@morphllm/morphsdk 0.2.171 → 0.2.172

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 (259) hide show
  1. package/dist/{chunk-3XRNC56L.js → chunk-2SNAXTUJ.js} +4 -4
  2. package/dist/chunk-453ZV2AX.js +120 -0
  3. package/dist/chunk-453ZV2AX.js.map +1 -0
  4. package/dist/chunk-53ZJMCWU.js +142 -0
  5. package/dist/chunk-53ZJMCWU.js.map +1 -0
  6. package/dist/{chunk-IW4TYYG6.js → chunk-5DA6SZQJ.js} +2 -2
  7. package/dist/chunk-66OHYI24.js +78 -0
  8. package/dist/chunk-66OHYI24.js.map +1 -0
  9. package/dist/chunk-6X6QMRQG.js +158 -0
  10. package/dist/chunk-6X6QMRQG.js.map +1 -0
  11. package/dist/{chunk-C37YAYBK.js → chunk-7PVVPLRL.js} +2 -2
  12. package/dist/{chunk-MZZMSL26.js → chunk-AE7M2I52.js} +2 -2
  13. package/dist/{chunk-JLLIVBKY.js → chunk-CQF76HJC.js} +30 -6
  14. package/dist/chunk-CQF76HJC.js.map +1 -0
  15. package/dist/{chunk-EFCDIESP.js → chunk-ESXCQBMU.js} +2 -2
  16. package/dist/{chunk-FQJCE2FX.js → chunk-FOIDGIY4.js} +29 -10
  17. package/dist/chunk-FOIDGIY4.js.map +1 -0
  18. package/dist/{chunk-JEDEBCZM.js → chunk-GJZXDRH5.js} +8 -3
  19. package/dist/{chunk-JEDEBCZM.js.map → chunk-GJZXDRH5.js.map} +1 -1
  20. package/dist/{chunk-2ALTBYMY.js → chunk-IJ33I7P5.js} +4 -4
  21. package/dist/{chunk-UK7TI7QY.js → chunk-IN2U7AAI.js} +99 -143
  22. package/dist/chunk-IN2U7AAI.js.map +1 -0
  23. package/dist/{chunk-LE66XCOI.js → chunk-JWZ5DLAS.js} +27 -10
  24. package/dist/chunk-JWZ5DLAS.js.map +1 -0
  25. package/dist/chunk-LKFZBBTD.js +12 -0
  26. package/dist/chunk-LKFZBBTD.js.map +1 -0
  27. package/dist/{chunk-TAS6S42A.js → chunk-MO6S2LRD.js} +2 -2
  28. package/dist/{chunk-2OAKX4SZ.js → chunk-NI7PWQ3B.js} +4 -4
  29. package/dist/{chunk-GLQWEINZ.js → chunk-QAXXE4AD.js} +2 -2
  30. package/dist/{chunk-3BCKZKNK.js → chunk-QFE5523Q.js} +2 -2
  31. package/dist/{chunk-LL3EWDKD.js → chunk-QQXNZIVK.js} +4 -4
  32. package/dist/{chunk-IGQYZ2KH.js → chunk-QZ3V2BP7.js} +2 -2
  33. package/dist/chunk-QZR7SJ5N.js +24 -0
  34. package/dist/chunk-QZR7SJ5N.js.map +1 -0
  35. package/dist/{chunk-SW527EQT.js → chunk-SJVLAGUL.js} +4 -4
  36. package/dist/{chunk-CMFY26F3.js → chunk-U4J3BVAQ.js} +4 -4
  37. package/dist/{chunk-5EUMJI3I.js → chunk-U4MRSZQQ.js} +2 -2
  38. package/dist/{chunk-ZJQTTOHO.js → chunk-UADW6FYD.js} +2 -2
  39. package/dist/{chunk-4324ZSCW.js → chunk-VBARKJWL.js} +2 -2
  40. package/dist/{chunk-OPNTDMHH.js → chunk-VLZ6PNAD.js} +4 -4
  41. package/dist/chunk-VZ7BOH2K.js +1 -0
  42. package/dist/chunk-VZ7BOH2K.js.map +1 -0
  43. package/dist/{chunk-Y6T4NA75.js → chunk-XJDXV5VX.js} +2 -2
  44. package/dist/{chunk-JTUB5ZCT.js → chunk-XYTYIAMQ.js} +2 -2
  45. package/dist/{chunk-4MTZUTNH.js → chunk-Z4GJVN52.js} +23 -8
  46. package/dist/chunk-Z4GJVN52.js.map +1 -0
  47. package/dist/chunk-ZLSNL6M2.js +97 -0
  48. package/dist/chunk-ZLSNL6M2.js.map +1 -0
  49. package/dist/{client-DsAAqupx.d.ts → client-Dh6yzCm4.d.ts} +14 -5
  50. package/dist/client.cjs +724 -523
  51. package/dist/client.cjs.map +1 -1
  52. package/dist/client.d.ts +5 -1
  53. package/dist/client.js +31 -27
  54. package/dist/core/client.cjs +540 -0
  55. package/dist/core/client.cjs.map +1 -0
  56. package/dist/core/client.d.ts +79 -0
  57. package/dist/core/client.js +12 -0
  58. package/dist/core/client.js.map +1 -0
  59. package/dist/core/error.cjs +309 -0
  60. package/dist/core/error.cjs.map +1 -0
  61. package/dist/core/error.d.ts +18 -0
  62. package/dist/core/error.js +10 -0
  63. package/dist/core/error.js.map +1 -0
  64. package/dist/core/index.cjs +552 -0
  65. package/dist/core/index.cjs.map +1 -0
  66. package/dist/core/index.d.ts +4 -0
  67. package/dist/core/index.js +20 -0
  68. package/dist/core/index.js.map +1 -0
  69. package/dist/core/resource.cjs +36 -0
  70. package/dist/core/resource.cjs.map +1 -0
  71. package/dist/core/resource.d.ts +18 -0
  72. package/dist/core/resource.js +8 -0
  73. package/dist/core/resource.js.map +1 -0
  74. package/dist/edge.cjs +236 -173
  75. package/dist/edge.cjs.map +1 -1
  76. package/dist/edge.d.ts +2 -0
  77. package/dist/edge.js +8 -5
  78. package/dist/git/client.cjs +529 -9
  79. package/dist/git/client.cjs.map +1 -1
  80. package/dist/git/client.d.ts +8 -2
  81. package/dist/git/client.js +7 -1
  82. package/dist/git/index.cjs +529 -9
  83. package/dist/git/index.cjs.map +1 -1
  84. package/dist/git/index.d.ts +2 -0
  85. package/dist/git/index.js +7 -1
  86. package/dist/index.cjs +672 -465
  87. package/dist/index.cjs.map +1 -1
  88. package/dist/index.d.ts +6 -2
  89. package/dist/index.js +49 -33
  90. package/dist/modelrouter/core.cjs +204 -125
  91. package/dist/modelrouter/core.cjs.map +1 -1
  92. package/dist/modelrouter/core.d.ts +36 -9
  93. package/dist/modelrouter/core.js +6 -3
  94. package/dist/modelrouter/index.cjs +204 -125
  95. package/dist/modelrouter/index.cjs.map +1 -1
  96. package/dist/modelrouter/index.d.ts +3 -0
  97. package/dist/modelrouter/index.js +6 -3
  98. package/dist/subagents/anthropic.cjs +268 -52
  99. package/dist/subagents/anthropic.cjs.map +1 -1
  100. package/dist/subagents/anthropic.js +10 -6
  101. package/dist/subagents/vercel.cjs +268 -52
  102. package/dist/subagents/vercel.cjs.map +1 -1
  103. package/dist/subagents/vercel.js +10 -6
  104. package/dist/tools/browser/anthropic.cjs +7 -2
  105. package/dist/tools/browser/anthropic.cjs.map +1 -1
  106. package/dist/tools/browser/anthropic.js +9 -6
  107. package/dist/tools/browser/core.cjs +162 -10
  108. package/dist/tools/browser/core.cjs.map +1 -1
  109. package/dist/tools/browser/core.d.ts +8 -2
  110. package/dist/tools/browser/core.js +8 -5
  111. package/dist/tools/browser/index.cjs +163 -11
  112. package/dist/tools/browser/index.cjs.map +1 -1
  113. package/dist/tools/browser/index.d.ts +2 -0
  114. package/dist/tools/browser/index.js +18 -15
  115. package/dist/tools/browser/index.js.map +1 -1
  116. package/dist/tools/browser/openai.cjs +7 -2
  117. package/dist/tools/browser/openai.cjs.map +1 -1
  118. package/dist/tools/browser/openai.js +9 -6
  119. package/dist/tools/browser/profiles/core.cjs +7 -2
  120. package/dist/tools/browser/profiles/core.cjs.map +1 -1
  121. package/dist/tools/browser/profiles/core.js +3 -3
  122. package/dist/tools/browser/profiles/index.cjs +7 -2
  123. package/dist/tools/browser/profiles/index.cjs.map +1 -1
  124. package/dist/tools/browser/profiles/index.js +3 -3
  125. package/dist/tools/browser/vercel.cjs +7 -2
  126. package/dist/tools/browser/vercel.cjs.map +1 -1
  127. package/dist/tools/browser/vercel.js +9 -6
  128. package/dist/tools/codebase_search/anthropic.cjs +162 -41
  129. package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
  130. package/dist/tools/codebase_search/anthropic.js +7 -4
  131. package/dist/tools/codebase_search/core.cjs +195 -66
  132. package/dist/tools/codebase_search/core.cjs.map +1 -1
  133. package/dist/tools/codebase_search/core.d.ts +18 -7
  134. package/dist/tools/codebase_search/core.js +6 -3
  135. package/dist/tools/codebase_search/index.cjs +162 -41
  136. package/dist/tools/codebase_search/index.cjs.map +1 -1
  137. package/dist/tools/codebase_search/index.d.ts +2 -0
  138. package/dist/tools/codebase_search/index.js +13 -10
  139. package/dist/tools/codebase_search/openai.cjs +162 -41
  140. package/dist/tools/codebase_search/openai.cjs.map +1 -1
  141. package/dist/tools/codebase_search/openai.js +7 -4
  142. package/dist/tools/codebase_search/vercel.cjs +162 -41
  143. package/dist/tools/codebase_search/vercel.cjs.map +1 -1
  144. package/dist/tools/codebase_search/vercel.js +7 -4
  145. package/dist/tools/compact/core.cjs +551 -47
  146. package/dist/tools/compact/core.cjs.map +1 -1
  147. package/dist/tools/compact/core.d.ts +16 -3
  148. package/dist/tools/compact/core.js +7 -1
  149. package/dist/tools/compact/index.cjs +549 -47
  150. package/dist/tools/compact/index.cjs.map +1 -1
  151. package/dist/tools/compact/index.d.ts +2 -0
  152. package/dist/tools/compact/index.js +8 -2
  153. package/dist/tools/fastapply/anthropic.cjs +16 -2
  154. package/dist/tools/fastapply/anthropic.cjs.map +1 -1
  155. package/dist/tools/fastapply/anthropic.js +8 -4
  156. package/dist/tools/fastapply/apply.cjs +7 -2
  157. package/dist/tools/fastapply/apply.cjs.map +1 -1
  158. package/dist/tools/fastapply/apply.js +2 -2
  159. package/dist/tools/fastapply/core.cjs +242 -12
  160. package/dist/tools/fastapply/core.cjs.map +1 -1
  161. package/dist/tools/fastapply/core.d.ts +8 -2
  162. package/dist/tools/fastapply/core.js +7 -3
  163. package/dist/tools/fastapply/index.cjs +16 -2
  164. package/dist/tools/fastapply/index.cjs.map +1 -1
  165. package/dist/tools/fastapply/index.d.ts +2 -0
  166. package/dist/tools/fastapply/index.js +13 -9
  167. package/dist/tools/fastapply/openai.cjs +16 -2
  168. package/dist/tools/fastapply/openai.cjs.map +1 -1
  169. package/dist/tools/fastapply/openai.js +8 -4
  170. package/dist/tools/fastapply/vercel.cjs +16 -2
  171. package/dist/tools/fastapply/vercel.cjs.map +1 -1
  172. package/dist/tools/fastapply/vercel.js +8 -4
  173. package/dist/tools/index.cjs +16 -2
  174. package/dist/tools/index.cjs.map +1 -1
  175. package/dist/tools/index.d.ts +2 -0
  176. package/dist/tools/index.js +13 -9
  177. package/dist/tools/reflex/core.cjs +693 -0
  178. package/dist/tools/reflex/core.cjs.map +1 -0
  179. package/dist/tools/reflex/core.d.ts +53 -0
  180. package/dist/tools/reflex/core.js +16 -0
  181. package/dist/tools/reflex/core.js.map +1 -0
  182. package/dist/tools/reflex/index.cjs +693 -0
  183. package/dist/tools/reflex/index.cjs.map +1 -0
  184. package/dist/tools/reflex/index.d.ts +5 -0
  185. package/dist/tools/reflex/index.js +16 -0
  186. package/dist/tools/reflex/index.js.map +1 -0
  187. package/dist/tools/reflex/types.cjs +19 -0
  188. package/dist/tools/reflex/types.cjs.map +1 -0
  189. package/dist/tools/reflex/types.d.ts +113 -0
  190. package/dist/tools/reflex/types.js +1 -0
  191. package/dist/tools/reflex/types.js.map +1 -0
  192. package/dist/tools/utils/resilience.cjs +7 -2
  193. package/dist/tools/utils/resilience.cjs.map +1 -1
  194. package/dist/tools/utils/resilience.js +2 -2
  195. package/dist/tools/warp_grep/agent/runner.cjs +7 -2
  196. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  197. package/dist/tools/warp_grep/agent/runner.js +2 -2
  198. package/dist/tools/warp_grep/anthropic.cjs +268 -52
  199. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  200. package/dist/tools/warp_grep/anthropic.d.ts +2 -0
  201. package/dist/tools/warp_grep/anthropic.js +10 -6
  202. package/dist/tools/warp_grep/client.cjs +268 -52
  203. package/dist/tools/warp_grep/client.cjs.map +1 -1
  204. package/dist/tools/warp_grep/client.d.ts +8 -2
  205. package/dist/tools/warp_grep/client.js +9 -5
  206. package/dist/tools/warp_grep/gemini.cjs +268 -52
  207. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  208. package/dist/tools/warp_grep/gemini.d.ts +2 -0
  209. package/dist/tools/warp_grep/gemini.js +9 -5
  210. package/dist/tools/warp_grep/gemini.js.map +1 -1
  211. package/dist/tools/warp_grep/harness.js +5 -5
  212. package/dist/tools/warp_grep/index.cjs +268 -52
  213. package/dist/tools/warp_grep/index.cjs.map +1 -1
  214. package/dist/tools/warp_grep/index.d.ts +2 -0
  215. package/dist/tools/warp_grep/index.js +12 -8
  216. package/dist/tools/warp_grep/openai.cjs +268 -52
  217. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  218. package/dist/tools/warp_grep/openai.d.ts +2 -0
  219. package/dist/tools/warp_grep/openai.js +10 -6
  220. package/dist/tools/warp_grep/providers/local.js +2 -2
  221. package/dist/tools/warp_grep/vercel.cjs +268 -52
  222. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  223. package/dist/tools/warp_grep/vercel.d.ts +2 -0
  224. package/dist/tools/warp_grep/vercel.js +10 -6
  225. package/dist/version.cjs +7 -2
  226. package/dist/version.cjs.map +1 -1
  227. package/dist/version.js +1 -1
  228. package/package.json +7 -2
  229. package/dist/chunk-4MTZUTNH.js.map +0 -1
  230. package/dist/chunk-FQJCE2FX.js.map +0 -1
  231. package/dist/chunk-H5WNI6R5.js +0 -102
  232. package/dist/chunk-H5WNI6R5.js.map +0 -1
  233. package/dist/chunk-JLLIVBKY.js.map +0 -1
  234. package/dist/chunk-KCFMXLZ7.js +0 -197
  235. package/dist/chunk-KCFMXLZ7.js.map +0 -1
  236. package/dist/chunk-LE66XCOI.js.map +0 -1
  237. package/dist/chunk-SCVWDNQP.js +0 -84
  238. package/dist/chunk-SCVWDNQP.js.map +0 -1
  239. package/dist/chunk-UK7TI7QY.js.map +0 -1
  240. /package/dist/{chunk-3XRNC56L.js.map → chunk-2SNAXTUJ.js.map} +0 -0
  241. /package/dist/{chunk-IW4TYYG6.js.map → chunk-5DA6SZQJ.js.map} +0 -0
  242. /package/dist/{chunk-C37YAYBK.js.map → chunk-7PVVPLRL.js.map} +0 -0
  243. /package/dist/{chunk-MZZMSL26.js.map → chunk-AE7M2I52.js.map} +0 -0
  244. /package/dist/{chunk-EFCDIESP.js.map → chunk-ESXCQBMU.js.map} +0 -0
  245. /package/dist/{chunk-2ALTBYMY.js.map → chunk-IJ33I7P5.js.map} +0 -0
  246. /package/dist/{chunk-TAS6S42A.js.map → chunk-MO6S2LRD.js.map} +0 -0
  247. /package/dist/{chunk-2OAKX4SZ.js.map → chunk-NI7PWQ3B.js.map} +0 -0
  248. /package/dist/{chunk-GLQWEINZ.js.map → chunk-QAXXE4AD.js.map} +0 -0
  249. /package/dist/{chunk-3BCKZKNK.js.map → chunk-QFE5523Q.js.map} +0 -0
  250. /package/dist/{chunk-LL3EWDKD.js.map → chunk-QQXNZIVK.js.map} +0 -0
  251. /package/dist/{chunk-IGQYZ2KH.js.map → chunk-QZ3V2BP7.js.map} +0 -0
  252. /package/dist/{chunk-SW527EQT.js.map → chunk-SJVLAGUL.js.map} +0 -0
  253. /package/dist/{chunk-CMFY26F3.js.map → chunk-U4J3BVAQ.js.map} +0 -0
  254. /package/dist/{chunk-5EUMJI3I.js.map → chunk-U4MRSZQQ.js.map} +0 -0
  255. /package/dist/{chunk-ZJQTTOHO.js.map → chunk-UADW6FYD.js.map} +0 -0
  256. /package/dist/{chunk-4324ZSCW.js.map → chunk-VBARKJWL.js.map} +0 -0
  257. /package/dist/{chunk-OPNTDMHH.js.map → chunk-VLZ6PNAD.js.map} +0 -0
  258. /package/dist/{chunk-Y6T4NA75.js.map → chunk-XJDXV5VX.js.map} +0 -0
  259. /package/dist/{chunk-JTUB5ZCT.js.map → chunk-XYTYIAMQ.js.map} +0 -0
@@ -40,19 +40,539 @@ module.exports = __toCommonJS(git_exports);
40
40
  var import_isomorphic_git = __toESM(require("isomorphic-git"), 1);
41
41
  var import_node = __toESM(require("isomorphic-git/http/node"), 1);
42
42
  var import_fs = __toESM(require("fs"), 1);
43
+
44
+ // package.json
45
+ var package_default = {
46
+ name: "@morphllm/morphsdk",
47
+ version: "0.2.172",
48
+ description: "TypeScript SDK and CLI for Morph Fast Apply integration",
49
+ type: "module",
50
+ main: "./dist/index.cjs",
51
+ module: "./dist/index.js",
52
+ types: "./dist/index.d.ts",
53
+ exports: {
54
+ ".": {
55
+ types: "./dist/index.d.ts",
56
+ import: "./dist/index.js",
57
+ require: "./dist/index.cjs"
58
+ },
59
+ "./logger": {
60
+ types: "./dist/logger.d.ts",
61
+ import: "./dist/logger.js",
62
+ require: "./dist/logger.cjs"
63
+ },
64
+ "./edge": {
65
+ types: "./dist/edge.d.ts",
66
+ import: "./dist/edge.js",
67
+ require: "./dist/edge.cjs"
68
+ },
69
+ "./tools/warp-grep": {
70
+ types: "./dist/tools/warp_grep/index.d.ts",
71
+ import: "./dist/tools/warp_grep/index.js",
72
+ require: "./dist/tools/warp_grep/index.cjs"
73
+ },
74
+ "./tools/warp-grep/openai": {
75
+ types: "./dist/tools/warp_grep/openai.d.ts",
76
+ import: "./dist/tools/warp_grep/openai.js",
77
+ require: "./dist/tools/warp_grep/openai.cjs"
78
+ },
79
+ "./tools/warp-grep/anthropic": {
80
+ types: "./dist/tools/warp_grep/anthropic.d.ts",
81
+ import: "./dist/tools/warp_grep/anthropic.js",
82
+ require: "./dist/tools/warp_grep/anthropic.cjs"
83
+ },
84
+ "./tools/warp-grep/vercel": {
85
+ types: "./dist/tools/warp_grep/vercel.d.ts",
86
+ import: "./dist/tools/warp_grep/vercel.js",
87
+ require: "./dist/tools/warp_grep/vercel.cjs"
88
+ },
89
+ "./tools/warp-grep/client": {
90
+ types: "./dist/tools/warp_grep/client.d.ts",
91
+ import: "./dist/tools/warp_grep/client.js",
92
+ require: "./dist/tools/warp_grep/client.cjs"
93
+ },
94
+ "./tools/warp-grep/gemini": {
95
+ types: "./dist/tools/warp_grep/gemini.d.ts",
96
+ import: "./dist/tools/warp_grep/gemini.js",
97
+ require: "./dist/tools/warp_grep/gemini.cjs"
98
+ },
99
+ "./tools/warp-grep/harness": {
100
+ types: "./dist/tools/warp_grep/harness.d.ts",
101
+ import: "./dist/tools/warp_grep/harness.js",
102
+ require: "./dist/tools/warp_grep/harness.cjs"
103
+ },
104
+ "./tools/fastapply": {
105
+ types: "./dist/tools/fastapply/index.d.ts",
106
+ import: "./dist/tools/fastapply/index.js",
107
+ require: "./dist/tools/fastapply/index.cjs"
108
+ },
109
+ "./tools/fastapply/anthropic": {
110
+ types: "./dist/tools/fastapply/anthropic.d.ts",
111
+ import: "./dist/tools/fastapply/anthropic.js",
112
+ require: "./dist/tools/fastapply/anthropic.cjs"
113
+ },
114
+ "./tools/fastapply/openai": {
115
+ types: "./dist/tools/fastapply/openai.d.ts",
116
+ import: "./dist/tools/fastapply/openai.js",
117
+ require: "./dist/tools/fastapply/openai.cjs"
118
+ },
119
+ "./tools/fastapply/vercel": {
120
+ types: "./dist/tools/fastapply/vercel.d.ts",
121
+ import: "./dist/tools/fastapply/vercel.js",
122
+ require: "./dist/tools/fastapply/vercel.cjs"
123
+ },
124
+ "./tools/codebase-search": {
125
+ types: "./dist/tools/codebase_search/index.d.ts",
126
+ import: "./dist/tools/codebase_search/index.js",
127
+ require: "./dist/tools/codebase_search/index.cjs"
128
+ },
129
+ "./tools/codebase-search/anthropic": {
130
+ types: "./dist/tools/codebase_search/anthropic.d.ts",
131
+ import: "./dist/tools/codebase_search/anthropic.js",
132
+ require: "./dist/tools/codebase_search/anthropic.cjs"
133
+ },
134
+ "./tools/codebase-search/openai": {
135
+ types: "./dist/tools/codebase_search/openai.d.ts",
136
+ import: "./dist/tools/codebase_search/openai.js",
137
+ require: "./dist/tools/codebase_search/openai.cjs"
138
+ },
139
+ "./tools/codebase-search/vercel": {
140
+ types: "./dist/tools/codebase_search/vercel.d.ts",
141
+ import: "./dist/tools/codebase_search/vercel.js",
142
+ require: "./dist/tools/codebase_search/vercel.cjs"
143
+ },
144
+ "./tools/git": {
145
+ types: "./dist/git/index.d.ts",
146
+ import: "./dist/git/index.js",
147
+ require: "./dist/git/index.cjs"
148
+ },
149
+ "./tools/browser": {
150
+ types: "./dist/tools/browser/index.d.ts",
151
+ import: "./dist/tools/browser/index.js",
152
+ require: "./dist/tools/browser/index.cjs"
153
+ },
154
+ "./tools/browser/anthropic": {
155
+ types: "./dist/tools/browser/anthropic.d.ts",
156
+ import: "./dist/tools/browser/anthropic.js",
157
+ require: "./dist/tools/browser/anthropic.cjs"
158
+ },
159
+ "./tools/browser/openai": {
160
+ types: "./dist/tools/browser/openai.d.ts",
161
+ import: "./dist/tools/browser/openai.js",
162
+ require: "./dist/tools/browser/openai.cjs"
163
+ },
164
+ "./tools/browser/vercel": {
165
+ types: "./dist/tools/browser/vercel.d.ts",
166
+ import: "./dist/tools/browser/vercel.js",
167
+ require: "./dist/tools/browser/vercel.cjs"
168
+ },
169
+ "./tools/browser/profiles": {
170
+ types: "./dist/tools/browser/profiles/index.d.ts",
171
+ import: "./dist/tools/browser/profiles/index.js",
172
+ require: "./dist/tools/browser/profiles/index.cjs"
173
+ },
174
+ "./modelrouter": {
175
+ types: "./dist/modelrouter/index.d.ts",
176
+ import: "./dist/modelrouter/index.js",
177
+ require: "./dist/modelrouter/index.cjs"
178
+ },
179
+ "./tools/compact": {
180
+ types: "./dist/tools/compact/index.d.ts",
181
+ import: "./dist/tools/compact/index.js",
182
+ require: "./dist/tools/compact/index.cjs"
183
+ },
184
+ "./tools/reflex": {
185
+ types: "./dist/tools/reflex/index.d.ts",
186
+ import: "./dist/tools/reflex/index.js",
187
+ require: "./dist/tools/reflex/index.cjs"
188
+ },
189
+ "./subagents": {
190
+ types: "./dist/subagents/index.d.ts",
191
+ import: "./dist/subagents/index.js",
192
+ require: "./dist/subagents/index.cjs"
193
+ },
194
+ "./subagents/vercel": {
195
+ types: "./dist/subagents/vercel.d.ts",
196
+ import: "./dist/subagents/vercel.js",
197
+ require: "./dist/subagents/vercel.cjs"
198
+ },
199
+ "./subagents/anthropic": {
200
+ types: "./dist/subagents/anthropic.d.ts",
201
+ import: "./dist/subagents/anthropic.js",
202
+ require: "./dist/subagents/anthropic.cjs"
203
+ }
204
+ },
205
+ files: [
206
+ "dist/**/*.js",
207
+ "dist/**/*.cjs",
208
+ "dist/**/*.d.ts",
209
+ "dist/**/*.map",
210
+ "!dist/**/__tests__/**",
211
+ "!dist/**/*.test.*"
212
+ ],
213
+ scripts: {
214
+ 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 git/index.ts git/client.ts git/config.ts git/types.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/reflex/index.ts tools/reflex/core.ts tools/reflex/types.ts tools/utils/resilience.ts subagents/index.ts subagents/types.ts subagents/prompts.ts subagents/vercel.ts subagents/anthropic.ts --format esm,cjs --sourcemap --clean --dts --dts-resolve",
215
+ prepare: "npm run build",
216
+ typecheck: "tsc --noEmit",
217
+ lint: "eslint .",
218
+ test: "vitest run",
219
+ "test:watch": "vitest watch",
220
+ "test:anthropic": "vitest run anthropic",
221
+ "test:openai": "vitest run openai",
222
+ "test:vercel": "vitest run vercel",
223
+ "test:git": "vitest run git",
224
+ "test:browser": "vitest run browser",
225
+ "test:agent": "npx tsx tests/fullAgentTest.ts",
226
+ "test:integration": "npx tsx tests/fullIntegrationTest.ts",
227
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
228
+ "release:patch": "npm version patch && npm publish",
229
+ "release:minor": "npm version minor && npm publish",
230
+ "release:major": "npm version major && npm publish"
231
+ },
232
+ keywords: [
233
+ "morph",
234
+ "fast-apply",
235
+ "cli",
236
+ "sdk",
237
+ "edit-file"
238
+ ],
239
+ engines: {
240
+ node: ">=18"
241
+ },
242
+ license: "MIT",
243
+ dependencies: {
244
+ "@vscode/ripgrep": "^1.17.0",
245
+ ai: ">=5.0.0",
246
+ diff: "^7.0.0",
247
+ "isomorphic-git": "^1.25.10",
248
+ openai: "^4.52.7",
249
+ zod: ">=3.23.0"
250
+ },
251
+ devDependencies: {
252
+ "@ai-sdk/anthropic": "^2.0.70",
253
+ "@ai-sdk/openai": "^2.0.35",
254
+ "@anthropic-ai/sdk": "^0.30.1",
255
+ "@google/generative-ai": "^0.24.1",
256
+ "@types/diff": "^7.0.2",
257
+ "@types/node": "^20.14.10",
258
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
259
+ "@typescript-eslint/parser": "^7.18.0",
260
+ dotenv: "^16.4.5",
261
+ eslint: "^8.57.0",
262
+ shx: "^0.3.4",
263
+ tsup: "^8.5.0",
264
+ tsx: "^4.16.2",
265
+ typescript: "^5.5.4",
266
+ vitest: "^2.1.6"
267
+ },
268
+ peerDependencies: {
269
+ "@anthropic-ai/sdk": ">=0.25.0",
270
+ "@google/generative-ai": ">=0.21.0",
271
+ ai: ">=5.0.0",
272
+ zod: ">=3.23.0"
273
+ },
274
+ peerDependenciesMeta: {
275
+ "@anthropic-ai/sdk": {
276
+ optional: true
277
+ },
278
+ "@google/generative-ai": {
279
+ optional: true
280
+ },
281
+ ai: {
282
+ optional: true
283
+ },
284
+ zod: {
285
+ optional: true
286
+ }
287
+ },
288
+ publishConfig: {
289
+ access: "public"
290
+ }
291
+ };
292
+
293
+ // version.ts
294
+ var SDK_VERSION = package_default.version;
295
+
296
+ // tools/utils/resilience.ts
297
+ var DEFAULT_RETRY_CONFIG = {
298
+ maxRetries: 3,
299
+ initialDelay: 1e3,
300
+ maxDelay: 3e4,
301
+ backoffMultiplier: 2,
302
+ retryableErrors: ["ECONNREFUSED", "ETIMEDOUT", "ENOTFOUND"]
303
+ };
304
+ async function fetchWithRetry(url, options, retryConfig = {}) {
305
+ const {
306
+ maxRetries = DEFAULT_RETRY_CONFIG.maxRetries,
307
+ initialDelay = DEFAULT_RETRY_CONFIG.initialDelay,
308
+ maxDelay = DEFAULT_RETRY_CONFIG.maxDelay,
309
+ backoffMultiplier = DEFAULT_RETRY_CONFIG.backoffMultiplier,
310
+ retryableErrors = DEFAULT_RETRY_CONFIG.retryableErrors,
311
+ onRetry
312
+ } = retryConfig;
313
+ let lastError = null;
314
+ let delay = initialDelay;
315
+ options = { ...options, headers: { "X-Morph-SDK-Version": SDK_VERSION, ...options.headers } };
316
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
317
+ try {
318
+ const response = await fetch(url, options);
319
+ if (response.status === 429 || response.status === 503) {
320
+ if (attempt < maxRetries) {
321
+ const retryAfter = response.headers.get("Retry-After");
322
+ const waitTime = retryAfter ? parseInt(retryAfter) * 1e3 : Math.min(delay, maxDelay);
323
+ const error = new Error(`HTTP ${response.status}: Retrying after ${waitTime}ms`);
324
+ if (onRetry) {
325
+ onRetry(attempt + 1, error);
326
+ }
327
+ await sleep(waitTime);
328
+ delay *= backoffMultiplier;
329
+ continue;
330
+ }
331
+ }
332
+ return response;
333
+ } catch (error) {
334
+ lastError = error;
335
+ const isRetryable = retryableErrors.some(
336
+ (errType) => lastError?.message?.includes(errType)
337
+ );
338
+ if (!isRetryable || attempt === maxRetries) {
339
+ throw lastError;
340
+ }
341
+ const waitTime = Math.min(delay, maxDelay);
342
+ if (onRetry) {
343
+ onRetry(attempt + 1, lastError);
344
+ }
345
+ await sleep(waitTime);
346
+ delay *= backoffMultiplier;
347
+ }
348
+ }
349
+ throw lastError || new Error("Max retries exceeded");
350
+ }
351
+ async function withTimeout(promise, timeoutMs, errorMessage) {
352
+ let timeoutId;
353
+ const timeoutPromise = new Promise((_, reject) => {
354
+ timeoutId = setTimeout(() => {
355
+ reject(new Error(errorMessage || `Operation timed out after ${timeoutMs}ms`));
356
+ }, timeoutMs);
357
+ });
358
+ try {
359
+ const result = await Promise.race([promise, timeoutPromise]);
360
+ clearTimeout(timeoutId);
361
+ return result;
362
+ } catch (error) {
363
+ clearTimeout(timeoutId);
364
+ throw error;
365
+ }
366
+ }
367
+ function sleep(ms) {
368
+ return new Promise((resolve) => setTimeout(resolve, ms));
369
+ }
370
+ var MorphError = class extends Error {
371
+ constructor(message, code, statusCode, retryable = false) {
372
+ super(message);
373
+ this.code = code;
374
+ this.statusCode = statusCode;
375
+ this.retryable = retryable;
376
+ this.name = "MorphError";
377
+ }
378
+ };
379
+
380
+ // logger.ts
381
+ var MorphLogger = class {
382
+ enabled;
383
+ fileStream;
384
+ /** Resolves once the file stream is initialized (or immediately if no file logging). */
385
+ ready;
386
+ constructor() {
387
+ this.enabled = typeof process !== "undefined" && (process.env.MORPH_DEBUG === "1" || !!process.env.MORPH_LOG_FILE);
388
+ this.fileStream = null;
389
+ const f = typeof process !== "undefined" ? process.env.MORPH_LOG_FILE : void 0;
390
+ if (f) {
391
+ this.ready = import("fs").then((fs2) => {
392
+ this.fileStream = fs2.createWriteStream(f, { flags: "a" });
393
+ }).catch(() => {
394
+ });
395
+ } else {
396
+ this.ready = Promise.resolve();
397
+ }
398
+ }
399
+ debug(component, msg, data) {
400
+ this._log("debug", component, msg, data);
401
+ }
402
+ info(component, msg, data) {
403
+ this._log("info", component, msg, data);
404
+ }
405
+ warn(component, msg, data) {
406
+ this._log("warn", component, msg, data);
407
+ }
408
+ error(component, msg, data) {
409
+ this._log("error", component, msg, data);
410
+ }
411
+ enable() {
412
+ this.enabled = true;
413
+ }
414
+ get isEnabled() {
415
+ return this.enabled;
416
+ }
417
+ _log(level, component, msg, data) {
418
+ if (level !== "error" && !this.enabled) return;
419
+ const ts = (/* @__PURE__ */ new Date()).toISOString();
420
+ const prefix = `[${ts}] [${level.toUpperCase()}] [${component}]`;
421
+ console.error(data ? `${prefix} ${msg} ${JSON.stringify(data)}` : `${prefix} ${msg}`);
422
+ this.fileStream?.write(JSON.stringify({ ts, level, component, msg, ...data && { data } }) + "\n");
423
+ }
424
+ };
425
+ var logger = new MorphLogger();
426
+
427
+ // core/error.ts
428
+ async function toMorphError(response) {
429
+ let message = `Morph API request failed (${response.status})`;
430
+ let code = "api_error";
431
+ try {
432
+ const body = await response.json();
433
+ message = body.error?.message ?? body.message ?? message;
434
+ code = body.error?.code ?? body.error?.type ?? code;
435
+ } catch {
436
+ }
437
+ if (response.status === 401) code = "authentication_error";
438
+ if (response.status === 429) code = "rate_limit_exceeded";
439
+ const retryable = response.status === 429 || response.status === 503;
440
+ return new MorphError(message, code, response.status, retryable);
441
+ }
442
+
443
+ // core/client.ts
444
+ var DEFAULT_BASE_URL = "https://api.morphllm.com";
445
+ var DEFAULT_REPOS_URL = "https://repos.morphllm.com";
446
+ var DEFAULT_BROWSER_URL = "https://browser.morphllm.com";
447
+ var DEFAULT_TIMEOUT = 6e4;
448
+ var env = (name) => typeof process !== "undefined" ? process.env?.[name] : void 0;
449
+ var stripTrailingSlash = (url) => url.replace(/\/+$/, "");
450
+ var MorphAPIClient = class {
451
+ /** Explicit key as provided; resolved against env at request time. */
452
+ apiKey;
453
+ baseURL;
454
+ reposURL;
455
+ browserURL;
456
+ /** Explicit default timeout (ms), if set. The request default is applied lazily so
457
+ * resources can read an undefined value and supply their own fallback. */
458
+ timeout;
459
+ retryConfig;
460
+ debug;
461
+ constructor(options = {}) {
462
+ this.apiKey = options.apiKey;
463
+ this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);
464
+ this.reposURL = stripTrailingSlash(options.reposURL ?? env("MORPH_SEARCH_URL") ?? DEFAULT_REPOS_URL);
465
+ this.browserURL = stripTrailingSlash(
466
+ options.browserURL ?? (env("MORPH_ENVIRONMENT") === "DEV" ? "http://localhost:8000" : DEFAULT_BROWSER_URL)
467
+ );
468
+ this.timeout = options.timeout;
469
+ this.retryConfig = options.retryConfig;
470
+ this.debug = options.debug ?? false;
471
+ if (this.debug) logger.enable();
472
+ }
473
+ /** The key actually used for requests: explicit, else `MORPH_API_KEY`. */
474
+ resolveApiKey() {
475
+ return this.apiKey ?? env("MORPH_API_KEY");
476
+ }
477
+ /** Headers shared with tools that bring their own HTTP client (FastApply/WarpGrep via the `openai` package). */
478
+ defaultHeaders() {
479
+ return { "X-Morph-SDK-Version": SDK_VERSION };
480
+ }
481
+ buildURL(path, baseURL) {
482
+ if (/^https?:\/\//i.test(path)) return path;
483
+ const base = stripTrailingSlash(baseURL ?? this.baseURL);
484
+ return `${base}${path.startsWith("/") ? "" : "/"}${path}`;
485
+ }
486
+ buildHeaders(apiKey, extra) {
487
+ return {
488
+ "Content-Type": "application/json",
489
+ "X-Morph-SDK-Version": SDK_VERSION,
490
+ Authorization: `Bearer ${apiKey}`,
491
+ ...extra
492
+ };
493
+ }
494
+ applyQuery(url, query) {
495
+ if (!query) return url;
496
+ const params = new URLSearchParams();
497
+ for (const [key, value] of Object.entries(query)) {
498
+ if (value !== void 0 && value !== null) params.set(key, String(value));
499
+ }
500
+ const qs = params.toString();
501
+ return qs ? `${url}${url.includes("?") ? "&" : "?"}${qs}` : url;
502
+ }
503
+ async request(method, path, opts = {}) {
504
+ const apiKey = this.resolveApiKey();
505
+ if (!apiKey) {
506
+ throw new MorphError(
507
+ "Morph API key not found. Set the MORPH_API_KEY environment variable or pass apiKey in config.",
508
+ "missing_api_key",
509
+ 401
510
+ );
511
+ }
512
+ const url = this.applyQuery(this.buildURL(path, opts.baseURL), opts.query);
513
+ const timeout = opts.timeout ?? this.timeout ?? DEFAULT_TIMEOUT;
514
+ const init = {
515
+ method,
516
+ headers: this.buildHeaders(apiKey, opts.headers),
517
+ ...opts.body !== void 0 ? { body: JSON.stringify(opts.body) } : {},
518
+ ...opts.signal ? { signal: opts.signal } : {}
519
+ };
520
+ logger.debug("MorphAPIClient", "request", { method, url });
521
+ const response = await withTimeout(
522
+ fetchWithRetry(url, init, this.retryConfig ?? {}),
523
+ timeout,
524
+ `Morph request to ${url} timed out after ${timeout}ms`
525
+ );
526
+ if (opts.raw) return response;
527
+ if (!response.ok) throw await toMorphError(response);
528
+ if (opts.stream) return response;
529
+ if (response.status === 204) return void 0;
530
+ const text = await response.text();
531
+ return text ? JSON.parse(text) : void 0;
532
+ }
533
+ get(path, opts) {
534
+ return this.request("GET", path, opts);
535
+ }
536
+ post(path, opts) {
537
+ return this.request("POST", path, opts);
538
+ }
539
+ delete(path, opts) {
540
+ return this.request("DELETE", path, opts);
541
+ }
542
+ };
543
+
544
+ // core/resource.ts
545
+ var APIResource = class {
546
+ _client;
547
+ constructor(client) {
548
+ this._client = client;
549
+ }
550
+ };
551
+
552
+ // git/client.ts
43
553
  var DEFAULT_PROXY_URL = "https://repos.morphllm.com";
44
- var MorphGit = class {
554
+ var MorphGit = class extends APIResource {
45
555
  apiKey;
46
556
  proxyUrl;
47
- constructor(config) {
48
- if (!config.apiKey) {
49
- throw new Error("API key is required. Get one at https://morphllm.com/dashboard");
50
- }
51
- if (!config.apiKey.startsWith("sk-") && !config.apiKey.startsWith("morph-")) {
52
- throw new Error("Invalid API key format. Expected: sk-... or morph-...");
557
+ constructor(clientOrConfig) {
558
+ const isClient = clientOrConfig instanceof MorphAPIClient;
559
+ if (!isClient) {
560
+ if (!clientOrConfig.apiKey) {
561
+ throw new Error("API key is required. Get one at https://morphllm.com/dashboard");
562
+ }
563
+ if (!clientOrConfig.apiKey.startsWith("sk-") && !clientOrConfig.apiKey.startsWith("morph-")) {
564
+ throw new Error("Invalid API key format. Expected: sk-... or morph-...");
565
+ }
53
566
  }
54
- this.apiKey = config.apiKey;
55
- this.proxyUrl = config.proxyUrl || DEFAULT_PROXY_URL;
567
+ super(
568
+ isClient ? clientOrConfig : new MorphAPIClient({
569
+ apiKey: clientOrConfig.apiKey,
570
+ reposURL: clientOrConfig.proxyUrl,
571
+ retryConfig: clientOrConfig.retryConfig
572
+ })
573
+ );
574
+ this.apiKey = this._client.resolveApiKey() ?? "";
575
+ this.proxyUrl = isClient ? this._client.reposURL : clientOrConfig.proxyUrl || DEFAULT_PROXY_URL;
56
576
  }
57
577
  /**
58
578
  * Get auth callback for isomorphic-git operations