@mearl/client 2.9.0 → 2.9.1
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/check.js +10 -1
- package/dist/cli.js +35 -9
- package/dist/commands.d.ts +13 -5
- package/dist/commands.js +11 -5
- package/dist/generated-browser-action-protocol.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -85,28 +85,32 @@ mearl browser_release
|
|
|
85
85
|
| `--payload <json>` | 直接传入 JSON 参数 |
|
|
86
86
|
| `--payload-file <path>` | 从文件读取 JSON 参数 |
|
|
87
87
|
| `--timeout <seconds>` | 请求超时时间 |
|
|
88
|
-
| `--compact` | 紧凑输出
|
|
88
|
+
| `--compact` | stdout 紧凑输出 |
|
|
89
89
|
| `--output <path>` | 将结果写入文件(如截图) |
|
|
90
90
|
| `--browser <id\|名称>` | 指定目标浏览器 |
|
|
91
91
|
| `--connector <id\|名称>` | 限制到一台远端机器 |
|
|
92
92
|
| `--local` | 只使用当前机器 |
|
|
93
|
+
| `--cdp` | 当前机器强制使用 CDP |
|
|
93
94
|
| `--server <url>` | 覆盖 cloud-server 地址 |
|
|
94
95
|
|
|
96
|
+
`check` 有独立的选项说明,运行 `mearl check --help` 查看。其中 `--json` 仅用于输出机器可读的检查结果。
|
|
97
|
+
|
|
95
98
|
## 支持的操作
|
|
96
99
|
|
|
97
|
-
| 分类
|
|
98
|
-
|
|
|
99
|
-
| API 调试
|
|
100
|
-
| Mock & 规则
|
|
101
|
-
|
|
|
102
|
-
| 标签页
|
|
103
|
-
| 页面操作
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
100
|
+
| 分类 | Actions |
|
|
101
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
102
|
+
| API 调试 | `tab_checkpoint` `get_requests` `get_logs` `get_events` `get_api_schema` |
|
|
103
|
+
| Mock & 规则 | `set_mock` `get_mocks` `set_rule` `get_rules` |
|
|
104
|
+
| 网络请求 | `send_request` `send_mtop_request` `request_domain_permission` |
|
|
105
|
+
| 标签页 | `tab_open` `tab_close` `tab_list` |
|
|
106
|
+
| 页面操作 | `page_click` `page_drag` `page_type` `page_hover` `page_scroll` `page_eval` `page_press` `page_wait` `page_navigate` `page_upload` |
|
|
107
|
+
| 组合调用 | `run_actions` |
|
|
108
|
+
| 页面感知 | `page_snapshot` `page_screenshot` `page_selected_element` `page_frames` |
|
|
109
|
+
| 环境与 Cookie | `set_device_emulation` `set_app_profile` `set_timezone` `get_cookie` `set_cookie` |
|
|
110
|
+
| 用户信息 | `get_user_info` |
|
|
111
|
+
| 录制 | `record_start` `record_stop` |
|
|
112
|
+
| TDBank | `tdbank_account` |
|
|
113
|
+
| 浏览器 | `browser_list` `browser_release` `browser_launch` `browser_close` |
|
|
110
114
|
|
|
111
115
|
页面交互动作(`page_click` / `page_drag` / `page_type` / `page_hover` / `page_scroll` / `page_press` / `page_upload`)默认等待异步稳定并返回 `{ action, observation }`。参数、ref 或目标解析在派发前失败时返回 `action.stage: "precondition"`,省略无意义的 `observation` / `diagnostics`,CLI 退出码为 1。传 `observe: false` 可执行裸动作;需要同一动作期间的新增 error logs 和业务 requests 时传 `diagnostics: true`,埋点通过 `diagnostics.events` 按需开启。`page_eval` 默认裸执行,可按需开启观察或诊断。
|
|
112
116
|
|
package/dist/check.js
CHANGED
|
@@ -190,6 +190,13 @@ export async function runUnifiedCheck(options, dependencies = {}) {
|
|
|
190
190
|
const browserChecks = [];
|
|
191
191
|
await Promise.all(targets.map(async (browser) => {
|
|
192
192
|
try {
|
|
193
|
+
if (options.transport === 'cdp') {
|
|
194
|
+
await client.invoke('tab_list', {}, {
|
|
195
|
+
timeoutSec,
|
|
196
|
+
browser: browser.browserId,
|
|
197
|
+
transport: 'cdp',
|
|
198
|
+
});
|
|
199
|
+
}
|
|
193
200
|
const versions = (await client.invoke('get_versions', {}, {
|
|
194
201
|
timeoutSec,
|
|
195
202
|
browser: browser.browserId,
|
|
@@ -243,7 +250,9 @@ export async function runUnifiedCheck(options, dependencies = {}) {
|
|
|
243
250
|
status: accessUrlWarning ? 'warning' : 'ok',
|
|
244
251
|
label: accessUrlWarning
|
|
245
252
|
? 'Browser command path ready; AgentBay access URL unavailable'
|
|
246
|
-
:
|
|
253
|
+
: options.transport === 'cdp'
|
|
254
|
+
? 'CDP command path'
|
|
255
|
+
: 'Browser command path',
|
|
247
256
|
details,
|
|
248
257
|
},
|
|
249
258
|
versions: publicVersions,
|
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ const CATEGORIES = [
|
|
|
15
15
|
},
|
|
16
16
|
{ title: 'Mock & 规则', names: ['set_mock', 'get_mocks', 'set_rule', 'get_rules'] },
|
|
17
17
|
{
|
|
18
|
-
title: '
|
|
18
|
+
title: '网络请求',
|
|
19
19
|
names: ['send_request', 'send_mtop_request', 'request_domain_permission'],
|
|
20
20
|
},
|
|
21
21
|
{ title: '标签页', names: ['tab_open', 'tab_close', 'tab_list'] },
|
|
@@ -67,18 +67,17 @@ function printUsage(commandName, version) {
|
|
|
67
67
|
'用法:',
|
|
68
68
|
` ${commandName} <action> [选项]`,
|
|
69
69
|
` ${commandName} <action> --help`,
|
|
70
|
-
` ${commandName} check [
|
|
70
|
+
` ${commandName} check [选项]`,
|
|
71
71
|
'',
|
|
72
72
|
'统一目标发现:',
|
|
73
|
-
' browser_list
|
|
74
|
-
'
|
|
73
|
+
' browser_list 默认聚合当前机器及已配置 cloud-server 下的浏览器。',
|
|
74
|
+
' 后续操作通过 --browser <browserId> 指定目标,客户端会自动选择本地或远端传输。',
|
|
75
75
|
'',
|
|
76
76
|
'通用选项:',
|
|
77
77
|
' --payload <json> 直接传入 JSON 参数',
|
|
78
78
|
' --payload-file <path> 从文件读取整个 JSON 参数',
|
|
79
79
|
' --timeout <seconds> 超时时间(默认按 action 推导)',
|
|
80
|
-
' --compact 输出紧凑格式 JSON',
|
|
81
|
-
' --json check 输出机器可读 JSON',
|
|
80
|
+
' --compact stdout 输出紧凑格式 JSON',
|
|
82
81
|
' --output <path> 保存输出或截图',
|
|
83
82
|
' --browser <id|名称> 指定 browser_list 返回的浏览器',
|
|
84
83
|
' --connector <id|名称> 限制到一台远端 connector',
|
|
@@ -86,6 +85,10 @@ function printUsage(commandName, version) {
|
|
|
86
85
|
' --cdp 当前机器强制使用 CDP(隐含 --local)',
|
|
87
86
|
' --server <url> 覆盖 cloud-server WebSocket URL',
|
|
88
87
|
'',
|
|
88
|
+
'其他选项:',
|
|
89
|
+
' -h, --help 查看帮助',
|
|
90
|
+
' -v, --version 查看版本',
|
|
91
|
+
'',
|
|
89
92
|
'内置命令:',
|
|
90
93
|
' check 检查指定浏览器,未指定时检查全部已连接浏览器',
|
|
91
94
|
];
|
|
@@ -94,12 +97,31 @@ function printUsage(commandName, version) {
|
|
|
94
97
|
for (const name of category.names) {
|
|
95
98
|
const command = COMMAND_MAP.get(name);
|
|
96
99
|
if (command)
|
|
97
|
-
lines.push(` ${name.padEnd(26)}${command.description}`);
|
|
100
|
+
lines.push(` ${name.padEnd(26)}${command.summary ?? command.description}`);
|
|
98
101
|
}
|
|
99
102
|
}
|
|
100
103
|
lines.push('', `运行 ${commandName} <action> --help 查看 action 参数。`);
|
|
101
104
|
console.error(lines.join('\n'));
|
|
102
105
|
}
|
|
106
|
+
function printCheckHelp(commandName) {
|
|
107
|
+
console.error([
|
|
108
|
+
'check',
|
|
109
|
+
' 检查指定浏览器,未指定时检查全部已连接浏览器',
|
|
110
|
+
'',
|
|
111
|
+
'用法:',
|
|
112
|
+
` ${commandName} check [选项]`,
|
|
113
|
+
'',
|
|
114
|
+
'选项:',
|
|
115
|
+
' --browser <id|名称> 只检查指定浏览器',
|
|
116
|
+
' --connector <id|名称> 限制到一台远端 connector',
|
|
117
|
+
' --local 只检查当前机器,不能与 --connector 同时使用',
|
|
118
|
+
' --cdp 当前机器强制使用 CDP(隐含 --local)',
|
|
119
|
+
' --server <url> 覆盖 cloud-server WebSocket URL',
|
|
120
|
+
' --timeout <seconds> 单项检查超时时间,默认 5 秒',
|
|
121
|
+
' --json 输出机器可读 JSON',
|
|
122
|
+
' -h, --help 查看帮助',
|
|
123
|
+
].join('\n'));
|
|
124
|
+
}
|
|
103
125
|
function printAdvancedCommandHelp(commandName, action) {
|
|
104
126
|
if (action !== 'connector_list')
|
|
105
127
|
return;
|
|
@@ -112,12 +134,13 @@ function printAdvancedCommandHelp(commandName, action) {
|
|
|
112
134
|
].join('\n'));
|
|
113
135
|
}
|
|
114
136
|
function printCommandHelp(commandName, command) {
|
|
137
|
+
const payloadUsage = command.params?.length ? ' [--payload <json> | --payload-file <path>]' : '';
|
|
115
138
|
const lines = [
|
|
116
139
|
`${command.name}`,
|
|
117
140
|
` ${command.description}`,
|
|
118
141
|
'',
|
|
119
142
|
'用法:',
|
|
120
|
-
` ${commandName} ${command.name} [
|
|
143
|
+
` ${commandName} ${command.name}${payloadUsage} [通用选项]`,
|
|
121
144
|
'',
|
|
122
145
|
];
|
|
123
146
|
if (command.params?.length) {
|
|
@@ -133,6 +156,7 @@ function printCommandHelp(commandName, command) {
|
|
|
133
156
|
for (const example of command.examples)
|
|
134
157
|
lines.push(` ${commandName} ${example}`);
|
|
135
158
|
}
|
|
159
|
+
lines.push('', `运行 ${commandName} --help 查看通用选项。`);
|
|
136
160
|
console.error(lines.join('\n'));
|
|
137
161
|
}
|
|
138
162
|
function printUnknownCommand(commandName, args) {
|
|
@@ -282,10 +306,12 @@ export async function runMearlCli(args, options = {}) {
|
|
|
282
306
|
const command = COMMAND_MAP.get(args[0]);
|
|
283
307
|
if (command)
|
|
284
308
|
printCommandHelp(commandName, command);
|
|
309
|
+
else if (args[0] === 'check')
|
|
310
|
+
printCheckHelp(commandName);
|
|
285
311
|
else if (ADVANCED_BUILTIN_COMMANDS.has(args[0])) {
|
|
286
312
|
printAdvancedCommandHelp(commandName, args[0]);
|
|
287
313
|
}
|
|
288
|
-
else if (args[0]?.startsWith('-')
|
|
314
|
+
else if (args[0]?.startsWith('-')) {
|
|
289
315
|
printUsage(commandName, clientVersion);
|
|
290
316
|
}
|
|
291
317
|
else {
|
package/dist/commands.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface ParamDef {
|
|
|
8
8
|
export interface CommandDef {
|
|
9
9
|
name: BrowserCommandAction;
|
|
10
10
|
description: string;
|
|
11
|
+
/** 顶层命令列表使用的简短描述;完整说明保留在 action help。 */
|
|
12
|
+
summary?: string;
|
|
11
13
|
/** CLI 中用于推荐 canonical action 的常见表达,不会作为可执行 action。 */
|
|
12
14
|
aliases?: readonly string[];
|
|
13
15
|
/** payload 字段说明 */
|
|
@@ -372,10 +374,12 @@ export declare const COMMANDS: readonly [{
|
|
|
372
374
|
}, {
|
|
373
375
|
readonly name: "browser_list";
|
|
374
376
|
readonly description: "列出所有浏览器及其连接状态、类型和托管实例信息;AgentBay 可包含镜像与持久化 Context";
|
|
377
|
+
readonly summary: "列出本地及远端浏览器与连接状态";
|
|
375
378
|
readonly examples: ["browser_list"];
|
|
376
379
|
}, {
|
|
377
380
|
readonly name: "browser_release";
|
|
378
381
|
readonly description: "按用户明确要求释放调试控制和会话级临时效果(含设备/时区模拟),保留浏览器和全部标签页;不用于普通任务收尾";
|
|
382
|
+
readonly summary: "释放浏览器调试控制及会话级临时效果";
|
|
379
383
|
readonly examples: ["browser_release", "browser_release --browser chrome-a"];
|
|
380
384
|
}, {
|
|
381
385
|
readonly name: "browser_launch";
|
|
@@ -529,7 +533,7 @@ export declare const COMMANDS: readonly [{
|
|
|
529
533
|
readonly examples: ["tab_close --payload '{\"tabId\":123}'"];
|
|
530
534
|
}, {
|
|
531
535
|
readonly name: "tab_list";
|
|
532
|
-
readonly description: "
|
|
536
|
+
readonly description: "列出目标浏览器所有窗口中的标签页";
|
|
533
537
|
readonly aliases: readonly ["tabs", "list_tabs", "show_tabs"];
|
|
534
538
|
readonly examples: ["tab_list"];
|
|
535
539
|
}, {
|
|
@@ -830,7 +834,7 @@ export declare const COMMANDS: readonly [{
|
|
|
830
834
|
readonly examples: ["page_snapshot", "page_snapshot --payload '{\"tabId\":1,\"mode\":\"viewport\"}'", "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\"}}'"];
|
|
831
835
|
}, {
|
|
832
836
|
readonly name: "page_screenshot";
|
|
833
|
-
readonly description: "
|
|
837
|
+
readonly description: "获取当前视口或指定元素截图";
|
|
834
838
|
readonly outputFlag: true;
|
|
835
839
|
readonly params: [{
|
|
836
840
|
readonly name: "selector";
|
|
@@ -872,7 +876,7 @@ export declare const COMMANDS: readonly [{
|
|
|
872
876
|
readonly examples: ["page_selected_element", "page_selected_element --output ./element.png"];
|
|
873
877
|
}, {
|
|
874
878
|
readonly name: "get_user_info";
|
|
875
|
-
readonly description: "
|
|
879
|
+
readonly description: "获取当前浏览器登录的阿里员工信息";
|
|
876
880
|
readonly params: [{
|
|
877
881
|
readonly name: "detail";
|
|
878
882
|
readonly type: "boolean";
|
|
@@ -891,6 +895,7 @@ export declare const COMMANDS: readonly [{
|
|
|
891
895
|
}, {
|
|
892
896
|
readonly name: "record_stop";
|
|
893
897
|
readonly description: "停止录制并返回完整结果(操作 + 关联请求);未在录制时不报错,返回 wasRecording: false";
|
|
898
|
+
readonly summary: "停止录制并返回操作和关联请求";
|
|
894
899
|
readonly params: [{
|
|
895
900
|
readonly name: "tabId";
|
|
896
901
|
readonly type: "number";
|
|
@@ -900,6 +905,7 @@ export declare const COMMANDS: readonly [{
|
|
|
900
905
|
}, {
|
|
901
906
|
readonly name: "set_device_emulation";
|
|
902
907
|
readonly description: "把目标 tab 切换为移动端模拟(视口/UA/触摸),等价 DevTools 设备工具栏,作用域 per-tab;需保持调试控制才持续生效";
|
|
908
|
+
readonly summary: "设置或清除目标标签页的设备模拟";
|
|
903
909
|
readonly params: [{
|
|
904
910
|
readonly name: "enabled";
|
|
905
911
|
readonly type: "boolean";
|
|
@@ -951,6 +957,7 @@ export declare const COMMANDS: readonly [{
|
|
|
951
957
|
}, {
|
|
952
958
|
readonly name: "set_app_profile";
|
|
953
959
|
readonly description: "把目标 tab 切换为 App 容器模拟态(客户端 UA + JSBridge 托管 + 页面跳转 iframe 容器栈 + scheme 唤端映射 + 自适应系统标题栏),系统栏由 iframe 外层统一渲染,并根据页面协议与桥调用切换普通、沉浸或隐藏状态;用于桌面浏览器近似实机验证 App 内 H5,需保持调试控制才持续生效";
|
|
960
|
+
readonly summary: "设置或清除目标标签页的 App 容器模拟";
|
|
954
961
|
readonly params: [{
|
|
955
962
|
readonly name: "enabled";
|
|
956
963
|
readonly type: "boolean";
|
|
@@ -1067,7 +1074,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1067
1074
|
readonly examples: ["set_cookie --payload '{\"tabId\":12345,\"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}'"];
|
|
1068
1075
|
}, {
|
|
1069
1076
|
readonly name: "page_frames";
|
|
1070
|
-
readonly description: "
|
|
1077
|
+
readonly description: "获取页面主 frame 与所有 iframe 列表";
|
|
1071
1078
|
readonly params: [{
|
|
1072
1079
|
readonly name: "tabId";
|
|
1073
1080
|
readonly type: "number";
|
|
@@ -1077,7 +1084,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1077
1084
|
readonly examples: ["page_frames --payload '{\"tabId\":12345}'"];
|
|
1078
1085
|
}, {
|
|
1079
1086
|
readonly name: "request_domain_permission";
|
|
1080
|
-
readonly description: "
|
|
1087
|
+
readonly description: "申请访问指定域名的权限(必要时弹窗让用户授权)";
|
|
1081
1088
|
readonly params: [{
|
|
1082
1089
|
readonly name: "domain";
|
|
1083
1090
|
readonly type: "string";
|
|
@@ -1088,6 +1095,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1088
1095
|
}, {
|
|
1089
1096
|
readonly name: "run_actions";
|
|
1090
1097
|
readonly description: "批量顺序执行多个 action,减少往返延迟。遇错即停,返回已完成步骤结果;步骤内的页面动作不带内置观察";
|
|
1098
|
+
readonly summary: "批量顺序执行多个 action,遇错即停";
|
|
1091
1099
|
readonly params: [{
|
|
1092
1100
|
readonly name: "actions";
|
|
1093
1101
|
readonly type: "Array<{action: string, data?: object}>";
|
package/dist/commands.js
CHANGED
|
@@ -266,11 +266,13 @@ export const COMMANDS = [
|
|
|
266
266
|
{
|
|
267
267
|
name: 'browser_list',
|
|
268
268
|
description: '列出所有浏览器及其连接状态、类型和托管实例信息;AgentBay 可包含镜像与持久化 Context',
|
|
269
|
+
summary: '列出本地及远端浏览器与连接状态',
|
|
269
270
|
examples: ['browser_list'],
|
|
270
271
|
},
|
|
271
272
|
{
|
|
272
273
|
name: 'browser_release',
|
|
273
274
|
description: '按用户明确要求释放调试控制和会话级临时效果(含设备/时区模拟),保留浏览器和全部标签页;不用于普通任务收尾',
|
|
275
|
+
summary: '释放浏览器调试控制及会话级临时效果',
|
|
274
276
|
examples: ['browser_release', 'browser_release --browser chrome-a'],
|
|
275
277
|
},
|
|
276
278
|
{
|
|
@@ -445,7 +447,7 @@ export const COMMANDS = [
|
|
|
445
447
|
},
|
|
446
448
|
{
|
|
447
449
|
name: 'tab_list',
|
|
448
|
-
description: '
|
|
450
|
+
description: '列出目标浏览器所有窗口中的标签页',
|
|
449
451
|
aliases: ['tabs', 'list_tabs', 'show_tabs'],
|
|
450
452
|
examples: ['tab_list'],
|
|
451
453
|
},
|
|
@@ -772,7 +774,7 @@ export const COMMANDS = [
|
|
|
772
774
|
},
|
|
773
775
|
{
|
|
774
776
|
name: 'page_screenshot',
|
|
775
|
-
description: '
|
|
777
|
+
description: '获取当前视口或指定元素截图',
|
|
776
778
|
outputFlag: true,
|
|
777
779
|
params: [
|
|
778
780
|
{ name: 'selector', type: 'string', description: 'CSS 选择器,提供后只截取该元素区域' },
|
|
@@ -806,7 +808,7 @@ export const COMMANDS = [
|
|
|
806
808
|
},
|
|
807
809
|
{
|
|
808
810
|
name: 'get_user_info',
|
|
809
|
-
description: '
|
|
811
|
+
description: '获取当前浏览器登录的阿里员工信息',
|
|
810
812
|
params: [
|
|
811
813
|
{
|
|
812
814
|
name: 'detail',
|
|
@@ -826,6 +828,7 @@ export const COMMANDS = [
|
|
|
826
828
|
{
|
|
827
829
|
name: 'record_stop',
|
|
828
830
|
description: '停止录制并返回完整结果(操作 + 关联请求);未在录制时不报错,返回 wasRecording: false',
|
|
831
|
+
summary: '停止录制并返回操作和关联请求',
|
|
829
832
|
params: [{ name: 'tabId', type: 'number', description: '目标标签页 ID,从 tab_list 获取' }],
|
|
830
833
|
examples: ['record_stop'],
|
|
831
834
|
},
|
|
@@ -833,6 +836,7 @@ export const COMMANDS = [
|
|
|
833
836
|
{
|
|
834
837
|
name: 'set_device_emulation',
|
|
835
838
|
description: '把目标 tab 切换为移动端模拟(视口/UA/触摸),等价 DevTools 设备工具栏,作用域 per-tab;需保持调试控制才持续生效',
|
|
839
|
+
summary: '设置或清除目标标签页的设备模拟',
|
|
836
840
|
params: [
|
|
837
841
|
{ name: 'enabled', type: 'boolean', required: true, description: 'true=启用,false=清除' },
|
|
838
842
|
{
|
|
@@ -863,6 +867,7 @@ export const COMMANDS = [
|
|
|
863
867
|
{
|
|
864
868
|
name: 'set_app_profile',
|
|
865
869
|
description: '把目标 tab 切换为 App 容器模拟态(客户端 UA + JSBridge 托管 + 页面跳转 iframe 容器栈 + scheme 唤端映射 + 自适应系统标题栏),系统栏由 iframe 外层统一渲染,并根据页面协议与桥调用切换普通、沉浸或隐藏状态;用于桌面浏览器近似实机验证 App 内 H5,需保持调试控制才持续生效',
|
|
870
|
+
summary: '设置或清除目标标签页的 App 容器模拟',
|
|
866
871
|
params: [
|
|
867
872
|
{ name: 'enabled', type: 'boolean', required: true, description: 'true=启用,false=清除' },
|
|
868
873
|
{
|
|
@@ -975,13 +980,13 @@ export const COMMANDS = [
|
|
|
975
980
|
// ── 其他 ──────────────────────────────────────────────────────────────────
|
|
976
981
|
{
|
|
977
982
|
name: 'page_frames',
|
|
978
|
-
description: '
|
|
983
|
+
description: '获取页面主 frame 与所有 iframe 列表',
|
|
979
984
|
params: [{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' }],
|
|
980
985
|
examples: [`page_frames --payload '{"tabId":12345}'`],
|
|
981
986
|
},
|
|
982
987
|
{
|
|
983
988
|
name: 'request_domain_permission',
|
|
984
|
-
description: '
|
|
989
|
+
description: '申请访问指定域名的权限(必要时弹窗让用户授权)',
|
|
985
990
|
params: [
|
|
986
991
|
{
|
|
987
992
|
name: 'domain',
|
|
@@ -996,6 +1001,7 @@ export const COMMANDS = [
|
|
|
996
1001
|
{
|
|
997
1002
|
name: 'run_actions',
|
|
998
1003
|
description: '批量顺序执行多个 action,减少往返延迟。遇错即停,返回已完成步骤结果;步骤内的页面动作不带内置观察',
|
|
1004
|
+
summary: '批量顺序执行多个 action,遇错即停',
|
|
999
1005
|
params: [
|
|
1000
1006
|
{
|
|
1001
1007
|
name: 'actions',
|
|
@@ -271,7 +271,7 @@ export interface BrowserEmulationOptions {
|
|
|
271
271
|
orientation?: 'portrait' | 'landscape';
|
|
272
272
|
touch?: boolean;
|
|
273
273
|
}
|
|
274
|
-
export type AppBridgeConfigBehavior = 'navigate' | 'memoryGet' | 'memorySet' | 'memoryDelete' | 'availabilityMap' | 'userInfo' | 'networkInfo' | 'geolocation' | 'permission' | 'prefetch' | 'fptTrack' | 'mtopStream' | 'previewFile' | 'toast' | 'unsupportedNativeInput' | 'payment' | 'userTrack' | 'calendar' | 'networkQualityMonitor' | 'beaconRequest';
|
|
274
|
+
export type AppBridgeConfigBehavior = 'navigate' | 'closeAll' | 'closeBackData' | 'postMessage' | 'notifySubscribe' | 'notifyUnsubscribe' | 'notifyPost' | 'sharedFileRead' | 'sharedFileWrite' | 'sharedDataGet' | 'sharedDataSet' | 'legacyBroadcastCreate' | 'legacyBroadcastPost' | 'legacyBroadcastClose' | 'memoryGet' | 'memorySet' | 'memoryDelete' | 'availabilityMap' | 'userInfo' | 'networkInfo' | 'geolocation' | 'permission' | 'prefetch' | 'fptTrack' | 'mtopStream' | 'previewFile' | 'toast' | 'unsupportedNativeInput' | 'payment' | 'userTrack' | 'calendar' | 'networkQualityMonitor' | 'beaconRequest';
|
|
275
275
|
/** 单个桥方法的声明式覆盖;行为、固定回包、成功空实现三选一。 */
|
|
276
276
|
export interface AppBridgeMethodConfig {
|
|
277
277
|
behavior?: AppBridgeConfigBehavior;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/client",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "Unified Mearl SDK & CLI for local and remote browsers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"commander": "^15.0.0",
|
|
56
56
|
"fastest-levenshtein": "^1.0.16",
|
|
57
57
|
"ws": "^8.18.0",
|
|
58
|
-
"@mearl/cloud-types": "2.9.
|
|
58
|
+
"@mearl/cloud-types": "2.9.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/node": "^24.9.1",
|