@mearl/client 3.0.0-beta.5 → 3.0.0-beta.8
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 +18 -14
- package/dist/actionTimeouts.js +0 -3
- package/dist/autoUpdate.js +2 -1
- package/dist/bin.js +12 -5
- package/dist/capabilityHelp.d.ts +4 -0
- package/dist/capabilityHelp.js +68 -0
- package/dist/check.js +1 -1
- package/dist/cli.js +17 -16
- package/dist/commandHelp.js +3 -3
- package/dist/commandSuggestions.d.ts +3 -0
- package/dist/commandSuggestions.js +16 -5
- package/dist/commands.d.ts +50 -55
- package/dist/commands.js +41 -41
- package/dist/guide.d.ts +46 -0
- package/dist/guide.js +71 -0
- package/dist/guides/api-browser-setup.md +93 -0
- package/dist/guides/api-page-automation.md +140 -0
- package/dist/guides/api-page-debugging.md +39 -0
- package/dist/guides/api-page-environment.md +37 -0
- package/dist/guides/api-request-debugging.md +54 -0
- package/dist/guides/browser-tool-cooperation.md +23 -0
- package/dist/guides/core.md +60 -0
- package/dist/guides/related-skills.md +32 -0
- package/dist/guides/scripting.md +21 -0
- package/dist/guides/troubleshooting.md +170 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -5
- package/dist/plugins/officialPluginInstaller.js +2 -1
- package/dist/plugins/pluginRegistry.js +9 -3
- package/dist/plugins/runtime/pluginDiagnostics.js +1 -1
- package/dist/plugins/runtime/pluginHostServer.js +1 -1
- package/dist/plugins/runtime/pluginPageManager.js +2 -2
- package/dist/plugins/runtime/pluginStateManager.js +1 -1
- package/dist/plugins/runtime/pluginTaskManager.js +2 -2
- package/dist/plugins/sdk/plugin.d.ts +2 -0
- package/dist/plugins/sdk/plugin.js +17 -9
- package/dist/script.js +2 -1
- package/dist/socket.js +32 -8
- package/dist/unified.js +11 -1
- package/dist/unifiedConfig.d.ts +4 -0
- package/dist/unifiedConfig.js +11 -0
- package/package.json +10 -10
package/dist/commands.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export interface CommandDef {
|
|
|
14
14
|
summary?: string;
|
|
15
15
|
/** CLI 中用于推荐 canonical action 的常见表达,不会作为可执行 action。 */
|
|
16
16
|
aliases?: readonly string[];
|
|
17
|
+
/** 仅用于错误建议;按表达给出 canonical action 的适用示例,不增加可执行别名。 */
|
|
18
|
+
aliasExamples?: Readonly<Record<string, string>>;
|
|
17
19
|
/** payload 字段说明 */
|
|
18
20
|
params?: ParamDef[];
|
|
19
21
|
/** 是否支持 --output */
|
|
@@ -86,7 +88,7 @@ export declare const COMMANDS: readonly [{
|
|
|
86
88
|
readonly examples: ["tab_checkpoint --payload '{\"tabId\":12345}'"];
|
|
87
89
|
}, {
|
|
88
90
|
readonly name: "get_requests";
|
|
89
|
-
readonly description: "
|
|
91
|
+
readonly description: "获取最近的网络请求(协议请求或普通 xhr/fetch)";
|
|
90
92
|
readonly params: [{
|
|
91
93
|
readonly name: "tabId";
|
|
92
94
|
readonly type: "number";
|
|
@@ -98,8 +100,8 @@ export declare const COMMANDS: readonly [{
|
|
|
98
100
|
readonly description: "返回条数,默认 10";
|
|
99
101
|
}, {
|
|
100
102
|
readonly name: "source";
|
|
101
|
-
readonly type: "\"
|
|
102
|
-
readonly description: "数据来源,不填时默认
|
|
103
|
+
readonly type: "\"protocol\" | \"requests\" | \"all\"";
|
|
104
|
+
readonly description: "数据来源,不填时默认 all;all 返回全部业务请求";
|
|
103
105
|
}, {
|
|
104
106
|
readonly name: "filter";
|
|
105
107
|
readonly type: "string";
|
|
@@ -133,9 +135,9 @@ export declare const COMMANDS: readonly [{
|
|
|
133
135
|
readonly type: "boolean";
|
|
134
136
|
readonly description: "只返回数据结构,不返回叶子值";
|
|
135
137
|
}];
|
|
136
|
-
readonly notes: readonly ["流式请求开始后即进入缓冲区;页面及 App 桥代发的
|
|
138
|
+
readonly notes: readonly ["流式请求开始后即进入缓冲区;页面及 App 桥代发的 协议 SSE 都归入 protocol。无法归属当前页面 target 的 Service Worker 请求不在采集范围内。"];
|
|
137
139
|
readonly result: readonly ["nextCursor 用于同类查询续读,hasMore 表示还有数据,gap 表示缓冲区淘汰造成缺口;checkpoint cursor 可分别用于三类查询的初始边界。", "省略正文时不返回 postData / responseBody 字段;指定 fields 后需要同时读取全文时显式传 includeBody:true。", "isPending 标记未完成请求;SSE 的 responseBody 保存按序到达的 event/data/timestamp/duration 分片。敏感请求头返回脱敏值。"];
|
|
138
|
-
readonly examples: ["get_requests --payload '{\"tabId\":12345,\"count\":5}'", "get_requests --payload '{\"tabId\":12345,\"source\":\"
|
|
140
|
+
readonly examples: ["get_requests --payload '{\"tabId\":12345,\"count\":5}'", "get_requests --payload '{\"tabId\":12345,\"source\":\"protocol\",\"filter\":\"cart\"}'"];
|
|
139
141
|
}, {
|
|
140
142
|
readonly name: "get_logs";
|
|
141
143
|
readonly description: "获取浏览器控制台日志";
|
|
@@ -242,7 +244,7 @@ export declare const COMMANDS: readonly [{
|
|
|
242
244
|
readonly description: "请求 query/body 字段子集匹配;$index 从 0 开始指定调用顺序";
|
|
243
245
|
}];
|
|
244
246
|
readonly notes: readonly ["启用时至少提供 mockData 或非空 fields;非空 fields 优先。fields 每项 { path: string, value: any },path 支持点号和数组索引。", "相同 apiName 的多条无条件 Mock 会覆盖;conditions 子集匹配 query/body(含 data 内层),不同条件可共存;$index 从 0 起控制调用顺序,不参与字段匹配。", "大字段可用顶层 @<绝对路径> 文件引用或 --payload-file;文件展开后仍受 Native Messaging 单条消息大小限制。"];
|
|
245
|
-
readonly examples: ["set_mock --payload '{\"tabId\":12345,\"apiName\":\"
|
|
247
|
+
readonly examples: ["set_mock --payload '{\"tabId\":12345,\"apiName\":\"cart.query\",\"mockData\":{\"ret\":[\"SUCCESS::调用成功\"]}}'", "set_mock --payload-file ./mock-data.json"];
|
|
246
248
|
}, {
|
|
247
249
|
readonly name: "get_mocks";
|
|
248
250
|
readonly description: "查看当前生效的 mock 列表";
|
|
@@ -307,7 +309,7 @@ export declare const COMMANDS: readonly [{
|
|
|
307
309
|
readonly type: "string";
|
|
308
310
|
readonly description: "规则说明";
|
|
309
311
|
}];
|
|
310
|
-
readonly notes: readonly ["扩展模式规则持久化;CDP 仅支持会话级 modifyHeaders 请求头 set,不支持响应头、initiatorDomains 或其他动作。Provider 是否支持以其能力声明为准。", "扩展模式会检查规则请求 URL 和显式来源域名的访问权限;缺失时仍保存规则,返回 warnings 和 missingOrigins,不自动弹窗。可在请求规则页面授权,或按提示调用
|
|
312
|
+
readonly notes: readonly ["扩展模式规则持久化;CDP 仅支持会话级 modifyHeaders 请求头 set,不支持响应头、initiatorDomains 或其他动作。Provider 是否支持以其能力声明为准。", "扩展模式会检查规则请求 URL 和显式来源域名的访问权限;缺失时仍保存规则,返回 warnings 和 missingOrigins,不自动弹窗。可在请求规则页面授权,或按提示调用 request_permission。复杂 URL 表达式无法完整推断域名时会提示手动检查。"];
|
|
311
313
|
readonly examples: ["set_rule --payload '{\"actionType\":\"block\",\"filter\":\"^https://example\\\\.com/ads/.*\"}'", "set_rule --payload '{\"ruleId\":42,\"enabled\":false}'"];
|
|
312
314
|
}, {
|
|
313
315
|
readonly name: "get_rules";
|
|
@@ -367,46 +369,19 @@ export declare const COMMANDS: readonly [{
|
|
|
367
369
|
readonly result: readonly ["返回 status、statusText、headers、body、bodyType、attachedCookieCount;bodyType 为 json/text/base64,二进制 body 需解码后保存。"];
|
|
368
370
|
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\"}]}'", "send_request --payload '{\"url\":\"https://api.example.com/upload\",\"method\":\"POST\",\"bodyFile\":{\"filePath\":\"/absolute/path/image.png\",\"contentType\":\"image/png\"}}'"];
|
|
369
371
|
}, {
|
|
370
|
-
readonly name: "
|
|
371
|
-
readonly description: "
|
|
372
|
+
readonly name: "browser_list";
|
|
373
|
+
readonly description: "列出所有浏览器及其连接状态、类型和 Provider 托管实例信息";
|
|
374
|
+
readonly summary: "列出本地及远端浏览器与连接状态";
|
|
372
375
|
readonly params: [{
|
|
373
|
-
readonly name: "
|
|
376
|
+
readonly name: "provider";
|
|
374
377
|
readonly type: "string";
|
|
375
|
-
readonly
|
|
376
|
-
readonly description: "mtop API 名称";
|
|
378
|
+
readonly description: "配合 launchForm,仅查询一个本机已安装 Provider 的启动候选;需 --local";
|
|
377
379
|
}, {
|
|
378
|
-
readonly name: "
|
|
380
|
+
readonly name: "launchForm";
|
|
379
381
|
readonly type: "object";
|
|
380
|
-
readonly description: "
|
|
381
|
-
}, {
|
|
382
|
-
readonly name: "version";
|
|
383
|
-
readonly type: "string";
|
|
384
|
-
readonly description: "API 版本,默认 1.0";
|
|
385
|
-
}, {
|
|
386
|
-
readonly name: "method";
|
|
387
|
-
readonly type: "string";
|
|
388
|
-
readonly description: "HTTP 方法,默认 GET";
|
|
389
|
-
}, {
|
|
390
|
-
readonly name: "appKey";
|
|
391
|
-
readonly type: "string";
|
|
392
|
-
readonly description: "签名使用的 appKey,默认 12574478";
|
|
393
|
-
}, {
|
|
394
|
-
readonly name: "env";
|
|
395
|
-
readonly type: "\"prod\" | \"pre\"";
|
|
396
|
-
readonly description: "请求环境,默认 prod";
|
|
397
|
-
}, {
|
|
398
|
-
readonly name: "timeout";
|
|
399
|
-
readonly type: "number";
|
|
400
|
-
readonly description: "超时毫秒数,默认 10000";
|
|
382
|
+
readonly description: "现有动态启动表单请求:{variant?,values:{}},不创建或接入实例";
|
|
401
383
|
}];
|
|
402
|
-
readonly
|
|
403
|
-
readonly result: readonly ["返回 success、response、requestData;业务成功需检查 response.ret。"];
|
|
404
|
-
readonly examples: ["send_mtop_request --payload '{\"api\":\"mtop.trade.order.detail\",\"data\":{\"orderId\":\"123\"}}'"];
|
|
405
|
-
}, {
|
|
406
|
-
readonly name: "browser_list";
|
|
407
|
-
readonly description: "列出所有浏览器及其连接状态、类型和 Provider 托管实例信息";
|
|
408
|
-
readonly summary: "列出本地及远端浏览器与连接状态";
|
|
409
|
-
readonly examples: ["browser_list"];
|
|
384
|
+
readonly examples: ["browser_list", "browser_list --local"];
|
|
410
385
|
}, {
|
|
411
386
|
readonly name: "browser_release";
|
|
412
387
|
readonly description: "释放当前浏览器的调试控制和会话级临时效果(含设备/时区模拟);不用于普通任务收尾,Provider 实例的行为以 mearl <providerId> 为准";
|
|
@@ -489,6 +464,9 @@ export declare const COMMANDS: readonly [{
|
|
|
489
464
|
readonly name: "tab_open";
|
|
490
465
|
readonly description: "打开或按 URL 规则复用 Tab,并等待新页面加载完成";
|
|
491
466
|
readonly aliases: readonly ["tab_new", "new_tab", "tab_create", "create_tab"];
|
|
467
|
+
readonly aliasExamples: {
|
|
468
|
+
readonly tab_activate: "tab_open --payload '{\"url\":\"https://example.com\",\"reuse\":\"require\",\"active\":true}'";
|
|
469
|
+
};
|
|
492
470
|
readonly params: [{
|
|
493
471
|
readonly name: "url";
|
|
494
472
|
readonly type: "string";
|
|
@@ -529,7 +507,7 @@ export declare const COMMANDS: readonly [{
|
|
|
529
507
|
}, {
|
|
530
508
|
readonly name: "appProfile";
|
|
531
509
|
readonly type: "string";
|
|
532
|
-
readonly description: "按已安装档案应用 App 环境,ID
|
|
510
|
+
readonly description: "按已安装档案应用 App 环境,ID 与限制见当前动态帮助。需要 iframe WebView 和系统栏时同时传 emulation.deviceShell=true";
|
|
533
511
|
}, {
|
|
534
512
|
readonly name: "os";
|
|
535
513
|
readonly type: "\"ios\" | \"android\"";
|
|
@@ -581,6 +559,9 @@ export declare const COMMANDS: readonly [{
|
|
|
581
559
|
}, {
|
|
582
560
|
readonly name: "page_click";
|
|
583
561
|
readonly description: "点击页面元素,支持 CSS/@ref、可见文本或视口坐标定位";
|
|
562
|
+
readonly aliasExamples: {
|
|
563
|
+
readonly page_select: "page_click --payload '{\"tabId\":12345,\"text\":\"选项文案\",\"role\":\"option\"}'";
|
|
564
|
+
};
|
|
584
565
|
readonly params: [{
|
|
585
566
|
readonly name: "selector";
|
|
586
567
|
readonly type: "string";
|
|
@@ -624,7 +605,7 @@ export declare const COMMANDS: readonly [{
|
|
|
624
605
|
readonly description: "目标标签页 ID";
|
|
625
606
|
}];
|
|
626
607
|
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 与可用观察或最小快照核验,避免重复提交。CLI 单次调用失败以退出码 1 结束;脚本需检查 action.success。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "effects.texts 按需返回普通可见文本的 selector/text,不代表可点击控件或业务成功;超限或覆盖不完整时仍提示补快照。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。"];
|
|
627
|
-
readonly notes: readonly ["selector / text / point 必须且只能提供一个。隐藏页 auto 使用 DOM;只有明确依赖真实用户手势时才激活页面。", "原生 select 可按 option 文本点击;checkbox/radio 返回 controlState.checkedBefore/checkedAfter。"];
|
|
608
|
+
readonly notes: readonly ["selector / text / point 必须且只能提供一个。隐藏页 auto 使用 DOM;只有明确依赖真实用户手势时才激活页面。", "auto 对原生 option、checkbox/radio 使用状态感知的 DOM 路径;显式 mouse/touch 保留可信输入。", "原生 select 可按 option 文本点击;auto/dom 返回 selectionState.valueBefore/valueAfter/selectedAfter,检查选中状态是否保持。checkbox/radio 返回 controlState.checkedBefore/checkedAfter。"];
|
|
628
609
|
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\"}'"];
|
|
629
610
|
}, {
|
|
630
611
|
readonly name: "page_drag";
|
|
@@ -659,6 +640,9 @@ export declare const COMMANDS: readonly [{
|
|
|
659
640
|
}, {
|
|
660
641
|
readonly name: "page_type";
|
|
661
642
|
readonly description: "向输入框填写文本,兼容 React 受控组件";
|
|
643
|
+
readonly aliasExamples: {
|
|
644
|
+
readonly page_fill: "page_type --payload '{\"tabId\":12345,\"selector\":\"@e6\",\"text\":\"填写内容\",\"clearFirst\":true}'";
|
|
645
|
+
};
|
|
662
646
|
readonly params: [{
|
|
663
647
|
readonly name: "selector";
|
|
664
648
|
readonly type: "string";
|
|
@@ -820,6 +804,14 @@ export declare const COMMANDS: readonly [{
|
|
|
820
804
|
readonly name: "modifiers";
|
|
821
805
|
readonly type: "string[]";
|
|
822
806
|
readonly description: "修饰键数组:ctrl/alt/shift/meta/cmd";
|
|
807
|
+
}, {
|
|
808
|
+
readonly name: "dialogId";
|
|
809
|
+
readonly type: "string";
|
|
810
|
+
readonly description: "原生弹窗回执或 page_snapshot 中的 dialog.id;仅配合 Enter 接受或 Escape 取消";
|
|
811
|
+
}, {
|
|
812
|
+
readonly name: "promptText";
|
|
813
|
+
readonly type: "string";
|
|
814
|
+
readonly description: "仅用于 dialogId + Enter 接受原生 prompt 时填写文本";
|
|
823
815
|
}, {
|
|
824
816
|
readonly name: "pressMode";
|
|
825
817
|
readonly type: "\"auto\" | \"dom\" | \"keyboard\"";
|
|
@@ -830,7 +822,7 @@ export declare const COMMANDS: readonly [{
|
|
|
830
822
|
readonly required: true;
|
|
831
823
|
readonly description: "目标标签页 ID";
|
|
832
824
|
}];
|
|
833
|
-
readonly notes: readonly ["隐藏页 DOM 模式支持 Tab 焦点移动、原生控件 Enter/Space 激活和输入框 Enter 提交;编辑、选择、方向键和页面滚动等原生行为需可见页与 pressMode=keyboard。"];
|
|
825
|
+
readonly notes: readonly ["隐藏页 DOM 模式支持 Tab 焦点移动、原生控件 Enter/Space 激活和输入框 Enter 提交;编辑、选择、方向键和页面滚动等原生行为需可见页与 pressMode=keyboard。", "原生 alert/confirm/prompt/beforeunload 弹窗需显式传 dialogId;普通 Enter 不处理弹窗。弹窗处理绕过 DOM 观察,不自动重放被中断的动作;处理后重新读取页面。"];
|
|
834
826
|
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 与可用观察或最小快照核验,避免重复提交。CLI 单次调用失败以退出码 1 结束;脚本需检查 action.success。", "observation.effects 返回通知、控件和焦点增量,可直接复用 node.ref/selector;changed=true 且 effects 为空不表示失败。", "effects.texts 按需返回普通可见文本的 selector/text,不代表可点击控件或业务成功;超限或覆盖不完整时仍提示补快照。", "fullSnapshotRecommended/snapshotReasons 提示是否补充快照;openedTabs 返回可继续操作的 tabId 和 ready。navigation 模式的 ready 表示新页面就绪。", "显式开启的诊断通道在 diagnostics 中返回动作期间增量,与 observe 独立。", "action.data.dispatchMode / fallbackReason / defaultAction 说明实际输入路径。"];
|
|
835
827
|
readonly examples: ["page_press --payload '{\"tabId\":12345,\"key\":\"Enter\"}'"];
|
|
836
828
|
}, {
|
|
@@ -874,11 +866,14 @@ export declare const COMMANDS: readonly [{
|
|
|
874
866
|
readonly required: true;
|
|
875
867
|
readonly description: "目标标签页 ID";
|
|
876
868
|
}];
|
|
877
|
-
readonly notes: readonly ["time / selector / text / condition 必须且只能提供一个;time 范围 0–60000ms。页面交互已有内置观察,仅在需要独立等待条件时使用。"];
|
|
869
|
+
readonly notes: readonly ["time / selector / text / condition 必须且只能提供一个;time 范围 0–60000ms。页面交互已有内置观察,仅在需要独立等待条件时使用。", "等待后须立即执行已知动作时,用 mearl run 在同一脚本中 await pageWait 后紧接 pageClick,避免模型往返。整体 --timeout 须覆盖等待及后续动作;等待失败不继续点击。"];
|
|
878
870
|
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}'"];
|
|
879
871
|
}, {
|
|
880
872
|
readonly name: "page_navigate";
|
|
881
873
|
readonly description: "在当前标签页内导航到 URL、刷新页面,或沿浏览历史后退/前进";
|
|
874
|
+
readonly aliasExamples: {
|
|
875
|
+
readonly page_reload: "page_navigate --payload '{\"tabId\":12345,\"refresh\":true}'";
|
|
876
|
+
};
|
|
882
877
|
readonly params: [{
|
|
883
878
|
readonly name: "url";
|
|
884
879
|
readonly type: "string";
|
|
@@ -1065,7 +1060,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1065
1060
|
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}'"];
|
|
1066
1061
|
}, {
|
|
1067
1062
|
readonly name: "set_app_profile";
|
|
1068
|
-
readonly description: "设置已安装的 App 档案;完整 JSBridge
|
|
1063
|
+
readonly description: "设置已安装的 App 档案;完整 JSBridge 由能力包提供。可同时设置已安装的网络控件,传 emulation 时联动设备模拟";
|
|
1069
1064
|
readonly summary: "设置或清除目标标签页的 App 容器模拟";
|
|
1070
1065
|
readonly params: [{
|
|
1071
1066
|
readonly name: "enabled";
|
|
@@ -1075,7 +1070,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1075
1070
|
}, {
|
|
1076
1071
|
readonly name: "profile";
|
|
1077
1072
|
readonly type: "string";
|
|
1078
|
-
readonly description: "已安装的容器档案 ID(enabled=true
|
|
1073
|
+
readonly description: "已安装的容器档案 ID(enabled=true 时必填);当前动态帮助直接展示目标浏览器目录";
|
|
1079
1074
|
}, {
|
|
1080
1075
|
readonly name: "os";
|
|
1081
1076
|
readonly type: "\"ios\" | \"android\"";
|
|
@@ -1101,9 +1096,9 @@ export declare const COMMANDS: readonly [{
|
|
|
1101
1096
|
readonly type: "object";
|
|
1102
1097
|
readonly description: "声明式覆盖桥方法,形如 {methods:{api:{behavior|response|noop,silent?}}};不执行配置脚本";
|
|
1103
1098
|
}, {
|
|
1104
|
-
readonly name: "
|
|
1105
|
-
readonly type: "
|
|
1106
|
-
readonly description: "
|
|
1099
|
+
readonly name: "networkControl";
|
|
1100
|
+
readonly type: "object | null";
|
|
1101
|
+
readonly description: "可选已安装网络控件 {id,value};null 清除,省略时保持当前设置。仅作用于目标 tab";
|
|
1107
1102
|
}, {
|
|
1108
1103
|
readonly name: "emulation";
|
|
1109
1104
|
readonly type: "object";
|
|
@@ -1119,8 +1114,8 @@ export declare const COMMANDS: readonly [{
|
|
|
1119
1114
|
readonly description: "目标标签页 ID";
|
|
1120
1115
|
}];
|
|
1121
1116
|
readonly notes: readonly ["只有用户明确要求 App/客户端/容器/JSBridge 模拟时启用。移动视口或普通 H5 调试使用 set_device_emulation。", "emulation={} 使用档案推荐设备;enabled=false 时省略 emulation 只清除 App 注入,传 {} 同时清除设备模拟。", "bridgeConfig.methods 按方法声明 behavior / response / noop 三选一,可传 silent;只支持受控行为、固定 JSON 回包或成功空实现,不执行配置脚本。"];
|
|
1122
|
-
readonly result: readonly ["返回 enabled、profile、label、userAgent、os、
|
|
1123
|
-
readonly examples: ["set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"reader\"}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"reader\",\"
|
|
1117
|
+
readonly result: readonly ["返回 enabled、profile、label、userAgent、os、networkControl、reloaded;联动设备时额外返回实际 emulation。"];
|
|
1118
|
+
readonly examples: ["set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"reader\"}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"reader\",\"networkControl\":{\"id\":\"environment\",\"value\":\"pre\"}}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":false,\"networkControl\":null}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"reader\",\"emulation\":{}}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"wallet\",\"emulation\":{\"preset\":\"pixel-11\",\"deviceShell\":true}}'", "set_app_profile --payload '{\"tabId\":12345,\"enabled\":true,\"profile\":\"reader\",\"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\":{}}'"];
|
|
1124
1119
|
}, {
|
|
1125
1120
|
readonly name: "set_timezone";
|
|
1126
1121
|
readonly description: "覆盖目标 tab 的时区,传空字符串恢复浏览器默认时区";
|
|
@@ -1213,7 +1208,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1213
1208
|
readonly result: readonly ["frames[] 包含 frameId、url、name 和 isMainFrame;frameId 可用于 page_eval 等支持 frame 定位的 action。"];
|
|
1214
1209
|
readonly examples: ["page_frames --payload '{\"tabId\":12345}'"];
|
|
1215
1210
|
}, {
|
|
1216
|
-
readonly name: "
|
|
1211
|
+
readonly name: "request_permission";
|
|
1217
1212
|
readonly description: "申请访问指定域名的权限(必要时弹窗让用户授权)";
|
|
1218
1213
|
readonly params: [{
|
|
1219
1214
|
readonly name: "domain";
|
|
@@ -1223,7 +1218,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1223
1218
|
}];
|
|
1224
1219
|
readonly notes: readonly ["domain 使用纯主机名,不传 URL。在 send_request 或 set_rule 提示缺少浏览器域名权限时申请。", "弹窗等待用户选择,90 秒超时或关闭按拒绝处理;granted=true 后才重试原请求。"];
|
|
1225
1220
|
readonly result: readonly ["返回 granted、domain,授权成功时包含 origin。"];
|
|
1226
|
-
readonly examples: ["
|
|
1221
|
+
readonly examples: ["request_permission --payload '{\"domain\":\"example.com\"}'"];
|
|
1227
1222
|
}, {
|
|
1228
1223
|
readonly name: "run_actions";
|
|
1229
1224
|
readonly description: "批量顺序执行多个 action,减少往返延迟。遇错即停,返回已完成步骤结果;步骤内的页面动作不带内置观察";
|
package/dist/commands.js
CHANGED
|
@@ -101,7 +101,7 @@ export const COMMANDS = [
|
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
name: 'get_requests',
|
|
104
|
-
description: '
|
|
104
|
+
description: '获取最近的网络请求(协议请求或普通 xhr/fetch)',
|
|
105
105
|
params: [
|
|
106
106
|
{
|
|
107
107
|
name: 'tabId',
|
|
@@ -112,8 +112,8 @@ export const COMMANDS = [
|
|
|
112
112
|
{ name: 'count', type: 'number', description: '返回条数,默认 10' },
|
|
113
113
|
{
|
|
114
114
|
name: 'source',
|
|
115
|
-
type: '"
|
|
116
|
-
description: '数据来源,不填时默认
|
|
115
|
+
type: '"protocol" | "requests" | "all"',
|
|
116
|
+
description: '数据来源,不填时默认 all;all 返回全部业务请求',
|
|
117
117
|
},
|
|
118
118
|
{ name: 'filter', type: 'string', description: '按 URL 或 API 名称过滤,支持正则' },
|
|
119
119
|
{ name: 'since', type: 'number', description: '只返回最近 N 秒内的请求' },
|
|
@@ -133,7 +133,7 @@ export const COMMANDS = [
|
|
|
133
133
|
{ name: 'keysOnly', type: 'boolean', description: '只返回数据结构,不返回叶子值' },
|
|
134
134
|
],
|
|
135
135
|
notes: [
|
|
136
|
-
'流式请求开始后即进入缓冲区;页面及 App 桥代发的
|
|
136
|
+
'流式请求开始后即进入缓冲区;页面及 App 桥代发的 协议 SSE 都归入 protocol。无法归属当前页面 target 的 Service Worker 请求不在采集范围内。',
|
|
137
137
|
],
|
|
138
138
|
result: [
|
|
139
139
|
'nextCursor 用于同类查询续读,hasMore 表示还有数据,gap 表示缓冲区淘汰造成缺口;checkpoint cursor 可分别用于三类查询的初始边界。',
|
|
@@ -142,7 +142,7 @@ export const COMMANDS = [
|
|
|
142
142
|
],
|
|
143
143
|
examples: [
|
|
144
144
|
`get_requests --payload '{"tabId":12345,"count":5}'`,
|
|
145
|
-
`get_requests --payload '{"tabId":12345,"source":"
|
|
145
|
+
`get_requests --payload '{"tabId":12345,"source":"protocol","filter":"cart"}'`,
|
|
146
146
|
],
|
|
147
147
|
},
|
|
148
148
|
{
|
|
@@ -249,7 +249,7 @@ export const COMMANDS = [
|
|
|
249
249
|
'大字段可用顶层 @<绝对路径> 文件引用或 --payload-file;文件展开后仍受 Native Messaging 单条消息大小限制。',
|
|
250
250
|
],
|
|
251
251
|
examples: [
|
|
252
|
-
`set_mock --payload '{"tabId":12345,"apiName":"
|
|
252
|
+
`set_mock --payload '{"tabId":12345,"apiName":"cart.query","mockData":{"ret":["SUCCESS::调用成功"]}}'`,
|
|
253
253
|
`set_mock --payload-file ./mock-data.json`,
|
|
254
254
|
],
|
|
255
255
|
},
|
|
@@ -303,7 +303,7 @@ export const COMMANDS = [
|
|
|
303
303
|
],
|
|
304
304
|
notes: [
|
|
305
305
|
'扩展模式规则持久化;CDP 仅支持会话级 modifyHeaders 请求头 set,不支持响应头、initiatorDomains 或其他动作。Provider 是否支持以其能力声明为准。',
|
|
306
|
-
'扩展模式会检查规则请求 URL 和显式来源域名的访问权限;缺失时仍保存规则,返回 warnings 和 missingOrigins,不自动弹窗。可在请求规则页面授权,或按提示调用
|
|
306
|
+
'扩展模式会检查规则请求 URL 和显式来源域名的访问权限;缺失时仍保存规则,返回 warnings 和 missingOrigins,不自动弹窗。可在请求规则页面授权,或按提示调用 request_permission。复杂 URL 表达式无法完整推断域名时会提示手动检查。',
|
|
307
307
|
],
|
|
308
308
|
examples: [
|
|
309
309
|
`set_rule --payload '{"actionType":"block","filter":"^https://example\\\\.com/ads/.*"}'`,
|
|
@@ -368,33 +368,16 @@ export const COMMANDS = [
|
|
|
368
368
|
`send_request --payload '{"url":"https://api.example.com/upload","method":"POST","bodyFile":{"filePath":"/absolute/path/image.png","contentType":"image/png"}}'`,
|
|
369
369
|
],
|
|
370
370
|
},
|
|
371
|
-
{
|
|
372
|
-
name: 'send_mtop_request',
|
|
373
|
-
description: '使用目标浏览器 Cookie 发起 mtop 请求,自动处理签名和 token',
|
|
374
|
-
params: [
|
|
375
|
-
{ name: 'api', type: 'string', required: true, description: 'mtop API 名称' },
|
|
376
|
-
{ name: 'data', type: 'object', description: '请求数据' },
|
|
377
|
-
{ name: 'version', type: 'string', description: 'API 版本,默认 1.0' },
|
|
378
|
-
{ name: 'method', type: 'string', description: 'HTTP 方法,默认 GET' },
|
|
379
|
-
{ name: 'appKey', type: 'string', description: '签名使用的 appKey,默认 12574478' },
|
|
380
|
-
{ name: 'env', type: '"prod" | "pre"', description: '请求环境,默认 prod' },
|
|
381
|
-
{ name: 'timeout', type: 'number', description: '超时毫秒数,默认 10000' },
|
|
382
|
-
],
|
|
383
|
-
notes: [
|
|
384
|
-
'需要目标浏览器有对应登录态;Mearl 自动处理签名,不依赖页面脚本。api 以 mopen. 开头时使用 mopen 协议。',
|
|
385
|
-
'env=prod/pre 的网关由已安装的请求协议能力提供。',
|
|
386
|
-
],
|
|
387
|
-
result: ['返回 success、response、requestData;业务成功需检查 response.ret。'],
|
|
388
|
-
examples: [
|
|
389
|
-
`send_mtop_request --payload '{"api":"mtop.trade.order.detail","data":{"orderId":"123"}}'`,
|
|
390
|
-
],
|
|
391
|
-
},
|
|
392
371
|
// ── 浏览器 ────────────────────────────────────────────────────────────────
|
|
393
372
|
{
|
|
394
373
|
name: 'browser_list',
|
|
395
374
|
description: '列出所有浏览器及其连接状态、类型和 Provider 托管实例信息',
|
|
396
375
|
summary: '列出本地及远端浏览器与连接状态',
|
|
397
|
-
|
|
376
|
+
params: [
|
|
377
|
+
{ name: 'provider', type: 'string', description: '配合 launchForm,仅查询一个本机已安装 Provider 的启动候选;需 --local' },
|
|
378
|
+
{ name: 'launchForm', type: 'object', description: '现有动态启动表单请求:{variant?,values:{}},不创建或接入实例' },
|
|
379
|
+
],
|
|
380
|
+
examples: ['browser_list', 'browser_list --local'],
|
|
398
381
|
},
|
|
399
382
|
{
|
|
400
383
|
name: 'browser_release',
|
|
@@ -501,6 +484,9 @@ export const COMMANDS = [
|
|
|
501
484
|
name: 'tab_open',
|
|
502
485
|
description: '打开或按 URL 规则复用 Tab,并等待新页面加载完成',
|
|
503
486
|
aliases: ['tab_new', 'new_tab', 'tab_create', 'create_tab'],
|
|
487
|
+
aliasExamples: {
|
|
488
|
+
tab_activate: `tab_open --payload '{"url":"https://example.com","reuse":"require","active":true}'`,
|
|
489
|
+
},
|
|
504
490
|
params: [
|
|
505
491
|
{ name: 'url', type: 'string', required: true, description: '要打开的 URL' },
|
|
506
492
|
{
|
|
@@ -546,7 +532,7 @@ export const COMMANDS = [
|
|
|
546
532
|
{
|
|
547
533
|
name: 'appProfile',
|
|
548
534
|
type: 'string',
|
|
549
|
-
description: '按已安装档案应用 App 环境,ID
|
|
535
|
+
description: '按已安装档案应用 App 环境,ID 与限制见当前动态帮助。需要 iframe WebView 和系统栏时同时传 emulation.deviceShell=true',
|
|
550
536
|
},
|
|
551
537
|
{
|
|
552
538
|
name: 'os',
|
|
@@ -618,6 +604,9 @@ export const COMMANDS = [
|
|
|
618
604
|
{
|
|
619
605
|
name: 'page_click',
|
|
620
606
|
description: '点击页面元素,支持 CSS/@ref、可见文本或视口坐标定位',
|
|
607
|
+
aliasExamples: {
|
|
608
|
+
page_select: `page_click --payload '{"tabId":12345,"text":"选项文案","role":"option"}'`,
|
|
609
|
+
},
|
|
621
610
|
params: [
|
|
622
611
|
{
|
|
623
612
|
name: 'selector',
|
|
@@ -671,7 +660,8 @@ export const COMMANDS = [
|
|
|
671
660
|
result: PAGE_ACTION_RESULT,
|
|
672
661
|
notes: [
|
|
673
662
|
'selector / text / point 必须且只能提供一个。隐藏页 auto 使用 DOM;只有明确依赖真实用户手势时才激活页面。',
|
|
674
|
-
'
|
|
663
|
+
'auto 对原生 option、checkbox/radio 使用状态感知的 DOM 路径;显式 mouse/touch 保留可信输入。',
|
|
664
|
+
'原生 select 可按 option 文本点击;auto/dom 返回 selectionState.valueBefore/valueAfter/selectedAfter,检查选中状态是否保持。checkbox/radio 返回 controlState.checkedBefore/checkedAfter。',
|
|
675
665
|
],
|
|
676
666
|
examples: [
|
|
677
667
|
`page_click --payload '{"tabId":12345,"text":"提交"}'`,
|
|
@@ -726,6 +716,9 @@ export const COMMANDS = [
|
|
|
726
716
|
{
|
|
727
717
|
name: 'page_type',
|
|
728
718
|
description: '向输入框填写文本,兼容 React 受控组件',
|
|
719
|
+
aliasExamples: {
|
|
720
|
+
page_fill: `page_type --payload '{"tabId":12345,"selector":"@e6","text":"填写内容","clearFirst":true}'`,
|
|
721
|
+
},
|
|
729
722
|
params: [
|
|
730
723
|
{
|
|
731
724
|
name: 'selector',
|
|
@@ -911,6 +904,8 @@ export const COMMANDS = [
|
|
|
911
904
|
description: '按键名称:Enter/Tab/Escape/Backspace 等',
|
|
912
905
|
},
|
|
913
906
|
{ name: 'modifiers', type: 'string[]', description: '修饰键数组:ctrl/alt/shift/meta/cmd' },
|
|
907
|
+
{ name: 'dialogId', type: 'string', description: '原生弹窗回执或 page_snapshot 中的 dialog.id;仅配合 Enter 接受或 Escape 取消' },
|
|
908
|
+
{ name: 'promptText', type: 'string', description: '仅用于 dialogId + Enter 接受原生 prompt 时填写文本' },
|
|
914
909
|
{
|
|
915
910
|
name: 'pressMode',
|
|
916
911
|
type: '"auto" | "dom" | "keyboard"',
|
|
@@ -922,6 +917,7 @@ export const COMMANDS = [
|
|
|
922
917
|
],
|
|
923
918
|
notes: [
|
|
924
919
|
'隐藏页 DOM 模式支持 Tab 焦点移动、原生控件 Enter/Space 激活和输入框 Enter 提交;编辑、选择、方向键和页面滚动等原生行为需可见页与 pressMode=keyboard。',
|
|
920
|
+
'原生 alert/confirm/prompt/beforeunload 弹窗需显式传 dialogId;普通 Enter 不处理弹窗。弹窗处理绕过 DOM 观察,不自动重放被中断的动作;处理后重新读取页面。',
|
|
925
921
|
],
|
|
926
922
|
result: [
|
|
927
923
|
...PAGE_ACTION_RESULT,
|
|
@@ -961,6 +957,7 @@ export const COMMANDS = [
|
|
|
961
957
|
],
|
|
962
958
|
notes: [
|
|
963
959
|
'time / selector / text / condition 必须且只能提供一个;time 范围 0–60000ms。页面交互已有内置观察,仅在需要独立等待条件时使用。',
|
|
960
|
+
'等待后须立即执行已知动作时,用 mearl run 在同一脚本中 await pageWait 后紧接 pageClick,避免模型往返。整体 --timeout 须覆盖等待及后续动作;等待失败不继续点击。',
|
|
964
961
|
],
|
|
965
962
|
examples: [
|
|
966
963
|
`page_wait --payload '{"tabId":12345,"time":1000}'`,
|
|
@@ -973,6 +970,9 @@ export const COMMANDS = [
|
|
|
973
970
|
{
|
|
974
971
|
name: 'page_navigate',
|
|
975
972
|
description: '在当前标签页内导航到 URL、刷新页面,或沿浏览历史后退/前进',
|
|
973
|
+
aliasExamples: {
|
|
974
|
+
page_reload: `page_navigate --payload '{"tabId":12345,"refresh":true}'`,
|
|
975
|
+
},
|
|
976
976
|
params: [
|
|
977
977
|
{
|
|
978
978
|
name: 'url',
|
|
@@ -1172,14 +1172,14 @@ export const COMMANDS = [
|
|
|
1172
1172
|
},
|
|
1173
1173
|
{
|
|
1174
1174
|
name: 'set_app_profile',
|
|
1175
|
-
description: '设置已安装的 App 档案;完整 JSBridge
|
|
1175
|
+
description: '设置已安装的 App 档案;完整 JSBridge 由能力包提供。可同时设置已安装的网络控件,传 emulation 时联动设备模拟',
|
|
1176
1176
|
summary: '设置或清除目标标签页的 App 容器模拟',
|
|
1177
1177
|
params: [
|
|
1178
1178
|
{ name: 'enabled', type: 'boolean', required: true, description: 'true=启用,false=清除' },
|
|
1179
1179
|
{
|
|
1180
1180
|
name: 'profile',
|
|
1181
1181
|
type: 'string',
|
|
1182
|
-
description: '已安装的容器档案 ID(enabled=true
|
|
1182
|
+
description: '已安装的容器档案 ID(enabled=true 时必填);当前动态帮助直接展示目标浏览器目录',
|
|
1183
1183
|
},
|
|
1184
1184
|
{ name: 'os', type: '"ios" | "android"', description: '容器系统,默认 ios' },
|
|
1185
1185
|
{
|
|
@@ -1204,9 +1204,9 @@ export const COMMANDS = [
|
|
|
1204
1204
|
description: '声明式覆盖桥方法,形如 {methods:{api:{behavior|response|noop,silent?}}};不执行配置脚本',
|
|
1205
1205
|
},
|
|
1206
1206
|
{
|
|
1207
|
-
name: '
|
|
1208
|
-
type: '
|
|
1209
|
-
description: '
|
|
1207
|
+
name: 'networkControl',
|
|
1208
|
+
type: 'object | null',
|
|
1209
|
+
description: '可选已安装网络控件 {id,value};null 清除,省略时保持当前设置。仅作用于目标 tab',
|
|
1210
1210
|
},
|
|
1211
1211
|
{
|
|
1212
1212
|
name: 'emulation',
|
|
@@ -1222,12 +1222,12 @@ export const COMMANDS = [
|
|
|
1222
1222
|
'bridgeConfig.methods 按方法声明 behavior / response / noop 三选一,可传 silent;只支持受控行为、固定 JSON 回包或成功空实现,不执行配置脚本。',
|
|
1223
1223
|
],
|
|
1224
1224
|
result: [
|
|
1225
|
-
'返回 enabled、profile、label、userAgent、os、
|
|
1225
|
+
'返回 enabled、profile、label、userAgent、os、networkControl、reloaded;联动设备时额外返回实际 emulation。',
|
|
1226
1226
|
],
|
|
1227
1227
|
examples: [
|
|
1228
1228
|
`set_app_profile --payload '{"tabId":12345,"enabled":true,"profile":"reader"}'`,
|
|
1229
|
-
`set_app_profile --payload '{"tabId":12345,"enabled":true,"profile":"reader","
|
|
1230
|
-
`set_app_profile --payload '{"tabId":12345,"enabled":false,"
|
|
1229
|
+
`set_app_profile --payload '{"tabId":12345,"enabled":true,"profile":"reader","networkControl":{"id":"environment","value":"pre"}}'`,
|
|
1230
|
+
`set_app_profile --payload '{"tabId":12345,"enabled":false,"networkControl":null}'`,
|
|
1231
1231
|
`set_app_profile --payload '{"tabId":12345,"enabled":true,"profile":"reader","emulation":{}}'`,
|
|
1232
1232
|
`set_app_profile --payload '{"tabId":12345,"enabled":true,"profile":"wallet","emulation":{"preset":"pixel-11","deviceShell":true}}'`,
|
|
1233
1233
|
`set_app_profile --payload '{"tabId":12345,"enabled":true,"profile":"reader","emulation":{"preset":"ipad-mini-a17-pro","orientation":"landscape","deviceShell":true,"splitScreen":true}}'`,
|
|
@@ -1347,7 +1347,7 @@ export const COMMANDS = [
|
|
|
1347
1347
|
examples: [`page_frames --payload '{"tabId":12345}'`],
|
|
1348
1348
|
},
|
|
1349
1349
|
{
|
|
1350
|
-
name: '
|
|
1350
|
+
name: 'request_permission',
|
|
1351
1351
|
description: '申请访问指定域名的权限(必要时弹窗让用户授权)',
|
|
1352
1352
|
params: [
|
|
1353
1353
|
{
|
|
@@ -1362,7 +1362,7 @@ export const COMMANDS = [
|
|
|
1362
1362
|
'弹窗等待用户选择,90 秒超时或关闭按拒绝处理;granted=true 后才重试原请求。',
|
|
1363
1363
|
],
|
|
1364
1364
|
result: ['返回 granted、domain,授权成功时包含 origin。'],
|
|
1365
|
-
examples: [`
|
|
1365
|
+
examples: [`request_permission --payload '{"domain":"example.com"}'`],
|
|
1366
1366
|
},
|
|
1367
1367
|
// ── 组合调用 ────────────────────────────────────────────────────────────────
|
|
1368
1368
|
{
|
package/dist/guide.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** One catalog drives CLI navigation and the build-time resource copy. */
|
|
2
|
+
export declare const GUIDE_TOPICS: readonly [{
|
|
3
|
+
readonly id: "core";
|
|
4
|
+
readonly file: "core.md";
|
|
5
|
+
readonly title: "核心工作流与按需导航";
|
|
6
|
+
}, {
|
|
7
|
+
readonly id: "automation";
|
|
8
|
+
readonly file: "api-page-automation.md";
|
|
9
|
+
readonly title: "控件、文件、弹窗与结果判读";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "run";
|
|
12
|
+
readonly file: "scripting.md";
|
|
13
|
+
readonly title: "SDK、代码组合、超时与不确定结果";
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "debugging";
|
|
16
|
+
readonly file: "api-page-debugging.md";
|
|
17
|
+
readonly title: "布局、遮挡、iframe 与视觉验证";
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: "environment";
|
|
20
|
+
readonly file: "api-page-environment.md";
|
|
21
|
+
readonly title: "设备、App、时区与 Cookie";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "diagnostics";
|
|
24
|
+
readonly file: "api-request-debugging.md";
|
|
25
|
+
readonly title: "接口、日志、埋点、权限与 Mock";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "browsers";
|
|
28
|
+
readonly file: "api-browser-setup.md";
|
|
29
|
+
readonly title: "目标、会话、远端与 Provider";
|
|
30
|
+
}, {
|
|
31
|
+
readonly id: "cooperation";
|
|
32
|
+
readonly file: "browser-tool-cooperation.md";
|
|
33
|
+
readonly title: "与其他浏览器工具协作";
|
|
34
|
+
}, {
|
|
35
|
+
readonly id: "extensions";
|
|
36
|
+
readonly file: "related-skills.md";
|
|
37
|
+
readonly title: "专用 Skill 与扩展开发入口";
|
|
38
|
+
}, {
|
|
39
|
+
readonly id: "troubleshooting";
|
|
40
|
+
readonly file: "troubleshooting.md";
|
|
41
|
+
readonly title: "安装、连接与环境排查";
|
|
42
|
+
}];
|
|
43
|
+
export declare function renderGuideLinks(source: string, commandName?: string): string;
|
|
44
|
+
/** Only packaged files are read; unknown IDs never become filesystem paths. */
|
|
45
|
+
export declare function readGuide(id: string, commandName?: string, version?: string): string;
|
|
46
|
+
export declare function runGuideCli(args: string[], commandName?: string, version?: string): number;
|