carlos-flow 2.13.0 → 2.14.1

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/ghost.json CHANGED
@@ -3,590 +3,50 @@
3
3
  "minCindyVersion": "1.0.2",
4
4
  "id": "carlos-flow",
5
5
  "name": "Carlos 工作流",
6
- "description": "机械门禁 MCP:留痕/派发/裁定/审计/快照/免检/还原。自动管理 Bridge 后台常驻,首次调用 ~3-5s,后续 ~1s。",
7
- "whenToUse": "需要走 Carlos 工作流门禁时使用:留痕/派发/裁定/审计/快照/免检/还原",
8
- "version": "2.13.0",
9
- "kind": "mcp",
10
- "entry": "client/carlos.js",
6
+ "description": "机械门禁 MCP:留痕/派发/验证/负对照/双轴审查/裁定/审计/快照/免检/还原,共 20 个操作。Cindy 内通过 list_tools 翻目录、call_tool 执行(工具面两段式,避免详情被撑大)。",
7
+ "whenToUse": "需要走 Carlos 工作流门禁时使用:提交任务卡留痕、派发 executor/auditor 子 Agent、跑真实验证命令、证明测试有判别力(负对照)、记录裁定与双轴审计、查询审计流水、免检通道、一键还原计划。先用 list_tools 看类目,再用 call_tool 执行具体操作。",
8
+ "version": "2.14.1",
9
+ "kind": "chip",
10
+ "entry": "main.js",
11
11
  "command": "门禁",
12
12
  "node": {
13
- "entry": "__ROOT__/bridge/mcp-bridge.js",
14
- "protocol": "json-rpc-stdio",
13
+ "entry": "src/index.js",
14
+ "protocol": "mcp-stdio",
15
15
  "lifecycle": "on-demand",
16
16
  "idleTimeoutSeconds": 300
17
17
  },
18
18
  "settingsHtml": "settings.html",
19
19
  "tools": [
20
20
  {
21
- "name": "flow_mode",
22
- "description": "切换工作流模式:pro(专业)/ guide(向导)。",
21
+ "name": "list_tools",
22
+ "description": "列出 Carlos 门禁可用的操作。不传 category 返回类目概览(类目名、数量、该类目 RULES);传 category 返回该类目下全部操作的名称、说明、参数 schema,并在同一份结果里下发该类目 RULES(调用前必读,决定你先做哪一步)。共 20 个操作。",
23
23
  "parameters": {
24
24
  "type": "object",
25
25
  "properties": {
26
- "sessionId": {
27
- "type": "string"
28
- },
29
- "mode": {
30
- "type": "string",
31
- "enum": [
32
- "pro",
33
- "guide"
34
- ]
35
- },
36
- "reason": {
37
- "type": "string"
38
- }
39
- },
40
- "required": [
41
- "mode"
42
- ]
43
- }
44
- },
45
- {
46
- "name": "flow_protocol",
47
- "description": "读取 Carlos 工作流协议全文(路由档位 T0/T1/T2、四段合同、报告规格、错误分层、状态字段、审计事件类型、免检触发词、任务卡模板)。",
48
- "parameters": {
49
- "type": "object",
50
- "properties": {}
51
- }
52
- },
53
- {
54
- "name": "flow_submit_requirement",
55
- "description": "提交(留痕)一张任务卡,作为后续派发的唯一依据。任何 T2 改动前必须先调用本工具。",
56
- "parameters": {
57
- "type": "object",
58
- "properties": {
59
- "goal": {
60
- "type": "string",
61
- "description": "一句话目标(任务卡 objective)"
62
- },
63
- "quote": {
64
- "type": "string",
65
- "description": "用户原话摘录,用于锚点校验,必须能在用户消息中定位"
66
- },
67
- "scope": {
68
- "type": "array",
69
- "items": {
70
- "type": "string"
71
- },
72
- "description": "只准改动的文件清单(相对 cwd 的路径)"
73
- },
74
- "acceptance": {
75
- "type": "array",
76
- "items": {
77
- "type": "string"
78
- },
79
- "description": "可判定的验收标准"
80
- },
81
- "unknowns": {
82
- "type": "array",
83
- "items": {
84
- "type": "string"
85
- },
86
- "description": "未知/待澄清事项"
87
- },
88
- "assumptions": {
89
- "type": "array",
90
- "items": {
91
- "type": "string"
92
- },
93
- "description": "已做的假设"
94
- },
95
- "files": {
96
- "type": "array",
97
- "items": {
98
- "type": "object",
99
- "properties": {
100
- "path": {
101
- "type": "string"
102
- },
103
- "line": {
104
- "type": "number"
105
- }
106
- },
107
- "required": [
108
- "path",
109
- "line"
110
- ]
111
- },
112
- "description": "关键定位点"
113
- },
114
- "verify": {
115
- "type": "object",
116
- "properties": {
117
- "cmd": {
118
- "type": "string"
119
- }
120
- },
121
- "description": "主 Agent 指定的验证命令"
122
- },
123
- "confirmed": {
124
- "type": "boolean",
125
- "description": "敏感路径是否已获用户确认(sensitive 档必须为 true)"
126
- },
127
- "parallel_plan": {
128
- "type": "string",
129
- "description": "并行派发计划说明(可选)"
130
- },
131
- "sessionId": {
132
- "type": "string",
133
- "description": "会话 ID,默认 unknown"
134
- },
135
- "cwd": {
136
- "type": "string",
137
- "description": "工作目录,默认 process.cwd()"
138
- },
139
- "userMessages": {
140
- "type": "array",
141
- "items": {
142
- "type": "string"
143
- },
144
- "description": "用户原话列表(可选)"
145
- },
146
- "cardText": {
147
- "type": "string",
148
- "description": "完整任务卡文本,含 FLOW_CARD: 前缀"
149
- }
150
- },
151
- "required": [
152
- "goal",
153
- "quote",
154
- "scope"
155
- ]
156
- }
157
- },
158
- {
159
- "name": "flow_claim",
160
- "description": "领取一次派发名额(executor 或 auditor)。返回四段合同 prompt,可直接作为子 Agent 的任务描述。",
161
- "parameters": {
162
- "type": "object",
163
- "properties": {
164
- "sessionId": {
165
- "type": "string",
166
- "description": "会话 ID,默认 unknown"
167
- },
168
- "role": {
169
- "type": "string",
170
- "enum": [
171
- "executor",
172
- "auditor"
173
- ],
174
- "description": "领取角色"
175
- },
176
- "cwd": {
177
- "type": "string",
178
- "description": "工作目录,默认 process.cwd()"
179
- }
180
- },
181
- "required": [
182
- "sessionId",
183
- "role"
184
- ]
185
- }
186
- },
187
- {
188
- "name": "flow_dispatch",
189
- "description": "按四段合同派发子 Agent。派发前会自动对 scope 内文件做快照。",
190
- "parameters": {
191
- "type": "object",
192
- "properties": {
193
- "sessionId": {
194
- "type": "string",
195
- "description": "会话 ID,默认 unknown"
196
- },
197
- "role": {
198
- "type": "string",
199
- "enum": [
200
- "executor",
201
- "auditor"
202
- ],
203
- "description": "派发角色"
204
- },
205
- "message": {
206
- "type": "string",
207
- "description": "附加说明,原样附在合同末尾"
208
- },
209
- "run": {
210
- "type": "boolean",
211
- "description": "true = 由本工具直接运行 opencode;false/absent = 只返回 prompt"
212
- },
213
- "cwd": {
214
- "type": "string",
215
- "description": "工作目录,默认 process.cwd()"
216
- }
217
- },
218
- "required": [
219
- "sessionId",
220
- "role"
221
- ]
222
- }
223
- },
224
- {
225
- "name": "flow_audit_axes",
226
- "description": "派发两个并行审计 subagent(Standards 轴 / Spec 轴),生成两段审计合同 prompt。executor 改动通过 flow_run_verify 与负对照后、落 PASS 裁定前必须先调用本工具。",
227
- "parameters": {
228
- "type": "object",
229
- "properties": {
230
- "sessionId": {
231
- "type": "string",
232
- "description": "会话 ID"
233
- },
234
- "cwd": {
235
- "type": "string",
236
- "description": "仓库工作目录,默认 process.cwd()"
237
- }
238
- }
239
- }
240
- },
241
- {
242
- "name": "flow_audit_submit",
243
- "description": "保存某一审计轴(standards|spec)的结论与证据到会话状态。PASS 裁定前必须两轴都提交,且各自绑定的 card_ts 与当前卡一致。同轴可重复提交(后者覆盖)。",
244
- "parameters": {
245
- "type": "object",
246
- "properties": {
247
- "sessionId": {
248
- "type": "string",
249
- "description": "会话 ID"
250
- },
251
- "axis": {
252
- "type": "string",
253
- "enum": [
254
- "standards",
255
- "spec"
256
- ],
257
- "description": "审计轴"
258
- },
259
- "verdict": {
260
- "type": "string",
261
- "enum": [
262
- "PASS",
263
- "FAIL",
264
- "WARN"
265
- ],
266
- "description": "轴判定;WARN=坏味道等 judgement call,不硬拦"
267
- },
268
- "findings": {
269
- "type": "array",
270
- "items": {
271
- "type": "string"
272
- },
273
- "description": "每条含 file:line 或证据"
274
- },
275
- "evidence": {
276
- "type": "string",
277
- "description": "实跑命令输出 / diff 摘录"
278
- }
279
- }
280
- }
281
- },
282
- {
283
- "name": "flow_audit_guard",
284
- "description": "校验两轴是否已通过且证据齐全(与 flow_verdict 内的双轴门禁同口径)。主 Agent 落 PASS 前可主动自查;flow_verdict 不受此调用影响,仍会再拦一道。",
285
- "parameters": {
286
- "type": "object",
287
- "properties": {
288
- "sessionId": {
289
- "type": "string",
290
- "description": "会话 ID"
291
- }
292
- }
293
- }
294
- },
295
- {
296
- "name": "flow_verdict",
297
- "description": "记录 auditor 的裁定结果(PASS / DIRECTION / LOCAL)。只有 PASS 会把 completed_ok 置为 true。",
298
- "parameters": {
299
- "type": "object",
300
- "properties": {
301
- "sessionId": {
302
- "type": "string",
303
- "description": "会话 ID,默认 unknown"
304
- },
305
- "verdict": {
306
- "type": "string",
307
- "enum": [
308
- "PASS",
309
- "DIRECTION",
310
- "LOCAL"
311
- ],
312
- "description": "裁定结果"
313
- },
314
- "notes": {
315
- "type": "string",
316
- "description": "裁定说明/证据摘要"
317
- },
318
- "role": {
319
- "type": "string",
320
- "description": "记录裁定者角色(通常 auditor)"
321
- },
322
- "cwd": {
323
- "type": "string",
324
- "description": "工作目录,默认 process.cwd()"
325
- }
326
- },
327
- "required": [
328
- "sessionId",
329
- "verdict"
330
- ]
331
- }
332
- },
333
- {
334
- "name": "flow_status",
335
- "description": "查询当前会话的门禁状态:是否有任务卡、风险档、已派发次数/上限、裁定结果、是否过期、是否处于免检模式。",
336
- "parameters": {
337
- "type": "object",
338
- "properties": {
339
- "sessionId": {
340
- "type": "string",
341
- "description": "会话 ID,默认 unknown"
342
- }
343
- },
344
- "required": [
345
- "sessionId"
346
- ]
347
- }
348
- },
349
- {
350
- "name": "flow_audit",
351
- "description": "读取审计流水,返回事件列表与按 type/kind 的统计。",
352
- "parameters": {
353
- "type": "object",
354
- "properties": {
355
- "sessionId": {
356
- "type": "string",
357
- "description": "会话 ID;不传则聚合全部"
358
- },
359
- "type": {
360
- "type": "string",
361
- "description": "事件类型过滤:run / finding / decision / resolution"
362
- },
363
- "limit": {
364
- "type": "number",
365
- "description": "最多返回最近 N 条"
366
- },
367
- "date": {
368
- "type": "string",
369
- "description": "YYYY-MM-DD,默认今天"
370
- }
371
- }
372
- }
373
- },
374
- {
375
- "name": "flow_diff_hunks",
376
- "description": "对指定文件跑 git diff -U0 并解析出每个文件的 hunk 范围。",
377
- "parameters": {
378
- "type": "object",
379
- "properties": {
380
- "cwd": {
381
- "type": "string",
382
- "description": "仓库工作目录,默认 process.cwd()"
383
- },
384
- "paths": {
385
- "type": "array",
386
- "items": {
387
- "type": "string"
388
- },
389
- "description": "要检查的文件路径列表"
390
- }
391
- },
392
- "required": [
393
- "cwd"
394
- ]
395
- }
396
- },
397
- {
398
- "name": "flow_bypass",
399
- "description": "开关免检模式。仅在用户明确授权时使用。",
400
- "parameters": {
401
- "type": "object",
402
- "properties": {
403
- "sessionId": {
404
- "type": "string",
405
- "description": "会话 ID,默认 unknown"
406
- },
407
- "on": {
408
- "type": "boolean",
409
- "description": "true 开启免检,false 关闭"
410
- },
411
- "reason": {
412
- "type": "string",
413
- "description": "开启/关闭理由(建议写用户原话)"
414
- }
415
- },
416
- "required": [
417
- "sessionId",
418
- "on"
419
- ]
420
- }
421
- },
422
- {
423
- "name": "flow_add_user_msg",
424
- "description": "写入一条用户原话到会话消息文件,供 quote 锚点校验使用。",
425
- "parameters": {
426
- "type": "object",
427
- "properties": {
428
- "sessionId": {
429
- "type": "string",
430
- "description": "会话 ID,默认 unknown"
431
- },
432
- "text": {
433
- "type": "string",
434
- "description": "用户原话原文"
435
- }
436
- },
437
- "required": [
438
- "sessionId",
439
- "text"
440
- ]
441
- }
442
- },
443
- {
444
- "name": "flow_save_result",
445
- "description": "保存子 Agent 执行结果到会话目录。",
446
- "parameters": {
447
- "type": "object",
448
- "properties": {
449
- "sessionId": {
450
- "type": "string",
451
- "description": "会话 ID,默认 unknown"
452
- },
453
- "role": {
454
- "type": "string",
455
- "enum": [
456
- "executor",
457
- "auditor"
458
- ],
459
- "description": "执行角色"
460
- },
461
- "stdout": {
462
- "type": "string",
463
- "description": "子 Agent 的 stdout"
464
- },
465
- "stderr": {
466
- "type": "string",
467
- "description": "子 Agent 的 stderr"
468
- },
469
- "code": {
470
- "type": "number",
471
- "description": "退出码"
472
- }
473
- },
474
- "required": [
475
- "sessionId",
476
- "role"
477
- ]
478
- }
479
- },
480
- {
481
- "name": "flow_revert_plan",
482
- "description": "根据本次会话的快照 manifest 生成还原计划。只返回计划,不自动执行。",
483
- "parameters": {
484
- "type": "object",
485
- "properties": {
486
- "sessionId": {
487
- "type": "string",
488
- "description": "会话 ID,默认 unknown"
489
- },
490
- "cwd": {
491
- "type": "string",
492
- "description": "工作目录,默认 process.cwd()"
493
- }
494
- },
495
- "required": [
496
- "sessionId"
497
- ]
498
- }
499
- },
500
- {
501
- "name": "flow_run_verify",
502
- "description": "执行卡片中指定的验证命令,返回执行结果(退出码、stdout、stderr)。用于在派发 executor 后验证其工作成果,或手动触发验证。记 PASS 裁定前必须先跑通本工具。",
503
- "parameters": {
504
- "type": "object",
505
- "properties": {
506
- "sessionId": {
26
+ "category": {
507
27
  "type": "string",
508
- "description": "会话 ID,默认 unknown"
509
- },
510
- "cwd": {
511
- "type": "string",
512
- "description": "工作目录,默认 process.cwd()"
28
+ "description": "类目名,来自概览(gate / verify / audit / infra / trigger)"
513
29
  }
514
30
  }
515
31
  }
516
32
  },
517
33
  {
518
- "name": "flow_falsify",
519
- "description": "负对照(negative control):把工作区还原到派发时的「改动前」状态跑同一 verify.cmd,要求它失败;再还原「改动后」状态跑一次,要求它通过。只有「改动前失败 + 改动后通过」才证明这个测试真的在测本次改动(而不是 `|| true` / `echo ok` 这类空测试)。记 PASS 裁定前必须先做负对照。",
34
+ "name": "call_tool",
35
+ "description": "执行一个具体的 Carlos 门禁操作。name 来自 list_tools 的返回(20 个 flow_* 操作之一);args 按该操作的参数说明传 JSON 对象。收到不认识的 name 会附全部可用操作名;args 不合法或缺必填项时会附该操作的参数 schema 与类目 RULES,照着自纠即可。",
520
36
  "parameters": {
521
37
  "type": "object",
522
38
  "properties": {
523
- "sessionId": {
39
+ "name": {
524
40
  "type": "string",
525
- "description": "会话 ID,默认 unknown"
41
+ "description": "操作名,来自 list_tools(category) 返回的 tools[].name"
526
42
  },
527
- "cwd": {
528
- "type": "string",
529
- "description": "工作目录,默认 process.cwd()"
530
- }
531
- }
532
- }
533
- },
534
- {
535
- "name": "flow_check_scope",
536
- "description": "检查指定文件列表是否在卡片 scope 范围内。用于在提交裁定前自查越界改动。空 scope 判定为全部越界(fail-closed)。",
537
- "parameters": {
538
- "type": "object",
539
- "properties": {
540
- "sessionId": {
541
- "type": "string",
542
- "description": "会话 ID,默认 unknown"
543
- },
544
- "paths": {
545
- "type": "array",
546
- "items": {
547
- "type": "string"
548
- },
549
- "description": "要检查的文件路径列表"
550
- },
551
- "cwd": {
552
- "type": "string",
553
- "description": "仓库工作目录,默认 process.cwd()"
554
- }
555
- },
556
- "required": [
557
- "sessionId"
558
- ]
559
- }
560
- },
561
- {
562
- "name": "flow_trigger_check",
563
- "description": "智能触发检查:判断当前这条用户消息是否应该启动 Carlos 工作流,并在达标时实际完成激活(写入用户原话 + 开占位卡 → 会话进入门禁态)。宿主在收到用户消息时调用本工具,就能获得与命令行客户端完全一致的自动触发行为。未达阈值时只如实返回评分与决策,不做任何动作;被限流时也如实返回真实评分。中文流程词(工作流/门禁/派发/审计…)已内置,中文需求同样能触发。",
564
- "parameters": {
565
- "type": "object",
566
- "properties": {
567
- "sessionId": {
568
- "type": "string",
569
- "description": "会话 ID,默认 unknown"
570
- },
571
- "message": {
572
- "type": "string",
573
- "description": "用户本轮消息原文(必须是真实原话,用于 quote 锚点)"
574
- },
575
- "complexity": {
576
- "type": "number",
577
- "description": "任务复杂度系数,默认 1.0"
578
- },
579
- "execute": {
580
- "type": "boolean",
581
- "description": "true = 达标时实际执行激活步骤(默认 true);false = 只评分不动作"
582
- },
583
- "cwd": {
584
- "type": "string",
585
- "description": "工作目录,默认 process.cwd()"
43
+ "args": {
44
+ "type": "object",
45
+ "description": "操作参数,不确定时可传 {} 触发错误反馈拿参数说明"
586
46
  }
587
47
  },
588
48
  "required": [
589
- "message"
49
+ "name"
590
50
  ]
591
51
  }
592
52
  }