@browserbasehq/orca 3.1.0-patch.3 → 3.2.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 (1460) hide show
  1. package/dist/cjs/cli.js +2 -210
  2. package/dist/cjs/index.d.ts +1 -0
  3. package/dist/cjs/index.js +2 -25025
  4. package/dist/cjs/lib/inference.js +335 -0
  5. package/dist/cjs/lib/inference.js.map +1 -0
  6. package/dist/cjs/lib/inferenceLogUtils.js +99 -0
  7. package/dist/cjs/lib/inferenceLogUtils.js.map +1 -0
  8. package/dist/cjs/lib/logger.js +331 -0
  9. package/dist/cjs/lib/logger.js.map +1 -0
  10. package/dist/cjs/lib/modelUtils.d.ts +1 -0
  11. package/dist/cjs/lib/modelUtils.js +53 -0
  12. package/dist/cjs/lib/modelUtils.js.map +1 -0
  13. package/dist/cjs/lib/prompt.d.ts +3 -2
  14. package/dist/cjs/lib/prompt.js +245 -0
  15. package/dist/cjs/lib/prompt.js.map +1 -0
  16. package/dist/cjs/lib/utils.js +670 -0
  17. package/dist/cjs/lib/utils.js.map +1 -0
  18. package/dist/cjs/lib/v3/agent/AgentClient.js +21 -0
  19. package/dist/cjs/lib/v3/agent/AgentClient.js.map +1 -0
  20. package/dist/cjs/lib/v3/agent/AgentProvider.js +81 -0
  21. package/dist/cjs/lib/v3/agent/AgentProvider.js.map +1 -0
  22. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js +844 -0
  23. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js.map +1 -0
  24. package/dist/cjs/lib/v3/agent/GoogleCUAClient.js +803 -0
  25. package/dist/cjs/lib/v3/agent/GoogleCUAClient.js.map +1 -0
  26. package/dist/cjs/lib/v3/agent/MicrosoftCUAClient.js +777 -0
  27. package/dist/cjs/lib/v3/agent/MicrosoftCUAClient.js.map +1 -0
  28. package/dist/cjs/lib/v3/agent/OpenAICUAClient.js +622 -0
  29. package/dist/cjs/lib/v3/agent/OpenAICUAClient.js.map +1 -0
  30. package/dist/cjs/lib/v3/agent/prompts/agentSystemPrompt.d.ts +3 -1
  31. package/dist/cjs/lib/v3/agent/prompts/agentSystemPrompt.js +212 -0
  32. package/dist/cjs/lib/v3/agent/prompts/agentSystemPrompt.js.map +1 -0
  33. package/dist/cjs/lib/v3/agent/tools/act.d.ts +2 -2
  34. package/dist/cjs/lib/v3/agent/tools/act.js +75 -0
  35. package/dist/cjs/lib/v3/agent/tools/act.js.map +1 -0
  36. package/dist/cjs/lib/v3/agent/tools/ariaTree.d.ts +8 -1
  37. package/dist/cjs/lib/v3/agent/tools/ariaTree.js +73 -0
  38. package/dist/cjs/lib/v3/agent/tools/ariaTree.js.map +1 -0
  39. package/dist/cjs/lib/v3/agent/tools/click.js +100 -0
  40. package/dist/cjs/lib/v3/agent/tools/click.js.map +1 -0
  41. package/dist/cjs/lib/v3/agent/tools/clickAndHold.js +72 -0
  42. package/dist/cjs/lib/v3/agent/tools/clickAndHold.js.map +1 -0
  43. package/dist/cjs/lib/v3/agent/tools/dragAndDrop.js +101 -0
  44. package/dist/cjs/lib/v3/agent/tools/dragAndDrop.js.map +1 -0
  45. package/dist/cjs/lib/v3/agent/tools/extract.d.ts +2 -2
  46. package/dist/cjs/lib/v3/agent/tools/extract.js +110 -0
  47. package/dist/cjs/lib/v3/agent/tools/extract.js.map +1 -0
  48. package/dist/cjs/lib/v3/agent/tools/fillFormVision.d.ts +2 -2
  49. package/dist/cjs/lib/v3/agent/tools/fillFormVision.js +158 -0
  50. package/dist/cjs/lib/v3/agent/tools/fillFormVision.js.map +1 -0
  51. package/dist/cjs/lib/v3/agent/tools/fillform.d.ts +8 -2
  52. package/dist/cjs/lib/v3/agent/tools/fillform.js +90 -0
  53. package/dist/cjs/lib/v3/agent/tools/fillform.js.map +1 -0
  54. package/dist/cjs/lib/v3/agent/tools/goto.js +35 -0
  55. package/dist/cjs/lib/v3/agent/tools/goto.js.map +1 -0
  56. package/dist/cjs/lib/v3/agent/tools/index.d.ts +11 -1
  57. package/dist/cjs/lib/v3/agent/tools/index.js +78 -0
  58. package/dist/cjs/lib/v3/agent/tools/index.js.map +1 -0
  59. package/dist/cjs/lib/v3/agent/tools/keys.js +64 -0
  60. package/dist/cjs/lib/v3/agent/tools/keys.js.map +1 -0
  61. package/dist/cjs/lib/v3/agent/tools/navback.js +27 -0
  62. package/dist/cjs/lib/v3/agent/tools/navback.js.map +1 -0
  63. package/dist/cjs/lib/v3/agent/tools/screenshot.d.ts +8 -0
  64. package/dist/cjs/lib/v3/agent/tools/screenshot.js +47 -0
  65. package/dist/cjs/lib/v3/agent/tools/screenshot.js.map +1 -0
  66. package/dist/cjs/lib/v3/agent/tools/scroll.js +159 -0
  67. package/dist/cjs/lib/v3/agent/tools/scroll.js.map +1 -0
  68. package/dist/cjs/lib/v3/agent/tools/search.js +77 -0
  69. package/dist/cjs/lib/v3/agent/tools/search.js.map +1 -0
  70. package/dist/cjs/lib/v3/agent/tools/think.js +28 -0
  71. package/dist/cjs/lib/v3/agent/tools/think.js.map +1 -0
  72. package/dist/cjs/lib/v3/agent/tools/type.d.ts +2 -2
  73. package/dist/cjs/lib/v3/agent/tools/type.js +111 -0
  74. package/dist/cjs/lib/v3/agent/tools/type.js.map +1 -0
  75. package/dist/cjs/lib/v3/agent/tools/wait.js +63 -0
  76. package/dist/cjs/lib/v3/agent/tools/wait.js.map +1 -0
  77. package/dist/cjs/lib/v3/agent/utils/actionMapping.js +103 -0
  78. package/dist/cjs/lib/v3/agent/utils/actionMapping.js.map +1 -0
  79. package/dist/cjs/lib/v3/agent/utils/coordinateNormalization.js +33 -0
  80. package/dist/cjs/lib/v3/agent/utils/coordinateNormalization.js.map +1 -0
  81. package/dist/cjs/lib/v3/agent/utils/cuaKeyMapping.js +65 -0
  82. package/dist/cjs/lib/v3/agent/utils/cuaKeyMapping.js.map +1 -0
  83. package/dist/cjs/lib/v3/agent/utils/googleCustomToolHandler.js +150 -0
  84. package/dist/cjs/lib/v3/agent/utils/googleCustomToolHandler.js.map +1 -0
  85. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js +108 -0
  86. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -0
  87. package/dist/cjs/lib/v3/agent/utils/imageCompression.js +212 -0
  88. package/dist/cjs/lib/v3/agent/utils/imageCompression.js.map +1 -0
  89. package/dist/cjs/lib/v3/agent/utils/messageProcessing.js +167 -0
  90. package/dist/cjs/lib/v3/agent/utils/messageProcessing.js.map +1 -0
  91. package/dist/cjs/lib/v3/agent/utils/screenshotHandler.js +29 -0
  92. package/dist/cjs/lib/v3/agent/utils/screenshotHandler.js.map +1 -0
  93. package/dist/cjs/lib/v3/agent/utils/validateExperimentalFeatures.js +90 -0
  94. package/dist/cjs/lib/v3/agent/utils/validateExperimentalFeatures.js.map +1 -0
  95. package/dist/cjs/lib/v3/agent/utils/variables.d.ts +21 -0
  96. package/dist/cjs/lib/v3/agent/utils/variables.js +54 -0
  97. package/dist/cjs/lib/v3/agent/utils/variables.js.map +1 -0
  98. package/dist/cjs/lib/v3/agent/utils/xpath.js +22 -0
  99. package/dist/cjs/lib/v3/agent/utils/xpath.js.map +1 -0
  100. package/dist/cjs/lib/v3/api.d.ts +23 -5
  101. package/dist/cjs/lib/v3/api.js +589 -0
  102. package/dist/cjs/lib/v3/api.js.map +1 -0
  103. package/dist/cjs/lib/v3/cache/ActCache.d.ts +0 -1
  104. package/dist/cjs/lib/v3/cache/ActCache.js +280 -0
  105. package/dist/cjs/lib/v3/cache/ActCache.js.map +1 -0
  106. package/dist/cjs/lib/v3/cache/AgentCache.d.ts +1 -0
  107. package/dist/cjs/lib/v3/cache/AgentCache.js +651 -0
  108. package/dist/cjs/lib/v3/cache/AgentCache.js.map +1 -0
  109. package/dist/cjs/lib/v3/cache/CacheStorage.js +105 -0
  110. package/dist/cjs/lib/v3/cache/CacheStorage.js.map +1 -0
  111. package/dist/cjs/lib/v3/cache/serverAgentCache.js +52 -0
  112. package/dist/cjs/lib/v3/cache/serverAgentCache.js.map +1 -0
  113. package/dist/cjs/lib/v3/cache/utils.js +44 -0
  114. package/dist/cjs/lib/v3/cache/utils.js.map +1 -0
  115. package/dist/cjs/lib/v3/cli.js +15 -0
  116. package/dist/cjs/lib/v3/cli.js.map +1 -0
  117. package/dist/cjs/lib/v3/dom/a11yScripts/index.js +124 -0
  118. package/dist/cjs/lib/v3/dom/a11yScripts/index.js.map +1 -0
  119. package/dist/cjs/lib/v3/dom/build/a11yScripts.generated.js +23 -0
  120. package/dist/cjs/lib/v3/dom/build/a11yScripts.generated.js.map +1 -0
  121. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.js +59 -0
  122. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.js.map +1 -0
  123. package/dist/cjs/lib/v3/dom/build/reRenderScriptContent.js +5 -0
  124. package/dist/cjs/lib/v3/dom/build/reRenderScriptContent.js.map +1 -0
  125. package/dist/cjs/lib/v3/dom/build/screenshotScripts.generated.js +11 -0
  126. package/dist/cjs/lib/v3/dom/build/screenshotScripts.generated.js.map +1 -0
  127. package/dist/cjs/lib/v3/dom/build/scriptV3Content.js +5 -0
  128. package/dist/cjs/lib/v3/dom/build/scriptV3Content.js.map +1 -0
  129. package/dist/cjs/lib/v3/dom/index.js +18 -0
  130. package/dist/cjs/lib/v3/dom/index.js.map +1 -0
  131. package/dist/cjs/lib/v3/dom/locatorScripts/counts.js +278 -0
  132. package/dist/cjs/lib/v3/dom/locatorScripts/counts.js.map +1 -0
  133. package/dist/cjs/lib/v3/dom/locatorScripts/index.js +21 -0
  134. package/dist/cjs/lib/v3/dom/locatorScripts/index.js.map +1 -0
  135. package/dist/cjs/lib/v3/dom/locatorScripts/scripts.js +474 -0
  136. package/dist/cjs/lib/v3/dom/locatorScripts/scripts.js.map +1 -0
  137. package/dist/cjs/lib/v3/dom/locatorScripts/selectors.js +289 -0
  138. package/dist/cjs/lib/v3/dom/locatorScripts/selectors.js.map +1 -0
  139. package/dist/cjs/lib/v3/dom/locatorScripts/waitForSelector.js +286 -0
  140. package/dist/cjs/lib/v3/dom/locatorScripts/waitForSelector.js.map +1 -0
  141. package/dist/cjs/lib/v3/dom/locatorScripts/xpathParser.js +381 -0
  142. package/dist/cjs/lib/v3/dom/locatorScripts/xpathParser.js.map +1 -0
  143. package/dist/cjs/lib/v3/dom/locatorScripts/xpathResolver.js +202 -0
  144. package/dist/cjs/lib/v3/dom/locatorScripts/xpathResolver.js.map +1 -0
  145. package/dist/cjs/lib/v3/dom/piercer.entry.js +5 -0
  146. package/dist/cjs/lib/v3/dom/piercer.entry.js.map +1 -0
  147. package/dist/cjs/lib/v3/dom/piercer.runtime.js +93 -0
  148. package/dist/cjs/lib/v3/dom/piercer.runtime.js.map +1 -0
  149. package/dist/cjs/lib/v3/dom/rerenderMissingShadows.entry.js +5 -0
  150. package/dist/cjs/lib/v3/dom/rerenderMissingShadows.entry.js.map +1 -0
  151. package/dist/cjs/lib/v3/dom/rerenderMissingShadows.runtime.js +43 -0
  152. package/dist/cjs/lib/v3/dom/rerenderMissingShadows.runtime.js.map +1 -0
  153. package/dist/cjs/lib/v3/dom/screenshotScripts/index.js +6 -0
  154. package/dist/cjs/lib/v3/dom/screenshotScripts/index.js.map +1 -0
  155. package/dist/cjs/lib/v3/dom/screenshotScripts/resolveMaskRect.js +85 -0
  156. package/dist/cjs/lib/v3/dom/screenshotScripts/resolveMaskRect.js.map +1 -0
  157. package/dist/cjs/lib/v3/external_clients/aisdk.js +107 -0
  158. package/dist/cjs/lib/v3/external_clients/aisdk.js.map +1 -0
  159. package/dist/cjs/lib/v3/external_clients/customOpenAI.js +224 -0
  160. package/dist/cjs/lib/v3/external_clients/customOpenAI.js.map +1 -0
  161. package/dist/cjs/lib/v3/flowLogger.js +881 -0
  162. package/dist/cjs/lib/v3/flowLogger.js.map +1 -0
  163. package/dist/cjs/lib/v3/handlers/actHandler.d.ts +2 -1
  164. package/dist/cjs/lib/v3/handlers/actHandler.js +344 -0
  165. package/dist/cjs/lib/v3/handlers/actHandler.js.map +1 -0
  166. package/dist/cjs/lib/v3/handlers/extractHandler.js +144 -0
  167. package/dist/cjs/lib/v3/handlers/extractHandler.js.map +1 -0
  168. package/dist/cjs/lib/v3/handlers/handlerUtils/actHandlerUtils.js +604 -0
  169. package/dist/cjs/lib/v3/handlers/handlerUtils/actHandlerUtils.js.map +1 -0
  170. package/dist/cjs/lib/v3/handlers/handlerUtils/timeoutGuard.js +17 -0
  171. package/dist/cjs/lib/v3/handlers/handlerUtils/timeoutGuard.js.map +1 -0
  172. package/dist/cjs/lib/v3/handlers/observeHandler.js +159 -0
  173. package/dist/cjs/lib/v3/handlers/observeHandler.js.map +1 -0
  174. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js +462 -0
  175. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js.map +1 -0
  176. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js +532 -0
  177. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -0
  178. package/dist/cjs/lib/v3/index.d.ts +143 -0
  179. package/dist/cjs/lib/v3/index.js +119 -0
  180. package/dist/cjs/lib/v3/index.js.map +1 -0
  181. package/dist/cjs/lib/v3/launch/browserbase.d.ts +1 -1
  182. package/dist/cjs/lib/v3/launch/browserbase.js +47 -0
  183. package/dist/cjs/lib/v3/launch/browserbase.js.map +1 -0
  184. package/dist/cjs/lib/v3/launch/local.js +104 -0
  185. package/dist/cjs/lib/v3/launch/local.js.map +1 -0
  186. package/dist/cjs/lib/v3/llm/AnthropicClient.js +246 -0
  187. package/dist/cjs/lib/v3/llm/AnthropicClient.js.map +1 -0
  188. package/dist/cjs/lib/v3/llm/CerebrasClient.js +242 -0
  189. package/dist/cjs/lib/v3/llm/CerebrasClient.js.map +1 -0
  190. package/dist/cjs/lib/v3/llm/GoogleClient.js +373 -0
  191. package/dist/cjs/lib/v3/llm/GoogleClient.js.map +1 -0
  192. package/dist/cjs/lib/v3/llm/GroqClient.js +243 -0
  193. package/dist/cjs/lib/v3/llm/GroqClient.js.map +1 -0
  194. package/dist/cjs/lib/v3/llm/LLMClient.js +27 -0
  195. package/dist/cjs/lib/v3/llm/LLMClient.js.map +1 -0
  196. package/dist/cjs/lib/v3/llm/LLMProvider.js +194 -0
  197. package/dist/cjs/lib/v3/llm/LLMProvider.js.map +1 -0
  198. package/dist/cjs/lib/v3/llm/OpenAIClient.js +336 -0
  199. package/dist/cjs/lib/v3/llm/OpenAIClient.js.map +1 -0
  200. package/dist/cjs/lib/v3/llm/aisdk.js +355 -0
  201. package/dist/cjs/lib/v3/llm/aisdk.js.map +1 -0
  202. package/dist/cjs/lib/v3/logger.js +102 -0
  203. package/dist/cjs/lib/v3/logger.js.map +1 -0
  204. package/dist/cjs/lib/v3/mcp/connection.d.ts +2 -0
  205. package/dist/cjs/lib/v3/mcp/connection.js +56 -0
  206. package/dist/cjs/lib/v3/mcp/connection.js.map +1 -0
  207. package/dist/cjs/lib/v3/mcp/utils.js +40 -0
  208. package/dist/cjs/lib/v3/mcp/utils.js.map +1 -0
  209. package/dist/cjs/lib/v3/runtimePaths.d.ts +6 -0
  210. package/dist/cjs/lib/v3/runtimePaths.js +119 -0
  211. package/dist/cjs/lib/v3/runtimePaths.js.map +1 -0
  212. package/dist/cjs/lib/v3/shutdown/cleanupLocal.js +36 -0
  213. package/dist/cjs/lib/v3/shutdown/cleanupLocal.js.map +1 -0
  214. package/dist/cjs/lib/v3/shutdown/supervisor.js +193 -0
  215. package/dist/cjs/lib/v3/shutdown/supervisor.js.map +1 -0
  216. package/dist/cjs/lib/v3/shutdown/supervisorClient.js +95 -0
  217. package/dist/cjs/lib/v3/shutdown/supervisorClient.js.map +1 -0
  218. package/dist/cjs/lib/v3/timeoutConfig.d.ts +1 -1
  219. package/dist/cjs/lib/v3/timeoutConfig.js +36 -0
  220. package/dist/cjs/lib/v3/timeoutConfig.js.map +1 -0
  221. package/dist/cjs/lib/v3/types/private/agent.js +3 -0
  222. package/dist/cjs/lib/v3/types/private/agent.js.map +1 -0
  223. package/dist/cjs/lib/v3/types/private/api.js +3 -0
  224. package/dist/cjs/lib/v3/types/private/api.js.map +1 -0
  225. package/dist/cjs/lib/v3/types/private/cache.d.ts +3 -0
  226. package/dist/cjs/lib/v3/types/private/cache.js +3 -0
  227. package/dist/cjs/lib/v3/types/private/cache.js.map +1 -0
  228. package/dist/cjs/lib/v3/types/private/evaluator.js +3 -0
  229. package/dist/cjs/lib/v3/types/private/evaluator.js.map +1 -0
  230. package/dist/cjs/lib/v3/types/private/handlers.d.ts +2 -1
  231. package/dist/cjs/lib/v3/types/private/handlers.js +19 -0
  232. package/dist/cjs/lib/v3/types/private/handlers.js.map +1 -0
  233. package/dist/cjs/lib/v3/types/private/index.js +24 -0
  234. package/dist/cjs/lib/v3/types/private/index.js.map +1 -0
  235. package/dist/cjs/lib/v3/types/private/internal.js +3 -0
  236. package/dist/cjs/lib/v3/types/private/internal.js.map +1 -0
  237. package/dist/cjs/lib/v3/types/private/locator.js +3 -0
  238. package/dist/cjs/lib/v3/types/private/locator.js.map +1 -0
  239. package/dist/cjs/lib/v3/types/private/network.js +6 -0
  240. package/dist/cjs/lib/v3/types/private/network.js.map +1 -0
  241. package/dist/cjs/lib/v3/types/private/shutdown.d.ts +1 -1
  242. package/dist/cjs/lib/v3/types/private/shutdown.js +6 -0
  243. package/dist/cjs/lib/v3/types/private/shutdown.js.map +1 -0
  244. package/dist/cjs/lib/v3/types/private/shutdownErrors.js +28 -0
  245. package/dist/cjs/lib/v3/types/private/shutdownErrors.js.map +1 -0
  246. package/dist/cjs/lib/v3/types/private/snapshot.js +3 -0
  247. package/dist/cjs/lib/v3/types/private/snapshot.js.map +1 -0
  248. package/dist/cjs/lib/v3/types/public/agent.d.ts +60 -2
  249. package/dist/cjs/lib/v3/types/public/agent.js +18 -0
  250. package/dist/cjs/lib/v3/types/public/agent.js.map +1 -0
  251. package/dist/cjs/lib/v3/types/public/api.d.ts +17 -0
  252. package/dist/cjs/lib/v3/types/public/api.js +922 -0
  253. package/dist/cjs/lib/v3/types/public/api.js.map +1 -0
  254. package/dist/cjs/lib/v3/types/public/apiErrors.js +41 -0
  255. package/dist/cjs/lib/v3/types/public/apiErrors.js.map +1 -0
  256. package/dist/cjs/lib/v3/types/public/context.d.ts +32 -0
  257. package/dist/cjs/lib/v3/types/public/context.js +3 -0
  258. package/dist/cjs/lib/v3/types/public/context.js.map +1 -0
  259. package/dist/cjs/lib/v3/types/public/index.d.ts +1 -0
  260. package/dist/cjs/lib/v3/types/public/index.js +56 -0
  261. package/dist/cjs/lib/v3/types/public/index.js.map +1 -0
  262. package/dist/cjs/lib/v3/types/public/locator.js +3 -0
  263. package/dist/cjs/lib/v3/types/public/locator.js.map +1 -0
  264. package/dist/cjs/lib/v3/types/public/logs.js +16 -0
  265. package/dist/cjs/lib/v3/types/public/logs.js.map +1 -0
  266. package/dist/cjs/lib/v3/types/public/methods.d.ts +33 -2
  267. package/dist/cjs/lib/v3/types/public/methods.js +18 -0
  268. package/dist/cjs/lib/v3/types/public/methods.js.map +1 -0
  269. package/dist/cjs/lib/v3/types/public/metrics.js +3 -0
  270. package/dist/cjs/lib/v3/types/public/metrics.js.map +1 -0
  271. package/dist/cjs/lib/v3/types/public/model.d.ts +4 -2
  272. package/dist/cjs/lib/v3/types/public/model.js +3 -0
  273. package/dist/cjs/lib/v3/types/public/model.js.map +1 -0
  274. package/dist/cjs/lib/v3/types/public/options.d.ts +8 -0
  275. package/dist/cjs/lib/v3/types/public/options.js +7 -0
  276. package/dist/cjs/lib/v3/types/public/options.js.map +1 -0
  277. package/dist/cjs/lib/v3/types/public/page.js +8 -0
  278. package/dist/cjs/lib/v3/types/public/page.js.map +1 -0
  279. package/dist/cjs/lib/v3/types/public/screenshotTypes.js +3 -0
  280. package/dist/cjs/lib/v3/types/public/screenshotTypes.js.map +1 -0
  281. package/dist/cjs/lib/v3/types/public/sdkErrors.d.ts +13 -0
  282. package/dist/cjs/lib/v3/types/public/sdkErrors.js +390 -0
  283. package/dist/cjs/lib/v3/types/public/sdkErrors.js.map +1 -0
  284. package/dist/cjs/lib/v3/understudy/a11y/snapshot/a11yTree.js +204 -0
  285. package/dist/cjs/lib/v3/understudy/a11y/snapshot/a11yTree.js.map +1 -0
  286. package/dist/cjs/lib/v3/understudy/a11y/snapshot/activeElement.js +124 -0
  287. package/dist/cjs/lib/v3/understudy/a11y/snapshot/activeElement.js.map +1 -0
  288. package/dist/cjs/lib/v3/understudy/a11y/snapshot/capture.js +345 -0
  289. package/dist/cjs/lib/v3/understudy/a11y/snapshot/capture.js.map +1 -0
  290. package/dist/cjs/lib/v3/understudy/a11y/snapshot/coordinateResolver.js +132 -0
  291. package/dist/cjs/lib/v3/understudy/a11y/snapshot/coordinateResolver.js.map +1 -0
  292. package/dist/cjs/lib/v3/understudy/a11y/snapshot/domTree.js +285 -0
  293. package/dist/cjs/lib/v3/understudy/a11y/snapshot/domTree.js.map +1 -0
  294. package/dist/cjs/lib/v3/understudy/a11y/snapshot/focusSelectors.d.ts +1 -0
  295. package/dist/cjs/lib/v3/understudy/a11y/snapshot/focusSelectors.js +226 -0
  296. package/dist/cjs/lib/v3/understudy/a11y/snapshot/focusSelectors.js.map +1 -0
  297. package/dist/cjs/lib/v3/understudy/a11y/snapshot/index.js +12 -0
  298. package/dist/cjs/lib/v3/understudy/a11y/snapshot/index.js.map +1 -0
  299. package/dist/cjs/lib/v3/understudy/a11y/snapshot/sessions.js +26 -0
  300. package/dist/cjs/lib/v3/understudy/a11y/snapshot/sessions.js.map +1 -0
  301. package/dist/cjs/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js +143 -0
  302. package/dist/cjs/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js.map +1 -0
  303. package/dist/cjs/lib/v3/understudy/a11y/snapshot/xpathUtils.js +110 -0
  304. package/dist/cjs/lib/v3/understudy/a11y/snapshot/xpathUtils.js.map +1 -0
  305. package/dist/cjs/lib/v3/understudy/a11yInvocation.js +15 -0
  306. package/dist/cjs/lib/v3/understudy/a11yInvocation.js.map +1 -0
  307. package/dist/cjs/lib/v3/understudy/cdp.d.ts +6 -1
  308. package/dist/cjs/lib/v3/understudy/cdp.js +317 -0
  309. package/dist/cjs/lib/v3/understudy/cdp.js.map +1 -0
  310. package/dist/cjs/lib/v3/understudy/consoleMessage.js +70 -0
  311. package/dist/cjs/lib/v3/understudy/consoleMessage.js.map +1 -0
  312. package/dist/cjs/lib/v3/understudy/context.d.ts +34 -0
  313. package/dist/cjs/lib/v3/understudy/context.js +960 -0
  314. package/dist/cjs/lib/v3/understudy/context.js.map +1 -0
  315. package/dist/cjs/lib/v3/understudy/cookies.d.ts +32 -0
  316. package/dist/cjs/lib/v3/understudy/cookies.js +142 -0
  317. package/dist/cjs/lib/v3/understudy/cookies.js.map +1 -0
  318. package/dist/cjs/lib/v3/understudy/deepLocator.js +204 -0
  319. package/dist/cjs/lib/v3/understudy/deepLocator.js.map +1 -0
  320. package/dist/cjs/lib/v3/understudy/executionContextRegistry.js +87 -0
  321. package/dist/cjs/lib/v3/understudy/executionContextRegistry.js.map +1 -0
  322. package/dist/cjs/lib/v3/understudy/fileUploadUtils.js +88 -0
  323. package/dist/cjs/lib/v3/understudy/fileUploadUtils.js.map +1 -0
  324. package/dist/cjs/lib/v3/understudy/frame.js +232 -0
  325. package/dist/cjs/lib/v3/understudy/frame.js.map +1 -0
  326. package/dist/cjs/lib/v3/understudy/frameLocator.js +260 -0
  327. package/dist/cjs/lib/v3/understudy/frameLocator.js.map +1 -0
  328. package/dist/cjs/lib/v3/understudy/frameRegistry.js +302 -0
  329. package/dist/cjs/lib/v3/understudy/frameRegistry.js.map +1 -0
  330. package/dist/cjs/lib/v3/understudy/initScripts.js +36 -0
  331. package/dist/cjs/lib/v3/understudy/initScripts.js.map +1 -0
  332. package/dist/cjs/lib/v3/understudy/lifecycleWatcher.js +249 -0
  333. package/dist/cjs/lib/v3/understudy/lifecycleWatcher.js.map +1 -0
  334. package/dist/cjs/lib/v3/understudy/locator.js +790 -0
  335. package/dist/cjs/lib/v3/understudy/locator.js.map +1 -0
  336. package/dist/cjs/lib/v3/understudy/locatorInvocation.js +15 -0
  337. package/dist/cjs/lib/v3/understudy/locatorInvocation.js.map +1 -0
  338. package/dist/cjs/lib/v3/understudy/navigationResponseTracker.js +228 -0
  339. package/dist/cjs/lib/v3/understudy/navigationResponseTracker.js.map +1 -0
  340. package/dist/cjs/lib/v3/understudy/networkManager.js +310 -0
  341. package/dist/cjs/lib/v3/understudy/networkManager.js.map +1 -0
  342. package/dist/cjs/lib/v3/understudy/page.d.ts +13 -0
  343. package/dist/cjs/lib/v3/understudy/page.js +1998 -0
  344. package/dist/cjs/lib/v3/understudy/page.js.map +1 -0
  345. package/dist/cjs/lib/v3/understudy/piercer.js +65 -0
  346. package/dist/cjs/lib/v3/understudy/piercer.js.map +1 -0
  347. package/dist/cjs/lib/v3/understudy/response.js +335 -0
  348. package/dist/cjs/lib/v3/understudy/response.js.map +1 -0
  349. package/dist/cjs/lib/v3/understudy/screenshotUtils.d.ts +0 -1
  350. package/dist/cjs/lib/v3/understudy/screenshotUtils.js +345 -0
  351. package/dist/cjs/lib/v3/understudy/screenshotUtils.js.map +1 -0
  352. package/dist/cjs/lib/v3/understudy/selectorResolver.js +300 -0
  353. package/dist/cjs/lib/v3/understudy/selectorResolver.js.map +1 -0
  354. package/dist/cjs/lib/v3/v3.js +1631 -0
  355. package/dist/cjs/lib/v3/v3.js.map +1 -0
  356. package/dist/cjs/lib/v3/zodCompat.js +26 -0
  357. package/dist/cjs/lib/v3/zodCompat.js.map +1 -0
  358. package/dist/cjs/lib/v3Evaluator.js +214 -0
  359. package/dist/cjs/lib/v3Evaluator.js.map +1 -0
  360. package/dist/cjs/lib/version.d.ts +1 -1
  361. package/dist/cjs/lib/version.js +9 -0
  362. package/dist/cjs/lib/version.js.map +1 -0
  363. package/dist/cjs/tests/cache-variables.test.js +221 -0
  364. package/dist/cjs/tests/cache-variables.test.js.map +1 -0
  365. package/dist/cjs/tests/integration/agent-abort-signal.spec.js +123 -0
  366. package/dist/cjs/tests/integration/agent-abort-signal.spec.js.map +1 -0
  367. package/dist/cjs/tests/integration/agent-cache-self-heal.spec.js +83 -0
  368. package/dist/cjs/tests/integration/agent-cache-self-heal.spec.js.map +1 -0
  369. package/dist/cjs/tests/integration/agent-callbacks.spec.js +385 -0
  370. package/dist/cjs/tests/integration/agent-callbacks.spec.js.map +1 -0
  371. package/dist/cjs/tests/integration/agent-experimental-validation.spec.js +362 -0
  372. package/dist/cjs/tests/integration/agent-experimental-validation.spec.js.map +1 -0
  373. package/dist/cjs/tests/integration/agent-hybrid-mode.spec.js +262 -0
  374. package/dist/cjs/tests/integration/agent-hybrid-mode.spec.js.map +1 -0
  375. package/dist/cjs/tests/integration/agent-message-continuation.spec.js +112 -0
  376. package/dist/cjs/tests/integration/agent-message-continuation.spec.js.map +1 -0
  377. package/dist/cjs/tests/integration/agent-streaming.spec.js +140 -0
  378. package/dist/cjs/tests/integration/agent-streaming.spec.js.map +1 -0
  379. package/dist/cjs/tests/integration/cdp-close-api-region.spec.d.ts +1 -0
  380. package/dist/cjs/tests/integration/cdp-close-api-region.spec.js +41 -0
  381. package/dist/cjs/tests/integration/cdp-close-api-region.spec.js.map +1 -0
  382. package/dist/cjs/tests/integration/cdp-connection-close.spec.d.ts +1 -0
  383. package/dist/cjs/tests/integration/cdp-connection-close.spec.js +76 -0
  384. package/dist/cjs/tests/integration/cdp-connection-close.spec.js.map +1 -0
  385. package/dist/cjs/tests/integration/cdp-session-detached.spec.d.ts +1 -0
  386. package/dist/cjs/tests/integration/cdp-session-detached.spec.js +45 -0
  387. package/dist/cjs/tests/integration/cdp-session-detached.spec.js.map +1 -0
  388. package/dist/cjs/tests/integration/click-count.spec.d.ts +1 -0
  389. package/dist/cjs/tests/integration/click-count.spec.js +163 -0
  390. package/dist/cjs/tests/integration/click-count.spec.js.map +1 -0
  391. package/dist/cjs/tests/integration/connect-to-existing-browser.spec.d.ts +1 -0
  392. package/dist/cjs/tests/integration/connect-to-existing-browser.spec.js +99 -0
  393. package/dist/cjs/tests/integration/connect-to-existing-browser.spec.js.map +1 -0
  394. package/dist/cjs/tests/integration/context-addInitScript.spec.d.ts +1 -0
  395. package/dist/cjs/tests/integration/context-addInitScript.spec.js +285 -0
  396. package/dist/cjs/tests/integration/context-addInitScript.spec.js.map +1 -0
  397. package/dist/cjs/tests/integration/context-extra-http-headers.spec.d.ts +1 -0
  398. package/dist/cjs/tests/integration/context-extra-http-headers.spec.js +49 -0
  399. package/dist/cjs/tests/integration/context-extra-http-headers.spec.js.map +1 -0
  400. package/dist/cjs/tests/integration/cookies.spec.d.ts +1 -0
  401. package/dist/cjs/tests/integration/cookies.spec.js +187 -0
  402. package/dist/cjs/tests/integration/cookies.spec.js.map +1 -0
  403. package/dist/cjs/tests/integration/default-page-tracking.spec.d.ts +1 -0
  404. package/dist/cjs/tests/integration/default-page-tracking.spec.js +52 -0
  405. package/dist/cjs/tests/integration/default-page-tracking.spec.js.map +1 -0
  406. package/dist/cjs/tests/integration/downloads.spec.d.ts +1 -0
  407. package/dist/cjs/tests/integration/downloads.spec.js +52 -0
  408. package/dist/cjs/tests/integration/downloads.spec.js.map +1 -0
  409. package/dist/cjs/tests/integration/frame-get-location-and-click.spec.d.ts +1 -0
  410. package/dist/cjs/tests/integration/frame-get-location-and-click.spec.js +57 -0
  411. package/dist/cjs/tests/integration/frame-get-location-and-click.spec.js.map +1 -0
  412. package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.d.ts +1 -0
  413. package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.js +219 -0
  414. package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.js.map +1 -0
  415. package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.d.ts +1 -0
  416. package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.js +474 -0
  417. package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.js.map +1 -0
  418. package/dist/cjs/tests/integration/keep-alive.child.d.ts +1 -0
  419. package/dist/cjs/tests/integration/keep-alive.child.js +85 -0
  420. package/dist/cjs/tests/integration/keep-alive.child.js.map +1 -0
  421. package/dist/cjs/tests/integration/keep-alive.spec.d.ts +22 -0
  422. package/dist/cjs/tests/integration/keep-alive.spec.js +490 -0
  423. package/dist/cjs/tests/integration/keep-alive.spec.js.map +1 -0
  424. package/dist/cjs/tests/integration/keyboard.spec.d.ts +1 -0
  425. package/dist/cjs/tests/integration/keyboard.spec.js +259 -0
  426. package/dist/cjs/tests/integration/keyboard.spec.js.map +1 -0
  427. package/dist/cjs/tests/integration/locator-backend-node-id.spec.d.ts +1 -0
  428. package/dist/cjs/tests/integration/locator-backend-node-id.spec.js +150 -0
  429. package/dist/cjs/tests/integration/locator-backend-node-id.spec.js.map +1 -0
  430. package/dist/cjs/tests/integration/locator-content-methods.spec.d.ts +1 -0
  431. package/dist/cjs/tests/integration/locator-content-methods.spec.js +180 -0
  432. package/dist/cjs/tests/integration/locator-content-methods.spec.js.map +1 -0
  433. package/dist/cjs/tests/integration/locator-count-iframe.spec.d.ts +1 -0
  434. package/dist/cjs/tests/integration/locator-count-iframe.spec.js +129 -0
  435. package/dist/cjs/tests/integration/locator-count-iframe.spec.js.map +1 -0
  436. package/dist/cjs/tests/integration/locator-count.spec.d.ts +1 -0
  437. package/dist/cjs/tests/integration/locator-count.spec.js +68 -0
  438. package/dist/cjs/tests/integration/locator-count.spec.js.map +1 -0
  439. package/dist/cjs/tests/integration/locator-fill.spec.d.ts +1 -0
  440. package/dist/cjs/tests/integration/locator-fill.spec.js +117 -0
  441. package/dist/cjs/tests/integration/locator-fill.spec.js.map +1 -0
  442. package/dist/cjs/tests/integration/locator-input-methods.spec.d.ts +1 -0
  443. package/dist/cjs/tests/integration/locator-input-methods.spec.js +127 -0
  444. package/dist/cjs/tests/integration/locator-input-methods.spec.js.map +1 -0
  445. package/dist/cjs/tests/integration/locator-nth.spec.d.ts +1 -0
  446. package/dist/cjs/tests/integration/locator-nth.spec.js +175 -0
  447. package/dist/cjs/tests/integration/locator-nth.spec.js.map +1 -0
  448. package/dist/cjs/tests/integration/locator-select-option.spec.d.ts +1 -0
  449. package/dist/cjs/tests/integration/locator-select-option.spec.js +216 -0
  450. package/dist/cjs/tests/integration/locator-select-option.spec.js.map +1 -0
  451. package/dist/cjs/tests/integration/logger-initialization.spec.d.ts +1 -0
  452. package/dist/cjs/tests/integration/logger-initialization.spec.js +597 -0
  453. package/dist/cjs/tests/integration/logger-initialization.spec.js.map +1 -0
  454. package/dist/cjs/tests/integration/multi-instance-logger.spec.d.ts +1 -0
  455. package/dist/cjs/tests/integration/multi-instance-logger.spec.js +293 -0
  456. package/dist/cjs/tests/integration/multi-instance-logger.spec.js.map +1 -0
  457. package/dist/cjs/tests/integration/nested-div.spec.d.ts +1 -0
  458. package/dist/cjs/tests/integration/nested-div.spec.js +22 -0
  459. package/dist/cjs/tests/integration/nested-div.spec.js.map +1 -0
  460. package/dist/cjs/tests/integration/page-addInitScript.spec.d.ts +1 -0
  461. package/dist/cjs/tests/integration/page-addInitScript.spec.js +94 -0
  462. package/dist/cjs/tests/integration/page-addInitScript.spec.js.map +1 -0
  463. package/dist/cjs/tests/integration/page-console.spec.d.ts +1 -0
  464. package/dist/cjs/tests/integration/page-console.spec.js +47 -0
  465. package/dist/cjs/tests/integration/page-console.spec.js.map +1 -0
  466. package/dist/cjs/tests/integration/page-drag-and-drop.spec.d.ts +1 -0
  467. package/dist/cjs/tests/integration/page-drag-and-drop.spec.js +437 -0
  468. package/dist/cjs/tests/integration/page-drag-and-drop.spec.js.map +1 -0
  469. package/dist/cjs/tests/integration/page-extra-http-headers.spec.d.ts +1 -0
  470. package/dist/cjs/tests/integration/page-extra-http-headers.spec.js +85 -0
  471. package/dist/cjs/tests/integration/page-extra-http-headers.spec.js.map +1 -0
  472. package/dist/cjs/tests/integration/page-goto-response.spec.d.ts +1 -0
  473. package/dist/cjs/tests/integration/page-goto-response.spec.js +34 -0
  474. package/dist/cjs/tests/integration/page-goto-response.spec.js.map +1 -0
  475. package/dist/cjs/tests/integration/page-hover.spec.d.ts +1 -0
  476. package/dist/cjs/tests/integration/page-hover.spec.js +165 -0
  477. package/dist/cjs/tests/integration/page-hover.spec.js.map +1 -0
  478. package/dist/cjs/tests/integration/page-screenshot.spec.d.ts +1 -0
  479. package/dist/cjs/tests/integration/page-screenshot.spec.js +292 -0
  480. package/dist/cjs/tests/integration/page-screenshot.spec.js.map +1 -0
  481. package/dist/cjs/tests/integration/page-scroll.spec.d.ts +1 -0
  482. package/dist/cjs/tests/integration/page-scroll.spec.js +183 -0
  483. package/dist/cjs/tests/integration/page-scroll.spec.js.map +1 -0
  484. package/dist/cjs/tests/integration/page-send-cdp.spec.d.ts +1 -0
  485. package/dist/cjs/tests/integration/page-send-cdp.spec.js +47 -0
  486. package/dist/cjs/tests/integration/page-send-cdp.spec.js.map +1 -0
  487. package/dist/cjs/tests/integration/perform-understudy-method.spec.d.ts +1 -0
  488. package/dist/cjs/tests/integration/perform-understudy-method.spec.js +63 -0
  489. package/dist/cjs/tests/integration/perform-understudy-method.spec.js.map +1 -0
  490. package/dist/cjs/tests/integration/setinputfiles.spec.d.ts +1 -0
  491. package/dist/cjs/tests/integration/setinputfiles.spec.js +133 -0
  492. package/dist/cjs/tests/integration/setinputfiles.spec.js.map +1 -0
  493. package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.d.ts +1 -0
  494. package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.js +161 -0
  495. package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.js.map +1 -0
  496. package/dist/cjs/tests/integration/shadow-iframe-spif.spec.d.ts +1 -0
  497. package/dist/cjs/tests/integration/shadow-iframe-spif.spec.js +160 -0
  498. package/dist/cjs/tests/integration/shadow-iframe-spif.spec.js.map +1 -0
  499. package/dist/cjs/tests/integration/testUtils.d.ts +7 -0
  500. package/dist/cjs/tests/integration/testUtils.js +44 -0
  501. package/dist/cjs/tests/integration/testUtils.js.map +1 -0
  502. package/dist/cjs/tests/integration/text-selector-innermost.spec.d.ts +1 -0
  503. package/dist/cjs/tests/integration/text-selector-innermost.spec.js +105 -0
  504. package/dist/cjs/tests/integration/text-selector-innermost.spec.js.map +1 -0
  505. package/dist/cjs/tests/integration/timeouts.spec.d.ts +1 -0
  506. package/dist/cjs/tests/integration/timeouts.spec.js +197 -0
  507. package/dist/cjs/tests/integration/timeouts.spec.js.map +1 -0
  508. package/dist/cjs/tests/integration/user-data-dir.spec.d.ts +1 -0
  509. package/dist/cjs/tests/integration/user-data-dir.spec.js +77 -0
  510. package/dist/cjs/tests/integration/user-data-dir.spec.js.map +1 -0
  511. package/dist/cjs/tests/integration/v3.config.d.ts +4 -0
  512. package/dist/cjs/tests/integration/v3.config.js +11 -0
  513. package/dist/cjs/tests/integration/v3.config.js.map +1 -0
  514. package/dist/cjs/tests/integration/v3.dynamic.config.d.ts +4 -0
  515. package/dist/cjs/tests/integration/v3.dynamic.config.js +48 -0
  516. package/dist/cjs/tests/integration/v3.dynamic.config.js.map +1 -0
  517. package/dist/cjs/tests/integration/v3.playwright.config.d.ts +2 -0
  518. package/dist/cjs/tests/integration/v3.playwright.config.js +48 -0
  519. package/dist/cjs/tests/integration/v3.playwright.config.js.map +1 -0
  520. package/dist/cjs/tests/integration/wait-for-selector.spec.d.ts +1 -0
  521. package/dist/cjs/tests/integration/wait-for-selector.spec.js +683 -0
  522. package/dist/cjs/tests/integration/wait-for-selector.spec.js.map +1 -0
  523. package/dist/cjs/tests/integration/wait-for-timeout.spec.d.ts +1 -0
  524. package/dist/cjs/tests/integration/wait-for-timeout.spec.js +118 -0
  525. package/dist/cjs/tests/integration/wait-for-timeout.spec.js.map +1 -0
  526. package/dist/cjs/tests/integration/xpath-for-location-deep.spec.d.ts +1 -0
  527. package/dist/cjs/tests/integration/xpath-for-location-deep.spec.js +87 -0
  528. package/dist/cjs/tests/integration/xpath-for-location-deep.spec.js.map +1 -0
  529. package/dist/cjs/tests/unit/agent-execution-model.test.d.ts +1 -0
  530. package/dist/cjs/tests/unit/agent-execution-model.test.js +128 -0
  531. package/dist/cjs/tests/unit/agent-execution-model.test.js.map +1 -0
  532. package/dist/cjs/tests/unit/api-multiregion.test.d.ts +1 -0
  533. package/dist/cjs/tests/unit/api-multiregion.test.js +58 -0
  534. package/dist/cjs/tests/unit/api-multiregion.test.js.map +1 -0
  535. package/dist/cjs/tests/unit/browserbase-session-accessors.test.d.ts +1 -0
  536. package/dist/cjs/tests/unit/browserbase-session-accessors.test.js +102 -0
  537. package/dist/cjs/tests/unit/browserbase-session-accessors.test.js.map +1 -0
  538. package/dist/cjs/tests/unit/cache-llm-resolution.test.d.ts +1 -0
  539. package/dist/cjs/tests/unit/cache-llm-resolution.test.js +186 -0
  540. package/dist/cjs/tests/unit/cache-llm-resolution.test.js.map +1 -0
  541. package/dist/cjs/tests/unit/cdp-connection-close.test.d.ts +1 -0
  542. package/dist/cjs/tests/unit/cdp-connection-close.test.js +74 -0
  543. package/dist/cjs/tests/unit/cdp-connection-close.test.js.map +1 -0
  544. package/dist/cjs/tests/unit/context-extra-http-headers.test.d.ts +1 -0
  545. package/dist/cjs/tests/unit/context-extra-http-headers.test.js +58 -0
  546. package/dist/cjs/tests/unit/context-extra-http-headers.test.js.map +1 -0
  547. package/dist/cjs/tests/unit/cookies.test.d.ts +1 -0
  548. package/dist/cjs/tests/unit/cookies.test.js +944 -0
  549. package/dist/cjs/tests/unit/cookies.test.js.map +1 -0
  550. package/dist/cjs/tests/unit/helpers/mockCDPSession.d.ts +19 -0
  551. package/dist/cjs/tests/unit/helpers/mockCDPSession.js +29 -0
  552. package/dist/cjs/tests/unit/helpers/mockCDPSession.js.map +1 -0
  553. package/dist/cjs/tests/unit/llm-provider.test.d.ts +1 -0
  554. package/dist/cjs/tests/unit/llm-provider.test.js +64 -0
  555. package/dist/cjs/tests/unit/llm-provider.test.js.map +1 -0
  556. package/dist/cjs/tests/unit/model-deprecation.test.d.ts +1 -0
  557. package/dist/cjs/tests/unit/model-deprecation.test.js +142 -0
  558. package/dist/cjs/tests/unit/model-deprecation.test.js.map +1 -0
  559. package/dist/cjs/tests/unit/model-utils.test.d.ts +1 -0
  560. package/dist/cjs/tests/unit/model-utils.test.js +42 -0
  561. package/dist/cjs/tests/unit/model-utils.test.js.map +1 -0
  562. package/dist/cjs/tests/unit/page-extra-http-headers.test.d.ts +1 -0
  563. package/dist/cjs/tests/unit/page-extra-http-headers.test.js +92 -0
  564. package/dist/cjs/tests/unit/page-extra-http-headers.test.js.map +1 -0
  565. package/dist/cjs/tests/unit/page-snapshot.test.d.ts +1 -0
  566. package/dist/cjs/tests/unit/page-snapshot.test.js +75 -0
  567. package/dist/cjs/tests/unit/page-snapshot.test.js.map +1 -0
  568. package/dist/cjs/tests/unit/public-api/export-surface.test.d.ts +1 -0
  569. package/dist/cjs/tests/unit/public-api/export-surface.test.js +107 -0
  570. package/dist/cjs/tests/unit/public-api/export-surface.test.js.map +1 -0
  571. package/dist/cjs/tests/unit/public-api/llm-and-agents.test.d.ts +1 -0
  572. package/dist/cjs/tests/unit/public-api/llm-and-agents.test.js +175 -0
  573. package/dist/cjs/tests/unit/public-api/llm-and-agents.test.js.map +1 -0
  574. package/dist/cjs/tests/unit/public-api/public-error-types.test.d.ts +62 -0
  575. package/dist/cjs/tests/unit/public-api/public-error-types.test.js +110 -0
  576. package/dist/cjs/tests/unit/public-api/public-error-types.test.js.map +1 -0
  577. package/dist/cjs/tests/unit/public-api/public-types.test.d.ts +1 -0
  578. package/dist/cjs/tests/unit/public-api/public-types.test.js +99 -0
  579. package/dist/cjs/tests/unit/public-api/public-types.test.js.map +1 -0
  580. package/dist/cjs/tests/unit/public-api/runtime-utils.test.d.ts +1 -0
  581. package/dist/cjs/tests/unit/public-api/runtime-utils.test.js +60 -0
  582. package/dist/cjs/tests/unit/public-api/runtime-utils.test.js.map +1 -0
  583. package/dist/cjs/tests/unit/public-api/schema-utils.test.d.ts +1 -0
  584. package/dist/cjs/tests/unit/public-api/schema-utils.test.js +95 -0
  585. package/dist/cjs/tests/unit/public-api/schema-utils.test.js.map +1 -0
  586. package/dist/cjs/tests/unit/public-api/timeout-error-types.test.d.ts +1 -0
  587. package/dist/cjs/tests/unit/public-api/timeout-error-types.test.js +121 -0
  588. package/dist/cjs/tests/unit/public-api/timeout-error-types.test.js.map +1 -0
  589. package/dist/cjs/tests/unit/public-api/tool-type-export.test.d.ts +1 -0
  590. package/dist/cjs/tests/unit/public-api/tool-type-export.test.js +65 -0
  591. package/dist/cjs/tests/unit/public-api/tool-type-export.test.js.map +1 -0
  592. package/dist/cjs/tests/unit/public-api/v3-core.test.d.ts +1 -0
  593. package/dist/cjs/tests/unit/public-api/v3-core.test.js +108 -0
  594. package/dist/cjs/tests/unit/public-api/v3-core.test.js.map +1 -0
  595. package/dist/cjs/tests/unit/rerender-missing-shadows.test.d.ts +1 -0
  596. package/dist/cjs/tests/unit/rerender-missing-shadows.test.js +209 -0
  597. package/dist/cjs/tests/unit/rerender-missing-shadows.test.js.map +1 -0
  598. package/dist/cjs/tests/unit/safety-confirmation.test.d.ts +1 -0
  599. package/dist/cjs/tests/unit/safety-confirmation.test.js +110 -0
  600. package/dist/cjs/tests/unit/safety-confirmation.test.js.map +1 -0
  601. package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.d.ts +1 -0
  602. package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.js +330 -0
  603. package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.js.map +1 -0
  604. package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.d.ts +1 -0
  605. package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.js +286 -0
  606. package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.js.map +1 -0
  607. package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.d.ts +1 -0
  608. package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.js +394 -0
  609. package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.js.map +1 -0
  610. package/dist/cjs/tests/unit/snapshot-cbor.test.d.ts +1 -0
  611. package/dist/cjs/tests/unit/snapshot-cbor.test.js +204 -0
  612. package/dist/cjs/tests/unit/snapshot-cbor.test.js.map +1 -0
  613. package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.d.ts +1 -0
  614. package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.js +220 -0
  615. package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.js.map +1 -0
  616. package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.d.ts +1 -0
  617. package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.js +107 -0
  618. package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.js.map +1 -0
  619. package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.d.ts +1 -0
  620. package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.js +89 -0
  621. package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.js.map +1 -0
  622. package/dist/cjs/tests/unit/snapshot-frame-merge.test.d.ts +1 -0
  623. package/dist/cjs/tests/unit/snapshot-frame-merge.test.js +335 -0
  624. package/dist/cjs/tests/unit/snapshot-frame-merge.test.js.map +1 -0
  625. package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.d.ts +1 -0
  626. package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.js +84 -0
  627. package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.js.map +1 -0
  628. package/dist/cjs/tests/unit/snapshot-xpath-utils.test.d.ts +1 -0
  629. package/dist/cjs/tests/unit/snapshot-xpath-utils.test.js +74 -0
  630. package/dist/cjs/tests/unit/snapshot-xpath-utils.test.js.map +1 -0
  631. package/dist/cjs/tests/unit/timeout-handlers.test.d.ts +1 -0
  632. package/dist/cjs/tests/unit/timeout-handlers.test.js +847 -0
  633. package/dist/cjs/tests/unit/timeout-handlers.test.js.map +1 -0
  634. package/dist/cjs/tests/unit/understudy-command-exception.test.d.ts +1 -0
  635. package/dist/cjs/tests/unit/understudy-command-exception.test.js +57 -0
  636. package/dist/cjs/tests/unit/understudy-command-exception.test.js.map +1 -0
  637. package/dist/cjs/tests/unit/xpath-parser.test.d.ts +1 -0
  638. package/dist/cjs/tests/unit/xpath-parser.test.js +311 -0
  639. package/dist/cjs/tests/unit/xpath-parser.test.js.map +1 -0
  640. package/dist/cjs/tests/unit/xpath-resolver.test.d.ts +1 -0
  641. package/dist/cjs/tests/unit/xpath-resolver.test.js +80 -0
  642. package/dist/cjs/tests/unit/xpath-resolver.test.js.map +1 -0
  643. package/dist/cjs/tests/unit/zod-enum-compatibility.test.d.ts +1 -0
  644. package/dist/cjs/tests/unit/zod-enum-compatibility.test.js +149 -0
  645. package/dist/cjs/tests/unit/zod-enum-compatibility.test.js.map +1 -0
  646. package/dist/esm/index.d.ts +1 -2
  647. package/dist/esm/index.js +1 -2
  648. package/dist/esm/lib/inference.js +5 -8
  649. package/dist/esm/lib/inference.js.map +1 -1
  650. package/dist/esm/lib/modelUtils.d.ts +1 -0
  651. package/dist/esm/lib/modelUtils.js.map +1 -1
  652. package/dist/esm/lib/prompt.d.ts +3 -2
  653. package/dist/esm/lib/prompt.js.map +1 -1
  654. package/dist/esm/lib/v3/agent/AgentProvider.js +1 -1
  655. package/dist/esm/lib/v3/agent/AgentProvider.js.map +1 -1
  656. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js +17 -2
  657. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
  658. package/dist/esm/lib/v3/agent/MicrosoftCUAClient.js +4 -4
  659. package/dist/esm/lib/v3/agent/MicrosoftCUAClient.js.map +1 -1
  660. package/dist/esm/lib/v3/agent/prompts/agentSystemPrompt.d.ts +3 -1
  661. package/dist/esm/lib/v3/agent/prompts/agentSystemPrompt.js +24 -1
  662. package/dist/esm/lib/v3/agent/prompts/agentSystemPrompt.js.map +1 -1
  663. package/dist/esm/lib/v3/agent/tools/act.d.ts +2 -2
  664. package/dist/esm/lib/v3/agent/tools/act.js +66 -44
  665. package/dist/esm/lib/v3/agent/tools/act.js.map +1 -1
  666. package/dist/esm/lib/v3/agent/tools/ariaTree.d.ts +8 -1
  667. package/dist/esm/lib/v3/agent/tools/ariaTree.js +60 -22
  668. package/dist/esm/lib/v3/agent/tools/ariaTree.js.map +1 -1
  669. package/dist/esm/lib/v3/agent/tools/click.js +23 -31
  670. package/dist/esm/lib/v3/agent/tools/click.js.map +1 -1
  671. package/dist/esm/lib/v3/agent/tools/dragAndDrop.js +22 -30
  672. package/dist/esm/lib/v3/agent/tools/dragAndDrop.js.map +1 -1
  673. package/dist/esm/lib/v3/agent/tools/extract.d.ts +2 -2
  674. package/dist/esm/lib/v3/agent/tools/extract.js +16 -3
  675. package/dist/esm/lib/v3/agent/tools/extract.js.map +1 -1
  676. package/dist/esm/lib/v3/agent/tools/fillFormVision.d.ts +2 -2
  677. package/dist/esm/lib/v3/agent/tools/fillFormVision.js +109 -98
  678. package/dist/esm/lib/v3/agent/tools/fillFormVision.js.map +1 -1
  679. package/dist/esm/lib/v3/agent/tools/fillform.d.ts +8 -2
  680. package/dist/esm/lib/v3/agent/tools/fillform.js +82 -52
  681. package/dist/esm/lib/v3/agent/tools/fillform.js.map +1 -1
  682. package/dist/esm/lib/v3/agent/tools/index.d.ts +11 -1
  683. package/dist/esm/lib/v3/agent/tools/index.js +8 -7
  684. package/dist/esm/lib/v3/agent/tools/index.js.map +1 -1
  685. package/dist/esm/lib/v3/agent/tools/screenshot.d.ts +8 -0
  686. package/dist/esm/lib/v3/agent/tools/screenshot.js +32 -15
  687. package/dist/esm/lib/v3/agent/tools/screenshot.js.map +1 -1
  688. package/dist/esm/lib/v3/agent/tools/scroll.js +12 -0
  689. package/dist/esm/lib/v3/agent/tools/scroll.js.map +1 -1
  690. package/dist/esm/lib/v3/agent/tools/type.d.ts +2 -2
  691. package/dist/esm/lib/v3/agent/tools/type.js +80 -79
  692. package/dist/esm/lib/v3/agent/tools/type.js.map +1 -1
  693. package/dist/esm/lib/v3/agent/tools/wait.js +6 -0
  694. package/dist/esm/lib/v3/agent/tools/wait.js.map +1 -1
  695. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js +4 -0
  696. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -1
  697. package/dist/esm/lib/v3/agent/utils/validateExperimentalFeatures.js +8 -0
  698. package/dist/esm/lib/v3/agent/utils/validateExperimentalFeatures.js.map +1 -1
  699. package/dist/esm/lib/v3/agent/utils/variables.d.ts +21 -0
  700. package/dist/esm/lib/v3/agent/utils/variables.js +48 -0
  701. package/dist/esm/lib/v3/agent/utils/variables.js.map +1 -0
  702. package/dist/esm/lib/v3/api.d.ts +23 -5
  703. package/dist/esm/lib/v3/api.js +74 -13
  704. package/dist/esm/lib/v3/api.js.map +1 -1
  705. package/dist/esm/lib/v3/cache/ActCache.d.ts +0 -1
  706. package/dist/esm/lib/v3/cache/ActCache.js +2 -18
  707. package/dist/esm/lib/v3/cache/ActCache.js.map +1 -1
  708. package/dist/esm/lib/v3/cache/AgentCache.d.ts +1 -0
  709. package/dist/esm/lib/v3/cache/AgentCache.js +18 -11
  710. package/dist/esm/lib/v3/cache/AgentCache.js.map +1 -1
  711. package/dist/esm/lib/v3/handlers/actHandler.d.ts +2 -1
  712. package/dist/esm/lib/v3/handlers/actHandler.js +4 -4
  713. package/dist/esm/lib/v3/handlers/actHandler.js.map +1 -1
  714. package/dist/esm/lib/v3/handlers/extractHandler.js +2 -2
  715. package/dist/esm/lib/v3/handlers/extractHandler.js.map +1 -1
  716. package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js +0 -27
  717. package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js.map +1 -1
  718. package/dist/esm/lib/v3/handlers/observeHandler.js +1 -2
  719. package/dist/esm/lib/v3/handlers/observeHandler.js.map +1 -1
  720. package/dist/esm/lib/v3/handlers/v3AgentHandler.js +13 -16
  721. package/dist/esm/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  722. package/dist/esm/lib/v3/index.d.ts +143 -0
  723. package/dist/esm/lib/v3/index.js +41 -0
  724. package/dist/esm/lib/v3/index.js.map +1 -1
  725. package/dist/esm/lib/v3/launch/browserbase.d.ts +1 -1
  726. package/dist/esm/lib/v3/launch/browserbase.js +4 -9
  727. package/dist/esm/lib/v3/launch/browserbase.js.map +1 -1
  728. package/dist/esm/lib/v3/llm/LLMProvider.js +0 -5
  729. package/dist/esm/lib/v3/llm/LLMProvider.js.map +1 -1
  730. package/dist/esm/lib/v3/llm/OpenAIClient.js +2 -2
  731. package/dist/esm/lib/v3/llm/OpenAIClient.js.map +1 -1
  732. package/dist/esm/lib/v3/mcp/connection.d.ts +2 -0
  733. package/dist/esm/lib/v3/mcp/connection.js +5 -2
  734. package/dist/esm/lib/v3/mcp/connection.js.map +1 -1
  735. package/dist/esm/lib/v3/runtimePaths.d.ts +6 -0
  736. package/dist/esm/lib/v3/runtimePaths.js +107 -0
  737. package/dist/esm/lib/v3/runtimePaths.js.map +1 -0
  738. package/dist/esm/lib/v3/shutdown/supervisor.js +2 -2
  739. package/dist/esm/lib/v3/shutdown/supervisor.js.map +1 -1
  740. package/dist/esm/lib/v3/shutdown/supervisorClient.js +9 -14
  741. package/dist/esm/lib/v3/shutdown/supervisorClient.js.map +1 -1
  742. package/dist/esm/lib/v3/timeoutConfig.d.ts +1 -1
  743. package/dist/esm/lib/v3/timeoutConfig.js +5 -0
  744. package/dist/esm/lib/v3/timeoutConfig.js.map +1 -1
  745. package/dist/esm/lib/v3/types/private/cache.d.ts +3 -0
  746. package/dist/esm/lib/v3/types/private/cache.js.map +1 -1
  747. package/dist/esm/lib/v3/types/private/handlers.d.ts +2 -1
  748. package/dist/esm/lib/v3/types/private/handlers.js.map +1 -1
  749. package/dist/esm/lib/v3/types/private/shutdown.d.ts +1 -1
  750. package/dist/esm/lib/v3/types/private/shutdown.js.map +1 -1
  751. package/dist/esm/lib/v3/types/public/agent.d.ts +60 -2
  752. package/dist/esm/lib/v3/types/public/agent.js +1 -1
  753. package/dist/esm/lib/v3/types/public/agent.js.map +1 -1
  754. package/dist/esm/lib/v3/types/public/api.d.ts +17 -0
  755. package/dist/esm/lib/v3/types/public/api.js +3 -2
  756. package/dist/esm/lib/v3/types/public/api.js.map +1 -1
  757. package/dist/esm/lib/v3/types/public/context.d.ts +32 -0
  758. package/dist/esm/lib/v3/types/public/context.js +2 -0
  759. package/dist/esm/lib/v3/types/public/context.js.map +1 -0
  760. package/dist/esm/lib/v3/types/public/index.d.ts +1 -0
  761. package/dist/esm/lib/v3/types/public/index.js +1 -0
  762. package/dist/esm/lib/v3/types/public/index.js.map +1 -1
  763. package/dist/esm/lib/v3/types/public/methods.d.ts +33 -2
  764. package/dist/esm/lib/v3/types/public/methods.js.map +1 -1
  765. package/dist/esm/lib/v3/types/public/model.d.ts +4 -2
  766. package/dist/esm/lib/v3/types/public/model.js.map +1 -1
  767. package/dist/esm/lib/v3/types/public/options.d.ts +8 -0
  768. package/dist/esm/lib/v3/types/public/options.js.map +1 -1
  769. package/dist/esm/lib/v3/types/public/sdkErrors.d.ts +13 -0
  770. package/dist/esm/lib/v3/types/public/sdkErrors.js +22 -0
  771. package/dist/esm/lib/v3/types/public/sdkErrors.js.map +1 -1
  772. package/dist/esm/lib/v3/understudy/a11y/snapshot/focusSelectors.d.ts +1 -0
  773. package/dist/esm/lib/v3/understudy/a11y/snapshot/focusSelectors.js +1 -1
  774. package/dist/esm/lib/v3/understudy/a11y/snapshot/focusSelectors.js.map +1 -1
  775. package/dist/esm/lib/v3/understudy/cdp.d.ts +6 -1
  776. package/dist/esm/lib/v3/understudy/cdp.js +65 -7
  777. package/dist/esm/lib/v3/understudy/cdp.js.map +1 -1
  778. package/dist/esm/lib/v3/understudy/context.d.ts +34 -0
  779. package/dist/esm/lib/v3/understudy/context.js +327 -67
  780. package/dist/esm/lib/v3/understudy/context.js.map +1 -1
  781. package/dist/esm/lib/v3/understudy/cookies.d.ts +32 -0
  782. package/dist/esm/lib/v3/understudy/cookies.js +136 -0
  783. package/dist/esm/lib/v3/understudy/cookies.js.map +1 -0
  784. package/dist/esm/lib/v3/understudy/deepLocator.js +1 -23
  785. package/dist/esm/lib/v3/understudy/deepLocator.js.map +1 -1
  786. package/dist/esm/lib/v3/understudy/frame.js +24 -7
  787. package/dist/esm/lib/v3/understudy/frame.js.map +1 -1
  788. package/dist/esm/lib/v3/understudy/page.d.ts +13 -0
  789. package/dist/esm/lib/v3/understudy/page.js +58 -5
  790. package/dist/esm/lib/v3/understudy/page.js.map +1 -1
  791. package/dist/esm/lib/v3/understudy/screenshotUtils.d.ts +0 -1
  792. package/dist/esm/lib/v3/understudy/screenshotUtils.js +1 -19
  793. package/dist/esm/lib/v3/understudy/screenshotUtils.js.map +1 -1
  794. package/dist/esm/lib/v3/understudy/selectorResolver.js +1 -1
  795. package/dist/esm/lib/v3/understudy/selectorResolver.js.map +1 -1
  796. package/dist/esm/lib/v3/v3.js +59 -35
  797. package/dist/esm/lib/v3/v3.js.map +1 -1
  798. package/dist/esm/lib/version.d.ts +1 -1
  799. package/dist/esm/lib/version.js +1 -1
  800. package/dist/esm/lib/version.js.map +1 -1
  801. package/dist/esm/tests/cache-variables.test.d.ts +1 -0
  802. package/dist/esm/tests/cache-variables.test.js +219 -0
  803. package/dist/esm/tests/cache-variables.test.js.map +1 -0
  804. package/dist/esm/tests/integration/agent-abort-signal.spec.d.ts +1 -0
  805. package/dist/esm/tests/integration/agent-abort-signal.spec.js +121 -0
  806. package/dist/esm/tests/integration/agent-abort-signal.spec.js.map +1 -0
  807. package/dist/esm/tests/integration/agent-cache-self-heal.spec.d.ts +1 -0
  808. package/dist/esm/tests/integration/agent-cache-self-heal.spec.js +78 -0
  809. package/dist/esm/tests/integration/agent-cache-self-heal.spec.js.map +1 -0
  810. package/dist/esm/tests/integration/agent-callbacks.spec.d.ts +1 -0
  811. package/dist/esm/tests/integration/agent-callbacks.spec.js +383 -0
  812. package/dist/esm/tests/integration/agent-callbacks.spec.js.map +1 -0
  813. package/dist/esm/tests/integration/agent-experimental-validation.spec.d.ts +1 -0
  814. package/dist/esm/tests/integration/agent-experimental-validation.spec.js +360 -0
  815. package/dist/esm/tests/integration/agent-experimental-validation.spec.js.map +1 -0
  816. package/dist/esm/tests/integration/agent-hybrid-mode.spec.d.ts +1 -0
  817. package/dist/esm/tests/integration/agent-hybrid-mode.spec.js +260 -0
  818. package/dist/esm/tests/integration/agent-hybrid-mode.spec.js.map +1 -0
  819. package/dist/esm/tests/integration/agent-message-continuation.spec.d.ts +1 -0
  820. package/dist/esm/tests/integration/agent-message-continuation.spec.js +110 -0
  821. package/dist/esm/tests/integration/agent-message-continuation.spec.js.map +1 -0
  822. package/dist/esm/tests/integration/agent-streaming.spec.d.ts +1 -0
  823. package/dist/esm/tests/integration/agent-streaming.spec.js +138 -0
  824. package/dist/esm/tests/integration/agent-streaming.spec.js.map +1 -0
  825. package/dist/esm/tests/integration/cdp-close-api-region.spec.d.ts +1 -0
  826. package/dist/esm/tests/integration/cdp-close-api-region.spec.js +39 -0
  827. package/dist/esm/tests/integration/cdp-close-api-region.spec.js.map +1 -0
  828. package/dist/esm/tests/integration/cdp-connection-close.spec.d.ts +1 -0
  829. package/dist/esm/tests/integration/cdp-connection-close.spec.js +74 -0
  830. package/dist/esm/tests/integration/cdp-connection-close.spec.js.map +1 -0
  831. package/dist/esm/tests/integration/cdp-session-detached.spec.d.ts +1 -0
  832. package/dist/esm/tests/integration/cdp-session-detached.spec.js +43 -0
  833. package/dist/esm/tests/integration/cdp-session-detached.spec.js.map +1 -0
  834. package/dist/esm/tests/integration/click-count.spec.d.ts +1 -0
  835. package/dist/esm/tests/integration/click-count.spec.js +161 -0
  836. package/dist/esm/tests/integration/click-count.spec.js.map +1 -0
  837. package/dist/esm/tests/integration/connect-to-existing-browser.spec.d.ts +1 -0
  838. package/dist/esm/tests/integration/connect-to-existing-browser.spec.js +97 -0
  839. package/dist/esm/tests/integration/connect-to-existing-browser.spec.js.map +1 -0
  840. package/dist/esm/tests/integration/context-addInitScript.spec.d.ts +1 -0
  841. package/dist/esm/tests/integration/context-addInitScript.spec.js +283 -0
  842. package/dist/esm/tests/integration/context-addInitScript.spec.js.map +1 -0
  843. package/dist/esm/tests/integration/context-extra-http-headers.spec.d.ts +1 -0
  844. package/dist/esm/tests/integration/context-extra-http-headers.spec.js +47 -0
  845. package/dist/esm/tests/integration/context-extra-http-headers.spec.js.map +1 -0
  846. package/dist/esm/tests/integration/cookies.spec.d.ts +1 -0
  847. package/dist/esm/tests/integration/cookies.spec.js +185 -0
  848. package/dist/esm/tests/integration/cookies.spec.js.map +1 -0
  849. package/dist/esm/tests/integration/default-page-tracking.spec.d.ts +1 -0
  850. package/dist/esm/tests/integration/default-page-tracking.spec.js +50 -0
  851. package/dist/esm/tests/integration/default-page-tracking.spec.js.map +1 -0
  852. package/dist/esm/tests/integration/downloads.spec.d.ts +1 -0
  853. package/dist/esm/tests/integration/downloads.spec.js +47 -0
  854. package/dist/esm/tests/integration/downloads.spec.js.map +1 -0
  855. package/dist/esm/tests/integration/frame-get-location-and-click.spec.d.ts +1 -0
  856. package/dist/esm/tests/integration/frame-get-location-and-click.spec.js +55 -0
  857. package/dist/esm/tests/integration/frame-get-location-and-click.spec.js.map +1 -0
  858. package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.d.ts +1 -0
  859. package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.js +217 -0
  860. package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.js.map +1 -0
  861. package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.d.ts +1 -0
  862. package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.js +472 -0
  863. package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.js.map +1 -0
  864. package/dist/esm/tests/integration/keep-alive.child.d.ts +1 -0
  865. package/dist/esm/tests/integration/keep-alive.child.js +83 -0
  866. package/dist/esm/tests/integration/keep-alive.child.js.map +1 -0
  867. package/dist/esm/tests/integration/keep-alive.spec.d.ts +22 -0
  868. package/dist/esm/tests/integration/keep-alive.spec.js +482 -0
  869. package/dist/esm/tests/integration/keep-alive.spec.js.map +1 -0
  870. package/dist/esm/tests/integration/keyboard.spec.d.ts +1 -0
  871. package/dist/esm/tests/integration/keyboard.spec.js +257 -0
  872. package/dist/esm/tests/integration/keyboard.spec.js.map +1 -0
  873. package/dist/esm/tests/integration/locator-backend-node-id.spec.d.ts +1 -0
  874. package/dist/esm/tests/integration/locator-backend-node-id.spec.js +148 -0
  875. package/dist/esm/tests/integration/locator-backend-node-id.spec.js.map +1 -0
  876. package/dist/esm/tests/integration/locator-content-methods.spec.d.ts +1 -0
  877. package/dist/esm/tests/integration/locator-content-methods.spec.js +178 -0
  878. package/dist/esm/tests/integration/locator-content-methods.spec.js.map +1 -0
  879. package/dist/esm/tests/integration/locator-count-iframe.spec.d.ts +1 -0
  880. package/dist/esm/tests/integration/locator-count-iframe.spec.js +127 -0
  881. package/dist/esm/tests/integration/locator-count-iframe.spec.js.map +1 -0
  882. package/dist/esm/tests/integration/locator-count.spec.d.ts +1 -0
  883. package/dist/esm/tests/integration/locator-count.spec.js +66 -0
  884. package/dist/esm/tests/integration/locator-count.spec.js.map +1 -0
  885. package/dist/esm/tests/integration/locator-fill.spec.d.ts +1 -0
  886. package/dist/esm/tests/integration/locator-fill.spec.js +115 -0
  887. package/dist/esm/tests/integration/locator-fill.spec.js.map +1 -0
  888. package/dist/esm/tests/integration/locator-input-methods.spec.d.ts +1 -0
  889. package/dist/esm/tests/integration/locator-input-methods.spec.js +125 -0
  890. package/dist/esm/tests/integration/locator-input-methods.spec.js.map +1 -0
  891. package/dist/esm/tests/integration/locator-nth.spec.d.ts +1 -0
  892. package/dist/esm/tests/integration/locator-nth.spec.js +173 -0
  893. package/dist/esm/tests/integration/locator-nth.spec.js.map +1 -0
  894. package/dist/esm/tests/integration/locator-select-option.spec.d.ts +1 -0
  895. package/dist/esm/tests/integration/locator-select-option.spec.js +214 -0
  896. package/dist/esm/tests/integration/locator-select-option.spec.js.map +1 -0
  897. package/dist/esm/tests/integration/logger-initialization.spec.d.ts +1 -0
  898. package/dist/esm/tests/integration/logger-initialization.spec.js +595 -0
  899. package/dist/esm/tests/integration/logger-initialization.spec.js.map +1 -0
  900. package/dist/esm/tests/integration/multi-instance-logger.spec.d.ts +1 -0
  901. package/dist/esm/tests/integration/multi-instance-logger.spec.js +291 -0
  902. package/dist/esm/tests/integration/multi-instance-logger.spec.js.map +1 -0
  903. package/dist/esm/tests/integration/nested-div.spec.d.ts +1 -0
  904. package/dist/esm/tests/integration/nested-div.spec.js +20 -0
  905. package/dist/esm/tests/integration/nested-div.spec.js.map +1 -0
  906. package/dist/esm/tests/integration/page-addInitScript.spec.d.ts +1 -0
  907. package/dist/esm/tests/integration/page-addInitScript.spec.js +92 -0
  908. package/dist/esm/tests/integration/page-addInitScript.spec.js.map +1 -0
  909. package/dist/esm/tests/integration/page-console.spec.d.ts +1 -0
  910. package/dist/esm/tests/integration/page-console.spec.js +45 -0
  911. package/dist/esm/tests/integration/page-console.spec.js.map +1 -0
  912. package/dist/esm/tests/integration/page-drag-and-drop.spec.d.ts +1 -0
  913. package/dist/esm/tests/integration/page-drag-and-drop.spec.js +435 -0
  914. package/dist/esm/tests/integration/page-drag-and-drop.spec.js.map +1 -0
  915. package/dist/esm/tests/integration/page-extra-http-headers.spec.d.ts +1 -0
  916. package/dist/esm/tests/integration/page-extra-http-headers.spec.js +83 -0
  917. package/dist/esm/tests/integration/page-extra-http-headers.spec.js.map +1 -0
  918. package/dist/esm/tests/integration/page-goto-response.spec.d.ts +1 -0
  919. package/dist/esm/tests/integration/page-goto-response.spec.js +32 -0
  920. package/dist/esm/tests/integration/page-goto-response.spec.js.map +1 -0
  921. package/dist/esm/tests/integration/page-hover.spec.d.ts +1 -0
  922. package/dist/esm/tests/integration/page-hover.spec.js +163 -0
  923. package/dist/esm/tests/integration/page-hover.spec.js.map +1 -0
  924. package/dist/esm/tests/integration/page-screenshot.spec.d.ts +1 -0
  925. package/dist/esm/tests/integration/page-screenshot.spec.js +257 -0
  926. package/dist/esm/tests/integration/page-screenshot.spec.js.map +1 -0
  927. package/dist/esm/tests/integration/page-scroll.spec.d.ts +1 -0
  928. package/dist/esm/tests/integration/page-scroll.spec.js +181 -0
  929. package/dist/esm/tests/integration/page-scroll.spec.js.map +1 -0
  930. package/dist/esm/tests/integration/page-send-cdp.spec.d.ts +1 -0
  931. package/dist/esm/tests/integration/page-send-cdp.spec.js +45 -0
  932. package/dist/esm/tests/integration/page-send-cdp.spec.js.map +1 -0
  933. package/dist/esm/tests/integration/perform-understudy-method.spec.d.ts +1 -0
  934. package/dist/esm/tests/integration/perform-understudy-method.spec.js +61 -0
  935. package/dist/esm/tests/integration/perform-understudy-method.spec.js.map +1 -0
  936. package/dist/esm/tests/integration/setinputfiles.spec.d.ts +1 -0
  937. package/dist/esm/tests/integration/setinputfiles.spec.js +128 -0
  938. package/dist/esm/tests/integration/setinputfiles.spec.js.map +1 -0
  939. package/dist/esm/tests/integration/shadow-iframe-oopif.spec.d.ts +1 -0
  940. package/dist/esm/tests/integration/shadow-iframe-oopif.spec.js +156 -0
  941. package/dist/esm/tests/integration/shadow-iframe-oopif.spec.js.map +1 -0
  942. package/dist/esm/tests/integration/shadow-iframe-spif.spec.d.ts +1 -0
  943. package/dist/esm/tests/integration/shadow-iframe-spif.spec.js +155 -0
  944. package/dist/esm/tests/integration/shadow-iframe-spif.spec.js.map +1 -0
  945. package/dist/esm/tests/integration/testUtils.d.ts +7 -0
  946. package/dist/esm/tests/integration/testUtils.js +40 -0
  947. package/dist/esm/tests/integration/testUtils.js.map +1 -0
  948. package/dist/esm/tests/integration/text-selector-innermost.spec.d.ts +1 -0
  949. package/dist/esm/tests/integration/text-selector-innermost.spec.js +103 -0
  950. package/dist/esm/tests/integration/text-selector-innermost.spec.js.map +1 -0
  951. package/dist/esm/tests/integration/timeouts.spec.d.ts +1 -0
  952. package/dist/esm/tests/integration/timeouts.spec.js +195 -0
  953. package/dist/esm/tests/integration/timeouts.spec.js.map +1 -0
  954. package/dist/esm/tests/integration/user-data-dir.spec.d.ts +1 -0
  955. package/dist/esm/tests/integration/user-data-dir.spec.js +42 -0
  956. package/dist/esm/tests/integration/user-data-dir.spec.js.map +1 -0
  957. package/dist/esm/tests/integration/v3.config.d.ts +4 -0
  958. package/dist/esm/tests/integration/v3.config.js +7 -0
  959. package/dist/esm/tests/integration/v3.config.js.map +1 -0
  960. package/dist/esm/tests/integration/v3.dynamic.config.d.ts +4 -0
  961. package/dist/esm/tests/integration/v3.dynamic.config.js +44 -0
  962. package/dist/esm/tests/integration/v3.dynamic.config.js.map +1 -0
  963. package/dist/esm/tests/integration/v3.playwright.config.d.ts +2 -0
  964. package/dist/esm/tests/integration/v3.playwright.config.js +46 -0
  965. package/dist/esm/tests/integration/v3.playwright.config.js.map +1 -0
  966. package/dist/esm/tests/integration/wait-for-selector.spec.d.ts +1 -0
  967. package/dist/esm/tests/integration/wait-for-selector.spec.js +681 -0
  968. package/dist/esm/tests/integration/wait-for-selector.spec.js.map +1 -0
  969. package/dist/esm/tests/integration/wait-for-timeout.spec.d.ts +1 -0
  970. package/dist/esm/tests/integration/wait-for-timeout.spec.js +116 -0
  971. package/dist/esm/tests/integration/wait-for-timeout.spec.js.map +1 -0
  972. package/dist/esm/tests/integration/xpath-for-location-deep.spec.d.ts +1 -0
  973. package/dist/esm/tests/integration/xpath-for-location-deep.spec.js +85 -0
  974. package/dist/esm/tests/integration/xpath-for-location-deep.spec.js.map +1 -0
  975. package/dist/esm/tests/unit/agent-execution-model.test.d.ts +1 -0
  976. package/dist/esm/tests/unit/agent-execution-model.test.js +126 -0
  977. package/dist/esm/tests/unit/agent-execution-model.test.js.map +1 -0
  978. package/dist/esm/tests/unit/api-multiregion.test.d.ts +1 -0
  979. package/dist/esm/tests/unit/api-multiregion.test.js +56 -0
  980. package/dist/esm/tests/unit/api-multiregion.test.js.map +1 -0
  981. package/dist/esm/tests/unit/browserbase-session-accessors.test.d.ts +1 -0
  982. package/dist/esm/tests/unit/browserbase-session-accessors.test.js +100 -0
  983. package/dist/esm/tests/unit/browserbase-session-accessors.test.js.map +1 -0
  984. package/dist/esm/tests/unit/cache-llm-resolution.test.d.ts +1 -0
  985. package/dist/esm/tests/unit/cache-llm-resolution.test.js +184 -0
  986. package/dist/esm/tests/unit/cache-llm-resolution.test.js.map +1 -0
  987. package/dist/esm/tests/unit/cdp-connection-close.test.d.ts +1 -0
  988. package/dist/esm/tests/unit/cdp-connection-close.test.js +72 -0
  989. package/dist/esm/tests/unit/cdp-connection-close.test.js.map +1 -0
  990. package/dist/esm/tests/unit/context-extra-http-headers.test.d.ts +1 -0
  991. package/dist/esm/tests/unit/context-extra-http-headers.test.js +56 -0
  992. package/dist/esm/tests/unit/context-extra-http-headers.test.js.map +1 -0
  993. package/dist/esm/tests/unit/cookies.test.d.ts +1 -0
  994. package/dist/esm/tests/unit/cookies.test.js +909 -0
  995. package/dist/esm/tests/unit/cookies.test.js.map +1 -0
  996. package/dist/esm/tests/unit/helpers/mockCDPSession.d.ts +19 -0
  997. package/dist/esm/tests/unit/helpers/mockCDPSession.js +25 -0
  998. package/dist/esm/tests/unit/helpers/mockCDPSession.js.map +1 -0
  999. package/dist/esm/tests/unit/llm-provider.test.d.ts +1 -0
  1000. package/dist/esm/tests/unit/llm-provider.test.js +62 -0
  1001. package/dist/esm/tests/unit/llm-provider.test.js.map +1 -0
  1002. package/dist/esm/tests/unit/model-deprecation.test.d.ts +1 -0
  1003. package/dist/esm/tests/unit/model-deprecation.test.js +140 -0
  1004. package/dist/esm/tests/unit/model-deprecation.test.js.map +1 -0
  1005. package/dist/esm/tests/unit/model-utils.test.d.ts +1 -0
  1006. package/dist/esm/tests/unit/model-utils.test.js +40 -0
  1007. package/dist/esm/tests/unit/model-utils.test.js.map +1 -0
  1008. package/dist/esm/tests/unit/page-extra-http-headers.test.d.ts +1 -0
  1009. package/dist/esm/tests/unit/page-extra-http-headers.test.js +90 -0
  1010. package/dist/esm/tests/unit/page-extra-http-headers.test.js.map +1 -0
  1011. package/dist/esm/tests/unit/page-snapshot.test.d.ts +1 -0
  1012. package/dist/esm/tests/unit/page-snapshot.test.js +40 -0
  1013. package/dist/esm/tests/unit/page-snapshot.test.js.map +1 -0
  1014. package/dist/esm/tests/unit/public-api/export-surface.test.d.ts +1 -0
  1015. package/dist/esm/tests/unit/public-api/export-surface.test.js +72 -0
  1016. package/dist/esm/tests/unit/public-api/export-surface.test.js.map +1 -0
  1017. package/dist/esm/tests/unit/public-api/llm-and-agents.test.d.ts +1 -0
  1018. package/dist/esm/tests/unit/public-api/llm-and-agents.test.js +140 -0
  1019. package/dist/esm/tests/unit/public-api/llm-and-agents.test.js.map +1 -0
  1020. package/dist/esm/tests/unit/public-api/public-error-types.test.d.ts +62 -0
  1021. package/dist/esm/tests/unit/public-api/public-error-types.test.js +74 -0
  1022. package/dist/esm/tests/unit/public-api/public-error-types.test.js.map +1 -0
  1023. package/dist/esm/tests/unit/public-api/public-types.test.d.ts +1 -0
  1024. package/dist/esm/tests/unit/public-api/public-types.test.js +97 -0
  1025. package/dist/esm/tests/unit/public-api/public-types.test.js.map +1 -0
  1026. package/dist/esm/tests/unit/public-api/runtime-utils.test.d.ts +1 -0
  1027. package/dist/esm/tests/unit/public-api/runtime-utils.test.js +25 -0
  1028. package/dist/esm/tests/unit/public-api/runtime-utils.test.js.map +1 -0
  1029. package/dist/esm/tests/unit/public-api/schema-utils.test.d.ts +1 -0
  1030. package/dist/esm/tests/unit/public-api/schema-utils.test.js +60 -0
  1031. package/dist/esm/tests/unit/public-api/schema-utils.test.js.map +1 -0
  1032. package/dist/esm/tests/unit/public-api/timeout-error-types.test.d.ts +1 -0
  1033. package/dist/esm/tests/unit/public-api/timeout-error-types.test.js +86 -0
  1034. package/dist/esm/tests/unit/public-api/timeout-error-types.test.js.map +1 -0
  1035. package/dist/esm/tests/unit/public-api/tool-type-export.test.d.ts +1 -0
  1036. package/dist/esm/tests/unit/public-api/tool-type-export.test.js +30 -0
  1037. package/dist/esm/tests/unit/public-api/tool-type-export.test.js.map +1 -0
  1038. package/dist/esm/tests/unit/public-api/v3-core.test.d.ts +1 -0
  1039. package/dist/esm/tests/unit/public-api/v3-core.test.js +73 -0
  1040. package/dist/esm/tests/unit/public-api/v3-core.test.js.map +1 -0
  1041. package/dist/esm/tests/unit/rerender-missing-shadows.test.d.ts +1 -0
  1042. package/dist/esm/tests/unit/rerender-missing-shadows.test.js +207 -0
  1043. package/dist/esm/tests/unit/rerender-missing-shadows.test.js.map +1 -0
  1044. package/dist/esm/tests/unit/safety-confirmation.test.d.ts +1 -0
  1045. package/dist/esm/tests/unit/safety-confirmation.test.js +108 -0
  1046. package/dist/esm/tests/unit/safety-confirmation.test.js.map +1 -0
  1047. package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.d.ts +1 -0
  1048. package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.js +295 -0
  1049. package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.js.map +1 -0
  1050. package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.d.ts +1 -0
  1051. package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.js +284 -0
  1052. package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.js.map +1 -0
  1053. package/dist/esm/tests/unit/snapshot-capture-orchestration.test.d.ts +1 -0
  1054. package/dist/esm/tests/unit/snapshot-capture-orchestration.test.js +359 -0
  1055. package/dist/esm/tests/unit/snapshot-capture-orchestration.test.js.map +1 -0
  1056. package/dist/esm/tests/unit/snapshot-cbor.test.d.ts +1 -0
  1057. package/dist/esm/tests/unit/snapshot-cbor.test.js +202 -0
  1058. package/dist/esm/tests/unit/snapshot-cbor.test.js.map +1 -0
  1059. package/dist/esm/tests/unit/snapshot-dom-session-builders.test.d.ts +1 -0
  1060. package/dist/esm/tests/unit/snapshot-dom-session-builders.test.js +218 -0
  1061. package/dist/esm/tests/unit/snapshot-dom-session-builders.test.js.map +1 -0
  1062. package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.d.ts +1 -0
  1063. package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.js +105 -0
  1064. package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.js.map +1 -0
  1065. package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.d.ts +1 -0
  1066. package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.js +87 -0
  1067. package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.js.map +1 -0
  1068. package/dist/esm/tests/unit/snapshot-frame-merge.test.d.ts +1 -0
  1069. package/dist/esm/tests/unit/snapshot-frame-merge.test.js +333 -0
  1070. package/dist/esm/tests/unit/snapshot-frame-merge.test.js.map +1 -0
  1071. package/dist/esm/tests/unit/snapshot-tree-format-utils.test.d.ts +1 -0
  1072. package/dist/esm/tests/unit/snapshot-tree-format-utils.test.js +82 -0
  1073. package/dist/esm/tests/unit/snapshot-tree-format-utils.test.js.map +1 -0
  1074. package/dist/esm/tests/unit/snapshot-xpath-utils.test.d.ts +1 -0
  1075. package/dist/esm/tests/unit/snapshot-xpath-utils.test.js +72 -0
  1076. package/dist/esm/tests/unit/snapshot-xpath-utils.test.js.map +1 -0
  1077. package/dist/esm/tests/unit/timeout-handlers.test.d.ts +1 -0
  1078. package/dist/esm/tests/unit/timeout-handlers.test.js +812 -0
  1079. package/dist/esm/tests/unit/timeout-handlers.test.js.map +1 -0
  1080. package/dist/esm/tests/unit/understudy-command-exception.test.d.ts +1 -0
  1081. package/dist/esm/tests/unit/understudy-command-exception.test.js +55 -0
  1082. package/dist/esm/tests/unit/understudy-command-exception.test.js.map +1 -0
  1083. package/dist/esm/tests/unit/xpath-parser.test.d.ts +1 -0
  1084. package/dist/esm/tests/unit/xpath-parser.test.js +309 -0
  1085. package/dist/esm/tests/unit/xpath-parser.test.js.map +1 -0
  1086. package/dist/esm/tests/unit/xpath-resolver.test.d.ts +1 -0
  1087. package/dist/esm/tests/unit/xpath-resolver.test.js +78 -0
  1088. package/dist/esm/tests/unit/xpath-resolver.test.js.map +1 -0
  1089. package/dist/esm/tests/unit/zod-enum-compatibility.test.d.ts +1 -0
  1090. package/dist/esm/tests/unit/zod-enum-compatibility.test.js +114 -0
  1091. package/dist/esm/tests/unit/zod-enum-compatibility.test.js.map +1 -0
  1092. package/package.json +19 -8
  1093. package/dist/cjs/cli.js.map +0 -7
  1094. package/dist/cjs/index.js.map +0 -7
  1095. package/dist/cjs/lib/v3/dom/build/rerender-index.d.ts +0 -0
  1096. package/dist/cjs/lib/v3/dom/build/v3-index.d.ts +0 -0
  1097. package/dist/cjs/lib/v3/tests/agent-abort-signal.spec.js +0 -113
  1098. package/dist/cjs/lib/v3/tests/agent-abort-signal.spec.js.map +0 -7
  1099. package/dist/cjs/lib/v3/tests/agent-cache-self-heal.spec.js +0 -102
  1100. package/dist/cjs/lib/v3/tests/agent-cache-self-heal.spec.js.map +0 -7
  1101. package/dist/cjs/lib/v3/tests/agent-callbacks.spec.js +0 -374
  1102. package/dist/cjs/lib/v3/tests/agent-callbacks.spec.js.map +0 -7
  1103. package/dist/cjs/lib/v3/tests/agent-experimental-validation.spec.js +0 -354
  1104. package/dist/cjs/lib/v3/tests/agent-experimental-validation.spec.js.map +0 -7
  1105. package/dist/cjs/lib/v3/tests/agent-hybrid-mode.spec.js +0 -247
  1106. package/dist/cjs/lib/v3/tests/agent-hybrid-mode.spec.js.map +0 -7
  1107. package/dist/cjs/lib/v3/tests/agent-message-continuation.spec.js +0 -105
  1108. package/dist/cjs/lib/v3/tests/agent-message-continuation.spec.js.map +0 -7
  1109. package/dist/cjs/lib/v3/tests/agent-streaming.spec.js +0 -126
  1110. package/dist/cjs/lib/v3/tests/agent-streaming.spec.js.map +0 -7
  1111. package/dist/cjs/lib/v3/tests/cdp-session-detached.spec.js +0 -44
  1112. package/dist/cjs/lib/v3/tests/cdp-session-detached.spec.js.map +0 -7
  1113. package/dist/cjs/lib/v3/tests/click-count.spec.js +0 -147
  1114. package/dist/cjs/lib/v3/tests/click-count.spec.js.map +0 -7
  1115. package/dist/cjs/lib/v3/tests/connect-to-existing-browser.spec.js +0 -54
  1116. package/dist/cjs/lib/v3/tests/connect-to-existing-browser.spec.js.map +0 -7
  1117. package/dist/cjs/lib/v3/tests/context-addInitScript.spec.js +0 -176
  1118. package/dist/cjs/lib/v3/tests/context-addInitScript.spec.js.map +0 -7
  1119. package/dist/cjs/lib/v3/tests/default-page-tracking.spec.js +0 -53
  1120. package/dist/cjs/lib/v3/tests/default-page-tracking.spec.js.map +0 -7
  1121. package/dist/cjs/lib/v3/tests/downloads.spec.js +0 -80
  1122. package/dist/cjs/lib/v3/tests/downloads.spec.js.map +0 -7
  1123. package/dist/cjs/lib/v3/tests/frame-get-location-and-click.spec.js +0 -53
  1124. package/dist/cjs/lib/v3/tests/frame-get-location-and-click.spec.js.map +0 -7
  1125. package/dist/cjs/lib/v3/tests/iframe-ctx-addInitScript.spec.js +0 -493
  1126. package/dist/cjs/lib/v3/tests/iframe-ctx-addInitScript.spec.js.map +0 -7
  1127. package/dist/cjs/lib/v3/tests/keep-alive.child.js +0 -92
  1128. package/dist/cjs/lib/v3/tests/keep-alive.child.js.map +0 -7
  1129. package/dist/cjs/lib/v3/tests/keep-alive.helpers.js +0 -568
  1130. package/dist/cjs/lib/v3/tests/keep-alive.helpers.js.map +0 -7
  1131. package/dist/cjs/lib/v3/tests/keep-alive.spec.js +0 -15
  1132. package/dist/cjs/lib/v3/tests/keep-alive.spec.js.map +0 -7
  1133. package/dist/cjs/lib/v3/tests/keyboard.spec.js +0 -296
  1134. package/dist/cjs/lib/v3/tests/keyboard.spec.js.map +0 -7
  1135. package/dist/cjs/lib/v3/tests/locator-backend-node-id.spec.js +0 -159
  1136. package/dist/cjs/lib/v3/tests/locator-backend-node-id.spec.js.map +0 -7
  1137. package/dist/cjs/lib/v3/tests/locator-content-methods.spec.js +0 -192
  1138. package/dist/cjs/lib/v3/tests/locator-content-methods.spec.js.map +0 -7
  1139. package/dist/cjs/lib/v3/tests/locator-count-iframe.spec.js +0 -108
  1140. package/dist/cjs/lib/v3/tests/locator-count-iframe.spec.js.map +0 -7
  1141. package/dist/cjs/lib/v3/tests/locator-count.spec.js +0 -71
  1142. package/dist/cjs/lib/v3/tests/locator-count.spec.js.map +0 -7
  1143. package/dist/cjs/lib/v3/tests/locator-fill.spec.js +0 -119
  1144. package/dist/cjs/lib/v3/tests/locator-fill.spec.js.map +0 -7
  1145. package/dist/cjs/lib/v3/tests/locator-input-methods.spec.js +0 -137
  1146. package/dist/cjs/lib/v3/tests/locator-input-methods.spec.js.map +0 -7
  1147. package/dist/cjs/lib/v3/tests/locator-nth.spec.js +0 -157
  1148. package/dist/cjs/lib/v3/tests/locator-nth.spec.js.map +0 -7
  1149. package/dist/cjs/lib/v3/tests/locator-select-option.spec.js +0 -243
  1150. package/dist/cjs/lib/v3/tests/locator-select-option.spec.js.map +0 -7
  1151. package/dist/cjs/lib/v3/tests/logger-initialization.spec.js +0 -547
  1152. package/dist/cjs/lib/v3/tests/logger-initialization.spec.js.map +0 -7
  1153. package/dist/cjs/lib/v3/tests/multi-instance-logger.spec.js +0 -269
  1154. package/dist/cjs/lib/v3/tests/multi-instance-logger.spec.js.map +0 -7
  1155. package/dist/cjs/lib/v3/tests/nested-div.spec.js +0 -23
  1156. package/dist/cjs/lib/v3/tests/nested-div.spec.js.map +0 -7
  1157. package/dist/cjs/lib/v3/tests/page-addInitScript.spec.js +0 -90
  1158. package/dist/cjs/lib/v3/tests/page-addInitScript.spec.js.map +0 -7
  1159. package/dist/cjs/lib/v3/tests/page-console.spec.js +0 -56
  1160. package/dist/cjs/lib/v3/tests/page-console.spec.js.map +0 -7
  1161. package/dist/cjs/lib/v3/tests/page-drag-and-drop.spec.js +0 -418
  1162. package/dist/cjs/lib/v3/tests/page-drag-and-drop.spec.js.map +0 -7
  1163. package/dist/cjs/lib/v3/tests/page-goto-response.spec.js +0 -35
  1164. package/dist/cjs/lib/v3/tests/page-goto-response.spec.js.map +0 -7
  1165. package/dist/cjs/lib/v3/tests/page-hover.spec.js +0 -167
  1166. package/dist/cjs/lib/v3/tests/page-hover.spec.js.map +0 -7
  1167. package/dist/cjs/lib/v3/tests/page-screenshot.spec.js +0 -295
  1168. package/dist/cjs/lib/v3/tests/page-screenshot.spec.js.map +0 -7
  1169. package/dist/cjs/lib/v3/tests/page-scroll.spec.js +0 -182
  1170. package/dist/cjs/lib/v3/tests/page-scroll.spec.js.map +0 -7
  1171. package/dist/cjs/lib/v3/tests/page-send-cdp.spec.js +0 -46
  1172. package/dist/cjs/lib/v3/tests/page-send-cdp.spec.js.map +0 -7
  1173. package/dist/cjs/lib/v3/tests/perform-understudy-method.spec.js +0 -98
  1174. package/dist/cjs/lib/v3/tests/perform-understudy-method.spec.js.map +0 -7
  1175. package/dist/cjs/lib/v3/tests/setinputfiles.spec.js +0 -148
  1176. package/dist/cjs/lib/v3/tests/setinputfiles.spec.js.map +0 -7
  1177. package/dist/cjs/lib/v3/tests/shadow-iframe-oopif.spec.js +0 -156
  1178. package/dist/cjs/lib/v3/tests/shadow-iframe-oopif.spec.js.map +0 -7
  1179. package/dist/cjs/lib/v3/tests/shadow-iframe-spif.spec.js +0 -156
  1180. package/dist/cjs/lib/v3/tests/shadow-iframe-spif.spec.js.map +0 -7
  1181. package/dist/cjs/lib/v3/tests/testUtils.js +0 -54
  1182. package/dist/cjs/lib/v3/tests/testUtils.js.map +0 -7
  1183. package/dist/cjs/lib/v3/tests/text-selector-innermost.spec.js +0 -100
  1184. package/dist/cjs/lib/v3/tests/text-selector-innermost.spec.js.map +0 -7
  1185. package/dist/cjs/lib/v3/tests/timeouts.spec.js +0 -32
  1186. package/dist/cjs/lib/v3/tests/timeouts.spec.js.map +0 -7
  1187. package/dist/cjs/lib/v3/tests/user-data-dir.spec.js +0 -65
  1188. package/dist/cjs/lib/v3/tests/user-data-dir.spec.js.map +0 -7
  1189. package/dist/cjs/lib/v3/tests/v3.config.js +0 -36
  1190. package/dist/cjs/lib/v3/tests/v3.config.js.map +0 -7
  1191. package/dist/cjs/lib/v3/tests/v3.dynamic.config.js +0 -67
  1192. package/dist/cjs/lib/v3/tests/v3.dynamic.config.js.map +0 -7
  1193. package/dist/cjs/lib/v3/tests/v3.playwright.config.js +0 -61
  1194. package/dist/cjs/lib/v3/tests/v3.playwright.config.js.map +0 -7
  1195. package/dist/cjs/lib/v3/tests/wait-for-selector.spec.js +0 -593
  1196. package/dist/cjs/lib/v3/tests/wait-for-selector.spec.js.map +0 -7
  1197. package/dist/cjs/lib/v3/tests/wait-for-timeout.spec.js +0 -97
  1198. package/dist/cjs/lib/v3/tests/wait-for-timeout.spec.js.map +0 -7
  1199. package/dist/cjs/lib/v3/tests/xpath-for-location-deep.spec.js +0 -77
  1200. package/dist/cjs/lib/v3/tests/xpath-for-location-deep.spec.js.map +0 -7
  1201. package/dist/cjs/tests/agent-execution-model.test.js +0 -139
  1202. package/dist/cjs/tests/agent-execution-model.test.js.map +0 -7
  1203. package/dist/cjs/tests/api-multiregion.test.js +0 -73
  1204. package/dist/cjs/tests/api-multiregion.test.js.map +0 -7
  1205. package/dist/cjs/tests/browserbase-session-accessors.test.js +0 -101
  1206. package/dist/cjs/tests/browserbase-session-accessors.test.js.map +0 -7
  1207. package/dist/cjs/tests/cache-llm-resolution.test.js +0 -187
  1208. package/dist/cjs/tests/cache-llm-resolution.test.js.map +0 -7
  1209. package/dist/cjs/tests/helpers/mockCDPSession.js +0 -50
  1210. package/dist/cjs/tests/helpers/mockCDPSession.js.map +0 -7
  1211. package/dist/cjs/tests/llm-provider.test.js +0 -57
  1212. package/dist/cjs/tests/llm-provider.test.js.map +0 -7
  1213. package/dist/cjs/tests/model-deprecation.test.js +0 -132
  1214. package/dist/cjs/tests/model-deprecation.test.js.map +0 -7
  1215. package/dist/cjs/tests/model-utils.test.js +0 -43
  1216. package/dist/cjs/tests/model-utils.test.js.map +0 -7
  1217. package/dist/cjs/tests/page-snapshot.test.js +0 -58
  1218. package/dist/cjs/tests/page-snapshot.test.js.map +0 -7
  1219. package/dist/cjs/tests/public-api/export-surface.test.js +0 -77
  1220. package/dist/cjs/tests/public-api/export-surface.test.js.map +0 -7
  1221. package/dist/cjs/tests/public-api/llm-and-agents.test.js +0 -151
  1222. package/dist/cjs/tests/public-api/llm-and-agents.test.js.map +0 -7
  1223. package/dist/cjs/tests/public-api/public-error-types.test.js +0 -106
  1224. package/dist/cjs/tests/public-api/public-error-types.test.js.map +0 -7
  1225. package/dist/cjs/tests/public-api/public-types.test.js +0 -74
  1226. package/dist/cjs/tests/public-api/public-types.test.js.map +0 -7
  1227. package/dist/cjs/tests/public-api/runtime-utils.test.js +0 -53
  1228. package/dist/cjs/tests/public-api/runtime-utils.test.js.map +0 -7
  1229. package/dist/cjs/tests/public-api/schema-utils.test.js +0 -100
  1230. package/dist/cjs/tests/public-api/schema-utils.test.js.map +0 -7
  1231. package/dist/cjs/tests/public-api/timeout-error-types.test.js +0 -103
  1232. package/dist/cjs/tests/public-api/timeout-error-types.test.js.map +0 -7
  1233. package/dist/cjs/tests/public-api/tool-type-export.test.js +0 -47
  1234. package/dist/cjs/tests/public-api/tool-type-export.test.js.map +0 -7
  1235. package/dist/cjs/tests/public-api/v3-core.test.js +0 -105
  1236. package/dist/cjs/tests/public-api/v3-core.test.js.map +0 -7
  1237. package/dist/cjs/tests/safety-confirmation.test.js +0 -134
  1238. package/dist/cjs/tests/safety-confirmation.test.js.map +0 -7
  1239. package/dist/cjs/tests/snapshot-a11y-resolvers.test.js +0 -370
  1240. package/dist/cjs/tests/snapshot-a11y-resolvers.test.js.map +0 -7
  1241. package/dist/cjs/tests/snapshot-a11y-tree-utils.test.js +0 -294
  1242. package/dist/cjs/tests/snapshot-a11y-tree-utils.test.js.map +0 -7
  1243. package/dist/cjs/tests/snapshot-capture-orchestration.test.js +0 -405
  1244. package/dist/cjs/tests/snapshot-capture-orchestration.test.js.map +0 -7
  1245. package/dist/cjs/tests/snapshot-cbor.test.js +0 -197
  1246. package/dist/cjs/tests/snapshot-cbor.test.js.map +0 -7
  1247. package/dist/cjs/tests/snapshot-dom-session-builders.test.js +0 -246
  1248. package/dist/cjs/tests/snapshot-dom-session-builders.test.js.map +0 -7
  1249. package/dist/cjs/tests/snapshot-dom-tree-utils.test.js +0 -104
  1250. package/dist/cjs/tests/snapshot-dom-tree-utils.test.js.map +0 -7
  1251. package/dist/cjs/tests/snapshot-focus-selectors-utils.test.js +0 -45
  1252. package/dist/cjs/tests/snapshot-focus-selectors-utils.test.js.map +0 -7
  1253. package/dist/cjs/tests/snapshot-frame-merge.test.js +0 -388
  1254. package/dist/cjs/tests/snapshot-frame-merge.test.js.map +0 -7
  1255. package/dist/cjs/tests/snapshot-tree-format-utils.test.js +0 -106
  1256. package/dist/cjs/tests/snapshot-tree-format-utils.test.js.map +0 -7
  1257. package/dist/cjs/tests/snapshot-xpath-utils.test.js +0 -74
  1258. package/dist/cjs/tests/snapshot-xpath-utils.test.js.map +0 -7
  1259. package/dist/cjs/tests/timeout-handlers.test.js +0 -864
  1260. package/dist/cjs/tests/timeout-handlers.test.js.map +0 -7
  1261. package/dist/cjs/tests/understudy-command-exception.test.js +0 -52
  1262. package/dist/cjs/tests/understudy-command-exception.test.js.map +0 -7
  1263. package/dist/cjs/tests/xpath-parser.test.js +0 -314
  1264. package/dist/cjs/tests/xpath-parser.test.js.map +0 -7
  1265. package/dist/cjs/tests/xpath-resolver.test.js +0 -70
  1266. package/dist/cjs/tests/xpath-resolver.test.js.map +0 -7
  1267. package/dist/cjs/tests/zod-enum-compatibility.test.js +0 -119
  1268. package/dist/cjs/tests/zod-enum-compatibility.test.js.map +0 -7
  1269. package/dist/esm/lib/v3/dom/build/rerender-index.d.ts +0 -0
  1270. package/dist/esm/lib/v3/dom/build/rerender-index.js.map +0 -1
  1271. package/dist/esm/lib/v3/dom/build/v3-index.d.ts +0 -0
  1272. package/dist/esm/lib/v3/dom/build/v3-index.js.map +0 -1
  1273. package/dist/esm/lib/v3/dom/genA11yScripts.js +0 -54
  1274. package/dist/esm/lib/v3/dom/genA11yScripts.js.map +0 -1
  1275. package/dist/esm/lib/v3/dom/genDomScripts.js +0 -38
  1276. package/dist/esm/lib/v3/dom/genDomScripts.js.map +0 -1
  1277. package/dist/esm/lib/v3/dom/genLocatorScripts.js +0 -51
  1278. package/dist/esm/lib/v3/dom/genLocatorScripts.js.map +0 -1
  1279. package/dist/esm/lib/v3/dom/genScreenshotScripts.js +0 -37
  1280. package/dist/esm/lib/v3/dom/genScreenshotScripts.js.map +0 -1
  1281. package/dist/esm/lib/v3/tests/agent-abort-signal.spec.js +0 -113
  1282. package/dist/esm/lib/v3/tests/agent-abort-signal.spec.js.map +0 -7
  1283. package/dist/esm/lib/v3/tests/agent-cache-self-heal.spec.js +0 -80
  1284. package/dist/esm/lib/v3/tests/agent-cache-self-heal.spec.js.map +0 -7
  1285. package/dist/esm/lib/v3/tests/agent-callbacks.spec.js +0 -374
  1286. package/dist/esm/lib/v3/tests/agent-callbacks.spec.js.map +0 -7
  1287. package/dist/esm/lib/v3/tests/agent-experimental-validation.spec.js +0 -357
  1288. package/dist/esm/lib/v3/tests/agent-experimental-validation.spec.js.map +0 -7
  1289. package/dist/esm/lib/v3/tests/agent-hybrid-mode.spec.js +0 -247
  1290. package/dist/esm/lib/v3/tests/agent-hybrid-mode.spec.js.map +0 -7
  1291. package/dist/esm/lib/v3/tests/agent-message-continuation.spec.js +0 -105
  1292. package/dist/esm/lib/v3/tests/agent-message-continuation.spec.js.map +0 -7
  1293. package/dist/esm/lib/v3/tests/agent-streaming.spec.js +0 -126
  1294. package/dist/esm/lib/v3/tests/agent-streaming.spec.js.map +0 -7
  1295. package/dist/esm/lib/v3/tests/cdp-session-detached.spec.js +0 -44
  1296. package/dist/esm/lib/v3/tests/cdp-session-detached.spec.js.map +0 -7
  1297. package/dist/esm/lib/v3/tests/click-count.spec.js +0 -147
  1298. package/dist/esm/lib/v3/tests/click-count.spec.js.map +0 -7
  1299. package/dist/esm/lib/v3/tests/connect-to-existing-browser.spec.js +0 -54
  1300. package/dist/esm/lib/v3/tests/connect-to-existing-browser.spec.js.map +0 -7
  1301. package/dist/esm/lib/v3/tests/context-addInitScript.spec.js +0 -176
  1302. package/dist/esm/lib/v3/tests/context-addInitScript.spec.js.map +0 -7
  1303. package/dist/esm/lib/v3/tests/default-page-tracking.spec.js +0 -53
  1304. package/dist/esm/lib/v3/tests/default-page-tracking.spec.js.map +0 -7
  1305. package/dist/esm/lib/v3/tests/downloads.spec.js +0 -58
  1306. package/dist/esm/lib/v3/tests/downloads.spec.js.map +0 -7
  1307. package/dist/esm/lib/v3/tests/frame-get-location-and-click.spec.js +0 -53
  1308. package/dist/esm/lib/v3/tests/frame-get-location-and-click.spec.js.map +0 -7
  1309. package/dist/esm/lib/v3/tests/iframe-ctx-addInitScript.spec.js +0 -493
  1310. package/dist/esm/lib/v3/tests/iframe-ctx-addInitScript.spec.js.map +0 -7
  1311. package/dist/esm/lib/v3/tests/keep-alive.child.js +0 -92
  1312. package/dist/esm/lib/v3/tests/keep-alive.child.js.map +0 -7
  1313. package/dist/esm/lib/v3/tests/keep-alive.helpers.js +0 -532
  1314. package/dist/esm/lib/v3/tests/keep-alive.helpers.js.map +0 -7
  1315. package/dist/esm/lib/v3/tests/keep-alive.spec.js +0 -19
  1316. package/dist/esm/lib/v3/tests/keep-alive.spec.js.map +0 -7
  1317. package/dist/esm/lib/v3/tests/keyboard.spec.js +0 -296
  1318. package/dist/esm/lib/v3/tests/keyboard.spec.js.map +0 -7
  1319. package/dist/esm/lib/v3/tests/locator-backend-node-id.spec.js +0 -159
  1320. package/dist/esm/lib/v3/tests/locator-backend-node-id.spec.js.map +0 -7
  1321. package/dist/esm/lib/v3/tests/locator-content-methods.spec.js +0 -192
  1322. package/dist/esm/lib/v3/tests/locator-content-methods.spec.js.map +0 -7
  1323. package/dist/esm/lib/v3/tests/locator-count-iframe.spec.js +0 -108
  1324. package/dist/esm/lib/v3/tests/locator-count-iframe.spec.js.map +0 -7
  1325. package/dist/esm/lib/v3/tests/locator-count.spec.js +0 -71
  1326. package/dist/esm/lib/v3/tests/locator-count.spec.js.map +0 -7
  1327. package/dist/esm/lib/v3/tests/locator-fill.spec.js +0 -119
  1328. package/dist/esm/lib/v3/tests/locator-fill.spec.js.map +0 -7
  1329. package/dist/esm/lib/v3/tests/locator-input-methods.spec.js +0 -137
  1330. package/dist/esm/lib/v3/tests/locator-input-methods.spec.js.map +0 -7
  1331. package/dist/esm/lib/v3/tests/locator-nth.spec.js +0 -157
  1332. package/dist/esm/lib/v3/tests/locator-nth.spec.js.map +0 -7
  1333. package/dist/esm/lib/v3/tests/locator-select-option.spec.js +0 -243
  1334. package/dist/esm/lib/v3/tests/locator-select-option.spec.js.map +0 -7
  1335. package/dist/esm/lib/v3/tests/logger-initialization.spec.js +0 -552
  1336. package/dist/esm/lib/v3/tests/logger-initialization.spec.js.map +0 -7
  1337. package/dist/esm/lib/v3/tests/multi-instance-logger.spec.js +0 -269
  1338. package/dist/esm/lib/v3/tests/multi-instance-logger.spec.js.map +0 -7
  1339. package/dist/esm/lib/v3/tests/nested-div.spec.js +0 -23
  1340. package/dist/esm/lib/v3/tests/nested-div.spec.js.map +0 -7
  1341. package/dist/esm/lib/v3/tests/page-addInitScript.spec.js +0 -90
  1342. package/dist/esm/lib/v3/tests/page-addInitScript.spec.js.map +0 -7
  1343. package/dist/esm/lib/v3/tests/page-console.spec.js +0 -56
  1344. package/dist/esm/lib/v3/tests/page-console.spec.js.map +0 -7
  1345. package/dist/esm/lib/v3/tests/page-drag-and-drop.spec.js +0 -418
  1346. package/dist/esm/lib/v3/tests/page-drag-and-drop.spec.js.map +0 -7
  1347. package/dist/esm/lib/v3/tests/page-goto-response.spec.js +0 -35
  1348. package/dist/esm/lib/v3/tests/page-goto-response.spec.js.map +0 -7
  1349. package/dist/esm/lib/v3/tests/page-hover.spec.js +0 -167
  1350. package/dist/esm/lib/v3/tests/page-hover.spec.js.map +0 -7
  1351. package/dist/esm/lib/v3/tests/page-screenshot.spec.js +0 -273
  1352. package/dist/esm/lib/v3/tests/page-screenshot.spec.js.map +0 -7
  1353. package/dist/esm/lib/v3/tests/page-scroll.spec.js +0 -182
  1354. package/dist/esm/lib/v3/tests/page-scroll.spec.js.map +0 -7
  1355. package/dist/esm/lib/v3/tests/page-send-cdp.spec.js +0 -46
  1356. package/dist/esm/lib/v3/tests/page-send-cdp.spec.js.map +0 -7
  1357. package/dist/esm/lib/v3/tests/perform-understudy-method.spec.js +0 -98
  1358. package/dist/esm/lib/v3/tests/perform-understudy-method.spec.js.map +0 -7
  1359. package/dist/esm/lib/v3/tests/setinputfiles.spec.js +0 -126
  1360. package/dist/esm/lib/v3/tests/setinputfiles.spec.js.map +0 -7
  1361. package/dist/esm/lib/v3/tests/shadow-iframe-oopif.spec.js +0 -134
  1362. package/dist/esm/lib/v3/tests/shadow-iframe-oopif.spec.js.map +0 -7
  1363. package/dist/esm/lib/v3/tests/shadow-iframe-spif.spec.js +0 -134
  1364. package/dist/esm/lib/v3/tests/shadow-iframe-spif.spec.js.map +0 -7
  1365. package/dist/esm/lib/v3/tests/testUtils.js +0 -31
  1366. package/dist/esm/lib/v3/tests/testUtils.js.map +0 -7
  1367. package/dist/esm/lib/v3/tests/text-selector-innermost.spec.js +0 -100
  1368. package/dist/esm/lib/v3/tests/text-selector-innermost.spec.js.map +0 -7
  1369. package/dist/esm/lib/v3/tests/timeouts.spec.js +0 -32
  1370. package/dist/esm/lib/v3/tests/timeouts.spec.js.map +0 -7
  1371. package/dist/esm/lib/v3/tests/user-data-dir.spec.js +0 -43
  1372. package/dist/esm/lib/v3/tests/user-data-dir.spec.js.map +0 -7
  1373. package/dist/esm/lib/v3/tests/v3.config.js +0 -15
  1374. package/dist/esm/lib/v3/tests/v3.config.js.map +0 -7
  1375. package/dist/esm/lib/v3/tests/v3.dynamic.config.js +0 -43
  1376. package/dist/esm/lib/v3/tests/v3.dynamic.config.js.map +0 -7
  1377. package/dist/esm/lib/v3/tests/v3.playwright.config.js +0 -41
  1378. package/dist/esm/lib/v3/tests/v3.playwright.config.js.map +0 -7
  1379. package/dist/esm/lib/v3/tests/wait-for-selector.spec.js +0 -593
  1380. package/dist/esm/lib/v3/tests/wait-for-selector.spec.js.map +0 -7
  1381. package/dist/esm/lib/v3/tests/wait-for-timeout.spec.js +0 -97
  1382. package/dist/esm/lib/v3/tests/wait-for-timeout.spec.js.map +0 -7
  1383. package/dist/esm/lib/v3/tests/xpath-for-location-deep.spec.js +0 -77
  1384. package/dist/esm/lib/v3/tests/xpath-for-location-deep.spec.js.map +0 -7
  1385. package/dist/esm/tests/agent-execution-model.test.js +0 -139
  1386. package/dist/esm/tests/agent-execution-model.test.js.map +0 -7
  1387. package/dist/esm/tests/api-multiregion.test.js +0 -73
  1388. package/dist/esm/tests/api-multiregion.test.js.map +0 -7
  1389. package/dist/esm/tests/browserbase-session-accessors.test.js +0 -101
  1390. package/dist/esm/tests/browserbase-session-accessors.test.js.map +0 -7
  1391. package/dist/esm/tests/cache-llm-resolution.test.js +0 -187
  1392. package/dist/esm/tests/cache-llm-resolution.test.js.map +0 -7
  1393. package/dist/esm/tests/helpers/mockCDPSession.js +0 -27
  1394. package/dist/esm/tests/helpers/mockCDPSession.js.map +0 -7
  1395. package/dist/esm/tests/llm-provider.test.js +0 -57
  1396. package/dist/esm/tests/llm-provider.test.js.map +0 -7
  1397. package/dist/esm/tests/model-deprecation.test.js +0 -135
  1398. package/dist/esm/tests/model-deprecation.test.js.map +0 -7
  1399. package/dist/esm/tests/model-utils.test.js +0 -43
  1400. package/dist/esm/tests/model-utils.test.js.map +0 -7
  1401. package/dist/esm/tests/page-snapshot.test.js +0 -36
  1402. package/dist/esm/tests/page-snapshot.test.js.map +0 -7
  1403. package/dist/esm/tests/public-api/export-surface.test.js +0 -55
  1404. package/dist/esm/tests/public-api/export-surface.test.js.map +0 -7
  1405. package/dist/esm/tests/public-api/llm-and-agents.test.js +0 -129
  1406. package/dist/esm/tests/public-api/llm-and-agents.test.js.map +0 -7
  1407. package/dist/esm/tests/public-api/public-error-types.test.js +0 -73
  1408. package/dist/esm/tests/public-api/public-error-types.test.js.map +0 -7
  1409. package/dist/esm/tests/public-api/public-types.test.js +0 -74
  1410. package/dist/esm/tests/public-api/public-types.test.js.map +0 -7
  1411. package/dist/esm/tests/public-api/runtime-utils.test.js +0 -31
  1412. package/dist/esm/tests/public-api/runtime-utils.test.js.map +0 -7
  1413. package/dist/esm/tests/public-api/schema-utils.test.js +0 -78
  1414. package/dist/esm/tests/public-api/schema-utils.test.js.map +0 -7
  1415. package/dist/esm/tests/public-api/timeout-error-types.test.js +0 -81
  1416. package/dist/esm/tests/public-api/timeout-error-types.test.js.map +0 -7
  1417. package/dist/esm/tests/public-api/tool-type-export.test.js +0 -25
  1418. package/dist/esm/tests/public-api/tool-type-export.test.js.map +0 -7
  1419. package/dist/esm/tests/public-api/v3-core.test.js +0 -83
  1420. package/dist/esm/tests/public-api/v3-core.test.js.map +0 -7
  1421. package/dist/esm/tests/safety-confirmation.test.js +0 -134
  1422. package/dist/esm/tests/safety-confirmation.test.js.map +0 -7
  1423. package/dist/esm/tests/snapshot-a11y-resolvers.test.js +0 -348
  1424. package/dist/esm/tests/snapshot-a11y-resolvers.test.js.map +0 -7
  1425. package/dist/esm/tests/snapshot-a11y-tree-utils.test.js +0 -300
  1426. package/dist/esm/tests/snapshot-a11y-tree-utils.test.js.map +0 -7
  1427. package/dist/esm/tests/snapshot-capture-orchestration.test.js +0 -383
  1428. package/dist/esm/tests/snapshot-capture-orchestration.test.js.map +0 -7
  1429. package/dist/esm/tests/snapshot-cbor.test.js +0 -197
  1430. package/dist/esm/tests/snapshot-cbor.test.js.map +0 -7
  1431. package/dist/esm/tests/snapshot-dom-session-builders.test.js +0 -251
  1432. package/dist/esm/tests/snapshot-dom-session-builders.test.js.map +0 -7
  1433. package/dist/esm/tests/snapshot-dom-tree-utils.test.js +0 -109
  1434. package/dist/esm/tests/snapshot-dom-tree-utils.test.js.map +0 -7
  1435. package/dist/esm/tests/snapshot-focus-selectors-utils.test.js +0 -49
  1436. package/dist/esm/tests/snapshot-focus-selectors-utils.test.js.map +0 -7
  1437. package/dist/esm/tests/snapshot-frame-merge.test.js +0 -391
  1438. package/dist/esm/tests/snapshot-frame-merge.test.js.map +0 -7
  1439. package/dist/esm/tests/snapshot-tree-format-utils.test.js +0 -113
  1440. package/dist/esm/tests/snapshot-tree-format-utils.test.js.map +0 -7
  1441. package/dist/esm/tests/snapshot-xpath-utils.test.js +0 -79
  1442. package/dist/esm/tests/snapshot-xpath-utils.test.js.map +0 -7
  1443. package/dist/esm/tests/timeout-handlers.test.js +0 -850
  1444. package/dist/esm/tests/timeout-handlers.test.js.map +0 -7
  1445. package/dist/esm/tests/understudy-command-exception.test.js +0 -55
  1446. package/dist/esm/tests/understudy-command-exception.test.js.map +0 -7
  1447. package/dist/esm/tests/xpath-parser.test.js +0 -317
  1448. package/dist/esm/tests/xpath-parser.test.js.map +0 -7
  1449. package/dist/esm/tests/xpath-resolver.test.js +0 -73
  1450. package/dist/esm/tests/xpath-resolver.test.js.map +0 -7
  1451. package/dist/esm/tests/zod-enum-compatibility.test.js +0 -97
  1452. package/dist/esm/tests/zod-enum-compatibility.test.js.map +0 -7
  1453. /package/dist/cjs/{lib/v3/dom/genA11yScripts.d.ts → tests/cache-variables.test.d.ts} +0 -0
  1454. /package/dist/cjs/{lib/v3/dom/genDomScripts.d.ts → tests/integration/agent-abort-signal.spec.d.ts} +0 -0
  1455. /package/dist/cjs/{lib/v3/dom/genLocatorScripts.d.ts → tests/integration/agent-cache-self-heal.spec.d.ts} +0 -0
  1456. /package/dist/cjs/{lib/v3/dom/genScreenshotScripts.d.ts → tests/integration/agent-callbacks.spec.d.ts} +0 -0
  1457. /package/dist/{esm/lib/v3/dom/genA11yScripts.d.ts → cjs/tests/integration/agent-experimental-validation.spec.d.ts} +0 -0
  1458. /package/dist/{esm/lib/v3/dom/genDomScripts.d.ts → cjs/tests/integration/agent-hybrid-mode.spec.d.ts} +0 -0
  1459. /package/dist/{esm/lib/v3/dom/genLocatorScripts.d.ts → cjs/tests/integration/agent-message-continuation.spec.d.ts} +0 -0
  1460. /package/dist/{esm/lib/v3/dom/genScreenshotScripts.d.ts → cjs/tests/integration/agent-streaming.spec.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"MicrosoftCUAClient.js","sourceRoot":"","sources":["../../../../../lib/v3/agent/MicrosoftCUAClient.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAS5B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AA+B9D;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACzC,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,eAAe,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC/C,UAAU,CAAU;IACpB,kBAAkB,CAAyB;IAC3C,aAAa,CAA0C;IAE/D,sBAAsB;IACd,mBAAmB,GAAkB,EAAE,CAAC,CAAC,kBAAkB;IAC3D,aAAa,GAAkB,EAAE,CAAC,CAAC,sBAAsB;IAEzD,SAAS,GAAW,CAAC,CAAC;IACtB,WAAW,GAAW,CAAC,CAAC;IACxB,KAAK,GAAa,EAAE,CAAC;IAE7B,qCAAqC;IACpB,oBAAoB,GAAG;QACtC,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,QAAQ;QACpB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,CAAC;KACd,CAAC;IAEF,qCAAqC;IAC7B,eAAe,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAEvD,YACE,IAAe,EACf,SAAiB,EACjB,wBAAiC,EACjC,aAA6B;QAE7B,KAAK,CAAC,I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AAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YAED,yBAAyB;YACzB,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAC/C,YAAY;oBACT,UAAkC,EAAE,MAAM,KAAK,SAAS;wBACvD,CAAC,CAAC,8BAA8B;wBAChC,CAAC,CAAC,+BAA+B,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACN,YAAY,GAAG,0BAA0B,QAAQ,uBAAuB,CAAC;YAC3E,CAAC;YAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,YAAY,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,YAAY,EAAE,CAAC;YAClE,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,SAAS;gBAClB,SAAS;gBACT,OAAO,EAAE,YAAY;gBACrB,OAAO;gBACP,KAAK,EAAE;oBACL,YAAY,EAAE,gBAAgB;oBAC9B,aAAa,EAAE,iBAAiB;oBAChC,iBAAiB,EAAE,kBAAkB;iBACtC;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC;gBACL,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,2BAA2B,KAAK,EAAE;gBAC3C,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YAEH,wEAAwE;YACxE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF","sourcesContent":["import OpenAI from \"openai\";\nimport { LogLine } from \"../types/public/logs.js\";\nimport {\n AgentAction,\n AgentResult,\n AgentType,\n AgentExecutionOptions,\n} from \"../types/public/agent.js\";\nimport { ClientOptions } from \"../types/public/model.js\";\nimport { AgentClient } from \"./AgentClient.js\";\nimport { AgentScreenshotProviderError } from \"../types/public/sdkErrors.js\";\nimport { mapKeyToPlaywright } from \"./utils/cuaKeyMapping.js\";\nimport { ChatCompletionMessageParam } from \"openai/resources/chat/completions\";\n\n/**\n * Message types for FARA agent\n */\ninterface FaraMessage {\n role: \"system\" | \"user\" | \"assistant\";\n content: string | FaraMessageContent[];\n}\n\ninterface FaraMessageContent {\n type: \"text\" | \"image_url\";\n text?: string;\n image_url?: {\n url: string; // data:image/png;base64,...\n };\n}\n\n/**\n * FARA function call structure (parsed from XML tags)\n */\ninterface FaraFunctionCall {\n name: string; // Always \"computer_use\"\n arguments: {\n action: string;\n thoughts?: string;\n [key: string]: unknown;\n };\n}\n\n/**\n * Client for FARA (Function-based Autonomous Research Agent) by Microsoft\n * This implementation uses OpenAI-compatible API with XML-based tool calling\n */\nexport class MicrosoftCUAClient extends AgentClient {\n private apiKey: string;\n private baseURL: string;\n private client: OpenAI;\n private currentViewport = { width: 1288, height: 711 };\n private currentUrl?: string;\n private screenshotProvider?: () => Promise<string>;\n private actionHandler?: (action: AgentAction) => Promise<void>;\n\n // Dual history system\n private conversationHistory: FaraMessage[] = []; // Conceptual flow\n private actionHistory: FaraMessage[] = []; // Raw model responses\n\n private maxImages: number = 3;\n private temperature: number = 0;\n private facts: string[] = [];\n\n // FARA-specific MLM processor config\n private readonly MLM_PROCESSOR_IM_CFG = {\n min_pixels: 3136,\n max_pixels: 12845056,\n patch_size: 14,\n merge_size: 2,\n };\n\n // Resized dimensions for model input\n private resizedViewport = { width: 1288, height: 711 };\n\n constructor(\n type: AgentType,\n modelName: string,\n userProvidedInstructions?: string,\n clientOptions?: ClientOptions,\n ) {\n super(type, modelName || \"fara-7b\", userProvidedInstructions);\n\n // Process client options\n this.apiKey =\n (clientOptions?.apiKey as string) ||\n process.env.AZURE_API_KEY ||\n process.env.FIREWORKS_API_KEY ||\n \"\";\n this.baseURL =\n (clientOptions?.baseURL as string) ||\n process.env.AZURE_ENDPOINT ||\n process.env.FIREWORKS_ENDPOINT ||\n \"\";\n\n // Store client options for reference\n this.clientOptions = {\n apiKey: this.apiKey,\n baseURL: this.baseURL,\n };\n\n // Validate API key\n if (!this.apiKey || this.apiKey === \"\") {\n throw new Error(\n \"API key is required. Please provide it via clientOptions.apiKey or AZURE_API_KEY or FIREWORKS_API_KEY environment variables.\",\n );\n }\n\n // Initialize the OpenAI client (FARA uses OpenAI-compatible API)\n this.client = new OpenAI({\n apiKey: this.apiKey,\n baseURL: this.baseURL,\n });\n\n // Max images to keep in history\n if (clientOptions?.maxImages !== undefined) {\n this.maxImages = clientOptions.maxImages as number;\n }\n\n // Temperature\n if (clientOptions?.temperature !== undefined) {\n this.temperature = clientOptions.temperature as number;\n }\n }\n\n setViewport(width: number, height: number): void {\n this.currentViewport = { width, height };\n // Compute resized viewport using smart_resize logic\n this.resizedViewport = this.smartResize(width, height);\n }\n\n setCurrentUrl(url: string): void {\n this.currentUrl = url;\n }\n\n setScreenshotProvider(provider: () => Promise<string>): void {\n this.screenshotProvider = provider;\n }\n\n setActionHandler(handler: (action: AgentAction) => Promise<void>): void {\n this.actionHandler = handler;\n }\n\n /**\n * Smart resize algorithm from FARA\n * Ensures dimensions are divisible by factor and within pixel limits\n */\n private smartResize(\n width: number,\n height: number,\n ): { width: number; height: number } {\n const { patch_size, merge_size, min_pixels, max_pixels } =\n this.MLM_PROCESSOR_IM_CFG;\n const factor = patch_size * merge_size;\n\n const roundByFactor = (num: number, f: number) => Math.round(num / f) * f;\n const ceilByFactor = (num: number, f: number) => Math.ceil(num / f) * f;\n const floorByFactor = (num: number, f: number) => Math.floor(num / f) * f;\n\n let h_bar = Math.max(factor, roundByFactor(height, factor));\n let w_bar = Math.max(factor, roundByFactor(width, factor));\n\n if (h_bar * w_bar > max_pixels) {\n const beta = Math.sqrt((height * width) / max_pixels);\n h_bar = floorByFactor(height / beta, factor);\n w_bar = floorByFactor(width / beta, factor);\n } else if (h_bar * w_bar < min_pixels) {\n const beta = Math.sqrt(min_pixels / (height * width));\n h_bar = ceilByFactor(height * beta, factor);\n w_bar = ceilByFactor(width * beta, factor);\n }\n\n return { width: w_bar, height: h_bar };\n }\n\n /**\n * Generate system prompt with tool description\n * Simplified to match Python's minimal approach\n */\n private generateSystemPrompt(): string {\n const { width, height } = this.resizedViewport;\n\n // Base prompt - Minimalist like Python\n let basePrompt = \"You are a helpful assistant.\";\n\n // Add user-provided instructions if available\n if (this.userProvidedInstructions) {\n basePrompt = `${basePrompt}\\n\\n${this.userProvidedInstructions}`;\n }\n\n // Tool description from FaraComputerUse\n const toolDescription = `Use a mouse and keyboard to interact with a computer, and take screenshots.\n* This is an interface to a desktop GUI. You do not have access to a terminal or applications menu. You must click on desktop icons to start applications.\n* Some applications may take time to start or process actions, so you may need to wait and take successive screenshots to see the results of your actions. E.g. if you click on Firefox and a window doesn't open, try wait and taking another screenshot.\n* The screen's resolution is ${width}x${height}.\n* Whenever you intend to move the cursor to click on an element like an icon, you should consult a screenshot to determine the coordinates of the element before moving the cursor.\n* If you tried clicking on a program or link but it failed to load, even after waiting, try adjusting your cursor position so that the tip of the cursor visually falls on the element that you want to click.\n* Make sure to click any buttons, links, icons, etc with the cursor tip in the center of the element. Don't click boxes on their edges unless asked.\n* When a separate scrollable container prominently overlays the webpage, if you want to scroll within it, you typically need to mouse_move() over it first and then scroll().\n* If a popup window appears that you want to close, if left_click() on the 'X' or close button doesn't work, try key(keys=['Escape']) to close it.\n* On some search bars, when you type(), you may need to press_enter=False and instead separately call left_click() on the search button to submit the search query. This is especially true of search bars that have auto-suggest popups for e.g. locations\n* For calendar widgets, you usually need to left_click() on arrows to move between months and left_click() on dates to select them; type() is not typically used to input dates there.`;\n\n // Tool parameters description\n const actionsDescription = `The action to perform. The available actions are:\n* \\`key\\`: Performs key down presses on the arguments passed in order, then performs key releases in reverse order. Includes \"Enter\", \"Alt\", \"Shift\", \"Tab\", \"Control\", \"Backspace\", \"Delete\", \"Escape\", \"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \"PageDown\", \"PageUp\", \"Shift\", etc.\n* \\`type\\`: Type a string of text on the keyboard.\n* \\`mouse_move\\`: Move the cursor to a specified (x, y) pixel coordinate on the screen.\n* \\`left_click\\`: Click the left mouse button.\n* \\`scroll\\`: Performs a scroll of the mouse scroll wheel.\n* \\`history_back\\`: Go back to the previous page in the browser history.\n* \\`pause_and_memorize_fact\\`: Pause and memorize a fact for future reference.\n* \\`visit_url\\`: Visit a specified URL.\n* \\`web_search\\`: Perform a web search with a specified query.\n* \\`wait\\`: Wait specified seconds for the change to happen.\n* \\`terminate\\`: Terminate the current task and report its completion status.`;\n\n // Tool JSON schema\n const toolSchema = {\n name: \"computer_use\",\n description: toolDescription,\n parameters: {\n type: \"object\",\n required: [\"action\"],\n properties: {\n action: {\n type: \"string\",\n description: actionsDescription,\n enum: [\n \"key\",\n \"type\",\n \"mouse_move\",\n \"left_click\",\n \"scroll\",\n \"visit_url\",\n \"web_search\",\n \"history_back\",\n \"pause_and_memorize_fact\",\n \"wait\",\n \"terminate\",\n ],\n },\n keys: {\n type: \"array\",\n description: \"Required only by `action=key`.\",\n },\n text: {\n type: \"string\",\n description: \"Required only by `action=type`.\",\n },\n press_enter: {\n type: \"boolean\",\n description:\n \"Whether to press the Enter key after typing. Required only by `action=type`.\",\n },\n delete_existing_text: {\n type: \"boolean\",\n description:\n \"Whether to delete existing text before typing. Required only by `action=type`.\",\n },\n coordinate: {\n type: \"array\",\n description:\n \"(x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=left_click`, `action=mouse_move`, and `action=type`.\",\n },\n pixels: {\n type: \"number\",\n description:\n \"The amount of scrolling to perform. Positive values scroll up, negative values scroll down. Required only by `action=scroll`.\",\n },\n fact: {\n type: \"string\",\n description:\n \"The fact to remember for the future. Required only by `action=pause_and_memorize_fact`.\",\n },\n time: {\n type: \"number\",\n description: \"The seconds to wait. Required only by `action=wait`.\",\n },\n status: {\n type: \"string\",\n description:\n \"The status of the task. Required only by `action=terminate`.\",\n enum: [\"success\", \"failure\"],\n },\n },\n },\n };\n\n // Format as FARA function calling template (FN_CALL_TEMPLATE format)\n const toolDescs = JSON.stringify(toolSchema, null, 2);\n const functionCallTemplate = `\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>\n${toolDescs}\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{{\"name\": <function-name>, \"arguments\": <args-json-object>}}\n</tool_call>`;\n\n return `${basePrompt}\\n\\n${functionCallTemplate}`;\n }\n\n /**\n * Parse thoughts and action from model response\n * FARA uses XML-based tool calling: <tool_call>\\n{...}\\n</tool_call>\n */\n private parseThoughtsAndAction(response: string): {\n thoughts: string;\n functionCall: FaraFunctionCall;\n } {\n try {\n const parts = response.split(\"<tool_call>\\n\");\n const thoughts = parts[0].trim();\n const actionText = parts[1].split(\"\\n</tool_call>\")[0].trim();\n\n let parsedAction;\n try {\n parsedAction = JSON.parse(actionText);\n } catch (jsonError) {\n // Fix common malformed JSON: double opening brackets {{\"name\": ...}}\n // This happens when the model adds an extra opening brace\n if (actionText.startsWith(\"{{\") && actionText.endsWith(\"}\")) {\n // Remove the extra opening brace\n const fixedText = actionText.slice(1);\n try {\n parsedAction = JSON.parse(fixedText);\n } catch (retryError) {\n throw new Error(\n `Failed to parse action text even after fixing double brackets. Original: ${actionText}. Fixed: ${fixedText}. Error: ${retryError}`,\n );\n }\n } else {\n throw new Error(\n `Failed to parse action text as JSON: ${actionText}. Error: ${jsonError}`,\n );\n }\n }\n\n return {\n thoughts,\n functionCall: {\n name: parsedAction.name || \"computer_use\",\n arguments: {\n ...parsedAction.arguments,\n thoughts,\n },\n },\n };\n } catch (error) {\n throw new Error(\n `Failed to parse FARA tool call from response: ${response}. Error: ${error}`,\n );\n }\n }\n\n /**\n * Convert FARA function call to Stagehand AgentAction\n */\n private convertFunctionCallToAction(\n functionCall: FaraFunctionCall,\n ): AgentAction {\n const args = functionCall.arguments;\n const action = args.action as string;\n\n // Transform coordinates from resized to original viewport\n const transformCoordinate = (coord: number[]): number[] => {\n if (!coord || coord.length !== 2) return coord;\n const [x, y] = coord;\n const scaleX = this.currentViewport.width / this.resizedViewport.width;\n const scaleY = this.currentViewport.height / this.resizedViewport.height;\n return [Math.round(x * scaleX), Math.round(y * scaleY)];\n };\n\n const baseAction = {\n type: action,\n reasoning: args.thoughts as string,\n };\n\n switch (action) {\n case \"left_click\": {\n const clickCoord = transformCoordinate(args.coordinate as number[]);\n return {\n ...baseAction,\n type: \"click\",\n x: clickCoord[0],\n y: clickCoord[1],\n button: \"left\" as const,\n };\n }\n\n case \"mouse_move\": {\n const moveCoord = transformCoordinate(args.coordinate as number[]);\n return {\n ...baseAction,\n type: \"move\",\n coordinate: moveCoord,\n };\n }\n\n case \"type\": {\n const typeCoord = args.coordinate\n ? transformCoordinate(args.coordinate as number[])\n : undefined;\n return {\n ...baseAction,\n text: args.text as string,\n ...(typeCoord && { x: typeCoord[0], y: typeCoord[1] }),\n press_enter:\n args.press_enter !== undefined\n ? (args.press_enter as boolean)\n : true,\n ...(args.delete_existing_text !== undefined && {\n delete_existing_text: args.delete_existing_text as boolean,\n }),\n };\n }\n\n case \"key\":\n case \"keypress\": {\n const keys = (args.keys as string[]) || [];\n // Normalize keys to Playwright format\n const normalizedKeys = keys.map((k) => mapKeyToPlaywright(k));\n return {\n ...baseAction,\n type: \"keypress\",\n keys: normalizedKeys,\n };\n }\n\n case \"scroll\": {\n const pixels = (args.pixels as number) || 0;\n // FARA: positive = scroll up, negative = scroll down\n // Convert to scroll_x/scroll_y\n return {\n ...baseAction,\n scroll_x: 0,\n scroll_y: -pixels, // Invert: negative pixels = scroll down\n };\n }\n\n case \"visit_url\": {\n let url = args.url as string;\n // Enhanced URL processing like Python\n if (\n !url.startsWith(\"https://\") &&\n !url.startsWith(\"http://\") &&\n !url.startsWith(\"file://\") &&\n !url.startsWith(\"about:\")\n ) {\n // If URL contains space, treat as search query\n if (url.includes(\" \")) {\n url = `https://www.bing.com/search?q=${encodeURIComponent(url)}&FORM=QBLH`;\n } else {\n // Otherwise prefix with https://\n url = \"https://\" + url;\n }\n }\n return {\n ...baseAction,\n type: \"goto\",\n url,\n };\n }\n\n case \"web_search\": {\n // Convert web search to visit_url with Bing search\n const query = args.query as string;\n const searchUrl = `https://www.bing.com/search?q=${encodeURIComponent(query)}&FORM=QBLH`;\n return {\n ...baseAction,\n type: \"goto\",\n url: searchUrl,\n };\n }\n\n case \"history_back\":\n return {\n ...baseAction,\n type: \"back\",\n };\n\n case \"wait\": {\n // Support both 'time' and 'duration' parameters with default (matches Python)\n const durationSeconds =\n (args.time as number) || (args.duration as number) || 3.0;\n return {\n ...baseAction,\n timeMs: durationSeconds * 1000, // Convert seconds to ms\n };\n }\n\n case \"pause_and_memorize_fact\": {\n // Store the fact for future reference (matches Python)\n const fact = args.fact as string;\n this.facts.push(fact);\n return {\n ...baseAction,\n fact,\n };\n }\n\n case \"terminate\":\n return {\n ...baseAction,\n status: args.status as string,\n };\n\n default:\n return {\n ...baseAction,\n ...args,\n };\n }\n }\n\n /**\n * Capture a screenshot and return as base64 data URL\n */\n async captureScreenshot(): Promise<string> {\n if (!this.screenshotProvider) {\n throw new AgentScreenshotProviderError(\"Screenshot provider not set\");\n }\n\n const base64Screenshot = await this.screenshotProvider();\n return `data:image/png;base64,${base64Screenshot}`;\n }\n\n /**\n * Remove old screenshots from history\n * Matches Python's maybe_remove_old_screenshots\n */\n private maybeRemoveOldScreenshots(\n history: FaraMessage[],\n includesCurrent: boolean = false,\n ): FaraMessage[] {\n if (this.maxImages <= 0) {\n return history;\n }\n\n const maxImages = includesCurrent ? this.maxImages : this.maxImages - 1;\n const newHistory: FaraMessage[] = [];\n let nImages = 0;\n\n // Iterate backwards\n for (let i = history.length - 1; i >= 0; i--) {\n const msg = history[i];\n\n // Check if message has image\n let hasImage = false;\n if (Array.isArray(msg.content)) {\n hasImage = msg.content.some((c) => c.type === \"image_url\");\n }\n\n if (i === 0 && nImages >= maxImages) {\n // First message (task) - preserve text, remove image\n if (Array.isArray(msg.content)) {\n const newContent = msg.content.filter((c) => c.type !== \"image_url\");\n // If no content left, skip (unless it's the only message, but Python logic says continue)\n if (newContent.length === 0) {\n continue;\n }\n newHistory.push({ ...msg, content: newContent });\n } else {\n newHistory.push(msg);\n }\n continue;\n }\n\n if (hasImage) {\n if (nImages < maxImages) {\n newHistory.push(msg);\n nImages++;\n } else {\n // Remove image, keep text\n if (Array.isArray(msg.content)) {\n const newContent = msg.content.filter(\n (c) => c.type !== \"image_url\",\n );\n // If content becomes empty, we can skip this message entirely (unless it's meaningful text)\n // Python logic: if msg is None continue.\n if (newContent.length > 0) {\n newHistory.push({ ...msg, content: newContent });\n }\n } else {\n newHistory.push(msg);\n }\n }\n } else {\n newHistory.push(msg);\n }\n }\n\n return newHistory.reverse();\n }\n\n /**\n * Reconstruct history for API call\n * Merges conceptual chat history with raw action history\n */\n private reconstructHistory(): FaraMessage[] {\n const history: FaraMessage[] = [];\n let actionTurn = 0;\n\n for (let i = 0; i < this.conversationHistory.length; i++) {\n const m = this.conversationHistory[i];\n if (m.role === \"assistant\") {\n if (actionTurn >= this.actionHistory.length) {\n // Should not happen if synced correctly\n console.warn(\"OUT OF SYNC: Action history shorter than chat history\");\n history.push(m);\n } else {\n history.push(this.actionHistory[actionTurn]);\n actionTurn++;\n }\n } else {\n history.push(m);\n }\n }\n\n return this.maybeRemoveOldScreenshots(history);\n }\n\n /**\n * Execute a single step\n */\n private async executeStep(\n logger: (message: LogLine) => void,\n isFirstRound: boolean = false,\n ): Promise<{\n actions: AgentAction[];\n completed: boolean;\n usage: {\n input_tokens: number;\n output_tokens: number;\n inference_time_ms: number;\n };\n }> {\n // Capture screenshot\n const screenshotDataUrl = await this.captureScreenshot();\n\n // Update conversation history with new screenshot/message\n if (isFirstRound) {\n // First round: modify the last message (initial user instruction) to include screenshot\n const lastMessage =\n this.conversationHistory[this.conversationHistory.length - 1];\n if (lastMessage && lastMessage.role === \"user\") {\n const originalContent =\n typeof lastMessage.content === \"string\"\n ? lastMessage.content\n : (lastMessage.content.find((c) => c.type === \"text\")?.text ??\n \"Start task\");\n\n lastMessage.content = [\n {\n type: \"image_url\",\n image_url: { url: screenshotDataUrl },\n },\n {\n type: \"text\",\n text: originalContent,\n },\n ];\n }\n } else {\n // Subsequent rounds: add new user message with screenshot\n const userContent: FaraMessageContent[] = [\n {\n type: \"image_url\",\n image_url: { url: screenshotDataUrl },\n },\n ];\n\n // Add current URL if available\n let textPrompt =\n \"Here is the next screenshot. Think about what to do next.\";\n if (this.currentUrl) {\n const trimmedUrl =\n this.currentUrl.length > 100\n ? this.currentUrl.slice(0, 100) + \"...\"\n : this.currentUrl;\n textPrompt = `Current URL: ${trimmedUrl}\\n${textPrompt}`;\n }\n\n userContent.push({\n type: \"text\",\n text: textPrompt,\n });\n\n this.conversationHistory.push({\n role: \"user\",\n content: userContent,\n });\n }\n\n // Reconstruct history for model call\n let history = this.reconstructHistory();\n\n // Prepend system prompt (generated fresh)\n const systemMessage: FaraMessage = {\n role: \"system\",\n content: this.generateSystemPrompt(),\n };\n history = [systemMessage, ...history];\n\n // Make API call\n logger({\n category: \"agent\",\n message: `Making API call to FARA model with ${history.length} messages`,\n level: 2,\n });\n\n const startTime = Date.now();\n let response;\n try {\n response = await this.client.chat.completions.create({\n model: this.modelName,\n messages: history as unknown as ChatCompletionMessageParam[],\n temperature: this.temperature,\n });\n } catch (apiError) {\n logger({\n category: \"agent\",\n message: `API call failed: ${apiError instanceof Error ? apiError.message : String(apiError)}`,\n level: 0,\n });\n throw apiError;\n }\n const inferenceTime = Date.now() - startTime;\n\n logger({\n category: \"agent\",\n message: `API call completed in ${inferenceTime}ms`,\n level: 2,\n });\n\n const content = response.choices[0].message.content || \"\";\n const usage = response.usage || {\n prompt_tokens: 0,\n completion_tokens: 0,\n total_tokens: 0,\n };\n\n // Add assistant response to both histories\n const assistantMsg: FaraMessage = {\n role: \"assistant\",\n content,\n };\n this.conversationHistory.push(assistantMsg);\n this.actionHistory.push(assistantMsg);\n\n logger({\n category: \"agent\",\n message: `Model response: ${content}`,\n level: 2,\n });\n\n // Parse tool call\n const { thoughts, functionCall } = this.parseThoughtsAndAction(content);\n\n logger({\n category: \"agent\",\n message: `Thoughts: ${thoughts}`,\n level: 2,\n });\n\n logger({\n category: \"agent\",\n message: `Action: ${JSON.stringify(functionCall.arguments)}`,\n level: 2,\n });\n\n // Convert to AgentAction\n const agentAction = this.convertFunctionCallToAction(functionCall);\n\n // Expand type action into multiple actions if it has coordinates\n const actions: AgentAction[] = [];\n if (\n agentAction.type === \"type\" &&\n typeof agentAction.x === \"number\" &&\n typeof agentAction.y === \"number\"\n ) {\n // First, click at the coordinates to focus the field\n actions.push({\n type: \"click\",\n x: agentAction.x,\n y: agentAction.y,\n button: \"left\",\n });\n\n // If delete_existing_text is true, clear the field first\n if (agentAction.delete_existing_text) {\n actions.push({\n type: \"keypress\",\n keys: [\"Command+A\"],\n });\n actions.push({\n type: \"keypress\",\n keys: [\"Backspace\"],\n });\n }\n\n // Add the type action (without coordinates since we already clicked)\n actions.push({\n type: \"type\",\n text: agentAction.text,\n });\n\n // If press_enter is true (default), press Enter after typing\n if (agentAction.press_enter !== false) {\n actions.push({\n type: \"keypress\",\n keys: [\"Enter\"],\n });\n }\n } else {\n // For all other actions, just add as-is\n actions.push(agentAction);\n }\n\n // Execute all actions if handler is available\n if (this.actionHandler && agentAction.type !== \"terminate\") {\n for (const action of actions) {\n await this.actionHandler(action);\n }\n }\n\n // Check if completed\n const completed = functionCall.arguments.action === \"terminate\";\n\n return {\n actions,\n completed,\n usage: {\n input_tokens: usage.prompt_tokens,\n output_tokens: usage.completion_tokens,\n inference_time_ms: inferenceTime,\n },\n };\n }\n\n /**\n * Execute a task with the FARA CUA\n * This is the main entry point for the agent\n * @implements AgentClient.execute\n */\n async execute(executionOptions: AgentExecutionOptions): Promise<AgentResult> {\n const { options, logger } = executionOptions;\n const { instruction } = options;\n const maxSteps = options.maxSteps || 10;\n\n let currentStep = 0;\n let completed = false;\n const actions: AgentAction[] = [];\n const messageList: string[] = [];\n let finalMessage = \"\";\n let totalInputTokens = 0;\n let totalOutputTokens = 0;\n let totalInferenceTime = 0;\n\n // Initialize conversation with user instruction\n // System prompt is NOT added here, it's added dynamically in executeStep\n this.conversationHistory = [\n {\n role: \"user\",\n content: instruction,\n },\n ];\n this.actionHistory = [];\n\n try {\n // Execute steps until completion or max steps reached\n while (!completed && currentStep < maxSteps) {\n logger({\n category: \"agent\",\n message: `Executing step ${currentStep + 1}/${maxSteps}`,\n level: 1,\n });\n\n const isFirstRound = currentStep === 0;\n const result = await this.executeStep(logger, isFirstRound);\n totalInputTokens += result.usage.input_tokens;\n totalOutputTokens += result.usage.output_tokens;\n totalInferenceTime += result.usage.inference_time_ms;\n\n // Add actions to the list\n actions.push(...result.actions);\n\n // Update completion status\n completed = result.completed;\n\n currentStep++;\n\n // Record message for this step\n const lastAction = result.actions[result.actions.length - 1];\n if (lastAction?.reasoning) {\n messageList.push(lastAction.reasoning);\n }\n }\n\n // Generate final message\n if (completed) {\n const lastAction = actions[actions.length - 1];\n finalMessage =\n (lastAction as { status?: string })?.status === \"success\"\n ? \"Task completed successfully.\"\n : \"Task completed with failures.\";\n } else {\n finalMessage = `Reached maximum steps (${maxSteps}) without completion.`;\n }\n\n if (messageList.length > 0) {\n finalMessage = `${messageList.join(\"\\n\\n\")}\\n\\n${finalMessage}`;\n }\n\n return {\n success: completed,\n completed,\n message: finalMessage,\n actions,\n usage: {\n input_tokens: totalInputTokens,\n output_tokens: totalOutputTokens,\n inference_time_ms: totalInferenceTime,\n },\n };\n } catch (error) {\n logger({\n category: \"agent\",\n message: `Error during execution: ${error}`,\n level: 0,\n });\n\n // Rethrow to allow eval runner's retry logic to handle transient errors\n throw error;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"MicrosoftCUAClient.js","sourceRoot":"","sources":["../../../../../lib/v3/agent/MicrosoftCUAClient.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAS5B,OAAO,EAAE,WAAW,EAAE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D,CAAC,CAAC,8BAA8B;wBAChC,CAAC,CAAC,+BAA+B,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACN,YAAY,GAAG,0BAA0B,QAAQ,uBAAuB,CAAC;YAC3E,CAAC;YAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,YAAY,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,YAAY,EAAE,CAAC;YAClE,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,SAAS;gBAClB,SAAS;gBACT,OAAO,EAAE,YAAY;gBACrB,OAAO;gBACP,KAAK,EAAE;oBACL,YAAY,EAAE,gBAAgB;oBAC9B,aAAa,EAAE,iBAAiB;oBAChC,iBAAiB,EAAE,kBAAkB;iBACtC;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC;gBACL,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,2BAA2B,KAAK,EAAE;gBAC3C,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YAEH,wEAAwE;YACxE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF","sourcesContent":["import OpenAI from \"openai\";\nimport { LogLine } from \"../types/public/logs.js\";\nimport {\n AgentAction,\n AgentResult,\n AgentType,\n AgentExecutionOptions,\n} from \"../types/public/agent.js\";\nimport { ClientOptions } from \"../types/public/model.js\";\nimport { AgentClient } from \"./AgentClient.js\";\nimport { AgentScreenshotProviderError } from \"../types/public/sdkErrors.js\";\nimport { mapKeyToPlaywright } from \"./utils/cuaKeyMapping.js\";\nimport { ChatCompletionMessageParam } from \"openai/resources/chat/completions\";\n\n/**\n * Message types for FARA agent\n */\ninterface FaraMessage {\n role: \"system\" | \"user\" | \"assistant\";\n content: string | FaraMessageContent[];\n}\n\ninterface FaraMessageContent {\n type: \"text\" | \"image_url\";\n text?: string;\n image_url?: {\n url: string; // data:image/png;base64,...\n };\n}\n\n/**\n * FARA function call structure (parsed from XML tags)\n */\ninterface FaraFunctionCall {\n name: string; // Always \"computer_use\"\n arguments: {\n action: string;\n thoughts?: string;\n [key: string]: unknown;\n };\n}\n\n/**\n * Client for FARA (Function-based Autonomous Research Agent) by Microsoft\n * This implementation uses OpenAI-compatible API with XML-based tool calling\n */\nexport class MicrosoftCUAClient extends AgentClient {\n private apiKey: string;\n private baseURL: string;\n private client: OpenAI;\n private currentViewport = { width: 1288, height: 711 };\n private currentUrl?: string;\n private screenshotProvider?: () => Promise<string>;\n private actionHandler?: (action: AgentAction) => Promise<void>;\n\n // Dual history system\n private conversationHistory: FaraMessage[] = []; // Conceptual flow\n private actionHistory: FaraMessage[] = []; // Raw model responses\n\n private maxImages: number = 3;\n private temperature: number = 0;\n private facts: string[] = [];\n\n // FARA-specific MLM processor config\n private readonly MLM_PROCESSOR_IM_CFG = {\n min_pixels: 3136,\n max_pixels: 12845056,\n patch_size: 14,\n merge_size: 2,\n };\n\n // Resized dimensions for model input\n private resizedViewport = { width: 1288, height: 711 };\n\n constructor(\n type: AgentType,\n modelName: string,\n userProvidedInstructions?: string,\n clientOptions?: ClientOptions,\n ) {\n super(type, modelName || \"fara-7b\", userProvidedInstructions);\n\n // Process client options\n this.apiKey =\n (clientOptions?.apiKey as string) ||\n process.env.AZURE_API_KEY ||\n process.env.FIREWORKS_API_KEY ||\n \"\";\n this.baseURL =\n (clientOptions?.baseURL as string) ||\n process.env.AZURE_ENDPOINT ||\n process.env.FIREWORKS_ENDPOINT ||\n \"\";\n\n // Store client options for reference\n this.clientOptions = {\n apiKey: this.apiKey,\n baseURL: this.baseURL,\n };\n\n // Validate API key\n if (!this.apiKey || this.apiKey === \"\") {\n throw new Error(\n \"API key is required. Please provide it via clientOptions.apiKey or AZURE_API_KEY or FIREWORKS_API_KEY environment variables.\",\n );\n }\n\n // Initialize the OpenAI client (FARA uses OpenAI-compatible API)\n this.client = new OpenAI({\n apiKey: this.apiKey,\n baseURL: this.baseURL,\n });\n\n // Max images to keep in history\n if (clientOptions?.maxImages !== undefined) {\n this.maxImages = clientOptions.maxImages as number;\n }\n\n // Temperature\n if (clientOptions?.temperature !== undefined) {\n this.temperature = clientOptions.temperature as number;\n }\n }\n\n setViewport(width: number, height: number): void {\n this.currentViewport = { width, height };\n // Compute resized viewport using smart_resize logic\n this.resizedViewport = this.smartResize(width, height);\n }\n\n setCurrentUrl(url: string): void {\n this.currentUrl = url;\n }\n\n setScreenshotProvider(provider: () => Promise<string>): void {\n this.screenshotProvider = provider;\n }\n\n setActionHandler(handler: (action: AgentAction) => Promise<void>): void {\n this.actionHandler = handler;\n }\n\n /**\n * Smart resize algorithm from FARA\n * Ensures dimensions are divisible by factor and within pixel limits\n */\n private smartResize(\n width: number,\n height: number,\n ): { width: number; height: number } {\n const { patch_size, merge_size, min_pixels, max_pixels } =\n this.MLM_PROCESSOR_IM_CFG;\n const factor = patch_size * merge_size;\n\n const roundByFactor = (num: number, f: number) => Math.round(num / f) * f;\n const ceilByFactor = (num: number, f: number) => Math.ceil(num / f) * f;\n const floorByFactor = (num: number, f: number) => Math.floor(num / f) * f;\n\n let h_bar = Math.max(factor, roundByFactor(height, factor));\n let w_bar = Math.max(factor, roundByFactor(width, factor));\n\n if (h_bar * w_bar > max_pixels) {\n const beta = Math.sqrt((height * width) / max_pixels);\n h_bar = floorByFactor(height / beta, factor);\n w_bar = floorByFactor(width / beta, factor);\n } else if (h_bar * w_bar < min_pixels) {\n const beta = Math.sqrt(min_pixels / (height * width));\n h_bar = ceilByFactor(height * beta, factor);\n w_bar = ceilByFactor(width * beta, factor);\n }\n\n return { width: w_bar, height: h_bar };\n }\n\n /**\n * Generate system prompt with tool description\n * Simplified to match Python's minimal approach\n */\n private generateSystemPrompt(): string {\n const { width, height } = this.resizedViewport;\n\n // Base prompt - Minimalist like Python\n let basePrompt = \"You are a helpful assistant.\";\n\n // Add user-provided instructions if available\n if (this.userProvidedInstructions) {\n basePrompt = `${basePrompt}\\n\\n${this.userProvidedInstructions}`;\n }\n\n // Tool description from FaraComputerUse\n const toolDescription = `Use a mouse and keyboard to interact with a computer, and take screenshots.\n* This is an interface to a desktop GUI. You do not have access to a terminal or applications menu. You must click on desktop icons to start applications.\n* Some applications may take time to start or process actions, so you may need to wait and take successive screenshots to see the results of your actions. E.g. if you click on Firefox and a window doesn't open, try wait and taking another screenshot.\n* The screen's resolution is ${width}x${height}.\n* Whenever you intend to move the cursor to click on an element like an icon, you should consult a screenshot to determine the coordinates of the element before moving the cursor.\n* If you tried clicking on a program or link but it failed to load, even after waiting, try adjusting your cursor position so that the tip of the cursor visually falls on the element that you want to click.\n* Make sure to click any buttons, links, icons, etc with the cursor tip in the center of the element. Don't click boxes on their edges unless asked.\n* When a separate scrollable container prominently overlays the webpage, if you want to scroll within it, you typically need to mouse_move() over it first and then scroll().\n* If a popup window appears that you want to close, if left_click() on the 'X' or close button doesn't work, try key(keys=['Escape']) to close it.\n* On some search bars, when you type(), you may need to press_enter=False and instead separately call left_click() on the search button to submit the search query. This is especially true of search bars that have auto-suggest popups for e.g. locations\n* For calendar widgets, you usually need to left_click() on arrows to move between months and left_click() on dates to select them; type() is not typically used to input dates there.`;\n\n // Tool parameters description\n const actionsDescription = `The action to perform. The available actions are:\n* \\`key\\`: Performs key down presses on the arguments passed in order, then performs key releases in reverse order. Includes \"Enter\", \"Alt\", \"Shift\", \"Tab\", \"Control\", \"Backspace\", \"Delete\", \"Escape\", \"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \"PageDown\", \"PageUp\", \"Shift\", etc.\n* \\`type\\`: Type a string of text on the keyboard.\n* \\`mouse_move\\`: Move the cursor to a specified (x, y) pixel coordinate on the screen.\n* \\`left_click\\`: Click the left mouse button.\n* \\`scroll\\`: Performs a scroll of the mouse scroll wheel.\n* \\`history_back\\`: Go back to the previous page in the browser history.\n* \\`pause_and_memorize_fact\\`: Pause and memorize a fact for future reference.\n* \\`visit_url\\`: Visit a specified URL.\n* \\`web_search\\`: Perform a web search with a specified query.\n* \\`wait\\`: Wait specified seconds for the change to happen.\n* \\`terminate\\`: Terminate the current task and report its completion status.`;\n\n // Tool JSON schema\n const toolSchema = {\n name: \"computer_use\",\n description: toolDescription,\n parameters: {\n type: \"object\",\n required: [\"action\"],\n properties: {\n action: {\n type: \"string\",\n description: actionsDescription,\n enum: [\n \"key\",\n \"type\",\n \"mouse_move\",\n \"left_click\",\n \"scroll\",\n \"visit_url\",\n \"web_search\",\n \"history_back\",\n \"pause_and_memorize_fact\",\n \"wait\",\n \"terminate\",\n ],\n },\n keys: {\n type: \"array\",\n description: \"Required only by `action=key`.\",\n },\n text: {\n type: \"string\",\n description: \"Required only by `action=type`.\",\n },\n press_enter: {\n type: \"boolean\",\n description:\n \"Whether to press the Enter key after typing. Required only by `action=type`.\",\n },\n delete_existing_text: {\n type: \"boolean\",\n description:\n \"Whether to delete existing text before typing. Required only by `action=type`.\",\n },\n coordinate: {\n type: \"array\",\n description:\n \"(x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=left_click`, `action=mouse_move`, and `action=type`.\",\n },\n pixels: {\n type: \"number\",\n description:\n \"The amount of scrolling to perform. Positive values scroll up, negative values scroll down. Required only by `action=scroll`.\",\n },\n fact: {\n type: \"string\",\n description:\n \"The fact to remember for the future. Required only by `action=pause_and_memorize_fact`.\",\n },\n time: {\n type: \"number\",\n description: \"The seconds to wait. Required only by `action=wait`.\",\n },\n status: {\n type: \"string\",\n description:\n \"The status of the task. Required only by `action=terminate`.\",\n enum: [\"success\", \"failure\"],\n },\n },\n },\n };\n\n // Format as FARA function calling template (FN_CALL_TEMPLATE format)\n const toolDescs = JSON.stringify(toolSchema, null, 2);\n const functionCallTemplate = `\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>\n${toolDescs}\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{{\"name\": <function-name>, \"arguments\": <args-json-object>}}\n</tool_call>`;\n\n return `${basePrompt}\\n\\n${functionCallTemplate}`;\n }\n\n /**\n * Parse thoughts and action from model response\n * FARA uses XML-based tool calling: <tool_call>\\n{...}\\n</tool_call>\n */\n private parseThoughtsAndAction(response: string): {\n thoughts: string;\n functionCall: FaraFunctionCall;\n } {\n try {\n const parts = response.split(\"<tool_call>\\n\");\n const thoughts = parts[0].trim();\n const actionText = parts[1].split(\"\\n</tool_call>\")[0].trim();\n\n let parsedAction;\n try {\n parsedAction = JSON.parse(actionText);\n } catch (jsonError) {\n // Fix common malformed JSON: double opening brackets {{\"name\": ...}}\n // This happens when the model adds an extra opening brace\n if (actionText.startsWith(\"{{\") && actionText.endsWith(\"}\")) {\n // Remove the extra opening brace\n const fixedText = actionText.slice(1);\n try {\n parsedAction = JSON.parse(fixedText);\n } catch (retryError) {\n throw new Error(\n `Failed to parse action text even after fixing double brackets. Original: ${actionText}. Fixed: ${fixedText}. Error: ${retryError}`,\n { cause: retryError },\n );\n }\n } else {\n throw new Error(\n `Failed to parse action text as JSON: ${actionText}. Error: ${jsonError}`,\n { cause: jsonError },\n );\n }\n }\n\n return {\n thoughts,\n functionCall: {\n name: parsedAction.name || \"computer_use\",\n arguments: {\n ...parsedAction.arguments,\n thoughts,\n },\n },\n };\n } catch (error) {\n throw new Error(\n `Failed to parse FARA tool call from response: ${response}. Error: ${error}`,\n { cause: error },\n );\n }\n }\n\n /**\n * Convert FARA function call to Stagehand AgentAction\n */\n private convertFunctionCallToAction(\n functionCall: FaraFunctionCall,\n ): AgentAction {\n const args = functionCall.arguments;\n const action = args.action as string;\n\n // Transform coordinates from resized to original viewport\n const transformCoordinate = (coord: number[]): number[] => {\n if (!coord || coord.length !== 2) return coord;\n const [x, y] = coord;\n const scaleX = this.currentViewport.width / this.resizedViewport.width;\n const scaleY = this.currentViewport.height / this.resizedViewport.height;\n return [Math.round(x * scaleX), Math.round(y * scaleY)];\n };\n\n const baseAction = {\n type: action,\n reasoning: args.thoughts as string,\n };\n\n switch (action) {\n case \"left_click\": {\n const clickCoord = transformCoordinate(args.coordinate as number[]);\n return {\n ...baseAction,\n type: \"click\",\n x: clickCoord[0],\n y: clickCoord[1],\n button: \"left\" as const,\n };\n }\n\n case \"mouse_move\": {\n const moveCoord = transformCoordinate(args.coordinate as number[]);\n return {\n ...baseAction,\n type: \"move\",\n coordinate: moveCoord,\n };\n }\n\n case \"type\": {\n const typeCoord = args.coordinate\n ? transformCoordinate(args.coordinate as number[])\n : undefined;\n return {\n ...baseAction,\n text: args.text as string,\n ...(typeCoord && { x: typeCoord[0], y: typeCoord[1] }),\n press_enter:\n args.press_enter !== undefined\n ? (args.press_enter as boolean)\n : true,\n ...(args.delete_existing_text !== undefined && {\n delete_existing_text: args.delete_existing_text as boolean,\n }),\n };\n }\n\n case \"key\":\n case \"keypress\": {\n const keys = (args.keys as string[]) || [];\n // Normalize keys to Playwright format\n const normalizedKeys = keys.map((k) => mapKeyToPlaywright(k));\n return {\n ...baseAction,\n type: \"keypress\",\n keys: normalizedKeys,\n };\n }\n\n case \"scroll\": {\n const pixels = (args.pixels as number) || 0;\n // FARA: positive = scroll up, negative = scroll down\n // Convert to scroll_x/scroll_y\n return {\n ...baseAction,\n scroll_x: 0,\n scroll_y: -pixels, // Invert: negative pixels = scroll down\n };\n }\n\n case \"visit_url\": {\n let url = args.url as string;\n // Enhanced URL processing like Python\n if (\n !url.startsWith(\"https://\") &&\n !url.startsWith(\"http://\") &&\n !url.startsWith(\"file://\") &&\n !url.startsWith(\"about:\")\n ) {\n // If URL contains space, treat as search query\n if (url.includes(\" \")) {\n url = `https://www.bing.com/search?q=${encodeURIComponent(url)}&FORM=QBLH`;\n } else {\n // Otherwise prefix with https://\n url = \"https://\" + url;\n }\n }\n return {\n ...baseAction,\n type: \"goto\",\n url,\n };\n }\n\n case \"web_search\": {\n // Convert web search to visit_url with Bing search\n const query = args.query as string;\n const searchUrl = `https://www.bing.com/search?q=${encodeURIComponent(query)}&FORM=QBLH`;\n return {\n ...baseAction,\n type: \"goto\",\n url: searchUrl,\n };\n }\n\n case \"history_back\":\n return {\n ...baseAction,\n type: \"back\",\n };\n\n case \"wait\": {\n // Support both 'time' and 'duration' parameters with default (matches Python)\n const durationSeconds =\n (args.time as number) || (args.duration as number) || 3.0;\n return {\n ...baseAction,\n timeMs: durationSeconds * 1000, // Convert seconds to ms\n };\n }\n\n case \"pause_and_memorize_fact\": {\n // Store the fact for future reference (matches Python)\n const fact = args.fact as string;\n this.facts.push(fact);\n return {\n ...baseAction,\n fact,\n };\n }\n\n case \"terminate\":\n return {\n ...baseAction,\n status: args.status as string,\n };\n\n default:\n return {\n ...baseAction,\n ...args,\n };\n }\n }\n\n /**\n * Capture a screenshot and return as base64 data URL\n */\n async captureScreenshot(): Promise<string> {\n if (!this.screenshotProvider) {\n throw new AgentScreenshotProviderError(\"Screenshot provider not set\");\n }\n\n const base64Screenshot = await this.screenshotProvider();\n return `data:image/png;base64,${base64Screenshot}`;\n }\n\n /**\n * Remove old screenshots from history\n * Matches Python's maybe_remove_old_screenshots\n */\n private maybeRemoveOldScreenshots(\n history: FaraMessage[],\n includesCurrent: boolean = false,\n ): FaraMessage[] {\n if (this.maxImages <= 0) {\n return history;\n }\n\n const maxImages = includesCurrent ? this.maxImages : this.maxImages - 1;\n const newHistory: FaraMessage[] = [];\n let nImages = 0;\n\n // Iterate backwards\n for (let i = history.length - 1; i >= 0; i--) {\n const msg = history[i];\n\n // Check if message has image\n let hasImage = false;\n if (Array.isArray(msg.content)) {\n hasImage = msg.content.some((c) => c.type === \"image_url\");\n }\n\n if (i === 0 && nImages >= maxImages) {\n // First message (task) - preserve text, remove image\n if (Array.isArray(msg.content)) {\n const newContent = msg.content.filter((c) => c.type !== \"image_url\");\n // If no content left, skip (unless it's the only message, but Python logic says continue)\n if (newContent.length === 0) {\n continue;\n }\n newHistory.push({ ...msg, content: newContent });\n } else {\n newHistory.push(msg);\n }\n continue;\n }\n\n if (hasImage) {\n if (nImages < maxImages) {\n newHistory.push(msg);\n nImages++;\n } else {\n // Remove image, keep text\n if (Array.isArray(msg.content)) {\n const newContent = msg.content.filter(\n (c) => c.type !== \"image_url\",\n );\n // If content becomes empty, we can skip this message entirely (unless it's meaningful text)\n // Python logic: if msg is None continue.\n if (newContent.length > 0) {\n newHistory.push({ ...msg, content: newContent });\n }\n } else {\n newHistory.push(msg);\n }\n }\n } else {\n newHistory.push(msg);\n }\n }\n\n return newHistory.reverse();\n }\n\n /**\n * Reconstruct history for API call\n * Merges conceptual chat history with raw action history\n */\n private reconstructHistory(): FaraMessage[] {\n const history: FaraMessage[] = [];\n let actionTurn = 0;\n\n for (let i = 0; i < this.conversationHistory.length; i++) {\n const m = this.conversationHistory[i];\n if (m.role === \"assistant\") {\n if (actionTurn >= this.actionHistory.length) {\n // Should not happen if synced correctly\n console.warn(\"OUT OF SYNC: Action history shorter than chat history\");\n history.push(m);\n } else {\n history.push(this.actionHistory[actionTurn]);\n actionTurn++;\n }\n } else {\n history.push(m);\n }\n }\n\n return this.maybeRemoveOldScreenshots(history);\n }\n\n /**\n * Execute a single step\n */\n private async executeStep(\n logger: (message: LogLine) => void,\n isFirstRound: boolean = false,\n ): Promise<{\n actions: AgentAction[];\n completed: boolean;\n usage: {\n input_tokens: number;\n output_tokens: number;\n inference_time_ms: number;\n };\n }> {\n // Capture screenshot\n const screenshotDataUrl = await this.captureScreenshot();\n\n // Update conversation history with new screenshot/message\n if (isFirstRound) {\n // First round: modify the last message (initial user instruction) to include screenshot\n const lastMessage =\n this.conversationHistory[this.conversationHistory.length - 1];\n if (lastMessage && lastMessage.role === \"user\") {\n const originalContent =\n typeof lastMessage.content === \"string\"\n ? lastMessage.content\n : (lastMessage.content.find((c) => c.type === \"text\")?.text ??\n \"Start task\");\n\n lastMessage.content = [\n {\n type: \"image_url\",\n image_url: { url: screenshotDataUrl },\n },\n {\n type: \"text\",\n text: originalContent,\n },\n ];\n }\n } else {\n // Subsequent rounds: add new user message with screenshot\n const userContent: FaraMessageContent[] = [\n {\n type: \"image_url\",\n image_url: { url: screenshotDataUrl },\n },\n ];\n\n // Add current URL if available\n let textPrompt =\n \"Here is the next screenshot. Think about what to do next.\";\n if (this.currentUrl) {\n const trimmedUrl =\n this.currentUrl.length > 100\n ? this.currentUrl.slice(0, 100) + \"...\"\n : this.currentUrl;\n textPrompt = `Current URL: ${trimmedUrl}\\n${textPrompt}`;\n }\n\n userContent.push({\n type: \"text\",\n text: textPrompt,\n });\n\n this.conversationHistory.push({\n role: \"user\",\n content: userContent,\n });\n }\n\n // Reconstruct history for model call\n let history = this.reconstructHistory();\n\n // Prepend system prompt (generated fresh)\n const systemMessage: FaraMessage = {\n role: \"system\",\n content: this.generateSystemPrompt(),\n };\n history = [systemMessage, ...history];\n\n // Make API call\n logger({\n category: \"agent\",\n message: `Making API call to FARA model with ${history.length} messages`,\n level: 2,\n });\n\n const startTime = Date.now();\n let response;\n try {\n response = await this.client.chat.completions.create({\n model: this.modelName,\n messages: history as unknown as ChatCompletionMessageParam[],\n temperature: this.temperature,\n });\n } catch (apiError) {\n logger({\n category: \"agent\",\n message: `API call failed: ${apiError instanceof Error ? apiError.message : String(apiError)}`,\n level: 0,\n });\n throw apiError;\n }\n const inferenceTime = Date.now() - startTime;\n\n logger({\n category: \"agent\",\n message: `API call completed in ${inferenceTime}ms`,\n level: 2,\n });\n\n const content = response.choices[0].message.content || \"\";\n const usage = response.usage || {\n prompt_tokens: 0,\n completion_tokens: 0,\n total_tokens: 0,\n };\n\n // Add assistant response to both histories\n const assistantMsg: FaraMessage = {\n role: \"assistant\",\n content,\n };\n this.conversationHistory.push(assistantMsg);\n this.actionHistory.push(assistantMsg);\n\n logger({\n category: \"agent\",\n message: `Model response: ${content}`,\n level: 2,\n });\n\n // Parse tool call\n const { thoughts, functionCall } = this.parseThoughtsAndAction(content);\n\n logger({\n category: \"agent\",\n message: `Thoughts: ${thoughts}`,\n level: 2,\n });\n\n logger({\n category: \"agent\",\n message: `Action: ${JSON.stringify(functionCall.arguments)}`,\n level: 2,\n });\n\n // Convert to AgentAction\n const agentAction = this.convertFunctionCallToAction(functionCall);\n\n // Expand type action into multiple actions if it has coordinates\n const actions: AgentAction[] = [];\n if (\n agentAction.type === \"type\" &&\n typeof agentAction.x === \"number\" &&\n typeof agentAction.y === \"number\"\n ) {\n // First, click at the coordinates to focus the field\n actions.push({\n type: \"click\",\n x: agentAction.x,\n y: agentAction.y,\n button: \"left\",\n });\n\n // If delete_existing_text is true, clear the field first\n if (agentAction.delete_existing_text) {\n actions.push({\n type: \"keypress\",\n keys: [\"Command+A\"],\n });\n actions.push({\n type: \"keypress\",\n keys: [\"Backspace\"],\n });\n }\n\n // Add the type action (without coordinates since we already clicked)\n actions.push({\n type: \"type\",\n text: agentAction.text,\n });\n\n // If press_enter is true (default), press Enter after typing\n if (agentAction.press_enter !== false) {\n actions.push({\n type: \"keypress\",\n keys: [\"Enter\"],\n });\n }\n } else {\n // For all other actions, just add as-is\n actions.push(agentAction);\n }\n\n // Execute all actions if handler is available\n if (this.actionHandler && agentAction.type !== \"terminate\") {\n for (const action of actions) {\n await this.actionHandler(action);\n }\n }\n\n // Check if completed\n const completed = functionCall.arguments.action === \"terminate\";\n\n return {\n actions,\n completed,\n usage: {\n input_tokens: usage.prompt_tokens,\n output_tokens: usage.completion_tokens,\n inference_time_ms: inferenceTime,\n },\n };\n }\n\n /**\n * Execute a task with the FARA CUA\n * This is the main entry point for the agent\n * @implements AgentClient.execute\n */\n async execute(executionOptions: AgentExecutionOptions): Promise<AgentResult> {\n const { options, logger } = executionOptions;\n const { instruction } = options;\n const maxSteps = options.maxSteps || 10;\n\n let currentStep = 0;\n let completed = false;\n const actions: AgentAction[] = [];\n const messageList: string[] = [];\n let finalMessage: string;\n let totalInputTokens = 0;\n let totalOutputTokens = 0;\n let totalInferenceTime = 0;\n\n // Initialize conversation with user instruction\n // System prompt is NOT added here, it's added dynamically in executeStep\n this.conversationHistory = [\n {\n role: \"user\",\n content: instruction,\n },\n ];\n this.actionHistory = [];\n\n try {\n // Execute steps until completion or max steps reached\n while (!completed && currentStep < maxSteps) {\n logger({\n category: \"agent\",\n message: `Executing step ${currentStep + 1}/${maxSteps}`,\n level: 1,\n });\n\n const isFirstRound = currentStep === 0;\n const result = await this.executeStep(logger, isFirstRound);\n totalInputTokens += result.usage.input_tokens;\n totalOutputTokens += result.usage.output_tokens;\n totalInferenceTime += result.usage.inference_time_ms;\n\n // Add actions to the list\n actions.push(...result.actions);\n\n // Update completion status\n completed = result.completed;\n\n currentStep++;\n\n // Record message for this step\n const lastAction = result.actions[result.actions.length - 1];\n if (lastAction?.reasoning) {\n messageList.push(lastAction.reasoning);\n }\n }\n\n // Generate final message\n if (completed) {\n const lastAction = actions[actions.length - 1];\n finalMessage =\n (lastAction as { status?: string })?.status === \"success\"\n ? \"Task completed successfully.\"\n : \"Task completed with failures.\";\n } else {\n finalMessage = `Reached maximum steps (${maxSteps}) without completion.`;\n }\n\n if (messageList.length > 0) {\n finalMessage = `${messageList.join(\"\\n\\n\")}\\n\\n${finalMessage}`;\n }\n\n return {\n success: completed,\n completed,\n message: finalMessage,\n actions,\n usage: {\n input_tokens: totalInputTokens,\n output_tokens: totalOutputTokens,\n inference_time_ms: totalInferenceTime,\n },\n };\n } catch (error) {\n logger({\n category: \"agent\",\n message: `Error during execution: ${error}`,\n level: 0,\n });\n\n // Rethrow to allow eval runner's retry logic to handle transient errors\n throw error;\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { AgentToolMode } from "../../types/public/agent.js";
1
+ import type { AgentToolMode, Variables } from "../../types/public/agent.js";
2
2
  export interface AgentSystemPromptOptions {
3
3
  url: string;
4
4
  executionInstruction: string;
@@ -8,5 +8,7 @@ export interface AgentSystemPromptOptions {
8
8
  isBrowserbase?: boolean;
9
9
  /** Tools to exclude from the system prompt */
10
10
  excludeTools?: string[];
11
+ /** Variables available to the agent for use in act/type tools */
12
+ variables?: Variables;
11
13
  }
12
14
  export declare function buildAgentSystemPrompt(options: AgentSystemPromptOptions): string;
@@ -71,7 +71,7 @@ function buildToolsSection(isHybridMode, hasSearch, excludeTools) {
71
71
  return `<tools>\n${toolLines}\n </tools>`;
72
72
  }
73
73
  export function buildAgentSystemPrompt(options) {
74
- const { url, executionInstruction, mode, systemInstructions, isBrowserbase = false, excludeTools, } = options;
74
+ const { url, executionInstruction, mode, systemInstructions, isBrowserbase = false, excludeTools, variables, } = options;
75
75
  const localeDate = new Date().toLocaleDateString();
76
76
  const isoDate = new Date().toISOString();
77
77
  const cdata = (text) => `<![CDATA[${text}]]>`;
@@ -143,6 +143,28 @@ export function buildAgentSystemPrompt(options) {
143
143
  const customInstructionsBlock = systemInstructions
144
144
  ? `<customInstructions>${cdata(systemInstructions)}</customInstructions>\n `
145
145
  : "";
146
+ // Build variables section only if variables are provided
147
+ const hasVariables = variables && Object.keys(variables).length > 0;
148
+ const variableToolsNote = isHybridMode
149
+ ? "Use %variableName% syntax in the type, fillFormVision, or act tool's value/text/action fields."
150
+ : "Use %variableName% syntax in the act or fillForm tool's value/action fields.";
151
+ const variablesSection = hasVariables
152
+ ? `<variables>
153
+ <note>You have access to the following variables. Use %variableName% syntax to substitute variable values. This is especially important for sensitive data like passwords.</note>
154
+ <usage>${variableToolsNote}</usage>
155
+ <example>To type a password, use: type %password% into the password field</example>
156
+ ${Object.entries(variables)
157
+ .map(([name, v]) => {
158
+ const description = typeof v === "object" && v !== null && "value" in v
159
+ ? v.description
160
+ : undefined;
161
+ return description
162
+ ? `<variable name="${name}">${description}</variable>`
163
+ : `<variable name="${name}" />`;
164
+ })
165
+ .join("\n ")}
166
+ </variables>`
167
+ : "";
146
168
  return `<system>
147
169
  <identity>You are a web automation assistant using browser automation tools to accomplish the user's goal.</identity>
148
170
  ${customInstructionsBlock}<task>
@@ -174,6 +196,7 @@ export function buildAgentSystemPrompt(options) {
174
196
  ${commonStrategyItems}
175
197
  </strategy>
176
198
  ${roadblocksSection}
199
+ ${variablesSection}
177
200
  <completion>
178
201
  <note>When you complete the task, explain any information that was found that was relevant to the original task.</note>
179
202
  <examples>
@@ -1 +1 @@
1
- {"version":3,"file":"agentSystemPrompt.js","sourceRoot":"","sources":["../../../../../../lib/v3/agent/prompts/agentSystemPrompt.ts"],"names":[],"mappings":"AAwBA,SAAS,iBAAiB,CACxB,YAAqB,EACrB,SAAkB,EAClB,YAAuB;IAEvB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAqB;QACpC;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,4DAA4D;SAC1E;QACD;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EACT,+DAA+D;SAClE;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EACT,qFAAqF;SACxF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EACT,2FAA2F;SAC9F;QACD;YACE,IAAI,EAAE,KAAK;YACX,WAAW,EACT,0LAA0L;SAC7L;QACD,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAChE,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,8BAA8B,EAAE;QACrE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sBAAsB,EAAE;QACrD;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,mCAAmC;SACjD;QACD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE;QACtD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,yBAAyB,EAAE;QAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE;QAClD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2BAA2B,EAAE;QAC1D,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,kCAAkC,EAAE;QACpE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;KACvE,CAAC;IAEF,MAAM,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;IAEhC,iFAAiF;IACjF,MAAM,iBAAiB,GAAG,aAAa;QACrC,CAAC,CAAC;;;gBAGU;QACZ,CAAC,CAAC,EAAE,CAAC;IAEP,kDAAkD;IAClD,MAAM,uBAAuB,GAAG,kBAAkB;QAChD,CAAC,CAAC,uBAAuB,KAAK,CAAC,kBAAkB,CAAC,2BAA2B;QAC7E,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;IAEL,uBAAuB;YACf,KAAK,CAAC,oBAAoB,CAAC;iCACN,OAAO,KAAK,UAAU;;;;2DAII,GAAG;;;;;;;;;;;;IAY1D,yBAAyB;;;MAGvB,SAAS,CAAC,CAAC,CAAC,mFAAmF,CAAC,CAAC,CAAC,EAAE;;IAEtG,YAAY;;MAEV,eAAe;MACf,mBAAmB;;IAErB,iBAAiB;;;;;;;;UAQX,CAAC;AACX,CAAC","sourcesContent":["import type { AgentToolMode } from \"../../types/public/agent.js\";\n\nexport interface AgentSystemPromptOptions {\n url: string;\n executionInstruction: string;\n mode: AgentToolMode;\n systemInstructions?: string;\n /** Whether running on Browserbase (enables captcha solver messaging) */\n isBrowserbase?: boolean;\n /** Tools to exclude from the system prompt */\n excludeTools?: string[];\n}\n\n/**\n * Builds the system prompt for the agent based on the tool mode.\n *\n * @param options - The prompt configuration options\n * @returns The formatted system prompt string\n */\ninterface ToolDefinition {\n name: string;\n description: string;\n}\n\nfunction buildToolsSection(\n isHybridMode: boolean,\n hasSearch: boolean,\n excludeTools?: string[],\n): string {\n const excludeSet = new Set(excludeTools ?? []);\n\n const hybridTools: ToolDefinition[] = [\n {\n name: \"screenshot\",\n description: \"Take a compressed JPEG screenshot for quick visual context\",\n },\n {\n name: \"ariaTree\",\n description:\n \"Get an accessibility (ARIA) hybrid tree for full page context\",\n },\n {\n name: \"click\",\n description:\n \"Click on an element (PREFERRED - more reliable when element is visible in viewport)\",\n },\n {\n name: \"type\",\n description:\n \"Type text into an element (PREFERRED - more reliable when element is visible in viewport)\",\n },\n {\n name: \"act\",\n description:\n \"Perform a specific atomic action (click, type, etc.) - ONLY use when element is in ariaTree but NOT visible in screenshot. Less reliable but can interact with out-of-viewport elements.\",\n },\n { name: \"dragAndDrop\", description: \"Drag and drop an element\" },\n { name: \"clickAndHold\", description: \"Click and hold on an element\" },\n { name: \"keys\", description: \"Press a keyboard key\" },\n {\n name: \"fillFormVision\",\n description: \"Fill out a form using coordinates\",\n },\n { name: \"think\", description: \"Think about the task\" },\n { name: \"extract\", description: \"Extract structured data\" },\n { name: \"goto\", description: \"Navigate to a URL\" },\n { name: \"wait\", description: \"Wait for a specified time\" },\n { name: \"navback\", description: \"Navigate back in browser history\" },\n { name: \"scroll\", description: \"Scroll the page x pixels up or down\" },\n ];\n\n const domTools: ToolDefinition[] = [\n {\n name: \"screenshot\",\n description: \"Take a compressed JPEG screenshot for quick visual context\",\n },\n {\n name: \"ariaTree\",\n description:\n \"Get an accessibility (ARIA) hybrid tree for full page context\",\n },\n {\n name: \"act\",\n description: \"Perform a specific atomic action (click, type)\",\n },\n { name: \"keys\", description: \"Press a keyboard key\" },\n { name: \"fillForm\", description: \"Fill out a form\" },\n { name: \"think\", description: \"Think about the task\" },\n { name: \"extract\", description: \"Extract structured data\" },\n { name: \"goto\", description: \"Navigate to a URL\" },\n { name: \"wait\", description: \"Wait for a specified time\" },\n { name: \"navback\", description: \"Navigate back in browser history\" },\n { name: \"scroll\", description: \"Scroll the page x pixels up or down\" },\n ];\n\n const baseTools = isHybridMode ? hybridTools : domTools;\n\n if (hasSearch) {\n baseTools.push({\n name: \"search\",\n description:\n \"Perform a web search and return results. Prefer this over navigating to Google and searching within the page for reliability and efficiency.\",\n });\n }\n\n const filteredTools = baseTools.filter((tool) => !excludeSet.has(tool.name));\n\n const toolLines = filteredTools\n .map((tool) => ` <tool name=\"${tool.name}\">${tool.description}</tool>`)\n .join(\"\\n\");\n\n return `<tools>\\n${toolLines}\\n </tools>`;\n}\n\nexport function buildAgentSystemPrompt(\n options: AgentSystemPromptOptions,\n): string {\n const {\n url,\n executionInstruction,\n mode,\n systemInstructions,\n isBrowserbase = false,\n excludeTools,\n } = options;\n const localeDate = new Date().toLocaleDateString();\n const isoDate = new Date().toISOString();\n const cdata = (text: string) => `<![CDATA[${text}]]>`;\n\n const isHybridMode = mode === \"hybrid\";\n const hasSearch = Boolean(process.env.BRAVE_API_KEY);\n\n // Tools section differs based on mode and excluded tools\n const toolsSection = buildToolsSection(isHybridMode, hasSearch, excludeTools);\n\n // Strategy differs based on mode\n const strategyItems = isHybridMode\n ? [\n `<item>Tool selection priority: Use specific tools (click, type) when elements are visible in viewport for maximum reliability.</item>`,\n `<item>Always use screenshot to get proper grounding of the coordinates you want to type/click into.</item>`,\n `<item>When interacting with an input, always use the type tool to type into the input, over clicking and then typing into it.</item>`,\n `<item>Use ariaTree as a secondary tool when elements aren't visible in screenshot or to get full page context.</item>`,\n `<item>Only use act when element is in ariaTree but NOT visible in screenshot.</item>`,\n ]\n : [\n `<item>Tool selection priority: Use act tool for all clicking and typing on a page.</item>`,\n `<item>Always check ariaTree first to understand full page content without scrolling - it shows all elements including those below the fold.</item>`,\n `<item>When interacting with an input, always use the act tool to type into the input, over clicking and then typing.</item>`,\n `<item>If an element is present in the ariaTree, use act to interact with it directly - this eliminates the need to scroll.</item>`,\n `<item>Use screenshot for visual confirmation when needed, but rely primarily on ariaTree for element detection.</item>`,\n ];\n\n const strategySection = strategyItems.join(\"\\n \");\n\n const commonStrategyItems = `\n <item>CRITICAL: Use extract ONLY when the task explicitly requires structured data output (e.g., \"get job listings\", \"extract product details\"). For reading page content or understanding elements, always use ${isHybridMode ? \"screenshot or ariaTree\" : \"ariaTree\"} instead - it's faster and more reliable.</item>\n <item>Keep actions atomic and verify outcomes before proceeding.</item>\n <item>For each action, provide clear reasoning about why you're taking that step.</item>\n <item>When you need to input text that could be entered character-by-character or through multiple separate inputs, prefer using the keys tool to type the entire sequence at once. This is more efficient for scenarios like verification codes split across multiple fields, or when virtual keyboards are present but direct typing would be faster.</item>\n `;\n\n // Page understanding protocol differs based on mode\n const pageUnderstandingProtocol = isHybridMode\n ? `<page_understanding_protocol>\n <step_1>\n <title>UNDERSTAND THE PAGE</title>\n <primary_tool>\n <name>screenshot</name>\n <usage>Visual confirmation when needed. Ideally after navigating to a new page.</usage>\n </primary_tool>\n <secondary_tool>\n <name>ariaTree</name>\n <usage>Get complete page context before taking actions</usage>\n <benefit>Eliminates the need to scroll and provides full accessible content</benefit>\n </secondary_tool>\n </step_1>\n </page_understanding_protocol>`\n : `<page_understanding_protocol>\n <step_1>\n <title>UNDERSTAND THE PAGE</title>\n <primary_tool>\n <name>ariaTree</name>\n <usage>Get complete page context before taking actions</usage>\n <benefit>Eliminates the need to scroll and provides full accessible content</benefit>\n </primary_tool>\n <secondary_tool>\n <name>screenshot</name>\n <usage>Visual confirmation when needed. Ideally after navigating to a new page.</usage>\n </secondary_tool>\n </step_1>\n </page_understanding_protocol>`;\n\n // Roadblocks section only shown when running on Browserbase (has captcha solver)\n const roadblocksSection = isBrowserbase\n ? `<roadblocks>\n <note>captchas, popups, etc.</note>\n <captcha>If you see a captcha, use the wait tool. It will automatically be solved by our internal solver.</captcha>\n </roadblocks>`\n : \"\";\n\n // Build customInstructions block only if provided\n const customInstructionsBlock = systemInstructions\n ? `<customInstructions>${cdata(systemInstructions)}</customInstructions>\\n `\n : \"\";\n\n return `<system>\n <identity>You are a web automation assistant using browser automation tools to accomplish the user's goal.</identity>\n ${customInstructionsBlock}<task>\n <goal>${cdata(executionInstruction)}</goal>\n <date display=\"local\" iso=\"${isoDate}\">${localeDate}</date>\n <note>You may think the date is different due to knowledge cutoff, but this is the actual date.</note>\n </task>\n <page>\n <startingUrl>you are starting your task on this url: ${url}</startingUrl>\n </page>\n <mindset>\n <note>Be very intentional about your action. The initial instruction is very important, and slight variations of the actual goal can lead to failures.</note>\n <importantNote>If something fails to meet a single condition of the task, move on from it rather than seeing if it meets other criteria. We only care that it meets all of it</importantNote>\n <note>When the task is complete, do not seek more information; you have completed the task.</note>\n </mindset>\n <guidelines>\n <item>Always start by understanding the current page state</item>\n <item>Use the screenshot tool to verify page state when needed</item>\n <item>Use appropriate tools for each action</item>\n </guidelines>\n ${pageUnderstandingProtocol}\n <navigation>\n <rule>If you are confident in the URL, navigate directly to it.</rule>\n ${hasSearch ? `<rule>If you are not confident in the URL, use the search tool to find it.</rule>` : ``}\n </navigation>\n ${toolsSection}\n <strategy>\n ${strategySection}\n ${commonStrategyItems}\n </strategy>\n ${roadblocksSection}\n <completion>\n <note>When you complete the task, explain any information that was found that was relevant to the original task.</note>\n <examples>\n <example>If you were asked for specific flights, list the flights you found.</example>\n <example>If you were asked for information about a product, list the product information you were asked for.</example>\n </examples>\n </completion>\n</system>`;\n}\n"]}
1
+ {"version":3,"file":"agentSystemPrompt.js","sourceRoot":"","sources":["../../../../../../lib/v3/agent/prompts/agentSystemPrompt.ts"],"names":[],"mappings":"AA0BA,SAAS,iBAAiB,CACxB,YAAqB,EACrB,SAAkB,EAClB,YAAuB;IAEvB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IAE/C,MAAM,WAAW,GAAqB;QACpC;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,4DAA4D;SAC1E;QACD;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EACT,+DAA+D;SAClE;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EACT,qFAAqF;SACxF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EACT,2FAA2F;SAC9F;QACD;YACE,IAAI,EAAE,KAAK;YACX,WAAW,EACT,0LAA0L;SAC7L;QACD,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAChE,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,8BAA8B,EAAE;QACrE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sBAAsB,EAAE;QACrD;YACE,IAAI,EAAE,gBAAgB;YAC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S,CAAC;YAChB,OAAO,WAAW;gBAChB,CAAC,CAAC,mBAAmB,IAAI,KAAK,WAAW,aAAa;gBACtD,CAAC,CAAC,mBAAmB,IAAI,MAAM,CAAC;QACpC,CAAC,CAAC;aACD,IAAI,CAAC,QAAQ,CAAC;eACN;QACX,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;IAEL,uBAAuB;YACf,KAAK,CAAC,oBAAoB,CAAC;iCACN,OAAO,KAAK,UAAU;;;;2DAII,GAAG;;;;;;;;;;;;IAY1D,yBAAyB;;;MAGvB,SAAS,CAAC,CAAC,CAAC,mFAAmF,CAAC,CAAC,CAAC,EAAE;;IAEtG,YAAY;;MAEV,eAAe;MACf,mBAAmB;;IAErB,iBAAiB;IACjB,gBAAgB;;;;;;;;UAQV,CAAC;AACX,CAAC","sourcesContent":["import type { AgentToolMode, Variables } from \"../../types/public/agent.js\";\n\nexport interface AgentSystemPromptOptions {\n url: string;\n executionInstruction: string;\n mode: AgentToolMode;\n systemInstructions?: string;\n /** Whether running on Browserbase (enables captcha solver messaging) */\n isBrowserbase?: boolean;\n /** Tools to exclude from the system prompt */\n excludeTools?: string[];\n /** Variables available to the agent for use in act/type tools */\n variables?: Variables;\n}\n\n/**\n * Builds the system prompt for the agent based on the tool mode.\n *\n * @param options - The prompt configuration options\n * @returns The formatted system prompt string\n */\ninterface ToolDefinition {\n name: string;\n description: string;\n}\n\nfunction buildToolsSection(\n isHybridMode: boolean,\n hasSearch: boolean,\n excludeTools?: string[],\n): string {\n const excludeSet = new Set(excludeTools ?? []);\n\n const hybridTools: ToolDefinition[] = [\n {\n name: \"screenshot\",\n description: \"Take a compressed JPEG screenshot for quick visual context\",\n },\n {\n name: \"ariaTree\",\n description:\n \"Get an accessibility (ARIA) hybrid tree for full page context\",\n },\n {\n name: \"click\",\n description:\n \"Click on an element (PREFERRED - more reliable when element is visible in viewport)\",\n },\n {\n name: \"type\",\n description:\n \"Type text into an element (PREFERRED - more reliable when element is visible in viewport)\",\n },\n {\n name: \"act\",\n description:\n \"Perform a specific atomic action (click, type, etc.) - ONLY use when element is in ariaTree but NOT visible in screenshot. Less reliable but can interact with out-of-viewport elements.\",\n },\n { name: \"dragAndDrop\", description: \"Drag and drop an element\" },\n { name: \"clickAndHold\", description: \"Click and hold on an element\" },\n { name: \"keys\", description: \"Press a keyboard key\" },\n {\n name: \"fillFormVision\",\n description: \"Fill out a form using coordinates\",\n },\n { name: \"think\", description: \"Think about the task\" },\n { name: \"extract\", description: \"Extract structured data\" },\n { name: \"goto\", description: \"Navigate to a URL\" },\n { name: \"wait\", description: \"Wait for a specified time\" },\n { name: \"navback\", description: \"Navigate back in browser history\" },\n { name: \"scroll\", description: \"Scroll the page x pixels up or down\" },\n ];\n\n const domTools: ToolDefinition[] = [\n {\n name: \"screenshot\",\n description: \"Take a compressed JPEG screenshot for quick visual context\",\n },\n {\n name: \"ariaTree\",\n description:\n \"Get an accessibility (ARIA) hybrid tree for full page context\",\n },\n {\n name: \"act\",\n description: \"Perform a specific atomic action (click, type)\",\n },\n { name: \"keys\", description: \"Press a keyboard key\" },\n { name: \"fillForm\", description: \"Fill out a form\" },\n { name: \"think\", description: \"Think about the task\" },\n { name: \"extract\", description: \"Extract structured data\" },\n { name: \"goto\", description: \"Navigate to a URL\" },\n { name: \"wait\", description: \"Wait for a specified time\" },\n { name: \"navback\", description: \"Navigate back in browser history\" },\n { name: \"scroll\", description: \"Scroll the page x pixels up or down\" },\n ];\n\n const baseTools = isHybridMode ? hybridTools : domTools;\n\n if (hasSearch) {\n baseTools.push({\n name: \"search\",\n description:\n \"Perform a web search and return results. Prefer this over navigating to Google and searching within the page for reliability and efficiency.\",\n });\n }\n\n const filteredTools = baseTools.filter((tool) => !excludeSet.has(tool.name));\n\n const toolLines = filteredTools\n .map((tool) => ` <tool name=\"${tool.name}\">${tool.description}</tool>`)\n .join(\"\\n\");\n\n return `<tools>\\n${toolLines}\\n </tools>`;\n}\n\nexport function buildAgentSystemPrompt(\n options: AgentSystemPromptOptions,\n): string {\n const {\n url,\n executionInstruction,\n mode,\n systemInstructions,\n isBrowserbase = false,\n excludeTools,\n variables,\n } = options;\n const localeDate = new Date().toLocaleDateString();\n const isoDate = new Date().toISOString();\n const cdata = (text: string) => `<![CDATA[${text}]]>`;\n\n const isHybridMode = mode === \"hybrid\";\n const hasSearch = Boolean(process.env.BRAVE_API_KEY);\n\n // Tools section differs based on mode and excluded tools\n const toolsSection = buildToolsSection(isHybridMode, hasSearch, excludeTools);\n\n // Strategy differs based on mode\n const strategyItems = isHybridMode\n ? [\n `<item>Tool selection priority: Use specific tools (click, type) when elements are visible in viewport for maximum reliability.</item>`,\n `<item>Always use screenshot to get proper grounding of the coordinates you want to type/click into.</item>`,\n `<item>When interacting with an input, always use the type tool to type into the input, over clicking and then typing into it.</item>`,\n `<item>Use ariaTree as a secondary tool when elements aren't visible in screenshot or to get full page context.</item>`,\n `<item>Only use act when element is in ariaTree but NOT visible in screenshot.</item>`,\n ]\n : [\n `<item>Tool selection priority: Use act tool for all clicking and typing on a page.</item>`,\n `<item>Always check ariaTree first to understand full page content without scrolling - it shows all elements including those below the fold.</item>`,\n `<item>When interacting with an input, always use the act tool to type into the input, over clicking and then typing.</item>`,\n `<item>If an element is present in the ariaTree, use act to interact with it directly - this eliminates the need to scroll.</item>`,\n `<item>Use screenshot for visual confirmation when needed, but rely primarily on ariaTree for element detection.</item>`,\n ];\n\n const strategySection = strategyItems.join(\"\\n \");\n\n const commonStrategyItems = `\n <item>CRITICAL: Use extract ONLY when the task explicitly requires structured data output (e.g., \"get job listings\", \"extract product details\"). For reading page content or understanding elements, always use ${isHybridMode ? \"screenshot or ariaTree\" : \"ariaTree\"} instead - it's faster and more reliable.</item>\n <item>Keep actions atomic and verify outcomes before proceeding.</item>\n <item>For each action, provide clear reasoning about why you're taking that step.</item>\n <item>When you need to input text that could be entered character-by-character or through multiple separate inputs, prefer using the keys tool to type the entire sequence at once. This is more efficient for scenarios like verification codes split across multiple fields, or when virtual keyboards are present but direct typing would be faster.</item>\n `;\n\n // Page understanding protocol differs based on mode\n const pageUnderstandingProtocol = isHybridMode\n ? `<page_understanding_protocol>\n <step_1>\n <title>UNDERSTAND THE PAGE</title>\n <primary_tool>\n <name>screenshot</name>\n <usage>Visual confirmation when needed. Ideally after navigating to a new page.</usage>\n </primary_tool>\n <secondary_tool>\n <name>ariaTree</name>\n <usage>Get complete page context before taking actions</usage>\n <benefit>Eliminates the need to scroll and provides full accessible content</benefit>\n </secondary_tool>\n </step_1>\n </page_understanding_protocol>`\n : `<page_understanding_protocol>\n <step_1>\n <title>UNDERSTAND THE PAGE</title>\n <primary_tool>\n <name>ariaTree</name>\n <usage>Get complete page context before taking actions</usage>\n <benefit>Eliminates the need to scroll and provides full accessible content</benefit>\n </primary_tool>\n <secondary_tool>\n <name>screenshot</name>\n <usage>Visual confirmation when needed. Ideally after navigating to a new page.</usage>\n </secondary_tool>\n </step_1>\n </page_understanding_protocol>`;\n\n // Roadblocks section only shown when running on Browserbase (has captcha solver)\n const roadblocksSection = isBrowserbase\n ? `<roadblocks>\n <note>captchas, popups, etc.</note>\n <captcha>If you see a captcha, use the wait tool. It will automatically be solved by our internal solver.</captcha>\n </roadblocks>`\n : \"\";\n\n // Build customInstructions block only if provided\n const customInstructionsBlock = systemInstructions\n ? `<customInstructions>${cdata(systemInstructions)}</customInstructions>\\n `\n : \"\";\n\n // Build variables section only if variables are provided\n const hasVariables = variables && Object.keys(variables).length > 0;\n const variableToolsNote = isHybridMode\n ? \"Use %variableName% syntax in the type, fillFormVision, or act tool's value/text/action fields.\"\n : \"Use %variableName% syntax in the act or fillForm tool's value/action fields.\";\n const variablesSection = hasVariables\n ? `<variables>\n <note>You have access to the following variables. Use %variableName% syntax to substitute variable values. This is especially important for sensitive data like passwords.</note>\n <usage>${variableToolsNote}</usage>\n <example>To type a password, use: type %password% into the password field</example>\n ${Object.entries(variables)\n .map(([name, v]) => {\n const description =\n typeof v === \"object\" && v !== null && \"value\" in v\n ? v.description\n : undefined;\n return description\n ? `<variable name=\"${name}\">${description}</variable>`\n : `<variable name=\"${name}\" />`;\n })\n .join(\"\\n \")}\n </variables>`\n : \"\";\n\n return `<system>\n <identity>You are a web automation assistant using browser automation tools to accomplish the user's goal.</identity>\n ${customInstructionsBlock}<task>\n <goal>${cdata(executionInstruction)}</goal>\n <date display=\"local\" iso=\"${isoDate}\">${localeDate}</date>\n <note>You may think the date is different due to knowledge cutoff, but this is the actual date.</note>\n </task>\n <page>\n <startingUrl>you are starting your task on this url: ${url}</startingUrl>\n </page>\n <mindset>\n <note>Be very intentional about your action. The initial instruction is very important, and slight variations of the actual goal can lead to failures.</note>\n <importantNote>If something fails to meet a single condition of the task, move on from it rather than seeing if it meets other criteria. We only care that it meets all of it</importantNote>\n <note>When the task is complete, do not seek more information; you have completed the task.</note>\n </mindset>\n <guidelines>\n <item>Always start by understanding the current page state</item>\n <item>Use the screenshot tool to verify page state when needed</item>\n <item>Use appropriate tools for each action</item>\n </guidelines>\n ${pageUnderstandingProtocol}\n <navigation>\n <rule>If you are confident in the URL, navigate directly to it.</rule>\n ${hasSearch ? `<rule>If you are not confident in the URL, use the search tool to find it.</rule>` : ``}\n </navigation>\n ${toolsSection}\n <strategy>\n ${strategySection}\n ${commonStrategyItems}\n </strategy>\n ${roadblocksSection}\n ${variablesSection}\n <completion>\n <note>When you complete the task, explain any information that was found that was relevant to the original task.</note>\n <examples>\n <example>If you were asked for specific flights, list the flights you found.</example>\n <example>If you were asked for information about a product, list the product information you were asked for.</example>\n </examples>\n </completion>\n</system>`;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { V3 } from "../../v3.js";
2
2
  import type { Action } from "../../types/public/methods.js";
3
- import type { AgentModelConfig } from "../../types/public/agent.js";
4
- export declare const actTool: (v3: V3, executionModel?: string | AgentModelConfig) => import("ai").Tool<{
3
+ import type { AgentModelConfig, Variables } from "../../types/public/agent.js";
4
+ export declare const actTool: (v3: V3, executionModel?: string | AgentModelConfig, variables?: Variables, toolTimeout?: number) => import("ai").Tool<{
5
5
  action: string;
6
6
  }, {
7
7
  success: boolean;
@@ -1,49 +1,71 @@
1
1
  import { tool } from "ai";
2
2
  import { z } from "zod";
3
- export const actTool = (v3, executionModel) => tool({
4
- description: "Perform an action on the page (click, type). Provide a short, specific phrase that mentions the element type.",
5
- inputSchema: z.object({
6
- action: z
7
- .string()
8
- .describe('Describe what to click or type, e.g. "click the Login button" or "type "John" into the first name input"'),
9
- }),
10
- execute: async ({ action }) => {
11
- try {
12
- v3.logger({
13
- category: "agent",
14
- message: `Agent calling tool: act`,
15
- level: 1,
16
- auxiliary: {
17
- arguments: {
18
- value: action,
19
- type: "string",
3
+ import { TimeoutError } from "../../types/public/sdkErrors.js";
4
+ export const actTool = (v3, executionModel, variables, toolTimeout) => {
5
+ const hasVariables = variables && Object.keys(variables).length > 0;
6
+ const actionDescription = hasVariables
7
+ ? `Describe what to click or type, e.g. "click the Login button" or "type %variableName% into the input". Available variables: ${Object.keys(variables).join(", ")}`
8
+ : 'Describe what to click or type, e.g. "click the Login button" or "type "John" into the first name input"';
9
+ return tool({
10
+ description: "Perform an action on the page (click, type). Provide a short, specific phrase that mentions the element type.",
11
+ inputSchema: z.object({
12
+ action: z.string().describe(actionDescription),
13
+ }),
14
+ execute: async ({ action }) => {
15
+ try {
16
+ v3.logger({
17
+ category: "agent",
18
+ message: `Agent calling tool: act`,
19
+ level: 1,
20
+ auxiliary: {
21
+ arguments: {
22
+ value: action,
23
+ type: "string",
24
+ },
20
25
  },
21
- },
22
- });
23
- const options = executionModel ? { model: executionModel } : undefined;
24
- const result = await v3.act(action, options);
25
- const actions = result.actions ?? [];
26
- v3.recordAgentReplayStep({
27
- type: "act",
28
- instruction: action,
29
- actions,
30
- actionDescription: result.actionDescription,
31
- message: result.message,
32
- });
33
- // Only include playwrightArguments when actions exist
34
- // (undefined is not valid JSON and breaks AI SDK validation)
35
- const response = {
36
- success: result.success ?? true,
37
- action: result?.actionDescription ?? action,
38
- };
39
- if (actions.length > 0) {
40
- response.playwrightArguments = actions[0];
26
+ });
27
+ const options = executionModel
28
+ ? { model: executionModel, variables, timeout: toolTimeout }
29
+ : { variables, timeout: toolTimeout };
30
+ const result = await v3.act(action, options);
31
+ const actions = result.actions ?? [];
32
+ v3.recordAgentReplayStep({
33
+ type: "act",
34
+ instruction: action,
35
+ actions,
36
+ actionDescription: result.actionDescription,
37
+ message: result.message,
38
+ });
39
+ // Only include playwrightArguments when actions exist
40
+ // (undefined is not valid JSON and breaks AI SDK validation)
41
+ const response = {
42
+ success: result.success ?? true,
43
+ action: result?.actionDescription ?? action,
44
+ };
45
+ if (actions.length > 0) {
46
+ response.playwrightArguments = actions[0];
47
+ }
48
+ return response;
41
49
  }
42
- return response;
43
- }
44
- catch (error) {
45
- return { success: false, error: error?.message ?? String(error) };
46
- }
47
- },
48
- });
50
+ catch (error) {
51
+ if (error instanceof TimeoutError) {
52
+ const timeoutMessage = `TimeoutError while waiting for act() to complete (it may continue executing in the background)`;
53
+ v3.logger({
54
+ category: "agent",
55
+ message: timeoutMessage,
56
+ level: 0,
57
+ });
58
+ return {
59
+ success: false,
60
+ error: `${timeoutMessage} — try using a different description for the action`,
61
+ };
62
+ }
63
+ return {
64
+ success: false,
65
+ error: error?.message ?? String(error),
66
+ };
67
+ }
68
+ },
69
+ });
70
+ };
49
71
  //# sourceMappingURL=act.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"act.js","sourceRoot":"","sources":["../../../../../../lib/v3/agent/tools/act.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAM,EAAE,cAA0C,EAAE,EAAE,CAC5E,IAAI,CAAC;IACH,WAAW,EACT,+GAA+G;IACjH,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,CAAC;aACN,MAAM,EAA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AAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACpE,CAAC;IACH,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport type { V3 } from \"../../v3.js\";\nimport type { Action } from \"../../types/public/methods.js\";\nimport type { AgentModelConfig } from \"../../types/public/agent.js\";\n\nexport const actTool = (v3: V3, executionModel?: string | AgentModelConfig) =>\n tool({\n description:\n \"Perform an action on the page (click, type). Provide a short, specific phrase that mentions the element type.\",\n inputSchema: z.object({\n action: z\n .string()\n .describe(\n 'Describe what to click or type, e.g. \"click the Login button\" or \"type \"John\" into the first name input\"',\n ),\n }),\n execute: async ({ action }) => {\n try {\n v3.logger({\n category: \"agent\",\n message: `Agent calling tool: act`,\n level: 1,\n auxiliary: {\n arguments: {\n value: action,\n type: \"string\",\n },\n },\n });\n const options = executionModel ? { model: executionModel } : undefined;\n const result = await v3.act(action, options);\n const actions = (result.actions as Action[] | undefined) ?? [];\n v3.recordAgentReplayStep({\n type: \"act\",\n instruction: action,\n actions,\n actionDescription: result.actionDescription,\n message: result.message,\n });\n // Only include playwrightArguments when actions exist\n // (undefined is not valid JSON and breaks AI SDK validation)\n const response: {\n success: boolean;\n action: string;\n playwrightArguments?: Action;\n } = {\n success: result.success ?? true,\n action: result?.actionDescription ?? action,\n };\n if (actions.length > 0) {\n response.playwrightArguments = actions[0];\n }\n return response;\n } catch (error) {\n return { success: false, error: error?.message ?? String(error) };\n }\n },\n });\n"]}
1
+ {"version":3,"file":"act.js","sourceRoot":"","sources":["../../../../../../lib/v3/agent/tools/act.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,EAAM,EACN,cAA0C,EAC1C,SAAqB,EACrB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iBAAiB;oBAC3C,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC,CAAC;gBACH,sDAAsD;gBACtD,6DAA6D;gBAC7D,MAAM,QAAQ,GAIV;oBACF,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI;oBAC/B,MAAM,EAAE,MAAM,EAAE,iBAAiB,IAAI,MAAM;iBAC5C,CAAC;gBACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACvB,QAAQ,CAAC,mBAAmB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC5C,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;oBAClC,MAAM,cAAc,GAAG,gGAAgG,CAAC;oBACxH,EAAE,CAAC,MAAM,CAAC;wBACR,QAAQ,EAAE,OAAO;wBACjB,OAAO,EAAE,cAAc;wBACvB,KAAK,EAAE,CAAC;qBACT,CAAC,CAAC;oBACH,OAAO;wBACL,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,GAAG,cAAc,qDAAqD;qBAC9E,CAAC;gBACJ,CAAC;gBACD,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC;iBACvC,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport type { V3 } from \"../../v3.js\";\nimport type { Action } from \"../../types/public/methods.js\";\nimport type { AgentModelConfig, Variables } from \"../../types/public/agent.js\";\nimport { TimeoutError } from \"../../types/public/sdkErrors.js\";\n\nexport const actTool = (\n v3: V3,\n executionModel?: string | AgentModelConfig,\n variables?: Variables,\n toolTimeout?: number,\n) => {\n const hasVariables = variables && Object.keys(variables).length > 0;\n const actionDescription = hasVariables\n ? `Describe what to click or type, e.g. \"click the Login button\" or \"type %variableName% into the input\". Available variables: ${Object.keys(variables).join(\", \")}`\n : 'Describe what to click or type, e.g. \"click the Login button\" or \"type \"John\" into the first name input\"';\n\n return tool({\n description:\n \"Perform an action on the page (click, type). Provide a short, specific phrase that mentions the element type.\",\n inputSchema: z.object({\n action: z.string().describe(actionDescription),\n }),\n execute: async ({ action }) => {\n try {\n v3.logger({\n category: \"agent\",\n message: `Agent calling tool: act`,\n level: 1,\n auxiliary: {\n arguments: {\n value: action,\n type: \"string\",\n },\n },\n });\n const options = executionModel\n ? { model: executionModel, variables, timeout: toolTimeout }\n : { variables, timeout: toolTimeout };\n\n const result = await v3.act(action, options);\n const actions = (result.actions as Action[] | undefined) ?? [];\n v3.recordAgentReplayStep({\n type: \"act\",\n instruction: action,\n actions,\n actionDescription: result.actionDescription,\n message: result.message,\n });\n // Only include playwrightArguments when actions exist\n // (undefined is not valid JSON and breaks AI SDK validation)\n const response: {\n success: boolean;\n action: string;\n playwrightArguments?: Action;\n } = {\n success: result.success ?? true,\n action: result?.actionDescription ?? action,\n };\n if (actions.length > 0) {\n response.playwrightArguments = actions[0];\n }\n return response;\n } catch (error) {\n if (error instanceof TimeoutError) {\n const timeoutMessage = `TimeoutError while waiting for act() to complete (it may continue executing in the background)`;\n v3.logger({\n category: \"agent\",\n message: timeoutMessage,\n level: 0,\n });\n return {\n success: false,\n error: `${timeoutMessage} — try using a different description for the action`,\n };\n }\n return {\n success: false,\n error: error?.message ?? String(error),\n };\n }\n },\n });\n};\n"]}
@@ -1,5 +1,12 @@
1
1
  import type { V3 } from "../../v3.js";
2
- export declare const ariaTreeTool: (v3: V3) => import("ai").Tool<Record<string, never>, {
2
+ export declare const ariaTreeTool: (v3: V3, toolTimeout?: number) => import("ai").Tool<Record<string, never>, {
3
+ success: boolean;
3
4
  content: string;
4
5
  pageUrl: string;
6
+ error?: undefined;
7
+ } | {
8
+ content: string;
9
+ error: any;
10
+ success: boolean;
11
+ pageUrl: string;
5
12
  }>;