@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
package/dist/index.cjs CHANGED
@@ -36,7 +36,7 @@ var init_package = __esm({
36
36
  "package.json"() {
37
37
  package_default = {
38
38
  name: "@morphllm/morphsdk",
39
- version: "0.2.198",
39
+ version: "0.2.199",
40
40
  description: "TypeScript SDK and CLI for Morph Fast Apply integration",
41
41
  type: "module",
42
42
  main: "./dist/index.cjs",
@@ -143,31 +143,6 @@ var init_package = __esm({
143
143
  import: "./dist/tools/codebase_search/vercel.js",
144
144
  require: "./dist/tools/codebase_search/vercel.cjs"
145
145
  },
146
- "./tools/browser": {
147
- types: "./dist/tools/browser/index.d.ts",
148
- import: "./dist/tools/browser/index.js",
149
- require: "./dist/tools/browser/index.cjs"
150
- },
151
- "./tools/browser/anthropic": {
152
- types: "./dist/tools/browser/anthropic.d.ts",
153
- import: "./dist/tools/browser/anthropic.js",
154
- require: "./dist/tools/browser/anthropic.cjs"
155
- },
156
- "./tools/browser/openai": {
157
- types: "./dist/tools/browser/openai.d.ts",
158
- import: "./dist/tools/browser/openai.js",
159
- require: "./dist/tools/browser/openai.cjs"
160
- },
161
- "./tools/browser/vercel": {
162
- types: "./dist/tools/browser/vercel.d.ts",
163
- import: "./dist/tools/browser/vercel.js",
164
- require: "./dist/tools/browser/vercel.cjs"
165
- },
166
- "./tools/browser/profiles": {
167
- types: "./dist/tools/browser/profiles/index.d.ts",
168
- import: "./dist/tools/browser/profiles/index.js",
169
- require: "./dist/tools/browser/profiles/index.cjs"
170
- },
171
146
  "./modelrouter": {
172
147
  types: "./dist/modelrouter/index.d.ts",
173
148
  import: "./dist/modelrouter/index.js",
@@ -208,7 +183,7 @@ var init_package = __esm({
208
183
  "!dist/**/*.test.*"
209
184
  ],
210
185
  scripts: {
211
- build: "tsup version.ts index.ts edge.ts client.ts core/index.ts core/client.ts core/resource.ts core/error.ts tools/index.ts tools/fastapply/index.ts tools/fastapply/core.ts tools/fastapply/apply.ts tools/fastapply/types.ts tools/fastapply/prompts.ts tools/fastapply/anthropic.ts tools/fastapply/openai.ts tools/fastapply/vercel.ts tools/codebase_search/index.ts tools/codebase_search/core.ts tools/codebase_search/types.ts tools/codebase_search/prompts.ts tools/codebase_search/anthropic.ts tools/codebase_search/openai.ts tools/codebase_search/vercel.ts tools/warp_grep/index.ts tools/warp_grep/client.ts tools/warp_grep/openai.ts tools/warp_grep/anthropic.ts tools/warp_grep/vercel.ts tools/warp_grep/gemini.ts tools/warp_grep/harness.ts tools/warp_grep/agent/config.ts tools/warp_grep/agent/parser.ts tools/warp_grep/agent/runner.ts tools/warp_grep/agent/types.ts tools/warp_grep/agent/formatter.ts tools/warp_grep/providers/types.ts tools/warp_grep/providers/local.ts tools/warp_grep/providers/remote.ts tools/warp_grep/providers/code_storage_http.ts tools/warp_grep/tools/grep.ts tools/warp_grep/tools/analyse.ts tools/warp_grep/tools/read.ts tools/warp_grep/tools/finish.ts tools/warp_grep/utils/paths.ts tools/warp_grep/utils/github.ts tools/warp_grep/utils/ripgrep.ts tools/warp_grep/utils/format.ts tools/warp_grep/utils/files.ts tools/browser/index.ts tools/browser/core.ts tools/browser/types.ts tools/browser/prompts.ts tools/browser/anthropic.ts tools/browser/openai.ts tools/browser/vercel.ts tools/browser/live.ts tools/browser/errors.ts tools/browser/profiles/index.ts tools/browser/profiles/core.ts tools/browser/profiles/types.ts modelrouter/index.ts modelrouter/core.ts modelrouter/types.ts tools/compact/index.ts tools/compact/core.ts tools/compact/types.ts tools/utils/resilience.ts subagents/index.ts subagents/types.ts subagents/prompts.ts subagents/vercel.ts subagents/anthropic.ts tracing/index.ts tracing/core.ts tracing/interaction.ts tracing/otel.ts tracing/types.ts --format esm,cjs --sourcemap --clean --dts --dts-resolve && tsup ai-sdk/index.ts --format esm,cjs --sourcemap --dts --no-clean --out-dir dist/ai-sdk",
186
+ build: "tsup version.ts index.ts edge.ts client.ts core/index.ts core/client.ts core/resource.ts core/error.ts tools/index.ts tools/fastapply/index.ts tools/fastapply/core.ts tools/fastapply/apply.ts tools/fastapply/types.ts tools/fastapply/prompts.ts tools/fastapply/anthropic.ts tools/fastapply/openai.ts tools/fastapply/vercel.ts tools/codebase_search/index.ts tools/codebase_search/core.ts tools/codebase_search/types.ts tools/codebase_search/prompts.ts tools/codebase_search/anthropic.ts tools/codebase_search/openai.ts tools/codebase_search/vercel.ts tools/warp_grep/index.ts tools/warp_grep/client.ts tools/warp_grep/openai.ts tools/warp_grep/anthropic.ts tools/warp_grep/vercel.ts tools/warp_grep/gemini.ts tools/warp_grep/harness.ts tools/warp_grep/agent/config.ts tools/warp_grep/agent/parser.ts tools/warp_grep/agent/runner.ts tools/warp_grep/agent/types.ts tools/warp_grep/agent/formatter.ts tools/warp_grep/providers/types.ts tools/warp_grep/providers/local.ts tools/warp_grep/providers/remote.ts tools/warp_grep/providers/code_storage_http.ts tools/warp_grep/tools/grep.ts tools/warp_grep/tools/analyse.ts tools/warp_grep/tools/read.ts tools/warp_grep/tools/finish.ts tools/warp_grep/utils/paths.ts tools/warp_grep/utils/github.ts tools/warp_grep/utils/ripgrep.ts tools/warp_grep/utils/format.ts tools/warp_grep/utils/files.ts modelrouter/index.ts modelrouter/core.ts modelrouter/types.ts tools/compact/index.ts tools/compact/core.ts tools/compact/types.ts tools/utils/resilience.ts subagents/index.ts subagents/types.ts subagents/prompts.ts subagents/vercel.ts subagents/anthropic.ts tracing/index.ts tracing/core.ts tracing/interaction.ts tracing/otel.ts tracing/types.ts --format esm,cjs --sourcemap --clean --dts --dts-resolve && tsup ai-sdk/index.ts --format esm,cjs --sourcemap --dts --no-clean --out-dir dist/ai-sdk",
212
187
  prepare: "npm run build",
213
188
  typecheck: "tsc --noEmit && tsc --noEmit -p ai-sdk/tsconfig.json",
214
189
  lint: "eslint .",
@@ -218,7 +193,6 @@ var init_package = __esm({
218
193
  "test:openai": "vitest run openai",
219
194
  "test:vercel": "vitest run vercel",
220
195
  "test:git": "vitest run git",
221
- "test:browser": "vitest run browser",
222
196
  "test:agent": "npx tsx tests/fullAgentTest.ts",
223
197
  "test:integration": "npx tsx tests/fullIntegrationTest.ts",
224
198
  "test:e2e": "vitest run --config vitest.e2e.config.ts",
@@ -1355,23 +1329,17 @@ __export(index_exports, {
1355
1329
  APIResource: () => APIResource,
1356
1330
  AnthropicRouter: () => AnthropicRouter,
1357
1331
  AnthropicToolFactory: () => AnthropicToolFactory,
1358
- BrowserClient: () => BrowserClient,
1359
1332
  CodebaseSearchClient: () => CodebaseSearchClient,
1360
1333
  CompactClient: () => CompactClient,
1361
1334
  FastApplyAnchorIntegrityError: () => FastApplyAnchorIntegrityError,
1362
1335
  FastApplyClient: () => FastApplyClient,
1363
1336
  FastApplyContextLengthError: () => FastApplyContextLengthError,
1364
1337
  GeminiRouter: () => GeminiRouter,
1365
- GitHubClient: () => GitHubClient,
1366
- GitHubError: () => GitHubError,
1367
1338
  LocalRipgrepProvider: () => LocalRipgrepProvider,
1368
1339
  MorphAPIClient: () => MorphAPIClient,
1369
1340
  MorphClient: () => MorphClient,
1370
- NoInstallationError: () => NoInstallationError,
1371
- NotFoundError: () => NotFoundError,
1372
1341
  OpenAIRouter: () => OpenAIRouter,
1373
1342
  OpenAIToolFactory: () => OpenAIToolFactory,
1374
- PermissionError: () => PermissionError,
1375
1343
  RawRouter: () => RawRouter,
1376
1344
  SDK_VERSION: () => SDK_VERSION,
1377
1345
  VercelToolFactory: () => VercelToolFactory,
@@ -1489,7 +1457,6 @@ async function toMorphError(response) {
1489
1457
  // core/client.ts
1490
1458
  var DEFAULT_BASE_URL = "https://api.morphllm.com";
1491
1459
  var DEFAULT_REPOS_URL = "https://repos.morphllm.com";
1492
- var DEFAULT_BROWSER_URL = "https://browser.morphllm.com";
1493
1460
  var DEFAULT_TIMEOUT = 6e4;
1494
1461
  var env = (name) => typeof process !== "undefined" ? process.env?.[name] : void 0;
1495
1462
  var stripTrailingSlash = (url) => url.replace(/\/+$/, "");
@@ -1498,7 +1465,6 @@ var MorphAPIClient = class {
1498
1465
  apiKey;
1499
1466
  baseURL;
1500
1467
  reposURL;
1501
- browserURL;
1502
1468
  /** Explicit default timeout (ms), if set. The request default is applied lazily so
1503
1469
  * resources can read an undefined value and supply their own fallback. */
1504
1470
  timeout;
@@ -1508,9 +1474,6 @@ var MorphAPIClient = class {
1508
1474
  this.apiKey = options.apiKey;
1509
1475
  this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);
1510
1476
  this.reposURL = stripTrailingSlash(options.reposURL ?? env("MORPH_SEARCH_URL") ?? DEFAULT_REPOS_URL);
1511
- this.browserURL = stripTrailingSlash(
1512
- options.browserURL ?? (env("MORPH_ENVIRONMENT") === "DEV" ? "http://localhost:8000" : DEFAULT_BROWSER_URL)
1513
- );
1514
1477
  this.timeout = options.timeout;
1515
1478
  this.retryConfig = options.retryConfig;
1516
1479
  this.debug = options.debug ?? false;
@@ -1569,7 +1532,6 @@ var MorphAPIClient = class {
1569
1532
  timeout,
1570
1533
  `Morph request to ${url} timed out after ${timeout}ms`
1571
1534
  );
1572
- if (opts.raw) return response;
1573
1535
  if (!response.ok) throw await toMorphError(response);
1574
1536
  if (opts.stream) return response;
1575
1537
  if (response.status === 204) return void 0;
@@ -1815,1259 +1777,6 @@ async function executeCodebaseSearch(input, config) {
1815
1777
  return runSearch(client, input, config.repoId, config.timeout ?? DEFAULT_TIMEOUT3, config.searchUrl);
1816
1778
  }
1817
1779
 
1818
- // tools/browser/core.ts
1819
- init_logger();
1820
-
1821
- // tools/browser/live.ts
1822
- var LIVE_PRESETS = {
1823
- /** Read-only monitoring (no interaction) */
1824
- readonly: { interactive: false },
1825
- /** Interactive control (human-in-the-loop) */
1826
- interactive: { interactive: true },
1827
- /** Watch-only without controls */
1828
- monitoring: { interactive: false, showControls: false }
1829
- };
1830
- function buildLiveUrl(debugUrl, options = {}) {
1831
- if (!debugUrl) {
1832
- throw new Error(
1833
- "debugUrl is required. Ensure your backend returns debugUrl in the task response. Contact support@morphllm.com if you need help."
1834
- );
1835
- }
1836
- const normalized = normalizeLiveUrl(debugUrl);
1837
- const url = new URL(normalized);
1838
- if (options.interactive !== void 0) {
1839
- url.searchParams.set("interactive", String(options.interactive));
1840
- }
1841
- if (options.theme) {
1842
- url.searchParams.set("theme", options.theme);
1843
- }
1844
- if (options.showControls !== void 0) {
1845
- url.searchParams.set("showControls", String(options.showControls));
1846
- }
1847
- if (options.pageId) {
1848
- url.searchParams.set("pageId", options.pageId);
1849
- }
1850
- if (options.pageIndex) {
1851
- url.searchParams.set("pageIndex", options.pageIndex);
1852
- }
1853
- return url.toString();
1854
- }
1855
- function cdpToHttps(wsUrl) {
1856
- return wsUrl.replace(/^wss:\/\//, "https://").replace(/^ws:\/\//, "http://");
1857
- }
1858
- function normalizeLiveUrl(debugUrl) {
1859
- const trimmed = debugUrl.trim();
1860
- if (!trimmed) return trimmed;
1861
- if (trimmed.startsWith("wss://") || trimmed.startsWith("ws://")) {
1862
- return `https://live.browser-use.com?wss=${encodeURIComponent(cdpToHttps(trimmed))}`;
1863
- }
1864
- let url;
1865
- try {
1866
- url = new URL(trimmed);
1867
- } catch {
1868
- return trimmed;
1869
- }
1870
- const wssParam = url.searchParams.get("wss");
1871
- if (wssParam && (wssParam.startsWith("wss://") || wssParam.startsWith("ws://"))) {
1872
- url.searchParams.set("wss", cdpToHttps(wssParam));
1873
- }
1874
- return url.toString();
1875
- }
1876
- function buildLiveIframe(debugUrl, options = {}) {
1877
- const {
1878
- width = "100%",
1879
- height = "600px",
1880
- style = "",
1881
- className = "",
1882
- ...sessionOptions
1883
- } = options;
1884
- const src = buildLiveUrl(debugUrl, sessionOptions);
1885
- const widthStr = typeof width === "number" ? `${width}px` : width;
1886
- const heightStr = typeof height === "number" ? `${height}px` : height;
1887
- const baseStyle = `width: ${widthStr}; height: ${heightStr}; border: none;`;
1888
- const fullStyle = style ? `${baseStyle} ${style}` : baseStyle;
1889
- const attributes = [
1890
- `src="${src}"`,
1891
- `style="${fullStyle}"`
1892
- ];
1893
- if (className) {
1894
- attributes.push(`class="${className}"`);
1895
- }
1896
- return `<iframe ${attributes.join(" ")}></iframe>`;
1897
- }
1898
- function buildEmbedCode(debugUrl, options = {}) {
1899
- const iframe = buildLiveIframe(debugUrl, options);
1900
- return `<!-- Embed Morph Live Session -->
1901
- ${iframe}`;
1902
- }
1903
- function resolvePreset(optionsOrPreset) {
1904
- if (!optionsOrPreset) {
1905
- return {};
1906
- }
1907
- if (typeof optionsOrPreset === "string") {
1908
- const preset = LIVE_PRESETS[optionsOrPreset];
1909
- if (!preset) {
1910
- throw new Error(
1911
- `Unknown preset: ${optionsOrPreset}. Available presets: ${Object.keys(LIVE_PRESETS).join(", ")}`
1912
- );
1913
- }
1914
- return preset;
1915
- }
1916
- return optionsOrPreset;
1917
- }
1918
-
1919
- // tools/browser/errors.ts
1920
- var MorphError2 = class extends Error {
1921
- /** Error code for programmatic handling */
1922
- code;
1923
- /** Original cause of the error, if any */
1924
- cause;
1925
- constructor(message, code, cause) {
1926
- super(message);
1927
- this.name = "MorphError";
1928
- this.code = code;
1929
- this.cause = cause;
1930
- if (Error.captureStackTrace) {
1931
- Error.captureStackTrace(this, this.constructor);
1932
- }
1933
- }
1934
- /**
1935
- * Returns a JSON representation of the error for logging.
1936
- */
1937
- toJSON() {
1938
- return {
1939
- name: this.name,
1940
- message: this.message,
1941
- code: this.code,
1942
- cause: this.cause?.message
1943
- };
1944
- }
1945
- };
1946
- var MorphValidationError = class extends MorphError2 {
1947
- /** The field that failed validation */
1948
- field;
1949
- constructor(message, field) {
1950
- super(message, "validation_error");
1951
- this.name = "MorphValidationError";
1952
- this.field = field;
1953
- }
1954
- toJSON() {
1955
- return {
1956
- ...super.toJSON(),
1957
- field: this.field
1958
- };
1959
- }
1960
- };
1961
- var MorphAPIError = class extends MorphError2 {
1962
- /** HTTP status code */
1963
- statusCode;
1964
- /** Request ID for debugging (if available) */
1965
- requestId;
1966
- /** Raw response body */
1967
- rawResponse;
1968
- constructor(message, code, statusCode, options) {
1969
- super(message, code, options?.cause);
1970
- this.name = "MorphAPIError";
1971
- this.statusCode = statusCode;
1972
- this.requestId = options?.requestId;
1973
- this.rawResponse = options?.rawResponse;
1974
- }
1975
- toJSON() {
1976
- return {
1977
- ...super.toJSON(),
1978
- statusCode: this.statusCode,
1979
- requestId: this.requestId
1980
- };
1981
- }
1982
- };
1983
- var MorphAuthenticationError = class extends MorphAPIError {
1984
- constructor(message = "Authentication required. Please provide a valid API key.") {
1985
- super(message, "authentication_required", 401);
1986
- this.name = "MorphAuthenticationError";
1987
- }
1988
- };
1989
- var MorphRateLimitError = class extends MorphAPIError {
1990
- /** When the rate limit resets (Unix timestamp) */
1991
- resetAt;
1992
- /** Number of seconds until reset */
1993
- retryAfter;
1994
- constructor(message = "Rate limit exceeded. Please retry later.", options) {
1995
- super(message, "rate_limit_exceeded", 429, { requestId: options?.requestId });
1996
- this.name = "MorphRateLimitError";
1997
- this.resetAt = options?.resetAt;
1998
- this.retryAfter = options?.retryAfter;
1999
- }
2000
- toJSON() {
2001
- return {
2002
- ...super.toJSON(),
2003
- resetAt: this.resetAt,
2004
- retryAfter: this.retryAfter
2005
- };
2006
- }
2007
- };
2008
- var MorphNotFoundError = class extends MorphAPIError {
2009
- /** The type of resource that was not found */
2010
- resourceType;
2011
- /** The ID of the resource that was not found */
2012
- resourceId;
2013
- constructor(resourceType, resourceId) {
2014
- const message = resourceId ? `${resourceType} '${resourceId}' not found` : `${resourceType} not found`;
2015
- super(message, "resource_not_found", 404);
2016
- this.name = "MorphNotFoundError";
2017
- this.resourceType = resourceType;
2018
- this.resourceId = resourceId;
2019
- }
2020
- toJSON() {
2021
- return {
2022
- ...super.toJSON(),
2023
- resourceType: this.resourceType,
2024
- resourceId: this.resourceId
2025
- };
2026
- }
2027
- };
2028
- var MorphProfileLimitError = class extends MorphAPIError {
2029
- /** Current number of profiles */
2030
- currentCount;
2031
- /** Maximum allowed profiles for the plan */
2032
- maxAllowed;
2033
- constructor(message = "Profile limit exceeded for your plan.", options) {
2034
- super(message, "profile_limit_exceeded", 403, { requestId: options?.requestId });
2035
- this.name = "MorphProfileLimitError";
2036
- this.currentCount = options?.currentCount;
2037
- this.maxAllowed = options?.maxAllowed;
2038
- }
2039
- toJSON() {
2040
- return {
2041
- ...super.toJSON(),
2042
- currentCount: this.currentCount,
2043
- maxAllowed: this.maxAllowed
2044
- };
2045
- }
2046
- };
2047
- function parseAPIError(statusCode, responseText, requestId) {
2048
- let errorData = {};
2049
- try {
2050
- errorData = JSON.parse(responseText);
2051
- } catch {
2052
- }
2053
- const message = errorData.detail || errorData.message || responseText || "Unknown error";
2054
- const code = errorData.code;
2055
- switch (statusCode) {
2056
- case 401:
2057
- return new MorphAuthenticationError(message);
2058
- case 403:
2059
- if (code === "profile_limit_exceeded" || message.toLowerCase().includes("limit")) {
2060
- return new MorphProfileLimitError(message, { requestId });
2061
- }
2062
- return new MorphAPIError(message, "insufficient_permissions", statusCode, { requestId, rawResponse: responseText });
2063
- case 404:
2064
- if (message.toLowerCase().includes("profile")) {
2065
- return new MorphNotFoundError("Profile", void 0);
2066
- }
2067
- if (message.toLowerCase().includes("session")) {
2068
- return new MorphNotFoundError("Session", void 0);
2069
- }
2070
- return new MorphAPIError(message, "resource_not_found", statusCode, { requestId, rawResponse: responseText });
2071
- case 429:
2072
- return new MorphRateLimitError(message, { requestId });
2073
- case 422:
2074
- return new MorphAPIError(message, "validation_error", statusCode, { requestId, rawResponse: responseText });
2075
- case 500:
2076
- case 502:
2077
- case 503:
2078
- case 504:
2079
- return new MorphAPIError(message, "service_unavailable", statusCode, { requestId, rawResponse: responseText });
2080
- default:
2081
- return new MorphAPIError(message, "network_error", statusCode, { requestId, rawResponse: responseText });
2082
- }
2083
- }
2084
-
2085
- // tools/browser/profiles/types.ts
2086
- function transformProfile(api) {
2087
- return {
2088
- id: api.id,
2089
- name: api.name,
2090
- repoId: api.repo_id,
2091
- cookieDomains: api.cookie_domains,
2092
- lastUsedAt: api.last_used_at,
2093
- createdAt: api.created_at,
2094
- updatedAt: api.updated_at
2095
- };
2096
- }
2097
- function transformCreateInput(input) {
2098
- return {
2099
- name: input.name,
2100
- repo_id: input.repoId
2101
- };
2102
- }
2103
- function transformSession(api) {
2104
- return {
2105
- sessionId: api.session_id,
2106
- debugUrl: api.debug_url || ""
2107
- };
2108
- }
2109
- function transformSaveInput(input) {
2110
- return {
2111
- session_id: input.sessionId,
2112
- profile_id: input.profileId
2113
- };
2114
- }
2115
- function transformStateResponse(api) {
2116
- return {
2117
- profileId: api.profile_id,
2118
- stateUrl: api.state_url,
2119
- expiresIn: api.expires_in
2120
- };
2121
- }
2122
-
2123
- // tools/browser/profiles/core.ts
2124
- var DEFAULT_API_URL2 = process.env.MORPH_ENVIRONMENT === "DEV" ? "http://localhost:8000" : "https://browser.morphllm.com";
2125
- var ProfilesClient = class {
2126
- config;
2127
- constructor(config) {
2128
- this.config = config;
2129
- }
2130
- /**
2131
- * Create a new browser profile and immediately start a live session.
2132
- *
2133
- * @param input - Profile creation parameters
2134
- * @returns Profile setup handle with live URL + save()
2135
- * @throws {MorphValidationError} If input validation fails
2136
- * @throws {MorphProfileLimitError} If profile limit is exceeded
2137
- * @throws {MorphAuthenticationError} If API key is missing or invalid
2138
- *
2139
- * @example
2140
- * ```typescript
2141
- * const setup = await morph.browser.profiles.createProfile({
2142
- * name: 'LinkedIn Production',
2143
- * repoId: 'owner/repo'
2144
- * });
2145
- * console.log(setup.session.debugUrl);
2146
- * await setup.save();
2147
- * ```
2148
- */
2149
- async createProfile(input) {
2150
- return createProfile(input, this.config);
2151
- }
2152
- /**
2153
- * List all profiles for the authenticated user.
2154
- *
2155
- * @param repoId - Optional repository ID to filter by
2156
- * @returns Array of profiles
2157
- *
2158
- * @example
2159
- * ```typescript
2160
- * // List all profiles
2161
- * const allProfiles = await morph.browser.profiles.listProfiles();
2162
- *
2163
- * // List profiles for a specific repo
2164
- * const repoProfiles = await morph.browser.profiles.listProfiles('owner/repo');
2165
- * ```
2166
- */
2167
- async listProfiles(repoId) {
2168
- return listProfiles(this.config, repoId);
2169
- }
2170
- /**
2171
- * Get a profile by ID with convenience methods.
2172
- *
2173
- * @param id - Profile ID
2174
- * @returns Profile with attached methods
2175
- * @throws {MorphNotFoundError} If profile is not found
2176
- *
2177
- * @example
2178
- * ```typescript
2179
- * const profile = await morph.browser.profiles.getProfile('profile-id');
2180
- * const state = await profile.getState();
2181
- * await profile.delete();
2182
- * ```
2183
- */
2184
- async getProfile(id) {
2185
- return getProfile(id, this.config);
2186
- }
2187
- /**
2188
- * Update a profile by opening a live session (no rename).
2189
- *
2190
- * @param id - Profile ID
2191
- * @returns Profile setup handle with live URL + save()
2192
- */
2193
- async updateProfile(id) {
2194
- return updateProfile(id, this.config);
2195
- }
2196
- /**
2197
- * Delete a profile.
2198
- *
2199
- * @param id - Profile ID
2200
- * @throws {MorphNotFoundError} If profile is not found
2201
- */
2202
- async deleteProfile(id) {
2203
- return deleteProfile(id, this.config);
2204
- }
2205
- /**
2206
- * Start a browser session for profile setup.
2207
- *
2208
- * Returns a live URL where the user can sign into accounts.
2209
- * After signing in, call `saveSession` to persist the state.
2210
- *
2211
- * @param input - Optional session parameters
2212
- * @returns Session with debug URL
2213
- *
2214
- * @example
2215
- * ```typescript
2216
- * const session = await morph.browser.profiles.startSession();
2217
- * console.log('Sign in at:', session.debugUrl);
2218
- * // Open debugUrl in browser, user signs in...
2219
- * await morph.browser.profiles.saveSession(session.sessionId, profile.id);
2220
- * ```
2221
- */
2222
- async startSession(input) {
2223
- return startProfileSession(this.config, input);
2224
- }
2225
- /**
2226
- * Save browser state from a session to a profile.
2227
- *
2228
- * Call this after the user is done signing into accounts.
2229
- * Extracts cookies, localStorage, and sessionStorage.
2230
- *
2231
- * @param sessionId - Browser session ID from startSession
2232
- * @param profileId - Profile ID to save state to
2233
- * @returns Updated profile with cookie domains
2234
- */
2235
- async saveSession(sessionId, profileId) {
2236
- return saveProfileSession({ sessionId, profileId }, this.config);
2237
- }
2238
- /**
2239
- * List available repo IDs (discovery).
2240
- *
2241
- * @returns Repo summaries with profile counts
2242
- */
2243
- async listRepos() {
2244
- return listRepos(this.config);
2245
- }
2246
- /**
2247
- * Get the presigned URL for a profile's state.
2248
- *
2249
- * Use this to download the raw state JSON for debugging
2250
- * or to restore state manually.
2251
- *
2252
- * @param profileId - Profile ID
2253
- * @returns State URL with expiry information
2254
- */
2255
- async getProfileState(profileId) {
2256
- return getProfileState(profileId, this.config);
2257
- }
2258
- };
2259
- function validateCreateInput(input) {
2260
- if (!input.name || typeof input.name !== "string") {
2261
- throw new MorphValidationError("name is required", "name");
2262
- }
2263
- const trimmedName = input.name.trim();
2264
- if (trimmedName.length === 0) {
2265
- throw new MorphValidationError("name cannot be empty", "name");
2266
- }
2267
- if (trimmedName.length > 100) {
2268
- throw new MorphValidationError("name must be 100 characters or less", "name");
2269
- }
2270
- if (!input.repoId || typeof input.repoId !== "string") {
2271
- throw new MorphValidationError("repoId is required", "repoId");
2272
- }
2273
- if (input.repoId.trim().length === 0) {
2274
- throw new MorphValidationError("repoId cannot be empty", "repoId");
2275
- }
2276
- }
2277
- function validateId(id, fieldName) {
2278
- if (!id || typeof id !== "string") {
2279
- throw new MorphValidationError(`${fieldName} is required`, fieldName);
2280
- }
2281
- if (id.trim().length === 0) {
2282
- throw new MorphValidationError(`${fieldName} cannot be empty`, fieldName);
2283
- }
2284
- }
2285
- async function createProfile(input, config = {}) {
2286
- validateCreateInput(input);
2287
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2288
- const headers = buildHeaders(config);
2289
- const response = await fetchWithRetry(
2290
- `${apiUrl}/profiles`,
2291
- {
2292
- method: "POST",
2293
- headers,
2294
- body: JSON.stringify(transformCreateInput(input))
2295
- },
2296
- config.retryConfig
2297
- );
2298
- if (!response.ok) {
2299
- const errorText = await response.text().catch(() => response.statusText);
2300
- const requestId = response.headers.get("x-request-id") || void 0;
2301
- throw parseAPIError(response.status, errorText, requestId);
2302
- }
2303
- const apiProfile = await response.json();
2304
- const profile = transformProfile(apiProfile);
2305
- const session = await startProfileSession(config, { profileId: profile.id });
2306
- return buildProfileSetup(profile, session, config);
2307
- }
2308
- async function listProfiles(config = {}, repoId) {
2309
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2310
- const headers = buildHeaders(config);
2311
- const url = repoId ? `${apiUrl}/profiles?repo_id=${encodeURIComponent(repoId)}` : `${apiUrl}/profiles`;
2312
- const response = await fetchWithRetry(
2313
- url,
2314
- { method: "GET", headers },
2315
- config.retryConfig
2316
- );
2317
- if (!response.ok) {
2318
- const errorText = await response.text().catch(() => response.statusText);
2319
- const requestId = response.headers.get("x-request-id") || void 0;
2320
- throw parseAPIError(response.status, errorText, requestId);
2321
- }
2322
- const data = await response.json();
2323
- return data.profiles.map(transformProfile);
2324
- }
2325
- async function getProfile(id, config = {}) {
2326
- validateId(id, "id");
2327
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2328
- const headers = buildHeaders(config);
2329
- const response = await fetchWithRetry(
2330
- `${apiUrl}/profiles/${encodeURIComponent(id)}`,
2331
- { method: "GET", headers },
2332
- config.retryConfig
2333
- );
2334
- if (!response.ok) {
2335
- const errorText = await response.text().catch(() => response.statusText);
2336
- const requestId = response.headers.get("x-request-id") || void 0;
2337
- throw parseAPIError(response.status, errorText, requestId);
2338
- }
2339
- const apiProfile = await response.json();
2340
- const profile = transformProfile(apiProfile);
2341
- return {
2342
- ...profile,
2343
- getState: () => getProfileState(id, config),
2344
- delete: () => deleteProfile(id, config)
2345
- };
2346
- }
2347
- async function updateProfile(id, config = {}) {
2348
- validateId(id, "id");
2349
- const profile = await fetchProfile(id, config);
2350
- const session = await startProfileSession(config, { profileId: profile.id });
2351
- return buildProfileSetup(profile, session, config);
2352
- }
2353
- async function deleteProfile(id, config = {}) {
2354
- validateId(id, "id");
2355
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2356
- const headers = buildHeaders(config);
2357
- const response = await fetchWithRetry(
2358
- `${apiUrl}/profiles/${encodeURIComponent(id)}`,
2359
- { method: "DELETE", headers },
2360
- config.retryConfig
2361
- );
2362
- if (!response.ok) {
2363
- const errorText = await response.text().catch(() => response.statusText);
2364
- const requestId = response.headers.get("x-request-id") || void 0;
2365
- throw parseAPIError(response.status, errorText, requestId);
2366
- }
2367
- }
2368
- async function startProfileSession(config = {}, input) {
2369
- if (!config.apiKey) {
2370
- throw new MorphAuthenticationError();
2371
- }
2372
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2373
- const headers = buildHeaders(config);
2374
- const body = input?.profileId ? { profile_id: input.profileId } : {};
2375
- const response = await fetchWithRetry(
2376
- `${apiUrl}/profiles/session/start`,
2377
- {
2378
- method: "POST",
2379
- headers,
2380
- body: JSON.stringify(body)
2381
- },
2382
- config.retryConfig
2383
- );
2384
- if (!response.ok) {
2385
- const errorText = await response.text().catch(() => response.statusText);
2386
- const requestId = response.headers.get("x-request-id") || void 0;
2387
- throw parseAPIError(response.status, errorText, requestId);
2388
- }
2389
- const apiSession = await response.json();
2390
- return transformSession(apiSession);
2391
- }
2392
- async function saveProfileSession(input, config = {}) {
2393
- validateId(input.sessionId, "sessionId");
2394
- validateId(input.profileId, "profileId");
2395
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2396
- const headers = buildHeaders(config);
2397
- const response = await fetchWithRetry(
2398
- `${apiUrl}/profiles/session/save`,
2399
- {
2400
- method: "POST",
2401
- headers,
2402
- body: JSON.stringify(transformSaveInput(input))
2403
- },
2404
- config.retryConfig
2405
- );
2406
- if (!response.ok) {
2407
- const errorText = await response.text().catch(() => response.statusText);
2408
- const requestId = response.headers.get("x-request-id") || void 0;
2409
- throw parseAPIError(response.status, errorText, requestId);
2410
- }
2411
- const apiProfile = await response.json();
2412
- return transformProfile(apiProfile);
2413
- }
2414
- async function listRepos(config = {}) {
2415
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2416
- const headers = buildHeaders(config);
2417
- const response = await fetchWithRetry(
2418
- `${apiUrl}/repos`,
2419
- { method: "GET", headers },
2420
- config.retryConfig
2421
- );
2422
- if (!response.ok) {
2423
- const errorText = await response.text().catch(() => response.statusText);
2424
- const requestId = response.headers.get("x-request-id") || void 0;
2425
- throw parseAPIError(response.status, errorText, requestId);
2426
- }
2427
- const data = await response.json();
2428
- const repos = Array.isArray(data?.repos) ? data.repos : [];
2429
- return repos.map((repo) => ({
2430
- repoId: repo.repo_id,
2431
- repoFullName: repo.repo_full_name,
2432
- profileCount: repo.profile_count ?? 0
2433
- }));
2434
- }
2435
- async function getProfileState(profileId, config = {}) {
2436
- validateId(profileId, "profileId");
2437
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2438
- const headers = buildHeaders(config);
2439
- const response = await fetchWithRetry(
2440
- `${apiUrl}/profiles/${encodeURIComponent(profileId)}/state`,
2441
- { method: "GET", headers },
2442
- config.retryConfig
2443
- );
2444
- if (!response.ok) {
2445
- const errorText = await response.text().catch(() => response.statusText);
2446
- const requestId = response.headers.get("x-request-id") || void 0;
2447
- throw parseAPIError(response.status, errorText, requestId);
2448
- }
2449
- const apiState = await response.json();
2450
- return transformStateResponse(apiState);
2451
- }
2452
- function buildHeaders(config) {
2453
- const headers = { "Content-Type": "application/json" };
2454
- if (config.apiKey) {
2455
- headers["Authorization"] = `Bearer ${config.apiKey}`;
2456
- }
2457
- return headers;
2458
- }
2459
- async function fetchProfile(id, config) {
2460
- const apiUrl = config.apiUrl || DEFAULT_API_URL2;
2461
- const headers = buildHeaders(config);
2462
- const response = await fetchWithRetry(
2463
- `${apiUrl}/profiles/${encodeURIComponent(id)}`,
2464
- { method: "GET", headers },
2465
- config.retryConfig
2466
- );
2467
- if (!response.ok) {
2468
- const errorText = await response.text().catch(() => response.statusText);
2469
- const requestId = response.headers.get("x-request-id") || void 0;
2470
- throw parseAPIError(response.status, errorText, requestId);
2471
- }
2472
- const apiProfile = await response.json();
2473
- return transformProfile(apiProfile);
2474
- }
2475
- function buildProfileSetup(profile, session, config) {
2476
- return {
2477
- profile,
2478
- session,
2479
- save: () => saveProfileSession({ sessionId: session.sessionId, profileId: profile.id }, config)
2480
- };
2481
- }
2482
-
2483
- // tools/browser/core.ts
2484
- var DEFAULT_CONFIG2 = {
2485
- apiUrl: process.env.MORPH_ENVIRONMENT === "DEV" ? "http://localhost:8000" : "https://browser.morphllm.com",
2486
- timeout: 1e6,
2487
- // 10 minutes for complex tasks
2488
- debug: false
2489
- };
2490
- var BrowserClient = class extends APIResource {
2491
- config;
2492
- /**
2493
- * Profile management - create and manage browser profiles for storing login state.
2494
- */
2495
- profiles;
2496
- constructor(clientOrConfig = {}) {
2497
- const isClient = clientOrConfig instanceof MorphAPIClient;
2498
- super(
2499
- isClient ? clientOrConfig : new MorphAPIClient({
2500
- apiKey: clientOrConfig.apiKey,
2501
- browserURL: clientOrConfig.apiUrl,
2502
- timeout: clientOrConfig.timeout,
2503
- retryConfig: clientOrConfig.retryConfig,
2504
- debug: clientOrConfig.debug
2505
- })
2506
- );
2507
- this.config = isClient ? {
2508
- ...DEFAULT_CONFIG2,
2509
- apiUrl: clientOrConfig.browserURL,
2510
- apiKey: clientOrConfig.resolveApiKey(),
2511
- retryConfig: clientOrConfig.retryConfig,
2512
- debug: clientOrConfig.debug
2513
- } : { ...DEFAULT_CONFIG2, ...clientOrConfig };
2514
- this.profiles = new ProfilesClient(this.config);
2515
- }
2516
- /**
2517
- * Execute a browser automation task
2518
- */
2519
- async execute(input) {
2520
- return executeBrowserTask(input, this.config);
2521
- }
2522
- async createTask(input) {
2523
- const apiUrl = this.config.apiUrl || DEFAULT_CONFIG2.apiUrl;
2524
- const debug = this.config.debug || false;
2525
- const hasTask = typeof input.task === "string" && input.task.trim().length > 0;
2526
- const hasDiff = typeof input.diff === "string" && input.diff.trim().length > 0;
2527
- if (!hasTask && !hasDiff) {
2528
- throw new Error('Browser task requires either "task" (natural language) or "diff" (PR-review planning)');
2529
- }
2530
- logger.debug("Browser", "create_task", { task: (input.task ?? "").slice(0, 100), url: input.url, endpoint: `${apiUrl}/browser-task/async` });
2531
- const headers = { "Content-Type": "application/json" };
2532
- if (this.config.apiKey) headers["Authorization"] = `Bearer ${this.config.apiKey}`;
2533
- const response = await fetch(`${apiUrl}/browser-task/async`, {
2534
- method: "POST",
2535
- headers,
2536
- body: JSON.stringify({
2537
- task: input.task,
2538
- diff: input.diff,
2539
- url: input.url,
2540
- max_steps: input.maxSteps ?? 10,
2541
- model: input.model ?? "morph-computer-use-v0",
2542
- viewport_width: input.viewportWidth ?? 1280,
2543
- viewport_height: input.viewportHeight ?? 720,
2544
- external_id: input.externalId,
2545
- repo_id: input.repoId,
2546
- repo_full_name: input.repoFullName,
2547
- commit_id: input.commitId,
2548
- record_video: input.recordVideo ?? false,
2549
- video_width: input.videoWidth ?? input.viewportWidth ?? 1280,
2550
- video_height: input.videoHeight ?? input.viewportHeight ?? 720,
2551
- allow_resizing: input.allowResizing ?? false,
2552
- structured_output: "schema" in input ? stringifyStructuredOutput(input.schema) : void 0,
2553
- auth: input.auth,
2554
- profile_id: input.profileId,
2555
- force_query_params: input.forceQueryParams
2556
- })
2557
- });
2558
- if (!response.ok) {
2559
- const errorText = await response.text().catch(() => response.statusText);
2560
- logger.error("Browser", "create_task_error", { status: response.status, error: errorText });
2561
- throw new Error(`HTTP ${response.status}: ${errorText}`);
2562
- }
2563
- const result = mapTaskResult(await response.json());
2564
- logger.debug("Browser", "task_created", { recording_id: result.recordingId, task_id: result.taskId, debug_url: !!result.debugUrl });
2565
- if ("schema" in input) {
2566
- return wrapTaskResponseWithSchema(result, this.config, input.schema);
2567
- } else {
2568
- return wrapTaskResponse(result, this.config);
2569
- }
2570
- }
2571
- /**
2572
- * Execute task with recording and wait for video to be ready
2573
- */
2574
- async executeWithRecording(input) {
2575
- return executeWithRecording(input, this.config);
2576
- }
2577
- /**
2578
- * Get recording status and URLs
2579
- */
2580
- async getRecording(recordingId) {
2581
- return getRecording(recordingId, this.config);
2582
- }
2583
- /**
2584
- * Wait for recording to complete with automatic polling
2585
- */
2586
- async waitForRecording(recordingId, options) {
2587
- return waitForRecording(recordingId, this.config, options);
2588
- }
2589
- /**
2590
- * Get errors from recording with screenshots
2591
- */
2592
- async getErrors(recordingId) {
2593
- return getErrors(recordingId, this.config);
2594
- }
2595
- /**
2596
- * Get animated WebP preview of recording
2597
- */
2598
- async getWebp(recordingId, options) {
2599
- return getWebp(recordingId, this.config, options);
2600
- }
2601
- /**
2602
- * Check if browser worker service is healthy
2603
- */
2604
- async checkHealth() {
2605
- return checkHealth(this.config);
2606
- }
2607
- };
2608
- async function executeBrowserTask(input, config = {}) {
2609
- const apiUrl = config.apiUrl || DEFAULT_CONFIG2.apiUrl;
2610
- const timeout = config.timeout || DEFAULT_CONFIG2.timeout;
2611
- const debug = config.debug || false;
2612
- if (!input.task || input.task.trim().length === 0) {
2613
- return {
2614
- success: false,
2615
- error: 'Task description is required. Example: "Go to example.com and click the login button"'
2616
- };
2617
- }
2618
- if (input.maxSteps !== void 0 && (input.maxSteps < 1 || input.maxSteps > 50)) {
2619
- return {
2620
- success: false,
2621
- error: "maxSteps must be between 1 and 50. Use more steps for complex multi-page flows."
2622
- };
2623
- }
2624
- logger.debug("Browser", "execute_start", { task: input.task.slice(0, 100), url: input.url, max_steps: input.maxSteps ?? 10, record_video: input.recordVideo ?? false });
2625
- const startTime = Date.now();
2626
- try {
2627
- const headers = { "Content-Type": "application/json" };
2628
- if (config.apiKey) headers["Authorization"] = `Bearer ${config.apiKey}`;
2629
- const fetchPromise = fetchWithRetry(
2630
- `${apiUrl}/browser-task`,
2631
- {
2632
- method: "POST",
2633
- headers,
2634
- body: JSON.stringify({
2635
- task: input.task,
2636
- url: input.url,
2637
- max_steps: input.maxSteps ?? 10,
2638
- model: input.model ?? "morph-computer-use-v0",
2639
- viewport_width: input.viewportWidth ?? 1280,
2640
- viewport_height: input.viewportHeight ?? 720,
2641
- external_id: input.externalId,
2642
- repo_id: input.repoId,
2643
- commit_id: input.commitId,
2644
- record_video: input.recordVideo ?? false,
2645
- video_width: input.videoWidth ?? input.viewportWidth ?? 1280,
2646
- video_height: input.videoHeight ?? input.viewportHeight ?? 720,
2647
- allow_resizing: input.allowResizing ?? false,
2648
- structured_output: input.structuredOutput,
2649
- auth: input.auth,
2650
- profile_id: input.profileId,
2651
- force_query_params: input.forceQueryParams
2652
- })
2653
- },
2654
- config.retryConfig
2655
- );
2656
- const response = await withTimeout(
2657
- fetchPromise,
2658
- timeout,
2659
- `Browser task timed out after ${timeout}ms. Consider increasing timeout or reducing maxSteps.`
2660
- );
2661
- if (!response.ok) {
2662
- const errorText = await response.text().catch(() => response.statusText);
2663
- logger.error("Browser", "execute_error", { status: response.status, error: errorText });
2664
- throw new Error(`HTTP ${response.status}: ${errorText}`);
2665
- }
2666
- const result = mapTaskResult(await response.json());
2667
- const elapsed = Date.now() - startTime;
2668
- logger.debug("Browser", "execute_complete", { success: result.success, latency_ms: elapsed, steps: result.stepsTaken ?? 0, recording_id: result.recordingId });
2669
- return result;
2670
- } catch (error) {
2671
- if (error instanceof Error) {
2672
- if (error.message.includes("ECONNREFUSED") || error.message.includes("fetch failed")) {
2673
- return {
2674
- success: false,
2675
- error: `Cannot connect to browser worker at ${apiUrl}. Ensure the service is running and accessible. For local dev, set MORPH_ENVIRONMENT=DEV.`
2676
- };
2677
- }
2678
- return {
2679
- success: false,
2680
- error: error.message
2681
- };
2682
- }
2683
- return {
2684
- success: false,
2685
- error: String(error)
2686
- };
2687
- }
2688
- }
2689
- async function getRecording(recordingId, config = {}) {
2690
- const apiUrl = config.apiUrl || DEFAULT_CONFIG2.apiUrl;
2691
- const debug = config.debug || false;
2692
- if (!config.apiKey) {
2693
- throw new Error("API key required for getRecording");
2694
- }
2695
- if (debug) console.log(`[Browser] getRecording: ${recordingId}`);
2696
- const response = await fetch(`${apiUrl}/recordings/${recordingId}`, {
2697
- method: "GET",
2698
- headers: { "Authorization": `Bearer ${config.apiKey}` }
2699
- });
2700
- if (!response.ok) {
2701
- const errorText = await response.text().catch(() => response.statusText);
2702
- if (debug) console.error(`[Browser] getRecording error: ${response.status} - ${errorText}`);
2703
- throw new Error(`HTTP ${response.status}: ${errorText}`);
2704
- }
2705
- const data = mapRecordingStatus(await response.json());
2706
- if (debug) console.log(`[Browser] Recording status: ${data.status}`);
2707
- return {
2708
- ...data,
2709
- getWebp: (options) => getWebp(recordingId, config, options),
2710
- getErrors: () => getErrors(recordingId, config)
2711
- };
2712
- }
2713
- async function waitForRecording(recordingId, config = {}, options = {}) {
2714
- const timeout = options.timeout ?? 6e4;
2715
- const pollInterval = options.pollInterval ?? 2e3;
2716
- const startTime = Date.now();
2717
- while (Date.now() - startTime < timeout) {
2718
- const status = await getRecording(recordingId, config);
2719
- if (status.status === "COMPLETED" || status.status === "ERROR") {
2720
- return status;
2721
- }
2722
- await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
2723
- }
2724
- throw new Error(`Recording timeout after ${timeout}ms - status still pending`);
2725
- }
2726
- async function executeWithRecording(input, config = {}) {
2727
- const taskResult = await executeBrowserTask(input, config);
2728
- if (taskResult.recordingId) {
2729
- try {
2730
- const recording = await waitForRecording(
2731
- taskResult.recordingId,
2732
- config,
2733
- { timeout: 6e4, pollInterval: 2e3 }
2734
- );
2735
- return {
2736
- ...taskResult,
2737
- recording
2738
- };
2739
- } catch (error) {
2740
- const errorRecording = {
2741
- id: taskResult.recordingId,
2742
- status: "ERROR",
2743
- error: error instanceof Error ? error.message : String(error),
2744
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2745
- getWebp: (options) => getWebp(taskResult.recordingId, config, options),
2746
- getErrors: () => getErrors(taskResult.recordingId, config)
2747
- };
2748
- return {
2749
- ...taskResult,
2750
- recording: errorRecording
2751
- };
2752
- }
2753
- }
2754
- return taskResult;
2755
- }
2756
- async function getErrors(recordingId, config = {}) {
2757
- const apiUrl = config.apiUrl || DEFAULT_CONFIG2.apiUrl;
2758
- const debug = config.debug || false;
2759
- if (!config.apiKey) {
2760
- throw new Error("API key required for getErrors");
2761
- }
2762
- if (debug) console.log(`[Browser] getErrors: ${recordingId}`);
2763
- const response = await fetch(`${apiUrl}/recordings/${recordingId}/errors`, {
2764
- method: "GET",
2765
- headers: { "Authorization": `Bearer ${config.apiKey}` }
2766
- });
2767
- if (!response.ok) {
2768
- const errorText = await response.text().catch(() => response.statusText);
2769
- if (debug) console.error(`[Browser] getErrors error: ${response.status} - ${errorText}`);
2770
- throw new Error(`HTTP ${response.status}: ${errorText}`);
2771
- }
2772
- const errors = mapErrorsResponse(await response.json());
2773
- if (debug) console.log(`[Browser] Found ${errors.totalErrors} errors`);
2774
- return errors;
2775
- }
2776
- function stringifyStructuredOutput(schema) {
2777
- try {
2778
- return JSON.stringify({
2779
- type: "object",
2780
- description: "Zod schema definition (Zod v3)",
2781
- zodDef: schema._def
2782
- });
2783
- } catch (error) {
2784
- console.warn("[Browser] Failed to serialize Zod schema:", error);
2785
- return JSON.stringify({
2786
- type: "object",
2787
- description: "Schema serialization failed"
2788
- });
2789
- }
2790
- }
2791
- function parseStructuredTaskOutput(result, schema) {
2792
- if (!result.output) {
2793
- return { ...result, parsed: null };
2794
- }
2795
- try {
2796
- const parsed = JSON.parse(result.output);
2797
- const validated = schema.parse(parsed);
2798
- return { ...result, parsed: validated };
2799
- } catch (error) {
2800
- if (error instanceof SyntaxError) {
2801
- return { ...result, parsed: null };
2802
- }
2803
- throw error;
2804
- }
2805
- }
2806
- function mapTaskResult(api) {
2807
- if (!api || typeof api !== "object") {
2808
- return api;
2809
- }
2810
- return {
2811
- success: api.success,
2812
- result: api.result,
2813
- error: api.error,
2814
- stepsTaken: api.steps_taken,
2815
- executionTimeMs: api.execution_time_ms,
2816
- urls: api.urls,
2817
- actionNames: api.action_names,
2818
- errors: api.errors,
2819
- modelActions: api.model_actions,
2820
- isDone: api.is_done,
2821
- actionHistory: api.action_history,
2822
- actionResults: api.action_results,
2823
- hasErrors: api.has_errors,
2824
- numberOfSteps: api.number_of_steps,
2825
- judgement: api.judgement,
2826
- isValidated: api.is_validated,
2827
- replayId: api.replay_id,
2828
- replayUrl: api.replay_url,
2829
- recordingId: api.recording_id,
2830
- recordingStatus: api.recording_status,
2831
- taskId: api.task_id,
2832
- status: api.status,
2833
- output: api.output,
2834
- debugUrl: api.debug_url
2835
- };
2836
- }
2837
- function mapRecordingStatus(api) {
2838
- return {
2839
- id: api.id,
2840
- status: api.status,
2841
- replayUrl: api.replay_url,
2842
- networkUrl: api.network_url,
2843
- consoleUrl: api.console_url,
2844
- videoUrl: api.video_url,
2845
- result: api.result,
2846
- totalEvents: api.total_events,
2847
- fileSize: api.file_size,
2848
- duration: api.duration,
2849
- error: api.error,
2850
- createdAt: api.created_at
2851
- };
2852
- }
2853
- function mapBrowserError(api) {
2854
- return {
2855
- type: api.type,
2856
- message: api.message,
2857
- url: api.url,
2858
- timestamp: api.timestamp,
2859
- screenshotUrl: api.screenshot_url,
2860
- capturedAt: api.captured_at,
2861
- status: api.status
2862
- };
2863
- }
2864
- function mapErrorsResponse(api) {
2865
- return {
2866
- recordingId: api.recording_id,
2867
- totalErrors: api.total_errors,
2868
- errors: Array.isArray(api.errors) ? api.errors.map(mapBrowserError) : []
2869
- };
2870
- }
2871
- function mapWebpResponse(api) {
2872
- return {
2873
- webpUrl: api.webp_url,
2874
- cached: api.cached,
2875
- width: api.width,
2876
- fps: api.fps,
2877
- maxDuration: api.max_duration,
2878
- fileSize: api.file_size,
2879
- maxSizeMb: api.max_size_mb,
2880
- budgetMet: api.budget_met,
2881
- qualityUsed: api.quality_used,
2882
- attempts: api.attempts
2883
- };
2884
- }
2885
- async function getTaskStatus(taskId, config) {
2886
- const apiUrl = config.apiUrl || DEFAULT_CONFIG2.apiUrl;
2887
- const debug = config.debug || false;
2888
- if (debug) console.log(`[Browser] getTaskStatus: ${taskId}`);
2889
- const headers = {};
2890
- if (config.apiKey) headers["Authorization"] = `Bearer ${config.apiKey}`;
2891
- const response = await fetch(`${apiUrl}/tasks/${taskId}`, {
2892
- method: "GET",
2893
- headers
2894
- });
2895
- if (!response.ok) {
2896
- const errorText = await response.text().catch(() => response.statusText);
2897
- if (debug) console.error(`[Browser] getTaskStatus error: ${response.status} - ${errorText}`);
2898
- throw new Error(`HTTP ${response.status}: ${errorText}`);
2899
- }
2900
- const result = mapTaskResult(await response.json());
2901
- if (debug) console.log(`[Browser] Task status: ${result.status}`);
2902
- return result;
2903
- }
2904
- function generateLiveUrl(taskId, config) {
2905
- const apiUrl = config.apiUrl || DEFAULT_CONFIG2.apiUrl;
2906
- const baseUrl = apiUrl.replace("/api", "");
2907
- return `${baseUrl}/tasks/${taskId}/live`;
2908
- }
2909
- async function pollTaskUntilComplete(taskId, config, pollConfig = {}) {
2910
- const interval = pollConfig.interval ?? 2e3;
2911
- const timeout = pollConfig.timeout ?? 3e5;
2912
- const startTime = Date.now();
2913
- while (Date.now() - startTime < timeout) {
2914
- const status = await getTaskStatus(taskId, config);
2915
- if (status.status === "completed" || status.status === "failed") {
2916
- return status;
2917
- }
2918
- await new Promise((resolve2) => setTimeout(resolve2, interval));
2919
- }
2920
- throw new Error(`Task polling timeout after ${timeout}ms`);
2921
- }
2922
- function wrapTaskResponse(result, config) {
2923
- const debugUrl = result.debugUrl ?? "";
2924
- const wrapped = {
2925
- ...result,
2926
- debugUrl,
2927
- taskId: result.taskId || "",
2928
- liveUrl: result.taskId ? generateLiveUrl(result.taskId, config) : debugUrl,
2929
- complete: async (pollConfig) => {
2930
- if (result.taskId) {
2931
- return pollTaskUntilComplete(result.taskId, config, pollConfig);
2932
- }
2933
- if (result.recordingId) {
2934
- const recording = await waitForRecording(
2935
- result.recordingId,
2936
- config,
2937
- pollConfig
2938
- );
2939
- return {
2940
- ...result,
2941
- recordingStatus: recording.status
2942
- };
2943
- }
2944
- throw new Error("Cannot poll completion: no taskId or recordingId available");
2945
- },
2946
- // Add Steel live session helpers - either functional or error-throwing
2947
- getLiveUrl: debugUrl ? (options) => buildLiveUrl(debugUrl, options) : () => {
2948
- throw new Error(
2949
- "Live sessions not available. Your backend must return a debugUrl in the response. Contact support@morphllm.com if you need help."
2950
- );
2951
- },
2952
- getLiveIframe: debugUrl ? (optionsOrPreset) => {
2953
- const options = resolvePreset(optionsOrPreset);
2954
- return buildLiveIframe(debugUrl, options);
2955
- } : () => {
2956
- throw new Error(
2957
- "Live sessions not available. Your backend must return a debugUrl in the response. Contact support@morphllm.com if you need help."
2958
- );
2959
- },
2960
- getEmbedCode: debugUrl ? () => buildEmbedCode(debugUrl) : () => {
2961
- throw new Error(
2962
- "Live sessions not available. Your backend must return a debugUrl in the response. Contact support@morphllm.com if you need help."
2963
- );
2964
- }
2965
- };
2966
- return wrapped;
2967
- }
2968
- function wrapTaskResponseWithSchema(result, config, schema) {
2969
- const debugUrl = result.debugUrl ?? "";
2970
- const parsed = result.output ? parseStructuredTaskOutput(result, schema) : { ...result, parsed: null };
2971
- const wrapped = {
2972
- ...parsed,
2973
- debugUrl,
2974
- taskId: result.taskId || "",
2975
- liveUrl: result.taskId ? generateLiveUrl(result.taskId, config) : debugUrl,
2976
- complete: async (pollConfig) => {
2977
- if (result.taskId) {
2978
- const finalResult = await pollTaskUntilComplete(result.taskId, config, pollConfig);
2979
- return parseStructuredTaskOutput(finalResult, schema);
2980
- }
2981
- if (result.recordingId) {
2982
- const recording = await waitForRecording(
2983
- result.recordingId,
2984
- config,
2985
- pollConfig
2986
- );
2987
- return {
2988
- ...parsed,
2989
- recordingStatus: recording.status
2990
- };
2991
- }
2992
- throw new Error("Cannot poll completion: no taskId or recordingId available");
2993
- },
2994
- // Add Steel live session helpers - either functional or error-throwing
2995
- getLiveUrl: debugUrl ? (options) => buildLiveUrl(debugUrl, options) : () => {
2996
- throw new Error(
2997
- "Live sessions not available. Your backend must return a debugUrl in the response. Contact support@morphllm.com if you need help enabling live sessions. "
2998
- );
2999
- },
3000
- getLiveIframe: debugUrl ? (optionsOrPreset) => {
3001
- const options = resolvePreset(optionsOrPreset);
3002
- return buildLiveIframe(debugUrl, options);
3003
- } : () => {
3004
- throw new Error(
3005
- "Live sessions not available. Your backend must return a debugUrl in the response. Contact support@morphllm.com if you need help enabling live sessions."
3006
- );
3007
- },
3008
- getEmbedCode: debugUrl ? () => buildEmbedCode(debugUrl) : () => {
3009
- throw new Error(
3010
- "Live sessions not available. Your backend must return a debugUrl in the response. Contact support@morphllm.com if you need help enabling live sessions."
3011
- );
3012
- }
3013
- };
3014
- return wrapped;
3015
- }
3016
- async function getWebp(recordingId, config = {}, options = {}) {
3017
- const apiUrl = config.apiUrl || DEFAULT_CONFIG2.apiUrl;
3018
- const debug = config.debug || false;
3019
- if (!config.apiKey) {
3020
- throw new Error("API key required for getWebp");
3021
- }
3022
- const params = new URLSearchParams();
3023
- if (options.maxDuration !== void 0) params.set("max_duration", String(options.maxDuration));
3024
- if (options.fps !== void 0) params.set("fps", String(options.fps));
3025
- if (options.width !== void 0) params.set("width", String(options.width));
3026
- if (options.quality !== void 0) params.set("quality", String(options.quality));
3027
- if (options.maxSizeMb !== void 0) params.set("max_size_mb", String(options.maxSizeMb));
3028
- const url = `${apiUrl}/recordings/${recordingId}/webp${params.toString() ? "?" + params.toString() : ""}`;
3029
- if (debug) console.log(`[Browser] getWebp: ${url}`);
3030
- const response = await fetch(url, {
3031
- method: "GET",
3032
- headers: { "Authorization": `Bearer ${config.apiKey}` }
3033
- });
3034
- if (!response.ok) {
3035
- const errorText = await response.text().catch(() => response.statusText);
3036
- if (debug) console.error(`[Browser] getWebp error: ${response.status} - ${errorText}`);
3037
- throw new Error(`HTTP ${response.status}: ${errorText}`);
3038
- }
3039
- const result = mapWebpResponse(await response.json());
3040
- if (debug) console.log(`[Browser] WebP ready: ${result.webpUrl} (cached: ${result.cached})`);
3041
- return result;
3042
- }
3043
- async function checkHealth(config = {}) {
3044
- const apiUrl = config.apiUrl || DEFAULT_CONFIG2.apiUrl;
3045
- try {
3046
- const response = await fetch(`${apiUrl}/health`, {
3047
- method: "GET",
3048
- headers: config.apiKey ? { "Authorization": `Bearer ${config.apiKey}` } : {}
3049
- });
3050
- if (!response.ok) {
3051
- throw new Error(`HTTP ${response.status}`);
3052
- }
3053
- const data = await response.json();
3054
- return {
3055
- ok: true,
3056
- google_configured: data.google_configured ?? false,
3057
- database_configured: data.database_configured ?? false,
3058
- s3_configured: data.s3_configured ?? false
3059
- };
3060
- } catch (error) {
3061
- return {
3062
- ok: false,
3063
- google_configured: false,
3064
- database_configured: false,
3065
- s3_configured: false,
3066
- error: error instanceof Error ? error.message : String(error)
3067
- };
3068
- }
3069
- }
3070
-
3071
1780
  // tools/warp_grep/agent/runner.ts
3072
1781
  init_config();
3073
1782
 
@@ -3377,7 +2086,7 @@ var import_openai2 = __toESM(require("openai"), 1);
3377
2086
  init_version();
3378
2087
  var import_path4 = __toESM(require("path"), 1);
3379
2088
  init_logger();
3380
- var DEFAULT_API_URL3 = "https://api.morphllm.com";
2089
+ var DEFAULT_API_URL2 = "https://api.morphllm.com";
3381
2090
  var TOOL_SPECS = [
3382
2091
  {
3383
2092
  type: "function",
@@ -3486,7 +2195,7 @@ var TOOL_SPECS = [
3486
2195
  }
3487
2196
  ];
3488
2197
  async function callModel(messages, model, options = {}) {
3489
- const baseUrl = options.morphApiUrl || DEFAULT_API_URL3;
2198
+ const baseUrl = options.morphApiUrl || DEFAULT_API_URL2;
3490
2199
  const apiKey = options.morphApiKey || process.env.MORPH_API_KEY || "";
3491
2200
  const timeoutMs = options.timeout ?? AGENT_CONFIG.TIMEOUT_MS;
3492
2201
  const parsedUrl = new URL(baseUrl);
@@ -4040,13 +2749,13 @@ function parseGitHubUrl(input) {
4040
2749
  }
4041
2750
 
4042
2751
  // tools/compact/core.ts
4043
- var DEFAULT_API_URL4 = "https://api.morphllm.com";
2752
+ var DEFAULT_API_URL3 = "https://api.morphllm.com";
4044
2753
  var DEFAULT_TIMEOUT4 = 12e4;
4045
2754
  function resolveClient(clientOrConfig) {
4046
2755
  if (clientOrConfig instanceof MorphAPIClient) return clientOrConfig;
4047
2756
  return new MorphAPIClient({
4048
2757
  apiKey: clientOrConfig.morphApiKey,
4049
- baseURL: clientOrConfig.morphApiUrl ?? DEFAULT_API_URL4,
2758
+ baseURL: clientOrConfig.morphApiUrl ?? DEFAULT_API_URL3,
4050
2759
  timeout: clientOrConfig.timeout ?? DEFAULT_TIMEOUT4,
4051
2760
  retryConfig: clientOrConfig.retryConfig,
4052
2761
  debug: clientOrConfig.debug
@@ -4427,357 +3136,16 @@ function formatResult(result) {
4427
3136
  return parts.join("\n");
4428
3137
  }
4429
3138
 
4430
- // tools/github/types.ts
4431
- var GitHubError = class extends Error {
4432
- /** HTTP status code */
4433
- status;
4434
- /** Error code from API */
4435
- code;
4436
- constructor(message, status, code) {
4437
- super(message);
4438
- this.name = "GitHubError";
4439
- this.status = status;
4440
- this.code = code;
4441
- }
4442
- };
4443
- var NoInstallationError = class extends GitHubError {
4444
- constructor(message = "No GitHub installation found. Connect GitHub at morphllm.com/dashboard/integrations/github") {
4445
- super(message, 404, "NO_INSTALLATION");
4446
- }
4447
- };
4448
- var NotFoundError = class extends GitHubError {
4449
- constructor(resource) {
4450
- super(`${resource} not found`, 404, "NOT_FOUND");
4451
- }
4452
- };
4453
- var PermissionError = class extends GitHubError {
4454
- constructor(message = "Insufficient permissions for this operation") {
4455
- super(message, 403, "PERMISSION_DENIED");
4456
- }
4457
- };
4458
-
4459
- // tools/github/core.ts
4460
- var DEFAULT_BASE_URL2 = "https://api.morphllm.com";
4461
- var DEFAULT_TIMEOUT5 = 3e4;
4462
- var GitHubClient = class extends APIResource {
4463
- timeout;
4464
- debug;
4465
- defaultInstallationId;
4466
- /** Installation operations */
4467
- installations;
4468
- /** Repository operations */
4469
- repos;
4470
- /** Project operations (monorepo sub-projects) */
4471
- projects;
4472
- /** Pull request operations */
4473
- pullRequests;
4474
- /** Deployment operations */
4475
- deployments;
4476
- /** Comment operations */
4477
- comments;
4478
- /** Check run operations */
4479
- checkRuns;
4480
- /**
4481
- * Get the GitHub App installation URL.
4482
- * Users visit this URL once to install the Morph GitHub App on their account/org.
4483
- */
4484
- getInstallUrl() {
4485
- return "https://github.com/apps/morph-subagents/installations/new";
4486
- }
4487
- constructor(clientOrConfig = {}, options = {}) {
4488
- const isClient = clientOrConfig instanceof MorphAPIClient;
4489
- const config = isClient ? {} : clientOrConfig;
4490
- super(
4491
- isClient ? clientOrConfig : new MorphAPIClient({
4492
- apiKey: config.apiKey,
4493
- baseURL: config.baseUrl ?? DEFAULT_BASE_URL2,
4494
- timeout: config.timeout ?? DEFAULT_TIMEOUT5,
4495
- debug: config.debug
4496
- })
4497
- );
4498
- this.timeout = config.timeout || DEFAULT_TIMEOUT5;
4499
- this.debug = config.debug || false;
4500
- this.defaultInstallationId = isClient ? options.installationId : config.installationId;
4501
- if (!this._client.resolveApiKey()) {
4502
- throw new Error("API key required. Set MORPH_API_KEY or pass apiKey in config.");
4503
- }
4504
- this.installations = {
4505
- list: this.listInstallations.bind(this),
4506
- get: this.getInstallation.bind(this),
4507
- update: this.updateInstallation.bind(this),
4508
- disconnect: this.disconnectInstallation.bind(this)
4509
- };
4510
- this.repos = {
4511
- list: this.listRepos.bind(this),
4512
- get: this.getRepo.bind(this),
4513
- update: this.updateRepo.bind(this),
4514
- remove: this.removeRepo.bind(this),
4515
- sync: this.syncRepos.bind(this)
4516
- };
4517
- this.projects = {
4518
- list: this.listProjects.bind(this),
4519
- create: this.createProject.bind(this),
4520
- update: this.updateProject.bind(this),
4521
- delete: this.deleteProject.bind(this)
4522
- };
4523
- this.pullRequests = {
4524
- list: this.listPullRequests.bind(this),
4525
- get: this.getPullRequest.bind(this)
4526
- };
4527
- this.deployments = {
4528
- list: this.listDeployments.bind(this)
4529
- };
4530
- this.comments = {
4531
- list: this.listComments.bind(this),
4532
- create: this.createComment.bind(this),
4533
- update: this.updateComment.bind(this),
4534
- delete: this.deleteComment.bind(this)
4535
- };
4536
- this.checkRuns = {
4537
- create: this.createCheckRun.bind(this),
4538
- update: this.updateCheckRun.bind(this)
4539
- };
4540
- }
4541
- /**
4542
- * Make an authenticated API request
4543
- */
4544
- async request(method, path6, body) {
4545
- if (this.debug) {
4546
- console.log(`[GitHub SDK] ${method} ${path6}`, body || "");
4547
- }
4548
- let response;
4549
- try {
4550
- response = await this._client.request(method, path6, {
4551
- body,
4552
- timeout: this.timeout,
4553
- raw: true
4554
- });
4555
- } catch (error) {
4556
- if (error instanceof Error && /timed out/i.test(error.message)) {
4557
- throw new GitHubError("Request timeout", 408, "TIMEOUT");
4558
- }
4559
- throw new GitHubError(error instanceof Error ? error.message : "Unknown error", 500, "UNKNOWN");
4560
- }
4561
- if (!response.ok) {
4562
- const errorData = await response.json().catch(() => ({}));
4563
- const message = errorData.error || errorData.detail || errorData.message || response.statusText;
4564
- if (this.debug) {
4565
- console.error(`[GitHub SDK] Error ${response.status}:`, message);
4566
- }
4567
- if (response.status === 404) {
4568
- if (message.includes("installation")) {
4569
- throw new NoInstallationError(message);
4570
- }
4571
- throw new NotFoundError(message);
4572
- }
4573
- if (response.status === 403) {
4574
- throw new PermissionError(message);
4575
- }
4576
- throw new GitHubError(message, response.status, errorData.code);
4577
- }
4578
- const data = await response.json();
4579
- if (this.debug) {
4580
- console.log(`[GitHub SDK] Response:`, JSON.stringify(data).slice(0, 200));
4581
- }
4582
- return data;
4583
- }
4584
- /**
4585
- * Get the installation ID to use for a request
4586
- */
4587
- getInstallationId(input) {
4588
- return input?.installationId || this.defaultInstallationId;
4589
- }
4590
- // ==========================================================================
4591
- // Installations
4592
- // ==========================================================================
4593
- async listInstallations() {
4594
- return this.request("GET", "/api/v1/github/installations");
4595
- }
4596
- async getInstallation(installationId) {
4597
- return this.request("GET", `/api/v1/github/installations/${installationId}`);
4598
- }
4599
- async updateInstallation(input) {
4600
- if (this.debug) console.log("[GitHub SDK] updateInstallation", input.installationId);
4601
- const { installationId, ...body } = input;
4602
- return this.request("PATCH", `/api/v1/github/installations/${installationId}`, body);
4603
- }
4604
- async disconnectInstallation(installationId) {
4605
- if (this.debug) console.log("[GitHub SDK] disconnectInstallation", installationId);
4606
- return this.request("DELETE", `/api/v1/github/installations/${installationId}`);
4607
- }
4608
- // ==========================================================================
4609
- // Repositories
4610
- // ==========================================================================
4611
- async listRepos(input) {
4612
- const installationId = input.installationId || this.defaultInstallationId;
4613
- if (!installationId) {
4614
- throw new NoInstallationError("installationId required. Call installations.list() first.");
4615
- }
4616
- return this.request("GET", `/api/v1/github/installations/${installationId}/repos`);
4617
- }
4618
- async getRepo(repoId) {
4619
- if (this.debug) console.log("[GitHub SDK] getRepo", repoId);
4620
- return this.request("GET", `/api/v1/github/repos/${repoId}`);
4621
- }
4622
- async updateRepo(input) {
4623
- if (this.debug) console.log("[GitHub SDK] updateRepo", input.repoId);
4624
- const { repoId, ...body } = input;
4625
- return this.request("PATCH", `/api/v1/github/repos/${repoId}`, body);
4626
- }
4627
- async removeRepo(repoId) {
4628
- if (this.debug) console.log("[GitHub SDK] removeRepo", repoId);
4629
- return this.request("DELETE", `/api/v1/github/repos/${repoId}`);
4630
- }
4631
- async syncRepos(input) {
4632
- const installationId = input.installationId || this.defaultInstallationId;
4633
- if (!installationId) {
4634
- throw new NoInstallationError("installationId required. Call installations.list() first.");
4635
- }
4636
- if (this.debug) console.log("[GitHub SDK] syncRepos", installationId);
4637
- return this.request("POST", `/api/v1/github/installations/${installationId}/repos/sync`);
4638
- }
4639
- // ==========================================================================
4640
- // Projects (monorepo sub-projects)
4641
- // ==========================================================================
4642
- async listProjects(input) {
4643
- if (this.debug) console.log("[GitHub SDK] listProjects", input.repoId);
4644
- return this.request("GET", `/api/v1/github/repos/${input.repoId}/projects`);
4645
- }
4646
- async createProject(input) {
4647
- if (this.debug) console.log("[GitHub SDK] createProject", input.repoId, input.name);
4648
- const { repoId, ...body } = input;
4649
- return this.request("POST", `/api/v1/github/repos/${repoId}/projects`, body);
4650
- }
4651
- async updateProject(input) {
4652
- if (this.debug) console.log("[GitHub SDK] updateProject", input.projectId);
4653
- const { projectId, ...body } = input;
4654
- return this.request("PATCH", `/api/v1/github/projects/${projectId}`, body);
4655
- }
4656
- async deleteProject(projectId) {
4657
- if (this.debug) console.log("[GitHub SDK] deleteProject", projectId);
4658
- return this.request("DELETE", `/api/v1/github/projects/${projectId}`);
4659
- }
4660
- // ==========================================================================
4661
- // Pull Requests
4662
- // ==========================================================================
4663
- async listPullRequests(input) {
4664
- const installationId = this.getInstallationId(input);
4665
- const params = new URLSearchParams({
4666
- owner: input.owner,
4667
- repo: input.repo,
4668
- ...input.state && { state: input.state },
4669
- ...installationId && { installationId }
4670
- });
4671
- return this.request("GET", `/api/v1/github/pulls?${params}`);
4672
- }
4673
- async getPullRequest(input) {
4674
- const installationId = this.getInstallationId(input);
4675
- const params = new URLSearchParams({
4676
- owner: input.owner,
4677
- repo: input.repo,
4678
- ...installationId && { installationId }
4679
- });
4680
- return this.request(
4681
- "GET",
4682
- `/api/v1/github/pulls/${input.number}?${params}`
4683
- );
4684
- }
4685
- // ==========================================================================
4686
- // Deployments
4687
- // ==========================================================================
4688
- async listDeployments(input) {
4689
- const installationId = this.getInstallationId(input);
4690
- const params = new URLSearchParams({
4691
- owner: input.owner,
4692
- repo: input.repo,
4693
- ...input.sha && { sha: input.sha },
4694
- ...input.environment && { environment: input.environment },
4695
- ...installationId && { installationId }
4696
- });
4697
- return this.request("GET", `/api/v1/github/deployments?${params}`);
4698
- }
4699
- // ==========================================================================
4700
- // Comments
4701
- // ==========================================================================
4702
- async listComments(input) {
4703
- const installationId = this.getInstallationId(input);
4704
- const params = new URLSearchParams({
4705
- owner: input.owner,
4706
- repo: input.repo,
4707
- pr: String(input.pr),
4708
- ...installationId && { installationId }
4709
- });
4710
- return this.request("GET", `/api/v1/github/comments?${params}`);
4711
- }
4712
- async createComment(input) {
4713
- const installationId = this.getInstallationId(input);
4714
- return this.request("POST", "/api/v1/github/comments", {
4715
- owner: input.owner,
4716
- repo: input.repo,
4717
- pr: input.pr,
4718
- body: input.body,
4719
- ...installationId && { installationId }
4720
- });
4721
- }
4722
- async updateComment(input) {
4723
- const installationId = this.getInstallationId(input);
4724
- return this.request("PATCH", `/api/v1/github/comments/${input.commentId}`, {
4725
- owner: input.owner,
4726
- repo: input.repo,
4727
- body: input.body,
4728
- ...installationId && { installationId }
4729
- });
4730
- }
4731
- async deleteComment(input) {
4732
- const installationId = this.getInstallationId(input);
4733
- const params = new URLSearchParams({
4734
- owner: input.owner,
4735
- repo: input.repo,
4736
- ...installationId && { installationId }
4737
- });
4738
- await this.request("DELETE", `/api/v1/github/comments/${input.commentId}?${params}`);
4739
- }
4740
- // ==========================================================================
4741
- // Check Runs
4742
- // ==========================================================================
4743
- async createCheckRun(input) {
4744
- const installationId = this.getInstallationId(input);
4745
- return this.request("POST", "/api/v1/github/check-runs", {
4746
- owner: input.owner,
4747
- repo: input.repo,
4748
- sha: input.sha,
4749
- name: input.name,
4750
- status: input.status,
4751
- ...input.title && { title: input.title },
4752
- ...input.summary && { summary: input.summary },
4753
- ...installationId && { installationId }
4754
- });
4755
- }
4756
- async updateCheckRun(input) {
4757
- const installationId = this.getInstallationId(input);
4758
- return this.request("PATCH", `/api/v1/github/check-runs/${input.checkRunId}`, {
4759
- owner: input.owner,
4760
- repo: input.repo,
4761
- ...input.status && { status: input.status },
4762
- ...input.conclusion && { conclusion: input.conclusion },
4763
- ...input.title && { title: input.title },
4764
- ...input.summary && { summary: input.summary },
4765
- ...input.text && { text: input.text },
4766
- ...installationId && { installationId }
4767
- });
4768
- }
4769
- };
4770
-
4771
3139
  // modelrouter/core.ts
4772
3140
  init_logger();
4773
- var DEFAULT_API_URL5 = "https://api.morphllm.com";
4774
- var DEFAULT_TIMEOUT6 = 5e3;
3141
+ var DEFAULT_API_URL4 = "https://api.morphllm.com";
3142
+ var DEFAULT_TIMEOUT5 = 5e3;
4775
3143
  function resolveClient2(clientOrConfig) {
4776
3144
  if (clientOrConfig instanceof MorphAPIClient) return clientOrConfig;
4777
3145
  return new MorphAPIClient({
4778
3146
  apiKey: clientOrConfig.apiKey,
4779
- baseURL: clientOrConfig.apiUrl ?? DEFAULT_API_URL5,
4780
- timeout: clientOrConfig.timeout ?? DEFAULT_TIMEOUT6,
3147
+ baseURL: clientOrConfig.apiUrl ?? DEFAULT_API_URL4,
3148
+ timeout: clientOrConfig.timeout ?? DEFAULT_TIMEOUT5,
4781
3149
  retryConfig: clientOrConfig.retryConfig,
4782
3150
  debug: clientOrConfig.debug
4783
3151
  });
@@ -4789,7 +3157,7 @@ var BaseRouter = class extends APIResource {
4789
3157
  super(resolveClient2(clientOrConfig));
4790
3158
  this.provider = provider;
4791
3159
  const cfg = clientOrConfig instanceof MorphAPIClient ? {} : clientOrConfig;
4792
- this.timeout = cfg.timeout ?? DEFAULT_TIMEOUT6;
3160
+ this.timeout = cfg.timeout ?? DEFAULT_TIMEOUT5;
4793
3161
  }
4794
3162
  /** Throw the historical "API key is required" message when no key is resolvable. */
4795
3163
  requireApiKey() {
@@ -4895,7 +3263,7 @@ var RouterClassifier = class extends APIResource {
4895
3263
  constructor(clientOrConfig = {}) {
4896
3264
  super(resolveClient2(clientOrConfig));
4897
3265
  const cfg = clientOrConfig instanceof MorphAPIClient ? {} : clientOrConfig;
4898
- this.timeout = cfg.timeout ?? DEFAULT_TIMEOUT6;
3266
+ this.timeout = cfg.timeout ?? DEFAULT_TIMEOUT5;
4899
3267
  }
4900
3268
  /** Classify an input across the requested axes (all three by default). */
4901
3269
  async classify(input) {
@@ -6313,10 +4681,6 @@ var MorphClient = class extends MorphAPIClient {
6313
4681
  codebaseSearch;
6314
4682
  /** WarpGrep tool for fast code search using ripgrep */
6315
4683
  warpGrep;
6316
- /** Browser tool for AI-powered browser automation */
6317
- browser;
6318
- /** GitHub tool for PR context, comments, and check runs */
6319
- github;
6320
4684
  /** Model routers for intelligent model selection */
6321
4685
  routers;
6322
4686
  /** OpenAI-compatible tool factories */
@@ -6356,8 +4720,6 @@ var MorphClient = class extends MorphAPIClient {
6356
4720
  this.fastApply = new FastApplyClient(this);
6357
4721
  this.codebaseSearch = new CodebaseSearchClient(this);
6358
4722
  this.warpGrep = new WarpGrepClient(this);
6359
- this.browser = new BrowserClient(this);
6360
- this.github = new GitHubClient(this, { installationId: config.github?.installationId });
6361
4723
  this.routers = {
6362
4724
  openai: new OpenAIRouter(this),
6363
4725
  anthropic: new AnthropicRouter(this),
@@ -6413,23 +4775,17 @@ var warpGrepInputSchema = import_zod5.z.object({
6413
4775
  APIResource,
6414
4776
  AnthropicRouter,
6415
4777
  AnthropicToolFactory,
6416
- BrowserClient,
6417
4778
  CodebaseSearchClient,
6418
4779
  CompactClient,
6419
4780
  FastApplyAnchorIntegrityError,
6420
4781
  FastApplyClient,
6421
4782
  FastApplyContextLengthError,
6422
4783
  GeminiRouter,
6423
- GitHubClient,
6424
- GitHubError,
6425
4784
  LocalRipgrepProvider,
6426
4785
  MorphAPIClient,
6427
4786
  MorphClient,
6428
- NoInstallationError,
6429
- NotFoundError,
6430
4787
  OpenAIRouter,
6431
4788
  OpenAIToolFactory,
6432
- PermissionError,
6433
4789
  RawRouter,
6434
4790
  SDK_VERSION,
6435
4791
  VercelToolFactory,