@enricai/barnacle 1.6.1 → 1.6.3
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/README.md +36 -29
- package/dist/api/errors.d.ts +3 -3
- package/dist/api/errors.d.ts.map +1 -1
- package/dist/api/errors.js +4 -4
- package/dist/api/errors.js.map +1 -1
- package/dist/api/helpers/reply.d.ts +1 -1
- package/dist/api/helpers/reply.js +1 -1
- package/dist/cache/keyed-ttl-cache.d.ts +4 -4
- package/dist/cache/keyed-ttl-cache.js +2 -2
- package/dist/lib/applicant-payload.d.ts +4 -4
- package/dist/lib/applicant-payload.js +4 -4
- package/dist/lib/application-address.d.ts +3 -3
- package/dist/lib/application-address.js +5 -5
- package/dist/lib/application-address.js.map +1 -1
- package/dist/lib/application-resume.d.ts +4 -4
- package/dist/lib/application-resume.js +4 -4
- package/dist/lib/dispatch-metrics.js +1 -1
- package/dist/lib/llm/judges/verify-submit.d.ts +1 -1
- package/dist/lib/llm/judges/verify-submit.js +1 -1
- package/dist/lib/llm/schemas.js +3 -3
- package/dist/lib/phone.d.ts +1 -1
- package/dist/lib/phone.js +1 -1
- package/dist/lib/telemetry/call-types.d.ts +1 -1
- package/dist/lib/telemetry/call-types.js +1 -1
- package/dist/lib/tracking-click.d.ts +5 -3
- package/dist/lib/tracking-click.d.ts.map +1 -1
- package/dist/lib/tracking-click.js +5 -3
- package/dist/lib/tracking-click.js.map +1 -1
- package/dist/lib/us-states.d.ts +1 -1
- package/dist/lib/us-states.js +1 -1
- package/dist/plugins/loader.js +2 -2
- package/dist/scraper/cookie-jar.d.ts +2 -2
- package/dist/scraper/cookie-jar.js +2 -2
- package/dist/scraper/deep-query.d.ts +36 -0
- package/dist/scraper/deep-query.d.ts.map +1 -0
- package/dist/scraper/deep-query.js +87 -0
- package/dist/scraper/deep-query.js.map +1 -0
- package/dist/scraper/errors.d.ts +12 -14
- package/dist/scraper/errors.d.ts.map +1 -1
- package/dist/scraper/errors.js +12 -17
- package/dist/scraper/errors.js.map +1 -1
- package/dist/scraper/flow-runner.d.ts +97 -30
- package/dist/scraper/flow-runner.d.ts.map +1 -1
- package/dist/scraper/flow-runner.js +304 -104
- package/dist/scraper/flow-runner.js.map +1 -1
- package/dist/scraper/http-client.d.ts +11 -1
- package/dist/scraper/http-client.d.ts.map +1 -1
- package/dist/scraper/http-client.js +90 -3
- package/dist/scraper/http-client.js.map +1 -1
- package/dist/scraper/phantom-click.d.ts +45 -0
- package/dist/scraper/phantom-click.d.ts.map +1 -0
- package/dist/scraper/phantom-click.js +37 -0
- package/dist/scraper/phantom-click.js.map +1 -0
- package/dist/scraper/raw-fetch.d.ts +2 -2
- package/dist/scraper/raw-fetch.js +1 -1
- package/dist/scraper/require-response-field.d.ts +1 -1
- package/dist/scraper/require-response-field.js +1 -1
- package/dist/scraper/session-browserbase.d.ts +48 -0
- package/dist/scraper/session-browserbase.d.ts.map +1 -1
- package/dist/scraper/session-browserbase.js +10 -5
- package/dist/scraper/session-browserbase.js.map +1 -1
- package/dist/scraper/session-shared.d.ts +6 -0
- package/dist/scraper/session-shared.d.ts.map +1 -1
- package/dist/scraper/session-shared.js.map +1 -1
- package/dist/scraper/session-warmup.d.ts +1 -1
- package/dist/scraper/session-warmup.js +1 -1
- package/dist/scraper/submit-control.d.ts +51 -0
- package/dist/scraper/submit-control.d.ts.map +1 -0
- package/dist/scraper/submit-control.js +142 -0
- package/dist/scraper/submit-control.js.map +1 -0
- package/dist/scripts/migrate-telemetry-dir-names.d.ts +2 -2
- package/dist/scripts/migrate-telemetry-dir-names.d.ts.map +1 -1
- package/dist/scripts/migrate-telemetry-dir-names.js +1 -1
- package/dist/scripts/recon-browser.d.ts +25 -20
- package/dist/scripts/recon-browser.d.ts.map +1 -1
- package/dist/scripts/recon-browser.js +65 -56
- package/dist/scripts/recon-browser.js.map +1 -1
- package/dist/scripts/recon-generate.d.ts +52 -7
- package/dist/scripts/recon-generate.d.ts.map +1 -1
- package/dist/scripts/recon-generate.js +73 -31
- package/dist/scripts/recon-generate.js.map +1 -1
- package/dist/scripts/recon-http.d.ts +36 -5
- package/dist/scripts/recon-http.d.ts.map +1 -1
- package/dist/scripts/recon-http.js +77 -47
- package/dist/scripts/recon-http.js.map +1 -1
- package/dist/scripts/recon-replay-jobs.d.ts +32 -3
- package/dist/scripts/recon-replay-jobs.d.ts.map +1 -1
- package/dist/scripts/recon-replay-jobs.js +46 -29
- package/dist/scripts/recon-replay-jobs.js.map +1 -1
- package/dist/scripts/recon-shared.d.ts +45 -0
- package/dist/scripts/recon-shared.d.ts.map +1 -1
- package/dist/scripts/recon-shared.js +117 -0
- package/dist/scripts/recon-shared.js.map +1 -1
- package/dist/scripts/recon-summarize.d.ts +5 -1
- package/dist/scripts/recon-summarize.d.ts.map +1 -1
- package/dist/scripts/recon-summarize.js +19 -7
- package/dist/scripts/recon-summarize.js.map +1 -1
- package/dist/site-plugin.d.ts +4 -4
- package/dist/testing/persona-fixture.d.ts +4 -4
- package/dist/testing/persona-fixture.d.ts.map +1 -1
- package/dist/testing/persona-fixture.js +4 -4
- package/dist/testing/persona-fixture.js.map +1 -1
- package/dist/types/dispatch-metrics.d.ts +1 -1
- package/dist/types/dispatch-metrics.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Submit-control locator: ranks every submit-shaped candidate the deep
|
|
4
|
+
* resolver (`deep-query.ts`) can reach — piercing open shadow roots — so
|
|
5
|
+
* the cascade can act on the best-ranked candidate and retry the runner-up
|
|
6
|
+
* if the first click phantoms. A false-positive submit click on a real run
|
|
7
|
+
* (e.g. clicking "Save draft") is worse than the current failure, since it
|
|
8
|
+
* could submit a half-filled application — so ranking is deliberately
|
|
9
|
+
* conservative: only tiers with strong, unambiguous submit signal are
|
|
10
|
+
* included, and "Back"/"Cancel"/"Save draft"-shaped controls never appear.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.buildRankSubmitCandidatesExpr = buildRankSubmitCandidatesExpr;
|
|
14
|
+
exports.buildClickByDeepIndexExpr = buildClickByDeepIndexExpr;
|
|
15
|
+
/**
|
|
16
|
+
* Verbs that identify a control as NOT the submit action even when it is
|
|
17
|
+
* button-shaped and reachable. Checked before any positive tier so a
|
|
18
|
+
* button whose text merely contains "submit" as a substring of a longer
|
|
19
|
+
* negative phrase (unlikely in practice, but the exclusion is what makes
|
|
20
|
+
* the ranking conservative) cannot slip through.
|
|
21
|
+
*/
|
|
22
|
+
const NEGATIVE_TEXT_EXPR = `((text) => {
|
|
23
|
+
const negatives = ["back", "cancel", "save draft", "save for later", "previous", "close"];
|
|
24
|
+
return negatives.some((n) => text === n || text.startsWith(n + " ") || text.endsWith(" " + n));
|
|
25
|
+
})`;
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes an element's accessible name to lowercase, whitespace-collapsed
|
|
28
|
+
* text, preferring `aria-label` over visible `textContent` (mirrors
|
|
29
|
+
* `SUBMIT_SHAPED_EL_EXPR`'s own normalization in deep-query.ts so both
|
|
30
|
+
* modules treat the same DOM the same way).
|
|
31
|
+
*/
|
|
32
|
+
const ACCESSIBLE_NAME_EXPR = `((el) => {
|
|
33
|
+
const norm = (s) => (s || "").replace(/\\s+/g, " ").trim().toLowerCase();
|
|
34
|
+
return norm(el.getAttribute("aria-label") || el.textContent || "");
|
|
35
|
+
})`;
|
|
36
|
+
/**
|
|
37
|
+
* Recursive open-shadow-root walker, identical in shape to `deep-query.ts`'s
|
|
38
|
+
* private `DEEP_ELEMENTS_EXPR` (duplicated rather than imported because both
|
|
39
|
+
* are browser-context expression strings composed by string interpolation,
|
|
40
|
+
* not runtime code that can share a module import).
|
|
41
|
+
*/
|
|
42
|
+
const DEEP_ELEMENTS_EXPR = `((root) => {
|
|
43
|
+
const out = [];
|
|
44
|
+
const walk = (node) => {
|
|
45
|
+
const kids = node.querySelectorAll ? Array.from(node.querySelectorAll("*")) : [];
|
|
46
|
+
for (const el of kids) {
|
|
47
|
+
out.push(el);
|
|
48
|
+
if (el.shadowRoot) walk(el.shadowRoot);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
walk(root);
|
|
52
|
+
return out;
|
|
53
|
+
})`;
|
|
54
|
+
/**
|
|
55
|
+
* Ranking tiers, most confident first. Each tier's `test` receives the
|
|
56
|
+
* element plus its precomputed accessible name and reports whether it
|
|
57
|
+
* belongs in that tier — the first matching tier wins, so an element that
|
|
58
|
+
* qualifies for tier 1 is never re-evaluated against tier 2/3.
|
|
59
|
+
*
|
|
60
|
+
* 1. Explicit `type="submit"` — unambiguous native semantics.
|
|
61
|
+
* 2. Accessible name is exactly (or is dominated by) "submit" — covers the
|
|
62
|
+
* shadow-root button whose text is "Submit" but carries no type
|
|
63
|
+
* attribute (Stencil/web-component controls often omit it).
|
|
64
|
+
* 3. Button/role="button" element whose accessible name contains "submit"
|
|
65
|
+
* as a distinct word alongside other text (e.g. "Submit Application"),
|
|
66
|
+
* with no negative verb present — covers Angular-style controls matched
|
|
67
|
+
* by role + text rather than by type.
|
|
68
|
+
*/
|
|
69
|
+
const RANK_TIERS_EXPR = `((el, name) => {
|
|
70
|
+
const isNegative = ${NEGATIVE_TEXT_EXPR};
|
|
71
|
+
if (isNegative(name)) return 0;
|
|
72
|
+
const tag = (el.tagName || "").toLowerCase();
|
|
73
|
+
const type = (el.getAttribute("type") || "").toLowerCase();
|
|
74
|
+
const role = (el.getAttribute("role") || "").toLowerCase();
|
|
75
|
+
const isButtonLike = tag === "button" || tag === "input" || role === "button";
|
|
76
|
+
if (!isButtonLike) return 0;
|
|
77
|
+
if ((tag === "button" || tag === "input") && type === "submit") return 3;
|
|
78
|
+
if (name === "submit") return 2;
|
|
79
|
+
if (/\\bsubmit\\b/.test(name)) return 1;
|
|
80
|
+
return 0;
|
|
81
|
+
})`;
|
|
82
|
+
/**
|
|
83
|
+
* Builds a self-contained `page.evaluate` expression string that walks the
|
|
84
|
+
* whole document (light DOM plus every open shadow root, arbitrarily deep)
|
|
85
|
+
* and returns every submit-shaped candidate ranked by confidence tier,
|
|
86
|
+
* highest first. Ties within a tier keep document order. Elements that
|
|
87
|
+
* match no positive tier — including anything caught by
|
|
88
|
+
* {@link NEGATIVE_TEXT_EXPR} — are excluded entirely rather than ranked
|
|
89
|
+
* last, so the caller never has to guess where the "safe" cutoff is.
|
|
90
|
+
*
|
|
91
|
+
* Each returned candidate carries `deepIndex`, the candidate's position in
|
|
92
|
+
* this same deterministic deep-traversal order. {@link buildClickByDeepIndexExpr}
|
|
93
|
+
* re-runs the identical traversal and clicks the element at that index, so
|
|
94
|
+
* the caller can locate once, decide which candidate to try, then click by
|
|
95
|
+
* index without holding a live element handle across the two round trips.
|
|
96
|
+
*/
|
|
97
|
+
function buildRankSubmitCandidatesExpr() {
|
|
98
|
+
return `(() => {
|
|
99
|
+
const accessibleName = ${ACCESSIBLE_NAME_EXPR};
|
|
100
|
+
const rankTier = ${RANK_TIERS_EXPR};
|
|
101
|
+
const deepElements = ${DEEP_ELEMENTS_EXPR};
|
|
102
|
+
const all = deepElements(document);
|
|
103
|
+
const ranked = [];
|
|
104
|
+
for (let i = 0; i < all.length; i++) {
|
|
105
|
+
const el = all[i];
|
|
106
|
+
const name = accessibleName(el);
|
|
107
|
+
const tier = rankTier(el, name);
|
|
108
|
+
if (tier === 0) continue;
|
|
109
|
+
ranked.push({
|
|
110
|
+
deepIndex: i,
|
|
111
|
+
tier,
|
|
112
|
+
tag: (el.tagName || "").toLowerCase(),
|
|
113
|
+
accessibleName: name,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
ranked.sort((a, b) => b.tier - a.tier || a.deepIndex - b.deepIndex);
|
|
117
|
+
return ranked;
|
|
118
|
+
})()`;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Builds a self-contained `page.evaluate` expression string that re-runs
|
|
122
|
+
* the same deterministic deep traversal as {@link buildRankSubmitCandidatesExpr}
|
|
123
|
+
* and clicks the element at `deepIndex` (dispatching focus + bubbling
|
|
124
|
+
* mousedown/mouseup/click, matching `deep-query.ts`'s controlled-state click
|
|
125
|
+
* convention). Returns `{ clicked: false }` without throwing if the index is
|
|
126
|
+
* out of range for the current DOM (e.g. the page changed between the
|
|
127
|
+
* locate and click calls).
|
|
128
|
+
*/
|
|
129
|
+
function buildClickByDeepIndexExpr(deepIndex) {
|
|
130
|
+
return `(() => {
|
|
131
|
+
const deepElements = ${DEEP_ELEMENTS_EXPR};
|
|
132
|
+
const all = deepElements(document);
|
|
133
|
+
const el = all[${JSON.stringify(deepIndex)}];
|
|
134
|
+
if (!el) return { clicked: false };
|
|
135
|
+
if (typeof el.focus === "function") { try { el.focus(); } catch (e) {} }
|
|
136
|
+
el.dispatchEvent(new Event("mousedown", { bubbles: true }));
|
|
137
|
+
el.dispatchEvent(new Event("mouseup", { bubbles: true }));
|
|
138
|
+
el.dispatchEvent(new Event("click", { bubbles: true }));
|
|
139
|
+
return { clicked: true };
|
|
140
|
+
})()`;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=submit-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-control.js","sourceRoot":"","sources":["../../src/scraper/submit-control.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;AAEH;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG;;;GAGxB,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,oBAAoB,GAAG;;;GAG1B,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG;;;;;;;;;;;GAWxB,CAAC;AAEJ;;;;;;;;;;;;;;GAcG;AACH,MAAM,eAAe,GAAG;uBACD,kBAAkB;;;;;;;;;;;GAWtC,CAAC;AAEJ;;;;;;;;;;;;;;GAcG;AACH;IACE,OAAO;6BACoB,oBAAoB;uBAC1B,eAAe;2BACX,kBAAkB;;;;;;;;;;;;;;;;;OAiBtC,CAAC;AACR,CAAC;AAED;;;;;;;;GAQG;AACH,mCAA0C,SAAiB;IACzD,OAAO;2BACkB,kBAAkB;;qBAExB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;;;;;;;OAOvC,CAAC;AACR,CAAC"}
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
* Usage:
|
|
24
24
|
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts
|
|
25
25
|
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts --apply
|
|
26
|
-
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts --site
|
|
26
|
+
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts --site <siteId> --apply
|
|
27
27
|
*/
|
|
28
28
|
interface MigrateOptions {
|
|
29
29
|
/** Path to the project root containing `src/sites/`. */
|
|
30
30
|
sitesRoot: string;
|
|
31
|
-
/** Optional: restrict to one site directory by name (e.g. "
|
|
31
|
+
/** Optional: restrict to one site directory by name (e.g. "acme-jobs"). */
|
|
32
32
|
siteFilter: string | null;
|
|
33
33
|
/** If false, log planned renames but do not execute them. */
|
|
34
34
|
apply: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-telemetry-dir-names.d.ts","sourceRoot":"","sources":["../../src/scripts/migrate-telemetry-dir-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAYH,UAAU,cAAc;IACtB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"migrate-telemetry-dir-names.d.ts","sourceRoot":"","sources":["../../src/scripts/migrate-telemetry-dir-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAYH,UAAU,cAAc;IACtB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,6DAA6D;IAC7D,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAiB3E;AAqED,UAAU,UAAU;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAapD"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* Usage:
|
|
25
25
|
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts
|
|
26
26
|
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts --apply
|
|
27
|
-
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts --site
|
|
27
|
+
* pnpm tsx src/scripts/migrate-telemetry-dir-names.ts --site <siteId> --apply
|
|
28
28
|
*/
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.migrateTelemetryDirs = migrateTelemetryDirs;
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Phase 1 recon: drives a real browser through a user-defined flow while
|
|
3
|
-
* wiretapping every network response.
|
|
4
|
-
*
|
|
3
|
+
* wiretapping every network response. Every artifact is rooted under one
|
|
4
|
+
* run-scoped directory resolved once at startup via
|
|
5
|
+
* {@link resolveReconRunDir} (default `/tmp/recon/<runId>`, override with
|
|
6
|
+
* `RECON_OUT_DIR`/`RECON_RUN_ID`) so concurrent or repeated runs cannot
|
|
7
|
+
* intermix files. Captures are written to
|
|
8
|
+
* `<runDir>/graphql/<NNN>-<phase>-<operationName>.json` — one file per call,
|
|
5
9
|
* diffable and greppable. The browser's full cookie jar is snapshotted at
|
|
6
10
|
* each phase boundary (initial goto, pre-step, post-step, run completion) and
|
|
7
|
-
* written to
|
|
11
|
+
* written to `<runDir>/cookies/<NNN>-<label>-<phase>.json`, so the jar state
|
|
8
12
|
* can be diffed across the journey (e.g. what a click-tracker traversal
|
|
9
13
|
* establishes vs. what a later step adds).
|
|
10
14
|
*
|
|
11
15
|
* Recovery model — each flow step runs through a 4-attempt self-healing cascade
|
|
12
16
|
* (act → observe+act → observe+act with ignoreSelectors → Anthropic-SDK rephrase),
|
|
13
17
|
* verified by "did the network counter advance OR did the URL change". On terminal
|
|
14
|
-
* cascade failure the step is dumped to
|
|
15
|
-
* main() loop attempts up to MAX_REPLANS=2 global replans, where
|
|
16
|
-
* the remaining flow tail given the failure context.
|
|
17
|
-
* skip the LLM-rephrase attempt and the replan loop
|
|
18
|
-
* docs/playbook.md sections 1c–1e for the full
|
|
18
|
+
* cascade failure the step is dumped to `<runDir>/step-failures/` and the
|
|
19
|
+
* script's main() loop attempts up to MAX_REPLANS=2 global replans, where
|
|
20
|
+
* Claude rewrites the remaining flow tail given the failure context.
|
|
21
|
+
* Bedrock-only deployments skip the LLM-rephrase attempt and the replan loop
|
|
22
|
+
* with a startup warn. See docs/playbook.md sections 1c–1e for the full
|
|
23
|
+
* design.
|
|
19
24
|
*
|
|
20
25
|
* Usage:
|
|
21
26
|
* pnpm tsx src/scripts/recon-browser.ts \
|
|
@@ -62,13 +67,13 @@ interface ReplanEvent {
|
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
64
69
|
* Reads the browser's full cookie jar for the given phase and writes it under
|
|
65
|
-
* `
|
|
66
|
-
* layout as `wireNetworkCapture`'s network
|
|
67
|
-
* filenames chronologically (zero-padded, shared
|
|
68
|
-
* flow-runner's capture counter) so snapshots sort in the
|
|
69
|
-
* actually occurred. Never throws — cookie telemetry is
|
|
70
|
-
* the existing capture-write behavior: a write failure
|
|
71
|
-
* recon run continues.
|
|
70
|
+
* the resolved run dir's `cookies` subdir, so a run's snapshots land in the
|
|
71
|
+
* same append-only, diffable layout as `wireNetworkCapture`'s network
|
|
72
|
+
* captures. `counter` indexes filenames chronologically (zero-padded, shared
|
|
73
|
+
* convention with flow-runner's capture counter) so snapshots sort in the
|
|
74
|
+
* order the phases actually occurred. Never throws — cookie telemetry is
|
|
75
|
+
* best-effort, matching the existing capture-write behavior: a write failure
|
|
76
|
+
* logs a warning and the recon run continues.
|
|
72
77
|
*/
|
|
73
78
|
declare function snapshotAndPersistCookieJar(page: Page, counter: {
|
|
74
79
|
n: number;
|
|
@@ -115,8 +120,8 @@ export declare function isReplanCycle(priorReplans: readonly ReplanEvent[], newS
|
|
|
115
120
|
* false. `origin` distinguishes hand-authored steps from steps the LLM
|
|
116
121
|
* replanner appended at cascade-exhausted recovery points — persistReplannedFlow
|
|
117
122
|
* uses it to force replan-origin steps to optional on write-back, preventing
|
|
118
|
-
* cross-employer regressions when
|
|
119
|
-
* gets persisted and the next run is on
|
|
123
|
+
* cross-employer regressions when an employer-specific replanned question
|
|
124
|
+
* gets persisted and the next run is on a different tenant.
|
|
120
125
|
*/
|
|
121
126
|
interface NormalizedStep {
|
|
122
127
|
instruction: string;
|
|
@@ -280,9 +285,9 @@ declare function replanRemainingFlow(params: {
|
|
|
280
285
|
stagehand: Stagehand;
|
|
281
286
|
captureFn?: CaptureFn;
|
|
282
287
|
/**
|
|
283
|
-
* Files in
|
|
284
|
-
* window. Used to surface structured server-side validation
|
|
285
|
-
* to the replan LLM when a submit actually fired but was rejected.
|
|
288
|
+
* Files in the run's captures dir recorded during the failed step's
|
|
289
|
+
* attempt window. Used to surface structured server-side validation
|
|
290
|
+
* errors to the replan LLM when a submit actually fired but was rejected.
|
|
286
291
|
*/
|
|
287
292
|
recentCaptures?: readonly string[];
|
|
288
293
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recon-browser.d.ts","sourceRoot":"","sources":["../../src/scripts/recon-browser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"recon-browser.d.ts","sourceRoot":"","s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