omowright 0.3.3 → 0.3.5
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/dist/bsk/dom-reads.d.ts +31 -0
- package/dist/bsk/first-navigate.d.ts +14 -0
- package/dist/bsk/protocol/params.generated.d.ts +1511 -0
- package/dist/bsk/screenshot.d.ts +6 -8
- package/dist/bsk/session.d.ts +47 -28
- package/dist/bsk/shared-tab.d.ts +22 -0
- package/dist/bsk/snapshot.d.ts +3 -4
- package/dist/bsk/targets.d.ts +8 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +241 -127
- package/dist/redact-value.d.ts +4 -1
- package/package.json +2 -2
- package/skills/omowright/references/browserskill.md +69 -14
- package/skills/omowright/references/frames-layers-human.md +17 -10
|
@@ -0,0 +1,1511 @@
|
|
|
1
|
+
/** Caller-supplied facts checked immediately before starting an action. */
|
|
2
|
+
export type ActionExpectation = {
|
|
3
|
+
/** Required only for field=attribute, measured in Unicode code points. */
|
|
4
|
+
readonly attribute?: string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* text/value require a string; checked/exists require a boolean;
|
|
7
|
+
* attribute accepts a string or null for absence. Text is exact textContent.
|
|
8
|
+
*/
|
|
9
|
+
readonly equals: ExpectedValue;
|
|
10
|
+
readonly field: ExpectationField;
|
|
11
|
+
/** Observed ref or main-document CSS selector, measured in Unicode code points. */
|
|
12
|
+
readonly target: string;
|
|
13
|
+
};
|
|
14
|
+
/** Display identity of the agent controlling a session. Never an authorization claim. */
|
|
15
|
+
export type ControllerInfo = {
|
|
16
|
+
/** Optional six-digit hex color. Omitted colors are derived from the session ID. */
|
|
17
|
+
readonly color?: string | null | undefined;
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly project?: string | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type ControlPolicy = "strict" | "target" | "auto";
|
|
22
|
+
export type CooperateAction = "enable" | "status" | "sync" | "wait";
|
|
23
|
+
export type DebugAction = "performance" | "aggregate" | "duplicates" | "capabilities" | "activity" | "wait" | "pin" | "unpin" | "start" | "stop" | "status" | "requests" | "request" | "operations" | "operation" | "console" | "pages" | "export" | "rules" | "rule_add" | "rule_enable" | "rule_disable" | "rule_remove" | "replay";
|
|
24
|
+
export type DebugJsonEdit = {
|
|
25
|
+
readonly remove?: readonly string[] | null | undefined;
|
|
26
|
+
readonly rename?: Record<string, string> | null | undefined;
|
|
27
|
+
readonly set?: Record<string, unknown> | null | undefined;
|
|
28
|
+
};
|
|
29
|
+
export type DebugReplaySpec = {
|
|
30
|
+
readonly body?: string | null | undefined;
|
|
31
|
+
readonly headers?: Record<string, string | null> | null | undefined;
|
|
32
|
+
readonly key: string;
|
|
33
|
+
readonly method?: string | null | undefined;
|
|
34
|
+
readonly url?: string | null | undefined;
|
|
35
|
+
};
|
|
36
|
+
export type DebugRuleEffect = {
|
|
37
|
+
readonly type: "block";
|
|
38
|
+
} | {
|
|
39
|
+
readonly body?: string | null | undefined;
|
|
40
|
+
readonly headers?: Record<string, string | null> | null | undefined;
|
|
41
|
+
readonly json?: DebugJsonEdit | null | undefined;
|
|
42
|
+
readonly method?: string | null | undefined;
|
|
43
|
+
readonly type: "modify";
|
|
44
|
+
readonly url?: string | null | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
readonly body: string;
|
|
47
|
+
readonly delay_ms?: number | null | undefined;
|
|
48
|
+
readonly headers?: Record<string, string> | null | undefined;
|
|
49
|
+
readonly status: number;
|
|
50
|
+
readonly type: "mock";
|
|
51
|
+
};
|
|
52
|
+
export type DebugRuleMatch = {
|
|
53
|
+
readonly method?: string | null | undefined;
|
|
54
|
+
readonly resource_type?: string | null | undefined;
|
|
55
|
+
readonly url: string;
|
|
56
|
+
};
|
|
57
|
+
export type DebugRuleSpec = {
|
|
58
|
+
readonly effect: DebugRuleEffect;
|
|
59
|
+
readonly match: DebugRuleMatch;
|
|
60
|
+
readonly name?: string | null | undefined;
|
|
61
|
+
readonly times?: number | null | undefined;
|
|
62
|
+
};
|
|
63
|
+
export type DomRead = "text" | "attribute" | "value" | "checked" | "exists";
|
|
64
|
+
export type DragMode = "press-move-release" | "click-move-click";
|
|
65
|
+
export type DragPoint = {
|
|
66
|
+
readonly x: number;
|
|
67
|
+
readonly y: number;
|
|
68
|
+
};
|
|
69
|
+
export type DragTarget = {
|
|
70
|
+
/** Offset from the visible action point, in top-level viewport CSS pixels. */
|
|
71
|
+
readonly offset?: DragPoint | null | undefined;
|
|
72
|
+
readonly ref?: string | null | undefined;
|
|
73
|
+
readonly selector?: string | null | undefined;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Which state the caller is waiting for.
|
|
77
|
+
*
|
|
78
|
+
* `Visible` / `Hidden` ask about **visibility**; `Attached` /
|
|
79
|
+
* `Detached` ask about **presence in the DOM**.
|
|
80
|
+
*
|
|
81
|
+
* `Hidden` is the opposite of `Visible`: absent or attached but not visible,
|
|
82
|
+
* including an element absent at the first probe. `Detached` requires absence.
|
|
83
|
+
* The result's `attached` field distinguishes removal from a hidden node.
|
|
84
|
+
* Invalid refs and inspection failures remain errors for every state.
|
|
85
|
+
*/
|
|
86
|
+
export type ElementState = "visible" | "hidden" | "attached" | "detached";
|
|
87
|
+
/**
|
|
88
|
+
* Concrete emulation overrides for one tab. Field presence drives the
|
|
89
|
+
* extension: only the overrides whose fields are set are touched, so a
|
|
90
|
+
* call may change just the UA, just the viewport, or any combination.
|
|
91
|
+
*/
|
|
92
|
+
export type EmulateOverrides = {
|
|
93
|
+
/** `Accept-Language` header override. Requires `user_agent`. */
|
|
94
|
+
readonly accept_language?: string | null | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Device scale factor (device pixel ratio). Only meaningful with
|
|
97
|
+
* `width`/`height`; the extension maps `None` to CDP's `0`
|
|
98
|
+
* ("use the display's native factor").
|
|
99
|
+
*/
|
|
100
|
+
readonly device_scale_factor?: number | null | undefined;
|
|
101
|
+
/** Viewport height in CSS pixels. Requires `width`. */
|
|
102
|
+
readonly height?: number | null | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Touch points reported while touch emulation is on (CDP defaults
|
|
105
|
+
* to 1 when omitted).
|
|
106
|
+
*/
|
|
107
|
+
readonly max_touch_points?: number | null | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Emulate a mobile viewport (meta-viewport handling, overlay
|
|
110
|
+
* scrollbars). Only meaningful with `width`/`height`.
|
|
111
|
+
*/
|
|
112
|
+
readonly mobile?: boolean | null | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Enable/disable touch emulation
|
|
115
|
+
* (`Emulation.setTouchEmulationEnabled`). When omitted while
|
|
116
|
+
* `max_touch_points` is set, touch is enabled.
|
|
117
|
+
*/
|
|
118
|
+
readonly touch?: boolean | null | undefined;
|
|
119
|
+
/** UA string for `Emulation.setUserAgentOverride`. */
|
|
120
|
+
readonly user_agent?: string | null | undefined;
|
|
121
|
+
/** UA client-hints metadata. Requires `user_agent`. */
|
|
122
|
+
readonly user_agent_metadata?: UserAgentMetadata | null | undefined;
|
|
123
|
+
/** Viewport width in CSS pixels. Requires `height`. */
|
|
124
|
+
readonly width?: number | null | undefined;
|
|
125
|
+
};
|
|
126
|
+
export type ExpectationField = "text" | "value" | "checked" | "attribute" | "exists";
|
|
127
|
+
export type ExpectedValue = string | boolean | null;
|
|
128
|
+
export type ExtractAction = "discover" | "table" | "list";
|
|
129
|
+
export type ExtractField = {
|
|
130
|
+
readonly attribute?: string | null | undefined;
|
|
131
|
+
readonly key: string;
|
|
132
|
+
readonly name?: string | null | undefined;
|
|
133
|
+
readonly read: ExtractRead;
|
|
134
|
+
readonly selector: string;
|
|
135
|
+
};
|
|
136
|
+
export type ExtractRead = "text" | "href" | "attribute";
|
|
137
|
+
export type HelpCompletionCondition = {
|
|
138
|
+
readonly selector_exists?: string | null | undefined;
|
|
139
|
+
readonly selector_missing?: string | null | undefined;
|
|
140
|
+
readonly text_exists?: string | null | undefined;
|
|
141
|
+
readonly text_missing?: string | null | undefined;
|
|
142
|
+
readonly url_contains?: string | null | undefined;
|
|
143
|
+
/** RE2-compatible URL regex (maximum 128 characters). Backtracking-only syntax is rejected. */
|
|
144
|
+
readonly url_matches?: string | null | undefined;
|
|
145
|
+
};
|
|
146
|
+
export type HelpCompletionCriteria = {
|
|
147
|
+
readonly all?: readonly HelpCompletionCondition[] | null | undefined;
|
|
148
|
+
readonly any?: readonly HelpCompletionCondition[] | null | undefined;
|
|
149
|
+
readonly stable_for_ms?: number | null | undefined;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* One component the user is asked to look at / interact with. Exactly
|
|
153
|
+
* one of `ref` / `selector` should be supplied (mirrors the
|
|
154
|
+
* click/fill convention). When neither matches a live element the
|
|
155
|
+
* overlay still shows the prompt and reports the miss via
|
|
156
|
+
* [`ResolvedTarget`].
|
|
157
|
+
*/
|
|
158
|
+
export type HelpTarget = {
|
|
159
|
+
readonly ref?: string | null | undefined;
|
|
160
|
+
readonly selector?: string | null | undefined;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Keyboard modifier flags. Multiple flags may be combined; the
|
|
164
|
+
* extension folds them into CDP's bitfield (`alt=1, ctrl=2, meta=4,
|
|
165
|
+
* shift=8`).
|
|
166
|
+
*/
|
|
167
|
+
export type KeyModifier = "alt" | "ctrl" | "meta" | "shift";
|
|
168
|
+
/** Mouse button selector for `tool.click`. */
|
|
169
|
+
export type MouseButton = "left" | "middle" | "right";
|
|
170
|
+
export type ReadField = {
|
|
171
|
+
readonly attribute?: string | null | undefined;
|
|
172
|
+
readonly key: string;
|
|
173
|
+
readonly read: DomRead;
|
|
174
|
+
/** Relative selector matching at most one descendant; omitted means the item itself. */
|
|
175
|
+
readonly selector?: string | null | undefined;
|
|
176
|
+
};
|
|
177
|
+
export type ScreenshotScope = "follow" | "current";
|
|
178
|
+
/**
|
|
179
|
+
* View scope for [`TabListParams`] (§6 sandbox table).
|
|
180
|
+
*
|
|
181
|
+
* * `User` — tabs that live in any window other than an Agent Window.
|
|
182
|
+
* * `Agent` — tabs in the requesting session's Agent Window only.
|
|
183
|
+
* * `All` — both of the above; never reveals other sessions' Agent
|
|
184
|
+
* Windows (cross-session isolation per §6).
|
|
185
|
+
*/
|
|
186
|
+
export type TabScope = "user" | "agent" | "all";
|
|
187
|
+
export type UploadFile = {
|
|
188
|
+
readonly name: string;
|
|
189
|
+
readonly staged_path?: string | null | undefined;
|
|
190
|
+
readonly transfer_id: string;
|
|
191
|
+
};
|
|
192
|
+
export type UploadMode = "input" | "drop";
|
|
193
|
+
/** One entry of CDP `Emulation.UserAgentBrandVersion` (UA client hints). */
|
|
194
|
+
export type UserAgentBrandVersion = {
|
|
195
|
+
readonly brand: string;
|
|
196
|
+
readonly version: string;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Mirror of CDP `Emulation.UserAgentMetadata`; every field is optional
|
|
200
|
+
* and only sent when present.
|
|
201
|
+
*/
|
|
202
|
+
export type UserAgentMetadata = {
|
|
203
|
+
readonly architecture?: string | null | undefined;
|
|
204
|
+
readonly brands?: readonly UserAgentBrandVersion[] | null | undefined;
|
|
205
|
+
readonly full_version?: string | null | undefined;
|
|
206
|
+
readonly mobile?: boolean | null | undefined;
|
|
207
|
+
readonly model?: string | null | undefined;
|
|
208
|
+
readonly platform?: string | null | undefined;
|
|
209
|
+
readonly platform_version?: string | null | undefined;
|
|
210
|
+
};
|
|
211
|
+
export type VideoQuality = "standard" | "clear";
|
|
212
|
+
/**
|
|
213
|
+
* Page-lifecycle checkpoint a navigation should wait on.
|
|
214
|
+
*
|
|
215
|
+
* Mapping to CDP `Page.lifecycleEvent` names:
|
|
216
|
+
* * `Load` → `load`
|
|
217
|
+
* * `DomContentLoaded` → `DOMContentLoaded`
|
|
218
|
+
* * `NetworkIdle` → `networkIdle`
|
|
219
|
+
* * `Commit` → `commit` (earliest event after the navigation actually
|
|
220
|
+
* commits to a new document)
|
|
221
|
+
*/
|
|
222
|
+
export type WaitUntil = "load" | "domcontentloaded" | "networkidle" | "commit";
|
|
223
|
+
export type ToolBlurParams = {
|
|
224
|
+
/**
|
|
225
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
226
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
227
|
+
*/
|
|
228
|
+
readonly context_id?: string | undefined;
|
|
229
|
+
/**
|
|
230
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
231
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
232
|
+
*/
|
|
233
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
236
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
237
|
+
*/
|
|
238
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
241
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
242
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
243
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
244
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
245
|
+
*/
|
|
246
|
+
readonly observation_id?: string | null | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* Optional `@e<N>` ref allocated by the last observation.
|
|
249
|
+
* Mutually exclusive with `selector`.
|
|
250
|
+
*/
|
|
251
|
+
readonly ref?: string | null | undefined;
|
|
252
|
+
readonly selector?: string | null | undefined;
|
|
253
|
+
readonly session_id: string;
|
|
254
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
255
|
+
readonly tab_id?: number | null | undefined;
|
|
256
|
+
readonly timeout_ms?: number | null | undefined;
|
|
257
|
+
};
|
|
258
|
+
export type ToolClickParams = {
|
|
259
|
+
readonly button?: MouseButton | null | undefined;
|
|
260
|
+
/** Single-use capture returned by a visual-ref screenshot; requires image coordinates. */
|
|
261
|
+
readonly capture_id?: string | null | undefined;
|
|
262
|
+
/** Number of consecutive mouse presses (double-click = 2). */
|
|
263
|
+
readonly click_count?: number | null | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
266
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
267
|
+
*/
|
|
268
|
+
readonly context_id?: string | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
271
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
272
|
+
*/
|
|
273
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
274
|
+
/**
|
|
275
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
276
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
277
|
+
*/
|
|
278
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
279
|
+
readonly image_x?: number | null | undefined;
|
|
280
|
+
readonly image_y?: number | null | undefined;
|
|
281
|
+
readonly modifiers?: readonly KeyModifier[] | null | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
284
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
285
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
286
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
287
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
288
|
+
*/
|
|
289
|
+
readonly observation_id?: string | null | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* Optional `@e<N>` ref allocated by the last `tool.snapshot`.
|
|
292
|
+
* Mutually exclusive with `selector` (caller must supply exactly
|
|
293
|
+
* one). Accepts both `"e3"` and `"@e3"`.
|
|
294
|
+
*/
|
|
295
|
+
readonly ref?: string | null | undefined;
|
|
296
|
+
readonly selector?: string | null | undefined;
|
|
297
|
+
readonly session_id: string;
|
|
298
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
299
|
+
readonly tab_id?: number | null | undefined;
|
|
300
|
+
readonly timeout_ms?: number | null | undefined;
|
|
301
|
+
};
|
|
302
|
+
export type ToolConsoleParams = {
|
|
303
|
+
/** Include structured stack frames. Defaults to false. */
|
|
304
|
+
readonly include_stack?: boolean | null | undefined;
|
|
305
|
+
/** Maximum number of entries to return. Extension applies safe defaults and caps. */
|
|
306
|
+
readonly limit?: number | null | undefined;
|
|
307
|
+
/** Maximum characters returned per entry text. Extension applies safe defaults and caps. */
|
|
308
|
+
readonly max_text_chars?: number | null | undefined;
|
|
309
|
+
readonly session_id: string;
|
|
310
|
+
/** Return entries with sequence strictly greater than this cursor. */
|
|
311
|
+
readonly since?: number | null | undefined;
|
|
312
|
+
/** Optional target tab. Defaults to the Agent Window's currently active tab. */
|
|
313
|
+
readonly tab_id?: number | null | undefined;
|
|
314
|
+
};
|
|
315
|
+
export type ToolCooperateParams = {
|
|
316
|
+
readonly action: CooperateAction;
|
|
317
|
+
/** Omitted by legacy callers. A negotiated policy remains fixed for the session. */
|
|
318
|
+
readonly control_policy?: ControlPolicy | null | undefined;
|
|
319
|
+
readonly max_tokens?: number | null | undefined;
|
|
320
|
+
readonly session_id: string;
|
|
321
|
+
readonly tab_id?: number | null | undefined;
|
|
322
|
+
readonly timeout_ms?: number | null | undefined;
|
|
323
|
+
};
|
|
324
|
+
export type ToolDebugParams = {
|
|
325
|
+
readonly action: DebugAction;
|
|
326
|
+
readonly budget?: number | null | undefined;
|
|
327
|
+
readonly command_id?: string | null | undefined;
|
|
328
|
+
/**
|
|
329
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
330
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
331
|
+
*/
|
|
332
|
+
readonly context_id?: string | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
335
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
336
|
+
*/
|
|
337
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
338
|
+
/**
|
|
339
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
340
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
341
|
+
*/
|
|
342
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
343
|
+
readonly fields?: readonly string[] | null | undefined;
|
|
344
|
+
readonly id?: string | null | undefined;
|
|
345
|
+
readonly include_controlled?: boolean | null | undefined;
|
|
346
|
+
readonly kind?: string | null | undefined;
|
|
347
|
+
readonly limit?: number | null | undefined;
|
|
348
|
+
readonly max_chars?: number | null | undefined;
|
|
349
|
+
readonly method?: string | null | undefined;
|
|
350
|
+
readonly name?: string | null | undefined;
|
|
351
|
+
/**
|
|
352
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
353
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
354
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
355
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
356
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
357
|
+
*/
|
|
358
|
+
readonly observation_id?: string | null | undefined;
|
|
359
|
+
readonly offset?: number | null | undefined;
|
|
360
|
+
readonly part?: string | null | undefined;
|
|
361
|
+
readonly pointer?: string | null | undefined;
|
|
362
|
+
readonly replay?: DebugReplaySpec | null | undefined;
|
|
363
|
+
readonly resource_type?: string | null | undefined;
|
|
364
|
+
readonly rule?: DebugRuleSpec | null | undefined;
|
|
365
|
+
readonly run_id?: string | null | undefined;
|
|
366
|
+
readonly session_id: string;
|
|
367
|
+
readonly since?: number | null | undefined;
|
|
368
|
+
readonly slow_ms?: number | null | undefined;
|
|
369
|
+
readonly state?: string | null | undefined;
|
|
370
|
+
readonly status?: number | null | undefined;
|
|
371
|
+
readonly tab_id?: number | null | undefined;
|
|
372
|
+
readonly url?: string | null | undefined;
|
|
373
|
+
readonly wait_ms?: number | null | undefined;
|
|
374
|
+
readonly window_ms?: number | null | undefined;
|
|
375
|
+
};
|
|
376
|
+
export type ToolDialogAcceptParams = {
|
|
377
|
+
readonly dialog_id: string;
|
|
378
|
+
readonly session_id: string;
|
|
379
|
+
readonly text?: string | null | undefined;
|
|
380
|
+
};
|
|
381
|
+
export type ToolDialogDismissParams = {
|
|
382
|
+
readonly dialog_id: string;
|
|
383
|
+
readonly session_id: string;
|
|
384
|
+
readonly text?: string | null | undefined;
|
|
385
|
+
};
|
|
386
|
+
export type ToolDialogHandleParams = {
|
|
387
|
+
readonly dialog_id: string;
|
|
388
|
+
readonly session_id: string;
|
|
389
|
+
readonly text?: string | null | undefined;
|
|
390
|
+
};
|
|
391
|
+
export type ToolDialogStatusParams = {
|
|
392
|
+
readonly session_id: string;
|
|
393
|
+
readonly tab_id?: number | null | undefined;
|
|
394
|
+
};
|
|
395
|
+
export type ToolDownloadParams = {
|
|
396
|
+
/** Daemon-injected relative directory beneath Chrome's Downloads root. */
|
|
397
|
+
readonly browser_relative_dir?: string | null | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
400
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
401
|
+
*/
|
|
402
|
+
readonly context_id?: string | undefined;
|
|
403
|
+
/**
|
|
404
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
405
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
406
|
+
*/
|
|
407
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
408
|
+
/**
|
|
409
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
410
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
411
|
+
*/
|
|
412
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
413
|
+
/**
|
|
414
|
+
* Daemon-injected authoritative transfer size limit. The extension uses
|
|
415
|
+
* it only for early cancellation; daemon import remains the final check.
|
|
416
|
+
*/
|
|
417
|
+
readonly max_byte_size?: number | null | undefined;
|
|
418
|
+
/**
|
|
419
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
420
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
421
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
422
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
423
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
424
|
+
*/
|
|
425
|
+
readonly observation_id?: string | null | undefined;
|
|
426
|
+
readonly ref?: string | null | undefined;
|
|
427
|
+
readonly selector?: string | null | undefined;
|
|
428
|
+
readonly session_id: string;
|
|
429
|
+
readonly tab_id?: number | null | undefined;
|
|
430
|
+
readonly timeout_ms?: number | null | undefined;
|
|
431
|
+
};
|
|
432
|
+
export type ToolDragParams = {
|
|
433
|
+
readonly button?: MouseButton | null | undefined;
|
|
434
|
+
/**
|
|
435
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
436
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
437
|
+
*/
|
|
438
|
+
readonly context_id?: string | undefined;
|
|
439
|
+
readonly delta?: DragPoint | null | undefined;
|
|
440
|
+
/**
|
|
441
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
442
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
443
|
+
*/
|
|
444
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
445
|
+
/** Travel duration, excluding hold. Defaults to 500 ms. */
|
|
446
|
+
readonly duration_ms?: number | null | undefined;
|
|
447
|
+
/**
|
|
448
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
449
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
450
|
+
*/
|
|
451
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
452
|
+
/** Delay after pressing and before moving. Defaults to zero. */
|
|
453
|
+
readonly hold_ms?: number | null | undefined;
|
|
454
|
+
/** Defaults to press-move-release. Click-move-click requires target and zero hold. */
|
|
455
|
+
readonly mode?: DragMode | null | undefined;
|
|
456
|
+
readonly modifiers?: readonly KeyModifier[] | null | undefined;
|
|
457
|
+
/**
|
|
458
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
459
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
460
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
461
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
462
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
463
|
+
*/
|
|
464
|
+
readonly observation_id?: string | null | undefined;
|
|
465
|
+
readonly session_id: string;
|
|
466
|
+
readonly source: DragTarget;
|
|
467
|
+
readonly tab_id?: number | null | undefined;
|
|
468
|
+
/** Exactly one of target or delta is required. */
|
|
469
|
+
readonly target?: DragTarget | null | undefined;
|
|
470
|
+
readonly timeout_ms?: number | null | undefined;
|
|
471
|
+
};
|
|
472
|
+
export type ToolEmulateParams = {
|
|
473
|
+
/**
|
|
474
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
475
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
476
|
+
*/
|
|
477
|
+
readonly context_id?: string | undefined;
|
|
478
|
+
/**
|
|
479
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
480
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
481
|
+
*/
|
|
482
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
483
|
+
/**
|
|
484
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
485
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
486
|
+
*/
|
|
487
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
488
|
+
/**
|
|
489
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
490
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
491
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
492
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
493
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
494
|
+
*/
|
|
495
|
+
readonly observation_id?: string | null | undefined;
|
|
496
|
+
/**
|
|
497
|
+
* Clear every emulation override on the tab and restore its real
|
|
498
|
+
* environment. Mutually exclusive with `overrides`.
|
|
499
|
+
*/
|
|
500
|
+
readonly off?: boolean | null | undefined;
|
|
501
|
+
/** Overrides to apply. Required unless `off` is set. */
|
|
502
|
+
readonly overrides?: EmulateOverrides | null | undefined;
|
|
503
|
+
readonly session_id: string;
|
|
504
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
505
|
+
readonly tab_id?: number | null | undefined;
|
|
506
|
+
};
|
|
507
|
+
export type ToolEvaluateParams = {
|
|
508
|
+
/**
|
|
509
|
+
* Await the expression when it resolves to a Promise (CDP
|
|
510
|
+
* `Runtime.evaluate(awaitPromise=...)`). Defaults to `true`.
|
|
511
|
+
*/
|
|
512
|
+
readonly await_promise?: boolean | null | undefined;
|
|
513
|
+
/**
|
|
514
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
515
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
516
|
+
*/
|
|
517
|
+
readonly context_id?: string | undefined;
|
|
518
|
+
/**
|
|
519
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
520
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
521
|
+
*/
|
|
522
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
523
|
+
/**
|
|
524
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
525
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
526
|
+
*/
|
|
527
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
528
|
+
readonly expression: string;
|
|
529
|
+
/**
|
|
530
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
531
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
532
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
533
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
534
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
535
|
+
*/
|
|
536
|
+
readonly observation_id?: string | null | undefined;
|
|
537
|
+
/**
|
|
538
|
+
* Ask CDP to serialise the result by value (vs. returning a
|
|
539
|
+
* `RemoteObject` id we cannot use). Defaults to `true`.
|
|
540
|
+
*/
|
|
541
|
+
readonly return_by_value?: boolean | null | undefined;
|
|
542
|
+
readonly session_id: string;
|
|
543
|
+
/** Target tab. Defaults to the Agent Window's currently active tab. */
|
|
544
|
+
readonly tab_id?: number | null | undefined;
|
|
545
|
+
/** Hard upper bound on the evaluation. Defaults to 30s. */
|
|
546
|
+
readonly timeout_ms?: number | null | undefined;
|
|
547
|
+
/**
|
|
548
|
+
* Run without comparing the page with any observation. Control authority,
|
|
549
|
+
* document identity and tab ownership are still enforced. Cannot be
|
|
550
|
+
* combined with `expect`, `depends_on` or `observation_id`. Prefer stating
|
|
551
|
+
* what the script relies on; use this only when that cannot be stated.
|
|
552
|
+
*/
|
|
553
|
+
readonly unverified?: boolean | null | undefined;
|
|
554
|
+
};
|
|
555
|
+
export type ToolExtractParams = {
|
|
556
|
+
readonly action: ExtractAction;
|
|
557
|
+
readonly fields?: readonly ExtractField[] | null | undefined;
|
|
558
|
+
readonly item_selector?: string | null | undefined;
|
|
559
|
+
readonly max_bytes?: number | null | undefined;
|
|
560
|
+
readonly max_columns?: number | null | undefined;
|
|
561
|
+
readonly max_rows?: number | null | undefined;
|
|
562
|
+
readonly ref?: string | null | undefined;
|
|
563
|
+
readonly selector?: string | null | undefined;
|
|
564
|
+
readonly session_id: string;
|
|
565
|
+
readonly tab_id?: number | null | undefined;
|
|
566
|
+
readonly target_id?: string | null | undefined;
|
|
567
|
+
readonly timeout_ms?: number | null | undefined;
|
|
568
|
+
};
|
|
569
|
+
export type ToolFillParams = {
|
|
570
|
+
/**
|
|
571
|
+
* Clear the field before typing. Defaults to `true`; pass `false`
|
|
572
|
+
* to append instead of replacing.
|
|
573
|
+
*/
|
|
574
|
+
readonly clear_before?: boolean | null | undefined;
|
|
575
|
+
/**
|
|
576
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
577
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
578
|
+
*/
|
|
579
|
+
readonly context_id?: string | undefined;
|
|
580
|
+
/**
|
|
581
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
582
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
583
|
+
*/
|
|
584
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
585
|
+
/**
|
|
586
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
587
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
588
|
+
*/
|
|
589
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
590
|
+
/**
|
|
591
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
592
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
593
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
594
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
595
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
596
|
+
*/
|
|
597
|
+
readonly observation_id?: string | null | undefined;
|
|
598
|
+
readonly ref?: string | null | undefined;
|
|
599
|
+
readonly selector?: string | null | undefined;
|
|
600
|
+
readonly session_id: string;
|
|
601
|
+
readonly tab_id?: number | null | undefined;
|
|
602
|
+
readonly timeout_ms?: number | null | undefined;
|
|
603
|
+
readonly value: string;
|
|
604
|
+
};
|
|
605
|
+
export type ToolFocusParams = {
|
|
606
|
+
/**
|
|
607
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
608
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
609
|
+
*/
|
|
610
|
+
readonly context_id?: string | undefined;
|
|
611
|
+
/**
|
|
612
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
613
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
614
|
+
*/
|
|
615
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
616
|
+
/**
|
|
617
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
618
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
619
|
+
*/
|
|
620
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
621
|
+
/**
|
|
622
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
623
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
624
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
625
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
626
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
627
|
+
*/
|
|
628
|
+
readonly observation_id?: string | null | undefined;
|
|
629
|
+
/**
|
|
630
|
+
* Optional `@e<N>` ref allocated by the last observation.
|
|
631
|
+
* Mutually exclusive with `selector`.
|
|
632
|
+
*/
|
|
633
|
+
readonly ref?: string | null | undefined;
|
|
634
|
+
readonly selector?: string | null | undefined;
|
|
635
|
+
readonly session_id: string;
|
|
636
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
637
|
+
readonly tab_id?: number | null | undefined;
|
|
638
|
+
readonly timeout_ms?: number | null | undefined;
|
|
639
|
+
};
|
|
640
|
+
/**
|
|
641
|
+
* Parameters for `tool.get_html`. Either give a tab and (optionally) a
|
|
642
|
+
* snapshot ref to scope the dump to one subtree, or leave both empty
|
|
643
|
+
* to fall back to the Agent Window's active tab and the document
|
|
644
|
+
* root.
|
|
645
|
+
*
|
|
646
|
+
* The wire field is `"ref"` (a Rust keyword); the Rust binding lives
|
|
647
|
+
* in [`Self::ref_`] and uses serde rename / alias so JSON stays clean.
|
|
648
|
+
*/
|
|
649
|
+
export type ToolGetHtmlParams = {
|
|
650
|
+
/**
|
|
651
|
+
* Truncate the HTML to at most this many bytes. Optional;
|
|
652
|
+
* extension applies a sensible default (`524288` = 512 KiB) when
|
|
653
|
+
* omitted.
|
|
654
|
+
*/
|
|
655
|
+
readonly max_bytes?: number | null | undefined;
|
|
656
|
+
/**
|
|
657
|
+
* Optional `@e<N>` ref allocated by the last `tool.snapshot`.
|
|
658
|
+
* Accepts both `"e3"` and `"@e3"`. When given the extension calls
|
|
659
|
+
* `DOM.getOuterHTML({ backendNodeId })` for the matching node;
|
|
660
|
+
* otherwise it fetches the document element.
|
|
661
|
+
*/
|
|
662
|
+
readonly ref?: string | null | undefined;
|
|
663
|
+
readonly session_id: string;
|
|
664
|
+
readonly tab_id?: number | null | undefined;
|
|
665
|
+
};
|
|
666
|
+
export type ToolHoverParams = {
|
|
667
|
+
/**
|
|
668
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
669
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
670
|
+
*/
|
|
671
|
+
readonly context_id?: string | undefined;
|
|
672
|
+
/**
|
|
673
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
674
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
675
|
+
*/
|
|
676
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
677
|
+
/**
|
|
678
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
679
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
680
|
+
*/
|
|
681
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
682
|
+
readonly modifiers?: readonly KeyModifier[] | null | undefined;
|
|
683
|
+
/**
|
|
684
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
685
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
686
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
687
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
688
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
689
|
+
*/
|
|
690
|
+
readonly observation_id?: string | null | undefined;
|
|
691
|
+
/**
|
|
692
|
+
* Optional `@e<N>` ref allocated by the last observation.
|
|
693
|
+
* Mutually exclusive with `selector`.
|
|
694
|
+
*/
|
|
695
|
+
readonly ref?: string | null | undefined;
|
|
696
|
+
readonly selector?: string | null | undefined;
|
|
697
|
+
readonly session_id: string;
|
|
698
|
+
/** Wait after the mouse move so hover-triggered UI can settle. */
|
|
699
|
+
readonly settle_ms?: number | null | undefined;
|
|
700
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
701
|
+
readonly tab_id?: number | null | undefined;
|
|
702
|
+
readonly timeout_ms?: number | null | undefined;
|
|
703
|
+
};
|
|
704
|
+
export type ToolNavigateBackParams = {
|
|
705
|
+
/**
|
|
706
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
707
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
708
|
+
*/
|
|
709
|
+
readonly context_id?: string | undefined;
|
|
710
|
+
/**
|
|
711
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
712
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
713
|
+
*/
|
|
714
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
715
|
+
/**
|
|
716
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
717
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
718
|
+
*/
|
|
719
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
720
|
+
/**
|
|
721
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
722
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
723
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
724
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
725
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
726
|
+
*/
|
|
727
|
+
readonly observation_id?: string | null | undefined;
|
|
728
|
+
readonly session_id: string;
|
|
729
|
+
readonly tab_id?: number | null | undefined;
|
|
730
|
+
readonly timeout_ms?: number | null | undefined;
|
|
731
|
+
readonly wait_until?: WaitUntil | null | undefined;
|
|
732
|
+
};
|
|
733
|
+
export type ToolNavigateForwardParams = {
|
|
734
|
+
/**
|
|
735
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
736
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
737
|
+
*/
|
|
738
|
+
readonly context_id?: string | undefined;
|
|
739
|
+
/**
|
|
740
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
741
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
742
|
+
*/
|
|
743
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
744
|
+
/**
|
|
745
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
746
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
747
|
+
*/
|
|
748
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
749
|
+
/**
|
|
750
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
751
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
752
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
753
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
754
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
755
|
+
*/
|
|
756
|
+
readonly observation_id?: string | null | undefined;
|
|
757
|
+
readonly session_id: string;
|
|
758
|
+
readonly tab_id?: number | null | undefined;
|
|
759
|
+
readonly timeout_ms?: number | null | undefined;
|
|
760
|
+
readonly wait_until?: WaitUntil | null | undefined;
|
|
761
|
+
};
|
|
762
|
+
export type ToolNavigateParams = {
|
|
763
|
+
/**
|
|
764
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
765
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
766
|
+
*/
|
|
767
|
+
readonly context_id?: string | undefined;
|
|
768
|
+
/**
|
|
769
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
770
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
771
|
+
*/
|
|
772
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
773
|
+
/**
|
|
774
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
775
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
776
|
+
*/
|
|
777
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
778
|
+
/**
|
|
779
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
780
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
781
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
782
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
783
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
784
|
+
*/
|
|
785
|
+
readonly observation_id?: string | null | undefined;
|
|
786
|
+
readonly session_id: string;
|
|
787
|
+
/** Target tab. Defaults to the Agent Window's currently active tab. */
|
|
788
|
+
readonly tab_id?: number | null | undefined;
|
|
789
|
+
/**
|
|
790
|
+
* Hard upper bound on the wait; the extension also enforces its
|
|
791
|
+
* own AbortController hookup (M7 stops listening for further
|
|
792
|
+
* lifecycle events once exceeded). Defaults to 30s if omitted.
|
|
793
|
+
*/
|
|
794
|
+
readonly timeout_ms?: number | null | undefined;
|
|
795
|
+
readonly url: string;
|
|
796
|
+
/** Lifecycle phase to wait on. Defaults to [`WaitUntil::Load`]. */
|
|
797
|
+
readonly wait_until?: WaitUntil | null | undefined;
|
|
798
|
+
};
|
|
799
|
+
export type ToolNetworkParams = {
|
|
800
|
+
/** Maximum number of entries to return. Extension applies safe defaults and caps. */
|
|
801
|
+
readonly limit?: number | null | undefined;
|
|
802
|
+
/** Maximum characters returned per URL / error text. Extension applies safe defaults and caps. */
|
|
803
|
+
readonly max_text_chars?: number | null | undefined;
|
|
804
|
+
readonly session_id: string;
|
|
805
|
+
/** Return entries with sequence strictly greater than this cursor. */
|
|
806
|
+
readonly since?: number | null | undefined;
|
|
807
|
+
/** Optional target tab. Defaults to the Agent Window's currently active tab. */
|
|
808
|
+
readonly tab_id?: number | null | undefined;
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* Parameters for `tool.observe` — produce a semantic VOM observation
|
|
812
|
+
* for one tab plus a fresh `@e<N>` ref-store on the extension side.
|
|
813
|
+
*
|
|
814
|
+
* Unlike `tool.snapshot`, this path may run bounded perception probes
|
|
815
|
+
* such as hover-surface discovery, but only when `probe_hover` asks for
|
|
816
|
+
* them. It must not submit input, click, navigate, or otherwise commit
|
|
817
|
+
* page state.
|
|
818
|
+
*/
|
|
819
|
+
export type ToolObserveParams = {
|
|
820
|
+
/**
|
|
821
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
822
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
823
|
+
*/
|
|
824
|
+
readonly context_id?: string | undefined;
|
|
825
|
+
/** Continue a retained observation; does not recapture the page. */
|
|
826
|
+
readonly cursor?: string | null | undefined;
|
|
827
|
+
/** Include implementation diagnostics for conditional surface probes. */
|
|
828
|
+
readonly debug_surfaces?: boolean | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
831
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
832
|
+
*/
|
|
833
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
834
|
+
/**
|
|
835
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
836
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
837
|
+
*/
|
|
838
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
839
|
+
/** Cap the depth of the rendered VOM tree. */
|
|
840
|
+
readonly max_depth?: number | null | undefined;
|
|
841
|
+
/**
|
|
842
|
+
* Soft cap on rendered tokens (approximate; extension uses a
|
|
843
|
+
* best-effort heuristic based on character count).
|
|
844
|
+
*/
|
|
845
|
+
readonly max_tokens?: number | null | undefined;
|
|
846
|
+
/**
|
|
847
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
848
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
849
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
850
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
851
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
852
|
+
*/
|
|
853
|
+
readonly observation_id?: string | null | undefined;
|
|
854
|
+
/**
|
|
855
|
+
* Opt in to active hover probing: the extension moves the real cursor
|
|
856
|
+
* over a bounded set of controls to discover hover-only menus and
|
|
857
|
+
* tooltips.
|
|
858
|
+
*
|
|
859
|
+
* Off by default. Probing costs seconds of wall clock, mutates the live
|
|
860
|
+
* page, and pays off only on pages whose content is genuinely hidden
|
|
861
|
+
* behind hover. Request it when a static observation looks like it is
|
|
862
|
+
* missing hover-revealed structure.
|
|
863
|
+
*/
|
|
864
|
+
readonly probe_hover?: boolean | undefined;
|
|
865
|
+
readonly session_id: string;
|
|
866
|
+
/**
|
|
867
|
+
* Optional target tab. Defaults to the Agent Window's currently
|
|
868
|
+
* active tab.
|
|
869
|
+
*/
|
|
870
|
+
readonly tab_id?: number | null | undefined;
|
|
871
|
+
};
|
|
872
|
+
export type ToolOperationAwaitParams = {
|
|
873
|
+
readonly operation_id: string;
|
|
874
|
+
readonly session_id: string;
|
|
875
|
+
readonly wait_ms?: number | null | undefined;
|
|
876
|
+
};
|
|
877
|
+
export type ToolOperationCancelParams = {
|
|
878
|
+
readonly operation_id: string;
|
|
879
|
+
readonly session_id: string;
|
|
880
|
+
readonly wait_ms?: number | null | undefined;
|
|
881
|
+
};
|
|
882
|
+
export type ToolOperationParams = {
|
|
883
|
+
readonly operation_id: string;
|
|
884
|
+
readonly session_id: string;
|
|
885
|
+
readonly wait_ms?: number | null | undefined;
|
|
886
|
+
};
|
|
887
|
+
export type ToolPressParams = {
|
|
888
|
+
/**
|
|
889
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
890
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
891
|
+
*/
|
|
892
|
+
readonly context_id?: string | undefined;
|
|
893
|
+
/**
|
|
894
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
895
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
896
|
+
*/
|
|
897
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
898
|
+
/**
|
|
899
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
900
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
901
|
+
*/
|
|
902
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
903
|
+
/**
|
|
904
|
+
* Hold the key down for this many milliseconds between `keyDown`
|
|
905
|
+
* and `keyUp`. Useful for testing long-press handlers.
|
|
906
|
+
*/
|
|
907
|
+
readonly hold_ms?: number | null | undefined;
|
|
908
|
+
/**
|
|
909
|
+
* Logical key name. Accepts CDP `key` strings (`Enter`, `Escape`,
|
|
910
|
+
* `ArrowDown`, single characters like `a`), or a compound
|
|
911
|
+
* expression such as `Ctrl+A` / `Meta+Shift+P`. Modifiers in the
|
|
912
|
+
* compound form combine with anything supplied via `modifiers`.
|
|
913
|
+
*/
|
|
914
|
+
readonly key: string;
|
|
915
|
+
readonly modifiers?: readonly KeyModifier[] | null | undefined;
|
|
916
|
+
/**
|
|
917
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
918
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
919
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
920
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
921
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
922
|
+
*/
|
|
923
|
+
readonly observation_id?: string | null | undefined;
|
|
924
|
+
/** Optional target to focus before dispatching the key. */
|
|
925
|
+
readonly ref?: string | null | undefined;
|
|
926
|
+
readonly selector?: string | null | undefined;
|
|
927
|
+
readonly session_id: string;
|
|
928
|
+
readonly tab_id?: number | null | undefined;
|
|
929
|
+
readonly timeout_ms?: number | null | undefined;
|
|
930
|
+
};
|
|
931
|
+
export type ToolReadParams = {
|
|
932
|
+
/** Optional cooperation context validated by the extension without renewing control. */
|
|
933
|
+
readonly context_id?: string | null | undefined;
|
|
934
|
+
/** Defaults to [{"key":"text","read":"text"}]. */
|
|
935
|
+
readonly fields?: readonly ReadField[] | null | undefined;
|
|
936
|
+
readonly max_bytes?: number | null | undefined;
|
|
937
|
+
readonly max_nodes?: number | null | undefined;
|
|
938
|
+
/** Exact observed DOM node, including iframe and shadow nodes. Exclusive with selector. */
|
|
939
|
+
readonly ref?: string | null | undefined;
|
|
940
|
+
/** CSS in the main document. All matches, up to max_nodes; no selector means the root. */
|
|
941
|
+
readonly selector?: string | null | undefined;
|
|
942
|
+
readonly session_id: string;
|
|
943
|
+
readonly tab_id?: number | null | undefined;
|
|
944
|
+
readonly timeout_ms?: number | null | undefined;
|
|
945
|
+
};
|
|
946
|
+
export type ToolRecordAwaitParams = {
|
|
947
|
+
readonly session_id: string;
|
|
948
|
+
readonly timeout_ms?: number | null | undefined;
|
|
949
|
+
};
|
|
950
|
+
export type ToolRecordStartParams = {
|
|
951
|
+
readonly max_page_tokens?: number | null | undefined;
|
|
952
|
+
readonly purpose?: string | null | undefined;
|
|
953
|
+
readonly redact_values?: boolean | null | undefined;
|
|
954
|
+
readonly session_id: string;
|
|
955
|
+
/** Client can decode the v3 `switch_tab` step variant. */
|
|
956
|
+
readonly supports_tab_switch_steps?: boolean | null | undefined;
|
|
957
|
+
readonly tab_id?: number | null | undefined;
|
|
958
|
+
/** Desired trace export format. Omitted means v2; `3` requests v3. */
|
|
959
|
+
readonly trace_version?: number | null | undefined;
|
|
960
|
+
readonly url?: string | null | undefined;
|
|
961
|
+
};
|
|
962
|
+
export type ToolRecordStopParams = {
|
|
963
|
+
readonly session_id: string;
|
|
964
|
+
};
|
|
965
|
+
export type ToolReloadParams = {
|
|
966
|
+
/**
|
|
967
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
968
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
969
|
+
*/
|
|
970
|
+
readonly context_id?: string | undefined;
|
|
971
|
+
/**
|
|
972
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
973
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
974
|
+
*/
|
|
975
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
976
|
+
/**
|
|
977
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
978
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
979
|
+
*/
|
|
980
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
981
|
+
/** When `true`, bypass the HTTP cache (CDP `Page.reload(ignoreCache=true)`). */
|
|
982
|
+
readonly hard?: boolean | null | undefined;
|
|
983
|
+
/**
|
|
984
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
985
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
986
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
987
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
988
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
989
|
+
*/
|
|
990
|
+
readonly observation_id?: string | null | undefined;
|
|
991
|
+
readonly session_id: string;
|
|
992
|
+
readonly tab_id?: number | null | undefined;
|
|
993
|
+
readonly timeout_ms?: number | null | undefined;
|
|
994
|
+
readonly wait_until?: WaitUntil | null | undefined;
|
|
995
|
+
};
|
|
996
|
+
export type ToolRequestHelpParams = {
|
|
997
|
+
/**
|
|
998
|
+
* Optional explicit success detector. Navigation by itself is not a
|
|
999
|
+
* completion signal; these criteria must match before the tool can
|
|
1000
|
+
* auto-complete without the user clicking Done.
|
|
1001
|
+
*/
|
|
1002
|
+
readonly completion_criteria?: HelpCompletionCriteria | null | undefined;
|
|
1003
|
+
/** Message shown to the user explaining what to do. */
|
|
1004
|
+
readonly prompt: string;
|
|
1005
|
+
readonly session_id: string;
|
|
1006
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
1007
|
+
readonly tab_id?: number | null | undefined;
|
|
1008
|
+
/** Optional components to scroll to + flash-highlight. */
|
|
1009
|
+
readonly targets?: readonly HelpTarget[] | null | undefined;
|
|
1010
|
+
/**
|
|
1011
|
+
* Hard upper bound on the wait. Defaults to 300000 (5 min),
|
|
1012
|
+
* enforced daemon-side via the generic tool timeout.
|
|
1013
|
+
*/
|
|
1014
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1015
|
+
/**
|
|
1016
|
+
* Optional custom title for the help overlay. Falls back to the
|
|
1017
|
+
* extension's default localized title when omitted.
|
|
1018
|
+
*/
|
|
1019
|
+
readonly title?: string | null | undefined;
|
|
1020
|
+
};
|
|
1021
|
+
/**
|
|
1022
|
+
* Scroll the session's active web page from top to bottom. PNG bytes are
|
|
1023
|
+
* exported in bounded chunks through `tool.screenshot_read`, then released.
|
|
1024
|
+
*/
|
|
1025
|
+
export type ToolScreenshotFullPageParams = {
|
|
1026
|
+
/**
|
|
1027
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
1028
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
1029
|
+
*/
|
|
1030
|
+
readonly context_id?: string | undefined;
|
|
1031
|
+
/**
|
|
1032
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
1033
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
1034
|
+
*/
|
|
1035
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
1036
|
+
/**
|
|
1037
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
1038
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
1039
|
+
*/
|
|
1040
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
1041
|
+
/**
|
|
1042
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
1043
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
1044
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
1045
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
1046
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
1047
|
+
*/
|
|
1048
|
+
readonly observation_id?: string | null | undefined;
|
|
1049
|
+
/** Follow appended content (default), or capture the initial document height. */
|
|
1050
|
+
readonly scope?: ScreenshotScope | null | undefined;
|
|
1051
|
+
readonly session_id: string;
|
|
1052
|
+
readonly tab_id?: number | null | undefined;
|
|
1053
|
+
/** Capture and PNG encoding deadline; defaults to 120000 milliseconds. */
|
|
1054
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1055
|
+
};
|
|
1056
|
+
/**
|
|
1057
|
+
* Parameters for `tool.screenshot`. Omit `ref` to capture the visible
|
|
1058
|
+
* tab; pass an `@e<N>` ref from the last `tool.snapshot` to crop to
|
|
1059
|
+
* that element.
|
|
1060
|
+
*/
|
|
1061
|
+
export type ToolScreenshotParams = {
|
|
1062
|
+
/**
|
|
1063
|
+
* Optional `@e<N>` ref allocated by the last `tool.snapshot`.
|
|
1064
|
+
* Accepts both `"e3"` and `"@e3"`.
|
|
1065
|
+
*/
|
|
1066
|
+
readonly ref?: string | null | undefined;
|
|
1067
|
+
readonly session_id: string;
|
|
1068
|
+
readonly tab_id?: number | null | undefined;
|
|
1069
|
+
};
|
|
1070
|
+
export type ToolScreenshotReadParams = {
|
|
1071
|
+
readonly capture_id: string;
|
|
1072
|
+
/** Byte offset, allowing an interrupted chunk request to be retried. */
|
|
1073
|
+
readonly offset: number;
|
|
1074
|
+
readonly session_id: string;
|
|
1075
|
+
};
|
|
1076
|
+
export type ToolScreenshotReleaseParams = {
|
|
1077
|
+
readonly capture_id: string;
|
|
1078
|
+
readonly session_id: string;
|
|
1079
|
+
};
|
|
1080
|
+
export type ToolScrollToParams = {
|
|
1081
|
+
/**
|
|
1082
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
1083
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
1084
|
+
*/
|
|
1085
|
+
readonly context_id?: string | undefined;
|
|
1086
|
+
/**
|
|
1087
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
1088
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
1089
|
+
*/
|
|
1090
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
1091
|
+
/**
|
|
1092
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
1093
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
1094
|
+
*/
|
|
1095
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
1096
|
+
/**
|
|
1097
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
1098
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
1099
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
1100
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
1101
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
1102
|
+
*/
|
|
1103
|
+
readonly observation_id?: string | null | undefined;
|
|
1104
|
+
/**
|
|
1105
|
+
* Optional `@e<N>` ref allocated by the last observation.
|
|
1106
|
+
* Mutually exclusive with `selector`.
|
|
1107
|
+
*/
|
|
1108
|
+
readonly ref?: string | null | undefined;
|
|
1109
|
+
readonly selector?: string | null | undefined;
|
|
1110
|
+
readonly session_id: string;
|
|
1111
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
1112
|
+
readonly tab_id?: number | null | undefined;
|
|
1113
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1114
|
+
};
|
|
1115
|
+
export type ToolSelectParams = {
|
|
1116
|
+
/**
|
|
1117
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
1118
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
1119
|
+
*/
|
|
1120
|
+
readonly context_id?: string | undefined;
|
|
1121
|
+
/**
|
|
1122
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
1123
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
1124
|
+
*/
|
|
1125
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
1126
|
+
/**
|
|
1127
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
1128
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
1129
|
+
*/
|
|
1130
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
1131
|
+
/**
|
|
1132
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
1133
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
1134
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
1135
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
1136
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
1137
|
+
*/
|
|
1138
|
+
readonly observation_id?: string | null | undefined;
|
|
1139
|
+
/**
|
|
1140
|
+
* Optional `@e<N>` ref allocated by the last `tool.snapshot`.
|
|
1141
|
+
* Mutually exclusive with `selector`. Accepts both `"e3"` and
|
|
1142
|
+
* `"@e3"`.
|
|
1143
|
+
*/
|
|
1144
|
+
readonly ref?: string | null | undefined;
|
|
1145
|
+
/**
|
|
1146
|
+
* CSS selector resolved against the live DOM. Mutually exclusive
|
|
1147
|
+
* with `ref_`.
|
|
1148
|
+
*/
|
|
1149
|
+
readonly selector?: string | null | undefined;
|
|
1150
|
+
readonly session_id: string;
|
|
1151
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
1152
|
+
readonly tab_id?: number | null | undefined;
|
|
1153
|
+
/** Maximum time the daemon waits for the tool call before timing out. */
|
|
1154
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1155
|
+
/**
|
|
1156
|
+
* Option `value` strings to set as the final selection. For a
|
|
1157
|
+
* single-select `<select>` exactly one value is required; for
|
|
1158
|
+
* `<select multiple>` the list replaces the current selection
|
|
1159
|
+
* (an empty list clears all selections).
|
|
1160
|
+
*/
|
|
1161
|
+
readonly values: readonly string[];
|
|
1162
|
+
};
|
|
1163
|
+
export type ToolSessionStartParams = {
|
|
1164
|
+
readonly browser_instance_id?: string | null | undefined;
|
|
1165
|
+
/** Caller-supplied display labels, not an authenticated identity. */
|
|
1166
|
+
readonly controller?: ControllerInfo | null | undefined;
|
|
1167
|
+
/**
|
|
1168
|
+
* Whether the new Agent Window should take focus. Omitted means the
|
|
1169
|
+
* extension's default (`false`).
|
|
1170
|
+
*/
|
|
1171
|
+
readonly focused?: boolean | null | undefined;
|
|
1172
|
+
/** Optional Agent Window outer height in CSS pixels (100..=7680). */
|
|
1173
|
+
readonly height?: number | null | undefined;
|
|
1174
|
+
/** Use Chrome's shared incognito browsing session. Omitted means normal. */
|
|
1175
|
+
readonly incognito?: boolean | undefined;
|
|
1176
|
+
readonly session_id: string;
|
|
1177
|
+
/** Optional Agent Window outer width in CSS pixels (100..=7680). */
|
|
1178
|
+
readonly width?: number | null | undefined;
|
|
1179
|
+
};
|
|
1180
|
+
export type ToolSessionStopParams = {
|
|
1181
|
+
readonly session_id: string;
|
|
1182
|
+
};
|
|
1183
|
+
/**
|
|
1184
|
+
* Parameters for `tool.snapshot` — produce an indented accessibility
|
|
1185
|
+
* tree for one tab plus a fresh `@e<N>` ref-store on the extension
|
|
1186
|
+
* side (design §4 / §7).
|
|
1187
|
+
*/
|
|
1188
|
+
export type ToolSnapshotParams = {
|
|
1189
|
+
/**
|
|
1190
|
+
* Cap the depth of the rendered tree (defense against very deep
|
|
1191
|
+
* pages). Implementation-defined default; agents typically use
|
|
1192
|
+
* `Some(16)` for "browse and read" prompts.
|
|
1193
|
+
*/
|
|
1194
|
+
readonly max_depth?: number | null | undefined;
|
|
1195
|
+
/**
|
|
1196
|
+
* Soft cap on rendered tokens (approximate; extension uses a
|
|
1197
|
+
* best-effort heuristic based on character count).
|
|
1198
|
+
*/
|
|
1199
|
+
readonly max_tokens?: number | null | undefined;
|
|
1200
|
+
readonly session_id: string;
|
|
1201
|
+
/**
|
|
1202
|
+
* Optional target tab. Defaults to the Agent Window's currently
|
|
1203
|
+
* active tab.
|
|
1204
|
+
*/
|
|
1205
|
+
readonly tab_id?: number | null | undefined;
|
|
1206
|
+
};
|
|
1207
|
+
/**
|
|
1208
|
+
* Params for `tool.tab_borrow`. Moves a *user* tab into the
|
|
1209
|
+
* requesting session's Agent Window, recording its original window /
|
|
1210
|
+
* index so `tab_return` (or session_stop) can put it back.
|
|
1211
|
+
*/
|
|
1212
|
+
export type ToolTabBorrowParams = {
|
|
1213
|
+
/** Legacy input, ignored. Browser settings decide whether confirmation is required. */
|
|
1214
|
+
readonly confirm?: boolean | null | undefined;
|
|
1215
|
+
/** Maximum time to wait for user confirmation (default 60 seconds). */
|
|
1216
|
+
readonly confirmation_timeout_ms?: number | null | undefined;
|
|
1217
|
+
readonly session_id: string;
|
|
1218
|
+
readonly tab_id: number;
|
|
1219
|
+
};
|
|
1220
|
+
export type ToolTabCloseParams = {
|
|
1221
|
+
/**
|
|
1222
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
1223
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
1224
|
+
*/
|
|
1225
|
+
readonly context_id?: string | undefined;
|
|
1226
|
+
/**
|
|
1227
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
1228
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
1229
|
+
*/
|
|
1230
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
1231
|
+
/**
|
|
1232
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
1233
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
1234
|
+
*/
|
|
1235
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
1236
|
+
/**
|
|
1237
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
1238
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
1239
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
1240
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
1241
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
1242
|
+
*/
|
|
1243
|
+
readonly observation_id?: string | null | undefined;
|
|
1244
|
+
readonly session_id: string;
|
|
1245
|
+
readonly tab_id: number;
|
|
1246
|
+
};
|
|
1247
|
+
/**
|
|
1248
|
+
* Params for `tool.tab_create`. The new tab is always created inside
|
|
1249
|
+
* the requesting session's Agent Window (design §6 sandbox rule —
|
|
1250
|
+
* agents never spawn tabs in user windows).
|
|
1251
|
+
*/
|
|
1252
|
+
export type ToolTabCreateParams = {
|
|
1253
|
+
/** Focus the new tab? Defaults to `true` (matches `chrome.tabs.create`). */
|
|
1254
|
+
readonly active?: boolean | null | undefined;
|
|
1255
|
+
/**
|
|
1256
|
+
* Insertion index within the Agent Window's tab strip. Omit to
|
|
1257
|
+
* append at the end.
|
|
1258
|
+
*/
|
|
1259
|
+
readonly index?: number | null | undefined;
|
|
1260
|
+
readonly session_id: string;
|
|
1261
|
+
/** Destination URL. Defaults to `chrome://newtab` when omitted. */
|
|
1262
|
+
readonly url?: string | null | undefined;
|
|
1263
|
+
};
|
|
1264
|
+
export type ToolTabListParams = {
|
|
1265
|
+
readonly scope?: TabScope | undefined;
|
|
1266
|
+
readonly session_id: string;
|
|
1267
|
+
};
|
|
1268
|
+
export type ToolTabReturnParams = {
|
|
1269
|
+
readonly session_id: string;
|
|
1270
|
+
readonly tab_id: number;
|
|
1271
|
+
};
|
|
1272
|
+
export type ToolTabSelectParams = {
|
|
1273
|
+
readonly session_id: string;
|
|
1274
|
+
readonly tab_id: number;
|
|
1275
|
+
};
|
|
1276
|
+
export type ToolUploadParams = {
|
|
1277
|
+
/**
|
|
1278
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
1279
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
1280
|
+
*/
|
|
1281
|
+
readonly context_id?: string | undefined;
|
|
1282
|
+
/**
|
|
1283
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
1284
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
1285
|
+
*/
|
|
1286
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
1287
|
+
/**
|
|
1288
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
1289
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
1290
|
+
*/
|
|
1291
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
1292
|
+
readonly files: readonly UploadFile[];
|
|
1293
|
+
readonly mode?: UploadMode | undefined;
|
|
1294
|
+
/**
|
|
1295
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
1296
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
1297
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
1298
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
1299
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
1300
|
+
*/
|
|
1301
|
+
readonly observation_id?: string | null | undefined;
|
|
1302
|
+
readonly ref?: string | null | undefined;
|
|
1303
|
+
readonly selector?: string | null | undefined;
|
|
1304
|
+
readonly session_id: string;
|
|
1305
|
+
readonly tab_id?: number | null | undefined;
|
|
1306
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1307
|
+
};
|
|
1308
|
+
export type ToolVideoParams = {
|
|
1309
|
+
readonly action: "start";
|
|
1310
|
+
readonly max_duration_ms: number;
|
|
1311
|
+
readonly quality: VideoQuality;
|
|
1312
|
+
readonly request_id: string;
|
|
1313
|
+
readonly session_id: string;
|
|
1314
|
+
readonly tab_id?: number | null | undefined;
|
|
1315
|
+
} | {
|
|
1316
|
+
readonly action: "capabilities";
|
|
1317
|
+
readonly browser?: string | null | undefined;
|
|
1318
|
+
readonly session_id?: string | null | undefined;
|
|
1319
|
+
} | {
|
|
1320
|
+
readonly action: "list";
|
|
1321
|
+
readonly browser?: string | null | undefined;
|
|
1322
|
+
} | {
|
|
1323
|
+
readonly action: "status";
|
|
1324
|
+
readonly browser: string;
|
|
1325
|
+
readonly capability: string;
|
|
1326
|
+
readonly recording_id: string;
|
|
1327
|
+
} | {
|
|
1328
|
+
readonly action: "stop";
|
|
1329
|
+
readonly browser: string;
|
|
1330
|
+
readonly capability: string;
|
|
1331
|
+
readonly recording_id: string;
|
|
1332
|
+
} | {
|
|
1333
|
+
readonly action: "read";
|
|
1334
|
+
readonly browser: string;
|
|
1335
|
+
readonly capability: string;
|
|
1336
|
+
readonly offset: number;
|
|
1337
|
+
readonly recording_id: string;
|
|
1338
|
+
} | {
|
|
1339
|
+
readonly action: "discard";
|
|
1340
|
+
readonly browser: string;
|
|
1341
|
+
readonly capability: string;
|
|
1342
|
+
readonly recording_id: string;
|
|
1343
|
+
} | {
|
|
1344
|
+
readonly action: "exported";
|
|
1345
|
+
readonly browser: string;
|
|
1346
|
+
readonly capability: string;
|
|
1347
|
+
readonly recording_id: string;
|
|
1348
|
+
};
|
|
1349
|
+
export type ToolWaitForElementParams = {
|
|
1350
|
+
/**
|
|
1351
|
+
* Polling interval, shortened near the deadline to allow a final probe.
|
|
1352
|
+
* Defaults to 100ms; values outside 16..=2000ms are rejected.
|
|
1353
|
+
*/
|
|
1354
|
+
readonly poll_ms?: number | null | undefined;
|
|
1355
|
+
/**
|
|
1356
|
+
* Optional `@e<N>` ref from the latest snapshot or observe.
|
|
1357
|
+
* Mutually exclusive with `selector`.
|
|
1358
|
+
*/
|
|
1359
|
+
readonly ref?: string | null | undefined;
|
|
1360
|
+
readonly selector?: string | null | undefined;
|
|
1361
|
+
readonly session_id: string;
|
|
1362
|
+
/** State to wait for. */
|
|
1363
|
+
readonly state: ElementState;
|
|
1364
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
1365
|
+
readonly tab_id?: number | null | undefined;
|
|
1366
|
+
/** Element inspection budget, including probes. Defaults to 10s (1..=300000ms). */
|
|
1367
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1368
|
+
};
|
|
1369
|
+
export type ToolWaitForNavigationParams = {
|
|
1370
|
+
readonly session_id: string;
|
|
1371
|
+
/** Target tab. Defaults to the Agent Window's currently active tab. */
|
|
1372
|
+
readonly tab_id?: number | null | undefined;
|
|
1373
|
+
/** Hard upper bound on the wait. Defaults to 30s. */
|
|
1374
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1375
|
+
/** Lifecycle phase to wait on. Defaults to [`WaitUntil::Load`]. */
|
|
1376
|
+
readonly wait_until?: WaitUntil | null | undefined;
|
|
1377
|
+
};
|
|
1378
|
+
export type ToolWaitMsParams = {
|
|
1379
|
+
readonly duration_ms: number;
|
|
1380
|
+
};
|
|
1381
|
+
export type ToolWheelParams = {
|
|
1382
|
+
/**
|
|
1383
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
1384
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
1385
|
+
*/
|
|
1386
|
+
readonly context_id?: string | undefined;
|
|
1387
|
+
/** Native CDP wheel input in CSS pixels. Positive X means right. Not measured displacement. */
|
|
1388
|
+
readonly delta_x?: number | undefined;
|
|
1389
|
+
/** Native CDP wheel input in CSS pixels. Positive Y means down. Defaults to zero. */
|
|
1390
|
+
readonly delta_y?: number | undefined;
|
|
1391
|
+
/**
|
|
1392
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
1393
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
1394
|
+
*/
|
|
1395
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
1396
|
+
/**
|
|
1397
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
1398
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
1399
|
+
*/
|
|
1400
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
1401
|
+
readonly modifiers?: readonly KeyModifier[] | null | undefined;
|
|
1402
|
+
/**
|
|
1403
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
1404
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
1405
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
1406
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
1407
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
1408
|
+
*/
|
|
1409
|
+
readonly observation_id?: string | null | undefined;
|
|
1410
|
+
/**
|
|
1411
|
+
* Optional `@e<N>` ref used as the wheel event's hit-test point.
|
|
1412
|
+
* Mutually exclusive with `selector`. When neither is supplied,
|
|
1413
|
+
* the event is dispatched at the viewport centre.
|
|
1414
|
+
*/
|
|
1415
|
+
readonly ref?: string | null | undefined;
|
|
1416
|
+
readonly selector?: string | null | undefined;
|
|
1417
|
+
readonly session_id: string;
|
|
1418
|
+
/** Target tab. Defaults to the Agent Window's active tab. */
|
|
1419
|
+
readonly tab_id?: number | null | undefined;
|
|
1420
|
+
readonly timeout_ms?: number | null | undefined;
|
|
1421
|
+
};
|
|
1422
|
+
export type ToolWindowResizeParams = {
|
|
1423
|
+
/**
|
|
1424
|
+
* Context actually returned by sync. Reusable for target-policy DOM actions;
|
|
1425
|
+
* strict policy consumes it after one action. Never fill it from cached state.
|
|
1426
|
+
*/
|
|
1427
|
+
readonly context_id?: string | undefined;
|
|
1428
|
+
/**
|
|
1429
|
+
* Strict policy only: observed decision regions. Target policy requires exact
|
|
1430
|
+
* business facts in expect; regions cannot be translated to facts automatically.
|
|
1431
|
+
*/
|
|
1432
|
+
readonly depends_on?: readonly string[] | undefined;
|
|
1433
|
+
/**
|
|
1434
|
+
* Literal conditions checked before input. Selectors search the main document;
|
|
1435
|
+
* use observed refs for iframe/shadow-root targets. Text includes all whitespace.
|
|
1436
|
+
*/
|
|
1437
|
+
readonly expect?: readonly ActionExpectation[] | undefined;
|
|
1438
|
+
/** New Agent Window outer height in CSS pixels (100..=7680). */
|
|
1439
|
+
readonly height: number;
|
|
1440
|
+
/**
|
|
1441
|
+
* Sync's single-use baseline for untargeted/visual actions under target policy,
|
|
1442
|
+
* including untargeted keys and displacement-only drags. Drags with a
|
|
1443
|
+
* target ref/selector need only context_id. A script needs it only when it
|
|
1444
|
+
* states no expect facts; passing both checks the whole page as well.
|
|
1445
|
+
* Strict-policy drag instead accepts its legacy ref-map observation token.
|
|
1446
|
+
*/
|
|
1447
|
+
readonly observation_id?: string | null | undefined;
|
|
1448
|
+
readonly session_id: string;
|
|
1449
|
+
/** Optional target tab bound by cooperation before resizing. */
|
|
1450
|
+
readonly tab_id?: number | null | undefined;
|
|
1451
|
+
/** New Agent Window outer width in CSS pixels (100..=7680). */
|
|
1452
|
+
readonly width: number;
|
|
1453
|
+
};
|
|
1454
|
+
/** Parameters of every `tool.<method>` request, keyed by method name. */
|
|
1455
|
+
export type BskToolParams = {
|
|
1456
|
+
blur: ToolBlurParams;
|
|
1457
|
+
click: ToolClickParams;
|
|
1458
|
+
console: ToolConsoleParams;
|
|
1459
|
+
cooperate: ToolCooperateParams;
|
|
1460
|
+
debug: ToolDebugParams;
|
|
1461
|
+
dialog_accept: ToolDialogAcceptParams;
|
|
1462
|
+
dialog_dismiss: ToolDialogDismissParams;
|
|
1463
|
+
dialog_handle: ToolDialogHandleParams;
|
|
1464
|
+
dialog_status: ToolDialogStatusParams;
|
|
1465
|
+
download: ToolDownloadParams;
|
|
1466
|
+
drag: ToolDragParams;
|
|
1467
|
+
emulate: ToolEmulateParams;
|
|
1468
|
+
evaluate: ToolEvaluateParams;
|
|
1469
|
+
extract: ToolExtractParams;
|
|
1470
|
+
fill: ToolFillParams;
|
|
1471
|
+
focus: ToolFocusParams;
|
|
1472
|
+
get_html: ToolGetHtmlParams;
|
|
1473
|
+
hover: ToolHoverParams;
|
|
1474
|
+
navigate_back: ToolNavigateBackParams;
|
|
1475
|
+
navigate_forward: ToolNavigateForwardParams;
|
|
1476
|
+
navigate: ToolNavigateParams;
|
|
1477
|
+
network: ToolNetworkParams;
|
|
1478
|
+
observe: ToolObserveParams;
|
|
1479
|
+
operation_await: ToolOperationAwaitParams;
|
|
1480
|
+
operation_cancel: ToolOperationCancelParams;
|
|
1481
|
+
operation: ToolOperationParams;
|
|
1482
|
+
press: ToolPressParams;
|
|
1483
|
+
read: ToolReadParams;
|
|
1484
|
+
record_await: ToolRecordAwaitParams;
|
|
1485
|
+
record_start: ToolRecordStartParams;
|
|
1486
|
+
record_stop: ToolRecordStopParams;
|
|
1487
|
+
reload: ToolReloadParams;
|
|
1488
|
+
request_help: ToolRequestHelpParams;
|
|
1489
|
+
screenshot_full_page: ToolScreenshotFullPageParams;
|
|
1490
|
+
screenshot: ToolScreenshotParams;
|
|
1491
|
+
screenshot_read: ToolScreenshotReadParams;
|
|
1492
|
+
screenshot_release: ToolScreenshotReleaseParams;
|
|
1493
|
+
scroll_to: ToolScrollToParams;
|
|
1494
|
+
select: ToolSelectParams;
|
|
1495
|
+
session_start: ToolSessionStartParams;
|
|
1496
|
+
session_stop: ToolSessionStopParams;
|
|
1497
|
+
snapshot: ToolSnapshotParams;
|
|
1498
|
+
tab_borrow: ToolTabBorrowParams;
|
|
1499
|
+
tab_close: ToolTabCloseParams;
|
|
1500
|
+
tab_create: ToolTabCreateParams;
|
|
1501
|
+
tab_list: ToolTabListParams;
|
|
1502
|
+
tab_return: ToolTabReturnParams;
|
|
1503
|
+
tab_select: ToolTabSelectParams;
|
|
1504
|
+
upload: ToolUploadParams;
|
|
1505
|
+
video: ToolVideoParams;
|
|
1506
|
+
wait_for_element: ToolWaitForElementParams;
|
|
1507
|
+
wait_for_navigation: ToolWaitForNavigationParams;
|
|
1508
|
+
wait_ms: ToolWaitMsParams;
|
|
1509
|
+
wheel: ToolWheelParams;
|
|
1510
|
+
window_resize: ToolWindowResizeParams;
|
|
1511
|
+
};
|