@morphllm/morphsdk 0.2.198 → 0.2.200

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