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
- 極簡 ANSI/escape 序列過濾器。
- claude
- Native adapter for Claude Code (
--input-format stream-json --output-format stream-json). - codex
- Native adapter for Codex (
codex app-server). - models
- 各 agent 可選的 model 清單:Claude 內建,其他 agent 向各自 CLI 查詢。TUI 與 daemon (網頁版) 共用。
- pty
- PTY passthrough adapter.
- question
- Shared interactive user question normalization across diverse agents.
- stderr
- 子處理程序 stderr 的收集:固定大小的環狀緩衝,只留最後幾行。
- stream
- 串流文字的行緩衝。
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.
- 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.