@enricai/barnacle 1.12.39 → 1.12.41
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/errors.d.ts +1 -1
- package/dist/api/errors.js +1 -1
- package/dist/api/helpers/reply.d.ts +1 -1
- package/dist/api/helpers/reply.js +1 -1
- package/dist/api/plugins/auth.js +1 -1
- package/dist/api/plugins/error-handler.js +3 -3
- package/dist/api/routes/submissions.js +2 -2
- package/dist/api/schemas/submissions.js +1 -1
- package/dist/lib/applicant-payload.js +3 -3
- package/dist/lib/datadog.js +2 -2
- package/dist/lib/dd-metrics.js +1 -1
- package/dist/lib/llm/anthropic-client.js +1 -1
- package/dist/lib/llm/judge.d.ts +1 -1
- package/dist/lib/llm/judge.js +2 -2
- package/dist/lib/llm/judges/error-messages.d.ts +2 -2
- package/dist/lib/llm/judges/error-messages.js +3 -3
- package/dist/lib/llm/judges/invalid-fields.d.ts +2 -2
- package/dist/lib/llm/judges/invalid-fields.js +3 -3
- package/dist/lib/llm/judges/modal-priority.d.ts +2 -2
- package/dist/lib/llm/judges/modal-priority.js +3 -3
- package/dist/lib/llm/judges/select-option.d.ts +2 -2
- package/dist/lib/llm/judges/select-option.js +3 -3
- package/dist/lib/llm/judges/verify-submit.d.ts +2 -2
- package/dist/lib/llm/judges/verify-submit.js +3 -3
- package/dist/lib/logging.js +2 -2
- package/dist/lib/option-matcher.js +2 -2
- package/dist/lib/statsd.js +3 -3
- package/dist/lib/telemetry/beacon-capture.d.ts +1 -1
- package/dist/lib/telemetry/beacon-capture.js +2 -2
- package/dist/lib/telemetry/call-capture.js +2 -2
- package/dist/lib/telemetry/reconciliation-source.d.ts +2 -2
- package/dist/lib/telemetry/reconciliation-source.js +5 -5
- package/dist/lib/telemetry/s3-sink.js +2 -2
- package/dist/lib/telemetry/submission-capture.js +3 -3
- package/dist/lib/telemetry/submission-query.d.ts +2 -2
- package/dist/lib/telemetry/submission-reader.d.ts +1 -1
- package/dist/lib/telemetry/submission-reader.js +2 -2
- 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 +3 -3
- package/dist/lib/tracking-click.js +4 -4
- package/dist/plugins/config-plugin.js +3 -3
- package/dist/plugins/discover.js +2 -2
- package/dist/recon/load-form-schema.d.ts +1 -1
- package/dist/recon/load-vocabulary.d.ts +1 -1
- package/dist/recon/load-vocabulary.js +1 -1
- package/dist/scraper/behavioral-signals.d.ts +1 -1
- package/dist/scraper/captcha-solver.d.ts +1 -1
- package/dist/scraper/captcha-solver.js +2 -2
- package/dist/scraper/cookie-jar.js +1 -1
- 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 +1 -1
- package/dist/scraper/deep-locator-candidates.js +3 -3
- package/dist/scraper/deep-locator-click.d.ts +1 -1
- package/dist/scraper/deep-locator-click.js +1 -1
- package/dist/scraper/deep-locator-fake.d.ts +1 -1
- package/dist/scraper/deep-locator-scan.js +1 -1
- package/dist/scraper/deep-query.js +1 -1
- package/dist/scraper/flow-runner.d.ts +50 -10
- package/dist/scraper/flow-runner.d.ts.map +1 -1
- package/dist/scraper/flow-runner.js +289 -90
- package/dist/scraper/flow-runner.js.map +1 -1
- package/dist/scraper/frame-target.js +1 -1
- package/dist/scraper/graphql-client.js +1 -1
- package/dist/scraper/http-client.d.ts +1 -1
- package/dist/scraper/http-client.js +2 -2
- package/dist/scraper/http-status-classifier.js +1 -1
- package/dist/scraper/parse-json-response.d.ts +1 -1
- package/dist/scraper/parse-json-response.js +1 -1
- package/dist/scraper/pool.d.ts +3 -3
- package/dist/scraper/pool.js +3 -3
- package/dist/scraper/rate-limited-json-client.d.ts +1 -1
- package/dist/scraper/rate-limited-json-client.js +1 -1
- package/dist/scraper/raw-fetch.js +2 -2
- package/dist/scraper/require-response-field.js +1 -1
- package/dist/scraper/retry.d.ts +1 -1
- package/dist/scraper/retry.js +1 -1
- package/dist/scraper/session-browserbase.d.ts +1 -1
- package/dist/scraper/session-browserbase.js +6 -6
- package/dist/scraper/session-create-limiter.js +1 -1
- package/dist/scraper/session-ip.js +1 -1
- package/dist/scraper/session-shared.d.ts +1 -1
- package/dist/scraper/session-steel.d.ts +2 -2
- package/dist/scraper/session-steel.js +5 -5
- package/dist/scraper/session-teardown.d.ts +1 -1
- package/dist/scraper/session-teardown.js +1 -1
- package/dist/scraper/session-warmup.d.ts +1 -1
- package/dist/scraper/session.d.ts +2 -2
- package/dist/scraper/session.js +4 -4
- package/dist/scraper/spa-readiness.js +1 -1
- package/dist/scraper/stagehand-guard.d.ts +1 -1
- package/dist/scraper/stagehand-guard.js +2 -2
- package/dist/scraper/submit-control.js +1 -1
- package/dist/scripts/llm-heal.d.ts +2 -2
- package/dist/scripts/llm-heal.js +2 -2
- package/dist/scripts/recon-browser.d.ts +15 -0
- package/dist/scripts/recon-browser.d.ts.map +1 -1
- package/dist/scripts/recon-browser.js +56 -3
- package/dist/scripts/recon-browser.js.map +1 -1
- package/dist/scripts/recon-generate-multicall-fixture.d.ts +111 -2
- package/dist/scripts/recon-generate-multicall-fixture.d.ts.map +1 -1
- package/dist/scripts/recon-generate-multicall-fixture.js +311 -0
- package/dist/scripts/recon-generate-multicall-fixture.js.map +1 -1
- package/dist/scripts/recon-generate-multiendpoint-fixture.d.ts +1 -1
- package/dist/scripts/recon-generate-repeated-section-fixture.d.ts +1 -1
- package/dist/scripts/recon-generate-repeated-section-fixture.js +1 -1
- package/dist/scripts/recon-generate.d.ts +9 -4
- package/dist/scripts/recon-generate.d.ts.map +1 -1
- package/dist/scripts/recon-generate.js +235 -32
- package/dist/scripts/recon-generate.js.map +1 -1
- package/dist/scripts/recon-http.js +1 -1
- package/dist/scripts/recon-replay-jobs.js +2 -2
- package/dist/scripts/recon-summarize.js +1 -1
- package/dist/testing/replay-integration-suite.mjs +1 -1
- package/dist/testmail/client.js +1 -1
- package/package.json +2 -2
|
@@ -20,7 +20,7 @@ exports.sleep = sleep;
|
|
|
20
20
|
exports.waitForChildFrameReady = waitForChildFrameReady;
|
|
21
21
|
const config_1 = require("../config");
|
|
22
22
|
const logging_1 = require("../lib/logging");
|
|
23
|
-
const watchdog_1 = require("
|
|
23
|
+
const watchdog_1 = require("./watchdog");
|
|
24
24
|
const logger = (0, logging_1.getLogger)({ name: "scraper/frame-target" });
|
|
25
25
|
/**
|
|
26
26
|
* Builds the main-frame `FrameTarget`: every method delegates to `Page`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createGraphqlClient = createGraphqlClient;
|
|
4
|
-
const http_client_1 = require("
|
|
4
|
+
const http_client_1 = require("./http-client");
|
|
5
5
|
function createGraphqlClient(options) {
|
|
6
6
|
const { schema, bottleneck, baseHeaders, endpoint } = options;
|
|
7
7
|
const httpClient = (0, http_client_1.createHttpClient)({ schema, bottleneck, baseHeaders });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type Bottleneck from "bottleneck";
|
|
2
2
|
import type { ZodType } from "zod/v4";
|
|
3
|
-
import { type ScraperError } from "
|
|
3
|
+
import { type ScraperError } from "./errors";
|
|
4
4
|
/**
|
|
5
5
|
* Payload surfaced to the optional `onResponse` hook. Provides the raw HTTP
|
|
6
6
|
* outcome before any error classification or body parsing so callers can read
|
|
@@ -38,8 +38,8 @@ const node_fs_1 = require("node:fs");
|
|
|
38
38
|
const node_path_1 = require("node:path");
|
|
39
39
|
const p_retry_1 = __importStar(require("p-retry"));
|
|
40
40
|
const logging_1 = require("../lib/logging");
|
|
41
|
-
const errors_1 = require("
|
|
42
|
-
const frame_target_1 = require("
|
|
41
|
+
const errors_1 = require("./errors");
|
|
42
|
+
const frame_target_1 = require("./frame-target");
|
|
43
43
|
const logger = (0, logging_1.getLogger)({ name: "scraper/http-client" });
|
|
44
44
|
/**
|
|
45
45
|
* Ceiling on how long the hot path will honor a server-supplied
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.classifyHttpStatus = classifyHttpStatus;
|
|
4
|
-
const errors_1 = require("
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
5
|
/**
|
|
6
6
|
* Pure status→error classifier shared by all raw-fetch callers that cannot
|
|
7
7
|
* use `createHttpClient` (e.g. multipart Buffer bodies, per-response header
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* message shapes and slice constants across plugins.
|
|
6
6
|
*/
|
|
7
7
|
import type { ZodType } from "zod/v4";
|
|
8
|
-
import { type ScraperError } from "
|
|
8
|
+
import { type ScraperError } from "./errors";
|
|
9
9
|
/**
|
|
10
10
|
* Parses `rawBody` as JSON, validates it against `schema`, and returns the
|
|
11
11
|
* narrowed result. On a JSON parse failure, an optional `classifyBody` gets
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.parseJsonResponse = parseJsonResponse;
|
|
10
10
|
const errors_1 = require("../lib/errors");
|
|
11
|
-
const errors_2 = require("
|
|
11
|
+
const errors_2 = require("./errors");
|
|
12
12
|
/**
|
|
13
13
|
* Parses `rawBody` as JSON, validates it against `schema`, and returns the
|
|
14
14
|
* narrowed result. On a JSON parse failure, an optional `classifyBody` gets
|
package/dist/scraper/pool.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type RetryOptions } from "
|
|
2
|
-
import { type BrowserSession } from "
|
|
3
|
-
import type { BrowserSessionOptions } from "
|
|
1
|
+
import { type RetryOptions } from "./retry";
|
|
2
|
+
import { type BrowserSession } from "./session";
|
|
3
|
+
import type { BrowserSessionOptions } from "./session-shared";
|
|
4
4
|
/**
|
|
5
5
|
* Runs `task` inside a freshly created browser session. The session is
|
|
6
6
|
* torn down in a `finally` block even if `task` throws. Retries are
|
package/dist/scraper/pool.js
CHANGED
|
@@ -9,9 +9,9 @@ exports.drainPool = drainPool;
|
|
|
9
9
|
const p_queue_1 = __importDefault(require("p-queue"));
|
|
10
10
|
const config_1 = require("../config");
|
|
11
11
|
const logging_1 = require("../lib/logging");
|
|
12
|
-
const errors_1 = require("
|
|
13
|
-
const retry_1 = require("
|
|
14
|
-
const session_1 = require("
|
|
12
|
+
const errors_1 = require("./errors");
|
|
13
|
+
const retry_1 = require("./retry");
|
|
14
|
+
const session_1 = require("./session");
|
|
15
15
|
const logger = (0, logging_1.getLogger)({ name: "scraper/pool" });
|
|
16
16
|
/**
|
|
17
17
|
* Per-task hard timeout default. A hung Stagehand operation (infinite network wait,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZodType } from "zod/v4";
|
|
2
|
-
import type { HttpClientOptions, HttpRequestInit } from "
|
|
2
|
+
import type { HttpClientOptions, HttpRequestInit } from "./http-client";
|
|
3
3
|
/**
|
|
4
4
|
* Options for building a Chromium-flavoured rate-limited JSON client.
|
|
5
5
|
* Bundles the Bottleneck configuration, Chromium client-hint values, and any
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.createRateLimitedJsonClient = createRateLimitedJsonClient;
|
|
7
7
|
const bottleneck_1 = __importDefault(require("bottleneck"));
|
|
8
8
|
const chromium_client_hints_1 = require("../lib/chromium-client-hints");
|
|
9
|
-
const http_client_1 = require("
|
|
9
|
+
const http_client_1 = require("./http-client");
|
|
10
10
|
/**
|
|
11
11
|
* Site-agnostic factory that wires together Bottleneck + chromiumClientHints +
|
|
12
12
|
* createHttpClient so individual plugins don't repeat the same three-step
|
|
@@ -11,8 +11,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.rawFetch = rawFetch;
|
|
12
12
|
const undici_1 = require("undici");
|
|
13
13
|
const errors_1 = require("../lib/errors");
|
|
14
|
-
const errors_2 = require("
|
|
15
|
-
const http_status_classifier_1 = require("
|
|
14
|
+
const errors_2 = require("./errors");
|
|
15
|
+
const http_status_classifier_1 = require("./http-status-classifier");
|
|
16
16
|
/**
|
|
17
17
|
* Issues an undici fetch with caller-supplied URL / method / headers / body,
|
|
18
18
|
* invokes `onResponse` with the response headers (for token rotation or audit),
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.requireResponseField = requireResponseField;
|
|
11
11
|
exports.requireFirstItemField = requireFirstItemField;
|
|
12
|
-
const errors_1 = require("
|
|
12
|
+
const errors_1 = require("./errors");
|
|
13
13
|
/**
|
|
14
14
|
* Returns `obj[key]` cast to `T`. Throws {@link HttpSchemaError} when the
|
|
15
15
|
* value is `null`, `undefined`, or the key is absent — with `contextLabel`
|
package/dist/scraper/retry.d.ts
CHANGED
package/dist/scraper/retry.js
CHANGED
|
@@ -38,7 +38,7 @@ exports.classifyScraperError = classifyScraperError;
|
|
|
38
38
|
const p_retry_1 = __importStar(require("p-retry"));
|
|
39
39
|
const errors_1 = require("../lib/errors");
|
|
40
40
|
const logging_1 = require("../lib/logging");
|
|
41
|
-
const errors_2 = require("
|
|
41
|
+
const errors_2 = require("./errors");
|
|
42
42
|
const logger = (0, logging_1.getLogger)({ name: "scraper/retry" });
|
|
43
43
|
/**
|
|
44
44
|
* Wraps a scraper task with p-retry and a classification policy aligned
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BrowserSession, type BrowserSessionOptions } from "
|
|
1
|
+
import { type BrowserSession, type BrowserSessionOptions } from "./session-shared";
|
|
2
2
|
import type { Logger } from "../types/logging";
|
|
3
3
|
/**
|
|
4
4
|
* Shape of the LogLine objects Stagehand passes to its `logger` callback.
|
|
@@ -8,12 +8,12 @@ const config_1 = require("../config");
|
|
|
8
8
|
const bedrock_1 = require("../lib/bedrock");
|
|
9
9
|
const errors_1 = require("../lib/errors");
|
|
10
10
|
const logging_1 = require("../lib/logging");
|
|
11
|
-
const cdp_heartbeat_1 = require("
|
|
12
|
-
const errors_2 = require("
|
|
13
|
-
const session_ip_1 = require("
|
|
14
|
-
const session_shared_1 = require("
|
|
15
|
-
const session_teardown_1 = require("
|
|
16
|
-
const throttle_1 = require("
|
|
11
|
+
const cdp_heartbeat_1 = require("./cdp-heartbeat");
|
|
12
|
+
const errors_2 = require("./errors");
|
|
13
|
+
const session_ip_1 = require("./session-ip");
|
|
14
|
+
const session_shared_1 = require("./session-shared");
|
|
15
|
+
const session_teardown_1 = require("./session-teardown");
|
|
16
|
+
const throttle_1 = require("./throttle");
|
|
17
17
|
const logger = (0, logging_1.getLogger)({ name: "scraper/session-browserbase" });
|
|
18
18
|
/**
|
|
19
19
|
* Build a custom Stagehand logger that filters out the noisy
|
|
@@ -40,7 +40,7 @@ exports.scheduleSessionCreate = scheduleSessionCreate;
|
|
|
40
40
|
const bottleneck_1 = __importDefault(require("bottleneck"));
|
|
41
41
|
const p_retry_1 = __importStar(require("p-retry"));
|
|
42
42
|
const config_1 = require("../config");
|
|
43
|
-
const errors_1 = require("
|
|
43
|
+
const errors_1 = require("./errors");
|
|
44
44
|
/**
|
|
45
45
|
* Process-wide (not per-session) Bottleneck limiter pacing session-create
|
|
46
46
|
* calls. Distinct from throttle.ts's `createSessionLimiter`, which paces
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.resolveSessionOutboundIp = resolveSessionOutboundIp;
|
|
16
16
|
const node_net_1 = require("node:net");
|
|
17
17
|
const errors_1 = require("../lib/errors");
|
|
18
|
-
const watchdog_1 = require("
|
|
18
|
+
const watchdog_1 = require("./watchdog");
|
|
19
19
|
const BODY_TEXT_EXPR = 'document.body ? document.body.innerText : ""';
|
|
20
20
|
const WATCHDOG_LABEL = "session-outbound-ip:echo";
|
|
21
21
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Stagehand } from "@browserbasehq/stagehand";
|
|
2
2
|
import type Bottleneck from "bottleneck";
|
|
3
|
-
import type { CdpTransportClosedError } from "
|
|
3
|
+
import type { CdpTransportClosedError } from "./errors";
|
|
4
4
|
/** Allowed provider names. */
|
|
5
5
|
export type ProviderName = "browserbase" | "steel";
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StagehandLogLine } from "
|
|
2
|
-
import { type BrowserSession } from "
|
|
1
|
+
import type { StagehandLogLine } from "./session-browserbase";
|
|
2
|
+
import { type BrowserSession } from "./session-shared";
|
|
3
3
|
import type { Logger } from "../types/logging";
|
|
4
4
|
/**
|
|
5
5
|
* Forwards every Stagehand LogLine to pino unchanged. Steel has no
|
|
@@ -11,11 +11,11 @@ const config_1 = require("../config");
|
|
|
11
11
|
const bedrock_1 = require("../lib/bedrock");
|
|
12
12
|
const errors_1 = require("../lib/errors");
|
|
13
13
|
const logging_1 = require("../lib/logging");
|
|
14
|
-
const cdp_heartbeat_1 = require("
|
|
15
|
-
const errors_2 = require("
|
|
16
|
-
const session_shared_1 = require("
|
|
17
|
-
const session_teardown_1 = require("
|
|
18
|
-
const throttle_1 = require("
|
|
14
|
+
const cdp_heartbeat_1 = require("./cdp-heartbeat");
|
|
15
|
+
const errors_2 = require("./errors");
|
|
16
|
+
const session_shared_1 = require("./session-shared");
|
|
17
|
+
const session_teardown_1 = require("./session-teardown");
|
|
18
|
+
const throttle_1 = require("./throttle");
|
|
19
19
|
const logger = (0, logging_1.getLogger)({ name: "scraper/session-steel" });
|
|
20
20
|
/**
|
|
21
21
|
* Forwards every Stagehand LogLine to pino unchanged. Steel has no
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StagehandLogLine } from "
|
|
1
|
+
import type { StagehandLogLine } from "./session-browserbase";
|
|
2
2
|
/**
|
|
3
3
|
* Detects a Stagehand-initiated CDP transport teardown from its log stream
|
|
4
4
|
* and exposes that as a promise that rejects the instant it's observed. A
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createSessionTeardownDetector = createSessionTeardownDetector;
|
|
4
4
|
exports.raceAgainstTeardown = raceAgainstTeardown;
|
|
5
|
-
const errors_1 = require("
|
|
5
|
+
const errors_1 = require("./errors");
|
|
6
6
|
/**
|
|
7
7
|
* Substring Stagehand's own v3 transport logs at `level:0` (error) when it
|
|
8
8
|
* initiates teardown of the CDP connection — verbatim across both log lines
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* finally-close + error-mapping each time.
|
|
11
11
|
*/
|
|
12
12
|
import { type Options as PRetryOptions } from "p-retry";
|
|
13
|
-
import type { BrowserSession } from "
|
|
13
|
+
import type { BrowserSession } from "./session-shared";
|
|
14
14
|
export interface SessionWarmupOptions {
|
|
15
15
|
/** pRetry options forwarded verbatim. The caller controls retries, timeouts, and onFailedAttempt. */
|
|
16
16
|
retryOptions: PRetryOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BrowserSession, BrowserSessionOptions } from "
|
|
2
|
-
export type { BrowserbaseSessionCreateParams, BrowserSession, BrowserSessionOptions, ProviderName, } from "
|
|
1
|
+
import type { BrowserSession, BrowserSessionOptions } from "./session-shared";
|
|
2
|
+
export type { BrowserbaseSessionCreateParams, BrowserSession, BrowserSessionOptions, ProviderName, } from "./session-shared";
|
|
3
3
|
/**
|
|
4
4
|
* Spins up one browser session via the configured provider. Browserbase is the
|
|
5
5
|
* default; Steel is an opt-in fallback.
|
package/dist/scraper/session.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBrowserSession = createBrowserSession;
|
|
4
4
|
const config_1 = require("../config");
|
|
5
|
-
const captcha_callback_capture_1 = require("
|
|
6
|
-
const session_browserbase_1 = require("
|
|
7
|
-
const session_create_limiter_1 = require("
|
|
8
|
-
const session_steel_1 = require("
|
|
5
|
+
const captcha_callback_capture_1 = require("./captcha-callback-capture");
|
|
6
|
+
const session_browserbase_1 = require("./session-browserbase");
|
|
7
|
+
const session_create_limiter_1 = require("./session-create-limiter");
|
|
8
|
+
const session_steel_1 = require("./session-steel");
|
|
9
9
|
/**
|
|
10
10
|
* Spins up one browser session via the configured provider. Browserbase is the
|
|
11
11
|
* default; Steel is an opt-in fallback.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.waitForSpaReady = waitForSpaReady;
|
|
4
|
-
const watchdog_1 = require("
|
|
4
|
+
const watchdog_1 = require("./watchdog");
|
|
5
5
|
/** SPA-readiness gate defaults — match the recon CLI's post-navigation wait. */
|
|
6
6
|
const SPA_READINESS_TIMEOUT_MS = 15_000;
|
|
7
7
|
const SPA_READINESS_POLL_MS = 500;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
import type { Action, ActOptions, ActResult, ExtractOptions, ObserveOptions, Stagehand } from "@browserbasehq/stagehand";
|
|
40
40
|
import { z } from "zod/v4";
|
|
41
41
|
import { type LlmCallInput } from "../lib/telemetry/call-capture";
|
|
42
|
-
import { type FrameTarget } from "
|
|
42
|
+
import { type FrameTarget } from "./frame-target";
|
|
43
43
|
/**
|
|
44
44
|
* Injectable capture function — matches `captureLlmCall`'s signature. Same
|
|
45
45
|
* shape as `JudgeCaptureFn` in `@/lib/llm/judge`. Lets each guard call route
|
|
@@ -46,8 +46,8 @@ const node_crypto_1 = require("node:crypto");
|
|
|
46
46
|
const v4_1 = require("zod/v4");
|
|
47
47
|
const call_capture_1 = require("../lib/telemetry/call-capture");
|
|
48
48
|
const call_types_1 = require("../lib/telemetry/call-types");
|
|
49
|
-
const frame_target_1 = require("
|
|
50
|
-
const watchdog_1 = require("
|
|
49
|
+
const frame_target_1 = require("./frame-target");
|
|
50
|
+
const watchdog_1 = require("./watchdog");
|
|
51
51
|
/**
|
|
52
52
|
* Fallback watchdog bound for a guarded call whose caller passes no
|
|
53
53
|
* `options.timeout`. Parallels `STEP_WATCHDOG_MS` (`@/scraper/flow-runner`) by
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.buildRankSubmitCandidatesExpr = buildRankSubmitCandidatesExpr;
|
|
14
14
|
exports.buildClickByDeepIndexExpr = buildClickByDeepIndexExpr;
|
|
15
|
-
const browser_click_expr_1 = require("
|
|
15
|
+
const browser_click_expr_1 = require("./browser-click-expr");
|
|
16
16
|
/**
|
|
17
17
|
* Verbs that identify a control as NOT the submit action even when it is
|
|
18
18
|
* button-shaped and reachable. Checked before any positive tier so a
|
|
@@ -25,8 +25,8 @@ import Anthropic from "@anthropic-ai/sdk";
|
|
|
25
25
|
import { type LlmCallSample } from "../api/schemas/telemetry";
|
|
26
26
|
import { buildAnthropicClient } from "../lib/llm/anthropic-client";
|
|
27
27
|
import { type LlmCallInput } from "../lib/telemetry/call-capture";
|
|
28
|
-
import { type ScorerFn } from "
|
|
29
|
-
import { type FlowPatch, type HealVerdict, type IterationRecord } from "
|
|
28
|
+
import { type ScorerFn } from "./judge-llm-batch";
|
|
29
|
+
import { type FlowPatch, type HealVerdict, type IterationRecord } from "./recon-heal";
|
|
30
30
|
/**
|
|
31
31
|
* Persistent state written after each iteration so the operator can inspect
|
|
32
32
|
* progress. Matches recon-heal's HealState but scoped to prompt-template arms.
|
package/dist/scripts/llm-heal.js
CHANGED
|
@@ -48,8 +48,8 @@ const schemas_1 = require("../lib/llm/schemas");
|
|
|
48
48
|
const logging_1 = require("../lib/logging");
|
|
49
49
|
const call_capture_1 = require("../lib/telemetry/call-capture");
|
|
50
50
|
const call_types_1 = require("../lib/telemetry/call-types");
|
|
51
|
-
const judge_llm_batch_1 = require("
|
|
52
|
-
const recon_heal_1 = require("
|
|
51
|
+
const judge_llm_batch_1 = require("./judge-llm-batch");
|
|
52
|
+
const recon_heal_1 = require("./recon-heal");
|
|
53
53
|
const logger = (0, logging_1.getScriptLogger)("llm-heal");
|
|
54
54
|
// ── defaults ──────────────────────────────────────────────────────────────────
|
|
55
55
|
const DEFAULT_MAX_ITERATIONS = 5;
|
|
@@ -416,6 +416,21 @@ export declare function filterReplanDuplicatingNextAuthored(newSteps: readonly N
|
|
|
416
416
|
* Pure; returns false whenever the bridge adds any genuinely new step.
|
|
417
417
|
*/
|
|
418
418
|
export declare function isReplanReproposingFailedStep(newSteps: readonly NormalizedStep[], failedStep: string): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Detect whether the live page has already navigated away from where a step
|
|
421
|
+
* started, mirroring {@link findRecentPageTransition} in flow-runner.ts:
|
|
422
|
+
* an observed URL transition is a legitimate completion signal, not
|
|
423
|
+
* ambiguous state that needs an LLM to interpret. Used as a deterministic,
|
|
424
|
+
* pre-replan short-circuit: when a step's verification fails but the page
|
|
425
|
+
* has moved to a new origin or path, the step's effect already landed and
|
|
426
|
+
* replanning would either re-author completed work or re-propose the same
|
|
427
|
+
* failed step against a page that no longer matches it. A same-path
|
|
428
|
+
* query/hash-only change (SPA-internal state, e.g. a modal toggling `?tab=`)
|
|
429
|
+
* is NOT treated as advancement — that is not a real navigation. Fails
|
|
430
|
+
* closed (returns false) on unparseable URLs so the existing replan path is
|
|
431
|
+
* unaffected when the signal is ambiguous.
|
|
432
|
+
*/
|
|
433
|
+
export declare function hasPageAlreadyAdvancedPastStep(stepStartUrl: string, currentUrl: string): boolean;
|
|
419
434
|
/**
|
|
420
435
|
* Detect a replan that proposes a Sign-In/Log-In recovery bridge after the
|
|
421
436
|
* completed-steps history already shows an account-creation/registration step.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recon-browser.d.ts","sourceRoot":"","sources":["../../src/scripts/recon-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAMH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAE/C,OAA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AuB,EACvB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,GACpB,CAAC"}
|
|
@@ -61,6 +61,7 @@ exports.dedupeReplanStepsByTarget = dedupeReplanStepsByTarget;
|
|
|
61
61
|
exports.filterCompletedFromReplan = filterCompletedFromReplan;
|
|
62
62
|
exports.filterReplanDuplicatingNextAuthored = filterReplanDuplicatingNextAuthored;
|
|
63
63
|
exports.isReplanReproposingFailedStep = isReplanReproposingFailedStep;
|
|
64
|
+
exports.hasPageAlreadyAdvancedPastStep = hasPageAlreadyAdvancedPastStep;
|
|
64
65
|
exports.isReplanRegressingAcrossAuthBoundary = isReplanRegressingAcrossAuthBoundary;
|
|
65
66
|
exports.renderStepWindow = renderStepWindow;
|
|
66
67
|
exports.countSlugPrefixMatches = countSlugPrefixMatches;
|
|
@@ -101,8 +102,8 @@ const session_teardown_1 = require("../scraper/session-teardown");
|
|
|
101
102
|
const spa_readiness_1 = require("../scraper/spa-readiness");
|
|
102
103
|
const stagehand_guard_1 = require("../scraper/stagehand-guard");
|
|
103
104
|
const watchdog_1 = require("../scraper/watchdog");
|
|
104
|
-
const judge_llm_batch_1 = require("
|
|
105
|
-
const recon_shared_1 = require("
|
|
105
|
+
const judge_llm_batch_1 = require("./judge-llm-batch");
|
|
106
|
+
const recon_shared_1 = require("./recon-shared");
|
|
106
107
|
const resume_fixture_1 = require("../testing/resume-fixture");
|
|
107
108
|
const client_1 = require("../testmail/client");
|
|
108
109
|
(0, http_1.configureHttpDispatcher)();
|
|
@@ -876,6 +877,41 @@ function isReplanReproposingFailedStep(newSteps, failedStep) {
|
|
|
876
877
|
const failedNorm = normalizeInstruction(failedStep);
|
|
877
878
|
return newSteps.every((s) => normalizeInstruction(s.instruction) === failedNorm);
|
|
878
879
|
}
|
|
880
|
+
/**
|
|
881
|
+
* Normalize a URL to origin + pathname (query and hash stripped) for
|
|
882
|
+
* same-page-vs-navigated comparison. Returns null on unparseable input so
|
|
883
|
+
* callers can fail closed rather than false-positive on a malformed URL.
|
|
884
|
+
*/
|
|
885
|
+
function originAndPath(url) {
|
|
886
|
+
try {
|
|
887
|
+
const parsed = new URL(url);
|
|
888
|
+
return parsed.origin + parsed.pathname;
|
|
889
|
+
}
|
|
890
|
+
catch {
|
|
891
|
+
return null;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Detect whether the live page has already navigated away from where a step
|
|
896
|
+
* started, mirroring {@link findRecentPageTransition} in flow-runner.ts:
|
|
897
|
+
* an observed URL transition is a legitimate completion signal, not
|
|
898
|
+
* ambiguous state that needs an LLM to interpret. Used as a deterministic,
|
|
899
|
+
* pre-replan short-circuit: when a step's verification fails but the page
|
|
900
|
+
* has moved to a new origin or path, the step's effect already landed and
|
|
901
|
+
* replanning would either re-author completed work or re-propose the same
|
|
902
|
+
* failed step against a page that no longer matches it. A same-path
|
|
903
|
+
* query/hash-only change (SPA-internal state, e.g. a modal toggling `?tab=`)
|
|
904
|
+
* is NOT treated as advancement — that is not a real navigation. Fails
|
|
905
|
+
* closed (returns false) on unparseable URLs so the existing replan path is
|
|
906
|
+
* unaffected when the signal is ambiguous.
|
|
907
|
+
*/
|
|
908
|
+
function hasPageAlreadyAdvancedPastStep(stepStartUrl, currentUrl) {
|
|
909
|
+
const start = originAndPath(stepStartUrl);
|
|
910
|
+
const current = originAndPath(currentUrl);
|
|
911
|
+
if (start === null || current === null)
|
|
912
|
+
return false;
|
|
913
|
+
return start !== current;
|
|
914
|
+
}
|
|
879
915
|
/** Word-boundary phrase patterns identifying a sign-in/log-in step, keyed lowercase like {@link ACCOUNT_CREATION_PATTERNS}. */
|
|
880
916
|
const SIGN_IN_PATTERNS = [/\bsign[\s-]?in\b/, /\blog[\s-]?in\b/];
|
|
881
917
|
/** Word-boundary phrase patterns identifying an account-creation/registration step. */
|
|
@@ -1880,7 +1916,7 @@ async function main() {
|
|
|
1880
1916
|
throw new errors_2.SessionTimeoutError(`${(0, flow_runner_1.formatStepPrefix)(i, () => plan.length)} session appears closed/dead (page.url() threw: ${(0, errors_1.toErrorMessage)(err)}) — aborting after ${i} of ${plan.length} steps completed`);
|
|
1881
1917
|
}
|
|
1882
1918
|
};
|
|
1883
|
-
readLiveUrl();
|
|
1919
|
+
const urlAtStepStart = readLiveUrl();
|
|
1884
1920
|
currentPhase =
|
|
1885
1921
|
step.instruction
|
|
1886
1922
|
.replace(/[^a-z0-9]+/gi, "-")
|
|
@@ -2076,6 +2112,23 @@ async function main() {
|
|
|
2076
2112
|
logger.error(`wizard regression: ${err.message}; aborting run`);
|
|
2077
2113
|
throw err;
|
|
2078
2114
|
}
|
|
2115
|
+
// Deterministic pre-replan short-circuit: if the live page has
|
|
2116
|
+
// already navigated away from where this step started, the step's
|
|
2117
|
+
// effect landed even though verification failed to observe it —
|
|
2118
|
+
// mirrors flow-runner.ts's findRecentPageTransition precedent.
|
|
2119
|
+
// Replanning here would either re-author already-completed work or
|
|
2120
|
+
// re-propose the identical failed step against a page it no longer
|
|
2121
|
+
// matches, so skip the replan dispatcher entirely and resume with
|
|
2122
|
+
// the remaining tail.
|
|
2123
|
+
const urlAfterFailure = readLiveUrl();
|
|
2124
|
+
if (hasPageAlreadyAdvancedPastStep(urlAtStepStart, urlAfterFailure)) {
|
|
2125
|
+
logger.info(`${(0, flow_runner_1.formatStepPrefix)(i, () => plan.length)} verification failed but the page already advanced past this step (${urlAtStepStart} → ${urlAfterFailure}); treating as completed and resuming remaining tail`);
|
|
2126
|
+
consecutiveStaleSkips = 0;
|
|
2127
|
+
lastSuccessNetworkCount = signalCounter.n;
|
|
2128
|
+
lastSuccessUrl = urlAfterFailure;
|
|
2129
|
+
completedSteps.push(step.instruction);
|
|
2130
|
+
continue;
|
|
2131
|
+
}
|
|
2079
2132
|
// Tier 1 — trailing-optional-step grace: when an OPTIONAL step at
|
|
2080
2133
|
// trailing position fails verification AND a recent non-GET capture
|
|
2081
2134
|
// returned 2xx, treat as a benign no-op exit. The flow's "real work"
|