@morphllm/morphsdk 0.2.76 → 0.2.81
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-DCIUCDWJ.js → chunk-467MCW5R.js} +38 -10
- package/dist/chunk-467MCW5R.js.map +1 -0
- package/dist/{chunk-HBIDSKIQ.js → chunk-4NI25AKV.js} +14 -6
- package/dist/chunk-4NI25AKV.js.map +1 -0
- package/dist/{chunk-XREWLWLA.js → chunk-4VMIPD4G.js} +4 -4
- package/dist/{chunk-RRWN62VU.js → chunk-B3UC7UVA.js} +4 -4
- package/dist/{chunk-RRWN62VU.js.map → chunk-B3UC7UVA.js.map} +1 -1
- package/dist/{chunk-Q5AHGIQO.js → chunk-FMLHRJDF.js} +3 -1
- package/dist/{chunk-Q5AHGIQO.js.map → chunk-FMLHRJDF.js.map} +1 -1
- package/dist/{chunk-G2EJHZSA.js → chunk-NTTQJM6O.js} +3 -3
- package/dist/{chunk-P2LHXSMG.js → chunk-OFMDENAQ.js} +2 -2
- package/dist/{chunk-26QXQFLZ.js → chunk-PHJQ4N3T.js} +8 -3
- package/dist/chunk-PHJQ4N3T.js.map +1 -0
- package/dist/{chunk-KILYNOE4.js → chunk-X6A64F2F.js} +5 -5
- package/dist/{chunk-RK2MR3N2.js → chunk-Z2HDXUH7.js} +3 -3
- package/dist/client.cjs +56 -12
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +10 -10
- package/dist/index.cjs +56 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -10
- package/dist/tools/warp_grep/agent/prompt.cjs +2 -0
- package/dist/tools/warp_grep/agent/prompt.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/prompt.d.ts +1 -1
- package/dist/tools/warp_grep/agent/prompt.js +1 -1
- package/dist/tools/warp_grep/agent/runner.cjs +36 -5
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +3 -3
- package/dist/tools/warp_grep/anthropic.cjs +56 -12
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +7 -7
- package/dist/tools/warp_grep/client.cjs +56 -12
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +6 -6
- package/dist/tools/warp_grep/gemini.cjs +56 -12
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +6 -6
- package/dist/tools/warp_grep/harness.cjs +52 -14
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.js +3 -3
- package/dist/tools/warp_grep/index.cjs +60 -17
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.js +6 -6
- package/dist/tools/warp_grep/openai.cjs +56 -12
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +7 -7
- package/dist/tools/warp_grep/providers/local.cjs +13 -5
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.js +1 -1
- package/dist/tools/warp_grep/providers/remote.cjs +7 -2
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/remote.js +1 -1
- package/dist/tools/warp_grep/vercel.cjs +56 -12
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-26QXQFLZ.js.map +0 -1
- package/dist/chunk-DCIUCDWJ.js.map +0 -1
- package/dist/chunk-HBIDSKIQ.js.map +0 -1
- /package/dist/{chunk-XREWLWLA.js.map → chunk-4VMIPD4G.js.map} +0 -0
- /package/dist/{chunk-G2EJHZSA.js.map → chunk-NTTQJM6O.js.map} +0 -0
- /package/dist/{chunk-P2LHXSMG.js.map → chunk-OFMDENAQ.js.map} +0 -0
- /package/dist/{chunk-KILYNOE4.js.map → chunk-X6A64F2F.js.map} +0 -0
- /package/dist/{chunk-RK2MR3N2.js.map → chunk-Z2HDXUH7.js.map} +0 -0
|
@@ -320,6 +320,8 @@ I think I have a rough idea, but this is my last turn so I must call the finish
|
|
|
320
320
|
No commentary outside \`<think>\`. No explanations after tool calls.
|
|
321
321
|
</output_format>
|
|
322
322
|
|
|
323
|
+
use as all 8 tool calls to be optimal
|
|
324
|
+
|
|
323
325
|
<finishing_requirements>
|
|
324
326
|
When calling \`finish\`:
|
|
325
327
|
- Include the import section (typically lines 1-20) of each file
|
|
@@ -607,10 +609,25 @@ async function toolGrep(provider, args) {
|
|
|
607
609
|
}
|
|
608
610
|
|
|
609
611
|
// tools/warp_grep/agent/tools/read.ts
|
|
612
|
+
function isValidRange(start, end) {
|
|
613
|
+
return typeof start === "number" && typeof end === "number" && Number.isFinite(start) && Number.isFinite(end) && start > 0 && end >= start;
|
|
614
|
+
}
|
|
610
615
|
async function toolRead(provider, args) {
|
|
611
|
-
if (args.lines && args.lines.length > 0) {
|
|
616
|
+
if (args.lines && Array.isArray(args.lines) && args.lines.length > 0) {
|
|
617
|
+
const validRanges = [];
|
|
618
|
+
for (const range of args.lines) {
|
|
619
|
+
if (Array.isArray(range) && range.length >= 2 && isValidRange(range[0], range[1])) {
|
|
620
|
+
validRanges.push([range[0], range[1]]);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
if (validRanges.length === 0) {
|
|
624
|
+
const res2 = await provider.read({ path: args.path });
|
|
625
|
+
if (res2.error) return res2.error;
|
|
626
|
+
if (!res2.lines.length) return "(empty file)";
|
|
627
|
+
return res2.lines.join("\n");
|
|
628
|
+
}
|
|
612
629
|
const chunks = [];
|
|
613
|
-
for (const [start, end] of
|
|
630
|
+
for (const [start, end] of validRanges) {
|
|
614
631
|
const res2 = await provider.read({ path: args.path, start, end });
|
|
615
632
|
if (res2.error) return res2.error;
|
|
616
633
|
chunks.push(res2.lines.join("\n"));
|
|
@@ -646,14 +663,28 @@ async function toolListDirectory(provider, args) {
|
|
|
646
663
|
}
|
|
647
664
|
|
|
648
665
|
// tools/warp_grep/agent/tools/finish.ts
|
|
666
|
+
function isValidRange2(range) {
|
|
667
|
+
return Array.isArray(range) && range.length >= 2 && typeof range[0] === "number" && typeof range[1] === "number" && Number.isFinite(range[0]) && Number.isFinite(range[1]) && range[0] > 0 && range[1] >= range[0];
|
|
668
|
+
}
|
|
669
|
+
function extractValidRanges(lines) {
|
|
670
|
+
if (!Array.isArray(lines)) return null;
|
|
671
|
+
const valid = [];
|
|
672
|
+
for (const range of lines) {
|
|
673
|
+
if (isValidRange2(range)) {
|
|
674
|
+
valid.push([range[0], range[1]]);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return valid.length > 0 ? valid : null;
|
|
678
|
+
}
|
|
649
679
|
async function readFinishFiles(repoRoot, files, reader) {
|
|
650
680
|
const out = [];
|
|
651
681
|
for (const f of files) {
|
|
652
|
-
|
|
682
|
+
const validRanges = f.lines === "*" ? null : extractValidRanges(f.lines);
|
|
683
|
+
if (f.lines === "*" || !validRanges) {
|
|
653
684
|
const lines = await reader(f.path);
|
|
654
685
|
out.push({ path: f.path, ranges: "*", content: lines.join("\n") });
|
|
655
686
|
} else {
|
|
656
|
-
const ranges = mergeRanges(
|
|
687
|
+
const ranges = mergeRanges(validRanges);
|
|
657
688
|
const chunks = [];
|
|
658
689
|
for (const [s, e] of ranges) {
|
|
659
690
|
const lines = await reader(f.path, s, e);
|
|
@@ -1061,7 +1092,7 @@ async function runWarpGrep(config) {
|
|
|
1061
1092
|
}
|
|
1062
1093
|
const parts = ["Relevant context found:"];
|
|
1063
1094
|
for (const f of finishMeta.files) {
|
|
1064
|
-
const ranges = f.lines === "*" ? "*" : f.lines.map(([s, e]) => `${s}-${e}`).join(", ");
|
|
1095
|
+
const ranges = f.lines === "*" ? "*" : Array.isArray(f.lines) ? f.lines.map(([s, e]) => `${s}-${e}`).join(", ") : "*";
|
|
1065
1096
|
parts.push(`- ${f.path}: ${ranges}`);
|
|
1066
1097
|
}
|
|
1067
1098
|
const payload = parts.join("\n");
|
|
@@ -1421,11 +1452,19 @@ Details: ${res.stderr}` : ""}`
|
|
|
1421
1452
|
};
|
|
1422
1453
|
}
|
|
1423
1454
|
const total = lines.length;
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1455
|
+
const rawStart = params.start;
|
|
1456
|
+
const rawEnd = params.end;
|
|
1457
|
+
let s = 1;
|
|
1458
|
+
let e = total;
|
|
1459
|
+
const startValid = rawStart === void 0 || Number.isFinite(rawStart) && rawStart > 0;
|
|
1460
|
+
const endValid = rawEnd === void 0 || Number.isFinite(rawEnd) && rawEnd > 0;
|
|
1461
|
+
if (startValid && endValid) {
|
|
1462
|
+
s = rawStart ?? 1;
|
|
1463
|
+
e = Math.min(rawEnd ?? total, total);
|
|
1464
|
+
if (s > total && total > 0 || s > e) {
|
|
1465
|
+
s = 1;
|
|
1466
|
+
e = total;
|
|
1467
|
+
}
|
|
1429
1468
|
}
|
|
1430
1469
|
const out = [];
|
|
1431
1470
|
for (let i = s; i <= e; i += 1) {
|
|
@@ -1601,8 +1640,13 @@ var RemoteCommandsProvider = class {
|
|
|
1601
1640
|
* Read file and add line numbers
|
|
1602
1641
|
*/
|
|
1603
1642
|
async read(params) {
|
|
1604
|
-
const
|
|
1605
|
-
const
|
|
1643
|
+
const rawStart = params.start;
|
|
1644
|
+
const rawEnd = params.end;
|
|
1645
|
+
const startValid = rawStart === void 0 || Number.isFinite(rawStart) && rawStart > 0;
|
|
1646
|
+
const endValid = rawEnd === void 0 || Number.isFinite(rawEnd) && rawEnd > 0;
|
|
1647
|
+
const rangeValid = startValid && endValid && (rawStart === void 0 || rawEnd === void 0 || rawStart <= rawEnd);
|
|
1648
|
+
const start = rangeValid && rawStart !== void 0 ? rawStart : 1;
|
|
1649
|
+
const end = rangeValid && rawEnd !== void 0 ? rawEnd : 1e6;
|
|
1606
1650
|
try {
|
|
1607
1651
|
const stdout = await this.commands.read(params.path, start, end);
|
|
1608
1652
|
const contentLines = (stdout || "").split("\n");
|