aicodeman 1.8.3 → 1.9.0

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 (85) hide show
  1. package/README.md +80 -103
  2. package/README.zh-CN.md +80 -103
  3. package/dist/types/common.d.ts +25 -0
  4. package/dist/types/common.d.ts.map +1 -1
  5. package/dist/types/common.js +1 -0
  6. package/dist/types/common.js.map +1 -1
  7. package/dist/web/public/admin-ui.js.gz +0 -0
  8. package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
  9. package/dist/web/public/app.adc992cd.js.gz +0 -0
  10. package/dist/web/public/constants.e7175b95.js.gz +0 -0
  11. package/dist/web/public/cron-ui.js.gz +0 -0
  12. package/dist/web/public/i18n.4dcf1b87.js.gz +0 -0
  13. package/dist/web/public/image-input.ee16ad88.js.gz +0 -0
  14. package/dist/web/public/index.html +10 -7
  15. package/dist/web/public/index.html.br +0 -0
  16. package/dist/web/public/index.html.gz +0 -0
  17. package/dist/web/public/input-cjk.63794d0b.js.gz +0 -0
  18. package/dist/web/public/{keyboard-accessory.3f91acef.js → keyboard-accessory.9936227d.js} +361 -2
  19. package/dist/web/public/keyboard-accessory.9936227d.js.br +0 -0
  20. package/dist/web/public/keyboard-accessory.9936227d.js.gz +0 -0
  21. package/dist/web/public/mobile-handlers.bc2b8c1d.js.gz +0 -0
  22. package/dist/web/public/mobile.40e2d64e.css +1 -0
  23. package/dist/web/public/mobile.40e2d64e.css.br +0 -0
  24. package/dist/web/public/mobile.40e2d64e.css.gz +0 -0
  25. package/dist/web/public/notification-manager.fca811fd.js.gz +0 -0
  26. package/dist/web/public/orchestrator-panel.js.gz +0 -0
  27. package/dist/web/public/panels-ui.3910e1e2.js.gz +0 -0
  28. package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
  29. package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
  30. package/dist/web/public/respawn-ui.2d249da9.js.gz +0 -0
  31. package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
  32. package/dist/web/public/{session-ui.fd39c53c.js → session-ui.ab6dd9aa.js} +15 -15
  33. package/dist/web/public/session-ui.ab6dd9aa.js.br +0 -0
  34. package/dist/web/public/session-ui.ab6dd9aa.js.gz +0 -0
  35. package/dist/web/public/settings-ui.b8def032.js.gz +0 -0
  36. package/dist/web/public/{styles.bd210c71.css → styles.42dd71e1.css} +1 -1
  37. package/dist/web/public/styles.42dd71e1.css.br +0 -0
  38. package/dist/web/public/styles.42dd71e1.css.gz +0 -0
  39. package/dist/web/public/subagent-windows.69b60c35.js.gz +0 -0
  40. package/dist/web/public/sw.js.gz +0 -0
  41. package/dist/web/public/{terminal-ui.feaf75c2.js → terminal-ui.f3a51974.js} +1 -1
  42. package/dist/web/public/terminal-ui.f3a51974.js.br +0 -0
  43. package/dist/web/public/terminal-ui.f3a51974.js.gz +0 -0
  44. package/dist/web/public/ultracode-panel.js.gz +0 -0
  45. package/dist/web/public/ultracode-windows.js.gz +0 -0
  46. package/dist/web/public/upload.html.gz +0 -0
  47. package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
  48. package/dist/web/public/vendor/marked.min.js.gz +0 -0
  49. package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
  50. package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
  51. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
  52. package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
  53. package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
  54. package/dist/web/public/vendor/xterm.css.gz +0 -0
  55. package/dist/web/public/vendor/xterm.min.js.gz +0 -0
  56. package/dist/web/public/voice-input.085e9e73.js.gz +0 -0
  57. package/dist/web/public/webview-tabs.js +43 -13
  58. package/dist/web/public/webview-tabs.js.br +0 -0
  59. package/dist/web/public/webview-tabs.js.gz +0 -0
  60. package/dist/web/routes/file-routes.d.ts.map +1 -1
  61. package/dist/web/routes/file-routes.js +313 -8
  62. package/dist/web/routes/file-routes.js.map +1 -1
  63. package/dist/web/routes/session-routes.d.ts.map +1 -1
  64. package/dist/web/routes/session-routes.js +173 -99
  65. package/dist/web/routes/session-routes.js.map +1 -1
  66. package/dist/web/schemas.d.ts +10 -0
  67. package/dist/web/schemas.d.ts.map +1 -1
  68. package/dist/web/schemas.js +30 -0
  69. package/dist/web/schemas.js.map +1 -1
  70. package/dist/web/webview-proxy.d.ts +18 -1
  71. package/dist/web/webview-proxy.d.ts.map +1 -1
  72. package/dist/web/webview-proxy.js +129 -1
  73. package/dist/web/webview-proxy.js.map +1 -1
  74. package/package.json +17 -6
  75. package/dist/web/public/keyboard-accessory.3f91acef.js.br +0 -0
  76. package/dist/web/public/keyboard-accessory.3f91acef.js.gz +0 -0
  77. package/dist/web/public/mobile.6153d275.css +0 -1
  78. package/dist/web/public/mobile.6153d275.css.br +0 -0
  79. package/dist/web/public/mobile.6153d275.css.gz +0 -0
  80. package/dist/web/public/session-ui.fd39c53c.js.br +0 -0
  81. package/dist/web/public/session-ui.fd39c53c.js.gz +0 -0
  82. package/dist/web/public/styles.bd210c71.css.br +0 -0
  83. package/dist/web/public/styles.bd210c71.css.gz +0 -0
  84. package/dist/web/public/terminal-ui.feaf75c2.js.br +0 -0
  85. package/dist/web/public/terminal-ui.feaf75c2.js.gz +0 -0
package/README.md CHANGED
@@ -13,7 +13,6 @@
13
13
  <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-22%2B-22c55e?style=flat-square&logo=node.js&logoColor=white" alt="Node.js 22+"></a>
14
14
  <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.9-3b82f6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript 5.9"></a>
15
15
  <a href="https://fastify.dev/"><img src="https://img.shields.io/badge/Fastify-5.x-1e3a5f?style=flat-square&logo=fastify&logoColor=white" alt="Fastify"></a>
16
- <img src="https://img.shields.io/badge/Tests-2861%20total-22c55e?style=flat-square" alt="Tests">
17
16
  <a href="https://www.npmjs.com/package/aicodeman"><img src="https://img.shields.io/npm/v/aicodeman?style=flat-square&label=npm&color=22c55e" alt="npm version"></a>
18
17
  <a href="https://github.com/Ark0N/Codeman/stargazers"><img src="https://img.shields.io/github/stars/Ark0N/Codeman?style=flat-square&color=eab308" alt="GitHub stars"></a>
19
18
  <a href="https://github.com/Ark0N/Codeman/graphs/contributors"><img src="https://img.shields.io/github/contributors/Ark0N/Codeman?style=flat-square&color=3b82f6" alt="Contributors"></a>
@@ -30,6 +29,19 @@
30
29
 
31
30
  **Codeman** is a self-hosted mission control for AI coding agents. It spawns Claude Code, OpenCode, Codex, or Gemini CLI inside persistent tmux sessions, streams the real terminal to any browser, and keeps agents productive after you walk away: it re-prompts on idle, resumes when a usage limit resets, runs scheduled jobs, and shows every background agent working in real time.
32
31
 
32
+ Get started in one line (macOS & Linux, Windows via WSL):
33
+
34
+ ```bash
35
+ curl -fsSL https://getcodeman.com/install | bash
36
+ ```
37
+
38
+ ```bash
39
+ codeman web
40
+ # Open http://localhost:3000 and start your first session
41
+ ```
42
+
43
+ The installer asks before every system change, and re-running the same line updates in place. Full details: [Quick Start - Installation](#quick-start---installation).
44
+
33
45
  - **One dashboard, four CLIs** - run [Claude Code, OpenCode, Codex, or Gemini](#more-features) per session (plus plain shell), locally, [in Docker](#isolated-docker-sessions), or [over SSH](#remote-ssh-sessions)
34
46
  - **Truly phone-friendly** - a [touch-optimized terminal](#mobile-optimized-web-ui) with instant local echo, QR login, swipe navigation, and push notifications
35
47
  - **Runs while you sleep** - [idle detection + respawn cycling](#respawn-controller) and auto-resume when a subscription limit resets, for 24+ hour unattended runs
@@ -46,7 +58,7 @@
46
58
  ## Quick Start - Installation
47
59
 
48
60
  ```bash
49
- curl -fsSL https://raw.githubusercontent.com/Ark0N/Codeman/master/install.sh | bash
61
+ curl -fsSL https://getcodeman.com/install | bash
50
62
  ```
51
63
 
52
64
  This installs Node.js and tmux if missing, clones Codeman to `~/.codeman/app`, and builds it. A few things worth knowing:
@@ -136,7 +148,7 @@ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.codeman.web.plist
136
148
  <summary><strong>Windows (WSL)</strong></summary>
137
149
 
138
150
  ```powershell
139
- wsl bash -c "curl -fsSL https://raw.githubusercontent.com/Ark0N/Codeman/master/install.sh | bash"
151
+ wsl bash -c "curl -fsSL https://getcodeman.com/install | bash"
140
152
  ```
141
153
 
142
154
  Codeman requires tmux, so Windows users need [WSL](https://learn.microsoft.com/en-us/windows/wsl/install). If you don't have WSL yet: run `wsl --install` in an admin PowerShell, reboot, open Ubuntu, then install your preferred AI coding CLI inside WSL ([Claude Code](https://docs.anthropic.com/en/docs/claude-code), [OpenCode](https://opencode.ai), [Codex](https://developers.openai.com/codex/cli), or [Gemini CLI](https://github.com/google-gemini/gemini-cli)). After installing, `http://localhost:3000` is accessible from your Windows browser.
@@ -145,6 +157,58 @@ Codeman requires tmux, so Windows users need [WSL](https://learn.microsoft.com/e
145
157
 
146
158
  ---
147
159
 
160
+ ## Mobile-Optimized Web UI
161
+
162
+ The most responsive AI coding agent experience on any phone. Full xterm.js terminal with local echo, swipe navigation, and a touch-optimized interface designed for real remote work — not a desktop UI crammed onto a small screen.
163
+
164
+ <table>
165
+ <tr>
166
+ <td align="center" width="40%"><img src="docs/screenshots/mobile-session-keyboard-20260727.png" alt="Mobile — answering an agent's plan prompt with the keyboard accessory bar and Enter button" width="300"></td>
167
+ <td align="center" width="60%"><img src="docs/screenshots/mobile-toolbar-enter-20260727.png" alt="Mobile toolbar: accessory bar with /init, /clear, clipboard and Esc above the Run, case, stop, Enter, voice and settings controls" width="440"></td>
168
+ </tr>
169
+ <tr>
170
+ <td align="center"><em>Answering prompts by touch</em></td>
171
+ <td align="center"><em>Accessory bar + dedicated Enter button</em></td>
172
+ </tr>
173
+ </table>
174
+
175
+ <table>
176
+ <tr>
177
+ <th>Terminal Apps</th>
178
+ <th>Codeman Mobile</th>
179
+ </tr>
180
+ <tr><td>200-300ms input lag over remote</td><td><b>Local echo — instant feedback</b></td></tr>
181
+ <tr><td>Tiny text, no context</td><td>Full xterm.js terminal</td></tr>
182
+ <tr><td>No session management</td><td>Swipe between sessions</td></tr>
183
+ <tr><td>No notifications</td><td>Push alerts for approvals and idle</td></tr>
184
+ <tr><td>Manual reconnect</td><td>tmux persistence</td></tr>
185
+ <tr><td>No agent visibility</td><td>Background agents in real-time</td></tr>
186
+ <tr><td>Copy-paste slash commands</td><td>One-tap <code>/init</code>, <code>/clear</code>, <code>/compact</code></td></tr>
187
+ <tr><td>Password typing on phone</td><td><b>QR code scan — instant auth</b></td></tr>
188
+ </table>
189
+
190
+ - **Keyboard accessory bar** — `/init`, `/clear`, `/compact` quick-action buttons above the virtual keyboard; destructive commands require a double-press to confirm, so you never fire one by accident
191
+ - **Dedicated Enter button** — replays the keypress through the terminal, so text buffered by local echo is flushed first rather than stranded
192
+ - **Swipe navigation & smart keyboard handling** — swipe left/right to switch sessions; toolbar and terminal shift up when the keyboard opens (`visualViewport` API)
193
+ - **Built for phones** — safe-area insets for notch and home indicator, 44px touch targets, bottom-sheet case picker, native momentum scrolling
194
+
195
+ ```bash
196
+ codeman web --https
197
+ # Open on your phone: https://<your-ip>:3000
198
+ ```
199
+
200
+ > `localhost` works over plain HTTP. Use `--https` when accessing from another device, or use [Tailscale](https://tailscale.com/) (recommended) — it provides a private network so you can access `http://<tailscale-ip>:3000` from your phone without TLS certificates.
201
+
202
+ ### Secure QR Code Authentication
203
+
204
+ Typing passwords on a phone keyboard is miserable. Codeman replaces it with **cryptographically secure single-use QR tokens** — scan the code displayed on your desktop and your phone is authenticated instantly.
205
+
206
+ Each QR encodes a URL containing a 6-character short code that maps to a 256-bit secret (`crypto.randomBytes(32)`) on the server. Tokens auto-rotate every **60 seconds**, are **atomically consumed on first scan** (replays always fail), and use **hash-based `Map.get()` lookup** that leaks nothing through response timing. The short code is an opaque pointer — the real secret never appears in browser history, `Referer` headers, or Cloudflare edge logs.
207
+
208
+ The security design addresses all 6 critical QR auth flaws identified in ["Demystifying the (In)Security of QR Code-based Login"](https://www.usenix.org/conference/usenixsecurity25/presentation/zhang-xin) (USENIX Security 2025, which found 47 of the top-100 websites vulnerable): single-use enforcement, short TTL, cryptographic randomness, server-side generation, real-time desktop notification on scan (QRLjacking detection), and IP + User-Agent session binding with manual revocation. Dual-layer rate limiting (per-IP + global) makes brute force infeasible across 62^6 = 56.8 billion possible codes. Full security analysis: [`docs/qr-auth-plan.md`](docs/qr-auth-plan.md)
209
+
210
+ ---
211
+
148
212
  ## Using Codeman — A Human's Guide
149
213
 
150
214
  A start-to-finish walkthrough for driving Codeman from the browser. If you just installed, this is where to begin.
@@ -177,7 +241,7 @@ Hit start — Codeman spawns the CLI via a real PTY and streams it to your brows
177
241
 
178
242
  - **Tabs (top)** — one per session. `Alt+1`-`9` to jump, `Ctrl+Tab` for next, drag to reorder (tab order syncs across your devices).
179
243
  - **Terminal (center)** — a real `xterm.js` terminal; full TUIs render correctly. Type directly and press **Enter** to send. `Shift+Enter` inserts a newline.
180
- - **Side panels** — Respawn, Ralph, Orchestrator, Cron, Subagents, Settings (toggled from the toolbar).
244
+ - **Side panels** — Respawn, Orchestrator, Cron, Subagents, Settings (toggled from the toolbar).
181
245
 
182
246
  ### 4. Talk to the agent
183
247
 
@@ -191,7 +255,6 @@ Hit start — Codeman spawns the CLI via a real PTY and streams it to your brows
191
255
  | Mode | Use it for | Where |
192
256
  | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
193
257
  | **Respawn** | Long unattended runs — auto-restarts the CLI on idle/limit, with adaptive timing. Presets: `solo-work`, `overnight-autonomous`, … | Respawn tab |
194
- | **Ralph / Todo** | A self-driving loop that tracks a todo list and keeps working until done. | Ralph tab |
195
258
  | **Orchestrator** | Turn one goal into a phased plan and drive it to completion across agents. | Orchestrator panel |
196
259
  | **Cron** | Saved, named jobs on a schedule (`once`/`interval`/`daily`/`weekly`) that spawn a session and send a prompt when due. | ⏰ Cron button _(opt-in: App Settings → Display → Header Displays)_ |
197
260
  | **Auto-resume** | Automatically continue after a subscription rate-limit resets. | Respawn tab (top) |
@@ -212,67 +275,23 @@ Hit start — Codeman spawns the CLI via a real PTY and streams it to your brows
212
275
 
213
276
  ---
214
277
 
215
- ## Mobile-Optimized Web UI
216
-
217
- The most responsive AI coding agent experience on any phone. Full xterm.js terminal with local echo, swipe navigation, and a touch-optimized interface designed for real remote work — not a desktop UI crammed onto a small screen.
218
-
219
- <table>
220
- <tr>
221
- <td align="center" width="33%"><img src="docs/screenshots/mobile-landing-qr.png" alt="Mobile — landing page with QR auth" width="260"></td>
222
- <td align="center" width="33%"><img src="docs/screenshots/mobile-session-keyboard-20260727.png" alt="Mobile — answering an agent's plan prompt with the keyboard accessory bar and Enter button" width="260"></td>
223
- <td align="center" width="33%"><img src="docs/screenshots/mobile-session-active.png" alt="Mobile — active agent session" width="260"></td>
224
- </tr>
225
- <tr>
226
- <td align="center"><em>Landing page with QR auth</em></td>
227
- <td align="center"><em>Answering prompts by touch</em></td>
228
- <td align="center"><em>Agent working in real-time</em></td>
229
- </tr>
230
- </table>
231
-
232
- <table>
233
- <tr>
234
- <th>Terminal Apps</th>
235
- <th>Codeman Mobile</th>
236
- </tr>
237
- <tr><td>200-300ms input lag over remote</td><td><b>Local echo — instant feedback</b></td></tr>
238
- <tr><td>Tiny text, no context</td><td>Full xterm.js terminal</td></tr>
239
- <tr><td>No session management</td><td>Swipe between sessions</td></tr>
240
- <tr><td>No notifications</td><td>Push alerts for approvals and idle</td></tr>
241
- <tr><td>Manual reconnect</td><td>tmux persistence</td></tr>
242
- <tr><td>No agent visibility</td><td>Background agents in real-time</td></tr>
243
- <tr><td>Copy-paste slash commands</td><td>One-tap <code>/init</code>, <code>/clear</code>, <code>/compact</code></td></tr>
244
- <tr><td>Password typing on phone</td><td><b>QR code scan — instant auth</b></td></tr>
245
- </table>
246
-
247
- ### Secure QR Code Authentication
248
-
249
- Typing passwords on a phone keyboard is miserable. Codeman replaces it with **cryptographically secure single-use QR tokens** — scan the code displayed on your desktop and your phone is authenticated instantly.
250
-
251
- Each QR encodes a URL containing a 6-character short code that maps to a 256-bit secret (`crypto.randomBytes(32)`) on the server. Tokens auto-rotate every **60 seconds**, are **atomically consumed on first scan** (replays always fail), and use **hash-based `Map.get()` lookup** that leaks nothing through response timing. The short code is an opaque pointer — the real secret never appears in browser history, `Referer` headers, or Cloudflare edge logs.
252
-
253
- The security design addresses all 6 critical QR auth flaws identified in ["Demystifying the (In)Security of QR Code-based Login"](https://www.usenix.org/conference/usenixsecurity25/presentation/zhang-xin) (USENIX Security 2025, which found 47 of the top-100 websites vulnerable): single-use enforcement, short TTL, cryptographic randomness, server-side generation, real-time desktop notification on scan (QRLjacking detection), and IP + User-Agent session binding with manual revocation. Dual-layer rate limiting (per-IP + global) makes brute force infeasible across 62^6 = 56.8 billion possible codes. Full security analysis: [`docs/qr-auth-plan.md`](docs/qr-auth-plan.md)
254
-
255
- ### Touch-Optimized Interface
278
+ ## Zero-Lag Input Overlay
256
279
 
257
280
  <p align="center">
258
- <img src="docs/screenshots/mobile-toolbar-enter-20260727.png" alt="Mobile toolbar: accessory bar with /init, /clear, clipboard and Esc above the Run, case, stop, Enter, voice and settings controls" width="560">
281
+ <img src="docs/images/zerolag-demo-20260728.gif" alt="Zerolag demo: instant local echo next to 600ms-2.7s server echo, side by side on two phones" width="900">
259
282
  </p>
260
283
 
261
- - **Keyboard accessory bar** `/init`, `/clear`, `/compact` quick-action buttons above the virtual keyboard. Destructive commands (`/clear`, `/compact`) require a double-press to confirm first tap arms the button, second tap executes — so you never fire one by accident on a bumpy commute
262
- - **Dedicated Enter button** — submitting is a constant need on a touch keyboard, so the phone toolbar gives it a button of its own. It replays the keypress through the terminal, so text buffered by local echo is flushed first rather than stranded. Starting a shell moves into the Run dropdown (`Terminal / Shell`), which is the rarer action
263
- - **Swipe navigation** — left/right on the terminal to switch sessions (80px threshold, 300ms)
264
- - **Smart keyboard handling** — toolbar and terminal shift up when keyboard opens (uses `visualViewport` API with 100px threshold for iOS address bar drift)
265
- - **Safe area support** — respects iPhone notch and home indicator via `env(safe-area-inset-*)`
266
- - **44px touch targets** — all buttons meet iOS Human Interface Guidelines minimum sizes
267
- - **Bottom sheet case picker** — slide-up modal replaces the desktop dropdown
268
- - **Native momentum scrolling** — `-webkit-overflow-scrolling: touch` for buttery scroll
284
+ When accessing your coding agent remotely (VPN, Tailscale, SSH tunnel), every keystroke normally takes 200-300ms to round-trip. Codeman implements a **Mosh-inspired local echo system** that makes typing feel instant regardless of latency.
269
285
 
270
- ```bash
271
- codeman web --https
272
- # Open on your phone: https://<your-ip>:3000
273
- ```
286
+ A pixel-perfect DOM overlay inside xterm.js renders keystrokes at 0ms. Background forwarding silently sends every character to the PTY in 50ms debounced batches, so Tab completion, `Ctrl+R` history search, and all shell features work normally. When the server echo arrives 200-300ms later, the overlay seamlessly disappears and the real terminal text takes over — the transition is invisible.
274
287
 
275
- > `localhost` works over plain HTTP. Use `--https` when accessing from another device, or use [Tailscale](https://tailscale.com/) (recommended) it provides a private network so you can access `http://<tailscale-ip>:3000` from your phone without TLS certificates.
288
+ - **Ink-proof architecture** lives as a `<span>` at z-index 7 inside `.xterm-screen`, completely immune to Ink's constant screen redraws (two previous attempts using `terminal.write()` failed because Ink corrupts injected buffer content)
289
+ - **Font-matched rendering** — reads `fontFamily`, `fontSize`, `fontWeight`, and `letterSpacing` from xterm.js computed styles so overlay text is visually indistinguishable from real terminal output
290
+ - **Full editing** — backspace, retype, paste (multi-char), cursor tracking, multi-line wrap when input exceeds terminal width
291
+ - **Persistent across reconnects** — unsent input survives page reloads via localStorage
292
+ - **Enabled by default** — works on both desktop and mobile, during idle and busy sessions
293
+
294
+ > Extracted as a standalone library: [`xterm-zerolag-input`](https://www.npmjs.com/package/xterm-zerolag-input) — see [Published Packages](#published-packages).
276
295
 
277
296
  ---
278
297
 
@@ -300,26 +319,6 @@ Multi-agent Workflow runs ("ultracode") get the same treatment: a floating run w
300
319
 
301
320
  ---
302
321
 
303
- ## Zero-Lag Input Overlay
304
-
305
- <p align="center">
306
- <img src="docs/images/zerolag-demo.gif" alt="Zerolag Demo — local echo vs server echo side-by-side" width="900">
307
- </p>
308
-
309
- When accessing your coding agent remotely (VPN, Tailscale, SSH tunnel), every keystroke normally takes 200-300ms to round-trip. Codeman implements a **Mosh-inspired local echo system** that makes typing feel instant regardless of latency.
310
-
311
- A pixel-perfect DOM overlay inside xterm.js renders keystrokes at 0ms. Background forwarding silently sends every character to the PTY in 50ms debounced batches, so Tab completion, `Ctrl+R` history search, and all shell features work normally. When the server echo arrives 200-300ms later, the overlay seamlessly disappears and the real terminal text takes over — the transition is invisible.
312
-
313
- - **Ink-proof architecture** — lives as a `<span>` at z-index 7 inside `.xterm-screen`, completely immune to Ink's constant screen redraws (two previous attempts using `terminal.write()` failed because Ink corrupts injected buffer content)
314
- - **Font-matched rendering** — reads `fontFamily`, `fontSize`, `fontWeight`, and `letterSpacing` from xterm.js computed styles so overlay text is visually indistinguishable from real terminal output
315
- - **Full editing** — backspace, retype, paste (multi-char), cursor tracking, multi-line wrap when input exceeds terminal width
316
- - **Persistent across reconnects** — unsent input survives page reloads via localStorage
317
- - **Enabled by default** — works on both desktop and mobile, during idle and busy sessions
318
-
319
- > Extracted as a standalone library: [`xterm-zerolag-input`](https://www.npmjs.com/package/xterm-zerolag-input) — see [Published Packages](#published-packages).
320
-
321
- ---
322
-
323
322
  ## Respawn Controller
324
323
 
325
324
  The core of autonomous work. When the agent goes idle, the Respawn Controller detects it, sends a continue prompt, cycles context management commands for fresh context, and resumes — running **24+ hours** completely unattended.
@@ -346,7 +345,7 @@ Beyond single-session respawn, the **Orchestrator** turns a high-level goal into
346
345
  - **Crash-safe** — full state persists under the `orchestrator` key in `state.json`, so it survives restarts
347
346
  - **Driven from the UI or API** — the Orchestrator panel, or `POST /api/orchestrator/start` → `/approve` → `/status` (10 endpoints)
348
347
 
349
- > Distinct from Ralph (a single-session autonomous loop): the orchestrator coordinates multi-phase, multi-agent execution. Full design: [`docs/orchestrator-loop-architecture.md`](docs/orchestrator-loop-architecture.md).
348
+ > Full design: [`docs/orchestrator-loop-architecture.md`](docs/orchestrator-loop-architecture.md).
350
349
 
351
350
  ---
352
351
 
@@ -354,10 +353,6 @@ Beyond single-session respawn, the **Orchestrator** turns a high-level goal into
354
353
 
355
354
  Run **20 parallel sessions** with full visibility — real-time xterm.js terminals at 60fps, per-session token and cost tracking, tab-based navigation, and one-click management.
356
355
 
357
- <p align="center">
358
- <img src="docs/screenshots/multi-session-dashboard.png" alt="Multi-Session Dashboard" width="800">
359
- </p>
360
-
361
356
  ### Persistent Sessions
362
357
 
363
358
  Every session runs inside **tmux** — sessions survive server restarts, network drops, and machine sleep. Auto-recovery on startup with dual redundancy. Ghost session discovery finds orphaned tmux sessions. Managed sessions are environment-tagged so the agent won't kill its own session.
@@ -392,14 +387,6 @@ The title is templated into the served HTML on first byte, so it's correct from
392
387
 
393
388
  Real-time desktop alerts when sessions need attention — `permission_prompt` and `elicitation_dialog` trigger critical red tab blinks, `idle_prompt` triggers yellow blinks. Click any notification to jump directly to the affected session. Hooks auto-configured per case directory.
394
389
 
395
- ### Ralph / Todo Tracking
396
-
397
- Auto-detects Ralph Loops, `<promise>` tags, TodoWrite progress (`4/9 complete`), and iteration counters (`[5/50]`) with real-time progress rings and elapsed time tracking.
398
-
399
- <p align="center">
400
- <img src="docs/images/ralph-tracker-8tasks-44percent.png" alt="Ralph Loop Tracking" width="800">
401
- </p>
402
-
403
390
  ### Run Summary
404
391
 
405
392
  Click the chart icon on any session tab to see a timeline of everything that happened — respawn cycles, token milestones, auto-compact triggers, idle/working transitions, hook events, errors, and more.
@@ -747,7 +734,6 @@ codeman session start -d /path/to/repo # (s) start a session
747
734
  codeman session list # list sessions
748
735
  codeman session logs <id> # tail output
749
736
  codeman task add "fix the failing test" # (t) queue a task
750
- codeman ralph start --min-hours 8 # (r) launch the autonomous loop
751
737
  codeman attach <path> # attach a Claude hook context
752
738
  ```
753
739
 
@@ -784,13 +770,6 @@ REST over Fastify — **~190 handlers across 20 route modules**, plus an SSE str
784
770
  | `POST` | `/api/sessions/:id/respawn/stop` | Stop controller |
785
771
  | `PUT` | `/api/sessions/:id/respawn/config` | Update config |
786
772
 
787
- ### Ralph / Todo
788
-
789
- | Method | Endpoint | Description |
790
- | ------ | -------------------------------- | ---------------------- |
791
- | `GET` | `/api/sessions/:id/ralph-state` | Get loop state + todos |
792
- | `POST` | `/api/sessions/:id/ralph-config` | Configure tracking |
793
-
794
773
  ### Orchestrator
795
774
 
796
775
  | Method | Endpoint | Description |
@@ -853,7 +832,6 @@ flowchart TB
853
832
  end
854
833
 
855
834
  subgraph Detection["Detection Layer"]
856
- RT["Ralph Tracker"]
857
835
  SW["Subagent Watcher<br/><small>~/.claude/projects/*/subagents</small>"]
858
836
  TW["Team Watcher<br/><small>~/.claude/teams/*</small>"]
859
837
  end
@@ -877,7 +855,6 @@ flowchart TB
877
855
  SM --> RC
878
856
  SM --> ORC
879
857
  SM --> SS
880
- S1 --> RT
881
858
  S1 --> SCR
882
859
  S2 --> SCR
883
860
  RC --> SCR
package/README.zh-CN.md CHANGED
@@ -17,7 +17,6 @@
17
17
  <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-22%2B-22c55e?style=flat-square&logo=node.js&logoColor=white" alt="Node.js 22+"></a>
18
18
  <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.9-3b82f6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript 5.9"></a>
19
19
  <a href="https://fastify.dev/"><img src="https://img.shields.io/badge/Fastify-5.x-1e3a5f?style=flat-square&logo=fastify&logoColor=white" alt="Fastify"></a>
20
- <img src="https://img.shields.io/badge/Tests-2861%20total-22c55e?style=flat-square" alt="Tests">
21
20
  <a href="https://github.com/Ark0N/Codeman/graphs/contributors"><img src="https://img.shields.io/github/contributors/Ark0N/Codeman?style=flat-square&color=3b82f6" alt="Contributors"></a>
22
21
  <a href="https://github.com/Ark0N/Codeman/commits/master"><img src="https://img.shields.io/github/commit-activity/t/Ark0N/Codeman?style=flat-square&color=1e3a5f" alt="Total commits"></a>
23
22
  </p>
@@ -32,12 +31,25 @@
32
31
 
33
32
  > 本文档由英文版 [`README.md`](README.md) 翻译而来。如有出入,以英文版为准。
34
33
 
34
+ 一行命令即可安装(macOS 和 Linux,Windows 通过 WSL):
35
+
36
+ ```bash
37
+ curl -fsSL https://getcodeman.com/install | bash
38
+ ```
39
+
40
+ ```bash
41
+ codeman web
42
+ # 打开 http://localhost:3000,开启你的第一个会话
43
+ ```
44
+
45
+ 安装器在每次系统改动前都会先询问;重跑同一条命令即可原地更新。详见[快速开始 — 安装](#快速开始--安装)。
46
+
35
47
  ---
36
48
 
37
49
  ## 快速开始 — 安装
38
50
 
39
51
  ```bash
40
- curl -fsSL https://raw.githubusercontent.com/Ark0N/Codeman/master/install.sh | bash
52
+ curl -fsSL https://getcodeman.com/install | bash
41
53
  ```
42
54
 
43
55
  该脚本会在缺失时自动安装 Node.js 和 tmux,把 Codeman 克隆到 `~/.codeman/app` 并完成构建。几点须知:
@@ -126,7 +138,7 @@ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.codeman.web.plist
126
138
  <summary><strong>Windows(WSL)</strong></summary>
127
139
 
128
140
  ```powershell
129
- wsl bash -c "curl -fsSL https://raw.githubusercontent.com/Ark0N/Codeman/master/install.sh | bash"
141
+ wsl bash -c "curl -fsSL https://getcodeman.com/install | bash"
130
142
  ```
131
143
 
132
144
  Codeman 依赖 tmux,因此 Windows 用户需要 [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)。如果还没装 WSL:在管理员 PowerShell 中运行 `wsl --install`,重启,打开 Ubuntu,然后在 WSL 内安装你偏好的 AI 编程 CLI([Claude Code](https://docs.anthropic.com/en/docs/claude-code)、[OpenCode](https://opencode.ai)、[Codex](https://developers.openai.com/codex/cli) 或 [Gemini CLI](https://github.com/google-gemini/gemini-cli))。安装完成后,即可从 Windows 浏览器访问 `http://localhost:3000`。
@@ -135,6 +147,58 @@ Codeman 依赖 tmux,因此 Windows 用户需要 [WSL](https://learn.microsoft.
135
147
 
136
148
  ---
137
149
 
150
+ ## 移动端优化的 Web UI
151
+
152
+ 在任意手机上都能获得最跟手的 AI 编程智能体体验。完整的 xterm.js 终端、本地回显、滑动导航,以及为真正的远程办公而设计的触控优化界面 —— 而不是把桌面 UI 硬塞进小屏幕。
153
+
154
+ <table>
155
+ <tr>
156
+ <td align="center" width="40%"><img src="docs/screenshots/mobile-session-keyboard-20260727.png" alt="移动端 — 通过键盘配件栏与 Enter 按钮回答智能体的方案提示" width="300"></td>
157
+ <td align="center" width="60%"><img src="docs/screenshots/mobile-toolbar-enter-20260727.png" alt="移动端工具栏:配件栏的 /init、/clear、剪贴板与 Esc,下方是 Run、案例、停止、Enter、语音与设置控件" width="440"></td>
158
+ </tr>
159
+ <tr>
160
+ <td align="center"><em>触控回答提示</em></td>
161
+ <td align="center"><em>配件栏 + 独立 Enter 按钮</em></td>
162
+ </tr>
163
+ </table>
164
+
165
+ <table>
166
+ <tr>
167
+ <th>普通终端 App</th>
168
+ <th>Codeman 移动端</th>
169
+ </tr>
170
+ <tr><td>远程输入延迟 200–300 毫秒</td><td><b>本地回显 —— 即时反馈</b></td></tr>
171
+ <tr><td>字小、无上下文</td><td>完整 xterm.js 终端</td></tr>
172
+ <tr><td>无会话管理</td><td>滑动切换会话</td></tr>
173
+ <tr><td>无通知</td><td>审批 / 空闲时推送提醒</td></tr>
174
+ <tr><td>需手动重连</td><td>tmux 持久化</td></tr>
175
+ <tr><td>看不到智能体</td><td>实时查看后台智能体</td></tr>
176
+ <tr><td>斜杠命令靠复制粘贴</td><td>一键 <code>/init</code>、<code>/clear</code>、<code>/compact</code></td></tr>
177
+ <tr><td>在手机上手打密码</td><td><b>扫二维码 —— 即时认证</b></td></tr>
178
+ </table>
179
+
180
+ - **键盘配件栏** —— 在虚拟键盘上方提供 `/init`、`/clear`、`/compact` 快捷按钮;破坏性命令需双击确认,绝不误触
181
+ - **独立的 Enter 按钮** —— 以按键方式回放,先冲刷本地回显缓冲的文本,不会让内容滞留在屏幕上
182
+ - **滑动导航与智能键盘处理** —— 左右滑动切换会话;键盘弹出时工具栏与终端整体上移(`visualViewport` API)
183
+ - **为手机而生** —— 刘海与 Home 指示条的安全区适配、44px 触控目标、底部抽屉式 case 选择器、原生惯性滚动
184
+
185
+ ```bash
186
+ codeman web --https
187
+ # 在手机上打开:https://<你的IP>:3000
188
+ ```
189
+
190
+ > `localhost` 走纯 HTTP 即可。从其他设备访问时请使用 `--https`,或使用 [Tailscale](https://tailscale.com/)(推荐)—— 它提供私有网络,让你无需 TLS 证书即可从手机访问 `http://<tailscale-ip>:3000`。
191
+
192
+ ### 安全的二维码认证
193
+
194
+ 在手机键盘上输密码太痛苦了。Codeman 用**密码学安全的一次性二维码令牌**取而代之 —— 扫描桌面上显示的二维码,手机即刻完成认证。
195
+
196
+ 每个二维码编码的是一个包含 6 字符短码的 URL,该短码在服务端映射到一个 256 位密钥(`crypto.randomBytes(32)`)。令牌每 **60 秒**自动轮换,**首次扫描即原子性消费**(重放永远失败),并采用**基于哈希的 `Map.get()` 查找**,不会通过响应时延泄露任何信息。短码只是一个不透明指针 —— 真正的密钥永远不会出现在浏览器历史、`Referer` 头或 Cloudflare 边缘日志中。
197
+
198
+ 该安全设计覆盖了 ["Demystifying the (In)Security of QR Code-based Login"](https://www.usenix.org/conference/usenixsecurity25/presentation/zhang-xin)(USENIX Security 2025,该研究发现 Top-100 网站中有 47 个存在漏洞)所指出的全部 6 个关键二维码认证缺陷:强制一次性使用、短 TTL、密码学随机性、服务端生成、扫描时桌面实时通知(QRLjacking 检测),以及 IP + User-Agent 会话绑定与手动吊销。双层速率限制(按 IP + 全局)使得在 62^6 = 568 亿种可能短码空间内进行暴力破解变得不可行。完整安全分析见:[`docs/qr-auth-plan.md`](docs/qr-auth-plan.md)
199
+
200
+ ---
201
+
138
202
  ## 使用 Codeman —— 人类操作指南
139
203
 
140
204
  从头到尾走一遍如何在浏览器里驾驭 Codeman。如果你刚装好,就从这里开始。
@@ -167,7 +231,7 @@ codeman web -H 0.0.0.0 # 绑定局域网 —— 必须设置 CODEMAN_
167
231
 
168
232
  - **标签(顶部)** —— 每个会话一个。`Alt+1`–`9` 跳转,`Ctrl+Tab` 下一个,拖拽排序(标签顺序会跨设备同步)。
169
233
  - **终端(中央)** —— 真实的 `xterm.js` 终端;完整 TUI 正常渲染。直接输入并按 **Enter** 发送。`Shift+Enter` 插入换行。
170
- - **侧边面板** —— Respawn、Ralph、Orchestrator、Cron、Subagents、Settings(从工具栏切换)。
234
+ - **侧边面板** —— Respawn、Orchestrator、Cron、Subagents、Settings(从工具栏切换)。
171
235
 
172
236
  ### 4. 与智能体对话
173
237
 
@@ -181,7 +245,6 @@ codeman web -H 0.0.0.0 # 绑定局域网 —— 必须设置 CODEMAN_
181
245
  | 模式 | 用途 | 位置 |
182
246
  | ---------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
183
247
  | **Respawn** | 长时间无人值守运行 —— 空闲/限额时自动重启 CLI,带自适应时序。预设:`solo-work`、`overnight-autonomous` 等 | Respawn 标签页 |
184
- | **Ralph / Todo** | 一个自驱循环,跟踪 todo 列表并持续工作直到完成。 | Ralph 标签页 |
185
248
  | **Orchestrator** | 把一个目标变成分阶段计划,并跨多个智能体推动完成。 | 编排器面板 |
186
249
  | **Cron** | 已保存的、命名的定时任务(`once`/`interval`/`daily`/`weekly`),到期时拉起会话并发送提示。 | ⏰ Cron 按钮(可选启用:App Settings → Display → Header Displays) |
187
250
  | **Auto-resume** | 订阅限额重置后自动继续。 | Respawn 标签页(顶部) |
@@ -202,67 +265,23 @@ codeman web -H 0.0.0.0 # 绑定局域网 —— 必须设置 CODEMAN_
202
265
 
203
266
  ---
204
267
 
205
- ## 移动端优化的 Web UI
206
-
207
- 在任意手机上都能获得最跟手的 AI 编程智能体体验。完整的 xterm.js 终端、本地回显、滑动导航,以及为真正的远程办公而设计的触控优化界面 —— 而不是把桌面 UI 硬塞进小屏幕。
208
-
209
- <table>
210
- <tr>
211
- <td align="center" width="33%"><img src="docs/screenshots/mobile-landing-qr.png" alt="移动端 — 带二维码认证的登录页" width="260"></td>
212
- <td align="center" width="33%"><img src="docs/screenshots/mobile-session-keyboard-20260727.png" alt="移动端 — 通过键盘配件栏与 Enter 按钮回答智能体的方案提示" width="260"></td>
213
- <td align="center" width="33%"><img src="docs/screenshots/mobile-session-active.png" alt="移动端 — 活动中的智能体会话" width="260"></td>
214
- </tr>
215
- <tr>
216
- <td align="center"><em>带二维码认证的登录页</em></td>
217
- <td align="center"><em>触控回答提示</em></td>
218
- <td align="center"><em>智能体实时工作中</em></td>
219
- </tr>
220
- </table>
221
-
222
- <table>
223
- <tr>
224
- <th>普通终端 App</th>
225
- <th>Codeman 移动端</th>
226
- </tr>
227
- <tr><td>远程输入延迟 200–300 毫秒</td><td><b>本地回显 —— 即时反馈</b></td></tr>
228
- <tr><td>字小、无上下文</td><td>完整 xterm.js 终端</td></tr>
229
- <tr><td>无会话管理</td><td>滑动切换会话</td></tr>
230
- <tr><td>无通知</td><td>审批 / 空闲时推送提醒</td></tr>
231
- <tr><td>需手动重连</td><td>tmux 持久化</td></tr>
232
- <tr><td>看不到智能体</td><td>实时查看后台智能体</td></tr>
233
- <tr><td>斜杠命令靠复制粘贴</td><td>一键 <code>/init</code>、<code>/clear</code>、<code>/compact</code></td></tr>
234
- <tr><td>在手机上手打密码</td><td><b>扫二维码 —— 即时认证</b></td></tr>
235
- </table>
236
-
237
- ### 安全的二维码认证
238
-
239
- 在手机键盘上输密码太痛苦了。Codeman 用**密码学安全的一次性二维码令牌**取而代之 —— 扫描桌面上显示的二维码,手机即刻完成认证。
240
-
241
- 每个二维码编码的是一个包含 6 字符短码的 URL,该短码在服务端映射到一个 256 位密钥(`crypto.randomBytes(32)`)。令牌每 **60 秒**自动轮换,**首次扫描即原子性消费**(重放永远失败),并采用**基于哈希的 `Map.get()` 查找**,不会通过响应时延泄露任何信息。短码只是一个不透明指针 —— 真正的密钥永远不会出现在浏览器历史、`Referer` 头或 Cloudflare 边缘日志中。
242
-
243
- 该安全设计覆盖了 ["Demystifying the (In)Security of QR Code-based Login"](https://www.usenix.org/conference/usenixsecurity25/presentation/zhang-xin)(USENIX Security 2025,该研究发现 Top-100 网站中有 47 个存在漏洞)所指出的全部 6 个关键二维码认证缺陷:强制一次性使用、短 TTL、密码学随机性、服务端生成、扫描时桌面实时通知(QRLjacking 检测),以及 IP + User-Agent 会话绑定与手动吊销。双层速率限制(按 IP + 全局)使得在 62^6 = 568 亿种可能短码空间内进行暴力破解变得不可行。完整安全分析见:[`docs/qr-auth-plan.md`](docs/qr-auth-plan.md)
244
-
245
- ### 触控优化界面
268
+ ## 零延迟输入叠加层
246
269
 
247
270
  <p align="center">
248
- <img src="docs/screenshots/mobile-toolbar-enter-20260727.png" alt="移动端工具栏:配件栏的 /init、/clear、剪贴板与 Esc,下方是 Run、案例、停止、Enter、语音与设置控件" width="560">
271
+ <img src="docs/images/zerolag-demo-20260728.gif" alt="Zerolag 演示:两台手机并排对比,即时本地回显与 600ms-2.7s 服务端回显" width="900">
249
272
  </p>
250
273
 
251
- - **键盘配件栏** —— 在虚拟键盘上方提供 `/init`、`/clear`、`/compact` 快捷按钮。破坏性命令(`/clear`、`/compact`)需双击确认 —— 第一次点击「上膛」,第二次点击执行 —— 这样在颠簸的通勤路上也不会误触
252
- - **独立的 Enter 按钮** —— 在触控键盘上提交是高频操作,因此手机工具栏为它单独设了一个按钮。它会以按键的方式回放,从而先冲刷本地回显缓冲的文本,不会让内容滞留在屏幕上。启动 Shell 这类低频操作则移入 Run 下拉菜单(`Terminal / Shell`)
253
- - **滑动导航** —— 在终端上左右滑动切换会话(阈值 80px,300ms)
254
- - **智能键盘处理** —— 键盘弹出时工具栏与终端整体上移(使用 `visualViewport` API,并对 iOS 地址栏漂移设置 100px 阈值)
255
- - **安全区适配** —— 通过 `env(safe-area-inset-*)` 适配 iPhone 刘海与底部 Home 指示条
256
- - **44px 触控目标** —— 所有按钮均满足 iOS 人机界面指南的最小尺寸
257
- - **底部抽屉式 case 选择器** —— 用上滑模态框替代桌面端下拉菜单
258
- - **原生惯性滚动** —— `-webkit-overflow-scrolling: touch`,丝滑流畅
274
+ 远程访问你的编程智能体时(VPN、Tailscale、SSH 隧道),每次按键通常需要 200–300 毫秒往返。Codeman 实现了一套**受 Mosh 启发的本地回显系统**,无论延迟多高,打字都感觉即时。
259
275
 
260
- ```bash
261
- codeman web --https
262
- # 在手机上打开:https://<你的IP>:3000
263
- ```
276
+ xterm.js 内部一个像素级精准的 DOM 叠加层以 0ms 渲染按键。后台转发会以 50ms 防抖批次静默地把每个字符送往 PTY,因此 Tab 补全、`Ctrl+R` 历史搜索以及所有 shell 特性都正常工作。当服务端回显在 200–300ms 后到达时,叠加层无缝消失、真实终端文本接管 —— 整个切换过程不可见。
264
277
 
265
- > `localhost` 走纯 HTTP 即可。从其他设备访问时请使用 `--https`,或使用 [Tailscale](https://tailscale.com/)(推荐)—— 它提供私有网络,让你无需 TLS 证书即可从手机访问 `http://<tailscale-ip>:3000`。
278
+ - **抗 Ink 架构** —— 它作为 `.xterm-screen` z-index 7 的一个 `<span>` 存在,完全不受 Ink 持续重绘屏幕的影响(此前两次使用 `terminal.write()` 的尝试都失败了,因为 Ink 会破坏注入的缓冲区内容)
279
+ - **字体匹配渲染** —— 从 xterm.js 的计算样式读取 `fontFamily`、`fontSize`、`fontWeight` 与 `letterSpacing`,使叠加层文本与真实终端输出在视觉上无法区分
280
+ - **完整编辑** —— 退格、重打、粘贴(多字符)、光标跟踪,输入超过终端宽度时多行换行
281
+ - **重连后持久** —— 未发送的输入通过 localStorage 在页面刷新后保留
282
+ - **默认启用** —— 桌面端与移动端均可用,会话空闲或繁忙时都生效
283
+
284
+ > 已抽取为独立库:[`xterm-zerolag-input`](https://www.npmjs.com/package/xterm-zerolag-input) —— 见[已发布的包](#已发布的包)。
266
285
 
267
286
  ---
268
287
 
@@ -290,26 +309,6 @@ codeman web --https
290
309
 
291
310
  ---
292
311
 
293
- ## 零延迟输入叠加层
294
-
295
- <p align="center">
296
- <img src="docs/images/zerolag-demo.gif" alt="Zerolag 演示 —— 本地回显与服务端回显并排对比" width="900">
297
- </p>
298
-
299
- 远程访问你的编程智能体时(VPN、Tailscale、SSH 隧道),每次按键通常需要 200–300 毫秒往返。Codeman 实现了一套**受 Mosh 启发的本地回显系统**,无论延迟多高,打字都感觉即时。
300
-
301
- xterm.js 内部一个像素级精准的 DOM 叠加层以 0ms 渲染按键。后台转发会以 50ms 防抖批次静默地把每个字符送往 PTY,因此 Tab 补全、`Ctrl+R` 历史搜索以及所有 shell 特性都正常工作。当服务端回显在 200–300ms 后到达时,叠加层无缝消失、真实终端文本接管 —— 整个切换过程不可见。
302
-
303
- - **抗 Ink 架构** —— 它作为 `.xterm-screen` 内 z-index 7 的一个 `<span>` 存在,完全不受 Ink 持续重绘屏幕的影响(此前两次使用 `terminal.write()` 的尝试都失败了,因为 Ink 会破坏注入的缓冲区内容)
304
- - **字体匹配渲染** —— 从 xterm.js 的计算样式读取 `fontFamily`、`fontSize`、`fontWeight` 与 `letterSpacing`,使叠加层文本与真实终端输出在视觉上无法区分
305
- - **完整编辑** —— 退格、重打、粘贴(多字符)、光标跟踪,输入超过终端宽度时多行换行
306
- - **重连后持久** —— 未发送的输入通过 localStorage 在页面刷新后保留
307
- - **默认启用** —— 桌面端与移动端均可用,会话空闲或繁忙时都生效
308
-
309
- > 已抽取为独立库:[`xterm-zerolag-input`](https://www.npmjs.com/package/xterm-zerolag-input) —— 见[已发布的包](#已发布的包)。
310
-
311
- ---
312
-
313
312
  ## 重生控制器(Respawn Controller)
314
313
 
315
314
  自主工作的核心。当智能体进入空闲,重生控制器会检测到,发送继续提示,循环执行上下文管理命令以获得全新上下文,然后恢复工作 —— 可完全无人值守运行 **24 小时以上**。
@@ -336,7 +335,7 @@ WATCHING → IDLE DETECTED → SEND UPDATE → /clear → /init → CONTINUE →
336
335
  - **崩溃安全** —— 完整状态持久化在 `state.json` 的 `orchestrator` 键下,可在重启后存续
337
336
  - **可从 UI 或 API 驱动** —— 编排器面板,或 `POST /api/orchestrator/start` → `/approve` → `/status`(共 10 个端点)
338
337
 
339
- > 与 Ralph(单会话自主循环)不同:编排器协调多阶段、多智能体执行。完整设计:[`docs/orchestrator-loop-architecture.md`](docs/orchestrator-loop-architecture.md)。
338
+ > 完整设计:[`docs/orchestrator-loop-architecture.md`](docs/orchestrator-loop-architecture.md)。
340
339
 
341
340
  ---
342
341
 
@@ -344,10 +343,6 @@ WATCHING → IDLE DETECTED → SEND UPDATE → /clear → /init → CONTINUE →
344
343
 
345
344
  运行 **20 个并行会话**且全程可见 —— 60fps 的实时 xterm.js 终端、按会话的 token 与成本跟踪、基于标签的导航,以及一键管理。
346
345
 
347
- <p align="center">
348
- <img src="docs/screenshots/multi-session-dashboard.png" alt="多会话仪表盘" width="800">
349
- </p>
350
-
351
346
  ### 持久化会话
352
347
 
353
348
  每个会话都运行在 **tmux** 内 —— 会话可在服务器重启、网络中断与机器休眠后存续。启动时自动恢复,具备双重冗余。幽灵会话发现机制能找到孤立的 tmux 会话。受管会话带有环境标签,因此智能体不会杀掉自己的会话。
@@ -382,14 +377,6 @@ codeman web --title-hostname dev-box # codeman:dev-box(用于覆盖嘈
382
377
 
383
378
  当会话需要关注时实时桌面提醒 —— `permission_prompt` 与 `elicitation_dialog` 触发关键的红色标签闪烁,`idle_prompt` 触发黄色闪烁。点击任意通知即可直接跳转到相关会话。Hook 按 case 目录自动配置。
384
379
 
385
- ### Ralph / Todo 跟踪
386
-
387
- 自动检测 Ralph 循环、`<promise>` 标签、TodoWrite 进度(`4/9 complete`)以及迭代计数器(`[5/50]`),并提供实时进度环与已用时间跟踪。
388
-
389
- <p align="center">
390
- <img src="docs/images/ralph-tracker-8tasks-44percent.png" alt="Ralph 循环跟踪" width="800">
391
- </p>
392
-
393
380
  ### 运行摘要(Run Summary)
394
381
 
395
382
  点击任意会话标签上的图表图标,即可看到所发生一切的时间线 —— 重生周期、token 里程碑、自动 compact 触发、空闲/工作切换、hook 事件、错误等等。
@@ -737,7 +724,6 @@ codeman session start -d /path/to/repo # (s) 启动会话
737
724
  codeman session list # 列出会话
738
725
  codeman session logs <id> # 查看输出
739
726
  codeman task add "fix the failing test" # (t) 排入任务
740
- codeman ralph start --min-hours 8 # (r) 启动自主循环
741
727
  codeman attach <path> # 附着 Claude hook 上下文
742
728
  ```
743
729
 
@@ -774,13 +760,6 @@ Codeman 会注册 Claude Code hook,它们 `POST /api/hook-event`(`permission
774
760
  | `POST` | `/api/sessions/:id/respawn/stop` | 停止控制器 |
775
761
  | `PUT` | `/api/sessions/:id/respawn/config` | 更新配置 |
776
762
 
777
- ### Ralph / Todo
778
-
779
- | 方法 | 端点 | 说明 |
780
- | ------ | -------------------------------- | -------------------- |
781
- | `GET` | `/api/sessions/:id/ralph-state` | 获取循环状态 + todos |
782
- | `POST` | `/api/sessions/:id/ralph-config` | 配置跟踪 |
783
-
784
763
  ### 编排器(Orchestrator)
785
764
 
786
765
  | 方法 | 端点 | 说明 |
@@ -843,7 +822,6 @@ flowchart TB
843
822
  end
844
823
 
845
824
  subgraph Detection["检测层"]
846
- RT["Ralph 跟踪器"]
847
825
  SW["子智能体监视器<br/><small>~/.claude/projects/*/subagents</small>"]
848
826
  TW["团队监视器<br/><small>~/.claude/teams/*</small>"]
849
827
  end
@@ -867,7 +845,6 @@ flowchart TB
867
845
  SM --> RC
868
846
  SM --> ORC
869
847
  SM --> SS
870
- S1 --> RT
871
848
  S1 --> SCR
872
849
  S2 --> SCR
873
850
  RC --> SCR