Skip to content

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

  1. Implement Tool in crates/tools (or a submodule).
  2. Register in crates/tools/src/registry.rs — follow the checklist comment at the top of that file (ins!, DEFAULT_TOOL_IDS, tests).
  3. If the tool is sensitive (writes files, spawns sub-agents, etc.), add its API name to SECURITY_SENSITIVE_TOOL_IDS in crates/tools/src/catalog.rs so bootstrap can register SecurityLayer policies consistently.
  4. Run cargo test -p anycode-tools and cargo test --workspace.

New LLM provider or transport

  1. Implement LLMClient in crates/llm (see existing providers under crates/llm/src/providers/).
  2. Wire routing in transport_for_provider_id / MultiProviderLlmClient as appropriate (crates/llm/src/lib.rs, provider_catalog.rs).
  3. Add or extend tests under crates/llm.

New channel (WeChat / web / …)

  1. Implement ChannelHandler from anycode-core in crates/channels.
  2. The main CLI path may not depend on channels yet; integrate at the composition root (crates/cli) when adding a user-facing entrypoint.

Memory backends and pipeline

  • File / hybrid / noop: configured via CLI bootstrapbuild_memory_layer (crates/cli/src/bootstrap/mod.rs).
  • Pipeline (vector + optional embedding): types in crates/core/src/memory_pipeline.rs, implementation crates/memory. See docs/adr/001-memory-pipeline-and-store.md.

Quick navigation

GoalFirst file to open
Tool registrycrates/tools/src/registry.rs
Tool catalog / sensitive IDscrates/tools/src/catalog.rs
Runtime assemblycrates/cli/src/bootstrap/runtime.rs
Agent loopcrates/agent/src/runtime/session.rs, mod.rs

MIT License