import type { AgentTool } from "@oh-my-pi/pi-agent-core";
export type DiscoverableToolSource = "builtin" | "mcp" | "extension" | "custom";
export interface DiscoverableTool {
    name: string;
    label: string;
    /** Short BM25 corpus entry; falls back to description first 200 chars */
    summary: string;
    source: DiscoverableToolSource;
    /** MCP only */
    serverName?: string;
    /** MCP only */
    mcpToolName?: string;
    schemaKeys: string[];
}
export interface DiscoverableToolServerSummary {
    name: string;
    toolCount: number;
}
export interface DiscoverableToolSummary {
    servers: DiscoverableToolServerSummary[];
    toolCount: number;
}
export interface DiscoverableToolSearchDocument {
    tool: DiscoverableTool;
    termFrequencies: Map<string, number>;
    length: number;
}
export interface DiscoverableToolSearchIndex {
    documents: DiscoverableToolSearchDocument[];
    averageLength: number;
    documentFrequencies: Map<string, number>;
}
export interface DiscoverableToolSearchResult {
    tool: DiscoverableTool;
    score: number;
}
export declare function isMCPToolName(name: string): boolean;
/**
 * Convert a raw AgentTool into a DiscoverableTool generic descriptor.
 * source: "mcp" if name starts with "mcp__", else "builtin" (caller may override).
 */
export declare function getDiscoverableTool(tool: AgentTool, overrides?: {
    source?: DiscoverableToolSource;
    summary?: string;
}): DiscoverableTool | null;
/** Collect all DiscoverableTools from a tool iterable. Skips tools that return null. */
export declare function collectDiscoverableTools(tools: Iterable<AgentTool>, options?: {
    source?: DiscoverableToolSource;
    summaryMap?: Map<string, string>;
}): DiscoverableTool[];
/** Filter discoverable tools by source */
export declare function filterBySource(tools: DiscoverableTool[], source: DiscoverableToolSource): DiscoverableTool[];
export declare function formatDiscoverableToolServerSummary(server: DiscoverableToolServerSummary): string;
export declare function selectDiscoverableToolNamesByServer(tools: Iterable<DiscoverableTool>, serverNames: ReadonlySet<string>): string[];
export declare function summarizeDiscoverableTools(tools: DiscoverableTool[]): DiscoverableToolSummary;
export declare function buildDiscoverableToolSearchIndex(tools: Iterable<DiscoverableTool>): DiscoverableToolSearchIndex;
export declare function searchDiscoverableTools(index: DiscoverableToolSearchIndex, query: string, limit: number): DiscoverableToolSearchResult[];
