@aituber-onair/core
Version:
Core library for AITuber OnAir providing voice synthesis and chat processing
36 lines (35 loc) • 1.21 kB
TypeScript
import { ToolDefinition, ToolUseBlock, ToolResultBlock, MCPServerConfig } from '@aituber-onair/chat';
type Handler<P = any, R = any> = (input: P) => Promise<R>;
export declare class ToolExecutor {
private registry;
private mcpServers;
register<P, R>(definition: ToolDefinition, fn: Handler<P, R>): void;
setMCPServers(servers: MCPServerConfig[]): void;
/**
* Check if a tool name is an MCP tool
* @param toolName Tool name to check
* @returns True if this is an MCP tool
*/
private isMCPTool;
/**
* Extract MCP server name from tool name
* @param toolName Tool name (e.g., "mcp_deepwiki_search")
* @returns Server name (e.g., "deepwiki")
*/
private extractMCPServerName;
/**
* Extract actual tool name from MCP tool name
* @param toolName Tool name (e.g., "mcp_deepwiki_search")
* @returns Actual tool name (e.g., "search")
*/
private extractMCPToolName;
/**
* Execute MCP tool call
* @param block Tool use block
* @returns Tool result block
*/
private executeMCPTool;
run(blocks: ToolUseBlock[]): Promise<ToolResultBlock[]>;
listDefinitions(): ToolDefinition[];
}
export {};