import { type Config, type McpServerConfig } from '../../config/schema.js'; import { type McpConnectionProbe } from './connection-setup.js'; import type { McpTransportDiagnostics } from './transport.js'; export declare function mcpConfigRevision(value: unknown): string; export declare function getMcpConnectionCheck(server: McpServerConfig): { checkedAt?: string; toolCount?: number; } | undefined; export declare class McpDraftError extends Error { readonly status: 400 | 404 | 409 | 429 | 500; constructor(status: 400 | 404 | 409 | 429 | 500, message: string); } export type McpDraftInput = { serverId: string; sourceServerId?: string; expectedServer?: unknown; server: unknown; }; /** Unsaved configuration and OAuth state belong to one principal and never enter the live registry. */ export declare class McpConnectionDrafts { private readonly options; private readonly completed; private readonly drafts; constructor(options: { readConfig: () => Config; saveConfig: (config: Config, expectedConfig?: Config) => Promise<{ saved: boolean; error?: string; persisted?: boolean; conflict?: boolean; }>; }); create(owner: string, input: McpDraftInput, options?: { protectCredentials?: boolean; }): Promise<{ id: `${string}-${string}-${string}-${string}-${string}`; serverId: string; expiresAt: number; }>; /** Only internal callers may start from a Gateway-owned connector definition. */ createInstalled(owner: string, serverId: string, expectedServer: McpServerConfig, authentication: Pick): Promise<{ id: `${string}-${string}-${string}-${string}-${string}`; serverId: string; expiresAt: number; }>; private createDraft; probe(owner: string, id: string, diagnostics?: McpTransportDiagnostics): Promise; authorize(owner: string, id: string, options?: { callbackRelayUrl?: string; }): import("./connection-setup.js").McpAuthorization; authorization(owner: string, id: string): import("./connection-setup.js").McpAuthorization; redirect(owner: string, id: string, url: string): void; cancelAuthorization(owner: string, id: string): void; tools(owner: string, id: string): Promise; /** Caller serializes this with other Gateway config writes. Only this entry is merged into the latest config. */ commit(owner: string, id: string, enable?: boolean): Promise<{ reloadRequired?: boolean | undefined; serverId: string; }>; remove(owner: string, id: string): void; close(): void; private get; private assertIdle; private assertAvailable; private dispose; }