UNPKG

mcp-files

Version:

Enables agents to quickly find and edit code in a codebase with surgical precision. Find symbols, edit them everywhere

99 lines (94 loc) 3.17 kB
import * as zod from 'zod'; import { ZodSchema, z } from 'zod'; declare const cli: { isCommand: (arg?: string) => boolean | "" | undefined; run(args: string[]): Promise<void>; runTool(tool: any, args: object): Promise<string>; }; interface ToolResult { success: boolean; output: string; error?: string; } interface ToolConfig<N extends string, S extends ZodSchema = ZodSchema> { id: N; name?: string; schema: S; description: string; isReadOnly?: boolean; isEnabled?: boolean; isResource?: boolean; handler: (args: z.infer<S>, context?: any) => Promise<any> | any; fromArgs: (args: string[]) => z.infer<S>; } type Tool<S extends ZodSchema = ZodSchema> = Required<ToolConfig<string, S>>; declare const tools: { readonly read_symbol: Required<ToolConfig<string, zod.ZodObject<{ symbol: zod.ZodString; file_paths: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>; limit: zod.ZodOptional<zod.ZodNumber>; }, "strip", zod.ZodTypeAny, { symbol: string; file_paths?: string[] | undefined; limit?: number | undefined; }, { symbol: string; file_paths?: string[] | undefined; limit?: number | undefined; }>>>; readonly import_symbol: Required<ToolConfig<string, zod.ZodObject<{ module_path: zod.ZodString; property: zod.ZodOptional<zod.ZodString>; }, "strip", zod.ZodTypeAny, { module_path: string; property?: string | undefined; }, { module_path: string; property?: string | undefined; }>>>; readonly search_replace: Required<ToolConfig<string, zod.ZodObject<{ file_path: zod.ZodString; old_string: zod.ZodString; new_string: zod.ZodString; allow_multiple_matches: zod.ZodOptional<zod.ZodBoolean>; }, "strip", zod.ZodTypeAny, { file_path: string; old_string: string; new_string: string; allow_multiple_matches?: boolean | undefined; }, { file_path: string; old_string: string; new_string: string; allow_multiple_matches?: boolean | undefined; }>>>; readonly insert_text: Required<ToolConfig<string, zod.ZodObject<{ file_path: zod.ZodString; from_line: zod.ZodNumber; text: zod.ZodString; to_line: zod.ZodOptional<zod.ZodNumber>; }, "strip", zod.ZodTypeAny, { file_path: string; from_line: number; text: string; to_line?: number | undefined; }, { file_path: string; from_line: number; text: string; to_line?: number | undefined; }>>>; readonly os_notification: Required<ToolConfig<string, zod.ZodObject<{ message: zod.ZodString; title: zod.ZodOptional<zod.ZodString>; }, "strip", zod.ZodTypeAny, { message: string; title?: string | undefined; }, { message: string; title?: string | undefined; }>>>; readonly utils_debug: Required<ToolConfig<string, zod.ZodObject<{}, "strip", zod.ZodTypeAny, {}, {}>>>; }; export { cli, tools }; export type { Tool, ToolConfig, ToolResult };