@morphllm/morphsdk 0.2.46 → 0.2.48
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-5JTJOQUX.js → chunk-AJ6X4STK.js} +5 -5
- package/dist/{chunk-UXYK7WZX.js → chunk-KM6V456Q.js} +2 -2
- package/dist/{chunk-7T7YOPJV.js → chunk-NHOPUGBN.js} +3 -3
- package/dist/chunk-TPP2UGQP.js +65 -0
- package/dist/chunk-TPP2UGQP.js.map +1 -0
- package/dist/{chunk-CL45IWIU.js → chunk-WI23KSNI.js} +2 -2
- package/dist/{chunk-D6OD3IST.js → chunk-YQVSMU24.js} +3 -3
- package/dist/{chunk-PABIV7X6.js → chunk-ZGK6OGK3.js} +3 -3
- package/dist/client.cjs +42 -3
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +7 -7
- package/dist/index.cjs +42 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/tools/warp_grep/anthropic.cjs +42 -3
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +4 -4
- package/dist/tools/warp_grep/index.cjs +42 -3
- 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 +42 -3
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +4 -4
- package/dist/tools/warp_grep/providers/local.cjs +42 -3
- package/dist/tools/warp_grep/providers/local.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/utils/ripgrep.cjs +42 -3
- package/dist/tools/warp_grep/utils/ripgrep.cjs.map +1 -1
- package/dist/tools/warp_grep/utils/ripgrep.js +1 -1
- package/dist/tools/warp_grep/vercel.cjs +42 -3
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +4 -4
- package/package.json +2 -1
- package/dist/chunk-RSLIOCOE.js +0 -26
- package/dist/chunk-RSLIOCOE.js.map +0 -1
- /package/dist/{chunk-5JTJOQUX.js.map → chunk-AJ6X4STK.js.map} +0 -0
- /package/dist/{chunk-UXYK7WZX.js.map → chunk-KM6V456Q.js.map} +0 -0
- /package/dist/{chunk-7T7YOPJV.js.map → chunk-NHOPUGBN.js.map} +0 -0
- /package/dist/{chunk-CL45IWIU.js.map → chunk-WI23KSNI.js.map} +0 -0
- /package/dist/{chunk-D6OD3IST.js.map → chunk-YQVSMU24.js.map} +0 -0
- /package/dist/{chunk-PABIV7X6.js.map → chunk-ZGK6OGK3.js.map} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMorphWarpGrepTool as createMorphWarpGrepTool2
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZGK6OGK3.js";
|
|
4
4
|
import {
|
|
5
5
|
createMorphWarpGrepTool
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NHOPUGBN.js";
|
|
7
7
|
import {
|
|
8
8
|
createMorphWarpGrepTool as createMorphWarpGrepTool3
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YQVSMU24.js";
|
|
10
10
|
import {
|
|
11
11
|
WarpGrepClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WI23KSNI.js";
|
|
13
13
|
import {
|
|
14
14
|
createCodebaseSearchTool as createCodebaseSearchTool3
|
|
15
15
|
} from "./chunk-UBX7QYBD.js";
|
|
@@ -280,4 +280,4 @@ export {
|
|
|
280
280
|
VercelToolFactory,
|
|
281
281
|
MorphClient
|
|
282
282
|
};
|
|
283
|
-
//# sourceMappingURL=chunk-
|
|
283
|
+
//# sourceMappingURL=chunk-AJ6X4STK.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-SMGZ6A64.js";
|
|
10
10
|
import {
|
|
11
11
|
runRipgrep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TPP2UGQP.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_EXCLUDES
|
|
15
15
|
} from "./chunk-TJIUA27P.js";
|
|
@@ -132,4 +132,4 @@ var LocalRipgrepProvider = class {
|
|
|
132
132
|
export {
|
|
133
133
|
LocalRipgrepProvider
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=chunk-
|
|
135
|
+
//# sourceMappingURL=chunk-KM6V456Q.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WARP_GREP_DESCRIPTION,
|
|
3
3
|
formatResult
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WI23KSNI.js";
|
|
5
5
|
import {
|
|
6
6
|
runWarpGrep
|
|
7
7
|
} from "./chunk-7HS6YXA3.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-WETRQJGU.js";
|
|
11
11
|
import {
|
|
12
12
|
LocalRipgrepProvider
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KM6V456Q.js";
|
|
14
14
|
|
|
15
15
|
// tools/warp_grep/openai.ts
|
|
16
16
|
var TOOL_PARAMETERS = {
|
|
@@ -79,4 +79,4 @@ export {
|
|
|
79
79
|
createMorphWarpGrepTool,
|
|
80
80
|
openai_default
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-NHOPUGBN.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// tools/warp_grep/utils/ripgrep.ts
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
import { rgPath } from "@vscode/ripgrep";
|
|
4
|
+
var resolvedRgPath = null;
|
|
5
|
+
var rgPathChecked = false;
|
|
6
|
+
function spawnRg(rgBinary, args, opts) {
|
|
7
|
+
return new Promise((resolve) => {
|
|
8
|
+
const child = spawn(rgBinary, args, {
|
|
9
|
+
cwd: opts?.cwd,
|
|
10
|
+
env: { ...process.env, ...opts?.env || {} },
|
|
11
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
12
|
+
});
|
|
13
|
+
let stdout = "";
|
|
14
|
+
let stderr = "";
|
|
15
|
+
child.stdout.on("data", (d) => stdout += d.toString());
|
|
16
|
+
child.stderr.on("data", (d) => stderr += d.toString());
|
|
17
|
+
child.on("close", (code) => {
|
|
18
|
+
resolve({ stdout, stderr, exitCode: typeof code === "number" ? code : -1 });
|
|
19
|
+
});
|
|
20
|
+
child.on("error", () => {
|
|
21
|
+
resolve({ stdout: "", stderr: "Failed to spawn ripgrep.", exitCode: -1 });
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function isBinaryFailure(result) {
|
|
26
|
+
if (result.exitCode === -1) return true;
|
|
27
|
+
if (result.stderr.includes("jemalloc") || result.stderr.includes("Unsupported system page size")) return true;
|
|
28
|
+
if (result.exitCode === 134) return true;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
async function runRipgrep(args, opts) {
|
|
32
|
+
if (rgPathChecked && resolvedRgPath) {
|
|
33
|
+
return spawnRg(resolvedRgPath, args, opts);
|
|
34
|
+
}
|
|
35
|
+
if (!rgPathChecked) {
|
|
36
|
+
const result = await spawnRg(rgPath, args, opts);
|
|
37
|
+
if (!isBinaryFailure(result)) {
|
|
38
|
+
resolvedRgPath = rgPath;
|
|
39
|
+
rgPathChecked = true;
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
const fallbackResult = await spawnRg("rg", args, opts);
|
|
43
|
+
if (!isBinaryFailure(fallbackResult)) {
|
|
44
|
+
resolvedRgPath = "rg";
|
|
45
|
+
rgPathChecked = true;
|
|
46
|
+
return fallbackResult;
|
|
47
|
+
}
|
|
48
|
+
rgPathChecked = true;
|
|
49
|
+
return {
|
|
50
|
+
stdout: "",
|
|
51
|
+
stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
|
|
52
|
+
exitCode: -1
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
stdout: "",
|
|
57
|
+
stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
|
|
58
|
+
exitCode: -1
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
runRipgrep
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=chunk-TPP2UGQP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tools/warp_grep/utils/ripgrep.ts"],"sourcesContent":["import { spawn } from 'child_process';\nimport { rgPath } from '@vscode/ripgrep';\n\nexport type ExecResult = { stdout: string; stderr: string; exitCode: number };\n\n// Cache the working ripgrep path to avoid repeated fallback checks\nlet resolvedRgPath: string | null = null;\nlet rgPathChecked = false;\n\nfunction spawnRg(rgBinary: string, args: string[], opts?: { cwd?: string; env?: NodeJS.ProcessEnv }): Promise<ExecResult> {\n return new Promise((resolve) => {\n const child = spawn(rgBinary, args, {\n cwd: opts?.cwd,\n env: { ...process.env, ...(opts?.env || {}) },\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n let stdout = '';\n let stderr = '';\n child.stdout.on('data', (d) => (stdout += d.toString()));\n child.stderr.on('data', (d) => (stderr += d.toString()));\n child.on('close', (code) => {\n resolve({ stdout, stderr, exitCode: typeof code === 'number' ? code : -1 });\n });\n child.on('error', () => {\n resolve({ stdout: '', stderr: 'Failed to spawn ripgrep.', exitCode: -1 });\n });\n });\n}\n\n// Check if a result indicates a binary compatibility failure (not a normal rg error)\nfunction isBinaryFailure(result: ExecResult): boolean {\n // Spawn error\n if (result.exitCode === -1) return true;\n // jemalloc page size issue (common on ARM64 with non-standard page sizes)\n if (result.stderr.includes('jemalloc') || result.stderr.includes('Unsupported system page size')) return true;\n // SIGABRT (134 = 128 + 6)\n if (result.exitCode === 134) return true;\n return false;\n}\n\nexport async function runRipgrep(args: string[], opts?: { cwd?: string; env?: NodeJS.ProcessEnv }): Promise<ExecResult> {\n // If we've already determined the working path, use it\n if (rgPathChecked && resolvedRgPath) {\n return spawnRg(resolvedRgPath, args, opts);\n }\n\n // First attempt: bundled ripgrep\n if (!rgPathChecked) {\n const result = await spawnRg(rgPath, args, opts);\n \n if (!isBinaryFailure(result)) {\n // Bundled binary works, cache it\n resolvedRgPath = rgPath;\n rgPathChecked = true;\n return result;\n }\n\n // Bundled binary failed, try system rg\n const fallbackResult = await spawnRg('rg', args, opts);\n \n if (!isBinaryFailure(fallbackResult)) {\n // System rg works, cache it\n resolvedRgPath = 'rg';\n rgPathChecked = true;\n return fallbackResult;\n }\n\n // Neither works, mark as checked and return the original error\n rgPathChecked = true;\n return { \n stdout: '', \n stderr: 'Failed to spawn ripgrep. Neither bundled nor system rg is available.', \n exitCode: -1 \n };\n }\n\n // rgPathChecked is true but resolvedRgPath is null - no working rg found\n return { \n stdout: '', \n stderr: 'Failed to spawn ripgrep. Neither bundled nor system rg is available.', \n exitCode: -1 \n };\n}\n\n\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,cAAc;AAKvB,IAAI,iBAAgC;AACpC,IAAI,gBAAgB;AAEpB,SAAS,QAAQ,UAAkB,MAAgB,MAAuE;AACxH,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,UAAM,QAAQ,MAAM,UAAU,MAAM;AAAA,MAClC,KAAK,MAAM;AAAA,MACX,KAAK,EAAE,GAAG,QAAQ,KAAK,GAAI,MAAM,OAAO,CAAC,EAAG;AAAA,MAC5C,OAAO,CAAC,UAAU,QAAQ,MAAM;AAAA,IAClC,CAAC;AACD,QAAI,SAAS;AACb,QAAI,SAAS;AACb,UAAM,OAAO,GAAG,QAAQ,CAAC,MAAO,UAAU,EAAE,SAAS,CAAE;AACvD,UAAM,OAAO,GAAG,QAAQ,CAAC,MAAO,UAAU,EAAE,SAAS,CAAE;AACvD,UAAM,GAAG,SAAS,CAAC,SAAS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|
|
8
8
|
// tools/warp_grep/core.ts
|
|
9
9
|
var WarpGrepClient = class {
|
|
@@ -102,4 +102,4 @@ export {
|
|
|
102
102
|
formatResult,
|
|
103
103
|
WARP_GREP_DESCRIPTION
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-WI23KSNI.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WARP_GREP_DESCRIPTION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WI23KSNI.js";
|
|
4
4
|
import {
|
|
5
5
|
runWarpGrep
|
|
6
6
|
} from "./chunk-7HS6YXA3.js";
|
|
7
7
|
import {
|
|
8
8
|
LocalRipgrepProvider
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KM6V456Q.js";
|
|
10
10
|
|
|
11
11
|
// tools/warp_grep/vercel.ts
|
|
12
12
|
import { tool } from "ai";
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
execute,
|
|
68
68
|
createMorphWarpGrepTool
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-YQVSMU24.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WARP_GREP_DESCRIPTION,
|
|
3
3
|
formatResult
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WI23KSNI.js";
|
|
5
5
|
import {
|
|
6
6
|
runWarpGrep
|
|
7
7
|
} from "./chunk-7HS6YXA3.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-WETRQJGU.js";
|
|
11
11
|
import {
|
|
12
12
|
LocalRipgrepProvider
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KM6V456Q.js";
|
|
14
14
|
|
|
15
15
|
// tools/warp_grep/anthropic.ts
|
|
16
16
|
var INPUT_SCHEMA = {
|
|
@@ -73,4 +73,4 @@ export {
|
|
|
73
73
|
createMorphWarpGrepTool,
|
|
74
74
|
anthropic_default
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-ZGK6OGK3.js.map
|
package/dist/client.cjs
CHANGED
|
@@ -1706,9 +1706,12 @@ var import_path4 = __toESM(require("path"), 1);
|
|
|
1706
1706
|
|
|
1707
1707
|
// tools/warp_grep/utils/ripgrep.ts
|
|
1708
1708
|
var import_child_process = require("child_process");
|
|
1709
|
-
|
|
1709
|
+
var import_ripgrep = require("@vscode/ripgrep");
|
|
1710
|
+
var resolvedRgPath = null;
|
|
1711
|
+
var rgPathChecked = false;
|
|
1712
|
+
function spawnRg(rgBinary, args, opts) {
|
|
1710
1713
|
return new Promise((resolve2) => {
|
|
1711
|
-
const child = (0, import_child_process.spawn)(
|
|
1714
|
+
const child = (0, import_child_process.spawn)(rgBinary, args, {
|
|
1712
1715
|
cwd: opts?.cwd,
|
|
1713
1716
|
env: { ...process.env, ...opts?.env || {} },
|
|
1714
1717
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -1721,10 +1724,46 @@ function runRipgrep(args, opts) {
|
|
|
1721
1724
|
resolve2({ stdout, stderr, exitCode: typeof code === "number" ? code : -1 });
|
|
1722
1725
|
});
|
|
1723
1726
|
child.on("error", () => {
|
|
1724
|
-
resolve2({ stdout: "", stderr: "Failed to spawn ripgrep
|
|
1727
|
+
resolve2({ stdout: "", stderr: "Failed to spawn ripgrep.", exitCode: -1 });
|
|
1725
1728
|
});
|
|
1726
1729
|
});
|
|
1727
1730
|
}
|
|
1731
|
+
function isBinaryFailure(result) {
|
|
1732
|
+
if (result.exitCode === -1) return true;
|
|
1733
|
+
if (result.stderr.includes("jemalloc") || result.stderr.includes("Unsupported system page size")) return true;
|
|
1734
|
+
if (result.exitCode === 134) return true;
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1737
|
+
async function runRipgrep(args, opts) {
|
|
1738
|
+
if (rgPathChecked && resolvedRgPath) {
|
|
1739
|
+
return spawnRg(resolvedRgPath, args, opts);
|
|
1740
|
+
}
|
|
1741
|
+
if (!rgPathChecked) {
|
|
1742
|
+
const result = await spawnRg(import_ripgrep.rgPath, args, opts);
|
|
1743
|
+
if (!isBinaryFailure(result)) {
|
|
1744
|
+
resolvedRgPath = import_ripgrep.rgPath;
|
|
1745
|
+
rgPathChecked = true;
|
|
1746
|
+
return result;
|
|
1747
|
+
}
|
|
1748
|
+
const fallbackResult = await spawnRg("rg", args, opts);
|
|
1749
|
+
if (!isBinaryFailure(fallbackResult)) {
|
|
1750
|
+
resolvedRgPath = "rg";
|
|
1751
|
+
rgPathChecked = true;
|
|
1752
|
+
return fallbackResult;
|
|
1753
|
+
}
|
|
1754
|
+
rgPathChecked = true;
|
|
1755
|
+
return {
|
|
1756
|
+
stdout: "",
|
|
1757
|
+
stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
|
|
1758
|
+
exitCode: -1
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
return {
|
|
1762
|
+
stdout: "",
|
|
1763
|
+
stderr: "Failed to spawn ripgrep. Neither bundled nor system rg is available.",
|
|
1764
|
+
exitCode: -1
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1728
1767
|
|
|
1729
1768
|
// tools/warp_grep/utils/paths.ts
|
|
1730
1769
|
var import_fs = __toESM(require("fs"), 1);
|