Skip to main content

Crate ertangle_adapter

Crate ertangle_adapter 

Source
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’s codex 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§

SessionSpec
All information required to launch a session.

Enums§

AgentEvent
Events sent upward after normalization by the adapter.

Constants§

EFFORT_LEVELS
Valid reasoning effort levels.

Traits§

AgentControl
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
啟動該 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.