@morphllm/morphsdk 0.2.198 → 0.2.199

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 (243) hide show
  1. package/README.md +1 -147
  2. package/dist/{chunk-CAFREMIT.js → chunk-5KQ2WRBU.js} +2 -2
  3. package/dist/{chunk-FUYX2MNM.js → chunk-7UU4NF4G.js} +4 -10
  4. package/dist/chunk-7UU4NF4G.js.map +1 -0
  5. package/dist/{chunk-XTFRHVCW.js → chunk-BLCCGRKT.js} +2 -2
  6. package/dist/{chunk-6XFL2NER.js → chunk-BTMMUG3E.js} +2 -2
  7. package/dist/{chunk-4JUIEYAH.js → chunk-CEXBKXWU.js} +3 -3
  8. package/dist/{chunk-FESO6TDQ.js → chunk-DP2PT36G.js} +2 -2
  9. package/dist/chunk-GKRPR5PZ.js +322 -0
  10. package/dist/chunk-GKRPR5PZ.js.map +1 -0
  11. package/dist/{chunk-ZQNTXHBQ.js → chunk-GTV27THY.js} +2 -2
  12. package/dist/{chunk-ZU5YYGBJ.js → chunk-JOC3ZI56.js} +3 -29
  13. package/dist/chunk-JOC3ZI56.js.map +1 -0
  14. package/dist/{chunk-WLMPQFER.js → chunk-K2JR2NFQ.js} +4 -4
  15. package/dist/{chunk-YQ2G5YLI.js → chunk-KXEPBLVD.js} +10 -10
  16. package/dist/{chunk-T6TXYTKH.js → chunk-MEZTHMB2.js} +4 -4
  17. package/dist/{chunk-ZGERT23F.js → chunk-O7LJEVZO.js} +2 -2
  18. package/dist/{chunk-LN7GNFET.js → chunk-OPNTDMHH.js} +4 -4
  19. package/dist/{chunk-QKNGVBE2.js → chunk-PKJ7ODTG.js} +3 -3
  20. package/dist/{chunk-4DNEBVGV.js → chunk-PW6K6OJL.js} +2 -2
  21. package/dist/{chunk-PV6EF6NG.js → chunk-Q3NH3NPD.js} +2 -2
  22. package/dist/{chunk-O5264GI4.js → chunk-RL3ZTXT3.js} +4 -4
  23. package/dist/{chunk-D2RFP6R2.js → chunk-ULHHMZRL.js} +3 -3
  24. package/dist/{chunk-PEFXG5M6.js → chunk-UT3NQLCF.js} +2 -2
  25. package/dist/{chunk-VBZ7BG47.js → chunk-VS5F2ORN.js} +3 -3
  26. package/dist/{chunk-YUH3MTP3.js → chunk-W37OFBSG.js} +2 -2
  27. package/dist/{chunk-SKN2L5CE.js → chunk-WDBYAXZ5.js} +2 -2
  28. package/dist/{chunk-XK3PQZW6.js → chunk-YSFEKIYQ.js} +2 -2
  29. package/dist/{chunk-3XS5P5XH.js → chunk-ZHB57ORD.js} +6 -6
  30. package/dist/client-CGW0Cevz.d.ts +402 -0
  31. package/dist/client.cjs +12 -1644
  32. package/dist/client.cjs.map +1 -1
  33. package/dist/client.d.ts +3 -7
  34. package/dist/client.js +27 -32
  35. package/dist/core/client.cjs +2 -34
  36. package/dist/core/client.cjs.map +1 -1
  37. package/dist/core/client.d.ts +0 -8
  38. package/dist/core/client.js +4 -4
  39. package/dist/core/error.cjs +2 -28
  40. package/dist/core/error.cjs.map +1 -1
  41. package/dist/core/error.js +3 -3
  42. package/dist/core/index.cjs +2 -34
  43. package/dist/core/index.cjs.map +1 -1
  44. package/dist/core/index.js +4 -4
  45. package/dist/edge.cjs +2 -34
  46. package/dist/edge.cjs.map +1 -1
  47. package/dist/edge.js +7 -7
  48. package/dist/index.cjs +12 -1656
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.ts +1 -5
  51. package/dist/index.js +31 -49
  52. package/dist/modelrouter/core.cjs +2 -34
  53. package/dist/modelrouter/core.cjs.map +1 -1
  54. package/dist/modelrouter/core.js +5 -5
  55. package/dist/modelrouter/index.cjs +2 -34
  56. package/dist/modelrouter/index.cjs.map +1 -1
  57. package/dist/modelrouter/index.js +5 -5
  58. package/dist/subagents/anthropic.cjs +2 -34
  59. package/dist/subagents/anthropic.cjs.map +1 -1
  60. package/dist/subagents/anthropic.js +11 -11
  61. package/dist/subagents/vercel.cjs +2 -34
  62. package/dist/subagents/vercel.cjs.map +1 -1
  63. package/dist/subagents/vercel.js +11 -11
  64. package/dist/tools/codebase_search/anthropic.cjs +2 -34
  65. package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
  66. package/dist/tools/codebase_search/anthropic.js +6 -6
  67. package/dist/tools/codebase_search/core.cjs +2 -34
  68. package/dist/tools/codebase_search/core.cjs.map +1 -1
  69. package/dist/tools/codebase_search/core.js +5 -5
  70. package/dist/tools/codebase_search/index.cjs +2 -34
  71. package/dist/tools/codebase_search/index.cjs.map +1 -1
  72. package/dist/tools/codebase_search/index.js +10 -10
  73. package/dist/tools/codebase_search/openai.cjs +2 -34
  74. package/dist/tools/codebase_search/openai.cjs.map +1 -1
  75. package/dist/tools/codebase_search/openai.js +6 -6
  76. package/dist/tools/codebase_search/vercel.cjs +2 -34
  77. package/dist/tools/codebase_search/vercel.cjs.map +1 -1
  78. package/dist/tools/codebase_search/vercel.js +6 -6
  79. package/dist/tools/compact/core.cjs +2 -34
  80. package/dist/tools/compact/core.cjs.map +1 -1
  81. package/dist/tools/compact/core.js +5 -5
  82. package/dist/tools/compact/index.cjs +2 -34
  83. package/dist/tools/compact/index.cjs.map +1 -1
  84. package/dist/tools/compact/index.js +6 -6
  85. package/dist/tools/fastapply/anthropic.cjs +2 -28
  86. package/dist/tools/fastapply/anthropic.cjs.map +1 -1
  87. package/dist/tools/fastapply/anthropic.js +7 -7
  88. package/dist/tools/fastapply/apply.cjs +2 -28
  89. package/dist/tools/fastapply/apply.cjs.map +1 -1
  90. package/dist/tools/fastapply/apply.js +2 -2
  91. package/dist/tools/fastapply/core.cjs +2 -34
  92. package/dist/tools/fastapply/core.cjs.map +1 -1
  93. package/dist/tools/fastapply/core.js +6 -6
  94. package/dist/tools/fastapply/index.cjs +2 -28
  95. package/dist/tools/fastapply/index.cjs.map +1 -1
  96. package/dist/tools/fastapply/index.js +11 -11
  97. package/dist/tools/fastapply/openai.cjs +2 -28
  98. package/dist/tools/fastapply/openai.cjs.map +1 -1
  99. package/dist/tools/fastapply/openai.js +7 -7
  100. package/dist/tools/fastapply/vercel.cjs +2 -28
  101. package/dist/tools/fastapply/vercel.cjs.map +1 -1
  102. package/dist/tools/fastapply/vercel.js +7 -7
  103. package/dist/tools/index.cjs +2 -28
  104. package/dist/tools/index.cjs.map +1 -1
  105. package/dist/tools/index.js +11 -11
  106. package/dist/tools/utils/resilience.cjs +2 -28
  107. package/dist/tools/utils/resilience.cjs.map +1 -1
  108. package/dist/tools/utils/resilience.js +2 -2
  109. package/dist/tools/warp_grep/agent/runner.cjs +2 -28
  110. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  111. package/dist/tools/warp_grep/agent/runner.js +3 -3
  112. package/dist/tools/warp_grep/anthropic.cjs +2 -34
  113. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  114. package/dist/tools/warp_grep/anthropic.js +11 -11
  115. package/dist/tools/warp_grep/client.cjs +2 -34
  116. package/dist/tools/warp_grep/client.cjs.map +1 -1
  117. package/dist/tools/warp_grep/client.js +10 -10
  118. package/dist/tools/warp_grep/gemini.cjs +2 -34
  119. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  120. package/dist/tools/warp_grep/gemini.js +10 -10
  121. package/dist/tools/warp_grep/harness.js +9 -9
  122. package/dist/tools/warp_grep/index.cjs +2 -34
  123. package/dist/tools/warp_grep/index.cjs.map +1 -1
  124. package/dist/tools/warp_grep/index.js +16 -16
  125. package/dist/tools/warp_grep/openai.cjs +2 -34
  126. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  127. package/dist/tools/warp_grep/openai.js +11 -11
  128. package/dist/tools/warp_grep/providers/local.js +2 -2
  129. package/dist/tools/warp_grep/vercel.cjs +2 -34
  130. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  131. package/dist/tools/warp_grep/vercel.js +11 -11
  132. package/dist/version.cjs +2 -28
  133. package/dist/version.cjs.map +1 -1
  134. package/dist/version.js +1 -1
  135. package/package.json +2 -28
  136. package/dist/anthropic-B6my2oBx.d.ts +0 -56
  137. package/dist/chunk-2AMEQAO2.js +0 -46
  138. package/dist/chunk-2AMEQAO2.js.map +0 -1
  139. package/dist/chunk-2HMEZZKK.js +0 -44
  140. package/dist/chunk-2HMEZZKK.js.map +0 -1
  141. package/dist/chunk-2VERUKO2.js +0 -177
  142. package/dist/chunk-2VERUKO2.js.map +0 -1
  143. package/dist/chunk-FUYX2MNM.js.map +0 -1
  144. package/dist/chunk-GJ42MYUU.js +0 -57
  145. package/dist/chunk-GJ42MYUU.js.map +0 -1
  146. package/dist/chunk-KQKLQHJF.js +0 -96
  147. package/dist/chunk-KQKLQHJF.js.map +0 -1
  148. package/dist/chunk-PIIXU2H3.js +0 -389
  149. package/dist/chunk-PIIXU2H3.js.map +0 -1
  150. package/dist/chunk-XH6KJJDI.js +0 -80
  151. package/dist/chunk-XH6KJJDI.js.map +0 -1
  152. package/dist/chunk-YD6TNDR4.js +0 -622
  153. package/dist/chunk-YD6TNDR4.js.map +0 -1
  154. package/dist/chunk-YHZJYCOU.js +0 -680
  155. package/dist/chunk-YHZJYCOU.js.map +0 -1
  156. package/dist/chunk-YTYCHRQ2.js +0 -106
  157. package/dist/chunk-YTYCHRQ2.js.map +0 -1
  158. package/dist/chunk-ZU5YYGBJ.js.map +0 -1
  159. package/dist/client-DCeydotn.d.ts +0 -1015
  160. package/dist/openai-BQMeDFef.d.ts +0 -81
  161. package/dist/tools/browser/anthropic.cjs +0 -645
  162. package/dist/tools/browser/anthropic.cjs.map +0 -1
  163. package/dist/tools/browser/anthropic.d.ts +0 -4
  164. package/dist/tools/browser/anthropic.js +0 -22
  165. package/dist/tools/browser/anthropic.js.map +0 -1
  166. package/dist/tools/browser/core.cjs +0 -1821
  167. package/dist/tools/browser/core.cjs.map +0 -1
  168. package/dist/tools/browser/core.d.ts +0 -245
  169. package/dist/tools/browser/core.js +0 -32
  170. package/dist/tools/browser/core.js.map +0 -1
  171. package/dist/tools/browser/errors.cjs +0 -208
  172. package/dist/tools/browser/errors.cjs.map +0 -1
  173. package/dist/tools/browser/errors.d.ts +0 -158
  174. package/dist/tools/browser/errors.js +0 -22
  175. package/dist/tools/browser/errors.js.map +0 -1
  176. package/dist/tools/browser/index.cjs +0 -2159
  177. package/dist/tools/browser/index.cjs.map +0 -1
  178. package/dist/tools/browser/index.d.ts +0 -134
  179. package/dist/tools/browser/index.js +0 -163
  180. package/dist/tools/browser/index.js.map +0 -1
  181. package/dist/tools/browser/live.cjs +0 -134
  182. package/dist/tools/browser/live.cjs.map +0 -1
  183. package/dist/tools/browser/live.d.ts +0 -75
  184. package/dist/tools/browser/live.js +0 -16
  185. package/dist/tools/browser/live.js.map +0 -1
  186. package/dist/tools/browser/openai.cjs +0 -661
  187. package/dist/tools/browser/openai.cjs.map +0 -1
  188. package/dist/tools/browser/openai.d.ts +0 -4
  189. package/dist/tools/browser/openai.js +0 -28
  190. package/dist/tools/browser/openai.js.map +0 -1
  191. package/dist/tools/browser/profiles/core.cjs +0 -932
  192. package/dist/tools/browser/profiles/core.cjs.map +0 -1
  193. package/dist/tools/browser/profiles/core.d.ts +0 -187
  194. package/dist/tools/browser/profiles/core.js +0 -30
  195. package/dist/tools/browser/profiles/core.js.map +0 -1
  196. package/dist/tools/browser/profiles/index.cjs +0 -932
  197. package/dist/tools/browser/profiles/index.cjs.map +0 -1
  198. package/dist/tools/browser/profiles/index.d.ts +0 -4
  199. package/dist/tools/browser/profiles/index.js +0 -30
  200. package/dist/tools/browser/profiles/index.js.map +0 -1
  201. package/dist/tools/browser/profiles/types.cjs +0 -74
  202. package/dist/tools/browser/profiles/types.cjs.map +0 -1
  203. package/dist/tools/browser/profiles/types.d.ts +0 -195
  204. package/dist/tools/browser/profiles/types.js +0 -16
  205. package/dist/tools/browser/profiles/types.js.map +0 -1
  206. package/dist/tools/browser/prompts.cjs +0 -69
  207. package/dist/tools/browser/prompts.cjs.map +0 -1
  208. package/dist/tools/browser/prompts.d.ts +0 -7
  209. package/dist/tools/browser/prompts.js +0 -10
  210. package/dist/tools/browser/prompts.js.map +0 -1
  211. package/dist/tools/browser/types.cjs +0 -19
  212. package/dist/tools/browser/types.cjs.map +0 -1
  213. package/dist/tools/browser/types.d.ts +0 -338
  214. package/dist/tools/browser/types.js +0 -1
  215. package/dist/tools/browser/types.js.map +0 -1
  216. package/dist/tools/browser/vercel.cjs +0 -622
  217. package/dist/tools/browser/vercel.cjs.map +0 -1
  218. package/dist/tools/browser/vercel.d.ts +0 -4
  219. package/dist/tools/browser/vercel.js +0 -22
  220. package/dist/tools/browser/vercel.js.map +0 -1
  221. package/dist/vercel-CVF27qFK.d.ts +0 -74
  222. /package/dist/{chunk-CAFREMIT.js.map → chunk-5KQ2WRBU.js.map} +0 -0
  223. /package/dist/{chunk-XTFRHVCW.js.map → chunk-BLCCGRKT.js.map} +0 -0
  224. /package/dist/{chunk-6XFL2NER.js.map → chunk-BTMMUG3E.js.map} +0 -0
  225. /package/dist/{chunk-4JUIEYAH.js.map → chunk-CEXBKXWU.js.map} +0 -0
  226. /package/dist/{chunk-FESO6TDQ.js.map → chunk-DP2PT36G.js.map} +0 -0
  227. /package/dist/{chunk-ZQNTXHBQ.js.map → chunk-GTV27THY.js.map} +0 -0
  228. /package/dist/{chunk-WLMPQFER.js.map → chunk-K2JR2NFQ.js.map} +0 -0
  229. /package/dist/{chunk-YQ2G5YLI.js.map → chunk-KXEPBLVD.js.map} +0 -0
  230. /package/dist/{chunk-T6TXYTKH.js.map → chunk-MEZTHMB2.js.map} +0 -0
  231. /package/dist/{chunk-ZGERT23F.js.map → chunk-O7LJEVZO.js.map} +0 -0
  232. /package/dist/{chunk-LN7GNFET.js.map → chunk-OPNTDMHH.js.map} +0 -0
  233. /package/dist/{chunk-QKNGVBE2.js.map → chunk-PKJ7ODTG.js.map} +0 -0
  234. /package/dist/{chunk-4DNEBVGV.js.map → chunk-PW6K6OJL.js.map} +0 -0
  235. /package/dist/{chunk-PV6EF6NG.js.map → chunk-Q3NH3NPD.js.map} +0 -0
  236. /package/dist/{chunk-O5264GI4.js.map → chunk-RL3ZTXT3.js.map} +0 -0
  237. /package/dist/{chunk-D2RFP6R2.js.map → chunk-ULHHMZRL.js.map} +0 -0
  238. /package/dist/{chunk-PEFXG5M6.js.map → chunk-UT3NQLCF.js.map} +0 -0
  239. /package/dist/{chunk-VBZ7BG47.js.map → chunk-VS5F2ORN.js.map} +0 -0
  240. /package/dist/{chunk-YUH3MTP3.js.map → chunk-W37OFBSG.js.map} +0 -0
  241. /package/dist/{chunk-SKN2L5CE.js.map → chunk-WDBYAXZ5.js.map} +0 -0
  242. /package/dist/{chunk-XK3PQZW6.js.map → chunk-YSFEKIYQ.js.map} +0 -0
  243. /package/dist/{chunk-3XS5P5XH.js.map → chunk-ZHB57ORD.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../tools/browser/types.ts"],"sourcesContent":["/**\n * Type definitions for browser automation tool\n */\n\nimport type { RetryConfig } from '../utils/resilience.js';\n\n/**\n * Available browser automation models\n */\nexport type BrowserModel =\n | 'gemini-3-flash-preview'\n | 'morph-computer-use-v0'\n | 'morph-computer-use-v1';\n\n/**\n * Configuration for the browser worker service\n */\nexport interface BrowserConfig {\n /** Browser worker API URL (default: https://browser.morphllm.com) */\n apiUrl?: string;\n /** Morph API key for authentication (required in production) */\n apiKey?: string;\n /** Request timeout in milliseconds (default: 1000000) */\n timeout?: number;\n /** Retry configuration for API calls */\n retryConfig?: RetryConfig;\n /** Enable debug logging (default: false) */\n debug?: boolean;\n}\n\n/**\n * Authentication credentials for site login (follows browser-use sensitive_data pattern)\n */\nexport interface AuthCredentials {\n /** Username/email for login */\n username?: string;\n /** Password for login */\n password?: string;\n /** Cookies in any JSON format, passed through to browser-use */\n cookies?: any;\n}\n\n/**\n * Input parameters for browser automation task\n */\nexport interface BrowserTaskInput {\n /** Natural language description of what to do */\n task?: string;\n /**\n * Optional PR diff used to generate a deterministic test plan on the backend.\n * If provided, `task` is treated as optional human instructions / focus areas.\n */\n diff?: string;\n /** Starting URL (e.g., https://3000-xyz.e2b.dev) */\n url?: string;\n /** Maximum number of browser actions to take (1-50, default: 10) */\n maxSteps?: number;\n /** Model to use for task execution (default: morph-computer-use-v0) */\n model?: BrowserModel;\n /** Browserless region: 'sfo' (US West) or 'lon' (Europe) */\n region?: 'sfo' | 'lon';\n /** Enable stealth mode to avoid bot detection (default: true) */\n stealth?: boolean;\n /** Browser viewport width (default: 1280) */\n viewportWidth?: number;\n /** Browser viewport height (default: 720) */\n viewportHeight?: number;\n /** User-defined reference/tracking ID (e.g., \"PR-1234\", \"jira-PROJ-567\") */\n externalId?: string;\n /** Optional repository database ID (UUID) to associate with this session - for internal use */\n repoId?: string;\n /** Optional repository full name (e.g., \"owner/repo\") - for external SDK users */\n repoFullName?: string;\n /** Optional commit UUID to associate with this session */\n commitId?: string;\n /** Record session video to S3 (default: false) */\n recordVideo?: boolean;\n /** Video width (default: 1280) */\n videoWidth?: number;\n /** Video height (default: 720) */\n videoHeight?: number;\n /** Enable window resizing for responsive/mobile testing. Disables stealth mode. (default: false) */\n allowResizing?: boolean;\n /** Serialized structured output schema (internal use) */\n structuredOutput?: string;\n /** Site authentication - global credentials or per-domain dict (follows browser-use pattern) */\n auth?: AuthCredentials | Record<string, AuthCredentials>;\n /** Profile ID - restore cookies/localStorage from a saved browser profile */\n profileId?: string;\n /**\n * Query parameters to force-append to ALL navigation URLs.\n * Used for Vercel deployment protection bypass.\n * Example: { 'x-vercel-protection-bypass': 'secret123', 'x-vercel-set-bypass-cookie': 'true' }\n */\n forceQueryParams?: Record<string, string>;\n}\n\n/**\n * Input with Zod schema for structured output\n */\nexport interface BrowserTaskInputWithSchema<T> extends Omit<BrowserTaskInput, 'structuredOutput'> {\n /** Zod schema for structured output */\n schema: any;\n}\n\n/**\n * Result from executing a browser task\n */\nexport interface BrowserTaskResult {\n /** Whether the task completed successfully */\n success: boolean;\n /** Task result or findings */\n result?: string;\n /** Error message if task failed */\n error?: string;\n /** Number of browser actions taken */\n stepsTaken?: number;\n /** Total execution time in milliseconds */\n executionTimeMs?: number;\n \n // Rich agent history data\n /** All URLs visited during execution */\n urls?: (string | null)[];\n /** Names of all actions executed */\n actionNames?: string[];\n /** Per-step errors (null for steps without errors) */\n errors?: (string | null)[];\n /** All model actions with parameters */\n modelActions?: any[];\n /** Whether agent marked task as done */\n isDone?: boolean;\n /** Truncated action history with essential fields */\n actionHistory?: any[][];\n /** All action results */\n actionResults?: any[];\n /** Whether any errors occurred */\n hasErrors?: boolean;\n /** Total number of steps executed */\n numberOfSteps?: number;\n \n // Judge validation\n /** Judge validation result if available */\n judgement?: {\n reasoning?: string;\n verdict: boolean;\n failure_reason?: string;\n impossible_task?: boolean;\n reached_captcha?: boolean;\n };\n /** Whether judge validated the execution */\n isValidated?: boolean;\n \n /** UUID of saved replay record (if session replay enabled) */\n replayId?: string;\n /** Browserless replay URL (if session replay enabled) */\n replayUrl?: string;\n /** Recording ID (if recordVideo=true) */\n recordingId?: string;\n /** Recording status: PENDING, PROCESSING, COMPLETED, ERROR */\n recordingStatus?: string;\n /** Task ID for async task tracking */\n taskId?: string;\n /** Task status: pending, running, completed, failed */\n status?: string;\n /** Structured output (JSON string) */\n output?: string;\n /** Live session debug URL for real-time viewing (WebRTC streaming) */\n debugUrl?: string;\n}\n\n/**\n * Configuration for live session viewing\n */\nexport interface LiveSessionOptions {\n /** Enable or disable remote control (default: true for headful, varies for headless) */\n interactive?: boolean;\n /** UI theme: 'dark' or 'light' (headless only, default: 'dark') */\n theme?: 'dark' | 'light';\n /** Show or hide navigation controls (headless only, default: true) */\n showControls?: boolean;\n /** Focus view on specific page/tab ID (headless only) */\n pageId?: string;\n /** Display specific tab by index (headless only) */\n pageIndex?: string;\n}\n\n/**\n * Configuration for iframe generation\n */\nexport interface IframeOptions extends LiveSessionOptions {\n /** Iframe width (default: '100%') */\n width?: string | number;\n /** Iframe height (default: '600px') */\n height?: string | number;\n /** Additional inline styles */\n style?: string;\n /** CSS class name */\n className?: string;\n}\n\n/**\n * Task result with convenience methods for async execution\n */\nexport interface BrowserTaskWithPromise extends BrowserTaskResult {\n taskId: string;\n /** Live URL to watch task execution in real-time */\n liveUrl: string;\n /** Wait for task completion */\n complete: (pollConfig?: { interval?: number; timeout?: number }) => Promise<BrowserTaskResult>;\n /** Get live session URL with optional parameters (Steel.dev) - throws if debugUrl not available */\n getLiveUrl: (options?: LiveSessionOptions) => string;\n /** Get iframe HTML for embedding live session - throws if debugUrl not available */\n getLiveIframe: (optionsOrPreset?: string | IframeOptions) => string;\n /** Get complete embed code snippet - throws if debugUrl not available */\n getEmbedCode: () => string;\n}\n\n/**\n * Task result with schema validation\n */\nexport interface BrowserTaskWithPromiseAndSchema<T> extends BrowserTaskResult {\n taskId: string;\n /** Live URL to watch task execution in real-time */\n liveUrl: string;\n /** Parsed and validated output */\n parsed: T | null;\n /** Wait for task completion with schema validation */\n complete: (pollConfig?: { interval?: number; timeout?: number }) => Promise<BrowserTaskResult & { parsed: T | null }>;\n /** Get live session URL with optional parameters - throws if debugUrl not available */\n getLiveUrl: (options?: LiveSessionOptions) => string;\n /** Get iframe HTML for embedding live session - throws if debugUrl not available */\n getLiveIframe: (optionsOrPreset?: string | IframeOptions) => string;\n /** Get complete embed code snippet - throws if debugUrl not available */\n getEmbedCode: () => string;\n}\n\n/**\n * Recording status and metadata\n */\nexport interface RecordingStatus {\n /** Recording ID */\n id: string;\n /** Current status */\n status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'ERROR';\n /** Presigned S3 URL for rrweb replay JSON (interactive DOM replay) */\n replayUrl?: string;\n /** Presigned S3 URL for network logs (NDJSON format) */\n networkUrl?: string;\n /** Presigned S3 URL for console logs (NDJSON format) */\n consoleUrl?: string;\n /** Presigned S3 URL for native browser video (WebM or MP4 format, real-time recording) */\n videoUrl?: string;\n /** Final AI summary from the browser agent */\n result?: string;\n /** Total rrweb events captured */\n totalEvents?: number;\n /** Total bytes of all files */\n fileSize?: number;\n /** Duration in milliseconds */\n duration?: number;\n /** Error message if status=ERROR */\n error?: string;\n /** When recording was created */\n createdAt: string;\n}\n\n/**\n * Browser error with screenshot captured at error time\n */\nexport interface BrowserError {\n /** Error type: console error or network error */\n type: 'console' | 'network';\n /** Error message */\n message: string;\n /** URL where error occurred */\n url?: string;\n /** CDP timestamp in seconds since browser start */\n timestamp: number;\n /** Presigned S3 URL to screenshot JPEG (captured 500ms after error) */\n screenshotUrl?: string;\n /** When screenshot was captured (Unix timestamp) */\n capturedAt?: number;\n \n // Network-specific fields\n /** HTTP status code (for network errors) */\n status?: number;\n}\n\n/**\n * Response from getErrors()\n */\nexport interface ErrorsResponse {\n /** Recording ID */\n recordingId: string;\n /** Total number of errors */\n totalErrors: number;\n /** Errors with real-time screenshots */\n errors: BrowserError[];\n}\n\n/**\n * Options for WebP generation\n */\nexport interface WebpOptions {\n /** Maximum duration in seconds (1-120, default: 60) */\n maxDuration?: number;\n /** Frame rate (5-30, default: 15) */\n fps?: number;\n /** Output width in pixels (320-1920, default: 780) */\n width?: number;\n /** Quality (10-100, default: 65) */\n quality?: number;\n /** Enable auto-zoom that follows click/input actions (default: false) */\n autoZoom?: boolean;\n /** Maximum file size in MB (0.5-50). Uses iterative reduction to guarantee budget. */\n maxSizeMb?: number;\n}\n\n/**\n * Response from getWebp()\n */\nexport interface WebpResponse {\n /** Presigned S3 URL for the WebP file */\n webpUrl: string;\n /** Whether the WebP was served from cache */\n cached: boolean;\n /** Width of the WebP (may differ from requested if budget-constrained) */\n width: number;\n /** Frame rate of the WebP (may differ from requested if budget-constrained) */\n fps: number;\n /** Max duration used (may differ from requested if budget-constrained) */\n maxDuration: number;\n /** File size in bytes */\n fileSize?: number;\n /** Max size budget in MB (if specified) */\n maxSizeMb?: number;\n /** Whether the file fits within the budget */\n budgetMet?: boolean;\n /** Quality setting used (may differ from requested if budget-constrained) */\n qualityUsed?: number;\n /** Number of encoding attempts needed to meet budget */\n attempts?: number;\n}\n\n/**\n * Recording with convenience methods\n */\nexport interface RecordingWithMethods extends RecordingStatus {\n /** Get animated WebP preview */\n getWebp: (options?: WebpOptions) => Promise<WebpResponse>;\n /** Get errors with screenshots */\n getErrors: () => Promise<ErrorsResponse>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,338 +0,0 @@
1
- import { RetryConfig } from '../utils/resilience.js';
2
-
3
- /**
4
- * Type definitions for browser automation tool
5
- */
6
-
7
- /**
8
- * Available browser automation models
9
- */
10
- type BrowserModel = 'gemini-3-flash-preview' | 'morph-computer-use-v0' | 'morph-computer-use-v1';
11
- /**
12
- * Configuration for the browser worker service
13
- */
14
- interface BrowserConfig {
15
- /** Browser worker API URL (default: https://browser.morphllm.com) */
16
- apiUrl?: string;
17
- /** Morph API key for authentication (required in production) */
18
- apiKey?: string;
19
- /** Request timeout in milliseconds (default: 1000000) */
20
- timeout?: number;
21
- /** Retry configuration for API calls */
22
- retryConfig?: RetryConfig;
23
- /** Enable debug logging (default: false) */
24
- debug?: boolean;
25
- }
26
- /**
27
- * Authentication credentials for site login (follows browser-use sensitive_data pattern)
28
- */
29
- interface AuthCredentials {
30
- /** Username/email for login */
31
- username?: string;
32
- /** Password for login */
33
- password?: string;
34
- /** Cookies in any JSON format, passed through to browser-use */
35
- cookies?: any;
36
- }
37
- /**
38
- * Input parameters for browser automation task
39
- */
40
- interface BrowserTaskInput {
41
- /** Natural language description of what to do */
42
- task?: string;
43
- /**
44
- * Optional PR diff used to generate a deterministic test plan on the backend.
45
- * If provided, `task` is treated as optional human instructions / focus areas.
46
- */
47
- diff?: string;
48
- /** Starting URL (e.g., https://3000-xyz.e2b.dev) */
49
- url?: string;
50
- /** Maximum number of browser actions to take (1-50, default: 10) */
51
- maxSteps?: number;
52
- /** Model to use for task execution (default: morph-computer-use-v0) */
53
- model?: BrowserModel;
54
- /** Browserless region: 'sfo' (US West) or 'lon' (Europe) */
55
- region?: 'sfo' | 'lon';
56
- /** Enable stealth mode to avoid bot detection (default: true) */
57
- stealth?: boolean;
58
- /** Browser viewport width (default: 1280) */
59
- viewportWidth?: number;
60
- /** Browser viewport height (default: 720) */
61
- viewportHeight?: number;
62
- /** User-defined reference/tracking ID (e.g., "PR-1234", "jira-PROJ-567") */
63
- externalId?: string;
64
- /** Optional repository database ID (UUID) to associate with this session - for internal use */
65
- repoId?: string;
66
- /** Optional repository full name (e.g., "owner/repo") - for external SDK users */
67
- repoFullName?: string;
68
- /** Optional commit UUID to associate with this session */
69
- commitId?: string;
70
- /** Record session video to S3 (default: false) */
71
- recordVideo?: boolean;
72
- /** Video width (default: 1280) */
73
- videoWidth?: number;
74
- /** Video height (default: 720) */
75
- videoHeight?: number;
76
- /** Enable window resizing for responsive/mobile testing. Disables stealth mode. (default: false) */
77
- allowResizing?: boolean;
78
- /** Serialized structured output schema (internal use) */
79
- structuredOutput?: string;
80
- /** Site authentication - global credentials or per-domain dict (follows browser-use pattern) */
81
- auth?: AuthCredentials | Record<string, AuthCredentials>;
82
- /** Profile ID - restore cookies/localStorage from a saved browser profile */
83
- profileId?: string;
84
- /**
85
- * Query parameters to force-append to ALL navigation URLs.
86
- * Used for Vercel deployment protection bypass.
87
- * Example: { 'x-vercel-protection-bypass': 'secret123', 'x-vercel-set-bypass-cookie': 'true' }
88
- */
89
- forceQueryParams?: Record<string, string>;
90
- }
91
- /**
92
- * Input with Zod schema for structured output
93
- */
94
- interface BrowserTaskInputWithSchema<T> extends Omit<BrowserTaskInput, 'structuredOutput'> {
95
- /** Zod schema for structured output */
96
- schema: any;
97
- }
98
- /**
99
- * Result from executing a browser task
100
- */
101
- interface BrowserTaskResult {
102
- /** Whether the task completed successfully */
103
- success: boolean;
104
- /** Task result or findings */
105
- result?: string;
106
- /** Error message if task failed */
107
- error?: string;
108
- /** Number of browser actions taken */
109
- stepsTaken?: number;
110
- /** Total execution time in milliseconds */
111
- executionTimeMs?: number;
112
- /** All URLs visited during execution */
113
- urls?: (string | null)[];
114
- /** Names of all actions executed */
115
- actionNames?: string[];
116
- /** Per-step errors (null for steps without errors) */
117
- errors?: (string | null)[];
118
- /** All model actions with parameters */
119
- modelActions?: any[];
120
- /** Whether agent marked task as done */
121
- isDone?: boolean;
122
- /** Truncated action history with essential fields */
123
- actionHistory?: any[][];
124
- /** All action results */
125
- actionResults?: any[];
126
- /** Whether any errors occurred */
127
- hasErrors?: boolean;
128
- /** Total number of steps executed */
129
- numberOfSteps?: number;
130
- /** Judge validation result if available */
131
- judgement?: {
132
- reasoning?: string;
133
- verdict: boolean;
134
- failure_reason?: string;
135
- impossible_task?: boolean;
136
- reached_captcha?: boolean;
137
- };
138
- /** Whether judge validated the execution */
139
- isValidated?: boolean;
140
- /** UUID of saved replay record (if session replay enabled) */
141
- replayId?: string;
142
- /** Browserless replay URL (if session replay enabled) */
143
- replayUrl?: string;
144
- /** Recording ID (if recordVideo=true) */
145
- recordingId?: string;
146
- /** Recording status: PENDING, PROCESSING, COMPLETED, ERROR */
147
- recordingStatus?: string;
148
- /** Task ID for async task tracking */
149
- taskId?: string;
150
- /** Task status: pending, running, completed, failed */
151
- status?: string;
152
- /** Structured output (JSON string) */
153
- output?: string;
154
- /** Live session debug URL for real-time viewing (WebRTC streaming) */
155
- debugUrl?: string;
156
- }
157
- /**
158
- * Configuration for live session viewing
159
- */
160
- interface LiveSessionOptions {
161
- /** Enable or disable remote control (default: true for headful, varies for headless) */
162
- interactive?: boolean;
163
- /** UI theme: 'dark' or 'light' (headless only, default: 'dark') */
164
- theme?: 'dark' | 'light';
165
- /** Show or hide navigation controls (headless only, default: true) */
166
- showControls?: boolean;
167
- /** Focus view on specific page/tab ID (headless only) */
168
- pageId?: string;
169
- /** Display specific tab by index (headless only) */
170
- pageIndex?: string;
171
- }
172
- /**
173
- * Configuration for iframe generation
174
- */
175
- interface IframeOptions extends LiveSessionOptions {
176
- /** Iframe width (default: '100%') */
177
- width?: string | number;
178
- /** Iframe height (default: '600px') */
179
- height?: string | number;
180
- /** Additional inline styles */
181
- style?: string;
182
- /** CSS class name */
183
- className?: string;
184
- }
185
- /**
186
- * Task result with convenience methods for async execution
187
- */
188
- interface BrowserTaskWithPromise extends BrowserTaskResult {
189
- taskId: string;
190
- /** Live URL to watch task execution in real-time */
191
- liveUrl: string;
192
- /** Wait for task completion */
193
- complete: (pollConfig?: {
194
- interval?: number;
195
- timeout?: number;
196
- }) => Promise<BrowserTaskResult>;
197
- /** Get live session URL with optional parameters (Steel.dev) - throws if debugUrl not available */
198
- getLiveUrl: (options?: LiveSessionOptions) => string;
199
- /** Get iframe HTML for embedding live session - throws if debugUrl not available */
200
- getLiveIframe: (optionsOrPreset?: string | IframeOptions) => string;
201
- /** Get complete embed code snippet - throws if debugUrl not available */
202
- getEmbedCode: () => string;
203
- }
204
- /**
205
- * Task result with schema validation
206
- */
207
- interface BrowserTaskWithPromiseAndSchema<T> extends BrowserTaskResult {
208
- taskId: string;
209
- /** Live URL to watch task execution in real-time */
210
- liveUrl: string;
211
- /** Parsed and validated output */
212
- parsed: T | null;
213
- /** Wait for task completion with schema validation */
214
- complete: (pollConfig?: {
215
- interval?: number;
216
- timeout?: number;
217
- }) => Promise<BrowserTaskResult & {
218
- parsed: T | null;
219
- }>;
220
- /** Get live session URL with optional parameters - throws if debugUrl not available */
221
- getLiveUrl: (options?: LiveSessionOptions) => string;
222
- /** Get iframe HTML for embedding live session - throws if debugUrl not available */
223
- getLiveIframe: (optionsOrPreset?: string | IframeOptions) => string;
224
- /** Get complete embed code snippet - throws if debugUrl not available */
225
- getEmbedCode: () => string;
226
- }
227
- /**
228
- * Recording status and metadata
229
- */
230
- interface RecordingStatus {
231
- /** Recording ID */
232
- id: string;
233
- /** Current status */
234
- status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'ERROR';
235
- /** Presigned S3 URL for rrweb replay JSON (interactive DOM replay) */
236
- replayUrl?: string;
237
- /** Presigned S3 URL for network logs (NDJSON format) */
238
- networkUrl?: string;
239
- /** Presigned S3 URL for console logs (NDJSON format) */
240
- consoleUrl?: string;
241
- /** Presigned S3 URL for native browser video (WebM or MP4 format, real-time recording) */
242
- videoUrl?: string;
243
- /** Final AI summary from the browser agent */
244
- result?: string;
245
- /** Total rrweb events captured */
246
- totalEvents?: number;
247
- /** Total bytes of all files */
248
- fileSize?: number;
249
- /** Duration in milliseconds */
250
- duration?: number;
251
- /** Error message if status=ERROR */
252
- error?: string;
253
- /** When recording was created */
254
- createdAt: string;
255
- }
256
- /**
257
- * Browser error with screenshot captured at error time
258
- */
259
- interface BrowserError {
260
- /** Error type: console error or network error */
261
- type: 'console' | 'network';
262
- /** Error message */
263
- message: string;
264
- /** URL where error occurred */
265
- url?: string;
266
- /** CDP timestamp in seconds since browser start */
267
- timestamp: number;
268
- /** Presigned S3 URL to screenshot JPEG (captured 500ms after error) */
269
- screenshotUrl?: string;
270
- /** When screenshot was captured (Unix timestamp) */
271
- capturedAt?: number;
272
- /** HTTP status code (for network errors) */
273
- status?: number;
274
- }
275
- /**
276
- * Response from getErrors()
277
- */
278
- interface ErrorsResponse {
279
- /** Recording ID */
280
- recordingId: string;
281
- /** Total number of errors */
282
- totalErrors: number;
283
- /** Errors with real-time screenshots */
284
- errors: BrowserError[];
285
- }
286
- /**
287
- * Options for WebP generation
288
- */
289
- interface WebpOptions {
290
- /** Maximum duration in seconds (1-120, default: 60) */
291
- maxDuration?: number;
292
- /** Frame rate (5-30, default: 15) */
293
- fps?: number;
294
- /** Output width in pixels (320-1920, default: 780) */
295
- width?: number;
296
- /** Quality (10-100, default: 65) */
297
- quality?: number;
298
- /** Enable auto-zoom that follows click/input actions (default: false) */
299
- autoZoom?: boolean;
300
- /** Maximum file size in MB (0.5-50). Uses iterative reduction to guarantee budget. */
301
- maxSizeMb?: number;
302
- }
303
- /**
304
- * Response from getWebp()
305
- */
306
- interface WebpResponse {
307
- /** Presigned S3 URL for the WebP file */
308
- webpUrl: string;
309
- /** Whether the WebP was served from cache */
310
- cached: boolean;
311
- /** Width of the WebP (may differ from requested if budget-constrained) */
312
- width: number;
313
- /** Frame rate of the WebP (may differ from requested if budget-constrained) */
314
- fps: number;
315
- /** Max duration used (may differ from requested if budget-constrained) */
316
- maxDuration: number;
317
- /** File size in bytes */
318
- fileSize?: number;
319
- /** Max size budget in MB (if specified) */
320
- maxSizeMb?: number;
321
- /** Whether the file fits within the budget */
322
- budgetMet?: boolean;
323
- /** Quality setting used (may differ from requested if budget-constrained) */
324
- qualityUsed?: number;
325
- /** Number of encoding attempts needed to meet budget */
326
- attempts?: number;
327
- }
328
- /**
329
- * Recording with convenience methods
330
- */
331
- interface RecordingWithMethods extends RecordingStatus {
332
- /** Get animated WebP preview */
333
- getWebp: (options?: WebpOptions) => Promise<WebpResponse>;
334
- /** Get errors with screenshots */
335
- getErrors: () => Promise<ErrorsResponse>;
336
- }
337
-
338
- export type { AuthCredentials, BrowserConfig, BrowserError, BrowserModel, BrowserTaskInput, BrowserTaskInputWithSchema, BrowserTaskResult, BrowserTaskWithPromise, BrowserTaskWithPromiseAndSchema, ErrorsResponse, IframeOptions, LiveSessionOptions, RecordingStatus, RecordingWithMethods, WebpOptions, WebpResponse };
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}