@roll-agent/browser-use-agent 0.26.1 → 0.27.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/SKILL.md +36 -8
- package/dist/browser-observation.d.ts +1 -0
- package/dist/execution-visual-feedback.d.ts +61 -0
- package/dist/goal/compact-request.d.ts +5 -0
- package/dist/goal/contracts.d.ts +1732 -0
- package/dist/goal/decisions.d.ts +55 -0
- package/dist/goal/dependency-observation.d.ts +7 -0
- package/dist/goal/execution-context.d.ts +593 -0
- package/dist/goal/form-context.d.ts +639 -0
- package/dist/goal/form-handoff.d.ts +152 -0
- package/dist/goal/form-loop-progress.d.ts +9 -0
- package/dist/goal/form-policy.d.ts +13 -0
- package/dist/goal/host.d.ts +6 -0
- package/dist/goal/interaction-feedback.d.ts +82 -0
- package/dist/goal/loop.d.ts +12 -0
- package/dist/goal/observation-retry.d.ts +3 -0
- package/dist/goal/observation.d.ts +981 -0
- package/dist/goal/operate-handoff.d.ts +3 -0
- package/dist/goal/picker-observation.d.ts +56 -0
- package/dist/goal/picker-state.d.ts +96 -0
- package/dist/goal/reachability.d.ts +2 -0
- package/dist/goal/task-evidence.d.ts +33 -0
- package/dist/goal/task-freshness.d.ts +86 -0
- package/dist/goal/task-loop.d.ts +5 -0
- package/dist/goal/task-observation.d.ts +5 -0
- package/dist/goal/task-policy.d.ts +174 -0
- package/dist/goal/task-progress-policy.d.ts +25 -0
- package/dist/goal/task-progress.d.ts +353 -0
- package/dist/goal/task-sources.d.ts +13 -0
- package/dist/index.js +1 -1
- package/dist/native-visual-activity-session.d.ts +38 -1
- package/dist/tools/browser-operate.d.ts +252 -0
- package/dist/tools/zhipin-diagnose-browser-state.d.ts +4 -4
- package/dist/tools/zhipin-generate-reply-preview.d.ts +1 -1
- package/dist/tools/zhipin-get-candidate-info.d.ts +1 -1
- package/dist/tools/zhipin-scroll-view.d.ts +5 -5
- package/package.json +3 -3
- package/references/browser-exploration.md +52 -0
- package/references/env.yaml +11 -0
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ReadDocument } from "./task-progress.ts";
|
|
3
|
+
import type { BrowserAxSnapshot, NativeCdpController } from "@roll-agent/browser";
|
|
4
|
+
export declare const GoalRequiredSourceSchema: z.ZodEnum<["html", "aria", "label-required", "label-optional"]>;
|
|
5
|
+
export declare const GoalControlConstraintsSchema: z.ZodObject<{
|
|
6
|
+
min: z.ZodOptional<z.ZodString>;
|
|
7
|
+
max: z.ZodOptional<z.ZodString>;
|
|
8
|
+
step: z.ZodOptional<z.ZodString>;
|
|
9
|
+
minlength: z.ZodOptional<z.ZodString>;
|
|
10
|
+
maxlength: z.ZodOptional<z.ZodString>;
|
|
11
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
12
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
}, "strict", z.ZodTypeAny, {
|
|
14
|
+
multiple?: boolean | undefined;
|
|
15
|
+
pattern?: string | undefined;
|
|
16
|
+
min?: string | undefined;
|
|
17
|
+
max?: string | undefined;
|
|
18
|
+
step?: string | undefined;
|
|
19
|
+
minlength?: string | undefined;
|
|
20
|
+
maxlength?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
multiple?: boolean | undefined;
|
|
23
|
+
pattern?: string | undefined;
|
|
24
|
+
min?: string | undefined;
|
|
25
|
+
max?: string | undefined;
|
|
26
|
+
step?: string | undefined;
|
|
27
|
+
minlength?: string | undefined;
|
|
28
|
+
maxlength?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const GoalControlSchema: z.ZodObject<{
|
|
31
|
+
availability: z.ZodEnum<["ready", "offscreen", "covered", "hidden", "unavailable"]>;
|
|
32
|
+
editable: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
/** Fresh applied DOM readback can remain readable while pointer input is covered. */
|
|
34
|
+
readable: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
domSemantics: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
tag: z.ZodString;
|
|
37
|
+
role: z.ZodString;
|
|
38
|
+
disabled: z.ZodBoolean;
|
|
39
|
+
readOnly: z.ZodBoolean;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
role: string;
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
tag: string;
|
|
44
|
+
readOnly: boolean;
|
|
45
|
+
}, {
|
|
46
|
+
role: string;
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
tag: string;
|
|
49
|
+
readOnly: boolean;
|
|
50
|
+
}>>;
|
|
51
|
+
expanded: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
picker: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
part: z.ZodEnum<["trigger", "option"]>;
|
|
54
|
+
relationship: z.ZodEnum<["aria", "local-dom", "unknown"]>;
|
|
55
|
+
triggerPath: z.ZodOptional<z.ZodString>;
|
|
56
|
+
panelPaths: z.ZodArray<z.ZodString, "many">;
|
|
57
|
+
label: z.ZodOptional<z.ZodString>;
|
|
58
|
+
labelSource: z.ZodOptional<z.ZodEnum<["label", "placeholder", "empty-display"]>>;
|
|
59
|
+
expanded: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
panelVisible: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
selection: z.ZodEnum<["empty", "value", "unknown"]>;
|
|
62
|
+
selectionEvidence: z.ZodEnum<["native-select", "backing-input", "unknown"]>;
|
|
63
|
+
committedText: z.ZodOptional<z.ZodString>;
|
|
64
|
+
queryText: z.ZodOptional<z.ZodString>;
|
|
65
|
+
optionText: z.ZodOptional<z.ZodString>;
|
|
66
|
+
optionLabel: z.ZodOptional<z.ZodString>;
|
|
67
|
+
optionPath: z.ZodOptional<z.ZodString>;
|
|
68
|
+
optionSelected: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
selection: "value" | "unknown" | "empty";
|
|
71
|
+
part: "option" | "trigger";
|
|
72
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
73
|
+
panelPaths: string[];
|
|
74
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
75
|
+
label?: string | undefined;
|
|
76
|
+
expanded?: boolean | undefined;
|
|
77
|
+
triggerPath?: string | undefined;
|
|
78
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
79
|
+
panelVisible?: boolean | undefined;
|
|
80
|
+
committedText?: string | undefined;
|
|
81
|
+
queryText?: string | undefined;
|
|
82
|
+
optionText?: string | undefined;
|
|
83
|
+
optionLabel?: string | undefined;
|
|
84
|
+
optionPath?: string | undefined;
|
|
85
|
+
optionSelected?: boolean | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
selection: "value" | "unknown" | "empty";
|
|
88
|
+
part: "option" | "trigger";
|
|
89
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
90
|
+
panelPaths: string[];
|
|
91
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
92
|
+
label?: string | undefined;
|
|
93
|
+
expanded?: boolean | undefined;
|
|
94
|
+
triggerPath?: string | undefined;
|
|
95
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
96
|
+
panelVisible?: boolean | undefined;
|
|
97
|
+
committedText?: string | undefined;
|
|
98
|
+
queryText?: string | undefined;
|
|
99
|
+
optionText?: string | undefined;
|
|
100
|
+
optionLabel?: string | undefined;
|
|
101
|
+
optionPath?: string | undefined;
|
|
102
|
+
optionSelected?: boolean | undefined;
|
|
103
|
+
}>>;
|
|
104
|
+
htmlId: z.ZodOptional<z.ZodString>;
|
|
105
|
+
controlsIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
106
|
+
ancestorIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
107
|
+
ownerPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
108
|
+
ancestorPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
109
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
top: z.ZodNumber;
|
|
111
|
+
left: z.ZodNumber;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
left: number;
|
|
114
|
+
top: number;
|
|
115
|
+
}, {
|
|
116
|
+
left: number;
|
|
117
|
+
top: number;
|
|
118
|
+
}>>;
|
|
119
|
+
/** Nearest-first scrollable ancestor paths, including same-origin parent frames. */
|
|
120
|
+
scrollContainerPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
121
|
+
/** An edge overlay requires explicit scroll; native visibility reveal alone is insufficient. */
|
|
122
|
+
revealViaScroll: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
labelledByIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
124
|
+
fieldLabel: z.ZodOptional<z.ZodString>;
|
|
125
|
+
peerGroup: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
key: z.ZodString;
|
|
127
|
+
position: z.ZodNumber;
|
|
128
|
+
count: z.ZodNumber;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
count: number;
|
|
131
|
+
key: string;
|
|
132
|
+
position: number;
|
|
133
|
+
}, {
|
|
134
|
+
count: number;
|
|
135
|
+
key: string;
|
|
136
|
+
position: number;
|
|
137
|
+
}>>;
|
|
138
|
+
validationErrors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
139
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
requiredSource: z.ZodOptional<z.ZodEnum<["html", "aria", "label-required", "label-optional"]>>;
|
|
141
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
min: z.ZodOptional<z.ZodString>;
|
|
143
|
+
max: z.ZodOptional<z.ZodString>;
|
|
144
|
+
step: z.ZodOptional<z.ZodString>;
|
|
145
|
+
minlength: z.ZodOptional<z.ZodString>;
|
|
146
|
+
maxlength: z.ZodOptional<z.ZodString>;
|
|
147
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
148
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
}, "strict", z.ZodTypeAny, {
|
|
150
|
+
multiple?: boolean | undefined;
|
|
151
|
+
pattern?: string | undefined;
|
|
152
|
+
min?: string | undefined;
|
|
153
|
+
max?: string | undefined;
|
|
154
|
+
step?: string | undefined;
|
|
155
|
+
minlength?: string | undefined;
|
|
156
|
+
maxlength?: string | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
multiple?: boolean | undefined;
|
|
159
|
+
pattern?: string | undefined;
|
|
160
|
+
min?: string | undefined;
|
|
161
|
+
max?: string | undefined;
|
|
162
|
+
step?: string | undefined;
|
|
163
|
+
minlength?: string | undefined;
|
|
164
|
+
maxlength?: string | undefined;
|
|
165
|
+
}>>;
|
|
166
|
+
inputType: z.ZodOptional<z.ZodString>;
|
|
167
|
+
observedValue: z.ZodOptional<z.ZodString>;
|
|
168
|
+
actionValue: z.ZodOptional<z.ZodString>;
|
|
169
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
170
|
+
observedName: z.ZodOptional<z.ZodString>;
|
|
171
|
+
context: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
172
|
+
layer: z.ZodOptional<z.ZodString>;
|
|
173
|
+
layerKey: z.ZodOptional<z.ZodString>;
|
|
174
|
+
modal: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
checked: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"mixed">]>>;
|
|
176
|
+
nativeSelect: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
label: z.ZodString;
|
|
179
|
+
value: z.ZodString;
|
|
180
|
+
selected: z.ZodBoolean;
|
|
181
|
+
disabled: z.ZodBoolean;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
value: string;
|
|
184
|
+
label: string;
|
|
185
|
+
disabled: boolean;
|
|
186
|
+
selected: boolean;
|
|
187
|
+
}, {
|
|
188
|
+
value: string;
|
|
189
|
+
label: string;
|
|
190
|
+
disabled: boolean;
|
|
191
|
+
selected: boolean;
|
|
192
|
+
}>, "many">>;
|
|
193
|
+
optionsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
}, "strip", z.ZodTypeAny, {
|
|
195
|
+
context: string[];
|
|
196
|
+
editable: boolean;
|
|
197
|
+
availability: "hidden" | "ready" | "offscreen" | "covered" | "unavailable";
|
|
198
|
+
options?: {
|
|
199
|
+
value: string;
|
|
200
|
+
label: string;
|
|
201
|
+
disabled: boolean;
|
|
202
|
+
selected: boolean;
|
|
203
|
+
}[] | undefined;
|
|
204
|
+
checked?: boolean | "mixed" | undefined;
|
|
205
|
+
expanded?: boolean | undefined;
|
|
206
|
+
required?: boolean | undefined;
|
|
207
|
+
readable?: boolean | undefined;
|
|
208
|
+
domSemantics?: {
|
|
209
|
+
role: string;
|
|
210
|
+
disabled: boolean;
|
|
211
|
+
tag: string;
|
|
212
|
+
readOnly: boolean;
|
|
213
|
+
} | undefined;
|
|
214
|
+
picker?: {
|
|
215
|
+
selection: "value" | "unknown" | "empty";
|
|
216
|
+
part: "option" | "trigger";
|
|
217
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
218
|
+
panelPaths: string[];
|
|
219
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
220
|
+
label?: string | undefined;
|
|
221
|
+
expanded?: boolean | undefined;
|
|
222
|
+
triggerPath?: string | undefined;
|
|
223
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
224
|
+
panelVisible?: boolean | undefined;
|
|
225
|
+
committedText?: string | undefined;
|
|
226
|
+
queryText?: string | undefined;
|
|
227
|
+
optionText?: string | undefined;
|
|
228
|
+
optionLabel?: string | undefined;
|
|
229
|
+
optionPath?: string | undefined;
|
|
230
|
+
optionSelected?: boolean | undefined;
|
|
231
|
+
} | undefined;
|
|
232
|
+
htmlId?: string | undefined;
|
|
233
|
+
controlsIds?: string[] | undefined;
|
|
234
|
+
ancestorIds?: string[] | undefined;
|
|
235
|
+
ownerPaths?: string[] | undefined;
|
|
236
|
+
ancestorPaths?: string[] | undefined;
|
|
237
|
+
position?: {
|
|
238
|
+
left: number;
|
|
239
|
+
top: number;
|
|
240
|
+
} | undefined;
|
|
241
|
+
scrollContainerPaths?: string[] | undefined;
|
|
242
|
+
revealViaScroll?: boolean | undefined;
|
|
243
|
+
labelledByIds?: string[] | undefined;
|
|
244
|
+
fieldLabel?: string | undefined;
|
|
245
|
+
peerGroup?: {
|
|
246
|
+
count: number;
|
|
247
|
+
key: string;
|
|
248
|
+
position: number;
|
|
249
|
+
} | undefined;
|
|
250
|
+
validationErrors?: string[] | undefined;
|
|
251
|
+
requiredSource?: "html" | "aria" | "label-required" | "label-optional" | undefined;
|
|
252
|
+
constraints?: {
|
|
253
|
+
multiple?: boolean | undefined;
|
|
254
|
+
pattern?: string | undefined;
|
|
255
|
+
min?: string | undefined;
|
|
256
|
+
max?: string | undefined;
|
|
257
|
+
step?: string | undefined;
|
|
258
|
+
minlength?: string | undefined;
|
|
259
|
+
maxlength?: string | undefined;
|
|
260
|
+
} | undefined;
|
|
261
|
+
inputType?: string | undefined;
|
|
262
|
+
observedValue?: string | undefined;
|
|
263
|
+
actionValue?: string | undefined;
|
|
264
|
+
displayText?: string | undefined;
|
|
265
|
+
observedName?: string | undefined;
|
|
266
|
+
layer?: string | undefined;
|
|
267
|
+
layerKey?: string | undefined;
|
|
268
|
+
modal?: boolean | undefined;
|
|
269
|
+
nativeSelect?: boolean | undefined;
|
|
270
|
+
optionsTruncated?: boolean | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
availability: "hidden" | "ready" | "offscreen" | "covered" | "unavailable";
|
|
273
|
+
options?: {
|
|
274
|
+
value: string;
|
|
275
|
+
label: string;
|
|
276
|
+
disabled: boolean;
|
|
277
|
+
selected: boolean;
|
|
278
|
+
}[] | undefined;
|
|
279
|
+
context?: string[] | undefined;
|
|
280
|
+
editable?: boolean | undefined;
|
|
281
|
+
checked?: boolean | "mixed" | undefined;
|
|
282
|
+
expanded?: boolean | undefined;
|
|
283
|
+
required?: boolean | undefined;
|
|
284
|
+
readable?: boolean | undefined;
|
|
285
|
+
domSemantics?: {
|
|
286
|
+
role: string;
|
|
287
|
+
disabled: boolean;
|
|
288
|
+
tag: string;
|
|
289
|
+
readOnly: boolean;
|
|
290
|
+
} | undefined;
|
|
291
|
+
picker?: {
|
|
292
|
+
selection: "value" | "unknown" | "empty";
|
|
293
|
+
part: "option" | "trigger";
|
|
294
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
295
|
+
panelPaths: string[];
|
|
296
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
297
|
+
label?: string | undefined;
|
|
298
|
+
expanded?: boolean | undefined;
|
|
299
|
+
triggerPath?: string | undefined;
|
|
300
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
301
|
+
panelVisible?: boolean | undefined;
|
|
302
|
+
committedText?: string | undefined;
|
|
303
|
+
queryText?: string | undefined;
|
|
304
|
+
optionText?: string | undefined;
|
|
305
|
+
optionLabel?: string | undefined;
|
|
306
|
+
optionPath?: string | undefined;
|
|
307
|
+
optionSelected?: boolean | undefined;
|
|
308
|
+
} | undefined;
|
|
309
|
+
htmlId?: string | undefined;
|
|
310
|
+
controlsIds?: string[] | undefined;
|
|
311
|
+
ancestorIds?: string[] | undefined;
|
|
312
|
+
ownerPaths?: string[] | undefined;
|
|
313
|
+
ancestorPaths?: string[] | undefined;
|
|
314
|
+
position?: {
|
|
315
|
+
left: number;
|
|
316
|
+
top: number;
|
|
317
|
+
} | undefined;
|
|
318
|
+
scrollContainerPaths?: string[] | undefined;
|
|
319
|
+
revealViaScroll?: boolean | undefined;
|
|
320
|
+
labelledByIds?: string[] | undefined;
|
|
321
|
+
fieldLabel?: string | undefined;
|
|
322
|
+
peerGroup?: {
|
|
323
|
+
count: number;
|
|
324
|
+
key: string;
|
|
325
|
+
position: number;
|
|
326
|
+
} | undefined;
|
|
327
|
+
validationErrors?: string[] | undefined;
|
|
328
|
+
requiredSource?: "html" | "aria" | "label-required" | "label-optional" | undefined;
|
|
329
|
+
constraints?: {
|
|
330
|
+
multiple?: boolean | undefined;
|
|
331
|
+
pattern?: string | undefined;
|
|
332
|
+
min?: string | undefined;
|
|
333
|
+
max?: string | undefined;
|
|
334
|
+
step?: string | undefined;
|
|
335
|
+
minlength?: string | undefined;
|
|
336
|
+
maxlength?: string | undefined;
|
|
337
|
+
} | undefined;
|
|
338
|
+
inputType?: string | undefined;
|
|
339
|
+
observedValue?: string | undefined;
|
|
340
|
+
actionValue?: string | undefined;
|
|
341
|
+
displayText?: string | undefined;
|
|
342
|
+
observedName?: string | undefined;
|
|
343
|
+
layer?: string | undefined;
|
|
344
|
+
layerKey?: string | undefined;
|
|
345
|
+
modal?: boolean | undefined;
|
|
346
|
+
nativeSelect?: boolean | undefined;
|
|
347
|
+
optionsTruncated?: boolean | undefined;
|
|
348
|
+
}>;
|
|
349
|
+
export type GoalControl = z.infer<typeof GoalControlSchema>;
|
|
350
|
+
export declare const GoalDependencyControlSchema: z.ZodObject<{
|
|
351
|
+
ref: z.ZodObject<{
|
|
352
|
+
ref: z.ZodString;
|
|
353
|
+
backendNodeId: z.ZodOptional<z.ZodNumber>;
|
|
354
|
+
frameId: z.ZodOptional<z.ZodString>;
|
|
355
|
+
role: z.ZodString;
|
|
356
|
+
name: z.ZodString;
|
|
357
|
+
nth: z.ZodNumber;
|
|
358
|
+
disabled: z.ZodBoolean;
|
|
359
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
360
|
+
form: z.ZodOptional<z.ZodString>;
|
|
361
|
+
dialog: z.ZodOptional<z.ZodString>;
|
|
362
|
+
label: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, "strip", z.ZodTypeAny, {
|
|
364
|
+
form?: string | undefined;
|
|
365
|
+
dialog?: string | undefined;
|
|
366
|
+
label?: string | undefined;
|
|
367
|
+
}, {
|
|
368
|
+
form?: string | undefined;
|
|
369
|
+
dialog?: string | undefined;
|
|
370
|
+
label?: string | undefined;
|
|
371
|
+
}>>;
|
|
372
|
+
locator: z.ZodOptional<z.ZodObject<{
|
|
373
|
+
css: z.ZodOptional<z.ZodString>;
|
|
374
|
+
role: z.ZodOptional<z.ZodString>;
|
|
375
|
+
name: z.ZodOptional<z.ZodString>;
|
|
376
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
377
|
+
unique: z.ZodLiteral<true>;
|
|
378
|
+
}, "strip", z.ZodTypeAny, {
|
|
379
|
+
unique: true;
|
|
380
|
+
css?: string | undefined;
|
|
381
|
+
role?: string | undefined;
|
|
382
|
+
name?: string | undefined;
|
|
383
|
+
scope?: string | undefined;
|
|
384
|
+
}, {
|
|
385
|
+
unique: true;
|
|
386
|
+
css?: string | undefined;
|
|
387
|
+
role?: string | undefined;
|
|
388
|
+
name?: string | undefined;
|
|
389
|
+
scope?: string | undefined;
|
|
390
|
+
}>>;
|
|
391
|
+
strict: z.ZodOptional<z.ZodBoolean>;
|
|
392
|
+
}, "strip", z.ZodTypeAny, {
|
|
393
|
+
role: string;
|
|
394
|
+
name: string;
|
|
395
|
+
ref: string;
|
|
396
|
+
nth: number;
|
|
397
|
+
disabled: boolean;
|
|
398
|
+
backendNodeId?: number | undefined;
|
|
399
|
+
frameId?: string | undefined;
|
|
400
|
+
context?: {
|
|
401
|
+
form?: string | undefined;
|
|
402
|
+
dialog?: string | undefined;
|
|
403
|
+
label?: string | undefined;
|
|
404
|
+
} | undefined;
|
|
405
|
+
locator?: {
|
|
406
|
+
unique: true;
|
|
407
|
+
css?: string | undefined;
|
|
408
|
+
role?: string | undefined;
|
|
409
|
+
name?: string | undefined;
|
|
410
|
+
scope?: string | undefined;
|
|
411
|
+
} | undefined;
|
|
412
|
+
strict?: boolean | undefined;
|
|
413
|
+
}, {
|
|
414
|
+
role: string;
|
|
415
|
+
name: string;
|
|
416
|
+
ref: string;
|
|
417
|
+
nth: number;
|
|
418
|
+
disabled: boolean;
|
|
419
|
+
backendNodeId?: number | undefined;
|
|
420
|
+
frameId?: string | undefined;
|
|
421
|
+
context?: {
|
|
422
|
+
form?: string | undefined;
|
|
423
|
+
dialog?: string | undefined;
|
|
424
|
+
label?: string | undefined;
|
|
425
|
+
} | undefined;
|
|
426
|
+
locator?: {
|
|
427
|
+
unique: true;
|
|
428
|
+
css?: string | undefined;
|
|
429
|
+
role?: string | undefined;
|
|
430
|
+
name?: string | undefined;
|
|
431
|
+
scope?: string | undefined;
|
|
432
|
+
} | undefined;
|
|
433
|
+
strict?: boolean | undefined;
|
|
434
|
+
}>;
|
|
435
|
+
control: z.ZodObject<{
|
|
436
|
+
availability: z.ZodEnum<["ready", "offscreen", "covered", "hidden", "unavailable"]>;
|
|
437
|
+
editable: z.ZodDefault<z.ZodBoolean>;
|
|
438
|
+
/** Fresh applied DOM readback can remain readable while pointer input is covered. */
|
|
439
|
+
readable: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
+
domSemantics: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
tag: z.ZodString;
|
|
442
|
+
role: z.ZodString;
|
|
443
|
+
disabled: z.ZodBoolean;
|
|
444
|
+
readOnly: z.ZodBoolean;
|
|
445
|
+
}, "strip", z.ZodTypeAny, {
|
|
446
|
+
role: string;
|
|
447
|
+
disabled: boolean;
|
|
448
|
+
tag: string;
|
|
449
|
+
readOnly: boolean;
|
|
450
|
+
}, {
|
|
451
|
+
role: string;
|
|
452
|
+
disabled: boolean;
|
|
453
|
+
tag: string;
|
|
454
|
+
readOnly: boolean;
|
|
455
|
+
}>>;
|
|
456
|
+
expanded: z.ZodOptional<z.ZodBoolean>;
|
|
457
|
+
picker: z.ZodOptional<z.ZodObject<{
|
|
458
|
+
part: z.ZodEnum<["trigger", "option"]>;
|
|
459
|
+
relationship: z.ZodEnum<["aria", "local-dom", "unknown"]>;
|
|
460
|
+
triggerPath: z.ZodOptional<z.ZodString>;
|
|
461
|
+
panelPaths: z.ZodArray<z.ZodString, "many">;
|
|
462
|
+
label: z.ZodOptional<z.ZodString>;
|
|
463
|
+
labelSource: z.ZodOptional<z.ZodEnum<["label", "placeholder", "empty-display"]>>;
|
|
464
|
+
expanded: z.ZodOptional<z.ZodBoolean>;
|
|
465
|
+
panelVisible: z.ZodOptional<z.ZodBoolean>;
|
|
466
|
+
selection: z.ZodEnum<["empty", "value", "unknown"]>;
|
|
467
|
+
selectionEvidence: z.ZodEnum<["native-select", "backing-input", "unknown"]>;
|
|
468
|
+
committedText: z.ZodOptional<z.ZodString>;
|
|
469
|
+
queryText: z.ZodOptional<z.ZodString>;
|
|
470
|
+
optionText: z.ZodOptional<z.ZodString>;
|
|
471
|
+
optionLabel: z.ZodOptional<z.ZodString>;
|
|
472
|
+
optionPath: z.ZodOptional<z.ZodString>;
|
|
473
|
+
optionSelected: z.ZodOptional<z.ZodBoolean>;
|
|
474
|
+
}, "strip", z.ZodTypeAny, {
|
|
475
|
+
selection: "value" | "unknown" | "empty";
|
|
476
|
+
part: "option" | "trigger";
|
|
477
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
478
|
+
panelPaths: string[];
|
|
479
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
480
|
+
label?: string | undefined;
|
|
481
|
+
expanded?: boolean | undefined;
|
|
482
|
+
triggerPath?: string | undefined;
|
|
483
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
484
|
+
panelVisible?: boolean | undefined;
|
|
485
|
+
committedText?: string | undefined;
|
|
486
|
+
queryText?: string | undefined;
|
|
487
|
+
optionText?: string | undefined;
|
|
488
|
+
optionLabel?: string | undefined;
|
|
489
|
+
optionPath?: string | undefined;
|
|
490
|
+
optionSelected?: boolean | undefined;
|
|
491
|
+
}, {
|
|
492
|
+
selection: "value" | "unknown" | "empty";
|
|
493
|
+
part: "option" | "trigger";
|
|
494
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
495
|
+
panelPaths: string[];
|
|
496
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
497
|
+
label?: string | undefined;
|
|
498
|
+
expanded?: boolean | undefined;
|
|
499
|
+
triggerPath?: string | undefined;
|
|
500
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
501
|
+
panelVisible?: boolean | undefined;
|
|
502
|
+
committedText?: string | undefined;
|
|
503
|
+
queryText?: string | undefined;
|
|
504
|
+
optionText?: string | undefined;
|
|
505
|
+
optionLabel?: string | undefined;
|
|
506
|
+
optionPath?: string | undefined;
|
|
507
|
+
optionSelected?: boolean | undefined;
|
|
508
|
+
}>>;
|
|
509
|
+
htmlId: z.ZodOptional<z.ZodString>;
|
|
510
|
+
controlsIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
511
|
+
ancestorIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
512
|
+
ownerPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
513
|
+
ancestorPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
514
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
515
|
+
top: z.ZodNumber;
|
|
516
|
+
left: z.ZodNumber;
|
|
517
|
+
}, "strip", z.ZodTypeAny, {
|
|
518
|
+
left: number;
|
|
519
|
+
top: number;
|
|
520
|
+
}, {
|
|
521
|
+
left: number;
|
|
522
|
+
top: number;
|
|
523
|
+
}>>;
|
|
524
|
+
/** Nearest-first scrollable ancestor paths, including same-origin parent frames. */
|
|
525
|
+
scrollContainerPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
526
|
+
/** An edge overlay requires explicit scroll; native visibility reveal alone is insufficient. */
|
|
527
|
+
revealViaScroll: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
+
labelledByIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
529
|
+
fieldLabel: z.ZodOptional<z.ZodString>;
|
|
530
|
+
peerGroup: z.ZodOptional<z.ZodObject<{
|
|
531
|
+
key: z.ZodString;
|
|
532
|
+
position: z.ZodNumber;
|
|
533
|
+
count: z.ZodNumber;
|
|
534
|
+
}, "strip", z.ZodTypeAny, {
|
|
535
|
+
count: number;
|
|
536
|
+
key: string;
|
|
537
|
+
position: number;
|
|
538
|
+
}, {
|
|
539
|
+
count: number;
|
|
540
|
+
key: string;
|
|
541
|
+
position: number;
|
|
542
|
+
}>>;
|
|
543
|
+
validationErrors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
544
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
545
|
+
requiredSource: z.ZodOptional<z.ZodEnum<["html", "aria", "label-required", "label-optional"]>>;
|
|
546
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
547
|
+
min: z.ZodOptional<z.ZodString>;
|
|
548
|
+
max: z.ZodOptional<z.ZodString>;
|
|
549
|
+
step: z.ZodOptional<z.ZodString>;
|
|
550
|
+
minlength: z.ZodOptional<z.ZodString>;
|
|
551
|
+
maxlength: z.ZodOptional<z.ZodString>;
|
|
552
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
553
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
554
|
+
}, "strict", z.ZodTypeAny, {
|
|
555
|
+
multiple?: boolean | undefined;
|
|
556
|
+
pattern?: string | undefined;
|
|
557
|
+
min?: string | undefined;
|
|
558
|
+
max?: string | undefined;
|
|
559
|
+
step?: string | undefined;
|
|
560
|
+
minlength?: string | undefined;
|
|
561
|
+
maxlength?: string | undefined;
|
|
562
|
+
}, {
|
|
563
|
+
multiple?: boolean | undefined;
|
|
564
|
+
pattern?: string | undefined;
|
|
565
|
+
min?: string | undefined;
|
|
566
|
+
max?: string | undefined;
|
|
567
|
+
step?: string | undefined;
|
|
568
|
+
minlength?: string | undefined;
|
|
569
|
+
maxlength?: string | undefined;
|
|
570
|
+
}>>;
|
|
571
|
+
inputType: z.ZodOptional<z.ZodString>;
|
|
572
|
+
observedValue: z.ZodOptional<z.ZodString>;
|
|
573
|
+
actionValue: z.ZodOptional<z.ZodString>;
|
|
574
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
575
|
+
observedName: z.ZodOptional<z.ZodString>;
|
|
576
|
+
context: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
577
|
+
layer: z.ZodOptional<z.ZodString>;
|
|
578
|
+
layerKey: z.ZodOptional<z.ZodString>;
|
|
579
|
+
modal: z.ZodOptional<z.ZodBoolean>;
|
|
580
|
+
checked: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"mixed">]>>;
|
|
581
|
+
nativeSelect: z.ZodOptional<z.ZodBoolean>;
|
|
582
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
583
|
+
label: z.ZodString;
|
|
584
|
+
value: z.ZodString;
|
|
585
|
+
selected: z.ZodBoolean;
|
|
586
|
+
disabled: z.ZodBoolean;
|
|
587
|
+
}, "strip", z.ZodTypeAny, {
|
|
588
|
+
value: string;
|
|
589
|
+
label: string;
|
|
590
|
+
disabled: boolean;
|
|
591
|
+
selected: boolean;
|
|
592
|
+
}, {
|
|
593
|
+
value: string;
|
|
594
|
+
label: string;
|
|
595
|
+
disabled: boolean;
|
|
596
|
+
selected: boolean;
|
|
597
|
+
}>, "many">>;
|
|
598
|
+
optionsTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
599
|
+
}, "strip", z.ZodTypeAny, {
|
|
600
|
+
context: string[];
|
|
601
|
+
editable: boolean;
|
|
602
|
+
availability: "hidden" | "ready" | "offscreen" | "covered" | "unavailable";
|
|
603
|
+
options?: {
|
|
604
|
+
value: string;
|
|
605
|
+
label: string;
|
|
606
|
+
disabled: boolean;
|
|
607
|
+
selected: boolean;
|
|
608
|
+
}[] | undefined;
|
|
609
|
+
checked?: boolean | "mixed" | undefined;
|
|
610
|
+
expanded?: boolean | undefined;
|
|
611
|
+
required?: boolean | undefined;
|
|
612
|
+
readable?: boolean | undefined;
|
|
613
|
+
domSemantics?: {
|
|
614
|
+
role: string;
|
|
615
|
+
disabled: boolean;
|
|
616
|
+
tag: string;
|
|
617
|
+
readOnly: boolean;
|
|
618
|
+
} | undefined;
|
|
619
|
+
picker?: {
|
|
620
|
+
selection: "value" | "unknown" | "empty";
|
|
621
|
+
part: "option" | "trigger";
|
|
622
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
623
|
+
panelPaths: string[];
|
|
624
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
625
|
+
label?: string | undefined;
|
|
626
|
+
expanded?: boolean | undefined;
|
|
627
|
+
triggerPath?: string | undefined;
|
|
628
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
629
|
+
panelVisible?: boolean | undefined;
|
|
630
|
+
committedText?: string | undefined;
|
|
631
|
+
queryText?: string | undefined;
|
|
632
|
+
optionText?: string | undefined;
|
|
633
|
+
optionLabel?: string | undefined;
|
|
634
|
+
optionPath?: string | undefined;
|
|
635
|
+
optionSelected?: boolean | undefined;
|
|
636
|
+
} | undefined;
|
|
637
|
+
htmlId?: string | undefined;
|
|
638
|
+
controlsIds?: string[] | undefined;
|
|
639
|
+
ancestorIds?: string[] | undefined;
|
|
640
|
+
ownerPaths?: string[] | undefined;
|
|
641
|
+
ancestorPaths?: string[] | undefined;
|
|
642
|
+
position?: {
|
|
643
|
+
left: number;
|
|
644
|
+
top: number;
|
|
645
|
+
} | undefined;
|
|
646
|
+
scrollContainerPaths?: string[] | undefined;
|
|
647
|
+
revealViaScroll?: boolean | undefined;
|
|
648
|
+
labelledByIds?: string[] | undefined;
|
|
649
|
+
fieldLabel?: string | undefined;
|
|
650
|
+
peerGroup?: {
|
|
651
|
+
count: number;
|
|
652
|
+
key: string;
|
|
653
|
+
position: number;
|
|
654
|
+
} | undefined;
|
|
655
|
+
validationErrors?: string[] | undefined;
|
|
656
|
+
requiredSource?: "html" | "aria" | "label-required" | "label-optional" | undefined;
|
|
657
|
+
constraints?: {
|
|
658
|
+
multiple?: boolean | undefined;
|
|
659
|
+
pattern?: string | undefined;
|
|
660
|
+
min?: string | undefined;
|
|
661
|
+
max?: string | undefined;
|
|
662
|
+
step?: string | undefined;
|
|
663
|
+
minlength?: string | undefined;
|
|
664
|
+
maxlength?: string | undefined;
|
|
665
|
+
} | undefined;
|
|
666
|
+
inputType?: string | undefined;
|
|
667
|
+
observedValue?: string | undefined;
|
|
668
|
+
actionValue?: string | undefined;
|
|
669
|
+
displayText?: string | undefined;
|
|
670
|
+
observedName?: string | undefined;
|
|
671
|
+
layer?: string | undefined;
|
|
672
|
+
layerKey?: string | undefined;
|
|
673
|
+
modal?: boolean | undefined;
|
|
674
|
+
nativeSelect?: boolean | undefined;
|
|
675
|
+
optionsTruncated?: boolean | undefined;
|
|
676
|
+
}, {
|
|
677
|
+
availability: "hidden" | "ready" | "offscreen" | "covered" | "unavailable";
|
|
678
|
+
options?: {
|
|
679
|
+
value: string;
|
|
680
|
+
label: string;
|
|
681
|
+
disabled: boolean;
|
|
682
|
+
selected: boolean;
|
|
683
|
+
}[] | undefined;
|
|
684
|
+
context?: string[] | undefined;
|
|
685
|
+
editable?: boolean | undefined;
|
|
686
|
+
checked?: boolean | "mixed" | undefined;
|
|
687
|
+
expanded?: boolean | undefined;
|
|
688
|
+
required?: boolean | undefined;
|
|
689
|
+
readable?: boolean | undefined;
|
|
690
|
+
domSemantics?: {
|
|
691
|
+
role: string;
|
|
692
|
+
disabled: boolean;
|
|
693
|
+
tag: string;
|
|
694
|
+
readOnly: boolean;
|
|
695
|
+
} | undefined;
|
|
696
|
+
picker?: {
|
|
697
|
+
selection: "value" | "unknown" | "empty";
|
|
698
|
+
part: "option" | "trigger";
|
|
699
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
700
|
+
panelPaths: string[];
|
|
701
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
702
|
+
label?: string | undefined;
|
|
703
|
+
expanded?: boolean | undefined;
|
|
704
|
+
triggerPath?: string | undefined;
|
|
705
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
706
|
+
panelVisible?: boolean | undefined;
|
|
707
|
+
committedText?: string | undefined;
|
|
708
|
+
queryText?: string | undefined;
|
|
709
|
+
optionText?: string | undefined;
|
|
710
|
+
optionLabel?: string | undefined;
|
|
711
|
+
optionPath?: string | undefined;
|
|
712
|
+
optionSelected?: boolean | undefined;
|
|
713
|
+
} | undefined;
|
|
714
|
+
htmlId?: string | undefined;
|
|
715
|
+
controlsIds?: string[] | undefined;
|
|
716
|
+
ancestorIds?: string[] | undefined;
|
|
717
|
+
ownerPaths?: string[] | undefined;
|
|
718
|
+
ancestorPaths?: string[] | undefined;
|
|
719
|
+
position?: {
|
|
720
|
+
left: number;
|
|
721
|
+
top: number;
|
|
722
|
+
} | undefined;
|
|
723
|
+
scrollContainerPaths?: string[] | undefined;
|
|
724
|
+
revealViaScroll?: boolean | undefined;
|
|
725
|
+
labelledByIds?: string[] | undefined;
|
|
726
|
+
fieldLabel?: string | undefined;
|
|
727
|
+
peerGroup?: {
|
|
728
|
+
count: number;
|
|
729
|
+
key: string;
|
|
730
|
+
position: number;
|
|
731
|
+
} | undefined;
|
|
732
|
+
validationErrors?: string[] | undefined;
|
|
733
|
+
requiredSource?: "html" | "aria" | "label-required" | "label-optional" | undefined;
|
|
734
|
+
constraints?: {
|
|
735
|
+
multiple?: boolean | undefined;
|
|
736
|
+
pattern?: string | undefined;
|
|
737
|
+
min?: string | undefined;
|
|
738
|
+
max?: string | undefined;
|
|
739
|
+
step?: string | undefined;
|
|
740
|
+
minlength?: string | undefined;
|
|
741
|
+
maxlength?: string | undefined;
|
|
742
|
+
} | undefined;
|
|
743
|
+
inputType?: string | undefined;
|
|
744
|
+
observedValue?: string | undefined;
|
|
745
|
+
actionValue?: string | undefined;
|
|
746
|
+
displayText?: string | undefined;
|
|
747
|
+
observedName?: string | undefined;
|
|
748
|
+
layer?: string | undefined;
|
|
749
|
+
layerKey?: string | undefined;
|
|
750
|
+
modal?: boolean | undefined;
|
|
751
|
+
nativeSelect?: boolean | undefined;
|
|
752
|
+
optionsTruncated?: boolean | undefined;
|
|
753
|
+
}>;
|
|
754
|
+
}, "strip", z.ZodTypeAny, {
|
|
755
|
+
ref: {
|
|
756
|
+
role: string;
|
|
757
|
+
name: string;
|
|
758
|
+
ref: string;
|
|
759
|
+
nth: number;
|
|
760
|
+
disabled: boolean;
|
|
761
|
+
backendNodeId?: number | undefined;
|
|
762
|
+
frameId?: string | undefined;
|
|
763
|
+
context?: {
|
|
764
|
+
form?: string | undefined;
|
|
765
|
+
dialog?: string | undefined;
|
|
766
|
+
label?: string | undefined;
|
|
767
|
+
} | undefined;
|
|
768
|
+
locator?: {
|
|
769
|
+
unique: true;
|
|
770
|
+
css?: string | undefined;
|
|
771
|
+
role?: string | undefined;
|
|
772
|
+
name?: string | undefined;
|
|
773
|
+
scope?: string | undefined;
|
|
774
|
+
} | undefined;
|
|
775
|
+
strict?: boolean | undefined;
|
|
776
|
+
};
|
|
777
|
+
control: {
|
|
778
|
+
context: string[];
|
|
779
|
+
editable: boolean;
|
|
780
|
+
availability: "hidden" | "ready" | "offscreen" | "covered" | "unavailable";
|
|
781
|
+
options?: {
|
|
782
|
+
value: string;
|
|
783
|
+
label: string;
|
|
784
|
+
disabled: boolean;
|
|
785
|
+
selected: boolean;
|
|
786
|
+
}[] | undefined;
|
|
787
|
+
checked?: boolean | "mixed" | undefined;
|
|
788
|
+
expanded?: boolean | undefined;
|
|
789
|
+
required?: boolean | undefined;
|
|
790
|
+
readable?: boolean | undefined;
|
|
791
|
+
domSemantics?: {
|
|
792
|
+
role: string;
|
|
793
|
+
disabled: boolean;
|
|
794
|
+
tag: string;
|
|
795
|
+
readOnly: boolean;
|
|
796
|
+
} | undefined;
|
|
797
|
+
picker?: {
|
|
798
|
+
selection: "value" | "unknown" | "empty";
|
|
799
|
+
part: "option" | "trigger";
|
|
800
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
801
|
+
panelPaths: string[];
|
|
802
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
803
|
+
label?: string | undefined;
|
|
804
|
+
expanded?: boolean | undefined;
|
|
805
|
+
triggerPath?: string | undefined;
|
|
806
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
807
|
+
panelVisible?: boolean | undefined;
|
|
808
|
+
committedText?: string | undefined;
|
|
809
|
+
queryText?: string | undefined;
|
|
810
|
+
optionText?: string | undefined;
|
|
811
|
+
optionLabel?: string | undefined;
|
|
812
|
+
optionPath?: string | undefined;
|
|
813
|
+
optionSelected?: boolean | undefined;
|
|
814
|
+
} | undefined;
|
|
815
|
+
htmlId?: string | undefined;
|
|
816
|
+
controlsIds?: string[] | undefined;
|
|
817
|
+
ancestorIds?: string[] | undefined;
|
|
818
|
+
ownerPaths?: string[] | undefined;
|
|
819
|
+
ancestorPaths?: string[] | undefined;
|
|
820
|
+
position?: {
|
|
821
|
+
left: number;
|
|
822
|
+
top: number;
|
|
823
|
+
} | undefined;
|
|
824
|
+
scrollContainerPaths?: string[] | undefined;
|
|
825
|
+
revealViaScroll?: boolean | undefined;
|
|
826
|
+
labelledByIds?: string[] | undefined;
|
|
827
|
+
fieldLabel?: string | undefined;
|
|
828
|
+
peerGroup?: {
|
|
829
|
+
count: number;
|
|
830
|
+
key: string;
|
|
831
|
+
position: number;
|
|
832
|
+
} | undefined;
|
|
833
|
+
validationErrors?: string[] | undefined;
|
|
834
|
+
requiredSource?: "html" | "aria" | "label-required" | "label-optional" | undefined;
|
|
835
|
+
constraints?: {
|
|
836
|
+
multiple?: boolean | undefined;
|
|
837
|
+
pattern?: string | undefined;
|
|
838
|
+
min?: string | undefined;
|
|
839
|
+
max?: string | undefined;
|
|
840
|
+
step?: string | undefined;
|
|
841
|
+
minlength?: string | undefined;
|
|
842
|
+
maxlength?: string | undefined;
|
|
843
|
+
} | undefined;
|
|
844
|
+
inputType?: string | undefined;
|
|
845
|
+
observedValue?: string | undefined;
|
|
846
|
+
actionValue?: string | undefined;
|
|
847
|
+
displayText?: string | undefined;
|
|
848
|
+
observedName?: string | undefined;
|
|
849
|
+
layer?: string | undefined;
|
|
850
|
+
layerKey?: string | undefined;
|
|
851
|
+
modal?: boolean | undefined;
|
|
852
|
+
nativeSelect?: boolean | undefined;
|
|
853
|
+
optionsTruncated?: boolean | undefined;
|
|
854
|
+
};
|
|
855
|
+
}, {
|
|
856
|
+
ref: {
|
|
857
|
+
role: string;
|
|
858
|
+
name: string;
|
|
859
|
+
ref: string;
|
|
860
|
+
nth: number;
|
|
861
|
+
disabled: boolean;
|
|
862
|
+
backendNodeId?: number | undefined;
|
|
863
|
+
frameId?: string | undefined;
|
|
864
|
+
context?: {
|
|
865
|
+
form?: string | undefined;
|
|
866
|
+
dialog?: string | undefined;
|
|
867
|
+
label?: string | undefined;
|
|
868
|
+
} | undefined;
|
|
869
|
+
locator?: {
|
|
870
|
+
unique: true;
|
|
871
|
+
css?: string | undefined;
|
|
872
|
+
role?: string | undefined;
|
|
873
|
+
name?: string | undefined;
|
|
874
|
+
scope?: string | undefined;
|
|
875
|
+
} | undefined;
|
|
876
|
+
strict?: boolean | undefined;
|
|
877
|
+
};
|
|
878
|
+
control: {
|
|
879
|
+
availability: "hidden" | "ready" | "offscreen" | "covered" | "unavailable";
|
|
880
|
+
options?: {
|
|
881
|
+
value: string;
|
|
882
|
+
label: string;
|
|
883
|
+
disabled: boolean;
|
|
884
|
+
selected: boolean;
|
|
885
|
+
}[] | undefined;
|
|
886
|
+
context?: string[] | undefined;
|
|
887
|
+
editable?: boolean | undefined;
|
|
888
|
+
checked?: boolean | "mixed" | undefined;
|
|
889
|
+
expanded?: boolean | undefined;
|
|
890
|
+
required?: boolean | undefined;
|
|
891
|
+
readable?: boolean | undefined;
|
|
892
|
+
domSemantics?: {
|
|
893
|
+
role: string;
|
|
894
|
+
disabled: boolean;
|
|
895
|
+
tag: string;
|
|
896
|
+
readOnly: boolean;
|
|
897
|
+
} | undefined;
|
|
898
|
+
picker?: {
|
|
899
|
+
selection: "value" | "unknown" | "empty";
|
|
900
|
+
part: "option" | "trigger";
|
|
901
|
+
relationship: "unknown" | "aria" | "local-dom";
|
|
902
|
+
panelPaths: string[];
|
|
903
|
+
selectionEvidence: "unknown" | "native-select" | "backing-input";
|
|
904
|
+
label?: string | undefined;
|
|
905
|
+
expanded?: boolean | undefined;
|
|
906
|
+
triggerPath?: string | undefined;
|
|
907
|
+
labelSource?: "label" | "placeholder" | "empty-display" | undefined;
|
|
908
|
+
panelVisible?: boolean | undefined;
|
|
909
|
+
committedText?: string | undefined;
|
|
910
|
+
queryText?: string | undefined;
|
|
911
|
+
optionText?: string | undefined;
|
|
912
|
+
optionLabel?: string | undefined;
|
|
913
|
+
optionPath?: string | undefined;
|
|
914
|
+
optionSelected?: boolean | undefined;
|
|
915
|
+
} | undefined;
|
|
916
|
+
htmlId?: string | undefined;
|
|
917
|
+
controlsIds?: string[] | undefined;
|
|
918
|
+
ancestorIds?: string[] | undefined;
|
|
919
|
+
ownerPaths?: string[] | undefined;
|
|
920
|
+
ancestorPaths?: string[] | undefined;
|
|
921
|
+
position?: {
|
|
922
|
+
left: number;
|
|
923
|
+
top: number;
|
|
924
|
+
} | undefined;
|
|
925
|
+
scrollContainerPaths?: string[] | undefined;
|
|
926
|
+
revealViaScroll?: boolean | undefined;
|
|
927
|
+
labelledByIds?: string[] | undefined;
|
|
928
|
+
fieldLabel?: string | undefined;
|
|
929
|
+
peerGroup?: {
|
|
930
|
+
count: number;
|
|
931
|
+
key: string;
|
|
932
|
+
position: number;
|
|
933
|
+
} | undefined;
|
|
934
|
+
validationErrors?: string[] | undefined;
|
|
935
|
+
requiredSource?: "html" | "aria" | "label-required" | "label-optional" | undefined;
|
|
936
|
+
constraints?: {
|
|
937
|
+
multiple?: boolean | undefined;
|
|
938
|
+
pattern?: string | undefined;
|
|
939
|
+
min?: string | undefined;
|
|
940
|
+
max?: string | undefined;
|
|
941
|
+
step?: string | undefined;
|
|
942
|
+
minlength?: string | undefined;
|
|
943
|
+
maxlength?: string | undefined;
|
|
944
|
+
} | undefined;
|
|
945
|
+
inputType?: string | undefined;
|
|
946
|
+
observedValue?: string | undefined;
|
|
947
|
+
actionValue?: string | undefined;
|
|
948
|
+
displayText?: string | undefined;
|
|
949
|
+
observedName?: string | undefined;
|
|
950
|
+
layer?: string | undefined;
|
|
951
|
+
layerKey?: string | undefined;
|
|
952
|
+
modal?: boolean | undefined;
|
|
953
|
+
nativeSelect?: boolean | undefined;
|
|
954
|
+
optionsTruncated?: boolean | undefined;
|
|
955
|
+
};
|
|
956
|
+
}>;
|
|
957
|
+
export type GoalDependencyControl = z.infer<typeof GoalDependencyControlSchema>;
|
|
958
|
+
export declare const GoalPageStateSchema: z.ZodObject<{
|
|
959
|
+
panels: z.ZodArray<z.ZodString, "many">;
|
|
960
|
+
selectedTabs: z.ZodArray<z.ZodString, "many">;
|
|
961
|
+
busy: z.ZodBoolean;
|
|
962
|
+
}, "strip", z.ZodTypeAny, {
|
|
963
|
+
panels: string[];
|
|
964
|
+
selectedTabs: string[];
|
|
965
|
+
busy: boolean;
|
|
966
|
+
}, {
|
|
967
|
+
panels: string[];
|
|
968
|
+
selectedTabs: string[];
|
|
969
|
+
busy: boolean;
|
|
970
|
+
}>;
|
|
971
|
+
export type GoalSnapshot = BrowserAxSnapshot & {
|
|
972
|
+
readDocuments?: ReadDocument[];
|
|
973
|
+
pageState?: z.infer<typeof GoalPageStateSchema>;
|
|
974
|
+
/** Fresh read-only evidence for modal-hidden dependencies; never actionable refs. */
|
|
975
|
+
dependencyControls?: Record<string, GoalDependencyControl>;
|
|
976
|
+
controls?: Record<string, GoalControl>;
|
|
977
|
+
pageText?: string;
|
|
978
|
+
pageTextTruncated?: boolean;
|
|
979
|
+
};
|
|
980
|
+
export declare const INSPECT_GOAL_CONTROL = "function(origins) {\n const el=this, doc=el.ownerDocument, view=doc && doc.defaultView;\n if (!doc || !view || !origins.includes(view.location.origin)) return {availability:'unavailable'};\n if (el.nodeType!==1 || !el.isConnected) return {availability:'unavailable'};\n const r=el.getBoundingClientRect(), style=view.getComputedStyle(el);\n if (!r.width || !r.height || style.display==='none' || style.visibility!=='visible' || style.opacity==='0' || el.closest('[inert]')) return {availability:'hidden'};\n const {availability,revealViaScroll}=(function(el,origins) {\n let revealViaScroll=false;\n const result=(availability)=>({availability,...(availability==='offscreen' && revealViaScroll?{revealViaScroll:true}:{})});\n const transformed=s=>s.transform!=='none' || s.perspective!=='none' || (s.translate && s.translate!=='none') || (s.rotate && s.rotate!=='none') || (s.scale && s.scale!=='none') || (s.zoom && s.zoom!=='normal' && Number(s.zoom)!==1);\n const layer=(node,view)=>{for(let p=node;p;p=p.parentElement){if(p.matches('dialog[open],[role=\"dialog\"],[aria-modal=\"true\"]'))return p;const s=view.getComputedStyle(p);if(s.position==='fixed' || s.position==='sticky')return p;}return null;};\n const modal=node=>node && (node.matches('dialog[open],[role=\"dialog\"],[aria-modal=\"true\"]') || Boolean(node.closest('dialog[open],[role=\"dialog\"],[aria-modal=\"true\"]')));\n const edgeLayer=(cover,ownLayer,view)=>{\n if(!cover || cover===ownLayer || modal(cover))return false;\n const cr=cover.getBoundingClientRect();\n return (cr.height<view.innerHeight/2 && (cr.top<=1 || cr.bottom>=view.innerHeight-1)) || (cr.width<view.innerWidth/2 && (cr.left<=1 || cr.right>=view.innerWidth-1));\n };\n const bounds=(node)=>{const r=node.getBoundingClientRect();return {left:r.left+node.clientLeft,top:r.top+node.clientTop,right:r.left+node.clientLeft+node.clientWidth,bottom:r.top+node.clientTop+node.clientHeight};};\n const room=(node,axis,direction)=>{const offset=axis==='x'?node.scrollLeft:node.scrollTop,max=axis==='x'?node.scrollWidth-node.clientWidth:node.scrollHeight-node.clientHeight;return direction<0?offset>1:offset<max-1;};\n try {\n let view=el.ownerDocument.defaultView,node=el;\n if(!view || !origins.includes(view.location.origin))return result('unavailable');\n const r=el.getBoundingClientRect();let point={x:r.left+r.width/2,y:r.top+r.height/2},reveal=false;\n for(let depth=0;depth<33;depth++){\n if(depth===32 || !origins.includes(view.location.origin))return result('unavailable');\n const doc=node.ownerDocument,root=doc.scrollingElement,ownLayer=layer(node,view);\n const activeModal=[...doc.querySelectorAll('dialog[open],[aria-modal=\"true\"]')].find(p=>{const s=view.getComputedStyle(p);return p.getClientRects().length && s.display!=='none' && s.visibility==='visible' && s.opacity!=='0' && !p.contains(node);});\n if(activeModal)return result('covered');\n const viewport={left:0,top:0,right:view.innerWidth,bottom:view.innerHeight};\n let scope=node,visible={...viewport},localReveal=false;\n const movable=[];\n for(let p=node;p;p=p.parentElement){\n const s=view.getComputedStyle(p);\n if(transformed(s))return result('unavailable');\n if(s.display==='none' || s.visibility!=='visible' || s.opacity==='0' || p.hasAttribute('inert'))return result('covered');\n if(p===node || p===root || p===doc.body)continue;\n const b=bounds(p);\n const axes=[['x','overflowX','left','right'],['y','overflowY','top','bottom']];\n for(const [axis,overflow,low,high] of axes){\n if(!/^(auto|scroll|hidden|clip)$/.test(s[overflow]))continue;\n const scrollable=/^(auto|scroll)$/.test(s[overflow]);\n if(scrollable)movable.push({node:p,axis,b});\n if(point[axis]<b[low] || point[axis]>=b[high]){\n if(!scrollable || !room(p,axis,point[axis]<b[low]?-1:1))return result('covered');\n point[axis]=Math.max(b[low]+1,Math.min(b[high]-2,point[axis]));scope=p;localReveal=true;visible={left:Math.max(0,b.left),top:Math.max(0,b.top),right:Math.min(view.innerWidth,b.right),bottom:Math.min(view.innerHeight,b.bottom)};\n }\n visible[low]=Math.max(visible[low],b[low]);visible[high]=Math.min(visible[high],b[high]);\n }\n }\n const rootStyle=root && view.getComputedStyle(root),bodyStyle=doc.body && view.getComputedStyle(doc.body);\n for(const [axis,overflow,low,high] of [['x','overflowX','left','right'],['y','overflowY','top','bottom']]){\n const scrollable=root && !ownLayer && ![rootStyle?.[overflow],bodyStyle?.[overflow]].some(value=>value==='hidden' || value==='clip');\n if(scrollable)movable.push({node:root,axis,b:viewport});\n if(point[axis]<viewport[low] || point[axis]>=viewport[high]){\n if(!scrollable || !room(root,axis,point[axis]<viewport[low]?-1:1))return result('covered');\n point[axis]=Math.max(viewport[low]+1,Math.min(viewport[high]-2,point[axis]));scope=root;localReveal=true;visible={...viewport};\n }\n }\n const same=(hit)=>hit && (hit===node || node.contains(hit));\n const exposed=(hit,container)=>{\n if(!hit || !(hit===container || container.contains(hit)))return false;\n const hitLayer=layer(hit,view);\n return !hitLayer || hitLayer===ownLayer;\n };\n const sample=(container,region)=>{\n if(region.right-region.left<4 || region.bottom-region.top<4)return null;\n for(const fy of [0.5,0.25,0.75,0.05,0.95])for(const fx of [0.5,0.25,0.75,0.05,0.95]){\n const p={x:region.left+(region.right-region.left)*fx,y:region.top+(region.bottom-region.top)*fy};\n if(exposed(doc.elementFromPoint(p.x,p.y),container))return p;\n }\n return null;\n };\n const hit=doc.elementFromPoint(point.x,point.y);\n if(localReveal){\n if(!exposed(hit,scope)){\n if(!edgeLayer(hit && layer(hit,view),ownLayer,view))return result('covered');\n revealViaScroll=true;\n }\n const probe=exposed(hit,scope)?point:sample(scope,visible);\n if(!probe)return result('covered');point=probe;reveal=true;\n }else if(!same(hit)){\n // A small edge-docked fixed/sticky toolbar may cover a scrollable target.\n // Dialogs, central overlays and full-screen layers are never reveal routes.\n const cover=hit && layer(hit,view),cr=cover && cover.getBoundingClientRect();\n if(!edgeLayer(cover,ownLayer,view))return result('covered');\n let probe=null;\n for(const candidate of movable){\n const axis=candidate.axis,coordinate=axis==='x'?point.x:point.y;\n const start=axis==='x'?cr.left:cr.top,end=axis==='x'?cr.right:cr.bottom;\n if(coordinate<start || coordinate>=end)continue;\n const towardStart=start>=(axis==='x'?view.innerWidth:view.innerHeight)/2;\n if(!room(candidate.node,axis,towardStart?1:-1))continue;\n const region={left:Math.max(visible.left,candidate.b.left),top:Math.max(visible.top,candidate.b.top),right:Math.min(visible.right,candidate.b.right),bottom:Math.min(visible.bottom,candidate.b.bottom)};\n if(axis==='y'){if(towardStart)region.bottom=Math.min(region.bottom,cr.top);else region.top=Math.max(region.top,cr.bottom);}\n else if(towardStart)region.right=Math.min(region.right,cr.left);else region.left=Math.max(region.left,cr.right);\n probe=sample(candidate.node,region);if(probe)break;\n }\n if(!probe)return result('covered');point=probe;reveal=true;revealViaScroll=true;\n }\n if(view===view.top)return result(reveal?'offscreen':'ready');\n const owner=view.frameElement,parent=owner?.ownerDocument.defaultView;\n if(!owner || !parent || !origins.includes(parent.location.origin))return result('unavailable');\n const box=owner.getBoundingClientRect();point={x:point.x+box.left+owner.clientLeft,y:point.y+box.top+owner.clientTop};\n node=owner;view=parent;\n }\n }catch{return result('unavailable');}\n return result('unavailable');\n})(el,origins);\n if(availability==='unavailable')return {availability};\n let frameView=view,projectedTop=r.top,projectedLeft=r.left;\n for(let depth=0;frameView!==frameView.top;depth++){\n if(depth>=32)return {availability:'unavailable'};\n const owner=frameView.frameElement,parent=owner && owner.ownerDocument.defaultView;\n if(!owner || !parent || !origins.includes(parent.location.origin))return {availability:'unavailable'};\n const box=owner.getBoundingClientRect();\n projectedLeft+=box.left+owner.clientLeft;projectedTop+=box.top+owner.clientTop;frameView=parent;\n }\n const position={top:projectedTop+frameView.scrollY,left:projectedLeft+frameView.scrollX};\n const documentPath=node=>{\n const parts=[];\n for(let p=node,depth=0;p && p.nodeType===1; p=p.parentElement,depth++){\n if(depth>=64)return undefined;\n let ordinal=1;for(let sibling=p.previousElementSibling;sibling;sibling=sibling.previousElementSibling)if(sibling.tagName===p.tagName)ordinal++;\n parts.unshift(p.tagName.toLowerCase()+'['+ordinal+']');\n }\n return '/'+parts.join('/');\n };\n const framePaths=[];let pathView=view,pathComplete=true;\n for(let depth=0;pathView!==pathView.top;depth++){\n if(depth>=32){pathComplete=false;break;}\n const owner=pathView.frameElement, parent=owner && owner.ownerDocument.defaultView;\n if(!owner || !parent || !origins.includes(parent.location.origin)){pathComplete=false;break;}\n const path=documentPath(owner);if(!path){pathComplete=false;break;}\n framePaths.unshift(path);pathView=parent;\n }\n const pathFor=node=>{const path=documentPath(node);return pathComplete && path ? [...framePaths,path].join('!') : undefined;};\n const scrollContainerPaths=[];\n const scrollPath=node=>{\n const own=documentPath(node);if(!own)return undefined;\n const paths=[own];let v=node.ownerDocument.defaultView;\n for(let depth=0;v && v!==v.top;depth++){\n if(depth>=32)return undefined;\n const owner=v.frameElement,parent=owner && owner.ownerDocument.defaultView;\n if(!owner || !parent || !origins.includes(parent.location.origin))return undefined;\n const path=documentPath(owner);if(!path)return undefined;\n paths.unshift(path);v=parent;\n }\n return paths.join('!');\n };\n let scrollNode=el,scrollView=view;\n for(let depth=0;depth<32;depth++){\n const root=scrollNode.ownerDocument.scrollingElement;let fixed=false;\n for(let p=scrollNode;p;p=p.parentElement){\n const s=scrollView.getComputedStyle(p);\n if(s.position==='fixed')fixed=true;\n const rootNode=p===root,body=scrollNode.ownerDocument.body,bs=body && scrollView.getComputedStyle(body);\n const axis=(overflow,size,client)=>p[size]>p[client]+1 && (rootNode?!fixed && ![s[overflow],bs?.[overflow]].some(v=>v==='hidden'||v==='clip'):/^(auto|scroll)$/.test(s[overflow]));\n if(axis('overflowX','scrollWidth','clientWidth') || axis('overflowY','scrollHeight','clientHeight')){\n const path=scrollPath(p);if(path && !scrollContainerPaths.includes(path))scrollContainerPaths.push(path);\n }\n }\n if(scrollView===scrollView.top)break;\n const owner=scrollView.frameElement,parent=owner && owner.ownerDocument.defaultView;\n if(!owner || !parent || !origins.includes(parent.location.origin))break;\n scrollNode=owner;scrollView=parent;\n }\n const fixedLayer=node=>{for(let p=node;p && p!==doc.body;p=p.parentElement){if(p.matches('dialog[open],[role=\"dialog\"],[aria-modal=\"true\"]'))return p;const s=view.getComputedStyle(p);if(s.position==='fixed' && Number(s.zIndex)>0)return p;}return null;};\n const ownLayer=fixedLayer(el);\n const nativeFieldSelector='input:not([type=\"hidden\"]):not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]),textarea,select,[role=\"textbox\"],[role=\"combobox\"],[role=\"spinbutton\"]';\n const fieldCandidateSelector=nativeFieldSelector+',[tabindex],[aria-haspopup],button,[role=\"button\"]';\n const isField=node=>{\n if(node.matches(nativeFieldSelector))return true;\n if(node.tabIndex<0)return false;\n const popup=node.getAttribute('aria-haspopup');\n const controlled=(node.getAttribute('aria-controls')||'').trim().split(/\\s+/).filter(Boolean).map(id=>doc.getElementById(id));\n const picker=Boolean(popup && popup!=='false') || controlled.some(panel=>panel && panel.matches('[role=\"listbox\"],[role=\"tree\"],[role=\"grid\"]'));\n return picker || Boolean(node.querySelector('input[type=\"hidden\"]'));\n };\n const fieldsWithin=node=>[...node.querySelectorAll(fieldCandidateSelector)].filter(isField);\n const ids=attribute=>(el.getAttribute(attribute)||'').trim().split(/\\s+/).filter(Boolean);\n const relatedText=[...ids('aria-describedby'),...ids('aria-errormessage'),...ids('aria-labelledby')].map(id=>doc.getElementById(id)).filter(Boolean);\n // Live page summaries are global evidence, not every nearby field's constraint.\n // Explicit accessibility relationships keep field-specific hints and errors local.\n const liveSelector='[role=\"status\"],[role=\"alert\"],[role=\"timer\"],[role=\"log\"],[aria-live]:not([aria-live=\"off\"]),output';\n const unrelatedLive=node=>{\n if(relatedText.some(related=>related===node || related.contains(node)))return false;\n return Boolean(node.closest(liveSelector));\n };\n const contextText=node=>{\n if(!node.matches(liveSelector) && !node.closest(liveSelector) && !node.querySelector(liveSelector))return node.innerText || '';\n const parts=[],walker=doc.createTreeWalker(node,4);let text;\n while((text=walker.nextNode())){\n const parent=text.parentElement;\n if(!parent || unrelatedLive(parent) || parent.closest('script,style') || !parent.getClientRects().length)continue;\n const style=view.getComputedStyle(parent);\n if(style.display!=='none' && style.visibility==='visible')parts.push(text.textContent||'');\n }\n return parts.join(' ');\n };\n let peerGroup;\n const context=[], ownerPaths=[], localParents=[], sharedLabels=[], own=(el.innerText || '').trim();\n const addContext=text=>{text=text.replace(/\\s+/g,' ').trim();if(context.length<2 && text && text!==own && text.length<=400 && !context.includes(text))context.push(text);};\n const sharedContext=boundary=>{\n let branch=el;\n while(branch.parentElement && branch.parentElement!==boundary)branch=branch.parentElement;\n for(let parent=boundary,depth=0;parent && parent!==doc.body && depth<3;branch=parent,parent=parent.parentElement,depth++){\n for(const child of parent.children){\n if(child===branch || child.contains(el) || isField(child) || fieldsWithin(child).length)continue;\n if(child.matches('button,a,[role=\"button\"],[role=\"option\"],[role=\"listbox\"],[role=\"menu\"],[role=\"menuitem\"]') || child.querySelector('button,a,[role=\"button\"],[role=\"option\"],[role=\"listbox\"],[role=\"menuitem\"]'))continue;\n const style=view.getComputedStyle(child);\n if(!child.getClientRects().length || style.display==='none' || style.visibility!=='visible' || style.cursor==='pointer')continue;\n const text=contextText(child).replace(/\\s+/g,' ').trim();\n if(!text || text.length>240)continue;\n addContext(text);\n if(!unrelatedLive(child))sharedLabels.push(child);\n }\n }\n };\n for(let p=el.parentElement, depth=0;p && p!==doc.body && depth<7;p=p.parentElement,depth++){\n const independent=fieldsWithin(p).some(other=>{\n if(other===el || el.contains(other) || other.contains(el))return false;\n if(['radio','checkbox'].includes(el.type) && el.name && other.type===el.type && other.name===el.name)return false;\n return true;\n });\n if(independent){\n const fields=fieldsWithin(p), roots=fields.filter(f=>!fields.some(other=>other!==f && other.contains(f)));\n const peers=roots.filter(f=>f.getClientRects().length).sort((a,b)=>{const ar=a.getBoundingClientRect(),br=b.getBoundingClientRect();return Math.abs(ar.top-br.top)>8?ar.top-br.top:ar.left-br.left;});\n const position=peers.findIndex(f=>f===el || f.contains(el));\n const key=pathFor(p);\n if(key && position>=0 && peers.length<=8)peerGroup={key,position:position+1,count:peers.length};\n sharedContext(p);break;\n }\n localParents.push(p);\n const path=pathFor(p);if(path)ownerPaths.push(path);\n addContext(contextText(p));\n }\n for(const related of relatedText){\n const text=(related.textContent||'').replace(/\\s+/g,' ').trim();\n if(text && text.length<=400 && !context.includes(text))context.push(text);\n }\n const layer=ownLayer && ((ownLayer.querySelector('h1,h2,h3,h4,[role=heading]')?.textContent || ownLayer.innerText || '').replace(/\\s+/g,' ').trim().slice(0,240));\n const tag=el.tagName.toLowerCase(), type=(el.getAttribute('type') || '').toLowerCase();\n const editable=(tag==='textarea' || (tag==='input' && !['password','button','submit','reset','checkbox','radio','file','hidden','image'].includes(type)) || el.isContentEditable) && !el.readOnly && !el.matches(':disabled');\n const modal=Boolean(ownLayer && (ownLayer.matches('dialog,[role=\"dialog\"],[aria-modal=\"true\"]') || /dialog|modal|popup/i.test(String(ownLayer.className))));\n const layerKey=ownLayer ? [ownLayer.tagName,ownLayer.id,String(ownLayer.className)].join('|') : undefined;\n const checkables=el.matches('input[type=\"checkbox\"],input[type=\"radio\"],[role=\"checkbox\"],[role=\"radio\"]') ? [el] : [...el.querySelectorAll('input[type=\"checkbox\"],input[type=\"radio\"],[role=\"checkbox\"],[role=\"radio\"]')];\n const customToggle=/check[-_]?box|radio[-_]?box|checkmark/i.test(String(el.className)) && !(el.innerText||'').trim();\n const checkbox=checkables.length===1?checkables[0]:undefined;\n const checked=checkbox ? (checkbox.getAttribute('aria-checked')==='mixed'?'mixed':Boolean(checkbox.checked || checkbox.getAttribute('aria-checked')==='true')) : customToggle ? /(^|[\\s_-])(checked|selected|on)([\\s_-]|$)/i.test(String(el.className)) : undefined;\n const nativeSelect=tag==='select';\n const constraints={};\n if(['input','textarea','select'].includes(tag)){\n for(const attribute of ['min','max','step','minlength','maxlength','pattern'])if(el.hasAttribute(attribute))constraints[attribute]=el.getAttribute(attribute);\n if(el.hasAttribute('multiple') && typeof el.multiple==='boolean')constraints.multiple=el.multiple;\n }\n const options=nativeSelect?[...el.options].slice(0,100).map(o=>({label:o.label,value:o.value,selected:o.selected,disabled:Boolean(o.disabled||o.closest('optgroup[disabled]'))})):undefined;\n const labelledByIds=ids('aria-labelledby');\n const fieldLabel=(el.getAttribute('aria-label') || [...(el.labels||[])].map(label=>label.textContent||'').join(' ') || labelledByIds.map(id=>doc.getElementById(id)?.textContent||'').join(' ')).trim();\n const labelText=label=>{\n const parts=[],walker=doc.createTreeWalker(label,4);let node;\n while((node=walker.nextNode()))if(node.parentElement && !unrelatedLive(node.parentElement) && !node.parentElement.closest('input,textarea,select,button,script,style'))parts.push(node.textContent||'');\n return parts.join(' ');\n };\n const nativeLabels=[...(el.labels||[])], namedLabels=labelledByIds.map(id=>doc.getElementById(id)).filter(Boolean);\n const labelNodes=[...nativeLabels,...namedLabels,...sharedLabels];\n for(const parent of localParents)for(const child of parent.children){\n if(child===el || child.contains(el) || child.matches('input,textarea,select,button,a,[role=\"button\"],[role=\"alert\"],[aria-live]') || child.querySelector('input,textarea,select,button,a,[role=\"button\"]'))continue;\n const text=contextText(child).replace(/\\s+/g,' ').trim();\n if(text && text.length<=120 && child.getClientRects().length && !labelNodes.includes(child))labelNodes.push(child);\n }\n const labelTexts=[el.getAttribute('aria-label')||'',...labelNodes.map(label=>{\n const generated=['::before','::after'].map(pseudo=>view.getComputedStyle(label,pseudo).content).map(text=>text && text!=='none' && text!=='normal'?text.replace(/^[\"']|[\"']$/g,''):'');\n return [generated[0]||'',labelText(label),generated[1]||''].join(' ').replace(/\\s+/g,' ').trim();\n })];\n const markedRequired=labelTexts.some(text=>/^\\s*[*\uFF0A\uFE61\u2731]|[*\uFF0A\uFE61\u2731]\\s*$|(?:^|[\uFF08(\\s])(?:\u5FC5\u586B|required)(?:[\uFF09)\\s:\uFF1A]|$)/i.test(text));\n const markedOptional=labelTexts.some(text=>/(?:^|[\uFF08(\\s])(?:optional|\u9009\u586B|\u53EF\u8865\u5145)(?:[\uFF09)\\s.,\uFF0C\u3002:\uFF1A]|$)/i.test(text));\n let required,requiredSource;\n if(el.required){required=true;requiredSource='html';}\n else if(el.getAttribute('aria-required')==='true'){required=true;requiredSource='aria';}\n else if(markedRequired){required=true;requiredSource='label-required';}\n else if(el.getAttribute('aria-required')==='false'){required=false;requiredSource='aria';}\n else if(markedOptional){required=false;requiredSource='label-optional';}\n const validationErrors=[el.validationMessage||'',...ids('aria-errormessage').map(id=>doc.getElementById(id)?.textContent||'')].filter(Boolean);\n const ancestorIds=[],ancestorPaths=[];for(let p=el.parentElement,depth=0;p && depth<12;p=p.parentElement,depth++){if(p.id)ancestorIds.push(p.id);const path=pathFor(p);if(path)ancestorPaths.push(path);}\n const actionControl=tag==='button' || (tag==='input' && ['button','submit','reset','image'].includes(type));\n const valueControl=['textarea','select','output'].includes(tag) || (tag==='input' && !actionControl);\n const observedValue=valueControl && typeof el.value==='string'?el.value:el.isContentEditable?(el.textContent||''):undefined;\n const actionValue=actionControl && typeof el.value==='string'?el.value:undefined;\n const displayText=['input','textarea','select'].includes(tag)?undefined:(el.innerText||'').trim().slice(0,2000);\n const observedName=(fieldLabel || el.getAttribute('placeholder') || el.innerText || el.getAttribute('title') || '').trim().slice(0,2000);\n const picker=(function(pathFor) {\n const el=this, doc=el.ownerDocument, view=doc.defaultView;\n if(el.getRootNode()!==doc)return undefined;\n const clean=s=>String(s||'').replace(/[\\uE000-\\uF8FF]/g,'').replace(/\\s+/g,' ').trim();\n const panelSelector='ul,ol,[role=\"listbox\"],[role=\"menu\"],[role=\"tree\"],[role=\"grid\"],[role=\"dialog\"],dialog';\n const optionSelector='li,option,[role=\"option\"],[role=\"menuitem\"],[role=\"treeitem\"]';\n const triggerSelector='input,select,button,[tabindex],[role=\"combobox\"],[aria-haspopup],[aria-controls],[aria-owns]';\n const ids=node=>[...(node.getAttribute('aria-controls')||'').split(/\\s+/),...(node.getAttribute('aria-owns')||'').split(/\\s+/)].filter(Boolean);\n const explicitPanels=node=>ids(node).map(id=>doc.getElementById(id)).filter(p=>p && p!==node);\n const hiddenValue=node=>{\n const inputs=[...node.querySelectorAll('input[type=\"hidden\"]')];\n return inputs.length===1?inputs[0]:undefined;\n };\n // A unique visible text input paired with one hidden selection token is a\n // grounded autocomplete even when the application omits ARIA combobox markup.\n const inputBacking=node=>{\n if(node.tagName!=='INPUT' || !['text','search',''].includes(node.getAttribute('type')||''))return undefined;\n for(let p=node.parentElement,depth=0;p && p!==doc.body && p.tagName!=='FORM' && depth<2;p=p.parentElement,depth++){\n const fields=[...p.querySelectorAll('input:not([type=\"hidden\"]),textarea,select')];\n if(fields.length>1)return undefined;\n const hidden=[...p.querySelectorAll('input[type=\"hidden\"]')];\n if(fields.length===1 && fields[0]===node && hidden.length===1)return hidden[0];\n }\n return undefined;\n };\n const triggerLike=node=>Boolean(inputBacking(node)) ||node.tagName==='SELECT' || node.getAttribute('role')==='combobox' ||\n Boolean(node.getAttribute('aria-haspopup') && node.getAttribute('aria-haspopup')!=='false') ||\n explicitPanels(node).some(p=>p.matches(panelSelector)||p.querySelector('[role=\"listbox\"],[role=\"menu\"],[role=\"tree\"]')) ||\n (node.tabIndex>=0 && hiddenValue(node));\n const triggersWithin=node=>{\n const all=[...node.querySelectorAll(triggerSelector)].filter(triggerLike);\n return all.filter(t=>!all.some(other=>other!==t && other.contains(t)));\n };\n const visible=node=>{\n if(!node.isConnected || !node.getClientRects().length)return false;\n for(let p=node;p;p=p.parentElement){const s=view.getComputedStyle(p);if(p.hidden || p.getAttribute('aria-hidden')==='true' || s.display==='none' || s.visibility!=='visible' || s.opacity==='0')return false;}\n return true;\n };\n const localPanels=trigger=>{\n if(trigger.tagName==='SELECT')return [];\n const nested=[...trigger.querySelectorAll(panelSelector)].filter(p=>p.querySelector(optionSelector));\n if(nested.length && !triggersWithin(trigger).length)return nested.filter(p=>!nested.some(other=>other!==p && other.contains(p)));\n for(let parent=trigger.parentElement,depth=0;parent && parent!==doc.body && depth<5;parent=parent.parentElement,depth++){\n const triggers=triggersWithin(parent);\n if(triggers.length>1)return [];\n if(triggers.length!==1 || triggers[0]!==trigger)continue;\n const panels=[...parent.querySelectorAll(panelSelector)].filter(p=>!trigger.contains(p) && p.querySelector(optionSelector));\n if(panels.length)return panels.filter(p=>!panels.some(other=>other!==p && other.contains(p)));\n }\n return [];\n };\n const option=el.closest(optionSelector);\n const ownRole=option && option.getAttribute('role');\n let trigger,panels=[],relationship='unknown',part;\n if(triggerLike(el) && !option){\n trigger=el;part='trigger';panels=explicitPanels(el);\n if(panels.length)relationship='aria';else {panels=localPanels(el);if(panels.length)relationship='local-dom';}\n if(el.tagName!=='SELECT' && !panels.length && !el.hasAttribute('aria-haspopup') && el.getAttribute('role')!=='combobox' && !inputBacking(el))return undefined;\n }else if(option){\n part='option';const panel=option.closest(panelSelector);\n if(!panel && option.tagName!=='OPTION')return undefined;\n const all=[...doc.querySelectorAll('[aria-controls],[aria-owns]')];\n const explicit=all.length<=512 ? all.filter(t=>triggerLike(t) && explicitPanels(t).some(p=>p.contains(option))) : [];\n let ambiguous=explicit.length>1 || all.length>512;\n if(explicit.length===1){trigger=explicit[0];panels=explicitPanels(trigger);relationship='aria';}\n if(!trigger && !ambiguous && panel){\n for(let parent=panel.parentElement,depth=0;parent && parent!==doc.body && depth<5;parent=parent.parentElement,depth++){\n const triggers=triggersWithin(parent).filter(t=>!panel.contains(t));\n if(triggers.length>1){ambiguous=true;break;}\n if(triggers.length===1){\n const candidate=triggers[0],owned=explicitPanels(candidate).length?explicitPanels(candidate):localPanels(candidate);\n if(owned.some(p=>p.contains(option))){trigger=candidate;panels=owned;relationship='local-dom';break;}\n }\n }\n }\n if(!trigger && !ambiguous && !['option','menuitem','treeitem'].includes(ownRole))return undefined;\n }else return undefined;\n const result={part,relationship,panelPaths:panels.map(pathFor).filter(Boolean),selection:'unknown',selectionEvidence:'unknown'};\n if(option && part==='option'){\n result.optionText=clean(option.innerText||option.textContent).slice(0,2000);\n result.optionLabel=clean(option.getAttribute('aria-label') || (option.innerText||option.textContent||'').split(/\\n/).find(line=>line.trim()) || '').slice(0,2000);\n const optionPath=pathFor(option);if(optionPath)result.optionPath=optionPath;\n if(option.hasAttribute('aria-selected'))result.optionSelected=option.getAttribute('aria-selected')==='true';\n else if(option.tagName==='OPTION')result.optionSelected=option.selected;\n }\n if(!trigger)return result;\n const path=pathFor(trigger);if(path)result.triggerPath=path;else result.relationship='unknown';\n const label=clean(trigger.getAttribute('aria-label') || [...(trigger.labels||[])].map(l=>l.textContent).join(' ') ||\n (trigger.getAttribute('aria-labelledby')||'').split(/\\s+/).map(id=>doc.getElementById(id)?.textContent||'').join(' '));\n if(label){result.label=label.slice(0,200);result.labelSource='label';}\n const backing=inputBacking(trigger);\n const hidden=hiddenValue(trigger)||backing,display=[];\n const walker=doc.createTreeWalker(trigger,4);let node;\n while((node=walker.nextNode())){\n const parent=node.parentElement;\n if(parent && visible(parent) && !parent.closest('script,style') && !panels.some(p=>p.contains(parent)))display.push(node.textContent||'');\n }\n const text=backing?clean(trigger.value):clean(display.join(''));\n if(trigger.tagName==='SELECT'){\n result.selection=trigger.selectedIndex<0 || (trigger.required && trigger.value==='')?'empty':'value';result.selectionEvidence='native-select';\n if(result.selection==='value')result.committedText=[...trigger.selectedOptions].map(o=>o.label).join(', ');\n }else if(hidden){\n result.selection=hidden.value!==''?'value':hidden.hasAttribute('value')?'unknown':'empty';result.selectionEvidence='backing-input';\n if(result.selection==='value' && text)result.committedText=text.slice(0,2000);\n if(!label && result.selection==='empty' && text){result.label=text.slice(0,200);result.labelSource='empty-display';}\n }\n if(['INPUT','TEXTAREA'].includes(trigger.tagName) && trigger.type!=='hidden'){\n if(!backing || !hidden.value || panels.some(visible))result.queryText=trigger.value;\n if(!label && trigger.placeholder){result.label=clean(trigger.placeholder).slice(0,200);result.labelSource='placeholder';}\n }\n if(panels.length)result.panelVisible=panels.some(visible);\n if(trigger.hasAttribute('aria-expanded'))result.expanded=trigger.getAttribute('aria-expanded')==='true';\n else if(panels.length)result.expanded=result.panelVisible;\n return result;\n}).call(el,pathFor);\n return {availability,...(revealViaScroll?{revealViaScroll}:{}),editable,readable:true,...(peerGroup?{peerGroup}:{}),...(picker?{picker}:{}),domSemantics:{tag:el.tagName.toLowerCase(),role:el.getAttribute(\"role\")||\"\",disabled:Boolean(el.disabled)||el.getAttribute(\"aria-disabled\")===\"true\",readOnly:Boolean(el.readOnly)||el.getAttribute(\"aria-readonly\")===\"true\"},context,modal,nativeSelect,observedValue,observedName,...(Object.keys(constraints).length?{constraints}:{}),...(actionValue===undefined?{}:{actionValue}),...(displayText===undefined?{}:{displayText}),htmlId:el.id,controlsIds:[...ids('aria-controls'),...ids('aria-owns')],ancestorIds,ownerPaths,ancestorPaths,position,scrollContainerPaths,labelledByIds,fieldLabel,validationErrors,...(required===undefined?{}:{required,requiredSource}),inputType:type,...(el.hasAttribute('aria-expanded')?{expanded:el.getAttribute('aria-expanded')==='true'}:{}),...(nativeSelect?{options,optionsTruncated:el.options.length>100}:{}),...(layer?{layer}:{}),...(layerKey?{layerKey}:{}),...(checked===undefined?{}:{checked})};\n}";
|
|
981
|
+
export declare function inspectGoalControls(controller: Pick<NativeCdpController, "resolveBackendNode" | "callFunctionOnObject" | "releaseObject">, snapshot: BrowserAxSnapshot, origins: readonly string[], signal: AbortSignal): Promise<GoalSnapshot>;
|