Tools Reference
19 个内置工具。源头:crates/tools/src/lib.rs(4645
行)。分发入口 execute_tool(name, input) 在
tools.rs:548–573;注册表 ToolRegistry 在
tools.rs:35–49。
工具清单
| 工具 | 作用 | 权限 | 关键入参 | 副作用 | Cite |
|---|---|---|---|---|---|
bash |
执行 shell 命令 | DangerFullAccess |
command、timeout?、description?、run_in_background?、dangerouslyDisableSandbox? |
子进程、文件、网络 | tools.rs:228–243 |
read_file |
读文本文件 | ReadOnly |
path、offset?、limit? |
文件读 | tools.rs:245–258 |
write_file |
写文本文件 | WorkspaceWrite |
path、content |
文件写(自动建父目录) | tools.rs:260–272 |
edit_file |
文件内查找替换 | WorkspaceWrite |
path、old_string、new_string、replace_all? |
文件读+写 | tools.rs:274–288 |
glob_search |
Glob 找文件 | ReadOnly |
pattern、path? |
文件读 | tools.rs:290–302 |
grep_search |
正则搜内容 | ReadOnly |
pattern、path?、glob?、-A/-B/-C、-n/-i、type?、head_limit?、multiline?、output_mode? |
文件读 | tools.rs:304–328 |
WebFetch |
抓 URL,HTML 转文本后回答 prompt | ReadOnly |
url、prompt |
网络;20 秒超时,最多 10 次跳转,除 localhost 外自动升级到 https | tools.rs:330–343 |
WebSearch |
DuckDuckGo 搜索 | ReadOnly |
query(至少 2
字符)、allowed_domains?、blocked_domains? |
网络;可用 DSCC_WEB_SEARCH_BASE_URL 覆盖,20
秒超时,最多 8 条结果 |
tools.rs:345–364 |
TodoWrite |
更新会话任务列表 | WorkspaceWrite |
todos[](每项含
content、activeForm、status: pending|in_progress|completed) |
写 .dscc-todos.json 或
DSCC_TODO_STORE |
tools.rs:366–392 |
Skill |
加载 skill 定义 | ReadOnly |
skill、args? |
文件读 | tools.rs:394–406 |
Agent |
启动子 agent | DangerFullAccess |
description、prompt、subagent_type?、name?、model? |
后台线程、API 调用、.dscc-agents/ 产物 |
tools.rs:408–423 |
ToolSearch |
查找延迟加载的工具 | ReadOnly |
query、max_results? |
文件读 | tools.rs:425–437 |
NotebookEdit |
替换 / 插入 / 删除 Jupyter cell | WorkspaceWrite |
notebook_path、cell_id?、new_source?、cell_type?、edit_mode? |
文件读+写 | tools.rs:439–454 |
Sleep |
阻塞 sleep | ReadOnly |
duration_ms |
线程 sleep | tools.rs:456–467 |
SendUserMessage / Brief |
发送带附件的消息 | ReadOnly |
message、attachments?、status? |
文件读 | tools.rs:469–488 |
Config |
读写 DSCC 设置 | WorkspaceWrite |
setting、value? |
文件读+写(~/.dscc/settings.json 或
.dscc/settings.local.json) |
tools.rs:490–504 |
StructuredOutput |
返回任意结构化 JSON | ReadOnly |
任意对象 | 无 | tools.rs:506–513 |
REPL |
子进程跑代码 | DangerFullAccess |
code、language(python/node/bash/sh)、timeout_ms? |
子进程 | tools.rs:515–528 |
PowerShell |
执行 PowerShell | DangerFullAccess |
command、timeout?、description?、run_in_background? |
子进程(Windows) | tools.rs:530–544 |
Agent 子类型
定义在 tools.rs:1687–1766,通过 Agent
工具的 subagent_type? 选择。
| 类型 | 工具白名单 |
|---|---|
Explore |
read_file、glob_search、grep_search、WebFetch、WebSearch、ToolSearch、Skill、StructuredOutput |
Plan |
Explore 集合 + TodoWrite +
SendUserMessage(不含 bash /
edit) |
Verification |
bash、PowerShell、TodoWrite、SendUserMessage、读类工具 |
dscc-guide |
Explore 集合 + SendUserMessage |
statusline-setup |
bash、read_file、write_file、edit_file、glob_search、grep_search、ToolSearch |
general-purpose (默认) |
全部工具 |