@enricai/barnacle 1.12.78 → 1.12.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/helpers/reply.d.ts.map +1 -1
- package/dist/api/helpers/reply.js +5 -2
- package/dist/api/helpers/reply.js.map +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/lib/llm/judge.d.ts.map +1 -1
- package/dist/lib/llm/judge.js +6 -1
- package/dist/lib/llm/judge.js.map +1 -1
- package/dist/lib/llm/judges/verify-step-advanced.d.ts +30 -0
- package/dist/lib/llm/judges/verify-step-advanced.d.ts.map +1 -0
- package/dist/lib/llm/judges/verify-step-advanced.js +62 -0
- package/dist/lib/llm/judges/verify-step-advanced.js.map +1 -0
- package/dist/lib/llm/judges/verify-submit.d.ts +7 -1
- package/dist/lib/llm/judges/verify-submit.d.ts.map +1 -1
- package/dist/lib/llm/judges/verify-submit.js +29 -8
- package/dist/lib/llm/judges/verify-submit.js.map +1 -1
- package/dist/lib/llm/schemas.d.ts +8 -0
- package/dist/lib/llm/schemas.d.ts.map +1 -1
- package/dist/lib/llm/schemas.js +21 -13
- package/dist/lib/llm/schemas.js.map +1 -1
- package/dist/lib/logging.d.ts +7 -0
- package/dist/lib/logging.d.ts.map +1 -1
- package/dist/lib/logging.js +19 -1
- package/dist/lib/logging.js.map +1 -1
- package/dist/lib/pii-redaction.d.ts +104 -0
- package/dist/lib/pii-redaction.d.ts.map +1 -0
- package/dist/lib/pii-redaction.js +397 -0
- package/dist/lib/pii-redaction.js.map +1 -0
- package/dist/lib/random.d.ts +3 -1
- package/dist/lib/random.d.ts.map +1 -1
- package/dist/lib/random.js +7 -2
- package/dist/lib/random.js.map +1 -1
- package/dist/lib/telemetry/beacon-capture.d.ts.map +1 -1
- package/dist/lib/telemetry/beacon-capture.js +2 -0
- package/dist/lib/telemetry/beacon-capture.js.map +1 -1
- package/dist/lib/telemetry/call-capture.d.ts.map +1 -1
- package/dist/lib/telemetry/call-capture.js +4 -1
- package/dist/lib/telemetry/call-capture.js.map +1 -1
- package/dist/lib/telemetry/submission-capture.d.ts +11 -1
- package/dist/lib/telemetry/submission-capture.d.ts.map +1 -1
- package/dist/lib/telemetry/submission-capture.js +32 -3
- package/dist/lib/telemetry/submission-capture.js.map +1 -1
- package/dist/plugins/config-plugin.d.ts +8 -0
- package/dist/plugins/config-plugin.d.ts.map +1 -1
- package/dist/plugins/config-plugin.js +6 -1
- package/dist/plugins/config-plugin.js.map +1 -1
- package/dist/plugins/discover.d.ts.map +1 -1
- package/dist/plugins/discover.js +2 -0
- package/dist/plugins/discover.js.map +1 -1
- package/dist/plugins/loader.d.ts.map +1 -1
- package/dist/plugins/loader.js +23 -6
- package/dist/plugins/loader.js.map +1 -1
- package/dist/scraper/actionable-visibility-expr.d.ts +12 -0
- package/dist/scraper/actionable-visibility-expr.d.ts.map +1 -0
- package/dist/scraper/actionable-visibility-expr.js +22 -0
- package/dist/scraper/actionable-visibility-expr.js.map +1 -0
- package/dist/scraper/active-page.d.ts +18 -0
- package/dist/scraper/active-page.d.ts.map +1 -0
- package/dist/scraper/active-page.js +53 -0
- package/dist/scraper/active-page.js.map +1 -0
- package/dist/scraper/browser-click-expr.d.ts +1 -1
- package/dist/scraper/browser-click-expr.d.ts.map +1 -1
- package/dist/scraper/browser-click-expr.js +2 -6
- package/dist/scraper/browser-click-expr.js.map +1 -1
- package/dist/scraper/click-settle.d.ts +19 -0
- package/dist/scraper/click-settle.d.ts.map +1 -0
- package/dist/scraper/click-settle.js +65 -0
- package/dist/scraper/click-settle.js.map +1 -0
- package/dist/scraper/deep-locator-candidates.d.ts +20 -1
- package/dist/scraper/deep-locator-candidates.d.ts.map +1 -1
- package/dist/scraper/deep-locator-candidates.js +110 -22
- package/dist/scraper/deep-locator-candidates.js.map +1 -1
- package/dist/scraper/deep-locator-scan.d.ts +12 -0
- package/dist/scraper/deep-locator-scan.d.ts.map +1 -1
- package/dist/scraper/deep-locator-scan.js +42 -13
- package/dist/scraper/deep-locator-scan.js.map +1 -1
- package/dist/scraper/errors.d.ts +10 -0
- package/dist/scraper/errors.d.ts.map +1 -1
- package/dist/scraper/errors.js +19 -1
- package/dist/scraper/errors.js.map +1 -1
- package/dist/scraper/flow-runner.d.ts +355 -6
- package/dist/scraper/flow-runner.d.ts.map +1 -1
- package/dist/scraper/flow-runner.js +2255 -350
- package/dist/scraper/flow-runner.js.map +1 -1
- package/dist/scraper/navigate.d.ts +3 -3
- package/dist/scraper/navigate.js +4 -4
- package/dist/scraper/navigate.js.map +1 -1
- package/dist/scraper/phantom-click.d.ts +34 -2
- package/dist/scraper/phantom-click.d.ts.map +1 -1
- package/dist/scraper/phantom-click.js +80 -6
- package/dist/scraper/phantom-click.js.map +1 -1
- package/dist/scraper/pool.d.ts.map +1 -1
- package/dist/scraper/pool.js +8 -1
- package/dist/scraper/pool.js.map +1 -1
- package/dist/scraper/quoted-spans.d.ts +35 -0
- package/dist/scraper/quoted-spans.d.ts.map +1 -0
- package/dist/scraper/quoted-spans.js +83 -0
- package/dist/scraper/quoted-spans.js.map +1 -0
- package/dist/scraper/retry.d.ts +1 -1
- package/dist/scraper/retry.d.ts.map +1 -1
- package/dist/scraper/retry.js +5 -1
- package/dist/scraper/retry.js.map +1 -1
- package/dist/scraper/session-browserbase.d.ts +4 -2
- package/dist/scraper/session-browserbase.d.ts.map +1 -1
- package/dist/scraper/session-browserbase.js +63 -20
- package/dist/scraper/session-browserbase.js.map +1 -1
- package/dist/scraper/session-shared.d.ts +5 -0
- package/dist/scraper/session-shared.d.ts.map +1 -1
- package/dist/scraper/session-shared.js.map +1 -1
- package/dist/scraper/session-steel.d.ts.map +1 -1
- package/dist/scraper/session-steel.js +16 -2
- package/dist/scraper/session-steel.js.map +1 -1
- package/dist/scraper/session-teardown.d.ts +31 -1
- package/dist/scraper/session-teardown.d.ts.map +1 -1
- package/dist/scraper/session-teardown.js +60 -4
- package/dist/scraper/session-teardown.js.map +1 -1
- package/dist/scraper/spa-readiness.d.ts +13 -1
- package/dist/scraper/spa-readiness.d.ts.map +1 -1
- package/dist/scraper/spa-readiness.js +31 -1
- package/dist/scraper/spa-readiness.js.map +1 -1
- package/dist/scraper/stagehand-guard.d.ts +8 -3
- package/dist/scraper/stagehand-guard.d.ts.map +1 -1
- package/dist/scraper/stagehand-guard.js +181 -13
- package/dist/scraper/stagehand-guard.js.map +1 -1
- package/dist/scraper/submit-control.d.ts +2 -2
- package/dist/scraper/submit-control.d.ts.map +1 -1
- package/dist/scraper/submit-control.js +5 -21
- package/dist/scraper/submit-control.js.map +1 -1
- package/dist/scraper/target-resolution-diagnostic.d.ts.map +1 -1
- package/dist/scraper/target-resolution-diagnostic.js +6 -11
- package/dist/scraper/target-resolution-diagnostic.js.map +1 -1
- package/dist/scraper/transient-provider-error.d.ts +19 -0
- package/dist/scraper/transient-provider-error.d.ts.map +1 -0
- package/dist/scraper/transient-provider-error.js +59 -0
- package/dist/scraper/transient-provider-error.js.map +1 -0
- package/dist/scraper/trusted-click.d.ts +122 -0
- package/dist/scraper/trusted-click.d.ts.map +1 -0
- package/dist/scraper/trusted-click.js +201 -0
- package/dist/scraper/trusted-click.js.map +1 -0
- package/dist/scraper/upload-affordance-expr.d.ts +33 -0
- package/dist/scraper/upload-affordance-expr.d.ts.map +1 -0
- package/dist/scraper/upload-affordance-expr.js +91 -0
- package/dist/scraper/upload-affordance-expr.js.map +1 -0
- package/dist/scripts/recon-browser.d.ts +30 -2
- package/dist/scripts/recon-browser.d.ts.map +1 -1
- package/dist/scripts/recon-browser.js +133 -27
- package/dist/scripts/recon-browser.js.map +1 -1
- package/dist/scripts/recon-capture-rebind.d.ts +11 -0
- package/dist/scripts/recon-capture-rebind.d.ts.map +1 -0
- package/dist/scripts/recon-capture-rebind.js +26 -0
- package/dist/scripts/recon-capture-rebind.js.map +1 -0
- package/dist/scripts/recon-generate.d.ts +159 -8
- package/dist/scripts/recon-generate.d.ts.map +1 -1
- package/dist/scripts/recon-generate.js +998 -182
- package/dist/scripts/recon-generate.js.map +1 -1
- package/dist/scripts/recon-shared.d.ts +7 -0
- package/dist/scripts/recon-shared.d.ts.map +1 -1
- package/dist/scripts/recon-shared.js +19 -0
- package/dist/scripts/recon-shared.js.map +1 -1
- package/dist/site-plugin.d.ts +8 -0
- package/dist/site-plugin.d.ts.map +1 -1
- package/dist/types/pii-redaction.d.ts +39 -0
- package/dist/types/pii-redaction.d.ts.map +1 -0
- package/dist/types/pii-redaction.js +3 -0
- package/dist/types/pii-redaction.js.map +1 -0
- package/package.json +14 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centre-then-hit-test wrapper around Stagehand's trusted `Locator.click()`.
|
|
3
|
+
* Stagehand scrolls with `DOM.scrollIntoViewIfNeeded` (which can leave the
|
|
4
|
+
* target flush against a sticky header or fixed footer) and then clicks the
|
|
5
|
+
* content-box centre without checking what is painted there, so an overlay
|
|
6
|
+
* silently swallows the click. This helper first scrolls the target to the
|
|
7
|
+
* viewport centre, confirms via `elementFromPoint` that the point resolves to
|
|
8
|
+
* the target or a descendant, and only then delivers the trusted click.
|
|
9
|
+
*/
|
|
10
|
+
import type { FrameTarget } from "./frame-target";
|
|
11
|
+
/** Total centre + hit-test passes before an occluded target is reported as an error. */
|
|
12
|
+
export declare const DEFAULT_CENTRED_CLICK_ATTEMPTS = 3;
|
|
13
|
+
/** Outcome of one in-page centre + hit-test pass. */
|
|
14
|
+
export interface CentredHitTestResult {
|
|
15
|
+
/** `"hit"` when the centre point resolves to the target; otherwise why not. */
|
|
16
|
+
state: "hit" | "occluded" | "missing" | "mismatch";
|
|
17
|
+
/** Short description of the element covering the point, when occluded. */
|
|
18
|
+
occluder?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Evaluates a function declaration source with the target element bound as
|
|
22
|
+
* `this`. Injected so the deep-locator path can run it via
|
|
23
|
+
* `Runtime.callFunctionOn` on `locator.resolveNode().objectId`.
|
|
24
|
+
*/
|
|
25
|
+
export type EvaluateOnElementFn = (functionDeclaration: string) => Promise<CentredHitTestResult>;
|
|
26
|
+
/** The minimal clickable surface both `Page.locator()` and `deepLocator().nth(i)` satisfy. */
|
|
27
|
+
export interface TrustedClickable {
|
|
28
|
+
click(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export interface CentredTrustedClickOptions {
|
|
31
|
+
/** Overrides {@link DEFAULT_CENTRED_CLICK_ATTEMPTS}. */
|
|
32
|
+
attempts?: number;
|
|
33
|
+
/** Names the target in logs and errors. */
|
|
34
|
+
label?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Normalised text (whitespace collapsed, trimmed) the target must still have
|
|
37
|
+
* after the centring scroll; a virtualized list can re-bind the node to a
|
|
38
|
+
* different item mid-scroll. A mismatch withholds the click.
|
|
39
|
+
*/
|
|
40
|
+
expectText?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Re-checks the target's identity in a separate call after the centring pass
|
|
43
|
+
* and immediately before the click, so a re-render that landed while the
|
|
44
|
+
* centring call was in flight (or that no in-page check could see) still
|
|
45
|
+
* withholds the click. Resolving `false` is reported as an identity mismatch.
|
|
46
|
+
*/
|
|
47
|
+
verifyBeforeClick?: () => Promise<boolean>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* In-page function (`this` is the target element): centres it, then hit-tests
|
|
51
|
+
* the content-box centre, walking up through shadow-root hosts so a target
|
|
52
|
+
* inside a shadow tree still counts as hit by its own descendants.
|
|
53
|
+
*/
|
|
54
|
+
export declare const CENTRE_AND_HIT_TEST_FN: string;
|
|
55
|
+
/**
|
|
56
|
+
* Builds the centring function; with `expectText` the identity check runs in
|
|
57
|
+
* the same synchronous in-page call, after the scroll and before the hit-test,
|
|
58
|
+
* so no await gap lets a re-render swap the node in between.
|
|
59
|
+
*/
|
|
60
|
+
export declare function buildCentreAndHitTestFn(expectText?: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Thrown by {@link centreAndHitTest} when no pass lands on the target. `state`
|
|
63
|
+
* lets callers tell an occluder or a re-bound node (never click) from a target
|
|
64
|
+
* the evaluating document cannot see (Stagehand may still resolve it across a
|
|
65
|
+
* frame or shadow boundary).
|
|
66
|
+
*/
|
|
67
|
+
export declare class CentredClickError extends Error {
|
|
68
|
+
readonly state: "occluded" | "missing" | "mismatch";
|
|
69
|
+
constructor(message: string, state: "occluded" | "missing" | "mismatch");
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Centre + hit-test until the click point lands on the target, without
|
|
73
|
+
* clicking. Lets callers whose click is delivered elsewhere (e.g. a Stagehand
|
|
74
|
+
* `Locator.click()` that re-scrolls and clicks the content-box centre) still
|
|
75
|
+
* guarantee a clear click point first. Retries re-centre because a lazy-loaded
|
|
76
|
+
* layout shift or a sticky bar can move between passes.
|
|
77
|
+
*
|
|
78
|
+
* @throws when the target is missing, fails the `expectText` identity check
|
|
79
|
+
* (no retry: the node was re-bound), or is still occluded after all attempts —
|
|
80
|
+
* never clicks an overlay.
|
|
81
|
+
*/
|
|
82
|
+
export declare function centreAndHitTest(evaluateOnElement: EvaluateOnElementFn, opts?: CentredTrustedClickOptions): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Centres `sel`'s element and hit-tests its content-box centre, returning the
|
|
85
|
+
* raw outcome (or `null` when the evaluation itself failed) so primitives that
|
|
86
|
+
* deliver their own trusted click can tell a real overlay (`occluded` by a named
|
|
87
|
+
* element) from an indeterminate read (no layout, nothing at the point).
|
|
88
|
+
*/
|
|
89
|
+
export declare function probeClickPoint(target: FrameTarget, sel: string): Promise<CentredHitTestResult | null>;
|
|
90
|
+
/**
|
|
91
|
+
* Hit test (centres the target first) for primitives that deliver their own trusted click:
|
|
92
|
+
* true only when `elementFromPoint` at the content-box centre is `sel`'s
|
|
93
|
+
* element or inside it, so a leftover popup over the field is detectable
|
|
94
|
+
* before the click is spent on it.
|
|
95
|
+
*/
|
|
96
|
+
export declare function isClickPointUnobscured(target: FrameTarget, sel: string): Promise<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* Core loop shared by every entry point: centre + hit-test until the point
|
|
99
|
+
* lands on the target, then click exactly once.
|
|
100
|
+
*
|
|
101
|
+
* @throws when the target is missing or still occluded after all attempts —
|
|
102
|
+
* never clicks an overlay.
|
|
103
|
+
*/
|
|
104
|
+
export declare function clickAfterCentredHitTest(clickable: TrustedClickable, evaluateOnElement: EvaluateOnElementFn, opts?: CentredTrustedClickOptions): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Resolves the handle a trusted click is delivered on. A locator that clicks
|
|
107
|
+
* itself is used directly; one that only exposes `first()` (the shape every
|
|
108
|
+
* trusted click used before the centring helper existed) is narrowed to its
|
|
109
|
+
* first match.
|
|
110
|
+
*/
|
|
111
|
+
export declare function firstMatchClickable(locator: ReturnType<FrameTarget["locator"]>): TrustedClickable;
|
|
112
|
+
/**
|
|
113
|
+
* Trusted-clicks `selector` inside a main-frame or child-frame `FrameTarget`
|
|
114
|
+
* after centring it and confirming the click point hits it.
|
|
115
|
+
*/
|
|
116
|
+
export declare function clickCentredTrusted(target: FrameTarget, selector: string, opts?: CentredTrustedClickOptions): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Centres `selector` and confirms its click point is unobstructed without
|
|
119
|
+
* clicking, so a subsequent Stagehand-issued click lands on the target.
|
|
120
|
+
*/
|
|
121
|
+
export declare function centreSelectorForClick(target: FrameTarget, selector: string, opts?: CentredTrustedClickOptions): Promise<void>;
|
|
122
|
+
//# sourceMappingURL=trusted-click.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-click.d.ts","sourceRoot":"","sources":["../../src/scraper/trusted-click.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D,wFAAwF;AACxF,eAAO,MAAM,8BAA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,GACV,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAGtC;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/F;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,gBAAgB,EAC3B,iBAAiB,EAAE,mBAAmB,EACtC,IAAI,GAAE,0BAA+B,GACpC,OAAO,CAAC,IAAI,CAAC,CAGf;AAmBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAEjG;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,0BAA+B,GACpC,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,0BAA+B,GACpC,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Centre-then-hit-test wrapper around Stagehand's trusted `Locator.click()`.
|
|
4
|
+
* Stagehand scrolls with `DOM.scrollIntoViewIfNeeded` (which can leave the
|
|
5
|
+
* target flush against a sticky header or fixed footer) and then clicks the
|
|
6
|
+
* content-box centre without checking what is painted there, so an overlay
|
|
7
|
+
* silently swallows the click. This helper first scrolls the target to the
|
|
8
|
+
* viewport centre, confirms via `elementFromPoint` that the point resolves to
|
|
9
|
+
* the target or a descendant, and only then delivers the trusted click.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CentredClickError = exports.CENTRE_AND_HIT_TEST_FN = exports.DEFAULT_CENTRED_CLICK_ATTEMPTS = void 0;
|
|
13
|
+
exports.buildCentreAndHitTestFn = buildCentreAndHitTestFn;
|
|
14
|
+
exports.centreAndHitTest = centreAndHitTest;
|
|
15
|
+
exports.probeClickPoint = probeClickPoint;
|
|
16
|
+
exports.isClickPointUnobscured = isClickPointUnobscured;
|
|
17
|
+
exports.clickAfterCentredHitTest = clickAfterCentredHitTest;
|
|
18
|
+
exports.firstMatchClickable = firstMatchClickable;
|
|
19
|
+
exports.clickCentredTrusted = clickCentredTrusted;
|
|
20
|
+
exports.centreSelectorForClick = centreSelectorForClick;
|
|
21
|
+
const logging_1 = require("../lib/logging");
|
|
22
|
+
const logger = (0, logging_1.getLogger)({ name: "scraper/trusted-click" });
|
|
23
|
+
/** Total centre + hit-test passes before an occluded target is reported as an error. */
|
|
24
|
+
exports.DEFAULT_CENTRED_CLICK_ATTEMPTS = 3;
|
|
25
|
+
/**
|
|
26
|
+
* In-page function (`this` is the target element): centres it, then hit-tests
|
|
27
|
+
* the content-box centre, walking up through shadow-root hosts so a target
|
|
28
|
+
* inside a shadow tree still counts as hit by its own descendants.
|
|
29
|
+
*/
|
|
30
|
+
exports.CENTRE_AND_HIT_TEST_FN = buildCentreAndHitTestFn();
|
|
31
|
+
/**
|
|
32
|
+
* Builds the centring function; with `expectText` the identity check runs in
|
|
33
|
+
* the same synchronous in-page call, after the scroll and before the hit-test,
|
|
34
|
+
* so no await gap lets a re-render swap the node in between.
|
|
35
|
+
*/
|
|
36
|
+
function buildCentreAndHitTestFn(expectText) {
|
|
37
|
+
const identityCheck = expectText === undefined
|
|
38
|
+
? ""
|
|
39
|
+
: `
|
|
40
|
+
const actual = (el.textContent || "").replace(/\\s+/g, " ").trim();
|
|
41
|
+
if (actual !== ${JSON.stringify(expectText)}) return { state: "mismatch" };`;
|
|
42
|
+
return `function () {
|
|
43
|
+
const el = this;
|
|
44
|
+
if (!el || !el.isConnected) return { state: "missing" };
|
|
45
|
+
el.scrollIntoView({ block: "center", inline: "center" });${identityCheck}
|
|
46
|
+
const rect = el.getBoundingClientRect();
|
|
47
|
+
const cs = getComputedStyle(el);
|
|
48
|
+
const px = (v) => parseFloat(v) || 0;
|
|
49
|
+
const left = rect.left + px(cs.borderLeftWidth) + px(cs.paddingLeft);
|
|
50
|
+
const right = rect.right - px(cs.borderRightWidth) - px(cs.paddingRight);
|
|
51
|
+
const top = rect.top + px(cs.borderTopWidth) + px(cs.paddingTop);
|
|
52
|
+
const bottom = rect.bottom - px(cs.borderBottomWidth) - px(cs.paddingBottom);
|
|
53
|
+
const x = (left + right) / 2;
|
|
54
|
+
const y = (top + bottom) / 2;
|
|
55
|
+
let hit = el.getRootNode().elementFromPoint
|
|
56
|
+
? el.getRootNode().elementFromPoint(x, y)
|
|
57
|
+
: document.elementFromPoint(x, y);
|
|
58
|
+
for (let node = hit; node; ) {
|
|
59
|
+
if (node === el) return { state: "hit" };
|
|
60
|
+
node = node.parentNode && node.parentNode.host ? node.parentNode.host : node.parentNode;
|
|
61
|
+
}
|
|
62
|
+
const tag = hit && hit.tagName ? hit.tagName.toLowerCase() : "none";
|
|
63
|
+
const id = hit && hit.id ? "#" + hit.id : "";
|
|
64
|
+
return { state: "occluded", occluder: tag + id };
|
|
65
|
+
}`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Thrown by {@link centreAndHitTest} when no pass lands on the target. `state`
|
|
69
|
+
* lets callers tell an occluder or a re-bound node (never click) from a target
|
|
70
|
+
* the evaluating document cannot see (Stagehand may still resolve it across a
|
|
71
|
+
* frame or shadow boundary).
|
|
72
|
+
*/
|
|
73
|
+
class CentredClickError extends Error {
|
|
74
|
+
state;
|
|
75
|
+
constructor(message, state) {
|
|
76
|
+
super(message);
|
|
77
|
+
this.state = state;
|
|
78
|
+
this.name = "CentredClickError";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.CentredClickError = CentredClickError;
|
|
82
|
+
/**
|
|
83
|
+
* Centre + hit-test until the click point lands on the target, without
|
|
84
|
+
* clicking. Lets callers whose click is delivered elsewhere (e.g. a Stagehand
|
|
85
|
+
* `Locator.click()` that re-scrolls and clicks the content-box centre) still
|
|
86
|
+
* guarantee a clear click point first. Retries re-centre because a lazy-loaded
|
|
87
|
+
* layout shift or a sticky bar can move between passes.
|
|
88
|
+
*
|
|
89
|
+
* @throws when the target is missing, fails the `expectText` identity check
|
|
90
|
+
* (no retry: the node was re-bound), or is still occluded after all attempts —
|
|
91
|
+
* never clicks an overlay.
|
|
92
|
+
*/
|
|
93
|
+
async function centreAndHitTest(evaluateOnElement, opts = {}) {
|
|
94
|
+
const attempts = Math.max(1, opts.attempts ?? exports.DEFAULT_CENTRED_CLICK_ATTEMPTS);
|
|
95
|
+
const label = opts.label ?? "target";
|
|
96
|
+
const centreFn = opts.expectText === undefined
|
|
97
|
+
? exports.CENTRE_AND_HIT_TEST_FN
|
|
98
|
+
: buildCentreAndHitTestFn(opts.expectText);
|
|
99
|
+
let last = { state: "missing" };
|
|
100
|
+
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
101
|
+
const result = await evaluateOnElement(centreFn);
|
|
102
|
+
if (typeof result?.state !== "string") {
|
|
103
|
+
throw new TypeError(`hit-test probe for ${label} returned no state`);
|
|
104
|
+
}
|
|
105
|
+
last =
|
|
106
|
+
result.state === "hit" || result.state === "occluded" || result.state === "mismatch"
|
|
107
|
+
? result
|
|
108
|
+
: { state: "missing" };
|
|
109
|
+
if (last.state === "hit") {
|
|
110
|
+
if (opts.verifyBeforeClick && !(await opts.verifyBeforeClick())) {
|
|
111
|
+
last = { state: "mismatch" };
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (last.state === "mismatch")
|
|
117
|
+
break;
|
|
118
|
+
logger.warn(`click point for ${label} not on target (${last.state}${last.occluder ? `, covered by ${last.occluder}` : ""}), attempt: ${attempt}/${attempts}`);
|
|
119
|
+
}
|
|
120
|
+
if (last.state === "mismatch") {
|
|
121
|
+
throw new CentredClickError(`centred click: ${label} identity mismatch after scroll, click withheld`, "mismatch");
|
|
122
|
+
}
|
|
123
|
+
throw new CentredClickError(last.state === "missing"
|
|
124
|
+
? `centred click: ${label} is not in the document`
|
|
125
|
+
: `centred click: ${label} is occluded by ${last.occluder ?? "another element"} after ${attempts} attempts`, last.state === "missing" ? "missing" : "occluded");
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Centres `sel`'s element and hit-tests its content-box centre, returning the
|
|
129
|
+
* raw outcome (or `null` when the evaluation itself failed) so primitives that
|
|
130
|
+
* deliver their own trusted click can tell a real overlay (`occluded` by a named
|
|
131
|
+
* element) from an indeterminate read (no layout, nothing at the point).
|
|
132
|
+
*/
|
|
133
|
+
async function probeClickPoint(target, sel) {
|
|
134
|
+
const expression = buildSelectorExpression(sel);
|
|
135
|
+
return await target.evaluate(expression).catch(() => null);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Hit test (centres the target first) for primitives that deliver their own trusted click:
|
|
139
|
+
* true only when `elementFromPoint` at the content-box centre is `sel`'s
|
|
140
|
+
* element or inside it, so a leftover popup over the field is detectable
|
|
141
|
+
* before the click is spent on it.
|
|
142
|
+
*/
|
|
143
|
+
async function isClickPointUnobscured(target, sel) {
|
|
144
|
+
return (await probeClickPoint(target, sel))?.state === "hit";
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Core loop shared by every entry point: centre + hit-test until the point
|
|
148
|
+
* lands on the target, then click exactly once.
|
|
149
|
+
*
|
|
150
|
+
* @throws when the target is missing or still occluded after all attempts —
|
|
151
|
+
* never clicks an overlay.
|
|
152
|
+
*/
|
|
153
|
+
async function clickAfterCentredHitTest(clickable, evaluateOnElement, opts = {}) {
|
|
154
|
+
await centreAndHitTest(evaluateOnElement, opts);
|
|
155
|
+
await clickable.click();
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Builds the in-frame expression resolving `selector` (css, or `xpath=` /
|
|
159
|
+
* bare xpath beginning with `/` or `(`) and applying the centring function.
|
|
160
|
+
*/
|
|
161
|
+
function buildSelectorExpression(selector, expectText) {
|
|
162
|
+
const stripped = selector.startsWith("xpath=") ? selector.slice("xpath=".length) : selector;
|
|
163
|
+
const isXpath = stripped.startsWith("/") || stripped.startsWith("(");
|
|
164
|
+
const lookup = isXpath
|
|
165
|
+
? `document.evaluate(${JSON.stringify(stripped)}, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue`
|
|
166
|
+
: `document.querySelector(${JSON.stringify(selector)})`;
|
|
167
|
+
return `(() => {
|
|
168
|
+
const el = ${lookup};
|
|
169
|
+
if (!el) return { state: "missing" };
|
|
170
|
+
return (${buildCentreAndHitTestFn(expectText)}).call(el);
|
|
171
|
+
})()`;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Resolves the handle a trusted click is delivered on. A locator that clicks
|
|
175
|
+
* itself is used directly; one that only exposes `first()` (the shape every
|
|
176
|
+
* trusted click used before the centring helper existed) is narrowed to its
|
|
177
|
+
* first match.
|
|
178
|
+
*/
|
|
179
|
+
function firstMatchClickable(locator) {
|
|
180
|
+
return typeof locator.click === "function" ? locator : locator.first();
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Trusted-clicks `selector` inside a main-frame or child-frame `FrameTarget`
|
|
184
|
+
* after centring it and confirming the click point hits it.
|
|
185
|
+
*/
|
|
186
|
+
async function clickCentredTrusted(target, selector, opts = {}) {
|
|
187
|
+
const expression = buildSelectorExpression(selector, opts.expectText);
|
|
188
|
+
await clickAfterCentredHitTest(firstMatchClickable(target.locator(selector)), () => target.evaluate(expression), { label: selector, ...opts });
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Centres `selector` and confirms its click point is unobstructed without
|
|
192
|
+
* clicking, so a subsequent Stagehand-issued click lands on the target.
|
|
193
|
+
*/
|
|
194
|
+
async function centreSelectorForClick(target, selector, opts = {}) {
|
|
195
|
+
const expression = buildSelectorExpression(selector, opts.expectText);
|
|
196
|
+
await centreAndHitTest(() => target.evaluate(expression), {
|
|
197
|
+
label: selector,
|
|
198
|
+
...opts,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=trusted-click.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-click.js","sourceRoot":"","sources":["../../src/scraper/trusted-click.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;AAEH,2CAA0C;AAG1C,MAAM,MAAM,GAAG,IAAA,mBAAS,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAE5D,wFAAwF;AAC3E,QAAA,8BAA8B,GAAG,CAAC,CAAC;AA0ChD;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,uBAAuB,EAAE,CAAC;AAEhE;;;;GAIG;AACH,iCAAwC,UAAmB;IACzD,MAAM,aAAa,GACjB,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;;mBAEW,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,iCAAiC,CAAC;IAC7E,OAAO;;;6DAGoD,aAAa;;;;;;;;;;;;;;;;;;;;EAoBxE,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,uBAA+B,SAAQ,KAAK;IAG/B,KAAK;IAFhB,YACE,OAAe,EACN,KAA0C;QAEnD,KAAK,CAAC,OAAO,CAAC,CAAC;qBAFN,KAAK;QAGd,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;;AAED;;;;;;;;;;GAUG;AACI,KAAK,2BACV,iBAAsC,EACtC,IAAI,GAA+B,EAAE;IAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAA,8BAA8B,CAAC,CAAC;IAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,KAA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CAAC,EAAE;QAC9E,KAAK,EAAE,QAAQ;QACf,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalised-label predicate for the Node side. It exists so the Node
|
|
3
|
+
* matcher and the browser expression derive from the same regex sources and
|
|
4
|
+
* cannot drift (a singular-only copy once missed "Select files").
|
|
5
|
+
*/
|
|
6
|
+
export declare function matchesUploadAffordanceVocabulary(label: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Browser-evaluable function-expression string giving the same verdicts as
|
|
9
|
+
* {@link matchesUploadAffordanceVocabulary}, for interpolation into
|
|
10
|
+
* `page.evaluate` template literals.
|
|
11
|
+
*/
|
|
12
|
+
export declare const UPLOAD_AFFORDANCE_MATCHER_EXPR: string;
|
|
13
|
+
/**
|
|
14
|
+
* Single drop-zone selector list shared by the render-gate and the synthetic
|
|
15
|
+
* drag-drop so the two cannot disagree about what a drop area is. Besides
|
|
16
|
+
* class substrings and custom tags it matches drop areas identified only by an
|
|
17
|
+
* attribute (e.g. `data-testid="file-drop-area"`).
|
|
18
|
+
*/
|
|
19
|
+
export declare const DROP_ZONE_SELECTORS: readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* Controls that can carry an upload-affordance label. Shared by the render-gate
|
|
22
|
+
* and the click so a `role="link"` "Choose files" control is seen by both.
|
|
23
|
+
*/
|
|
24
|
+
export declare const UPLOAD_AFFORDANCE_CONTROL_SELECTOR = "button,[role='button'],[role='link'],a";
|
|
25
|
+
/**
|
|
26
|
+
* Browser-evaluable function expression `(document) => Element | null` that
|
|
27
|
+
* finds a drop area. Tries the class/tag/attribute selectors first, then scans
|
|
28
|
+
* every element's attributes (any name, any value) so a drop area identified
|
|
29
|
+
* only by e.g. `data-area="file-drop"` is still found. Shared by the render-gate
|
|
30
|
+
* and the synthetic drag-drop so the two cannot disagree about what a drop area is.
|
|
31
|
+
*/
|
|
32
|
+
export declare const FIND_DROP_ZONE_EXPR: string;
|
|
33
|
+
//# sourceMappingURL=upload-affordance-expr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-affordance-expr.d.ts","sourceRoot":"","sources":["../../src/scraper/upload-affordance-expr.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,QAMxC,CAAC;AAWJ;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAehD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kCAAkC,2CAA2C,CAAC;AAK3F;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAc7B,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FIND_DROP_ZONE_EXPR = exports.UPLOAD_AFFORDANCE_CONTROL_SELECTOR = exports.DROP_ZONE_SELECTORS = exports.UPLOAD_AFFORDANCE_MATCHER_EXPR = void 0;
|
|
4
|
+
exports.matchesUploadAffordanceVocabulary = matchesUploadAffordanceVocabulary;
|
|
5
|
+
const EXCLUDE_SOURCE = "\\b(later|skip|without|remove|delete|cancel|decline)\\b";
|
|
6
|
+
const NO_FILE_SOURCE = "\\bno files?\\b";
|
|
7
|
+
const POSITIVE_SOURCE = "\\b(upload|browse|(select|choose) files?|attach|add (a )?(resume|cv|files?)|resume/cv)\\b";
|
|
8
|
+
/**
|
|
9
|
+
* Normalised-label predicate for the Node side. It exists so the Node
|
|
10
|
+
* matcher and the browser expression derive from the same regex sources and
|
|
11
|
+
* cannot drift (a singular-only copy once missed "Select files").
|
|
12
|
+
*/
|
|
13
|
+
function matchesUploadAffordanceVocabulary(label) {
|
|
14
|
+
const norm = label.replace(/\s+/g, " ").trim().toLowerCase();
|
|
15
|
+
if (norm.length === 0)
|
|
16
|
+
return false;
|
|
17
|
+
if (new RegExp(EXCLUDE_SOURCE).test(norm))
|
|
18
|
+
return false;
|
|
19
|
+
if (new RegExp(NO_FILE_SOURCE).test(norm))
|
|
20
|
+
return false;
|
|
21
|
+
return new RegExp(POSITIVE_SOURCE).test(norm);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Browser-evaluable function-expression string giving the same verdicts as
|
|
25
|
+
* {@link matchesUploadAffordanceVocabulary}, for interpolation into
|
|
26
|
+
* `page.evaluate` template literals.
|
|
27
|
+
*/
|
|
28
|
+
exports.UPLOAD_AFFORDANCE_MATCHER_EXPR = `((raw) => {
|
|
29
|
+
const t = (raw || "").replace(/\\s+/g, " ").trim().toLowerCase();
|
|
30
|
+
if (!t) return false;
|
|
31
|
+
if (new RegExp(${JSON.stringify(EXCLUDE_SOURCE)}).test(t)) return false;
|
|
32
|
+
if (new RegExp(${JSON.stringify(NO_FILE_SOURCE)}).test(t)) return false;
|
|
33
|
+
return new RegExp(${JSON.stringify(POSITIVE_SOURCE)}).test(t);
|
|
34
|
+
})`;
|
|
35
|
+
const DROP_ZONE_ATTRIBUTES = [
|
|
36
|
+
"data-testid",
|
|
37
|
+
"data-test",
|
|
38
|
+
"data-test-id",
|
|
39
|
+
"data-qa",
|
|
40
|
+
"data-cy",
|
|
41
|
+
"id",
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Single drop-zone selector list shared by the render-gate and the synthetic
|
|
45
|
+
* drag-drop so the two cannot disagree about what a drop area is. Besides
|
|
46
|
+
* class substrings and custom tags it matches drop areas identified only by an
|
|
47
|
+
* attribute (e.g. `data-testid="file-drop-area"`).
|
|
48
|
+
*/
|
|
49
|
+
exports.DROP_ZONE_SELECTORS = [
|
|
50
|
+
"uapp-upload",
|
|
51
|
+
"app-upload",
|
|
52
|
+
"uapp-resume-upload",
|
|
53
|
+
"[class*='dropzone']",
|
|
54
|
+
"[class*='drop-zone']",
|
|
55
|
+
"[class*='file-drop']",
|
|
56
|
+
"[class*='upload-zone']",
|
|
57
|
+
"[class*='uapp-upload']",
|
|
58
|
+
"[class*='ResumeUpload']",
|
|
59
|
+
"[class*='resumeUpload']",
|
|
60
|
+
"[class*='resume-upload']",
|
|
61
|
+
...DROP_ZONE_ATTRIBUTES.flatMap((attr) => ["file", "upload"].map((word) => `[${attr}*='drop' i][${attr}*='${word}' i]`)),
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* Controls that can carry an upload-affordance label. Shared by the render-gate
|
|
65
|
+
* and the click so a `role="link"` "Choose files" control is seen by both.
|
|
66
|
+
*/
|
|
67
|
+
exports.UPLOAD_AFFORDANCE_CONTROL_SELECTOR = "button,[role='button'],[role='link'],a";
|
|
68
|
+
const DROP_ZONE_ATTRIBUTE_VALUE_SOURCE = "drop[-_ ]?(zone|area|target|file|upload|resume)|(file|upload|resume)[-_ ]?drop(?!-?down)";
|
|
69
|
+
/**
|
|
70
|
+
* Browser-evaluable function expression `(document) => Element | null` that
|
|
71
|
+
* finds a drop area. Tries the class/tag/attribute selectors first, then scans
|
|
72
|
+
* every element's attributes (any name, any value) so a drop area identified
|
|
73
|
+
* only by e.g. `data-area="file-drop"` is still found. Shared by the render-gate
|
|
74
|
+
* and the synthetic drag-drop so the two cannot disagree about what a drop area is.
|
|
75
|
+
*/
|
|
76
|
+
exports.FIND_DROP_ZONE_EXPR = `((doc) => {
|
|
77
|
+
const bySelector = doc.querySelector(${JSON.stringify(exports.DROP_ZONE_SELECTORS.join(","))});
|
|
78
|
+
if (bySelector) return bySelector;
|
|
79
|
+
if (typeof doc.querySelectorAll !== "function") return null;
|
|
80
|
+
const valueRe = new RegExp(${JSON.stringify(DROP_ZONE_ATTRIBUTE_VALUE_SOURCE)}, "i");
|
|
81
|
+
const skip = new Set(["html", "head", "body", "script", "style", "input", "option"]);
|
|
82
|
+
for (const el of Array.from(doc.querySelectorAll("*"))) {
|
|
83
|
+
if (!el.attributes || skip.has(String(el.tagName || "").toLowerCase())) continue;
|
|
84
|
+
for (const attr of Array.from(el.attributes)) {
|
|
85
|
+
if (attr.name === "class") continue;
|
|
86
|
+
if (valueRe.test(attr.name) || valueRe.test(attr.value || "")) return el;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
})`;
|
|
91
|
+
//# sourceMappingURL=upload-affordance-expr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-affordance-expr.js","sourceRoot":"","sources":["../../src/scraper/upload-affordance-expr.ts"],"names":[],"mappings":";;;;AAAA,MAAM,cAAc,GAAG,yDAAyD,CAAC;AACjF,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,eAAe,GACnB,2FAA2F,CAAC;AAE9F;;;;GAIG;AACH,2CAAkD,KAAa;IAC7D,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,IAAI,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,OAAO,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACU,QAAA,8BAA8B,GAAG;;;mBAG3B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;mBAC9B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;sBAC3B,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;GAClD,CAAC;AAEJ,MAAM,oBAAoB,GAAG;IAC3B,aAAa;IACb,WAAW;IACX,cAAc;IACd,SAAS;IACT,SAAS;IACT,IAAI;CACL,CAAC;AAEF;;;;;GAKG;AACU,QAAA,mBAAmB,GAAsB;IACpD,aAAa;IACb,YAAY;IACZ,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,sBAAsB;IACtB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,yBAAyB;IACzB,0BAA0B;IAC1B,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CACvC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,eAAe,IAAI,MAAM,IAAI,MAAM,CAAC,CAC9E;CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,kCAAkC,GAAG,wCAAwC,CAAC;AAE3F,MAAM,gCAAgC,GACpC,0FAA0F,CAAC;AAE7F;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG;yCACM,IAAI,CAAC,SAAS,CAAC,QAAA,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;;+BAGvD,IAAI,CAAC,SAAS,CAAC,gCAAgC,CAAC;;;;;;;;;;GAU5E,CAAC"}
|
|
@@ -301,6 +301,7 @@ export declare const RECON_FLOW_FILE_SCHEMA: z.ZodUnion<readonly [z.ZodArray<z.Z
|
|
|
301
301
|
successUrlFragments: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
302
302
|
successPageTitleHints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
303
303
|
ownBackendHostnames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
304
|
+
browserFlowOnly: z.ZodOptional<z.ZodBoolean>;
|
|
304
305
|
knownErrorClassPrefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
305
306
|
wizardExitButtonLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
306
307
|
restartSignalUrlPatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -457,6 +458,19 @@ export declare function filterReplanDuplicatingNextAuthored(newSteps: readonly N
|
|
|
457
458
|
* corrected-value retry is forward progress, not a stuck repeat.
|
|
458
459
|
*/
|
|
459
460
|
export declare function isReplanReproposingFailedStep(newSteps: readonly NormalizedStep[], failedStep: string): boolean;
|
|
461
|
+
/** Max times one step may be re-run after a provider-only failure cascade. */
|
|
462
|
+
export declare const MAX_TRANSIENT_STEP_RETRIES = 2;
|
|
463
|
+
/**
|
|
464
|
+
* Cause-aware wrapper over {@link isReplanReproposingFailedStep}: a re-proposal
|
|
465
|
+
* of only the failed step is a guaranteed re-fail for a real selector/page
|
|
466
|
+
* problem, but a legitimate bounded re-run when every recorded attempt failed
|
|
467
|
+
* on a transient provider error. Retries are counted per step signature in
|
|
468
|
+
* `retryCounts` (mutated on "retry"); once exhausted, or when the dump is
|
|
469
|
+
* missing/empty/mixed, the original abort stands.
|
|
470
|
+
*/
|
|
471
|
+
export declare function decideReplanNoProgress(newSteps: readonly NormalizedStep[], failedStep: string, attempts: ReadonlyArray<{
|
|
472
|
+
errorMessage?: string | null;
|
|
473
|
+
}> | null | undefined, retryCounts: Map<string, number>): "proceed" | "retry" | "abort";
|
|
460
474
|
/**
|
|
461
475
|
* Detect whether the live page has already navigated away from where a step
|
|
462
476
|
* started, mirroring {@link findRecentPageTransition} in flow-runner.ts:
|
|
@@ -476,6 +490,14 @@ export declare function isReplanReproposingFailedStep(newSteps: readonly Normali
|
|
|
476
490
|
* is ambiguous.
|
|
477
491
|
*/
|
|
478
492
|
export declare function hasPageAlreadyAdvancedPastStep(stepStartUrl: string, currentUrl: string, stepInstruction: string): boolean;
|
|
493
|
+
/**
|
|
494
|
+
* DOM-advance counterpart of {@link hasPageAlreadyAdvancedPastStep} for
|
|
495
|
+
* non-final submit-shaped steps, whose SPA wizards swap content without a URL
|
|
496
|
+
* change. Reuses the shared {@link hasPageAdvanced} judgement over the
|
|
497
|
+
* step-start and live visible-text signatures; a final step is never credited
|
|
498
|
+
* here because its completion is owned by the submit-destination judge.
|
|
499
|
+
*/
|
|
500
|
+
export declare function hasSubmitStepDomAdvanced(isFinalStep: boolean, preVisibleTextSignature: string | undefined, liveVisibleTextSignature: string | undefined): boolean;
|
|
479
501
|
/**
|
|
480
502
|
* Detect a replan that proposes a Sign-In/Log-In recovery bridge after the
|
|
481
503
|
* completed-steps history already shows an account-creation/registration step.
|
|
@@ -491,7 +513,10 @@ export declare function hasPageAlreadyAdvancedPastStep(stepStartUrl: string, cur
|
|
|
491
513
|
* in". Scopes the Sign-In match to the step's own action clause (via
|
|
492
514
|
* `splitIntoActionClauses`, shared with `isPlausibleStepDestination`) so a
|
|
493
515
|
* step that merely mentions sign-in in descriptive context isn't mistaken
|
|
494
|
-
* for one that is itself about signing in.
|
|
516
|
+
* for one that is itself about signing in. The completed-steps side is
|
|
517
|
+
* clause-scoped the same way, so a step that only mentions account creation
|
|
518
|
+
* in descriptive text (e.g. a wizard step title) isn't mistaken for a
|
|
519
|
+
* completed account-creation step. Pure.
|
|
495
520
|
*/
|
|
496
521
|
export declare function isReplanRegressingAcrossAuthBoundary(newSteps: readonly NormalizedStep[], completedSteps: readonly string[]): boolean;
|
|
497
522
|
/**
|
|
@@ -501,7 +526,10 @@ export declare function isReplanRegressingAcrossAuthBoundary(newSteps: readonly
|
|
|
501
526
|
* combination that no longer matches what this particular step does).
|
|
502
527
|
* Matches on word boundaries against normalized (lowercased, whitespace-
|
|
503
528
|
* collapsed) text, mirroring {@link SIGN_IN_PATTERNS}/{@link ACCOUNT_CREATION_PATTERNS},
|
|
504
|
-
* so a phrase like "commit the change" does not false-positive on "submit".
|
|
529
|
+
* so a phrase like "commit the change" does not false-positive on "submit".
|
|
530
|
+
* Negated guardrail clauses ("Do NOT click ... proceeds to checkout") are
|
|
531
|
+
* blanked first: a step that declares itself not a submit is never seeded as
|
|
532
|
+
* one. Pure.
|
|
505
533
|
*/
|
|
506
534
|
export declare function isSubmitShapedInstructionText(instruction: string): boolean;
|
|
507
535
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recon-browser.d.ts","sourceRoot":"","sources":["../../src/scripts/recon-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;
|
|
1
|
+
{"version":3,"file":"recon-browser.d.ts","sourceRoot":"","sources":["../../src/scripts/recon-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAKH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGnF,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AA8B3B,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,SAAS,EAGd,KAAK,eAAe,EAKpB,KAAK,mBAAmB,EAkBzB,MAAM,uBAAuB,CAAC;AAc/B,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI5E,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAQjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAM9C,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,cAAc,GAAG,mBAAmB,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD;AAoED;;;;;;;;;GASG;AACH,iBAAe,2BAA2B,CACxC,IAAI,EAAE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