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
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§

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
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.