Contributing extensions
This page lists where to change code for common extensions. For layering rules and orchestration authority, see Architecture. For ADR-style decisions (e.g. AgentRuntime as the only orchestration path), see the repo folder docs/adr/.
New default tool
- Implement
Toolincrates/tools(or a submodule). - Register in
crates/tools/src/registry.rs— follow the checklist comment at the top of that file (ins!,DEFAULT_TOOL_IDS, tests). - If the tool is sensitive (writes files, spawns sub-agents, etc.), add its API name to
SECURITY_SENSITIVE_TOOL_IDSincrates/tools/src/catalog.rssobootstrapcan registerSecurityLayerpolicies consistently. - Run
cargo test -p anycode-toolsandcargo test --workspace.
New LLM provider or transport
- Implement
LLMClientincrates/llm(see existing providers undercrates/llm/src/providers/). - Wire routing in
transport_for_provider_id/MultiProviderLlmClientas appropriate (crates/llm/src/lib.rs,provider_catalog.rs). - Add or extend tests under
crates/llm.
New channel (WeChat / web / …)
- Implement
ChannelHandlerfromanycode-coreincrates/channels. - The main CLI path may not depend on
channelsyet; integrate at the composition root (crates/cli) when adding a user-facing entrypoint.
Memory backends and pipeline
- File / hybrid / noop: configured via CLI
bootstrap→build_memory_layer(crates/cli/src/bootstrap/mod.rs). - Pipeline (vector + optional embedding): types in
crates/core/src/memory_pipeline.rs, implementationcrates/memory. Seedocs/adr/001-memory-pipeline-and-store.md.
Quick navigation
| Goal | First file to open |
|---|---|
| Tool registry | crates/tools/src/registry.rs |
| Tool catalog / sensitive IDs | crates/tools/src/catalog.rs |
| Runtime assembly | crates/cli/src/bootstrap/runtime.rs |
| Agent loop | crates/agent/src/runtime/session.rs, mod.rs |
