@morphllm/morphsdk 0.2.55 → 0.2.57

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.
Files changed (59) hide show
  1. package/dist/{chunk-37SRI4GW.js → chunk-6X5UOY7B.js} +34 -39
  2. package/dist/chunk-6X5UOY7B.js.map +1 -0
  3. package/dist/chunk-7OQOOB3R.js +1 -0
  4. package/dist/{chunk-X5HNQ7SB.js → chunk-CFF636UC.js} +3 -3
  5. package/dist/{chunk-KO6JQFRE.js → chunk-GJ5TYNRD.js} +2 -2
  6. package/dist/{chunk-ZWY434TS.js → chunk-IMYQOKFO.js} +3 -3
  7. package/dist/{chunk-BSHJGJ25.js → chunk-KBQWGT5L.js} +3 -3
  8. package/dist/{chunk-C6QQL6FX.js → chunk-QFIHUCTF.js} +5 -5
  9. package/dist/client.cjs +28 -142
  10. package/dist/client.cjs.map +1 -1
  11. package/dist/client.js +8 -9
  12. package/dist/index.cjs +28 -209
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.ts +0 -1
  15. package/dist/index.js +9 -14
  16. package/dist/tools/warp_grep/agent/runner.cjs +28 -142
  17. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  18. package/dist/tools/warp_grep/agent/runner.js +3 -4
  19. package/dist/tools/warp_grep/anthropic.cjs +28 -142
  20. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  21. package/dist/tools/warp_grep/anthropic.js +5 -6
  22. package/dist/tools/warp_grep/harness.cjs +859 -0
  23. package/dist/tools/warp_grep/harness.cjs.map +1 -0
  24. package/dist/tools/warp_grep/harness.d.ts +176 -0
  25. package/dist/tools/warp_grep/harness.js +76 -0
  26. package/dist/tools/warp_grep/harness.js.map +1 -0
  27. package/dist/tools/warp_grep/index.cjs +28 -209
  28. package/dist/tools/warp_grep/index.cjs.map +1 -1
  29. package/dist/tools/warp_grep/index.d.ts +0 -1
  30. package/dist/tools/warp_grep/index.js +8 -13
  31. package/dist/tools/warp_grep/openai.cjs +28 -142
  32. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  33. package/dist/tools/warp_grep/openai.js +5 -6
  34. package/dist/tools/warp_grep/vercel.cjs +28 -142
  35. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  36. package/dist/tools/warp_grep/vercel.js +5 -6
  37. package/package.json +7 -2
  38. package/dist/chunk-37SRI4GW.js.map +0 -1
  39. package/dist/chunk-JYBVRF72.js +0 -1
  40. package/dist/chunk-NDZO5IPV.js +0 -121
  41. package/dist/chunk-NDZO5IPV.js.map +0 -1
  42. package/dist/chunk-P2XKFWFD.js +0 -73
  43. package/dist/chunk-P2XKFWFD.js.map +0 -1
  44. package/dist/tools/warp_grep/agent/grep_helpers.cjs +0 -148
  45. package/dist/tools/warp_grep/agent/grep_helpers.cjs.map +0 -1
  46. package/dist/tools/warp_grep/agent/grep_helpers.d.ts +0 -16
  47. package/dist/tools/warp_grep/agent/grep_helpers.js +0 -14
  48. package/dist/tools/warp_grep/agent/grep_helpers.js.map +0 -1
  49. package/dist/tools/warp_grep/providers/command.cjs +0 -177
  50. package/dist/tools/warp_grep/providers/command.cjs.map +0 -1
  51. package/dist/tools/warp_grep/providers/command.d.ts +0 -48
  52. package/dist/tools/warp_grep/providers/command.js +0 -9
  53. package/dist/tools/warp_grep/providers/command.js.map +0 -1
  54. /package/dist/{chunk-JYBVRF72.js.map → chunk-7OQOOB3R.js.map} +0 -0
  55. /package/dist/{chunk-X5HNQ7SB.js.map → chunk-CFF636UC.js.map} +0 -0
  56. /package/dist/{chunk-KO6JQFRE.js.map → chunk-GJ5TYNRD.js.map} +0 -0
  57. /package/dist/{chunk-ZWY434TS.js.map → chunk-IMYQOKFO.js.map} +0 -0
  58. /package/dist/{chunk-BSHJGJ25.js.map → chunk-KBQWGT5L.js.map} +0 -0
  59. /package/dist/{chunk-C6QQL6FX.js.map → chunk-QFIHUCTF.js.map} +0 -0
@@ -1,121 +0,0 @@
1
- // tools/warp_grep/agent/grep_helpers.ts
2
- var GrepState = class {
3
- seenLines = /* @__PURE__ */ new Set();
4
- isNew(path, lineNumber) {
5
- const key = this.makeKey(path, lineNumber);
6
- return !this.seenLines.has(key);
7
- }
8
- add(path, lineNumber) {
9
- this.seenLines.add(this.makeKey(path, lineNumber));
10
- }
11
- makeKey(path, lineNumber) {
12
- return `${path}:${lineNumber}`;
13
- }
14
- };
15
- var MAX_GREP_OUTPUT_CHARS_PER_TURN = 6e4;
16
- function extractMatchFields(payload) {
17
- const text = payload.replace(/\r?\n$/, "");
18
- if (!text || text.startsWith("[error]")) {
19
- return null;
20
- }
21
- const firstSep = text.indexOf(":");
22
- if (firstSep === -1) {
23
- return null;
24
- }
25
- let filePath = text.slice(0, firstSep).trim();
26
- if (!filePath) {
27
- return null;
28
- }
29
- if (filePath.startsWith("./") || filePath.startsWith(".\\")) {
30
- filePath = filePath.slice(2);
31
- }
32
- const remainder = text.slice(firstSep + 1);
33
- const secondSep = remainder.indexOf(":");
34
- if (secondSep === -1) {
35
- return null;
36
- }
37
- const linePart = remainder.slice(0, secondSep);
38
- const lineNumber = Number.parseInt(linePart, 10);
39
- if (!Number.isInteger(lineNumber) || lineNumber <= 0) {
40
- return null;
41
- }
42
- let contentSegment = remainder.slice(secondSep + 1);
43
- const columnSep = contentSegment.indexOf(":");
44
- if (columnSep !== -1 && /^\d+$/.test(contentSegment.slice(0, columnSep))) {
45
- contentSegment = contentSegment.slice(columnSep + 1);
46
- }
47
- const content = contentSegment.trim();
48
- if (!content) {
49
- return null;
50
- }
51
- return { path: filePath, lineNumber, content };
52
- }
53
- function parseAndFilterGrepOutput(rawOutput, state) {
54
- const matches = [];
55
- if (typeof rawOutput !== "string" || !rawOutput.trim()) {
56
- return matches;
57
- }
58
- for (const line of rawOutput.split(/\r?\n/)) {
59
- const fields = extractMatchFields(line);
60
- if (!fields) {
61
- continue;
62
- }
63
- if (state.isNew(fields.path, fields.lineNumber)) {
64
- matches.push(fields);
65
- state.add(fields.path, fields.lineNumber);
66
- }
67
- }
68
- return matches;
69
- }
70
- function truncateOutput(payload, maxChars) {
71
- if (payload.length <= maxChars) {
72
- return payload;
73
- }
74
- const note = "... (output truncated)";
75
- const available = maxChars - note.length - 1;
76
- if (available <= 0) {
77
- return note;
78
- }
79
- if (payload.length <= available) {
80
- return `${payload.slice(0, available).replace(/\n$/, "")}
81
- ${note}`;
82
- }
83
- const core = payload.slice(0, Math.max(0, available - 1));
84
- const trimmed = core.replace(/\n$/, "").replace(/\s+$/, "");
85
- const snippet = trimmed ? `${trimmed}\u2026` : "\u2026";
86
- return `${snippet}
87
- ${note}`;
88
- }
89
- function formatTurnGrepOutput(matches, maxChars = MAX_GREP_OUTPUT_CHARS_PER_TURN) {
90
- if (!matches || matches.length === 0) {
91
- return "No new matches found.";
92
- }
93
- const matchesByFile = /* @__PURE__ */ new Map();
94
- for (const match of matches) {
95
- if (!matchesByFile.has(match.path)) {
96
- matchesByFile.set(match.path, []);
97
- }
98
- matchesByFile.get(match.path).push(match);
99
- }
100
- const lines = [];
101
- const sortedPaths = Array.from(matchesByFile.keys()).sort();
102
- sortedPaths.forEach((filePath, index) => {
103
- if (index > 0) {
104
- lines.push("");
105
- }
106
- lines.push(filePath);
107
- const sortedMatches = matchesByFile.get(filePath).slice().sort((a, b) => a.lineNumber - b.lineNumber);
108
- for (const match of sortedMatches) {
109
- lines.push(`${match.lineNumber}:${match.content}`);
110
- }
111
- });
112
- return truncateOutput(lines.join("\n"), maxChars);
113
- }
114
-
115
- export {
116
- GrepState,
117
- MAX_GREP_OUTPUT_CHARS_PER_TURN,
118
- parseAndFilterGrepOutput,
119
- formatTurnGrepOutput
120
- };
121
- //# sourceMappingURL=chunk-NDZO5IPV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../tools/warp_grep/agent/grep_helpers.ts"],"sourcesContent":["export interface GrepMatch {\n\tpath: string;\n\tlineNumber: number;\n\tcontent: string;\n}\n\nexport class GrepState {\n\tprivate readonly seenLines = new Set<string>();\n\n\tisNew(path: string, lineNumber: number): boolean {\n\t\tconst key = this.makeKey(path, lineNumber);\n\t\treturn !this.seenLines.has(key);\n\t}\n\n\tadd(path: string, lineNumber: number): void {\n\t\tthis.seenLines.add(this.makeKey(path, lineNumber));\n\t}\n\n\tprivate makeKey(path: string, lineNumber: number): string {\n\t\treturn `${path}:${lineNumber}`;\n\t}\n}\n\nexport const MAX_GREP_OUTPUT_CHARS_PER_TURN = 60_000;\n\nfunction extractMatchFields(payload: string): GrepMatch | null {\n\tconst text = payload.replace(/\\r?\\n$/, \"\");\n\tif (!text || text.startsWith(\"[error]\")) {\n\t\treturn null;\n\t}\n\n\tconst firstSep = text.indexOf(\":\");\n\tif (firstSep === -1) {\n\t\treturn null;\n\t}\n\tlet filePath = text.slice(0, firstSep).trim();\n\tif (!filePath) {\n\t\treturn null;\n\t}\n\tif (filePath.startsWith(\"./\") || filePath.startsWith(\".\\\\\")) {\n\t\tfilePath = filePath.slice(2);\n\t}\n\n\tconst remainder = text.slice(firstSep + 1);\n\tconst secondSep = remainder.indexOf(\":\");\n\tif (secondSep === -1) {\n\t\treturn null;\n\t}\n\n\tconst linePart = remainder.slice(0, secondSep);\n\tconst lineNumber = Number.parseInt(linePart, 10);\n\tif (!Number.isInteger(lineNumber) || lineNumber <= 0) {\n\t\treturn null;\n\t}\n\n\tlet contentSegment = remainder.slice(secondSep + 1);\n\tconst columnSep = contentSegment.indexOf(\":\");\n\tif (columnSep !== -1 && /^\\d+$/.test(contentSegment.slice(0, columnSep))) {\n\t\tcontentSegment = contentSegment.slice(columnSep + 1);\n\t}\n\n\tconst content = contentSegment.trim();\n\tif (!content) {\n\t\treturn null;\n\t}\n\n\treturn { path: filePath, lineNumber, content };\n}\n\nexport function parseAndFilterGrepOutput(rawOutput: string, state: GrepState): GrepMatch[] {\n\tconst matches: GrepMatch[] = [];\n\tif (typeof rawOutput !== \"string\" || !rawOutput.trim()) {\n\t\treturn matches;\n\t}\n\n\tfor (const line of rawOutput.split(/\\r?\\n/)) {\n\t\tconst fields = extractMatchFields(line);\n\t\tif (!fields) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (state.isNew(fields.path, fields.lineNumber)) {\n\t\t\tmatches.push(fields);\n\t\t\tstate.add(fields.path, fields.lineNumber);\n\t\t}\n\t}\n\n\treturn matches;\n}\n\nfunction truncateOutput(payload: string, maxChars: number): string {\n\tif (payload.length <= maxChars) {\n\t\treturn payload;\n\t}\n\n\tconst note = \"... (output truncated)\";\n\tconst available = maxChars - note.length - 1;\n\tif (available <= 0) {\n\t\treturn note;\n\t}\n\n\tif (payload.length <= available) {\n\t\treturn `${payload.slice(0, available).replace(/\\n$/, \"\")}\\n${note}`;\n\t}\n\n\tconst core = payload.slice(0, Math.max(0, available - 1));\n\tconst trimmed = core.replace(/\\n$/, \"\").replace(/\\s+$/, \"\");\n\tconst snippet = trimmed ? `${trimmed}…` : \"…\";\n\treturn `${snippet}\\n${note}`;\n}\n\nexport function formatTurnGrepOutput(\n\tmatches: GrepMatch[],\n\tmaxChars: number = MAX_GREP_OUTPUT_CHARS_PER_TURN\n): string {\n\tif (!matches || matches.length === 0) {\n\t\treturn \"No new matches found.\";\n\t}\n\n\tconst matchesByFile = new Map<string, GrepMatch[]>();\n\tfor (const match of matches) {\n\t\tif (!matchesByFile.has(match.path)) {\n\t\t\tmatchesByFile.set(match.path, []);\n\t\t}\n\t\tmatchesByFile.get(match.path)!.push(match);\n\t}\n\n\tconst lines: string[] = [];\n\tconst sortedPaths = Array.from(matchesByFile.keys()).sort();\n\tsortedPaths.forEach((filePath, index) => {\n\t\tif (index > 0) {\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tlines.push(filePath);\n\t\tconst sortedMatches = matchesByFile\n\t\t\t.get(filePath)!\n\t\t\t.slice()\n\t\t\t.sort((a, b) => a.lineNumber - b.lineNumber);\n\t\tfor (const match of sortedMatches) {\n\t\t\tlines.push(`${match.lineNumber}:${match.content}`);\n\t\t}\n\t});\n\n\treturn truncateOutput(lines.join(\"\\n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AAEO,SAAS,qBACf,SACA,WAAmB,gCACV;AACT,MAAI,CAAC,WAAW,QAAQ,WAAW,GAAG;AACrC,WAAO;AAAA,EACR;AAEA,QAAM,gBAAgB,oBAAI,IAAyB;AACnD,aAAW,SAAS,SAAS;AAC5B,QAAI,CAAC,cAAc,IAAI,MAAM,IAAI,GAAG;AACnC,oBAAc,IAAI,MAAM,MAAM,CAAC,CAAC;AAAA,IACjC;AACA,kBAAc,IAAI,MAAM,IAAI,EAAG,KAAK,KAAK;AAAA,EAC1C;AAEA,QAAM,QAAkB,CAAC;AACzB,QAAM,cAAc,MAAM,KAAK,cAAc,KAAK,CAAC,EAAE,KAAK;AAC1D,cAAY,QAAQ,CAAC,UAAU,UAAU;AACxC,QAAI,QAAQ,GAAG;AACd,YAAM,KAAK,EAAE;AAAA,IACd;AACA,UAAM,KAAK,QAAQ;AACnB,UAAM,gBAAgB,cACpB,IAAI,QAAQ,EACZ,MAAM,EACN,KAAK,CAAC,GAAG,MAAM,EAAE,aAAa,EAAE,UAAU;AAC5C,eAAW,SAAS,eAAe;AAClC,YAAM,KAAK,GAAG,MAAM,UAAU,IAAI,MAAM,OAAO,EAAE;AAAA,IAClD;AAAA,EACD,CAAC;AAED,SAAO,eAAe,MAAM,KAAK,IAAI,GAAG,QAAQ;AACjD;","names":[]}
@@ -1,73 +0,0 @@
1
- import {
2
- DEFAULT_EXCLUDES
3
- } from "./chunk-TJIUA27P.js";
4
-
5
- // tools/warp_grep/providers/command.ts
6
- var CommandExecProvider = class {
7
- constructor(opts) {
8
- this.opts = opts;
9
- }
10
- map(path) {
11
- return this.opts.pathMap ? this.opts.pathMap(path) : path;
12
- }
13
- async grep(params) {
14
- const remotePath = this.map(params.path);
15
- const args = [
16
- "--no-config",
17
- "--no-heading",
18
- "--with-filename",
19
- "--line-number",
20
- "--color=never",
21
- "--trim",
22
- "--max-columns=400",
23
- ...(this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ["-g", `!${e}`]),
24
- params.pattern,
25
- remotePath || "."
26
- ];
27
- const res = await this.opts.run("rg", args, { cwd: this.opts.cwd, env: this.opts.env });
28
- if (res.exitCode === -1) throw new Error(res.stderr || "ripgrep execution failed");
29
- if (res.exitCode !== 0 && res.exitCode !== 1) throw new Error(res.stderr || `ripgrep failed (${res.exitCode})`);
30
- const lines = (res.stdout || "").trim().split(/\r?\n/).filter((l) => l.length > 0);
31
- return { lines };
32
- }
33
- async glob(params) {
34
- const remotePath = this.map(params.path);
35
- const args = [
36
- "--no-config",
37
- "--files",
38
- "-g",
39
- params.pattern,
40
- ...(this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ["-g", `!${e}`]),
41
- remotePath || "."
42
- ];
43
- const res = await this.opts.run("rg", args, { cwd: this.opts.cwd, env: this.opts.env });
44
- if (res.exitCode === -1) throw new Error(res.stderr || "ripgrep execution failed");
45
- const files = (res.stdout || "").trim().split(/\r?\n/).filter((l) => l.length > 0);
46
- return { files };
47
- }
48
- async read(params) {
49
- const remotePath = this.map(params.path);
50
- const rc = this.opts.readCommand ? this.opts.readCommand(remotePath, params.start, params.end) : { cmd: "sed", args: ["-n", `${params.start ?? 1},${params.end ?? 1e6}p`, remotePath] };
51
- const res = await this.opts.run(rc.cmd, rc.args, { cwd: this.opts.cwd, env: this.opts.env });
52
- if (res.exitCode !== 0) throw new Error(res.stderr || `read failed (${res.exitCode})`);
53
- const text = res.stdout || "";
54
- const lines = text.split(/\r?\n/).map((line, idx) => `${(params.start ?? 1) + idx}|${line}`);
55
- return { lines: lines.filter((l) => l !== `${(params.start ?? 1) + (lines.length - 1)}|`) };
56
- }
57
- async analyse(params) {
58
- const target = this.map(params.path);
59
- const pattern = params.pattern ?? "*";
60
- const files = await this.glob({ pattern, path: target }).catch(() => ({ files: [] }));
61
- return files.files.slice(0, params.maxResults ?? 100).map((f) => ({
62
- name: f.split("/").pop() || f,
63
- path: f,
64
- type: f.endsWith("/") ? "dir" : "file",
65
- depth: 0
66
- }));
67
- }
68
- };
69
-
70
- export {
71
- CommandExecProvider
72
- };
73
- //# sourceMappingURL=chunk-P2XKFWFD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../tools/warp_grep/providers/command.ts"],"sourcesContent":["import type { WarpGrepProvider, GrepResult, ReadResult, AnalyseEntry } from './types.js';\nimport { DEFAULT_EXCLUDES } from '../agent/config.js';\n\ntype ExecResult = { stdout: string; stderr: string; exitCode: number };\n\nexport class CommandExecProvider implements WarpGrepProvider {\n constructor(\n private readonly opts: {\n run: (cmd: string, args: string[], options?: { cwd?: string; env?: Record<string, string> }) => Promise<ExecResult>;\n pathMap?: (localPath: string) => string;\n cwd?: string;\n env?: Record<string, string>;\n readCommand?: (remotePath: string, start?: number, end?: number) => { cmd: string; args: string[] };\n excludes?: string[];\n }\n ) {}\n\n private map(path: string): string {\n return this.opts.pathMap ? this.opts.pathMap(path) : path;\n }\n\n async grep(params: { pattern: string; path: string }): Promise<GrepResult> {\n const remotePath = this.map(params.path);\n const args = [\n '--no-config',\n '--no-heading',\n '--with-filename',\n '--line-number',\n '--color=never',\n '--trim',\n '--max-columns=400',\n ...((this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ['-g', `!${e}`])),\n params.pattern,\n remotePath || '.',\n ];\n const res = await this.opts.run('rg', args, { cwd: this.opts.cwd, env: this.opts.env });\n if (res.exitCode === -1) throw new Error(res.stderr || 'ripgrep execution failed');\n if (res.exitCode !== 0 && res.exitCode !== 1) throw new Error(res.stderr || `ripgrep failed (${res.exitCode})`);\n const lines = (res.stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((l) => l.length > 0);\n return { lines };\n }\n\n async glob(params: { pattern: string; path: string }): Promise<{ files: string[] }> {\n const remotePath = this.map(params.path);\n const args = [\n '--no-config',\n '--files',\n '-g',\n params.pattern,\n ...((this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ['-g', `!${e}`])),\n remotePath || '.',\n ];\n const res = await this.opts.run('rg', args, { cwd: this.opts.cwd, env: this.opts.env });\n if (res.exitCode === -1) throw new Error(res.stderr || 'ripgrep execution failed');\n const files = (res.stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((l) => l.length > 0);\n return { files };\n }\n\n async read(params: { path: string; start?: number; end?: number }): Promise<ReadResult> {\n const remotePath = this.map(params.path);\n const rc = this.opts.readCommand\n ? this.opts.readCommand(remotePath, params.start, params.end)\n : { cmd: 'sed', args: ['-n', `${params.start ?? 1},${params.end ?? 1_000_000}p`, remotePath] };\n const res = await this.opts.run(rc.cmd, rc.args, { cwd: this.opts.cwd, env: this.opts.env });\n if (res.exitCode !== 0) throw new Error(res.stderr || `read failed (${res.exitCode})`);\n const text = res.stdout || '';\n const lines = text.split(/\\r?\\n/).map((line, idx) => `${(params.start ?? 1) + idx}|${line}`);\n return { lines: lines.filter(l => l !== `${(params.start ?? 1) + (lines.length - 1)}|`) };\n }\n\n async analyse(params: { path: string; pattern?: string | null; maxResults?: number; maxDepth?: number }): Promise<AnalyseEntry[]> {\n // Minimal remote analyse: glob all files and trim\n const target = this.map(params.path);\n const pattern = params.pattern ?? '*';\n const files = await this.glob({ pattern, path: target }).catch(() => ({ files: [] }));\n return files.files.slice(0, params.maxResults ?? 100).map((f) => ({\n name: f.split('/').pop() || f,\n path: f,\n type: f.endsWith('/') ? 'dir' : 'file',\n depth: 0,\n }));\n }\n}\n\n\n"],"mappings":";;;;;AAKO,IAAM,sBAAN,MAAsD;AAAA,EAC3D,YACmB,MAQjB;AARiB;AAAA,EAQhB;AAAA,EAEK,IAAI,MAAsB;AAChC,WAAO,KAAK,KAAK,UAAU,KAAK,KAAK,QAAQ,IAAI,IAAI;AAAA,EACvD;AAAA,EAEA,MAAM,KAAK,QAAgE;AACzE,UAAM,aAAa,KAAK,IAAI,OAAO,IAAI;AACvC,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAK,KAAK,KAAK,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getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // tools/warp_grep/agent/grep_helpers.ts
21
- var grep_helpers_exports = {};
22
- __export(grep_helpers_exports, {
23
- GrepState: () => GrepState,
24
- MAX_GREP_OUTPUT_CHARS_PER_TURN: () => MAX_GREP_OUTPUT_CHARS_PER_TURN,
25
- formatTurnGrepOutput: () => formatTurnGrepOutput,
26
- parseAndFilterGrepOutput: () => parseAndFilterGrepOutput
27
- });
28
- module.exports = __toCommonJS(grep_helpers_exports);
29
- var GrepState = class {
30
- seenLines = /* @__PURE__ */ new Set();
31
- isNew(path, lineNumber) {
32
- const key = this.makeKey(path, lineNumber);
33
- return !this.seenLines.has(key);
34
- }
35
- add(path, lineNumber) {
36
- this.seenLines.add(this.makeKey(path, lineNumber));
37
- }
38
- makeKey(path, lineNumber) {
39
- return `${path}:${lineNumber}`;
40
- }
41
- };
42
- var MAX_GREP_OUTPUT_CHARS_PER_TURN = 6e4;
43
- function extractMatchFields(payload) {
44
- const text = payload.replace(/\r?\n$/, "");
45
- if (!text || text.startsWith("[error]")) {
46
- return null;
47
- }
48
- const firstSep = text.indexOf(":");
49
- if (firstSep === -1) {
50
- return null;
51
- }
52
- let filePath = text.slice(0, firstSep).trim();
53
- if (!filePath) {
54
- return null;
55
- }
56
- if (filePath.startsWith("./") || filePath.startsWith(".\\")) {
57
- filePath = filePath.slice(2);
58
- }
59
- const remainder = text.slice(firstSep + 1);
60
- const secondSep = remainder.indexOf(":");
61
- if (secondSep === -1) {
62
- return null;
63
- }
64
- const linePart = remainder.slice(0, secondSep);
65
- const lineNumber = Number.parseInt(linePart, 10);
66
- if (!Number.isInteger(lineNumber) || lineNumber <= 0) {
67
- return null;
68
- }
69
- let contentSegment = remainder.slice(secondSep + 1);
70
- const columnSep = contentSegment.indexOf(":");
71
- if (columnSep !== -1 && /^\d+$/.test(contentSegment.slice(0, columnSep))) {
72
- contentSegment = contentSegment.slice(columnSep + 1);
73
- }
74
- const content = contentSegment.trim();
75
- if (!content) {
76
- return null;
77
- }
78
- return { path: filePath, lineNumber, content };
79
- }
80
- function parseAndFilterGrepOutput(rawOutput, state) {
81
- const matches = [];
82
- if (typeof rawOutput !== "string" || !rawOutput.trim()) {
83
- return matches;
84
- }
85
- for (const line of rawOutput.split(/\r?\n/)) {
86
- const fields = extractMatchFields(line);
87
- if (!fields) {
88
- continue;
89
- }
90
- if (state.isNew(fields.path, fields.lineNumber)) {
91
- matches.push(fields);
92
- state.add(fields.path, fields.lineNumber);
93
- }
94
- }
95
- return matches;
96
- }
97
- function truncateOutput(payload, maxChars) {
98
- if (payload.length <= maxChars) {
99
- return payload;
100
- }
101
- const note = "... (output truncated)";
102
- const available = maxChars - note.length - 1;
103
- if (available <= 0) {
104
- return note;
105
- }
106
- if (payload.length <= available) {
107
- return `${payload.slice(0, available).replace(/\n$/, "")}
108
- ${note}`;
109
- }
110
- const core = payload.slice(0, Math.max(0, available - 1));
111
- const trimmed = core.replace(/\n$/, "").replace(/\s+$/, "");
112
- const snippet = trimmed ? `${trimmed}\u2026` : "\u2026";
113
- return `${snippet}
114
- ${note}`;
115
- }
116
- function formatTurnGrepOutput(matches, maxChars = MAX_GREP_OUTPUT_CHARS_PER_TURN) {
117
- if (!matches || matches.length === 0) {
118
- return "No new matches found.";
119
- }
120
- const matchesByFile = /* @__PURE__ */ new Map();
121
- for (const match of matches) {
122
- if (!matchesByFile.has(match.path)) {
123
- matchesByFile.set(match.path, []);
124
- }
125
- matchesByFile.get(match.path).push(match);
126
- }
127
- const lines = [];
128
- const sortedPaths = Array.from(matchesByFile.keys()).sort();
129
- sortedPaths.forEach((filePath, index) => {
130
- if (index > 0) {
131
- lines.push("");
132
- }
133
- lines.push(filePath);
134
- const sortedMatches = matchesByFile.get(filePath).slice().sort((a, b) => a.lineNumber - b.lineNumber);
135
- for (const match of sortedMatches) {
136
- lines.push(`${match.lineNumber}:${match.content}`);
137
- }
138
- });
139
- return truncateOutput(lines.join("\n"), maxChars);
140
- }
141
- // Annotate the CommonJS export names for ESM import in node:
142
- 0 && (module.exports = {
143
- GrepState,
144
- MAX_GREP_OUTPUT_CHARS_PER_TURN,
145
- formatTurnGrepOutput,
146
- parseAndFilterGrepOutput
147
- });
148
- //# sourceMappingURL=grep_helpers.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/agent/grep_helpers.ts"],"sourcesContent":["export interface GrepMatch {\n\tpath: string;\n\tlineNumber: number;\n\tcontent: string;\n}\n\nexport class GrepState {\n\tprivate readonly seenLines = new Set<string>();\n\n\tisNew(path: string, lineNumber: number): boolean {\n\t\tconst key = this.makeKey(path, lineNumber);\n\t\treturn !this.seenLines.has(key);\n\t}\n\n\tadd(path: string, lineNumber: number): void {\n\t\tthis.seenLines.add(this.makeKey(path, lineNumber));\n\t}\n\n\tprivate makeKey(path: string, lineNumber: number): string {\n\t\treturn `${path}:${lineNumber}`;\n\t}\n}\n\nexport const MAX_GREP_OUTPUT_CHARS_PER_TURN = 60_000;\n\nfunction extractMatchFields(payload: string): GrepMatch | null {\n\tconst text = payload.replace(/\\r?\\n$/, \"\");\n\tif (!text || text.startsWith(\"[error]\")) {\n\t\treturn null;\n\t}\n\n\tconst firstSep = text.indexOf(\":\");\n\tif (firstSep === -1) {\n\t\treturn null;\n\t}\n\tlet filePath = text.slice(0, firstSep).trim();\n\tif (!filePath) {\n\t\treturn null;\n\t}\n\tif (filePath.startsWith(\"./\") || filePath.startsWith(\".\\\\\")) {\n\t\tfilePath = filePath.slice(2);\n\t}\n\n\tconst remainder = text.slice(firstSep + 1);\n\tconst secondSep = remainder.indexOf(\":\");\n\tif (secondSep === -1) {\n\t\treturn null;\n\t}\n\n\tconst linePart = remainder.slice(0, secondSep);\n\tconst lineNumber = Number.parseInt(linePart, 10);\n\tif (!Number.isInteger(lineNumber) || lineNumber <= 0) {\n\t\treturn null;\n\t}\n\n\tlet contentSegment = remainder.slice(secondSep + 1);\n\tconst columnSep = contentSegment.indexOf(\":\");\n\tif (columnSep !== -1 && /^\\d+$/.test(contentSegment.slice(0, columnSep))) {\n\t\tcontentSegment = contentSegment.slice(columnSep + 1);\n\t}\n\n\tconst content = contentSegment.trim();\n\tif (!content) {\n\t\treturn null;\n\t}\n\n\treturn { path: filePath, lineNumber, content };\n}\n\nexport function parseAndFilterGrepOutput(rawOutput: string, state: GrepState): GrepMatch[] {\n\tconst matches: GrepMatch[] = [];\n\tif (typeof rawOutput !== \"string\" || !rawOutput.trim()) {\n\t\treturn matches;\n\t}\n\n\tfor (const line of rawOutput.split(/\\r?\\n/)) {\n\t\tconst fields = extractMatchFields(line);\n\t\tif (!fields) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (state.isNew(fields.path, fields.lineNumber)) {\n\t\t\tmatches.push(fields);\n\t\t\tstate.add(fields.path, fields.lineNumber);\n\t\t}\n\t}\n\n\treturn matches;\n}\n\nfunction truncateOutput(payload: string, maxChars: number): string {\n\tif (payload.length <= maxChars) {\n\t\treturn payload;\n\t}\n\n\tconst note = \"... (output truncated)\";\n\tconst available = maxChars - note.length - 1;\n\tif (available <= 0) {\n\t\treturn note;\n\t}\n\n\tif (payload.length <= available) {\n\t\treturn `${payload.slice(0, available).replace(/\\n$/, \"\")}\\n${note}`;\n\t}\n\n\tconst core = payload.slice(0, Math.max(0, available - 1));\n\tconst trimmed = core.replace(/\\n$/, \"\").replace(/\\s+$/, \"\");\n\tconst snippet = trimmed ? `${trimmed}…` : \"…\";\n\treturn `${snippet}\\n${note}`;\n}\n\nexport function formatTurnGrepOutput(\n\tmatches: GrepMatch[],\n\tmaxChars: number = MAX_GREP_OUTPUT_CHARS_PER_TURN\n): string {\n\tif (!matches || matches.length === 0) {\n\t\treturn \"No new matches found.\";\n\t}\n\n\tconst matchesByFile = new Map<string, GrepMatch[]>();\n\tfor (const match of matches) {\n\t\tif (!matchesByFile.has(match.path)) {\n\t\t\tmatchesByFile.set(match.path, []);\n\t\t}\n\t\tmatchesByFile.get(match.path)!.push(match);\n\t}\n\n\tconst lines: string[] = [];\n\tconst sortedPaths = Array.from(matchesByFile.keys()).sort();\n\tsortedPaths.forEach((filePath, index) => {\n\t\tif (index > 0) {\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tlines.push(filePath);\n\t\tconst sortedMatches = matchesByFile\n\t\t\t.get(filePath)!\n\t\t\t.slice()\n\t\t\t.sort((a, b) => a.lineNumber - b.lineNumber);\n\t\tfor (const match of sortedMatches) {\n\t\t\tlines.push(`${match.lineNumber}:${match.content}`);\n\t\t}\n\t});\n\n\treturn truncateOutput(lines.join(\"\\n\"), maxChars);\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,YAAN,MAAgB;AAAA,EACL,YAAY,oBAAI,IAAY;AAAA,EAE7C,MAAM,MAAc,YAA6B;AAChD,UAAM,MAAM,KAAK,QAAQ,MAAM,UAAU;AACzC,WAAO,CAAC,KAAK,UAAU,IAAI,GAAG;AAAA,EAC/B;AAAA,EAEA,IAAI,MAAc,YAA0B;AAC3C,SAAK,UAAU,IAAI,KAAK,QAAQ,MAAM,UAAU,CAAC;AAAA,EAClD;AAAA,EAEQ,QAAQ,MAAc,YAA4B;AACzD,WAAO,GAAG,IAAI,IAAI,UAAU;AAAA,EAC7B;AACD;AAEO,IAAM,iCAAiC;AAE9C,SAAS,mBAAmB,SAAmC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xC,QAAI,QAAQ,GAAG;AACd,YAAM,KAAK,EAAE;AAAA,IACd;AACA,UAAM,KAAK,QAAQ;AACnB,UAAM,gBAAgB,cACpB,IAAI,QAAQ,EACZ,MAAM,EACN,KAAK,CAAC,GAAG,MAAM,EAAE,aAAa,EAAE,UAAU;AAC5C,eAAW,SAAS,eAAe;AAClC,YAAM,KAAK,GAAG,MAAM,UAAU,IAAI,MAAM,OAAO,EAAE;AAAA,IAClD;AAAA,EACD,CAAC;AAED,SAAO,eAAe,MAAM,KAAK,IAAI,GAAG,QAAQ;AACjD;","names":[]}
@@ -1,16 +0,0 @@
1
- interface GrepMatch {
2
- path: string;
3
- lineNumber: number;
4
- content: string;
5
- }
6
- declare class GrepState {
7
- private readonly seenLines;
8
- isNew(path: string, lineNumber: number): boolean;
9
- add(path: string, lineNumber: number): void;
10
- private makeKey;
11
- }
12
- declare const MAX_GREP_OUTPUT_CHARS_PER_TURN = 60000;
13
- declare function parseAndFilterGrepOutput(rawOutput: string, state: GrepState): GrepMatch[];
14
- declare function formatTurnGrepOutput(matches: GrepMatch[], maxChars?: number): string;
15
-
16
- export { type GrepMatch, GrepState, MAX_GREP_OUTPUT_CHARS_PER_TURN, formatTurnGrepOutput, parseAndFilterGrepOutput };
@@ -1,14 +0,0 @@
1
- import {
2
- GrepState,
3
- MAX_GREP_OUTPUT_CHARS_PER_TURN,
4
- formatTurnGrepOutput,
5
- parseAndFilterGrepOutput
6
- } from "../../../chunk-NDZO5IPV.js";
7
- import "../../../chunk-PZ5AY32C.js";
8
- export {
9
- GrepState,
10
- MAX_GREP_OUTPUT_CHARS_PER_TURN,
11
- formatTurnGrepOutput,
12
- parseAndFilterGrepOutput
13
- };
14
- //# sourceMappingURL=grep_helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,177 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // tools/warp_grep/providers/command.ts
21
- var command_exports = {};
22
- __export(command_exports, {
23
- CommandExecProvider: () => CommandExecProvider
24
- });
25
- module.exports = __toCommonJS(command_exports);
26
-
27
- // tools/warp_grep/agent/config.ts
28
- var BUILTIN_EXCLUDES = [
29
- // Version control
30
- ".git",
31
- ".svn",
32
- ".hg",
33
- ".bzr",
34
- // Dependencies
35
- "node_modules",
36
- "bower_components",
37
- ".pnpm",
38
- ".yarn",
39
- "vendor",
40
- "packages",
41
- "Pods",
42
- ".bundle",
43
- // Python
44
- "__pycache__",
45
- ".pytest_cache",
46
- ".mypy_cache",
47
- ".ruff_cache",
48
- ".venv",
49
- "venv",
50
- ".tox",
51
- ".nox",
52
- ".eggs",
53
- "*.egg-info",
54
- // Build outputs
55
- "dist",
56
- "build",
57
- "out",
58
- "output",
59
- "target",
60
- "_build",
61
- ".next",
62
- ".nuxt",
63
- ".output",
64
- ".vercel",
65
- ".netlify",
66
- // Cache directories
67
- ".cache",
68
- ".parcel-cache",
69
- ".turbo",
70
- ".nx",
71
- ".gradle",
72
- // IDE/Editor
73
- ".idea",
74
- ".vscode",
75
- ".vs",
76
- // Coverage
77
- "coverage",
78
- ".coverage",
79
- "htmlcov",
80
- ".nyc_output",
81
- // Temporary
82
- "tmp",
83
- "temp",
84
- ".tmp",
85
- ".temp",
86
- // Lock files
87
- "package-lock.json",
88
- "yarn.lock",
89
- "pnpm-lock.yaml",
90
- "bun.lockb",
91
- "Cargo.lock",
92
- "Gemfile.lock",
93
- "poetry.lock",
94
- // Binary/minified
95
- "*.min.js",
96
- "*.min.css",
97
- "*.bundle.js",
98
- "*.wasm",
99
- "*.so",
100
- "*.dll",
101
- "*.pyc",
102
- "*.map",
103
- "*.js.map",
104
- // Hidden directories catch-all
105
- ".*"
106
- ];
107
- var DEFAULT_EXCLUDES = (process.env.MORPH_WARP_GREP_EXCLUDE || "").split(",").map((s) => s.trim()).filter(Boolean).concat(BUILTIN_EXCLUDES);
108
-
109
- // tools/warp_grep/providers/command.ts
110
- var CommandExecProvider = class {
111
- constructor(opts) {
112
- this.opts = opts;
113
- }
114
- map(path) {
115
- return this.opts.pathMap ? this.opts.pathMap(path) : path;
116
- }
117
- async grep(params) {
118
- const remotePath = this.map(params.path);
119
- const args = [
120
- "--no-config",
121
- "--no-heading",
122
- "--with-filename",
123
- "--line-number",
124
- "--color=never",
125
- "--trim",
126
- "--max-columns=400",
127
- ...(this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ["-g", `!${e}`]),
128
- params.pattern,
129
- remotePath || "."
130
- ];
131
- const res = await this.opts.run("rg", args, { cwd: this.opts.cwd, env: this.opts.env });
132
- if (res.exitCode === -1) throw new Error(res.stderr || "ripgrep execution failed");
133
- if (res.exitCode !== 0 && res.exitCode !== 1) throw new Error(res.stderr || `ripgrep failed (${res.exitCode})`);
134
- const lines = (res.stdout || "").trim().split(/\r?\n/).filter((l) => l.length > 0);
135
- return { lines };
136
- }
137
- async glob(params) {
138
- const remotePath = this.map(params.path);
139
- const args = [
140
- "--no-config",
141
- "--files",
142
- "-g",
143
- params.pattern,
144
- ...(this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ["-g", `!${e}`]),
145
- remotePath || "."
146
- ];
147
- const res = await this.opts.run("rg", args, { cwd: this.opts.cwd, env: this.opts.env });
148
- if (res.exitCode === -1) throw new Error(res.stderr || "ripgrep execution failed");
149
- const files = (res.stdout || "").trim().split(/\r?\n/).filter((l) => l.length > 0);
150
- return { files };
151
- }
152
- async read(params) {
153
- const remotePath = this.map(params.path);
154
- const rc = this.opts.readCommand ? this.opts.readCommand(remotePath, params.start, params.end) : { cmd: "sed", args: ["-n", `${params.start ?? 1},${params.end ?? 1e6}p`, remotePath] };
155
- const res = await this.opts.run(rc.cmd, rc.args, { cwd: this.opts.cwd, env: this.opts.env });
156
- if (res.exitCode !== 0) throw new Error(res.stderr || `read failed (${res.exitCode})`);
157
- const text = res.stdout || "";
158
- const lines = text.split(/\r?\n/).map((line, idx) => `${(params.start ?? 1) + idx}|${line}`);
159
- return { lines: lines.filter((l) => l !== `${(params.start ?? 1) + (lines.length - 1)}|`) };
160
- }
161
- async analyse(params) {
162
- const target = this.map(params.path);
163
- const pattern = params.pattern ?? "*";
164
- const files = await this.glob({ pattern, path: target }).catch(() => ({ files: [] }));
165
- return files.files.slice(0, params.maxResults ?? 100).map((f) => ({
166
- name: f.split("/").pop() || f,
167
- path: f,
168
- type: f.endsWith("/") ? "dir" : "file",
169
- depth: 0
170
- }));
171
- }
172
- };
173
- // Annotate the CommonJS export names for ESM import in node:
174
- 0 && (module.exports = {
175
- CommandExecProvider
176
- });
177
- //# sourceMappingURL=command.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../tools/warp_grep/providers/command.ts","../../../../tools/warp_grep/agent/config.ts"],"sourcesContent":["import type { WarpGrepProvider, GrepResult, ReadResult, AnalyseEntry } from './types.js';\nimport { DEFAULT_EXCLUDES } from '../agent/config.js';\n\ntype ExecResult = { stdout: string; stderr: string; exitCode: number };\n\nexport class CommandExecProvider implements WarpGrepProvider {\n constructor(\n private readonly opts: {\n run: (cmd: string, args: string[], options?: { cwd?: string; env?: Record<string, string> }) => Promise<ExecResult>;\n pathMap?: (localPath: string) => string;\n cwd?: string;\n env?: Record<string, string>;\n readCommand?: (remotePath: string, start?: number, end?: number) => { cmd: string; args: string[] };\n excludes?: string[];\n }\n ) {}\n\n private map(path: string): string {\n return this.opts.pathMap ? this.opts.pathMap(path) : path;\n }\n\n async grep(params: { pattern: string; path: string }): Promise<GrepResult> {\n const remotePath = this.map(params.path);\n const args = [\n '--no-config',\n '--no-heading',\n '--with-filename',\n '--line-number',\n '--color=never',\n '--trim',\n '--max-columns=400',\n ...((this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ['-g', `!${e}`])),\n params.pattern,\n remotePath || '.',\n ];\n const res = await this.opts.run('rg', args, { cwd: this.opts.cwd, env: this.opts.env });\n if (res.exitCode === -1) throw new Error(res.stderr || 'ripgrep execution failed');\n if (res.exitCode !== 0 && res.exitCode !== 1) throw new Error(res.stderr || `ripgrep failed (${res.exitCode})`);\n const lines = (res.stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((l) => l.length > 0);\n return { lines };\n }\n\n async glob(params: { pattern: string; path: string }): Promise<{ files: string[] }> {\n const remotePath = this.map(params.path);\n const args = [\n '--no-config',\n '--files',\n '-g',\n params.pattern,\n ...((this.opts.excludes ?? DEFAULT_EXCLUDES).flatMap((e) => ['-g', `!${e}`])),\n remotePath || '.',\n ];\n const res = await this.opts.run('rg', args, { cwd: this.opts.cwd, env: this.opts.env });\n if (res.exitCode === -1) throw new Error(res.stderr || 'ripgrep execution failed');\n const files = (res.stdout || '')\n .trim()\n .split(/\\r?\\n/)\n .filter((l) => l.length > 0);\n return { files };\n }\n\n async read(params: { path: string; start?: number; end?: number }): Promise<ReadResult> {\n const remotePath = this.map(params.path);\n const rc = this.opts.readCommand\n ? this.opts.readCommand(remotePath, params.start, params.end)\n : { cmd: 'sed', args: ['-n', `${params.start ?? 1},${params.end ?? 1_000_000}p`, remotePath] };\n const res = await this.opts.run(rc.cmd, rc.args, { cwd: this.opts.cwd, env: this.opts.env });\n if (res.exitCode !== 0) throw new Error(res.stderr || `read failed (${res.exitCode})`);\n const text = res.stdout || '';\n const lines = text.split(/\\r?\\n/).map((line, idx) => `${(params.start ?? 1) + idx}|${line}`);\n return { lines: lines.filter(l => l !== `${(params.start ?? 1) + (lines.length - 1)}|`) };\n }\n\n async analyse(params: { path: string; pattern?: string | null; maxResults?: number; maxDepth?: number }): Promise<AnalyseEntry[]> {\n // Minimal remote analyse: glob all files and trim\n const target = this.map(params.path);\n const pattern = params.pattern ?? '*';\n const files = await this.glob({ pattern, path: target }).catch(() => ({ files: [] }));\n return files.files.slice(0, params.maxResults ?? 100).map((f) => ({\n name: f.split('/').pop() || f,\n path: f,\n type: f.endsWith('/') ? 'dir' : 'file',\n depth: 0,\n }));\n }\n}\n\n\n","// Agent configuration defaults for morph-warp-grep\n// Hard-coded: SDK does not expose control over rounds or timeout.\nexport const AGENT_CONFIG = {\n // Give the model freedom; failsafe cap to prevent infinite loops\n MAX_ROUNDS: 10,\n TIMEOUT_MS: 30000,\n};\n\n/**\n * Comprehensive exclusion list for directories and files\n * These patterns are used with ripgrep's -g flag\n */\nconst BUILTIN_EXCLUDES = [\n // Version control\n '.git', '.svn', '.hg', '.bzr',\n \n // Dependencies\n 'node_modules', 'bower_components', '.pnpm', '.yarn',\n 'vendor', 'packages', 'Pods', '.bundle',\n \n // Python\n '__pycache__', '.pytest_cache', '.mypy_cache', '.ruff_cache',\n '.venv', 'venv', '.tox', '.nox', '.eggs', '*.egg-info',\n \n // Build outputs\n 'dist', 'build', 'out', 'output', 'target', '_build',\n '.next', '.nuxt', '.output', '.vercel', '.netlify',\n \n // Cache directories\n '.cache', '.parcel-cache', '.turbo', '.nx', '.gradle',\n \n // IDE/Editor\n '.idea', '.vscode', '.vs',\n \n // Coverage\n 'coverage', '.coverage', 'htmlcov', '.nyc_output',\n \n // Temporary\n 'tmp', 'temp', '.tmp', '.temp',\n \n // Lock files\n 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb',\n 'Cargo.lock', 'Gemfile.lock', 'poetry.lock',\n \n // Binary/minified\n '*.min.js', '*.min.css', '*.bundle.js',\n '*.wasm', '*.so', '*.dll', '*.pyc',\n '*.map', '*.js.map',\n \n // Hidden directories catch-all\n '.*',\n];\n\nexport const DEFAULT_EXCLUDES = (process.env.MORPH_WARP_GREP_EXCLUDE || '')\n .split(',')\n .map(s => s.trim())\n .filter(Boolean)\n .concat(BUILTIN_EXCLUDES);\n\nexport const DEFAULT_MODEL = 'morph-warp-grep';\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYA,IAAM,mBAAmB;AAAA;AAAA,EAEvB;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAO;AAAA;AAAA,EAGvB;AAAA,EAAgB;AAAA,EAAoB;AAAA,EAAS;AAAA,EAC7C;AAAA,EAAU;AAAA,EAAY;AAAA,EAAQ;AAAA;AAAA,EAG9B;AAAA,EAAe;AAAA,EAAiB;AAAA,EAAe;AAAA,EAC/C;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA;AAAA,EAG1C;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAO;AAAA,EAAU;AAAA,EAAU;AAAA,EAC5C;AAAA,EAAS;AAAA,EAAS;AAAA,EAAW;AAAA,EAAW;AAAA;AAAA,EAGxC;AAAA,EAAU;AAAA,EAAiB;AAAA,EAAU;AAAA,EAAO;AAAA;AAAA,EAG5C;AAAA,EAAS;AAAA,EAAW;AAAA;AAAA,EAGpB;AAAA,EAAY;AAAA,EAAa;AAAA,EAAW;AAAA;AAAA,EAGpC;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAQ;AAAA;AAAA,EAGvB;AAAA,EAAqB;AAAA,EAAa;AAAA,EAAkB;AAAA,EACpD;AAAA,EAAc;AAAA,EAAgB;AAAA;AAAA,EAG9B;AAAA,EAAY;AAAA,EAAa;AAAA,EACzB;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAS;AAAA,EAC3B;AAAA,EAAS;AAAA;A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