Expand description
ertangle-adapter — Normalization layer for diverse agents.
Protocols for each agent (ACP, stream-json, app-server, PTY) are translated here into
a uniform set of AgentEvents, so layers above the daemon do not need to know which agent is underneath.
Structured adapters (native, zero extra dependencies):
acp: Agent Client Protocol — OpenCode (opencode acp), Antigravity (agy acp).claude: Claude Code’s--input-format/--output-format stream-json.codex: Codex’scodex app-server(stdio JSON-RPC).
Universal fallback:
pty: PTY passthrough, works for any CLI agent.
Modules§
- acp
- Native Agent Client Protocol adapter.
- ansi
- Minimal ANSI/escape sequence stripper.
- claude
- Native adapter for Claude Code (
--input-format stream-json --output-format stream-json). - codex
- Native adapter for Codex (
codex app-server). - models
- Available model lists per agent: built-in for Claude, queried from each CLI for others. Shared by TUI and daemon (Web UI).
- pty
- PTY passthrough adapter.
- question
- Shared interactive user question normalization across diverse agents.
- stderr
- Child process stderr collection: a fixed-size ring buffer keeping only the last few lines.
- stream
- Line buffering for streaming text.
Structs§
- Session
Spec - All information required to launch a session.
Enums§
- Agent
Event - Events sent upward after normalization by the adapter.
Constants§
- EFFORT_
LEVELS - Valid reasoning effort levels.
Traits§
- Agent
Control - Control handle for a running session.
Functions§
- agent_
bin - Finds the agent executable: checks environment variable override first (for testing and custom installs), then searches PATH.
- check_
effort - Checks if an effort value is valid.
- env_
removals - Environment variables to remove before launching the agent.
- is_
installed - Checks whether the corresponding structured agent binary is installed in local
$PATH. - signal_
pgid - Sends a Unix signal (e.g.
-STOP/-CONT/-KILL) to a specific process group (PGID). - signal_
pid - Sends a Unix signal (e.g.
-STOP/-CONT) to a specific PID. - spawn
- Starts a session and returns a control handle; events stream through
tx. - supports_
structured - Whether this agent has a native structured protocol available.
- which
- Probes whether an executable exists and returns its absolute path.