@@ -15,24 +15,29 @@ Repository rule: **keep product logic platform-agnostic, then expose it through
1515
1616## Layered Module Index
1717
18- Dependencies flow top to bottom. A layer may depend on lower layers only; keep
19- crate dependencies inside each layer to the smallest set needed.
18+ Dependencies flow top to bottom. This table is the physical crate layout, not
19+ the full conceptual architecture. For Product Feature / Agent Kernel /
20+ Execution / Extension / Cross-platform Adapter boundaries, read
21+ [ ` docs/architecture/core-decomposition.md ` ] ( docs/architecture/core-decomposition.md ) .
22+ Keep crate dependencies inside each layer to the smallest set needed.
2023
2124| # | Layer | Path | Owns | Modules / entries | Layer doc |
2225| ---| ---| ---| ---| ---| ---|
2326| 1 | Interfaces and entrypoints | ` src/apps/* ` , ` src/web-ui ` , ` src/mobile-web ` , ` BitFun-Installer ` , ` tests/e2e ` , ` src/crates/interfaces ` | Product hosts, commands, UI entrypoints, protocol interfaces, and cross-surface tests | desktop, CLI, server, relay, Web UI, mobile web, installer, E2E, ` acp ` | nearest local ` AGENTS.md ` ; [ interfaces] ( src/crates/interfaces/AGENTS.md ) |
2427| 2 | Product assembly | ` src/crates/assembly ` | Compatibility exports, product capability selection, product-full wiring, and adapter/service registration | ` core ` , ` product-capabilities ` | [ AGENTS.md] ( src/crates/assembly/AGENTS.md ) |
2528| 3 | Adapters | ` src/crates/adapters ` | AI/API/transport/WebDriver protocol adapters and external-provider translation | ` ai-adapters ` , ` api-layer ` , ` transport ` , ` webdriver ` | [ AGENTS.md] ( src/crates/adapters/AGENTS.md ) |
26- | 4 | Services | ` src/crates/services ` | Reusable OS, filesystem, terminal, MCP, remote, git, watch, process, session persistence primitives, MiniApp runtime IO, and network implementations | ` services-core ` , ` services-integrations ` , ` terminal ` | [ AGENTS.md] ( src/crates/services/AGENTS.md ) |
29+ | 4 | Services | ` src/crates/services ` | Reusable OS, filesystem, terminal, MCP, remote, git, watch, process, LSP plugin registry, session persistence primitives, MiniApp runtime IO, and network implementations | ` services-core ` , ` services-integrations ` , ` terminal ` | [ AGENTS.md] ( src/crates/services/AGENTS.md ) |
2730| 5 | Execution primitives | ` src/crates/execution ` | Portable agent, harness, stream, DeepReview policy/report, typed-service, tool-contract, tool-group, and tool-execution building blocks | ` agent-runtime ` , ` agent-stream ` , ` tool-contracts ` , ` harness ` , ` runtime-services ` , ` tool-provider-groups ` , ` tool-execution ` | [ AGENTS.md] ( src/crates/execution/AGENTS.md ) |
28- | 6 | Stable contracts and product domains | ` src/crates/contracts ` | Shared DTOs, event shapes, runtime ports, and product domain contracts/policies | ` core-types ` , ` events ` , ` runtime-ports ` , ` product-domains ` | [ AGENTS.md] ( src/crates/contracts/AGENTS.md ) |
31+ | 6 | Stable contracts and product domains | ` src/crates/contracts ` | Shared DTOs, event shapes, runtime ports, LSP protocol/plugin DTOs, and product domain contracts/policies | ` core-types ` , ` events ` , ` runtime-ports ` , ` product-domains ` | [ AGENTS.md] ( src/crates/contracts/AGENTS.md ) |
2932
3033Boundary rules:
3134
3235- Interfaces and app entrypoints expose selected product behavior; reusable behavior moves down.
3336- Assembly wires lower layers and selects product capability facts; it must not implement concrete adapter, OS, or service details.
34- - Adapters translate protocols and external systems; they should not own product capability selection or reusable OS service behavior.
35- - Services implement reusable concrete OS, process, terminal, MCP, remote, git, filesystem, and MiniApp runtime IO capabilities.
37+ - Product features assemble user-facing commands, UI contributions, settings, and default policy on top of kernel capabilities; long-running task, scheduler, permission, session/workspace, memory, DFX, hook, and event facts stay in Agent Kernel owners.
38+ - Adapters translate protocols and external-provider shapes; they should not own product capability selection or reusable OS service behavior.
39+ - Services implement reusable concrete OS, process, terminal, MCP, remote, git, filesystem, LSP plugin registry, and MiniApp runtime IO capabilities.
40+ - External systems are boundary resources, not repository layers. Only registered adapters/services/app-local providers should call them; other layers consume ports and stable contracts.
3641- Execution crates are portable runtime building blocks, not host-specific or delivery-profile owners.
3742- Contracts stay behavior-light and must not depend upward.
3843
0 commit comments