@baoanaz/cviauto 0.6.6 → 0.6.8

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 (80) hide show
  1. package/dist/templates/claude/agents/trellis-check.md +61 -61
  2. package/dist/templates/claude/agents/trellis-implement.md +58 -58
  3. package/dist/templates/claude/agents/trellis-research.md +67 -67
  4. package/dist/templates/codebuddy/agents/trellis-check.md +61 -61
  5. package/dist/templates/codebuddy/agents/trellis-implement.md +58 -58
  6. package/dist/templates/codebuddy/agents/trellis-research.md +67 -67
  7. package/dist/templates/codex/agents/trellis-check.toml +99 -30
  8. package/dist/templates/codex/agents/trellis-implement.toml +99 -16
  9. package/dist/templates/codex/agents/trellis-research.toml +116 -39
  10. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +41 -41
  11. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +194 -261
  12. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +59 -93
  13. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +72 -110
  14. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +120 -171
  15. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +35 -43
  16. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +78 -78
  17. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +24 -24
  18. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +29 -29
  19. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +46 -46
  20. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +28 -28
  21. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +66 -66
  22. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +32 -32
  23. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +40 -40
  24. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +40 -40
  25. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +44 -44
  26. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +79 -79
  27. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +37 -37
  28. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +43 -43
  29. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +47 -47
  30. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +40 -40
  31. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +33 -33
  32. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +61 -61
  33. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +41 -41
  34. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +31 -31
  35. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +40 -40
  36. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +40 -41
  37. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +36 -36
  38. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +36 -38
  39. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +52 -52
  40. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +45 -45
  41. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +41 -42
  42. package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +28 -28
  43. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +30 -30
  44. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +34 -34
  45. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +30 -30
  46. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +39 -39
  47. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +40 -40
  48. package/dist/templates/common/commands/continue.md +28 -29
  49. package/dist/templates/common/commands/finish-work.md +32 -40
  50. package/dist/templates/cursor/agents/trellis-check.md +61 -61
  51. package/dist/templates/cursor/agents/trellis-implement.md +58 -58
  52. package/dist/templates/cursor/agents/trellis-research.md +67 -67
  53. package/dist/templates/droid/droids/trellis-check.md +64 -56
  54. package/dist/templates/droid/droids/trellis-implement.md +61 -53
  55. package/dist/templates/droid/droids/trellis-research.md +67 -67
  56. package/dist/templates/gemini/agents/trellis-check.md +64 -57
  57. package/dist/templates/gemini/agents/trellis-implement.md +61 -54
  58. package/dist/templates/gemini/agents/trellis-research.md +67 -67
  59. package/dist/templates/kiro/agents/trellis-check.json +15 -3
  60. package/dist/templates/kiro/agents/trellis-implement.json +15 -3
  61. package/dist/templates/kiro/agents/trellis-research.json +10 -2
  62. package/dist/templates/kiro/agents/trellis.json +19 -5
  63. package/dist/templates/opencode/agents/trellis-check.md +61 -61
  64. package/dist/templates/opencode/agents/trellis-implement.md +58 -59
  65. package/dist/templates/opencode/agents/trellis-research.md +67 -67
  66. package/dist/templates/pi/agents/trellis-check.md +99 -21
  67. package/dist/templates/pi/agents/trellis-implement.md +90 -22
  68. package/dist/templates/pi/agents/trellis-research.md +124 -12
  69. package/dist/templates/qoder/agents/trellis-check.md +64 -57
  70. package/dist/templates/qoder/agents/trellis-implement.md +61 -54
  71. package/dist/templates/qoder/agents/trellis-research.md +67 -67
  72. package/dist/templates/trae/agents/trellis-check.md +64 -57
  73. package/dist/templates/trae/agents/trellis-implement.md +61 -54
  74. package/dist/templates/trae/agents/trellis-research.md +67 -67
  75. package/dist/templates/trellis/agents/check.md +29 -29
  76. package/dist/templates/trellis/agents/implement.md +30 -30
  77. package/dist/templates/trellis/workflow.md +349 -356
  78. package/dist/templates/zcode/agents/trellis-check.md +64 -51
  79. package/dist/templates/zcode/agents/trellis-implement.md +61 -53
  80. package/package.json +2 -2
@@ -1,51 +1,45 @@
1
- # Command Reference
1
+ # 命令参考(Command Reference
2
2
 
3
- Authoritative current command reference for `cviauto channel` subcommands,
4
- validated against the source in `packages/cli/src/commands/channel/`
5
- (`index.ts` Commander wiring and each subcommand handler).
3
+ `cviauto channel` 子命令的权威当前命令参考,对照 `packages/cli/src/commands/channel/` 目录下的源码验证(`index.ts` 的 Commander 接线以及各子命令处理函数)。
6
4
 
7
- Every subcommand accepts `--scope <project|global>` unless noted; `project`
8
- is the default and resolves against the current cwd's project bucket.
5
+ 除非另有说明,每个子命令都接受 `--scope <project|global>`;`project` 为默认值,会基于当前工作目录的项目桶进行解析。
9
6
 
10
- ## Top-level
7
+ ## 顶层命令
11
8
 
12
9
  ```
13
10
  cviauto channel <subcommand>
14
11
  ```
15
12
 
16
- > Multi-agent collaboration runtime spawn / coordinate / interrupt worker
17
- > agents through a shared event log.
13
+ > 多智能体协作运行时(Multi-agent collaboration runtime)—— 通过共享事件日志来生成(spawn)/ 协调(coordinate)/ 中断(interrupt)工作智能体(worker agent)。
18
14
 
19
15
  ---
20
16
 
21
- ## Create / List
17
+ ## 创建 / 列表
22
18
 
23
19
  ### `create <name>`
24
20
 
25
21
  ```bash
26
22
  cviauto channel create <name>
27
- [--scope project|global] # default: project
28
- [--type chat|forum] # default: chat
29
- [--task <path>] # associated Cviauto task dir
23
+ [--scope project|global] # 默认:project
24
+ [--type chat|forum] # 默认:chat
25
+ [--task <path>] # 关联的 Cviauto 任务目录
30
26
  [--project <slug>]
31
27
  [--labels a,b,c]
32
- [--description <text>] # stable channel description
33
- [--context-file <abs-path>] ... # repeatable
34
- [--context-raw <text>] ... # repeatable
35
- [--linked-context-file <abs-path>] # [deprecated alias]
36
- [--linked-context-raw <text>] # [deprecated alias]
37
- [--cwd <path>] # recorded in create event
38
- [--by <agent>] # default: main
39
- [--force] # overwrite existing channel
40
- [--ephemeral] # hide from default list, prunable
28
+ [--description <text>] # 稳定的频道描述
29
+ [--context-file <abs-path>] ... # 可重复
30
+ [--context-raw <text>] ... # 可重复
31
+ [--linked-context-file <abs-path>] # [已弃用的别名]
32
+ [--linked-context-raw <text>] # [已弃用的别名]
33
+ [--cwd <path>] # 记录在 create 事件中
34
+ [--by <agent>] # 默认:main
35
+ [--force] # 覆盖已存在的频道
36
+ [--ephemeral] # 在默认列表中隐藏,可被清理
41
37
  ```
42
38
 
43
- Behavior:
44
- - Appends a `create` event; immutable `type` (cannot mutate forum↔chat after).
45
- - `--ephemeral` channels are hidden from `channel list` by default and are
46
- the sweep target for `channel prune --ephemeral`.
47
- - `--linked-context-*` are folded into `--context-*`; emit a deprecation
48
- notice when used.
39
+ 行为:
40
+ - 追加一条 `create` 事件;`type` 不可变(创建后无法在 forum chat 之间切换)。
41
+ - `--ephemeral` 频道默认在 `channel list` 中隐藏,同时也是 `channel prune --ephemeral` 的清理目标。
42
+ - `--linked-context-*` 会被合并到 `--context-*` 中;使用时会输出弃用提示。
49
43
 
50
44
  ### `list`
51
45
 
@@ -53,131 +47,106 @@ Behavior:
53
47
  cviauto channel list
54
48
  [--scope project|global]
55
49
  [--json]
56
- [--project <slug>] # substring match on task field
57
- [--all] # include ephemeral (suffix '*')
58
- [--all-projects] # scan every project bucket
50
+ [--project <slug>] # task 字段做子串匹配
51
+ [--all] # 包含临时频道(后缀 '*'
52
+ [--all-projects] # 扫描所有项目桶
59
53
  ```
60
54
 
61
- Behavior:
62
- - Default scope: current cwd's project. `--all-projects` scans every bucket.
63
- - Pretty mode prints `NAME WORKERS EVENTS LAST KIND TYPE TASK`, sorted by
64
- recency, with a footer noting hidden ephemeral count.
65
- - `--json` switches to a JSON array.
55
+ 行为:
56
+ - 默认范围:当前工作目录的项目。`--all-projects` 会扫描所有桶。
57
+ - 美化模式(pretty mode)打印 `NAME WORKERS EVENTS LAST KIND TYPE TASK`,按最近时间排序,并在页脚显示隐藏的临时频道数量。
58
+ - `--json` 切换为 JSON 数组输出。
66
59
 
67
60
  ---
68
61
 
69
- ## Chat Messages
62
+ ## 聊天消息(Chat Messages
70
63
 
71
64
  ### `send <name> [text]`
72
65
 
73
66
  ```bash
74
67
  cviauto channel send <name> [text]
75
- --as <agent> # REQUIREDauthor
68
+ --as <agent> # 必填作者
76
69
  [--scope project|global]
77
- [--to <agents,csv>] # default: broadcast
78
- [--stdin | --text-file <path>] # body from stdin or file
70
+ [--to <agents,csv>] # 默认:广播(broadcast
71
+ [--stdin | --text-file <path>] # 从标准输入或文件读取消息体
79
72
  [--delivery-mode appendOnly|requireKnownWorker|requireRunningWorker]
80
73
  ```
81
74
 
82
- Behavior:
83
- - Body precedence: positional `[text]` → `--stdin` → `--text-file`.
84
- - `--to` with one entry stores a string; multiple stores an array; omitted
85
- means broadcast.
86
- - `--delivery-mode` selects targeted-delivery validation:
87
- - `appendOnly` (default-ish — just record),
88
- - `requireKnownWorker` (the named target must have a `spawned` event),
89
- - `requireRunningWorker` (the worker must currently be live).
90
- - Prints the appended event as one JSON line on stdout.
75
+ 行为:
76
+ - 消息体优先级:位置参数 `[text]` → `--stdin` → `--text-file`。
77
+ - `--to` 只有一个条目时存储为字符串;多个时存储为数组;省略时表示广播。
78
+ - `--delivery-mode` 选择定向投递验证方式:
79
+ - `appendOnly`(默认行为 仅记录),
80
+ - `requireKnownWorker`(指定目标必须有 `spawned` 事件),
81
+ - `requireRunningWorker`(该 worker 当前必须处于活跃状态)。
82
+ - 将追加的事件以单行 JSON 打印到 stdout。
91
83
 
92
- > **Note:** `send` has **no** `--tag` and **no** `--kind` flag. See
93
- > [`tag-vs-kind`](#tag-vs-kind--how-event-shape-is-actually-controlled) below.
84
+ > **注意:** `send` **没有** `--tag` `--kind` 标志。参见下文 [tag-vs-kind](#tag-vs-kind--事件形态的实际控制方式)。
94
85
 
95
86
  ### `messages <name>`
96
87
 
97
88
  ```bash
98
89
  cviauto channel messages <name>
99
90
  [--scope project|global]
100
- [--raw] # one JSON event per line
101
- [--follow] # stream new events
102
- [--last <N>] # last N matching events
91
+ [--raw] # 每行一个 JSON 事件
92
+ [--follow] # 流式推送新事件
93
+ [--last <N>] # 最近 N 条匹配事件
103
94
  [--since <seq>] # seq > N
104
- [--kind <kind>] # one of CHANNEL_EVENT_KINDS
105
- [--from <csv>] # author filter
106
- [--to <target>] # routing target filter
107
- [--thread <key>] # forum-only
108
- [--action <thread-action>] # forum-only
109
- [--no-progress] # hide progress events
95
+ [--kind <kind>] # 必须是 CHANNEL_EVENT_KINDS 之一
96
+ [--from <csv>] # 作者过滤
97
+ [--to <target>] # 路由目标过滤
98
+ [--thread <key>] # forum 频道
99
+ [--action <thread-action>] # forum 频道
100
+ [--no-progress] # 隐藏进度事件
110
101
  ```
111
102
 
112
- Behavior:
113
- - Auto-detects forum channels: with no filters it renders the thread board
114
- instead of the event stream. `--thread` / `--action` are forum-only and
115
- error against chat channels.
116
- - `--kind` is validated against `CHANNEL_EVENT_KINDS` (single value, not
117
- CSV — that's the `wait` side).
103
+ 行为:
104
+ - 自动检测 forum 频道:无过滤器时渲染线程面板而非事件流。`--thread` / `--action` 仅限 forum 频道,对 chat 频道使用会报错。
105
+ - `--kind` 会按 `CHANNEL_EVENT_KINDS` 进行校验(单个值,非 CSV `wait` 那边才是 CSV)。
118
106
 
119
107
  ### `wait <name>`
120
108
 
121
109
  ```bash
122
110
  cviauto channel wait <name>
123
- --as <agent> # REQUIREDself for filter ctx
111
+ --as <agent> # 必填用于过滤器上下文的自身标识
124
112
  [--scope project|global]
125
- [--timeout <Ns|Nm|Nh|Nms>] # parsed by parseDuration
126
- [--from <a,b>] # author CSV
127
- [--kind <k1,k2>] # CSV, OR semantics
128
- [--thread <key>] # forum filter
129
- [--action <thread-action>] # forum filter
130
- [--to <target>] # default: own agent (broadcast + me)
131
- [--include-progress] # also wake on progress events
132
- [--all] # require every --from to match
113
+ [--timeout <Ns|Nm|Nh|Nms>] # parseDuration 解析
114
+ [--from <a,b>] # 作者 CSV
115
+ [--kind <k1,k2>] # CSVOR 语义
116
+ [--thread <key>] # forum 过滤
117
+ [--action <thread-action>] # forum 过滤
118
+ [--to <target>] # 默认:自身智能体(广播 + 我)
119
+ [--include-progress] # 遇到进度事件也唤醒
120
+ [--all] # 要求所有 --from 都匹配
133
121
  ```
134
122
 
135
- Behavior:
136
- - Streams matching events as JSON, one per line.
137
- - Default `--to` filter is the caller's own agent (broadcast events still
138
- match broadcast + explicit-to-me).
139
- - `--all` requires `--from` and blocks until every listed agent has produced
140
- a matching event.
141
- - **Timeout exits 124** and prints `timeout: still waiting on ...` to stderr
142
- when `--all` was in play.
123
+ 行为:
124
+ - JSON 流式输出匹配的事件,每行一个。
125
+ - 默认 `--to` 过滤器为调用者自身智能体(广播事件也会匹配 广播 + 显式发送给我)。
126
+ - `--all` 要求指定 `--from`,并且会阻塞直到所有列出的智能体都产生了匹配事件。
127
+ - **超时退出码为 124**,当使用了 `--all` 时,会在 stderr 打印 `timeout: still waiting on ...`。
143
128
 
144
129
  ---
145
130
 
146
- ## tag-vs-kind — how event shape is actually controlled
147
-
148
- There is **no `--tag` flag** anywhere in the v0.6.0 channel CLI; `--kind` is
149
- not a legacy alias for any `--tag` flag.
150
-
151
- Concrete model in the current source:
152
-
153
- - `--kind` is the only event-type filter, and it is constrained to the
154
- trellis-emitted whitelist (`CHANNEL_EVENT_KINDS` in
155
- `packages/core/src/channel/internal/store/events.ts`):
156
- - `create`, `join`, `leave`, `message`, `thread`, `context`, `channel`,
157
- `spawned`, `killed`, `respawned`, `progress`, `done`, `error`,
158
- `waiting`, `awake`, `undeliverable`, `interrupt_requested`,
159
- `turn_started`, `turn_finished`, `interrupted`, `supervisor_warning`
160
- - Passing anything else throws
161
- `Invalid --kind '<x>'. Must be one of: …`.
162
- - `--kind` lives on `wait` (CSV, OR semantics) and `messages` (single
163
- value). `send` and `run` cannot emit a custom kind — every `send` writes
164
- a `message` event.
165
- - Mid-turn worker abort is **not** a tag. It is the dedicated
166
- `channel interrupt` command, which appends an `interrupt_requested` /
167
- `interrupted` pair and provider-level interrupts the worker.
168
-
169
- Practical rule for dispatchers waiting on workers:
170
-
171
- - Use `--kind done,turn_finished` for "worker finished a turn" — these are
172
- system events that the supervisor fires automatically. Do not depend on
173
- the worker LLM remembering to emit any custom signal.
174
- - Use `cviauto channel interrupt` (the command) only when you actually want
175
- mid-turn abort behavior.
176
- - Do **not** invent user-side tags as completion signals. There is no
177
- `--tag` filter; a worker writing a custom string into its final message
178
- is just text inside a `message` event and cannot be matched by `wait`.
179
-
180
- Long bodies always go through stdin or a file:
131
+ ## tag-vs-kind — 事件形态的实际控制方式
132
+
133
+ v0.6.0 channel CLI 中**任何地方都没有 `--tag` 标志**;`--kind` 也不是任何 `--tag` 标志的旧版别名。
134
+
135
+ 当前源码中的具体模型:
136
+
137
+ - `--kind` 是唯一的事件类型过滤器,且被限制为 Cviauto 发出的白名单(`packages/core/src/channel/internal/store/events.ts` 中的 `CHANNEL_EVENT_KINDS`):
138
+ - `create`、`join`、`leave`、`message`、`thread`、`context`、`channel`、`spawned`、`killed`、`respawned`、`progress`、`done`、`error`、`waiting`、`awake`、`undeliverable`、`interrupt_requested`、`turn_started`、`turn_finished`、`interrupted`、`supervisor_warning`
139
+ - 传入其他值会抛出 `Invalid --kind '<x>'. Must be one of: …`。
140
+ - `--kind` 用于 `wait`(CSV,OR 语义)和 `messages`(单个值)。`send` 和 `run` 不能发送自定义 kind — 每次 `send` 写入的都是 `message` 事件。
141
+ - 中途终止 worker **不是**一个 tag,而是专用的 `channel interrupt` 命令,它会追加一对 `interrupt_requested` / `interrupted` 事件,并在 provider 层级对 worker 进行中断。
142
+
143
+ 调度者(dispatcher)等待 worker 的实用规则:
144
+
145
+ - 使用 `--kind done,turn_finished` 来表示"worker 完成了一个回合" — 这些是 supervisor 自动触发的系统事件。不要依赖 worker 的 LLM 记得发出任何自定义信号。
146
+ - 只有当你确实需要中途终止行为时,才使用 `cviauto channel interrupt`(该命令)。
147
+ - **不要**凭空发明用户侧标签作为完成信号。没有 `--tag` 过滤器;worker 在最终消息中写入的自定义字符串只是 `message` 事件中的文本,无法被 `wait` 匹配到。
148
+
149
+ 长消息体始终通过标准输入或文件传递:
181
150
 
182
151
  ```bash
183
152
  cviauto channel send T --as A --stdin < /tmp/message.md
@@ -186,65 +155,57 @@ cviauto channel send T --as A --text-file /tmp/message.md
186
155
 
187
156
  ---
188
157
 
189
- ## Interrupt
158
+ ## 中断(Interrupt
190
159
 
191
160
  ### `interrupt <name> [text]`
192
161
 
193
162
  ```bash
194
163
  cviauto channel interrupt <name> [text]
195
- --as <agent> # REQUIREDcaller
196
- --to <agent> # REQUIREDtarget worker
164
+ --as <agent> # 必填调用者
165
+ --to <agent> # 必填目标 worker
197
166
  [--scope project|global]
198
167
  [--stdin | --text-file <path>]
199
168
  ```
200
169
 
201
- Behavior:
202
- - Appends an `interrupt` event with `reason: "user"` and a replacement
203
- instruction body; supervisor performs provider-level interrupt where
204
- supported (Claude `/interrupt`, Codex turn cancel).
205
- - Prints the appended event JSON on stdout.
170
+ 行为:
171
+ - 追加一条 `interrupt` 事件,其中 `reason: "user"` 并附带替代指令正文;supervisor provider 支持的情况下执行 provider 级中断(Claude 的 `/interrupt`、Codex 的 turn cancel)。
172
+ - 将追加的事件 JSON 打印到 stdout。
206
173
 
207
174
  ---
208
175
 
209
- ## Workers
176
+ ## 工作智能体(Workers
210
177
 
211
178
  ### `spawn <name>`
212
179
 
213
180
  ```bash
214
181
  cviauto channel spawn <name>
215
182
  [--scope project|global]
216
- [--agent <agent-name>] # loads .cviauto/agents/<name>.md
217
- [--provider claude|codex] # overrides agent file
218
- [--as <worker-name>] # default: agent name
183
+ [--agent <agent-name>] # 加载 .cviauto/agents/<name>.md
184
+ [--provider claude|codex] # 覆盖 agent 文件中的配置
185
+ [--as <worker-name>] # 默认:agent 名称
219
186
  [--cwd <path>]
220
187
  [--model <id>]
221
- [--resume <id>] # session/thread id resume
222
- [--timeout <Ns|Nm|Nh>] # auto-kill after duration
223
- [--warn-before <Ns|Nm|Nh>] # supervisor_warning lead time
224
- # default 5m, 0ms disables
225
- [--file <path>] ... # glob, repeatable; inject content
226
- [--jsonl <path>] ... # Cviauto manifest, repeatable
227
- [--by <agent>] # spawn-event author
228
- # default: TRELLIS_CHANNEL_AS env or 'main'
188
+ [--resume <id>] # 恢复会话/线程 ID
189
+ [--timeout <Ns|Nm|Nh>] # 超时后自动 kill
190
+ [--warn-before <Ns|Nm|Nh>] # supervisor_warning 提前量
191
+ # 默认 5m0ms 表示禁用
192
+ [--file <path>] ... # 支持 glob,可重复;注入文件内容
193
+ [--jsonl <path>] ... # Cviauto 清单文件,可重复
194
+ [--by <agent>] # spawn 事件作者
195
+ # 默认:TRELLIS_CHANNEL_AS 环境变量或 'main'
229
196
  [--inbox-policy explicitOnly|broadcastAndExplicit]
230
- # default explicitOnly
231
- [--idle-timeout <Ns|Nm|Nh>] # OOM-guard idle TTL
232
- # default 5m, 0 disables
233
- [--max-live-workers <n>] # spawn-time live-worker budget
234
- # default 6, 0 disables
197
+ # 默认 explicitOnly
198
+ [--idle-timeout <Ns|Nm|Nh>] # OOM 防护的空闲 TTL
199
+ # 默认 5m0 表示禁用
200
+ [--max-live-workers <n>] # 启动时的活跃 worker 数量预算
201
+ # 默认 60 表示禁用
235
202
  ```
236
203
 
237
- Behavior:
238
- - Provider is validated against the adapter registry
239
- (`packages/cli/src/commands/channel/adapters/`); current: `claude`,
240
- `codex`.
241
- - Worker stays inbox-idle until the first `send --to <worker>`.
242
- - Records a `spawned` event with `pid`, `provider`, `agent`, `files`,
243
- `manifests`.
244
- - OOM-guard precedence: CLI flag → env var
245
- (`TRELLIS_CHANNEL_WORKER_IDLE_TIMEOUT`,
246
- `TRELLIS_CHANNEL_MAX_LIVE_WORKERS`) →
247
- `.cviauto/config.yaml#channel.worker_guard` → built-in defaults.
204
+ 行为:
205
+ - Provider 按适配器注册表进行校验(`packages/cli/src/commands/channel/adapters/`);当前:`claude`、`codex`。
206
+ - Worker 在收到第一条 `send --to <worker>` 之前保持收件箱空闲状态。
207
+ - 记录一条 `spawned` 事件,包含 `pid`、`provider`、`agent`、`files`、`manifests`。
208
+ - OOM 防护优先级:CLI 标志 环境变量(`TRELLIS_CHANNEL_WORKER_IDLE_TIMEOUT`、`TRELLIS_CHANNEL_MAX_LIVE_WORKERS`)→ `.cviauto/config.yaml#channel.worker_guard` 内置默认值。
248
209
 
249
210
  ### `run [name]`
250
211
 
@@ -255,36 +216,30 @@ cviauto channel run [name?]
255
216
  [--as <worker-name>]
256
217
  [--cwd <path>]
257
218
  [--model <id>]
258
- [--file <path>] ... # repeatable, glob
259
- [--jsonl <path>] ... # repeatable
219
+ [--file <path>] ... # 可重复,支持 glob
220
+ [--jsonl <path>] ... # 可重复
260
221
  [--message <text> | --message-file <path> | --stdin]
261
- [--timeout <Ns|Nm|Nh>] # default 5m
222
+ [--timeout <Ns|Nm|Nh>] # 默认 5m
262
223
  ```
263
224
 
264
- Behavior:
265
- - One-shot. Auto-generates `run-<hex>` if `name` omitted.
266
- - Creates an ephemeral channel (`createMode=run`), spawns a single worker,
267
- sends the prompt, waits for `done`, prints the final assistant text to
268
- stdout, then removes the channel on success. On failure the channel is
269
- kept for inspection and exit code is 1.
225
+ 行为:
226
+ - 一次性执行(one-shot)。省略 `name` 时自动生成 `run-<hex>`。
227
+ - 创建临时频道(`createMode=run`),启动单个 worker,发送提示词,等待 `done`,将最终的助手文本打印到 stdout,成功后删除频道。失败时保留频道以供检查,退出码为 1。
270
228
 
271
- > `run` has **no** `--tag` flag. Completion is detected via the `done`
272
- > event the supervisor emits.
229
+ > `run` **没有** `--tag` 标志。完成检测通过 supervisor 发出的 `done` 事件实现。
273
230
 
274
231
  ### `kill <name>`
275
232
 
276
233
  ```bash
277
234
  cviauto channel kill <name>
278
- --as <agent> # REQUIRED — worker agent name
235
+ --as <agent> # 必填 — worker 智能体名称
279
236
  [--scope project|global]
280
- [--force] # SIGKILL immediately
237
+ [--force] # 立即 SIGKILL
281
238
  ```
282
239
 
283
- Behavior:
284
- - Default path: SIGTERM → 8 s grace → SIGKILL escalation; the CLI writes a
285
- `killed` event when SIGKILL was needed so the log stays truthful.
286
- - Cleans `pid`, `worker-pid`, `config`, `spawnlock` sidecar files; keeps
287
- `log`, `session-id`, `thread-id` for forensics / resume.
240
+ 行为:
241
+ - 默认路径:SIGTERM → 8 秒宽限期 → SIGKILL 升级;CLI 在需要 SIGKILL 时会写入 `killed` 事件,确保日志记录保持真实。
242
+ - 清理 `pid`、`worker-pid`、`config`、`spawnlock` 附属文件;保留 `log`、`session-id`、`thread-id` 用于取证 / 恢复。
288
243
 
289
244
  ### `rm <name>`
290
245
 
@@ -293,60 +248,57 @@ cviauto channel rm <name>
293
248
  [--scope project|global]
294
249
  ```
295
250
 
296
- Behavior:
297
- - Kills any live workers, then deletes the entire channel directory.
298
- - Prints `Removed channel '<name>'`.
251
+ 行为:
252
+ - 终止所有活跃 worker,然后删除整个频道目录。
253
+ - 打印 `Removed channel '<name>'`。
299
254
 
300
255
  ### `prune`
301
256
 
302
257
  ```bash
303
258
  cviauto channel prune
304
- [--scope project|global] # omitted: scan every project
305
- [--all | --empty | --idle <Ns|Nm|Nh|Nd> | --ephemeral] # mutually exclusive
306
- [--yes] # actually delete (default: dry-run)
307
- [--dry-run] # default true; redundant with default
308
- [--keep <names,csv>] # exclusion list
259
+ [--scope project|global] # 省略:扫描所有项目
260
+ [--all | --empty | --idle <Ns|Nm|Nh|Nd> | --ephemeral] # 互斥选项
261
+ [--yes] # 实际执行删除(默认:干运行)
262
+ [--dry-run] # 默认 true;与默认值重复
263
+ [--keep <names,csv>] # 排除列表
309
264
  ```
310
265
 
311
- Behavior:
312
- - Filter flags are mutually exclusive error otherwise.
313
- - Default is dry-run; `--yes` flips to real delete.
314
- - Without `--scope`, scans **every** project bucket (intentional, repo-wide
315
- cleanup); with `--scope project|global`, limited to that bucket.
316
- - Live-worker channels are always skipped regardless of filter.
317
- - Output: per-candidate line `name last-ts (reason)` plus a final summary.
266
+ 行为:
267
+ - 过滤标志互斥否则报错。
268
+ - 默认为干运行(dry-run);`--yes` 切换为实际删除。
269
+ - 不指定 `--scope` 时,扫描**所有**项目桶(有意为之,用于仓库级清理);指定 `--scope project|global` 时仅限该桶。
270
+ - 有活跃 worker 的频道无论过滤条件如何始终跳过。
271
+ - 输出:逐条候选行 `name last-ts (reason)` 加上最终汇总。
318
272
 
319
273
  ---
320
274
 
321
- ## Forum Channels
275
+ ## Forum 频道
322
276
 
323
277
  ### `post <name> <action>`
324
278
 
325
279
  ```bash
326
280
  cviauto channel post <name> <action>
327
- --as <agent> # REQUIRED
281
+ --as <agent> # 必填
328
282
  [--scope project|global]
329
- [--thread <key>] # required except action=opened
283
+ [--thread <key>] # action=opened 外必填
330
284
  [--title <text>]
331
285
  [--text <text> | --stdin | --text-file <path>]
332
- [--description <text>] # stable thread description
286
+ [--description <text>] # 稳定的线程描述
333
287
  [--status <status>]
334
- [--labels a,b] # REPLACES thread labels
335
- [--assignees a,b] # REPLACES assignees
288
+ [--labels a,b] # 替换(REPLACE)线程标签
289
+ [--assignees a,b] # 替换(REPLACE)指派人
336
290
  [--summary <text>]
337
291
  [--context-file <abs-path>] ...
338
292
  [--context-raw <text>] ...
339
- [--linked-context-file <abs-path>] # [deprecated alias]
340
- [--linked-context-raw <text>] # [deprecated alias]
293
+ [--linked-context-file <abs-path>] # [已弃用的别名]
294
+ [--linked-context-raw <text>] # [已弃用的别名]
341
295
  ```
342
296
 
343
- Behavior:
344
- - `<action>` is free-form on the CLI surface; conventional values include
345
- `opened`, `comment`, `status`, `labels`, `assignees`, `summary`,
346
- `processed`.
347
- - `action=rename` is rejected — use `thread rename` instead.
348
- - `--labels` / `--assignees` are replace-semantics, not append.
349
- - Output: appended event JSON on stdout.
297
+ 行为:
298
+ - `<action>` CLI 层面是自由格式;常用值包括 `opened`、`comment`、`status`、`labels`、`assignees`、`summary`、`processed`。
299
+ - `action=rename` 会被拒绝 — 请改用 `thread rename`。
300
+ - `--labels` / `--assignees` 是替换语义,非追加。
301
+ - 输出:追加的事件 JSON stdout。
350
302
 
351
303
  ### `forum <name>`
352
304
 
@@ -357,9 +309,8 @@ cviauto channel forum <name>
357
309
  [--raw]
358
310
  ```
359
311
 
360
- Behavior:
361
- - Lists threads (reduced state). `--status` filters by current thread
362
- status. `--raw` prints one JSON per thread.
312
+ 行为:
313
+ - 列出线程(简化状态)。`--status` 按当前线程状态过滤。`--raw` 每条线程打印一行 JSON。
363
314
 
364
315
  ### `thread <name> <thread>` / `thread rename`
365
316
 
@@ -369,33 +320,31 @@ cviauto channel thread <name> <thread-key>
369
320
  [--raw]
370
321
 
371
322
  cviauto channel thread rename <name> <old-thread> <new-thread>
372
- --as <agent> # REQUIRED
323
+ --as <agent> # 必填
373
324
  [--scope project|global]
374
325
  ```
375
326
 
376
- Behavior:
377
- - `thread <name> <key>` shows one thread's timeline:
378
- header `<thread> [<status>] <title>`, then description / labels /
379
- assignees / summary / timeline lines. `--raw` switches to raw events.
380
- - `thread rename` is the only mutation; `post --action rename` is rejected.
327
+ 行为:
328
+ - `thread <name> <key>` 显示单条线程的时间线:头部 `<thread> [<status>] <title>`,然后是 description / labels / assignees / summary / timeline 行。`--raw` 切换为原始事件。
329
+ - `thread rename` 是唯一的变更操作;`post --action rename` 会被拒绝。
381
330
 
382
331
  ---
383
332
 
384
- ## Context / Title
333
+ ## 上下文 / 标题(Context / Title
385
334
 
386
335
  ### `context add` / `context delete` / `context list`
387
336
 
388
337
  ```bash
389
338
  cviauto channel context add <name>
390
- [--as <agent>] # default: main
339
+ [--as <agent>] # 默认:main
391
340
  [--scope project|global]
392
- [--thread <key>] # thread-level instead of channel-level
393
- [--file <abs-path>] ... # repeatable
394
- [--raw <text>] ... # repeatable
395
- # at least one of --file or --raw
341
+ [--thread <key>] # 线程级而非频道级
342
+ [--file <abs-path>] ... # 可重复
343
+ [--raw <text>] ... # 可重复
344
+ # --file --raw 至少指定其一
396
345
 
397
346
  cviauto channel context delete <name>
398
- [--as <agent>] # default: main
347
+ [--as <agent>] # 默认:main
399
348
  [--scope project|global]
400
349
  [--thread <key>]
401
350
  [--file <abs-path>] ...
@@ -404,77 +353,61 @@ cviauto channel context delete <name>
404
353
  cviauto channel context list <name>
405
354
  [--scope project|global]
406
355
  [--thread <key>]
407
- [--raw] # one JSON entry per line
356
+ [--raw] # 每行一条 JSON 条目
408
357
  ```
409
358
 
410
- Behavior:
411
- - `add` / `delete` append a `context` event and print the event JSON.
412
- - `list` projects current context entries; pretty output is
413
- `file <path>` / `raw <truncated text>` lines, `(no context)` when empty.
359
+ 行为:
360
+ - `add` / `delete` 追加一条 `context` 事件并打印事件 JSON
361
+ - `list` 投影当前上下文条目;美化输出为 `file <path>` / `raw <截断文本>` 行,为空时显示 `(no context)`。
414
362
 
415
363
  ### `title set <name>` / `title clear <name>`
416
364
 
417
365
  ```bash
418
366
  cviauto channel title set <name>
419
- --title <text> # REQUIRED
420
- [--as <agent>] # default: main
367
+ --title <text> # 必填
368
+ [--as <agent>] # 默认:main
421
369
  [--scope project|global]
422
370
 
423
371
  cviauto channel title clear <name>
424
- [--as <agent>] # default: main
372
+ [--as <agent>] # 默认:main
425
373
  [--scope project|global]
426
374
  ```
427
375
 
428
- Behavior:
429
- - Appends a `title` event projecting a stable display title onto the
430
- channel. Output: event JSON.
376
+ 行为:
377
+ - 追加一条 `title` 事件,将稳定的显示标题投影到频道上。输出:事件 JSON。
431
378
 
432
379
  ---
433
380
 
434
- ## Hidden / Internal
381
+ ## 隐藏 / 内部命令
435
382
 
436
- | Command | Purpose |
383
+ | 命令 | 用途 |
437
384
  |---|---|
438
- | `channel __supervisor <channel> <worker> <config>` | Forked entry point invoked by `spawn`. Do not invoke directly. |
439
- | `channel __parse-trace <adapter> <file>` | Dev helper replays a recorded stream-json / wire trace through the matching adapter and prints the resulting channel events. Adapter is validated against the provider registry. |
385
+ | `channel __supervisor <channel> <worker> <config>` | `spawn` 调用的 fork 入口点。请勿直接调用。 |
386
+ | `channel __parse-trace <adapter> <file>` | 开发辅助工具将记录的 stream-json / wire trace 通过匹配的适配器重放,并打印生成的频道事件。适配器按 provider 注册表进行校验。 |
440
387
 
441
388
  ---
442
389
 
443
- ## Event Model
390
+ ## 事件模型(Event Model
444
391
 
445
- `CHANNEL_EVENT_KINDS` (whitelist enforced by `parseChannelKind`):
392
+ `CHANNEL_EVENT_KINDS`(由 `parseChannelKind` 强制校验的白名单):
446
393
 
447
- `create`, `join`, `leave`, `message`, `thread`, `context`, `channel`,
448
- `spawned`, `killed`, `respawned`, `progress`, `done`, `error`, `waiting`,
449
- `awake`, `undeliverable`, `interrupt_requested`, `turn_started`,
450
- `turn_finished`, `interrupted`, `supervisor_warning`.
394
+ `create`、`join`、`leave`、`message`、`thread`、`context`、`channel`、`spawned`、`killed`、`respawned`、`progress`、`done`、`error`、`waiting`、`awake`、`undeliverable`、`interrupt_requested`、`turn_started`、`turn_finished`、`interrupted`、`supervisor_warning`。
451
395
 
452
- `MEANINGFUL_EVENT_KINDS` (default-visible subset used by `wait` /
453
- `messages` when no explicit `--kind` is given):
396
+ `MEANINGFUL_EVENT_KINDS`(`wait` / `messages` 未显式指定 `--kind` 时使用的默认可见子集):
454
397
 
455
- `create`, `join`, `leave`, `message`, `thread`, `context`, `channel`,
456
- `spawned`, `killed`, `respawned`, `done`, `error`.
398
+ `create`、`join`、`leave`、`message`、`thread`、`context`、`channel`、`spawned`、`killed`、`respawned`、`done`、`error`。
457
399
 
458
- Non-meaningful kinds (e.g. `progress`, `waiting`, `awake`,
459
- `supervisor_warning`, the `turn_*` / `interrupt*` set) still flow through
460
- the store; opt in via `--kind` or `--include-progress`.
400
+ 非有意义事件类型(non-meaningful kinds,如 `progress`、`waiting`、`awake`、`supervisor_warning`、`turn_*` / `interrupt*` 系列)仍会在存储中流转;通过 `--kind` 或 `--include-progress` 选择加入。
461
401
 
462
- Forum channels are event-sourced; use the CLI reducers
463
- (`forum`, `thread`, `context list`) for state projection.
402
+ Forum 频道采用事件溯源(event-sourced)模式;请使用 CLI reducer(`forum`、`thread`、`context list`)进行状态投影。
464
403
 
465
404
  ---
466
405
 
467
- ## Output Conventions
468
-
469
- - **Mutations** (`send`, `interrupt`, `post`, `context add/delete`,
470
- `title set/clear`, `thread rename`) print the appended event as one JSON
471
- line on **stdout**.
472
- - **Streaming reads** (`wait`, `messages --follow`) print one JSON event
473
- per line on stdout.
474
- - **Pretty reads** (`list`, `messages`, `forum`, `thread`, `context list`)
475
- print colored, padded tables / timelines.
476
- - **`run`** prints only the final assistant text on stdout (so callers can
477
- pipe); diagnostic notes go to stderr.
478
- - **Errors** go through `chalk.red("Error:")` to stderr and `exit 1`.
479
- - **`wait` timeout** specifically exits **124**.
406
+ ## 输出约定(Output Conventions
480
407
 
408
+ - **变更操作**(mutation:`send`、`interrupt`、`post`、`context add/delete`、`title set/clear`、`thread rename`)将追加的事件以单行 JSON 打印到 **stdout**。
409
+ - **流式读取**(`wait`、`messages --follow`)每行打印一个 JSON 事件到 stdout。
410
+ - **美化读取**(`list`、`messages`、`forum`、`thread`、`context list`)打印带颜色、对齐的表格 / 时间线。
411
+ - **`run`** 仅将最终的助手文本打印到 stdout(以便调用方管道连接);诊断信息发送到 stderr。
412
+ - **错误**通过 `chalk.red("Error:")` 输出到 stderr 并以 `exit 1` 退出。
413
+ - **`wait` 超时**特别以 **124** 退出。