@morphllm/morphsdk 0.2.201 → 0.2.203
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-2PPYWRMZ.js +3 -4
- package/dist/{chunk-DBNSOYQ3.js → chunk-2UIOCSVJ.js} +3 -24
- package/dist/chunk-44OIEPIO.js +4 -23
- package/dist/chunk-4EQQGUZ7.cjs +104 -0
- package/dist/chunk-4OUGA3KS.js +1 -5
- package/dist/chunk-4R5MDGL6.cjs +280 -0
- package/dist/chunk-65W4I66Q.cjs +103 -0
- package/dist/{chunk-WBTXEJOC.js → chunk-66THRMD7.js} +10 -35
- package/dist/chunk-6TZCVTW5.js +3 -4
- package/dist/chunk-6WP7EA4F.js +2 -4
- package/dist/chunk-74A4HLIO.cjs +42 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-7NA7X7W2.cjs +77 -0
- package/dist/chunk-7PJYY46L.cjs +2 -0
- package/dist/chunk-AFF6XYKL.cjs +71 -0
- package/dist/{chunk-P2KW2O5R.js → chunk-AJBZA23L.js} +3 -25
- package/dist/chunk-AWFZKS27.cjs +11 -0
- package/dist/{chunk-FVT4PU4I.js → chunk-AXEKIRRY.js} +22 -62
- package/dist/chunk-B3FD67F2.cjs +256 -0
- package/dist/chunk-BJBWWIZV.cjs +2 -0
- package/dist/{chunk-M6AVXUM4.js → chunk-E3XNKAMI.js} +5 -15
- package/dist/{chunk-TS3OJ4LA.js → chunk-E7FLETFO.js} +2 -8
- package/dist/{chunk-EQAWWVKV.js → chunk-EI2M567U.js} +2 -6
- package/dist/chunk-EJTL2BOZ.cjs +42 -0
- package/dist/chunk-ETBRAKVV.js +1 -5
- package/dist/{chunk-VOXUA5ZH.js → chunk-EZ2OFDBJ.js} +5 -19
- package/dist/chunk-FBOZIVVQ.js +1 -0
- package/dist/{chunk-TZC3EOZS.js → chunk-GDFPZ3NJ.js} +4 -19
- package/dist/{chunk-LISSWRUD.js → chunk-GIQAIHUI.js} +8 -33
- package/dist/chunk-GSUQGDCL.cjs +235 -0
- package/dist/{chunk-5NSYDT36.js → chunk-H3HRSRR5.js} +4 -12
- package/dist/chunk-HDP4QAZL.js +1 -4
- package/dist/chunk-HMLYJVZM.cjs +410 -0
- package/dist/chunk-IPJA3ZS6.cjs +10 -0
- package/dist/{chunk-B376VMIH.js → chunk-IUM6CQYX.js} +3 -12
- package/dist/{chunk-OVLUL5AC.js → chunk-J56Q6C4Y.js} +4 -18
- package/dist/chunk-JBTR3FQD.cjs +135 -0
- package/dist/chunk-JNQKQKHS.cjs +81 -0
- package/dist/chunk-JOZC4T6C.cjs +168 -0
- package/dist/{chunk-ILY5N5NJ.js → chunk-JUGNTIVU.js} +6 -19
- package/dist/{chunk-SU7AAS3O.js → chunk-JY6COF3X.js} +5 -22
- package/dist/{chunk-JBAY3PRV.js → chunk-KLVJIC2O.js} +5 -17
- package/dist/chunk-KSZYOX6S.cjs +91 -0
- package/dist/chunk-KVGZ2TSG.cjs +274 -0
- package/dist/chunk-LDM7RNNN.js +1 -0
- package/dist/{chunk-RZOJ4GSY.js → chunk-LLQH6CCB.js} +10 -28
- package/dist/chunk-M34E2AMK.js +1 -5
- package/dist/chunk-MF56KEI4.js +1 -4
- package/dist/chunk-MLKGABMK.js +1 -3
- package/dist/{chunk-I26FQELI.js → chunk-MLPZKUCO.js} +11 -5
- package/dist/chunk-MWXJ6DZ2.cjs +21 -0
- package/dist/{chunk-NWGRW4V7.js → chunk-N7UKZ5X7.js} +2 -6
- package/dist/chunk-NDUC7OV6.cjs +74 -0
- package/dist/{chunk-RJXAXR7Q.js → chunk-NLACTMZT.js} +6 -19
- package/dist/chunk-NNKBKENK.cjs +15 -0
- package/dist/chunk-NRG6QX3L.js +1 -3
- package/dist/chunk-OCCGJ4S6.js +8 -0
- package/dist/chunk-ODY2NKQU.cjs +50 -0
- package/dist/chunk-OM5ZSXQW.cjs +91 -0
- package/dist/chunk-OOEORM7H.cjs +334 -0
- package/dist/chunk-OPDWMD4Q.js +1 -3
- package/dist/{chunk-BZXOAC2R.js → chunk-OSL4CNSO.js} +7 -23
- package/dist/chunk-OXXMTDOY.cjs +86 -0
- package/dist/chunk-PA3UTI4A.js +1 -4
- package/dist/chunk-QEEAIXL5.cjs +74 -0
- package/dist/chunk-RYVW7RUM.js +2 -6
- package/dist/chunk-S6QBPXBI.cjs +107 -0
- package/dist/chunk-TL34BLQD.cjs +10 -0
- package/dist/chunk-TPZHMD7J.cjs +72 -0
- package/dist/chunk-UAPK3AIJ.js +1 -10
- package/dist/chunk-UF5IKELS.cjs +26 -0
- package/dist/chunk-UNX7V6P6.cjs +60 -0
- package/dist/chunk-UUCRWJJR.cjs +313 -0
- package/dist/chunk-VDFLPO7B.cjs +396 -0
- package/dist/chunk-VHD7CW5O.cjs +43 -0
- package/dist/chunk-VL4QNALG.cjs +50 -0
- package/dist/chunk-WR7LSUIR.cjs +213 -0
- package/dist/chunk-XE6D4J63.cjs +72 -0
- package/dist/chunk-ZLG2M2I4.cjs +21 -0
- package/dist/chunk-ZSHVXDA2.js +4 -10
- package/dist/client.cjs +40 -4353
- package/dist/client.js +32 -37
- package/dist/core/client.cjs +10 -476
- package/dist/core/client.js +6 -11
- package/dist/core/error.cjs +8 -251
- package/dist/core/error.js +4 -9
- package/dist/core/index.cjs +20 -488
- package/dist/core/index.js +8 -19
- package/dist/core/resource.cjs +9 -33
- package/dist/core/resource.js +2 -7
- package/dist/edge.cjs +62 -1111
- package/dist/edge.js +10 -42
- package/dist/index.cjs +115 -4424
- package/dist/index.js +39 -87
- package/dist/modelrouter/core.cjs +28 -648
- package/dist/modelrouter/core.js +8 -21
- package/dist/modelrouter/index.cjs +28 -648
- package/dist/modelrouter/index.js +8 -21
- package/dist/modelrouter/types.cjs +1 -17
- package/dist/modelrouter/types.js +1 -0
- package/dist/subagents/anthropic.cjs +27 -2777
- package/dist/subagents/anthropic.js +19 -24
- package/dist/subagents/index.cjs +14 -95
- package/dist/subagents/index.js +2 -11
- package/dist/subagents/prompts.cjs +14 -93
- package/dist/subagents/prompts.js +2 -11
- package/dist/subagents/types.cjs +1 -17
- package/dist/subagents/types.js +1 -0
- package/dist/subagents/vercel.cjs +27 -2754
- package/dist/subagents/vercel.js +19 -24
- package/dist/tools/compact/core.cjs +12 -548
- package/dist/tools/compact/core.js +8 -13
- package/dist/tools/compact/index.cjs +17 -595
- package/dist/tools/compact/index.js +9 -17
- package/dist/tools/compact/types.cjs +1 -17
- package/dist/tools/compact/types.js +1 -0
- package/dist/tools/fastapply/anthropic.cjs +27 -891
- package/dist/tools/fastapply/anthropic.js +11 -24
- package/dist/tools/fastapply/apply.cjs +28 -672
- package/dist/tools/fastapply/apply.js +4 -19
- package/dist/tools/fastapply/core.cjs +37 -1061
- package/dist/tools/fastapply/core.js +9 -29
- package/dist/tools/fastapply/index.cjs +62 -1062
- package/dist/tools/fastapply/index.js +14 -44
- package/dist/tools/fastapply/openai.cjs +32 -901
- package/dist/tools/fastapply/openai.js +11 -26
- package/dist/tools/fastapply/prompts.cjs +10 -62
- package/dist/tools/fastapply/prompts.js +2 -9
- package/dist/tools/fastapply/types.cjs +1 -17
- package/dist/tools/fastapply/types.js +1 -0
- package/dist/tools/fastapply/vercel.cjs +25 -897
- package/dist/tools/fastapply/vercel.js +11 -22
- package/dist/tools/index.cjs +62 -1062
- package/dist/tools/index.js +14 -44
- package/dist/tools/utils/resilience.cjs +15 -312
- package/dist/tools/utils/resilience.js +3 -12
- package/dist/tools/warp_grep/agent/config.cjs +16 -127
- package/dist/tools/warp_grep/agent/config.js +2 -11
- package/dist/tools/warp_grep/agent/formatter.cjs +12 -48
- package/dist/tools/warp_grep/agent/formatter.js +2 -9
- package/dist/tools/warp_grep/agent/parser.cjs +16 -83
- package/dist/tools/warp_grep/agent/parser.js +2 -11
- package/dist/tools/warp_grep/agent/runner.cjs +15 -1081
- package/dist/tools/warp_grep/agent/runner.js +7 -14
- package/dist/tools/warp_grep/agent/types.cjs +1 -17
- package/dist/tools/warp_grep/agent/types.js +1 -0
- package/dist/tools/warp_grep/anthropic.cjs +47 -2554
- package/dist/tools/warp_grep/anthropic.js +19 -35
- package/dist/tools/warp_grep/client.cjs +49 -2464
- package/dist/tools/warp_grep/client.js +17 -34
- package/dist/tools/warp_grep/gemini.cjs +48 -2483
- package/dist/tools/warp_grep/gemini.js +21 -41
- package/dist/tools/warp_grep/harness.cjs +81 -929
- package/dist/tools/warp_grep/harness.js +12 -51
- package/dist/tools/warp_grep/index.cjs +124 -2568
- package/dist/tools/warp_grep/index.js +24 -87
- package/dist/tools/warp_grep/openai.cjs +53 -2568
- package/dist/tools/warp_grep/openai.js +19 -37
- package/dist/tools/warp_grep/providers/code_storage_http.cjs +12 -65
- package/dist/tools/warp_grep/providers/code_storage_http.js +2 -9
- package/dist/tools/warp_grep/providers/local.cjs +10 -582
- package/dist/tools/warp_grep/providers/local.js +6 -11
- package/dist/tools/warp_grep/providers/remote.cjs +8 -331
- package/dist/tools/warp_grep/providers/remote.js +3 -8
- package/dist/tools/warp_grep/providers/types.cjs +1 -17
- package/dist/tools/warp_grep/providers/types.js +1 -0
- package/dist/tools/warp_grep/utils/files.cjs +9 -42
- package/dist/tools/warp_grep/utils/files.js +2 -7
- package/dist/tools/warp_grep/utils/github.cjs +9 -43
- package/dist/tools/warp_grep/utils/github.js +2 -7
- package/dist/tools/warp_grep/utils/paths.cjs +28 -104
- package/dist/tools/warp_grep/utils/paths.js +2 -17
- package/dist/tools/warp_grep/utils/ripgrep.cjs +9 -86
- package/dist/tools/warp_grep/utils/ripgrep.js +2 -7
- package/dist/tools/warp_grep/vercel.cjs +53 -2550
- package/dist/tools/warp_grep/vercel.js +19 -37
- package/dist/version.cjs +7 -225
- package/dist/version.js +2 -7
- package/package.json +2 -2
- package/dist/chunk-UZCXOOZO.js +0 -203
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SDK_VERSION
|
|
3
|
-
} from "./chunk-UZCXOOZO.js";
|
|
1
|
+
import { SDK_VERSION } from './chunk-OCCGJ4S6.js';
|
|
4
2
|
|
|
5
3
|
// tools/utils/resilience.ts
|
|
6
4
|
var DEFAULT_RETRY_CONFIG = {
|
|
@@ -86,8 +84,4 @@ var MorphError = class extends Error {
|
|
|
86
84
|
}
|
|
87
85
|
};
|
|
88
86
|
|
|
89
|
-
export {
|
|
90
|
-
fetchWithRetry,
|
|
91
|
-
withTimeout,
|
|
92
|
-
MorphError
|
|
93
|
-
};
|
|
87
|
+
export { MorphError, fetchWithRetry, withTimeout };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MorphError
|
|
3
|
-
} from "./chunk-TS3OJ4LA.js";
|
|
1
|
+
import { MorphError } from './chunk-E7FLETFO.js';
|
|
4
2
|
|
|
5
3
|
// core/error.ts
|
|
6
4
|
async function toMorphError(response) {
|
|
@@ -18,6 +16,4 @@ async function toMorphError(response) {
|
|
|
18
16
|
return new MorphError(message, code, response.status, retryable);
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
export {
|
|
22
|
-
toMorphError
|
|
23
|
-
};
|
|
19
|
+
export { toMorphError };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// tools/warp_grep/prompts.ts
|
|
4
|
+
var WARP_GREP_TOOL_NAME = "codebase_search";
|
|
5
|
+
var WARP_GREP_DESCRIPTION = 'Very fast code search exploration subagent (not a grep tool) that runs parallel grep and file read calls over multiple turns to locate relevant files and line ranges. The search term should be a targeted natural-language query describing what you are trying to find or accomplish, e.g. "Find where authentication requests are handled in the Express routes" or "How do callers of processOrder handle the error case?". Fill in extra context you can infer to make the query specific. Do not pass bare keywords or symbol names \u2014 use grep directly for exact symbol lookups. Use this tool first when exploring unfamiliar code. The results may be partial \u2014 follow up with classical search tools or direct file reads if needed.';
|
|
6
|
+
var GITHUB_WARP_GREP_SEARCH_TOOL_NAME = "github_codebase_search";
|
|
7
|
+
var GITHUB_WARP_GREP_SEARCH_DESCRIPTION = "Always use this when debugging errors in third-party dependencies to check for upstream fixes, open issues, or newer code pathsSearch tool for public GitHub repositories.Code search exploration subagent for public GitHub repositories (not your local workspace \u2014 use codebase_search for that). Runs parallel grep and file read calls to locate relevant files and line ranges in external github repositories without cloning the repository. Pass a targeted natural-language query, not bare keywords. Useful for understanding how a library works or investigating upstream bugs. You must provide either github_url or owner_repo (at least one required). ";
|
|
8
|
+
var GITHUB_WARP_GREP_SEARCH_INPUT_SCHEMA = {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
search_term: { type: "string", description: 'A targeted natural-language query describing what to find (e.g. "How does auth work for SSO users?"). Not a keyword or symbol name.' },
|
|
12
|
+
github_url: { type: "string", description: 'GitHub repository URL to search (e.g. "https://github.com/vercel/next.js"). You must provide either github_url or owner_repo.' },
|
|
13
|
+
owner_repo: { type: "string", description: 'Repository owner/repo shorthand (e.g. "vercel/next.js"). You must provide either github_url or owner_repo.' },
|
|
14
|
+
branch: { type: "string", description: "Branch to search (defaults to the repository default branch)" }
|
|
15
|
+
},
|
|
16
|
+
required: ["search_term"]
|
|
17
|
+
};
|
|
18
|
+
var GITHUB_SEARCH_TOOL_NAME = GITHUB_WARP_GREP_SEARCH_TOOL_NAME;
|
|
19
|
+
var GITHUB_SEARCH_DESCRIPTION = GITHUB_WARP_GREP_SEARCH_DESCRIPTION;
|
|
20
|
+
var GITHUB_SEARCH_INPUT_SCHEMA = GITHUB_WARP_GREP_SEARCH_INPUT_SCHEMA;
|
|
21
|
+
var GITHUB_READ_FILE_TOOL_NAME = "readfile_github_search";
|
|
22
|
+
var GITHUB_READ_FILE_DESCRIPTION = "Read a single file (or a line range) from a public GitHub repository. ONLY USE THIS WHEN YOU ALREADY KNOW THE EXACT FILE PATH YOU WANT TO READ, for example after finding it via github_codebase_search results. Takes owner/repo shorthand and the file path within the repo. Optionally specify startLine and endLine (1-based) to read a specific range. Returns the file content with line numbers.";
|
|
23
|
+
var GITHUB_READ_FILE_INPUT_SCHEMA = {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
github: { type: "string", description: 'owner/repo shorthand (e.g., "vercel/next.js")' },
|
|
27
|
+
path: { type: "string", description: 'File path within the repository (e.g., "src/server/index.ts")' },
|
|
28
|
+
startLine: { type: "number", description: "Start line number (1-based). Omit to start from beginning." },
|
|
29
|
+
endLine: { type: "number", description: "End line number (1-based, inclusive). Omit to read to the end." },
|
|
30
|
+
branch: { type: "string", description: "Branch to read from (defaults to the repository default branch)" }
|
|
31
|
+
},
|
|
32
|
+
required: ["github", "path"]
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.GITHUB_READ_FILE_DESCRIPTION = GITHUB_READ_FILE_DESCRIPTION;
|
|
36
|
+
exports.GITHUB_READ_FILE_INPUT_SCHEMA = GITHUB_READ_FILE_INPUT_SCHEMA;
|
|
37
|
+
exports.GITHUB_READ_FILE_TOOL_NAME = GITHUB_READ_FILE_TOOL_NAME;
|
|
38
|
+
exports.GITHUB_SEARCH_DESCRIPTION = GITHUB_SEARCH_DESCRIPTION;
|
|
39
|
+
exports.GITHUB_SEARCH_INPUT_SCHEMA = GITHUB_SEARCH_INPUT_SCHEMA;
|
|
40
|
+
exports.GITHUB_SEARCH_TOOL_NAME = GITHUB_SEARCH_TOOL_NAME;
|
|
41
|
+
exports.WARP_GREP_DESCRIPTION = WARP_GREP_DESCRIPTION;
|
|
42
|
+
exports.WARP_GREP_TOOL_NAME = WARP_GREP_TOOL_NAME;
|
package/dist/chunk-ETBRAKVV.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from
|
|
4
|
-
import {
|
|
5
|
-
logger
|
|
6
|
-
} from "./chunk-6WP7EA4F.js";
|
|
7
|
-
import {
|
|
8
|
-
MorphError
|
|
9
|
-
} from "./chunk-TS3OJ4LA.js";
|
|
10
|
-
import {
|
|
11
|
-
APIResource
|
|
12
|
-
} from "./chunk-NRG6QX3L.js";
|
|
1
|
+
import { MorphAPIClient } from './chunk-KLVJIC2O.js';
|
|
2
|
+
import { logger } from './chunk-6WP7EA4F.js';
|
|
3
|
+
import { MorphError } from './chunk-E7FLETFO.js';
|
|
4
|
+
import { APIResource } from './chunk-NRG6QX3L.js';
|
|
13
5
|
|
|
14
6
|
// modelrouter/core.ts
|
|
15
7
|
var DEFAULT_API_URL = "https://api.morphllm.com";
|
|
@@ -167,10 +159,4 @@ var RouterClassifier = class extends APIResource {
|
|
|
167
159
|
}
|
|
168
160
|
};
|
|
169
161
|
|
|
170
|
-
export {
|
|
171
|
-
OpenAIRouter,
|
|
172
|
-
AnthropicRouter,
|
|
173
|
-
GeminiRouter,
|
|
174
|
-
RawRouter,
|
|
175
|
-
RouterClassifier
|
|
176
|
-
};
|
|
162
|
+
export { AnthropicRouter, GeminiRouter, OpenAIRouter, RawRouter, RouterClassifier };
|
package/dist/chunk-FBOZIVVQ.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-PA3UTI4A.js";
|
|
5
|
-
import {
|
|
6
|
-
executeEditFile
|
|
7
|
-
} from "./chunk-RZOJ4GSY.js";
|
|
8
|
-
import {
|
|
9
|
-
__export
|
|
10
|
-
} from "./chunk-MLKGABMK.js";
|
|
1
|
+
import { EDIT_FILE_TOOL_DESCRIPTION, EDIT_FILE_SYSTEM_PROMPT } from './chunk-PA3UTI4A.js';
|
|
2
|
+
import { executeEditFile } from './chunk-LLQH6CCB.js';
|
|
3
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
11
4
|
|
|
12
5
|
// tools/fastapply/openai.ts
|
|
13
6
|
var openai_exports = {};
|
|
@@ -82,12 +75,4 @@ function createEditFileTool(config = {}) {
|
|
|
82
75
|
}
|
|
83
76
|
var openai_default = editFileTool;
|
|
84
77
|
|
|
85
|
-
export {
|
|
86
|
-
editFileTool,
|
|
87
|
-
execute,
|
|
88
|
-
getSystemPrompt,
|
|
89
|
-
formatResult,
|
|
90
|
-
createEditFileTool,
|
|
91
|
-
openai_default,
|
|
92
|
-
openai_exports
|
|
93
|
-
};
|
|
78
|
+
export { createEditFileTool, editFileTool, execute, formatResult, getSystemPrompt, openai_default, openai_exports };
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
toolGrep,
|
|
9
|
-
toolListDirectory,
|
|
10
|
-
toolRead
|
|
11
|
-
} from "./chunk-44OIEPIO.js";
|
|
12
|
-
import {
|
|
13
|
-
AGENT_CONFIG,
|
|
14
|
-
DEFAULT_MODEL
|
|
15
|
-
} from "./chunk-M34E2AMK.js";
|
|
16
|
-
import {
|
|
17
|
-
extractPathFromCommand,
|
|
18
|
-
parseFinishFiles,
|
|
19
|
-
parseReadLines
|
|
20
|
-
} from "./chunk-4OUGA3KS.js";
|
|
21
|
-
import {
|
|
22
|
-
logger
|
|
23
|
-
} from "./chunk-6WP7EA4F.js";
|
|
24
|
-
import {
|
|
25
|
-
SDK_VERSION
|
|
26
|
-
} from "./chunk-UZCXOOZO.js";
|
|
1
|
+
import { buildInitialState, enforceContextLimit, formatTurnMessage, calculateContextBudget, readFinishFiles, toolRead, toolListDirectory, toolGlob, toolGrep } from './chunk-44OIEPIO.js';
|
|
2
|
+
import { AGENT_CONFIG, DEFAULT_MODEL } from './chunk-M34E2AMK.js';
|
|
3
|
+
import { parseFinishFiles, parseReadLines, extractPathFromCommand } from './chunk-4OUGA3KS.js';
|
|
4
|
+
import { logger } from './chunk-6WP7EA4F.js';
|
|
5
|
+
import { SDK_VERSION } from './chunk-OCCGJ4S6.js';
|
|
6
|
+
import OpenAI from 'openai';
|
|
7
|
+
import path from 'path';
|
|
27
8
|
|
|
28
|
-
// tools/warp_grep/agent/runner.ts
|
|
29
|
-
import OpenAI from "openai";
|
|
30
|
-
import path from "path";
|
|
31
9
|
var DEFAULT_API_URL = "https://api.morphllm.com";
|
|
32
10
|
var TOOL_SPECS = [
|
|
33
11
|
{
|
|
@@ -421,7 +399,4 @@ async function runWarpGrep(config) {
|
|
|
421
399
|
return result.value;
|
|
422
400
|
}
|
|
423
401
|
|
|
424
|
-
export {
|
|
425
|
-
runWarpGrepStreaming,
|
|
426
|
-
runWarpGrep
|
|
427
|
-
};
|
|
402
|
+
export { runWarpGrep, runWarpGrepStreaming };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKSZYOX6S_cjs = require('./chunk-KSZYOX6S.cjs');
|
|
4
|
+
var chunkS6QBPXBI_cjs = require('./chunk-S6QBPXBI.cjs');
|
|
5
|
+
var chunk7NA7X7W2_cjs = require('./chunk-7NA7X7W2.cjs');
|
|
6
|
+
var chunkOXXMTDOY_cjs = require('./chunk-OXXMTDOY.cjs');
|
|
7
|
+
var chunkJNQKQKHS_cjs = require('./chunk-JNQKQKHS.cjs');
|
|
8
|
+
var chunkNDUC7OV6_cjs = require('./chunk-NDUC7OV6.cjs');
|
|
9
|
+
var chunkJBTR3FQD_cjs = require('./chunk-JBTR3FQD.cjs');
|
|
10
|
+
var chunk4R5MDGL6_cjs = require('./chunk-4R5MDGL6.cjs');
|
|
11
|
+
var chunkB3FD67F2_cjs = require('./chunk-B3FD67F2.cjs');
|
|
12
|
+
var chunkUUCRWJJR_cjs = require('./chunk-UUCRWJJR.cjs');
|
|
13
|
+
var chunkJOZC4T6C_cjs = require('./chunk-JOZC4T6C.cjs');
|
|
14
|
+
var chunkAFF6XYKL_cjs = require('./chunk-AFF6XYKL.cjs');
|
|
15
|
+
var chunk65W4I66Q_cjs = require('./chunk-65W4I66Q.cjs');
|
|
16
|
+
var chunkVL4QNALG_cjs = require('./chunk-VL4QNALG.cjs');
|
|
17
|
+
|
|
18
|
+
// factories/openai.ts
|
|
19
|
+
var OpenAIToolFactory = class {
|
|
20
|
+
constructor(config) {
|
|
21
|
+
this.config = config;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create an OpenAI-compatible warp grep tool
|
|
25
|
+
*
|
|
26
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
27
|
+
* @returns OpenAI ChatCompletionTool with execute and formatResult methods
|
|
28
|
+
*/
|
|
29
|
+
createWarpGrepTool(toolConfig) {
|
|
30
|
+
return chunkKSZYOX6S_cjs.createWarpGrepTool({
|
|
31
|
+
...toolConfig,
|
|
32
|
+
morphApiKey: this.config.apiKey
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create an OpenAI-compatible edit file tool
|
|
37
|
+
*
|
|
38
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
39
|
+
* @returns OpenAI ChatCompletionTool with execute and formatResult methods
|
|
40
|
+
*/
|
|
41
|
+
createEditFileTool(toolConfig = {}) {
|
|
42
|
+
return chunkOXXMTDOY_cjs.createEditFileTool({
|
|
43
|
+
...toolConfig,
|
|
44
|
+
morphApiKey: this.config.apiKey
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Create an OpenAI-compatible GitHub search tool
|
|
49
|
+
*
|
|
50
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
51
|
+
* @returns OpenAI ChatCompletionTool with execute and formatResult methods
|
|
52
|
+
*/
|
|
53
|
+
createGitHubSearchTool(toolConfig) {
|
|
54
|
+
return chunkKSZYOX6S_cjs.createGitHubSearchTool({
|
|
55
|
+
...toolConfig,
|
|
56
|
+
morphApiKey: this.config.apiKey
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// factories/anthropic.ts
|
|
62
|
+
var AnthropicToolFactory = class {
|
|
63
|
+
constructor(config) {
|
|
64
|
+
this.config = config;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create an Anthropic-compatible warp grep tool
|
|
68
|
+
*
|
|
69
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
70
|
+
* @returns Anthropic Tool with execute and formatResult methods
|
|
71
|
+
*/
|
|
72
|
+
createWarpGrepTool(toolConfig) {
|
|
73
|
+
return chunk7NA7X7W2_cjs.createWarpGrepTool({
|
|
74
|
+
...toolConfig,
|
|
75
|
+
morphApiKey: this.config.apiKey
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create an Anthropic-compatible edit file tool
|
|
80
|
+
*
|
|
81
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
82
|
+
* @returns Anthropic Tool with execute and formatResult methods
|
|
83
|
+
*/
|
|
84
|
+
createEditFileTool(toolConfig = {}) {
|
|
85
|
+
return chunkNDUC7OV6_cjs.createEditFileTool({
|
|
86
|
+
...toolConfig,
|
|
87
|
+
morphApiKey: this.config.apiKey
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create an Anthropic-compatible GitHub search tool
|
|
92
|
+
*
|
|
93
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
94
|
+
* @returns Anthropic Tool with execute and formatResult methods
|
|
95
|
+
*/
|
|
96
|
+
createGitHubSearchTool(toolConfig) {
|
|
97
|
+
return chunk7NA7X7W2_cjs.createGitHubSearchTool({
|
|
98
|
+
...toolConfig,
|
|
99
|
+
morphApiKey: this.config.apiKey
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Create an Explore subagent that searches the codebase and returns summaries
|
|
104
|
+
*
|
|
105
|
+
* @param config - Subagent configuration including client and model (morphApiKey inherited from MorphClient)
|
|
106
|
+
* @returns Explore subagent with .tool, .run(), and .stream() methods
|
|
107
|
+
*/
|
|
108
|
+
createExploreSubagent(config) {
|
|
109
|
+
return chunk4R5MDGL6_cjs.createExploreSubagent({
|
|
110
|
+
...config,
|
|
111
|
+
morphApiKey: this.config.apiKey
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// factories/vercel.ts
|
|
117
|
+
var VercelToolFactory = class {
|
|
118
|
+
constructor(config) {
|
|
119
|
+
this.config = config;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Create a Vercel AI SDK-compatible warp grep tool
|
|
123
|
+
*
|
|
124
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
125
|
+
* @returns Vercel AI SDK tool
|
|
126
|
+
*/
|
|
127
|
+
createWarpGrepTool(toolConfig) {
|
|
128
|
+
return chunkS6QBPXBI_cjs.createWarpGrepTool({
|
|
129
|
+
...toolConfig,
|
|
130
|
+
morphApiKey: this.config.apiKey
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Create a Vercel AI SDK-compatible edit file tool
|
|
135
|
+
*
|
|
136
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
137
|
+
* @returns Vercel AI SDK tool
|
|
138
|
+
*/
|
|
139
|
+
createEditFileTool(toolConfig = {}) {
|
|
140
|
+
return chunkJNQKQKHS_cjs.createEditFileTool({
|
|
141
|
+
...toolConfig,
|
|
142
|
+
morphApiKey: this.config.apiKey
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Create a Vercel AI SDK-compatible GitHub search tool
|
|
147
|
+
*
|
|
148
|
+
* @param toolConfig - Tool configuration (morphApiKey inherited from MorphClient)
|
|
149
|
+
* @returns Vercel AI SDK tool
|
|
150
|
+
*/
|
|
151
|
+
createGitHubSearchTool(toolConfig) {
|
|
152
|
+
return chunkS6QBPXBI_cjs.createGitHubSearchTool({
|
|
153
|
+
...toolConfig,
|
|
154
|
+
morphApiKey: this.config.apiKey
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Create an Explore subagent that searches the codebase and returns summaries
|
|
159
|
+
*
|
|
160
|
+
* @param config - Subagent configuration including model (morphApiKey inherited from MorphClient)
|
|
161
|
+
* @returns Explore subagent with .tool, .run(), and .stream() methods
|
|
162
|
+
*/
|
|
163
|
+
createExploreSubagent(config) {
|
|
164
|
+
return chunkB3FD67F2_cjs.createExploreSubagent({
|
|
165
|
+
...config,
|
|
166
|
+
morphApiKey: this.config.apiKey
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// client.ts
|
|
172
|
+
var MorphClient = class extends chunk65W4I66Q_cjs.MorphAPIClient {
|
|
173
|
+
/** Client configuration */
|
|
174
|
+
config;
|
|
175
|
+
/** FastApply tool for editing files with AI-powered merge */
|
|
176
|
+
fastApply;
|
|
177
|
+
/** WarpGrep tool for fast code search using ripgrep */
|
|
178
|
+
warpGrep;
|
|
179
|
+
/** Model routers for intelligent model selection */
|
|
180
|
+
routers;
|
|
181
|
+
/** OpenAI-compatible tool factories */
|
|
182
|
+
openai;
|
|
183
|
+
/** Anthropic-compatible tool factories */
|
|
184
|
+
anthropic;
|
|
185
|
+
/** Vercel AI SDK tool factories */
|
|
186
|
+
vercel;
|
|
187
|
+
/** Compact context with line ranges */
|
|
188
|
+
compact;
|
|
189
|
+
/**
|
|
190
|
+
* Create a new Morph SDK client
|
|
191
|
+
*
|
|
192
|
+
* @param config - Client configuration (apiKey, debug, timeout, retryConfig)
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```typescript
|
|
196
|
+
* const morph = new MorphClient({
|
|
197
|
+
* apiKey: process.env.MORPH_API_KEY,
|
|
198
|
+
* debug: true,
|
|
199
|
+
* timeout: 60000
|
|
200
|
+
* });
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
constructor(config = {}) {
|
|
204
|
+
super({
|
|
205
|
+
apiKey: config.apiKey,
|
|
206
|
+
timeout: config.timeout,
|
|
207
|
+
retryConfig: config.retryConfig,
|
|
208
|
+
debug: config.debug
|
|
209
|
+
});
|
|
210
|
+
if (!config.apiKey) {
|
|
211
|
+
throw new Error("Morph API key is required. Pass it as { apiKey } when constructing MorphClient.");
|
|
212
|
+
}
|
|
213
|
+
this.config = config;
|
|
214
|
+
chunkVL4QNALG_cjs.logger.debug("MorphClient", "initialized", { debug: !!config.debug, timeout: config.timeout });
|
|
215
|
+
this.fastApply = new chunkJBTR3FQD_cjs.FastApplyClient(this);
|
|
216
|
+
this.warpGrep = new chunkUUCRWJJR_cjs.WarpGrepClient(this);
|
|
217
|
+
this.routers = {
|
|
218
|
+
openai: new chunkJOZC4T6C_cjs.OpenAIRouter(this),
|
|
219
|
+
anthropic: new chunkJOZC4T6C_cjs.AnthropicRouter(this),
|
|
220
|
+
gemini: new chunkJOZC4T6C_cjs.GeminiRouter(this),
|
|
221
|
+
raw: new chunkJOZC4T6C_cjs.RawRouter(this),
|
|
222
|
+
classify: new chunkJOZC4T6C_cjs.RouterClassifier(this)
|
|
223
|
+
};
|
|
224
|
+
const compactClient = new chunkAFF6XYKL_cjs.CompactClient(this);
|
|
225
|
+
this.compact = compactClient.compact.bind(compactClient);
|
|
226
|
+
this.openai = new OpenAIToolFactory(config);
|
|
227
|
+
this.anthropic = new AnthropicToolFactory(config);
|
|
228
|
+
this.vercel = new VercelToolFactory(config);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
exports.AnthropicToolFactory = AnthropicToolFactory;
|
|
233
|
+
exports.MorphClient = MorphClient;
|
|
234
|
+
exports.OpenAIToolFactory = OpenAIToolFactory;
|
|
235
|
+
exports.VercelToolFactory = VercelToolFactory;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from
|
|
4
|
-
import {
|
|
5
|
-
MorphError
|
|
6
|
-
} from "./chunk-TS3OJ4LA.js";
|
|
7
|
-
import {
|
|
8
|
-
APIResource
|
|
9
|
-
} from "./chunk-NRG6QX3L.js";
|
|
1
|
+
import { MorphAPIClient } from './chunk-KLVJIC2O.js';
|
|
2
|
+
import { MorphError } from './chunk-E7FLETFO.js';
|
|
3
|
+
import { APIResource } from './chunk-NRG6QX3L.js';
|
|
10
4
|
|
|
11
5
|
// tools/compact/core.ts
|
|
12
6
|
var DEFAULT_API_URL = "https://api.morphllm.com";
|
|
@@ -72,6 +66,4 @@ var CompactClient = class extends APIResource {
|
|
|
72
66
|
}
|
|
73
67
|
};
|
|
74
68
|
|
|
75
|
-
export {
|
|
76
|
-
CompactClient
|
|
77
|
-
};
|
|
69
|
+
export { CompactClient };
|