@jennie-shawn/starwork 0.1.0-alpha.22 → 0.1.0-alpha.23

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/cli/src/cli.js CHANGED
@@ -146,6 +146,7 @@ const MANUAL_HANDOFF_STATUS = "manual_handoff_required";
146
146
  const HOST_DELIVERY_STATUSES = new Set([
147
147
  "delivered",
148
148
  "delivered_via_codex_thread_tool",
149
+ "delivered_via_claude_code_session_tool",
149
150
  "recorded_only",
150
151
  MANUAL_HANDOFF_STATUS,
151
152
  "failed"
@@ -10270,7 +10271,7 @@ Options:
10270
10271
  --from <lane-id>
10271
10272
  --to <lane-id>
10272
10273
  --message <text>
10273
- --host-delivery <delivered_via_codex_thread_tool|recorded_only|manual_handoff_required|failed>
10274
+ --host-delivery <delivered_via_codex_thread_tool|delivered_via_claude_code_session_tool|recorded_only|manual_handoff_required|failed>
10274
10275
  --delivery-tool <tool-name>
10275
10276
  --id <request-id>
10276
10277
  --json
@@ -286,6 +286,9 @@ test("starworkMultiagent skill uses Codex standard session tools directly", () =
286
286
  assert.match(skill, /multiagent share/);
287
287
  assert.match(skill, /multiagent request record/);
288
288
  assert.match(skill, /delivered_via_codex_thread_tool/);
289
+ assert.match(skill, /delivered_via_claude_code_session_tool/);
290
+ assert.match(skill, /mcp__ccd_session_mgmt__send_message/);
291
+ assert.match(skill, /mcp__ccd_session_mgmt__search_session_transcripts/);
289
292
  assert.match(skill, /STARWORK:MULTIAGENT_MESSAGE v1/);
290
293
  assert.match(skill, /manual_handoff_required/);
291
294
  assert.match(skill, /pending_merge/);
@@ -1881,6 +1884,36 @@ test("multiagent request record supports Codex thread-tool delivery status", ()
1881
1884
  assert.equal(state.requests[0].host_delivery.delivery_tool, "send_message_to_thread");
1882
1885
  });
1883
1886
 
1887
+ test("multiagent request record supports Claude Code Desktop session-tool delivery status", () => {
1888
+ const dir = tempDir();
1889
+ runInit(["--type", "single-light", "--pack", "general", "--target", dir, "--yes"]);
1890
+ runCommand(["multiagent", "init", "--target", dir, "--yes"]);
1891
+ runCommand(["multiagent", "add", "product-planning", "--purpose", "产品规划", "--write", "product/planning/**", "--target", dir, "--yes"]);
1892
+ runCommand(["multiagent", "add", "development", "--purpose", "功能开发", "--write", "product/cli/**", "--target", dir, "--yes"]);
1893
+
1894
+ const record = runCommand([
1895
+ "multiagent", "request", "record",
1896
+ "--from", "product-planning",
1897
+ "--to", "development",
1898
+ "--message", "请开始实现 Claude Code Desktop 投递。",
1899
+ "--host-delivery", "delivered_via_claude_code_session_tool",
1900
+ "--delivery-tool", "ccd_session_mgmt_send_message",
1901
+ "--target", dir,
1902
+ "--json",
1903
+ "--yes"
1904
+ ]);
1905
+ const recordResult = JSON.parse(record.stdout);
1906
+ const shared = fs.readFileSync(path.join(dir, "_系统", "协作", "shared.md"), "utf8");
1907
+ const state = readJson(path.join(dir, ".starwork", "agent-lanes", "state.json"));
1908
+
1909
+ assert.equal(record.status, 0);
1910
+ assert.equal(recordResult.host_delivery.status, "delivered_via_claude_code_session_tool");
1911
+ assert.equal(recordResult.host_delivery.delivery_tool, "ccd_session_mgmt_send_message");
1912
+ assert.match(shared, /product-planning \| development \| 请开始实现 Claude Code Desktop 投递。 \| delivered_via_claude_code_session_tool \| delivered_via_claude_code_session_tool/);
1913
+ assert.equal(state.requests[0].host_delivery.status, "delivered_via_claude_code_session_tool");
1914
+ assert.equal(state.requests[0].host_delivery.delivery_tool, "ccd_session_mgmt_send_message");
1915
+ });
1916
+
1884
1917
  test("multiagent request record accepts recorded-only Codex boundary status", () => {
1885
1918
  const dir = tempDir();
1886
1919
  runInit(["--type", "single-light", "--pack", "general", "--target", dir, "--yes"]);
@@ -7,7 +7,8 @@
7
7
  | 宿主软件 | 识别当前会话 | 自动命名会话 | 自动列出会话 | 自动读取历史 | 自动向其他会话发指令 | 自动归档会话 | 自动置顶会话 |
8
8
  | --- | --- | --- | --- | --- | --- | --- | --- |
9
9
  | Codex App / Desktop | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
10
- | Claude Code | 支持 | 不支持 | 不支持 | 支持 | 不支持 | 不支持 | 不支持 |
10
+ | Claude Code Desktop | 支持 | 不支持 | 支持 | 支持 | 支持¹ | 支持¹ | 不支持 |
11
+ | Claude Code CLI | 支持 | 不支持 | 不支持 | 支持 | 不支持 | 不支持 | 不支持 |
11
12
  | Cursor | 不支持 | 支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 |
12
13
  | Trae IDE | 支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 |
13
14
  | Trae Solo App | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 |
@@ -18,3 +19,5 @@
18
19
  | --- | --- |
19
20
  | 支持 | StarWork 可以让工具自动完成,不需要用户手动去宿主软件里操作 |
20
21
  | 不支持 | StarWork 不能自动完成,需要用户自己在宿主软件里手动操作 |
22
+
23
+ 注¹:Claude Code 桌面端的「发送指令」和「归档」由标准会话工具自动完成,但每次会弹出用户确认,且仅在有人值守(非 auto / bypass)会话可用。这是权限闸门,不是让用户去宿主软件里手动操作,仍记为「支持」。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jennie-shawn/starwork",
3
- "version": "0.1.0-alpha.22",
3
+ "version": "0.1.0-alpha.23",
4
4
  "description": "StarWork Core、CLI、Packs 和 Agent skills,用于构建 AI 工作台。",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -210,6 +210,35 @@ starwork doctor --target <path> --json
210
210
 
211
211
  如果这些工具没有出现在当前可用工具列表里,先用工具发现能力查找。仍不可见或调用失败时,不要宣称已创建、已发送或已改名;输出 `manual_handoff_required`,并展示完整可复制的 `STARWORK:MULTIAGENT_MESSAGE`。
212
212
 
213
+ ## 宿主路由
214
+
215
+ 任何依赖宿主能力的动作(发送、读取、列出、创建、改名、置顶、归档)执行前,先确定**目标会话**属于哪个宿主,再选对应工具表:
216
+
217
+ - 从目标 lane 的 `current_session` 前缀判断宿主:`codex:<id>` → Codex(用上面的「Codex 标准工具」);`claude-code:<id>` → Claude Code 桌面端(用下面的「Claude Code Desktop 标准工具」)。
218
+ - 选定工具后,**调用前先确认该工具此刻出现在你的可用工具列表里**(必要时用工具发现能力查找)。前缀只说明目标会话属于哪个宿主,不代表你当前环境一定能调用它。
219
+ - 如果你当前不在该宿主里、或对应工具不可见,**不要调用另一个宿主的工具,也不要假装已自动完成**:改为输出 `manual_handoff_required`,展示完整可复制 `STARWORK:MULTIAGENT_MESSAGE`,并说明尚未自动送达。
220
+ - 某宿主某场景在工具表里标注「无」时,同样走人工 handoff,不要用别的能力凑。
221
+
222
+ ## Claude Code Desktop 标准工具
223
+
224
+ 目标会话是 `claude-code:<id>` 且你正运行在 Claude Code 桌面端时,以下动作由 Skill 直接调用标准工具:
225
+
226
+ | 场景 | 标准工具 | 注意 |
227
+ |---|---|---|
228
+ | 向 lane 会话发送指令 | `mcp__ccd_session_mgmt__send_message` | 参数是 `(session_id, message)`,不是 Codex 的 `(threadId, prompt)`;会弹用户确认;仅在有人值守会话可用;`session_id` 不能是当前会话 |
229
+ | 搜索或确认历史会话 | `mcp__ccd_session_mgmt__list_sessions` / `mcp__ccd_session_mgmt__search_session_transcripts` | 只读 |
230
+ | 读取 lane 会话状态 | `mcp__ccd_session_mgmt__search_session_transcripts` | 宿主观察,不替代 lane worklog |
231
+ | 归档会话 | `mcp__ccd_session_mgmt__archive_session` | 会弹用户确认 |
232
+ | 创建 lane 会话 / 设置标题 / 置顶 | 无对应标准工具 | 走人工 handoff:请用户在 Claude Code 里手动新建或改名会话,拿到 session id 后再用 `multiagent bind` 记录 |
233
+
234
+ 发送成功后,用 CLI 记录真实投递状态:
235
+
236
+ ```bash
237
+ starwork multiagent request record --from <from-lane> --to <to-lane> --message "<text>" --host-delivery delivered_via_claude_code_session_tool --delivery-tool ccd_session_mgmt_send_message --target <path> --yes
238
+ ```
239
+
240
+ 成功时可以说“已投递到目标会话,并已记录到 StarWork”,不要说“目标任务已完成”。工具不可见、用户拒绝确认或调用失败时,输出 `manual_handoff_required`,展示完整 Instruction Message,并说明尚未自动送达;不得改用 CLI 模拟自动投递。
241
+
213
242
  ## 判断用户意图
214
243
 
215
244
  优先把用户话语归到一个入口,不要一开始讲 CLI 子命令。
@@ -374,7 +403,9 @@ starwork multiagent release <lane> --target <path> --yes
374
403
 
375
404
  ## 非 Codex 宿主
376
405
 
377
- Cursor、Trae、Claude Code 的策略按各自 Host Adapter 文档执行。在没有等价标准会话工具前,不要宣称可以自动创建、发送、改名、置顶或归档;使用人工 handoff 或只读 transcript 摘要。
406
+ Claude Code 桌面端的标准工具见上文「宿主路由」与「Claude Code Desktop 标准工具」:发送、列出、读取、归档可由 Skill 直接调用;创建、改名、置顶无标准工具,走人工 handoff。
407
+
408
+ Cursor、Trae 以及 Claude Code 终端 CLI 在没有等价标准会话工具前,不要宣称可以自动创建、发送、改名、置顶或归档;使用人工 handoff 或只读 transcript 摘要。具体策略按各自 Host Adapter 文档执行。
378
409
 
379
410
  ## Lane Workspace 与正式输出
380
411