@morphllm/morphsdk 0.2.154 → 0.2.156
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-4R6F66B7.js → chunk-3ZO5CVTX.js} +2 -2
- package/dist/{chunk-ZHKANLAQ.js → chunk-4PBF6VGZ.js} +6 -6
- package/dist/chunk-4PBF6VGZ.js.map +1 -0
- package/dist/{chunk-A6T6E636.js → chunk-5GGCKVRH.js} +2 -2
- package/dist/{chunk-VK76R3IN.js → chunk-6XM5TBIT.js} +2 -2
- package/dist/{chunk-2WAHX6I2.js → chunk-743P6D7J.js} +2 -2
- package/dist/{chunk-P57SFOLD.js → chunk-7RFUBE4P.js} +2 -2
- package/dist/{chunk-FOKMTUWC.js → chunk-BC4S5XJW.js} +2 -2
- package/dist/{chunk-TAGDMT3K.js → chunk-BMDFQ2BE.js} +2 -2
- package/dist/{chunk-5IKDEESU.js → chunk-DSFA7SJ5.js} +3 -3
- package/dist/{chunk-Q77CT3RI.js → chunk-EM6MIZ3K.js} +2 -2
- package/dist/{chunk-J43SJUCO.js → chunk-FFH6M54A.js} +3 -2
- package/dist/{chunk-J43SJUCO.js.map → chunk-FFH6M54A.js.map} +1 -1
- package/dist/{chunk-LK4C3NYX.js → chunk-GFHUTZHM.js} +2 -2
- package/dist/{chunk-3XO33KPS.js → chunk-GYMTY3D7.js} +2 -2
- package/dist/{chunk-3XO33KPS.js.map → chunk-GYMTY3D7.js.map} +1 -1
- package/dist/{chunk-D5UUKDKL.js → chunk-HD3A6TOA.js} +6 -6
- package/dist/chunk-HD3A6TOA.js.map +1 -0
- package/dist/{chunk-N4KLUOXK.js → chunk-HZBDQQ2Z.js} +2 -2
- package/dist/{chunk-UDI5U6QV.js → chunk-L7LQEC44.js} +2 -2
- package/dist/{chunk-QSATHLZJ.js → chunk-NYE3YVAN.js} +4 -3
- package/dist/{chunk-QSATHLZJ.js.map → chunk-NYE3YVAN.js.map} +1 -1
- package/dist/{chunk-MTRH7FMN.js → chunk-SQCU6VGN.js} +2 -2
- package/dist/{chunk-WQU6QXSU.js → chunk-TIX35I4U.js} +2 -2
- package/dist/{chunk-PRHEWGWC.js → chunk-ULQTARZU.js} +17 -17
- package/dist/{chunk-KRRO7FF2.js → chunk-UYKCUVY2.js} +2 -2
- package/dist/{chunk-ZSA3NL5T.js → chunk-XJE5S5QO.js} +2 -2
- package/dist/{chunk-Y5O3A7SU.js → chunk-YFWWVZKP.js} +2 -2
- package/dist/{chunk-3BTUUH23.js → chunk-Z65R2COW.js} +8 -8
- package/dist/chunk-Z65R2COW.js.map +1 -0
- package/dist/{chunk-YKBVE3CE.js → chunk-ZOENCBBC.js} +2 -2
- package/dist/{client-BcO_qte8.d.ts → client-PkB7g9SA.d.ts} +1 -1
- package/dist/client.cjs +19 -17
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +22 -22
- package/dist/edge.cjs +3 -2
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.js +4 -4
- package/dist/index.cjs +19 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -22
- package/dist/modelrouter/core.cjs +1 -1
- package/dist/modelrouter/core.cjs.map +1 -1
- package/dist/modelrouter/core.js +3 -3
- package/dist/modelrouter/index.cjs +1 -1
- package/dist/modelrouter/index.cjs.map +1 -1
- package/dist/modelrouter/index.js +3 -3
- package/dist/subagents/anthropic.cjs +1 -1
- package/dist/subagents/anthropic.cjs.map +1 -1
- package/dist/subagents/anthropic.js +4 -4
- package/dist/subagents/vercel.cjs +1 -1
- package/dist/subagents/vercel.cjs.map +1 -1
- package/dist/subagents/vercel.js +4 -4
- package/dist/tools/browser/anthropic.cjs +1 -1
- package/dist/tools/browser/anthropic.cjs.map +1 -1
- package/dist/tools/browser/anthropic.js +5 -5
- package/dist/tools/browser/core.cjs +1 -1
- package/dist/tools/browser/core.cjs.map +1 -1
- package/dist/tools/browser/core.js +4 -4
- package/dist/tools/browser/index.cjs +1 -1
- package/dist/tools/browser/index.cjs.map +1 -1
- package/dist/tools/browser/index.js +7 -7
- package/dist/tools/browser/openai.cjs +1 -1
- package/dist/tools/browser/openai.cjs.map +1 -1
- package/dist/tools/browser/openai.js +5 -5
- package/dist/tools/browser/profiles/core.cjs +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/tools/browser/vercel.cjs.map +1 -1
- package/dist/tools/browser/vercel.js +5 -5
- package/dist/tools/codebase_search/anthropic.cjs +1 -1
- package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
- package/dist/tools/codebase_search/anthropic.js +4 -4
- package/dist/tools/codebase_search/core.cjs +1 -1
- package/dist/tools/codebase_search/core.cjs.map +1 -1
- package/dist/tools/codebase_search/core.js +3 -3
- package/dist/tools/codebase_search/index.cjs +1 -1
- package/dist/tools/codebase_search/index.cjs.map +1 -1
- package/dist/tools/codebase_search/index.js +6 -6
- package/dist/tools/codebase_search/openai.cjs +1 -1
- package/dist/tools/codebase_search/openai.cjs.map +1 -1
- package/dist/tools/codebase_search/openai.js +4 -4
- package/dist/tools/codebase_search/vercel.cjs +1 -1
- package/dist/tools/codebase_search/vercel.cjs.map +1 -1
- package/dist/tools/codebase_search/vercel.js +4 -4
- package/dist/tools/fastapply/anthropic.cjs +9 -7
- package/dist/tools/fastapply/anthropic.cjs.map +1 -1
- package/dist/tools/fastapply/anthropic.js +4 -4
- package/dist/tools/fastapply/apply.cjs +3 -2
- package/dist/tools/fastapply/apply.cjs.map +1 -1
- package/dist/tools/fastapply/apply.js +2 -2
- package/dist/tools/fastapply/core.cjs +5 -3
- package/dist/tools/fastapply/core.cjs.map +1 -1
- package/dist/tools/fastapply/core.js +3 -3
- package/dist/tools/fastapply/index.cjs +19 -17
- package/dist/tools/fastapply/index.cjs.map +1 -1
- package/dist/tools/fastapply/index.d.ts +1 -1
- package/dist/tools/fastapply/index.js +6 -6
- package/dist/tools/fastapply/openai.cjs +9 -7
- package/dist/tools/fastapply/openai.cjs.map +1 -1
- package/dist/tools/fastapply/openai.js +4 -4
- package/dist/tools/fastapply/types.cjs.map +1 -1
- package/dist/tools/fastapply/types.d.ts +6 -2
- package/dist/tools/fastapply/vercel.cjs +11 -9
- package/dist/tools/fastapply/vercel.cjs.map +1 -1
- package/dist/tools/fastapply/vercel.d.ts +1 -1
- package/dist/tools/fastapply/vercel.js +4 -4
- package/dist/tools/index.cjs +19 -17
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +6 -6
- package/dist/tools/utils/resilience.cjs +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
- package/dist/tools/warp_grep/anthropic.js +4 -4
- package/dist/tools/warp_grep/client.cjs +1 -1
- package/dist/tools/warp_grep/client.cjs.map +1 -1
- package/dist/tools/warp_grep/client.js +3 -3
- package/dist/tools/warp_grep/gemini.cjs +1 -1
- package/dist/tools/warp_grep/gemini.cjs.map +1 -1
- package/dist/tools/warp_grep/gemini.js +3 -3
- package/dist/tools/warp_grep/index.cjs +1 -1
- package/dist/tools/warp_grep/index.cjs.map +1 -1
- package/dist/tools/warp_grep/index.js +3 -3
- package/dist/tools/warp_grep/openai.cjs +1 -1
- package/dist/tools/warp_grep/openai.cjs.map +1 -1
- package/dist/tools/warp_grep/openai.js +4 -4
- package/dist/tools/warp_grep/vercel.cjs +1 -1
- package/dist/tools/warp_grep/vercel.cjs.map +1 -1
- package/dist/tools/warp_grep/vercel.js +4 -4
- package/dist/{vercel-B1GZ_g9N.d.ts → vercel-Cg38kNm4.d.ts} +2 -2
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3BTUUH23.js.map +0 -1
- package/dist/chunk-D5UUKDKL.js.map +0 -1
- package/dist/chunk-ZHKANLAQ.js.map +0 -1
- /package/dist/{chunk-4R6F66B7.js.map → chunk-3ZO5CVTX.js.map} +0 -0
- /package/dist/{chunk-A6T6E636.js.map → chunk-5GGCKVRH.js.map} +0 -0
- /package/dist/{chunk-VK76R3IN.js.map → chunk-6XM5TBIT.js.map} +0 -0
- /package/dist/{chunk-2WAHX6I2.js.map → chunk-743P6D7J.js.map} +0 -0
- /package/dist/{chunk-P57SFOLD.js.map → chunk-7RFUBE4P.js.map} +0 -0
- /package/dist/{chunk-FOKMTUWC.js.map → chunk-BC4S5XJW.js.map} +0 -0
- /package/dist/{chunk-TAGDMT3K.js.map → chunk-BMDFQ2BE.js.map} +0 -0
- /package/dist/{chunk-5IKDEESU.js.map → chunk-DSFA7SJ5.js.map} +0 -0
- /package/dist/{chunk-Q77CT3RI.js.map → chunk-EM6MIZ3K.js.map} +0 -0
- /package/dist/{chunk-LK4C3NYX.js.map → chunk-GFHUTZHM.js.map} +0 -0
- /package/dist/{chunk-N4KLUOXK.js.map → chunk-HZBDQQ2Z.js.map} +0 -0
- /package/dist/{chunk-UDI5U6QV.js.map → chunk-L7LQEC44.js.map} +0 -0
- /package/dist/{chunk-MTRH7FMN.js.map → chunk-SQCU6VGN.js.map} +0 -0
- /package/dist/{chunk-WQU6QXSU.js.map → chunk-TIX35I4U.js.map} +0 -0
- /package/dist/{chunk-PRHEWGWC.js.map → chunk-ULQTARZU.js.map} +0 -0
- /package/dist/{chunk-KRRO7FF2.js.map → chunk-UYKCUVY2.js.map} +0 -0
- /package/dist/{chunk-ZSA3NL5T.js.map → chunk-XJE5S5QO.js.map} +0 -0
- /package/dist/{chunk-Y5O3A7SU.js.map → chunk-YFWWVZKP.js.map} +0 -0
- /package/dist/{chunk-YKBVE3CE.js.map → chunk-ZOENCBBC.js.map} +0 -0
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createGitHubSearchTool,
|
|
3
3
|
createWarpGrepTool
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BMDFQ2BE.js";
|
|
5
5
|
import {
|
|
6
6
|
createGitHubSearchTool as createGitHubSearchTool3,
|
|
7
7
|
createWarpGrepTool as createWarpGrepTool3
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5GGCKVRH.js";
|
|
9
9
|
import {
|
|
10
10
|
createGitHubSearchTool as createGitHubSearchTool2,
|
|
11
11
|
createWarpGrepTool as createWarpGrepTool2
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EM6MIZ3K.js";
|
|
13
13
|
import {
|
|
14
14
|
createCodebaseSearchTool as createCodebaseSearchTool3
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SQCU6VGN.js";
|
|
16
16
|
import {
|
|
17
17
|
createCodebaseSearchTool as createCodebaseSearchTool2
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7RFUBE4P.js";
|
|
19
19
|
import {
|
|
20
20
|
createCodebaseSearchTool
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HZBDQQ2Z.js";
|
|
22
22
|
import {
|
|
23
23
|
CodebaseSearchClient
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3ZO5CVTX.js";
|
|
25
25
|
import {
|
|
26
26
|
createEditFileTool
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4PBF6VGZ.js";
|
|
28
28
|
import {
|
|
29
29
|
createEditFileTool as createEditFileTool3
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-Z65R2COW.js";
|
|
31
31
|
import {
|
|
32
32
|
createEditFileTool as createEditFileTool2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-HD3A6TOA.js";
|
|
34
34
|
import {
|
|
35
35
|
FastApplyClient
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-FFH6M54A.js";
|
|
37
37
|
import {
|
|
38
38
|
BrowserClient
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-DSFA7SJ5.js";
|
|
40
40
|
import {
|
|
41
41
|
createExploreSubagent
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-L7LQEC44.js";
|
|
43
43
|
import {
|
|
44
44
|
createExploreSubagent as createExploreSubagent2
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-GFHUTZHM.js";
|
|
46
46
|
import {
|
|
47
47
|
WarpGrepClient
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-TIX35I4U.js";
|
|
49
49
|
import {
|
|
50
50
|
AnthropicRouter,
|
|
51
51
|
GeminiRouter,
|
|
52
52
|
OpenAIRouter,
|
|
53
53
|
RawRouter
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-743P6D7J.js";
|
|
55
55
|
import {
|
|
56
56
|
CompactClient
|
|
57
57
|
} from "./chunk-SCVWDNQP.js";
|
|
@@ -724,4 +724,4 @@ export {
|
|
|
724
724
|
VercelToolFactory,
|
|
725
725
|
MorphClient
|
|
726
726
|
};
|
|
727
|
-
//# sourceMappingURL=chunk-
|
|
727
|
+
//# sourceMappingURL=chunk-ULQTARZU.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-2HMEZZKK.js";
|
|
5
5
|
import {
|
|
6
6
|
executeBrowserTask
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DSFA7SJ5.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
createBrowserTool,
|
|
94
94
|
openai_exports
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-UYKCUVY2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SDK_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GYMTY3D7.js";
|
|
4
4
|
|
|
5
5
|
// tools/utils/resilience.ts
|
|
6
6
|
var DEFAULT_RETRY_CONFIG = {
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
withTimeout,
|
|
92
92
|
MorphError
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-XJE5S5QO.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2HMEZZKK.js";
|
|
4
4
|
import {
|
|
5
5
|
executeBrowserTask
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DSFA7SJ5.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
9
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
browserTool,
|
|
55
55
|
vercel_exports
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-YFWWVZKP.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-63WE2C5R.js";
|
|
5
5
|
import {
|
|
6
6
|
executeEditFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FFH6M54A.js";
|
|
8
8
|
import {
|
|
9
9
|
__export
|
|
10
10
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -21,8 +21,8 @@ import { tool } from "ai";
|
|
|
21
21
|
import { z } from "zod";
|
|
22
22
|
var editFileSchema = z.object({
|
|
23
23
|
target_filepath: z.string().describe("The path of the target file to modify"),
|
|
24
|
-
|
|
25
|
-
code_edit: z.string().describe("
|
|
24
|
+
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."),
|
|
25
|
+
code_edit: z.string().describe("Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections.")
|
|
26
26
|
});
|
|
27
27
|
var editFileTool = tool({
|
|
28
28
|
description: EDIT_FILE_TOOL_DESCRIPTION,
|
|
@@ -30,7 +30,7 @@ var editFileTool = tool({
|
|
|
30
30
|
execute: async (params) => {
|
|
31
31
|
const result = await executeEditFile({
|
|
32
32
|
target_filepath: params.target_filepath,
|
|
33
|
-
|
|
33
|
+
instruction: params.instruction,
|
|
34
34
|
code_edit: params.code_edit
|
|
35
35
|
});
|
|
36
36
|
if (!result.success) {
|
|
@@ -50,8 +50,8 @@ function getSystemPrompt() {
|
|
|
50
50
|
function createEditFileTool(config = {}) {
|
|
51
51
|
const schema = z.object({
|
|
52
52
|
target_filepath: z.string().describe("The path of the target file to modify"),
|
|
53
|
-
|
|
54
|
-
code_edit: z.string().describe("
|
|
53
|
+
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."),
|
|
54
|
+
code_edit: z.string().describe("Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections.")
|
|
55
55
|
});
|
|
56
56
|
return tool({
|
|
57
57
|
description: config.description || EDIT_FILE_TOOL_DESCRIPTION,
|
|
@@ -60,7 +60,7 @@ function createEditFileTool(config = {}) {
|
|
|
60
60
|
const result = await executeEditFile(
|
|
61
61
|
{
|
|
62
62
|
target_filepath: params.target_filepath,
|
|
63
|
-
|
|
63
|
+
instruction: params.instruction,
|
|
64
64
|
code_edit: params.code_edit
|
|
65
65
|
},
|
|
66
66
|
config
|
|
@@ -86,4 +86,4 @@ export {
|
|
|
86
86
|
vercel_default,
|
|
87
87
|
vercel_exports
|
|
88
88
|
};
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-Z65R2COW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../tools/fastapply/vercel.ts"],"sourcesContent":["/**\n * Vercel AI SDK adapter for edit_file tool\n */\n\nimport { tool } from 'ai';\nimport { z } from 'zod';\nimport { executeEditFile } from './core.js';\nimport { EDIT_FILE_TOOL_DESCRIPTION, EDIT_FILE_SYSTEM_PROMPT } from './prompts.js';\nimport type { EditFileConfig } from './types.js';\n\n/**\n * Vercel AI SDK tool for edit_file\n * \n * @example\n * ```ts\n * import { generateText } from 'ai';\n * import { anthropic } from '@ai-sdk/anthropic';\n * import { editFileTool } from 'morphsdk/tools/vercel';\n * \n * const result = await generateText({\n * model: anthropic('claude-sonnet-4-5-20250929'),\n * tools: { editFile: editFileTool },\n * prompt: \"Fix the bug in app.ts\"\n * });\n * ```\n */\nconst editFileSchema = z.object({\n target_filepath: z.string().describe('The path of the target file to modify'),\n instruction: z\n .string()\n .describe('A single sentence written in the first person describing what the agent is changing. Used to help disambiguate uncertainty in the edit.'),\n code_edit: z\n .string()\n .describe('Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections.'),\n});\n\nexport const editFileTool = tool({\n description: EDIT_FILE_TOOL_DESCRIPTION,\n inputSchema: editFileSchema,\n execute: async (params) => {\n const result = await executeEditFile({\n target_filepath: params.target_filepath,\n instruction: params.instruction,\n code_edit: params.code_edit,\n });\n \n if (!result.success) {\n throw new Error(`Failed to edit file: ${result.error}`);\n }\n \n return {\n success: true,\n filepath: result.filepath,\n changes: result.changes,\n udiff: result.udiff,\n };\n },\n});\n\n/**\n * Get the system prompt for edit_file usage\n * \n * Add this to your system message to guide the model on using edit_file properly.\n * \n * @example\n * ```ts\n * const result = await generateText({\n * model: anthropic('claude-sonnet-4-5-20250929'),\n * system: getSystemPrompt(),\n * tools: { editFile: editFileTool },\n * prompt: \"Fix bugs\"\n * });\n * ```\n */\nexport function getSystemPrompt(): string {\n return EDIT_FILE_SYSTEM_PROMPT;\n}\n\n/**\n * Create a custom edit_file tool with configuration\n * \n * @param config - Configuration options\n * @returns Vercel AI SDK tool with custom config\n * \n * @example\n * ```ts\n * const customEditTool = createEditFileTool({\n * baseDir: './src',\n * generateUdiff: true,\n * description: 'Custom tool description for your use case'\n * });\n * \n * const result = await generateText({\n * model: anthropic('claude-sonnet-4-5-20250929'),\n * tools: { editFile: customEditTool },\n * prompt: \"Fix bugs\"\n * });\n * ```\n */\nexport function createEditFileTool(config: EditFileConfig = {}) {\n const schema = z.object({\n target_filepath: z.string().describe('The path of the target file to modify'),\n instruction: z\n .string()\n .describe('A single sentence written in the first person describing what the agent is changing. Used to help disambiguate uncertainty in the edit.'),\n code_edit: z\n .string()\n .describe('Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections.'),\n });\n\n return tool({\n description: config.description || EDIT_FILE_TOOL_DESCRIPTION,\n inputSchema: schema,\n execute: async (params) => {\n const result = await executeEditFile(\n {\n target_filepath: params.target_filepath,\n instruction: params.instruction,\n code_edit: params.code_edit,\n },\n config\n );\n \n if (!result.success) {\n throw new Error(`Failed to edit file: ${result.error}`);\n }\n \n return {\n success: true,\n filepath: result.filepath,\n changes: result.changes,\n udiff: result.udiff,\n };\n },\n });\n}\n\n// Default export for convenience\nexport default editFileTool;\n\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAS,YAAY;AACrB,SAAS,SAAS;AAqBlB,IAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,iBAAiB,EAAE,OAAO,EAAE,SAAS,uCAAuC;AAAA,EAC5E,aAAa,EACV,OAAO,EACP,SAAS,yIAAyI;AAAA,EACrJ,WAAW,EACR,OAAO,EACP,SAAS,sHAAsH;AACpI,CAAC;AAEM,IAAM,eAAe,KAAK;AAAA,EAC/B,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS,OAAO,WAAW;AACzB,UAAM,SAAS,MAAM,gBAAgB;AAAA,MACnC,iBAAiB,OAAO;AAAA,MACxB,aAAa,OAAO;AAAA,MACpB,WAAW,OAAO;AAAA,IACpB,CAAC;AAED,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,IAAI,MAAM,wBAAwB,OAAO,KAAK,EAAE;AAAA,IACxD;AAEA,WAAO;AAAA,MACL,SAAS;AAAA,MACT,UAAU,OAAO;AAAA,MACjB,SAAS,OAAO;AAAA,MAChB,OAAO,OAAO;AAAA,IAChB;AAAA,EACF;AACF,CAAC;AAiBM,SAAS,kBAA0B;AACxC,SAAO;AACT;AAuBO,SAAS,mBAAmB,SAAyB,CAAC,GAAG;AAC9D,QAAM,SAAS,EAAE,OAAO;AAAA,IACtB,iBAAiB,EAAE,OAAO,EAAE,SAAS,uCAAuC;AAAA,IAC5E,aAAa,EACV,OAAO,EACP,SAAS,yIAAyI;AAAA,IACrJ,WAAW,EACR,OAAO,EACP,SAAS,sHAAsH;AAAA,EACpI,CAAC;AAED,SAAO,KAAK;AAAA,IACV,aAAa,OAAO,eAAe;AAAA,IACnC,aAAa;AAAA,IACb,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM;AAAA,QACnB;AAAA,UACE,iBAAiB,OAAO;AAAA,UACxB,aAAa,OAAO;AAAA,UACpB,WAAW,OAAO;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAEA,UAAI,CAAC,OAAO,SAAS;AACnB,cAAM,IAAI,MAAM,wBAAwB,OAAO,KAAK,EAAE;AAAA,MACxD;AAEA,aAAO;AAAA,QACL,SAAS;AAAA,QACT,UAAU,OAAO;AAAA,QACjB,SAAS,OAAO;AAAA,QAChB,OAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAGA,IAAO,iBAAQ;","names":[]}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-I3J46TSB.js";
|
|
21
21
|
import {
|
|
22
22
|
SDK_VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GYMTY3D7.js";
|
|
24
24
|
|
|
25
25
|
// tools/warp_grep/agent/runner.ts
|
|
26
26
|
import OpenAI from "openai";
|
|
@@ -398,4 +398,4 @@ export {
|
|
|
398
398
|
runWarpGrepStreaming,
|
|
399
399
|
runWarpGrep
|
|
400
400
|
};
|
|
401
|
-
//# sourceMappingURL=chunk-
|
|
401
|
+
//# sourceMappingURL=chunk-ZOENCBBC.js.map
|
|
@@ -851,7 +851,7 @@ declare class VercelToolFactory {
|
|
|
851
851
|
*/
|
|
852
852
|
createEditFileTool(toolConfig?: Omit<EditFileConfig, 'morphApiKey'>): ai.Tool<{
|
|
853
853
|
target_filepath: string;
|
|
854
|
-
|
|
854
|
+
instruction: string;
|
|
855
855
|
code_edit: string;
|
|
856
856
|
}, {
|
|
857
857
|
success: boolean;
|
package/dist/client.cjs
CHANGED
|
@@ -36,7 +36,7 @@ var init_package = __esm({
|
|
|
36
36
|
"package.json"() {
|
|
37
37
|
package_default = {
|
|
38
38
|
name: "@morphllm/morphsdk",
|
|
39
|
-
version: "0.2.
|
|
39
|
+
version: "0.2.156",
|
|
40
40
|
description: "TypeScript SDK and CLI for Morph Fast Apply integration",
|
|
41
41
|
type: "module",
|
|
42
42
|
main: "./dist/index.cjs",
|
|
@@ -367,10 +367,11 @@ async function applyEdit(input, config = {}) {
|
|
|
367
367
|
if (debug) {
|
|
368
368
|
console.log(`[FastApply] Applying edit to code (${input.originalCode.length} chars)`);
|
|
369
369
|
}
|
|
370
|
+
const instruction = input.instruction ?? input.instructions ?? "";
|
|
370
371
|
const { content: mergedCode, completionId } = await callMorphAPI(
|
|
371
372
|
input.originalCode,
|
|
372
373
|
input.codeEdit,
|
|
373
|
-
|
|
374
|
+
instruction,
|
|
374
375
|
filepath,
|
|
375
376
|
config
|
|
376
377
|
);
|
|
@@ -1084,7 +1085,8 @@ async function executeEditFile(input, config = {}) {
|
|
|
1084
1085
|
}
|
|
1085
1086
|
if (debug) console.log(`[FastApply] File doesn't exist, will create new file`);
|
|
1086
1087
|
}
|
|
1087
|
-
const
|
|
1088
|
+
const instruction = input.instruction ?? input.instructions ?? "";
|
|
1089
|
+
const { content: mergedCode, completionId } = await callMorphAPI2(originalCode, input.code_edit, instruction, input.target_filepath, config);
|
|
1088
1090
|
const udiff = config.generateUdiff !== false ? generateUdiff2(originalCode, mergedCode, input.target_filepath) : void 0;
|
|
1089
1091
|
if (config.autoWrite !== false) {
|
|
1090
1092
|
await writeFile(fullPath, mergedCode, "utf-8");
|
|
@@ -5153,16 +5155,16 @@ var editFileTool = {
|
|
|
5153
5155
|
type: "string",
|
|
5154
5156
|
description: "The path of the target file to modify"
|
|
5155
5157
|
},
|
|
5156
|
-
|
|
5158
|
+
instruction: {
|
|
5157
5159
|
type: "string",
|
|
5158
|
-
description: "A single sentence describing what
|
|
5160
|
+
description: "A single sentence written in the first person describing what the agent is changing. Used to help disambiguate uncertainty in the edit."
|
|
5159
5161
|
},
|
|
5160
5162
|
code_edit: {
|
|
5161
5163
|
type: "string",
|
|
5162
|
-
description: "
|
|
5164
|
+
description: "Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections."
|
|
5163
5165
|
}
|
|
5164
5166
|
},
|
|
5165
|
-
required: ["target_filepath", "
|
|
5167
|
+
required: ["target_filepath", "instruction", "code_edit"]
|
|
5166
5168
|
}
|
|
5167
5169
|
}
|
|
5168
5170
|
};
|
|
@@ -5384,16 +5386,16 @@ var editFileTool2 = {
|
|
|
5384
5386
|
type: "string",
|
|
5385
5387
|
description: "The path of the target file to modify"
|
|
5386
5388
|
},
|
|
5387
|
-
|
|
5389
|
+
instruction: {
|
|
5388
5390
|
type: "string",
|
|
5389
|
-
description: "A single sentence describing what
|
|
5391
|
+
description: "A single sentence written in the first person describing what the agent is changing. Used to help disambiguate uncertainty in the edit."
|
|
5390
5392
|
},
|
|
5391
5393
|
code_edit: {
|
|
5392
5394
|
type: "string",
|
|
5393
|
-
description: "
|
|
5395
|
+
description: "Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections."
|
|
5394
5396
|
}
|
|
5395
5397
|
},
|
|
5396
|
-
required: ["target_filepath", "
|
|
5398
|
+
required: ["target_filepath", "instruction", "code_edit"]
|
|
5397
5399
|
}
|
|
5398
5400
|
};
|
|
5399
5401
|
function formatResult5(result) {
|
|
@@ -5938,8 +5940,8 @@ var import_ai3 = require("ai");
|
|
|
5938
5940
|
var import_zod3 = require("zod");
|
|
5939
5941
|
var editFileSchema = import_zod3.z.object({
|
|
5940
5942
|
target_filepath: import_zod3.z.string().describe("The path of the target file to modify"),
|
|
5941
|
-
|
|
5942
|
-
code_edit: import_zod3.z.string().describe("
|
|
5943
|
+
instruction: import_zod3.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."),
|
|
5944
|
+
code_edit: import_zod3.z.string().describe("Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections.")
|
|
5943
5945
|
});
|
|
5944
5946
|
var editFileTool3 = (0, import_ai3.tool)({
|
|
5945
5947
|
description: EDIT_FILE_TOOL_DESCRIPTION,
|
|
@@ -5947,7 +5949,7 @@ var editFileTool3 = (0, import_ai3.tool)({
|
|
|
5947
5949
|
execute: async (params) => {
|
|
5948
5950
|
const result = await executeEditFile({
|
|
5949
5951
|
target_filepath: params.target_filepath,
|
|
5950
|
-
|
|
5952
|
+
instruction: params.instruction,
|
|
5951
5953
|
code_edit: params.code_edit
|
|
5952
5954
|
});
|
|
5953
5955
|
if (!result.success) {
|
|
@@ -5964,8 +5966,8 @@ var editFileTool3 = (0, import_ai3.tool)({
|
|
|
5964
5966
|
function createEditFileTool3(config = {}) {
|
|
5965
5967
|
const schema = import_zod3.z.object({
|
|
5966
5968
|
target_filepath: import_zod3.z.string().describe("The path of the target file to modify"),
|
|
5967
|
-
|
|
5968
|
-
code_edit: import_zod3.z.string().describe("
|
|
5969
|
+
instruction: import_zod3.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."),
|
|
5970
|
+
code_edit: import_zod3.z.string().describe("Specify ONLY the precise lines of code that you wish to edit. Use `// ... existing code ...` for unchanged sections.")
|
|
5969
5971
|
});
|
|
5970
5972
|
return (0, import_ai3.tool)({
|
|
5971
5973
|
description: config.description || EDIT_FILE_TOOL_DESCRIPTION,
|
|
@@ -5974,7 +5976,7 @@ function createEditFileTool3(config = {}) {
|
|
|
5974
5976
|
const result = await executeEditFile(
|
|
5975
5977
|
{
|
|
5976
5978
|
target_filepath: params.target_filepath,
|
|
5977
|
-
|
|
5979
|
+
instruction: params.instruction,
|
|
5978
5980
|
code_edit: params.code_edit
|
|
5979
5981
|
},
|
|
5980
5982
|
config
|