Service Layer
June 11, 2026 · View on GitHub
中文 | English
Service Layer
This layer owns reusable concrete implementations that touch local systems or runtime infrastructure: filesystem, git, file watch, terminal, MCP, remote connectivity, process lifecycle, MiniApp concrete runtime IO, and similar OS/network capabilities.
Modules
| Crate | Responsibility | Local doc |
|---|---|---|
services-core | Reusable local service primitives, filesystem helpers, session storage layout/indexing/deletion, metadata counter/index rules, and JSON file IO without product assembly decisions | AGENTS.md |
services-integrations | Concrete MCP, git, remote, file-watch, MiniApp runtime, and product-domain port implementations | AGENTS.md |
terminal | PTY, shell integration, and terminal session infrastructure | AGENTS.md |
Placement Rules
- Put concrete OS, process, filesystem, git, terminal, MCP, remote SSH, file-watch, MiniApp runtime IO, and network service implementations here.
- Implement
contracts,execution, orcontracts/product-domainsports here when the implementation needs concrete dependencies. - Keep protocol/transport projection in
adapters, and keep product capability selection inassembly.
Dependency Boundaries
- Services may depend on
contractsand narrowly on provider-neutral execution crates when implementing runtime ports. - Services must not depend on
assembly/core, interface crates, product UI code, or app command handlers. - Service-to-service dependencies must stay narrow; reusable contracts should
move to
contractsorexecutioninstead of creating broad coupling.