@capyclaw/browser-suite 0.0.0-stage → 0.1.2

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/README.md CHANGED
@@ -1,3 +1,24 @@
1
- # Temporary Holding Version
1
+ # @capyclaw/browser-suite
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 浏览器操控工作台套件 —— 一键安装 Browser 运行时 + 3 个独立 skill 包 + 公共基建插件。
4
+
5
+ ## 组成
6
+
7
+ - `@capyclaw/browser-workbench` —— 运行时:15 个 `browser_*` MCP 工具 + Playwright 引擎(有头可见、登录态持久化)+ 可视化工作台(http://127.0.0.1:39315/)
8
+ - `@capyclaw/browser-skill-browser` —— 路由技能(总入口)
9
+ - `@capyclaw/browser-skill-api` —— 工具手册技能(含生成的 tool-contract.md)
10
+ - `@capyclaw/browser-skill-ops` —— 网活实操技能(观察→定位→动作→验证工作流)
11
+ - 公共基建:service-host / tool-host / asset-service / service-broker
12
+
13
+ ## 安装
14
+
15
+ ```bash
16
+ dsh plugin --profile web add @capyclaw/browser-suite
17
+ ```
18
+
19
+ 安装后:broker 按本包 `services.json` 以独立进程拉起 relay(固定端口 39315),
20
+ dsh 侧经官方 mcp-client 连 `http://127.0.0.1:39315/mcp`,工具名 `mcp__browser__browser_*`。
21
+
22
+ ## 许可证
23
+
24
+ MIT License
@@ -0,0 +1,60 @@
1
+ {
2
+ "suite": "capyclaw-browser-suite",
3
+ "suiteVersion": "0.1.2",
4
+ "packages": {
5
+ "@capyclaw/asset-service": {
6
+ "version": "0.1.2",
7
+ "apiVersion": "1.0.0",
8
+ "path": "..\\..\\..\\..\\..\\packages\\capyclaw-asset-service",
9
+ "sha256": "1e4dcb876e6acf9f253bf7f01b594390c39cf541534f9ff26a97b62ba37e6060"
10
+ },
11
+ "@capyclaw/browser-skill-api": {
12
+ "version": "0.1.0",
13
+ "apiVersion": null,
14
+ "path": "../capyclaw-browser-skill-api",
15
+ "sha256": "c890d889c5207344d909af553761d30aec5920f411f5ce4c1eedf2814d4cfb04"
16
+ },
17
+ "@capyclaw/browser-skill-browser": {
18
+ "version": "0.1.0",
19
+ "apiVersion": null,
20
+ "path": "../capyclaw-browser-skill-browser",
21
+ "sha256": "3550cc83e4f8dba404b1271048fd2c5103c4dcb24717a33ef71ca70bbcc0c507"
22
+ },
23
+ "@capyclaw/browser-skill-ops": {
24
+ "version": "0.1.0",
25
+ "apiVersion": null,
26
+ "path": "../capyclaw-browser-skill-ops",
27
+ "sha256": "500074f484b5054a2ba602df39cd064d26952c86826b3232f2301cc2a955f6bf"
28
+ },
29
+ "@capyclaw/browser-workbench": {
30
+ "version": "0.1.0",
31
+ "apiVersion": null,
32
+ "path": "../capyclaw-browser-workbench",
33
+ "sha256": "ef30aa6b420c3eb8afb14767690f55f5995fb61292dba5d9f000a8afe6443c1d"
34
+ },
35
+ "@capyclaw/plugin-kit": {
36
+ "version": "0.2.2",
37
+ "apiVersion": null,
38
+ "path": "../../../../../packages/capyclaw-plugin-kit",
39
+ "sha256": "2247b5314820fda9a0ae40faf50fc6bcc5bd1877764c12ab528f1baab382ccc6"
40
+ },
41
+ "@capyclaw/service-broker": {
42
+ "version": "0.2.4",
43
+ "apiVersion": "1.0.0",
44
+ "path": "../../../../../packages/capyclaw-service-broker",
45
+ "sha256": "a013d1e36eeed9a22d864ff56b2739281ab35eaad6c0eb71880f8f5462864c8b"
46
+ },
47
+ "@capyclaw/service-host": {
48
+ "version": "0.1.2",
49
+ "apiVersion": "1.0.0",
50
+ "path": "..\\..\\..\\..\\..\\packages\\capyclaw-service-host",
51
+ "sha256": "c517f6291a63c08e938e2ae0984a5663ed418af244cec7929cbfa4447dfdb845"
52
+ },
53
+ "@capyclaw/tool-host": {
54
+ "version": "0.1.2",
55
+ "apiVersion": "1.0.0",
56
+ "path": "..\\..\\..\\..\\..\\packages\\capyclaw-tool-host",
57
+ "sha256": "c79b9f3efef2ee588c9797562f3fb56135907b03eb2a0d7e22314548e8500723"
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,890 @@
1
+ {
2
+ "contractVersion": "1.0.0",
3
+ "packageVersion": "0.1.0",
4
+ "toolCount": 15,
5
+ "tools": [
6
+ {
7
+ "name": "browser_capabilities",
8
+ "kind": "read",
9
+ "since": "1.0.0",
10
+ "capability": "contract",
11
+ "description": "返回工作台契约版本、工具清单、能力清单与引擎状态。skill 加载后先调用一次;工具缺失或 major 版本不一致时停止并提示升级。",
12
+ "inputSchema": {
13
+ "type": "object",
14
+ "properties": {},
15
+ "additionalProperties": false
16
+ }
17
+ },
18
+ {
19
+ "name": "browser_navigate",
20
+ "kind": "write",
21
+ "since": "1.0.0",
22
+ "capability": "navigation",
23
+ "description": "打开网址(仅 http/https;URL 内嵌用户名密码会被拒绝)。首次调用会自动拉起浏览器(默认有头可见,登录态持久化)。返回新页面的元素快照,后续动作直接引用其中的 ref。",
24
+ "inputSchema": {
25
+ "type": "object",
26
+ "properties": {
27
+ "url": {
28
+ "type": "string",
29
+ "maxLength": 2048,
30
+ "description": "目标网址,如 https://example.com/"
31
+ },
32
+ "tab": {
33
+ "type": "string",
34
+ "maxLength": 16,
35
+ "description": "在指定标签页打开(缺省=当前活动标签页;浏览器未启动时自动新建)"
36
+ }
37
+ },
38
+ "required": [
39
+ "url"
40
+ ],
41
+ "additionalProperties": false
42
+ }
43
+ },
44
+ {
45
+ "name": "browser_snapshot",
46
+ "kind": "read",
47
+ "since": "1.0.0",
48
+ "capability": "snapshot",
49
+ "description": "观察当前页面:返回可交互元素(链接/按钮/输入框/下拉…)与结构节点(标题/图片)的缩进文本树,每个元素带 ref=eN。click/fill/select 等动作只用 ref 定位;页面变化后 ref 会过期(报 STALE_SNAPSHOT),重新快照即可。",
50
+ "inputSchema": {
51
+ "type": "object",
52
+ "properties": {
53
+ "tab": {
54
+ "type": "string",
55
+ "maxLength": 16,
56
+ "description": "目标标签页 id(缺省=当前活动标签页)"
57
+ }
58
+ },
59
+ "additionalProperties": false
60
+ }
61
+ },
62
+ {
63
+ "name": "browser_click",
64
+ "kind": "write",
65
+ "since": "1.0.0",
66
+ "capability": "interaction",
67
+ "description": "点击元素。ref 来自最近一次 browser_navigate/browser_snapshot 的快照;元素已变化时报 STALE_SNAPSHOT,重新快照后用新 ref。动作成功后返回新快照。",
68
+ "inputSchema": {
69
+ "type": "object",
70
+ "properties": {
71
+ "ref": {
72
+ "type": "string",
73
+ "maxLength": 16,
74
+ "description": "快照里的元素引用,如 e5"
75
+ },
76
+ "tab": {
77
+ "type": "string",
78
+ "maxLength": 16,
79
+ "description": "目标标签页 id(缺省=当前活动标签页)"
80
+ }
81
+ },
82
+ "required": [
83
+ "ref"
84
+ ],
85
+ "additionalProperties": false
86
+ }
87
+ },
88
+ {
89
+ "name": "browser_fill",
90
+ "kind": "write",
91
+ "since": "1.0.0",
92
+ "capability": "interaction",
93
+ "description": "在输入框/文本域填写文字(整体替换,兼容 React/Vue 受控输入)。submit=true 时填写后按回车提交。密码框会被快照掩码显示,但填写不受影响。",
94
+ "inputSchema": {
95
+ "type": "object",
96
+ "properties": {
97
+ "ref": {
98
+ "type": "string",
99
+ "maxLength": 16,
100
+ "description": "目标输入框的 ref"
101
+ },
102
+ "text": {
103
+ "type": "string",
104
+ "maxLength": 10000,
105
+ "description": "要填入的文字(空字符串=清空)"
106
+ },
107
+ "submit": {
108
+ "type": "boolean",
109
+ "description": "填写后按 Enter 提交(默认 false)"
110
+ },
111
+ "tab": {
112
+ "type": "string",
113
+ "maxLength": 16,
114
+ "description": "目标标签页 id(缺省=当前活动标签页)"
115
+ }
116
+ },
117
+ "required": [
118
+ "ref",
119
+ "text"
120
+ ],
121
+ "additionalProperties": false
122
+ }
123
+ },
124
+ {
125
+ "name": "browser_press",
126
+ "kind": "write",
127
+ "since": "1.0.0",
128
+ "capability": "interaction",
129
+ "description": "按键。给 ref 时在指定元素上按(如输入框内 Enter),不给 ref 时对当前页面按(如 Tab / Escape / Control+a)。",
130
+ "inputSchema": {
131
+ "type": "object",
132
+ "properties": {
133
+ "key": {
134
+ "type": "string",
135
+ "maxLength": 40,
136
+ "description": "键名:Enter / Tab / Escape / ArrowDown / Control+a 等(Playwright 键名)"
137
+ },
138
+ "ref": {
139
+ "type": "string",
140
+ "maxLength": 16,
141
+ "description": "目标元素 ref(缺省=页面级按键)"
142
+ },
143
+ "tab": {
144
+ "type": "string",
145
+ "maxLength": 16,
146
+ "description": "目标标签页 id(缺省=当前活动标签页)"
147
+ }
148
+ },
149
+ "required": [
150
+ "key"
151
+ ],
152
+ "additionalProperties": false
153
+ }
154
+ },
155
+ {
156
+ "name": "browser_select",
157
+ "kind": "write",
158
+ "since": "1.0.0",
159
+ "capability": "interaction",
160
+ "description": "选择下拉框(select)的选项。value 先按 <option value> 匹配,失败自动按选项文本匹配。",
161
+ "inputSchema": {
162
+ "type": "object",
163
+ "properties": {
164
+ "ref": {
165
+ "type": "string",
166
+ "maxLength": 16,
167
+ "description": "目标下拉框的 ref"
168
+ },
169
+ "value": {
170
+ "type": "string",
171
+ "maxLength": 300,
172
+ "description": "选项的 value 或可见文本"
173
+ },
174
+ "tab": {
175
+ "type": "string",
176
+ "maxLength": 16,
177
+ "description": "目标标签页 id(缺省=当前活动标签页)"
178
+ }
179
+ },
180
+ "required": [
181
+ "ref",
182
+ "value"
183
+ ],
184
+ "additionalProperties": false
185
+ }
186
+ },
187
+ {
188
+ "name": "browser_scroll",
189
+ "kind": "write",
190
+ "since": "1.0.0",
191
+ "capability": "interaction",
192
+ "description": "滚动当前页面(默认向下 600px)。懒加载页面翻内容用它。",
193
+ "inputSchema": {
194
+ "type": "object",
195
+ "properties": {
196
+ "direction": {
197
+ "type": "string",
198
+ "enum": [
199
+ "up",
200
+ "down"
201
+ ],
202
+ "description": "方向(默认 down)"
203
+ },
204
+ "amount": {
205
+ "type": "number",
206
+ "description": "像素数(默认 600)"
207
+ },
208
+ "tab": {
209
+ "type": "string",
210
+ "maxLength": 16,
211
+ "description": "目标标签页 id(缺省=当前活动标签页)"
212
+ }
213
+ },
214
+ "additionalProperties": false
215
+ }
216
+ },
217
+ {
218
+ "name": "browser_tabs",
219
+ "kind": "control",
220
+ "since": "1.0.0",
221
+ "capability": "tabs",
222
+ "description": "标签页四合一:action=list 列出(含稳定 id 与当前地址);new 打开新标签页(可带 url);select 切换活动标签页;close 关闭。后续动作默认作用于活动标签页,也可用 tab 参数显式指定。",
223
+ "inputSchema": {
224
+ "type": "object",
225
+ "properties": {
226
+ "action": {
227
+ "type": "string",
228
+ "enum": [
229
+ "list",
230
+ "new",
231
+ "select",
232
+ "close"
233
+ ],
234
+ "description": "动作(默认 list)"
235
+ },
236
+ "url": {
237
+ "type": "string",
238
+ "maxLength": 2048,
239
+ "description": "new 动作要打开的网址"
240
+ },
241
+ "tab": {
242
+ "type": "string",
243
+ "maxLength": 16,
244
+ "description": "select/close 的目标标签页 id"
245
+ }
246
+ },
247
+ "additionalProperties": false
248
+ }
249
+ },
250
+ {
251
+ "name": "browser_screenshot",
252
+ "kind": "read",
253
+ "since": "1.0.0",
254
+ "capability": "screenshot",
255
+ "description": "当前页面截图(PNG 保存到本机,返回绝对路径)。默认视口截图;fullPage=true 截整页。工作台地址可实时观察页面。",
256
+ "inputSchema": {
257
+ "type": "object",
258
+ "properties": {
259
+ "fullPage": {
260
+ "type": "boolean",
261
+ "description": "是否截取整页(默认 false)"
262
+ },
263
+ "tab": {
264
+ "type": "string",
265
+ "maxLength": 16,
266
+ "description": "目标标签页 id(缺省=当前活动标签页)"
267
+ }
268
+ },
269
+ "additionalProperties": false
270
+ }
271
+ },
272
+ {
273
+ "name": "browser_status",
274
+ "kind": "read",
275
+ "since": "1.0.0",
276
+ "capability": "session",
277
+ "description": "引擎状态:是否运行、有头/无头、标签页清单(id+地址)、累计动作数、最近动作日志。不确定浏览器是否还活着时先看它。",
278
+ "inputSchema": {
279
+ "type": "object",
280
+ "properties": {},
281
+ "additionalProperties": false
282
+ }
283
+ },
284
+ {
285
+ "name": "browser_wait",
286
+ "kind": "control",
287
+ "since": "1.0.0",
288
+ "capability": "session",
289
+ "description": "等待:ms=毫秒;selector=等元素出现(如 .result);都不给=等页面 load 完成。动作后页面还在加载/渲染时用它。",
290
+ "inputSchema": {
291
+ "type": "object",
292
+ "properties": {
293
+ "ms": {
294
+ "type": "number",
295
+ "description": "等待毫秒数(上限 30000)"
296
+ },
297
+ "selector": {
298
+ "type": "string",
299
+ "maxLength": 300,
300
+ "description": "等待出现的 CSS 选择器"
301
+ },
302
+ "tab": {
303
+ "type": "string",
304
+ "maxLength": 16,
305
+ "description": "目标标签页 id(缺省=当前活动标签页)"
306
+ }
307
+ },
308
+ "additionalProperties": false
309
+ }
310
+ },
311
+ {
312
+ "name": "browser_history",
313
+ "kind": "control",
314
+ "since": "1.0.0",
315
+ "capability": "session",
316
+ "description": "浏览历史:back 后退 / forward 前进 / reload 重载。返回操作后的新快照。",
317
+ "inputSchema": {
318
+ "type": "object",
319
+ "properties": {
320
+ "action": {
321
+ "type": "string",
322
+ "enum": [
323
+ "back",
324
+ "forward",
325
+ "reload"
326
+ ],
327
+ "description": "动作(默认 back)"
328
+ },
329
+ "tab": {
330
+ "type": "string",
331
+ "maxLength": 16,
332
+ "description": "目标标签页 id(缺省=当前活动标签页)"
333
+ }
334
+ },
335
+ "additionalProperties": false
336
+ }
337
+ },
338
+ {
339
+ "name": "browser_close",
340
+ "kind": "control",
341
+ "since": "1.0.0",
342
+ "capability": "session",
343
+ "description": "关闭浏览器(所有标签页)。登录态与 profile 持久化,下次 navigate 自动重启浏览器并保留登录。任务结束或页面卡死时用它重置。",
344
+ "inputSchema": {
345
+ "type": "object",
346
+ "properties": {},
347
+ "additionalProperties": false
348
+ }
349
+ },
350
+ {
351
+ "name": "browser_evaluate",
352
+ "kind": "write",
353
+ "since": "1.0.0",
354
+ "capability": "evaluate",
355
+ "description": "在页面里执行 JS 表达式并返回结果。默认关闭(安全默认);关闭时返回 NOT_IMPLEMENTED 与开启方法。优先用快照+ref 完成任务,本工具留给快照覆盖不了的场景。",
356
+ "inputSchema": {
357
+ "type": "object",
358
+ "properties": {
359
+ "script": {
360
+ "type": "string",
361
+ "maxLength": 20000,
362
+ "description": "JS 表达式(如 document.title)"
363
+ },
364
+ "tab": {
365
+ "type": "string",
366
+ "maxLength": 16,
367
+ "description": "目标标签页 id(缺省=当前活动标签页)"
368
+ }
369
+ },
370
+ "required": [
371
+ "script"
372
+ ],
373
+ "additionalProperties": false
374
+ }
375
+ }
376
+ ],
377
+ "features": [
378
+ "browser.contract",
379
+ "browser.navigation",
380
+ "browser.snapshot",
381
+ "browser.interaction",
382
+ "browser.tabs",
383
+ "browser.screenshot",
384
+ "browser.session",
385
+ "browser.evaluate"
386
+ ],
387
+ "capabilities": [
388
+ {
389
+ "id": "contract",
390
+ "title": "契约探测",
391
+ "description": "",
392
+ "tags": [
393
+ "meta"
394
+ ],
395
+ "requires": [
396
+ "engine",
397
+ "server"
398
+ ],
399
+ "dependsOn": [],
400
+ "provides": {},
401
+ "features": [
402
+ "browser.contract"
403
+ ],
404
+ "tools": [
405
+ {
406
+ "name": "browser_capabilities",
407
+ "description": "返回工作台契约版本、工具清单、能力清单与引擎状态。skill 加载后先调用一次;工具缺失或 major 版本不一致时停止并提示升级。",
408
+ "inputSchema": {
409
+ "type": "object",
410
+ "properties": {},
411
+ "additionalProperties": false
412
+ },
413
+ "kind": "read",
414
+ "since": "1.0.0"
415
+ }
416
+ ]
417
+ },
418
+ {
419
+ "id": "navigation",
420
+ "title": "导航",
421
+ "description": "",
422
+ "tags": [
423
+ "core"
424
+ ],
425
+ "requires": [
426
+ "engine"
427
+ ],
428
+ "dependsOn": [],
429
+ "provides": {},
430
+ "features": [
431
+ "browser.navigation"
432
+ ],
433
+ "tools": [
434
+ {
435
+ "name": "browser_navigate",
436
+ "description": "打开网址(仅 http/https;URL 内嵌用户名密码会被拒绝)。首次调用会自动拉起浏览器(默认有头可见,登录态持久化)。返回新页面的元素快照,后续动作直接引用其中的 ref。",
437
+ "inputSchema": {
438
+ "type": "object",
439
+ "properties": {
440
+ "url": {
441
+ "type": "string",
442
+ "maxLength": 2048,
443
+ "description": "目标网址,如 https://example.com/"
444
+ },
445
+ "tab": {
446
+ "type": "string",
447
+ "maxLength": 16,
448
+ "description": "在指定标签页打开(缺省=当前活动标签页;浏览器未启动时自动新建)"
449
+ }
450
+ },
451
+ "required": [
452
+ "url"
453
+ ],
454
+ "additionalProperties": false
455
+ },
456
+ "kind": "write",
457
+ "since": "1.0.0"
458
+ }
459
+ ]
460
+ },
461
+ {
462
+ "id": "snapshot",
463
+ "title": "页面快照",
464
+ "description": "",
465
+ "tags": [
466
+ "core"
467
+ ],
468
+ "requires": [
469
+ "engine"
470
+ ],
471
+ "dependsOn": [],
472
+ "provides": {},
473
+ "features": [
474
+ "browser.snapshot"
475
+ ],
476
+ "tools": [
477
+ {
478
+ "name": "browser_snapshot",
479
+ "description": "观察当前页面:返回可交互元素(链接/按钮/输入框/下拉…)与结构节点(标题/图片)的缩进文本树,每个元素带 ref=eN。click/fill/select 等动作只用 ref 定位;页面变化后 ref 会过期(报 STALE_SNAPSHOT),重新快照即可。",
480
+ "inputSchema": {
481
+ "type": "object",
482
+ "properties": {
483
+ "tab": {
484
+ "type": "string",
485
+ "maxLength": 16,
486
+ "description": "目标标签页 id(缺省=当前活动标签页)"
487
+ }
488
+ },
489
+ "additionalProperties": false
490
+ },
491
+ "kind": "read",
492
+ "since": "1.0.0"
493
+ }
494
+ ]
495
+ },
496
+ {
497
+ "id": "interaction",
498
+ "title": "页面交互",
499
+ "description": "",
500
+ "tags": [
501
+ "core"
502
+ ],
503
+ "requires": [
504
+ "engine"
505
+ ],
506
+ "dependsOn": [],
507
+ "provides": {},
508
+ "features": [
509
+ "browser.interaction"
510
+ ],
511
+ "tools": [
512
+ {
513
+ "name": "browser_click",
514
+ "description": "点击元素。ref 来自最近一次 browser_navigate/browser_snapshot 的快照;元素已变化时报 STALE_SNAPSHOT,重新快照后用新 ref。动作成功后返回新快照。",
515
+ "inputSchema": {
516
+ "type": "object",
517
+ "properties": {
518
+ "ref": {
519
+ "type": "string",
520
+ "maxLength": 16,
521
+ "description": "快照里的元素引用,如 e5"
522
+ },
523
+ "tab": {
524
+ "type": "string",
525
+ "maxLength": 16,
526
+ "description": "目标标签页 id(缺省=当前活动标签页)"
527
+ }
528
+ },
529
+ "required": [
530
+ "ref"
531
+ ],
532
+ "additionalProperties": false
533
+ },
534
+ "kind": "write",
535
+ "since": "1.0.0"
536
+ },
537
+ {
538
+ "name": "browser_fill",
539
+ "description": "在输入框/文本域填写文字(整体替换,兼容 React/Vue 受控输入)。submit=true 时填写后按回车提交。密码框会被快照掩码显示,但填写不受影响。",
540
+ "inputSchema": {
541
+ "type": "object",
542
+ "properties": {
543
+ "ref": {
544
+ "type": "string",
545
+ "maxLength": 16,
546
+ "description": "目标输入框的 ref"
547
+ },
548
+ "text": {
549
+ "type": "string",
550
+ "maxLength": 10000,
551
+ "description": "要填入的文字(空字符串=清空)"
552
+ },
553
+ "submit": {
554
+ "type": "boolean",
555
+ "description": "填写后按 Enter 提交(默认 false)"
556
+ },
557
+ "tab": {
558
+ "type": "string",
559
+ "maxLength": 16,
560
+ "description": "目标标签页 id(缺省=当前活动标签页)"
561
+ }
562
+ },
563
+ "required": [
564
+ "ref",
565
+ "text"
566
+ ],
567
+ "additionalProperties": false
568
+ },
569
+ "kind": "write",
570
+ "since": "1.0.0"
571
+ },
572
+ {
573
+ "name": "browser_press",
574
+ "description": "按键。给 ref 时在指定元素上按(如输入框内 Enter),不给 ref 时对当前页面按(如 Tab / Escape / Control+a)。",
575
+ "inputSchema": {
576
+ "type": "object",
577
+ "properties": {
578
+ "key": {
579
+ "type": "string",
580
+ "maxLength": 40,
581
+ "description": "键名:Enter / Tab / Escape / ArrowDown / Control+a 等(Playwright 键名)"
582
+ },
583
+ "ref": {
584
+ "type": "string",
585
+ "maxLength": 16,
586
+ "description": "目标元素 ref(缺省=页面级按键)"
587
+ },
588
+ "tab": {
589
+ "type": "string",
590
+ "maxLength": 16,
591
+ "description": "目标标签页 id(缺省=当前活动标签页)"
592
+ }
593
+ },
594
+ "required": [
595
+ "key"
596
+ ],
597
+ "additionalProperties": false
598
+ },
599
+ "kind": "write",
600
+ "since": "1.0.0"
601
+ },
602
+ {
603
+ "name": "browser_select",
604
+ "description": "选择下拉框(select)的选项。value 先按 <option value> 匹配,失败自动按选项文本匹配。",
605
+ "inputSchema": {
606
+ "type": "object",
607
+ "properties": {
608
+ "ref": {
609
+ "type": "string",
610
+ "maxLength": 16,
611
+ "description": "目标下拉框的 ref"
612
+ },
613
+ "value": {
614
+ "type": "string",
615
+ "maxLength": 300,
616
+ "description": "选项的 value 或可见文本"
617
+ },
618
+ "tab": {
619
+ "type": "string",
620
+ "maxLength": 16,
621
+ "description": "目标标签页 id(缺省=当前活动标签页)"
622
+ }
623
+ },
624
+ "required": [
625
+ "ref",
626
+ "value"
627
+ ],
628
+ "additionalProperties": false
629
+ },
630
+ "kind": "write",
631
+ "since": "1.0.0"
632
+ },
633
+ {
634
+ "name": "browser_scroll",
635
+ "description": "滚动当前页面(默认向下 600px)。懒加载页面翻内容用它。",
636
+ "inputSchema": {
637
+ "type": "object",
638
+ "properties": {
639
+ "direction": {
640
+ "type": "string",
641
+ "enum": [
642
+ "up",
643
+ "down"
644
+ ],
645
+ "description": "方向(默认 down)"
646
+ },
647
+ "amount": {
648
+ "type": "number",
649
+ "description": "像素数(默认 600)"
650
+ },
651
+ "tab": {
652
+ "type": "string",
653
+ "maxLength": 16,
654
+ "description": "目标标签页 id(缺省=当前活动标签页)"
655
+ }
656
+ },
657
+ "additionalProperties": false
658
+ },
659
+ "kind": "write",
660
+ "since": "1.0.0"
661
+ }
662
+ ]
663
+ },
664
+ {
665
+ "id": "tabs",
666
+ "title": "标签页管理",
667
+ "description": "",
668
+ "tags": [
669
+ "core"
670
+ ],
671
+ "requires": [
672
+ "engine"
673
+ ],
674
+ "dependsOn": [],
675
+ "provides": {},
676
+ "features": [
677
+ "browser.tabs"
678
+ ],
679
+ "tools": [
680
+ {
681
+ "name": "browser_tabs",
682
+ "description": "标签页四合一:action=list 列出(含稳定 id 与当前地址);new 打开新标签页(可带 url);select 切换活动标签页;close 关闭。后续动作默认作用于活动标签页,也可用 tab 参数显式指定。",
683
+ "inputSchema": {
684
+ "type": "object",
685
+ "properties": {
686
+ "action": {
687
+ "type": "string",
688
+ "enum": [
689
+ "list",
690
+ "new",
691
+ "select",
692
+ "close"
693
+ ],
694
+ "description": "动作(默认 list)"
695
+ },
696
+ "url": {
697
+ "type": "string",
698
+ "maxLength": 2048,
699
+ "description": "new 动作要打开的网址"
700
+ },
701
+ "tab": {
702
+ "type": "string",
703
+ "maxLength": 16,
704
+ "description": "select/close 的目标标签页 id"
705
+ }
706
+ },
707
+ "additionalProperties": false
708
+ },
709
+ "kind": "control",
710
+ "since": "1.0.0"
711
+ }
712
+ ]
713
+ },
714
+ {
715
+ "id": "screenshot",
716
+ "title": "页面截图",
717
+ "description": "",
718
+ "tags": [
719
+ "verify"
720
+ ],
721
+ "requires": [
722
+ "engine",
723
+ "server"
724
+ ],
725
+ "dependsOn": [],
726
+ "provides": {},
727
+ "features": [
728
+ "browser.screenshot"
729
+ ],
730
+ "tools": [
731
+ {
732
+ "name": "browser_screenshot",
733
+ "description": "当前页面截图(PNG 保存到本机,返回绝对路径)。默认视口截图;fullPage=true 截整页。工作台地址可实时观察页面。",
734
+ "inputSchema": {
735
+ "type": "object",
736
+ "properties": {
737
+ "fullPage": {
738
+ "type": "boolean",
739
+ "description": "是否截取整页(默认 false)"
740
+ },
741
+ "tab": {
742
+ "type": "string",
743
+ "maxLength": 16,
744
+ "description": "目标标签页 id(缺省=当前活动标签页)"
745
+ }
746
+ },
747
+ "additionalProperties": false
748
+ },
749
+ "kind": "read",
750
+ "since": "1.0.0"
751
+ }
752
+ ]
753
+ },
754
+ {
755
+ "id": "session",
756
+ "title": "会话管理",
757
+ "description": "",
758
+ "tags": [
759
+ "core"
760
+ ],
761
+ "requires": [
762
+ "engine"
763
+ ],
764
+ "dependsOn": [],
765
+ "provides": {},
766
+ "features": [
767
+ "browser.session"
768
+ ],
769
+ "tools": [
770
+ {
771
+ "name": "browser_status",
772
+ "description": "引擎状态:是否运行、有头/无头、标签页清单(id+地址)、累计动作数、最近动作日志。不确定浏览器是否还活着时先看它。",
773
+ "inputSchema": {
774
+ "type": "object",
775
+ "properties": {},
776
+ "additionalProperties": false
777
+ },
778
+ "kind": "read",
779
+ "since": "1.0.0"
780
+ },
781
+ {
782
+ "name": "browser_wait",
783
+ "description": "等待:ms=毫秒;selector=等元素出现(如 .result);都不给=等页面 load 完成。动作后页面还在加载/渲染时用它。",
784
+ "inputSchema": {
785
+ "type": "object",
786
+ "properties": {
787
+ "ms": {
788
+ "type": "number",
789
+ "description": "等待毫秒数(上限 30000)"
790
+ },
791
+ "selector": {
792
+ "type": "string",
793
+ "maxLength": 300,
794
+ "description": "等待出现的 CSS 选择器"
795
+ },
796
+ "tab": {
797
+ "type": "string",
798
+ "maxLength": 16,
799
+ "description": "目标标签页 id(缺省=当前活动标签页)"
800
+ }
801
+ },
802
+ "additionalProperties": false
803
+ },
804
+ "kind": "control",
805
+ "since": "1.0.0"
806
+ },
807
+ {
808
+ "name": "browser_history",
809
+ "description": "浏览历史:back 后退 / forward 前进 / reload 重载。返回操作后的新快照。",
810
+ "inputSchema": {
811
+ "type": "object",
812
+ "properties": {
813
+ "action": {
814
+ "type": "string",
815
+ "enum": [
816
+ "back",
817
+ "forward",
818
+ "reload"
819
+ ],
820
+ "description": "动作(默认 back)"
821
+ },
822
+ "tab": {
823
+ "type": "string",
824
+ "maxLength": 16,
825
+ "description": "目标标签页 id(缺省=当前活动标签页)"
826
+ }
827
+ },
828
+ "additionalProperties": false
829
+ },
830
+ "kind": "control",
831
+ "since": "1.0.0"
832
+ },
833
+ {
834
+ "name": "browser_close",
835
+ "description": "关闭浏览器(所有标签页)。登录态与 profile 持久化,下次 navigate 自动重启浏览器并保留登录。任务结束或页面卡死时用它重置。",
836
+ "inputSchema": {
837
+ "type": "object",
838
+ "properties": {},
839
+ "additionalProperties": false
840
+ },
841
+ "kind": "control",
842
+ "since": "1.0.0"
843
+ }
844
+ ]
845
+ },
846
+ {
847
+ "id": "evaluate",
848
+ "title": "页面脚本",
849
+ "description": "",
850
+ "tags": [
851
+ "advanced"
852
+ ],
853
+ "requires": [
854
+ "engine"
855
+ ],
856
+ "dependsOn": [],
857
+ "provides": {},
858
+ "features": [
859
+ "browser.evaluate"
860
+ ],
861
+ "tools": [
862
+ {
863
+ "name": "browser_evaluate",
864
+ "description": "在页面里执行 JS 表达式并返回结果。默认关闭(安全默认);关闭时返回 NOT_IMPLEMENTED 与开启方法。优先用快照+ref 完成任务,本工具留给快照覆盖不了的场景。",
865
+ "inputSchema": {
866
+ "type": "object",
867
+ "properties": {
868
+ "script": {
869
+ "type": "string",
870
+ "maxLength": 20000,
871
+ "description": "JS 表达式(如 document.title)"
872
+ },
873
+ "tab": {
874
+ "type": "string",
875
+ "maxLength": 16,
876
+ "description": "目标标签页 id(缺省=当前活动标签页)"
877
+ }
878
+ },
879
+ "required": [
880
+ "script"
881
+ ],
882
+ "additionalProperties": false
883
+ },
884
+ "kind": "write",
885
+ "since": "1.0.0"
886
+ }
887
+ ]
888
+ }
889
+ ]
890
+ }
@@ -0,0 +1,18 @@
1
+ # 由 @capyclaw/suite-kit 生成;改 dsh-suite.json 后重跑 compose。
2
+
3
+ - insert:
4
+ - id: service-host
5
+ name: "@capyclaw/service-host"
6
+ - id: tool-host
7
+ name: "@capyclaw/tool-host"
8
+ - id: asset-service
9
+ name: "@capyclaw/asset-service"
10
+ - id: mcp-browser
11
+ name: "@deepseek-ai/dsh-mcp-client"
12
+ config: {"serverName":"browser","transport":"streamable-http","url":"http://127.0.0.1:39315/mcp","failOnStartupError":false,"toolCallTimeoutMs":120000}
13
+ - id: browser-skill-browser
14
+ name: "@capyclaw/browser-skill-browser"
15
+ - id: browser-skill-api
16
+ name: "@capyclaw/browser-skill-api"
17
+ - id: browser-skill-ops
18
+ name: "@capyclaw/browser-skill-ops"
package/dsh-suite.json ADDED
@@ -0,0 +1,163 @@
1
+ {
2
+ "$schema": "../../../../../packages/capyclaw-suite-kit/suite.schema.json",
3
+ "name": "capyclaw-browser-suite",
4
+ "version": "0.1.2",
5
+ "title": "浏览器操控工作台套件",
6
+ "description": "浏览器操控运行时(独立端口服务,Playwright 引擎、有头可见、登录态持久化)+ 3 个独立 skill 包 + 3 个公共基建插件 + 服务中间件(broker);relay 不 insert 进 dsh 进程,由中间件按清单以独立进程拉起。",
7
+ "components": [
8
+ "../../../../../packages/capyclaw-service-host",
9
+ "../../../../../packages/capyclaw-tool-host",
10
+ "../../../../../packages/capyclaw-asset-service"
11
+ ],
12
+ "packages": {
13
+ "@capyclaw/plugin-kit": {
14
+ "role": "support",
15
+ "version": "^0.2.2",
16
+ "path": "../../../../../packages/capyclaw-plugin-kit"
17
+ },
18
+ "@capyclaw/browser-workbench": {
19
+ "role": "runtime",
20
+ "version": "^0.1.0",
21
+ "path": "../capyclaw-browser-workbench",
22
+ "requires": {
23
+ "capabilities": {
24
+ "host.http": "^1.0.0",
25
+ "tools.registry": "^1.0.0",
26
+ "assets.store": "^1.0.0"
27
+ }
28
+ },
29
+ "provides": {
30
+ "tools": [
31
+ "browser_*"
32
+ ],
33
+ "services": [
34
+ "browser-workbench"
35
+ ],
36
+ "ports": [
37
+ 39315
38
+ ],
39
+ "capabilities": {
40
+ "browser.runtime": "1.0.0",
41
+ "browser.tools": "1.0.0"
42
+ }
43
+ }
44
+ },
45
+ "@capyclaw/browser-skill-browser": {
46
+ "role": "skills",
47
+ "version": "^0.1.0",
48
+ "path": "../capyclaw-browser-skill-browser",
49
+ "requires": {
50
+ "@capyclaw/browser-workbench": "^0.1.0",
51
+ "capabilities": {
52
+ "browser.runtime": "^1.0.0"
53
+ }
54
+ },
55
+ "provides": {
56
+ "skills": [
57
+ "browser"
58
+ ],
59
+ "capabilities": {
60
+ "browser.workflows": "1.0.0"
61
+ }
62
+ }
63
+ },
64
+ "@capyclaw/browser-skill-api": {
65
+ "role": "skills",
66
+ "version": "^0.1.0",
67
+ "path": "../capyclaw-browser-skill-api",
68
+ "requires": {
69
+ "@capyclaw/browser-workbench": "^0.1.0",
70
+ "capabilities": {
71
+ "browser.runtime": "^1.0.0"
72
+ }
73
+ },
74
+ "provides": {
75
+ "skills": [
76
+ "browser-api"
77
+ ],
78
+ "capabilities": {
79
+ "browser.workflows": "1.0.0"
80
+ }
81
+ }
82
+ },
83
+ "@capyclaw/browser-skill-ops": {
84
+ "role": "skills",
85
+ "version": "^0.1.0",
86
+ "path": "../capyclaw-browser-skill-ops",
87
+ "requires": {
88
+ "@capyclaw/browser-workbench": "^0.1.0",
89
+ "capabilities": {
90
+ "browser.runtime": "^1.0.0"
91
+ }
92
+ },
93
+ "provides": {
94
+ "skills": [
95
+ "browser-ops"
96
+ ],
97
+ "capabilities": {
98
+ "browser.workflows": "1.0.0"
99
+ }
100
+ }
101
+ },
102
+ "@capyclaw/service-broker": {
103
+ "role": "runtime",
104
+ "version": "^0.2.4",
105
+ "path": "../../../../../packages/capyclaw-service-broker",
106
+ "provides": {
107
+ "services": [
108
+ "serviceBroker"
109
+ ],
110
+ "ports": [],
111
+ "capabilities": {
112
+ "service.broker": "1.0.0"
113
+ }
114
+ }
115
+ }
116
+ },
117
+ "rows": [
118
+ {
119
+ "id": "mcp-browser",
120
+ "name": "@deepseek-ai/dsh-mcp-client",
121
+ "config": {
122
+ "serverName": "browser",
123
+ "transport": "streamable-http",
124
+ "url": "http://127.0.0.1:39315/mcp",
125
+ "failOnStartupError": false,
126
+ "toolCallTimeoutMs": 120000
127
+ }
128
+ },
129
+ {
130
+ "id": "browser-skill-browser",
131
+ "name": "@capyclaw/browser-skill-browser"
132
+ },
133
+ {
134
+ "id": "browser-skill-api",
135
+ "name": "@capyclaw/browser-skill-api"
136
+ },
137
+ {
138
+ "id": "browser-skill-ops",
139
+ "name": "@capyclaw/browser-skill-ops"
140
+ }
141
+ ],
142
+ "checks": [
143
+ {
144
+ "id": "browser-health",
145
+ "type": "http",
146
+ "url": "http://127.0.0.1:39315/healthz",
147
+ "expectStatus": 200,
148
+ "expectBody": {
149
+ "ok": true,
150
+ "contractsOk": true
151
+ },
152
+ "timeoutMs": 3000
153
+ },
154
+ {
155
+ "id": "browser-contract",
156
+ "type": "contract",
157
+ "url": "http://127.0.0.1:39315/mcp",
158
+ "tool": "browser_capabilities",
159
+ "major": 1,
160
+ "timeoutMs": 5000
161
+ }
162
+ ]
163
+ }
package/lib/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ /** capyclaw-browser-suite 是组合包:自身不注册服务,仅承载 cordis.patch.yml。 */
2
+ export const name = 'browser-suite'
3
+
4
+ export function apply() {
5
+ // 组合行由 cordis.patch.yml 插入;这里保持空实现,便于包结构校验与独立加载。
6
+ }
package/package.json CHANGED
@@ -1,6 +1,66 @@
1
1
  {
2
2
  "name": "@capyclaw/browser-suite",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.2",
4
+ "description": "浏览器操控工作台套件:workbench + 3 个独立 skill 包 + 公共基建插件,一键安装、锁定已验证版本。",
5
+ "type": "module",
6
+ "main": "./lib/index.mjs",
7
+ "exports": {
8
+ ".": "./lib/index.mjs",
9
+ "./package.json": "./package.json"
10
+ },
11
+ "engines": {
12
+ "node": ">=18",
13
+ "dsh": "^0.2.0-rc.2"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "dependencies": {
19
+ "@capyclaw/plugin-kit": "^0.2.0",
20
+ "@capyclaw/service-host": "^0.1.0",
21
+ "@capyclaw/tool-host": "^0.1.0",
22
+ "@capyclaw/asset-service": "^0.1.0",
23
+ "@capyclaw/service-broker": "^0.2.4",
24
+ "@capyclaw/browser-workbench": "^0.1.0",
25
+ "@capyclaw/browser-skill-browser": "^0.1.0",
26
+ "@capyclaw/browser-skill-api": "^0.1.0",
27
+ "@capyclaw/browser-skill-ops": "^0.1.0"
28
+ },
29
+ "dsh": {
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ },
33
+ "suite": "./dsh-suite.json",
34
+ "category": "service",
35
+ "platform": "both"
36
+ },
37
+ "meta": {
38
+ "title": "浏览器操控工作台套件",
39
+ "description": "一键安装浏览器操控运行时 + 3 个独立 skill 包 + 公共基建插件"
40
+ },
41
+ "files": [
42
+ "lib/",
43
+ "contract/",
44
+ "dsh-suite.json",
45
+ "composition.lock.json",
46
+ "cordis.patch.yml",
47
+ "README.md",
48
+ "services.json"
49
+ ],
50
+ "license": "MIT",
51
+ "scripts": {},
52
+ "author": {
53
+ "name": "CapyClaw",
54
+ "url": "https://github.com/capyclaw",
55
+ "email": "support@capyclaw.dev"
56
+ },
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/Maple496/capyclaw.git",
60
+ "directory": "extensions/bridges/browser-bridge/plugin/capyclaw-browser-suite"
61
+ },
62
+ "bugs": {
63
+ "url": "https://github.com/Maple496/capyclaw/issues"
64
+ },
65
+ "homepage": "https://github.com/capyclaw/dsh-plugins"
66
+ }
package/services.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "services": [
3
+ {
4
+ "id": "browser-workbench",
5
+ "portFrom": "content",
6
+ "dirFrom": "contentState",
7
+ "cmd": [
8
+ "node",
9
+ "${PACKAGE_DIR}/node_modules/@capyclaw/browser-workbench/server/relay.mjs",
10
+ "--port",
11
+ "${PORT}",
12
+ "--dir",
13
+ "${PACKAGE_DIR}/.host"
14
+ ],
15
+ "ports": {
16
+ "main": 39315
17
+ },
18
+ "url": "http://127.0.0.1:${PORT}",
19
+ "keepAlive": true,
20
+ "healthPath": "/healthz"
21
+ }
22
+ ]
23
+ }