@morphllm/morphsdk 0.2.193 → 0.2.195
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/README.md +25 -1
- package/dist/ai-sdk/index.cjs +48 -0
- package/dist/ai-sdk/index.cjs.map +1 -0
- package/dist/ai-sdk/index.d.ts +29 -0
- package/dist/ai-sdk/index.js +23 -0
- package/dist/ai-sdk/index.js.map +1 -0
- package/dist/{chunk-YTQSM7JP.js → chunk-2YOE44FF.js} +9 -6
- package/dist/chunk-2YOE44FF.js.map +1 -0
- package/dist/{chunk-GXQXQMVG.js → chunk-35U2MW77.js} +4 -4
- package/dist/{chunk-6HVOMKED.js → chunk-4YWADZPB.js} +2 -2
- package/dist/{chunk-F3FIVK6A.js → chunk-6FVLHSQ6.js} +2 -2
- package/dist/{chunk-5JZHQGFA.js → chunk-6P4KCGAG.js} +2 -2
- package/dist/{chunk-3EVXYGJU.js → chunk-BSJVZEHN.js} +2 -2
- package/dist/{chunk-UEHQJLKC.js → chunk-DUPKDVNP.js} +2 -2
- package/dist/{chunk-ONP3JVU3.js → chunk-FC3HXR2Q.js} +2 -2
- package/dist/{chunk-Z5Y5WBGI.js → chunk-FNN5776O.js} +2 -2
- package/dist/{chunk-362NSH77.js → chunk-GWFZGS3Z.js} +2 -2
- package/dist/{chunk-TW3IQ357.js → chunk-H2YBEXR4.js} +2 -2
- package/dist/{chunk-UXSK2O6V.js → chunk-H353ZTXC.js} +2 -2
- package/dist/{chunk-LATNDSMS.js → chunk-HHKAZTGY.js} +2 -2
- package/dist/{chunk-SOZM3BG3.js → chunk-HLSOQ7MP.js} +3 -3
- package/dist/{chunk-N4LGEYGW.js → chunk-JGC6S5SB.js} +2 -2
- package/dist/{chunk-2BFAHP3U.js → chunk-K75R3X5V.js} +3 -3
- package/dist/{chunk-23KRET2F.js → chunk-KDVOJBKE.js} +3 -3
- package/dist/{chunk-MHWNJR5B.js → chunk-L7U5WS4B.js} +4 -4
- package/dist/{chunk-EQI6CRLJ.js → chunk-LNXRPEMK.js} +2 -2
- package/dist/{chunk-BMO22JIM.js → chunk-LOXY4VVO.js} +23 -23
- package/dist/{chunk-A7T7RKSW.js → chunk-LXRSNY7W.js} +2 -2
- package/dist/{chunk-FLWWY5IP.js → chunk-MPTEH2CO.js} +10 -4
- package/dist/chunk-MPTEH2CO.js.map +1 -0
- package/dist/{chunk-WLTBLDXJ.js → chunk-MUK6LFVY.js} +4 -4
- package/dist/{chunk-OQZOP2PQ.js → chunk-O3GWJKDO.js} +2 -2
- package/dist/{chunk-HQ3N3YAO.js → chunk-ORDOOXPQ.js} +2 -2
- package/dist/{chunk-PPABZ2FR.js → chunk-PSFKWZKR.js} +2 -2
- package/dist/{chunk-ZWJUC7YK.js → chunk-QGR6OVVY.js} +3 -3
- package/dist/{chunk-3GYCTQ3B.js → chunk-QSMGHCAG.js} +2 -2
- package/dist/{chunk-KGA3RGUQ.js → chunk-R5XYEQV6.js} +2 -2
- package/dist/{chunk-PI5TUSCU.js → chunk-SFLWBHK2.js} +2 -2
- package/dist/chunk-XUMLQ7AJ.js +399 -0
- package/dist/chunk-XUMLQ7AJ.js.map +1 -0
- package/dist/client.cjs +245 -28
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +29 -29
- package/dist/core/client.cjs +9 -3
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.js +4 -4
- package/dist/core/error.cjs +9 -3
- package/dist/core/error.cjs.map +1 -1
- package/dist/core/error.js +3 -3
- package/dist/core/index.cjs +9 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +4 -4
- package/dist/edge.cjs +233 -25
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.d.ts +1 -1
- package/dist/edge.js +9 -7
- package/dist/git/client.cjs +9 -3
- package/dist/git/client.cjs.map +1 -1
- package/dist/git/client.js +5 -5
- package/dist/git/index.cjs +9 -3
- package/dist/git/index.cjs.map +1 -1
- package/dist/git/index.js +5 -5
- package/dist/index.cjs +247 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -31
- package/dist/modelrouter/core.cjs +9 -3
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +5 -5
- package/dist/modelrouter/index.cjs +9 -3
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +5 -5
- package/dist/subagents/anthropic.cjs +9 -3
- package/dist/subagents/anthropic.cjs.map +1 -1
- package/dist/subagents/anthropic.js +9 -9
- package/dist/subagents/vercel.cjs +9 -3
- package/dist/subagents/vercel.cjs.map +1 -1
- package/dist/subagents/vercel.js +9 -9
- package/dist/tools/browser/anthropic.cjs +9 -3
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +7 -7
- package/dist/tools/browser/core.cjs +9 -3
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.js +6 -6
- package/dist/tools/browser/index.cjs +9 -3
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.js +9 -9
- package/dist/tools/browser/openai.cjs +9 -3
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +7 -7
- package/dist/tools/browser/profiles/core.cjs +9 -3
- 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 +9 -3
- 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 +9 -3
- package/dist/tools/browser/vercel.cjs.map +1 -1
- package/dist/tools/browser/vercel.js +7 -7
- package/dist/tools/codebase_search/anthropic.cjs +9 -3
- 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 +9 -3
- 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 +9 -3
- 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 +9 -3
- 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 +9 -3
- 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 +9 -3
- package/dist/tools/compact/core.cjs.map +1 -1
- package/dist/tools/compact/core.js +5 -5
- package/dist/tools/compact/index.cjs +9 -3
- package/dist/tools/compact/index.cjs.map +1 -1
- package/dist/tools/compact/index.js +6 -6
- package/dist/tools/fastapply/anthropic.cjs +245 -28
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +7 -7
- package/dist/tools/fastapply/apply.cjs +233 -25
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.d.ts +8 -1
- package/dist/tools/fastapply/apply.js +4 -2
- package/dist/tools/fastapply/core.cjs +247 -28
- package/dist/tools/fastapply/core.cjs.map +1 -1
- package/dist/tools/fastapply/core.d.ts +1 -1
- package/dist/tools/fastapply/core.js +8 -6
- package/dist/tools/fastapply/index.cjs +247 -28
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.d.ts +1 -1
- package/dist/tools/fastapply/index.js +11 -9
- package/dist/tools/fastapply/openai.cjs +245 -28
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +7 -7
- package/dist/tools/fastapply/types.cjs.map +1 -1
- package/dist/tools/fastapply/types.d.ts +10 -2
- package/dist/tools/fastapply/vercel.cjs +245 -28
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.js +7 -7
- package/dist/tools/index.cjs +247 -28
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +11 -9
- package/dist/tools/reflex/core.cjs +9 -3
- package/dist/tools/reflex/core.cjs.map +1 -1
- package/dist/tools/reflex/core.js +5 -5
- package/dist/tools/reflex/index.cjs +9 -3
- package/dist/tools/reflex/index.cjs.map +1 -1
- package/dist/tools/reflex/index.js +5 -5
- package/dist/tools/utils/resilience.cjs +9 -3
- 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 +9 -3
- 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 +9 -3
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +9 -9
- package/dist/tools/warp_grep/client.cjs +9 -3
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +8 -8
- package/dist/tools/warp_grep/gemini.cjs +9 -3
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +8 -8
- package/dist/tools/warp_grep/index.cjs +9 -3
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.js +8 -8
- package/dist/tools/warp_grep/openai.cjs +9 -3
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +9 -9
- package/dist/tools/warp_grep/vercel.cjs +9 -3
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +9 -9
- package/dist/version.cjs +9 -3
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -3
- package/dist/chunk-FLWWY5IP.js.map +0 -1
- package/dist/chunk-VPDOBYJE.js +0 -196
- package/dist/chunk-VPDOBYJE.js.map +0 -1
- package/dist/chunk-YTQSM7JP.js.map +0 -1
- /package/dist/{chunk-GXQXQMVG.js.map → chunk-35U2MW77.js.map} +0 -0
- /package/dist/{chunk-6HVOMKED.js.map → chunk-4YWADZPB.js.map} +0 -0
- /package/dist/{chunk-F3FIVK6A.js.map → chunk-6FVLHSQ6.js.map} +0 -0
- /package/dist/{chunk-5JZHQGFA.js.map → chunk-6P4KCGAG.js.map} +0 -0
- /package/dist/{chunk-3EVXYGJU.js.map → chunk-BSJVZEHN.js.map} +0 -0
- /package/dist/{chunk-UEHQJLKC.js.map → chunk-DUPKDVNP.js.map} +0 -0
- /package/dist/{chunk-ONP3JVU3.js.map → chunk-FC3HXR2Q.js.map} +0 -0
- /package/dist/{chunk-Z5Y5WBGI.js.map → chunk-FNN5776O.js.map} +0 -0
- /package/dist/{chunk-362NSH77.js.map → chunk-GWFZGS3Z.js.map} +0 -0
- /package/dist/{chunk-TW3IQ357.js.map → chunk-H2YBEXR4.js.map} +0 -0
- /package/dist/{chunk-UXSK2O6V.js.map → chunk-H353ZTXC.js.map} +0 -0
- /package/dist/{chunk-LATNDSMS.js.map → chunk-HHKAZTGY.js.map} +0 -0
- /package/dist/{chunk-SOZM3BG3.js.map → chunk-HLSOQ7MP.js.map} +0 -0
- /package/dist/{chunk-N4LGEYGW.js.map → chunk-JGC6S5SB.js.map} +0 -0
- /package/dist/{chunk-2BFAHP3U.js.map → chunk-K75R3X5V.js.map} +0 -0
- /package/dist/{chunk-23KRET2F.js.map → chunk-KDVOJBKE.js.map} +0 -0
- /package/dist/{chunk-MHWNJR5B.js.map → chunk-L7U5WS4B.js.map} +0 -0
- /package/dist/{chunk-EQI6CRLJ.js.map → chunk-LNXRPEMK.js.map} +0 -0
- /package/dist/{chunk-BMO22JIM.js.map → chunk-LOXY4VVO.js.map} +0 -0
- /package/dist/{chunk-A7T7RKSW.js.map → chunk-LXRSNY7W.js.map} +0 -0
- /package/dist/{chunk-WLTBLDXJ.js.map → chunk-MUK6LFVY.js.map} +0 -0
- /package/dist/{chunk-OQZOP2PQ.js.map → chunk-O3GWJKDO.js.map} +0 -0
- /package/dist/{chunk-HQ3N3YAO.js.map → chunk-ORDOOXPQ.js.map} +0 -0
- /package/dist/{chunk-PPABZ2FR.js.map → chunk-PSFKWZKR.js.map} +0 -0
- /package/dist/{chunk-ZWJUC7YK.js.map → chunk-QGR6OVVY.js.map} +0 -0
- /package/dist/{chunk-3GYCTQ3B.js.map → chunk-QSMGHCAG.js.map} +0 -0
- /package/dist/{chunk-KGA3RGUQ.js.map → chunk-R5XYEQV6.js.map} +0 -0
- /package/dist/{chunk-PI5TUSCU.js.map → chunk-SFLWBHK2.js.map} +0 -0
package/README.md
CHANGED
|
@@ -27,6 +27,31 @@ export MORPH_API_KEY="sk-your-key-here"
|
|
|
27
27
|
|
|
28
28
|
## Quick Start
|
|
29
29
|
|
|
30
|
+
### Vercel AI SDK provider
|
|
31
|
+
|
|
32
|
+
The provider works with AI SDK 6 and newer. It reads `MORPH_API_KEY` by default.
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { morph } from '@morphllm/morphsdk/ai-sdk';
|
|
36
|
+
import { generateText } from 'ai';
|
|
37
|
+
|
|
38
|
+
const { text } = await generateText({
|
|
39
|
+
model: morph('morph-glm53-744b'),
|
|
40
|
+
prompt: 'Write a TypeScript rate limiter.',
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Create a provider instance to use custom headers or a [dedicated inference endpoint](https://www.morphllm.com/dedicated-inference):
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { createMorph } from '@morphllm/morphsdk/ai-sdk';
|
|
48
|
+
|
|
49
|
+
const morph = createMorph({
|
|
50
|
+
apiKey: process.env.MORPH_API_KEY,
|
|
51
|
+
baseURL: 'https://your-endpoint.morphllm.com/v1',
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
30
55
|
### WarpGrep - Intelligent Code Search
|
|
31
56
|
|
|
32
57
|
WarpGrep is a search subagent that explores your codebase using parallel grep and file read operations. It understands natural language queries and returns relevant code with line numbers.
|
|
@@ -306,4 +331,3 @@ Full docs: [docs.morphllm.com](https://docs.morphllm.com)
|
|
|
306
331
|
- [GitHub](https://docs.morphllm.com/sdk/components/github) - GitHub integration for PR context and automation
|
|
307
332
|
- [Browser](https://docs.morphllm.com/sdk/components/browser) - AI-powered browser automation
|
|
308
333
|
- [Repo Storage](https://docs.morphllm.com/sdk/components/git) - Git operations and agent metadata
|
|
309
|
-
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// ai-sdk/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
MORPH_API_BASE_URL: () => MORPH_API_BASE_URL,
|
|
24
|
+
createMorph: () => createMorph,
|
|
25
|
+
morph: () => morph
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
var import_openai_compatible = require("@ai-sdk/openai-compatible");
|
|
29
|
+
var MORPH_API_BASE_URL = "https://api.morphllm.com/v1";
|
|
30
|
+
function createMorph(options = {}) {
|
|
31
|
+
return (0, import_openai_compatible.createOpenAICompatible)({
|
|
32
|
+
name: "morph",
|
|
33
|
+
baseURL: options.baseURL ?? MORPH_API_BASE_URL,
|
|
34
|
+
apiKey: options.apiKey ?? process.env.MORPH_API_KEY,
|
|
35
|
+
headers: options.headers,
|
|
36
|
+
fetch: options.fetch,
|
|
37
|
+
includeUsage: true,
|
|
38
|
+
supportsStructuredOutputs: true
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
var morph = createMorph();
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
MORPH_API_BASE_URL,
|
|
45
|
+
createMorph,
|
|
46
|
+
morph
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../ai-sdk/index.ts"],"sourcesContent":["import {\n createOpenAICompatible,\n type OpenAICompatibleProvider,\n type OpenAICompatibleProviderSettings,\n} from '@ai-sdk/openai-compatible'\n\nexport const MORPH_API_BASE_URL = 'https://api.morphllm.com/v1'\n\n/** Public model identifiers served by Morph's shared API. */\nexport type MorphChatModelId =\n | 'morph-kimik3'\n | 'morph-glm53-744b'\n | 'morph-glm53flash'\n | 'morph-dsv4flash'\n | (string & {})\n\nexport interface MorphProviderSettings {\n /**\n * Morph API key. Defaults to the `MORPH_API_KEY` environment variable.\n */\n apiKey?: string\n\n /**\n * Base URL for API calls. Set this to the URL of a dedicated Morph endpoint\n * when using reserved capacity.\n */\n baseURL?: string\n\n /** Custom headers to include with every request. */\n headers?: Record<string, string>\n\n /** Custom fetch implementation, useful for middleware and tests. */\n fetch?: OpenAICompatibleProviderSettings['fetch']\n}\n\nexport type MorphProvider = OpenAICompatibleProvider<\n MorphChatModelId,\n string,\n string,\n string\n>\n\n/**\n * Creates a Morph provider for the Vercel AI SDK.\n */\nexport function createMorph(options: MorphProviderSettings = {}): MorphProvider {\n return createOpenAICompatible<\n MorphChatModelId,\n string,\n string,\n string\n >({\n name: 'morph',\n baseURL: options.baseURL ?? MORPH_API_BASE_URL,\n apiKey: options.apiKey ?? process.env.MORPH_API_KEY,\n headers: options.headers,\n fetch: options.fetch,\n includeUsage: true,\n supportsStructuredOutputs: true,\n })\n}\n\n/** Default Morph provider using `MORPH_API_KEY`. */\nexport const morph = createMorph()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAIO;AAEA,IAAM,qBAAqB;AAuC3B,SAAS,YAAY,UAAiC,CAAC,GAAkB;AAC9E,aAAO,iDAKL;AAAA,IACA,MAAM;AAAA,IACN,SAAS,QAAQ,WAAW;AAAA,IAC5B,QAAQ,QAAQ,UAAU,QAAQ,IAAI;AAAA,IACtC,SAAS,QAAQ;AAAA,IACjB,OAAO,QAAQ;AAAA,IACf,cAAc;AAAA,IACd,2BAA2B;AAAA,EAC7B,CAAC;AACH;AAGO,IAAM,QAAQ,YAAY;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OpenAICompatibleProviderSettings, OpenAICompatibleProvider } from '@ai-sdk/openai-compatible';
|
|
2
|
+
|
|
3
|
+
declare const MORPH_API_BASE_URL = "https://api.morphllm.com/v1";
|
|
4
|
+
/** Public model identifiers served by Morph's shared API. */
|
|
5
|
+
type MorphChatModelId = 'morph-kimik3' | 'morph-glm53-744b' | 'morph-glm53flash' | 'morph-dsv4flash' | (string & {});
|
|
6
|
+
interface MorphProviderSettings {
|
|
7
|
+
/**
|
|
8
|
+
* Morph API key. Defaults to the `MORPH_API_KEY` environment variable.
|
|
9
|
+
*/
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Base URL for API calls. Set this to the URL of a dedicated Morph endpoint
|
|
13
|
+
* when using reserved capacity.
|
|
14
|
+
*/
|
|
15
|
+
baseURL?: string;
|
|
16
|
+
/** Custom headers to include with every request. */
|
|
17
|
+
headers?: Record<string, string>;
|
|
18
|
+
/** Custom fetch implementation, useful for middleware and tests. */
|
|
19
|
+
fetch?: OpenAICompatibleProviderSettings['fetch'];
|
|
20
|
+
}
|
|
21
|
+
type MorphProvider = OpenAICompatibleProvider<MorphChatModelId, string, string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a Morph provider for the Vercel AI SDK.
|
|
24
|
+
*/
|
|
25
|
+
declare function createMorph(options?: MorphProviderSettings): MorphProvider;
|
|
26
|
+
/** Default Morph provider using `MORPH_API_KEY`. */
|
|
27
|
+
declare const morph: MorphProvider;
|
|
28
|
+
|
|
29
|
+
export { MORPH_API_BASE_URL, type MorphChatModelId, type MorphProvider, type MorphProviderSettings, createMorph, morph };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// ai-sdk/index.ts
|
|
2
|
+
import {
|
|
3
|
+
createOpenAICompatible
|
|
4
|
+
} from "@ai-sdk/openai-compatible";
|
|
5
|
+
var MORPH_API_BASE_URL = "https://api.morphllm.com/v1";
|
|
6
|
+
function createMorph(options = {}) {
|
|
7
|
+
return createOpenAICompatible({
|
|
8
|
+
name: "morph",
|
|
9
|
+
baseURL: options.baseURL ?? MORPH_API_BASE_URL,
|
|
10
|
+
apiKey: options.apiKey ?? process.env.MORPH_API_KEY,
|
|
11
|
+
headers: options.headers,
|
|
12
|
+
fetch: options.fetch,
|
|
13
|
+
includeUsage: true,
|
|
14
|
+
supportsStructuredOutputs: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
var morph = createMorph();
|
|
18
|
+
export {
|
|
19
|
+
MORPH_API_BASE_URL,
|
|
20
|
+
createMorph,
|
|
21
|
+
morph
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../ai-sdk/index.ts"],"sourcesContent":["import {\n createOpenAICompatible,\n type OpenAICompatibleProvider,\n type OpenAICompatibleProviderSettings,\n} from '@ai-sdk/openai-compatible'\n\nexport const MORPH_API_BASE_URL = 'https://api.morphllm.com/v1'\n\n/** Public model identifiers served by Morph's shared API. */\nexport type MorphChatModelId =\n | 'morph-kimik3'\n | 'morph-glm53-744b'\n | 'morph-glm53flash'\n | 'morph-dsv4flash'\n | (string & {})\n\nexport interface MorphProviderSettings {\n /**\n * Morph API key. Defaults to the `MORPH_API_KEY` environment variable.\n */\n apiKey?: string\n\n /**\n * Base URL for API calls. Set this to the URL of a dedicated Morph endpoint\n * when using reserved capacity.\n */\n baseURL?: string\n\n /** Custom headers to include with every request. */\n headers?: Record<string, string>\n\n /** Custom fetch implementation, useful for middleware and tests. */\n fetch?: OpenAICompatibleProviderSettings['fetch']\n}\n\nexport type MorphProvider = OpenAICompatibleProvider<\n MorphChatModelId,\n string,\n string,\n string\n>\n\n/**\n * Creates a Morph provider for the Vercel AI SDK.\n */\nexport function createMorph(options: MorphProviderSettings = {}): MorphProvider {\n return createOpenAICompatible<\n MorphChatModelId,\n string,\n string,\n string\n >({\n name: 'morph',\n baseURL: options.baseURL ?? MORPH_API_BASE_URL,\n apiKey: options.apiKey ?? process.env.MORPH_API_KEY,\n headers: options.headers,\n fetch: options.fetch,\n includeUsage: true,\n supportsStructuredOutputs: true,\n })\n}\n\n/** Default Morph provider using `MORPH_API_KEY`. */\nexport const morph = createMorph()\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAGK;AAEA,IAAM,qBAAqB;AAuC3B,SAAS,YAAY,UAAiC,CAAC,GAAkB;AAC9E,SAAO,uBAKL;AAAA,IACA,MAAM;AAAA,IACN,SAAS,QAAQ,WAAW;AAAA,IAC5B,QAAQ,QAAQ,UAAU,QAAQ,IAAI;AAAA,IACtC,SAAS,QAAQ;AAAA,IACjB,OAAO,QAAQ;AAAA,IACf,cAAc;AAAA,IACd,2BAA2B;AAAA,EAC7B,CAAC;AACH;AAGO,IAAM,QAAQ,YAAY;","names":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
FastApplyAnchorIntegrityError,
|
|
2
3
|
FastApplyContextLengthError
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XUMLQ7AJ.js";
|
|
4
5
|
import {
|
|
5
6
|
MorphAPIClient
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-L7U5WS4B.js";
|
|
7
8
|
import {
|
|
8
9
|
logger
|
|
9
10
|
} from "./chunk-F3NCFNUX.js";
|
|
@@ -19,6 +20,8 @@ var DEFAULT_CONFIG = {
|
|
|
19
20
|
generateUdiff: true,
|
|
20
21
|
autoWrite: true,
|
|
21
22
|
timeout: 6e5,
|
|
23
|
+
anchorCompaction: true,
|
|
24
|
+
anchorCompactionThreshold: 128 * 1024,
|
|
22
25
|
debug: false
|
|
23
26
|
};
|
|
24
27
|
var FastApplyClient = class extends APIResource {
|
|
@@ -128,15 +131,15 @@ async function executeEditFile(input, config = {}) {
|
|
|
128
131
|
};
|
|
129
132
|
} catch (error) {
|
|
130
133
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
131
|
-
const
|
|
134
|
+
const structuredError = error instanceof FastApplyContextLengthError || error instanceof FastApplyAnchorIntegrityError ? error : void 0;
|
|
132
135
|
logger.error("FastApply", "execute_error", { error: errorMessage, target_filepath: input.target_filepath, stack: error instanceof Error ? error.stack : void 0 });
|
|
133
136
|
return {
|
|
134
137
|
success: false,
|
|
135
138
|
filepath: input.target_filepath,
|
|
136
139
|
changes: { linesAdded: 0, linesRemoved: 0, linesModified: 0 },
|
|
137
140
|
error: errorMessage,
|
|
138
|
-
errorCode:
|
|
139
|
-
completionId:
|
|
141
|
+
errorCode: structuredError?.code,
|
|
142
|
+
completionId: structuredError?.completionId
|
|
140
143
|
};
|
|
141
144
|
}
|
|
142
145
|
}
|
|
@@ -145,4 +148,4 @@ export {
|
|
|
145
148
|
FastApplyClient,
|
|
146
149
|
executeEditFile
|
|
147
150
|
};
|
|
148
|
-
//# sourceMappingURL=chunk-
|
|
151
|
+
//# sourceMappingURL=chunk-2YOE44FF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tools/fastapply/core.ts"],"sourcesContent":["/**\n * Core implementation of Morph Fast Apply\n *\n * This module provides file-based operations that require Node.js.\n * For edge-compatible code-in/code-out operations, use applyEdit from ./apply.ts\n */\n\nimport { join, resolve, relative } from 'path';\nimport type {\n EditFileInput,\n EditFileResult,\n EditFileConfig,\n} from './types.js';\nimport { logger } from '../../logger.js';\nimport { MorphAPIClient } from '../../core/client.js';\nimport { APIResource } from '../../core/resource.js';\nimport {\n FastApplyAnchorIntegrityError,\n FastApplyContextLengthError,\n} from './apply.js';\n\n// Re-export edge-compatible functions\nexport { applyEdit, generateUdiff, countChanges, callMorphAPI } from './apply.js';\nexport { FastApplyAnchorIntegrityError, FastApplyContextLengthError };\n\nconst DEFAULT_CONFIG: Required<Omit<EditFileConfig, 'morphApiKey' | 'systemPrompt' | 'retryConfig' | 'description' | 'large'>> = {\n morphApiUrl: 'https://api.morphllm.com',\n baseDir: process.cwd(),\n generateUdiff: true,\n autoWrite: true,\n timeout: 600000,\n anchorCompaction: true,\n anchorCompactionThreshold: 128 * 1024,\n debug: false,\n};\n\n/**\n * FastApply client for programmatic file editing\n * Note: This client requires Node.js for file operations\n *\n * @deprecated Prefer the unified `MorphClient` (`new MorphClient({ apiKey }).fastApply`).\n * Standalone clients remain only for backwards compatibility and may be removed in a future\n * major version — do not use them in new code.\n */\nexport class FastApplyClient extends APIResource {\n private config: EditFileConfig;\n\n constructor(clientOrConfig: MorphAPIClient | { apiKey?: string; debug?: boolean; timeout?: number; retryConfig?: any } = {}) {\n const isClient = clientOrConfig instanceof MorphAPIClient;\n super(\n isClient\n ? clientOrConfig\n : new MorphAPIClient({\n apiKey: clientOrConfig.apiKey,\n timeout: clientOrConfig.timeout ?? DEFAULT_CONFIG.timeout,\n retryConfig: clientOrConfig.retryConfig,\n debug: clientOrConfig.debug,\n }),\n );\n // FastApply talks to /v1/chat/completions through the `openai` package, but\n // sources its credentials and host from the shared transport.\n this.config = {\n morphApiKey: this._client.resolveApiKey(),\n morphApiUrl: this._client.baseURL,\n debug: this._client.debug,\n timeout: (isClient ? undefined : clientOrConfig.timeout) ?? DEFAULT_CONFIG.timeout,\n retryConfig: this._client.retryConfig,\n generateUdiff: DEFAULT_CONFIG.generateUdiff,\n autoWrite: DEFAULT_CONFIG.autoWrite,\n };\n }\n\n /**\n * Execute a file edit operation\n *\n * @param input - Edit parameters including filepath, instructions, and code_edit\n * @param overrides - Optional config overrides for this operation\n * @returns Edit result with success status and changes\n */\n async execute(input: EditFileInput, overrides?: Partial<EditFileConfig>): Promise<EditFileResult> {\n return executeEditFile(input, { ...this.config, ...overrides });\n }\n\n /**\n * Apply an edit to code directly without file I/O\n *\n * Useful for sandbox environments or when you manage your own file system.\n * Compatible with the earlier OpenAI client API contract.\n *\n * @param input - Code and edit parameters\n * @param overrides - Optional config overrides for this operation\n * @returns Result with merged code\n *\n * @example\n * ```typescript\n * const result = await client.applyEdit({\n * originalCode: 'function hello() { return \"world\"; }',\n * codeEdit: 'function hello() { return \"universe\"; }',\n * instructions: 'Change return value'\n * });\n * console.log(result.mergedCode);\n * ```\n */\n async applyEdit(input: import('./types.js').ApplyEditInput, overrides?: Partial<import('./types.js').ApplyEditConfig>): Promise<import('./types.js').ApplyEditResult> {\n const { applyEdit } = await import('./apply.js');\n return applyEdit(input, { ...this.config, ...overrides });\n }\n}\n\n/**\n * Execute a file edit using Morph Fast Apply\n * Note: This function requires Node.js for file I/O\n */\nexport async function executeEditFile(\n input: EditFileInput,\n config: EditFileConfig = {}\n): Promise<EditFileResult> {\n const baseDir = config.baseDir || DEFAULT_CONFIG.baseDir;\n const fullPath = resolve(join(baseDir, input.target_filepath));\n\n logger.debug('FastApply', 'execute_start', { target_filepath: input.target_filepath, baseDir, autoWrite: config.autoWrite !== false });\n\n // Security: ensure file is within baseDir\n const relativePath = relative(baseDir, fullPath);\n if (relativePath.startsWith('..') || fullPath === baseDir) {\n logger.warn('FastApply', 'security_check_failed', { target_filepath: input.target_filepath, relative: relativePath });\n return {\n success: false,\n filepath: input.target_filepath,\n changes: { linesAdded: 0, linesRemoved: 0, linesModified: 0 },\n error: `Invalid filepath: '${input.target_filepath}' is outside baseDir`,\n };\n }\n\n logger.debug('FastApply', 'security_check', { resolved: fullPath, relative: relativePath });\n\n try {\n // Dynamic import to avoid loading Node.js fs module at module evaluation time\n const { readFile, writeFile } = await import('fs/promises');\n const { callMorphAPI, generateUdiff, countChanges } = await import('./apply.js');\n\n // Handle both existing and non-existent files\n let originalCode = '';\n let fileExists = true;\n try {\n originalCode = await readFile(fullPath, 'utf-8');\n logger.debug('FastApply', 'file_read', { path: fullPath, exists: true, size_bytes: originalCode.length });\n } catch (error: any) {\n if (error.code !== 'ENOENT') {\n throw error; // Re-throw if it's not a \"file not found\" error\n }\n fileExists = false;\n logger.debug('FastApply', 'file_read', { path: fullPath, exists: false });\n }\n\n const instruction = input.instruction ?? input.instructions ?? '';\n logger.debug('FastApply', 'api_call', { instruction_len: instruction.length, code_edit_len: input.code_edit.length, original_len: originalCode.length });\n\n const { content: mergedCode, completionId } = await callMorphAPI(originalCode, input.code_edit, instruction, input.target_filepath, config);\n\n logger.debug('FastApply', 'api_response', { completion_id: completionId, merged_len: mergedCode.length });\n\n const udiff = config.generateUdiff !== false ? generateUdiff(originalCode, mergedCode, input.target_filepath) : undefined;\n\n if (config.autoWrite !== false) {\n await writeFile(fullPath, mergedCode, 'utf-8');\n logger.debug('FastApply', 'file_write', { path: fullPath, size_bytes: mergedCode.length });\n }\n\n const changes = countChanges(originalCode, mergedCode);\n logger.debug('FastApply', 'changes', { added: changes.linesAdded, removed: changes.linesRemoved, modified: changes.linesModified });\n\n return {\n success: true,\n filepath: input.target_filepath,\n udiff,\n changes,\n completionId,\n };\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';\n const structuredError = error instanceof FastApplyContextLengthError\n || error instanceof FastApplyAnchorIntegrityError\n ? error\n : undefined;\n logger.error('FastApply', 'execute_error', { error: errorMessage, target_filepath: input.target_filepath, stack: error instanceof Error ? error.stack : undefined });\n\n return {\n success: false,\n filepath: input.target_filepath,\n changes: { linesAdded: 0, linesRemoved: 0, linesModified: 0 },\n error: errorMessage,\n errorCode: structuredError?.code,\n completionId: structuredError?.completionId,\n };\n }\n}\n"],"mappings":"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","names":["applyEdit","callMorphAPI","generateUdiff","countChanges"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProfilesClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6P4KCGAG.js";
|
|
4
4
|
import {
|
|
5
5
|
buildEmbedCode,
|
|
6
6
|
buildLiveIframe,
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
} from "./chunk-YTYCHRQ2.js";
|
|
10
10
|
import {
|
|
11
11
|
MorphAPIClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-L7U5WS4B.js";
|
|
13
13
|
import {
|
|
14
14
|
logger
|
|
15
15
|
} from "./chunk-F3NCFNUX.js";
|
|
16
16
|
import {
|
|
17
17
|
fetchWithRetry,
|
|
18
18
|
withTimeout
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BSJVZEHN.js";
|
|
20
20
|
import {
|
|
21
21
|
APIResource
|
|
22
22
|
} from "./chunk-LKFZBBTD.js";
|
|
@@ -619,4 +619,4 @@ export {
|
|
|
619
619
|
getWebp,
|
|
620
620
|
checkHealth
|
|
621
621
|
};
|
|
622
|
-
//# sourceMappingURL=chunk-
|
|
622
|
+
//# sourceMappingURL=chunk-35U2MW77.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCodebaseSearch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QGR6OVVY.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEBASE_SEARCH_DESCRIPTION
|
|
6
6
|
} from "./chunk-YQMPVJ2L.js";
|
|
@@ -55,4 +55,4 @@ export {
|
|
|
55
55
|
getSystemPrompt,
|
|
56
56
|
vercel_default
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-4YWADZPB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCodebaseSearch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QGR6OVVY.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEBASE_SEARCH_DESCRIPTION,
|
|
6
6
|
CODEBASE_SEARCH_SYSTEM_PROMPT
|
|
@@ -80,4 +80,4 @@ function formatResult(result) {
|
|
|
80
80
|
export {
|
|
81
81
|
createCodebaseSearchTool
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-6FVLHSQ6.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-2VERUKO2.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchWithRetry
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BSJVZEHN.js";
|
|
16
16
|
|
|
17
17
|
// tools/browser/profiles/core.ts
|
|
18
18
|
var DEFAULT_API_URL = process.env.MORPH_ENVIRONMENT === "DEV" ? "http://localhost:8000" : "https://browser.morphllm.com";
|
|
@@ -386,4 +386,4 @@ export {
|
|
|
386
386
|
listRepos,
|
|
387
387
|
getProfileState
|
|
388
388
|
};
|
|
389
|
-
//# sourceMappingURL=chunk-
|
|
389
|
+
//# sourceMappingURL=chunk-6P4KCGAG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SDK_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MPTEH2CO.js";
|
|
4
4
|
|
|
5
5
|
// tools/utils/resilience.ts
|
|
6
6
|
var DEFAULT_RETRY_CONFIG = {
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
withTimeout,
|
|
92
92
|
MorphError
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-BSJVZEHN.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2HMEZZKK.js";
|
|
4
4
|
import {
|
|
5
5
|
executeBrowserTask
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-35U2MW77.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
9
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
browserTool,
|
|
55
55
|
vercel_exports
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-DUPKDVNP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompactClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K75R3X5V.js";
|
|
4
4
|
|
|
5
5
|
// tools/compact/utils.ts
|
|
6
6
|
async function compactFileContexts(files, query, apiKey, apiUrl, maxTokens = 1e4, maxConcurrency = 3) {
|
|
@@ -50,4 +50,4 @@ async function compactFileContexts(files, query, apiKey, apiUrl, maxTokens = 1e4
|
|
|
50
50
|
export {
|
|
51
51
|
compactFileContexts
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=chunk-
|
|
53
|
+
//# sourceMappingURL=chunk-FC3HXR2Q.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BSJVZEHN.js";
|
|
4
4
|
|
|
5
5
|
// core/error.ts
|
|
6
6
|
async function toMorphError(response) {
|
|
@@ -21,4 +21,4 @@ async function toMorphError(response) {
|
|
|
21
21
|
export {
|
|
22
22
|
toMorphError
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-FNN5776O.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-63WE2C5R.js";
|
|
5
5
|
import {
|
|
6
6
|
executeEditFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2YOE44FF.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -86,4 +86,4 @@ export {
|
|
|
86
86
|
vercel_default,
|
|
87
87
|
vercel_exports
|
|
88
88
|
};
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-GWFZGS3Z.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeCodebaseSearch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QGR6OVVY.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEBASE_SEARCH_DESCRIPTION,
|
|
6
6
|
CODEBASE_SEARCH_SYSTEM_PROMPT
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
getSystemPrompt,
|
|
126
126
|
openai_default
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-H2YBEXR4.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-63WE2C5R.js";
|
|
5
5
|
import {
|
|
6
6
|
executeEditFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2YOE44FF.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -79,4 +79,4 @@ export {
|
|
|
79
79
|
getSystemPrompt,
|
|
80
80
|
anthropic_exports
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-H353ZTXC.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-2HMEZZKK.js";
|
|
5
5
|
import {
|
|
6
6
|
executeBrowserTask
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-35U2MW77.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
createBrowserTool,
|
|
78
78
|
anthropic_exports
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-HHKAZTGY.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphAPIClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L7U5WS4B.js";
|
|
4
4
|
import {
|
|
5
5
|
MorphError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BSJVZEHN.js";
|
|
7
7
|
import {
|
|
8
8
|
APIResource
|
|
9
9
|
} from "./chunk-LKFZBBTD.js";
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
ReflexClient,
|
|
200
200
|
ReflexJobsResource
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-HLSOQ7MP.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
executeToolCall,
|
|
15
15
|
formatGitHubReadFileResult,
|
|
16
16
|
formatResult
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MUK6LFVY.js";
|
|
18
18
|
|
|
19
19
|
// tools/warp_grep/anthropic.ts
|
|
20
20
|
var INPUT_SCHEMA = {
|
|
@@ -90,4 +90,4 @@ export {
|
|
|
90
90
|
createGitHubSearchTool,
|
|
91
91
|
createGitHubReadFileTool
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-JGC6S5SB.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphAPIClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L7U5WS4B.js";
|
|
4
4
|
import {
|
|
5
5
|
MorphError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BSJVZEHN.js";
|
|
7
7
|
import {
|
|
8
8
|
APIResource
|
|
9
9
|
} from "./chunk-LKFZBBTD.js";
|
|
@@ -75,4 +75,4 @@ var CompactClient = class extends APIResource {
|
|
|
75
75
|
export {
|
|
76
76
|
CompactClient
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-K75R3X5V.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphAPIClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L7U5WS4B.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
6
|
} from "./chunk-F3NCFNUX.js";
|
|
7
7
|
import {
|
|
8
8
|
MorphError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BSJVZEHN.js";
|
|
10
10
|
import {
|
|
11
11
|
APIResource
|
|
12
12
|
} from "./chunk-LKFZBBTD.js";
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
RawRouter,
|
|
175
175
|
RouterClassifier
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-KDVOJBKE.js.map
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-F3NCFNUX.js";
|
|
4
4
|
import {
|
|
5
5
|
toMorphError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FNN5776O.js";
|
|
7
7
|
import {
|
|
8
8
|
MorphError,
|
|
9
9
|
fetchWithRetry,
|
|
10
10
|
withTimeout
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BSJVZEHN.js";
|
|
12
12
|
import {
|
|
13
13
|
SDK_VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MPTEH2CO.js";
|
|
15
15
|
|
|
16
16
|
// core/client.ts
|
|
17
17
|
var DEFAULT_BASE_URL = "https://api.morphllm.com";
|
|
@@ -117,4 +117,4 @@ var MorphAPIClient = class {
|
|
|
117
117
|
export {
|
|
118
118
|
MorphAPIClient
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-L7U5WS4B.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-63WE2C5R.js";
|
|
5
5
|
import {
|
|
6
6
|
executeEditFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2YOE44FF.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
openai_default,
|
|
92
92
|
openai_exports
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-LNXRPEMK.js.map
|
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createGitHubSearchTool,
|
|
3
3
|
createWarpGrepTool
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SFLWBHK2.js";
|
|
5
5
|
import {
|
|
6
6
|
createGitHubSearchTool as createGitHubSearchTool3,
|
|
7
7
|
createWarpGrepTool as createWarpGrepTool3
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LXRSNY7W.js";
|
|
9
9
|
import {
|
|
10
10
|
TracesClient
|
|
11
11
|
} from "./chunk-TCCZBGG5.js";
|
|
12
12
|
import {
|
|
13
13
|
createGitHubSearchTool as createGitHubSearchTool2,
|
|
14
14
|
createWarpGrepTool as createWarpGrepTool2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JGC6S5SB.js";
|
|
16
16
|
import {
|
|
17
17
|
ReflexClient
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HLSOQ7MP.js";
|
|
19
|
+
import {
|
|
20
|
+
BrowserClient
|
|
21
|
+
} from "./chunk-35U2MW77.js";
|
|
19
22
|
import {
|
|
20
23
|
createCodebaseSearchTool as createCodebaseSearchTool3
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4YWADZPB.js";
|
|
22
25
|
import {
|
|
23
26
|
createCodebaseSearchTool as createCodebaseSearchTool2
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6FVLHSQ6.js";
|
|
25
28
|
import {
|
|
26
29
|
createCodebaseSearchTool
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-H2YBEXR4.js";
|
|
28
31
|
import {
|
|
29
32
|
CodebaseSearchClient
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
BrowserClient
|
|
33
|
-
} from "./chunk-GXQXQMVG.js";
|
|
33
|
+
} from "./chunk-QGR6OVVY.js";
|
|
34
34
|
import {
|
|
35
35
|
createExploreSubagent as createExploreSubagent2
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-O3GWJKDO.js";
|
|
37
37
|
import {
|
|
38
38
|
createEditFileTool
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LNXRPEMK.js";
|
|
40
40
|
import {
|
|
41
41
|
createEditFileTool as createEditFileTool3
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-GWFZGS3Z.js";
|
|
43
43
|
import {
|
|
44
44
|
createEditFileTool as createEditFileTool2
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-H353ZTXC.js";
|
|
46
46
|
import {
|
|
47
47
|
FastApplyClient
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-2YOE44FF.js";
|
|
49
49
|
import {
|
|
50
50
|
MorphGit
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-QSMGHCAG.js";
|
|
52
52
|
import {
|
|
53
53
|
createExploreSubagent
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-PSFKWZKR.js";
|
|
55
55
|
import {
|
|
56
56
|
WarpGrepClient
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-MUK6LFVY.js";
|
|
58
58
|
import {
|
|
59
59
|
AnthropicRouter,
|
|
60
60
|
GeminiRouter,
|
|
61
61
|
OpenAIRouter,
|
|
62
62
|
RawRouter,
|
|
63
63
|
RouterClassifier
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-KDVOJBKE.js";
|
|
65
65
|
import {
|
|
66
66
|
CompactClient
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-K75R3X5V.js";
|
|
68
68
|
import {
|
|
69
69
|
MorphAPIClient
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-L7U5WS4B.js";
|
|
71
71
|
import {
|
|
72
72
|
logger
|
|
73
73
|
} from "./chunk-F3NCFNUX.js";
|
|
@@ -695,4 +695,4 @@ export {
|
|
|
695
695
|
VercelToolFactory,
|
|
696
696
|
MorphClient
|
|
697
697
|
};
|
|
698
|
-
//# sourceMappingURL=chunk-
|
|
698
|
+
//# sourceMappingURL=chunk-LOXY4VVO.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
executeGitHubReadFile,
|
|
9
9
|
executeToolCall,
|
|
10
10
|
executeToolCallStreaming
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MUK6LFVY.js";
|
|
12
12
|
|
|
13
13
|
// tools/warp_grep/vercel.ts
|
|
14
14
|
import { tool } from "ai";
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
createGitHubReadFileTool,
|
|
116
116
|
vercel_default
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-LXRSNY7W.js.map
|