@morphllm/morphsdk 0.2.62 → 0.2.64

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 (114) hide show
  1. package/dist/{chunk-PKPJWARB.js → chunk-5QIWYEHJ.js} +2 -2
  2. package/dist/{chunk-3M4DOG6N.js → chunk-5QRN3JNB.js} +9 -9
  3. package/dist/chunk-5QRN3JNB.js.map +1 -0
  4. package/dist/{chunk-GZ7TJ7UB.js → chunk-BLKHVDYQ.js} +3 -3
  5. package/dist/{chunk-6Y5JB4JC.js → chunk-DCIUCDWJ.js} +15 -7
  6. package/dist/{chunk-6Y5JB4JC.js.map → chunk-DCIUCDWJ.js.map} +1 -1
  7. package/dist/{chunk-XWSKUQVQ.js → chunk-DT6MPBD4.js} +8 -8
  8. package/dist/{chunk-LHKFRPUO.js → chunk-IQFKDBQD.js} +3 -3
  9. package/dist/{chunk-BHNJEBQJ.js → chunk-IUG2FHNN.js} +2 -2
  10. package/dist/{chunk-Z75HCPIE.js → chunk-NTCSWQEM.js} +3 -3
  11. package/dist/chunk-PZ5AY32C.js +10 -0
  12. package/dist/{chunk-IXNSTNS7.js → chunk-QZNGKOCZ.js} +2 -2
  13. package/dist/{chunk-S3RCM32V.js → chunk-S6FZAPJ7.js} +3 -3
  14. package/dist/{chunk-Y7CPJGLU.js → chunk-SUBBMTMY.js} +5 -5
  15. package/dist/chunk-SUBBMTMY.js.map +1 -0
  16. package/dist/{chunk-563RLKFC.js → chunk-TPP2UGQP.js} +7 -21
  17. package/dist/chunk-TPP2UGQP.js.map +1 -0
  18. package/dist/{chunk-44GS4GJJ.js → chunk-V2IEG55Y.js} +3 -3
  19. package/dist/{chunk-JNOZPU44.js → chunk-ZO4PPFCZ.js} +2 -2
  20. package/dist/client.cjs +27 -48
  21. package/dist/client.cjs.map +1 -1
  22. package/dist/client.js +14 -14
  23. package/dist/{finish-kXAcUJyB.d.ts → finish-pPJfB0uO.d.ts} +2 -2
  24. package/dist/git/client.js +1 -1
  25. package/dist/git/config.js +1 -1
  26. package/dist/git/index.js +1 -1
  27. package/dist/index.cjs +27 -48
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.js +15 -15
  30. package/dist/modelrouter/core.js +1 -1
  31. package/dist/modelrouter/index.js +1 -1
  32. package/dist/tools/browser/anthropic.js +1 -1
  33. package/dist/tools/browser/core.js +1 -1
  34. package/dist/tools/browser/index.js +1 -1
  35. package/dist/tools/browser/live.js +1 -1
  36. package/dist/tools/browser/openai.js +1 -1
  37. package/dist/tools/browser/prompts.js +1 -1
  38. package/dist/tools/browser/vercel.js +1 -1
  39. package/dist/tools/codebase_search/anthropic.js +1 -1
  40. package/dist/tools/codebase_search/core.js +1 -1
  41. package/dist/tools/codebase_search/index.js +1 -1
  42. package/dist/tools/codebase_search/openai.js +1 -1
  43. package/dist/tools/codebase_search/prompts.js +1 -1
  44. package/dist/tools/codebase_search/vercel.js +1 -1
  45. package/dist/tools/fastapply/anthropic.js +2 -2
  46. package/dist/tools/fastapply/core.js +1 -1
  47. package/dist/tools/fastapply/index.js +4 -4
  48. package/dist/tools/fastapply/openai.js +2 -2
  49. package/dist/tools/fastapply/prompts.js +1 -1
  50. package/dist/tools/fastapply/vercel.js +2 -2
  51. package/dist/tools/index.js +4 -4
  52. package/dist/tools/utils/resilience.js +1 -1
  53. package/dist/tools/warp_grep/agent/config.js +1 -1
  54. package/dist/tools/warp_grep/agent/formatter.js +1 -1
  55. package/dist/tools/warp_grep/agent/parser.cjs +8 -8
  56. package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
  57. package/dist/tools/warp_grep/agent/parser.js +2 -2
  58. package/dist/tools/warp_grep/agent/prompt.js +1 -1
  59. package/dist/tools/warp_grep/agent/runner.cjs +21 -16
  60. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  61. package/dist/tools/warp_grep/agent/runner.js +4 -4
  62. package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
  63. package/dist/tools/warp_grep/agent/types.d.ts +2 -2
  64. package/dist/tools/warp_grep/anthropic.cjs +27 -48
  65. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  66. package/dist/tools/warp_grep/anthropic.js +8 -8
  67. package/dist/tools/warp_grep/client.cjs +27 -48
  68. package/dist/tools/warp_grep/client.cjs.map +1 -1
  69. package/dist/tools/warp_grep/client.js +7 -7
  70. package/dist/tools/warp_grep/gemini.cjs +27 -48
  71. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  72. package/dist/tools/warp_grep/gemini.js +8 -8
  73. package/dist/tools/warp_grep/harness.cjs +28 -46
  74. package/dist/tools/warp_grep/harness.cjs.map +1 -1
  75. package/dist/tools/warp_grep/harness.d.ts +1 -1
  76. package/dist/tools/warp_grep/harness.js +5 -5
  77. package/dist/tools/warp_grep/harness.js.map +1 -1
  78. package/dist/tools/warp_grep/index.cjs +30 -48
  79. package/dist/tools/warp_grep/index.cjs.map +1 -1
  80. package/dist/tools/warp_grep/index.d.ts +1 -1
  81. package/dist/tools/warp_grep/index.js +11 -11
  82. package/dist/tools/warp_grep/openai.cjs +27 -48
  83. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  84. package/dist/tools/warp_grep/openai.js +8 -8
  85. package/dist/tools/warp_grep/providers/local.cjs +6 -32
  86. package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
  87. package/dist/tools/warp_grep/providers/local.js +3 -3
  88. package/dist/tools/warp_grep/providers/remote.js +1 -1
  89. package/dist/tools/warp_grep/utils/files.js +1 -1
  90. package/dist/tools/warp_grep/utils/paths.js +1 -1
  91. package/dist/tools/warp_grep/utils/ripgrep.cjs +6 -42
  92. package/dist/tools/warp_grep/utils/ripgrep.cjs.map +1 -1
  93. package/dist/tools/warp_grep/utils/ripgrep.js +2 -2
  94. package/dist/tools/warp_grep/vercel.cjs +27 -48
  95. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  96. package/dist/tools/warp_grep/vercel.js +8 -8
  97. package/package.json +2 -4
  98. package/dist/chunk-3M4DOG6N.js.map +0 -1
  99. package/dist/chunk-563RLKFC.js.map +0 -1
  100. package/dist/chunk-5FUTL2UF.js +0 -22
  101. package/dist/chunk-Y7CPJGLU.js.map +0 -1
  102. package/dist/lib-GEPX5Y3T.js +0 -14
  103. package/dist/lib-GEPX5Y3T.js.map +0 -1
  104. /package/dist/{chunk-PKPJWARB.js.map → chunk-5QIWYEHJ.js.map} +0 -0
  105. /package/dist/{chunk-GZ7TJ7UB.js.map → chunk-BLKHVDYQ.js.map} +0 -0
  106. /package/dist/{chunk-XWSKUQVQ.js.map → chunk-DT6MPBD4.js.map} +0 -0
  107. /package/dist/{chunk-LHKFRPUO.js.map → chunk-IQFKDBQD.js.map} +0 -0
  108. /package/dist/{chunk-BHNJEBQJ.js.map → chunk-IUG2FHNN.js.map} +0 -0
  109. /package/dist/{chunk-Z75HCPIE.js.map → chunk-NTCSWQEM.js.map} +0 -0
  110. /package/dist/{chunk-5FUTL2UF.js.map → chunk-PZ5AY32C.js.map} +0 -0
  111. /package/dist/{chunk-IXNSTNS7.js.map → chunk-QZNGKOCZ.js.map} +0 -0
  112. /package/dist/{chunk-S3RCM32V.js.map → chunk-S6FZAPJ7.js.map} +0 -0
  113. /package/dist/{chunk-44GS4GJJ.js.map → chunk-V2IEG55Y.js.map} +0 -0
  114. /package/dist/{chunk-JNOZPU44.js.map → chunk-ZO4PPFCZ.js.map} +0 -0
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
8
  var __export = (target, all) => {
12
9
  for (var name in all)
13
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -30,15 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
27
  ));
31
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
29
 
33
- // node_modules/@vscode/ripgrep/lib/index.js
34
- var require_lib = __commonJS({
35
- "node_modules/@vscode/ripgrep/lib/index.js"(exports2, module2) {
36
- "use strict";
37
- var path5 = require("path");
38
- module2.exports.rgPath = path5.join(__dirname, `../bin/rg${process.platform === "win32" ? ".exe" : ""}`);
39
- }
40
- });
41
-
42
30
  // tools/warp_grep/index.ts
43
31
  var warp_grep_exports = {};
44
32
  __export(warp_grep_exports, {
@@ -431,19 +419,19 @@ function parseNestedXmlTools(text) {
431
419
  const filePath = getXmlElementText(fileContent, "path");
432
420
  const linesStr = getXmlElementText(fileContent, "lines");
433
421
  if (filePath && linesStr) {
434
- const ranges = [];
435
- for (const rangeStr of linesStr.split(",")) {
436
- if (rangeStr.trim() === "*") {
437
- ranges.push([1, 999999]);
438
- } else {
422
+ if (linesStr.trim() === "*") {
423
+ files.push({ path: filePath, lines: "*" });
424
+ } else {
425
+ const ranges = [];
426
+ for (const rangeStr of linesStr.split(",")) {
439
427
  const [s, e] = rangeStr.split("-").map((v) => parseInt(v.trim(), 10));
440
428
  if (Number.isFinite(s) && Number.isFinite(e)) {
441
429
  ranges.push([s, e]);
442
430
  }
443
431
  }
444
- }
445
- if (ranges.length > 0) {
446
- files.push({ path: filePath, lines: ranges });
432
+ if (ranges.length > 0) {
433
+ files.push({ path: filePath, lines: ranges });
434
+ }
447
435
  }
448
436
  }
449
437
  }
@@ -673,6 +661,9 @@ async function toolListDirectory(provider, args) {
673
661
  // tools/warp_grep/agent/tools/finish.ts
674
662
  function normalizeFinishFiles(files) {
675
663
  return files.map((f) => {
664
+ if (f.lines === "*") {
665
+ return { path: f.path, lines: "*" };
666
+ }
676
667
  const merged = mergeRanges(f.lines);
677
668
  return { path: f.path, lines: merged };
678
669
  });
@@ -680,13 +671,18 @@ function normalizeFinishFiles(files) {
680
671
  async function readFinishFiles(repoRoot, files, reader) {
681
672
  const out = [];
682
673
  for (const f of files) {
683
- const ranges = mergeRanges(f.lines);
684
- const chunks = [];
685
- for (const [s, e] of ranges) {
686
- const lines = await reader(f.path, s, e);
687
- chunks.push(lines.join("\n"));
674
+ if (f.lines === "*") {
675
+ const lines = await reader(f.path);
676
+ out.push({ path: f.path, ranges: "*", content: lines.join("\n") });
677
+ } else {
678
+ const ranges = mergeRanges(f.lines);
679
+ const chunks = [];
680
+ for (const [s, e] of ranges) {
681
+ const lines = await reader(f.path, s, e);
682
+ chunks.push(lines.join("\n"));
683
+ }
684
+ out.push({ path: f.path, ranges, content: chunks.join("\n") });
688
685
  }
689
- out.push({ path: f.path, ranges, content: chunks.join("\n") });
690
686
  }
691
687
  return out;
692
688
  }
@@ -1023,7 +1019,7 @@ async function runWarpGrep(config) {
1023
1019
  messages.push({ role: "assistant", content: assistantContent });
1024
1020
  const toolCalls = parser.parse(assistantContent);
1025
1021
  if (toolCalls.length === 0) {
1026
- errors.push({ message: "No tool calls produced by the model. Your MCP is likely out of date! Update it by running: npm cache clean --force && npx -y @morphllm/morphmcp@latest" });
1022
+ errors.push({ message: "No tool calls produced by the model. Your MCP is likely out of date! Update it by running: rm -rf ~/.npm/_npx && npm cache clean --force && npx -y @morphllm/morphmcp@latest" });
1027
1023
  terminationReason = "terminated";
1028
1024
  break;
1029
1025
  }
@@ -1087,7 +1083,7 @@ async function runWarpGrep(config) {
1087
1083
  }
1088
1084
  const parts = ["Relevant context found:"];
1089
1085
  for (const f of finishMeta.files) {
1090
- const ranges = f.lines.map(([s, e]) => `${s}-${e}`).join(", ");
1086
+ const ranges = f.lines === "*" ? "*" : f.lines.map(([s, e]) => `${s}-${e}`).join(", ");
1091
1087
  parts.push(`- ${f.path}: ${ranges}`);
1092
1088
  }
1093
1089
  const payload = parts.join("\n");
@@ -1126,20 +1122,9 @@ var import_path4 = __toESM(require("path"), 1);
1126
1122
 
1127
1123
  // tools/warp_grep/utils/ripgrep.ts
1128
1124
  var import_child_process = require("child_process");
1125
+ var import_ripgrep = require("@vscode/ripgrep");
1129
1126
  var resolvedRgPath = null;
1130
1127
  var rgPathChecked = false;
1131
- var bundledRgPath = null;
1132
- async function getBundledRgPath() {
1133
- if (bundledRgPath !== null) return bundledRgPath;
1134
- try {
1135
- const module2 = await Promise.resolve().then(() => __toESM(require_lib(), 1));
1136
- bundledRgPath = module2.rgPath;
1137
- return bundledRgPath;
1138
- } catch {
1139
- bundledRgPath = "";
1140
- return null;
1141
- }
1142
- }
1143
1128
  function spawnRg(rgBinary, args, opts) {
1144
1129
  return new Promise((resolve) => {
1145
1130
  const child = (0, import_child_process.spawn)(rgBinary, args, {
@@ -1170,14 +1155,11 @@ async function runRipgrep(args, opts) {
1170
1155
  return spawnRg(resolvedRgPath, args, opts);
1171
1156
  }
1172
1157
  if (!rgPathChecked) {
1173
- const bundledPath = await getBundledRgPath();
1174
- if (bundledPath) {
1175
- const result = await spawnRg(bundledPath, args, opts);
1176
- if (!isBinaryFailure(result)) {
1177
- resolvedRgPath = bundledPath;
1178
- rgPathChecked = true;
1179
- return result;
1180
- }
1158
+ const result = await spawnRg(import_ripgrep.rgPath, args, opts);
1159
+ if (!isBinaryFailure(result)) {
1160
+ resolvedRgPath = import_ripgrep.rgPath;
1161
+ rgPathChecked = true;
1162
+ return result;
1181
1163
  }
1182
1164
  const fallbackResult = await spawnRg("rg", args, opts);
1183
1165
  if (!isBinaryFailure(fallbackResult)) {