Skip to main content

Module codex

Module codex 

Source
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), as codex app-server daemon version reports in socketPath.
thread_status
A thread’s status as thread/read and thread/status/changed report it: notLoaded, idle, active or systemError.