@morphllm/morphsdk 0.2.189 → 0.2.190
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-EL3PFPAG.js → chunk-3IEZFECM.js} +2 -2
- package/dist/{chunk-WDTQSCEF.js → chunk-4HWDQEHY.js} +2 -2
- package/dist/{chunk-QXQWVXR5.js → chunk-66LEBVGY.js} +23 -23
- package/dist/{chunk-SQPH6GIE.js → chunk-ANR7MZB6.js} +3 -3
- package/dist/{chunk-KSGVHWG7.js → chunk-AYJIJUIN.js} +2 -2
- package/dist/{chunk-N46EHRKD.js → chunk-BEOWFUOS.js} +2 -2
- package/dist/{chunk-B2M45EM7.js → chunk-BG66V2TL.js} +2 -2
- package/dist/{chunk-XT6Y3YWD.js → chunk-BJVN7D5S.js} +2 -2
- package/dist/{chunk-6QEN3GDU.js → chunk-FAN67CEH.js} +2 -2
- package/dist/{chunk-3FSNRVGX.js → chunk-GACWZPES.js} +2 -2
- package/dist/{chunk-TZAYSJTA.js → chunk-HBAPH52R.js} +2 -2
- package/dist/{chunk-FA2UYSGI.js → chunk-I47HR32K.js} +3 -3
- package/dist/{chunk-WWB6LGTC.js → chunk-I7VZH73D.js} +3 -3
- package/dist/{chunk-23CLZZMU.js → chunk-JPRHFZJS.js} +2 -2
- package/dist/{chunk-FHKHINJ6.js → chunk-JTDEEUUQ.js} +4 -4
- package/dist/{chunk-G5SPU45F.js → chunk-K7PNYXHA.js} +15 -8
- package/dist/chunk-K7PNYXHA.js.map +1 -0
- package/dist/{chunk-A757WPBG.js → chunk-KCX33EXW.js} +2 -2
- package/dist/{chunk-5RJM5O2N.js → chunk-KRMJ6TY5.js} +2 -2
- package/dist/{chunk-EUPISPLN.js → chunk-MWBVO2OZ.js} +3 -3
- package/dist/{chunk-DBLW6DDW.js → chunk-NN35VBFL.js} +2 -2
- package/dist/{chunk-YO5BQMSP.js → chunk-NQQ7L4IO.js} +2 -2
- package/dist/{chunk-QYPZL2IU.js → chunk-NWB3HJGZ.js} +2 -2
- package/dist/{chunk-V5NMFRJ4.js → chunk-S2BRHJWT.js} +4 -4
- package/dist/{chunk-3OFDPEWP.js → chunk-TT4HS35C.js} +2 -2
- package/dist/{chunk-ZTGDTW4B.js → chunk-UZBH2ZAG.js} +2 -2
- package/dist/{chunk-ED7EJHT4.js → chunk-V3ACYBJJ.js} +2 -2
- package/dist/{chunk-PSY52HPS.js → chunk-V5OI2UIY.js} +2 -2
- package/dist/{chunk-DYWXVFUT.js → chunk-VO7KLNE5.js} +2 -2
- package/dist/{chunk-SY65P6FE.js → chunk-XXMIVX3H.js} +2 -2
- package/dist/{chunk-A5SAWVC3.js → chunk-XZ6NDGZV.js} +2 -2
- package/dist/{chunk-PSFKRTG7.js → chunk-ZDMK3OPO.js} +2 -2
- package/dist/{chunk-PSFKRTG7.js.map → chunk-ZDMK3OPO.js.map} +1 -1
- package/dist/{chunk-GVGJIXV2.js → chunk-ZMKLSBIM.js} +10 -7
- package/dist/chunk-ZMKLSBIM.js.map +1 -0
- package/dist/{client-BtIoVFEt.d.ts → client-Rn1zymAl.d.ts} +1 -1
- package/dist/client.cjs +20 -10
- 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 +7 -7
- 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 +20 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -32
- 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 +20 -10
- 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 +20 -10
- 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 +20 -10
- 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 +20 -10
- 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 +20 -10
- 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 +20 -10
- 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 +20 -10
- 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 +9 -6
- package/dist/tools/warp_grep/providers/code_storage_http.cjs.map +1 -1
- package/dist/tools/warp_grep/providers/code_storage_http.d.ts +4 -2
- package/dist/tools/warp_grep/providers/code_storage_http.js +1 -1
- package/dist/tools/warp_grep/providers/remote.d.ts +1 -1
- package/dist/tools/warp_grep/vercel.cjs +20 -10
- 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-EL3PFPAG.js.map → chunk-3IEZFECM.js.map} +0 -0
- /package/dist/{chunk-WDTQSCEF.js.map → chunk-4HWDQEHY.js.map} +0 -0
- /package/dist/{chunk-QXQWVXR5.js.map → chunk-66LEBVGY.js.map} +0 -0
- /package/dist/{chunk-SQPH6GIE.js.map → chunk-ANR7MZB6.js.map} +0 -0
- /package/dist/{chunk-KSGVHWG7.js.map → chunk-AYJIJUIN.js.map} +0 -0
- /package/dist/{chunk-N46EHRKD.js.map → chunk-BEOWFUOS.js.map} +0 -0
- /package/dist/{chunk-B2M45EM7.js.map → chunk-BG66V2TL.js.map} +0 -0
- /package/dist/{chunk-XT6Y3YWD.js.map → chunk-BJVN7D5S.js.map} +0 -0
- /package/dist/{chunk-6QEN3GDU.js.map → chunk-FAN67CEH.js.map} +0 -0
- /package/dist/{chunk-3FSNRVGX.js.map → chunk-GACWZPES.js.map} +0 -0
- /package/dist/{chunk-TZAYSJTA.js.map → chunk-HBAPH52R.js.map} +0 -0
- /package/dist/{chunk-FA2UYSGI.js.map → chunk-I47HR32K.js.map} +0 -0
- /package/dist/{chunk-WWB6LGTC.js.map → chunk-I7VZH73D.js.map} +0 -0
- /package/dist/{chunk-23CLZZMU.js.map → chunk-JPRHFZJS.js.map} +0 -0
- /package/dist/{chunk-FHKHINJ6.js.map → chunk-JTDEEUUQ.js.map} +0 -0
- /package/dist/{chunk-A757WPBG.js.map → chunk-KCX33EXW.js.map} +0 -0
- /package/dist/{chunk-5RJM5O2N.js.map → chunk-KRMJ6TY5.js.map} +0 -0
- /package/dist/{chunk-EUPISPLN.js.map → chunk-MWBVO2OZ.js.map} +0 -0
- /package/dist/{chunk-DBLW6DDW.js.map → chunk-NN35VBFL.js.map} +0 -0
- /package/dist/{chunk-YO5BQMSP.js.map → chunk-NQQ7L4IO.js.map} +0 -0
- /package/dist/{chunk-QYPZL2IU.js.map → chunk-NWB3HJGZ.js.map} +0 -0
- /package/dist/{chunk-V5NMFRJ4.js.map → chunk-S2BRHJWT.js.map} +0 -0
- /package/dist/{chunk-3OFDPEWP.js.map → chunk-TT4HS35C.js.map} +0 -0
- /package/dist/{chunk-ZTGDTW4B.js.map → chunk-UZBH2ZAG.js.map} +0 -0
- /package/dist/{chunk-ED7EJHT4.js.map → chunk-V3ACYBJJ.js.map} +0 -0
- /package/dist/{chunk-PSY52HPS.js.map → chunk-V5OI2UIY.js.map} +0 -0
- /package/dist/{chunk-DYWXVFUT.js.map → chunk-VO7KLNE5.js.map} +0 -0
- /package/dist/{chunk-SY65P6FE.js.map → chunk-XXMIVX3H.js.map} +0 -0
- /package/dist/{chunk-A5SAWVC3.js.map → chunk-XZ6NDGZV.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-XZ6NDGZV.js";
|
|
9
9
|
import "../../chunk-Q6QCHAMD.js";
|
|
10
10
|
import {
|
|
11
11
|
formatResult
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-K7PNYXHA.js";
|
|
13
13
|
import "../../chunk-63VHBANJ.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-BEOWFUOS.js";
|
|
15
|
+
import "../../chunk-ZMKLSBIM.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-AYJIJUIN.js";
|
|
21
|
+
import "../../chunk-I7VZH73D.js";
|
|
22
|
+
import "../../chunk-JTDEEUUQ.js";
|
|
23
23
|
import "../../chunk-F3NCFNUX.js";
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-BJVN7D5S.js";
|
|
25
|
+
import "../../chunk-3IEZFECM.js";
|
|
26
|
+
import "../../chunk-ZDMK3OPO.js";
|
|
27
27
|
import "../../chunk-LKFZBBTD.js";
|
|
28
28
|
import "../../chunk-PZ5AY32C.js";
|
|
29
29
|
export {
|
|
@@ -23,10 +23,13 @@ __export(code_storage_http_exports, {
|
|
|
23
23
|
createCodeStorageHttpCommands: () => createCodeStorageHttpCommands
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(code_storage_http_exports);
|
|
26
|
-
async function post(url, body, op) {
|
|
26
|
+
async function post(url, body, op, apiKey) {
|
|
27
27
|
const res = await fetch(url, {
|
|
28
28
|
method: "POST",
|
|
29
|
-
headers: {
|
|
29
|
+
headers: {
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
|
+
...apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
|
|
32
|
+
},
|
|
30
33
|
body: JSON.stringify(body)
|
|
31
34
|
});
|
|
32
35
|
if (!res.ok) {
|
|
@@ -43,12 +46,12 @@ async function post(url, body, op) {
|
|
|
43
46
|
return data.stdout;
|
|
44
47
|
}
|
|
45
48
|
function createCodeStorageHttpCommands(config) {
|
|
46
|
-
const { baseUrl, repoId, branch } = config;
|
|
49
|
+
const { baseUrl, repoId, branch, apiKey } = config;
|
|
47
50
|
const encodedRepoId = encodeURIComponent(repoId);
|
|
48
51
|
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")
|
|
52
|
+
grep: (pattern, path, glob) => post(`${baseUrl}/api/code-search/${encodedRepoId}/grep`, { pattern, path, glob, branch }, "grep", apiKey),
|
|
53
|
+
read: (path, start, end) => post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path, start, end, branch }, "read", apiKey),
|
|
54
|
+
listDir: (path, maxDepth) => post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path, maxDepth, branch }, "list", apiKey)
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -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\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, glob, branch }, 'grep', apiKey),\n\n read: (path: string, start: number, end: number) =>\n post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path, start, end, branch }, 'read', apiKey),\n\n listDir: (path: string, maxDepth: number) =>\n post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path, maxDepth, branch }, 'list', apiKey),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBA,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,MAAM,OAAO,GAAG,QAAQ,MAAM;AAAA,IAE1G,MAAM,CAAC,MAAc,OAAe,QAClC,KAAK,GAAG,OAAO,oBAAoB,aAAa,SAAS,EAAE,MAAM,OAAO,KAAK,OAAO,GAAG,QAAQ,MAAM;AAAA,IAEvG,SAAS,CAAC,MAAc,aACtB,KAAK,GAAG,OAAO,oBAAoB,aAAa,SAAS,EAAE,MAAM,UAAU,OAAO,GAAG,QAAQ,MAAM;AAAA,EACvG;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
|
|
|
@@ -11,12 +11,14 @@ import '../../utils/resilience.js';
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
interface CodeStorageHttpConfig {
|
|
14
|
-
/** Base URL for the code search API (e.g. "https://morphllm.com") */
|
|
14
|
+
/** Base URL for the code search API (e.g. "https://api.morphllm.com") */
|
|
15
15
|
baseUrl: string;
|
|
16
16
|
/** Repository ID returned by the get-or-create endpoint */
|
|
17
17
|
repoId: string;
|
|
18
18
|
/** Git branch to search */
|
|
19
19
|
branch: string;
|
|
20
|
+
/** Morph API key, forwarded as a Bearer token (api.morphllm.com requires it) */
|
|
21
|
+
apiKey?: string;
|
|
20
22
|
}
|
|
21
23
|
declare function createCodeStorageHttpCommands(config: CodeStorageHttpConfig): RemoteCommands;
|
|
22
24
|
|
|
@@ -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
|
/**
|
|
@@ -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.190",
|
|
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,13 @@ var RemoteCommandsProvider = class {
|
|
|
1864
1864
|
};
|
|
1865
1865
|
|
|
1866
1866
|
// tools/warp_grep/providers/code_storage_http.ts
|
|
1867
|
-
async function post(url, body, op) {
|
|
1867
|
+
async function post(url, body, op, apiKey) {
|
|
1868
1868
|
const res = await fetch(url, {
|
|
1869
1869
|
method: "POST",
|
|
1870
|
-
headers: {
|
|
1870
|
+
headers: {
|
|
1871
|
+
"Content-Type": "application/json",
|
|
1872
|
+
...apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
|
|
1873
|
+
},
|
|
1871
1874
|
body: JSON.stringify(body)
|
|
1872
1875
|
});
|
|
1873
1876
|
if (!res.ok) {
|
|
@@ -1884,12 +1887,12 @@ async function post(url, body, op) {
|
|
|
1884
1887
|
return data.stdout;
|
|
1885
1888
|
}
|
|
1886
1889
|
function createCodeStorageHttpCommands(config) {
|
|
1887
|
-
const { baseUrl, repoId, branch } = config;
|
|
1890
|
+
const { baseUrl, repoId, branch, apiKey } = config;
|
|
1888
1891
|
const encodedRepoId = encodeURIComponent(repoId);
|
|
1889
1892
|
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")
|
|
1893
|
+
grep: (pattern, path6, glob) => post(`${baseUrl}/api/code-search/${encodedRepoId}/grep`, { pattern, path: path6, glob, branch }, "grep", apiKey),
|
|
1894
|
+
read: (path6, start, end) => post(`${baseUrl}/api/code-search/${encodedRepoId}/read`, { path: path6, start, end, branch }, "read", apiKey),
|
|
1895
|
+
listDir: (path6, maxDepth) => post(`${baseUrl}/api/code-search/${encodedRepoId}/list`, { path: path6, maxDepth, branch }, "list", apiKey)
|
|
1893
1896
|
};
|
|
1894
1897
|
}
|
|
1895
1898
|
|
|
@@ -2230,7 +2233,7 @@ async function compactFileContexts(files, query, apiKey, apiUrl, maxTokens = 1e4
|
|
|
2230
2233
|
}
|
|
2231
2234
|
|
|
2232
2235
|
// tools/warp_grep/client.ts
|
|
2233
|
-
var DEFAULT_CODE_SEARCH_URL = "https://morphllm.com";
|
|
2236
|
+
var DEFAULT_CODE_SEARCH_URL = "https://api.morphllm.com";
|
|
2234
2237
|
async function getLocalProvider(repoRoot, excludes, allowNames) {
|
|
2235
2238
|
const { LocalRipgrepProvider: LocalRipgrepProvider2 } = await Promise.resolve().then(() => (init_local(), local_exports));
|
|
2236
2239
|
const opts = allowNames?.length ? { allowNames } : void 0;
|
|
@@ -2306,7 +2309,9 @@ var WarpGrepClient = class extends APIResource {
|
|
|
2306
2309
|
const baseUrl = this.config.codeSearchUrl || DEFAULT_CODE_SEARCH_URL;
|
|
2307
2310
|
logger.debug("WarpGrep", "github_resolve", { owner_repo: `${owner}/${repo}`, branch: input.branch });
|
|
2308
2311
|
const resolveStart = Date.now();
|
|
2309
|
-
const importRes = await fetch(`${baseUrl}/api/code-search/get-or-create?url=${encodeURIComponent(`${owner}/${repo}`)}
|
|
2312
|
+
const importRes = await fetch(`${baseUrl}/api/code-search/get-or-create?url=${encodeURIComponent(`${owner}/${repo}`)}`, {
|
|
2313
|
+
headers: this.config.morphApiKey ? { Authorization: `Bearer ${this.config.morphApiKey}` } : void 0
|
|
2314
|
+
});
|
|
2310
2315
|
if (!importRes.ok) {
|
|
2311
2316
|
const text = await importRes.text().catch(() => importRes.statusText);
|
|
2312
2317
|
logger.error("WarpGrep", "github_resolve_failed", { owner_repo: `${owner}/${repo}`, status: importRes.status, error: text });
|
|
@@ -2316,7 +2321,12 @@ var WarpGrepClient = class extends APIResource {
|
|
|
2316
2321
|
logger.debug("WarpGrep", "github_repo_fetched", { repo_id: repoId, default_branch: defaultBranch, latency_ms: Date.now() - resolveStart });
|
|
2317
2322
|
return {
|
|
2318
2323
|
repo,
|
|
2319
|
-
remoteCommands: createCodeStorageHttpCommands({
|
|
2324
|
+
remoteCommands: createCodeStorageHttpCommands({
|
|
2325
|
+
baseUrl,
|
|
2326
|
+
repoId,
|
|
2327
|
+
branch: input.branch || defaultBranch,
|
|
2328
|
+
apiKey: this.config.morphApiKey
|
|
2329
|
+
})
|
|
2320
2330
|
};
|
|
2321
2331
|
}
|
|
2322
2332
|
async _searchGitHubAsync(input) {
|