Adapter Layer

August 15, 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
agent-runtime-ipcNon-published private local IPC adapter for the opt-in first-party Shared TUI Runtime; closed interactive operations onlyAGENTS.md
ai-adaptersAI provider request/response adapters and stream protocol glueAGENTS.md
opencode-adapterOpenCode source semantics for user Instructions plus the live Command, standalone Tool, Subagent, MCP, and static Hook providers; managed-package static previewAGENTS.md
dsh-adapterDeepSeek Harness (dsh) bundle/profile source projection for managed packages; static preview onlyAGENTS.md
claude-code-adapterRuntime-free Claude Code user Instructions, Command, Subagent, MCP, and Hook source semantics with redacted projectionAGENTS.md
codex-adapterRuntime-free Codex user Instructions, Subagent, MCP, and Hook source semantics with redacted projectionAGENTS.md
static-hook-supportShared bounded/redacting static-source utilities plus the JSON/TOML Hook parser used by sibling ecosystem adapters; no ecosystem policy or runtimeinherited
transportEvent transport adapters plus protocol-neutral bounded JSON encoding and TypeScript message/JSON-RPC mechanics shared by current hostsAGENTS.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.
  • Do not create a shared API crate for a single host or a future protocol. A non-published pre-integration seam may remain crate-internal only when the adjacent design names its first consumer, stable test contract, integration check, and removal condition. Promote only the API used by that consumer.

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.