tinyagent-ts
Version:
Modern TypeScript framework for building AI agents with pluggable tools and ReAct reasoning
39 lines (38 loc) • 1.35 kB
TypeScript
import { z } from 'zod';
import { Tool } from '../final-answer.tool';
export declare const FileToolSchema: z.ZodObject<{
action: z.ZodEnum<["read", "write", "append", "delete"]>;
path: z.ZodString;
content: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
path: string;
action: "read" | "write" | "append" | "delete";
content?: string | undefined;
}, {
path: string;
action: "read" | "write" | "append" | "delete";
content?: string | undefined;
}>;
export type FileToolArgs = z.infer<typeof FileToolSchema>;
export type FileToolOutput = string;
/**
* Simple file system tool supporting basic CRUD operations.
*/
export declare class FileTool implements Tool<FileToolArgs, FileToolOutput> {
readonly name = "file";
readonly description = "Read, write, append or delete a file on disk";
readonly schema: z.ZodObject<{
action: z.ZodEnum<["read", "write", "append", "delete"]>;
path: z.ZodString;
content: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
path: string;
action: "read" | "write" | "append" | "delete";
content?: string | undefined;
}, {
path: string;
action: "read" | "write" | "append" | "delete";
content?: string | undefined;
}>;
forward(args: FileToolArgs): Promise<FileToolOutput>;
}