17 lines
776 B
TypeScript
17 lines
776 B
TypeScript
import { ToolContext } from './context';
|
|
export interface ToolDefinition {
|
|
name: string;
|
|
description: string;
|
|
parameters: Record<string, unknown>;
|
|
/** Implementation — called by executeTool(). Not sent to the LLM. */
|
|
handler: (args: Record<string, unknown>, ctx: ToolContext) => Promise<unknown>;
|
|
}
|
|
/**
|
|
* Mutable array kept in sync with the registry.
|
|
* Used by agents.ts to pick tool subsets by name (backwards-compatible with ALL_TOOLS).
|
|
*/
|
|
export declare const ALL_TOOLS: ToolDefinition[];
|
|
export declare function registerTool(tool: ToolDefinition): void;
|
|
/** Dispatch a tool call by name — O(1) map lookup, no switch needed. */
|
|
export declare function executeTool(name: string, args: Record<string, unknown>, ctx: ToolContext): Promise<unknown>;
|