townmouse 0.0.0-stage → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/DESIGN.md +169 -0
  3. package/LICENSE +661 -0
  4. package/README.md +368 -2
  5. package/SECURITY.md +57 -0
  6. package/TOWNMOUSE.md +91 -0
  7. package/assets/brand/mascot/README.md +23 -0
  8. package/assets/brand/mascot/townmouse-aristocrat.png +0 -0
  9. package/assets/brand/mascot/townmouse-icon.svg +1 -0
  10. package/assets/brand/mascot/townmouse-monocled.png +0 -0
  11. package/bin/townmouse +68 -0
  12. package/docs/PACKAGING.md +275 -0
  13. package/docs/browser-workspace.md +184 -0
  14. package/docs/panes.md +252 -0
  15. package/native/TownmouseApp.swift +108 -0
  16. package/package.json +89 -4
  17. package/public/apple-touch-icon.png +0 -0
  18. package/public/brand/floydslabs-credit.png +0 -0
  19. package/public/brand/floydslabs-credit.webp +0 -0
  20. package/public/brand/townmouse-aristocrat.webp +0 -0
  21. package/public/brand/townmouse-monocled.webp +0 -0
  22. package/public/clipboard-text.mjs +5 -0
  23. package/public/favicon-16x16.png +0 -0
  24. package/public/favicon-32x32.png +0 -0
  25. package/public/favicon.ico +0 -0
  26. package/public/favicon.svg +1 -0
  27. package/public/features/autosave.mjs +76 -0
  28. package/public/features/clipboard.mjs +69 -0
  29. package/public/features/command-palette.mjs +181 -0
  30. package/public/features/desktop-palette.mjs +19 -0
  31. package/public/features/export.mjs +37 -0
  32. package/public/features/file-drop.mjs +77 -0
  33. package/public/features/floating-palette.mjs +113 -0
  34. package/public/features/fontsize.mjs +72 -0
  35. package/public/features/haptic-keys.mjs +42 -0
  36. package/public/features/history-undo.mjs +102 -0
  37. package/public/features/keepalive.mjs +36 -0
  38. package/public/features/keybar-config.mjs +70 -0
  39. package/public/features/keyboard-shortcuts.mjs +74 -0
  40. package/public/features/links.mjs +139 -0
  41. package/public/features/multi-window-sync.mjs +74 -0
  42. package/public/features/osc-bridge.mjs +59 -0
  43. package/public/features/phone-landscape-focus.mjs +157 -0
  44. package/public/features/recent-commands.mjs +100 -0
  45. package/public/features/search.mjs +134 -0
  46. package/public/features/session-lock.mjs +96 -0
  47. package/public/features/session-manager.mjs +149 -0
  48. package/public/features/settings-sync.mjs +77 -0
  49. package/public/features/shortcut-help.mjs +85 -0
  50. package/public/features/smart-completions.mjs +101 -0
  51. package/public/features/smart-suggest.mjs +124 -0
  52. package/public/features/snippets.mjs +85 -0
  53. package/public/features/split-view.mjs +102 -0
  54. package/public/features/status-metrics.mjs +114 -0
  55. package/public/features/stylus-support.mjs +124 -0
  56. package/public/features/swipe-history.mjs +141 -0
  57. package/public/features/swipe-sessions.mjs +85 -0
  58. package/public/features/tab-reorder.mjs +62 -0
  59. package/public/features/theme-system.mjs +51 -0
  60. package/public/features/toast-status.mjs +118 -0
  61. package/public/features/two-finger-menu.mjs +87 -0
  62. package/public/features/voice-input.mjs +244 -0
  63. package/public/features/wake-fullscreen.mjs +67 -0
  64. package/public/features/window-title.mjs +40 -0
  65. package/public/features/zoom.mjs +80 -0
  66. package/public/icon-128.png +0 -0
  67. package/public/icon-180.png +0 -0
  68. package/public/icon-192.png +0 -0
  69. package/public/icon-48.png +0 -0
  70. package/public/icon-512-maskable.png +0 -0
  71. package/public/icon-512.png +0 -0
  72. package/public/icon.svg +1 -0
  73. package/public/index.html +1765 -0
  74. package/public/input-chunks.mjs +22 -0
  75. package/public/input-guard.mjs +210 -0
  76. package/public/manifest.json +56 -0
  77. package/public/panes.css +1257 -0
  78. package/public/panes.html +208 -0
  79. package/public/panes.mjs +2625 -0
  80. package/public/service-worker.js +67 -0
  81. package/public/workspace.css +1447 -0
  82. package/public/workspace.mjs +1475 -0
  83. package/scripts/install-service.sh +269 -0
  84. package/scripts/node-runtime.sh +138 -0
  85. package/scripts/panes +439 -0
  86. package/scripts/prepare-native.sh +35 -0
  87. package/scripts/run-hooks +69 -0
  88. package/scripts/t1.sh +113 -0
  89. package/scripts/uninstall-service.sh +49 -0
  90. package/src/agent-guide.js +260 -0
  91. package/src/attachments.js +128 -0
  92. package/src/browser-dom.js +545 -0
  93. package/src/browser-workspace.js +1246 -0
  94. package/src/chrome-resolve.js +80 -0
  95. package/src/pty-permissions.js +99 -0
  96. package/src/regex-worker.js +13 -0
  97. package/src/replay-text.js +189 -0
  98. package/src/request-boundary.js +58 -0
  99. package/src/safe-regex.js +87 -0
  100. package/src/server.js +1122 -0
  101. package/src/shell-resolve.js +42 -0
  102. package/src/static-deps.js +61 -0
  103. package/src/workspace-panes.js +1099 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,126 @@
1
+ # Changelog
2
+
3
+ All notable changes to Townmouse and the TerminalOne engine it embeds.
4
+
5
+ Townmouse is version 0.2.1, the second product cut, and is licensed AGPL-3.0-only. The 1.0.x entries below are the engine's inherited release history; the version numbers and dates stay exactly where history put them.
6
+
7
+ ## [0.2.1] — 2026-11-21
8
+
9
+ ### Security
10
+
11
+ - Element catalogs never serialize a password field's value. A catalog is served to view-only bearer grants, so returning it would cross the sharing boundary that the image and page text already respect.
12
+ - Browser URL waits match literally. A client-supplied regular expression was tested on the event loop, where a catastrophic pattern could stall every terminal, browser, and API request.
13
+ - Terminal wait patterns run in a worker thread with a deadline, so a pattern that backtracks pathologically is terminated and refused instead of stalling the server; patterns are capped at 200 characters.
14
+
15
+ ### Packaging
16
+
17
+ - `repository.url` normalized to `git+https://…`, the form npm requires at publish time.
18
+
19
+ ## [0.2.0] — 2026-11-21
20
+
21
+ ### Standard browser view
22
+
23
+ - One compact address row is the header. Agent access sits behind **Share** instead of occupying its own row, and the state line is a single slim line.
24
+ - A **Collapse** control hides every bar above the page and remembers the choice, leaving a 32 px strip that names the current page and restores the controls. Measured gain: 112 px on desktop, 180 px on tablet, 127 px on phone.
25
+ - The mascot lives in the navigation rail only; it no longer occupies the working area.
26
+
27
+ ### Agent control
28
+
29
+ - Browser panes address controls by role and name across cross-origin frames and open shadow roots. Every observation carries an id, capture time, viewport, scroll offset, address, title, and a truncation flag.
30
+ - A coordinate target from a page that has changed since it was observed is refused with "look again"; element refs are stable and re-checked before use.
31
+ - Actions report `completed`, `missing`, `wrong-kind`, `failed`, `stale`, or `unconfirmed`, with the focused control and value. Navigation returns the new page's title.
32
+ - Modifier chords (`Alt+M`), hover, drag, replace-typing, named-area scrolling, and bounded waits.
33
+ - Ordinary commands run as tracked jobs with an exit code; `pane read` defaults to clean screen text and `--raw` keeps the original terminal data.
34
+ - Program, agent-reported, and command status are three separate channels, and a fresh program clears the previous agent report.
35
+ - Visible maximize/restore control and a fixed-size browser lock that the owner's viewer cannot resize.
36
+ - New panes drop inherited parent-harness session markers (`CLAUDECODE`, `CLAUDE_CODE_CHILD_SESSION`, and related).
37
+
38
+ ### Packaging
39
+
40
+ - Dependency assets resolve through Node's lookup paths, so a normal `npm install` with hoisted dependencies serves the terminal engine instead of 404ing it.
41
+ - The server repairs node-pty's macOS spawn-helper mode at startup; npm 12 skips dependency install scripts by default, so the postinstall cannot be the only fix.
42
+ - Browser panes fall back to an installed Chrome, Chromium, Edge, or Brave; `GET /health` reports the resolved engine.
43
+ - `npx townmouse` works on Node 22–26. Node 22 is still preferred; the engine range is `>=22 <27`.
44
+ - Containers accept a remapped host port, the image has a `HEALTHCHECK`, and the build context no longer carries `.runtime`.
45
+ - The macOS installer scripts ship in the npm package.
46
+ - New gates: `npm run test:package` installs the packed tarball with `--ignore-scripts` and exercises the installed application; `tests/agent-control.test.cjs` covers 36 agent journeys.
47
+ - On Linux the package gate installs with the native build, because node-pty has no Linux prebuild. The server now explains a missing terminal engine and names the remedy (`npm rebuild node-pty`, `npm install --allow-scripts=node-pty townmouse`, or the container) instead of dying in a require stack.
48
+
49
+ ## [0.1.0] — 2026-11-15
50
+
51
+ ### Workspace
52
+
53
+ - Four-pane workspace tabs: any mix of PTY terminals and real Chromium browsers, up to four panes per tab and 24 tabs.
54
+ - Terminal agents receive `TOWNMOUSE_API`, `TOWNMOUSE_TOKEN`, `TOWNMOUSE_TAB_ID`, `TOWNMOUSE_PANE_ID`, and `TOWNMOUSE_PANES_CLI` in every pane; `scripts/panes` controls tabs, panes, URLs, input, reads, named keys, bracketed send-text, waits, agent state, dialogs, attachments, and pane order.
55
+ - Pane terminals start at the client's measured dimensions, expose `lastOutputAt`/`idleMs`/exit status, and accept agent-reported working/blocked/idle/done state.
56
+ - Workspace state, tab titles, pane cwd, browser URLs, and active selection survive a server restart.
57
+ - Visible tab strip, draggable terminal/browser separators, 7-second idle chrome collapse, and phone/tablet/desktop layouts.
58
+ - Draggable pane dividers with per-tab ratios, keyboard resizing, double-click reset, pane headers that drag to reorder, and a maximize chord.
59
+ - Phone key bar for panes (Esc, Tab, sticky Ctrl/Alt, Ctrl+C, arrows, Home/End, PgUp/PgDn), a word-wrapped Reader transcript, terminal context menus, and a shortcut sheet.
60
+ - Restart epochs and a restored-layout notice; answerable page dialogs; browser Forward; software-keyboard inset handling.
61
+
62
+ ### Attachments
63
+
64
+ - Attach button in the main bottom navigation and pane menu, backed by a multi-file picker.
65
+ - Image and file paste uploads once and inserts a shell-quoted path; terminal agents and humans see the stored path.
66
+ - Drops outside a terminal never type file bytes or `data:` URIs into a PTY.
67
+
68
+ ### Fixed
69
+
70
+ - Resuming at a different width replays a control-free transcript built from the width each output was produced at, so shell redraws cannot fragment commands.
71
+ - Blank browser panes survive restart instead of being discarded; restarts mint an epoch and tell the client what was not restored.
72
+ - Queued terminal input survives a workspace tab switch and reuses one queue per pane.
73
+ - A page popup can no longer crash the server; a superseded window can no longer detach a live resumed shell; dead Chromium pages are pruned.
74
+ - Slow terminal readers are disconnected into the polling fallback instead of growing server memory without bound; at most four SSE streams are open.
75
+ - The attachment picker inserts its path and shows a copyable URL card; active HTML/SVG downloads instead of rendering.
76
+ - Bare Ctrl+C always interrupts, even with a selection.
77
+
78
+ ### Security
79
+
80
+ - Owner bootstrap and attachment uploads require an HttpOnly SameSite owner capability minted on page navigation. Header-less local callers and pane-token callers receive 403.
81
+ - Attachments are served with a sandbox CSP and `Cross-Origin-Resource-Policy: same-origin`.
82
+ - Chromium keeps its renderer sandbox by default; containers/CI opt out explicitly with `TOWNMOUSE_CHROMIUM_NO_SANDBOX=1`. Session and pane APIs bind loopback only unless Docker sets `HOST=0.0.0.0` for port forwarding.
83
+ - Attachment uploads are owner- or pane-token gated, daily-quota bounded, archived by age, and served with a sandbox CSP plus download disposition for active document types.
84
+
85
+ ### Packaging and tests
86
+
87
+ - npm CLI (`bin/townmouse`), Dockerfile, npm files allowlist, and AGPL-3.0-only licensing.
88
+ - New regression coverage for pane API limits, persistence, resume width, attachment picker/paste/drop, and popup safety.
89
+
90
+ ## [1.0.3] — 2026-11-08
91
+
92
+ - The engine learned to take dictation. Voice / speech-to-text has a settings section; the STT command, model, language, and argument template are saved server-side in `~/.config/terminalone/voice.json` and used at transcription time.
93
+ - Audio is staged under `~/.cache/terminalone`. The server accepts `.txt` or `.srt` output and no longer assumes `whisper` is on `PATH` or that a fixed `tiny.en` model is the only game in town.
94
+ - Explicit `TERMINALONE_STT_*` environment values override the saved setting for deployment and tests.
95
+
96
+ ## [1.0.2] — 2026-11-06
97
+
98
+ - Added a one-tap **Ctrl+b** shortcut for herdr to the iPhone/iPad key bar and the Snippets row. It sends Control plus lowercase b immediately, without switching keyboards or pressing Enter.
99
+ - Shell respawn storms are bounded, early input survives, and terminal context resets more cleanly after disconnects.
100
+ - If `/bin/zsh` is missing on the host, the engine falls back to an available shell.
101
+ - Hardened the browser input-guard so short batched keystrokes are not dropped.
102
+ - Patched body-parser, proxy-addr, and qs advisories, and pinned CI to Node 22.
103
+ - Moved the package homepage to https://floydslabs.com and refreshed the commercial studio screenshots.
104
+
105
+ ## [1.0.0] — 2026-06-26
106
+
107
+ ### Initial public release
108
+
109
+ This is the first public release of TerminalOne, the browser-based terminal engine Townmouse embeds: 39 feature modules and PWA install support.
110
+
111
+ ### Features
112
+
113
+ - Live PTY terminal via WebSocket — your actual shell, in your browser
114
+ - 39 feature modules covering command palette, session switching, search, clipboard, export, zoom, theme catalog, autosave, OS notification bridge, configurable key bar, and more
115
+ - Voice input module with bounded browser microphone capture, local Whisper-backed server transcription, review-before-run insertion, and oversized audio guards
116
+ - PWA support — install on iPad/iPhone as a standalone fullscreen app
117
+ - macOS launchd service installer with `t1` CLI launcher and Spotlight integration
118
+ - Responsive layout across phone, tablet, and desktop
119
+ - Settings import/export and theme system with dark/light mode
120
+ - 20/20 ShellFish-parity features implemented and tested
121
+
122
+ ### Build and test
123
+
124
+ - 6 test suites (input-guard, smoke, feature, feature-behavior, voice, responsive)
125
+ - Install/uninstall/reinstall verified end-to-end
126
+ - Beta release review cleared with no blockers (docs/BETA_RELEASE_READINESS_2026-06-26.md)
package/DESIGN.md ADDED
@@ -0,0 +1,169 @@
1
+ # TOWNMOUSE design
2
+
3
+ ## Or: A quiet light frame around a black rectangle, with one mouse doing all the shouting
4
+
5
+ - **DOCUMENT CLASSIFICATION:** DESIGN RECORD / MODERATE CHAOS / TECHNICALLY CREDIBLE
6
+ - **DATE RECORDED:** 2026-11-15 — late enough that the coffee has opinions
7
+ - **LOCATION:** The garage; the good monitor faces the cats
8
+ - **BEVERAGE:** Coffee that tastes like motor oil and exactly one blue accent
9
+ - **FELINE SUPERVISION:** Bella approved the quiet parts; Bowser is monitoring the separator
10
+ - **CURRENT STATE:** Porcelain, ink, and a terminal that stays black
11
+
12
+ ## Product job (Or: What This Thing Is For, Before Anyone Says "Platform")
13
+
14
+ Townmouse is a terminal and agent browser workspace. A person needs to run a real shell and a real browser page on the same host, switch between them quickly, and understand exactly what an agent can see or control. The terminal is the anchor; the browser is a peer surface.
15
+
16
+ That is the whole job. Everything below is in service of it, or it does not ship.
17
+
18
+ ## Selected workflow (Or: We Read the Studio, We Did Not Move In)
19
+
20
+ Primary: the Legacy Design Studio's Frontend Design workflow (`frontend-design/SKILL.md`). Supplemental review: the Studio's Open Design anti-AI-slop guide (`open-design/craft/anti-ai-slop.md`). The Studio is read in place from its installed library; the application stays in this repository and the Studio supplies guidance only.
21
+
22
+ We read the Studio. We did not rename the garage or schedule a kickoff about the kickoff.
23
+
24
+ ## Design plan (Or: One Blue Accent, a System Sans, and a Firm No)
25
+
26
+ **Color.** Porcelain `#eef1f5`, ink `#202832`, glass `#ffffffcc`, line `#cbd2dc`, blue `#175cbb`, terminal `#14171b`. The blue is the only chrome accent. The terminal surface keeps its own dark palette; workspace chrome never inherits the terminal's accent or elevation colors. If the chrome starts glowing, we have failed.
27
+
28
+ **Type.** The system sans (SF on Apple platforms) for workspace chrome. The terminal keeps its monospace face. Type sizes step 10 / 11 / 12 / 13 / 14 / 18 / 20 / 22 px; the brand wordmark is 19 px with tight tracking. No font pilgrimage. The system sans is already installed, and the terminal has a job.
29
+
30
+ **Layout.** A quiet, light frame around a dark terminal. Navigation is one consistent model with device-specific structures; the terminal and browser surfaces are never merely scaled from one device to another. Three devices, three structures. Scaling is not design.
31
+
32
+ **Principles.**
33
+
34
+ - The terminal is uninterrupted. Controls sit outside the black surface.
35
+ - State is explicit: Human or Agent, Private / View only / Control, session and working directory.
36
+ - Every primary control is reachable and at least 44pt.
37
+ - Spend boldness in one place: the Townmouse character and the terminal's contrast. Everything around it stays quiet.
38
+ - No emoji, decorative gradients, invented metrics, template hero, or identical card grid.
39
+
40
+ That last bullet is not a mood. It is a checklist.
41
+
42
+ **Brand character.** Townmouse is the monocled colonial mouse: the terminal is the house, the browser is the town. The full-figure illustration is the single bold visual move: the large sidebar brand art, the browser empty state, and the README. The bust portrait is the small SVG icon asset (favicon, app/PWA icons, and tiny chrome), shown uncropped. Both are the owner's original 1254×1254 RGBA PNGs, scaled with `object-fit: contain`; the character is never cropped. The character is never repeated as an emoji.
43
+
44
+ The ancestry is deliberate: the name completes the *Pigs (Three Different Ones)* triptych with FATCHIN and RATBAG — oversight, labor, and the space they operate in. The mouse is the product's identity, not a sticker on the terminal.
45
+
46
+ **Assets.** Originals live in `assets/brand/mascot/` (`townmouse-aristocrat.png`, `townmouse-monocled.png`), copied byte-for-byte from the owner's files, with their checksums recorded in that folder's `README.md`. The bust is wrapped as `townmouse-icon.svg` for the SVG icon surfaces. Optimized transparent WebP files live in `public/brand/`; the generated PWA/app icons are `public/icon-*.png`, including the padded maskable icon. If it is not the owner's pixels, it does not ship.
47
+
48
+ **Creator credit.** A small Floyd’s Labs neon-cats mark appears in the desktop sidebar and in the Tools sheet, labeled “Built at Floyd’s Labs” and linking to floydslabs.com. It is a creator credit, distinct from the Townmouse character, and stays small enough never to compete with the product brand. The cats get the credit; the mouse gets the product.
49
+
50
+ ## Three layouts (Or: Three Structures, Not One Structure Scaled Three Times)
51
+
52
+ The layouts share a navigation model, not a pixel grid. Each device gets the structure it can actually use.
53
+
54
+ **Desktop (1440×900 and wider).** A 208px sidebar holds the brand, Terminal, Browser, the tab list, New tab, Agent, Tools, and the real local server address. The terminal fills the main frame. Opening a browser splits the frame horizontally with a 60px header and a 30px footer. The 12px separator between terminal and browser is draggable left and right; the terminal keeps at least 320px and the browser at least 420px. Browser tabs live in the sidebar; sharing controls are always visible in the browser surface.
55
+
56
+ **Tablet (820×1180).** A 72px labeled rail holds the mark, Terminal, Browser, Agent, and Tools. The terminal fills the frame. Opening a browser stacks the terminal above the browser with a draggable separator; the key bar and footer leave the split so the browser gets the space. The separator can be dragged up and down between a 25% and 75% browser share. Browser tabs, Share, Expand, and Hide live in the browser tab strip. Share reveals the permissions row. Expand gives the browser the whole frame.
57
+
58
+ **Phone (393×852).** A bottom navigation holds Terminal, Browser, Agent, and Tools. One task surface is visible at a time. The terminal key bar collapses to one row of essentials plus a chevron that reveals the rest. In the browser, the state row sits at the top. The tab strip, address bar, and Share sit at the bottom above the remote keyboard, within thumb reach. The address bar carries back, forward, reload, the URL, and Go; Share opens the permissions row above the address bar. The tab itself carries Close. The control rows keep their 44pt targets but carry almost no outer padding. After seven seconds without a touch, every chrome row except the bottom navigation collapses, and the terminal or browser fills the frame. The first touch wakes the chrome; the bottom navigation stays awake and operable throughout.
59
+
60
+ Content first is the phone's whole personality. The navigation never leaves.
61
+
62
+ ## Pane workspace (Or: Four Live Things in a 2x2 Box)
63
+
64
+ `/panes.html` is the agent-first workspace. A workspace tab holds one to four panes in a 2x2 grid; each pane is a live PTY terminal or a live headless-browser page. Tabs are the units the human or the orchestrator creates and selects, and every tab can hold a different mix of terminals and browsers. The browser is the substrate: browser panes are real pages rendered by the server, and terminal panes are real PTYs. No iframe cosplay.
65
+
66
+ The orchestrator pane is spawned with `TOWNMOUSE_API`, `TOWNMOUSE_TOKEN`, `TOWNMOUSE_PANE_ID` and `scripts/panes`, so an agent creates tabs, adds panes, opens URLs and runs commands without copying a connection code. The bottom bar is the only chrome: back, host/session pill, tab count, keyboard, and menu. That is the whole chrome. It is enough.
67
+
68
+ This follows the Chrome split-view model — live tabs sharing one surface with a draggable divider — extended to four panes per tab.
69
+
70
+ The pane workspace is the same product, not a second identity. It uses the graphite family (`#0a0d12` / `#11161d`) and the one Townmouse blue as `--accent` (#8ab4ff, the dark-surface step of `#175cbb`). The old mint-on-green palette is retired.
71
+
72
+ ## Surface protection (Or: A Menu May Never Cover a Live Face)
73
+
74
+ Recorded 2026-11-18. This is a hard invariant, not a preference: **no menu, sheet, dialog, toast, or panel may paint over a live terminal or browser surface.** Chrome either docks and reflows the surface, or replaces it as a first-class mode with an explicit way back. Scope of this pass: the workspace chrome and pane surfaces listed below. The inherited command palette, shortcut help, search, recent-commands popover, and session-lock overlays are not yet ported and remain known exceptions.
75
+
76
+ - **Tools, Sessions, the close confirmation, Settings, and the browser page-text dialogs are docked peers.** On desktop (≥1100px) they reserve a 300px right column; on tablet (700–1099px) a 32dvh bottom row; on phone (≤699px) a 44dvh bottom row above the four-item navigation. The live surface shrinks; it is never covered. No scrim, no backdrop blur, no inert background, no focus trap.
77
+ - **Desktop menu is collapsible, not fixed overhead.** `#workspace-nav-toggle` trades the 208px labeled sidebar for a 72px icon rail and remembers the choice. The rail keeps a New tab control; when there are 2+ browser tabs the tab strip also appears in the browser surface so tabs stay reachable, and a single tab costs no extra height.
78
+ - **Reader view** is a mode, not an overlay: it replaces the transcript surface and always shows Close.
79
+ - **Notifications live in the flow.** Banner, toasts, and the attachment handoff card are siblings in the shell and push the terminal down. The pane workspace puts its notice in the bottom stack.
80
+ - **Pane workspace menus dock.** Tabs, menu, shortcuts, and confirmations reserve a 360px right column at ≥900px and a 48dvh bottom row below that. Context actions are a docked action rail above the workspace bar, not a floating menu on a pane.
81
+ - **Phone navigation is four surfaces** — Terminal, Browser, Agent, Tools. Panes and Attach are labeled rows in the Tools dock, because they are actions, not surfaces.
82
+ - **Visible control boundaries.** `--ws-control: #7c8898` (3.60:1 on white, 3.18:1 on paper) replaces the 1.3–1.5:1 hairline on inputs, key caps, tab chips, and both resize grips. The pale `--ws-line` remains decorative only. Dark pane controls use `#5f6f88` on `#11161d` (3.4:1).
83
+ - **Enforced by software.** `npm run test:ui` (`tests/ui-surfaces.test.cjs`) fails if any docked panel intersects `#terminal` or `.browser-canvas` at 1440×900, 1150×800, 820×1180, 393×852, or 932×430, or if a rendered live surface extends outside `.app-shell`; it also asserts the contrast floors, no horizontal overflow, the four-item phone navigation, and the Panes/Attach rows in Tools.
84
+
85
+ ## Navigation and browser model (Or: Who Can See What, and Who Can Touch It)
86
+
87
+ - The session pill is a button. It opens a Sessions sheet listing every named session, marking the current one, switching between them, and offering New session. The footer keeps the shell command, working directory, and uptime.
88
+ - Human and agent browser tabs share one tab strip. Each tab advertises Human or Agent; the persistent state row shows the active kind and permission.
89
+ - Human tabs start Private. View only and Allow control rotate the connection token. Private revokes subsequent token requests. Close tab destroys the context.
90
+ - The agent browser has control granted and keeps running when its view is hidden.
91
+
92
+ State is not a badge in a corner. It is the answer to the only question that matters: what can this thing see and do?
93
+
94
+ ## Motions (Or: Five Motions, Then We Stop)
95
+
96
+ Five motions, all with a job. The house style is arrive, do not perform.
97
+
98
+ 1. **Drawer reveal** — Tools opens and closes; 260ms; `cubic-bezier(.2,.8,.2,1)`; reduced-motion: immediate, no transform.
99
+ 2. **Surface switch** — terminal or browser surface enters; 220ms; `cubic-bezier(.2,.8,.2,1)`; reduced-motion: immediate.
100
+ 3. **Control press** — pointer down/up on controls; 180ms; `cubic-bezier(.2,.8,.2,1)`; reduced-motion: no transform/transition.
101
+ 4. **Active tab feedback** — selected tab background and border; 200ms; `cubic-bezier(.2,.8,.2,1)`; reduced-motion: immediate.
102
+ 5. **Tool state** — active tool row fill, white text, and checkmark; 180ms; `cubic-bezier(.2,.8,.2,1)`; reduced-motion: immediate.
103
+
104
+ Reduced motion also disables the xterm cursor blink and the two-finger inertia scroller. No parallax or continuous motion is used.
105
+
106
+ ## Accessibility (Or: 44pt, 2px, and No Traps)
107
+
108
+ - Native buttons, inputs, selects, and modal dialogs; visible 2px focus ring.
109
+ - Browser tabs use `role="tab"` with `aria-selected`; the tab lists use `role="tablist"`. Workspace navigation uses `aria-current="page"`.
110
+ - The phone permission select keeps an accessible name; the visual label is present when Share is open.
111
+ - Primary controls and tab close are at least 44pt. The split separator is a visible line with a grip, pointer and touch drag, and keyboard support: Left and Right arrows on the desktop vertical separator, Up and Down on the tablet horizontal separator, with Home and End jumping to the bounds. Safe-area insets are respected at the top, bottom, and around the phone sheet.
112
+ - The phone's collapsed state is not a trap: keydown wakes the chrome, the bottom navigation remains reachable, and the first touch on the content only restores the chrome instead of activating the page or terminal underneath.
113
+ - The destructive Close terminal action uses an in-design confirmation with Cancel and Close terminal. The settings dialog uses the workspace type system and 44px fields.
114
+ - Text and controls meet contrast on the porcelain chrome; the terminal keeps its own theme.
115
+
116
+ This is load-bearing. None of it is a nice-to-have, and none of it is negotiable.
117
+
118
+ ## Anti-AI-slop review (Or: The Checklist We Actually Ran)
119
+
120
+ Reviewed against the Open Design checklist:
121
+
122
+ - No indigo accent, no two-stop trust gradient, no emoji, no invented metrics, no filler copy.
123
+ - No identical rounded card grid; Tools is a grouped list with task headings, icons, descriptions, and a destructive row separated by color and confirmation.
124
+ - The only repeated card-like shapes are controls and tabs, which carry different roles.
125
+ - The character is the identity: a monocled colonial mouse holding a terminal sign, used large in the sidebar brand art and the browser empty state; the bust portrait is the small SVG icon asset. The terminal surface stays black; the chrome stays quiet.
126
+ - The empty browser state is specific to the product ("A place for the web" with local-host guidance), not placeholder content.
127
+
128
+ That is the review. It was not a vibe check.
129
+
130
+ ## Evidence (Or: Math. Not Vibes.)
131
+
132
+ - `npm run test:workspace` covers terminal input, human and agent tabs, sharing/revocation, page text, hidden-agent navigation, reduced motion, the tablet split drag and expand, and phone/tablet/desktop layouts at 393×852, 820×1180, 1440×900, and 1920×1080. The desktop separator drag and both orientation bounds are verified in the split-handle pass recorded in `docs/evidence/mascot-correction/` and `stewardship/screens/pass16`.
133
+ - `npm run test:ui` measures the surface-protection invariant and token contrast at all three breakpoints. The pass recorded 2026-11-18 found zero intersections for Tools, Sessions, close confirmation, Settings, and the pane menu, with control-boundary ratios of 3.60:1 (white) and 3.18:1 (paper), and pane control at 3.4:1.
134
+ - `npm test` covers the engine suite and responsive layout tests.
135
+ - Accepted screenshots are recorded in the stewardship evidence directory.
136
+ - The adversarial secondary-model grade is recorded in the stewardship `EVIDENCE.md`.
137
+
138
+ If you do not believe us, run it yourself.
139
+
140
+ ## Known limits (Or: The Honest Part)
141
+
142
+ - The browser viewer is image-based; it is remote interaction, not a native DOM exposed to the viewer's assistive technology. Agents use `/content` for text.
143
+ - Browser sessions and grants are in memory; a server restart closes them.
144
+ - Browser audio, file dialogs, extensions, and password managers are not provided.
145
+ - At most 32 browser contexts can remain open.
146
+ - Real Safari/iPadOS behavior and an authenticated remote proxy are not verified by the headless test matrix.
147
+
148
+ These are limits, not features waiting for a better slide.
149
+
150
+ ```
151
+ ┌──────────────────────────────────────────────────────────┐
152
+ │ DOCUMENT METADATA │
153
+ ├──────────────────────────────────────────────────────────┤
154
+ │ Layouts: 3 (desktop, tablet, phone) │
155
+ │ Panes per tab: 1-4, 2x2 grid │
156
+ │ Chrome accents: 1 (blue #175cbb) │
157
+ │ Emoji: 0 │
158
+ │ Cat Supervision: Bella approved / Bowser monitoring │
159
+ │ Corporate Feelings: HURT (intended) │
160
+ └──────────────────────────────────────────────────────────┘
161
+ ```
162
+
163
+ **DOCUMENT ENDS**
164
+
165
+ *— The Design Record That Would Like a Monocle for the Edge Cases*
166
+
167
+ *Floyd’s Labs — Townmouse Design Division*
168
+
169
+ *"Quiet chrome, black terminal, uncropped mouse. The rest is negotiation."*