@capyclaw/browser-workbench 0.0.0-stage → 0.1.19

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 (168) hide show
  1. package/README.md +88 -2
  2. package/contract/browser-contract.json +1349 -0
  3. package/demo/form.html +112 -0
  4. package/lib/host.mjs +1 -0
  5. package/node_modules/@capyclaw/asset-service/README.md +48 -0
  6. package/node_modules/@capyclaw/asset-service/cordis.patch.yml +4 -0
  7. package/node_modules/@capyclaw/asset-service/dsh-suite.json +29 -0
  8. package/node_modules/@capyclaw/asset-service/lib/host.mjs +14 -0
  9. package/node_modules/@capyclaw/asset-service/package.json +59 -0
  10. package/node_modules/@capyclaw/asset-service/src/index.mjs +304 -0
  11. package/node_modules/@capyclaw/document-workbench/README.md +125 -0
  12. package/node_modules/@capyclaw/document-workbench/package.json +44 -0
  13. package/node_modules/@capyclaw/document-workbench/src/bridge/index.mjs +321 -0
  14. package/node_modules/@capyclaw/document-workbench/src/client/index.mjs +625 -0
  15. package/node_modules/@capyclaw/document-workbench/src/client/screenshot.mjs +98 -0
  16. package/node_modules/@capyclaw/document-workbench/src/index.mjs +9 -0
  17. package/node_modules/@capyclaw/document-workbench/src/model/audit.mjs +101 -0
  18. package/node_modules/@capyclaw/document-workbench/src/model/conformance.mjs +92 -0
  19. package/node_modules/@capyclaw/document-workbench/src/model/ids.mjs +56 -0
  20. package/node_modules/@capyclaw/document-workbench/src/model/index.mjs +18 -0
  21. package/node_modules/@capyclaw/document-workbench/src/model/locate.mjs +118 -0
  22. package/node_modules/@capyclaw/document-workbench/src/model/manifest.mjs +148 -0
  23. package/node_modules/@capyclaw/document-workbench/src/model/ops.mjs +160 -0
  24. package/node_modules/@capyclaw/document-workbench/src/model/validate.mjs +72 -0
  25. package/node_modules/@capyclaw/document-workbench/src/ops/index.mjs +93 -0
  26. package/node_modules/@capyclaw/document-workbench/src/session/context.mjs +103 -0
  27. package/node_modules/@capyclaw/document-workbench/src/session/index.mjs +394 -0
  28. package/node_modules/@capyclaw/document-workbench/src/session/lease.mjs +105 -0
  29. package/node_modules/@capyclaw/document-workbench/src/session/mode.mjs +80 -0
  30. package/node_modules/@capyclaw/document-workbench/src/session/sanitize.mjs +107 -0
  31. package/node_modules/@capyclaw/document-workbench/src/session/state.mjs +159 -0
  32. package/node_modules/@capyclaw/document-workbench/src/session/watch.mjs +63 -0
  33. package/node_modules/@capyclaw/document-workbench/src/store/file-backend.mjs +158 -0
  34. package/node_modules/@capyclaw/document-workbench/src/testing/index.mjs +75 -0
  35. package/node_modules/@capyclaw/foundation/README.md +51 -0
  36. package/node_modules/@capyclaw/foundation/abi/bridge.mjs +86 -0
  37. package/node_modules/@capyclaw/foundation/abi/errors.mjs +63 -0
  38. package/node_modules/@capyclaw/foundation/abi/index.mjs +35 -0
  39. package/node_modules/@capyclaw/foundation/abi/kinds.mjs +271 -0
  40. package/node_modules/@capyclaw/foundation/abi/loader.mjs +345 -0
  41. package/node_modules/@capyclaw/foundation/abi/schema.mjs +98 -0
  42. package/node_modules/@capyclaw/foundation/abi/spec.mjs +255 -0
  43. package/node_modules/@capyclaw/foundation/abi/validate.mjs +24 -0
  44. package/node_modules/@capyclaw/foundation/abi/version.mjs +82 -0
  45. package/node_modules/@capyclaw/foundation/cordis.patch.yml +5 -0
  46. package/node_modules/@capyclaw/foundation/kit/index.mjs +6 -0
  47. package/node_modules/@capyclaw/foundation/lib/adapters/client-panel.mjs +98 -0
  48. package/node_modules/@capyclaw/foundation/lib/adapters/host-event.mjs +35 -0
  49. package/node_modules/@capyclaw/foundation/lib/adapters/http-router.mjs +69 -0
  50. package/node_modules/@capyclaw/foundation/lib/adapters/lifecycle-hook.mjs +55 -0
  51. package/node_modules/@capyclaw/foundation/lib/adapters/own-server.mjs +113 -0
  52. package/node_modules/@capyclaw/foundation/lib/adapters/raw.mjs +69 -0
  53. package/node_modules/@capyclaw/foundation/lib/adapters/runtime-driver.mjs +120 -0
  54. package/node_modules/@capyclaw/foundation/lib/adapters/service-provider.mjs +77 -0
  55. package/node_modules/@capyclaw/foundation/lib/adapters/skill-provider.mjs +56 -0
  56. package/node_modules/@capyclaw/foundation/lib/adapters/tool-provider.mjs +50 -0
  57. package/node_modules/@capyclaw/foundation/lib/adapters/ui-panel.mjs +64 -0
  58. package/node_modules/@capyclaw/foundation/lib/ctx-service.mjs +42 -0
  59. package/node_modules/@capyclaw/foundation/lib/host/caps.mjs +34 -0
  60. package/node_modules/@capyclaw/foundation/lib/host/contract.mjs +85 -0
  61. package/node_modules/@capyclaw/foundation/lib/host/dsh.mjs +50 -0
  62. package/node_modules/@capyclaw/foundation/lib/host/memory.mjs +160 -0
  63. package/node_modules/@capyclaw/foundation/lib/host.mjs +23 -0
  64. package/node_modules/@capyclaw/foundation/lib/kernel.mjs +185 -0
  65. package/node_modules/@capyclaw/foundation/lib/skill/scan.mjs +115 -0
  66. package/node_modules/@capyclaw/foundation/lib/subsystems/events.mjs +60 -0
  67. package/node_modules/@capyclaw/foundation/lib/subsystems/log.mjs +51 -0
  68. package/node_modules/@capyclaw/foundation/lib/subsystems/net.mjs +188 -0
  69. package/node_modules/@capyclaw/foundation/package.json +53 -0
  70. package/node_modules/@capyclaw/foundation/runtime/index.mjs +20 -0
  71. package/node_modules/@capyclaw/plugin-kit/INTEGRATION.md +100 -0
  72. package/node_modules/@capyclaw/plugin-kit/README.md +70 -0
  73. package/node_modules/@capyclaw/plugin-kit/bin/sync.mjs +103 -0
  74. package/node_modules/@capyclaw/plugin-kit/package.json +69 -0
  75. package/node_modules/@capyclaw/plugin-kit/src/cli.mjs +56 -0
  76. package/node_modules/@capyclaw/plugin-kit/src/config.mjs +142 -0
  77. package/node_modules/@capyclaw/plugin-kit/src/editor/heartbeat-worker.js +129 -0
  78. package/node_modules/@capyclaw/plugin-kit/src/editor/lease.mjs +58 -0
  79. package/node_modules/@capyclaw/plugin-kit/src/editor/shadow.mjs +219 -0
  80. package/node_modules/@capyclaw/plugin-kit/src/editor/transport.js +13 -0
  81. package/node_modules/@capyclaw/plugin-kit/src/index.mjs +13 -0
  82. package/node_modules/@capyclaw/plugin-kit/src/pack.mjs +230 -0
  83. package/node_modules/@capyclaw/plugin-kit/src/runtime/context.mjs +128 -0
  84. package/node_modules/@capyclaw/plugin-kit/src/self-contained.mjs +307 -0
  85. package/node_modules/@capyclaw/plugin-kit/src/service/api.mjs +45 -0
  86. package/node_modules/@capyclaw/plugin-kit/src/service/http.mjs +113 -0
  87. package/node_modules/@capyclaw/plugin-kit/src/service/mcp-http.mjs +150 -0
  88. package/node_modules/@capyclaw/plugin-kit/src/service/server.mjs +131 -0
  89. package/node_modules/@capyclaw/plugin-kit/src/skills/provider.mjs +82 -0
  90. package/node_modules/@capyclaw/plugin-kit/src/store/blob-store.mjs +109 -0
  91. package/node_modules/@capyclaw/plugin-kit/src/store/content-store.mjs +17 -0
  92. package/node_modules/@capyclaw/plugin-kit/src/store/journal-store.mjs +89 -0
  93. package/node_modules/@capyclaw/plugin-kit/src/tools/result.mjs +57 -0
  94. package/node_modules/@capyclaw/plugin-kit/src/tools/validate.mjs +150 -0
  95. package/node_modules/@capyclaw/plugin-kit/src/tuning.mjs +82 -0
  96. package/node_modules/@capyclaw/plugin-kit/src/util/fs-lock.mjs +132 -0
  97. package/node_modules/@capyclaw/plugin-kit/src/util/http.mjs +130 -0
  98. package/node_modules/@capyclaw/plugin-kit/src/workspace/manager.mjs +656 -0
  99. package/node_modules/@capyclaw/plugin-kit/src/zip.mjs +181 -0
  100. package/node_modules/@capyclaw/service-host/README.md +86 -0
  101. package/node_modules/@capyclaw/service-host/cordis.patch.yml +4 -0
  102. package/node_modules/@capyclaw/service-host/dsh-suite.json +29 -0
  103. package/node_modules/@capyclaw/service-host/lib/host.mjs +22 -0
  104. package/node_modules/@capyclaw/service-host/package.json +60 -0
  105. package/node_modules/@capyclaw/service-host/src/index.mjs +571 -0
  106. package/node_modules/@capyclaw/service-host/src/tuning.mjs +63 -0
  107. package/node_modules/@capyclaw/tool-host/README.md +56 -0
  108. package/node_modules/@capyclaw/tool-host/cordis.patch.yml +4 -0
  109. package/node_modules/@capyclaw/tool-host/dsh-suite.json +30 -0
  110. package/node_modules/@capyclaw/tool-host/lib/host.mjs +16 -0
  111. package/node_modules/@capyclaw/tool-host/package.json +59 -0
  112. package/node_modules/@capyclaw/tool-host/src/descriptors.mjs +166 -0
  113. package/node_modules/@capyclaw/tool-host/src/index.mjs +416 -0
  114. package/package.json +77 -4
  115. package/plugin.mjs +1 -0
  116. package/server/constants.mjs +16 -0
  117. package/server/contract-snapshots.mjs +81 -0
  118. package/server/contract.mjs +24 -0
  119. package/server/embedded-host.mjs +247 -0
  120. package/server/engine.mjs +2466 -0
  121. package/server/governor.mjs +189 -0
  122. package/server/http-utils.mjs +2 -0
  123. package/server/human.mjs +628 -0
  124. package/server/infra/http.mjs +2 -0
  125. package/server/infra/tuning.mjs +2 -0
  126. package/server/input.mjs +154 -0
  127. package/server/login-vault.mjs +109 -0
  128. package/server/mcp/handler.mjs +2 -0
  129. package/server/mcp/instructions.mjs +31 -0
  130. package/server/orphans.mjs +163 -0
  131. package/server/relay.mjs +198 -0
  132. package/server/routes/api.mjs +233 -0
  133. package/server/routes/assets.mjs +2 -0
  134. package/server/routes/mcp.mjs +17 -0
  135. package/server/routes/workbench.mjs +33 -0
  136. package/server/session-engines.mjs +223 -0
  137. package/server/shared/SHARED_MANIFEST.json +70 -0
  138. package/server/shared/asset-service.mjs +2 -0
  139. package/server/shared/editor-host.mjs +2 -0
  140. package/server/shared/kit/editor/lease.mjs +2 -0
  141. package/server/shared/kit/service/api.mjs +2 -0
  142. package/server/shared/kit/service/http.mjs +2 -0
  143. package/server/shared/kit/service/mcp-http.mjs +2 -0
  144. package/server/shared/kit/tools/validate.mjs +2 -0
  145. package/server/shared/kit/tuning.mjs +2 -0
  146. package/server/shared/kit/util/fs-lock.mjs +2 -0
  147. package/server/shared/service-host.mjs +2 -0
  148. package/server/shared/tool-host.mjs +2 -0
  149. package/server/shared/tuning.mjs +2 -0
  150. package/server/tools/capabilities/contract.mjs +55 -0
  151. package/server/tools/capabilities/evaluate.mjs +36 -0
  152. package/server/tools/capabilities/index.mjs +26 -0
  153. package/server/tools/capabilities/interaction.mjs +215 -0
  154. package/server/tools/capabilities/navigation.mjs +35 -0
  155. package/server/tools/capabilities/screenshot.mjs +50 -0
  156. package/server/tools/capabilities/session.mjs +81 -0
  157. package/server/tools/capabilities/snapshot.mjs +30 -0
  158. package/server/tools/capabilities/tabs.mjs +35 -0
  159. package/server/tools/index.mjs +12 -0
  160. package/server/tools/kernel/define.mjs +5 -0
  161. package/server/tools/kernel/output.mjs +30 -0
  162. package/server/tools/kernel/ports.mjs +59 -0
  163. package/server/tools/kernel/registry.mjs +17 -0
  164. package/server/tools.mjs +3 -0
  165. package/server/workbench-framework.mjs +305 -0
  166. package/ui/app.js +447 -0
  167. package/ui/index.html +46 -0
  168. package/ui/style.css +144 -0
@@ -0,0 +1,1349 @@
1
+ {
2
+ "contractVersion": "1.3.0",
3
+ "packageVersion": "0.1.19",
4
+ "toolCount": 18,
5
+ "tools": [
6
+ {
7
+ "name": "browser_capabilities",
8
+ "kind": "read",
9
+ "since": "1.0.0",
10
+ "capability": "contract",
11
+ "description": "返回工作台契约版本、工具清单、能力清单与引擎状态。skill 加载后先调用一次;工具缺失或 major 版本不一致时停止并提示升级。默认紧凑模式(只给名字/状态,省 token);需要能力描述与 tags 时传 detail=\"full\"。",
12
+ "inputSchema": {
13
+ "type": "object",
14
+ "properties": {
15
+ "detail": {
16
+ "type": "string",
17
+ "enum": [
18
+ "compact",
19
+ "full"
20
+ ],
21
+ "description": "报告详细度,默认 compact"
22
+ }
23
+ },
24
+ "additionalProperties": false
25
+ }
26
+ },
27
+ {
28
+ "name": "browser_navigate",
29
+ "kind": "write",
30
+ "since": "1.0.0",
31
+ "capability": "navigation",
32
+ "description": "打开网址(仅 http/https;URL 内嵌用户名密码会被拒绝)。首次调用会自动拉起浏览器(默认有头可见,登录态持久化)。返回新页面的元素快照,后续动作直接引用其中的 ref。导航超时会返回当前已渲染的快照并标注 [NAV_TIMEOUT],不是空错误。",
33
+ "inputSchema": {
34
+ "type": "object",
35
+ "properties": {
36
+ "url": {
37
+ "type": "string",
38
+ "maxLength": 2048,
39
+ "description": "目标网址,如 https://example.com/"
40
+ },
41
+ "tab": {
42
+ "type": "string",
43
+ "maxLength": 16,
44
+ "description": "在指定标签页打开(缺省=当前活动标签页;浏览器未启动时自动新建)"
45
+ }
46
+ },
47
+ "required": [
48
+ "url"
49
+ ],
50
+ "additionalProperties": false
51
+ }
52
+ },
53
+ {
54
+ "name": "browser_snapshot",
55
+ "kind": "read",
56
+ "since": "1.0.0",
57
+ "capability": "snapshot",
58
+ "description": "观察当前页面:返回可交互元素(链接/按钮/输入框/下拉…)与结构节点(标题/图片)的缩进文本树,每个元素带 ref=eN。click/fill/select 等动作只用 ref 定位;页面变化后 ref 会过期(报 STALE_SNAPSHOT),重新快照即可。",
59
+ "inputSchema": {
60
+ "type": "object",
61
+ "properties": {
62
+ "tab": {
63
+ "type": "string",
64
+ "maxLength": 16,
65
+ "description": "目标标签页 id(缺省=当前活动标签页)"
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ }
70
+ },
71
+ {
72
+ "name": "browser_click",
73
+ "kind": "write",
74
+ "since": "1.0.0",
75
+ "capability": "interaction",
76
+ "description": "点击元素。ref 来自最近一次快照(首选);快照里没有的元素(无 role 的 div 按钮等)用 selector 或 text 兜底。元素已变化时报 STALE_SNAPSHOT,重新快照后用新 ref。动作成功后返回新快照。",
77
+ "inputSchema": {
78
+ "type": "object",
79
+ "properties": {
80
+ "ref": {
81
+ "type": "string",
82
+ "maxLength": 16,
83
+ "description": "快照里的元素引用,如 e5(首选)"
84
+ },
85
+ "selector": {
86
+ "type": "string",
87
+ "maxLength": 300,
88
+ "description": "CSS 选择器兜底,如 .next-btn"
89
+ },
90
+ "text": {
91
+ "type": "string",
92
+ "maxLength": 120,
93
+ "description": "可见文案兜底,如「下一步」"
94
+ },
95
+ "tab": {
96
+ "type": "string",
97
+ "maxLength": 16,
98
+ "description": "目标标签页 id(缺省=当前活动标签页)"
99
+ }
100
+ },
101
+ "additionalProperties": false
102
+ }
103
+ },
104
+ {
105
+ "name": "browser_drag",
106
+ "kind": "write",
107
+ "since": "1.2.0",
108
+ "capability": "interaction",
109
+ "description": "拖拽:滑块验证、拖放排序。起点可以给 ref / selector / text;终点给 toRef / toSelector / toText,或直接用 dx/dy 相对位移(滑块常用 dx)。内部按多步轨迹移动再松手,比一步到位更像人。成功后返回新快照。",
110
+ "inputSchema": {
111
+ "type": "object",
112
+ "properties": {
113
+ "ref": {
114
+ "type": "string",
115
+ "maxLength": 16,
116
+ "description": "起点 ref(首选)"
117
+ },
118
+ "selector": {
119
+ "type": "string",
120
+ "maxLength": 300,
121
+ "description": "起点 CSS 选择器兜底"
122
+ },
123
+ "text": {
124
+ "type": "string",
125
+ "maxLength": 120,
126
+ "description": "起点可见文案兜底"
127
+ },
128
+ "toRef": {
129
+ "type": "string",
130
+ "maxLength": 16,
131
+ "description": "终点 ref"
132
+ },
133
+ "toSelector": {
134
+ "type": "string",
135
+ "maxLength": 300,
136
+ "description": "终点 CSS 选择器"
137
+ },
138
+ "toText": {
139
+ "type": "string",
140
+ "maxLength": 120,
141
+ "description": "终点可见文案"
142
+ },
143
+ "dx": {
144
+ "type": "number",
145
+ "description": "相对起点的横向位移(滑块向右为正)"
146
+ },
147
+ "dy": {
148
+ "type": "number",
149
+ "description": "相对起点的纵向位移"
150
+ },
151
+ "steps": {
152
+ "type": "number",
153
+ "description": "轨迹分几步(默认 24,越大越平滑)"
154
+ },
155
+ "tab": {
156
+ "type": "string",
157
+ "maxLength": 16,
158
+ "description": "目标标签页 id(缺省=当前活动标签页)"
159
+ }
160
+ },
161
+ "additionalProperties": false
162
+ }
163
+ },
164
+ {
165
+ "name": "browser_fill",
166
+ "kind": "write",
167
+ "since": "1.0.0",
168
+ "capability": "interaction",
169
+ "description": "在输入框/文本域填写文字(整体替换,兼容 React/Vue 受控输入)。submit=true 时填写后按回车提交。密码框会被快照掩码显示,但填写不受影响。",
170
+ "inputSchema": {
171
+ "type": "object",
172
+ "properties": {
173
+ "ref": {
174
+ "type": "string",
175
+ "maxLength": 16,
176
+ "description": "目标输入框的 ref"
177
+ },
178
+ "text": {
179
+ "type": "string",
180
+ "maxLength": 10000,
181
+ "description": "要填入的文字(空字符串=清空)"
182
+ },
183
+ "submit": {
184
+ "type": "boolean",
185
+ "description": "填写后按 Enter 提交(默认 false)"
186
+ },
187
+ "tab": {
188
+ "type": "string",
189
+ "maxLength": 16,
190
+ "description": "目标标签页 id(缺省=当前活动标签页)"
191
+ }
192
+ },
193
+ "required": [
194
+ "ref",
195
+ "text"
196
+ ],
197
+ "additionalProperties": false
198
+ }
199
+ },
200
+ {
201
+ "name": "browser_press",
202
+ "kind": "write",
203
+ "since": "1.0.0",
204
+ "capability": "interaction",
205
+ "description": "按键。给 ref 时在指定元素上按(如输入框内 Enter),不给 ref 时对当前页面按(如 Tab / Escape / Control+a)。",
206
+ "inputSchema": {
207
+ "type": "object",
208
+ "properties": {
209
+ "key": {
210
+ "type": "string",
211
+ "maxLength": 40,
212
+ "description": "键名:Enter / Tab / Escape / ArrowDown / Control+a 等(Playwright 键名)"
213
+ },
214
+ "ref": {
215
+ "type": "string",
216
+ "maxLength": 16,
217
+ "description": "目标元素 ref(缺省=页面级按键)"
218
+ },
219
+ "tab": {
220
+ "type": "string",
221
+ "maxLength": 16,
222
+ "description": "目标标签页 id(缺省=当前活动标签页)"
223
+ }
224
+ },
225
+ "required": [
226
+ "key"
227
+ ],
228
+ "additionalProperties": false
229
+ }
230
+ },
231
+ {
232
+ "name": "browser_select",
233
+ "kind": "write",
234
+ "since": "1.0.0",
235
+ "capability": "interaction",
236
+ "description": "选择下拉框(select)的选项。value 先按 <option value> 匹配,失败自动按选项文本匹配。",
237
+ "inputSchema": {
238
+ "type": "object",
239
+ "properties": {
240
+ "ref": {
241
+ "type": "string",
242
+ "maxLength": 16,
243
+ "description": "目标下拉框的 ref"
244
+ },
245
+ "value": {
246
+ "type": "string",
247
+ "maxLength": 300,
248
+ "description": "选项的 value 或可见文本"
249
+ },
250
+ "tab": {
251
+ "type": "string",
252
+ "maxLength": 16,
253
+ "description": "目标标签页 id(缺省=当前活动标签页)"
254
+ }
255
+ },
256
+ "required": [
257
+ "ref",
258
+ "value"
259
+ ],
260
+ "additionalProperties": false
261
+ }
262
+ },
263
+ {
264
+ "name": "browser_upload",
265
+ "kind": "write",
266
+ "since": "1.3.0",
267
+ "capability": "interaction",
268
+ "description": "给文件上传控件(<input type=\"file\">)设置本机文件。ref/selector 定位上传控件;files 是本机绝对路径数组(可多选),空数组=清空已选。闭环里 ppt 等套件产出的文件先物化成本机路径再传这里。成功后返回新快照。",
269
+ "inputSchema": {
270
+ "type": "object",
271
+ "properties": {
272
+ "ref": {
273
+ "type": "string",
274
+ "maxLength": 16,
275
+ "description": "上传控件的 ref(首选)"
276
+ },
277
+ "selector": {
278
+ "type": "string",
279
+ "maxLength": 300,
280
+ "description": "CSS 选择器兜底,如 input[type=file]"
281
+ },
282
+ "files": {
283
+ "type": "array",
284
+ "items": {
285
+ "type": "string",
286
+ "maxLength": 1000
287
+ },
288
+ "maxItems": 20,
289
+ "description": "本机绝对路径数组;空数组=清空已选"
290
+ },
291
+ "tab": {
292
+ "type": "string",
293
+ "maxLength": 16,
294
+ "description": "目标标签页 id(缺省=当前活动标签页)"
295
+ }
296
+ },
297
+ "required": [
298
+ "files"
299
+ ],
300
+ "additionalProperties": false
301
+ }
302
+ },
303
+ {
304
+ "name": "browser_scroll",
305
+ "kind": "write",
306
+ "since": "1.0.0",
307
+ "capability": "interaction",
308
+ "description": "滚动当前页面(默认向下 600px)。懒加载页面翻内容用它。",
309
+ "inputSchema": {
310
+ "type": "object",
311
+ "properties": {
312
+ "direction": {
313
+ "type": "string",
314
+ "enum": [
315
+ "up",
316
+ "down"
317
+ ],
318
+ "description": "方向(默认 down)"
319
+ },
320
+ "amount": {
321
+ "type": "number",
322
+ "description": "像素数(默认 600)"
323
+ },
324
+ "tab": {
325
+ "type": "string",
326
+ "maxLength": 16,
327
+ "description": "目标标签页 id(缺省=当前活动标签页)"
328
+ }
329
+ },
330
+ "additionalProperties": false
331
+ }
332
+ },
333
+ {
334
+ "name": "browser_act",
335
+ "kind": "write",
336
+ "since": "1.1.0",
337
+ "capability": "interaction",
338
+ "description": "把同一页面上多个不跳转的动作打包成一次调用(最多 10 步),只返回一份最终快照——替代「一步一次往返」,每条消息省下多次模型往返。典型:填账号 + 填密码 + 勾选协议 + 选城市 + 拖滑块。注意:会跳转或整页重排的动作(提交、下单、翻页)放最后一步或单独调用;中途不重拍快照,ref 沿用打包前的快照。失败会停在该步并给出原因,仍返回最新快照。",
339
+ "inputSchema": {
340
+ "type": "object",
341
+ "properties": {
342
+ "steps": {
343
+ "type": "array",
344
+ "maxItems": 10,
345
+ "description": "按顺序执行的动作列表",
346
+ "items": {
347
+ "type": "object",
348
+ "properties": {
349
+ "op": {
350
+ "type": "string",
351
+ "enum": [
352
+ "click",
353
+ "fill",
354
+ "press",
355
+ "select",
356
+ "drag",
357
+ "scroll",
358
+ "wait"
359
+ ],
360
+ "description": "动作类型"
361
+ },
362
+ "ref": {
363
+ "type": "string",
364
+ "maxLength": 16,
365
+ "description": "目标 ref(click/fill/press/select/drag 的起点)"
366
+ },
367
+ "selector": {
368
+ "type": "string",
369
+ "maxLength": 300,
370
+ "description": "click/fill/press 的 CSS 兜底;wait 时是等待的选择器"
371
+ },
372
+ "text": {
373
+ "type": "string",
374
+ "maxLength": 10000,
375
+ "description": "fill 的文字;click 时是目标文案"
376
+ },
377
+ "submit": {
378
+ "type": "boolean",
379
+ "description": "fill 之后回车提交"
380
+ },
381
+ "key": {
382
+ "type": "string",
383
+ "maxLength": 40,
384
+ "description": "press 的键名,如 Enter / Tab"
385
+ },
386
+ "value": {
387
+ "type": "string",
388
+ "maxLength": 300,
389
+ "description": "select 的选项 value 或文本"
390
+ },
391
+ "toRef": {
392
+ "type": "string",
393
+ "maxLength": 16,
394
+ "description": "drag 的终点 ref"
395
+ },
396
+ "toSelector": {
397
+ "type": "string",
398
+ "maxLength": 300,
399
+ "description": "drag 的终点选择器"
400
+ },
401
+ "dx": {
402
+ "type": "number",
403
+ "description": "drag 的相对横向位移(滑块向右为正)"
404
+ },
405
+ "dy": {
406
+ "type": "number",
407
+ "description": "drag 的相对纵向位移"
408
+ },
409
+ "direction": {
410
+ "type": "string",
411
+ "enum": [
412
+ "up",
413
+ "down"
414
+ ],
415
+ "description": "scroll 方向"
416
+ },
417
+ "amount": {
418
+ "type": "number",
419
+ "description": "scroll 像素数(默认 600)"
420
+ },
421
+ "ms": {
422
+ "type": "number",
423
+ "description": "wait 毫秒数"
424
+ }
425
+ },
426
+ "required": [
427
+ "op"
428
+ ],
429
+ "additionalProperties": false
430
+ }
431
+ },
432
+ "stopOnError": {
433
+ "type": "boolean",
434
+ "description": "某步失败后是否停止(默认 true)"
435
+ },
436
+ "tab": {
437
+ "type": "string",
438
+ "maxLength": 16,
439
+ "description": "目标标签页 id(缺省=当前活动标签页)"
440
+ }
441
+ },
442
+ "required": [
443
+ "steps"
444
+ ],
445
+ "additionalProperties": false
446
+ }
447
+ },
448
+ {
449
+ "name": "browser_tabs",
450
+ "kind": "control",
451
+ "since": "1.0.0",
452
+ "capability": "tabs",
453
+ "description": "标签页四合一:action=list 列出(含稳定 id 与当前地址);new 打开新标签页(可带 url);select 切换活动标签页;close 关闭。后续动作默认作用于活动标签页,也可用 tab 参数显式指定。",
454
+ "inputSchema": {
455
+ "type": "object",
456
+ "properties": {
457
+ "action": {
458
+ "type": "string",
459
+ "enum": [
460
+ "list",
461
+ "new",
462
+ "select",
463
+ "close"
464
+ ],
465
+ "description": "动作(默认 list)"
466
+ },
467
+ "url": {
468
+ "type": "string",
469
+ "maxLength": 2048,
470
+ "description": "new 动作要打开的网址"
471
+ },
472
+ "tab": {
473
+ "type": "string",
474
+ "maxLength": 16,
475
+ "description": "select/close 的目标标签页 id"
476
+ }
477
+ },
478
+ "additionalProperties": false
479
+ }
480
+ },
481
+ {
482
+ "name": "browser_screenshot",
483
+ "kind": "read",
484
+ "since": "1.0.0",
485
+ "capability": "screenshot",
486
+ "description": "当前页面截图,图片直接返回给你看(PNG,同时落盘并给出路径);不要再调 read_image 去读它。默认视口截图;fullPage=true 截整页。工作台地址可实时观察页面。",
487
+ "inputSchema": {
488
+ "type": "object",
489
+ "properties": {
490
+ "fullPage": {
491
+ "type": "boolean",
492
+ "description": "是否截取整页(默认 false)"
493
+ },
494
+ "tab": {
495
+ "type": "string",
496
+ "maxLength": 16,
497
+ "description": "目标标签页 id(缺省=当前活动标签页)"
498
+ }
499
+ },
500
+ "additionalProperties": false
501
+ }
502
+ },
503
+ {
504
+ "name": "browser_status",
505
+ "kind": "read",
506
+ "since": "1.0.0",
507
+ "capability": "session",
508
+ "description": "引擎状态:是否运行、有头/无头、标签页清单(id+地址)、累计动作数、最近动作日志。不确定浏览器是否还活着时先看它。",
509
+ "inputSchema": {
510
+ "type": "object",
511
+ "properties": {},
512
+ "additionalProperties": false
513
+ }
514
+ },
515
+ {
516
+ "name": "browser_wait",
517
+ "kind": "control",
518
+ "since": "1.0.0",
519
+ "capability": "session",
520
+ "description": "等待指定条件后返回**等待后的新快照**(不用再单独 browser_snapshot)。selector=等元素出现(首选,如 .result),ms=固定毫秒(上限 30000),都不给=等页面 load 完成。",
521
+ "inputSchema": {
522
+ "type": "object",
523
+ "properties": {
524
+ "ms": {
525
+ "type": "number",
526
+ "description": "等待毫秒数(上限 30000)"
527
+ },
528
+ "selector": {
529
+ "type": "string",
530
+ "maxLength": 300,
531
+ "description": "等待出现的 CSS 选择器"
532
+ },
533
+ "tab": {
534
+ "type": "string",
535
+ "maxLength": 16,
536
+ "description": "目标标签页 id(缺省=当前活动标签页)"
537
+ }
538
+ },
539
+ "additionalProperties": false
540
+ }
541
+ },
542
+ {
543
+ "name": "browser_history",
544
+ "kind": "control",
545
+ "since": "1.0.0",
546
+ "capability": "session",
547
+ "description": "浏览历史:back 后退 / forward 前进 / reload 重载。返回操作后的新快照。",
548
+ "inputSchema": {
549
+ "type": "object",
550
+ "properties": {
551
+ "action": {
552
+ "type": "string",
553
+ "enum": [
554
+ "back",
555
+ "forward",
556
+ "reload"
557
+ ],
558
+ "description": "动作(默认 back)"
559
+ },
560
+ "tab": {
561
+ "type": "string",
562
+ "maxLength": 16,
563
+ "description": "目标标签页 id(缺省=当前活动标签页)"
564
+ }
565
+ },
566
+ "additionalProperties": false
567
+ }
568
+ },
569
+ {
570
+ "name": "browser_close",
571
+ "kind": "control",
572
+ "since": "1.0.0",
573
+ "capability": "session",
574
+ "description": "关闭浏览器(所有标签页)并清空标签页记录——这是一次显式重置:登录态保留在 profile,但下次 navigate 是干净浏览器(不恢复旧标签)。空闲回收/服务重启则会自动恢复上次标签页。任务结束或页面卡死时用它重置。",
575
+ "inputSchema": {
576
+ "type": "object",
577
+ "properties": {},
578
+ "additionalProperties": false
579
+ }
580
+ },
581
+ {
582
+ "name": "browser_evaluate",
583
+ "kind": "write",
584
+ "since": "1.0.0",
585
+ "capability": "evaluate",
586
+ "description": "在页面里执行 JS 表达式并返回结果。默认关闭(安全默认);关闭时返回 NOT_IMPLEMENTED 与开启方法。优先用快照+ref 完成任务,本工具留给快照覆盖不了的场景。",
587
+ "inputSchema": {
588
+ "type": "object",
589
+ "properties": {
590
+ "script": {
591
+ "type": "string",
592
+ "maxLength": 20000,
593
+ "description": "JS 表达式(如 document.title)"
594
+ },
595
+ "tab": {
596
+ "type": "string",
597
+ "maxLength": 16,
598
+ "description": "目标标签页 id(缺省=当前活动标签页)"
599
+ }
600
+ },
601
+ "required": [
602
+ "script"
603
+ ],
604
+ "additionalProperties": false
605
+ }
606
+ }
607
+ ],
608
+ "features": [
609
+ "browser.contract",
610
+ "browser.navigation",
611
+ "browser.snapshot",
612
+ "browser.interaction",
613
+ "browser.tabs",
614
+ "browser.screenshot",
615
+ "browser.session",
616
+ "browser.evaluate"
617
+ ],
618
+ "capabilities": [
619
+ {
620
+ "id": "contract",
621
+ "title": "契约探测",
622
+ "description": "",
623
+ "tags": [
624
+ "meta"
625
+ ],
626
+ "requires": [
627
+ "engine",
628
+ "server"
629
+ ],
630
+ "dependsOn": [],
631
+ "provides": {},
632
+ "features": [
633
+ "browser.contract"
634
+ ],
635
+ "tools": [
636
+ {
637
+ "name": "browser_capabilities",
638
+ "description": "返回工作台契约版本、工具清单、能力清单与引擎状态。skill 加载后先调用一次;工具缺失或 major 版本不一致时停止并提示升级。默认紧凑模式(只给名字/状态,省 token);需要能力描述与 tags 时传 detail=\"full\"。",
639
+ "inputSchema": {
640
+ "type": "object",
641
+ "properties": {
642
+ "detail": {
643
+ "type": "string",
644
+ "enum": [
645
+ "compact",
646
+ "full"
647
+ ],
648
+ "description": "报告详细度,默认 compact"
649
+ }
650
+ },
651
+ "additionalProperties": false
652
+ },
653
+ "kind": "read",
654
+ "since": "1.0.0"
655
+ }
656
+ ]
657
+ },
658
+ {
659
+ "id": "navigation",
660
+ "title": "导航",
661
+ "description": "",
662
+ "tags": [
663
+ "core"
664
+ ],
665
+ "requires": [
666
+ "engine"
667
+ ],
668
+ "dependsOn": [],
669
+ "provides": {},
670
+ "features": [
671
+ "browser.navigation"
672
+ ],
673
+ "tools": [
674
+ {
675
+ "name": "browser_navigate",
676
+ "description": "打开网址(仅 http/https;URL 内嵌用户名密码会被拒绝)。首次调用会自动拉起浏览器(默认有头可见,登录态持久化)。返回新页面的元素快照,后续动作直接引用其中的 ref。导航超时会返回当前已渲染的快照并标注 [NAV_TIMEOUT],不是空错误。",
677
+ "inputSchema": {
678
+ "type": "object",
679
+ "properties": {
680
+ "url": {
681
+ "type": "string",
682
+ "maxLength": 2048,
683
+ "description": "目标网址,如 https://example.com/"
684
+ },
685
+ "tab": {
686
+ "type": "string",
687
+ "maxLength": 16,
688
+ "description": "在指定标签页打开(缺省=当前活动标签页;浏览器未启动时自动新建)"
689
+ }
690
+ },
691
+ "required": [
692
+ "url"
693
+ ],
694
+ "additionalProperties": false
695
+ },
696
+ "kind": "write",
697
+ "since": "1.0.0"
698
+ }
699
+ ]
700
+ },
701
+ {
702
+ "id": "snapshot",
703
+ "title": "页面快照",
704
+ "description": "",
705
+ "tags": [
706
+ "core"
707
+ ],
708
+ "requires": [
709
+ "engine"
710
+ ],
711
+ "dependsOn": [],
712
+ "provides": {},
713
+ "features": [
714
+ "browser.snapshot"
715
+ ],
716
+ "tools": [
717
+ {
718
+ "name": "browser_snapshot",
719
+ "description": "观察当前页面:返回可交互元素(链接/按钮/输入框/下拉…)与结构节点(标题/图片)的缩进文本树,每个元素带 ref=eN。click/fill/select 等动作只用 ref 定位;页面变化后 ref 会过期(报 STALE_SNAPSHOT),重新快照即可。",
720
+ "inputSchema": {
721
+ "type": "object",
722
+ "properties": {
723
+ "tab": {
724
+ "type": "string",
725
+ "maxLength": 16,
726
+ "description": "目标标签页 id(缺省=当前活动标签页)"
727
+ }
728
+ },
729
+ "additionalProperties": false
730
+ },
731
+ "kind": "read",
732
+ "since": "1.0.0"
733
+ }
734
+ ]
735
+ },
736
+ {
737
+ "id": "interaction",
738
+ "title": "页面交互",
739
+ "description": "",
740
+ "tags": [
741
+ "core"
742
+ ],
743
+ "requires": [
744
+ "engine"
745
+ ],
746
+ "dependsOn": [],
747
+ "provides": {},
748
+ "features": [
749
+ "browser.interaction"
750
+ ],
751
+ "tools": [
752
+ {
753
+ "name": "browser_click",
754
+ "description": "点击元素。ref 来自最近一次快照(首选);快照里没有的元素(无 role 的 div 按钮等)用 selector 或 text 兜底。元素已变化时报 STALE_SNAPSHOT,重新快照后用新 ref。动作成功后返回新快照。",
755
+ "inputSchema": {
756
+ "type": "object",
757
+ "properties": {
758
+ "ref": {
759
+ "type": "string",
760
+ "maxLength": 16,
761
+ "description": "快照里的元素引用,如 e5(首选)"
762
+ },
763
+ "selector": {
764
+ "type": "string",
765
+ "maxLength": 300,
766
+ "description": "CSS 选择器兜底,如 .next-btn"
767
+ },
768
+ "text": {
769
+ "type": "string",
770
+ "maxLength": 120,
771
+ "description": "可见文案兜底,如「下一步」"
772
+ },
773
+ "tab": {
774
+ "type": "string",
775
+ "maxLength": 16,
776
+ "description": "目标标签页 id(缺省=当前活动标签页)"
777
+ }
778
+ },
779
+ "additionalProperties": false
780
+ },
781
+ "kind": "write",
782
+ "since": "1.0.0"
783
+ },
784
+ {
785
+ "name": "browser_drag",
786
+ "description": "拖拽:滑块验证、拖放排序。起点可以给 ref / selector / text;终点给 toRef / toSelector / toText,或直接用 dx/dy 相对位移(滑块常用 dx)。内部按多步轨迹移动再松手,比一步到位更像人。成功后返回新快照。",
787
+ "inputSchema": {
788
+ "type": "object",
789
+ "properties": {
790
+ "ref": {
791
+ "type": "string",
792
+ "maxLength": 16,
793
+ "description": "起点 ref(首选)"
794
+ },
795
+ "selector": {
796
+ "type": "string",
797
+ "maxLength": 300,
798
+ "description": "起点 CSS 选择器兜底"
799
+ },
800
+ "text": {
801
+ "type": "string",
802
+ "maxLength": 120,
803
+ "description": "起点可见文案兜底"
804
+ },
805
+ "toRef": {
806
+ "type": "string",
807
+ "maxLength": 16,
808
+ "description": "终点 ref"
809
+ },
810
+ "toSelector": {
811
+ "type": "string",
812
+ "maxLength": 300,
813
+ "description": "终点 CSS 选择器"
814
+ },
815
+ "toText": {
816
+ "type": "string",
817
+ "maxLength": 120,
818
+ "description": "终点可见文案"
819
+ },
820
+ "dx": {
821
+ "type": "number",
822
+ "description": "相对起点的横向位移(滑块向右为正)"
823
+ },
824
+ "dy": {
825
+ "type": "number",
826
+ "description": "相对起点的纵向位移"
827
+ },
828
+ "steps": {
829
+ "type": "number",
830
+ "description": "轨迹分几步(默认 24,越大越平滑)"
831
+ },
832
+ "tab": {
833
+ "type": "string",
834
+ "maxLength": 16,
835
+ "description": "目标标签页 id(缺省=当前活动标签页)"
836
+ }
837
+ },
838
+ "additionalProperties": false
839
+ },
840
+ "kind": "write",
841
+ "since": "1.2.0"
842
+ },
843
+ {
844
+ "name": "browser_fill",
845
+ "description": "在输入框/文本域填写文字(整体替换,兼容 React/Vue 受控输入)。submit=true 时填写后按回车提交。密码框会被快照掩码显示,但填写不受影响。",
846
+ "inputSchema": {
847
+ "type": "object",
848
+ "properties": {
849
+ "ref": {
850
+ "type": "string",
851
+ "maxLength": 16,
852
+ "description": "目标输入框的 ref"
853
+ },
854
+ "text": {
855
+ "type": "string",
856
+ "maxLength": 10000,
857
+ "description": "要填入的文字(空字符串=清空)"
858
+ },
859
+ "submit": {
860
+ "type": "boolean",
861
+ "description": "填写后按 Enter 提交(默认 false)"
862
+ },
863
+ "tab": {
864
+ "type": "string",
865
+ "maxLength": 16,
866
+ "description": "目标标签页 id(缺省=当前活动标签页)"
867
+ }
868
+ },
869
+ "required": [
870
+ "ref",
871
+ "text"
872
+ ],
873
+ "additionalProperties": false
874
+ },
875
+ "kind": "write",
876
+ "since": "1.0.0"
877
+ },
878
+ {
879
+ "name": "browser_press",
880
+ "description": "按键。给 ref 时在指定元素上按(如输入框内 Enter),不给 ref 时对当前页面按(如 Tab / Escape / Control+a)。",
881
+ "inputSchema": {
882
+ "type": "object",
883
+ "properties": {
884
+ "key": {
885
+ "type": "string",
886
+ "maxLength": 40,
887
+ "description": "键名:Enter / Tab / Escape / ArrowDown / Control+a 等(Playwright 键名)"
888
+ },
889
+ "ref": {
890
+ "type": "string",
891
+ "maxLength": 16,
892
+ "description": "目标元素 ref(缺省=页面级按键)"
893
+ },
894
+ "tab": {
895
+ "type": "string",
896
+ "maxLength": 16,
897
+ "description": "目标标签页 id(缺省=当前活动标签页)"
898
+ }
899
+ },
900
+ "required": [
901
+ "key"
902
+ ],
903
+ "additionalProperties": false
904
+ },
905
+ "kind": "write",
906
+ "since": "1.0.0"
907
+ },
908
+ {
909
+ "name": "browser_select",
910
+ "description": "选择下拉框(select)的选项。value 先按 <option value> 匹配,失败自动按选项文本匹配。",
911
+ "inputSchema": {
912
+ "type": "object",
913
+ "properties": {
914
+ "ref": {
915
+ "type": "string",
916
+ "maxLength": 16,
917
+ "description": "目标下拉框的 ref"
918
+ },
919
+ "value": {
920
+ "type": "string",
921
+ "maxLength": 300,
922
+ "description": "选项的 value 或可见文本"
923
+ },
924
+ "tab": {
925
+ "type": "string",
926
+ "maxLength": 16,
927
+ "description": "目标标签页 id(缺省=当前活动标签页)"
928
+ }
929
+ },
930
+ "required": [
931
+ "ref",
932
+ "value"
933
+ ],
934
+ "additionalProperties": false
935
+ },
936
+ "kind": "write",
937
+ "since": "1.0.0"
938
+ },
939
+ {
940
+ "name": "browser_upload",
941
+ "description": "给文件上传控件(<input type=\"file\">)设置本机文件。ref/selector 定位上传控件;files 是本机绝对路径数组(可多选),空数组=清空已选。闭环里 ppt 等套件产出的文件先物化成本机路径再传这里。成功后返回新快照。",
942
+ "inputSchema": {
943
+ "type": "object",
944
+ "properties": {
945
+ "ref": {
946
+ "type": "string",
947
+ "maxLength": 16,
948
+ "description": "上传控件的 ref(首选)"
949
+ },
950
+ "selector": {
951
+ "type": "string",
952
+ "maxLength": 300,
953
+ "description": "CSS 选择器兜底,如 input[type=file]"
954
+ },
955
+ "files": {
956
+ "type": "array",
957
+ "items": {
958
+ "type": "string",
959
+ "maxLength": 1000
960
+ },
961
+ "maxItems": 20,
962
+ "description": "本机绝对路径数组;空数组=清空已选"
963
+ },
964
+ "tab": {
965
+ "type": "string",
966
+ "maxLength": 16,
967
+ "description": "目标标签页 id(缺省=当前活动标签页)"
968
+ }
969
+ },
970
+ "required": [
971
+ "files"
972
+ ],
973
+ "additionalProperties": false
974
+ },
975
+ "kind": "write",
976
+ "since": "1.3.0"
977
+ },
978
+ {
979
+ "name": "browser_scroll",
980
+ "description": "滚动当前页面(默认向下 600px)。懒加载页面翻内容用它。",
981
+ "inputSchema": {
982
+ "type": "object",
983
+ "properties": {
984
+ "direction": {
985
+ "type": "string",
986
+ "enum": [
987
+ "up",
988
+ "down"
989
+ ],
990
+ "description": "方向(默认 down)"
991
+ },
992
+ "amount": {
993
+ "type": "number",
994
+ "description": "像素数(默认 600)"
995
+ },
996
+ "tab": {
997
+ "type": "string",
998
+ "maxLength": 16,
999
+ "description": "目标标签页 id(缺省=当前活动标签页)"
1000
+ }
1001
+ },
1002
+ "additionalProperties": false
1003
+ },
1004
+ "kind": "write",
1005
+ "since": "1.0.0"
1006
+ },
1007
+ {
1008
+ "name": "browser_act",
1009
+ "description": "把同一页面上多个不跳转的动作打包成一次调用(最多 10 步),只返回一份最终快照——替代「一步一次往返」,每条消息省下多次模型往返。典型:填账号 + 填密码 + 勾选协议 + 选城市 + 拖滑块。注意:会跳转或整页重排的动作(提交、下单、翻页)放最后一步或单独调用;中途不重拍快照,ref 沿用打包前的快照。失败会停在该步并给出原因,仍返回最新快照。",
1010
+ "inputSchema": {
1011
+ "type": "object",
1012
+ "properties": {
1013
+ "steps": {
1014
+ "type": "array",
1015
+ "maxItems": 10,
1016
+ "description": "按顺序执行的动作列表",
1017
+ "items": {
1018
+ "type": "object",
1019
+ "properties": {
1020
+ "op": {
1021
+ "type": "string",
1022
+ "enum": [
1023
+ "click",
1024
+ "fill",
1025
+ "press",
1026
+ "select",
1027
+ "drag",
1028
+ "scroll",
1029
+ "wait"
1030
+ ],
1031
+ "description": "动作类型"
1032
+ },
1033
+ "ref": {
1034
+ "type": "string",
1035
+ "maxLength": 16,
1036
+ "description": "目标 ref(click/fill/press/select/drag 的起点)"
1037
+ },
1038
+ "selector": {
1039
+ "type": "string",
1040
+ "maxLength": 300,
1041
+ "description": "click/fill/press 的 CSS 兜底;wait 时是等待的选择器"
1042
+ },
1043
+ "text": {
1044
+ "type": "string",
1045
+ "maxLength": 10000,
1046
+ "description": "fill 的文字;click 时是目标文案"
1047
+ },
1048
+ "submit": {
1049
+ "type": "boolean",
1050
+ "description": "fill 之后回车提交"
1051
+ },
1052
+ "key": {
1053
+ "type": "string",
1054
+ "maxLength": 40,
1055
+ "description": "press 的键名,如 Enter / Tab"
1056
+ },
1057
+ "value": {
1058
+ "type": "string",
1059
+ "maxLength": 300,
1060
+ "description": "select 的选项 value 或文本"
1061
+ },
1062
+ "toRef": {
1063
+ "type": "string",
1064
+ "maxLength": 16,
1065
+ "description": "drag 的终点 ref"
1066
+ },
1067
+ "toSelector": {
1068
+ "type": "string",
1069
+ "maxLength": 300,
1070
+ "description": "drag 的终点选择器"
1071
+ },
1072
+ "dx": {
1073
+ "type": "number",
1074
+ "description": "drag 的相对横向位移(滑块向右为正)"
1075
+ },
1076
+ "dy": {
1077
+ "type": "number",
1078
+ "description": "drag 的相对纵向位移"
1079
+ },
1080
+ "direction": {
1081
+ "type": "string",
1082
+ "enum": [
1083
+ "up",
1084
+ "down"
1085
+ ],
1086
+ "description": "scroll 方向"
1087
+ },
1088
+ "amount": {
1089
+ "type": "number",
1090
+ "description": "scroll 像素数(默认 600)"
1091
+ },
1092
+ "ms": {
1093
+ "type": "number",
1094
+ "description": "wait 毫秒数"
1095
+ }
1096
+ },
1097
+ "required": [
1098
+ "op"
1099
+ ],
1100
+ "additionalProperties": false
1101
+ }
1102
+ },
1103
+ "stopOnError": {
1104
+ "type": "boolean",
1105
+ "description": "某步失败后是否停止(默认 true)"
1106
+ },
1107
+ "tab": {
1108
+ "type": "string",
1109
+ "maxLength": 16,
1110
+ "description": "目标标签页 id(缺省=当前活动标签页)"
1111
+ }
1112
+ },
1113
+ "required": [
1114
+ "steps"
1115
+ ],
1116
+ "additionalProperties": false
1117
+ },
1118
+ "kind": "write",
1119
+ "since": "1.1.0"
1120
+ }
1121
+ ]
1122
+ },
1123
+ {
1124
+ "id": "tabs",
1125
+ "title": "标签页管理",
1126
+ "description": "",
1127
+ "tags": [
1128
+ "core"
1129
+ ],
1130
+ "requires": [
1131
+ "engine"
1132
+ ],
1133
+ "dependsOn": [],
1134
+ "provides": {},
1135
+ "features": [
1136
+ "browser.tabs"
1137
+ ],
1138
+ "tools": [
1139
+ {
1140
+ "name": "browser_tabs",
1141
+ "description": "标签页四合一:action=list 列出(含稳定 id 与当前地址);new 打开新标签页(可带 url);select 切换活动标签页;close 关闭。后续动作默认作用于活动标签页,也可用 tab 参数显式指定。",
1142
+ "inputSchema": {
1143
+ "type": "object",
1144
+ "properties": {
1145
+ "action": {
1146
+ "type": "string",
1147
+ "enum": [
1148
+ "list",
1149
+ "new",
1150
+ "select",
1151
+ "close"
1152
+ ],
1153
+ "description": "动作(默认 list)"
1154
+ },
1155
+ "url": {
1156
+ "type": "string",
1157
+ "maxLength": 2048,
1158
+ "description": "new 动作要打开的网址"
1159
+ },
1160
+ "tab": {
1161
+ "type": "string",
1162
+ "maxLength": 16,
1163
+ "description": "select/close 的目标标签页 id"
1164
+ }
1165
+ },
1166
+ "additionalProperties": false
1167
+ },
1168
+ "kind": "control",
1169
+ "since": "1.0.0"
1170
+ }
1171
+ ]
1172
+ },
1173
+ {
1174
+ "id": "screenshot",
1175
+ "title": "页面截图",
1176
+ "description": "",
1177
+ "tags": [
1178
+ "verify"
1179
+ ],
1180
+ "requires": [
1181
+ "engine",
1182
+ "server"
1183
+ ],
1184
+ "dependsOn": [],
1185
+ "provides": {},
1186
+ "features": [
1187
+ "browser.screenshot"
1188
+ ],
1189
+ "tools": [
1190
+ {
1191
+ "name": "browser_screenshot",
1192
+ "description": "当前页面截图,图片直接返回给你看(PNG,同时落盘并给出路径);不要再调 read_image 去读它。默认视口截图;fullPage=true 截整页。工作台地址可实时观察页面。",
1193
+ "inputSchema": {
1194
+ "type": "object",
1195
+ "properties": {
1196
+ "fullPage": {
1197
+ "type": "boolean",
1198
+ "description": "是否截取整页(默认 false)"
1199
+ },
1200
+ "tab": {
1201
+ "type": "string",
1202
+ "maxLength": 16,
1203
+ "description": "目标标签页 id(缺省=当前活动标签页)"
1204
+ }
1205
+ },
1206
+ "additionalProperties": false
1207
+ },
1208
+ "kind": "read",
1209
+ "since": "1.0.0"
1210
+ }
1211
+ ]
1212
+ },
1213
+ {
1214
+ "id": "session",
1215
+ "title": "会话管理",
1216
+ "description": "",
1217
+ "tags": [
1218
+ "core"
1219
+ ],
1220
+ "requires": [
1221
+ "engine"
1222
+ ],
1223
+ "dependsOn": [],
1224
+ "provides": {},
1225
+ "features": [
1226
+ "browser.session"
1227
+ ],
1228
+ "tools": [
1229
+ {
1230
+ "name": "browser_status",
1231
+ "description": "引擎状态:是否运行、有头/无头、标签页清单(id+地址)、累计动作数、最近动作日志。不确定浏览器是否还活着时先看它。",
1232
+ "inputSchema": {
1233
+ "type": "object",
1234
+ "properties": {},
1235
+ "additionalProperties": false
1236
+ },
1237
+ "kind": "read",
1238
+ "since": "1.0.0"
1239
+ },
1240
+ {
1241
+ "name": "browser_wait",
1242
+ "description": "等待指定条件后返回**等待后的新快照**(不用再单独 browser_snapshot)。selector=等元素出现(首选,如 .result),ms=固定毫秒(上限 30000),都不给=等页面 load 完成。",
1243
+ "inputSchema": {
1244
+ "type": "object",
1245
+ "properties": {
1246
+ "ms": {
1247
+ "type": "number",
1248
+ "description": "等待毫秒数(上限 30000)"
1249
+ },
1250
+ "selector": {
1251
+ "type": "string",
1252
+ "maxLength": 300,
1253
+ "description": "等待出现的 CSS 选择器"
1254
+ },
1255
+ "tab": {
1256
+ "type": "string",
1257
+ "maxLength": 16,
1258
+ "description": "目标标签页 id(缺省=当前活动标签页)"
1259
+ }
1260
+ },
1261
+ "additionalProperties": false
1262
+ },
1263
+ "kind": "control",
1264
+ "since": "1.0.0"
1265
+ },
1266
+ {
1267
+ "name": "browser_history",
1268
+ "description": "浏览历史:back 后退 / forward 前进 / reload 重载。返回操作后的新快照。",
1269
+ "inputSchema": {
1270
+ "type": "object",
1271
+ "properties": {
1272
+ "action": {
1273
+ "type": "string",
1274
+ "enum": [
1275
+ "back",
1276
+ "forward",
1277
+ "reload"
1278
+ ],
1279
+ "description": "动作(默认 back)"
1280
+ },
1281
+ "tab": {
1282
+ "type": "string",
1283
+ "maxLength": 16,
1284
+ "description": "目标标签页 id(缺省=当前活动标签页)"
1285
+ }
1286
+ },
1287
+ "additionalProperties": false
1288
+ },
1289
+ "kind": "control",
1290
+ "since": "1.0.0"
1291
+ },
1292
+ {
1293
+ "name": "browser_close",
1294
+ "description": "关闭浏览器(所有标签页)并清空标签页记录——这是一次显式重置:登录态保留在 profile,但下次 navigate 是干净浏览器(不恢复旧标签)。空闲回收/服务重启则会自动恢复上次标签页。任务结束或页面卡死时用它重置。",
1295
+ "inputSchema": {
1296
+ "type": "object",
1297
+ "properties": {},
1298
+ "additionalProperties": false
1299
+ },
1300
+ "kind": "control",
1301
+ "since": "1.0.0"
1302
+ }
1303
+ ]
1304
+ },
1305
+ {
1306
+ "id": "evaluate",
1307
+ "title": "页面脚本",
1308
+ "description": "",
1309
+ "tags": [
1310
+ "advanced"
1311
+ ],
1312
+ "requires": [
1313
+ "engine"
1314
+ ],
1315
+ "dependsOn": [],
1316
+ "provides": {},
1317
+ "features": [
1318
+ "browser.evaluate"
1319
+ ],
1320
+ "tools": [
1321
+ {
1322
+ "name": "browser_evaluate",
1323
+ "description": "在页面里执行 JS 表达式并返回结果。默认关闭(安全默认);关闭时返回 NOT_IMPLEMENTED 与开启方法。优先用快照+ref 完成任务,本工具留给快照覆盖不了的场景。",
1324
+ "inputSchema": {
1325
+ "type": "object",
1326
+ "properties": {
1327
+ "script": {
1328
+ "type": "string",
1329
+ "maxLength": 20000,
1330
+ "description": "JS 表达式(如 document.title)"
1331
+ },
1332
+ "tab": {
1333
+ "type": "string",
1334
+ "maxLength": 16,
1335
+ "description": "目标标签页 id(缺省=当前活动标签页)"
1336
+ }
1337
+ },
1338
+ "required": [
1339
+ "script"
1340
+ ],
1341
+ "additionalProperties": false
1342
+ },
1343
+ "kind": "write",
1344
+ "since": "1.0.0"
1345
+ }
1346
+ ]
1347
+ }
1348
+ ]
1349
+ }