@@ -107,7 +107,7 @@ export class NewUnifiedDiffStrategy implements DiffStrategy {
107107 return { hunks }
108108 }
109109
110- getToolDescription ( cwd : string ) : string {
110+ getToolDescription ( args : { cwd : string ; toolOptions ?: { [ key : string ] : string } } ) : string {
111111 return `# apply_diff Tool - Generate Precise Code Changes
112112
113113Generate a unified diff that can be cleanly applied to modify code files.
@@ -164,8 +164,8 @@ Generate a unified diff that can be cleanly applied to modify code files.
164164\`\`\`
165165
166166Parameters:
167- - path: (required) The path of the file to apply the diff to ( relative to the current working directory ${ args . cwd } )
168- - diff: (required) The diff content in unified format to apply to the file.
167+ - path: (required) File path relative to ${ args . cwd }
168+ - diff: (required) Unified diff content in unified format to apply to the file.
169169
170170Usage:
171171<apply_diff>
@@ -233,7 +233,7 @@ Your diff here
233233 originalContent : string ,
234234 diffContent : string ,
235235 startLine ?: number ,
236- endLine ?: number ,
236+ endLine ?: number
237237 ) : Promise < DiffResult > {
238238 const parsedDiff = this . parseUnifiedDiff ( diffContent )
239239 const originalLines = originalContent . split ( "\n" )
@@ -271,7 +271,7 @@ Your diff here
271271 subHunkResult ,
272272 subSearchResult . index ,
273273 subSearchResult . confidence ,
274- this . confidenceThreshold ,
274+ this . confidenceThreshold
275275 )
276276 if ( subEditResult . confidence >= this . confidenceThreshold ) {
277277 subHunkResult = subEditResult . result
@@ -293,12 +293,12 @@ Your diff here
293293 const contextRatio = contextLines / totalLines
294294
295295 let errorMsg = `Failed to find a matching location in the file (${ Math . floor (
296- confidence * 100 ,
296+ confidence * 100
297297 ) } % confidence, needs ${ Math . floor ( this . confidenceThreshold * 100 ) } %)\n\n`
298298 errorMsg += "Debug Info:\n"
299299 errorMsg += `- Search Strategy Used: ${ strategy } \n`
300300 errorMsg += `- Context Lines: ${ contextLines } out of ${ totalLines } total lines (${ Math . floor (
301- contextRatio * 100 ,
301+ contextRatio * 100
302302 ) } %)\n`
303303 errorMsg += `- Attempted to split into ${ subHunks . length } sub-hunks but still failed\n`
304304
@@ -330,7 +330,7 @@ Your diff here
330330 } else {
331331 // Edit failure - likely due to content mismatch
332332 let errorMsg = `Failed to apply the edit using ${ editResult . strategy } strategy (${ Math . floor (
333- editResult . confidence * 100 ,
333+ editResult . confidence * 100
334334 ) } % confidence)\n\n`
335335 errorMsg += "Debug Info:\n"
336336 errorMsg += "- The location was found but the content didn't match exactly\n"
0 commit comments