@browserbasehq/orca 3.4.0-preview.0 → 3.5.0-preview.1

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 (919) hide show
  1. package/dist/cjs/lib/inference.d.ts +2 -1
  2. package/dist/cjs/lib/inference.js +10 -3
  3. package/dist/cjs/lib/inference.js.map +1 -1
  4. package/dist/cjs/lib/prompt.d.ts +2 -2
  5. package/dist/cjs/lib/prompt.js +19 -4
  6. package/dist/cjs/lib/prompt.js.map +1 -1
  7. package/dist/cjs/lib/v3/agent/AgentProvider.d.ts +1 -1
  8. package/dist/cjs/lib/v3/agent/AgentProvider.js.map +1 -1
  9. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js +10 -0
  10. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.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/postStepProbeEvidence.d.ts +19 -0
  15. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.js +54 -0
  16. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.js.map +1 -0
  17. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.d.ts +2 -0
  18. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.js +62 -0
  19. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.js.map +1 -0
  20. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.d.ts +3 -0
  21. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.js +25 -0
  22. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.js.map +1 -0
  23. package/dist/cjs/lib/v3/api.d.ts +7 -1
  24. package/dist/cjs/lib/v3/api.js +100 -29
  25. package/dist/cjs/lib/v3/api.js.map +1 -1
  26. package/dist/cjs/lib/v3/dom/build/selectorRuntime.generated.d.ts +24 -0
  27. package/dist/cjs/lib/v3/dom/build/selectorRuntime.generated.js +31 -0
  28. package/dist/cjs/lib/v3/dom/build/selectorRuntime.generated.js.map +1 -0
  29. package/dist/cjs/lib/v3/handlers/extractHandler.js +19 -2
  30. package/dist/cjs/lib/v3/handlers/extractHandler.js.map +1 -1
  31. package/dist/cjs/lib/v3/handlers/observeHandler.js +2 -1
  32. package/dist/cjs/lib/v3/handlers/observeHandler.js.map +1 -1
  33. package/dist/cjs/lib/v3/handlers/v3AgentHandler.d.ts +1 -0
  34. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js +83 -7
  35. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  36. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.d.ts +11 -0
  37. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js +120 -5
  38. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  39. package/dist/cjs/lib/v3/index.d.ts +12 -0
  40. package/dist/cjs/lib/v3/index.js +19 -1
  41. package/dist/cjs/lib/v3/index.js.map +1 -1
  42. package/dist/cjs/lib/v3/launch/local.d.ts +2 -7
  43. package/dist/cjs/lib/v3/launch/local.js +47 -7
  44. package/dist/cjs/lib/v3/launch/local.js.map +1 -1
  45. package/dist/cjs/lib/v3/llm/LLMProvider.d.ts +3 -0
  46. package/dist/cjs/lib/v3/llm/LLMProvider.js +28 -8
  47. package/dist/cjs/lib/v3/llm/LLMProvider.js.map +1 -1
  48. package/dist/cjs/lib/v3/llm/aisdk.js +5 -0
  49. package/dist/cjs/lib/v3/llm/aisdk.js.map +1 -1
  50. package/dist/cjs/lib/v3/types/private/handlers.d.ts +2 -0
  51. package/dist/cjs/lib/v3/types/private/handlers.js.map +1 -1
  52. package/dist/cjs/lib/v3/types/private/snapshot.d.ts +2 -0
  53. package/dist/cjs/lib/v3/types/private/snapshot.js.map +1 -1
  54. package/dist/cjs/lib/v3/types/public/agent.d.ts +7 -1
  55. package/dist/cjs/lib/v3/types/public/agent.js.map +1 -1
  56. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.d.ts +85 -0
  57. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.js +15 -0
  58. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.js.map +1 -0
  59. package/dist/cjs/lib/v3/types/public/api.d.ts +584 -65
  60. package/dist/cjs/lib/v3/types/public/api.js +107 -7
  61. package/dist/cjs/lib/v3/types/public/api.js.map +1 -1
  62. package/dist/cjs/lib/v3/types/public/index.d.ts +1 -0
  63. package/dist/cjs/lib/v3/types/public/index.js +1 -0
  64. package/dist/cjs/lib/v3/types/public/index.js.map +1 -1
  65. package/dist/cjs/lib/v3/types/public/methods.d.ts +2 -0
  66. package/dist/cjs/lib/v3/types/public/methods.js.map +1 -1
  67. package/dist/cjs/lib/v3/types/public/model.d.ts +23 -10
  68. package/dist/cjs/lib/v3/types/public/model.js.map +1 -1
  69. package/dist/cjs/lib/v3/understudy/a11y/snapshot/a11yTree.js +25 -0
  70. package/dist/cjs/lib/v3/understudy/a11y/snapshot/a11yTree.js.map +1 -1
  71. package/dist/cjs/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js +10 -1
  72. package/dist/cjs/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js.map +1 -1
  73. package/dist/cjs/lib/v3/v3.d.ts +1 -0
  74. package/dist/cjs/lib/v3/v3.js +21 -47
  75. package/dist/cjs/lib/v3/v3.js.map +1 -1
  76. package/dist/cjs/lib/v3/verifier/evidenceNormalization.d.ts +7 -0
  77. package/dist/cjs/lib/v3/verifier/evidenceNormalization.js +100 -0
  78. package/dist/cjs/lib/v3/verifier/evidenceNormalization.js.map +1 -0
  79. package/dist/cjs/lib/v3/verifier/index.d.ts +6 -0
  80. package/dist/cjs/lib/v3/verifier/index.js +16 -0
  81. package/dist/cjs/lib/v3/verifier/index.js.map +1 -0
  82. package/dist/cjs/lib/v3/verifier/trajectory.d.ts +50 -0
  83. package/dist/cjs/lib/v3/verifier/trajectory.js +316 -0
  84. package/dist/cjs/lib/v3/verifier/trajectory.js.map +1 -0
  85. package/dist/cjs/lib/v3/verifier/types.d.ts +281 -0
  86. package/dist/cjs/lib/v3/verifier/types.js +10 -0
  87. package/dist/cjs/lib/v3/verifier/types.js.map +1 -0
  88. package/dist/cjs/lib/v3Evaluator.d.ts +29 -16
  89. package/dist/cjs/lib/v3Evaluator.js +184 -194
  90. package/dist/cjs/lib/v3Evaluator.js.map +1 -1
  91. package/dist/cjs/lib/v3LegacyEvaluator.d.ts +20 -0
  92. package/dist/cjs/lib/v3LegacyEvaluator.js +219 -0
  93. package/dist/cjs/lib/v3LegacyEvaluator.js.map +1 -0
  94. package/dist/cjs/lib/version.d.ts +1 -1
  95. package/dist/cjs/lib/version.js +1 -1
  96. package/dist/cjs/lib/version.js.map +1 -1
  97. package/dist/esm/lib/inference.d.ts +2 -1
  98. package/dist/esm/lib/inference.js +10 -3
  99. package/dist/esm/lib/inference.js.map +1 -1
  100. package/dist/esm/lib/prompt.d.ts +2 -2
  101. package/dist/esm/lib/prompt.js +19 -4
  102. package/dist/esm/lib/prompt.js.map +1 -1
  103. package/dist/esm/lib/v3/agent/AgentProvider.d.ts +1 -1
  104. package/dist/esm/lib/v3/agent/AgentProvider.js.map +1 -1
  105. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js +10 -0
  106. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
  107. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.d.ts +35 -0
  108. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.js +35 -0
  109. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.js.map +1 -0
  110. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.d.ts +19 -0
  111. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.js +50 -0
  112. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.js.map +1 -0
  113. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.d.ts +2 -0
  114. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.js +59 -0
  115. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.js.map +1 -0
  116. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.d.ts +3 -0
  117. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.js +22 -0
  118. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.js.map +1 -0
  119. package/dist/esm/lib/v3/api.d.ts +7 -1
  120. package/dist/esm/lib/v3/api.js +100 -29
  121. package/dist/esm/lib/v3/api.js.map +1 -1
  122. package/dist/esm/lib/v3/dom/build/selectorRuntime.generated.d.ts +24 -0
  123. package/dist/esm/lib/v3/dom/build/selectorRuntime.generated.js +28 -0
  124. package/dist/esm/lib/v3/dom/build/selectorRuntime.generated.js.map +1 -0
  125. package/dist/esm/lib/v3/handlers/extractHandler.js +19 -2
  126. package/dist/esm/lib/v3/handlers/extractHandler.js.map +1 -1
  127. package/dist/esm/lib/v3/handlers/observeHandler.js +2 -1
  128. package/dist/esm/lib/v3/handlers/observeHandler.js.map +1 -1
  129. package/dist/esm/lib/v3/handlers/v3AgentHandler.d.ts +1 -0
  130. package/dist/esm/lib/v3/handlers/v3AgentHandler.js +83 -7
  131. package/dist/esm/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  132. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.d.ts +11 -0
  133. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js +120 -5
  134. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  135. package/dist/esm/lib/v3/index.d.ts +12 -0
  136. package/dist/esm/lib/v3/index.js +10 -0
  137. package/dist/esm/lib/v3/index.js.map +1 -1
  138. package/dist/esm/lib/v3/launch/local.d.ts +2 -7
  139. package/dist/esm/lib/v3/launch/local.js +48 -8
  140. package/dist/esm/lib/v3/launch/local.js.map +1 -1
  141. package/dist/esm/lib/v3/llm/LLMProvider.d.ts +3 -0
  142. package/dist/esm/lib/v3/llm/LLMProvider.js +28 -9
  143. package/dist/esm/lib/v3/llm/LLMProvider.js.map +1 -1
  144. package/dist/esm/lib/v3/llm/aisdk.js +5 -0
  145. package/dist/esm/lib/v3/llm/aisdk.js.map +1 -1
  146. package/dist/esm/lib/v3/types/private/handlers.d.ts +2 -0
  147. package/dist/esm/lib/v3/types/private/handlers.js.map +1 -1
  148. package/dist/esm/lib/v3/types/private/snapshot.d.ts +2 -0
  149. package/dist/esm/lib/v3/types/private/snapshot.js.map +1 -1
  150. package/dist/esm/lib/v3/types/public/agent.d.ts +7 -1
  151. package/dist/esm/lib/v3/types/public/agent.js.map +1 -1
  152. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.d.ts +85 -0
  153. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.js +14 -0
  154. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.js.map +1 -0
  155. package/dist/esm/lib/v3/types/public/api.d.ts +584 -65
  156. package/dist/esm/lib/v3/types/public/api.js +105 -5
  157. package/dist/esm/lib/v3/types/public/api.js.map +1 -1
  158. package/dist/esm/lib/v3/types/public/index.d.ts +1 -0
  159. package/dist/esm/lib/v3/types/public/index.js +1 -0
  160. package/dist/esm/lib/v3/types/public/index.js.map +1 -1
  161. package/dist/esm/lib/v3/types/public/methods.d.ts +2 -0
  162. package/dist/esm/lib/v3/types/public/methods.js.map +1 -1
  163. package/dist/esm/lib/v3/types/public/model.d.ts +23 -10
  164. package/dist/esm/lib/v3/types/public/model.js.map +1 -1
  165. package/dist/esm/lib/v3/understudy/a11y/snapshot/a11yTree.js +25 -0
  166. package/dist/esm/lib/v3/understudy/a11y/snapshot/a11yTree.js.map +1 -1
  167. package/dist/esm/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js +10 -1
  168. package/dist/esm/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js.map +1 -1
  169. package/dist/esm/lib/v3/v3.d.ts +1 -0
  170. package/dist/esm/lib/v3/v3.js +21 -47
  171. package/dist/esm/lib/v3/v3.js.map +1 -1
  172. package/dist/esm/lib/v3/verifier/evidenceNormalization.d.ts +7 -0
  173. package/dist/esm/lib/v3/verifier/evidenceNormalization.js +93 -0
  174. package/dist/esm/lib/v3/verifier/evidenceNormalization.js.map +1 -0
  175. package/dist/esm/lib/v3/verifier/index.d.ts +6 -0
  176. package/dist/esm/lib/v3/verifier/index.js +3 -0
  177. package/dist/esm/lib/v3/verifier/index.js.map +1 -0
  178. package/dist/esm/lib/v3/verifier/trajectory.d.ts +50 -0
  179. package/dist/esm/lib/v3/verifier/trajectory.js +273 -0
  180. package/dist/esm/lib/v3/verifier/trajectory.js.map +1 -0
  181. package/dist/esm/lib/v3/verifier/types.d.ts +281 -0
  182. package/dist/esm/lib/v3/verifier/types.js +9 -0
  183. package/dist/esm/lib/v3/verifier/types.js.map +1 -0
  184. package/dist/esm/lib/v3Evaluator.d.ts +29 -16
  185. package/dist/esm/lib/v3Evaluator.js +183 -193
  186. package/dist/esm/lib/v3Evaluator.js.map +1 -1
  187. package/dist/esm/lib/v3LegacyEvaluator.d.ts +20 -0
  188. package/dist/esm/lib/v3LegacyEvaluator.js +215 -0
  189. package/dist/esm/lib/v3LegacyEvaluator.js.map +1 -0
  190. package/dist/esm/lib/version.d.ts +1 -1
  191. package/dist/esm/lib/version.js +1 -1
  192. package/dist/esm/lib/version.js.map +1 -1
  193. package/package.json +33 -21
  194. package/dist/cjs/tests/cache-variables.test.d.ts +0 -1
  195. package/dist/cjs/tests/cache-variables.test.js +0 -221
  196. package/dist/cjs/tests/cache-variables.test.js.map +0 -1
  197. package/dist/cjs/tests/integration/agent-abort-signal.spec.d.ts +0 -1
  198. package/dist/cjs/tests/integration/agent-abort-signal.spec.js +0 -123
  199. package/dist/cjs/tests/integration/agent-abort-signal.spec.js.map +0 -1
  200. package/dist/cjs/tests/integration/agent-cache-self-heal.spec.d.ts +0 -1
  201. package/dist/cjs/tests/integration/agent-cache-self-heal.spec.js +0 -83
  202. package/dist/cjs/tests/integration/agent-cache-self-heal.spec.js.map +0 -1
  203. package/dist/cjs/tests/integration/agent-callbacks.spec.d.ts +0 -1
  204. package/dist/cjs/tests/integration/agent-callbacks.spec.js +0 -385
  205. package/dist/cjs/tests/integration/agent-callbacks.spec.js.map +0 -1
  206. package/dist/cjs/tests/integration/agent-experimental-validation.spec.d.ts +0 -1
  207. package/dist/cjs/tests/integration/agent-experimental-validation.spec.js +0 -362
  208. package/dist/cjs/tests/integration/agent-experimental-validation.spec.js.map +0 -1
  209. package/dist/cjs/tests/integration/agent-hybrid-mode.spec.d.ts +0 -1
  210. package/dist/cjs/tests/integration/agent-hybrid-mode.spec.js +0 -262
  211. package/dist/cjs/tests/integration/agent-hybrid-mode.spec.js.map +0 -1
  212. package/dist/cjs/tests/integration/agent-message-continuation.spec.d.ts +0 -1
  213. package/dist/cjs/tests/integration/agent-message-continuation.spec.js +0 -112
  214. package/dist/cjs/tests/integration/agent-message-continuation.spec.js.map +0 -1
  215. package/dist/cjs/tests/integration/agent-streaming.spec.d.ts +0 -1
  216. package/dist/cjs/tests/integration/agent-streaming.spec.js +0 -140
  217. package/dist/cjs/tests/integration/agent-streaming.spec.js.map +0 -1
  218. package/dist/cjs/tests/integration/cdp-close-api-region.spec.d.ts +0 -1
  219. package/dist/cjs/tests/integration/cdp-close-api-region.spec.js +0 -41
  220. package/dist/cjs/tests/integration/cdp-close-api-region.spec.js.map +0 -1
  221. package/dist/cjs/tests/integration/cdp-connection-close.spec.d.ts +0 -1
  222. package/dist/cjs/tests/integration/cdp-connection-close.spec.js +0 -76
  223. package/dist/cjs/tests/integration/cdp-connection-close.spec.js.map +0 -1
  224. package/dist/cjs/tests/integration/cdp-session-detached.spec.d.ts +0 -1
  225. package/dist/cjs/tests/integration/cdp-session-detached.spec.js +0 -45
  226. package/dist/cjs/tests/integration/cdp-session-detached.spec.js.map +0 -1
  227. package/dist/cjs/tests/integration/chrome-newtab-page-tracking.spec.d.ts +0 -1
  228. package/dist/cjs/tests/integration/chrome-newtab-page-tracking.spec.js +0 -56
  229. package/dist/cjs/tests/integration/chrome-newtab-page-tracking.spec.js.map +0 -1
  230. package/dist/cjs/tests/integration/click-count.spec.d.ts +0 -1
  231. package/dist/cjs/tests/integration/click-count.spec.js +0 -163
  232. package/dist/cjs/tests/integration/click-count.spec.js.map +0 -1
  233. package/dist/cjs/tests/integration/connect-to-existing-browser.spec.d.ts +0 -1
  234. package/dist/cjs/tests/integration/connect-to-existing-browser.spec.js +0 -99
  235. package/dist/cjs/tests/integration/connect-to-existing-browser.spec.js.map +0 -1
  236. package/dist/cjs/tests/integration/context-addInitScript.spec.d.ts +0 -1
  237. package/dist/cjs/tests/integration/context-addInitScript.spec.js +0 -285
  238. package/dist/cjs/tests/integration/context-addInitScript.spec.js.map +0 -1
  239. package/dist/cjs/tests/integration/context-extra-http-headers.spec.d.ts +0 -1
  240. package/dist/cjs/tests/integration/context-extra-http-headers.spec.js +0 -49
  241. package/dist/cjs/tests/integration/context-extra-http-headers.spec.js.map +0 -1
  242. package/dist/cjs/tests/integration/cookies.spec.d.ts +0 -1
  243. package/dist/cjs/tests/integration/cookies.spec.js +0 -187
  244. package/dist/cjs/tests/integration/cookies.spec.js.map +0 -1
  245. package/dist/cjs/tests/integration/default-page-tracking.spec.d.ts +0 -1
  246. package/dist/cjs/tests/integration/default-page-tracking.spec.js +0 -52
  247. package/dist/cjs/tests/integration/default-page-tracking.spec.js.map +0 -1
  248. package/dist/cjs/tests/integration/downloads.spec.d.ts +0 -1
  249. package/dist/cjs/tests/integration/downloads.spec.js +0 -52
  250. package/dist/cjs/tests/integration/downloads.spec.js.map +0 -1
  251. package/dist/cjs/tests/integration/flowLogger.spec.d.ts +0 -1
  252. package/dist/cjs/tests/integration/flowLogger.spec.js +0 -718
  253. package/dist/cjs/tests/integration/flowLogger.spec.js.map +0 -1
  254. package/dist/cjs/tests/integration/frame-get-location-and-click.spec.d.ts +0 -1
  255. package/dist/cjs/tests/integration/frame-get-location-and-click.spec.js +0 -57
  256. package/dist/cjs/tests/integration/frame-get-location-and-click.spec.js.map +0 -1
  257. package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.d.ts +0 -1
  258. package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.js +0 -219
  259. package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.js.map +0 -1
  260. package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.d.ts +0 -1
  261. package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.js +0 -474
  262. package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.js.map +0 -1
  263. package/dist/cjs/tests/integration/keep-alive.child.d.ts +0 -1
  264. package/dist/cjs/tests/integration/keep-alive.child.js +0 -85
  265. package/dist/cjs/tests/integration/keep-alive.child.js.map +0 -1
  266. package/dist/cjs/tests/integration/keep-alive.spec.d.ts +0 -22
  267. package/dist/cjs/tests/integration/keep-alive.spec.js +0 -490
  268. package/dist/cjs/tests/integration/keep-alive.spec.js.map +0 -1
  269. package/dist/cjs/tests/integration/keyboard.spec.d.ts +0 -1
  270. package/dist/cjs/tests/integration/keyboard.spec.js +0 -259
  271. package/dist/cjs/tests/integration/keyboard.spec.js.map +0 -1
  272. package/dist/cjs/tests/integration/locator-backend-node-id.spec.d.ts +0 -1
  273. package/dist/cjs/tests/integration/locator-backend-node-id.spec.js +0 -150
  274. package/dist/cjs/tests/integration/locator-backend-node-id.spec.js.map +0 -1
  275. package/dist/cjs/tests/integration/locator-content-methods.spec.d.ts +0 -1
  276. package/dist/cjs/tests/integration/locator-content-methods.spec.js +0 -180
  277. package/dist/cjs/tests/integration/locator-content-methods.spec.js.map +0 -1
  278. package/dist/cjs/tests/integration/locator-count-iframe.spec.d.ts +0 -1
  279. package/dist/cjs/tests/integration/locator-count-iframe.spec.js +0 -129
  280. package/dist/cjs/tests/integration/locator-count-iframe.spec.js.map +0 -1
  281. package/dist/cjs/tests/integration/locator-count.spec.d.ts +0 -1
  282. package/dist/cjs/tests/integration/locator-count.spec.js +0 -68
  283. package/dist/cjs/tests/integration/locator-count.spec.js.map +0 -1
  284. package/dist/cjs/tests/integration/locator-fill.spec.d.ts +0 -1
  285. package/dist/cjs/tests/integration/locator-fill.spec.js +0 -117
  286. package/dist/cjs/tests/integration/locator-fill.spec.js.map +0 -1
  287. package/dist/cjs/tests/integration/locator-input-methods.spec.d.ts +0 -1
  288. package/dist/cjs/tests/integration/locator-input-methods.spec.js +0 -127
  289. package/dist/cjs/tests/integration/locator-input-methods.spec.js.map +0 -1
  290. package/dist/cjs/tests/integration/locator-nth.spec.d.ts +0 -1
  291. package/dist/cjs/tests/integration/locator-nth.spec.js +0 -175
  292. package/dist/cjs/tests/integration/locator-nth.spec.js.map +0 -1
  293. package/dist/cjs/tests/integration/locator-select-option.spec.d.ts +0 -1
  294. package/dist/cjs/tests/integration/locator-select-option.spec.js +0 -216
  295. package/dist/cjs/tests/integration/locator-select-option.spec.js.map +0 -1
  296. package/dist/cjs/tests/integration/logger-initialization.spec.d.ts +0 -1
  297. package/dist/cjs/tests/integration/logger-initialization.spec.js +0 -597
  298. package/dist/cjs/tests/integration/logger-initialization.spec.js.map +0 -1
  299. package/dist/cjs/tests/integration/multi-instance-logger.spec.d.ts +0 -1
  300. package/dist/cjs/tests/integration/multi-instance-logger.spec.js +0 -293
  301. package/dist/cjs/tests/integration/multi-instance-logger.spec.js.map +0 -1
  302. package/dist/cjs/tests/integration/nested-div.spec.d.ts +0 -1
  303. package/dist/cjs/tests/integration/nested-div.spec.js +0 -22
  304. package/dist/cjs/tests/integration/nested-div.spec.js.map +0 -1
  305. package/dist/cjs/tests/integration/observe-element-id-format.spec.d.ts +0 -1
  306. package/dist/cjs/tests/integration/observe-element-id-format.spec.js +0 -130
  307. package/dist/cjs/tests/integration/observe-element-id-format.spec.js.map +0 -1
  308. package/dist/cjs/tests/integration/page-addInitScript.spec.d.ts +0 -1
  309. package/dist/cjs/tests/integration/page-addInitScript.spec.js +0 -94
  310. package/dist/cjs/tests/integration/page-addInitScript.spec.js.map +0 -1
  311. package/dist/cjs/tests/integration/page-console.spec.d.ts +0 -1
  312. package/dist/cjs/tests/integration/page-console.spec.js +0 -47
  313. package/dist/cjs/tests/integration/page-console.spec.js.map +0 -1
  314. package/dist/cjs/tests/integration/page-drag-and-drop.spec.d.ts +0 -1
  315. package/dist/cjs/tests/integration/page-drag-and-drop.spec.js +0 -437
  316. package/dist/cjs/tests/integration/page-drag-and-drop.spec.js.map +0 -1
  317. package/dist/cjs/tests/integration/page-extra-http-headers.spec.d.ts +0 -1
  318. package/dist/cjs/tests/integration/page-extra-http-headers.spec.js +0 -85
  319. package/dist/cjs/tests/integration/page-extra-http-headers.spec.js.map +0 -1
  320. package/dist/cjs/tests/integration/page-goto-response.spec.d.ts +0 -1
  321. package/dist/cjs/tests/integration/page-goto-response.spec.js +0 -34
  322. package/dist/cjs/tests/integration/page-goto-response.spec.js.map +0 -1
  323. package/dist/cjs/tests/integration/page-hover.spec.d.ts +0 -1
  324. package/dist/cjs/tests/integration/page-hover.spec.js +0 -165
  325. package/dist/cjs/tests/integration/page-hover.spec.js.map +0 -1
  326. package/dist/cjs/tests/integration/page-screenshot.spec.d.ts +0 -1
  327. package/dist/cjs/tests/integration/page-screenshot.spec.js +0 -292
  328. package/dist/cjs/tests/integration/page-screenshot.spec.js.map +0 -1
  329. package/dist/cjs/tests/integration/page-scroll.spec.d.ts +0 -1
  330. package/dist/cjs/tests/integration/page-scroll.spec.js +0 -183
  331. package/dist/cjs/tests/integration/page-scroll.spec.js.map +0 -1
  332. package/dist/cjs/tests/integration/page-send-cdp.spec.d.ts +0 -1
  333. package/dist/cjs/tests/integration/page-send-cdp.spec.js +0 -47
  334. package/dist/cjs/tests/integration/page-send-cdp.spec.js.map +0 -1
  335. package/dist/cjs/tests/integration/perform-understudy-method.spec.d.ts +0 -1
  336. package/dist/cjs/tests/integration/perform-understudy-method.spec.js +0 -63
  337. package/dist/cjs/tests/integration/perform-understudy-method.spec.js.map +0 -1
  338. package/dist/cjs/tests/integration/setinputfiles.spec.d.ts +0 -1
  339. package/dist/cjs/tests/integration/setinputfiles.spec.js +0 -133
  340. package/dist/cjs/tests/integration/setinputfiles.spec.js.map +0 -1
  341. package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.d.ts +0 -1
  342. package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.js +0 -161
  343. package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.js.map +0 -1
  344. package/dist/cjs/tests/integration/shadow-iframe-spif.spec.d.ts +0 -1
  345. package/dist/cjs/tests/integration/shadow-iframe-spif.spec.js +0 -160
  346. package/dist/cjs/tests/integration/shadow-iframe-spif.spec.js.map +0 -1
  347. package/dist/cjs/tests/integration/testUtils.d.ts +0 -40
  348. package/dist/cjs/tests/integration/testUtils.js +0 -188
  349. package/dist/cjs/tests/integration/testUtils.js.map +0 -1
  350. package/dist/cjs/tests/integration/text-selector-innermost.spec.d.ts +0 -1
  351. package/dist/cjs/tests/integration/text-selector-innermost.spec.js +0 -105
  352. package/dist/cjs/tests/integration/text-selector-innermost.spec.js.map +0 -1
  353. package/dist/cjs/tests/integration/timeouts.spec.d.ts +0 -1
  354. package/dist/cjs/tests/integration/timeouts.spec.js +0 -309
  355. package/dist/cjs/tests/integration/timeouts.spec.js.map +0 -1
  356. package/dist/cjs/tests/integration/user-data-dir.spec.d.ts +0 -1
  357. package/dist/cjs/tests/integration/user-data-dir.spec.js +0 -77
  358. package/dist/cjs/tests/integration/user-data-dir.spec.js.map +0 -1
  359. package/dist/cjs/tests/integration/v3.config.d.ts +0 -4
  360. package/dist/cjs/tests/integration/v3.config.js +0 -11
  361. package/dist/cjs/tests/integration/v3.config.js.map +0 -1
  362. package/dist/cjs/tests/integration/v3.dynamic.config.d.ts +0 -4
  363. package/dist/cjs/tests/integration/v3.dynamic.config.js +0 -48
  364. package/dist/cjs/tests/integration/v3.dynamic.config.js.map +0 -1
  365. package/dist/cjs/tests/integration/v3.playwright.config.d.ts +0 -2
  366. package/dist/cjs/tests/integration/v3.playwright.config.js +0 -48
  367. package/dist/cjs/tests/integration/v3.playwright.config.js.map +0 -1
  368. package/dist/cjs/tests/integration/wait-for-selector.spec.d.ts +0 -1
  369. package/dist/cjs/tests/integration/wait-for-selector.spec.js +0 -683
  370. package/dist/cjs/tests/integration/wait-for-selector.spec.js.map +0 -1
  371. package/dist/cjs/tests/integration/wait-for-timeout.spec.d.ts +0 -1
  372. package/dist/cjs/tests/integration/wait-for-timeout.spec.js +0 -118
  373. package/dist/cjs/tests/integration/wait-for-timeout.spec.js.map +0 -1
  374. package/dist/cjs/tests/integration/xpath-for-location-deep.spec.d.ts +0 -1
  375. package/dist/cjs/tests/integration/xpath-for-location-deep.spec.js +0 -87
  376. package/dist/cjs/tests/integration/xpath-for-location-deep.spec.js.map +0 -1
  377. package/dist/cjs/tests/unit/agent-captcha-hooks.test.d.ts +0 -1
  378. package/dist/cjs/tests/unit/agent-captcha-hooks.test.js +0 -341
  379. package/dist/cjs/tests/unit/agent-captcha-hooks.test.js.map +0 -1
  380. package/dist/cjs/tests/unit/agent-execution-model.test.d.ts +0 -1
  381. package/dist/cjs/tests/unit/agent-execution-model.test.js +0 -150
  382. package/dist/cjs/tests/unit/agent-execution-model.test.js.map +0 -1
  383. package/dist/cjs/tests/unit/agent-metrics.test.d.ts +0 -1
  384. package/dist/cjs/tests/unit/agent-metrics.test.js +0 -112
  385. package/dist/cjs/tests/unit/agent-metrics.test.js.map +0 -1
  386. package/dist/cjs/tests/unit/agent-mode-routing.test.d.ts +0 -1
  387. package/dist/cjs/tests/unit/agent-mode-routing.test.js +0 -88
  388. package/dist/cjs/tests/unit/agent-mode-routing.test.js.map +0 -1
  389. package/dist/cjs/tests/unit/agent-system-prompt-variables.test.d.ts +0 -1
  390. package/dist/cjs/tests/unit/agent-system-prompt-variables.test.js +0 -23
  391. package/dist/cjs/tests/unit/agent-system-prompt-variables.test.js.map +0 -1
  392. package/dist/cjs/tests/unit/agent-temperature.test.d.ts +0 -1
  393. package/dist/cjs/tests/unit/agent-temperature.test.js +0 -191
  394. package/dist/cjs/tests/unit/agent-temperature.test.js.map +0 -1
  395. package/dist/cjs/tests/unit/agent-variables-validation.test.d.ts +0 -1
  396. package/dist/cjs/tests/unit/agent-variables-validation.test.js +0 -43
  397. package/dist/cjs/tests/unit/agent-variables-validation.test.js.map +0 -1
  398. package/dist/cjs/tests/unit/aisdk-clients.test.d.ts +0 -1
  399. package/dist/cjs/tests/unit/aisdk-clients.test.js +0 -86
  400. package/dist/cjs/tests/unit/aisdk-clients.test.js.map +0 -1
  401. package/dist/cjs/tests/unit/anthropic-cua-adaptive-thinking.test.d.ts +0 -1
  402. package/dist/cjs/tests/unit/anthropic-cua-adaptive-thinking.test.js +0 -250
  403. package/dist/cjs/tests/unit/anthropic-cua-adaptive-thinking.test.js.map +0 -1
  404. package/dist/cjs/tests/unit/api-client-observe-variables.test.d.ts +0 -1
  405. package/dist/cjs/tests/unit/api-client-observe-variables.test.js +0 -133
  406. package/dist/cjs/tests/unit/api-client-observe-variables.test.js.map +0 -1
  407. package/dist/cjs/tests/unit/api-multiregion.test.d.ts +0 -1
  408. package/dist/cjs/tests/unit/api-multiregion.test.js +0 -58
  409. package/dist/cjs/tests/unit/api-multiregion.test.js.map +0 -1
  410. package/dist/cjs/tests/unit/api-optional-model-api-key.test.d.ts +0 -1
  411. package/dist/cjs/tests/unit/api-optional-model-api-key.test.js +0 -155
  412. package/dist/cjs/tests/unit/api-optional-model-api-key.test.js.map +0 -1
  413. package/dist/cjs/tests/unit/api-variables-schema.test.d.ts +0 -1
  414. package/dist/cjs/tests/unit/api-variables-schema.test.js +0 -62
  415. package/dist/cjs/tests/unit/api-variables-schema.test.js.map +0 -1
  416. package/dist/cjs/tests/unit/browserbase-session-accessors.test.d.ts +0 -1
  417. package/dist/cjs/tests/unit/browserbase-session-accessors.test.js +0 -142
  418. package/dist/cjs/tests/unit/browserbase-session-accessors.test.js.map +0 -1
  419. package/dist/cjs/tests/unit/cache-llm-resolution.test.d.ts +0 -1
  420. package/dist/cjs/tests/unit/cache-llm-resolution.test.js +0 -186
  421. package/dist/cjs/tests/unit/cache-llm-resolution.test.js.map +0 -1
  422. package/dist/cjs/tests/unit/captcha-solver.test.d.ts +0 -1
  423. package/dist/cjs/tests/unit/captcha-solver.test.js +0 -154
  424. package/dist/cjs/tests/unit/captcha-solver.test.js.map +0 -1
  425. package/dist/cjs/tests/unit/cdp-connection-close.test.d.ts +0 -1
  426. package/dist/cjs/tests/unit/cdp-connection-close.test.js +0 -74
  427. package/dist/cjs/tests/unit/cdp-connection-close.test.js.map +0 -1
  428. package/dist/cjs/tests/unit/context-extra-http-headers.test.d.ts +0 -1
  429. package/dist/cjs/tests/unit/context-extra-http-headers.test.js +0 -58
  430. package/dist/cjs/tests/unit/context-extra-http-headers.test.js.map +0 -1
  431. package/dist/cjs/tests/unit/cookies.test.d.ts +0 -1
  432. package/dist/cjs/tests/unit/cookies.test.js +0 -944
  433. package/dist/cjs/tests/unit/cookies.test.js.map +0 -1
  434. package/dist/cjs/tests/unit/flowlogger-capturing-cdp.test.d.ts +0 -1
  435. package/dist/cjs/tests/unit/flowlogger-capturing-cdp.test.js +0 -95
  436. package/dist/cjs/tests/unit/flowlogger-capturing-cdp.test.js.map +0 -1
  437. package/dist/cjs/tests/unit/flowlogger-capturing-llm.test.d.ts +0 -1
  438. package/dist/cjs/tests/unit/flowlogger-capturing-llm.test.js +0 -43
  439. package/dist/cjs/tests/unit/flowlogger-capturing-llm.test.js.map +0 -1
  440. package/dist/cjs/tests/unit/flowlogger-eventstore.test.d.ts +0 -1
  441. package/dist/cjs/tests/unit/flowlogger-eventstore.test.js +0 -250
  442. package/dist/cjs/tests/unit/flowlogger-eventstore.test.js.map +0 -1
  443. package/dist/cjs/tests/unit/frame-registry-oopif-adoption.test.d.ts +0 -1
  444. package/dist/cjs/tests/unit/frame-registry-oopif-adoption.test.js +0 -60
  445. package/dist/cjs/tests/unit/frame-registry-oopif-adoption.test.js.map +0 -1
  446. package/dist/cjs/tests/unit/helpers/mockCDPSession.d.ts +0 -19
  447. package/dist/cjs/tests/unit/helpers/mockCDPSession.js +0 -29
  448. package/dist/cjs/tests/unit/helpers/mockCDPSession.js.map +0 -1
  449. package/dist/cjs/tests/unit/inference-temperature.test.d.ts +0 -1
  450. package/dist/cjs/tests/unit/inference-temperature.test.js +0 -65
  451. package/dist/cjs/tests/unit/inference-temperature.test.js.map +0 -1
  452. package/dist/cjs/tests/unit/llm-middleware.test.d.ts +0 -1
  453. package/dist/cjs/tests/unit/llm-middleware.test.js +0 -495
  454. package/dist/cjs/tests/unit/llm-middleware.test.js.map +0 -1
  455. package/dist/cjs/tests/unit/llm-provider.test.d.ts +0 -1
  456. package/dist/cjs/tests/unit/llm-provider.test.js +0 -64
  457. package/dist/cjs/tests/unit/llm-provider.test.js.map +0 -1
  458. package/dist/cjs/tests/unit/microsoft-cua-client.test.d.ts +0 -1
  459. package/dist/cjs/tests/unit/microsoft-cua-client.test.js +0 -86
  460. package/dist/cjs/tests/unit/microsoft-cua-client.test.js.map +0 -1
  461. package/dist/cjs/tests/unit/model-deprecation.test.d.ts +0 -1
  462. package/dist/cjs/tests/unit/model-deprecation.test.js +0 -142
  463. package/dist/cjs/tests/unit/model-deprecation.test.js.map +0 -1
  464. package/dist/cjs/tests/unit/model-utils.test.d.ts +0 -1
  465. package/dist/cjs/tests/unit/model-utils.test.js +0 -42
  466. package/dist/cjs/tests/unit/model-utils.test.js.map +0 -1
  467. package/dist/cjs/tests/unit/openai-compatible-temperature.test.d.ts +0 -1
  468. package/dist/cjs/tests/unit/openai-compatible-temperature.test.js +0 -84
  469. package/dist/cjs/tests/unit/openai-compatible-temperature.test.js.map +0 -1
  470. package/dist/cjs/tests/unit/openai-cua-client.test.d.ts +0 -1
  471. package/dist/cjs/tests/unit/openai-cua-client.test.js +0 -71
  472. package/dist/cjs/tests/unit/openai-cua-client.test.js.map +0 -1
  473. package/dist/cjs/tests/unit/page-extra-http-headers.test.d.ts +0 -1
  474. package/dist/cjs/tests/unit/page-extra-http-headers.test.js +0 -92
  475. package/dist/cjs/tests/unit/page-extra-http-headers.test.js.map +0 -1
  476. package/dist/cjs/tests/unit/page-snapshot.test.d.ts +0 -1
  477. package/dist/cjs/tests/unit/page-snapshot.test.js +0 -75
  478. package/dist/cjs/tests/unit/page-snapshot.test.js.map +0 -1
  479. package/dist/cjs/tests/unit/prompt-observe-variables.test.d.ts +0 -1
  480. package/dist/cjs/tests/unit/prompt-observe-variables.test.js +0 -25
  481. package/dist/cjs/tests/unit/prompt-observe-variables.test.js.map +0 -1
  482. package/dist/cjs/tests/unit/public-api/export-surface.test.d.ts +0 -1
  483. package/dist/cjs/tests/unit/public-api/export-surface.test.js +0 -107
  484. package/dist/cjs/tests/unit/public-api/export-surface.test.js.map +0 -1
  485. package/dist/cjs/tests/unit/public-api/llm-and-agents.test.d.ts +0 -1
  486. package/dist/cjs/tests/unit/public-api/llm-and-agents.test.js +0 -179
  487. package/dist/cjs/tests/unit/public-api/llm-and-agents.test.js.map +0 -1
  488. package/dist/cjs/tests/unit/public-api/public-error-types.test.d.ts +0 -62
  489. package/dist/cjs/tests/unit/public-api/public-error-types.test.js +0 -110
  490. package/dist/cjs/tests/unit/public-api/public-error-types.test.js.map +0 -1
  491. package/dist/cjs/tests/unit/public-api/public-types.test.d.ts +0 -1
  492. package/dist/cjs/tests/unit/public-api/public-types.test.js +0 -99
  493. package/dist/cjs/tests/unit/public-api/public-types.test.js.map +0 -1
  494. package/dist/cjs/tests/unit/public-api/runtime-utils.test.d.ts +0 -1
  495. package/dist/cjs/tests/unit/public-api/runtime-utils.test.js +0 -60
  496. package/dist/cjs/tests/unit/public-api/runtime-utils.test.js.map +0 -1
  497. package/dist/cjs/tests/unit/public-api/schema-utils.test.d.ts +0 -1
  498. package/dist/cjs/tests/unit/public-api/schema-utils.test.js +0 -95
  499. package/dist/cjs/tests/unit/public-api/schema-utils.test.js.map +0 -1
  500. package/dist/cjs/tests/unit/public-api/timeout-error-types.test.d.ts +0 -1
  501. package/dist/cjs/tests/unit/public-api/timeout-error-types.test.js +0 -121
  502. package/dist/cjs/tests/unit/public-api/timeout-error-types.test.js.map +0 -1
  503. package/dist/cjs/tests/unit/public-api/tool-type-export.test.d.ts +0 -1
  504. package/dist/cjs/tests/unit/public-api/tool-type-export.test.js +0 -65
  505. package/dist/cjs/tests/unit/public-api/tool-type-export.test.js.map +0 -1
  506. package/dist/cjs/tests/unit/public-api/v3-core.test.d.ts +0 -1
  507. package/dist/cjs/tests/unit/public-api/v3-core.test.js +0 -108
  508. package/dist/cjs/tests/unit/public-api/v3-core.test.js.map +0 -1
  509. package/dist/cjs/tests/unit/safety-confirmation.test.d.ts +0 -1
  510. package/dist/cjs/tests/unit/safety-confirmation.test.js +0 -110
  511. package/dist/cjs/tests/unit/safety-confirmation.test.js.map +0 -1
  512. package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.d.ts +0 -1
  513. package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.js +0 -431
  514. package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.js.map +0 -1
  515. package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.d.ts +0 -1
  516. package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.js +0 -306
  517. package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.js.map +0 -1
  518. package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.d.ts +0 -1
  519. package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.js +0 -504
  520. package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.js.map +0 -1
  521. package/dist/cjs/tests/unit/snapshot-cbor.test.d.ts +0 -1
  522. package/dist/cjs/tests/unit/snapshot-cbor.test.js +0 -204
  523. package/dist/cjs/tests/unit/snapshot-cbor.test.js.map +0 -1
  524. package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.d.ts +0 -1
  525. package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.js +0 -220
  526. package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.js.map +0 -1
  527. package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.d.ts +0 -1
  528. package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.js +0 -107
  529. package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.js.map +0 -1
  530. package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.d.ts +0 -1
  531. package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.js +0 -89
  532. package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.js.map +0 -1
  533. package/dist/cjs/tests/unit/snapshot-frame-merge.test.d.ts +0 -1
  534. package/dist/cjs/tests/unit/snapshot-frame-merge.test.js +0 -335
  535. package/dist/cjs/tests/unit/snapshot-frame-merge.test.js.map +0 -1
  536. package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.d.ts +0 -1
  537. package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.js +0 -84
  538. package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.js.map +0 -1
  539. package/dist/cjs/tests/unit/snapshot-xpath-utils.test.d.ts +0 -1
  540. package/dist/cjs/tests/unit/snapshot-xpath-utils.test.js +0 -74
  541. package/dist/cjs/tests/unit/snapshot-xpath-utils.test.js.map +0 -1
  542. package/dist/cjs/tests/unit/timeout-handlers.test.d.ts +0 -1
  543. package/dist/cjs/tests/unit/timeout-handlers.test.js +0 -897
  544. package/dist/cjs/tests/unit/timeout-handlers.test.js.map +0 -1
  545. package/dist/cjs/tests/unit/understudy-command-exception.test.d.ts +0 -1
  546. package/dist/cjs/tests/unit/understudy-command-exception.test.js +0 -57
  547. package/dist/cjs/tests/unit/understudy-command-exception.test.js.map +0 -1
  548. package/dist/cjs/tests/unit/xpath-parser.test.d.ts +0 -1
  549. package/dist/cjs/tests/unit/xpath-parser.test.js +0 -311
  550. package/dist/cjs/tests/unit/xpath-parser.test.js.map +0 -1
  551. package/dist/cjs/tests/unit/xpath-resolver.test.d.ts +0 -1
  552. package/dist/cjs/tests/unit/xpath-resolver.test.js +0 -80
  553. package/dist/cjs/tests/unit/xpath-resolver.test.js.map +0 -1
  554. package/dist/cjs/tests/unit/zod-enum-compatibility.test.d.ts +0 -1
  555. package/dist/cjs/tests/unit/zod-enum-compatibility.test.js +0 -149
  556. package/dist/cjs/tests/unit/zod-enum-compatibility.test.js.map +0 -1
  557. package/dist/esm/tests/cache-variables.test.d.ts +0 -1
  558. package/dist/esm/tests/cache-variables.test.js +0 -219
  559. package/dist/esm/tests/cache-variables.test.js.map +0 -1
  560. package/dist/esm/tests/integration/agent-abort-signal.spec.d.ts +0 -1
  561. package/dist/esm/tests/integration/agent-abort-signal.spec.js +0 -121
  562. package/dist/esm/tests/integration/agent-abort-signal.spec.js.map +0 -1
  563. package/dist/esm/tests/integration/agent-cache-self-heal.spec.d.ts +0 -1
  564. package/dist/esm/tests/integration/agent-cache-self-heal.spec.js +0 -78
  565. package/dist/esm/tests/integration/agent-cache-self-heal.spec.js.map +0 -1
  566. package/dist/esm/tests/integration/agent-callbacks.spec.d.ts +0 -1
  567. package/dist/esm/tests/integration/agent-callbacks.spec.js +0 -383
  568. package/dist/esm/tests/integration/agent-callbacks.spec.js.map +0 -1
  569. package/dist/esm/tests/integration/agent-experimental-validation.spec.d.ts +0 -1
  570. package/dist/esm/tests/integration/agent-experimental-validation.spec.js +0 -360
  571. package/dist/esm/tests/integration/agent-experimental-validation.spec.js.map +0 -1
  572. package/dist/esm/tests/integration/agent-hybrid-mode.spec.d.ts +0 -1
  573. package/dist/esm/tests/integration/agent-hybrid-mode.spec.js +0 -260
  574. package/dist/esm/tests/integration/agent-hybrid-mode.spec.js.map +0 -1
  575. package/dist/esm/tests/integration/agent-message-continuation.spec.d.ts +0 -1
  576. package/dist/esm/tests/integration/agent-message-continuation.spec.js +0 -110
  577. package/dist/esm/tests/integration/agent-message-continuation.spec.js.map +0 -1
  578. package/dist/esm/tests/integration/agent-streaming.spec.d.ts +0 -1
  579. package/dist/esm/tests/integration/agent-streaming.spec.js +0 -138
  580. package/dist/esm/tests/integration/agent-streaming.spec.js.map +0 -1
  581. package/dist/esm/tests/integration/cdp-close-api-region.spec.d.ts +0 -1
  582. package/dist/esm/tests/integration/cdp-close-api-region.spec.js +0 -39
  583. package/dist/esm/tests/integration/cdp-close-api-region.spec.js.map +0 -1
  584. package/dist/esm/tests/integration/cdp-connection-close.spec.d.ts +0 -1
  585. package/dist/esm/tests/integration/cdp-connection-close.spec.js +0 -74
  586. package/dist/esm/tests/integration/cdp-connection-close.spec.js.map +0 -1
  587. package/dist/esm/tests/integration/cdp-session-detached.spec.d.ts +0 -1
  588. package/dist/esm/tests/integration/cdp-session-detached.spec.js +0 -43
  589. package/dist/esm/tests/integration/cdp-session-detached.spec.js.map +0 -1
  590. package/dist/esm/tests/integration/chrome-newtab-page-tracking.spec.d.ts +0 -1
  591. package/dist/esm/tests/integration/chrome-newtab-page-tracking.spec.js +0 -54
  592. package/dist/esm/tests/integration/chrome-newtab-page-tracking.spec.js.map +0 -1
  593. package/dist/esm/tests/integration/click-count.spec.d.ts +0 -1
  594. package/dist/esm/tests/integration/click-count.spec.js +0 -161
  595. package/dist/esm/tests/integration/click-count.spec.js.map +0 -1
  596. package/dist/esm/tests/integration/connect-to-existing-browser.spec.d.ts +0 -1
  597. package/dist/esm/tests/integration/connect-to-existing-browser.spec.js +0 -97
  598. package/dist/esm/tests/integration/connect-to-existing-browser.spec.js.map +0 -1
  599. package/dist/esm/tests/integration/context-addInitScript.spec.d.ts +0 -1
  600. package/dist/esm/tests/integration/context-addInitScript.spec.js +0 -283
  601. package/dist/esm/tests/integration/context-addInitScript.spec.js.map +0 -1
  602. package/dist/esm/tests/integration/context-extra-http-headers.spec.d.ts +0 -1
  603. package/dist/esm/tests/integration/context-extra-http-headers.spec.js +0 -47
  604. package/dist/esm/tests/integration/context-extra-http-headers.spec.js.map +0 -1
  605. package/dist/esm/tests/integration/cookies.spec.d.ts +0 -1
  606. package/dist/esm/tests/integration/cookies.spec.js +0 -185
  607. package/dist/esm/tests/integration/cookies.spec.js.map +0 -1
  608. package/dist/esm/tests/integration/default-page-tracking.spec.d.ts +0 -1
  609. package/dist/esm/tests/integration/default-page-tracking.spec.js +0 -50
  610. package/dist/esm/tests/integration/default-page-tracking.spec.js.map +0 -1
  611. package/dist/esm/tests/integration/downloads.spec.d.ts +0 -1
  612. package/dist/esm/tests/integration/downloads.spec.js +0 -47
  613. package/dist/esm/tests/integration/downloads.spec.js.map +0 -1
  614. package/dist/esm/tests/integration/flowLogger.spec.d.ts +0 -1
  615. package/dist/esm/tests/integration/flowLogger.spec.js +0 -716
  616. package/dist/esm/tests/integration/flowLogger.spec.js.map +0 -1
  617. package/dist/esm/tests/integration/frame-get-location-and-click.spec.d.ts +0 -1
  618. package/dist/esm/tests/integration/frame-get-location-and-click.spec.js +0 -55
  619. package/dist/esm/tests/integration/frame-get-location-and-click.spec.js.map +0 -1
  620. package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.d.ts +0 -1
  621. package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.js +0 -217
  622. package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.js.map +0 -1
  623. package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.d.ts +0 -1
  624. package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.js +0 -472
  625. package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.js.map +0 -1
  626. package/dist/esm/tests/integration/keep-alive.child.d.ts +0 -1
  627. package/dist/esm/tests/integration/keep-alive.child.js +0 -83
  628. package/dist/esm/tests/integration/keep-alive.child.js.map +0 -1
  629. package/dist/esm/tests/integration/keep-alive.spec.d.ts +0 -22
  630. package/dist/esm/tests/integration/keep-alive.spec.js +0 -482
  631. package/dist/esm/tests/integration/keep-alive.spec.js.map +0 -1
  632. package/dist/esm/tests/integration/keyboard.spec.d.ts +0 -1
  633. package/dist/esm/tests/integration/keyboard.spec.js +0 -257
  634. package/dist/esm/tests/integration/keyboard.spec.js.map +0 -1
  635. package/dist/esm/tests/integration/locator-backend-node-id.spec.d.ts +0 -1
  636. package/dist/esm/tests/integration/locator-backend-node-id.spec.js +0 -148
  637. package/dist/esm/tests/integration/locator-backend-node-id.spec.js.map +0 -1
  638. package/dist/esm/tests/integration/locator-content-methods.spec.d.ts +0 -1
  639. package/dist/esm/tests/integration/locator-content-methods.spec.js +0 -178
  640. package/dist/esm/tests/integration/locator-content-methods.spec.js.map +0 -1
  641. package/dist/esm/tests/integration/locator-count-iframe.spec.d.ts +0 -1
  642. package/dist/esm/tests/integration/locator-count-iframe.spec.js +0 -127
  643. package/dist/esm/tests/integration/locator-count-iframe.spec.js.map +0 -1
  644. package/dist/esm/tests/integration/locator-count.spec.d.ts +0 -1
  645. package/dist/esm/tests/integration/locator-count.spec.js +0 -66
  646. package/dist/esm/tests/integration/locator-count.spec.js.map +0 -1
  647. package/dist/esm/tests/integration/locator-fill.spec.d.ts +0 -1
  648. package/dist/esm/tests/integration/locator-fill.spec.js +0 -115
  649. package/dist/esm/tests/integration/locator-fill.spec.js.map +0 -1
  650. package/dist/esm/tests/integration/locator-input-methods.spec.d.ts +0 -1
  651. package/dist/esm/tests/integration/locator-input-methods.spec.js +0 -125
  652. package/dist/esm/tests/integration/locator-input-methods.spec.js.map +0 -1
  653. package/dist/esm/tests/integration/locator-nth.spec.d.ts +0 -1
  654. package/dist/esm/tests/integration/locator-nth.spec.js +0 -173
  655. package/dist/esm/tests/integration/locator-nth.spec.js.map +0 -1
  656. package/dist/esm/tests/integration/locator-select-option.spec.d.ts +0 -1
  657. package/dist/esm/tests/integration/locator-select-option.spec.js +0 -214
  658. package/dist/esm/tests/integration/locator-select-option.spec.js.map +0 -1
  659. package/dist/esm/tests/integration/logger-initialization.spec.d.ts +0 -1
  660. package/dist/esm/tests/integration/logger-initialization.spec.js +0 -595
  661. package/dist/esm/tests/integration/logger-initialization.spec.js.map +0 -1
  662. package/dist/esm/tests/integration/multi-instance-logger.spec.d.ts +0 -1
  663. package/dist/esm/tests/integration/multi-instance-logger.spec.js +0 -291
  664. package/dist/esm/tests/integration/multi-instance-logger.spec.js.map +0 -1
  665. package/dist/esm/tests/integration/nested-div.spec.d.ts +0 -1
  666. package/dist/esm/tests/integration/nested-div.spec.js +0 -20
  667. package/dist/esm/tests/integration/nested-div.spec.js.map +0 -1
  668. package/dist/esm/tests/integration/observe-element-id-format.spec.d.ts +0 -1
  669. package/dist/esm/tests/integration/observe-element-id-format.spec.js +0 -128
  670. package/dist/esm/tests/integration/observe-element-id-format.spec.js.map +0 -1
  671. package/dist/esm/tests/integration/page-addInitScript.spec.d.ts +0 -1
  672. package/dist/esm/tests/integration/page-addInitScript.spec.js +0 -92
  673. package/dist/esm/tests/integration/page-addInitScript.spec.js.map +0 -1
  674. package/dist/esm/tests/integration/page-console.spec.d.ts +0 -1
  675. package/dist/esm/tests/integration/page-console.spec.js +0 -45
  676. package/dist/esm/tests/integration/page-console.spec.js.map +0 -1
  677. package/dist/esm/tests/integration/page-drag-and-drop.spec.d.ts +0 -1
  678. package/dist/esm/tests/integration/page-drag-and-drop.spec.js +0 -435
  679. package/dist/esm/tests/integration/page-drag-and-drop.spec.js.map +0 -1
  680. package/dist/esm/tests/integration/page-extra-http-headers.spec.d.ts +0 -1
  681. package/dist/esm/tests/integration/page-extra-http-headers.spec.js +0 -83
  682. package/dist/esm/tests/integration/page-extra-http-headers.spec.js.map +0 -1
  683. package/dist/esm/tests/integration/page-goto-response.spec.d.ts +0 -1
  684. package/dist/esm/tests/integration/page-goto-response.spec.js +0 -32
  685. package/dist/esm/tests/integration/page-goto-response.spec.js.map +0 -1
  686. package/dist/esm/tests/integration/page-hover.spec.d.ts +0 -1
  687. package/dist/esm/tests/integration/page-hover.spec.js +0 -163
  688. package/dist/esm/tests/integration/page-hover.spec.js.map +0 -1
  689. package/dist/esm/tests/integration/page-screenshot.spec.d.ts +0 -1
  690. package/dist/esm/tests/integration/page-screenshot.spec.js +0 -257
  691. package/dist/esm/tests/integration/page-screenshot.spec.js.map +0 -1
  692. package/dist/esm/tests/integration/page-scroll.spec.d.ts +0 -1
  693. package/dist/esm/tests/integration/page-scroll.spec.js +0 -181
  694. package/dist/esm/tests/integration/page-scroll.spec.js.map +0 -1
  695. package/dist/esm/tests/integration/page-send-cdp.spec.d.ts +0 -1
  696. package/dist/esm/tests/integration/page-send-cdp.spec.js +0 -45
  697. package/dist/esm/tests/integration/page-send-cdp.spec.js.map +0 -1
  698. package/dist/esm/tests/integration/perform-understudy-method.spec.d.ts +0 -1
  699. package/dist/esm/tests/integration/perform-understudy-method.spec.js +0 -61
  700. package/dist/esm/tests/integration/perform-understudy-method.spec.js.map +0 -1
  701. package/dist/esm/tests/integration/setinputfiles.spec.d.ts +0 -1
  702. package/dist/esm/tests/integration/setinputfiles.spec.js +0 -128
  703. package/dist/esm/tests/integration/setinputfiles.spec.js.map +0 -1
  704. package/dist/esm/tests/integration/shadow-iframe-oopif.spec.d.ts +0 -1
  705. package/dist/esm/tests/integration/shadow-iframe-oopif.spec.js +0 -156
  706. package/dist/esm/tests/integration/shadow-iframe-oopif.spec.js.map +0 -1
  707. package/dist/esm/tests/integration/shadow-iframe-spif.spec.d.ts +0 -1
  708. package/dist/esm/tests/integration/shadow-iframe-spif.spec.js +0 -155
  709. package/dist/esm/tests/integration/shadow-iframe-spif.spec.js.map +0 -1
  710. package/dist/esm/tests/integration/testUtils.d.ts +0 -40
  711. package/dist/esm/tests/integration/testUtils.js +0 -178
  712. package/dist/esm/tests/integration/testUtils.js.map +0 -1
  713. package/dist/esm/tests/integration/text-selector-innermost.spec.d.ts +0 -1
  714. package/dist/esm/tests/integration/text-selector-innermost.spec.js +0 -103
  715. package/dist/esm/tests/integration/text-selector-innermost.spec.js.map +0 -1
  716. package/dist/esm/tests/integration/timeouts.spec.d.ts +0 -1
  717. package/dist/esm/tests/integration/timeouts.spec.js +0 -307
  718. package/dist/esm/tests/integration/timeouts.spec.js.map +0 -1
  719. package/dist/esm/tests/integration/user-data-dir.spec.d.ts +0 -1
  720. package/dist/esm/tests/integration/user-data-dir.spec.js +0 -42
  721. package/dist/esm/tests/integration/user-data-dir.spec.js.map +0 -1
  722. package/dist/esm/tests/integration/v3.config.d.ts +0 -4
  723. package/dist/esm/tests/integration/v3.config.js +0 -7
  724. package/dist/esm/tests/integration/v3.config.js.map +0 -1
  725. package/dist/esm/tests/integration/v3.dynamic.config.d.ts +0 -4
  726. package/dist/esm/tests/integration/v3.dynamic.config.js +0 -44
  727. package/dist/esm/tests/integration/v3.dynamic.config.js.map +0 -1
  728. package/dist/esm/tests/integration/v3.playwright.config.d.ts +0 -2
  729. package/dist/esm/tests/integration/v3.playwright.config.js +0 -46
  730. package/dist/esm/tests/integration/v3.playwright.config.js.map +0 -1
  731. package/dist/esm/tests/integration/wait-for-selector.spec.d.ts +0 -1
  732. package/dist/esm/tests/integration/wait-for-selector.spec.js +0 -681
  733. package/dist/esm/tests/integration/wait-for-selector.spec.js.map +0 -1
  734. package/dist/esm/tests/integration/wait-for-timeout.spec.d.ts +0 -1
  735. package/dist/esm/tests/integration/wait-for-timeout.spec.js +0 -116
  736. package/dist/esm/tests/integration/wait-for-timeout.spec.js.map +0 -1
  737. package/dist/esm/tests/integration/xpath-for-location-deep.spec.d.ts +0 -1
  738. package/dist/esm/tests/integration/xpath-for-location-deep.spec.js +0 -85
  739. package/dist/esm/tests/integration/xpath-for-location-deep.spec.js.map +0 -1
  740. package/dist/esm/tests/unit/agent-captcha-hooks.test.d.ts +0 -1
  741. package/dist/esm/tests/unit/agent-captcha-hooks.test.js +0 -339
  742. package/dist/esm/tests/unit/agent-captcha-hooks.test.js.map +0 -1
  743. package/dist/esm/tests/unit/agent-execution-model.test.d.ts +0 -1
  744. package/dist/esm/tests/unit/agent-execution-model.test.js +0 -148
  745. package/dist/esm/tests/unit/agent-execution-model.test.js.map +0 -1
  746. package/dist/esm/tests/unit/agent-metrics.test.d.ts +0 -1
  747. package/dist/esm/tests/unit/agent-metrics.test.js +0 -110
  748. package/dist/esm/tests/unit/agent-metrics.test.js.map +0 -1
  749. package/dist/esm/tests/unit/agent-mode-routing.test.d.ts +0 -1
  750. package/dist/esm/tests/unit/agent-mode-routing.test.js +0 -86
  751. package/dist/esm/tests/unit/agent-mode-routing.test.js.map +0 -1
  752. package/dist/esm/tests/unit/agent-system-prompt-variables.test.d.ts +0 -1
  753. package/dist/esm/tests/unit/agent-system-prompt-variables.test.js +0 -21
  754. package/dist/esm/tests/unit/agent-system-prompt-variables.test.js.map +0 -1
  755. package/dist/esm/tests/unit/agent-temperature.test.d.ts +0 -1
  756. package/dist/esm/tests/unit/agent-temperature.test.js +0 -189
  757. package/dist/esm/tests/unit/agent-temperature.test.js.map +0 -1
  758. package/dist/esm/tests/unit/agent-variables-validation.test.d.ts +0 -1
  759. package/dist/esm/tests/unit/agent-variables-validation.test.js +0 -41
  760. package/dist/esm/tests/unit/agent-variables-validation.test.js.map +0 -1
  761. package/dist/esm/tests/unit/aisdk-clients.test.d.ts +0 -1
  762. package/dist/esm/tests/unit/aisdk-clients.test.js +0 -84
  763. package/dist/esm/tests/unit/aisdk-clients.test.js.map +0 -1
  764. package/dist/esm/tests/unit/anthropic-cua-adaptive-thinking.test.d.ts +0 -1
  765. package/dist/esm/tests/unit/anthropic-cua-adaptive-thinking.test.js +0 -245
  766. package/dist/esm/tests/unit/anthropic-cua-adaptive-thinking.test.js.map +0 -1
  767. package/dist/esm/tests/unit/api-client-observe-variables.test.d.ts +0 -1
  768. package/dist/esm/tests/unit/api-client-observe-variables.test.js +0 -131
  769. package/dist/esm/tests/unit/api-client-observe-variables.test.js.map +0 -1
  770. package/dist/esm/tests/unit/api-multiregion.test.d.ts +0 -1
  771. package/dist/esm/tests/unit/api-multiregion.test.js +0 -56
  772. package/dist/esm/tests/unit/api-multiregion.test.js.map +0 -1
  773. package/dist/esm/tests/unit/api-optional-model-api-key.test.d.ts +0 -1
  774. package/dist/esm/tests/unit/api-optional-model-api-key.test.js +0 -153
  775. package/dist/esm/tests/unit/api-optional-model-api-key.test.js.map +0 -1
  776. package/dist/esm/tests/unit/api-variables-schema.test.d.ts +0 -1
  777. package/dist/esm/tests/unit/api-variables-schema.test.js +0 -60
  778. package/dist/esm/tests/unit/api-variables-schema.test.js.map +0 -1
  779. package/dist/esm/tests/unit/browserbase-session-accessors.test.d.ts +0 -1
  780. package/dist/esm/tests/unit/browserbase-session-accessors.test.js +0 -140
  781. package/dist/esm/tests/unit/browserbase-session-accessors.test.js.map +0 -1
  782. package/dist/esm/tests/unit/cache-llm-resolution.test.d.ts +0 -1
  783. package/dist/esm/tests/unit/cache-llm-resolution.test.js +0 -184
  784. package/dist/esm/tests/unit/cache-llm-resolution.test.js.map +0 -1
  785. package/dist/esm/tests/unit/captcha-solver.test.d.ts +0 -1
  786. package/dist/esm/tests/unit/captcha-solver.test.js +0 -152
  787. package/dist/esm/tests/unit/captcha-solver.test.js.map +0 -1
  788. package/dist/esm/tests/unit/cdp-connection-close.test.d.ts +0 -1
  789. package/dist/esm/tests/unit/cdp-connection-close.test.js +0 -72
  790. package/dist/esm/tests/unit/cdp-connection-close.test.js.map +0 -1
  791. package/dist/esm/tests/unit/context-extra-http-headers.test.d.ts +0 -1
  792. package/dist/esm/tests/unit/context-extra-http-headers.test.js +0 -56
  793. package/dist/esm/tests/unit/context-extra-http-headers.test.js.map +0 -1
  794. package/dist/esm/tests/unit/cookies.test.d.ts +0 -1
  795. package/dist/esm/tests/unit/cookies.test.js +0 -909
  796. package/dist/esm/tests/unit/cookies.test.js.map +0 -1
  797. package/dist/esm/tests/unit/flowlogger-capturing-cdp.test.d.ts +0 -1
  798. package/dist/esm/tests/unit/flowlogger-capturing-cdp.test.js +0 -93
  799. package/dist/esm/tests/unit/flowlogger-capturing-cdp.test.js.map +0 -1
  800. package/dist/esm/tests/unit/flowlogger-capturing-llm.test.d.ts +0 -1
  801. package/dist/esm/tests/unit/flowlogger-capturing-llm.test.js +0 -41
  802. package/dist/esm/tests/unit/flowlogger-capturing-llm.test.js.map +0 -1
  803. package/dist/esm/tests/unit/flowlogger-eventstore.test.d.ts +0 -1
  804. package/dist/esm/tests/unit/flowlogger-eventstore.test.js +0 -248
  805. package/dist/esm/tests/unit/flowlogger-eventstore.test.js.map +0 -1
  806. package/dist/esm/tests/unit/frame-registry-oopif-adoption.test.d.ts +0 -1
  807. package/dist/esm/tests/unit/frame-registry-oopif-adoption.test.js +0 -58
  808. package/dist/esm/tests/unit/frame-registry-oopif-adoption.test.js.map +0 -1
  809. package/dist/esm/tests/unit/helpers/mockCDPSession.d.ts +0 -19
  810. package/dist/esm/tests/unit/helpers/mockCDPSession.js +0 -25
  811. package/dist/esm/tests/unit/helpers/mockCDPSession.js.map +0 -1
  812. package/dist/esm/tests/unit/inference-temperature.test.d.ts +0 -1
  813. package/dist/esm/tests/unit/inference-temperature.test.js +0 -63
  814. package/dist/esm/tests/unit/inference-temperature.test.js.map +0 -1
  815. package/dist/esm/tests/unit/llm-middleware.test.d.ts +0 -1
  816. package/dist/esm/tests/unit/llm-middleware.test.js +0 -460
  817. package/dist/esm/tests/unit/llm-middleware.test.js.map +0 -1
  818. package/dist/esm/tests/unit/llm-provider.test.d.ts +0 -1
  819. package/dist/esm/tests/unit/llm-provider.test.js +0 -62
  820. package/dist/esm/tests/unit/llm-provider.test.js.map +0 -1
  821. package/dist/esm/tests/unit/microsoft-cua-client.test.d.ts +0 -1
  822. package/dist/esm/tests/unit/microsoft-cua-client.test.js +0 -84
  823. package/dist/esm/tests/unit/microsoft-cua-client.test.js.map +0 -1
  824. package/dist/esm/tests/unit/model-deprecation.test.d.ts +0 -1
  825. package/dist/esm/tests/unit/model-deprecation.test.js +0 -140
  826. package/dist/esm/tests/unit/model-deprecation.test.js.map +0 -1
  827. package/dist/esm/tests/unit/model-utils.test.d.ts +0 -1
  828. package/dist/esm/tests/unit/model-utils.test.js +0 -40
  829. package/dist/esm/tests/unit/model-utils.test.js.map +0 -1
  830. package/dist/esm/tests/unit/openai-compatible-temperature.test.d.ts +0 -1
  831. package/dist/esm/tests/unit/openai-compatible-temperature.test.js +0 -82
  832. package/dist/esm/tests/unit/openai-compatible-temperature.test.js.map +0 -1
  833. package/dist/esm/tests/unit/openai-cua-client.test.d.ts +0 -1
  834. package/dist/esm/tests/unit/openai-cua-client.test.js +0 -69
  835. package/dist/esm/tests/unit/openai-cua-client.test.js.map +0 -1
  836. package/dist/esm/tests/unit/page-extra-http-headers.test.d.ts +0 -1
  837. package/dist/esm/tests/unit/page-extra-http-headers.test.js +0 -90
  838. package/dist/esm/tests/unit/page-extra-http-headers.test.js.map +0 -1
  839. package/dist/esm/tests/unit/page-snapshot.test.d.ts +0 -1
  840. package/dist/esm/tests/unit/page-snapshot.test.js +0 -40
  841. package/dist/esm/tests/unit/page-snapshot.test.js.map +0 -1
  842. package/dist/esm/tests/unit/prompt-observe-variables.test.d.ts +0 -1
  843. package/dist/esm/tests/unit/prompt-observe-variables.test.js +0 -23
  844. package/dist/esm/tests/unit/prompt-observe-variables.test.js.map +0 -1
  845. package/dist/esm/tests/unit/public-api/export-surface.test.d.ts +0 -1
  846. package/dist/esm/tests/unit/public-api/export-surface.test.js +0 -72
  847. package/dist/esm/tests/unit/public-api/export-surface.test.js.map +0 -1
  848. package/dist/esm/tests/unit/public-api/llm-and-agents.test.d.ts +0 -1
  849. package/dist/esm/tests/unit/public-api/llm-and-agents.test.js +0 -144
  850. package/dist/esm/tests/unit/public-api/llm-and-agents.test.js.map +0 -1
  851. package/dist/esm/tests/unit/public-api/public-error-types.test.d.ts +0 -62
  852. package/dist/esm/tests/unit/public-api/public-error-types.test.js +0 -74
  853. package/dist/esm/tests/unit/public-api/public-error-types.test.js.map +0 -1
  854. package/dist/esm/tests/unit/public-api/public-types.test.d.ts +0 -1
  855. package/dist/esm/tests/unit/public-api/public-types.test.js +0 -97
  856. package/dist/esm/tests/unit/public-api/public-types.test.js.map +0 -1
  857. package/dist/esm/tests/unit/public-api/runtime-utils.test.d.ts +0 -1
  858. package/dist/esm/tests/unit/public-api/runtime-utils.test.js +0 -25
  859. package/dist/esm/tests/unit/public-api/runtime-utils.test.js.map +0 -1
  860. package/dist/esm/tests/unit/public-api/schema-utils.test.d.ts +0 -1
  861. package/dist/esm/tests/unit/public-api/schema-utils.test.js +0 -60
  862. package/dist/esm/tests/unit/public-api/schema-utils.test.js.map +0 -1
  863. package/dist/esm/tests/unit/public-api/timeout-error-types.test.d.ts +0 -1
  864. package/dist/esm/tests/unit/public-api/timeout-error-types.test.js +0 -86
  865. package/dist/esm/tests/unit/public-api/timeout-error-types.test.js.map +0 -1
  866. package/dist/esm/tests/unit/public-api/tool-type-export.test.d.ts +0 -1
  867. package/dist/esm/tests/unit/public-api/tool-type-export.test.js +0 -30
  868. package/dist/esm/tests/unit/public-api/tool-type-export.test.js.map +0 -1
  869. package/dist/esm/tests/unit/public-api/v3-core.test.d.ts +0 -1
  870. package/dist/esm/tests/unit/public-api/v3-core.test.js +0 -73
  871. package/dist/esm/tests/unit/public-api/v3-core.test.js.map +0 -1
  872. package/dist/esm/tests/unit/safety-confirmation.test.d.ts +0 -1
  873. package/dist/esm/tests/unit/safety-confirmation.test.js +0 -108
  874. package/dist/esm/tests/unit/safety-confirmation.test.js.map +0 -1
  875. package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.d.ts +0 -1
  876. package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.js +0 -396
  877. package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.js.map +0 -1
  878. package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.d.ts +0 -1
  879. package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.js +0 -304
  880. package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.js.map +0 -1
  881. package/dist/esm/tests/unit/snapshot-capture-orchestration.test.d.ts +0 -1
  882. package/dist/esm/tests/unit/snapshot-capture-orchestration.test.js +0 -469
  883. package/dist/esm/tests/unit/snapshot-capture-orchestration.test.js.map +0 -1
  884. package/dist/esm/tests/unit/snapshot-cbor.test.d.ts +0 -1
  885. package/dist/esm/tests/unit/snapshot-cbor.test.js +0 -202
  886. package/dist/esm/tests/unit/snapshot-cbor.test.js.map +0 -1
  887. package/dist/esm/tests/unit/snapshot-dom-session-builders.test.d.ts +0 -1
  888. package/dist/esm/tests/unit/snapshot-dom-session-builders.test.js +0 -218
  889. package/dist/esm/tests/unit/snapshot-dom-session-builders.test.js.map +0 -1
  890. package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.d.ts +0 -1
  891. package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.js +0 -105
  892. package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.js.map +0 -1
  893. package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.d.ts +0 -1
  894. package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.js +0 -87
  895. package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.js.map +0 -1
  896. package/dist/esm/tests/unit/snapshot-frame-merge.test.d.ts +0 -1
  897. package/dist/esm/tests/unit/snapshot-frame-merge.test.js +0 -333
  898. package/dist/esm/tests/unit/snapshot-frame-merge.test.js.map +0 -1
  899. package/dist/esm/tests/unit/snapshot-tree-format-utils.test.d.ts +0 -1
  900. package/dist/esm/tests/unit/snapshot-tree-format-utils.test.js +0 -82
  901. package/dist/esm/tests/unit/snapshot-tree-format-utils.test.js.map +0 -1
  902. package/dist/esm/tests/unit/snapshot-xpath-utils.test.d.ts +0 -1
  903. package/dist/esm/tests/unit/snapshot-xpath-utils.test.js +0 -72
  904. package/dist/esm/tests/unit/snapshot-xpath-utils.test.js.map +0 -1
  905. package/dist/esm/tests/unit/timeout-handlers.test.d.ts +0 -1
  906. package/dist/esm/tests/unit/timeout-handlers.test.js +0 -862
  907. package/dist/esm/tests/unit/timeout-handlers.test.js.map +0 -1
  908. package/dist/esm/tests/unit/understudy-command-exception.test.d.ts +0 -1
  909. package/dist/esm/tests/unit/understudy-command-exception.test.js +0 -55
  910. package/dist/esm/tests/unit/understudy-command-exception.test.js.map +0 -1
  911. package/dist/esm/tests/unit/xpath-parser.test.d.ts +0 -1
  912. package/dist/esm/tests/unit/xpath-parser.test.js +0 -309
  913. package/dist/esm/tests/unit/xpath-parser.test.js.map +0 -1
  914. package/dist/esm/tests/unit/xpath-resolver.test.d.ts +0 -1
  915. package/dist/esm/tests/unit/xpath-resolver.test.js +0 -78
  916. package/dist/esm/tests/unit/xpath-resolver.test.js.map +0 -1
  917. package/dist/esm/tests/unit/zod-enum-compatibility.test.d.ts +0 -1
  918. package/dist/esm/tests/unit/zod-enum-compatibility.test.js +0 -114
  919. package/dist/esm/tests/unit/zod-enum-compatibility.test.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../../../../lib/v3/types/public/agent.ts"],"names":[],"mappings":";;;AAica,QAAA,oBAAoB,GAAG;IAClC,gBAAgB;IAChB,qBAAqB;IACrB,gBAAgB;IAChB,6BAA6B;IAC7B,wCAAwC;IACxC,oCAAoC;IACpC,2BAA2B;IAC3B,6BAA6B;IAC7B,4BAA4B;IAC5B,qCAAqC;IACrC,oCAAoC;IACpC,sCAAsC;IACtC,gDAAgD;IAChD,+BAA+B;IAC/B,6BAA6B;IAC7B,mBAAmB;CACX,CAAC","sourcesContent":["import type { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport {\n ToolSet,\n ModelMessage,\n wrapLanguageModel,\n StreamTextResult,\n StepResult,\n PrepareStepFunction,\n GenerateTextOnStepFinishCallback,\n StreamTextOnStepFinishCallback,\n StreamTextOnErrorCallback,\n StreamTextOnChunkCallback,\n StreamTextOnFinishCallback,\n} from \"ai\";\nimport { LogLine } from \"./logs.js\";\nimport { ClientOptions } from \"./model.js\";\nimport { StagehandZodObject } from \"../../zodCompat.js\";\n\n// Re-export ModelMessage for consumers who want to use it for conversation continuation\nexport type { ModelMessage } from \"ai\";\n\n// Re-export Tool type for consumers who want to define custom tools\nexport type { Tool } from \"ai\";\nimport { Page as PlaywrightPage } from \"playwright-core\";\nimport { Page as PuppeteerPage } from \"puppeteer-core\";\nimport { Page as PatchrightPage } from \"patchright-core\";\nimport { Page } from \"../../understudy/page.js\";\n\n// =============================================================================\n// Variable Types\n// =============================================================================\n\n/**\n * A variable value can be a simple primitive or a rich object with an optional description.\n * This unified type is shared across `act`, `agent.execute`, and other methods.\n *\n * @example Simple (backward-compatible):\n * ```typescript\n * variables: { username: \"john@example.com\" }\n * ```\n *\n * @example Rich with description (useful for agents):\n * ```typescript\n * variables: {\n * username: { value: \"john@example.com\", description: \"The login email\" }\n * }\n * ```\n */\nexport type VariableValue =\n | string\n | number\n | boolean\n | { value: string | number | boolean; description?: string };\n\n/**\n * A collection of named variables for use in act, agent, and other methods.\n */\nexport type Variables = Record<string, VariableValue>;\n\nexport interface AgentContext {\n options: AgentExecuteOptionsBase;\n maxSteps: number;\n systemPrompt: string;\n allTools: ToolSet;\n messages: ModelMessage[];\n wrappedModel: ReturnType<typeof wrapLanguageModel>;\n initialPageUrl: string;\n}\n\nexport interface AgentState {\n collectedReasoning: string[];\n actions: AgentAction[];\n finalMessage: string;\n completed: boolean;\n currentPageUrl: string;\n}\n\nexport interface AgentAction {\n type: string;\n reasoning?: string;\n taskCompleted?: boolean;\n action?: string;\n // Tool-specific fields\n timeMs?: number; // wait tool\n pageText?: string; // ariaTree tool\n pageUrl?: string; // ariaTree tool\n instruction?: string; // various tools\n [key: string]: unknown;\n}\n\nexport interface AgentResult {\n success: boolean;\n message: string;\n actions: AgentAction[];\n completed: boolean;\n metadata?: Record<string, unknown>;\n usage?: {\n input_tokens: number;\n output_tokens: number;\n reasoning_tokens?: number;\n cached_input_tokens?: number;\n inference_time_ms: number;\n };\n /**\n * The conversation messages from this execution.\n * Pass these to a subsequent execute() call via the `messages` option to continue the conversation.\n * @experimental\n */\n messages?: ModelMessage[];\n /**\n * Custom output data extracted based on the `output` schema provided in execute options.\n * Only populated if an `output` schema was provided.\n * @experimental\n */\n output?: Record<string, unknown>;\n}\n\nexport type AgentStreamResult = StreamTextResult<ToolSet, never> & {\n result: Promise<AgentResult>;\n};\n\n/**\n * Base callbacks shared between execute (non-streaming) and streaming modes.\n */\nexport interface AgentCallbacks {\n /**\n * Optional function called before each step to modify settings.\n * You can change the model, tool choices, active tools, system prompt,\n * and input messages for each step.\n */\n prepareStep?: PrepareStepFunction<ToolSet>;\n /**\n * Callback called when each step (LLM call) is finished.\n * This is called for intermediate steps as well as the final step.\n */\n onStepFinish?:\n | GenerateTextOnStepFinishCallback<ToolSet>\n | StreamTextOnStepFinishCallback<ToolSet>;\n}\n\n/**\n * Error message type for streaming-only callbacks used in non-streaming mode.\n * This provides a clear error message when users try to use streaming callbacks without stream: true.\n */\ntype StreamingCallbackNotAvailable =\n \"This callback requires 'stream: true' in AgentConfig. Set stream: true to use streaming callbacks like onChunk, onFinish, onError, and onAbort.\";\n\n/**\n * Error message for safety confirmation callback misuse.\n * Safety confirmations are only available for non-streaming CUA agent executions.\n */\ntype SafetyConfirmationCallbackNotAvailable =\n \"Safety confirmation callbacks are only available via non-streaming AgentExecuteOptions.callbacks when using mode: 'cua'.\";\n\n/**\n * Callbacks specific to the non-streaming execute method.\n */\nexport interface AgentExecuteCallbacks extends AgentCallbacks {\n /**\n * Callback called when each step (LLM call) is finished.\n */\n onStepFinish?: GenerateTextOnStepFinishCallback<ToolSet>;\n /**\n * Callback for handling safety confirmation requests from CUA providers.\n * Only available when running an agent configured with mode: \"cua\".\n */\n onSafetyConfirmation?: SafetyConfirmationHandler;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onChunk:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onChunk: async (chunk) => console.log(chunk) }\n * });\n * ```\n */\n onChunk?: StreamingCallbackNotAvailable;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onFinish:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onFinish: (event) => console.log(\"Done!\", event) }\n * });\n * ```\n */\n onFinish?: StreamingCallbackNotAvailable;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onError:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onError: ({ error }) => console.error(error) }\n * });\n * ```\n */\n onError?: StreamingCallbackNotAvailable;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onAbort:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onAbort: (event) => console.log(\"Aborted\", event.steps) }\n * });\n * ```\n */\n onAbort?: StreamingCallbackNotAvailable;\n}\n\n/**\n * Callbacks specific to the streaming mode.\n */\nexport interface AgentStreamCallbacks extends AgentCallbacks {\n /**\n * Callback called when each step (LLM call) is finished during streaming.\n */\n onStepFinish?: StreamTextOnStepFinishCallback<ToolSet>;\n /**\n * Callback called when an error occurs during streaming.\n * Use this to log errors or handle error states.\n */\n onError?: StreamTextOnErrorCallback;\n /**\n * Callback called for each chunk of the stream.\n * Stream processing will pause until the callback promise resolves.\n */\n onChunk?: StreamTextOnChunkCallback<ToolSet>;\n /**\n * Callback called when the stream finishes.\n */\n onFinish?: StreamTextOnFinishCallback<ToolSet>;\n /**\n * Callback called when the stream is aborted.\n */\n onAbort?: (event: {\n steps: Array<StepResult<ToolSet>>;\n }) => PromiseLike<void> | void;\n /**\n * NOT AVAILABLE in streaming mode.\n * Safety confirmations currently require non-streaming execute() on CUA agents.\n */\n onSafetyConfirmation?: SafetyConfirmationCallbackNotAvailable;\n}\n\n/**\n * Base options for agent execution (without callbacks).\n */\nexport interface AgentExecuteOptionsBase {\n instruction: string;\n maxSteps?: number;\n page?: PlaywrightPage | PuppeteerPage | PatchrightPage | Page;\n highlightCursor?: boolean;\n /**\n * Previous conversation messages to continue from.\n * Pass the `messages` from a previous AgentResult to continue that conversation.\n * @experimental\n */\n messages?: ModelMessage[];\n /**\n * An AbortSignal that can be used to cancel the agent execution.\n * When aborted, the agent will stop and return a partial result.\n * @experimental\n *\n * @example\n * ```typescript\n * const controller = new AbortController();\n * setTimeout(() => controller.abort(), 30000); // 30 second timeout\n *\n * const result = await agent.execute({\n * instruction: \"...\",\n * signal: controller.signal\n * });\n * ```\n */\n signal?: AbortSignal;\n /**\n * Tools to exclude from this execution.\n * Pass an array of tool names to prevent the agent from using those tools.\n *\n * **Note:** Not supported in CUA mode (`mode: \"cua\"`).\n *\n * **Available tools by mode:**\n *\n * **DOM mode (default):**\n * - `act` - Perform semantic actions (click, type, etc.)\n * - `fillForm` - Fill form fields using DOM selectors\n * - `ariaTree` - Get accessibility tree of the page\n * - `extract` - Extract structured data from page\n * - `goto` - Navigate to a URL\n * - `scroll` - Scroll using semantic directions (up/down/left/right)\n * - `keys` - Press keyboard keys\n * - `navback` - Navigate back in history\n * - `screenshot` - Take a screenshot\n * - `think` - Agent reasoning/planning step\n * - `wait` - Wait for time or condition\n * - `done` - Mark task as complete\n * - `search` - Web search (requires useSearch: true and BROWSERBASE_API_KEY)\n *\n * **Hybrid mode:**\n * - `click` - Click at specific coordinates\n * - `type` - Type text at coordinates\n * - `dragAndDrop` - Drag from one point to another\n * - `clickAndHold` - Click and hold at coordinates\n * - `fillFormVision` - Fill forms using vision/coordinates\n * - `act` - Perform semantic actions\n * - `ariaTree` - Get accessibility tree\n * - `extract` - Extract data from page\n * - `goto` - Navigate to URL\n * - `scroll` - Scroll using coordinates\n * - `keys` - Press keyboard keys\n * - `navback` - Navigate back\n * - `screenshot` - Take screenshot\n * - `think` - Agent reasoning step\n * - `wait` - Wait for time/condition\n * - `done` - Mark task complete\n * - `search` - Web search (requires useSearch: true and BROWSERBASE_API_KEY)\n *\n * @experimental\n * @example\n * ```typescript\n * // Exclude screenshot and extract tools\n * const result = await agent.execute({\n * instruction: \"Click the submit button\",\n * excludeTools: [\"screenshot\", \"extract\"]\n * });\n * ```\n */\n excludeTools?: string[];\n /**\n * A Zod schema defining custom output data to return when the task completes.\n * The agent will populate this data in the final done tool call.\n *\n * @experimental\n * @example\n * ```typescript\n * const result = await agent.execute({\n * instruction: \"Find the cheapest flight from NYC to LA\",\n * output: z.object({\n * price: z.string().describe(\"The price of the flight\"),\n * airline: z.string().describe(\"The airline name\"),\n * departureTime: z.string().describe(\"Departure time\"),\n * }),\n * });\n *\n * console.log(result.output); // { price: \"$199\", airline: \"Delta\", departureTime: \"8:00 AM\" }\n * ```\n */\n output?: StagehandZodObject;\n /**\n * Variables that the agent can use when filling forms or typing text.\n * The agent will see variable names and descriptions in the system prompt,\n * and can use them via `%variableName%` syntax in act/type/fillForm tool calls.\n *\n * Accepts both simple values and rich objects with descriptions (same type as `act`).\n *\n * **Note:** Not supported in CUA mode (`mode: \"cua\"`).\n *\n * @example\n * ```typescript\n * // Simple values\n * variables: { username: \"john@example.com\", password: \"secret123\" }\n *\n * // Rich values with descriptions (helps the agent understand context)\n * variables: {\n * username: { value: \"john@example.com\", description: \"The login email\" },\n * password: { value: \"secret123\", description: \"The login password\" },\n * }\n * ```\n */\n variables?: Variables;\n /**\n * Timeout in milliseconds for each agent tool call.\n * If a tool call exceeds this duration, it will be aborted and\n * reported back to the LLM as a timeout error so it can retry or adjust.\n * For tools that call v3 methods (act, extract, fillForm, ariaTree), the\n * timeout is also forwarded to the underlying v3 call for true cancellation.\n * @default 45000 (45 seconds)\n */\n toolTimeout?: number;\n /**\n * Enable the web search tool powered by Browserbase Search API.\n * Requires a valid Browserbase API key (BROWSERBASE_API_KEY).\n * When set to true, the agent gains access to a `search` tool for web searches.\n *\n * @example\n * ```typescript\n * const result = await agent.execute({\n * instruction: \"Find the latest news about AI\",\n * useSearch: true,\n * });\n * ```\n */\n useSearch?: boolean;\n}\n\n/**\n * Options for non-streaming agent execution.\n * Only accepts AgentExecuteCallbacks (no streaming-specific callbacks like onChunk, onFinish).\n */\nexport interface AgentExecuteOptions extends AgentExecuteOptionsBase {\n /**\n * Callbacks for non-streaming agent execution.\n * For streaming callbacks (onChunk, onFinish, onError, onAbort), use stream: true in AgentConfig.\n */\n callbacks?: AgentExecuteCallbacks;\n}\n\n/**\n * Options for streaming agent execution.\n * Accepts AgentStreamCallbacks including onChunk, onFinish, onError, and onAbort.\n */\nexport interface AgentStreamExecuteOptions extends AgentExecuteOptionsBase {\n /**\n * Callbacks for streaming agent execution.\n * Includes streaming-specific callbacks: onChunk, onFinish, onError, onAbort.\n */\n callbacks?: AgentStreamCallbacks;\n}\nexport type AgentType =\n | \"openai\"\n | \"anthropic\"\n | \"google\"\n | \"microsoft\"\n | \"bedrock\";\n\nexport const AVAILABLE_CUA_MODELS = [\n \"openai/gpt-5.4\",\n \"openai/gpt-5.4-mini\",\n \"openai/gpt-5.5\",\n \"openai/computer-use-preview\",\n \"openai/computer-use-preview-2025-03-11\",\n \"anthropic/claude-opus-4-5-20251101\",\n \"anthropic/claude-opus-4-6\",\n \"anthropic/claude-sonnet-4-6\",\n \"anthropic/claude-haiku-4-5\",\n \"anthropic/claude-haiku-4-5-20251001\",\n \"anthropic/claude-sonnet-4-20250514\",\n \"anthropic/claude-sonnet-4-5-20250929\",\n \"google/gemini-2.5-computer-use-preview-10-2025\",\n \"google/gemini-3-flash-preview\",\n \"google/gemini-3-pro-preview\",\n \"microsoft/fara-7b\",\n] as const;\nexport type AvailableCuaModel = (typeof AVAILABLE_CUA_MODELS)[number];\n\nexport interface AgentExecutionOptions<\n TOptions extends AgentExecuteOptions = AgentExecuteOptions,\n> {\n options: TOptions;\n logger: (message: LogLine) => void;\n retries?: number;\n}\n\nexport interface AgentHandlerOptions {\n modelName: string;\n clientOptions?: ClientOptions;\n userProvidedInstructions?: string;\n experimental?: boolean;\n}\n\nexport interface ActionExecutionResult {\n success: boolean;\n error?: string;\n data?: unknown;\n}\n\n/**\n * Represents a safety check that requires user confirmation before proceeding.\n * These are issued by CUA providers (OpenAI, Google) when the agent attempts\n * potentially risky actions.\n */\nexport interface SafetyCheck {\n /** Unique identifier for this safety check */\n id: string;\n /** Code identifying the type of safety concern */\n code: string;\n /** Human-readable description of the safety concern */\n message: string;\n}\n\n/**\n * Response from the user for a safety confirmation request.\n */\nexport interface SafetyConfirmationResponse {\n /** Whether the user acknowledged/approved the safety checks */\n acknowledged: boolean;\n}\n\n/**\n * Callback for handling safety confirmation requests.\n * Called when the CUA provider issues safety checks that require user confirmation.\n * The callback should return a promise that resolves when the user has made a decision.\n *\n * @param safetyChecks - Array of safety checks requiring confirmation\n * @returns Promise resolving to the user's response\n *\n * @example\n * ```typescript\n * const agent = stagehand.agent({\n * mode: \"cua\",\n * });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: {\n * onSafetyConfirmation: async (checks) => {\n * console.log(\"Safety checks:\", checks);\n * const userApproved = await showConfirmationDialog(checks);\n * return { acknowledged: userApproved };\n * },\n * },\n * });\n * ```\n */\nexport type SafetyConfirmationHandler = (\n safetyChecks: SafetyCheck[],\n) => Promise<SafetyConfirmationResponse>;\n\n// Anthropic types:\n\nexport interface ToolUseItem extends ResponseItem {\n type: \"tool_use\";\n id: string; // This is the correct property name from Anthropic's API\n name: string; // Name of the tool being used\n input: Record<string, unknown>;\n}\n\nexport interface AnthropicMessage {\n role: string;\n content: string | Array<AnthropicContentBlock>;\n}\n\nexport interface AnthropicContentBlock {\n type: string;\n [key: string]: unknown;\n}\n\nexport interface AnthropicTextBlock extends AnthropicContentBlock {\n type: \"text\";\n text: string;\n}\n\nexport interface AnthropicToolResult {\n type: \"tool_result\";\n tool_use_id: string;\n content: string | Array<AnthropicContentBlock>;\n}\n\n// OpenAI types:\n\nexport interface ResponseItem {\n type: string;\n id: string;\n [key: string]: unknown;\n}\n\nexport interface ComputerCallItem extends ResponseItem {\n type: \"computer_call\";\n call_id: string;\n action?: {\n type: string;\n [key: string]: unknown;\n };\n actions?: Array<{\n type: string;\n [key: string]: unknown;\n }>;\n pending_safety_checks?: Array<{\n id: string;\n code: string;\n message: string;\n }>;\n}\n\nexport interface FunctionCallItem extends ResponseItem {\n type: \"function_call\";\n call_id: string;\n name: string;\n arguments: string;\n}\n\nexport type ResponseInputItem =\n | { role: string; content: string }\n | {\n type: \"computer_call_output\";\n call_id: string;\n output:\n | {\n type: \"input_image\" | \"computer_screenshot\";\n image_url: string;\n detail?: \"original\" | \"high\" | \"low\";\n current_url?: string;\n error?: string;\n [key: string]: unknown;\n }\n | string;\n acknowledged_safety_checks?: Array<{\n id: string;\n code: string;\n message: string;\n }>;\n }\n | {\n type: \"function_call_output\";\n call_id: string;\n output: string;\n };\n\nexport interface AgentInstance {\n execute: (\n instructionOrOptions: string | AgentExecuteOptions,\n ) => Promise<AgentResult>;\n}\n\nexport type AgentProviderType = AgentType;\n\nexport type AgentModelConfig<TModelName extends string = string> = {\n modelName: TModelName;\n} & Record<string, unknown>;\n\n/**\n * Agent tool mode determines which set of tools are available to the agent.\n * - 'dom': Uses DOM-based tools (act, fillForm) - better for structured page interactions\n * - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, etc.) - better for visual/screenshot-based interactions\n * - 'cua': Uses Computer Use Agent (CUA) providers like Anthropic Claude or Google Gemini for screenshot-based automation\n */\nexport type AgentToolMode = \"dom\" | \"hybrid\" | \"cua\";\n\nexport type AgentConfig = {\n /**\n * Custom system prompt to provide to the agent. Overrides the default system prompt.\n */\n systemPrompt?: string;\n /**\n * MCP integrations - Array of Client objects\n */\n integrations?: (Client | string)[];\n /**\n * Tools passed to the agent client\n */\n tools?: ToolSet;\n /**\n * @deprecated Use `mode: \"cua\"` instead. This option will be removed in a future version.\n * Enables Computer Use Agent (CUA) mode.\n */\n cua?: boolean;\n /**\n * The model to use for agent functionality\n */\n model?: string | AgentModelConfig<string>;\n /**\n * The model to use for tool execution (observe/act calls within agent tools).\n * If not specified, inherits from the main model configuration.\n * Format: \"provider/model\" (e.g., \"openai/gpt-4o-mini\", \"google/gemini-2.0-flash-exp\")\n */\n executionModel?: string | AgentModelConfig<string>;\n /**\n * Enable streaming mode for the agent.\n * When true, execute() returns AgentStreamResult with textStream for incremental output.\n * When false (default), execute() returns AgentResult after completion.\n */\n stream?: boolean;\n /**\n * Tool mode for the agent. Determines which set of tools are available.\n * - 'dom' (default): Uses DOM-based tools (act, fillForm) for structured interactions\n * - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, clickAndHold, fillFormVision)\n * for visual/screenshot-based interactions\n * - 'cua': Uses Computer Use Agent (CUA) providers for screenshot-based automation\n */\n mode?: AgentToolMode;\n};\n\n/**\n * Agent instance returned when stream: true is set in AgentConfig.\n * execute() returns a streaming result that can be consumed incrementally.\n * Accepts AgentStreamExecuteOptions with streaming-specific callbacks.\n */\nexport interface StreamingAgentInstance {\n execute: (\n instructionOrOptions: string | AgentStreamExecuteOptions,\n ) => Promise<AgentStreamResult>;\n}\n\n/**\n * Agent instance returned when stream is false or not set in AgentConfig.\n * execute() returns a result after the agent completes.\n * Accepts AgentExecuteOptions with non-streaming callbacks only.\n */\nexport interface NonStreamingAgentInstance {\n execute: (\n instructionOrOptions: string | AgentExecuteOptions,\n ) => Promise<AgentResult>;\n}\n\n// =============================================================================\n// Vision Action Tool Result Types\n// =============================================================================\n\n/**\n * Content item type for toModelOutput return values.\n * Used in tool definitions to return text and/or media to the model.\n */\nexport type ModelOutputContentItem =\n | { type: \"text\"; text: string }\n | { type: \"media\"; mediaType: string; data: string };\n\nexport interface ClickToolResult {\n success: boolean;\n describe?: string;\n coordinates?: number[];\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface TypeToolResult {\n success: boolean;\n describe?: string;\n text?: string;\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface DragAndDropToolResult {\n success: boolean;\n describe?: string;\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface FillFormField {\n action: string;\n value: string;\n coordinates: { x: number; y: number };\n}\n\nexport interface FillFormVisionToolResult {\n success: boolean;\n playwrightArguments?: FillFormField[];\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface ScrollToolResult {\n success: boolean;\n message: string;\n scrolledPixels: number;\n error?: string;\n}\n\nexport interface ScrollVisionToolResult extends ScrollToolResult {\n screenshotBase64?: string;\n}\n\nexport interface WaitToolResult {\n success: boolean;\n waited: number;\n screenshotBase64?: string;\n error?: string;\n}\n"]}
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../../../../lib/v3/types/public/agent.ts"],"names":[],"mappings":";;;AAwca,QAAA,oBAAoB,GAAG;IAClC,gBAAgB;IAChB,qBAAqB;IACrB,gBAAgB;IAChB,6BAA6B;IAC7B,wCAAwC;IACxC,oCAAoC;IACpC,2BAA2B;IAC3B,6BAA6B;IAC7B,4BAA4B;IAC5B,qCAAqC;IACrC,oCAAoC;IACpC,sCAAsC;IACtC,gDAAgD;IAChD,+BAA+B;IAC/B,6BAA6B;IAC7B,mBAAmB;CACX,CAAC","sourcesContent":["import type { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport {\n ToolSet,\n ModelMessage,\n wrapLanguageModel,\n StreamTextResult,\n StepResult,\n PrepareStepFunction,\n GenerateTextOnStepFinishCallback,\n StreamTextOnStepFinishCallback,\n StreamTextOnErrorCallback,\n StreamTextOnChunkCallback,\n StreamTextOnFinishCallback,\n} from \"ai\";\nimport { LogLine } from \"./logs.js\";\nimport { ClientOptions } from \"./model.js\";\nimport { StagehandZodObject } from \"../../zodCompat.js\";\nimport type { AgentEvidenceCallback } from \"./agentEvidenceEvents.js\";\n\n// Re-export ModelMessage for consumers who want to use it for conversation continuation\nexport type { ModelMessage } from \"ai\";\n\n// Re-export Tool type for consumers who want to define custom tools\nexport type { Tool } from \"ai\";\nimport { Page as PlaywrightPage } from \"playwright-core\";\nimport { Page as PuppeteerPage } from \"puppeteer-core\";\nimport { Page as PatchrightPage } from \"patchright-core\";\nimport { Page } from \"../../understudy/page.js\";\n\n// =============================================================================\n// Variable Types\n// =============================================================================\n\n/**\n * A variable value can be a simple primitive or a rich object with an optional description.\n * This unified type is shared across `act`, `agent.execute`, and other methods.\n *\n * @example Simple (backward-compatible):\n * ```typescript\n * variables: { username: \"john@example.com\" }\n * ```\n *\n * @example Rich with description (useful for agents):\n * ```typescript\n * variables: {\n * username: { value: \"john@example.com\", description: \"The login email\" }\n * }\n * ```\n */\nexport type VariableValue =\n | string\n | number\n | boolean\n | { value: string | number | boolean; description?: string };\n\n/**\n * A collection of named variables for use in act, agent, and other methods.\n */\nexport type Variables = Record<string, VariableValue>;\n\nexport interface AgentContext {\n options: AgentExecuteOptionsBase;\n maxSteps: number;\n systemPrompt: string;\n allTools: ToolSet;\n messages: ModelMessage[];\n wrappedModel: ReturnType<typeof wrapLanguageModel>;\n initialPageUrl: string;\n}\n\nexport interface AgentState {\n collectedReasoning: string[];\n actions: AgentAction[];\n finalMessage: string;\n completed: boolean;\n currentPageUrl: string;\n}\n\nexport interface AgentAction {\n type: string;\n reasoning?: string;\n taskCompleted?: boolean;\n action?: string;\n // Tool-specific fields\n timeMs?: number; // wait tool\n pageText?: string; // ariaTree tool\n pageUrl?: string; // ariaTree tool\n instruction?: string; // various tools\n [key: string]: unknown;\n}\n\nexport interface AgentResult {\n success: boolean;\n message: string;\n actions: AgentAction[];\n completed: boolean;\n metadata?: Record<string, unknown>;\n usage?: {\n input_tokens: number;\n output_tokens: number;\n reasoning_tokens?: number;\n cached_input_tokens?: number;\n inference_time_ms: number;\n };\n /**\n * The conversation messages from this execution.\n * Pass these to a subsequent execute() call via the `messages` option to continue the conversation.\n * @experimental\n */\n messages?: ModelMessage[];\n /**\n * Custom output data extracted based on the `output` schema provided in execute options.\n * Only populated if an `output` schema was provided.\n * @experimental\n */\n output?: Record<string, unknown>;\n}\n\nexport type AgentStreamResult = StreamTextResult<ToolSet, never> & {\n result: Promise<AgentResult>;\n};\n\n/**\n * Base callbacks shared between execute (non-streaming) and streaming modes.\n */\nexport interface AgentCallbacks {\n /**\n * Optional function called before each step to modify settings.\n * You can change the model, tool choices, active tools, system prompt,\n * and input messages for each step.\n */\n prepareStep?: PrepareStepFunction<ToolSet>;\n /**\n * Callback called when each step (LLM call) is finished.\n * This is called for intermediate steps as well as the final step.\n */\n onStepFinish?:\n | GenerateTextOnStepFinishCallback<ToolSet>\n | StreamTextOnStepFinishCallback<ToolSet>;\n /**\n * Callback called when Stagehand captures agent-run evidence such as\n * screenshots, completed tool/action steps, or post-action observations.\n */\n onEvidence?: AgentEvidenceCallback;\n}\n\n/**\n * Error message type for streaming-only callbacks used in non-streaming mode.\n * This provides a clear error message when users try to use streaming callbacks without stream: true.\n */\ntype StreamingCallbackNotAvailable =\n \"This callback requires 'stream: true' in AgentConfig. Set stream: true to use streaming callbacks like onChunk, onFinish, onError, and onAbort.\";\n\n/**\n * Error message for safety confirmation callback misuse.\n * Safety confirmations are only available for non-streaming CUA agent executions.\n */\ntype SafetyConfirmationCallbackNotAvailable =\n \"Safety confirmation callbacks are only available via non-streaming AgentExecuteOptions.callbacks when using mode: 'cua'.\";\n\n/**\n * Callbacks specific to the non-streaming execute method.\n */\nexport interface AgentExecuteCallbacks extends AgentCallbacks {\n /**\n * Callback called when each step (LLM call) is finished.\n */\n onStepFinish?: GenerateTextOnStepFinishCallback<ToolSet>;\n /**\n * Callback for handling safety confirmation requests from CUA providers.\n * Only available when running an agent configured with mode: \"cua\".\n */\n onSafetyConfirmation?: SafetyConfirmationHandler;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onChunk:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onChunk: async (chunk) => console.log(chunk) }\n * });\n * ```\n */\n onChunk?: StreamingCallbackNotAvailable;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onFinish:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onFinish: (event) => console.log(\"Done!\", event) }\n * });\n * ```\n */\n onFinish?: StreamingCallbackNotAvailable;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onError:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onError: ({ error }) => console.error(error) }\n * });\n * ```\n */\n onError?: StreamingCallbackNotAvailable;\n\n /**\n * NOT AVAILABLE in non-streaming mode.\n * This callback requires `stream: true` in AgentConfig.\n *\n * @example\n * ```typescript\n * // Enable streaming to use onAbort:\n * const agent = stagehand.agent({ stream: true });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: { onAbort: (event) => console.log(\"Aborted\", event.steps) }\n * });\n * ```\n */\n onAbort?: StreamingCallbackNotAvailable;\n}\n\n/**\n * Callbacks specific to the streaming mode.\n */\nexport interface AgentStreamCallbacks extends AgentCallbacks {\n /**\n * Callback called when each step (LLM call) is finished during streaming.\n */\n onStepFinish?: StreamTextOnStepFinishCallback<ToolSet>;\n /**\n * Callback called when an error occurs during streaming.\n * Use this to log errors or handle error states.\n */\n onError?: StreamTextOnErrorCallback;\n /**\n * Callback called for each chunk of the stream.\n * Stream processing will pause until the callback promise resolves.\n */\n onChunk?: StreamTextOnChunkCallback<ToolSet>;\n /**\n * Callback called when the stream finishes.\n */\n onFinish?: StreamTextOnFinishCallback<ToolSet>;\n /**\n * Callback called when the stream is aborted.\n */\n onAbort?: (event: {\n steps: Array<StepResult<ToolSet>>;\n }) => PromiseLike<void> | void;\n /**\n * NOT AVAILABLE in streaming mode.\n * Safety confirmations currently require non-streaming execute() on CUA agents.\n */\n onSafetyConfirmation?: SafetyConfirmationCallbackNotAvailable;\n}\n\n/**\n * Base options for agent execution (without callbacks).\n */\nexport interface AgentExecuteOptionsBase {\n instruction: string;\n maxSteps?: number;\n page?: PlaywrightPage | PuppeteerPage | PatchrightPage | Page;\n highlightCursor?: boolean;\n /**\n * Previous conversation messages to continue from.\n * Pass the `messages` from a previous AgentResult to continue that conversation.\n * @experimental\n */\n messages?: ModelMessage[];\n /**\n * An AbortSignal that can be used to cancel the agent execution.\n * When aborted, the agent will stop and return a partial result.\n * @experimental\n *\n * @example\n * ```typescript\n * const controller = new AbortController();\n * setTimeout(() => controller.abort(), 30000); // 30 second timeout\n *\n * const result = await agent.execute({\n * instruction: \"...\",\n * signal: controller.signal\n * });\n * ```\n */\n signal?: AbortSignal;\n /**\n * Tools to exclude from this execution.\n * Pass an array of tool names to prevent the agent from using those tools.\n *\n * **Note:** Not supported in CUA mode (`mode: \"cua\"`).\n *\n * **Available tools by mode:**\n *\n * **DOM mode (default):**\n * - `act` - Perform semantic actions (click, type, etc.)\n * - `fillForm` - Fill form fields using DOM selectors\n * - `ariaTree` - Get accessibility tree of the page\n * - `extract` - Extract structured data from page\n * - `goto` - Navigate to a URL\n * - `scroll` - Scroll using semantic directions (up/down/left/right)\n * - `keys` - Press keyboard keys\n * - `navback` - Navigate back in history\n * - `screenshot` - Take a screenshot\n * - `think` - Agent reasoning/planning step\n * - `wait` - Wait for time or condition\n * - `done` - Mark task as complete\n * - `search` - Web search (requires useSearch: true and BROWSERBASE_API_KEY)\n *\n * **Hybrid mode:**\n * - `click` - Click at specific coordinates\n * - `type` - Type text at coordinates\n * - `dragAndDrop` - Drag from one point to another\n * - `clickAndHold` - Click and hold at coordinates\n * - `fillFormVision` - Fill forms using vision/coordinates\n * - `act` - Perform semantic actions\n * - `ariaTree` - Get accessibility tree\n * - `extract` - Extract data from page\n * - `goto` - Navigate to URL\n * - `scroll` - Scroll using coordinates\n * - `keys` - Press keyboard keys\n * - `navback` - Navigate back\n * - `screenshot` - Take screenshot\n * - `think` - Agent reasoning step\n * - `wait` - Wait for time/condition\n * - `done` - Mark task complete\n * - `search` - Web search (requires useSearch: true and BROWSERBASE_API_KEY)\n *\n * @experimental\n * @example\n * ```typescript\n * // Exclude screenshot and extract tools\n * const result = await agent.execute({\n * instruction: \"Click the submit button\",\n * excludeTools: [\"screenshot\", \"extract\"]\n * });\n * ```\n */\n excludeTools?: string[];\n /**\n * A Zod schema defining custom output data to return when the task completes.\n * The agent will populate this data in the final done tool call.\n *\n * @experimental\n * @example\n * ```typescript\n * const result = await agent.execute({\n * instruction: \"Find the cheapest flight from NYC to LA\",\n * output: z.object({\n * price: z.string().describe(\"The price of the flight\"),\n * airline: z.string().describe(\"The airline name\"),\n * departureTime: z.string().describe(\"Departure time\"),\n * }),\n * });\n *\n * console.log(result.output); // { price: \"$199\", airline: \"Delta\", departureTime: \"8:00 AM\" }\n * ```\n */\n output?: StagehandZodObject;\n /**\n * Variables that the agent can use when filling forms or typing text.\n * The agent will see variable names and descriptions in the system prompt,\n * and can use them via `%variableName%` syntax in act/type/fillForm tool calls.\n *\n * Accepts both simple values and rich objects with descriptions (same type as `act`).\n *\n * **Note:** Not supported in CUA mode (`mode: \"cua\"`).\n *\n * @example\n * ```typescript\n * // Simple values\n * variables: { username: \"john@example.com\", password: \"secret123\" }\n *\n * // Rich values with descriptions (helps the agent understand context)\n * variables: {\n * username: { value: \"john@example.com\", description: \"The login email\" },\n * password: { value: \"secret123\", description: \"The login password\" },\n * }\n * ```\n */\n variables?: Variables;\n /**\n * Timeout in milliseconds for each agent tool call.\n * If a tool call exceeds this duration, it will be aborted and\n * reported back to the LLM as a timeout error so it can retry or adjust.\n * For tools that call v3 methods (act, extract, fillForm, ariaTree), the\n * timeout is also forwarded to the underlying v3 call for true cancellation.\n * @default 45000 (45 seconds)\n */\n toolTimeout?: number;\n /**\n * Enable the web search tool powered by Browserbase Search API.\n * Requires a valid Browserbase API key (BROWSERBASE_API_KEY).\n * When set to true, the agent gains access to a `search` tool for web searches.\n *\n * @example\n * ```typescript\n * const result = await agent.execute({\n * instruction: \"Find the latest news about AI\",\n * useSearch: true,\n * });\n * ```\n */\n useSearch?: boolean;\n}\n\n/**\n * Options for non-streaming agent execution.\n * Only accepts AgentExecuteCallbacks (no streaming-specific callbacks like onChunk, onFinish).\n */\nexport interface AgentExecuteOptions extends AgentExecuteOptionsBase {\n /**\n * Callbacks for non-streaming agent execution.\n * For streaming callbacks (onChunk, onFinish, onError, onAbort), use stream: true in AgentConfig.\n */\n callbacks?: AgentExecuteCallbacks;\n}\n\n/**\n * Options for streaming agent execution.\n * Accepts AgentStreamCallbacks including onChunk, onFinish, onError, and onAbort.\n */\nexport interface AgentStreamExecuteOptions extends AgentExecuteOptionsBase {\n /**\n * Callbacks for streaming agent execution.\n * Includes streaming-specific callbacks: onChunk, onFinish, onError, onAbort.\n */\n callbacks?: AgentStreamCallbacks;\n}\nexport type AgentType =\n | \"openai\"\n | \"anthropic\"\n | \"google\"\n | \"microsoft\"\n | \"bedrock\"\n | \"vertex\";\n\nexport const AVAILABLE_CUA_MODELS = [\n \"openai/gpt-5.4\",\n \"openai/gpt-5.4-mini\",\n \"openai/gpt-5.5\",\n \"openai/computer-use-preview\",\n \"openai/computer-use-preview-2025-03-11\",\n \"anthropic/claude-opus-4-5-20251101\",\n \"anthropic/claude-opus-4-6\",\n \"anthropic/claude-sonnet-4-6\",\n \"anthropic/claude-haiku-4-5\",\n \"anthropic/claude-haiku-4-5-20251001\",\n \"anthropic/claude-sonnet-4-20250514\",\n \"anthropic/claude-sonnet-4-5-20250929\",\n \"google/gemini-2.5-computer-use-preview-10-2025\",\n \"google/gemini-3-flash-preview\",\n \"google/gemini-3-pro-preview\",\n \"microsoft/fara-7b\",\n] as const;\nexport type AvailableCuaModel = (typeof AVAILABLE_CUA_MODELS)[number];\n\nexport interface AgentExecutionOptions<\n TOptions extends AgentExecuteOptions = AgentExecuteOptions,\n> {\n options: TOptions;\n logger: (message: LogLine) => void;\n retries?: number;\n}\n\nexport interface AgentHandlerOptions {\n modelName: string;\n clientOptions?: ClientOptions;\n userProvidedInstructions?: string;\n experimental?: boolean;\n}\n\nexport interface ActionExecutionResult {\n success: boolean;\n error?: string;\n data?: unknown;\n}\n\n/**\n * Represents a safety check that requires user confirmation before proceeding.\n * These are issued by CUA providers (OpenAI, Google) when the agent attempts\n * potentially risky actions.\n */\nexport interface SafetyCheck {\n /** Unique identifier for this safety check */\n id: string;\n /** Code identifying the type of safety concern */\n code: string;\n /** Human-readable description of the safety concern */\n message: string;\n}\n\n/**\n * Response from the user for a safety confirmation request.\n */\nexport interface SafetyConfirmationResponse {\n /** Whether the user acknowledged/approved the safety checks */\n acknowledged: boolean;\n}\n\n/**\n * Callback for handling safety confirmation requests.\n * Called when the CUA provider issues safety checks that require user confirmation.\n * The callback should return a promise that resolves when the user has made a decision.\n *\n * @param safetyChecks - Array of safety checks requiring confirmation\n * @returns Promise resolving to the user's response\n *\n * @example\n * ```typescript\n * const agent = stagehand.agent({\n * mode: \"cua\",\n * });\n * await agent.execute({\n * instruction: \"...\",\n * callbacks: {\n * onSafetyConfirmation: async (checks) => {\n * console.log(\"Safety checks:\", checks);\n * const userApproved = await showConfirmationDialog(checks);\n * return { acknowledged: userApproved };\n * },\n * },\n * });\n * ```\n */\nexport type SafetyConfirmationHandler = (\n safetyChecks: SafetyCheck[],\n) => Promise<SafetyConfirmationResponse>;\n\n// Anthropic types:\n\nexport interface ToolUseItem extends ResponseItem {\n type: \"tool_use\";\n id: string; // This is the correct property name from Anthropic's API\n name: string; // Name of the tool being used\n input: Record<string, unknown>;\n}\n\nexport interface AnthropicMessage {\n role: string;\n content: string | Array<AnthropicContentBlock>;\n}\n\nexport interface AnthropicContentBlock {\n type: string;\n [key: string]: unknown;\n}\n\nexport interface AnthropicTextBlock extends AnthropicContentBlock {\n type: \"text\";\n text: string;\n}\n\nexport interface AnthropicToolResult {\n type: \"tool_result\";\n tool_use_id: string;\n content: string | Array<AnthropicContentBlock>;\n}\n\n// OpenAI types:\n\nexport interface ResponseItem {\n type: string;\n id: string;\n [key: string]: unknown;\n}\n\nexport interface ComputerCallItem extends ResponseItem {\n type: \"computer_call\";\n call_id: string;\n action?: {\n type: string;\n [key: string]: unknown;\n };\n actions?: Array<{\n type: string;\n [key: string]: unknown;\n }>;\n pending_safety_checks?: Array<{\n id: string;\n code: string;\n message: string;\n }>;\n}\n\nexport interface FunctionCallItem extends ResponseItem {\n type: \"function_call\";\n call_id: string;\n name: string;\n arguments: string;\n}\n\nexport type ResponseInputItem =\n | { role: string; content: string }\n | {\n type: \"computer_call_output\";\n call_id: string;\n output:\n | {\n type: \"input_image\" | \"computer_screenshot\";\n image_url: string;\n detail?: \"original\" | \"high\" | \"low\";\n current_url?: string;\n error?: string;\n [key: string]: unknown;\n }\n | string;\n acknowledged_safety_checks?: Array<{\n id: string;\n code: string;\n message: string;\n }>;\n }\n | {\n type: \"function_call_output\";\n call_id: string;\n output: string;\n };\n\nexport interface AgentInstance {\n execute: (\n instructionOrOptions: string | AgentExecuteOptions,\n ) => Promise<AgentResult>;\n}\n\nexport type AgentProviderType = AgentType;\n\nexport type AgentModelConfig<TModelName extends string = string> = {\n modelName: TModelName;\n} & Record<string, unknown>;\n\n/**\n * Agent tool mode determines which set of tools are available to the agent.\n * - 'dom': Uses DOM-based tools (act, fillForm) - better for structured page interactions\n * - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, etc.) - better for visual/screenshot-based interactions\n * - 'cua': Uses Computer Use Agent (CUA) providers like Anthropic Claude or Google Gemini for screenshot-based automation\n */\nexport type AgentToolMode = \"dom\" | \"hybrid\" | \"cua\";\n\nexport type AgentConfig = {\n /**\n * Custom system prompt to provide to the agent. Overrides the default system prompt.\n */\n systemPrompt?: string;\n /**\n * MCP integrations - Array of Client objects\n */\n integrations?: (Client | string)[];\n /**\n * Tools passed to the agent client\n */\n tools?: ToolSet;\n /**\n * @deprecated Use `mode: \"cua\"` instead. This option will be removed in a future version.\n * Enables Computer Use Agent (CUA) mode.\n */\n cua?: boolean;\n /**\n * The model to use for agent functionality\n */\n model?: string | AgentModelConfig<string>;\n /**\n * The model to use for tool execution (observe/act calls within agent tools).\n * If not specified, inherits from the main model configuration.\n * Format: \"provider/model\" (e.g., \"openai/gpt-4o-mini\", \"google/gemini-2.0-flash-exp\")\n */\n executionModel?: string | AgentModelConfig<string>;\n /**\n * Enable streaming mode for the agent.\n * When true, execute() returns AgentStreamResult with textStream for incremental output.\n * When false (default), execute() returns AgentResult after completion.\n */\n stream?: boolean;\n /**\n * Tool mode for the agent. Determines which set of tools are available.\n * - 'dom' (default): Uses DOM-based tools (act, fillForm) for structured interactions\n * - 'hybrid': Uses coordinate-based tools (click, type, dragAndDrop, clickAndHold, fillFormVision)\n * for visual/screenshot-based interactions\n * - 'cua': Uses Computer Use Agent (CUA) providers for screenshot-based automation\n */\n mode?: AgentToolMode;\n};\n\n/**\n * Agent instance returned when stream: true is set in AgentConfig.\n * execute() returns a streaming result that can be consumed incrementally.\n * Accepts AgentStreamExecuteOptions with streaming-specific callbacks.\n */\nexport interface StreamingAgentInstance {\n execute: (\n instructionOrOptions: string | AgentStreamExecuteOptions,\n ) => Promise<AgentStreamResult>;\n}\n\n/**\n * Agent instance returned when stream is false or not set in AgentConfig.\n * execute() returns a result after the agent completes.\n * Accepts AgentExecuteOptions with non-streaming callbacks only.\n */\nexport interface NonStreamingAgentInstance {\n execute: (\n instructionOrOptions: string | AgentExecuteOptions,\n ) => Promise<AgentResult>;\n}\n\n// =============================================================================\n// Vision Action Tool Result Types\n// =============================================================================\n\n/**\n * Content item type for toModelOutput return values.\n * Used in tool definitions to return text and/or media to the model.\n */\nexport type ModelOutputContentItem =\n | { type: \"text\"; text: string }\n | { type: \"media\"; mediaType: string; data: string };\n\nexport interface ClickToolResult {\n success: boolean;\n describe?: string;\n coordinates?: number[];\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface TypeToolResult {\n success: boolean;\n describe?: string;\n text?: string;\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface DragAndDropToolResult {\n success: boolean;\n describe?: string;\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface FillFormField {\n action: string;\n value: string;\n coordinates: { x: number; y: number };\n}\n\nexport interface FillFormVisionToolResult {\n success: boolean;\n playwrightArguments?: FillFormField[];\n error?: string;\n screenshotBase64?: string;\n}\n\nexport interface ScrollToolResult {\n success: boolean;\n message: string;\n scrolledPixels: number;\n error?: string;\n}\n\nexport interface ScrollVisionToolResult extends ScrollToolResult {\n screenshotBase64?: string;\n}\n\nexport interface WaitToolResult {\n success: boolean;\n waited: number;\n screenshotBase64?: string;\n error?: string;\n}\n"]}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Evidence events emitted through AgentExecuteOptions.callbacks.onEvidence.
3
+ *
4
+ * These events describe observations made by Stagehand during an agent run.
5
+ * They are emitted in temporal order; consumers should treat the stream as
6
+ * sequential. An agent-role screenshot applies to every subsequent
7
+ * step_finished until a newer agent-role screenshot replaces it — a CUA
8
+ * provider may choose multiple actions from a single screenshot, so each of
9
+ * those steps shares that frame. A step_observed/probe applies to all
10
+ * step_finished events received since the last probe. Verifier-specific
11
+ * storage and normalization live in the evals/verifier layers.
12
+ */
13
+ export type AgentEvidenceRole = "probe" | "agent";
14
+ export type AgentEvidenceEvent = AgentScreenshotEvidenceEvent | AgentStepFinishedEvent | AgentStepObservedEvent | AgentFinalAnswerEvent;
15
+ /**
16
+ * Screenshot captured during an agent run.
17
+ *
18
+ * In DOM/hybrid mode, post-tool screenshots are probe evidence. In CUA mode,
19
+ * screenshots captured by the screenshot provider are agent evidence because
20
+ * they are the exact bytes sent to the provider.
21
+ */
22
+ export interface AgentScreenshotEvidenceEvent {
23
+ type: "screenshot";
24
+ /** PNG bytes from page.screenshot(). */
25
+ screenshot: Buffer;
26
+ /** Page URL at the time of capture. */
27
+ url: string;
28
+ /** Role this screenshot plays in downstream evidence collection. */
29
+ evidenceRole: AgentEvidenceRole;
30
+ }
31
+ /**
32
+ * One completed agent tool/action step.
33
+ */
34
+ export interface AgentStepFinishedEvent {
35
+ type: "step_finished";
36
+ /** Name of the tool/action that ran, e.g. "act", "extract", "click". */
37
+ actionName: string;
38
+ /** Arguments passed to the tool/action. */
39
+ actionArgs: Record<string, unknown>;
40
+ /** Agent textual reasoning for the step, when available. */
41
+ reasoning: string;
42
+ /** Outcome of the tool/action as seen by Stagehand. */
43
+ toolOutput: {
44
+ ok: boolean;
45
+ /** Native return value from the tool/action. */
46
+ result: unknown;
47
+ error?: string;
48
+ };
49
+ }
50
+ /**
51
+ * Independent post-step browser observation. Emitted once per agent turn;
52
+ * consumers apply it to every step_finished received since the previous probe.
53
+ */
54
+ export interface AgentStepObservedEvent {
55
+ type: "step_observed";
56
+ /** Page URL after the step's tool/action execution. */
57
+ url: string;
58
+ /** Accessibility tree snapshot, when captured. */
59
+ ariaTree?: string;
60
+ }
61
+ export interface AgentFinalObservation {
62
+ /** Page URL at the time of terminal capture. */
63
+ url: string;
64
+ /** PNG bytes from page.screenshot(), when capture succeeds. */
65
+ screenshot?: Buffer;
66
+ /** Accessibility tree snapshot, when captured. */
67
+ ariaTree?: string;
68
+ }
69
+ /** Final answer emitted by the agent, when available. */
70
+ export interface AgentFinalAnswerEvent {
71
+ type: "final_answer";
72
+ /** The agent's final summary message. */
73
+ message: string;
74
+ /** Optional structured output if the agent's output schema was set. */
75
+ output?: Record<string, unknown>;
76
+ /**
77
+ * Independent terminal browser observation captured after the agent finishes.
78
+ *
79
+ * This preserves the legacy verifier behavior of evaluating against a final
80
+ * page screenshot even when the last agent output is a final answer rather
81
+ * than a browser action.
82
+ */
83
+ observation?: AgentFinalObservation;
84
+ }
85
+ export type AgentEvidenceCallback = (event: AgentEvidenceEvent) => PromiseLike<void> | void;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Evidence events emitted through AgentExecuteOptions.callbacks.onEvidence.
4
+ *
5
+ * These events describe observations made by Stagehand during an agent run.
6
+ * They are emitted in temporal order; consumers should treat the stream as
7
+ * sequential. An agent-role screenshot applies to every subsequent
8
+ * step_finished until a newer agent-role screenshot replaces it — a CUA
9
+ * provider may choose multiple actions from a single screenshot, so each of
10
+ * those steps shares that frame. A step_observed/probe applies to all
11
+ * step_finished events received since the last probe. Verifier-specific
12
+ * storage and normalization live in the evals/verifier layers.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ //# sourceMappingURL=agentEvidenceEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentEvidenceEvents.js","sourceRoot":"","sources":["../../../../../../lib/v3/types/public/agentEvidenceEvents.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG","sourcesContent":["/**\n * Evidence events emitted through AgentExecuteOptions.callbacks.onEvidence.\n *\n * These events describe observations made by Stagehand during an agent run.\n * They are emitted in temporal order; consumers should treat the stream as\n * sequential. An agent-role screenshot applies to every subsequent\n * step_finished until a newer agent-role screenshot replaces it — a CUA\n * provider may choose multiple actions from a single screenshot, so each of\n * those steps shares that frame. A step_observed/probe applies to all\n * step_finished events received since the last probe. Verifier-specific\n * storage and normalization live in the evals/verifier layers.\n */\n\nexport type AgentEvidenceRole = \"probe\" | \"agent\";\n\nexport type AgentEvidenceEvent =\n | AgentScreenshotEvidenceEvent\n | AgentStepFinishedEvent\n | AgentStepObservedEvent\n | AgentFinalAnswerEvent;\n\n/**\n * Screenshot captured during an agent run.\n *\n * In DOM/hybrid mode, post-tool screenshots are probe evidence. In CUA mode,\n * screenshots captured by the screenshot provider are agent evidence because\n * they are the exact bytes sent to the provider.\n */\nexport interface AgentScreenshotEvidenceEvent {\n type: \"screenshot\";\n /** PNG bytes from page.screenshot(). */\n screenshot: Buffer;\n /** Page URL at the time of capture. */\n url: string;\n /** Role this screenshot plays in downstream evidence collection. */\n evidenceRole: AgentEvidenceRole;\n}\n\n/**\n * One completed agent tool/action step.\n */\nexport interface AgentStepFinishedEvent {\n type: \"step_finished\";\n /** Name of the tool/action that ran, e.g. \"act\", \"extract\", \"click\". */\n actionName: string;\n /** Arguments passed to the tool/action. */\n actionArgs: Record<string, unknown>;\n /** Agent textual reasoning for the step, when available. */\n reasoning: string;\n /** Outcome of the tool/action as seen by Stagehand. */\n toolOutput: {\n ok: boolean;\n /** Native return value from the tool/action. */\n result: unknown;\n error?: string;\n };\n}\n\n/**\n * Independent post-step browser observation. Emitted once per agent turn;\n * consumers apply it to every step_finished received since the previous probe.\n */\nexport interface AgentStepObservedEvent {\n type: \"step_observed\";\n /** Page URL after the step's tool/action execution. */\n url: string;\n /** Accessibility tree snapshot, when captured. */\n ariaTree?: string;\n}\n\nexport interface AgentFinalObservation {\n /** Page URL at the time of terminal capture. */\n url: string;\n /** PNG bytes from page.screenshot(), when capture succeeds. */\n screenshot?: Buffer;\n /** Accessibility tree snapshot, when captured. */\n ariaTree?: string;\n}\n\n/** Final answer emitted by the agent, when available. */\nexport interface AgentFinalAnswerEvent {\n type: \"final_answer\";\n /** The agent's final summary message. */\n message: string;\n /** Optional structured output if the agent's output schema was set. */\n output?: Record<string, unknown>;\n /**\n * Independent terminal browser observation captured after the agent finishes.\n *\n * This preserves the legacy verifier behavior of evaluating against a final\n * page screenshot even when the last agent output is a final answer rather\n * than a browser action.\n */\n observation?: AgentFinalObservation;\n}\n\nexport type AgentEvidenceCallback = (\n event: AgentEvidenceEvent,\n) => PromiseLike<void> | void;\n"]}