@mearl/client 2.13.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/browserRegistry.d.ts +8 -6
- package/dist/buc.d.ts +65 -0
- package/dist/buc.js +533 -0
- package/dist/check.d.ts +9 -9
- package/dist/check.js +9 -7
- package/dist/cli.js +94 -18
- package/dist/commands.d.ts +22 -122
- package/dist/commands.js +21 -125
- package/dist/generated-browser-action-protocol.d.ts +117 -94
- 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/socket.js +33 -18
- package/dist/unified.d.ts +3 -0
- package/dist/unified.js +25 -13
- package/package.json +3 -3
package/dist/commands.js
CHANGED
|
@@ -93,20 +93,6 @@ export const COMMANDS = [
|
|
|
93
93
|
`get_events --payload '{"tabId":12345,"source":"all","limit":20}'`,
|
|
94
94
|
],
|
|
95
95
|
},
|
|
96
|
-
{
|
|
97
|
-
name: 'get_api_schema',
|
|
98
|
-
description: '获取 API 接口 schema(出入参定义)',
|
|
99
|
-
params: [
|
|
100
|
-
{ name: 'api', type: 'string', required: true, description: 'API 名称' },
|
|
101
|
-
{ name: 'version', type: 'string', description: 'API 版本,用于精确匹配接口定义' },
|
|
102
|
-
{
|
|
103
|
-
name: 'fields',
|
|
104
|
-
type: '("schema" | "hsf")[]',
|
|
105
|
-
description: '指定返回内容;不填时返回全部可用内容',
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
examples: [`get_api_schema --payload '{"api":"mtop.trade.order.detail"}'`],
|
|
109
|
-
},
|
|
110
96
|
// ── Mock & 规则 ───────────────────────────────────────────────────────────
|
|
111
97
|
{
|
|
112
98
|
name: 'set_mock',
|
|
@@ -235,129 +221,55 @@ export const COMMANDS = [
|
|
|
235
221
|
`send_mtop_request --payload '{"api":"mtop.trade.order.detail","data":{"orderId":"123"}}'`,
|
|
236
222
|
],
|
|
237
223
|
},
|
|
238
|
-
{
|
|
239
|
-
name: 'tdbank_account',
|
|
240
|
-
description: 'TDBank 账号操作:获取扫码登录二维码、当前账号、账号列表、切换账号、快速借用并切换账号',
|
|
241
|
-
params: [
|
|
242
|
-
{
|
|
243
|
-
name: 'tabId',
|
|
244
|
-
type: 'number',
|
|
245
|
-
description: 'login 首次不传;后续传上次响应的 tabId;无法恢复待扫码状态时会返回新的 tabId;其他操作在 CDP 模式下用于读取 Cookie',
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
name: 'operation',
|
|
249
|
-
type: '"current" | "list" | "login" | "switch" | "borrow"',
|
|
250
|
-
description: '操作类型,默认 current',
|
|
251
|
-
},
|
|
252
|
-
{ name: 'refresh', type: 'boolean', description: 'list 时是否强制刷新账号列表' },
|
|
253
|
-
{ name: 'pageIndex', type: 'number', description: 'list 时的页码,默认 1' },
|
|
254
|
-
{ name: 'accountId', type: 'string | number', description: 'switch 时使用账号列表中的 id' },
|
|
255
|
-
{
|
|
256
|
-
name: 'havanaId',
|
|
257
|
-
type: 'string | number',
|
|
258
|
-
description: 'switch 时直接指定 havanaId;TDBank 方式需配合 site,免密方式需配合 ssoKey',
|
|
259
|
-
},
|
|
260
|
-
{ name: 'site', type: 'string | number', description: 'TDBank 方式直接指定 havanaId 时必填' },
|
|
261
|
-
{
|
|
262
|
-
name: 'ssoKey',
|
|
263
|
-
type: 'string',
|
|
264
|
-
description: 'switch 免密方式的秘钥;必须同时传 havanaId,site 固定为 taobao',
|
|
265
|
-
},
|
|
266
|
-
{ name: 'query', type: 'string', description: 'borrow 时输入要借用的账号 loginId/关键词' },
|
|
267
|
-
{
|
|
268
|
-
name: 'identityId',
|
|
269
|
-
type: 'string | number',
|
|
270
|
-
description: 'login 返回 identity_required 后,传用户明确选择的 identityId',
|
|
271
|
-
},
|
|
272
|
-
],
|
|
273
|
-
examples: [
|
|
274
|
-
`tdbank_account --payload '{"operation":"login"}'`,
|
|
275
|
-
`tdbank_account --payload '{"operation":"login","tabId":12345}'`,
|
|
276
|
-
`tdbank_account --payload '{"operation":"login","tabId":12345,"identityId":"10001"}'`,
|
|
277
|
-
`tdbank_account --payload '{"operation":"current"}'`,
|
|
278
|
-
`tdbank_account --payload '{"operation":"list","refresh":true}'`,
|
|
279
|
-
`tdbank_account --payload '{"operation":"switch","accountId":12345}'`,
|
|
280
|
-
`tdbank_account --payload '{"operation":"switch","havanaId":"1234567890","ssoKey":"<secret>"}'`,
|
|
281
|
-
`tdbank_account --payload '{"operation":"borrow","query":"test_account"}'`,
|
|
282
|
-
],
|
|
283
|
-
},
|
|
284
224
|
// ── 浏览器 ────────────────────────────────────────────────────────────────
|
|
285
225
|
{
|
|
286
226
|
name: 'browser_list',
|
|
287
|
-
description: '
|
|
227
|
+
description: '列出所有浏览器及其连接状态、类型和 Provider 托管实例信息',
|
|
288
228
|
summary: '列出本地及远端浏览器与连接状态',
|
|
289
229
|
examples: ['browser_list'],
|
|
290
230
|
},
|
|
291
231
|
{
|
|
292
232
|
name: 'browser_release',
|
|
293
|
-
description: '
|
|
294
|
-
summary: '
|
|
233
|
+
description: '释放当前浏览器的调试控制和会话级临时效果(含设备/时区模拟);不用于普通任务收尾,Provider 实例的行为以 mearl <providerId> 为准',
|
|
234
|
+
summary: '释放浏览器调试控制和会话级临时效果',
|
|
295
235
|
examples: ['browser_release', 'browser_release --browser chrome-a'],
|
|
296
236
|
},
|
|
297
237
|
{
|
|
298
238
|
name: 'browser_launch',
|
|
299
|
-
description: '启动本地 Chrome
|
|
239
|
+
description: '启动本地 Chrome,或通过已注册 Provider 创建浏览器实例',
|
|
300
240
|
params: [
|
|
301
241
|
{
|
|
302
242
|
name: 'name',
|
|
303
243
|
type: 'string',
|
|
304
|
-
description: '
|
|
244
|
+
description: '本地实例名称;使用 local Provider 时必填',
|
|
305
245
|
},
|
|
306
246
|
{
|
|
307
247
|
name: 'provider',
|
|
308
248
|
type: 'string',
|
|
309
|
-
description: '运行环境,默认 local;可传
|
|
249
|
+
description: '运行环境,默认 local;可传 mearl --help 中展示的已注册 Provider ID',
|
|
310
250
|
},
|
|
311
251
|
{
|
|
312
252
|
name: 'providerOptions',
|
|
313
|
-
type: 'Record<string,
|
|
314
|
-
description: '
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
name: 'sessionId',
|
|
318
|
-
type: 'string',
|
|
319
|
-
description: '显式接入现有 AgentBay Session;不会创建、初始化或取得其生命周期所有权',
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: 'reuse',
|
|
323
|
-
type: '"never" | "prefer" | "require"',
|
|
324
|
-
description: 'AgentBay 运行实例复用策略:never 默认不复用;prefer 同名运行实例存在则复用、无记录则创建;require 只复用、不创建',
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
name: 'imageId',
|
|
328
|
-
type: 'string',
|
|
329
|
-
description: 'AgentBay 镜像别名或具体镜像 ID;默认使用已验证的 Linux Browser Use 内网镜像',
|
|
253
|
+
type: 'Record<string, JSON value>',
|
|
254
|
+
description: '所选 Provider 声明的结构化启动参数;不能与顶层启动字段混用',
|
|
330
255
|
},
|
|
331
256
|
{
|
|
332
257
|
name: 'headless',
|
|
333
258
|
type: 'boolean',
|
|
334
|
-
description: '本地
|
|
259
|
+
description: '本地 Provider 是否无头运行,默认 true',
|
|
335
260
|
},
|
|
336
261
|
{
|
|
337
262
|
name: 'userAgentMode',
|
|
338
263
|
type: '"default" | "desktop"',
|
|
339
|
-
description: 'UA 模式:default
|
|
264
|
+
description: '本地 UA 模式:default 使用默认 UA;desktop 使用匹配本机版本的 UA',
|
|
340
265
|
},
|
|
341
266
|
{
|
|
342
267
|
name: 'persistent',
|
|
343
268
|
type: 'boolean',
|
|
344
|
-
description: '
|
|
269
|
+
description: '本地实例关闭后是否保留 Profile,默认 false',
|
|
345
270
|
},
|
|
346
271
|
{ name: 'url', type: 'string', description: '登录完成后打开的初始页面' },
|
|
347
272
|
{ name: 'executablePath', type: 'string', description: '自定义 Chrome 可执行文件路径' },
|
|
348
|
-
{ name: 'accountId', type: 'string | number', description: '登录账号列表中的 accountId' },
|
|
349
|
-
{
|
|
350
|
-
name: 'havanaId',
|
|
351
|
-
type: 'string | number',
|
|
352
|
-
description: '直接登录 havanaId;需要同时传 site',
|
|
353
|
-
},
|
|
354
|
-
{ name: 'site', type: 'string | number', description: 'havanaId 对应的站点' },
|
|
355
|
-
{ name: 'query', type: 'string', description: '搜索、借用并登录匹配的 TDBank 账号' },
|
|
356
|
-
{
|
|
357
|
-
name: 'tabId',
|
|
358
|
-
type: 'number',
|
|
359
|
-
description: 'CDP 控制浏览器中用于读取 TDBank Cookie 的标签页',
|
|
360
|
-
},
|
|
361
273
|
{
|
|
362
274
|
name: 'copyCookieDomains',
|
|
363
275
|
type: 'string[] | "mearl-services" | { presets?: ["mearl-services"]; domains?: string[] }',
|
|
@@ -366,22 +278,13 @@ export const COMMANDS = [
|
|
|
366
278
|
],
|
|
367
279
|
examples: [
|
|
368
280
|
`browser_launch --payload '{"provider":"brow","providerOptions":{}}'`,
|
|
369
|
-
`browser_launch --payload '{"name":"cloud-a","provider":"agentbay","userAgentMode":"desktop","url":"https://example.com"}'`,
|
|
370
|
-
`browser_launch --payload '{"name":"cloud-public","provider":"agentbay","imageId":"browser_latest","url":"https://example.com"}'`,
|
|
371
|
-
`browser_launch --payload '{"name":"cloud-login","provider":"agentbay","persistent":true,"copyCookieDomains":["example.com"],"url":"https://example.com/account"}'`,
|
|
372
|
-
`browser_launch --payload '{"name":"cloud-login","provider":"agentbay","reuse":"require","copyCookieDomains":["example.com"]}'`,
|
|
373
|
-
`browser_launch --browser '<本地浏览器 browserId>' --payload '{"sessionId":"<AgentBay sessionId>","copyCookieDomains":["example.com"]}'`,
|
|
374
|
-
`browser_launch --payload '{"name":"cloud-tools","provider":"agentbay","copyCookieDomains":"mearl-services"}'`,
|
|
375
|
-
`browser_launch --payload '{"name":"cloud-tools","provider":"agentbay","copyCookieDomains":{"presets":["mearl-services"],"domains":["figma.com"]}}'`,
|
|
376
|
-
`browser_launch --payload '{"name":"account-a","headless":true,"accountId":12345}'`,
|
|
377
281
|
`browser_launch --payload '{"name":"figma","userAgentMode":"desktop","copyCookieDomains":["figma.com"]}'`,
|
|
378
|
-
`browser_launch --payload '{"name":"account-b","query":"test_account","url":"https://www.taobao.com"}'`,
|
|
379
282
|
`browser_launch --payload '{"name":"with-cookies","copyCookieDomains":["example.com","sub.example.org"]}'`,
|
|
380
283
|
],
|
|
381
284
|
},
|
|
382
285
|
{
|
|
383
286
|
name: 'browser_close',
|
|
384
|
-
description: '
|
|
287
|
+
description: '关闭指定托管浏览器,并按 Provider 策略保留或清理持久化数据',
|
|
385
288
|
params: [
|
|
386
289
|
{
|
|
387
290
|
name: 'browser',
|
|
@@ -392,12 +295,11 @@ export const COMMANDS = [
|
|
|
392
295
|
{
|
|
393
296
|
name: 'deleteProfile',
|
|
394
297
|
type: 'boolean',
|
|
395
|
-
description: '
|
|
298
|
+
description: '强制删除持久化数据,默认 false',
|
|
396
299
|
},
|
|
397
300
|
],
|
|
398
301
|
examples: [
|
|
399
302
|
`browser_close --payload '{"browser":"managed:account-a"}'`,
|
|
400
|
-
`browser_close --payload '{"browser":"managed:agentbay:cloud-a"}'`,
|
|
401
303
|
`browser_close --payload '{"browser":"account-b","deleteProfile":true}'`,
|
|
402
304
|
],
|
|
403
305
|
},
|
|
@@ -837,18 +739,6 @@ export const COMMANDS = [
|
|
|
837
739
|
],
|
|
838
740
|
examples: ['page_selected_element', 'page_selected_element --output ./element.png'],
|
|
839
741
|
},
|
|
840
|
-
{
|
|
841
|
-
name: 'get_user_info',
|
|
842
|
-
description: '获取当前浏览器登录的阿里员工信息',
|
|
843
|
-
params: [
|
|
844
|
-
{
|
|
845
|
-
name: 'detail',
|
|
846
|
-
type: 'boolean',
|
|
847
|
-
description: '是否获取完整用户信息,默认 false(只返回工号)',
|
|
848
|
-
},
|
|
849
|
-
],
|
|
850
|
-
examples: ['get_user_info', `get_user_info --payload '{"detail":true}'`],
|
|
851
|
-
},
|
|
852
742
|
// ── 录制 ──────────────────────────────────────────────────────────────────
|
|
853
743
|
{
|
|
854
744
|
name: 'record_start',
|
|
@@ -967,7 +857,7 @@ export const COMMANDS = [
|
|
|
967
857
|
},
|
|
968
858
|
{
|
|
969
859
|
name: 'get_cookie',
|
|
970
|
-
description: '
|
|
860
|
+
description: '从目标浏览器读取一个指定非分区 Cookie;拒绝返回 HttpOnly Cookie',
|
|
971
861
|
params: [
|
|
972
862
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
973
863
|
{
|
|
@@ -976,16 +866,22 @@ export const COMMANDS = [
|
|
|
976
866
|
required: true,
|
|
977
867
|
description: '要读取的 Cookie 名称;不支持列举全部 Cookie',
|
|
978
868
|
},
|
|
869
|
+
{
|
|
870
|
+
name: 'url',
|
|
871
|
+
type: 'string',
|
|
872
|
+
description: '可选 Cookie 查询 URL;省略时使用当前标签页 URL',
|
|
873
|
+
},
|
|
979
874
|
{
|
|
980
875
|
name: 'domain',
|
|
981
876
|
type: 'string',
|
|
982
|
-
description: '
|
|
877
|
+
description: '可选精确域过滤,只允许 Cookie 查询 URL 的 host 或其父域',
|
|
983
878
|
},
|
|
984
879
|
{ name: 'path', type: 'string', description: '可选精确 path 过滤' },
|
|
985
880
|
],
|
|
986
881
|
examples: [
|
|
987
882
|
`get_cookie --payload '{"tabId":12345,"name":"feature_flag"}'`,
|
|
988
883
|
`get_cookie --payload '{"tabId":12345,"name":"edith_switch_br.rx-vehicle-search_home","domain":"taobao.com"}'`,
|
|
884
|
+
`get_cookie --payload '{"tabId":12345,"name":"tracknick","url":"https://www.taobao.com/","domain":"taobao.com","path":"/"}'`,
|
|
989
885
|
],
|
|
990
886
|
},
|
|
991
887
|
{
|
|
@@ -60,11 +60,6 @@ export interface GetMocksParams {
|
|
|
60
60
|
tabId?: number;
|
|
61
61
|
apiName?: string;
|
|
62
62
|
}
|
|
63
|
-
export interface GetApiSchemaParams {
|
|
64
|
-
api: string;
|
|
65
|
-
version?: string;
|
|
66
|
-
fields?: Array<'schema' | 'hsf'>;
|
|
67
|
-
}
|
|
68
63
|
export declare const SEND_REQUEST_MAX_FILES = 20;
|
|
69
64
|
export declare const SEND_REQUEST_MAX_TOTAL_FILE_BYTES: number;
|
|
70
65
|
export declare const SEND_REQUEST_MAX_TOTAL_BASE64_FILE_BYTES: number;
|
|
@@ -111,18 +106,6 @@ export interface SendMtopRequestParams {
|
|
|
111
106
|
headers?: Record<string, string>;
|
|
112
107
|
ttid?: string;
|
|
113
108
|
}
|
|
114
|
-
export interface TdbankAccountParams {
|
|
115
|
-
operation?: 'current' | 'list' | 'login' | 'switch' | 'borrow';
|
|
116
|
-
pageIndex?: number;
|
|
117
|
-
refresh?: boolean;
|
|
118
|
-
query?: string;
|
|
119
|
-
accountId?: string | number;
|
|
120
|
-
havanaId?: string | number;
|
|
121
|
-
site?: string | number;
|
|
122
|
-
ssoKey?: string;
|
|
123
|
-
tabId?: number;
|
|
124
|
-
identityId?: string | number;
|
|
125
|
-
}
|
|
126
109
|
export type BrowserStatus = 'connected' | 'pairing' | 'running_disconnected' | 'stopped';
|
|
127
110
|
export type BrowserTransport = 'extension' | 'cdp' | 'provider';
|
|
128
111
|
export interface BrowserPairingInfo {
|
|
@@ -137,6 +120,33 @@ export interface BrowserSource {
|
|
|
137
120
|
connectorId?: string;
|
|
138
121
|
connectorName?: string;
|
|
139
122
|
}
|
|
123
|
+
export type BrowserJsonPrimitive = string | number | boolean | null;
|
|
124
|
+
export type BrowserJsonValue = BrowserJsonPrimitive | BrowserJsonValue[] | {
|
|
125
|
+
[key: string]: BrowserJsonValue;
|
|
126
|
+
};
|
|
127
|
+
export type BrowserProviderOperation = 'start' | 'close' | 'detach' | 'deleteData' | 'access' | 'syncCookies';
|
|
128
|
+
export interface BrowserProviderIdentity {
|
|
129
|
+
id: string;
|
|
130
|
+
name: string;
|
|
131
|
+
builtin: boolean;
|
|
132
|
+
version?: string;
|
|
133
|
+
protocolVersion?: number;
|
|
134
|
+
}
|
|
135
|
+
/** Common safe metadata; additional Provider-specific keys must also be non-secret JSON. */
|
|
136
|
+
export type BrowserDetails = Record<string, BrowserJsonValue> & {
|
|
137
|
+
headless?: boolean;
|
|
138
|
+
createdAt?: string;
|
|
139
|
+
cdpPort?: number;
|
|
140
|
+
copiedCookies?: {
|
|
141
|
+
domains: string[];
|
|
142
|
+
count: number;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
export interface BrowserReference {
|
|
146
|
+
kind: string;
|
|
147
|
+
id: string;
|
|
148
|
+
label?: string;
|
|
149
|
+
}
|
|
140
150
|
export interface BrowserInfoBase {
|
|
141
151
|
browserId: string;
|
|
142
152
|
name: string;
|
|
@@ -148,12 +158,14 @@ export interface BrowserInfoBase {
|
|
|
148
158
|
extensionVersion?: string;
|
|
149
159
|
nativeHostVersion?: string;
|
|
150
160
|
transport?: BrowserTransport;
|
|
151
|
-
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
161
|
+
/** Provider identity, independent from the browser control transport. */
|
|
162
|
+
provider?: BrowserProviderIdentity;
|
|
163
|
+
ownership?: 'owned' | 'attached';
|
|
164
|
+
persistence?: 'ephemeral' | 'persistent';
|
|
165
|
+
operations?: BrowserProviderOperation[];
|
|
166
|
+
references?: BrowserReference[];
|
|
167
|
+
/** Safe, non-secret metadata suitable for display and remote connectors. */
|
|
168
|
+
details?: BrowserDetails;
|
|
157
169
|
/** Setup information exposed by a provider while it waits for an external device. */
|
|
158
170
|
pairing?: BrowserPairingInfo;
|
|
159
171
|
}
|
|
@@ -170,33 +182,12 @@ export interface RegularBrowserInfo extends BrowserInfoBase {
|
|
|
170
182
|
type: 'regular';
|
|
171
183
|
status: 'connected' | 'pairing';
|
|
172
184
|
}
|
|
173
|
-
export interface ManagedBrowserAccount {
|
|
174
|
-
accountId?: string;
|
|
175
|
-
loginId?: string;
|
|
176
|
-
nickname: string;
|
|
177
|
-
}
|
|
178
185
|
export interface ManagedBrowserInfo extends BrowserInfoBase {
|
|
179
186
|
type: 'managed';
|
|
180
|
-
status: 'connected' | 'running_disconnected' | 'stopped';
|
|
181
|
-
provider
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
cdpPort?: number;
|
|
185
|
-
agentbaySessionId?: string;
|
|
186
|
-
/** Whether this host owns the AgentBay session lifecycle or only attaches to it. */
|
|
187
|
-
agentbaySessionMode?: 'owned' | 'attached';
|
|
188
|
-
/** AgentBay image used to create the session. */
|
|
189
|
-
agentbayImageId?: string;
|
|
190
|
-
/** Persistent AgentBay browser context ID when enabled for this instance. */
|
|
191
|
-
agentbayContextId?: string;
|
|
192
|
-
/** Stable AgentBay browser context name derived from the managed browser name. */
|
|
193
|
-
agentbayContextName?: string;
|
|
194
|
-
createdAt: string;
|
|
195
|
-
account?: ManagedBrowserAccount;
|
|
196
|
-
copiedCookies?: {
|
|
197
|
-
domains: string[];
|
|
198
|
-
count: number;
|
|
199
|
-
};
|
|
187
|
+
status: 'connected' | 'pairing' | 'running_disconnected' | 'stopped';
|
|
188
|
+
provider: BrowserProviderIdentity;
|
|
189
|
+
persistence: 'ephemeral' | 'persistent';
|
|
190
|
+
operations: BrowserProviderOperation[];
|
|
200
191
|
}
|
|
201
192
|
export type BrowserInfo = RegularBrowserInfo | ManagedBrowserInfo;
|
|
202
193
|
export interface BrowserListResult {
|
|
@@ -227,11 +218,6 @@ export interface BrowserReleaseResult {
|
|
|
227
218
|
hadActiveControl: boolean;
|
|
228
219
|
transports: BrowserTransport[];
|
|
229
220
|
affectedTabIds: number[];
|
|
230
|
-
/** True when browser_release also removed a sessionId-based local AgentBay attachment. */
|
|
231
|
-
detached?: boolean;
|
|
232
|
-
/** Attached sessions remain alive in AgentBay after the local attachment is released. */
|
|
233
|
-
sessionClosed?: boolean;
|
|
234
|
-
agentbaySessionId?: string;
|
|
235
221
|
failures?: BrowserReleaseFailure[];
|
|
236
222
|
}
|
|
237
223
|
export interface CookieCopyScope {
|
|
@@ -241,30 +227,19 @@ export interface CookieCopyScope {
|
|
|
241
227
|
domains?: string[];
|
|
242
228
|
}
|
|
243
229
|
export interface BrowserLaunchParams {
|
|
244
|
-
/** Required
|
|
230
|
+
/** Required by the built-in local Provider. */
|
|
245
231
|
name?: string;
|
|
246
232
|
/** Built-in runtime or the id of a registered external Provider. */
|
|
247
233
|
provider?: string;
|
|
248
|
-
/**
|
|
249
|
-
providerOptions?: Record<string,
|
|
250
|
-
/**
|
|
251
|
-
sessionId?: string;
|
|
252
|
-
/** AgentBay running-session reuse policy. Defaults to never. */
|
|
253
|
-
reuse?: 'never' | 'prefer' | 'require';
|
|
254
|
-
/** AgentBay image alias or concrete image ID. Only supported by the AgentBay provider. */
|
|
255
|
-
imageId?: string;
|
|
256
|
-
/** Local Chrome defaults to true. AgentBay is fixed to false and rejects true. */
|
|
234
|
+
/** Structured launch parameters declared by the selected Provider. Cannot be mixed with flat options. */
|
|
235
|
+
providerOptions?: Record<string, BrowserJsonValue>;
|
|
236
|
+
/** Whether the built-in local Chrome uses headless mode. Defaults to true. */
|
|
257
237
|
headless?: boolean;
|
|
258
|
-
/** Desktop mode uses
|
|
238
|
+
/** Desktop mode uses a user agent matching the local Chrome version. */
|
|
259
239
|
userAgentMode?: 'default' | 'desktop';
|
|
260
240
|
persistent?: boolean;
|
|
261
241
|
executablePath?: string;
|
|
262
242
|
url?: string;
|
|
263
|
-
accountId?: string | number;
|
|
264
|
-
havanaId?: string | number;
|
|
265
|
-
site?: string | number;
|
|
266
|
-
query?: string;
|
|
267
|
-
tabId?: number;
|
|
268
243
|
/** Copy explicit domains, the Mearl-service preset, or a combination of both. */
|
|
269
244
|
copyCookieDomains?: string[] | 'mearl-services' | CookieCopyScope;
|
|
270
245
|
}
|
|
@@ -272,6 +247,76 @@ export interface BrowserCloseParams {
|
|
|
272
247
|
browser: string;
|
|
273
248
|
deleteProfile?: boolean;
|
|
274
249
|
}
|
|
250
|
+
interface BrowserProviderSchemaBase {
|
|
251
|
+
title?: string;
|
|
252
|
+
description?: string;
|
|
253
|
+
default?: BrowserJsonValue;
|
|
254
|
+
/** Optional Mearl form component used to edit this schema value. */
|
|
255
|
+
component?: 'cookie-sync' | 'switch';
|
|
256
|
+
/** Presentation-only default used by Mearl forms without changing runtime semantics. */
|
|
257
|
+
formDefault?: BrowserJsonValue;
|
|
258
|
+
/** Excludes an advanced runtime option from generated Mearl forms. */
|
|
259
|
+
formHidden?: boolean;
|
|
260
|
+
/** Places compact fields side by side in generated Mearl forms. */
|
|
261
|
+
formWidth?: 'half' | 'full';
|
|
262
|
+
/** Hides the optional badge without changing schema validation. */
|
|
263
|
+
formHideOptional?: boolean;
|
|
264
|
+
/** Conditionally displays and submits this field based on another form value. */
|
|
265
|
+
formVisibleWhen?: {
|
|
266
|
+
field: string;
|
|
267
|
+
empty: boolean;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
export type BrowserProviderInputSchema = (BrowserProviderSchemaBase & {
|
|
271
|
+
type: 'string';
|
|
272
|
+
secret?: boolean;
|
|
273
|
+
enum?: readonly string[];
|
|
274
|
+
minLength?: number;
|
|
275
|
+
maxLength?: number;
|
|
276
|
+
pattern?: string;
|
|
277
|
+
placeholder?: string;
|
|
278
|
+
}) | (BrowserProviderSchemaBase & {
|
|
279
|
+
type: 'number';
|
|
280
|
+
integer?: boolean;
|
|
281
|
+
minimum?: number;
|
|
282
|
+
maximum?: number;
|
|
283
|
+
}) | (BrowserProviderSchemaBase & {
|
|
284
|
+
type: 'boolean';
|
|
285
|
+
}) | (BrowserProviderSchemaBase & {
|
|
286
|
+
type: 'array';
|
|
287
|
+
items: BrowserProviderInputSchema;
|
|
288
|
+
minItems?: number;
|
|
289
|
+
maxItems?: number;
|
|
290
|
+
}) | BrowserProviderObjectSchema;
|
|
291
|
+
export interface BrowserProviderObjectSchema extends BrowserProviderSchemaBase {
|
|
292
|
+
type: 'object';
|
|
293
|
+
properties: Record<string, BrowserProviderInputSchema>;
|
|
294
|
+
required?: readonly string[];
|
|
295
|
+
oneOf?: readonly BrowserProviderObjectSchema[];
|
|
296
|
+
not?: BrowserProviderObjectSchema;
|
|
297
|
+
additionalProperties?: boolean;
|
|
298
|
+
}
|
|
299
|
+
export interface BrowserProviderDefinition {
|
|
300
|
+
provider: BrowserProviderIdentity;
|
|
301
|
+
browserType: {
|
|
302
|
+
name: string;
|
|
303
|
+
documentationUrl?: string;
|
|
304
|
+
inputSchema: BrowserProviderObjectSchema;
|
|
305
|
+
configuration?: {
|
|
306
|
+
inputSchema: BrowserProviderObjectSchema;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export interface BrowserProviderListResult {
|
|
311
|
+
providers: BrowserProviderDefinition[];
|
|
312
|
+
}
|
|
313
|
+
export interface BrowserAccessResult {
|
|
314
|
+
browserAccess: {
|
|
315
|
+
kind: string;
|
|
316
|
+
url: string;
|
|
317
|
+
sensitive: true;
|
|
318
|
+
};
|
|
319
|
+
}
|
|
275
320
|
export interface SetRuleParams {
|
|
276
321
|
actionType: 'redirect' | 'block' | 'allow' | 'upgradeScheme' | 'modifyHeaders';
|
|
277
322
|
filter: string;
|
|
@@ -533,6 +578,8 @@ export interface SetTimezoneResult {
|
|
|
533
578
|
export interface GetCookieParams {
|
|
534
579
|
tabId?: number;
|
|
535
580
|
name: string;
|
|
581
|
+
/** Cookie lookup URL; defaults to the current tab URL. */
|
|
582
|
+
url?: string;
|
|
536
583
|
domain?: string;
|
|
537
584
|
path?: string;
|
|
538
585
|
}
|
|
@@ -561,9 +608,6 @@ export interface SetCookieResult {
|
|
|
561
608
|
path: string;
|
|
562
609
|
reloaded: boolean;
|
|
563
610
|
}
|
|
564
|
-
export interface GetUserInfoParams {
|
|
565
|
-
detail?: boolean;
|
|
566
|
-
}
|
|
567
611
|
export interface RecordParams {
|
|
568
612
|
tabId?: number;
|
|
569
613
|
}
|
|
@@ -601,10 +645,6 @@ export interface BrowserActionMap {
|
|
|
601
645
|
request: GetEventsParams;
|
|
602
646
|
response: unknown;
|
|
603
647
|
};
|
|
604
|
-
get_api_schema: {
|
|
605
|
-
request: GetApiSchemaParams;
|
|
606
|
-
response: unknown;
|
|
607
|
-
};
|
|
608
648
|
set_mock: {
|
|
609
649
|
request: SetMockParams;
|
|
610
650
|
response: unknown;
|
|
@@ -629,10 +669,6 @@ export interface BrowserActionMap {
|
|
|
629
669
|
request: SendMtopRequestParams;
|
|
630
670
|
response: unknown;
|
|
631
671
|
};
|
|
632
|
-
tdbank_account: {
|
|
633
|
-
request: TdbankAccountParams;
|
|
634
|
-
response: unknown;
|
|
635
|
-
};
|
|
636
672
|
browser_list: {
|
|
637
673
|
request: undefined;
|
|
638
674
|
response: BrowserListResult;
|
|
@@ -647,7 +683,7 @@ export interface BrowserActionMap {
|
|
|
647
683
|
};
|
|
648
684
|
browser_launch: {
|
|
649
685
|
request: BrowserLaunchParams;
|
|
650
|
-
response:
|
|
686
|
+
response: ManagedBrowserInfo;
|
|
651
687
|
};
|
|
652
688
|
browser_close: {
|
|
653
689
|
request: BrowserCloseParams;
|
|
@@ -753,10 +789,6 @@ export interface BrowserActionMap {
|
|
|
753
789
|
request: RequestDomainPermissionParams;
|
|
754
790
|
response: unknown;
|
|
755
791
|
};
|
|
756
|
-
get_user_info: {
|
|
757
|
-
request: GetUserInfoParams;
|
|
758
|
-
response: unknown;
|
|
759
|
-
};
|
|
760
792
|
run_actions: {
|
|
761
793
|
request: RunActionsParams;
|
|
762
794
|
response: unknown;
|
|
@@ -775,14 +807,12 @@ export declare const BROWSER_ACTIONS: {
|
|
|
775
807
|
readonly get_requests: true;
|
|
776
808
|
readonly get_logs: true;
|
|
777
809
|
readonly get_events: true;
|
|
778
|
-
readonly get_api_schema: true;
|
|
779
810
|
readonly set_mock: true;
|
|
780
811
|
readonly get_mocks: true;
|
|
781
812
|
readonly set_rule: true;
|
|
782
813
|
readonly get_rules: true;
|
|
783
814
|
readonly send_request: true;
|
|
784
815
|
readonly send_mtop_request: true;
|
|
785
|
-
readonly tdbank_account: true;
|
|
786
816
|
readonly browser_list: true;
|
|
787
817
|
readonly browser_select_browser: true;
|
|
788
818
|
readonly browser_release: true;
|
|
@@ -813,7 +843,6 @@ export declare const BROWSER_ACTIONS: {
|
|
|
813
843
|
readonly record_start: true;
|
|
814
844
|
readonly record_stop: true;
|
|
815
845
|
readonly request_domain_permission: true;
|
|
816
|
-
readonly get_user_info: true;
|
|
817
846
|
readonly run_actions: true;
|
|
818
847
|
};
|
|
819
848
|
export declare const BROWSER_COMMAND_ACTIONS: {
|
|
@@ -822,14 +851,12 @@ export declare const BROWSER_COMMAND_ACTIONS: {
|
|
|
822
851
|
readonly get_requests: true;
|
|
823
852
|
readonly get_logs: true;
|
|
824
853
|
readonly get_events: true;
|
|
825
|
-
readonly get_api_schema: true;
|
|
826
854
|
readonly set_mock: true;
|
|
827
855
|
readonly get_mocks: true;
|
|
828
856
|
readonly set_rule: true;
|
|
829
857
|
readonly get_rules: true;
|
|
830
858
|
readonly send_request: true;
|
|
831
859
|
readonly send_mtop_request: true;
|
|
832
|
-
readonly tdbank_account: true;
|
|
833
860
|
readonly browser_list: true;
|
|
834
861
|
readonly browser_release: true;
|
|
835
862
|
readonly browser_launch: true;
|
|
@@ -859,7 +886,6 @@ export declare const BROWSER_COMMAND_ACTIONS: {
|
|
|
859
886
|
readonly record_start: true;
|
|
860
887
|
readonly record_stop: true;
|
|
861
888
|
readonly request_domain_permission: true;
|
|
862
|
-
readonly get_user_info: true;
|
|
863
889
|
readonly run_actions: true;
|
|
864
890
|
};
|
|
865
891
|
export declare const EXTENSION_BROWSER_ACTIONS: {
|
|
@@ -868,14 +894,12 @@ export declare const EXTENSION_BROWSER_ACTIONS: {
|
|
|
868
894
|
readonly get_requests: true;
|
|
869
895
|
readonly get_logs: true;
|
|
870
896
|
readonly get_events: true;
|
|
871
|
-
readonly get_api_schema: true;
|
|
872
897
|
readonly set_mock: true;
|
|
873
898
|
readonly get_mocks: true;
|
|
874
899
|
readonly set_rule: true;
|
|
875
900
|
readonly get_rules: true;
|
|
876
901
|
readonly send_request: true;
|
|
877
902
|
readonly send_mtop_request: true;
|
|
878
|
-
readonly tdbank_account: true;
|
|
879
903
|
readonly browser_release: true;
|
|
880
904
|
readonly page_screenshot: true;
|
|
881
905
|
readonly page_selected_element: true;
|
|
@@ -902,7 +926,6 @@ export declare const EXTENSION_BROWSER_ACTIONS: {
|
|
|
902
926
|
readonly record_start: true;
|
|
903
927
|
readonly record_stop: true;
|
|
904
928
|
readonly request_domain_permission: true;
|
|
905
|
-
readonly get_user_info: true;
|
|
906
929
|
readonly run_actions: true;
|
|
907
930
|
};
|
|
908
931
|
export declare function isBrowserAction(value: unknown): value is BrowserAction;
|