@morphllm/morphsdk 0.2.197 → 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 (301) hide show
  1. package/README.md +1 -147
  2. package/dist/{chunk-GE5MNVT7.js → chunk-5KQ2WRBU.js} +2 -2
  3. package/dist/{chunk-LKFZBBTD.js → chunk-5TOJD2C5.js} +1 -1
  4. package/dist/chunk-5TOJD2C5.js.map +1 -0
  5. package/dist/{chunk-PQCOBN7L.js → chunk-7UU4NF4G.js} +4 -10
  6. package/dist/chunk-7UU4NF4G.js.map +1 -0
  7. package/dist/{chunk-6YZCPCAY.js → chunk-BLCCGRKT.js} +2 -2
  8. package/dist/{chunk-2BT4UGKH.js → chunk-BTMMUG3E.js} +2 -2
  9. package/dist/{chunk-VJD6MF3M.js → chunk-CEXBKXWU.js} +4 -4
  10. package/dist/{chunk-UOS3XKJD.js → chunk-DP2PT36G.js} +2 -2
  11. package/dist/{chunk-CZ74CRGH.js → chunk-EMURAU6J.js} +4 -6
  12. package/dist/chunk-EMURAU6J.js.map +1 -0
  13. package/dist/chunk-GKRPR5PZ.js +322 -0
  14. package/dist/chunk-GKRPR5PZ.js.map +1 -0
  15. package/dist/{chunk-DNL4DMMS.js → chunk-GTV27THY.js} +2 -2
  16. package/dist/{chunk-ATAKRJQZ.js → chunk-IDMKQWQG.js} +1 -36
  17. package/dist/chunk-IDMKQWQG.js.map +1 -0
  18. package/dist/{chunk-EGI642TV.js → chunk-JOC3ZI56.js} +3 -39
  19. package/dist/chunk-JOC3ZI56.js.map +1 -0
  20. package/dist/{chunk-VGCPVDFP.js → chunk-K2JR2NFQ.js} +4 -4
  21. package/dist/{chunk-DHGXGVHC.js → chunk-KXEPBLVD.js} +8 -8
  22. package/dist/{chunk-SVD3YRWM.js → chunk-MEZTHMB2.js} +4 -4
  23. package/dist/{chunk-BECYWCEZ.js → chunk-O7LJEVZO.js} +2 -2
  24. package/dist/{chunk-7QOGUY4A.js → chunk-PKJ7ODTG.js} +4 -4
  25. package/dist/{chunk-2HXELZI5.js → chunk-PW6K6OJL.js} +2 -2
  26. package/dist/chunk-PW6K6OJL.js.map +1 -0
  27. package/dist/{chunk-YVKRPVOM.js → chunk-Q3NH3NPD.js} +2 -2
  28. package/dist/{chunk-ZA3UJRSE.js → chunk-RL3ZTXT3.js} +4 -4
  29. package/dist/{chunk-WN6YLBEH.js → chunk-ULHHMZRL.js} +4 -4
  30. package/dist/{chunk-TJUZAO7T.js → chunk-UT3NQLCF.js} +2 -2
  31. package/dist/{chunk-DW6ZIVCM.js → chunk-VS5F2ORN.js} +4 -4
  32. package/dist/{chunk-UZA2ODNU.js → chunk-W37OFBSG.js} +2 -2
  33. package/dist/{chunk-JU6TCHVI.js → chunk-WDBYAXZ5.js} +2 -2
  34. package/dist/{chunk-2XDSHAB5.js → chunk-YSFEKIYQ.js} +2 -2
  35. package/dist/{chunk-WDLDKJHT.js → chunk-ZHB57ORD.js} +6 -6
  36. package/dist/client-CGW0Cevz.d.ts +402 -0
  37. package/dist/client.cjs +195 -2068
  38. package/dist/client.cjs.map +1 -1
  39. package/dist/client.d.ts +3 -11
  40. package/dist/client.js +28 -35
  41. package/dist/core/client.cjs +2 -44
  42. package/dist/core/client.cjs.map +1 -1
  43. package/dist/core/client.d.ts +2 -10
  44. package/dist/core/client.js +4 -4
  45. package/dist/core/error.cjs +2 -38
  46. package/dist/core/error.cjs.map +1 -1
  47. package/dist/core/error.d.ts +1 -1
  48. package/dist/core/error.js +3 -3
  49. package/dist/core/index.cjs +2 -44
  50. package/dist/core/index.cjs.map +1 -1
  51. package/dist/core/index.js +5 -5
  52. package/dist/core/resource.cjs.map +1 -1
  53. package/dist/core/resource.d.ts +1 -1
  54. package/dist/core/resource.js +1 -1
  55. package/dist/edge.cjs +2 -44
  56. package/dist/edge.cjs.map +1 -1
  57. package/dist/edge.js +8 -8
  58. package/dist/index.cjs +195 -2086
  59. package/dist/index.cjs.map +1 -1
  60. package/dist/index.d.ts +1 -9
  61. package/dist/index.js +30 -58
  62. package/dist/modelrouter/core.cjs +2 -44
  63. package/dist/modelrouter/core.cjs.map +1 -1
  64. package/dist/modelrouter/core.js +6 -6
  65. package/dist/modelrouter/index.cjs +2 -44
  66. package/dist/modelrouter/index.cjs.map +1 -1
  67. package/dist/modelrouter/index.js +6 -6
  68. package/dist/subagents/anthropic.cjs +2 -44
  69. package/dist/subagents/anthropic.cjs.map +1 -1
  70. package/dist/subagents/anthropic.js +12 -12
  71. package/dist/subagents/vercel.cjs +2 -44
  72. package/dist/subagents/vercel.cjs.map +1 -1
  73. package/dist/subagents/vercel.js +12 -12
  74. package/dist/tools/codebase_search/anthropic.cjs +2 -44
  75. package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
  76. package/dist/tools/codebase_search/anthropic.js +7 -7
  77. package/dist/tools/codebase_search/core.cjs +2 -44
  78. package/dist/tools/codebase_search/core.cjs.map +1 -1
  79. package/dist/tools/codebase_search/core.js +6 -6
  80. package/dist/tools/codebase_search/index.cjs +2 -44
  81. package/dist/tools/codebase_search/index.cjs.map +1 -1
  82. package/dist/tools/codebase_search/index.js +11 -11
  83. package/dist/tools/codebase_search/openai.cjs +2 -44
  84. package/dist/tools/codebase_search/openai.cjs.map +1 -1
  85. package/dist/tools/codebase_search/openai.js +7 -7
  86. package/dist/tools/codebase_search/vercel.cjs +2 -44
  87. package/dist/tools/codebase_search/vercel.cjs.map +1 -1
  88. package/dist/tools/codebase_search/vercel.js +7 -7
  89. package/dist/tools/compact/core.cjs +2 -44
  90. package/dist/tools/compact/core.cjs.map +1 -1
  91. package/dist/tools/compact/core.js +6 -6
  92. package/dist/tools/compact/index.cjs +2 -44
  93. package/dist/tools/compact/index.cjs.map +1 -1
  94. package/dist/tools/compact/index.js +7 -7
  95. package/dist/tools/fastapply/anthropic.cjs +2 -38
  96. package/dist/tools/fastapply/anthropic.cjs.map +1 -1
  97. package/dist/tools/fastapply/anthropic.js +8 -8
  98. package/dist/tools/fastapply/apply.cjs +2 -38
  99. package/dist/tools/fastapply/apply.cjs.map +1 -1
  100. package/dist/tools/fastapply/apply.js +2 -2
  101. package/dist/tools/fastapply/core.cjs +2 -44
  102. package/dist/tools/fastapply/core.cjs.map +1 -1
  103. package/dist/tools/fastapply/core.js +7 -7
  104. package/dist/tools/fastapply/index.cjs +2 -38
  105. package/dist/tools/fastapply/index.cjs.map +1 -1
  106. package/dist/tools/fastapply/index.js +12 -12
  107. package/dist/tools/fastapply/openai.cjs +2 -38
  108. package/dist/tools/fastapply/openai.cjs.map +1 -1
  109. package/dist/tools/fastapply/openai.js +8 -8
  110. package/dist/tools/fastapply/vercel.cjs +2 -38
  111. package/dist/tools/fastapply/vercel.cjs.map +1 -1
  112. package/dist/tools/fastapply/vercel.js +8 -8
  113. package/dist/tools/index.cjs +2 -38
  114. package/dist/tools/index.cjs.map +1 -1
  115. package/dist/tools/index.js +12 -12
  116. package/dist/tools/utils/resilience.cjs +2 -38
  117. package/dist/tools/utils/resilience.cjs.map +1 -1
  118. package/dist/tools/utils/resilience.js +2 -2
  119. package/dist/tools/warp_grep/agent/runner.cjs +2 -38
  120. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  121. package/dist/tools/warp_grep/agent/runner.js +3 -3
  122. package/dist/tools/warp_grep/anthropic.cjs +2 -44
  123. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  124. package/dist/tools/warp_grep/anthropic.js +12 -12
  125. package/dist/tools/warp_grep/client.cjs +2 -44
  126. package/dist/tools/warp_grep/client.cjs.map +1 -1
  127. package/dist/tools/warp_grep/client.js +11 -11
  128. package/dist/tools/warp_grep/gemini.cjs +2 -44
  129. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  130. package/dist/tools/warp_grep/gemini.js +11 -11
  131. package/dist/tools/warp_grep/harness.js +7 -7
  132. package/dist/tools/warp_grep/index.cjs +2 -44
  133. package/dist/tools/warp_grep/index.cjs.map +1 -1
  134. package/dist/tools/warp_grep/index.js +14 -14
  135. package/dist/tools/warp_grep/openai.cjs +2 -44
  136. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  137. package/dist/tools/warp_grep/openai.js +12 -12
  138. package/dist/tools/warp_grep/vercel.cjs +2 -44
  139. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  140. package/dist/tools/warp_grep/vercel.js +12 -12
  141. package/dist/tracing/core.cjs +2 -34
  142. package/dist/tracing/core.cjs.map +1 -1
  143. package/dist/tracing/core.d.ts +1 -2
  144. package/dist/tracing/core.js +2 -2
  145. package/dist/tracing/index.cjs +4 -42
  146. package/dist/tracing/index.cjs.map +1 -1
  147. package/dist/tracing/index.d.ts +0 -34
  148. package/dist/tracing/index.js +3 -10
  149. package/dist/tracing/interaction.cjs +0 -30
  150. package/dist/tracing/interaction.cjs.map +1 -1
  151. package/dist/tracing/interaction.js +1 -1
  152. package/dist/tracing/types.cjs.map +1 -1
  153. package/dist/tracing/types.d.ts +1 -27
  154. package/dist/version.cjs +2 -38
  155. package/dist/version.cjs.map +1 -1
  156. package/dist/version.js +1 -1
  157. package/package.json +2 -38
  158. package/dist/anthropic-B6my2oBx.d.ts +0 -56
  159. package/dist/chunk-2AMEQAO2.js +0 -46
  160. package/dist/chunk-2AMEQAO2.js.map +0 -1
  161. package/dist/chunk-2HMEZZKK.js +0 -44
  162. package/dist/chunk-2HMEZZKK.js.map +0 -1
  163. package/dist/chunk-2HXELZI5.js.map +0 -1
  164. package/dist/chunk-2VERUKO2.js +0 -177
  165. package/dist/chunk-2VERUKO2.js.map +0 -1
  166. package/dist/chunk-4FWK3CEH.js +0 -692
  167. package/dist/chunk-4FWK3CEH.js.map +0 -1
  168. package/dist/chunk-ATAKRJQZ.js.map +0 -1
  169. package/dist/chunk-CZ74CRGH.js.map +0 -1
  170. package/dist/chunk-EGI642TV.js.map +0 -1
  171. package/dist/chunk-FLWBVHDC.js +0 -622
  172. package/dist/chunk-FLWBVHDC.js.map +0 -1
  173. package/dist/chunk-JZJY2XFQ.js +0 -96
  174. package/dist/chunk-JZJY2XFQ.js.map +0 -1
  175. package/dist/chunk-LKFZBBTD.js.map +0 -1
  176. package/dist/chunk-LRHJVSSD.js +0 -57
  177. package/dist/chunk-LRHJVSSD.js.map +0 -1
  178. package/dist/chunk-NKFAMQF2.js +0 -202
  179. package/dist/chunk-NKFAMQF2.js.map +0 -1
  180. package/dist/chunk-PQCOBN7L.js.map +0 -1
  181. package/dist/chunk-TCCZBGG5.js +0 -46
  182. package/dist/chunk-TCCZBGG5.js.map +0 -1
  183. package/dist/chunk-W34BUTVR.js +0 -389
  184. package/dist/chunk-W34BUTVR.js.map +0 -1
  185. package/dist/chunk-WFOGTZF6.js +0 -80
  186. package/dist/chunk-WFOGTZF6.js.map +0 -1
  187. package/dist/chunk-YTYCHRQ2.js +0 -106
  188. package/dist/chunk-YTYCHRQ2.js.map +0 -1
  189. package/dist/client-B3fWTCcL.d.ts +0 -1021
  190. package/dist/openai-BQMeDFef.d.ts +0 -81
  191. package/dist/tools/browser/anthropic.cjs +0 -655
  192. package/dist/tools/browser/anthropic.cjs.map +0 -1
  193. package/dist/tools/browser/anthropic.d.ts +0 -4
  194. package/dist/tools/browser/anthropic.js +0 -22
  195. package/dist/tools/browser/anthropic.js.map +0 -1
  196. package/dist/tools/browser/core.cjs +0 -1831
  197. package/dist/tools/browser/core.cjs.map +0 -1
  198. package/dist/tools/browser/core.d.ts +0 -245
  199. package/dist/tools/browser/core.js +0 -32
  200. package/dist/tools/browser/core.js.map +0 -1
  201. package/dist/tools/browser/errors.cjs +0 -208
  202. package/dist/tools/browser/errors.cjs.map +0 -1
  203. package/dist/tools/browser/errors.d.ts +0 -158
  204. package/dist/tools/browser/errors.js +0 -22
  205. package/dist/tools/browser/errors.js.map +0 -1
  206. package/dist/tools/browser/index.cjs +0 -2169
  207. package/dist/tools/browser/index.cjs.map +0 -1
  208. package/dist/tools/browser/index.d.ts +0 -134
  209. package/dist/tools/browser/index.js +0 -163
  210. package/dist/tools/browser/index.js.map +0 -1
  211. package/dist/tools/browser/live.cjs +0 -134
  212. package/dist/tools/browser/live.cjs.map +0 -1
  213. package/dist/tools/browser/live.d.ts +0 -75
  214. package/dist/tools/browser/live.js +0 -16
  215. package/dist/tools/browser/live.js.map +0 -1
  216. package/dist/tools/browser/openai.cjs +0 -671
  217. package/dist/tools/browser/openai.cjs.map +0 -1
  218. package/dist/tools/browser/openai.d.ts +0 -4
  219. package/dist/tools/browser/openai.js +0 -28
  220. package/dist/tools/browser/openai.js.map +0 -1
  221. package/dist/tools/browser/profiles/core.cjs +0 -942
  222. package/dist/tools/browser/profiles/core.cjs.map +0 -1
  223. package/dist/tools/browser/profiles/core.d.ts +0 -187
  224. package/dist/tools/browser/profiles/core.js +0 -30
  225. package/dist/tools/browser/profiles/core.js.map +0 -1
  226. package/dist/tools/browser/profiles/index.cjs +0 -942
  227. package/dist/tools/browser/profiles/index.cjs.map +0 -1
  228. package/dist/tools/browser/profiles/index.d.ts +0 -4
  229. package/dist/tools/browser/profiles/index.js +0 -30
  230. package/dist/tools/browser/profiles/index.js.map +0 -1
  231. package/dist/tools/browser/profiles/types.cjs +0 -74
  232. package/dist/tools/browser/profiles/types.cjs.map +0 -1
  233. package/dist/tools/browser/profiles/types.d.ts +0 -195
  234. package/dist/tools/browser/profiles/types.js +0 -16
  235. package/dist/tools/browser/profiles/types.js.map +0 -1
  236. package/dist/tools/browser/prompts.cjs +0 -69
  237. package/dist/tools/browser/prompts.cjs.map +0 -1
  238. package/dist/tools/browser/prompts.d.ts +0 -7
  239. package/dist/tools/browser/prompts.js +0 -10
  240. package/dist/tools/browser/prompts.js.map +0 -1
  241. package/dist/tools/browser/types.cjs +0 -19
  242. package/dist/tools/browser/types.cjs.map +0 -1
  243. package/dist/tools/browser/types.d.ts +0 -338
  244. package/dist/tools/browser/types.js +0 -1
  245. package/dist/tools/browser/types.js.map +0 -1
  246. package/dist/tools/browser/vercel.cjs +0 -632
  247. package/dist/tools/browser/vercel.cjs.map +0 -1
  248. package/dist/tools/browser/vercel.d.ts +0 -4
  249. package/dist/tools/browser/vercel.js +0 -22
  250. package/dist/tools/browser/vercel.js.map +0 -1
  251. package/dist/tools/reflex/core.cjs +0 -756
  252. package/dist/tools/reflex/core.cjs.map +0 -1
  253. package/dist/tools/reflex/core.d.ts +0 -59
  254. package/dist/tools/reflex/core.js +0 -16
  255. package/dist/tools/reflex/core.js.map +0 -1
  256. package/dist/tools/reflex/index.cjs +0 -756
  257. package/dist/tools/reflex/index.cjs.map +0 -1
  258. package/dist/tools/reflex/index.d.ts +0 -5
  259. package/dist/tools/reflex/index.js +0 -16
  260. package/dist/tools/reflex/index.js.map +0 -1
  261. package/dist/tools/reflex/types.cjs +0 -19
  262. package/dist/tools/reflex/types.cjs.map +0 -1
  263. package/dist/tools/reflex/types.d.ts +0 -171
  264. package/dist/tools/reflex/types.js +0 -1
  265. package/dist/tools/reflex/types.js.map +0 -1
  266. package/dist/tools/traces/core.cjs +0 -76
  267. package/dist/tools/traces/core.cjs.map +0 -1
  268. package/dist/tools/traces/core.d.ts +0 -24
  269. package/dist/tools/traces/core.js +0 -9
  270. package/dist/tools/traces/core.js.map +0 -1
  271. package/dist/tools/traces/index.cjs +0 -76
  272. package/dist/tools/traces/index.cjs.map +0 -1
  273. package/dist/tools/traces/index.d.ts +0 -5
  274. package/dist/tools/traces/index.js +0 -9
  275. package/dist/tools/traces/index.js.map +0 -1
  276. package/dist/tools/traces/types.cjs +0 -19
  277. package/dist/tools/traces/types.cjs.map +0 -1
  278. package/dist/tools/traces/types.d.ts +0 -56
  279. package/dist/tools/traces/types.js +0 -1
  280. package/dist/tools/traces/types.js.map +0 -1
  281. package/dist/vercel-CVF27qFK.d.ts +0 -74
  282. /package/dist/{chunk-GE5MNVT7.js.map → chunk-5KQ2WRBU.js.map} +0 -0
  283. /package/dist/{chunk-6YZCPCAY.js.map → chunk-BLCCGRKT.js.map} +0 -0
  284. /package/dist/{chunk-2BT4UGKH.js.map → chunk-BTMMUG3E.js.map} +0 -0
  285. /package/dist/{chunk-VJD6MF3M.js.map → chunk-CEXBKXWU.js.map} +0 -0
  286. /package/dist/{chunk-UOS3XKJD.js.map → chunk-DP2PT36G.js.map} +0 -0
  287. /package/dist/{chunk-DNL4DMMS.js.map → chunk-GTV27THY.js.map} +0 -0
  288. /package/dist/{chunk-VGCPVDFP.js.map → chunk-K2JR2NFQ.js.map} +0 -0
  289. /package/dist/{chunk-DHGXGVHC.js.map → chunk-KXEPBLVD.js.map} +0 -0
  290. /package/dist/{chunk-SVD3YRWM.js.map → chunk-MEZTHMB2.js.map} +0 -0
  291. /package/dist/{chunk-BECYWCEZ.js.map → chunk-O7LJEVZO.js.map} +0 -0
  292. /package/dist/{chunk-7QOGUY4A.js.map → chunk-PKJ7ODTG.js.map} +0 -0
  293. /package/dist/{chunk-YVKRPVOM.js.map → chunk-Q3NH3NPD.js.map} +0 -0
  294. /package/dist/{chunk-ZA3UJRSE.js.map → chunk-RL3ZTXT3.js.map} +0 -0
  295. /package/dist/{chunk-WN6YLBEH.js.map → chunk-ULHHMZRL.js.map} +0 -0
  296. /package/dist/{chunk-TJUZAO7T.js.map → chunk-UT3NQLCF.js.map} +0 -0
  297. /package/dist/{chunk-DW6ZIVCM.js.map → chunk-VS5F2ORN.js.map} +0 -0
  298. /package/dist/{chunk-UZA2ODNU.js.map → chunk-W37OFBSG.js.map} +0 -0
  299. /package/dist/{chunk-JU6TCHVI.js.map → chunk-WDBYAXZ5.js.map} +0 -0
  300. /package/dist/{chunk-2XDSHAB5.js.map → chunk-YSFEKIYQ.js.map} +0 -0
  301. /package/dist/{chunk-WDLDKJHT.js.map → chunk-ZHB57ORD.js.map} +0 -0
@@ -1,692 +0,0 @@
1
- import {
2
- createGitHubSearchTool as createGitHubSearchTool2,
3
- createWarpGrepTool as createWarpGrepTool2
4
- } from "./chunk-2XDSHAB5.js";
5
- import {
6
- createGitHubSearchTool,
7
- createWarpGrepTool
8
- } from "./chunk-UZA2ODNU.js";
9
- import {
10
- createGitHubSearchTool as createGitHubSearchTool3,
11
- createWarpGrepTool as createWarpGrepTool3
12
- } from "./chunk-TJUZAO7T.js";
13
- import {
14
- ReflexClient
15
- } from "./chunk-NKFAMQF2.js";
16
- import {
17
- TracesClient
18
- } from "./chunk-TCCZBGG5.js";
19
- import {
20
- createCodebaseSearchTool
21
- } from "./chunk-VGCPVDFP.js";
22
- import {
23
- createCodebaseSearchTool as createCodebaseSearchTool3
24
- } from "./chunk-ZA3UJRSE.js";
25
- import {
26
- createCodebaseSearchTool as createCodebaseSearchTool2
27
- } from "./chunk-SVD3YRWM.js";
28
- import {
29
- CodebaseSearchClient
30
- } from "./chunk-DW6ZIVCM.js";
31
- import {
32
- createEditFileTool as createEditFileTool3
33
- } from "./chunk-YVKRPVOM.js";
34
- import {
35
- createEditFileTool as createEditFileTool2
36
- } from "./chunk-BECYWCEZ.js";
37
- import {
38
- createEditFileTool
39
- } from "./chunk-6YZCPCAY.js";
40
- import {
41
- FastApplyClient
42
- } from "./chunk-WN6YLBEH.js";
43
- import {
44
- BrowserClient
45
- } from "./chunk-FLWBVHDC.js";
46
- import {
47
- createExploreSubagent
48
- } from "./chunk-GE5MNVT7.js";
49
- import {
50
- createExploreSubagent as createExploreSubagent2
51
- } from "./chunk-JU6TCHVI.js";
52
- import {
53
- WarpGrepClient
54
- } from "./chunk-DHGXGVHC.js";
55
- import {
56
- AnthropicRouter,
57
- GeminiRouter,
58
- OpenAIRouter,
59
- RawRouter,
60
- RouterClassifier
61
- } from "./chunk-7QOGUY4A.js";
62
- import {
63
- CompactClient
64
- } from "./chunk-VJD6MF3M.js";
65
- import {
66
- MorphAPIClient
67
- } from "./chunk-PQCOBN7L.js";
68
- import {
69
- logger
70
- } from "./chunk-F3NCFNUX.js";
71
- import {
72
- APIResource
73
- } from "./chunk-LKFZBBTD.js";
74
-
75
- // tools/github/types.ts
76
- var GitHubError = class extends Error {
77
- /** HTTP status code */
78
- status;
79
- /** Error code from API */
80
- code;
81
- constructor(message, status, code) {
82
- super(message);
83
- this.name = "GitHubError";
84
- this.status = status;
85
- this.code = code;
86
- }
87
- };
88
- var NoInstallationError = class extends GitHubError {
89
- constructor(message = "No GitHub installation found. Connect GitHub at morphllm.com/dashboard/integrations/github") {
90
- super(message, 404, "NO_INSTALLATION");
91
- }
92
- };
93
- var NotFoundError = class extends GitHubError {
94
- constructor(resource) {
95
- super(`${resource} not found`, 404, "NOT_FOUND");
96
- }
97
- };
98
- var PermissionError = class extends GitHubError {
99
- constructor(message = "Insufficient permissions for this operation") {
100
- super(message, 403, "PERMISSION_DENIED");
101
- }
102
- };
103
-
104
- // tools/github/core.ts
105
- var DEFAULT_BASE_URL = "https://api.morphllm.com";
106
- var DEFAULT_TIMEOUT = 3e4;
107
- var GitHubClient = class extends APIResource {
108
- timeout;
109
- debug;
110
- defaultInstallationId;
111
- /** Installation operations */
112
- installations;
113
- /** Repository operations */
114
- repos;
115
- /** Project operations (monorepo sub-projects) */
116
- projects;
117
- /** Pull request operations */
118
- pullRequests;
119
- /** Deployment operations */
120
- deployments;
121
- /** Comment operations */
122
- comments;
123
- /** Check run operations */
124
- checkRuns;
125
- /**
126
- * Get the GitHub App installation URL.
127
- * Users visit this URL once to install the Morph GitHub App on their account/org.
128
- */
129
- getInstallUrl() {
130
- return "https://github.com/apps/morph-subagents/installations/new";
131
- }
132
- constructor(clientOrConfig = {}, options = {}) {
133
- const isClient = clientOrConfig instanceof MorphAPIClient;
134
- const config = isClient ? {} : clientOrConfig;
135
- super(
136
- isClient ? clientOrConfig : new MorphAPIClient({
137
- apiKey: config.apiKey,
138
- baseURL: config.baseUrl ?? DEFAULT_BASE_URL,
139
- timeout: config.timeout ?? DEFAULT_TIMEOUT,
140
- debug: config.debug
141
- })
142
- );
143
- this.timeout = config.timeout || DEFAULT_TIMEOUT;
144
- this.debug = config.debug || false;
145
- this.defaultInstallationId = isClient ? options.installationId : config.installationId;
146
- if (!this._client.resolveApiKey()) {
147
- throw new Error("API key required. Set MORPH_API_KEY or pass apiKey in config.");
148
- }
149
- this.installations = {
150
- list: this.listInstallations.bind(this),
151
- get: this.getInstallation.bind(this),
152
- update: this.updateInstallation.bind(this),
153
- disconnect: this.disconnectInstallation.bind(this)
154
- };
155
- this.repos = {
156
- list: this.listRepos.bind(this),
157
- get: this.getRepo.bind(this),
158
- update: this.updateRepo.bind(this),
159
- remove: this.removeRepo.bind(this),
160
- sync: this.syncRepos.bind(this)
161
- };
162
- this.projects = {
163
- list: this.listProjects.bind(this),
164
- create: this.createProject.bind(this),
165
- update: this.updateProject.bind(this),
166
- delete: this.deleteProject.bind(this)
167
- };
168
- this.pullRequests = {
169
- list: this.listPullRequests.bind(this),
170
- get: this.getPullRequest.bind(this)
171
- };
172
- this.deployments = {
173
- list: this.listDeployments.bind(this)
174
- };
175
- this.comments = {
176
- list: this.listComments.bind(this),
177
- create: this.createComment.bind(this),
178
- update: this.updateComment.bind(this),
179
- delete: this.deleteComment.bind(this)
180
- };
181
- this.checkRuns = {
182
- create: this.createCheckRun.bind(this),
183
- update: this.updateCheckRun.bind(this)
184
- };
185
- }
186
- /**
187
- * Make an authenticated API request
188
- */
189
- async request(method, path, body) {
190
- if (this.debug) {
191
- console.log(`[GitHub SDK] ${method} ${path}`, body || "");
192
- }
193
- let response;
194
- try {
195
- response = await this._client.request(method, path, {
196
- body,
197
- timeout: this.timeout,
198
- raw: true
199
- });
200
- } catch (error) {
201
- if (error instanceof Error && /timed out/i.test(error.message)) {
202
- throw new GitHubError("Request timeout", 408, "TIMEOUT");
203
- }
204
- throw new GitHubError(error instanceof Error ? error.message : "Unknown error", 500, "UNKNOWN");
205
- }
206
- if (!response.ok) {
207
- const errorData = await response.json().catch(() => ({}));
208
- const message = errorData.error || errorData.detail || errorData.message || response.statusText;
209
- if (this.debug) {
210
- console.error(`[GitHub SDK] Error ${response.status}:`, message);
211
- }
212
- if (response.status === 404) {
213
- if (message.includes("installation")) {
214
- throw new NoInstallationError(message);
215
- }
216
- throw new NotFoundError(message);
217
- }
218
- if (response.status === 403) {
219
- throw new PermissionError(message);
220
- }
221
- throw new GitHubError(message, response.status, errorData.code);
222
- }
223
- const data = await response.json();
224
- if (this.debug) {
225
- console.log(`[GitHub SDK] Response:`, JSON.stringify(data).slice(0, 200));
226
- }
227
- return data;
228
- }
229
- /**
230
- * Get the installation ID to use for a request
231
- */
232
- getInstallationId(input) {
233
- return input?.installationId || this.defaultInstallationId;
234
- }
235
- // ==========================================================================
236
- // Installations
237
- // ==========================================================================
238
- async listInstallations() {
239
- return this.request("GET", "/api/v1/github/installations");
240
- }
241
- async getInstallation(installationId) {
242
- return this.request("GET", `/api/v1/github/installations/${installationId}`);
243
- }
244
- async updateInstallation(input) {
245
- if (this.debug) console.log("[GitHub SDK] updateInstallation", input.installationId);
246
- const { installationId, ...body } = input;
247
- return this.request("PATCH", `/api/v1/github/installations/${installationId}`, body);
248
- }
249
- async disconnectInstallation(installationId) {
250
- if (this.debug) console.log("[GitHub SDK] disconnectInstallation", installationId);
251
- return this.request("DELETE", `/api/v1/github/installations/${installationId}`);
252
- }
253
- // ==========================================================================
254
- // Repositories
255
- // ==========================================================================
256
- async listRepos(input) {
257
- const installationId = input.installationId || this.defaultInstallationId;
258
- if (!installationId) {
259
- throw new NoInstallationError("installationId required. Call installations.list() first.");
260
- }
261
- return this.request("GET", `/api/v1/github/installations/${installationId}/repos`);
262
- }
263
- async getRepo(repoId) {
264
- if (this.debug) console.log("[GitHub SDK] getRepo", repoId);
265
- return this.request("GET", `/api/v1/github/repos/${repoId}`);
266
- }
267
- async updateRepo(input) {
268
- if (this.debug) console.log("[GitHub SDK] updateRepo", input.repoId);
269
- const { repoId, ...body } = input;
270
- return this.request("PATCH", `/api/v1/github/repos/${repoId}`, body);
271
- }
272
- async removeRepo(repoId) {
273
- if (this.debug) console.log("[GitHub SDK] removeRepo", repoId);
274
- return this.request("DELETE", `/api/v1/github/repos/${repoId}`);
275
- }
276
- async syncRepos(input) {
277
- const installationId = input.installationId || this.defaultInstallationId;
278
- if (!installationId) {
279
- throw new NoInstallationError("installationId required. Call installations.list() first.");
280
- }
281
- if (this.debug) console.log("[GitHub SDK] syncRepos", installationId);
282
- return this.request("POST", `/api/v1/github/installations/${installationId}/repos/sync`);
283
- }
284
- // ==========================================================================
285
- // Projects (monorepo sub-projects)
286
- // ==========================================================================
287
- async listProjects(input) {
288
- if (this.debug) console.log("[GitHub SDK] listProjects", input.repoId);
289
- return this.request("GET", `/api/v1/github/repos/${input.repoId}/projects`);
290
- }
291
- async createProject(input) {
292
- if (this.debug) console.log("[GitHub SDK] createProject", input.repoId, input.name);
293
- const { repoId, ...body } = input;
294
- return this.request("POST", `/api/v1/github/repos/${repoId}/projects`, body);
295
- }
296
- async updateProject(input) {
297
- if (this.debug) console.log("[GitHub SDK] updateProject", input.projectId);
298
- const { projectId, ...body } = input;
299
- return this.request("PATCH", `/api/v1/github/projects/${projectId}`, body);
300
- }
301
- async deleteProject(projectId) {
302
- if (this.debug) console.log("[GitHub SDK] deleteProject", projectId);
303
- return this.request("DELETE", `/api/v1/github/projects/${projectId}`);
304
- }
305
- // ==========================================================================
306
- // Pull Requests
307
- // ==========================================================================
308
- async listPullRequests(input) {
309
- const installationId = this.getInstallationId(input);
310
- const params = new URLSearchParams({
311
- owner: input.owner,
312
- repo: input.repo,
313
- ...input.state && { state: input.state },
314
- ...installationId && { installationId }
315
- });
316
- return this.request("GET", `/api/v1/github/pulls?${params}`);
317
- }
318
- async getPullRequest(input) {
319
- const installationId = this.getInstallationId(input);
320
- const params = new URLSearchParams({
321
- owner: input.owner,
322
- repo: input.repo,
323
- ...installationId && { installationId }
324
- });
325
- return this.request(
326
- "GET",
327
- `/api/v1/github/pulls/${input.number}?${params}`
328
- );
329
- }
330
- // ==========================================================================
331
- // Deployments
332
- // ==========================================================================
333
- async listDeployments(input) {
334
- const installationId = this.getInstallationId(input);
335
- const params = new URLSearchParams({
336
- owner: input.owner,
337
- repo: input.repo,
338
- ...input.sha && { sha: input.sha },
339
- ...input.environment && { environment: input.environment },
340
- ...installationId && { installationId }
341
- });
342
- return this.request("GET", `/api/v1/github/deployments?${params}`);
343
- }
344
- // ==========================================================================
345
- // Comments
346
- // ==========================================================================
347
- async listComments(input) {
348
- const installationId = this.getInstallationId(input);
349
- const params = new URLSearchParams({
350
- owner: input.owner,
351
- repo: input.repo,
352
- pr: String(input.pr),
353
- ...installationId && { installationId }
354
- });
355
- return this.request("GET", `/api/v1/github/comments?${params}`);
356
- }
357
- async createComment(input) {
358
- const installationId = this.getInstallationId(input);
359
- return this.request("POST", "/api/v1/github/comments", {
360
- owner: input.owner,
361
- repo: input.repo,
362
- pr: input.pr,
363
- body: input.body,
364
- ...installationId && { installationId }
365
- });
366
- }
367
- async updateComment(input) {
368
- const installationId = this.getInstallationId(input);
369
- return this.request("PATCH", `/api/v1/github/comments/${input.commentId}`, {
370
- owner: input.owner,
371
- repo: input.repo,
372
- body: input.body,
373
- ...installationId && { installationId }
374
- });
375
- }
376
- async deleteComment(input) {
377
- const installationId = this.getInstallationId(input);
378
- const params = new URLSearchParams({
379
- owner: input.owner,
380
- repo: input.repo,
381
- ...installationId && { installationId }
382
- });
383
- await this.request("DELETE", `/api/v1/github/comments/${input.commentId}?${params}`);
384
- }
385
- // ==========================================================================
386
- // Check Runs
387
- // ==========================================================================
388
- async createCheckRun(input) {
389
- const installationId = this.getInstallationId(input);
390
- return this.request("POST", "/api/v1/github/check-runs", {
391
- owner: input.owner,
392
- repo: input.repo,
393
- sha: input.sha,
394
- name: input.name,
395
- status: input.status,
396
- ...input.title && { title: input.title },
397
- ...input.summary && { summary: input.summary },
398
- ...installationId && { installationId }
399
- });
400
- }
401
- async updateCheckRun(input) {
402
- const installationId = this.getInstallationId(input);
403
- return this.request("PATCH", `/api/v1/github/check-runs/${input.checkRunId}`, {
404
- owner: input.owner,
405
- repo: input.repo,
406
- ...input.status && { status: input.status },
407
- ...input.conclusion && { conclusion: input.conclusion },
408
- ...input.title && { title: input.title },
409
- ...input.summary && { summary: input.summary },
410
- ...input.text && { text: input.text },
411
- ...installationId && { installationId }
412
- });
413
- }
414
- };
415
-
416
- // factories/openai.ts
417
- var OpenAIToolFactory = class {
418
- constructor(config) {
419
- this.config = config;
420
- }
421
- /**
422
- * Create an OpenAI-compatible warp grep tool
423
- *
424
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
425
- * @returns OpenAI ChatCompletionTool with execute and formatResult methods
426
- */
427
- createWarpGrepTool(toolConfig) {
428
- return createWarpGrepTool({
429
- ...toolConfig,
430
- morphApiKey: this.config.apiKey
431
- });
432
- }
433
- /**
434
- * Create an OpenAI-compatible codebase search tool
435
- *
436
- * @param toolConfig - Tool configuration with repoId (apiKey inherited from MorphClient)
437
- * @returns OpenAI ChatCompletionTool with execute and formatResult methods
438
- */
439
- createCodebaseSearchTool(toolConfig) {
440
- return createCodebaseSearchTool({
441
- ...toolConfig,
442
- apiKey: this.config.apiKey
443
- });
444
- }
445
- /**
446
- * Create an OpenAI-compatible edit file tool
447
- *
448
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
449
- * @returns OpenAI ChatCompletionTool with execute and formatResult methods
450
- */
451
- createEditFileTool(toolConfig = {}) {
452
- return createEditFileTool({
453
- ...toolConfig,
454
- morphApiKey: this.config.apiKey
455
- });
456
- }
457
- /**
458
- * Create an OpenAI-compatible GitHub search tool
459
- *
460
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
461
- * @returns OpenAI ChatCompletionTool with execute and formatResult methods
462
- */
463
- createGitHubSearchTool(toolConfig) {
464
- return createGitHubSearchTool({
465
- ...toolConfig,
466
- morphApiKey: this.config.apiKey
467
- });
468
- }
469
- };
470
-
471
- // factories/anthropic.ts
472
- var AnthropicToolFactory = class {
473
- constructor(config) {
474
- this.config = config;
475
- }
476
- /**
477
- * Create an Anthropic-compatible warp grep tool
478
- *
479
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
480
- * @returns Anthropic Tool with execute and formatResult methods
481
- */
482
- createWarpGrepTool(toolConfig) {
483
- return createWarpGrepTool2({
484
- ...toolConfig,
485
- morphApiKey: this.config.apiKey
486
- });
487
- }
488
- /**
489
- * Create an Anthropic-compatible codebase search tool
490
- *
491
- * @param toolConfig - Tool configuration with repoId (apiKey inherited from MorphClient)
492
- * @returns Anthropic Tool with execute and formatResult methods
493
- */
494
- createCodebaseSearchTool(toolConfig) {
495
- return createCodebaseSearchTool2({
496
- ...toolConfig,
497
- apiKey: this.config.apiKey
498
- });
499
- }
500
- /**
501
- * Create an Anthropic-compatible edit file tool
502
- *
503
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
504
- * @returns Anthropic Tool with execute and formatResult methods
505
- */
506
- createEditFileTool(toolConfig = {}) {
507
- return createEditFileTool2({
508
- ...toolConfig,
509
- morphApiKey: this.config.apiKey
510
- });
511
- }
512
- /**
513
- * Create an Anthropic-compatible GitHub search tool
514
- *
515
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
516
- * @returns Anthropic Tool with execute and formatResult methods
517
- */
518
- createGitHubSearchTool(toolConfig) {
519
- return createGitHubSearchTool2({
520
- ...toolConfig,
521
- morphApiKey: this.config.apiKey
522
- });
523
- }
524
- /**
525
- * Create an Explore subagent that searches the codebase and returns summaries
526
- *
527
- * @param config - Subagent configuration including client and model (morphApiKey inherited from MorphClient)
528
- * @returns Explore subagent with .tool, .run(), and .stream() methods
529
- */
530
- createExploreSubagent(config) {
531
- return createExploreSubagent({
532
- ...config,
533
- morphApiKey: this.config.apiKey
534
- });
535
- }
536
- };
537
-
538
- // factories/vercel.ts
539
- var VercelToolFactory = class {
540
- constructor(config) {
541
- this.config = config;
542
- }
543
- /**
544
- * Create a Vercel AI SDK-compatible warp grep tool
545
- *
546
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
547
- * @returns Vercel AI SDK tool
548
- */
549
- createWarpGrepTool(toolConfig) {
550
- return createWarpGrepTool3({
551
- ...toolConfig,
552
- morphApiKey: this.config.apiKey
553
- });
554
- }
555
- /**
556
- * Create a Vercel AI SDK-compatible codebase search tool
557
- *
558
- * @param toolConfig - Tool configuration with repoId (apiKey inherited from MorphClient)
559
- * @returns Vercel AI SDK tool
560
- */
561
- createCodebaseSearchTool(toolConfig) {
562
- return createCodebaseSearchTool3({
563
- ...toolConfig,
564
- apiKey: this.config.apiKey
565
- });
566
- }
567
- /**
568
- * Create a Vercel AI SDK-compatible edit file tool
569
- *
570
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
571
- * @returns Vercel AI SDK tool
572
- */
573
- createEditFileTool(toolConfig = {}) {
574
- return createEditFileTool3({
575
- ...toolConfig,
576
- morphApiKey: this.config.apiKey
577
- });
578
- }
579
- /**
580
- * Create a Vercel AI SDK-compatible GitHub search tool
581
- *
582
- * @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
583
- * @returns Vercel AI SDK tool
584
- */
585
- createGitHubSearchTool(toolConfig) {
586
- return createGitHubSearchTool3({
587
- ...toolConfig,
588
- morphApiKey: this.config.apiKey
589
- });
590
- }
591
- /**
592
- * Create an Explore subagent that searches the codebase and returns summaries
593
- *
594
- * @param config - Subagent configuration including model (morphApiKey inherited from MorphClient)
595
- * @returns Explore subagent with .tool, .run(), and .stream() methods
596
- */
597
- createExploreSubagent(config) {
598
- return createExploreSubagent2({
599
- ...config,
600
- morphApiKey: this.config.apiKey
601
- });
602
- }
603
- };
604
-
605
- // client.ts
606
- var MorphClient = class extends MorphAPIClient {
607
- /** Client configuration */
608
- config;
609
- /** FastApply tool for editing files with AI-powered merge */
610
- fastApply;
611
- /** CodebaseSearch tool for semantic code search */
612
- codebaseSearch;
613
- /** WarpGrep tool for fast code search using ripgrep */
614
- warpGrep;
615
- /** Browser tool for AI-powered browser automation */
616
- browser;
617
- /** GitHub tool for PR context, comments, and check runs */
618
- github;
619
- /** Model routers for intelligent model selection */
620
- routers;
621
- /** OpenAI-compatible tool factories */
622
- openai;
623
- /** Anthropic-compatible tool factories */
624
- anthropic;
625
- /** Vercel AI SDK tool factories */
626
- vercel;
627
- /** Compact context with line ranges */
628
- compact;
629
- /** Reflex: train and serve small text classifiers */
630
- reflex;
631
- /** Traces: read back turns shipped with `morphTracing()`, with their Reflex labels */
632
- traces;
633
- /**
634
- * Create a new Morph SDK client
635
- *
636
- * @param config - Client configuration (apiKey, debug, timeout, retryConfig)
637
- *
638
- * @example
639
- * ```typescript
640
- * const morph = new MorphClient({
641
- * apiKey: process.env.MORPH_API_KEY,
642
- * debug: true,
643
- * timeout: 60000
644
- * });
645
- * ```
646
- */
647
- constructor(config = {}) {
648
- super({
649
- apiKey: config.apiKey,
650
- timeout: config.timeout,
651
- retryConfig: config.retryConfig,
652
- debug: config.debug
653
- });
654
- if (!config.apiKey) {
655
- throw new Error("Morph API key is required. Pass it as { apiKey } when constructing MorphClient.");
656
- }
657
- this.config = config;
658
- logger.debug("MorphClient", "initialized", { debug: !!config.debug, timeout: config.timeout });
659
- this.fastApply = new FastApplyClient(this);
660
- this.codebaseSearch = new CodebaseSearchClient(this);
661
- this.warpGrep = new WarpGrepClient(this);
662
- this.browser = new BrowserClient(this);
663
- this.github = new GitHubClient(this, { installationId: config.github?.installationId });
664
- this.routers = {
665
- openai: new OpenAIRouter(this),
666
- anthropic: new AnthropicRouter(this),
667
- gemini: new GeminiRouter(this),
668
- raw: new RawRouter(this),
669
- classify: new RouterClassifier(this)
670
- };
671
- const compactClient = new CompactClient(this);
672
- this.compact = compactClient.compact.bind(compactClient);
673
- this.reflex = new ReflexClient(this);
674
- this.traces = new TracesClient(this);
675
- this.openai = new OpenAIToolFactory(config);
676
- this.anthropic = new AnthropicToolFactory(config);
677
- this.vercel = new VercelToolFactory(config);
678
- }
679
- };
680
-
681
- export {
682
- GitHubError,
683
- NoInstallationError,
684
- NotFoundError,
685
- PermissionError,
686
- GitHubClient,
687
- OpenAIToolFactory,
688
- AnthropicToolFactory,
689
- VercelToolFactory,
690
- MorphClient
691
- };
692
- //# sourceMappingURL=chunk-4FWK3CEH.js.map