@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.
Files changed (448) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +958 -0
  3. package/dist/api/errors.d.ts +88 -0
  4. package/dist/api/errors.d.ts.map +1 -0
  5. package/dist/api/errors.js +164 -0
  6. package/dist/api/errors.js.map +1 -0
  7. package/dist/api/helpers/envelope.d.ts +13 -0
  8. package/dist/api/helpers/envelope.d.ts.map +1 -0
  9. package/dist/api/helpers/envelope.js +20 -0
  10. package/dist/api/helpers/envelope.js.map +1 -0
  11. package/dist/api/helpers/reply.d.ts +9 -0
  12. package/dist/api/helpers/reply.d.ts.map +1 -0
  13. package/dist/api/helpers/reply.js +14 -0
  14. package/dist/api/helpers/reply.js.map +1 -0
  15. package/dist/api/plugins/auth.d.ts +27 -0
  16. package/dist/api/plugins/auth.d.ts.map +1 -0
  17. package/dist/api/plugins/auth.js +111 -0
  18. package/dist/api/plugins/auth.js.map +1 -0
  19. package/dist/api/plugins/error-handler.d.ts +12 -0
  20. package/dist/api/plugins/error-handler.d.ts.map +1 -0
  21. package/dist/api/plugins/error-handler.js +72 -0
  22. package/dist/api/plugins/error-handler.js.map +1 -0
  23. package/dist/api/plugins/request-context.d.ts +17 -0
  24. package/dist/api/plugins/request-context.d.ts.map +1 -0
  25. package/dist/api/plugins/request-context.js +61 -0
  26. package/dist/api/plugins/request-context.js.map +1 -0
  27. package/dist/api/routes/health.d.ts +55 -0
  28. package/dist/api/routes/health.d.ts.map +1 -0
  29. package/dist/api/routes/health.js +137 -0
  30. package/dist/api/routes/health.js.map +1 -0
  31. package/dist/api/routes/plugins-introspection.d.ts +17 -0
  32. package/dist/api/routes/plugins-introspection.d.ts.map +1 -0
  33. package/dist/api/routes/plugins-introspection.js +13 -0
  34. package/dist/api/routes/plugins-introspection.js.map +1 -0
  35. package/dist/api/schemas/common.d.ts +114 -0
  36. package/dist/api/schemas/common.d.ts.map +1 -0
  37. package/dist/api/schemas/common.js +109 -0
  38. package/dist/api/schemas/common.js.map +1 -0
  39. package/dist/api/schemas/telemetry.d.ts +66 -0
  40. package/dist/api/schemas/telemetry.d.ts.map +1 -0
  41. package/dist/api/schemas/telemetry.js +52 -0
  42. package/dist/api/schemas/telemetry.js.map +1 -0
  43. package/dist/cache/keyed-ttl-cache.d.ts +45 -0
  44. package/dist/cache/keyed-ttl-cache.d.ts.map +1 -0
  45. package/dist/cache/keyed-ttl-cache.js +69 -0
  46. package/dist/cache/keyed-ttl-cache.js.map +1 -0
  47. package/dist/cache/response-cache.d.ts +37 -0
  48. package/dist/cache/response-cache.d.ts.map +1 -0
  49. package/dist/cache/response-cache.js +114 -0
  50. package/dist/cache/response-cache.js.map +1 -0
  51. package/dist/config.d.ts +258 -0
  52. package/dist/config.d.ts.map +1 -0
  53. package/dist/config.js +138 -0
  54. package/dist/config.js.map +1 -0
  55. package/dist/lib/applicant-payload.d.ts +28 -0
  56. package/dist/lib/applicant-payload.d.ts.map +1 -0
  57. package/dist/lib/applicant-payload.js +20 -0
  58. package/dist/lib/applicant-payload.js.map +1 -0
  59. package/dist/lib/application-address.d.ts +16 -0
  60. package/dist/lib/application-address.d.ts.map +1 -0
  61. package/dist/lib/application-address.js +20 -0
  62. package/dist/lib/application-address.js.map +1 -0
  63. package/dist/lib/application-answers.d.ts +151 -0
  64. package/dist/lib/application-answers.d.ts.map +1 -0
  65. package/dist/lib/application-answers.js +95 -0
  66. package/dist/lib/application-answers.js.map +1 -0
  67. package/dist/lib/application-identity.d.ts +18 -0
  68. package/dist/lib/application-identity.d.ts.map +1 -0
  69. package/dist/lib/application-identity.js +20 -0
  70. package/dist/lib/application-identity.js.map +1 -0
  71. package/dist/lib/application-resume.d.ts +21 -0
  72. package/dist/lib/application-resume.d.ts.map +1 -0
  73. package/dist/lib/application-resume.js +23 -0
  74. package/dist/lib/application-resume.js.map +1 -0
  75. package/dist/lib/bedrock.d.ts +22 -0
  76. package/dist/lib/bedrock.d.ts.map +1 -0
  77. package/dist/lib/bedrock.js +35 -0
  78. package/dist/lib/bedrock.js.map +1 -0
  79. package/dist/lib/case-insensitive-headers.d.ts +15 -0
  80. package/dist/lib/case-insensitive-headers.d.ts.map +1 -0
  81. package/dist/lib/case-insensitive-headers.js +29 -0
  82. package/dist/lib/case-insensitive-headers.js.map +1 -0
  83. package/dist/lib/chromium-client-hints.d.ts +11 -0
  84. package/dist/lib/chromium-client-hints.d.ts.map +1 -0
  85. package/dist/lib/chromium-client-hints.js +17 -0
  86. package/dist/lib/chromium-client-hints.js.map +1 -0
  87. package/dist/lib/cookie-value.d.ts +8 -0
  88. package/dist/lib/cookie-value.d.ts.map +1 -0
  89. package/dist/lib/cookie-value.js +14 -0
  90. package/dist/lib/cookie-value.js.map +1 -0
  91. package/dist/lib/datadog.d.ts +8 -0
  92. package/dist/lib/datadog.d.ts.map +1 -0
  93. package/dist/lib/datadog.js +27 -0
  94. package/dist/lib/datadog.js.map +1 -0
  95. package/dist/lib/dd-metrics.d.ts +28 -0
  96. package/dist/lib/dd-metrics.d.ts.map +1 -0
  97. package/dist/lib/dd-metrics.js +62 -0
  98. package/dist/lib/dd-metrics.js.map +1 -0
  99. package/dist/lib/dispatch-metrics.d.ts +19 -0
  100. package/dist/lib/dispatch-metrics.d.ts.map +1 -0
  101. package/dist/lib/dispatch-metrics.js +65 -0
  102. package/dist/lib/dispatch-metrics.js.map +1 -0
  103. package/dist/lib/env.d.ts +37 -0
  104. package/dist/lib/env.d.ts.map +1 -0
  105. package/dist/lib/env.js +70 -0
  106. package/dist/lib/env.js.map +1 -0
  107. package/dist/lib/errors.d.ts +15 -0
  108. package/dist/lib/errors.d.ts.map +1 -0
  109. package/dist/lib/errors.js +20 -0
  110. package/dist/lib/errors.js.map +1 -0
  111. package/dist/lib/http.d.ts +7 -0
  112. package/dist/lib/http.d.ts.map +1 -0
  113. package/dist/lib/http.js +14 -0
  114. package/dist/lib/http.js.map +1 -0
  115. package/dist/lib/job-tracking.d.ts +17 -0
  116. package/dist/lib/job-tracking.d.ts.map +1 -0
  117. package/dist/lib/job-tracking.js +19 -0
  118. package/dist/lib/job-tracking.js.map +1 -0
  119. package/dist/lib/llm/anthropic-client.d.ts +12 -0
  120. package/dist/lib/llm/anthropic-client.d.ts.map +1 -0
  121. package/dist/lib/llm/anthropic-client.js +23 -0
  122. package/dist/lib/llm/anthropic-client.js.map +1 -0
  123. package/dist/lib/llm/judge.d.ts +57 -0
  124. package/dist/lib/llm/judge.d.ts.map +1 -0
  125. package/dist/lib/llm/judge.js +123 -0
  126. package/dist/lib/llm/judge.js.map +1 -0
  127. package/dist/lib/llm/judges/error-messages.d.ts +38 -0
  128. package/dist/lib/llm/judges/error-messages.d.ts.map +1 -0
  129. package/dist/lib/llm/judges/error-messages.js +72 -0
  130. package/dist/lib/llm/judges/error-messages.js.map +1 -0
  131. package/dist/lib/llm/judges/invalid-fields.d.ts +43 -0
  132. package/dist/lib/llm/judges/invalid-fields.d.ts.map +1 -0
  133. package/dist/lib/llm/judges/invalid-fields.js +80 -0
  134. package/dist/lib/llm/judges/invalid-fields.js.map +1 -0
  135. package/dist/lib/llm/judges/modal-priority.d.ts +41 -0
  136. package/dist/lib/llm/judges/modal-priority.d.ts.map +1 -0
  137. package/dist/lib/llm/judges/modal-priority.js +74 -0
  138. package/dist/lib/llm/judges/modal-priority.js.map +1 -0
  139. package/dist/lib/llm/judges/select-option.d.ts +49 -0
  140. package/dist/lib/llm/judges/select-option.d.ts.map +1 -0
  141. package/dist/lib/llm/judges/select-option.js +90 -0
  142. package/dist/lib/llm/judges/select-option.js.map +1 -0
  143. package/dist/lib/llm/judges/verify-submit.d.ts +68 -0
  144. package/dist/lib/llm/judges/verify-submit.d.ts.map +1 -0
  145. package/dist/lib/llm/judges/verify-submit.js +89 -0
  146. package/dist/lib/llm/judges/verify-submit.js.map +1 -0
  147. package/dist/lib/llm/schemas.d.ts +220 -0
  148. package/dist/lib/llm/schemas.d.ts.map +1 -0
  149. package/dist/lib/llm/schemas.js +239 -0
  150. package/dist/lib/llm/schemas.js.map +1 -0
  151. package/dist/lib/logging.d.ts +39 -0
  152. package/dist/lib/logging.d.ts.map +1 -0
  153. package/dist/lib/logging.js +219 -0
  154. package/dist/lib/logging.js.map +1 -0
  155. package/dist/lib/multipart.d.ts +34 -0
  156. package/dist/lib/multipart.d.ts.map +1 -0
  157. package/dist/lib/multipart.js +55 -0
  158. package/dist/lib/multipart.js.map +1 -0
  159. package/dist/lib/option-matcher.d.ts +15 -0
  160. package/dist/lib/option-matcher.d.ts.map +1 -0
  161. package/dist/lib/option-matcher.js +69 -0
  162. package/dist/lib/option-matcher.js.map +1 -0
  163. package/dist/lib/phone.d.ts +11 -0
  164. package/dist/lib/phone.d.ts.map +1 -0
  165. package/dist/lib/phone.js +17 -0
  166. package/dist/lib/phone.js.map +1 -0
  167. package/dist/lib/random.d.ts +22 -0
  168. package/dist/lib/random.d.ts.map +1 -0
  169. package/dist/lib/random.js +33 -0
  170. package/dist/lib/random.js.map +1 -0
  171. package/dist/lib/statsd.d.ts +11 -0
  172. package/dist/lib/statsd.d.ts.map +1 -0
  173. package/dist/lib/statsd.js +68 -0
  174. package/dist/lib/statsd.js.map +1 -0
  175. package/dist/lib/telemetry/call-capture.d.ts +89 -0
  176. package/dist/lib/telemetry/call-capture.d.ts.map +1 -0
  177. package/dist/lib/telemetry/call-capture.js +190 -0
  178. package/dist/lib/telemetry/call-capture.js.map +1 -0
  179. package/dist/lib/telemetry/call-types.d.ts +65 -0
  180. package/dist/lib/telemetry/call-types.d.ts.map +1 -0
  181. package/dist/lib/telemetry/call-types.js +68 -0
  182. package/dist/lib/telemetry/call-types.js.map +1 -0
  183. package/dist/lib/telemetry/run-state.d.ts +15 -0
  184. package/dist/lib/telemetry/run-state.d.ts.map +1 -0
  185. package/dist/lib/telemetry/run-state.js +23 -0
  186. package/dist/lib/telemetry/run-state.js.map +1 -0
  187. package/dist/lib/telemetry/s3-sink.d.ts +48 -0
  188. package/dist/lib/telemetry/s3-sink.d.ts.map +1 -0
  189. package/dist/lib/telemetry/s3-sink.js +229 -0
  190. package/dist/lib/telemetry/s3-sink.js.map +1 -0
  191. package/dist/lib/telemetry/submission-capture.d.ts +45 -0
  192. package/dist/lib/telemetry/submission-capture.d.ts.map +1 -0
  193. package/dist/lib/telemetry/submission-capture.js +57 -0
  194. package/dist/lib/telemetry/submission-capture.js.map +1 -0
  195. package/dist/lib/telemetry/telemetry-paths.d.ts +59 -0
  196. package/dist/lib/telemetry/telemetry-paths.d.ts.map +1 -0
  197. package/dist/lib/telemetry/telemetry-paths.js +103 -0
  198. package/dist/lib/telemetry/telemetry-paths.js.map +1 -0
  199. package/dist/lib/tracking-click.d.ts +20 -0
  200. package/dist/lib/tracking-click.d.ts.map +1 -0
  201. package/dist/lib/tracking-click.js +75 -0
  202. package/dist/lib/tracking-click.js.map +1 -0
  203. package/dist/lib/url-capture.d.ts +8 -0
  204. package/dist/lib/url-capture.d.ts.map +1 -0
  205. package/dist/lib/url-capture.js +17 -0
  206. package/dist/lib/url-capture.js.map +1 -0
  207. package/dist/lib/us-states.d.ts +20 -0
  208. package/dist/lib/us-states.d.ts.map +1 -0
  209. package/dist/lib/us-states.js +86 -0
  210. package/dist/lib/us-states.js.map +1 -0
  211. package/dist/lib/zod-multipart.d.ts +18 -0
  212. package/dist/lib/zod-multipart.d.ts.map +1 -0
  213. package/dist/lib/zod-multipart.js +35 -0
  214. package/dist/lib/zod-multipart.js.map +1 -0
  215. package/dist/plugins/config-plugin.d.ts +77 -0
  216. package/dist/plugins/config-plugin.d.ts.map +1 -0
  217. package/dist/plugins/config-plugin.js +216 -0
  218. package/dist/plugins/config-plugin.js.map +1 -0
  219. package/dist/plugins/discover.d.ts +72 -0
  220. package/dist/plugins/discover.d.ts.map +1 -0
  221. package/dist/plugins/discover.js +265 -0
  222. package/dist/plugins/discover.js.map +1 -0
  223. package/dist/plugins/json-schema-to-zod.d.ts +47 -0
  224. package/dist/plugins/json-schema-to-zod.d.ts.map +1 -0
  225. package/dist/plugins/json-schema-to-zod.js +85 -0
  226. package/dist/plugins/json-schema-to-zod.js.map +1 -0
  227. package/dist/plugins/loader.d.ts +34 -0
  228. package/dist/plugins/loader.d.ts.map +1 -0
  229. package/dist/plugins/loader.js +348 -0
  230. package/dist/plugins/loader.js.map +1 -0
  231. package/dist/plugins/plugin-api-version.d.ts +8 -0
  232. package/dist/plugins/plugin-api-version.d.ts.map +1 -0
  233. package/dist/plugins/plugin-api-version.js +11 -0
  234. package/dist/plugins/plugin-api-version.js.map +1 -0
  235. package/dist/plugins/plugin-manifest-envelope.d.ts +16 -0
  236. package/dist/plugins/plugin-manifest-envelope.d.ts.map +1 -0
  237. package/dist/plugins/plugin-manifest-envelope.js +19 -0
  238. package/dist/plugins/plugin-manifest-envelope.js.map +1 -0
  239. package/dist/scraper/behavioral-signals.d.ts +16 -0
  240. package/dist/scraper/behavioral-signals.d.ts.map +1 -0
  241. package/dist/scraper/behavioral-signals.js +30 -0
  242. package/dist/scraper/behavioral-signals.js.map +1 -0
  243. package/dist/scraper/errors.d.ts +193 -0
  244. package/dist/scraper/errors.d.ts.map +1 -0
  245. package/dist/scraper/errors.js +226 -0
  246. package/dist/scraper/errors.js.map +1 -0
  247. package/dist/scraper/fixtures.d.ts +23 -0
  248. package/dist/scraper/fixtures.d.ts.map +1 -0
  249. package/dist/scraper/fixtures.js +48 -0
  250. package/dist/scraper/fixtures.js.map +1 -0
  251. package/dist/scraper/flow-runner.d.ts +1319 -0
  252. package/dist/scraper/flow-runner.d.ts.map +1 -0
  253. package/dist/scraper/flow-runner.js +5637 -0
  254. package/dist/scraper/flow-runner.js.map +1 -0
  255. package/dist/scraper/graphql-client.d.ts +30 -0
  256. package/dist/scraper/graphql-client.d.ts.map +1 -0
  257. package/dist/scraper/graphql-client.js +14 -0
  258. package/dist/scraper/graphql-client.js.map +1 -0
  259. package/dist/scraper/http-client.d.ts +75 -0
  260. package/dist/scraper/http-client.d.ts.map +1 -0
  261. package/dist/scraper/http-client.js +189 -0
  262. package/dist/scraper/http-client.js.map +1 -0
  263. package/dist/scraper/http-status-classifier.d.ts +12 -0
  264. package/dist/scraper/http-status-classifier.d.ts.map +1 -0
  265. package/dist/scraper/http-status-classifier.js +29 -0
  266. package/dist/scraper/http-status-classifier.js.map +1 -0
  267. package/dist/scraper/metrics.d.ts +50 -0
  268. package/dist/scraper/metrics.d.ts.map +1 -0
  269. package/dist/scraper/metrics.js +85 -0
  270. package/dist/scraper/metrics.js.map +1 -0
  271. package/dist/scraper/navigate.d.ts +20 -0
  272. package/dist/scraper/navigate.d.ts.map +1 -0
  273. package/dist/scraper/navigate.js +30 -0
  274. package/dist/scraper/navigate.js.map +1 -0
  275. package/dist/scraper/oracle-sentinels.d.ts +22 -0
  276. package/dist/scraper/oracle-sentinels.d.ts.map +1 -0
  277. package/dist/scraper/oracle-sentinels.js +40 -0
  278. package/dist/scraper/oracle-sentinels.js.map +1 -0
  279. package/dist/scraper/parse-json-response.d.ts +16 -0
  280. package/dist/scraper/parse-json-response.d.ts.map +1 -0
  281. package/dist/scraper/parse-json-response.js +37 -0
  282. package/dist/scraper/parse-json-response.js.map +1 -0
  283. package/dist/scraper/pool.d.ts +37 -0
  284. package/dist/scraper/pool.d.ts.map +1 -0
  285. package/dist/scraper/pool.js +105 -0
  286. package/dist/scraper/pool.js.map +1 -0
  287. package/dist/scraper/rate-limited-json-client.d.ts +35 -0
  288. package/dist/scraper/rate-limited-json-client.d.ts.map +1 -0
  289. package/dist/scraper/rate-limited-json-client.js +29 -0
  290. package/dist/scraper/rate-limited-json-client.js.map +1 -0
  291. package/dist/scraper/raw-fetch.d.ts +49 -0
  292. package/dist/scraper/raw-fetch.d.ts.map +1 -0
  293. package/dist/scraper/raw-fetch.js +40 -0
  294. package/dist/scraper/raw-fetch.js.map +1 -0
  295. package/dist/scraper/require-response-field.d.ts +23 -0
  296. package/dist/scraper/require-response-field.d.ts.map +1 -0
  297. package/dist/scraper/require-response-field.js +42 -0
  298. package/dist/scraper/require-response-field.js.map +1 -0
  299. package/dist/scraper/retry.d.ts +33 -0
  300. package/dist/scraper/retry.d.ts.map +1 -0
  301. package/dist/scraper/retry.js +122 -0
  302. package/dist/scraper/retry.js.map +1 -0
  303. package/dist/scraper/session-browserbase.d.ts +35 -0
  304. package/dist/scraper/session-browserbase.d.ts.map +1 -0
  305. package/dist/scraper/session-browserbase.js +198 -0
  306. package/dist/scraper/session-browserbase.js.map +1 -0
  307. package/dist/scraper/session-shared.d.ts +29 -0
  308. package/dist/scraper/session-shared.d.ts.map +1 -0
  309. package/dist/scraper/session-shared.js +35 -0
  310. package/dist/scraper/session-shared.js.map +1 -0
  311. package/dist/scraper/session-steel.d.ts +31 -0
  312. package/dist/scraper/session-steel.d.ts.map +1 -0
  313. package/dist/scraper/session-steel.js +140 -0
  314. package/dist/scraper/session-steel.js.map +1 -0
  315. package/dist/scraper/session-warmup.d.ts +31 -0
  316. package/dist/scraper/session-warmup.d.ts.map +1 -0
  317. package/dist/scraper/session-warmup.js +46 -0
  318. package/dist/scraper/session-warmup.js.map +1 -0
  319. package/dist/scraper/session.d.ts +21 -0
  320. package/dist/scraper/session.d.ts.map +1 -0
  321. package/dist/scraper/session.js +28 -0
  322. package/dist/scraper/session.js.map +1 -0
  323. package/dist/scraper/stagehand-guard.d.ts +128 -0
  324. package/dist/scraper/stagehand-guard.d.ts.map +1 -0
  325. package/dist/scraper/stagehand-guard.js +337 -0
  326. package/dist/scraper/stagehand-guard.js.map +1 -0
  327. package/dist/scraper/throttle.d.ts +21 -0
  328. package/dist/scraper/throttle.d.ts.map +1 -0
  329. package/dist/scraper/throttle.js +45 -0
  330. package/dist/scraper/throttle.js.map +1 -0
  331. package/dist/scripts/hca-inbox-poll.d.ts +19 -0
  332. package/dist/scripts/hca-inbox-poll.d.ts.map +1 -0
  333. package/dist/scripts/hca-inbox-poll.js +151 -0
  334. package/dist/scripts/hca-inbox-poll.js.map +1 -0
  335. package/dist/scripts/judge-llm-batch.d.ts +98 -0
  336. package/dist/scripts/judge-llm-batch.d.ts.map +1 -0
  337. package/dist/scripts/judge-llm-batch.js +350 -0
  338. package/dist/scripts/judge-llm-batch.js.map +1 -0
  339. package/dist/scripts/llm-heal.d.ts +165 -0
  340. package/dist/scripts/llm-heal.d.ts.map +1 -0
  341. package/dist/scripts/llm-heal.js +595 -0
  342. package/dist/scripts/llm-heal.js.map +1 -0
  343. package/dist/scripts/migrate-telemetry-dir-names.d.ts +57 -0
  344. package/dist/scripts/migrate-telemetry-dir-names.d.ts.map +1 -0
  345. package/dist/scripts/migrate-telemetry-dir-names.js +156 -0
  346. package/dist/scripts/migrate-telemetry-dir-names.js.map +1 -0
  347. package/dist/scripts/probe-setinputfiles.d.ts +28 -0
  348. package/dist/scripts/probe-setinputfiles.d.ts.map +1 -0
  349. package/dist/scripts/probe-setinputfiles.js +95 -0
  350. package/dist/scripts/probe-setinputfiles.js.map +1 -0
  351. package/dist/scripts/recon-browser.d.ts +304 -0
  352. package/dist/scripts/recon-browser.d.ts.map +1 -0
  353. package/dist/scripts/recon-browser.js +1833 -0
  354. package/dist/scripts/recon-browser.js.map +1 -0
  355. package/dist/scripts/recon-generate.d.ts +182 -0
  356. package/dist/scripts/recon-generate.d.ts.map +1 -0
  357. package/dist/scripts/recon-generate.js +2572 -0
  358. package/dist/scripts/recon-generate.js.map +1 -0
  359. package/dist/scripts/recon-heal.d.ts +176 -0
  360. package/dist/scripts/recon-heal.d.ts.map +1 -0
  361. package/dist/scripts/recon-heal.js +584 -0
  362. package/dist/scripts/recon-heal.js.map +1 -0
  363. package/dist/scripts/recon-http.d.ts +19 -0
  364. package/dist/scripts/recon-http.d.ts.map +1 -0
  365. package/dist/scripts/recon-http.js +377 -0
  366. package/dist/scripts/recon-http.js.map +1 -0
  367. package/dist/scripts/recon-replay-jobs.d.ts +21 -0
  368. package/dist/scripts/recon-replay-jobs.d.ts.map +1 -0
  369. package/dist/scripts/recon-replay-jobs.js +221 -0
  370. package/dist/scripts/recon-replay-jobs.js.map +1 -0
  371. package/dist/scripts/recon-shared.d.ts +52 -0
  372. package/dist/scripts/recon-shared.d.ts.map +1 -0
  373. package/dist/scripts/recon-shared.js +68 -0
  374. package/dist/scripts/recon-shared.js.map +1 -0
  375. package/dist/scripts/recon-summarize.d.ts +15 -0
  376. package/dist/scripts/recon-summarize.d.ts.map +1 -0
  377. package/dist/scripts/recon-summarize.js +233 -0
  378. package/dist/scripts/recon-summarize.js.map +1 -0
  379. package/dist/scripts/smoke-test.d.ts +22 -0
  380. package/dist/scripts/smoke-test.d.ts.map +1 -0
  381. package/dist/scripts/smoke-test.js +236 -0
  382. package/dist/scripts/smoke-test.js.map +1 -0
  383. package/dist/server.d.ts +10 -0
  384. package/dist/server.d.ts.map +1 -0
  385. package/dist/server.js +189 -0
  386. package/dist/server.js.map +1 -0
  387. package/dist/site-plugin.d.ts +226 -0
  388. package/dist/site-plugin.d.ts.map +1 -0
  389. package/dist/site-plugin.js +13 -0
  390. package/dist/site-plugin.js.map +1 -0
  391. package/dist/testing/answers-fixture.d.ts +13 -0
  392. package/dist/testing/answers-fixture.d.ts.map +1 -0
  393. package/dist/testing/answers-fixture.js +37 -0
  394. package/dist/testing/answers-fixture.js.map +1 -0
  395. package/dist/testing/batch-email-confirmation.d.ts +58 -0
  396. package/dist/testing/batch-email-confirmation.d.ts.map +1 -0
  397. package/dist/testing/batch-email-confirmation.js +62 -0
  398. package/dist/testing/batch-email-confirmation.js.map +1 -0
  399. package/dist/testing/batch-report.d.ts +33 -0
  400. package/dist/testing/batch-report.d.ts.map +1 -0
  401. package/dist/testing/batch-report.js +30 -0
  402. package/dist/testing/batch-report.js.map +1 -0
  403. package/dist/testing/contract-parity-suite.d.ts +55 -0
  404. package/dist/testing/contract-parity-suite.d.ts.map +1 -0
  405. package/dist/testing/contract-parity-suite.js +39 -0
  406. package/dist/testing/contract-parity-suite.js.map +1 -0
  407. package/dist/testing/coverage-guard-suite.d.ts +46 -0
  408. package/dist/testing/coverage-guard-suite.d.ts.map +1 -0
  409. package/dist/testing/coverage-guard-suite.js +39 -0
  410. package/dist/testing/coverage-guard-suite.js.map +1 -0
  411. package/dist/testing/fixtures/resume.pdf +54 -0
  412. package/dist/testing/integration-runner.d.ts +62 -0
  413. package/dist/testing/integration-runner.d.ts.map +1 -0
  414. package/dist/testing/integration-runner.js +46 -0
  415. package/dist/testing/integration-runner.js.map +1 -0
  416. package/dist/testing/mock-fetch-response.d.ts +7 -0
  417. package/dist/testing/mock-fetch-response.d.ts.map +1 -0
  418. package/dist/testing/mock-fetch-response.js +16 -0
  419. package/dist/testing/mock-fetch-response.js.map +1 -0
  420. package/dist/testing/persona-fixture.d.ts +77 -0
  421. package/dist/testing/persona-fixture.d.ts.map +1 -0
  422. package/dist/testing/persona-fixture.js +83 -0
  423. package/dist/testing/persona-fixture.js.map +1 -0
  424. package/dist/testing/replay-integration-suite.d.ts +50 -0
  425. package/dist/testing/replay-integration-suite.d.ts.map +1 -0
  426. package/dist/testing/replay-integration-suite.js +45 -0
  427. package/dist/testing/replay-integration-suite.js.map +1 -0
  428. package/dist/testing/resume-fixture.d.ts +39 -0
  429. package/dist/testing/resume-fixture.d.ts.map +1 -0
  430. package/dist/testing/resume-fixture.js +38 -0
  431. package/dist/testing/resume-fixture.js.map +1 -0
  432. package/dist/testmail/client.d.ts +61 -0
  433. package/dist/testmail/client.d.ts.map +1 -0
  434. package/dist/testmail/client.js +190 -0
  435. package/dist/testmail/client.js.map +1 -0
  436. package/dist/testmail/errors.d.ts +18 -0
  437. package/dist/testmail/errors.d.ts.map +1 -0
  438. package/dist/testmail/errors.js +29 -0
  439. package/dist/testmail/errors.js.map +1 -0
  440. package/dist/types/dispatch-metrics.d.ts +46 -0
  441. package/dist/types/dispatch-metrics.d.ts.map +1 -0
  442. package/dist/types/dispatch-metrics.js +25 -0
  443. package/dist/types/dispatch-metrics.js.map +1 -0
  444. package/dist/types/logging.d.ts +11 -0
  445. package/dist/types/logging.d.ts.map +1 -0
  446. package/dist/types/logging.js +3 -0
  447. package/dist/types/logging.js.map +1 -0
  448. 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"}