/** * Host-neutral portable tool definitions for pi-exa. * * Tools defined here are consumed by both the Pi adapter (extensions/index.ts) * and the MCP stdio server (extensions/mcp-server.ts). Files in this module * must not import from `@earendil-works/pi-coding-agent` or the MCP SDK. */ import { type PortableTool } from "@feniix/bridgekit"; import type { TObject } from "typebox"; import { type ResearchPlanner } from "./research-planner.js"; export interface ExaToolsOptions { /** Resolve the Exa API key at execute time. Return undefined when unconfigured. */ resolveApiKey?: () => string | undefined; /** Host-agnostic gating; tools whose names return false are omitted from the returned array. */ isToolEnabled?: (name: string) => boolean; /** Planner instance for the four exa_research_* tools. Defaults to a fresh createResearchPlanner(). */ planner?: ResearchPlanner; /** * Per-call timeout overrides in ms. Precedence: per-tool entry → `default` → * built-in per-tool default (60_000ms; 180_000ms for web_research_exa). * Resolved at execute time so config can change after construction. * * NB: exa-js does not yet accept AbortSignal (exa-labs/exa-js#158). The * timeout bounds the JS-side wait; the underlying HTTP request continues * until exa-js resolves it and Exa still bills for the call. */ timeouts?: ExaToolTimeouts; } /** Per-tool timeout overrides; all entries are optional positive integers (ms). */ export interface ExaToolTimeouts { default?: number; web_search_exa?: number; web_fetch_exa?: number; web_answer_exa?: number; web_find_similar_exa?: number; web_search_advanced_exa?: number; web_research_exa?: number; } /** Resolve the effective timeout for `toolName` given optional caller overrides. */ export declare function resolveExaToolTimeoutMs(toolName: string, timeouts?: ExaToolTimeouts): number; export declare function createExaTools(opts?: ExaToolsOptions): readonly PortableTool[];