@morphllm/morphsdk 0.2.189 → 0.2.191
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-23CLZZMU.js → chunk-2C7VYXAS.js} +2 -2
- package/dist/{chunk-SQPH6GIE.js → chunk-4OK2MQ6D.js} +3 -3
- package/dist/{chunk-EL3PFPAG.js → chunk-64C7KH43.js} +2 -2
- package/dist/{chunk-WWB6LGTC.js → chunk-7CHATKFG.js} +3 -3
- package/dist/{chunk-6QEN3GDU.js → chunk-AGZWNSYQ.js} +2 -2
- package/dist/{chunk-ED7EJHT4.js → chunk-BQ7TIETH.js} +2 -2
- package/dist/{chunk-QYPZL2IU.js → chunk-CEQGLXFL.js} +2 -2
- package/dist/{chunk-TZAYSJTA.js → chunk-COFXBRFH.js} +2 -2
- package/dist/{chunk-B2M45EM7.js → chunk-E5PPKNP7.js} +2 -2
- package/dist/{chunk-3FSNRVGX.js → chunk-EGZHEFVZ.js} +2 -2
- package/dist/{chunk-QXQWVXR5.js → chunk-F4FIXHMI.js} +23 -23
- package/dist/{chunk-DBLW6DDW.js → chunk-FKF52VSB.js} +2 -2
- package/dist/{chunk-3OFDPEWP.js → chunk-FSMAW6PJ.js} +2 -2
- package/dist/{chunk-A757WPBG.js → chunk-HOGGK6XD.js} +2 -2
- package/dist/{chunk-PSFKRTG7.js → chunk-J5KIUNUN.js} +2 -2
- package/dist/{chunk-PSFKRTG7.js.map → chunk-J5KIUNUN.js.map} +1 -1
- package/dist/{chunk-FA2UYSGI.js → chunk-JZ7Y6HZV.js} +3 -3
- package/dist/{chunk-G5SPU45F.js → chunk-LWINQ2RM.js} +15 -8
- package/dist/chunk-LWINQ2RM.js.map +1 -0
- package/dist/{chunk-GVGJIXV2.js → chunk-MRMBFJR2.js} +17 -7
- package/dist/chunk-MRMBFJR2.js.map +1 -0
- package/dist/{chunk-V5NMFRJ4.js → chunk-OB44QQNL.js} +4 -4
- package/dist/{chunk-YO5BQMSP.js → chunk-OUG4ELG5.js} +2 -2
- package/dist/{chunk-A5SAWVC3.js → chunk-PCNK6Y46.js} +2 -2
- package/dist/{chunk-N46EHRKD.js → chunk-RDW27VLU.js} +2 -2
- package/dist/{chunk-SY65P6FE.js → chunk-SNGALUO7.js} +2 -2
- package/dist/{chunk-5RJM5O2N.js → chunk-TKKPH5GW.js} +2 -2
- package/dist/{chunk-EUPISPLN.js → chunk-U2F3EPZJ.js} +3 -3
- package/dist/{chunk-KSGVHWG7.js → chunk-ULJP7VQF.js} +2 -2
- package/dist/{chunk-DYWXVFUT.js → chunk-VA6RRTXW.js} +2 -2
- package/dist/{chunk-WDTQSCEF.js → chunk-VKPE4HR2.js} +2 -2
- package/dist/{chunk-PSY52HPS.js → chunk-WVZZV5YS.js} +2 -2
- package/dist/{chunk-ZTGDTW4B.js → chunk-XOXIFA6I.js} +2 -2
- package/dist/{chunk-XT6Y3YWD.js → chunk-XUAYUGVU.js} +2 -2
- package/dist/{chunk-FHKHINJ6.js → chunk-Z2KWDMFO.js} +4 -4
- package/dist/{client-BtIoVFEt.d.ts → client-Rn1zymAl.d.ts} +1 -1
- package/dist/client.cjs +30 -14
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +30 -30
- package/dist/core/client.cjs +1 -1
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.js +4 -4
- package/dist/core/error.cjs +1 -1
- package/dist/core/error.cjs.map +1 -1
- package/dist/core/error.js +3 -3
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +4 -4
- package/dist/edge.cjs +1 -1
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.js +12 -12
- package/dist/git/client.cjs +1 -1
- package/dist/git/client.cjs.map +1 -1
- package/dist/git/client.js +5 -5
- package/dist/git/index.cjs +1 -1
- package/dist/git/index.cjs.map +1 -1
- package/dist/git/index.js +5 -5
- package/dist/index.cjs +30 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -34
- package/dist/modelrouter/core.cjs +1 -1
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +5 -5
- package/dist/modelrouter/index.cjs +1 -1
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +5 -5
- package/dist/subagents/anthropic.cjs +30 -14
- package/dist/subagents/anthropic.cjs.map +1 -1
- package/dist/subagents/anthropic.d.ts +1 -1
- package/dist/subagents/anthropic.js +10 -10
- package/dist/subagents/index.d.ts +1 -1
- package/dist/subagents/prompts.d.ts +1 -1
- package/dist/subagents/types.d.ts +1 -1
- package/dist/subagents/vercel.cjs +30 -14
- package/dist/subagents/vercel.cjs.map +1 -1
- package/dist/subagents/vercel.d.ts +1 -1
- package/dist/subagents/vercel.js +10 -10
- package/dist/tools/browser/anthropic.cjs +1 -1
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +7 -7
- package/dist/tools/browser/core.cjs +1 -1
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.js +6 -6
- package/dist/tools/browser/index.cjs +1 -1
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.js +9 -9
- package/dist/tools/browser/openai.cjs +1 -1
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +7 -7
- 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 +7 -7
- 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 +6 -6
- 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 +5 -5
- 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 +8 -8
- 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 +6 -6
- 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 +6 -6
- package/dist/tools/compact/core.cjs +1 -1
- package/dist/tools/compact/core.cjs.map +1 -1
- package/dist/tools/compact/core.js +5 -5
- package/dist/tools/compact/index.cjs +1 -1
- package/dist/tools/compact/index.cjs.map +1 -1
- package/dist/tools/compact/index.js +6 -6
- package/dist/tools/fastapply/anthropic.cjs +1 -1
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +7 -7
- 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 +6 -6
- package/dist/tools/fastapply/index.cjs +1 -1
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.js +9 -9
- package/dist/tools/fastapply/openai.cjs +1 -1
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +7 -7
- package/dist/tools/fastapply/vercel.cjs +1 -1
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.js +7 -7
- package/dist/tools/index.cjs +1 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +9 -9
- package/dist/tools/reflex/core.cjs +1 -1
- package/dist/tools/reflex/core.cjs.map +1 -1
- package/dist/tools/reflex/core.js +5 -5
- package/dist/tools/reflex/index.cjs +1 -1
- package/dist/tools/reflex/index.cjs.map +1 -1
- package/dist/tools/reflex/index.js +5 -5
- 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/runner.cjs +1 -1
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +2 -2
- package/dist/tools/warp_grep/anthropic.cjs +30 -14
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +1 -1
- package/dist/tools/warp_grep/anthropic.js +10 -10
- package/dist/tools/warp_grep/client.cjs +30 -14
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.d.ts +1 -1
- package/dist/tools/warp_grep/client.js +9 -9
- package/dist/tools/warp_grep/gemini.cjs +30 -14
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.d.ts +1 -1
- package/dist/tools/warp_grep/gemini.js +9 -9
- package/dist/tools/warp_grep/index.cjs +30 -14
- 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 +9 -9
- package/dist/tools/warp_grep/openai.cjs +30 -14
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +1 -1
- package/dist/tools/warp_grep/openai.js +10 -10
- package/dist/tools/warp_grep/providers/code_storage_http.cjs +19 -8
- package/dist/tools/warp_grep/providers/code_storage_http.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/code_storage_http.d.ts +6 -3
- package/dist/tools/warp_grep/providers/code_storage_http.js +5 -3
- package/dist/tools/warp_grep/providers/remote.d.ts +1 -1
- package/dist/tools/warp_grep/vercel.cjs +30 -14
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +1 -1
- package/dist/tools/warp_grep/vercel.js +10 -10
- package/dist/{types-CtkD4o1_.d.ts → types-qwD753FR.d.ts} +1 -1
- 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-G5SPU45F.js.map +0 -1
- package/dist/chunk-GVGJIXV2.js.map +0 -1
- /package/dist/{chunk-23CLZZMU.js.map → chunk-2C7VYXAS.js.map} +0 -0
- /package/dist/{chunk-SQPH6GIE.js.map → chunk-4OK2MQ6D.js.map} +0 -0
- /package/dist/{chunk-EL3PFPAG.js.map → chunk-64C7KH43.js.map} +0 -0
- /package/dist/{chunk-WWB6LGTC.js.map → chunk-7CHATKFG.js.map} +0 -0
- /package/dist/{chunk-6QEN3GDU.js.map → chunk-AGZWNSYQ.js.map} +0 -0
- /package/dist/{chunk-ED7EJHT4.js.map → chunk-BQ7TIETH.js.map} +0 -0
- /package/dist/{chunk-QYPZL2IU.js.map → chunk-CEQGLXFL.js.map} +0 -0
- /package/dist/{chunk-TZAYSJTA.js.map → chunk-COFXBRFH.js.map} +0 -0
- /package/dist/{chunk-B2M45EM7.js.map → chunk-E5PPKNP7.js.map} +0 -0
- /package/dist/{chunk-3FSNRVGX.js.map → chunk-EGZHEFVZ.js.map} +0 -0
- /package/dist/{chunk-QXQWVXR5.js.map → chunk-F4FIXHMI.js.map} +0 -0
- /package/dist/{chunk-DBLW6DDW.js.map → chunk-FKF52VSB.js.map} +0 -0
- /package/dist/{chunk-3OFDPEWP.js.map → chunk-FSMAW6PJ.js.map} +0 -0
- /package/dist/{chunk-A757WPBG.js.map → chunk-HOGGK6XD.js.map} +0 -0
- /package/dist/{chunk-FA2UYSGI.js.map → chunk-JZ7Y6HZV.js.map} +0 -0
- /package/dist/{chunk-V5NMFRJ4.js.map → chunk-OB44QQNL.js.map} +0 -0
- /package/dist/{chunk-YO5BQMSP.js.map → chunk-OUG4ELG5.js.map} +0 -0
- /package/dist/{chunk-A5SAWVC3.js.map → chunk-PCNK6Y46.js.map} +0 -0
- /package/dist/{chunk-N46EHRKD.js.map → chunk-RDW27VLU.js.map} +0 -0
- /package/dist/{chunk-SY65P6FE.js.map → chunk-SNGALUO7.js.map} +0 -0
- /package/dist/{chunk-5RJM5O2N.js.map → chunk-TKKPH5GW.js.map} +0 -0
- /package/dist/{chunk-EUPISPLN.js.map → chunk-U2F3EPZJ.js.map} +0 -0
- /package/dist/{chunk-KSGVHWG7.js.map → chunk-ULJP7VQF.js.map} +0 -0
- /package/dist/{chunk-DYWXVFUT.js.map → chunk-VA6RRTXW.js.map} +0 -0
- /package/dist/{chunk-WDTQSCEF.js.map → chunk-VKPE4HR2.js.map} +0 -0
- /package/dist/{chunk-PSY52HPS.js.map → chunk-WVZZV5YS.js.map} +0 -0
- /package/dist/{chunk-ZTGDTW4B.js.map → chunk-XOXIFA6I.js.map} +0 -0
- /package/dist/{chunk-XT6Y3YWD.js.map → chunk-XUAYUGVU.js.map} +0 -0
- /package/dist/{chunk-FHKHINJ6.js.map → chunk-Z2KWDMFO.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatCompletionTool } from 'openai/resources/chat/completions';
|
|
2
2
|
export { formatResult } from './client.js';
|
|
3
|
-
import { d as WarpGrepToolConfig, b as WarpGrepResult, g as GitHubSearchToolConfig, h as GitHubReadFileToolConfig, e as GitHubReadFileInput, f as GitHubReadFileResult } from '../../types-
|
|
3
|
+
import { d as WarpGrepToolConfig, b as WarpGrepResult, g as GitHubSearchToolConfig, h as GitHubReadFileToolConfig, e as GitHubReadFileInput, f as GitHubReadFileResult } from '../../types-qwD753FR.js';
|
|
4
4
|
import './agent/types.js';
|
|
5
5
|
import '../utils/resilience.js';
|
|
6
6
|
import '../../core/client.js';
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
execute,
|
|
6
6
|
openai_default,
|
|
7
7
|
warpGrepTool
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-PCNK6Y46.js";
|
|
9
9
|
import "../../chunk-Q6QCHAMD.js";
|
|
10
10
|
import {
|
|
11
11
|
formatResult
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-LWINQ2RM.js";
|
|
13
13
|
import "../../chunk-63VHBANJ.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-RDW27VLU.js";
|
|
15
|
+
import "../../chunk-MRMBFJR2.js";
|
|
16
16
|
import "../../chunk-A4D2CIIT.js";
|
|
17
17
|
import "../../chunk-IA5K2HTC.js";
|
|
18
18
|
import "../../chunk-FBRNUWEB.js";
|
|
19
19
|
import "../../chunk-CCJK3HTG.js";
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-ULJP7VQF.js";
|
|
21
|
+
import "../../chunk-7CHATKFG.js";
|
|
22
|
+
import "../../chunk-Z2KWDMFO.js";
|
|
23
23
|
import "../../chunk-F3NCFNUX.js";
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-XUAYUGVU.js";
|
|
25
|
+
import "../../chunk-64C7KH43.js";
|
|
26
|
+
import "../../chunk-J5KIUNUN.js";
|
|
27
27
|
import "../../chunk-LKFZBBTD.js";
|
|
28
28
|
import "../../chunk-PZ5AY32C.js";
|
|
29
29
|
export {
|
|
@@ -20,13 +20,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// tools/warp_grep/providers/code_storage_http.ts
|
|
21
21
|
var code_storage_http_exports = {};
|
|
22
22
|
__export(code_storage_http_exports, {
|
|
23
|
-
createCodeStorageHttpCommands: () => createCodeStorageHttpCommands
|
|
23
|
+
createCodeStorageHttpCommands: () => createCodeStorageHttpCommands,
|
|
24
|
+
toRepoRelative: () => toRepoRelative
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(code_storage_http_exports);
|
|
26
|
-
|
|
27
|
+
var MODEL_REPO_ROOT = /^\/?home\/ubuntu\/repo(?:\/|$)/;
|
|
28
|
+
function toRepoRelative(path) {
|
|
29
|
+
if (!path) return path;
|
|
30
|
+
const stripped = path.replace(MODEL_REPO_ROOT, "").replace(/^\.?\/+/, "");
|
|
31
|
+
return stripped || ".";
|
|
32
|
+
}
|
|
33
|
+
async function post(url, body, op, apiKey) {
|
|
27
34
|
const res = await fetch(url, {
|
|
28
35
|
method: "POST",
|
|
29
|
-
headers: {
|
|
36
|
+
headers: {
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
...apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
|
|
39
|
+
},
|
|
30
40
|
body: JSON.stringify(body)
|
|
31
41
|
});
|
|
32
42
|
if (!res.ok) {
|
|
@@ -43,16 +53,17 @@ async function post(url, body, op) {
|
|
|
43
53
|
return data.stdout;
|
|
44
54
|
}
|
|
45
55
|
function createCodeStorageHttpCommands(config) {
|
|
46
|
-
const { baseUrl, repoId, branch } = config;
|
|
56
|
+
const { baseUrl, repoId, branch, apiKey } = config;
|
|
47
57
|
const encodedRepoId = encodeURIComponent(repoId);
|
|
48
58
|
return {
|
|
49
|
-
grep: (pattern, path, glob) => post(`${baseUrl}/api/code-search/${encodedRepoId}/grep`, { pattern, path, glob, branch }, "grep"),
|
|
50
|
-
read: (path, start, end) => post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path, start, end, branch }, "read"),
|
|
51
|
-
listDir: (path, maxDepth) => post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path, maxDepth, branch }, "list")
|
|
59
|
+
grep: (pattern, path, glob) => post(`${baseUrl}/api/code-search/${encodedRepoId}/grep`, { pattern, path: toRepoRelative(path), glob, branch }, "grep", apiKey),
|
|
60
|
+
read: (path, start, end) => post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path: toRepoRelative(path), start, end, branch }, "read", apiKey),
|
|
61
|
+
listDir: (path, maxDepth) => post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path: toRepoRelative(path), maxDepth, branch }, "list", apiKey)
|
|
52
62
|
};
|
|
53
63
|
}
|
|
54
64
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
65
|
0 && (module.exports = {
|
|
56
|
-
createCodeStorageHttpCommands
|
|
66
|
+
createCodeStorageHttpCommands,
|
|
67
|
+
toRepoRelative
|
|
57
68
|
});
|
|
58
69
|
//# sourceMappingURL=code_storage_http.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../tools/warp_grep/providers/code_storage_http.ts"],"sourcesContent":["/**\n * HTTP-based RemoteCommands for code search against the Morph landing API.\n *\n * Translates grep/read/listDir into POST requests to the code-search endpoints,\n * so the WarpGrep agent can search GitHub repositories that have been indexed\n * by the Morph code storage service.\n */\n\nimport type { RemoteCommands } from '../types.js';\n\nexport interface CodeStorageHttpConfig {\n /** Base URL for the code search API (e.g. \"https://morphllm.com\") */\n baseUrl: string;\n /** Repository ID returned by the get-or-create endpoint */\n repoId: string;\n /** Git branch to search */\n branch: string;\n}\n\nasync function post(url: string, body: Record<string, unknown>, op: string): Promise<string> {\n const res = await fetch(url, {\n method: 'POST',\n headers: {
|
|
1
|
+
{"version":3,"sources":["../../../../tools/warp_grep/providers/code_storage_http.ts"],"sourcesContent":["/**\n * HTTP-based RemoteCommands for code search against the Morph landing API.\n *\n * Translates grep/read/listDir into POST requests to the code-search endpoints,\n * so the WarpGrep agent can search GitHub repositories that have been indexed\n * by the Morph code storage service.\n */\n\nimport type { RemoteCommands } from '../types.js';\n\n/**\n * The WarpGrep model addresses files as if the repo were checked out at\n * /home/ubuntu/repo (its training root), while the code-search endpoints\n * expect repo-relative paths. Strip the training root and any leading\n * slashes at this boundary — the same normalization the dashboard\n * playground applies via warpgrep-mock-paths.ts.\n */\nconst MODEL_REPO_ROOT = /^\\/?home\\/ubuntu\\/repo(?:\\/|$)/;\n\nexport function toRepoRelative(path: string): string {\n if (!path) return path;\n const stripped = path.replace(MODEL_REPO_ROOT, '').replace(/^\\.?\\/+/, '');\n return stripped || '.';\n}\n\nexport interface CodeStorageHttpConfig {\n /** Base URL for the code search API (e.g. \"https://api.morphllm.com\") */\n baseUrl: string;\n /** Repository ID returned by the get-or-create endpoint */\n repoId: string;\n /** Git branch to search */\n branch: string;\n /** Morph API key, forwarded as a Bearer token (api.morphllm.com requires it) */\n apiKey?: string;\n}\n\nasync function post(url: string, body: Record<string, unknown>, op: string, apiKey?: string): Promise<string> {\n const res = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),\n },\n body: JSON.stringify(body),\n });\n if (!res.ok) {\n const text = await res.text().catch(() => res.statusText);\n // Return error as content instead of throwing so the agent can handle it gracefully\n try {\n const parsed = JSON.parse(text);\n if (parsed.error) return `Error: ${parsed.error}`;\n } catch { /* not JSON, fall through */ }\n return `Error: ${op} failed (${res.status}): ${text}`;\n }\n const data = await res.json();\n if (data.error) throw new Error(data.error);\n return data.stdout;\n}\n\nexport function createCodeStorageHttpCommands(config: CodeStorageHttpConfig): RemoteCommands {\n const { baseUrl, repoId, branch, apiKey } = config;\n const encodedRepoId = encodeURIComponent(repoId);\n\n return {\n grep: (pattern: string, path: string, glob?: string) =>\n post(`${baseUrl}/api/code-search/${encodedRepoId}/grep`, { pattern, path: toRepoRelative(path), glob, branch }, 'grep', apiKey),\n\n read: (path: string, start: number, end: number) =>\n post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path: toRepoRelative(path), start, end, branch }, 'read', apiKey),\n\n listDir: (path: string, maxDepth: number) =>\n post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path: toRepoRelative(path), maxDepth, branch }, 'list', apiKey),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA,IAAM,kBAAkB;AAEjB,SAAS,eAAe,MAAsB;AACnD,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,WAAW,KAAK,QAAQ,iBAAiB,EAAE,EAAE,QAAQ,WAAW,EAAE;AACxE,SAAO,YAAY;AACrB;AAaA,eAAe,KAAK,KAAa,MAA+B,IAAY,QAAkC;AAC5G,QAAM,MAAM,MAAM,MAAM,KAAK;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,GAAI,SAAS,EAAE,eAAe,UAAU,MAAM,GAAG,IAAI,CAAC;AAAA,IACxD;AAAA,IACA,MAAM,KAAK,UAAU,IAAI;AAAA,EAC3B,CAAC;AACD,MAAI,CAAC,IAAI,IAAI;AACX,UAAM,OAAO,MAAM,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,UAAU;AAExD,QAAI;AACF,YAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,UAAI,OAAO,MAAO,QAAO,UAAU,OAAO,KAAK;AAAA,IACjD,QAAQ;AAAA,IAA+B;AACvC,WAAO,UAAU,EAAE,YAAY,IAAI,MAAM,MAAM,IAAI;AAAA,EACrD;AACA,QAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,MAAI,KAAK,MAAO,OAAM,IAAI,MAAM,KAAK,KAAK;AAC1C,SAAO,KAAK;AACd;AAEO,SAAS,8BAA8B,QAA+C;AAC3F,QAAM,EAAE,SAAS,QAAQ,QAAQ,OAAO,IAAI;AAC5C,QAAM,gBAAgB,mBAAmB,MAAM;AAE/C,SAAO;AAAA,IACL,MAAM,CAAC,SAAiB,MAAc,SACpC,KAAK,GAAG,OAAO,oBAAoB,aAAa,SAAS,EAAE,SAAS,MAAM,eAAe,IAAI,GAAG,MAAM,OAAO,GAAG,QAAQ,MAAM;AAAA,IAEhI,MAAM,CAAC,MAAc,OAAe,QAClC,KAAK,GAAG,OAAO,oBAAoB,aAAa,SAAS,EAAE,MAAM,eAAe,IAAI,GAAG,OAAO,KAAK,OAAO,GAAG,QAAQ,MAAM;AAAA,IAE7H,SAAS,CAAC,MAAc,aACtB,KAAK,GAAG,OAAO,oBAAoB,aAAa,SAAS,EAAE,MAAM,eAAe,IAAI,GAAG,UAAU,OAAO,GAAG,QAAQ,MAAM;AAAA,EAC7H;AACF;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RemoteCommands } from '../../../types-
|
|
1
|
+
import { R as RemoteCommands } from '../../../types-qwD753FR.js';
|
|
2
2
|
import './types.js';
|
|
3
3
|
import '../../utils/resilience.js';
|
|
4
4
|
|
|
@@ -10,14 +10,17 @@ import '../../utils/resilience.js';
|
|
|
10
10
|
* by the Morph code storage service.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
declare function toRepoRelative(path: string): string;
|
|
13
14
|
interface CodeStorageHttpConfig {
|
|
14
|
-
/** Base URL for the code search API (e.g. "https://morphllm.com") */
|
|
15
|
+
/** Base URL for the code search API (e.g. "https://api.morphllm.com") */
|
|
15
16
|
baseUrl: string;
|
|
16
17
|
/** Repository ID returned by the get-or-create endpoint */
|
|
17
18
|
repoId: string;
|
|
18
19
|
/** Git branch to search */
|
|
19
20
|
branch: string;
|
|
21
|
+
/** Morph API key, forwarded as a Bearer token (api.morphllm.com requires it) */
|
|
22
|
+
apiKey?: string;
|
|
20
23
|
}
|
|
21
24
|
declare function createCodeStorageHttpCommands(config: CodeStorageHttpConfig): RemoteCommands;
|
|
22
25
|
|
|
23
|
-
export { type CodeStorageHttpConfig, createCodeStorageHttpCommands };
|
|
26
|
+
export { type CodeStorageHttpConfig, createCodeStorageHttpCommands, toRepoRelative };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createCodeStorageHttpCommands
|
|
3
|
-
|
|
2
|
+
createCodeStorageHttpCommands,
|
|
3
|
+
toRepoRelative
|
|
4
|
+
} from "../../../chunk-MRMBFJR2.js";
|
|
4
5
|
import "../../../chunk-PZ5AY32C.js";
|
|
5
6
|
export {
|
|
6
|
-
createCodeStorageHttpCommands
|
|
7
|
+
createCodeStorageHttpCommands,
|
|
8
|
+
toRepoRelative
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=code_storage_http.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WarpGrepProvider, GrepResult, ReadResult, ListDirectoryEntry, GlobResult } from './types.js';
|
|
2
|
-
import { R as RemoteCommands } from '../../../types-
|
|
2
|
+
import { R as RemoteCommands } from '../../../types-qwD753FR.js';
|
|
3
3
|
import '../../utils/resilience.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -215,7 +215,7 @@ function ensureWithinRepo(repoRoot, absTarget) {
|
|
|
215
215
|
throw new Error(`Path outside repository root: ${absTarget}`);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function toRepoRelative2(repoRoot, absPath) {
|
|
219
219
|
return import_path4.default.relative(import_path4.default.resolve(repoRoot), import_path4.default.resolve(absPath));
|
|
220
220
|
}
|
|
221
221
|
function isSymlink(p) {
|
|
@@ -402,7 +402,7 @@ var init_local = __esm({
|
|
|
402
402
|
}
|
|
403
403
|
const stat = await import_promises2.default.stat(abs).catch(() => null);
|
|
404
404
|
if (!stat) return { lines: [] };
|
|
405
|
-
const targetArg = abs === import_path5.default.resolve(this.repoRoot) ? "." :
|
|
405
|
+
const targetArg = abs === import_path5.default.resolve(this.repoRoot) ? "." : toRepoRelative2(this.repoRoot, abs);
|
|
406
406
|
const contextLines = params.context_lines !== void 0 ? String(params.context_lines) : "1";
|
|
407
407
|
const args = [
|
|
408
408
|
"--no-config",
|
|
@@ -561,7 +561,7 @@ Details: ${res.stderr}` : ""}`
|
|
|
561
561
|
const isDir = entry.isDirectory();
|
|
562
562
|
results.push({
|
|
563
563
|
name: entry.name,
|
|
564
|
-
path:
|
|
564
|
+
path: toRepoRelative2(repoRoot, full),
|
|
565
565
|
type: isDir ? "dir" : "file",
|
|
566
566
|
depth
|
|
567
567
|
});
|
|
@@ -584,7 +584,7 @@ Details: ${res.stderr}` : ""}`
|
|
|
584
584
|
if (!stat || !stat.isDirectory()) {
|
|
585
585
|
return { files: [], searchDir: abs, totalFound: 0, error: `[PATH ERROR] Directory not found: ${params.path || "."}` };
|
|
586
586
|
}
|
|
587
|
-
const targetArg = abs === import_path5.default.resolve(this.repoRoot) ? "." :
|
|
587
|
+
const targetArg = abs === import_path5.default.resolve(this.repoRoot) ? "." : toRepoRelative2(this.repoRoot, abs);
|
|
588
588
|
const args = [
|
|
589
589
|
"--no-config",
|
|
590
590
|
"--files",
|
|
@@ -942,7 +942,7 @@ var import_openai = __toESM(require("openai"), 1);
|
|
|
942
942
|
// package.json
|
|
943
943
|
var package_default = {
|
|
944
944
|
name: "@morphllm/morphsdk",
|
|
945
|
-
version: "0.2.
|
|
945
|
+
version: "0.2.191",
|
|
946
946
|
description: "TypeScript SDK and CLI for Morph Fast Apply integration",
|
|
947
947
|
type: "module",
|
|
948
948
|
main: "./dist/index.cjs",
|
|
@@ -1864,10 +1864,19 @@ var RemoteCommandsProvider = class {
|
|
|
1864
1864
|
};
|
|
1865
1865
|
|
|
1866
1866
|
// tools/warp_grep/providers/code_storage_http.ts
|
|
1867
|
-
|
|
1867
|
+
var MODEL_REPO_ROOT = /^\/?home\/ubuntu\/repo(?:\/|$)/;
|
|
1868
|
+
function toRepoRelative(path6) {
|
|
1869
|
+
if (!path6) return path6;
|
|
1870
|
+
const stripped = path6.replace(MODEL_REPO_ROOT, "").replace(/^\.?\/+/, "");
|
|
1871
|
+
return stripped || ".";
|
|
1872
|
+
}
|
|
1873
|
+
async function post(url, body, op, apiKey) {
|
|
1868
1874
|
const res = await fetch(url, {
|
|
1869
1875
|
method: "POST",
|
|
1870
|
-
headers: {
|
|
1876
|
+
headers: {
|
|
1877
|
+
"Content-Type": "application/json",
|
|
1878
|
+
...apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
|
|
1879
|
+
},
|
|
1871
1880
|
body: JSON.stringify(body)
|
|
1872
1881
|
});
|
|
1873
1882
|
if (!res.ok) {
|
|
@@ -1884,12 +1893,12 @@ async function post(url, body, op) {
|
|
|
1884
1893
|
return data.stdout;
|
|
1885
1894
|
}
|
|
1886
1895
|
function createCodeStorageHttpCommands(config) {
|
|
1887
|
-
const { baseUrl, repoId, branch } = config;
|
|
1896
|
+
const { baseUrl, repoId, branch, apiKey } = config;
|
|
1888
1897
|
const encodedRepoId = encodeURIComponent(repoId);
|
|
1889
1898
|
return {
|
|
1890
|
-
grep: (pattern, path6, glob) => post(`${baseUrl}/api/code-search/${encodedRepoId}/grep`, { pattern, path: path6, glob, branch }, "grep"),
|
|
1891
|
-
read: (path6, start, end) => post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path: path6, start, end, branch }, "read"),
|
|
1892
|
-
listDir: (path6, maxDepth) => post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path: path6, maxDepth, branch }, "list")
|
|
1899
|
+
grep: (pattern, path6, glob) => post(`${baseUrl}/api/code-search/${encodedRepoId}/grep`, { pattern, path: toRepoRelative(path6), glob, branch }, "grep", apiKey),
|
|
1900
|
+
read: (path6, start, end) => post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path: toRepoRelative(path6), start, end, branch }, "read", apiKey),
|
|
1901
|
+
listDir: (path6, maxDepth) => post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path: toRepoRelative(path6), maxDepth, branch }, "list", apiKey)
|
|
1893
1902
|
};
|
|
1894
1903
|
}
|
|
1895
1904
|
|
|
@@ -2230,7 +2239,7 @@ async function compactFileContexts(files, query, apiKey, apiUrl, maxTokens = 1e4
|
|
|
2230
2239
|
}
|
|
2231
2240
|
|
|
2232
2241
|
// tools/warp_grep/client.ts
|
|
2233
|
-
var DEFAULT_CODE_SEARCH_URL = "https://morphllm.com";
|
|
2242
|
+
var DEFAULT_CODE_SEARCH_URL = "https://api.morphllm.com";
|
|
2234
2243
|
async function getLocalProvider(repoRoot, excludes, allowNames) {
|
|
2235
2244
|
const { LocalRipgrepProvider: LocalRipgrepProvider2 } = await Promise.resolve().then(() => (init_local(), local_exports));
|
|
2236
2245
|
const opts = allowNames?.length ? { allowNames } : void 0;
|
|
@@ -2306,7 +2315,9 @@ var WarpGrepClient = class extends APIResource {
|
|
|
2306
2315
|
const baseUrl = this.config.codeSearchUrl || DEFAULT_CODE_SEARCH_URL;
|
|
2307
2316
|
logger.debug("WarpGrep", "github_resolve", { owner_repo: `${owner}/${repo}`, branch: input.branch });
|
|
2308
2317
|
const resolveStart = Date.now();
|
|
2309
|
-
const importRes = await fetch(`${baseUrl}/api/code-search/get-or-create?url=${encodeURIComponent(`${owner}/${repo}`)}
|
|
2318
|
+
const importRes = await fetch(`${baseUrl}/api/code-search/get-or-create?url=${encodeURIComponent(`${owner}/${repo}`)}`, {
|
|
2319
|
+
headers: this.config.morphApiKey ? { Authorization: `Bearer ${this.config.morphApiKey}` } : void 0
|
|
2320
|
+
});
|
|
2310
2321
|
if (!importRes.ok) {
|
|
2311
2322
|
const text = await importRes.text().catch(() => importRes.statusText);
|
|
2312
2323
|
logger.error("WarpGrep", "github_resolve_failed", { owner_repo: `${owner}/${repo}`, status: importRes.status, error: text });
|
|
@@ -2316,7 +2327,12 @@ var WarpGrepClient = class extends APIResource {
|
|
|
2316
2327
|
logger.debug("WarpGrep", "github_repo_fetched", { repo_id: repoId, default_branch: defaultBranch, latency_ms: Date.now() - resolveStart });
|
|
2317
2328
|
return {
|
|
2318
2329
|
repo,
|
|
2319
|
-
remoteCommands: createCodeStorageHttpCommands({
|
|
2330
|
+
remoteCommands: createCodeStorageHttpCommands({
|
|
2331
|
+
baseUrl,
|
|
2332
|
+
repoId,
|
|
2333
|
+
branch: input.branch || defaultBranch,
|
|
2334
|
+
apiKey: this.config.morphApiKey
|
|
2335
|
+
})
|
|
2320
2336
|
};
|
|
2321
2337
|
}
|
|
2322
2338
|
async _searchGitHubAsync(input) {
|