| name | codex-jsonrpc |
| description | Implement or debug the CodexMonitor remote backend daemon and client using the JSON-over-TCP, line-delimited JSON-RPC-ish protocol. Use when building the TypeScript/Node.js daemon, wiring Codex app-server proxy methods, auth handshake, workspace/worktree management, or the matching client. |
Codex JSON-RPC Daemon
Overview
Use this skill to implement a TypeScript/Node.js remote backend daemon and client that are protocol-compatible with the Rust CodexMonitor implementation. The full specification is in references/codex-jsonrpc-typescript-spec.md.
Implementation workflow
- Implement TCP server with line-delimited JSON framing.
- Add auth gating (
auth first) and error responses.
- Implement workspace/worktree CRUD and persistence.
- Spawn and proxy
codex app-server sessions per workspace.
- Broadcast app-server events to all authenticated clients.
- Implement the TypeScript client wrapper for calls and notifications.
- Verify method names, params, and error messages match spec.
Protocol checklist
- One JSON object per line; ignore blank or invalid JSON.
- No response if request has no numeric
id.
- Responses are
{id,result} or {id,error:{message}} with exact messages.
- Notifications:
app-server-event (snake workspace_id) and optional terminal-output.
Codex app-server proxy rules
- Initialize app-server on spawn and emit
codex/connected event.
- Map accessMode to sandboxPolicy and approvalPolicy exactly.
- Proxy thread/turn/review/model/skills methods as raw JSON.
Persistence
workspaces.json and settings.json in dataDir.
- Atomic writes after each mutation.
References
references/codex-jsonrpc-typescript-spec.md contains the full spec.