@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
|
@@ -6,7 +6,7 @@ export { RemoteCommandsProvider } from './providers/remote.js';
|
|
|
6
6
|
export { runWarpGrep } from './agent/runner.js';
|
|
7
7
|
export { AgentRunResult, ChatMessage, SessionConfig } from './agent/types.js';
|
|
8
8
|
export { SYSTEM_PROMPT as WARP_GREP_SYSTEM_PROMPT, getSystemPrompt } from './agent/prompt.js';
|
|
9
|
-
export { n as normalizeFinishFiles, r as readFinishFiles, t as toolGrep, b as toolListDirectory, a as toolRead } from '../../finish-
|
|
9
|
+
export { n as normalizeFinishFiles, r as readFinishFiles, t as toolGrep, b as toolListDirectory, a as toolRead } from '../../finish-pPJfB0uO.js';
|
|
10
10
|
export { a as anthropic } from '../../anthropic-BC-AMEIN.js';
|
|
11
11
|
export { o as openai } from '../../openai-Beb9escY.js';
|
|
12
12
|
export { v as vercel } from '../../vercel-Bo84tpBe.js';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "../../chunk-ISWL67SF.js";
|
|
2
2
|
import {
|
|
3
3
|
gemini_exports
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-PNIQNTXR.js";
|
|
5
5
|
import {
|
|
6
6
|
anthropic_exports
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-GM5VR33N.js";
|
|
8
8
|
import {
|
|
9
9
|
openai_exports
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-3WMLFUAR.js";
|
|
11
11
|
import {
|
|
12
12
|
vercel_exports
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-GJ573YH3.js";
|
|
14
14
|
import {
|
|
15
15
|
WARP_GREP_DESCRIPTION,
|
|
16
16
|
WARP_GREP_TOOL_NAME
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
executeToolCall,
|
|
21
21
|
executeWarpGrep,
|
|
22
22
|
formatResult
|
|
23
|
-
} from "../../chunk-
|
|
23
|
+
} from "../../chunk-TTBXKDCT.js";
|
|
24
24
|
import {
|
|
25
25
|
runWarpGrep
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-3SHLMXBV.js";
|
|
27
27
|
import {
|
|
28
28
|
RemoteCommandsProvider
|
|
29
29
|
} from "../../chunk-527P5X2E.js";
|
|
@@ -33,22 +33,22 @@ import {
|
|
|
33
33
|
toolGrep,
|
|
34
34
|
toolListDirectory,
|
|
35
35
|
toolRead
|
|
36
|
-
} from "../../chunk-
|
|
36
|
+
} from "../../chunk-DCIUCDWJ.js";
|
|
37
37
|
import "../../chunk-APP75CBN.js";
|
|
38
|
-
import "../../chunk-
|
|
38
|
+
import "../../chunk-5QRN3JNB.js";
|
|
39
39
|
import {
|
|
40
40
|
SYSTEM_PROMPT,
|
|
41
41
|
getSystemPrompt
|
|
42
42
|
} from "../../chunk-Q5AHGIQO.js";
|
|
43
43
|
import {
|
|
44
44
|
LocalRipgrepProvider
|
|
45
|
-
} from "../../chunk-
|
|
45
|
+
} from "../../chunk-JNOZPU44.js";
|
|
46
46
|
import "../../chunk-G2RSY56Q.js";
|
|
47
47
|
import "../../chunk-SMGZ6A64.js";
|
|
48
|
-
import "../../chunk-
|
|
48
|
+
import "../../chunk-563RLKFC.js";
|
|
49
49
|
import "../../chunk-XT5ZO6ES.js";
|
|
50
50
|
import "../../chunk-4VWJFZVS.js";
|
|
51
|
-
import "../../chunk-
|
|
51
|
+
import "../../chunk-5FUTL2UF.js";
|
|
52
52
|
export {
|
|
53
53
|
LocalRipgrepProvider,
|
|
54
54
|
RemoteCommandsProvider,
|
|
@@ -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/openai.ts
|
|
31
43
|
var openai_exports = {};
|
|
32
44
|
__export(openai_exports, {
|
|
@@ -405,19 +417,19 @@ function parseNestedXmlTools(text) {
|
|
|
405
417
|
const filePath = getXmlElementText(fileContent, "path");
|
|
406
418
|
const linesStr = getXmlElementText(fileContent, "lines");
|
|
407
419
|
if (filePath && linesStr) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
420
|
+
if (linesStr.trim() === "*") {
|
|
421
|
+
files.push({ path: filePath, lines: "*" });
|
|
422
|
+
} else {
|
|
423
|
+
const ranges = [];
|
|
424
|
+
for (const rangeStr of linesStr.split(",")) {
|
|
413
425
|
const [s, e] = rangeStr.split("-").map((v) => parseInt(v.trim(), 10));
|
|
414
426
|
if (Number.isFinite(s) && Number.isFinite(e)) {
|
|
415
427
|
ranges.push([s, e]);
|
|
416
428
|
}
|
|
417
429
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
430
|
+
if (ranges.length > 0) {
|
|
431
|
+
files.push({ path: filePath, lines: ranges });
|
|
432
|
+
}
|
|
421
433
|
}
|
|
422
434
|
}
|
|
423
435
|
}
|
|
@@ -429,33 +441,9 @@ function parseNestedXmlTools(text) {
|
|
|
429
441
|
return tools;
|
|
430
442
|
}
|
|
431
443
|
function preprocessText(text) {
|
|
432
|
-
|
|
444
|
+
const processed = text.replace(/<think>[\s\S]*?<\/think>/gi, "").replace(/<\/?tool_call>/gi, "");
|
|
433
445
|
const nestedTools = parseNestedXmlTools(processed);
|
|
434
|
-
const openingTagRegex = /<tool_call>|<tool>/gi;
|
|
435
|
-
const closingTagRegex = /<\/tool_call>|<\/tool>/gi;
|
|
436
|
-
const openingMatches = processed.match(openingTagRegex) || [];
|
|
437
|
-
const closingMatches = processed.match(closingTagRegex) || [];
|
|
438
|
-
if (openingMatches.length > closingMatches.length) {
|
|
439
|
-
const lastClosingMatch = /<\/tool_call>|<\/tool>/gi;
|
|
440
|
-
let lastClosingIndex = -1;
|
|
441
|
-
let match;
|
|
442
|
-
while ((match = lastClosingMatch.exec(processed)) !== null) {
|
|
443
|
-
lastClosingIndex = match.index + match[0].length;
|
|
444
|
-
}
|
|
445
|
-
if (lastClosingIndex > 0) {
|
|
446
|
-
processed = processed.slice(0, lastClosingIndex);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
446
|
const toolCallLines = [];
|
|
450
|
-
const toolTagRegex = /<tool_call>([\s\S]*?)<\/tool_call>|<tool>([\s\S]*?)<\/tool>/gi;
|
|
451
|
-
let tagMatch;
|
|
452
|
-
while ((tagMatch = toolTagRegex.exec(processed)) !== null) {
|
|
453
|
-
const content = (tagMatch[1] || tagMatch[2] || "").trim();
|
|
454
|
-
if (content) {
|
|
455
|
-
const lines = content.split(/\r?\n/).map((l) => l.trim()).filter((l) => l);
|
|
456
|
-
toolCallLines.push(...lines);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
447
|
const allLines = processed.split(/\r?\n/).map((l) => l.trim());
|
|
460
448
|
for (const line of allLines) {
|
|
461
449
|
if (!line) continue;
|
|
@@ -672,13 +660,18 @@ async function toolListDirectory(provider, args) {
|
|
|
672
660
|
async function readFinishFiles(repoRoot, files, reader) {
|
|
673
661
|
const out = [];
|
|
674
662
|
for (const f of files) {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
663
|
+
if (f.lines === "*") {
|
|
664
|
+
const lines = await reader(f.path);
|
|
665
|
+
out.push({ path: f.path, ranges: "*", content: lines.join("\n") });
|
|
666
|
+
} else {
|
|
667
|
+
const ranges = mergeRanges(f.lines);
|
|
668
|
+
const chunks = [];
|
|
669
|
+
for (const [s, e] of ranges) {
|
|
670
|
+
const lines = await reader(f.path, s, e);
|
|
671
|
+
chunks.push(lines.join("\n"));
|
|
672
|
+
}
|
|
673
|
+
out.push({ path: f.path, ranges, content: chunks.join("\n") });
|
|
680
674
|
}
|
|
681
|
-
out.push({ path: f.path, ranges, content: chunks.join("\n") });
|
|
682
675
|
}
|
|
683
676
|
return out;
|
|
684
677
|
}
|
|
@@ -1079,7 +1072,7 @@ async function runWarpGrep(config) {
|
|
|
1079
1072
|
}
|
|
1080
1073
|
const parts = ["Relevant context found:"];
|
|
1081
1074
|
for (const f of finishMeta.files) {
|
|
1082
|
-
const ranges = f.lines.map(([s, e]) => `${s}-${e}`).join(", ");
|
|
1075
|
+
const ranges = f.lines === "*" ? "*" : f.lines.map(([s, e]) => `${s}-${e}`).join(", ");
|
|
1083
1076
|
parts.push(`- ${f.path}: ${ranges}`);
|
|
1084
1077
|
}
|
|
1085
1078
|
const payload = parts.join("\n");
|
|
@@ -1118,9 +1111,20 @@ var import_path4 = __toESM(require("path"), 1);
|
|
|
1118
1111
|
|
|
1119
1112
|
// tools/warp_grep/utils/ripgrep.ts
|
|
1120
1113
|
var import_child_process = require("child_process");
|
|
1121
|
-
var import_ripgrep = require("@vscode/ripgrep");
|
|
1122
1114
|
var resolvedRgPath = null;
|
|
1123
1115
|
var rgPathChecked = false;
|
|
1116
|
+
var bundledRgPath = null;
|
|
1117
|
+
async function getBundledRgPath() {
|
|
1118
|
+
if (bundledRgPath !== null) return bundledRgPath;
|
|
1119
|
+
try {
|
|
1120
|
+
const module2 = await Promise.resolve().then(() => __toESM(require_lib(), 1));
|
|
1121
|
+
bundledRgPath = module2.rgPath;
|
|
1122
|
+
return bundledRgPath;
|
|
1123
|
+
} catch {
|
|
1124
|
+
bundledRgPath = "";
|
|
1125
|
+
return null;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1124
1128
|
function spawnRg(rgBinary, args, opts) {
|
|
1125
1129
|
return new Promise((resolve) => {
|
|
1126
1130
|
const child = (0, import_child_process.spawn)(rgBinary, args, {
|
|
@@ -1151,11 +1155,14 @@ async function runRipgrep(args, opts) {
|
|
|
1151
1155
|
return spawnRg(resolvedRgPath, args, opts);
|
|
1152
1156
|
}
|
|
1153
1157
|
if (!rgPathChecked) {
|
|
1154
|
-
const
|
|
1155
|
-
if (
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1158
|
+
const bundledPath = await getBundledRgPath();
|
|
1159
|
+
if (bundledPath) {
|
|
1160
|
+
const result = await spawnRg(bundledPath, args, opts);
|
|
1161
|
+
if (!isBinaryFailure(result)) {
|
|
1162
|
+
resolvedRgPath = bundledPath;
|
|
1163
|
+
rgPathChecked = true;
|
|
1164
|
+
return result;
|
|
1165
|
+
}
|
|
1159
1166
|
}
|
|
1160
1167
|
const fallbackResult = await spawnRg("rg", args, opts);
|
|
1161
1168
|
if (!isBinaryFailure(fallbackResult)) {
|