@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.
Files changed (168) hide show
  1. package/dist/{chunk-4R6F66B7.js → chunk-3ZO5CVTX.js} +2 -2
  2. package/dist/{chunk-ZHKANLAQ.js → chunk-4PBF6VGZ.js} +6 -6
  3. package/dist/chunk-4PBF6VGZ.js.map +1 -0
  4. package/dist/{chunk-A6T6E636.js → chunk-5GGCKVRH.js} +2 -2
  5. package/dist/{chunk-VK76R3IN.js → chunk-6XM5TBIT.js} +2 -2
  6. package/dist/{chunk-2WAHX6I2.js → chunk-743P6D7J.js} +2 -2
  7. package/dist/{chunk-P57SFOLD.js → chunk-7RFUBE4P.js} +2 -2
  8. package/dist/{chunk-FOKMTUWC.js → chunk-BC4S5XJW.js} +2 -2
  9. package/dist/{chunk-TAGDMT3K.js → chunk-BMDFQ2BE.js} +2 -2
  10. package/dist/{chunk-5IKDEESU.js → chunk-DSFA7SJ5.js} +3 -3
  11. package/dist/{chunk-Q77CT3RI.js → chunk-EM6MIZ3K.js} +2 -2
  12. package/dist/{chunk-J43SJUCO.js → chunk-FFH6M54A.js} +3 -2
  13. package/dist/{chunk-J43SJUCO.js.map → chunk-FFH6M54A.js.map} +1 -1
  14. package/dist/{chunk-LK4C3NYX.js → chunk-GFHUTZHM.js} +2 -2
  15. package/dist/{chunk-3XO33KPS.js → chunk-GYMTY3D7.js} +2 -2
  16. package/dist/{chunk-3XO33KPS.js.map → chunk-GYMTY3D7.js.map} +1 -1
  17. package/dist/{chunk-D5UUKDKL.js → chunk-HD3A6TOA.js} +6 -6
  18. package/dist/chunk-HD3A6TOA.js.map +1 -0
  19. package/dist/{chunk-N4KLUOXK.js → chunk-HZBDQQ2Z.js} +2 -2
  20. package/dist/{chunk-UDI5U6QV.js → chunk-L7LQEC44.js} +2 -2
  21. package/dist/{chunk-QSATHLZJ.js → chunk-NYE3YVAN.js} +4 -3
  22. package/dist/{chunk-QSATHLZJ.js.map → chunk-NYE3YVAN.js.map} +1 -1
  23. package/dist/{chunk-MTRH7FMN.js → chunk-SQCU6VGN.js} +2 -2
  24. package/dist/{chunk-WQU6QXSU.js → chunk-TIX35I4U.js} +2 -2
  25. package/dist/{chunk-PRHEWGWC.js → chunk-ULQTARZU.js} +17 -17
  26. package/dist/{chunk-KRRO7FF2.js → chunk-UYKCUVY2.js} +2 -2
  27. package/dist/{chunk-ZSA3NL5T.js → chunk-XJE5S5QO.js} +2 -2
  28. package/dist/{chunk-Y5O3A7SU.js → chunk-YFWWVZKP.js} +2 -2
  29. package/dist/{chunk-3BTUUH23.js → chunk-Z65R2COW.js} +8 -8
  30. package/dist/chunk-Z65R2COW.js.map +1 -0
  31. package/dist/{chunk-YKBVE3CE.js → chunk-ZOENCBBC.js} +2 -2
  32. package/dist/{client-BcO_qte8.d.ts → client-PkB7g9SA.d.ts} +1 -1
  33. package/dist/client.cjs +19 -17
  34. package/dist/client.cjs.map +1 -1
  35. package/dist/client.d.ts +1 -1
  36. package/dist/client.js +22 -22
  37. package/dist/edge.cjs +3 -2
  38. package/dist/edge.cjs.map +1 -1
  39. package/dist/edge.js +4 -4
  40. package/dist/index.cjs +19 -17
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.ts +1 -1
  43. package/dist/index.js +22 -22
  44. package/dist/modelrouter/core.cjs +1 -1
  45. package/dist/modelrouter/core.cjs.map +1 -1
  46. package/dist/modelrouter/core.js +3 -3
  47. package/dist/modelrouter/index.cjs +1 -1
  48. package/dist/modelrouter/index.cjs.map +1 -1
  49. package/dist/modelrouter/index.js +3 -3
  50. package/dist/subagents/anthropic.cjs +1 -1
  51. package/dist/subagents/anthropic.cjs.map +1 -1
  52. package/dist/subagents/anthropic.js +4 -4
  53. package/dist/subagents/vercel.cjs +1 -1
  54. package/dist/subagents/vercel.cjs.map +1 -1
  55. package/dist/subagents/vercel.js +4 -4
  56. package/dist/tools/browser/anthropic.cjs +1 -1
  57. package/dist/tools/browser/anthropic.cjs.map +1 -1
  58. package/dist/tools/browser/anthropic.js +5 -5
  59. package/dist/tools/browser/core.cjs +1 -1
  60. package/dist/tools/browser/core.cjs.map +1 -1
  61. package/dist/tools/browser/core.js +4 -4
  62. package/dist/tools/browser/index.cjs +1 -1
  63. package/dist/tools/browser/index.cjs.map +1 -1
  64. package/dist/tools/browser/index.js +7 -7
  65. package/dist/tools/browser/openai.cjs +1 -1
  66. package/dist/tools/browser/openai.cjs.map +1 -1
  67. package/dist/tools/browser/openai.js +5 -5
  68. package/dist/tools/browser/profiles/core.cjs +1 -1
  69. package/dist/tools/browser/profiles/core.cjs.map +1 -1
  70. package/dist/tools/browser/profiles/core.js +3 -3
  71. package/dist/tools/browser/profiles/index.cjs +1 -1
  72. package/dist/tools/browser/profiles/index.cjs.map +1 -1
  73. package/dist/tools/browser/profiles/index.js +3 -3
  74. package/dist/tools/browser/vercel.cjs +1 -1
  75. package/dist/tools/browser/vercel.cjs.map +1 -1
  76. package/dist/tools/browser/vercel.js +5 -5
  77. package/dist/tools/codebase_search/anthropic.cjs +1 -1
  78. package/dist/tools/codebase_search/anthropic.cjs.map +1 -1
  79. package/dist/tools/codebase_search/anthropic.js +4 -4
  80. package/dist/tools/codebase_search/core.cjs +1 -1
  81. package/dist/tools/codebase_search/core.cjs.map +1 -1
  82. package/dist/tools/codebase_search/core.js +3 -3
  83. package/dist/tools/codebase_search/index.cjs +1 -1
  84. package/dist/tools/codebase_search/index.cjs.map +1 -1
  85. package/dist/tools/codebase_search/index.js +6 -6
  86. package/dist/tools/codebase_search/openai.cjs +1 -1
  87. package/dist/tools/codebase_search/openai.cjs.map +1 -1
  88. package/dist/tools/codebase_search/openai.js +4 -4
  89. package/dist/tools/codebase_search/vercel.cjs +1 -1
  90. package/dist/tools/codebase_search/vercel.cjs.map +1 -1
  91. package/dist/tools/codebase_search/vercel.js +4 -4
  92. package/dist/tools/fastapply/anthropic.cjs +9 -7
  93. package/dist/tools/fastapply/anthropic.cjs.map +1 -1
  94. package/dist/tools/fastapply/anthropic.js +4 -4
  95. package/dist/tools/fastapply/apply.cjs +3 -2
  96. package/dist/tools/fastapply/apply.cjs.map +1 -1
  97. package/dist/tools/fastapply/apply.js +2 -2
  98. package/dist/tools/fastapply/core.cjs +5 -3
  99. package/dist/tools/fastapply/core.cjs.map +1 -1
  100. package/dist/tools/fastapply/core.js +3 -3
  101. package/dist/tools/fastapply/index.cjs +19 -17
  102. package/dist/tools/fastapply/index.cjs.map +1 -1
  103. package/dist/tools/fastapply/index.d.ts +1 -1
  104. package/dist/tools/fastapply/index.js +6 -6
  105. package/dist/tools/fastapply/openai.cjs +9 -7
  106. package/dist/tools/fastapply/openai.cjs.map +1 -1
  107. package/dist/tools/fastapply/openai.js +4 -4
  108. package/dist/tools/fastapply/types.cjs.map +1 -1
  109. package/dist/tools/fastapply/types.d.ts +6 -2
  110. package/dist/tools/fastapply/vercel.cjs +11 -9
  111. package/dist/tools/fastapply/vercel.cjs.map +1 -1
  112. package/dist/tools/fastapply/vercel.d.ts +1 -1
  113. package/dist/tools/fastapply/vercel.js +4 -4
  114. package/dist/tools/index.cjs +19 -17
  115. package/dist/tools/index.cjs.map +1 -1
  116. package/dist/tools/index.d.ts +1 -1
  117. package/dist/tools/index.js +6 -6
  118. package/dist/tools/utils/resilience.cjs +1 -1
  119. package/dist/tools/utils/resilience.cjs.map +1 -1
  120. package/dist/tools/utils/resilience.js +2 -2
  121. package/dist/tools/warp_grep/agent/runner.cjs +1 -1
  122. package/dist/tools/warp_grep/agent/runner.cjs.map +1 -1
  123. package/dist/tools/warp_grep/agent/runner.js +2 -2
  124. package/dist/tools/warp_grep/anthropic.cjs +1 -1
  125. package/dist/tools/warp_grep/anthropic.cjs.map +1 -1
  126. package/dist/tools/warp_grep/anthropic.js +4 -4
  127. package/dist/tools/warp_grep/client.cjs +1 -1
  128. package/dist/tools/warp_grep/client.cjs.map +1 -1
  129. package/dist/tools/warp_grep/client.js +3 -3
  130. package/dist/tools/warp_grep/gemini.cjs +1 -1
  131. package/dist/tools/warp_grep/gemini.cjs.map +1 -1
  132. package/dist/tools/warp_grep/gemini.js +3 -3
  133. package/dist/tools/warp_grep/index.cjs +1 -1
  134. package/dist/tools/warp_grep/index.cjs.map +1 -1
  135. package/dist/tools/warp_grep/index.js +3 -3
  136. package/dist/tools/warp_grep/openai.cjs +1 -1
  137. package/dist/tools/warp_grep/openai.cjs.map +1 -1
  138. package/dist/tools/warp_grep/openai.js +4 -4
  139. package/dist/tools/warp_grep/vercel.cjs +1 -1
  140. package/dist/tools/warp_grep/vercel.cjs.map +1 -1
  141. package/dist/tools/warp_grep/vercel.js +4 -4
  142. package/dist/{vercel-B1GZ_g9N.d.ts → vercel-Cg38kNm4.d.ts} +2 -2
  143. package/dist/version.cjs +1 -1
  144. package/dist/version.cjs.map +1 -1
  145. package/dist/version.js +1 -1
  146. package/package.json +1 -1
  147. package/dist/chunk-3BTUUH23.js.map +0 -1
  148. package/dist/chunk-D5UUKDKL.js.map +0 -1
  149. package/dist/chunk-ZHKANLAQ.js.map +0 -1
  150. /package/dist/{chunk-4R6F66B7.js.map → chunk-3ZO5CVTX.js.map} +0 -0
  151. /package/dist/{chunk-A6T6E636.js.map → chunk-5GGCKVRH.js.map} +0 -0
  152. /package/dist/{chunk-VK76R3IN.js.map → chunk-6XM5TBIT.js.map} +0 -0
  153. /package/dist/{chunk-2WAHX6I2.js.map → chunk-743P6D7J.js.map} +0 -0
  154. /package/dist/{chunk-P57SFOLD.js.map → chunk-7RFUBE4P.js.map} +0 -0
  155. /package/dist/{chunk-FOKMTUWC.js.map → chunk-BC4S5XJW.js.map} +0 -0
  156. /package/dist/{chunk-TAGDMT3K.js.map → chunk-BMDFQ2BE.js.map} +0 -0
  157. /package/dist/{chunk-5IKDEESU.js.map → chunk-DSFA7SJ5.js.map} +0 -0
  158. /package/dist/{chunk-Q77CT3RI.js.map → chunk-EM6MIZ3K.js.map} +0 -0
  159. /package/dist/{chunk-LK4C3NYX.js.map → chunk-GFHUTZHM.js.map} +0 -0
  160. /package/dist/{chunk-N4KLUOXK.js.map → chunk-HZBDQQ2Z.js.map} +0 -0
  161. /package/dist/{chunk-UDI5U6QV.js.map → chunk-L7LQEC44.js.map} +0 -0
  162. /package/dist/{chunk-MTRH7FMN.js.map → chunk-SQCU6VGN.js.map} +0 -0
  163. /package/dist/{chunk-WQU6QXSU.js.map → chunk-TIX35I4U.js.map} +0 -0
  164. /package/dist/{chunk-PRHEWGWC.js.map → chunk-ULQTARZU.js.map} +0 -0
  165. /package/dist/{chunk-KRRO7FF2.js.map → chunk-UYKCUVY2.js.map} +0 -0
  166. /package/dist/{chunk-ZSA3NL5T.js.map → chunk-XJE5S5QO.js.map} +0 -0
  167. /package/dist/{chunk-Y5O3A7SU.js.map → chunk-YFWWVZKP.js.map} +0 -0
  168. /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-TAGDMT3K.js";
4
+ } from "./chunk-BMDFQ2BE.js";
5
5
  import {
6
6
  createGitHubSearchTool as createGitHubSearchTool3,
7
7
  createWarpGrepTool as createWarpGrepTool3
8
- } from "./chunk-A6T6E636.js";
8
+ } from "./chunk-5GGCKVRH.js";
9
9
  import {
10
10
  createGitHubSearchTool as createGitHubSearchTool2,
11
11
  createWarpGrepTool as createWarpGrepTool2
12
- } from "./chunk-Q77CT3RI.js";
12
+ } from "./chunk-EM6MIZ3K.js";
13
13
  import {
14
14
  createCodebaseSearchTool as createCodebaseSearchTool3
15
- } from "./chunk-MTRH7FMN.js";
15
+ } from "./chunk-SQCU6VGN.js";
16
16
  import {
17
17
  createCodebaseSearchTool as createCodebaseSearchTool2
18
- } from "./chunk-P57SFOLD.js";
18
+ } from "./chunk-7RFUBE4P.js";
19
19
  import {
20
20
  createCodebaseSearchTool
21
- } from "./chunk-N4KLUOXK.js";
21
+ } from "./chunk-HZBDQQ2Z.js";
22
22
  import {
23
23
  CodebaseSearchClient
24
- } from "./chunk-4R6F66B7.js";
24
+ } from "./chunk-3ZO5CVTX.js";
25
25
  import {
26
26
  createEditFileTool
27
- } from "./chunk-ZHKANLAQ.js";
27
+ } from "./chunk-4PBF6VGZ.js";
28
28
  import {
29
29
  createEditFileTool as createEditFileTool3
30
- } from "./chunk-3BTUUH23.js";
30
+ } from "./chunk-Z65R2COW.js";
31
31
  import {
32
32
  createEditFileTool as createEditFileTool2
33
- } from "./chunk-D5UUKDKL.js";
33
+ } from "./chunk-HD3A6TOA.js";
34
34
  import {
35
35
  FastApplyClient
36
- } from "./chunk-J43SJUCO.js";
36
+ } from "./chunk-FFH6M54A.js";
37
37
  import {
38
38
  BrowserClient
39
- } from "./chunk-5IKDEESU.js";
39
+ } from "./chunk-DSFA7SJ5.js";
40
40
  import {
41
41
  createExploreSubagent
42
- } from "./chunk-UDI5U6QV.js";
42
+ } from "./chunk-L7LQEC44.js";
43
43
  import {
44
44
  createExploreSubagent as createExploreSubagent2
45
- } from "./chunk-LK4C3NYX.js";
45
+ } from "./chunk-GFHUTZHM.js";
46
46
  import {
47
47
  WarpGrepClient
48
- } from "./chunk-WQU6QXSU.js";
48
+ } from "./chunk-TIX35I4U.js";
49
49
  import {
50
50
  AnthropicRouter,
51
51
  GeminiRouter,
52
52
  OpenAIRouter,
53
53
  RawRouter
54
- } from "./chunk-2WAHX6I2.js";
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-PRHEWGWC.js.map
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-5IKDEESU.js";
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-KRRO7FF2.js.map
96
+ //# sourceMappingURL=chunk-UYKCUVY2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SDK_VERSION
3
- } from "./chunk-3XO33KPS.js";
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-ZSA3NL5T.js.map
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-5IKDEESU.js";
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-Y5O3A7SU.js.map
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-J43SJUCO.js";
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
- instructions: z.string().describe("A single sentence describing what you are changing (first person)"),
25
- code_edit: z.string().describe("The lazy edit with // ... existing code ... markers")
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
- instructions: params.instructions,
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
- instructions: z.string().describe("A single sentence describing what you are changing (first person)"),
54
- code_edit: z.string().describe("The lazy edit with // ... existing code ... markers")
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
- instructions: params.instructions,
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-3BTUUH23.js.map
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-3XO33KPS.js";
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-YKBVE3CE.js.map
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
- instructions: string;
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.154",
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
- input.instructions,
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 { content: mergedCode, completionId } = await callMorphAPI2(originalCode, input.code_edit, input.instructions, input.target_filepath, config);
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
- instructions: {
5158
+ instruction: {
5157
5159
  type: "string",
5158
- description: "A single sentence describing what you are changing (first person)"
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: "The lazy edit with // ... existing code ... markers"
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", "instructions", "code_edit"]
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
- instructions: {
5389
+ instruction: {
5388
5390
  type: "string",
5389
- description: "A single sentence describing what you are changing (first person)"
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: "The lazy edit with // ... existing code ... markers"
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", "instructions", "code_edit"]
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
- instructions: import_zod3.z.string().describe("A single sentence describing what you are changing (first person)"),
5942
- code_edit: import_zod3.z.string().describe("The lazy edit with // ... existing code ... markers")
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
- instructions: params.instructions,
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
- instructions: import_zod3.z.string().describe("A single sentence describing what you are changing (first person)"),
5968
- code_edit: import_zod3.z.string().describe("The lazy edit with // ... existing code ... markers")
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
- instructions: params.instructions,
5979
+ instruction: params.instruction,
5978
5980
  code_edit: params.code_edit
5979
5981
  },
5980
5982
  config