@enricai/barnacle 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +958 -0
- package/dist/api/errors.d.ts +88 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +164 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/helpers/envelope.d.ts +13 -0
- package/dist/api/helpers/envelope.d.ts.map +1 -0
- package/dist/api/helpers/envelope.js +20 -0
- package/dist/api/helpers/envelope.js.map +1 -0
- package/dist/api/helpers/reply.d.ts +9 -0
- package/dist/api/helpers/reply.d.ts.map +1 -0
- package/dist/api/helpers/reply.js +14 -0
- package/dist/api/helpers/reply.js.map +1 -0
- package/dist/api/plugins/auth.d.ts +27 -0
- package/dist/api/plugins/auth.d.ts.map +1 -0
- package/dist/api/plugins/auth.js +111 -0
- package/dist/api/plugins/auth.js.map +1 -0
- package/dist/api/plugins/error-handler.d.ts +12 -0
- package/dist/api/plugins/error-handler.d.ts.map +1 -0
- package/dist/api/plugins/error-handler.js +72 -0
- package/dist/api/plugins/error-handler.js.map +1 -0
- package/dist/api/plugins/request-context.d.ts +17 -0
- package/dist/api/plugins/request-context.d.ts.map +1 -0
- package/dist/api/plugins/request-context.js +61 -0
- package/dist/api/plugins/request-context.js.map +1 -0
- package/dist/api/routes/health.d.ts +55 -0
- package/dist/api/routes/health.d.ts.map +1 -0
- package/dist/api/routes/health.js +137 -0
- package/dist/api/routes/health.js.map +1 -0
- package/dist/api/routes/plugins-introspection.d.ts +17 -0
- package/dist/api/routes/plugins-introspection.d.ts.map +1 -0
- package/dist/api/routes/plugins-introspection.js +13 -0
- package/dist/api/routes/plugins-introspection.js.map +1 -0
- package/dist/api/schemas/common.d.ts +114 -0
- package/dist/api/schemas/common.d.ts.map +1 -0
- package/dist/api/schemas/common.js +109 -0
- package/dist/api/schemas/common.js.map +1 -0
- package/dist/api/schemas/telemetry.d.ts +66 -0
- package/dist/api/schemas/telemetry.d.ts.map +1 -0
- package/dist/api/schemas/telemetry.js +52 -0
- package/dist/api/schemas/telemetry.js.map +1 -0
- package/dist/cache/keyed-ttl-cache.d.ts +45 -0
- package/dist/cache/keyed-ttl-cache.d.ts.map +1 -0
- package/dist/cache/keyed-ttl-cache.js +69 -0
- package/dist/cache/keyed-ttl-cache.js.map +1 -0
- package/dist/cache/response-cache.d.ts +37 -0
- package/dist/cache/response-cache.d.ts.map +1 -0
- package/dist/cache/response-cache.js +114 -0
- package/dist/cache/response-cache.js.map +1 -0
- package/dist/config.d.ts +258 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +138 -0
- package/dist/config.js.map +1 -0
- package/dist/lib/applicant-payload.d.ts +28 -0
- package/dist/lib/applicant-payload.d.ts.map +1 -0
- package/dist/lib/applicant-payload.js +20 -0
- package/dist/lib/applicant-payload.js.map +1 -0
- package/dist/lib/application-address.d.ts +16 -0
- package/dist/lib/application-address.d.ts.map +1 -0
- package/dist/lib/application-address.js +20 -0
- package/dist/lib/application-address.js.map +1 -0
- package/dist/lib/application-answers.d.ts +151 -0
- package/dist/lib/application-answers.d.ts.map +1 -0
- package/dist/lib/application-answers.js +95 -0
- package/dist/lib/application-answers.js.map +1 -0
- package/dist/lib/application-identity.d.ts +18 -0
- package/dist/lib/application-identity.d.ts.map +1 -0
- package/dist/lib/application-identity.js +20 -0
- package/dist/lib/application-identity.js.map +1 -0
- package/dist/lib/application-resume.d.ts +21 -0
- package/dist/lib/application-resume.d.ts.map +1 -0
- package/dist/lib/application-resume.js +23 -0
- package/dist/lib/application-resume.js.map +1 -0
- package/dist/lib/bedrock.d.ts +22 -0
- package/dist/lib/bedrock.d.ts.map +1 -0
- package/dist/lib/bedrock.js +35 -0
- package/dist/lib/bedrock.js.map +1 -0
- package/dist/lib/case-insensitive-headers.d.ts +15 -0
- package/dist/lib/case-insensitive-headers.d.ts.map +1 -0
- package/dist/lib/case-insensitive-headers.js +29 -0
- package/dist/lib/case-insensitive-headers.js.map +1 -0
- package/dist/lib/chromium-client-hints.d.ts +11 -0
- package/dist/lib/chromium-client-hints.d.ts.map +1 -0
- package/dist/lib/chromium-client-hints.js +17 -0
- package/dist/lib/chromium-client-hints.js.map +1 -0
- package/dist/lib/cookie-value.d.ts +8 -0
- package/dist/lib/cookie-value.d.ts.map +1 -0
- package/dist/lib/cookie-value.js +14 -0
- package/dist/lib/cookie-value.js.map +1 -0
- package/dist/lib/datadog.d.ts +8 -0
- package/dist/lib/datadog.d.ts.map +1 -0
- package/dist/lib/datadog.js +27 -0
- package/dist/lib/datadog.js.map +1 -0
- package/dist/lib/dd-metrics.d.ts +28 -0
- package/dist/lib/dd-metrics.d.ts.map +1 -0
- package/dist/lib/dd-metrics.js +62 -0
- package/dist/lib/dd-metrics.js.map +1 -0
- package/dist/lib/dispatch-metrics.d.ts +19 -0
- package/dist/lib/dispatch-metrics.d.ts.map +1 -0
- package/dist/lib/dispatch-metrics.js +65 -0
- package/dist/lib/dispatch-metrics.js.map +1 -0
- package/dist/lib/env.d.ts +37 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/env.js +70 -0
- package/dist/lib/env.js.map +1 -0
- package/dist/lib/errors.d.ts +15 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +20 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/http.d.ts +7 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +14 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/job-tracking.d.ts +17 -0
- package/dist/lib/job-tracking.d.ts.map +1 -0
- package/dist/lib/job-tracking.js +19 -0
- package/dist/lib/job-tracking.js.map +1 -0
- package/dist/lib/llm/anthropic-client.d.ts +12 -0
- package/dist/lib/llm/anthropic-client.d.ts.map +1 -0
- package/dist/lib/llm/anthropic-client.js +23 -0
- package/dist/lib/llm/anthropic-client.js.map +1 -0
- package/dist/lib/llm/judge.d.ts +57 -0
- package/dist/lib/llm/judge.d.ts.map +1 -0
- package/dist/lib/llm/judge.js +123 -0
- package/dist/lib/llm/judge.js.map +1 -0
- package/dist/lib/llm/judges/error-messages.d.ts +38 -0
- package/dist/lib/llm/judges/error-messages.d.ts.map +1 -0
- package/dist/lib/llm/judges/error-messages.js +72 -0
- package/dist/lib/llm/judges/error-messages.js.map +1 -0
- package/dist/lib/llm/judges/invalid-fields.d.ts +43 -0
- package/dist/lib/llm/judges/invalid-fields.d.ts.map +1 -0
- package/dist/lib/llm/judges/invalid-fields.js +80 -0
- package/dist/lib/llm/judges/invalid-fields.js.map +1 -0
- package/dist/lib/llm/judges/modal-priority.d.ts +41 -0
- package/dist/lib/llm/judges/modal-priority.d.ts.map +1 -0
- package/dist/lib/llm/judges/modal-priority.js +74 -0
- package/dist/lib/llm/judges/modal-priority.js.map +1 -0
- package/dist/lib/llm/judges/select-option.d.ts +49 -0
- package/dist/lib/llm/judges/select-option.d.ts.map +1 -0
- package/dist/lib/llm/judges/select-option.js +90 -0
- package/dist/lib/llm/judges/select-option.js.map +1 -0
- package/dist/lib/llm/judges/verify-submit.d.ts +68 -0
- package/dist/lib/llm/judges/verify-submit.d.ts.map +1 -0
- package/dist/lib/llm/judges/verify-submit.js +89 -0
- package/dist/lib/llm/judges/verify-submit.js.map +1 -0
- package/dist/lib/llm/schemas.d.ts +220 -0
- package/dist/lib/llm/schemas.d.ts.map +1 -0
- package/dist/lib/llm/schemas.js +239 -0
- package/dist/lib/llm/schemas.js.map +1 -0
- package/dist/lib/logging.d.ts +39 -0
- package/dist/lib/logging.d.ts.map +1 -0
- package/dist/lib/logging.js +219 -0
- package/dist/lib/logging.js.map +1 -0
- package/dist/lib/multipart.d.ts +34 -0
- package/dist/lib/multipart.d.ts.map +1 -0
- package/dist/lib/multipart.js +55 -0
- package/dist/lib/multipart.js.map +1 -0
- package/dist/lib/option-matcher.d.ts +15 -0
- package/dist/lib/option-matcher.d.ts.map +1 -0
- package/dist/lib/option-matcher.js +69 -0
- package/dist/lib/option-matcher.js.map +1 -0
- package/dist/lib/phone.d.ts +11 -0
- package/dist/lib/phone.d.ts.map +1 -0
- package/dist/lib/phone.js +17 -0
- package/dist/lib/phone.js.map +1 -0
- package/dist/lib/random.d.ts +22 -0
- package/dist/lib/random.d.ts.map +1 -0
- package/dist/lib/random.js +33 -0
- package/dist/lib/random.js.map +1 -0
- package/dist/lib/statsd.d.ts +11 -0
- package/dist/lib/statsd.d.ts.map +1 -0
- package/dist/lib/statsd.js +68 -0
- package/dist/lib/statsd.js.map +1 -0
- package/dist/lib/telemetry/call-capture.d.ts +89 -0
- package/dist/lib/telemetry/call-capture.d.ts.map +1 -0
- package/dist/lib/telemetry/call-capture.js +190 -0
- package/dist/lib/telemetry/call-capture.js.map +1 -0
- package/dist/lib/telemetry/call-types.d.ts +65 -0
- package/dist/lib/telemetry/call-types.d.ts.map +1 -0
- package/dist/lib/telemetry/call-types.js +68 -0
- package/dist/lib/telemetry/call-types.js.map +1 -0
- package/dist/lib/telemetry/run-state.d.ts +15 -0
- package/dist/lib/telemetry/run-state.d.ts.map +1 -0
- package/dist/lib/telemetry/run-state.js +23 -0
- package/dist/lib/telemetry/run-state.js.map +1 -0
- package/dist/lib/telemetry/s3-sink.d.ts +48 -0
- package/dist/lib/telemetry/s3-sink.d.ts.map +1 -0
- package/dist/lib/telemetry/s3-sink.js +229 -0
- package/dist/lib/telemetry/s3-sink.js.map +1 -0
- package/dist/lib/telemetry/submission-capture.d.ts +45 -0
- package/dist/lib/telemetry/submission-capture.d.ts.map +1 -0
- package/dist/lib/telemetry/submission-capture.js +57 -0
- package/dist/lib/telemetry/submission-capture.js.map +1 -0
- package/dist/lib/telemetry/telemetry-paths.d.ts +59 -0
- package/dist/lib/telemetry/telemetry-paths.d.ts.map +1 -0
- package/dist/lib/telemetry/telemetry-paths.js +103 -0
- package/dist/lib/telemetry/telemetry-paths.js.map +1 -0
- package/dist/lib/tracking-click.d.ts +20 -0
- package/dist/lib/tracking-click.d.ts.map +1 -0
- package/dist/lib/tracking-click.js +75 -0
- package/dist/lib/tracking-click.js.map +1 -0
- package/dist/lib/url-capture.d.ts +8 -0
- package/dist/lib/url-capture.d.ts.map +1 -0
- package/dist/lib/url-capture.js +17 -0
- package/dist/lib/url-capture.js.map +1 -0
- package/dist/lib/us-states.d.ts +20 -0
- package/dist/lib/us-states.d.ts.map +1 -0
- package/dist/lib/us-states.js +86 -0
- package/dist/lib/us-states.js.map +1 -0
- package/dist/lib/zod-multipart.d.ts +18 -0
- package/dist/lib/zod-multipart.d.ts.map +1 -0
- package/dist/lib/zod-multipart.js +35 -0
- package/dist/lib/zod-multipart.js.map +1 -0
- package/dist/plugins/config-plugin.d.ts +77 -0
- package/dist/plugins/config-plugin.d.ts.map +1 -0
- package/dist/plugins/config-plugin.js +216 -0
- package/dist/plugins/config-plugin.js.map +1 -0
- package/dist/plugins/discover.d.ts +72 -0
- package/dist/plugins/discover.d.ts.map +1 -0
- package/dist/plugins/discover.js +265 -0
- package/dist/plugins/discover.js.map +1 -0
- package/dist/plugins/json-schema-to-zod.d.ts +47 -0
- package/dist/plugins/json-schema-to-zod.d.ts.map +1 -0
- package/dist/plugins/json-schema-to-zod.js +85 -0
- package/dist/plugins/json-schema-to-zod.js.map +1 -0
- package/dist/plugins/loader.d.ts +34 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +348 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/plugin-api-version.d.ts +8 -0
- package/dist/plugins/plugin-api-version.d.ts.map +1 -0
- package/dist/plugins/plugin-api-version.js +11 -0
- package/dist/plugins/plugin-api-version.js.map +1 -0
- package/dist/plugins/plugin-manifest-envelope.d.ts +16 -0
- package/dist/plugins/plugin-manifest-envelope.d.ts.map +1 -0
- package/dist/plugins/plugin-manifest-envelope.js +19 -0
- package/dist/plugins/plugin-manifest-envelope.js.map +1 -0
- package/dist/scraper/behavioral-signals.d.ts +16 -0
- package/dist/scraper/behavioral-signals.d.ts.map +1 -0
- package/dist/scraper/behavioral-signals.js +30 -0
- package/dist/scraper/behavioral-signals.js.map +1 -0
- package/dist/scraper/errors.d.ts +193 -0
- package/dist/scraper/errors.d.ts.map +1 -0
- package/dist/scraper/errors.js +226 -0
- package/dist/scraper/errors.js.map +1 -0
- package/dist/scraper/fixtures.d.ts +23 -0
- package/dist/scraper/fixtures.d.ts.map +1 -0
- package/dist/scraper/fixtures.js +48 -0
- package/dist/scraper/fixtures.js.map +1 -0
- package/dist/scraper/flow-runner.d.ts +1319 -0
- package/dist/scraper/flow-runner.d.ts.map +1 -0
- package/dist/scraper/flow-runner.js +5637 -0
- package/dist/scraper/flow-runner.js.map +1 -0
- package/dist/scraper/graphql-client.d.ts +30 -0
- package/dist/scraper/graphql-client.d.ts.map +1 -0
- package/dist/scraper/graphql-client.js +14 -0
- package/dist/scraper/graphql-client.js.map +1 -0
- package/dist/scraper/http-client.d.ts +75 -0
- package/dist/scraper/http-client.d.ts.map +1 -0
- package/dist/scraper/http-client.js +189 -0
- package/dist/scraper/http-client.js.map +1 -0
- package/dist/scraper/http-status-classifier.d.ts +12 -0
- package/dist/scraper/http-status-classifier.d.ts.map +1 -0
- package/dist/scraper/http-status-classifier.js +29 -0
- package/dist/scraper/http-status-classifier.js.map +1 -0
- package/dist/scraper/metrics.d.ts +50 -0
- package/dist/scraper/metrics.d.ts.map +1 -0
- package/dist/scraper/metrics.js +85 -0
- package/dist/scraper/metrics.js.map +1 -0
- package/dist/scraper/navigate.d.ts +20 -0
- package/dist/scraper/navigate.d.ts.map +1 -0
- package/dist/scraper/navigate.js +30 -0
- package/dist/scraper/navigate.js.map +1 -0
- package/dist/scraper/oracle-sentinels.d.ts +22 -0
- package/dist/scraper/oracle-sentinels.d.ts.map +1 -0
- package/dist/scraper/oracle-sentinels.js +40 -0
- package/dist/scraper/oracle-sentinels.js.map +1 -0
- package/dist/scraper/parse-json-response.d.ts +16 -0
- package/dist/scraper/parse-json-response.d.ts.map +1 -0
- package/dist/scraper/parse-json-response.js +37 -0
- package/dist/scraper/parse-json-response.js.map +1 -0
- package/dist/scraper/pool.d.ts +37 -0
- package/dist/scraper/pool.d.ts.map +1 -0
- package/dist/scraper/pool.js +105 -0
- package/dist/scraper/pool.js.map +1 -0
- package/dist/scraper/rate-limited-json-client.d.ts +35 -0
- package/dist/scraper/rate-limited-json-client.d.ts.map +1 -0
- package/dist/scraper/rate-limited-json-client.js +29 -0
- package/dist/scraper/rate-limited-json-client.js.map +1 -0
- package/dist/scraper/raw-fetch.d.ts +49 -0
- package/dist/scraper/raw-fetch.d.ts.map +1 -0
- package/dist/scraper/raw-fetch.js +40 -0
- package/dist/scraper/raw-fetch.js.map +1 -0
- package/dist/scraper/require-response-field.d.ts +23 -0
- package/dist/scraper/require-response-field.d.ts.map +1 -0
- package/dist/scraper/require-response-field.js +42 -0
- package/dist/scraper/require-response-field.js.map +1 -0
- package/dist/scraper/retry.d.ts +33 -0
- package/dist/scraper/retry.d.ts.map +1 -0
- package/dist/scraper/retry.js +122 -0
- package/dist/scraper/retry.js.map +1 -0
- package/dist/scraper/session-browserbase.d.ts +35 -0
- package/dist/scraper/session-browserbase.d.ts.map +1 -0
- package/dist/scraper/session-browserbase.js +198 -0
- package/dist/scraper/session-browserbase.js.map +1 -0
- package/dist/scraper/session-shared.d.ts +29 -0
- package/dist/scraper/session-shared.d.ts.map +1 -0
- package/dist/scraper/session-shared.js +35 -0
- package/dist/scraper/session-shared.js.map +1 -0
- package/dist/scraper/session-steel.d.ts +31 -0
- package/dist/scraper/session-steel.d.ts.map +1 -0
- package/dist/scraper/session-steel.js +140 -0
- package/dist/scraper/session-steel.js.map +1 -0
- package/dist/scraper/session-warmup.d.ts +31 -0
- package/dist/scraper/session-warmup.d.ts.map +1 -0
- package/dist/scraper/session-warmup.js +46 -0
- package/dist/scraper/session-warmup.js.map +1 -0
- package/dist/scraper/session.d.ts +21 -0
- package/dist/scraper/session.d.ts.map +1 -0
- package/dist/scraper/session.js +28 -0
- package/dist/scraper/session.js.map +1 -0
- package/dist/scraper/stagehand-guard.d.ts +128 -0
- package/dist/scraper/stagehand-guard.d.ts.map +1 -0
- package/dist/scraper/stagehand-guard.js +337 -0
- package/dist/scraper/stagehand-guard.js.map +1 -0
- package/dist/scraper/throttle.d.ts +21 -0
- package/dist/scraper/throttle.d.ts.map +1 -0
- package/dist/scraper/throttle.js +45 -0
- package/dist/scraper/throttle.js.map +1 -0
- package/dist/scripts/hca-inbox-poll.d.ts +19 -0
- package/dist/scripts/hca-inbox-poll.d.ts.map +1 -0
- package/dist/scripts/hca-inbox-poll.js +151 -0
- package/dist/scripts/hca-inbox-poll.js.map +1 -0
- package/dist/scripts/judge-llm-batch.d.ts +98 -0
- package/dist/scripts/judge-llm-batch.d.ts.map +1 -0
- package/dist/scripts/judge-llm-batch.js +350 -0
- package/dist/scripts/judge-llm-batch.js.map +1 -0
- package/dist/scripts/llm-heal.d.ts +165 -0
- package/dist/scripts/llm-heal.d.ts.map +1 -0
- package/dist/scripts/llm-heal.js +595 -0
- package/dist/scripts/llm-heal.js.map +1 -0
- package/dist/scripts/migrate-telemetry-dir-names.d.ts +57 -0
- package/dist/scripts/migrate-telemetry-dir-names.d.ts.map +1 -0
- package/dist/scripts/migrate-telemetry-dir-names.js +156 -0
- package/dist/scripts/migrate-telemetry-dir-names.js.map +1 -0
- package/dist/scripts/probe-setinputfiles.d.ts +28 -0
- package/dist/scripts/probe-setinputfiles.d.ts.map +1 -0
- package/dist/scripts/probe-setinputfiles.js +95 -0
- package/dist/scripts/probe-setinputfiles.js.map +1 -0
- package/dist/scripts/recon-browser.d.ts +304 -0
- package/dist/scripts/recon-browser.d.ts.map +1 -0
- package/dist/scripts/recon-browser.js +1833 -0
- package/dist/scripts/recon-browser.js.map +1 -0
- package/dist/scripts/recon-generate.d.ts +182 -0
- package/dist/scripts/recon-generate.d.ts.map +1 -0
- package/dist/scripts/recon-generate.js +2572 -0
- package/dist/scripts/recon-generate.js.map +1 -0
- package/dist/scripts/recon-heal.d.ts +176 -0
- package/dist/scripts/recon-heal.d.ts.map +1 -0
- package/dist/scripts/recon-heal.js +584 -0
- package/dist/scripts/recon-heal.js.map +1 -0
- package/dist/scripts/recon-http.d.ts +19 -0
- package/dist/scripts/recon-http.d.ts.map +1 -0
- package/dist/scripts/recon-http.js +377 -0
- package/dist/scripts/recon-http.js.map +1 -0
- package/dist/scripts/recon-replay-jobs.d.ts +21 -0
- package/dist/scripts/recon-replay-jobs.d.ts.map +1 -0
- package/dist/scripts/recon-replay-jobs.js +221 -0
- package/dist/scripts/recon-replay-jobs.js.map +1 -0
- package/dist/scripts/recon-shared.d.ts +52 -0
- package/dist/scripts/recon-shared.d.ts.map +1 -0
- package/dist/scripts/recon-shared.js +68 -0
- package/dist/scripts/recon-shared.js.map +1 -0
- package/dist/scripts/recon-summarize.d.ts +15 -0
- package/dist/scripts/recon-summarize.d.ts.map +1 -0
- package/dist/scripts/recon-summarize.js +233 -0
- package/dist/scripts/recon-summarize.js.map +1 -0
- package/dist/scripts/smoke-test.d.ts +22 -0
- package/dist/scripts/smoke-test.d.ts.map +1 -0
- package/dist/scripts/smoke-test.js +236 -0
- package/dist/scripts/smoke-test.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +189 -0
- package/dist/server.js.map +1 -0
- package/dist/site-plugin.d.ts +226 -0
- package/dist/site-plugin.d.ts.map +1 -0
- package/dist/site-plugin.js +13 -0
- package/dist/site-plugin.js.map +1 -0
- package/dist/testing/answers-fixture.d.ts +13 -0
- package/dist/testing/answers-fixture.d.ts.map +1 -0
- package/dist/testing/answers-fixture.js +37 -0
- package/dist/testing/answers-fixture.js.map +1 -0
- package/dist/testing/batch-email-confirmation.d.ts +58 -0
- package/dist/testing/batch-email-confirmation.d.ts.map +1 -0
- package/dist/testing/batch-email-confirmation.js +62 -0
- package/dist/testing/batch-email-confirmation.js.map +1 -0
- package/dist/testing/batch-report.d.ts +33 -0
- package/dist/testing/batch-report.d.ts.map +1 -0
- package/dist/testing/batch-report.js +30 -0
- package/dist/testing/batch-report.js.map +1 -0
- package/dist/testing/contract-parity-suite.d.ts +55 -0
- package/dist/testing/contract-parity-suite.d.ts.map +1 -0
- package/dist/testing/contract-parity-suite.js +39 -0
- package/dist/testing/contract-parity-suite.js.map +1 -0
- package/dist/testing/coverage-guard-suite.d.ts +46 -0
- package/dist/testing/coverage-guard-suite.d.ts.map +1 -0
- package/dist/testing/coverage-guard-suite.js +39 -0
- package/dist/testing/coverage-guard-suite.js.map +1 -0
- package/dist/testing/fixtures/resume.pdf +54 -0
- package/dist/testing/integration-runner.d.ts +62 -0
- package/dist/testing/integration-runner.d.ts.map +1 -0
- package/dist/testing/integration-runner.js +46 -0
- package/dist/testing/integration-runner.js.map +1 -0
- package/dist/testing/mock-fetch-response.d.ts +7 -0
- package/dist/testing/mock-fetch-response.d.ts.map +1 -0
- package/dist/testing/mock-fetch-response.js +16 -0
- package/dist/testing/mock-fetch-response.js.map +1 -0
- package/dist/testing/persona-fixture.d.ts +77 -0
- package/dist/testing/persona-fixture.d.ts.map +1 -0
- package/dist/testing/persona-fixture.js +83 -0
- package/dist/testing/persona-fixture.js.map +1 -0
- package/dist/testing/replay-integration-suite.d.ts +50 -0
- package/dist/testing/replay-integration-suite.d.ts.map +1 -0
- package/dist/testing/replay-integration-suite.js +45 -0
- package/dist/testing/replay-integration-suite.js.map +1 -0
- package/dist/testing/resume-fixture.d.ts +39 -0
- package/dist/testing/resume-fixture.d.ts.map +1 -0
- package/dist/testing/resume-fixture.js +38 -0
- package/dist/testing/resume-fixture.js.map +1 -0
- package/dist/testmail/client.d.ts +61 -0
- package/dist/testmail/client.d.ts.map +1 -0
- package/dist/testmail/client.js +190 -0
- package/dist/testmail/client.js.map +1 -0
- package/dist/testmail/errors.d.ts +18 -0
- package/dist/testmail/errors.d.ts.map +1 -0
- package/dist/testmail/errors.js +29 -0
- package/dist/testmail/errors.js.map +1 -0
- package/dist/types/dispatch-metrics.d.ts +46 -0
- package/dist/types/dispatch-metrics.d.ts.map +1 -0
- package/dist/types/dispatch-metrics.js +25 -0
- package/dist/types/dispatch-metrics.js.map +1 -0
- package/dist/types/logging.d.ts +11 -0
- package/dist/types/logging.d.ts.map +1 -0
- package/dist/types/logging.js +3 -0
- package/dist/types/logging.js.map +1 -0
- package/package.json +283 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Modal-priority judge. Replaces the keyword regex
|
|
4
|
+
* `MODAL_PRIORITY_RX = /(modal|dialog|popup|overlay|drawer)/i` that
|
|
5
|
+
* matched Stagehand's English description strings.
|
|
6
|
+
*
|
|
7
|
+
* Why: the regex missed sheet, flyout, panel, sidebar, lightbox,
|
|
8
|
+
* cdk-overlay, radix-portal, app-prefixed variants, and any non-English
|
|
9
|
+
* description. When the regex missed, the rephrase prompt's UNFOCUSED
|
|
10
|
+
* OBSERVE section didn't bubble the blocking modal to the top — the
|
|
11
|
+
* LLM saw the form fields first and didn't realize a modal was in the
|
|
12
|
+
* way.
|
|
13
|
+
*
|
|
14
|
+
* The judge looks at the full unfocused-observe list and decides which
|
|
15
|
+
* entries are STRUCTURALLY blocking the form (modal with backdrop,
|
|
16
|
+
* dialog, overlay, popup) vs which are always-visible UI (sidebars,
|
|
17
|
+
* sticky headers, panels). Returns indices to bubble to the top.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.MODAL_PRIORITY_SYSTEM_PROMPT = void 0;
|
|
21
|
+
exports.judgeModalPriorityWithLLM = judgeModalPriorityWithLLM;
|
|
22
|
+
const judge_1 = require("../../../lib/llm/judge");
|
|
23
|
+
const schemas_1 = require("../../../lib/llm/schemas");
|
|
24
|
+
const call_types_1 = require("../../../lib/telemetry/call-types");
|
|
25
|
+
const MODAL_PRIORITY_SYSTEM_PROMPT = `You are a strict modal-priority judge for browser-automation. Given a list of UI elements observed on the page (with English descriptions), identify which ones are STRUCTURALLY blocking modal/dialog/overlay components that need to be dismissed before the underlying form can be interacted with.
|
|
26
|
+
|
|
27
|
+
Strict criteria for marking an index as priority:
|
|
28
|
+
- Cookie consent banners (block the page until accepted/dismissed) — PRIORITY.
|
|
29
|
+
- Welcome / sign-in modals with a dismiss action — PRIORITY.
|
|
30
|
+
- Floating sheet/flyout/dialog/popup/overlay UIs covering form content — PRIORITY.
|
|
31
|
+
- Lightbox image viewers — PRIORITY when they cover the form.
|
|
32
|
+
- Drawer components when they're modal (block underlying interaction) — PRIORITY.
|
|
33
|
+
|
|
34
|
+
Do NOT mark as priority:
|
|
35
|
+
- Sidebars and navigation panels that are always visible by design.
|
|
36
|
+
- Sticky headers / footers that don't block form interaction.
|
|
37
|
+
- Tooltips / popovers that auto-dismiss on click outside.
|
|
38
|
+
- Slide-out panels in responsive layouts when they're statically open.
|
|
39
|
+
|
|
40
|
+
The descriptions are English prose generated by Stagehand. Class names mentioned in the description (e.g. cdk-overlay, app-modal) are stronger evidence than keywords. Site-specific app-prefixed dialog/modal classes count as priority.
|
|
41
|
+
|
|
42
|
+
Return the indices (0-based) of priority items in the order they appear in the input. Max 50 items. Include a one-sentence rationale citing the strongest signal.`;
|
|
43
|
+
exports.MODAL_PRIORITY_SYSTEM_PROMPT = MODAL_PRIORITY_SYSTEM_PROMPT;
|
|
44
|
+
function buildModalPriorityPrompt(input) {
|
|
45
|
+
const list = input.observations
|
|
46
|
+
.map((o, i) => ` ${i}. ${o.description} — ${o.selector}`)
|
|
47
|
+
.join("\n");
|
|
48
|
+
return `Which observed elements are structurally blocking modal/dialog/overlay components?
|
|
49
|
+
|
|
50
|
+
OBSERVATIONS (index. description — selector):
|
|
51
|
+
${list}`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Run the modal-priority judge. Returns priority indices + a rationale.
|
|
55
|
+
* Returns null when the client is null (Bedrock-only) or the API call
|
|
56
|
+
* fails — callers fall back to leaving the original order untouched.
|
|
57
|
+
*/
|
|
58
|
+
async function judgeModalPriorityWithLLM(params) {
|
|
59
|
+
const { client, input, captureFn } = params;
|
|
60
|
+
if (client === null)
|
|
61
|
+
return null;
|
|
62
|
+
if (input.observations.length === 0)
|
|
63
|
+
return null;
|
|
64
|
+
const result = await (0, judge_1.callHaikuJudge)({
|
|
65
|
+
client,
|
|
66
|
+
systemPrompt: MODAL_PRIORITY_SYSTEM_PROMPT,
|
|
67
|
+
userPrompt: buildModalPriorityPrompt(input),
|
|
68
|
+
schema: schemas_1.MODAL_PRIORITY_SCHEMA,
|
|
69
|
+
callType: call_types_1.CALL_TYPE_JUDGE_MODAL_PRIORITY,
|
|
70
|
+
captureFn,
|
|
71
|
+
});
|
|
72
|
+
return result?.parsed ?? null;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=modal-priority.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-priority.js","sourceRoot":"","sources":["../../../../src/lib/llm/judges/modal-priority.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAgDH,8DAiBC;AA5DD,2CAAsE;AACtE,+CAA0D;AAC1D,2DAA4E;AAE5E,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;kKAiB6H,CAAC;AAyC1J,oEAA4B;AAlCrC,SAAS,wBAAwB,CAAC,KAA8B;IAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;SACzD,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO;;;EAGP,IAAI,EAAE,CAAC;AACT,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,yBAAyB,CAAC,MAI/C;IACC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC5C,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC;QAClC,MAAM;QACN,YAAY,EAAE,4BAA4B;QAC1C,UAAU,EAAE,wBAAwB,CAAC,KAAK,CAAC;QAC3C,MAAM,EAAE,+BAAqB;QAC7B,QAAQ,EAAE,2CAA8B;QACxC,SAAS;KACV,CAAC,CAAC;IACH,OAAO,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select-option picker judge. When a recon flow step hardcodes a dropdown
|
|
3
|
+
* answer (e.g. "select 'Emergency Department'") but that exact option does
|
|
4
|
+
* not exist in a given requisition's option list — different jobs render
|
|
5
|
+
* different screening-question options — this judge chooses the most
|
|
6
|
+
* plausible AVAILABLE option so the required question is answered and the
|
|
7
|
+
* multi-page wizard can advance.
|
|
8
|
+
*
|
|
9
|
+
* Why an LLM (not fuzzy string match): the gap is semantic, not lexical. An
|
|
10
|
+
* "Emergency Department" hint on a Cardiac requisition has near-zero string
|
|
11
|
+
* overlap with the real options (CVICU, Progressive Care, …) yet a human
|
|
12
|
+
* would pick the closest clinically-plausible one. Deterministic overlap
|
|
13
|
+
* would pick nothing or the wrong option. This is the "LLM-chosen, correct
|
|
14
|
+
* real submission" policy the answers land in the ATS under.
|
|
15
|
+
*/
|
|
16
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
17
|
+
import type { z } from "zod/v4";
|
|
18
|
+
import { type JudgeCaptureFn } from "../../../lib/llm/judge";
|
|
19
|
+
import { SELECT_OPTION_SCHEMA } from "../../../lib/llm/schemas";
|
|
20
|
+
declare const SELECT_OPTION_SYSTEM_PROMPT = "You are a job applicant answering a required screening dropdown on an application form. You are given a QUESTION, a HINT at the intended answer (from a generic template that may not match this specific job), and SEVERAL candidate dropdowns on the page \u2014 each with its own list of options. Exactly one dropdown (or none) is the one that answers the question.\n\nDo two things:\n1. Pick the dropdown (selectIndex) whose options actually answer the QUESTION. E.g. a nursing-education question is answered by a dropdown whose options are education levels, NOT one whose options are disability choices or countries. If NO dropdown's options fit the question, return selectIndex=null.\n2. Within that dropdown, pick the option (optionIndex) that is the most plausible, truthful answer letting a qualified candidate proceed:\n - Prefer the option semantically closest to the hint (e.g. hint \"Emergency Department\" on a cardiac role \u2192 the closest clinical specialty available).\n - For EEO / self-identification / voluntary demographic questions (race, gender, disability, veteran status), prefer a decline option (\"I do not wish to answer\", \"Prefer not to answer\", \"Decline to self-identify\").\n - For yes/no eligibility questions, choose the answer that keeps a qualified candidate eligible (usually the hint).\n - NEVER choose a disabled placeholder (\"Please select\u2026\", \"-- Select --\", empty first entry).\n\nReturn selectIndex = the 0-based index into the candidate dropdowns (or null if none fit), optionIndex = the 0-based index into THAT dropdown's options (null if selectIndex is null). Always give a one-line reason.";
|
|
21
|
+
export interface JudgeSelectOptionCandidate {
|
|
22
|
+
/** The dropdown's nearby/associated label text, when discoverable. */
|
|
23
|
+
label: string | null;
|
|
24
|
+
/** The dropdown's real option texts, in DOM order (index-aligned). */
|
|
25
|
+
options: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
export interface JudgeSelectOptionInput {
|
|
28
|
+
/** The question being answered (from the flow step). */
|
|
29
|
+
questionLabel: string | null;
|
|
30
|
+
/** The flow's intended answer text (may not exist in any dropdown). */
|
|
31
|
+
desiredHint: string;
|
|
32
|
+
/** Candidate dropdowns on the page (unfilled ones), index-aligned. */
|
|
33
|
+
candidates: readonly JudgeSelectOptionCandidate[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Run the select-option picker. Returns the parsed verdict — which candidate
|
|
37
|
+
* dropdown (selectIndex) answers the question and which option in it
|
|
38
|
+
* (optionIndex), or both null when no dropdown fits. Returns null when the
|
|
39
|
+
* client is null (Bedrock-only) or the API call fails — the caller then falls
|
|
40
|
+
* through to the cascade instead of applying a guess. Both indices are bounds-
|
|
41
|
+
* checked against the supplied candidates before returning.
|
|
42
|
+
*/
|
|
43
|
+
export declare function judgeSelectOptionWithLLM(params: {
|
|
44
|
+
client: Anthropic | null;
|
|
45
|
+
input: JudgeSelectOptionInput;
|
|
46
|
+
captureFn?: JudgeCaptureFn;
|
|
47
|
+
}): Promise<z.infer<typeof SELECT_OPTION_SCHEMA> | null>;
|
|
48
|
+
export { SELECT_OPTION_SYSTEM_PROMPT };
|
|
49
|
+
//# sourceMappingURL=select-option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-option.d.ts","sourceRoot":"","sources":["../../../../src/lib/llm/judges/select-option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,QAAA,MAAM,2BAA2B,wnDAUqL,CAAC;AAEvN,MAAM,WAAW,0BAA0B;IACzC,sEAAsE;IACtE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,sEAAsE;IACtE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,UAAU,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACnD;AAiBD;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE;IACrD,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAAG,IAAI,CAAC,CA+BvD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Select-option picker judge. When a recon flow step hardcodes a dropdown
|
|
4
|
+
* answer (e.g. "select 'Emergency Department'") but that exact option does
|
|
5
|
+
* not exist in a given requisition's option list — different jobs render
|
|
6
|
+
* different screening-question options — this judge chooses the most
|
|
7
|
+
* plausible AVAILABLE option so the required question is answered and the
|
|
8
|
+
* multi-page wizard can advance.
|
|
9
|
+
*
|
|
10
|
+
* Why an LLM (not fuzzy string match): the gap is semantic, not lexical. An
|
|
11
|
+
* "Emergency Department" hint on a Cardiac requisition has near-zero string
|
|
12
|
+
* overlap with the real options (CVICU, Progressive Care, …) yet a human
|
|
13
|
+
* would pick the closest clinically-plausible one. Deterministic overlap
|
|
14
|
+
* would pick nothing or the wrong option. This is the "LLM-chosen, correct
|
|
15
|
+
* real submission" policy the answers land in the ATS under.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.SELECT_OPTION_SYSTEM_PROMPT = void 0;
|
|
19
|
+
exports.judgeSelectOptionWithLLM = judgeSelectOptionWithLLM;
|
|
20
|
+
const judge_1 = require("../../../lib/llm/judge");
|
|
21
|
+
const schemas_1 = require("../../../lib/llm/schemas");
|
|
22
|
+
const call_types_1 = require("../../../lib/telemetry/call-types");
|
|
23
|
+
const SELECT_OPTION_SYSTEM_PROMPT = `You are a job applicant answering a required screening dropdown on an application form. You are given a QUESTION, a HINT at the intended answer (from a generic template that may not match this specific job), and SEVERAL candidate dropdowns on the page — each with its own list of options. Exactly one dropdown (or none) is the one that answers the question.
|
|
24
|
+
|
|
25
|
+
Do two things:
|
|
26
|
+
1. Pick the dropdown (selectIndex) whose options actually answer the QUESTION. E.g. a nursing-education question is answered by a dropdown whose options are education levels, NOT one whose options are disability choices or countries. If NO dropdown's options fit the question, return selectIndex=null.
|
|
27
|
+
2. Within that dropdown, pick the option (optionIndex) that is the most plausible, truthful answer letting a qualified candidate proceed:
|
|
28
|
+
- Prefer the option semantically closest to the hint (e.g. hint "Emergency Department" on a cardiac role → the closest clinical specialty available).
|
|
29
|
+
- For EEO / self-identification / voluntary demographic questions (race, gender, disability, veteran status), prefer a decline option ("I do not wish to answer", "Prefer not to answer", "Decline to self-identify").
|
|
30
|
+
- For yes/no eligibility questions, choose the answer that keeps a qualified candidate eligible (usually the hint).
|
|
31
|
+
- NEVER choose a disabled placeholder ("Please select…", "-- Select --", empty first entry).
|
|
32
|
+
|
|
33
|
+
Return selectIndex = the 0-based index into the candidate dropdowns (or null if none fit), optionIndex = the 0-based index into THAT dropdown's options (null if selectIndex is null). Always give a one-line reason.`;
|
|
34
|
+
exports.SELECT_OPTION_SYSTEM_PROMPT = SELECT_OPTION_SYSTEM_PROMPT;
|
|
35
|
+
function buildSelectOptionPrompt(input) {
|
|
36
|
+
const blocks = input.candidates
|
|
37
|
+
.map((c, si) => {
|
|
38
|
+
const opts = c.options.map((o, oi) => ` ${oi}. ${o}`).join("\n");
|
|
39
|
+
return `DROPDOWN ${si}${c.label ? ` (label: ${c.label})` : ""}:\n${opts}`;
|
|
40
|
+
})
|
|
41
|
+
.join("\n\n");
|
|
42
|
+
return `QUESTION: ${input.questionLabel ?? "(no label discoverable)"}
|
|
43
|
+
|
|
44
|
+
INTENDED ANSWER (hint, may not match): ${input.desiredHint}
|
|
45
|
+
|
|
46
|
+
CANDIDATE DROPDOWNS (pick the one that answers the question, then an option in it):
|
|
47
|
+
${blocks}`;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run the select-option picker. Returns the parsed verdict — which candidate
|
|
51
|
+
* dropdown (selectIndex) answers the question and which option in it
|
|
52
|
+
* (optionIndex), or both null when no dropdown fits. Returns null when the
|
|
53
|
+
* client is null (Bedrock-only) or the API call fails — the caller then falls
|
|
54
|
+
* through to the cascade instead of applying a guess. Both indices are bounds-
|
|
55
|
+
* checked against the supplied candidates before returning.
|
|
56
|
+
*/
|
|
57
|
+
async function judgeSelectOptionWithLLM(params) {
|
|
58
|
+
const { client, input, captureFn } = params;
|
|
59
|
+
if (client === null)
|
|
60
|
+
return null;
|
|
61
|
+
if (input.candidates.length === 0)
|
|
62
|
+
return null;
|
|
63
|
+
const result = await (0, judge_1.callHaikuJudge)({
|
|
64
|
+
client,
|
|
65
|
+
systemPrompt: SELECT_OPTION_SYSTEM_PROMPT,
|
|
66
|
+
userPrompt: buildSelectOptionPrompt(input),
|
|
67
|
+
schema: schemas_1.SELECT_OPTION_SCHEMA,
|
|
68
|
+
callType: call_types_1.CALL_TYPE_JUDGE_SELECT_OPTION,
|
|
69
|
+
captureFn,
|
|
70
|
+
});
|
|
71
|
+
const parsed = result?.parsed ?? null;
|
|
72
|
+
if (!parsed || parsed.selectIndex === null)
|
|
73
|
+
return parsed;
|
|
74
|
+
// Guard both indices against the supplied candidates — a hallucinated
|
|
75
|
+
// out-of-range index must not index past the arrays in the caller.
|
|
76
|
+
const nullVerdict = (reason) => ({
|
|
77
|
+
selectIndex: null,
|
|
78
|
+
optionIndex: null,
|
|
79
|
+
reason,
|
|
80
|
+
});
|
|
81
|
+
const chosenCandidate = input.candidates[parsed.selectIndex];
|
|
82
|
+
if (!chosenCandidate) {
|
|
83
|
+
return nullVerdict(`LLM selectIndex ${parsed.selectIndex} out of range`);
|
|
84
|
+
}
|
|
85
|
+
if (parsed.optionIndex === null || parsed.optionIndex >= chosenCandidate.options.length) {
|
|
86
|
+
return nullVerdict(`LLM optionIndex ${parsed.optionIndex} out of range for dropdown ${parsed.selectIndex}`);
|
|
87
|
+
}
|
|
88
|
+
return parsed;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=select-option.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-option.js","sourceRoot":"","sources":["../../../../src/lib/llm/judges/select-option.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA4DH,4DAmCC;AA1FD,2CAAsE;AACtE,+CAAyD;AACzD,2DAA2E;AAE3E,MAAM,2BAA2B,GAAG;;;;;;;;;;sNAUkL,CAAC;AA8E9M,kEAA2B;AA5DpC,SAAS,uBAAuB,CAAC,KAA6B;IAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QACb,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpE,OAAO,YAAY,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,EAAE,CAAC;IAC5E,CAAC,CAAC;SACD,IAAI,CAAC,MAAM,CAAC,CAAC;IAChB,OAAO,aAAa,KAAK,CAAC,aAAa,IAAI,yBAAyB;;yCAE7B,KAAK,CAAC,WAAW;;;EAGxD,MAAM,EAAE,CAAC;AACX,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,wBAAwB,CAAC,MAI9C;IACC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC5C,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC;QAClC,MAAM;QACN,YAAY,EAAE,2BAA2B;QACzC,UAAU,EAAE,uBAAuB,CAAC,KAAK,CAAC;QAC1C,MAAM,EAAE,8BAAoB;QAC5B,QAAQ,EAAE,0CAA6B;QACvC,SAAS;KACV,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC;IACtC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAC1D,sEAAsE;IACtE,mEAAmE;IACnE,MAAM,WAAW,GAAG,CAAC,MAAc,EAAwC,EAAE,CAAC,CAAC;QAC7E,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;QACjB,MAAM;KACP,CAAC,CAAC;IACH,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7D,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,WAAW,CAAC,mBAAmB,MAAM,CAAC,WAAW,eAAe,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,IAAI,MAAM,CAAC,WAAW,IAAI,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACxF,OAAO,WAAW,CAChB,mBAAmB,MAAM,CAAC,WAAW,8BAA8B,MAAM,CAAC,WAAW,EAAE,CACxF,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Submit-verification judge. Replaces the per-site `submitEndpointPattern`
|
|
3
|
+
* regex with a Haiku 4.5 structured-output call that judges success across
|
|
4
|
+
* multiple corroborating signals (network 2xx + DOM success component + URL
|
|
5
|
+
* transition + page title).
|
|
6
|
+
*
|
|
7
|
+
* Empirically validated 2026-06-11 on two production failure cases:
|
|
8
|
+
* - Case A (was wrongly flagged as failure by the regex): verdict=true,
|
|
9
|
+
* correctly identified dom_signal="uapp-universal-submitted-page" and
|
|
10
|
+
* url_signal="/applyboard/applied".
|
|
11
|
+
* - Case B (genuinely stuck, 10 ng-invalid markers, no success DOM):
|
|
12
|
+
* verdict=false with a coherent reason about why submission failed.
|
|
13
|
+
*
|
|
14
|
+
* Strictness rule baked into the system prompt: verified=true requires at
|
|
15
|
+
* least one DOM/URL/title signal of post-submit state. A 2xx alone is NOT
|
|
16
|
+
* sufficient (could be telemetry). The judge defaults to verified=false
|
|
17
|
+
* when signals are ambiguous — strong evidence, not lax permission.
|
|
18
|
+
*/
|
|
19
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
20
|
+
import type { z } from "zod/v4";
|
|
21
|
+
import { type JudgeCaptureFn } from "../../../lib/llm/judge";
|
|
22
|
+
import { SUBMIT_VERDICT_SCHEMA } from "../../../lib/llm/schemas";
|
|
23
|
+
/**
|
|
24
|
+
* System prompt for the submit-verifier. The strictness rules are
|
|
25
|
+
* intentionally explicit and multi-signal — the empirical replay confirmed
|
|
26
|
+
* Haiku follows them honestly on both true-success and genuine-failure cases.
|
|
27
|
+
*/
|
|
28
|
+
declare const SUBMIT_VERIFY_SYSTEM_PROMPT = "You are a strict submit-verifier for browser-automated job applications. Given evidence about what happened after a Submit click, decide whether the submission actually succeeded.\n\nStrictness rule for verified=true:\n- You need at least ONE strong DOM/URL/title signal: a post-submit success component is visible in the page DOM (matching one of submitted-state selectors or a generic post-submit marker like *-submitted-page, *-thank-you, *-confirmation), OR the page title contains a confirmation phrase (\"Thank you\", \"Application submitted\", \"Submitted\", \"Confirmation\"), OR the URL transitioned to a success path (any of the success URL fragments supplied, or generic patterns like \"/applied\", \"/submitted\", \"/confirmation\", \"/thank-you\").\n- A 2xx POST/PUT/DELETE to the site's own backend (matching one of the supplied ownBackendHostnames) STRENGTHENS the case but is not required on its own \u2014 sometimes the network capture window misses the submit POST because the SPA navigates faster than the recorder.\n- A 2xx network request alone, with NO DOM/URL/title indication of success, is INSUFFICIENT. Could be telemetry. Set verified=false in that case.\n- If only error indicators are present (4xx, 5xx, error containers, the form is still visible with invalid markers), set verified=false with a reason.\n- When ambiguous, set verified=false with a reason. Be strict, not lax \u2014 false positives here mean the engine thinks a submit succeeded when it didn't, and the candidate's application is lost.\n\nWhen verified=true, populate the three signal fields with what you found (any can be null if absent), and write a one-sentence rationale citing the strongest signal.\nWhen verified=false, write a one-sentence reason citing what you'd need to see to be convinced.";
|
|
29
|
+
/**
|
|
30
|
+
* Site-supplied evidence and criteria for the submit-verifier. The engine
|
|
31
|
+
* is fully site-agnostic; this object is built from the parsed flow file
|
|
32
|
+
* and the in-flight cascade state.
|
|
33
|
+
*/
|
|
34
|
+
export interface VerifySubmitInput {
|
|
35
|
+
pageUrl: string;
|
|
36
|
+
pageTitle: string;
|
|
37
|
+
unfocusedObserve: {
|
|
38
|
+
description: string;
|
|
39
|
+
selector: string;
|
|
40
|
+
}[];
|
|
41
|
+
networkCaptures: {
|
|
42
|
+
method: string;
|
|
43
|
+
status: number;
|
|
44
|
+
url: string;
|
|
45
|
+
}[];
|
|
46
|
+
invalidMarkerCount: number;
|
|
47
|
+
/** Per-site: hostnames that count as "the site's own backend." */
|
|
48
|
+
ownBackendHostnames: string[];
|
|
49
|
+
/** Per-site: URL fragments that indicate a successful submit. */
|
|
50
|
+
successUrlFragments: string[];
|
|
51
|
+
/** Per-site: page-title substrings that indicate a successful submit. */
|
|
52
|
+
successPageTitleHints: string[];
|
|
53
|
+
/** Per-site: DOM selectors that indicate the success page is rendered. */
|
|
54
|
+
submittedStateSelectors: string[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Run the Haiku submit-verifier. Returns the parsed verdict (discriminated
|
|
58
|
+
* union — `verified: true | false`). Returns null when the client is null
|
|
59
|
+
* (Bedrock-only deployment, no Anthropic SDK) or when the API call fails —
|
|
60
|
+
* callers fall back to the conservative "verified=false" default.
|
|
61
|
+
*/
|
|
62
|
+
export declare function verifySubmitWithLLM(params: {
|
|
63
|
+
client: Anthropic | null;
|
|
64
|
+
input: VerifySubmitInput;
|
|
65
|
+
captureFn?: JudgeCaptureFn;
|
|
66
|
+
}): Promise<z.infer<typeof SUBMIT_VERDICT_SCHEMA> | null>;
|
|
67
|
+
export { SUBMIT_VERIFY_SYSTEM_PROMPT };
|
|
68
|
+
//# sourceMappingURL=verify-submit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-submit.d.ts","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-submit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D;;;;GAIG;AACH,QAAA,MAAM,2BAA2B,2wDAU+D,CAAC;AAEjG;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9D,eAAe,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,iEAAiE;IACjE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,yEAAyE;IACzE,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,0EAA0E;IAC1E,uBAAuB,EAAE,MAAM,EAAE,CAAC;CACnC;AA+BD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,iBAAiB,CAAC;IACzB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,GAAG,IAAI,CAAC,CAYxD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Submit-verification judge. Replaces the per-site `submitEndpointPattern`
|
|
4
|
+
* regex with a Haiku 4.5 structured-output call that judges success across
|
|
5
|
+
* multiple corroborating signals (network 2xx + DOM success component + URL
|
|
6
|
+
* transition + page title).
|
|
7
|
+
*
|
|
8
|
+
* Empirically validated 2026-06-11 on two production failure cases:
|
|
9
|
+
* - Case A (was wrongly flagged as failure by the regex): verdict=true,
|
|
10
|
+
* correctly identified dom_signal="uapp-universal-submitted-page" and
|
|
11
|
+
* url_signal="/applyboard/applied".
|
|
12
|
+
* - Case B (genuinely stuck, 10 ng-invalid markers, no success DOM):
|
|
13
|
+
* verdict=false with a coherent reason about why submission failed.
|
|
14
|
+
*
|
|
15
|
+
* Strictness rule baked into the system prompt: verified=true requires at
|
|
16
|
+
* least one DOM/URL/title signal of post-submit state. A 2xx alone is NOT
|
|
17
|
+
* sufficient (could be telemetry). The judge defaults to verified=false
|
|
18
|
+
* when signals are ambiguous — strong evidence, not lax permission.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.SUBMIT_VERIFY_SYSTEM_PROMPT = void 0;
|
|
22
|
+
exports.verifySubmitWithLLM = verifySubmitWithLLM;
|
|
23
|
+
const judge_1 = require("../../../lib/llm/judge");
|
|
24
|
+
const schemas_1 = require("../../../lib/llm/schemas");
|
|
25
|
+
const call_types_1 = require("../../../lib/telemetry/call-types");
|
|
26
|
+
/**
|
|
27
|
+
* System prompt for the submit-verifier. The strictness rules are
|
|
28
|
+
* intentionally explicit and multi-signal — the empirical replay confirmed
|
|
29
|
+
* Haiku follows them honestly on both true-success and genuine-failure cases.
|
|
30
|
+
*/
|
|
31
|
+
const SUBMIT_VERIFY_SYSTEM_PROMPT = `You are a strict submit-verifier for browser-automated job applications. Given evidence about what happened after a Submit click, decide whether the submission actually succeeded.
|
|
32
|
+
|
|
33
|
+
Strictness rule for verified=true:
|
|
34
|
+
- You need at least ONE strong DOM/URL/title signal: a post-submit success component is visible in the page DOM (matching one of submitted-state selectors or a generic post-submit marker like *-submitted-page, *-thank-you, *-confirmation), OR the page title contains a confirmation phrase ("Thank you", "Application submitted", "Submitted", "Confirmation"), OR the URL transitioned to a success path (any of the success URL fragments supplied, or generic patterns like "/applied", "/submitted", "/confirmation", "/thank-you").
|
|
35
|
+
- A 2xx POST/PUT/DELETE to the site's own backend (matching one of the supplied ownBackendHostnames) STRENGTHENS the case but is not required on its own — sometimes the network capture window misses the submit POST because the SPA navigates faster than the recorder.
|
|
36
|
+
- A 2xx network request alone, with NO DOM/URL/title indication of success, is INSUFFICIENT. Could be telemetry. Set verified=false in that case.
|
|
37
|
+
- If only error indicators are present (4xx, 5xx, error containers, the form is still visible with invalid markers), set verified=false with a reason.
|
|
38
|
+
- When ambiguous, set verified=false with a reason. Be strict, not lax — false positives here mean the engine thinks a submit succeeded when it didn't, and the candidate's application is lost.
|
|
39
|
+
|
|
40
|
+
When verified=true, populate the three signal fields with what you found (any can be null if absent), and write a one-sentence rationale citing the strongest signal.
|
|
41
|
+
When verified=false, write a one-sentence reason citing what you'd need to see to be convinced.`;
|
|
42
|
+
exports.SUBMIT_VERIFY_SYSTEM_PROMPT = SUBMIT_VERIFY_SYSTEM_PROMPT;
|
|
43
|
+
/**
|
|
44
|
+
* Render the evidence into a user prompt for Haiku. The structure mirrors
|
|
45
|
+
* the empirical-replay prototype that proved this works on production cases.
|
|
46
|
+
*/
|
|
47
|
+
function buildVerifySubmitPrompt(input) {
|
|
48
|
+
return `Did the submit succeed?
|
|
49
|
+
|
|
50
|
+
PAGE URL: ${input.pageUrl}
|
|
51
|
+
PAGE TITLE: ${input.pageTitle}
|
|
52
|
+
|
|
53
|
+
NETWORK REQUESTS IN ATTEMPT WINDOW (method, status, url):
|
|
54
|
+
${input.networkCaptures.length > 0
|
|
55
|
+
? input.networkCaptures.map((c) => ` ${c.method} ${c.status} ${c.url}`).join("\n")
|
|
56
|
+
: " (none)"}
|
|
57
|
+
|
|
58
|
+
UNFOCUSED OBSERVE (xpaths the agent can see on the page right now):
|
|
59
|
+
${input.unfocusedObserve.map((o, i) => ` ${i + 1}. ${o.description} — ${o.selector}`).join("\n")}
|
|
60
|
+
|
|
61
|
+
DOM INVALID-MARKER COUNT: ${input.invalidMarkerCount} (form fields still showing structural error/invalid state)
|
|
62
|
+
|
|
63
|
+
SITE CRITERIA:
|
|
64
|
+
- Own-backend hostnames: ${JSON.stringify(input.ownBackendHostnames)}
|
|
65
|
+
- Success URL fragments: ${JSON.stringify(input.successUrlFragments)}
|
|
66
|
+
- Success page title hints: ${JSON.stringify(input.successPageTitleHints)}
|
|
67
|
+
- Submitted-state selectors (DOM components that indicate post-submit state): ${JSON.stringify(input.submittedStateSelectors)}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Run the Haiku submit-verifier. Returns the parsed verdict (discriminated
|
|
71
|
+
* union — `verified: true | false`). Returns null when the client is null
|
|
72
|
+
* (Bedrock-only deployment, no Anthropic SDK) or when the API call fails —
|
|
73
|
+
* callers fall back to the conservative "verified=false" default.
|
|
74
|
+
*/
|
|
75
|
+
async function verifySubmitWithLLM(params) {
|
|
76
|
+
const { client, input, captureFn } = params;
|
|
77
|
+
if (client === null)
|
|
78
|
+
return null;
|
|
79
|
+
const result = await (0, judge_1.callHaikuJudge)({
|
|
80
|
+
client,
|
|
81
|
+
systemPrompt: SUBMIT_VERIFY_SYSTEM_PROMPT,
|
|
82
|
+
userPrompt: buildVerifySubmitPrompt(input),
|
|
83
|
+
schema: schemas_1.SUBMIT_VERDICT_SCHEMA,
|
|
84
|
+
callType: call_types_1.CALL_TYPE_JUDGE_SUBMIT_VERIFY,
|
|
85
|
+
captureFn,
|
|
86
|
+
});
|
|
87
|
+
return result?.parsed ?? null;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=verify-submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-submit.js","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-submit.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAkFH,kDAgBC;AA7FD,2CAAsE;AACtE,+CAA0D;AAC1D,2DAA2E;AAE3E;;;;GAIG;AACH,MAAM,2BAA2B,GAAG;;;;;;;;;;gGAU4D,CAAC;AA4ExF,kEAA2B;AArDpC;;;GAGG;AACH,SAAS,uBAAuB,CAAC,KAAwB;IACvD,OAAO;;YAEG,KAAK,CAAC,OAAO;cACX,KAAK,CAAC,SAAS;;;EAI3B,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;QAC9B,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACnF,CAAC,CAAC,UACN;;;EAGE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;4BAErE,KAAK,CAAC,kBAAkB;;;2BAGzB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC;2BACzC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC;8BACtC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,qBAAqB,CAAC;gFACO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC;AAChI,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB,CAAC,MAIzC;IACC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC5C,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC;QAClC,MAAM;QACN,YAAY,EAAE,2BAA2B;QACzC,UAAU,EAAE,uBAAuB,CAAC,KAAK,CAAC;QAC1C,MAAM,EAAE,+BAAqB;QAC7B,QAAQ,EAAE,0CAA6B;QACvC,SAAS;KACV,CAAC,CAAC;IACH,OAAO,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for every Anthropic LLM call site's structured output. Every
|
|
3
|
+
* call in the engine goes through `client.messages.parse` + `zodOutputFormat`
|
|
4
|
+
* (or equivalent) so the SDK throws on schema violation rather than handing
|
|
5
|
+
* back malformed text the caller has to defensively parse. Co-locating the
|
|
6
|
+
* schemas here keeps the contracts visible in one file instead of buried
|
|
7
|
+
* inside ~4500-line scripts.
|
|
8
|
+
*
|
|
9
|
+
* Naming: each schema corresponds 1:1 to a `CALL_TYPE_*` constant in
|
|
10
|
+
* `src/lib/telemetry/call-types.ts`.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod/v4";
|
|
13
|
+
/**
|
|
14
|
+
* Cap on per-replan step list size. Anything beyond this is almost certainly
|
|
15
|
+
* the LLM hallucinating an entire flow from scratch instead of writing the
|
|
16
|
+
* minimum bridge needed to unstick the cascade. Matches the existing pre-move
|
|
17
|
+
* constant value so call-site behavior is identical.
|
|
18
|
+
*/
|
|
19
|
+
export declare const REPLAN_MAX_STEPS = 30;
|
|
20
|
+
/**
|
|
21
|
+
* Flow step shape consumed by every recon-flow consumer (file parsing,
|
|
22
|
+
* replanner output, normalizer). A bare string is a required step; the
|
|
23
|
+
* object form supports `optional` and `upload` flags.
|
|
24
|
+
*
|
|
25
|
+
* Moved here from recon-browser.ts so REPLAN_RESPONSE_SCHEMA can be defined
|
|
26
|
+
* alongside it without recon-browser.ts having to re-export both.
|
|
27
|
+
*/
|
|
28
|
+
export declare const RECON_FLOW_STEP_SCHEMA: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
29
|
+
step: z.ZodString;
|
|
30
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
+
upload: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
+
submitStep: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
payloadField: z.ZodOptional<z.ZodString>;
|
|
34
|
+
payloadFieldNone: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$strip>]>;
|
|
36
|
+
/**
|
|
37
|
+
* Replanner response. Discriminated union on `outcome`. When the cascade has
|
|
38
|
+
* exhausted all per-step healing attempts, the replanner either proposes a
|
|
39
|
+
* bridge sequence (`replan` outcome) or admits the page state is
|
|
40
|
+
* unrecoverable (`impossible`). The single-action constraint on each step is
|
|
41
|
+
* enforced by the caller's normalizer, not the schema (the LLM emits
|
|
42
|
+
* arbitrary text inside `step`; we trust the caller's downstream parse).
|
|
43
|
+
*/
|
|
44
|
+
export declare const REPLAN_RESPONSE_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
outcome: z.ZodLiteral<"replan">;
|
|
46
|
+
steps: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
47
|
+
step: z.ZodString;
|
|
48
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
upload: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
submitStep: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
+
payloadField: z.ZodOptional<z.ZodString>;
|
|
52
|
+
payloadFieldNone: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
}, z.core.$strip>]>>;
|
|
54
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
outcome: z.ZodLiteral<"impossible">;
|
|
56
|
+
reason: z.ZodString;
|
|
57
|
+
}, z.core.$strip>]>;
|
|
58
|
+
/**
|
|
59
|
+
* Rephrase response. Discriminated union on `outcome`. The pre-schema
|
|
60
|
+
* contract was free text plus the magic string "IMPOSSIBLE" — fragile and
|
|
61
|
+
* easy for the LLM to emit prose around. The schema makes the contract
|
|
62
|
+
* explicit and parses on the API side.
|
|
63
|
+
*/
|
|
64
|
+
export declare const REPHRASE_RESPONSE_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
65
|
+
outcome: z.ZodLiteral<"rewrite">;
|
|
66
|
+
instruction: z.ZodString;
|
|
67
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
+
outcome: z.ZodLiteral<"impossible">;
|
|
69
|
+
reason: z.ZodString;
|
|
70
|
+
}, z.core.$strip>]>;
|
|
71
|
+
/**
|
|
72
|
+
* Patch generator response shape. Shared between `recon-flow-patch` and
|
|
73
|
+
* `llm-prompt-patch` — both follow the same anchor/replacement/strategy
|
|
74
|
+
* minimal-change discipline. The contract was identical at the prose level
|
|
75
|
+
* before this schema; making it shared explicit Zod cleans up two parallel
|
|
76
|
+
* `JSON.parse` ladders.
|
|
77
|
+
*
|
|
78
|
+
* Cross-field validation (anchor must exist in the artifact being patched)
|
|
79
|
+
* stays at the caller because the artifact isn't known to the schema.
|
|
80
|
+
*/
|
|
81
|
+
export declare const PATCH_RESPONSE_SCHEMA: z.ZodObject<{
|
|
82
|
+
anchor: z.ZodString;
|
|
83
|
+
replacement: z.ZodString;
|
|
84
|
+
strategy: z.ZodString;
|
|
85
|
+
pivot_reason: z.ZodNullable<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
/**
|
|
88
|
+
* Judge verdict shape. The existing judge prompt already specifies this
|
|
89
|
+
* structure in prose; moving it to a Zod schema makes the contract enforced
|
|
90
|
+
* by the SDK and removes the manual try/catch JSON-parse ladder.
|
|
91
|
+
*/
|
|
92
|
+
export declare const JUDGE_VERDICT_SCHEMA: z.ZodObject<{
|
|
93
|
+
schemaOk: z.ZodBoolean;
|
|
94
|
+
schemaRationale: z.ZodString;
|
|
95
|
+
factuallyGrounded: z.ZodBoolean;
|
|
96
|
+
factualRationale: z.ZodString;
|
|
97
|
+
hallucinationFree: z.ZodBoolean;
|
|
98
|
+
hallucinationRationale: z.ZodString;
|
|
99
|
+
worstOffender: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
100
|
+
schema: "schema";
|
|
101
|
+
factual: "factual";
|
|
102
|
+
hallucination: "hallucination";
|
|
103
|
+
}>>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
/**
|
|
106
|
+
* Submit-verification verdict. Replaces the per-site `submitEndpointPattern`
|
|
107
|
+
* regex. Discriminated union forces the LLM to commit to verified=true|false
|
|
108
|
+
* — no in-between "maybe" state.
|
|
109
|
+
*
|
|
110
|
+
* The verified=true branch requires populating three signal fields (any can
|
|
111
|
+
* be null but at least one of dom_signal / url_signal SHOULD be non-null per
|
|
112
|
+
* the strict system prompt). The verifier's `rationale` must cite the
|
|
113
|
+
* strongest signal — keeps Haiku honest about why it ruled success.
|
|
114
|
+
*
|
|
115
|
+
* The verified=false branch requires a reason — keeps Haiku from waving
|
|
116
|
+
* failures away without explanation, and gives the rephrase prompt
|
|
117
|
+
* downstream a structured signal about what to look for.
|
|
118
|
+
*
|
|
119
|
+
* Empirically validated 2026-06-11 on two real production failure dumps
|
|
120
|
+
* (one wrongly-flagged-as-fail, one genuinely-stuck) — both verdicts
|
|
121
|
+
* correct, both rationale fields coherent.
|
|
122
|
+
*/
|
|
123
|
+
export declare const SUBMIT_VERDICT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
124
|
+
verified: z.ZodLiteral<true>;
|
|
125
|
+
network_signal: z.ZodNullable<z.ZodObject<{
|
|
126
|
+
url: z.ZodString;
|
|
127
|
+
status: z.ZodNumber;
|
|
128
|
+
method: z.ZodString;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
dom_signal: z.ZodNullable<z.ZodString>;
|
|
131
|
+
url_signal: z.ZodNullable<z.ZodString>;
|
|
132
|
+
rationale: z.ZodString;
|
|
133
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
134
|
+
verified: z.ZodLiteral<false>;
|
|
135
|
+
reason: z.ZodString;
|
|
136
|
+
}, z.core.$strip>]>;
|
|
137
|
+
/**
|
|
138
|
+
* Invalid-field detection verdict. Replaces INVALID_CLASS_RX regex.
|
|
139
|
+
* `present` is the top-level boolean so a downstream consumer can
|
|
140
|
+
* short-circuit on "no invalid fields here" without iterating `fields`.
|
|
141
|
+
* `fields` carries the discovered structural markers per-container so
|
|
142
|
+
* the rephrase prompt can build its INTERACTIVE TARGETS section.
|
|
143
|
+
*
|
|
144
|
+
* Strict prompting requires: structural marker (class containing
|
|
145
|
+
* "invalid", aria-invalid="true", data-invalid, or visible error
|
|
146
|
+
* container near input). Visual-only styling does NOT count.
|
|
147
|
+
*/
|
|
148
|
+
export declare const INVALID_FIELDS_SCHEMA: z.ZodObject<{
|
|
149
|
+
present: z.ZodBoolean;
|
|
150
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
151
|
+
containerXpath: z.ZodString;
|
|
152
|
+
label: z.ZodNullable<z.ZodString>;
|
|
153
|
+
markerKind: z.ZodEnum<{
|
|
154
|
+
class: "class";
|
|
155
|
+
aria: "aria";
|
|
156
|
+
data: "data";
|
|
157
|
+
"error-container": "error-container";
|
|
158
|
+
other: "other";
|
|
159
|
+
}>;
|
|
160
|
+
framework: z.ZodEnum<{
|
|
161
|
+
other: "other";
|
|
162
|
+
angular: "angular";
|
|
163
|
+
react: "react";
|
|
164
|
+
vue: "vue";
|
|
165
|
+
mantine: "mantine";
|
|
166
|
+
chakra: "chakra";
|
|
167
|
+
bootstrap: "bootstrap";
|
|
168
|
+
}>;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
/**
|
|
172
|
+
* Modal-priority verdict. Replaces MODAL_PRIORITY_RX keyword regex over
|
|
173
|
+
* Stagehand's English description strings. Returns indices into the
|
|
174
|
+
* caller-supplied unfocused-observe array — the engine just re-sorts
|
|
175
|
+
* its own list, the LLM doesn't see selectors or have to echo them
|
|
176
|
+
* back.
|
|
177
|
+
*
|
|
178
|
+
* Strict prompting requires: structurally blocking the form. Cookie
|
|
179
|
+
* banners and welcome modals ARE priority. Always-visible panels and
|
|
180
|
+
* sidebars are NOT.
|
|
181
|
+
*/
|
|
182
|
+
export declare const MODAL_PRIORITY_SCHEMA: z.ZodObject<{
|
|
183
|
+
priorityIndices: z.ZodArray<z.ZodNumber>;
|
|
184
|
+
rationale: z.ZodString;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
/**
|
|
187
|
+
* Visible-error-message extraction verdict. Replaces `errorPattern`
|
|
188
|
+
* regex. Each entry carries the text, an optional field-name hint,
|
|
189
|
+
* and a severity ranking — the rephrase prompt today renders these as
|
|
190
|
+
* the VISIBLE ERROR / REQUIRED-FIELD MESSAGES section.
|
|
191
|
+
*
|
|
192
|
+
* Strict prompting: structurally-marked error containers + visible text
|
|
193
|
+
* only. Skip placeholder text, help text, and inactive tooltips.
|
|
194
|
+
*/
|
|
195
|
+
export declare const ERROR_MESSAGES_SCHEMA: z.ZodObject<{
|
|
196
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
197
|
+
text: z.ZodString;
|
|
198
|
+
fieldHint: z.ZodNullable<z.ZodString>;
|
|
199
|
+
severity: z.ZodEnum<{
|
|
200
|
+
info: "info";
|
|
201
|
+
error: "error";
|
|
202
|
+
warning: "warning";
|
|
203
|
+
}>;
|
|
204
|
+
}, z.core.$strip>>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
/**
|
|
207
|
+
* Select-option picker verdict. When a flow step's hardcoded dropdown answer
|
|
208
|
+
* doesn't exist in a given requisition's option list (per-req variance —
|
|
209
|
+
* e.g. an ER-flavored answer on a Cardiac job), this judge picks the most
|
|
210
|
+
* plausible AVAILABLE option so the required question can be answered and the
|
|
211
|
+
* wizard advances. `selectIndex` picks which candidate dropdown answers the
|
|
212
|
+
* question (or null when none does); `optionIndex` picks the option within that
|
|
213
|
+
* dropdown (null when `selectIndex` is null).
|
|
214
|
+
*/
|
|
215
|
+
export declare const SELECT_OPTION_SCHEMA: z.ZodObject<{
|
|
216
|
+
selectIndex: z.ZodNullable<z.ZodNumber>;
|
|
217
|
+
optionIndex: z.ZodNullable<z.ZodNumber>;
|
|
218
|
+
reason: z.ZodString;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/lib/llm/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;;;;;mBAiCjC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;mBASjC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;mBASnC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;;;;;iBAKhC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAQ/B,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;mBAkBhC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;iBAYhC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAUhC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;;iBAQ/B,CAAC"}
|