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

CrateResponsibilityLocal doc
services-coreReusable local service primitives, filesystem helpers, session storage layout/indexing/deletion, metadata counter/index rules, and JSON file IO without product assembly decisionsAGENTS.md
services-integrationsConcrete MCP, git, remote, file-watch, MiniApp runtime, and product-domain port implementationsAGENTS.md
terminalPTY, shell integration, and terminal session infrastructureAGENTS.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, or contracts/product-domains ports here when the implementation needs concrete dependencies.
  • Keep protocol/transport projection in adapters, and keep product capability selection in assembly.

Dependency Boundaries

  • Services may depend on contracts and 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 contracts or execution instead of creating broad coupling.