@morphllm/morphsdk 0.2.108 → 0.2.110
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-4CZPXV6R.js → chunk-23R562QJ.js} +20 -16
- package/dist/chunk-23R562QJ.js.map +1 -0
- package/dist/{chunk-KRDIR7GG.js → chunk-3MLWXJTJ.js} +8 -2
- package/dist/chunk-3MLWXJTJ.js.map +1 -0
- package/dist/{chunk-AFLEE2PO.js → chunk-ALTKGCG5.js} +2 -2
- package/dist/{chunk-QUIGATZE.js → chunk-FL4ZBHK2.js} +2 -2
- package/dist/{chunk-MY4OU4ON.js → chunk-HI35Y6EZ.js} +2 -2
- package/dist/{chunk-GOPNOZVI.js → chunk-I72WZNZF.js} +5 -5
- package/dist/chunk-I72WZNZF.js.map +1 -0
- package/dist/{chunk-ZROQPUCQ.js → chunk-YY7NZLAI.js} +2 -2
- package/dist/{client-DYnecl6H.d.ts → client-BH1R-YHX.d.ts} +1 -1
- package/dist/client.cjs +26 -16
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +7 -7
- package/dist/index.cjs +26 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/tools/warp_grep/agent/runner.cjs +7 -1
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +2 -2
- package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/types.d.ts +1 -1
- package/dist/tools/warp_grep/anthropic.cjs +23 -14
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +1 -1
- package/dist/tools/warp_grep/anthropic.js +4 -4
- package/dist/tools/warp_grep/client.cjs +26 -16
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.d.ts +1 -1
- package/dist/tools/warp_grep/client.js +3 -3
- package/dist/tools/warp_grep/gemini.cjs +23 -14
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.d.ts +1 -1
- package/dist/tools/warp_grep/gemini.js +3 -3
- package/dist/tools/warp_grep/harness.cjs +7 -1
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.js +1 -1
- package/dist/tools/warp_grep/index.cjs +26 -16
- 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 +3 -3
- package/dist/tools/warp_grep/openai.cjs +23 -14
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +1 -1
- package/dist/tools/warp_grep/openai.js +4 -4
- package/dist/tools/warp_grep/providers/remote.d.ts +1 -1
- package/dist/tools/warp_grep/vercel.cjs +23 -14
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +1 -1
- package/dist/tools/warp_grep/vercel.js +4 -4
- package/dist/{types-BMowL9iZ.d.ts → types-D5p8QErL.d.ts} +2 -0
- package/package.json +1 -1
- package/dist/chunk-4CZPXV6R.js.map +0 -1
- package/dist/chunk-GOPNOZVI.js.map +0 -1
- package/dist/chunk-KRDIR7GG.js.map +0 -1
- /package/dist/{chunk-AFLEE2PO.js.map → chunk-ALTKGCG5.js.map} +0 -0
- /package/dist/{chunk-QUIGATZE.js.map → chunk-FL4ZBHK2.js.map} +0 -0
- /package/dist/{chunk-MY4OU4ON.js.map → chunk-HI35Y6EZ.js.map} +0 -0
- /package/dist/{chunk-ZROQPUCQ.js.map → chunk-YY7NZLAI.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tool } from '@anthropic-ai/sdk/resources/messages';
|
|
2
2
|
export { formatResult } from './client.js';
|
|
3
3
|
export { getSystemPrompt } from './agent/prompt.js';
|
|
4
|
-
import { d as WarpGrepToolConfig, b as WarpGrepResult } from '../../types-
|
|
4
|
+
import { d as WarpGrepToolConfig, b as WarpGrepResult } from '../../types-D5p8QErL.js';
|
|
5
5
|
import './agent/types.js';
|
|
6
6
|
import '../utils/resilience.js';
|
|
7
7
|
import './providers/types.js';
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
createWarpGrepTool,
|
|
3
3
|
execute,
|
|
4
4
|
warpGrepTool
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-ALTKGCG5.js";
|
|
6
6
|
import "../../chunk-KW7OEGZK.js";
|
|
7
7
|
import {
|
|
8
8
|
formatResult
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-23R562QJ.js";
|
|
10
|
+
import "../../chunk-YY7NZLAI.js";
|
|
11
11
|
import "../../chunk-PUGSTXLO.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-3MLWXJTJ.js";
|
|
13
13
|
import "../../chunk-SNGGSPYJ.js";
|
|
14
14
|
import {
|
|
15
15
|
getSystemPrompt
|
|
@@ -1143,7 +1143,13 @@ async function readFinishFiles(repoRoot, files, reader) {
|
|
|
1143
1143
|
} else {
|
|
1144
1144
|
const ranges = mergeRanges(validRanges);
|
|
1145
1145
|
const chunks = [];
|
|
1146
|
-
for (
|
|
1146
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
1147
|
+
const [s, e] = ranges[i];
|
|
1148
|
+
if (i === 0 && s > 1) {
|
|
1149
|
+
chunks.push(`// ... existing code, block starting at line ${s} ...`);
|
|
1150
|
+
} else if (i > 0) {
|
|
1151
|
+
chunks.push(`// ... existing code, block starting at line ${s} ...`);
|
|
1152
|
+
}
|
|
1147
1153
|
const lines = await reader(f.path, s, e);
|
|
1148
1154
|
chunks.push(lines.join("\n"));
|
|
1149
1155
|
}
|
|
@@ -1920,7 +1926,8 @@ async function executeToolCall(input, config) {
|
|
|
1920
1926
|
}
|
|
1921
1927
|
const contexts = (finish.resolved ?? []).map((r) => ({
|
|
1922
1928
|
file: r.path,
|
|
1923
|
-
content: r.content
|
|
1929
|
+
content: r.content,
|
|
1930
|
+
lines: r.ranges
|
|
1924
1931
|
}));
|
|
1925
1932
|
return { success: true, contexts, summary: finish.payload };
|
|
1926
1933
|
}
|
|
@@ -1931,7 +1938,8 @@ function processAgentResult(result) {
|
|
|
1931
1938
|
}
|
|
1932
1939
|
const contexts = (finish.resolved ?? []).map((r) => ({
|
|
1933
1940
|
file: r.path,
|
|
1934
|
-
content: r.content
|
|
1941
|
+
content: r.content,
|
|
1942
|
+
lines: r.ranges
|
|
1935
1943
|
}));
|
|
1936
1944
|
return { success: true, contexts, summary: finish.payload };
|
|
1937
1945
|
}
|
|
@@ -1968,20 +1976,22 @@ function formatResult(result) {
|
|
|
1968
1976
|
if (!result.contexts || result.contexts.length === 0) {
|
|
1969
1977
|
return "No relevant code found. Try rephrasing your query.";
|
|
1970
1978
|
}
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1979
|
+
const parts = [];
|
|
1980
|
+
parts.push(`Morph Fast Context subagent performed search on repository:
|
|
1973
1981
|
`);
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
lines.
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1982
|
+
parts.push("Relevant context found:");
|
|
1983
|
+
for (const ctx of result.contexts) {
|
|
1984
|
+
const rangeStr = !ctx.lines || ctx.lines === "*" ? "*" : ctx.lines.map(([s, e]) => `${s}-${e}`).join(",");
|
|
1985
|
+
parts.push(`- ${ctx.file}:${rangeStr}`);
|
|
1986
|
+
}
|
|
1987
|
+
parts.push("\nHere is the content of files:\n");
|
|
1988
|
+
for (const ctx of result.contexts) {
|
|
1989
|
+
const rangeStr = !ctx.lines || ctx.lines === "*" ? "" : ` lines="${ctx.lines.map(([s, e]) => `${s}-${e}`).join(",")}"`;
|
|
1990
|
+
parts.push(`<file path="${ctx.file}"${rangeStr}>`);
|
|
1991
|
+
parts.push(ctx.content);
|
|
1992
|
+
parts.push("</file>\n");
|
|
1993
|
+
}
|
|
1994
|
+
return parts.join("\n");
|
|
1985
1995
|
}
|
|
1986
1996
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1987
1997
|
0 && (module.exports = {
|