@morphllm/morphsdk 0.2.170 → 0.2.172
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-IY7DESC3.js → chunk-2SNAXTUJ.js} +4 -4
- package/dist/chunk-453ZV2AX.js +120 -0
- package/dist/chunk-453ZV2AX.js.map +1 -0
- package/dist/chunk-53ZJMCWU.js +142 -0
- package/dist/chunk-53ZJMCWU.js.map +1 -0
- package/dist/{chunk-5KFQBI4J.js → chunk-5DA6SZQJ.js} +2 -2
- package/dist/chunk-66OHYI24.js +78 -0
- package/dist/chunk-66OHYI24.js.map +1 -0
- package/dist/chunk-6X6QMRQG.js +158 -0
- package/dist/chunk-6X6QMRQG.js.map +1 -0
- package/dist/{chunk-76XER44U.js → chunk-7PVVPLRL.js} +2 -2
- package/dist/{chunk-BCPZAPWY.js → chunk-AE7M2I52.js} +2 -2
- package/dist/{chunk-LNXIVRPY.js → chunk-CQF76HJC.js} +30 -6
- package/dist/chunk-CQF76HJC.js.map +1 -0
- package/dist/{chunk-OJQYBWHR.js → chunk-ESXCQBMU.js} +2 -2
- package/dist/{chunk-LAGN62H5.js → chunk-FOIDGIY4.js} +29 -10
- package/dist/chunk-FOIDGIY4.js.map +1 -0
- package/dist/{chunk-KUPSW5QN.js → chunk-GJZXDRH5.js} +8 -3
- package/dist/{chunk-KUPSW5QN.js.map → chunk-GJZXDRH5.js.map} +1 -1
- package/dist/{chunk-5IR3YE77.js → chunk-IJ33I7P5.js} +4 -4
- package/dist/{chunk-E5QWXVTF.js → chunk-IN2U7AAI.js} +99 -143
- package/dist/chunk-IN2U7AAI.js.map +1 -0
- package/dist/{chunk-LE66XCOI.js → chunk-JWZ5DLAS.js} +27 -10
- package/dist/chunk-JWZ5DLAS.js.map +1 -0
- package/dist/chunk-LKFZBBTD.js +12 -0
- package/dist/chunk-LKFZBBTD.js.map +1 -0
- package/dist/{chunk-6LPWEZ6H.js → chunk-MO6S2LRD.js} +2 -2
- package/dist/{chunk-S4IEM5EG.js → chunk-NI7PWQ3B.js} +4 -4
- package/dist/{chunk-GLQWEINZ.js → chunk-QAXXE4AD.js} +2 -2
- package/dist/{chunk-YG2I377B.js → chunk-QFE5523Q.js} +18 -3
- package/dist/chunk-QFE5523Q.js.map +1 -0
- package/dist/{chunk-G4FPDEUP.js → chunk-QQXNZIVK.js} +4 -4
- package/dist/{chunk-A3ZUWLYX.js → chunk-QZ3V2BP7.js} +2 -2
- package/dist/chunk-QZR7SJ5N.js +24 -0
- package/dist/chunk-QZR7SJ5N.js.map +1 -0
- package/dist/{chunk-SYD6BRQX.js → chunk-SJVLAGUL.js} +4 -4
- package/dist/{chunk-JMEQ6FLB.js → chunk-U4J3BVAQ.js} +4 -4
- package/dist/{chunk-QAWYDWDW.js → chunk-U4MRSZQQ.js} +2 -2
- package/dist/{chunk-WU3D46MH.js → chunk-UADW6FYD.js} +2 -2
- package/dist/{chunk-K7NY5SVR.js → chunk-VBARKJWL.js} +2 -2
- package/dist/{chunk-OPNTDMHH.js → chunk-VLZ6PNAD.js} +4 -4
- package/dist/chunk-VZ7BOH2K.js +1 -0
- package/dist/chunk-VZ7BOH2K.js.map +1 -0
- package/dist/{chunk-GUGHUAJU.js → chunk-XJDXV5VX.js} +2 -2
- package/dist/{chunk-GPNUS3H2.js → chunk-XYTYIAMQ.js} +2 -2
- package/dist/{chunk-MKBVWPU7.js → chunk-Z4GJVN52.js} +23 -8
- package/dist/chunk-Z4GJVN52.js.map +1 -0
- package/dist/chunk-ZLSNL6M2.js +97 -0
- package/dist/chunk-ZLSNL6M2.js.map +1 -0
- package/dist/{client-DsAAqupx.d.ts → client-Dh6yzCm4.d.ts} +14 -5
- package/dist/client.cjs +741 -525
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +5 -1
- package/dist/client.js +31 -27
- package/dist/core/client.cjs +540 -0
- package/dist/core/client.cjs.map +1 -0
- package/dist/core/client.d.ts +79 -0
- package/dist/core/client.js +12 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/error.cjs +309 -0
- package/dist/core/error.cjs.map +1 -0
- package/dist/core/error.d.ts +18 -0
- package/dist/core/error.js +10 -0
- package/dist/core/error.js.map +1 -0
- package/dist/core/index.cjs +552 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +20 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/resource.cjs +36 -0
- package/dist/core/resource.cjs.map +1 -0
- package/dist/core/resource.d.ts +18 -0
- package/dist/core/resource.js +8 -0
- package/dist/core/resource.js.map +1 -0
- package/dist/edge.cjs +252 -174
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.d.ts +2 -0
- package/dist/edge.js +8 -5
- package/dist/git/client.cjs +529 -9
- package/dist/git/client.cjs.map +1 -1
- package/dist/git/client.d.ts +8 -2
- package/dist/git/client.js +7 -1
- package/dist/git/index.cjs +529 -9
- package/dist/git/index.cjs.map +1 -1
- package/dist/git/index.d.ts +2 -0
- package/dist/git/index.js +7 -1
- package/dist/index.cjs +688 -466
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +49 -33
- package/dist/modelrouter/core.cjs +204 -125
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.d.ts +36 -9
- package/dist/modelrouter/core.js +6 -3
- package/dist/modelrouter/index.cjs +204 -125
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.d.ts +3 -0
- package/dist/modelrouter/index.js +6 -3
- package/dist/subagents/anthropic.cjs +268 -52
- package/dist/subagents/anthropic.cjs.map +1 -1
- package/dist/subagents/anthropic.js +10 -6
- package/dist/subagents/vercel.cjs +268 -52
- package/dist/subagents/vercel.cjs.map +1 -1
- package/dist/subagents/vercel.js +10 -6
- package/dist/tools/browser/anthropic.cjs +7 -2
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +9 -6
- package/dist/tools/browser/core.cjs +162 -10
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.d.ts +8 -2
- package/dist/tools/browser/core.js +8 -5
- package/dist/tools/browser/index.cjs +163 -11
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.d.ts +2 -0
- package/dist/tools/browser/index.js +18 -15
- package/dist/tools/browser/index.js.map +1 -1
- package/dist/tools/browser/openai.cjs +7 -2
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +9 -6
- package/dist/tools/browser/profiles/core.cjs +7 -2
- 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 +7 -2
- 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 +7 -2
- package/dist/tools/browser/vercel.cjs.map +1 -1
- package/dist/tools/browser/vercel.js +9 -6
- package/dist/tools/codebase_search/anthropic.cjs +162 -41
- package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
- package/dist/tools/codebase_search/anthropic.js +7 -4
- package/dist/tools/codebase_search/core.cjs +195 -66
- package/dist/tools/codebase_search/core.cjs.map +1 -1
- package/dist/tools/codebase_search/core.d.ts +18 -7
- package/dist/tools/codebase_search/core.js +6 -3
- package/dist/tools/codebase_search/index.cjs +162 -41
- package/dist/tools/codebase_search/index.cjs.map +1 -1
- package/dist/tools/codebase_search/index.d.ts +2 -0
- package/dist/tools/codebase_search/index.js +13 -10
- package/dist/tools/codebase_search/openai.cjs +162 -41
- package/dist/tools/codebase_search/openai.cjs.map +1 -1
- package/dist/tools/codebase_search/openai.js +7 -4
- package/dist/tools/codebase_search/vercel.cjs +162 -41
- package/dist/tools/codebase_search/vercel.cjs.map +1 -1
- package/dist/tools/codebase_search/vercel.js +7 -4
- package/dist/tools/compact/core.cjs +551 -47
- package/dist/tools/compact/core.cjs.map +1 -1
- package/dist/tools/compact/core.d.ts +16 -3
- package/dist/tools/compact/core.js +7 -1
- package/dist/tools/compact/index.cjs +549 -47
- package/dist/tools/compact/index.cjs.map +1 -1
- package/dist/tools/compact/index.d.ts +2 -0
- package/dist/tools/compact/index.js +8 -2
- package/dist/tools/fastapply/anthropic.cjs +32 -3
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +8 -4
- package/dist/tools/fastapply/apply.cjs +23 -3
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.js +2 -2
- package/dist/tools/fastapply/core.cjs +258 -13
- package/dist/tools/fastapply/core.cjs.map +1 -1
- package/dist/tools/fastapply/core.d.ts +8 -2
- package/dist/tools/fastapply/core.js +7 -3
- package/dist/tools/fastapply/index.cjs +32 -3
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.d.ts +2 -0
- package/dist/tools/fastapply/index.js +13 -9
- package/dist/tools/fastapply/openai.cjs +32 -3
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +8 -4
- package/dist/tools/fastapply/vercel.cjs +32 -3
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.js +8 -4
- package/dist/tools/index.cjs +32 -3
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +13 -9
- package/dist/tools/reflex/core.cjs +693 -0
- package/dist/tools/reflex/core.cjs.map +1 -0
- package/dist/tools/reflex/core.d.ts +53 -0
- package/dist/tools/reflex/core.js +16 -0
- package/dist/tools/reflex/core.js.map +1 -0
- package/dist/tools/reflex/index.cjs +693 -0
- package/dist/tools/reflex/index.cjs.map +1 -0
- package/dist/tools/reflex/index.d.ts +5 -0
- package/dist/tools/reflex/index.js +16 -0
- package/dist/tools/reflex/index.js.map +1 -0
- package/dist/tools/reflex/types.cjs +19 -0
- package/dist/tools/reflex/types.cjs.map +1 -0
- package/dist/tools/reflex/types.d.ts +113 -0
- package/dist/tools/reflex/types.js +1 -0
- package/dist/tools/reflex/types.js.map +1 -0
- package/dist/tools/utils/resilience.cjs +7 -2
- 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 +7 -2
- 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 +268 -52
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.d.ts +2 -0
- package/dist/tools/warp_grep/anthropic.js +10 -6
- package/dist/tools/warp_grep/client.cjs +268 -52
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.d.ts +8 -2
- package/dist/tools/warp_grep/client.js +9 -5
- package/dist/tools/warp_grep/gemini.cjs +268 -52
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.d.ts +2 -0
- package/dist/tools/warp_grep/gemini.js +9 -5
- package/dist/tools/warp_grep/gemini.js.map +1 -1
- package/dist/tools/warp_grep/harness.js +5 -5
- package/dist/tools/warp_grep/index.cjs +268 -52
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.d.ts +2 -0
- package/dist/tools/warp_grep/index.js +12 -8
- package/dist/tools/warp_grep/openai.cjs +268 -52
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.d.ts +2 -0
- package/dist/tools/warp_grep/openai.js +10 -6
- package/dist/tools/warp_grep/providers/local.js +2 -2
- package/dist/tools/warp_grep/vercel.cjs +268 -52
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.d.ts +2 -0
- package/dist/tools/warp_grep/vercel.js +10 -6
- package/dist/version.cjs +7 -2
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -2
- package/dist/chunk-E5QWXVTF.js.map +0 -1
- package/dist/chunk-INBZD4EX.js +0 -197
- package/dist/chunk-INBZD4EX.js.map +0 -1
- package/dist/chunk-LAGN62H5.js.map +0 -1
- package/dist/chunk-LE66XCOI.js.map +0 -1
- package/dist/chunk-LNXIVRPY.js.map +0 -1
- package/dist/chunk-MKBVWPU7.js.map +0 -1
- package/dist/chunk-SCVWDNQP.js +0 -84
- package/dist/chunk-SCVWDNQP.js.map +0 -1
- package/dist/chunk-VE7J6VYX.js +0 -102
- package/dist/chunk-VE7J6VYX.js.map +0 -1
- package/dist/chunk-YG2I377B.js.map +0 -1
- /package/dist/{chunk-IY7DESC3.js.map → chunk-2SNAXTUJ.js.map} +0 -0
- /package/dist/{chunk-5KFQBI4J.js.map → chunk-5DA6SZQJ.js.map} +0 -0
- /package/dist/{chunk-76XER44U.js.map → chunk-7PVVPLRL.js.map} +0 -0
- /package/dist/{chunk-BCPZAPWY.js.map → chunk-AE7M2I52.js.map} +0 -0
- /package/dist/{chunk-OJQYBWHR.js.map → chunk-ESXCQBMU.js.map} +0 -0
- /package/dist/{chunk-5IR3YE77.js.map → chunk-IJ33I7P5.js.map} +0 -0
- /package/dist/{chunk-6LPWEZ6H.js.map → chunk-MO6S2LRD.js.map} +0 -0
- /package/dist/{chunk-S4IEM5EG.js.map → chunk-NI7PWQ3B.js.map} +0 -0
- /package/dist/{chunk-GLQWEINZ.js.map → chunk-QAXXE4AD.js.map} +0 -0
- /package/dist/{chunk-G4FPDEUP.js.map → chunk-QQXNZIVK.js.map} +0 -0
- /package/dist/{chunk-A3ZUWLYX.js.map → chunk-QZ3V2BP7.js.map} +0 -0
- /package/dist/{chunk-SYD6BRQX.js.map → chunk-SJVLAGUL.js.map} +0 -0
- /package/dist/{chunk-JMEQ6FLB.js.map → chunk-U4J3BVAQ.js.map} +0 -0
- /package/dist/{chunk-QAWYDWDW.js.map → chunk-U4MRSZQQ.js.map} +0 -0
- /package/dist/{chunk-WU3D46MH.js.map → chunk-UADW6FYD.js.map} +0 -0
- /package/dist/{chunk-K7NY5SVR.js.map → chunk-VBARKJWL.js.map} +0 -0
- /package/dist/{chunk-OPNTDMHH.js.map → chunk-VLZ6PNAD.js.map} +0 -0
- /package/dist/{chunk-GUGHUAJU.js.map → chunk-XJDXV5VX.js.map} +0 -0
- /package/dist/{chunk-GPNUS3H2.js.map → chunk-XYTYIAMQ.js.map} +0 -0
|
@@ -3,6 +3,8 @@ export { formatResult } from './client.js';
|
|
|
3
3
|
import { d as WarpGrepToolConfig, b as WarpGrepResult, g as GitHubSearchToolConfig, h as GitHubReadFileToolConfig, e as GitHubReadFileInput, f as GitHubReadFileResult } from '../../types-CtkD4o1_.js';
|
|
4
4
|
import './agent/types.js';
|
|
5
5
|
import '../utils/resilience.js';
|
|
6
|
+
import '../../core/client.js';
|
|
7
|
+
import '../../core/resource.js';
|
|
6
8
|
import './providers/types.js';
|
|
7
9
|
|
|
8
10
|
/**
|
|
@@ -5,22 +5,26 @@ import {
|
|
|
5
5
|
execute,
|
|
6
6
|
openai_default,
|
|
7
7
|
warpGrepTool
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-U4MRSZQQ.js";
|
|
9
9
|
import "../../chunk-Q6QCHAMD.js";
|
|
10
10
|
import {
|
|
11
11
|
formatResult
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-CQF76HJC.js";
|
|
13
13
|
import "../../chunk-63VHBANJ.js";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-7PVVPLRL.js";
|
|
15
15
|
import "../../chunk-GVGJIXV2.js";
|
|
16
16
|
import "../../chunk-A4D2CIIT.js";
|
|
17
17
|
import "../../chunk-IA5K2HTC.js";
|
|
18
18
|
import "../../chunk-FBRNUWEB.js";
|
|
19
19
|
import "../../chunk-CCJK3HTG.js";
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-QAXXE4AD.js";
|
|
21
|
+
import "../../chunk-66OHYI24.js";
|
|
22
|
+
import "../../chunk-453ZV2AX.js";
|
|
22
23
|
import "../../chunk-F3NCFNUX.js";
|
|
23
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-QZR7SJ5N.js";
|
|
25
|
+
import "../../chunk-XYTYIAMQ.js";
|
|
26
|
+
import "../../chunk-GJZXDRH5.js";
|
|
27
|
+
import "../../chunk-LKFZBBTD.js";
|
|
24
28
|
import "../../chunk-PZ5AY32C.js";
|
|
25
29
|
export {
|
|
26
30
|
createGitHubReadFileTool,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocalRipgrepProvider
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-G2RSY56Q.js";
|
|
3
|
+
} from "../../../chunk-VLZ6PNAD.js";
|
|
5
4
|
import "../../../chunk-YPKNMYD4.js";
|
|
6
5
|
import "../../../chunk-TPP2UGQP.js";
|
|
6
|
+
import "../../../chunk-G2RSY56Q.js";
|
|
7
7
|
import "../../../chunk-CCJK3HTG.js";
|
|
8
8
|
import "../../../chunk-PZ5AY32C.js";
|
|
9
9
|
export {
|
|
@@ -942,7 +942,7 @@ var import_openai = __toESM(require("openai"), 1);
|
|
|
942
942
|
// package.json
|
|
943
943
|
var package_default = {
|
|
944
944
|
name: "@morphllm/morphsdk",
|
|
945
|
-
version: "0.2.
|
|
945
|
+
version: "0.2.172",
|
|
946
946
|
description: "TypeScript SDK and CLI for Morph Fast Apply integration",
|
|
947
947
|
type: "module",
|
|
948
948
|
main: "./dist/index.cjs",
|
|
@@ -1079,6 +1079,11 @@ var package_default = {
|
|
|
1079
1079
|
import: "./dist/tools/compact/index.js",
|
|
1080
1080
|
require: "./dist/tools/compact/index.cjs"
|
|
1081
1081
|
},
|
|
1082
|
+
"./tools/reflex": {
|
|
1083
|
+
types: "./dist/tools/reflex/index.d.ts",
|
|
1084
|
+
import: "./dist/tools/reflex/index.js",
|
|
1085
|
+
require: "./dist/tools/reflex/index.cjs"
|
|
1086
|
+
},
|
|
1082
1087
|
"./subagents": {
|
|
1083
1088
|
types: "./dist/subagents/index.d.ts",
|
|
1084
1089
|
import: "./dist/subagents/index.js",
|
|
@@ -1104,7 +1109,7 @@ var package_default = {
|
|
|
1104
1109
|
"!dist/**/*.test.*"
|
|
1105
1110
|
],
|
|
1106
1111
|
scripts: {
|
|
1107
|
-
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/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 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 subagents/index.ts subagents/types.ts subagents/prompts.ts subagents/vercel.ts subagents/anthropic.ts --format esm,cjs --sourcemap --clean --dts --dts-resolve",
|
|
1112
|
+
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/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/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 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/reflex/index.ts tools/reflex/core.ts tools/reflex/types.ts tools/utils/resilience.ts subagents/index.ts subagents/types.ts subagents/prompts.ts subagents/vercel.ts subagents/anthropic.ts --format esm,cjs --sourcemap --clean --dts --dts-resolve",
|
|
1108
1113
|
prepare: "npm run build",
|
|
1109
1114
|
typecheck: "tsc --noEmit",
|
|
1110
1115
|
lint: "eslint .",
|
|
@@ -1887,16 +1892,238 @@ function parseGitHubUrl(input) {
|
|
|
1887
1892
|
);
|
|
1888
1893
|
}
|
|
1889
1894
|
|
|
1895
|
+
// tools/utils/resilience.ts
|
|
1896
|
+
var DEFAULT_RETRY_CONFIG = {
|
|
1897
|
+
maxRetries: 3,
|
|
1898
|
+
initialDelay: 1e3,
|
|
1899
|
+
maxDelay: 3e4,
|
|
1900
|
+
backoffMultiplier: 2,
|
|
1901
|
+
retryableErrors: ["ECONNREFUSED", "ETIMEDOUT", "ENOTFOUND"]
|
|
1902
|
+
};
|
|
1903
|
+
async function fetchWithRetry(url, options, retryConfig = {}) {
|
|
1904
|
+
const {
|
|
1905
|
+
maxRetries = DEFAULT_RETRY_CONFIG.maxRetries,
|
|
1906
|
+
initialDelay = DEFAULT_RETRY_CONFIG.initialDelay,
|
|
1907
|
+
maxDelay = DEFAULT_RETRY_CONFIG.maxDelay,
|
|
1908
|
+
backoffMultiplier = DEFAULT_RETRY_CONFIG.backoffMultiplier,
|
|
1909
|
+
retryableErrors = DEFAULT_RETRY_CONFIG.retryableErrors,
|
|
1910
|
+
onRetry
|
|
1911
|
+
} = retryConfig;
|
|
1912
|
+
let lastError = null;
|
|
1913
|
+
let delay = initialDelay;
|
|
1914
|
+
options = { ...options, headers: { "X-Morph-SDK-Version": SDK_VERSION, ...options.headers } };
|
|
1915
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
1916
|
+
try {
|
|
1917
|
+
const response = await fetch(url, options);
|
|
1918
|
+
if (response.status === 429 || response.status === 503) {
|
|
1919
|
+
if (attempt < maxRetries) {
|
|
1920
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
1921
|
+
const waitTime = retryAfter ? parseInt(retryAfter) * 1e3 : Math.min(delay, maxDelay);
|
|
1922
|
+
const error = new Error(`HTTP ${response.status}: Retrying after ${waitTime}ms`);
|
|
1923
|
+
if (onRetry) {
|
|
1924
|
+
onRetry(attempt + 1, error);
|
|
1925
|
+
}
|
|
1926
|
+
await sleep(waitTime);
|
|
1927
|
+
delay *= backoffMultiplier;
|
|
1928
|
+
continue;
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
return response;
|
|
1932
|
+
} catch (error) {
|
|
1933
|
+
lastError = error;
|
|
1934
|
+
const isRetryable = retryableErrors.some(
|
|
1935
|
+
(errType) => lastError?.message?.includes(errType)
|
|
1936
|
+
);
|
|
1937
|
+
if (!isRetryable || attempt === maxRetries) {
|
|
1938
|
+
throw lastError;
|
|
1939
|
+
}
|
|
1940
|
+
const waitTime = Math.min(delay, maxDelay);
|
|
1941
|
+
if (onRetry) {
|
|
1942
|
+
onRetry(attempt + 1, lastError);
|
|
1943
|
+
}
|
|
1944
|
+
await sleep(waitTime);
|
|
1945
|
+
delay *= backoffMultiplier;
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
throw lastError || new Error("Max retries exceeded");
|
|
1949
|
+
}
|
|
1950
|
+
async function withTimeout(promise, timeoutMs, errorMessage) {
|
|
1951
|
+
let timeoutId;
|
|
1952
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
1953
|
+
timeoutId = setTimeout(() => {
|
|
1954
|
+
reject(new Error(errorMessage || `Operation timed out after ${timeoutMs}ms`));
|
|
1955
|
+
}, timeoutMs);
|
|
1956
|
+
});
|
|
1957
|
+
try {
|
|
1958
|
+
const result = await Promise.race([promise, timeoutPromise]);
|
|
1959
|
+
clearTimeout(timeoutId);
|
|
1960
|
+
return result;
|
|
1961
|
+
} catch (error) {
|
|
1962
|
+
clearTimeout(timeoutId);
|
|
1963
|
+
throw error;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
function sleep(ms) {
|
|
1967
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1968
|
+
}
|
|
1969
|
+
var MorphError = class extends Error {
|
|
1970
|
+
constructor(message, code, statusCode, retryable = false) {
|
|
1971
|
+
super(message);
|
|
1972
|
+
this.code = code;
|
|
1973
|
+
this.statusCode = statusCode;
|
|
1974
|
+
this.retryable = retryable;
|
|
1975
|
+
this.name = "MorphError";
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
// core/error.ts
|
|
1980
|
+
async function toMorphError(response) {
|
|
1981
|
+
let message = `Morph API request failed (${response.status})`;
|
|
1982
|
+
let code = "api_error";
|
|
1983
|
+
try {
|
|
1984
|
+
const body = await response.json();
|
|
1985
|
+
message = body.error?.message ?? body.message ?? message;
|
|
1986
|
+
code = body.error?.code ?? body.error?.type ?? code;
|
|
1987
|
+
} catch {
|
|
1988
|
+
}
|
|
1989
|
+
if (response.status === 401) code = "authentication_error";
|
|
1990
|
+
if (response.status === 429) code = "rate_limit_exceeded";
|
|
1991
|
+
const retryable = response.status === 429 || response.status === 503;
|
|
1992
|
+
return new MorphError(message, code, response.status, retryable);
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
// core/client.ts
|
|
1996
|
+
var DEFAULT_BASE_URL = "https://api.morphllm.com";
|
|
1997
|
+
var DEFAULT_REPOS_URL = "https://repos.morphllm.com";
|
|
1998
|
+
var DEFAULT_BROWSER_URL = "https://browser.morphllm.com";
|
|
1999
|
+
var DEFAULT_TIMEOUT = 6e4;
|
|
2000
|
+
var env = (name) => typeof process !== "undefined" ? process.env?.[name] : void 0;
|
|
2001
|
+
var stripTrailingSlash = (url) => url.replace(/\/+$/, "");
|
|
2002
|
+
var MorphAPIClient = class {
|
|
2003
|
+
/** Explicit key as provided; resolved against env at request time. */
|
|
2004
|
+
apiKey;
|
|
2005
|
+
baseURL;
|
|
2006
|
+
reposURL;
|
|
2007
|
+
browserURL;
|
|
2008
|
+
/** Explicit default timeout (ms), if set. The request default is applied lazily so
|
|
2009
|
+
* resources can read an undefined value and supply their own fallback. */
|
|
2010
|
+
timeout;
|
|
2011
|
+
retryConfig;
|
|
2012
|
+
debug;
|
|
2013
|
+
constructor(options = {}) {
|
|
2014
|
+
this.apiKey = options.apiKey;
|
|
2015
|
+
this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);
|
|
2016
|
+
this.reposURL = stripTrailingSlash(options.reposURL ?? env("MORPH_SEARCH_URL") ?? DEFAULT_REPOS_URL);
|
|
2017
|
+
this.browserURL = stripTrailingSlash(
|
|
2018
|
+
options.browserURL ?? (env("MORPH_ENVIRONMENT") === "DEV" ? "http://localhost:8000" : DEFAULT_BROWSER_URL)
|
|
2019
|
+
);
|
|
2020
|
+
this.timeout = options.timeout;
|
|
2021
|
+
this.retryConfig = options.retryConfig;
|
|
2022
|
+
this.debug = options.debug ?? false;
|
|
2023
|
+
if (this.debug) logger.enable();
|
|
2024
|
+
}
|
|
2025
|
+
/** The key actually used for requests: explicit, else `MORPH_API_KEY`. */
|
|
2026
|
+
resolveApiKey() {
|
|
2027
|
+
return this.apiKey ?? env("MORPH_API_KEY");
|
|
2028
|
+
}
|
|
2029
|
+
/** Headers shared with tools that bring their own HTTP client (FastApply/WarpGrep via the `openai` package). */
|
|
2030
|
+
defaultHeaders() {
|
|
2031
|
+
return { "X-Morph-SDK-Version": SDK_VERSION };
|
|
2032
|
+
}
|
|
2033
|
+
buildURL(path6, baseURL) {
|
|
2034
|
+
if (/^https?:\/\//i.test(path6)) return path6;
|
|
2035
|
+
const base = stripTrailingSlash(baseURL ?? this.baseURL);
|
|
2036
|
+
return `${base}${path6.startsWith("/") ? "" : "/"}${path6}`;
|
|
2037
|
+
}
|
|
2038
|
+
buildHeaders(apiKey, extra) {
|
|
2039
|
+
return {
|
|
2040
|
+
"Content-Type": "application/json",
|
|
2041
|
+
"X-Morph-SDK-Version": SDK_VERSION,
|
|
2042
|
+
Authorization: `Bearer ${apiKey}`,
|
|
2043
|
+
...extra
|
|
2044
|
+
};
|
|
2045
|
+
}
|
|
2046
|
+
applyQuery(url, query) {
|
|
2047
|
+
if (!query) return url;
|
|
2048
|
+
const params = new URLSearchParams();
|
|
2049
|
+
for (const [key, value] of Object.entries(query)) {
|
|
2050
|
+
if (value !== void 0 && value !== null) params.set(key, String(value));
|
|
2051
|
+
}
|
|
2052
|
+
const qs = params.toString();
|
|
2053
|
+
return qs ? `${url}${url.includes("?") ? "&" : "?"}${qs}` : url;
|
|
2054
|
+
}
|
|
2055
|
+
async request(method, path6, opts = {}) {
|
|
2056
|
+
const apiKey = this.resolveApiKey();
|
|
2057
|
+
if (!apiKey) {
|
|
2058
|
+
throw new MorphError(
|
|
2059
|
+
"Morph API key not found. Set the MORPH_API_KEY environment variable or pass apiKey in config.",
|
|
2060
|
+
"missing_api_key",
|
|
2061
|
+
401
|
|
2062
|
+
);
|
|
2063
|
+
}
|
|
2064
|
+
const url = this.applyQuery(this.buildURL(path6, opts.baseURL), opts.query);
|
|
2065
|
+
const timeout = opts.timeout ?? this.timeout ?? DEFAULT_TIMEOUT;
|
|
2066
|
+
const init = {
|
|
2067
|
+
method,
|
|
2068
|
+
headers: this.buildHeaders(apiKey, opts.headers),
|
|
2069
|
+
...opts.body !== void 0 ? { body: JSON.stringify(opts.body) } : {},
|
|
2070
|
+
...opts.signal ? { signal: opts.signal } : {}
|
|
2071
|
+
};
|
|
2072
|
+
logger.debug("MorphAPIClient", "request", { method, url });
|
|
2073
|
+
const response = await withTimeout(
|
|
2074
|
+
fetchWithRetry(url, init, this.retryConfig ?? {}),
|
|
2075
|
+
timeout,
|
|
2076
|
+
`Morph request to ${url} timed out after ${timeout}ms`
|
|
2077
|
+
);
|
|
2078
|
+
if (opts.raw) return response;
|
|
2079
|
+
if (!response.ok) throw await toMorphError(response);
|
|
2080
|
+
if (opts.stream) return response;
|
|
2081
|
+
if (response.status === 204) return void 0;
|
|
2082
|
+
const text = await response.text();
|
|
2083
|
+
return text ? JSON.parse(text) : void 0;
|
|
2084
|
+
}
|
|
2085
|
+
get(path6, opts) {
|
|
2086
|
+
return this.request("GET", path6, opts);
|
|
2087
|
+
}
|
|
2088
|
+
post(path6, opts) {
|
|
2089
|
+
return this.request("POST", path6, opts);
|
|
2090
|
+
}
|
|
2091
|
+
delete(path6, opts) {
|
|
2092
|
+
return this.request("DELETE", path6, opts);
|
|
2093
|
+
}
|
|
2094
|
+
};
|
|
2095
|
+
|
|
2096
|
+
// core/resource.ts
|
|
2097
|
+
var APIResource = class {
|
|
2098
|
+
_client;
|
|
2099
|
+
constructor(client) {
|
|
2100
|
+
this._client = client;
|
|
2101
|
+
}
|
|
2102
|
+
};
|
|
2103
|
+
|
|
1890
2104
|
// tools/compact/core.ts
|
|
1891
2105
|
var DEFAULT_API_URL2 = "https://api.morphllm.com";
|
|
1892
|
-
var
|
|
1893
|
-
|
|
2106
|
+
var DEFAULT_TIMEOUT2 = 12e4;
|
|
2107
|
+
function resolveClient(clientOrConfig) {
|
|
2108
|
+
if (clientOrConfig instanceof MorphAPIClient) return clientOrConfig;
|
|
2109
|
+
return new MorphAPIClient({
|
|
2110
|
+
apiKey: clientOrConfig.morphApiKey,
|
|
2111
|
+
baseURL: clientOrConfig.morphApiUrl ?? DEFAULT_API_URL2,
|
|
2112
|
+
timeout: clientOrConfig.timeout ?? DEFAULT_TIMEOUT2,
|
|
2113
|
+
retryConfig: clientOrConfig.retryConfig,
|
|
2114
|
+
debug: clientOrConfig.debug
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
var CompactClient = class extends APIResource {
|
|
2118
|
+
/** Resolved URL/timeout, exposed for backwards-compatible introspection. */
|
|
1894
2119
|
config;
|
|
1895
|
-
constructor(
|
|
2120
|
+
constructor(clientOrConfig = {}) {
|
|
2121
|
+
super(resolveClient(clientOrConfig));
|
|
2122
|
+
const cfg = clientOrConfig instanceof MorphAPIClient ? {} : clientOrConfig;
|
|
1896
2123
|
this.config = {
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
2124
|
+
morphApiUrl: this._client.baseURL,
|
|
2125
|
+
timeout: cfg.timeout ?? DEFAULT_TIMEOUT2,
|
|
2126
|
+
debug: cfg.debug ?? false
|
|
1900
2127
|
};
|
|
1901
2128
|
}
|
|
1902
2129
|
/**
|
|
@@ -1915,17 +2142,6 @@ var CompactClient = class {
|
|
|
1915
2142
|
* ```
|
|
1916
2143
|
*/
|
|
1917
2144
|
async compact(input) {
|
|
1918
|
-
const apiKey = this.config.morphApiKey || (typeof process !== "undefined" ? process.env?.MORPH_API_KEY : void 0);
|
|
1919
|
-
const debug = this.config.debug || false;
|
|
1920
|
-
if (!apiKey) {
|
|
1921
|
-
throw new Error(
|
|
1922
|
-
"Morph API key not found. Set MORPH_API_KEY environment variable or pass morphApiKey in config."
|
|
1923
|
-
);
|
|
1924
|
-
}
|
|
1925
|
-
const url = `${this.config.morphApiUrl}/v1/compact`;
|
|
1926
|
-
if (debug) {
|
|
1927
|
-
console.log(`[Compact] Calling ${url}`);
|
|
1928
|
-
}
|
|
1929
2145
|
const body = {
|
|
1930
2146
|
compression_ratio: input.compressionRatio ?? 0.5,
|
|
1931
2147
|
preserve_recent: input.preserveRecent ?? 2,
|
|
@@ -1933,37 +2149,19 @@ var CompactClient = class {
|
|
|
1933
2149
|
include_line_ranges: input.includeLineRanges ?? true,
|
|
1934
2150
|
include_markers: input.includeMarkers ?? true
|
|
1935
2151
|
};
|
|
1936
|
-
if (input.query !== void 0)
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
if (input.
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
const startTime = Date.now();
|
|
1949
|
-
const response = await fetch(url, {
|
|
1950
|
-
method: "POST",
|
|
1951
|
-
headers: {
|
|
1952
|
-
"Authorization": `Bearer ${apiKey}`,
|
|
1953
|
-
"Content-Type": "application/json"
|
|
1954
|
-
},
|
|
1955
|
-
body: JSON.stringify(body),
|
|
1956
|
-
signal: AbortSignal.timeout(this.config.timeout)
|
|
1957
|
-
});
|
|
1958
|
-
if (!response.ok) {
|
|
1959
|
-
const text = await response.text();
|
|
1960
|
-
throw new Error(`Compact API error ${response.status}: ${text}`);
|
|
1961
|
-
}
|
|
1962
|
-
const data = await response.json();
|
|
1963
|
-
if (debug) {
|
|
1964
|
-
console.log(`[Compact] compact() done in ${Date.now() - startTime}ms`);
|
|
2152
|
+
if (input.query !== void 0) body.query = input.query;
|
|
2153
|
+
if (input.messages) body.messages = input.messages;
|
|
2154
|
+
else if (typeof input.input === "string") body.input = input.input;
|
|
2155
|
+
else if (Array.isArray(input.input)) body.messages = input.input;
|
|
2156
|
+
else throw new Error("Either 'input' or 'messages' must be provided");
|
|
2157
|
+
try {
|
|
2158
|
+
return await this._client.post("/v1/compact", { body, timeout: this.config.timeout });
|
|
2159
|
+
} catch (err) {
|
|
2160
|
+
if (err instanceof MorphError) {
|
|
2161
|
+
throw new Error(`Compact API error ${err.statusCode}: ${err.message}`);
|
|
2162
|
+
}
|
|
2163
|
+
throw err;
|
|
1965
2164
|
}
|
|
1966
|
-
return data;
|
|
1967
2165
|
}
|
|
1968
2166
|
};
|
|
1969
2167
|
|
|
@@ -2019,10 +2217,28 @@ async function getLocalProvider(repoRoot, excludes, allowNames) {
|
|
|
2019
2217
|
const opts = allowNames?.length ? { allowNames } : void 0;
|
|
2020
2218
|
return new LocalRipgrepProvider2(repoRoot, excludes, opts);
|
|
2021
2219
|
}
|
|
2022
|
-
var WarpGrepClient = class {
|
|
2220
|
+
var WarpGrepClient = class extends APIResource {
|
|
2023
2221
|
config;
|
|
2024
|
-
constructor(
|
|
2025
|
-
|
|
2222
|
+
constructor(clientOrConfig = {}) {
|
|
2223
|
+
const isClient = clientOrConfig instanceof MorphAPIClient;
|
|
2224
|
+
super(
|
|
2225
|
+
isClient ? clientOrConfig : new MorphAPIClient({
|
|
2226
|
+
apiKey: clientOrConfig.morphApiKey,
|
|
2227
|
+
baseURL: clientOrConfig.morphApiUrl,
|
|
2228
|
+
timeout: clientOrConfig.timeout,
|
|
2229
|
+
retryConfig: clientOrConfig.retryConfig,
|
|
2230
|
+
debug: clientOrConfig.debug
|
|
2231
|
+
})
|
|
2232
|
+
);
|
|
2233
|
+
const cfg = isClient ? {} : clientOrConfig;
|
|
2234
|
+
this.config = {
|
|
2235
|
+
...cfg,
|
|
2236
|
+
morphApiKey: this._client.resolveApiKey(),
|
|
2237
|
+
morphApiUrl: this._client.baseURL,
|
|
2238
|
+
timeout: this._client.timeout,
|
|
2239
|
+
retryConfig: this._client.retryConfig,
|
|
2240
|
+
debug: this._client.debug
|
|
2241
|
+
};
|
|
2026
2242
|
}
|
|
2027
2243
|
execute(input) {
|
|
2028
2244
|
const toolConfig = {
|