Expand description
A minimal client for the Codex app-server (#222).
Codex runs a local app-server daemon (codex app-server daemon) that owns
the user’s threads and exposes them on a Unix socket. The protocol is
JSON-RPC 2.0, one message per WebSocket text frame. This module speaks
exactly what the wake adapter needs: initialize, thread/read,
thread/resume, turn/start, and the notifications that follow. It is
a client only, and only over a local Unix socket the user owns: no TCP,
no TLS, no authentication of its own.
The WebSocket framing is written here rather than pulled in as a crate: the adapter needs text frames, ping, pong and close over one local socket, which is a few dozen lines, and a new dependency needs approval the feature does not justify.
Structs§
- AppServer
- A connected, initialised app-server client.
- RpcError
- A JSON-RPC error the app-server returned, kept apart from transport failures so the adapter can tell “Codex refused” from “Codex is gone”.
Functions§
- default_
socket - Where the Codex app-server daemon listens by default: under
$CODEX_HOME(else~/.codex), ascodex app-server daemon versionreports insocketPath. - thread_
status - A thread’s status as
thread/readandthread/status/changedreport it:notLoaded,idle,activeorsystemError.