@logicseek/hello-cc 0.1.2 → 0.1.4

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/docs/README.md CHANGED
@@ -10,9 +10,11 @@ summary and first command. Use these docs when you need more detail.
10
10
  - [Command Reference](commands.md): compact list of public commands and the
11
11
  intended use of each command group.
12
12
  - [Changelog](../CHANGELOG.md): release notes for published versions.
13
- - Release notes: run `npm run release:check` before publishing, and use
14
- `npm run release:notes` to print the current changelog section for GitHub
15
- Release notes.
13
+ - Release notes: run `npm run release:check` and
14
+ `npm run release:github:dry-run` before publishing. Pushing a `v*` tag runs
15
+ `.github/workflows/github-release.yml`, which creates or updates the GitHub
16
+ Release description from the current changelog section. Use
17
+ `workflow_dispatch` to backfill older releases without a personal token.
16
18
 
17
19
  ## Design And Implementation
18
20
 
@@ -9,9 +9,11 @@
9
9
  peer 身份和环境变量行为。
10
10
  - [命令参考](commands.zh-CN.md):公共命令的紧凑清单,以及每组命令的用途。
11
11
  - [更新日志](../CHANGELOG.md):已发布版本的 release notes。
12
- - 发行说明:发布前运行 `npm run release:check`,用
13
- `npm run release:notes` 输出当前版本的 changelog 小节,作为 GitHub
14
- Release 描述。
12
+ - 发行说明:发布前运行 `npm run release:check` 和
13
+ `npm run release:github:dry-run`。推送 `v*` tag 会触发
14
+ `.github/workflows/github-release.yml`,根据当前 changelog 小节创建或更新
15
+ GitHub Release 描述。旧版本可用 `workflow_dispatch` 补写描述,不需要个人
16
+ token。
15
17
 
16
18
  ## 设计和实现
17
19
 
package/docs/commands.md CHANGED
@@ -18,20 +18,25 @@ current project's `.hello-cc` data and guidance blocks.
18
18
  ## Start And Stop
19
19
 
20
20
  ```text
21
- hcc web [--host HOST] [--port N] [--token TEXT] [--local] [--no-discover] [--no-guidance]
21
+ hcc web [--host HOST] [--port N] [--token TEXT] [--local] [--no-token] [--no-discover] [--no-guidance]
22
22
  hcc down
23
23
  hcc up [--no-discover] [--no-guidance]
24
24
  ```
25
25
 
26
26
  `hcc web` is the default entry. It initializes coordination, installs hooks and
27
- shims, starts or reuses the Web console, and returns the terminal to you. Use
28
- `hcc up` only when you want coordination without the Web console or shims.
27
+ shims, starts or reuses the Web console, and returns the terminal to you. Bare
28
+ `hcc web` listens on `0.0.0.0` and uses a saved URL token, generating one on
29
+ first use. Use `--local` to bind only `127.0.0.1`, `--token` or `HCC_WEB_TOKEN`
30
+ to replace the saved token, and
31
+ `--no-token` only in trusted local/test environments. Use `hcc up` only when you
32
+ want coordination without the Web console or shims.
29
33
 
30
34
  ## Peers And Status
31
35
 
32
36
  ```text
33
37
  hcc peers
34
38
  hcc status [--peer ID]
39
+ hcc state [--peer ID] [--resource PATH] [--intent work|stop|finish]
35
40
  hcc scan [--register]
36
41
  hcc prompt --peer ID [--kind codex|claude|shell|other] [--role ROLE]
37
42
  hcc join --peer ID [--kind codex|claude|shell|other] [--role ROLE]
@@ -41,7 +46,12 @@ hcc run --peer ID --kind codex|claude|shell --role ROLE -- COMMAND [ARGS...]
41
46
  ```
42
47
 
43
48
  Use these commands to inspect live project state, register terminals, and run a
44
- CLI with `HCC_PEER`, `HCC_ROOT`, and `HCC_DB` set.
49
+ CLI with `HCC_PEER`, `HCC_ROOT`, and `HCC_DB` set. `hcc state` does not execute
50
+ coordination actions such as acking messages, claiming tasks, acquiring locks, or
51
+ creating handoffs. It adds a unified collaboration timeline plus
52
+ `automation.next_action.argv`, a machine-readable next coordination command for
53
+ agents to execute explicitly. `automation.current_task` records the peer's active
54
+ task when one exists.
45
55
 
46
56
  ## Browser-Controllable Terminals
47
57
 
@@ -66,12 +76,16 @@ controlled from the Web console.
66
76
  hcc msg send [--from ID] [--to ID|all] --body TEXT [--task N] [--kind note|task|handoff]
67
77
  hcc msg inbox [--peer ID] [--wait SEC] [--all] [--limit N]
68
78
  hcc msg ack [--peer ID] --id N
79
+ hcc msg reply [--from ID] --id N --body TEXT [--to ID] [--kind reply]
80
+ hcc msg thread --id N [--limit N]
69
81
  hcc ask PEER MESSAGE [--from ID] [--task N] [--inject]
70
82
  hcc broadcast MESSAGE [--from ID] [--task N] [--inject]
71
83
  ```
72
84
 
73
85
  Messages are addressed mailbox items. `ask` and `broadcast` also support live
74
- terminal injection with `--inject`.
86
+ terminal injection with `--inject`. Use `msg reply` when answering a specific
87
+ message; the reply stays in the same thread and is sent back to the original
88
+ sender by default. Use `msg thread` to inspect the full thread for one message.
75
89
 
76
90
  ## Tasks
77
91
 
@@ -79,13 +93,30 @@ terminal injection with `--inject`.
79
93
  hcc task create --title TEXT [--body TEXT] [--from ID] [--to ID] [--priority N]
80
94
  hcc task list [--status S] [--peer ID] [--all]
81
95
  hcc task claim [--peer ID] --id N
82
- hcc task next [--peer ID]
96
+ hcc task next [--peer ID] [--force]
97
+ hcc task create --title TEXT --parent N [--team-role ROLE]
83
98
  hcc task update [--peer ID] --id N --status running|review|blocked|done|abandoned [--summary TEXT] [--body TEXT] [--to ID]
84
99
  hcc task done [--peer ID] --id N --summary TEXT
85
100
  ```
86
101
 
87
102
  Tasks are shared project facts. They remain visible until marked `done` or
88
- `abandoned`.
103
+ `abandoned`. `task next` returns your existing claimed/running/review/blocked
104
+ task before claiming a new pending task; use `--force` only when intentionally
105
+ taking another pending task.
106
+
107
+ ## Teams
108
+
109
+ ```text
110
+ hcc team plan --from-task N [--item ROLE:TITLE] [--item PEER:ROLE:TITLE] [--workers A,B|codex:2,claude:1]
111
+ hcc team start --from-task N [--item ROLE:TITLE] [--item PEER:ROLE:TITLE] [--workers A,B|codex:2,claude:1] [--force]
112
+ hcc team status --task N
113
+ ```
114
+
115
+ Teams are explicit parent-task splits. `team plan` is read-only and shows the
116
+ subtasks that would be created. `team start` creates child tasks under the
117
+ parent and optionally assigns them to worker peer IDs. It does not silently
118
+ spawn model processes or override the current-task rule. `--workers` accepts
119
+ explicit peer IDs or kind counts such as `codex:2,claude:1`.
89
120
 
90
121
  ## Locks, Handoffs, And Events
91
122
 
@@ -17,20 +17,23 @@ hcc uninstall [--purge --yes]
17
17
  ## 启动和停止
18
18
 
19
19
  ```text
20
- hcc web [--host HOST] [--port N] [--token TEXT] [--local] [--no-discover] [--no-guidance]
20
+ hcc web [--host HOST] [--port N] [--token TEXT] [--local] [--no-token] [--no-discover] [--no-guidance]
21
21
  hcc down
22
22
  hcc up [--no-discover] [--no-guidance]
23
23
  ```
24
24
 
25
25
  `hcc web` 是默认入口。它会初始化协作状态,安装 hooks 和 shims,启动或复用
26
- Web 控制台,然后把终端还给你。只想使用本地协作、不需要 Web 或 shims 时,
27
- 再使用 `hcc up`。
26
+ Web 控制台,然后把终端还给你。裸 `hcc web` 会监听 `0.0.0.0` 并使用固定
27
+ URL token;首次使用时自动生成并保存。用 `--local` 可只绑定 `127.0.0.1`,
28
+ 用 `--token` 或 `HCC_WEB_TOKEN` 可替换保存的 token,只有在可信本地/测试环境才使用 `--no-token`。
29
+ 只想使用本地协作、不需要 Web 或 shims 时,再使用 `hcc up`。
28
30
 
29
31
  ## Peers 和状态
30
32
 
31
33
  ```text
32
34
  hcc peers
33
35
  hcc status [--peer ID]
36
+ hcc state [--peer ID] [--resource PATH] [--intent work|stop|finish]
34
37
  hcc scan [--register]
35
38
  hcc prompt --peer ID [--kind codex|claude|shell|other] [--role ROLE]
36
39
  hcc join --peer ID [--kind codex|claude|shell|other] [--role ROLE]
@@ -40,7 +43,10 @@ hcc run --peer ID --kind codex|claude|shell --role ROLE -- COMMAND [ARGS...]
40
43
  ```
41
44
 
42
45
  这些命令用于查看项目状态、注册终端,以及用 `HCC_PEER`、`HCC_ROOT`、
43
- `HCC_DB` 环境运行 CLI。
46
+ `HCC_DB` 环境运行 CLI。`hcc state` 不会执行确认消息、认领任务、获取锁或
47
+ 创建 handoff 这类协作动作;它会返回统一协作时间线,以及
48
+ `automation.next_action.argv` 这种机器可读的下一步协作命令,供 agent 显式执行
49
+ 并留下审计记录。`automation.current_task` 会记录当前 peer 已经拥有的活动任务。
44
50
 
45
51
  ## Web 可控终端
46
52
 
@@ -64,12 +70,15 @@ hcc inject PEER TEXT [--no-enter]
64
70
  hcc msg send [--from ID] [--to ID|all] --body TEXT [--task N] [--kind note|task|handoff]
65
71
  hcc msg inbox [--peer ID] [--wait SEC] [--all] [--limit N]
66
72
  hcc msg ack [--peer ID] --id N
73
+ hcc msg reply [--from ID] --id N --body TEXT [--to ID] [--kind reply]
74
+ hcc msg thread --id N [--limit N]
67
75
  hcc ask PEER MESSAGE [--from ID] [--task N] [--inject]
68
76
  hcc broadcast MESSAGE [--from ID] [--task N] [--inject]
69
77
  ```
70
78
 
71
79
  消息是带收件人的邮箱记录。`ask` 和 `broadcast` 加 `--inject` 后,也会把内容
72
- 实时注入到终端。
80
+ 实时注入到终端。回复某条消息时使用 `msg reply`;默认会发回原 sender,并保留
81
+ 在同一个 thread 中。使用 `msg thread` 可以查看某条消息所在的完整线程。
73
82
 
74
83
  ## 任务
75
84
 
@@ -77,12 +86,28 @@ hcc broadcast MESSAGE [--from ID] [--task N] [--inject]
77
86
  hcc task create --title TEXT [--body TEXT] [--from ID] [--to ID] [--priority N]
78
87
  hcc task list [--status S] [--peer ID] [--all]
79
88
  hcc task claim [--peer ID] --id N
80
- hcc task next [--peer ID]
89
+ hcc task next [--peer ID] [--force]
90
+ hcc task create --title TEXT --parent N [--team-role ROLE]
81
91
  hcc task update [--peer ID] --id N --status running|review|blocked|done|abandoned [--summary TEXT] [--body TEXT] [--to ID]
82
92
  hcc task done [--peer ID] --id N --summary TEXT
83
93
  ```
84
94
 
85
95
  任务是项目共享事实。任务会一直可见,直到被标记为 `done` 或 `abandoned`。
96
+ `task next` 会优先返回当前 peer 已经认领、运行、审查或阻塞中的任务;只有明确
97
+ 要再接一个 pending 任务时才使用 `--force`。
98
+
99
+ ## 团队
100
+
101
+ ```text
102
+ hcc team plan --from-task N [--item ROLE:TITLE] [--item PEER:ROLE:TITLE] [--workers A,B|codex:2,claude:1]
103
+ hcc team start --from-task N [--item ROLE:TITLE] [--item PEER:ROLE:TITLE] [--workers A,B|codex:2,claude:1] [--force]
104
+ hcc team status --task N
105
+ ```
106
+
107
+ 团队是显式的父任务拆分。`team plan` 只读,只展示会创建哪些子任务。
108
+ `team start` 会在父任务下创建子任务,并可把子任务分配给 worker peer。
109
+ 它不会静默启动模型进程,也不会绕过“先继续当前任务”的规则。`--workers`
110
+ 支持显式 peer ID,也支持 `codex:2,claude:1` 这种 kind 数量形式。
86
111
 
87
112
  ## 锁、交接和事件
88
113
 
package/docs/design.md CHANGED
@@ -170,12 +170,13 @@ Server polls/captures tmux pane output and broadcasts it to browsers.
170
170
  ```text
171
171
  peers stable terminal identities and heartbeat
172
172
  peer_bindings provider session binding and runtime transport metadata
173
- tasks task assignment, ownership, and lifecycle
174
- messages direct or broadcast messages
173
+ tasks task assignment, ownership, hierarchy, and lifecycle
174
+ messages direct, broadcast, or threaded messages
175
175
  message_reads per-peer ack state
176
176
  locks advisory exclusive locks with TTL
177
177
  handoffs durable cross-session handoff summaries
178
178
  events audit trail for observability
179
+ schema_migrations applied SQLite schema version history
179
180
  ```
180
181
 
181
182
  ## Coordination Semantics
@@ -185,10 +186,17 @@ events audit trail for observability
185
186
  - SQLite runs with WAL and `busy_timeout=5000`.
186
187
  - Tasks are project facts. They remain visible to all peers until status becomes
187
188
  `done` or `abandoned`.
189
+ - Tasks can form explicit parent/child hierarchies for team splits. Team commands
190
+ create auditable child tasks; they do not silently spawn model processes.
188
191
  - Messages are addressed mailbox items. Read state is tracked per peer.
192
+ - Message replies keep `reply_to` and `thread_id` so peer-visible collaboration
193
+ history can be reconstructed without terminal capture.
189
194
  - Broadcast messages use per-peer acknowledgement, so one peer cannot consume a
190
195
  message for everyone else.
191
196
  - Locks are advisory and TTL-based. Peers must follow the protocol.
197
+ - `hcc state` and `/api/state` expose a derived timeline plus
198
+ `automation.next_action.argv`; the command is advisory and does not execute
199
+ coordination actions itself.
192
200
 
193
201
  ## Hook Path
194
202
 
@@ -196,8 +204,8 @@ The primary model-facing path is hook context injection, not project markdown.
196
204
 
197
205
  `hcc web` installs hooks that register sessions and inject hello-cc snapshots at
198
206
  session start and before model answers. The injected snapshot contains current
199
- peer identity, active peers, open tasks, unread messages, active locks, and the
200
- commands the model should use to inspect state.
207
+ peer identity, active peers, open tasks, unread messages, active locks, the
208
+ current task when one exists, and the next auditable coordination action.
201
209
 
202
210
  `CLAUDE.md`, `AGENTS.md`, and `.hello-cc/HCC.md` are fallback instruction
203
211
  layers. Existing root files are updated only inside a bounded hello-cc block.
package/docs/guide.md CHANGED
@@ -70,8 +70,8 @@ project: /path/to/project
70
70
  database: /path/to/project/.hello-cc/mesh.db
71
71
  runtime: /path/to/project/.hello-cc/runtime.json
72
72
  log: /path/to/project/.hello-cc/web.log
73
- open: http://<machine-ip>:8787/?project=%2Fpath%2Fto%2Fproject
74
- local: http://127.0.0.1:8787/?project=%2Fpath%2Fto%2Fproject
73
+ open: http://<machine-ip>:8787/?token=<token>&project=%2Fpath%2Fto%2Fproject
74
+ local: http://127.0.0.1:8787/?token=<token>&project=%2Fpath%2Fto%2Fproject
75
75
  shims: installed claude, codex
76
76
  PATH updated in ~/.bashrc; open a new terminal or source it
77
77
  stop: hcc down
@@ -157,6 +157,8 @@ Tasks and messages have different read semantics:
157
157
  `abandoned`.
158
158
  - Messages are addressed mailbox items. `hcc msg inbox` defaults to unread
159
159
  messages for the current peer, and `hcc msg ack` records per-peer read state.
160
+ - Message replies are threaded. Use `hcc msg reply --id N --body "..."` when
161
+ answering a message, and use `hcc msg thread --id N` to read the full thread.
160
162
  - `ask` and `broadcast` write durable messages. With `--inject`, they also send
161
163
  live input to runtime-attached terminals.
162
164
  - Locks use SQLite transactions and TTLs. They are coordination locks, not a
@@ -175,8 +177,9 @@ into the model context:
175
177
  - open tasks
176
178
  - unread messages for the current peer
177
179
  - active locks
178
- - suggested commands such as `hcc status`, `hcc peers`, `hcc task list`,
179
- `hcc msg inbox`, and `hcc lock list`
180
+ - a machine-readable next action from `hcc state`
181
+ - suggested commands such as `hcc status`, `hcc state`, `hcc peers`,
182
+ `hcc task list`, `hcc msg inbox`, and `hcc lock list`
180
183
 
181
184
  When an attached Claude/Codex session is asked what other sessions are doing,
182
185
  it should answer from the latest hello-cc state instead of generic isolation
@@ -202,31 +205,46 @@ claude -p 'Do you see hello-cc open tasks?' --debug hooks --debug-file /tmp/hcc-
202
205
  The debug log should contain `Hook UserPromptSubmit ... provided
203
206
  additionalContext` and the `hello-cc coordination` block.
204
207
 
208
+ `hcc state --peer <peer> [--resource PATH]` exposes the same coordination state
209
+ without performing coordination actions such as acking messages, claiming tasks,
210
+ acquiring locks, sending messages, creating handoffs, or marking tasks done. It
211
+ returns the existing project arrays plus a unified `timeline` and an
212
+ `automation` object. The important machine field is
213
+ `automation.next_action.argv`: agents can execute that explicit hcc command, so
214
+ the coordination flow becomes auditable instead of being only a prompt
215
+ instruction. `automation.current_task` carries the peer's active task so a
216
+ resumed session keeps working on the same task until it is handed off, done, or
217
+ blocked.
218
+
205
219
  ## Web Console
206
220
 
207
- Start local and LAN-visible control:
221
+ Start local and LAN-visible control with token authentication:
208
222
 
209
223
  ```bash
210
224
  hcc web
211
225
  ```
212
226
 
213
- Use a token only when you want one:
227
+ Bare `hcc web` stores its generated token and reuses it across restarts. Set a
228
+ token explicitly when you want to replace the saved value:
214
229
 
215
230
  ```bash
216
- HCC_WEB_TOKEN='choose-a-long-token' hcc web --host 0.0.0.0 --port 8787
231
+ HCC_WEB_TOKEN='choose-a-long-token' hcc web --port 8787
217
232
  ```
218
233
 
219
234
  Open from another machine on the same network:
220
235
 
221
236
  ```text
222
- http://<machine-ip>:8787/
237
+ http://<machine-ip>:8787/?token=<token>
223
238
  ```
224
239
 
240
+ Use `hcc web --local` to bind only `127.0.0.1`. Use `hcc web --no-token` only
241
+ in a trusted local/test environment.
242
+
225
243
  The web console can:
226
244
 
227
245
  - switch between multiple registered project roots on one port
228
246
  - register another project path from the browser
229
- - show project state: peers, tasks, messages, locks, handoffs, events
247
+ - show project state: next action, timeline, peers, tasks, and locks
230
248
  - operate local terminals: start Claude/Codex/shell, send keyboard input, view
231
249
  output, detach runtime control
232
250
 
@@ -240,6 +258,8 @@ Browser-controlled sessions are local tmux terminals:
240
258
  Already-open raw terminals cannot be captured or controlled unconditionally
241
259
  unless they started under tmux, screen, or a hello-cc shim. They can still
242
260
  participate in tasks, messages, and locks through hooks and `hcc` commands.
261
+ For these coordination-only peers, the Web console shows collaboration through
262
+ the Timeline rather than a terminal stream.
243
263
 
244
264
  ## Command Reference
245
265
 
@@ -281,10 +301,35 @@ hcc task next
281
301
  hcc lock acquire --resource vllm/router --ttl 900 --reason "implement diagnostics"
282
302
  ```
283
303
 
304
+ `task next` first returns the peer's current claimed/running/review/blocked task.
305
+ Use `hcc task next --force` only when intentionally taking another pending task.
306
+
307
+ Split a task into an explicit team when the work is genuinely parallel:
308
+
309
+ ```bash
310
+ hcc team plan --from-task 12 \
311
+ --item "docs:Update user guide" \
312
+ --item "tests:Add regression" \
313
+ --workers codex:1,claude:1
314
+
315
+ hcc team start --from-task 12 \
316
+ --item "docs:Update user guide" \
317
+ --item "tests:Add regression" \
318
+ --workers codex:1,claude:1
319
+
320
+ hcc team status --task 12
321
+ ```
322
+
323
+ `team plan` is read-only. `team start` creates child tasks and assignment
324
+ messages, but it does not spawn hidden model processes. Agents still claim,
325
+ lock, hand off, and finish their own child tasks through the normal commands.
326
+
284
327
  Message or inject:
285
328
 
286
329
  ```bash
287
330
  hcc msg send --to claude-a --body "Implementation is ready for review."
331
+ hcc msg reply --id 12 --body "Reviewed; no blocker found."
332
+ hcc msg thread --id 12
288
333
  hcc ask claude-a "Please review the current implementation." --inject
289
334
  hcc broadcast "Pause edits under vllm/router until this task finishes." --inject
290
335
  ```
@@ -308,7 +353,7 @@ hcc lock release --resource vllm/router
308
353
  | `HCC_PEER` | default peer identity |
309
354
  | `HCC_ROOT` | override project root |
310
355
  | `HCC_DB` | override database path |
311
- | `HCC_WEB_TOKEN` | optional token for web access |
356
+ | `HCC_WEB_TOKEN` | replace and save the stable web access token |
312
357
  | `HCC_RUNTIME_URL` | direct runtime URL |
313
358
  | `HCC_NO_AUTO_INSTALL_TMUX=1` | disable tmux auto-install, mainly for tests |
314
359
 
@@ -67,8 +67,8 @@ project: /path/to/project
67
67
  database: /path/to/project/.hello-cc/mesh.db
68
68
  runtime: /path/to/project/.hello-cc/runtime.json
69
69
  log: /path/to/project/.hello-cc/web.log
70
- open: http://<machine-ip>:8787/?project=%2Fpath%2Fto%2Fproject
71
- local: http://127.0.0.1:8787/?project=%2Fpath%2Fto%2Fproject
70
+ open: http://<machine-ip>:8787/?token=<token>&project=%2Fpath%2Fto%2Fproject
71
+ local: http://127.0.0.1:8787/?token=<token>&project=%2Fpath%2Fto%2Fproject
72
72
  shims: installed claude, codex
73
73
  PATH updated in ~/.bashrc; open a new terminal or source it
74
74
  stop: hcc down
@@ -143,6 +143,8 @@ Claude/Codex/普通 shell
143
143
 
144
144
  - 任务是项目事实。所有 peer 默认都能看到未 `done` 且未 `abandoned` 的任务。
145
145
  - 消息是带收件人的邮箱消息。`hcc msg inbox` 默认读取当前 peer 的未读消息,`hcc msg ack` 记录每个 peer 的已读状态。
146
+ - 消息回复有 thread。回复某条消息时使用 `hcc msg reply --id N --body "..."`,
147
+ 查看完整线程时使用 `hcc msg thread --id N`。
146
148
  - `ask` 和 `broadcast` 会写入持久消息;加 `--inject` 时,还会把内容实时注入到 Web runtime 已接管的终端。
147
149
  - 锁使用 SQLite 事务和 TTL,是协作式冲突避免,不是文件系统强制沙箱。
148
150
 
@@ -157,7 +159,8 @@ Claude/Codex/普通 shell
157
159
  - 未完成任务
158
160
  - 当前 peer 的未读消息
159
161
  - 活跃锁
160
- - 建议执行的 `hcc status`、`hcc peers`、`hcc task list`、`hcc msg inbox`、`hcc lock list`
162
+ - 来自 `hcc state` 的机器可读下一步动作
163
+ - 建议执行的 `hcc status`、`hcc state`、`hcc peers`、`hcc task list`、`hcc msg inbox`、`hcc lock list`
161
164
 
162
165
  因此,当你在已接入的 Claude/Codex 里问“其他会话在做什么”,模型应该基于 hello-cc 注入的最新状态回答,而不是回答“我无法知道其他会话”。
163
166
 
@@ -178,31 +181,41 @@ claude -p 'Do you see hello-cc open tasks?' --debug hooks --debug-file /tmp/hcc-
178
181
 
179
182
  debug 日志里应该出现 `Hook UserPromptSubmit ... provided additionalContext`,并包含 `hello-cc coordination` 块。
180
183
 
184
+ `hcc state --peer <peer> [--resource PATH]` 会读取同一份协作状态,但不会执行
185
+ 确认消息、认领任务、获取锁、发送消息、创建 handoff 或标记完成这类协作动作。
186
+ 它返回现有项目数组、统一 `timeline`,以及 `automation` 对象。关键机器字段是
187
+ `automation.next_action.argv`:agent 可以显式执行这条 hcc 命令,让协作流程留下
188
+ 可审计记录,而不是只依赖 prompt 里的自然语言规则。`automation.current_task`
189
+ 会携带当前 peer 的活动任务,让恢复后的会话继续同一个任务,直到交接、完成或阻塞。
190
+
181
191
  ## Web 控制台
182
192
 
183
- 默认本机和内网访问:
193
+ 默认开启本机和内网访问,并启用 token 认证:
184
194
 
185
195
  ```bash
186
196
  hcc web
187
197
  ```
188
198
 
189
- 需要令牌时再显式开启:
199
+ 裸 `hcc web` 会保存自动生成的 token,并在重启后复用。需要替换保存值时可显式设置:
190
200
 
191
201
  ```bash
192
- HCC_WEB_TOKEN='choose-a-long-token' hcc web --host 0.0.0.0 --port 8787
202
+ HCC_WEB_TOKEN='choose-a-long-token' hcc web --port 8787
193
203
  ```
194
204
 
195
205
  同一内网机器打开:
196
206
 
197
207
  ```text
198
- http://<machine-ip>:8787/
208
+ http://<machine-ip>:8787/?token=<token>
199
209
  ```
200
210
 
211
+ 使用 `hcc web --local` 可只监听 `127.0.0.1`。只有在可信本地/测试环境才使用
212
+ `hcc web --no-token`。
213
+
201
214
  Web 控制台能做这些事:
202
215
 
203
216
  - 在一个端口里切换多个已注册项目 root
204
217
  - 直接在浏览器里注册新的项目路径
205
- - 查看项目状态:peers、tasks、messages、locks、handoffs、events
218
+ - 查看项目状态:下一步动作、timeline、peers、tasks、locks
206
219
  - 操作本地终端:启动 Claude/Codex/shell、发送键盘输入、查看输出、停止接管
207
220
 
208
221
  Web 操作的是 hello-cc 管理的本机 tmux 终端:
@@ -213,6 +226,7 @@ Web 操作的是 hello-cc 管理的本机 tmux 终端:
213
226
  - 通过 `hcc peer attach` 接入的已有 tmux pane
214
227
 
215
228
  已经打开的普通 raw 终端不能被无条件捕获或控制,除非它原本就在 tmux、screen 或 hello-cc shim 之下。它仍然可以通过 hooks 和 `hcc` 命令参与任务、消息和锁。
229
+ 对于这类 coordination-only peer,Web 会通过 Timeline 展示协作轨迹,而不是显示终端流。
216
230
 
217
231
  ## 命令参考
218
232
 
@@ -252,10 +266,34 @@ hcc task next
252
266
  hcc lock acquire --resource vllm/router --ttl 900 --reason "实现路由诊断"
253
267
  ```
254
268
 
269
+ `task next` 会先返回当前 peer 已经认领、运行、审查或阻塞中的任务。只有明确
270
+ 要再接一个 pending 任务时,才使用 `hcc task next --force`。
271
+
272
+ 当工作确实可以并行时,用显式团队把父任务拆成子任务:
273
+
274
+ ```bash
275
+ hcc team plan --from-task 12 \
276
+ --item "docs:更新用户指南" \
277
+ --item "tests:增加回归测试" \
278
+ --workers codex:1,claude:1
279
+
280
+ hcc team start --from-task 12 \
281
+ --item "docs:更新用户指南" \
282
+ --item "tests:增加回归测试" \
283
+ --workers codex:1,claude:1
284
+
285
+ hcc team status --task 12
286
+ ```
287
+
288
+ `team plan` 是只读命令。`team start` 会创建子任务和分配消息,但不会隐藏地启动
289
+ 模型进程。每个 agent 仍然通过普通任务、锁、交接和完成命令处理自己的子任务。
290
+
255
291
  发消息或实时注入:
256
292
 
257
293
  ```bash
258
294
  hcc msg send --to claude-a --body "实现已准备好供审查。"
295
+ hcc msg reply --id 12 --body "已审查,未发现阻塞问题。"
296
+ hcc msg thread --id 12
259
297
  hcc ask claude-a "请审查当前实现。" --inject
260
298
  hcc broadcast "暂停编辑 vllm/router,等待任务完成。" --inject
261
299
  ```
@@ -279,7 +317,7 @@ hcc lock release --resource vllm/router
279
317
  | `HCC_PEER` | 默认 peer 身份 |
280
318
  | `HCC_ROOT` | 覆盖项目根目录 |
281
319
  | `HCC_DB` | 覆盖数据库路径 |
282
- | `HCC_WEB_TOKEN` | 可选 Web 访问令牌 |
320
+ | `HCC_WEB_TOKEN` | 替换并保存固定 Web 访问令牌 |
283
321
  | `HCC_RUNTIME_URL` | 直接指定 runtime URL |
284
322
  | `HCC_NO_AUTO_INSTALL_TMUX=1` | 禁用 tmux 自动安装,主要用于测试 |
285
323
 
@@ -119,7 +119,9 @@ Messages:
119
119
  ```text
120
120
  from peer
121
121
  to peer | all | tag:<tag> | task:<task-id>
122
- kind note | ask | handoff | system
122
+ kind note | ask | reply | handoff | system
123
+ reply_to optional source message id
124
+ thread_id root message id for threaded collaboration history
123
125
  delivery store-only | inject-terminal | both
124
126
  ```
125
127
 
@@ -128,11 +130,29 @@ Tasks:
128
130
  ```text
129
131
  pending -> claimed -> running -> review/block/done|abandoned
130
132
  owner is dynamic; there is no fixed dispatcher
133
+ parent_id/team_role record explicit team child tasks
131
134
  ```
132
135
 
133
136
  Default task reads are lifecycle-based: all peers see tasks until they are
134
137
  `done` or `abandoned`. Read/ack state exists only for messages.
135
138
 
139
+ `hcc team plan` is read-only. `hcc team start` creates child tasks under the
140
+ parent and assignment messages; it does not spawn hidden agents or bypass the
141
+ normal claim/lock/handoff protocol.
142
+
143
+ State:
144
+
145
+ ```text
146
+ hcc state / /api/state
147
+ timeline derived from messages, handoffs, tasks, locks, and selected events
148
+ automation.next_action.argv suggests the next explicit hcc command
149
+ automation.current_task preserves sticky task context across prompts
150
+ ```
151
+
152
+ State inspection does not perform coordination actions such as acking messages,
153
+ claiming tasks, acquiring locks, sending messages, creating handoffs, or marking
154
+ tasks done. Opening a DB may still run schema/version maintenance.
155
+
136
156
  Locks:
137
157
 
138
158
  ```text