@@ -95,7 +95,7 @@ export interface ToolReturnParseResult {
9595 filePath ?: string ;
9696 title ?: string ;
9797 technicalPlan ?: TechnicalPlan ;
98- type ?: 'modify' | 'create' | 'delete' | 'open' | 'bash' ;
98+ type ?: 'modify' | 'create' | 'delete' | 'open' | 'bash' | 'move' ;
9999}
100100
101101export type Response = ChatMessage | ChatMessage [ ] | null ;
@@ -111,7 +111,7 @@ export interface SavedPromptsResponse {
111111}
112112interface ToolReturnInfo {
113113 title : string ;
114- type : 'modify' | 'create' | 'delete' | 'open' | 'bash' ;
114+ type : 'modify' | 'create' | 'delete' | 'open' | 'bash' | 'move' ;
115115}
116116
117117export const modifyFileTitleMap : Record < string , ToolReturnInfo > = {
@@ -121,6 +121,7 @@ export const modifyFileTitleMap: Record<string, ToolReturnInfo> = {
121121 created : { title : 'Created file' , type : 'create' } ,
122122 deleted : { title : 'Deleted file' , type : 'delete' } ,
123123 updated : { title : 'Updated file' , type : 'modify' } ,
124+ moved : { title : 'Moved file' , type : 'move' } ,
124125 expanded_folder : { title : 'Expanded folder' , type : 'open' } ,
125126} ;
126127
@@ -143,6 +144,7 @@ export function parseToolReturnMessage(
143144 case 'open_files' :
144145 case 'create_file' :
145146 case 'delete_file' :
147+ case 'move_file' :
146148 const contentArray = msg . parsedContent ? msg . parsedContent : [ msg . content ] ;
147149 if ( ! Array . isArray ( contentArray ) ) {
148150 console . warn ( 'Invalid content format in ToolReturnMessage:' , msg . content ) ;
@@ -157,7 +159,7 @@ export function parseToolReturnMessage(
157159
158160 const trimmedLine = line . split ( '\n\n' ) [ 0 ] . trim ( ) ;
159161 const matches = trimmedLine . match (
160- / ^ S u c c e s s f u l l y \s + ( e x p a n d e d c o d e c h u n k s | r e p l a c e d c o d e | o p e n e d | c r e a t e d | d e l e t e d | u p d a t e d ) (?: \s + i n ) ? \s + ( .+ ) ? $ / ,
162+ / ^ S u c c e s s f u l l y \s + ( e x p a n d e d c o d e c h u n k s | r e p l a c e d c o d e | o p e n e d | m o v e d | c r e a t e d | d e l e t e d | u p d a t e d ) (?: \s + i n ) ? \s + ( .+ ) ? $ / ,
161163 ) ;
162164 if ( matches && matches . length >= 3 ) {
163165 let filePath = matches [ 2 ] . trim ( ) ;
@@ -274,7 +276,7 @@ export function parseToolReturnMessage(
274276}
275277
276278export const isCodeChangeTool = ( toolName : string ) : boolean => {
277- return [ 'find_and_replace_code' , 'create_file' , 'delete_file' ] . includes ( toolName ) ;
279+ return [ 'find_and_replace_code' , 'create_file' , 'delete_file' , 'move_file' ] . includes ( toolName ) ;
278280} ;
279281
280282export const CODE_PLAN_EXECUTE_PROMPT = 'Execute the code plan that you have created' ;
0 commit comments