feat(skills): WASM host 函数真实实现 — zclaw_log/http_fetch/file_read (Phase 4B)

替换 stub 为真实实现:
- zclaw_log: 读取 guest 内存并 log
- zclaw_http_fetch: ureq v3 同步 GET (10s timeout, network_allowed 守卫)
- zclaw_file_read: 沙箱 /workspace 目录读取 (路径校验防逃逸)
添加 ureq v3 workspace 依赖, 25 测试全通过。
This commit is contained in:
iven
2026-04-18 08:18:08 +08:00
parent 2037809196
commit a685e97b17
4 changed files with 143 additions and 20 deletions

View File

@@ -9,7 +9,7 @@ description = "ZCLAW skill system"
[features]
default = []
wasm = ["wasmtime", "wasmtime-wasi/p1"]
wasm = ["wasmtime", "wasmtime-wasi/p1", "ureq"]
[dependencies]
zclaw-types = { workspace = true }
@@ -27,3 +27,4 @@ shlex = { workspace = true }
# Optional WASM runtime (enable with --features wasm)
wasmtime = { workspace = true, optional = true }
wasmtime-wasi = { workspace = true, optional = true }
ureq = { workspace = true, optional = true }