@skyvern/client 1.0.2 → 1.0.6
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/README.md +46 -1
- package/dist/cjs/Client.d.ts +32 -4
- package/dist/cjs/Client.js +144 -11
- package/dist/cjs/api/client/requests/BodyUploadFileV1UploadFilePost.d.ts +10 -0
- package/dist/cjs/api/client/requests/CreateCredentialRequest.d.ts +1 -1
- package/dist/cjs/api/client/requests/DownloadFilesRequest.d.ts +37 -0
- package/dist/cjs/api/client/requests/GetWorkflowsRequest.d.ts +2 -0
- package/dist/cjs/api/client/requests/LoginRequest.d.ts +6 -6
- package/dist/cjs/api/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/index.js +1 -6
- package/dist/cjs/api/types/Action.d.ts +1 -0
- package/dist/cjs/api/types/ActionBlock.d.ts +1 -0
- package/dist/cjs/api/types/ActionBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ActionType.d.ts +1 -0
- package/dist/cjs/api/types/ActionType.js +1 -0
- package/dist/cjs/api/types/Artifact.d.ts +1 -0
- package/dist/cjs/api/types/BranchCondition.d.ts +2 -1
- package/dist/cjs/api/types/BranchConditionCriteria.d.ts +10 -0
- package/dist/cjs/api/types/BranchConditionYaml.d.ts +7 -0
- package/dist/cjs/api/types/BranchCriteriaYaml.d.ts +12 -0
- package/dist/cjs/api/types/BranchCriteriaYaml.js +11 -0
- package/dist/cjs/api/types/CodeBlock.d.ts +1 -0
- package/dist/cjs/api/types/CodeBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ConditionalBlock.d.ts +1 -0
- package/dist/cjs/api/types/ConditionalBlockYaml.d.ts +11 -0
- package/dist/cjs/api/types/CredentialResponse.d.ts +1 -1
- package/dist/cjs/api/types/CredentialTypeOutput.d.ts +1 -0
- package/dist/cjs/api/types/CredentialTypeOutput.js +1 -0
- package/dist/cjs/api/types/DownloadToS3Block.d.ts +1 -0
- package/dist/cjs/api/types/DownloadToS3BlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ExtractionBlock.d.ts +1 -0
- package/dist/cjs/api/types/ExtractionBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/FileDownloadBlock.d.ts +1 -0
- package/dist/cjs/api/types/FileDownloadBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/FileParserBlock.d.ts +1 -0
- package/dist/cjs/api/types/FileParserBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/FileUploadBlock.d.ts +1 -0
- package/dist/cjs/api/types/FileUploadBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ForLoopBlock.d.ts +1 -0
- package/dist/cjs/api/types/ForLoopBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ForLoopBlockYamlLoopBlocksItem.d.ts +4 -1
- package/dist/cjs/api/types/HttpRequestBlock.d.ts +2 -0
- package/dist/cjs/api/types/HttpRequestBlockYaml.d.ts +2 -0
- package/dist/cjs/api/types/HumanInteractionBlock.d.ts +1 -0
- package/dist/cjs/api/types/HumanInteractionBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/JinjaBranchCriteria.d.ts +7 -0
- package/dist/cjs/api/types/LoginBlock.d.ts +1 -0
- package/dist/cjs/api/types/LoginBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/NavigationBlock.d.ts +1 -0
- package/dist/cjs/api/types/NavigationBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/PdfParserBlock.d.ts +1 -0
- package/dist/cjs/api/types/PdfParserBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/PromptAction.d.ts +11 -0
- package/dist/cjs/api/types/PromptBranchCriteria.d.ts +7 -0
- package/dist/cjs/api/types/PromptBranchCriteria.js +3 -0
- package/dist/cjs/api/types/RetryRunWebhookRequest.d.ts +4 -0
- package/dist/cjs/api/types/RetryRunWebhookRequest.js +3 -0
- package/dist/cjs/api/types/RunSdkActionRequestAction.d.ts +7 -1
- package/dist/cjs/api/types/SecretCredential.d.ts +9 -0
- package/dist/cjs/api/types/SecretCredential.js +3 -0
- package/dist/cjs/api/types/SecretCredentialResponse.d.ts +7 -0
- package/dist/cjs/api/types/SecretCredentialResponse.js +3 -0
- package/dist/cjs/api/types/SendEmailBlock.d.ts +1 -0
- package/dist/cjs/api/types/SendEmailBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.d.ts +1 -0
- package/dist/cjs/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.js +1 -0
- package/dist/cjs/api/types/TaskBlock.d.ts +1 -0
- package/dist/cjs/api/types/TaskBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/TaskV2Block.d.ts +1 -0
- package/dist/cjs/api/types/TaskV2BlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/TextPromptBlock.d.ts +1 -0
- package/dist/cjs/api/types/TextPromptBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/UploadFileResponse.d.ts +6 -0
- package/dist/cjs/api/types/UploadFileResponse.js +3 -0
- package/dist/cjs/api/types/UploadToS3Block.d.ts +1 -0
- package/dist/cjs/api/types/UploadToS3BlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/UrlBlock.d.ts +1 -0
- package/dist/cjs/api/types/UrlBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/ValidateAction.d.ts +9 -0
- package/dist/cjs/api/types/ValidateAction.js +3 -0
- package/dist/cjs/api/types/ValidationBlock.d.ts +1 -0
- package/dist/cjs/api/types/ValidationBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/WaitBlock.d.ts +1 -0
- package/dist/cjs/api/types/WaitBlockYaml.d.ts +1 -0
- package/dist/cjs/api/types/Workflow.d.ts +1 -0
- package/dist/cjs/api/types/WorkflowDefinitionYamlBlocksItem.d.ts +4 -1
- package/dist/cjs/api/types/WorkflowRunBlock.d.ts +4 -0
- package/dist/cjs/api/types/index.d.ts +12 -2
- package/dist/cjs/api/types/index.js +12 -2
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/{api/resources/workflows/index.js → core/exports.js} +1 -1
- package/dist/cjs/core/file/exports.d.ts +1 -0
- package/dist/cjs/core/file/file.d.ts +10 -0
- package/dist/cjs/core/file/file.js +221 -0
- package/dist/cjs/core/file/index.d.ts +2 -0
- package/dist/cjs/core/file/index.js +18 -0
- package/dist/cjs/core/file/types.d.ts +66 -0
- package/dist/cjs/core/file/types.js +2 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.js +185 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/cjs/core/form-data-utils/index.d.ts +2 -0
- package/dist/cjs/core/form-data-utils/index.js +20 -0
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +3 -1
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/{api/resources/workflows/client/index.js → exports.js} +1 -1
- package/dist/cjs/index.d.ts +4 -1
- package/dist/cjs/index.js +11 -2
- package/dist/cjs/library/Skyvern.d.ts +124 -0
- package/dist/cjs/library/Skyvern.js +333 -0
- package/dist/cjs/library/SkyvernBrowser.d.ts +76 -0
- package/dist/cjs/library/SkyvernBrowser.js +119 -0
- package/dist/cjs/library/SkyvernBrowserPage.d.ts +152 -0
- package/dist/cjs/library/SkyvernBrowserPage.js +275 -0
- package/dist/cjs/library/SkyvernBrowserPageAgent.d.ts +183 -0
- package/dist/cjs/library/SkyvernBrowserPageAgent.js +243 -0
- package/dist/cjs/library/SkyvernBrowserPageAi.d.ts +85 -0
- package/dist/cjs/library/SkyvernBrowserPageAi.js +248 -0
- package/dist/cjs/library/constants.d.ts +3 -0
- package/dist/cjs/library/constants.js +6 -0
- package/dist/cjs/library/index.d.ts +10 -0
- package/dist/cjs/library/index.js +20 -0
- package/dist/cjs/library/logger.d.ts +15 -0
- package/dist/cjs/library/logger.js +56 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +32 -4
- package/dist/esm/Client.mjs +144 -11
- package/dist/esm/api/client/requests/BodyUploadFileV1UploadFilePost.d.mts +10 -0
- package/dist/esm/api/client/requests/CreateCredentialRequest.d.mts +1 -1
- package/dist/esm/api/client/requests/DownloadFilesRequest.d.mts +37 -0
- package/dist/esm/api/client/requests/GetWorkflowsRequest.d.mts +2 -0
- package/dist/esm/api/client/requests/LoginRequest.d.mts +6 -6
- package/dist/esm/api/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/index.mjs +0 -2
- package/dist/esm/api/types/Action.d.mts +1 -0
- package/dist/esm/api/types/ActionBlock.d.mts +1 -0
- package/dist/esm/api/types/ActionBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ActionType.d.mts +1 -0
- package/dist/esm/api/types/ActionType.mjs +1 -0
- package/dist/esm/api/types/Artifact.d.mts +1 -0
- package/dist/esm/api/types/BranchCondition.d.mts +2 -1
- package/dist/esm/api/types/BranchConditionCriteria.d.mts +10 -0
- package/dist/esm/api/types/BranchConditionYaml.d.mts +7 -0
- package/dist/esm/api/types/BranchCriteriaYaml.d.mts +12 -0
- package/dist/esm/api/types/BranchCriteriaYaml.mjs +8 -0
- package/dist/esm/api/types/CodeBlock.d.mts +1 -0
- package/dist/esm/api/types/CodeBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ConditionalBlock.d.mts +1 -0
- package/dist/esm/api/types/ConditionalBlockYaml.d.mts +11 -0
- package/dist/esm/api/types/CredentialResponse.d.mts +1 -1
- package/dist/esm/api/types/CredentialTypeOutput.d.mts +1 -0
- package/dist/esm/api/types/CredentialTypeOutput.mjs +1 -0
- package/dist/esm/api/types/DownloadToS3Block.d.mts +1 -0
- package/dist/esm/api/types/DownloadToS3BlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ExtractionBlock.d.mts +1 -0
- package/dist/esm/api/types/ExtractionBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/FileDownloadBlock.d.mts +1 -0
- package/dist/esm/api/types/FileDownloadBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/FileParserBlock.d.mts +1 -0
- package/dist/esm/api/types/FileParserBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/FileUploadBlock.d.mts +1 -0
- package/dist/esm/api/types/FileUploadBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ForLoopBlock.d.mts +1 -0
- package/dist/esm/api/types/ForLoopBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ForLoopBlockYamlLoopBlocksItem.d.mts +4 -1
- package/dist/esm/api/types/HttpRequestBlock.d.mts +2 -0
- package/dist/esm/api/types/HttpRequestBlockYaml.d.mts +2 -0
- package/dist/esm/api/types/HumanInteractionBlock.d.mts +1 -0
- package/dist/esm/api/types/HumanInteractionBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/JinjaBranchCriteria.d.mts +7 -0
- package/dist/esm/api/types/LoginBlock.d.mts +1 -0
- package/dist/esm/api/types/LoginBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/NavigationBlock.d.mts +1 -0
- package/dist/esm/api/types/NavigationBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/PdfParserBlock.d.mts +1 -0
- package/dist/esm/api/types/PdfParserBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/PromptAction.d.mts +11 -0
- package/dist/esm/api/types/PromptBranchCriteria.d.mts +7 -0
- package/dist/esm/api/types/PromptBranchCriteria.mjs +2 -0
- package/dist/esm/api/types/RetryRunWebhookRequest.d.mts +4 -0
- package/dist/esm/api/types/RetryRunWebhookRequest.mjs +2 -0
- package/dist/esm/api/types/RunSdkActionRequestAction.d.mts +7 -1
- package/dist/esm/api/types/SecretCredential.d.mts +9 -0
- package/dist/esm/api/types/SecretCredential.mjs +2 -0
- package/dist/esm/api/types/SecretCredentialResponse.d.mts +7 -0
- package/dist/esm/api/types/SecretCredentialResponse.mjs +2 -0
- package/dist/esm/api/types/SendEmailBlock.d.mts +1 -0
- package/dist/esm/api/types/SendEmailBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.d.mts +1 -0
- package/dist/esm/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.mjs +1 -0
- package/dist/esm/api/types/TaskBlock.d.mts +1 -0
- package/dist/esm/api/types/TaskBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/TaskV2Block.d.mts +1 -0
- package/dist/esm/api/types/TaskV2BlockYaml.d.mts +1 -0
- package/dist/esm/api/types/TextPromptBlock.d.mts +1 -0
- package/dist/esm/api/types/TextPromptBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/UploadFileResponse.d.mts +6 -0
- package/dist/esm/api/types/UploadFileResponse.mjs +2 -0
- package/dist/esm/api/types/UploadToS3Block.d.mts +1 -0
- package/dist/esm/api/types/UploadToS3BlockYaml.d.mts +1 -0
- package/dist/esm/api/types/UrlBlock.d.mts +1 -0
- package/dist/esm/api/types/UrlBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/ValidateAction.d.mts +9 -0
- package/dist/esm/api/types/ValidateAction.mjs +2 -0
- package/dist/esm/api/types/ValidationBlock.d.mts +1 -0
- package/dist/esm/api/types/ValidationBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/WaitBlock.d.mts +1 -0
- package/dist/esm/api/types/WaitBlockYaml.d.mts +1 -0
- package/dist/esm/api/types/Workflow.d.mts +1 -0
- package/dist/esm/api/types/WorkflowDefinitionYamlBlocksItem.d.mts +4 -1
- package/dist/esm/api/types/WorkflowRunBlock.d.mts +4 -0
- package/dist/esm/api/types/index.d.mts +12 -2
- package/dist/esm/api/types/index.mjs +12 -2
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/file/exports.d.mts +1 -0
- package/dist/esm/core/file/file.d.mts +10 -0
- package/dist/esm/core/file/file.mjs +184 -0
- package/dist/esm/core/file/index.d.mts +2 -0
- package/dist/esm/core/file/index.mjs +2 -0
- package/dist/esm/core/file/types.d.mts +66 -0
- package/dist/esm/core/file/types.mjs +1 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +147 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
- package/dist/esm/core/form-data-utils/index.d.mts +2 -0
- package/dist/esm/core/form-data-utils/index.mjs +2 -0
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +4 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/library/Skyvern.d.mts +124 -0
- package/dist/esm/library/Skyvern.mjs +296 -0
- package/dist/esm/library/SkyvernBrowser.d.mts +76 -0
- package/dist/esm/library/SkyvernBrowser.mjs +115 -0
- package/dist/esm/library/SkyvernBrowserPage.d.mts +152 -0
- package/dist/esm/library/SkyvernBrowserPage.mjs +271 -0
- package/dist/esm/library/SkyvernBrowserPageAgent.d.mts +183 -0
- package/dist/esm/library/SkyvernBrowserPageAgent.mjs +239 -0
- package/dist/esm/library/SkyvernBrowserPageAi.d.mts +85 -0
- package/dist/esm/library/SkyvernBrowserPageAi.mjs +244 -0
- package/dist/esm/library/constants.d.mts +3 -0
- package/dist/esm/library/constants.mjs +3 -0
- package/dist/esm/library/index.d.mts +10 -0
- package/dist/esm/library/index.mjs +7 -0
- package/dist/esm/library/logger.d.mts +15 -0
- package/dist/esm/library/logger.mjs +52 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +4 -1
- package/reference.md +0 -411
- package/dist/cjs/api/resources/workflows/client/Client.d.ts +0 -108
- package/dist/cjs/api/resources/workflows/client/Client.js +0 -465
- package/dist/cjs/api/resources/workflows/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.d.ts +0 -10
- package/dist/cjs/api/resources/workflows/client/requests/FolderCreate.d.ts +0 -12
- package/dist/cjs/api/resources/workflows/client/requests/FolderUpdate.d.ts +0 -10
- package/dist/cjs/api/resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.d.ts +0 -16
- package/dist/cjs/api/resources/workflows/client/requests/UpdateWorkflowFolderRequest.d.ts +0 -8
- package/dist/cjs/api/resources/workflows/client/requests/index.d.ts +0 -5
- package/dist/cjs/api/resources/workflows/index.d.ts +0 -1
- package/dist/cjs/api/types/BranchCriteria.d.ts +0 -8
- package/dist/cjs/api/types/Folder.d.ts +0 -15
- package/dist/esm/api/resources/workflows/client/Client.d.mts +0 -108
- package/dist/esm/api/resources/workflows/client/Client.mjs +0 -428
- package/dist/esm/api/resources/workflows/client/index.d.mts +0 -1
- package/dist/esm/api/resources/workflows/client/index.mjs +0 -1
- package/dist/esm/api/resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.d.mts +0 -10
- package/dist/esm/api/resources/workflows/client/requests/FolderCreate.d.mts +0 -12
- package/dist/esm/api/resources/workflows/client/requests/FolderUpdate.d.mts +0 -10
- package/dist/esm/api/resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.d.mts +0 -16
- package/dist/esm/api/resources/workflows/client/requests/UpdateWorkflowFolderRequest.d.mts +0 -8
- package/dist/esm/api/resources/workflows/client/requests/index.d.mts +0 -5
- package/dist/esm/api/resources/workflows/index.d.mts +0 -1
- package/dist/esm/api/resources/workflows/index.mjs +0 -1
- package/dist/esm/api/types/BranchCriteria.d.mts +0 -8
- package/dist/esm/api/types/Folder.d.mts +0 -15
- /package/dist/cjs/api/{resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.js → client/requests/BodyUploadFileV1UploadFilePost.js} +0 -0
- /package/dist/cjs/api/{resources/workflows/client/requests/FolderCreate.js → client/requests/DownloadFilesRequest.js} +0 -0
- /package/dist/cjs/api/{resources/workflows/client/requests/FolderUpdate.js → types/BranchConditionCriteria.js} +0 -0
- /package/dist/cjs/api/{resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.js → types/BranchConditionYaml.js} +0 -0
- /package/dist/cjs/api/{resources/workflows/client/requests/UpdateWorkflowFolderRequest.js → types/ConditionalBlockYaml.js} +0 -0
- /package/dist/cjs/api/types/{BranchCriteria.js → JinjaBranchCriteria.js} +0 -0
- /package/dist/cjs/api/types/{Folder.js → PromptAction.js} +0 -0
- /package/dist/cjs/{api/resources/workflows/client/requests/index.js → core/file/exports.js} +0 -0
- /package/dist/esm/api/{resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.mjs → client/requests/BodyUploadFileV1UploadFilePost.mjs} +0 -0
- /package/dist/esm/api/{resources/workflows/client/requests/FolderCreate.mjs → client/requests/DownloadFilesRequest.mjs} +0 -0
- /package/dist/esm/api/{resources/workflows/client/requests/FolderUpdate.mjs → types/BranchConditionCriteria.mjs} +0 -0
- /package/dist/esm/api/{resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.mjs → types/BranchConditionYaml.mjs} +0 -0
- /package/dist/esm/api/{resources/workflows/client/requests/UpdateWorkflowFolderRequest.mjs → types/ConditionalBlockYaml.mjs} +0 -0
- /package/dist/esm/api/types/{BranchCriteria.mjs → JinjaBranchCriteria.mjs} +0 -0
- /package/dist/esm/api/types/{Folder.mjs → PromptAction.mjs} +0 -0
- /package/dist/esm/{api/resources/workflows/client/requests/index.mjs → core/file/exports.mjs} +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { Page } from "playwright";
|
|
2
|
+
import type { SkyvernBrowser } from "./SkyvernBrowser.mjs";
|
|
3
|
+
import { SkyvernBrowserPageAgent } from "./SkyvernBrowserPageAgent.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* A browser page wrapper that combines Playwright's page API with Skyvern's AI capabilities.
|
|
6
|
+
*
|
|
7
|
+
* This class provides a unified interface for both traditional browser automation (via Playwright)
|
|
8
|
+
* and AI-powered task execution (via Skyvern). It exposes standard page methods like click, fill,
|
|
9
|
+
* goto, etc., while also providing access to Skyvern's task and workflow execution through the
|
|
10
|
+
* `agent` attribute.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Use standard Playwright methods
|
|
15
|
+
* await page.goto("https://example.com");
|
|
16
|
+
* await page.fill("#username", "user@example.com");
|
|
17
|
+
* await page.click("#login-button");
|
|
18
|
+
*
|
|
19
|
+
* // Or use Skyvern's AI capabilities
|
|
20
|
+
* await page.agent.runTask("Fill out the contact form and submit it");
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class SkyvernBrowserPageCore {
|
|
24
|
+
private readonly _browser;
|
|
25
|
+
private readonly _page;
|
|
26
|
+
private readonly _ai;
|
|
27
|
+
readonly agent: SkyvernBrowserPageAgent;
|
|
28
|
+
private readonly _proxy;
|
|
29
|
+
private constructor();
|
|
30
|
+
static create(browser: SkyvernBrowser, page: Page): SkyvernBrowserPage;
|
|
31
|
+
get page(): Page;
|
|
32
|
+
get browser(): SkyvernBrowser;
|
|
33
|
+
/**
|
|
34
|
+
* Click an element using a CSS selector, AI-powered prompt matching, or both.
|
|
35
|
+
*
|
|
36
|
+
* This method supports three modes:
|
|
37
|
+
* - **Selector-based**: Click the element matching the CSS selector
|
|
38
|
+
* - **AI-powered**: Use natural language to describe which element to click
|
|
39
|
+
* - **Fallback mode**: Try the selector first, fall back to AI if it fails
|
|
40
|
+
*
|
|
41
|
+
* @param selector - CSS selector for the target element.
|
|
42
|
+
* @param options - Click options including prompt.
|
|
43
|
+
* @param options.prompt - Natural language description of which element to click.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Click using a CSS selector
|
|
48
|
+
* await page.click("#open-invoice-button");
|
|
49
|
+
*
|
|
50
|
+
* // Click using AI with natural language
|
|
51
|
+
* await page.click({ prompt: "Click on the 'Open Invoice' button" });
|
|
52
|
+
*
|
|
53
|
+
* // Try selector first, fall back to AI if selector fails
|
|
54
|
+
* await page.click("#open-invoice-button", { prompt: "Click on the 'Open Invoice' button" });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
click(selector: string, options?: Parameters<Page["click"]>[1]): Promise<void>;
|
|
58
|
+
click(options: {
|
|
59
|
+
prompt: string;
|
|
60
|
+
} & Partial<Parameters<Page["click"]>[1]>): Promise<void>;
|
|
61
|
+
click(selector: string, options: {
|
|
62
|
+
prompt: string;
|
|
63
|
+
} & Partial<Parameters<Page["click"]>[1]>): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Fill an input field using a CSS selector, AI-powered prompt matching, or both.
|
|
66
|
+
*
|
|
67
|
+
* This method supports three modes:
|
|
68
|
+
* - **Selector-based**: Fill the input field with a value using CSS selector
|
|
69
|
+
* - **AI-powered**: Use natural language prompt (AI extracts value from prompt or uses provided value)
|
|
70
|
+
* - **Fallback mode**: Try the selector first, fall back to AI if it fails
|
|
71
|
+
*
|
|
72
|
+
* @param selector - CSS selector for the target input element.
|
|
73
|
+
* @param value - The text value to input into the field.
|
|
74
|
+
* @param options - Fill options including prompt.
|
|
75
|
+
* @param options.prompt - Natural language description of which field to fill and what value.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* // Fill using selector and value
|
|
80
|
+
* await page.fill("#email-input", "user@example.com");
|
|
81
|
+
*
|
|
82
|
+
* // Fill using AI with natural language
|
|
83
|
+
* await page.fill({ prompt: "Fill 'user@example.com' in the email address field" });
|
|
84
|
+
*
|
|
85
|
+
* // Try selector first, fall back to AI if selector fails
|
|
86
|
+
* await page.fill("#email-input", "user@example.com", { prompt: "Fill the email address" });
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
fill(selector: string, value: string, options?: Parameters<Page["fill"]>[2]): Promise<void>;
|
|
90
|
+
fill(options: {
|
|
91
|
+
prompt: string;
|
|
92
|
+
value?: string;
|
|
93
|
+
} & Partial<Parameters<Page["fill"]>[2]>): Promise<void>;
|
|
94
|
+
fill(selector: string, value: string, options: {
|
|
95
|
+
prompt: string;
|
|
96
|
+
} & Partial<Parameters<Page["fill"]>[2]>): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Select an option from a dropdown using a CSS selector, AI-powered prompt matching, or both.
|
|
99
|
+
*
|
|
100
|
+
* This method supports three modes:
|
|
101
|
+
* - **Selector-based**: Select the option with a value using CSS selector
|
|
102
|
+
* - **AI-powered**: Use natural language prompt (AI extracts value from prompt or uses provided value)
|
|
103
|
+
* - **Fallback mode**: Try the selector first, fall back to AI if it fails
|
|
104
|
+
*
|
|
105
|
+
* @param selector - CSS selector for the target select/dropdown element.
|
|
106
|
+
* @param value - The option value to select.
|
|
107
|
+
* @param options - Select options including prompt.
|
|
108
|
+
* @param options.prompt - Natural language description of which option to select.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* // Select using selector and value
|
|
113
|
+
* await page.selectOption("#country", "us");
|
|
114
|
+
*
|
|
115
|
+
* // Select using AI with natural language
|
|
116
|
+
* await page.selectOption({ prompt: "Select 'United States' from the country dropdown" });
|
|
117
|
+
*
|
|
118
|
+
* // Try selector first, fall back to AI if selector fails
|
|
119
|
+
* await page.selectOption("#country", "us", { prompt: "Select United States from country" });
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
selectOption(selector: string, values: string | string[], options?: Parameters<Page["selectOption"]>[2]): Promise<void>;
|
|
123
|
+
selectOption(options: {
|
|
124
|
+
prompt: string;
|
|
125
|
+
value?: string;
|
|
126
|
+
} & Partial<Parameters<Page["selectOption"]>[2]>): Promise<void>;
|
|
127
|
+
selectOption(selector: string, values: string | string[], options: {
|
|
128
|
+
prompt: string;
|
|
129
|
+
} & Partial<Parameters<Page["selectOption"]>[2]>): Promise<void>;
|
|
130
|
+
/**
|
|
131
|
+
* Perform an action on the page using AI based on a natural language prompt.
|
|
132
|
+
*
|
|
133
|
+
* @param prompt - Natural language description of the action to perform.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* // Simple action
|
|
138
|
+
* await page.act("Click the login button");
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
act(prompt: string): Promise<void>;
|
|
142
|
+
extract(options: {
|
|
143
|
+
prompt: string;
|
|
144
|
+
schema?: Record<string, unknown> | unknown[] | string;
|
|
145
|
+
errorCodeMapping?: Record<string, string>;
|
|
146
|
+
intention?: string;
|
|
147
|
+
data?: string | Record<string, unknown>;
|
|
148
|
+
}): Promise<Record<string, unknown> | unknown[] | string | null>;
|
|
149
|
+
validate(prompt: string, model?: Record<string, unknown> | string): Promise<boolean>;
|
|
150
|
+
prompt(prompt: string, schema?: Record<string, unknown>, model?: Record<string, unknown> | string): Promise<Record<string, unknown> | unknown[] | string | null>;
|
|
151
|
+
}
|
|
152
|
+
export type SkyvernBrowserPage = SkyvernBrowserPageCore & Page;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import { SkyvernBrowserPageAgent } from "./SkyvernBrowserPageAgent.mjs";
|
|
22
|
+
import { SkyvernBrowserPageAi } from "./SkyvernBrowserPageAi.mjs";
|
|
23
|
+
/**
|
|
24
|
+
* A browser page wrapper that combines Playwright's page API with Skyvern's AI capabilities.
|
|
25
|
+
*
|
|
26
|
+
* This class provides a unified interface for both traditional browser automation (via Playwright)
|
|
27
|
+
* and AI-powered task execution (via Skyvern). It exposes standard page methods like click, fill,
|
|
28
|
+
* goto, etc., while also providing access to Skyvern's task and workflow execution through the
|
|
29
|
+
* `agent` attribute.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // Use standard Playwright methods
|
|
34
|
+
* await page.goto("https://example.com");
|
|
35
|
+
* await page.fill("#username", "user@example.com");
|
|
36
|
+
* await page.click("#login-button");
|
|
37
|
+
*
|
|
38
|
+
* // Or use Skyvern's AI capabilities
|
|
39
|
+
* await page.agent.runTask("Fill out the contact form and submit it");
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export class SkyvernBrowserPageCore {
|
|
43
|
+
constructor(browser, page) {
|
|
44
|
+
this._browser = browser;
|
|
45
|
+
this._page = page;
|
|
46
|
+
this._ai = new SkyvernBrowserPageAi(browser, page);
|
|
47
|
+
this.agent = new SkyvernBrowserPageAgent(browser, page);
|
|
48
|
+
this._proxy = new Proxy(this, {
|
|
49
|
+
get(target, prop, receiver) {
|
|
50
|
+
if (prop in target) {
|
|
51
|
+
return Reflect.get(target, prop, receiver);
|
|
52
|
+
}
|
|
53
|
+
const value = Reflect.get(target._page, prop, target._page);
|
|
54
|
+
if (typeof value === "function") {
|
|
55
|
+
return value.bind(target._page);
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
static create(browser, page) {
|
|
62
|
+
const instance = new SkyvernBrowserPageCore(browser, page);
|
|
63
|
+
return instance._proxy;
|
|
64
|
+
}
|
|
65
|
+
get page() {
|
|
66
|
+
return this._page;
|
|
67
|
+
}
|
|
68
|
+
get browser() {
|
|
69
|
+
return this._browser;
|
|
70
|
+
}
|
|
71
|
+
click(selectorOrOptions, options) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
let selector;
|
|
74
|
+
let prompt;
|
|
75
|
+
let clickOptions = {};
|
|
76
|
+
let timeout;
|
|
77
|
+
// Parse arguments
|
|
78
|
+
if (typeof selectorOrOptions === "string") {
|
|
79
|
+
selector = selectorOrOptions;
|
|
80
|
+
if (options && typeof options === "object") {
|
|
81
|
+
const _a = options, { prompt: p, timeout: t } = _a, rest = __rest(_a, ["prompt", "timeout"]);
|
|
82
|
+
prompt = p;
|
|
83
|
+
timeout = t;
|
|
84
|
+
clickOptions = rest;
|
|
85
|
+
}
|
|
86
|
+
else if (options) {
|
|
87
|
+
clickOptions = options;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if (selectorOrOptions && typeof selectorOrOptions === "object") {
|
|
91
|
+
const { prompt: p, timeout: t } = selectorOrOptions, rest = __rest(selectorOrOptions, ["prompt", "timeout"]);
|
|
92
|
+
prompt = p;
|
|
93
|
+
timeout = t;
|
|
94
|
+
clickOptions = rest;
|
|
95
|
+
}
|
|
96
|
+
if (!selector && !prompt) {
|
|
97
|
+
throw new Error("Missing input: pass a selector and/or a prompt.");
|
|
98
|
+
}
|
|
99
|
+
// Try to click the element with the original selector first
|
|
100
|
+
let errorToRaise;
|
|
101
|
+
if (selector) {
|
|
102
|
+
try {
|
|
103
|
+
yield this._page.click(selector, Object.assign(Object.assign({}, clickOptions), { timeout }));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
errorToRaise = error;
|
|
108
|
+
selector = undefined;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// If the original selector doesn't work, try to click the element with the AI generated selector
|
|
112
|
+
if (prompt) {
|
|
113
|
+
yield this._ai.aiClick({
|
|
114
|
+
intention: prompt,
|
|
115
|
+
data: Object.keys(clickOptions).length > 0 ? clickOptions : undefined,
|
|
116
|
+
timeout,
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (errorToRaise) {
|
|
121
|
+
throw errorToRaise;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
fill(selectorOrOptions, value, options) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
let selector;
|
|
128
|
+
let fillValue;
|
|
129
|
+
let prompt;
|
|
130
|
+
let fillOptions = {};
|
|
131
|
+
let timeout;
|
|
132
|
+
if (typeof selectorOrOptions === "string") {
|
|
133
|
+
selector = selectorOrOptions;
|
|
134
|
+
fillValue = value;
|
|
135
|
+
if (options && typeof options === "object") {
|
|
136
|
+
const _a = options, { prompt: p, timeout: t } = _a, rest = __rest(_a, ["prompt", "timeout"]);
|
|
137
|
+
prompt = p;
|
|
138
|
+
timeout = t;
|
|
139
|
+
fillOptions = rest;
|
|
140
|
+
}
|
|
141
|
+
else if (options) {
|
|
142
|
+
fillOptions = options;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (selectorOrOptions && typeof selectorOrOptions === "object") {
|
|
146
|
+
const { prompt: p, value: v, timeout: t } = selectorOrOptions, rest = __rest(selectorOrOptions, ["prompt", "value", "timeout"]);
|
|
147
|
+
prompt = p;
|
|
148
|
+
fillValue = v;
|
|
149
|
+
timeout = t;
|
|
150
|
+
fillOptions = rest;
|
|
151
|
+
}
|
|
152
|
+
if (!selector && !prompt) {
|
|
153
|
+
throw new Error("Missing input: pass a selector and/or a prompt.");
|
|
154
|
+
}
|
|
155
|
+
let errorToRaise;
|
|
156
|
+
if (selector && fillValue !== undefined) {
|
|
157
|
+
try {
|
|
158
|
+
yield this._page.fill(selector, fillValue, Object.assign(Object.assign({}, fillOptions), { timeout }));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
errorToRaise = error;
|
|
163
|
+
selector = undefined;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (prompt) {
|
|
167
|
+
yield this._ai.aiInputText({
|
|
168
|
+
value: fillValue,
|
|
169
|
+
intention: prompt,
|
|
170
|
+
data: Object.keys(fillOptions).length > 0 ? fillOptions : undefined,
|
|
171
|
+
timeout,
|
|
172
|
+
});
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (errorToRaise) {
|
|
176
|
+
throw errorToRaise;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
selectOption(selectorOrOptions, values, options) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
let selector;
|
|
183
|
+
let selectValue;
|
|
184
|
+
let prompt;
|
|
185
|
+
let selectOptions = {};
|
|
186
|
+
let timeout;
|
|
187
|
+
// Parse arguments
|
|
188
|
+
if (typeof selectorOrOptions === "string") {
|
|
189
|
+
selector = selectorOrOptions;
|
|
190
|
+
selectValue = values;
|
|
191
|
+
if (options && typeof options === "object") {
|
|
192
|
+
const _a = options, { prompt: p, timeout: t } = _a, rest = __rest(_a, ["prompt", "timeout"]);
|
|
193
|
+
prompt = p;
|
|
194
|
+
timeout = t;
|
|
195
|
+
selectOptions = rest;
|
|
196
|
+
}
|
|
197
|
+
else if (options) {
|
|
198
|
+
selectOptions = options;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else if (selectorOrOptions && typeof selectorOrOptions === "object") {
|
|
202
|
+
const { prompt: p, value: v, timeout: t } = selectorOrOptions, rest = __rest(selectorOrOptions, ["prompt", "value", "timeout"]);
|
|
203
|
+
prompt = p;
|
|
204
|
+
selectValue = v;
|
|
205
|
+
timeout = t;
|
|
206
|
+
selectOptions = rest;
|
|
207
|
+
}
|
|
208
|
+
if (!selector && !prompt) {
|
|
209
|
+
throw new Error("Missing input: pass a selector and/or a prompt.");
|
|
210
|
+
}
|
|
211
|
+
// Try to select the option with the original selector first
|
|
212
|
+
let errorToRaise;
|
|
213
|
+
if (selector && selectValue !== undefined) {
|
|
214
|
+
try {
|
|
215
|
+
yield this._page.selectOption(selector, selectValue, Object.assign(Object.assign({}, selectOptions), { timeout }));
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
errorToRaise = error;
|
|
220
|
+
selector = undefined;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
// If the original selector doesn't work, try to select the option with AI
|
|
224
|
+
if (prompt) {
|
|
225
|
+
yield this._ai.aiSelectOption({
|
|
226
|
+
value: typeof selectValue === "string" ? selectValue : selectValue === null || selectValue === void 0 ? void 0 : selectValue[0],
|
|
227
|
+
intention: prompt,
|
|
228
|
+
data: Object.keys(selectOptions).length > 0 ? selectOptions : undefined,
|
|
229
|
+
timeout,
|
|
230
|
+
});
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (errorToRaise) {
|
|
234
|
+
throw errorToRaise;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Perform an action on the page using AI based on a natural language prompt.
|
|
240
|
+
*
|
|
241
|
+
* @param prompt - Natural language description of the action to perform.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* // Simple action
|
|
246
|
+
* await page.act("Click the login button");
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
act(prompt) {
|
|
250
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
return this._ai.aiAct(prompt);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
extract(options) {
|
|
255
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
return this._ai.aiExtract(options);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
validate(prompt, model) {
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
const normalizedModel = typeof model === "string" ? { modelName: model } : model;
|
|
262
|
+
return this._ai.aiValidate({ prompt, model: normalizedModel });
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
prompt(prompt, schema, model) {
|
|
266
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
267
|
+
const normalizedModel = typeof model === "string" ? { modelName: model } : model;
|
|
268
|
+
return this._ai.aiPrompt({ prompt, schema, model: normalizedModel });
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { Page } from "playwright";
|
|
2
|
+
import type * as Skyvern from "../api/index.mjs";
|
|
3
|
+
import type { SkyvernBrowser } from "./SkyvernBrowser.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Provides methods to run Skyvern tasks and workflows in the context of a browser page.
|
|
6
|
+
*
|
|
7
|
+
* This class enables executing AI-powered browser automation tasks while sharing the
|
|
8
|
+
* context of an existing browser page. It supports running custom tasks, login workflows,
|
|
9
|
+
* and pre-defined workflows with automatic waiting for completion.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SkyvernBrowserPageAgent {
|
|
12
|
+
private readonly _browser;
|
|
13
|
+
private readonly _page;
|
|
14
|
+
constructor(browser: SkyvernBrowser, page: Page);
|
|
15
|
+
/**
|
|
16
|
+
* Run a task in the context of this page and wait for it to finish.
|
|
17
|
+
*
|
|
18
|
+
* @param prompt - Natural language description of the task to perform.
|
|
19
|
+
* @param options - Optional configuration
|
|
20
|
+
* @param options.engine - The execution engine to use. Defaults to skyvern_v2.
|
|
21
|
+
* @param options.model - LLM model configuration options.
|
|
22
|
+
* @param options.url - URL to navigate to. If not provided, uses the current page URL.
|
|
23
|
+
* @param options.webhookUrl - URL to receive webhook notifications about task progress.
|
|
24
|
+
* @param options.totpIdentifier - Identifier for TOTP (Time-based One-Time Password) authentication.
|
|
25
|
+
* @param options.totpUrl - URL to fetch TOTP codes from.
|
|
26
|
+
* @param options.title - Human-readable title for this task run.
|
|
27
|
+
* @param options.errorCodeMapping - Mapping of error codes to custom error messages.
|
|
28
|
+
* @param options.dataExtractionSchema - Schema defining what data to extract from the page.
|
|
29
|
+
* @param options.maxSteps - Maximum number of steps the agent can take.
|
|
30
|
+
* @param options.timeout - Maximum time in seconds to wait for task completion.
|
|
31
|
+
*
|
|
32
|
+
* @returns TaskRunResponse containing the task execution results.
|
|
33
|
+
*/
|
|
34
|
+
runTask(prompt: string, options?: {
|
|
35
|
+
engine?: Skyvern.RunEngine;
|
|
36
|
+
model?: Record<string, unknown>;
|
|
37
|
+
url?: string;
|
|
38
|
+
webhookUrl?: string;
|
|
39
|
+
totpIdentifier?: string;
|
|
40
|
+
totpUrl?: string;
|
|
41
|
+
title?: string;
|
|
42
|
+
errorCodeMapping?: Record<string, string>;
|
|
43
|
+
dataExtractionSchema?: Record<string, unknown> | string;
|
|
44
|
+
maxSteps?: number;
|
|
45
|
+
timeout?: number;
|
|
46
|
+
}): Promise<Skyvern.TaskRunResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Run a login task in the context of this page and wait for it to finish.
|
|
49
|
+
*
|
|
50
|
+
* This method has multiple overloaded signatures for different credential types:
|
|
51
|
+
*
|
|
52
|
+
* 1. Skyvern credentials:
|
|
53
|
+
* ```typescript
|
|
54
|
+
* await page.agent.login("skyvern", {
|
|
55
|
+
* credentialId: "cred_123"
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* 2. Bitwarden credentials:
|
|
60
|
+
* ```typescript
|
|
61
|
+
* await page.agent.login("bitwarden", {
|
|
62
|
+
* bitwardenItemId: "item_id",
|
|
63
|
+
* bitwardenCollectionId: "collection_id"
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* 3. 1Password credentials:
|
|
68
|
+
* ```typescript
|
|
69
|
+
* await page.agent.login("1password", {
|
|
70
|
+
* onepasswordVaultId: "vault_id",
|
|
71
|
+
* onepasswordItemId: "item_id"
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* 4. Azure Vault credentials:
|
|
76
|
+
* ```typescript
|
|
77
|
+
* await page.agent.login("azure_vault", {
|
|
78
|
+
* azureVaultName: "vault_name",
|
|
79
|
+
* azureVaultUsernameKey: "username_key",
|
|
80
|
+
* azureVaultPasswordKey: "password_key",
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
login(credentialType: "skyvern", options: {
|
|
85
|
+
credentialId: string;
|
|
86
|
+
url?: string;
|
|
87
|
+
prompt?: string;
|
|
88
|
+
webhookUrl?: string;
|
|
89
|
+
totpIdentifier?: string;
|
|
90
|
+
totpUrl?: string;
|
|
91
|
+
extraHttpHeaders?: Record<string, string>;
|
|
92
|
+
timeout?: number;
|
|
93
|
+
}): Promise<Skyvern.WorkflowRunResponse>;
|
|
94
|
+
login(credentialType: "bitwarden", options: {
|
|
95
|
+
bitwardenItemId: string;
|
|
96
|
+
bitwardenCollectionId?: string;
|
|
97
|
+
url?: string;
|
|
98
|
+
prompt?: string;
|
|
99
|
+
webhookUrl?: string;
|
|
100
|
+
totpIdentifier?: string;
|
|
101
|
+
totpUrl?: string;
|
|
102
|
+
extraHttpHeaders?: Record<string, string>;
|
|
103
|
+
timeout?: number;
|
|
104
|
+
}): Promise<Skyvern.WorkflowRunResponse>;
|
|
105
|
+
login(credentialType: "1password", options: {
|
|
106
|
+
onepasswordVaultId: string;
|
|
107
|
+
onepasswordItemId: string;
|
|
108
|
+
url?: string;
|
|
109
|
+
prompt?: string;
|
|
110
|
+
webhookUrl?: string;
|
|
111
|
+
totpIdentifier?: string;
|
|
112
|
+
totpUrl?: string;
|
|
113
|
+
extraHttpHeaders?: Record<string, string>;
|
|
114
|
+
timeout?: number;
|
|
115
|
+
}): Promise<Skyvern.WorkflowRunResponse>;
|
|
116
|
+
login(credentialType: "azure_vault", options: {
|
|
117
|
+
azureVaultName: string;
|
|
118
|
+
azureVaultUsernameKey: string;
|
|
119
|
+
azureVaultPasswordKey: string;
|
|
120
|
+
azureVaultTotpSecretKey?: string;
|
|
121
|
+
url?: string;
|
|
122
|
+
prompt?: string;
|
|
123
|
+
webhookUrl?: string;
|
|
124
|
+
totpIdentifier?: string;
|
|
125
|
+
totpUrl?: string;
|
|
126
|
+
extraHttpHeaders?: Record<string, string>;
|
|
127
|
+
timeout?: number;
|
|
128
|
+
}): Promise<Skyvern.WorkflowRunResponse>;
|
|
129
|
+
/**
|
|
130
|
+
* Run a file download task in the context of this page and wait for it to finish.
|
|
131
|
+
*
|
|
132
|
+
* @param prompt - Instructions for navigating to and downloading the file.
|
|
133
|
+
* @param options - Optional configuration
|
|
134
|
+
* @param options.url - URL to navigate to for file download. If not provided, uses the current page URL.
|
|
135
|
+
* @param options.downloadSuffix - Suffix or complete filename for the downloaded file.
|
|
136
|
+
* @param options.downloadTimeout - Timeout in seconds for the download operation.
|
|
137
|
+
* @param options.maxStepsPerRun - Maximum number of steps to execute.
|
|
138
|
+
* @param options.webhookUrl - URL to receive webhook notifications about download progress.
|
|
139
|
+
* @param options.totpIdentifier - Identifier for TOTP authentication.
|
|
140
|
+
* @param options.totpUrl - URL to fetch TOTP codes from.
|
|
141
|
+
* @param options.extraHttpHeaders - Additional HTTP headers to include in requests.
|
|
142
|
+
* @param options.timeout - Maximum time in seconds to wait for download completion.
|
|
143
|
+
*
|
|
144
|
+
* @returns WorkflowRunResponse containing the file download workflow execution results.
|
|
145
|
+
*/
|
|
146
|
+
downloadFiles(prompt: string, options?: {
|
|
147
|
+
url?: string;
|
|
148
|
+
downloadSuffix?: string;
|
|
149
|
+
downloadTimeout?: number;
|
|
150
|
+
maxStepsPerRun?: number;
|
|
151
|
+
webhookUrl?: string;
|
|
152
|
+
totpIdentifier?: string;
|
|
153
|
+
totpUrl?: string;
|
|
154
|
+
extraHttpHeaders?: Record<string, string>;
|
|
155
|
+
timeout?: number;
|
|
156
|
+
}): Promise<Skyvern.WorkflowRunResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* Run a workflow in the context of this page and wait for it to finish.
|
|
159
|
+
*
|
|
160
|
+
* @param workflowId - ID of the workflow to execute.
|
|
161
|
+
* @param options - Optional configuration
|
|
162
|
+
* @param options.parameters - Dictionary of parameters to pass to the workflow.
|
|
163
|
+
* @param options.template - Whether this is a workflow template.
|
|
164
|
+
* @param options.title - Human-readable title for this workflow run.
|
|
165
|
+
* @param options.webhookUrl - URL to receive webhook notifications about workflow progress.
|
|
166
|
+
* @param options.totpUrl - URL to fetch TOTP codes from.
|
|
167
|
+
* @param options.totpIdentifier - Identifier for TOTP authentication.
|
|
168
|
+
* @param options.timeout - Maximum time in seconds to wait for workflow completion.
|
|
169
|
+
*
|
|
170
|
+
* @returns WorkflowRunResponse containing the workflow execution results.
|
|
171
|
+
*/
|
|
172
|
+
runWorkflow(workflowId: string, options?: {
|
|
173
|
+
parameters?: Record<string, unknown>;
|
|
174
|
+
template?: boolean;
|
|
175
|
+
title?: string;
|
|
176
|
+
webhookUrl?: string;
|
|
177
|
+
totpUrl?: string;
|
|
178
|
+
totpIdentifier?: string;
|
|
179
|
+
timeout?: number;
|
|
180
|
+
}): Promise<Skyvern.WorkflowRunResponse>;
|
|
181
|
+
private _waitForRunCompletion;
|
|
182
|
+
private _getPageUrl;
|
|
183
|
+
}
|