@morphllm/morphsdk 0.2.171 → 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-3XRNC56L.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-IW4TYYG6.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-C37YAYBK.js → chunk-7PVVPLRL.js} +2 -2
- package/dist/{chunk-MZZMSL26.js → chunk-AE7M2I52.js} +2 -2
- package/dist/{chunk-JLLIVBKY.js → chunk-CQF76HJC.js} +30 -6
- package/dist/chunk-CQF76HJC.js.map +1 -0
- package/dist/{chunk-EFCDIESP.js → chunk-ESXCQBMU.js} +2 -2
- package/dist/{chunk-FQJCE2FX.js → chunk-FOIDGIY4.js} +29 -10
- package/dist/chunk-FOIDGIY4.js.map +1 -0
- package/dist/{chunk-JEDEBCZM.js → chunk-GJZXDRH5.js} +8 -3
- package/dist/{chunk-JEDEBCZM.js.map → chunk-GJZXDRH5.js.map} +1 -1
- package/dist/{chunk-2ALTBYMY.js → chunk-IJ33I7P5.js} +4 -4
- package/dist/{chunk-UK7TI7QY.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-TAS6S42A.js → chunk-MO6S2LRD.js} +2 -2
- package/dist/{chunk-2OAKX4SZ.js → chunk-NI7PWQ3B.js} +4 -4
- package/dist/{chunk-GLQWEINZ.js → chunk-QAXXE4AD.js} +2 -2
- package/dist/{chunk-3BCKZKNK.js → chunk-QFE5523Q.js} +2 -2
- package/dist/{chunk-LL3EWDKD.js → chunk-QQXNZIVK.js} +4 -4
- package/dist/{chunk-IGQYZ2KH.js → chunk-QZ3V2BP7.js} +2 -2
- package/dist/chunk-QZR7SJ5N.js +24 -0
- package/dist/chunk-QZR7SJ5N.js.map +1 -0
- package/dist/{chunk-SW527EQT.js → chunk-SJVLAGUL.js} +4 -4
- package/dist/{chunk-CMFY26F3.js → chunk-U4J3BVAQ.js} +4 -4
- package/dist/{chunk-5EUMJI3I.js → chunk-U4MRSZQQ.js} +2 -2
- package/dist/{chunk-ZJQTTOHO.js → chunk-UADW6FYD.js} +2 -2
- package/dist/{chunk-4324ZSCW.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-Y6T4NA75.js → chunk-XJDXV5VX.js} +2 -2
- package/dist/{chunk-JTUB5ZCT.js → chunk-XYTYIAMQ.js} +2 -2
- package/dist/{chunk-4MTZUTNH.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 +724 -523
- 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 +236 -173
- 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 +672 -465
- 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 +16 -2
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +8 -4
- package/dist/tools/fastapply/apply.cjs +7 -2
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.js +2 -2
- package/dist/tools/fastapply/core.cjs +242 -12
- 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 +16 -2
- 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 +16 -2
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +8 -4
- package/dist/tools/fastapply/vercel.cjs +16 -2
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.js +8 -4
- package/dist/tools/index.cjs +16 -2
- 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-4MTZUTNH.js.map +0 -1
- package/dist/chunk-FQJCE2FX.js.map +0 -1
- package/dist/chunk-H5WNI6R5.js +0 -102
- package/dist/chunk-H5WNI6R5.js.map +0 -1
- package/dist/chunk-JLLIVBKY.js.map +0 -1
- package/dist/chunk-KCFMXLZ7.js +0 -197
- package/dist/chunk-KCFMXLZ7.js.map +0 -1
- package/dist/chunk-LE66XCOI.js.map +0 -1
- package/dist/chunk-SCVWDNQP.js +0 -84
- package/dist/chunk-SCVWDNQP.js.map +0 -1
- package/dist/chunk-UK7TI7QY.js.map +0 -1
- /package/dist/{chunk-3XRNC56L.js.map → chunk-2SNAXTUJ.js.map} +0 -0
- /package/dist/{chunk-IW4TYYG6.js.map → chunk-5DA6SZQJ.js.map} +0 -0
- /package/dist/{chunk-C37YAYBK.js.map → chunk-7PVVPLRL.js.map} +0 -0
- /package/dist/{chunk-MZZMSL26.js.map → chunk-AE7M2I52.js.map} +0 -0
- /package/dist/{chunk-EFCDIESP.js.map → chunk-ESXCQBMU.js.map} +0 -0
- /package/dist/{chunk-2ALTBYMY.js.map → chunk-IJ33I7P5.js.map} +0 -0
- /package/dist/{chunk-TAS6S42A.js.map → chunk-MO6S2LRD.js.map} +0 -0
- /package/dist/{chunk-2OAKX4SZ.js.map → chunk-NI7PWQ3B.js.map} +0 -0
- /package/dist/{chunk-GLQWEINZ.js.map → chunk-QAXXE4AD.js.map} +0 -0
- /package/dist/{chunk-3BCKZKNK.js.map → chunk-QFE5523Q.js.map} +0 -0
- /package/dist/{chunk-LL3EWDKD.js.map → chunk-QQXNZIVK.js.map} +0 -0
- /package/dist/{chunk-IGQYZ2KH.js.map → chunk-QZ3V2BP7.js.map} +0 -0
- /package/dist/{chunk-SW527EQT.js.map → chunk-SJVLAGUL.js.map} +0 -0
- /package/dist/{chunk-CMFY26F3.js.map → chunk-U4J3BVAQ.js.map} +0 -0
- /package/dist/{chunk-5EUMJI3I.js.map → chunk-U4MRSZQQ.js.map} +0 -0
- /package/dist/{chunk-ZJQTTOHO.js.map → chunk-UADW6FYD.js.map} +0 -0
- /package/dist/{chunk-4324ZSCW.js.map → chunk-VBARKJWL.js.map} +0 -0
- /package/dist/{chunk-OPNTDMHH.js.map → chunk-VLZ6PNAD.js.map} +0 -0
- /package/dist/{chunk-Y6T4NA75.js.map → chunk-XJDXV5VX.js.map} +0 -0
- /package/dist/{chunk-JTUB5ZCT.js.map → chunk-XYTYIAMQ.js.map} +0 -0
|
@@ -9,7 +9,9 @@ export { fixPathRepetition } from './utils/paths.js';
|
|
|
9
9
|
export { runWarpGrep, runWarpGrepStreaming } from './agent/runner.js';
|
|
10
10
|
export { AgentRunResult, ChatMessage, SessionConfig, WarpGrepStep } from './agent/types.js';
|
|
11
11
|
export { n as normalizeFinishFiles, r as readFinishFiles, t as toolGrep, b as toolListDirectory, a as toolRead } from '../../finish-Ddj1MPGt.js';
|
|
12
|
+
import '../../core/client.js';
|
|
12
13
|
import '../utils/resilience.js';
|
|
14
|
+
import '../../core/resource.js';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Prompts and descriptions for codebase_search
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
warpGrepInputSchema
|
|
3
3
|
} from "../../chunk-HYRHI2UL.js";
|
|
4
|
-
import "../../chunk-QRXG5CAZ.js";
|
|
5
4
|
import {
|
|
6
5
|
LocalRipgrepProvider
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-G2RSY56Q.js";
|
|
6
|
+
} from "../../chunk-VLZ6PNAD.js";
|
|
9
7
|
import {
|
|
10
8
|
fixPathRepetition
|
|
11
9
|
} from "../../chunk-YPKNMYD4.js";
|
|
12
10
|
import "../../chunk-TPP2UGQP.js";
|
|
11
|
+
import "../../chunk-G2RSY56Q.js";
|
|
12
|
+
import "../../chunk-QRXG5CAZ.js";
|
|
13
13
|
import {
|
|
14
14
|
GITHUB_READ_FILE_DESCRIPTION,
|
|
15
15
|
GITHUB_READ_FILE_INPUT_SCHEMA,
|
|
@@ -27,12 +27,12 @@ import {
|
|
|
27
27
|
executeWarpGrep,
|
|
28
28
|
formatGitHubReadFileResult,
|
|
29
29
|
formatResult
|
|
30
|
-
} from "../../chunk-
|
|
30
|
+
} from "../../chunk-CQF76HJC.js";
|
|
31
31
|
import "../../chunk-63VHBANJ.js";
|
|
32
32
|
import {
|
|
33
33
|
runWarpGrep,
|
|
34
34
|
runWarpGrepStreaming
|
|
35
|
-
} from "../../chunk-
|
|
35
|
+
} from "../../chunk-7PVVPLRL.js";
|
|
36
36
|
import {
|
|
37
37
|
createCodeStorageHttpCommands
|
|
38
38
|
} from "../../chunk-GVGJIXV2.js";
|
|
@@ -48,10 +48,14 @@ import {
|
|
|
48
48
|
} from "../../chunk-IA5K2HTC.js";
|
|
49
49
|
import "../../chunk-FBRNUWEB.js";
|
|
50
50
|
import "../../chunk-CCJK3HTG.js";
|
|
51
|
-
import "../../chunk-
|
|
52
|
-
import "../../chunk-
|
|
51
|
+
import "../../chunk-QAXXE4AD.js";
|
|
52
|
+
import "../../chunk-66OHYI24.js";
|
|
53
|
+
import "../../chunk-453ZV2AX.js";
|
|
53
54
|
import "../../chunk-F3NCFNUX.js";
|
|
54
|
-
import "../../chunk-
|
|
55
|
+
import "../../chunk-QZR7SJ5N.js";
|
|
56
|
+
import "../../chunk-XYTYIAMQ.js";
|
|
57
|
+
import "../../chunk-GJZXDRH5.js";
|
|
58
|
+
import "../../chunk-LKFZBBTD.js";
|
|
55
59
|
import "../../chunk-PZ5AY32C.js";
|
|
56
60
|
export {
|
|
57
61
|
GITHUB_READ_FILE_DESCRIPTION,
|
|
@@ -940,7 +940,7 @@ var import_openai = __toESM(require("openai"), 1);
|
|
|
940
940
|
// package.json
|
|
941
941
|
var package_default = {
|
|
942
942
|
name: "@morphllm/morphsdk",
|
|
943
|
-
version: "0.2.
|
|
943
|
+
version: "0.2.172",
|
|
944
944
|
description: "TypeScript SDK and CLI for Morph Fast Apply integration",
|
|
945
945
|
type: "module",
|
|
946
946
|
main: "./dist/index.cjs",
|
|
@@ -1077,6 +1077,11 @@ var package_default = {
|
|
|
1077
1077
|
import: "./dist/tools/compact/index.js",
|
|
1078
1078
|
require: "./dist/tools/compact/index.cjs"
|
|
1079
1079
|
},
|
|
1080
|
+
"./tools/reflex": {
|
|
1081
|
+
types: "./dist/tools/reflex/index.d.ts",
|
|
1082
|
+
import: "./dist/tools/reflex/index.js",
|
|
1083
|
+
require: "./dist/tools/reflex/index.cjs"
|
|
1084
|
+
},
|
|
1080
1085
|
"./subagents": {
|
|
1081
1086
|
types: "./dist/subagents/index.d.ts",
|
|
1082
1087
|
import: "./dist/subagents/index.js",
|
|
@@ -1102,7 +1107,7 @@ var package_default = {
|
|
|
1102
1107
|
"!dist/**/*.test.*"
|
|
1103
1108
|
],
|
|
1104
1109
|
scripts: {
|
|
1105
|
-
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",
|
|
1110
|
+
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",
|
|
1106
1111
|
prepare: "npm run build",
|
|
1107
1112
|
typecheck: "tsc --noEmit",
|
|
1108
1113
|
lint: "eslint .",
|
|
@@ -1885,16 +1890,238 @@ function parseGitHubUrl(input) {
|
|
|
1885
1890
|
);
|
|
1886
1891
|
}
|
|
1887
1892
|
|
|
1893
|
+
// tools/utils/resilience.ts
|
|
1894
|
+
var DEFAULT_RETRY_CONFIG = {
|
|
1895
|
+
maxRetries: 3,
|
|
1896
|
+
initialDelay: 1e3,
|
|
1897
|
+
maxDelay: 3e4,
|
|
1898
|
+
backoffMultiplier: 2,
|
|
1899
|
+
retryableErrors: ["ECONNREFUSED", "ETIMEDOUT", "ENOTFOUND"]
|
|
1900
|
+
};
|
|
1901
|
+
async function fetchWithRetry(url, options, retryConfig = {}) {
|
|
1902
|
+
const {
|
|
1903
|
+
maxRetries = DEFAULT_RETRY_CONFIG.maxRetries,
|
|
1904
|
+
initialDelay = DEFAULT_RETRY_CONFIG.initialDelay,
|
|
1905
|
+
maxDelay = DEFAULT_RETRY_CONFIG.maxDelay,
|
|
1906
|
+
backoffMultiplier = DEFAULT_RETRY_CONFIG.backoffMultiplier,
|
|
1907
|
+
retryableErrors = DEFAULT_RETRY_CONFIG.retryableErrors,
|
|
1908
|
+
onRetry
|
|
1909
|
+
} = retryConfig;
|
|
1910
|
+
let lastError = null;
|
|
1911
|
+
let delay = initialDelay;
|
|
1912
|
+
options = { ...options, headers: { "X-Morph-SDK-Version": SDK_VERSION, ...options.headers } };
|
|
1913
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
1914
|
+
try {
|
|
1915
|
+
const response = await fetch(url, options);
|
|
1916
|
+
if (response.status === 429 || response.status === 503) {
|
|
1917
|
+
if (attempt < maxRetries) {
|
|
1918
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
1919
|
+
const waitTime = retryAfter ? parseInt(retryAfter) * 1e3 : Math.min(delay, maxDelay);
|
|
1920
|
+
const error = new Error(`HTTP ${response.status}: Retrying after ${waitTime}ms`);
|
|
1921
|
+
if (onRetry) {
|
|
1922
|
+
onRetry(attempt + 1, error);
|
|
1923
|
+
}
|
|
1924
|
+
await sleep(waitTime);
|
|
1925
|
+
delay *= backoffMultiplier;
|
|
1926
|
+
continue;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
return response;
|
|
1930
|
+
} catch (error) {
|
|
1931
|
+
lastError = error;
|
|
1932
|
+
const isRetryable = retryableErrors.some(
|
|
1933
|
+
(errType) => lastError?.message?.includes(errType)
|
|
1934
|
+
);
|
|
1935
|
+
if (!isRetryable || attempt === maxRetries) {
|
|
1936
|
+
throw lastError;
|
|
1937
|
+
}
|
|
1938
|
+
const waitTime = Math.min(delay, maxDelay);
|
|
1939
|
+
if (onRetry) {
|
|
1940
|
+
onRetry(attempt + 1, lastError);
|
|
1941
|
+
}
|
|
1942
|
+
await sleep(waitTime);
|
|
1943
|
+
delay *= backoffMultiplier;
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
throw lastError || new Error("Max retries exceeded");
|
|
1947
|
+
}
|
|
1948
|
+
async function withTimeout(promise, timeoutMs, errorMessage) {
|
|
1949
|
+
let timeoutId;
|
|
1950
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
1951
|
+
timeoutId = setTimeout(() => {
|
|
1952
|
+
reject(new Error(errorMessage || `Operation timed out after ${timeoutMs}ms`));
|
|
1953
|
+
}, timeoutMs);
|
|
1954
|
+
});
|
|
1955
|
+
try {
|
|
1956
|
+
const result = await Promise.race([promise, timeoutPromise]);
|
|
1957
|
+
clearTimeout(timeoutId);
|
|
1958
|
+
return result;
|
|
1959
|
+
} catch (error) {
|
|
1960
|
+
clearTimeout(timeoutId);
|
|
1961
|
+
throw error;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
function sleep(ms) {
|
|
1965
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1966
|
+
}
|
|
1967
|
+
var MorphError = class extends Error {
|
|
1968
|
+
constructor(message, code, statusCode, retryable = false) {
|
|
1969
|
+
super(message);
|
|
1970
|
+
this.code = code;
|
|
1971
|
+
this.statusCode = statusCode;
|
|
1972
|
+
this.retryable = retryable;
|
|
1973
|
+
this.name = "MorphError";
|
|
1974
|
+
}
|
|
1975
|
+
};
|
|
1976
|
+
|
|
1977
|
+
// core/error.ts
|
|
1978
|
+
async function toMorphError(response) {
|
|
1979
|
+
let message = `Morph API request failed (${response.status})`;
|
|
1980
|
+
let code = "api_error";
|
|
1981
|
+
try {
|
|
1982
|
+
const body = await response.json();
|
|
1983
|
+
message = body.error?.message ?? body.message ?? message;
|
|
1984
|
+
code = body.error?.code ?? body.error?.type ?? code;
|
|
1985
|
+
} catch {
|
|
1986
|
+
}
|
|
1987
|
+
if (response.status === 401) code = "authentication_error";
|
|
1988
|
+
if (response.status === 429) code = "rate_limit_exceeded";
|
|
1989
|
+
const retryable = response.status === 429 || response.status === 503;
|
|
1990
|
+
return new MorphError(message, code, response.status, retryable);
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
// core/client.ts
|
|
1994
|
+
var DEFAULT_BASE_URL = "https://api.morphllm.com";
|
|
1995
|
+
var DEFAULT_REPOS_URL = "https://repos.morphllm.com";
|
|
1996
|
+
var DEFAULT_BROWSER_URL = "https://browser.morphllm.com";
|
|
1997
|
+
var DEFAULT_TIMEOUT = 6e4;
|
|
1998
|
+
var env = (name) => typeof process !== "undefined" ? process.env?.[name] : void 0;
|
|
1999
|
+
var stripTrailingSlash = (url) => url.replace(/\/+$/, "");
|
|
2000
|
+
var MorphAPIClient = class {
|
|
2001
|
+
/** Explicit key as provided; resolved against env at request time. */
|
|
2002
|
+
apiKey;
|
|
2003
|
+
baseURL;
|
|
2004
|
+
reposURL;
|
|
2005
|
+
browserURL;
|
|
2006
|
+
/** Explicit default timeout (ms), if set. The request default is applied lazily so
|
|
2007
|
+
* resources can read an undefined value and supply their own fallback. */
|
|
2008
|
+
timeout;
|
|
2009
|
+
retryConfig;
|
|
2010
|
+
debug;
|
|
2011
|
+
constructor(options = {}) {
|
|
2012
|
+
this.apiKey = options.apiKey;
|
|
2013
|
+
this.baseURL = stripTrailingSlash(options.baseURL ?? DEFAULT_BASE_URL);
|
|
2014
|
+
this.reposURL = stripTrailingSlash(options.reposURL ?? env("MORPH_SEARCH_URL") ?? DEFAULT_REPOS_URL);
|
|
2015
|
+
this.browserURL = stripTrailingSlash(
|
|
2016
|
+
options.browserURL ?? (env("MORPH_ENVIRONMENT") === "DEV" ? "http://localhost:8000" : DEFAULT_BROWSER_URL)
|
|
2017
|
+
);
|
|
2018
|
+
this.timeout = options.timeout;
|
|
2019
|
+
this.retryConfig = options.retryConfig;
|
|
2020
|
+
this.debug = options.debug ?? false;
|
|
2021
|
+
if (this.debug) logger.enable();
|
|
2022
|
+
}
|
|
2023
|
+
/** The key actually used for requests: explicit, else `MORPH_API_KEY`. */
|
|
2024
|
+
resolveApiKey() {
|
|
2025
|
+
return this.apiKey ?? env("MORPH_API_KEY");
|
|
2026
|
+
}
|
|
2027
|
+
/** Headers shared with tools that bring their own HTTP client (FastApply/WarpGrep via the `openai` package). */
|
|
2028
|
+
defaultHeaders() {
|
|
2029
|
+
return { "X-Morph-SDK-Version": SDK_VERSION };
|
|
2030
|
+
}
|
|
2031
|
+
buildURL(path6, baseURL) {
|
|
2032
|
+
if (/^https?:\/\//i.test(path6)) return path6;
|
|
2033
|
+
const base = stripTrailingSlash(baseURL ?? this.baseURL);
|
|
2034
|
+
return `${base}${path6.startsWith("/") ? "" : "/"}${path6}`;
|
|
2035
|
+
}
|
|
2036
|
+
buildHeaders(apiKey, extra) {
|
|
2037
|
+
return {
|
|
2038
|
+
"Content-Type": "application/json",
|
|
2039
|
+
"X-Morph-SDK-Version": SDK_VERSION,
|
|
2040
|
+
Authorization: `Bearer ${apiKey}`,
|
|
2041
|
+
...extra
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
applyQuery(url, query) {
|
|
2045
|
+
if (!query) return url;
|
|
2046
|
+
const params = new URLSearchParams();
|
|
2047
|
+
for (const [key, value] of Object.entries(query)) {
|
|
2048
|
+
if (value !== void 0 && value !== null) params.set(key, String(value));
|
|
2049
|
+
}
|
|
2050
|
+
const qs = params.toString();
|
|
2051
|
+
return qs ? `${url}${url.includes("?") ? "&" : "?"}${qs}` : url;
|
|
2052
|
+
}
|
|
2053
|
+
async request(method, path6, opts = {}) {
|
|
2054
|
+
const apiKey = this.resolveApiKey();
|
|
2055
|
+
if (!apiKey) {
|
|
2056
|
+
throw new MorphError(
|
|
2057
|
+
"Morph API key not found. Set the MORPH_API_KEY environment variable or pass apiKey in config.",
|
|
2058
|
+
"missing_api_key",
|
|
2059
|
+
401
|
|
2060
|
+
);
|
|
2061
|
+
}
|
|
2062
|
+
const url = this.applyQuery(this.buildURL(path6, opts.baseURL), opts.query);
|
|
2063
|
+
const timeout = opts.timeout ?? this.timeout ?? DEFAULT_TIMEOUT;
|
|
2064
|
+
const init = {
|
|
2065
|
+
method,
|
|
2066
|
+
headers: this.buildHeaders(apiKey, opts.headers),
|
|
2067
|
+
...opts.body !== void 0 ? { body: JSON.stringify(opts.body) } : {},
|
|
2068
|
+
...opts.signal ? { signal: opts.signal } : {}
|
|
2069
|
+
};
|
|
2070
|
+
logger.debug("MorphAPIClient", "request", { method, url });
|
|
2071
|
+
const response = await withTimeout(
|
|
2072
|
+
fetchWithRetry(url, init, this.retryConfig ?? {}),
|
|
2073
|
+
timeout,
|
|
2074
|
+
`Morph request to ${url} timed out after ${timeout}ms`
|
|
2075
|
+
);
|
|
2076
|
+
if (opts.raw) return response;
|
|
2077
|
+
if (!response.ok) throw await toMorphError(response);
|
|
2078
|
+
if (opts.stream) return response;
|
|
2079
|
+
if (response.status === 204) return void 0;
|
|
2080
|
+
const text = await response.text();
|
|
2081
|
+
return text ? JSON.parse(text) : void 0;
|
|
2082
|
+
}
|
|
2083
|
+
get(path6, opts) {
|
|
2084
|
+
return this.request("GET", path6, opts);
|
|
2085
|
+
}
|
|
2086
|
+
post(path6, opts) {
|
|
2087
|
+
return this.request("POST", path6, opts);
|
|
2088
|
+
}
|
|
2089
|
+
delete(path6, opts) {
|
|
2090
|
+
return this.request("DELETE", path6, opts);
|
|
2091
|
+
}
|
|
2092
|
+
};
|
|
2093
|
+
|
|
2094
|
+
// core/resource.ts
|
|
2095
|
+
var APIResource = class {
|
|
2096
|
+
_client;
|
|
2097
|
+
constructor(client) {
|
|
2098
|
+
this._client = client;
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
|
|
1888
2102
|
// tools/compact/core.ts
|
|
1889
2103
|
var DEFAULT_API_URL2 = "https://api.morphllm.com";
|
|
1890
|
-
var
|
|
1891
|
-
|
|
2104
|
+
var DEFAULT_TIMEOUT2 = 12e4;
|
|
2105
|
+
function resolveClient(clientOrConfig) {
|
|
2106
|
+
if (clientOrConfig instanceof MorphAPIClient) return clientOrConfig;
|
|
2107
|
+
return new MorphAPIClient({
|
|
2108
|
+
apiKey: clientOrConfig.morphApiKey,
|
|
2109
|
+
baseURL: clientOrConfig.morphApiUrl ?? DEFAULT_API_URL2,
|
|
2110
|
+
timeout: clientOrConfig.timeout ?? DEFAULT_TIMEOUT2,
|
|
2111
|
+
retryConfig: clientOrConfig.retryConfig,
|
|
2112
|
+
debug: clientOrConfig.debug
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
2115
|
+
var CompactClient = class extends APIResource {
|
|
2116
|
+
/** Resolved URL/timeout, exposed for backwards-compatible introspection. */
|
|
1892
2117
|
config;
|
|
1893
|
-
constructor(
|
|
2118
|
+
constructor(clientOrConfig = {}) {
|
|
2119
|
+
super(resolveClient(clientOrConfig));
|
|
2120
|
+
const cfg = clientOrConfig instanceof MorphAPIClient ? {} : clientOrConfig;
|
|
1894
2121
|
this.config = {
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
2122
|
+
morphApiUrl: this._client.baseURL,
|
|
2123
|
+
timeout: cfg.timeout ?? DEFAULT_TIMEOUT2,
|
|
2124
|
+
debug: cfg.debug ?? false
|
|
1898
2125
|
};
|
|
1899
2126
|
}
|
|
1900
2127
|
/**
|
|
@@ -1913,17 +2140,6 @@ var CompactClient = class {
|
|
|
1913
2140
|
* ```
|
|
1914
2141
|
*/
|
|
1915
2142
|
async compact(input) {
|
|
1916
|
-
const apiKey = this.config.morphApiKey || (typeof process !== "undefined" ? process.env?.MORPH_API_KEY : void 0);
|
|
1917
|
-
const debug = this.config.debug || false;
|
|
1918
|
-
if (!apiKey) {
|
|
1919
|
-
throw new Error(
|
|
1920
|
-
"Morph API key not found. Set MORPH_API_KEY environment variable or pass morphApiKey in config."
|
|
1921
|
-
);
|
|
1922
|
-
}
|
|
1923
|
-
const url = `${this.config.morphApiUrl}/v1/compact`;
|
|
1924
|
-
if (debug) {
|
|
1925
|
-
console.log(`[Compact] Calling ${url}`);
|
|
1926
|
-
}
|
|
1927
2143
|
const body = {
|
|
1928
2144
|
compression_ratio: input.compressionRatio ?? 0.5,
|
|
1929
2145
|
preserve_recent: input.preserveRecent ?? 2,
|
|
@@ -1931,37 +2147,19 @@ var CompactClient = class {
|
|
|
1931
2147
|
include_line_ranges: input.includeLineRanges ?? true,
|
|
1932
2148
|
include_markers: input.includeMarkers ?? true
|
|
1933
2149
|
};
|
|
1934
|
-
if (input.query !== void 0)
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
if (input.
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
const startTime = Date.now();
|
|
1947
|
-
const response = await fetch(url, {
|
|
1948
|
-
method: "POST",
|
|
1949
|
-
headers: {
|
|
1950
|
-
"Authorization": `Bearer ${apiKey}`,
|
|
1951
|
-
"Content-Type": "application/json"
|
|
1952
|
-
},
|
|
1953
|
-
body: JSON.stringify(body),
|
|
1954
|
-
signal: AbortSignal.timeout(this.config.timeout)
|
|
1955
|
-
});
|
|
1956
|
-
if (!response.ok) {
|
|
1957
|
-
const text = await response.text();
|
|
1958
|
-
throw new Error(`Compact API error ${response.status}: ${text}`);
|
|
1959
|
-
}
|
|
1960
|
-
const data = await response.json();
|
|
1961
|
-
if (debug) {
|
|
1962
|
-
console.log(`[Compact] compact() done in ${Date.now() - startTime}ms`);
|
|
2150
|
+
if (input.query !== void 0) body.query = input.query;
|
|
2151
|
+
if (input.messages) body.messages = input.messages;
|
|
2152
|
+
else if (typeof input.input === "string") body.input = input.input;
|
|
2153
|
+
else if (Array.isArray(input.input)) body.messages = input.input;
|
|
2154
|
+
else throw new Error("Either 'input' or 'messages' must be provided");
|
|
2155
|
+
try {
|
|
2156
|
+
return await this._client.post("/v1/compact", { body, timeout: this.config.timeout });
|
|
2157
|
+
} catch (err) {
|
|
2158
|
+
if (err instanceof MorphError) {
|
|
2159
|
+
throw new Error(`Compact API error ${err.statusCode}: ${err.message}`);
|
|
2160
|
+
}
|
|
2161
|
+
throw err;
|
|
1963
2162
|
}
|
|
1964
|
-
return data;
|
|
1965
2163
|
}
|
|
1966
2164
|
};
|
|
1967
2165
|
|
|
@@ -2017,10 +2215,28 @@ async function getLocalProvider(repoRoot, excludes, allowNames) {
|
|
|
2017
2215
|
const opts = allowNames?.length ? { allowNames } : void 0;
|
|
2018
2216
|
return new LocalRipgrepProvider2(repoRoot, excludes, opts);
|
|
2019
2217
|
}
|
|
2020
|
-
var WarpGrepClient = class {
|
|
2218
|
+
var WarpGrepClient = class extends APIResource {
|
|
2021
2219
|
config;
|
|
2022
|
-
constructor(
|
|
2023
|
-
|
|
2220
|
+
constructor(clientOrConfig = {}) {
|
|
2221
|
+
const isClient = clientOrConfig instanceof MorphAPIClient;
|
|
2222
|
+
super(
|
|
2223
|
+
isClient ? clientOrConfig : new MorphAPIClient({
|
|
2224
|
+
apiKey: clientOrConfig.morphApiKey,
|
|
2225
|
+
baseURL: clientOrConfig.morphApiUrl,
|
|
2226
|
+
timeout: clientOrConfig.timeout,
|
|
2227
|
+
retryConfig: clientOrConfig.retryConfig,
|
|
2228
|
+
debug: clientOrConfig.debug
|
|
2229
|
+
})
|
|
2230
|
+
);
|
|
2231
|
+
const cfg = isClient ? {} : clientOrConfig;
|
|
2232
|
+
this.config = {
|
|
2233
|
+
...cfg,
|
|
2234
|
+
morphApiKey: this._client.resolveApiKey(),
|
|
2235
|
+
morphApiUrl: this._client.baseURL,
|
|
2236
|
+
timeout: this._client.timeout,
|
|
2237
|
+
retryConfig: this._client.retryConfig,
|
|
2238
|
+
debug: this._client.debug
|
|
2239
|
+
};
|
|
2024
2240
|
}
|
|
2025
2241
|
execute(input) {
|
|
2026
2242
|
const toolConfig = {
|