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/README.md CHANGED
@@ -1,3 +1,369 @@
1
- # Temporary Holding Version
1
+ # Townmouse
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ## Or: The terminal is the house. The browser is the town. The mouse runs both.
4
+
5
+ <img src="public/brand/townmouse-monocled.webp" alt="Townmouse, the monocled colonial mouse holding a terminal sign" width="260">
6
+
7
+ **DOCUMENT CLASSIFICATION:** PRODUCT README / CAFFEINATED / ANTI-CORPORATE
8
+ **DATE RECORDED:** 2026-11-15 — 2:47 AM, because that is when the real work happens
9
+ **LOCATION:** The garage, Brown County, Indiana
10
+ **BEVERAGE:** Coffee that tastes like motor oil (fresh pot)
11
+ **CAT SUPERVISION:** Bella on quality assurance; Bowser monitoring the routers
12
+ **CURRENT STATE:** Terminal open, browser open, no subscription in sight
13
+
14
+ Townmouse is a terminal and agent browser workspace that runs on your own
15
+ machine. A live PTY shell and live Chromium pages share one workspace. You can
16
+ work in both. So can an agent. No hosted dashboard, no per-seat invoice, no
17
+ "contact sales" button lurking behind the terminal.
18
+
19
+ This is local software: a Node server and a static front end. The server listens
20
+ on `127.0.0.1` at port 11001 by default, and anything the terminal runs has your
21
+ account's authority. That is the deal. Treat it like a loaded shell, because it
22
+ is one.
23
+
24
+ ## What it does (Or: Fewer tabs, more work)
25
+
26
+ - **Terminal.** A real PTY with your shell, session resume, the key bar, themes,
27
+ and the existing terminal feature modules. The session pill opens a switcher
28
+ with every named shell and a New session action. The footer shows the shell,
29
+ working directory, and uptime. The terminal does not pretend to be a text box.
30
+ - **Pane workspace.** The native path for agent work. Open `/panes.html` for a
31
+ 2x2 grid of up to four live panes per tab, each one a terminal or a browser
32
+ page. The orchestrator agent creates and drives them through the injected
33
+ `TOWNMOUSE_API` and `scripts/panes` interface. No connection code is copied
34
+ between the browser and the terminal. Browser viewports reflow to the pane,
35
+ and dropped or pasted files upload once and arrive in the terminal as a real
36
+ path.
37
+ - **Browser.** Real Chromium pages on the terminal host, each in its own context
38
+ with its own cookies, not an iframe wearing a trench coat. The pane workspace
39
+ is the native way to use them; the single-browser workspace remains for
40
+ compatibility.
41
+ - **Agent browser.** A separate context with control granted. Hide view keeps it
42
+ running headless; reopen Agent to observe the same context. In the pane
43
+ workspace, the agent gets native access through the injected environment. The
44
+ single-browser view keeps its bearer-token path for compatibility.
45
+ - **Three layouts.** Desktop sidebar, tablet rail, phone bottom navigation. The
46
+ phone shows one task surface at a time; its key bar collapses to one row and
47
+ expands on demand. After seven seconds without a touch, the phone chrome drops
48
+ away except the bottom navigation. The next touch wakes it. No mystery meat
49
+ chrome.
50
+ - **Installable.** Add it to the home screen on iPad or iPhone. The shell and
51
+ workspace load from the local server. Offline coverage is the shell only; live
52
+ PTYs and browser pages still need the server.
53
+
54
+ ## Requirements (Or: The parts you actually need)
55
+
56
+ Node.js 22.x (preferred; 22–26 are accepted) and npm on macOS or Linux. Puppeteer
57
+ is a production dependency because browser tabs and panes are real Chromium
58
+ pages; `npm ci` downloads a compatible Chromium. If that download is skipped —
59
+ npm 12 skips dependency install scripts by default — TownMouse falls back to an
60
+ installed Chrome, Chromium, Edge, or Brave. Set `TERMINALONE_CHROME` to choose a
61
+ specific binary. `GET /health` reports which engine resolved.
62
+
63
+ On Linux, npm 12 skips dependency install scripts by default and node-pty has no
64
+ prebuilt Linux binary; install with `--allow-scripts=node-pty`, or run
65
+ `npm rebuild node-pty`, then `npm run doctor`. The container needs neither.
66
+
67
+ `npm run doctor` checks the Node version and native modules. If `node-pty`
68
+ needs rebuilding, `npm run repair` does that. The engine is native code; it is
69
+ not going to apologize for needing a compiler.
70
+
71
+ ## Run it (Or: From source, from npm, or from a container)
72
+
73
+ ### From source
74
+
75
+ ```sh
76
+ git clone https://github.com/CaptainPhantasy/townmouse.git
77
+ cd townmouse
78
+ npm ci
79
+ npm start
80
+ ```
81
+
82
+ Open `http://localhost:11001`. The server binds to `127.0.0.1`. A terminal can
83
+ run commands with your account's permissions; keep the server on loopback
84
+ unless you have an authenticated proxy in front.
85
+
86
+ ### From npm
87
+
88
+ ```sh
89
+ npx townmouse
90
+ ```
91
+
92
+ `npx townmouse` runs without a global install; `npm install -g townmouse` puts
93
+ the `townmouse` command on your PATH. The binary starts the server, prints the
94
+ URL, and opens a browser unless you pass `--no-open`. Use `--port` for a port
95
+ other than 11001:
96
+
97
+ ```sh
98
+ townmouse --port 12000 --no-open
99
+ ```
100
+
101
+ ### With Docker
102
+
103
+ ```sh
104
+ TOWNMOUSE_VERSION=$(node -p "require('./package.json').version") \
105
+ GIT_REVISION=$(git rev-parse HEAD) \
106
+ docker build \
107
+ --build-arg TOWNMOUSE_VERSION="$TOWNMOUSE_VERSION" \
108
+ --build-arg GIT_REVISION="$GIT_REVISION" \
109
+ -t townmouse:"$TOWNMOUSE_VERSION" \
110
+ -t townmouse:latest .
111
+ docker run --rm -p 127.0.0.1:11001:11001 \
112
+ -v townmouse-home:/home/node/.townmouse \
113
+ -v townmouse-config:/home/node/.config/terminalone \
114
+ townmouse
115
+ ```
116
+
117
+ The image uses `node:22-bookworm-slim` and installs Chromium. The volume holds
118
+ the workspace data. Mount project directories explicitly; the terminal starts
119
+ in `/home/node`. `GET /health` returns `status: "ok"`.
120
+
121
+ Inside the container the server listens on `0.0.0.0` so Docker can forward the
122
+ port; the `-p 127.0.0.1:...` above is what keeps it off your network. Do not
123
+ publish it on `0.0.0.0` without an authenticated HTTPS proxy. Chromium runs
124
+ without its sandbox in this image because the container has no user namespace
125
+ setup for it; treat the image as a trusted single-user boundary.
126
+
127
+ ## Use it from a phone or tablet (Or: The tailnet is the front door)
128
+
129
+ The app installs from the browser on iPad or iPhone. The workspace and terminal
130
+ shell come from the local server; live PTYs and browser pages need it running.
131
+
132
+ Do not expose the raw loopback server. Put an HTTPS proxy or tunnel in front
133
+ that requires you to sign in before it forwards **any** request, including
134
+ WebSocket connections. Start Townmouse with the exact public address:
135
+
136
+ ```sh
137
+ TERMINALONE_TRUSTED_ORIGINS=https://townmouse.example.com npm start
138
+ ```
139
+
140
+ The proxy must forward to `http://127.0.0.1:11001`, preserve the public `Host`
141
+ header and browser `Origin`, and support WebSocket upgrades. The setting takes
142
+ exact HTTPS origins separated by commas; wildcards, paths, embedded credentials,
143
+ and plain HTTP remote addresses are rejected. It allows an address. It does not
144
+ add authentication. Keep the server on loopback and let the proxy do the
145
+ sign-in.
146
+
147
+ On a tailnet, publish with `tailscale serve` on a claimed port bound to
148
+ loopback. Never expose it with Funnel without explicit approval. The mesh is the
149
+ gate; the server is not the gate.
150
+
151
+ ## The pane workspace (Or: Four panes, one token, zero codes to copy)
152
+
153
+ The pane workspace is the native path for agent work. Open `/panes.html`,
154
+ `/panes`, or **Panes** in the workspace sidebar.
155
+
156
+ A workspace tab holds up to four panes in a 2x2 grid. Each pane is a live PTY
157
+ terminal or a live headless-browser page. Tabs are created by the human or by
158
+ the orchestrator, and every tab can hold a different mix. The server caps the
159
+ workspace at 24 tabs and four panes per tab, with 24 terminal panes. The browser
160
+ runtime caps open browser contexts at 32. That gives a runaway agent a ceiling
161
+ before it gives the machine a funeral.
162
+
163
+ ### For a person (Or: The controls you actually touch)
164
+
165
+ **Tabs** in the bottom bar lists, switches, creates, and closes workspace tabs.
166
+ **Menu** adds a terminal or browser pane, opens Reader, adjusts terminal text,
167
+ or shows the shortcut sheet. **Keyboard** focuses the active terminal; in a
168
+ browser pane it focuses the page-type field. `Alt+T` creates a tab, `Alt+1..9`
169
+ selects one, `Alt+Arrow` moves pane focus, `Alt+Shift+Arrow` reorders a pane,
170
+ `Alt+M` maximizes, and `Alt+W` asks before closing the active pane. Drag a pane
171
+ header to reorder it, or drag the divider between panes to resize them.
172
+
173
+ Browser panes accept clicks, wheel scrolling, touch-drag scrolling, typing,
174
+ Back, Forward, Reload, and an address. The browser is a real Chromium page
175
+ rendered by the server, and its viewport reflows to the pane's actual size so
176
+ text wraps at the pane edge. `alert`/`confirm`/`prompt` dialogs wait for an
177
+ answer in a pane card (or `panes pane dialog`) instead of deadlocking the page.
178
+
179
+ Drop or paste a file or image onto a terminal pane. The file is uploaded once
180
+ into the state directory's `attachments/<date>/` tree (25 MB per request; daily
181
+ quota; old buckets archived), and a shell-quoted absolute path is inserted into
182
+ the PTY; the terminal never receives a base64 stream. The attachment card shows
183
+ the path and URL, and the browser pane can open the loopback URL. This is the
184
+ drag-and-drop people have expected since roughly 1995.
185
+
186
+ ### For an agent (Or: The environment is the handshake)
187
+
188
+ Each terminal pane is spawned with:
189
+
190
+ ```text
191
+ TOWNMOUSE_API=http://127.0.0.1:<port>/api/panes
192
+ TOWNMOUSE_TOKEN=<workspace token>
193
+ TOWNMOUSE_TAB_ID=<this tab>
194
+ TOWNMOUSE_PANE_ID=<this pane>
195
+ TOWNMOUSE_PANES_CLI=<repo>/scripts/panes
196
+ ```
197
+
198
+ No code is copied between the browser and the terminal. Run the CLI directly:
199
+
200
+ ```bash
201
+ "$TOWNMOUSE_PANES_CLI" state
202
+ "$TOWNMOUSE_PANES_CLI" tab create --title "Second workspace"
203
+ "$TOWNMOUSE_PANES_CLI" pane create --kind terminal
204
+ "$TOWNMOUSE_PANES_CLI" pane create --kind browser --url https://example.com
205
+ "$TOWNMOUSE_PANES_CLI" pane url <pane-id> https://example.com
206
+ "$TOWNMOUSE_PANES_CLI" pane run <pane-id> "npm test"
207
+ "$TOWNMOUSE_PANES_CLI" pane send-text <pane-id> "multi-line prompt"
208
+ "$TOWNMOUSE_PANES_CLI" pane keys <pane-id> ctrl+c
209
+ "$TOWNMOUSE_PANES_CLI" pane wait <pane-id> --match "PASS" --timeout 60000
210
+ "$TOWNMOUSE_PANES_CLI" pane status <pane-id> --state blocked
211
+ "$TOWNMOUSE_PANES_CLI" pane read <pane-id> --lines 120
212
+ "$TOWNMOUSE_PANES_CLI" pane text <pane-id>
213
+ "$TOWNMOUSE_PANES_CLI" attach ./screenshot.png --pane <pane-id>
214
+ ```
215
+
216
+ `pane create` defaults to the current tab. The orchestrator can create as many
217
+ tabs as the server allows; each tab holds up to four panes. A tab can be all
218
+ terminals, all browsers, or any mix. `pane text` reads the browser page's
219
+ readable content, because an agent should not have to guess what a pane is
220
+ showing. `pane wait` blocks on text, a regex, an idle interval, or an
221
+ agent-reported state; `pane status` records working, blocked, idle, or done so
222
+ the pane header and orchestrator agree. `attach` uploads with the scoped pane
223
+ token and prints the path and URL.
224
+
225
+ The workspace survives a server restart: tab titles, pane kinds, terminal
226
+ working directories, browser URLs, pane order, and the active tab are saved in
227
+ `~/.townmouse/workspace.json`. The PTYs start fresh, because a shell process
228
+ does not survive its server. The layout does; the client sees a new epoch and
229
+ is told that scrollback and running jobs were not restored.
230
+
231
+ ## The single-browser workspace (Or: The compatibility wing)
232
+
233
+ The pane workspace is the native path. The original single-browser workspace
234
+ remains for compatibility: the terminal surface, a tab strip of browser tabs,
235
+ and a separate agent browser.
236
+
237
+ Open **Browser** or a new tab. Enter a web address, search phrase, or localhost
238
+ URL. Navigation, clicks, typing, and scrolling happen in the real page on the
239
+ terminal host, not in an iframe.
240
+
241
+ Human tabs start Private. The compatibility sharing flow keeps View only,
242
+ Allow control, and Copy connection. Changing the permission rotates the token;
243
+ choosing Private rejects subsequent token requests; closing a tab destroys its
244
+ context. On a phone or tablet, **Share** opens the permission row, Read page,
245
+ and Close tab. On a phone, the tab strip, address bar, and Share sit together at
246
+ the bottom above the remote keyboard; the address bar carries back, forward,
247
+ reload, and Go.
248
+
249
+ The agent browser is a separate context with control granted. Hide view keeps it
250
+ running headless; reopen Agent to observe the same context. Its bearer-token API
251
+ is documented in [docs/browser-workspace.md](docs/browser-workspace.md). For
252
+ agent work in the pane workspace, use the injected environment and
253
+ `scripts/panes` instead; there is no connection code to copy.
254
+
255
+ ## Security and limits (Or: Bad news first, then the receipts)
256
+
257
+ - The terminal runs with your account's permissions. Keep the server on loopback
258
+ unless an authenticated proxy is in front.
259
+ - Browser tabs and panes are isolated Chromium contexts with their own cookies,
260
+ not your personal Safari or Chrome profile. They are not a security boundary
261
+ against a process that already has unrestricted access to the host.
262
+ - Grants protect cooperative API clients. They do not protect against a hostile
263
+ process with host access.
264
+ - Browser sessions and grants live in memory. Restarting the server closes them;
265
+ saved browser profiles and seamless session persistence are not implemented.
266
+ - Browser audio, native file-picker and download dialogs, extensions, and
267
+ password-manager integration are not provided. Dropped files use the
268
+ attachment path above.
269
+ - The browser viewer is image-based: it is remote interaction, not a native DOM
270
+ exposed to the viewer's assistive technology.
271
+
272
+ ### Your data (Or: The files that stay yours)
273
+
274
+ Workspace data lives in `~/.townmouse`:
275
+
276
+ - `pane-token` — the workspace API token, mode 600.
277
+ - `attachments/<date>/` — dropped files, mode 700/600.
278
+ - `workspace.json` — tabs, panes, URLs, and the active tab, mode 600.
279
+
280
+ Back up `~/.townmouse` before upgrades. Project files live wherever you mounted
281
+ them, never inside the package directory. Docker uses the `townmouse-home`
282
+ volume for the same data.
283
+
284
+ ## Development (Or: Tests before vibes)
285
+
286
+ ```sh
287
+ npm start # run the workspace
288
+ npm test # security, unit, smoke, feature, voice, responsive, pane API, and agent-control suites
289
+ npm run test:workspace # browser workspace journeys; starts its own preview site
290
+ npm run test:package # install the packed tarball and run the installed app
291
+ npm run doctor # check Node and native modules
292
+ npm run repair # rebuild native modules
293
+ ```
294
+
295
+ Design notes live in [DESIGN.md](DESIGN.md). The product follows the Legacy
296
+ Design Studio's Frontend Design workflow, with the Open Design anti-AI-slop
297
+ review as its supplemental checklist.
298
+
299
+ More docs:
300
+
301
+ - [docs/panes.md](docs/panes.md) — pane workspace and agent CLI.
302
+ - [docs/browser-workspace.md](docs/browser-workspace.md) — browser tabs and the legacy bearer-token API.
303
+ - [docs/PACKAGING.md](docs/PACKAGING.md) — npm, Docker, the macOS wrapper, release gates, and backup.
304
+ - [TOWNMOUSE.md](TOWNMOUSE.md) — product boundary and origin.
305
+
306
+ ## Status (Or: Version 0.2.1, and honest about it)
307
+
308
+ Version 0.2.1. 0.1.0 was the first product cut. Two working surfaces: the single
309
+ terminal/browser workspace and the pane workspace. The pane workspace is the
310
+ native path for agent work; the single-browser workspace remains for
311
+ compatibility. Known limits are under Security and in
312
+ [docs/PACKAGING.md](docs/PACKAGING.md).
313
+
314
+ ## Terminal engine (Or: The engine stays in the engine bay)
315
+
316
+ The terminal is TerminalOne, the canonical standalone PTY from Floyd’s Labs,
317
+ embedded in Townmouse. The terminal surface — PTY, session resume, key bar,
318
+ themes, and feature modules — comes from the engine. Townmouse owns the browser
319
+ workspace, agent browser, view/control grants, the pane system, and the
320
+ interface. Browser-workspace features do not go upstream into TerminalOne. See
321
+ [TOWNMOUSE.md](TOWNMOUSE.md) for the product boundary and origin.
322
+
323
+ ## Credits (Or: The cats get a logo, not the product)
324
+
325
+ Built at [Floyd’s Labs](https://floydslabs.com). The creator credit in the app
326
+ uses the Floyd’s Labs neon-cats mark. Bella and Bowser did not review this README,
327
+ but Bella walked across the keyboard at least once, which counts as QA.
328
+
329
+ ## License (Or: The give-back rule)
330
+
331
+ AGPL-3.0-only. If you run Townmouse, or a modified version of it, as a network
332
+ service, you must offer the complete corresponding source to the people who use
333
+ it. Distributing it also requires the source. TerminalOne's license and
334
+ copyright notices remain with the portions it supplies.
335
+
336
+ ### Why AGPL-3.0-only (Or: Because the subscription treadmill can keep walking)
337
+
338
+ At Floyd’s Labs we build local tools that should stay useful to the people who
339
+ run them. We release Townmouse under the GNU Affero General Public License v3,
340
+ and only v3, for three plain reasons:
341
+
342
+ - **Open Exchange.** The work should be available to independent developers,
343
+ self-hosters, and hobbyists for personal and local use.
344
+ - **The Give-Back Rule.** If you modify Townmouse and expose it as a network
345
+ service, the AGPL requires you to offer your modified source under the same
346
+ terms.
347
+ - **Passive Protection.** The license keeps self-funded lab work a shared asset.
348
+ A proprietary service cannot build on Townmouse without making its modified
349
+ source available under the same terms.
350
+
351
+ That is the point. Nobody gets to take the garage work, put a Patagonia vest on
352
+ it, and charge rent for the terminal.
353
+
354
+ ---
355
+
356
+ ┌──────────────────────────────────────────────────────────┐
357
+ │ DOCUMENT METADATA │
358
+ ├──────────────────────────────────────────────────────────┤
359
+ │ Classification: Product README / Floyd's Labs │
360
+ │ Cat Supervision: Bella approved; Bowser monitoring │
361
+ │ "I Don't Suck": PASS │
362
+ │ Corporate Feelings: HURT (intended) │
363
+ └──────────────────────────────────────────────────────────┘
364
+
365
+ **DOCUMENT ENDS**
366
+
367
+ *— The Garage, Product Documentation Division*
368
+ *Floyd’s Labs — Brown County, Indiana*
369
+ *“The terminal is the house. The browser is the town. The mouse is the product.”*
package/SECURITY.md ADDED
@@ -0,0 +1,57 @@
1
+ # Security Policy
2
+
3
+ ## Or: Keep The Shell In The House And The Browser In The Town
4
+
5
+ Townmouse is a terminal and agent browser workspace. It runs a real shell and real browser pages on your machine, with your account's permissions — that is the whole point, and also the whole risk. It embeds TerminalOne as its terminal engine. Treat the workspace as an administrative tool for a host you trust.
6
+
7
+ Written in the garage in Brown County, Indiana. The coffee is terrible. The rules are not.
8
+
9
+ ## Supported Versions
10
+
11
+ Security fixes land on `main`, or they do not land. Only the latest commit on the `main` branch is supported with security updates.
12
+
13
+ | Version | Supported |
14
+ | ------- | ------------------ |
15
+ | main | :white_check_mark: |
16
+ | < main | :x: |
17
+
18
+ ## Reporting a Vulnerability
19
+
20
+ **Do not open a public issue for security vulnerabilities.** A public issue tells everyone, including the people you would rather not tell.
21
+
22
+ Report vulnerabilities privately via **GitHub Security Advisories**:
23
+
24
+ 1. Go to the [Security tab](https://github.com/CaptainPhantasy/townmouse/security) on the Townmouse repository.
25
+ 2. Click **Report a vulnerability**.
26
+ 3. Describe the issue in detail: what is affected, how to reproduce it, and the potential impact.
27
+
28
+ ### What to expect
29
+
30
+ - **Response:** Best-effort. No guaranteed SLA. We will not pretend otherwise.
31
+ - **Disclosure:** Coordinated disclosure — a fix will ship before the advisory is published.
32
+ - **Credit:** Reporters are credited in the advisory and changelog unless they request anonymity.
33
+
34
+ ### Out of scope
35
+
36
+ - Issues in third-party dependencies (report upstream to the dependency maintainers)
37
+ - Social engineering or phishing attacks
38
+ - Physical access to the host machine
39
+ - Vulnerabilities that require the attacker to already have shell access to the machine running Townmouse
40
+
41
+ ## Security model
42
+
43
+ - Townmouse binds to `127.0.0.1` by default. Keep it on loopback. An HTTPS proxy or tunnel in front must authenticate **every** request before it forwards it, including WebSocket upgrades. `TERMINALONE_TRUSTED_ORIGINS` allows an address; it does not add authentication.
44
+ - A terminal runs commands with your account's permissions. Browser tabs are isolated Chromium contexts, not your personal Safari or Chrome profile.
45
+ - View and control grants protect cooperative API clients. They are not a security boundary against a process that already has unrestricted access to the host.
46
+ - Browser sessions and grants are held in memory; restarting the server closes them. At most 32 browser contexts can remain open.
47
+ - Browser audio, file upload/download dialogs, extensions, and password-manager integration are not provided.
48
+ - The request boundary accepts any port on a loopback hostname so a container can be published on a different host port. It still requires an exact same-origin `Origin`/`Host` match, so a page served from another local port cannot drive the server. A non-loopback hostname must be listed in `TERMINALONE_TRUSTED_ORIGINS` as an exact HTTPS origin.
49
+ - On macOS the server makes node-pty's `spawn-helper` executable inside its own installed package at startup. npm 12 does not run dependency install scripts by default, and the tarball does not carry the mode bit; without the repair every terminal fails. The change is a mode bit on a file inside the package the server is already running from.
50
+ - Browser panes use `TERMINALONE_CHROME` when set, otherwise Puppeteer's downloaded build, otherwise an installed Chrome, Chromium, Edge, or Brave. `GET /health` reports which one resolved. None of these are the user's personal profile.
51
+
52
+ *Townmouse is AGPL-3.0-only.*
53
+
54
+ ---
55
+
56
+ *— Floyd's Labs, The Garage*
57
+ *"Bowser watches the router. We watch the door."*
package/TOWNMOUSE.md ADDED
@@ -0,0 +1,91 @@
1
+ # TOWNMOUSE
2
+
3
+ ## Or: The house, the town, and the mouse holding the terminal sign
4
+
5
+ - **DOCUMENT CLASSIFICATION:** PRODUCT BOUNDARY / ENGINE ATTRIBUTION / THE APP IS TOWNMOUSE
6
+ - **DATE RECORDED:** 2026-11-15 — 2:47 AM, allegedly
7
+ - **LOCATION:** Brown County, Indiana — the garage with the good terminal
8
+ - **BEVERAGE:** Coffee that tastes like motor oil; the browser renders anyway
9
+ - **FELINE SUPERVISION:** Bella on product identity; Bowser monitoring the engine boundary
10
+ - **CURRENT STATE:** Townmouse-shaped, engine-powered, no identity crisis
11
+
12
+ ## What Townmouse Is (Or: The Application, Not the Engine)
13
+
14
+ Townmouse is a terminal and agent browser workspace. It runs a real shell and real browser pages on the same host, in one workspace, so a person or an agent can work in both. The terminal is the anchor; the browser is a peer surface.
15
+
16
+ It embeds TerminalOne as its terminal engine. That sentence has two nouns and one job each: Townmouse is the application; TerminalOne is the engine. The product is not a TerminalOne skin, and TerminalOne is not the product.
17
+
18
+ ## Relationship to TerminalOne (Or: The Engine Stays in the Terminal Where It Belongs)
19
+
20
+ - `CaptainPhantasy/TerminalOne` remains the canonical simple PTY.
21
+ - Townmouse owns the browser workspace, the agent browser, view/control grants, and the workspace interface.
22
+ - These features do not go upstream into TerminalOne.
23
+ - The product chrome carries no TerminalOne branding. TerminalOne appears in the documentation as the embedded engine and as origin provenance, and it remains its own product.
24
+
25
+ ## Origin (Or: Seeded From a Commit, Not Rebranded From a Product)
26
+
27
+ Townmouse was seeded on 2026-11-14 from TerminalOne commit `dd0cbde6` ("Preserve recovered TerminalOne glass browser workspace"), originally branch `dot/recover-terminalone-20261114`.
28
+
29
+ That is engine ancestry. The commit belongs to TerminalOne's history; the workspace built on top of it belongs to Townmouse. The recovered glass browser was the starting point, not the product name.
30
+
31
+ ## Current Structure (Or: One Repository, Two Jobs, and a Boundary We Owe Ourselves)
32
+
33
+ The recovery snapshot keeps the TerminalOne engine at the repository root, with the workspace layer integrated through `src/browser-workspace.js`, `public/workspace.css`, `public/workspace.mjs`, and small hooks in `src/server.js` and `public/index.html`.
34
+
35
+ A future restructure should make the boundary explicit:
36
+
37
+ - `terminalone/` — vendored upstream engine.
38
+ - `workspace/` — Townmouse product layer.
39
+ - a product server that mounts both.
40
+
41
+ One directory boundary is cheaper than a rebrand.
42
+
43
+ ## Product (Or: The Name, the Codename, and the Chrome Rules)
44
+
45
+ - Display name: **Townmouse**.
46
+ - Repository and package: `townmouse`.
47
+ - Codename: TOWNMOUSE.
48
+ - Chrome: no engine branding. The app is Townmouse through the whole chrome.
49
+
50
+ ## Character and Assets (Or: One Mouse, Two Portraits, Zero Crops)
51
+
52
+ Townmouse is the monocled colonial mouse, holding a terminal sign. The terminal is the house; the browser is the town. The mouse is the identity, not a sticker applied after the fact.
53
+
54
+ The full-figure illustration is the large sidebar brand art, the browser empty state, and the README. The bust portrait is the small SVG icon asset: favicon and app/PWA icons. Both are shown uncropped. The full figure gets the square footage; the bust fits in a favicon. Neither gets cropped to make a point.
55
+
56
+ Assets: originals live in `assets/brand/mascot/`, optimized WebP in `public/brand/`, generated PWA icons in `public/icon-*.png`. Both mascot originals are the owner's 1254×1254 RGBA PNGs and are never cropped.
57
+
58
+ ## Creator Credit (Or: The Cats Get a Logo, Not the Product)
59
+
60
+ The Floyd’s Labs neon-cats mark is a small labeled credit in the desktop sidebar and Tools sheet, linking to floydslabs.com. It is distinct from the Townmouse character and does not replace the product brand. It stays small enough to be a credit, not a second mascot.
61
+
62
+ ## Palette and Type (Or: Porcelain, Ink, and One Blue That Behaves)
63
+
64
+ - Palette: porcelain `#eef1f5`, ink `#202832`, line `#cbd2dc`, blue `#175cbb`, terminal `#14171b`.
65
+ - Type: the system sans for workspace chrome; the terminal keeps its monospace face.
66
+
67
+ One blue accent. The terminal stays black. Nobody borrows anybody else's elevation.
68
+
69
+ ## Status (Or: Version 0.1.0, Two Surfaces, Three Layouts)
70
+
71
+ Version 0.1.0. Two working surfaces: the single terminal/browser workspace and the pane workspace (`/panes.html`), where each tab holds up to four live panes — terminal or browser — and the orchestrator agent creates and drives them through the injected `TOWNMOUSE_API` / `scripts/panes` interface.
72
+
73
+ Three deliberate layouts: desktop sidebar, tablet rail, phone bottom navigation. Phone shows one task surface at a time; the key bar collapses to one row and expands with the chevron. Tablet and phone put browser tabs and sharing controls in the browser surface; on phone the tab strip, address bar, and Share sit together at the bottom. Those rows are tightly padded, and after seven seconds without a touch the content takes the whole frame while the bottom navigation stays; the next touch wakes the chrome.
74
+
75
+ The session pill opens a Sessions sheet with switching and New session. Tools is a grouped surface. Close terminal uses an in-design confirmation. None of that is decorative. It is the product.
76
+
77
+ ## Naming and Ancestry (Or: The Triptych, and Why There Are Three)
78
+
79
+ TOWNMOUSE completes the *Pigs (Three Different Ones)* triptych with FATCHIN and RATBAG: oversight, labor, and the space they operate in.
80
+
81
+ ## Receipts (Or: The Design Doc Has the Numbers)
82
+
83
+ The layouts, motions, accessibility gates, and evidence live in [DESIGN.md](DESIGN.md). Math. Not vibes.
84
+
85
+ **DOCUMENT ENDS**
86
+
87
+ *— The Product, Which Is Not the Engine*
88
+
89
+ *Floyd’s Labs — Townmouse Division*
90
+
91
+ *"The terminal is the house. The browser is the town. The mouse is the product."*
@@ -0,0 +1,23 @@
1
+ # Townmouse mascot originals
2
+
3
+ Both files are the owner's original PNGs, supplied 2026-11-15, copied here
4
+ byte-for-byte. They are 1254 × 1254 RGBA with their original transparency.
5
+ They are never cropped, recolored, or recompressed in this folder.
6
+
7
+ | File | Source in `~/Downloads` | Use | SHA-256 |
8
+ |---|---|---|---|
9
+ | `townmouse-aristocrat.png` | `Townmouse Aristocrat with iPad-2.png` | Bust portrait: small SVG icon asset and app/PWA icons | `f4d18359e8064390916813f36405cacf2d1029f69f05cd9184012256b5dec87d` |
10
+ | `townmouse-monocled.png` | `Monocled colonial mouse with an iPad-1.png` | Full figure: large sidebar brand art, browser empty state, README | `f87c0fd24095fa4bd1677904ea6420da605dbc573320bb3e4cc58498a6e27da1` |
11
+
12
+ `townmouse-icon.svg` is generated from the bust: it embeds a 256 px PNG of the
13
+ same uncropped portrait inside an SVG wrapper (`public/icon.svg` and
14
+ `public/favicon.svg`). It preserves the owner's pixels; it is not an auto-traced
15
+ redrawing.
16
+
17
+ The optimized transparent WebP renditions live in `public/brand/`. Icons are
18
+ generated by `stewardship/make-icons.cjs`: the bust portrait is scaled
19
+ uncropped; the monoline cursor remains the 16/32 favicon for legibility.
20
+
21
+ The pattern follows the sister apps: RATBAG uses one uncropped square mascot in
22
+ a square art well, and FATCHIN uses the owner's original square PNG for its
23
+ navigation logo and icons.