工具层重构:工具清单入树 + 受管调用;python/shell 下沉 stdlib - #74
Merged
Merged
Conversation
agent 工具能力下沉到 kvlang 的 stdlib/networld(shell / python / edit),
byteseek 只留「策略与记账」这一层:
- **删 lib/byteseek/{python,shell}.kv** —— 实现在 stdlib networld 里了
- **新增 lib/byteseek/tool.kv**(受管工具):prepare(参数校验)→ 闸门
(before_hook,policy/deny 命中即拒)→ 调 stdlib 工具 → 每次调用记账
到 /byteseek/toolcall/<n>。只覆盖改写类(edit·write/replace/multi);
只读工具直接调 stdlib。返回码沿用 stdlib,另有 8=denied、9=arg。
- **新增 lib/byteseek/tools.kv**(工具清单即 KV 数据):工具声明写进
/byteseek/tools/,system prompt 的工具清单由 tools·manifest() 从树里生成,
不再在 prompt.kv 手写——新增工具 = 往树里写一条。
- main / llm / prompt / memory / memgen 配套调整。
Co-Authored-By: Claude Code <noreply@anthropic.com>
- tests/selftest.kv:覆盖 tool 层新语义(RUN/FAILKIND/TRUNC/RUNTIME/ TOOLS/REC/DENIED=8/ALLOWED=0/ARG=9/TOOLCALL/EDIT) - Makefile:test 目标同步这些断言;另加一步 **repl 冒烟**—— 管道喂 hi/exit 跑 byteseek·main,要求出现 "bye." 且全程无 TypeError Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
agent 工具能力下沉到 kvlang 的 stdlib/networld(shell / python / edit),byteseek 只留「策略与记账」。
1. 工具层
lib/byteseek/{python,shell}.kv—— 实现在 stdlib networld 里了lib/byteseek/tool.kv(受管工具):prepare(参数校验)→ 闸门(policy/deny命中即拒)→ 调 stdlib 工具 → 每次调用记账到/byteseek/toolcall/<n>。只覆盖改写类(edit·write/replace/multi);只读工具直接调 stdlib。返回码沿用 stdlib,另有8=denied、9=arg。lib/byteseek/tools.kv(工具清单即 KV 数据):工具声明写进/byteseek/tools/,system prompt 的工具清单由tools·manifest()从树里生成 —— 不再在prompt.kv手写;新增工具 = 往树里写一条。main/llm/prompt/memory/memgen配套调整。2. 自检
tests/selftest.kv:覆盖 tool 层新语义(RUN / FAILKIND / TRUNC / RUNTIME / TOOLS / REC / DENIED=8 / ALLOWED=0 / ARG=9 / TOOLCALL / EDIT)Makefile:断言同步;另加一步 repl 冒烟 —— 管道喂hi/exit跑byteseek·main,要求输出bye.且全程无TypeError🤖 Generated with Claude Code