@browserbasehq/orca 3.5.0-vertex-test → 3.6.0-gemini-cua

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 (290) hide show
  1. package/README.md +7 -15
  2. package/dist/cjs/lib/utils.d.ts +8 -0
  3. package/dist/cjs/lib/utils.js +31 -0
  4. package/dist/cjs/lib/utils.js.map +1 -1
  5. package/dist/cjs/lib/v3/agent/AgentProvider.js +5 -3
  6. package/dist/cjs/lib/v3/agent/AgentProvider.js.map +1 -1
  7. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js +10 -8
  8. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
  9. package/dist/cjs/lib/v3/agent/GoogleCUAClient.js +124 -28
  10. package/dist/cjs/lib/v3/agent/GoogleCUAClient.js.map +1 -1
  11. package/dist/cjs/lib/v3/agent/utils/captureAriaTreeProbe.d.ts +35 -0
  12. package/dist/cjs/lib/v3/agent/utils/captureAriaTreeProbe.js +38 -0
  13. package/dist/cjs/lib/v3/agent/utils/captureAriaTreeProbe.js.map +1 -0
  14. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js +10 -1
  15. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -1
  16. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.d.ts +19 -0
  17. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.js +54 -0
  18. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.js.map +1 -0
  19. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.d.ts +2 -0
  20. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.js +62 -0
  21. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.js.map +1 -0
  22. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.d.ts +3 -0
  23. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.js +25 -0
  24. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.js.map +1 -0
  25. package/dist/cjs/lib/v3/api.d.ts +1 -0
  26. package/dist/cjs/lib/v3/api.js +37 -16
  27. package/dist/cjs/lib/v3/api.js.map +1 -1
  28. package/dist/cjs/lib/v3/cache/ActCache.js +1 -1
  29. package/dist/cjs/lib/v3/cache/ActCache.js.map +1 -1
  30. package/dist/cjs/lib/v3/cache/utils.d.ts +7 -0
  31. package/dist/cjs/lib/v3/cache/utils.js +19 -0
  32. package/dist/cjs/lib/v3/cache/utils.js.map +1 -1
  33. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.d.ts +24 -24
  34. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.js +24 -24
  35. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.js.map +1 -1
  36. package/dist/cjs/lib/v3/dom/locatorScripts/xpathResolver.js +79 -10
  37. package/dist/cjs/lib/v3/dom/locatorScripts/xpathResolver.js.map +1 -1
  38. package/dist/cjs/lib/v3/handlers/v3AgentHandler.d.ts +3 -1
  39. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js +108 -16
  40. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  41. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.d.ts +11 -0
  42. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js +119 -5
  43. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  44. package/dist/cjs/lib/v3/index.d.ts +13 -1
  45. package/dist/cjs/lib/v3/index.js +19 -1
  46. package/dist/cjs/lib/v3/index.js.map +1 -1
  47. package/dist/cjs/lib/v3/launch/local.js +1 -0
  48. package/dist/cjs/lib/v3/launch/local.js.map +1 -1
  49. package/dist/cjs/lib/v3/llm/LLMProvider.d.ts +3 -0
  50. package/dist/cjs/lib/v3/llm/LLMProvider.js +45 -3
  51. package/dist/cjs/lib/v3/llm/LLMProvider.js.map +1 -1
  52. package/dist/cjs/lib/v3/llm/aisdk.js +4 -0
  53. package/dist/cjs/lib/v3/llm/aisdk.js.map +1 -1
  54. package/dist/cjs/lib/v3/llm/anthropicOptions.d.ts +57 -0
  55. package/dist/cjs/lib/v3/llm/anthropicOptions.js +115 -0
  56. package/dist/cjs/lib/v3/llm/anthropicOptions.js.map +1 -0
  57. package/dist/cjs/lib/v3/types/public/agent.d.ts +8 -2
  58. package/dist/cjs/lib/v3/types/public/agent.js +3 -0
  59. package/dist/cjs/lib/v3/types/public/agent.js.map +1 -1
  60. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.d.ts +85 -0
  61. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.js +15 -0
  62. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.js.map +1 -0
  63. package/dist/cjs/lib/v3/types/public/api.d.ts +925 -182
  64. package/dist/cjs/lib/v3/types/public/api.js +138 -20
  65. package/dist/cjs/lib/v3/types/public/api.js.map +1 -1
  66. package/dist/cjs/lib/v3/types/public/clipboard.d.ts +15 -0
  67. package/dist/cjs/lib/v3/types/public/clipboard.js +3 -0
  68. package/dist/cjs/lib/v3/types/public/clipboard.js.map +1 -0
  69. package/dist/cjs/lib/v3/types/public/index.d.ts +2 -0
  70. package/dist/cjs/lib/v3/types/public/index.js +2 -0
  71. package/dist/cjs/lib/v3/types/public/index.js.map +1 -1
  72. package/dist/cjs/lib/v3/types/public/model.d.ts +33 -8
  73. package/dist/cjs/lib/v3/types/public/model.js.map +1 -1
  74. package/dist/cjs/lib/v3/types/public/page.d.ts +29 -0
  75. package/dist/cjs/lib/v3/types/public/page.js.map +1 -1
  76. package/dist/cjs/lib/v3/types/public/sdkErrors.d.ts +3 -0
  77. package/dist/cjs/lib/v3/types/public/sdkErrors.js +8 -2
  78. package/dist/cjs/lib/v3/types/public/sdkErrors.js.map +1 -1
  79. package/dist/cjs/lib/v3/understudy/clipboard.d.ts +24 -0
  80. package/dist/cjs/lib/v3/understudy/clipboard.js +166 -0
  81. package/dist/cjs/lib/v3/understudy/clipboard.js.map +1 -0
  82. package/dist/cjs/lib/v3/understudy/context.d.ts +3 -0
  83. package/dist/cjs/lib/v3/understudy/context.js +15 -0
  84. package/dist/cjs/lib/v3/understudy/context.js.map +1 -1
  85. package/dist/cjs/lib/v3/understudy/page.d.ts +23 -1
  86. package/dist/cjs/lib/v3/understudy/page.js +283 -0
  87. package/dist/cjs/lib/v3/understudy/page.js.map +1 -1
  88. package/dist/cjs/lib/v3/v3.js +19 -7
  89. package/dist/cjs/lib/v3/v3.js.map +1 -1
  90. package/dist/cjs/lib/v3/verifier/errorTaxonomy.d.ts +35 -0
  91. package/dist/cjs/lib/v3/verifier/errorTaxonomy.js +291 -0
  92. package/dist/cjs/lib/v3/verifier/errorTaxonomy.js.map +1 -0
  93. package/dist/cjs/lib/v3/verifier/evidence.d.ts +44 -0
  94. package/dist/cjs/lib/v3/verifier/evidence.js +432 -0
  95. package/dist/cjs/lib/v3/verifier/evidence.js.map +1 -0
  96. package/dist/cjs/lib/v3/verifier/evidenceNormalization.d.ts +7 -0
  97. package/dist/cjs/lib/v3/verifier/evidenceNormalization.js +100 -0
  98. package/dist/cjs/lib/v3/verifier/evidenceNormalization.js.map +1 -0
  99. package/dist/cjs/lib/v3/verifier/index.d.ts +6 -0
  100. package/dist/cjs/lib/v3/verifier/index.js +16 -0
  101. package/dist/cjs/lib/v3/verifier/index.js.map +1 -0
  102. package/dist/cjs/lib/v3/verifier/prompts/batchedRelevance.d.ts +21 -0
  103. package/dist/cjs/lib/v3/verifier/prompts/batchedRelevance.js +71 -0
  104. package/dist/cjs/lib/v3/verifier/prompts/batchedRelevance.js.map +1 -0
  105. package/dist/cjs/lib/v3/verifier/prompts/firstPointOfFailure.d.ts +3 -0
  106. package/dist/cjs/lib/v3/verifier/prompts/firstPointOfFailure.js +166 -0
  107. package/dist/cjs/lib/v3/verifier/prompts/firstPointOfFailure.js.map +1 -0
  108. package/dist/cjs/lib/v3/verifier/prompts/fusedJudgment.d.ts +35 -0
  109. package/dist/cjs/lib/v3/verifier/prompts/fusedJudgment.js +158 -0
  110. package/dist/cjs/lib/v3/verifier/prompts/fusedJudgment.js.map +1 -0
  111. package/dist/cjs/lib/v3/verifier/prompts/fusedOutcome.d.ts +26 -0
  112. package/dist/cjs/lib/v3/verifier/prompts/fusedOutcome.js +137 -0
  113. package/dist/cjs/lib/v3/verifier/prompts/fusedOutcome.js.map +1 -0
  114. package/dist/cjs/lib/v3/verifier/prompts/index.d.ts +8 -0
  115. package/dist/cjs/lib/v3/verifier/prompts/index.js +22 -0
  116. package/dist/cjs/lib/v3/verifier/prompts/index.js.map +1 -0
  117. package/dist/cjs/lib/v3/verifier/prompts/perCriterionScore.d.ts +23 -0
  118. package/dist/cjs/lib/v3/verifier/prompts/perCriterionScore.js +77 -0
  119. package/dist/cjs/lib/v3/verifier/prompts/perCriterionScore.js.map +1 -0
  120. package/dist/cjs/lib/v3/verifier/prompts/render.d.ts +23 -0
  121. package/dist/cjs/lib/v3/verifier/prompts/render.js +45 -0
  122. package/dist/cjs/lib/v3/verifier/prompts/render.js.map +1 -0
  123. package/dist/cjs/lib/v3/verifier/prompts/rubricGeneration.d.ts +16 -0
  124. package/dist/cjs/lib/v3/verifier/prompts/rubricGeneration.js +321 -0
  125. package/dist/cjs/lib/v3/verifier/prompts/rubricGeneration.js.map +1 -0
  126. package/dist/cjs/lib/v3/verifier/prompts/taskValidity.d.ts +1 -0
  127. package/dist/cjs/lib/v3/verifier/prompts/taskValidity.js +116 -0
  128. package/dist/cjs/lib/v3/verifier/prompts/taskValidity.js.map +1 -0
  129. package/dist/cjs/lib/v3/verifier/rubricVerifier.d.ts +91 -0
  130. package/dist/cjs/lib/v3/verifier/rubricVerifier.js +1645 -0
  131. package/dist/cjs/lib/v3/verifier/rubricVerifier.js.map +1 -0
  132. package/dist/cjs/lib/v3/verifier/trajectory.d.ts +50 -0
  133. package/dist/cjs/lib/v3/verifier/trajectory.js +316 -0
  134. package/dist/cjs/lib/v3/verifier/trajectory.js.map +1 -0
  135. package/dist/cjs/lib/v3/verifier/types.d.ts +429 -0
  136. package/dist/cjs/lib/v3/verifier/types.js +3 -0
  137. package/dist/cjs/lib/v3/verifier/types.js.map +1 -0
  138. package/dist/cjs/lib/v3Evaluator.d.ts +14 -4
  139. package/dist/cjs/lib/v3Evaluator.js +189 -1
  140. package/dist/cjs/lib/v3Evaluator.js.map +1 -1
  141. package/dist/cjs/lib/v3LegacyEvaluator.js +5 -1
  142. package/dist/cjs/lib/v3LegacyEvaluator.js.map +1 -1
  143. package/dist/cjs/lib/version.d.ts +1 -1
  144. package/dist/cjs/lib/version.js +1 -1
  145. package/dist/cjs/lib/version.js.map +1 -1
  146. package/dist/esm/lib/utils.d.ts +8 -0
  147. package/dist/esm/lib/utils.js +28 -0
  148. package/dist/esm/lib/utils.js.map +1 -1
  149. package/dist/esm/lib/v3/agent/AgentProvider.js +5 -3
  150. package/dist/esm/lib/v3/agent/AgentProvider.js.map +1 -1
  151. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js +10 -8
  152. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
  153. package/dist/esm/lib/v3/agent/GoogleCUAClient.js +124 -28
  154. package/dist/esm/lib/v3/agent/GoogleCUAClient.js.map +1 -1
  155. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.d.ts +35 -0
  156. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.js +35 -0
  157. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.js.map +1 -0
  158. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js +10 -1
  159. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -1
  160. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.d.ts +19 -0
  161. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.js +50 -0
  162. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.js.map +1 -0
  163. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.d.ts +2 -0
  164. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.js +59 -0
  165. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.js.map +1 -0
  166. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.d.ts +3 -0
  167. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.js +22 -0
  168. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.js.map +1 -0
  169. package/dist/esm/lib/v3/api.d.ts +1 -0
  170. package/dist/esm/lib/v3/api.js +38 -17
  171. package/dist/esm/lib/v3/api.js.map +1 -1
  172. package/dist/esm/lib/v3/cache/ActCache.js +2 -2
  173. package/dist/esm/lib/v3/cache/ActCache.js.map +1 -1
  174. package/dist/esm/lib/v3/cache/utils.d.ts +7 -0
  175. package/dist/esm/lib/v3/cache/utils.js +18 -0
  176. package/dist/esm/lib/v3/cache/utils.js.map +1 -1
  177. package/dist/esm/lib/v3/dom/build/locatorScripts.generated.d.ts +24 -24
  178. package/dist/esm/lib/v3/dom/build/locatorScripts.generated.js +24 -24
  179. package/dist/esm/lib/v3/dom/build/locatorScripts.generated.js.map +1 -1
  180. package/dist/esm/lib/v3/dom/locatorScripts/xpathResolver.js +79 -10
  181. package/dist/esm/lib/v3/dom/locatorScripts/xpathResolver.js.map +1 -1
  182. package/dist/esm/lib/v3/handlers/v3AgentHandler.d.ts +3 -1
  183. package/dist/esm/lib/v3/handlers/v3AgentHandler.js +108 -16
  184. package/dist/esm/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  185. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.d.ts +11 -0
  186. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js +119 -5
  187. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  188. package/dist/esm/lib/v3/index.d.ts +13 -1
  189. package/dist/esm/lib/v3/index.js +10 -0
  190. package/dist/esm/lib/v3/index.js.map +1 -1
  191. package/dist/esm/lib/v3/launch/local.js +1 -0
  192. package/dist/esm/lib/v3/launch/local.js.map +1 -1
  193. package/dist/esm/lib/v3/llm/LLMProvider.d.ts +3 -0
  194. package/dist/esm/lib/v3/llm/LLMProvider.js +44 -3
  195. package/dist/esm/lib/v3/llm/LLMProvider.js.map +1 -1
  196. package/dist/esm/lib/v3/llm/aisdk.js +4 -0
  197. package/dist/esm/lib/v3/llm/aisdk.js.map +1 -1
  198. package/dist/esm/lib/v3/llm/anthropicOptions.d.ts +57 -0
  199. package/dist/esm/lib/v3/llm/anthropicOptions.js +106 -0
  200. package/dist/esm/lib/v3/llm/anthropicOptions.js.map +1 -0
  201. package/dist/esm/lib/v3/types/public/agent.d.ts +8 -2
  202. package/dist/esm/lib/v3/types/public/agent.js +3 -0
  203. package/dist/esm/lib/v3/types/public/agent.js.map +1 -1
  204. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.d.ts +85 -0
  205. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.js +14 -0
  206. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.js.map +1 -0
  207. package/dist/esm/lib/v3/types/public/api.d.ts +925 -182
  208. package/dist/esm/lib/v3/types/public/api.js +136 -18
  209. package/dist/esm/lib/v3/types/public/api.js.map +1 -1
  210. package/dist/esm/lib/v3/types/public/clipboard.d.ts +15 -0
  211. package/dist/esm/lib/v3/types/public/clipboard.js +2 -0
  212. package/dist/esm/lib/v3/types/public/clipboard.js.map +1 -0
  213. package/dist/esm/lib/v3/types/public/index.d.ts +2 -0
  214. package/dist/esm/lib/v3/types/public/index.js +2 -0
  215. package/dist/esm/lib/v3/types/public/index.js.map +1 -1
  216. package/dist/esm/lib/v3/types/public/model.d.ts +33 -8
  217. package/dist/esm/lib/v3/types/public/model.js.map +1 -1
  218. package/dist/esm/lib/v3/types/public/page.d.ts +29 -0
  219. package/dist/esm/lib/v3/types/public/page.js.map +1 -1
  220. package/dist/esm/lib/v3/types/public/sdkErrors.d.ts +3 -0
  221. package/dist/esm/lib/v3/types/public/sdkErrors.js +5 -0
  222. package/dist/esm/lib/v3/types/public/sdkErrors.js.map +1 -1
  223. package/dist/esm/lib/v3/understudy/clipboard.d.ts +24 -0
  224. package/dist/esm/lib/v3/understudy/clipboard.js +163 -0
  225. package/dist/esm/lib/v3/understudy/clipboard.js.map +1 -0
  226. package/dist/esm/lib/v3/understudy/context.d.ts +3 -0
  227. package/dist/esm/lib/v3/understudy/context.js +15 -0
  228. package/dist/esm/lib/v3/understudy/context.js.map +1 -1
  229. package/dist/esm/lib/v3/understudy/page.d.ts +23 -1
  230. package/dist/esm/lib/v3/understudy/page.js +284 -1
  231. package/dist/esm/lib/v3/understudy/page.js.map +1 -1
  232. package/dist/esm/lib/v3/v3.js +20 -8
  233. package/dist/esm/lib/v3/v3.js.map +1 -1
  234. package/dist/esm/lib/v3/verifier/errorTaxonomy.d.ts +35 -0
  235. package/dist/esm/lib/v3/verifier/errorTaxonomy.js +285 -0
  236. package/dist/esm/lib/v3/verifier/errorTaxonomy.js.map +1 -0
  237. package/dist/esm/lib/v3/verifier/evidence.d.ts +44 -0
  238. package/dist/esm/lib/v3/verifier/evidence.js +393 -0
  239. package/dist/esm/lib/v3/verifier/evidence.js.map +1 -0
  240. package/dist/esm/lib/v3/verifier/evidenceNormalization.d.ts +7 -0
  241. package/dist/esm/lib/v3/verifier/evidenceNormalization.js +93 -0
  242. package/dist/esm/lib/v3/verifier/evidenceNormalization.js.map +1 -0
  243. package/dist/esm/lib/v3/verifier/index.d.ts +6 -0
  244. package/dist/esm/lib/v3/verifier/index.js +3 -0
  245. package/dist/esm/lib/v3/verifier/index.js.map +1 -0
  246. package/dist/esm/lib/v3/verifier/prompts/batchedRelevance.d.ts +21 -0
  247. package/dist/esm/lib/v3/verifier/prompts/batchedRelevance.js +68 -0
  248. package/dist/esm/lib/v3/verifier/prompts/batchedRelevance.js.map +1 -0
  249. package/dist/esm/lib/v3/verifier/prompts/firstPointOfFailure.d.ts +3 -0
  250. package/dist/esm/lib/v3/verifier/prompts/firstPointOfFailure.js +162 -0
  251. package/dist/esm/lib/v3/verifier/prompts/firstPointOfFailure.js.map +1 -0
  252. package/dist/esm/lib/v3/verifier/prompts/fusedJudgment.d.ts +35 -0
  253. package/dist/esm/lib/v3/verifier/prompts/fusedJudgment.js +155 -0
  254. package/dist/esm/lib/v3/verifier/prompts/fusedJudgment.js.map +1 -0
  255. package/dist/esm/lib/v3/verifier/prompts/fusedOutcome.d.ts +26 -0
  256. package/dist/esm/lib/v3/verifier/prompts/fusedOutcome.js +134 -0
  257. package/dist/esm/lib/v3/verifier/prompts/fusedOutcome.js.map +1 -0
  258. package/dist/esm/lib/v3/verifier/prompts/index.d.ts +8 -0
  259. package/dist/esm/lib/v3/verifier/prompts/index.js +9 -0
  260. package/dist/esm/lib/v3/verifier/prompts/index.js.map +1 -0
  261. package/dist/esm/lib/v3/verifier/prompts/perCriterionScore.d.ts +23 -0
  262. package/dist/esm/lib/v3/verifier/prompts/perCriterionScore.js +74 -0
  263. package/dist/esm/lib/v3/verifier/prompts/perCriterionScore.js.map +1 -0
  264. package/dist/esm/lib/v3/verifier/prompts/render.d.ts +23 -0
  265. package/dist/esm/lib/v3/verifier/prompts/render.js +41 -0
  266. package/dist/esm/lib/v3/verifier/prompts/render.js.map +1 -0
  267. package/dist/esm/lib/v3/verifier/prompts/rubricGeneration.d.ts +16 -0
  268. package/dist/esm/lib/v3/verifier/prompts/rubricGeneration.js +318 -0
  269. package/dist/esm/lib/v3/verifier/prompts/rubricGeneration.js.map +1 -0
  270. package/dist/esm/lib/v3/verifier/prompts/taskValidity.d.ts +1 -0
  271. package/dist/esm/lib/v3/verifier/prompts/taskValidity.js +113 -0
  272. package/dist/esm/lib/v3/verifier/prompts/taskValidity.js.map +1 -0
  273. package/dist/esm/lib/v3/verifier/rubricVerifier.d.ts +91 -0
  274. package/dist/esm/lib/v3/verifier/rubricVerifier.js +1640 -0
  275. package/dist/esm/lib/v3/verifier/rubricVerifier.js.map +1 -0
  276. package/dist/esm/lib/v3/verifier/trajectory.d.ts +50 -0
  277. package/dist/esm/lib/v3/verifier/trajectory.js +273 -0
  278. package/dist/esm/lib/v3/verifier/trajectory.js.map +1 -0
  279. package/dist/esm/lib/v3/verifier/types.d.ts +429 -0
  280. package/dist/esm/lib/v3/verifier/types.js +2 -0
  281. package/dist/esm/lib/v3/verifier/types.js.map +1 -0
  282. package/dist/esm/lib/v3Evaluator.d.ts +14 -4
  283. package/dist/esm/lib/v3Evaluator.js +189 -1
  284. package/dist/esm/lib/v3Evaluator.js.map +1 -1
  285. package/dist/esm/lib/v3LegacyEvaluator.js +5 -1
  286. package/dist/esm/lib/v3LegacyEvaluator.js.map +1 -1
  287. package/dist/esm/lib/version.d.ts +1 -1
  288. package/dist/esm/lib/version.js +1 -1
  289. package/dist/esm/lib/version.js.map +1 -1
  290. package/package.json +18 -12
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Batched evidence-relevance prompt — replacement for the per-screenshot
3
+ * MM_SCREENSHOT_CRITERION_RELEVANCE_PROMPT.
4
+ *
5
+ * One call grades the relevance of B evidence points (mixed image + text)
6
+ * against all N rubric criteria. Reduces Step 2 cost from M calls to
7
+ * ⌈M / B⌉ calls. Each evidence point in the batch is labelled with an
8
+ * `evidence_idx` (0..B-1) the model must echo back so we can join the
9
+ * scores to the right evidence.
10
+ *
11
+ * Variables:
12
+ * - task_definition — task instruction string
13
+ * - init_url_context — optional "Starting URL: ..." appendix
14
+ * - rubric_criteria — numbered list of criteria ("\n{idx}. **{name}**\n Description: {desc}\n")
15
+ * - evidence_manifest — textual list describing each evidence point in the
16
+ * batch: kind (image/text), source (probe/agent),
17
+ * step index, brief preview. Lets the model line up
18
+ * the inline images/text with the `evidence_idx`
19
+ * it's expected to score.
20
+ */
21
+ export declare const MM_BATCHED_RELEVANCE_PROMPT = "Task: $task_definition$init_url_context\n\nYou are analyzing a batch of evidence points (screenshots and text snippets) from an agent's trajectory to determine which rubric criteria each evidence point helps evaluate.\n\n**Rubric Criteria:**\n$rubric_criteria\n\n**Evidence Points in This Batch:**\n$evidence_manifest\n\nThe evidence is presented to you in order: each image / text block in this message corresponds to one entry in the manifest above, identified by its `evidence_idx`.\n\n**Your Task:**\nFor EACH evidence point in the batch, assign a relevance score from 0\u201310 against EACH criterion.\n\n**Scoring Guidelines:**\n- **10**: Evidence directly shows critical proof for this criterion (e.g., shows the exact item, cart contents, confirmation page, the filled form field).\n- **7-9**: Evidence shows important contextual information for this criterion (search results, applied filters, navigation state).\n- **4-6**: Evidence shows partial / related information for this criterion.\n- **1-3**: Evidence shows minimal relevance to this criterion.\n- **0**: Evidence is completely irrelevant to this criterion.\n\n**Important:**\n- An evidence point can be highly relevant to multiple criteria.\n- Focus on what is VISIBLE in the screenshot or PRESENT in the text snippet, not what the agent claimed.\n- Text-form evidence (e.g., accessibility tree snippets, agent text, JSON tool outputs) is especially relevant for criteria asking \"is this field filled with X?\", \"does the page contain Y?\", or \"did the tool return X?\" \u2014 score it accordingly.\n\n**Output Format:**\nOutput a JSON object with an `items` list. One entry per evidence point in the batch:\n\n{{\n \"items\": [\n {{\n \"evidence_idx\": 0,\n \"scores\": [\n {{ \"criterion_idx\": 0, \"score\": 7 }},\n {{ \"criterion_idx\": 1, \"score\": 2 }}\n ]\n }},\n ...one entry per evidence point...\n ]\n}}\n\nYou MUST include an entry for every `evidence_idx` listed in the manifest, and every criterion_idx in each `scores` list.\n\nDO NOT OUTPUT ANYTHING OTHER THAN JSON.\n";
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MM_BATCHED_RELEVANCE_PROMPT = void 0;
4
+ /**
5
+ * Batched evidence-relevance prompt — replacement for the per-screenshot
6
+ * MM_SCREENSHOT_CRITERION_RELEVANCE_PROMPT.
7
+ *
8
+ * One call grades the relevance of B evidence points (mixed image + text)
9
+ * against all N rubric criteria. Reduces Step 2 cost from M calls to
10
+ * ⌈M / B⌉ calls. Each evidence point in the batch is labelled with an
11
+ * `evidence_idx` (0..B-1) the model must echo back so we can join the
12
+ * scores to the right evidence.
13
+ *
14
+ * Variables:
15
+ * - task_definition — task instruction string
16
+ * - init_url_context — optional "Starting URL: ..." appendix
17
+ * - rubric_criteria — numbered list of criteria ("\n{idx}. **{name}**\n Description: {desc}\n")
18
+ * - evidence_manifest — textual list describing each evidence point in the
19
+ * batch: kind (image/text), source (probe/agent),
20
+ * step index, brief preview. Lets the model line up
21
+ * the inline images/text with the `evidence_idx`
22
+ * it's expected to score.
23
+ */
24
+ exports.MM_BATCHED_RELEVANCE_PROMPT = `Task: $task_definition$init_url_context
25
+
26
+ You are analyzing a batch of evidence points (screenshots and text snippets) from an agent's trajectory to determine which rubric criteria each evidence point helps evaluate.
27
+
28
+ **Rubric Criteria:**
29
+ $rubric_criteria
30
+
31
+ **Evidence Points in This Batch:**
32
+ $evidence_manifest
33
+
34
+ The evidence is presented to you in order: each image / text block in this message corresponds to one entry in the manifest above, identified by its \`evidence_idx\`.
35
+
36
+ **Your Task:**
37
+ For EACH evidence point in the batch, assign a relevance score from 0–10 against EACH criterion.
38
+
39
+ **Scoring Guidelines:**
40
+ - **10**: Evidence directly shows critical proof for this criterion (e.g., shows the exact item, cart contents, confirmation page, the filled form field).
41
+ - **7-9**: Evidence shows important contextual information for this criterion (search results, applied filters, navigation state).
42
+ - **4-6**: Evidence shows partial / related information for this criterion.
43
+ - **1-3**: Evidence shows minimal relevance to this criterion.
44
+ - **0**: Evidence is completely irrelevant to this criterion.
45
+
46
+ **Important:**
47
+ - An evidence point can be highly relevant to multiple criteria.
48
+ - Focus on what is VISIBLE in the screenshot or PRESENT in the text snippet, not what the agent claimed.
49
+ - Text-form evidence (e.g., accessibility tree snippets, agent text, JSON tool outputs) is especially relevant for criteria asking "is this field filled with X?", "does the page contain Y?", or "did the tool return X?" — score it accordingly.
50
+
51
+ **Output Format:**
52
+ Output a JSON object with an \`items\` list. One entry per evidence point in the batch:
53
+
54
+ {{
55
+ "items": [
56
+ {{
57
+ "evidence_idx": 0,
58
+ "scores": [
59
+ {{ "criterion_idx": 0, "score": 7 }},
60
+ {{ "criterion_idx": 1, "score": 2 }}
61
+ ]
62
+ }},
63
+ ...one entry per evidence point...
64
+ ]
65
+ }}
66
+
67
+ You MUST include an entry for every \`evidence_idx\` listed in the manifest, and every criterion_idx in each \`scores\` list.
68
+
69
+ DO NOT OUTPUT ANYTHING OTHER THAN JSON.
70
+ `;
71
+ //# sourceMappingURL=batchedRelevance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batchedRelevance.js","sourceRoot":"","sources":["../../../../../../lib/v3/verifier/prompts/batchedRelevance.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8C1C,CAAC","sourcesContent":["/**\n * Batched evidence-relevance prompt — replacement for the per-screenshot\n * MM_SCREENSHOT_CRITERION_RELEVANCE_PROMPT.\n *\n * One call grades the relevance of B evidence points (mixed image + text)\n * against all N rubric criteria. Reduces Step 2 cost from M calls to\n * ⌈M / B⌉ calls. Each evidence point in the batch is labelled with an\n * `evidence_idx` (0..B-1) the model must echo back so we can join the\n * scores to the right evidence.\n *\n * Variables:\n * - task_definition — task instruction string\n * - init_url_context — optional \"Starting URL: ...\" appendix\n * - rubric_criteria — numbered list of criteria (\"\\n{idx}. **{name}**\\n Description: {desc}\\n\")\n * - evidence_manifest — textual list describing each evidence point in the\n * batch: kind (image/text), source (probe/agent),\n * step index, brief preview. Lets the model line up\n * the inline images/text with the `evidence_idx`\n * it's expected to score.\n */\nexport const MM_BATCHED_RELEVANCE_PROMPT = `Task: $task_definition$init_url_context\n\nYou are analyzing a batch of evidence points (screenshots and text snippets) from an agent's trajectory to determine which rubric criteria each evidence point helps evaluate.\n\n**Rubric Criteria:**\n$rubric_criteria\n\n**Evidence Points in This Batch:**\n$evidence_manifest\n\nThe evidence is presented to you in order: each image / text block in this message corresponds to one entry in the manifest above, identified by its \\`evidence_idx\\`.\n\n**Your Task:**\nFor EACH evidence point in the batch, assign a relevance score from 0–10 against EACH criterion.\n\n**Scoring Guidelines:**\n- **10**: Evidence directly shows critical proof for this criterion (e.g., shows the exact item, cart contents, confirmation page, the filled form field).\n- **7-9**: Evidence shows important contextual information for this criterion (search results, applied filters, navigation state).\n- **4-6**: Evidence shows partial / related information for this criterion.\n- **1-3**: Evidence shows minimal relevance to this criterion.\n- **0**: Evidence is completely irrelevant to this criterion.\n\n**Important:**\n- An evidence point can be highly relevant to multiple criteria.\n- Focus on what is VISIBLE in the screenshot or PRESENT in the text snippet, not what the agent claimed.\n- Text-form evidence (e.g., accessibility tree snippets, agent text, JSON tool outputs) is especially relevant for criteria asking \"is this field filled with X?\", \"does the page contain Y?\", or \"did the tool return X?\" — score it accordingly.\n\n**Output Format:**\nOutput a JSON object with an \\`items\\` list. One entry per evidence point in the batch:\n\n{{\n \"items\": [\n {{\n \"evidence_idx\": 0,\n \"scores\": [\n {{ \"criterion_idx\": 0, \"score\": 7 }},\n {{ \"criterion_idx\": 1, \"score\": 2 }}\n ]\n }},\n ...one entry per evidence point...\n ]\n}}\n\nYou MUST include an entry for every \\`evidence_idx\\` listed in the manifest, and every criterion_idx in each \\`scores\\` list.\n\nDO NOT OUTPUT ANYTHING OTHER THAN JSON.\n`;\n"]}
@@ -0,0 +1,3 @@
1
+ import type { ParseFailureStepNumbersOptions } from "../types.js";
2
+ export declare const FIRST_POINT_OF_FAILURE_PROMPT: string;
3
+ export declare function parseFailureStepNumbers(raw: string, opts?: ParseFailureStepNumbersOptions): number[];
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FIRST_POINT_OF_FAILURE_PROMPT = void 0;
4
+ exports.parseFailureStepNumbers = parseFailureStepNumbers;
5
+ /**
6
+ * First-point-of-failure prompt — Step 9a of the rubric verifier pipeline.
7
+ *
8
+ * Identifies ALL distinct failure points in a trajectory and pinpoints the
9
+ * earliest one (the "first" failure). Diagnostic signal only — does NOT
10
+ * affect scoring. Surfaced in EvaluationResult.firstPointOfFailure.
11
+ *
12
+ * Uses error-taxonomy categories 1–6 (the agent-controllable error space):
13
+ * Selection, Hallucination, Execution & Strategy, Critical Point,
14
+ * Side-Effect, Tool Interaction. Categories 7–8 (task ambiguity / invalid
15
+ * task) are handled by Steps 10 / 9b.
16
+ *
17
+ * The taxonomy is pre-rendered into the prompt body at module load time
18
+ * (the data is static). Variables substituted at call time:
19
+ * - task_definition
20
+ * - init_url_context
21
+ * - action_history
22
+ * - predicted_output
23
+ * - rubric_summary
24
+ * - evidence_summary
25
+ * - outcome_verification
26
+ */
27
+ const errorTaxonomy_js_1 = require("../errorTaxonomy.js");
28
+ // Pre-render the taxonomy + summary table (categories 1–6) once at load.
29
+ const TAXONOMY_TEXT = (0, errorTaxonomy_js_1.getTaxonomyText)(1, 6, 3);
30
+ const SUMMARY_TABLE = (0, errorTaxonomy_js_1.getSummaryTable)(1, 6);
31
+ exports.FIRST_POINT_OF_FAILURE_PROMPT = `You are an expert failure analyst for computer-use web agents. You will analyze a single task trajectory to identify all failure points and pinpoint the first (earliest) point of failure.
32
+
33
+ You are given:
34
+ - The task the agent was asked to complete
35
+ - The agent's full step-by-step action history (each step has a step number, the agent's reasoning, the action taken, the URL, and a human-readable description)
36
+ - The agent's predicted output (final answer)
37
+ - A scored rubric with multimodal screenshot evidence showing how the agent performed on each criterion
38
+ - The outcome verification result (whether the task was deemed successful overall)
39
+
40
+ Your job is to identify **every distinct failure point** in the trajectory, pinpoint the **exact step number(s)** where it occurred, classify it using the error taxonomy below, and determine which failure occurred **first** (earliest step number).
41
+
42
+ **Calibration:** ${errorTaxonomy_js_1.CALIBRATION_NOTE}
43
+
44
+ ## Error Taxonomy
45
+
46
+ ${TAXONOMY_TEXT}
47
+
48
+ ${SUMMARY_TABLE}
49
+
50
+ ## Context
51
+
52
+ Task: "$task_definition"$init_url_context
53
+
54
+ Action History: >>>
55
+ $action_history
56
+ <<<
57
+
58
+ Predicted Output: >>>
59
+ $predicted_output
60
+ <<<
61
+
62
+ Scored Rubric (post-multimodal verification): >>>
63
+ $rubric_summary
64
+ <<<
65
+
66
+ Screenshot Evidence by Criterion: >>>
67
+ $evidence_summary
68
+ <<<
69
+
70
+ Outcome Verification Result: >>>
71
+ $outcome_verification
72
+ <<<
73
+
74
+ ## Instructions
75
+
76
+ Analyze the trajectory and identify ALL distinct failure points. For each failure point:
77
+ 1. Identify the exact step number(s) in the action history where the failure occurred.
78
+ 2. Classify it using the error taxonomy above (use exact category and error type names).
79
+ 3. Ground your classification in concrete evidence (screenshot index, action-history quote, or tool output).
80
+
81
+ **IMPORTANT**
82
+ Output your answer in pure JSON format according to the following schema. The JSON object must be parsable as-is. DO NOT OUTPUT ANYTHING OTHER THAN JSON, AND DO NOT DEVIATE FROM THIS SCHEMA:
83
+
84
+ {{
85
+ "reasoning": str,
86
+ "has_failure": bool,
87
+ "failure_points": [
88
+ {{
89
+ "step_numbers": str,
90
+ "error_code": str,
91
+ "error_category": str,
92
+ "error_type": str,
93
+ "what_happened": str,
94
+ "agent_reasoning": str,
95
+ "evidence": str,
96
+ "impact": str
97
+ }}
98
+ ]
99
+ }}
100
+ `;
101
+ /**
102
+ * Parse the model's flexible step-numbers field into a sorted array of step
103
+ * indices.
104
+ *
105
+ * Accepts:
106
+ * "5" → [5]
107
+ * "5-7" → [5, 6, 7]
108
+ * "5,8,12" → [5, 8, 12]
109
+ * "5,7-9,12" → [5, 7, 8, 9, 12]
110
+ *
111
+ * Returns an empty array for unparseable input rather than throwing — failure
112
+ * analysis is best-effort and a malformed step-numbers field shouldn't tank
113
+ * the whole EvaluationResult.
114
+ */
115
+ const DEFAULT_MAX_EXPANDED_STEPS = 1000;
116
+ function parseFailureStepNumbers(raw, opts = {}) {
117
+ if (typeof raw !== "string" || raw.length === 0)
118
+ return [];
119
+ const maxExpandedSteps = sanitizeNonNegativeInt(opts.maxExpandedSteps, DEFAULT_MAX_EXPANDED_STEPS);
120
+ if (maxExpandedSteps === 0)
121
+ return [];
122
+ const maxStep = opts.maxStep === undefined
123
+ ? undefined
124
+ : sanitizeNonNegativeInt(opts.maxStep, 0);
125
+ const out = new Set();
126
+ const addStep = (n) => {
127
+ if (!Number.isFinite(n) || n < 0)
128
+ return out.size < maxExpandedSteps;
129
+ if (maxStep !== undefined && n > maxStep)
130
+ return out.size < maxExpandedSteps;
131
+ out.add(n);
132
+ return out.size < maxExpandedSteps;
133
+ };
134
+ for (const segment of raw.split(",")) {
135
+ const seg = segment.trim();
136
+ if (!seg)
137
+ continue;
138
+ const dashIdx = seg.indexOf("-");
139
+ if (dashIdx > 0) {
140
+ const lo = Number.parseInt(seg.slice(0, dashIdx), 10);
141
+ const hi = Number.parseInt(seg.slice(dashIdx + 1), 10);
142
+ if (Number.isFinite(lo) && Number.isFinite(hi) && lo <= hi) {
143
+ const cappedHi = Math.min(hi, maxStep ?? hi, lo + (maxExpandedSteps - out.size) - 1);
144
+ for (let i = lo; i <= cappedHi; i++) {
145
+ if (!addStep(i))
146
+ break;
147
+ }
148
+ }
149
+ }
150
+ else {
151
+ const n = Number.parseInt(seg, 10);
152
+ if (!addStep(n))
153
+ break;
154
+ }
155
+ if (out.size >= maxExpandedSteps)
156
+ break;
157
+ }
158
+ // De-dup + sort ascending.
159
+ return Array.from(out).sort((a, b) => a - b);
160
+ }
161
+ function sanitizeNonNegativeInt(value, fallback) {
162
+ if (value === undefined || !Number.isFinite(value))
163
+ return fallback;
164
+ return Math.max(0, Math.floor(value));
165
+ }
166
+ //# sourceMappingURL=firstPointOfFailure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firstPointOfFailure.js","sourceRoot":"","sources":["../../../../../../lib/v3/verifier/prompts/firstPointOfFailure.ts"],"names":[],"mappings":";;;AAwHA,0DA+CC;AAvKD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,0DAI6B;AAG7B,yEAAyE;AACzE,MAAM,aAAa,GAAG,IAAA,kCAAe,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/C,MAAM,aAAa,GAAG,IAAA,kCAAe,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,QAAA,6BAA6B,GAAG;;;;;;;;;;;mBAW1B,mCAAgB;;;;EAIjC,aAAa;;EAEb,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDd,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAExC,SAAgB,uBAAuB,CACrC,GAAW,EACX,OAAuC,EAAE;IAEzC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC3D,MAAM,gBAAgB,GAAG,sBAAsB,CAC7C,IAAI,CAAC,gBAAgB,EACrB,0BAA0B,CAC3B,CAAC;IACF,IAAI,gBAAgB,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,MAAM,OAAO,GACX,IAAI,CAAC,OAAO,KAAK,SAAS;QACxB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,MAAM,OAAO,GAAG,CAAC,CAAS,EAAW,EAAE;QACrC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC,IAAI,GAAG,gBAAgB,CAAC;QACrE,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,GAAG,OAAO;YACtC,OAAO,GAAG,CAAC,IAAI,GAAG,gBAAgB,CAAC;QACrC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACX,OAAO,GAAG,CAAC,IAAI,GAAG,gBAAgB,CAAC;IACrC,CAAC,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YAChB,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;YACtD,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvD,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;gBAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACvB,EAAE,EACF,OAAO,IAAI,EAAE,EACb,EAAE,GAAG,CAAC,gBAAgB,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CACvC,CAAC;gBACF,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;oBACpC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBAAE,MAAM;gBACzB,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACnC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAAE,MAAM;QACzB,CAAC;QACD,IAAI,GAAG,CAAC,IAAI,IAAI,gBAAgB;YAAE,MAAM;IAC1C,CAAC;IACD,2BAA2B;IAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,sBAAsB,CAC7B,KAAyB,EACzB,QAAgB;IAEhB,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACpE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/**\n * First-point-of-failure prompt — Step 9a of the rubric verifier pipeline.\n *\n * Identifies ALL distinct failure points in a trajectory and pinpoints the\n * earliest one (the \"first\" failure). Diagnostic signal only — does NOT\n * affect scoring. Surfaced in EvaluationResult.firstPointOfFailure.\n *\n * Uses error-taxonomy categories 1–6 (the agent-controllable error space):\n * Selection, Hallucination, Execution & Strategy, Critical Point,\n * Side-Effect, Tool Interaction. Categories 7–8 (task ambiguity / invalid\n * task) are handled by Steps 10 / 9b.\n *\n * The taxonomy is pre-rendered into the prompt body at module load time\n * (the data is static). Variables substituted at call time:\n * - task_definition\n * - init_url_context\n * - action_history\n * - predicted_output\n * - rubric_summary\n * - evidence_summary\n * - outcome_verification\n */\nimport {\n CALIBRATION_NOTE,\n getSummaryTable,\n getTaxonomyText,\n} from \"../errorTaxonomy.js\";\nimport type { ParseFailureStepNumbersOptions } from \"../types.js\";\n\n// Pre-render the taxonomy + summary table (categories 1–6) once at load.\nconst TAXONOMY_TEXT = getTaxonomyText(1, 6, 3);\nconst SUMMARY_TABLE = getSummaryTable(1, 6);\n\nexport const FIRST_POINT_OF_FAILURE_PROMPT = `You are an expert failure analyst for computer-use web agents. You will analyze a single task trajectory to identify all failure points and pinpoint the first (earliest) point of failure.\n\nYou are given:\n- The task the agent was asked to complete\n- The agent's full step-by-step action history (each step has a step number, the agent's reasoning, the action taken, the URL, and a human-readable description)\n- The agent's predicted output (final answer)\n- A scored rubric with multimodal screenshot evidence showing how the agent performed on each criterion\n- The outcome verification result (whether the task was deemed successful overall)\n\nYour job is to identify **every distinct failure point** in the trajectory, pinpoint the **exact step number(s)** where it occurred, classify it using the error taxonomy below, and determine which failure occurred **first** (earliest step number).\n\n**Calibration:** ${CALIBRATION_NOTE}\n\n## Error Taxonomy\n\n${TAXONOMY_TEXT}\n\n${SUMMARY_TABLE}\n\n## Context\n\nTask: \"$task_definition\"$init_url_context\n\nAction History: >>>\n$action_history\n<<<\n\nPredicted Output: >>>\n$predicted_output\n<<<\n\nScored Rubric (post-multimodal verification): >>>\n$rubric_summary\n<<<\n\nScreenshot Evidence by Criterion: >>>\n$evidence_summary\n<<<\n\nOutcome Verification Result: >>>\n$outcome_verification\n<<<\n\n## Instructions\n\nAnalyze the trajectory and identify ALL distinct failure points. For each failure point:\n1. Identify the exact step number(s) in the action history where the failure occurred.\n2. Classify it using the error taxonomy above (use exact category and error type names).\n3. Ground your classification in concrete evidence (screenshot index, action-history quote, or tool output).\n\n**IMPORTANT**\nOutput your answer in pure JSON format according to the following schema. The JSON object must be parsable as-is. DO NOT OUTPUT ANYTHING OTHER THAN JSON, AND DO NOT DEVIATE FROM THIS SCHEMA:\n\n{{\n \"reasoning\": str,\n \"has_failure\": bool,\n \"failure_points\": [\n {{\n \"step_numbers\": str,\n \"error_code\": str,\n \"error_category\": str,\n \"error_type\": str,\n \"what_happened\": str,\n \"agent_reasoning\": str,\n \"evidence\": str,\n \"impact\": str\n }}\n ]\n}}\n`;\n\n/**\n * Parse the model's flexible step-numbers field into a sorted array of step\n * indices.\n *\n * Accepts:\n * \"5\" → [5]\n * \"5-7\" → [5, 6, 7]\n * \"5,8,12\" → [5, 8, 12]\n * \"5,7-9,12\" → [5, 7, 8, 9, 12]\n *\n * Returns an empty array for unparseable input rather than throwing — failure\n * analysis is best-effort and a malformed step-numbers field shouldn't tank\n * the whole EvaluationResult.\n */\nconst DEFAULT_MAX_EXPANDED_STEPS = 1000;\n\nexport function parseFailureStepNumbers(\n raw: string,\n opts: ParseFailureStepNumbersOptions = {},\n): number[] {\n if (typeof raw !== \"string\" || raw.length === 0) return [];\n const maxExpandedSteps = sanitizeNonNegativeInt(\n opts.maxExpandedSteps,\n DEFAULT_MAX_EXPANDED_STEPS,\n );\n if (maxExpandedSteps === 0) return [];\n const maxStep =\n opts.maxStep === undefined\n ? undefined\n : sanitizeNonNegativeInt(opts.maxStep, 0);\n const out = new Set<number>();\n const addStep = (n: number): boolean => {\n if (!Number.isFinite(n) || n < 0) return out.size < maxExpandedSteps;\n if (maxStep !== undefined && n > maxStep)\n return out.size < maxExpandedSteps;\n out.add(n);\n return out.size < maxExpandedSteps;\n };\n for (const segment of raw.split(\",\")) {\n const seg = segment.trim();\n if (!seg) continue;\n const dashIdx = seg.indexOf(\"-\");\n if (dashIdx > 0) {\n const lo = Number.parseInt(seg.slice(0, dashIdx), 10);\n const hi = Number.parseInt(seg.slice(dashIdx + 1), 10);\n if (Number.isFinite(lo) && Number.isFinite(hi) && lo <= hi) {\n const cappedHi = Math.min(\n hi,\n maxStep ?? hi,\n lo + (maxExpandedSteps - out.size) - 1,\n );\n for (let i = lo; i <= cappedHi; i++) {\n if (!addStep(i)) break;\n }\n }\n } else {\n const n = Number.parseInt(seg, 10);\n if (!addStep(n)) break;\n }\n if (out.size >= maxExpandedSteps) break;\n }\n // De-dup + sort ascending.\n return Array.from(out).sort((a, b) => a - b);\n}\n\nfunction sanitizeNonNegativeInt(\n value: number | undefined,\n fallback: number,\n): number {\n if (value === undefined || !Number.isFinite(value)) return fallback;\n return Math.max(0, Math.floor(value));\n}\n"]}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Fused judgment prompt — Approach B's single-call replacement for
3
+ * Steps 4+6+8 (and optionally folded 9a + 10).
4
+ *
5
+ * One multimodal call grades every rubric criterion, emits an independent
6
+ * outcome verdict, surfaces findings, optionally identifies the first point
7
+ * of failure, and optionally classifies task validity. The structured
8
+ * response is rich enough to populate the full `EvaluationResult` object without
9
+ * additional LLM calls.
10
+ *
11
+ * Variables:
12
+ * - task_definition — instruction string
13
+ * - init_url_context — "Starting URL: ..." or empty
14
+ * - action_history — compact textual action history
15
+ * - agent_predicted_output — agent's final answer / message
16
+ * - rubric_block — full rubric: index, criterion, description,
17
+ * max_points, optional condition
18
+ * - evidence_block — per-criterion top-K evidence manifest
19
+ * (image refs + ariaTree snippets). Each image
20
+ * in the message body is keyed by its label
21
+ * here (e.g., "Evidence #3 — step=12, probe").
22
+ * - taxonomy_block — error taxonomy text (only when
23
+ * fold_failure_analysis = true). Otherwise
24
+ * empty string.
25
+ * - fold_failure_analysis — "true" / "false" — whether to emit failure
26
+ * analysis in the response.
27
+ * - fold_task_validity — "true" / "false" — whether to emit task
28
+ * validity classification in the response.
29
+ * - final_state_block — always-attached final URL + ariaTree of the
30
+ * last step probe and finalObservation; this
31
+ * bypasses the per-criterion top-K selection
32
+ * so the judge always has the closing page
33
+ * content available.
34
+ */
35
+ export declare const FUSED_JUDGMENT_PROMPT = "Task: $task_definition$init_url_context\n\n**Current Date:** $current_date\n\nYou are an expert evaluator of web-navigation agent trajectories. You will grade the agent's run against a rubric, decide whether the overall task succeeded, and surface diagnostics \u2014 all in one structured response.\n\nUse the current date above to assess time-sensitive constraints in the task (e.g., a task referencing dates in the past relative to the current date is impossible \u2014 classify as task_validity.is_invalid with code 8.1).\n\n**Action History:**\n$action_history\n\n**Agent's Predicted Output (Final Answer):**\n$agent_predicted_output\n\n**Rubric:**\n$rubric_block\n\n**Evidence (grouped by criterion):**\n$evidence_block\n\nEach evidence reference points to an image attached below or to a text snippet inline above. Screenshots are listed in chronological order across the trajectory; when two screenshots show the same element, **the LATER screenshot reflects the final state and takes precedence**.\n\n**Final trajectory state** (authoritative \u2014 this is the page content and screenshot captured at the very end of the run; treat it as ground truth for what the agent saw on its final page, even if no `extract`/`observe` step appears in the action history):\n$final_state_block\n\n**Optional sections to include in the response:**\n- Failure analysis: $fold_failure_analysis\n- Task validity classification: $fold_task_validity\n\nWhen failure analysis is requested and you judge `output_success: false`, you must populate `failure_point` using the error taxonomy below:\n\n$taxonomy_block\n\nWhen task validity is requested, you must populate `task_validity` with the booleans `is_ambiguous` / `is_invalid` and, when each is true, a single one-line free-form reason in `ambiguity_reason` / `invalid_reason` (e.g., \"Requested dates are in the past relative to the current date\"). Leave the reason field empty when the corresponding flag is false.\n\n---\n\n**Core Evaluation Principles** (these OVERRIDE the criterion descriptions when they conflict):\n\n1. **Best Effort Evaluation.** The agent should be evaluated on helpfulness and effort within constraints it cannot control.\n\n2. **Uncontrollable Blockers** (award full credit when these prevent task completion): platform issues (site down, CAPTCHA, login walls), entity non-existence, availability constraints (out of stock, sold out), platform limitations. If screenshots CONFIRM the blocker, award full credit even for downstream dependent criteria.\n\n3. **Controllable Failures** (penalize): wrong selections when correct options are available, poor execution (not using filters, not attempting specified platforms), hallucinations (claiming success without evidence), insufficient effort.\n\n4. **Tasks with Explicit Constraints.** Distinguish \"searched for the constraint\" from \"found results that actually satisfy it\". If the hard constraint is NOT met in the evidence, award only minimal partial credit for the search effort.\n\n5. **Ambiguous Wording \u2014 Don't Penalize for One Valid Interpretation.** If the task has multiple defensible readings, the agent picking one is fine.\n\n6. **Cascading Dependencies:**\n - Scenario A: Blocker is uncontrollable \u2192 award full credit for downstream criteria that couldn't be attempted.\n - Scenario B: Blocker is a controllable error \u2192 cascade partial/zero credit downstream.\n - Scenario C: Don't re-penalize for the same deviation across multiple criteria.\n - Scenario D: Shared platform blockers across sibling sub-tasks \u2192 award full credit for all affected siblings.\n\n7. **Conditional Criteria.** Some criteria have a \"condition\" field. Only score them when the condition is met; otherwise mark the criterion as not applicable (give it max_points so it doesn't drag down the process score).\n\n8. **Distinguish nitpicks from critical errors:**\n - Only nitpicks \u2192 75\u2013100% of max\n - Correct approach, wrong final answer \u2192 40\u201380%\n - Critical error \u2192 penalize per severity\n - Mix of nitpicks + a critical error \u2192 score based on the critical error\n\n**Outcome Judgment:**\n\n`output_success` is your independent binary verdict on whether the agent completed the task. It is informed by the per-criterion scores but is not a function of them \u2014 a task can have high process score and still fail (right approach, wrong final answer) or have lower process score and still succeed (the answer is right, intermediate steps were inelegant).\n\n**Findings:** Surface actionable patterns: failed tool usage, agent-strategy issues, rubric quality problems, capture gaps. Each finding gets a category, severity, description, and (optional) related steps + suggested action. Keep findings sparse and load-bearing.\n\n---\n\n**Output Format:**\n\nOutput one JSON object matching this schema. Include the optional sections only when requested above.\n\n{{\n \"outcome\": {{\n \"primary_intent\": \"<one-sentence restatement of what the task was asking for>\",\n \"reasoning\": \"<your reasoning for the success / failure verdict>\",\n \"output_success\": true,\n \"findings\": [\n {{\n \"category\": \"agent_tool_usage|agent_strategy|rubric_quality|trajectory_capture|task_specification|verifier_uncertainty|other\",\n \"severity\": \"info|warning|blocking\",\n \"description\": \"...\",\n \"suggestedAction\": \"...\",\n \"relatedSteps\": [3, 4]\n }}\n ]\n }},\n \"per_criterion\": [\n {{\n \"criterion_idx\": 0,\n \"applicable_evidence\": \"Which evidence is applicable; cite by 'Screenshot N \u2014 step=K' or aria-tree step number.\",\n \"justification\": \"How the visual / textual evidence supports your score.\",\n \"earned_points\": 4,\n \"evidence_sufficient\": true\n }}\n ],\n \"failure_point\": {{\n \"step_index\": 17,\n \"error_code\": \"1.4\",\n \"error_category\": \"Selection\",\n \"description\": \"<one-line description of what went wrong at this step>\"\n }},\n \"task_validity\": {{\n \"is_ambiguous\": false,\n \"ambiguity_reason\": \"\",\n \"is_invalid\": false,\n \"invalid_reason\": \"\"\n }}\n}}\n\n- Omit `failure_point` when `output_success` is true or when failure analysis was not requested.\n- Omit `task_validity` when task-validity classification was not requested.\n- You MUST emit exactly one `per_criterion` entry per rubric item, in rubric order.\n- `earned_points` must be in [0, max_points] for that criterion.\n\nDO NOT OUTPUT ANYTHING OTHER THAN JSON.\n";
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ /**
3
+ * Fused judgment prompt — Approach B's single-call replacement for
4
+ * Steps 4+6+8 (and optionally folded 9a + 10).
5
+ *
6
+ * One multimodal call grades every rubric criterion, emits an independent
7
+ * outcome verdict, surfaces findings, optionally identifies the first point
8
+ * of failure, and optionally classifies task validity. The structured
9
+ * response is rich enough to populate the full `EvaluationResult` object without
10
+ * additional LLM calls.
11
+ *
12
+ * Variables:
13
+ * - task_definition — instruction string
14
+ * - init_url_context — "Starting URL: ..." or empty
15
+ * - action_history — compact textual action history
16
+ * - agent_predicted_output — agent's final answer / message
17
+ * - rubric_block — full rubric: index, criterion, description,
18
+ * max_points, optional condition
19
+ * - evidence_block — per-criterion top-K evidence manifest
20
+ * (image refs + ariaTree snippets). Each image
21
+ * in the message body is keyed by its label
22
+ * here (e.g., "Evidence #3 — step=12, probe").
23
+ * - taxonomy_block — error taxonomy text (only when
24
+ * fold_failure_analysis = true). Otherwise
25
+ * empty string.
26
+ * - fold_failure_analysis — "true" / "false" — whether to emit failure
27
+ * analysis in the response.
28
+ * - fold_task_validity — "true" / "false" — whether to emit task
29
+ * validity classification in the response.
30
+ * - final_state_block — always-attached final URL + ariaTree of the
31
+ * last step probe and finalObservation; this
32
+ * bypasses the per-criterion top-K selection
33
+ * so the judge always has the closing page
34
+ * content available.
35
+ */
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.FUSED_JUDGMENT_PROMPT = void 0;
38
+ exports.FUSED_JUDGMENT_PROMPT = `Task: $task_definition$init_url_context
39
+
40
+ **Current Date:** $current_date
41
+
42
+ You are an expert evaluator of web-navigation agent trajectories. You will grade the agent's run against a rubric, decide whether the overall task succeeded, and surface diagnostics — all in one structured response.
43
+
44
+ Use the current date above to assess time-sensitive constraints in the task (e.g., a task referencing dates in the past relative to the current date is impossible — classify as task_validity.is_invalid with code 8.1).
45
+
46
+ **Action History:**
47
+ $action_history
48
+
49
+ **Agent's Predicted Output (Final Answer):**
50
+ $agent_predicted_output
51
+
52
+ **Rubric:**
53
+ $rubric_block
54
+
55
+ **Evidence (grouped by criterion):**
56
+ $evidence_block
57
+
58
+ Each evidence reference points to an image attached below or to a text snippet inline above. Screenshots are listed in chronological order across the trajectory; when two screenshots show the same element, **the LATER screenshot reflects the final state and takes precedence**.
59
+
60
+ **Final trajectory state** (authoritative — this is the page content and screenshot captured at the very end of the run; treat it as ground truth for what the agent saw on its final page, even if no \`extract\`/\`observe\` step appears in the action history):
61
+ $final_state_block
62
+
63
+ **Optional sections to include in the response:**
64
+ - Failure analysis: $fold_failure_analysis
65
+ - Task validity classification: $fold_task_validity
66
+
67
+ When failure analysis is requested and you judge \`output_success: false\`, you must populate \`failure_point\` using the error taxonomy below:
68
+
69
+ $taxonomy_block
70
+
71
+ When task validity is requested, you must populate \`task_validity\` with the booleans \`is_ambiguous\` / \`is_invalid\` and, when each is true, a single one-line free-form reason in \`ambiguity_reason\` / \`invalid_reason\` (e.g., "Requested dates are in the past relative to the current date"). Leave the reason field empty when the corresponding flag is false.
72
+
73
+ ---
74
+
75
+ **Core Evaluation Principles** (these OVERRIDE the criterion descriptions when they conflict):
76
+
77
+ 1. **Best Effort Evaluation.** The agent should be evaluated on helpfulness and effort within constraints it cannot control.
78
+
79
+ 2. **Uncontrollable Blockers** (award full credit when these prevent task completion): platform issues (site down, CAPTCHA, login walls), entity non-existence, availability constraints (out of stock, sold out), platform limitations. If screenshots CONFIRM the blocker, award full credit even for downstream dependent criteria.
80
+
81
+ 3. **Controllable Failures** (penalize): wrong selections when correct options are available, poor execution (not using filters, not attempting specified platforms), hallucinations (claiming success without evidence), insufficient effort.
82
+
83
+ 4. **Tasks with Explicit Constraints.** Distinguish "searched for the constraint" from "found results that actually satisfy it". If the hard constraint is NOT met in the evidence, award only minimal partial credit for the search effort.
84
+
85
+ 5. **Ambiguous Wording — Don't Penalize for One Valid Interpretation.** If the task has multiple defensible readings, the agent picking one is fine.
86
+
87
+ 6. **Cascading Dependencies:**
88
+ - Scenario A: Blocker is uncontrollable → award full credit for downstream criteria that couldn't be attempted.
89
+ - Scenario B: Blocker is a controllable error → cascade partial/zero credit downstream.
90
+ - Scenario C: Don't re-penalize for the same deviation across multiple criteria.
91
+ - Scenario D: Shared platform blockers across sibling sub-tasks → award full credit for all affected siblings.
92
+
93
+ 7. **Conditional Criteria.** Some criteria have a "condition" field. Only score them when the condition is met; otherwise mark the criterion as not applicable (give it max_points so it doesn't drag down the process score).
94
+
95
+ 8. **Distinguish nitpicks from critical errors:**
96
+ - Only nitpicks → 75–100% of max
97
+ - Correct approach, wrong final answer → 40–80%
98
+ - Critical error → penalize per severity
99
+ - Mix of nitpicks + a critical error → score based on the critical error
100
+
101
+ **Outcome Judgment:**
102
+
103
+ \`output_success\` is your independent binary verdict on whether the agent completed the task. It is informed by the per-criterion scores but is not a function of them — a task can have high process score and still fail (right approach, wrong final answer) or have lower process score and still succeed (the answer is right, intermediate steps were inelegant).
104
+
105
+ **Findings:** Surface actionable patterns: failed tool usage, agent-strategy issues, rubric quality problems, capture gaps. Each finding gets a category, severity, description, and (optional) related steps + suggested action. Keep findings sparse and load-bearing.
106
+
107
+ ---
108
+
109
+ **Output Format:**
110
+
111
+ Output one JSON object matching this schema. Include the optional sections only when requested above.
112
+
113
+ {{
114
+ "outcome": {{
115
+ "primary_intent": "<one-sentence restatement of what the task was asking for>",
116
+ "reasoning": "<your reasoning for the success / failure verdict>",
117
+ "output_success": true,
118
+ "findings": [
119
+ {{
120
+ "category": "agent_tool_usage|agent_strategy|rubric_quality|trajectory_capture|task_specification|verifier_uncertainty|other",
121
+ "severity": "info|warning|blocking",
122
+ "description": "...",
123
+ "suggestedAction": "...",
124
+ "relatedSteps": [3, 4]
125
+ }}
126
+ ]
127
+ }},
128
+ "per_criterion": [
129
+ {{
130
+ "criterion_idx": 0,
131
+ "applicable_evidence": "Which evidence is applicable; cite by 'Screenshot N — step=K' or aria-tree step number.",
132
+ "justification": "How the visual / textual evidence supports your score.",
133
+ "earned_points": 4,
134
+ "evidence_sufficient": true
135
+ }}
136
+ ],
137
+ "failure_point": {{
138
+ "step_index": 17,
139
+ "error_code": "1.4",
140
+ "error_category": "Selection",
141
+ "description": "<one-line description of what went wrong at this step>"
142
+ }},
143
+ "task_validity": {{
144
+ "is_ambiguous": false,
145
+ "ambiguity_reason": "",
146
+ "is_invalid": false,
147
+ "invalid_reason": ""
148
+ }}
149
+ }}
150
+
151
+ - Omit \`failure_point\` when \`output_success\` is true or when failure analysis was not requested.
152
+ - Omit \`task_validity\` when task-validity classification was not requested.
153
+ - You MUST emit exactly one \`per_criterion\` entry per rubric item, in rubric order.
154
+ - \`earned_points\` must be in [0, max_points] for that criterion.
155
+
156
+ DO NOT OUTPUT ANYTHING OTHER THAN JSON.
157
+ `;
158
+ //# sourceMappingURL=fusedJudgment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fusedJudgment.js","sourceRoot":"","sources":["../../../../../../lib/v3/verifier/prompts/fusedJudgment.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;AAEU,QAAA,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuHpC,CAAC","sourcesContent":["/**\n * Fused judgment prompt — Approach B's single-call replacement for\n * Steps 4+6+8 (and optionally folded 9a + 10).\n *\n * One multimodal call grades every rubric criterion, emits an independent\n * outcome verdict, surfaces findings, optionally identifies the first point\n * of failure, and optionally classifies task validity. The structured\n * response is rich enough to populate the full `EvaluationResult` object without\n * additional LLM calls.\n *\n * Variables:\n * - task_definition — instruction string\n * - init_url_context — \"Starting URL: ...\" or empty\n * - action_history — compact textual action history\n * - agent_predicted_output — agent's final answer / message\n * - rubric_block — full rubric: index, criterion, description,\n * max_points, optional condition\n * - evidence_block — per-criterion top-K evidence manifest\n * (image refs + ariaTree snippets). Each image\n * in the message body is keyed by its label\n * here (e.g., \"Evidence #3 — step=12, probe\").\n * - taxonomy_block — error taxonomy text (only when\n * fold_failure_analysis = true). Otherwise\n * empty string.\n * - fold_failure_analysis — \"true\" / \"false\" — whether to emit failure\n * analysis in the response.\n * - fold_task_validity — \"true\" / \"false\" — whether to emit task\n * validity classification in the response.\n * - final_state_block — always-attached final URL + ariaTree of the\n * last step probe and finalObservation; this\n * bypasses the per-criterion top-K selection\n * so the judge always has the closing page\n * content available.\n */\n\nexport const FUSED_JUDGMENT_PROMPT = `Task: $task_definition$init_url_context\n\n**Current Date:** $current_date\n\nYou are an expert evaluator of web-navigation agent trajectories. You will grade the agent's run against a rubric, decide whether the overall task succeeded, and surface diagnostics — all in one structured response.\n\nUse the current date above to assess time-sensitive constraints in the task (e.g., a task referencing dates in the past relative to the current date is impossible — classify as task_validity.is_invalid with code 8.1).\n\n**Action History:**\n$action_history\n\n**Agent's Predicted Output (Final Answer):**\n$agent_predicted_output\n\n**Rubric:**\n$rubric_block\n\n**Evidence (grouped by criterion):**\n$evidence_block\n\nEach evidence reference points to an image attached below or to a text snippet inline above. Screenshots are listed in chronological order across the trajectory; when two screenshots show the same element, **the LATER screenshot reflects the final state and takes precedence**.\n\n**Final trajectory state** (authoritative — this is the page content and screenshot captured at the very end of the run; treat it as ground truth for what the agent saw on its final page, even if no \\`extract\\`/\\`observe\\` step appears in the action history):\n$final_state_block\n\n**Optional sections to include in the response:**\n- Failure analysis: $fold_failure_analysis\n- Task validity classification: $fold_task_validity\n\nWhen failure analysis is requested and you judge \\`output_success: false\\`, you must populate \\`failure_point\\` using the error taxonomy below:\n\n$taxonomy_block\n\nWhen task validity is requested, you must populate \\`task_validity\\` with the booleans \\`is_ambiguous\\` / \\`is_invalid\\` and, when each is true, a single one-line free-form reason in \\`ambiguity_reason\\` / \\`invalid_reason\\` (e.g., \"Requested dates are in the past relative to the current date\"). Leave the reason field empty when the corresponding flag is false.\n\n---\n\n**Core Evaluation Principles** (these OVERRIDE the criterion descriptions when they conflict):\n\n1. **Best Effort Evaluation.** The agent should be evaluated on helpfulness and effort within constraints it cannot control.\n\n2. **Uncontrollable Blockers** (award full credit when these prevent task completion): platform issues (site down, CAPTCHA, login walls), entity non-existence, availability constraints (out of stock, sold out), platform limitations. If screenshots CONFIRM the blocker, award full credit even for downstream dependent criteria.\n\n3. **Controllable Failures** (penalize): wrong selections when correct options are available, poor execution (not using filters, not attempting specified platforms), hallucinations (claiming success without evidence), insufficient effort.\n\n4. **Tasks with Explicit Constraints.** Distinguish \"searched for the constraint\" from \"found results that actually satisfy it\". If the hard constraint is NOT met in the evidence, award only minimal partial credit for the search effort.\n\n5. **Ambiguous Wording — Don't Penalize for One Valid Interpretation.** If the task has multiple defensible readings, the agent picking one is fine.\n\n6. **Cascading Dependencies:**\n - Scenario A: Blocker is uncontrollable → award full credit for downstream criteria that couldn't be attempted.\n - Scenario B: Blocker is a controllable error → cascade partial/zero credit downstream.\n - Scenario C: Don't re-penalize for the same deviation across multiple criteria.\n - Scenario D: Shared platform blockers across sibling sub-tasks → award full credit for all affected siblings.\n\n7. **Conditional Criteria.** Some criteria have a \"condition\" field. Only score them when the condition is met; otherwise mark the criterion as not applicable (give it max_points so it doesn't drag down the process score).\n\n8. **Distinguish nitpicks from critical errors:**\n - Only nitpicks → 75–100% of max\n - Correct approach, wrong final answer → 40–80%\n - Critical error → penalize per severity\n - Mix of nitpicks + a critical error → score based on the critical error\n\n**Outcome Judgment:**\n\n\\`output_success\\` is your independent binary verdict on whether the agent completed the task. It is informed by the per-criterion scores but is not a function of them — a task can have high process score and still fail (right approach, wrong final answer) or have lower process score and still succeed (the answer is right, intermediate steps were inelegant).\n\n**Findings:** Surface actionable patterns: failed tool usage, agent-strategy issues, rubric quality problems, capture gaps. Each finding gets a category, severity, description, and (optional) related steps + suggested action. Keep findings sparse and load-bearing.\n\n---\n\n**Output Format:**\n\nOutput one JSON object matching this schema. Include the optional sections only when requested above.\n\n{{\n \"outcome\": {{\n \"primary_intent\": \"<one-sentence restatement of what the task was asking for>\",\n \"reasoning\": \"<your reasoning for the success / failure verdict>\",\n \"output_success\": true,\n \"findings\": [\n {{\n \"category\": \"agent_tool_usage|agent_strategy|rubric_quality|trajectory_capture|task_specification|verifier_uncertainty|other\",\n \"severity\": \"info|warning|blocking\",\n \"description\": \"...\",\n \"suggestedAction\": \"...\",\n \"relatedSteps\": [3, 4]\n }}\n ]\n }},\n \"per_criterion\": [\n {{\n \"criterion_idx\": 0,\n \"applicable_evidence\": \"Which evidence is applicable; cite by 'Screenshot N — step=K' or aria-tree step number.\",\n \"justification\": \"How the visual / textual evidence supports your score.\",\n \"earned_points\": 4,\n \"evidence_sufficient\": true\n }}\n ],\n \"failure_point\": {{\n \"step_index\": 17,\n \"error_code\": \"1.4\",\n \"error_category\": \"Selection\",\n \"description\": \"<one-line description of what went wrong at this step>\"\n }},\n \"task_validity\": {{\n \"is_ambiguous\": false,\n \"ambiguity_reason\": \"\",\n \"is_invalid\": false,\n \"invalid_reason\": \"\"\n }}\n}}\n\n- Omit \\`failure_point\\` when \\`output_success\\` is true or when failure analysis was not requested.\n- Omit \\`task_validity\\` when task-validity classification was not requested.\n- You MUST emit exactly one \\`per_criterion\\` entry per rubric item, in rubric order.\n- \\`earned_points\\` must be in [0, max_points] for that criterion.\n\nDO NOT OUTPUT ANYTHING OTHER THAN JSON.\n`;\n"]}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Fused outcome prompt — Approach A's combined Step 8 + optional folded
3
+ * 9a/10 call. Consumes a pre-scored rubric (computed deterministically from
4
+ * Approach A's per-criterion analyses) and emits the outcome verdict,
5
+ * findings, and optionally the first point of failure + task validity.
6
+ *
7
+ * Variables:
8
+ * - task_definition — instruction string
9
+ * - init_url_context — "Starting URL: ..." or empty
10
+ * - action_history — compact textual action history
11
+ * - outcome_evidence_summary — selected text evidence snippets from the
12
+ * trajectory, ordered by step
13
+ * - agent_predicted_output — agent's final answer / message
14
+ * - rubric_summary — pre-scored rubric: per-criterion earned/max
15
+ * + the justifications from per-criterion calls
16
+ * - taxonomy_block — error taxonomy text (only when
17
+ * fold_failure_analysis is true; "" otherwise)
18
+ * - fold_failure_analysis — "true" / "false"
19
+ * - fold_task_validity — "true" / "false"
20
+ * - final_state_block — always-attached final URL + ariaTree of the
21
+ * last step probe and finalObservation; this
22
+ * bypasses the keyword-based excerpt selection
23
+ * used by outcome_evidence_summary so the
24
+ * judge always has the closing page content.
25
+ */
26
+ export declare const FUSED_OUTCOME_PROMPT = "Task: $task_definition$init_url_context\n\n**Current Date:** $current_date\n\nYou are an expert evaluator of web-navigation agent trajectories. The rubric has already been scored per criterion (results below). Your job is to produce the overall outcome verdict.\n\nUse the current date above to assess time-sensitive constraints in the task (e.g., a task referencing dates in the past relative to the current date is impossible \u2014 classify as task_validity.is_invalid with code 8.1).\n\n**Action History:**\n$action_history\n\n**Selected Trajectory Evidence:**\n$outcome_evidence_summary\n\n**Final trajectory state** (authoritative \u2014 page content and screenshot captured at the very end of the run; treat as ground truth for what the agent saw on its final page, even when no `extract`/`observe` step appears in the action history):\n$final_state_block\n\n**Agent's Predicted Output (Final Answer):**\n$agent_predicted_output\n\n**Pre-Scored Rubric (per-criterion earned points + justifications):**\n$rubric_summary\n\n**Optional sections in the response:**\n- Failure analysis: $fold_failure_analysis\n- Task validity classification: $fold_task_validity\n\nWhen failure analysis is requested and you judge `output_success: false`, populate `failure_point` using the error taxonomy below:\n\n$taxonomy_block\n\nWhen task validity is requested, populate `task_validity` with the booleans `is_ambiguous` / `is_invalid` and, when each is true, a single one-line free-form reason in `ambiguity_reason` / `invalid_reason` (e.g., \"Requested dates are in the past relative to the current date\"). Leave the reason field empty when the corresponding flag is false.\n\n---\n\n**Outcome judgment:**\n`output_success` is your independent binary verdict on whether the agent completed the task. It is informed by the per-criterion scores but is not a function of them \u2014 a task can have high process score and still fail (right approach, wrong final answer), or have lower process score and still succeed.\n\nApply these rules when making the outcome verdict:\n\n1. **Judge the delivered result, not the route.** If the final answer satisfies the user's requested deliverable and the trajectory does not contradict it, mark success even if the agent used an inefficient path, clicked around after finding the answer, or used a slightly different but reasonable search control. Do not fail solely because the process was imperfect.\n\n2. **Use the simulated trajectory as truth.** Do not use outside/current-world knowledge to override what the saved browser state shows. If search results, page text, URLs, or screenshots in the trajectory support a concrete answer, judge against that evidence even if the real web may differ. Do not introduce an alternate \"correct\" answer from your own knowledge unless that alternate answer is visible in the supplied trajectory evidence.\n\n3. **Treat attached screenshots as partial evidence.** Screenshots may be sampled from a longer trajectory. If the final answer is concrete and the action history shows the agent reached a relevant source (page, list, chart, search result, product page, map result), assume the answer may have been extracted from that source unless the attached screenshots or action history directly contradict it. Do not call a concrete answer fabricated merely because the exact supporting text is absent from the sampled screenshots.\n\n4. **Require the actual deliverable.** The final answer is the user-visible deliverable. For tasks asking to find, show, get, browse, list, summarize, report, compare, or provide values/content, the final answer must contain the requested content or a direct correct link to the requested document/page. Merely saying the agent \"found\", \"extracted\", \"provided\", \"displayed\", \"retrieved\", or \"located\" the information is not enough, even if the browser reached the right page. The selected trajectory evidence is only context; it cannot fill in missing values, lists, links, or summaries that are absent from the final answer. Only purely navigational tasks phrased as opening a page can succeed from navigation alone.\n\n5. **Report/document tasks need the report/document.** If the task asks to get, open, retrieve, download, or provide a report/document/page, the final answer must include a direct correct URL, the opened document/page itself must be the final browser state, or the final answer must include the requested document content. Merely naming the document title is not enough unless the user only asked for the title/name.\n\n6. **Do not invent equivalence.** If the final answer gives a URL, document, article id, product, entity, date, or value that differs from what the trajectory visibly reached, do not assume an unseen redirect, canonicalization, or equivalence. Treat the mismatch as a contradiction unless the supplied trajectory evidence itself shows they are equivalent.\n\n7. **Hard constraints still matter.** If the latest relevant attached screenshot, selected trajectory evidence, or action-history URL clearly shows that an explicit constraint was not met (for example wrong sort/filter/date/class, permanently closed location reported as active, visible product/list item outside the requested color/size/status, wrong URL/article id, or wrong entity), that is a critical issue.\n\n8. **Dynamic sources can disagree.** Search results, charts, rankings, prices, and listings can differ across pages or update times in the saved trajectory. If the final answer is concrete and matches at least one relevant trajectory source, do not fail solely because another relevant source in the trajectory shows a different dynamic value, unless the final answer clearly used the contradicted source or the task required that exact source.\n\n9. **Shopping/search constraints may be source-level.** For product-search tasks, a search query, filter, result page, or product title/snippet can satisfy a descriptive constraint such as \"hypoallergenic\" when the final answer provides concrete candidate products and no supplied evidence directly contradicts the constraint. Do not fail solely because a later product page does not repeat every search constraint as a formal specification.\n\n10. **Separate nitpicks from critical issues.** Minor wording, harmless method choices, unsupported extra details that are not part of the requested deliverable, caveats about imperfect verification, or small presentation differences should not flip a successful answer to failure when the final answer still provides concrete requested content and the trajectory does not directly contradict it. Wrong requested entities, unsupported fabricated requested facts, active-vs-closed mistakes, wrong sort/filter results, wrong dates/classes, and missing requested content are critical.\n\nUse this decision order:\n\n- First ask whether the final answer contains the requested user-facing artifact: values, list items, summary, comparison, report link, product candidates, or page/document URL. If it only narrates that the artifact was found/extracted/provided, mark failure.\n- Then check for direct contradictions in the supplied trajectory evidence. Contradictions must come from the provided action history, URLs, screenshots, or final answer, not from outside knowledge.\n- If the final answer is concrete, the trajectory reached a relevant source, and the supplied evidence does not directly contradict the final answer, mark success.\n\n**Findings:** Surface actionable patterns: failed tool usage, agent-strategy issues, rubric quality problems, capture gaps. Each finding gets a category, severity, description, and (optional) related steps + suggested action. Keep findings sparse and load-bearing.\n\n---\n\n**Output Format:**\n\nOutput one JSON object:\n\n{{\n \"outcome\": {{\n \"primary_intent\": \"<one-sentence restatement of what the task was asking for>\",\n \"reasoning\": \"<your reasoning for the success / failure verdict>\",\n \"output_success\": true,\n \"findings\": [\n {{\n \"category\": \"agent_tool_usage|agent_strategy|rubric_quality|trajectory_capture|task_specification|verifier_uncertainty|other\",\n \"severity\": \"info|warning|blocking\",\n \"description\": \"...\",\n \"suggestedAction\": \"...\",\n \"relatedSteps\": [3, 4]\n }}\n ]\n }},\n \"failure_point\": {{\n \"step_index\": 17,\n \"error_code\": \"1.4\",\n \"error_category\": \"Selection\",\n \"description\": \"<one-line description of what went wrong at this step>\"\n }},\n \"task_validity\": {{\n \"is_ambiguous\": false,\n \"ambiguity_reason\": \"\",\n \"is_invalid\": false,\n \"invalid_reason\": \"\"\n }}\n}}\n\n- Omit `failure_point` when `output_success` is true or failure analysis was not requested.\n- Omit `task_validity` when task-validity classification was not requested.\n\nDO NOT OUTPUT ANYTHING OTHER THAN JSON.\n";