import { type Variables } from "@modelcontextprotocol/client"; import { type CatalogTool } from "./catalog.js"; import { type CatalogPrompt } from "./prompts.js"; export type DiscoveryKind = "all" | "tools" | "resources" | "prompts"; export interface ResourceTarget { server: string; uri: string; } export interface TemplateTarget { server: string; template: string; arguments: Variables; } export declare function validTemplateRead(value: Record): boolean; export interface CompletionTarget { server: string; template: string; argument: { name: string; value: string; }; arguments?: Record; } export declare function validCompletion(value: unknown): value is CompletionTarget; export interface CatalogResource extends ResourceTarget { name: string; title?: string; description: string; mimeType?: string; size?: number; identity: string; variables?: string[]; } export type Candidate = (CatalogTool & { kind: "tool"; nextCall: { activate: string[]; }; }) | (CatalogResource & { kind: "resource"; nextCall: { read: ResourceTarget; }; }) | (CatalogResource & { kind: "template"; nextCall: { read: TemplateTarget; }; }) | (CatalogPrompt & { kind: "prompt"; command: string; }); /** URIs identify MCP resources; they are never fetched as URLs or opened as files. */ export declare function validResourceUri(value: unknown): value is string; export declare function prepareResource(server: string, identity: string, value: unknown): CatalogResource; export declare function prepareResourceTemplate(server: string, identity: string, value: unknown): CatalogResource; /** One ranked result set and one limit, with executable next steps but no resource bodies. */ export declare function searchCapabilities(tools: CatalogTool[], resources: CatalogResource[], query: string, server?: string, limit?: number, templates?: CatalogResource[], prompts?: CatalogPrompt[]): Candidate[];