File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -23,19 +23,25 @@ const ToolRunner = {
2323
2424 const builtIns = {
2525 // VFS Ops
26- read_file : async ( { path } ) => {
26+ read_file : async ( args ) => {
27+ const path = args . path || args . file ;
2728 if ( ! path ) throw new Errors . ValidationError ( 'Missing path' ) ;
2829 return await VFS . read ( path ) ;
2930 } ,
30- write_file : async ( { path, content } ) => {
31+ write_file : async ( args ) => {
32+ const path = args . path || args . file ;
33+ const content = args . content ;
3134 if ( ! path || content === undefined ) throw new Errors . ValidationError ( 'Missing args' ) ;
3235 await VFS . write ( path , content ) ;
3336 return `Wrote ${ path } (${ content . length } bytes)` ;
3437 } ,
35- list_files : async ( { path } ) => {
38+ list_files : async ( args ) => {
39+ const path = args . path || args . directory || args . dir ;
3640 return await VFS . list ( path || '/' ) ;
3741 } ,
38- delete_file : async ( { path } ) => {
42+ delete_file : async ( args ) => {
43+ const path = args . path || args . file ;
44+ if ( ! path ) throw new Errors . ValidationError ( 'Missing path' ) ;
3945 await VFS . delete ( path ) ;
4046 return `Deleted ${ path } ` ;
4147 } ,
You can’t perform that action at this time.
0 commit comments