@morphllm/morphsdk 0.2.119 → 0.2.121
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-ZRLEAPZV.js → chunk-266SWRHK.js} +2 -2
- package/dist/{chunk-4VWJFZVS.js → chunk-3HBZXN6E.js} +6 -1
- package/dist/chunk-3HBZXN6E.js.map +1 -0
- package/dist/{chunk-3T4BGWCV.js → chunk-7IZUNRPZ.js} +37 -23
- package/dist/{chunk-3T4BGWCV.js.map → chunk-7IZUNRPZ.js.map} +1 -1
- package/dist/{chunk-FXBT4UDY.js → chunk-7QZFNYOH.js} +7 -2
- package/dist/chunk-7QZFNYOH.js.map +1 -0
- package/dist/{chunk-M5DR2WOZ.js → chunk-AI3ZCOCT.js} +1 -1
- package/dist/{chunk-UNHHRMU7.js → chunk-BDKXYMU2.js} +4 -4
- package/dist/{chunk-G7RSAZIK.js → chunk-C3BQUIFE.js} +5 -5
- package/dist/{chunk-WM77HRKO.js → chunk-CIFPLFBQ.js} +2 -2
- package/dist/{chunk-WVTX3QS6.js → chunk-CXP63PHW.js} +2 -2
- package/dist/{chunk-5IVVJMMX.js → chunk-DL3Y3R6A.js} +2 -2
- package/dist/{chunk-HMQSMEN2.js → chunk-EF7ZYLA2.js} +4 -4
- package/dist/chunk-EJYFE73S.js +230 -0
- package/dist/chunk-EJYFE73S.js.map +1 -0
- package/dist/{chunk-EAT5W3SH.js → chunk-EZFXR52Q.js} +2 -2
- package/dist/{chunk-HMAX2FEE.js → chunk-FV3R3JGV.js} +4 -4
- package/dist/{chunk-OUEJ6XEO.js → chunk-GNRMDXJA.js} +2 -2
- package/dist/chunk-J267T54M.js +76 -0
- package/dist/chunk-J267T54M.js.map +1 -0
- package/dist/{chunk-SI2CKRKJ.js → chunk-JBIFS33U.js} +2 -2
- package/dist/{chunk-EMMSRY32.js → chunk-L4PK4VC7.js} +2 -2
- package/dist/{chunk-PR44LEQQ.js → chunk-MAAULSSQ.js} +2 -2
- package/dist/{chunk-QL7MV3GT.js → chunk-QDGB6FLI.js} +12 -8
- package/dist/chunk-QDGB6FLI.js.map +1 -0
- package/dist/{chunk-K4EO7S2O.js → chunk-U5UDFQXK.js} +2 -2
- package/dist/{chunk-O5DA5V5S.js → chunk-W37KJB25.js} +2 -2
- package/dist/{chunk-ZYPLV3HP.js → chunk-WEBUKGPK.js} +3 -3
- package/dist/{chunk-OOCSNAA5.js → chunk-XERAWJ3H.js} +2 -2
- package/dist/{chunk-Y5BB7JFH.js → chunk-YMOTJ6ZP.js} +4 -4
- package/dist/{client-D7iO2TbA.d.ts → client-Bp3MRcJc.d.ts} +6 -1
- package/dist/client.cjs +329 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +4 -1
- package/dist/client.js +24 -22
- package/dist/edge.cjs +305 -1
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.d.ts +4 -0
- package/dist/edge.js +15 -7
- package/dist/index.cjs +334 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +38 -30
- package/dist/modelrouter/core.cjs +227 -0
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +3 -2
- package/dist/modelrouter/index.cjs +227 -0
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +3 -2
- package/dist/tools/browser/anthropic.cjs +227 -0
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +6 -5
- package/dist/tools/browser/core.cjs +227 -0
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.js +5 -4
- package/dist/tools/browser/index.cjs +227 -0
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.js +13 -12
- package/dist/tools/browser/index.js.map +1 -1
- package/dist/tools/browser/openai.cjs +227 -0
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +6 -5
- package/dist/tools/browser/profiles/core.cjs +227 -0
- package/dist/tools/browser/profiles/core.cjs.map +1 -1
- package/dist/tools/browser/profiles/core.js +3 -2
- package/dist/tools/browser/profiles/index.cjs +227 -0
- package/dist/tools/browser/profiles/index.cjs.map +1 -1
- package/dist/tools/browser/profiles/index.js +3 -2
- package/dist/tools/browser/vercel.cjs +227 -0
- package/dist/tools/browser/vercel.cjs.map +1 -1
- package/dist/tools/browser/vercel.js +6 -5
- package/dist/tools/codebase_search/anthropic.cjs +227 -0
- package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
- package/dist/tools/codebase_search/anthropic.js +4 -3
- package/dist/tools/codebase_search/core.cjs +227 -0
- package/dist/tools/codebase_search/core.cjs.map +1 -1
- package/dist/tools/codebase_search/core.js +3 -2
- package/dist/tools/codebase_search/index.cjs +227 -0
- package/dist/tools/codebase_search/index.cjs.map +1 -1
- package/dist/tools/codebase_search/index.js +8 -7
- package/dist/tools/codebase_search/openai.cjs +227 -0
- package/dist/tools/codebase_search/openai.cjs.map +1 -1
- package/dist/tools/codebase_search/openai.js +4 -3
- package/dist/tools/codebase_search/vercel.cjs +227 -0
- package/dist/tools/codebase_search/vercel.cjs.map +1 -1
- package/dist/tools/codebase_search/vercel.js +4 -3
- package/dist/tools/compact/core.cjs +110 -0
- package/dist/tools/compact/core.cjs.map +1 -0
- package/dist/tools/compact/core.d.ts +37 -0
- package/dist/tools/compact/core.js +8 -0
- package/dist/tools/compact/core.js.map +1 -0
- package/dist/tools/compact/index.cjs +112 -0
- package/dist/tools/compact/index.cjs.map +1 -0
- package/dist/tools/compact/index.d.ts +4 -0
- package/dist/tools/compact/index.js +8 -0
- package/dist/tools/compact/index.js.map +1 -0
- package/dist/tools/compact/types.cjs +19 -0
- package/dist/tools/compact/types.cjs.map +1 -0
- package/dist/tools/compact/types.d.ts +60 -0
- package/dist/tools/compact/types.js +1 -0
- package/dist/tools/compact/types.js.map +1 -0
- package/dist/tools/fastapply/anthropic.cjs +241 -1
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +4 -3
- package/dist/tools/fastapply/apply.cjs +230 -1
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.js +2 -1
- package/dist/tools/fastapply/core.cjs +241 -1
- package/dist/tools/fastapply/core.cjs.map +1 -1
- package/dist/tools/fastapply/core.js +3 -2
- package/dist/tools/fastapply/index.cjs +241 -1
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.d.ts +1 -1
- package/dist/tools/fastapply/index.js +9 -8
- package/dist/tools/fastapply/openai.cjs +241 -1
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +4 -3
- package/dist/tools/fastapply/vercel.cjs +241 -1
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.d.ts +1 -1
- package/dist/tools/fastapply/vercel.js +4 -3
- package/dist/tools/index.cjs +241 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +9 -8
- package/dist/tools/utils/resilience.cjs +229 -0
- package/dist/tools/utils/resilience.cjs.map +1 -1
- package/dist/tools/utils/resilience.js +2 -1
- package/dist/tools/warp_grep/agent/runner.cjs +230 -1
- package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
- package/dist/tools/warp_grep/agent/runner.js +4 -3
- package/dist/tools/warp_grep/anthropic.cjs +230 -1
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +6 -5
- package/dist/tools/warp_grep/client.cjs +230 -1
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +5 -4
- package/dist/tools/warp_grep/gemini.cjs +230 -1
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +5 -4
- package/dist/tools/warp_grep/gemini.js.map +1 -1
- package/dist/tools/warp_grep/harness.js +9 -9
- package/dist/tools/warp_grep/index.cjs +230 -1
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.js +10 -9
- package/dist/tools/warp_grep/openai.cjs +230 -1
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +6 -5
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/vercel.cjs +230 -1
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +6 -5
- package/dist/version.cjs +256 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.js +8 -0
- package/dist/version.js.map +1 -0
- package/package.json +7 -2
- package/dist/chunk-4VWJFZVS.js.map +0 -1
- package/dist/chunk-FXBT4UDY.js.map +0 -1
- package/dist/chunk-QL7MV3GT.js.map +0 -1
- package/dist/{chunk-ZRLEAPZV.js.map → chunk-266SWRHK.js.map} +0 -0
- package/dist/{chunk-M5DR2WOZ.js.map → chunk-AI3ZCOCT.js.map} +0 -0
- package/dist/{chunk-UNHHRMU7.js.map → chunk-BDKXYMU2.js.map} +0 -0
- package/dist/{chunk-G7RSAZIK.js.map → chunk-C3BQUIFE.js.map} +0 -0
- package/dist/{chunk-WM77HRKO.js.map → chunk-CIFPLFBQ.js.map} +0 -0
- package/dist/{chunk-WVTX3QS6.js.map → chunk-CXP63PHW.js.map} +0 -0
- package/dist/{chunk-5IVVJMMX.js.map → chunk-DL3Y3R6A.js.map} +0 -0
- package/dist/{chunk-HMQSMEN2.js.map → chunk-EF7ZYLA2.js.map} +0 -0
- package/dist/{chunk-EAT5W3SH.js.map → chunk-EZFXR52Q.js.map} +0 -0
- package/dist/{chunk-HMAX2FEE.js.map → chunk-FV3R3JGV.js.map} +0 -0
- package/dist/{chunk-OUEJ6XEO.js.map → chunk-GNRMDXJA.js.map} +0 -0
- package/dist/{chunk-SI2CKRKJ.js.map → chunk-JBIFS33U.js.map} +0 -0
- package/dist/{chunk-EMMSRY32.js.map → chunk-L4PK4VC7.js.map} +0 -0
- package/dist/{chunk-PR44LEQQ.js.map → chunk-MAAULSSQ.js.map} +0 -0
- package/dist/{chunk-K4EO7S2O.js.map → chunk-U5UDFQXK.js.map} +0 -0
- package/dist/{chunk-O5DA5V5S.js.map → chunk-W37KJB25.js.map} +0 -0
- package/dist/{chunk-ZYPLV3HP.js.map → chunk-WEBUKGPK.js.map} +0 -0
- package/dist/{chunk-OOCSNAA5.js.map → chunk-XERAWJ3H.js.map} +0 -0
- package/dist/{chunk-Y5BB7JFH.js.map → chunk-YMOTJ6ZP.js.map} +0 -0
- package/dist/{vercel-B1GZ_g9N.d.ts → vercel-BTSPdTA-.d.ts} +2 -2
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// tools/compact/index.ts
|
|
31
|
+
var compact_exports = {};
|
|
32
|
+
__export(compact_exports, {
|
|
33
|
+
CompactClient: () => CompactClient
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(compact_exports);
|
|
36
|
+
|
|
37
|
+
// tools/compact/core.ts
|
|
38
|
+
var import_openai = __toESM(require("openai"), 1);
|
|
39
|
+
var DEFAULT_API_URL = "https://api.morphllm.com";
|
|
40
|
+
var DEFAULT_TIMEOUT = 12e4;
|
|
41
|
+
var CompactClient = class {
|
|
42
|
+
config;
|
|
43
|
+
constructor(config = {}) {
|
|
44
|
+
this.config = {
|
|
45
|
+
morphApiUrl: DEFAULT_API_URL,
|
|
46
|
+
timeout: DEFAULT_TIMEOUT,
|
|
47
|
+
...config
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Compact conversation context using Morph compactor
|
|
52
|
+
*
|
|
53
|
+
* @param input - Compact parameters including input content and optional prompt
|
|
54
|
+
* @returns Compact result with compacted output and usage stats
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const client = new CompactClient({ morphApiKey: 'sk-...' });
|
|
59
|
+
* const result = await client.compact({
|
|
60
|
+
* input: 'Long conversation context to compact...',
|
|
61
|
+
* prompt: 'Focus on the code review feedback',
|
|
62
|
+
* });
|
|
63
|
+
* console.log(result.output);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
async compact(input) {
|
|
67
|
+
const apiKey = this.config.morphApiKey || (typeof process !== "undefined" ? process.env?.MORPH_API_KEY : void 0);
|
|
68
|
+
const debug = this.config.debug || false;
|
|
69
|
+
if (!apiKey) {
|
|
70
|
+
throw new Error(
|
|
71
|
+
"Morph API key not found. Set MORPH_API_KEY environment variable or pass morphApiKey in config."
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
const client = new import_openai.default({
|
|
75
|
+
apiKey,
|
|
76
|
+
baseURL: `${this.config.morphApiUrl}/v1`,
|
|
77
|
+
timeout: this.config.timeout,
|
|
78
|
+
maxRetries: this.config.retryConfig?.maxRetries ?? 3
|
|
79
|
+
});
|
|
80
|
+
const instructions = input.prompt ? `The user's next message will be: "${input.prompt}"
|
|
81
|
+
Prioritize keeping context relevant to this query.` : void 0;
|
|
82
|
+
if (debug) {
|
|
83
|
+
console.log(`[Compact] Calling ${this.config.morphApiUrl}/v1/responses`);
|
|
84
|
+
console.log(`[Compact] Model: ${input.model || "morph-compactor"}`);
|
|
85
|
+
}
|
|
86
|
+
const startTime = Date.now();
|
|
87
|
+
const response = await client.responses.create({
|
|
88
|
+
model: input.model || "morph-compactor",
|
|
89
|
+
input: input.input,
|
|
90
|
+
...instructions && { instructions },
|
|
91
|
+
...input.temperature != null && { temperature: input.temperature },
|
|
92
|
+
...input.max_output_tokens != null && { max_output_tokens: input.max_output_tokens },
|
|
93
|
+
stream: false
|
|
94
|
+
});
|
|
95
|
+
const elapsed = Date.now() - startTime;
|
|
96
|
+
if (debug) {
|
|
97
|
+
console.log(`[Compact] Success in ${elapsed}ms`);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
id: response.id,
|
|
101
|
+
output: response.output,
|
|
102
|
+
usage: response.usage,
|
|
103
|
+
status: response.status ?? "completed",
|
|
104
|
+
model: response.model
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
+
0 && (module.exports = {
|
|
110
|
+
CompactClient
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../tools/compact/index.ts","../../../tools/compact/core.ts"],"sourcesContent":["/**\n * Morph Compact SDK - Main exports\n */\n\n// Core exports\nexport { CompactClient } from './core.js';\nexport type { CompactInput, CompactResult, CompactConfig } from './types.js';\n","/**\n * Core implementation of Morph Compact\n *\n * Uses the OpenAI Responses API to compact conversation context\n * via the Morph compactor model.\n */\n\nimport OpenAI from 'openai';\nimport type { CompactConfig, CompactInput, CompactResult } from './types.js';\n\nconst DEFAULT_API_URL = 'https://api.morphllm.com';\nconst DEFAULT_TIMEOUT = 120000;\n\n/**\n * CompactClient for programmatic context compaction\n */\nexport class CompactClient {\n private config: Required<Pick<CompactConfig, 'morphApiUrl' | 'timeout'>> & CompactConfig;\n\n constructor(config: CompactConfig = {}) {\n this.config = {\n morphApiUrl: DEFAULT_API_URL,\n timeout: DEFAULT_TIMEOUT,\n ...config,\n };\n }\n\n /**\n * Compact conversation context using Morph compactor\n *\n * @param input - Compact parameters including input content and optional prompt\n * @returns Compact result with compacted output and usage stats\n *\n * @example\n * ```typescript\n * const client = new CompactClient({ morphApiKey: 'sk-...' });\n * const result = await client.compact({\n * input: 'Long conversation context to compact...',\n * prompt: 'Focus on the code review feedback',\n * });\n * console.log(result.output);\n * ```\n */\n async compact(input: CompactInput): Promise<CompactResult> {\n const apiKey = this.config.morphApiKey || (typeof process !== 'undefined' ? process.env?.MORPH_API_KEY : undefined);\n const debug = this.config.debug || false;\n\n if (!apiKey) {\n throw new Error(\n 'Morph API key not found. Set MORPH_API_KEY environment variable or pass morphApiKey in config.'\n );\n }\n\n const client = new OpenAI({\n apiKey,\n baseURL: `${this.config.morphApiUrl}/v1`,\n timeout: this.config.timeout,\n maxRetries: this.config.retryConfig?.maxRetries ?? 3,\n });\n\n const instructions = input.prompt\n ? `The user's next message will be: \"${input.prompt}\"\\nPrioritize keeping context relevant to this query.`\n : undefined;\n\n if (debug) {\n console.log(`[Compact] Calling ${this.config.morphApiUrl}/v1/responses`);\n console.log(`[Compact] Model: ${input.model || 'morph-compactor'}`);\n }\n\n const startTime = Date.now();\n\n const response = await client.responses.create({\n model: input.model || 'morph-compactor',\n input: input.input as any,\n ...(instructions && { instructions }),\n ...(input.temperature != null && { temperature: input.temperature }),\n ...(input.max_output_tokens != null && { max_output_tokens: input.max_output_tokens }),\n stream: false,\n });\n\n const elapsed = Date.now() - startTime;\n\n if (debug) {\n console.log(`[Compact] Success in ${elapsed}ms`);\n }\n\n return {\n id: response.id,\n output: response.output as any,\n usage: response.usage as any,\n status: response.status ?? 'completed',\n model: response.model,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,oBAAmB;AAGnB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAKjB,IAAM,gBAAN,MAAoB;AAAA,EACjB;AAAA,EAER,YAAY,SAAwB,CAAC,GAAG;AACtC,SAAK,SAAS;AAAA,MACZ,aAAa;AAAA,MACb,SAAS;AAAA,MACT,GAAG;AAAA,IACL;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,MAAM,QAAQ,OAA6C;AACzD,UAAM,SAAS,KAAK,OAAO,gBAAgB,OAAO,YAAY,cAAc,QAAQ,KAAK,gBAAgB;AACzG,UAAM,QAAQ,KAAK,OAAO,SAAS;AAEnC,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,UAAM,SAAS,IAAI,cAAAA,QAAO;AAAA,MACxB;AAAA,MACA,SAAS,GAAG,KAAK,OAAO,WAAW;AAAA,MACnC,SAAS,KAAK,OAAO;AAAA,MACrB,YAAY,KAAK,OAAO,aAAa,cAAc;AAAA,IACrD,CAAC;AAED,UAAM,eAAe,MAAM,SACvB,qCAAqC,MAAM,MAAM;AAAA,sDACjD;AAEJ,QAAI,OAAO;AACT,cAAQ,IAAI,qBAAqB,KAAK,OAAO,WAAW,eAAe;AACvE,cAAQ,IAAI,oBAAoB,MAAM,SAAS,iBAAiB,EAAE;AAAA,IACpE;AAEA,UAAM,YAAY,KAAK,IAAI;AAE3B,UAAM,WAAW,MAAM,OAAO,UAAU,OAAO;AAAA,MAC7C,OAAO,MAAM,SAAS;AAAA,MACtB,OAAO,MAAM;AAAA,MACb,GAAI,gBAAgB,EAAE,aAAa;AAAA,MACnC,GAAI,MAAM,eAAe,QAAQ,EAAE,aAAa,MAAM,YAAY;AAAA,MAClE,GAAI,MAAM,qBAAqB,QAAQ,EAAE,mBAAmB,MAAM,kBAAkB;AAAA,MACpF,QAAQ;AAAA,IACV,CAAC;AAED,UAAM,UAAU,KAAK,IAAI,IAAI;AAE7B,QAAI,OAAO;AACT,cAAQ,IAAI,wBAAwB,OAAO,IAAI;AAAA,IACjD;AAEA,WAAO;AAAA,MACL,IAAI,SAAS;AAAA,MACb,QAAQ,SAAS;AAAA,MACjB,OAAO,SAAS;AAAA,MAChB,QAAQ,SAAS,UAAU;AAAA,MAC3B,OAAO,SAAS;AAAA,IAClB;AAAA,EACF;AACF;","names":["OpenAI"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// tools/compact/types.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
19
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../tools/compact/types.ts"],"sourcesContent":["/**\n * Core types for Morph Compact SDK\n */\n\nimport type { RetryConfig } from '../utils/resilience.js';\nimport type { ResponseInputItem, ResponseOutputItem } from 'openai/resources/responses/responses';\n\n/**\n * Input parameters for the compact tool\n */\nexport interface CompactInput {\n /** Model to use for compaction (defaults to 'morph-compactor') */\n model?: string;\n /** Input content - either a string or an array of response input items */\n input: string | ResponseInputItem[];\n /** Optional prompt to guide compaction priority */\n prompt?: string;\n /** Sampling temperature */\n temperature?: number;\n /** Maximum output tokens */\n max_output_tokens?: number;\n /** Whether to stream the response */\n stream?: boolean;\n}\n\n/**\n * Result returned after executing a compaction\n */\nexport interface CompactResult {\n /** Response ID */\n id: string;\n /** Output items from the response */\n output: ResponseOutputItem[];\n /** Token usage statistics */\n usage?: {\n input_tokens: number;\n output_tokens: number;\n total_tokens: number;\n };\n /** Response status */\n status: string;\n /** Model used for compaction */\n model: string;\n}\n\n/**\n * Configuration options for the compact tool\n */\nexport interface CompactConfig {\n /** Morph API key (defaults to MORPH_API_KEY env var) */\n morphApiKey?: string;\n /** Morph API base URL */\n morphApiUrl?: string;\n /** Timeout for API calls in ms (default: 120000) */\n timeout?: number;\n /** Retry configuration for API calls */\n retryConfig?: RetryConfig;\n /** Enable debug logging (default: false) */\n debug?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { RetryConfig } from '../utils/resilience.js';
|
|
2
|
+
import { ResponseInputItem, ResponseOutputItem } from 'openai/resources/responses/responses';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Core types for Morph Compact SDK
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Input parameters for the compact tool
|
|
10
|
+
*/
|
|
11
|
+
interface CompactInput {
|
|
12
|
+
/** Model to use for compaction (defaults to 'morph-compactor') */
|
|
13
|
+
model?: string;
|
|
14
|
+
/** Input content - either a string or an array of response input items */
|
|
15
|
+
input: string | ResponseInputItem[];
|
|
16
|
+
/** Optional prompt to guide compaction priority */
|
|
17
|
+
prompt?: string;
|
|
18
|
+
/** Sampling temperature */
|
|
19
|
+
temperature?: number;
|
|
20
|
+
/** Maximum output tokens */
|
|
21
|
+
max_output_tokens?: number;
|
|
22
|
+
/** Whether to stream the response */
|
|
23
|
+
stream?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Result returned after executing a compaction
|
|
27
|
+
*/
|
|
28
|
+
interface CompactResult {
|
|
29
|
+
/** Response ID */
|
|
30
|
+
id: string;
|
|
31
|
+
/** Output items from the response */
|
|
32
|
+
output: ResponseOutputItem[];
|
|
33
|
+
/** Token usage statistics */
|
|
34
|
+
usage?: {
|
|
35
|
+
input_tokens: number;
|
|
36
|
+
output_tokens: number;
|
|
37
|
+
total_tokens: number;
|
|
38
|
+
};
|
|
39
|
+
/** Response status */
|
|
40
|
+
status: string;
|
|
41
|
+
/** Model used for compaction */
|
|
42
|
+
model: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Configuration options for the compact tool
|
|
46
|
+
*/
|
|
47
|
+
interface CompactConfig {
|
|
48
|
+
/** Morph API key (defaults to MORPH_API_KEY env var) */
|
|
49
|
+
morphApiKey?: string;
|
|
50
|
+
/** Morph API base URL */
|
|
51
|
+
morphApiUrl?: string;
|
|
52
|
+
/** Timeout for API calls in ms (default: 120000) */
|
|
53
|
+
timeout?: number;
|
|
54
|
+
/** Retry configuration for API calls */
|
|
55
|
+
retryConfig?: RetryConfig;
|
|
56
|
+
/** Enable debug logging (default: false) */
|
|
57
|
+
debug?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type { CompactConfig, CompactInput, CompactResult };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -30,6 +30,244 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
+
// package.json
|
|
34
|
+
var package_default;
|
|
35
|
+
var init_package = __esm({
|
|
36
|
+
"package.json"() {
|
|
37
|
+
package_default = {
|
|
38
|
+
name: "@morphllm/morphsdk",
|
|
39
|
+
version: "0.2.121",
|
|
40
|
+
description: "TypeScript SDK and CLI for Morph Fast Apply integration",
|
|
41
|
+
type: "module",
|
|
42
|
+
main: "./dist/index.cjs",
|
|
43
|
+
module: "./dist/index.js",
|
|
44
|
+
types: "./dist/index.d.ts",
|
|
45
|
+
exports: {
|
|
46
|
+
".": {
|
|
47
|
+
types: "./dist/index.d.ts",
|
|
48
|
+
import: "./dist/index.js",
|
|
49
|
+
require: "./dist/index.cjs"
|
|
50
|
+
},
|
|
51
|
+
"./edge": {
|
|
52
|
+
types: "./dist/edge.d.ts",
|
|
53
|
+
import: "./dist/edge.js",
|
|
54
|
+
require: "./dist/edge.cjs"
|
|
55
|
+
},
|
|
56
|
+
"./tools/warp-grep": {
|
|
57
|
+
types: "./dist/tools/warp_grep/index.d.ts",
|
|
58
|
+
import: "./dist/tools/warp_grep/index.js",
|
|
59
|
+
require: "./dist/tools/warp_grep/index.cjs"
|
|
60
|
+
},
|
|
61
|
+
"./tools/warp-grep/openai": {
|
|
62
|
+
types: "./dist/tools/warp_grep/openai.d.ts",
|
|
63
|
+
import: "./dist/tools/warp_grep/openai.js",
|
|
64
|
+
require: "./dist/tools/warp_grep/openai.cjs"
|
|
65
|
+
},
|
|
66
|
+
"./tools/warp-grep/anthropic": {
|
|
67
|
+
types: "./dist/tools/warp_grep/anthropic.d.ts",
|
|
68
|
+
import: "./dist/tools/warp_grep/anthropic.js",
|
|
69
|
+
require: "./dist/tools/warp_grep/anthropic.cjs"
|
|
70
|
+
},
|
|
71
|
+
"./tools/warp-grep/vercel": {
|
|
72
|
+
types: "./dist/tools/warp_grep/vercel.d.ts",
|
|
73
|
+
import: "./dist/tools/warp_grep/vercel.js",
|
|
74
|
+
require: "./dist/tools/warp_grep/vercel.cjs"
|
|
75
|
+
},
|
|
76
|
+
"./tools/warp-grep/client": {
|
|
77
|
+
types: "./dist/tools/warp_grep/client.d.ts",
|
|
78
|
+
import: "./dist/tools/warp_grep/client.js",
|
|
79
|
+
require: "./dist/tools/warp_grep/client.cjs"
|
|
80
|
+
},
|
|
81
|
+
"./tools/warp-grep/gemini": {
|
|
82
|
+
types: "./dist/tools/warp_grep/gemini.d.ts",
|
|
83
|
+
import: "./dist/tools/warp_grep/gemini.js",
|
|
84
|
+
require: "./dist/tools/warp_grep/gemini.cjs"
|
|
85
|
+
},
|
|
86
|
+
"./tools/warp-grep/harness": {
|
|
87
|
+
types: "./dist/tools/warp_grep/harness.d.ts",
|
|
88
|
+
import: "./dist/tools/warp_grep/harness.js",
|
|
89
|
+
require: "./dist/tools/warp_grep/harness.cjs"
|
|
90
|
+
},
|
|
91
|
+
"./tools/fastapply": {
|
|
92
|
+
types: "./dist/tools/fastapply/index.d.ts",
|
|
93
|
+
import: "./dist/tools/fastapply/index.js",
|
|
94
|
+
require: "./dist/tools/fastapply/index.cjs"
|
|
95
|
+
},
|
|
96
|
+
"./tools/fastapply/anthropic": {
|
|
97
|
+
types: "./dist/tools/fastapply/anthropic.d.ts",
|
|
98
|
+
import: "./dist/tools/fastapply/anthropic.js",
|
|
99
|
+
require: "./dist/tools/fastapply/anthropic.cjs"
|
|
100
|
+
},
|
|
101
|
+
"./tools/fastapply/openai": {
|
|
102
|
+
types: "./dist/tools/fastapply/openai.d.ts",
|
|
103
|
+
import: "./dist/tools/fastapply/openai.js",
|
|
104
|
+
require: "./dist/tools/fastapply/openai.cjs"
|
|
105
|
+
},
|
|
106
|
+
"./tools/fastapply/vercel": {
|
|
107
|
+
types: "./dist/tools/fastapply/vercel.d.ts",
|
|
108
|
+
import: "./dist/tools/fastapply/vercel.js",
|
|
109
|
+
require: "./dist/tools/fastapply/vercel.cjs"
|
|
110
|
+
},
|
|
111
|
+
"./tools/codebase-search": {
|
|
112
|
+
types: "./dist/tools/codebase_search/index.d.ts",
|
|
113
|
+
import: "./dist/tools/codebase_search/index.js",
|
|
114
|
+
require: "./dist/tools/codebase_search/index.cjs"
|
|
115
|
+
},
|
|
116
|
+
"./tools/codebase-search/anthropic": {
|
|
117
|
+
types: "./dist/tools/codebase_search/anthropic.d.ts",
|
|
118
|
+
import: "./dist/tools/codebase_search/anthropic.js",
|
|
119
|
+
require: "./dist/tools/codebase_search/anthropic.cjs"
|
|
120
|
+
},
|
|
121
|
+
"./tools/codebase-search/openai": {
|
|
122
|
+
types: "./dist/tools/codebase_search/openai.d.ts",
|
|
123
|
+
import: "./dist/tools/codebase_search/openai.js",
|
|
124
|
+
require: "./dist/tools/codebase_search/openai.cjs"
|
|
125
|
+
},
|
|
126
|
+
"./tools/codebase-search/vercel": {
|
|
127
|
+
types: "./dist/tools/codebase_search/vercel.d.ts",
|
|
128
|
+
import: "./dist/tools/codebase_search/vercel.js",
|
|
129
|
+
require: "./dist/tools/codebase_search/vercel.cjs"
|
|
130
|
+
},
|
|
131
|
+
"./tools/git": {
|
|
132
|
+
types: "./dist/git/index.d.ts",
|
|
133
|
+
import: "./dist/git/index.js",
|
|
134
|
+
require: "./dist/git/index.cjs"
|
|
135
|
+
},
|
|
136
|
+
"./tools/browser": {
|
|
137
|
+
types: "./dist/tools/browser/index.d.ts",
|
|
138
|
+
import: "./dist/tools/browser/index.js",
|
|
139
|
+
require: "./dist/tools/browser/index.cjs"
|
|
140
|
+
},
|
|
141
|
+
"./tools/browser/anthropic": {
|
|
142
|
+
types: "./dist/tools/browser/anthropic.d.ts",
|
|
143
|
+
import: "./dist/tools/browser/anthropic.js",
|
|
144
|
+
require: "./dist/tools/browser/anthropic.cjs"
|
|
145
|
+
},
|
|
146
|
+
"./tools/browser/openai": {
|
|
147
|
+
types: "./dist/tools/browser/openai.d.ts",
|
|
148
|
+
import: "./dist/tools/browser/openai.js",
|
|
149
|
+
require: "./dist/tools/browser/openai.cjs"
|
|
150
|
+
},
|
|
151
|
+
"./tools/browser/vercel": {
|
|
152
|
+
types: "./dist/tools/browser/vercel.d.ts",
|
|
153
|
+
import: "./dist/tools/browser/vercel.js",
|
|
154
|
+
require: "./dist/tools/browser/vercel.cjs"
|
|
155
|
+
},
|
|
156
|
+
"./tools/browser/profiles": {
|
|
157
|
+
types: "./dist/tools/browser/profiles/index.d.ts",
|
|
158
|
+
import: "./dist/tools/browser/profiles/index.js",
|
|
159
|
+
require: "./dist/tools/browser/profiles/index.cjs"
|
|
160
|
+
},
|
|
161
|
+
"./modelrouter": {
|
|
162
|
+
types: "./dist/modelrouter/index.d.ts",
|
|
163
|
+
import: "./dist/modelrouter/index.js",
|
|
164
|
+
require: "./dist/modelrouter/index.cjs"
|
|
165
|
+
},
|
|
166
|
+
"./tools/compact": {
|
|
167
|
+
types: "./dist/tools/compact/index.d.ts",
|
|
168
|
+
import: "./dist/tools/compact/index.js",
|
|
169
|
+
require: "./dist/tools/compact/index.cjs"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
files: [
|
|
173
|
+
"dist/**/*.js",
|
|
174
|
+
"dist/**/*.cjs",
|
|
175
|
+
"dist/**/*.d.ts",
|
|
176
|
+
"dist/**/*.map",
|
|
177
|
+
"!dist/**/__tests__/**",
|
|
178
|
+
"!dist/**/*.test.*"
|
|
179
|
+
],
|
|
180
|
+
scripts: {
|
|
181
|
+
build: "tsup version.ts index.ts edge.ts client.ts tools/index.ts tools/fastapply/index.ts tools/fastapply/core.ts tools/fastapply/apply.ts tools/fastapply/types.ts tools/fastapply/prompts.ts tools/fastapply/anthropic.ts tools/fastapply/openai.ts tools/fastapply/vercel.ts tools/codebase_search/index.ts tools/codebase_search/core.ts tools/codebase_search/types.ts tools/codebase_search/prompts.ts tools/codebase_search/anthropic.ts tools/codebase_search/openai.ts tools/codebase_search/vercel.ts tools/warp_grep/index.ts tools/warp_grep/client.ts tools/warp_grep/openai.ts tools/warp_grep/anthropic.ts tools/warp_grep/vercel.ts tools/warp_grep/gemini.ts tools/warp_grep/harness.ts tools/warp_grep/agent/config.ts tools/warp_grep/agent/prompt.ts tools/warp_grep/agent/parser.ts tools/warp_grep/agent/runner.ts tools/warp_grep/agent/types.ts tools/warp_grep/agent/formatter.ts tools/warp_grep/providers/types.ts tools/warp_grep/providers/local.ts tools/warp_grep/providers/remote.ts tools/warp_grep/tools/grep.ts tools/warp_grep/tools/analyse.ts tools/warp_grep/tools/read.ts tools/warp_grep/tools/finish.ts tools/warp_grep/utils/paths.ts tools/warp_grep/utils/ripgrep.ts tools/warp_grep/utils/format.ts tools/warp_grep/utils/files.ts git/index.ts git/client.ts git/config.ts git/types.ts tools/browser/index.ts tools/browser/core.ts tools/browser/types.ts tools/browser/prompts.ts tools/browser/anthropic.ts tools/browser/openai.ts tools/browser/vercel.ts tools/browser/live.ts tools/browser/errors.ts tools/browser/profiles/index.ts tools/browser/profiles/core.ts tools/browser/profiles/types.ts modelrouter/index.ts modelrouter/core.ts modelrouter/types.ts tools/compact/index.ts tools/compact/core.ts tools/compact/types.ts tools/utils/resilience.ts --format esm,cjs --sourcemap --clean --dts --dts-resolve",
|
|
182
|
+
prepare: "npm run build",
|
|
183
|
+
typecheck: "tsc --noEmit",
|
|
184
|
+
lint: "eslint .",
|
|
185
|
+
test: "vitest run",
|
|
186
|
+
"test:watch": "vitest watch",
|
|
187
|
+
"test:anthropic": "vitest run anthropic",
|
|
188
|
+
"test:openai": "vitest run openai",
|
|
189
|
+
"test:vercel": "vitest run vercel",
|
|
190
|
+
"test:git": "vitest run git",
|
|
191
|
+
"test:browser": "vitest run browser",
|
|
192
|
+
"test:agent": "npx tsx tests/fullAgentTest.ts",
|
|
193
|
+
"test:integration": "npx tsx tests/fullIntegrationTest.ts",
|
|
194
|
+
"release:patch": "npm version patch && npm publish",
|
|
195
|
+
"release:minor": "npm version minor && npm publish",
|
|
196
|
+
"release:major": "npm version major && npm publish"
|
|
197
|
+
},
|
|
198
|
+
keywords: [
|
|
199
|
+
"morph",
|
|
200
|
+
"fast-apply",
|
|
201
|
+
"cli",
|
|
202
|
+
"sdk",
|
|
203
|
+
"edit-file"
|
|
204
|
+
],
|
|
205
|
+
engines: {
|
|
206
|
+
node: ">=18"
|
|
207
|
+
},
|
|
208
|
+
license: "MIT",
|
|
209
|
+
dependencies: {
|
|
210
|
+
"@vscode/ripgrep": "^1.17.0",
|
|
211
|
+
ai: "^5.0.0",
|
|
212
|
+
diff: "^7.0.0",
|
|
213
|
+
"isomorphic-git": "^1.25.10",
|
|
214
|
+
openai: "^4.52.7",
|
|
215
|
+
zod: "^3.23.8"
|
|
216
|
+
},
|
|
217
|
+
devDependencies: {
|
|
218
|
+
"@ai-sdk/anthropic": "^1.0.9",
|
|
219
|
+
"@ai-sdk/openai": "^2.0.35",
|
|
220
|
+
"@anthropic-ai/sdk": "^0.30.1",
|
|
221
|
+
"@google/generative-ai": "^0.24.1",
|
|
222
|
+
"@types/diff": "^7.0.2",
|
|
223
|
+
"@types/node": "^20.14.10",
|
|
224
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
225
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
226
|
+
dotenv: "^16.4.5",
|
|
227
|
+
eslint: "^8.57.0",
|
|
228
|
+
shx: "^0.3.4",
|
|
229
|
+
tsup: "^8.5.0",
|
|
230
|
+
tsx: "^4.16.2",
|
|
231
|
+
typescript: "^5.5.4",
|
|
232
|
+
vitest: "^2.1.6"
|
|
233
|
+
},
|
|
234
|
+
peerDependencies: {
|
|
235
|
+
"@anthropic-ai/sdk": ">=0.25.0",
|
|
236
|
+
"@google/generative-ai": ">=0.21.0",
|
|
237
|
+
ai: ">=5.0.0",
|
|
238
|
+
zod: ">=3.23.0"
|
|
239
|
+
},
|
|
240
|
+
peerDependenciesMeta: {
|
|
241
|
+
"@anthropic-ai/sdk": {
|
|
242
|
+
optional: true
|
|
243
|
+
},
|
|
244
|
+
"@google/generative-ai": {
|
|
245
|
+
optional: true
|
|
246
|
+
},
|
|
247
|
+
ai: {
|
|
248
|
+
optional: true
|
|
249
|
+
},
|
|
250
|
+
zod: {
|
|
251
|
+
optional: true
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
publishConfig: {
|
|
255
|
+
access: "public"
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
// version.ts
|
|
262
|
+
var SDK_VERSION;
|
|
263
|
+
var init_version = __esm({
|
|
264
|
+
"version.ts"() {
|
|
265
|
+
"use strict";
|
|
266
|
+
init_package();
|
|
267
|
+
SDK_VERSION = package_default.version;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
|
|
33
271
|
// tools/fastapply/apply.ts
|
|
34
272
|
var apply_exports = {};
|
|
35
273
|
__export(apply_exports, {
|
|
@@ -90,7 +328,8 @@ async function callMorphAPI(originalCode, codeEdit, instructions, filepath, conf
|
|
|
90
328
|
apiKey,
|
|
91
329
|
baseURL: `${apiUrl}/v1`,
|
|
92
330
|
timeout,
|
|
93
|
-
maxRetries: config.retryConfig?.maxRetries ?? 3
|
|
331
|
+
maxRetries: config.retryConfig?.maxRetries ?? 3,
|
|
332
|
+
defaultHeaders: { "X-Morph-SDK-Version": SDK_VERSION }
|
|
94
333
|
});
|
|
95
334
|
const completion = await client.chat.completions.create({
|
|
96
335
|
model: "morph-v3-fast",
|
|
@@ -145,6 +384,7 @@ var init_apply = __esm({
|
|
|
145
384
|
"use strict";
|
|
146
385
|
import_diff = require("diff");
|
|
147
386
|
import_openai = __toESM(require("openai"), 1);
|
|
387
|
+
init_version();
|
|
148
388
|
DEFAULT_API_URL = "https://api.morphllm.com";
|
|
149
389
|
DEFAULT_TIMEOUT = 3e4;
|
|
150
390
|
}
|