File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -595,7 +595,38 @@ export class PintFsClient implements IAgentClientFS {
595595 to : string ,
596596 overwrite ?: boolean
597597 ) : Promise < PickRawFsResult < "fs/rename" > > {
598- throw new Error ( "Not implemented" ) ;
598+ try {
599+ const response = await performFileAction ( {
600+ client : this . apiClient ,
601+ path : {
602+ path : from ,
603+ } ,
604+ body : {
605+ action : 'move' ,
606+ destination : to ,
607+ } ,
608+ } ) ;
609+
610+ if ( response . data ) {
611+ // FSRenameResult is an empty object (Record<string, never>)
612+ return {
613+ type : "ok" ,
614+ result : { } ,
615+ } ;
616+ } else {
617+ return {
618+ type : "error" ,
619+ error : response . error ?. message || "Failed to rename/move file" ,
620+ errno : null ,
621+ } ;
622+ }
623+ } catch ( error ) {
624+ return {
625+ type : "error" ,
626+ error : error instanceof Error ? error . message : "Unknown error" ,
627+ errno : null ,
628+ } ;
629+ }
599630 }
600631
601632 async watch (
You can’t perform that action at this time.
0 commit comments