@mearl/client 2.14.0 → 2.15.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 +43 -20
- package/dist/actionTimeouts.js +2 -4
- package/dist/buc.d.ts +65 -0
- package/dist/buc.js +533 -0
- package/dist/check.d.ts +0 -2
- package/dist/check.js +0 -2
- package/dist/cli.js +94 -18
- package/dist/commands.d.ts +20 -120
- package/dist/commands.js +19 -123
- package/dist/generated-browser-action-protocol.d.ts +20 -65
- package/dist/generated-browser-action-protocol.js +0 -9
- package/dist/index.d.ts +3 -5
- package/dist/index.js +1 -10
- package/dist/plugin.d.ts +26 -2
- package/dist/plugin.js +52 -3
- package/dist/pluginRegistry.d.ts +5 -1
- package/dist/pluginRegistry.js +15 -3
- package/dist/unified.d.ts +3 -0
- package/dist/unified.js +24 -2
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -8,13 +8,13 @@ import { commandInput, findCommandSuggestions, formatCommandSuggestions, } from
|
|
|
8
8
|
import { COMMANDS, COMMAND_MAP } from './commands.js';
|
|
9
9
|
import { CLIENT_VERSION } from './socket.js';
|
|
10
10
|
import { UnifiedClient } from './unified.js';
|
|
11
|
-
import { findPluginEntry, findPluginRegistration, listPluginNames,
|
|
11
|
+
import { findPluginEntry, findPluginRegistration, listPluginNames, loadRegisteredPlugin, PluginError, } from './plugin.js';
|
|
12
12
|
import { getCloudServerConfigPath, loadCloudServerConfig } from './unifiedConfig.js';
|
|
13
13
|
const TOP_LEVEL_COMMAND_NAME_WIDTH = 22;
|
|
14
14
|
const CATEGORIES = [
|
|
15
15
|
{
|
|
16
16
|
title: 'API 调试',
|
|
17
|
-
names: ['tab_checkpoint', 'get_requests', 'get_logs', 'get_events'
|
|
17
|
+
names: ['tab_checkpoint', 'get_requests', 'get_logs', 'get_events'],
|
|
18
18
|
},
|
|
19
19
|
{ title: 'Mock & 规则', names: ['set_mock', 'get_mocks', 'set_rule', 'get_rules'] },
|
|
20
20
|
{
|
|
@@ -46,9 +46,7 @@ const CATEGORIES = [
|
|
|
46
46
|
title: '环境与 Cookie',
|
|
47
47
|
names: ['set_device_emulation', 'set_app_profile', 'set_timezone', 'get_cookie', 'set_cookie'],
|
|
48
48
|
},
|
|
49
|
-
{ title: '用户信息', names: ['get_user_info'] },
|
|
50
49
|
{ title: '录制', names: ['record_start', 'record_stop'] },
|
|
51
|
-
{ title: 'TDBank', names: ['tdbank_account'] },
|
|
52
50
|
{
|
|
53
51
|
title: '浏览器',
|
|
54
52
|
names: ['browser_list', 'browser_release', 'browser_launch', 'browser_close'],
|
|
@@ -126,6 +124,78 @@ function printUsage(commandName, version) {
|
|
|
126
124
|
lines.push('', `运行 ${commandName} <action> --help 查看 action 参数。`);
|
|
127
125
|
console.error(lines.join('\n'));
|
|
128
126
|
}
|
|
127
|
+
function providerSchemaLine(name, schema, required, indent = 2) {
|
|
128
|
+
const detail = [
|
|
129
|
+
required ? '必填' : '可选',
|
|
130
|
+
schema.type,
|
|
131
|
+
schema.type === 'string' && schema.secret ? '敏感' : undefined,
|
|
132
|
+
schema.title,
|
|
133
|
+
schema.description,
|
|
134
|
+
schema.default === undefined ? undefined : `默认 ${JSON.stringify(schema.default)}`,
|
|
135
|
+
].filter(Boolean);
|
|
136
|
+
return `${' '.repeat(indent)}${name.padEnd(Math.max(1, 24 - indent))}${detail.join(' · ')}`;
|
|
137
|
+
}
|
|
138
|
+
function providerSchemaLines(name, schema, required, indent = 2) {
|
|
139
|
+
const lines = [providerSchemaLine(name, schema, required, indent)];
|
|
140
|
+
if (schema.type === 'object') {
|
|
141
|
+
const childRequired = new Set(schema.required ?? []);
|
|
142
|
+
for (const [childName, childSchema] of Object.entries(schema.properties)) {
|
|
143
|
+
lines.push(...providerSchemaLines(childName, childSchema, childRequired.has(childName), indent + 2));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else if (schema.type === 'array' && schema.items.type === 'object') {
|
|
147
|
+
const childRequired = new Set(schema.items.required ?? []);
|
|
148
|
+
for (const [childName, childSchema] of Object.entries(schema.items.properties)) {
|
|
149
|
+
lines.push(...providerSchemaLines(childName, childSchema, childRequired.has(childName), indent + 2));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return lines;
|
|
153
|
+
}
|
|
154
|
+
function printProviderHelp(commandName, provider) {
|
|
155
|
+
const browserType = provider.browserType;
|
|
156
|
+
const lines = [
|
|
157
|
+
`${provider.providerId} — ${provider.name} v${provider.version}`,
|
|
158
|
+
'',
|
|
159
|
+
...(browserType.help ?? []).map(line => String(line)),
|
|
160
|
+
];
|
|
161
|
+
if (browserType.help?.length)
|
|
162
|
+
lines.push('');
|
|
163
|
+
lines.push('创建:', ` ${commandName} browser_launch --payload '{"provider":"${provider.providerId}","providerOptions":{}}'`, '', '启动参数(providerOptions):');
|
|
164
|
+
const required = new Set(browserType.inputSchema.required ?? []);
|
|
165
|
+
const properties = Object.entries(browserType.inputSchema.properties);
|
|
166
|
+
if (properties.length === 0)
|
|
167
|
+
lines.push(' (无)');
|
|
168
|
+
else {
|
|
169
|
+
for (const [name, schema] of properties) {
|
|
170
|
+
lines.push(...providerSchemaLines(name, schema, required.has(name)));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (browserType.inputSchema.oneOf?.length) {
|
|
174
|
+
lines.push('', '可选模式:');
|
|
175
|
+
browserType.inputSchema.oneOf.forEach((schema, index) => {
|
|
176
|
+
const mode = schema.title || `模式 ${index + 1}`;
|
|
177
|
+
const requiredFields = schema.required?.length ? schema.required.join(', ') : '无必填字段';
|
|
178
|
+
lines.push(` ${mode}(必填:${requiredFields})`);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
lines.push('', '发现与检查:', ` ${commandName} browser_list`, ` ${commandName} check --browser <browserId>`, '', '管理:', ` npx @mearl/setup provider update ${provider.providerId}`, ` npx @mearl/setup provider uninstall ${provider.providerId}`);
|
|
182
|
+
if (browserType.configuration) {
|
|
183
|
+
lines.push('', 'Provider 配置(在 Mearl 浏览器管理器中填写):');
|
|
184
|
+
const configurationRequired = new Set(browserType.configuration.inputSchema.required ?? []);
|
|
185
|
+
for (const [name, schema] of Object.entries(browserType.configuration.inputSchema.properties)) {
|
|
186
|
+
lines.push(...providerSchemaLines(name, schema, configurationRequired.has(name)));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (browserType.documentationUrl) {
|
|
190
|
+
lines.push('', `文档:${browserType.documentationUrl}`);
|
|
191
|
+
}
|
|
192
|
+
console.error(lines.join('\n'));
|
|
193
|
+
}
|
|
194
|
+
function installedProvider(name) {
|
|
195
|
+
if (!name)
|
|
196
|
+
return undefined;
|
|
197
|
+
return listInstalledProviders().find(provider => provider.providerId === name);
|
|
198
|
+
}
|
|
129
199
|
function printCheckHelp(commandName) {
|
|
130
200
|
console.error([
|
|
131
201
|
'check',
|
|
@@ -341,7 +411,7 @@ export function parseClientArgs(args, plugin = false) {
|
|
|
341
411
|
: {}),
|
|
342
412
|
};
|
|
343
413
|
}
|
|
344
|
-
async function runPluginCli(args,
|
|
414
|
+
async function runPluginCli(args, commandName) {
|
|
345
415
|
let parsed;
|
|
346
416
|
try {
|
|
347
417
|
parsed = parseClientArgs(args, true);
|
|
@@ -359,23 +429,23 @@ async function runPluginCli(args, entry, commandName) {
|
|
|
359
429
|
...(parsed.local ? { local: true } : {}),
|
|
360
430
|
...(parsed.forceCdp ? { transport: 'cdp' } : {}),
|
|
361
431
|
};
|
|
362
|
-
const plugin = await
|
|
363
|
-
options: invokeOptions,
|
|
364
|
-
progress(message) {
|
|
365
|
-
if (parsed.verbose) {
|
|
366
|
-
process.stderr.write(message.endsWith('\n') ? message : `${message}\n`);
|
|
367
|
-
}
|
|
368
|
-
},
|
|
432
|
+
const plugin = await loadRegisteredPlugin(parsed.action, {
|
|
369
433
|
async invoke(action, payload, options) {
|
|
370
434
|
client ??= new UnifiedClient({
|
|
371
435
|
...(parsed.serverUrl ? { serverUrl: parsed.serverUrl } : {}),
|
|
372
436
|
});
|
|
373
|
-
|
|
374
|
-
if (result?.action?.success === false)
|
|
375
|
-
throw new Error(result.action.error || `${action} failed`);
|
|
376
|
-
return result;
|
|
437
|
+
return client.invoke(action, payload, options);
|
|
377
438
|
},
|
|
378
|
-
},
|
|
439
|
+
}, {
|
|
440
|
+
...invokeOptions,
|
|
441
|
+
...(parsed.verbose
|
|
442
|
+
? {
|
|
443
|
+
onProgress(message) {
|
|
444
|
+
process.stderr.write(message.endsWith('\n') ? message : `${message}\n`);
|
|
445
|
+
},
|
|
446
|
+
}
|
|
447
|
+
: {}),
|
|
448
|
+
});
|
|
379
449
|
if (parsed.version) {
|
|
380
450
|
console.log(plugin.version ?? 'unknown');
|
|
381
451
|
return 0;
|
|
@@ -435,6 +505,12 @@ export async function runMearlCli(args, options = {}) {
|
|
|
435
505
|
const clientVersion = options.clientVersion ?? CLIENT_VERSION;
|
|
436
506
|
if (args[0] === 'capture_checkpoint')
|
|
437
507
|
args = ['tab_checkpoint', ...args.slice(1)];
|
|
508
|
+
const provider = installedProvider(args[0]);
|
|
509
|
+
if (provider &&
|
|
510
|
+
(args.length === 1 || args.slice(1).every(arg => arg === '--help' || arg === '-h'))) {
|
|
511
|
+
printProviderHelp(commandName, provider);
|
|
512
|
+
return 0;
|
|
513
|
+
}
|
|
438
514
|
if (args[0] &&
|
|
439
515
|
!args[0].startsWith('-') &&
|
|
440
516
|
!args[0].startsWith('__') &&
|
|
@@ -444,7 +520,7 @@ export async function runMearlCli(args, options = {}) {
|
|
|
444
520
|
try {
|
|
445
521
|
const entry = findPluginEntry(args[0]);
|
|
446
522
|
if (entry)
|
|
447
|
-
return await runPluginCli(args,
|
|
523
|
+
return await runPluginCli(args, commandName);
|
|
448
524
|
}
|
|
449
525
|
catch (error) {
|
|
450
526
|
console.error(error instanceof Error ? error.message : String(error));
|
package/dist/commands.d.ts
CHANGED
|
@@ -142,24 +142,6 @@ export declare const COMMANDS: readonly [{
|
|
|
142
142
|
readonly description: "返回完整 URL、_raw 和 _context;默认 false";
|
|
143
143
|
}];
|
|
144
144
|
readonly examples: ["get_events --payload '{\"source\":\"aplus\",\"event_type\":\"CLK\",\"limit\":10}'", "get_events --payload '{\"filter\":\"order\",\"includeRaw\":true,\"limit\":1}'", "get_events --payload '{\"tabId\":12345,\"source\":\"all\",\"limit\":20}'"];
|
|
145
|
-
}, {
|
|
146
|
-
readonly name: "get_api_schema";
|
|
147
|
-
readonly description: "获取 API 接口 schema(出入参定义)";
|
|
148
|
-
readonly params: [{
|
|
149
|
-
readonly name: "api";
|
|
150
|
-
readonly type: "string";
|
|
151
|
-
readonly required: true;
|
|
152
|
-
readonly description: "API 名称";
|
|
153
|
-
}, {
|
|
154
|
-
readonly name: "version";
|
|
155
|
-
readonly type: "string";
|
|
156
|
-
readonly description: "API 版本,用于精确匹配接口定义";
|
|
157
|
-
}, {
|
|
158
|
-
readonly name: "fields";
|
|
159
|
-
readonly type: "(\"schema\" | \"hsf\")[]";
|
|
160
|
-
readonly description: "指定返回内容;不填时返回全部可用内容";
|
|
161
|
-
}];
|
|
162
|
-
readonly examples: ["get_api_schema --payload '{\"api\":\"mtop.trade.order.detail\"}'"];
|
|
163
145
|
}, {
|
|
164
146
|
readonly name: "set_mock";
|
|
165
147
|
readonly description: "设置 API mock 数据";
|
|
@@ -334,100 +316,43 @@ export declare const COMMANDS: readonly [{
|
|
|
334
316
|
readonly description: "超时毫秒数,默认 10000";
|
|
335
317
|
}];
|
|
336
318
|
readonly examples: ["send_mtop_request --payload '{\"api\":\"mtop.trade.order.detail\",\"data\":{\"orderId\":\"123\"}}'"];
|
|
337
|
-
}, {
|
|
338
|
-
readonly name: "tdbank_account";
|
|
339
|
-
readonly description: "TDBank 账号操作:获取扫码登录二维码、当前账号、账号列表、切换账号、快速借用并切换账号";
|
|
340
|
-
readonly params: [{
|
|
341
|
-
readonly name: "tabId";
|
|
342
|
-
readonly type: "number";
|
|
343
|
-
readonly description: "login 首次不传;后续传上次响应的 tabId;无法恢复待扫码状态时会返回新的 tabId;其他操作在 CDP 模式下用于读取 Cookie";
|
|
344
|
-
}, {
|
|
345
|
-
readonly name: "operation";
|
|
346
|
-
readonly type: "\"current\" | \"list\" | \"login\" | \"switch\" | \"borrow\"";
|
|
347
|
-
readonly description: "操作类型,默认 current";
|
|
348
|
-
}, {
|
|
349
|
-
readonly name: "refresh";
|
|
350
|
-
readonly type: "boolean";
|
|
351
|
-
readonly description: "list 时是否强制刷新账号列表";
|
|
352
|
-
}, {
|
|
353
|
-
readonly name: "pageIndex";
|
|
354
|
-
readonly type: "number";
|
|
355
|
-
readonly description: "list 时的页码,默认 1";
|
|
356
|
-
}, {
|
|
357
|
-
readonly name: "accountId";
|
|
358
|
-
readonly type: "string | number";
|
|
359
|
-
readonly description: "switch 时使用账号列表中的 id";
|
|
360
|
-
}, {
|
|
361
|
-
readonly name: "havanaId";
|
|
362
|
-
readonly type: "string | number";
|
|
363
|
-
readonly description: "switch 时直接指定 havanaId;TDBank 方式需配合 site,免密方式需配合 ssoKey";
|
|
364
|
-
}, {
|
|
365
|
-
readonly name: "site";
|
|
366
|
-
readonly type: "string | number";
|
|
367
|
-
readonly description: "TDBank 方式直接指定 havanaId 时必填";
|
|
368
|
-
}, {
|
|
369
|
-
readonly name: "ssoKey";
|
|
370
|
-
readonly type: "string";
|
|
371
|
-
readonly description: "switch 免密方式的秘钥;必须同时传 havanaId,site 固定为 taobao";
|
|
372
|
-
}, {
|
|
373
|
-
readonly name: "query";
|
|
374
|
-
readonly type: "string";
|
|
375
|
-
readonly description: "borrow 时输入要借用的账号 loginId/关键词";
|
|
376
|
-
}, {
|
|
377
|
-
readonly name: "identityId";
|
|
378
|
-
readonly type: "string | number";
|
|
379
|
-
readonly description: "login 返回 identity_required 后,传用户明确选择的 identityId";
|
|
380
|
-
}];
|
|
381
|
-
readonly examples: ["tdbank_account --payload '{\"operation\":\"login\"}'", "tdbank_account --payload '{\"operation\":\"login\",\"tabId\":12345}'", "tdbank_account --payload '{\"operation\":\"login\",\"tabId\":12345,\"identityId\":\"10001\"}'", "tdbank_account --payload '{\"operation\":\"current\"}'", "tdbank_account --payload '{\"operation\":\"list\",\"refresh\":true}'", "tdbank_account --payload '{\"operation\":\"switch\",\"accountId\":12345}'", "tdbank_account --payload '{\"operation\":\"switch\",\"havanaId\":\"1234567890\",\"ssoKey\":\"<secret>\"}'", "tdbank_account --payload '{\"operation\":\"borrow\",\"query\":\"test_account\"}'"];
|
|
382
319
|
}, {
|
|
383
320
|
readonly name: "browser_list";
|
|
384
|
-
readonly description: "
|
|
321
|
+
readonly description: "列出所有浏览器及其连接状态、类型和 Provider 托管实例信息";
|
|
385
322
|
readonly summary: "列出本地及远端浏览器与连接状态";
|
|
386
323
|
readonly examples: ["browser_list"];
|
|
387
324
|
}, {
|
|
388
325
|
readonly name: "browser_release";
|
|
389
|
-
readonly description: "
|
|
390
|
-
readonly summary: "
|
|
326
|
+
readonly description: "释放当前浏览器的调试控制和会话级临时效果(含设备/时区模拟);不用于普通任务收尾,Provider 实例的行为以 mearl <providerId> 为准";
|
|
327
|
+
readonly summary: "释放浏览器调试控制和会话级临时效果";
|
|
391
328
|
readonly examples: ["browser_release", "browser_release --browser chrome-a"];
|
|
392
329
|
}, {
|
|
393
330
|
readonly name: "browser_launch";
|
|
394
|
-
readonly description: "启动本地 Chrome
|
|
331
|
+
readonly description: "启动本地 Chrome,或通过已注册 Provider 创建浏览器实例";
|
|
395
332
|
readonly params: [{
|
|
396
333
|
readonly name: "name";
|
|
397
334
|
readonly type: "string";
|
|
398
|
-
readonly description: "
|
|
335
|
+
readonly description: "本地实例名称;使用 local Provider 时必填";
|
|
399
336
|
}, {
|
|
400
337
|
readonly name: "provider";
|
|
401
338
|
readonly type: "string";
|
|
402
|
-
readonly description: "运行环境,默认 local;可传
|
|
339
|
+
readonly description: "运行环境,默认 local;可传 mearl --help 中展示的已注册 Provider ID";
|
|
403
340
|
}, {
|
|
404
341
|
readonly name: "providerOptions";
|
|
405
342
|
readonly type: "Record<string, JSON value>";
|
|
406
343
|
readonly description: "所选 Provider 声明的结构化启动参数;不能与顶层启动字段混用";
|
|
407
|
-
}, {
|
|
408
|
-
readonly name: "sessionId";
|
|
409
|
-
readonly type: "string";
|
|
410
|
-
readonly description: "显式接入现有 AgentBay Session;不会创建、初始化或取得其生命周期所有权";
|
|
411
|
-
}, {
|
|
412
|
-
readonly name: "reuse";
|
|
413
|
-
readonly type: "\"never\" | \"prefer\" | \"require\"";
|
|
414
|
-
readonly description: "AgentBay 运行实例复用策略:never 默认不复用;prefer 同名运行实例存在则复用、无记录则创建;require 只复用、不创建";
|
|
415
|
-
}, {
|
|
416
|
-
readonly name: "imageId";
|
|
417
|
-
readonly type: "string";
|
|
418
|
-
readonly description: "AgentBay 镜像别名或具体镜像 ID;默认使用已验证的 Linux Browser Use 内网镜像";
|
|
419
344
|
}, {
|
|
420
345
|
readonly name: "headless";
|
|
421
346
|
readonly type: "boolean";
|
|
422
|
-
readonly description: "本地
|
|
347
|
+
readonly description: "本地 Provider 是否无头运行,默认 true";
|
|
423
348
|
}, {
|
|
424
349
|
readonly name: "userAgentMode";
|
|
425
350
|
readonly type: "\"default\" | \"desktop\"";
|
|
426
|
-
readonly description: "UA 模式:default
|
|
351
|
+
readonly description: "本地 UA 模式:default 使用默认 UA;desktop 使用匹配本机版本的 UA";
|
|
427
352
|
}, {
|
|
428
353
|
readonly name: "persistent";
|
|
429
354
|
readonly type: "boolean";
|
|
430
|
-
readonly description: "
|
|
355
|
+
readonly description: "本地实例关闭后是否保留 Profile,默认 false";
|
|
431
356
|
}, {
|
|
432
357
|
readonly name: "url";
|
|
433
358
|
readonly type: "string";
|
|
@@ -436,35 +361,15 @@ export declare const COMMANDS: readonly [{
|
|
|
436
361
|
readonly name: "executablePath";
|
|
437
362
|
readonly type: "string";
|
|
438
363
|
readonly description: "自定义 Chrome 可执行文件路径";
|
|
439
|
-
}, {
|
|
440
|
-
readonly name: "accountId";
|
|
441
|
-
readonly type: "string | number";
|
|
442
|
-
readonly description: "登录账号列表中的 accountId";
|
|
443
|
-
}, {
|
|
444
|
-
readonly name: "havanaId";
|
|
445
|
-
readonly type: "string | number";
|
|
446
|
-
readonly description: "直接登录 havanaId;需要同时传 site";
|
|
447
|
-
}, {
|
|
448
|
-
readonly name: "site";
|
|
449
|
-
readonly type: "string | number";
|
|
450
|
-
readonly description: "havanaId 对应的站点";
|
|
451
|
-
}, {
|
|
452
|
-
readonly name: "query";
|
|
453
|
-
readonly type: "string";
|
|
454
|
-
readonly description: "搜索、借用并登录匹配的 TDBank 账号";
|
|
455
|
-
}, {
|
|
456
|
-
readonly name: "tabId";
|
|
457
|
-
readonly type: "number";
|
|
458
|
-
readonly description: "CDP 控制浏览器中用于读取 TDBank Cookie 的标签页";
|
|
459
364
|
}, {
|
|
460
365
|
readonly name: "copyCookieDomains";
|
|
461
366
|
readonly type: "string[] | \"mearl-services\" | { presets?: [\"mearl-services\"]; domains?: string[] }";
|
|
462
367
|
readonly description: "从控制浏览器复制 Cookie:可传域名数组、Mearl 登录态预设,或组合预设与额外域名";
|
|
463
368
|
}];
|
|
464
|
-
readonly examples: ["browser_launch --payload '{\"provider\":\"brow\",\"providerOptions\":{}}'", "browser_launch --payload '{\"name\":\"
|
|
369
|
+
readonly examples: ["browser_launch --payload '{\"provider\":\"brow\",\"providerOptions\":{}}'", "browser_launch --payload '{\"name\":\"figma\",\"userAgentMode\":\"desktop\",\"copyCookieDomains\":[\"figma.com\"]}'", "browser_launch --payload '{\"name\":\"with-cookies\",\"copyCookieDomains\":[\"example.com\",\"sub.example.org\"]}'"];
|
|
465
370
|
}, {
|
|
466
371
|
readonly name: "browser_close";
|
|
467
|
-
readonly description: "
|
|
372
|
+
readonly description: "关闭指定托管浏览器,并按 Provider 策略保留或清理持久化数据";
|
|
468
373
|
readonly params: [{
|
|
469
374
|
readonly name: "browser";
|
|
470
375
|
readonly type: "string";
|
|
@@ -473,9 +378,9 @@ export declare const COMMANDS: readonly [{
|
|
|
473
378
|
}, {
|
|
474
379
|
readonly name: "deleteProfile";
|
|
475
380
|
readonly type: "boolean";
|
|
476
|
-
readonly description: "
|
|
381
|
+
readonly description: "强制删除持久化数据,默认 false";
|
|
477
382
|
}];
|
|
478
|
-
readonly examples: ["browser_close --payload '{\"browser\":\"managed:account-a\"}'", "browser_close --payload '{\"browser\":\"
|
|
383
|
+
readonly examples: ["browser_close --payload '{\"browser\":\"managed:account-a\"}'", "browser_close --payload '{\"browser\":\"account-b\",\"deleteProfile\":true}'"];
|
|
479
384
|
}, {
|
|
480
385
|
readonly name: "tab_open";
|
|
481
386
|
readonly description: "打开或按 URL 规则复用 Tab,并等待新页面加载完成";
|
|
@@ -885,15 +790,6 @@ export declare const COMMANDS: readonly [{
|
|
|
885
790
|
readonly description: "目标标签页 ID";
|
|
886
791
|
}];
|
|
887
792
|
readonly examples: ["page_selected_element", "page_selected_element --output ./element.png"];
|
|
888
|
-
}, {
|
|
889
|
-
readonly name: "get_user_info";
|
|
890
|
-
readonly description: "获取当前浏览器登录的阿里员工信息";
|
|
891
|
-
readonly params: [{
|
|
892
|
-
readonly name: "detail";
|
|
893
|
-
readonly type: "boolean";
|
|
894
|
-
readonly description: "是否获取完整用户信息,默认 false(只返回工号)";
|
|
895
|
-
}];
|
|
896
|
-
readonly examples: ["get_user_info", "get_user_info --payload '{\"detail\":true}'"];
|
|
897
793
|
}, {
|
|
898
794
|
readonly name: "record_start";
|
|
899
795
|
readonly description: "开始录制用户操作";
|
|
@@ -1034,7 +930,7 @@ export declare const COMMANDS: readonly [{
|
|
|
1034
930
|
readonly examples: ["set_timezone --payload '{\"tabId\":12345,\"timezone\":\"America/New_York\"}'", "set_timezone --payload '{\"tabId\":12345,\"timezone\":\"\"}'"];
|
|
1035
931
|
}, {
|
|
1036
932
|
readonly name: "get_cookie";
|
|
1037
|
-
readonly description: "
|
|
933
|
+
readonly description: "从目标浏览器读取一个指定非分区 Cookie;拒绝返回 HttpOnly Cookie";
|
|
1038
934
|
readonly params: [{
|
|
1039
935
|
readonly name: "tabId";
|
|
1040
936
|
readonly type: "number";
|
|
@@ -1045,16 +941,20 @@ export declare const COMMANDS: readonly [{
|
|
|
1045
941
|
readonly type: "string";
|
|
1046
942
|
readonly required: true;
|
|
1047
943
|
readonly description: "要读取的 Cookie 名称;不支持列举全部 Cookie";
|
|
944
|
+
}, {
|
|
945
|
+
readonly name: "url";
|
|
946
|
+
readonly type: "string";
|
|
947
|
+
readonly description: "可选 Cookie 查询 URL;省略时使用当前标签页 URL";
|
|
1048
948
|
}, {
|
|
1049
949
|
readonly name: "domain";
|
|
1050
950
|
readonly type: "string";
|
|
1051
|
-
readonly description: "
|
|
951
|
+
readonly description: "可选精确域过滤,只允许 Cookie 查询 URL 的 host 或其父域";
|
|
1052
952
|
}, {
|
|
1053
953
|
readonly name: "path";
|
|
1054
954
|
readonly type: "string";
|
|
1055
955
|
readonly description: "可选精确 path 过滤";
|
|
1056
956
|
}];
|
|
1057
|
-
readonly examples: ["get_cookie --payload '{\"tabId\":12345,\"name\":\"feature_flag\"}'", "get_cookie --payload '{\"tabId\":12345,\"name\":\"edith_switch_br.rx-vehicle-search_home\",\"domain\":\"taobao.com\"}'"];
|
|
957
|
+
readonly examples: ["get_cookie --payload '{\"tabId\":12345,\"name\":\"feature_flag\"}'", "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\":\"/\"}'"];
|
|
1058
958
|
}, {
|
|
1059
959
|
readonly name: "set_cookie";
|
|
1060
960
|
readonly description: "设置当前标签页域下的一个指定非分区 session Cookie,可选刷新页面";
|