/** * Exa MCP Types * * Types for the Exa MCP client and tool implementations. */ import type { TSchema } from "@oh-my-pi/pi-ai"; /** MCP endpoint URLs */ export declare const EXA_MCP_URL = "https://mcp.exa.ai/mcp"; export declare const WEBSETS_MCP_URL = "https://websetsmcp.exa.ai/mcp"; /** MCP tool definition from server */ export interface MCPTool { name: string; description: string; inputSchema: TSchema; } /** Tool wrapper config for dynamic MCP tool creation */ export interface MCPToolWrapperConfig { /** Our tool name (e.g., "exa_search") */ name: string; /** Display label for UI */ label: string; /** MCP tool name to call (e.g., "web_search_exa") */ mcpToolName: string; /** Whether this is a websets tool (uses different MCP endpoint) */ isWebsetsTool?: boolean; } /** MCP tools/list response */ export interface MCPToolsResponse { result?: { tools: MCPTool[]; }; error?: { code: number; message: string; }; } /** MCP tools/call response */ export interface MCPCallResponse { result?: { content?: Array<{ type: string; text?: string; }>; }; error?: { code: number; message: string; }; } /** Search result from Exa */ export interface ExaSearchResult { id?: string; title?: string; url?: string; author?: string; publishedDate?: string; text?: string; highlights?: string[]; image?: string; favicon?: string; } /** Search response from Exa */ export interface ExaSearchResponse { results?: ExaSearchResult[]; statuses?: Array<{ id: string; status: string; source?: string; }>; costDollars?: { total: number; }; searchTime?: number; requestId?: string; } /** Researcher task status */ export interface ResearcherStatus { id: string; status: "pending" | "running" | "completed" | "failed"; result?: string; error?: string; } /** Webset definition */ export interface Webset { id: string; name: string; description?: string; createdAt?: string; updatedAt?: string; } /** Webset item */ export interface WebsetItem { id: string; websetId: string; url: string; title?: string; content?: string; metadata?: Record; } /** Webset search */ export interface WebsetSearch { id: string; websetId: string; query: string; status: "pending" | "running" | "completed" | "cancelled"; resultCount?: number; } /** Webset enrichment */ export interface WebsetEnrichment { id: string; websetId: string; name: string; prompt: string; status: "pending" | "running" | "completed" | "cancelled"; } /** Tool name mappings: MCP name -> our tool name */ export declare const EXA_TOOL_MAPPINGS: { readonly web_search_exa: "exa_search"; readonly get_code_context_exa: "exa_search_code"; readonly crawling_exa: "exa_crawl"; readonly linkedin_search_exa: "exa_linkedin"; readonly company_research_exa: "exa_company"; readonly deep_researcher_start: "exa_researcher_start"; readonly deep_researcher_check: "exa_researcher_poll"; }; export declare const WEBSETS_TOOL_MAPPINGS: { readonly create_webset: "webset_create"; readonly list_websets: "webset_list"; readonly get_webset: "webset_get"; readonly update_webset: "webset_update"; readonly delete_webset: "webset_delete"; readonly list_webset_items: "webset_items_list"; readonly get_item: "webset_item_get"; readonly create_search: "webset_search_create"; readonly get_search: "webset_search_get"; readonly cancel_search: "webset_search_cancel"; readonly create_enrichment: "webset_enrichment_create"; readonly get_enrichment: "webset_enrichment_get"; readonly update_enrichment: "webset_enrichment_update"; readonly delete_enrichment: "webset_enrichment_delete"; readonly cancel_enrichment: "webset_enrichment_cancel"; readonly create_monitor: "webset_monitor_create"; }; export type ExaMcpToolName = keyof typeof EXA_TOOL_MAPPINGS; export type WebsetsMcpToolName = keyof typeof WEBSETS_TOOL_MAPPINGS; export type ExaToolName = (typeof EXA_TOOL_MAPPINGS)[ExaMcpToolName]; export type WebsetsToolName = (typeof WEBSETS_TOOL_MAPPINGS)[WebsetsMcpToolName]; /** Render details for TUI */ export interface ExaRenderDetails { response?: ExaSearchResponse; error?: string; toolName?: string; /** Raw result for non-search responses */ raw?: unknown; }