@morphllm/morphsdk 0.2.146 → 0.2.147
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-J2HIK4GB.js → chunk-334JOOAC.js} +2 -2
- package/dist/{chunk-QRSWXP4K.js → chunk-3GXWZ7TI.js} +2 -2
- package/dist/{chunk-BDHKL3MT.js → chunk-4LZK67MS.js} +2 -2
- package/dist/{chunk-UVNENJ6H.js → chunk-4XNHMFVU.js} +3 -3
- package/dist/{chunk-HZOTLGJH.js → chunk-4Y2NM6JD.js} +42 -2
- package/dist/chunk-4Y2NM6JD.js.map +1 -0
- package/dist/{chunk-V73GO5AJ.js → chunk-7HKJUVAK.js} +2 -2
- package/dist/{chunk-NF2QWJDY.js → chunk-B3AKP3RA.js} +31 -2
- package/dist/chunk-B3AKP3RA.js.map +1 -0
- package/dist/{chunk-VZ6VYRQB.js → chunk-BXQYZR7O.js} +2 -2
- package/dist/{chunk-GJUB3ECP.js → chunk-CJD4ZFOX.js} +2 -2
- package/dist/chunk-CMSHXALI.js +60 -0
- package/dist/chunk-CMSHXALI.js.map +1 -0
- package/dist/{chunk-KYKRRF7E.js → chunk-DYCRGTRN.js} +2 -2
- package/dist/{chunk-EU7OLX4Z.js → chunk-ETKDGHOB.js} +2 -2
- package/dist/{chunk-SJYAKVSS.js → chunk-G4TRYATX.js} +2 -2
- package/dist/{chunk-SJYAKVSS.js.map → chunk-G4TRYATX.js.map} +1 -1
- package/dist/chunk-GK56GCLU.js +401 -0
- package/dist/chunk-GK56GCLU.js.map +1 -0
- package/dist/{chunk-I7SFRYTX.js → chunk-HWED34T3.js} +2 -2
- package/dist/{chunk-FIVYDIHX.js → chunk-HYRHI2UL.js} +1 -1
- package/dist/{chunk-DKODF3YG.js → chunk-I3J46TSB.js} +5 -4
- package/dist/chunk-I3J46TSB.js.map +1 -0
- package/dist/{chunk-E4YKEKGW.js → chunk-KV2CC4N7.js} +2 -2
- package/dist/{chunk-BIQ7234U.js → chunk-LSPEWVCD.js} +2 -2
- package/dist/{chunk-OV57JBMB.js → chunk-N7XLC7BK.js} +2 -2
- package/dist/{chunk-FBOJJ3UY.js → chunk-O356YR2N.js} +17 -17
- package/dist/{chunk-JSWNBCGS.js → chunk-PIHW2GSK.js} +2 -2
- package/dist/{chunk-UYPWKQKV.js → chunk-RGNP6FNH.js} +2 -2
- package/dist/{chunk-YIETFYCL.js → chunk-T7HF2TDQ.js} +75 -48
- package/dist/chunk-T7HF2TDQ.js.map +1 -0
- package/dist/{chunk-NKUSUSVI.js → chunk-T7VCGKXB.js} +3 -3
- package/dist/{chunk-Q36MNOFA.js → chunk-UZ2QUWJD.js} +2 -2
- package/dist/{chunk-FYO46OT6.js → chunk-VTTU7MJB.js} +2 -2
- package/dist/{chunk-4PBUB77N.js → chunk-XADFYB6B.js} +2 -2
- package/dist/{chunk-T564HFSH.js → chunk-XS4PO4FC.js} +1 -1
- package/dist/{chunk-E45FW5EK.js → chunk-YH3XIVF2.js} +2 -2
- package/dist/{chunk-MMBQKN4G.js → chunk-ZZW4B4GG.js} +2 -2
- package/dist/client.cjs +439 -446
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +26 -27
- package/dist/edge.cjs +1 -1
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.js +4 -4
- package/dist/{finish-DBKuo8yj.d.ts → finish-Ddj1MPGt.d.ts} +1 -1
- package/dist/index.cjs +458 -446
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -29
- package/dist/modelrouter/core.cjs +1 -1
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +3 -3
- package/dist/modelrouter/index.cjs +1 -1
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +3 -3
- package/dist/subagents/anthropic.cjs +435 -442
- package/dist/subagents/anthropic.cjs.map +1 -1
- package/dist/subagents/anthropic.js +8 -9
- package/dist/subagents/vercel.cjs +435 -442
- package/dist/subagents/vercel.cjs.map +1 -1
- package/dist/subagents/vercel.js +8 -9
- package/dist/tools/browser/anthropic.cjs +1 -1
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +5 -5
- package/dist/tools/browser/core.cjs +1 -1
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.js +4 -4
- package/dist/tools/browser/index.cjs +1 -1
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.js +7 -7
- package/dist/tools/browser/openai.cjs +1 -1
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +5 -5
- package/dist/tools/browser/profiles/core.cjs +1 -1
- package/dist/tools/browser/profiles/core.cjs.map +1 -1
- package/dist/tools/browser/profiles/core.js +3 -3
- package/dist/tools/browser/profiles/index.cjs +1 -1
- package/dist/tools/browser/profiles/index.cjs.map +1 -1
- package/dist/tools/browser/profiles/index.js +3 -3
- package/dist/tools/browser/vercel.cjs +1 -1
- package/dist/tools/browser/vercel.cjs.map +1 -1
- package/dist/tools/browser/vercel.js +5 -5
- package/dist/tools/codebase_search/anthropic.cjs +1 -1
- package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
- package/dist/tools/codebase_search/anthropic.js +4 -4
- package/dist/tools/codebase_search/core.cjs +1 -1
- package/dist/tools/codebase_search/core.cjs.map +1 -1
- package/dist/tools/codebase_search/core.js +3 -3
- package/dist/tools/codebase_search/index.cjs +1 -1
- package/dist/tools/codebase_search/index.cjs.map +1 -1
- package/dist/tools/codebase_search/index.js +6 -6
- package/dist/tools/codebase_search/openai.cjs +1 -1
- package/dist/tools/codebase_search/openai.cjs.map +1 -1
- package/dist/tools/codebase_search/openai.js +4 -4
- package/dist/tools/codebase_search/vercel.cjs +1 -1
- package/dist/tools/codebase_search/vercel.cjs.map +1 -1
- package/dist/tools/codebase_search/vercel.js +4 -4
- package/dist/tools/fastapply/anthropic.cjs +1 -1
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +4 -4
- package/dist/tools/fastapply/apply.cjs +1 -1
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.js +2 -2
- package/dist/tools/fastapply/core.cjs +1 -1
- package/dist/tools/fastapply/core.cjs.map +1 -1
- package/dist/tools/fastapply/core.js +3 -3
- package/dist/tools/fastapply/index.cjs +1 -1
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.js +6 -6
- package/dist/tools/fastapply/openai.cjs +1 -1
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +4 -4
- package/dist/tools/fastapply/vercel.cjs +1 -1
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.js +4 -4
- package/dist/tools/index.cjs +1 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +6 -6
- package/dist/tools/utils/resilience.cjs +1 -1
- package/dist/tools/utils/resilience.cjs.map +1 -1
- package/dist/tools/utils/resilience.js +2 -2
- package/dist/tools/warp_grep/agent/config.cjs +4 -3
- package/dist/tools/warp_grep/agent/config.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/config.d.ts +2 -1
- package/dist/tools/warp_grep/agent/config.js +1 -1
- package/dist/tools/warp_grep/agent/parser.cjs +52 -121
- package/dist/tools/warp_grep/agent/parser.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/parser.d.ts +12 -5
- package/dist/tools/warp_grep/agent/parser.js +7 -3
- package/dist/tools/warp_grep/agent/runner.cjs +348 -424
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.d.ts +6 -3
- package/dist/tools/warp_grep/agent/runner.js +5 -6
- package/dist/tools/warp_grep/agent/types.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/types.d.ts +22 -3
- package/dist/tools/warp_grep/anthropic.cjs +435 -442
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +8 -9
- package/dist/tools/warp_grep/client.cjs +435 -442
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +7 -8
- package/dist/tools/warp_grep/gemini.cjs +435 -442
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +7 -8
- package/dist/tools/warp_grep/gemini.js.map +1 -1
- package/dist/tools/warp_grep/harness.cjs +168 -180
- package/dist/tools/warp_grep/harness.cjs.map +1 -1
- package/dist/tools/warp_grep/harness.d.ts +17 -38
- package/dist/tools/warp_grep/harness.js +15 -14
- package/dist/tools/warp_grep/harness.js.map +1 -1
- package/dist/tools/warp_grep/index.cjs +454 -442
- 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 +10 -10
- package/dist/tools/warp_grep/openai.cjs +435 -442
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +8 -9
- package/dist/tools/warp_grep/providers/local.cjs +43 -2
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.d.ts +5 -1
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/providers/remote.cjs +32 -2
- package/dist/tools/warp_grep/providers/remote.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/remote.d.ts +9 -1
- package/dist/tools/warp_grep/providers/remote.js +2 -2
- package/dist/tools/warp_grep/providers/types.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/types.d.ts +14 -1
- package/dist/tools/warp_grep/vercel.cjs +435 -442
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +8 -9
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DKODF3YG.js.map +0 -1
- package/dist/chunk-EUHNJMWL.js +0 -409
- package/dist/chunk-EUHNJMWL.js.map +0 -1
- package/dist/chunk-HZOTLGJH.js.map +0 -1
- package/dist/chunk-NF2QWJDY.js.map +0 -1
- package/dist/chunk-VCKJ22DX.js +0 -131
- package/dist/chunk-VCKJ22DX.js.map +0 -1
- package/dist/chunk-YIETFYCL.js.map +0 -1
- /package/dist/{chunk-J2HIK4GB.js.map → chunk-334JOOAC.js.map} +0 -0
- /package/dist/{chunk-QRSWXP4K.js.map → chunk-3GXWZ7TI.js.map} +0 -0
- /package/dist/{chunk-BDHKL3MT.js.map → chunk-4LZK67MS.js.map} +0 -0
- /package/dist/{chunk-UVNENJ6H.js.map → chunk-4XNHMFVU.js.map} +0 -0
- /package/dist/{chunk-V73GO5AJ.js.map → chunk-7HKJUVAK.js.map} +0 -0
- /package/dist/{chunk-VZ6VYRQB.js.map → chunk-BXQYZR7O.js.map} +0 -0
- /package/dist/{chunk-GJUB3ECP.js.map → chunk-CJD4ZFOX.js.map} +0 -0
- /package/dist/{chunk-KYKRRF7E.js.map → chunk-DYCRGTRN.js.map} +0 -0
- /package/dist/{chunk-EU7OLX4Z.js.map → chunk-ETKDGHOB.js.map} +0 -0
- /package/dist/{chunk-I7SFRYTX.js.map → chunk-HWED34T3.js.map} +0 -0
- /package/dist/{chunk-FIVYDIHX.js.map → chunk-HYRHI2UL.js.map} +0 -0
- /package/dist/{chunk-E4YKEKGW.js.map → chunk-KV2CC4N7.js.map} +0 -0
- /package/dist/{chunk-BIQ7234U.js.map → chunk-LSPEWVCD.js.map} +0 -0
- /package/dist/{chunk-OV57JBMB.js.map → chunk-N7XLC7BK.js.map} +0 -0
- /package/dist/{chunk-FBOJJ3UY.js.map → chunk-O356YR2N.js.map} +0 -0
- /package/dist/{chunk-JSWNBCGS.js.map → chunk-PIHW2GSK.js.map} +0 -0
- /package/dist/{chunk-UYPWKQKV.js.map → chunk-RGNP6FNH.js.map} +0 -0
- /package/dist/{chunk-NKUSUSVI.js.map → chunk-T7VCGKXB.js.map} +0 -0
- /package/dist/{chunk-Q36MNOFA.js.map → chunk-UZ2QUWJD.js.map} +0 -0
- /package/dist/{chunk-FYO46OT6.js.map → chunk-VTTU7MJB.js.map} +0 -0
- /package/dist/{chunk-4PBUB77N.js.map → chunk-XADFYB6B.js.map} +0 -0
- /package/dist/{chunk-T564HFSH.js.map → chunk-XS4PO4FC.js.map} +0 -0
- /package/dist/{chunk-E45FW5EK.js.map → chunk-YH3XIVF2.js.map} +0 -0
- /package/dist/{chunk-MMBQKN4G.js.map → chunk-ZZW4B4GG.js.map} +0 -0
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
executeToolCall,
|
|
15
15
|
formatGitHubReadFileResult,
|
|
16
16
|
formatResult
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-T7VCGKXB.js";
|
|
18
18
|
|
|
19
19
|
// tools/warp_grep/anthropic.ts
|
|
20
20
|
var INPUT_SCHEMA = {
|
|
@@ -90,4 +90,4 @@ export {
|
|
|
90
90
|
createGitHubSearchTool,
|
|
91
91
|
createGitHubReadFileTool
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-RGNP6FNH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_CONFIG
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I3J46TSB.js";
|
|
4
4
|
|
|
5
5
|
// tools/warp_grep/agent/tools/grep.ts
|
|
6
6
|
async function toolGrep(provider, args) {
|
|
@@ -50,29 +50,42 @@ async function toolRead(provider, args) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// tools/warp_grep/agent/tools/list_directory.ts
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
import path from "path";
|
|
54
|
+
async function toolListDirectory(provider, args, repoRoot) {
|
|
55
|
+
const maxResults = args.maxResults ?? AGENT_CONFIG.MAX_LIST_RESULTS;
|
|
56
|
+
const maxDepth = args.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;
|
|
57
|
+
const entries = await provider.listDirectory({
|
|
58
|
+
path: args.path,
|
|
59
|
+
pattern: args.pattern ?? null,
|
|
60
|
+
maxResults,
|
|
61
|
+
maxDepth
|
|
62
|
+
});
|
|
63
|
+
if (!entries.length) return "empty";
|
|
64
|
+
if (repoRoot) {
|
|
65
|
+
const absRoot = path.resolve(repoRoot);
|
|
66
|
+
const lines = entries.map((e) => path.join(absRoot, e.path));
|
|
67
|
+
return lines.join("\n");
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
return entries.map((e) => e.path).join("\n");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// tools/warp_grep/agent/tools/glob.ts
|
|
73
|
+
async function toolGlob(provider, args) {
|
|
74
|
+
const res = await provider.glob(args);
|
|
75
|
+
if (res.error) {
|
|
76
|
+
return res.error;
|
|
77
|
+
}
|
|
78
|
+
if (!res.files.length) {
|
|
79
|
+
return "no matches";
|
|
80
|
+
}
|
|
81
|
+
const header = `Found ${res.totalFound} file(s) matching "${args.pattern}" within ${res.searchDir}, sorted by modification time (newest first):`;
|
|
82
|
+
const body = res.files.join("\n");
|
|
83
|
+
const truncated = res.totalFound > res.files.length ? `
|
|
84
|
+
[${res.totalFound - res.files.length} files truncated]` : "";
|
|
85
|
+
return `${header}
|
|
86
|
+
---
|
|
87
|
+
${body}
|
|
88
|
+
---${truncated}`;
|
|
76
89
|
}
|
|
77
90
|
|
|
78
91
|
// tools/warp_grep/agent/tools/finish.ts
|
|
@@ -142,8 +155,19 @@ function mergeRanges(ranges) {
|
|
|
142
155
|
}
|
|
143
156
|
|
|
144
157
|
// tools/warp_grep/agent/helpers.ts
|
|
145
|
-
import
|
|
158
|
+
import path2 from "path";
|
|
146
159
|
var TRUNCATED_MARKER = "[truncated for context limit]";
|
|
160
|
+
function getMessageSize(m) {
|
|
161
|
+
if (m.role === "tool") return m.content.length;
|
|
162
|
+
if (m.role === "assistant") {
|
|
163
|
+
let size = typeof m.content === "string" ? m.content.length : 0;
|
|
164
|
+
if (m.tool_calls) {
|
|
165
|
+
size += m.tool_calls.reduce((s, tc) => s + tc.function.name.length + tc.function.arguments.length, 0);
|
|
166
|
+
}
|
|
167
|
+
return size;
|
|
168
|
+
}
|
|
169
|
+
return m.content.length;
|
|
170
|
+
}
|
|
147
171
|
function formatTurnMessage(turnsUsed, maxTurns) {
|
|
148
172
|
const turnsRemaining = maxTurns - turnsUsed;
|
|
149
173
|
if (turnsRemaining === 1) {
|
|
@@ -154,33 +178,30 @@ You have used ${turnsUsed} turns, you only have 1 turn remaining. You have run o
|
|
|
154
178
|
You have used ${turnsUsed} turn${turnsUsed === 1 ? "" : "s"} and have ${turnsRemaining} remaining`;
|
|
155
179
|
}
|
|
156
180
|
function calculateContextBudget(messages) {
|
|
157
|
-
const totalChars = messages.reduce((sum, m) => sum + m
|
|
181
|
+
const totalChars = messages.reduce((sum, m) => sum + getMessageSize(m), 0);
|
|
158
182
|
const maxChars = AGENT_CONFIG.MAX_CONTEXT_CHARS;
|
|
159
|
-
const percent = Math.
|
|
160
|
-
const usedK = Math.
|
|
161
|
-
const maxK = Math.
|
|
162
|
-
return `<context_budget>${percent}% (${usedK}K/${maxK}K chars
|
|
183
|
+
const percent = Math.floor(totalChars / maxChars * 100);
|
|
184
|
+
const usedK = Math.floor(totalChars / 1e3);
|
|
185
|
+
const maxK = Math.floor(maxChars / 1e3);
|
|
186
|
+
return `<context_budget>${percent}% (${usedK}K/${maxK}K chars)</context_budget>`;
|
|
163
187
|
}
|
|
164
188
|
async function buildInitialState(repoRoot, searchTerm, provider, options) {
|
|
165
189
|
const budget = calculateContextBudget([]);
|
|
166
|
-
const turnTag = `
|
|
190
|
+
const turnTag = `You have used 0 turns and have ${AGENT_CONFIG.MAX_TURNS} remaining`;
|
|
167
191
|
const treeDepth = options?.search_type === "node_modules" ? 1 : 2;
|
|
192
|
+
const absRoot = path2.resolve(repoRoot);
|
|
168
193
|
try {
|
|
169
194
|
const entries = await provider.listDirectory({
|
|
170
195
|
path: ".",
|
|
171
196
|
maxResults: AGENT_CONFIG.MAX_OUTPUT_LINES,
|
|
172
197
|
maxDepth: treeDepth
|
|
173
198
|
});
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
});
|
|
179
|
-
const repoName = path.basename(repoRoot);
|
|
180
|
-
const treeOutput = treeLines.length > 0 ? `${repoName}/
|
|
181
|
-
${treeLines.join("\n")}` : `${repoName}/`;
|
|
199
|
+
const lines = [absRoot];
|
|
200
|
+
for (const e of entries) {
|
|
201
|
+
lines.push(path2.join(absRoot, e.path));
|
|
202
|
+
}
|
|
182
203
|
return `<repo_structure>
|
|
183
|
-
${
|
|
204
|
+
${lines.join("\n")}
|
|
184
205
|
</repo_structure>
|
|
185
206
|
|
|
186
207
|
<search_string>
|
|
@@ -189,9 +210,8 @@ ${searchTerm}
|
|
|
189
210
|
${budget}
|
|
190
211
|
${turnTag}`;
|
|
191
212
|
} catch {
|
|
192
|
-
const repoName = path.basename(repoRoot);
|
|
193
213
|
return `<repo_structure>
|
|
194
|
-
${
|
|
214
|
+
${absRoot}
|
|
195
215
|
</repo_structure>
|
|
196
216
|
|
|
197
217
|
<search_string>
|
|
@@ -210,26 +230,32 @@ function formatListDirectoryTree(entries) {
|
|
|
210
230
|
}).join("\n");
|
|
211
231
|
}
|
|
212
232
|
function enforceContextLimit(messages, maxChars = AGENT_CONFIG.MAX_CONTEXT_CHARS) {
|
|
213
|
-
const getTotalChars = () => messages.reduce((sum, m) => sum + m
|
|
233
|
+
const getTotalChars = () => messages.reduce((sum, m) => sum + getMessageSize(m), 0);
|
|
214
234
|
if (getTotalChars() <= maxChars) {
|
|
215
235
|
return messages;
|
|
216
236
|
}
|
|
217
|
-
const
|
|
237
|
+
const truncatableIndices = [];
|
|
218
238
|
let firstUserSkipped = false;
|
|
219
239
|
for (let i = 0; i < messages.length; i++) {
|
|
220
|
-
|
|
240
|
+
const m = messages[i];
|
|
241
|
+
if (m.role === "tool") {
|
|
242
|
+
truncatableIndices.push(i);
|
|
243
|
+
} else if (m.role === "user") {
|
|
221
244
|
if (!firstUserSkipped) {
|
|
222
245
|
firstUserSkipped = true;
|
|
223
246
|
continue;
|
|
224
247
|
}
|
|
225
|
-
|
|
248
|
+
truncatableIndices.push(i);
|
|
226
249
|
}
|
|
227
250
|
}
|
|
228
|
-
for (const idx of
|
|
251
|
+
for (const idx of truncatableIndices) {
|
|
229
252
|
if (getTotalChars() <= maxChars) {
|
|
230
253
|
break;
|
|
231
254
|
}
|
|
232
|
-
|
|
255
|
+
const m = messages[idx];
|
|
256
|
+
if (m.role === "tool" && m.content !== TRUNCATED_MARKER) {
|
|
257
|
+
messages[idx] = { role: "tool", tool_call_id: m.tool_call_id, content: TRUNCATED_MARKER };
|
|
258
|
+
} else if (m.role === "user" && m.content !== TRUNCATED_MARKER) {
|
|
233
259
|
messages[idx] = { role: "user", content: TRUNCATED_MARKER };
|
|
234
260
|
}
|
|
235
261
|
}
|
|
@@ -240,6 +266,7 @@ export {
|
|
|
240
266
|
toolGrep,
|
|
241
267
|
toolRead,
|
|
242
268
|
toolListDirectory,
|
|
269
|
+
toolGlob,
|
|
243
270
|
normalizeFinishFiles,
|
|
244
271
|
readFinishFiles,
|
|
245
272
|
formatTurnMessage,
|
|
@@ -248,4 +275,4 @@ export {
|
|
|
248
275
|
formatListDirectoryTree,
|
|
249
276
|
enforceContextLimit
|
|
250
277
|
};
|
|
251
|
-
//# sourceMappingURL=chunk-
|
|
278
|
+
//# sourceMappingURL=chunk-T7HF2TDQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tools/warp_grep/agent/tools/grep.ts","../tools/warp_grep/agent/tools/read.ts","../tools/warp_grep/agent/tools/list_directory.ts","../tools/warp_grep/agent/tools/glob.ts","../tools/warp_grep/agent/tools/finish.ts","../tools/warp_grep/agent/helpers.ts"],"sourcesContent":["import type { WarpGrepProvider } from '../../providers/types.js';\n\nexport async function toolGrep(\n provider: WarpGrepProvider,\n args: { pattern: string; path: string; glob?: string; context_lines?: number; case_sensitive?: boolean }\n): Promise<{ output: string }> {\n const res = await provider.grep(args);\n \n // Return errors as output - let the model see and handle them\n if (res.error) {\n return { output: res.error };\n }\n \n if (!res.lines.length) {\n return { output: 'no matches' };\n }\n \n return { output: res.lines.join('\\n') };\n}\n\n","import type { WarpGrepProvider } from '../../providers/types.js';\n\nfunction isValidRange(start: unknown, end: unknown): boolean {\n return (\n typeof start === 'number' &&\n typeof end === 'number' &&\n Number.isFinite(start) &&\n Number.isFinite(end) &&\n start > 0 &&\n end >= start\n );\n}\n\nexport async function toolRead(\n provider: WarpGrepProvider,\n args: { path: string; start?: number; end?: number; lines?: Array<[number, number]> }\n): Promise<string> {\n if (args.lines && Array.isArray(args.lines) && args.lines.length > 0) {\n const validRanges: Array<[number, number]> = [];\n for (const range of args.lines) {\n if (Array.isArray(range) && range.length >= 2 && isValidRange(range[0], range[1])) {\n validRanges.push([range[0], range[1]]);\n }\n }\n \n if (validRanges.length === 0) {\n const res = await provider.read({ path: args.path });\n if (res.error) return res.error;\n if (!res.lines.length) return '(empty file)';\n return res.lines.join('\\n');\n }\n \n const chunks: string[] = [];\n for (const [start, end] of validRanges) {\n const res = await provider.read({ path: args.path, start, end });\n if (res.error) return res.error;\n chunks.push(res.lines.join('\\n'));\n }\n if (chunks.every(c => c === '')) return '(empty file)';\n return chunks.join('\\n...\\n');\n }\n\n const res = await provider.read({ path: args.path, start: args.start, end: args.end });\n if (res.error) {\n return res.error;\n }\n if (!res.lines.length) return '(empty file)';\n return res.lines.join('\\n');\n}\n\n","import type { WarpGrepProvider } from '../../providers/types.js';\nimport { AGENT_CONFIG } from '../config.js';\nimport path from 'path';\n\nexport async function toolListDirectory(\n provider: WarpGrepProvider,\n args: { path: string; pattern?: string | null; maxResults?: number; maxDepth?: number },\n repoRoot?: string,\n): Promise<string> {\n\n const maxResults = args.maxResults ?? AGENT_CONFIG.MAX_LIST_RESULTS;\n const maxDepth = args.maxDepth ?? AGENT_CONFIG.MAX_LIST_DEPTH;\n\n const entries = await provider.listDirectory({\n path: args.path,\n pattern: args.pattern ?? null,\n maxResults,\n maxDepth,\n });\n\n if (!entries.length) return 'empty';\n\n // Flat absolute paths (matches training format)\n // If repoRoot is available, convert relative paths to absolute\n if (repoRoot) {\n const absRoot = path.resolve(repoRoot);\n const lines = entries.map(e => path.join(absRoot, e.path));\n return lines.join('\\n');\n }\n\n // Fallback: return relative paths if repoRoot not available\n return entries.map(e => e.path).join('\\n');\n}\n","import type { WarpGrepProvider } from '../../providers/types.js';\n\nexport async function toolGlob(\n provider: WarpGrepProvider,\n args: { pattern: string; path?: string }\n): Promise<string> {\n const res = await provider.glob(args);\n\n if (res.error) {\n return res.error;\n }\n\n if (!res.files.length) {\n return 'no matches';\n }\n\n // Match training output format exactly\n const header = `Found ${res.totalFound} file(s) matching \"${args.pattern}\" within ${res.searchDir}, sorted by modification time (newest first):`;\n const body = res.files.join('\\n');\n const truncated = res.totalFound > res.files.length\n ? `\\n[${res.totalFound - res.files.length} files truncated]`\n : '';\n return `${header}\\n---\\n${body}\\n---${truncated}`;\n}\n","import type { FinishFileSpec } from '../types.js';\n\nfunction isValidRange(range: unknown): range is [number, number] {\n return (\n Array.isArray(range) &&\n range.length >= 2 &&\n typeof range[0] === 'number' &&\n typeof range[1] === 'number' &&\n Number.isFinite(range[0]) &&\n Number.isFinite(range[1]) &&\n range[0] > 0 &&\n range[1] >= range[0]\n );\n}\n\nfunction extractValidRanges(lines: unknown): Array<[number, number]> | null {\n if (!Array.isArray(lines)) return null;\n const valid: Array<[number, number]> = [];\n for (const range of lines) {\n if (isValidRange(range)) {\n valid.push([range[0], range[1]]);\n }\n }\n return valid.length > 0 ? valid : null;\n}\n\nexport function normalizeFinishFiles(files: FinishFileSpec[]): FinishFileSpec[] {\n return files.map((f) => {\n if (f.lines === '*') return { path: f.path, lines: '*' };\n const validRanges = extractValidRanges(f.lines);\n if (!validRanges) return { path: f.path, lines: '*' };\n return { path: f.path, lines: mergeRanges(validRanges) };\n });\n}\n\nexport async function readFinishFiles(\n repoRoot: string,\n files: FinishFileSpec[],\n reader: (path: string, start?: number, end?: number) => Promise<string[]>\n): Promise<{ path: string; ranges: '*' | Array<[number, number]>; content: string }[]> {\n const out: { path: string; ranges: '*' | Array<[number, number]>; content: string }[] = [];\n for (const f of files) {\n const validRanges = f.lines === '*' ? null : extractValidRanges(f.lines);\n if (f.lines === '*' || !validRanges) {\n const lines = await reader(f.path);\n out.push({ path: f.path, ranges: '*', content: lines.join('\\n') });\n } else {\n const ranges = mergeRanges(validRanges);\n const chunks: string[] = [];\n for (let i = 0; i < ranges.length; i++) {\n const [s, e] = ranges[i];\n if (i === 0 && s > 1) {\n chunks.push(`// ... existing code, block starting at line ${s} ...`);\n } else if (i > 0) {\n chunks.push(`// ... existing code, block starting at line ${s} ...`);\n }\n const lines = await reader(f.path, s, e);\n chunks.push(lines.join('\\n'));\n }\n out.push({ path: f.path, ranges, content: chunks.join('\\n') });\n }\n }\n return out;\n}\n\nfunction mergeRanges(ranges: Array<[number, number]>): Array<[number, number]> {\n if (!ranges.length) return [];\n const sorted = [...ranges].sort((a, b) => a[0] - b[0]);\n const merged: Array<[number, number]> = [];\n let [cs, ce] = sorted[0];\n for (let i = 1; i < sorted.length; i++) {\n const [s, e] = sorted[i];\n if (s <= ce + 1) {\n ce = Math.max(ce, e);\n } else {\n merged.push([cs, ce]);\n cs = s;\n ce = e;\n }\n }\n merged.push([cs, ce]);\n return merged;\n}\n\n","/**\n * Shared helper functions for warp-grep agent loop.\n * Used by both the internal runner and exported for harness users.\n */\n\nimport path from 'path';\nimport { AGENT_CONFIG } from './config.js';\nimport type { ChatMessage } from './types.js';\nimport type { WarpGrepProvider, ListDirectoryEntry } from '../providers/types.js';\n\nconst TRUNCATED_MARKER = '[truncated for context limit]';\n\n/**\n * Get the character size of a ChatMessage (handles all message types).\n */\nfunction getMessageSize(m: ChatMessage): number {\n if (m.role === 'tool') return m.content.length;\n if (m.role === 'assistant') {\n let size = typeof m.content === 'string' ? m.content.length : 0;\n if (m.tool_calls) {\n size += m.tool_calls.reduce((s, tc) => s + tc.function.name.length + tc.function.arguments.length, 0);\n }\n return size;\n }\n // system or user\n return (m as { content: string }).content.length;\n}\n\n/**\n * Format the turn counter message shown to the model.\n */\nexport function formatTurnMessage(turnsUsed: number, maxTurns: number): string {\n const turnsRemaining = maxTurns - turnsUsed;\n if (turnsRemaining === 1) {\n return `\\nYou have used ${turnsUsed} turns, you only have 1 turn remaining. You have run out of turns to explore the code base and MUST call the finish tool now`;\n }\n return `\\nYou have used ${turnsUsed} turn${turnsUsed === 1 ? '' : 's'} and have ${turnsRemaining} remaining`;\n}\n\n/**\n * Calculate and format the context budget indicator.\n */\nexport function calculateContextBudget(messages: ChatMessage[]): string {\n const totalChars = messages.reduce((sum, m) => sum + getMessageSize(m), 0);\n const maxChars = AGENT_CONFIG.MAX_CONTEXT_CHARS;\n const percent = Math.floor((totalChars / maxChars) * 100);\n const usedK = Math.floor(totalChars / 1000);\n const maxK = Math.floor(maxChars / 1000);\n return `<context_budget>${percent}% (${usedK}K/${maxK}K chars)</context_budget>`;\n}\n\n/**\n * Build the initial state message containing repo structure and search term.\n */\nexport async function buildInitialState(\n repoRoot: string,\n searchTerm: string,\n provider: WarpGrepProvider,\n options?: { search_type?: string },\n): Promise<string> {\n const budget = calculateContextBudget([]);\n const turnTag = `You have used 0 turns and have ${AGENT_CONFIG.MAX_TURNS} remaining`;\n const treeDepth = options?.search_type === 'node_modules' ? 1 : 2;\n\n const absRoot = path.resolve(repoRoot);\n\n try {\n const entries = await provider.listDirectory({\n path: '.',\n maxResults: AGENT_CONFIG.MAX_OUTPUT_LINES,\n maxDepth: treeDepth,\n });\n\n // Flat list of absolute paths (matches training format)\n // First line is the repo root, then one absolute path per entry\n const lines = [absRoot];\n for (const e of entries) {\n lines.push(path.join(absRoot, e.path));\n }\n\n return `<repo_structure>\\n${lines.join('\\n')}\\n</repo_structure>\\n\\n<search_string>\\n${searchTerm}\\n</search_string>\\n${budget}\\n${turnTag}`;\n } catch {\n return `<repo_structure>\\n${absRoot}\\n</repo_structure>\\n\\n<search_string>\\n${searchTerm}\\n</search_string>\\n${budget}\\n${turnTag}`;\n }\n}\n\n/**\n * Format directory entries as an indented tree string.\n */\nexport function formatListDirectoryTree(entries: ListDirectoryEntry[]): string {\n if (!entries.length) return 'empty';\n return entries\n .map((e) => {\n const indent = ' '.repeat(e.depth);\n const name = e.type === 'dir' ? `${e.name}/` : e.name;\n return `${indent}${name}`;\n })\n .join('\\n');\n}\n\n/**\n * Enforce hard context limit by truncating tool result messages.\n * Preserves the first user message (initial query) and all assistant messages.\n * Truncates tool/user messages from oldest to newest until under the threshold.\n *\n * @param messages - The conversation messages array (mutated in place)\n * @param maxChars - Maximum total character count (defaults to AGENT_CONFIG.MAX_CONTEXT_CHARS)\n * @returns The same messages array, truncated if necessary\n */\nexport function enforceContextLimit(\n messages: ChatMessage[],\n maxChars: number = AGENT_CONFIG.MAX_CONTEXT_CHARS\n): ChatMessage[] {\n const getTotalChars = () => messages.reduce((sum, m) => sum + getMessageSize(m), 0);\n\n if (getTotalChars() <= maxChars) {\n return messages;\n }\n\n // Find indices of truncatable messages (tool results and non-first user messages)\n const truncatableIndices: number[] = [];\n let firstUserSkipped = false;\n for (let i = 0; i < messages.length; i++) {\n const m = messages[i];\n if (m.role === 'tool') {\n truncatableIndices.push(i);\n } else if (m.role === 'user') {\n if (!firstUserSkipped) {\n firstUserSkipped = true;\n continue; // Skip first user message (contains the search query)\n }\n truncatableIndices.push(i);\n }\n }\n\n // Truncate from oldest to newest until under limit\n for (const idx of truncatableIndices) {\n if (getTotalChars() <= maxChars) {\n break;\n }\n const m = messages[idx];\n if (m.role === 'tool' && m.content !== TRUNCATED_MARKER) {\n messages[idx] = { role: 'tool', tool_call_id: m.tool_call_id, content: TRUNCATED_MARKER };\n } else if (m.role === 'user' && (m as { content: string }).content !== TRUNCATED_MARKER) {\n messages[idx] = { role: 'user', content: TRUNCATED_MARKER };\n }\n }\n\n return messages;\n}\n"],"mappings":";;;;;AAEA,eAAsB,SACpB,UACA,MAC6B;AAC7B,QAAM,MAAM,MAAM,SAAS,KAAK,IAAI;AAGpC,MAAI,IAAI,OAAO;AACb,WAAO,EAAE,QAAQ,IAAI,MAAM;AAAA,EAC7B;AAEA,MAAI,CAAC,IAAI,MAAM,QAAQ;AACrB,WAAO,EAAE,QAAQ,aAAa;AAAA,EAChC;AAEA,SAAO,EAAE,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;AACxC;;;AChBA,SAAS,aAAa,OAAgB,KAAuB;AAC3D,SACE,OAAO,UAAU,YACjB,OAAO,QAAQ,YACf,OAAO,SAAS,KAAK,KACrB,OAAO,SAAS,GAAG,KACnB,QAAQ,KACR,OAAO;AAEX;AAEA,eAAsB,SACpB,UACA,MACiB;AACjB,MAAI,KAAK,SAAS,MAAM,QAAQ,KAAK,KAAK,KAAK,KAAK,MAAM,SAAS,GAAG;AACpE,UAAM,cAAuC,CAAC;AAC9C,eAAW,SAAS,KAAK,OAAO;AAC9B,UAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU,KAAK,aAAa,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG;AACjF,oBAAY,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAAA,MACvC;AAAA,IACF;AAEA,QAAI,YAAY,WAAW,GAAG;AAC5B,YAAMA,OAAM,MAAM,SAAS,KAAK,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MAAM,SAAS,OAAO,CAAC,KAAK,MAAM,MAAM,eAAe,CAAC,GAAG,CAAC;AAElF,MAAI,cAAc,KAAK,UAAU;AAC/B,WAAO;AAAA,EACT;AAGA,QAAM,qBAA+B,CAAC;AACtC,MAAI,mBAAmB;AACvB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,IAAI,SAAS,CAAC;AACpB,QAAI,EAAE,SAAS,QAAQ;AACrB,yBAAmB,KAAK,CAAC;AAAA,IAC3B,WAAW,EAAE,SAAS,QAAQ;AAC5B,UAAI,CAAC,kBAAkB;AACrB,2BAAmB;AACnB;AAAA,MACF;AACA,yBAAmB,KAAK,CAAC;AAAA,IAC3B;AAAA,EACF;AAGA,aAAW,OAAO,oBAAoB;AACpC,QAAI,cAAc,KAAK,UAAU;AAC/B;AAAA,IACF;AACA,UAAM,IAAI,SAAS,GAAG;AACtB,QAAI,EAAE,SAAS,UAAU,EAAE,YAAY,kBAAkB;AACvD,eAAS,GAAG,IAAI,EAAE,MAAM,QAAQ,cAAc,EAAE,cAAc,SAAS,iBAAiB;AAAA,IAC1F,WAAW,EAAE,SAAS,UAAW,EAA0B,YAAY,kBAAkB;AACvF,eAAS,GAAG,IAAI,EAAE,MAAM,QAAQ,SAAS,iBAAiB;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO;AACT;","names":["res","isValidRange","path","path"]}
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
runWarpGrep,
|
|
6
6
|
runWarpGrepStreaming
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GK56GCLU.js";
|
|
8
8
|
import {
|
|
9
9
|
createCodeStorageHttpCommands
|
|
10
10
|
} from "./chunk-GVGJIXV2.js";
|
|
11
11
|
import {
|
|
12
12
|
RemoteCommandsProvider
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-B3AKP3RA.js";
|
|
14
14
|
|
|
15
15
|
// tools/warp_grep/client.ts
|
|
16
16
|
var DEFAULT_CODE_SEARCH_URL = "https://morphllm.com";
|
|
@@ -290,4 +290,4 @@ export {
|
|
|
290
290
|
formatGitHubReadFileResult,
|
|
291
291
|
formatResult
|
|
292
292
|
};
|
|
293
|
-
//# sourceMappingURL=chunk-
|
|
293
|
+
//# sourceMappingURL=chunk-T7VCGKXB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SDK_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G4TRYATX.js";
|
|
4
4
|
|
|
5
5
|
// tools/utils/resilience.ts
|
|
6
6
|
var DEFAULT_RETRY_CONFIG = {
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
withTimeout,
|
|
92
92
|
MorphError
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-UZ2QUWJD.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
executeGitHubReadFile,
|
|
9
9
|
executeToolCall,
|
|
10
10
|
executeToolCallStreaming
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-T7VCGKXB.js";
|
|
12
12
|
|
|
13
13
|
// tools/warp_grep/vercel.ts
|
|
14
14
|
import { tool } from "ai";
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
createGitHubReadFileTool,
|
|
116
116
|
vercel_default
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-VTTU7MJB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WarpGrepClient,
|
|
3
3
|
formatResult
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-T7VCGKXB.js";
|
|
5
5
|
import {
|
|
6
6
|
CODEBASE_SEARCH_TOOL,
|
|
7
7
|
SEND_MESSAGE_TOOL,
|
|
@@ -285,4 +285,4 @@ function deduplicateContexts(contexts) {
|
|
|
285
285
|
export {
|
|
286
286
|
createExploreSubagent
|
|
287
287
|
};
|
|
288
|
-
//# sourceMappingURL=chunk-
|
|
288
|
+
//# sourceMappingURL=chunk-XADFYB6B.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-2HMEZZKK.js";
|
|
5
5
|
import {
|
|
6
6
|
executeBrowserTask
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4XNHMFVU.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
createBrowserTool,
|
|
78
78
|
anthropic_exports
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-YH3XIVF2.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-63WE2C5R.js";
|
|
5
5
|
import {
|
|
6
6
|
executeEditFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XS4PO4FC.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -79,4 +79,4 @@ export {
|
|
|
79
79
|
getSystemPrompt,
|
|
80
80
|
anthropic_exports
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-ZZW4B4GG.js.map
|