@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
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createExploreSubagent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-AE7M2I52.js";
|
|
4
|
+
import "../chunk-CQF76HJC.js";
|
|
5
5
|
import "../chunk-63VHBANJ.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-7PVVPLRL.js";
|
|
7
7
|
import "../chunk-GVGJIXV2.js";
|
|
8
8
|
import "../chunk-A4D2CIIT.js";
|
|
9
9
|
import "../chunk-IA5K2HTC.js";
|
|
10
10
|
import "../chunk-FBRNUWEB.js";
|
|
11
11
|
import "../chunk-CCJK3HTG.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-QAXXE4AD.js";
|
|
13
13
|
import "../chunk-ZZ25FZG2.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-66OHYI24.js";
|
|
15
|
+
import "../chunk-453ZV2AX.js";
|
|
15
16
|
import "../chunk-F3NCFNUX.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-QZR7SJ5N.js";
|
|
18
|
+
import "../chunk-XYTYIAMQ.js";
|
|
19
|
+
import "../chunk-GJZXDRH5.js";
|
|
20
|
+
import "../chunk-LKFZBBTD.js";
|
|
17
21
|
import "../chunk-PZ5AY32C.js";
|
|
18
22
|
export {
|
|
19
23
|
createExploreSubagent
|
|
@@ -936,7 +936,7 @@ var import_openai = __toESM(require("openai"), 1);
|
|
|
936
936
|
// package.json
|
|
937
937
|
var package_default = {
|
|
938
938
|
name: "@morphllm/morphsdk",
|
|
939
|
-
version: "0.2.
|
|
939
|
+
version: "0.2.172",
|
|
940
940
|
description: "TypeScript SDK and CLI for Morph Fast Apply integration",
|
|
941
941
|
type: "module",
|
|
942
942
|
main: "./dist/index.cjs",
|
|
@@ -1073,6 +1073,11 @@ var package_default = {
|
|
|
1073
1073
|
import: "./dist/tools/compact/index.js",
|
|
1074
1074
|
require: "./dist/tools/compact/index.cjs"
|
|
1075
1075
|
},
|
|
1076
|
+
"./tools/reflex": {
|
|
1077
|
+
types: "./dist/tools/reflex/index.d.ts",
|
|
1078
|
+
import: "./dist/tools/reflex/index.js",
|
|
1079
|
+
require: "./dist/tools/reflex/index.cjs"
|
|
1080
|
+
},
|
|
1076
1081
|
"./subagents": {
|
|
1077
1082
|
types: "./dist/subagents/index.d.ts",
|
|
1078
1083
|
import: "./dist/subagents/index.js",
|
|
@@ -1098,7 +1103,7 @@ var package_default = {
|
|
|
1098
1103
|
"!dist/**/*.test.*"
|
|
1099
1104
|
],
|
|
1100
1105
|
scripts: {
|
|
1101
|
-
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",
|
|
1106
|
+
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",
|
|
1102
1107
|
prepare: "npm run build",
|
|
1103
1108
|
typecheck: "tsc --noEmit",
|
|
1104
1109
|
lint: "eslint .",
|
|
@@ -1881,16 +1886,238 @@ function parseGitHubUrl(input) {
|
|
|
1881
1886
|
);
|
|
1882
1887
|
}
|
|
1883
1888
|
|
|
1889
|
+
// tools/utils/resilience.ts
|
|
1890
|
+
var DEFAULT_RETRY_CONFIG = {
|
|
1891
|
+
maxRetries: 3,
|
|
1892
|
+
initialDelay: 1e3,
|
|
1893
|
+
maxDelay: 3e4,
|
|
1894
|
+
backoffMultiplier: 2,
|
|
1895
|
+
retryableErrors: ["ECONNREFUSED", "ETIMEDOUT", "ENOTFOUND"]
|
|
1896
|
+
};
|
|
1897
|
+
async function fetchWithRetry(url, options, retryConfig = {}) {
|
|
1898
|
+
const {
|
|
1899
|
+
maxRetries = DEFAULT_RETRY_CONFIG.maxRetries,
|
|
1900
|
+
initialDelay = DEFAULT_RETRY_CONFIG.initialDelay,
|
|
1901
|
+
maxDelay = DEFAULT_RETRY_CONFIG.maxDelay,
|
|
1902
|
+
backoffMultiplier = DEFAULT_RETRY_CONFIG.backoffMultiplier,
|
|
1903
|
+
retryableErrors = DEFAULT_RETRY_CONFIG.retryableErrors,
|
|
1904
|
+
onRetry
|
|
1905
|
+
} = retryConfig;
|
|
1906
|
+
let lastError = null;
|
|
1907
|
+
let delay = initialDelay;
|
|
1908
|
+
options = { ...options, headers: { "X-Morph-SDK-Version": SDK_VERSION, ...options.headers } };
|
|
1909
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
1910
|
+
try {
|
|
1911
|
+
const response = await fetch(url, options);
|
|
1912
|
+
if (response.status === 429 || response.status === 503) {
|
|
1913
|
+
if (attempt < maxRetries) {
|
|
1914
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
1915
|
+
const waitTime = retryAfter ? parseInt(retryAfter) * 1e3 : Math.min(delay, maxDelay);
|
|
1916
|
+
const error = new Error(`HTTP ${response.status}: Retrying after ${waitTime}ms`);
|
|
1917
|
+
if (onRetry) {
|
|
1918
|
+
onRetry(attempt + 1, error);
|
|
1919
|
+
}
|
|
1920
|
+
await sleep(waitTime);
|
|
1921
|
+
delay *= backoffMultiplier;
|
|
1922
|
+
continue;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
return response;
|
|
1926
|
+
} catch (error) {
|
|
1927
|
+
lastError = error;
|
|
1928
|
+
const isRetryable = retryableErrors.some(
|
|
1929
|
+
(errType) => lastError?.message?.includes(errType)
|
|
1930
|
+
);
|
|
1931
|
+
if (!isRetryable || attempt === maxRetries) {
|
|
1932
|
+
throw lastError;
|
|
1933
|
+
}
|
|
1934
|
+
const waitTime = Math.min(delay, maxDelay);
|
|
1935
|
+
if (onRetry) {
|
|
1936
|
+
onRetry(attempt + 1, lastError);
|
|
1937
|
+
}
|
|
1938
|
+
await sleep(waitTime);
|
|
1939
|
+
delay *= backoffMultiplier;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
throw lastError || new Error("Max retries exceeded");
|
|
1943
|
+
}
|
|
1944
|
+
async function withTimeout(promise, timeoutMs, errorMessage) {
|
|
1945
|
+
let timeoutId;
|
|
1946
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
1947
|
+
timeoutId = setTimeout(() => {
|
|
1948
|
+
reject(new Error(errorMessage || `Operation timed out after ${timeoutMs}ms`));
|
|
1949
|
+
}, timeoutMs);
|
|
1950
|
+
});
|
|
1951
|
+
try {
|
|
1952
|
+
const result = await Promise.race([promise, timeoutPromise]);
|
|
1953
|
+
clearTimeout(timeoutId);
|
|
1954
|
+
return result;
|
|
1955
|
+
} catch (error) {
|
|
1956
|
+
clearTimeout(timeoutId);
|
|
1957
|
+
throw error;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
function sleep(ms) {
|
|
1961
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1962
|
+
}
|
|
1963
|
+
var MorphError = class extends Error {
|
|
1964
|
+
constructor(message, code, statusCode, retryable = false) {
|
|
1965
|
+
super(message);
|
|
1966
|
+
this.code = code;
|
|
1967
|
+
this.statusCode = statusCode;
|
|
1968
|
+
this.retryable = retryable;
|
|
1969
|
+
this.name = "MorphError";
|
|
1970
|
+
}
|
|
1971
|
+
};
|
|
1972
|
+
|
|
1973
|
+
// core/error.ts
|
|
1974
|
+
async function toMorphError(response) {
|
|
1975
|
+
let message = `Morph API request failed (${response.status})`;
|
|
1976
|
+
let code = "api_error";
|
|
1977
|
+
try {
|
|
1978
|
+
const body = await response.json();
|
|
1979
|
+
message = body.error?.message ?? body.message ?? message;
|
|
1980
|
+
code = body.error?.code ?? body.error?.type ?? code;
|
|
1981
|
+
} catch {
|
|
1982
|
+
}
|
|
1983
|
+
if (response.status === 401) code = "authentication_error";
|
|
1984
|
+
if (response.status === 429) code = "rate_limit_exceeded";
|
|
1985
|
+
const retryable = response.status === 429 || response.status === 503;
|
|
1986
|
+
return new MorphError(message, code, response.status, retryable);
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
// core/client.ts
|
|
1990
|
+
var DEFAULT_BASE_URL = "https://api.morphllm.com";
|
|
1991
|
+
var DEFAULT_REPOS_URL = "https://repos.morphllm.com";
|
|
1992
|
+
var DEFAULT_BROWSER_URL = "https://browser.morphllm.com";
|
|
1993
|
+
var DEFAULT_TIMEOUT = 6e4;
|
|
1994
|
+
var env = (name) => typeof process !== "undefined" ? process.env?.[name] : void 0;
|
|
1995
|
+
var stripTrailingSlash = (url) => url.replace(/\/+$/, "");
|
|
1996
|
+
var MorphAPIClient = class {
|
|
1997
|
+
/** Explicit key as provided; resolved against env at request time. */
|
|
1998
|
+
apiKey;
|
|
1999
|
+
baseURL;
|
|
2000
|
+
reposURL;
|
|
2001
|
+
browserURL;
|
|
2002
|
+
/** Explicit default timeout (ms), if set. The request default is applied lazily so
|
|
2003
|
+
* resources can read an undefined value and supply their own fallback. */
|
|
2004
|
+
timeout;
|
|
2005
|
+
retryConfig;
|
|
2006
|
+
debug;
|
|
2007
|
+
constructor(options = {}) {
|
|
2008
|
+
this.apiKey = options.apiKey;
|
|
2009
|
+
this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);
|
|
2010
|
+
this.reposURL = stripTrailingSlash(options.reposURL ?? env("MORPH_SEARCH_URL") ?? DEFAULT_REPOS_URL);
|
|
2011
|
+
this.browserURL = stripTrailingSlash(
|
|
2012
|
+
options.browserURL ?? (env("MORPH_ENVIRONMENT") === "DEV" ? "http://localhost:8000" : DEFAULT_BROWSER_URL)
|
|
2013
|
+
);
|
|
2014
|
+
this.timeout = options.timeout;
|
|
2015
|
+
this.retryConfig = options.retryConfig;
|
|
2016
|
+
this.debug = options.debug ?? false;
|
|
2017
|
+
if (this.debug) logger.enable();
|
|
2018
|
+
}
|
|
2019
|
+
/** The key actually used for requests: explicit, else `MORPH_API_KEY`. */
|
|
2020
|
+
resolveApiKey() {
|
|
2021
|
+
return this.apiKey ?? env("MORPH_API_KEY");
|
|
2022
|
+
}
|
|
2023
|
+
/** Headers shared with tools that bring their own HTTP client (FastApply/WarpGrep via the `openai` package). */
|
|
2024
|
+
defaultHeaders() {
|
|
2025
|
+
return { "X-Morph-SDK-Version": SDK_VERSION };
|
|
2026
|
+
}
|
|
2027
|
+
buildURL(path6, baseURL) {
|
|
2028
|
+
if (/^https?:\/\//i.test(path6)) return path6;
|
|
2029
|
+
const base = stripTrailingSlash(baseURL ?? this.baseURL);
|
|
2030
|
+
return `${base}${path6.startsWith("/") ? "" : "/"}${path6}`;
|
|
2031
|
+
}
|
|
2032
|
+
buildHeaders(apiKey, extra) {
|
|
2033
|
+
return {
|
|
2034
|
+
"Content-Type": "application/json",
|
|
2035
|
+
"X-Morph-SDK-Version": SDK_VERSION,
|
|
2036
|
+
Authorization: `Bearer ${apiKey}`,
|
|
2037
|
+
...extra
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
applyQuery(url, query) {
|
|
2041
|
+
if (!query) return url;
|
|
2042
|
+
const params = new URLSearchParams();
|
|
2043
|
+
for (const [key, value] of Object.entries(query)) {
|
|
2044
|
+
if (value !== void 0 && value !== null) params.set(key, String(value));
|
|
2045
|
+
}
|
|
2046
|
+
const qs = params.toString();
|
|
2047
|
+
return qs ? `${url}${url.includes("?") ? "&" : "?"}${qs}` : url;
|
|
2048
|
+
}
|
|
2049
|
+
async request(method, path6, opts = {}) {
|
|
2050
|
+
const apiKey = this.resolveApiKey();
|
|
2051
|
+
if (!apiKey) {
|
|
2052
|
+
throw new MorphError(
|
|
2053
|
+
"Morph API key not found. Set the MORPH_API_KEY environment variable or pass apiKey in config.",
|
|
2054
|
+
"missing_api_key",
|
|
2055
|
+
401
|
|
2056
|
+
);
|
|
2057
|
+
}
|
|
2058
|
+
const url = this.applyQuery(this.buildURL(path6, opts.baseURL), opts.query);
|
|
2059
|
+
const timeout = opts.timeout ?? this.timeout ?? DEFAULT_TIMEOUT;
|
|
2060
|
+
const init = {
|
|
2061
|
+
method,
|
|
2062
|
+
headers: this.buildHeaders(apiKey, opts.headers),
|
|
2063
|
+
...opts.body !== void 0 ? { body: JSON.stringify(opts.body) } : {},
|
|
2064
|
+
...opts.signal ? { signal: opts.signal } : {}
|
|
2065
|
+
};
|
|
2066
|
+
logger.debug("MorphAPIClient", "request", { method, url });
|
|
2067
|
+
const response = await withTimeout(
|
|
2068
|
+
fetchWithRetry(url, init, this.retryConfig ?? {}),
|
|
2069
|
+
timeout,
|
|
2070
|
+
`Morph request to ${url} timed out after ${timeout}ms`
|
|
2071
|
+
);
|
|
2072
|
+
if (opts.raw) return response;
|
|
2073
|
+
if (!response.ok) throw await toMorphError(response);
|
|
2074
|
+
if (opts.stream) return response;
|
|
2075
|
+
if (response.status === 204) return void 0;
|
|
2076
|
+
const text = await response.text();
|
|
2077
|
+
return text ? JSON.parse(text) : void 0;
|
|
2078
|
+
}
|
|
2079
|
+
get(path6, opts) {
|
|
2080
|
+
return this.request("GET", path6, opts);
|
|
2081
|
+
}
|
|
2082
|
+
post(path6, opts) {
|
|
2083
|
+
return this.request("POST", path6, opts);
|
|
2084
|
+
}
|
|
2085
|
+
delete(path6, opts) {
|
|
2086
|
+
return this.request("DELETE", path6, opts);
|
|
2087
|
+
}
|
|
2088
|
+
};
|
|
2089
|
+
|
|
2090
|
+
// core/resource.ts
|
|
2091
|
+
var APIResource = class {
|
|
2092
|
+
_client;
|
|
2093
|
+
constructor(client) {
|
|
2094
|
+
this._client = client;
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
|
|
1884
2098
|
// tools/compact/core.ts
|
|
1885
2099
|
var DEFAULT_API_URL2 = "https://api.morphllm.com";
|
|
1886
|
-
var
|
|
1887
|
-
|
|
2100
|
+
var DEFAULT_TIMEOUT2 = 12e4;
|
|
2101
|
+
function resolveClient(clientOrConfig) {
|
|
2102
|
+
if (clientOrConfig instanceof MorphAPIClient) return clientOrConfig;
|
|
2103
|
+
return new MorphAPIClient({
|
|
2104
|
+
apiKey: clientOrConfig.morphApiKey,
|
|
2105
|
+
baseURL: clientOrConfig.morphApiUrl ?? DEFAULT_API_URL2,
|
|
2106
|
+
timeout: clientOrConfig.timeout ?? DEFAULT_TIMEOUT2,
|
|
2107
|
+
retryConfig: clientOrConfig.retryConfig,
|
|
2108
|
+
debug: clientOrConfig.debug
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
2111
|
+
var CompactClient = class extends APIResource {
|
|
2112
|
+
/** Resolved URL/timeout, exposed for backwards-compatible introspection. */
|
|
1888
2113
|
config;
|
|
1889
|
-
constructor(
|
|
2114
|
+
constructor(clientOrConfig = {}) {
|
|
2115
|
+
super(resolveClient(clientOrConfig));
|
|
2116
|
+
const cfg = clientOrConfig instanceof MorphAPIClient ? {} : clientOrConfig;
|
|
1890
2117
|
this.config = {
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
2118
|
+
morphApiUrl: this._client.baseURL,
|
|
2119
|
+
timeout: cfg.timeout ?? DEFAULT_TIMEOUT2,
|
|
2120
|
+
debug: cfg.debug ?? false
|
|
1894
2121
|
};
|
|
1895
2122
|
}
|
|
1896
2123
|
/**
|
|
@@ -1909,17 +2136,6 @@ var CompactClient = class {
|
|
|
1909
2136
|
* ```
|
|
1910
2137
|
*/
|
|
1911
2138
|
async compact(input) {
|
|
1912
|
-
const apiKey = this.config.morphApiKey || (typeof process !== "undefined" ? process.env?.MORPH_API_KEY : void 0);
|
|
1913
|
-
const debug = this.config.debug || false;
|
|
1914
|
-
if (!apiKey) {
|
|
1915
|
-
throw new Error(
|
|
1916
|
-
"Morph API key not found. Set MORPH_API_KEY environment variable or pass morphApiKey in config."
|
|
1917
|
-
);
|
|
1918
|
-
}
|
|
1919
|
-
const url = `${this.config.morphApiUrl}/v1/compact`;
|
|
1920
|
-
if (debug) {
|
|
1921
|
-
console.log(`[Compact] Calling ${url}`);
|
|
1922
|
-
}
|
|
1923
2139
|
const body = {
|
|
1924
2140
|
compression_ratio: input.compressionRatio ?? 0.5,
|
|
1925
2141
|
preserve_recent: input.preserveRecent ?? 2,
|
|
@@ -1927,37 +2143,19 @@ var CompactClient = class {
|
|
|
1927
2143
|
include_line_ranges: input.includeLineRanges ?? true,
|
|
1928
2144
|
include_markers: input.includeMarkers ?? true
|
|
1929
2145
|
};
|
|
1930
|
-
if (input.query !== void 0)
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
if (input.
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
const startTime = Date.now();
|
|
1943
|
-
const response = await fetch(url, {
|
|
1944
|
-
method: "POST",
|
|
1945
|
-
headers: {
|
|
1946
|
-
"Authorization": `Bearer ${apiKey}`,
|
|
1947
|
-
"Content-Type": "application/json"
|
|
1948
|
-
},
|
|
1949
|
-
body: JSON.stringify(body),
|
|
1950
|
-
signal: AbortSignal.timeout(this.config.timeout)
|
|
1951
|
-
});
|
|
1952
|
-
if (!response.ok) {
|
|
1953
|
-
const text = await response.text();
|
|
1954
|
-
throw new Error(`Compact API error ${response.status}: ${text}`);
|
|
1955
|
-
}
|
|
1956
|
-
const data = await response.json();
|
|
1957
|
-
if (debug) {
|
|
1958
|
-
console.log(`[Compact] compact() done in ${Date.now() - startTime}ms`);
|
|
2146
|
+
if (input.query !== void 0) body.query = input.query;
|
|
2147
|
+
if (input.messages) body.messages = input.messages;
|
|
2148
|
+
else if (typeof input.input === "string") body.input = input.input;
|
|
2149
|
+
else if (Array.isArray(input.input)) body.messages = input.input;
|
|
2150
|
+
else throw new Error("Either 'input' or 'messages' must be provided");
|
|
2151
|
+
try {
|
|
2152
|
+
return await this._client.post("/v1/compact", { body, timeout: this.config.timeout });
|
|
2153
|
+
} catch (err) {
|
|
2154
|
+
if (err instanceof MorphError) {
|
|
2155
|
+
throw new Error(`Compact API error ${err.statusCode}: ${err.message}`);
|
|
2156
|
+
}
|
|
2157
|
+
throw err;
|
|
1959
2158
|
}
|
|
1960
|
-
return data;
|
|
1961
2159
|
}
|
|
1962
2160
|
};
|
|
1963
2161
|
|
|
@@ -2013,10 +2211,28 @@ async function getLocalProvider(repoRoot, excludes, allowNames) {
|
|
|
2013
2211
|
const opts = allowNames?.length ? { allowNames } : void 0;
|
|
2014
2212
|
return new LocalRipgrepProvider2(repoRoot, excludes, opts);
|
|
2015
2213
|
}
|
|
2016
|
-
var WarpGrepClient = class {
|
|
2214
|
+
var WarpGrepClient = class extends APIResource {
|
|
2017
2215
|
config;
|
|
2018
|
-
constructor(
|
|
2019
|
-
|
|
2216
|
+
constructor(clientOrConfig = {}) {
|
|
2217
|
+
const isClient = clientOrConfig instanceof MorphAPIClient;
|
|
2218
|
+
super(
|
|
2219
|
+
isClient ? clientOrConfig : new MorphAPIClient({
|
|
2220
|
+
apiKey: clientOrConfig.morphApiKey,
|
|
2221
|
+
baseURL: clientOrConfig.morphApiUrl,
|
|
2222
|
+
timeout: clientOrConfig.timeout,
|
|
2223
|
+
retryConfig: clientOrConfig.retryConfig,
|
|
2224
|
+
debug: clientOrConfig.debug
|
|
2225
|
+
})
|
|
2226
|
+
);
|
|
2227
|
+
const cfg = isClient ? {} : clientOrConfig;
|
|
2228
|
+
this.config = {
|
|
2229
|
+
...cfg,
|
|
2230
|
+
morphApiKey: this._client.resolveApiKey(),
|
|
2231
|
+
morphApiUrl: this._client.baseURL,
|
|
2232
|
+
timeout: this._client.timeout,
|
|
2233
|
+
retryConfig: this._client.retryConfig,
|
|
2234
|
+
debug: this._client.debug
|
|
2235
|
+
};
|
|
2020
2236
|
}
|
|
2021
2237
|
execute(input) {
|
|
2022
2238
|
const toolConfig = {
|