import { type MCPManagerApi } from "../mcp/manager.js"; import type { InternalResource, InternalUrl, ProtocolHandler, ResolveContext, SchemeSpec } from "./types.js"; export interface McpResourceReadOptions { /** Match advertised resource URIs only, never URI templates. */ exact?: boolean; /** * Cap, in ms, on waiting for still-connecting servers and their catalogs when no connected server * advertises the URI. Omitted: wait until that work settles, however long its reconnects take. */ waitMs?: number; signal?: AbortSignal; } /** * Read the MCP resource `url` names (see {@link extractResourceUri}) from the connected server that * advertises it. Undefined when no server does after pending connects and catalog loads settle. * That wait includes timeout-triggered reconnect ladders and never ends for a server with * `timeout: 0`, so speculative callers pass `waitMs`; an aborted `signal` also ends it early * (the work itself stays in flight for the manager). */ export declare function readMcpResource(mcpManager: MCPManagerApi, url: InternalUrl, options?: McpResourceReadOptions): Promise; /** No connected MCP server advertises the requested resource URI. */ export declare class McpResourceNotFoundError extends Error { constructor(message: string); } /** * Protocol handler for MCP resources. * * URL forms: * - mcp:// (e.g. mcp://test://notes, mcp://ibkr://portfolio/positions) * - A resource's native URI when its scheme has no OMP handler (e.g. ags://capabilities/current-host) */ export declare class McpProtocolHandler implements ProtocolHandler { readonly scheme = "mcp"; readonly spec: SchemeSpec; /** * Always advertised: the system prompt is built before MCP discovery settles * (`MCPManager.instance()` and its server set are populated asynchronously), * so there is no reliable synchronous "has servers" signal at prompt time. */ promptDoc(): string; resolve(url: InternalUrl, context?: ResolveContext): Promise; }