UNPKG

sourcewizard

Version:

SourceWizard - AI-powered setup wizard for dev tools and libraries with MCP integration

453 lines (452 loc) 11.7 kB
import z from "zod"; import { TargetInfo } from "./repository-detector"; /** * Create a read_file tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createReadFileTool(cwd: string): import("ai").Tool<z.ZodObject<{ path: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; }, { path?: string; }>, { path: string; content: string; success: boolean; error?: undefined; } | { path: string; error: string; success: boolean; content?: undefined; }> & { execute: (args: { path?: string; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ path: string; content: string; success: boolean; error?: undefined; } | { path: string; error: string; success: boolean; content?: undefined; }>; }; /** * Create a write_file tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createWriteFileTool(cwd: string): import("ai").Tool<z.ZodObject<{ path: z.ZodString; content: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; content?: string; }, { path?: string; content?: string; }>, { path: string; success: boolean; message: string; error?: undefined; } | { path: string; error: string; success: boolean; message?: undefined; }> & { execute: (args: { path?: string; content?: string; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ path: string; success: boolean; message: string; error?: undefined; } | { path: string; error: string; success: boolean; message?: undefined; }>; }; /** * Create a create_file tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createCreateFileTool(cwd: string): import("ai").Tool<z.ZodObject<{ path: z.ZodString; content: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; content?: string; }, { path?: string; content?: string; }>, { path: string; error: string; success: boolean; message?: undefined; } | { path: string; success: boolean; message: string; error?: undefined; }> & { execute: (args: { path?: string; content?: string; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ path: string; error: string; success: boolean; message?: undefined; } | { path: string; success: boolean; message: string; error?: undefined; }>; }; /** * Create a list_directory tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createListDirectoryTool(cwd: string): import("ai").Tool<z.ZodObject<{ path: z.ZodString; include_hidden: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { path?: string; include_hidden?: boolean; }, { path?: string; include_hidden?: boolean; }>, { path: string; items: { name: string; type: string; path: string; }[]; success: boolean; error?: undefined; } | { path: string; error: string; success: boolean; items?: undefined; }> & { execute: (args: { path?: string; include_hidden?: boolean; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ path: string; items: { name: string; type: string; path: string; }[]; success: boolean; error?: undefined; } | { path: string; error: string; success: boolean; items?: undefined; }>; }; /** * Create an append_to_file tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createAppendToFileTool(cwd: string): import("ai").Tool<z.ZodObject<{ path: z.ZodString; content: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; content?: string; }, { path?: string; content?: string; }>, { path: string; success: boolean; message: string; error?: undefined; } | { path: string; error: string; success: boolean; message?: undefined; }> & { execute: (args: { path?: string; content?: string; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ path: string; success: boolean; message: string; error?: undefined; } | { path: string; error: string; success: boolean; message?: undefined; }>; }; /** * Create a delete_file tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createDeleteFileTool(cwd: string): import("ai").Tool<z.ZodObject<{ path: z.ZodString; recursive: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { path?: string; recursive?: boolean; }, { path?: string; recursive?: boolean; }>, { path: string; success: boolean; message: string; error?: undefined; } | { path: string; error: string; success: boolean; message?: undefined; }> & { execute: (args: { path?: string; recursive?: boolean; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ path: string; success: boolean; message: string; error?: undefined; } | { path: string; error: string; success: boolean; message?: undefined; }>; }; /** * Create an edit_file tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createEditFileTool(cwd: string): import("ai").Tool<z.ZodObject<{ path: z.ZodString; old_string: z.ZodString; new_string: z.ZodString; }, "strip", z.ZodTypeAny, { path?: string; old_string?: string; new_string?: string; }, { path?: string; old_string?: string; new_string?: string; }>, { path: string; error: string; success: boolean; message?: undefined; } | { path: string; success: boolean; message: string; error?: undefined; }> & { execute: (args: { path?: string; old_string?: string; new_string?: string; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ path: string; error: string; success: boolean; message?: undefined; } | { path: string; success: boolean; message: string; error?: undefined; }>; }; /** * Create a typecheck tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createTypecheckTool(cwd: string): import("ai").Tool<z.ZodObject<{ target: z.ZodOptional<z.ZodString>; repoPath: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { target?: string; repoPath?: string; }, { target?: string; repoPath?: string; }>, { success: boolean; output: string; target: string; repoPath: string; message: string; error?: undefined; } | { success: boolean; error: string; target: string; repoPath: string; output?: undefined; message?: undefined; }> & { execute: (args: { target?: string; repoPath?: string; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ success: boolean; output: string; target: string; repoPath: string; message: string; error?: undefined; } | { success: boolean; error: string; target: string; repoPath: string; output?: undefined; message?: undefined; }>; }; /** * Create a getBulkTargetData tool for AI agents * @param cwd Current working directory for relative path resolution * @param repositoryTargets Available targets in the repository */ export declare function createGetBulkTargetDataTool(cwd: string, repositoryTargets: Record<string, TargetInfo>): import("ai").Tool<z.ZodObject<{ targetNames: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>; repoPath: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { repoPath?: string; targetNames?: string | string[]; }, { repoPath?: string; targetNames?: string | string[]; }>, { success: boolean; error: string; data?: undefined; requestedTargets?: undefined; availableTargets?: undefined; } | { success: boolean; data: import("./repository-detector").BulkTargetData; requestedTargets: string[]; availableTargets: string[]; error?: undefined; }> & { execute: (args: { repoPath?: string; targetNames?: string | string[]; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ success: boolean; error: string; data?: undefined; requestedTargets?: undefined; availableTargets?: undefined; } | { success: boolean; data: import("./repository-detector").BulkTargetData; requestedTargets: string[]; availableTargets: string[]; error?: undefined; }>; }; /** * Create an add_package tool for AI agents * @param cwd Current working directory for relative path resolution */ export declare function createAddPackageTool(cwd: string): import("ai").Tool<z.ZodObject<{ packageName: z.ZodString; target: z.ZodOptional<z.ZodString>; isDev: z.ZodOptional<z.ZodBoolean>; useWorkspace: z.ZodOptional<z.ZodBoolean>; additionalFlags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; repoPath: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { packageName?: string; target?: string; repoPath?: string; isDev?: boolean; useWorkspace?: boolean; additionalFlags?: string[]; }, { packageName?: string; target?: string; repoPath?: string; isDev?: boolean; useWorkspace?: boolean; additionalFlags?: string[]; }>, { success: boolean; output: string; target: string; packageName: string; isDev: boolean; repoPath: string; message: string; error?: undefined; } | { success: boolean; error: string; target: string; packageName: string; isDev: boolean; repoPath: string; output?: undefined; message?: undefined; }> & { execute: (args: { packageName?: string; target?: string; repoPath?: string; isDev?: boolean; useWorkspace?: boolean; additionalFlags?: string[]; }, options: import("ai").ToolExecutionOptions) => PromiseLike<{ success: boolean; output: string; target: string; packageName: string; isDev: boolean; repoPath: string; message: string; error?: undefined; } | { success: boolean; error: string; target: string; packageName: string; isDev: boolean; repoPath: string; output?: undefined; message?: undefined; }>; }; /** * Create a complete set of file operation tools for AI agents * @param cwd Current working directory for relative path resolution * @param repositoryTargets Optional repository targets for the getBulkTargetData tool */ export declare function createFileOperationTools(cwd: string, repositoryTargets?: Record<string, TargetInfo>): any; export declare function createSearchTools(cwd: string, repositoryTargets: Record<string, TargetInfo>): any;