Skip to content

扩展与贡献清单

本文列出常见扩展应修改的代码位置。分层与编排权威见 架构。具体设计决策(例如仅 AgentRuntime 负责多轮编排)见仓库内 docs/adr/(不参与 VitePress 构建)。

新增默认工具

  1. crates/tools 中实现 anycode_core::traits::Tool
  2. crates/tools/src/registry.rs 注册 —— 遵守文件顶部 checklistins!DEFAULT_TOOL_IDS、测试等)。
  3. 若工具涉及写盘、子 Agent、网络等敏感能力,在 crates/tools/src/catalog.rsSECURITY_SENSITIVE_TOOL_IDS 中登记,以便 bootstrap 统一注册 SecurityLayer 策略。
  4. 运行 cargo test -p anycode-toolscargo test --workspace

新 LLM 提供商或传输方式

  1. crates/llm 实现 LLMClient(可参考 crates/llm/src/providers/)。
  2. transport_for_provider_id / MultiProviderLlmClient 等处接入路由(lib.rsprovider_catalog.rs 等)。
  3. crates/llm 补充测试。

新通道(微信 / Web 等)

  1. crates/channels 实现 ChannelHandler
  2. 主 CLI 未必已依赖 channels;在用户可见入口就绪时于 crates/cli 组合根接线。

记忆后端与 pipeline

  • file / hybrid / noop:由 CLI bootstrapbuild_memory_layer 配置(crates/cli/src/bootstrap/mod.rs)。
  • pipeline(向量与可选 embedding):领域类型见 crates/core/src/memory_pipeline.rs,实现见 crates/memory。详见 ADR 001

速查表

目标优先打开的文件
工具注册crates/tools/src/registry.rs
目录与敏感工具 IDcrates/tools/src/catalog.rs
运行时组装crates/cli/src/bootstrap/runtime.rs
Agent 多轮循环crates/agent/src/runtime/session.rsmod.rs

MIT License