Adapter Layer

June 5, 2026 · View on GitHub

中文 | English

Adapter Layer

This layer owns protocol, transport, external-provider, and host-facing adapter crates. Adapters translate between product/runtime contracts and concrete protocols; they should not become owners of product policy or reusable OS services.

Modules

CrateResponsibilityLocal doc
ai-adaptersAI provider request/response adapters and stream protocol glueAGENTS.md
api-layerBackend API adapter surface shared by product hostsAGENTS.md
transportEvent transport emitters and host transport adaptersAGENTS.md
webdriverEmbedded WebDriver protocol and browser automation adapterAGENTS.md

Placement Rules

  • Put protocol serialization, transport projection, external provider request shaping, and host communication adapters here.
  • Keep OS, filesystem, terminal, MCP, remote, git, and watch implementations in services unless the code is purely protocol translation.
  • Keep delivery-profile selection and adapter registration in assembly.

Dependency Boundaries

  • Adapters may depend on contracts, execution, and narrowly on services when an adapter must expose a service capability through a protocol.
  • Adapters must not depend on assembly/core, product UI code, app command handlers, or Tauri APIs unless the crate is explicitly feature-gated for that host boundary.
  • Prefer stable contracts over adapter-to-adapter coupling. Cross-adapter dependencies require a clear boundary reason.