/** * ToolRegistry — Single source of truth for gateway tools (STORY-016) * * Centralizes tool definitions so that: * - VALID_TOOLS array (gateway-tool-executor.ts) is derived, not hand-coded * - gateway-tools.md can be generated at build time * - Per-agent tool filtering has one canonical list to filter against */ import type { GatewayToolName } from './types.js'; import type { HostToolDefinition } from './model-runner.js'; export type ToolCategory = 'memory' | 'business_data' | 'utility' | 'os_management' | 'os_monitoring' | 'webchat' | 'code_act' | 'system'; export interface ToolDefinitionMeta { name: GatewayToolName; description: string; category: ToolCategory; /** Short parameter hint for prompt generation (e.g. "query?, type?, limit?") */ params?: string; /** If true, only viewers can use this tool */ viewerOnly?: boolean; /** Exact Codex dynamic-tool schema when the permissive gateway default is insufficient. */ inputSchema?: HostToolDefinition['inputSchema']; } export interface HostToolDefinitionOptions { allowedTools?: string[]; blockedTools?: string[]; disallowedTools?: string[]; viewer?: boolean; } export declare class ToolRegistry { /** * Get all registered tool names. */ static getValidToolNames(): GatewayToolName[]; /** * Get tool metadata by name. */ static getTool(name: string): ToolDefinitionMeta | undefined; /** * Get all tool definitions. */ static getAllTools(): ToolDefinitionMeta[]; /** * Get tools filtered by allowed list. * If allowedTools is undefined, returns all tools. An empty list returns none. * Supports wildcard patterns: "mama_*", "browser_*", "*" */ static getFilteredTools(allowedTools?: readonly string[]): ToolDefinitionMeta[]; /** Expand optional exact/glob patterns to canonical registry names. */ static expandToolPatterns(patterns?: readonly string[]): string[]; /** * Convert role-filtered registry metadata to Codex dynamic functions. * Argument validation remains the responsibility of GatewayToolExecutor. */ static getHostToolDefinitions(options?: HostToolDefinitionOptions): HostToolDefinition[]; /** * Get tools grouped by category. */ static getByCategory(): Map; /** * Check if a tool name is registered. */ static isRegistered(name: string): boolean; /** * Validate that all registered tools have handlers in an executor. * Returns list of tool names with missing handlers. */ static validateHandlers(handlerNames: Set): string[]; /** * Generate a markdown prompt listing all tools (or filtered subset). */ static generatePrompt(allowedTools?: readonly string[]): string; /** * Generate a compact fallback prompt (for when gateway-tools.md is not available). */ static generateFallbackPrompt(allowedTools?: readonly string[]): string; /** * Total number of registered tools. */ static get count(): number; } //# sourceMappingURL=tool-registry.d.ts.map