@enricai/barnacle 1.9.7 → 1.9.9
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 +6 -6
- package/dist/api/errors.d.ts +1 -1
- package/dist/api/errors.d.ts.map +1 -1
- package/dist/api/errors.js +3 -3
- package/dist/api/errors.js.map +1 -1
- package/dist/api/plugins/error-handler.js +1 -1
- package/dist/api/plugins/error-handler.js.map +1 -1
- package/dist/api/routes/submissions.d.ts +1 -1
- package/dist/api/schemas/telemetry.d.ts +1 -1
- package/dist/api/schemas/telemetry.js +1 -1
- package/dist/cache/response-cache.d.ts +1 -1
- package/dist/cache/response-cache.js +2 -2
- package/dist/config.d.ts +4 -4
- package/dist/lib/llm/judges/invalid-fields.d.ts +1 -1
- package/dist/lib/llm/judges/invalid-fields.d.ts.map +1 -1
- package/dist/lib/llm/judges/invalid-fields.js +1 -1
- package/dist/lib/llm/judges/verify-submit.js +1 -1
- package/dist/lib/logging.d.ts +1 -1
- package/dist/lib/logging.js +1 -1
- package/dist/lib/telemetry/beacon-capture.d.ts +1 -1
- package/dist/lib/telemetry/beacon-capture.js +1 -1
- package/dist/lib/telemetry/call-capture.d.ts +1 -1
- package/dist/lib/telemetry/call-capture.js +1 -1
- package/dist/lib/telemetry/reconciliation-source.d.ts +4 -4
- package/dist/lib/telemetry/reconciliation-source.js +5 -5
- package/dist/lib/telemetry/run-telemetry.d.ts +1 -1
- package/dist/lib/telemetry/run-telemetry.js +1 -1
- package/dist/lib/telemetry/s3-sink.d.ts +1 -1
- package/dist/lib/telemetry/s3-sink.js +1 -1
- package/dist/lib/telemetry/submissions-s3-objects.d.ts +1 -1
- package/dist/lib/telemetry/submissions-s3-objects.js +1 -1
- package/dist/lib/telemetry/submissions-s3-reader.d.ts +1 -1
- package/dist/lib/telemetry/submissions-s3-reader.js +1 -1
- package/dist/plugins/config-plugin.js +2 -2
- package/dist/recon/load-form-schema.d.ts +1 -1
- package/dist/recon/load-form-schema.js +1 -1
- package/dist/recon/load-vocabulary.d.ts +1 -1
- package/dist/recon/load-vocabulary.js +2 -2
- package/dist/scraper/deep-locator-actuate.d.ts +1 -1
- package/dist/scraper/deep-locator-actuate.js +3 -3
- package/dist/scraper/deep-locator-candidates.d.ts +2 -2
- package/dist/scraper/deep-locator-candidates.js +3 -3
- package/dist/scraper/deep-locator-fake.d.ts +8 -8
- package/dist/scraper/deep-locator-fake.d.ts.map +1 -1
- package/dist/scraper/deep-locator-fake.js +5 -5
- package/dist/scraper/deep-locator-fake.js.map +1 -1
- package/dist/scraper/deep-locator-scan.d.ts +5 -5
- package/dist/scraper/deep-locator-scan.js +7 -7
- package/dist/scraper/deep-query.js +1 -1
- package/dist/scraper/errors.d.ts +2 -2
- package/dist/scraper/errors.js +2 -2
- package/dist/scraper/flow-runner.d.ts +6 -6
- package/dist/scraper/flow-runner.js +18 -18
- package/dist/scraper/flow-runner.js.map +1 -1
- package/dist/scraper/frame-target.js +1 -1
- package/dist/scraper/http-client.js +1 -1
- package/dist/scraper/metrics.d.ts +1 -1
- package/dist/scraper/metrics.js +1 -1
- package/dist/scraper/phantom-click.d.ts +1 -1
- package/dist/scraper/phantom-click.d.ts.map +1 -1
- package/dist/scraper/retry.js +1 -1
- package/dist/scraper/retry.js.map +1 -1
- package/dist/scraper/session-browserbase.d.ts +3 -3
- package/dist/scraper/session-browserbase.js +4 -4
- package/dist/scraper/session-browserbase.js.map +1 -1
- package/dist/scraper/session-shared.d.ts +2 -2
- package/dist/scraper/stagehand-guard.d.ts +4 -4
- package/dist/scraper/stagehand-guard.js +5 -5
- package/dist/scraper/submit-control.js +1 -1
- package/dist/scripts/judge-llm-batch.d.ts +1 -1
- package/dist/scripts/llm-heal.d.ts +1 -1
- package/dist/scripts/recon-browser.d.ts +1 -1
- package/dist/scripts/recon-browser.js +2 -2
- package/dist/scripts/recon-generate-multicall-fixture.d.ts +1 -1
- package/dist/scripts/recon-generate.d.ts +11 -1
- package/dist/scripts/recon-generate.d.ts.map +1 -1
- package/dist/scripts/recon-generate.js +182 -22
- package/dist/scripts/recon-generate.js.map +1 -1
- package/dist/scripts/recon-heal.js +1 -1
- package/dist/scripts/recon-heal.js.map +1 -1
- package/dist/scripts/recon-http.d.ts +1 -1
- package/dist/scripts/recon-http.js +1 -1
- package/dist/scripts/recon-shared.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/site-plugin.d.ts +1 -1
- package/dist/testing/contract-parity-suite.d.mts +1 -1
- package/dist/testing/contract-parity-suite.mjs +1 -1
- package/dist/testing/coverage-guard-suite.d.mts +1 -1
- package/dist/testing/coverage-guard-suite.mjs +1 -1
- package/dist/testing/replay-integration-suite.d.mts +1 -1
- package/package.json +2 -2
|
@@ -149,7 +149,7 @@ function wireSignalCapture(page, params) {
|
|
|
149
149
|
// See mergeResponseHeaders.
|
|
150
150
|
const extraResponseHeaders = new Map();
|
|
151
151
|
// Cookie (and other extra-info-only request headers) keyed by requestId.
|
|
152
|
-
//
|
|
152
|
+
// Parallels extraResponseHeaders: Network.requestWillBeSent omits the outgoing
|
|
153
153
|
// Cookie header by design, and requestWillBeSentExtraInfo — which carries it —
|
|
154
154
|
// can race requestWillBeSent in either order. Buffered here and folded into
|
|
155
155
|
// the capture once, in `onFinished`. See mergeResponseHeaders.
|
|
@@ -691,7 +691,7 @@ const ADVANCE_STEP_PHRASES = [
|
|
|
691
691
|
* advance step must be verified by a real transition (network/URL), not a DOM
|
|
692
692
|
* state change. Keyed on the ORIGINAL step instruction so a rephrase that
|
|
693
693
|
* resolves "Next" to a radio click can't launder a field toggle into a passed
|
|
694
|
-
* advance. Pure; unit-testable seam
|
|
694
|
+
* advance. Pure; unit-testable seam paralleling `isWizardExitAction`.
|
|
695
695
|
*/
|
|
696
696
|
function isAdvanceStep(instruction) {
|
|
697
697
|
if (!instruction)
|
|
@@ -1704,7 +1704,7 @@ async function extractLivePageFormEvidence(_page, target, options) {
|
|
|
1704
1704
|
* signals" — DOM tree walking is the latter.
|
|
1705
1705
|
*
|
|
1706
1706
|
* Returns up to 12 leaf records. Empty array on evaluate failure (safe
|
|
1707
|
-
* fallback to the existing Haiku judge
|
|
1707
|
+
* fallback to the existing Haiku judge earlier in the pipeline). The `inputTag` and
|
|
1708
1708
|
* `visibleErrorText` fields let the prompt distinguish a smart-address
|
|
1709
1709
|
* autocomplete (where typing-only fails and the cascade needs dropdown
|
|
1710
1710
|
* selection) from a plain text input.
|
|
@@ -2254,7 +2254,7 @@ function isCommittedDateReadback(readback) {
|
|
|
2254
2254
|
* The committed value is confirmed via {@link verifyFillReadback}; a datepicker
|
|
2255
2255
|
* reformats what it accepts, so a non-empty date-shaped readback is success.
|
|
2256
2256
|
*
|
|
2257
|
-
* Return contract
|
|
2257
|
+
* Return contract parallels {@link fillHtml5DateTimeInput}: `null` means "not a
|
|
2258
2258
|
* datepicker — caller falls through to the generic readback verifier"; a
|
|
2259
2259
|
* non-null object means "this WAS a datepicker, here's the outcome". A non-null
|
|
2260
2260
|
* `filled:false` therefore deliberately TERMINATES the cascade (the caller
|
|
@@ -2295,7 +2295,7 @@ async function fillTextDatepickerInput(target, selector, value) {
|
|
|
2295
2295
|
catch {
|
|
2296
2296
|
return null;
|
|
2297
2297
|
}
|
|
2298
|
-
// Strategy 1 — keyboard entry (typeable datepickers).
|
|
2298
|
+
// Strategy 1 — keyboard entry (typeable datepickers). Parallels the Angular
|
|
2299
2299
|
// reactive-form re-type at verifyDomEffect: real CDP keystrokes flow through
|
|
2300
2300
|
// the widget's own onChange, unlike a programmatic value write.
|
|
2301
2301
|
const typed = (0, date_fns_1.format)(new Date(parts.year, parts.monthIndex, parts.day), "MM/dd/yyyy");
|
|
@@ -2804,8 +2804,8 @@ async function surfaceAndUpload(params) {
|
|
|
2804
2804
|
// mount. Wait (bounded, same window as the raw-input probe) for ANY upload
|
|
2805
2805
|
// target to appear — a dropzone, an upload-affordance button, or an
|
|
2806
2806
|
// <input type=file> — so every downstream strategy runs against a rendered
|
|
2807
|
-
// widget. Static evaluate literal (no interpolation); dropzone list
|
|
2808
|
-
// simulateDragDropUpload and the button matcher
|
|
2807
|
+
// widget. Static evaluate literal (no interpolation); dropzone list parallels
|
|
2808
|
+
// simulateDragDropUpload and the button matcher parallels clickUploadAffordance.
|
|
2809
2809
|
const targetExpr = `(() => {
|
|
2810
2810
|
const norm = (s) => (s || "").replace(/\\s+/g, " ").trim().toLowerCase();
|
|
2811
2811
|
const isUpload = (raw) => {
|
|
@@ -2917,7 +2917,7 @@ async function surfaceAndUpload(params) {
|
|
|
2917
2917
|
* (the frame the enumerate/click runs against).
|
|
2918
2918
|
*/
|
|
2919
2919
|
async function clickUploadAffordance(page, target, logger) {
|
|
2920
|
-
// The browser-side matcher
|
|
2920
|
+
// The browser-side matcher parallels isUploadAffordanceLabel; kept as a literal
|
|
2921
2921
|
// so the enumerate is a static string (same trust posture as the other
|
|
2922
2922
|
// primitives). No external interpolation.
|
|
2923
2923
|
const expr = `(() => {
|
|
@@ -3080,7 +3080,7 @@ function parseFillStep(instruction) {
|
|
|
3080
3080
|
* "Type '01/2020' into the Start Date input", which carries no `fill` verb, so
|
|
3081
3081
|
* without the `type` shape the guard could never fire on any replanned step.
|
|
3082
3082
|
*
|
|
3083
|
-
* Deliberately excludes select steps (checked first,
|
|
3083
|
+
* Deliberately excludes select steps (checked first, paralleling
|
|
3084
3084
|
* `resolveDeepLocatorActuation`'s precedence) so a `select '…'` step whose
|
|
3085
3085
|
* prose happens to trail a quoted value is never mistaken for a fill. Returns
|
|
3086
3086
|
* `null` for clicks, selects, and any step without a quoted value.
|
|
@@ -3518,7 +3518,7 @@ const DECLINE_OPTION_MARKERS = [
|
|
|
3518
3518
|
];
|
|
3519
3519
|
/**
|
|
3520
3520
|
* Pick an option to satisfy a REQUIRED select on a catch-all step, from the
|
|
3521
|
-
* select's option TEXTS (placeholder already excluded
|
|
3521
|
+
* select's option TEXTS (placeholder already excluded earlier). Policy: take
|
|
3522
3522
|
* the first non-decline option (a plausible substantive answer — the operator
|
|
3523
3523
|
* accepts LLM-plausible answers reaching ATS prod); fall back to the first
|
|
3524
3524
|
* option only if every option is a decline/placeholder. Returns null when there
|
|
@@ -4518,7 +4518,7 @@ async function verifyDomEffect(target, action) {
|
|
|
4518
4518
|
case "selectOptionFromDropdown": {
|
|
4519
4519
|
// Stagehand dispatches both names to Playwright's `locator.selectOption(text)`,
|
|
4520
4520
|
// which only succeeds on native <select> and matches the input against any of
|
|
4521
|
-
// the option's value/label/textContent.
|
|
4521
|
+
// the option's value/label/textContent. Match that resolution at verify time
|
|
4522
4522
|
// so we get a real equality signal — Playwright's "selection happened" succeeds
|
|
4523
4523
|
// iff one of those three fields matches.
|
|
4524
4524
|
const expected = action.arguments?.[0]?.toString().trim() ?? "";
|
|
@@ -4536,7 +4536,7 @@ async function verifyDomEffect(target, action) {
|
|
|
4536
4536
|
// UI-style widgets — always fail the native-<select>-only check below,
|
|
4537
4537
|
// misreporting genuinely-successful selections as unverified. Fall back to
|
|
4538
4538
|
// reading the combobox's own displayed/aria value when the resolved element
|
|
4539
|
-
// isn't a real <select>,
|
|
4539
|
+
// isn't a real <select>, paralleling what a real ARIA combobox exposes.
|
|
4540
4540
|
const exprNative = `(() => { const r = document.evaluate(${JSON.stringify(xpath)}, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); const el = r.singleNodeValue; if (!el || el.tagName !== "SELECT") return null; const opt = el.options[el.selectedIndex]; if (!opt) return { value: "", label: "", text: "" }; return { value: (opt.value || "").trim(), label: (opt.label || "").trim(), text: (opt.textContent || "").trim() }; })()`;
|
|
4541
4541
|
let selected = null;
|
|
4542
4542
|
try {
|
|
@@ -4597,7 +4597,7 @@ async function verifyDomEffect(target, action) {
|
|
|
4597
4597
|
}
|
|
4598
4598
|
case "setInputFiles":
|
|
4599
4599
|
// No cheap DOM equivalent without re-resolving the file. Trust Stagehand's
|
|
4600
|
-
// actResultSuccess
|
|
4600
|
+
// actResultSuccess from the caller — caller composes signals.
|
|
4601
4601
|
return true;
|
|
4602
4602
|
case "click": {
|
|
4603
4603
|
// Clicks on radios and checkboxes toggle `:checked` without firing a
|
|
@@ -5812,7 +5812,7 @@ async function executeStepWithHealing(params) {
|
|
|
5812
5812
|
// `-32000 Node does not have a layout object` error (an unrendered
|
|
5813
5813
|
// node) or is refused by the wizard-exit deny-list costs only that
|
|
5814
5814
|
// one candidate, not the whole attempt — the next ranked candidate
|
|
5815
|
-
// is tried instead. `attemptTriedSelectors`
|
|
5815
|
+
// is tried instead. `attemptTriedSelectors` parallels the walk's own
|
|
5816
5816
|
// click attempts as they happen (not just on a successful return)
|
|
5817
5817
|
// so a click that throws a REAL error (e.g. a wedged
|
|
5818
5818
|
// `WatchdogTimeoutError`) still feeds attempt 4's exclusion filter.
|
|
@@ -6230,7 +6230,7 @@ async function executeStepWithHealing(params) {
|
|
|
6230
6230
|
? await deepLocatorCandidatesAsActions(page, frameTarget, step)
|
|
6231
6231
|
: observedCandidates;
|
|
6232
6232
|
// Fetch live-page evidence so the rephrase prompt can reason about
|
|
6233
|
-
// form state, not just observe candidates.
|
|
6233
|
+
// form state, not just observe candidates. Parallels the same
|
|
6234
6234
|
// extraction the cascade-exhaust dump path already does.
|
|
6235
6235
|
const livePageEvidence = await extractLivePageFormEvidence(page, frameTarget ?? (0, frame_target_1.mainFrameTarget)(page), {
|
|
6236
6236
|
client: anthropic,
|
|
@@ -6675,7 +6675,7 @@ async function executeStepWithHealing(params) {
|
|
|
6675
6675
|
// (validation errors rendered) with NO network/URL change is a
|
|
6676
6676
|
// validation-blocked no-op, not a real transition — but the
|
|
6677
6677
|
// dom-delta/text-change signals below would score it verified and
|
|
6678
|
-
// advance the wizard past an unfilled required page.
|
|
6678
|
+
// advance the wizard past an unfilled required page. Match the
|
|
6679
6679
|
// checkbox vacuous-click guard: when a click produced no network/URL
|
|
6680
6680
|
// change AND the page still has required-invalid controls (MUI-aware
|
|
6681
6681
|
// via countNgInvalidContainers), treat the DOM-only signal as NOT
|
|
@@ -6997,7 +6997,7 @@ async function executeStepWithHealing(params) {
|
|
|
6997
6997
|
}
|
|
6998
6998
|
throw new errors_2.StepVerificationError(`${formatStepPrefix(stepIndex, totalSteps)} (${step.slice(0, 60)}) failed verification after ${MAX_STEP_ATTEMPTS} attempts${dumpPath ? `; see ${dumpPath}` : ""}`, phantomClickAfterAttempt1 ? "phantom-click-exhausted" : "cascade-exhausted");
|
|
6999
6999
|
}
|
|
7000
|
-
/** SPA-readiness gate defaults —
|
|
7000
|
+
/** SPA-readiness gate defaults — match the recon CLI's post-navigation wait. */
|
|
7001
7001
|
const SPA_READINESS_TIMEOUT_MS = 15_000;
|
|
7002
7002
|
const SPA_READINESS_POLL_MS = 500;
|
|
7003
7003
|
const SPA_MIN_BODY_LENGTH = 5_000;
|
|
@@ -7101,7 +7101,7 @@ async function runHealingFlow(deps) {
|
|
|
7101
7101
|
// Resolved fresh per step (not cached across the run) so a cross-origin
|
|
7102
7102
|
// iframe that attaches mid-flow (e.g. after an "Apply" click reveals a
|
|
7103
7103
|
// wizard embedded later in the DOM) is picked up as soon as it's
|
|
7104
|
-
// reachable,
|
|
7104
|
+
// reachable, paralleling the recon CLI's per-step resolution. `resolveFrameTarget`
|
|
7105
7105
|
// falls back to the main-frame target when `frameSelector` is null/unresolvable,
|
|
7106
7106
|
// so this is a no-op for every flow that doesn't declare one.
|
|
7107
7107
|
const frameTarget = await (0, frame_target_1.resolveFrameTarget)(page, deps.frameSelector);
|