aicodeman 1.6.0 → 1.6.2
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.
- package/README.md +48 -12
- package/README.zh-CN.md +68 -12
- package/dist/web/public/admin-ui.js +303 -6
- package/dist/web/public/admin-ui.js.br +0 -0
- package/dist/web/public/admin-ui.js.gz +0 -0
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/{app.b78b0465.js → app.9367fd20.js} +1 -1
- package/dist/web/public/app.9367fd20.js.br +0 -0
- package/dist/web/public/{app.b78b0465.js.gz → app.9367fd20.js.gz} +0 -0
- package/dist/web/public/constants.21a0a83e.js.gz +0 -0
- package/dist/web/public/cron-ui.js.gz +0 -0
- package/dist/web/public/image-input.ee16ad88.js.gz +0 -0
- package/dist/web/public/index.html +8 -4
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.63794d0b.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.3f91acef.js.gz +0 -0
- package/dist/web/public/mobile-handlers.b5a667ef.js.gz +0 -0
- package/dist/web/public/mobile.6a53092b.css +1 -0
- package/dist/web/public/mobile.6a53092b.css.br +0 -0
- package/dist/web/public/mobile.6a53092b.css.gz +0 -0
- package/dist/web/public/notification-manager.ca9dc40d.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/panels-ui.58582d4c.js.gz +0 -0
- package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
- package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
- package/dist/web/public/respawn-ui.2d249da9.js.gz +0 -0
- package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
- package/dist/web/public/session-ui.0cf86dd4.js.gz +0 -0
- package/dist/web/public/settings-ui.bc5f4792.js.gz +0 -0
- package/dist/web/public/styles.e9dc275f.css +1 -0
- package/dist/web/public/styles.e9dc275f.css.br +0 -0
- package/dist/web/public/{styles.7295e6f4.css.gz → styles.e9dc275f.css.gz} +0 -0
- package/dist/web/public/subagent-windows.69b60c35.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/terminal-ui.9ea677e9.js.gz +0 -0
- package/dist/web/public/ultracode-panel.js.gz +0 -0
- package/dist/web/public/ultracode-windows.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.085e9e73.js.gz +0 -0
- package/dist/web/routes/admin-routes.d.ts +2 -0
- package/dist/web/routes/admin-routes.d.ts.map +1 -1
- package/dist/web/routes/admin-routes.js +91 -2
- package/dist/web/routes/admin-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/app.b78b0465.js.br +0 -0
- package/dist/web/public/mobile.597136a6.css +0 -1
- package/dist/web/public/mobile.597136a6.css.br +0 -0
- package/dist/web/public/mobile.597136a6.css.gz +0 -0
- package/dist/web/public/styles.7295e6f4.css +0 -1
- package/dist/web/public/styles.7295e6f4.css.br +0 -0
package/README.md
CHANGED
|
@@ -41,6 +41,15 @@ codeman web
|
|
|
41
41
|
# Open http://localhost:3000 and start your first session
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
**Sharing with a small team?** Start it in multi-user mode instead: each person gets their own login and workspace.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
codeman users add alice --admin # create the first admin account
|
|
48
|
+
codeman web --multiuser # named logins + per-user case spaces
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Details in [Multi-User Mode](#multi-user-mode-opt-in) below.
|
|
52
|
+
|
|
44
53
|
<details>
|
|
45
54
|
<summary><strong>Run as a background service</strong></summary>
|
|
46
55
|
|
|
@@ -142,7 +151,7 @@ Hit start — Codeman spawns the CLI via a real PTY and streams it to your brows
|
|
|
142
151
|
|
|
143
152
|
### 3. Read the dashboard
|
|
144
153
|
|
|
145
|
-
- **Tabs (top)** — one per session. `Alt+1`-`9` to jump, `Ctrl+Tab` for next, drag to reorder.
|
|
154
|
+
- **Tabs (top)** — one per session. `Alt+1`-`9` to jump, `Ctrl+Tab` for next, drag to reorder (tab order syncs across your devices).
|
|
146
155
|
- **Terminal (center)** — a real `xterm.js` terminal; full TUIs render correctly. Type directly and press **Enter** to send. `Shift+Enter` inserts a newline.
|
|
147
156
|
- **Side panels** — Respawn, Ralph, Orchestrator, Cron, Subagents, Settings (toggled from the toolbar).
|
|
148
157
|
|
|
@@ -155,13 +164,13 @@ Hit start — Codeman spawns the CLI via a real PTY and streams it to your brows
|
|
|
155
164
|
|
|
156
165
|
### 5. Make it autonomous
|
|
157
166
|
|
|
158
|
-
| Mode | Use it for | Where
|
|
159
|
-
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
160
|
-
| **Respawn** | Long unattended runs — auto-restarts the CLI on idle/limit, with adaptive timing. Presets: `solo-work`, `overnight-autonomous`, … | Respawn tab
|
|
161
|
-
| **Ralph / Todo** | A self-driving loop that tracks a todo list and keeps working until done. | Ralph tab
|
|
162
|
-
| **Orchestrator** | Turn one goal into a phased plan and drive it to completion across agents. | Orchestrator panel
|
|
163
|
-
| **Cron** | Saved, named jobs on a schedule (`once`/`interval`/`daily`/`weekly`) that spawn a session and send a prompt when due. | ⏰ Cron button
|
|
164
|
-
| **Auto-resume** | Automatically continue after a subscription rate-limit resets. | Respawn tab (top)
|
|
167
|
+
| Mode | Use it for | Where |
|
|
168
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
169
|
+
| **Respawn** | Long unattended runs — auto-restarts the CLI on idle/limit, with adaptive timing. Presets: `solo-work`, `overnight-autonomous`, … | Respawn tab |
|
|
170
|
+
| **Ralph / Todo** | A self-driving loop that tracks a todo list and keeps working until done. | Ralph tab |
|
|
171
|
+
| **Orchestrator** | Turn one goal into a phased plan and drive it to completion across agents. | Orchestrator panel |
|
|
172
|
+
| **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)_ |
|
|
173
|
+
| **Auto-resume** | Automatically continue after a subscription rate-limit resets. | Respawn tab (top) |
|
|
165
174
|
|
|
166
175
|
### 6. Reach it from anywhere
|
|
167
176
|
|
|
@@ -171,7 +180,7 @@ Hit start — Codeman spawns the CLI via a real PTY and streams it to your brows
|
|
|
171
180
|
|
|
172
181
|
### 7. Operate & maintain
|
|
173
182
|
|
|
174
|
-
- **App Settings** — model, effort, theme/skin, notifications, display toggles, per-CLI options.
|
|
183
|
+
- **App Settings** — model, effort, permission startup mode, theme/skin, notifications, display toggles, per-CLI options.
|
|
175
184
|
- **Self-update** — git-clone installs update in place from **Settings → Updates**.
|
|
176
185
|
- **Deploy your own changes** — see [Development](#development).
|
|
177
186
|
|
|
@@ -318,6 +327,14 @@ Run **20 parallel sessions** with full visibility — real-time xterm.js termina
|
|
|
318
327
|
|
|
319
328
|
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.
|
|
320
329
|
|
|
330
|
+
### Session Manager & Command Palette
|
|
331
|
+
|
|
332
|
+
`Ctrl/Cmd/Alt+K` opens a fuzzy session palette; **Browse all sessions** opens the Session Manager: one deduped list of everything Codeman knows about (live sessions, past sessions from state and lifecycle history, and Claude transcripts), each row showing its first and most recent prompt.
|
|
333
|
+
|
|
334
|
+
- **Pinning**: pin a session to float it to the top of the list. Pinned sessions even survive kill (they demote to a lightweight stopped entry that stays visible and resumable).
|
|
335
|
+
- **Name retention**: resuming a past session keeps its original name instead of minting a new one.
|
|
336
|
+
- **Cross-device tab order**: drag-reordered tabs persist server-side, so your ordering follows you from desktop to phone.
|
|
337
|
+
|
|
321
338
|
### Hostname-Aware Window Title
|
|
322
339
|
|
|
323
340
|
Running Codeman on multiple hosts (laptop, dev box, NAS)? The browser tab title is `codeman:<hostname>` so you can tell which backend each tab points at without clicking in:
|
|
@@ -367,6 +384,7 @@ PTY Output → 16ms Server Batch → DEC 2026 Wrap → SSE → Client rAF → xt
|
|
|
367
384
|
- **Self-update** — git-clone installs under systemd/launchd update in place from **App Settings → Updates**: it detects the latest release, auto-stashes a dirty tree, and streams build progress across the service restart (npm installs report as non-updatable)
|
|
368
385
|
- **Multi-CLI** — run **Claude Code**, **OpenCode**, **Codex**, or **Gemini** per session; env-var prefixes auto-gate (`CLAUDE_CODE_*` vs `OPENCODE_*` vs `CODEX_*` vs `GEMINI_*`/`GOOGLE_*`). See [`docs/opencode-integration.md`](docs/opencode-integration.md)
|
|
369
386
|
- **Docker sessions** — run a case inside an isolated, hardened container. One checkbox on **Create New** spins up a container with sensible defaults and starts the agent inside it; multiple sessions share one per-case container; export a container + its workspace to a portable `.tar.gz` to move it to another machine. See [`docs/docker-cases.md`](docs/docker-cases.md)
|
|
387
|
+
- **Remote SSH sessions** — point a case at another machine and run the agent there inside a durable remote tmux: survives SSH drops, auto-reconnects, and can discover + attach sessions already running on the host. See [`docs/remote-sessions.md`](docs/remote-sessions.md)
|
|
370
388
|
- **Effort & Ultracode** — set a per-session default effort (`low`–`max`) or enable **ultracode** (dynamic multi-agent workflows). Soft defaults only — switchable anytime with `/effort` in-session. Extended-thinking budget is configurable too
|
|
371
389
|
- **Voice input** — dictate prompts with Deepgram Nova-3 (Web Speech API fallback): toggle recording, auto-silence stop, live level meter (`Ctrl+Shift+V`)
|
|
372
390
|
- **Image input** — paste or drag-and-drop images straight into a session
|
|
@@ -394,6 +412,20 @@ Prerequisite: just Docker (or Podman). The agent base image builds itself automa
|
|
|
394
412
|
|
|
395
413
|
---
|
|
396
414
|
|
|
415
|
+
## Remote SSH Sessions
|
|
416
|
+
|
|
417
|
+
Point a case at another machine and run the agent **there**, over SSH, with the same dashboard, mobile UI, and autonomy features. Your laptop is just a window onto a session that lives on the remote host.
|
|
418
|
+
|
|
419
|
+
- **Durable by design**: the agent runs inside a dedicated tmux session on the remote host, so a dropped SSH connection, network change, or laptop sleep never kills the run. Reconnecting lands back in the same live conversation.
|
|
420
|
+
- **Auto-reconnect**: a bounded-backoff watcher notices a dead SSH pane and silently reattaches to the still-running remote session (kill-switch in settings; intentional kills are never revived).
|
|
421
|
+
- **Discover & attach**: list the `codeman-*` sessions already running on a host (started by that machine's own Codeman, or by another operator) and attach to one. Attached sessions you don't own **detach on tab close, never kill**.
|
|
422
|
+
- **Shared sessions**: several clients can attach the same remote session at different window sizes without clamping each other; discovery shows a "shared" badge with the client count.
|
|
423
|
+
- **Injection-safe**: every ssh command line flows through a single shell-escaping builder, and host/path/identity fields are schema-guarded.
|
|
424
|
+
|
|
425
|
+
Set it up under **New Case → Remote** (host, user, identity file, optional jump host). Full design: [`docs/remote-sessions.md`](docs/remote-sessions.md).
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
397
429
|
## Multi-User Mode (opt-in)
|
|
398
430
|
|
|
399
431
|
Share one Codeman with a small trusted team, each person getting their own login and workspace. **Off by default** — without the flag, nothing changes.
|
|
@@ -537,13 +569,14 @@ When someone authenticates via QR, the desktop shows a notification toast with t
|
|
|
537
569
|
|
|
538
570
|
## Security
|
|
539
571
|
|
|
540
|
-
Codeman launches sessions with `--dangerously-skip-permissions`, so the web UI is by design a remote-code-execution surface for whoever can reach it — the whole security model exists to control _who_ that is. Recent hardening (v0.9.0 + v0.9.5) closes the browser-driven attack paths that bite self-hosted dev tools. Full model: [`docs/security-architecture.md`](docs/security-architecture.md). **Found a vulnerability?** See [`SECURITY.md`](SECURITY.md) for private disclosure and the list of known limitations.
|
|
572
|
+
By default Codeman launches sessions with `--dangerously-skip-permissions`, so the web UI is by design a remote-code-execution surface for whoever can reach it — the whole security model exists to control _who_ that is. (The startup permission mode is configurable; see below.) Recent hardening (v0.9.0 + v0.9.5) closes the browser-driven attack paths that bite self-hosted dev tools. Full model: [`docs/security-architecture.md`](docs/security-architecture.md). **Found a vulnerability?** See [`SECURITY.md`](SECURITY.md) for private disclosure and the list of known limitations.
|
|
541
573
|
|
|
542
574
|
### Network & access
|
|
543
575
|
|
|
544
576
|
- **Loopback by default** — binds `127.0.0.1`, reachable only from the same machine, so the no-password default is safe out of the box. Binding a non-loopback host without `CODEMAN_PASSWORD` _starts but prints a loud warning_ with three concrete fixes (set a password, loopback + an authenticated tunnel, or explicitly acknowledge with `--allow-unauthenticated-network`)
|
|
545
577
|
- **Optional auth, real sessions** — HTTP Basic via `CODEMAN_USERNAME` (default `admin`) / `CODEMAN_PASSWORD`. Success issues an opaque 256-bit `codeman_session` cookie (`randomBytes(32)`) — validated server-side, not client-signed, so it can't be forged offline (24h TTL, auto-extend, device-context audit log)
|
|
546
578
|
- **Per-IP rate limiting** — 10 failed attempts → `429` with `Retry-After` (15-min decay). A valid cookie or correct password recovers _immediately_ even while an attacker hammers the same IP — important because all tunnel traffic shares one loopback IP. QR auth has its own separate limiter
|
|
579
|
+
- **Configurable permission mode** - `--dangerously-skip-permissions` is only the default. **App Settings → Claude CLI → Startup Mode** can switch new sessions to Anthropic's classifier-guarded `auto` mode (low-prompt, needs Claude Code 2.1.207+), `normal` prompting, or an explicit allowed-tools list. In multi-user mode, non-granted users are forced to `auto`, and shell sessions / skip-permissions require an explicit per-user grant
|
|
547
580
|
|
|
548
581
|
### Always-on browser hardening (v0.9.5)
|
|
549
582
|
|
|
@@ -693,7 +726,7 @@ Codeman registers Claude Code hooks that `POST /api/hook-event` (`permission_pro
|
|
|
693
726
|
|
|
694
727
|
## API
|
|
695
728
|
|
|
696
|
-
REST over Fastify — **~
|
|
729
|
+
REST over Fastify — **~190 handlers across 20 route modules**, plus an SSE stream and a WebSocket terminal channel. All responses use the `ApiResponse<T>` envelope (`{success, data}` / `{success, error, errorCode}`); `/api/v1/*` is a stable alias. A representative subset:
|
|
697
730
|
|
|
698
731
|
### Sessions
|
|
699
732
|
|
|
@@ -703,6 +736,9 @@ REST over Fastify — **~160 handlers across 18 route modules**, plus an SSE str
|
|
|
703
736
|
| `POST` | `/api/quick-start` | Create case + start session (`{caseName?, mode?, effort?, envOverrides?}`) |
|
|
704
737
|
| `POST` | `/api/sessions/:id/input` | Send input (`{input, useMux?, clientId?, seq?}` — `clientId`+`seq` = exactly-once) |
|
|
705
738
|
| `GET` | `/api/sessions/:id/output` | Read terminal output |
|
|
739
|
+
| `GET` | `/api/sessions/unified` | Unified live + history list (Session Manager) — `?q=&limit=` |
|
|
740
|
+
| `POST` | `/api/sessions/:id/pin` | Pin/unpin in the Session Manager (`{pinned}`) |
|
|
741
|
+
| `PUT` | `/api/session-order` | Sync tab order across devices (`{order: [ids]}`) |
|
|
706
742
|
| `DELETE` | `/api/sessions/:id` | Delete session |
|
|
707
743
|
|
|
708
744
|
### Respawn
|
|
@@ -825,7 +861,7 @@ flowchart TB
|
|
|
825
861
|
npm install
|
|
826
862
|
npx tsx src/index.ts web # Dev mode
|
|
827
863
|
npm run build # Production build
|
|
828
|
-
npm test
|
|
864
|
+
npm run test:ci # Run tests (the CI suite; browser suites need extra setup)
|
|
829
865
|
```
|
|
830
866
|
|
|
831
867
|
See [CLAUDE.md](./CLAUDE.md) for full documentation.
|
package/README.zh-CN.md
CHANGED
|
@@ -43,6 +43,15 @@ codeman web
|
|
|
43
43
|
# 打开 http://localhost:3000,开启你的第一个会话
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
**想和小团队共用一台?** 改用多用户模式启动:每人拥有自己的登录与工作空间。
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
codeman users add alice --admin # 创建第一个管理员账号
|
|
50
|
+
codeman web --multiuser # 命名登录 + 按用户隔离的案例空间
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
详见下文[多用户模式](#多用户模式可选启用)。
|
|
54
|
+
|
|
46
55
|
<details>
|
|
47
56
|
<summary><strong>作为后台服务运行</strong></summary>
|
|
48
57
|
|
|
@@ -144,7 +153,7 @@ codeman web -H 0.0.0.0 # 绑定局域网 —— 必须设置 CODEMAN_
|
|
|
144
153
|
|
|
145
154
|
### 3. 读懂仪表盘
|
|
146
155
|
|
|
147
|
-
- **标签(顶部)** —— 每个会话一个。`Alt+1`–`9` 跳转,`Ctrl+Tab`
|
|
156
|
+
- **标签(顶部)** —— 每个会话一个。`Alt+1`–`9` 跳转,`Ctrl+Tab` 下一个,拖拽排序(标签顺序会跨设备同步)。
|
|
148
157
|
- **终端(中央)** —— 真实的 `xterm.js` 终端;完整 TUI 正常渲染。直接输入并按 **Enter** 发送。`Shift+Enter` 插入换行。
|
|
149
158
|
- **侧边面板** —— Respawn、Ralph、Orchestrator、Cron、Subagents、Settings(从工具栏切换)。
|
|
150
159
|
|
|
@@ -157,13 +166,13 @@ codeman web -H 0.0.0.0 # 绑定局域网 —— 必须设置 CODEMAN_
|
|
|
157
166
|
|
|
158
167
|
### 5. 让它自主运行
|
|
159
168
|
|
|
160
|
-
| 模式 | 用途 | 位置
|
|
161
|
-
| ---------------- | --------------------------------------------------------------------------------------------------------- |
|
|
162
|
-
| **Respawn** | 长时间无人值守运行 —— 空闲/限额时自动重启 CLI,带自适应时序。预设:`solo-work`、`overnight-autonomous` 等 | Respawn 标签页
|
|
163
|
-
| **Ralph / Todo** | 一个自驱循环,跟踪 todo 列表并持续工作直到完成。 | Ralph 标签页
|
|
164
|
-
| **Orchestrator** | 把一个目标变成分阶段计划,并跨多个智能体推动完成。 | 编排器面板
|
|
165
|
-
| **Cron** | 已保存的、命名的定时任务(`once`/`interval`/`daily`/`weekly`),到期时拉起会话并发送提示。 | ⏰ Cron
|
|
166
|
-
| **Auto-resume** | 订阅限额重置后自动继续。 | Respawn 标签页(顶部)
|
|
169
|
+
| 模式 | 用途 | 位置 |
|
|
170
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
171
|
+
| **Respawn** | 长时间无人值守运行 —— 空闲/限额时自动重启 CLI,带自适应时序。预设:`solo-work`、`overnight-autonomous` 等 | Respawn 标签页 |
|
|
172
|
+
| **Ralph / Todo** | 一个自驱循环,跟踪 todo 列表并持续工作直到完成。 | Ralph 标签页 |
|
|
173
|
+
| **Orchestrator** | 把一个目标变成分阶段计划,并跨多个智能体推动完成。 | 编排器面板 |
|
|
174
|
+
| **Cron** | 已保存的、命名的定时任务(`once`/`interval`/`daily`/`weekly`),到期时拉起会话并发送提示。 | ⏰ Cron 按钮(可选启用:App Settings → Display → Header Displays) |
|
|
175
|
+
| **Auto-resume** | 订阅限额重置后自动继续。 | Respawn 标签页(顶部) |
|
|
167
176
|
|
|
168
177
|
### 6. 随时随地访问
|
|
169
178
|
|
|
@@ -173,7 +182,7 @@ codeman web -H 0.0.0.0 # 绑定局域网 —— 必须设置 CODEMAN_
|
|
|
173
182
|
|
|
174
183
|
### 7. 运维与维护
|
|
175
184
|
|
|
176
|
-
- **App Settings** —— 模型、effort
|
|
185
|
+
- **App Settings** —— 模型、effort、权限启动模式、主题/皮肤、通知、显示开关、各 CLI 的专属选项。
|
|
177
186
|
- **自更新** —— git-clone 安装可在 **Settings → Updates** 中原地更新。
|
|
178
187
|
- **部署你自己的改动** —— 见[开发](#开发)。
|
|
179
188
|
|
|
@@ -320,6 +329,14 @@ WATCHING → IDLE DETECTED → SEND UPDATE → /clear → /init → CONTINUE →
|
|
|
320
329
|
|
|
321
330
|
每个会话都运行在 **tmux** 内 —— 会话可在服务器重启、网络中断与机器休眠后存续。启动时自动恢复,具备双重冗余。幽灵会话发现机制能找到孤立的 tmux 会话。受管会话带有环境标签,因此智能体不会杀掉自己的会话。
|
|
322
331
|
|
|
332
|
+
### 会话管理器与命令面板
|
|
333
|
+
|
|
334
|
+
`Ctrl/Cmd/Alt+K` 打开模糊搜索的会话面板;**Browse all sessions** 打开会话管理器:一份去重后的完整清单,涵盖 Codeman 所知的一切(活动会话、来自状态与生命周期历史的既往会话,以及 Claude 转录),每一行都显示其第一条与最近一条提示。
|
|
335
|
+
|
|
336
|
+
- **置顶(Pin)**:把会话固定到列表顶部。被置顶的会话甚至能挺过被杀掉(降级为一条轻量的已停止记录,依然可见、可恢复)。
|
|
337
|
+
- **名称保留**:从会话管理器恢复既往会话时保留其原有名称,而不是生成一个新名称。
|
|
338
|
+
- **跨设备标签顺序**:拖拽排序的标签顺序保存在服务端,你的排列会从桌面跟随到手机。
|
|
339
|
+
|
|
323
340
|
### 主机名感知的窗口标题
|
|
324
341
|
|
|
325
342
|
在多台主机上运行 Codeman(笔记本、开发机、NAS)?浏览器标签标题是 `codeman:<主机名>`,让你无需点进去就能分辨每个标签对应哪个后端:
|
|
@@ -369,6 +386,7 @@ PTY 输出 → 16ms 服务端批处理 → DEC 2026 包裹 → SSE → 客户端
|
|
|
369
386
|
- **自更新** —— systemd/launchd 管理下的 git-clone 安装可在 **App Settings → Updates** 中原地更新:它会检测最新发行版,自动暂存(stash)脏工作树,并在服务重启期间流式展示构建进度(npm 安装会被报告为不可更新)
|
|
370
387
|
- **多 CLI** —— 每个会话可选 **Claude Code**、**OpenCode**、**Codex** 或 **Gemini**;环境变量前缀自动隔离(`CLAUDE_CODE_*`、`OPENCODE_*`、`CODEX_*` 与 `GEMINI_*`/`GOOGLE_*`)。详见 [`docs/opencode-integration.md`](docs/opencode-integration.md)
|
|
371
388
|
- **Docker 会话** —— 在隔离且加固的容器中运行案例。**Create New** 上勾选一个复选框即可用合理的默认值启动容器并在其中启动智能体;同一案例的多个会话共享一个容器;可将容器连同工作区导出为可移植的 `.tar.gz`,迁移到另一台机器。详见 [`docs/docker-cases.md`](docs/docker-cases.md)
|
|
389
|
+
- **远程 SSH 会话**:把案例指向另一台机器,让智能体在那里一个持久的远程 tmux 中运行:SSH 断连不中断任务、自动重连,还能发现并附着主机上已在运行的会话。详见 [`docs/remote-sessions.md`](docs/remote-sessions.md)
|
|
372
390
|
- **Effort 与 Ultracode** —— 设置每会话的默认 effort(`low`–`max`),或启用 **ultracode**(动态多智能体工作流)。这些都只是软默认值 —— 会话中可随时用 `/effort` 切换。扩展思考预算也可配置
|
|
373
391
|
- **语音输入** —— 用 Deepgram Nova-3 口述提示(带 Web Speech API 回退):切换录音、自动静音停止、实时音量表(`Ctrl+Shift+V`)
|
|
374
392
|
- **图像输入** —— 直接把图片粘贴或拖放进会话
|
|
@@ -396,6 +414,40 @@ PTY 输出 → 16ms 服务端批处理 → DEC 2026 包裹 → SSE → 客户端
|
|
|
396
414
|
|
|
397
415
|
---
|
|
398
416
|
|
|
417
|
+
## 远程 SSH 会话
|
|
418
|
+
|
|
419
|
+
把案例(case)指向另一台机器,通过 SSH 让智能体**在那台机器上**运行,同时保留同样的仪表盘、移动端 UI 与自主运行特性。你的笔记本只是一扇窗口,会话本体活在远程主机上。
|
|
420
|
+
|
|
421
|
+
- **天生持久**:智能体运行在远程主机上一个专用的 tmux 会话里,SSH 断连、网络切换或笔记本休眠都不会中断任务。重新连接后回到同一个活跃对话。
|
|
422
|
+
- **自动重连**:一个带上限退避的监视器发现 SSH 面板断开后,会静默重新附着到仍在运行的远程会话(设置中有总开关;主动杀掉的会话绝不会被复活)。
|
|
423
|
+
- **发现与附着**:列出主机上已在运行的 `codeman-*` 会话(由那台机器自己的 Codeman 或其他操作者启动)并附着其一。非你所有的已附着会话在关闭标签时**只分离,绝不杀掉**。
|
|
424
|
+
- **共享会话**:多个客户端可以以不同窗口尺寸同时附着同一个远程会话而互不挤压;发现列表会显示带客户端计数的「shared」徽标。
|
|
425
|
+
- **注入安全**:所有 ssh 命令行都经由单一的 shell 转义构建器生成,主机/路径/身份文件字段均有模式校验。
|
|
426
|
+
|
|
427
|
+
在 **New Case → Remote** 中配置(主机、用户、身份文件、可选跳板机)。完整设计:[`docs/remote-sessions.md`](docs/remote-sessions.md)。
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## 多用户模式(可选启用)
|
|
432
|
+
|
|
433
|
+
与一个小型互信团队共享同一个 Codeman,每人拥有自己的登录与工作空间。**默认关闭**:不加该开关时,行为与单用户完全一致。
|
|
434
|
+
|
|
435
|
+
用 `codeman web --multiuser`(或 `CODEMAN_MULTIUSER=1`)启用。创建第一个管理员后,可通过 CLI 或 App Settings 中的 **Users** 标签页管理用户:
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
codeman users add alice --admin # 提示输入密码(或 --password-stdin)
|
|
439
|
+
codeman users add bob # 普通用户
|
|
440
|
+
codeman users list
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
- **按用户的空间**:每个用户的案例位于 `~/codeman-users/<name>/cases`;会话、案例、搜索与实时事件都按属主隔离。管理员可以看到全部。
|
|
444
|
+
- **可单独吊销的登录**:命名用户的密码以 scrypt 哈希保存在 `~/.codeman/users.json`;可随时禁用、重置(一次性密码)或删除账号。管理员操作审计记录在 `~/.codeman/admin-audit.jsonl`。
|
|
445
|
+
- **普通用户的更安全默认值**:非管理员以 `--permission-mode auto` 运行 Claude(Anthropic 的分类器护栏模式);raw shell 会话、cron `launchCommand` 与跳过权限模式需要按用户显式授权。
|
|
446
|
+
|
|
447
|
+
> ⚠️ **这只是工作空间的划分,不是用户之间的沙箱。** 所有会话都以同一个操作系统账户运行,因此有心用户的智能体依然能触及他人的文件。若需要真正的隔离,请结合 **Docker 案例**,或在不同的操作系统账户下运行独立实例。参见 [`docs/multi-user-plan.md`](docs/multi-user-plan.md) 与 [`docs/security-architecture.md`](docs/security-architecture.md) 的多用户章节。
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
399
451
|
## 远程访问 —— Cloudflare 隧道
|
|
400
452
|
|
|
401
453
|
使用免费的 [Cloudflare 快速隧道](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/),从手机或本地网络外的任意设备访问 Codeman —— 无需端口转发、无需 DNS、无需静态 IP。
|
|
@@ -519,13 +571,14 @@ URL 被刻意保持精简(`/q/` 路径 + 6 字符码 ≈ 53–56 个字符)
|
|
|
519
571
|
|
|
520
572
|
## 安全
|
|
521
573
|
|
|
522
|
-
Codeman
|
|
574
|
+
Codeman 默认用 `--dangerously-skip-permissions` 启动会话,因此 Web UI 在设计上对任何能访问到它的人都是一个远程代码执行面 —— 整套安全模型的存在就是为了控制*谁*能访问。(启动权限模式可配置,见下文。)近期加固(v0.9.0 + v0.9.5)封堵了那些常困扰自托管开发工具的浏览器驱动攻击路径。完整模型:[`docs/security-architecture.md`](docs/security-architecture.md)。**发现了漏洞?** 私下披露方式与已知限制清单见 [`SECURITY.md`](SECURITY.md)。
|
|
523
575
|
|
|
524
576
|
### 网络与访问
|
|
525
577
|
|
|
526
578
|
- **默认仅环回** —— 绑定 `127.0.0.1`,仅可从本机访问,因此「无密码」默认配置开箱即安全。在未设置 `CODEMAN_PASSWORD` 的情况下绑定非环回主机会*启动但打印一条醒目警告*,并给出三个具体修复方案(设置密码、环回 + 一个带认证的隧道,或用 `--allow-unauthenticated-network` 显式确认)
|
|
527
579
|
- **可选认证,真实会话** —— 通过 `CODEMAN_USERNAME`(默认 `admin`)/ `CODEMAN_PASSWORD` 的 HTTP Basic 认证。成功后签发一个不透明的 256 位 `codeman_session` cookie(`randomBytes(32)`)—— 服务端校验,而非客户端签名,因此无法离线伪造(24h TTL、自动延长、设备上下文审计日志)
|
|
528
580
|
- **按 IP 速率限制** —— 失败 10 次 → `429` 并带 `Retry-After`(15 分钟衰减)。即便攻击者在同一 IP 上猛攻,有效 cookie 或正确密码也能*立即*恢复 —— 这很重要,因为所有隧道流量共享同一个环回 IP。二维码认证有自己独立的限制器
|
|
581
|
+
- **可配置的权限模式**:`--dangerously-skip-permissions` 只是默认值。**App Settings → Claude CLI → Startup Mode** 可以把新会话切换为 Anthropic 的分类器护栏 `auto` 模式(低打扰,需要 Claude Code 2.1.207+)、`normal` 提示模式,或一份显式的允许工具列表。多用户模式下,未获授权的用户会被强制为 `auto`,shell 会话与跳过权限需要按用户显式授权
|
|
529
582
|
|
|
530
583
|
### 始终开启的浏览器加固(v0.9.5)
|
|
531
584
|
|
|
@@ -675,7 +728,7 @@ Codeman 会注册 Claude Code hook,它们 `POST /api/hook-event`(`permission
|
|
|
675
728
|
|
|
676
729
|
## API
|
|
677
730
|
|
|
678
|
-
基于 Fastify 的 REST —— **
|
|
731
|
+
基于 Fastify 的 REST —— **20 个路由模块中约 190 个处理器**,外加一条 SSE 流和一条 WebSocket 终端通道。所有响应都使用 `ApiResponse<T>` 信封(`{success, data}` / `{success, error, errorCode}`);`/api/v1/*` 是稳定别名。以下是一个有代表性的子集:
|
|
679
732
|
|
|
680
733
|
### 会话(Sessions)
|
|
681
734
|
|
|
@@ -685,6 +738,9 @@ Codeman 会注册 Claude Code hook,它们 `POST /api/hook-event`(`permission
|
|
|
685
738
|
| `POST` | `/api/quick-start` | 创建 case + 启动会话(`{caseName?, mode?, effort?, envOverrides?}`) |
|
|
686
739
|
| `POST` | `/api/sessions/:id/input` | 发送输入(`{input, useMux?, clientId?, seq?}` —— `clientId`+`seq` = 精确一次) |
|
|
687
740
|
| `GET` | `/api/sessions/:id/output` | 读取终端输出 |
|
|
741
|
+
| `GET` | `/api/sessions/unified` | 统一的活动 + 历史清单(会话管理器):`?q=&limit=` |
|
|
742
|
+
| `POST` | `/api/sessions/:id/pin` | 在会话管理器中置顶 / 取消置顶(`{pinned}`) |
|
|
743
|
+
| `PUT` | `/api/session-order` | 跨设备同步标签顺序(`{order: [ids]}`) |
|
|
688
744
|
| `DELETE` | `/api/sessions/:id` | 删除会话 |
|
|
689
745
|
|
|
690
746
|
### 重生(Respawn)
|
|
@@ -807,7 +863,7 @@ flowchart TB
|
|
|
807
863
|
npm install
|
|
808
864
|
npx tsx src/index.ts web # 开发模式
|
|
809
865
|
npm run build # 生产构建
|
|
810
|
-
npm test
|
|
866
|
+
npm run test:ci # 运行测试(CI 套件;浏览器套件需要额外环境)
|
|
811
867
|
```
|
|
812
868
|
|
|
813
869
|
完整文档见 [CLAUDE.md](./CLAUDE.md)。
|