@mearl/client 2.19.2 → 2.20.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.
- package/README.md +35 -3
- package/dist/actionTimeouts.js +2 -0
- package/dist/artifacts.d.ts +17 -0
- package/dist/artifacts.js +80 -0
- package/dist/check.js +16 -4
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +47 -3
- package/dist/commands.d.ts +138 -14
- package/dist/commands.js +276 -9
- package/dist/generated-browser-action-protocol.d.ts +122 -9
- package/dist/generated-browser-action-protocol.js +24 -6
- package/dist/index.d.ts +10 -1
- package/dist/index.js +15 -3
- package/dist/plugin.d.ts +5 -2
- package/dist/plugin.js +66 -21
- package/dist/pluginPageBundle.d.ts +1 -0
- package/dist/pluginPageBundle.js +54 -1
- package/dist/pluginRegistry.d.ts +5 -0
- package/dist/pluginRegistry.js +28 -0
- package/dist/pluginSource.d.ts +2 -0
- package/dist/pluginSource.js +8 -0
- package/dist/socket.d.ts +1 -0
- package/dist/socket.js +208 -52
- package/dist/unified.d.ts +17 -0
- package/dist/unified.js +119 -9
- package/package.json +3 -3
package/dist/commands.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export interface ParamDef {
|
|
|
4
4
|
type: string;
|
|
5
5
|
required?: boolean;
|
|
6
6
|
description: string;
|
|
7
|
+
/** 复杂字段的结构与组合约束,仅在 action help 展示。 */
|
|
8
|
+
details?: readonly string[];
|
|
7
9
|
}
|
|
8
10
|
export interface CommandDef {
|
|
9
11
|
name: BrowserCommandAction;
|
|
@@ -17,8 +19,52 @@ export interface CommandDef {
|
|
|
17
19
|
/** 是否支持 --output */
|
|
18
20
|
outputFlag?: boolean;
|
|
19
21
|
examples?: string[];
|
|
22
|
+
notes?: readonly string[];
|
|
23
|
+
result?: readonly string[];
|
|
20
24
|
}
|
|
21
25
|
export declare const COMMANDS: readonly [{
|
|
26
|
+
readonly name: "browser_control";
|
|
27
|
+
readonly description: "把控制会话交给用户;用户在 Mearl 浏览器管理页交还后重新观察页面";
|
|
28
|
+
readonly params: [{
|
|
29
|
+
readonly name: "operation";
|
|
30
|
+
readonly type: "\"handoff\" | \"resume\"";
|
|
31
|
+
readonly required: true;
|
|
32
|
+
readonly description: "交给用户操作;resume 仅在用户明确交还后使用";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "tabId";
|
|
35
|
+
readonly type: "number";
|
|
36
|
+
readonly description: "可选的目标页面";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "reason";
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
readonly description: "用户需要处理的事项";
|
|
41
|
+
}];
|
|
42
|
+
readonly notes: readonly ["必须携带 --session;接管停止后续派发,已经发出的操作可能仍然生效。"];
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "page_download";
|
|
45
|
+
readonly description: "先监听再点击,等待下载完成并创建浏览器文件产物";
|
|
46
|
+
readonly outputFlag: true;
|
|
47
|
+
readonly params: [{
|
|
48
|
+
readonly name: "tabId";
|
|
49
|
+
readonly type: "number";
|
|
50
|
+
readonly required: true;
|
|
51
|
+
readonly description: "下载来源页面";
|
|
52
|
+
}, {
|
|
53
|
+
readonly name: "trigger";
|
|
54
|
+
readonly type: "object";
|
|
55
|
+
readonly required: true;
|
|
56
|
+
readonly description: "page_click 参数,不含 tabId";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "url";
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
readonly description: "预期下载 URL;扩展无法通过 referrer 归属时需显式指定";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "timeout";
|
|
63
|
+
readonly type: "number";
|
|
64
|
+
readonly description: "下载等待毫秒,默认 30000,范围 1000–300000";
|
|
65
|
+
}];
|
|
66
|
+
readonly notes: readonly ["--output 把文件分块保存到调用方机器;未指定时返回 artifactId,可供 page_upload 复用。", "共享 CDP 浏览器保持原下载目录;Chrome 未返回文件路径时明确报错。超时不能直接重复点击。"];
|
|
67
|
+
}, {
|
|
22
68
|
readonly name: "tab_checkpoint";
|
|
23
69
|
readonly description: "为目标标签页建立日志、请求和埋点增量边界";
|
|
24
70
|
readonly params: [{
|
|
@@ -77,6 +123,8 @@ export declare const COMMANDS: readonly [{
|
|
|
77
123
|
readonly type: "boolean";
|
|
78
124
|
readonly description: "只返回数据结构,不返回叶子值";
|
|
79
125
|
}];
|
|
126
|
+
readonly notes: readonly ["流式请求开始后即进入缓冲区;页面及 App 桥代发的 MTop SSE 都归入 mtop。无法归属当前页面 target 的 Service Worker 请求不在采集范围内。"];
|
|
127
|
+
readonly result: readonly ["nextCursor 用于同类查询续读,hasMore 表示还有数据,gap 表示缓冲区淘汰造成缺口;checkpoint cursor 可分别用于三类查询的初始边界。", "isPending 标记未完成请求;SSE 的 responseBody 保存按序到达的 event/data/timestamp/duration 分片。敏感请求头返回脱敏值。"];
|
|
80
128
|
readonly examples: ["get_requests --payload '{\"tabId\":12345,\"count\":5}'", "get_requests --payload '{\"tabId\":12345,\"source\":\"mtop\",\"filter\":\"cart\"}'"];
|
|
81
129
|
}, {
|
|
82
130
|
readonly name: "get_logs";
|
|
@@ -107,6 +155,7 @@ export declare const COMMANDS: readonly [{
|
|
|
107
155
|
readonly type: "string";
|
|
108
156
|
readonly description: "只返回指定 tab checkpoint 或同类查询 cursor 之后的日志";
|
|
109
157
|
}];
|
|
158
|
+
readonly result: readonly ["nextCursor 用于同类查询续读,hasMore 表示还有数据,gap 表示缓冲区淘汰造成缺口;checkpoint cursor 可分别用于三类查询的初始边界。"];
|
|
110
159
|
readonly examples: ["get_logs --payload '{\"tabId\":12345,\"limit\":10,\"level\":\"error\"}'"];
|
|
111
160
|
}, {
|
|
112
161
|
readonly name: "get_events";
|
|
@@ -145,6 +194,8 @@ export declare const COMMANDS: readonly [{
|
|
|
145
194
|
readonly type: "boolean";
|
|
146
195
|
readonly description: "返回完整 URL、_raw 和 _context;默认 false";
|
|
147
196
|
}];
|
|
197
|
+
readonly notes: readonly ["tab_open 新页从首屏采集;既有页面首次查询才启用采集,需要刷新或重新触发埋点。同批事件不会被 limit 拆开。"];
|
|
198
|
+
readonly result: readonly ["nextCursor 用于同类查询续读,hasMore 表示还有数据,gap 表示缓冲区淘汰造成缺口;checkpoint cursor 可分别用于三类查询的初始边界。", "captureStatus 为 armed/active/inactive;空结果附 hint 时按提示刷新或触发。默认去除 tracking URL query 与 _raw/_context,includeRaw=true 时保留。"];
|
|
148
199
|
readonly examples: ["get_events --payload '{\"tabId\":12345,\"source\":\"aplus\",\"event_type\":\"CLK\",\"limit\":10}'", "get_events --payload '{\"tabId\":12345,\"filter\":\"order\",\"includeRaw\":true,\"limit\":1}'", "get_events --payload '{\"tabId\":12345,\"source\":\"all\",\"limit\":20}'"];
|
|
149
200
|
}, {
|
|
150
201
|
readonly name: "set_mock";
|
|
@@ -180,6 +231,7 @@ export declare const COMMANDS: readonly [{
|
|
|
180
231
|
readonly type: "object";
|
|
181
232
|
readonly description: "请求 query/body 字段子集匹配;$index 从 0 开始指定调用顺序";
|
|
182
233
|
}];
|
|
234
|
+
readonly notes: readonly ["启用时至少提供 mockData 或非空 fields;非空 fields 优先。fields 每项 { path: string, value: any },path 支持点号和数组索引。", "相同 apiName 的多条无条件 Mock 会覆盖;conditions 子集匹配 query/body(含 data 内层),不同条件可共存;$index 从 0 起控制调用顺序,不参与字段匹配。", "大字段可用顶层 @<绝对路径> 文件引用或 --payload-file;文件展开后仍受 Native Messaging 单条消息大小限制。"];
|
|
183
235
|
readonly examples: ["set_mock --payload '{\"tabId\":12345,\"apiName\":\"mtop.cart.query\",\"mockData\":{\"ret\":[\"SUCCESS::调用成功\"]}}'", "set_mock --payload-file ./mock-data.json"];
|
|
184
236
|
}, {
|
|
185
237
|
readonly name: "get_mocks";
|
|
@@ -222,10 +274,12 @@ export declare const COMMANDS: readonly [{
|
|
|
222
274
|
readonly name: "requestHeaders";
|
|
223
275
|
readonly type: "array";
|
|
224
276
|
readonly description: "modifyHeaders 动作的请求头修改列表";
|
|
277
|
+
readonly details: readonly ["每项 { header: string, operation: \"set\" | \"append\" | \"remove\", value?: string };set/append 需 value"];
|
|
225
278
|
}, {
|
|
226
279
|
readonly name: "responseHeaders";
|
|
227
280
|
readonly type: "array";
|
|
228
281
|
readonly description: "modifyHeaders 动作的响应头修改列表";
|
|
282
|
+
readonly details: readonly ["每项 { header: string, operation: \"set\" | \"append\" | \"remove\", value?: string };set/append 需 value"];
|
|
229
283
|
}, {
|
|
230
284
|
readonly name: "initiatorDomains";
|
|
231
285
|
readonly type: "string";
|
|
@@ -243,6 +297,7 @@ export declare const COMMANDS: readonly [{
|
|
|
243
297
|
readonly type: "string";
|
|
244
298
|
readonly description: "规则说明";
|
|
245
299
|
}];
|
|
300
|
+
readonly notes: readonly ["扩展模式规则持久化;CDP 仅支持会话级 modifyHeaders 请求头 set,不支持响应头、initiatorDomains 或其他动作。Provider 是否支持以其能力声明为准。"];
|
|
246
301
|
readonly examples: ["set_rule --payload '{\"actionType\":\"block\",\"filter\":\"^https://example\\\\.com/ads/.*\"}'", "set_rule --payload '{\"ruleId\":42,\"enabled\":false}'"];
|
|
247
302
|
}, {
|
|
248
303
|
readonly name: "get_rules";
|
|
@@ -280,6 +335,7 @@ export declare const COMMANDS: readonly [{
|
|
|
280
335
|
readonly name: "files";
|
|
281
336
|
readonly type: "SendRequestFile[]";
|
|
282
337
|
readonly description: "multipart 文件,最多 20 个、总计不超过 40 MiB;Base64 文件总计不超过 7 MiB。每项传 fieldName 和绝对 filePath,或传 base64 + filename";
|
|
338
|
+
readonly details: readonly ["fieldName: string(必填);filePath: string 与 base64: string 二选一", "filename: string,base64 时必填,filePath 时默认文件 basename", "contentType: string(可选),默认按文件名推断 MIME,否则 application/octet-stream"];
|
|
283
339
|
}, {
|
|
284
340
|
readonly name: "withCookies";
|
|
285
341
|
readonly type: "boolean";
|
|
@@ -293,6 +349,8 @@ export declare const COMMANDS: readonly [{
|
|
|
293
349
|
readonly type: "number";
|
|
294
350
|
readonly description: "超时毫秒数,默认 30000";
|
|
295
351
|
}];
|
|
352
|
+
readonly notes: readonly ["仅用于非 BUC 请求;BUC 接口使用 mearl buc,不手工传 Token、DPoP 或 Ticket。", "body 不能与 formData/files 组合;multipart 不手工设置 Content-Type,由 Mearl 生成 boundary。", "filePath 属于 native-host 所在机器;无法引用远端路径时用 base64。BUC 上传的路径属于插件执行宿主。"];
|
|
353
|
+
readonly result: readonly ["返回 status、statusText、headers、body、bodyType、attachedCookieCount;bodyType 为 json/text/base64,二进制 body 需解码后保存。"];
|
|
296
354
|
readonly examples: ["send_request --payload '{\"url\":\"https://api.example.com/data\",\"method\":\"GET\"}'", "send_request --payload '{\"url\":\"https://api.example.com/upload\",\"method\":\"POST\",\"formData\":{\"folder\":\"assets\"},\"files\":[{\"fieldName\":\"file\",\"filePath\":\"/absolute/path/image.png\"}]}'"];
|
|
297
355
|
}, {
|
|
298
356
|
readonly name: "send_mtop_request";
|
|
@@ -327,6 +385,8 @@ export declare const COMMANDS: readonly [{
|
|
|
327
385
|
readonly type: "number";
|
|
328
386
|
readonly description: "超时毫秒数,默认 10000";
|
|
329
387
|
}];
|
|
388
|
+
readonly notes: readonly ["需要目标浏览器有对应登录态;Mearl 自动处理签名,不依赖页面脚本。api 以 mopen. 开头时使用 mopen 协议。", "env=prod 使用 h5api.m.taobao.com,pre 使用 h5api.wapa.taobao.com。"];
|
|
389
|
+
readonly result: readonly ["返回 success、response、requestData;业务成功需检查 response.ret。"];
|
|
330
390
|
readonly examples: ["send_mtop_request --payload '{\"api\":\"mtop.trade.order.detail\",\"data\":{\"orderId\":\"123\"}}'"];
|
|
331
391
|
}, {
|
|
332
392
|
readonly name: "browser_list";
|
|
@@ -336,6 +396,24 @@ export declare const COMMANDS: readonly [{
|
|
|
336
396
|
}, {
|
|
337
397
|
readonly name: "browser_release";
|
|
338
398
|
readonly description: "释放当前浏览器的调试控制和会话级临时效果(含设备/时区模拟);不用于普通任务收尾,Provider 实例的行为以 mearl <providerId> 为准";
|
|
399
|
+
readonly params: [{
|
|
400
|
+
readonly name: "closeCreatedTabs";
|
|
401
|
+
readonly type: "boolean";
|
|
402
|
+
readonly description: "带 --session 时关闭会话创建的过程页,默认 false";
|
|
403
|
+
}, {
|
|
404
|
+
readonly name: "keepTabIds";
|
|
405
|
+
readonly type: "number[]";
|
|
406
|
+
readonly description: "保留的结果页面;复用的用户页面始终保留";
|
|
407
|
+
}, {
|
|
408
|
+
readonly name: "preserveEnvironment";
|
|
409
|
+
readonly type: "boolean";
|
|
410
|
+
readonly description: "带 --session 时默认 true,保留 Mock 与模拟现场;false 清理这些页面的环境";
|
|
411
|
+
}, {
|
|
412
|
+
readonly name: "keepArtifactIds";
|
|
413
|
+
readonly type: "string[]";
|
|
414
|
+
readonly description: "保留在浏览器宿主的文件产物;其余会话临时文件删除";
|
|
415
|
+
}];
|
|
416
|
+
readonly notes: readonly ["带 --session 时可用于任务收尾,只释放该会话;未带会话时保留原浏览器级释放行为,活动会话存在时拒绝全局释放。"];
|
|
339
417
|
readonly summary: "释放浏览器调试控制和会话级临时效果";
|
|
340
418
|
readonly examples: ["browser_release", "browser_release --browser chrome-a"];
|
|
341
419
|
}, {
|
|
@@ -447,6 +525,8 @@ export declare const COMMANDS: readonly [{
|
|
|
447
525
|
readonly type: "object";
|
|
448
526
|
readonly description: "与 appProfile 配合;声明式覆盖桥方法,形如 {methods:{api:{behavior|response|noop,silent?}}}";
|
|
449
527
|
}];
|
|
528
|
+
readonly notes: readonly ["emulation / appProfile 只应用到新建 Tab;复用 Tab 要切换状态时用对应设置 action。", "closeExisting 不能与复用或 openerTabId 组合;多匹配默认报错,match.onMultiple=first 可显式选择第一个。"];
|
|
529
|
+
readonly result: readonly ["返回 tabId、url、title、opened/reused;reused=true 的既有页面应保留。", "active=true 时 activation 包含 tabActive、windowFocused、windowState、visibilityState;emulation 返回实际生效配置。", "capture.cursor 是导航前诊断边界,可分别用于 get_logs/get_requests/get_events 的 after。"];
|
|
450
530
|
readonly examples: ["tab_open --payload '{\"url\":\"https://example.com\"}'", "tab_open --payload '{\"url\":\"https://example.com/page\",\"reuse\":\"prefer\",\"match\":{\"ignoreSearch\":true}}'", "tab_open --payload '{\"url\":\"https://m.example.com\",\"emulation\":{\"preset\":\"iphone-17-pro\"}}'", "tab_open --payload '{\"url\":\"https://market.m.taobao.com/app/trip/rx-home/pages/home\",\"appProfile\":\"fliggy\"}'", "tab_open --payload '{\"url\":\"https://market.m.taobao.com/app/trip/rx-home/pages/home\",\"appProfile\":\"fliggy\",\"emulation\":{\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}}'", "tab_open --payload '{\"url\":\"https://example.com\",\"appProfile\":\"fliggy\",\"os\":\"android\"}'", "tab_open --payload '{\"url\":\"https://example.com\",\"group\":\"验证任务\"}'"];
|
|
451
531
|
}, {
|
|
452
532
|
readonly name: "tab_close";
|
|
@@ -529,6 +609,8 @@ export declare const COMMANDS: readonly [{
|
|
|
529
609
|
readonly required: true;
|
|
530
610
|
readonly description: "目标标签页 ID";
|
|
531
611
|
}];
|
|
612
|
+
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。失败以退出码 1 结束。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。"];
|
|
613
|
+
readonly notes: readonly ["selector / text / point 必须且只能提供一个。隐藏页 auto 使用 DOM;只有明确依赖真实用户手势时才激活页面。", "原生 select 可按 option 文本点击;checkbox/radio 返回 controlState.checkedBefore/checkedAfter。"];
|
|
532
614
|
readonly examples: ["page_click --payload '{\"tabId\":12345,\"text\":\"提交\"}'", "page_click --payload '{\"tabId\":12345,\"text\":\"退款明细\",\"role\":\"button\"}'", "page_click --payload '{\"tabId\":12345,\"text\":\"确定\",\"scope\":\"@e12\"}'", "page_click --payload '{\"tabId\":12345,\"selector\":\"@e3\"}'", "page_click --payload '{\"tabId\":12345,\"selector\":\".submit-btn\"}'", "page_click --payload '{\"tabId\":12345,\"selector\":\".gesture-btn\",\"clickMode\":\"touch\"}'", "page_click --payload '{\"tabId\":12345,\"point\":{\"x\":336,\"y\":117}}'", "page_click --payload '{\"tabId\":12345,\"point\":{\"x\":196,\"y\":240},\"coordinateSpace\":\"active-frame\"}'"];
|
|
533
615
|
}, {
|
|
534
616
|
readonly name: "page_drag";
|
|
@@ -557,6 +639,8 @@ export declare const COMMANDS: readonly [{
|
|
|
557
639
|
readonly required: true;
|
|
558
640
|
readonly description: "目标标签页 ID";
|
|
559
641
|
}];
|
|
642
|
+
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。失败以退出码 1 结束。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。"];
|
|
643
|
+
readonly notes: readonly ["起点会自动滚入视口,终点必须同时位于当前视口;否则先滚动页面。隐藏页 auto 使用 DOM,不切换活动页。"];
|
|
560
644
|
readonly examples: ["page_drag --payload '{\"tabId\":12345,\"from\":{\"x\":350,\"y\":80},\"to\":{\"x\":80,\"y\":80}}'", "page_drag --payload '{\"tabId\":12345,\"from\":\"@e3\",\"to\":\"#drop-zone\",\"dragMode\":\"mouse\"}'"];
|
|
561
645
|
}, {
|
|
562
646
|
readonly name: "page_type";
|
|
@@ -581,6 +665,7 @@ export declare const COMMANDS: readonly [{
|
|
|
581
665
|
readonly required: true;
|
|
582
666
|
readonly description: "目标标签页 ID";
|
|
583
667
|
}];
|
|
668
|
+
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。失败以退出码 1 结束。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。"];
|
|
584
669
|
readonly examples: ["page_type --payload '{\"tabId\":12345,\"selector\":\"@e6\",\"text\":\"搜索关键词\"}'"];
|
|
585
670
|
}, {
|
|
586
671
|
readonly name: "page_hover";
|
|
@@ -596,6 +681,7 @@ export declare const COMMANDS: readonly [{
|
|
|
596
681
|
readonly required: true;
|
|
597
682
|
readonly description: "目标标签页 ID";
|
|
598
683
|
}];
|
|
684
|
+
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。失败以退出码 1 结束。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。"];
|
|
599
685
|
readonly examples: ["page_hover --payload '{\"tabId\":12345,\"selector\":\".nav-menu\"}'"];
|
|
600
686
|
}, {
|
|
601
687
|
readonly name: "page_scroll";
|
|
@@ -623,6 +709,7 @@ export declare const COMMANDS: readonly [{
|
|
|
623
709
|
readonly required: true;
|
|
624
710
|
readonly description: "目标标签页 ID";
|
|
625
711
|
}];
|
|
712
|
+
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。失败以退出码 1 结束。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。", "action.data 返回 moved、atTop/atBottom、scrollYBefore/After、maxScrollY、resolvedContainer 和 ancestorDistance;自动发现的内部容器提供可复用 containerSelector。"];
|
|
626
713
|
readonly examples: ["page_scroll --payload '{\"tabId\":12345,\"direction\":\"down\"}'", "page_scroll --payload '{\"tabId\":12345,\"direction\":\"bottom\"}'", "page_scroll --payload '{\"tabId\":12345,\"selector\":\".virtual-list\",\"direction\":\"down\",\"distance\":800}'", "page_scroll --payload '{\"tabId\":12345,\"selector\":\"@e8\",\"containerPolicy\":\"nearest\",\"direction\":\"bottom\"}'"];
|
|
627
714
|
}, {
|
|
628
715
|
readonly name: "page_eval";
|
|
@@ -637,15 +724,23 @@ export declare const COMMANDS: readonly [{
|
|
|
637
724
|
readonly type: "boolean";
|
|
638
725
|
readonly description: "表达式返回 Promise 时等待完成,默认 true";
|
|
639
726
|
}, {
|
|
640
|
-
readonly name: "
|
|
727
|
+
readonly name: "frameId";
|
|
728
|
+
readonly type: "string";
|
|
729
|
+
readonly description: "page_frames 返回的目标 frame ID,扩展/CDP 均支持;省略时容器/设备外壳使用当前业务 frame,普通页面使用主 frame";
|
|
730
|
+
}, {
|
|
641
731
|
readonly type: "object";
|
|
642
732
|
readonly description: "仅在表达式会修改页面且需要观察结果时显式传入;不传保持轻量裸执行";
|
|
733
|
+
readonly name: string;
|
|
734
|
+
readonly required?: boolean;
|
|
735
|
+
readonly details?: readonly string[];
|
|
643
736
|
}, ParamDef, {
|
|
644
737
|
readonly name: "tabId";
|
|
645
738
|
readonly type: "number";
|
|
646
739
|
readonly required: true;
|
|
647
740
|
readonly description: "目标标签页 ID";
|
|
648
741
|
}];
|
|
742
|
+
readonly notes: readonly ["优先使用结构化 action;仅在其无法表达需求时执行最小范围脚本。"];
|
|
743
|
+
readonly result: readonly ["默认返回 { result };observe 对象启用观察并返回 { action, observation };仅开启 diagnostics 时返回 { action, diagnostics }。diagnostics=false 不启用包装。失败阶段语义同 page_click。"];
|
|
649
744
|
readonly examples: ["page_eval --payload '{\"tabId\":12345,\"expression\":\"document.title\"}'"];
|
|
650
745
|
}, {
|
|
651
746
|
readonly name: "page_inspect";
|
|
@@ -676,6 +771,7 @@ export declare const COMMANDS: readonly [{
|
|
|
676
771
|
readonly required: true;
|
|
677
772
|
readonly description: "目标标签页 ID";
|
|
678
773
|
}];
|
|
774
|
+
readonly result: readonly ["matches[] 包含 boundingBox、computedStyle、hitTest、scroll 溢出量及可用的 scrollContainer。receivesPointerEvents=false 时读取 occludedBy。", "$0 还返回 resolvedSelector、属性、XPath 和可用框架信息。"];
|
|
679
775
|
readonly examples: ["page_inspect --payload '{\"tabId\":12345,\"selector\":\".form-field\",\"styles\":[\"display\",\"width\"]}'", "page_inspect --payload '{\"tabId\":12345,\"selector\":\"@e8\"}'", "page_inspect --payload '{\"tabId\":12345,\"selector\":\"$0\"}'", "page_inspect --payload '{\"tabId\":12345,\"filter\":\"horizontal-overflow\"}'", "page_inspect --payload '{\"tabId\":12345,\"filter\":\"scrollable\"}'"];
|
|
680
776
|
}, {
|
|
681
777
|
readonly name: "page_press";
|
|
@@ -699,6 +795,8 @@ export declare const COMMANDS: readonly [{
|
|
|
699
795
|
readonly required: true;
|
|
700
796
|
readonly description: "目标标签页 ID";
|
|
701
797
|
}];
|
|
798
|
+
readonly notes: readonly ["隐藏页 DOM 模式支持 Tab 焦点移动、原生控件 Enter/Space 激活和输入框 Enter 提交;编辑、选择、方向键和页面滚动等原生行为需可见页与 pressMode=keyboard。"];
|
|
799
|
+
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。失败以退出码 1 结束。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。", "action.data.dispatchMode / fallbackReason / defaultAction 说明实际输入路径。"];
|
|
702
800
|
readonly examples: ["page_press --payload '{\"tabId\":12345,\"key\":\"Enter\"}'"];
|
|
703
801
|
}, {
|
|
704
802
|
readonly name: "page_wait";
|
|
@@ -741,6 +839,7 @@ export declare const COMMANDS: readonly [{
|
|
|
741
839
|
readonly required: true;
|
|
742
840
|
readonly description: "目标标签页 ID";
|
|
743
841
|
}];
|
|
842
|
+
readonly notes: readonly ["time / selector / text / condition 必须且只能提供一个;time 范围 0–60000ms。页面交互已有内置观察,仅在需要独立等待条件时使用。"];
|
|
744
843
|
readonly examples: ["page_wait --payload '{\"tabId\":12345,\"time\":1000}'", "page_wait --payload '{\"tabId\":12345,\"selector\":\".dialog\",\"state\":\"visible\"}'", "page_wait --payload '{\"tabId\":12345,\"selector\":\".loading\",\"state\":\"hidden\"}'", "page_wait --payload '{\"tabId\":12345,\"text\":\"提交成功\"}'", "page_wait --payload '{\"tabId\":12345,\"condition\":\"window.appReady === true\",\"timeout\":30000}'"];
|
|
745
844
|
}, {
|
|
746
845
|
readonly name: "page_navigate";
|
|
@@ -763,11 +862,16 @@ export declare const COMMANDS: readonly [{
|
|
|
763
862
|
readonly required: true;
|
|
764
863
|
readonly description: "目标标签页 ID";
|
|
765
864
|
}];
|
|
865
|
+
readonly notes: readonly ["url / refresh=true / history 必须且只能提供一个。"];
|
|
766
866
|
readonly examples: ["page_navigate --payload '{\"tabId\":12345,\"url\":\"https://example.com/page2\"}'", "page_navigate --payload '{\"tabId\":12345,\"refresh\":true}'", "page_navigate --payload '{\"tabId\":12345,\"history\":\"back\"}'"];
|
|
767
867
|
}, {
|
|
768
868
|
readonly name: "page_upload";
|
|
769
869
|
readonly description: "向 <input type=\"file\"> 元素上传一个或多个文件";
|
|
770
870
|
readonly params: [{
|
|
871
|
+
readonly name: "files";
|
|
872
|
+
readonly type: "object[]";
|
|
873
|
+
readonly description: "调用方绝对路径 {filePath} 或浏览器产物 {artifactId};与 filePaths 二选一";
|
|
874
|
+
}, {
|
|
771
875
|
readonly name: "selector";
|
|
772
876
|
readonly type: "string";
|
|
773
877
|
readonly required: true;
|
|
@@ -775,14 +879,15 @@ export declare const COMMANDS: readonly [{
|
|
|
775
879
|
}, {
|
|
776
880
|
readonly name: "filePaths";
|
|
777
881
|
readonly type: "string[]";
|
|
778
|
-
readonly
|
|
779
|
-
readonly description: "本地文件路径数组";
|
|
882
|
+
readonly description: "浏览器宿主上的绝对路径数组;与 files 二选一";
|
|
780
883
|
}, ParamDef, ParamDef, {
|
|
781
884
|
readonly name: "tabId";
|
|
782
885
|
readonly type: "number";
|
|
783
886
|
readonly required: true;
|
|
784
887
|
readonly description: "目标标签页 ID";
|
|
785
888
|
}];
|
|
889
|
+
readonly result: readonly ["默认返回 { action, observation };action.success 只表示动作成功,业务效果需结合 observation 和目标状态判断。", "observe=false 且未开启 diagnostics 时返回裸动作结果(如 { clicked: true }),没有 action/observation;开启 diagnostics 时返回 { action, diagnostics }。", "包装结果中的 action.stage=precondition 表示未派发,省略 observation/diagnostics;dispatch-uncertain 表示可能已派发,先查看 action.attempt 与可用观察或最小快照核验,避免重复提交。失败以退出码 1 结束。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。"];
|
|
890
|
+
readonly notes: readonly ["直接写入 input[type=file],不依赖 file chooser;隐藏的文件节点也可上传。外部 Provider 的文件中转能力查询 mearl <providerId>。"];
|
|
786
891
|
readonly examples: ["page_upload --payload '{\"tabId\":12345,\"selector\":\"#file-input\",\"filePaths\":[\"/Users/me/photo.jpg\"]}'"];
|
|
787
892
|
}, {
|
|
788
893
|
readonly name: "page_snapshot";
|
|
@@ -825,6 +930,8 @@ export declare const COMMANDS: readonly [{
|
|
|
825
930
|
readonly required: true;
|
|
826
931
|
readonly description: "目标标签页 ID";
|
|
827
932
|
}];
|
|
933
|
+
readonly notes: readonly ["query.text / query.role 至少提供一个;query.exact 默认 true。每次快照刷新有效 ref 集合。", "interactive 无 AX 控件时回退到 viewport,不会自动改用 dom;Canvas 内容需截图。"];
|
|
934
|
+
readonly result: readonly ["返回 snapshot、elementCount、outputNodeCount、mode;截断时 truncated=true。", "query 返回 matches 与完整 matchCount,matches 最多 100 项,裁剪时 matchesTruncated=true。容器/iframe 的视口裁剪返回 outerViewport、contentViewport 和滚动位置。"];
|
|
828
935
|
readonly examples: ["page_snapshot --payload '{\"tabId\":12345}'", "page_snapshot --payload '{\"tabId\":1,\"mode\":\"viewport\"}'", "page_snapshot --payload '{\"tabId\":1,\"mode\":\"dom\"}'", "page_snapshot --payload '{\"tabId\":1,\"rootSelector\":\"[role=dialog]\"}'", "page_snapshot --payload '{\"tabId\":1,\"rootRef\":\"@e8\",\"ancestorDepth\":1}'", "page_snapshot --payload '{\"tabId\":1,\"query\":{\"text\":\"保存\",\"role\":\"button\"}}'"];
|
|
829
936
|
}, {
|
|
830
937
|
readonly name: "page_screenshot";
|
|
@@ -848,6 +955,8 @@ export declare const COMMANDS: readonly [{
|
|
|
848
955
|
readonly required: true;
|
|
849
956
|
readonly description: "目标标签页 ID";
|
|
850
957
|
}];
|
|
958
|
+
readonly notes: readonly ["使用 --output <path> 保存图片;省略时 stdout 返回含 base64 data 的 JSON,避免直接将其加载为文本。"];
|
|
959
|
+
readonly result: readonly ["meta 包含 format、width、height、size、url、title;宽高为物理像素(CSS 尺寸 × DPR)。"];
|
|
851
960
|
readonly examples: ["page_screenshot --payload '{\"tabId\":12345}' --output ./screenshot.png", "page_screenshot --payload '{\"tabId\":12345,\"selector\":\".product-card\"}' --output ./card.png"];
|
|
852
961
|
}, {
|
|
853
962
|
readonly name: "set_device_emulation";
|
|
@@ -912,6 +1021,8 @@ export declare const COMMANDS: readonly [{
|
|
|
912
1021
|
readonly required: true;
|
|
913
1022
|
readonly description: "目标标签页 ID";
|
|
914
1023
|
}];
|
|
1024
|
+
readonly notes: readonly ["无 preset 时 width/height 必须成对提供且 userAgent 必填;mobile 默认 true,touch 跟随 mobile。", "deviceShell 开启/移除时必须重载;splitScreen 仅在已启用 App 档案、deviceShell=true、横屏时生效。"];
|
|
1025
|
+
readonly result: readonly ["返回实际 viewport(width/height/deviceScaleFactor/scale)、UA、mobile、touch、orientation、deviceShell、splitScreen 和 reloaded;应以响应确认生效状态。"];
|
|
915
1026
|
readonly examples: ["set_device_emulation --payload '{\"tabId\":12345,\"enabled\":true,\"preset\":\"iphone-17-pro\"}'", "set_device_emulation --payload '{\"tabId\":12345,\"enabled\":true,\"preset\":\"pixel-11\",\"orientation\":\"landscape\"}'", "set_device_emulation --payload '{\"tabId\":12345,\"enabled\":true,\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}'", "set_device_emulation --payload '{\"tabId\":12345,\"enabled\":false}'"];
|
|
916
1027
|
}, {
|
|
917
1028
|
readonly name: "set_app_profile";
|
|
@@ -960,6 +1071,8 @@ export declare const COMMANDS: readonly [{
|
|
|
960
1071
|
readonly required: true;
|
|
961
1072
|
readonly description: "目标标签页 ID";
|
|
962
1073
|
}];
|
|
1074
|
+
readonly notes: readonly ["只有用户明确要求 App/客户端/容器/JSBridge 模拟时启用。移动视口或普通 H5 调试使用 set_device_emulation。", "emulation={} 使用档案推荐设备;enabled=false 时省略 emulation 只清除 App 注入,传 {} 同时清除设备模拟。", "bridgeConfig.methods 按方法声明 behavior / response / noop 三选一,可传 silent;只支持受控行为、固定 JSON 回包或成功空实现,不执行配置脚本。"];
|
|
1075
|
+
readonly result: readonly ["返回 enabled、profile、label、userAgent、os、mtopEnv、reloaded;联动设备时额外返回实际 emulation。"];
|
|
963
1076
|
readonly examples: ["set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"fliggy\"}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"fliggy\",\"mtopEnv\":\"pre\"}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":false,\"mtopEnv\":\"prod\"}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{}}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"alipay\",\"emulation\":{\"preset\":\"pixel-11\",\"deviceShell\":true}}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"fliggy\",\"emulation\":{\"preset\":\"ipad-mini-a17-pro\",\"orientation\":\"landscape\",\"deviceShell\":true,\"splitScreen\":true}}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":false}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":false,\"emulation\":{}}'"];
|
|
964
1077
|
}, {
|
|
965
1078
|
readonly name: "set_timezone";
|
|
@@ -982,8 +1095,7 @@ export declare const COMMANDS: readonly [{
|
|
|
982
1095
|
readonly params: [{
|
|
983
1096
|
readonly name: "tabId";
|
|
984
1097
|
readonly type: "number";
|
|
985
|
-
readonly
|
|
986
|
-
readonly description: "目标标签页 ID";
|
|
1098
|
+
readonly description: "可选;指定标签页的 Cookie 存储区,省略时使用浏览器默认存储区";
|
|
987
1099
|
}, {
|
|
988
1100
|
readonly name: "name";
|
|
989
1101
|
readonly type: "string";
|
|
@@ -992,7 +1104,7 @@ export declare const COMMANDS: readonly [{
|
|
|
992
1104
|
}, {
|
|
993
1105
|
readonly name: "url";
|
|
994
1106
|
readonly type: "string";
|
|
995
|
-
readonly description: "
|
|
1107
|
+
readonly description: "Cookie 查询 URL;未传 tabId 时必填,省略时使用指定标签页 URL";
|
|
996
1108
|
}, {
|
|
997
1109
|
readonly name: "domain";
|
|
998
1110
|
readonly type: "string";
|
|
@@ -1002,15 +1114,20 @@ export declare const COMMANDS: readonly [{
|
|
|
1002
1114
|
readonly type: "string";
|
|
1003
1115
|
readonly description: "可选精确 path 过滤";
|
|
1004
1116
|
}];
|
|
1005
|
-
readonly
|
|
1117
|
+
readonly notes: readonly ["只读取指定非分区 Cookie,不列举全部、不回退分区 Cookie,拒绝 HttpOnly;禁止读取认证 Token。指定 url 不导航,指定 tabId 仅选择存储区时不启动采集。"];
|
|
1118
|
+
readonly result: readonly ["找到时 found=true 并返回 value/domain/path;不存在时 found=false。"];
|
|
1119
|
+
readonly examples: ["get_cookie --payload '{\"tabId\":12345,\"name\":\"feature_flag\"}'", "get_cookie --payload '{\"url\":\"https://www.taobao.com/\",\"name\":\"tracknick\"}'", "get_cookie --payload '{\"tabId\":12345,\"name\":\"edith_switch_br.rx-vehicle-search_home\",\"domain\":\"taobao.com\"}'", "get_cookie --payload '{\"tabId\":12345,\"name\":\"tracknick\",\"url\":\"https://www.taobao.com/\",\"domain\":\"taobao.com\",\"path\":\"/\"}'"];
|
|
1006
1120
|
}, {
|
|
1007
1121
|
readonly name: "set_cookie";
|
|
1008
|
-
readonly description: "
|
|
1122
|
+
readonly description: "在目标浏览器设置一个指定非分区 session Cookie,可选刷新指定页面";
|
|
1009
1123
|
readonly params: [{
|
|
1010
1124
|
readonly name: "tabId";
|
|
1011
1125
|
readonly type: "number";
|
|
1012
|
-
readonly
|
|
1013
|
-
|
|
1126
|
+
readonly description: "可选;指定标签页的 Cookie 存储区,reload=true 时必填";
|
|
1127
|
+
}, {
|
|
1128
|
+
readonly name: "url";
|
|
1129
|
+
readonly type: "string";
|
|
1130
|
+
readonly description: "Cookie 目标 URL;未传 tabId 时必填,省略时使用指定标签页 URL";
|
|
1014
1131
|
}, {
|
|
1015
1132
|
readonly name: "name";
|
|
1016
1133
|
readonly type: "string";
|
|
@@ -1024,7 +1141,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1024
1141
|
}, {
|
|
1025
1142
|
readonly name: "domain";
|
|
1026
1143
|
readonly type: "string";
|
|
1027
|
-
readonly description: "Cookie
|
|
1144
|
+
readonly description: "Cookie 域,默认目标 URL 的 host;只允许目标 host 或其父域";
|
|
1028
1145
|
}, {
|
|
1029
1146
|
readonly name: "path";
|
|
1030
1147
|
readonly type: "string";
|
|
@@ -1032,9 +1149,11 @@ export declare const COMMANDS: readonly [{
|
|
|
1032
1149
|
}, {
|
|
1033
1150
|
readonly name: "reload";
|
|
1034
1151
|
readonly type: "boolean";
|
|
1035
|
-
readonly description: "
|
|
1152
|
+
readonly description: "设置后是否刷新指定 tabId,默认 false;true 时必须传 tabId";
|
|
1036
1153
|
}];
|
|
1037
|
-
readonly
|
|
1154
|
+
readonly notes: readonly ["仅写非分区 session Cookie,不支持删除。reload=true 时校验目标域与刷新页域的授权。"];
|
|
1155
|
+
readonly result: readonly ["返回 url/name/domain/path/reloaded,指定标签页时包含 tabId;不回显 Cookie 值。"];
|
|
1156
|
+
readonly examples: ["set_cookie --payload '{\"tabId\":12345,\"name\":\"feature_flag\",\"value\":\"enabled\"}'", "set_cookie --payload '{\"url\":\"https://www.taobao.com/\",\"name\":\"feature_flag\",\"value\":\"enabled\"}'", "set_cookie --payload '{\"tabId\":12345,\"name\":\"edith_switch_br.rx-vehicle-search_home\",\"value\":\"3.6.63\",\"domain\":\"taobao.com\",\"reload\":true}'"];
|
|
1038
1157
|
}, {
|
|
1039
1158
|
readonly name: "page_frames";
|
|
1040
1159
|
readonly description: "获取页面主 frame 与所有 iframe 列表";
|
|
@@ -1044,6 +1163,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1044
1163
|
readonly required: true;
|
|
1045
1164
|
readonly description: "目标标签页 ID";
|
|
1046
1165
|
}];
|
|
1166
|
+
readonly result: readonly ["frames[] 包含 frameId、url、name 和 isMainFrame;frameId 可用于 page_eval 等支持 frame 定位的 action。"];
|
|
1047
1167
|
readonly examples: ["page_frames --payload '{\"tabId\":12345}'"];
|
|
1048
1168
|
}, {
|
|
1049
1169
|
readonly name: "request_domain_permission";
|
|
@@ -1054,6 +1174,8 @@ export declare const COMMANDS: readonly [{
|
|
|
1054
1174
|
readonly required: true;
|
|
1055
1175
|
readonly description: "需要授权的域名,如 example.com";
|
|
1056
1176
|
}];
|
|
1177
|
+
readonly notes: readonly ["domain 使用纯主机名,不传 URL。仅在非 BUC send_request 报域权限缺失时申请,BUC 不使用浏览器域权限。", "弹窗等待用户选择,90 秒超时或关闭按拒绝处理;granted=true 后才重试原请求。"];
|
|
1178
|
+
readonly result: readonly ["返回 granted、domain,授权成功时包含 origin。"];
|
|
1057
1179
|
readonly examples: ["request_domain_permission --payload '{\"domain\":\"example.com\"}'"];
|
|
1058
1180
|
}, {
|
|
1059
1181
|
readonly name: "run_actions";
|
|
@@ -1070,6 +1192,8 @@ export declare const COMMANDS: readonly [{
|
|
|
1070
1192
|
readonly required: true;
|
|
1071
1193
|
readonly description: "所有步骤共享的 tabId,步骤自身指定的优先";
|
|
1072
1194
|
}];
|
|
1073
|
-
readonly
|
|
1195
|
+
readonly notes: readonly ["最多 50 步,不允许嵌套 run_actions;需要根据每步效果决策时逐步调用普通 action。"];
|
|
1196
|
+
readonly result: readonly ["返回 results、completedSteps、totalSteps;失败时包含 error/failedStep,后续步骤未执行。"];
|
|
1197
|
+
readonly examples: ["run_actions --payload '{\"tabId\":12345,\"actions\":[{\"action\":\"page_hover\",\"data\":{\"selector\":\"#menu\"}},{\"action\":\"page_click\",\"data\":{\"selector\":\"#menu-item\"}}]}'"];
|
|
1074
1198
|
}];
|
|
1075
1199
|
export declare const COMMAND_MAP: ReadonlyMap<string, CommandDef>;
|