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 @@ -623,7 +623,38 @@ export class PintFsClient implements IAgentClientFS {
623623 recursive ?: boolean ,
624624 overwrite ?: boolean
625625 ) : Promise < PickRawFsResult < "fs/copy" > > {
626- throw new Error ( "Not implemented" ) ;
626+ try {
627+ const response = await performFileAction ( {
628+ client : this . apiClient ,
629+ path : {
630+ path : from ,
631+ } ,
632+ body : {
633+ action : 'copy' ,
634+ destination : to ,
635+ } ,
636+ } ) ;
637+
638+ if ( response . data ) {
639+ // FSCopyResult is an empty object (Record<string, never>)
640+ return {
641+ type : "ok" ,
642+ result : { } ,
643+ } ;
644+ } else {
645+ return {
646+ type : "error" ,
647+ error : response . error ?. message || "Failed to copy file" ,
648+ errno : null ,
649+ } ;
650+ }
651+ } catch ( error ) {
652+ return {
653+ type : "error" ,
654+ error : error instanceof Error ? error . message : "Unknown error" ,
655+ errno : null ,
656+ } ;
657+ }
627658 }
628659
629660 async rename (
You can’t perform that action at this time.
0 commit comments