@morphllm/morphsdk 0.2.60 → 0.2.63
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.
- package/dist/{chunk-2CASO3ZO.js → chunk-3SHLMXBV.js} +4 -4
- package/dist/{chunk-2CASO3ZO.js.map → chunk-3SHLMXBV.js.map} +1 -1
- package/dist/{chunk-6N6ZYZYD.js → chunk-3WMLFUAR.js} +3 -3
- package/dist/{chunk-TPP2UGQP.js → chunk-563RLKFC.js} +21 -7
- package/dist/chunk-563RLKFC.js.map +1 -0
- package/dist/chunk-5FUTL2UF.js +22 -0
- package/dist/{chunk-YV75OQTE.js → chunk-5QRN3JNB.js} +10 -34
- package/dist/chunk-5QRN3JNB.js.map +1 -0
- package/dist/{chunk-IUG2FHNN.js → chunk-BHNJEBQJ.js} +2 -2
- package/dist/{chunk-6Y5JB4JC.js → chunk-DCIUCDWJ.js} +15 -7
- package/dist/{chunk-6Y5JB4JC.js.map → chunk-DCIUCDWJ.js.map} +1 -1
- package/dist/{chunk-4VGOBA2J.js → chunk-GJ573YH3.js} +3 -3
- package/dist/{chunk-3IQIT6MC.js → chunk-GM5VR33N.js} +3 -3
- package/dist/{chunk-QZNGKOCZ.js → chunk-IXNSTNS7.js} +2 -2
- package/dist/{chunk-ZO4PPFCZ.js → chunk-JNOZPU44.js} +2 -2
- package/dist/{chunk-5QIWYEHJ.js → chunk-PKPJWARB.js} +2 -2
- package/dist/{chunk-ILJ3J5IA.js → chunk-PNIQNTXR.js} +3 -3
- package/dist/{chunk-FN4EP3WY.js → chunk-T6677HCA.js} +8 -8
- package/dist/{chunk-374N3GIA.js → chunk-TTBXKDCT.js} +3 -3
- package/dist/client.cjs +53 -46
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +14 -14
- package/dist/{finish-kXAcUJyB.d.ts → finish-pPJfB0uO.d.ts} +2 -2
- package/dist/git/client.js +1 -1
- package/dist/git/config.js +1 -1
- package/dist/git/index.js +1 -1
- package/dist/index.cjs +53 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -15
- package/dist/lib-GEPX5Y3T.js +14 -0
- package/dist/lib-GEPX5Y3T.js.map +1 -0
- package/dist/modelrouter/core.js +1 -1
- package/dist/modelrouter/index.js +1 -1
- package/dist/tools/browser/anthropic.js +1 -1
- package/dist/tools/browser/core.js +1 -1
- package/dist/tools/browser/index.js +1 -1
- package/dist/tools/browser/live.js +1 -1
- package/dist/tools/browser/openai.js +1 -1
- package/dist/tools/browser/prompts.js +1 -1
- package/dist/tools/browser/vercel.js +1 -1
- package/dist/tools/codebase_search/anthropic.js +1 -1
- package/dist/tools/codebase_search/core.js +1 -1
- package/dist/tools/codebase_search/index.js +1 -1
- package/dist/tools/codebase_search/openai.js +1 -1
- package/dist/tools/codebase_search/prompts.js +1 -1
- package/dist/tools/codebase_search/vercel.js +1 -1
- package/dist/tools/fastapply/anthropic.js +2 -2
- package/dist/tools/fastapply/core.js +1 -1
- package/dist/tools/fastapply/index.js +4 -4
- package/dist/tools/fastapply/openai.js +2 -2
- package/dist/tools/fastapply/prompts.js +1 -1
- package/dist/tools/fastapply/vercel.js +2 -2
- package/dist/tools/index.js +4 -4
- package/dist/tools/utils/resilience.js +1 -1
- package/dist/tools/warp_grep/agent/config.js +1 -1
- package/dist/tools/warp_grep/agent/formatter.js +1 -1
- package/dist/tools/warp_grep/agent/parser.cjs +9 -33
- package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/parser.js +2 -2
- package/dist/tools/warp_grep/agent/prompt.js +1 -1
- package/dist/tools/warp_grep/agent/runner.cjs +21 -40
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +4 -4
- package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/types.d.ts +2 -2
- package/dist/tools/warp_grep/anthropic.cjs +53 -46
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +8 -8
- package/dist/tools/warp_grep/client.cjs +53 -46
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +7 -7
- package/dist/tools/warp_grep/gemini.cjs +53 -46
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +8 -8
- package/dist/tools/warp_grep/harness.cjs +55 -45
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.d.ts +1 -1
- package/dist/tools/warp_grep/harness.js +5 -5
- package/dist/tools/warp_grep/harness.js.map +1 -1
- package/dist/tools/warp_grep/index.cjs +56 -46
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.d.ts +1 -1
- package/dist/tools/warp_grep/index.js +11 -11
- package/dist/tools/warp_grep/openai.cjs +53 -46
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +8 -8
- package/dist/tools/warp_grep/providers/local.cjs +32 -6
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.js +3 -3
- package/dist/tools/warp_grep/providers/remote.js +1 -1
- package/dist/tools/warp_grep/utils/files.js +1 -1
- package/dist/tools/warp_grep/utils/paths.js +1 -1
- package/dist/tools/warp_grep/utils/ripgrep.cjs +42 -6
- package/dist/tools/warp_grep/utils/ripgrep.cjs.map +1 -1
- package/dist/tools/warp_grep/utils/ripgrep.js +2 -2
- package/dist/tools/warp_grep/vercel.cjs +53 -46
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +8 -8
- package/package.json +5 -3
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-TPP2UGQP.js.map +0 -1
- package/dist/chunk-YV75OQTE.js.map +0 -1
- /package/dist/{chunk-6N6ZYZYD.js.map → chunk-3WMLFUAR.js.map} +0 -0
- /package/dist/{chunk-PZ5AY32C.js.map → chunk-5FUTL2UF.js.map} +0 -0
- /package/dist/{chunk-IUG2FHNN.js.map → chunk-BHNJEBQJ.js.map} +0 -0
- /package/dist/{chunk-4VGOBA2J.js.map → chunk-GJ573YH3.js.map} +0 -0
- /package/dist/{chunk-3IQIT6MC.js.map → chunk-GM5VR33N.js.map} +0 -0
- /package/dist/{chunk-QZNGKOCZ.js.map → chunk-IXNSTNS7.js.map} +0 -0
- /package/dist/{chunk-ZO4PPFCZ.js.map → chunk-JNOZPU44.js.map} +0 -0
- /package/dist/{chunk-5QIWYEHJ.js.map → chunk-PKPJWARB.js.map} +0 -0
- /package/dist/{chunk-ILJ3J5IA.js.map → chunk-PNIQNTXR.js.map} +0 -0
- /package/dist/{chunk-FN4EP3WY.js.map → chunk-T6677HCA.js.map} +0 -0
- /package/dist/{chunk-374N3GIA.js.map → chunk-TTBXKDCT.js.map} +0 -0
|
@@ -5,6 +5,9 @@ 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
|
+
};
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,6 +30,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
30
|
));
|
|
28
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
32
|
|
|
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
|
+
|
|
30
42
|
// tools/warp_grep/client.ts
|
|
31
43
|
var client_exports = {};
|
|
32
44
|
__export(client_exports, {
|
|
@@ -403,19 +415,19 @@ function parseNestedXmlTools(text) {
|
|
|
403
415
|
const filePath = getXmlElementText(fileContent, "path");
|
|
404
416
|
const linesStr = getXmlElementText(fileContent, "lines");
|
|
405
417
|
if (filePath && linesStr) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
418
|
+
if (linesStr.trim() === "*") {
|
|
419
|
+
files.push({ path: filePath, lines: "*" });
|
|
420
|
+
} else {
|
|
421
|
+
const ranges = [];
|
|
422
|
+
for (const rangeStr of linesStr.split(",")) {
|
|
411
423
|
const [s, e] = rangeStr.split("-").map((v) => parseInt(v.trim(), 10));
|
|
412
424
|
if (Number.isFinite(s) && Number.isFinite(e)) {
|
|
413
425
|
ranges.push([s, e]);
|
|
414
426
|
}
|
|
415
427
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
428
|
+
if (ranges.length > 0) {
|
|
429
|
+
files.push({ path: filePath, lines: ranges });
|
|
430
|
+
}
|
|
419
431
|
}
|
|
420
432
|
}
|
|
421
433
|
}
|
|
@@ -427,33 +439,9 @@ function parseNestedXmlTools(text) {
|
|
|
427
439
|
return tools;
|
|
428
440
|
}
|
|
429
441
|
function preprocessText(text) {
|
|
430
|
-
|
|
442
|
+
const processed = text.replace(/<think>[\s\S]*?<\/think>/gi, "").replace(/<\/?tool_call>/gi, "");
|
|
431
443
|
const nestedTools = parseNestedXmlTools(processed);
|
|
432
|
-
const openingTagRegex = /<tool_call>|<tool>/gi;
|
|
433
|
-
const closingTagRegex = /<\/tool_call>|<\/tool>/gi;
|
|
434
|
-
const openingMatches = processed.match(openingTagRegex) || [];
|
|
435
|
-
const closingMatches = processed.match(closingTagRegex) || [];
|
|
436
|
-
if (openingMatches.length > closingMatches.length) {
|
|
437
|
-
const lastClosingMatch = /<\/tool_call>|<\/tool>/gi;
|
|
438
|
-
let lastClosingIndex = -1;
|
|
439
|
-
let match;
|
|
440
|
-
while ((match = lastClosingMatch.exec(processed)) !== null) {
|
|
441
|
-
lastClosingIndex = match.index + match[0].length;
|
|
442
|
-
}
|
|
443
|
-
if (lastClosingIndex > 0) {
|
|
444
|
-
processed = processed.slice(0, lastClosingIndex);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
444
|
const toolCallLines = [];
|
|
448
|
-
const toolTagRegex = /<tool_call>([\s\S]*?)<\/tool_call>|<tool>([\s\S]*?)<\/tool>/gi;
|
|
449
|
-
let tagMatch;
|
|
450
|
-
while ((tagMatch = toolTagRegex.exec(processed)) !== null) {
|
|
451
|
-
const content = (tagMatch[1] || tagMatch[2] || "").trim();
|
|
452
|
-
if (content) {
|
|
453
|
-
const lines = content.split(/\r?\n/).map((l) => l.trim()).filter((l) => l);
|
|
454
|
-
toolCallLines.push(...lines);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
445
|
const allLines = processed.split(/\r?\n/).map((l) => l.trim());
|
|
458
446
|
for (const line of allLines) {
|
|
459
447
|
if (!line) continue;
|
|
@@ -670,13 +658,18 @@ async function toolListDirectory(provider, args) {
|
|
|
670
658
|
async function readFinishFiles(repoRoot, files, reader) {
|
|
671
659
|
const out = [];
|
|
672
660
|
for (const f of files) {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
661
|
+
if (f.lines === "*") {
|
|
662
|
+
const lines = await reader(f.path);
|
|
663
|
+
out.push({ path: f.path, ranges: "*", content: lines.join("\n") });
|
|
664
|
+
} else {
|
|
665
|
+
const ranges = mergeRanges(f.lines);
|
|
666
|
+
const chunks = [];
|
|
667
|
+
for (const [s, e] of ranges) {
|
|
668
|
+
const lines = await reader(f.path, s, e);
|
|
669
|
+
chunks.push(lines.join("\n"));
|
|
670
|
+
}
|
|
671
|
+
out.push({ path: f.path, ranges, content: chunks.join("\n") });
|
|
678
672
|
}
|
|
679
|
-
out.push({ path: f.path, ranges, content: chunks.join("\n") });
|
|
680
673
|
}
|
|
681
674
|
return out;
|
|
682
675
|
}
|
|
@@ -1077,7 +1070,7 @@ async function runWarpGrep(config) {
|
|
|
1077
1070
|
}
|
|
1078
1071
|
const parts = ["Relevant context found:"];
|
|
1079
1072
|
for (const f of finishMeta.files) {
|
|
1080
|
-
const ranges = f.lines.map(([s, e]) => `${s}-${e}`).join(", ");
|
|
1073
|
+
const ranges = f.lines === "*" ? "*" : f.lines.map(([s, e]) => `${s}-${e}`).join(", ");
|
|
1081
1074
|
parts.push(`- ${f.path}: ${ranges}`);
|
|
1082
1075
|
}
|
|
1083
1076
|
const payload = parts.join("\n");
|
|
@@ -1116,9 +1109,20 @@ var import_path4 = __toESM(require("path"), 1);
|
|
|
1116
1109
|
|
|
1117
1110
|
// tools/warp_grep/utils/ripgrep.ts
|
|
1118
1111
|
var import_child_process = require("child_process");
|
|
1119
|
-
var import_ripgrep = require("@vscode/ripgrep");
|
|
1120
1112
|
var resolvedRgPath = null;
|
|
1121
1113
|
var rgPathChecked = false;
|
|
1114
|
+
var bundledRgPath = null;
|
|
1115
|
+
async function getBundledRgPath() {
|
|
1116
|
+
if (bundledRgPath !== null) return bundledRgPath;
|
|
1117
|
+
try {
|
|
1118
|
+
const module2 = await Promise.resolve().then(() => __toESM(require_lib(), 1));
|
|
1119
|
+
bundledRgPath = module2.rgPath;
|
|
1120
|
+
return bundledRgPath;
|
|
1121
|
+
} catch {
|
|
1122
|
+
bundledRgPath = "";
|
|
1123
|
+
return null;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1122
1126
|
function spawnRg(rgBinary, args, opts) {
|
|
1123
1127
|
return new Promise((resolve) => {
|
|
1124
1128
|
const child = (0, import_child_process.spawn)(rgBinary, args, {
|
|
@@ -1149,11 +1153,14 @@ async function runRipgrep(args, opts) {
|
|
|
1149
1153
|
return spawnRg(resolvedRgPath, args, opts);
|
|
1150
1154
|
}
|
|
1151
1155
|
if (!rgPathChecked) {
|
|
1152
|
-
const
|
|
1153
|
-
if (
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1156
|
+
const bundledPath = await getBundledRgPath();
|
|
1157
|
+
if (bundledPath) {
|
|
1158
|
+
const result = await spawnRg(bundledPath, args, opts);
|
|
1159
|
+
if (!isBinaryFailure(result)) {
|
|
1160
|
+
resolvedRgPath = bundledPath;
|
|
1161
|
+
rgPathChecked = true;
|
|
1162
|
+
return result;
|
|
1163
|
+
}
|
|
1157
1164
|
}
|
|
1158
1165
|
const fallbackResult = await spawnRg("rg", args, opts);
|
|
1159
1166
|
if (!isBinaryFailure(fallbackResult)) {
|