Core concepts

Terminal

Agents run in a real embedded terminal. Spec ADE supports three connection styles: Auggie and Claude over PTY, plus agents that speak ACP.

Two connection modes

ModeForMechanism
ptyAuggie · Claude CodeTerminal emulation via portable-pty, I/O over WebSocket
acpAgents speaking the Agent Client ProtocolA dedicated process with sequence-numbered events for replay

The WebSocket protocol

For PTY sessions, the frontend and backend exchange JSON messages over WebSocket:

Client → Server

typePayloadDescription
inputdata: stringRaw keystrokes
submitdata: stringLine content + Enter
resizecols, rowsTerminal resize

Server → Client

typePayloadDescription
outputdata: stringPTY stream data
readyAgent ready (bracketed paste)
exitcode: numberProcess exited
Ready detection

Spec ADE treats an agent as “ready” when the terminal enables bracketed paste mode. Input is gated until the ready signal arrives — preventing stray keystrokes.

ACP — Agent Client Protocol

ACP agents run in a dedicated process and communicate over an event channel. Each event carries a sequence number, so on reconnect the client sends ?after_seq=N and the backend replays missed events.

Scoped permissions

Filesystem operations are path-validated; sensitive requests require user approval.

Auto-reconnect

On WS close, client retries with exponential backoff (1s → 30s cap).