@morphllm/morphsdk 0.2.202 → 0.2.203

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 (180) hide show
  1. package/dist/chunk-2PPYWRMZ.js +3 -4
  2. package/dist/{chunk-SIFDK4AA.js → chunk-2UIOCSVJ.js} +3 -24
  3. package/dist/chunk-44OIEPIO.js +4 -23
  4. package/dist/chunk-4EQQGUZ7.cjs +104 -0
  5. package/dist/chunk-4OUGA3KS.js +1 -5
  6. package/dist/chunk-4R5MDGL6.cjs +280 -0
  7. package/dist/chunk-65W4I66Q.cjs +103 -0
  8. package/dist/{chunk-3CPI6ZIC.js → chunk-66THRMD7.js} +10 -35
  9. package/dist/chunk-6TZCVTW5.js +3 -4
  10. package/dist/chunk-6WP7EA4F.js +2 -4
  11. package/dist/chunk-74A4HLIO.cjs +42 -0
  12. package/dist/chunk-75ZPJI57.cjs +9 -0
  13. package/dist/chunk-7NA7X7W2.cjs +77 -0
  14. package/dist/chunk-7PJYY46L.cjs +2 -0
  15. package/dist/chunk-AFF6XYKL.cjs +71 -0
  16. package/dist/{chunk-2XU3XXUE.js → chunk-AJBZA23L.js} +3 -25
  17. package/dist/chunk-AWFZKS27.cjs +11 -0
  18. package/dist/{chunk-LVKKICOB.js → chunk-AXEKIRRY.js} +22 -62
  19. package/dist/chunk-B3FD67F2.cjs +256 -0
  20. package/dist/chunk-BJBWWIZV.cjs +2 -0
  21. package/dist/{chunk-UAZKHSEU.js → chunk-E3XNKAMI.js} +5 -15
  22. package/dist/{chunk-VQDDL3UH.js → chunk-E7FLETFO.js} +2 -8
  23. package/dist/{chunk-YAM6P5OQ.js → chunk-EI2M567U.js} +2 -6
  24. package/dist/chunk-EJTL2BOZ.cjs +42 -0
  25. package/dist/chunk-ETBRAKVV.js +1 -5
  26. package/dist/{chunk-6OYJC4TZ.js → chunk-EZ2OFDBJ.js} +5 -19
  27. package/dist/chunk-FBOZIVVQ.js +1 -0
  28. package/dist/{chunk-CAWQEHKP.js → chunk-GDFPZ3NJ.js} +4 -19
  29. package/dist/{chunk-UKXCGQPS.js → chunk-GIQAIHUI.js} +8 -33
  30. package/dist/chunk-GSUQGDCL.cjs +235 -0
  31. package/dist/{chunk-D6YJ5X3C.js → chunk-H3HRSRR5.js} +4 -12
  32. package/dist/chunk-HDP4QAZL.js +1 -4
  33. package/dist/chunk-HMLYJVZM.cjs +410 -0
  34. package/dist/chunk-IPJA3ZS6.cjs +10 -0
  35. package/dist/{chunk-XPHNS7NW.js → chunk-IUM6CQYX.js} +3 -12
  36. package/dist/{chunk-26K5EJD3.js → chunk-J56Q6C4Y.js} +4 -18
  37. package/dist/chunk-JBTR3FQD.cjs +135 -0
  38. package/dist/chunk-JNQKQKHS.cjs +81 -0
  39. package/dist/chunk-JOZC4T6C.cjs +168 -0
  40. package/dist/{chunk-JEVLCA5C.js → chunk-JUGNTIVU.js} +6 -19
  41. package/dist/{chunk-NFPRKZQ5.js → chunk-JY6COF3X.js} +5 -22
  42. package/dist/{chunk-ICCGLO6V.js → chunk-KLVJIC2O.js} +5 -17
  43. package/dist/chunk-KSZYOX6S.cjs +91 -0
  44. package/dist/chunk-KVGZ2TSG.cjs +274 -0
  45. package/dist/chunk-LDM7RNNN.js +1 -0
  46. package/dist/{chunk-65TUD7JV.js → chunk-LLQH6CCB.js} +10 -28
  47. package/dist/chunk-M34E2AMK.js +1 -5
  48. package/dist/chunk-MF56KEI4.js +1 -4
  49. package/dist/chunk-MLKGABMK.js +1 -3
  50. package/dist/chunk-MLPZKUCO.js +4 -5
  51. package/dist/chunk-MWXJ6DZ2.cjs +21 -0
  52. package/dist/{chunk-IBRBSDLT.js → chunk-N7UKZ5X7.js} +2 -6
  53. package/dist/chunk-NDUC7OV6.cjs +74 -0
  54. package/dist/{chunk-PDSIWL7I.js → chunk-NLACTMZT.js} +6 -19
  55. package/dist/chunk-NNKBKENK.cjs +15 -0
  56. package/dist/chunk-NRG6QX3L.js +1 -3
  57. package/dist/chunk-OCCGJ4S6.js +8 -0
  58. package/dist/chunk-ODY2NKQU.cjs +50 -0
  59. package/dist/chunk-OM5ZSXQW.cjs +91 -0
  60. package/dist/chunk-OOEORM7H.cjs +334 -0
  61. package/dist/chunk-OPDWMD4Q.js +1 -3
  62. package/dist/chunk-OSL4CNSO.js +7 -23
  63. package/dist/chunk-OXXMTDOY.cjs +86 -0
  64. package/dist/chunk-PA3UTI4A.js +1 -4
  65. package/dist/chunk-QEEAIXL5.cjs +74 -0
  66. package/dist/chunk-RYVW7RUM.js +2 -6
  67. package/dist/chunk-S6QBPXBI.cjs +107 -0
  68. package/dist/chunk-TL34BLQD.cjs +10 -0
  69. package/dist/chunk-TPZHMD7J.cjs +72 -0
  70. package/dist/chunk-UAPK3AIJ.js +1 -10
  71. package/dist/chunk-UF5IKELS.cjs +26 -0
  72. package/dist/chunk-UNX7V6P6.cjs +60 -0
  73. package/dist/chunk-UUCRWJJR.cjs +313 -0
  74. package/dist/chunk-VDFLPO7B.cjs +396 -0
  75. package/dist/chunk-VHD7CW5O.cjs +43 -0
  76. package/dist/chunk-VL4QNALG.cjs +50 -0
  77. package/dist/chunk-WR7LSUIR.cjs +213 -0
  78. package/dist/chunk-XE6D4J63.cjs +72 -0
  79. package/dist/chunk-ZLG2M2I4.cjs +21 -0
  80. package/dist/chunk-ZSHVXDA2.js +4 -10
  81. package/dist/client.cjs +40 -4360
  82. package/dist/client.js +32 -37
  83. package/dist/core/client.cjs +10 -476
  84. package/dist/core/client.js +6 -11
  85. package/dist/core/error.cjs +8 -251
  86. package/dist/core/error.js +4 -9
  87. package/dist/core/index.cjs +20 -488
  88. package/dist/core/index.js +8 -19
  89. package/dist/core/resource.cjs +9 -33
  90. package/dist/core/resource.js +2 -7
  91. package/dist/edge.cjs +62 -1111
  92. package/dist/edge.js +10 -42
  93. package/dist/index.cjs +115 -4431
  94. package/dist/index.js +39 -87
  95. package/dist/modelrouter/core.cjs +28 -648
  96. package/dist/modelrouter/core.js +8 -21
  97. package/dist/modelrouter/index.cjs +28 -648
  98. package/dist/modelrouter/index.js +8 -21
  99. package/dist/modelrouter/types.cjs +1 -17
  100. package/dist/modelrouter/types.js +1 -0
  101. package/dist/subagents/anthropic.cjs +27 -2784
  102. package/dist/subagents/anthropic.js +19 -24
  103. package/dist/subagents/index.cjs +14 -95
  104. package/dist/subagents/index.js +2 -11
  105. package/dist/subagents/prompts.cjs +14 -93
  106. package/dist/subagents/prompts.js +2 -11
  107. package/dist/subagents/types.cjs +1 -17
  108. package/dist/subagents/types.js +1 -0
  109. package/dist/subagents/vercel.cjs +27 -2761
  110. package/dist/subagents/vercel.js +19 -24
  111. package/dist/tools/compact/core.cjs +12 -548
  112. package/dist/tools/compact/core.js +8 -13
  113. package/dist/tools/compact/index.cjs +17 -595
  114. package/dist/tools/compact/index.js +9 -17
  115. package/dist/tools/compact/types.cjs +1 -17
  116. package/dist/tools/compact/types.js +1 -0
  117. package/dist/tools/fastapply/anthropic.cjs +27 -891
  118. package/dist/tools/fastapply/anthropic.js +11 -24
  119. package/dist/tools/fastapply/apply.cjs +28 -672
  120. package/dist/tools/fastapply/apply.js +4 -19
  121. package/dist/tools/fastapply/core.cjs +37 -1061
  122. package/dist/tools/fastapply/core.js +9 -29
  123. package/dist/tools/fastapply/index.cjs +62 -1062
  124. package/dist/tools/fastapply/index.js +14 -44
  125. package/dist/tools/fastapply/openai.cjs +32 -901
  126. package/dist/tools/fastapply/openai.js +11 -26
  127. package/dist/tools/fastapply/prompts.cjs +10 -62
  128. package/dist/tools/fastapply/prompts.js +2 -9
  129. package/dist/tools/fastapply/types.cjs +1 -17
  130. package/dist/tools/fastapply/types.js +1 -0
  131. package/dist/tools/fastapply/vercel.cjs +25 -897
  132. package/dist/tools/fastapply/vercel.js +11 -22
  133. package/dist/tools/index.cjs +62 -1062
  134. package/dist/tools/index.js +14 -44
  135. package/dist/tools/utils/resilience.cjs +15 -312
  136. package/dist/tools/utils/resilience.js +3 -12
  137. package/dist/tools/warp_grep/agent/config.cjs +16 -127
  138. package/dist/tools/warp_grep/agent/config.js +2 -11
  139. package/dist/tools/warp_grep/agent/formatter.cjs +12 -48
  140. package/dist/tools/warp_grep/agent/formatter.js +2 -9
  141. package/dist/tools/warp_grep/agent/parser.cjs +16 -83
  142. package/dist/tools/warp_grep/agent/parser.js +2 -11
  143. package/dist/tools/warp_grep/agent/runner.cjs +15 -1081
  144. package/dist/tools/warp_grep/agent/runner.js +7 -14
  145. package/dist/tools/warp_grep/agent/types.cjs +1 -17
  146. package/dist/tools/warp_grep/agent/types.js +1 -0
  147. package/dist/tools/warp_grep/anthropic.cjs +47 -2561
  148. package/dist/tools/warp_grep/anthropic.js +19 -35
  149. package/dist/tools/warp_grep/client.cjs +49 -2471
  150. package/dist/tools/warp_grep/client.js +17 -34
  151. package/dist/tools/warp_grep/gemini.cjs +48 -2490
  152. package/dist/tools/warp_grep/gemini.js +21 -41
  153. package/dist/tools/warp_grep/harness.cjs +81 -936
  154. package/dist/tools/warp_grep/harness.js +12 -51
  155. package/dist/tools/warp_grep/index.cjs +124 -2575
  156. package/dist/tools/warp_grep/index.js +24 -87
  157. package/dist/tools/warp_grep/openai.cjs +53 -2575
  158. package/dist/tools/warp_grep/openai.js +19 -37
  159. package/dist/tools/warp_grep/providers/code_storage_http.cjs +12 -65
  160. package/dist/tools/warp_grep/providers/code_storage_http.js +2 -9
  161. package/dist/tools/warp_grep/providers/local.cjs +10 -589
  162. package/dist/tools/warp_grep/providers/local.js +6 -11
  163. package/dist/tools/warp_grep/providers/remote.cjs +8 -331
  164. package/dist/tools/warp_grep/providers/remote.js +3 -8
  165. package/dist/tools/warp_grep/providers/types.cjs +1 -17
  166. package/dist/tools/warp_grep/providers/types.js +1 -0
  167. package/dist/tools/warp_grep/utils/files.cjs +9 -42
  168. package/dist/tools/warp_grep/utils/files.js +2 -7
  169. package/dist/tools/warp_grep/utils/github.cjs +9 -43
  170. package/dist/tools/warp_grep/utils/github.js +2 -7
  171. package/dist/tools/warp_grep/utils/paths.cjs +28 -104
  172. package/dist/tools/warp_grep/utils/paths.js +2 -17
  173. package/dist/tools/warp_grep/utils/ripgrep.cjs +9 -103
  174. package/dist/tools/warp_grep/utils/ripgrep.js +2 -7
  175. package/dist/tools/warp_grep/vercel.cjs +53 -2557
  176. package/dist/tools/warp_grep/vercel.js +19 -37
  177. package/dist/version.cjs +7 -225
  178. package/dist/version.js +2 -7
  179. package/package.json +2 -2
  180. package/dist/chunk-E6TL6MIH.js +0 -203
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ var child_process = require('child_process');
4
+
5
+ // tools/warp_grep/utils/ripgrep.ts
6
+ var resolvedRgPath = null;
7
+ var rgPathChecked = false;
8
+ function spawnRg(rgBinary, args, opts) {
9
+ return new Promise((resolve) => {
10
+ const child = child_process.spawn(rgBinary, args, {
11
+ cwd: opts?.cwd,
12
+ env: { ...process.env, ...opts?.env || {} },
13
+ stdio: ["ignore", "pipe", "pipe"]
14
+ });
15
+ let stdout = "";
16
+ let stderr = "";
17
+ child.stdout.on("data", (d) => stdout += d.toString());
18
+ child.stderr.on("data", (d) => stderr += d.toString());
19
+ child.on("close", (code) => {
20
+ resolve({ stdout, stderr, exitCode: typeof code === "number" ? code : -1 });
21
+ });
22
+ child.on("error", () => {
23
+ resolve({ stdout: "", stderr: "Failed to spawn ripgrep.", exitCode: -1 });
24
+ });
25
+ });
26
+ }
27
+ async function preferredRgPath() {
28
+ try {
29
+ return (await import('@vscode/ripgrep')).rgPath ?? "rg";
30
+ } catch {
31
+ return "rg";
32
+ }
33
+ }
34
+ function isBinaryFailure(result) {
35
+ if (result.exitCode === -1) return true;
36
+ if (result.stderr.includes("jemalloc") || result.stderr.includes("Unsupported system page size")) return true;
37
+ if (result.exitCode === 134) return true;
38
+ return false;
39
+ }
40
+ async function runRipgrep(args, opts) {
41
+ if (rgPathChecked && resolvedRgPath) {
42
+ return spawnRg(resolvedRgPath, args, opts);
43
+ }
44
+ if (!rgPathChecked) {
45
+ const rgPath = await preferredRgPath();
46
+ const result = await spawnRg(rgPath, args, opts);
47
+ if (!isBinaryFailure(result)) {
48
+ resolvedRgPath = rgPath;
49
+ rgPathChecked = true;
50
+ return result;
51
+ }
52
+ const fallbackResult = await spawnRg("rg", args, opts);
53
+ if (!isBinaryFailure(fallbackResult)) {
54
+ resolvedRgPath = "rg";
55
+ rgPathChecked = true;
56
+ return fallbackResult;
57
+ }
58
+ rgPathChecked = true;
59
+ return {
60
+ stdout: "",
61
+ stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
62
+ exitCode: -1
63
+ };
64
+ }
65
+ return {
66
+ stdout: "",
67
+ stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
68
+ exitCode: -1
69
+ };
70
+ }
71
+
72
+ exports.runRipgrep = runRipgrep;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ var chunkOM5ZSXQW_cjs = require('./chunk-OM5ZSXQW.cjs');
4
+
5
+ // core/error.ts
6
+ async function toMorphError(response) {
7
+ let message = `Morph API request failed (${response.status})`;
8
+ let code = "api_error";
9
+ try {
10
+ const body = await response.json();
11
+ message = body.error?.message ?? body.message ?? message;
12
+ code = body.error?.code ?? body.error?.type ?? code;
13
+ } catch {
14
+ }
15
+ if (response.status === 401) code = "authentication_error";
16
+ if (response.status === 429) code = "rate_limit_exceeded";
17
+ const retryable = response.status === 429 || response.status === 503;
18
+ return new chunkOM5ZSXQW_cjs.MorphError(message, code, response.status, retryable);
19
+ }
20
+
21
+ exports.toMorphError = toMorphError;
@@ -1,6 +1,7 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
1
4
  // tools/warp_grep/utils/paths.ts
2
- import fs from "fs";
3
- import path from "path";
4
5
  function resolveUnderRepo(repoRoot, targetPath) {
5
6
  const absRoot = path.resolve(repoRoot);
6
7
  const resolved = path.resolve(absRoot, targetPath);
@@ -58,11 +59,4 @@ function isTextualFile(filePath, maxBytes = 2e6) {
58
59
  }
59
60
  }
60
61
 
61
- export {
62
- resolveUnderRepo,
63
- ensureWithinRepo,
64
- toRepoRelative,
65
- isSymlink,
66
- fixPathRepetition,
67
- isTextualFile
68
- };
62
+ export { ensureWithinRepo, fixPathRepetition, isSymlink, isTextualFile, resolveUnderRepo, toRepoRelative };