@mearl/client 2.2.2 → 2.3.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 +2 -2
- package/dist/cli.js +4 -1
- package/dist/commands.d.ts +41 -16
- package/dist/commands.js +31 -9
- package/dist/generated-browser-action-protocol.d.ts +35 -1
- package/dist/generated-browser-action-protocol.js +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ mearl browser_release
|
|
|
82
82
|
|
|
83
83
|
| 分类 | Actions |
|
|
84
84
|
| ----------- | --------------------------------------------------------------------------------------------------------- |
|
|
85
|
-
| API 调试 | `get_requests` `get_logs` `get_events` `get_api_schema`
|
|
85
|
+
| API 调试 | `capture_checkpoint` `get_requests` `get_logs` `get_events` `get_api_schema` |
|
|
86
86
|
| Mock & 规则 | `set_mock` `get_mocks` `set_rule` `get_rules` |
|
|
87
87
|
| 网络代理 | `send_request` `send_mtop_request` |
|
|
88
88
|
| 标签页 | `tab_open` `tab_close` `tab_list` |
|
|
@@ -94,7 +94,7 @@ mearl browser_release
|
|
|
94
94
|
| TDBank | `tdbank_account` |
|
|
95
95
|
| 浏览器 | `browser_list` `browser_release` `browser_launch` `browser_close` |
|
|
96
96
|
|
|
97
|
-
页面交互动作(`page_click` / `page_type` / `page_hover` / `page_scroll` / `page_press` / `page_upload
|
|
97
|
+
页面交互动作(`page_click` / `page_type` / `page_hover` / `page_scroll` / `page_press` / `page_upload`)默认内置观察与原子诊断:同一次调用内执行动作、等待异步稳定,并返回 `{ action, observation, diagnostics }`;`diagnostics` 默认包含新增 error logs 和全部业务 requests。传 `observe: false` 只关闭 DOM/导航观察并保留诊断;同时传 `diagnostics: false` 才仅执行裸动作。观察结果不替代完整页面理解:`mode: "delta"` 只返回主文档中的 `effects.notifications`、`effects.interactives` 和 `effects.focus` 等高置信度信号,并明确携带 `scope: "main-document"`;可交互节点会尽量携带真实 backend `node.ref`,后续动作优先使用 ref,缺少 ref 时使用 `node.selector`。`mode: "navigation"` 且 `ready: true` 时,页面已通过网络静默、骨架状态或保守的内容稳定判定,可在新页面重建快照。动作直接打开新标签页时,`observation.openedTabs` 返回新标签页的 `tabId`、URL、标题和加载状态,可直接把该 `tabId` 用于后续操作,不必调用 `tab_list`。通常仅在 `fullSnapshotRecommended` 为 true 时根据 `snapshotReasons` 回退;滚动后若下一步需要读取新视口内容,可按需获取 viewport 快照。`page_eval` 默认裸执行;显式传 `observe` 对象可启用观察,传 `diagnostics: true` 或对象可启用原子诊断。
|
|
98
98
|
|
|
99
99
|
`page_snapshot` 默认返回完整 AX Tree;长列表可传 `mode: "viewport"`,只需要当前视口内的控件时传 `mode: "interactive"`,已知 CSS 区域时传 `rootSelector`,已有 ref 时传 `rootRef`(可用 `ancestorDepth` 向上补充上下文),只查找特定文案或角色时传 `query`。视口内缺少 AX 控件语义时,`interactive` 会自动回退到 viewport,并返回 `fallbackMode: "viewport"`。`maxNodes` / `maxChars` 截断会同时保留首尾内容。
|
|
100
100
|
|
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,10 @@ import { runCheck } from './check.js';
|
|
|
18
18
|
import { resolveActionTimeoutSec } from './actionTimeouts.js';
|
|
19
19
|
// ─── Usage / Help ─────────────────────────────────────────────────────────────
|
|
20
20
|
const CATEGORIES = [
|
|
21
|
-
{
|
|
21
|
+
{
|
|
22
|
+
title: 'API 调试',
|
|
23
|
+
names: ['capture_checkpoint', 'get_requests', 'get_logs', 'get_events', 'get_api_schema'],
|
|
24
|
+
},
|
|
22
25
|
{ title: 'Mock & 规则', names: ['set_mock', 'get_mocks', 'set_rule', 'get_rules'] },
|
|
23
26
|
{ title: '网络代理', names: ['send_request', 'send_mtop_request'] },
|
|
24
27
|
{ title: '标签页', names: ['tab_open', 'tab_close', 'tab_list'] },
|
package/dist/commands.d.ts
CHANGED
|
@@ -15,6 +15,15 @@ export interface CommandDef {
|
|
|
15
15
|
examples?: string[];
|
|
16
16
|
}
|
|
17
17
|
export declare const COMMANDS: readonly [{
|
|
18
|
+
readonly name: "capture_checkpoint";
|
|
19
|
+
readonly description: "为目标标签页建立 console/network 增量边界";
|
|
20
|
+
readonly params: [{
|
|
21
|
+
readonly name: "tabId";
|
|
22
|
+
readonly type: "number";
|
|
23
|
+
readonly description: "目标标签页 ID,从 tab_open 获取";
|
|
24
|
+
}];
|
|
25
|
+
readonly examples: ["capture_checkpoint --payload '{\"tabId\":12345}'"];
|
|
26
|
+
}, {
|
|
18
27
|
readonly name: "get_requests";
|
|
19
28
|
readonly description: "获取最近的网络请求(mtop 或普通 xhr/fetch)";
|
|
20
29
|
readonly params: [{
|
|
@@ -27,12 +36,20 @@ export declare const COMMANDS: readonly [{
|
|
|
27
36
|
readonly description: "返回条数,默认 10";
|
|
28
37
|
}, {
|
|
29
38
|
readonly name: "source";
|
|
30
|
-
readonly type: "\"mtop\" | \"requests\"";
|
|
31
|
-
readonly description: "数据来源,不填时默认 mtop";
|
|
39
|
+
readonly type: "\"mtop\" | \"requests\" | \"all\"";
|
|
40
|
+
readonly description: "数据来源,不填时默认 mtop;all 返回全部业务请求";
|
|
32
41
|
}, {
|
|
33
42
|
readonly name: "filter";
|
|
34
43
|
readonly type: "string";
|
|
35
44
|
readonly description: "按 URL 或 API 名称过滤,支持正则";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "since";
|
|
47
|
+
readonly type: "number";
|
|
48
|
+
readonly description: "只返回最近 N 秒内的请求";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "after";
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly description: "只返回指定 capture cursor 之后的请求";
|
|
36
53
|
}, {
|
|
37
54
|
readonly name: "includeBody";
|
|
38
55
|
readonly type: "boolean";
|
|
@@ -49,7 +66,7 @@ export declare const COMMANDS: readonly [{
|
|
|
49
66
|
}, {
|
|
50
67
|
readonly name: "limit";
|
|
51
68
|
readonly type: "number";
|
|
52
|
-
readonly description: "
|
|
69
|
+
readonly description: "返回最新 N 条,默认 100";
|
|
53
70
|
}, {
|
|
54
71
|
readonly name: "level";
|
|
55
72
|
readonly type: "string";
|
|
@@ -58,6 +75,14 @@ export declare const COMMANDS: readonly [{
|
|
|
58
75
|
readonly name: "filter";
|
|
59
76
|
readonly type: "string";
|
|
60
77
|
readonly description: "按内容过滤,支持正则";
|
|
78
|
+
}, {
|
|
79
|
+
readonly name: "since";
|
|
80
|
+
readonly type: "number";
|
|
81
|
+
readonly description: "只返回最近 N 秒内的日志";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "after";
|
|
84
|
+
readonly type: "string";
|
|
85
|
+
readonly description: "只返回指定 capture cursor 之后的日志";
|
|
61
86
|
}];
|
|
62
87
|
readonly examples: ["get_logs --payload '{\"limit\":10,\"level\":\"error\"}'"];
|
|
63
88
|
}, {
|
|
@@ -433,8 +458,8 @@ export declare const COMMANDS: readonly [{
|
|
|
433
458
|
}, {
|
|
434
459
|
readonly name: "observe";
|
|
435
460
|
readonly type: "object | false";
|
|
436
|
-
readonly description: "观察选项(quietMs/firstChangeTimeoutMs/timeoutMs/navigationGraceMs/navigationTimeoutMs/networkIdleMs/contentReadyAfterMs);传 false
|
|
437
|
-
}, {
|
|
461
|
+
readonly description: "观察选项(quietMs/firstChangeTimeoutMs/timeoutMs/navigationGraceMs/navigationTimeoutMs/networkIdleMs/contentReadyAfterMs);传 false 只关闭 DOM/导航观察,默认诊断仍会返回";
|
|
462
|
+
}, ParamDef, {
|
|
438
463
|
readonly name: "tabId";
|
|
439
464
|
readonly type: "number";
|
|
440
465
|
readonly required: true;
|
|
@@ -461,8 +486,8 @@ export declare const COMMANDS: readonly [{
|
|
|
461
486
|
}, {
|
|
462
487
|
readonly name: "observe";
|
|
463
488
|
readonly type: "object | false";
|
|
464
|
-
readonly description: "观察选项;传 false
|
|
465
|
-
}, {
|
|
489
|
+
readonly description: "观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回";
|
|
490
|
+
}, ParamDef, {
|
|
466
491
|
readonly name: "tabId";
|
|
467
492
|
readonly type: "number";
|
|
468
493
|
readonly required: true;
|
|
@@ -480,8 +505,8 @@ export declare const COMMANDS: readonly [{
|
|
|
480
505
|
}, {
|
|
481
506
|
readonly name: "observe";
|
|
482
507
|
readonly type: "object | false";
|
|
483
|
-
readonly description: "观察选项;传 false
|
|
484
|
-
}, {
|
|
508
|
+
readonly description: "观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回";
|
|
509
|
+
}, ParamDef, {
|
|
485
510
|
readonly name: "tabId";
|
|
486
511
|
readonly type: "number";
|
|
487
512
|
readonly required: true;
|
|
@@ -511,8 +536,8 @@ export declare const COMMANDS: readonly [{
|
|
|
511
536
|
}, {
|
|
512
537
|
readonly name: "observe";
|
|
513
538
|
readonly type: "object | false";
|
|
514
|
-
readonly description: "观察选项;传 false
|
|
515
|
-
}, {
|
|
539
|
+
readonly description: "观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回";
|
|
540
|
+
}, ParamDef, {
|
|
516
541
|
readonly name: "tabId";
|
|
517
542
|
readonly type: "number";
|
|
518
543
|
readonly required: true;
|
|
@@ -535,7 +560,7 @@ export declare const COMMANDS: readonly [{
|
|
|
535
560
|
readonly name: "observe";
|
|
536
561
|
readonly type: "object";
|
|
537
562
|
readonly description: "仅在表达式会修改页面且需要观察结果时显式传入;不传保持轻量裸执行";
|
|
538
|
-
}, {
|
|
563
|
+
}, ParamDef, {
|
|
539
564
|
readonly name: "tabId";
|
|
540
565
|
readonly type: "number";
|
|
541
566
|
readonly required: true;
|
|
@@ -557,8 +582,8 @@ export declare const COMMANDS: readonly [{
|
|
|
557
582
|
}, {
|
|
558
583
|
readonly name: "observe";
|
|
559
584
|
readonly type: "object | false";
|
|
560
|
-
readonly description: "观察选项;传 false
|
|
561
|
-
}, {
|
|
585
|
+
readonly description: "观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回";
|
|
586
|
+
}, ParamDef, {
|
|
562
587
|
readonly name: "tabId";
|
|
563
588
|
readonly type: "number";
|
|
564
589
|
readonly required: true;
|
|
@@ -633,8 +658,8 @@ export declare const COMMANDS: readonly [{
|
|
|
633
658
|
}, {
|
|
634
659
|
readonly name: "observe";
|
|
635
660
|
readonly type: "object | false";
|
|
636
|
-
readonly description: "观察选项;传 false
|
|
637
|
-
}, {
|
|
661
|
+
readonly description: "观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回";
|
|
662
|
+
}, ParamDef, {
|
|
638
663
|
readonly name: "tabId";
|
|
639
664
|
readonly type: "number";
|
|
640
665
|
readonly required: true;
|
package/dist/commands.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
const PAGE_DIAGNOSTICS_PARAM = {
|
|
2
|
+
name: 'diagnostics',
|
|
3
|
+
type: 'object | boolean',
|
|
4
|
+
description: '交互动作默认在执行前原子建立边界,并返回新增 error logs/全部业务 requests;传 false 关闭,或传对象自定义过滤',
|
|
5
|
+
};
|
|
1
6
|
export const COMMANDS = [
|
|
2
7
|
// ── API 调试 ──────────────────────────────────────────────────────────────
|
|
8
|
+
{
|
|
9
|
+
name: 'capture_checkpoint',
|
|
10
|
+
description: '为目标标签页建立 console/network 增量边界',
|
|
11
|
+
params: [{ name: 'tabId', type: 'number', description: '目标标签页 ID,从 tab_open 获取' }],
|
|
12
|
+
examples: [`capture_checkpoint --payload '{"tabId":12345}'`],
|
|
13
|
+
},
|
|
3
14
|
{
|
|
4
15
|
name: 'get_requests',
|
|
5
16
|
description: '获取最近的网络请求(mtop 或普通 xhr/fetch)',
|
|
@@ -8,10 +19,12 @@ export const COMMANDS = [
|
|
|
8
19
|
{ name: 'count', type: 'number', description: '返回条数,默认 10' },
|
|
9
20
|
{
|
|
10
21
|
name: 'source',
|
|
11
|
-
type: '"mtop" | "requests"',
|
|
12
|
-
description: '数据来源,不填时默认 mtop',
|
|
22
|
+
type: '"mtop" | "requests" | "all"',
|
|
23
|
+
description: '数据来源,不填时默认 mtop;all 返回全部业务请求',
|
|
13
24
|
},
|
|
14
25
|
{ name: 'filter', type: 'string', description: '按 URL 或 API 名称过滤,支持正则' },
|
|
26
|
+
{ name: 'since', type: 'number', description: '只返回最近 N 秒内的请求' },
|
|
27
|
+
{ name: 'after', type: 'string', description: '只返回指定 capture cursor 之后的请求' },
|
|
15
28
|
{ name: 'includeBody', type: 'boolean', description: '是否包含请求/响应体,默认 true' },
|
|
16
29
|
],
|
|
17
30
|
examples: [
|
|
@@ -24,9 +37,11 @@ export const COMMANDS = [
|
|
|
24
37
|
description: '获取浏览器控制台日志',
|
|
25
38
|
params: [
|
|
26
39
|
{ name: 'tabId', type: 'number', description: '目标标签页 ID,从 tab_list 获取' },
|
|
27
|
-
{ name: 'limit', type: 'number', description: '
|
|
40
|
+
{ name: 'limit', type: 'number', description: '返回最新 N 条,默认 100' },
|
|
28
41
|
{ name: 'level', type: 'string', description: '按日志级别过滤:log/info/warn/error' },
|
|
29
42
|
{ name: 'filter', type: 'string', description: '按内容过滤,支持正则' },
|
|
43
|
+
{ name: 'since', type: 'number', description: '只返回最近 N 秒内的日志' },
|
|
44
|
+
{ name: 'after', type: 'string', description: '只返回指定 capture cursor 之后的日志' },
|
|
30
45
|
],
|
|
31
46
|
examples: [`get_logs --payload '{"limit":10,"level":"error"}'`],
|
|
32
47
|
},
|
|
@@ -368,8 +383,9 @@ export const COMMANDS = [
|
|
|
368
383
|
{
|
|
369
384
|
name: 'observe',
|
|
370
385
|
type: 'object | false',
|
|
371
|
-
description: '观察选项(quietMs/firstChangeTimeoutMs/timeoutMs/navigationGraceMs/navigationTimeoutMs/networkIdleMs/contentReadyAfterMs);传 false
|
|
386
|
+
description: '观察选项(quietMs/firstChangeTimeoutMs/timeoutMs/navigationGraceMs/navigationTimeoutMs/networkIdleMs/contentReadyAfterMs);传 false 只关闭 DOM/导航观察,默认诊断仍会返回',
|
|
372
387
|
},
|
|
388
|
+
PAGE_DIAGNOSTICS_PARAM,
|
|
373
389
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
374
390
|
],
|
|
375
391
|
examples: [
|
|
@@ -397,8 +413,9 @@ export const COMMANDS = [
|
|
|
397
413
|
{
|
|
398
414
|
name: 'observe',
|
|
399
415
|
type: 'object | false',
|
|
400
|
-
description: '观察选项;传 false
|
|
416
|
+
description: '观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回',
|
|
401
417
|
},
|
|
418
|
+
PAGE_DIAGNOSTICS_PARAM,
|
|
402
419
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
403
420
|
],
|
|
404
421
|
examples: [`page_type --payload '{"selector":"@e6","text":"搜索关键词"}'`],
|
|
@@ -416,8 +433,9 @@ export const COMMANDS = [
|
|
|
416
433
|
{
|
|
417
434
|
name: 'observe',
|
|
418
435
|
type: 'object | false',
|
|
419
|
-
description: '观察选项;传 false
|
|
436
|
+
description: '观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回',
|
|
420
437
|
},
|
|
438
|
+
PAGE_DIAGNOSTICS_PARAM,
|
|
421
439
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
422
440
|
],
|
|
423
441
|
examples: [`page_hover --payload '{"selector":".nav-menu"}'`],
|
|
@@ -446,8 +464,9 @@ export const COMMANDS = [
|
|
|
446
464
|
{
|
|
447
465
|
name: 'observe',
|
|
448
466
|
type: 'object | false',
|
|
449
|
-
description: '观察选项;传 false
|
|
467
|
+
description: '观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回',
|
|
450
468
|
},
|
|
469
|
+
PAGE_DIAGNOSTICS_PARAM,
|
|
451
470
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
452
471
|
],
|
|
453
472
|
examples: [
|
|
@@ -472,6 +491,7 @@ export const COMMANDS = [
|
|
|
472
491
|
type: 'object',
|
|
473
492
|
description: '仅在表达式会修改页面且需要观察结果时显式传入;不传保持轻量裸执行',
|
|
474
493
|
},
|
|
494
|
+
PAGE_DIAGNOSTICS_PARAM,
|
|
475
495
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
476
496
|
],
|
|
477
497
|
examples: [`page_eval --payload '{"expression":"document.title"}'`],
|
|
@@ -490,8 +510,9 @@ export const COMMANDS = [
|
|
|
490
510
|
{
|
|
491
511
|
name: 'observe',
|
|
492
512
|
type: 'object | false',
|
|
493
|
-
description: '观察选项;传 false
|
|
513
|
+
description: '观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回',
|
|
494
514
|
},
|
|
515
|
+
PAGE_DIAGNOSTICS_PARAM,
|
|
495
516
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
496
517
|
],
|
|
497
518
|
examples: [`page_press --payload '{"key":"Enter"}'`],
|
|
@@ -562,8 +583,9 @@ export const COMMANDS = [
|
|
|
562
583
|
{
|
|
563
584
|
name: 'observe',
|
|
564
585
|
type: 'object | false',
|
|
565
|
-
description: '观察选项;传 false
|
|
586
|
+
description: '观察选项;传 false 只关闭 DOM/导航观察,默认诊断仍会返回',
|
|
566
587
|
},
|
|
588
|
+
PAGE_DIAGNOSTICS_PARAM,
|
|
567
589
|
{ name: 'tabId', type: 'number', required: true, description: '目标标签页 ID' },
|
|
568
590
|
],
|
|
569
591
|
examples: [
|
|
@@ -2,22 +2,37 @@ export interface GetRequestsParams {
|
|
|
2
2
|
tabId?: number;
|
|
3
3
|
count?: number;
|
|
4
4
|
filter?: string;
|
|
5
|
+
/** Relative time window in seconds. */
|
|
5
6
|
since?: number;
|
|
7
|
+
/** Opaque cursor returned by capture_checkpoint or a previous query. */
|
|
8
|
+
after?: string;
|
|
6
9
|
includeBody?: boolean;
|
|
7
10
|
includeHeaders?: boolean;
|
|
8
11
|
maxBodySize?: number;
|
|
9
12
|
fields?: string[];
|
|
10
13
|
keysOnly?: boolean;
|
|
11
14
|
applyHiddenFilter?: boolean;
|
|
12
|
-
source?: 'mtop' | 'requests';
|
|
15
|
+
source?: 'mtop' | 'requests' | 'all';
|
|
13
16
|
}
|
|
14
17
|
export interface GetLogsParams {
|
|
15
18
|
tabId?: number;
|
|
16
19
|
level?: 'log' | 'warn' | 'error' | 'info' | 'all';
|
|
20
|
+
/** Relative time window in seconds. */
|
|
17
21
|
since?: number;
|
|
22
|
+
/** Opaque cursor returned by capture_checkpoint or a previous query. */
|
|
23
|
+
after?: string;
|
|
18
24
|
limit?: number;
|
|
19
25
|
filter?: string;
|
|
20
26
|
}
|
|
27
|
+
export interface CaptureCheckpointParams {
|
|
28
|
+
tabId?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface CaptureCheckpointResult {
|
|
31
|
+
tabId: number;
|
|
32
|
+
cursor: string;
|
|
33
|
+
timestampMs: number;
|
|
34
|
+
captureStatus: 'armed' | 'active';
|
|
35
|
+
}
|
|
21
36
|
export interface GetEventsParams {
|
|
22
37
|
tabId?: number;
|
|
23
38
|
source?: 'rum' | 'aplus' | 'arms' | 'all';
|
|
@@ -253,6 +268,11 @@ export interface PageObservationWaitOptions {
|
|
|
253
268
|
networkIdleMs?: number;
|
|
254
269
|
contentReadyAfterMs?: number;
|
|
255
270
|
}
|
|
271
|
+
export interface PageDiagnosticsOptions {
|
|
272
|
+
logs?: boolean | Pick<GetLogsParams, 'level' | 'limit' | 'filter'>;
|
|
273
|
+
requests?: boolean | Pick<GetRequestsParams, 'count' | 'filter' | 'includeBody' | 'includeHeaders' | 'maxBodySize' | 'fields' | 'keysOnly' | 'source'>;
|
|
274
|
+
}
|
|
275
|
+
export type PageDiagnosticsSetting = PageDiagnosticsOptions | boolean;
|
|
256
276
|
export interface PageClickParams {
|
|
257
277
|
tabId?: number;
|
|
258
278
|
selector?: string;
|
|
@@ -266,6 +286,7 @@ export interface PageClickParams {
|
|
|
266
286
|
scope?: string;
|
|
267
287
|
clickMode?: 'auto' | 'dom' | 'mouse' | 'touch';
|
|
268
288
|
observe?: PageObservationWaitOptions | false;
|
|
289
|
+
diagnostics?: PageDiagnosticsSetting;
|
|
269
290
|
}
|
|
270
291
|
export interface PageTypeParams {
|
|
271
292
|
tabId?: number;
|
|
@@ -273,6 +294,7 @@ export interface PageTypeParams {
|
|
|
273
294
|
text: string;
|
|
274
295
|
clearFirst?: boolean;
|
|
275
296
|
observe?: PageObservationWaitOptions | false;
|
|
297
|
+
diagnostics?: PageDiagnosticsSetting;
|
|
276
298
|
}
|
|
277
299
|
export interface PageScrollParams {
|
|
278
300
|
tabId?: number;
|
|
@@ -281,11 +303,13 @@ export interface PageScrollParams {
|
|
|
281
303
|
selector?: string;
|
|
282
304
|
containerPolicy?: 'self' | 'nearest';
|
|
283
305
|
observe?: PageObservationWaitOptions | false;
|
|
306
|
+
diagnostics?: PageDiagnosticsSetting;
|
|
284
307
|
}
|
|
285
308
|
export interface PageHoverParams {
|
|
286
309
|
tabId?: number;
|
|
287
310
|
selector: string;
|
|
288
311
|
observe?: PageObservationWaitOptions | false;
|
|
312
|
+
diagnostics?: PageDiagnosticsSetting;
|
|
289
313
|
}
|
|
290
314
|
export interface PageEvalParams {
|
|
291
315
|
tabId?: number;
|
|
@@ -293,6 +317,7 @@ export interface PageEvalParams {
|
|
|
293
317
|
frameId?: string;
|
|
294
318
|
awaitPromise?: boolean;
|
|
295
319
|
observe?: PageObservationWaitOptions;
|
|
320
|
+
diagnostics?: PageDiagnosticsSetting;
|
|
296
321
|
}
|
|
297
322
|
export interface PageSnapshotQuery {
|
|
298
323
|
text?: string;
|
|
@@ -315,6 +340,7 @@ export interface PagePressParams {
|
|
|
315
340
|
key: string;
|
|
316
341
|
modifiers?: string[];
|
|
317
342
|
observe?: PageObservationWaitOptions | false;
|
|
343
|
+
diagnostics?: PageDiagnosticsSetting;
|
|
318
344
|
}
|
|
319
345
|
export interface PageWaitParams {
|
|
320
346
|
tabId?: number;
|
|
@@ -335,6 +361,7 @@ export interface PageUploadParams {
|
|
|
335
361
|
selector: string;
|
|
336
362
|
filePaths: string[];
|
|
337
363
|
observe?: PageObservationWaitOptions | false;
|
|
364
|
+
diagnostics?: PageDiagnosticsSetting;
|
|
338
365
|
}
|
|
339
366
|
export interface PageFramesParams {
|
|
340
367
|
tabId?: number;
|
|
@@ -402,6 +429,10 @@ export interface RunActionsParams {
|
|
|
402
429
|
tabId: number;
|
|
403
430
|
}
|
|
404
431
|
export interface BrowserActionMap {
|
|
432
|
+
capture_checkpoint: {
|
|
433
|
+
request: CaptureCheckpointParams;
|
|
434
|
+
response: CaptureCheckpointResult;
|
|
435
|
+
};
|
|
405
436
|
get_requests: {
|
|
406
437
|
request: GetRequestsParams;
|
|
407
438
|
response: unknown;
|
|
@@ -575,6 +606,7 @@ export type ExtensionBrowserAction = Exclude<BrowserCommandAction, 'browser_list
|
|
|
575
606
|
export declare const PAGE_ACT_ACTIONS: readonly ["page_click", "page_type", "page_hover", "page_scroll", "page_press", "page_upload", "page_eval"];
|
|
576
607
|
export type PageActAction = (typeof PAGE_ACT_ACTIONS)[number];
|
|
577
608
|
export declare const BROWSER_ACTIONS: {
|
|
609
|
+
readonly capture_checkpoint: true;
|
|
578
610
|
readonly get_requests: true;
|
|
579
611
|
readonly get_logs: true;
|
|
580
612
|
readonly get_events: true;
|
|
@@ -618,6 +650,7 @@ export declare const BROWSER_ACTIONS: {
|
|
|
618
650
|
readonly run_actions: true;
|
|
619
651
|
};
|
|
620
652
|
export declare const BROWSER_COMMAND_ACTIONS: {
|
|
653
|
+
readonly capture_checkpoint: true;
|
|
621
654
|
readonly get_requests: true;
|
|
622
655
|
readonly get_logs: true;
|
|
623
656
|
readonly get_events: true;
|
|
@@ -660,6 +693,7 @@ export declare const BROWSER_COMMAND_ACTIONS: {
|
|
|
660
693
|
readonly run_actions: true;
|
|
661
694
|
};
|
|
662
695
|
export declare const EXTENSION_BROWSER_ACTIONS: {
|
|
696
|
+
readonly capture_checkpoint: true;
|
|
663
697
|
readonly get_requests: true;
|
|
664
698
|
readonly get_logs: true;
|
|
665
699
|
readonly get_events: true;
|
|
@@ -16,6 +16,7 @@ export const PAGE_ACT_ACTIONS = [
|
|
|
16
16
|
'page_eval',
|
|
17
17
|
];
|
|
18
18
|
export const BROWSER_ACTIONS = {
|
|
19
|
+
capture_checkpoint: true,
|
|
19
20
|
get_requests: true,
|
|
20
21
|
get_logs: true,
|
|
21
22
|
get_events: true,
|
|
@@ -59,6 +60,7 @@ export const BROWSER_ACTIONS = {
|
|
|
59
60
|
run_actions: true,
|
|
60
61
|
};
|
|
61
62
|
export const BROWSER_COMMAND_ACTIONS = {
|
|
63
|
+
capture_checkpoint: true,
|
|
62
64
|
get_requests: true,
|
|
63
65
|
get_logs: true,
|
|
64
66
|
get_events: true,
|
|
@@ -101,6 +103,7 @@ export const BROWSER_COMMAND_ACTIONS = {
|
|
|
101
103
|
run_actions: true,
|
|
102
104
|
};
|
|
103
105
|
export const EXTENSION_BROWSER_ACTIONS = {
|
|
106
|
+
capture_checkpoint: true,
|
|
104
107
|
get_requests: true,
|
|
105
108
|
get_logs: true,
|
|
106
109
|
get_events: true,
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
export { invoke } from './socket.js';
|
|
8
8
|
export type { InvokeOptions } from './socket.js';
|
|
9
9
|
export { BROWSER_ACTIONS, BROWSER_COMMAND_ACTIONS, EXTENSION_BROWSER_ACTIONS, PAGE_ACT_ACTIONS, SEND_REQUEST_MAX_FILES, SEND_REQUEST_MAX_TOTAL_BASE64_FILE_BYTES, SEND_REQUEST_MAX_TOTAL_FILE_BYTES, isBrowserAction, isBrowserCommandAction, isExtensionBrowserAction, } from './generated-browser-action-protocol.js';
|
|
10
|
-
export type { ActionStep, BrowserAction, BrowserActionMap, BrowserActionRequest, BrowserActionResponse, BrowserCloseParams, BrowserCommandAction, BrowserInfo, BrowserInfoBase, BrowserLaunchParams, BrowserListResult, BrowserReleaseFailure, BrowserReleaseResult, BrowserStatus, BrowserDevicePresetName, BrowserEmulationOptions, ExtensionBrowserAction, GetApiSchemaParams, GetCookieParams, GetCookieResult, GetEventsParams, GetLogsParams, GetMocksParams, GetRequestsParams, GetUserInfoParams, ManagedBrowserAccount, ManagedBrowserInfo, PageClickParams, PageActAction, PageEvalParams, PageFramesParams, PageHoverParams, PageNavigateParams, PageObservationWaitOptions, PagePressParams, PageScreenshotParams, PageScrollParams, PageSelectedElementParams, PageSnapshotParams, PageSnapshotQuery, PageTypeParams, PageUploadParams, PageWaitParams, RecordParams, RegularBrowserInfo, RequestDomainPermissionParams, RulesResult, RunActionName, RunActionsParams, SelectBrowserParams, SelectBrowserResult, SendRequestFile, SendRequestFormValue, SendMtopRequestParams, SendRequestParams, SetCookieParams, SetCookieResult, SetDeviceEmulationParams, SetMockParams, SetRuleParams, SetTimezoneParams, SetTimezoneResult, TabCloseParams, TabOpenParams, TdbankAccountParams, } from './generated-browser-action-protocol.js';
|
|
10
|
+
export type { ActionStep, BrowserAction, BrowserActionMap, BrowserActionRequest, BrowserActionResponse, BrowserCloseParams, BrowserCommandAction, BrowserInfo, BrowserInfoBase, BrowserLaunchParams, BrowserListResult, BrowserReleaseFailure, BrowserReleaseResult, BrowserStatus, CaptureCheckpointParams, CaptureCheckpointResult, BrowserDevicePresetName, BrowserEmulationOptions, ExtensionBrowserAction, GetApiSchemaParams, GetCookieParams, GetCookieResult, GetEventsParams, GetLogsParams, GetMocksParams, GetRequestsParams, GetUserInfoParams, ManagedBrowserAccount, ManagedBrowserInfo, PageClickParams, PageActAction, PageDiagnosticsOptions, PageDiagnosticsSetting, PageEvalParams, PageFramesParams, PageHoverParams, PageNavigateParams, PageObservationWaitOptions, PagePressParams, PageScreenshotParams, PageScrollParams, PageSelectedElementParams, PageSnapshotParams, PageSnapshotQuery, PageTypeParams, PageUploadParams, PageWaitParams, RecordParams, RegularBrowserInfo, RequestDomainPermissionParams, RulesResult, RunActionName, RunActionsParams, SelectBrowserParams, SelectBrowserResult, SendRequestFile, SendRequestFormValue, SendMtopRequestParams, SendRequestParams, SetCookieParams, SetCookieResult, SetDeviceEmulationParams, SetMockParams, SetRuleParams, SetTimezoneParams, SetTimezoneResult, TabCloseParams, TabOpenParams, TdbankAccountParams, } from './generated-browser-action-protocol.js';
|
|
11
11
|
import type * as Protocol from './generated-browser-action-protocol.js';
|
|
12
|
+
export declare function captureCheckpoint(params?: Protocol.CaptureCheckpointParams): Promise<Protocol.BrowserActionResponse<'capture_checkpoint'>>;
|
|
12
13
|
export declare function getRequests(params?: Protocol.GetRequestsParams): Promise<Protocol.BrowserActionResponse<'get_requests'>>;
|
|
13
14
|
export declare function getLogs(params?: Protocol.GetLogsParams): Promise<Protocol.BrowserActionResponse<'get_logs'>>;
|
|
14
15
|
export declare function getEvents(params?: Protocol.GetEventsParams): Promise<Protocol.BrowserActionResponse<'get_events'>>;
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
export { invoke } from './socket.js';
|
|
8
8
|
export { BROWSER_ACTIONS, BROWSER_COMMAND_ACTIONS, EXTENSION_BROWSER_ACTIONS, PAGE_ACT_ACTIONS, SEND_REQUEST_MAX_FILES, SEND_REQUEST_MAX_TOTAL_BASE64_FILE_BYTES, SEND_REQUEST_MAX_TOTAL_FILE_BYTES, isBrowserAction, isBrowserCommandAction, isExtensionBrowserAction, } from './generated-browser-action-protocol.js';
|
|
9
9
|
import { invoke } from './socket.js';
|
|
10
|
+
export function captureCheckpoint(params = {}) {
|
|
11
|
+
return invoke('capture_checkpoint', params);
|
|
12
|
+
}
|
|
10
13
|
export function getRequests(params = {}) {
|
|
11
14
|
return invoke('get_requests', params);
|
|
12
15
|
}
|