openclaw-sc 5.38.0

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 (48) hide show
  1. package/.env.example +13 -0
  2. package/INSTALL.md +13 -0
  3. package/LICENSE +233 -0
  4. package/README.md +123 -0
  5. package/SECURITY.md +27 -0
  6. package/index.js +3479 -0
  7. package/lib/code-review-shared.js +164 -0
  8. package/lib/config.js +164 -0
  9. package/lib/constants.js +438 -0
  10. package/lib/decomposer.js +896 -0
  11. package/lib/dialog-recall.js +389 -0
  12. package/lib/env.js +59 -0
  13. package/lib/level-rules.js +72 -0
  14. package/lib/log-manager.js +258 -0
  15. package/lib/preemption.js +278 -0
  16. package/lib/priority-calc.js +134 -0
  17. package/lib/prompt-injection.js +748 -0
  18. package/lib/route-evidence.js +701 -0
  19. package/lib/shared-fs.js +244 -0
  20. package/lib/steward-rules.js +648 -0
  21. package/lib/task-center.js +602 -0
  22. package/lib/task-chain.js +713 -0
  23. package/lib/task-checker.js +317 -0
  24. package/lib/task-profiles.js +255 -0
  25. package/lib/tcell.js +411 -0
  26. package/lib/tool-auto-discover.js +522 -0
  27. package/lib/tool-enrich-subagent.js +375 -0
  28. package/lib/tool-handlers.js +178 -0
  29. package/lib/tool-selector.js +459 -0
  30. package/openclaw.plugin.json +55 -0
  31. package/package.json +63 -0
  32. package/security.js +141 -0
  33. package/tools/bridge.js +3288 -0
  34. package/tools/dashboard/tk-dashboard.py +262 -0
  35. package/tools/hippocampus-multi-search.js +1038 -0
  36. package/tools/hippocampus-sqlite.js +738 -0
  37. package/tools/hippocampus-store.js +262 -0
  38. package/tools/mcp-tools.config.json +653 -0
  39. package/tools/pipeline-engine.js +667 -0
  40. package/tools/sidecar/_check_tools.py +34 -0
  41. package/tools/sidecar/sidecar-server.cjs +1360 -0
  42. package/tools/sidecar/subagent-runner.cjs +1471 -0
  43. package/tools/system-tools.js +619 -0
  44. package/vector/README.md +100 -0
  45. package/vector/usearch-bridge.js +639 -0
  46. package/vector/usearch-http.js +74 -0
  47. package/vector/usearch-serve.js +156 -0
  48. package/workers/worker.js +1419 -0
@@ -0,0 +1,653 @@
1
+ {
2
+ "version": "1",
3
+ "description": "sc MCP tools 统一配置 — v5.38.0,14个工具",
4
+ "apiKeys": {
5
+ "deepseek": "",
6
+ "tavily": ""
7
+ },
8
+ "search": {
9
+ "backends": [
10
+ "tavily",
11
+ "ddg",
12
+ "direct_http"
13
+ ],
14
+ "tavily": {
15
+ "apiKeyEnv": "TAVILY_API_KEY",
16
+ "timeout": 30000,
17
+ "maxRetries": 1,
18
+ "searchDepth": "advanced"
19
+ },
20
+ "ddg": {
21
+ "baseUrl": "https://api.duckduckgo.com",
22
+ "htmlBaseUrl": "https://html.duckduckgo.com/html/",
23
+ "timeout": 30000
24
+ },
25
+ "searxng": {
26
+ "baseUrl": "",
27
+ "timeout": 30000
28
+ },
29
+ "direct_http": {
30
+ "timeout": 30000,
31
+ "maxContentLength": 50000,
32
+ "searchUrl": "https://www.bing.com/search",
33
+ "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) OpenClaw-sc-webSearch/1.0 Safari/537.36"
34
+ }
35
+ },
36
+ "main": {
37
+ "deny": [
38
+ "validate"
39
+ ]
40
+ },
41
+ "tools": [
42
+ {
43
+ "name": "stats",
44
+ "description": "Worker池状态快照(无参数)——查看Worker池活跃数、排队数、任务统计等",
45
+ "inputSchema": {
46
+ "type": "object",
47
+ "properties": {},
48
+ "additionalProperties": false
49
+ }
50
+ },
51
+ {
52
+ "name": "memorySearch",
53
+ "description": "搜记忆。推荐action='smart'自动判断。可选:search_dialog(时间/关键词)|semantic_search(语义)|memory_query(全量)|lcm_recall(压缩)",
54
+ "inputSchema": {
55
+ "type": "object",
56
+ "required": [
57
+ "action"
58
+ ],
59
+ "properties": {
60
+ "action": {
61
+ "type": "string",
62
+ "enum": [
63
+ "smart",
64
+ "search_dialog",
65
+ "semantic_search",
66
+ "memory_query",
67
+ "lcm_recall"
68
+ ]
69
+ },
70
+ "query": {
71
+ "type": "string"
72
+ },
73
+ "maxResults": {
74
+ "type": "number"
75
+ }
76
+ },
77
+ "additionalProperties": false
78
+ }
79
+ },
80
+ {
81
+ "name": "webSearch",
82
+ "description": "搜网页(action=web_search搜索|web_fetch抓取网页内容)",
83
+ "inputSchema": {
84
+ "type": "object",
85
+ "required": [
86
+ "action"
87
+ ],
88
+ "properties": {
89
+ "action": {
90
+ "type": "string",
91
+ "enum": [
92
+ "web_search",
93
+ "web_fetch"
94
+ ]
95
+ },
96
+ "query": {
97
+ "type": "string",
98
+ "description": "搜索关键词"
99
+ },
100
+ "url": {
101
+ "type": "string",
102
+ "description": "要提取的网页URL"
103
+ },
104
+ "maxResults": {
105
+ "type": "number",
106
+ "description": "搜索结果数量(默认5)"
107
+ }
108
+ },
109
+ "additionalProperties": false
110
+ }
111
+ },
112
+ {
113
+ "name": "glob",
114
+ "description": "文件 glob 模式匹配(pattern=必填, path=可选)。如 '**/*.js' 递归找所有JS文件,'*.md' 找根目录MD文件。结果按修改时间降序",
115
+ "inputSchema": {
116
+ "type": "object",
117
+ "required": [
118
+ "pattern"
119
+ ],
120
+ "properties": {
121
+ "pattern": {
122
+ "type": "string",
123
+ "description": "glob 模式(必填),如 '**/*.js'、'*.{json,md}'、'plugins/*/SKILL.md'"
124
+ },
125
+ "path": {
126
+ "type": "string",
127
+ "description": "搜索根目录,默认 workspace"
128
+ }
129
+ },
130
+ "additionalProperties": false
131
+ }
132
+ },
133
+ {
134
+ "name": "grep",
135
+ "description": "ripgrep 高速代码搜索(pattern=正则必填, path/glob/outputMode/ignoreCase/multiline/context/headLimit可选)。outputMode: content(带行号)/files_with_matches(仅文件名)/count(文件+计数)",
136
+ "inputSchema": {
137
+ "type": "object",
138
+ "required": [
139
+ "pattern"
140
+ ],
141
+ "properties": {
142
+ "pattern": {
143
+ "type": "string",
144
+ "description": "正则搜索模式(必填),如 'function\\\\s+\\\\w+'"
145
+ },
146
+ "path": {
147
+ "type": "string",
148
+ "description": "搜索路径,默认 workspace"
149
+ },
150
+ "glob": {
151
+ "type": "string",
152
+ "description": "文件筛选 glob,如 '*.js'、'*.{json,md}'"
153
+ },
154
+ "outputMode": {
155
+ "type": "string",
156
+ "enum": [
157
+ "content",
158
+ "files_with_matches",
159
+ "count"
160
+ ],
161
+ "description": "content(带行号)/files_with_matches(仅路径)/count(计数)"
162
+ },
163
+ "ignoreCase": {
164
+ "type": "boolean",
165
+ "description": "忽略大小写"
166
+ },
167
+ "multiline": {
168
+ "type": "boolean",
169
+ "description": "多行模式,可跨行匹配"
170
+ },
171
+ "context": {
172
+ "type": "number",
173
+ "description": "显示匹配行前后各N行"
174
+ },
175
+ "headLimit": {
176
+ "type": "number",
177
+ "description": "输出上限(默认250,0=不限)"
178
+ }
179
+ },
180
+ "additionalProperties": false
181
+ }
182
+ },
183
+ {
184
+ "name": "codeEditor",
185
+ "description": "编辑/审查代码(action=edit_code/review_code)——先用review_code读文件内容,再用edit_code(edits=[{oldText,newText}])精准替换,不改整文件。子Agent改完代码必须调validate验证",
186
+ "inputSchema": {
187
+ "type": "object",
188
+ "required": [
189
+ "action"
190
+ ],
191
+ "properties": {
192
+ "action": {
193
+ "type": "string",
194
+ "enum": [
195
+ "edit_code",
196
+ "review_code"
197
+ ]
198
+ },
199
+ "path": {
200
+ "type": "string",
201
+ "description": "文件路径"
202
+ },
203
+ "edits": {
204
+ "type": "array",
205
+ "items": {
206
+ "type": "object",
207
+ "required": [
208
+ "oldText",
209
+ "newText"
210
+ ],
211
+ "properties": {
212
+ "oldText": {
213
+ "type": "string",
214
+ "description": "被替换的原文(必须精确匹配)"
215
+ },
216
+ "newText": {
217
+ "type": "string",
218
+ "description": "替换后的新文"
219
+ }
220
+ }
221
+ },
222
+ "description": "精确替换对数组 [{oldText, newText}]"
223
+ }
224
+ },
225
+ "additionalProperties": false
226
+ }
227
+ },
228
+ {
229
+ "name": "batchVision",
230
+ "description": "看图(传files数组读取指定图;传[\"latest\"]或[\"current\"]自动读最新一张;不传files默认读最新一张;串行处理不炸GPU)",
231
+ "inputSchema": {
232
+ "type": "object",
233
+ "required": [],
234
+ "properties": {
235
+ "files": {
236
+ "type": "array",
237
+ "items": {
238
+ "type": "string"
239
+ },
240
+ "description": "图片文件名/路径数组。传\"latest\"或\"current\"自动取最新一张;传文件名自动去media/inbound/目录找;传完整路径直接读;不传默认取最新一张"
241
+ },
242
+ "prompt": {
243
+ "type": "string",
244
+ "description": "可选,分析提示词"
245
+ },
246
+ "model": {
247
+ "type": "string",
248
+ "description": "可选,视觉模型名,默认从openclaw.json读取"
249
+ }
250
+ },
251
+ "additionalProperties": false
252
+ }
253
+ },
254
+ {
255
+ "name": "emergencyStop",
256
+ "description": "⛔ 高危熔断!除非用户明确说'紧急停止',绝不调用!status也会触发停止(BUG)勿用它查状态。日常用stats。(action=stop_all/kill_subagents/status)",
257
+ "inputSchema": {
258
+ "type": "object",
259
+ "required": [
260
+ "action"
261
+ ],
262
+ "properties": {
263
+ "action": {
264
+ "type": "string",
265
+ "enum": [
266
+ "stop_all",
267
+ "kill_subagents",
268
+ "status"
269
+ ]
270
+ }
271
+ },
272
+ "additionalProperties": false
273
+ }
274
+ },
275
+ {
276
+ "name": "fileManager",
277
+ "description": "文件操作(action=read读|write写|list列目录|copy复制|move移动,无delete权限)。copy/move 使用 dest 作为目的路径,target 仅为兼容别名。⚠️ write仅允许workspace目录(安全限制),子Agent不可删除文件",
278
+ "inputSchema": {
279
+ "type": "object",
280
+ "required": [
281
+ "action",
282
+ "path"
283
+ ],
284
+ "properties": {
285
+ "action": {
286
+ "type": "string",
287
+ "enum": [
288
+ "read",
289
+ "write",
290
+ "list",
291
+ "copy",
292
+ "move"
293
+ ]
294
+ },
295
+ "path": {
296
+ "type": "string"
297
+ },
298
+ "content": {
299
+ "type": "string"
300
+ },
301
+ "dest": {
302
+ "type": "string",
303
+ "description": "copy/move 的目的路径;新 TaskCard 优先使用 dest"
304
+ },
305
+ "target": {
306
+ "type": "string",
307
+ "description": "copy/move 的 deprecated 兼容别名;新 TaskCard 使用 dest"
308
+ }
309
+ },
310
+ "additionalProperties": false
311
+ }
312
+ },
313
+ {
314
+ "name": "spawnWorker",
315
+ "description": "Worker池(action=search|analyze|semantic|diff|stats,keyword/query/files/path参数)",
316
+ "inputSchema": {
317
+ "type": "object",
318
+ "required": [
319
+ "action"
320
+ ],
321
+ "properties": {
322
+ "action": {
323
+ "type": "string",
324
+ "enum": [
325
+ "search",
326
+ "analyze",
327
+ "semantic",
328
+ "diff",
329
+ "stats"
330
+ ]
331
+ },
332
+ "keyword": {
333
+ "type": "string"
334
+ },
335
+ "files": {
336
+ "type": "array",
337
+ "items": {
338
+ "type": "string"
339
+ }
340
+ },
341
+ "path": {
342
+ "type": "string",
343
+ "description": "搜索目录路径,不传则用 files 列表"
344
+ },
345
+ "query": {
346
+ "type": "string"
347
+ },
348
+ "maxResults": {
349
+ "type": "number"
350
+ }
351
+ },
352
+ "additionalProperties": false
353
+ }
354
+ },
355
+ {
356
+ "name": "spawnAgent",
357
+ "description": "派单路子Agent(prompt必填,model默认deepseek-v4-flash,timeout默认600秒,maxRounds默认100轮)。当前 bridge 不实现 count fan-out;多路同任务请用 taskPipeline 展开多个 group。⚠️ 子Agent不可用此工具(防递归blocked),不可派兵",
358
+ "inputSchema": {
359
+ "type": "object",
360
+ "required": [
361
+ "prompt"
362
+ ],
363
+ "properties": {
364
+ "prompt": {
365
+ "type": "string"
366
+ },
367
+ "model": {
368
+ "type": "string"
369
+ },
370
+ "timeout": {
371
+ "type": "number"
372
+ },
373
+ "maxRounds": {
374
+ "type": "number"
375
+ },
376
+ "taskName": {
377
+ "type": "string"
378
+ },
379
+ "batchName": {
380
+ "type": "string"
381
+ },
382
+ "groupName": {
383
+ "type": "string"
384
+ },
385
+ "runId": {
386
+ "type": "string"
387
+ },
388
+ "runDir": {
389
+ "type": "string"
390
+ },
391
+ "taskCard": {
392
+ "type": "object",
393
+ "additionalProperties": true
394
+ },
395
+ "collector": {
396
+ "type": "object",
397
+ "additionalProperties": true
398
+ },
399
+ "budgets": {
400
+ "type": "object",
401
+ "additionalProperties": true
402
+ },
403
+ "acceptance": {
404
+ "type": "object",
405
+ "additionalProperties": true
406
+ },
407
+ "evidence": {
408
+ "type": "object",
409
+ "additionalProperties": true
410
+ },
411
+ "toolPolicy": {
412
+ "type": "object",
413
+ "additionalProperties": true
414
+ },
415
+ "tool_policy": {
416
+ "type": "object",
417
+ "additionalProperties": true
418
+ },
419
+ "notifyPolicy": {
420
+ "type": "string"
421
+ },
422
+ "raw_output_policy": {
423
+ "type": "string",
424
+ "enum": [
425
+ "no_full_dump"
426
+ ]
427
+ }
428
+ },
429
+ "additionalProperties": false
430
+ }
431
+ },
432
+ {
433
+ "name": "taskPipeline",
434
+ "description": "树状多层派兵编排:一次调用=派多路不同任务AI兵。groups传[{name,prompt,model?,timeout?,maxRounds?}], maxWait=等待超时(ms,默认0=无限等且只停止等待不杀兵)。groups>10默认stagger分批(每批10路×20ms间隔);stagger或maxWait<=500会fire-and-return。runId/runDir/collector属于TaskCard和EvidenceBundle回收纪律,不是当前runtime输入字段",
435
+ "inputSchema": {
436
+ "type": "object",
437
+ "required": [
438
+ "groups"
439
+ ],
440
+ "properties": {
441
+ "batchName": {
442
+ "type": "string",
443
+ "description": "战役名称"
444
+ },
445
+ "groups": {
446
+ "type": "array",
447
+ "items": {
448
+ "type": "object",
449
+ "required": [
450
+ "name",
451
+ "prompt"
452
+ ],
453
+ "properties": {
454
+ "name": {
455
+ "type": "string",
456
+ "description": "兵名称"
457
+ },
458
+ "prompt": {
459
+ "type": "string",
460
+ "description": "兵的任务指令"
461
+ },
462
+ "model": {
463
+ "type": "string",
464
+ "description": "模型(默认deepseek-v4-flash)"
465
+ },
466
+ "timeout": {
467
+ "type": "number",
468
+ "description": "超时秒数(默认600)"
469
+ },
470
+ "maxRounds": {
471
+ "type": "number",
472
+ "description": "最大工具轮次(默认100)"
473
+ },
474
+ "toolPolicy": {
475
+ "type": "object",
476
+ "additionalProperties": true
477
+ },
478
+ "tool_policy": {
479
+ "type": "object",
480
+ "additionalProperties": true
481
+ }
482
+ }
483
+ },
484
+ "description": "兵的任务列表,每路兵一个独立prompt;多路同任务需显式展开多个group"
485
+ },
486
+ "maxWait": {
487
+ "type": "number",
488
+ "description": "最大等待毫秒数(默认0=无限等)。超时仅停止等待,不杀兵;maxWait<=500会派完即回"
489
+ },
490
+ "staggerMs": {
491
+ "type": "number",
492
+ "description": "分批间隔毫秒(groups>10时默认20ms。staggerMs>0会派完即回,必须另行collector/DONE回收)"
493
+ },
494
+ "staggerBatchSize": {
495
+ "type": "number",
496
+ "description": "每批兵数(groups>10时默认10。设小值减轻MCP传输压力;需与runId/runDir/collector纪律配套)"
497
+ },
498
+ "runId": {
499
+ "type": "string"
500
+ },
501
+ "runDir": {
502
+ "type": "string"
503
+ },
504
+ "taskCard": {
505
+ "type": "object",
506
+ "additionalProperties": true
507
+ },
508
+ "collector": {
509
+ "type": "object",
510
+ "additionalProperties": true
511
+ },
512
+ "budgets": {
513
+ "type": "object",
514
+ "additionalProperties": true
515
+ },
516
+ "acceptance": {
517
+ "type": "object",
518
+ "additionalProperties": true
519
+ },
520
+ "evidence": {
521
+ "type": "object",
522
+ "additionalProperties": true
523
+ },
524
+ "toolPolicy": {
525
+ "type": "object",
526
+ "additionalProperties": true
527
+ },
528
+ "tool_policy": {
529
+ "type": "object",
530
+ "additionalProperties": true
531
+ },
532
+ "notifyPolicy": {
533
+ "type": "string"
534
+ },
535
+ "raw_output_policy": {
536
+ "type": "string",
537
+ "enum": [
538
+ "no_full_dump"
539
+ ]
540
+ }
541
+ },
542
+ "additionalProperties": false
543
+ }
544
+ },
545
+ {
546
+ "name": "scInbox",
547
+ "description": "SC完成事件收件箱(action=pending|recent|report|ack|stats)。pending只返回未ack事件;chat-inject成功后事件会被ack,此时用recent或includeAcked=true核实最近事件。用于回收SC子Agent completion event;不是用户输入,也不是伪造assistant回复。子Agent不可调用。",
548
+ "inputSchema": {
549
+ "type": "object",
550
+ "required": [
551
+ "action"
552
+ ],
553
+ "properties": {
554
+ "action": {
555
+ "type": "string",
556
+ "enum": [
557
+ "pending",
558
+ "recent",
559
+ "report",
560
+ "ack",
561
+ "stats"
562
+ ]
563
+ },
564
+ "limit": {
565
+ "type": "number",
566
+ "description": "返回事件上限,默认20,最大200"
567
+ },
568
+ "eventIds": {
569
+ "type": "array",
570
+ "items": {
571
+ "type": "string"
572
+ },
573
+ "description": "ack 指定事件ID"
574
+ },
575
+ "taskIds": {
576
+ "type": "array",
577
+ "items": {
578
+ "type": "string"
579
+ },
580
+ "description": "ack 指定任务ID"
581
+ },
582
+ "all": {
583
+ "type": "boolean",
584
+ "description": "ack 全部未确认事件"
585
+ },
586
+ "ack": {
587
+ "type": "boolean",
588
+ "description": "report 后是否立即ack;默认false,建议用户可见汇报成功后再ack"
589
+ },
590
+ "includeAcked": {
591
+ "type": "boolean",
592
+ "description": "是否包含已ack事件;chat-inject自动ack后核实最近完成事件时设为true,或使用action=recent"
593
+ }
594
+ },
595
+ "additionalProperties": false
596
+ }
597
+ },
598
+ {
599
+ "name": "validate",
600
+ "description": "代码验证工具(action=check语法检查|load模块加载|diff查看改动)——check跑 node --check,load隔离子进程验证模块加载,diff用 git diff 看文件改动。子Agent改完代码后必须调此工具确认代码无误",
601
+ "inputSchema": {
602
+ "type": "object",
603
+ "required": [
604
+ "action",
605
+ "path"
606
+ ],
607
+ "properties": {
608
+ "action": {
609
+ "type": "string",
610
+ "enum": [
611
+ "check",
612
+ "load",
613
+ "diff"
614
+ ]
615
+ },
616
+ "path": {
617
+ "type": "string",
618
+ "description": "要验证/查看的文件路径"
619
+ }
620
+ },
621
+ "additionalProperties": false
622
+ }
623
+ }
624
+ ],
625
+ "subagent": {
626
+ "blocked": [
627
+ "emergencyStop",
628
+ "spawnAgent",
629
+ "taskPipeline",
630
+ "scInbox",
631
+ "batchVision"
632
+ ],
633
+ "partialAllowed": {
634
+ "codeEditor": {
635
+ "description": "子agent仅允许edit_code/review_code",
636
+ "actions": [
637
+ "edit_code",
638
+ "review_code"
639
+ ]
640
+ },
641
+ "fileManager": {
642
+ "description": "子agent仅允许read/list/write/copy/move",
643
+ "actions": [
644
+ "read",
645
+ "list",
646
+ "write",
647
+ "copy",
648
+ "move"
649
+ ]
650
+ }
651
+ }
652
+ }
653
+ }