import { VowelActionDefinition, JSONSchema } from '../types'; /** * WebMCP tool definition from the browser's native API */ export interface WebMCPTool { name: string; description: string; inputSchema: JSONSchema; } /** * WebMCP execution result */ export interface WebMCPExecutionResult { success: boolean; result?: unknown; error?: string; } /** * Check if WebMCP native API is available in the browser * * @returns true if navigator.modelContext.registerTool is available * * @example * ```ts * if (isWebMCPAvailable()) { * console.log('WebMCP is available!'); * } * ``` */ export declare function isWebMCPAvailable(): boolean; /** * Check if WebMCP testing API is available (for tool discovery) * * @returns true if navigator.modelContextTesting.getTools is available * * @example * ```ts * if (isWebMCPTestingAvailable()) { * const tools = await discoverWebMCPTools(); * } * ``` */ export declare function isWebMCPTestingAvailable(): boolean; /** * Discover WebMCP tools registered in the browser * * @returns Promise resolving to array of discovered WebMCP tools * * @example * ```ts * const tools = await discoverWebMCPTools(); * console.log('Discovered tools:', tools.map(t => t.name)); * ``` */ export declare function discoverWebMCPTools(): Promise; /** * Register a Vowel action as a WebMCP tool * * @param name - Tool name * @param definition - Vowel action definition (WebMCP or legacy format) * @param handler - Execution handler * @returns AbortController for cleanup, or null if WebMCP not available * * @example * ```ts * const controller = await registerVowelActionAsWebMCP('searchProducts', { * name: 'searchProducts', * description: 'Search for products', * inputSchema: { ... } * }, async (params) => { ... }); * * // Later, to unregister: * controller?.abort(); * ``` */ export declare function registerVowelActionAsWebMCP(name: string, definition: VowelActionDefinition, handler: (params: unknown) => Promise): Promise; /** * Unregister a WebMCP tool * * @param controller - AbortController from registerVowelActionAsWebMCP * * @example * ```ts * const controller = await registerVowelActionAsWebMCP(...); * // Later, to unregister: * unregisterWebMCPTool(controller); * ``` */ export declare function unregisterWebMCPTool(controller: AbortController | null): void; /** * Convert a Vowel action definition to WebMCP tool format * * @param name - Tool name * @param definition - Vowel action definition * @returns WebMCP tool definition or null if conversion fails * * @example * ```ts * const tool = convertToWebMCPTool('searchProducts', { * description: 'Search for products', * parameters: { query: { type: 'string', description: 'Search query' } } * }); * ``` */ export declare function convertToWebMCPTool(name: string, definition: VowelActionDefinition): WebMCPTool | null; /** * Call a WebMCP tool directly (for testing) * * @param name - Tool name * @param params - Tool parameters * @returns Promise resolving to tool execution result * * @example * ```ts * const result = await callWebMCPTool('searchProducts', { query: 'iphone' }); * console.log(result); * ``` */ export declare function callWebMCPTool(name: string, params: unknown): Promise; /** * Get all registered WebMCP tool names * * @returns Array of registered tool names * * @example * ```ts * const names = getRegisteredWebMCPToolNames(); * console.log('Registered tools:', names); * ``` */ export declare function getRegisteredWebMCPToolNames(): string[]; //# sourceMappingURL=index.d.ts.map