import { IEventService, IFunctionTool, IParameterValidationResult, ITool, IToolExecutionContext, IToolRegistry, IToolResult, IToolSchema, TToolExecutor, TToolParameters, TUniversalValue } from "@robota-sdk/agent-core"; import { TypeOf, ZodType } from "zod"; //#region src/types/tool-result.d.ts /** * Result returned by a CLI tool invocation */ interface IToolInvocationResult { success: boolean; output: string; error?: string; exitCode?: number; /** Start line number of the edit in the original file (Edit tool only) */ startLine?: number; } //#endregion //#region src/registry/tool-registry.d.ts /** * Tool registry implementation * Manages tool registration, validation, and retrieval */ declare class ToolRegistry implements IToolRegistry { private tools; /** * Register a tool */ register(tool: ITool): void; /** * Unregister a tool */ unregister(name: string): void; /** * Get tool by name */ get(name: string): ITool | undefined; /** * Get all registered tools */ getAll(): ITool[]; /** * Get tool schemas */ getSchemas(): IToolSchema[]; /** * Check if tool exists */ has(name: string): boolean; /** * Clear all tools */ clear(): void; /** * Get tool names */ getToolNames(): string[]; /** * Get tools by pattern */ getToolsByPattern(pattern: string | RegExp): ITool[]; /** * Get tool count */ size(): number; /** * Validate tool schema */ private validateToolSchema; } //#endregion //#region src/implementations/function-tool.d.ts /** * Function tool implementation * Wraps a JavaScript function as a tool with schema validation * * Implements IFunctionTool without extending AbstractTool to avoid * circular runtime dependency (tools → agents → tools). */ declare class FunctionTool implements IFunctionTool { readonly schema: IToolSchema; readonly fn: TToolExecutor; private eventService; constructor(schema: IToolSchema, fn: TToolExecutor); /** * Get tool name */ getName(): string; /** * Set EventService for post-construction injection. * Accepts EventService as-is without transformation. * Caller is responsible for providing properly configured EventService. */ setEventService(eventService: IEventService | undefined): void; /** * Execute the function tool */ execute(parameters: TToolParameters, context?: IToolExecutionContext): Promise; /** * Validate parameters (simple boolean result) */ validate(parameters: TToolParameters): boolean; /** * Validate tool parameters with detailed result */ validateParameters(parameters: TToolParameters): IParameterValidationResult; /** * Get tool description */ getDescription(): string; /** * Validate constructor inputs */ private validateConstructorInputs; } /** * Helper function to create a function tool from a simple function */ declare function createFunctionTool(name: string, description: string, parameters: IToolSchema['parameters'], fn: TToolExecutor): FunctionTool; /** * Helper function to create a function tool from Zod schema */ declare function createZodFunctionTool(name: string, description: string, zodSchema: S, fn: TToolExecutor>): FunctionTool; //#endregion //#region src/implementations/function-tool/types.d.ts /** * Parameter type validation options */ interface IFunctionToolValidationOptions { strict?: boolean; allowUnknown?: boolean; validateTypes?: boolean; } /** * Tool execution metadata */ interface IFunctionToolExecutionMetadata { executionTime: number; toolName: string; parameters: TToolParameters; } /** * Tool result with metadata */ interface IFunctionToolResult { success: boolean; data: TUniversalValue; metadata?: IFunctionToolExecutionMetadata; } //#endregion export { FunctionTool, type IFunctionToolExecutionMetadata, type IFunctionToolResult, type IFunctionToolValidationOptions, type IToolInvocationResult, ToolRegistry, createFunctionTool, createZodFunctionTool }; //# sourceMappingURL=browser.d.ts.map