@skyvern/client 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/Client.d.ts +15 -3
  3. package/dist/cjs/Client.js +66 -7
  4. package/dist/cjs/api/client/requests/CreateCredentialRequest.d.ts +1 -1
  5. package/dist/cjs/api/client/requests/DownloadFilesRequest.d.ts +37 -0
  6. package/dist/cjs/api/client/requests/LoginRequest.d.ts +6 -6
  7. package/dist/cjs/api/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/index.d.ts +0 -2
  9. package/dist/cjs/api/resources/index.js +1 -6
  10. package/dist/cjs/api/types/ActionBlock.d.ts +1 -0
  11. package/dist/cjs/api/types/ActionBlockYaml.d.ts +1 -0
  12. package/dist/cjs/api/types/ActionType.d.ts +1 -0
  13. package/dist/cjs/api/types/ActionType.js +1 -0
  14. package/dist/cjs/api/types/BranchCondition.d.ts +2 -1
  15. package/dist/cjs/api/types/BranchConditionCriteria.d.ts +10 -0
  16. package/dist/cjs/api/types/BranchConditionYaml.d.ts +7 -0
  17. package/dist/cjs/api/types/BranchCriteriaYaml.d.ts +12 -0
  18. package/dist/cjs/api/types/BranchCriteriaYaml.js +11 -0
  19. package/dist/cjs/api/types/CodeBlock.d.ts +1 -0
  20. package/dist/cjs/api/types/CodeBlockYaml.d.ts +1 -0
  21. package/dist/cjs/api/types/ConditionalBlock.d.ts +1 -0
  22. package/dist/cjs/api/types/ConditionalBlockYaml.d.ts +11 -0
  23. package/dist/cjs/api/types/CredentialResponse.d.ts +1 -1
  24. package/dist/cjs/api/types/CredentialTypeOutput.d.ts +1 -0
  25. package/dist/cjs/api/types/CredentialTypeOutput.js +1 -0
  26. package/dist/cjs/api/types/DownloadToS3Block.d.ts +1 -0
  27. package/dist/cjs/api/types/DownloadToS3BlockYaml.d.ts +1 -0
  28. package/dist/cjs/api/types/ExtractionBlock.d.ts +1 -0
  29. package/dist/cjs/api/types/ExtractionBlockYaml.d.ts +1 -0
  30. package/dist/cjs/api/types/FileDownloadBlock.d.ts +1 -0
  31. package/dist/cjs/api/types/FileDownloadBlockYaml.d.ts +1 -0
  32. package/dist/cjs/api/types/FileParserBlock.d.ts +1 -0
  33. package/dist/cjs/api/types/FileParserBlockYaml.d.ts +1 -0
  34. package/dist/cjs/api/types/FileUploadBlock.d.ts +1 -0
  35. package/dist/cjs/api/types/FileUploadBlockYaml.d.ts +1 -0
  36. package/dist/cjs/api/types/ForLoopBlock.d.ts +1 -0
  37. package/dist/cjs/api/types/ForLoopBlockYaml.d.ts +1 -0
  38. package/dist/cjs/api/types/ForLoopBlockYamlLoopBlocksItem.d.ts +4 -1
  39. package/dist/cjs/api/types/HttpRequestBlock.d.ts +2 -0
  40. package/dist/cjs/api/types/HttpRequestBlockYaml.d.ts +2 -0
  41. package/dist/cjs/api/types/HumanInteractionBlock.d.ts +1 -0
  42. package/dist/cjs/api/types/HumanInteractionBlockYaml.d.ts +1 -0
  43. package/dist/cjs/api/types/JinjaBranchCriteria.d.ts +7 -0
  44. package/dist/cjs/api/types/LoginBlock.d.ts +1 -0
  45. package/dist/cjs/api/types/LoginBlockYaml.d.ts +1 -0
  46. package/dist/cjs/api/types/NavigationBlock.d.ts +1 -0
  47. package/dist/cjs/api/types/NavigationBlockYaml.d.ts +1 -0
  48. package/dist/cjs/api/types/PdfParserBlock.d.ts +1 -0
  49. package/dist/cjs/api/types/PdfParserBlockYaml.d.ts +1 -0
  50. package/dist/cjs/api/types/PromptAction.d.ts +11 -0
  51. package/dist/cjs/api/types/PromptBranchCriteria.d.ts +7 -0
  52. package/dist/cjs/api/types/RunSdkActionRequestAction.d.ts +7 -1
  53. package/dist/cjs/api/types/SecretCredential.d.ts +9 -0
  54. package/dist/cjs/api/types/SecretCredential.js +3 -0
  55. package/dist/cjs/api/types/SecretCredentialResponse.d.ts +7 -0
  56. package/dist/cjs/api/types/SecretCredentialResponse.js +3 -0
  57. package/dist/cjs/api/types/SendEmailBlock.d.ts +1 -0
  58. package/dist/cjs/api/types/SendEmailBlockYaml.d.ts +1 -0
  59. package/dist/cjs/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.d.ts +1 -0
  60. package/dist/cjs/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.js +1 -0
  61. package/dist/cjs/api/types/TaskBlock.d.ts +1 -0
  62. package/dist/cjs/api/types/TaskBlockYaml.d.ts +1 -0
  63. package/dist/cjs/api/types/TaskV2Block.d.ts +1 -0
  64. package/dist/cjs/api/types/TaskV2BlockYaml.d.ts +1 -0
  65. package/dist/cjs/api/types/TextPromptBlock.d.ts +1 -0
  66. package/dist/cjs/api/types/TextPromptBlockYaml.d.ts +1 -0
  67. package/dist/cjs/api/types/UploadToS3Block.d.ts +1 -0
  68. package/dist/cjs/api/types/UploadToS3BlockYaml.d.ts +1 -0
  69. package/dist/cjs/api/types/UrlBlock.d.ts +1 -0
  70. package/dist/cjs/api/types/UrlBlockYaml.d.ts +1 -0
  71. package/dist/cjs/api/types/ValidateAction.d.ts +9 -0
  72. package/dist/cjs/api/types/ValidateAction.js +3 -0
  73. package/dist/cjs/api/types/ValidationBlock.d.ts +1 -0
  74. package/dist/cjs/api/types/ValidationBlockYaml.d.ts +1 -0
  75. package/dist/cjs/api/types/WaitBlock.d.ts +1 -0
  76. package/dist/cjs/api/types/WaitBlockYaml.d.ts +1 -0
  77. package/dist/cjs/api/types/WorkflowDefinitionYamlBlocksItem.d.ts +4 -1
  78. package/dist/cjs/api/types/WorkflowRunBlock.d.ts +4 -0
  79. package/dist/cjs/api/types/index.d.ts +10 -2
  80. package/dist/cjs/api/types/index.js +10 -2
  81. package/dist/cjs/index.d.ts +3 -1
  82. package/dist/cjs/index.js +7 -2
  83. package/dist/cjs/library/Skyvern.d.ts +124 -0
  84. package/dist/cjs/library/Skyvern.js +315 -0
  85. package/dist/cjs/library/SkyvernBrowser.d.ts +76 -0
  86. package/dist/cjs/library/SkyvernBrowser.js +119 -0
  87. package/dist/cjs/library/SkyvernBrowserPage.d.ts +69 -0
  88. package/dist/cjs/library/SkyvernBrowserPage.js +162 -0
  89. package/dist/cjs/library/SkyvernBrowserPageAgent.d.ts +135 -0
  90. package/dist/cjs/library/SkyvernBrowserPageAgent.js +256 -0
  91. package/dist/cjs/library/SkyvernBrowserPageAi.d.ts +85 -0
  92. package/dist/cjs/library/SkyvernBrowserPageAi.js +248 -0
  93. package/dist/cjs/library/constants.d.ts +3 -0
  94. package/dist/cjs/library/constants.js +6 -0
  95. package/dist/cjs/library/index.d.ts +10 -0
  96. package/dist/cjs/library/index.js +20 -0
  97. package/dist/cjs/library/logger.d.ts +15 -0
  98. package/dist/cjs/library/logger.js +56 -0
  99. package/dist/cjs/version.d.ts +1 -1
  100. package/dist/cjs/version.js +1 -1
  101. package/dist/esm/Client.d.mts +15 -3
  102. package/dist/esm/Client.mjs +66 -7
  103. package/dist/esm/api/client/requests/CreateCredentialRequest.d.mts +1 -1
  104. package/dist/esm/api/client/requests/DownloadFilesRequest.d.mts +37 -0
  105. package/dist/esm/api/client/requests/LoginRequest.d.mts +6 -6
  106. package/dist/esm/api/client/requests/index.d.mts +1 -0
  107. package/dist/esm/api/resources/index.d.mts +0 -2
  108. package/dist/esm/api/resources/index.mjs +0 -2
  109. package/dist/esm/api/types/ActionBlock.d.mts +1 -0
  110. package/dist/esm/api/types/ActionBlockYaml.d.mts +1 -0
  111. package/dist/esm/api/types/ActionType.d.mts +1 -0
  112. package/dist/esm/api/types/ActionType.mjs +1 -0
  113. package/dist/esm/api/types/BranchCondition.d.mts +2 -1
  114. package/dist/esm/api/types/BranchConditionCriteria.d.mts +10 -0
  115. package/dist/esm/api/types/BranchConditionYaml.d.mts +7 -0
  116. package/dist/esm/api/types/BranchCriteriaYaml.d.mts +12 -0
  117. package/dist/esm/api/types/BranchCriteriaYaml.mjs +8 -0
  118. package/dist/esm/api/types/CodeBlock.d.mts +1 -0
  119. package/dist/esm/api/types/CodeBlockYaml.d.mts +1 -0
  120. package/dist/esm/api/types/ConditionalBlock.d.mts +1 -0
  121. package/dist/esm/api/types/ConditionalBlockYaml.d.mts +11 -0
  122. package/dist/esm/api/types/CredentialResponse.d.mts +1 -1
  123. package/dist/esm/api/types/CredentialTypeOutput.d.mts +1 -0
  124. package/dist/esm/api/types/CredentialTypeOutput.mjs +1 -0
  125. package/dist/esm/api/types/DownloadToS3Block.d.mts +1 -0
  126. package/dist/esm/api/types/DownloadToS3BlockYaml.d.mts +1 -0
  127. package/dist/esm/api/types/ExtractionBlock.d.mts +1 -0
  128. package/dist/esm/api/types/ExtractionBlockYaml.d.mts +1 -0
  129. package/dist/esm/api/types/FileDownloadBlock.d.mts +1 -0
  130. package/dist/esm/api/types/FileDownloadBlockYaml.d.mts +1 -0
  131. package/dist/esm/api/types/FileParserBlock.d.mts +1 -0
  132. package/dist/esm/api/types/FileParserBlockYaml.d.mts +1 -0
  133. package/dist/esm/api/types/FileUploadBlock.d.mts +1 -0
  134. package/dist/esm/api/types/FileUploadBlockYaml.d.mts +1 -0
  135. package/dist/esm/api/types/ForLoopBlock.d.mts +1 -0
  136. package/dist/esm/api/types/ForLoopBlockYaml.d.mts +1 -0
  137. package/dist/esm/api/types/ForLoopBlockYamlLoopBlocksItem.d.mts +4 -1
  138. package/dist/esm/api/types/HttpRequestBlock.d.mts +2 -0
  139. package/dist/esm/api/types/HttpRequestBlockYaml.d.mts +2 -0
  140. package/dist/esm/api/types/HumanInteractionBlock.d.mts +1 -0
  141. package/dist/esm/api/types/HumanInteractionBlockYaml.d.mts +1 -0
  142. package/dist/esm/api/types/JinjaBranchCriteria.d.mts +7 -0
  143. package/dist/esm/api/types/LoginBlock.d.mts +1 -0
  144. package/dist/esm/api/types/LoginBlockYaml.d.mts +1 -0
  145. package/dist/esm/api/types/NavigationBlock.d.mts +1 -0
  146. package/dist/esm/api/types/NavigationBlockYaml.d.mts +1 -0
  147. package/dist/esm/api/types/PdfParserBlock.d.mts +1 -0
  148. package/dist/esm/api/types/PdfParserBlockYaml.d.mts +1 -0
  149. package/dist/esm/api/types/PromptAction.d.mts +11 -0
  150. package/dist/esm/api/types/PromptBranchCriteria.d.mts +7 -0
  151. package/dist/esm/api/types/RunSdkActionRequestAction.d.mts +7 -1
  152. package/dist/esm/api/types/SecretCredential.d.mts +9 -0
  153. package/dist/esm/api/types/SecretCredential.mjs +2 -0
  154. package/dist/esm/api/types/SecretCredentialResponse.d.mts +7 -0
  155. package/dist/esm/api/types/SecretCredentialResponse.mjs +2 -0
  156. package/dist/esm/api/types/SendEmailBlock.d.mts +1 -0
  157. package/dist/esm/api/types/SendEmailBlockYaml.d.mts +1 -0
  158. package/dist/esm/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.d.mts +1 -0
  159. package/dist/esm/api/types/SkyvernForgeSdkSchemasCredentialsCredentialType.mjs +1 -0
  160. package/dist/esm/api/types/TaskBlock.d.mts +1 -0
  161. package/dist/esm/api/types/TaskBlockYaml.d.mts +1 -0
  162. package/dist/esm/api/types/TaskV2Block.d.mts +1 -0
  163. package/dist/esm/api/types/TaskV2BlockYaml.d.mts +1 -0
  164. package/dist/esm/api/types/TextPromptBlock.d.mts +1 -0
  165. package/dist/esm/api/types/TextPromptBlockYaml.d.mts +1 -0
  166. package/dist/esm/api/types/UploadToS3Block.d.mts +1 -0
  167. package/dist/esm/api/types/UploadToS3BlockYaml.d.mts +1 -0
  168. package/dist/esm/api/types/UrlBlock.d.mts +1 -0
  169. package/dist/esm/api/types/UrlBlockYaml.d.mts +1 -0
  170. package/dist/esm/api/types/ValidateAction.d.mts +9 -0
  171. package/dist/esm/api/types/ValidateAction.mjs +2 -0
  172. package/dist/esm/api/types/ValidationBlock.d.mts +1 -0
  173. package/dist/esm/api/types/ValidationBlockYaml.d.mts +1 -0
  174. package/dist/esm/api/types/WaitBlock.d.mts +1 -0
  175. package/dist/esm/api/types/WaitBlockYaml.d.mts +1 -0
  176. package/dist/esm/api/types/WorkflowDefinitionYamlBlocksItem.d.mts +4 -1
  177. package/dist/esm/api/types/WorkflowRunBlock.d.mts +4 -0
  178. package/dist/esm/api/types/index.d.mts +10 -2
  179. package/dist/esm/api/types/index.mjs +10 -2
  180. package/dist/esm/index.d.mts +3 -1
  181. package/dist/esm/index.mjs +2 -1
  182. package/dist/esm/library/Skyvern.d.mts +124 -0
  183. package/dist/esm/library/Skyvern.mjs +278 -0
  184. package/dist/esm/library/SkyvernBrowser.d.mts +76 -0
  185. package/dist/esm/library/SkyvernBrowser.mjs +115 -0
  186. package/dist/esm/library/SkyvernBrowserPage.d.mts +69 -0
  187. package/dist/esm/library/SkyvernBrowserPage.mjs +158 -0
  188. package/dist/esm/library/SkyvernBrowserPageAgent.d.mts +135 -0
  189. package/dist/esm/library/SkyvernBrowserPageAgent.mjs +252 -0
  190. package/dist/esm/library/SkyvernBrowserPageAi.d.mts +85 -0
  191. package/dist/esm/library/SkyvernBrowserPageAi.mjs +244 -0
  192. package/dist/esm/library/constants.d.mts +3 -0
  193. package/dist/esm/library/constants.mjs +3 -0
  194. package/dist/esm/library/index.d.mts +10 -0
  195. package/dist/esm/library/index.mjs +7 -0
  196. package/dist/esm/library/logger.d.mts +15 -0
  197. package/dist/esm/library/logger.mjs +52 -0
  198. package/dist/esm/version.d.mts +1 -1
  199. package/dist/esm/version.mjs +1 -1
  200. package/package.json +4 -1
  201. package/reference.md +0 -411
  202. package/dist/cjs/api/resources/workflows/client/Client.d.ts +0 -108
  203. package/dist/cjs/api/resources/workflows/client/Client.js +0 -465
  204. package/dist/cjs/api/resources/workflows/client/index.d.ts +0 -1
  205. package/dist/cjs/api/resources/workflows/client/index.js +0 -17
  206. package/dist/cjs/api/resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.d.ts +0 -10
  207. package/dist/cjs/api/resources/workflows/client/requests/FolderCreate.d.ts +0 -12
  208. package/dist/cjs/api/resources/workflows/client/requests/FolderUpdate.d.ts +0 -10
  209. package/dist/cjs/api/resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.d.ts +0 -16
  210. package/dist/cjs/api/resources/workflows/client/requests/UpdateWorkflowFolderRequest.d.ts +0 -8
  211. package/dist/cjs/api/resources/workflows/client/requests/index.d.ts +0 -5
  212. package/dist/cjs/api/resources/workflows/client/requests/index.js +0 -2
  213. package/dist/cjs/api/resources/workflows/index.d.ts +0 -1
  214. package/dist/cjs/api/resources/workflows/index.js +0 -17
  215. package/dist/cjs/api/types/BranchCriteria.d.ts +0 -8
  216. package/dist/cjs/api/types/Folder.d.ts +0 -15
  217. package/dist/esm/api/resources/workflows/client/Client.d.mts +0 -108
  218. package/dist/esm/api/resources/workflows/client/Client.mjs +0 -428
  219. package/dist/esm/api/resources/workflows/client/index.d.mts +0 -1
  220. package/dist/esm/api/resources/workflows/client/index.mjs +0 -1
  221. package/dist/esm/api/resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.d.mts +0 -10
  222. package/dist/esm/api/resources/workflows/client/requests/FolderCreate.d.mts +0 -12
  223. package/dist/esm/api/resources/workflows/client/requests/FolderUpdate.d.mts +0 -10
  224. package/dist/esm/api/resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.d.mts +0 -16
  225. package/dist/esm/api/resources/workflows/client/requests/UpdateWorkflowFolderRequest.d.mts +0 -8
  226. package/dist/esm/api/resources/workflows/client/requests/index.d.mts +0 -5
  227. package/dist/esm/api/resources/workflows/client/requests/index.mjs +0 -1
  228. package/dist/esm/api/resources/workflows/index.d.mts +0 -1
  229. package/dist/esm/api/resources/workflows/index.mjs +0 -1
  230. package/dist/esm/api/types/BranchCriteria.d.mts +0 -8
  231. package/dist/esm/api/types/Folder.d.mts +0 -15
  232. /package/dist/cjs/api/{resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.js → client/requests/DownloadFilesRequest.js} +0 -0
  233. /package/dist/cjs/api/{resources/workflows/client/requests/FolderCreate.js → types/BranchConditionCriteria.js} +0 -0
  234. /package/dist/cjs/api/{resources/workflows/client/requests/FolderUpdate.js → types/BranchConditionYaml.js} +0 -0
  235. /package/dist/cjs/api/{resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.js → types/ConditionalBlockYaml.js} +0 -0
  236. /package/dist/cjs/api/{resources/workflows/client/requests/UpdateWorkflowFolderRequest.js → types/JinjaBranchCriteria.js} +0 -0
  237. /package/dist/cjs/api/types/{BranchCriteria.js → PromptAction.js} +0 -0
  238. /package/dist/cjs/api/types/{Folder.js → PromptBranchCriteria.js} +0 -0
  239. /package/dist/esm/api/{resources/workflows/client/requests/DeleteFolderV1FoldersFolderIdDeleteRequest.mjs → client/requests/DownloadFilesRequest.mjs} +0 -0
  240. /package/dist/esm/api/{resources/workflows/client/requests/FolderCreate.mjs → types/BranchConditionCriteria.mjs} +0 -0
  241. /package/dist/esm/api/{resources/workflows/client/requests/FolderUpdate.mjs → types/BranchConditionYaml.mjs} +0 -0
  242. /package/dist/esm/api/{resources/workflows/client/requests/GetFoldersV1FoldersGetRequest.mjs → types/ConditionalBlockYaml.mjs} +0 -0
  243. /package/dist/esm/api/{resources/workflows/client/requests/UpdateWorkflowFolderRequest.mjs → types/JinjaBranchCriteria.mjs} +0 -0
  244. /package/dist/esm/api/types/{BranchCriteria.mjs → PromptAction.mjs} +0 -0
  245. /package/dist/esm/api/types/{Folder.mjs → PromptBranchCriteria.mjs} +0 -0
@@ -0,0 +1,252 @@
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
+ import { SkyvernEnvironment } from "../environments.mjs";
11
+ import { DEFAULT_AGENT_HEARTBEAT_INTERVAL, DEFAULT_AGENT_TIMEOUT } from "./constants.mjs";
12
+ import { LOG } from "./logger.mjs";
13
+ function getAppUrlForRun(runId) {
14
+ return `https://app.skyvern.com/runs/${runId}`;
15
+ }
16
+ /**
17
+ * Provides methods to run Skyvern tasks and workflows in the context of a browser page.
18
+ *
19
+ * This class enables executing AI-powered browser automation tasks while sharing the
20
+ * context of an existing browser page. It supports running custom tasks, login workflows,
21
+ * and pre-defined workflows with automatic waiting for completion.
22
+ */
23
+ export class SkyvernBrowserPageAgent {
24
+ constructor(browser, page) {
25
+ this._browser = browser;
26
+ this._page = page;
27
+ }
28
+ /**
29
+ * Run a task in the context of this page and wait for it to finish.
30
+ *
31
+ * @param prompt - Natural language description of the task to perform.
32
+ * @param options - Optional configuration
33
+ * @param options.engine - The execution engine to use. Defaults to skyvern_v2.
34
+ * @param options.model - LLM model configuration options.
35
+ * @param options.url - URL to navigate to. If not provided, uses the current page URL.
36
+ * @param options.webhookUrl - URL to receive webhook notifications about task progress.
37
+ * @param options.totpIdentifier - Identifier for TOTP (Time-based One-Time Password) authentication.
38
+ * @param options.totpUrl - URL to fetch TOTP codes from.
39
+ * @param options.title - Human-readable title for this task run.
40
+ * @param options.errorCodeMapping - Mapping of error codes to custom error messages.
41
+ * @param options.dataExtractionSchema - Schema defining what data to extract from the page.
42
+ * @param options.maxSteps - Maximum number of steps the agent can take.
43
+ * @param options.timeout - Maximum time in seconds to wait for task completion.
44
+ *
45
+ * @returns TaskRunResponse containing the task execution results.
46
+ */
47
+ runTask(prompt, options) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ var _a, _b;
50
+ LOG.info("AI run task", { prompt });
51
+ const taskRun = yield this._browser.skyvern.runTask({
52
+ "x-user-agent": "skyvern-sdk",
53
+ body: {
54
+ prompt: prompt,
55
+ engine: options === null || options === void 0 ? void 0 : options.engine,
56
+ model: options === null || options === void 0 ? void 0 : options.model,
57
+ url: (_a = options === null || options === void 0 ? void 0 : options.url) !== null && _a !== void 0 ? _a : this._getPageUrl(),
58
+ webhook_url: options === null || options === void 0 ? void 0 : options.webhookUrl,
59
+ totp_identifier: options === null || options === void 0 ? void 0 : options.totpIdentifier,
60
+ totp_url: options === null || options === void 0 ? void 0 : options.totpUrl,
61
+ title: options === null || options === void 0 ? void 0 : options.title,
62
+ error_code_mapping: options === null || options === void 0 ? void 0 : options.errorCodeMapping,
63
+ data_extraction_schema: options === null || options === void 0 ? void 0 : options.dataExtractionSchema,
64
+ max_steps: options === null || options === void 0 ? void 0 : options.maxSteps,
65
+ browser_session_id: this._browser.browserSessionId,
66
+ browser_address: this._browser.browserAddress,
67
+ },
68
+ });
69
+ if (this._browser.skyvern.environment === SkyvernEnvironment.Cloud) {
70
+ LOG.info("AI task is running, this may take a while", { url: getAppUrlForRun(taskRun.run_id), run_id: taskRun.run_id });
71
+ }
72
+ else {
73
+ LOG.info("AI task is running, this may take a while", { run_id: taskRun.run_id });
74
+ }
75
+ const completedRun = yield this._waitForRunCompletion(taskRun.run_id, (_b = options === null || options === void 0 ? void 0 : options.timeout) !== null && _b !== void 0 ? _b : DEFAULT_AGENT_TIMEOUT);
76
+ LOG.info("AI task finished", { run_id: completedRun.run_id, status: completedRun.status });
77
+ return completedRun;
78
+ });
79
+ }
80
+ /**
81
+ * Run a login task in the context of this page and wait for it to finish.
82
+ *
83
+ * @param credentialType - Type of credential store to use (e.g., skyvern, bitwarden, onepassword).
84
+ * @param options - Optional configuration
85
+ * @param options.url - URL to navigate to for login. If not provided, uses the current page URL.
86
+ * @param options.credentialId - ID of the credential to use.
87
+ * @param options.bitwardenCollectionId - Bitwarden collection ID containing the credentials.
88
+ * @param options.bitwardenItemId - Bitwarden item ID for the credentials.
89
+ * @param options.onepasswordVaultId - 1Password vault ID containing the credentials.
90
+ * @param options.onepasswordItemId - 1Password item ID for the credentials.
91
+ * @param options.prompt - Additional instructions for the login process.
92
+ * @param options.webhookUrl - URL to receive webhook notifications about login progress.
93
+ * @param options.totpIdentifier - Identifier for TOTP authentication.
94
+ * @param options.totpUrl - URL to fetch TOTP codes from.
95
+ * @param options.extraHttpHeaders - Additional HTTP headers to include in requests.
96
+ * @param options.timeout - Maximum time in seconds to wait for login completion.
97
+ *
98
+ * @returns WorkflowRunResponse containing the login workflow execution results.
99
+ */
100
+ login(credentialType, options) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ var _a, _b;
103
+ LOG.info("Starting AI login workflow", { credential_type: credentialType });
104
+ const workflowRun = yield this._browser.skyvern.login({
105
+ credential_type: credentialType,
106
+ url: (_a = options === null || options === void 0 ? void 0 : options.url) !== null && _a !== void 0 ? _a : this._getPageUrl(),
107
+ credential_id: options === null || options === void 0 ? void 0 : options.credentialId,
108
+ bitwarden_collection_id: options === null || options === void 0 ? void 0 : options.bitwardenCollectionId,
109
+ bitwarden_item_id: options === null || options === void 0 ? void 0 : options.bitwardenItemId,
110
+ onepassword_vault_id: options === null || options === void 0 ? void 0 : options.onepasswordVaultId,
111
+ onepassword_item_id: options === null || options === void 0 ? void 0 : options.onepasswordItemId,
112
+ prompt: options === null || options === void 0 ? void 0 : options.prompt,
113
+ webhook_url: options === null || options === void 0 ? void 0 : options.webhookUrl,
114
+ totp_identifier: options === null || options === void 0 ? void 0 : options.totpIdentifier,
115
+ totp_url: options === null || options === void 0 ? void 0 : options.totpUrl,
116
+ browser_session_id: this._browser.browserSessionId,
117
+ browser_address: this._browser.browserAddress,
118
+ extra_http_headers: options === null || options === void 0 ? void 0 : options.extraHttpHeaders,
119
+ }, {
120
+ headers: { "x-user-agent": "skyvern-sdk" },
121
+ });
122
+ if (this._browser.skyvern.environment === SkyvernEnvironment.Cloud) {
123
+ LOG.info("AI login workflow is running, this may take a while", { url: getAppUrlForRun(workflowRun.run_id), run_id: workflowRun.run_id });
124
+ }
125
+ else {
126
+ LOG.info("AI login workflow is running, this may take a while", { run_id: workflowRun.run_id });
127
+ }
128
+ const completedRun = yield this._waitForRunCompletion(workflowRun.run_id, (_b = options === null || options === void 0 ? void 0 : options.timeout) !== null && _b !== void 0 ? _b : DEFAULT_AGENT_TIMEOUT);
129
+ LOG.info("AI login workflow finished", { run_id: completedRun.run_id, status: completedRun.status });
130
+ return completedRun;
131
+ });
132
+ }
133
+ /**
134
+ * Run a file download task in the context of this page and wait for it to finish.
135
+ *
136
+ * @param prompt - Instructions for navigating to and downloading the file.
137
+ * @param options - Optional configuration
138
+ * @param options.url - URL to navigate to for file download. If not provided, uses the current page URL.
139
+ * @param options.downloadSuffix - Suffix or complete filename for the downloaded file.
140
+ * @param options.downloadTimeout - Timeout in seconds for the download operation.
141
+ * @param options.maxStepsPerRun - Maximum number of steps to execute.
142
+ * @param options.webhookUrl - URL to receive webhook notifications about download progress.
143
+ * @param options.totpIdentifier - Identifier for TOTP authentication.
144
+ * @param options.totpUrl - URL to fetch TOTP codes from.
145
+ * @param options.extraHttpHeaders - Additional HTTP headers to include in requests.
146
+ * @param options.timeout - Maximum time in seconds to wait for download completion.
147
+ *
148
+ * @returns WorkflowRunResponse containing the file download workflow execution results.
149
+ */
150
+ downloadFiles(prompt, options) {
151
+ return __awaiter(this, void 0, void 0, function* () {
152
+ var _a, _b;
153
+ LOG.info("Starting AI file download workflow", { navigation_goal: prompt });
154
+ const workflowRun = yield this._browser.skyvern.downloadFiles({
155
+ navigation_goal: prompt,
156
+ url: (_a = options === null || options === void 0 ? void 0 : options.url) !== null && _a !== void 0 ? _a : this._getPageUrl(),
157
+ download_suffix: options === null || options === void 0 ? void 0 : options.downloadSuffix,
158
+ download_timeout: options === null || options === void 0 ? void 0 : options.downloadTimeout,
159
+ max_steps_per_run: options === null || options === void 0 ? void 0 : options.maxStepsPerRun,
160
+ webhook_url: options === null || options === void 0 ? void 0 : options.webhookUrl,
161
+ totp_identifier: options === null || options === void 0 ? void 0 : options.totpIdentifier,
162
+ totp_url: options === null || options === void 0 ? void 0 : options.totpUrl,
163
+ browser_session_id: this._browser.browserSessionId,
164
+ browser_address: this._browser.browserAddress,
165
+ extra_http_headers: options === null || options === void 0 ? void 0 : options.extraHttpHeaders,
166
+ }, {
167
+ headers: { "x-user-agent": "skyvern-sdk" },
168
+ });
169
+ LOG.info("AI file download workflow is running, this may take a while", { run_id: workflowRun.run_id });
170
+ const completedRun = yield this._waitForRunCompletion(workflowRun.run_id, (_b = options === null || options === void 0 ? void 0 : options.timeout) !== null && _b !== void 0 ? _b : DEFAULT_AGENT_TIMEOUT);
171
+ LOG.info("AI file download workflow finished", { run_id: completedRun.run_id, status: completedRun.status });
172
+ return completedRun;
173
+ });
174
+ }
175
+ /**
176
+ * Run a workflow in the context of this page and wait for it to finish.
177
+ *
178
+ * @param workflowId - ID of the workflow to execute.
179
+ * @param options - Optional configuration
180
+ * @param options.parameters - Dictionary of parameters to pass to the workflow.
181
+ * @param options.template - Whether this is a workflow template.
182
+ * @param options.title - Human-readable title for this workflow run.
183
+ * @param options.webhookUrl - URL to receive webhook notifications about workflow progress.
184
+ * @param options.totpUrl - URL to fetch TOTP codes from.
185
+ * @param options.totpIdentifier - Identifier for TOTP authentication.
186
+ * @param options.timeout - Maximum time in seconds to wait for workflow completion.
187
+ *
188
+ * @returns WorkflowRunResponse containing the workflow execution results.
189
+ */
190
+ runWorkflow(workflowId, options) {
191
+ return __awaiter(this, void 0, void 0, function* () {
192
+ var _a;
193
+ LOG.info("Starting AI workflow", { workflow_id: workflowId });
194
+ const workflowRun = yield this._browser.skyvern.runWorkflow({
195
+ "x-user-agent": "skyvern-sdk",
196
+ template: options === null || options === void 0 ? void 0 : options.template,
197
+ body: {
198
+ workflow_id: workflowId,
199
+ parameters: options === null || options === void 0 ? void 0 : options.parameters,
200
+ title: options === null || options === void 0 ? void 0 : options.title,
201
+ webhook_url: options === null || options === void 0 ? void 0 : options.webhookUrl,
202
+ totp_url: options === null || options === void 0 ? void 0 : options.totpUrl,
203
+ totp_identifier: options === null || options === void 0 ? void 0 : options.totpIdentifier,
204
+ browser_session_id: this._browser.browserSessionId,
205
+ browser_address: this._browser.browserAddress,
206
+ },
207
+ }, {
208
+ headers: { "x-user-agent": "skyvern-sdk" },
209
+ });
210
+ if (this._browser.skyvern.environment === SkyvernEnvironment.Cloud) {
211
+ LOG.info("AI workflow is running, this may take a while", { url: getAppUrlForRun(workflowRun.run_id), run_id: workflowRun.run_id });
212
+ }
213
+ else {
214
+ LOG.info("AI workflow is running, this may take a while", { run_id: workflowRun.run_id });
215
+ }
216
+ const completedRun = yield this._waitForRunCompletion(workflowRun.run_id, (_a = options === null || options === void 0 ? void 0 : options.timeout) !== null && _a !== void 0 ? _a : DEFAULT_AGENT_TIMEOUT);
217
+ LOG.info("AI workflow finished", { run_id: completedRun.run_id, status: completedRun.status });
218
+ return completedRun;
219
+ });
220
+ }
221
+ _waitForRunCompletion(runId, timeoutSeconds) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ const startTime = Date.now();
224
+ const timeoutMs = timeoutSeconds * 1000;
225
+ while (true) {
226
+ const run = yield this._browser.skyvern.getRun(runId);
227
+ // Check if the run is in a final state
228
+ const status = run.status;
229
+ if (status === "completed" ||
230
+ status === "failed" ||
231
+ status === "terminated" ||
232
+ status === "timed_out" ||
233
+ status === "canceled") {
234
+ return run;
235
+ }
236
+ // Check timeout
237
+ if (Date.now() - startTime >= timeoutMs) {
238
+ throw new Error(`Timeout waiting for run ${runId} to complete after ${timeoutSeconds} seconds`);
239
+ }
240
+ // Wait before polling again
241
+ yield new Promise((resolve) => setTimeout(resolve, DEFAULT_AGENT_HEARTBEAT_INTERVAL * 1000));
242
+ }
243
+ });
244
+ }
245
+ _getPageUrl() {
246
+ const url = this._page.url();
247
+ if (url === "about:blank") {
248
+ return undefined;
249
+ }
250
+ return url;
251
+ }
252
+ }
@@ -0,0 +1,85 @@
1
+ import type { Page } from "playwright";
2
+ import type { SkyvernBrowser } from "./SkyvernBrowser.mjs";
3
+ export declare class SkyvernBrowserPageAi {
4
+ private readonly _browser;
5
+ private readonly _page;
6
+ constructor(browser: SkyvernBrowser, page: Page);
7
+ /**
8
+ * Click an element using AI via API call.
9
+ */
10
+ aiClick(options: {
11
+ selector?: string;
12
+ intention: string;
13
+ data?: string | Record<string, unknown>;
14
+ timeout?: number;
15
+ }): Promise<string | null>;
16
+ /**
17
+ * Input text into an element using AI via API call.
18
+ */
19
+ aiInputText(options: {
20
+ selector?: string;
21
+ value?: string;
22
+ intention: string;
23
+ data?: string | Record<string, unknown>;
24
+ totpIdentifier?: string;
25
+ totpUrl?: string;
26
+ timeout?: number;
27
+ }): Promise<string>;
28
+ /**
29
+ * Select an option from a dropdown using AI via API call.
30
+ */
31
+ aiSelectOption(options: {
32
+ selector?: string;
33
+ value?: string;
34
+ intention: string;
35
+ data?: string | Record<string, unknown>;
36
+ timeout?: number;
37
+ }): Promise<string>;
38
+ /**
39
+ * Upload a file using AI via API call.
40
+ */
41
+ aiUploadFile(options: {
42
+ selector?: string;
43
+ fileUrl?: string;
44
+ intention: string;
45
+ data?: string | Record<string, unknown>;
46
+ timeout?: number;
47
+ }): Promise<string>;
48
+ /**
49
+ * Extract information from the page using AI via API call.
50
+ */
51
+ aiExtract(options: {
52
+ prompt: string;
53
+ extractSchema?: Record<string, unknown> | unknown[] | string;
54
+ errorCodeMapping?: Record<string, string>;
55
+ intention?: string;
56
+ data?: string | Record<string, unknown>;
57
+ }): Promise<Record<string, unknown> | unknown[] | string | null>;
58
+ /**
59
+ * Validate the current page state using AI via API call.
60
+ */
61
+ aiValidate(options: {
62
+ prompt: string;
63
+ model?: Record<string, unknown>;
64
+ }): Promise<boolean>;
65
+ /**
66
+ * Perform an action on the page using AI via API call.
67
+ */
68
+ aiAct(prompt: string): Promise<void>;
69
+ /**
70
+ * Locate an element on the page using AI and return its XPath selector via API call.
71
+ *
72
+ * @param prompt - Natural language description of the element to locate (e.g., 'find "download invoices" button')
73
+ *
74
+ * @returns XPath selector string (e.g., 'xpath=//button[@id="download"]') or null if not found
75
+ */
76
+ aiLocateElement(prompt: string): Promise<string | null>;
77
+ /**
78
+ * Send a prompt to the LLM and get a response based on the provided schema via API call.
79
+ */
80
+ aiPrompt(options: {
81
+ prompt: string;
82
+ schema?: Record<string, unknown>;
83
+ model?: Record<string, unknown>;
84
+ }): Promise<Record<string, unknown> | unknown[] | string | null>;
85
+ }
@@ -0,0 +1,244 @@
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
+ import { LOG } from "./logger.mjs";
11
+ export class SkyvernBrowserPageAi {
12
+ constructor(browser, page) {
13
+ this._browser = browser;
14
+ this._page = page;
15
+ }
16
+ /**
17
+ * Click an element using AI via API call.
18
+ */
19
+ aiClick(options) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ LOG.info("AI click", { intention: options.intention, workflow_run_id: this._browser.workflowRunId });
22
+ const response = yield this._browser.skyvern.runSdkAction({
23
+ url: this._page.url(),
24
+ browser_session_id: this._browser.browserSessionId,
25
+ browser_address: this._browser.browserAddress,
26
+ workflow_run_id: this._browser.workflowRunId,
27
+ action: {
28
+ type: "ai_click",
29
+ selector: options.selector,
30
+ intention: options.intention,
31
+ data: options.data,
32
+ timeout: options.timeout,
33
+ },
34
+ });
35
+ if (response.workflow_run_id) {
36
+ this._browser.workflowRunId = response.workflow_run_id;
37
+ }
38
+ return response.result ? String(response.result) : options.selector || null;
39
+ });
40
+ }
41
+ /**
42
+ * Input text into an element using AI via API call.
43
+ */
44
+ aiInputText(options) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ LOG.info("AI input text", { intention: options.intention, workflow_run_id: this._browser.workflowRunId });
47
+ const response = yield this._browser.skyvern.runSdkAction({
48
+ url: this._page.url(),
49
+ browser_session_id: this._browser.browserSessionId,
50
+ browser_address: this._browser.browserAddress,
51
+ workflow_run_id: this._browser.workflowRunId,
52
+ action: {
53
+ type: "ai_input_text",
54
+ selector: options.selector,
55
+ value: options.value,
56
+ intention: options.intention,
57
+ data: options.data,
58
+ totp_identifier: options.totpIdentifier,
59
+ totp_url: options.totpUrl,
60
+ timeout: options.timeout,
61
+ },
62
+ });
63
+ if (response.workflow_run_id) {
64
+ this._browser.workflowRunId = response.workflow_run_id;
65
+ }
66
+ return response.result ? String(response.result) : options.value || "";
67
+ });
68
+ }
69
+ /**
70
+ * Select an option from a dropdown using AI via API call.
71
+ */
72
+ aiSelectOption(options) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ LOG.info("AI select option", { intention: options.intention, workflow_run_id: this._browser.workflowRunId });
75
+ const response = yield this._browser.skyvern.runSdkAction({
76
+ url: this._page.url(),
77
+ browser_session_id: this._browser.browserSessionId,
78
+ browser_address: this._browser.browserAddress,
79
+ workflow_run_id: this._browser.workflowRunId,
80
+ action: {
81
+ type: "ai_select_option",
82
+ selector: options.selector,
83
+ value: options.value,
84
+ intention: options.intention,
85
+ data: options.data,
86
+ timeout: options.timeout,
87
+ },
88
+ });
89
+ if (response.workflow_run_id) {
90
+ this._browser.workflowRunId = response.workflow_run_id;
91
+ }
92
+ return response.result ? String(response.result) : options.value || "";
93
+ });
94
+ }
95
+ /**
96
+ * Upload a file using AI via API call.
97
+ */
98
+ aiUploadFile(options) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ LOG.info("AI upload file", { intention: options.intention, workflow_run_id: this._browser.workflowRunId });
101
+ const response = yield this._browser.skyvern.runSdkAction({
102
+ url: this._page.url(),
103
+ browser_session_id: this._browser.browserSessionId,
104
+ browser_address: this._browser.browserAddress,
105
+ workflow_run_id: this._browser.workflowRunId,
106
+ action: {
107
+ type: "ai_upload_file",
108
+ selector: options.selector,
109
+ file_url: options.fileUrl,
110
+ intention: options.intention,
111
+ data: options.data,
112
+ timeout: options.timeout,
113
+ },
114
+ });
115
+ if (response.workflow_run_id) {
116
+ this._browser.workflowRunId = response.workflow_run_id;
117
+ }
118
+ return response.result ? String(response.result) : options.fileUrl || "";
119
+ });
120
+ }
121
+ /**
122
+ * Extract information from the page using AI via API call.
123
+ */
124
+ aiExtract(options) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ LOG.info("AI extract", { prompt: options.prompt, workflow_run_id: this._browser.workflowRunId });
127
+ const response = yield this._browser.skyvern.runSdkAction({
128
+ url: this._page.url(),
129
+ browser_session_id: this._browser.browserSessionId,
130
+ browser_address: this._browser.browserAddress,
131
+ workflow_run_id: this._browser.workflowRunId,
132
+ action: {
133
+ type: "extract",
134
+ prompt: options.prompt,
135
+ extract_schema: options.extractSchema,
136
+ error_code_mapping: options.errorCodeMapping,
137
+ intention: options.intention,
138
+ data: options.data,
139
+ },
140
+ });
141
+ if (response.workflow_run_id) {
142
+ this._browser.workflowRunId = response.workflow_run_id;
143
+ }
144
+ return response.result || null;
145
+ });
146
+ }
147
+ /**
148
+ * Validate the current page state using AI via API call.
149
+ */
150
+ aiValidate(options) {
151
+ return __awaiter(this, void 0, void 0, function* () {
152
+ LOG.info("AI validate", { prompt: options.prompt, model: options.model, workflow_run_id: this._browser.workflowRunId });
153
+ const response = yield this._browser.skyvern.runSdkAction({
154
+ url: this._page.url(),
155
+ browser_session_id: this._browser.browserSessionId,
156
+ browser_address: this._browser.browserAddress,
157
+ workflow_run_id: this._browser.workflowRunId,
158
+ action: {
159
+ type: "validate",
160
+ prompt: options.prompt,
161
+ model: options.model,
162
+ },
163
+ });
164
+ if (response.workflow_run_id) {
165
+ this._browser.workflowRunId = response.workflow_run_id;
166
+ }
167
+ return response.result != null ? Boolean(response.result) : false;
168
+ });
169
+ }
170
+ /**
171
+ * Perform an action on the page using AI via API call.
172
+ */
173
+ aiAct(prompt) {
174
+ return __awaiter(this, void 0, void 0, function* () {
175
+ LOG.info("AI act", { prompt, workflow_run_id: this._browser.workflowRunId });
176
+ const response = yield this._browser.skyvern.runSdkAction({
177
+ url: this._page.url(),
178
+ browser_session_id: this._browser.browserSessionId,
179
+ browser_address: this._browser.browserAddress,
180
+ workflow_run_id: this._browser.workflowRunId,
181
+ action: {
182
+ type: "ai_act",
183
+ intention: prompt,
184
+ },
185
+ });
186
+ if (response.workflow_run_id) {
187
+ this._browser.workflowRunId = response.workflow_run_id;
188
+ }
189
+ });
190
+ }
191
+ /**
192
+ * Locate an element on the page using AI and return its XPath selector via API call.
193
+ *
194
+ * @param prompt - Natural language description of the element to locate (e.g., 'find "download invoices" button')
195
+ *
196
+ * @returns XPath selector string (e.g., 'xpath=//button[@id="download"]') or null if not found
197
+ */
198
+ aiLocateElement(prompt) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ LOG.info("AI locate element", { prompt, workflow_run_id: this._browser.workflowRunId });
201
+ const response = yield this._browser.skyvern.runSdkAction({
202
+ url: this._page.url(),
203
+ browser_session_id: this._browser.browserSessionId,
204
+ browser_address: this._browser.browserAddress,
205
+ workflow_run_id: this._browser.workflowRunId,
206
+ action: {
207
+ type: "locate_element",
208
+ prompt,
209
+ },
210
+ });
211
+ if (response.workflow_run_id) {
212
+ this._browser.workflowRunId = response.workflow_run_id;
213
+ }
214
+ if (response.result && typeof response.result === "string") {
215
+ return response.result;
216
+ }
217
+ return null;
218
+ });
219
+ }
220
+ /**
221
+ * Send a prompt to the LLM and get a response based on the provided schema via API call.
222
+ */
223
+ aiPrompt(options) {
224
+ return __awaiter(this, void 0, void 0, function* () {
225
+ LOG.info("AI prompt", { prompt: options.prompt, model: options.model, workflow_run_id: this._browser.workflowRunId });
226
+ const response = yield this._browser.skyvern.runSdkAction({
227
+ url: this._page.url(),
228
+ browser_session_id: this._browser.browserSessionId,
229
+ browser_address: this._browser.browserAddress,
230
+ workflow_run_id: this._browser.workflowRunId,
231
+ action: {
232
+ type: "prompt",
233
+ prompt: options.prompt,
234
+ schema: options.schema,
235
+ model: options.model,
236
+ },
237
+ });
238
+ if (response.workflow_run_id) {
239
+ this._browser.workflowRunId = response.workflow_run_id;
240
+ }
241
+ return response.result || null;
242
+ });
243
+ }
244
+ }
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_AGENT_TIMEOUT = 1800;
2
+ export declare const DEFAULT_AGENT_HEARTBEAT_INTERVAL = 10;
3
+ export declare const DEFAULT_CDP_PORT = 9222;
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_AGENT_TIMEOUT = 1800; // 30 minutes in seconds
2
+ export const DEFAULT_AGENT_HEARTBEAT_INTERVAL = 10; // 10 seconds
3
+ export const DEFAULT_CDP_PORT = 9222;
@@ -0,0 +1,10 @@
1
+ export { Skyvern } from "./Skyvern.mjs";
2
+ export type { SkyvernOptions, RunTaskOptions, RunWorkflowOptions, LoginOptions, DownloadFilesOptions } from "./Skyvern.mjs";
3
+ export { SkyvernBrowser } from "./SkyvernBrowser.mjs";
4
+ export { SkyvernBrowserPageCore as SkyvernBrowserPageIml } from "./SkyvernBrowserPage.mjs";
5
+ export type { SkyvernBrowserPage } from "./SkyvernBrowserPage.mjs";
6
+ export { SkyvernBrowserPageAgent } from "./SkyvernBrowserPageAgent.mjs";
7
+ export { SkyvernBrowserPageAi } from "./SkyvernBrowserPageAi.mjs";
8
+ export { DEFAULT_AGENT_TIMEOUT, DEFAULT_AGENT_HEARTBEAT_INTERVAL, DEFAULT_CDP_PORT } from "./constants.mjs";
9
+ export type { Logger } from "./logger.mjs";
10
+ export { setLogger, LOG } from "./logger.mjs";
@@ -0,0 +1,7 @@
1
+ export { Skyvern } from "./Skyvern.mjs";
2
+ export { SkyvernBrowser } from "./SkyvernBrowser.mjs";
3
+ export { SkyvernBrowserPageCore as SkyvernBrowserPageIml } from "./SkyvernBrowserPage.mjs";
4
+ export { SkyvernBrowserPageAgent } from "./SkyvernBrowserPageAgent.mjs";
5
+ export { SkyvernBrowserPageAi } from "./SkyvernBrowserPageAi.mjs";
6
+ export { DEFAULT_AGENT_TIMEOUT, DEFAULT_AGENT_HEARTBEAT_INTERVAL, DEFAULT_CDP_PORT } from "./constants.mjs";
7
+ export { setLogger, LOG } from "./logger.mjs";
@@ -0,0 +1,15 @@
1
+ export interface Logger {
2
+ debug(message: string, context?: Record<string, unknown>): void;
3
+ info(message: string, context?: Record<string, unknown>): void;
4
+ warn(message: string, context?: Record<string, unknown>): void;
5
+ error(message: string, context?: Record<string, unknown>): void;
6
+ }
7
+ export declare function setLogger(logger: Logger): void;
8
+ declare class StructuredLogger {
9
+ debug(message: string, context?: Record<string, unknown>): void;
10
+ info(message: string, context?: Record<string, unknown>): void;
11
+ warn(message: string, context?: Record<string, unknown>): void;
12
+ error(message: string, context?: Record<string, unknown>): void;
13
+ }
14
+ export declare const LOG: StructuredLogger;
15
+ export {};