import { ModelMessage, UserModelMessage, AssistantModelMessage, ToolModelMessage, StopCondition, ToolSet, TimeoutConfiguration, dynamicTool } from 'ai';
import * as _modelcontextprotocol_client from '@modelcontextprotocol/client';
import { Client, CallToolResult, ServerCapabilities, RequestOptions, LoggingLevel, ElicitResult } from '@modelcontextprotocol/client';
import { e as MCPClientManagerConfig, v as MCPClientManagerOptions, S as ServerSummary, f as MCPConnectionStatus, M as MCPServerConfig, N as ManagedMcpClient, O as ClientRequestOptions, L as ListToolsResult, p as Tool, A as AiSdkTool, E as ExecuteToolArguments, T as TaskOptions, t as ExecuteToolRequest, Q as ListResourcesParams, V as ReadResourceParams, W as SubscribeResourceParams, X as UnsubscribeResourceParams, Y as ListResourceTemplatesParams, Z as ListPromptsParams, _ as GetPromptParams, s as ElicitationHandler, q as ElicitationCallback } from './types-BJY6bi4K.js';
import { b as HostJson, e as HostStyleId, S as ServerId, H as HostConnectionDefaults, c as HostMcp, d as HostServerOverride, a as HostInit } from './public-types-c84qENXu.js';
import './mcp-protocol-version-cf74324S.js';

/**
 * Core types for SDK evals functionality
 */

type CoreMessage = ModelMessage;
type CoreUserMessage = UserModelMessage;
type CoreAssistantMessage = AssistantModelMessage;
type CoreToolMessage = ToolModelMessage;
/**
 * Built-in LLM providers with native SDK support
 */
type LLMProvider = "anthropic" | "openai" | "azure" | "deepseek" | "google" | "ollama" | "mistral" | "openrouter" | "xai";
/**
 * Compatible API protocols for custom providers
 */
type CompatibleProtocol = "openai-compatible" | "anthropic-compatible";
/**
 * Configuration for a custom provider (user-defined)
 */
interface CustomProvider {
    /** Unique name for this provider (used in model strings, e.g., "groq/llama-3") */
    name: string;
    /** API protocol this provider is compatible with */
    protocol: CompatibleProtocol;
    /** Base URL for the API endpoint */
    baseUrl: string;
    /** List of available model IDs */
    modelIds: string[];
    /** Optional API key (can also be provided at runtime) */
    apiKey?: string;
    /** Environment variable name to read API key from (fallback) */
    apiKeyEnvVar?: string;
    /**
     * Use Chat Completions API (.chat()) instead of default.
     * Required for some OpenAI-compatible providers like LiteLLM.
     * Only applies to openai-compatible protocol.
     */
    useChatCompletions?: boolean;
}
/**
 * Configuration for an LLM
 */
interface LLMConfig {
    provider: LLMProvider;
    model: string;
    apiKey: string;
}
/**
 * Represents a tool call made by the LLM
 */
interface ToolCall {
    toolName: string;
    arguments: Record<any, any>;
}
/**
 * Token usage statistics
 */
interface TokenUsage {
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
}
/**
 * Latency breakdown for prompt execution
 */
interface LatencyBreakdown {
    /** Total wall-clock time in milliseconds */
    e2eMs: number;
    /** LLM API time in milliseconds */
    llmMs: number;
    /** MCP tool execution time in milliseconds */
    mcpMs: number;
}
/**
 * Raw prompt result data (used internally)
 */
interface PromptResultData {
    /** The original prompt/query that was sent */
    prompt: string;
    /** The full conversation history (user, assistant, tool messages) */
    messages: ModelMessage[];
    text: string;
    toolCalls: ToolCall[];
    usage: TokenUsage;
    latency: LatencyBreakdown;
    error?: string;
    /** LLM provider name (e.g., "openai", "anthropic") */
    provider?: string;
    /** LLM model name (e.g., "gpt-4o", "claude-3-5-sonnet-20241022") */
    model?: string;
    /** Persisted widget snapshots captured during MCP App tool execution */
    widgetSnapshots?: EvalWidgetSnapshotInput[];
    /** Timeline spans for eval trace visualization (relative to prompt start) */
    spans?: EvalTraceSpanInput[];
}

/**
 * PromptResult class - wraps the result of a HostRunner prompt
 */

/**
 * Represents the result of a HostRunner prompt.
 * Provides convenient methods to inspect tool calls, token usage, and errors.
 */
declare class PromptResult {
    /** The original prompt/query that was sent */
    readonly prompt: string;
    /** The text response from the LLM */
    readonly text: string;
    /** The full conversation history */
    private readonly _messages;
    /** Latency breakdown (e2e, llm, mcp) */
    private readonly _latency;
    /** Tool calls made during the prompt */
    private readonly _toolCalls;
    /** Token usage statistics */
    private readonly _usage;
    /** Widget snapshots captured during tool execution */
    private readonly _widgetSnapshots;
    /** Error message if the prompt failed */
    private readonly _error?;
    /** LLM provider name (e.g., "openai", "anthropic") */
    private readonly _provider?;
    /** LLM model name (e.g., "gpt-4o", "claude-3-5-sonnet-20241022") */
    private readonly _model?;
    /** Timeline spans (times relative to prompt run start) */
    private readonly _spans;
    /**
     * Create a new PromptResult
     * @param data - The raw prompt result data
     */
    constructor(data: PromptResultData);
    /**
     * Get the original query/prompt that was sent.
     *
     * @returns The original prompt string
     */
    getPrompt(): string;
    /**
     * Get the full conversation history (user, assistant, tool messages).
     * Returns a copy to prevent external modification.
     *
     * @returns Array of CoreMessage objects
     */
    getMessages(): CoreMessage[];
    /**
     * Get only user messages from the conversation.
     *
     * @returns Array of CoreUserMessage objects
     */
    getUserMessages(): CoreUserMessage[];
    /**
     * Get only assistant messages from the conversation.
     *
     * @returns Array of CoreAssistantMessage objects
     */
    getAssistantMessages(): CoreAssistantMessage[];
    /**
     * Get only tool result messages from the conversation.
     *
     * @returns Array of CoreToolMessage objects
     */
    getToolMessages(): CoreToolMessage[];
    /**
     * Get the end-to-end latency in milliseconds.
     * This is the total wall-clock time for the prompt.
     *
     * @returns End-to-end latency in milliseconds
     */
    e2eLatencyMs(): number;
    /**
     * Get the LLM API latency in milliseconds.
     * This is the time spent waiting for LLM responses (excluding tool execution).
     *
     * @returns LLM latency in milliseconds
     */
    llmLatencyMs(): number;
    /**
     * Get the MCP tool execution latency in milliseconds.
     * This is the time spent executing MCP tools.
     *
     * @returns MCP tool latency in milliseconds
     */
    mcpLatencyMs(): number;
    /**
     * Get the full latency breakdown.
     *
     * @returns LatencyBreakdown object with e2eMs, llmMs, and mcpMs
     */
    getLatency(): LatencyBreakdown;
    /**
     * Get the names of all tools that were called during this prompt.
     * Returns a standard string[] that can be used with .includes().
     *
     * @returns Array of tool names
     */
    toolsCalled(): string[];
    /**
     * Check if a specific tool was called during this prompt.
     * Case-sensitive exact match.
     *
     * @param toolName - The name of the tool to check for
     * @returns true if the tool was called
     */
    hasToolCall(toolName: string): boolean;
    /**
     * Get all tool calls with their arguments.
     *
     * @returns Array of ToolCall objects
     */
    getToolCalls(): ToolCall[];
    /**
     * Get the arguments passed to a specific tool call.
     * Returns undefined if the tool was not called.
     * If the tool was called multiple times, returns the first call's arguments.
     *
     * @param toolName - The name of the tool
     * @returns The arguments object or undefined
     */
    getToolArguments(toolName: string): Record<string, unknown> | undefined;
    /**
     * Get the total number of tokens used.
     *
     * @returns Total tokens (input + output)
     */
    totalTokens(): number;
    /**
     * Get the number of input tokens used.
     *
     * @returns Input token count
     */
    inputTokens(): number;
    /**
     * Get the number of output tokens used.
     *
     * @returns Output token count
     */
    outputTokens(): number;
    /**
     * Get the full token usage statistics.
     *
     * @returns TokenUsage object
     */
    getUsage(): TokenUsage;
    /**
     * Get widget snapshots captured during tool execution.
     */
    getWidgetSnapshots(): EvalWidgetSnapshotInput[];
    /**
     * Timeline spans for this prompt (e.g. step / llm / tool / error), if captured.
     */
    getSpans(): EvalTraceSpanInput[];
    /**
     * Check if this prompt resulted in an error.
     *
     * @returns true if there was an error
     */
    hasError(): boolean;
    /**
     * Get the error message if the prompt failed.
     *
     * @returns The error message or undefined
     */
    getError(): string | undefined;
    /**
     * Get the LLM provider name.
     *
     * @returns The provider name or undefined
     */
    getProvider(): string | undefined;
    /**
     * Get the LLM model name.
     *
     * @returns The model name or undefined
     */
    getModel(): string | undefined;
    /**
     * Create a PromptResult from raw data.
     * Factory method for convenience.
     *
     * @param data - The raw prompt result data
     * @returns A new PromptResult instance
     */
    static from(data: PromptResultData): PromptResult;
    /**
     * Create an error PromptResult.
     * Factory method for error cases.
     *
     * @param error - The error message
     * @param latency - The latency breakdown or e2e time in milliseconds
     * @returns A new PromptResult instance with error state
     */
    static error(error: string, latency?: LatencyBreakdown | number, prompt?: string, metadata?: {
        provider?: string;
        model?: string;
        spans?: EvalTraceSpanInput[];
    }): PromptResult;
    /**
     * Format the conversation trace as a JSON string.
     * Useful for debugging failed evaluations.
     *
     * @returns A JSON string of the conversation messages
     */
    formatTrace(): string;
    /**
     * Convert this prompt result into an EvalResultInput for report ingestion.
     */
    toEvalResult(options?: Partial<Omit<EvalResultInput, "actualToolCalls" | "tokens" | "trace">> & {
        failOnToolError?: boolean;
    }): EvalResultInput;
}

/**
 * Options for the run() method
 */
interface PromptOptions {
    /** Previous PromptResult(s) to include as conversation context for multi-turn conversations */
    context?: PromptResult | PromptResult[];
    /** Optional abort signal for cancelling the prompt runtime. */
    abortSignal?: AbortSignal;
    /**
     * Additional stop conditions for the agentic loop.
     * Evaluated after each step completes (tools execute normally).
     * `stepCountIs(maxSteps)` is always applied as a safety guard
     * in addition to any conditions provided here.
     *
     * Import helpers like `hasToolCall` and `stepCountIs` from `"@mcpjam/sdk"`.
     *
     * @example
     * ```typescript
     * import { hasToolCall } from "@mcpjam/sdk";
     *
     * // Stop the loop after the step where "search_tasks" is called
     * const result = await executor.run("Find my tasks", {
     *   stopWhen: hasToolCall("search_tasks"),
     * });
     * expect(result.hasToolCall("search_tasks")).toBe(true);
     *
     * // Multiple conditions (any one being true stops the loop)
     * const result = await executor.run("Do something", {
     *   stopWhen: [hasToolCall("tool_a"), hasToolCall("tool_b")],
     * });
     * ```
     */
    stopWhen?: StopCondition<ToolSet> | Array<StopCondition<ToolSet>>;
    /**
     * Timeout for the prompt runtime.
     *
     * - `number`: total timeout for the entire prompt call in milliseconds
     * - `{ totalMs }`: total timeout across all steps
     * - `{ stepMs }`: timeout for each generation step
     * - `{ chunkMs }`: accepted for parity and primarily relevant to streaming APIs
     *
     * The runtime creates an internal abort signal. Tools can stop early if they
     * respect the `abortSignal` passed to `execute()`.
     */
    timeout?: TimeoutConfiguration;
    /** Shortcut for a total prompt timeout in milliseconds. */
    timeoutMs?: number;
    /**
     * Stop the prompt loop after the step where one of these tools is called and
     * short-circuit that tool execution with a stub result.
     */
    stopAfterToolCall?: string | string[];
}
/**
 * Minimal executor interface that eval tests run against. Implemented by
 * `HostRunner` (sync, tools pre-resolved) and `HostRuntime` (live binding
 * to a manager). Use `HostRunner.mock()` for deterministic tests without
 * an unsafe `as unknown as HostRunner` cast.
 */
interface HostExecutor {
    run(message: string, options?: PromptOptions): Promise<PromptResult>;
    withOptions(options: Record<string, any>): HostExecutor;
    getPromptHistory(): PromptResult[];
    resetPromptHistory(): void;
    /**
     * Returns the immutable `HostJson` snapshot driving this executor, if it
     * was constructed from a `Host`. Optional because callers can also build
     * an executor without supplying a `Host` (legacy explicit-config path).
     */
    getHostSnapshot?(): HostJson | undefined;
    /**
     * Returns replay configs for the executor's attached MCP servers.
     * Optional — `HostRunner` and `HostRuntime` expose it when their
     * underlying manager supports it, so SDK eval uploads can infer
     * replay configs without callers manually copying them into
     * `mcpjam.serverReplayConfigs`.
     */
    getServerReplayConfigs?(): MCPServerReplayConfig[] | undefined;
}

/**
 * `HostRuntime` — live binding of a `Host` to an `MCPClientManager`.
 *
 * `Host` is a pure, serializable spec; `HostRunner` is a sync executor with
 * tools pre-resolved. `HostRuntime` sits between them: it holds a live
 * `Host` reference plus a structural manager and, on every `.run(...)`,
 * snapshots the host, validates server ids against the manager, resolves
 * the active tool set, and delegates to a fresh `HostRunner` constructed
 * with that snapshot.
 *
 * Bundle safety: this module deliberately avoids static imports of
 * `HostRunner`, `ai`, or `MCPClientManager`. The runner is dynamically
 * imported inside `.run()` so the `host-config` browser bundle remains
 * free of the AI SDK and Node-only runtime dependencies.
 *
 * Stateless across turns: `.run()` calls do NOT auto-replay prior turns
 * into the next runner. Conversation continuity stays explicit through
 * `PromptOptions.context`. The runtime accumulates `PromptResult` history
 * for inspection/reporting only.
 */

/**
 * Structural shape of the AI SDK tool record returned by
 * `MCPClientManager.getToolsForAiSdk()`. Kept narrow so this module does
 * not import `ai` types.
 */
type AiSdkToolRecord = Record<string, unknown>;
/**
 * Structural shape of an MCP client manager from `HostRuntime`'s point of
 * view: server registry + tool resolution. Both `MCPClientManager` and
 * lightweight test fakes satisfy this without dragging the concrete class
 * into this bundle-safe module.
 */
type HostRuntimeManager = HostServerRegistry & {
    getToolsForAiSdk(serverIds?: string[] | string, options?: {
        includeAppOnly?: boolean;
        needsApproval?: boolean;
    }): Promise<AiSdkToolRecord>;
    /**
     * Optional. When the runtime is bound to a manager that exposes
     * replayable server configs (the concrete `MCPClientManager` does),
     * `HostRuntime.getServerReplayConfigs()` delegates here so SDK eval
     * uploads (`EvalTest`/`EvalSuite` -> `resolveServerReplayConfigs`) can
     * stamp them without callers manually copying configs into
     * `mcpjam.serverReplayConfigs`.
     */
    getServerReplayConfigs?(): MCPServerReplayConfig[] | undefined;
};
/**
 * Defaults bound at `HostRuntime` construction and applied to every `.run()`.
 *
 * `apiKey` is required because every `.run()` constructs a fresh `HostRunner`
 * and the runner requires it. The remaining fields override the corresponding
 * host-snapshot-derived values when set.
 */
interface HostRuntimeDefaults {
    apiKey: string;
    /** Overrides the host snapshot's model. */
    model?: string;
    /** Overrides the host snapshot's systemPrompt. */
    systemPrompt?: string;
    /** Overrides the host snapshot's temperature. */
    temperature?: number;
    maxSteps?: number;
    customProviders?: Map<string, CustomProvider> | Record<string, CustomProvider>;
    /** Overrides the host-config-resolved OpenAI compat decision. */
    injectOpenAiCompat?: boolean;
}
/**
 * Live binding of a `Host` to an `MCPClientManager`. Construct via
 * `host.withManager(manager, { apiKey })` or the explicit constructor.
 */
declare class HostRuntime implements HostExecutor {
    private readonly host;
    private readonly manager;
    private readonly defaults;
    private promptHistory;
    constructor(host: Host, manager: HostRuntimeManager, defaults: HostRuntimeDefaults);
    /**
     * Execute the host against `input`. Snapshots the live `Host` on every
     * call so mutations between `.run()` invocations are reflected.
     *
     * Stateless across turns: prior `PromptResult`s are recorded in
     * {@link getPromptHistory} for inspection but NOT auto-replayed.
     * Conversation continuity stays explicit — caller passes `context: r1`
     * via `options` for follow-up turns.
     */
    run(input: string, options?: PromptOptions): Promise<PromptResult>;
    /**
     * Return a new `HostRuntime` bound to the same `host` and `manager` with
     * `defaults` shallow-merged. The new runtime has its own (empty) prompt
     * history, matching `HostRunner.withOptions(...)` semantics.
     */
    withOptions(options: Partial<HostRuntimeDefaults> | Record<string, any>): HostRuntime;
    getPromptHistory(): PromptResult[];
    resetPromptHistory(): void;
    /**
     * Snapshot of the bound `Host` taken at call time. Useful for reporters
     * that want to stamp the current host config into per-iteration metadata.
     */
    getHostSnapshot(): HostJson;
    /**
     * Delegate to the bound manager so SDK eval uploads
     * (`EvalTest`/`EvalSuite` -> `resolveServerReplayConfigs`) can infer
     * replay configs from the runtime, matching the `HostRunner` shape.
     * Returns `undefined` when the manager doesn't expose
     * `getServerReplayConfigs` (custom structural managers).
     */
    getServerReplayConfigs(): MCPServerReplayConfig[] | undefined;
}

declare class Host {
    /**
     * Host style id (e.g. "mcpjam", "claude", "chatgpt"). **Required** at
     * `toJSON()` time — there is no SDK default, so an external agent author
     * who forgets to set it gets a loud error rather than silently inheriting
     * MCPJam product chrome on a Claude-style flow.
     *
     * Note: `style` is a **product knob**, not part of SEP-1865 / the MCP base
     * spec. It selects which host-style preset (chrome, default capabilities,
     * compat-runtime shims) the inspector applies.
     */
    style: HostStyleId;
    /**
     * LLM model id, e.g. `"anthropic/claude-sonnet-4-6"`. **Required** at
     * `toJSON()` time — no SDK default.
     */
    model: string;
    systemPrompt: string;
    temperature: number;
    requireToolApproval: boolean;
    /** Opt into progressive MCP tool discovery (search/load meta-tools). */
    progressiveToolDiscovery?: boolean;
    /**
     * SEP-1865 `_meta.ui.visibility` filtering. `undefined` → spec default
     * (filter); explicit `false` → show every tool (for hosts that don't
     * implement visibility).
     */
    respectToolVisibility?: boolean;
    /** Required servers. Mutable — `requireServer`/`removeRequiredServer` are sugar. */
    servers: ServerId[];
    /** Optional (auto-connect-if-available) servers. */
    optionalServers: ServerId[];
    connectionDefaults: HostConnectionDefaults;
    /**
     * MCP `ClientCapabilities` the inspector advertises in `initialize`.
     * Untyped (`Record<string, unknown>`) so future spec additions and host
     * extensions (SEP-1724) can be added without an SDK release. The MCP Apps
     * extension lives at `clientCapabilities.extensions["io.modelcontextprotocol/ui"]`.
     */
    clientCapabilities: Record<string, unknown>;
    /** SEP-1865 `HostContext` (theme, displayMode, …) advertised via `ui/initialize`. */
    hostContext: Record<string, unknown>;
    /**
     * Override the SEP-1865 MCP-Apps `hostCapabilities` blob the inspector
     * advertises in `ui/initialize`.
     *
     * Semantics: `undefined` = "use the host-style preset" (the inspector
     * picks a sensible default per style). `{}` = "advertise nothing"
     * (distinct from `undefined`; hashes distinctly). Use this to *cap* what
     * a host advertises — e.g. force `serverTools: undefined` to block widget
     * → server tool proxying for a hardened host.
     */
    hostCapabilitiesOverride?: Record<string, unknown>;
    /** Override the chat-UI surface (logo, fonts, …). `undefined` vs `{}` semantics match `hostCapabilitiesOverride`. */
    chatUiOverride?: Record<string, unknown>;
    /**
     * The host's MCP settings.
     *
     * Spec-aligned shape (`protocolVersion`, `initialize`, `apps`, `extensions`)
     * is **mutable in place** — assign or mutate any leaf directly:
     *
     * ```ts
     * host.mcp.protocolVersion = "2025-11-25";
     * host.mcp.initialize = { clientInfo: { name: "my-app", version: "1.0" } };
     * host.mcp.apps = { sandbox: { csp: { mode: "declared" } } };
     * ```
     *
     * The SEP-1865 sandbox knobs at `mcp.apps.sandbox.csp` / `.permissions` are
     * **host enforcement caps**, not capability grants to the widget. The
     * widget *declares* what it needs via its resource metadata; the host MAY
     * further restrict but MUST NOT loosen (`restrictTo` intersects the
     * declared set; `mode: "declared"` honors the declared set as-is).
     *
     * A "freshly constructed, untouched" `host.mcp` (all fields undefined)
     * collapses to no `mcpProfile` in canonical, so it hashes identically to
     * `host.mcp = undefined`.
     */
    mcp: HostMcp;
    /** Per-server connection overrides keyed by server id. */
    serverOverrides: Record<string, HostServerOverride>;
    constructor(init?: HostInit);
    setStyle(style: HostStyleId): this;
    setModel(model: string): this;
    setSystemPrompt(systemPrompt: string): this;
    setTemperature(temperature: number): this;
    setRequireToolApproval(require?: boolean): this;
    setProgressiveToolDiscovery(enabled: boolean): this;
    setRespectToolVisibility(respect: boolean): this;
    /**
     * Mark a server id as required for this host; no-op if `id` is already in
     * the list. Required ids must resolve to a known server at execution
     * time; see {@link assertHostServersKnown}.
     */
    requireServer(id: ServerId): this;
    /** Drop a required server id; no-op if absent. */
    removeRequiredServer(id: ServerId): this;
    /** Append an optional (auto-connect-if-available) server; deduped. */
    addOptionalServer(id: ServerId): this;
    removeOptionalServer(id: ServerId): this;
    /**
     * Replace the per-server override for `id`. Passing an empty `{}` is
     * preserved here but stripped from the canonical output (an override with
     * no fields adds no information).
     */
    setServerOverride(id: ServerId, override: HostServerOverride): this;
    removeServerOverride(id: ServerId): this;
    /**
     * Reset `mcp` to an empty object — equivalent to "use SDK defaults / no
     * host-level MCP profile." Collapses to no `mcpProfile` in canonical.
     */
    clearMcp(): this;
    /**
     * Throw a clear error if required fields (`style`, `model`) are still empty.
     * Called from `toJSON()` so the failure lands at the moment of use, not
     * deep inside the canonicalizer with a less obvious message.
     */
    private requireConfigured;
    /**
     * Build the internal canonicalizer input from the current public-shape
     * properties. Snapshotted (`structuredClone`) so the canonicalizer sees a
     * stable copy even if the caller is mid-mutation.
     */
    private toInternalInput;
    /**
     * Serialize to the normalized public `HostJson` shape (clean MCP
     * vocabulary — `mcp`, `servers`, `style`; no `mcpProfile`/`schemaVersion`).
     * Normalized and round-trippable: `new Host(host.toJSON())` reproduces an
     * equivalent host. Throws if the configuration is invalid (e.g.
     * `style`/`model` not set, a non-finite temperature, or a malformed MCP
     * profile).
     */
    toJSON(): HostJson;
    /**
     * Bind this `Host` to a live MCP client manager and return a `HostRuntime`
     * — the ergonomic execution surface for hosts.
     *
     * `defaults.apiKey` is required because every `.run()` constructs a fresh
     * runner internally. The remaining fields override host-snapshot-derived
     * values (model / systemPrompt / temperature / injectOpenAiCompat) per call.
     *
     * The runtime holds a live reference to this `Host`, so mutations made
     * between `.run()` invocations (e.g. `host.requireServer(...)`) are
     * reflected on the next run. `.run()` snapshots the host each time.
     */
    withManager(manager: HostRuntimeManager, defaults: HostRuntimeDefaults): HostRuntime;
    /**
     * One-shot convenience: bind a manager, run once, discard the runtime.
     *
     * Equivalent to `host.withManager(mcpClientManager, rest).run(input)`.
     * The throwaway runtime carries no prompt history across calls — each
     * `host.run(...)` starts fresh. For multi-turn or accumulating
     * inspection state, prefer `host.withManager(...)` and reuse the runtime.
     */
    run(input: string, runtime: HostRuntimeDefaults & {
        mcpClientManager: HostRuntimeManager;
    }): Promise<PromptResult>;
}
/**
 * Accepted shapes anywhere `HostRunner` / `HostRuntime` take a host:
 *
 * - `Host` — a live, mutable builder (snapshotted via `.toJSON()`).
 * - `HostInit` — the constructor-init shape (instantiated then snapshotted).
 * - `HostJson` — an already-snapshotted, immutable value (passed through).
 */
type HostSource = Host | HostInit | HostJson;
/**
 * Structural predicate for "is this already a `HostJson` snapshot?"
 *
 * Used by {@link snapshotHostSource} so callers that already snapshotted
 * (e.g. `HostRuntime.run()` calling `this.host.toJSON()` once per turn)
 * can pass the result straight through without double-snapshotting. Avoids
 * `instanceof Host` for the positive branch so a snapshot can safely cross
 * bundle / package boundaries.
 *
 * Explicitly rejects `Host` instances so a configured `Host` (whose
 * `style`/`model`/`servers` properties also satisfy the shape) takes the
 * `.toJSON()` path.
 */
declare function isHostJson(value: unknown): value is HostJson;
/**
 * Normalize any `HostSource` to an immutable `HostJson` snapshot. Idempotent:
 * an already-snapshotted `HostJson` is returned unchanged (same reference),
 * so `HostRunner` constructed with a pre-snapshotted host does NOT re-snapshot.
 */
declare function snapshotHostSource(host: HostSource): HostJson;
/**
 * Minimal structural shape for "something that knows which server ids exist
 * at runtime." Both `MCPClientManager` and lightweight test fakes satisfy
 * this without dragging the concrete class into the bundle-safe
 * `host-config` module.
 *
 * `listServers` is optional but enables a better error message when the
 * registry can enumerate its ids cheaply.
 */
type HostServerRegistry = {
    hasServer(id: string): boolean;
    listServers?(): string[];
};
/**
 * Validate that every required server id in `host.servers` exists in the
 * registry. Unknown required ids throw before tool resolution; unknown
 * `optionalServers` are silently skipped (they are "auto-connect-if-available"
 * by contract). A known server that returns zero tools is NOT a validation
 * failure — that's a legitimate tool-less server.
 */
declare function assertHostServersKnown(host: HostJson, registry: HostServerRegistry): void;
/**
 * Return the subset of `host.servers` + `host.optionalServers` that the
 * registry actually knows about. Caller is responsible for asserting
 * required ids first; this only filters.
 */
declare function resolveKnownServerIds(host: HostJson, registry: HostServerRegistry): string[];

/**
 * Eval tool-call matchers.
 *
 * This module is browser-safe and intentionally has no node-only deps so
 * it can be imported into client bundles via `@mcpjam/sdk/matchers`.
 *
 * `evaluateToolCalls` is a richer, configurable replacement for the
 * existing `matchToolCalls(expected: string[], actual: string[]): boolean`
 * in `./validators`. The simple boolean API in `./validators` stays
 * unchanged for SDK consumers that already depend on it.
 */

type EvalToolCall = ToolCall;
type EvalArgumentMismatch = {
    toolName: string;
    expectedArgs: Record<string, unknown>;
    actualArgs: Record<string, unknown>;
};
type EvalOutOfOrderToolCall = {
    toolName: string;
    expectedIndex: number;
    actualIndex: number;
};
type EvalMatchOptions = {
    /**
     * Trajectory pairing mode for actual vs. expected tool calls.
     *
     * `"ignore"` (default) — order-agnostic greedy pairing: for each expected
     * call in iteration order, the matcher consumes the earliest still-unmatched
     * actual call whose tool name + arguments are compatible. Out-of-order
     * pairings are never flagged.
     *
     * `"strict"` — index-aligned positional match. expected[i] is paired with
     * actual[i] if compatible; otherwise expected[i] is missing. Any extras
     * (j ≥ |expected| or mismatched at index j) are unconsumed actuals.
     *
     * `"superset"` — greedy left-to-right consume. The cursor walks forward
     * through actual once; for each expected call in iteration order, the
     * matcher advances the cursor until it finds a compatible actual call.
     * Useful for "the agent must perform these steps in order, but extra
     * unrelated steps interleaved are fine."
     */
    toolCallOrder?: "ignore" | "strict" | "superset";
    /**
     * Bound on extra actual tool calls beyond what was paired with expected.
     *
     * `null` (default) — extras allowed without bound (previous
     * `allowExtraToolCalls: true` behavior).
     *
     * `0` — strict, no extras allowed (previous `allowExtraToolCalls: false`).
     *
     * `N > 0` (must be a non-negative integer) — up to N extras allowed.
     *
     * Evaluated **independently** of `toolCallOrder`: extras = |actual| − |matched|.
     */
    maxExtraToolCalls?: number | null;
    /**
     * LEGACY: prefer `maxExtraToolCalls`. When present without
     * `maxExtraToolCalls`, the matcher entry shims `true → null`, `false → 0`.
     * Remove after v<NEXT_MINOR>.
     */
    allowExtraToolCalls?: boolean;
    /**
     * `"partial"` (default) — only expected keys are checked; actual may
     * carry extra keys; empty expected args match anything; placeholder
     * strings like `"string"`, `"number"`, `"any"` are interpreted as type
     * checks (matches current inspector behavior).
     *
     * `"exact"` — deep equality on the args object; no extras allowed; no
     * placeholders.
     *
     * `"ignore"` — args are not compared.
     */
    argumentMatching?: "exact" | "partial" | "ignore";
};
type EvalToolCallMatchResult = {
    missing: EvalToolCall[];
    extra: EvalToolCall[];
    outOfOrder: EvalOutOfOrderToolCall[];
    argumentMismatches: EvalArgumentMismatch[];
    passed: boolean;
};
/**
 * Canonical defaults for {@link EvalMatchOptions}. Exported so the
 * inspector server, client, and tests share a single source of truth
 * with `evaluateToolCalls` instead of redefining the same literals.
 *
 * `maxExtraToolCalls: null` preserves the previous `allowExtraToolCalls: true`
 * behavior: extras are reported in `extra[]` but never fail the test by
 * themselves.
 */
declare const MATCH_OPTIONS_DEFAULTS: Required<Omit<EvalMatchOptions, "allowExtraToolCalls">>;
/**
 * Merge match options from suite → case → run-override layers on top of
 * defaults. `undefined` fields inherit from the next layer; explicit
 * values win at their layer. Returns a fully-populated options object
 * suitable to snapshot or pass directly to `evaluateToolCalls`.
 *
 * Legacy `allowExtraToolCalls` on any layer is shimmed to
 * `maxExtraToolCalls` (`true → null`, `false → 0`). An explicit
 * `maxExtraToolCalls` on the same layer wins.
 */
declare function resolveMatchOptions(suite?: EvalMatchOptions, testCase?: EvalMatchOptions, runOverride?: EvalMatchOptions): Required<Omit<EvalMatchOptions, "allowExtraToolCalls">>;
/**
 * Evaluate actual tool calls against expected.
 *
 * Defaults preserve today's inspector behavior precisely:
 *   - `toolCallOrder: "ignore"` (order does not matter)
 *   - `maxExtraToolCalls: null` (extras reported but non-fatal)
 *   - `argumentMatching: "partial"` (placeholders, empty-expected matches
 *     anything, extras allowed on actual args)
 *
 * Pass `isNegativeTest: true` to flip the test: it then passes iff *no*
 * tool calls were made.
 */
declare function evaluateToolCalls(expected: EvalToolCall[], actual: EvalToolCall[], options?: EvalMatchOptions & {
    isNegativeTest?: boolean;
}): EvalToolCallMatchResult;

type EvalExpectedToolCall = {
    toolName: string;
    arguments?: Record<string, unknown>;
};
type EvalCiMetadata = {
    provider?: string;
    pipelineId?: string;
    jobId?: string;
    runUrl?: string;
    branch?: string;
    commitSha?: string;
};
type EvalTraceSpanCategory = "step" | "llm" | "tool" | "error";
type EvalTraceSpanStatus = "ok" | "error";
type EvalTraceSpanInput = {
    id: string;
    parentId?: string;
    name: string;
    category: EvalTraceSpanCategory;
    startMs: number;
    endMs: number;
    promptIndex?: number;
    stepIndex?: number;
    status?: EvalTraceSpanStatus;
    toolCallId?: string;
    toolName?: string;
    serverId?: string;
    modelId?: string;
    inputTokens?: number;
    outputTokens?: number;
    totalTokens?: number;
    messageStartIndex?: number;
    messageEndIndex?: number;
};
type EvalTraceInput = string | Array<{
    role: string;
    content: unknown;
}> | {
    messages?: Array<{
        role: string;
        content: unknown;
    }>;
    spans?: EvalTraceSpanInput[];
    prompts?: unknown[];
    raw?: unknown;
};
type EvalWidgetCsp = {
    connectDomains?: string[];
    resourceDomains?: string[];
    frameDomains?: string[];
    baseUriDomains?: string[];
};
type EvalWidgetPermissions = {
    camera?: Record<string, never>;
    microphone?: Record<string, never>;
    geolocation?: Record<string, never>;
    clipboardWrite?: Record<string, never>;
};
type EvalWidgetSnapshotInput = {
    toolCallId: string;
    toolName: string;
    protocol: "mcp-apps";
    serverId: string;
    resourceUri: string;
    toolMetadata: Record<string, unknown>;
    widgetCsp: EvalWidgetCsp | null;
    widgetPermissions: EvalWidgetPermissions | null;
    widgetPermissive: boolean;
    prefersBorder: boolean;
    widgetHtml?: string;
    widgetHtmlBlobId?: string;
    injectedOpenAiCompat?: boolean;
};
type EvalResultInput = {
    caseTitle: string;
    query?: string;
    passed: boolean;
    durationMs?: number;
    provider?: string;
    model?: string;
    expectedToolCalls?: EvalExpectedToolCall[];
    actualToolCalls?: EvalExpectedToolCall[];
    tokens?: {
        input?: number;
        output?: number;
        total?: number;
    };
    error?: string;
    errorDetails?: string;
    trace?: EvalTraceInput;
    externalIterationId?: string;
    externalCaseId?: string;
    metadata?: Record<string, string | number | boolean>;
    isNegativeTest?: boolean;
    advancedConfig?: Record<string, unknown>;
    widgetSnapshots?: EvalWidgetSnapshotInput[];
    /**
     * Per-result match options. When present, the inspector snapshots
     * these onto the appended iteration's `testCaseSnapshot.matchOptions`
     * so historical pass/fail computation honors them.
     */
    matchOptions?: EvalMatchOptions;
};
type MCPServerReplayConfig = {
    serverId: string;
    url: string;
    preferSSE?: boolean;
    accessToken?: string;
    refreshToken?: string;
    clientId?: string;
    clientSecret?: string;
};
type MCPJamReportingConfig = {
    enabled?: boolean;
    apiKey?: string;
    baseUrl?: string;
    serverNames?: string[];
    serverReplayConfigs?: MCPServerReplayConfig[];
    suiteName?: string;
    suiteDescription?: string;
    notes?: string;
    passCriteria?: {
        minimumPassRate: number;
    };
    strict?: boolean;
    /**
     * When not `false`, auto-reported results fail if the trace shows tool
     * execution errors. Default: strict tool outcomes (equivalent to `true`).
     */
    failOnToolError?: boolean;
    externalRunId?: string;
    framework?: string;
    ci?: EvalCiMetadata;
    expectedIterations?: number;
    tags?: string[];
    /**
     * Host configuration that drove this eval run. When provided, the
     * reporter computes a content-addressed hash internally and attaches it
     * to the upload so the backend can dedupe / link to a stored
     * `hostConfigsV2` row. The hash is never set by the caller — supply the
     * raw `Host` and let the SDK fingerprint it.
     *
     * Wire-level send (the `hostConfigHash` field on each `EvalResultInput`)
     * is implemented in a follow-up stage; in this SDK release the field is
     * accepted but not yet propagated to `/sdk/v1/evals/*` ingestion.
     */
    host?: Host;
};
type ReportEvalResultsInput = MCPJamReportingConfig & {
    suiteName: string;
    results: EvalResultInput[];
    agent?: {
        getServerReplayConfigs?: () => MCPServerReplayConfig[] | undefined;
    };
    mcpClientManager?: MCPClientManager;
};
type ReportEvalResultsOutput = {
    suiteId: string;
    runId: string;
    status: "completed" | "failed";
    result: "passed" | "failed";
    summary: {
        total: number;
        passed: number;
        failed: number;
        passRate: number;
    };
};

/**
 * Notification handler management for MCPClientManager
 */

type NotificationMethodName = Parameters<Client["setNotificationHandler"]>[0];
type NotificationHandler = Parameters<Client["setNotificationHandler"]>[1];

/**
 * Tool conversion utilities for integrating MCP tools with Vercel AI SDK
 */

/**
 * Input schema type for tool definitions
 */
type ToolInputSchema = Parameters<typeof dynamicTool>[0]["inputSchema"];
/**
 * Schema overrides for specific tools
 * Maps tool name to custom input schema definition
 */
type ToolSchemaOverrides = Record<string, {
    inputSchema: ToolInputSchema;
}>;
/**
 * Checks whether a tool is an MCP App by inspecting its _meta for a UI resource URI.
 *
 * @param toolMeta - The tool's _meta field from listTools result
 * @returns true if the tool is an MCP App
 */
declare function isMcpAppTool(toolMeta: Record<string, unknown> | undefined): boolean;
/**
 * Checks whether a tool is a ChatGPT App by inspecting its _meta for an output template.
 *
 * @param toolMeta - The tool's _meta field from listTools result
 * @returns true if the tool is a ChatGPT App
 */
declare function isChatGPTAppTool(toolMeta: Record<string, unknown> | undefined): boolean;

/**
 * Removes only the _meta field from a tool result (shallow copy).
 *
 * @param result - The full tool call result
 * @returns A shallow copy of the result without _meta
 */
declare function scrubMetaFromToolResult(result: CallToolResult): CallToolResult;
/**
 * Returns a shallow copy of a CallToolResult with _meta and structuredContent removed.
 *
 * @param result - The full tool call result
 * @returns A scrubbed shallow copy without _meta and structuredContent
 */
declare function scrubMetaAndStructuredContentFromToolResult(result: CallToolResult): CallToolResult;

/**
 * Manages multiple MCP server connections with support for tools, resources,
 * prompts, notifications, elicitation, and tasks.
 *
 * @example
 * ```typescript
 * const manager = new MCPClientManager({
 *   everything: {
 *     command: "npx",
 *     args: ["-y", "@modelcontextprotocol/server-everything"],
 *   },
 *   myServer: {
 *     url: "https://my-server.com/mcp",
 *     accessToken: "my-token",
 *   },
 * });
 *
 * const tools = await manager.listTools("everything");
 * const result = await manager.executeTool("everything", "add", { a: 1, b: 2 });
 * ```
 */
declare class MCPClientManager {
    private readonly registeredServers;
    private readonly liveClientStates;
    private readonly toolsMetadataCache;
    private readonly retryAbortControllers;
    private readonly unauthorizedRefreshInFlight;
    private readonly notificationManager;
    private readonly elicitationManager;
    private readonly defaultClientName;
    private readonly defaultClientVersion;
    /**
     * Extra `clientInfo` fields (e.g. `title`) merged into the per-connection
     * `clientInfo` object alongside name/version. Per-server `clientInfo`
     * overrides individual keys. Lets the inspector pass forward-compat MCP
     * spec additions (the `title` field, future fields) without an SDK bump.
     */
    private readonly defaultClientInfoExtras;
    /**
     * Default supported protocol versions accept-list. Forwarded to the
     * upstream Client as `ClientOptions.supportedProtocolVersions`. Per-
     * server `supportedProtocolVersions` overrides this. Undefined here
     * preserves historical behavior (upstream Client's built-in
     * `SUPPORTED_PROTOCOL_VERSIONS` default).
     */
    private readonly defaultSupportedProtocolVersions;
    private readonly defaultCapabilities;
    private readonly defaultTimeout;
    private readonly defaultLogJsonRpc;
    private readonly defaultRpcLogger?;
    private readonly defaultProgressHandler?;
    private readonly defaultRetryPolicy;
    private readonly lazyConnect;
    private progressTokenCounter;
    /**
     * Creates a new MCPClientManager.
     *
     * @param servers - Configuration map of server IDs to server configs
     * @param options - Global options for the manager
     */
    constructor(servers?: MCPClientManagerConfig, options?: MCPClientManagerOptions);
    /**
     * Lists all registered server IDs.
     */
    listServers(): string[];
    /**
     * Checks if a server is registered.
     */
    hasServer(serverId: string): boolean;
    /**
     * Gets summaries for all registered servers.
     */
    getServerSummaries(): ServerSummary[];
    /**
     * Gets replayable HTTP server configs for eval reporting.
     */
    getServerReplayConfigs(): MCPServerReplayConfig[];
    /**
     * Gets the connection status for a server.
     */
    getConnectionStatus(serverId: string): MCPConnectionStatus;
    /**
     * Gets the configuration for a server.
     */
    getServerConfig(serverId: string): MCPServerConfig | undefined;
    /**
     * Gets the capabilities reported by a server.
     */
    getServerCapabilities(serverId: string): ServerCapabilities | undefined;
    /**
     * Gets the underlying upstream MCP `Client` for a server. Returns the
     * legacy adapter's wrapped `Client` instance, or `undefined` for
     * stateless-preview connections (which have no upstream `Client`).
     *
     * **Deprecated for new code** — prefer `getManagedClient()`. Kept
     * because external SDK consumers reference this API; retyping it
     * would be a breaking change.
     */
    getClient(serverId: string): Client | undefined;
    /**
     * Gets the `ManagedMcpClient` for a server — works for both the legacy
     * adapter and the 2026-07-28 stateless preview. Use this in new
     * code instead of `getClient()`.
     */
    getManagedClient(serverId: string): ManagedMcpClient | undefined;
    /**
     * Gets initialization information for a connected server.
     */
    getInitializationInfo(serverId: string): {
        protocolVersion: string | undefined;
        transport: string;
        serverCapabilities: {
            experimental?: {
                [x: string]: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                };
            } | undefined;
            logging?: {
                [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
            } | undefined;
            completions?: {
                [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
            } | undefined;
            prompts?: {
                listChanged?: boolean | undefined;
            } | undefined;
            resources?: {
                subscribe?: boolean | undefined;
                listChanged?: boolean | undefined;
            } | undefined;
            tools?: {
                listChanged?: boolean | undefined;
            } | undefined;
            tasks?: {
                [x: string]: unknown;
                list?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
                cancel?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
                requests?: {
                    [x: string]: unknown;
                    tools?: {
                        [x: string]: unknown;
                        call?: {
                            [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                        } | undefined;
                    } | undefined;
                } | undefined;
            } | undefined;
            extensions?: {
                [x: string]: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                };
            } | undefined;
        } | undefined;
        serverVersion: {
            version: string;
            name: string;
            websiteUrl?: string | undefined;
            description?: string | undefined;
            icons?: {
                src: string;
                mimeType?: string | undefined;
                sizes?: string[] | undefined;
                theme?: "light" | "dark" | undefined;
            }[] | undefined;
            title?: string | undefined;
        } | undefined;
        instructions: string | undefined;
        clientCapabilities: Omit<{
            experimental?: {
                [x: string]: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                };
            } | undefined;
            sampling?: {
                context?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
                tools?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
            } | undefined;
            elicitation?: {
                [x: string]: string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null;
                } | (string | number | boolean | {
                    [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
                } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                form?: {
                    [x: string]: string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null;
                    } | (string | number | boolean | {
                        [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
                    } | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                    applyDefaults?: boolean | undefined;
                } | undefined;
                url?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
            } | undefined;
            roots?: {
                listChanged?: boolean | undefined;
            } | undefined;
            tasks?: {
                [x: string]: unknown;
                list?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
                cancel?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
                requests?: {
                    [x: string]: unknown;
                    sampling?: {
                        [x: string]: unknown;
                        createMessage?: {
                            [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                        } | undefined;
                    } | undefined;
                    elicitation?: {
                        [x: string]: unknown;
                        create?: {
                            [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                        } | undefined;
                    } | undefined;
                } | undefined;
            } | undefined;
            extensions?: {
                [x: string]: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                };
            } | undefined;
        }, "tasks"> & {
            tasks?: {
                [x: string]: unknown;
                list?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
                cancel?: {
                    [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                } | undefined;
                requests?: {
                    [x: string]: unknown;
                    sampling?: {
                        [x: string]: unknown;
                        createMessage?: {
                            [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                        } | undefined;
                    } | undefined;
                    elicitation?: {
                        [x: string]: unknown;
                        create?: {
                            [x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
                        } | undefined;
                    } | undefined;
                } | undefined;
            } & _modelcontextprotocol_client.TaskManagerOptions;
        };
    } | undefined;
    /**
     * Connects to an MCP server.
     *
     * @param serverId - Unique identifier for the server
     * @param config - Server configuration
     * @returns The connected MCP Client
     */
    connectToServer(serverId: string, config: MCPServerConfig): Promise<ManagedMcpClient>;
    /**
     * Disconnects from a server.
     */
    disconnectServer(serverId: string): Promise<void>;
    /**
     * Removes a server from the manager entirely.
     */
    removeServer(serverId: string): Promise<void>;
    /**
     * Disconnects from all servers.
     */
    disconnectAllServers(): Promise<void>;
    /**
     * Lists tools available from a server.
     */
    listTools(serverId: string, params?: Parameters<Client["listTools"]>[0], options?: ClientRequestOptions): Promise<ListToolsResult>;
    /**
     * Gets tools from multiple servers (or all servers if none specified).
     * Returns tools with execute functions pre-wired to call this manager.
     *
     * @param serverIds - Server IDs to get tools from (or all if omitted)
     * @returns Array of executable tools
     *
     * @example
     * ```typescript
     * const tools = await manager.getTools(["asana"]);
     * const agent = new HostRunner({ tools, model: "openai/gpt-4o", apiKey });
     * ```
     */
    getTools(serverIds?: string[]): Promise<Tool[]>;
    /**
     * Gets cached tool metadata for a server.
     */
    getAllToolsMetadata(serverId: string): Record<string, Record<string, any>>;
    /**
     * Gets cached metadata for a specific tool.
     * Metadata is populated when tools are listed via listTools()/getTools()/getToolsForAiSdk().
     */
    getToolMetadata(serverId: string, toolName: string): Record<string, unknown> | undefined;
    /**
     * Gets tools formatted for Vercel AI SDK.
     *
     * @param serverIds - Server IDs to get tools from (or all if omitted)
     * @param options - Schema options
     * @returns AiSdkTool compatible with Vercel AI SDK's generateText()
     */
    getToolsForAiSdk(serverIds?: string[] | string, options?: {
        schemas?: ToolSchemaOverrides | "automatic";
        needsApproval?: boolean;
        /**
         * When true, include SEP-1865 app-only tools (`_meta.ui.visibility = ["app"]`)
         * in the returned tool set. Defaults to `false` (spec-compliant: app-only
         * tools are hidden from the model). Use this only when intentionally
         * mirroring a host that does not implement visibility filtering.
         */
        includeAppOnly?: boolean;
    }): Promise<AiSdkTool>;
    /**
     * Executes a tool on a server.
     *
     * @param serverId - The server ID
     * @param toolName - The tool name
     * @param args - Tool arguments
     * @param options - Request options
     * @param taskOptions - Task options for async execution
     */
    executeTool(serverId: string, toolName: string, args?: ExecuteToolArguments, options?: ClientRequestOptions, taskOptions?: TaskOptions): Promise<CallToolResult | Record<string, unknown>>;
    executeTool(serverId: string, toolName: string, args: ExecuteToolArguments | undefined, options: ExecuteToolRequest): Promise<CallToolResult | Record<string, unknown>>;
    /**
     * Lists resources available from a server.
     */
    listResources(serverId: string, params?: ListResourcesParams, options?: ClientRequestOptions): Promise<{
        [x: string]: unknown;
        resources: {
            uri: string;
            name: string;
            description?: string | undefined;
            mimeType?: string | undefined;
            size?: number | undefined;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
            icons?: {
                src: string;
                mimeType?: string | undefined;
                sizes?: string[] | undefined;
                theme?: "light" | "dark" | undefined;
            }[] | undefined;
            title?: string | undefined;
        }[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
        nextCursor?: string | undefined;
    }>;
    /**
     * Reads a resource from a server.
     */
    readResource(serverId: string, params: ReadResourceParams, options?: ClientRequestOptions): Promise<{
        [x: string]: unknown;
        contents: ({
            uri: string;
            text: string;
            mimeType?: string | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        } | {
            uri: string;
            blob: string;
            mimeType?: string | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        })[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
    }>;
    /**
     * Subscribes to resource updates.
     */
    subscribeResource(serverId: string, params: SubscribeResourceParams, options?: ClientRequestOptions): Promise<{
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
    }>;
    /**
     * Unsubscribes from resource updates.
     */
    unsubscribeResource(serverId: string, params: UnsubscribeResourceParams, options?: ClientRequestOptions): Promise<{
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
    }>;
    /**
     * Lists resource templates from a server.
     */
    listResourceTemplates(serverId: string, params?: ListResourceTemplatesParams, options?: ClientRequestOptions): Promise<{
        [x: string]: unknown;
        resourceTemplates: {
            uriTemplate: string;
            name: string;
            description?: string | undefined;
            mimeType?: string | undefined;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
            icons?: {
                src: string;
                mimeType?: string | undefined;
                sizes?: string[] | undefined;
                theme?: "light" | "dark" | undefined;
            }[] | undefined;
            title?: string | undefined;
        }[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
        nextCursor?: string | undefined;
    }>;
    /**
     * Lists prompts available from a server.
     */
    listPrompts(serverId: string, params?: ListPromptsParams, options?: ClientRequestOptions): Promise<{
        [x: string]: unknown;
        prompts: {
            name: string;
            description?: string | undefined;
            arguments?: {
                name: string;
                description?: string | undefined;
                required?: boolean | undefined;
            }[] | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
            icons?: {
                src: string;
                mimeType?: string | undefined;
                sizes?: string[] | undefined;
                theme?: "light" | "dark" | undefined;
            }[] | undefined;
            title?: string | undefined;
        }[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
        nextCursor?: string | undefined;
    }>;
    /**
     * Gets a prompt from a server.
     */
    getPrompt(serverId: string, params: GetPromptParams, options?: ClientRequestOptions): Promise<{
        [x: string]: unknown;
        messages: {
            role: "user" | "assistant";
            content: {
                type: "text";
                text: string;
                annotations?: {
                    audience?: ("user" | "assistant")[] | undefined;
                    priority?: number | undefined;
                    lastModified?: string | undefined;
                } | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            } | {
                type: "image";
                data: string;
                mimeType: string;
                annotations?: {
                    audience?: ("user" | "assistant")[] | undefined;
                    priority?: number | undefined;
                    lastModified?: string | undefined;
                } | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            } | {
                type: "audio";
                data: string;
                mimeType: string;
                annotations?: {
                    audience?: ("user" | "assistant")[] | undefined;
                    priority?: number | undefined;
                    lastModified?: string | undefined;
                } | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            } | {
                uri: string;
                name: string;
                type: "resource_link";
                description?: string | undefined;
                mimeType?: string | undefined;
                size?: number | undefined;
                annotations?: {
                    audience?: ("user" | "assistant")[] | undefined;
                    priority?: number | undefined;
                    lastModified?: string | undefined;
                } | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
                icons?: {
                    src: string;
                    mimeType?: string | undefined;
                    sizes?: string[] | undefined;
                    theme?: "light" | "dark" | undefined;
                }[] | undefined;
                title?: string | undefined;
            } | {
                type: "resource";
                resource: {
                    uri: string;
                    text: string;
                    mimeType?: string | undefined;
                    _meta?: {
                        [x: string]: unknown;
                    } | undefined;
                } | {
                    uri: string;
                    blob: string;
                    mimeType?: string | undefined;
                    _meta?: {
                        [x: string]: unknown;
                    } | undefined;
                };
                annotations?: {
                    audience?: ("user" | "assistant")[] | undefined;
                    priority?: number | undefined;
                    lastModified?: string | undefined;
                } | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            };
        }[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
        description?: string | undefined;
    }>;
    /**
     * Pings a server to check connectivity.
     */
    pingServer(serverId: string, options?: RequestOptions): Promise<Awaited<ReturnType<Client["ping"]>>>;
    /**
     * Sets the logging level for a server.
     */
    setLoggingLevel(serverId: string, level?: LoggingLevel): Promise<void>;
    /**
     * Gets the session ID for a Streamable HTTP server.
     */
    getSessionIdByServer(serverId: string): string | undefined;
    /**
     * Adds a notification handler for a server.
     */
    addNotificationHandler(serverId: string, method: NotificationMethodName, handler: NotificationHandler): void;
    /**
     * Registers a handler for resource list changes.
     */
    onResourceListChanged(serverId: string, handler: NotificationHandler): void;
    /**
     * Registers a handler for resource updates.
     */
    onResourceUpdated(serverId: string, handler: NotificationHandler): void;
    /**
     * Registers a handler for prompt list changes.
     */
    onPromptListChanged(serverId: string, handler: NotificationHandler): void;
    /**
     * Registers a handler for task status changes.
     */
    onTaskStatusChanged(serverId: string, handler: NotificationHandler): void;
    /**
     * Sets a server-specific elicitation handler.
     */
    setElicitationHandler(serverId: string, handler: ElicitationHandler): void;
    /**
     * Clears a server-specific elicitation handler.
     */
    clearElicitationHandler(serverId: string): void;
    /**
     * Sets a global elicitation callback for all servers.
     */
    setElicitationCallback(callback: ElicitationCallback): void;
    /**
     * Clears the global elicitation callback.
     */
    clearElicitationCallback(): void;
    /**
     * Gets the pending elicitations map for external resolvers.
     */
    getPendingElicitations(): Map<string, {
        resolve: (value: ElicitResult) => void;
        reject: (error: unknown) => void;
    }>;
    /**
     * Responds to a pending elicitation.
     */
    respondToElicitation(requestId: string, response: ElicitResult): boolean;
    /**
     * Lists tasks from a server.
     */
    listTasks(serverId: string, cursor?: string, options?: ClientRequestOptions): Promise<{
        [x: string]: unknown;
        tasks: {
            taskId: string;
            status: "working" | "input_required" | "completed" | "failed" | "cancelled";
            ttl: number | null;
            createdAt: string;
            lastUpdatedAt: string;
            pollInterval?: number | undefined;
            statusMessage?: string | undefined;
        }[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
        nextCursor?: string | undefined;
    }>;
    /**
     * Gets a task by ID.
     */
    getTask(serverId: string, taskId: string, options?: ClientRequestOptions): Promise<{
        taskId: string;
        status: "working" | "input_required" | "completed" | "failed" | "cancelled";
        ttl: number | null;
        createdAt: string;
        lastUpdatedAt: string;
        pollInterval?: number | undefined;
        statusMessage?: string | undefined;
    }>;
    /**
     * Gets the result of a completed task.
     */
    getTaskResult(serverId: string, taskId: string, options?: ClientRequestOptions): Promise<unknown>;
    /**
     * Cancels a task.
     */
    cancelTask(serverId: string, taskId: string, options?: ClientRequestOptions): Promise<{
        taskId: string;
        status: "working" | "input_required" | "completed" | "failed" | "cancelled";
        ttl: number | null;
        createdAt: string;
        lastUpdatedAt: string;
        pollInterval?: number | undefined;
        statusMessage?: string | undefined;
    }>;
    /**
     * Checks if server supports task-augmented tool calls.
     */
    supportsTasksForToolCalls(serverId: string): boolean;
    /**
     * Checks if server supports listing tasks.
     */
    supportsTasksList(serverId: string): boolean;
    /**
     * Checks if server supports canceling tasks.
     */
    supportsTasksCancel(serverId: string): boolean;
    private registerServer;
    private connectToServerOnce;
    private performConnection;
    private connectViaStdio;
    private connectViaHttp;
    private safeCloseTransport;
    private getProcessEnvironment;
    private createStdioStderrDrain;
    private annotateStdioConnectError;
    private ensureConnected;
    private getClientOrThrow;
    private clearLiveState;
    private clearClosedPendingConnectionState;
    private destroyLiveState;
    private buildServerReplayConfig;
    private isHttpConfig;
    private extractReplayAccessToken;
    private hasReplayableRequestInit;
    private extractBearerAccessToken;
    private withTimeout;
    private withProgressHandler;
    private buildCapabilities;
    private hasNegotiatedElicitation;
    private resolveRpcLogger;
    private cacheToolsMetadata;
    private isStdioConfig;
    private isExecuteToolRequest;
    private normalizeExecuteToolRequest;
    private runRetryableReadOperation;
    private runRetriedOperation;
    private refreshAccessTokenAfterUnauthorized;
    private createRetrySignal;
    private abortRetrySignals;
    private throwIfAborted;
    private awaitWithAbort;
}

export { type HostRuntimeDefaults as A, type HostRuntimeManager as B, type CustomProvider as C, type HostServerRegistry as D, type EvalMatchOptions as E, type LLMConfig as F, type PromptResultData as G, Host as H, type TokenUsage as I, assertHostServersKnown as J, evaluateToolCalls as K, type LLMProvider as L, MCPClientManager as M, isChatGPTAppTool as N, isHostJson as O, type PromptOptions as P, isMcpAppTool as Q, type ReportEvalResultsInput as R, resolveKnownServerIds as S, type ToolCall as T, scrubMetaAndStructuredContentFromToolResult as U, scrubMetaFromToolResult as V, snapshotHostSource as W, MATCH_OPTIONS_DEFAULTS as X, resolveMatchOptions as Y, type EvalTraceInput as a, type CompatibleProtocol as b, type HostExecutor as c, type HostSource as d, PromptResult as e, type MCPServerReplayConfig as f, type LatencyBreakdown as g, type EvalExpectedToolCall as h, type MCPJamReportingConfig as i, type ReportEvalResultsOutput as j, type EvalResultInput as k, type EvalCiMetadata as l, type CoreAssistantMessage as m, type CoreMessage as n, type CoreToolMessage as o, type CoreUserMessage as p, type EvalArgumentMismatch as q, type EvalOutOfOrderToolCall as r, type EvalToolCall as s, type EvalToolCallMatchResult as t, type EvalTraceSpanCategory as u, type EvalTraceSpanInput as v, type EvalWidgetCsp as w, type EvalWidgetPermissions as x, type EvalWidgetSnapshotInput as y, HostRuntime as z };
