donobu 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/AgentsApi.d.ts +12 -0
- package/dist/apis/AgentsApi.js +36 -0
- package/dist/apis/AgentsApi.js.map +1 -0
- package/dist/apis/AskAiApi.d.ts +17 -0
- package/dist/apis/AskAiApi.js +58 -0
- package/dist/apis/AskAiApi.js.map +1 -0
- package/dist/apis/DefaultApiAuthApi.d.ts +17 -0
- package/dist/apis/DefaultApiAuthApi.js +33 -0
- package/dist/apis/DefaultApiAuthApi.js.map +1 -0
- package/dist/apis/FlowsApi.d.ts +40 -0
- package/dist/apis/FlowsApi.js +129 -0
- package/dist/apis/FlowsApi.js.map +1 -0
- package/dist/apis/FlowsFilesApi.d.ts +8 -0
- package/dist/apis/FlowsFilesApi.js +87 -0
- package/dist/apis/FlowsFilesApi.js.map +1 -0
- package/dist/apis/FlowsToolCallsApi.d.ts +18 -0
- package/dist/apis/FlowsToolCallsApi.js +43 -0
- package/dist/apis/FlowsToolCallsApi.js.map +1 -0
- package/dist/apis/GptConfigsApi.d.ts +22 -0
- package/dist/apis/GptConfigsApi.js +77 -0
- package/dist/apis/GptConfigsApi.js.map +1 -0
- package/dist/apis/GptResourcesApi.d.ts +20 -0
- package/dist/apis/GptResourcesApi.js +53 -0
- package/dist/apis/GptResourcesApi.js.map +1 -0
- package/dist/apis/KeysApi.d.ts +25 -0
- package/dist/apis/KeysApi.js +64 -0
- package/dist/apis/KeysApi.js.map +1 -0
- package/dist/apis/PingApi.d.ts +13 -0
- package/dist/apis/PingApi.js +19 -0
- package/dist/apis/PingApi.js.map +1 -0
- package/dist/apis/SpecialFlowsApi.d.ts +17 -0
- package/dist/apis/SpecialFlowsApi.js +430 -0
- package/dist/apis/SpecialFlowsApi.js.map +1 -0
- package/dist/apis/ToolsApi.d.ts +20 -0
- package/dist/apis/ToolsApi.js +26 -0
- package/dist/apis/ToolsApi.js.map +1 -0
- package/dist/apis/VersionApi.d.ts +13 -0
- package/dist/apis/VersionApi.js +20 -0
- package/dist/apis/VersionApi.js.map +1 -0
- package/dist/assets/Donobu.entitlements.plist +28 -0
- package/dist/assets/axe.js +47397 -0
- package/dist/assets/clickable-elements-tracker.js +62 -0
- package/dist/assets/control-panel.js +447 -0
- package/dist/assets/devices.json +1403 -0
- package/dist/assets/dialog-prompt-tracker.js +20 -0
- package/dist/assets/generated/parameter-schemas.json +1518 -0
- package/dist/assets/generated/version +1 -0
- package/dist/assets/icon.png +0 -0
- package/dist/assets/page-interactions-tracker.js +222 -0
- package/dist/assets/smart-selector-generator.js +268 -0
- package/dist/assets/zaru-eyes.html +141 -0
- package/dist/bindings/FocusPage.d.ts +17 -0
- package/dist/bindings/FocusPage.js +27 -0
- package/dist/bindings/FocusPage.js.map +1 -0
- package/dist/bindings/NamedBindingCallback.d.ts +23 -0
- package/dist/bindings/NamedBindingCallback.js +3 -0
- package/dist/bindings/NamedBindingCallback.js.map +1 -0
- package/dist/bindings/PageInteractionTracker.d.ts +28 -0
- package/dist/bindings/PageInteractionTracker.js +102 -0
- package/dist/bindings/PageInteractionTracker.js.map +1 -0
- package/dist/clients/AnthropicAwsBedrockGptClient.d.ts +36 -0
- package/dist/clients/AnthropicAwsBedrockGptClient.js +357 -0
- package/dist/clients/AnthropicAwsBedrockGptClient.js.map +1 -0
- package/dist/clients/AnthropicGptClient.d.ts +36 -0
- package/dist/clients/AnthropicGptClient.js +309 -0
- package/dist/clients/AnthropicGptClient.js.map +1 -0
- package/dist/clients/GoogleGptClient.d.ts +49 -0
- package/dist/clients/GoogleGptClient.js +380 -0
- package/dist/clients/GoogleGptClient.js.map +1 -0
- package/dist/clients/GoogleGptClient2.d.ts +18 -0
- package/dist/clients/GoogleGptClient2.js +237 -0
- package/dist/clients/GoogleGptClient2.js.map +1 -0
- package/dist/clients/GptClient.d.ts +36 -0
- package/dist/clients/GptClient.js +12 -0
- package/dist/clients/GptClient.js.map +1 -0
- package/dist/clients/GptClientFactory.d.ts +5 -0
- package/dist/clients/GptClientFactory.js +39 -0
- package/dist/clients/GptClientFactory.js.map +1 -0
- package/dist/clients/OpenAiGptClient.d.ts +35 -0
- package/dist/clients/OpenAiGptClient.js +269 -0
- package/dist/clients/OpenAiGptClient.js.map +1 -0
- package/dist/clients/SupabaseClient.d.ts +16 -0
- package/dist/clients/SupabaseClient.js +200 -0
- package/dist/clients/SupabaseClient.js.map +1 -0
- package/dist/donobu.fixtures.d.ts +57 -0
- package/dist/donobu.fixtures.js +167 -0
- package/dist/donobu.fixtures.js.map +1 -0
- package/dist/esm/apis/AgentsApi.d.ts +12 -0
- package/dist/esm/apis/AgentsApi.js +36 -0
- package/dist/esm/apis/AgentsApi.js.map +1 -0
- package/dist/esm/apis/AskAiApi.d.ts +17 -0
- package/dist/esm/apis/AskAiApi.js +58 -0
- package/dist/esm/apis/AskAiApi.js.map +1 -0
- package/dist/esm/apis/DefaultApiAuthApi.d.ts +17 -0
- package/dist/esm/apis/DefaultApiAuthApi.js +33 -0
- package/dist/esm/apis/DefaultApiAuthApi.js.map +1 -0
- package/dist/esm/apis/FlowsApi.d.ts +40 -0
- package/dist/esm/apis/FlowsApi.js +129 -0
- package/dist/esm/apis/FlowsApi.js.map +1 -0
- package/dist/esm/apis/FlowsFilesApi.d.ts +8 -0
- package/dist/esm/apis/FlowsFilesApi.js +87 -0
- package/dist/esm/apis/FlowsFilesApi.js.map +1 -0
- package/dist/esm/apis/FlowsToolCallsApi.d.ts +18 -0
- package/dist/esm/apis/FlowsToolCallsApi.js +43 -0
- package/dist/esm/apis/FlowsToolCallsApi.js.map +1 -0
- package/dist/esm/apis/GptConfigsApi.d.ts +22 -0
- package/dist/esm/apis/GptConfigsApi.js +77 -0
- package/dist/esm/apis/GptConfigsApi.js.map +1 -0
- package/dist/esm/apis/GptResourcesApi.d.ts +20 -0
- package/dist/esm/apis/GptResourcesApi.js +53 -0
- package/dist/esm/apis/GptResourcesApi.js.map +1 -0
- package/dist/esm/apis/KeysApi.d.ts +25 -0
- package/dist/esm/apis/KeysApi.js +64 -0
- package/dist/esm/apis/KeysApi.js.map +1 -0
- package/dist/esm/apis/PingApi.d.ts +13 -0
- package/dist/esm/apis/PingApi.js +19 -0
- package/dist/esm/apis/PingApi.js.map +1 -0
- package/dist/esm/apis/SpecialFlowsApi.d.ts +17 -0
- package/dist/esm/apis/SpecialFlowsApi.js +430 -0
- package/dist/esm/apis/SpecialFlowsApi.js.map +1 -0
- package/dist/esm/apis/ToolsApi.d.ts +20 -0
- package/dist/esm/apis/ToolsApi.js +26 -0
- package/dist/esm/apis/ToolsApi.js.map +1 -0
- package/dist/esm/apis/VersionApi.d.ts +13 -0
- package/dist/esm/apis/VersionApi.js +20 -0
- package/dist/esm/apis/VersionApi.js.map +1 -0
- package/dist/esm/assets/Donobu.entitlements.plist +28 -0
- package/dist/esm/assets/axe.js +47397 -0
- package/dist/esm/assets/clickable-elements-tracker.js +62 -0
- package/dist/esm/assets/control-panel.js +447 -0
- package/dist/esm/assets/devices.json +1403 -0
- package/dist/esm/assets/dialog-prompt-tracker.js +20 -0
- package/dist/esm/assets/generated/parameter-schemas.json +1518 -0
- package/dist/esm/assets/generated/version +1 -0
- package/dist/esm/assets/icon.png +0 -0
- package/dist/esm/assets/page-interactions-tracker.js +222 -0
- package/dist/esm/assets/smart-selector-generator.js +268 -0
- package/dist/esm/assets/zaru-eyes.html +141 -0
- package/dist/esm/bindings/FocusPage.d.ts +17 -0
- package/dist/esm/bindings/FocusPage.js +27 -0
- package/dist/esm/bindings/FocusPage.js.map +1 -0
- package/dist/esm/bindings/NamedBindingCallback.d.ts +23 -0
- package/dist/esm/bindings/NamedBindingCallback.js +3 -0
- package/dist/esm/bindings/NamedBindingCallback.js.map +1 -0
- package/dist/esm/bindings/PageInteractionTracker.d.ts +28 -0
- package/dist/esm/bindings/PageInteractionTracker.js +102 -0
- package/dist/esm/bindings/PageInteractionTracker.js.map +1 -0
- package/dist/esm/clients/AnthropicAwsBedrockGptClient.d.ts +36 -0
- package/dist/esm/clients/AnthropicAwsBedrockGptClient.js +357 -0
- package/dist/esm/clients/AnthropicAwsBedrockGptClient.js.map +1 -0
- package/dist/esm/clients/AnthropicGptClient.d.ts +36 -0
- package/dist/esm/clients/AnthropicGptClient.js +309 -0
- package/dist/esm/clients/AnthropicGptClient.js.map +1 -0
- package/dist/esm/clients/GoogleGptClient.d.ts +49 -0
- package/dist/esm/clients/GoogleGptClient.js +380 -0
- package/dist/esm/clients/GoogleGptClient.js.map +1 -0
- package/dist/esm/clients/GptClient.d.ts +36 -0
- package/dist/esm/clients/GptClient.js +12 -0
- package/dist/esm/clients/GptClient.js.map +1 -0
- package/dist/esm/clients/GptClientFactory.d.ts +5 -0
- package/dist/esm/clients/GptClientFactory.js +39 -0
- package/dist/esm/clients/GptClientFactory.js.map +1 -0
- package/dist/esm/clients/OpenAiGptClient.d.ts +35 -0
- package/dist/esm/clients/OpenAiGptClient.js +269 -0
- package/dist/esm/clients/OpenAiGptClient.js.map +1 -0
- package/dist/esm/clients/SupabaseClient.d.ts +16 -0
- package/dist/esm/clients/SupabaseClient.js +200 -0
- package/dist/esm/clients/SupabaseClient.js.map +1 -0
- package/dist/esm/donobu.fixtures.d.ts +57 -0
- package/dist/esm/donobu.fixtures.js +167 -0
- package/dist/esm/donobu.fixtures.js.map +1 -0
- package/dist/esm/exceptions/ActiveFlowNotFoundException.d.ts +10 -0
- package/dist/esm/exceptions/ActiveFlowNotFoundException.js +19 -0
- package/dist/esm/exceptions/ActiveFlowNotFoundException.js.map +1 -0
- package/dist/esm/exceptions/ApiKeyNotSetUpException.d.ts +14 -0
- package/dist/esm/exceptions/ApiKeyNotSetUpException.js +21 -0
- package/dist/esm/exceptions/ApiKeyNotSetUpException.js.map +1 -0
- package/dist/esm/exceptions/BrowserStateNotFoundException.d.ts +8 -0
- package/dist/esm/exceptions/BrowserStateNotFoundException.js +15 -0
- package/dist/esm/exceptions/BrowserStateNotFoundException.js.map +1 -0
- package/dist/esm/exceptions/CannotDeleteRunningFlowException.d.ts +9 -0
- package/dist/esm/exceptions/CannotDeleteRunningFlowException.js +18 -0
- package/dist/esm/exceptions/CannotDeleteRunningFlowException.js.map +1 -0
- package/dist/esm/exceptions/DonobuException.d.ts +12 -0
- package/dist/esm/exceptions/DonobuException.js +39 -0
- package/dist/esm/exceptions/DonobuException.js.map +1 -0
- package/dist/esm/exceptions/FlowNotFoundException.d.ts +6 -0
- package/dist/esm/exceptions/FlowNotFoundException.js +17 -0
- package/dist/esm/exceptions/FlowNotFoundException.js.map +1 -0
- package/dist/esm/exceptions/GptApiKeysNotSetupException.d.ts +4 -0
- package/dist/esm/exceptions/GptApiKeysNotSetupException.js +11 -0
- package/dist/esm/exceptions/GptApiKeysNotSetupException.js.map +1 -0
- package/dist/esm/exceptions/GptConfigNotFoundException.d.ts +8 -0
- package/dist/esm/exceptions/GptConfigNotFoundException.js +16 -0
- package/dist/esm/exceptions/GptConfigNotFoundException.js.map +1 -0
- package/dist/esm/exceptions/GptModelNotFoundException.d.ts +9 -0
- package/dist/esm/exceptions/GptModelNotFoundException.js +18 -0
- package/dist/esm/exceptions/GptModelNotFoundException.js.map +1 -0
- package/dist/esm/exceptions/GptPlatformAuthenticationFailedException.d.ts +6 -0
- package/dist/esm/exceptions/GptPlatformAuthenticationFailedException.js +14 -0
- package/dist/esm/exceptions/GptPlatformAuthenticationFailedException.js.map +1 -0
- package/dist/esm/exceptions/GptPlatformInsufficientQuotaException.d.ts +5 -0
- package/dist/esm/exceptions/GptPlatformInsufficientQuotaException.js +13 -0
- package/dist/esm/exceptions/GptPlatformInsufficientQuotaException.js.map +1 -0
- package/dist/esm/exceptions/GptPlatformInternalErrorException.d.ts +5 -0
- package/dist/esm/exceptions/GptPlatformInternalErrorException.js +12 -0
- package/dist/esm/exceptions/GptPlatformInternalErrorException.js.map +1 -0
- package/dist/esm/exceptions/GptPlatformNotReachableException.d.ts +5 -0
- package/dist/esm/exceptions/GptPlatformNotReachableException.js +13 -0
- package/dist/esm/exceptions/GptPlatformNotReachableException.js.map +1 -0
- package/dist/esm/exceptions/GptPlatformRateLimitedException.d.ts +5 -0
- package/dist/esm/exceptions/GptPlatformRateLimitedException.js +13 -0
- package/dist/esm/exceptions/GptPlatformRateLimitedException.js.map +1 -0
- package/dist/esm/exceptions/GptResourceNotFoundException.d.ts +8 -0
- package/dist/esm/exceptions/GptResourceNotFoundException.js +16 -0
- package/dist/esm/exceptions/GptResourceNotFoundException.js.map +1 -0
- package/dist/esm/exceptions/InvalidParamValueException.d.ts +13 -0
- package/dist/esm/exceptions/InvalidParamValueException.js +25 -0
- package/dist/esm/exceptions/InvalidParamValueException.js.map +1 -0
- package/dist/esm/exceptions/NoApiAccessTokenPresentException.d.ts +8 -0
- package/dist/esm/exceptions/NoApiAccessTokenPresentException.js +15 -0
- package/dist/esm/exceptions/NoApiAccessTokenPresentException.js.map +1 -0
- package/dist/esm/exceptions/PageClosedException.d.ts +6 -0
- package/dist/esm/exceptions/PageClosedException.js +13 -0
- package/dist/esm/exceptions/PageClosedException.js.map +1 -0
- package/dist/esm/exceptions/TooManyRequestsException.d.ts +5 -0
- package/dist/esm/exceptions/TooManyRequestsException.js +13 -0
- package/dist/esm/exceptions/TooManyRequestsException.js.map +1 -0
- package/dist/esm/exceptions/ToolCallNotFoundException.d.ts +6 -0
- package/dist/esm/exceptions/ToolCallNotFoundException.js +14 -0
- package/dist/esm/exceptions/ToolCallNotFoundException.js.map +1 -0
- package/dist/esm/exceptions/ToolRequiresGptException.d.ts +5 -0
- package/dist/esm/exceptions/ToolRequiresGptException.js +13 -0
- package/dist/esm/exceptions/ToolRequiresGptException.js.map +1 -0
- package/dist/esm/exceptions/UnknownToolException.d.ts +5 -0
- package/dist/esm/exceptions/UnknownToolException.js +13 -0
- package/dist/esm/exceptions/UnknownToolException.js.map +1 -0
- package/dist/esm/exceptions/UnparseableJsonBodyException.d.ts +4 -0
- package/dist/esm/exceptions/UnparseableJsonBodyException.js +12 -0
- package/dist/esm/exceptions/UnparseableJsonBodyException.js.map +1 -0
- package/dist/esm/main.d.ts +21 -0
- package/dist/esm/main.js +143 -0
- package/dist/esm/main.js.map +1 -0
- package/dist/esm/managers/AdminApiController.d.ts +32 -0
- package/dist/esm/managers/AdminApiController.js +251 -0
- package/dist/esm/managers/AdminApiController.js.map +1 -0
- package/dist/esm/managers/AgentsManager.d.ts +28 -0
- package/dist/esm/managers/AgentsManager.js +75 -0
- package/dist/esm/managers/AgentsManager.js.map +1 -0
- package/dist/esm/managers/DonobuFlow.d.ts +115 -0
- package/dist/esm/managers/DonobuFlow.js +1070 -0
- package/dist/esm/managers/DonobuFlow.js.map +1 -0
- package/dist/esm/managers/DonobuFlowsManager.d.ts +130 -0
- package/dist/esm/managers/DonobuFlowsManager.js +830 -0
- package/dist/esm/managers/DonobuFlowsManager.js.map +1 -0
- package/dist/esm/managers/FlowsPersistence.d.ts +79 -0
- package/dist/esm/managers/FlowsPersistence.js +3 -0
- package/dist/esm/managers/FlowsPersistence.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceAwsS3.d.ts +48 -0
- package/dist/esm/managers/FlowsPersistenceAwsS3.js +284 -0
- package/dist/esm/managers/FlowsPersistenceAwsS3.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceFactory.d.ts +9 -0
- package/dist/esm/managers/FlowsPersistenceFactory.js +3 -0
- package/dist/esm/managers/FlowsPersistenceFactory.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceFactoryImpl.d.ts +57 -0
- package/dist/esm/managers/FlowsPersistenceFactoryImpl.js +119 -0
- package/dist/esm/managers/FlowsPersistenceFactoryImpl.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceFactoryPreset.d.ts +12 -0
- package/dist/esm/managers/FlowsPersistenceFactoryPreset.js +25 -0
- package/dist/esm/managers/FlowsPersistenceFactoryPreset.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceFilesystem.d.ts +33 -0
- package/dist/esm/managers/FlowsPersistenceFilesystem.js +180 -0
- package/dist/esm/managers/FlowsPersistenceFilesystem.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceGoogleCloudStorage.d.ts +40 -0
- package/dist/esm/managers/FlowsPersistenceGoogleCloudStorage.js +209 -0
- package/dist/esm/managers/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceSupabase.d.ts +33 -0
- package/dist/esm/managers/FlowsPersistenceSupabase.js +152 -0
- package/dist/esm/managers/FlowsPersistenceSupabase.js.map +1 -0
- package/dist/esm/managers/FlowsPersistenceVolatile.d.ts +30 -0
- package/dist/esm/managers/FlowsPersistenceVolatile.js +103 -0
- package/dist/esm/managers/FlowsPersistenceVolatile.js.map +1 -0
- package/dist/esm/managers/GptConfigsManager.d.ts +38 -0
- package/dist/esm/managers/GptConfigsManager.js +159 -0
- package/dist/esm/managers/GptConfigsManager.js.map +1 -0
- package/dist/esm/managers/GptPlatformApiKeysManager.d.ts +36 -0
- package/dist/esm/managers/GptPlatformApiKeysManager.js +3 -0
- package/dist/esm/managers/GptPlatformApiKeysManager.js.map +1 -0
- package/dist/esm/managers/GptPlatformApiKeysManagerFilesystem.d.ts +29 -0
- package/dist/esm/managers/GptPlatformApiKeysManagerFilesystem.js +136 -0
- package/dist/esm/managers/GptPlatformApiKeysManagerFilesystem.js.map +1 -0
- package/dist/esm/managers/GptPlatformApiKeysManagerVolatile.d.ts +35 -0
- package/dist/esm/managers/GptPlatformApiKeysManagerVolatile.js +51 -0
- package/dist/esm/managers/GptPlatformApiKeysManagerVolatile.js.map +1 -0
- package/dist/esm/managers/GptResourcesManager.d.ts +39 -0
- package/dist/esm/managers/GptResourcesManager.js +130 -0
- package/dist/esm/managers/GptResourcesManager.js.map +1 -0
- package/dist/esm/managers/RequestContextHolder.d.ts +24 -0
- package/dist/esm/managers/RequestContextHolder.js +43 -0
- package/dist/esm/managers/RequestContextHolder.js.map +1 -0
- package/dist/esm/managers/SelectorGenerator.d.ts +8 -0
- package/dist/esm/managers/SelectorGenerator.js +15 -0
- package/dist/esm/managers/SelectorGenerator.js.map +1 -0
- package/dist/esm/managers/ToolManager.d.ts +21 -0
- package/dist/esm/managers/ToolManager.js +264 -0
- package/dist/esm/managers/ToolManager.js.map +1 -0
- package/dist/esm/managers/ToolTipper.d.ts +35 -0
- package/dist/esm/managers/ToolTipper.js +201 -0
- package/dist/esm/managers/ToolTipper.js.map +1 -0
- package/dist/esm/models/AskAiRequest.d.ts +14 -0
- package/dist/esm/models/AskAiRequest.js +3 -0
- package/dist/esm/models/AskAiRequest.js.map +1 -0
- package/dist/esm/models/BaseToolGptParameters.d.ts +9 -0
- package/dist/esm/models/BaseToolGptParameters.js +3 -0
- package/dist/esm/models/BaseToolGptParameters.js.map +1 -0
- package/dist/esm/models/BrowserDevice.d.ts +18 -0
- package/dist/esm/models/BrowserDevice.js +3 -0
- package/dist/esm/models/BrowserDevice.js.map +1 -0
- package/dist/esm/models/BrowserFramework.d.ts +36 -0
- package/dist/esm/models/BrowserFramework.js +164 -0
- package/dist/esm/models/BrowserFramework.js.map +1 -0
- package/dist/esm/models/BrowserState.d.ts +25 -0
- package/dist/esm/models/BrowserState.js +3 -0
- package/dist/esm/models/BrowserState.js.map +1 -0
- package/dist/esm/models/BrowserStateFlowReference.d.ts +10 -0
- package/dist/esm/models/BrowserStateFlowReference.js +3 -0
- package/dist/esm/models/BrowserStateFlowReference.js.map +1 -0
- package/dist/esm/models/CreateDonobuFlow.d.ts +88 -0
- package/dist/esm/models/CreateDonobuFlow.js +3 -0
- package/dist/esm/models/CreateDonobuFlow.js.map +1 -0
- package/dist/esm/models/CreateGoogleSteetviewExtractionFlow.d.ts +21 -0
- package/dist/esm/models/CreateGoogleSteetviewExtractionFlow.js +3 -0
- package/dist/esm/models/CreateGoogleSteetviewExtractionFlow.js.map +1 -0
- package/dist/esm/models/CustomTool.d.ts +9 -0
- package/dist/esm/models/CustomTool.js +3 -0
- package/dist/esm/models/CustomTool.js.map +1 -0
- package/dist/esm/models/DonobuAgentType.d.ts +2 -0
- package/dist/esm/models/DonobuAgentType.js +5 -0
- package/dist/esm/models/DonobuAgentType.js.map +1 -0
- package/dist/esm/models/DonobuDeploymentEnvironment.d.ts +5 -0
- package/dist/esm/models/DonobuDeploymentEnvironment.js +10 -0
- package/dist/esm/models/DonobuDeploymentEnvironment.js.map +1 -0
- package/dist/esm/models/DonobuErrorResponse.d.ts +13 -0
- package/dist/esm/models/DonobuErrorResponse.js +3 -0
- package/dist/esm/models/DonobuErrorResponse.js.map +1 -0
- package/dist/esm/models/ElementSelector.d.ts +14 -0
- package/dist/esm/models/ElementSelector.js +3 -0
- package/dist/esm/models/ElementSelector.js.map +1 -0
- package/dist/esm/models/ElementSelectorForReplay.d.ts +14 -0
- package/dist/esm/models/ElementSelectorForReplay.js +3 -0
- package/dist/esm/models/ElementSelectorForReplay.js.map +1 -0
- package/dist/esm/models/FlowMetadata.d.ts +123 -0
- package/dist/esm/models/FlowMetadata.js +50 -0
- package/dist/esm/models/FlowMetadata.js.map +1 -0
- package/dist/esm/models/FlowsQuery.d.ts +11 -0
- package/dist/esm/models/FlowsQuery.js +3 -0
- package/dist/esm/models/FlowsQuery.js.map +1 -0
- package/dist/esm/models/FocusedPage.d.ts +4 -0
- package/dist/esm/models/FocusedPage.js +3 -0
- package/dist/esm/models/FocusedPage.js.map +1 -0
- package/dist/esm/models/GptConfig.d.ts +38 -0
- package/dist/esm/models/GptConfig.js +3 -0
- package/dist/esm/models/GptConfig.js.map +1 -0
- package/dist/esm/models/GptMessage.d.ts +43 -0
- package/dist/esm/models/GptMessage.js +3 -0
- package/dist/esm/models/GptMessage.js.map +1 -0
- package/dist/esm/models/GptResource.d.ts +33 -0
- package/dist/esm/models/GptResource.js +3 -0
- package/dist/esm/models/GptResource.js.map +1 -0
- package/dist/esm/models/InteractableElement.d.ts +13 -0
- package/dist/esm/models/InteractableElement.js +3 -0
- package/dist/esm/models/InteractableElement.js.map +1 -0
- package/dist/esm/models/ProposedToolCall.d.ts +19 -0
- package/dist/esm/models/ProposedToolCall.js +3 -0
- package/dist/esm/models/ProposedToolCall.js.map +1 -0
- package/dist/esm/models/RequestContext.d.ts +21 -0
- package/dist/esm/models/RequestContext.js +24 -0
- package/dist/esm/models/RequestContext.js.map +1 -0
- package/dist/esm/models/ToolCall.d.ts +38 -0
- package/dist/esm/models/ToolCall.js +3 -0
- package/dist/esm/models/ToolCall.js.map +1 -0
- package/dist/esm/models/ToolCallContext.d.ts +22 -0
- package/dist/esm/models/ToolCallContext.js +3 -0
- package/dist/esm/models/ToolCallContext.js.map +1 -0
- package/dist/esm/models/ToolCallResult.d.ts +20 -0
- package/dist/esm/models/ToolCallResult.js +19 -0
- package/dist/esm/models/ToolCallResult.js.map +1 -0
- package/dist/esm/models/VideoSegment.d.ts +20 -0
- package/dist/esm/models/VideoSegment.js +3 -0
- package/dist/esm/models/VideoSegment.js.map +1 -0
- package/dist/esm/persistence/AgentsPersistence.d.ts +11 -0
- package/dist/esm/persistence/AgentsPersistence.js +3 -0
- package/dist/esm/persistence/AgentsPersistence.js.map +1 -0
- package/dist/esm/persistence/AgentsPersistenceFilesystem.d.ts +15 -0
- package/dist/esm/persistence/AgentsPersistenceFilesystem.js +48 -0
- package/dist/esm/persistence/AgentsPersistenceFilesystem.js.map +1 -0
- package/dist/esm/persistence/AgentsPersistenceSqlite.d.ts +14 -0
- package/dist/esm/persistence/AgentsPersistenceSqlite.js +51 -0
- package/dist/esm/persistence/AgentsPersistenceSqlite.js.map +1 -0
- package/dist/esm/persistence/AgentsPersistenceVolatile.d.ts +13 -0
- package/dist/esm/persistence/AgentsPersistenceVolatile.js +27 -0
- package/dist/esm/persistence/AgentsPersistenceVolatile.js.map +1 -0
- package/dist/esm/persistence/DonobuSqliteDb.d.ts +11 -0
- package/dist/esm/persistence/DonobuSqliteDb.js +178 -0
- package/dist/esm/persistence/DonobuSqliteDb.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistence.d.ts +94 -0
- package/dist/esm/persistence/FlowsPersistence.js +3 -0
- package/dist/esm/persistence/FlowsPersistence.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceAwsS3.d.ts +70 -0
- package/dist/esm/persistence/FlowsPersistenceAwsS3.js +447 -0
- package/dist/esm/persistence/FlowsPersistenceAwsS3.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceFactory.d.ts +9 -0
- package/dist/esm/persistence/FlowsPersistenceFactory.js +3 -0
- package/dist/esm/persistence/FlowsPersistenceFactory.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceFactoryImpl.d.ts +60 -0
- package/dist/esm/persistence/FlowsPersistenceFactoryImpl.js +244 -0
- package/dist/esm/persistence/FlowsPersistenceFactoryImpl.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceFactoryPreset.d.ts +12 -0
- package/dist/esm/persistence/FlowsPersistenceFactoryPreset.js +25 -0
- package/dist/esm/persistence/FlowsPersistenceFactoryPreset.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceFilesystem.d.ts +42 -0
- package/dist/esm/persistence/FlowsPersistenceFilesystem.js +271 -0
- package/dist/esm/persistence/FlowsPersistenceFilesystem.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceGoogleCloudStorage.d.ts +62 -0
- package/dist/esm/persistence/FlowsPersistenceGoogleCloudStorage.js +406 -0
- package/dist/esm/persistence/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceSqlite.d.ts +37 -0
- package/dist/esm/persistence/FlowsPersistenceSqlite.js +229 -0
- package/dist/esm/persistence/FlowsPersistenceSqlite.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceSupabase.d.ts +38 -0
- package/dist/esm/persistence/FlowsPersistenceSupabase.js +216 -0
- package/dist/esm/persistence/FlowsPersistenceSupabase.js.map +1 -0
- package/dist/esm/persistence/FlowsPersistenceVolatile.d.ts +35 -0
- package/dist/esm/persistence/FlowsPersistenceVolatile.js +147 -0
- package/dist/esm/persistence/FlowsPersistenceVolatile.js.map +1 -0
- package/dist/esm/persistence/GptConfigsPersistence.d.ts +11 -0
- package/dist/esm/persistence/GptConfigsPersistence.js +3 -0
- package/dist/esm/persistence/GptConfigsPersistence.js.map +1 -0
- package/dist/esm/persistence/GptConfigsPersistenceFilesystem.d.ts +16 -0
- package/dist/esm/persistence/GptConfigsPersistenceFilesystem.js +54 -0
- package/dist/esm/persistence/GptConfigsPersistenceFilesystem.js.map +1 -0
- package/dist/esm/persistence/GptConfigsPersistenceSqlite.d.ts +12 -0
- package/dist/esm/persistence/GptConfigsPersistenceSqlite.js +36 -0
- package/dist/esm/persistence/GptConfigsPersistenceSqlite.js.map +1 -0
- package/dist/esm/persistence/GptConfigsPersistenceVolatile.d.ts +14 -0
- package/dist/esm/persistence/GptConfigsPersistenceVolatile.js +32 -0
- package/dist/esm/persistence/GptConfigsPersistenceVolatile.js.map +1 -0
- package/dist/esm/persistence/GptResourcesPersistence.d.ts +11 -0
- package/dist/esm/persistence/GptResourcesPersistence.js +3 -0
- package/dist/esm/persistence/GptResourcesPersistence.js.map +1 -0
- package/dist/esm/persistence/GptResourcesPersistenceFilesystem.d.ts +20 -0
- package/dist/esm/persistence/GptResourcesPersistenceFilesystem.js +79 -0
- package/dist/esm/persistence/GptResourcesPersistenceFilesystem.js.map +1 -0
- package/dist/esm/persistence/GptResourcesPersistenceVolatile.d.ts +14 -0
- package/dist/esm/persistence/GptResourcesPersistenceVolatile.js +32 -0
- package/dist/esm/persistence/GptResourcesPersistenceVolatile.js.map +1 -0
- package/dist/esm/test.d.ts +66 -0
- package/dist/esm/test.js +288 -0
- package/dist/esm/test.js.map +1 -0
- package/dist/esm/testfixtures.d.ts +66 -0
- package/dist/esm/testfixtures.js +288 -0
- package/dist/esm/testfixtures.js.map +1 -0
- package/dist/esm/tools/AggregateExtractedStreetviewDataTool.d.ts +24 -0
- package/dist/esm/tools/AggregateExtractedStreetviewDataTool.js +61 -0
- package/dist/esm/tools/AggregateExtractedStreetviewDataTool.js.map +1 -0
- package/dist/esm/tools/AnalyzePageTextTool.d.ts +22 -0
- package/dist/esm/tools/AnalyzePageTextTool.js +59 -0
- package/dist/esm/tools/AnalyzePageTextTool.js.map +1 -0
- package/dist/esm/tools/AssertTool.d.ts +24 -0
- package/dist/esm/tools/AssertTool.js +56 -0
- package/dist/esm/tools/AssertTool.js.map +1 -0
- package/dist/esm/tools/ChangeWebBrowserTabTool.d.ts +18 -0
- package/dist/esm/tools/ChangeWebBrowserTabTool.js +36 -0
- package/dist/esm/tools/ChangeWebBrowserTabTool.js.map +1 -0
- package/dist/esm/tools/ChooseSelectOptionTool.d.ts +18 -0
- package/dist/esm/tools/ChooseSelectOptionTool.js +18 -0
- package/dist/esm/tools/ChooseSelectOptionTool.js.map +1 -0
- package/dist/esm/tools/ClickButtonTool.d.ts +14 -0
- package/dist/esm/tools/ClickButtonTool.js +36 -0
- package/dist/esm/tools/ClickButtonTool.js.map +1 -0
- package/dist/esm/tools/ClickTool.d.ts +14 -0
- package/dist/esm/tools/ClickTool.js +36 -0
- package/dist/esm/tools/ClickTool.js.map +1 -0
- package/dist/esm/tools/CreateBrowserCookieReportTool.d.ts +15 -0
- package/dist/esm/tools/CreateBrowserCookieReportTool.js +98 -0
- package/dist/esm/tools/CreateBrowserCookieReportTool.js.map +1 -0
- package/dist/esm/tools/CustomToolRunnerTool.d.ts +14 -0
- package/dist/esm/tools/CustomToolRunnerTool.js +35 -0
- package/dist/esm/tools/CustomToolRunnerTool.js.map +1 -0
- package/dist/esm/tools/DetectBrokenLinksTool.d.ts +38 -0
- package/dist/esm/tools/DetectBrokenLinksTool.js +264 -0
- package/dist/esm/tools/DetectBrokenLinksTool.js.map +1 -0
- package/dist/esm/tools/DownloadPdfTool.d.ts +19 -0
- package/dist/esm/tools/DownloadPdfTool.js +48 -0
- package/dist/esm/tools/DownloadPdfTool.js.map +1 -0
- package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.d.ts +50 -0
- package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.js +176 -0
- package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.js.map +1 -0
- package/dist/esm/tools/ExtractPaymentProviderKeyTool.d.ts +16 -0
- package/dist/esm/tools/ExtractPaymentProviderKeyTool.js +80 -0
- package/dist/esm/tools/ExtractPaymentProviderKeyTool.js.map +1 -0
- package/dist/esm/tools/ExtractPublicFacebookEntityDataTool.d.ts +27 -0
- package/dist/esm/tools/ExtractPublicFacebookEntityDataTool.js +232 -0
- package/dist/esm/tools/ExtractPublicFacebookEntityDataTool.js.map +1 -0
- package/dist/esm/tools/GetEntityDataFromGoogleMapResult.d.ts +27 -0
- package/dist/esm/tools/GetEntityDataFromGoogleMapResult.js +36 -0
- package/dist/esm/tools/GetEntityDataFromGoogleMapResult.js.map +1 -0
- package/dist/esm/tools/GoForwardOrBackTool.d.ts +22 -0
- package/dist/esm/tools/GoForwardOrBackTool.js +37 -0
- package/dist/esm/tools/GoForwardOrBackTool.js.map +1 -0
- package/dist/esm/tools/GoToGoogleMapsStreetViewTool.d.ts +37 -0
- package/dist/esm/tools/GoToGoogleMapsStreetViewTool.js +119 -0
- package/dist/esm/tools/GoToGoogleMapsStreetViewTool.js.map +1 -0
- package/dist/esm/tools/GoToWebpageTool.d.ts +20 -0
- package/dist/esm/tools/GoToWebpageTool.js +40 -0
- package/dist/esm/tools/GoToWebpageTool.js.map +1 -0
- package/dist/esm/tools/HandleBrowserDialogTool.d.ts +26 -0
- package/dist/esm/tools/HandleBrowserDialogTool.js +22 -0
- package/dist/esm/tools/HandleBrowserDialogTool.js.map +1 -0
- package/dist/esm/tools/HoverOverElementTool.d.ts +15 -0
- package/dist/esm/tools/HoverOverElementTool.js +18 -0
- package/dist/esm/tools/HoverOverElementTool.js.map +1 -0
- package/dist/esm/tools/InputRandomizedEmailAddressTool.d.ts +27 -0
- package/dist/esm/tools/InputRandomizedEmailAddressTool.js +74 -0
- package/dist/esm/tools/InputRandomizedEmailAddressTool.js.map +1 -0
- package/dist/esm/tools/InputTextTool.d.ts +24 -0
- package/dist/esm/tools/InputTextTool.js +48 -0
- package/dist/esm/tools/InputTextTool.js.map +1 -0
- package/dist/esm/tools/MakeCommentTool.d.ts +21 -0
- package/dist/esm/tools/MakeCommentTool.js +31 -0
- package/dist/esm/tools/MakeCommentTool.js.map +1 -0
- package/dist/esm/tools/MarkObjectiveCompleteTool.d.ts +27 -0
- package/dist/esm/tools/MarkObjectiveCompleteTool.js +39 -0
- package/dist/esm/tools/MarkObjectiveCompleteTool.js.map +1 -0
- package/dist/esm/tools/MarkObjectiveNotCompletableTool.d.ts +14 -0
- package/dist/esm/tools/MarkObjectiveNotCompletableTool.js +35 -0
- package/dist/esm/tools/MarkObjectiveNotCompletableTool.js.map +1 -0
- package/dist/esm/tools/NavigateToWebpageTool.d.ts +20 -0
- package/dist/esm/tools/NavigateToWebpageTool.js +40 -0
- package/dist/esm/tools/NavigateToWebpageTool.js.map +1 -0
- package/dist/esm/tools/NavigateWithinStreetView.d.ts +38 -0
- package/dist/esm/tools/NavigateWithinStreetView.js +107 -0
- package/dist/esm/tools/NavigateWithinStreetView.js.map +1 -0
- package/dist/esm/tools/PauseForUserInteractionTool.d.ts +18 -0
- package/dist/esm/tools/PauseForUserInteractionTool.js +24 -0
- package/dist/esm/tools/PauseForUserInteractionTool.js.map +1 -0
- package/dist/esm/tools/PressKeyTool.d.ts +18 -0
- package/dist/esm/tools/PressKeyTool.js +43 -0
- package/dist/esm/tools/PressKeyTool.js.map +1 -0
- package/dist/esm/tools/ReloadPageTool.d.ts +14 -0
- package/dist/esm/tools/ReloadPageTool.js +20 -0
- package/dist/esm/tools/ReloadPageTool.js.map +1 -0
- package/dist/esm/tools/ReplayableInteraction.d.ts +62 -0
- package/dist/esm/tools/ReplayableInteraction.js +170 -0
- package/dist/esm/tools/ReplayableInteraction.js.map +1 -0
- package/dist/esm/tools/RunAccessibilityTestTool.d.ts +14 -0
- package/dist/esm/tools/RunAccessibilityTestTool.js +49 -0
- package/dist/esm/tools/RunAccessibilityTestTool.js.map +1 -0
- package/dist/esm/tools/RunInlineJavaScriptCodeTool.d.ts +17 -0
- package/dist/esm/tools/RunInlineJavaScriptCodeTool.js +30 -0
- package/dist/esm/tools/RunInlineJavaScriptCodeTool.js.map +1 -0
- package/dist/esm/tools/RunSandboxedJavaScriptCodeTool.d.ts +18 -0
- package/dist/esm/tools/RunSandboxedJavaScriptCodeTool.js +43 -0
- package/dist/esm/tools/RunSandboxedJavaScriptCodeTool.js.map +1 -0
- package/dist/esm/tools/SaveWebpageAsPdfTool.d.ts +15 -0
- package/dist/esm/tools/SaveWebpageAsPdfTool.js +27 -0
- package/dist/esm/tools/SaveWebpageAsPdfTool.js.map +1 -0
- package/dist/esm/tools/ScrollPageTool.d.ts +18 -0
- package/dist/esm/tools/ScrollPageTool.js +21 -0
- package/dist/esm/tools/ScrollPageTool.js.map +1 -0
- package/dist/esm/tools/SetRunModeTool.d.ts +20 -0
- package/dist/esm/tools/SetRunModeTool.js +22 -0
- package/dist/esm/tools/SetRunModeTool.js.map +1 -0
- package/dist/esm/tools/SummarizeLearningsTool.d.ts +21 -0
- package/dist/esm/tools/SummarizeLearningsTool.js +31 -0
- package/dist/esm/tools/SummarizeLearningsTool.js.map +1 -0
- package/dist/esm/tools/Tool.d.ts +35 -0
- package/dist/esm/tools/Tool.js +38 -0
- package/dist/esm/tools/Tool.js.map +1 -0
- package/dist/esm/tools/TriggerDonobuFlowTool.d.ts +19 -0
- package/dist/esm/tools/TriggerDonobuFlowTool.js +26 -0
- package/dist/esm/tools/TriggerDonobuFlowTool.js.map +1 -0
- package/dist/esm/tools/WaitTool.d.ts +18 -0
- package/dist/esm/tools/WaitTool.js +20 -0
- package/dist/esm/tools/WaitTool.js.map +1 -0
- package/dist/esm/utils/DirectoryUtils.d.ts +11 -0
- package/dist/esm/utils/DirectoryUtils.js +37 -0
- package/dist/esm/utils/DirectoryUtils.js.map +1 -0
- package/dist/esm/utils/JsonUtils.d.ts +19 -0
- package/dist/esm/utils/JsonUtils.js +124 -0
- package/dist/esm/utils/JsonUtils.js.map +1 -0
- package/dist/esm/utils/Logger.d.ts +17 -0
- package/dist/esm/utils/Logger.js +95 -0
- package/dist/esm/utils/Logger.js.map +1 -0
- package/dist/esm/utils/MiscUtils.d.ts +62 -0
- package/dist/esm/utils/MiscUtils.js +164 -0
- package/dist/esm/utils/MiscUtils.js.map +1 -0
- package/dist/esm/utils/PlaywrightUtils.d.ts +180 -0
- package/dist/esm/utils/PlaywrightUtils.js +1086 -0
- package/dist/esm/utils/PlaywrightUtils.js.map +1 -0
- package/dist/esm/utils/VerbConverter.d.ts +14 -0
- package/dist/esm/utils/VerbConverter.js +96 -0
- package/dist/esm/utils/VerbConverter.js.map +1 -0
- package/dist/exceptions/ActiveFlowNotFoundException.d.ts +10 -0
- package/dist/exceptions/ActiveFlowNotFoundException.js +19 -0
- package/dist/exceptions/ActiveFlowNotFoundException.js.map +1 -0
- package/dist/exceptions/ApiKeyNotSetUpException.d.ts +14 -0
- package/dist/exceptions/ApiKeyNotSetUpException.js +21 -0
- package/dist/exceptions/ApiKeyNotSetUpException.js.map +1 -0
- package/dist/exceptions/BrowserStateNotFoundException.d.ts +8 -0
- package/dist/exceptions/BrowserStateNotFoundException.js +15 -0
- package/dist/exceptions/BrowserStateNotFoundException.js.map +1 -0
- package/dist/exceptions/CannotDeleteRunningFlowException.d.ts +9 -0
- package/dist/exceptions/CannotDeleteRunningFlowException.js +18 -0
- package/dist/exceptions/CannotDeleteRunningFlowException.js.map +1 -0
- package/dist/exceptions/DonobuException.d.ts +12 -0
- package/dist/exceptions/DonobuException.js +39 -0
- package/dist/exceptions/DonobuException.js.map +1 -0
- package/dist/exceptions/FlowNotFoundException.d.ts +6 -0
- package/dist/exceptions/FlowNotFoundException.js +17 -0
- package/dist/exceptions/FlowNotFoundException.js.map +1 -0
- package/dist/exceptions/GptApiKeysNotSetupException.d.ts +4 -0
- package/dist/exceptions/GptApiKeysNotSetupException.js +11 -0
- package/dist/exceptions/GptApiKeysNotSetupException.js.map +1 -0
- package/dist/exceptions/GptConfigNotFoundException.d.ts +8 -0
- package/dist/exceptions/GptConfigNotFoundException.js +16 -0
- package/dist/exceptions/GptConfigNotFoundException.js.map +1 -0
- package/dist/exceptions/GptModelNotFoundException.d.ts +9 -0
- package/dist/exceptions/GptModelNotFoundException.js +18 -0
- package/dist/exceptions/GptModelNotFoundException.js.map +1 -0
- package/dist/exceptions/GptPlatformAuthenticationFailedException.d.ts +6 -0
- package/dist/exceptions/GptPlatformAuthenticationFailedException.js +14 -0
- package/dist/exceptions/GptPlatformAuthenticationFailedException.js.map +1 -0
- package/dist/exceptions/GptPlatformInsufficientQuotaException.d.ts +5 -0
- package/dist/exceptions/GptPlatformInsufficientQuotaException.js +13 -0
- package/dist/exceptions/GptPlatformInsufficientQuotaException.js.map +1 -0
- package/dist/exceptions/GptPlatformInternalErrorException.d.ts +5 -0
- package/dist/exceptions/GptPlatformInternalErrorException.js +12 -0
- package/dist/exceptions/GptPlatformInternalErrorException.js.map +1 -0
- package/dist/exceptions/GptPlatformNotReachableException.d.ts +5 -0
- package/dist/exceptions/GptPlatformNotReachableException.js +13 -0
- package/dist/exceptions/GptPlatformNotReachableException.js.map +1 -0
- package/dist/exceptions/GptPlatformRateLimitedException.d.ts +5 -0
- package/dist/exceptions/GptPlatformRateLimitedException.js +13 -0
- package/dist/exceptions/GptPlatformRateLimitedException.js.map +1 -0
- package/dist/exceptions/GptResourceNotFoundException.d.ts +8 -0
- package/dist/exceptions/GptResourceNotFoundException.js +16 -0
- package/dist/exceptions/GptResourceNotFoundException.js.map +1 -0
- package/dist/exceptions/InvalidParamValueException.d.ts +13 -0
- package/dist/exceptions/InvalidParamValueException.js +25 -0
- package/dist/exceptions/InvalidParamValueException.js.map +1 -0
- package/dist/exceptions/NoApiAccessTokenPresentException.d.ts +8 -0
- package/dist/exceptions/NoApiAccessTokenPresentException.js +15 -0
- package/dist/exceptions/NoApiAccessTokenPresentException.js.map +1 -0
- package/dist/exceptions/PageClosedException.d.ts +6 -0
- package/dist/exceptions/PageClosedException.js +13 -0
- package/dist/exceptions/PageClosedException.js.map +1 -0
- package/dist/exceptions/TooManyRequestsException.d.ts +5 -0
- package/dist/exceptions/TooManyRequestsException.js +13 -0
- package/dist/exceptions/TooManyRequestsException.js.map +1 -0
- package/dist/exceptions/ToolCallNotFoundException.d.ts +6 -0
- package/dist/exceptions/ToolCallNotFoundException.js +14 -0
- package/dist/exceptions/ToolCallNotFoundException.js.map +1 -0
- package/dist/exceptions/ToolRequiresGptException.d.ts +5 -0
- package/dist/exceptions/ToolRequiresGptException.js +13 -0
- package/dist/exceptions/ToolRequiresGptException.js.map +1 -0
- package/dist/exceptions/UnknownToolException.d.ts +5 -0
- package/dist/exceptions/UnknownToolException.js +13 -0
- package/dist/exceptions/UnknownToolException.js.map +1 -0
- package/dist/exceptions/UnparseableJsonBodyException.d.ts +4 -0
- package/dist/exceptions/UnparseableJsonBodyException.js +12 -0
- package/dist/exceptions/UnparseableJsonBodyException.js.map +1 -0
- package/dist/main.d.ts +21 -0
- package/dist/main.js +143 -0
- package/dist/main.js.map +1 -0
- package/dist/managers/AdminApiController.d.ts +32 -0
- package/dist/managers/AdminApiController.js +251 -0
- package/dist/managers/AdminApiController.js.map +1 -0
- package/dist/managers/AgentsManager.d.ts +28 -0
- package/dist/managers/AgentsManager.js +75 -0
- package/dist/managers/AgentsManager.js.map +1 -0
- package/dist/managers/DonobuFlow.d.ts +115 -0
- package/dist/managers/DonobuFlow.js +1070 -0
- package/dist/managers/DonobuFlow.js.map +1 -0
- package/dist/managers/DonobuFlowsManager.d.ts +130 -0
- package/dist/managers/DonobuFlowsManager.js +830 -0
- package/dist/managers/DonobuFlowsManager.js.map +1 -0
- package/dist/managers/FlowsPersistence.d.ts +79 -0
- package/dist/managers/FlowsPersistence.js +3 -0
- package/dist/managers/FlowsPersistence.js.map +1 -0
- package/dist/managers/FlowsPersistenceAwsS3.d.ts +48 -0
- package/dist/managers/FlowsPersistenceAwsS3.js +284 -0
- package/dist/managers/FlowsPersistenceAwsS3.js.map +1 -0
- package/dist/managers/FlowsPersistenceFactory.d.ts +9 -0
- package/dist/managers/FlowsPersistenceFactory.js +3 -0
- package/dist/managers/FlowsPersistenceFactory.js.map +1 -0
- package/dist/managers/FlowsPersistenceFactoryImpl.d.ts +57 -0
- package/dist/managers/FlowsPersistenceFactoryImpl.js +119 -0
- package/dist/managers/FlowsPersistenceFactoryImpl.js.map +1 -0
- package/dist/managers/FlowsPersistenceFactoryPreset.d.ts +12 -0
- package/dist/managers/FlowsPersistenceFactoryPreset.js +25 -0
- package/dist/managers/FlowsPersistenceFactoryPreset.js.map +1 -0
- package/dist/managers/FlowsPersistenceFilesystem.d.ts +33 -0
- package/dist/managers/FlowsPersistenceFilesystem.js +180 -0
- package/dist/managers/FlowsPersistenceFilesystem.js.map +1 -0
- package/dist/managers/FlowsPersistenceGoogleCloudStorage.d.ts +40 -0
- package/dist/managers/FlowsPersistenceGoogleCloudStorage.js +209 -0
- package/dist/managers/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
- package/dist/managers/FlowsPersistenceSupabase.d.ts +33 -0
- package/dist/managers/FlowsPersistenceSupabase.js +152 -0
- package/dist/managers/FlowsPersistenceSupabase.js.map +1 -0
- package/dist/managers/FlowsPersistenceVolatile.d.ts +30 -0
- package/dist/managers/FlowsPersistenceVolatile.js +103 -0
- package/dist/managers/FlowsPersistenceVolatile.js.map +1 -0
- package/dist/managers/GptConfigsManager.d.ts +38 -0
- package/dist/managers/GptConfigsManager.js +159 -0
- package/dist/managers/GptConfigsManager.js.map +1 -0
- package/dist/managers/GptPlatformApiKeysManager.d.ts +36 -0
- package/dist/managers/GptPlatformApiKeysManager.js +3 -0
- package/dist/managers/GptPlatformApiKeysManager.js.map +1 -0
- package/dist/managers/GptPlatformApiKeysManagerFilesystem.d.ts +29 -0
- package/dist/managers/GptPlatformApiKeysManagerFilesystem.js +136 -0
- package/dist/managers/GptPlatformApiKeysManagerFilesystem.js.map +1 -0
- package/dist/managers/GptPlatformApiKeysManagerVolatile.d.ts +35 -0
- package/dist/managers/GptPlatformApiKeysManagerVolatile.js +51 -0
- package/dist/managers/GptPlatformApiKeysManagerVolatile.js.map +1 -0
- package/dist/managers/GptResourcesManager.d.ts +44 -0
- package/dist/managers/GptResourcesManager.js +180 -0
- package/dist/managers/GptResourcesManager.js.map +1 -0
- package/dist/managers/RequestContextHolder.d.ts +24 -0
- package/dist/managers/RequestContextHolder.js +43 -0
- package/dist/managers/RequestContextHolder.js.map +1 -0
- package/dist/managers/SelectorGenerator.d.ts +8 -0
- package/dist/managers/SelectorGenerator.js +15 -0
- package/dist/managers/SelectorGenerator.js.map +1 -0
- package/dist/managers/ToolManager.d.ts +21 -0
- package/dist/managers/ToolManager.js +264 -0
- package/dist/managers/ToolManager.js.map +1 -0
- package/dist/managers/ToolTipper.d.ts +35 -0
- package/dist/managers/ToolTipper.js +201 -0
- package/dist/managers/ToolTipper.js.map +1 -0
- package/dist/models/AskAiRequest.d.ts +14 -0
- package/dist/models/AskAiRequest.js +3 -0
- package/dist/models/AskAiRequest.js.map +1 -0
- package/dist/models/BaseToolGptParameters.d.ts +9 -0
- package/dist/models/BaseToolGptParameters.js +3 -0
- package/dist/models/BaseToolGptParameters.js.map +1 -0
- package/dist/models/BaseToolParam.d.ts +9 -0
- package/dist/models/BaseToolParam.js +3 -0
- package/dist/models/BaseToolParam.js.map +1 -0
- package/dist/models/BaseToolParameters.d.ts +9 -0
- package/dist/models/BaseToolParameters.js +3 -0
- package/dist/models/BaseToolParameters.js.map +1 -0
- package/dist/models/BrowserDevice.d.ts +18 -0
- package/dist/models/BrowserDevice.js +3 -0
- package/dist/models/BrowserDevice.js.map +1 -0
- package/dist/models/BrowserFramework.d.ts +36 -0
- package/dist/models/BrowserFramework.js +164 -0
- package/dist/models/BrowserFramework.js.map +1 -0
- package/dist/models/BrowserState.d.ts +25 -0
- package/dist/models/BrowserState.js +3 -0
- package/dist/models/BrowserState.js.map +1 -0
- package/dist/models/BrowserStateFlowReference.d.ts +10 -0
- package/dist/models/BrowserStateFlowReference.js +3 -0
- package/dist/models/BrowserStateFlowReference.js.map +1 -0
- package/dist/models/CreateDonobuFlow.d.ts +88 -0
- package/dist/models/CreateDonobuFlow.js +3 -0
- package/dist/models/CreateDonobuFlow.js.map +1 -0
- package/dist/models/CreateGoogleSteetviewExtractionFlow.d.ts +21 -0
- package/dist/models/CreateGoogleSteetviewExtractionFlow.js +3 -0
- package/dist/models/CreateGoogleSteetviewExtractionFlow.js.map +1 -0
- package/dist/models/CustomTool.d.ts +9 -0
- package/dist/models/CustomTool.js +3 -0
- package/dist/models/CustomTool.js.map +1 -0
- package/dist/models/DonobuAgentType.d.ts +2 -0
- package/dist/models/DonobuAgentType.js +5 -0
- package/dist/models/DonobuAgentType.js.map +1 -0
- package/dist/models/DonobuAnnotated.d.ts +23 -0
- package/dist/models/DonobuAnnotated.js +12 -0
- package/dist/models/DonobuAnnotated.js.map +1 -0
- package/dist/models/DonobuDeploymentEnvironment.d.ts +5 -0
- package/dist/models/DonobuDeploymentEnvironment.js +10 -0
- package/dist/models/DonobuDeploymentEnvironment.js.map +1 -0
- package/dist/models/DonobuErrorResponse.d.ts +13 -0
- package/dist/models/DonobuErrorResponse.js +3 -0
- package/dist/models/DonobuErrorResponse.js.map +1 -0
- package/dist/models/ElementSelector.d.ts +14 -0
- package/dist/models/ElementSelector.js +3 -0
- package/dist/models/ElementSelector.js.map +1 -0
- package/dist/models/ElementSelectorForReplay.d.ts +14 -0
- package/dist/models/ElementSelectorForReplay.js +3 -0
- package/dist/models/ElementSelectorForReplay.js.map +1 -0
- package/dist/models/FlowMetadata.d.ts +123 -0
- package/dist/models/FlowMetadata.js +50 -0
- package/dist/models/FlowMetadata.js.map +1 -0
- package/dist/models/FlowsQuery.d.ts +11 -0
- package/dist/models/FlowsQuery.js +3 -0
- package/dist/models/FlowsQuery.js.map +1 -0
- package/dist/models/FocusedPage.d.ts +4 -0
- package/dist/models/FocusedPage.js +3 -0
- package/dist/models/FocusedPage.js.map +1 -0
- package/dist/models/GptConfig.d.ts +38 -0
- package/dist/models/GptConfig.js +3 -0
- package/dist/models/GptConfig.js.map +1 -0
- package/dist/models/GptMessage.d.ts +43 -0
- package/dist/models/GptMessage.js +3 -0
- package/dist/models/GptMessage.js.map +1 -0
- package/dist/models/GptResource.d.ts +33 -0
- package/dist/models/GptResource.js +3 -0
- package/dist/models/GptResource.js.map +1 -0
- package/dist/models/InteractableElement.d.ts +13 -0
- package/dist/models/InteractableElement.js +3 -0
- package/dist/models/InteractableElement.js.map +1 -0
- package/dist/models/ProposedToolCall.d.ts +19 -0
- package/dist/models/ProposedToolCall.js +3 -0
- package/dist/models/ProposedToolCall.js.map +1 -0
- package/dist/models/RequestContext.d.ts +21 -0
- package/dist/models/RequestContext.js +24 -0
- package/dist/models/RequestContext.js.map +1 -0
- package/dist/models/ToolCall.d.ts +38 -0
- package/dist/models/ToolCall.js +3 -0
- package/dist/models/ToolCall.js.map +1 -0
- package/dist/models/ToolCallContext.d.ts +22 -0
- package/dist/models/ToolCallContext.js +3 -0
- package/dist/models/ToolCallContext.js.map +1 -0
- package/dist/models/ToolCallResult.d.ts +20 -0
- package/dist/models/ToolCallResult.js +19 -0
- package/dist/models/ToolCallResult.js.map +1 -0
- package/dist/models/VideoSegment.d.ts +20 -0
- package/dist/models/VideoSegment.js +3 -0
- package/dist/models/VideoSegment.js.map +1 -0
- package/dist/persistence/AgentsPersistence.d.ts +11 -0
- package/dist/persistence/AgentsPersistence.js +3 -0
- package/dist/persistence/AgentsPersistence.js.map +1 -0
- package/dist/persistence/AgentsPersistenceFilesystem.d.ts +15 -0
- package/dist/persistence/AgentsPersistenceFilesystem.js +48 -0
- package/dist/persistence/AgentsPersistenceFilesystem.js.map +1 -0
- package/dist/persistence/AgentsPersistenceSqlite.d.ts +14 -0
- package/dist/persistence/AgentsPersistenceSqlite.js +51 -0
- package/dist/persistence/AgentsPersistenceSqlite.js.map +1 -0
- package/dist/persistence/AgentsPersistenceVolatile.d.ts +13 -0
- package/dist/persistence/AgentsPersistenceVolatile.js +27 -0
- package/dist/persistence/AgentsPersistenceVolatile.js.map +1 -0
- package/dist/persistence/DonobuSqliteDb.d.ts +11 -0
- package/dist/persistence/DonobuSqliteDb.js +178 -0
- package/dist/persistence/DonobuSqliteDb.js.map +1 -0
- package/dist/persistence/FlowsPersistence.d.ts +94 -0
- package/dist/persistence/FlowsPersistence.js +3 -0
- package/dist/persistence/FlowsPersistence.js.map +1 -0
- package/dist/persistence/FlowsPersistenceAwsS3.d.ts +70 -0
- package/dist/persistence/FlowsPersistenceAwsS3.js +447 -0
- package/dist/persistence/FlowsPersistenceAwsS3.js.map +1 -0
- package/dist/persistence/FlowsPersistenceFactory.d.ts +9 -0
- package/dist/persistence/FlowsPersistenceFactory.js +3 -0
- package/dist/persistence/FlowsPersistenceFactory.js.map +1 -0
- package/dist/persistence/FlowsPersistenceFactoryImpl.d.ts +60 -0
- package/dist/persistence/FlowsPersistenceFactoryImpl.js +244 -0
- package/dist/persistence/FlowsPersistenceFactoryImpl.js.map +1 -0
- package/dist/persistence/FlowsPersistenceFactoryPreset.d.ts +12 -0
- package/dist/persistence/FlowsPersistenceFactoryPreset.js +25 -0
- package/dist/persistence/FlowsPersistenceFactoryPreset.js.map +1 -0
- package/dist/persistence/FlowsPersistenceFilesystem.d.ts +42 -0
- package/dist/persistence/FlowsPersistenceFilesystem.js +271 -0
- package/dist/persistence/FlowsPersistenceFilesystem.js.map +1 -0
- package/dist/persistence/FlowsPersistenceGoogleCloudStorage.d.ts +62 -0
- package/dist/persistence/FlowsPersistenceGoogleCloudStorage.js +406 -0
- package/dist/persistence/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
- package/dist/persistence/FlowsPersistenceSqlite.d.ts +37 -0
- package/dist/persistence/FlowsPersistenceSqlite.js +229 -0
- package/dist/persistence/FlowsPersistenceSqlite.js.map +1 -0
- package/dist/persistence/FlowsPersistenceSupabase.d.ts +38 -0
- package/dist/persistence/FlowsPersistenceSupabase.js +216 -0
- package/dist/persistence/FlowsPersistenceSupabase.js.map +1 -0
- package/dist/persistence/FlowsPersistenceVolatile.d.ts +35 -0
- package/dist/persistence/FlowsPersistenceVolatile.js +147 -0
- package/dist/persistence/FlowsPersistenceVolatile.js.map +1 -0
- package/dist/persistence/GptConfigsPersistence.d.ts +11 -0
- package/dist/persistence/GptConfigsPersistence.js +3 -0
- package/dist/persistence/GptConfigsPersistence.js.map +1 -0
- package/dist/persistence/GptConfigsPersistenceFilesystem.d.ts +16 -0
- package/dist/persistence/GptConfigsPersistenceFilesystem.js +54 -0
- package/dist/persistence/GptConfigsPersistenceFilesystem.js.map +1 -0
- package/dist/persistence/GptConfigsPersistenceSqlite.d.ts +12 -0
- package/dist/persistence/GptConfigsPersistenceSqlite.js +36 -0
- package/dist/persistence/GptConfigsPersistenceSqlite.js.map +1 -0
- package/dist/persistence/GptConfigsPersistenceVolatile.d.ts +14 -0
- package/dist/persistence/GptConfigsPersistenceVolatile.js +32 -0
- package/dist/persistence/GptConfigsPersistenceVolatile.js.map +1 -0
- package/dist/persistence/GptResourcesPersistence.d.ts +11 -0
- package/dist/persistence/GptResourcesPersistence.js +3 -0
- package/dist/persistence/GptResourcesPersistence.js.map +1 -0
- package/dist/persistence/GptResourcesPersistenceFilesystem.d.ts +20 -0
- package/dist/persistence/GptResourcesPersistenceFilesystem.js +79 -0
- package/dist/persistence/GptResourcesPersistenceFilesystem.js.map +1 -0
- package/dist/persistence/GptResourcesPersistenceVolatile.d.ts +14 -0
- package/dist/persistence/GptResourcesPersistenceVolatile.js +32 -0
- package/dist/persistence/GptResourcesPersistenceVolatile.js.map +1 -0
- package/dist/test.d.ts +66 -0
- package/dist/test.js +288 -0
- package/dist/test.js.map +1 -0
- package/dist/testfixtures.d.ts +66 -0
- package/dist/testfixtures.js +288 -0
- package/dist/testfixtures.js.map +1 -0
- package/dist/tools/AggregateExtractedStreetviewDataTool.d.ts +24 -0
- package/dist/tools/AggregateExtractedStreetviewDataTool.js +61 -0
- package/dist/tools/AggregateExtractedStreetviewDataTool.js.map +1 -0
- package/dist/tools/AnalyzePageTextTool.d.ts +22 -0
- package/dist/tools/AnalyzePageTextTool.js +59 -0
- package/dist/tools/AnalyzePageTextTool.js.map +1 -0
- package/dist/tools/AssertTool.d.ts +24 -0
- package/dist/tools/AssertTool.js +56 -0
- package/dist/tools/AssertTool.js.map +1 -0
- package/dist/tools/ChangeWebBrowserTabTool.d.ts +18 -0
- package/dist/tools/ChangeWebBrowserTabTool.js +36 -0
- package/dist/tools/ChangeWebBrowserTabTool.js.map +1 -0
- package/dist/tools/ChooseSelectOptionTool.d.ts +18 -0
- package/dist/tools/ChooseSelectOptionTool.js +18 -0
- package/dist/tools/ChooseSelectOptionTool.js.map +1 -0
- package/dist/tools/ClickButtonTool.d.ts +14 -0
- package/dist/tools/ClickButtonTool.js +36 -0
- package/dist/tools/ClickButtonTool.js.map +1 -0
- package/dist/tools/ClickTool.d.ts +14 -0
- package/dist/tools/ClickTool.js +36 -0
- package/dist/tools/ClickTool.js.map +1 -0
- package/dist/tools/CreateBrowserCookieReportTool.d.ts +15 -0
- package/dist/tools/CreateBrowserCookieReportTool.js +98 -0
- package/dist/tools/CreateBrowserCookieReportTool.js.map +1 -0
- package/dist/tools/CustomToolRunnerTool.d.ts +14 -0
- package/dist/tools/CustomToolRunnerTool.js +35 -0
- package/dist/tools/CustomToolRunnerTool.js.map +1 -0
- package/dist/tools/DetectBrokenLinksTool.d.ts +38 -0
- package/dist/tools/DetectBrokenLinksTool.js +264 -0
- package/dist/tools/DetectBrokenLinksTool.js.map +1 -0
- package/dist/tools/DownloadPdfTool.d.ts +19 -0
- package/dist/tools/DownloadPdfTool.js +48 -0
- package/dist/tools/DownloadPdfTool.js.map +1 -0
- package/dist/tools/ExtractGoogleStreetviewEntityDataTool.d.ts +50 -0
- package/dist/tools/ExtractGoogleStreetviewEntityDataTool.js +176 -0
- package/dist/tools/ExtractGoogleStreetviewEntityDataTool.js.map +1 -0
- package/dist/tools/ExtractPaymentProviderKeyTool.d.ts +16 -0
- package/dist/tools/ExtractPaymentProviderKeyTool.js +80 -0
- package/dist/tools/ExtractPaymentProviderKeyTool.js.map +1 -0
- package/dist/tools/ExtractPublicFacebookEntityDataTool.d.ts +27 -0
- package/dist/tools/ExtractPublicFacebookEntityDataTool.js +232 -0
- package/dist/tools/ExtractPublicFacebookEntityDataTool.js.map +1 -0
- package/dist/tools/GetEntityDataFromGoogleMapResult.d.ts +27 -0
- package/dist/tools/GetEntityDataFromGoogleMapResult.js +36 -0
- package/dist/tools/GetEntityDataFromGoogleMapResult.js.map +1 -0
- package/dist/tools/GoForwardOrBackTool.d.ts +22 -0
- package/dist/tools/GoForwardOrBackTool.js +37 -0
- package/dist/tools/GoForwardOrBackTool.js.map +1 -0
- package/dist/tools/GoToGoogleMapsStreetViewTool.d.ts +37 -0
- package/dist/tools/GoToGoogleMapsStreetViewTool.js +119 -0
- package/dist/tools/GoToGoogleMapsStreetViewTool.js.map +1 -0
- package/dist/tools/GoToWebpageTool.d.ts +20 -0
- package/dist/tools/GoToWebpageTool.js +40 -0
- package/dist/tools/GoToWebpageTool.js.map +1 -0
- package/dist/tools/HandleBrowserDialogTool.d.ts +26 -0
- package/dist/tools/HandleBrowserDialogTool.js +22 -0
- package/dist/tools/HandleBrowserDialogTool.js.map +1 -0
- package/dist/tools/HoverOverElementTool.d.ts +15 -0
- package/dist/tools/HoverOverElementTool.js +18 -0
- package/dist/tools/HoverOverElementTool.js.map +1 -0
- package/dist/tools/InputRandomizedEmailAddressTool.d.ts +27 -0
- package/dist/tools/InputRandomizedEmailAddressTool.js +74 -0
- package/dist/tools/InputRandomizedEmailAddressTool.js.map +1 -0
- package/dist/tools/InputTextTool.d.ts +24 -0
- package/dist/tools/InputTextTool.js +48 -0
- package/dist/tools/InputTextTool.js.map +1 -0
- package/dist/tools/MakeCommentTool.d.ts +21 -0
- package/dist/tools/MakeCommentTool.js +31 -0
- package/dist/tools/MakeCommentTool.js.map +1 -0
- package/dist/tools/MarkObjectiveCompleteTool.d.ts +27 -0
- package/dist/tools/MarkObjectiveCompleteTool.js +39 -0
- package/dist/tools/MarkObjectiveCompleteTool.js.map +1 -0
- package/dist/tools/MarkObjectiveNotCompletableTool.d.ts +14 -0
- package/dist/tools/MarkObjectiveNotCompletableTool.js +35 -0
- package/dist/tools/MarkObjectiveNotCompletableTool.js.map +1 -0
- package/dist/tools/NavigateToWebpage.d.ts +19 -0
- package/dist/tools/NavigateToWebpage.js +25 -0
- package/dist/tools/NavigateToWebpage.js.map +1 -0
- package/dist/tools/NavigateToWebpageTool.d.ts +20 -0
- package/dist/tools/NavigateToWebpageTool.js +40 -0
- package/dist/tools/NavigateToWebpageTool.js.map +1 -0
- package/dist/tools/NavigateWithinStreetView.d.ts +38 -0
- package/dist/tools/NavigateWithinStreetView.js +107 -0
- package/dist/tools/NavigateWithinStreetView.js.map +1 -0
- package/dist/tools/PauseForUserInteractionTool.d.ts +18 -0
- package/dist/tools/PauseForUserInteractionTool.js +24 -0
- package/dist/tools/PauseForUserInteractionTool.js.map +1 -0
- package/dist/tools/PressKeyTool.d.ts +18 -0
- package/dist/tools/PressKeyTool.js +43 -0
- package/dist/tools/PressKeyTool.js.map +1 -0
- package/dist/tools/ReloadPageTool.d.ts +14 -0
- package/dist/tools/ReloadPageTool.js +20 -0
- package/dist/tools/ReloadPageTool.js.map +1 -0
- package/dist/tools/ReplayableInteraction.d.ts +62 -0
- package/dist/tools/ReplayableInteraction.js +170 -0
- package/dist/tools/ReplayableInteraction.js.map +1 -0
- package/dist/tools/RunAccessibilityTestTool.d.ts +14 -0
- package/dist/tools/RunAccessibilityTestTool.js +49 -0
- package/dist/tools/RunAccessibilityTestTool.js.map +1 -0
- package/dist/tools/RunInlineJavaScriptCodeTool.d.ts +17 -0
- package/dist/tools/RunInlineJavaScriptCodeTool.js +30 -0
- package/dist/tools/RunInlineJavaScriptCodeTool.js.map +1 -0
- package/dist/tools/RunSandboxedJavaScriptCodeTool.d.ts +18 -0
- package/dist/tools/RunSandboxedJavaScriptCodeTool.js +43 -0
- package/dist/tools/RunSandboxedJavaScriptCodeTool.js.map +1 -0
- package/dist/tools/SaveWebpageAsPdfTool.d.ts +15 -0
- package/dist/tools/SaveWebpageAsPdfTool.js +27 -0
- package/dist/tools/SaveWebpageAsPdfTool.js.map +1 -0
- package/dist/tools/ScrollPageTool.d.ts +18 -0
- package/dist/tools/ScrollPageTool.js +21 -0
- package/dist/tools/ScrollPageTool.js.map +1 -0
- package/dist/tools/SetRunModeTool.d.ts +20 -0
- package/dist/tools/SetRunModeTool.js +22 -0
- package/dist/tools/SetRunModeTool.js.map +1 -0
- package/dist/tools/SummarizeLearningsTool.d.ts +21 -0
- package/dist/tools/SummarizeLearningsTool.js +31 -0
- package/dist/tools/SummarizeLearningsTool.js.map +1 -0
- package/dist/tools/Tool.d.ts +35 -0
- package/dist/tools/Tool.js +38 -0
- package/dist/tools/Tool.js.map +1 -0
- package/dist/tools/TriggerDonobuFlowTool.d.ts +19 -0
- package/dist/tools/TriggerDonobuFlowTool.js +26 -0
- package/dist/tools/TriggerDonobuFlowTool.js.map +1 -0
- package/dist/tools/WaitTool.d.ts +18 -0
- package/dist/tools/WaitTool.js +20 -0
- package/dist/tools/WaitTool.js.map +1 -0
- package/dist/utils/DirectoryUtils.d.ts +11 -0
- package/dist/utils/DirectoryUtils.js +37 -0
- package/dist/utils/DirectoryUtils.js.map +1 -0
- package/dist/utils/JsonUtils.d.ts +19 -0
- package/dist/utils/JsonUtils.js +124 -0
- package/dist/utils/JsonUtils.js.map +1 -0
- package/dist/utils/Logger.d.ts +17 -0
- package/dist/utils/Logger.js +95 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/MiscUtils.d.ts +62 -0
- package/dist/utils/MiscUtils.js +164 -0
- package/dist/utils/MiscUtils.js.map +1 -0
- package/dist/utils/PlaywrightUtils.d.ts +180 -0
- package/dist/utils/PlaywrightUtils.js +1086 -0
- package/dist/utils/PlaywrightUtils.js.map +1 -0
- package/dist/utils/VerbConverter.d.ts +14 -0
- package/dist/utils/VerbConverter.js +96 -0
- package/dist/utils/VerbConverter.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,1086 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PlaywrightUtils = void 0;
|
|
7
|
+
const Logger_1 = require("./Logger");
|
|
8
|
+
const MiscUtils_1 = require("./MiscUtils");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const PageClosedException_1 = require("../exceptions/PageClosedException");
|
|
11
|
+
const child_process_1 = require("child_process");
|
|
12
|
+
/**
|
|
13
|
+
* Miscellaneous utility functions for working with the Playwright SDK. If you are looking to
|
|
14
|
+
* instantiate a Playwright instance, see PlaywrightSetup instead.
|
|
15
|
+
*/
|
|
16
|
+
class PlaywrightUtils {
|
|
17
|
+
static logger = Logger_1.Logger.appLogger;
|
|
18
|
+
static ACCESSIBILITY_TEST_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('axe.js'));
|
|
19
|
+
static CLICKABLE_ELEMENTS_TRACKER_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('clickable-elements-tracker.js'));
|
|
20
|
+
static DIALOG_PROMPT_TRACKER_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('dialog-prompt-tracker.js'));
|
|
21
|
+
static SMART_SELECTOR_GENERATOR_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('smart-selector-generator.js'));
|
|
22
|
+
static PAGE_INTERACTIONS_TRACKER_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('page-interactions-tracker.js'));
|
|
23
|
+
static DONOBU_CONTROL_PANEL_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('control-panel.js'));
|
|
24
|
+
// WARNING: If the control panel ID is changed here, you must also change the
|
|
25
|
+
// control-panel.js control panel ID value.
|
|
26
|
+
static DONOBU_CONTROL_PANEL_ELEMENT_ID = 'donobu-control-panel';
|
|
27
|
+
static DONOBU_CONTROL_PANEL_HEADLINE_ELEMENT_ID = 'donobu-control-panel-title-text';
|
|
28
|
+
static DONOBU_INTERACTABLE_ATTRIBUTE = 'data-donobu-interactable';
|
|
29
|
+
static DONOBU_ANNOTATION_ATTRIBUTE = 'data-donobu-annotation';
|
|
30
|
+
/**
|
|
31
|
+
* Attempts to take a screenshot of the given page in PNG format, returning
|
|
32
|
+
* the raw byte array. If the operation fails, an empty array is returned.
|
|
33
|
+
* Note that if the Donobu control panel is present in the page, it will be
|
|
34
|
+
* excluded from the screenshot.
|
|
35
|
+
*/
|
|
36
|
+
static async takePngScreenshot(page) {
|
|
37
|
+
try {
|
|
38
|
+
const style = `#${PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID} { display: none !important; }`;
|
|
39
|
+
return await page.screenshot({
|
|
40
|
+
style,
|
|
41
|
+
type: 'png',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
46
|
+
throw new PageClosedException_1.PageClosedException();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Generate valid selectors for the given element. The generated selectors are
|
|
55
|
+
* in a priority order based on their ability to identify the given element.
|
|
56
|
+
* For example, an unambiguous selector that matches the element exactly are
|
|
57
|
+
* first in the list, and weaker selectors that match multiple elements are
|
|
58
|
+
* last.
|
|
59
|
+
*/
|
|
60
|
+
static async generateSelectors(element) {
|
|
61
|
+
return element.evaluate((elem) => {
|
|
62
|
+
return window.donobuGenerateSmartSelectors(elem);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns a JavaScript code snippet intended to run as an initialization
|
|
67
|
+
* script for `DonobuFlow` flows. This script helps other scripts to know
|
|
68
|
+
* which elements have mouse-click related event listeners attached to them
|
|
69
|
+
* via inspecting the {@code window.donobuGetClickableElements} element array.
|
|
70
|
+
*/
|
|
71
|
+
static clickableElementsTrackerInitScript() {
|
|
72
|
+
return PlaywrightUtils.CLICKABLE_ELEMENTS_TRACKER_INIT_SCRIPT;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns a JavaScript code snippet intended to run as an initialization
|
|
76
|
+
* script for `DonobuFlow` flows. This script helps flows handle/track
|
|
77
|
+
* prompts/confirmations. This is done specially since these browser actions
|
|
78
|
+
* pause the Javascript main thread and also cause issues with running various
|
|
79
|
+
* Playwright actions. See `DonobuFlow.onDialog(Dialog)` for details.
|
|
80
|
+
*/
|
|
81
|
+
static dialogPromptTrackerInitScript() {
|
|
82
|
+
return PlaywrightUtils.DIALOG_PROMPT_TRACKER_INIT_SCRIPT;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns a JavaScript code snippet intended to run as an initialization
|
|
86
|
+
* script for `DonobuFlow` flows. This is an in-page version of the
|
|
87
|
+
* `SelectorGenerator` class so that smart selectors can be generated in
|
|
88
|
+
* the web client. This is done so the
|
|
89
|
+
* {@link PlaywrightUtils.pageInteractionsTrackerInitScript()} can generate
|
|
90
|
+
* smart selectors on the fly and pass them to the `PageInteractionTracker`
|
|
91
|
+
* so the page interactions can be converted to synthetic `ToolCallResult`s.
|
|
92
|
+
*/
|
|
93
|
+
static smartSelectorGeneratorInitScript() {
|
|
94
|
+
return PlaywrightUtils.SMART_SELECTOR_GENERATOR_INIT_SCRIPT;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* This script is used by the `RunAccessibilityTestTool` to test the
|
|
98
|
+
* accessibility of a webpage. This script is injected on page load, rather
|
|
99
|
+
* than when running the `RunAccessibilityTestTool` because we need to bypass
|
|
100
|
+
* webpage Content Security Policy (CSP); this is done by injecting the
|
|
101
|
+
* script via `BrowserContext#addInitScript`.
|
|
102
|
+
*/
|
|
103
|
+
static accessibilityTestInitScript() {
|
|
104
|
+
return PlaywrightUtils.ACCESSIBILITY_TEST_INIT_SCRIPT;
|
|
105
|
+
}
|
|
106
|
+
static pageInteractionsTrackerInitScript() {
|
|
107
|
+
return PlaywrightUtils.PAGE_INTERACTIONS_TRACKER_INIT_SCRIPT;
|
|
108
|
+
}
|
|
109
|
+
static donobuControlPanelInitScript() {
|
|
110
|
+
return PlaywrightUtils.DONOBU_CONTROL_PANEL_INIT_SCRIPT;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Creates a visual sparkle effect at the specified browser-page coordinates,
|
|
114
|
+
* automatically detecting if the point lies inside a same-origin iframe (and nesting deeper
|
|
115
|
+
* if necessary). Injects the sparkle into that frame’s document at the correct local coords.
|
|
116
|
+
*
|
|
117
|
+
* @param page - The Playwright Page object
|
|
118
|
+
* @param x - The x-coordinate in the top-level page coordinate space (relative to the browser window)
|
|
119
|
+
* @param y - The y-coordinate in the top-level page coordinate space
|
|
120
|
+
* @param durationMs - How long the sparkle remains (ms, default 800)
|
|
121
|
+
* @param emoji - The emoji to display (default '✨')
|
|
122
|
+
* @param size - CSS font-size for the emoji (default '40px')
|
|
123
|
+
*/
|
|
124
|
+
static async createSparkleEffect(page, x, y, durationMs = 800, emoji = '✨', size = '40px') {
|
|
125
|
+
// 1) Find the deepest same-origin frame covering (x, y), recursing if iframes nest further.
|
|
126
|
+
// Also get the coordinate in that frame’s local coordinate system.
|
|
127
|
+
const { targetFrame, localX, localY } = await this.findDeepestFrameAtPoint(page, x, y);
|
|
128
|
+
// 2) Inject the sparkle container & style in that frame
|
|
129
|
+
await targetFrame.evaluate(({ x, y, emoji, size }) => {
|
|
130
|
+
const containerId = 'playwright-sparkle-shadow-container';
|
|
131
|
+
// Remove old container if needed
|
|
132
|
+
const old = document.getElementById(containerId);
|
|
133
|
+
if (old)
|
|
134
|
+
old.remove();
|
|
135
|
+
const container = document.createElement('div');
|
|
136
|
+
container.id = containerId;
|
|
137
|
+
const shadowRoot = container.attachShadow({ mode: 'open' });
|
|
138
|
+
const sparkle = document.createElement('span');
|
|
139
|
+
sparkle.id = 'playwright-sparkle-element';
|
|
140
|
+
sparkle.textContent = emoji;
|
|
141
|
+
// Position & style
|
|
142
|
+
sparkle.style.position = 'fixed';
|
|
143
|
+
sparkle.style.left = `${x}px`;
|
|
144
|
+
sparkle.style.top = `${y}px`;
|
|
145
|
+
sparkle.style.fontSize = size;
|
|
146
|
+
sparkle.style.transform = 'translate(-50%, -50%)';
|
|
147
|
+
sparkle.style.zIndex = '2147483647'; // Very large to float above most overlays
|
|
148
|
+
sparkle.style.pointerEvents = 'none';
|
|
149
|
+
sparkle.style.userSelect = 'none';
|
|
150
|
+
sparkle.style.filter = 'drop-shadow(0 0 2px rgba(255,255,255,0.7))';
|
|
151
|
+
sparkle.style.animation = 'sparkle-appear 0.3s ease-out forwards';
|
|
152
|
+
const styleEl = document.createElement('style');
|
|
153
|
+
styleEl.textContent = `
|
|
154
|
+
:host {
|
|
155
|
+
all: initial;
|
|
156
|
+
}
|
|
157
|
+
@keyframes sparkle-appear {
|
|
158
|
+
0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
|
|
159
|
+
50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
|
|
160
|
+
100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
|
|
161
|
+
}
|
|
162
|
+
@keyframes sparkle-disappear {
|
|
163
|
+
0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
|
|
164
|
+
100% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
|
|
165
|
+
}
|
|
166
|
+
`;
|
|
167
|
+
shadowRoot.appendChild(styleEl);
|
|
168
|
+
shadowRoot.appendChild(sparkle);
|
|
169
|
+
document.body.appendChild(container);
|
|
170
|
+
console.log(`Sparkle created at ${x}, ${y} with emoji "${emoji}"`);
|
|
171
|
+
}, { x: localX, y: localY, emoji, size });
|
|
172
|
+
// 3) Wait the duration
|
|
173
|
+
await page.waitForTimeout(durationMs);
|
|
174
|
+
// 4) Fade out and remove
|
|
175
|
+
await targetFrame.evaluate(() => {
|
|
176
|
+
const container = document.getElementById('playwright-sparkle-shadow-container');
|
|
177
|
+
if (container && container.shadowRoot) {
|
|
178
|
+
const sparkle = container.shadowRoot.getElementById('playwright-sparkle-element');
|
|
179
|
+
if (sparkle) {
|
|
180
|
+
sparkle.style.animation = 'sparkle-disappear 0.3s ease-in forwards';
|
|
181
|
+
}
|
|
182
|
+
setTimeout(() => {
|
|
183
|
+
container.remove();
|
|
184
|
+
console.log('Sparkle effect removed');
|
|
185
|
+
}, 300);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
// 5) Wait for removal
|
|
189
|
+
await page.waitForTimeout(300);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Recursively finds the deepest same-origin Frame that covers the point (top-level coordinates).
|
|
193
|
+
* Returns the Frame plus the local coordinates (relative to that frame's viewport).
|
|
194
|
+
*
|
|
195
|
+
* If no same-origin child frame covers (x, y), it returns the main frame and the original coords.
|
|
196
|
+
*/
|
|
197
|
+
static async findDeepestFrameAtPoint(page, x, y, frame = page.mainFrame()) {
|
|
198
|
+
// We'll attempt to see if any child <iframe> in this frame covers the coordinate
|
|
199
|
+
// Steps:
|
|
200
|
+
// (1) Convert the top-level coordinate (x, y) into this frame's local coordinate system.
|
|
201
|
+
// (2) If outside the frame's bounding client rect (in its parent), skip further checks.
|
|
202
|
+
// (3) Check each child <iframe> inside this frame's DOM. If the point is inside that <iframe>,
|
|
203
|
+
// convert to the child frame's coords and recurse. If the child frame is cross-origin,
|
|
204
|
+
// skip it.
|
|
205
|
+
//
|
|
206
|
+
// If none of the children contain the point, we are the "deepest" frame for that point.
|
|
207
|
+
// If we're the mainFrame, there's no parent boundingRect. So we start with (x, y) as is.
|
|
208
|
+
let localX = x;
|
|
209
|
+
let localY = y;
|
|
210
|
+
// If there's a parent frame, we need to see where the <iframe> itself is in parent's coords
|
|
211
|
+
// But we only do that if frame is NOT the main frame
|
|
212
|
+
const parentFrame = frame.parentFrame();
|
|
213
|
+
if (parentFrame) {
|
|
214
|
+
// Evaluate bounding rect of the <iframe> that hosts this child frame
|
|
215
|
+
// We'll do a small trick: find the <iframe> element in the parent that has frame.url()
|
|
216
|
+
// or frame.name(). There's no direct method, so we rely on the frame element handle:
|
|
217
|
+
const frameElement = await frame.frameElement();
|
|
218
|
+
const box = await frameElement.boundingBox();
|
|
219
|
+
if (!box) {
|
|
220
|
+
// If we can't get bounding box, fallback
|
|
221
|
+
return { targetFrame: page.mainFrame(), localX: x, localY: y };
|
|
222
|
+
}
|
|
223
|
+
// The bounding box's coords are relative to the parent's main page.
|
|
224
|
+
// Convert our (x, y) from the parent's coordinate system to this child's local system.
|
|
225
|
+
if (x < box.x ||
|
|
226
|
+
y < box.y ||
|
|
227
|
+
x > box.x + box.width ||
|
|
228
|
+
y > box.y + box.height) {
|
|
229
|
+
// The point is not inside this child frame's bounding box at all
|
|
230
|
+
// so it's not relevant. We'll skip it. The caller will continue searching siblings.
|
|
231
|
+
return { targetFrame: page.mainFrame(), localX: x, localY: y };
|
|
232
|
+
}
|
|
233
|
+
// So we are inside this child frame. Convert (x, y) to local coords
|
|
234
|
+
localX = x - box.x; // offset from left
|
|
235
|
+
localY = y - box.y; // offset from top
|
|
236
|
+
// Now we must also account for the child frame's own scrolling. Evaluate in the child:
|
|
237
|
+
const scrollOffsets = await frame.evaluate(() => {
|
|
238
|
+
return { sx: window.scrollX, sy: window.scrollY };
|
|
239
|
+
});
|
|
240
|
+
localX += scrollOffsets.sx;
|
|
241
|
+
localY += scrollOffsets.sy;
|
|
242
|
+
}
|
|
243
|
+
// Next, see if there's a deeper child frame (iframe) in this frame that covers (localX, localY)
|
|
244
|
+
const childFrames = frame.childFrames();
|
|
245
|
+
for (const child of childFrames) {
|
|
246
|
+
// We'll see if child is same-origin by trying a small evaluate
|
|
247
|
+
// If it's cross-origin, we'll catch the error & skip
|
|
248
|
+
try {
|
|
249
|
+
// Convert localX/Y into child's bounding box
|
|
250
|
+
const childElement = await child.frameElement();
|
|
251
|
+
const childBox = await childElement.boundingBox();
|
|
252
|
+
if (!childBox) {
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
// Check if local point is inside child's bounding box
|
|
256
|
+
if (localX >= childBox.x &&
|
|
257
|
+
localY >= childBox.y &&
|
|
258
|
+
localX <= childBox.x + childBox.width &&
|
|
259
|
+
localY <= childBox.y + childBox.height) {
|
|
260
|
+
// Convert to child's local coords
|
|
261
|
+
let childLocalX = localX - childBox.x;
|
|
262
|
+
let childLocalY = localY - childBox.y;
|
|
263
|
+
// Add child's scroll offset
|
|
264
|
+
const childScroll = await child.evaluate(() => {
|
|
265
|
+
return { sx: window.scrollX, sy: window.scrollY };
|
|
266
|
+
});
|
|
267
|
+
childLocalX += childScroll.sx;
|
|
268
|
+
childLocalY += childScroll.sy;
|
|
269
|
+
// Recurse deeper
|
|
270
|
+
return await this.findDeepestFrameAtPoint(page, childLocalX, childLocalY, child);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
// Probably cross-origin or some other error, skip
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
// If we get here, none of the children contain the point (or are cross-origin),
|
|
278
|
+
// so this frame is the deepest coverage.
|
|
279
|
+
return { targetFrame: frame, localX, localY };
|
|
280
|
+
}
|
|
281
|
+
static async getLocatorOrItsLabel(element) {
|
|
282
|
+
const timeoutMilliseconds = 5000;
|
|
283
|
+
try {
|
|
284
|
+
const id = await element.getAttribute('id', {
|
|
285
|
+
timeout: timeoutMilliseconds,
|
|
286
|
+
});
|
|
287
|
+
if (id) {
|
|
288
|
+
// Get the underlying ElementHandle first
|
|
289
|
+
const handle = await element.elementHandle({
|
|
290
|
+
timeout: timeoutMilliseconds / 5,
|
|
291
|
+
});
|
|
292
|
+
if (handle) {
|
|
293
|
+
// From the handle, retrieve the frame that owns this element
|
|
294
|
+
const frame = await handle.ownerFrame();
|
|
295
|
+
if (frame) {
|
|
296
|
+
// Look for label with matching 'for' attribute
|
|
297
|
+
const labelByFor = frame.locator(`label[for="${id}"]`);
|
|
298
|
+
if ((await labelByFor.count()) > 0) {
|
|
299
|
+
await labelByFor.waitFor({
|
|
300
|
+
state: 'visible',
|
|
301
|
+
timeout: timeoutMilliseconds / 5,
|
|
302
|
+
});
|
|
303
|
+
return labelByFor;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
// Fallback: look for a wrapping label
|
|
309
|
+
const wrappingLabel = element.locator('xpath=ancestor::label');
|
|
310
|
+
if ((await wrappingLabel.count()) > 0) {
|
|
311
|
+
await wrappingLabel.waitFor({
|
|
312
|
+
state: 'visible',
|
|
313
|
+
timeout: timeoutMilliseconds / 5,
|
|
314
|
+
});
|
|
315
|
+
return wrappingLabel;
|
|
316
|
+
}
|
|
317
|
+
// Neither "for" nor wrapping label found
|
|
318
|
+
return element;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
322
|
+
throw new PageClosedException_1.PageClosedException();
|
|
323
|
+
}
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Reads and clears the desired next state as directed by the in-flow control
|
|
329
|
+
* panel. Note that the control panel does not have carte blanche control, as
|
|
330
|
+
* we only support the control panel signaling an intent to pause and resume a
|
|
331
|
+
* flow.
|
|
332
|
+
*/
|
|
333
|
+
static async popControlPanelNextDesiredState(page) {
|
|
334
|
+
try {
|
|
335
|
+
const desiredNextState = await page.evaluate(() => {
|
|
336
|
+
const tmpState = window.donobuNextState;
|
|
337
|
+
window.donobuNextState = null;
|
|
338
|
+
return tmpState;
|
|
339
|
+
});
|
|
340
|
+
if (desiredNextState) {
|
|
341
|
+
return desiredNextState;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
catch (error) {
|
|
345
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
346
|
+
throw new PageClosedException_1.PageClosedException();
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
throw error;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Hides the control panel by setting its display to 'none'. This ensures the
|
|
356
|
+
* panel is not visible and does not intercept mouse events.
|
|
357
|
+
*/
|
|
358
|
+
static async hideControlPanel(focusedPage, flowMetadata) {
|
|
359
|
+
if (!flowMetadata.isControlPanelEnabled) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
for (const page of focusedPage.context().pages()) {
|
|
363
|
+
try {
|
|
364
|
+
await page.evaluate((panelId) => {
|
|
365
|
+
const element = document.querySelector(`#${panelId}`);
|
|
366
|
+
if (element) {
|
|
367
|
+
element.style.display = 'none';
|
|
368
|
+
}
|
|
369
|
+
}, PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID);
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
373
|
+
// Pass; this can happen normally.
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Shows the control panel by resetting its display property. Assumes the
|
|
383
|
+
* original display was 'block'.
|
|
384
|
+
*/
|
|
385
|
+
static async showControlPanel(focusedPage, flowMetadata) {
|
|
386
|
+
if (!flowMetadata.isControlPanelEnabled) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
for (const page of focusedPage.context().pages()) {
|
|
390
|
+
try {
|
|
391
|
+
await page.evaluate((panelId) => {
|
|
392
|
+
const element = document.querySelector(`#${panelId}`);
|
|
393
|
+
if (element) {
|
|
394
|
+
element.style.display = 'block';
|
|
395
|
+
}
|
|
396
|
+
}, PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID);
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
400
|
+
// Pass; this can happen normally.
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Updates all control panels in the given browser context. If the provided
|
|
410
|
+
* headline is non-null, the headline in the control panel will be updated.
|
|
411
|
+
*/
|
|
412
|
+
static async updateControlPanel(focusedPage, flowMetadata, headline) {
|
|
413
|
+
const controlPanelQuerySelector = `#${PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID}`;
|
|
414
|
+
const controlPanelHeadlineQuerySelector = `#${PlaywrightUtils.DONOBU_CONTROL_PANEL_HEADLINE_ELEMENT_ID}`;
|
|
415
|
+
for (const page of focusedPage.context().pages()) {
|
|
416
|
+
try {
|
|
417
|
+
const controlPanel = await page.$(controlPanelQuerySelector);
|
|
418
|
+
if (controlPanel) {
|
|
419
|
+
await controlPanel.evaluate((element, state) => {
|
|
420
|
+
element.donobuFlowState = state;
|
|
421
|
+
}, flowMetadata.state.toString());
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
catch (error) {
|
|
425
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
426
|
+
// Pass; this can happen normally.
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (headline) {
|
|
434
|
+
for (const page of focusedPage.context().pages()) {
|
|
435
|
+
try {
|
|
436
|
+
const controlPanel = await page.$(controlPanelHeadlineQuerySelector);
|
|
437
|
+
if (controlPanel) {
|
|
438
|
+
const escapedMessage = headline.replace(/[\\"']/g, '\\$&');
|
|
439
|
+
await controlPanel.evaluate((element, message) => {
|
|
440
|
+
element.innerText = message;
|
|
441
|
+
element.dataset.text = message;
|
|
442
|
+
}, escapedMessage);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
catch (error) {
|
|
446
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
447
|
+
// Pass; this can happen normally.
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Returns all elements that have the
|
|
458
|
+
* {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE} HTML attribute.
|
|
459
|
+
**/
|
|
460
|
+
static async getAttributedInteractableElements(page) {
|
|
461
|
+
try {
|
|
462
|
+
const interactableElements = [];
|
|
463
|
+
const frames = page
|
|
464
|
+
.frames()
|
|
465
|
+
.filter((frame) => PlaywrightUtils.frameFilter(frame));
|
|
466
|
+
for (const frame of frames) {
|
|
467
|
+
const attributeMap = await frame.evaluate((interactableAttribute) => {
|
|
468
|
+
const getOuterHTMLWithoutChildrenExceptForSelectElements = (element) => {
|
|
469
|
+
if (element.tagName.toLowerCase() === 'select') {
|
|
470
|
+
return element.outerHTML;
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
const tempElement = document.createElement('div');
|
|
474
|
+
tempElement.appendChild(element.cloneNode(false));
|
|
475
|
+
return tempElement.innerHTML;
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
const attributeToHtmlMap = {};
|
|
479
|
+
const elements = document.querySelectorAll(`[${interactableAttribute}]`);
|
|
480
|
+
elements.forEach((element) => {
|
|
481
|
+
const attributeValue = element.getAttribute(interactableAttribute);
|
|
482
|
+
const outerHtml = getOuterHTMLWithoutChildrenExceptForSelectElements(element);
|
|
483
|
+
if (attributeValue) {
|
|
484
|
+
attributeToHtmlMap[attributeValue] = outerHtml;
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
return attributeToHtmlMap;
|
|
488
|
+
}, PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE);
|
|
489
|
+
Object.entries(attributeMap).forEach(([donobuAttributeValue, htmlSnippet]) => {
|
|
490
|
+
interactableElements.push({
|
|
491
|
+
donobuAttributeValue,
|
|
492
|
+
htmlSnippet,
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
return interactableElements;
|
|
497
|
+
}
|
|
498
|
+
catch (error) {
|
|
499
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
500
|
+
throw new PageClosedException_1.PageClosedException();
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
throw error;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Assigns a globally unique {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE}
|
|
509
|
+
* attribute value to each visible, interactable, element in the given page.
|
|
510
|
+
* Any pre-existing {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE}
|
|
511
|
+
* attributes will be removed.
|
|
512
|
+
*/
|
|
513
|
+
static async attributeInteractableElements(page) {
|
|
514
|
+
try {
|
|
515
|
+
// Remove any preexisting attributes
|
|
516
|
+
await this.deattributeVisibleInteractableElements(page);
|
|
517
|
+
// Get the main page's viewport and scroll offsets
|
|
518
|
+
const [viewWidth, viewHeight, viewX, viewY] = await page.evaluate(() => {
|
|
519
|
+
return [
|
|
520
|
+
window.innerWidth,
|
|
521
|
+
window.innerHeight,
|
|
522
|
+
Math.round(window.scrollX),
|
|
523
|
+
Math.round(window.scrollY),
|
|
524
|
+
];
|
|
525
|
+
});
|
|
526
|
+
// 1) Attribute elements in the main page
|
|
527
|
+
let annotationOffset = await page.evaluate(this.attributeElementsInContext, [0, PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE]);
|
|
528
|
+
// 2) Check child frames, attributing elements if the frame is (partially) in view
|
|
529
|
+
const frames = page
|
|
530
|
+
.frames()
|
|
531
|
+
.filter((frame) => PlaywrightUtils.frameFilter(frame) && frame !== page.mainFrame());
|
|
532
|
+
for (const frame of frames) {
|
|
533
|
+
const elementHandle = await frame.frameElement();
|
|
534
|
+
if (!elementHandle) {
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
const boundingBox = await elementHandle.boundingBox();
|
|
538
|
+
if (!boundingBox) {
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
const { x: frameX, y: frameY, width: frameWidth, height: frameHeight, } = boundingBox;
|
|
542
|
+
// Check if the frame is visible in the main viewport
|
|
543
|
+
const intersectsViewport = frameX < viewX + viewWidth &&
|
|
544
|
+
frameX + frameWidth > viewX &&
|
|
545
|
+
frameY < viewY + viewHeight &&
|
|
546
|
+
frameY + frameHeight > viewY;
|
|
547
|
+
if (intersectsViewport) {
|
|
548
|
+
// Update annotation offset from this frame's results
|
|
549
|
+
annotationOffset = await frame.evaluate(this.attributeElementsInContext, [
|
|
550
|
+
annotationOffset,
|
|
551
|
+
PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE,
|
|
552
|
+
]);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
catch (error) {
|
|
557
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
558
|
+
throw new PageClosedException_1.PageClosedException();
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
throw error;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Annotate all elements in the given page that have a
|
|
567
|
+
* {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE} HTML attribute.
|
|
568
|
+
*
|
|
569
|
+
* The annotations are placed in a shadow root to avoid site-specific CSS,
|
|
570
|
+
* each having a {@link PlaywrightUtils.DONOBU_ANNOTATION_ATTRIBUTE} attribute.
|
|
571
|
+
*/
|
|
572
|
+
static async annotateInteractableElements(page) {
|
|
573
|
+
try {
|
|
574
|
+
// Filter frames as needed
|
|
575
|
+
const frames = page
|
|
576
|
+
.frames()
|
|
577
|
+
.filter((frame) => PlaywrightUtils.frameFilter(frame));
|
|
578
|
+
for (const frame of frames) {
|
|
579
|
+
await frame.evaluate(([interactableAttr, annotationAttr]) => {
|
|
580
|
+
// 1) Ensure we have a shadow container in the main document
|
|
581
|
+
let container = document.getElementById('annotation-shadow-container');
|
|
582
|
+
if (!container) {
|
|
583
|
+
container = document.createElement('div');
|
|
584
|
+
container.id = 'annotation-shadow-container';
|
|
585
|
+
// Position container so child elements can be absolutely placed
|
|
586
|
+
Object.assign(container.style, {
|
|
587
|
+
position: 'absolute',
|
|
588
|
+
top: '0',
|
|
589
|
+
left: '0',
|
|
590
|
+
width: '100%',
|
|
591
|
+
height: '100%',
|
|
592
|
+
pointerEvents: 'none', // Let clicks pass through
|
|
593
|
+
});
|
|
594
|
+
// Check if document.body exists before trying to append.
|
|
595
|
+
if (document.body) {
|
|
596
|
+
document.body.appendChild(container);
|
|
597
|
+
}
|
|
598
|
+
else if (document.documentElement) {
|
|
599
|
+
// Fall back to document.documentElement if body does not exist.
|
|
600
|
+
document.documentElement.appendChild(container);
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
// If neither exists, we can't proceed with annotations in this frame.
|
|
604
|
+
console.warn(`Cannot create annotation container for ${window.location.href} since the document structure is incomplete`);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
// Attach a shadow root
|
|
608
|
+
const shadowRoot = container.attachShadow({ mode: 'open' });
|
|
609
|
+
// Add a <style> element inside the shadow root to reset and define annotation styles
|
|
610
|
+
const style = document.createElement('style');
|
|
611
|
+
style.textContent = `
|
|
612
|
+
:host {
|
|
613
|
+
all: initial; /* Reset styles in shadow root */
|
|
614
|
+
}
|
|
615
|
+
.annotation {
|
|
616
|
+
position: absolute;
|
|
617
|
+
z-index: 2147483647;
|
|
618
|
+
background-color: black;
|
|
619
|
+
color: white;
|
|
620
|
+
width: 40px;
|
|
621
|
+
height: 40px;
|
|
622
|
+
border-radius: 50%;
|
|
623
|
+
display: flex;
|
|
624
|
+
align-items: center;
|
|
625
|
+
justify-content: center;
|
|
626
|
+
font-size: 14px;
|
|
627
|
+
font-weight: bold;
|
|
628
|
+
line-height: 20px;
|
|
629
|
+
text-align: center;
|
|
630
|
+
box-shadow: 0px 2px 4px rgba(0,0,0,0.2);
|
|
631
|
+
border: 4px solid #FF4136;
|
|
632
|
+
pointer-events: none;
|
|
633
|
+
}
|
|
634
|
+
`;
|
|
635
|
+
shadowRoot.appendChild(style);
|
|
636
|
+
}
|
|
637
|
+
// Retrieve the shadow root to place annotation elements
|
|
638
|
+
const containerEl = document.getElementById('annotation-shadow-container');
|
|
639
|
+
if (!containerEl?.shadowRoot) {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
const shadowRoot = containerEl.shadowRoot;
|
|
643
|
+
// 2) Factory to create a new annotation inside the shadow root
|
|
644
|
+
const createAnnotation = (value) => {
|
|
645
|
+
const annotation = document.createElement('div');
|
|
646
|
+
annotation.classList.add('annotation');
|
|
647
|
+
annotation.dataset[annotationAttr] = '1';
|
|
648
|
+
annotation.textContent = value;
|
|
649
|
+
return annotation;
|
|
650
|
+
};
|
|
651
|
+
// 3) Position annotation relative to an element
|
|
652
|
+
const positionAnnotation = (annotation, element) => {
|
|
653
|
+
const rect = element.getBoundingClientRect();
|
|
654
|
+
// Center the annotation on the element, adjusting for its size
|
|
655
|
+
const x = rect.left + rect.width / 2 - 20 + window.scrollX;
|
|
656
|
+
const y = rect.top + rect.height / 2 - 20 + window.scrollY;
|
|
657
|
+
annotation.style.left = `${x}px`;
|
|
658
|
+
annotation.style.top = `${y}px`;
|
|
659
|
+
};
|
|
660
|
+
// 4) Traverse DOM (including any nested shadow roots) to find interactable elements
|
|
661
|
+
const processNode = (root) => {
|
|
662
|
+
// Find elements with the interactable attribute
|
|
663
|
+
const elements = root.querySelectorAll(`[${interactableAttr}]`);
|
|
664
|
+
elements.forEach((element) => {
|
|
665
|
+
const value = element.getAttribute(interactableAttr);
|
|
666
|
+
if (value) {
|
|
667
|
+
const annotation = createAnnotation(value);
|
|
668
|
+
shadowRoot.appendChild(annotation);
|
|
669
|
+
positionAnnotation(annotation, element);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
// Recursively process any child shadow roots
|
|
673
|
+
root.querySelectorAll('*').forEach((el) => {
|
|
674
|
+
if (el.shadowRoot) {
|
|
675
|
+
processNode(el.shadowRoot);
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
// Start processing from the (frame) document root
|
|
680
|
+
processNode(document);
|
|
681
|
+
}, [
|
|
682
|
+
PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE,
|
|
683
|
+
PlaywrightUtils.convertToJsAttribute(PlaywrightUtils.DONOBU_ANNOTATION_ATTRIBUTE),
|
|
684
|
+
]);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
catch (error) {
|
|
688
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
689
|
+
throw new PageClosedException_1.PageClosedException();
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
throw error;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Removes all annotations with a {@link PlaywrightUtils.DONOBU_ANNOTATION_ATTRIBUTE}
|
|
698
|
+
* HTML attribute in the given page, including any containers in shadow DOM.
|
|
699
|
+
*/
|
|
700
|
+
static async removeDonobuAnnotations(page) {
|
|
701
|
+
try {
|
|
702
|
+
const frames = page
|
|
703
|
+
.frames()
|
|
704
|
+
.filter((frame) => PlaywrightUtils.frameFilter(frame));
|
|
705
|
+
for (const frame of frames) {
|
|
706
|
+
await frame.evaluate(() => {
|
|
707
|
+
const containerId = 'annotation-shadow-container';
|
|
708
|
+
const container = document.getElementById(containerId);
|
|
709
|
+
if (container) {
|
|
710
|
+
container.remove();
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
catch (error) {
|
|
716
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
717
|
+
throw new PageClosedException_1.PageClosedException();
|
|
718
|
+
}
|
|
719
|
+
throw error;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Removes the {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE} HTML
|
|
724
|
+
* attribute for all elements in the given page. This attribute is normally
|
|
725
|
+
* added by the {@link PlaywrightUtils.attributeInteractableElements(Page)}
|
|
726
|
+
* function.
|
|
727
|
+
*/
|
|
728
|
+
static async deattributeVisibleInteractableElements(page) {
|
|
729
|
+
try {
|
|
730
|
+
const frames = page
|
|
731
|
+
.frames()
|
|
732
|
+
.filter((frame) => PlaywrightUtils.frameFilter(frame));
|
|
733
|
+
for (const frame of frames) {
|
|
734
|
+
await frame.evaluate((attr) => {
|
|
735
|
+
document.querySelectorAll(`[${attr}]`).forEach((element) => {
|
|
736
|
+
element.removeAttribute(attr);
|
|
737
|
+
});
|
|
738
|
+
}, PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
catch (error) {
|
|
742
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
743
|
+
throw new PageClosedException_1.PageClosedException();
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
throw error;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
static async parseUnambiguousSelector(elementHandle) {
|
|
751
|
+
try {
|
|
752
|
+
return await elementHandle.evaluate((element) => {
|
|
753
|
+
const escapeCssIdentifier = (ident) => {
|
|
754
|
+
return ident.replace(/([!"#$%&'()*+,./:;<=>?@[\\]^{|}~])/g, '\\$1');
|
|
755
|
+
};
|
|
756
|
+
const getPath = (el) => {
|
|
757
|
+
if (el.id)
|
|
758
|
+
return '#' + escapeCssIdentifier(el.id);
|
|
759
|
+
if (!el.parentNode || el.parentNode.nodeType === Node.DOCUMENT_NODE)
|
|
760
|
+
return '';
|
|
761
|
+
const siblings = Array.from(el.parentNode.children).filter((e) => e.tagName === el.tagName);
|
|
762
|
+
const index = siblings.indexOf(el) + 1;
|
|
763
|
+
const tag = el.tagName.toLowerCase();
|
|
764
|
+
const parentPath = getPath(el.parentNode);
|
|
765
|
+
return (parentPath +
|
|
766
|
+
(parentPath ? ' > ' : '') +
|
|
767
|
+
tag +
|
|
768
|
+
(siblings.length > 1 ? ':nth-child(' + index + ')' : ''));
|
|
769
|
+
};
|
|
770
|
+
return getPath(element);
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
catch (error) {
|
|
774
|
+
if (PlaywrightUtils.isPageClosedError(error)) {
|
|
775
|
+
throw new PageClosedException_1.PageClosedException();
|
|
776
|
+
}
|
|
777
|
+
else {
|
|
778
|
+
throw error;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Converts an HTML attribute to a JavaScript attribute. For example,
|
|
784
|
+
* "data-foo-bar" is turned into "fooBar". Notice the dropping of the "data-"
|
|
785
|
+
* prefix, and the conversion from kebab-case to camelCase.
|
|
786
|
+
*/
|
|
787
|
+
static convertToJsAttribute(htmlAttribute) {
|
|
788
|
+
if (htmlAttribute.startsWith('data-')) {
|
|
789
|
+
htmlAttribute = htmlAttribute.substring(5);
|
|
790
|
+
}
|
|
791
|
+
const parts = htmlAttribute.split('-');
|
|
792
|
+
const jsAttribute = parts[0] +
|
|
793
|
+
parts
|
|
794
|
+
.slice(1)
|
|
795
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
|
|
796
|
+
.join('');
|
|
797
|
+
return jsAttribute;
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Returned true IFF the given error is a Playwright error regarding page closing,
|
|
801
|
+
* of if the given error is an instance of {@link PageClosedException}.
|
|
802
|
+
*/
|
|
803
|
+
static isPageClosedError(error) {
|
|
804
|
+
if (error instanceof PageClosedException_1.PageClosedException) {
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
const exceptionMessage = error?.message?.toLowerCase();
|
|
809
|
+
if (!exceptionMessage) {
|
|
810
|
+
return false;
|
|
811
|
+
}
|
|
812
|
+
else {
|
|
813
|
+
return (exceptionMessage.includes('detached') ||
|
|
814
|
+
exceptionMessage.includes('context was destroyed') ||
|
|
815
|
+
exceptionMessage.includes('browser has been closed'));
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
static async ensurePlaywrightInstallation() {
|
|
820
|
+
return PlaywrightUtils.runPlaywrightCli(['install', '--with-deps']);
|
|
821
|
+
}
|
|
822
|
+
static async runPlaywrightCli(args) {
|
|
823
|
+
try {
|
|
824
|
+
// First, resolve the package root
|
|
825
|
+
const packagePath = require.resolve('playwright-core/package.json');
|
|
826
|
+
// Then construct the path to cli.js
|
|
827
|
+
const cliPath = path_1.default.join(path_1.default.dirname(packagePath), 'cli.js');
|
|
828
|
+
PlaywrightUtils.logger.debug(`Found Playwright CLI at: ${cliPath}`);
|
|
829
|
+
PlaywrightUtils.logger.info(`Running Playwright CLI with args: ${args.join(' ')}`);
|
|
830
|
+
const env = {
|
|
831
|
+
...process.env,
|
|
832
|
+
PLAYWRIGHT_BROWSERS_PATH: path_1.default.join(MiscUtils_1.MiscUtils.baseWorkingDirectory(), '.playwright'),
|
|
833
|
+
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS: '1',
|
|
834
|
+
PLAYWRIGHT_SKIP_BROWSER_GC: '1',
|
|
835
|
+
PLAYWRIGHT_SKIP_BROWSER_VALIDATION: '1',
|
|
836
|
+
FORCE_COLOR: '0',
|
|
837
|
+
NODE_NO_WARNINGS: '1',
|
|
838
|
+
ELECTRON_RUN_AS_NODE: '1',
|
|
839
|
+
};
|
|
840
|
+
const childProcess = (0, child_process_1.spawn)(process.execPath, [cliPath, ...args], {
|
|
841
|
+
stdio: 'inherit',
|
|
842
|
+
env: env,
|
|
843
|
+
windowsHide: true,
|
|
844
|
+
});
|
|
845
|
+
return new Promise((resolve, reject) => {
|
|
846
|
+
childProcess.on('exit', (code) => {
|
|
847
|
+
if (code === 0) {
|
|
848
|
+
PlaywrightUtils.logger.debug('Playwright CLI completed successfully');
|
|
849
|
+
resolve();
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
reject(new Error(`Playwright CLI failed with code ${code}`));
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
childProcess.on('error', (error) => {
|
|
856
|
+
reject(new Error(`Failed to execute Playwright CLI: ${error.message}`));
|
|
857
|
+
});
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
catch (error) {
|
|
861
|
+
throw new Error(`Failed to initialize Playwright CLI: ${error instanceof Error ? error.message : String(error)}`);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Attempts to wait until the currently focused page is stable. If the page
|
|
866
|
+
* never stabilizes, it just returns after timing out. If any error occurs,
|
|
867
|
+
* it is logged and ignored. If page is null, this function has no effect.
|
|
868
|
+
*/
|
|
869
|
+
static async waitForPageStability(page) {
|
|
870
|
+
const waitTimeMilliseconds = 5000;
|
|
871
|
+
const minimumWaitTimeMilliseconds = 1000;
|
|
872
|
+
if (page) {
|
|
873
|
+
try {
|
|
874
|
+
await Promise.all([
|
|
875
|
+
page.waitForLoadState('load', {
|
|
876
|
+
timeout: waitTimeMilliseconds,
|
|
877
|
+
}),
|
|
878
|
+
page.waitForTimeout(minimumWaitTimeMilliseconds),
|
|
879
|
+
]);
|
|
880
|
+
}
|
|
881
|
+
catch (error) {
|
|
882
|
+
if (!PlaywrightUtils.isPageClosedError(error)) {
|
|
883
|
+
// Pass, just move on and hope for the best, we waited long enough.
|
|
884
|
+
PlaywrightUtils.logger.error(`Error while waiting for page to reach steady state for page ${page.url}`, error);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
static frameFilter(frame) {
|
|
890
|
+
return (!frame.isDetached() &&
|
|
891
|
+
!frame.url().startsWith('about:') &&
|
|
892
|
+
!frame.url().startsWith('chrome:') &&
|
|
893
|
+
!frame.url().startsWith('edge:'));
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* This function is injected into the page (or frame) context. It finds
|
|
897
|
+
* "interactable" elements, checks visibility, and sets a unique attribute.
|
|
898
|
+
* It returns the updated offset after labeling.
|
|
899
|
+
*/
|
|
900
|
+
static attributeElementsInContext(arg) {
|
|
901
|
+
let offset = arg[0];
|
|
902
|
+
const interactableAttribute = arg[1];
|
|
903
|
+
// --- Utility Functions ---
|
|
904
|
+
function isElementVisible(rect, style) {
|
|
905
|
+
return (rect.width > 0 &&
|
|
906
|
+
rect.height > 0 &&
|
|
907
|
+
style.display !== 'none' &&
|
|
908
|
+
style.visibility !== 'hidden');
|
|
909
|
+
}
|
|
910
|
+
function isElementMoreThanHalfInViewport(rect) {
|
|
911
|
+
const viewportWidth = window.innerWidth || document.documentElement.clientWidth;
|
|
912
|
+
const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
913
|
+
const visibleWidth = Math.min(rect.right, viewportWidth) - Math.max(rect.left, 0);
|
|
914
|
+
const visibleHeight = Math.min(rect.bottom, viewportHeight) - Math.max(rect.top, 0);
|
|
915
|
+
const visibleArea = Math.max(0, visibleWidth) * Math.max(0, visibleHeight);
|
|
916
|
+
const elementArea = rect.width * rect.height;
|
|
917
|
+
return visibleArea >= elementArea / 2;
|
|
918
|
+
}
|
|
919
|
+
function isElementEnabled(element, style) {
|
|
920
|
+
// Check standard disabled attribute (for form controls like button, input, etc.)
|
|
921
|
+
if (element.hasAttribute('disabled')) {
|
|
922
|
+
return false;
|
|
923
|
+
}
|
|
924
|
+
// Check for ARIA attributes that indicate non-interactivity
|
|
925
|
+
if (element.getAttribute('aria-disabled') === 'true' ||
|
|
926
|
+
element.getAttribute('aria-hidden') === 'true') {
|
|
927
|
+
return false;
|
|
928
|
+
}
|
|
929
|
+
// Check for pointer-events: none which prevents interactions
|
|
930
|
+
if (style.pointerEvents === 'none') {
|
|
931
|
+
return false;
|
|
932
|
+
}
|
|
933
|
+
// Check for ARIA attributes indicating disabled state
|
|
934
|
+
if (element.getAttribute('aria-disabled') === 'true') {
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
// Check for inert attribute which makes elements non-interactive
|
|
938
|
+
if (element.hasAttribute('inert')) {
|
|
939
|
+
return false;
|
|
940
|
+
}
|
|
941
|
+
// If the element is in a form and the fieldset is disabled, it might be disabled as well
|
|
942
|
+
let parent = element.parentElement;
|
|
943
|
+
while (parent) {
|
|
944
|
+
if (parent.tagName.toLowerCase() === 'fieldset' &&
|
|
945
|
+
parent.hasAttribute('disabled') &&
|
|
946
|
+
element.tagName.toLowerCase() !== 'legend') {
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
949
|
+
parent = parent.parentElement;
|
|
950
|
+
}
|
|
951
|
+
return true;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Generate a few test points on the element's bounding box. We only need
|
|
955
|
+
* a small offset (1px) from each corner, plus the center.
|
|
956
|
+
*/
|
|
957
|
+
function getPointsToCheck(rect) {
|
|
958
|
+
const cornerOffset = 1;
|
|
959
|
+
return [
|
|
960
|
+
{ x: rect.left + cornerOffset, y: rect.top + cornerOffset },
|
|
961
|
+
{ x: rect.right - cornerOffset, y: rect.top + cornerOffset },
|
|
962
|
+
{ x: rect.left + cornerOffset, y: rect.bottom - cornerOffset },
|
|
963
|
+
{ x: rect.right - cornerOffset, y: rect.bottom - cornerOffset },
|
|
964
|
+
{ x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 },
|
|
965
|
+
];
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Like `elementFromPoint` but continues walking shadow roots if found.
|
|
969
|
+
*/
|
|
970
|
+
function getDeepElementFromPoint(x, y) {
|
|
971
|
+
let el = document.elementFromPoint(x, y);
|
|
972
|
+
while (el && el.shadowRoot) {
|
|
973
|
+
const shadowEl = el.shadowRoot.elementFromPoint(x, y);
|
|
974
|
+
if (!shadowEl || shadowEl === el)
|
|
975
|
+
break;
|
|
976
|
+
el = shadowEl;
|
|
977
|
+
}
|
|
978
|
+
return el;
|
|
979
|
+
}
|
|
980
|
+
function getAllInteractableElements(root) {
|
|
981
|
+
const selector = [
|
|
982
|
+
// Basic interactive elements
|
|
983
|
+
'button',
|
|
984
|
+
'button svg',
|
|
985
|
+
'input',
|
|
986
|
+
'textarea',
|
|
987
|
+
'a',
|
|
988
|
+
'select',
|
|
989
|
+
// Common ARIA roles
|
|
990
|
+
'[role="button"]',
|
|
991
|
+
'[role="option"]',
|
|
992
|
+
'[role="link"]',
|
|
993
|
+
'[role="checkbox"]',
|
|
994
|
+
'[role="radio"]',
|
|
995
|
+
'[role="tab"]',
|
|
996
|
+
'[role="menuitem"]',
|
|
997
|
+
'[role="menuitemcheckbox"]',
|
|
998
|
+
'[role="menuitemradio"]',
|
|
999
|
+
'[role="combobox"]',
|
|
1000
|
+
'[role="listbox"]',
|
|
1001
|
+
'[role="searchbox"]',
|
|
1002
|
+
'[role="spinbutton"]',
|
|
1003
|
+
'[role="slider"]',
|
|
1004
|
+
'[role="switch"]',
|
|
1005
|
+
// Elements with popup behavior
|
|
1006
|
+
'[aria-haspopup]',
|
|
1007
|
+
'[aria-controls]',
|
|
1008
|
+
// Editable elements
|
|
1009
|
+
'[contenteditable="true"]',
|
|
1010
|
+
// Draggable elements
|
|
1011
|
+
'[draggable="true"]',
|
|
1012
|
+
// Elements that can receive focus
|
|
1013
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
1014
|
+
].join(', ');
|
|
1015
|
+
let elements = Array.from(root.querySelectorAll(selector));
|
|
1016
|
+
// Dive into shadow roots
|
|
1017
|
+
root.querySelectorAll('*').forEach((el) => {
|
|
1018
|
+
if (el.shadowRoot) {
|
|
1019
|
+
// Recurse
|
|
1020
|
+
elements = elements.concat(getAllInteractableElements(el.shadowRoot));
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1023
|
+
// Remove duplicates
|
|
1024
|
+
return Array.from(new Set(elements));
|
|
1025
|
+
}
|
|
1026
|
+
// 1) Gather candidate elements (including any custom "clickable" from donobuGetClickableElements)
|
|
1027
|
+
let interactableElements = getAllInteractableElements(document);
|
|
1028
|
+
if (window.donobuGetClickableElements) {
|
|
1029
|
+
interactableElements = interactableElements.concat(window
|
|
1030
|
+
.donobuGetClickableElements()
|
|
1031
|
+
// Exclude elements with a "donobu-" prefixed ID.
|
|
1032
|
+
.filter((el) => !el.id || !el.id.startsWith('donobu-')));
|
|
1033
|
+
}
|
|
1034
|
+
// Use a Set to avoid duplicates
|
|
1035
|
+
const uniqueElements = new Set(interactableElements);
|
|
1036
|
+
// 2) Check each element for visibility + actual "interactability"
|
|
1037
|
+
uniqueElements.forEach((element) => {
|
|
1038
|
+
if (typeof element.getBoundingClientRect !== 'function') {
|
|
1039
|
+
// Should be rare, but just in case
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
const rect = element.getBoundingClientRect();
|
|
1043
|
+
const style = window.getComputedStyle(element);
|
|
1044
|
+
const visible = isElementVisible(rect, style) && isElementMoreThanHalfInViewport(rect);
|
|
1045
|
+
// Check if the element is actually enabled/interactive
|
|
1046
|
+
const enabled = isElementEnabled(element, style);
|
|
1047
|
+
if (!visible || !enabled) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
let annotated = false;
|
|
1051
|
+
// 3) Test small set of points on the element to confirm it's truly topmost
|
|
1052
|
+
for (const pt of getPointsToCheck(rect)) {
|
|
1053
|
+
let elToCheck = getDeepElementFromPoint(pt.x, pt.y);
|
|
1054
|
+
// Walk up the DOM tree from that point
|
|
1055
|
+
while (elToCheck) {
|
|
1056
|
+
if (elToCheck === element) {
|
|
1057
|
+
// Found the actual element
|
|
1058
|
+
element.setAttribute(interactableAttribute, offset.toString());
|
|
1059
|
+
offset++;
|
|
1060
|
+
annotated = true;
|
|
1061
|
+
break;
|
|
1062
|
+
}
|
|
1063
|
+
else if (elToCheck.tagName?.toLowerCase() === 'label' &&
|
|
1064
|
+
elToCheck.htmlFor) {
|
|
1065
|
+
// If we found a label referencing an element, also mark that
|
|
1066
|
+
const forId = elToCheck.htmlFor;
|
|
1067
|
+
const associatedInput = document.getElementById(forId);
|
|
1068
|
+
if (associatedInput) {
|
|
1069
|
+
associatedInput.setAttribute(interactableAttribute, offset.toString());
|
|
1070
|
+
offset++;
|
|
1071
|
+
}
|
|
1072
|
+
annotated = true;
|
|
1073
|
+
break;
|
|
1074
|
+
}
|
|
1075
|
+
elToCheck = elToCheck.parentElement;
|
|
1076
|
+
}
|
|
1077
|
+
if (annotated) {
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
return offset;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
exports.PlaywrightUtils = PlaywrightUtils;
|
|
1086
|
+
//# sourceMappingURL=PlaywrightUtils.js.map
|