diff --git a/AGENTS.md b/AGENTS.md index 33f66bc9..b95b6e69 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,46 +11,46 @@ pnpm build # build lib, vscode extension, and website ## Architecture -- **lib/** — Shared React + TailwindCSS frontend library (components, platform abstraction, tests, Storybook) -- **standalone/** — Tauri desktop app with Node.js sidecar for native PTY via node-pty -- **vscode-ext/** — VS Code extension wrapping the lib in a webview with native PTY backend -- **website/** — Marketing website bundling part of the lib as an interactive demo -- **server/** — Hono coordinating server for remote control: selfhost accounts + passkey auth, WebSocket relay between Pocket clients and Hosts, serves the built Pocket app -- **server-lib-common/** — Runtime-agnostic security primitives + wire contract shared by `server`, the Host module in `lib`, and the Pocket app - -## Project Structure - -- `lib/` — Core UI library (pnpm) — Storybook, tests, shared components -- `lib/src/lib/platform/` — Platform abstraction layer (`PlatformAdapter` interface, fake + VSCode adapters) -- `standalone/` — Tauri app (Rust + Vite frontend) -- `standalone/sidecar/` — Node.js PTY manager, bundled as Tauri sidecar -- `standalone/src-tauri/` — Rust backend that bridges webview ↔ Node.js sidecar -- `vscode-ext/` — VS Code extension (esbuild, node-pty via forked child process) -- `website/` — Marketing site (Vite, uses FakePtyAdapter for demo) -- `server/` — Selfhost server (Hono; accounts in local JSON files, no database) -- `server-lib-common/` — Shared security + wire contract (bare ES2022 — no DOM or Node types) -- `lib/src/remote/` — Remote control: `host/` (laptop side), `client/` (phone-side protocol + `RemotePtyAdapter`), `pocket-app/` (Pocket shell), `ws.ts` (shared socket surface) +- **`lib/`** — Shared React + TailwindCSS frontend library: components, tests, Storybook. + - `lib/src/lib/platform/` — platform abstraction (`PlatformAdapter` interface, fake + VSCode adapters) + - `lib/src/remote/` — remote control: `host/` (laptop side), `client/` (phone-side protocol + `RemotePtyAdapter`), `pocket-app/` (Pocket shell), `ws.ts` (shared socket surface) +- **`standalone/`** — Tauri desktop app (Rust + Vite frontend). + - `standalone/sidecar/` — Node.js PTY manager (native PTY via node-pty), bundled as the Tauri sidecar + - `standalone/src-tauri/` — Rust backend bridging webview ↔ sidecar +- **`vscode-ext/`** — VS Code extension wrapping the lib in a webview (esbuild; node-pty via forked child process) +- **`website/`** — Marketing site (Vite) bundling part of the lib as an interactive demo on `FakePtyAdapter` +- **`server/`** — Selfhost coordinating server for remote control (Hono): accounts + passkey auth in local JSON files (no database), WebSocket relay between Pocket clients and Hosts, serves the built Pocket app +- **`dor/`** — The `dor` CLI (stricli) staged onto the `PATH` of every Dormouse-launched terminal; talks to its host over a private control socket +- **`server-lib-common/`** — Security primitives + remote wire contract shared by `server`, the Host module in `lib`, and the Pocket app (bare ES2022 — no DOM or Node types) +- **`dor-lib-common/`** — Cross-platform external-process spawning (`spawnAndCapture`) shared by `dor` and the `lib` host. Despite the parallel names, the two `*-lib-common` packages are unrelated: `server-lib-common` is remote security/wire, `dor-lib-common` is spawn plumbing. ## Specs The primary job of a spec is to be an accurate reference for the current state of the code. Read the relevant spec before modifying a feature it covers — the spec describes invariants, edge cases, and design decisions that are not obvious from the code alone. -- **`docs/specs/glossary.md`** — Canonical vocabulary: the **Surface** model (a Pane's durable occupant — a terminal **Session** or a **browser** surface, with a per-kind axis table), Session states and layers (Process / Registry / View / Link / Activity / Snapshot), the `Window ⊃ Workspace ⊃ Pane ⊃ Surface` containment hierarchy and the Workspace union status, transition verbs, and the Liskov contract on Registry APIs. Read this first. Other specs defer to it when naming a state, a surface kind, or a verb. -- **`docs/specs/layout.md`** — Tiling layout, pane/door containers, dockview configuration, modes (passthrough/command), keyboard shortcuts, selection overlay, spatial navigation, minimize/reattach, inline rename, the standalone workspace strip (tabs, switching, lifecycle), session lifecycle, session persistence, and theming. Read this when touching: `Wall.tsx`, `Baseboard.tsx`, `Door.tsx`, `TerminalPane.tsx`, `standalone/src/AppBar.tsx`, `spatial-nav.ts`, `layout-snapshot.ts`, `terminal-registry.ts`, `session-save.ts`, `session-restore.ts`, `reconnect.ts`, `index.css`, `theme.css`, or any keyboard/navigation/mode/workspace behavior. -- **`docs/specs/dor-cli.md`** - the `dor` CLI which is prepended onto the path of every terminal that dormouse launches. -- **`docs/specs/dor-browser.md`** — The unified `dor` browser surface: a single `BrowserPanel` (`surfaceType: 'browser'`) with a swappable `renderMode` (`ab-screencast` / `ab-popout` / `iframe`). Covers the `dor ab` / `dor agent-browser` screencast viewer that delegates to the user's own agent-browser install (canvas screencast, input forwarding, tabs, pop-out modal) and the `dor iframe` renderer (an `