03 · Map

Components & architecture

The modules and their build status. The how lives in the engineering spec — this is role + status + link. Architecture diagram is canonical there: engg §02 → (not redrawn here).

bin/cli.js — CLI entry

verified

Resolves the doc, local default and launch override, starts the loopback server, and reports the URL. engg →

src/server.js — HTTP · SSE · file-watch · toolbar inject

verified

Owns authenticated requests, one global provider-tagged turn lifecycle, byte-truth snapshots and undo, and page/client-scoped reloads. source →

src/path-policy.js — shared repository serve · mutation boundary

verified

Classifies repository-relative paths and rechecks canonical aliases after realpath resolution. source →

provider registry + Claude Code and Codex adapters

verified

The internal static registry validates availability and dispatches claude -p or controlled codex exec; adapters normalize frames while the versioned store scopes resume IDs by page/provider. engg →

public/sp-client.js + toolbar.js + .css — the on-page surface

verified

Centralizes authenticated transport, explicit provider selection/default/reset, separate transcripts, sparse usage, truthful completion/undo, serialized Hands transactions, exact rollback, and accessibility. source →

test/ — Node integration + Chromium browser suites

verified

Node integration and Chromium browser suites exercise the real server with a deterministic fake runner and no live model call. browser suite →

Glossary

data-cid

Stable per-block anchor that survives regeneration; the brain's link target and the unit of scoping. how it resolves →

stream-json

A provider's headless NDJSON event stream; each adapter maps native events to provider-tagged status, reply, edit, usage, warning, and terminal frames. event map →

the bridge

The local server that dispatches the selected Claude Code or Codex adapter and lets the page act on the doc — a dumb pipe with server-owned byte truth. engg →

mouth · eyes · hands

The division of labor: terminal = the mouth (steer); browser = the eyes (this brain) + hands (act in place).