@browserbasehq/orca 3.0.9-alpha-3 → 3.1.0-patch.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/lib/inference.d.ts +65 -0
- package/dist/esm/lib/inference.js +333 -0
- package/dist/esm/lib/inference.js.map +1 -0
- package/dist/esm/lib/inferenceLogUtils.d.ts +12 -0
- package/dist/esm/lib/inferenceLogUtils.js +92 -0
- package/dist/esm/lib/inferenceLogUtils.js.map +1 -0
- package/dist/esm/lib/logger.d.ts +69 -0
- package/dist/esm/lib/logger.js +323 -0
- package/dist/esm/lib/logger.js.map +1 -0
- package/dist/esm/lib/modelUtils.d.ts +14 -0
- package/dist/esm/lib/modelUtils.js +48 -0
- package/dist/esm/lib/modelUtils.js.map +1 -0
- package/dist/esm/lib/prompt.d.ts +14 -0
- package/dist/esm/lib/prompt.js +230 -0
- package/dist/esm/lib/prompt.js.map +1 -0
- package/dist/esm/lib/utils.d.ts +68 -0
- package/dist/esm/lib/utils.js +654 -0
- package/dist/esm/lib/utils.js.map +1 -0
- package/dist/esm/lib/v3/agent/AgentClient.d.ts +19 -0
- package/dist/esm/lib/v3/agent/AgentClient.js +17 -0
- package/dist/esm/lib/v3/agent/AgentClient.js.map +1 -0
- package/dist/esm/lib/v3/agent/AgentProvider.d.ts +20 -0
- package/dist/esm/lib/v3/agent/AgentProvider.js +77 -0
- package/dist/esm/lib/v3/agent/AgentProvider.js.map +1 -0
- package/dist/esm/lib/v3/agent/AnthropicCUAClient.d.ts +57 -0
- package/dist/esm/lib/v3/agent/AnthropicCUAClient.js +822 -0
- package/dist/esm/lib/v3/agent/AnthropicCUAClient.js.map +1 -0
- package/dist/esm/lib/v3/agent/GoogleCUAClient.d.ts +74 -0
- package/dist/esm/lib/v3/agent/GoogleCUAClient.js +799 -0
- package/dist/esm/lib/v3/agent/GoogleCUAClient.js.map +1 -0
- package/dist/esm/lib/v3/agent/MicrosoftCUAClient.d.ts +71 -0
- package/dist/esm/lib/v3/agent/MicrosoftCUAClient.js +770 -0
- package/dist/esm/lib/v3/agent/MicrosoftCUAClient.js.map +1 -0
- package/dist/esm/lib/v3/agent/OpenAICUAClient.d.ts +69 -0
- package/dist/esm/lib/v3/agent/OpenAICUAClient.js +615 -0
- package/dist/esm/lib/v3/agent/OpenAICUAClient.js.map +1 -0
- package/dist/esm/lib/v3/agent/prompts/agentSystemPrompt.d.ts +12 -0
- package/dist/esm/lib/v3/agent/prompts/agentSystemPrompt.js +186 -0
- package/dist/esm/lib/v3/agent/prompts/agentSystemPrompt.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/act.d.ts +13 -0
- package/dist/esm/lib/v3/agent/tools/act.js +49 -0
- package/dist/esm/lib/v3/agent/tools/act.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/ariaTree.d.ts +5 -0
- package/dist/esm/lib/v3/agent/tools/ariaTree.js +31 -0
- package/dist/esm/lib/v3/agent/tools/ariaTree.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/click.d.ts +6 -0
- package/dist/esm/lib/v3/agent/tools/click.js +104 -0
- package/dist/esm/lib/v3/agent/tools/click.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/clickAndHold.d.ts +14 -0
- package/dist/esm/lib/v3/agent/tools/clickAndHold.js +68 -0
- package/dist/esm/lib/v3/agent/tools/clickAndHold.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/dragAndDrop.d.ts +7 -0
- package/dist/esm/lib/v3/agent/tools/dragAndDrop.js +105 -0
- package/dist/esm/lib/v3/agent/tools/dragAndDrop.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/extract.d.ts +21 -0
- package/dist/esm/lib/v3/agent/tools/extract.js +93 -0
- package/dist/esm/lib/v3/agent/tools/extract.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/fillFormVision.d.ts +12 -0
- package/dist/esm/lib/v3/agent/tools/fillFormVision.js +143 -0
- package/dist/esm/lib/v3/agent/tools/fillFormVision.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/fillform.d.ts +13 -0
- package/dist/esm/lib/v3/agent/tools/fillform.js +56 -0
- package/dist/esm/lib/v3/agent/tools/fillform.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/goto.d.ts +12 -0
- package/dist/esm/lib/v3/agent/tools/goto.js +31 -0
- package/dist/esm/lib/v3/agent/tools/goto.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/index.d.ts +92 -0
- package/dist/esm/lib/v3/agent/tools/index.js +74 -0
- package/dist/esm/lib/v3/agent/tools/index.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/keys.d.ts +24 -0
- package/dist/esm/lib/v3/agent/tools/keys.js +60 -0
- package/dist/esm/lib/v3/agent/tools/keys.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/navback.d.ts +6 -0
- package/dist/esm/lib/v3/agent/tools/navback.js +23 -0
- package/dist/esm/lib/v3/agent/tools/navback.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/screenshot.d.ts +6 -0
- package/dist/esm/lib/v3/agent/tools/screenshot.js +26 -0
- package/dist/esm/lib/v3/agent/tools/screenshot.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/scroll.d.ts +19 -0
- package/dist/esm/lib/v3/agent/tools/scroll.js +142 -0
- package/dist/esm/lib/v3/agent/tools/scroll.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/search.d.ts +15 -0
- package/dist/esm/lib/v3/agent/tools/search.js +73 -0
- package/dist/esm/lib/v3/agent/tools/search.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/think.d.ts +6 -0
- package/dist/esm/lib/v3/agent/tools/think.js +24 -0
- package/dist/esm/lib/v3/agent/tools/think.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/type.d.ts +7 -0
- package/dist/esm/lib/v3/agent/tools/type.js +106 -0
- package/dist/esm/lib/v3/agent/tools/type.js.map +1 -0
- package/dist/esm/lib/v3/agent/tools/wait.d.ts +5 -0
- package/dist/esm/lib/v3/agent/tools/wait.js +53 -0
- package/dist/esm/lib/v3/agent/tools/wait.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/actionMapping.d.ts +3 -0
- package/dist/esm/lib/v3/agent/utils/actionMapping.js +100 -0
- package/dist/esm/lib/v3/agent/utils/actionMapping.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/coordinateNormalization.d.ts +13 -0
- package/dist/esm/lib/v3/agent/utils/coordinateNormalization.js +28 -0
- package/dist/esm/lib/v3/agent/utils/coordinateNormalization.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/cuaKeyMapping.d.ts +10 -0
- package/dist/esm/lib/v3/agent/utils/cuaKeyMapping.js +62 -0
- package/dist/esm/lib/v3/agent/utils/cuaKeyMapping.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/googleCustomToolHandler.d.ts +25 -0
- package/dist/esm/lib/v3/agent/utils/googleCustomToolHandler.js +145 -0
- package/dist/esm/lib/v3/agent/utils/googleCustomToolHandler.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.d.ts +22 -0
- package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js +101 -0
- package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/imageCompression.d.ts +53 -0
- package/dist/esm/lib/v3/agent/utils/imageCompression.js +204 -0
- package/dist/esm/lib/v3/agent/utils/imageCompression.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/messageProcessing.d.ts +12 -0
- package/dist/esm/lib/v3/agent/utils/messageProcessing.js +164 -0
- package/dist/esm/lib/v3/agent/utils/messageProcessing.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/screenshotHandler.d.ts +10 -0
- package/dist/esm/lib/v3/agent/utils/screenshotHandler.js +26 -0
- package/dist/esm/lib/v3/agent/utils/screenshotHandler.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/validateExperimentalFeatures.d.ts +26 -0
- package/dist/esm/lib/v3/agent/utils/validateExperimentalFeatures.js +79 -0
- package/dist/esm/lib/v3/agent/utils/validateExperimentalFeatures.js.map +1 -0
- package/dist/esm/lib/v3/agent/utils/xpath.d.ts +11 -0
- package/dist/esm/lib/v3/agent/utils/xpath.js +19 -0
- package/dist/esm/lib/v3/agent/utils/xpath.js.map +1 -0
- package/dist/esm/lib/v3/api.d.ts +86 -0
- package/dist/esm/lib/v3/api.js +484 -0
- package/dist/esm/lib/v3/api.js.map +1 -0
- package/dist/esm/lib/v3/cache/ActCache.d.ts +23 -0
- package/dist/esm/lib/v3/cache/ActCache.js +292 -0
- package/dist/esm/lib/v3/cache/ActCache.js.map +1 -0
- package/dist/esm/lib/v3/cache/AgentCache.d.ts +109 -0
- package/dist/esm/lib/v3/cache/AgentCache.js +640 -0
- package/dist/esm/lib/v3/cache/AgentCache.js.map +1 -0
- package/dist/esm/lib/v3/cache/CacheStorage.d.ts +17 -0
- package/dist/esm/lib/v3/cache/CacheStorage.js +98 -0
- package/dist/esm/lib/v3/cache/CacheStorage.js.map +1 -0
- package/dist/esm/lib/v3/cache/serverAgentCache.d.ts +7 -0
- package/dist/esm/lib/v3/cache/serverAgentCache.js +49 -0
- package/dist/esm/lib/v3/cache/serverAgentCache.js.map +1 -0
- package/dist/esm/lib/v3/cache/utils.d.ts +15 -0
- package/dist/esm/lib/v3/cache/utils.js +39 -0
- package/dist/esm/lib/v3/cache/utils.js.map +1 -0
- package/dist/esm/lib/v3/dom/a11yScripts/index.d.ts +11 -0
- package/dist/esm/lib/v3/dom/a11yScripts/index.js +117 -0
- package/dist/esm/lib/v3/dom/a11yScripts/index.js.map +1 -0
- package/dist/esm/lib/v3/dom/build/a11yScripts.generated.d.ts +16 -0
- package/dist/esm/lib/v3/dom/build/a11yScripts.generated.js +20 -0
- package/dist/esm/lib/v3/dom/build/a11yScripts.generated.js.map +1 -0
- package/dist/esm/lib/v3/dom/build/locatorScripts.generated.d.ts +52 -0
- package/dist/esm/lib/v3/dom/build/locatorScripts.generated.js +56 -0
- package/dist/esm/lib/v3/dom/build/locatorScripts.generated.js.map +1 -0
- package/dist/esm/lib/v3/dom/build/reRenderScriptContent.d.ts +1 -0
- package/dist/esm/lib/v3/dom/build/reRenderScriptContent.js +2 -0
- package/dist/esm/lib/v3/dom/build/reRenderScriptContent.js.map +1 -0
- package/dist/esm/lib/v3/dom/build/rerender-index.js +1 -0
- package/dist/esm/lib/v3/dom/build/screenshotScripts.generated.d.ts +4 -0
- package/dist/esm/lib/v3/dom/build/screenshotScripts.generated.js +8 -0
- package/dist/esm/lib/v3/dom/build/screenshotScripts.generated.js.map +1 -0
- package/dist/esm/lib/v3/dom/build/scriptV3Content.d.ts +1 -0
- package/dist/esm/lib/v3/dom/build/scriptV3Content.js +2 -0
- package/dist/esm/lib/v3/dom/build/scriptV3Content.js.map +1 -0
- package/dist/esm/lib/v3/dom/build/v3-index.js +1 -0
- package/dist/esm/lib/v3/dom/genA11yScripts.d.ts +1 -0
- package/dist/esm/lib/v3/dom/genA11yScripts.js +54 -0
- package/dist/esm/lib/v3/dom/genA11yScripts.js.map +1 -0
- package/dist/esm/lib/v3/dom/genDomScripts.d.ts +1 -0
- package/dist/esm/lib/v3/dom/genDomScripts.js +38 -0
- package/dist/esm/lib/v3/dom/genDomScripts.js.map +1 -0
- package/dist/esm/lib/v3/dom/genLocatorScripts.d.ts +1 -0
- package/dist/esm/lib/v3/dom/genLocatorScripts.js +51 -0
- package/dist/esm/lib/v3/dom/genLocatorScripts.js.map +1 -0
- package/dist/esm/lib/v3/dom/genScreenshotScripts.d.ts +1 -0
- package/dist/esm/lib/v3/dom/genScreenshotScripts.js +37 -0
- package/dist/esm/lib/v3/dom/genScreenshotScripts.js.map +1 -0
- package/dist/esm/lib/v3/dom/index.d.ts +1 -0
- package/dist/esm/lib/v3/dom/index.js +2 -0
- package/dist/esm/lib/v3/dom/index.js.map +1 -0
- package/dist/esm/lib/v3/dom/locatorScripts/counts.d.ts +15 -0
- package/dist/esm/lib/v3/dom/locatorScripts/counts.js +272 -0
- package/dist/esm/lib/v3/dom/locatorScripts/counts.js.map +1 -0
- package/dist/esm/lib/v3/dom/locatorScripts/index.d.ts +4 -0
- package/dist/esm/lib/v3/dom/locatorScripts/index.js +5 -0
- package/dist/esm/lib/v3/dom/locatorScripts/index.js.map +1 -0
- package/dist/esm/lib/v3/dom/locatorScripts/scripts.d.ts +37 -0
- package/dist/esm/lib/v3/dom/locatorScripts/scripts.js +458 -0
- package/dist/esm/lib/v3/dom/locatorScripts/scripts.js.map +1 -0
- package/dist/esm/lib/v3/dom/locatorScripts/selectors.d.ts +4 -0
- package/dist/esm/lib/v3/dom/locatorScripts/selectors.js +283 -0
- package/dist/esm/lib/v3/dom/locatorScripts/selectors.js.map +1 -0
- package/dist/esm/lib/v3/dom/locatorScripts/waitForSelector.d.ts +19 -0
- package/dist/esm/lib/v3/dom/locatorScripts/waitForSelector.js +283 -0
- package/dist/esm/lib/v3/dom/locatorScripts/waitForSelector.js.map +1 -0
- package/dist/esm/lib/v3/dom/locatorScripts/xpathParser.d.ts +76 -0
- package/dist/esm/lib/v3/dom/locatorScripts/xpathParser.js +376 -0
- package/dist/esm/lib/v3/dom/locatorScripts/xpathParser.js.map +1 -0
- package/dist/esm/lib/v3/dom/locatorScripts/xpathResolver.d.ts +9 -0
- package/dist/esm/lib/v3/dom/locatorScripts/xpathResolver.js +196 -0
- package/dist/esm/lib/v3/dom/locatorScripts/xpathResolver.js.map +1 -0
- package/dist/esm/lib/v3/dom/piercer.entry.d.ts +1 -0
- package/dist/esm/lib/v3/dom/piercer.entry.js +3 -0
- package/dist/esm/lib/v3/dom/piercer.entry.js.map +1 -0
- package/dist/esm/lib/v3/dom/piercer.runtime.d.ts +23 -0
- package/dist/esm/lib/v3/dom/piercer.runtime.js +90 -0
- package/dist/esm/lib/v3/dom/piercer.runtime.js.map +1 -0
- package/dist/esm/lib/v3/dom/rerenderMissingShadows.entry.d.ts +1 -0
- package/dist/esm/lib/v3/dom/rerenderMissingShadows.entry.js +3 -0
- package/dist/esm/lib/v3/dom/rerenderMissingShadows.entry.js.map +1 -0
- package/dist/esm/lib/v3/dom/rerenderMissingShadows.runtime.d.ts +1 -0
- package/dist/esm/lib/v3/dom/rerenderMissingShadows.runtime.js +40 -0
- package/dist/esm/lib/v3/dom/rerenderMissingShadows.runtime.js.map +1 -0
- package/dist/esm/lib/v3/dom/screenshotScripts/index.d.ts +1 -0
- package/dist/esm/lib/v3/dom/screenshotScripts/index.js +2 -0
- package/dist/esm/lib/v3/dom/screenshotScripts/index.js.map +1 -0
- package/dist/esm/lib/v3/dom/screenshotScripts/resolveMaskRect.d.ts +8 -0
- package/dist/esm/lib/v3/dom/screenshotScripts/resolveMaskRect.js +82 -0
- package/dist/esm/lib/v3/dom/screenshotScripts/resolveMaskRect.js.map +1 -0
- package/dist/esm/lib/v3/external_clients/aisdk.d.ts +11 -0
- package/dist/esm/lib/v3/external_clients/aisdk.js +103 -0
- package/dist/esm/lib/v3/external_clients/aisdk.js.map +1 -0
- package/dist/esm/lib/v3/external_clients/customOpenAI.d.ts +18 -0
- package/dist/esm/lib/v3/external_clients/customOpenAI.js +220 -0
- package/dist/esm/lib/v3/external_clients/customOpenAI.js.map +1 -0
- package/dist/esm/lib/v3/flowLogger.d.ts +139 -0
- package/dist/esm/lib/v3/flowLogger.js +868 -0
- package/dist/esm/lib/v3/flowLogger.js.map +1 -0
- package/dist/esm/lib/v3/handlers/actHandler.d.ts +21 -0
- package/dist/esm/lib/v3/handlers/actHandler.js +340 -0
- package/dist/esm/lib/v3/handlers/actHandler.js.map +1 -0
- package/dist/esm/lib/v3/handlers/extractHandler.d.ts +31 -0
- package/dist/esm/lib/v3/handlers/extractHandler.js +139 -0
- package/dist/esm/lib/v3/handlers/extractHandler.js.map +1 -0
- package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.d.ts +24 -0
- package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js +623 -0
- package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js.map +1 -0
- package/dist/esm/lib/v3/handlers/handlerUtils/timeoutGuard.d.ts +2 -0
- package/dist/esm/lib/v3/handlers/handlerUtils/timeoutGuard.js +14 -0
- package/dist/esm/lib/v3/handlers/handlerUtils/timeoutGuard.js.map +1 -0
- package/dist/esm/lib/v3/handlers/observeHandler.d.ts +17 -0
- package/dist/esm/lib/v3/handlers/observeHandler.js +156 -0
- package/dist/esm/lib/v3/handlers/observeHandler.js.map +1 -0
- package/dist/esm/lib/v3/handlers/v3AgentHandler.d.ts +32 -0
- package/dist/esm/lib/v3/handlers/v3AgentHandler.js +461 -0
- package/dist/esm/lib/v3/handlers/v3AgentHandler.js.map +1 -0
- package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.d.ts +33 -0
- package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js +528 -0
- package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -0
- package/dist/esm/lib/v3/index.d.ts +17 -0
- package/dist/esm/lib/v3/index.js +13 -0
- package/dist/esm/lib/v3/index.js.map +1 -0
- package/dist/esm/lib/v3/launch/browserbase.d.ts +7 -0
- package/dist/esm/lib/v3/launch/browserbase.js +46 -0
- package/dist/esm/lib/v3/launch/browserbase.js.map +1 -0
- package/dist/esm/lib/v3/launch/local.d.ts +15 -0
- package/dist/esm/lib/v3/launch/local.js +98 -0
- package/dist/esm/lib/v3/launch/local.js.map +1 -0
- package/dist/esm/lib/v3/llm/AnthropicClient.d.ts +16 -0
- package/dist/esm/lib/v3/llm/AnthropicClient.js +239 -0
- package/dist/esm/lib/v3/llm/AnthropicClient.js.map +1 -0
- package/dist/esm/lib/v3/llm/CerebrasClient.d.ts +17 -0
- package/dist/esm/lib/v3/llm/CerebrasClient.js +235 -0
- package/dist/esm/lib/v3/llm/CerebrasClient.js.map +1 -0
- package/dist/esm/lib/v3/llm/GoogleClient.d.ts +19 -0
- package/dist/esm/lib/v3/llm/GoogleClient.js +369 -0
- package/dist/esm/lib/v3/llm/GoogleClient.js.map +1 -0
- package/dist/esm/lib/v3/llm/GroqClient.d.ts +17 -0
- package/dist/esm/lib/v3/llm/GroqClient.js +236 -0
- package/dist/esm/lib/v3/llm/GroqClient.js.map +1 -0
- package/dist/esm/lib/v3/llm/LLMClient.d.ts +121 -0
- package/dist/esm/lib/v3/llm/LLMClient.js +23 -0
- package/dist/esm/lib/v3/llm/LLMClient.js.map +1 -0
- package/dist/esm/lib/v3/llm/LLMProvider.d.ts +13 -0
- package/dist/esm/lib/v3/llm/LLMProvider.js +194 -0
- package/dist/esm/lib/v3/llm/LLMProvider.js.map +1 -0
- package/dist/esm/lib/v3/llm/OpenAIClient.d.ts +15 -0
- package/dist/esm/lib/v3/llm/OpenAIClient.js +329 -0
- package/dist/esm/lib/v3/llm/OpenAIClient.js.map +1 -0
- package/dist/esm/lib/v3/llm/aisdk.d.ts +15 -0
- package/dist/esm/lib/v3/llm/aisdk.js +348 -0
- package/dist/esm/lib/v3/llm/aisdk.js.map +1 -0
- package/dist/esm/lib/v3/logger.d.ts +9 -0
- package/dist/esm/lib/v3/logger.js +96 -0
- package/dist/esm/lib/v3/logger.js.map +1 -0
- package/dist/esm/lib/v3/mcp/connection.d.ts +11 -0
- package/dist/esm/lib/v3/mcp/connection.js +49 -0
- package/dist/esm/lib/v3/mcp/connection.js.map +1 -0
- package/dist/esm/lib/v3/mcp/utils.d.ts +3 -0
- package/dist/esm/lib/v3/mcp/utils.js +36 -0
- package/dist/esm/lib/v3/mcp/utils.js.map +1 -0
- package/dist/esm/lib/v3/shutdown/cleanupLocal.d.ts +14 -0
- package/dist/esm/lib/v3/shutdown/cleanupLocal.js +30 -0
- package/dist/esm/lib/v3/shutdown/cleanupLocal.js.map +1 -0
- package/dist/esm/lib/v3/shutdown/supervisor.d.ts +9 -0
- package/dist/esm/lib/v3/shutdown/supervisor.js +156 -0
- package/dist/esm/lib/v3/shutdown/supervisor.js.map +1 -0
- package/dist/esm/lib/v3/shutdown/supervisorClient.d.ts +15 -0
- package/dist/esm/lib/v3/shutdown/supervisorClient.js +97 -0
- package/dist/esm/lib/v3/shutdown/supervisorClient.js.map +1 -0
- package/dist/esm/lib/v3/tests/agent-abort-signal.spec.js +113 -0
- package/dist/esm/lib/v3/tests/agent-abort-signal.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/agent-cache-self-heal.spec.js +80 -0
- package/dist/esm/lib/v3/tests/agent-cache-self-heal.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/agent-callbacks.spec.js +374 -0
- package/dist/esm/lib/v3/tests/agent-callbacks.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/agent-experimental-validation.spec.js +357 -0
- package/dist/esm/lib/v3/tests/agent-experimental-validation.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/agent-hybrid-mode.spec.js +247 -0
- package/dist/esm/lib/v3/tests/agent-hybrid-mode.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/agent-message-continuation.spec.js +105 -0
- package/dist/esm/lib/v3/tests/agent-message-continuation.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/agent-streaming.spec.js +126 -0
- package/dist/esm/lib/v3/tests/agent-streaming.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/cdp-session-detached.spec.js +44 -0
- package/dist/esm/lib/v3/tests/cdp-session-detached.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/click-count.spec.js +112 -0
- package/dist/esm/lib/v3/tests/click-count.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/connect-to-existing-browser.spec.js +54 -0
- package/dist/esm/lib/v3/tests/connect-to-existing-browser.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/context-addInitScript.spec.js +176 -0
- package/dist/esm/lib/v3/tests/context-addInitScript.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/default-page-tracking.spec.js +53 -0
- package/dist/esm/lib/v3/tests/default-page-tracking.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/downloads.spec.js +58 -0
- package/dist/esm/lib/v3/tests/downloads.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/envReporter.js +57 -0
- package/dist/esm/lib/v3/tests/envReporter.js.map +7 -0
- package/dist/esm/lib/v3/tests/frame-get-location-and-click.spec.js +53 -0
- package/dist/esm/lib/v3/tests/frame-get-location-and-click.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/iframe-ctx-addInitScript.spec.js +447 -0
- package/dist/esm/lib/v3/tests/iframe-ctx-addInitScript.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/keep-alive.child.js +92 -0
- package/dist/esm/lib/v3/tests/keep-alive.child.js.map +7 -0
- package/dist/esm/lib/v3/tests/keep-alive.helpers.js +532 -0
- package/dist/esm/lib/v3/tests/keep-alive.helpers.js.map +7 -0
- package/dist/esm/lib/v3/tests/keep-alive.spec.js +19 -0
- package/dist/esm/lib/v3/tests/keep-alive.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/keyboard.spec.js +296 -0
- package/dist/esm/lib/v3/tests/keyboard.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-backend-node-id.spec.js +159 -0
- package/dist/esm/lib/v3/tests/locator-backend-node-id.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-content-methods.spec.js +191 -0
- package/dist/esm/lib/v3/tests/locator-content-methods.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-count-iframe.spec.js +108 -0
- package/dist/esm/lib/v3/tests/locator-count-iframe.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-count.spec.js +71 -0
- package/dist/esm/lib/v3/tests/locator-count.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-fill.spec.js +118 -0
- package/dist/esm/lib/v3/tests/locator-fill.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-input-methods.spec.js +136 -0
- package/dist/esm/lib/v3/tests/locator-input-methods.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-nth.spec.js +157 -0
- package/dist/esm/lib/v3/tests/locator-nth.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/locator-select-option.spec.js +242 -0
- package/dist/esm/lib/v3/tests/locator-select-option.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/logger-initialization.spec.js +552 -0
- package/dist/esm/lib/v3/tests/logger-initialization.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/multi-instance-logger.spec.js +269 -0
- package/dist/esm/lib/v3/tests/multi-instance-logger.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/nested-div.spec.js +23 -0
- package/dist/esm/lib/v3/tests/nested-div.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-addInitScript.spec.js +90 -0
- package/dist/esm/lib/v3/tests/page-addInitScript.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-console.spec.js +56 -0
- package/dist/esm/lib/v3/tests/page-console.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-drag-and-drop.spec.js +418 -0
- package/dist/esm/lib/v3/tests/page-drag-and-drop.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-goto-response.spec.js +35 -0
- package/dist/esm/lib/v3/tests/page-goto-response.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-hover.spec.js +167 -0
- package/dist/esm/lib/v3/tests/page-hover.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-screenshot.spec.js +273 -0
- package/dist/esm/lib/v3/tests/page-screenshot.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-scroll.spec.js +182 -0
- package/dist/esm/lib/v3/tests/page-scroll.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/page-send-cdp.spec.js +46 -0
- package/dist/esm/lib/v3/tests/page-send-cdp.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/perform-understudy-method.spec.js +98 -0
- package/dist/esm/lib/v3/tests/perform-understudy-method.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/setinputfiles.spec.js +126 -0
- package/dist/esm/lib/v3/tests/setinputfiles.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/shadow-iframe-oopif.spec.js +134 -0
- package/dist/esm/lib/v3/tests/shadow-iframe-oopif.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/shadow-iframe-spif.spec.js +134 -0
- package/dist/esm/lib/v3/tests/shadow-iframe-spif.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/testUtils.js +31 -0
- package/dist/esm/lib/v3/tests/testUtils.js.map +7 -0
- package/dist/esm/lib/v3/tests/text-selector-innermost.spec.js +100 -0
- package/dist/esm/lib/v3/tests/text-selector-innermost.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/timeouts.spec.js +32 -0
- package/dist/esm/lib/v3/tests/timeouts.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/user-data-dir.spec.js +43 -0
- package/dist/esm/lib/v3/tests/user-data-dir.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/v3.config.js +15 -0
- package/dist/esm/lib/v3/tests/v3.config.js.map +7 -0
- package/dist/esm/lib/v3/tests/v3.dynamic.config.js +43 -0
- package/dist/esm/lib/v3/tests/v3.dynamic.config.js.map +7 -0
- package/dist/esm/lib/v3/tests/v3.playwright.config.js +98 -0
- package/dist/esm/lib/v3/tests/v3.playwright.config.js.map +7 -0
- package/dist/esm/lib/v3/tests/wait-for-selector.spec.js +593 -0
- package/dist/esm/lib/v3/tests/wait-for-selector.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/wait-for-timeout.spec.js +97 -0
- package/dist/esm/lib/v3/tests/wait-for-timeout.spec.js.map +7 -0
- package/dist/esm/lib/v3/tests/xpath-for-location-deep.spec.js +77 -0
- package/dist/esm/lib/v3/tests/xpath-for-location-deep.spec.js.map +7 -0
- package/dist/esm/lib/v3/timeoutConfig.d.ts +2 -0
- package/dist/esm/lib/v3/timeoutConfig.js +27 -0
- package/dist/esm/lib/v3/timeoutConfig.js.map +1 -0
- package/dist/esm/lib/v3/types/private/agent.d.ts +6 -0
- package/dist/esm/lib/v3/types/private/agent.js +2 -0
- package/dist/esm/lib/v3/types/private/agent.js.map +1 -0
- package/dist/esm/lib/v3/types/private/api.d.ts +11 -0
- package/dist/esm/lib/v3/types/private/api.js +2 -0
- package/dist/esm/lib/v3/types/private/api.js.map +1 -0
- package/dist/esm/lib/v3/types/private/cache.d.ts +128 -0
- package/dist/esm/lib/v3/types/private/cache.js +2 -0
- package/dist/esm/lib/v3/types/private/cache.js.map +1 -0
- package/dist/esm/lib/v3/types/private/evaluator.d.ts +40 -0
- package/dist/esm/lib/v3/types/private/evaluator.js +2 -0
- package/dist/esm/lib/v3/types/private/evaluator.js.map +1 -0
- package/dist/esm/lib/v3/types/private/handlers.d.ts +38 -0
- package/dist/esm/lib/v3/types/private/handlers.js +16 -0
- package/dist/esm/lib/v3/types/private/handlers.js.map +1 -0
- package/dist/esm/lib/v3/types/private/index.d.ts +7 -0
- package/dist/esm/lib/v3/types/private/index.js +8 -0
- package/dist/esm/lib/v3/types/private/index.js.map +1 -0
- package/dist/esm/lib/v3/types/private/internal.d.ts +39 -0
- package/dist/esm/lib/v3/types/private/internal.js +2 -0
- package/dist/esm/lib/v3/types/private/internal.js.map +1 -0
- package/dist/esm/lib/v3/types/private/locator.d.ts +9 -0
- package/dist/esm/lib/v3/types/private/locator.js +2 -0
- package/dist/esm/lib/v3/types/private/locator.js.map +1 -0
- package/dist/esm/lib/v3/types/private/network.d.ts +34 -0
- package/dist/esm/lib/v3/types/private/network.js +3 -0
- package/dist/esm/lib/v3/types/private/network.js.map +1 -0
- package/dist/esm/lib/v3/types/private/shutdown.d.ts +31 -0
- package/dist/esm/lib/v3/types/private/shutdown.js +5 -0
- package/dist/esm/lib/v3/types/private/shutdown.js.map +1 -0
- package/dist/esm/lib/v3/types/private/shutdownErrors.d.ts +12 -0
- package/dist/esm/lib/v3/types/private/shutdownErrors.js +22 -0
- package/dist/esm/lib/v3/types/private/shutdownErrors.js.map +1 -0
- package/dist/esm/lib/v3/types/private/snapshot.d.ts +117 -0
- package/dist/esm/lib/v3/types/private/snapshot.js +2 -0
- package/dist/esm/lib/v3/types/private/snapshot.js.map +1 -0
- package/dist/esm/lib/v3/types/public/agent.d.ts +595 -0
- package/dist/esm/lib/v3/types/public/agent.js +15 -0
- package/dist/esm/lib/v3/types/public/agent.js.map +1 -0
- package/dist/esm/lib/v3/types/public/api.d.ts +1211 -0
- package/dist/esm/lib/v3/types/public/api.js +915 -0
- package/dist/esm/lib/v3/types/public/api.js.map +1 -0
- package/dist/esm/lib/v3/types/public/apiErrors.d.ts +18 -0
- package/dist/esm/lib/v3/types/public/apiErrors.js +32 -0
- package/dist/esm/lib/v3/types/public/apiErrors.js.map +1 -0
- package/dist/esm/lib/v3/types/public/index.d.ts +12 -0
- package/dist/esm/lib/v3/types/public/index.js +14 -0
- package/dist/esm/lib/v3/types/public/index.js.map +1 -0
- package/dist/esm/lib/v3/types/public/locator.d.ts +9 -0
- package/dist/esm/lib/v3/types/public/locator.js +2 -0
- package/dist/esm/lib/v3/types/public/locator.js.map +1 -0
- package/dist/esm/lib/v3/types/public/logs.d.ts +23 -0
- package/dist/esm/lib/v3/types/public/logs.js +13 -0
- package/dist/esm/lib/v3/types/public/logs.js.map +1 -0
- package/dist/esm/lib/v3/types/public/methods.d.ts +56 -0
- package/dist/esm/lib/v3/types/public/methods.js +15 -0
- package/dist/esm/lib/v3/types/public/methods.js.map +1 -0
- package/dist/esm/lib/v3/types/public/metrics.d.ts +27 -0
- package/dist/esm/lib/v3/types/public/metrics.js +2 -0
- package/dist/esm/lib/v3/types/public/metrics.js.map +1 -0
- package/dist/esm/lib/v3/types/public/model.d.ts +65 -0
- package/dist/esm/lib/v3/types/public/model.js +2 -0
- package/dist/esm/lib/v3/types/public/model.js.map +1 -0
- package/dist/esm/lib/v3/types/public/options.d.ts +70 -0
- package/dist/esm/lib/v3/types/public/options.js +4 -0
- package/dist/esm/lib/v3/types/public/options.js.map +1 -0
- package/dist/esm/lib/v3/types/public/page.d.ts +18 -0
- package/dist/esm/lib/v3/types/public/page.js +3 -0
- package/dist/esm/lib/v3/types/public/page.js.map +1 -0
- package/dist/esm/lib/v3/types/public/screenshotTypes.d.ts +25 -0
- package/dist/esm/lib/v3/types/public/screenshotTypes.js +2 -0
- package/dist/esm/lib/v3/types/public/screenshotTypes.js.map +1 -0
- package/dist/esm/lib/v3/types/public/sdkErrors.d.ts +152 -0
- package/dist/esm/lib/v3/types/public/sdkErrors.js +305 -0
- package/dist/esm/lib/v3/types/public/sdkErrors.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/a11yTree.d.ts +15 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/a11yTree.js +196 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/a11yTree.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/activeElement.d.ts +8 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/activeElement.js +121 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/activeElement.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/capture.d.ts +77 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/capture.js +336 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/capture.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/coordinateResolver.d.ts +7 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/coordinateResolver.js +129 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/coordinateResolver.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/domTree.d.ts +46 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/domTree.js +274 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/domTree.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/focusSelectors.d.ts +24 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/focusSelectors.js +216 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/focusSelectors.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/index.d.ts +4 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/index.js +5 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/index.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/sessions.d.ts +16 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/sessions.js +22 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/sessions.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/treeFormatUtils.d.ts +28 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js +135 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/xpathUtils.d.ts +26 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/xpathUtils.js +102 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/xpathUtils.js.map +1 -0
- package/dist/esm/lib/v3/understudy/a11yInvocation.d.ts +8 -0
- package/dist/esm/lib/v3/understudy/a11yInvocation.js +12 -0
- package/dist/esm/lib/v3/understudy/a11yInvocation.js.map +1 -0
- package/dist/esm/lib/v3/understudy/cdp.d.ts +69 -0
- package/dist/esm/lib/v3/understudy/cdp.js +251 -0
- package/dist/esm/lib/v3/understudy/cdp.js.map +1 -0
- package/dist/esm/lib/v3/understudy/consoleMessage.d.ts +22 -0
- package/dist/esm/lib/v3/understudy/consoleMessage.js +66 -0
- package/dist/esm/lib/v3/understudy/consoleMessage.js.map +1 -0
- package/dist/esm/lib/v3/understudy/context.d.ts +132 -0
- package/dist/esm/lib/v3/understudy/context.js +687 -0
- package/dist/esm/lib/v3/understudy/context.js.map +1 -0
- package/dist/esm/lib/v3/understudy/deepLocator.d.ts +87 -0
- package/dist/esm/lib/v3/understudy/deepLocator.js +218 -0
- package/dist/esm/lib/v3/understudy/deepLocator.js.map +1 -0
- package/dist/esm/lib/v3/understudy/executionContextRegistry.d.ts +15 -0
- package/dist/esm/lib/v3/understudy/executionContextRegistry.js +83 -0
- package/dist/esm/lib/v3/understudy/executionContextRegistry.js.map +1 -0
- package/dist/esm/lib/v3/understudy/fileUploadUtils.d.ts +13 -0
- package/dist/esm/lib/v3/understudy/fileUploadUtils.js +81 -0
- package/dist/esm/lib/v3/understudy/fileUploadUtils.js.map +1 -0
- package/dist/esm/lib/v3/understudy/frame.d.ts +69 -0
- package/dist/esm/lib/v3/understudy/frame.js +211 -0
- package/dist/esm/lib/v3/understudy/frame.js.map +1 -0
- package/dist/esm/lib/v3/understudy/frameLocator.d.ts +50 -0
- package/dist/esm/lib/v3/understudy/frameLocator.js +255 -0
- package/dist/esm/lib/v3/understudy/frameLocator.js.map +1 -0
- package/dist/esm/lib/v3/understudy/frameRegistry.d.ts +101 -0
- package/dist/esm/lib/v3/understudy/frameRegistry.js +298 -0
- package/dist/esm/lib/v3/understudy/frameRegistry.js.map +1 -0
- package/dist/esm/lib/v3/understudy/initScripts.d.ts +2 -0
- package/dist/esm/lib/v3/understudy/initScripts.js +33 -0
- package/dist/esm/lib/v3/understudy/initScripts.js.map +1 -0
- package/dist/esm/lib/v3/understudy/lifecycleWatcher.d.ts +64 -0
- package/dist/esm/lib/v3/understudy/lifecycleWatcher.js +245 -0
- package/dist/esm/lib/v3/understudy/lifecycleWatcher.js.map +1 -0
- package/dist/esm/lib/v3/understudy/locator.d.ts +194 -0
- package/dist/esm/lib/v3/understudy/locator.js +753 -0
- package/dist/esm/lib/v3/understudy/locator.js.map +1 -0
- package/dist/esm/lib/v3/understudy/locatorInvocation.d.ts +8 -0
- package/dist/esm/lib/v3/understudy/locatorInvocation.js +12 -0
- package/dist/esm/lib/v3/understudy/locatorInvocation.js.map +1 -0
- package/dist/esm/lib/v3/understudy/navigationResponseTracker.d.ts +84 -0
- package/dist/esm/lib/v3/understudy/navigationResponseTracker.js +224 -0
- package/dist/esm/lib/v3/understudy/navigationResponseTracker.js.map +1 -0
- package/dist/esm/lib/v3/understudy/networkManager.d.ts +53 -0
- package/dist/esm/lib/v3/understudy/networkManager.js +306 -0
- package/dist/esm/lib/v3/understudy/networkManager.js.map +1 -0
- package/dist/esm/lib/v3/understudy/page.d.ts +354 -0
- package/dist/esm/lib/v3/understudy/page.js +1941 -0
- package/dist/esm/lib/v3/understudy/page.js.map +1 -0
- package/dist/esm/lib/v3/understudy/piercer.d.ts +4 -0
- package/dist/esm/lib/v3/understudy/piercer.js +61 -0
- package/dist/esm/lib/v3/understudy/piercer.js.map +1 -0
- package/dist/esm/lib/v3/understudy/response.d.ts +137 -0
- package/dist/esm/lib/v3/understudy/response.js +330 -0
- package/dist/esm/lib/v3/understudy/response.js.map +1 -0
- package/dist/esm/lib/v3/understudy/screenshotUtils.d.ts +16 -0
- package/dist/esm/lib/v3/understudy/screenshotUtils.js +352 -0
- package/dist/esm/lib/v3/understudy/screenshotUtils.js.map +1 -0
- package/dist/esm/lib/v3/understudy/selectorResolver.d.ts +38 -0
- package/dist/esm/lib/v3/understudy/selectorResolver.js +296 -0
- package/dist/esm/lib/v3/understudy/selectorResolver.js.map +1 -0
- package/dist/esm/lib/v3/v3.d.ts +191 -0
- package/dist/esm/lib/v3/v3.js +1572 -0
- package/dist/esm/lib/v3/v3.js.map +1 -0
- package/dist/esm/lib/v3/zodCompat.d.ts +12 -0
- package/dist/esm/lib/v3/zodCompat.js +17 -0
- package/dist/esm/lib/v3/zodCompat.js.map +1 -0
- package/dist/esm/lib/v3Evaluator.d.ts +19 -0
- package/dist/esm/lib/v3Evaluator.js +210 -0
- package/dist/esm/lib/v3Evaluator.js.map +1 -0
- package/dist/esm/lib/version.d.ts +5 -0
- package/dist/esm/lib/version.js +6 -0
- package/dist/esm/lib/version.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/tests/agent-execution-model.test.js +139 -0
- package/dist/esm/tests/agent-execution-model.test.js.map +7 -0
- package/dist/esm/tests/browserbase-session-accessors.test.js +101 -0
- package/dist/esm/tests/browserbase-session-accessors.test.js.map +7 -0
- package/dist/esm/tests/cache-llm-resolution.test.js +187 -0
- package/dist/esm/tests/cache-llm-resolution.test.js.map +7 -0
- package/dist/esm/tests/helpers/mockCDPSession.js +27 -0
- package/dist/esm/tests/helpers/mockCDPSession.js.map +7 -0
- package/dist/esm/tests/llm-provider.test.js +57 -0
- package/dist/esm/tests/llm-provider.test.js.map +7 -0
- package/dist/esm/tests/model-deprecation.test.js +135 -0
- package/dist/esm/tests/model-deprecation.test.js.map +7 -0
- package/dist/esm/tests/model-utils.test.js +43 -0
- package/dist/esm/tests/model-utils.test.js.map +7 -0
- package/dist/esm/tests/page-snapshot.test.js +36 -0
- package/dist/esm/tests/page-snapshot.test.js.map +7 -0
- package/dist/esm/tests/public-api/export-surface.test.js +53 -0
- package/dist/esm/tests/public-api/export-surface.test.js.map +7 -0
- package/dist/esm/tests/public-api/llm-and-agents.test.js +128 -0
- package/dist/esm/tests/public-api/llm-and-agents.test.js.map +7 -0
- package/dist/esm/tests/public-api/public-error-types.test.js +71 -0
- package/dist/esm/tests/public-api/public-error-types.test.js.map +7 -0
- package/dist/esm/tests/public-api/public-types.test.js +74 -0
- package/dist/esm/tests/public-api/public-types.test.js.map +7 -0
- package/dist/esm/tests/public-api/runtime-utils.test.js +31 -0
- package/dist/esm/tests/public-api/runtime-utils.test.js.map +7 -0
- package/dist/esm/tests/public-api/schema-utils.test.js +78 -0
- package/dist/esm/tests/public-api/schema-utils.test.js.map +7 -0
- package/dist/esm/tests/public-api/timeout-error-types.test.js +81 -0
- package/dist/esm/tests/public-api/timeout-error-types.test.js.map +7 -0
- package/dist/esm/tests/public-api/tool-type-export.test.js +25 -0
- package/dist/esm/tests/public-api/tool-type-export.test.js.map +7 -0
- package/dist/esm/tests/public-api/v3-core.test.js +82 -0
- package/dist/esm/tests/public-api/v3-core.test.js.map +7 -0
- package/dist/esm/tests/safety-confirmation.test.js +134 -0
- package/dist/esm/tests/safety-confirmation.test.js.map +7 -0
- package/dist/esm/tests/snapshot-a11y-resolvers.test.js +348 -0
- package/dist/esm/tests/snapshot-a11y-resolvers.test.js.map +7 -0
- package/dist/esm/tests/snapshot-a11y-tree-utils.test.js +300 -0
- package/dist/esm/tests/snapshot-a11y-tree-utils.test.js.map +7 -0
- package/dist/esm/tests/snapshot-capture-orchestration.test.js +381 -0
- package/dist/esm/tests/snapshot-capture-orchestration.test.js.map +7 -0
- package/dist/esm/tests/snapshot-cbor.test.js +197 -0
- package/dist/esm/tests/snapshot-cbor.test.js.map +7 -0
- package/dist/esm/tests/snapshot-dom-session-builders.test.js +251 -0
- package/dist/esm/tests/snapshot-dom-session-builders.test.js.map +7 -0
- package/dist/esm/tests/snapshot-dom-tree-utils.test.js +109 -0
- package/dist/esm/tests/snapshot-dom-tree-utils.test.js.map +7 -0
- package/dist/esm/tests/snapshot-focus-selectors-utils.test.js +49 -0
- package/dist/esm/tests/snapshot-focus-selectors-utils.test.js.map +7 -0
- package/dist/esm/tests/snapshot-frame-merge.test.js +391 -0
- package/dist/esm/tests/snapshot-frame-merge.test.js.map +7 -0
- package/dist/esm/tests/snapshot-tree-format-utils.test.js +113 -0
- package/dist/esm/tests/snapshot-tree-format-utils.test.js.map +7 -0
- package/dist/esm/tests/snapshot-xpath-utils.test.js +79 -0
- package/dist/esm/tests/snapshot-xpath-utils.test.js.map +7 -0
- package/dist/esm/tests/timeout-handlers.test.js +850 -0
- package/dist/esm/tests/timeout-handlers.test.js.map +7 -0
- package/dist/esm/tests/xpath-parser.test.js +317 -0
- package/dist/esm/tests/xpath-parser.test.js.map +7 -0
- package/dist/esm/tests/xpath-resolver.test.js +73 -0
- package/dist/esm/tests/xpath-resolver.test.js.map +7 -0
- package/dist/esm/tests/zod-enum-compatibility.test.js +97 -0
- package/dist/esm/tests/zod-enum-compatibility.test.js.map +7 -0
- package/package.json +42 -27
- package/dist/index.d.ts +0 -4321
- package/dist/index.js +0 -69585
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
export function buildUserInstructionsString(userProvidedInstructions) {
|
|
2
|
+
if (!userProvidedInstructions) {
|
|
3
|
+
return "";
|
|
4
|
+
}
|
|
5
|
+
return `\n\n# Custom Instructions Provided by the User
|
|
6
|
+
|
|
7
|
+
Please keep the user's instructions in mind when performing actions. If the user's instructions are not relevant to the current task, ignore them.
|
|
8
|
+
|
|
9
|
+
User Instructions:
|
|
10
|
+
${userProvidedInstructions}`;
|
|
11
|
+
}
|
|
12
|
+
// extract
|
|
13
|
+
export function buildExtractSystemPrompt(isUsingPrintExtractedDataTool = false, userProvidedInstructions) {
|
|
14
|
+
const baseContent = `You are extracting content on behalf of a user.
|
|
15
|
+
If a user asks you to extract a 'list' of information, or 'all' information,
|
|
16
|
+
YOU MUST EXTRACT ALL OF THE INFORMATION THAT THE USER REQUESTS.
|
|
17
|
+
|
|
18
|
+
You will be given:
|
|
19
|
+
1. An instruction
|
|
20
|
+
2. `;
|
|
21
|
+
const contentDetail = `A list of DOM elements to extract from.`;
|
|
22
|
+
const instructions = `
|
|
23
|
+
Print the exact text from the DOM elements with all symbols, characters, and endlines as is.
|
|
24
|
+
Print null or an empty string if no new information is found.
|
|
25
|
+
`.trim();
|
|
26
|
+
const toolInstructions = isUsingPrintExtractedDataTool
|
|
27
|
+
? `
|
|
28
|
+
ONLY print the content using the print_extracted_data tool provided.
|
|
29
|
+
ONLY print the content using the print_extracted_data tool provided.
|
|
30
|
+
`.trim()
|
|
31
|
+
: "";
|
|
32
|
+
const additionalInstructions = "If a user is attempting to extract links or URLs, you MUST respond with ONLY the IDs of the link elements. \n" +
|
|
33
|
+
"Do not attempt to extract links directly from the text unless absolutely necessary. ";
|
|
34
|
+
const userInstructions = buildUserInstructionsString(userProvidedInstructions);
|
|
35
|
+
const content = `${baseContent}${contentDetail}\n\n${instructions}\n${toolInstructions}${additionalInstructions ? `\n\n${additionalInstructions}` : ""}${userInstructions ? `\n\n${userInstructions}` : ""}`.replace(/\s+/g, " ");
|
|
36
|
+
return {
|
|
37
|
+
role: "system",
|
|
38
|
+
content,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function buildExtractUserPrompt(instruction, domElements, isUsingPrintExtractedDataTool = false) {
|
|
42
|
+
let content = `Instruction: ${instruction}
|
|
43
|
+
DOM: ${domElements}`;
|
|
44
|
+
if (isUsingPrintExtractedDataTool) {
|
|
45
|
+
content += `
|
|
46
|
+
ONLY print the content using the print_extracted_data tool provided.
|
|
47
|
+
ONLY print the content using the print_extracted_data tool provided.`;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
role: "user",
|
|
51
|
+
content,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const metadataSystemPrompt = `You are an AI assistant tasked with evaluating the progress and completion status of an extraction task.
|
|
55
|
+
Analyze the extraction response and determine if the task is completed or if more information is needed.
|
|
56
|
+
Strictly abide by the following criteria:
|
|
57
|
+
1. Once the instruction has been satisfied by the current extraction response, ALWAYS set completion status to true and stop processing, regardless of remaining chunks.
|
|
58
|
+
2. Only set completion status to false if BOTH of these conditions are true:
|
|
59
|
+
- The instruction has not been satisfied yet
|
|
60
|
+
- There are still chunks left to process (chunksTotal > chunksSeen)`;
|
|
61
|
+
export function buildMetadataSystemPrompt() {
|
|
62
|
+
return {
|
|
63
|
+
role: "system",
|
|
64
|
+
content: metadataSystemPrompt,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function buildMetadataPrompt(instruction, extractionResponse) {
|
|
68
|
+
return {
|
|
69
|
+
role: "user",
|
|
70
|
+
content: `Instruction: ${instruction}
|
|
71
|
+
Extracted content: ${JSON.stringify(extractionResponse, null, 2)}`,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
// observe
|
|
75
|
+
export function buildObserveSystemPrompt(userProvidedInstructions, supportedActions) {
|
|
76
|
+
const actionsString = supportedActions?.length
|
|
77
|
+
? `\n\nSupported actions: ${supportedActions.join(", ")}`
|
|
78
|
+
: "";
|
|
79
|
+
const observeSystemPrompt = `
|
|
80
|
+
You are helping the user automate the browser by finding elements based on what the user wants to observe in the page.
|
|
81
|
+
|
|
82
|
+
You will be given:
|
|
83
|
+
1. a instruction of elements to observe
|
|
84
|
+
2. a hierarchical accessibility tree showing the semantic structure of the page. The tree is a hybrid of the DOM and the accessibility tree.
|
|
85
|
+
|
|
86
|
+
Return an array of elements that match the instruction if they exist, otherwise return an empty array.
|
|
87
|
+
When returning elements, include the appropriate method from the supported actions list.${actionsString}. When choosing non-left click actions, provide right or middle as the argument.`;
|
|
88
|
+
const content = observeSystemPrompt.replace(/\s+/g, " ");
|
|
89
|
+
return {
|
|
90
|
+
role: "system",
|
|
91
|
+
content: [content, buildUserInstructionsString(userProvidedInstructions)]
|
|
92
|
+
.filter(Boolean)
|
|
93
|
+
.join("\n\n"),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function buildObserveUserMessage(instruction, domElements) {
|
|
97
|
+
return {
|
|
98
|
+
role: "user",
|
|
99
|
+
content: `instruction: ${instruction}
|
|
100
|
+
Accessibility Tree: \n${domElements}\n`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export function buildActSystemPrompt(userProvidedInstructions) {
|
|
104
|
+
const actSystemPrompt = `
|
|
105
|
+
You are helping the user automate the browser by finding elements based on what action the user wants to take on the page
|
|
106
|
+
|
|
107
|
+
You will be given:
|
|
108
|
+
1. a user defined instruction about what action to take
|
|
109
|
+
2. a hierarchical accessibility tree showing the semantic structure of the page. The tree is a hybrid of the DOM and the accessibility tree.
|
|
110
|
+
|
|
111
|
+
Return the element that matches the instruction if it exists. Otherwise, return an empty object.`;
|
|
112
|
+
const content = actSystemPrompt.replace(/\s+/g, " ");
|
|
113
|
+
return {
|
|
114
|
+
role: "system",
|
|
115
|
+
content: [content, buildUserInstructionsString(userProvidedInstructions)]
|
|
116
|
+
.filter(Boolean)
|
|
117
|
+
.join("\n\n"),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export function buildActPrompt(action, supportedActions, variables) {
|
|
121
|
+
// Base instruction
|
|
122
|
+
let instruction = `Find the most relevant element to perform an action on given the following action: ${action}.
|
|
123
|
+
IF AND ONLY IF the action EXPLICITLY includes the word 'dropdown' and implies choosing/selecting an option from a dropdown, ignore the 'General Instructions' section, and follow the 'Dropdown Specific Instructions' section carefully.
|
|
124
|
+
|
|
125
|
+
General Instructions:
|
|
126
|
+
Provide an action for this element such as ${supportedActions.join(", ")}. Remember that to users, buttons and links look the same in most cases.
|
|
127
|
+
When choosing non-left click actions, provide right or middle as the argument
|
|
128
|
+
If the action is completely unrelated to a potential action to be taken on the page, return an empty object.
|
|
129
|
+
ONLY return one action. If multiple actions are relevant, return the most relevant one.
|
|
130
|
+
If the user is asking to scroll to a position on the page, e.g., 'halfway' or 0.75, etc, you must return the argument formatted as the correct percentage, e.g., '50%' or '75%', etc.
|
|
131
|
+
If the user is asking to scroll to the next chunk/previous chunk, choose the nextChunk/prevChunk method. No arguments are required here.
|
|
132
|
+
If the action implies a key press, e.g., 'press enter', 'press a', 'press space', etc., always choose the press method with the appropriate key as argument — e.g. 'a', 'Enter', 'Space'. Do not choose a click action on an on-screen keyboard. Capitalize the first character like 'Enter', 'Tab', 'Escape' only for special keys.
|
|
133
|
+
|
|
134
|
+
Dropdown Specific Instructions:
|
|
135
|
+
For interacting with dropdowns, there are two specific cases that you need to handle.
|
|
136
|
+
|
|
137
|
+
CASE 1: the element is a 'select' element.
|
|
138
|
+
- choose the selectOptionFromDropdown method,
|
|
139
|
+
- set the argument to the exact text of the option that should be selected,
|
|
140
|
+
- set twoStep to false.
|
|
141
|
+
CASE 2: the element is NOT a 'select' element:
|
|
142
|
+
- do not attempt to directly choose the element from the dropdown. You will need to click to expand the dropdown first. You will achieve this by following these instructions:
|
|
143
|
+
- choose the node that most closely corresponds to the given instruction EVEN if it is a 'StaticText' element, or otherwise does not appear to be interactable.
|
|
144
|
+
- choose the 'click' method
|
|
145
|
+
- set twoStep to true.
|
|
146
|
+
`;
|
|
147
|
+
// Add variable names (not values) to the instruction if any
|
|
148
|
+
if (variables && Object.keys(variables).length > 0) {
|
|
149
|
+
const variableNames = Object.keys(variables)
|
|
150
|
+
.map((key) => `%${key}%`)
|
|
151
|
+
.join(", ");
|
|
152
|
+
const variablesPrompt = `The following variables are available to use in the action: ${variableNames}. Fill the argument variables with the variable name.`;
|
|
153
|
+
instruction += ` ${variablesPrompt}`;
|
|
154
|
+
}
|
|
155
|
+
return instruction;
|
|
156
|
+
}
|
|
157
|
+
export function buildStepTwoPrompt(originalUserAction, previousAction, supportedActions, variables) {
|
|
158
|
+
// Base instruction
|
|
159
|
+
let instruction = `
|
|
160
|
+
The original user action was: ${originalUserAction}.
|
|
161
|
+
You have just taken the following action which completed step 1 of 2: ${previousAction}.
|
|
162
|
+
|
|
163
|
+
Now, you must find the most relevant element to perform an action on in order to complete step 2 of 2.
|
|
164
|
+
|
|
165
|
+
General Instructions:
|
|
166
|
+
Provide an action for this element such as ${supportedActions.join(", ")}. Remember that to users, buttons and links look the same in most cases.
|
|
167
|
+
If the action is completely unrelated to a potential action to be taken on the page, return an empty object.
|
|
168
|
+
ONLY return one action. If multiple actions are relevant, return the most relevant one.
|
|
169
|
+
If the user is asking to scroll to a position on the page, e.g., 'halfway' or 0.75, etc, you must return the argument formatted as the correct percentage, e.g., '50%' or '75%', etc.
|
|
170
|
+
If the user is asking to scroll to the next chunk/previous chunk, choose the nextChunk/prevChunk method. No arguments are required here.
|
|
171
|
+
If the action implies a key press, e.g., 'press enter', 'press a', 'press space', etc., always choose the press method with the appropriate key as argument — e.g. 'a', 'Enter', 'Space'. Do not choose a click action on an on-screen keyboard. Capitalize the first character like 'Enter', 'Tab', 'Escape' only for special keys.
|
|
172
|
+
`;
|
|
173
|
+
// Add variable names (not values) to the instruction if any
|
|
174
|
+
if (variables && Object.keys(variables).length > 0) {
|
|
175
|
+
const variableNames = Object.keys(variables)
|
|
176
|
+
.map((key) => `%${key}%`)
|
|
177
|
+
.join(", ");
|
|
178
|
+
const variablesPrompt = `The following variables are available to use in the action: ${variableNames}. Fill the argument variables with the variable name.`;
|
|
179
|
+
instruction += ` ${variablesPrompt}`;
|
|
180
|
+
}
|
|
181
|
+
return instruction;
|
|
182
|
+
}
|
|
183
|
+
export function buildOperatorSystemPrompt(goal) {
|
|
184
|
+
return {
|
|
185
|
+
role: "system",
|
|
186
|
+
content: `You are a general-purpose agent whose job is to accomplish the user's goal across multiple model calls by running actions on the page.
|
|
187
|
+
|
|
188
|
+
You will be given a goal and a list of steps that have been taken so far. Your job is to determine if either the user's goal has been completed or if there are still steps that need to be taken.
|
|
189
|
+
|
|
190
|
+
# Your current goal
|
|
191
|
+
${goal}
|
|
192
|
+
|
|
193
|
+
# CRITICAL: You MUST use the provided tools to take actions. Do not just describe what you want to do - actually call the appropriate tools.
|
|
194
|
+
|
|
195
|
+
# Available tools and when to use them:
|
|
196
|
+
- \`act\`: Use this to interact with the page (click, type, navigate, etc.)
|
|
197
|
+
- \`extract\`: Use this to get information from the page
|
|
198
|
+
- \`goto\`: Use this to navigate to a specific URL
|
|
199
|
+
- \`wait\`: Use this to wait for a period of time
|
|
200
|
+
- \`navback\`: Use this to go back to the previous page
|
|
201
|
+
- \`refresh\`: Use this to refresh the current page
|
|
202
|
+
- \`close\`: Use this ONLY when the task is complete or cannot be achieved
|
|
203
|
+
- External tools: Use any additional tools (like search tools) as needed for your goal
|
|
204
|
+
|
|
205
|
+
# Important guidelines
|
|
206
|
+
1. ALWAYS use tools - never just provide text responses about what you plan to do
|
|
207
|
+
2. Break down complex actions into individual atomic steps
|
|
208
|
+
3. For \`act\` commands, use only one action at a time, such as:
|
|
209
|
+
- Single click on a specific element
|
|
210
|
+
- Type into a single input field
|
|
211
|
+
- Select a single option
|
|
212
|
+
4. Avoid combining multiple actions in one instruction
|
|
213
|
+
5. If multiple actions are needed, they should be separate steps
|
|
214
|
+
6. Only use \`close\` when the task is genuinely complete or impossible to achieve`,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export function buildCuaDefaultSystemPrompt() {
|
|
218
|
+
return `You are a helpful assistant that can use a web browser.\nDo not ask follow up questions, the user will trust your judgement. Today's date is ${new Date().toISOString().split("T")[0]}.`;
|
|
219
|
+
}
|
|
220
|
+
export function buildGoogleCUASystemPrompt() {
|
|
221
|
+
return {
|
|
222
|
+
role: "system",
|
|
223
|
+
content: `You are a general-purpose browser agent whose job is to accomplish the user's goal.
|
|
224
|
+
Today's date is ${new Date().toISOString().split("T")[0]}.
|
|
225
|
+
You have access to a search tool; however, in most cases you should operate within the page/url the user has provided. ONLY use the search tool if you're stuck or the task is impossible to complete within the current page.
|
|
226
|
+
You will be given a goal and a list of steps that have been taken so far. Avoid requesting the user for input as much as possible. Good luck!
|
|
227
|
+
`,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../lib/prompt.ts"],"names":[],"mappings":"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","sourcesContent":["import { ChatMessage } from \"./v3/llm/LLMClient.js\";\n\nexport function buildUserInstructionsString(\n userProvidedInstructions?: string,\n): string {\n if (!userProvidedInstructions) {\n return \"\";\n }\n\n return `\\n\\n# Custom Instructions Provided by the User\n \nPlease keep the user's instructions in mind when performing actions. If the user's instructions are not relevant to the current task, ignore them.\n\nUser Instructions:\n${userProvidedInstructions}`;\n}\n\n// extract\nexport function buildExtractSystemPrompt(\n isUsingPrintExtractedDataTool: boolean = false,\n userProvidedInstructions?: string,\n): ChatMessage {\n const baseContent = `You are extracting content on behalf of a user.\n If a user asks you to extract a 'list' of information, or 'all' information, \n YOU MUST EXTRACT ALL OF THE INFORMATION THAT THE USER REQUESTS.\n \n You will be given:\n1. An instruction\n2. `;\n\n const contentDetail = `A list of DOM elements to extract from.`;\n\n const instructions = `\nPrint the exact text from the DOM elements with all symbols, characters, and endlines as is.\nPrint null or an empty string if no new information is found.\n `.trim();\n\n const toolInstructions = isUsingPrintExtractedDataTool\n ? `\nONLY print the content using the print_extracted_data tool provided.\nONLY print the content using the print_extracted_data tool provided.\n `.trim()\n : \"\";\n\n const additionalInstructions =\n \"If a user is attempting to extract links or URLs, you MUST respond with ONLY the IDs of the link elements. \\n\" +\n \"Do not attempt to extract links directly from the text unless absolutely necessary. \";\n\n const userInstructions = buildUserInstructionsString(\n userProvidedInstructions,\n );\n\n const content =\n `${baseContent}${contentDetail}\\n\\n${instructions}\\n${toolInstructions}${\n additionalInstructions ? `\\n\\n${additionalInstructions}` : \"\"\n }${userInstructions ? `\\n\\n${userInstructions}` : \"\"}`.replace(/\\s+/g, \" \");\n\n return {\n role: \"system\",\n content,\n };\n}\n\nexport function buildExtractUserPrompt(\n instruction: string,\n domElements: string,\n isUsingPrintExtractedDataTool: boolean = false,\n): ChatMessage {\n let content = `Instruction: ${instruction}\nDOM: ${domElements}`;\n\n if (isUsingPrintExtractedDataTool) {\n content += `\nONLY print the content using the print_extracted_data tool provided.\nONLY print the content using the print_extracted_data tool provided.`;\n }\n\n return {\n role: \"user\",\n content,\n };\n}\n\nconst metadataSystemPrompt = `You are an AI assistant tasked with evaluating the progress and completion status of an extraction task.\nAnalyze the extraction response and determine if the task is completed or if more information is needed.\nStrictly abide by the following criteria:\n1. Once the instruction has been satisfied by the current extraction response, ALWAYS set completion status to true and stop processing, regardless of remaining chunks.\n2. Only set completion status to false if BOTH of these conditions are true:\n - The instruction has not been satisfied yet\n - There are still chunks left to process (chunksTotal > chunksSeen)`;\n\nexport function buildMetadataSystemPrompt(): ChatMessage {\n return {\n role: \"system\",\n content: metadataSystemPrompt,\n };\n}\n\nexport function buildMetadataPrompt(\n instruction: string,\n extractionResponse: object,\n): ChatMessage {\n return {\n role: \"user\",\n content: `Instruction: ${instruction}\nExtracted content: ${JSON.stringify(extractionResponse, null, 2)}`,\n };\n}\n\n// observe\nexport function buildObserveSystemPrompt(\n userProvidedInstructions?: string,\n supportedActions?: string[],\n): ChatMessage {\n const actionsString = supportedActions?.length\n ? `\\n\\nSupported actions: ${supportedActions.join(\", \")}`\n : \"\";\n\n const observeSystemPrompt = `\nYou are helping the user automate the browser by finding elements based on what the user wants to observe in the page.\n\nYou will be given:\n1. a instruction of elements to observe\n2. a hierarchical accessibility tree showing the semantic structure of the page. The tree is a hybrid of the DOM and the accessibility tree.\n\nReturn an array of elements that match the instruction if they exist, otherwise return an empty array.\nWhen returning elements, include the appropriate method from the supported actions list.${actionsString}. When choosing non-left click actions, provide right or middle as the argument.`;\n const content = observeSystemPrompt.replace(/\\s+/g, \" \");\n\n return {\n role: \"system\",\n content: [content, buildUserInstructionsString(userProvidedInstructions)]\n .filter(Boolean)\n .join(\"\\n\\n\"),\n };\n}\n\nexport function buildObserveUserMessage(\n instruction: string,\n domElements: string,\n): ChatMessage {\n return {\n role: \"user\",\n content: `instruction: ${instruction}\nAccessibility Tree: \\n${domElements}\\n`,\n };\n}\n\nexport function buildActSystemPrompt(\n userProvidedInstructions?: string,\n): ChatMessage {\n const actSystemPrompt = `\nYou are helping the user automate the browser by finding elements based on what action the user wants to take on the page\n\nYou will be given:\n1. a user defined instruction about what action to take\n2. a hierarchical accessibility tree showing the semantic structure of the page. The tree is a hybrid of the DOM and the accessibility tree.\n\nReturn the element that matches the instruction if it exists. Otherwise, return an empty object.`;\n const content = actSystemPrompt.replace(/\\s+/g, \" \");\n\n return {\n role: \"system\",\n content: [content, buildUserInstructionsString(userProvidedInstructions)]\n .filter(Boolean)\n .join(\"\\n\\n\"),\n };\n}\n\nexport function buildActPrompt(\n action: string,\n supportedActions: string[],\n variables?: Record<string, string>,\n): string {\n // Base instruction\n let instruction = `Find the most relevant element to perform an action on given the following action: ${action}. \n IF AND ONLY IF the action EXPLICITLY includes the word 'dropdown' and implies choosing/selecting an option from a dropdown, ignore the 'General Instructions' section, and follow the 'Dropdown Specific Instructions' section carefully.\n \n General Instructions: \n Provide an action for this element such as ${supportedActions.join(\", \")}. Remember that to users, buttons and links look the same in most cases.\n When choosing non-left click actions, provide right or middle as the argument\n If the action is completely unrelated to a potential action to be taken on the page, return an empty object. \n ONLY return one action. If multiple actions are relevant, return the most relevant one. \n If the user is asking to scroll to a position on the page, e.g., 'halfway' or 0.75, etc, you must return the argument formatted as the correct percentage, e.g., '50%' or '75%', etc.\n If the user is asking to scroll to the next chunk/previous chunk, choose the nextChunk/prevChunk method. No arguments are required here.\n If the action implies a key press, e.g., 'press enter', 'press a', 'press space', etc., always choose the press method with the appropriate key as argument — e.g. 'a', 'Enter', 'Space'. Do not choose a click action on an on-screen keyboard. Capitalize the first character like 'Enter', 'Tab', 'Escape' only for special keys. \n \n Dropdown Specific Instructions:\n For interacting with dropdowns, there are two specific cases that you need to handle. \n \n CASE 1: the element is a 'select' element. \n - choose the selectOptionFromDropdown method,\n - set the argument to the exact text of the option that should be selected,\n - set twoStep to false.\n CASE 2: the element is NOT a 'select' element:\n - do not attempt to directly choose the element from the dropdown. You will need to click to expand the dropdown first. You will achieve this by following these instructions:\n - choose the node that most closely corresponds to the given instruction EVEN if it is a 'StaticText' element, or otherwise does not appear to be interactable. \n - choose the 'click' method\n - set twoStep to true.\n `;\n\n // Add variable names (not values) to the instruction if any\n if (variables && Object.keys(variables).length > 0) {\n const variableNames = Object.keys(variables)\n .map((key) => `%${key}%`)\n .join(\", \");\n const variablesPrompt = `The following variables are available to use in the action: ${variableNames}. Fill the argument variables with the variable name.`;\n instruction += ` ${variablesPrompt}`;\n }\n\n return instruction;\n}\n\nexport function buildStepTwoPrompt(\n originalUserAction: string,\n previousAction: string,\n supportedActions: string[],\n variables?: Record<string, string>,\n): string {\n // Base instruction\n let instruction = `\n The original user action was: ${originalUserAction}.\n You have just taken the following action which completed step 1 of 2: ${previousAction}.\n \n Now, you must find the most relevant element to perform an action on in order to complete step 2 of 2. \n \n General Instructions: \n Provide an action for this element such as ${supportedActions.join(\", \")}. Remember that to users, buttons and links look the same in most cases.\n If the action is completely unrelated to a potential action to be taken on the page, return an empty object. \n ONLY return one action. If multiple actions are relevant, return the most relevant one. \n If the user is asking to scroll to a position on the page, e.g., 'halfway' or 0.75, etc, you must return the argument formatted as the correct percentage, e.g., '50%' or '75%', etc.\n If the user is asking to scroll to the next chunk/previous chunk, choose the nextChunk/prevChunk method. No arguments are required here.\n If the action implies a key press, e.g., 'press enter', 'press a', 'press space', etc., always choose the press method with the appropriate key as argument — e.g. 'a', 'Enter', 'Space'. Do not choose a click action on an on-screen keyboard. Capitalize the first character like 'Enter', 'Tab', 'Escape' only for special keys. \n `;\n\n // Add variable names (not values) to the instruction if any\n if (variables && Object.keys(variables).length > 0) {\n const variableNames = Object.keys(variables)\n .map((key) => `%${key}%`)\n .join(\", \");\n const variablesPrompt = `The following variables are available to use in the action: ${variableNames}. Fill the argument variables with the variable name.`;\n instruction += ` ${variablesPrompt}`;\n }\n\n return instruction;\n}\n\nexport function buildOperatorSystemPrompt(goal: string): ChatMessage {\n return {\n role: \"system\",\n content: `You are a general-purpose agent whose job is to accomplish the user's goal across multiple model calls by running actions on the page.\n\nYou will be given a goal and a list of steps that have been taken so far. Your job is to determine if either the user's goal has been completed or if there are still steps that need to be taken.\n\n# Your current goal\n${goal}\n\n# CRITICAL: You MUST use the provided tools to take actions. Do not just describe what you want to do - actually call the appropriate tools.\n\n# Available tools and when to use them:\n- \\`act\\`: Use this to interact with the page (click, type, navigate, etc.)\n- \\`extract\\`: Use this to get information from the page\n- \\`goto\\`: Use this to navigate to a specific URL\n- \\`wait\\`: Use this to wait for a period of time\n- \\`navback\\`: Use this to go back to the previous page\n- \\`refresh\\`: Use this to refresh the current page\n- \\`close\\`: Use this ONLY when the task is complete or cannot be achieved\n- External tools: Use any additional tools (like search tools) as needed for your goal\n\n# Important guidelines\n1. ALWAYS use tools - never just provide text responses about what you plan to do\n2. Break down complex actions into individual atomic steps\n3. For \\`act\\` commands, use only one action at a time, such as:\n - Single click on a specific element\n - Type into a single input field\n - Select a single option\n4. Avoid combining multiple actions in one instruction\n5. If multiple actions are needed, they should be separate steps\n6. Only use \\`close\\` when the task is genuinely complete or impossible to achieve`,\n };\n}\n\nexport function buildCuaDefaultSystemPrompt(): string {\n return `You are a helpful assistant that can use a web browser.\\nDo not ask follow up questions, the user will trust your judgement. Today's date is ${new Date().toISOString().split(\"T\")[0]}.`;\n}\n\nexport function buildGoogleCUASystemPrompt(): ChatMessage {\n return {\n role: \"system\",\n content: `You are a general-purpose browser agent whose job is to accomplish the user's goal.\nToday's date is ${new Date().toISOString().split(\"T\")[0]}.\nYou have access to a search tool; however, in most cases you should operate within the page/url the user has provided. ONLY use the search tool if you're stuck or the task is impossible to complete within the current page.\nYou will be given a goal and a list of steps that have been taken so far. Avoid requesting the user for input as much as possible. Good luck!\n`,\n };\n}\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Schema } from "@google/genai";
|
|
2
|
+
import { z, ZodTypeAny } from "zod";
|
|
3
|
+
import { LogLine } from "./v3/types/public/logs.js";
|
|
4
|
+
import { ModelProvider } from "./v3/types/public/model.js";
|
|
5
|
+
import { ZodPathSegments } from "./v3/types/private/internal.js";
|
|
6
|
+
import type { StagehandZodSchema } from "./v3/zodCompat.js";
|
|
7
|
+
export declare function getZFactory(schema: StagehandZodSchema): typeof z;
|
|
8
|
+
export declare function validateZodSchema(schema: StagehandZodSchema, data: unknown): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Detects if the code is running in the Bun runtime environment.
|
|
11
|
+
* @returns {boolean} True if running in Bun, false otherwise.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isRunningInBun(): boolean;
|
|
14
|
+
export declare function toGeminiSchema(zodSchema: StagehandZodSchema): Schema;
|
|
15
|
+
export declare function getZodType(schema: StagehandZodSchema): string;
|
|
16
|
+
/**
|
|
17
|
+
* Recursively traverses a given Zod schema, scanning for any fields of type `z.string().url()`.
|
|
18
|
+
* For each such field, it replaces the `z.string().url()` with `z.number()`.
|
|
19
|
+
*
|
|
20
|
+
* This function is used internally by higher-level utilities (e.g., transforming entire object schemas)
|
|
21
|
+
* and handles nested objects, arrays, unions, intersections, optionals.
|
|
22
|
+
*
|
|
23
|
+
* @param schema - The Zod schema to transform.
|
|
24
|
+
* @param currentPath - An array of string/number keys representing the current schema path (used internally for recursion).
|
|
25
|
+
* @returns A two-element tuple:
|
|
26
|
+
* 1. The updated Zod schema, with any `.url()` fields replaced by `z.number()`.
|
|
27
|
+
* 2. An array of {@link ZodPathSegments} objects representing each replaced field, including the path segments.
|
|
28
|
+
*/
|
|
29
|
+
export declare function transformSchema(schema: StagehandZodSchema, currentPath: Array<string | number>): [StagehandZodSchema, ZodPathSegments[]];
|
|
30
|
+
/**
|
|
31
|
+
* Once we get the final extracted object that has numeric IDs in place of URLs,
|
|
32
|
+
* use `injectUrls` to walk the object and replace numeric IDs
|
|
33
|
+
* with the real URL strings from idToUrlMapping. The `path` may include `*`
|
|
34
|
+
* for array indices (indicating "all items in the array").
|
|
35
|
+
*/
|
|
36
|
+
export declare function injectUrls(obj: unknown, path: Array<string | number>, idToUrlMapping: Record<string, string>): void;
|
|
37
|
+
/**
|
|
38
|
+
* Mapping from LLM provider names to their corresponding environment variable names for API keys.
|
|
39
|
+
*/
|
|
40
|
+
export declare const providerEnvVarMap: Partial<Record<ModelProvider | string, string | Array<string>>>;
|
|
41
|
+
/**
|
|
42
|
+
* Loads an API key for a provider, checking environment variables.
|
|
43
|
+
* @param provider The name of the provider (e.g., 'openai', 'anthropic')
|
|
44
|
+
* @param logger Optional logger for info/error messages
|
|
45
|
+
* @returns The API key if found, undefined otherwise
|
|
46
|
+
*/
|
|
47
|
+
export declare function loadApiKeyFromEnv(provider: string | undefined, logger: (logLine: LogLine) => void): string | undefined;
|
|
48
|
+
export declare function trimTrailingTextNode(path: string | undefined): string | undefined;
|
|
49
|
+
export interface JsonSchemaProperty {
|
|
50
|
+
type: string;
|
|
51
|
+
enum?: unknown[];
|
|
52
|
+
items?: JsonSchemaProperty;
|
|
53
|
+
properties?: Record<string, JsonSchemaProperty>;
|
|
54
|
+
required?: string[];
|
|
55
|
+
minimum?: number;
|
|
56
|
+
maximum?: number;
|
|
57
|
+
description?: string;
|
|
58
|
+
format?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface JsonSchema extends JsonSchemaProperty {
|
|
61
|
+
type: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Converts a JSON Schema object to a Zod schema
|
|
65
|
+
* @param schema The JSON Schema object to convert
|
|
66
|
+
* @returns A Zod schema equivalent to the input JSON Schema
|
|
67
|
+
*/
|
|
68
|
+
export declare function jsonSchemaToZod(schema: JsonSchema): ZodTypeAny;
|