@browserbridge/bbx 1.7.8 → 1.9.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/PRIVACY.md +57 -12
- package/README.md +19 -8
- package/SECURITY.md +12 -0
- package/package.json +15 -6
- package/packages/agent-client/src/cli-args.js +59 -0
- package/packages/agent-client/src/cli-batch.js +121 -58
- package/packages/agent-client/src/cli-output.js +8 -1
- package/packages/agent-client/src/cli.js +272 -70
- package/packages/agent-client/src/client.js +296 -8
- package/packages/agent-client/src/command-registry.js +64 -55
- package/packages/agent-client/src/config.js +195 -0
- package/packages/agent-client/src/content-extract.js +198 -0
- package/packages/agent-client/src/npm-self-update.js +305 -0
- package/packages/agent-client/src/remotes.js +4 -2
- package/packages/agent-client/src/runtime.js +864 -39
- package/packages/agent-client/src/types.ts +169 -6
- package/packages/mcp-server/src/guidance.js +1 -1
- package/packages/mcp-server/src/handlers-capture.js +69 -6
- package/packages/mcp-server/src/handlers-dom.js +61 -4
- package/packages/mcp-server/src/handlers-navigation.js +2 -1
- package/packages/mcp-server/src/handlers-page.js +211 -54
- package/packages/mcp-server/src/handlers-utils.js +101 -10
- package/packages/mcp-server/src/handlers.js +14 -7
- package/packages/mcp-server/src/server.js +176 -11
- package/packages/native-host/src/artifact-store.js +353 -0
- package/packages/native-host/src/config.js +9 -1
- package/packages/native-host/src/daemon-logger.js +3 -1
- package/packages/native-host/src/daemon.js +701 -33
- package/packages/native-host/src/native-host.js +28 -3
- package/packages/protocol/src/capability-values.js +2 -0
- package/packages/protocol/src/defaults.js +31 -0
- package/packages/protocol/src/errors.js +102 -6
- package/packages/protocol/src/incidental-sanitizer.js +197 -0
- package/packages/protocol/src/index.js +2 -0
- package/packages/protocol/src/protocol.js +612 -6
- package/packages/protocol/src/recovery-telemetry.js +302 -0
- package/packages/protocol/src/registry.js +206 -38
- package/packages/protocol/src/summary.js +203 -30
- package/packages/protocol/src/types.ts +721 -2
- package/skills/browser-bridge/SKILL.md +54 -19
- package/skills/browser-bridge/references/interaction.md +55 -11
- package/skills/browser-bridge/references/patch-workflow.md +2 -0
- package/skills/browser-bridge/references/protocol.md +265 -86
- package/skills/browser-bridge/references/token-efficiency.md +29 -13
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export type BridgeRequestSource = 'cli' | 'mcp';
|
|
2
2
|
|
|
3
|
+
export type AccessIntent = 'inspect' | 'interact' | 'capture' | 'navigate' | 'debugger' | 'general';
|
|
4
|
+
|
|
5
|
+
export interface AccessRequestParams {
|
|
6
|
+
intent?: AccessIntent;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface NormalizedAccessRequestParams extends BridgeParams {
|
|
10
|
+
intent: AccessIntent;
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
export type Capability =
|
|
4
14
|
| 'page.read'
|
|
5
15
|
| 'page.evaluate'
|
|
@@ -19,14 +29,32 @@ export type Capability =
|
|
|
19
29
|
| 'tabs.manage'
|
|
20
30
|
| 'performance.read'
|
|
21
31
|
| 'network.read'
|
|
22
|
-
| 'network.intercept'
|
|
32
|
+
| 'network.intercept'
|
|
33
|
+
| 'sensitive.read';
|
|
23
34
|
|
|
24
35
|
export type ErrorCode =
|
|
25
36
|
| 'ACCESS_DENIED'
|
|
26
37
|
| 'TAB_MISMATCH'
|
|
27
38
|
| 'ELEMENT_STALE'
|
|
39
|
+
| 'ELEMENT_AMBIGUOUS'
|
|
40
|
+
| 'ELEMENT_NOT_ACTIONABLE'
|
|
41
|
+
| 'ELEMENT_OBSCURED'
|
|
42
|
+
| 'ELEMENT_NOT_FOUND'
|
|
43
|
+
| 'INPUT_UNSUPPORTED'
|
|
44
|
+
| 'INPUT_INVALID_TARGET'
|
|
45
|
+
| 'INPUT_FOCUS_CHANGED'
|
|
46
|
+
| 'DIALOG_NOT_OPEN'
|
|
47
|
+
| 'DIALOG_ACTION_CONFLICT'
|
|
28
48
|
| 'RESULT_TRUNCATED'
|
|
29
|
-
| '
|
|
49
|
+
| 'RESULT_TOO_LARGE'
|
|
50
|
+
| 'SENSITIVE_TARGET_NOT_FOUND'
|
|
51
|
+
| 'CONTENT_SCRIPT_UNAVAILABLE'
|
|
52
|
+
| 'ARTIFACT_NOT_FOUND'
|
|
53
|
+
| 'ARTIFACT_QUOTA_EXCEEDED'
|
|
54
|
+
| 'ARTIFACT_TRANSFER_INVALID'
|
|
55
|
+
| 'DOM_BASELINE_NOT_FOUND'
|
|
56
|
+
| 'DOM_BASELINE_INVALIDATED'
|
|
57
|
+
| 'DOM_BASELINE_QUOTA_EXCEEDED'
|
|
30
58
|
| 'INTERNAL_ERROR'
|
|
31
59
|
| 'INVALID_REQUEST'
|
|
32
60
|
| 'NATIVE_HOST_UNAVAILABLE'
|
|
@@ -45,10 +73,14 @@ export type BridgeMethod =
|
|
|
45
73
|
| 'page.get_state'
|
|
46
74
|
| 'page.evaluate'
|
|
47
75
|
| 'page.get_console'
|
|
76
|
+
| 'page.handle_dialog'
|
|
48
77
|
| 'page.wait_for_load_state'
|
|
49
78
|
| 'page.get_storage'
|
|
79
|
+
| 'sensitive.read'
|
|
50
80
|
| 'page.get_text'
|
|
81
|
+
| 'page.extract_content'
|
|
51
82
|
| 'page.get_network'
|
|
83
|
+
| 'network.export_har'
|
|
52
84
|
| 'network.intercept.add'
|
|
53
85
|
| 'network.intercept.remove'
|
|
54
86
|
| 'network.intercept.list'
|
|
@@ -58,6 +90,10 @@ export type BridgeMethod =
|
|
|
58
90
|
| 'navigation.go_back'
|
|
59
91
|
| 'navigation.go_forward'
|
|
60
92
|
| 'dom.query'
|
|
93
|
+
| 'dom.baseline.create'
|
|
94
|
+
| 'dom.baseline.compare'
|
|
95
|
+
| 'dom.baseline.describe'
|
|
96
|
+
| 'dom.baseline.release'
|
|
61
97
|
| 'dom.describe'
|
|
62
98
|
| 'dom.get_text'
|
|
63
99
|
| 'dom.get_attributes'
|
|
@@ -85,6 +121,8 @@ export type BridgeMethod =
|
|
|
85
121
|
| 'screenshot.capture_region'
|
|
86
122
|
| 'screenshot.capture_element'
|
|
87
123
|
| 'screenshot.capture_full_page'
|
|
124
|
+
| 'artifact.read'
|
|
125
|
+
| 'artifact.delete'
|
|
88
126
|
| 'patch.apply_styles'
|
|
89
127
|
| 'patch.apply_dom'
|
|
90
128
|
| 'patch.list'
|
|
@@ -121,9 +159,44 @@ export interface BridgeMeta {
|
|
|
121
159
|
budget_applied?: boolean;
|
|
122
160
|
budget_truncated?: boolean;
|
|
123
161
|
continuation_hint?: string | null;
|
|
162
|
+
automatic_retry?: { attempt: 2; reason: 'retryable_error' };
|
|
163
|
+
stale_recovery?: 'success' | 'failure';
|
|
124
164
|
[key: string]: unknown;
|
|
125
165
|
}
|
|
126
166
|
|
|
167
|
+
export type RecoveryScope = 'routedExtension' | 'daemon';
|
|
168
|
+
|
|
169
|
+
export type RecoveryEventKind =
|
|
170
|
+
| 'automatic_mcp_retry'
|
|
171
|
+
| 'stale_ref_recovery'
|
|
172
|
+
| 'debugger_reattach'
|
|
173
|
+
| 'content_script_reinjection'
|
|
174
|
+
| 'native_host_reconnect'
|
|
175
|
+
| 'request_outcome';
|
|
176
|
+
|
|
177
|
+
export interface RecoveryEventSummary {
|
|
178
|
+
attempts: number;
|
|
179
|
+
successes: number;
|
|
180
|
+
failures: number;
|
|
181
|
+
pending: number;
|
|
182
|
+
saturated: boolean;
|
|
183
|
+
successRate: number | null;
|
|
184
|
+
failureRate: number | null;
|
|
185
|
+
activeLoop: boolean;
|
|
186
|
+
lastEventAt: number | null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface RecoveryTelemetrySummary {
|
|
190
|
+
scope: RecoveryScope;
|
|
191
|
+
windowMs: number;
|
|
192
|
+
bucketMs: number;
|
|
193
|
+
loopWindowMs: number;
|
|
194
|
+
loopThreshold: number;
|
|
195
|
+
asOf: number;
|
|
196
|
+
activeLoop: boolean;
|
|
197
|
+
events: Record<RecoveryEventKind, RecoveryEventSummary>;
|
|
198
|
+
}
|
|
199
|
+
|
|
127
200
|
export interface BridgeParams {
|
|
128
201
|
[key: string]: unknown;
|
|
129
202
|
}
|
|
@@ -202,6 +275,147 @@ export interface NormalizedDomQuery extends BridgeParams {
|
|
|
202
275
|
budget: Budget;
|
|
203
276
|
}
|
|
204
277
|
|
|
278
|
+
export interface DomBaselineCreateParams {
|
|
279
|
+
selector?: string;
|
|
280
|
+
maxNodes?: number;
|
|
281
|
+
maxDepth?: number;
|
|
282
|
+
textBudget?: number;
|
|
283
|
+
attributeAllowlist?: string[];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface NormalizedDomBaselineCreateParams extends BridgeParams {
|
|
287
|
+
selector: string;
|
|
288
|
+
maxNodes: number;
|
|
289
|
+
maxDepth: number;
|
|
290
|
+
textBudget: number;
|
|
291
|
+
attributeAllowlist: string[];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface DomBaselineCompareParams {
|
|
295
|
+
baselineId?: string;
|
|
296
|
+
maxChanges?: number;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface NormalizedDomBaselineCompareParams extends BridgeParams {
|
|
300
|
+
baselineId: string;
|
|
301
|
+
maxChanges: number;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface DomBaselineHandleParams {
|
|
305
|
+
baselineId?: string;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface NormalizedDomBaselineHandleParams extends BridgeParams {
|
|
309
|
+
baselineId: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface DomBaselineOptions {
|
|
313
|
+
maxNodes: number;
|
|
314
|
+
maxDepth: number;
|
|
315
|
+
textBudget: number;
|
|
316
|
+
attributeAllowlist: string[];
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface DomBaselineScope {
|
|
320
|
+
windowId: number;
|
|
321
|
+
tabId: number;
|
|
322
|
+
frameId: number;
|
|
323
|
+
documentToken: string;
|
|
324
|
+
selector: string;
|
|
325
|
+
representation: 'semantic-dom-v1';
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface DomBaselineSnapshotStats {
|
|
329
|
+
nodeCount: number;
|
|
330
|
+
byteLength: number;
|
|
331
|
+
digest: string;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface DomBaselineDescriptor {
|
|
335
|
+
baselineId: string;
|
|
336
|
+
createdAt: string;
|
|
337
|
+
expiresAt: string;
|
|
338
|
+
scope: DomBaselineScope;
|
|
339
|
+
options: DomBaselineOptions;
|
|
340
|
+
snapshot: DomBaselineSnapshotStats;
|
|
341
|
+
evicted?: Array<{
|
|
342
|
+
baselineId: string;
|
|
343
|
+
reason: 'per_tab_quota' | 'global_quota';
|
|
344
|
+
}>;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export type DomBaselineCreateResult = DomBaselineDescriptor;
|
|
348
|
+
export type DomBaselineDescribeResult = DomBaselineDescriptor;
|
|
349
|
+
|
|
350
|
+
export interface DomBaselineSemanticNodeEvidence {
|
|
351
|
+
tag: string;
|
|
352
|
+
role: string | null;
|
|
353
|
+
name: string | null;
|
|
354
|
+
text: string;
|
|
355
|
+
attributes: Record<string, string>;
|
|
356
|
+
depth: number;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export type DomBaselineNodeEvidence = DomBaselineSemanticNodeEvidence;
|
|
360
|
+
|
|
361
|
+
export interface DomBaselineChangedNode {
|
|
362
|
+
fields: string[];
|
|
363
|
+
before: DomBaselineSemanticNodeEvidence;
|
|
364
|
+
after: DomBaselineSemanticNodeEvidence;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface DomBaselineNodeLocation {
|
|
368
|
+
ancestry: string[];
|
|
369
|
+
order: number;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export interface DomBaselineMovedNode {
|
|
373
|
+
node: DomBaselineSemanticNodeEvidence;
|
|
374
|
+
from: DomBaselineNodeLocation;
|
|
375
|
+
to: DomBaselineNodeLocation;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export interface DomBaselineChangeCounts {
|
|
379
|
+
added: number;
|
|
380
|
+
removed: number;
|
|
381
|
+
changed: number;
|
|
382
|
+
moved: number;
|
|
383
|
+
unchanged: number;
|
|
384
|
+
total: number;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export interface DomBaselineReturnedCounts {
|
|
388
|
+
added: number;
|
|
389
|
+
removed: number;
|
|
390
|
+
changed: number;
|
|
391
|
+
moved: number;
|
|
392
|
+
total: number;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export interface DomBaselineCompareResult {
|
|
396
|
+
baselineId: string;
|
|
397
|
+
equal: boolean;
|
|
398
|
+
comparedAt: string;
|
|
399
|
+
counts: DomBaselineChangeCounts;
|
|
400
|
+
returnedCounts: DomBaselineReturnedCounts;
|
|
401
|
+
added: DomBaselineSemanticNodeEvidence[];
|
|
402
|
+
removed: DomBaselineSemanticNodeEvidence[];
|
|
403
|
+
changed: DomBaselineChangedNode[];
|
|
404
|
+
moved: DomBaselineMovedNode[];
|
|
405
|
+
truncated: boolean;
|
|
406
|
+
omittedChanges: number;
|
|
407
|
+
ambiguity: {
|
|
408
|
+
count: number;
|
|
409
|
+
examples: DomBaselineSemanticNodeEvidence[];
|
|
410
|
+
};
|
|
411
|
+
guidance: string;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export interface DomBaselineReleaseResult {
|
|
415
|
+
baselineId: string;
|
|
416
|
+
released: boolean;
|
|
417
|
+
}
|
|
418
|
+
|
|
205
419
|
export interface DomFindResult {
|
|
206
420
|
found: boolean;
|
|
207
421
|
nodes: Record<string, unknown>[];
|
|
@@ -228,6 +442,29 @@ export interface InputTarget {
|
|
|
228
442
|
selector?: string;
|
|
229
443
|
}
|
|
230
444
|
|
|
445
|
+
export type InputExecutionMode = 'dom' | 'cdp';
|
|
446
|
+
|
|
447
|
+
export interface InputResolutionMetadata {
|
|
448
|
+
strategy: 'elementRef' | 'selector-first' | 'selector-ranked' | 'stale-recovery';
|
|
449
|
+
candidateCount: number;
|
|
450
|
+
evaluatedCount: number;
|
|
451
|
+
scrolled: boolean;
|
|
452
|
+
hitTest: 'target' | 'descendant' | 'none' | 'not-required';
|
|
453
|
+
recovered: boolean;
|
|
454
|
+
oldRef?: string;
|
|
455
|
+
newRef?: string;
|
|
456
|
+
matchedFields?: string[];
|
|
457
|
+
confidenceBasis?: string;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export interface InputExecutionMetadata {
|
|
461
|
+
requestedMode: InputExecutionMode;
|
|
462
|
+
actualMode: InputExecutionMode;
|
|
463
|
+
fallbackReason: null;
|
|
464
|
+
debuggerUsed: boolean;
|
|
465
|
+
targetCoordinates?: { x: number; y: number };
|
|
466
|
+
}
|
|
467
|
+
|
|
231
468
|
export interface InputActionParams {
|
|
232
469
|
target?: InputTarget;
|
|
233
470
|
button?: 'left' | 'middle' | 'right';
|
|
@@ -239,6 +476,8 @@ export interface InputActionParams {
|
|
|
239
476
|
submit?: boolean;
|
|
240
477
|
key?: string;
|
|
241
478
|
modifiers?: string[];
|
|
479
|
+
executionMode?: InputExecutionMode;
|
|
480
|
+
recoverStale?: boolean;
|
|
242
481
|
}
|
|
243
482
|
|
|
244
483
|
export interface NormalizedInputAction extends BridgeParams {
|
|
@@ -252,6 +491,8 @@ export interface NormalizedInputAction extends BridgeParams {
|
|
|
252
491
|
submit: boolean;
|
|
253
492
|
key: string;
|
|
254
493
|
modifiers: string[];
|
|
494
|
+
executionMode: InputExecutionMode;
|
|
495
|
+
recoverStale: boolean;
|
|
255
496
|
}
|
|
256
497
|
|
|
257
498
|
export interface CdpDispatchKeyEventParams {
|
|
@@ -264,6 +505,10 @@ export interface CdpNodeIdParams {
|
|
|
264
505
|
nodeId?: number;
|
|
265
506
|
}
|
|
266
507
|
|
|
508
|
+
export interface CdpDomSnapshotParams {
|
|
509
|
+
computedStyles?: string[];
|
|
510
|
+
}
|
|
511
|
+
|
|
267
512
|
export interface NormalizedCdpDispatchKeyEventParams extends BridgeParams {
|
|
268
513
|
key: string;
|
|
269
514
|
code: string;
|
|
@@ -274,14 +519,22 @@ export interface NormalizedCdpNodeIdParams extends BridgeParams {
|
|
|
274
519
|
nodeId: number;
|
|
275
520
|
}
|
|
276
521
|
|
|
522
|
+
export interface NormalizedCdpDomSnapshotParams extends BridgeParams {
|
|
523
|
+
computedStyles: string[];
|
|
524
|
+
}
|
|
525
|
+
|
|
277
526
|
export interface CheckedActionParams {
|
|
278
527
|
target?: InputTarget;
|
|
279
528
|
checked?: boolean;
|
|
529
|
+
executionMode?: InputExecutionMode;
|
|
530
|
+
recoverStale?: boolean;
|
|
280
531
|
}
|
|
281
532
|
|
|
282
533
|
export interface NormalizedCheckedAction extends BridgeParams {
|
|
283
534
|
target: InputTarget;
|
|
284
535
|
checked: boolean;
|
|
536
|
+
executionMode: InputExecutionMode;
|
|
537
|
+
recoverStale: boolean;
|
|
285
538
|
}
|
|
286
539
|
|
|
287
540
|
export interface SelectActionParams {
|
|
@@ -289,6 +542,8 @@ export interface SelectActionParams {
|
|
|
289
542
|
values?: string[];
|
|
290
543
|
labels?: string[];
|
|
291
544
|
indexes?: number[];
|
|
545
|
+
executionMode?: InputExecutionMode;
|
|
546
|
+
recoverStale?: boolean;
|
|
292
547
|
}
|
|
293
548
|
|
|
294
549
|
export interface NormalizedSelectAction extends BridgeParams {
|
|
@@ -296,6 +551,8 @@ export interface NormalizedSelectAction extends BridgeParams {
|
|
|
296
551
|
values: string[];
|
|
297
552
|
labels: string[];
|
|
298
553
|
indexes: number[];
|
|
554
|
+
executionMode: InputExecutionMode;
|
|
555
|
+
recoverStale: boolean;
|
|
299
556
|
}
|
|
300
557
|
|
|
301
558
|
export interface ViewportActionParams {
|
|
@@ -417,6 +674,21 @@ export interface ConsoleParams {
|
|
|
417
674
|
limit?: number;
|
|
418
675
|
}
|
|
419
676
|
|
|
677
|
+
export type DialogAction = 'inspect' | 'accept' | 'dismiss';
|
|
678
|
+
|
|
679
|
+
export interface HandleDialogParams {
|
|
680
|
+
action?: DialogAction;
|
|
681
|
+
promptText?: string;
|
|
682
|
+
/** Optional stale-decision check performed immediately before CDP dispatch. */
|
|
683
|
+
expectedDialogId?: string;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
export interface NormalizedHandleDialogParams extends BridgeParams {
|
|
687
|
+
action: DialogAction;
|
|
688
|
+
promptText: string | null;
|
|
689
|
+
expectedDialogId: string | null;
|
|
690
|
+
}
|
|
691
|
+
|
|
420
692
|
export interface NormalizedConsoleParams extends BridgeParams {
|
|
421
693
|
level: string;
|
|
422
694
|
clear: boolean;
|
|
@@ -483,12 +755,16 @@ export interface HoverParams {
|
|
|
483
755
|
target?: InputTarget;
|
|
484
756
|
duration?: number;
|
|
485
757
|
modifiers?: string[];
|
|
758
|
+
executionMode?: InputExecutionMode;
|
|
759
|
+
recoverStale?: boolean;
|
|
486
760
|
}
|
|
487
761
|
|
|
488
762
|
export interface NormalizedHoverParams extends BridgeParams {
|
|
489
763
|
target: InputTarget;
|
|
490
764
|
duration: number;
|
|
491
765
|
modifiers: string[];
|
|
766
|
+
executionMode: InputExecutionMode;
|
|
767
|
+
recoverStale: boolean;
|
|
492
768
|
}
|
|
493
769
|
|
|
494
770
|
export interface DragParams {
|
|
@@ -496,6 +772,8 @@ export interface DragParams {
|
|
|
496
772
|
destination?: InputTarget;
|
|
497
773
|
offsetX?: number;
|
|
498
774
|
offsetY?: number;
|
|
775
|
+
executionMode?: InputExecutionMode;
|
|
776
|
+
recoverStale?: boolean;
|
|
499
777
|
}
|
|
500
778
|
|
|
501
779
|
export interface NormalizedDragParams extends BridgeParams {
|
|
@@ -503,6 +781,8 @@ export interface NormalizedDragParams extends BridgeParams {
|
|
|
503
781
|
destination: InputTarget;
|
|
504
782
|
offsetX: number;
|
|
505
783
|
offsetY: number;
|
|
784
|
+
executionMode: InputExecutionMode;
|
|
785
|
+
recoverStale: boolean;
|
|
506
786
|
}
|
|
507
787
|
|
|
508
788
|
export interface StorageParams {
|
|
@@ -515,14 +795,136 @@ export interface NormalizedStorageParams extends BridgeParams {
|
|
|
515
795
|
keys: string[] | null;
|
|
516
796
|
}
|
|
517
797
|
|
|
798
|
+
export type SensitiveStorageSource = 'local_storage' | 'session_storage';
|
|
799
|
+
|
|
800
|
+
export interface SensitiveReadParams {
|
|
801
|
+
source: SensitiveStorageSource;
|
|
802
|
+
key: string;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export interface NormalizedSensitiveReadParams extends BridgeParams {
|
|
806
|
+
source: SensitiveStorageSource;
|
|
807
|
+
key: string;
|
|
808
|
+
maxBytes: number;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
export interface SensitiveReadResult {
|
|
812
|
+
source: SensitiveStorageSource;
|
|
813
|
+
value: string;
|
|
814
|
+
exact: true;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
export type ExtractContentFormat = 'text' | 'markdown';
|
|
818
|
+
export type ExtractContentConsistency = 'best_effort' | 'settled';
|
|
819
|
+
export type ExtractContentSource = 'readability' | 'semantic-root' | 'body';
|
|
820
|
+
export type ScreenshotFormat = 'png' | 'jpeg' | 'webp';
|
|
821
|
+
export type ScreenshotDelivery = 'auto' | 'inline' | 'artifact';
|
|
822
|
+
export type ArtifactKind = 'screenshot' | 'har';
|
|
823
|
+
|
|
824
|
+
export interface ExtractContentParams {
|
|
825
|
+
format?: ExtractContentFormat;
|
|
826
|
+
selector?: string;
|
|
827
|
+
includeMetadata?: boolean;
|
|
828
|
+
consistency?: ExtractContentConsistency;
|
|
829
|
+
textBudget?: number;
|
|
830
|
+
settleTimeoutMs?: number;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
export interface NormalizedExtractContentParams extends BridgeParams {
|
|
834
|
+
format: ExtractContentFormat;
|
|
835
|
+
selector: string | null;
|
|
836
|
+
includeMetadata: boolean;
|
|
837
|
+
consistency: ExtractContentConsistency;
|
|
838
|
+
textBudget: number;
|
|
839
|
+
settleTimeoutMs: number;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export interface ScreenshotParams extends BridgeParams {
|
|
843
|
+
format?: ScreenshotFormat;
|
|
844
|
+
quality?: number;
|
|
845
|
+
delivery?: ScreenshotDelivery;
|
|
846
|
+
scale?: number;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
export interface NormalizedScreenshotParams extends BridgeParams {
|
|
850
|
+
format: ScreenshotFormat;
|
|
851
|
+
quality: number | null;
|
|
852
|
+
delivery: ScreenshotDelivery;
|
|
853
|
+
scale: number;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
export interface ArtifactDescriptor<K extends ArtifactKind = ArtifactKind> {
|
|
857
|
+
artifactId: string;
|
|
858
|
+
kind: K;
|
|
859
|
+
mimeType: string;
|
|
860
|
+
byteLength: number;
|
|
861
|
+
sha256: string;
|
|
862
|
+
chunkSize: number;
|
|
863
|
+
chunkCount: number;
|
|
864
|
+
createdAt: string;
|
|
865
|
+
expiresAt: string;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export interface ScreenshotMetadata {
|
|
869
|
+
mimeType: `image/${ScreenshotFormat}`;
|
|
870
|
+
format: ScreenshotFormat;
|
|
871
|
+
byteLength: number;
|
|
872
|
+
dimensions: { width: number; height: number };
|
|
873
|
+
rect: { x: number; y: number; width: number; height: number; scale: number };
|
|
874
|
+
complete: boolean;
|
|
875
|
+
clipped: boolean;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
export type ScreenshotResult =
|
|
879
|
+
| (ScreenshotMetadata & { delivery: 'inline'; image: string })
|
|
880
|
+
| (ScreenshotMetadata & {
|
|
881
|
+
delivery: 'artifact';
|
|
882
|
+
artifact: ArtifactDescriptor<'screenshot'>;
|
|
883
|
+
});
|
|
884
|
+
|
|
885
|
+
export interface ArtifactReadParams extends BridgeParams {
|
|
886
|
+
artifactId?: string;
|
|
887
|
+
offset?: number;
|
|
888
|
+
maxBytes?: number;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
export interface NormalizedArtifactReadParams extends BridgeParams {
|
|
892
|
+
artifactId: string;
|
|
893
|
+
offset: number;
|
|
894
|
+
maxBytes: number;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
export interface ArtifactDeleteParams extends BridgeParams {
|
|
898
|
+
artifactId?: string;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
export interface ExtractContentResult {
|
|
902
|
+
format: ExtractContentFormat;
|
|
903
|
+
content: string;
|
|
904
|
+
title?: string;
|
|
905
|
+
byline?: string;
|
|
906
|
+
excerpt?: string;
|
|
907
|
+
siteName?: string;
|
|
908
|
+
source: ExtractContentSource;
|
|
909
|
+
root?: { tag: string; selector?: string };
|
|
910
|
+
length: number;
|
|
911
|
+
truncated: boolean;
|
|
912
|
+
omitted: number;
|
|
913
|
+
settlement?: { requested: boolean; quietMs: number; timedOut: boolean };
|
|
914
|
+
}
|
|
915
|
+
|
|
518
916
|
export interface WaitForLoadStateParams {
|
|
519
917
|
waitForLoad?: boolean;
|
|
520
918
|
timeoutMs?: number;
|
|
919
|
+
url?: string;
|
|
920
|
+
urlMatch?: 'exact' | 'contains' | 'regex';
|
|
521
921
|
}
|
|
522
922
|
|
|
523
923
|
export interface NormalizedWaitForLoadStateParams extends BridgeParams {
|
|
524
924
|
waitForLoad: boolean;
|
|
525
925
|
timeoutMs: number;
|
|
926
|
+
url: string | null;
|
|
927
|
+
urlMatch: 'exact' | 'contains' | 'regex' | null;
|
|
526
928
|
}
|
|
527
929
|
|
|
528
930
|
export interface TabCreateParams {
|
|
@@ -544,25 +946,342 @@ export interface NormalizedTabCloseParams extends BridgeParams {
|
|
|
544
946
|
}
|
|
545
947
|
|
|
546
948
|
export interface AccessibilityTreeParams {
|
|
949
|
+
selector?: string;
|
|
547
950
|
maxDepth?: number;
|
|
548
951
|
maxNodes?: number;
|
|
952
|
+
compact?: boolean;
|
|
953
|
+
interactiveOnly?: boolean;
|
|
549
954
|
}
|
|
550
955
|
|
|
551
956
|
export interface NormalizedAccessibilityTreeParams extends BridgeParams {
|
|
957
|
+
selector: string | null;
|
|
552
958
|
maxDepth: number;
|
|
553
959
|
maxNodes: number;
|
|
960
|
+
compact: boolean;
|
|
961
|
+
interactiveOnly: boolean;
|
|
554
962
|
}
|
|
555
963
|
|
|
964
|
+
export interface AccessibilityTreeNode {
|
|
965
|
+
nodeId: string;
|
|
966
|
+
role: string;
|
|
967
|
+
name: string;
|
|
968
|
+
description: string;
|
|
969
|
+
value: string;
|
|
970
|
+
focused: boolean;
|
|
971
|
+
required: boolean;
|
|
972
|
+
checked: 'true' | 'false' | 'mixed' | null;
|
|
973
|
+
disabled: boolean;
|
|
974
|
+
interactive: boolean;
|
|
975
|
+
semanticInteractive: boolean;
|
|
976
|
+
focusable: boolean;
|
|
977
|
+
focusableAndEnabled: boolean;
|
|
978
|
+
ignored: boolean;
|
|
979
|
+
childIds: string[];
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
export interface AccessibilityTreeResult {
|
|
983
|
+
nodes: AccessibilityTreeNode[];
|
|
984
|
+
rootIds: string[];
|
|
985
|
+
count: number;
|
|
986
|
+
total: number;
|
|
987
|
+
rawTotal: number;
|
|
988
|
+
source: 'cdp-accessibility';
|
|
989
|
+
compact: boolean;
|
|
990
|
+
interactiveOnly: boolean;
|
|
991
|
+
truncated: boolean;
|
|
992
|
+
truncation: {
|
|
993
|
+
reason: 'maxNodes' | 'maxDepth';
|
|
994
|
+
reasons: Array<'maxNodes' | 'maxDepth'>;
|
|
995
|
+
maxNodes: number;
|
|
996
|
+
maxDepth: number;
|
|
997
|
+
omitted: number;
|
|
998
|
+
missingChildCount: number;
|
|
999
|
+
partialTopology: true;
|
|
1000
|
+
};
|
|
1001
|
+
continuationHint: string;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
export type NetworkSource = 'fetch-xhr' | 'cdp';
|
|
1005
|
+
export type NetworkCaptureAction = 'read' | 'start' | 'clear' | 'stop';
|
|
1006
|
+
|
|
556
1007
|
export interface NetworkParams {
|
|
557
1008
|
clear?: boolean;
|
|
558
1009
|
limit?: number;
|
|
559
1010
|
urlPattern?: string;
|
|
1011
|
+
source?: NetworkSource;
|
|
1012
|
+
capture?: NetworkCaptureAction;
|
|
560
1013
|
}
|
|
561
1014
|
|
|
562
1015
|
export interface NormalizedNetworkParams extends BridgeParams {
|
|
563
1016
|
clear: boolean;
|
|
564
1017
|
limit: number;
|
|
565
1018
|
urlPattern: string | null;
|
|
1019
|
+
source: NetworkSource;
|
|
1020
|
+
capture: NetworkCaptureAction;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
export interface CdpNetworkEntry {
|
|
1024
|
+
requestId: string;
|
|
1025
|
+
url: string;
|
|
1026
|
+
method: string;
|
|
1027
|
+
resourceType: string;
|
|
1028
|
+
status: number;
|
|
1029
|
+
mimeType: string;
|
|
1030
|
+
protocol: string;
|
|
1031
|
+
fromCache: boolean;
|
|
1032
|
+
fromDiskCache: boolean;
|
|
1033
|
+
fromServiceWorker: boolean;
|
|
1034
|
+
fromPrefetchCache: boolean;
|
|
1035
|
+
redirect: {
|
|
1036
|
+
count: number;
|
|
1037
|
+
hops: Array<{ url: string; status: number }>;
|
|
1038
|
+
truncated: boolean;
|
|
1039
|
+
};
|
|
1040
|
+
failureReason: string;
|
|
1041
|
+
duration: number;
|
|
1042
|
+
timestamp: number;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
export interface NetworkResult {
|
|
1046
|
+
entries: Array<CdpNetworkEntry | Record<string, unknown>>;
|
|
1047
|
+
count: number;
|
|
1048
|
+
total: number;
|
|
1049
|
+
filteredTotal: number;
|
|
1050
|
+
dropped: number;
|
|
1051
|
+
abandoned: number;
|
|
1052
|
+
source: NetworkSource;
|
|
1053
|
+
capture: NetworkCaptureAction | null;
|
|
1054
|
+
armed: boolean;
|
|
1055
|
+
armedDuringCapture: boolean;
|
|
1056
|
+
captureState: 'armed' | 'stop_failed' | 'stopped' | 'instrumented';
|
|
1057
|
+
ownershipHeld: boolean;
|
|
1058
|
+
startedAt: number | null;
|
|
1059
|
+
inflight: number;
|
|
1060
|
+
truncated: boolean;
|
|
1061
|
+
truncation: { reason: 'limit' | null; limit: number; omitted: number };
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
export interface CdpPerformanceMetric {
|
|
1065
|
+
name: string;
|
|
1066
|
+
value: number;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
export interface PerformanceMeasurement {
|
|
1070
|
+
source: 'cdp.Performance.getMetrics';
|
|
1071
|
+
kind: 'raw_cdp_counters';
|
|
1072
|
+
sampledAt: string;
|
|
1073
|
+
timeDomain: 'timeTicks';
|
|
1074
|
+
observation: 'browser_maintained_point_sample';
|
|
1075
|
+
webVitals: 'not_measured';
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
export interface PerformanceMetricsResult {
|
|
1079
|
+
metrics: Record<string, number>;
|
|
1080
|
+
measurement: PerformanceMeasurement;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
export type HarDelivery = 'auto' | 'inline' | 'artifact';
|
|
1084
|
+
export type HarCaptureState = NetworkResult['captureState'];
|
|
1085
|
+
|
|
1086
|
+
export interface HarExportParams {
|
|
1087
|
+
limit?: number;
|
|
1088
|
+
urlPattern?: string;
|
|
1089
|
+
delivery?: HarDelivery;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
export interface NormalizedHarExportParams extends BridgeParams {
|
|
1093
|
+
limit: number;
|
|
1094
|
+
urlPattern: string | null;
|
|
1095
|
+
delivery: HarDelivery;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
export interface HarEvidenceEntry extends Record<string, unknown> {
|
|
1099
|
+
url: string;
|
|
1100
|
+
method: string;
|
|
1101
|
+
resourceType: string;
|
|
1102
|
+
status: number;
|
|
1103
|
+
mimeType: string;
|
|
1104
|
+
protocol: string;
|
|
1105
|
+
fromCache: boolean;
|
|
1106
|
+
fromDiskCache: boolean;
|
|
1107
|
+
fromServiceWorker: boolean;
|
|
1108
|
+
fromPrefetchCache: boolean;
|
|
1109
|
+
failureReason: string;
|
|
1110
|
+
redirectURL: string;
|
|
1111
|
+
duration: number;
|
|
1112
|
+
startedAt: number;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
export interface HarNameValue extends Record<string, unknown> {
|
|
1116
|
+
name: string;
|
|
1117
|
+
value: string;
|
|
1118
|
+
comment?: string;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
export interface HarCookie extends HarNameValue {
|
|
1122
|
+
path?: string;
|
|
1123
|
+
domain?: string;
|
|
1124
|
+
expires?: string;
|
|
1125
|
+
httpOnly?: boolean;
|
|
1126
|
+
secure?: boolean;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
export interface HarPostDataParam extends HarNameValue {
|
|
1130
|
+
fileName?: string;
|
|
1131
|
+
contentType?: string;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
export interface HarPostData extends Record<string, unknown> {
|
|
1135
|
+
mimeType: string;
|
|
1136
|
+
params?: HarPostDataParam[];
|
|
1137
|
+
text?: string;
|
|
1138
|
+
comment?: string;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
export interface HarRequest extends Record<string, unknown> {
|
|
1142
|
+
method: string;
|
|
1143
|
+
url: string;
|
|
1144
|
+
httpVersion: string;
|
|
1145
|
+
cookies: HarCookie[];
|
|
1146
|
+
headers: HarNameValue[];
|
|
1147
|
+
queryString: HarNameValue[];
|
|
1148
|
+
postData?: HarPostData;
|
|
1149
|
+
headersSize: number;
|
|
1150
|
+
bodySize: number;
|
|
1151
|
+
comment?: string;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
export interface HarContent extends Record<string, unknown> {
|
|
1155
|
+
size: number;
|
|
1156
|
+
compression?: number;
|
|
1157
|
+
mimeType: string;
|
|
1158
|
+
text?: string;
|
|
1159
|
+
encoding?: string;
|
|
1160
|
+
comment?: string;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
export interface HarResponse extends Record<string, unknown> {
|
|
1164
|
+
status: number;
|
|
1165
|
+
statusText: string;
|
|
1166
|
+
httpVersion: string;
|
|
1167
|
+
cookies: HarCookie[];
|
|
1168
|
+
headers: HarNameValue[];
|
|
1169
|
+
content: HarContent;
|
|
1170
|
+
redirectURL: string;
|
|
1171
|
+
headersSize: number;
|
|
1172
|
+
bodySize: number;
|
|
1173
|
+
comment?: string;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
export interface HarCacheInfo extends Record<string, unknown> {
|
|
1177
|
+
expires?: string;
|
|
1178
|
+
lastAccess: string;
|
|
1179
|
+
eTag: string;
|
|
1180
|
+
hitCount: number;
|
|
1181
|
+
comment?: string;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
export interface HarCache extends Record<string, unknown> {
|
|
1185
|
+
beforeRequest?: HarCacheInfo;
|
|
1186
|
+
afterRequest?: HarCacheInfo;
|
|
1187
|
+
comment?: string;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
export interface HarTimings extends Record<string, unknown> {
|
|
1191
|
+
blocked?: number;
|
|
1192
|
+
dns?: number;
|
|
1193
|
+
connect?: number;
|
|
1194
|
+
send: number;
|
|
1195
|
+
wait: number;
|
|
1196
|
+
receive: number;
|
|
1197
|
+
ssl?: number;
|
|
1198
|
+
comment?: string;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
export interface HarPageTimings extends Record<string, unknown> {
|
|
1202
|
+
onContentLoad?: number;
|
|
1203
|
+
onLoad?: number;
|
|
1204
|
+
comment?: string;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
export interface HarPage extends Record<string, unknown> {
|
|
1208
|
+
startedDateTime: string;
|
|
1209
|
+
id: string;
|
|
1210
|
+
title: string;
|
|
1211
|
+
pageTimings: HarPageTimings;
|
|
1212
|
+
comment?: string;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
export interface HarCreator extends Record<string, unknown> {
|
|
1216
|
+
name: string;
|
|
1217
|
+
version: string;
|
|
1218
|
+
comment?: string;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
export interface HarEntry extends Record<string, unknown> {
|
|
1222
|
+
pageref?: string;
|
|
1223
|
+
startedDateTime: string;
|
|
1224
|
+
time: number;
|
|
1225
|
+
request: HarRequest;
|
|
1226
|
+
response: HarResponse;
|
|
1227
|
+
cache: HarCache;
|
|
1228
|
+
timings: HarTimings;
|
|
1229
|
+
serverIPAddress?: string;
|
|
1230
|
+
connection?: string;
|
|
1231
|
+
comment?: string;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
export interface HarLog extends Record<string, unknown> {
|
|
1235
|
+
version: '1.2';
|
|
1236
|
+
creator: HarCreator;
|
|
1237
|
+
browser?: HarCreator;
|
|
1238
|
+
pages?: HarPage[];
|
|
1239
|
+
entries: HarEntry[];
|
|
1240
|
+
comment?: string;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
export interface HarDocument extends Record<string, unknown> {
|
|
1244
|
+
log: HarLog;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
export interface HarExportTruncation {
|
|
1248
|
+
reason: 'limit' | 'inline_bytes' | null;
|
|
1249
|
+
limit: number;
|
|
1250
|
+
omitted: number;
|
|
1251
|
+
omittedByLimit: number;
|
|
1252
|
+
omittedBySize: number;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
export interface HarExportMetadata {
|
|
1256
|
+
format: 'har';
|
|
1257
|
+
harVersion: '1.2';
|
|
1258
|
+
mimeType: 'application/json';
|
|
1259
|
+
byteLength: number;
|
|
1260
|
+
entryCount: number;
|
|
1261
|
+
totalEntries: number;
|
|
1262
|
+
dropped: number;
|
|
1263
|
+
abandoned: number;
|
|
1264
|
+
inflight: number;
|
|
1265
|
+
startedAt: number | null;
|
|
1266
|
+
captureState: HarCaptureState;
|
|
1267
|
+
truncated: boolean;
|
|
1268
|
+
truncation: HarExportTruncation;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
export type HarExportResult =
|
|
1272
|
+
| (HarExportMetadata & { delivery: 'inline'; har: HarDocument })
|
|
1273
|
+
| (HarExportMetadata & {
|
|
1274
|
+
delivery: 'artifact';
|
|
1275
|
+
artifact: ArtifactDescriptor<'har'>;
|
|
1276
|
+
});
|
|
1277
|
+
|
|
1278
|
+
export interface HarExportEvidence {
|
|
1279
|
+
delivery: HarExportResult['delivery'];
|
|
1280
|
+
entryCount: number;
|
|
1281
|
+
totalEntries: number;
|
|
1282
|
+
dropped: number;
|
|
1283
|
+
abandoned: number;
|
|
1284
|
+
inflight: number;
|
|
566
1285
|
}
|
|
567
1286
|
|
|
568
1287
|
export type NetworkInterceptAction = 'fulfill' | 'continue' | 'block';
|