tinyagent-ts
Version:
Modern TypeScript framework for building AI agents with pluggable tools and ReAct reasoning
41 lines (40 loc) • 1.26 kB
TypeScript
import { z } from 'zod';
import { BaseTool } from './types';
/**
* Schema for file operations
*/
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>;
/**
* File system tool supporting basic CRUD operations
*/
export declare class FileTool extends BaseTool {
name: string;
description: string;
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;
}>;
execute(args: FileToolArgs, abortSignal?: AbortSignal): Promise<string>;
}