Skip to content

Reference 索引

Reference 概述

docs/reference/ 是 devkit-pi 的查表型、契约型文档目录。这里记录当前已实现的 public surface、配置、工具参数、返回结构、错误/失败语义和稳定性边界。

Reference 文档不是教程,也不记录 roadmap。若 proposal、ADR 或 archive 与 reference 不一致,以当前 src/tests/ 和本目录 reference 为准。

架构一致性策略

当前 public contracts 优先考虑结构一致性,而不是保留旧的内部布局。当模块、工具、提供者、命令或功能区域承担类似角色时,reference 文档应使用对齐的命名、配置、schema、错误、测试和文档模式,除非存在已记录的例外。

这意味着 legacy flat configuration fields、旧目录布局或一次性 command/provider 结构不会仅为了兼容而保留;当它们与当前模块化架构冲突时,应以当前架构为准。

相关指南

维护者专用的架构、测试、发布、ADR、规划、归档、问题日志和审计文档位于 internal-docs/,刻意不进入公开网站导航。

核心 References

配置

subagents.allowWrite 是实验性的,不属于稳定写入能力契约;它不提供完整沙箱、审计日志或回滚保证。详见 configuration.mdsubagents.md安全模型

文档适合什么时候读Canonical source
configuration.md配置 devkit-pi、核对默认值和 normalize 规则src/config/load-config.ts, src/shared/types.ts

Subagents

文档适合什么时候读Canonical source
subagents.md理解 Subagents 模块 public surface、执行模型和边界src/modules/subagents/, agents/, src/shared/delegation-policy.ts
subagent-tool.md调用 subagent tool、查看输入/输出/失败语义src/modules/subagents/register.ts, schemas.ts, executor.ts
agent-definition.md编写 built-in/user/project agent markdown 定义src/modules/subagents/agents.ts, frontmatter.ts, agents/*.md
result-schema.md程序化理解 subagent tool result 与错误码src/modules/subagents/executor.ts, collect-output.ts, src/shared/types.ts

Web tools

文档适合什么时候读Canonical source
web-tools.md调用 web_searchfetch_contentget_search_contentsrc/modules/web/register.ts, schemas.ts, types.ts, search.ts, fetch.ts, storage.ts
convert-tools.md调用 convert_content 转换本地文件或安全下载的远程文件src/modules/convert/, src/config/load-config.ts
web-providers.md配置/选择 ddgs、brave、tavily、serper、openserp、searxngsrc/modules/web/providers/, src/modules/web/providers/select-provider.ts
web-tools-error-codes.md判断 Web tool structured errors 和 reserved/deprecated code 边界src/modules/web/errors.ts, src/modules/web/types.ts

LSP tools

文档适合什么时候读Canonical source
lsp-tools.md调用 lsp tool、理解 diagnostics hook 和 action 权限src/modules/lsp/register.ts, tool.ts, schemas.ts, hook.ts

Toolkit commands

文档适合什么时候读Canonical source
toolkit-commands.md使用 /toolkit 诊断、查看 modules/agents/logs/LSP 状态src/modules/commands/register.ts, src/modules/subagents/commands/

Schemas 和契约

文档适合什么时候读Canonical source
result-schema.md查看 subagent tool result 的结构化字段src/shared/types.ts, src/modules/subagents/executor.ts
web-tools-error-codes.md查看 Web canonical error code、active/reserved/deprecated 状态src/modules/web/errors.ts
configuration.md查看配置 schema-like defaults 和 normalize 行为src/config/load-config.ts

Canonical source 策略

稳定性策略

subagents.allowWrite 不属于稳定写入能力契约;当前只作为 experimental / advanced / unsafe 配置入口记录在 configuration.mdsubagents.md

相对稳定:

  • Public tool names:subagentweb_searchfetch_contentget_search_contentlspconvert_content
  • Public command root/subcommands:/toolkitdoctormoduleslogsagentslspactivityhelp
  • 文档中明确列出的 input schema 字段
  • 文档中明确列出的 output contract / structured error code
  • 当前 canonical error code 字符串值

可能变化:

  • Internal helpers、formatters、manager classes 和 provider parser 实现细节
  • Human-readable logs、console output、TUI rendering 和 notification 文案
  • Agent prompt wording、delegation policy examples 和 markdown 输出模板
  • Session file 布局、streaming display item 细节、sanitize/truncate 具体规则
  • Reserved error codes 的启用时机和 proposed behavior

Reserved error codes / proposed behavior 不代表当前会直接返回或执行。若需要把 proposed 能力变成 public reference,应先在源码和测试中实现,再更新 reference。