@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
package/dist/client.js
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import "./chunk-NRG6QX3L.js";
|
|
34
|
-
import "./chunk-MLKGABMK.js";
|
|
35
|
-
export {
|
|
36
|
-
MorphClient
|
|
37
|
-
};
|
|
1
|
+
export { MorphClient } from './chunk-AXEKIRRY.js';
|
|
2
|
+
import './chunk-AJBZA23L.js';
|
|
3
|
+
import './chunk-JY6COF3X.js';
|
|
4
|
+
import './chunk-2UIOCSVJ.js';
|
|
5
|
+
import './chunk-UAPK3AIJ.js';
|
|
6
|
+
import './chunk-GDFPZ3NJ.js';
|
|
7
|
+
import './chunk-NLACTMZT.js';
|
|
8
|
+
import './chunk-J56Q6C4Y.js';
|
|
9
|
+
import './chunk-PA3UTI4A.js';
|
|
10
|
+
import './chunk-LLQH6CCB.js';
|
|
11
|
+
import './chunk-IUM6CQYX.js';
|
|
12
|
+
import './chunk-E3XNKAMI.js';
|
|
13
|
+
import './chunk-66THRMD7.js';
|
|
14
|
+
import './chunk-HDP4QAZL.js';
|
|
15
|
+
import './chunk-RYVW7RUM.js';
|
|
16
|
+
import './chunk-OPDWMD4Q.js';
|
|
17
|
+
import './chunk-GIQAIHUI.js';
|
|
18
|
+
import './chunk-44OIEPIO.js';
|
|
19
|
+
import './chunk-M34E2AMK.js';
|
|
20
|
+
import './chunk-4OUGA3KS.js';
|
|
21
|
+
import './chunk-N7UKZ5X7.js';
|
|
22
|
+
import './chunk-ETBRAKVV.js';
|
|
23
|
+
import './chunk-JUGNTIVU.js';
|
|
24
|
+
import './chunk-EZ2OFDBJ.js';
|
|
25
|
+
import './chunk-H3HRSRR5.js';
|
|
26
|
+
import './chunk-KLVJIC2O.js';
|
|
27
|
+
import './chunk-6WP7EA4F.js';
|
|
28
|
+
import './chunk-EI2M567U.js';
|
|
29
|
+
import './chunk-E7FLETFO.js';
|
|
30
|
+
import './chunk-OCCGJ4S6.js';
|
|
31
|
+
import './chunk-NRG6QX3L.js';
|
|
32
|
+
import './chunk-MLKGABMK.js';
|
package/dist/core/client.cjs
CHANGED
|
@@ -1,481 +1,15 @@
|
|
|
1
|
-
|
|
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);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// package.json
|
|
38
|
-
var package_default = {
|
|
39
|
-
name: "@morphllm/morphsdk",
|
|
40
|
-
version: "0.2.201",
|
|
41
|
-
description: "TypeScript SDK and CLI for Morph Fast Apply integration",
|
|
42
|
-
type: "module",
|
|
43
|
-
main: "./dist/index.cjs",
|
|
44
|
-
module: "./dist/index.js",
|
|
45
|
-
types: "./dist/index.d.ts",
|
|
46
|
-
exports: {
|
|
47
|
-
".": {
|
|
48
|
-
types: "./dist/index.d.ts",
|
|
49
|
-
import: "./dist/index.js",
|
|
50
|
-
require: "./dist/index.cjs"
|
|
51
|
-
},
|
|
52
|
-
"./logger": {
|
|
53
|
-
types: "./dist/logger.d.ts",
|
|
54
|
-
import: "./dist/logger.js",
|
|
55
|
-
require: "./dist/logger.cjs"
|
|
56
|
-
},
|
|
57
|
-
"./edge": {
|
|
58
|
-
types: "./dist/edge.d.ts",
|
|
59
|
-
import: "./dist/edge.js",
|
|
60
|
-
require: "./dist/edge.cjs"
|
|
61
|
-
},
|
|
62
|
-
"./tools/warp-grep": {
|
|
63
|
-
types: "./dist/tools/warp_grep/index.d.ts",
|
|
64
|
-
import: "./dist/tools/warp_grep/index.js",
|
|
65
|
-
require: "./dist/tools/warp_grep/index.cjs"
|
|
66
|
-
},
|
|
67
|
-
"./tools/warp-grep/openai": {
|
|
68
|
-
types: "./dist/tools/warp_grep/openai.d.ts",
|
|
69
|
-
import: "./dist/tools/warp_grep/openai.js",
|
|
70
|
-
require: "./dist/tools/warp_grep/openai.cjs"
|
|
71
|
-
},
|
|
72
|
-
"./tools/warp-grep/anthropic": {
|
|
73
|
-
types: "./dist/tools/warp_grep/anthropic.d.ts",
|
|
74
|
-
import: "./dist/tools/warp_grep/anthropic.js",
|
|
75
|
-
require: "./dist/tools/warp_grep/anthropic.cjs"
|
|
76
|
-
},
|
|
77
|
-
"./tools/warp-grep/vercel": {
|
|
78
|
-
types: "./dist/tools/warp_grep/vercel.d.ts",
|
|
79
|
-
import: "./dist/tools/warp_grep/vercel.js",
|
|
80
|
-
require: "./dist/tools/warp_grep/vercel.cjs"
|
|
81
|
-
},
|
|
82
|
-
"./tools/warp-grep/client": {
|
|
83
|
-
types: "./dist/tools/warp_grep/client.d.ts",
|
|
84
|
-
import: "./dist/tools/warp_grep/client.js",
|
|
85
|
-
require: "./dist/tools/warp_grep/client.cjs"
|
|
86
|
-
},
|
|
87
|
-
"./tools/warp-grep/gemini": {
|
|
88
|
-
types: "./dist/tools/warp_grep/gemini.d.ts",
|
|
89
|
-
import: "./dist/tools/warp_grep/gemini.js",
|
|
90
|
-
require: "./dist/tools/warp_grep/gemini.cjs"
|
|
91
|
-
},
|
|
92
|
-
"./tools/warp-grep/harness": {
|
|
93
|
-
types: "./dist/tools/warp_grep/harness.d.ts",
|
|
94
|
-
import: "./dist/tools/warp_grep/harness.js",
|
|
95
|
-
require: "./dist/tools/warp_grep/harness.cjs"
|
|
96
|
-
},
|
|
97
|
-
"./tools/fastapply": {
|
|
98
|
-
types: "./dist/tools/fastapply/index.d.ts",
|
|
99
|
-
import: "./dist/tools/fastapply/index.js",
|
|
100
|
-
require: "./dist/tools/fastapply/index.cjs"
|
|
101
|
-
},
|
|
102
|
-
"./tools/fastapply/anthropic": {
|
|
103
|
-
types: "./dist/tools/fastapply/anthropic.d.ts",
|
|
104
|
-
import: "./dist/tools/fastapply/anthropic.js",
|
|
105
|
-
require: "./dist/tools/fastapply/anthropic.cjs"
|
|
106
|
-
},
|
|
107
|
-
"./tools/fastapply/openai": {
|
|
108
|
-
types: "./dist/tools/fastapply/openai.d.ts",
|
|
109
|
-
import: "./dist/tools/fastapply/openai.js",
|
|
110
|
-
require: "./dist/tools/fastapply/openai.cjs"
|
|
111
|
-
},
|
|
112
|
-
"./tools/fastapply/vercel": {
|
|
113
|
-
types: "./dist/tools/fastapply/vercel.d.ts",
|
|
114
|
-
import: "./dist/tools/fastapply/vercel.js",
|
|
115
|
-
require: "./dist/tools/fastapply/vercel.cjs"
|
|
116
|
-
},
|
|
117
|
-
"./modelrouter": {
|
|
118
|
-
types: "./dist/modelrouter/index.d.ts",
|
|
119
|
-
import: "./dist/modelrouter/index.js",
|
|
120
|
-
require: "./dist/modelrouter/index.cjs"
|
|
121
|
-
},
|
|
122
|
-
"./tools/compact": {
|
|
123
|
-
types: "./dist/tools/compact/index.d.ts",
|
|
124
|
-
import: "./dist/tools/compact/index.js",
|
|
125
|
-
require: "./dist/tools/compact/index.cjs"
|
|
126
|
-
},
|
|
127
|
-
"./subagents": {
|
|
128
|
-
types: "./dist/subagents/index.d.ts",
|
|
129
|
-
import: "./dist/subagents/index.js",
|
|
130
|
-
require: "./dist/subagents/index.cjs"
|
|
131
|
-
},
|
|
132
|
-
"./subagents/vercel": {
|
|
133
|
-
types: "./dist/subagents/vercel.d.ts",
|
|
134
|
-
import: "./dist/subagents/vercel.js",
|
|
135
|
-
require: "./dist/subagents/vercel.cjs"
|
|
136
|
-
},
|
|
137
|
-
"./subagents/anthropic": {
|
|
138
|
-
types: "./dist/subagents/anthropic.d.ts",
|
|
139
|
-
import: "./dist/subagents/anthropic.js",
|
|
140
|
-
require: "./dist/subagents/anthropic.cjs"
|
|
141
|
-
},
|
|
142
|
-
"./ai-sdk": {
|
|
143
|
-
types: "./dist/ai-sdk/index.d.ts",
|
|
144
|
-
import: "./dist/ai-sdk/index.js",
|
|
145
|
-
require: "./dist/ai-sdk/index.cjs"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
files: [
|
|
149
|
-
"dist/**/*.js",
|
|
150
|
-
"dist/**/*.cjs",
|
|
151
|
-
"dist/**/*.d.ts",
|
|
152
|
-
"!dist/**/__tests__/**",
|
|
153
|
-
"!dist/**/*.test.*"
|
|
154
|
-
],
|
|
155
|
-
scripts: {
|
|
156
|
-
build: "tsup version.ts index.ts edge.ts client.ts core/index.ts core/client.ts core/resource.ts core/error.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/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/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/providers/code_storage_http.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/github.ts tools/warp_grep/utils/ripgrep.ts tools/warp_grep/utils/format.ts tools/warp_grep/utils/files.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 subagents/index.ts subagents/types.ts subagents/prompts.ts subagents/vercel.ts subagents/anthropic.ts --format esm,cjs --clean --dts --dts-resolve && tsup ai-sdk/index.ts --format esm,cjs --dts --no-clean --out-dir dist/ai-sdk",
|
|
157
|
-
prepare: "npm run build",
|
|
158
|
-
typecheck: "tsc --noEmit && tsc --noEmit -p ai-sdk/tsconfig.json",
|
|
159
|
-
lint: "eslint .",
|
|
160
|
-
test: "vitest run",
|
|
161
|
-
"test:watch": "vitest watch",
|
|
162
|
-
"test:anthropic": "vitest run anthropic",
|
|
163
|
-
"test:openai": "vitest run openai",
|
|
164
|
-
"test:vercel": "vitest run vercel",
|
|
165
|
-
"test:git": "vitest run git",
|
|
166
|
-
"test:agent": "npx tsx tests/fullAgentTest.ts",
|
|
167
|
-
"test:integration": "npx tsx tests/fullIntegrationTest.ts",
|
|
168
|
-
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
169
|
-
"release:patch": "npm version patch && npm publish",
|
|
170
|
-
"release:minor": "npm version minor && npm publish",
|
|
171
|
-
"release:major": "npm version major && npm publish"
|
|
172
|
-
},
|
|
173
|
-
keywords: [
|
|
174
|
-
"morph",
|
|
175
|
-
"fast-apply",
|
|
176
|
-
"cli",
|
|
177
|
-
"sdk",
|
|
178
|
-
"edit-file"
|
|
179
|
-
],
|
|
180
|
-
engines: {
|
|
181
|
-
node: ">=18"
|
|
182
|
-
},
|
|
183
|
-
license: "MIT",
|
|
184
|
-
dependencies: {
|
|
185
|
-
"@vscode/ripgrep": "^1.17.0",
|
|
186
|
-
ai: ">=5.0.0",
|
|
187
|
-
diff: "^7.0.0",
|
|
188
|
-
openai: "^4.52.7",
|
|
189
|
-
zod: ">=3.23.0"
|
|
190
|
-
},
|
|
191
|
-
devDependencies: {
|
|
192
|
-
"@ai-sdk/anthropic": "^2.0.70",
|
|
193
|
-
"@ai-sdk/openai": "^2.0.35",
|
|
194
|
-
"@anthropic-ai/sdk": "^0.30.1",
|
|
195
|
-
"@google/generative-ai": "^0.24.1",
|
|
196
|
-
"@types/diff": "^7.0.2",
|
|
197
|
-
"@types/node": "^20.14.10",
|
|
198
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
199
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
200
|
-
dotenv: "^16.4.5",
|
|
201
|
-
eslint: "^8.57.0",
|
|
202
|
-
shx: "^0.3.4",
|
|
203
|
-
tsup: "^8.5.0",
|
|
204
|
-
tsx: "^4.16.2",
|
|
205
|
-
typescript: "^5.5.4",
|
|
206
|
-
vitest: "^2.1.6"
|
|
207
|
-
},
|
|
208
|
-
peerDependencies: {
|
|
209
|
-
"@ai-sdk/openai-compatible": ">=2.0.74 <4",
|
|
210
|
-
"@anthropic-ai/sdk": ">=0.25.0",
|
|
211
|
-
"@google/generative-ai": ">=0.21.0",
|
|
212
|
-
ai: ">=5.0.0",
|
|
213
|
-
zod: ">=3.23.0"
|
|
214
|
-
},
|
|
215
|
-
peerDependenciesMeta: {
|
|
216
|
-
"@anthropic-ai/sdk": {
|
|
217
|
-
optional: true
|
|
218
|
-
},
|
|
219
|
-
"@google/generative-ai": {
|
|
220
|
-
optional: true
|
|
221
|
-
},
|
|
222
|
-
ai: {
|
|
223
|
-
optional: true
|
|
224
|
-
},
|
|
225
|
-
zod: {
|
|
226
|
-
optional: true
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
publishConfig: {
|
|
230
|
-
access: "public"
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
// version.ts
|
|
235
|
-
var SDK_VERSION = package_default.version;
|
|
236
|
-
|
|
237
|
-
// tools/utils/resilience.ts
|
|
238
|
-
var DEFAULT_RETRY_CONFIG = {
|
|
239
|
-
maxRetries: 3,
|
|
240
|
-
initialDelay: 1e3,
|
|
241
|
-
maxDelay: 3e4,
|
|
242
|
-
backoffMultiplier: 2,
|
|
243
|
-
retryableErrors: ["ECONNREFUSED", "ETIMEDOUT", "ENOTFOUND"]
|
|
244
|
-
};
|
|
245
|
-
async function fetchWithRetry(url, options, retryConfig = {}) {
|
|
246
|
-
const {
|
|
247
|
-
maxRetries = DEFAULT_RETRY_CONFIG.maxRetries,
|
|
248
|
-
initialDelay = DEFAULT_RETRY_CONFIG.initialDelay,
|
|
249
|
-
maxDelay = DEFAULT_RETRY_CONFIG.maxDelay,
|
|
250
|
-
backoffMultiplier = DEFAULT_RETRY_CONFIG.backoffMultiplier,
|
|
251
|
-
retryableErrors = DEFAULT_RETRY_CONFIG.retryableErrors,
|
|
252
|
-
onRetry
|
|
253
|
-
} = retryConfig;
|
|
254
|
-
let lastError = null;
|
|
255
|
-
let delay = initialDelay;
|
|
256
|
-
options = { ...options, headers: { "X-Morph-SDK-Version": SDK_VERSION, ...options.headers } };
|
|
257
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
258
|
-
try {
|
|
259
|
-
const response = await fetch(url, options);
|
|
260
|
-
if (response.status === 429 || response.status === 503) {
|
|
261
|
-
if (attempt < maxRetries) {
|
|
262
|
-
const retryAfter = response.headers.get("Retry-After");
|
|
263
|
-
const waitTime = retryAfter ? parseInt(retryAfter) * 1e3 : Math.min(delay, maxDelay);
|
|
264
|
-
const error = new Error(`HTTP ${response.status}: Retrying after ${waitTime}ms`);
|
|
265
|
-
if (onRetry) {
|
|
266
|
-
onRetry(attempt + 1, error);
|
|
267
|
-
}
|
|
268
|
-
await sleep(waitTime);
|
|
269
|
-
delay *= backoffMultiplier;
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return response;
|
|
274
|
-
} catch (error) {
|
|
275
|
-
lastError = error;
|
|
276
|
-
const isRetryable = retryableErrors.some(
|
|
277
|
-
(errType) => lastError?.message?.includes(errType)
|
|
278
|
-
);
|
|
279
|
-
if (!isRetryable || attempt === maxRetries) {
|
|
280
|
-
throw lastError;
|
|
281
|
-
}
|
|
282
|
-
const waitTime = Math.min(delay, maxDelay);
|
|
283
|
-
if (onRetry) {
|
|
284
|
-
onRetry(attempt + 1, lastError);
|
|
285
|
-
}
|
|
286
|
-
await sleep(waitTime);
|
|
287
|
-
delay *= backoffMultiplier;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
throw lastError || new Error("Max retries exceeded");
|
|
291
|
-
}
|
|
292
|
-
async function withTimeout(promise, timeoutMs, errorMessage) {
|
|
293
|
-
let timeoutId;
|
|
294
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
295
|
-
timeoutId = setTimeout(() => {
|
|
296
|
-
reject(new Error(errorMessage || `Operation timed out after ${timeoutMs}ms`));
|
|
297
|
-
}, timeoutMs);
|
|
298
|
-
});
|
|
299
|
-
try {
|
|
300
|
-
const result = await Promise.race([promise, timeoutPromise]);
|
|
301
|
-
clearTimeout(timeoutId);
|
|
302
|
-
return result;
|
|
303
|
-
} catch (error) {
|
|
304
|
-
clearTimeout(timeoutId);
|
|
305
|
-
throw error;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
function sleep(ms) {
|
|
309
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
310
|
-
}
|
|
311
|
-
var MorphError = class extends Error {
|
|
312
|
-
constructor(message, code, statusCode, retryable = false) {
|
|
313
|
-
super(message);
|
|
314
|
-
this.code = code;
|
|
315
|
-
this.statusCode = statusCode;
|
|
316
|
-
this.retryable = retryable;
|
|
317
|
-
this.name = "MorphError";
|
|
318
|
-
}
|
|
319
|
-
};
|
|
3
|
+
var chunk65W4I66Q_cjs = require('../chunk-65W4I66Q.cjs');
|
|
4
|
+
require('../chunk-VL4QNALG.cjs');
|
|
5
|
+
require('../chunk-ZLG2M2I4.cjs');
|
|
6
|
+
require('../chunk-OM5ZSXQW.cjs');
|
|
7
|
+
require('../chunk-TL34BLQD.cjs');
|
|
8
|
+
require('../chunk-75ZPJI57.cjs');
|
|
320
9
|
|
|
321
|
-
// logger.ts
|
|
322
|
-
var MorphLogger = class {
|
|
323
|
-
enabled;
|
|
324
|
-
fileStream;
|
|
325
|
-
/** Resolves once the file stream is initialized (or immediately if no file logging). */
|
|
326
|
-
ready;
|
|
327
|
-
constructor() {
|
|
328
|
-
this.enabled = typeof process !== "undefined" && (process.env.MORPH_DEBUG === "1" || !!process.env.MORPH_LOG_FILE);
|
|
329
|
-
this.fileStream = null;
|
|
330
|
-
const f = typeof process !== "undefined" ? process.env.MORPH_LOG_FILE : void 0;
|
|
331
|
-
if (f) {
|
|
332
|
-
this.ready = import("fs").then((fs) => {
|
|
333
|
-
this.fileStream = fs.createWriteStream(f, { flags: "a" });
|
|
334
|
-
}).catch(() => {
|
|
335
|
-
});
|
|
336
|
-
} else {
|
|
337
|
-
this.ready = Promise.resolve();
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
debug(component, msg, data) {
|
|
341
|
-
this._log("debug", component, msg, data);
|
|
342
|
-
}
|
|
343
|
-
info(component, msg, data) {
|
|
344
|
-
this._log("info", component, msg, data);
|
|
345
|
-
}
|
|
346
|
-
warn(component, msg, data) {
|
|
347
|
-
this._log("warn", component, msg, data);
|
|
348
|
-
}
|
|
349
|
-
error(component, msg, data) {
|
|
350
|
-
this._log("error", component, msg, data);
|
|
351
|
-
}
|
|
352
|
-
enable() {
|
|
353
|
-
this.enabled = true;
|
|
354
|
-
}
|
|
355
|
-
get isEnabled() {
|
|
356
|
-
return this.enabled;
|
|
357
|
-
}
|
|
358
|
-
_log(level, component, msg, data) {
|
|
359
|
-
if (level !== "error" && !this.enabled) return;
|
|
360
|
-
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
361
|
-
const prefix = `[${ts}] [${level.toUpperCase()}] [${component}]`;
|
|
362
|
-
console.error(data ? `${prefix} ${msg} ${JSON.stringify(data)}` : `${prefix} ${msg}`);
|
|
363
|
-
this.fileStream?.write(JSON.stringify({ ts, level, component, msg, ...data && { data } }) + "\n");
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
var logger = new MorphLogger();
|
|
367
10
|
|
|
368
|
-
// core/error.ts
|
|
369
|
-
async function toMorphError(response) {
|
|
370
|
-
let message = `Morph API request failed (${response.status})`;
|
|
371
|
-
let code = "api_error";
|
|
372
|
-
try {
|
|
373
|
-
const body = await response.json();
|
|
374
|
-
message = body.error?.message ?? body.message ?? message;
|
|
375
|
-
code = body.error?.code ?? body.error?.type ?? code;
|
|
376
|
-
} catch {
|
|
377
|
-
}
|
|
378
|
-
if (response.status === 401) code = "authentication_error";
|
|
379
|
-
if (response.status === 429) code = "rate_limit_exceeded";
|
|
380
|
-
const retryable = response.status === 429 || response.status === 503;
|
|
381
|
-
return new MorphError(message, code, response.status, retryable);
|
|
382
|
-
}
|
|
383
11
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
var DEFAULT_TIMEOUT = 6e4;
|
|
388
|
-
var env = (name) => typeof process !== "undefined" ? process.env?.[name] : void 0;
|
|
389
|
-
var stripTrailingSlash = (url) => url.replace(/\/+$/, "");
|
|
390
|
-
var MorphAPIClient = class {
|
|
391
|
-
/** Explicit key as provided; resolved against env at request time. */
|
|
392
|
-
apiKey;
|
|
393
|
-
baseURL;
|
|
394
|
-
reposURL;
|
|
395
|
-
/** Explicit default timeout (ms), if set. The request default is applied lazily so
|
|
396
|
-
* resources can read an undefined value and supply their own fallback. */
|
|
397
|
-
timeout;
|
|
398
|
-
retryConfig;
|
|
399
|
-
debug;
|
|
400
|
-
constructor(options = {}) {
|
|
401
|
-
this.apiKey = options.apiKey;
|
|
402
|
-
this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);
|
|
403
|
-
this.reposURL = stripTrailingSlash(options.reposURL ?? env("MORPH_SEARCH_URL") ?? DEFAULT_REPOS_URL);
|
|
404
|
-
this.timeout = options.timeout;
|
|
405
|
-
this.retryConfig = options.retryConfig;
|
|
406
|
-
this.debug = options.debug ?? false;
|
|
407
|
-
if (this.debug) logger.enable();
|
|
408
|
-
}
|
|
409
|
-
/** The key actually used for requests: explicit, else `MORPH_API_KEY`. */
|
|
410
|
-
resolveApiKey() {
|
|
411
|
-
return this.apiKey ?? env("MORPH_API_KEY");
|
|
412
|
-
}
|
|
413
|
-
/** Headers shared with tools that bring their own HTTP client (FastApply/WarpGrep via the `openai` package). */
|
|
414
|
-
defaultHeaders() {
|
|
415
|
-
return { "X-Morph-SDK-Version": SDK_VERSION };
|
|
416
|
-
}
|
|
417
|
-
buildURL(path, baseURL) {
|
|
418
|
-
if (/^https?:\/\//i.test(path)) return path;
|
|
419
|
-
const base = stripTrailingSlash(baseURL ?? this.baseURL);
|
|
420
|
-
return `${base}${path.startsWith("/") ? "" : "/"}${path}`;
|
|
421
|
-
}
|
|
422
|
-
buildHeaders(apiKey, extra) {
|
|
423
|
-
return {
|
|
424
|
-
"Content-Type": "application/json",
|
|
425
|
-
"X-Morph-SDK-Version": SDK_VERSION,
|
|
426
|
-
Authorization: `Bearer ${apiKey}`,
|
|
427
|
-
...extra
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
applyQuery(url, query) {
|
|
431
|
-
if (!query) return url;
|
|
432
|
-
const params = new URLSearchParams();
|
|
433
|
-
for (const [key, value] of Object.entries(query)) {
|
|
434
|
-
if (value !== void 0 && value !== null) params.set(key, String(value));
|
|
435
|
-
}
|
|
436
|
-
const qs = params.toString();
|
|
437
|
-
return qs ? `${url}${url.includes("?") ? "&" : "?"}${qs}` : url;
|
|
438
|
-
}
|
|
439
|
-
async request(method, path, opts = {}) {
|
|
440
|
-
const apiKey = this.resolveApiKey();
|
|
441
|
-
if (!apiKey) {
|
|
442
|
-
throw new MorphError(
|
|
443
|
-
"Morph API key not found. Set the MORPH_API_KEY environment variable or pass apiKey in config.",
|
|
444
|
-
"missing_api_key",
|
|
445
|
-
401
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
const url = this.applyQuery(this.buildURL(path, opts.baseURL), opts.query);
|
|
449
|
-
const timeout = opts.timeout ?? this.timeout ?? DEFAULT_TIMEOUT;
|
|
450
|
-
const init = {
|
|
451
|
-
method,
|
|
452
|
-
headers: this.buildHeaders(apiKey, opts.headers),
|
|
453
|
-
...opts.body !== void 0 ? { body: JSON.stringify(opts.body) } : {},
|
|
454
|
-
...opts.signal ? { signal: opts.signal } : {}
|
|
455
|
-
};
|
|
456
|
-
logger.debug("MorphAPIClient", "request", { method, url });
|
|
457
|
-
const response = await withTimeout(
|
|
458
|
-
fetchWithRetry(url, init, this.retryConfig ?? {}),
|
|
459
|
-
timeout,
|
|
460
|
-
`Morph request to ${url} timed out after ${timeout}ms`
|
|
461
|
-
);
|
|
462
|
-
if (!response.ok) throw await toMorphError(response);
|
|
463
|
-
if (opts.stream) return response;
|
|
464
|
-
if (response.status === 204) return void 0;
|
|
465
|
-
const text = await response.text();
|
|
466
|
-
return text ? JSON.parse(text) : void 0;
|
|
467
|
-
}
|
|
468
|
-
get(path, opts) {
|
|
469
|
-
return this.request("GET", path, opts);
|
|
470
|
-
}
|
|
471
|
-
post(path, opts) {
|
|
472
|
-
return this.request("POST", path, opts);
|
|
473
|
-
}
|
|
474
|
-
delete(path, opts) {
|
|
475
|
-
return this.request("DELETE", path, opts);
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
479
|
-
0 && (module.exports = {
|
|
480
|
-
MorphAPIClient
|
|
12
|
+
Object.defineProperty(exports, "MorphAPIClient", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunk65W4I66Q_cjs.MorphAPIClient; }
|
|
481
15
|
});
|
package/dist/core/client.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "../chunk-UZCXOOZO.js";
|
|
8
|
-
import "../chunk-MLKGABMK.js";
|
|
9
|
-
export {
|
|
10
|
-
MorphAPIClient
|
|
11
|
-
};
|
|
1
|
+
export { MorphAPIClient } from '../chunk-KLVJIC2O.js';
|
|
2
|
+
import '../chunk-6WP7EA4F.js';
|
|
3
|
+
import '../chunk-EI2M567U.js';
|
|
4
|
+
import '../chunk-E7FLETFO.js';
|
|
5
|
+
import '../chunk-OCCGJ4S6.js';
|
|
6
|
+
import '../chunk-MLKGABMK.js';
|