@morphllm/morphsdk 0.2.202 → 0.2.204

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 (246) hide show
  1. package/README.md +101 -0
  2. package/dist/chunk-2GMG5XKU.js +100 -0
  3. package/dist/chunk-2PPYWRMZ.js +3 -4
  4. package/dist/chunk-3HAHJYZQ.cjs +74 -0
  5. package/dist/{chunk-2XU3XXUE.js → chunk-3JROKKS4.js} +3 -25
  6. package/dist/{chunk-26K5EJD3.js → chunk-43JBUEIX.js} +4 -18
  7. package/dist/chunk-44OIEPIO.js +4 -23
  8. package/dist/chunk-4EQQGUZ7.cjs +104 -0
  9. package/dist/chunk-4OUGA3KS.js +1 -5
  10. package/dist/{chunk-VQDDL3UH.js → chunk-4TZBUFVP.js} +2 -8
  11. package/dist/{chunk-YAM6P5OQ.js → chunk-564XJOQP.js} +2 -6
  12. package/dist/chunk-5H3FKFOI.cjs +77 -0
  13. package/dist/chunk-5TTZQF4X.cjs +110 -0
  14. package/dist/chunk-6HAYJA6M.cjs +317 -0
  15. package/dist/chunk-6TZCVTW5.js +3 -4
  16. package/dist/chunk-6WP7EA4F.js +2 -4
  17. package/dist/chunk-74A4HLIO.cjs +42 -0
  18. package/dist/chunk-75ZPJI57.cjs +9 -0
  19. package/dist/chunk-7PJYY46L.cjs +2 -0
  20. package/dist/chunk-AWFZKS27.cjs +11 -0
  21. package/dist/chunk-BJBWWIZV.cjs +2 -0
  22. package/dist/chunk-DLYDIYDK.cjs +305 -0
  23. package/dist/{chunk-65TUD7JV.js → chunk-DYCMPDPV.js} +13 -29
  24. package/dist/{chunk-3CPI6ZIC.js → chunk-DZP7BR66.js} +22 -43
  25. package/dist/chunk-E63OPKP7.js +96 -0
  26. package/dist/chunk-E6V75LI6.cjs +334 -0
  27. package/dist/{chunk-XPHNS7NW.js → chunk-EJ6ID24K.js} +3 -12
  28. package/dist/chunk-EJTL2BOZ.cjs +42 -0
  29. package/dist/chunk-ETBRAKVV.js +1 -5
  30. package/dist/chunk-F633IVQA.cjs +91 -0
  31. package/dist/chunk-FBOZIVVQ.js +1 -0
  32. package/dist/{chunk-UKXCGQPS.js → chunk-FGA6EYC2.js} +35 -37
  33. package/dist/{chunk-CAWQEHKP.js → chunk-G4RODMXA.js} +4 -19
  34. package/dist/chunk-GUNGJC6X.cjs +256 -0
  35. package/dist/chunk-GYE3FY6Z.js +8 -0
  36. package/dist/chunk-HDP4QAZL.js +1 -4
  37. package/dist/chunk-HNMEBYIS.cjs +86 -0
  38. package/dist/chunk-HP3PCOTW.cjs +81 -0
  39. package/dist/{chunk-ICCGLO6V.js → chunk-IGXNLXPN.js} +12 -17
  40. package/dist/chunk-IPJA3ZS6.cjs +10 -0
  41. package/dist/chunk-JHC2R3HU.cjs +317 -0
  42. package/dist/{chunk-IBRBSDLT.js → chunk-JVMIFGZY.js} +5 -8
  43. package/dist/chunk-KF6S3EPJ.cjs +100 -0
  44. package/dist/chunk-KVGZ2TSG.cjs +274 -0
  45. package/dist/{chunk-6OYJC4TZ.js → chunk-L5SCKZVK.js} +13 -22
  46. package/dist/chunk-LDM7RNNN.js +1 -0
  47. package/dist/{chunk-UAZKHSEU.js → chunk-LQST3NW2.js} +5 -15
  48. package/dist/chunk-M34E2AMK.js +1 -5
  49. package/dist/chunk-MF56KEI4.js +1 -4
  50. package/dist/chunk-MLKGABMK.js +1 -3
  51. package/dist/chunk-MLPZKUCO.js +4 -5
  52. package/dist/chunk-MMX5PUGC.cjs +242 -0
  53. package/dist/chunk-MWXJ6DZ2.cjs +21 -0
  54. package/dist/chunk-NJWOWXUR.cjs +137 -0
  55. package/dist/chunk-NNKBKENK.cjs +15 -0
  56. package/dist/chunk-NRG6QX3L.js +1 -3
  57. package/dist/chunk-OCKEEEYE.cjs +433 -0
  58. package/dist/chunk-OENJO7YW.js +306 -0
  59. package/dist/chunk-OKLAYEBC.cjs +2 -0
  60. package/dist/chunk-OPDWMD4Q.js +1 -3
  61. package/dist/{chunk-D6YJ5X3C.js → chunk-OX5GN2KB.js} +26 -14
  62. package/dist/{chunk-JEVLCA5C.js → chunk-OYBOP47A.js} +18 -19
  63. package/dist/chunk-OZHCHPIE.js +1 -0
  64. package/dist/chunk-PA3UTI4A.js +1 -4
  65. package/dist/chunk-QEEAIXL5.cjs +74 -0
  66. package/dist/chunk-QT5LGZG3.cjs +10 -0
  67. package/dist/chunk-R3TUE7O2.cjs +107 -0
  68. package/dist/chunk-RYVW7RUM.js +2 -6
  69. package/dist/{chunk-LVKKICOB.js → chunk-SOQYE5A4.js} +36 -69
  70. package/dist/chunk-ST2OXLT5.cjs +91 -0
  71. package/dist/{chunk-SIFDK4AA.js → chunk-TH4MG73B.js} +3 -24
  72. package/dist/{chunk-OSL4CNSO.js → chunk-TLMAMVAW.js} +7 -23
  73. package/dist/chunk-TPZHMD7J.cjs +72 -0
  74. package/dist/{chunk-PDSIWL7I.js → chunk-U4PYAGNR.js} +6 -19
  75. package/dist/chunk-UAPK3AIJ.js +1 -10
  76. package/dist/chunk-UF5IKELS.cjs +26 -0
  77. package/dist/chunk-UHFVWYSP.cjs +408 -0
  78. package/dist/chunk-UKBSXYKE.cjs +280 -0
  79. package/dist/chunk-UNX7V6P6.cjs +60 -0
  80. package/dist/chunk-UZMMJ47A.cjs +107 -0
  81. package/dist/chunk-VHD7CW5O.cjs +43 -0
  82. package/dist/chunk-VL4QNALG.cjs +50 -0
  83. package/dist/chunk-VYE7O4FM.cjs +51 -0
  84. package/dist/chunk-WIYVT4UO.cjs +173 -0
  85. package/dist/chunk-WJHHO24M.cjs +91 -0
  86. package/dist/chunk-WR7LSUIR.cjs +213 -0
  87. package/dist/chunk-XE6D4J63.cjs +72 -0
  88. package/dist/chunk-YAUXTFIN.cjs +21 -0
  89. package/dist/{chunk-NFPRKZQ5.js → chunk-YJUCGZNN.js} +5 -22
  90. package/dist/chunk-ZSHVXDA2.js +4 -10
  91. package/dist/chunk-ZX6T3LNG.js +302 -0
  92. package/dist/{client-BWhi-vSj.d.ts → client-DSXbcxII.d.ts} +10 -1
  93. package/dist/client.cjs +44 -4360
  94. package/dist/client.d.ts +4 -2
  95. package/dist/client.js +36 -37
  96. package/dist/core/client.cjs +14 -476
  97. package/dist/core/client.d.ts +8 -0
  98. package/dist/core/client.js +10 -11
  99. package/dist/core/error.cjs +8 -251
  100. package/dist/core/error.js +4 -9
  101. package/dist/core/index.cjs +27 -491
  102. package/dist/core/index.d.ts +2 -0
  103. package/dist/core/index.js +12 -19
  104. package/dist/core/resource.cjs +9 -33
  105. package/dist/core/resource.d.ts +2 -0
  106. package/dist/core/resource.js +2 -7
  107. package/dist/edge.cjs +74 -1111
  108. package/dist/edge.d.ts +3 -0
  109. package/dist/edge.js +14 -42
  110. package/dist/guard-CvW03v4u.d.ts +59 -0
  111. package/dist/index.cjs +140 -4431
  112. package/dist/index.d.ts +6 -2
  113. package/dist/index.js +44 -87
  114. package/dist/modelrouter/core.cjs +35 -651
  115. package/dist/modelrouter/core.d.ts +2 -0
  116. package/dist/modelrouter/core.js +12 -21
  117. package/dist/modelrouter/index.cjs +35 -651
  118. package/dist/modelrouter/index.d.ts +2 -0
  119. package/dist/modelrouter/index.js +12 -21
  120. package/dist/modelrouter/types.cjs +1 -17
  121. package/dist/modelrouter/types.d.ts +5 -0
  122. package/dist/modelrouter/types.js +1 -0
  123. package/dist/subagents/anthropic.cjs +31 -2784
  124. package/dist/subagents/anthropic.d.ts +3 -1
  125. package/dist/subagents/anthropic.js +23 -24
  126. package/dist/subagents/index.cjs +14 -95
  127. package/dist/subagents/index.d.ts +3 -1
  128. package/dist/subagents/index.js +2 -11
  129. package/dist/subagents/prompts.cjs +14 -93
  130. package/dist/subagents/prompts.d.ts +3 -1
  131. package/dist/subagents/prompts.js +2 -11
  132. package/dist/subagents/types.cjs +1 -17
  133. package/dist/subagents/types.d.ts +3 -1
  134. package/dist/subagents/types.js +1 -0
  135. package/dist/subagents/vercel.cjs +31 -2761
  136. package/dist/subagents/vercel.d.ts +3 -1
  137. package/dist/subagents/vercel.js +23 -24
  138. package/dist/tools/compact/core.cjs +20 -552
  139. package/dist/tools/compact/core.d.ts +2 -0
  140. package/dist/tools/compact/core.js +12 -13
  141. package/dist/tools/compact/index.cjs +24 -598
  142. package/dist/tools/compact/index.d.ts +3 -1
  143. package/dist/tools/compact/index.js +13 -17
  144. package/dist/tools/compact/types.cjs +1 -17
  145. package/dist/tools/compact/types.d.ts +4 -4
  146. package/dist/tools/compact/types.js +1 -0
  147. package/dist/tools/fastapply/anthropic.cjs +39 -899
  148. package/dist/tools/fastapply/anthropic.d.ts +2 -0
  149. package/dist/tools/fastapply/anthropic.js +15 -24
  150. package/dist/tools/fastapply/apply.cjs +32 -672
  151. package/dist/tools/fastapply/apply.d.ts +2 -0
  152. package/dist/tools/fastapply/apply.js +8 -19
  153. package/dist/tools/fastapply/core.cjs +49 -1069
  154. package/dist/tools/fastapply/core.d.ts +3 -0
  155. package/dist/tools/fastapply/core.js +13 -29
  156. package/dist/tools/fastapply/index.cjs +56 -1052
  157. package/dist/tools/fastapply/index.d.ts +2 -0
  158. package/dist/tools/fastapply/index.js +18 -44
  159. package/dist/tools/fastapply/openai.cjs +45 -910
  160. package/dist/tools/fastapply/openai.d.ts +2 -0
  161. package/dist/tools/fastapply/openai.js +15 -26
  162. package/dist/tools/fastapply/prompts.cjs +10 -62
  163. package/dist/tools/fastapply/prompts.js +2 -9
  164. package/dist/tools/fastapply/types.cjs +1 -17
  165. package/dist/tools/fastapply/types.d.ts +9 -4
  166. package/dist/tools/fastapply/types.js +1 -0
  167. package/dist/tools/fastapply/vercel.cjs +37 -905
  168. package/dist/tools/fastapply/vercel.d.ts +2 -0
  169. package/dist/tools/fastapply/vercel.js +15 -22
  170. package/dist/tools/index.cjs +56 -1052
  171. package/dist/tools/index.d.ts +2 -0
  172. package/dist/tools/index.js +18 -44
  173. package/dist/tools/pii/index.cjs +47 -0
  174. package/dist/tools/pii/index.d.ts +4 -0
  175. package/dist/tools/pii/index.js +6 -0
  176. package/dist/tools/pii/model.cjs +45 -0
  177. package/dist/tools/pii/model.d.ts +83 -0
  178. package/dist/tools/pii/model.js +4 -0
  179. package/dist/tools/pii/patterns.cjs +15 -0
  180. package/dist/tools/pii/patterns.d.ts +31 -0
  181. package/dist/tools/pii/patterns.js +2 -0
  182. package/dist/tools/pii/regex.cjs +32 -0
  183. package/dist/tools/pii/regex.d.ts +48 -0
  184. package/dist/tools/pii/regex.js +3 -0
  185. package/dist/tools/pii/types.cjs +2 -0
  186. package/dist/tools/pii/types.d.ts +108 -0
  187. package/dist/tools/pii/types.js +1 -0
  188. package/dist/tools/utils/resilience.cjs +15 -312
  189. package/dist/tools/utils/resilience.js +3 -12
  190. package/dist/tools/warp_grep/agent/config.cjs +16 -127
  191. package/dist/tools/warp_grep/agent/config.js +2 -11
  192. package/dist/tools/warp_grep/agent/formatter.cjs +12 -48
  193. package/dist/tools/warp_grep/agent/formatter.js +2 -9
  194. package/dist/tools/warp_grep/agent/parser.cjs +16 -83
  195. package/dist/tools/warp_grep/agent/parser.d.ts +2 -0
  196. package/dist/tools/warp_grep/agent/parser.js +2 -11
  197. package/dist/tools/warp_grep/agent/runner.cjs +19 -1081
  198. package/dist/tools/warp_grep/agent/runner.d.ts +2 -0
  199. package/dist/tools/warp_grep/agent/runner.js +11 -14
  200. package/dist/tools/warp_grep/agent/types.cjs +1 -17
  201. package/dist/tools/warp_grep/agent/types.d.ts +4 -0
  202. package/dist/tools/warp_grep/agent/types.js +1 -0
  203. package/dist/tools/warp_grep/anthropic.cjs +51 -2561
  204. package/dist/tools/warp_grep/anthropic.d.ts +3 -1
  205. package/dist/tools/warp_grep/anthropic.js +23 -35
  206. package/dist/tools/warp_grep/client.cjs +53 -2471
  207. package/dist/tools/warp_grep/client.d.ts +3 -1
  208. package/dist/tools/warp_grep/client.js +21 -34
  209. package/dist/tools/warp_grep/gemini.cjs +52 -2490
  210. package/dist/tools/warp_grep/gemini.d.ts +3 -1
  211. package/dist/tools/warp_grep/gemini.js +25 -41
  212. package/dist/tools/warp_grep/harness.cjs +81 -936
  213. package/dist/tools/warp_grep/harness.d.ts +2 -0
  214. package/dist/tools/warp_grep/harness.js +12 -51
  215. package/dist/tools/warp_grep/index.cjs +128 -2575
  216. package/dist/tools/warp_grep/index.d.ts +3 -1
  217. package/dist/tools/warp_grep/index.js +28 -87
  218. package/dist/tools/warp_grep/openai.cjs +57 -2575
  219. package/dist/tools/warp_grep/openai.d.ts +3 -1
  220. package/dist/tools/warp_grep/openai.js +23 -37
  221. package/dist/tools/warp_grep/providers/code_storage_http.cjs +12 -65
  222. package/dist/tools/warp_grep/providers/code_storage_http.d.ts +3 -1
  223. package/dist/tools/warp_grep/providers/code_storage_http.js +2 -9
  224. package/dist/tools/warp_grep/providers/local.cjs +10 -589
  225. package/dist/tools/warp_grep/providers/local.js +6 -11
  226. package/dist/tools/warp_grep/providers/remote.cjs +8 -331
  227. package/dist/tools/warp_grep/providers/remote.d.ts +3 -1
  228. package/dist/tools/warp_grep/providers/remote.js +3 -8
  229. package/dist/tools/warp_grep/providers/types.cjs +1 -17
  230. package/dist/tools/warp_grep/providers/types.js +1 -0
  231. package/dist/tools/warp_grep/utils/files.cjs +9 -42
  232. package/dist/tools/warp_grep/utils/files.js +2 -7
  233. package/dist/tools/warp_grep/utils/github.cjs +9 -43
  234. package/dist/tools/warp_grep/utils/github.js +2 -7
  235. package/dist/tools/warp_grep/utils/paths.cjs +28 -104
  236. package/dist/tools/warp_grep/utils/paths.js +2 -17
  237. package/dist/tools/warp_grep/utils/ripgrep.cjs +9 -103
  238. package/dist/tools/warp_grep/utils/ripgrep.js +2 -7
  239. package/dist/tools/warp_grep/vercel.cjs +57 -2557
  240. package/dist/tools/warp_grep/vercel.d.ts +3 -1
  241. package/dist/tools/warp_grep/vercel.js +23 -37
  242. package/dist/{types-DxZLPogx.d.ts → types-BKhXjDCB.d.ts} +6 -1
  243. package/dist/version.cjs +7 -225
  244. package/dist/version.js +2 -7
  245. package/package.json +11 -2
  246. package/dist/chunk-E6TL6MIH.js +0 -203
@@ -1,493 +1,29 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // core/index.ts
31
- var core_exports = {};
32
- __export(core_exports, {
33
- APIResource: () => APIResource,
34
- MorphAPIClient: () => MorphAPIClient,
35
- toMorphError: () => toMorphError
1
+ 'use strict';
2
+
3
+ require('../chunk-7PJYY46L.cjs');
4
+ var chunk5TTZQF4X_cjs = require('../chunk-5TTZQF4X.cjs');
5
+ require('../chunk-VL4QNALG.cjs');
6
+ require('../chunk-KF6S3EPJ.cjs');
7
+ require('../chunk-6HAYJA6M.cjs');
8
+ require('../chunk-R3TUE7O2.cjs');
9
+ require('../chunk-DLYDIYDK.cjs');
10
+ var chunkYAUXTFIN_cjs = require('../chunk-YAUXTFIN.cjs');
11
+ require('../chunk-WJHHO24M.cjs');
12
+ require('../chunk-QT5LGZG3.cjs');
13
+ var chunkAWFZKS27_cjs = require('../chunk-AWFZKS27.cjs');
14
+ require('../chunk-75ZPJI57.cjs');
15
+
16
+
17
+
18
+ Object.defineProperty(exports, "MorphAPIClient", {
19
+ enumerable: true,
20
+ get: function () { return chunk5TTZQF4X_cjs.MorphAPIClient; }
36
21
  });
37
- module.exports = __toCommonJS(core_exports);
38
-
39
- // package.json
40
- var package_default = {
41
- name: "@morphllm/morphsdk",
42
- version: "0.2.202",
43
- description: "TypeScript SDK and CLI for Morph Fast Apply integration",
44
- type: "module",
45
- main: "./dist/index.cjs",
46
- module: "./dist/index.js",
47
- types: "./dist/index.d.ts",
48
- exports: {
49
- ".": {
50
- types: "./dist/index.d.ts",
51
- import: "./dist/index.js",
52
- require: "./dist/index.cjs"
53
- },
54
- "./logger": {
55
- types: "./dist/logger.d.ts",
56
- import: "./dist/logger.js",
57
- require: "./dist/logger.cjs"
58
- },
59
- "./edge": {
60
- types: "./dist/edge.d.ts",
61
- import: "./dist/edge.js",
62
- require: "./dist/edge.cjs"
63
- },
64
- "./tools/warp-grep": {
65
- types: "./dist/tools/warp_grep/index.d.ts",
66
- import: "./dist/tools/warp_grep/index.js",
67
- require: "./dist/tools/warp_grep/index.cjs"
68
- },
69
- "./tools/warp-grep/openai": {
70
- types: "./dist/tools/warp_grep/openai.d.ts",
71
- import: "./dist/tools/warp_grep/openai.js",
72
- require: "./dist/tools/warp_grep/openai.cjs"
73
- },
74
- "./tools/warp-grep/anthropic": {
75
- types: "./dist/tools/warp_grep/anthropic.d.ts",
76
- import: "./dist/tools/warp_grep/anthropic.js",
77
- require: "./dist/tools/warp_grep/anthropic.cjs"
78
- },
79
- "./tools/warp-grep/vercel": {
80
- types: "./dist/tools/warp_grep/vercel.d.ts",
81
- import: "./dist/tools/warp_grep/vercel.js",
82
- require: "./dist/tools/warp_grep/vercel.cjs"
83
- },
84
- "./tools/warp-grep/client": {
85
- types: "./dist/tools/warp_grep/client.d.ts",
86
- import: "./dist/tools/warp_grep/client.js",
87
- require: "./dist/tools/warp_grep/client.cjs"
88
- },
89
- "./tools/warp-grep/gemini": {
90
- types: "./dist/tools/warp_grep/gemini.d.ts",
91
- import: "./dist/tools/warp_grep/gemini.js",
92
- require: "./dist/tools/warp_grep/gemini.cjs"
93
- },
94
- "./tools/warp-grep/harness": {
95
- types: "./dist/tools/warp_grep/harness.d.ts",
96
- import: "./dist/tools/warp_grep/harness.js",
97
- require: "./dist/tools/warp_grep/harness.cjs"
98
- },
99
- "./tools/fastapply": {
100
- types: "./dist/tools/fastapply/index.d.ts",
101
- import: "./dist/tools/fastapply/index.js",
102
- require: "./dist/tools/fastapply/index.cjs"
103
- },
104
- "./tools/fastapply/anthropic": {
105
- types: "./dist/tools/fastapply/anthropic.d.ts",
106
- import: "./dist/tools/fastapply/anthropic.js",
107
- require: "./dist/tools/fastapply/anthropic.cjs"
108
- },
109
- "./tools/fastapply/openai": {
110
- types: "./dist/tools/fastapply/openai.d.ts",
111
- import: "./dist/tools/fastapply/openai.js",
112
- require: "./dist/tools/fastapply/openai.cjs"
113
- },
114
- "./tools/fastapply/vercel": {
115
- types: "./dist/tools/fastapply/vercel.d.ts",
116
- import: "./dist/tools/fastapply/vercel.js",
117
- require: "./dist/tools/fastapply/vercel.cjs"
118
- },
119
- "./modelrouter": {
120
- types: "./dist/modelrouter/index.d.ts",
121
- import: "./dist/modelrouter/index.js",
122
- require: "./dist/modelrouter/index.cjs"
123
- },
124
- "./tools/compact": {
125
- types: "./dist/tools/compact/index.d.ts",
126
- import: "./dist/tools/compact/index.js",
127
- require: "./dist/tools/compact/index.cjs"
128
- },
129
- "./subagents": {
130
- types: "./dist/subagents/index.d.ts",
131
- import: "./dist/subagents/index.js",
132
- require: "./dist/subagents/index.cjs"
133
- },
134
- "./subagents/vercel": {
135
- types: "./dist/subagents/vercel.d.ts",
136
- import: "./dist/subagents/vercel.js",
137
- require: "./dist/subagents/vercel.cjs"
138
- },
139
- "./subagents/anthropic": {
140
- types: "./dist/subagents/anthropic.d.ts",
141
- import: "./dist/subagents/anthropic.js",
142
- require: "./dist/subagents/anthropic.cjs"
143
- },
144
- "./ai-sdk": {
145
- types: "./dist/ai-sdk/index.d.ts",
146
- import: "./dist/ai-sdk/index.js",
147
- require: "./dist/ai-sdk/index.cjs"
148
- }
149
- },
150
- files: [
151
- "dist/**/*.js",
152
- "dist/**/*.cjs",
153
- "dist/**/*.d.ts",
154
- "!dist/**/__tests__/**",
155
- "!dist/**/*.test.*"
156
- ],
157
- scripts: {
158
- 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/warp_grep/index.ts tools/warp_grep/client.ts tools/warp_grep/openai.ts tools/warp_grep/anthropic.ts tools/warp_grep/vercel.ts tools/warp_grep/gemini.ts tools/warp_grep/harness.ts tools/warp_grep/agent/config.ts tools/warp_grep/agent/parser.ts tools/warp_grep/agent/runner.ts tools/warp_grep/agent/types.ts tools/warp_grep/agent/formatter.ts tools/warp_grep/providers/types.ts tools/warp_grep/providers/local.ts tools/warp_grep/providers/remote.ts tools/warp_grep/providers/code_storage_http.ts tools/warp_grep/tools/grep.ts tools/warp_grep/tools/analyse.ts tools/warp_grep/tools/read.ts tools/warp_grep/tools/finish.ts tools/warp_grep/utils/paths.ts tools/warp_grep/utils/github.ts tools/warp_grep/utils/ripgrep.ts tools/warp_grep/utils/format.ts tools/warp_grep/utils/files.ts modelrouter/index.ts modelrouter/core.ts modelrouter/types.ts tools/compact/index.ts tools/compact/core.ts tools/compact/types.ts tools/utils/resilience.ts subagents/index.ts subagents/types.ts subagents/prompts.ts subagents/vercel.ts subagents/anthropic.ts --format esm,cjs --clean --dts --dts-resolve && tsup ai-sdk/index.ts --format esm,cjs --dts --no-clean --out-dir dist/ai-sdk",
159
- prepare: "npm run build",
160
- typecheck: "tsc --noEmit && tsc --noEmit -p ai-sdk/tsconfig.json",
161
- lint: "eslint .",
162
- test: "vitest run",
163
- "test:watch": "vitest watch",
164
- "test:anthropic": "vitest run anthropic",
165
- "test:openai": "vitest run openai",
166
- "test:vercel": "vitest run vercel",
167
- "test:git": "vitest run git",
168
- "test:agent": "npx tsx tests/fullAgentTest.ts",
169
- "test:integration": "npx tsx tests/fullIntegrationTest.ts",
170
- "test:e2e": "vitest run --config vitest.e2e.config.ts",
171
- "release:patch": "npm version patch && npm publish",
172
- "release:minor": "npm version minor && npm publish",
173
- "release:major": "npm version major && npm publish"
174
- },
175
- keywords: [
176
- "morph",
177
- "fast-apply",
178
- "cli",
179
- "sdk",
180
- "edit-file"
181
- ],
182
- engines: {
183
- node: ">=18"
184
- },
185
- license: "MIT",
186
- dependencies: {
187
- "@vscode/ripgrep": "^1.17.0",
188
- ai: ">=5.0.0",
189
- diff: "^7.0.0",
190
- openai: "^4.52.7",
191
- zod: ">=3.23.0"
192
- },
193
- devDependencies: {
194
- "@ai-sdk/anthropic": "^2.0.70",
195
- "@ai-sdk/openai": "^2.0.35",
196
- "@anthropic-ai/sdk": "^0.30.1",
197
- "@google/generative-ai": "^0.24.1",
198
- "@types/diff": "^7.0.2",
199
- "@types/node": "^20.14.10",
200
- "@typescript-eslint/eslint-plugin": "^7.18.0",
201
- "@typescript-eslint/parser": "^7.18.0",
202
- dotenv: "^16.4.5",
203
- eslint: "^8.57.0",
204
- shx: "^0.3.4",
205
- tsup: "^8.5.0",
206
- tsx: "^4.16.2",
207
- typescript: "^5.5.4",
208
- vitest: "^2.1.6"
209
- },
210
- peerDependencies: {
211
- "@ai-sdk/openai-compatible": ">=2.0.74 <4",
212
- "@anthropic-ai/sdk": ">=0.25.0",
213
- "@google/generative-ai": ">=0.21.0",
214
- ai: ">=5.0.0",
215
- zod: ">=3.23.0"
216
- },
217
- peerDependenciesMeta: {
218
- "@anthropic-ai/sdk": {
219
- optional: true
220
- },
221
- "@google/generative-ai": {
222
- optional: true
223
- },
224
- ai: {
225
- optional: true
226
- },
227
- zod: {
228
- optional: true
229
- }
230
- },
231
- publishConfig: {
232
- access: "public"
233
- }
234
- };
235
-
236
- // version.ts
237
- var SDK_VERSION = package_default.version;
238
-
239
- // tools/utils/resilience.ts
240
- var DEFAULT_RETRY_CONFIG = {
241
- maxRetries: 3,
242
- initialDelay: 1e3,
243
- maxDelay: 3e4,
244
- backoffMultiplier: 2,
245
- retryableErrors: ["ECONNREFUSED", "ETIMEDOUT", "ENOTFOUND"]
246
- };
247
- async function fetchWithRetry(url, options, retryConfig = {}) {
248
- const {
249
- maxRetries = DEFAULT_RETRY_CONFIG.maxRetries,
250
- initialDelay = DEFAULT_RETRY_CONFIG.initialDelay,
251
- maxDelay = DEFAULT_RETRY_CONFIG.maxDelay,
252
- backoffMultiplier = DEFAULT_RETRY_CONFIG.backoffMultiplier,
253
- retryableErrors = DEFAULT_RETRY_CONFIG.retryableErrors,
254
- onRetry
255
- } = retryConfig;
256
- let lastError = null;
257
- let delay = initialDelay;
258
- options = { ...options, headers: { "X-Morph-SDK-Version": SDK_VERSION, ...options.headers } };
259
- for (let attempt = 0; attempt <= maxRetries; attempt++) {
260
- try {
261
- const response = await fetch(url, options);
262
- if (response.status === 429 || response.status === 503) {
263
- if (attempt < maxRetries) {
264
- const retryAfter = response.headers.get("Retry-After");
265
- const waitTime = retryAfter ? parseInt(retryAfter) * 1e3 : Math.min(delay, maxDelay);
266
- const error = new Error(`HTTP ${response.status}: Retrying after ${waitTime}ms`);
267
- if (onRetry) {
268
- onRetry(attempt + 1, error);
269
- }
270
- await sleep(waitTime);
271
- delay *= backoffMultiplier;
272
- continue;
273
- }
274
- }
275
- return response;
276
- } catch (error) {
277
- lastError = error;
278
- const isRetryable = retryableErrors.some(
279
- (errType) => lastError?.message?.includes(errType)
280
- );
281
- if (!isRetryable || attempt === maxRetries) {
282
- throw lastError;
283
- }
284
- const waitTime = Math.min(delay, maxDelay);
285
- if (onRetry) {
286
- onRetry(attempt + 1, lastError);
287
- }
288
- await sleep(waitTime);
289
- delay *= backoffMultiplier;
290
- }
291
- }
292
- throw lastError || new Error("Max retries exceeded");
293
- }
294
- async function withTimeout(promise, timeoutMs, errorMessage) {
295
- let timeoutId;
296
- const timeoutPromise = new Promise((_, reject) => {
297
- timeoutId = setTimeout(() => {
298
- reject(new Error(errorMessage || `Operation timed out after ${timeoutMs}ms`));
299
- }, timeoutMs);
300
- });
301
- try {
302
- const result = await Promise.race([promise, timeoutPromise]);
303
- clearTimeout(timeoutId);
304
- return result;
305
- } catch (error) {
306
- clearTimeout(timeoutId);
307
- throw error;
308
- }
309
- }
310
- function sleep(ms) {
311
- return new Promise((resolve) => setTimeout(resolve, ms));
312
- }
313
- var MorphError = class extends Error {
314
- constructor(message, code, statusCode, retryable = false) {
315
- super(message);
316
- this.code = code;
317
- this.statusCode = statusCode;
318
- this.retryable = retryable;
319
- this.name = "MorphError";
320
- }
321
- };
322
-
323
- // logger.ts
324
- var MorphLogger = class {
325
- enabled;
326
- fileStream;
327
- /** Resolves once the file stream is initialized (or immediately if no file logging). */
328
- ready;
329
- constructor() {
330
- this.enabled = typeof process !== "undefined" && (process.env.MORPH_DEBUG === "1" || !!process.env.MORPH_LOG_FILE);
331
- this.fileStream = null;
332
- const f = typeof process !== "undefined" ? process.env.MORPH_LOG_FILE : void 0;
333
- if (f) {
334
- this.ready = import("fs").then((fs) => {
335
- this.fileStream = fs.createWriteStream(f, { flags: "a" });
336
- }).catch(() => {
337
- });
338
- } else {
339
- this.ready = Promise.resolve();
340
- }
341
- }
342
- debug(component, msg, data) {
343
- this._log("debug", component, msg, data);
344
- }
345
- info(component, msg, data) {
346
- this._log("info", component, msg, data);
347
- }
348
- warn(component, msg, data) {
349
- this._log("warn", component, msg, data);
350
- }
351
- error(component, msg, data) {
352
- this._log("error", component, msg, data);
353
- }
354
- enable() {
355
- this.enabled = true;
356
- }
357
- get isEnabled() {
358
- return this.enabled;
359
- }
360
- _log(level, component, msg, data) {
361
- if (level !== "error" && !this.enabled) return;
362
- const ts = (/* @__PURE__ */ new Date()).toISOString();
363
- const prefix = `[${ts}] [${level.toUpperCase()}] [${component}]`;
364
- console.error(data ? `${prefix} ${msg} ${JSON.stringify(data)}` : `${prefix} ${msg}`);
365
- this.fileStream?.write(JSON.stringify({ ts, level, component, msg, ...data && { data } }) + "\n");
366
- }
367
- };
368
- var logger = new MorphLogger();
369
-
370
- // core/error.ts
371
- async function toMorphError(response) {
372
- let message = `Morph API request failed (${response.status})`;
373
- let code = "api_error";
374
- try {
375
- const body = await response.json();
376
- message = body.error?.message ?? body.message ?? message;
377
- code = body.error?.code ?? body.error?.type ?? code;
378
- } catch {
379
- }
380
- if (response.status === 401) code = "authentication_error";
381
- if (response.status === 429) code = "rate_limit_exceeded";
382
- const retryable = response.status === 429 || response.status === 503;
383
- return new MorphError(message, code, response.status, retryable);
384
- }
385
-
386
- // core/client.ts
387
- var DEFAULT_BASE_URL = "https://api.morphllm.com";
388
- var DEFAULT_REPOS_URL = "https://repos.morphllm.com";
389
- var DEFAULT_TIMEOUT = 6e4;
390
- var env = (name) => typeof process !== "undefined" ? process.env?.[name] : void 0;
391
- var stripTrailingSlash = (url) => url.replace(/\/+$/, "");
392
- var MorphAPIClient = class {
393
- /** Explicit key as provided; resolved against env at request time. */
394
- apiKey;
395
- baseURL;
396
- reposURL;
397
- /** Explicit default timeout (ms), if set. The request default is applied lazily so
398
- * resources can read an undefined value and supply their own fallback. */
399
- timeout;
400
- retryConfig;
401
- debug;
402
- constructor(options = {}) {
403
- this.apiKey = options.apiKey;
404
- this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);
405
- this.reposURL = stripTrailingSlash(options.reposURL ?? env("MORPH_SEARCH_URL") ?? DEFAULT_REPOS_URL);
406
- this.timeout = options.timeout;
407
- this.retryConfig = options.retryConfig;
408
- this.debug = options.debug ?? false;
409
- if (this.debug) logger.enable();
410
- }
411
- /** The key actually used for requests: explicit, else `MORPH_API_KEY`. */
412
- resolveApiKey() {
413
- return this.apiKey ?? env("MORPH_API_KEY");
414
- }
415
- /** Headers shared with tools that bring their own HTTP client (FastApply/WarpGrep via the `openai` package). */
416
- defaultHeaders() {
417
- return { "X-Morph-SDK-Version": SDK_VERSION };
418
- }
419
- buildURL(path, baseURL) {
420
- if (/^https?:\/\//i.test(path)) return path;
421
- const base = stripTrailingSlash(baseURL ?? this.baseURL);
422
- return `${base}${path.startsWith("/") ? "" : "/"}${path}`;
423
- }
424
- buildHeaders(apiKey, extra) {
425
- return {
426
- "Content-Type": "application/json",
427
- "X-Morph-SDK-Version": SDK_VERSION,
428
- Authorization: `Bearer ${apiKey}`,
429
- ...extra
430
- };
431
- }
432
- applyQuery(url, query) {
433
- if (!query) return url;
434
- const params = new URLSearchParams();
435
- for (const [key, value] of Object.entries(query)) {
436
- if (value !== void 0 && value !== null) params.set(key, String(value));
437
- }
438
- const qs = params.toString();
439
- return qs ? `${url}${url.includes("?") ? "&" : "?"}${qs}` : url;
440
- }
441
- async request(method, path, opts = {}) {
442
- const apiKey = this.resolveApiKey();
443
- if (!apiKey) {
444
- throw new MorphError(
445
- "Morph API key not found. Set the MORPH_API_KEY environment variable or pass apiKey in config.",
446
- "missing_api_key",
447
- 401
448
- );
449
- }
450
- const url = this.applyQuery(this.buildURL(path, opts.baseURL), opts.query);
451
- const timeout = opts.timeout ?? this.timeout ?? DEFAULT_TIMEOUT;
452
- const init = {
453
- method,
454
- headers: this.buildHeaders(apiKey, opts.headers),
455
- ...opts.body !== void 0 ? { body: JSON.stringify(opts.body) } : {},
456
- ...opts.signal ? { signal: opts.signal } : {}
457
- };
458
- logger.debug("MorphAPIClient", "request", { method, url });
459
- const response = await withTimeout(
460
- fetchWithRetry(url, init, this.retryConfig ?? {}),
461
- timeout,
462
- `Morph request to ${url} timed out after ${timeout}ms`
463
- );
464
- if (!response.ok) throw await toMorphError(response);
465
- if (opts.stream) return response;
466
- if (response.status === 204) return void 0;
467
- const text = await response.text();
468
- return text ? JSON.parse(text) : void 0;
469
- }
470
- get(path, opts) {
471
- return this.request("GET", path, opts);
472
- }
473
- post(path, opts) {
474
- return this.request("POST", path, opts);
475
- }
476
- delete(path, opts) {
477
- return this.request("DELETE", path, opts);
478
- }
479
- };
480
-
481
- // core/resource.ts
482
- var APIResource = class {
483
- _client;
484
- constructor(client) {
485
- this._client = client;
486
- }
487
- };
488
- // Annotate the CommonJS export names for ESM import in node:
489
- 0 && (module.exports = {
490
- APIResource,
491
- MorphAPIClient,
492
- toMorphError
22
+ Object.defineProperty(exports, "toMorphError", {
23
+ enumerable: true,
24
+ get: function () { return chunkYAUXTFIN_cjs.toMorphError; }
25
+ });
26
+ Object.defineProperty(exports, "APIResource", {
27
+ enumerable: true,
28
+ get: function () { return chunkAWFZKS27_cjs.APIResource; }
493
29
  });
@@ -2,3 +2,5 @@ export { MorphAPIClient, MorphAPIClientOptions, RequestOptions } from './client.
2
2
  export { APIResource } from './resource.js';
3
3
  export { toMorphError } from './error.js';
4
4
  import '../tools/utils/resilience.js';
5
+ import '../guard-CvW03v4u.js';
6
+ import '../tools/pii/types.js';
@@ -1,19 +1,12 @@
1
- import "../chunk-LDM7RNNN.js";
2
- import {
3
- MorphAPIClient
4
- } from "../chunk-ICCGLO6V.js";
5
- import "../chunk-6WP7EA4F.js";
6
- import {
7
- toMorphError
8
- } from "../chunk-YAM6P5OQ.js";
9
- import "../chunk-VQDDL3UH.js";
10
- import "../chunk-E6TL6MIH.js";
11
- import {
12
- APIResource
13
- } from "../chunk-NRG6QX3L.js";
14
- import "../chunk-MLKGABMK.js";
15
- export {
16
- APIResource,
17
- MorphAPIClient,
18
- toMorphError
19
- };
1
+ import '../chunk-LDM7RNNN.js';
2
+ export { MorphAPIClient } from '../chunk-IGXNLXPN.js';
3
+ import '../chunk-6WP7EA4F.js';
4
+ import '../chunk-E63OPKP7.js';
5
+ import '../chunk-OENJO7YW.js';
6
+ import '../chunk-2GMG5XKU.js';
7
+ import '../chunk-ZX6T3LNG.js';
8
+ export { toMorphError } from '../chunk-564XJOQP.js';
9
+ import '../chunk-4TZBUFVP.js';
10
+ import '../chunk-GYE3FY6Z.js';
11
+ export { APIResource } from '../chunk-NRG6QX3L.js';
12
+ import '../chunk-MLKGABMK.js';
@@ -1,35 +1,11 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
19
2
 
20
- // core/resource.ts
21
- var resource_exports = {};
22
- __export(resource_exports, {
23
- APIResource: () => APIResource
24
- });
25
- module.exports = __toCommonJS(resource_exports);
26
- var APIResource = class {
27
- _client;
28
- constructor(client) {
29
- this._client = client;
30
- }
31
- };
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- APIResource
3
+ var chunkAWFZKS27_cjs = require('../chunk-AWFZKS27.cjs');
4
+ require('../chunk-75ZPJI57.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "APIResource", {
9
+ enumerable: true,
10
+ get: function () { return chunkAWFZKS27_cjs.APIResource; }
35
11
  });
@@ -1,5 +1,7 @@
1
1
  import { MorphAPIClient } from './client.js';
2
2
  import '../tools/utils/resilience.js';
3
+ import '../guard-CvW03v4u.js';
4
+ import '../tools/pii/types.js';
3
5
 
4
6
  /**
5
7
  * Base class for every API resource (FastApply, Compact, …).
@@ -1,7 +1,2 @@
1
- import {
2
- APIResource
3
- } from "../chunk-NRG6QX3L.js";
4
- import "../chunk-MLKGABMK.js";
5
- export {
6
- APIResource
7
- };
1
+ export { APIResource } from '../chunk-NRG6QX3L.js';
2
+ import '../chunk-MLKGABMK.js';