From 47056f72bfb1d47d7c693cf517c7457f70005ec1 Mon Sep 17 00:00:00 2001 From: "peng.li24" <734991033@qq.com> Date: Wed, 2 Sep 2026 12:30:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20internet=20=E2=86=92=20networld?= =?UTF-8?q?=EF=BC=88networld/proc=C2=B7exec=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- doc/substrate.md | 8 ++++---- lib/byteseek/python.kv | 2 +- lib/byteseek/shell.kv | 4 ++-- tests/selftest.kv | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/substrate.md b/doc/substrate.md index 4595587..02072a2 100644 --- a/doc/substrate.md +++ b/doc/substrate.md @@ -109,18 +109,18 @@ byteseek 不再注册任何自有 Rust rwir。所需能力全部是 kvlang 标 | `json·to` / `json·from` | 标准 json rwir | | `http·call(method,header,url,body) -> resp` | 标准 http rwir | | `kvlanglayout·vet / ·format / ·layout / ·dump` | 标准 layout rwir | -| `internet/proc·exec(args,envs) -> code, out, err` | 标准 internet rwir(子进程 + 捕获 @ 句柄) | +| `networld/proc·exec(args,envs) -> code, out, err` | 标准 networld rwir(子进程 + 捕获 @ 句柄) | | `vthread·call(funckey)` | native builtin(同 vid 动态调用) | | `string·* / kv·* / xv·*` | native builtin | `shell·run` / `python·run` 是 `lib/` 下的 kv rwfunc:把命令包成 `{"bash","-c",cmd}` / -`{"python3","-c",code}` 交给 `internet/proc·exec`,绑定 stdout/stderr 写槽即捕获(`@[]uint8` -扩展句柄,`println` 读时按 body 前缀 `/internet/{host}/proc` 路由回兑现物理字节),返回 stdout。 +`{"python3","-c",code}` 交给 `networld/proc·exec`,绑定 stdout/stderr 写槽即捕获(`@[]uint8` +扩展句柄,`println` 读时按 body 前缀 `/networld/{host}/proc` 路由回兑现物理字节),返回 stdout。 ## 已验证(0rs) - `KVLANG_LIB=lib kvlang` 引导:config/语法速览/系统提示三 init 于 layout 期种入,rwfunc 持久。 - `kvlang byteseek·main`:REPL 循环、`exit` 退出、无 key 时 `llm·call` 回填 error 且 `byteseek·run` 跳过。 - `byteseek·run(entry)` → `vthread·call`:同 vid 动态执行入库的 session 程序,其内 rwir 就地派发。 -- `shell·run` / `python·run`:经 `internet/proc·exec` 捕获子进程 stdout 并透明兑现。 +- `shell·run` / `python·run`:经 `networld/proc·exec` 捕获子进程 stdout 并透明兑现。 - `make test`(无网络无 LLM,shm 后端):vet + session 执行 + shell/python 捕获全链路通过。 diff --git a/lib/byteseek/python.kv b/lib/byteseek/python.kv index 2a41859..d36163d 100644 --- a/lib/byteseek/python.kv +++ b/lib/byteseek/python.kv @@ -5,7 +5,7 @@ lib python { println("🔧 python:", code) noenv = map() a = {"python3", "-c", code} - internet/proc·exec(a, noenv) -> ret, o, e + networld/proc·exec(a, noenv) -> ret, o, e println("↳", o, e) o -> out } diff --git a/lib/byteseek/shell.kv b/lib/byteseek/shell.kv index 5244617..687d515 100644 --- a/lib/byteseek/shell.kv +++ b/lib/byteseek/shell.kv @@ -1,12 +1,12 @@ # shell·run(cmd) -> out:跑一段 bash,返回 stdout(@ 句柄,读时兑现)。 -# 绑定 out/err 写槽 → internet/proc·exec 管道捕获两流;就地打印工具头与两流后返回 stdout。 +# 绑定 out/err 写槽 → networld/proc·exec 管道捕获两流;就地打印工具头与两流后返回 stdout。 lib shell { rwfunc run(cmd:[]char/utf32) -> (out:[]char/utf32) { println("🔧 shell:", cmd) noenv = map() a = {"bash", "-c", cmd} - internet/proc·exec(a, noenv) -> code, o, e + networld/proc·exec(a, noenv) -> code, o, e println("↳", o, e) o -> out } diff --git a/tests/selftest.kv b/tests/selftest.kv index d268468..4a957a3 100644 --- a/tests/selftest.kv +++ b/tests/selftest.kv @@ -1,6 +1,6 @@ # byteseek 自检(无网络、无 LLM):验证全 kvlang 主脑的执行链—— # byteseek·run(entry) → vthread·call 在当前 vthread 动态执行生成程序; -# shell·run / python·run 经 internet/proc·exec 捕获子进程 stdout。 +# shell·run / python·run 经 networld/proc·exec 捕获子进程 stdout。 # 先 boot byteseek 库(KVLANG_LIB=lib kvlang),再 layout 本文件,最后 run selftest·go。 # 期望输出: # vet(good)= ok