Function: createScopedFilesystemTools()
createScopedFilesystemTools(
workingDir,opts?):object
Defined in: scoped.ts:37
Build bash + filesystem tools that default to the given working directory. Output shapes match the unscoped tools so existing renderers work unchanged.
Parameters
workingDir
string
opts?
Returns
object
bash
bash:
ZodToolDefinition<ZodObject<{command:ZodString;timeout:ZodOptional<ZodNumber>; },$strip>,BashResult> =scopedBash
edit_file
edit_file:
ZodToolDefinition<ZodObject<{new_string:ZodString;old_string:ZodString;path:ZodString;replace_all:ZodOptional<ZodBoolean>; },$strip>, {error:string;path?:undefined;replacements?:undefined;success:boolean; } | {error?:undefined;path:string;replacements:number;success:boolean; }> =scopedEditFile
file_info
file_info:
ZodToolDefinition<ZodObject<{path:ZodString; },$strip>, {created?:undefined;error:string;exists?:undefined;modified?:undefined;size?:undefined;success:boolean;type?:undefined; } | {created:string|undefined;error?:undefined;exists:boolean;modified:string|undefined;size:number|undefined;success:boolean;type:"unknown"|"file"|"directory"|"symlink"|undefined; }> =scopedFileInfo
list_directory
list_directory:
ZodToolDefinition<ZodObject<{includeHidden:ZodOptional<ZodBoolean>;path:ZodString;recursive:ZodOptional<ZodBoolean>; },$strip>, {count?:undefined;entries?:undefined;error:string;path?:undefined;success:boolean; } | {count:number;entries:DirEntry[];error?:undefined;path:string;success:boolean; }> =scopedListDirectory
read_file
read_file:
ZodToolDefinition<ZodObject<{encoding:ZodOptional<ZodEnum<{base64:"base64";hex:"hex";utf-8:"utf-8";utf8:"utf8"; }>>;path:ZodString; },$strip>, {content?:undefined;error:string;size?:undefined;success:boolean; } | {content:string;error?:undefined;size:number;success:boolean; }> =scopedReadFile
write_file
write_file:
ZodToolDefinition<ZodObject<{content:ZodString;createDirs:ZodOptional<ZodBoolean>;encoding:ZodOptional<ZodEnum<{base64:"base64";hex:"hex";utf-8:"utf-8";utf8:"utf8"; }>>;path:ZodString; },$strip>, {error:string;path?:undefined;size?:undefined;success:boolean; } | {error?:undefined;path:string;size:number;success:boolean; }> =scopedWriteFile