@applitools/nlp-web-runner 5.14.2 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
var __defProp=Object['defineProperty'],__exportAll=(
|
|
1
|
+
var __defProp=Object['defineProperty'],__exportAll=(k,v)=>{let Y={};for(var E in k)__defProp(Y,E,{'get':k[E],'enumerable':!![]});if(!v)__defProp(Y,Symbol['toStringTag'],{'value':'Module'});return Y;};export{__exportAll as t};
|
|
@@ -36,7 +36,22 @@ type IfControlFlow = {
|
|
|
36
36
|
then?: Instruction[];
|
|
37
37
|
otherwise?: Instruction[];
|
|
38
38
|
};
|
|
39
|
-
type
|
|
39
|
+
type RepeatLoopControlFlow = {
|
|
40
|
+
type: 'loop';
|
|
41
|
+
instructions: Instruction[];
|
|
42
|
+
times?: NumberExpression;
|
|
43
|
+
condition?: Condition;
|
|
44
|
+
wait?: NumberExpression;
|
|
45
|
+
};
|
|
46
|
+
type ForEachLoopControlFlow = {
|
|
47
|
+
type: 'loop';
|
|
48
|
+
instructions: Instruction[];
|
|
49
|
+
iterable: AnyExpression | ElementDescriptor;
|
|
50
|
+
bindings?: string[];
|
|
51
|
+
wait?: NumberExpression;
|
|
52
|
+
};
|
|
53
|
+
type LoopControlFlow = RepeatLoopControlFlow | ForEachLoopControlFlow;
|
|
54
|
+
type ControlFlow = SetPreinstructionsControlFlow | DropPreinstructionsControlFlow | TryControlFlow | InitializeScopeControlFlow | IfControlFlow | LoopControlFlow;
|
|
40
55
|
type EmptyAction = {
|
|
41
56
|
type: 'empty';
|
|
42
57
|
};
|
|
@@ -60,7 +75,7 @@ type SetVariableAction = {
|
|
|
60
75
|
type SetValueAction = {
|
|
61
76
|
type: 'set value';
|
|
62
77
|
value: StringExpression | NumberExpression | Generator$1 | FileHandle;
|
|
63
|
-
element: ElementDescriptor;
|
|
78
|
+
element: ElementDescriptor | ElementReference;
|
|
64
79
|
};
|
|
65
80
|
type FetchAction = {
|
|
66
81
|
type: 'fetch';
|
|
@@ -98,32 +113,32 @@ type EvaluateAction = {
|
|
|
98
113
|
};
|
|
99
114
|
type FocusAction = {
|
|
100
115
|
type: 'focus';
|
|
101
|
-
element: ElementDescriptor;
|
|
116
|
+
element: ElementDescriptor | ElementReference;
|
|
102
117
|
};
|
|
103
118
|
type CheckAction = {
|
|
104
119
|
type: 'check';
|
|
105
120
|
value: boolean;
|
|
106
|
-
element: ElementDescriptor;
|
|
121
|
+
element: ElementDescriptor | ElementReference;
|
|
107
122
|
};
|
|
108
123
|
type ClearAction = {
|
|
109
124
|
type: 'clear';
|
|
110
|
-
element?: ElementDescriptor;
|
|
125
|
+
element?: ElementDescriptor | ElementReference;
|
|
111
126
|
};
|
|
112
127
|
type EraseAction = {
|
|
113
128
|
type: 'erase';
|
|
114
129
|
size: NumberExpression;
|
|
115
|
-
element?: ElementDescriptor;
|
|
130
|
+
element?: ElementDescriptor | ElementReference;
|
|
116
131
|
};
|
|
117
132
|
type TypeAction = {
|
|
118
133
|
type: 'type';
|
|
119
134
|
value: AnyExpression | ExtractOperation | Generator$1;
|
|
120
135
|
secret?: boolean;
|
|
121
|
-
element?: ElementDescriptor | ChromeElementDescriptor | DialogElementDescriptor;
|
|
136
|
+
element?: ElementDescriptor | ElementReference | ChromeElementDescriptor | DialogElementDescriptor;
|
|
122
137
|
};
|
|
123
138
|
type SearchAction = {
|
|
124
139
|
type: 'search';
|
|
125
140
|
value: StringExpression;
|
|
126
|
-
element?: ElementDescriptor;
|
|
141
|
+
element?: ElementDescriptor | ElementReference;
|
|
127
142
|
};
|
|
128
143
|
type HitKeyAction = {
|
|
129
144
|
type: 'hit key';
|
|
@@ -133,7 +148,7 @@ type HitKeyAction = {
|
|
|
133
148
|
type ClickElementAction = {
|
|
134
149
|
type: 'click';
|
|
135
150
|
keys?: Key[];
|
|
136
|
-
element: ElementDescriptor;
|
|
151
|
+
element: ElementDescriptor | ElementReference;
|
|
137
152
|
button?: 'left' | 'right';
|
|
138
153
|
times?: number;
|
|
139
154
|
};
|
|
@@ -147,7 +162,7 @@ type ClickDialogElementAction = {
|
|
|
147
162
|
};
|
|
148
163
|
type HoverAction = {
|
|
149
164
|
type: 'hover';
|
|
150
|
-
element: ElementDescriptor;
|
|
165
|
+
element: ElementDescriptor | ElementReference;
|
|
151
166
|
};
|
|
152
167
|
type ScrollByDistanceAction = {
|
|
153
168
|
type: 'scroll';
|
|
@@ -158,23 +173,23 @@ type ScrollByDistanceAction = {
|
|
|
158
173
|
type ScrollByFractionAction = {
|
|
159
174
|
type: 'scroll';
|
|
160
175
|
fraction: NumberExpression;
|
|
161
|
-
element?: ElementDescriptor | ViewportDescriptor;
|
|
176
|
+
element?: ElementDescriptor | ElementReference | ViewportDescriptor;
|
|
162
177
|
direction?: Direction;
|
|
163
178
|
times?: NumberExpression;
|
|
164
179
|
};
|
|
165
180
|
type ScrollToPositionAction = {
|
|
166
181
|
type: 'scroll';
|
|
167
182
|
position: AbsolutePosition;
|
|
168
|
-
element?: ElementDescriptor | ViewportDescriptor;
|
|
183
|
+
element?: ElementDescriptor | ElementReference | ViewportDescriptor;
|
|
169
184
|
times?: NumberExpression;
|
|
170
185
|
};
|
|
171
186
|
type ScrollToElementAction = {
|
|
172
187
|
type: 'scroll';
|
|
173
|
-
element: ElementDescriptor;
|
|
188
|
+
element: ElementDescriptor | ElementReference;
|
|
174
189
|
};
|
|
175
190
|
type ScrollTheElementAction = {
|
|
176
191
|
type: 'scroll';
|
|
177
|
-
element: ElementDescriptor;
|
|
192
|
+
element: ElementDescriptor | ElementReference;
|
|
178
193
|
direction?: Direction;
|
|
179
194
|
distance: NumberExpression;
|
|
180
195
|
times?: NumberExpression;
|
|
@@ -213,7 +228,7 @@ type CreateTargetAction = {
|
|
|
213
228
|
};
|
|
214
229
|
type CloseAction = {
|
|
215
230
|
type: 'close';
|
|
216
|
-
element: ElementDescriptor | DialogDescriptor | ChromeTabDescriptor;
|
|
231
|
+
element: ElementDescriptor | ElementReference | DialogDescriptor | ChromeTabDescriptor;
|
|
217
232
|
};
|
|
218
233
|
type SwitchAction = {
|
|
219
234
|
type: 'switch';
|
|
@@ -226,7 +241,7 @@ type WaitAction = {
|
|
|
226
241
|
};
|
|
227
242
|
type FindAction = {
|
|
228
243
|
type: 'find';
|
|
229
|
-
element: ElementDescriptor;
|
|
244
|
+
element: ElementDescriptor | ElementReference;
|
|
230
245
|
};
|
|
231
246
|
type VisualCheckAction = {
|
|
232
247
|
type: 'visual check';
|
|
@@ -335,7 +350,7 @@ type NumberOperation = AddOperation | SubOperation | MulOperation | DivOperation
|
|
|
335
350
|
type ConditionOperation = ParensOperation | IgnoreCaseOperation | MatchCaseOperation | NotOperation | OrOperation | AndOperation | ComparisonOperation | ValidateOperation | MatchOperation | IncludesOnlyOperation | IncludesOperation | StartsWithOperation | EndsWithOperation | VisibleOperation | ClickableOperation | EnabledOperation | HoveredOperation | CheckedOperation | PopulatedOperation | EveryOperation | SomeOperation;
|
|
336
351
|
type Operand = {
|
|
337
352
|
isOperand: true;
|
|
338
|
-
value: AnyExpression | ElementDescriptor | DialogDescriptor | ExpressionOperation;
|
|
353
|
+
value: AnyExpression | ElementDescriptor | ElementReference | DialogDescriptor | ExpressionOperation;
|
|
339
354
|
};
|
|
340
355
|
type ParensOperation = {
|
|
341
356
|
operator: 'parens';
|
|
@@ -512,15 +527,30 @@ type Selector$1 = {
|
|
|
512
527
|
type: 'css' | 'xpath';
|
|
513
528
|
selector: StringExpression;
|
|
514
529
|
};
|
|
515
|
-
type AnchorDescriptor<TElement = ElementDescriptor> = RelativeAnchorDescriptor<TElement> | AbsoluteAnchorDescriptor<TElement>;
|
|
516
|
-
type RelativeAnchorDescriptor<TElement = ElementDescriptor> = {
|
|
530
|
+
type AnchorDescriptor<TElement = ElementDescriptor | ElementReference> = RelativeAnchorDescriptor<TElement> | AbsoluteAnchorDescriptor<TElement>;
|
|
531
|
+
type RelativeAnchorDescriptor<TElement = ElementDescriptor | ElementReference> = {
|
|
517
532
|
position: RelativePosition | RelativePosition[];
|
|
518
533
|
element: TElement;
|
|
519
534
|
};
|
|
520
|
-
type AbsoluteAnchorDescriptor<TElement = ElementDescriptor> = {
|
|
535
|
+
type AbsoluteAnchorDescriptor<TElement = ElementDescriptor | ElementReference> = {
|
|
521
536
|
position: AbsolutePosition | AbsolutePosition[];
|
|
522
537
|
element?: TElement | ViewportDescriptor | DialogDescriptor;
|
|
523
538
|
};
|
|
539
|
+
/**
|
|
540
|
+
* A contextual element reference (`it`) in element position. The parser no longer resolves it to
|
|
541
|
+
* a copy of the referenced descriptor - the runner resolves it at runtime against the element the
|
|
542
|
+
* run most recently resolved (a previous action's element, or the current entry of a for-each
|
|
543
|
+
* loop over page elements).
|
|
544
|
+
*/
|
|
545
|
+
type ElementReference = {
|
|
546
|
+
isElementReference: true;
|
|
547
|
+
/**
|
|
548
|
+
* The type word the reference was spelled with (`that button`, `the current row`) - surface
|
|
549
|
+
* decoration for readability and round-tripping; resolution ignores it.
|
|
550
|
+
*/
|
|
551
|
+
type?: ElementType; /** The referenced element is known at parse time to hold sensitive data, so the value keeps masking. */
|
|
552
|
+
secret?: boolean;
|
|
553
|
+
};
|
|
524
554
|
type DialogDescriptor = {
|
|
525
555
|
isDialogDescriptor: true;
|
|
526
556
|
};
|
|
@@ -8579,6 +8609,11 @@ interface AXProvider {
|
|
|
8579
8609
|
findAXNode<TNode>(nodes: Iterable<IAXNodeView<TNode>>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): Promise<CandidateMetric | null>;
|
|
8580
8610
|
/** Optional: remote providers may not support returning the full ranked candidate list. */
|
|
8581
8611
|
findAXNodes?<TNode>(nodes: Iterable<IAXNodeView<TNode>>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): Promise<CandidateMetric[]>;
|
|
8612
|
+
/**
|
|
8613
|
+
* Optional: the collection of elements the descriptor describes - the candidates whose match
|
|
8614
|
+
* quality ties with the best one found, in document order.
|
|
8615
|
+
*/
|
|
8616
|
+
findAXNodeCollection?<TNode>(nodes: Iterable<IAXNodeView<TNode>>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): Promise<CandidateMetric[]>;
|
|
8582
8617
|
} //#endregion
|
|
8583
8618
|
//#endregion
|
|
8584
8619
|
//#region src/scope.d.ts
|
|
@@ -8607,6 +8642,19 @@ declare class Scope {
|
|
|
8607
8642
|
initialize(data: StorageData): void;
|
|
8608
8643
|
available(id: string): boolean;
|
|
8609
8644
|
set(name: string, data: StorageData): Storage;
|
|
8645
|
+
/**
|
|
8646
|
+
* Creates bindings in the current scope: an ephemeral, stackable storage that shadows the scope's
|
|
8647
|
+
* own values until it is unbound - what a loop binds for the run of its body. Bindings are not
|
|
8648
|
+
* storages, so they leave the scope chain (and everything keyed off a nested scope, like skipping
|
|
8649
|
+
* assertions in a called test) untouched, and they are immutable through syntax - assigning to a
|
|
8650
|
+
* bound name throws.
|
|
8651
|
+
*/
|
|
8652
|
+
bind(values: Record<string, {
|
|
8653
|
+
value: any;
|
|
8654
|
+
secret?: boolean;
|
|
8655
|
+
}>): () => void;
|
|
8656
|
+
/** Removes every binding, so none outlives the run that created it. */
|
|
8657
|
+
unbindAll(): void;
|
|
8610
8658
|
reset(): void;
|
|
8611
8659
|
}
|
|
8612
8660
|
interface Storage {
|
|
@@ -9256,6 +9304,8 @@ declare const ErrorCode: {
|
|
|
9256
9304
|
readonly OBSCURED_ELEMENT: "OBSCURED_ELEMENT";
|
|
9257
9305
|
readonly FORBIDDEN_ACTION: "FORBIDDEN_ACTION";
|
|
9258
9306
|
readonly EXCEEDED_ALLOWED_TIMEOUT: "EXCEEDED_ALLOWED_TIMEOUT";
|
|
9307
|
+
readonly LOOP_LIMIT_EXCEEDED: "LOOP_LIMIT_EXCEEDED";
|
|
9308
|
+
readonly ASSIGNMENT_TO_BINDING: "ASSIGNMENT_TO_BINDING";
|
|
9259
9309
|
readonly NOT_PDF_VIEWER: "NOT_PDF_VIEWER";
|
|
9260
9310
|
readonly PDF_PAGE_OUT_OF_RANGE: "PDF_PAGE_OUT_OF_RANGE";
|
|
9261
9311
|
};
|
|
@@ -9274,7 +9324,7 @@ type ResolvedChromeTabDescriptor = {
|
|
|
9274
9324
|
declare function activateBrowserTab(automator: Browser, descriptor: ResolvedChromeTabDescriptor): Promise<void>;
|
|
9275
9325
|
//#endregion
|
|
9276
9326
|
//#region src/utils/evaluate-expression.d.ts
|
|
9277
|
-
type EvaluatedExpression<TValue> = TValue extends ExtractOperation ? Any : TValue extends NumberExpression ? number : TValue extends SizeOperation ? number : TValue extends KeysOperation ? string[] : TValue extends ValuesOperation | EntriesOperation | MapOperation ? Any[] : TValue extends Condition | EveryOperation | SomeOperation ? boolean : TValue extends OTP ? string : TValue extends RandomValue<string> ? string | string[] : TValue extends RandomValue<number> ? number : TValue extends Reference<infer TType extends Any> ? TType : TValue extends JSExpressionReference<infer TType extends Any> ? TType : TValue extends InterpolatedString ? string : TValue extends JSExpression ? string : TValue extends Structure ? Record<string, any> | any[] : TValue extends FileHandle ? string : TValue extends Pattern ? RegExp | Match : TValue extends ChromeTabDescriptor ? ResolvedChromeTabDescriptor : TValue extends ChromeElementDescriptor ? ChromeElementDescriptor : TValue extends ElementDescriptor ? ResolvedElementDescriptor : TValue;
|
|
9327
|
+
type EvaluatedExpression<TValue> = TValue extends ExtractOperation ? Any : TValue extends NumberExpression ? number : TValue extends SizeOperation ? number : TValue extends KeysOperation ? string[] : TValue extends ValuesOperation | EntriesOperation | MapOperation ? Any[] : TValue extends Condition | EveryOperation | SomeOperation ? boolean : TValue extends OTP ? string : TValue extends RandomValue<string> ? string | string[] : TValue extends RandomValue<number> ? number : TValue extends Reference<infer TType extends Any> ? TType : TValue extends JSExpressionReference<infer TType extends Any> ? TType : TValue extends InterpolatedString ? string : TValue extends JSExpression ? string : TValue extends Structure ? Record<string, any> | any[] : TValue extends FileHandle ? string : TValue extends Pattern ? RegExp | Match : TValue extends ChromeTabDescriptor ? ResolvedChromeTabDescriptor : TValue extends ChromeElementDescriptor ? ChromeElementDescriptor : TValue extends ElementDescriptor | ElementReference ? ResolvedElementDescriptor : TValue;
|
|
9278
9328
|
//#endregion
|
|
9279
9329
|
//#region src/handler.d.ts
|
|
9280
9330
|
type HandlerOptions<TAutomator extends Automator, TInstruction extends Instruction> = {
|
|
@@ -9282,11 +9332,16 @@ type HandlerOptions<TAutomator extends Automator, TInstruction extends Instructi
|
|
|
9282
9332
|
context: RunnerContext;
|
|
9283
9333
|
instruction: TInstruction;
|
|
9284
9334
|
signal?: AbortSignal;
|
|
9285
|
-
shouldCapture?: boolean; /**
|
|
9335
|
+
shouldCapture?: boolean; /** The live loop handle a block-form loop body runs under (see `handlers/loop.ts`). */
|
|
9336
|
+
loop?: LoopHandle; /** Stable identity of the instruction in the caller's program, used to key a loop handle. */
|
|
9337
|
+
stepId?: string;
|
|
9338
|
+
stepIndex?: number; /** Opaque id echoed on progress log events so a caller can tie them back to the run it triggered. */
|
|
9339
|
+
correlationId?: string; /** @internal for BE usage only */
|
|
9286
9340
|
shouldNotThrowOnUnexpectedNavigationStatus?: boolean; /** @internal for BE usage only */
|
|
9287
9341
|
expectedNavigationStatuses?: number[];
|
|
9288
9342
|
};
|
|
9289
9343
|
type RunResult$1<TResult extends HandleResult> = TResult & {
|
|
9344
|
+
/** The text the instruction was parsed from - see {@link getInstructionText}. */text?: string;
|
|
9290
9345
|
before?: Capture;
|
|
9291
9346
|
after?: Capture;
|
|
9292
9347
|
values: UsedValues;
|
|
@@ -9350,6 +9405,10 @@ declare abstract class Handler$1<TAutomator extends Automator, TInstruction exte
|
|
|
9350
9405
|
readonly instruction: TInstruction;
|
|
9351
9406
|
readonly signal: AbortSignal;
|
|
9352
9407
|
readonly shouldCapture: boolean;
|
|
9408
|
+
readonly loop?: LoopHandle;
|
|
9409
|
+
readonly stepId?: string;
|
|
9410
|
+
readonly correlationId?: string;
|
|
9411
|
+
readonly stepIndex?: number;
|
|
9353
9412
|
readonly shouldNotThrowOnUnexpectedNavigationStatus: boolean;
|
|
9354
9413
|
readonly expectedNavigationStatuses: number[];
|
|
9355
9414
|
get action(): TInstruction extends Action<any> ? TInstruction : unknown;
|
|
@@ -9365,6 +9424,10 @@ declare abstract class Handler$1<TAutomator extends Automator, TInstruction exte
|
|
|
9365
9424
|
instruction,
|
|
9366
9425
|
signal,
|
|
9367
9426
|
shouldCapture,
|
|
9427
|
+
loop,
|
|
9428
|
+
stepId,
|
|
9429
|
+
correlationId,
|
|
9430
|
+
stepIndex,
|
|
9368
9431
|
shouldNotThrowOnUnexpectedNavigationStatus,
|
|
9369
9432
|
expectedNavigationStatuses
|
|
9370
9433
|
}: HandlerOptions<TAutomator, TInstruction>);
|
|
@@ -9382,6 +9445,8 @@ declare abstract class Handler$1<TAutomator extends Automator, TInstruction exte
|
|
|
9382
9445
|
web: IAXNodeView<WebNode> | null;
|
|
9383
9446
|
mobile: IAXNodeView<IOSNode> | null;
|
|
9384
9447
|
}[TAutomator["type"]]>;
|
|
9448
|
+
/** The collection of elements the descriptor describes (see {@link AXOps.findNodes}). */
|
|
9449
|
+
elements(descriptor: ElementDescriptor | ResolvedElementDescriptor): Promise<IAXNodeView<any>[]>;
|
|
9385
9450
|
capture(): Promise<Capture | undefined>;
|
|
9386
9451
|
/** Best-effort scroll bringing the elements matched by this handler into the viewport, so the
|
|
9387
9452
|
* `after` capture shows them. Call it after the instruction's page reads are done — the scroll
|
|
@@ -9634,6 +9699,57 @@ declare class IfHandler extends Handler$1<Automator, IfControlFlow, IfResult> {
|
|
|
9634
9699
|
}>;
|
|
9635
9700
|
}
|
|
9636
9701
|
//#endregion
|
|
9702
|
+
//#region src/utils/iterator.d.ts
|
|
9703
|
+
type IterationEntry = {
|
|
9704
|
+
index: number;
|
|
9705
|
+
key: number | string;
|
|
9706
|
+
item: Any;
|
|
9707
|
+
result: Any;
|
|
9708
|
+
};
|
|
9709
|
+
//#endregion
|
|
9710
|
+
//#region src/handlers/loop.d.ts
|
|
9711
|
+
type LoopResult = {
|
|
9712
|
+
status: 'looped';
|
|
9713
|
+
meta: {
|
|
9714
|
+
iteration: number;
|
|
9715
|
+
done: boolean;
|
|
9716
|
+
next?: Instruction[];
|
|
9717
|
+
loop?: LoopHandle;
|
|
9718
|
+
};
|
|
9719
|
+
};
|
|
9720
|
+
type LoopState = {
|
|
9721
|
+
iteration: number; /** The exact iteration count when the loop's shape knows it up front. */
|
|
9722
|
+
total?: number;
|
|
9723
|
+
entries?: IterationEntry[]; /** The element iterable, resolved once per loop - a body that rebinds `it` must not shift it. */
|
|
9724
|
+
iterable?: ResolvedElementDescriptor; /** Removes this loop's bindings from the scope. */
|
|
9725
|
+
unbind?: () => void;
|
|
9726
|
+
};
|
|
9727
|
+
declare class LoopHandler extends Handler$1<Automator, LoopControlFlow, LoopResult> {
|
|
9728
|
+
#private;
|
|
9729
|
+
handle(): Promise<{
|
|
9730
|
+
status: "looped";
|
|
9731
|
+
meta: {
|
|
9732
|
+
iteration: number;
|
|
9733
|
+
done: boolean;
|
|
9734
|
+
loop: LoopHandle;
|
|
9735
|
+
};
|
|
9736
|
+
} | {
|
|
9737
|
+
status: "looped";
|
|
9738
|
+
meta: {
|
|
9739
|
+
iteration: any;
|
|
9740
|
+
done: boolean;
|
|
9741
|
+
next?: undefined;
|
|
9742
|
+
};
|
|
9743
|
+
} | {
|
|
9744
|
+
status: "looped";
|
|
9745
|
+
meta: {
|
|
9746
|
+
iteration: any;
|
|
9747
|
+
done: boolean;
|
|
9748
|
+
next: Instruction[];
|
|
9749
|
+
};
|
|
9750
|
+
}>;
|
|
9751
|
+
}
|
|
9752
|
+
//#endregion
|
|
9637
9753
|
//#region src/handlers/intent.d.ts
|
|
9638
9754
|
declare class IntentHandler extends Handler$1<Automator, Action<'intent'>> {
|
|
9639
9755
|
handle(): Promise<never>;
|
|
@@ -9949,6 +10065,7 @@ declare const handlers: {
|
|
|
9949
10065
|
'initialize scope': typeof InitializeScopeHandler;
|
|
9950
10066
|
try: typeof TryHandler;
|
|
9951
10067
|
if: typeof IfHandler;
|
|
10068
|
+
loop: typeof LoopHandler;
|
|
9952
10069
|
};
|
|
9953
10070
|
mobile: {
|
|
9954
10071
|
check: typeof CheckHandler;
|
|
@@ -9970,6 +10087,7 @@ declare const handlers: {
|
|
|
9970
10087
|
'initialize scope': typeof InitializeScopeHandler;
|
|
9971
10088
|
try: typeof TryHandler;
|
|
9972
10089
|
if: typeof IfHandler;
|
|
10090
|
+
loop: typeof LoopHandler;
|
|
9973
10091
|
"set value": never;
|
|
9974
10092
|
evaluate: never;
|
|
9975
10093
|
clear: never;
|
|
@@ -10033,7 +10151,8 @@ type RunnerOptions<TAutomator extends Automator> = {
|
|
|
10033
10151
|
screenshotTimeout?: number;
|
|
10034
10152
|
previewTimeout?: number;
|
|
10035
10153
|
maxWaitTimeout?: number;
|
|
10036
|
-
};
|
|
10154
|
+
}; /** How many iterations a loop may run before it fails; capped by the runner's hard maximum. */
|
|
10155
|
+
loopIterationLimit?: number;
|
|
10037
10156
|
shouldHideFilepickerDialogs?: boolean;
|
|
10038
10157
|
shouldSkipInitialNavigationInNestedScope?: boolean;
|
|
10039
10158
|
shouldSkipAssertionsInNestedScope?: boolean;
|
|
@@ -10045,7 +10164,9 @@ type RunnerOptions<TAutomator extends Automator> = {
|
|
|
10045
10164
|
};
|
|
10046
10165
|
};
|
|
10047
10166
|
type RunOptions = {
|
|
10048
|
-
stepIndex?: number;
|
|
10167
|
+
stepIndex?: number; /** Stable identity of this instruction in the caller's program, used to key a loop handle. */
|
|
10168
|
+
stepId?: string; /** The live loop handle when this instruction belongs to the body of a block-form loop. */
|
|
10169
|
+
loop?: LoopHandle;
|
|
10049
10170
|
signal?: AbortSignal;
|
|
10050
10171
|
shouldCapture?: boolean;
|
|
10051
10172
|
/** Opaque id echoed on each `subinstructionExecutionStarted` so a caller can tie the resulting
|
|
@@ -10302,6 +10423,14 @@ declare class AXOps<TAutomator extends Automator = Automator> {
|
|
|
10302
10423
|
searchCandidates<TNode>(tree: IAXTreeView<TNode>, descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): Promise<CandidateMetric[]>;
|
|
10303
10424
|
describeNode<TNode>(tree: IAXTreeView<TNode>, query: ElementDescriptorQuery<IAXNodeView<TNode>>): Promise<ResolvedElementDescriptor | undefined>;
|
|
10304
10425
|
findNode(descriptor: ResolvedElementDescriptor, options: FindNodeOptions): Promise<FindNodeResult<TAutomator>>;
|
|
10426
|
+
/**
|
|
10427
|
+
* Resolves an element descriptor to the collection of elements it describes - the candidates
|
|
10428
|
+
* whose match quality ties with the best one found, in document order. Used by for-each loops
|
|
10429
|
+
* over page elements, and by any consumer needing "every element matching the descriptor".
|
|
10430
|
+
* An empty collection is retried until the timeout, since a page mid-load may transiently
|
|
10431
|
+
* match nothing.
|
|
10432
|
+
*/
|
|
10433
|
+
findNodes(descriptor: ResolvedElementDescriptor, options: FindNodeOptions): Promise<IAXNodeView<any>[]>;
|
|
10305
10434
|
}
|
|
10306
10435
|
//#endregion
|
|
10307
10436
|
//#region src/types.d.ts
|
|
@@ -10326,6 +10455,18 @@ type UsedValues = {
|
|
|
10326
10455
|
element?: ResolvedElementDescriptor;
|
|
10327
10456
|
}>;
|
|
10328
10457
|
};
|
|
10458
|
+
/**
|
|
10459
|
+
* The state of a running block-form loop, handed to the caller and passed back with every
|
|
10460
|
+
* instruction of the body (see adr/2026-08-21-block-form-loop-handles.md). Opaque to the caller:
|
|
10461
|
+
* store it, echo it, never interpret it.
|
|
10462
|
+
*/
|
|
10463
|
+
type LoopHandle = {
|
|
10464
|
+
id: string; /** The head instruction, so bindings can be re-derived without runner-side state. */
|
|
10465
|
+
head: LoopControlFlow; /** The enclosing loop, so a nested body sees both sets of bindings. */
|
|
10466
|
+
parent?: LoopHandle; /** How many iterations have started. */
|
|
10467
|
+
iteration: number; /** When the loop started, for a per-loop wall-clock timeout. */
|
|
10468
|
+
startedAt: number;
|
|
10469
|
+
};
|
|
10329
10470
|
interface RunnerContext {
|
|
10330
10471
|
axOps: AXOps;
|
|
10331
10472
|
scope: Scope;
|
|
@@ -10333,6 +10474,14 @@ interface RunnerContext {
|
|
|
10333
10474
|
dispatcher?: Dispatcher;
|
|
10334
10475
|
activeElement?: WebNode;
|
|
10335
10476
|
preinstructions: Instruction[];
|
|
10477
|
+
/** Bookkeeping for each running loop, kept while the runner re-queues it. */
|
|
10478
|
+
loops?: Map<Instruction, LoopState>;
|
|
10479
|
+
/**
|
|
10480
|
+
* The most recently resolved element node - what an element reference (`it`) resolves to at
|
|
10481
|
+
* runtime. Every successful element find updates it, and a for-each loop over page elements
|
|
10482
|
+
* rebinds it to the current entry at the start of each iteration.
|
|
10483
|
+
*/
|
|
10484
|
+
activeAXNode?: IAXNodeView<any>;
|
|
10336
10485
|
}
|
|
10337
10486
|
type SelectorElementDescriptor = Required<Pick<ResolvedElementDescriptor, 'selector'>>;
|
|
10338
10487
|
declare namespace index_d_exports {
|
|
@@ -10803,4 +10952,4 @@ declare class HttpRemoteAXProvider extends RemoteAXProvider {
|
|
|
10803
10952
|
protected _rqFindAXNode<TNode>(nodes: IAXNodeView<TNode>[], descriptor: ResolvedElementDescriptor, options?: FindCandidatesOptions): Promise<CandidateMetricResponse | null>;
|
|
10804
10953
|
}
|
|
10805
10954
|
//#endregion
|
|
10806
|
-
export { type AXContentType, type AXControlType, type AXNodeFlat, type AXOption, type AXProvider, AXServerFetch, AXServerRequest, type AXState, type AXStructuralType, type AXStyle, type AXTreeFlat, type AXType, AbortError, type AnchorDescriptor, Automator, AutomatorError, BlockingDialog, BodyConsumedError, Browser, BrowserActivePageChangedEvent, BrowserDisconnectedEvent, BrowserPageClosedEvent, BrowserPageCreatedEvent, BrowserPageNavigatedEvent, BrowserStabilizingLoadEvent, BrowserStabilizingNavigationEvent, BrowserStabilizingOutgoingRequestsEvent, BrowserTargetCrashedEvent, BrowserTargetCreatedEvent, BrowserWindowCreatedEvent, CallableRemoteFunctionHandle, CandidateMetricResponse, CommandTimedOutError, Connection, Cookie, type CustomActions, Debugger, DebuggerPausedEvent, DebuggerResumedEvent, DescribeAXNodeResponse, type DescriptorStrategy, DialogHandledEvent, type ElementDescriptor, type ElementDescriptorQuery, EvaluationArguments, EvaluationExpression, EvaluationFunction, EvaluationOptions, EvaluationResult, Evaluator, EvaluatorDestroyedEvent, EvaluatorLogEvent, Expression, FilepickerDialog, FlagChangedEvent, Flags, FlagsSnapshot, FlushError, Frame, FrameDestroyedEvent, FrameDocumentRequestEvent, FrameDocumentResponseEvent, FrameEvaluatorAttached, FrameFetchError, FrameFetchOptions, FrameLifecycleEvent, FrameNavigatedEvent, FrameNavigatingEvent, FrameSwappedEvent, FrameSwappingEvent, type Har, HarRecorder, HarRecorderOptions, HarRecorderStatsChangedEvent, HarStats, HttpRemoteAXProvider, HttpRemoteAXProviderOptions, type IAXNodeView, type IAXTreeView, Injection, InjectionEvaluatorAttachedEvent, InjectionExpression, InjectionIncommingMessageEvent, InjectionOutgoingMessageEvent, InjectionTargetAttachedEvent, Intercepted, InterceptedRequest, InterceptedResponse, InterceptionHandler, InterceptionPattern, InterceptionPatternMatcher, Keyboard, Loader, LoaderRequestEvent, LoaderResponseEvent, LocalizedRemoteValue, MakeAXTreeResponse, Mouse, NavigationFailedError, NavigationTimedOutError, NoHistoryEntryError, Node, type NodeBackground, Port, PortIncommingMessageEvent, type PortMessageEvent, PortOutgoingMessageEvent, RemoteAXProvider, RemoteFunctionHandle, RemoteObjectHandle, type Request, type ResolvedAnchor, type ResolvedElementDescriptor, ResolvedRemoteValue, type Response$1 as Response, RunOptions, RunResult, Runner, RunnerAXNodeFoundEvent, type RunnerContext, RunnerFilepickerDialogRequestedEvent, RunnerOptions, RunnerStatusChangedEvent, Script, type SelectorElementDescriptor, StaleNodeError, StaleRemoteObjectHandleError, StylesheetHandle, Target, TargetActivatedEvent, TargetActivatingEvent, TargetAttachedEvent, TargetChangedEvent, TargetChildTargetCreatingEvent, TargetClosedEvent, TargetDetachedEvent, TargetDialogEvent, TargetElementSelectedEvent, TargetFilepickerDialogEvent, TargetFrameAttachedEvent, TargetFrameTargetCreatedEvent, TargetMainFrameReadyEvent, TargetNavigatedEvent, TargetVisibilityChangeEvent, type UsedValues, WebNode, Window, WindowDestroyedEvent, WindowTargetAttachedEvent, WindowTargetDetachedEvent, flags, isElementAcceptableInvisible, localizeRemoteValue, makeBlockingDialog, makeBrowser, makeBundledExpression, makeBundledScript, makeConnection, makeDebugger, makeEvaluator, makeExpression, makeFilepickerDialog, makeFrame, makeInjection, makeIntercepted, makeInterceptedRequest, makeInterceptedResponse, makeInterceptionPatternMatcher, makeKeyboard, makeLoader, makeMouse, makePort, makeRunner, makeScript, makeTarget, makeWebNode, makeWindow, provideRolldownConfig, index_d_exports as spec, toCDPPattern };
|
|
10955
|
+
export { type AXContentType, type AXControlType, type AXNodeFlat, type AXOption, type AXProvider, AXServerFetch, AXServerRequest, type AXState, type AXStructuralType, type AXStyle, type AXTreeFlat, type AXType, AbortError, type AnchorDescriptor, Automator, AutomatorError, BlockingDialog, BodyConsumedError, Browser, BrowserActivePageChangedEvent, BrowserDisconnectedEvent, BrowserPageClosedEvent, BrowserPageCreatedEvent, BrowserPageNavigatedEvent, BrowserStabilizingLoadEvent, BrowserStabilizingNavigationEvent, BrowserStabilizingOutgoingRequestsEvent, BrowserTargetCrashedEvent, BrowserTargetCreatedEvent, BrowserWindowCreatedEvent, CallableRemoteFunctionHandle, CandidateMetricResponse, CommandTimedOutError, Connection, Cookie, type CustomActions, Debugger, DebuggerPausedEvent, DebuggerResumedEvent, DescribeAXNodeResponse, type DescriptorStrategy, DialogHandledEvent, type ElementDescriptor, type ElementDescriptorQuery, EvaluationArguments, EvaluationExpression, EvaluationFunction, EvaluationOptions, EvaluationResult, Evaluator, EvaluatorDestroyedEvent, EvaluatorLogEvent, Expression, FilepickerDialog, FlagChangedEvent, Flags, FlagsSnapshot, FlushError, Frame, FrameDestroyedEvent, FrameDocumentRequestEvent, FrameDocumentResponseEvent, FrameEvaluatorAttached, FrameFetchError, FrameFetchOptions, FrameLifecycleEvent, FrameNavigatedEvent, FrameNavigatingEvent, FrameSwappedEvent, FrameSwappingEvent, type Har, HarRecorder, HarRecorderOptions, HarRecorderStatsChangedEvent, HarStats, HttpRemoteAXProvider, HttpRemoteAXProviderOptions, type IAXNodeView, type IAXTreeView, Injection, InjectionEvaluatorAttachedEvent, InjectionExpression, InjectionIncommingMessageEvent, InjectionOutgoingMessageEvent, InjectionTargetAttachedEvent, Intercepted, InterceptedRequest, InterceptedResponse, InterceptionHandler, InterceptionPattern, InterceptionPatternMatcher, Keyboard, Loader, LoaderRequestEvent, LoaderResponseEvent, LocalizedRemoteValue, type LoopHandle, MakeAXTreeResponse, Mouse, NavigationFailedError, NavigationTimedOutError, NoHistoryEntryError, Node, type NodeBackground, Port, PortIncommingMessageEvent, type PortMessageEvent, PortOutgoingMessageEvent, RemoteAXProvider, RemoteFunctionHandle, RemoteObjectHandle, type Request, type ResolvedAnchor, type ResolvedElementDescriptor, ResolvedRemoteValue, type Response$1 as Response, RunOptions, RunResult, Runner, RunnerAXNodeFoundEvent, type RunnerContext, RunnerFilepickerDialogRequestedEvent, RunnerOptions, RunnerStatusChangedEvent, Script, type SelectorElementDescriptor, StaleNodeError, StaleRemoteObjectHandleError, StylesheetHandle, Target, TargetActivatedEvent, TargetActivatingEvent, TargetAttachedEvent, TargetChangedEvent, TargetChildTargetCreatingEvent, TargetClosedEvent, TargetDetachedEvent, TargetDialogEvent, TargetElementSelectedEvent, TargetFilepickerDialogEvent, TargetFrameAttachedEvent, TargetFrameTargetCreatedEvent, TargetMainFrameReadyEvent, TargetNavigatedEvent, TargetVisibilityChangeEvent, type UsedValues, WebNode, Window, WindowDestroyedEvent, WindowTargetAttachedEvent, WindowTargetDetachedEvent, flags, isElementAcceptableInvisible, localizeRemoteValue, makeBlockingDialog, makeBrowser, makeBundledExpression, makeBundledScript, makeConnection, makeDebugger, makeEvaluator, makeExpression, makeFilepickerDialog, makeFrame, makeInjection, makeIntercepted, makeInterceptedRequest, makeInterceptedResponse, makeInterceptionPatternMatcher, makeKeyboard, makeLoader, makeMouse, makePort, makeRunner, makeScript, makeTarget, makeWebNode, makeWindow, provideRolldownConfig, index_d_exports as spec, toCDPPattern };
|