@morphllm/morphsdk 0.2.202 → 0.2.204
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/README.md +101 -0
- package/dist/chunk-2GMG5XKU.js +100 -0
- package/dist/chunk-2PPYWRMZ.js +3 -4
- package/dist/chunk-3HAHJYZQ.cjs +74 -0
- package/dist/{chunk-2XU3XXUE.js → chunk-3JROKKS4.js} +3 -25
- package/dist/{chunk-26K5EJD3.js → chunk-43JBUEIX.js} +4 -18
- package/dist/chunk-44OIEPIO.js +4 -23
- package/dist/chunk-4EQQGUZ7.cjs +104 -0
- package/dist/chunk-4OUGA3KS.js +1 -5
- package/dist/{chunk-VQDDL3UH.js → chunk-4TZBUFVP.js} +2 -8
- package/dist/{chunk-YAM6P5OQ.js → chunk-564XJOQP.js} +2 -6
- package/dist/chunk-5H3FKFOI.cjs +77 -0
- package/dist/chunk-5TTZQF4X.cjs +110 -0
- package/dist/chunk-6HAYJA6M.cjs +317 -0
- package/dist/chunk-6TZCVTW5.js +3 -4
- package/dist/chunk-6WP7EA4F.js +2 -4
- package/dist/chunk-74A4HLIO.cjs +42 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-7PJYY46L.cjs +2 -0
- package/dist/chunk-AWFZKS27.cjs +11 -0
- package/dist/chunk-BJBWWIZV.cjs +2 -0
- package/dist/chunk-DLYDIYDK.cjs +305 -0
- package/dist/{chunk-65TUD7JV.js → chunk-DYCMPDPV.js} +13 -29
- package/dist/{chunk-3CPI6ZIC.js → chunk-DZP7BR66.js} +22 -43
- package/dist/chunk-E63OPKP7.js +96 -0
- package/dist/chunk-E6V75LI6.cjs +334 -0
- package/dist/{chunk-XPHNS7NW.js → chunk-EJ6ID24K.js} +3 -12
- package/dist/chunk-EJTL2BOZ.cjs +42 -0
- package/dist/chunk-ETBRAKVV.js +1 -5
- package/dist/chunk-F633IVQA.cjs +91 -0
- package/dist/chunk-FBOZIVVQ.js +1 -0
- package/dist/{chunk-UKXCGQPS.js → chunk-FGA6EYC2.js} +35 -37
- package/dist/{chunk-CAWQEHKP.js → chunk-G4RODMXA.js} +4 -19
- package/dist/chunk-GUNGJC6X.cjs +256 -0
- package/dist/chunk-GYE3FY6Z.js +8 -0
- package/dist/chunk-HDP4QAZL.js +1 -4
- package/dist/chunk-HNMEBYIS.cjs +86 -0
- package/dist/chunk-HP3PCOTW.cjs +81 -0
- package/dist/{chunk-ICCGLO6V.js → chunk-IGXNLXPN.js} +12 -17
- package/dist/chunk-IPJA3ZS6.cjs +10 -0
- package/dist/chunk-JHC2R3HU.cjs +317 -0
- package/dist/{chunk-IBRBSDLT.js → chunk-JVMIFGZY.js} +5 -8
- package/dist/chunk-KF6S3EPJ.cjs +100 -0
- package/dist/chunk-KVGZ2TSG.cjs +274 -0
- package/dist/{chunk-6OYJC4TZ.js → chunk-L5SCKZVK.js} +13 -22
- package/dist/chunk-LDM7RNNN.js +1 -0
- package/dist/{chunk-UAZKHSEU.js → chunk-LQST3NW2.js} +5 -15
- package/dist/chunk-M34E2AMK.js +1 -5
- package/dist/chunk-MF56KEI4.js +1 -4
- package/dist/chunk-MLKGABMK.js +1 -3
- package/dist/chunk-MLPZKUCO.js +4 -5
- package/dist/chunk-MMX5PUGC.cjs +242 -0
- package/dist/chunk-MWXJ6DZ2.cjs +21 -0
- package/dist/chunk-NJWOWXUR.cjs +137 -0
- package/dist/chunk-NNKBKENK.cjs +15 -0
- package/dist/chunk-NRG6QX3L.js +1 -3
- package/dist/chunk-OCKEEEYE.cjs +433 -0
- package/dist/chunk-OENJO7YW.js +306 -0
- package/dist/chunk-OKLAYEBC.cjs +2 -0
- package/dist/chunk-OPDWMD4Q.js +1 -3
- package/dist/{chunk-D6YJ5X3C.js → chunk-OX5GN2KB.js} +26 -14
- package/dist/{chunk-JEVLCA5C.js → chunk-OYBOP47A.js} +18 -19
- package/dist/chunk-OZHCHPIE.js +1 -0
- package/dist/chunk-PA3UTI4A.js +1 -4
- package/dist/chunk-QEEAIXL5.cjs +74 -0
- package/dist/chunk-QT5LGZG3.cjs +10 -0
- package/dist/chunk-R3TUE7O2.cjs +107 -0
- package/dist/chunk-RYVW7RUM.js +2 -6
- package/dist/{chunk-LVKKICOB.js → chunk-SOQYE5A4.js} +36 -69
- package/dist/chunk-ST2OXLT5.cjs +91 -0
- package/dist/{chunk-SIFDK4AA.js → chunk-TH4MG73B.js} +3 -24
- package/dist/{chunk-OSL4CNSO.js → chunk-TLMAMVAW.js} +7 -23
- package/dist/chunk-TPZHMD7J.cjs +72 -0
- package/dist/{chunk-PDSIWL7I.js → chunk-U4PYAGNR.js} +6 -19
- package/dist/chunk-UAPK3AIJ.js +1 -10
- package/dist/chunk-UF5IKELS.cjs +26 -0
- package/dist/chunk-UHFVWYSP.cjs +408 -0
- package/dist/chunk-UKBSXYKE.cjs +280 -0
- package/dist/chunk-UNX7V6P6.cjs +60 -0
- package/dist/chunk-UZMMJ47A.cjs +107 -0
- package/dist/chunk-VHD7CW5O.cjs +43 -0
- package/dist/chunk-VL4QNALG.cjs +50 -0
- package/dist/chunk-VYE7O4FM.cjs +51 -0
- package/dist/chunk-WIYVT4UO.cjs +173 -0
- package/dist/chunk-WJHHO24M.cjs +91 -0
- package/dist/chunk-WR7LSUIR.cjs +213 -0
- package/dist/chunk-XE6D4J63.cjs +72 -0
- package/dist/chunk-YAUXTFIN.cjs +21 -0
- package/dist/{chunk-NFPRKZQ5.js → chunk-YJUCGZNN.js} +5 -22
- package/dist/chunk-ZSHVXDA2.js +4 -10
- package/dist/chunk-ZX6T3LNG.js +302 -0
- package/dist/{client-BWhi-vSj.d.ts → client-DSXbcxII.d.ts} +10 -1
- package/dist/client.cjs +44 -4360
- package/dist/client.d.ts +4 -2
- package/dist/client.js +36 -37
- package/dist/core/client.cjs +14 -476
- package/dist/core/client.d.ts +8 -0
- package/dist/core/client.js +10 -11
- package/dist/core/error.cjs +8 -251
- package/dist/core/error.js +4 -9
- package/dist/core/index.cjs +27 -491
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +12 -19
- package/dist/core/resource.cjs +9 -33
- package/dist/core/resource.d.ts +2 -0
- package/dist/core/resource.js +2 -7
- package/dist/edge.cjs +74 -1111
- package/dist/edge.d.ts +3 -0
- package/dist/edge.js +14 -42
- package/dist/guard-CvW03v4u.d.ts +59 -0
- package/dist/index.cjs +140 -4431
- package/dist/index.d.ts +6 -2
- package/dist/index.js +44 -87
- package/dist/modelrouter/core.cjs +35 -651
- package/dist/modelrouter/core.d.ts +2 -0
- package/dist/modelrouter/core.js +12 -21
- package/dist/modelrouter/index.cjs +35 -651
- package/dist/modelrouter/index.d.ts +2 -0
- package/dist/modelrouter/index.js +12 -21
- package/dist/modelrouter/types.cjs +1 -17
- package/dist/modelrouter/types.d.ts +5 -0
- package/dist/modelrouter/types.js +1 -0
- package/dist/subagents/anthropic.cjs +31 -2784
- package/dist/subagents/anthropic.d.ts +3 -1
- package/dist/subagents/anthropic.js +23 -24
- package/dist/subagents/index.cjs +14 -95
- package/dist/subagents/index.d.ts +3 -1
- package/dist/subagents/index.js +2 -11
- package/dist/subagents/prompts.cjs +14 -93
- package/dist/subagents/prompts.d.ts +3 -1
- package/dist/subagents/prompts.js +2 -11
- package/dist/subagents/types.cjs +1 -17
- package/dist/subagents/types.d.ts +3 -1
- package/dist/subagents/types.js +1 -0
- package/dist/subagents/vercel.cjs +31 -2761
- package/dist/subagents/vercel.d.ts +3 -1
- package/dist/subagents/vercel.js +23 -24
- package/dist/tools/compact/core.cjs +20 -552
- package/dist/tools/compact/core.d.ts +2 -0
- package/dist/tools/compact/core.js +12 -13
- package/dist/tools/compact/index.cjs +24 -598
- package/dist/tools/compact/index.d.ts +3 -1
- package/dist/tools/compact/index.js +13 -17
- package/dist/tools/compact/types.cjs +1 -17
- package/dist/tools/compact/types.d.ts +4 -4
- package/dist/tools/compact/types.js +1 -0
- package/dist/tools/fastapply/anthropic.cjs +39 -899
- package/dist/tools/fastapply/anthropic.d.ts +2 -0
- package/dist/tools/fastapply/anthropic.js +15 -24
- package/dist/tools/fastapply/apply.cjs +32 -672
- package/dist/tools/fastapply/apply.d.ts +2 -0
- package/dist/tools/fastapply/apply.js +8 -19
- package/dist/tools/fastapply/core.cjs +49 -1069
- package/dist/tools/fastapply/core.d.ts +3 -0
- package/dist/tools/fastapply/core.js +13 -29
- package/dist/tools/fastapply/index.cjs +56 -1052
- package/dist/tools/fastapply/index.d.ts +2 -0
- package/dist/tools/fastapply/index.js +18 -44
- package/dist/tools/fastapply/openai.cjs +45 -910
- package/dist/tools/fastapply/openai.d.ts +2 -0
- package/dist/tools/fastapply/openai.js +15 -26
- package/dist/tools/fastapply/prompts.cjs +10 -62
- package/dist/tools/fastapply/prompts.js +2 -9
- package/dist/tools/fastapply/types.cjs +1 -17
- package/dist/tools/fastapply/types.d.ts +9 -4
- package/dist/tools/fastapply/types.js +1 -0
- package/dist/tools/fastapply/vercel.cjs +37 -905
- package/dist/tools/fastapply/vercel.d.ts +2 -0
- package/dist/tools/fastapply/vercel.js +15 -22
- package/dist/tools/index.cjs +56 -1052
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +18 -44
- package/dist/tools/pii/index.cjs +47 -0
- package/dist/tools/pii/index.d.ts +4 -0
- package/dist/tools/pii/index.js +6 -0
- package/dist/tools/pii/model.cjs +45 -0
- package/dist/tools/pii/model.d.ts +83 -0
- package/dist/tools/pii/model.js +4 -0
- package/dist/tools/pii/patterns.cjs +15 -0
- package/dist/tools/pii/patterns.d.ts +31 -0
- package/dist/tools/pii/patterns.js +2 -0
- package/dist/tools/pii/regex.cjs +32 -0
- package/dist/tools/pii/regex.d.ts +48 -0
- package/dist/tools/pii/regex.js +3 -0
- package/dist/tools/pii/types.cjs +2 -0
- package/dist/tools/pii/types.d.ts +108 -0
- package/dist/tools/pii/types.js +1 -0
- package/dist/tools/utils/resilience.cjs +15 -312
- package/dist/tools/utils/resilience.js +3 -12
- package/dist/tools/warp_grep/agent/config.cjs +16 -127
- package/dist/tools/warp_grep/agent/config.js +2 -11
- package/dist/tools/warp_grep/agent/formatter.cjs +12 -48
- package/dist/tools/warp_grep/agent/formatter.js +2 -9
- package/dist/tools/warp_grep/agent/parser.cjs +16 -83
- package/dist/tools/warp_grep/agent/parser.d.ts +2 -0
- package/dist/tools/warp_grep/agent/parser.js +2 -11
- package/dist/tools/warp_grep/agent/runner.cjs +19 -1081
- package/dist/tools/warp_grep/agent/runner.d.ts +2 -0
- package/dist/tools/warp_grep/agent/runner.js +11 -14
- package/dist/tools/warp_grep/agent/types.cjs +1 -17
- package/dist/tools/warp_grep/agent/types.d.ts +4 -0
- package/dist/tools/warp_grep/agent/types.js +1 -0
- package/dist/tools/warp_grep/anthropic.cjs +51 -2561
- package/dist/tools/warp_grep/anthropic.d.ts +3 -1
- package/dist/tools/warp_grep/anthropic.js +23 -35
- package/dist/tools/warp_grep/client.cjs +53 -2471
- package/dist/tools/warp_grep/client.d.ts +3 -1
- package/dist/tools/warp_grep/client.js +21 -34
- package/dist/tools/warp_grep/gemini.cjs +52 -2490
- package/dist/tools/warp_grep/gemini.d.ts +3 -1
- package/dist/tools/warp_grep/gemini.js +25 -41
- package/dist/tools/warp_grep/harness.cjs +81 -936
- package/dist/tools/warp_grep/harness.d.ts +2 -0
- package/dist/tools/warp_grep/harness.js +12 -51
- package/dist/tools/warp_grep/index.cjs +128 -2575
- package/dist/tools/warp_grep/index.d.ts +3 -1
- package/dist/tools/warp_grep/index.js +28 -87
- package/dist/tools/warp_grep/openai.cjs +57 -2575
- package/dist/tools/warp_grep/openai.d.ts +3 -1
- package/dist/tools/warp_grep/openai.js +23 -37
- package/dist/tools/warp_grep/providers/code_storage_http.cjs +12 -65
- package/dist/tools/warp_grep/providers/code_storage_http.d.ts +3 -1
- package/dist/tools/warp_grep/providers/code_storage_http.js +2 -9
- package/dist/tools/warp_grep/providers/local.cjs +10 -589
- package/dist/tools/warp_grep/providers/local.js +6 -11
- package/dist/tools/warp_grep/providers/remote.cjs +8 -331
- package/dist/tools/warp_grep/providers/remote.d.ts +3 -1
- package/dist/tools/warp_grep/providers/remote.js +3 -8
- package/dist/tools/warp_grep/providers/types.cjs +1 -17
- package/dist/tools/warp_grep/providers/types.js +1 -0
- package/dist/tools/warp_grep/utils/files.cjs +9 -42
- package/dist/tools/warp_grep/utils/files.js +2 -7
- package/dist/tools/warp_grep/utils/github.cjs +9 -43
- package/dist/tools/warp_grep/utils/github.js +2 -7
- package/dist/tools/warp_grep/utils/paths.cjs +28 -104
- package/dist/tools/warp_grep/utils/paths.js +2 -17
- package/dist/tools/warp_grep/utils/ripgrep.cjs +9 -103
- package/dist/tools/warp_grep/utils/ripgrep.js +2 -7
- package/dist/tools/warp_grep/vercel.cjs +57 -2557
- package/dist/tools/warp_grep/vercel.d.ts +3 -1
- package/dist/tools/warp_grep/vercel.js +23 -37
- package/dist/{types-DxZLPogx.d.ts → types-BKhXjDCB.d.ts} +6 -1
- package/dist/version.cjs +7 -225
- package/dist/version.js +2 -7
- package/package.json +11 -2
- package/dist/chunk-E6TL6MIH.js +0 -203
|
@@ -1,52 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-CAWQEHKP.js";
|
|
16
|
-
import {
|
|
17
|
-
createEditFileTool as createEditFileTool3
|
|
18
|
-
} from "./chunk-PDSIWL7I.js";
|
|
19
|
-
import {
|
|
20
|
-
createEditFileTool as createEditFileTool2
|
|
21
|
-
} from "./chunk-26K5EJD3.js";
|
|
22
|
-
import {
|
|
23
|
-
FastApplyClient
|
|
24
|
-
} from "./chunk-65TUD7JV.js";
|
|
25
|
-
import {
|
|
26
|
-
createExploreSubagent
|
|
27
|
-
} from "./chunk-XPHNS7NW.js";
|
|
28
|
-
import {
|
|
29
|
-
createExploreSubagent as createExploreSubagent2
|
|
30
|
-
} from "./chunk-UAZKHSEU.js";
|
|
31
|
-
import {
|
|
32
|
-
WarpGrepClient
|
|
33
|
-
} from "./chunk-3CPI6ZIC.js";
|
|
34
|
-
import {
|
|
35
|
-
AnthropicRouter,
|
|
36
|
-
GeminiRouter,
|
|
37
|
-
OpenAIRouter,
|
|
38
|
-
RawRouter,
|
|
39
|
-
RouterClassifier
|
|
40
|
-
} from "./chunk-6OYJC4TZ.js";
|
|
41
|
-
import {
|
|
42
|
-
CompactClient
|
|
43
|
-
} from "./chunk-D6YJ5X3C.js";
|
|
44
|
-
import {
|
|
45
|
-
MorphAPIClient
|
|
46
|
-
} from "./chunk-ICCGLO6V.js";
|
|
47
|
-
import {
|
|
48
|
-
logger
|
|
49
|
-
} from "./chunk-6WP7EA4F.js";
|
|
1
|
+
import { createWarpGrepTool as createWarpGrepTool$2, createGitHubSearchTool as createGitHubSearchTool$2 } from './chunk-YJUCGZNN.js';
|
|
2
|
+
import { createWarpGrepTool as createWarpGrepTool$1, createGitHubSearchTool as createGitHubSearchTool$1 } from './chunk-TH4MG73B.js';
|
|
3
|
+
import { createWarpGrepTool, createGitHubSearchTool } from './chunk-3JROKKS4.js';
|
|
4
|
+
import { createExploreSubagent as createExploreSubagent$1 } from './chunk-LQST3NW2.js';
|
|
5
|
+
import { createEditFileTool } from './chunk-G4RODMXA.js';
|
|
6
|
+
import { createEditFileTool as createEditFileTool$2 } from './chunk-U4PYAGNR.js';
|
|
7
|
+
import { createEditFileTool as createEditFileTool$1 } from './chunk-43JBUEIX.js';
|
|
8
|
+
import { FastApplyClient } from './chunk-DYCMPDPV.js';
|
|
9
|
+
import { createExploreSubagent } from './chunk-EJ6ID24K.js';
|
|
10
|
+
import { WarpGrepClient } from './chunk-DZP7BR66.js';
|
|
11
|
+
import { RouterClassifier, RawRouter, GeminiRouter, AnthropicRouter, OpenAIRouter } from './chunk-L5SCKZVK.js';
|
|
12
|
+
import { CompactClient } from './chunk-OX5GN2KB.js';
|
|
13
|
+
import { MorphAPIClient } from './chunk-IGXNLXPN.js';
|
|
14
|
+
import { logger } from './chunk-6WP7EA4F.js';
|
|
50
15
|
|
|
51
16
|
// factories/openai.ts
|
|
52
17
|
var OpenAIToolFactory = class {
|
|
@@ -62,7 +27,8 @@ var OpenAIToolFactory = class {
|
|
|
62
27
|
createWarpGrepTool(toolConfig) {
|
|
63
28
|
return createWarpGrepTool({
|
|
64
29
|
...toolConfig,
|
|
65
|
-
morphApiKey: this.config.apiKey
|
|
30
|
+
morphApiKey: this.config.apiKey,
|
|
31
|
+
redactPII: toolConfig.redactPII ?? this.config.redactPII
|
|
66
32
|
});
|
|
67
33
|
}
|
|
68
34
|
/**
|
|
@@ -74,7 +40,8 @@ var OpenAIToolFactory = class {
|
|
|
74
40
|
createEditFileTool(toolConfig = {}) {
|
|
75
41
|
return createEditFileTool({
|
|
76
42
|
...toolConfig,
|
|
77
|
-
morphApiKey: this.config.apiKey
|
|
43
|
+
morphApiKey: this.config.apiKey,
|
|
44
|
+
redactPII: toolConfig.redactPII ?? this.config.redactPII
|
|
78
45
|
});
|
|
79
46
|
}
|
|
80
47
|
/**
|
|
@@ -103,9 +70,10 @@ var AnthropicToolFactory = class {
|
|
|
103
70
|
* @returns Anthropic Tool with execute and formatResult methods
|
|
104
71
|
*/
|
|
105
72
|
createWarpGrepTool(toolConfig) {
|
|
106
|
-
return
|
|
73
|
+
return createWarpGrepTool$1({
|
|
107
74
|
...toolConfig,
|
|
108
|
-
morphApiKey: this.config.apiKey
|
|
75
|
+
morphApiKey: this.config.apiKey,
|
|
76
|
+
redactPII: toolConfig.redactPII ?? this.config.redactPII
|
|
109
77
|
});
|
|
110
78
|
}
|
|
111
79
|
/**
|
|
@@ -115,9 +83,10 @@ var AnthropicToolFactory = class {
|
|
|
115
83
|
* @returns Anthropic Tool with execute and formatResult methods
|
|
116
84
|
*/
|
|
117
85
|
createEditFileTool(toolConfig = {}) {
|
|
118
|
-
return
|
|
86
|
+
return createEditFileTool$1({
|
|
119
87
|
...toolConfig,
|
|
120
|
-
morphApiKey: this.config.apiKey
|
|
88
|
+
morphApiKey: this.config.apiKey,
|
|
89
|
+
redactPII: toolConfig.redactPII ?? this.config.redactPII
|
|
121
90
|
});
|
|
122
91
|
}
|
|
123
92
|
/**
|
|
@@ -127,7 +96,7 @@ var AnthropicToolFactory = class {
|
|
|
127
96
|
* @returns Anthropic Tool with execute and formatResult methods
|
|
128
97
|
*/
|
|
129
98
|
createGitHubSearchTool(toolConfig) {
|
|
130
|
-
return
|
|
99
|
+
return createGitHubSearchTool$1({
|
|
131
100
|
...toolConfig,
|
|
132
101
|
morphApiKey: this.config.apiKey
|
|
133
102
|
});
|
|
@@ -158,9 +127,10 @@ var VercelToolFactory = class {
|
|
|
158
127
|
* @returns Vercel AI SDK tool
|
|
159
128
|
*/
|
|
160
129
|
createWarpGrepTool(toolConfig) {
|
|
161
|
-
return
|
|
130
|
+
return createWarpGrepTool$2({
|
|
162
131
|
...toolConfig,
|
|
163
|
-
morphApiKey: this.config.apiKey
|
|
132
|
+
morphApiKey: this.config.apiKey,
|
|
133
|
+
redactPII: toolConfig.redactPII ?? this.config.redactPII
|
|
164
134
|
});
|
|
165
135
|
}
|
|
166
136
|
/**
|
|
@@ -170,9 +140,10 @@ var VercelToolFactory = class {
|
|
|
170
140
|
* @returns Vercel AI SDK tool
|
|
171
141
|
*/
|
|
172
142
|
createEditFileTool(toolConfig = {}) {
|
|
173
|
-
return
|
|
143
|
+
return createEditFileTool$2({
|
|
174
144
|
...toolConfig,
|
|
175
|
-
morphApiKey: this.config.apiKey
|
|
145
|
+
morphApiKey: this.config.apiKey,
|
|
146
|
+
redactPII: toolConfig.redactPII ?? this.config.redactPII
|
|
176
147
|
});
|
|
177
148
|
}
|
|
178
149
|
/**
|
|
@@ -182,7 +153,7 @@ var VercelToolFactory = class {
|
|
|
182
153
|
* @returns Vercel AI SDK tool
|
|
183
154
|
*/
|
|
184
155
|
createGitHubSearchTool(toolConfig) {
|
|
185
|
-
return
|
|
156
|
+
return createGitHubSearchTool$2({
|
|
186
157
|
...toolConfig,
|
|
187
158
|
morphApiKey: this.config.apiKey
|
|
188
159
|
});
|
|
@@ -194,7 +165,7 @@ var VercelToolFactory = class {
|
|
|
194
165
|
* @returns Explore subagent with .tool, .run(), and .stream() methods
|
|
195
166
|
*/
|
|
196
167
|
createExploreSubagent(config) {
|
|
197
|
-
return
|
|
168
|
+
return createExploreSubagent$1({
|
|
198
169
|
...config,
|
|
199
170
|
morphApiKey: this.config.apiKey
|
|
200
171
|
});
|
|
@@ -238,7 +209,8 @@ var MorphClient = class extends MorphAPIClient {
|
|
|
238
209
|
apiKey: config.apiKey,
|
|
239
210
|
timeout: config.timeout,
|
|
240
211
|
retryConfig: config.retryConfig,
|
|
241
|
-
debug: config.debug
|
|
212
|
+
debug: config.debug,
|
|
213
|
+
redactPII: config.redactPII
|
|
242
214
|
});
|
|
243
215
|
if (!config.apiKey) {
|
|
244
216
|
throw new Error("Morph API key is required. Pass it as { apiKey } when constructing MorphClient.");
|
|
@@ -262,9 +234,4 @@ var MorphClient = class extends MorphAPIClient {
|
|
|
262
234
|
}
|
|
263
235
|
};
|
|
264
236
|
|
|
265
|
-
export {
|
|
266
|
-
OpenAIToolFactory,
|
|
267
|
-
AnthropicToolFactory,
|
|
268
|
-
VercelToolFactory,
|
|
269
|
-
MorphClient
|
|
270
|
-
};
|
|
237
|
+
export { AnthropicToolFactory, MorphClient, OpenAIToolFactory, VercelToolFactory };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkEJTL2BOZ_cjs = require('./chunk-EJTL2BOZ.cjs');
|
|
4
|
+
var chunkJHC2R3HU_cjs = require('./chunk-JHC2R3HU.cjs');
|
|
5
|
+
|
|
6
|
+
// tools/warp_grep/openai.ts
|
|
7
|
+
var TOOL_PARAMETERS = {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
search_term: { type: "string", description: "Search problem statement that this subagent is supposed to research for" }
|
|
11
|
+
},
|
|
12
|
+
required: ["search_term"]
|
|
13
|
+
};
|
|
14
|
+
var warpGrepTool = {
|
|
15
|
+
type: "function",
|
|
16
|
+
function: {
|
|
17
|
+
name: chunkEJTL2BOZ_cjs.WARP_GREP_TOOL_NAME,
|
|
18
|
+
description: chunkEJTL2BOZ_cjs.WARP_GREP_DESCRIPTION,
|
|
19
|
+
parameters: TOOL_PARAMETERS
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
async function execute(input, config) {
|
|
23
|
+
return chunkJHC2R3HU_cjs.executeToolCall(input, config);
|
|
24
|
+
}
|
|
25
|
+
function createWarpGrepTool(config) {
|
|
26
|
+
const tool = {
|
|
27
|
+
type: "function",
|
|
28
|
+
function: {
|
|
29
|
+
name: config.name ?? chunkEJTL2BOZ_cjs.WARP_GREP_TOOL_NAME,
|
|
30
|
+
description: config.description ?? chunkEJTL2BOZ_cjs.WARP_GREP_DESCRIPTION,
|
|
31
|
+
parameters: TOOL_PARAMETERS
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return Object.assign(tool, {
|
|
35
|
+
execute: async (input) => {
|
|
36
|
+
return chunkJHC2R3HU_cjs.executeToolCall(input, config);
|
|
37
|
+
},
|
|
38
|
+
formatResult: (result) => {
|
|
39
|
+
return chunkJHC2R3HU_cjs.formatResult(result);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function createGitHubSearchTool(config) {
|
|
44
|
+
const client = new chunkJHC2R3HU_cjs.WarpGrepClient(config);
|
|
45
|
+
const tool = {
|
|
46
|
+
type: "function",
|
|
47
|
+
function: {
|
|
48
|
+
name: chunkEJTL2BOZ_cjs.GITHUB_SEARCH_TOOL_NAME,
|
|
49
|
+
description: chunkEJTL2BOZ_cjs.GITHUB_SEARCH_DESCRIPTION,
|
|
50
|
+
parameters: chunkEJTL2BOZ_cjs.GITHUB_SEARCH_INPUT_SCHEMA
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return Object.assign(tool, {
|
|
54
|
+
execute: async (input) => {
|
|
55
|
+
const github = input.github_url || input.owner_repo;
|
|
56
|
+
if (!github) {
|
|
57
|
+
throw new Error("Please provide github search url or owner/repo id");
|
|
58
|
+
}
|
|
59
|
+
return client.searchGitHub({ searchTerm: input.search_term, github, branch: input.branch });
|
|
60
|
+
},
|
|
61
|
+
formatResult: (result) => {
|
|
62
|
+
return chunkJHC2R3HU_cjs.formatResult(result);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function createGitHubReadFileTool(config) {
|
|
67
|
+
const tool = {
|
|
68
|
+
type: "function",
|
|
69
|
+
function: {
|
|
70
|
+
name: chunkEJTL2BOZ_cjs.GITHUB_READ_FILE_TOOL_NAME,
|
|
71
|
+
description: chunkEJTL2BOZ_cjs.GITHUB_READ_FILE_DESCRIPTION,
|
|
72
|
+
parameters: chunkEJTL2BOZ_cjs.GITHUB_READ_FILE_INPUT_SCHEMA
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return Object.assign(tool, {
|
|
76
|
+
execute: async (input) => {
|
|
77
|
+
return chunkJHC2R3HU_cjs.executeGitHubReadFile(input, config);
|
|
78
|
+
},
|
|
79
|
+
formatResult: (result) => {
|
|
80
|
+
return chunkJHC2R3HU_cjs.formatGitHubReadFileResult(result);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
var openai_default = warpGrepTool;
|
|
85
|
+
|
|
86
|
+
exports.createGitHubReadFileTool = createGitHubReadFileTool;
|
|
87
|
+
exports.createGitHubSearchTool = createGitHubSearchTool;
|
|
88
|
+
exports.createWarpGrepTool = createWarpGrepTool;
|
|
89
|
+
exports.execute = execute;
|
|
90
|
+
exports.openai_default = openai_default;
|
|
91
|
+
exports.warpGrepTool = warpGrepTool;
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
GITHUB_READ_FILE_INPUT_SCHEMA,
|
|
4
|
-
GITHUB_READ_FILE_TOOL_NAME,
|
|
5
|
-
GITHUB_SEARCH_DESCRIPTION,
|
|
6
|
-
GITHUB_SEARCH_INPUT_SCHEMA,
|
|
7
|
-
GITHUB_SEARCH_TOOL_NAME,
|
|
8
|
-
WARP_GREP_DESCRIPTION,
|
|
9
|
-
WARP_GREP_TOOL_NAME
|
|
10
|
-
} from "./chunk-UAPK3AIJ.js";
|
|
11
|
-
import {
|
|
12
|
-
WarpGrepClient,
|
|
13
|
-
executeGitHubReadFile,
|
|
14
|
-
executeToolCall,
|
|
15
|
-
formatGitHubReadFileResult,
|
|
16
|
-
formatResult
|
|
17
|
-
} from "./chunk-3CPI6ZIC.js";
|
|
1
|
+
import { WARP_GREP_DESCRIPTION, WARP_GREP_TOOL_NAME, GITHUB_SEARCH_INPUT_SCHEMA, GITHUB_SEARCH_DESCRIPTION, GITHUB_SEARCH_TOOL_NAME, GITHUB_READ_FILE_INPUT_SCHEMA, GITHUB_READ_FILE_DESCRIPTION, GITHUB_READ_FILE_TOOL_NAME } from './chunk-UAPK3AIJ.js';
|
|
2
|
+
import { executeToolCall, formatResult, WarpGrepClient, formatGitHubReadFileResult, executeGitHubReadFile } from './chunk-DZP7BR66.js';
|
|
18
3
|
|
|
19
4
|
// tools/warp_grep/anthropic.ts
|
|
20
5
|
var INPUT_SCHEMA = {
|
|
@@ -83,10 +68,4 @@ function createGitHubReadFileTool(config) {
|
|
|
83
68
|
});
|
|
84
69
|
}
|
|
85
70
|
|
|
86
|
-
export {
|
|
87
|
-
warpGrepTool,
|
|
88
|
-
execute,
|
|
89
|
-
createWarpGrepTool,
|
|
90
|
-
createGitHubSearchTool,
|
|
91
|
-
createGitHubReadFileTool
|
|
92
|
-
};
|
|
71
|
+
export { createGitHubReadFileTool, createGitHubSearchTool, createWarpGrepTool, execute, warpGrepTool };
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
fixPathRepetition,
|
|
9
|
-
isSymlink,
|
|
10
|
-
isTextualFile,
|
|
11
|
-
resolveUnderRepo,
|
|
12
|
-
toRepoRelative
|
|
13
|
-
} from "./chunk-ZSHVXDA2.js";
|
|
14
|
-
import {
|
|
15
|
-
AGENT_CONFIG,
|
|
16
|
-
DEFAULT_EXCLUDES
|
|
17
|
-
} from "./chunk-M34E2AMK.js";
|
|
1
|
+
import { readAllLines } from './chunk-6TZCVTW5.js';
|
|
2
|
+
import { resolveUnderRepo, toRepoRelative, fixPathRepetition, isSymlink, isTextualFile } from './chunk-ZSHVXDA2.js';
|
|
3
|
+
import { runRipgrep } from './chunk-MLPZKUCO.js';
|
|
4
|
+
import { DEFAULT_EXCLUDES, AGENT_CONFIG } from './chunk-M34E2AMK.js';
|
|
5
|
+
import fs from 'fs/promises';
|
|
6
|
+
import path from 'path';
|
|
18
7
|
|
|
19
|
-
// tools/warp_grep/providers/local.ts
|
|
20
|
-
import fs from "fs/promises";
|
|
21
|
-
import path from "path";
|
|
22
8
|
var SKIP_NAMES = /* @__PURE__ */ new Set([
|
|
23
9
|
// Version control
|
|
24
10
|
".git",
|
|
@@ -338,6 +324,4 @@ Details: ${res.stderr}` : ""}`
|
|
|
338
324
|
}
|
|
339
325
|
};
|
|
340
326
|
|
|
341
|
-
export {
|
|
342
|
-
LocalRipgrepProvider
|
|
343
|
-
};
|
|
327
|
+
export { LocalRipgrepProvider };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// subagents/prompts.ts
|
|
4
|
+
var THOROUGHNESS_INSTRUCTIONS = {
|
|
5
|
+
quick: `Do 1-2 targeted searches. Find the most relevant file/function quickly and summarize. Don't go deep.`,
|
|
6
|
+
medium: `Do 2-4 searches. Start broad, then follow up on the most promising leads. Cover the main aspects.`,
|
|
7
|
+
thorough: `Do 4-8 searches. Explore systematically: start broad, then drill into each relevant area. Cover edge cases, related files, and the full call chain. Leave no stone unturned.`
|
|
8
|
+
};
|
|
9
|
+
function getSystemPrompt(thoroughness = "medium") {
|
|
10
|
+
return `You are a codebase exploration specialist. Your job is to search a codebase and return a concise, accurate summary of what you find.
|
|
11
|
+
|
|
12
|
+
## Mode
|
|
13
|
+
READ-ONLY. You cannot modify files. You can only search and read code.
|
|
14
|
+
|
|
15
|
+
## Strategy
|
|
16
|
+
${THOROUGHNESS_INSTRUCTIONS[thoroughness]}
|
|
17
|
+
|
|
18
|
+
- Use multiple focused searches rather than one vague search
|
|
19
|
+
- Follow imports, function calls, and type references to build complete understanding
|
|
20
|
+
- If a search returns no results, try alternative terms (e.g., "auth" vs "authentication" vs "login")
|
|
21
|
+
- Look at both implementation and tests when relevant
|
|
22
|
+
|
|
23
|
+
## Communication
|
|
24
|
+
You have a \`send_message\` tool. Use it when:
|
|
25
|
+
- You hit a fork in the road and need guidance ("Found auth in both src/middleware/ and legacy/auth/. Which should I focus on?")
|
|
26
|
+
- You need clarification on ambiguous requests ("There are 3 auth strategies: JWT, session, OAuth. Which one?")
|
|
27
|
+
- You want to share a key finding before continuing ("The main auth handler is in src/auth/index.ts. It delegates to strategy-specific modules. Continuing to trace JWT flow.")
|
|
28
|
+
|
|
29
|
+
Do NOT use send_message for routine status updates. Only use it when you genuinely need input or have a significant finding worth sharing before you're done.
|
|
30
|
+
|
|
31
|
+
## Output
|
|
32
|
+
When you have enough information, output your final summary. Structure it as:
|
|
33
|
+
1. Direct answer to the question
|
|
34
|
+
2. Key files and their roles
|
|
35
|
+
3. How the pieces connect
|
|
36
|
+
|
|
37
|
+
Be concise. The summary should be useful to another AI model that will use your findings to complete a task.`;
|
|
38
|
+
}
|
|
39
|
+
var CODEBASE_SEARCH_TOOL = {
|
|
40
|
+
name: "codebase_search",
|
|
41
|
+
description: "Search the codebase for relevant code. Takes a natural language search request describing what you want to find. Returns matching file contents with line numbers.",
|
|
42
|
+
input_schema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
searchRequest: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Natural language description of what to search for in the codebase"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
required: ["searchRequest"],
|
|
51
|
+
additionalProperties: false
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var SEND_MESSAGE_TOOL = {
|
|
55
|
+
name: "send_message",
|
|
56
|
+
description: "Send a message to the orchestrating agent. Use this to ask questions, request clarification, or share important findings. The orchestrator may reply with additional context. Use sparingly \u2014 only when you genuinely need input or have a significant finding.",
|
|
57
|
+
input_schema: {
|
|
58
|
+
type: "object",
|
|
59
|
+
properties: {
|
|
60
|
+
message: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "The message to send to the orchestrator"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
required: ["message"],
|
|
66
|
+
additionalProperties: false
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
exports.CODEBASE_SEARCH_TOOL = CODEBASE_SEARCH_TOOL;
|
|
71
|
+
exports.SEND_MESSAGE_TOOL = SEND_MESSAGE_TOOL;
|
|
72
|
+
exports.getSystemPrompt = getSystemPrompt;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from
|
|
5
|
-
import {
|
|
6
|
-
executeEditFile
|
|
7
|
-
} from "./chunk-65TUD7JV.js";
|
|
8
|
-
import {
|
|
9
|
-
__export
|
|
10
|
-
} from "./chunk-MLKGABMK.js";
|
|
1
|
+
import { EDIT_FILE_TOOL_DESCRIPTION, EDIT_FILE_SYSTEM_PROMPT } from './chunk-PA3UTI4A.js';
|
|
2
|
+
import { executeEditFile } from './chunk-DYCMPDPV.js';
|
|
3
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
4
|
+
import { tool } from 'ai';
|
|
5
|
+
import { z } from 'zod';
|
|
11
6
|
|
|
12
7
|
// tools/fastapply/vercel.ts
|
|
13
8
|
var vercel_exports = {};
|
|
@@ -17,8 +12,6 @@ __export(vercel_exports, {
|
|
|
17
12
|
editFileTool: () => editFileTool,
|
|
18
13
|
getSystemPrompt: () => getSystemPrompt
|
|
19
14
|
});
|
|
20
|
-
import { tool } from "ai";
|
|
21
|
-
import { z } from "zod";
|
|
22
15
|
var editFileSchema = z.object({
|
|
23
16
|
target_filepath: z.string().describe("The path of the target file to modify"),
|
|
24
17
|
instruction: z.string().describe("A single sentence written in the first person describing what the agent is changing. Used to help disambiguate uncertainty in the edit."),
|
|
@@ -79,10 +72,4 @@ function createEditFileTool(config = {}) {
|
|
|
79
72
|
}
|
|
80
73
|
var vercel_default = editFileTool;
|
|
81
74
|
|
|
82
|
-
export {
|
|
83
|
-
editFileTool,
|
|
84
|
-
getSystemPrompt,
|
|
85
|
-
createEditFileTool,
|
|
86
|
-
vercel_default,
|
|
87
|
-
vercel_exports
|
|
88
|
-
};
|
|
75
|
+
export { createEditFileTool, editFileTool, getSystemPrompt, vercel_default, vercel_exports };
|
package/dist/chunk-UAPK3AIJ.js
CHANGED
|
@@ -30,13 +30,4 @@ var GITHUB_READ_FILE_INPUT_SCHEMA = {
|
|
|
30
30
|
required: ["github", "path"]
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
export {
|
|
34
|
-
WARP_GREP_TOOL_NAME,
|
|
35
|
-
WARP_GREP_DESCRIPTION,
|
|
36
|
-
GITHUB_SEARCH_TOOL_NAME,
|
|
37
|
-
GITHUB_SEARCH_DESCRIPTION,
|
|
38
|
-
GITHUB_SEARCH_INPUT_SCHEMA,
|
|
39
|
-
GITHUB_READ_FILE_TOOL_NAME,
|
|
40
|
-
GITHUB_READ_FILE_DESCRIPTION,
|
|
41
|
-
GITHUB_READ_FILE_INPUT_SCHEMA
|
|
42
|
-
};
|
|
33
|
+
export { GITHUB_READ_FILE_DESCRIPTION, GITHUB_READ_FILE_INPUT_SCHEMA, GITHUB_READ_FILE_TOOL_NAME, GITHUB_SEARCH_DESCRIPTION, GITHUB_SEARCH_INPUT_SCHEMA, GITHUB_SEARCH_TOOL_NAME, WARP_GREP_DESCRIPTION, WARP_GREP_TOOL_NAME };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// tools/warp_grep/agent/formatter.ts
|
|
4
|
+
var ToolOutputFormatter = class {
|
|
5
|
+
format(toolName, _args, output, options = {}) {
|
|
6
|
+
const name = (toolName ?? "").trim();
|
|
7
|
+
if (!name) {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
const payload = output?.toString?.()?.trim?.() ?? "";
|
|
11
|
+
const isError = Boolean(options.isError);
|
|
12
|
+
if (!payload && !isError) {
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
return `<tool_response>
|
|
16
|
+
${payload}
|
|
17
|
+
</tool_response>`;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var sharedFormatter = new ToolOutputFormatter();
|
|
21
|
+
function formatAgentToolOutput(toolName, args, output, options = {}) {
|
|
22
|
+
return sharedFormatter.format(toolName, args, output, options);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.ToolOutputFormatter = ToolOutputFormatter;
|
|
26
|
+
exports.formatAgentToolOutput = formatAgentToolOutput;
|