@onyxsecurity/mcp-gateway 2.1.39 → 2.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/mcp-gateway.js +2 -2
- package/dist/{cli-CmbQVMhl.js → cli-iLlbNqMw.js} +2 -2
- package/dist/cli-iLlbNqMw.js.map +1 -0
- package/dist/env-BYymL5qu.js +1 -0
- package/dist/env-DvKbtn5P.js +2 -0
- package/dist/env-DvKbtn5P.js.map +1 -0
- package/dist/{helpers-BrpBfS5F.js → helpers-BLNSu673.js} +4 -4
- package/dist/{helpers-BrpBfS5F.js.map → helpers-BLNSu673.js.map} +1 -1
- package/dist/index.d.ts +4 -9
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/logger-C9UQmiLF.js +5 -0
- package/dist/{logger-BKIQpGtw.js.map → logger-C9UQmiLF.js.map} +1 -1
- package/dist/main-Cw-GpTlP.js +6 -0
- package/dist/main-Cw-GpTlP.js.map +1 -0
- package/dist/normalizeUrl-DoppHGlo.js +64 -0
- package/dist/normalizeUrl-DoppHGlo.js.map +1 -0
- package/dist/oauthProvidersClient-BPHPTMIw.js +1 -0
- package/dist/{oauthProvidersClient-CSfC0nnU.js → oauthProvidersClient-DBwig3Kv.js} +2 -2
- package/dist/{oauthProvidersClient-CSfC0nnU.js.map → oauthProvidersClient-DBwig3Kv.js.map} +1 -1
- package/dist/{providers-BDjtjNUA.js → providers-ITwJPvLY.js} +2 -2
- package/dist/{providers-BDjtjNUA.js.map → providers-ITwJPvLY.js.map} +1 -1
- package/dist/transportDetection-di7mtGu9.js +136 -0
- package/dist/transportDetection-di7mtGu9.js.map +1 -0
- package/dist/upstreamNegotiation-DXOdQ605.js +15 -0
- package/dist/upstreamNegotiation-DXOdQ605.js.map +1 -0
- package/package.json +5 -2
- package/dist/cli-CmbQVMhl.js.map +0 -1
- package/dist/env-Bq3tPJX9.js +0 -2
- package/dist/env-Bq3tPJX9.js.map +0 -1
- package/dist/env-Bto2CEy8.js +0 -1
- package/dist/logger-BKIQpGtw.js +0 -5
- package/dist/main-DURKDydM.js +0 -6
- package/dist/main-DURKDydM.js.map +0 -1
- package/dist/normalizeUrl-BrUSzVK4.js +0 -31
- package/dist/normalizeUrl-BrUSzVK4.js.map +0 -1
- package/dist/oauthProvidersClient-DTav_fHE.js +0 -1
- package/dist/stdio-D3je2hIR.js +0 -31
- package/dist/stdio-D3je2hIR.js.map +0 -1
- package/dist/transportDetection-BW8OoLyM.js +0 -136
- package/dist/transportDetection-BW8OoLyM.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstreamNegotiation-DXOdQ605.js","names":["reason: string","url","systemInfo: null | typeof import(\"systeminformation\")","email","REDACTED","result: string[]","parsed: URL","config","scanResult: ScanResponse","scanRequest: ScanRequest","mirrorInstance: null | TrafficMirror","options: RequestOptions","scanResult: ScanResponse","requestResult: R | undefined","OAuthError","z.lazy","z.union","z.string","z.number","z.boolean","z.null","z.record","z.array","z.object","z.looseObject","z.literal","z.enum","z.intersection","z.preprocess","z.optional","z.unknown","z.iso.datetime","z.discriminatedUnion","ProtocolError","z.safeParse","z.toJSONSchema","z.email","z.url","z.iso.date","string","constants","If","env","http","Ajv","cacheKey","logger","date","addFormats","DefaultJsonSchemaValidator","config","Request","url","#body","#init","crypto","Http2ServerRequest2","h2constants","handleResponseError","chunks: Buffer[]","_endpoint: string","res: ServerResponse","randomUUID","parsedMessage: JSONRPCMessage","authInfo: AuthInfo | undefined","body: string | unknown","URL","bodyParts: Buffer[]","body: string","fixedHeaders: http.OutgoingHttpHeaders","transport: StreamableHTTPServerTransport","server: T","StreamableHTTPServerTransport","randomUUID","createServer","activeTransport:\n\t\t\t| {\n\t\t\t\t\tserver: T;\n\t\t\t\t\ttransport: StreamableHTTPServerTransport;\n\t\t\t }\n\t\t\t| undefined","activeTransport: SSEServerTransport | undefined","activeSSETransports: Record<string, SSEServerTransport>","activeStreamTransports: Record<\n\t\tstring,\n\t\t{\n\t\t\tserver: T;\n\t\t\ttransport: StreamableHTTPServerTransport;\n\t\t}\n\t>","process","rejection"],"sources":["../src/InMemoryEventStore.ts","../src/lib/errors.ts","../src/utils/getUserData.ts","../src/utils/redactCliArgs.ts","../src/utils/redactOnyxGuardUrl.ts","../src/lib/compress-client-info.ts","../src/lib/trafficMirror.ts","../src/proxyServer.ts","../node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs","../node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs","../node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs","../node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs","../node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs","../node_modules/@modelcontextprotocol/server/dist/index.mjs","../node_modules/@hono/node-server/dist/index.mjs","../node_modules/@modelcontextprotocol/node/dist/index.mjs","../src/legacySseServerTransport.ts","../src/startHTTPServer.ts","../node_modules/@modelcontextprotocol/server/dist/stdio.mjs","../src/lib/upstreamNegotiation.ts"],"sourcesContent":["/**\n * This is a copy of the InMemoryEventStore from the typescript-sdk\n * https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/shared/inMemoryEventStore.ts\n */\n\nimport type { EventStore, JSONRPCMessage } from \"@modelcontextprotocol/server\";\n\n/**\n * Simple in-memory implementation of the EventStore interface for resumability\n * This is primarily intended for examples and testing, not for production use\n * where a persistent storage solution would be more appropriate.\n */\nexport class InMemoryEventStore implements EventStore {\n private counter = 0;\n private events: Map<string, { message: JSONRPCMessage; streamId: string }> =\n new Map();\n\n /**\n * Replays events that occurred after a specific event ID\n * Implements EventStore.replayEventsAfter\n */\n async replayEventsAfter(\n lastEventId: string,\n {\n send,\n }: { send: (eventId: string, message: JSONRPCMessage) => Promise<void> },\n ): Promise<string> {\n if (!lastEventId || !this.events.has(lastEventId)) {\n return \"\";\n }\n\n // Extract the stream ID from the event ID\n const streamId = this.getStreamIdFromEventId(lastEventId);\n\n if (!streamId) {\n return \"\";\n }\n\n let foundLastEvent = false;\n\n // Sort events by eventId for chronological ordering\n const sortedEvents = [...this.events.entries()].sort((a, b) =>\n a[0].localeCompare(b[0]),\n );\n\n for (const [\n eventId,\n { message, streamId: eventStreamId },\n ] of sortedEvents) {\n // Only include events from the same stream\n if (eventStreamId !== streamId) {\n continue;\n }\n\n // Start sending events after we find the lastEventId\n if (eventId === lastEventId) {\n foundLastEvent = true;\n continue;\n }\n\n if (foundLastEvent) {\n await send(eventId, message);\n }\n }\n\n return streamId;\n }\n\n /**\n * Stores an event with a generated event ID\n * Implements EventStore.storeEvent\n */\n async storeEvent(streamId: string, message: JSONRPCMessage): Promise<string> {\n const eventId = this.generateEventId(streamId);\n\n this.events.set(eventId, { message, streamId });\n\n return eventId;\n }\n\n /**\n * Generates a unique event ID for a given stream ID.\n *\n * Includes a per-instance monotonic counter so the chronological ordering\n * established by `localeCompare` in `replayEventsAfter` holds even when\n * two events are stored within the same millisecond — `Date.now()` alone\n * is not enough resolution under load (was the source of intermittent\n * test failures under busy CI). Counter is zero-padded so lexicographic\n * comparison of the eventId string yields numeric ordering.\n */\n private generateEventId(streamId: string): string {\n const seq = (++this.counter).toString().padStart(12, \"0\");\n return `${streamId}_${Date.now()}_${seq}_${Math.random().toString(36).substring(2, 10)}`;\n }\n\n /**\n * Extracts the stream ID from an event ID.\n *\n * Event ID format from generateEventId: `{streamId}_{timestamp}_{seq}_{random}`.\n * The streamId itself can contain underscores (consumers pass arbitrary\n * strings), so a simple `split(\"_\")[0]` returns only the first segment of\n * a multi-part stream id and replayEventsAfter then silently skips that\n * stream's events. Reconstruct by dropping the LAST 3 segments instead —\n * those are always our own (timestamp, seq, random) appended in\n * generateEventId.\n */\n private getStreamIdFromEventId(eventId: string): string {\n const parts = eventId.split(\"_\");\n if (parts.length < 4) {\n return \"\";\n }\n return parts.slice(0, -3).join(\"_\");\n }\n}\n","export class TrackableError extends Error {\n extra: Record<string, unknown>;\n tags: Record<string, string>;\n\n constructor(name: string, message: string, tags: Record<string, string> = {}, extra: Record<string, unknown> = {}) {\n super(message);\n this.name = name;\n this.tags = tags;\n this.extra = extra;\n }\n}\n\nexport class AccessControlBlockError extends TrackableError {\n constructor(\n message: string,\n public readonly reason: string = \"access_denied\",\n extra: Record<string, unknown> = {}\n ) {\n super(\n \"AccessControlBlockError\",\n message,\n {\n feature: \"access_control\",\n module: \"security\",\n operation: \"block\",\n },\n {\n reason,\n ...extra,\n }\n );\n }\n}\n\nexport class ConfigurationError extends TrackableError {\n constructor(message: string, configKey?: string, extra: Record<string, unknown> = {}) {\n super(\n \"ConfigurationError\",\n message,\n {\n feature: \"configuration\",\n module: \"cli\",\n operation: \"validate\",\n },\n {\n configKey,\n ...extra,\n }\n );\n }\n}\n\nexport class HTTPServerError extends TrackableError {\n constructor(message: string, endpoint?: string, statusCode?: number, extra: Record<string, unknown> = {}) {\n super(\n \"HTTPServerError\",\n message,\n {\n feature: \"http\",\n module: \"server\",\n operation: \"request\",\n },\n {\n endpoint,\n statusCode,\n ...extra,\n }\n );\n }\n}\n\nexport class ProcessSpawnError extends TrackableError {\n constructor(message: string, command?: string, args?: string[], extra: Record<string, unknown> = {}) {\n super(\n \"ProcessSpawnError\",\n message,\n {\n feature: \"stdio\",\n module: \"transport\",\n operation: \"spawn\",\n },\n {\n // Don't log full args array to avoid potential secrets, just the count\n argCount: args?.length,\n command,\n ...extra,\n }\n );\n }\n}\n\n/**\n * The upstream and this gateway do not speak the same MCP protocol era, so no\n * session can be established. Distinct from ProxyConnectionError on purpose:\n * the server is reachable and healthy, it simply removed the `initialize`\n * handshake this gateway opens with. Retrying, falling back to another\n * transport, or re-authenticating cannot fix it — see lib/protocolEra.ts.\n */\nexport class ProtocolEraMismatchError extends TrackableError {\n constructor(message: string, url?: string, extra: Record<string, unknown> = {}) {\n super(\n \"ProtocolEraMismatchError\",\n message,\n {\n feature: \"protocol_era\",\n module: \"proxy\",\n operation: \"negotiate\",\n },\n {\n url: url\n ? (() => {\n try {\n return new URL(url).origin;\n } catch {\n return url;\n }\n })()\n : undefined,\n ...extra,\n }\n );\n }\n}\n\nexport class ProxyConnectionError extends TrackableError {\n constructor(message: string, url?: string, transport?: string, extra: Record<string, unknown> = {}, cause?: unknown) {\n super(\n \"ProxyConnectionError\",\n message,\n {\n feature: \"connection\",\n module: \"proxy\",\n operation: \"connect\",\n transport: transport || \"unknown\",\n },\n {\n url: url\n ? (() => {\n try {\n return new URL(url).origin;\n } catch {\n return url; // Return as-is if URL parsing fails\n }\n })()\n : undefined, // Sanitize URL to remove query params\n ...extra,\n }\n );\n // Preserve the original error so callers can classify the underlying\n // transport failure (errno via `.cause`) even after wrapping.\n if (cause !== undefined) {\n (this as { cause?: unknown }).cause = cause;\n }\n }\n}\n\nexport class TransportError extends TrackableError {\n constructor(\n message: string,\n transportType: \"sse\" | \"stdio\" | \"stream\" | \"unknown\" = \"unknown\",\n operation: string = \"unknown\",\n extra: Record<string, unknown> = {}\n ) {\n super(\n \"TransportError\",\n message,\n {\n feature: transportType,\n module: \"transport\",\n operation,\n },\n extra\n );\n }\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { homedir, hostname, userInfo } from \"node:os\";\nimport { join } from \"node:path\";\nimport psList from \"ps-list\";\n\nimport type { ProxyType } from \"../bin/main.js\";\n\nimport { config } from \"../config/env.js\";\n\nconst CLIENT_APP_NAME = config.clientAppName;\n\n// Lazy-loaded systeminformation module for device serial number\nlet systemInfo: null | typeof import(\"systeminformation\") = null;\nconst getSystemInfo = async () => {\n if (!systemInfo) {\n systemInfo = await import(\"systeminformation\");\n }\n return systemInfo;\n};\n\nexport interface RemoteSessionCliArgs extends SessionCliArgs {\n proxyType: \"remote\";\n url: string;\n}\n\nexport interface SessionCliArgs {\n proxyType: ProxyType;\n}\n\nexport interface SessionData {\n clientAppName?: string;\n // Containerization technology (\"docker\"; in future \"wsl\"), supplied by the\n // scanner/orchestrator via ONYX_CONTAINER_RUNTIME.\n containerRuntime?: string;\n deviceName?: string;\n deviceSerialNumber?: string;\n dockerContainerId?: string;\n dockerContainerName?: string;\n dockerImage?: string;\n dockerImageId?: string;\n email?: string;\n // ISO-8601 UTC time the tool-call/event completed. Set per scan request.\n eventEndTime?: string;\n gatewayVersion?: string;\n // Host-container provenance — set when this gateway runs INSIDE a container.\n // deviceName / systemSerialNumber carry the HOST's values (overridden from\n // ONYX_HOST_* env) so the session links to the host machine, while these say\n // which container it came from. Distinct from stdioCliArgs.dockerImageName,\n // which describes the MCP server's own image.\n inDockerContainer?: boolean;\n parentProcessId?: number;\n parentProcessName?: string;\n // ISO-8601 UTC start time of the parent process (best-effort; may be absent).\n parentProcessStartTime?: string;\n processId?: number;\n // ISO-8601 UTC start time of the gateway's own process.\n processStartTime?: string;\n proxyType: ProxyType;\n remoteCliArgs?: RemoteSessionCliArgs;\n // PID + ISO-8601 UTC start time of the stdio MCP server child the gateway\n // spawned. Absent for remote proxies (no spawned child). On win32 with\n // shell:true the pid is the cmd wrapper the server runs under — still the\n // direct child the OS process tree shows between the gateway and the server.\n spawnedServerProcessId?: number;\n spawnedServerProcessStartTime?: string;\n stdioCliArgs?: StdioSessionCliArgs;\n systemSerialNumber?: string;\n username?: string;\n}\n\nexport interface StdioSessionCliArgs extends SessionCliArgs {\n args: string[];\n command: string;\n /**\n * The Docker image digests (sha256 hashes of the manifest) if the command is running a container MCP.\n * These are consistent across registries and uniquely identify specific image versions.\n * An image may have multiple digests if it exists in multiple registries.\n * Only populated for container run commands (docker, podman, nerdctl, finch).\n */\n dockerImageDigests?: string[];\n /**\n * The Docker image name/tag if the command is running a container MCP.\n * Only populated for container run commands (docker, podman, nerdctl, finch).\n */\n dockerImageName?: string;\n proxyType: \"stdio\";\n}\n\n/**\n * When this gateway runs inside a container started with the host's identity\n * env (the same ONYX_DOCKER_* / ONYX_HOST_* contract the scanner uses),\n * rewrite the session to link back to the host machine and record which\n * container it came from. No-op when running directly on a host.\n */\ninterface PersistedDockerContext {\n container_id?: string;\n container_name?: string;\n host_device_name?: string;\n host_serial_number?: string;\n image?: string;\n image_id?: string;\n}\n\n/**\n * Check if an email string is valid (non-empty and contains @).\n * Matches the scanner's email.IsValid() logic.\n */\nexport function isValidEmail(email: null | string | undefined): email is string {\n return typeof email === \"string\" && email !== \"\" && email.includes(\"@\");\n}\n\n/**\n * Read email from ~/.gitconfig [user] section.\n * Matches the scanner's email.ExtractFromGitConfig() logic.\n */\nexport function readGitConfigEmail(): null | string {\n try {\n const configPath = getGitConfigPath();\n\n if (!existsSync(configPath)) {\n return null;\n }\n\n const content = readFileSync(configPath, \"utf-8\");\n\n // Parse INI-style gitconfig to extract [user] email\n // Matches the scanner's ini.Load() + Section(\"user\").Key(\"email\") approach\n let inUserSection = false;\n for (const rawLine of content.split(\"\\n\")) {\n const line = rawLine.trim();\n\n // Skip comment-only lines (# and ; are comment characters in gitconfig)\n if (line.startsWith(\"#\") || line.startsWith(\";\")) {\n continue;\n }\n\n if (line.startsWith(\"[\")) {\n inUserSection = line.toLowerCase() === \"[user]\";\n continue;\n }\n if (inUserSection) {\n const match = line.match(/^email\\s*=\\s*(.+)/i);\n if (match) {\n // Strip inline comments (# or ;) — matches gopkg.in/ini.v1 behavior\n const value = match[1].replace(/\\s+[#;].*$/, \"\").trim();\n return value || null;\n }\n }\n }\n\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * Get the cross-platform path to the Claude configuration file\n */\nfunction getClaudeConfigPath(): string {\n return join(homedir(), \".claude.json\");\n}\n\n/**\n * Get the cross-platform path to the Codex auth file\n */\nfunction getCodexAuthPath(): string {\n return join(homedir(), \".codex\", \"auth.json\");\n}\n\n/**\n * Get the device name using Node.js hostname\n */\nfunction getDeviceName(): string {\n try {\n return hostname();\n } catch {\n // Fallback to a default value if hostname() fails\n return \"unknown-device\";\n }\n}\n\n/**\n * Get the cross-platform path to the Git config file\n */\nfunction getGitConfigPath(): string {\n return join(homedir(), \".gitconfig\");\n}\n\n/**\n * Get the parent process name by PID\n */\nasync function getParentProcessName(parentPid: number): Promise<string> {\n try {\n const processes = await psList();\n const parentProcess = processes.find((p) => p.pid === parentPid);\n return parentProcess?.name || \"unknown\";\n } catch {\n return \"unknown\";\n }\n}\n\n/**\n * Resolved start times, memoized per pid — including the in-flight promise, so\n * concurrent callers share one enumeration instead of racing two.\n *\n * si.processes() walks the entire process table (a WMIC/PowerShell shell-out on\n * Windows, a full ps elsewhere) and getSessionData is awaited before the upstream\n * MCP server connects, so it sits on the startup critical path — and it is\n * assembled a second time when access control is configured. A process's start\n * time is immutable, so caching makes every repeat assembly free.\n */\nconst parentProcessStartTimeCache = new Map<number, Promise<string | undefined>>();\n\n/**\n * Best-effort ISO-8601 UTC start time of the parent process, looked up by PID via\n * systeminformation (ps-list carries no start field). Returns undefined on any\n * failure — the backend treats an absent value as an older payload.\n */\nasync function getParentProcessStartTime(parentPid: number): Promise<string | undefined> {\n const cached = parentProcessStartTimeCache.get(parentPid);\n if (cached) {\n return cached;\n }\n const lookup = (async (): Promise<string | undefined> => {\n try {\n const si = await getSystemInfo();\n const { list } = await si.processes();\n const started = list.find((p) => p.pid === parentPid)?.started;\n if (started) {\n const parsed = new Date(started);\n if (!Number.isNaN(parsed.getTime())) {\n return parsed.toISOString();\n }\n }\n return undefined;\n } catch {\n return undefined;\n }\n })();\n parentProcessStartTimeCache.set(parentPid, lookup);\n return lookup;\n}\n\n/**\n * ISO-8601 UTC start time of the gateway's own process, derived from Node's\n * process uptime (no systeminformation lookup needed for self).\n */\nfunction getProcessStartTime(): string {\n return new Date(Date.now() - Math.round(process.uptime() * 1000)).toISOString();\n}\n\n/**\n * Get the system serial number using systeminformation library.\n * Works cross-platform (macOS, Windows, Linux) without spawning shell commands.\n */\nasync function getSystemSerialNumber(): Promise<string | undefined> {\n try {\n const si = await getSystemInfo();\n const systemData = await si.system();\n const serial = systemData.serial;\n // Filter out empty, default, or placeholder values\n if (serial && serial !== \"\" && serial !== \"0\" && !serial.toLowerCase().includes(\"to be filled\")) {\n return serial;\n }\n return undefined;\n } catch {\n // Silently handle errors\n return undefined;\n }\n}\n\nfunction getUserEmail(): string | undefined {\n try {\n // Try Claude config first\n const claudeConfig = readClaudeConfig();\n const claudeEmail = claudeConfig?.oauthAccount?.emailAddress;\n if (isValidEmail(claudeEmail)) {\n return claudeEmail;\n }\n\n // Try Codex config\n const codexEmail = readCodexEmail();\n if (isValidEmail(codexEmail)) {\n return codexEmail;\n }\n\n // Fall back to Git config.\n //\n // This chain is a FALLBACK, not the gateway's identity answer, and it is\n // deliberately NOT kept in step with the scanner's. The backend attributes a\n // gateway session by looking up the desktop_agent_user row for this machine +\n // OS user and taking the employee the scan already resolved against the\n // tenant's org domains (ADR 0061). Whatever this returns is used only when no\n // scan has reached the machine yet.\n //\n // So do not add a Windows/Entra step here to \"re-converge\" the two chains:\n // ranking addresses needs the tenant's org domains, which no endpoint has\n // (ADR 0052), and a second resolver here is the drift this design removed.\n const gitEmail = readGitConfigEmail();\n if (isValidEmail(gitEmail)) {\n return gitEmail;\n }\n\n return undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Get the current username\n * Priority: userInfo().username -> environment variables (USER, USERNAME, LOGNAME)\n */\nfunction getUsername(): string | undefined {\n try {\n // Try Node.js userInfo() first\n const info = userInfo();\n if (info.username) {\n return info.username;\n }\n // If userInfo() succeeds but username is empty, fall through to catch\n throw new Error(\"userInfo() returned empty username\");\n } catch {\n // Fallback to environment variables\n return process.env.USER || process.env.USERNAME || process.env.LOGNAME;\n }\n}\n\n/**\n * Safely read and parse the Claude configuration file\n */\nfunction readClaudeConfig(): { oauthAccount: { emailAddress: string } } | null {\n try {\n const configPath = getClaudeConfigPath();\n\n if (!existsSync(configPath)) {\n return null;\n }\n\n const configContent = readFileSync(configPath, \"utf-8\");\n const config = JSON.parse(configContent);\n\n return config;\n } catch {\n // Silently handle errors (file not readable, invalid JSON, etc.)\n return null;\n }\n}\n\n/**\n * Read email from Codex auth.json by parsing the JWT id_token\n */\nfunction readCodexEmail(): null | string {\n try {\n const authPath = getCodexAuthPath();\n\n if (!existsSync(authPath)) {\n return null;\n }\n\n const authContent = readFileSync(authPath, \"utf-8\");\n const auth = JSON.parse(authContent) as { tokens?: { id_token?: string } };\n\n const idToken = auth?.tokens?.id_token;\n if (!idToken) {\n return null;\n }\n\n // Parse JWT token to extract email from payload\n // JWT format: header.payload.signature (base64url encoded)\n const parts = idToken.split(\".\");\n if (parts.length !== 3) {\n return null;\n }\n\n // Decode the payload (second part) - JWT uses base64url encoding\n const payload = Buffer.from(parts[1], \"base64url\").toString(\"utf-8\");\n const jwtPayload = JSON.parse(payload) as { email?: string };\n\n return jwtPayload.email || null;\n } catch {\n // Silently handle errors (file not readable, invalid JSON, invalid JWT, etc.)\n return null;\n }\n}\n\n/**\n * Recover the host+container identity that the scanner persisted to\n * ~/.onyx/container-context.json (mirror of scanner/internal/dockercontext).\n * Needed because the gateway is normally spawned by the agent INSIDE the\n * container as a plain child process — so the ONYX_DOCKER_* env the scanner\n * sets on its own docker-exec'd processes is absent, and without this fallback\n * the gateway would report the container hostname / no serial and never link to\n * the per-container asset. Liveness-gated on /.dockerenv so a bind-mounted host\n * home can't leak a container's identity into host-side gateway runs.\n */\nconst loadPersistedDockerContext = (): null | PersistedDockerContext => {\n if (!existsSync(\"/.dockerenv\")) {\n return null;\n }\n try {\n const raw = readFileSync(join(homedir(), \".onyx\", \"container-context.json\"), \"utf8\");\n const ctx = JSON.parse(raw) as PersistedDockerContext;\n return ctx.container_id ? ctx : null;\n } catch {\n return null;\n }\n};\n\nexport const applyDockerContext = (data: Omit<SessionData, \"proxyType\">): Omit<SessionData, \"proxyType\"> => {\n // Prefer the live env (scanner docker-exec), then the persisted file\n // (agent-spawned gateway, no env). No-op on a host.\n const envId = process.env.ONYX_DOCKER_CONTAINER_ID;\n const file = envId ? null : loadPersistedDockerContext();\n const containerId = envId || file?.container_id;\n if (!containerId) {\n return data;\n }\n return {\n ...data,\n // Runtime declared by the orchestrator (docker today). Not defaulted — left\n // undefined if absent so the backend omits it.\n containerRuntime: process.env.ONYX_CONTAINER_RUNTIME || undefined,\n deviceName: process.env.ONYX_HOST_DEVICE_NAME || file?.host_device_name || data.deviceName,\n dockerContainerId: containerId,\n dockerContainerName: process.env.ONYX_DOCKER_CONTAINER_NAME || file?.container_name || undefined,\n dockerImage: process.env.ONYX_DOCKER_IMAGE || file?.image || undefined,\n dockerImageId: process.env.ONYX_DOCKER_IMAGE_ID || file?.image_id || undefined,\n inDockerContainer: true,\n systemSerialNumber: process.env.ONYX_HOST_SERIAL_NUMBER || file?.host_serial_number || data.systemSerialNumber,\n };\n};\n\n/**\n * Retrieve user data including email from ~/.claude.json and device name\n */\nexport const getSessionData = async (): Promise<Omit<SessionData, \"proxyType\">> => {\n const processId = process.pid;\n const parentProcessId = process.ppid;\n const processStartTime = getProcessStartTime();\n try {\n const deviceName = getDeviceName();\n const [systemSerialNumber, parentProcessName, parentProcessStartTime] = await Promise.all([\n getSystemSerialNumber(),\n getParentProcessName(parentProcessId),\n getParentProcessStartTime(parentProcessId),\n ]);\n const email = getUserEmail();\n const username = getUsername();\n\n return applyDockerContext({\n clientAppName: CLIENT_APP_NAME || \"unknown\",\n deviceName,\n email,\n gatewayVersion: config.appVersion,\n parentProcessId,\n parentProcessName,\n parentProcessStartTime,\n processId,\n processStartTime,\n systemSerialNumber,\n username,\n });\n } catch {\n return applyDockerContext({\n clientAppName: CLIENT_APP_NAME || \"unknown\",\n deviceName: \"unknown-device\",\n email: undefined,\n gatewayVersion: config.appVersion,\n parentProcessId,\n parentProcessName: \"unknown\",\n processId,\n processStartTime,\n systemSerialNumber: undefined,\n username: undefined,\n });\n }\n};\n","const REDACTED = \"[REDACTED]\";\n\n// Flags whose next argument (or =value) carries sensitive data.\n// Matched case-insensitively after stripping leading dashes. Kept in sync\n// with backend/pkg/secrets/sanitizer.go::sensitiveCLIFlags so backend audit\n// and gateway logs apply the same allowlist.\n//\n// Lowercase \"h\" is intentionally NOT in this set — it collides with `-h` /\n// `--help` and `docker run -h <hostname>`, producing false-positive\n// redactions in audit logs. Uppercase `-H` (the curl header convention) is\n// matched explicitly below as a case-sensitive carve-out.\nconst SENSITIVE_FLAGS = new Set([\n\t\"api_key\",\n\t\"api-key\",\n\t\"apikey\",\n\t\"authorization\",\n\t\"bearer\",\n\t\"credential\",\n\t\"credentials\",\n\t\"header\",\n\t\"headers\",\n\t\"key\",\n\t\"pass\", // covers `--pass <value>` form (mysql / redis / etc.)\n\t\"passwd\",\n\t\"password\",\n\t\"pwd\", // some agents abbreviate the password flag this way\n\t\"secret\",\n\t\"token\",\n]);\n\n/**\n * Redact values following sensitive CLI flags.\n *\n * Flags like --header, --token, --api-key signal that the next arg (or the\n * part after `=`) is sensitive. Returns a NEW array with sensitive values\n * replaced by [REDACTED]; the input is never mutated.\n *\n * Defense-in-depth for gateway log sinks — gitleaks-pattern scanning misses\n * generic bearer tokens / API keys without recognizable prefixes.\n */\nexport function redactCliArgs(args: readonly string[]): string[] {\n\tconst result: string[] = [];\n\tlet redactNext = false;\n\n\tfor (const arg of args) {\n\t\tif (redactNext) {\n\t\t\tresult.push(REDACTED);\n\t\t\tredactNext = false;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// `-H<value>` combined-short-flag form (curl idiom that surfaces in\n\t\t// real MCP server `args`, e.g. `[\"-HAuthorization: Bearer …\"]`).\n\t\t// `-H` is the only short flag we treat case-sensitively, so it's\n\t\t// also the only one with a meaningful glued form — `-hhost` for\n\t\t// docker is a hostname, not a header.\n\t\t//\n\t\t// The `arg[2] !== \"=\"` guard keeps `-H=value` out of this branch so\n\t\t// the equals-form branch below handles it as `-H=[REDACTED]`,\n\t\t// matching Go's check order. Cursor[bot] caught this divergence\n\t\t// (bug 9bdd875a-d725-4ba2-9678-5fdab52c8309).\n\t\tif (\n\t\t\targ.startsWith(\"-H\") &&\n\t\t\targ.length > 2 &&\n\t\t\t!arg.startsWith(\"--\") &&\n\t\t\targ[2] !== \"=\"\n\t\t) {\n\t\t\tresult.push(\"-H\" + REDACTED);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst flagName = extractFlagName(arg);\n\n\t\tif (flagName !== null && isSensitiveFlag(flagName)) {\n\t\t\tif (arg.includes(\"=\")) {\n\t\t\t\t// --flag=value form: redact only the value portion.\n\t\t\t\tconst eqIdx = arg.indexOf(\"=\");\n\t\t\t\tresult.push(arg.slice(0, eqIdx + 1) + REDACTED);\n\t\t\t} else {\n\t\t\t\t// --flag <value> form: push flag, mark next for redaction.\n\t\t\t\tresult.push(arg);\n\t\t\t\tredactNext = true;\n\t\t\t}\n\t\t} else {\n\t\t\tresult.push(arg);\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns the flag name from a CLI arg after stripping leading dashes, or\n * null if the arg is not a flag (doesn't start with `-`). For `--flag=value`\n * only the portion before `=` is returned.\n */\nfunction extractFlagName(arg: string): null | string {\n\tif (!arg.startsWith(\"-\")) return null;\n\tconst stripped = arg.replace(/^-{1,2}/, \"\");\n\tconst eqIdx = stripped.indexOf(\"=\");\n\treturn eqIdx >= 0 ? stripped.slice(0, eqIdx) : stripped;\n}\n\n/**\n * Returns true if flagName names a sensitive flag. Uppercase `H` matches\n * case-sensitively (curl's `-H \"Header: value\"` convention); everything\n * else falls back to the case-insensitive set lookup.\n */\nfunction isSensitiveFlag(flagName: string): boolean {\n\tif (flagName === \"H\") return true;\n\treturn SENSITIVE_FLAGS.has(flagName.toLowerCase());\n}\n","// Onyx-Guard URLs embed the tenant API key as the first non-empty path\n// segment: `{base}/{api_key}/{compressed_client_info}/{upstream_domain}`.\n// Logging the raw URL leaks the key.\n//\n// This is a LOG-SINK helper only: it is applied to the copy of the session\n// data handed to the logger, never to the metadata sent to the backend (the\n// backend needs the verbatim upstream URL to identify the MCP asset). It only\n// redacts genuine Onyx-Guard hosts (`*.onyx.security`) — a plain upstream MCP\n// URL like `https://mcp.figma.com/mcp` has no embedded key and passes through.\n//\n// Intentional asymmetry with `scanner/internal/common/url_redact.go::\n// RedactOnyxGuardURL`, which stays unconditional: that twin is only ever fed\n// URLs built by `BuildOnyxGuardURL` (always genuine guard URLs), so host-gating\n// it could stop it redacting a real key.\n\nconst REDACTED = \"[REDACTED]\";\n\n// Production Onyx-Guard apex. Guard URLs may be served from a subdomain\n// (e.g. `<tenant>.ai-guard.onyx.security`), so match the apex and any subdomain.\nconst ONYX_GUARD_SUFFIX = \"onyx.security\";\n\n/**\n * Replace the first non-empty path segment with [REDACTED] — but only when the\n * host is an Onyx-Guard host (`*.onyx.security`), where that segment is the\n * tenant API key. Returns the input unchanged for non-guard hosts, unparseable\n * URLs, or URLs with no path segments to redact. The query string is preserved\n * as-is — query-only redaction is a different sink (see\n * auth/browser.ts::redactUrlForLogging).\n */\nexport function redactOnyxGuardUrl(raw: string): string {\n\tif (!raw) return raw;\n\n\tlet parsed: URL;\n\ttry {\n\t\tparsed = new URL(raw);\n\t} catch {\n\t\treturn raw;\n\t}\n\tif (!parsed.host || parsed.pathname === \"\" || parsed.pathname === \"/\") {\n\t\treturn raw;\n\t}\n\n\t// Only redact genuine Onyx-Guard hosts. A plain upstream MCP URL has no\n\t// embedded key and must pass through untouched. Strip a trailing dot so a\n\t// valid FQDN form (`ai-guard.onyx.security.`) still matches the suffix and\n\t// doesn't leak the key into logs.\n\tconst host = parsed.hostname.toLowerCase().replace(/\\.$/, \"\");\n\tif (host !== ONYX_GUARD_SUFFIX && !host.endsWith(`.${ONYX_GUARD_SUFFIX}`)) {\n\t\treturn raw;\n\t}\n\n\t// Split on `/` and redact the first non-empty segment so paths with\n\t// repeated leading slashes (`//sk_live/...`) don't bypass the redactor.\n\t// `split` preserves empty leading segments, so the rebuilt path keeps\n\t// the original slash count.\n\tconst segments = parsed.pathname.split(\"/\");\n\tconst firstNonEmptyIdx = segments.findIndex((seg) => seg.length > 0);\n\tif (firstNonEmptyIdx === -1) return raw;\n\tsegments[firstNonEmptyIdx] = REDACTED;\n\tconst newPath = segments.join(\"/\");\n\treturn `${parsed.protocol}//${parsed.host}${newPath}${parsed.search}${parsed.hash}`;\n}\n","import { deflateSync } from \"node:zlib\";\n\n/**\n * Compress and base64-encode client info for URL transmission.\n * Used by both traffic mirror (scanner) and access control client.\n *\n * @param data - Data to compress (typically SessionData)\n * @returns Base64-encoded compressed data suitable for URL\n */\nexport function compressClientInfo(data: unknown): string {\n const compressedData = deflateSync(JSON.stringify(data));\n return Buffer.from(compressedData).toString(\"base64url\");\n}\n\n","import { SESSION_ID } from \"../config/env.js\";\nimport {\n getSessionData,\n type RemoteSessionCliArgs,\n type SessionData,\n type StdioSessionCliArgs,\n} from \"../utils/getUserData.js\";\nimport { redactCliArgs } from \"../utils/redactCliArgs.js\";\nimport { redactOnyxGuardUrl } from \"../utils/redactOnyxGuardUrl.js\";\nimport { compressClientInfo } from \"./compress-client-info.js\";\nimport { logger } from \"./logger.js\";\n\ninterface MirrorConfig {\n cliArgs: RemoteSessionCliArgs | StdioSessionCliArgs;\n scanApiKey?: string;\n // Scanner config\n scanEnabled: boolean;\n scanFailOpen: boolean;\n scanHeaders: Record<string, string>;\n scanTimeoutMs: number;\n scanUrl: string;\n // Best-effort accessor for the spawned stdio MCP server child. Read fresh on\n // each scan so the metadata reflects the current child (a crashed server can be\n // respawned mid-session with a new pid). Absent for remote proxies.\n spawnedServerInfoProvider?: () => SpawnedServerInfo;\n}\n\ninterface MirrorPayload {\n data: unknown;\n id: string;\n metadata: SessionData;\n method: string;\n originalRequestId?: string;\n sessionId: string;\n timestamp: string;\n type: \"error\" | \"request\" | \"response\";\n}\n\ninterface ScanRequest {\n data: unknown;\n id: string;\n metadata: SessionData;\n method: string;\n originalRequestId?: string;\n type: \"error\" | \"request\" | \"response\";\n}\n\ninterface ScanResponse {\n action: \"allow\" | \"block\" | \"modify\";\n block_reason?: string;\n modified_data?: unknown;\n}\n\ninterface SpawnedServerInfo {\n pid?: number;\n startedAtMs?: number;\n}\n\nclass TrafficMirror {\n clientAppName: string;\n clientInfoBase64: string;\n sessionData: SessionData;\n // Expose config for fail-safe checks\n get scannerConfig() {\n return {\n apiKey: this.config.scanApiKey,\n enabled: this.config.scanEnabled,\n failOpen: this.config.scanFailOpen,\n headers: this.config.scanHeaders,\n timeoutMs: this.config.scanTimeoutMs,\n url: this.config.scanUrl,\n };\n }\n\n private config: MirrorConfig;\n\n constructor(config: MirrorConfig, sessionData: SessionData) {\n this.config = config;\n this.sessionData = sessionData;\n this.clientAppName = sessionData.clientAppName || \"\";\n this.clientInfoBase64 = this.getClientInfoBase64();\n }\n\n async evaluate(payload: Omit<MirrorPayload, \"metadata\" | \"sessionId\">): Promise<ScanResponse> {\n let scanResult: ScanResponse = { action: \"allow\" };\n\n // Evaluate traffic if scanning is enabled\n if (this.isScanEnabled()) {\n try {\n scanResult = await this.scan({\n data: payload.data,\n id: payload.id,\n method: payload.method,\n originalRequestId: payload.originalRequestId,\n timestamp: payload.timestamp,\n type: payload.type,\n });\n\n logger.info(\"Scan result\", {\n action: scanResult.action,\n id: payload.id,\n method: payload.method,\n originalRequestId: payload.originalRequestId,\n });\n\n // Handle block action\n if (scanResult.action === \"block\") {\n logger.warn(\"Request blocked by security policy\");\n return scanResult;\n }\n } catch (error) {\n logger.error(\"Scanning failed\", {\n error,\n method: payload.method,\n requestType: payload.type,\n scannerUrl: this.config.scanUrl,\n });\n\n // Apply fail-safe behavior\n if (!this.config.scanFailOpen) {\n logger.warn(\"Scanning service unavailable, blocking traffic (fail-closed)\");\n return { action: \"block\" };\n }\n logger.warn(\"Scanning service unavailable, allowing traffic (fail-open)\");\n }\n }\n\n return scanResult;\n }\n\n isEnabled(): boolean {\n return this.isScanEnabled();\n }\n\n isScanEnabled(): boolean {\n return this.config.scanEnabled && !!this.config.scanUrl;\n }\n\n async scan(payload: {\n data: unknown;\n id: string;\n method: string;\n originalRequestId?: string;\n timestamp: string;\n type: \"error\" | \"request\" | \"response\";\n }): Promise<ScanResponse> {\n if (!this.isScanEnabled()) {\n return { action: \"allow\" };\n }\n\n const scanRequest: ScanRequest = {\n data: payload.data,\n id: payload.id,\n metadata: this.buildEventMetadata(),\n method: payload.method,\n originalRequestId: payload.originalRequestId,\n type: payload.type,\n };\n\n logger.info(\"Scanning traffic\", {\n id: payload.id,\n method: payload.method,\n originalRequestId: payload.originalRequestId,\n type: payload.type,\n });\n\n const result = await this.sendScanRequest(scanRequest);\n\n logger.info(\"Scan result\", {\n action: result.action,\n blockReason: result.block_reason,\n hasModifiedData: !!result.modified_data,\n id: payload.id,\n originalRequestId: payload.originalRequestId,\n });\n\n return result;\n }\n\n updateConfig(config: Partial<MirrorConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n // Per-event metadata: the stable session data plus the spawned-server identity\n // (read fresh — a respawn changes the child pid) and this event's completion\n // time. All added fields are optional; the backend treats absent values as an\n // older payload.\n private buildEventMetadata(): SessionData {\n const spawned = this.config.spawnedServerInfoProvider?.();\n return {\n ...this.sessionData,\n eventEndTime: new Date().toISOString(),\n ...(spawned?.pid !== undefined ? { spawnedServerProcessId: spawned.pid } : {}),\n ...(spawned?.startedAtMs !== undefined\n ? { spawnedServerProcessStartTime: new Date(spawned.startedAtMs).toISOString() }\n : {}),\n };\n }\n\n private getClientInfoBase64(): string {\n return compressClientInfo(this.sessionData);\n }\n\n private async sendScanRequest(scanRequest: ScanRequest): Promise<ScanResponse> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), this.config.scanTimeoutMs);\n\n try {\n const scanUrl = `${this.config.scanUrl}/${this.config.scanApiKey}/mcp/${this.clientInfoBase64}`;\n\n // Convert camelCase to snake_case for Python service\n const pythonPayload = {\n data: scanRequest.data,\n id: scanRequest.id,\n metadata: scanRequest.metadata,\n method: scanRequest.method,\n sessionId: SESSION_ID,\n ...(scanRequest.originalRequestId && { original_request_id: String(scanRequest.originalRequestId) }),\n type: scanRequest.type,\n };\n\n const response = await fetch(scanUrl, {\n body: JSON.stringify(pythonPayload),\n headers: {\n \"Content-Type\": \"application/json\",\n ...this.config.scanHeaders,\n },\n method: \"POST\",\n signal: controller.signal,\n });\n\n if (!response.ok) {\n throw new Error(`Sanitization service returned ${response.status}: ${response.statusText}`);\n }\n\n const result = (await response.json()) as ScanResponse;\n\n // Validate response format\n if (!result.action || ![\"allow\", \"block\", \"modify\"].includes(result.action)) {\n throw new Error(`Invalid scan response format: action=\"${result.action}\"`);\n }\n\n return result;\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n throw new Error(`Scan request timed out after ${this.config.scanTimeoutMs}ms`);\n }\n throw error;\n } finally {\n clearTimeout(timeout);\n }\n }\n}\n\n// Singleton instance\nlet mirrorInstance: null | TrafficMirror = null;\n\nexport const initializeTrafficMirror = async (config: MirrorConfig): Promise<TrafficMirror> => {\n const sessionData = await getSessionData();\n const proxyType = config.cliArgs.proxyType;\n\n // Redact sensitive stdio CLI args (values after --header / --token /\n // --api-key / etc.). A single Bearer token argument from the host MCP server\n // config would otherwise taint every entry in mcp-gateway-*.log. We redact\n // these everywhere — the backend re-sanitizes before persisting and the MCP\n // asset's identity does not depend on the secret arg values.\n const cliArgs =\n proxyType === \"stdio\"\n ? {\n ...(config.cliArgs as StdioSessionCliArgs),\n args: redactCliArgs((config.cliArgs as StdioSessionCliArgs).args),\n }\n : (config.cliArgs as RemoteSessionCliArgs);\n\n // Backend metadata MUST keep the upstream URL verbatim: the asset-creation\n // worker identifies the MCP asset by canonize_url(url), so a redacted URL\n // forks a duplicate asset that no longer matches the scanner's. So we do NOT\n // redact remoteCliArgs.url here — this is the data sent to the scanner.\n const fullSessionData = {\n ...sessionData,\n proxyType,\n remoteCliArgs: proxyType === \"remote\" ? (cliArgs as RemoteSessionCliArgs) : undefined,\n stdioCliArgs: proxyType === \"stdio\" ? (cliArgs as StdioSessionCliArgs) : undefined,\n };\n\n // Log sink only: Onyx-Guard URLs (*.onyx.security) embed the tenant API key\n // as path[1], so redact it from the copy merged into every log line. Plain\n // upstream URLs (e.g. https://mcp.figma.com/mcp) are not guard hosts and pass\n // through unchanged. The backend still receives the verbatim URL above.\n const loggedSessionData =\n proxyType === \"remote\"\n ? {\n ...fullSessionData,\n remoteCliArgs: {\n ...(cliArgs as RemoteSessionCliArgs),\n url: redactOnyxGuardUrl((cliArgs as RemoteSessionCliArgs).url),\n },\n }\n : fullSessionData;\n\n logger.setSessionData(loggedSessionData);\n\n mirrorInstance = new TrafficMirror(config, fullSessionData);\n return mirrorInstance;\n};\n\nexport const getTrafficMirror = (): null | TrafficMirror => {\n return mirrorInstance;\n};\n\nexport type { MirrorConfig, MirrorPayload, ScanRequest, ScanResponse };\n","import type {\n CallToolRequest,\n Progress,\n RequestOptions,\n Server,\n ServerCapabilities,\n ServerContext,\n} from \"@modelcontextprotocol/server\";\n\nimport { randomUUID } from \"crypto\";\n\nimport type { AccessControlAuthorizer } from \"./accessControl/authorizer.js\";\n\nimport { config } from \"./config/env.js\";\nimport { AccessControlBlockError } from \"./lib/errors.js\";\nimport { logger } from \"./lib/logger.js\";\nimport type { UpstreamClient } from \"./lib/reconnectingClient.js\";\nimport { getTrafficMirror, type ScanResponse } from \"./lib/trafficMirror.js\";\n\n/**\n * Timeout configuration for forwarded requests. Mirrors `config.toolCall`.\n */\nexport type ForwardingOptions = {\n maxTotalTimeoutMs: number;\n resetTimeoutOnProgress: boolean;\n timeoutMs: number;\n};\n\n/**\n * Builds the MCP SDK `RequestOptions` applied to forwarded requests. Without\n * these the SDK uses `DEFAULT_REQUEST_TIMEOUT_MSEC` (60s) and never resets the\n * timer on progress, which caps long-running upstream tools at 60s regardless\n * of the client's own timeout. A `maxTotalTimeoutMs` of 0 means \"no absolute\n * cap\" — left `undefined`, matching SDK semantics. A negative value is a\n * misconfiguration and throws rather than being silently treated as \"no cap\".\n */\nexport const buildForwardingRequestOptions = (forwarding: ForwardingOptions): RequestOptions => {\n if (forwarding.maxTotalTimeoutMs < 0) {\n throw new Error(\n `maxTotalTimeoutMs must be >= 0 (0 disables the cap), got ${forwarding.maxTotalTimeoutMs}`\n );\n }\n\n const options: RequestOptions = {\n resetTimeoutOnProgress: forwarding.resetTimeoutOnProgress,\n timeout: forwarding.timeoutMs,\n };\n if (forwarding.maxTotalTimeoutMs > 0) {\n options.maxTotalTimeout = forwarding.maxTotalTimeoutMs;\n }\n return options;\n};\n\n// Request counter for tracking intercepted requests\nclass RequestCounter {\n private counts: Map<string, number> = new Map();\n private lastLogTime: number = Date.now();\n private logIntervalMs: number = 60000; // Log every minute\n\n increment(method: string): void {\n this.counts.set(method, (this.counts.get(method) || 0) + 1);\n this.maybeLog();\n }\n\n logAndReset(): void {\n if (this.counts.size === 0) return;\n\n const total = Array.from(this.counts.values()).reduce((a, b) => a + b, 0);\n logger.info(\"Requests intercepted\", {\n byMethod: Object.fromEntries(this.counts),\n eventType: \"mcp_requests_intercepted\",\n totalCount: total,\n });\n\n this.counts.clear();\n this.lastLogTime = Date.now();\n }\n\n private maybeLog(): void {\n const now = Date.now();\n if (now - this.lastLogTime >= this.logIntervalMs) {\n this.logAndReset();\n }\n }\n}\n\n// Singleton request counter\nconst requestCounter = new RequestCounter();\n\n// Export for shutdown logging\nexport const logRequestCounts = (): void => {\n requestCounter.logAndReset();\n};\n\n// Helper function to extract originalRequestId from handler arguments. Request\n// handlers receive the per-request context as their second argument, and the\n// downstream client's JSON-RPC id lives at ctx.mcpReq.id; notification handlers\n// have no second argument, so this returns undefined for them.\nconst extractOriginalRequestId = <T extends unknown[]>(args: T): string | undefined => {\n if (args.length > 1 && args[1] && typeof args[1] === \"object\" && \"mcpReq\" in args[1]) {\n const mcpReq = (args[1] as { mcpReq?: { id?: number | string } }).mcpReq;\n return mcpReq?.id?.toString();\n }\n return undefined;\n};\n\n// Helper function to wrap handlers with error tracking and traffic evaluation/scanning\nconst wrapHandler = <T extends unknown[], R>(\n handlerName: string,\n operation: string,\n handler: (...args: T) => Promise<R>,\n authorizer?: AccessControlAuthorizer\n): ((...args: T) => Promise<R>) => {\n return async (...args: T): Promise<R> => {\n // Track intercepted request\n requestCounter.increment(handlerName);\n\n const mirror = getTrafficMirror();\n\n // Extract method from data if available, otherwise use handlerName\n let method = handlerName;\n const data = args[0];\n const id = randomUUID();\n const originalRequestId = extractOriginalRequestId(args)?.toString();\n\n if (data && typeof data === \"object\" && \"method\" in data && typeof data.method === \"string\") {\n method = data.method;\n }\n\n // Helper function to process evaluation/scan operations\n const processEvaluation = async (\n type: \"error\" | \"request\" | \"response\",\n payloadData: unknown,\n modifyOriginal?: (newData: unknown) => void\n ): Promise<R | undefined> => {\n try {\n if (!mirror?.isEnabled() && !mirror?.isScanEnabled()) {\n return undefined;\n }\n\n let scanResult: ScanResponse;\n try {\n scanResult = await mirror.evaluate({\n data: payloadData,\n id: id,\n method,\n originalRequestId: originalRequestId,\n timestamp: new Date().toISOString(),\n type,\n });\n } catch (error) {\n logger.error(`${type} evaluation failed, applying fail-safe`, { error });\n\n if (mirror?.isScanEnabled() && !mirror.scannerConfig?.failOpen) {\n // In fail-closed mode, throw exception to ensure request is blocked\n throw new Error(\"Security scanning service unavailable\");\n }\n // If fail-open, continue\n return undefined;\n }\n\n logger.info(`${type} scan result`, {\n action: scanResult.action,\n id: id,\n method,\n ...(type === \"request\" && { originalRequestId }),\n });\n\n if (scanResult.action === \"block\" || scanResult.action === \"modify\") {\n const actionType = scanResult.action === \"block\" ? \"blocked\" : \"modified\";\n const logLevel = scanResult.action === \"block\" && type === \"request\" ? \"warn\" : \"log\";\n\n if (scanResult.modified_data) {\n if (scanResult.action === \"block\") {\n const message = `${type} ${actionType} by security policy${type === \"request\" ? \", returning error response\" : \"\"}`;\n if (logLevel === \"warn\") {\n logger.warn(message);\n } else {\n logger.info(message);\n }\n // Return the modified data as the generic return type\n return scanResult.modified_data as R;\n }\n if (modifyOriginal) {\n const message = `${type} ${actionType} by security policy`;\n if (logLevel === \"warn\") {\n logger.warn(message);\n } else {\n logger.info(message);\n }\n modifyOriginal(scanResult.modified_data);\n return undefined;\n }\n return scanResult.modified_data as R;\n }\n logger.warn(`${scanResult.action} action without modified_data, allowing original ${type}`);\n }\n\n return undefined;\n } catch (error) {\n // Catch any unexpected exceptions during processing\n logger.error(`Unexpected error during ${type} processing`, { error });\n\n // Re-throw controlled security errors in fail-closed mode\n if (type === \"request\" && error instanceof Error && error.message === \"Security scanning service unavailable\") {\n throw error;\n }\n\n // For all other cases, return undefined to allow the handler to proceed\n return undefined;\n }\n };\n\n // Process request\n let requestResult: R | undefined;\n try {\n requestResult = await processEvaluation(\"request\", data, (modifiedData) => {\n args[0] = modifiedData;\n });\n } catch (error) {\n // Re-throw controlled security errors in fail-closed mode to block the request\n if (error instanceof Error && error.message === \"Security scanning service unavailable\") {\n logger.error(\"Security scanning unavailable (fail-closed)\", {\n error: error.message,\n handlerName,\n operation,\n });\n throw error;\n }\n\n // For any other unexpected errors, log but continue to call the handler\n logger.error(\"Unexpected error during request processing, continuing\", { error, handlerName, operation });\n }\n\n if (requestResult !== undefined) {\n return requestResult;\n }\n\n // Check access control BEFORE executing handler (if authorizer provided)\n if (authorizer) {\n const isAllowed = await authorizer.isAllowed();\n if (!isAllowed) {\n const reason = authorizer.getBlockReason();\n logger.warn(\"MCP server blocked by access control\", {\n handlerName,\n operation,\n reason,\n });\n throw new AccessControlBlockError(reason, \"policy_block\");\n }\n }\n\n try {\n // Execute the actual handler with potentially modified args\n const result = await handler(...args);\n\n // Process response - wrap in try-catch to ensure we return the result\n try {\n if (result) {\n const responseResult = await processEvaluation(\"response\", result);\n if (responseResult !== undefined) {\n return responseResult;\n }\n }\n } catch (error) {\n // Log response processing errors but still return the original result\n logger.error(\"Error during response processing, returning original result\", { error });\n }\n\n return result;\n } catch (error) {\n // Handle access control blocks gracefully - don't treat as unexpected error\n if (error instanceof AccessControlBlockError) {\n logger.info(\"Request blocked by access control\", {\n error: error.message,\n handlerName,\n operation,\n reason: error.reason,\n });\n // Re-throw to let MCP SDK handle it and return error to client\n throw error;\n }\n\n // Handle error evaluation for unexpected errors\n try {\n await processEvaluation(\"error\", {\n error: error instanceof Error ? error.message : String(error),\n stack: error instanceof Error ? error.stack : undefined,\n });\n } catch (evalError) {\n // Don't throw on evaluation errors during error handling\n logger.warn(\"Failed to evaluate error\", { evalError });\n }\n\n logger.error(`Handler error in ${handlerName}`, {\n argsCount: args.length,\n errorMessage: error instanceof Error ? error.message : String(error),\n operation,\n });\n throw error; // Re-throw the original error\n }\n };\n};\n\nexport const proxyServer = async ({\n authorizer,\n client,\n forwarding = config.toolCall,\n server,\n serverCapabilities,\n}: {\n authorizer?: AccessControlAuthorizer;\n client: UpstreamClient;\n forwarding?: ForwardingOptions;\n server: Server;\n serverCapabilities: ServerCapabilities;\n}): Promise<void> => {\n // RequestOptions applied to every forwarded request so the SDK's 60s default\n // timeout no longer caps long-running upstream tools. See ForwardingOptions.\n const requestOptions = buildForwardingRequestOptions(forwarding);\n if (serverCapabilities?.logging) {\n server.setNotificationHandler(\n \"notifications/message\",\n wrapHandler(\"notifications/message\", \"server-to-client\", async (args) => {\n return client.notification(args);\n }, authorizer)\n );\n client.setNotificationHandler(\n \"notifications/message\",\n wrapHandler(\"notifications/message\", \"client-to-server\", async (args) => {\n return server.notification(args);\n }, authorizer)\n );\n }\n\n if (serverCapabilities?.prompts) {\n server.setRequestHandler(\n \"prompts/get\",\n wrapHandler(\"prompts/get\", \"get\", async (args) => {\n return client.getPrompt(args.params, requestOptions);\n }, authorizer)\n );\n\n server.setRequestHandler(\n \"prompts/list\",\n wrapHandler(\"prompts/list\", \"list\", async (args) => {\n return client.listPrompts(args.params, requestOptions);\n }, authorizer)\n );\n }\n\n if (serverCapabilities?.resources) {\n server.setRequestHandler(\n \"resources/list\",\n wrapHandler(\"resources/list\", \"list\", async (args) => {\n return client.listResources(args.params, requestOptions);\n }, authorizer)\n );\n\n server.setRequestHandler(\n \"resources/templates/list\",\n wrapHandler(\"resources/templates/list\", \"list\", async (args) => {\n return client.listResourceTemplates(args.params, requestOptions);\n }, authorizer)\n );\n\n server.setRequestHandler(\n \"resources/read\",\n wrapHandler(\"resources/read\", \"read\", async (args) => {\n return client.readResource(args.params, requestOptions);\n }, authorizer)\n );\n\n if (serverCapabilities?.resources.subscribe) {\n server.setNotificationHandler(\n \"notifications/resources/updated\",\n wrapHandler(\"notifications/resources/updated\", \"notify\", async (args) => {\n return client.notification(args);\n }, authorizer)\n );\n\n server.setRequestHandler(\n \"resources/subscribe\",\n wrapHandler(\"resources/subscribe\", \"subscribe\", async (args) => {\n return client.subscribeResource(args.params, requestOptions);\n }, authorizer)\n );\n\n server.setRequestHandler(\n \"resources/unsubscribe\",\n wrapHandler(\"resources/unsubscribe\", \"unsubscribe\", async (args) => {\n return client.unsubscribeResource(args.params, requestOptions);\n }, authorizer)\n );\n }\n }\n\n if (serverCapabilities?.tools) {\n server.setRequestHandler(\n \"tools/call\",\n wrapHandler(\"tools/call\", \"call\", async (\n request: CallToolRequest,\n ctx: ServerContext\n ) => {\n // When the client requested progress (sent a progressToken), forward\n // upstream progress notifications back to it. This both keeps the\n // client's own timer alive and — together with resetTimeoutOnProgress —\n // lets the gateway's forward timeout reset on each heartbeat.\n //\n // Read the token from ctx.mcpReq._meta (the SDK's snapshot of the\n // ORIGINAL request) rather than request.params: a scanner \"modify\"\n // verdict replaces request.params with sanitized data that may drop\n // _meta, which would silently disable progress forwarding for scanned\n // calls.\n const progressToken = ctx.mcpReq._meta?.progressToken;\n const onprogress =\n progressToken === undefined\n ? undefined\n : (progress: Progress) => {\n void ctx.mcpReq\n .notify({\n method: \"notifications/progress\",\n params: { ...progress, progressToken },\n })\n .catch((error: unknown) => {\n logger.warn(\"Failed to forward progress notification to client\", { error });\n });\n };\n return client.callTool(request.params, { ...requestOptions, onprogress });\n }, authorizer)\n );\n\n server.setRequestHandler(\n \"tools/list\",\n wrapHandler(\"tools/list\", \"list\", async (args) => {\n return client.listTools(args.params, requestOptions);\n }, authorizer)\n );\n }\n\n // Gate on the upstream capability like every other handler: setRequestHandler\n // asserts the server declared the matching capability and throws otherwise\n // (SDK behavior since 1.19), which would abort proxy-server creation entirely.\n if (serverCapabilities?.completions) {\n server.setRequestHandler(\n \"completion/complete\",\n wrapHandler(\"completion/complete\", \"complete\", async (args) => {\n return client.complete(args.params, requestOptions);\n }, authorizer)\n );\n }\n};\n","//#region rolldown:runtime\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);\nvar __exportAll = (all, symbols) => {\n\tlet target = {};\n\tfor (var name in all) {\n\t\t__defProp(target, name, {\n\t\t\tget: all[name],\n\t\t\tenumerable: true\n\t\t});\n\t}\n\tif (symbols) {\n\t\t__defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\t}\n\treturn target;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\t\tkey = keys[i];\n\t\t\tif (!__hasOwnProp.call(to, key) && key !== except) {\n\t\t\t\t__defProp(to, key, {\n\t\t\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n\n//#endregion\nexport { __exportAll as n, __toESM as r, __commonJSMin as t };","//#region ../core-internal/src/validators/dialects.ts\n/**\n* Canonical `$schema` URIs per supported dialect (http + https variants, trailing-`#` stripped).\n*/\nconst DRAFT_2020_12_URIS = new Set([\"https://json-schema.org/draft/2020-12/schema\", \"http://json-schema.org/draft/2020-12/schema\"]);\nconst DRAFT_2019_09_URIS = new Set([\"https://json-schema.org/draft/2019-09/schema\", \"http://json-schema.org/draft/2019-09/schema\"]);\nconst DRAFT_07_URIS = new Set([\"https://json-schema.org/draft-07/schema\", \"http://json-schema.org/draft-07/schema\"]);\nconst DRAFT_06_URIS = new Set([\"https://json-schema.org/draft-06/schema\", \"http://json-schema.org/draft-06/schema\"]);\n/**\n* Whether a `$schema` value declares the 2019-09 dialect — the only supported dialect with\n* `$recursiveRef`/`$recursiveAnchor`. Non-throwing (unlike {@linkcode declaredDialect}) so\n* wire-layer callers can consult it for documents whose dialect may be unsupported.\n*/\nfunction declares2019Dialect($schema) {\n\treturn typeof $schema === \"string\" && DRAFT_2019_09_URIS.has($schema.replace(/#$/, \"\"));\n}\n/**\n* Classify a schema's declared `$schema` dialect. No `$schema` (or a non-string one) means\n* 2020-12. Any other dialect throws a plain `Error` with a clear message rather than letting the\n* engine crash on an opaque internal error or silently mis-validate; `remedy` names the calling\n* provider's escape hatch in that message.\n*/\nfunction declaredDialect(schema, remedy) {\n\tif (!(\"$schema\" in schema) || typeof schema.$schema !== \"string\") return \"2020-12\";\n\tconst declared = schema.$schema.replace(/#$/, \"\");\n\tif (DRAFT_2020_12_URIS.has(declared)) return \"2020-12\";\n\tif (DRAFT_2019_09_URIS.has(declared)) return \"2019-09\";\n\tif (DRAFT_07_URIS.has(declared) || DRAFT_06_URIS.has(declared)) return \"draft-7\";\n\tthrow new Error(`JSON Schema declares an unsupported dialect (\"$schema\": \"${schema.$schema.slice(0, 200)}\"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${remedy}`);\n}\n\n//#endregion\nexport { declares2019Dialect as n, declaredDialect as t };\n//# sourceMappingURL=dialects-DoSzNhcb.mjs.map","import { n as __exportAll, r as __toESM, t as __commonJSMin } from \"./chunk-Br0eD_fh.mjs\";\nimport { n as declares2019Dialect } from \"./dialects-DoSzNhcb.mjs\";\nimport { AnnotationsSchema, AudioContentSchema, BAGGAGE_META_KEY, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, IconSchema, IconsSchema, IdJagTokenExchangeResponseSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArraySchema, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONRPC_VERSION, JSONValueSchema, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, METHOD_NOT_FOUND, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, OAuthClientInformationFullSchema, OAuthClientInformationSchema, OAuthClientMetadataSchema, OAuthClientRegistrationErrorSchema, OAuthErrorResponseSchema, OAuthMetadataSchema, OAuthProtectedResourceMetadataSchema, OAuthTokenRevocationRequestSchema, OAuthTokensSchema, OpenIdProviderDiscoveryMetadataSchema, OpenIdProviderMetadataSchema, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, RELATED_TASK_META_KEY, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SERVER_INFO_META_KEY, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema } from \"@modelcontextprotocol/core/internal\";\nimport * as z from \"zod/v4\";\n\n//#region ../core-internal/src/errors/crossBundleBrand.ts\n/**\n* Cross-bundle `instanceof` support for the SDK error classes.\n*\n* `@modelcontextprotocol/client` and `@modelcontextprotocol/server` each bundle their\n* own copy of `core-internal`, so an error constructed by one package fails a\n* prototype-identity `instanceof` against the same class re-exported by the other —\n* exactly the check a dual-role process (gateway, host, in-process test) writes.\n*\n* Instead of prototype identity, branded classes stamp every instance with the brand\n* strings of its class chain under a registry symbol (`Symbol.for`, shared across\n* bundles and realms), and resolve `instanceof` via `Symbol.hasInstance` against the\n* brand set. Ordinary prototype-based `instanceof` is kept as a fallback so behavior\n* is unchanged for anything unbranded.\n*\n* A class participates by defining an **own** `mcpBrand` static (via a `static {}`\n* block, so nothing reaches the declaration files — a declared `protected static`\n* field would make the constructor types nominally incompatible across the bundled\n* copies) and (for hierarchy roots) installing {@linkcode brandedHasInstance} as\n* `Symbol.hasInstance`. User-defined subclasses that do not declare their own brand\n* keep plain prototype semantics — a foreign base-class instance never satisfies\n* `instanceof UserSubclass`.\n*\n* Prior art — the same stamp-and-hook shape ships at scale elsewhere: Node core\n* (stream.Writable since 2017, Console via a marker symbol, diagnostics_channel),\n* undici's whole error hierarchy (vendored into Node as fetch), googleapis/gaxios\n* (GaxiosError, Symbol.for marker), AWS SDK v3's ServiceException (which pairs a\n* Symbol.hasInstance override with a static isInstance guard, as we do), and zod v4\n* (Symbol.hasInstance on every schema class for cross-version interop).\n*\n* Contract notes:\n* - Participation criterion: **every error class exported from a public package that\n* callers are documented to `instanceof` must be branded.** The per-package\n* errorBrandConformance tests walk the export surfaces and fail naming any\n* exported Error subclass that has not opted in.\n* - Brands assert **identity, not shape**: brand strings are version-less, so an\n* instance from one SDK version matches the class of another. Members added to a\n* branded class in a later version may be absent on a matched instance — read\n* fields defensively, and treat branded classes as additive-only. The escape\n* hatch when a release must break a branded class's read contract: change that\n* class's brand string in the same release, which cleanly severs cross-version\n* matching for that class. The per-package brand pins make the rename\n* deliberate: errorSurfacePins.test.ts owns the core-internal brands, and each\n* package's errorBrandConformance test pins its package-local ones.\n* - Cross-bundle matching requires **both** copies to be at or after the release\n* that introduced branding; against an older copy, behavior degrades to plain\n* prototype `instanceof` in both directions.\n* - A consumer re-bundling the SDK with property mangling (`mangle.props`) would\n* break the brand statics; default esbuild/webpack/terser settings do not.\n*/\n/** Registry symbol — identical across bundled copies and realms. */\nconst BRANDS = Symbol.for(\"mcp.sdk.errorBrands\");\n/**\n* Stamp `instance` with the brand of every class in `ctor`'s chain that declares an\n* own `mcpBrand`. Call once from the hierarchy root's constructor with `new.target` —\n* subclasses inherit the stamping without touching their constructors.\n*\n* Constructor-time only: never stamp arbitrary objects. A stamped non-instance would\n* satisfy `instanceof` while lacking the prototype members (getters like `.status`)\n* that callers reach for after the check.\n*/\nfunction stampErrorBrands(instance, ctor) {\n\tconst brands = /* @__PURE__ */ new Set();\n\tlet current = ctor;\n\twhile (typeof current === \"function\") {\n\t\tconst brand = current.mcpBrand;\n\t\tif (Object.prototype.hasOwnProperty.call(current, \"mcpBrand\") && typeof brand === \"string\") brands.add(brand);\n\t\tcurrent = Object.getPrototypeOf(current);\n\t}\n\tif (brands.size === 0) return;\n\tObject.defineProperty(instance, BRANDS, {\n\t\tvalue: brands,\n\t\tenumerable: false,\n\t\tconfigurable: true\n\t});\n}\n/**\n* `Symbol.hasInstance` implementation for branded hierarchy roots. Matches when the\n* value carries the **own** brand of the class being tested against (cross-bundle\n* path), falling back to ordinary prototype-based `instanceof` otherwise.\n*/\nfunction brandedHasInstance(cls, value) {\n\ttry {\n\t\tif (typeof value === \"object\" && value !== null && Object.prototype.hasOwnProperty.call(cls, \"mcpBrand\") && typeof cls.mcpBrand === \"string\" && Object.prototype.hasOwnProperty.call(value, BRANDS)) {\n\t\t\tconst carried = value[BRANDS];\n\t\t\tif (carried && typeof carried.has === \"function\" && carried.has(cls.mcpBrand)) return true;\n\t\t}\n\t} catch {}\n\treturn Function.prototype[Symbol.hasInstance].call(cls, value);\n}\n\n//#endregion\n//#region ../core-internal/src/auth/errors.ts\n/**\n* OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}\n* and extensions.\n*/\nlet OAuthErrorCode = /* @__PURE__ */ function(OAuthErrorCode$1) {\n\t/**\n\t* The request is missing a required parameter, includes an invalid parameter value,\n\t* includes a parameter more than once, or is otherwise malformed.\n\t*/\n\tOAuthErrorCode$1[\"InvalidRequest\"] = \"invalid_request\";\n\t/**\n\t* Client authentication failed (e.g., unknown client, no client authentication included,\n\t* or unsupported authentication method).\n\t*/\n\tOAuthErrorCode$1[\"InvalidClient\"] = \"invalid_client\";\n\t/**\n\t* The provided authorization grant or refresh token is invalid, expired, revoked,\n\t* does not match the redirection URI used in the authorization request, or was issued to another client.\n\t*/\n\tOAuthErrorCode$1[\"InvalidGrant\"] = \"invalid_grant\";\n\t/**\n\t* The authenticated client is not authorized to use this authorization grant type.\n\t*/\n\tOAuthErrorCode$1[\"UnauthorizedClient\"] = \"unauthorized_client\";\n\t/**\n\t* The authorization grant type is not supported by the authorization server.\n\t*/\n\tOAuthErrorCode$1[\"UnsupportedGrantType\"] = \"unsupported_grant_type\";\n\t/**\n\t* The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.\n\t*/\n\tOAuthErrorCode$1[\"InvalidScope\"] = \"invalid_scope\";\n\t/**\n\t* The resource owner or authorization server denied the request.\n\t*/\n\tOAuthErrorCode$1[\"AccessDenied\"] = \"access_denied\";\n\t/**\n\t* The authorization server encountered an unexpected condition that prevented it from fulfilling the request.\n\t*/\n\tOAuthErrorCode$1[\"ServerError\"] = \"server_error\";\n\t/**\n\t* The authorization server is currently unable to handle the request due to temporary overloading or maintenance.\n\t*/\n\tOAuthErrorCode$1[\"TemporarilyUnavailable\"] = \"temporarily_unavailable\";\n\t/**\n\t* The authorization server does not support obtaining an authorization code using this method.\n\t*/\n\tOAuthErrorCode$1[\"UnsupportedResponseType\"] = \"unsupported_response_type\";\n\t/**\n\t* The authorization server does not support the requested token type.\n\t*/\n\tOAuthErrorCode$1[\"UnsupportedTokenType\"] = \"unsupported_token_type\";\n\t/**\n\t* The access token provided is expired, revoked, malformed, or invalid for other reasons.\n\t*/\n\tOAuthErrorCode$1[\"InvalidToken\"] = \"invalid_token\";\n\t/**\n\t* The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)\n\t*/\n\tOAuthErrorCode$1[\"MethodNotAllowed\"] = \"method_not_allowed\";\n\t/**\n\t* Rate limit exceeded. (Custom, non-standard error based on RFC 6585)\n\t*/\n\tOAuthErrorCode$1[\"TooManyRequests\"] = \"too_many_requests\";\n\t/**\n\t* The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)\n\t*/\n\tOAuthErrorCode$1[\"InvalidClientMetadata\"] = \"invalid_client_metadata\";\n\t/**\n\t* The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)\n\t*/\n\tOAuthErrorCode$1[\"InvalidRedirectUri\"] = \"invalid_redirect_uri\";\n\t/**\n\t* The request requires higher privileges than provided by the access token.\n\t*/\n\tOAuthErrorCode$1[\"InsufficientScope\"] = \"insufficient_scope\";\n\t/**\n\t* The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)\n\t*/\n\tOAuthErrorCode$1[\"InvalidTarget\"] = \"invalid_target\";\n\treturn OAuthErrorCode$1;\n}({});\n/**\n* OAuth error class for all OAuth-related errors.\n*/\nvar OAuthError = class OAuthError extends Error {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.OAuthError\" });\n\t}\n\tstatic [Symbol.hasInstance](value) {\n\t\treturn brandedHasInstance(this, value);\n\t}\n\t/**\n\t* Brand-based type guard: equivalent to `value instanceof this`, as an\n\t* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads\n\t* the caller's own brand via `this`, so every branded subclass gets a\n\t* correctly-scoped guard by inheritance. Must be invoked on the class —\n\t* in callback position write `v => SdkError.isInstance(v)`, not\n\t* `.filter(SdkError.isInstance)` (detached calls throw rather than\n\t* silently matching nothing).\n\t*/\n\tstatic isInstance(value) {\n\t\tif (typeof this !== \"function\") throw new TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");\n\t\treturn brandedHasInstance(this, value);\n\t}\n\tconstructor(code, message, errorUri) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.errorUri = errorUri;\n\t\tthis.name = \"OAuthError\";\n\t\tstampErrorBrands(this, new.target);\n\t}\n\t/**\n\t* Converts the error to a standard OAuth error response object.\n\t*/\n\ttoResponseObject() {\n\t\tconst response = {\n\t\t\terror: this.code,\n\t\t\terror_description: this.message\n\t\t};\n\t\tif (this.errorUri) response.error_uri = this.errorUri;\n\t\treturn response;\n\t}\n\t/**\n\t* Creates an {@linkcode OAuthError} from an OAuth error response.\n\t*/\n\tstatic fromResponse(response) {\n\t\treturn new OAuthError(response.error, response.error_description ?? response.error, response.error_uri);\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/errors/sdkErrors.ts\n/**\n* Error codes for SDK errors (local errors that never cross the wire).\n* Unlike {@linkcode ProtocolErrorCode} which uses numeric JSON-RPC codes, `SdkErrorCode` uses\n* descriptive string values for better developer experience.\n*\n* These errors are thrown locally by the SDK and are never serialized as\n* JSON-RPC error responses.\n*/\nlet SdkErrorCode = /* @__PURE__ */ function(SdkErrorCode$1) {\n\t/** Transport is not connected */\n\tSdkErrorCode$1[\"NotConnected\"] = \"NOT_CONNECTED\";\n\t/** Transport is already connected */\n\tSdkErrorCode$1[\"AlreadyConnected\"] = \"ALREADY_CONNECTED\";\n\t/** Protocol is not initialized */\n\tSdkErrorCode$1[\"NotInitialized\"] = \"NOT_INITIALIZED\";\n\t/** Required capability is not supported by the remote side */\n\tSdkErrorCode$1[\"CapabilityNotSupported\"] = \"CAPABILITY_NOT_SUPPORTED\";\n\t/** Request timed out waiting for response */\n\tSdkErrorCode$1[\"RequestTimeout\"] = \"REQUEST_TIMEOUT\";\n\t/** Connection was closed */\n\tSdkErrorCode$1[\"ConnectionClosed\"] = \"CONNECTION_CLOSED\";\n\t/** Failed to send message */\n\tSdkErrorCode$1[\"SendFailed\"] = \"SEND_FAILED\";\n\t/** Response result failed local schema validation */\n\tSdkErrorCode$1[\"InvalidResult\"] = \"INVALID_RESULT\";\n\t/**\n\t* The response carried a `resultType` discriminator (protocol revision\n\t* 2026-07-28) naming a result kind this client cannot consume yet, e.g.\n\t* `input_required`. The kind is carried in `data.resultType`.\n\t*/\n\tSdkErrorCode$1[\"UnsupportedResultType\"] = \"UNSUPPORTED_RESULT_TYPE\";\n\t/**\n\t* The multi-round-trip auto-fulfilment driver exhausted its round cap\n\t* (`inputRequired.maxRounds`) without the server returning a complete\n\t* result. `data.rounds` carries the cap that was hit and\n\t* `data.lastResult` carries the last `input_required` payload received\n\t* (`{ inputRequests, requestState? }`), so callers can inspect or resume\n\t* the flow manually.\n\t*/\n\tSdkErrorCode$1[\"InputRequiredRoundsExceeded\"] = \"INPUT_REQUIRED_ROUNDS_EXCEEDED\";\n\t/**\n\t* The auto-aggregating no-`cursor` `listTools()` / `listPrompts()` /\n\t* `listResources()` / `listResourceTemplates()` walk hit the\n\t* `ClientOptions.listMaxPages` cap without the server's pagination\n\t* converging. `data.method` carries the list verb and\n\t* `data.listMaxPages` the cap that was hit; raise the cap or fall back to\n\t* explicit per-page `{ cursor }` calls.\n\t*/\n\tSdkErrorCode$1[\"ListPaginationExceeded\"] = \"LIST_PAGINATION_EXCEEDED\";\n\t/**\n\t* The spec method being sent does not exist on the negotiated protocol\n\t* version's wire era (e.g. `tasks/get` toward a 2026-07-28 peer, or\n\t* `server/discover` toward a 2025-era peer). Raised locally, before\n\t* anything reaches the transport. The method and era are carried in\n\t* `data.method` / `data.era`.\n\t*/\n\tSdkErrorCode$1[\"MethodNotSupportedByProtocolVersion\"] = \"METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION\";\n\t/**\n\t* Protocol-era negotiation at connect time failed without producing either a\n\t* usable modern (2026-07-28+) era or a definitive legacy fallback signal —\n\t* e.g. the negotiation mode forbids falling back (`pin`), the probe hit a\n\t* network failure, or the server answered the probe with a 5xx (a typed\n\t* connect error, never an era verdict).\n\t*\n\t* Negotiation-phase only: this code is never used once an era is\n\t* established. Auth walls never carry it: a 401/403 rejecting the probe\n\t* uses {@linkcode ClientHttpAuthentication} / {@linkcode ClientHttpForbidden}\n\t* instead, so era-recovery flows keyed on this code (e.g. cached-verdict\n\t* gateways) can never persist a verdict for an unauthorized exchange.\n\t*/\n\tSdkErrorCode$1[\"EraNegotiationFailed\"] = \"ERA_NEGOTIATION_FAILED\";\n\tSdkErrorCode$1[\"ClientHttpNotImplemented\"] = \"CLIENT_HTTP_NOT_IMPLEMENTED\";\n\t/**\n\t* HTTP 401 authentication failure: the transport's re-auth retry still got\n\t* 401 (`Server returned 401 after re-authentication`), or the version\n\t* negotiation probe was rejected 401 with no `authProvider` configured\n\t* (`Version negotiation failed: the server requires authorization (HTTP 401)`).\n\t* Carried on an {@linkcode SdkHttpError} with `status: 401`.\n\t*/\n\tSdkErrorCode$1[\"ClientHttpAuthentication\"] = \"CLIENT_HTTP_AUTHENTICATION\";\n\t/**\n\t* HTTP 403 denial: the step-up re-authorization retry limit was reached,\n\t* or the version negotiation probe was rejected 403\n\t* (`Version negotiation failed: the server denied access (HTTP 403)`).\n\t* Carried on an {@linkcode SdkHttpError} with `status: 403`.\n\t*/\n\tSdkErrorCode$1[\"ClientHttpForbidden\"] = \"CLIENT_HTTP_FORBIDDEN\";\n\tSdkErrorCode$1[\"ClientHttpUnexpectedContent\"] = \"CLIENT_HTTP_UNEXPECTED_CONTENT\";\n\tSdkErrorCode$1[\"ClientHttpFailedToOpenStream\"] = \"CLIENT_HTTP_FAILED_TO_OPEN_STREAM\";\n\tSdkErrorCode$1[\"ClientHttpFailedToTerminateSession\"] = \"CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION\";\n\treturn SdkErrorCode$1;\n}({});\n/**\n* SDK errors are local errors that never cross the wire.\n* They are distinct from {@linkcode ProtocolError} which represents JSON-RPC protocol errors\n* that are serialized and sent as error responses.\n*\n* @example\n* ```ts source=\"./sdkErrors.examples.ts#SdkError_basicUsage\"\n* try {\n* // Throwing an SDK error\n* throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');\n* } catch (error) {\n* // Checking error type by code\n* if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {\n* // Handle timeout\n* }\n* }\n* ```\n*/\nvar SdkError = class extends Error {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.SdkError\" });\n\t}\n\tstatic [Symbol.hasInstance](value) {\n\t\treturn brandedHasInstance(this, value);\n\t}\n\t/**\n\t* Brand-based type guard: equivalent to `value instanceof this`, as an\n\t* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads\n\t* the caller's own brand via `this`, so every branded subclass gets a\n\t* correctly-scoped guard by inheritance. Must be invoked on the class —\n\t* in callback position write `v => SdkError.isInstance(v)`, not\n\t* `.filter(SdkError.isInstance)` (detached calls throw rather than\n\t* silently matching nothing).\n\t*/\n\tstatic isInstance(value) {\n\t\tif (typeof this !== \"function\") throw new TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");\n\t\treturn brandedHasInstance(this, value);\n\t}\n\tconstructor(code, message, data) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.data = data;\n\t\tthis.name = \"SdkError\";\n\t\tstampErrorBrands(this, new.target);\n\t}\n};\n/**\n* An {@linkcode SdkError} subclass for HTTP transport failures.\n*\n* Thrown by the streamable HTTP transport when the server responds with a\n* non-OK status code. Narrows {@linkcode SdkError.data | data} to\n* {@linkcode SdkHttpErrorData} so consumers can inspect the HTTP status\n* without unsafe casting.\n*\n* @example\n* ```ts source=\"./sdkErrors.examples.ts#SdkHttpError_basicUsage\"\n* if (error instanceof SdkHttpError) {\n* console.log(error.status); // number\n* console.log(error.statusText); // string | undefined\n* }\n* ```\n*/\nvar SdkHttpError = class extends SdkError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.SdkHttpError\" });\n\t}\n\tconstructor(code, message, data) {\n\t\tsuper(code, message, data);\n\t\tthis.name = \"SdkHttpError\";\n\t}\n\tget status() {\n\t\treturn this.data.status;\n\t}\n\tget statusText() {\n\t\treturn this.data.statusText;\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/shared/authUtils.ts\n/**\n* Utilities for handling OAuth resource URIs.\n*/\n/**\n* Converts a server URL to a resource URL by removing the fragment.\n* {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}\n* states that resource URIs \"MUST NOT include a fragment component\".\n* Keeps everything else unchanged (scheme, domain, port, path, query).\n*/\nfunction resourceUrlFromServerUrl(url) {\n\tconst resourceURL = typeof url === \"string\" ? new URL(url) : new URL(url.href);\n\tresourceURL.hash = \"\";\n\treturn resourceURL;\n}\n/**\n* Checks if a requested resource URL matches a configured resource URL.\n* A requested resource matches if it has the same scheme, domain, port,\n* and its path starts with the configured resource's path.\n*\n* @param options - The options object\n* @param options.requestedResource - The resource URL being requested\n* @param options.configuredResource - The resource URL that has been configured\n* @returns true if the requested resource matches the configured resource, false otherwise\n*/\nfunction checkResourceAllowed({ requestedResource, configuredResource }) {\n\tconst requested = typeof requestedResource === \"string\" ? new URL(requestedResource) : new URL(requestedResource.href);\n\tconst configured = typeof configuredResource === \"string\" ? new URL(configuredResource) : new URL(configuredResource.href);\n\tif (requested.origin !== configured.origin) return false;\n\tif (requested.pathname.length < configured.pathname.length) return false;\n\tconst requestedPath = requested.pathname.endsWith(\"/\") ? requested.pathname : requested.pathname + \"/\";\n\tconst configuredPath = configured.pathname.endsWith(\"/\") ? configured.pathname : configured.pathname + \"/\";\n\treturn requestedPath.startsWith(configuredPath);\n}\n\n//#endregion\n//#region ../core-internal/src/shared/clientCapabilityRequirements.ts\n/**\n* Inbound request methods whose processing structurally requires a client\n* capability, keyed by method, valued by the capabilities required.\n*\n* Currently empty: none of the request methods served on the 2026-07-28\n* registry unconditionally requires a client capability. Entries appear here\n* when such methods exist — for example requests whose handling embeds\n* elicitation or sampling input requests (the input-request engine), or\n* opt-in subscription delivery. Handler-conditional requirements (a specific\n* tool that needs sampling) are not expressible as a static method table and\n* are enforced at the point the requirement arises instead.\n*/\nconst REQUIRED_CLIENT_CAPABILITIES_BY_METHOD = {};\n/**\n* The client capabilities a request method structurally requires, or\n* `undefined` when the method has no static requirement.\n*/\nfunction requiredClientCapabilitiesForRequest(method) {\n\treturn Object.hasOwn(REQUIRED_CLIENT_CAPABILITIES_BY_METHOD, method) ? REQUIRED_CLIENT_CAPABILITIES_BY_METHOD[method] : void 0;\n}\nfunction isPlainObject$7(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/**\n* Whether a required nested member counts as declared even though it is not\n* spelled out: a bare `elicitation: {}` declaration (no mode sub-capability at\n* all) is read as form support — the pre-mode (2025) meaning of a bare\n* declaration — so an `elicitation.form` requirement treats it as satisfied.\n* Declaring any mode explicitly (for example `elicitation: { url: {} }`)\n* removes the implication.\n*/\nfunction isImpliedCapabilityMember(capability, member, declaredValue) {\n\treturn capability === \"elicitation\" && member === \"form\" && declaredValue[\"form\"] === void 0 && declaredValue[\"url\"] === void 0;\n}\n/**\n* The client capabilities an embedded multi-round-trip input request requires\n* (call site 2 — the outbound input-request leg): a server MUST NOT send an\n* `inputRequests` kind the request's declared client capabilities do not\n* cover. Returns `undefined` for entries whose method is not one of the\n* embedded input-request kinds (those are a server bug handled separately,\n* not a capability question).\n*\n* The requirement is mode-aware where the capability is: URL-mode elicitation\n* requires `elicitation.url`; form-mode (or mode-omitted) elicitation requires\n* `elicitation.form` (modes are sub-capabilities, and a server MUST NOT send a\n* mode the client did not declare); sampling with `tools`/`toolChoice`\n* requires `sampling.tools`. A bare `elicitation: {}` declaration satisfies\n* the form requirement — see {@linkcode missingClientCapabilities}.\n*/\nfunction requiredClientCapabilitiesForInputRequest(entry) {\n\tswitch (entry.method) {\n\t\tcase \"elicitation/create\":\n\t\t\tif (entry.params?.[\"mode\"] === \"url\") return { elicitation: { url: {} } };\n\t\t\treturn { elicitation: { form: {} } };\n\t\tcase \"sampling/createMessage\": {\n\t\t\tconst params = entry.params;\n\t\t\tif (params !== void 0 && (params[\"tools\"] !== void 0 || params[\"toolChoice\"] !== void 0)) return { sampling: { tools: {} } };\n\t\t\treturn { sampling: {} };\n\t\t}\n\t\tcase \"roots/list\": return { roots: {} };\n\t\tdefault: return;\n\t}\n}\n/**\n* Computes the subset of `required` client capabilities the client did not\n* declare. Returns `undefined` when every required capability is declared;\n* otherwise returns an object in the `ClientCapabilities` shape containing\n* exactly the missing capabilities (suitable for\n* `data.requiredCapabilities` on the `-32021` error).\n*\n* A capability counts as declared when its top-level key is present on the\n* declared capabilities; when the requirement names nested members (for\n* example `elicitation: { url: {} }`), each named member must also be present\n* under the declared capability. One lenient reading applies: a bare\n* `elicitation: {}` declaration (no mode sub-capability at all) counts as\n* declaring `elicitation.form` — the pre-mode (2025) meaning of a bare\n* declaration. An absent or empty `declared` value means\n* nothing is declared — every required capability is missing (the structural\n* clean-refusal posture for sessions with no per-request capability view).\n*/\nfunction missingClientCapabilities(required, declared) {\n\tconst missing = {};\n\tfor (const [capability, requirement] of Object.entries(required)) {\n\t\tif (requirement === void 0) continue;\n\t\tconst declaredValue = declared === void 0 ? void 0 : declared[capability];\n\t\tif (declaredValue === void 0) {\n\t\t\tmissing[capability] = requirement;\n\t\t\tcontinue;\n\t\t}\n\t\tif (isPlainObject$7(requirement) && isPlainObject$7(declaredValue)) {\n\t\t\tconst missingMembers = {};\n\t\t\tfor (const [member, memberRequirement] of Object.entries(requirement)) if (memberRequirement !== void 0 && declaredValue[member] === void 0 && !isImpliedCapabilityMember(capability, member, declaredValue)) missingMembers[member] = memberRequirement;\n\t\t\tif (Object.keys(missingMembers).length > 0) missing[capability] = missingMembers;\n\t\t}\n\t}\n\treturn Object.keys(missing).length > 0 ? missing : void 0;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/protocolEras.ts\n/**\n* The first protocol revision of the modern (2026-07-28) era. Revision identifiers\n* are ISO dates, so lexicographic comparison orders them chronologically.\n*/\nconst FIRST_MODERN_PROTOCOL_VERSION = \"2026-07-28\";\n/**\n* Modern-era protocol revisions this SDK can negotiate via `server/discover`.\n* Deliberately separate from {@linkcode SUPPORTED_PROTOCOL_VERSIONS} (the legacy\n* `initialize` list), so adding a revision here can never leak a modern version\n* string into a 2025-era handshake. Internal — not part of the public API surface.\n*/\nconst SUPPORTED_MODERN_PROTOCOL_VERSIONS = [FIRST_MODERN_PROTOCOL_VERSION];\n/** Whether the given protocol revision belongs to the modern (2026-07-28+) era. */\nfunction isModernProtocolVersion(version) {\n\treturn version >= FIRST_MODERN_PROTOCOL_VERSION;\n}\n/** The legacy-era (pre-2026-07-28) subset of a supported-versions list, in the list's own preference order. */\nfunction legacyProtocolVersions(versions) {\n\treturn versions.filter((version) => !isModernProtocolVersion(version));\n}\n/** The modern-era (2026-07-28+) subset of a supported-versions list, in the list's own preference order. */\nfunction modernProtocolVersions(versions) {\n\treturn versions.filter((version) => isModernProtocolVersion(version));\n}\n\n//#endregion\n//#region ../core-internal/src/wire/textFallback.ts\n/**\n* SEP-2106 §4.3 TextContent auto-append, era-agnostic, called from BOTH\n* codecs' {@link WireCodec.projectCallToolResult}: when `structuredContent`\n* is a non-object value (array/primitive/`null`) and the handler authored no\n* `type:'text'` block, append `{type:'text', text: JSON.stringify(value)}`.\n* Object-shaped (or absent) `structuredContent` returns the same reference.\n*\n* Leaf module: imported by both era codec modules, so it must NOT import from\n* `./codec.js` (which value-imports the rev codecs at top level — that would\n* make a runtime cycle and a TDZ hazard for entries that evaluate a rev codec\n* module first).\n*/\nfunction appendTextFallbackForNonObject(result) {\n\tconst sc = result.structuredContent;\n\tif (sc === void 0) return result;\n\tif (!(typeof sc !== \"object\" || sc === null || Array.isArray(sc))) return result;\n\tif (result.content?.some((c) => c.type === \"text\") ?? false) return result;\n\treturn {\n\t\t...result,\n\t\tcontent: [...result.content ?? [], {\n\t\t\ttype: \"text\",\n\t\t\ttext: JSON.stringify(sc)\n\t\t}]\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/wire/resultFamilies.ts\n/**\n* Result-family keys that must never default into a `{content: []}` tools/call\n* success. Shared by the 2025 wire-seam schema and server normalization.\n* Leaf module (like `textFallback.ts`): imported by registry/server paths, so\n* it must NOT import from `./codec.js` — that would close a runtime cycle.\n*/\nconst TOOL_RESULT_FOREIGN_FAMILY_KEYS = [\n\t\"task\",\n\t\"inputRequests\",\n\t\"requestState\"\n];\n/**\n* Single owner of the v1-parity ruling: a plain-object tool result without `content` (and\n* without foreign-family keys) gains `content: []`. Shared by the 2025 wire seam and server-side handler normalization.\n*/\nfunction normalizeContentlessToolResult(value) {\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value) || value.content !== void 0 || TOOL_RESULT_FOREIGN_FAMILY_KEYS.some((key) => key in value)) return value;\n\treturn {\n\t\t...value,\n\t\tcontent: []\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/buildSchemas.ts\n/**\n* Complete frozen 2025-11-25 wire schemas. Self-contained — no imports from\n* the public/neutral types/schemas.ts. The neutral layer is the public-API\n* superset and is free to evolve (e.g., SEP-2106 widening); this file is the\n* 2025 wire-parse contract (Q10-L2 byte-identity) and is BEHAVIOR-FROZEN.\n*\n* This is the era's complete frozen wire-parse contract — both the 2025-only\n* delta (the deprecated task family, the era role unions) AND frozen copies of\n* every era-shared shape (Tool, CallToolResult, Initialize*, ContentBlock,\n* prompts/resources/completion/elicitation, …). The 2026-era codec\n* (`wire/rev2026-07-28/`) is symmetrically self-contained in the same way.\n*\n* The 2025-only delta (the task message surface, restored types-only by #2248\n* for interop with task-capable 2025 peers) is parsed ONLY through this era's\n* registry; the deprecated Task* schemas also live (marked `@deprecated`) in\n* the neutral schema layer so the public types stay nameable without a\n* cross-layer import — nameability is constant, runtime availability is\n* version-keyed — but appear in no API signature. Q1 increment 2 — deletions\n* are physical: the\n* 2026-era REGISTRY has no Task* methods (its frozen building-block copies do\n* carry the deprecated Task* sub-schemas by composition — soft contamination,\n* tracked for anchor-exactness adjudication).\n*\n* The only cross-layer dependency is `import type { JSONObject, JSONValue }`\n* from the neutral types barrel — pure structural type aliases with no parse\n* behavior. No runtime schema is shared with the neutral layer.\n*/\nfunction build$1() {\n\tconst JSONValueSchema$1 = z.lazy(() => z.union([\n\t\tz.string(),\n\t\tz.number(),\n\t\tz.boolean(),\n\t\tz.null(),\n\t\tz.record(z.string(), JSONValueSchema$1),\n\t\tz.array(JSONValueSchema$1)\n\t]));\n\tconst JSONObjectSchema$1 = z.record(z.string(), JSONValueSchema$1);\n\t/**\n\t* A progress token, used to associate progress notifications with the original request.\n\t*/\n\tconst ProgressTokenSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* An opaque token used to represent a cursor for pagination.\n\t*/\n\tconst CursorSchema$1 = z.string();\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst TaskMetadataSchema$1 = z.object({ ttl: z.number().optional() });\n\t/**\n\t* Metadata for associating messages with a task.\n\t* Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst RelatedTaskMetadataSchema$1 = z.object({ taskId: z.string() });\n\tconst RequestMetaSchema$1 = z.looseObject({\n\t\tprogressToken: ProgressTokenSchema$1.optional(),\n\t\t\"io.modelcontextprotocol/related-task\": RelatedTaskMetadataSchema$1.optional()\n\t});\n\t/**\n\t* Common params for any request.\n\t*/\n\tconst BaseRequestParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\t/**\n\t* Common params for any task-augmented request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskAugmentedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ task: TaskMetadataSchema$1.optional() });\n\tconst RequestSchema$1 = z.object({\n\t\tmethod: z.string(),\n\t\tparams: BaseRequestParamsSchema$1.loose().optional()\n\t});\n\tconst NotificationsParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\tconst NotificationSchema$1 = z.object({\n\t\tmethod: z.string(),\n\t\tparams: NotificationsParamsSchema$1.loose().optional()\n\t});\n\tconst ResultSchema$1 = z.looseObject({ _meta: RequestMetaSchema$1.optional() });\n\t/**\n\t* A uniquely identifying ID for a request in JSON-RPC.\n\t*/\n\tconst RequestIdSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* A response that indicates success but carries no data.\n\t*/\n\tconst EmptyResultSchema$1 = ResultSchema$1.strict();\n\tconst CancelledNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({\n\t\trequestId: RequestIdSchema$1.optional(),\n\t\treason: z.string().optional()\n\t});\n\t/**\n\t* This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n\t*\n\t* The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\t*\n\t* This notification indicates that the result will be unused, so any associated processing SHOULD cease.\n\t*\n\t* A client MUST NOT attempt to cancel its {@linkcode InitializeRequest | initialize} request.\n\t*/\n\tconst CancelledNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/cancelled\"),\n\t\tparams: CancelledNotificationParamsSchema$1\n\t});\n\t/**\n\t* Icon schema for use in {@link Tool | tools}, {@link Prompt | prompts}, {@link Resource | resources}, and {@link Implementation | implementations}.\n\t*/\n\tconst IconSchema$1 = z.object({\n\t\tsrc: z.string(),\n\t\tmimeType: z.string().optional(),\n\t\tsizes: z.array(z.string()).optional(),\n\t\ttheme: z.enum([\"light\", \"dark\"]).optional()\n\t});\n\t/**\n\t* Base schema to add `icons` property.\n\t*\n\t*/\n\tconst IconsSchema$1 = z.object({ icons: z.array(IconSchema$1).optional() });\n\t/**\n\t* Base metadata interface for common properties across {@link Resource | resources}, {@link Tool | tools}, {@link Prompt | prompts}, and {@link Implementation | implementations}.\n\t*/\n\tconst BaseMetadataSchema$1 = z.object({\n\t\tname: z.string(),\n\t\ttitle: z.string().optional()\n\t});\n\t/**\n\t* Describes the name and version of an MCP implementation.\n\t*/\n\tconst ImplementationSchema$1 = BaseMetadataSchema$1.extend({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tversion: z.string(),\n\t\twebsiteUrl: z.string().optional(),\n\t\tdescription: z.string().optional()\n\t});\n\tconst FormElicitationCapabilitySchema = z.intersection(z.object({ applyDefaults: z.boolean().optional() }), JSONObjectSchema$1);\n\tconst ElicitationCapabilitySchema = z.preprocess((value) => {\n\t\tif (value && typeof value === \"object\" && !Array.isArray(value) && Object.keys(value).length === 0) return { form: {} };\n\t\treturn value;\n\t}, z.intersection(z.object({\n\t\tform: FormElicitationCapabilitySchema.optional(),\n\t\turl: JSONObjectSchema$1.optional()\n\t}), JSONObjectSchema$1.optional()));\n\t/**\n\t* Task capabilities for clients, indicating which request types support task creation.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ClientTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({\n\t\t\tsampling: z.looseObject({ createMessage: JSONObjectSchema$1.optional() }).optional(),\n\t\t\telicitation: z.looseObject({ create: JSONObjectSchema$1.optional() }).optional()\n\t\t}).optional()\n\t});\n\t/**\n\t* Task capabilities for servers, indicating which request types support task creation.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ServerTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({ tools: z.looseObject({ call: JSONObjectSchema$1.optional() }).optional() }).optional()\n\t});\n\t/**\n\t* Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.\n\t*/\n\tconst ClientCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tsampling: z.object({\n\t\t\tcontext: JSONObjectSchema$1.optional(),\n\t\t\ttools: JSONObjectSchema$1.optional()\n\t\t}).optional(),\n\t\telicitation: ElicitationCapabilitySchema.optional(),\n\t\troots: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ClientTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\tconst InitializeRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({\n\t\tprotocolVersion: z.string(),\n\t\tcapabilities: ClientCapabilitiesSchema$1,\n\t\tclientInfo: ImplementationSchema$1\n\t});\n\t/**\n\t* This request is sent from the client to the server when it first connects, asking it to begin initialization.\n\t*/\n\tconst InitializeRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"initialize\"),\n\t\tparams: InitializeRequestParamsSchema$1\n\t});\n\t/**\n\t* Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.\n\t*/\n\tconst ServerCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tlogging: JSONObjectSchema$1.optional(),\n\t\tcompletions: JSONObjectSchema$1.optional(),\n\t\tprompts: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\tresources: z.object({\n\t\t\tsubscribe: z.boolean().optional(),\n\t\t\tlistChanged: z.boolean().optional()\n\t\t}).optional(),\n\t\ttools: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ServerTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\t/**\n\t* After receiving an initialize request from the client, the server sends this response.\n\t*/\n\tconst InitializeResultSchema$1 = ResultSchema$1.extend({\n\t\tprotocolVersion: z.string(),\n\t\tcapabilities: ServerCapabilitiesSchema$1,\n\t\tserverInfo: ImplementationSchema$1,\n\t\tinstructions: z.string().optional()\n\t});\n\t/**\n\t* This notification is sent from the client to the server after initialization has finished.\n\t*/\n\tconst InitializedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/initialized\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.\n\t*/\n\tconst PingRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"ping\"),\n\t\tparams: BaseRequestParamsSchema$1.optional()\n\t});\n\tconst ProgressSchema$1 = z.object({\n\t\tprogress: z.number(),\n\t\ttotal: z.optional(z.number()),\n\t\tmessage: z.optional(z.string())\n\t});\n\tconst ProgressNotificationParamsSchema$1 = z.object({\n\t\t...NotificationsParamsSchema$1.shape,\n\t\t...ProgressSchema$1.shape,\n\t\tprogressToken: ProgressTokenSchema$1\n\t});\n\t/**\n\t* An out-of-band notification used to inform the receiver of a progress update for a long-running request.\n\t*\n\t* @category notifications/progress\n\t*/\n\tconst ProgressNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/progress\"),\n\t\tparams: ProgressNotificationParamsSchema$1\n\t});\n\tconst PaginatedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ cursor: CursorSchema$1.optional() });\n\tconst PaginatedRequestSchema$1 = RequestSchema$1.extend({ params: PaginatedRequestParamsSchema$1.optional() });\n\tconst PaginatedResultSchema$1 = ResultSchema$1.extend({ nextCursor: CursorSchema$1.optional() });\n\t/**\n\t* The contents of a specific resource or sub-resource.\n\t*/\n\tconst ResourceContentsSchema$1 = z.object({\n\t\turi: z.string(),\n\t\tmimeType: z.optional(z.string()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst TextResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ text: z.string() });\n\t/**\n\t* A Zod schema for validating Base64 strings that is more performant and\n\t* robust for very large inputs than the default regex-based check. It avoids\n\t* stack overflows by using the native `atob` function for validation.\n\t*/\n\tconst Base64Schema = z.string().refine((val) => {\n\t\ttry {\n\t\t\tatob(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, { message: \"Invalid Base64 string\" });\n\tconst BlobResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ blob: Base64Schema });\n\t/**\n\t* The sender or recipient of messages and data in a conversation.\n\t*/\n\tconst RoleSchema$1 = z.enum([\"user\", \"assistant\"]);\n\t/**\n\t* Optional annotations providing clients additional context about a resource.\n\t*/\n\tconst AnnotationsSchema$1 = z.object({\n\t\taudience: z.array(RoleSchema$1).optional(),\n\t\tpriority: z.number().min(0).max(1).optional(),\n\t\tlastModified: z.iso.datetime({ offset: true }).optional()\n\t});\n\t/**\n\t* A known resource that the server is capable of reading.\n\t*/\n\tconst ResourceSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turi: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tsize: z.optional(z.number()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\t/**\n\t* A template description for resources available on the server.\n\t*/\n\tconst ResourceTemplateSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turiTemplate: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\t/**\n\t* Sent from the client to request a list of resources the server has.\n\t*/\n\tconst ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"resources/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListResourcesRequest | resources/list} request from the client.\n\t*/\n\tconst ListResourcesResultSchema$1 = PaginatedResultSchema$1.extend({ resources: z.array(ResourceSchema$1) });\n\t/**\n\t* Sent from the client to request a list of resource templates the server has.\n\t*/\n\tconst ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"resources/templates/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListResourceTemplatesRequest | resources/templates/list} request from the client.\n\t*/\n\tconst ListResourceTemplatesResultSchema$1 = PaginatedResultSchema$1.extend({ resourceTemplates: z.array(ResourceTemplateSchema$1) });\n\tconst ResourceRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ uri: z.string() });\n\t/**\n\t* Parameters for a {@linkcode ReadResourceRequest | resources/read} request.\n\t*/\n\tconst ReadResourceRequestParamsSchema$1 = ResourceRequestParamsSchema$1;\n\t/**\n\t* Sent from the client to the server, to read a specific resource URI.\n\t*/\n\tconst ReadResourceRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"resources/read\"),\n\t\tparams: ReadResourceRequestParamsSchema$1\n\t});\n\t/**\n\t* The server's response to a {@linkcode ReadResourceRequest | resources/read} request from the client.\n\t*/\n\tconst ReadResourceResultSchema$1 = ResultSchema$1.extend({ contents: z.array(z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1])) });\n\t/**\n\t* An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.\n\t*/\n\tconst ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst SubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;\n\t/**\n\t* Sent from the client to request `resources/updated` notifications from the server whenever a particular resource changes.\n\t*/\n\tconst SubscribeRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"resources/subscribe\"),\n\t\tparams: SubscribeRequestParamsSchema$1\n\t});\n\tconst UnsubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;\n\t/**\n\t* Sent from the client to request cancellation of {@linkcode ResourceUpdatedNotification | resources/updated} notifications from the server. This should follow a previous {@linkcode SubscribeRequest | resources/subscribe} request.\n\t*/\n\tconst UnsubscribeRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"resources/unsubscribe\"),\n\t\tparams: UnsubscribeRequestParamsSchema$1\n\t});\n\t/**\n\t* Parameters for a {@linkcode ResourceUpdatedNotification | notifications/resources/updated} notification.\n\t*/\n\tconst ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: z.string() });\n\t/**\n\t* A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a {@linkcode SubscribeRequest | resources/subscribe} request.\n\t*/\n\tconst ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/updated\"),\n\t\tparams: ResourceUpdatedNotificationParamsSchema$1\n\t});\n\t/**\n\t* Describes an argument that a prompt can accept.\n\t*/\n\tconst PromptArgumentSchema$1 = z.object({\n\t\tname: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\trequired: z.optional(z.boolean())\n\t});\n\t/**\n\t* A prompt or prompt template that the server offers.\n\t*/\n\tconst PromptSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.optional(z.string()),\n\t\targuments: z.optional(z.array(PromptArgumentSchema$1)),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\t/**\n\t* Sent from the client to request a list of prompts and prompt templates the server has.\n\t*/\n\tconst ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"prompts/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListPromptsRequest | prompts/list} request from the client.\n\t*/\n\tconst ListPromptsResultSchema$1 = PaginatedResultSchema$1.extend({ prompts: z.array(PromptSchema$1) });\n\t/**\n\t* Parameters for a {@linkcode GetPromptRequest | prompts/get} request.\n\t*/\n\tconst GetPromptRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.string()).optional()\n\t});\n\t/**\n\t* Used by the client to get a prompt provided by the server.\n\t*/\n\tconst GetPromptRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"prompts/get\"),\n\t\tparams: GetPromptRequestParamsSchema$1\n\t});\n\t/**\n\t* Text provided to or from an LLM.\n\t*/\n\tconst TextContentSchema$1 = z.object({\n\t\ttype: z.literal(\"text\"),\n\t\ttext: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* An image provided to or from an LLM.\n\t*/\n\tconst ImageContentSchema$1 = z.object({\n\t\ttype: z.literal(\"image\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Audio content provided to or from an LLM.\n\t*/\n\tconst AudioContentSchema$1 = z.object({\n\t\ttype: z.literal(\"audio\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* A tool call request from an assistant (LLM).\n\t* Represents the assistant's request to use a tool.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ToolUseContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_use\"),\n\t\tname: z.string(),\n\t\tid: z.string(),\n\t\tinput: z.record(z.string(), z.unknown()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* The contents of a resource, embedded into a prompt or tool call result.\n\t*/\n\tconst EmbeddedResourceSchema$1 = z.object({\n\t\ttype: z.literal(\"resource\"),\n\t\tresource: z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* A resource that the server is capable of reading, included in a prompt or tool call result.\n\t*\n\t* Note: resource links returned by tools are not guaranteed to appear in the results of {@linkcode ListResourcesRequest | resources/list} requests.\n\t*/\n\tconst ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: z.literal(\"resource_link\") });\n\t/**\n\t* A content block that can be used in prompts and tool results.\n\t*/\n\tconst ContentBlockSchema$1 = z.union([\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tResourceLinkSchema$1,\n\t\tEmbeddedResourceSchema$1\n\t]);\n\t/**\n\t* Describes a message returned as part of a prompt.\n\t*/\n\tconst PromptMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: ContentBlockSchema$1\n\t});\n\t/**\n\t* The server's response to a {@linkcode GetPromptRequest | prompts/get} request from the client.\n\t*/\n\tconst GetPromptResultSchema$1 = ResultSchema$1.extend({\n\t\tdescription: z.string().optional(),\n\t\tmessages: z.array(PromptMessageSchema$1)\n\t});\n\t/**\n\t* An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.\n\t*/\n\tconst PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/prompts/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* Additional properties describing a `Tool` to clients.\n\t*\n\t* NOTE: all properties in {@linkcode ToolAnnotations} are **hints**.\n\t* They are not guaranteed to provide a faithful description of\n\t* tool behavior (including descriptive properties like `title`).\n\t*\n\t* Clients should never make tool use decisions based on `ToolAnnotations`\n\t* received from untrusted servers.\n\t*/\n\tconst ToolAnnotationsSchema$1 = z.object({\n\t\ttitle: z.string().optional(),\n\t\treadOnlyHint: z.boolean().optional(),\n\t\tdestructiveHint: z.boolean().optional(),\n\t\tidempotentHint: z.boolean().optional(),\n\t\topenWorldHint: z.boolean().optional()\n\t});\n\t/**\n\t* Execution-related properties for a tool.\n\t*/\n\tconst ToolExecutionSchema$1 = z.object({ taskSupport: z.enum([\n\t\t\"required\",\n\t\t\"optional\",\n\t\t\"forbidden\"\n\t]).optional() });\n\t/**\n\t* Definition for a tool the client can call.\n\t*/\n\tconst ToolSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.string().optional(),\n\t\tinputSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), JSONValueSchema$1).optional(),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown()),\n\t\toutputSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), JSONValueSchema$1).optional(),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown()).optional(),\n\t\tannotations: ToolAnnotationsSchema$1.optional(),\n\t\texecution: ToolExecutionSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Sent from the client to request a list of tools the server has.\n\t*/\n\tconst ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"tools/list\") });\n\t/**\n\t* The server's response to a {@linkcode ListToolsRequest | tools/list} request from the client.\n\t*/\n\tconst ListToolsResultSchema$1 = PaginatedResultSchema$1.extend({ tools: z.array(ToolSchema$1) });\n\t/**\n\t* The server's response to a tool call.\n\t*/\n\tconst CallToolResultSchema$1 = ResultSchema$1.extend({\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.record(z.string(), z.unknown()).optional(),\n\t\tisError: z.boolean().optional()\n\t});\n\t/**\n\t* Parameters for a `tools/call` request.\n\t*/\n\tconst CallToolRequestParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Used by the client to invoke a tool provided by the server.\n\t*/\n\tconst CallToolRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tools/call\"),\n\t\tparams: CallToolRequestParamsSchema$1\n\t});\n\t/**\n\t* An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.\n\t*/\n\tconst ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/tools/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* The severity of a log message.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst LoggingLevelSchema$1 = z.enum([\n\t\t\"debug\",\n\t\t\"info\",\n\t\t\"notice\",\n\t\t\"warning\",\n\t\t\"error\",\n\t\t\"critical\",\n\t\t\"alert\",\n\t\t\"emergency\"\n\t]);\n\t/**\n\t* Parameters for a `logging/setLevel` request.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst SetLevelRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ level: LoggingLevelSchema$1 });\n\t/**\n\t* A request from the client to the server, to enable or adjust logging.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst SetLevelRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"logging/setLevel\"),\n\t\tparams: SetLevelRequestParamsSchema$1\n\t});\n\t/**\n\t* Parameters for a `notifications/message` notification.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({\n\t\tlevel: LoggingLevelSchema$1,\n\t\tlogger: z.string().optional(),\n\t\tdata: z.unknown()\n\t});\n\t/**\n\t* Notification of a log message passed from server to client. If no `logging/setLevel` request has been sent from the client, the server MAY decide which messages to send automatically.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to stderr logging\n\t* (STDIO servers) or OpenTelemetry.\n\t*/\n\tconst LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/message\"),\n\t\tparams: LoggingMessageNotificationParamsSchema$1\n\t});\n\t/**\n\t* Hints to use for model selection.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ModelHintSchema$1 = z.object({ name: z.string().optional() });\n\t/**\n\t* The server's preferences for model selection, requested of the client during sampling.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ModelPreferencesSchema$1 = z.object({\n\t\thints: z.array(ModelHintSchema$1).optional(),\n\t\tcostPriority: z.number().min(0).max(1).optional(),\n\t\tspeedPriority: z.number().min(0).max(1).optional(),\n\t\tintelligencePriority: z.number().min(0).max(1).optional()\n\t});\n\t/**\n\t* Controls tool usage behavior in sampling requests.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ToolChoiceSchema$1 = z.object({ mode: z.enum([\n\t\t\"auto\",\n\t\t\"required\",\n\t\t\"none\"\n\t]).optional() });\n\t/**\n\t* The result of a tool execution, provided by the user (server).\n\t* Represents the outcome of invoking a tool requested via `ToolUseContent`.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst ToolResultContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_result\"),\n\t\ttoolUseId: z.string().describe(\"The unique identifier for the corresponding tool call.\"),\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.object({}).loose().optional(),\n\t\tisError: z.boolean().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Basic content types for sampling responses (without tool use).\n\t* Used for backwards-compatible {@linkcode CreateMessageResult} when tools are not used.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst SamplingContentSchema$1 = z.discriminatedUnion(\"type\", [\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1\n\t]);\n\t/**\n\t* Content block types allowed in sampling messages.\n\t* This includes text, image, audio, tool use requests, and tool results.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst SamplingMessageContentBlockSchema$1 = z.discriminatedUnion(\"type\", [\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tToolUseContentSchema$1,\n\t\tToolResultContentSchema$1\n\t]);\n\t/**\n\t* Describes a message issued to or received from an LLM API.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst SamplingMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: z.union([SamplingMessageContentBlockSchema$1, z.array(SamplingMessageContentBlockSchema$1)]),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Parameters for a `sampling/createMessage` request.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageRequestParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmessages: z.array(SamplingMessageSchema$1),\n\t\tmodelPreferences: ModelPreferencesSchema$1.optional(),\n\t\tsystemPrompt: z.string().optional(),\n\t\tincludeContext: z.enum([\n\t\t\t\"none\",\n\t\t\t\"thisServer\",\n\t\t\t\"allServers\"\n\t\t]).optional(),\n\t\ttemperature: z.number().optional(),\n\t\tmaxTokens: z.number().int(),\n\t\tstopSequences: z.array(z.string()).optional(),\n\t\tmetadata: JSONObjectSchema$1.optional(),\n\t\ttools: z.array(ToolSchema$1).optional(),\n\t\ttoolChoice: ToolChoiceSchema$1.optional()\n\t});\n\t/**\n\t* A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"sampling/createMessage\"),\n\t\tparams: CreateMessageRequestParamsSchema$1\n\t});\n\t/**\n\t* The client's response to a `sampling/create_message` request from the server.\n\t* This is the backwards-compatible version that returns single content (no arrays).\n\t* Used when the request does not include tools.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageResultSchema$1 = ResultSchema$1.extend({\n\t\tmodel: z.string(),\n\t\tstopReason: z.optional(z.enum([\n\t\t\t\"endTurn\",\n\t\t\t\"stopSequence\",\n\t\t\t\"maxTokens\"\n\t\t]).or(z.string())),\n\t\trole: RoleSchema$1,\n\t\tcontent: SamplingContentSchema$1\n\t});\n\t/**\n\t* The client's response to a `sampling/create_message` request when tools were provided.\n\t* This version supports array content for tool use flows.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to calling LLM\n\t* provider APIs directly.\n\t*/\n\tconst CreateMessageResultWithToolsSchema$1 = ResultSchema$1.extend({\n\t\tmodel: z.string(),\n\t\tstopReason: z.optional(z.enum([\n\t\t\t\"endTurn\",\n\t\t\t\"stopSequence\",\n\t\t\t\"maxTokens\",\n\t\t\t\"toolUse\"\n\t\t]).or(z.string())),\n\t\trole: RoleSchema$1,\n\t\tcontent: z.union([SamplingMessageContentBlockSchema$1, z.array(SamplingMessageContentBlockSchema$1)])\n\t});\n\t/**\n\t* Primitive schema definition for boolean fields.\n\t*/\n\tconst BooleanSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"boolean\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tdefault: z.boolean().optional()\n\t});\n\t/**\n\t* Primitive schema definition for string fields.\n\t*/\n\tconst StringSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminLength: z.number().optional(),\n\t\tmaxLength: z.number().optional(),\n\t\tformat: z.enum([\n\t\t\t\"email\",\n\t\t\t\"uri\",\n\t\t\t\"date\",\n\t\t\t\"date-time\"\n\t\t]).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\t/**\n\t* Primitive schema definition for number fields.\n\t*/\n\tconst NumberSchemaSchema$1 = z.object({\n\t\ttype: z.enum([\"number\", \"integer\"]),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminimum: z.number().optional(),\n\t\tmaximum: z.number().optional(),\n\t\tdefault: z.number().optional()\n\t});\n\t/**\n\t* Schema for single-selection enumeration without display titles for options.\n\t*/\n\tconst UntitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tdefault: z.string().optional()\n\t});\n\t/**\n\t* Schema for single-selection enumeration with display titles for each option.\n\t*/\n\tconst TitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\toneOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})),\n\t\tdefault: z.string().optional()\n\t});\n\t/**\n\t* Use {@linkcode TitledSingleSelectEnumSchema} instead.\n\t* This interface will be removed in a future version.\n\t*/\n\tconst LegacyTitledEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tenumNames: z.array(z.string()).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\tconst SingleSelectEnumSchemaSchema$1 = z.union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);\n\t/**\n\t* Schema for multiple-selection enumeration without display titles for options.\n\t*/\n\tconst UntitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({\n\t\t\ttype: z.literal(\"string\"),\n\t\t\tenum: z.array(z.string())\n\t\t}),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\t/**\n\t* Schema for multiple-selection enumeration with display titles for each option.\n\t*/\n\tconst TitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({ anyOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})) }),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\t/**\n\t* Combined schema for multiple-selection enumeration\n\t*/\n\tconst MultiSelectEnumSchemaSchema$1 = z.union([UntitledMultiSelectEnumSchemaSchema$1, TitledMultiSelectEnumSchemaSchema$1]);\n\t/**\n\t* Primitive schema definition for enum fields.\n\t*/\n\tconst EnumSchemaSchema$1 = z.union([\n\t\tLegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema$1\n\t]);\n\t/**\n\t* Union of all primitive schema definitions.\n\t*/\n\tconst PrimitiveSchemaDefinitionSchema$1 = z.union([\n\t\tEnumSchemaSchema$1,\n\t\tBooleanSchemaSchema$1,\n\t\tStringSchemaSchema$1,\n\t\tNumberSchemaSchema$1\n\t]);\n\t/**\n\t* Parameters for an `elicitation/create` request for form-based elicitation.\n\t*/\n\tconst ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmode: z.literal(\"form\").optional(),\n\t\tmessage: z.string(),\n\t\trequestedSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), PrimitiveSchemaDefinitionSchema$1),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown())\n\t});\n\t/**\n\t* Parameters for an {@linkcode ElicitRequest | elicitation/create} request for URL-based elicitation.\n\t*/\n\tconst ElicitRequestURLParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmode: z.literal(\"url\"),\n\t\tmessage: z.string(),\n\t\telicitationId: z.string(),\n\t\turl: z.string().url()\n\t});\n\t/**\n\t* The parameters for a request to elicit additional information from the user via the client.\n\t*/\n\tconst ElicitRequestParamsSchema$1 = z.union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);\n\t/**\n\t* A request from the server to elicit user input via the client.\n\t* The client should present the message and form fields to the user (form mode)\n\t* or navigate to a URL (URL mode).\n\t*/\n\tconst ElicitRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"elicitation/create\"),\n\t\tparams: ElicitRequestParamsSchema$1\n\t});\n\t/**\n\t* Parameters for a {@linkcode ElicitationCompleteNotification | notifications/elicitation/complete} notification.\n\t*\n\t* @category notifications/elicitation/complete\n\t*/\n\tconst ElicitationCompleteNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ elicitationId: z.string() });\n\t/**\n\t* A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.\n\t*\n\t* @category notifications/elicitation/complete\n\t*/\n\tconst ElicitationCompleteNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/elicitation/complete\"),\n\t\tparams: ElicitationCompleteNotificationParamsSchema$1\n\t});\n\t/**\n\t* The client's response to an {@linkcode ElicitRequest | elicitation/create} request from the server.\n\t*/\n\tconst ElicitResultSchema$1 = ResultSchema$1.extend({\n\t\taction: z.enum([\n\t\t\t\"accept\",\n\t\t\t\"decline\",\n\t\t\t\"cancel\"\n\t\t]),\n\t\tcontent: z.preprocess((val) => val === null ? void 0 : val, z.record(z.string(), z.union([\n\t\t\tz.string(),\n\t\t\tz.number(),\n\t\t\tz.boolean(),\n\t\t\tz.array(z.string())\n\t\t])).optional())\n\t});\n\t/**\n\t* A reference to a resource or resource template definition.\n\t*/\n\tconst ResourceTemplateReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/resource\"),\n\t\turi: z.string()\n\t});\n\t/**\n\t* Identifies a prompt.\n\t*/\n\tconst PromptReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/prompt\"),\n\t\tname: z.string()\n\t});\n\t/**\n\t* Parameters for a {@linkcode CompleteRequest | completion/complete} request.\n\t*/\n\tconst CompleteRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({\n\t\tref: z.union([PromptReferenceSchema$1, ResourceTemplateReferenceSchema$1]),\n\t\targument: z.object({\n\t\t\tname: z.string(),\n\t\t\tvalue: z.string()\n\t\t}),\n\t\tcontext: z.object({ arguments: z.record(z.string(), z.string()).optional() }).optional()\n\t});\n\t/**\n\t* A request from the client to the server, to ask for completion options.\n\t*/\n\tconst CompleteRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"completion/complete\"),\n\t\tparams: CompleteRequestParamsSchema$1\n\t});\n\t/**\n\t* The server's response to a {@linkcode CompleteRequest | completion/complete} request\n\t*/\n\tconst CompleteResultSchema$1 = ResultSchema$1.extend({ completion: z.looseObject({\n\t\tvalues: z.array(z.string()).max(100),\n\t\ttotal: z.optional(z.number().int()),\n\t\thasMore: z.optional(z.boolean())\n\t}) });\n\t/**\n\t* Represents a root directory or file that the server can operate on.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst RootSchema$1 = z.object({\n\t\turi: z.string().startsWith(\"file://\"),\n\t\tname: z.string().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/**\n\t* Sent from the server to request a list of root URIs from the client.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst ListRootsRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"roots/list\"),\n\t\tparams: BaseRequestParamsSchema$1.optional()\n\t});\n\t/**\n\t* The client's response to a `roots/list` request from the server.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst ListRootsResultSchema$1 = ResultSchema$1.extend({ roots: z.array(RootSchema$1) });\n\t/**\n\t* A notification from the client to the server, informing it that the list of roots has changed.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains\n\t* in the specification for at least twelve months. Migrate to passing paths via\n\t* tool parameters, resource URIs, or configuration.\n\t*/\n\tconst RootsListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/roots/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\t/**\n\t* Task creation parameters, used to ask that the server create a task to represent a request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskCreationParamsSchema$1 = z.looseObject({\n\t\tttl: z.number().optional(),\n\t\tpollInterval: z.number().optional()\n\t});\n\t/**\n\t* The status of a task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskStatusSchema$1 = z.enum([\n\t\t\"working\",\n\t\t\"input_required\",\n\t\t\"completed\",\n\t\t\"failed\",\n\t\t\"cancelled\"\n\t]);\n\t/**\n\t* A pollable state object associated with a request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskSchema$1 = z.object({\n\t\ttaskId: z.string(),\n\t\tstatus: TaskStatusSchema$1,\n\t\tttl: z.union([z.number(), z.null()]),\n\t\tcreatedAt: z.string(),\n\t\tlastUpdatedAt: z.string(),\n\t\tpollInterval: z.optional(z.number()),\n\t\tstatusMessage: z.optional(z.string())\n\t});\n\t/**\n\t* Result returned when a task is created, containing the task data wrapped in a `task` field.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst CreateTaskResultSchema$1 = ResultSchema$1.extend({ task: TaskSchema$1 });\n\t/**\n\t* Parameters for task status notification.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskStatusNotificationParamsSchema$1 = NotificationsParamsSchema$1.merge(TaskSchema$1);\n\t/**\n\t* A notification sent when a task's status changes.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst TaskStatusNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/tasks/status\"),\n\t\tparams: TaskStatusNotificationParamsSchema$1\n\t});\n\t/**\n\t* A request to get the state of a specific task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tasks/get\"),\n\t\tparams: BaseRequestParamsSchema$1.extend({ taskId: z.string() })\n\t});\n\t/**\n\t* The response to a {@linkcode GetTaskRequest | tasks/get} request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskResultSchema$1 = ResultSchema$1.merge(TaskSchema$1);\n\t/**\n\t* A request to get the result of a specific task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskPayloadRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tasks/result\"),\n\t\tparams: BaseRequestParamsSchema$1.extend({ taskId: z.string() })\n\t});\n\t/**\n\t* The response to a `tasks/result` request.\n\t* The structure matches the result type of the original request.\n\t* For example, a {@linkcode CallToolRequest | tools/call} task would return the `CallToolResult` structure.\n\t*\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst GetTaskPayloadResultSchema$1 = ResultSchema$1.loose();\n\t/**\n\t* A request to list tasks.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: z.literal(\"tasks/list\") });\n\t/**\n\t* The response to a {@linkcode ListTasksRequest | tasks/list} request.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst ListTasksResultSchema$1 = PaginatedResultSchema$1.extend({ tasks: z.array(TaskSchema$1) });\n\t/**\n\t* A request to cancel a specific task.\n\t*\n\t* @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.\n\t*/\n\tconst CancelTaskRequestSchema$1 = RequestSchema$1.extend({\n\t\tmethod: z.literal(\"tasks/cancel\"),\n\t\tparams: BaseRequestParamsSchema$1.extend({ taskId: z.string() })\n\t});\n\treturn {\n\t\tJSONValueSchema: JSONValueSchema$1,\n\t\tJSONObjectSchema: JSONObjectSchema$1,\n\t\tProgressTokenSchema: ProgressTokenSchema$1,\n\t\tCursorSchema: CursorSchema$1,\n\t\tTaskMetadataSchema: TaskMetadataSchema$1,\n\t\tRelatedTaskMetadataSchema: RelatedTaskMetadataSchema$1,\n\t\tRequestMetaSchema: RequestMetaSchema$1,\n\t\tBaseRequestParamsSchema: BaseRequestParamsSchema$1,\n\t\tTaskAugmentedRequestParamsSchema: TaskAugmentedRequestParamsSchema$1,\n\t\tRequestSchema: RequestSchema$1,\n\t\tNotificationsParamsSchema: NotificationsParamsSchema$1,\n\t\tNotificationSchema: NotificationSchema$1,\n\t\tResultSchema: ResultSchema$1,\n\t\tRequestIdSchema: RequestIdSchema$1,\n\t\tEmptyResultSchema: EmptyResultSchema$1,\n\t\tCancelledNotificationParamsSchema: CancelledNotificationParamsSchema$1,\n\t\tCancelledNotificationSchema: CancelledNotificationSchema$1,\n\t\tIconSchema: IconSchema$1,\n\t\tIconsSchema: IconsSchema$1,\n\t\tBaseMetadataSchema: BaseMetadataSchema$1,\n\t\tImplementationSchema: ImplementationSchema$1,\n\t\tClientTasksCapabilitySchema: ClientTasksCapabilitySchema$1,\n\t\tServerTasksCapabilitySchema: ServerTasksCapabilitySchema$1,\n\t\tClientCapabilitiesSchema: ClientCapabilitiesSchema$1,\n\t\tInitializeRequestParamsSchema: InitializeRequestParamsSchema$1,\n\t\tInitializeRequestSchema: InitializeRequestSchema$1,\n\t\tServerCapabilitiesSchema: ServerCapabilitiesSchema$1,\n\t\tInitializeResultSchema: InitializeResultSchema$1,\n\t\tInitializedNotificationSchema: InitializedNotificationSchema$1,\n\t\tPingRequestSchema: PingRequestSchema$1,\n\t\tProgressSchema: ProgressSchema$1,\n\t\tProgressNotificationParamsSchema: ProgressNotificationParamsSchema$1,\n\t\tProgressNotificationSchema: ProgressNotificationSchema$1,\n\t\tPaginatedRequestParamsSchema: PaginatedRequestParamsSchema$1,\n\t\tPaginatedRequestSchema: PaginatedRequestSchema$1,\n\t\tPaginatedResultSchema: PaginatedResultSchema$1,\n\t\tResourceContentsSchema: ResourceContentsSchema$1,\n\t\tTextResourceContentsSchema: TextResourceContentsSchema$1,\n\t\tBlobResourceContentsSchema: BlobResourceContentsSchema$1,\n\t\tRoleSchema: RoleSchema$1,\n\t\tAnnotationsSchema: AnnotationsSchema$1,\n\t\tResourceSchema: ResourceSchema$1,\n\t\tResourceTemplateSchema: ResourceTemplateSchema$1,\n\t\tListResourcesRequestSchema: ListResourcesRequestSchema$1,\n\t\tListResourcesResultSchema: ListResourcesResultSchema$1,\n\t\tListResourceTemplatesRequestSchema: ListResourceTemplatesRequestSchema$1,\n\t\tListResourceTemplatesResultSchema: ListResourceTemplatesResultSchema$1,\n\t\tResourceRequestParamsSchema: ResourceRequestParamsSchema$1,\n\t\tReadResourceRequestParamsSchema: ReadResourceRequestParamsSchema$1,\n\t\tReadResourceRequestSchema: ReadResourceRequestSchema$1,\n\t\tReadResourceResultSchema: ReadResourceResultSchema$1,\n\t\tResourceListChangedNotificationSchema: ResourceListChangedNotificationSchema$1,\n\t\tSubscribeRequestParamsSchema: SubscribeRequestParamsSchema$1,\n\t\tSubscribeRequestSchema: SubscribeRequestSchema$1,\n\t\tUnsubscribeRequestParamsSchema: UnsubscribeRequestParamsSchema$1,\n\t\tUnsubscribeRequestSchema: UnsubscribeRequestSchema$1,\n\t\tResourceUpdatedNotificationParamsSchema: ResourceUpdatedNotificationParamsSchema$1,\n\t\tResourceUpdatedNotificationSchema: ResourceUpdatedNotificationSchema$1,\n\t\tPromptArgumentSchema: PromptArgumentSchema$1,\n\t\tPromptSchema: PromptSchema$1,\n\t\tListPromptsRequestSchema: ListPromptsRequestSchema$1,\n\t\tListPromptsResultSchema: ListPromptsResultSchema$1,\n\t\tGetPromptRequestParamsSchema: GetPromptRequestParamsSchema$1,\n\t\tGetPromptRequestSchema: GetPromptRequestSchema$1,\n\t\tTextContentSchema: TextContentSchema$1,\n\t\tImageContentSchema: ImageContentSchema$1,\n\t\tAudioContentSchema: AudioContentSchema$1,\n\t\tToolUseContentSchema: ToolUseContentSchema$1,\n\t\tEmbeddedResourceSchema: EmbeddedResourceSchema$1,\n\t\tResourceLinkSchema: ResourceLinkSchema$1,\n\t\tContentBlockSchema: ContentBlockSchema$1,\n\t\tPromptMessageSchema: PromptMessageSchema$1,\n\t\tGetPromptResultSchema: GetPromptResultSchema$1,\n\t\tPromptListChangedNotificationSchema: PromptListChangedNotificationSchema$1,\n\t\tToolAnnotationsSchema: ToolAnnotationsSchema$1,\n\t\tToolExecutionSchema: ToolExecutionSchema$1,\n\t\tToolSchema: ToolSchema$1,\n\t\tListToolsRequestSchema: ListToolsRequestSchema$1,\n\t\tListToolsResultSchema: ListToolsResultSchema$1,\n\t\tCallToolResultSchema: CallToolResultSchema$1,\n\t\tCallToolRequestParamsSchema: CallToolRequestParamsSchema$1,\n\t\tCallToolRequestSchema: CallToolRequestSchema$1,\n\t\tToolListChangedNotificationSchema: ToolListChangedNotificationSchema$1,\n\t\tLoggingLevelSchema: LoggingLevelSchema$1,\n\t\tSetLevelRequestParamsSchema: SetLevelRequestParamsSchema$1,\n\t\tSetLevelRequestSchema: SetLevelRequestSchema$1,\n\t\tLoggingMessageNotificationParamsSchema: LoggingMessageNotificationParamsSchema$1,\n\t\tLoggingMessageNotificationSchema: LoggingMessageNotificationSchema$1,\n\t\tModelHintSchema: ModelHintSchema$1,\n\t\tModelPreferencesSchema: ModelPreferencesSchema$1,\n\t\tToolChoiceSchema: ToolChoiceSchema$1,\n\t\tToolResultContentSchema: ToolResultContentSchema$1,\n\t\tSamplingContentSchema: SamplingContentSchema$1,\n\t\tSamplingMessageContentBlockSchema: SamplingMessageContentBlockSchema$1,\n\t\tSamplingMessageSchema: SamplingMessageSchema$1,\n\t\tCreateMessageRequestParamsSchema: CreateMessageRequestParamsSchema$1,\n\t\tCreateMessageRequestSchema: CreateMessageRequestSchema$1,\n\t\tCreateMessageResultSchema: CreateMessageResultSchema$1,\n\t\tCreateMessageResultWithToolsSchema: CreateMessageResultWithToolsSchema$1,\n\t\tBooleanSchemaSchema: BooleanSchemaSchema$1,\n\t\tStringSchemaSchema: StringSchemaSchema$1,\n\t\tNumberSchemaSchema: NumberSchemaSchema$1,\n\t\tUntitledSingleSelectEnumSchemaSchema: UntitledSingleSelectEnumSchemaSchema$1,\n\t\tTitledSingleSelectEnumSchemaSchema: TitledSingleSelectEnumSchemaSchema$1,\n\t\tLegacyTitledEnumSchemaSchema: LegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema: SingleSelectEnumSchemaSchema$1,\n\t\tUntitledMultiSelectEnumSchemaSchema: UntitledMultiSelectEnumSchemaSchema$1,\n\t\tTitledMultiSelectEnumSchemaSchema: TitledMultiSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema: MultiSelectEnumSchemaSchema$1,\n\t\tEnumSchemaSchema: EnumSchemaSchema$1,\n\t\tPrimitiveSchemaDefinitionSchema: PrimitiveSchemaDefinitionSchema$1,\n\t\tElicitRequestFormParamsSchema: ElicitRequestFormParamsSchema$1,\n\t\tElicitRequestURLParamsSchema: ElicitRequestURLParamsSchema$1,\n\t\tElicitRequestParamsSchema: ElicitRequestParamsSchema$1,\n\t\tElicitRequestSchema: ElicitRequestSchema$1,\n\t\tElicitationCompleteNotificationParamsSchema: ElicitationCompleteNotificationParamsSchema$1,\n\t\tElicitationCompleteNotificationSchema: ElicitationCompleteNotificationSchema$1,\n\t\tElicitResultSchema: ElicitResultSchema$1,\n\t\tResourceTemplateReferenceSchema: ResourceTemplateReferenceSchema$1,\n\t\tPromptReferenceSchema: PromptReferenceSchema$1,\n\t\tCompleteRequestParamsSchema: CompleteRequestParamsSchema$1,\n\t\tCompleteRequestSchema: CompleteRequestSchema$1,\n\t\tCompleteResultSchema: CompleteResultSchema$1,\n\t\tRootSchema: RootSchema$1,\n\t\tListRootsRequestSchema: ListRootsRequestSchema$1,\n\t\tListRootsResultSchema: ListRootsResultSchema$1,\n\t\tRootsListChangedNotificationSchema: RootsListChangedNotificationSchema$1,\n\t\tTaskCreationParamsSchema: TaskCreationParamsSchema$1,\n\t\tTaskStatusSchema: TaskStatusSchema$1,\n\t\tTaskSchema: TaskSchema$1,\n\t\tCreateTaskResultSchema: CreateTaskResultSchema$1,\n\t\tTaskStatusNotificationParamsSchema: TaskStatusNotificationParamsSchema$1,\n\t\tTaskStatusNotificationSchema: TaskStatusNotificationSchema$1,\n\t\tGetTaskRequestSchema: GetTaskRequestSchema$1,\n\t\tGetTaskResultSchema: GetTaskResultSchema$1,\n\t\tGetTaskPayloadRequestSchema: GetTaskPayloadRequestSchema$1,\n\t\tGetTaskPayloadResultSchema: GetTaskPayloadResultSchema$1,\n\t\tListTasksRequestSchema: ListTasksRequestSchema$1,\n\t\tListTasksResultSchema: ListTasksResultSchema$1,\n\t\tCancelTaskRequestSchema: CancelTaskRequestSchema$1,\n\t\tCancelTaskResultSchema: ResultSchema$1.merge(TaskSchema$1),\n\t\tClientRequestSchema: z.union([\n\t\t\tPingRequestSchema$1,\n\t\t\tInitializeRequestSchema$1,\n\t\t\tCompleteRequestSchema$1,\n\t\t\tSetLevelRequestSchema$1,\n\t\t\tGetPromptRequestSchema$1,\n\t\t\tListPromptsRequestSchema$1,\n\t\t\tListResourcesRequestSchema$1,\n\t\t\tListResourceTemplatesRequestSchema$1,\n\t\t\tReadResourceRequestSchema$1,\n\t\t\tSubscribeRequestSchema$1,\n\t\t\tUnsubscribeRequestSchema$1,\n\t\t\tCallToolRequestSchema$1,\n\t\t\tListToolsRequestSchema$1,\n\t\t\tGetTaskRequestSchema$1,\n\t\t\tGetTaskPayloadRequestSchema$1,\n\t\t\tListTasksRequestSchema$1,\n\t\t\tCancelTaskRequestSchema$1\n\t\t]),\n\t\tClientNotificationSchema: z.union([\n\t\t\tCancelledNotificationSchema$1,\n\t\t\tProgressNotificationSchema$1,\n\t\t\tInitializedNotificationSchema$1,\n\t\t\tRootsListChangedNotificationSchema$1,\n\t\t\tTaskStatusNotificationSchema$1\n\t\t]),\n\t\tClientResultSchema: z.union([\n\t\t\tEmptyResultSchema$1,\n\t\t\tCreateMessageResultSchema$1,\n\t\t\tCreateMessageResultWithToolsSchema$1,\n\t\t\tElicitResultSchema$1,\n\t\t\tListRootsResultSchema$1,\n\t\t\tGetTaskResultSchema$1,\n\t\t\tListTasksResultSchema$1,\n\t\t\tCreateTaskResultSchema$1\n\t\t]),\n\t\tServerRequestSchema: z.union([\n\t\t\tPingRequestSchema$1,\n\t\t\tCreateMessageRequestSchema$1,\n\t\t\tElicitRequestSchema$1,\n\t\t\tListRootsRequestSchema$1,\n\t\t\tGetTaskRequestSchema$1,\n\t\t\tGetTaskPayloadRequestSchema$1,\n\t\t\tListTasksRequestSchema$1,\n\t\t\tCancelTaskRequestSchema$1\n\t\t]),\n\t\tServerNotificationSchema: z.union([\n\t\t\tCancelledNotificationSchema$1,\n\t\t\tProgressNotificationSchema$1,\n\t\t\tLoggingMessageNotificationSchema$1,\n\t\t\tResourceUpdatedNotificationSchema$1,\n\t\t\tResourceListChangedNotificationSchema$1,\n\t\t\tToolListChangedNotificationSchema$1,\n\t\t\tPromptListChangedNotificationSchema$1,\n\t\t\tTaskStatusNotificationSchema$1,\n\t\t\tElicitationCompleteNotificationSchema$1\n\t\t]),\n\t\tServerResultSchema: z.union([\n\t\t\tEmptyResultSchema$1,\n\t\t\tInitializeResultSchema$1,\n\t\t\tCompleteResultSchema$1,\n\t\t\tGetPromptResultSchema$1,\n\t\t\tListPromptsResultSchema$1,\n\t\t\tListResourcesResultSchema$1,\n\t\t\tListResourceTemplatesResultSchema$1,\n\t\t\tReadResourceResultSchema$1,\n\t\t\tCallToolResultSchema$1,\n\t\t\tListToolsResultSchema$1,\n\t\t\tGetTaskResultSchema$1,\n\t\t\tListTasksResultSchema$1,\n\t\t\tCreateTaskResultSchema$1\n\t\t]),\n\t\tCallToolResultWireSchema: z.unknown().superRefine((value, ctx) => {\n\t\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value) || value.content !== void 0) return;\n\t\t\tfor (const key of TOOL_RESULT_FOREIGN_FAMILY_KEYS) if (key in value) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tmessage: `content is required when the body carries '${key}' — another result family cannot default into an empty tools/call success`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}).transform(normalizeContentlessToolResult).pipe(CallToolResultSchema$1)\n\t};\n}\nlet memo$1;\n/**\n* Builds the era wire-schema set on first call and returns the same object\n* thereafter. Module evaluation stays construction-free so importing the\n* era codec/registry costs nothing until the first validation actually\n* needs a schema; the registry, the codec, and the eager `schemas.ts`\n* shim all pull through this memo, so reference identity holds across\n* every consumer.\n*/\nfunction buildSchemas2025() {\n\treturn memo$1 ??= build$1();\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/legacyWrap.ts\n/**\n* SEP-2106 legacy `outputSchema` wrap helpers (2025-era projection only).\n*\n* The neutral / 2026-07-28 model lets a tool's `outputSchema` carry any JSON\n* Schema root. The 2025-11-25 wire shape requires `type:'object'` at the root,\n* so when an era-blind handler advertises a non-object root, the 2025 codec's\n* `encodeResult('tools/list', …)` projects it down to\n* `{type:'object', properties:{result:<natural>}, required:['result']}`, and\n* `projectCallToolResult` wraps the matching `structuredContent` as\n* `{result:<value>}`. The 2026 codec's projections are the identity.\n*\n* These helpers are wire-layer property — they exist so the projection can\n* live behind {@link WireCodec.encodeResult} / {@link WireCodec.projectCallToolResult}\n* and never be re-derived in shared/ or server-side code.\n*/\n/**\n* Whether a JSON Schema's root is non-object: either an explicit non-object\n* `type`, or a typeless root such as `{anyOf:[…]}`. Object-shaped typeless\n* roots that the schema-conversion layer can prove are objects are stamped\n* `type:'object'` upstream, so they reach this predicate as object roots.\n*/\nfunction isNonObjectJsonSchemaRoot(json) {\n\treturn json[\"type\"] !== \"object\";\n}\n/**\n* Keyword-position keys whose values are instance data (not subschemas). A\n* `{$ref:…}` appearing inside one is a literal value, not a JSON Pointer to\n* rewrite. Only consulted when the current object is in keyword position —\n* a PROPERTY named `default`/`const` (under `properties`/`$defs`/…) is a name\n* position whose value IS a subschema and is recursed into.\n*/\nconst REF_REWRITE_DATA_POSITION_KEYS = new Set([\n\t\"const\",\n\t\"enum\",\n\t\"default\",\n\t\"examples\"\n]);\n/**\n* Keyword-position keys whose value is a name→subschema map. Entries inside\n* such a map are in NAME position: their keys are author-chosen property\n* names (which may collide with JSON Schema keywords), their values are\n* subschemas to recurse into.\n*/\nconst REF_REWRITE_NAME_MAP_KEYS = new Set([\n\t\"properties\",\n\t\"patternProperties\",\n\t\"$defs\",\n\t\"definitions\",\n\t\"dependentSchemas\",\n\t\"dependencies\"\n]);\n/**\n* Whether a subtree's `$id` establishes a new resolution base. A fragment-only\n* `$id` (`\"#item\"`, the draft-07/06 spelling of 2020-12's `$anchor`) does not\n* change the RFC 3986 base URI — same-document pointers inside still resolve\n* against the document root and must be rewritten.\n*/\nfunction establishesNewBase(id) {\n\treturn id !== void 0 && !(typeof id === \"string\" && id.startsWith(\"#\"));\n}\n/**\n* Wrap a non-object output schema in the 2025-era envelope:\n* `{type:'object', properties:{result:<natural>}, required:['result']}`.\n*\n* Same-document `$ref` / `$dynamicRef` JSON Pointers inside the natural schema\n* (e.g. `#/properties/foo` produced by zod for de-duplicated/recursive types)\n* are rewritten to account for the new `#/properties/result` root: bare `#` →\n* `#/properties/result`, `#/…` → `#/properties/result/…`. Cross-document refs\n* (anything not starting with `#`) are left untouched.\n*\n* The rewrite is position-aware: data-valued keywords\n* (`const`/`enum`/`default`/`examples`) in keyword position are NOT descended\n* into; the same names appearing as property names under\n* `properties`/`patternProperties`/`$defs`/`definitions`/`dependentSchemas`/\n* `dependencies` ARE descended into (they're subschemas). The rewrite is also\n* `$id`-scoped: if the natural root carries a base-establishing `$id` no\n* pointer is rewritten (same-document refs inside resolve against the embedded\n* `$id` base, not the wrapper root), and any subtree that establishes its own\n* `$id` is left untouched for the same reason. Fragment-only `$id` (`\"#item\"`,\n* draft-07's anchor spelling) does not establish a base and IS descended into.\n*/\nfunction wrapOutputSchemaForLegacy(natural) {\n\tconst $schema = typeof natural[\"$schema\"] === \"string\" ? natural[\"$schema\"] : void 0;\n\tif (establishesNewBase(natural[\"$id\"])) return {\n\t\t...$schema !== void 0 && { $schema },\n\t\ttype: \"object\",\n\t\tproperties: { result: natural },\n\t\trequired: [\"result\"]\n\t};\n\tconst convertRecursiveRefs = declares2019Dialect(natural[\"$schema\"]) && natural[\"$recursiveAnchor\"] !== true;\n\tconst rewriteRefs = (node, parentIsNameMap) => {\n\t\tif (Array.isArray(node)) return node.map((item) => rewriteRefs(item, false));\n\t\tif (node === null || typeof node !== \"object\") return node;\n\t\tif (!parentIsNameMap && establishesNewBase(node[\"$id\"])) return node;\n\t\tconst out = {};\n\t\tlet convertedRecursion = false;\n\t\tfor (const [k, v] of Object.entries(node)) if (parentIsNameMap) out[k] = rewriteRefs(v, false);\n\t\telse if ((k === \"$ref\" || k === \"$dynamicRef\") && typeof v === \"string\") out[k] = v === \"#\" ? \"#/properties/result\" : v.startsWith(\"#/\") ? `#/properties/result${v.slice(1)}` : v;\n\t\telse if (k === \"$recursiveRef\" && v === \"#\" && convertRecursiveRefs) convertedRecursion = true;\n\t\telse if (REF_REWRITE_DATA_POSITION_KEYS.has(k)) out[k] = v;\n\t\telse if (REF_REWRITE_NAME_MAP_KEYS.has(k)) out[k] = rewriteRefs(v, true);\n\t\telse out[k] = rewriteRefs(v, false);\n\t\tif (convertedRecursion) if (\"$ref\" in out) out[\"allOf\"] = [...Array.isArray(out[\"allOf\"]) ? out[\"allOf\"] : [], { $ref: \"#/properties/result\" }];\n\t\telse out[\"$ref\"] = \"#/properties/result\";\n\t\treturn out;\n\t};\n\treturn {\n\t\t...$schema !== void 0 && { $schema },\n\t\ttype: \"object\",\n\t\tproperties: { result: rewriteRefs(natural, false) },\n\t\trequired: [\"result\"]\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/registry.ts\nconst requestMethodKeys$1 = {\n\tping: null,\n\tinitialize: null,\n\t\"completion/complete\": null,\n\t\"logging/setLevel\": null,\n\t\"prompts/get\": null,\n\t\"prompts/list\": null,\n\t\"resources/list\": null,\n\t\"resources/templates/list\": null,\n\t\"resources/read\": null,\n\t\"resources/subscribe\": null,\n\t\"resources/unsubscribe\": null,\n\t\"tools/call\": null,\n\t\"tools/list\": null,\n\t\"tasks/get\": null,\n\t\"tasks/result\": null,\n\t\"tasks/list\": null,\n\t\"tasks/cancel\": null,\n\t\"sampling/createMessage\": null,\n\t\"elicitation/create\": null,\n\t\"roots/list\": null\n};\nconst notificationMethodKeys$1 = {\n\t\"notifications/cancelled\": null,\n\t\"notifications/progress\": null,\n\t\"notifications/initialized\": null,\n\t\"notifications/roots/list_changed\": null,\n\t\"notifications/tasks/status\": null,\n\t\"notifications/message\": null,\n\t\"notifications/resources/updated\": null,\n\t\"notifications/resources/list_changed\": null,\n\t\"notifications/tools/list_changed\": null,\n\t\"notifications/prompts/list_changed\": null,\n\t\"notifications/elicitation/complete\": null\n};\nconst resultMethodKeys = {\n\tping: null,\n\tinitialize: null,\n\t\"completion/complete\": null,\n\t\"logging/setLevel\": null,\n\t\"prompts/get\": null,\n\t\"prompts/list\": null,\n\t\"resources/list\": null,\n\t\"resources/templates/list\": null,\n\t\"resources/read\": null,\n\t\"resources/subscribe\": null,\n\t\"resources/unsubscribe\": null,\n\t\"tools/call\": null,\n\t\"tools/list\": null,\n\t\"sampling/createMessage\": null,\n\t\"elicitation/create\": null,\n\t\"roots/list\": null\n};\nlet maps$1;\nfunction registryMaps() {\n\tif (maps$1) return maps$1;\n\tconst s = buildSchemas2025();\n\tmaps$1 = {\n\t\trequestSchemas: {\n\t\t\tping: s.PingRequestSchema,\n\t\t\tinitialize: s.InitializeRequestSchema,\n\t\t\t\"completion/complete\": s.CompleteRequestSchema,\n\t\t\t\"logging/setLevel\": s.SetLevelRequestSchema,\n\t\t\t\"prompts/get\": s.GetPromptRequestSchema,\n\t\t\t\"prompts/list\": s.ListPromptsRequestSchema,\n\t\t\t\"resources/list\": s.ListResourcesRequestSchema,\n\t\t\t\"resources/templates/list\": s.ListResourceTemplatesRequestSchema,\n\t\t\t\"resources/read\": s.ReadResourceRequestSchema,\n\t\t\t\"resources/subscribe\": s.SubscribeRequestSchema,\n\t\t\t\"resources/unsubscribe\": s.UnsubscribeRequestSchema,\n\t\t\t\"tools/call\": s.CallToolRequestSchema,\n\t\t\t\"tools/list\": s.ListToolsRequestSchema,\n\t\t\t\"tasks/get\": s.GetTaskRequestSchema,\n\t\t\t\"tasks/result\": s.GetTaskPayloadRequestSchema,\n\t\t\t\"tasks/list\": s.ListTasksRequestSchema,\n\t\t\t\"tasks/cancel\": s.CancelTaskRequestSchema,\n\t\t\t\"sampling/createMessage\": s.CreateMessageRequestSchema,\n\t\t\t\"elicitation/create\": s.ElicitRequestSchema,\n\t\t\t\"roots/list\": s.ListRootsRequestSchema\n\t\t},\n\t\tnotificationSchemas: {\n\t\t\t\"notifications/cancelled\": s.CancelledNotificationSchema,\n\t\t\t\"notifications/progress\": s.ProgressNotificationSchema,\n\t\t\t\"notifications/initialized\": s.InitializedNotificationSchema,\n\t\t\t\"notifications/roots/list_changed\": s.RootsListChangedNotificationSchema,\n\t\t\t\"notifications/tasks/status\": s.TaskStatusNotificationSchema,\n\t\t\t\"notifications/message\": s.LoggingMessageNotificationSchema,\n\t\t\t\"notifications/resources/updated\": s.ResourceUpdatedNotificationSchema,\n\t\t\t\"notifications/resources/list_changed\": s.ResourceListChangedNotificationSchema,\n\t\t\t\"notifications/tools/list_changed\": s.ToolListChangedNotificationSchema,\n\t\t\t\"notifications/prompts/list_changed\": s.PromptListChangedNotificationSchema,\n\t\t\t\"notifications/elicitation/complete\": s.ElicitationCompleteNotificationSchema\n\t\t},\n\t\tresultSchemas: {\n\t\t\tping: s.EmptyResultSchema,\n\t\t\tinitialize: s.InitializeResultSchema,\n\t\t\t\"completion/complete\": s.CompleteResultSchema,\n\t\t\t\"logging/setLevel\": s.EmptyResultSchema,\n\t\t\t\"prompts/get\": s.GetPromptResultSchema,\n\t\t\t\"prompts/list\": s.ListPromptsResultSchema,\n\t\t\t\"resources/list\": s.ListResourcesResultSchema,\n\t\t\t\"resources/templates/list\": s.ListResourceTemplatesResultSchema,\n\t\t\t\"resources/read\": s.ReadResourceResultSchema,\n\t\t\t\"resources/subscribe\": s.EmptyResultSchema,\n\t\t\t\"resources/unsubscribe\": s.EmptyResultSchema,\n\t\t\t\"tools/call\": s.CallToolResultWireSchema,\n\t\t\t\"tools/list\": s.ListToolsResultSchema,\n\t\t\t\"sampling/createMessage\": s.CreateMessageResultWithToolsSchema,\n\t\t\t\"elicitation/create\": s.ElicitResultSchema,\n\t\t\t\"roots/list\": s.ListRootsResultSchema\n\t\t}\n\t};\n\treturn maps$1;\n}\n/**\n* Forces the lazy registry maps (and, through them, the era's schema memo).\n* Warm-up hook for `preloadSchemas()` — no-op once the maps exist.\n*/\nfunction warmRegistryMaps2025() {\n\tregistryMaps();\n}\n/** The 2025-era request-method set (registry membership = the deletion story). */\nfunction hasRequestMethod2025(method) {\n\treturn Object.prototype.hasOwnProperty.call(requestMethodKeys$1, method);\n}\n/** The 2025-era notification-method set. */\nfunction hasNotificationMethod2025(method) {\n\treturn Object.prototype.hasOwnProperty.call(notificationMethodKeys$1, method);\n}\n/** Result-map membership: exactly the era's typed-method subset (no task entries, no 2026-only methods). */\nfunction hasResultMethod(method) {\n\treturn Object.prototype.hasOwnProperty.call(resultMethodKeys, method);\n}\nfunction getResultSchema(method) {\n\treturn hasResultMethod(method) ? registryMaps().resultSchemas[method] : void 0;\n}\nfunction getRequestSchema(method) {\n\treturn hasRequestMethod2025(method) ? registryMaps().requestSchemas[method] : void 0;\n}\nfunction getNotificationSchema(method) {\n\treturn hasNotificationMethod2025(method) ? registryMaps().notificationSchemas[method] : void 0;\n}\n/** Registry method lists (for the spec-method universe and the CI registry-diff oracle). */\nconst rev2025RequestMethods = Object.keys(requestMethodKeys$1);\nconst rev2025NotificationMethods = Object.keys(notificationMethodKeys$1);\n\n//#endregion\n//#region ../core-internal/src/wire/rev2025-11-25/codec.ts\nfunction isPlainObject$6(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/** Tri-state wrap of an optional Zod schema lookup (the function-only contract). */\nfunction triState$1(schema, raw) {\n\tif (schema === void 0) return {\n\t\tok: false,\n\t\treason: \"not-in-era\"\n\t};\n\tconst parsed = schema.safeParse(raw);\n\treturn parsed.success ? {\n\t\tok: true,\n\t\tvalue: parsed.data\n\t} : {\n\t\tok: false,\n\t\treason: \"invalid\",\n\t\tmessage: String(parsed.error)\n\t};\n}\nconst NOT_IN_ERA$1 = {\n\tok: false,\n\treason: \"not-in-era\"\n};\n/** Whether a `tools/list` entry advertises a non-object `outputSchema` root that needs the SEP-2106 legacy wrap. */\nfunction toolNeedsLegacyWrap(t) {\n\treturn isPlainObject$6(t) && isPlainObject$6(t[\"outputSchema\"]) && isNonObjectJsonSchemaRoot(t[\"outputSchema\"]);\n}\n/** The wire→neutral trust boundary: a decoded 2025-era wire result is adopted as the neutral `Result` here (the module's single deliberate assertion). */\nfunction toNeutralResult(value) {\n\treturn value;\n}\nconst rev2025Codec = {\n\tera: \"2025-11-25\",\n\thasRequestMethod: hasRequestMethod2025,\n\thasNotificationMethod: hasNotificationMethod2025,\n\tvalidateRequest: (method, raw) => triState$1(getRequestSchema(method), raw),\n\tvalidateResult: (method, raw) => triState$1(getResultSchema(method), raw),\n\tvalidateNotification: (method, raw) => triState$1(getNotificationSchema(method), raw),\n\thasInputRequestMethod: () => false,\n\tvalidateInputRequest: () => NOT_IN_ERA$1,\n\tvalidateInputResponse: () => NOT_IN_ERA$1,\n\tsamplingResultVariant: ((hasTools, raw) => {\n\t\tconst s = buildSchemas2025();\n\t\treturn triState$1(hasTools ? s.CreateMessageResultWithToolsSchema : s.CreateMessageResultSchema, raw);\n\t}),\n\toutboundEnvelope: (_material) => void 0,\n\tvalidateEnvelopeMeta: (_meta) => [],\n\tprojectCallToolResult(result, advertisedOutputSchema) {\n\t\tconst withText = appendTextFallbackForNonObject(result);\n\t\tconst sc = withText.structuredContent;\n\t\tif (sc === void 0) return withText;\n\t\tconst valueIsNonObject = typeof sc !== \"object\" || sc === null || Array.isArray(sc);\n\t\tconst schemaWrapped = advertisedOutputSchema !== void 0 && isNonObjectJsonSchemaRoot(advertisedOutputSchema);\n\t\tif (!valueIsNonObject && !schemaWrapped) return withText;\n\t\treturn {\n\t\t\t...withText,\n\t\t\tstructuredContent: { result: sc }\n\t\t};\n\t},\n\tdecodeResult(_method, raw) {\n\t\tif (isPlainObject$6(raw) && \"resultType\" in raw) {\n\t\t\tconst stripped = { ...raw };\n\t\t\tdelete stripped[\"resultType\"];\n\t\t\treturn {\n\t\t\t\tkind: \"complete\",\n\t\t\t\tresult: toNeutralResult(stripped)\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"complete\",\n\t\t\tresult: toNeutralResult(raw)\n\t\t};\n\t},\n\tencodeResult(method, result) {\n\t\tif (method !== \"tools/list\") return result;\n\t\tconst tools = result.tools;\n\t\tif (!Array.isArray(tools) || !tools.some((t) => toolNeedsLegacyWrap(t))) return result;\n\t\treturn {\n\t\t\t...result,\n\t\t\ttools: tools.map((t) => toolNeedsLegacyWrap(t) ? {\n\t\t\t\t...t,\n\t\t\t\toutputSchema: wrapOutputSchemaForLegacy(t.outputSchema)\n\t\t\t} : t)\n\t\t};\n\t},\n\tencodeErrorCode: (code) => code === -32002 ? -32602 : code,\n\tcheckInboundEnvelope: (_material) => void 0\n};\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/buildSchemas.ts\n/**\n* 2026-era wire schemas (protocol revision 2026-07-28).\n*\n* Fully self-contained — no runtime imports from types/schemas.ts. The\n* neutral types/schemas.ts layer is the public-API superset and is free to\n* evolve; this file is the 2026 wire-parse contract and is BEHAVIOR-FROZEN\n* against the 2026-07-28 anchor. Every era-shared building block (content\n* blocks, resources, prompts, capabilities, notifications, …) that the wire\n* shapes compose is a frozen LOCAL copy — verbatim from the neutral layer at\n* the point this revision was sealed, dependencies first. The only cross-layer\n* dependency is `import type { JSONObject, JSONValue }` from the neutral types\n* barrel — pure structural type aliases with no parse behavior.\n*\n* This module is the only place the per-request `_meta` envelope is modeled.\n* The envelope is wire-only vocabulary: the protocol layer lifts it off\n* inbound requests before any handler runs and surfaces it at\n* `ctx.mcpReq.envelope`; the 2026-era codec enforces its requiredness at\n* dispatch time (`checkInboundEnvelope`) - the former neutral-schema JSDoc\n* deferral (\"enforced per request at dispatch time, not here\") is now\n* discharged by that codec step.\n*\n* No 2025-era traffic ever touches this module, so requiredness here is\n* bare and spec-exact (the shared-schema `.catch` hazards do not apply).\n*\n* SPEC-CURRENCY RE-SEAL (2026-07-17): the 2026-07-28 revision was re-sealed\n* upstream by spec PR #3002 (commit 71e30695, merged 2026-07-15 — after the\n* previous anchor pin f68d864a): the envelope's `clientInfo` demoted from\n* required to SHOULD, and `DiscoverResult.serverInfo` moved from the result\n* body to the new `ResultMetaObject` key\n* `_meta['io.modelcontextprotocol/serverInfo']` (optional on every result).\n* The shapes below are the re-sealed anchor, exactly — no pre-#3002 shape is\n* modeled anywhere (per ruling: the final revision is the only 2026-07-28).\n*/\nfunction build() {\n\tconst JSONValueSchema$1 = z.lazy(() => z.union([\n\t\tz.string(),\n\t\tz.number(),\n\t\tz.boolean(),\n\t\tz.null(),\n\t\tz.record(z.string(), JSONValueSchema$1),\n\t\tz.array(JSONValueSchema$1)\n\t]));\n\tconst JSONObjectSchema$1 = z.record(z.string(), JSONValueSchema$1);\n\t/**\n\t* A progress token, used to associate progress notifications with the original request.\n\t*/\n\tconst ProgressTokenSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* An opaque token used to represent a cursor for pagination.\n\t*/\n\tconst CursorSchema$1 = z.string();\n\t/**\n\t* A uniquely identifying ID for a request in JSON-RPC.\n\t*/\n\tconst RequestIdSchema$1 = z.union([z.string(), z.number().int()]);\n\t/**\n\t* The sender or recipient of messages and data in a conversation.\n\t*/\n\tconst RoleSchema$1 = z.enum([\"user\", \"assistant\"]);\n\t/**\n\t* The severity of a log message.\n\t*/\n\tconst LoggingLevelSchema$1 = z.enum([\n\t\t\"debug\",\n\t\t\"info\",\n\t\t\"notice\",\n\t\t\"warning\",\n\t\t\"error\",\n\t\t\"critical\",\n\t\t\"alert\",\n\t\t\"emergency\"\n\t]);\n\t/**\n\t* A Zod schema for validating Base64 strings that is more performant and\n\t* robust for very large inputs than the default regex-based check. It avoids\n\t* stack overflows by using the native `atob` function for validation.\n\t*/\n\tconst Base64Schema = z.string().refine((val) => {\n\t\ttry {\n\t\t\tatob(val);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, { message: \"Invalid Base64 string\" });\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst TaskMetadataSchema$1 = z.object({ ttl: z.number().optional() });\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst RelatedTaskMetadataSchema$1 = z.object({ taskId: z.string() });\n\tconst RequestMetaSchema$1 = z.looseObject({\n\t\tprogressToken: ProgressTokenSchema$1.optional(),\n\t\t\"io.modelcontextprotocol/related-task\": RelatedTaskMetadataSchema$1.optional()\n\t});\n\tconst BaseRequestParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst TaskAugmentedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ task: TaskMetadataSchema$1.optional() });\n\tconst NotificationsParamsSchema$1 = z.object({ _meta: RequestMetaSchema$1.optional() });\n\tconst NotificationSchema$1 = z.object({\n\t\tmethod: z.string(),\n\t\tparams: NotificationsParamsSchema$1.loose().optional()\n\t});\n\tconst IconSchema$1 = z.object({\n\t\tsrc: z.string(),\n\t\tmimeType: z.string().optional(),\n\t\tsizes: z.array(z.string()).optional(),\n\t\ttheme: z.enum([\"light\", \"dark\"]).optional()\n\t});\n\tconst IconsSchema$1 = z.object({ icons: z.array(IconSchema$1).optional() });\n\tconst BaseMetadataSchema$1 = z.object({\n\t\tname: z.string(),\n\t\ttitle: z.string().optional()\n\t});\n\tconst ImplementationSchema$1 = BaseMetadataSchema$1.extend({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tversion: z.string(),\n\t\twebsiteUrl: z.string().optional(),\n\t\tdescription: z.string().optional()\n\t});\n\tconst FormElicitationCapabilitySchema = z.intersection(z.object({ applyDefaults: z.boolean().optional() }), JSONObjectSchema$1);\n\tconst ElicitationCapabilitySchema = z.preprocess((value) => {\n\t\tif (value && typeof value === \"object\" && !Array.isArray(value) && Object.keys(value).length === 0) return { form: {} };\n\t\treturn value;\n\t}, z.intersection(z.object({\n\t\tform: FormElicitationCapabilitySchema.optional(),\n\t\turl: JSONObjectSchema$1.optional()\n\t}), JSONObjectSchema$1.optional()));\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst ClientTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({\n\t\t\tsampling: z.looseObject({ createMessage: JSONObjectSchema$1.optional() }).optional(),\n\t\t\telicitation: z.looseObject({ create: JSONObjectSchema$1.optional() }).optional()\n\t\t}).optional()\n\t});\n\t/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */\n\tconst ServerTasksCapabilitySchema$1 = z.looseObject({\n\t\tlist: JSONObjectSchema$1.optional(),\n\t\tcancel: JSONObjectSchema$1.optional(),\n\t\trequests: z.looseObject({ tools: z.looseObject({ call: JSONObjectSchema$1.optional() }).optional() }).optional()\n\t});\n\tconst ClientCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tsampling: z.object({\n\t\t\tcontext: JSONObjectSchema$1.optional(),\n\t\t\ttools: JSONObjectSchema$1.optional()\n\t\t}).optional(),\n\t\telicitation: ElicitationCapabilitySchema.optional(),\n\t\troots: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ClientTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\tconst ServerCapabilitiesSchema$1 = z.object({\n\t\texperimental: z.record(z.string(), JSONObjectSchema$1).optional(),\n\t\tlogging: JSONObjectSchema$1.optional(),\n\t\tcompletions: JSONObjectSchema$1.optional(),\n\t\tprompts: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\tresources: z.object({\n\t\t\tsubscribe: z.boolean().optional(),\n\t\t\tlistChanged: z.boolean().optional()\n\t\t}).optional(),\n\t\ttools: z.object({ listChanged: z.boolean().optional() }).optional(),\n\t\ttasks: ServerTasksCapabilitySchema$1.optional(),\n\t\textensions: z.record(z.string(), JSONObjectSchema$1).optional()\n\t});\n\tconst ProgressSchema$1 = z.object({\n\t\tprogress: z.number(),\n\t\ttotal: z.optional(z.number()),\n\t\tmessage: z.optional(z.string())\n\t});\n\tconst ProgressNotificationParamsSchema$1 = z.object({\n\t\t...NotificationsParamsSchema$1.shape,\n\t\t...ProgressSchema$1.shape,\n\t\tprogressToken: ProgressTokenSchema$1\n\t});\n\tconst ProgressNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/progress\"),\n\t\tparams: ProgressNotificationParamsSchema$1\n\t});\n\tconst LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({\n\t\tlevel: LoggingLevelSchema$1,\n\t\tlogger: z.string().optional(),\n\t\tdata: z.unknown()\n\t});\n\tconst LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/message\"),\n\t\tparams: LoggingMessageNotificationParamsSchema$1\n\t});\n\tconst ResourceContentsSchema$1 = z.object({\n\t\turi: z.string(),\n\t\tmimeType: z.optional(z.string()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst TextResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ text: z.string() });\n\tconst BlobResourceContentsSchema$1 = ResourceContentsSchema$1.extend({ blob: Base64Schema });\n\tconst AnnotationsSchema$1 = z.object({\n\t\taudience: z.array(RoleSchema$1).optional(),\n\t\tpriority: z.number().min(0).max(1).optional(),\n\t\tlastModified: z.iso.datetime({ offset: true }).optional()\n\t});\n\tconst ResourceSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turi: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tsize: z.optional(z.number()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\tconst ResourceTemplateSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\turiTemplate: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\tmimeType: z.optional(z.string()),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\tconst ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: z.string() });\n\tconst ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/resources/updated\"),\n\t\tparams: ResourceUpdatedNotificationParamsSchema$1\n\t});\n\tconst PromptArgumentSchema$1 = z.object({\n\t\tname: z.string(),\n\t\tdescription: z.optional(z.string()),\n\t\trequired: z.optional(z.boolean())\n\t});\n\tconst PromptSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.optional(z.string()),\n\t\targuments: z.optional(z.array(PromptArgumentSchema$1)),\n\t\t_meta: z.optional(z.looseObject({}))\n\t});\n\tconst PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/prompts/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst TextContentSchema$1 = z.object({\n\t\ttype: z.literal(\"text\"),\n\t\ttext: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst ImageContentSchema$1 = z.object({\n\t\ttype: z.literal(\"image\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst AudioContentSchema$1 = z.object({\n\t\ttype: z.literal(\"audio\"),\n\t\tdata: Base64Schema,\n\t\tmimeType: z.string(),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst ToolUseContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_use\"),\n\t\tname: z.string(),\n\t\tid: z.string(),\n\t\tinput: z.record(z.string(), z.unknown()),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst EmbeddedResourceSchema$1 = z.object({\n\t\ttype: z.literal(\"resource\"),\n\t\tresource: z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),\n\t\tannotations: AnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: z.literal(\"resource_link\") });\n\tconst ContentBlockSchema$1 = z.union([\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tResourceLinkSchema$1,\n\t\tEmbeddedResourceSchema$1\n\t]);\n\tconst PromptMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: ContentBlockSchema$1\n\t});\n\tconst ToolAnnotationsSchema$1 = z.object({\n\t\ttitle: z.string().optional(),\n\t\treadOnlyHint: z.boolean().optional(),\n\t\tdestructiveHint: z.boolean().optional(),\n\t\tidempotentHint: z.boolean().optional(),\n\t\topenWorldHint: z.boolean().optional()\n\t});\n\tconst ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({\n\t\tmethod: z.literal(\"notifications/tools/list_changed\"),\n\t\tparams: NotificationsParamsSchema$1.optional()\n\t});\n\tconst ModelHintSchema$1 = z.object({ name: z.string().optional() });\n\tconst ModelPreferencesSchema$1 = z.object({\n\t\thints: z.array(ModelHintSchema$1).optional(),\n\t\tcostPriority: z.number().min(0).max(1).optional(),\n\t\tspeedPriority: z.number().min(0).max(1).optional(),\n\t\tintelligencePriority: z.number().min(0).max(1).optional()\n\t});\n\tconst ToolChoiceSchema$1 = z.object({ mode: z.enum([\n\t\t\"auto\",\n\t\t\"required\",\n\t\t\"none\"\n\t]).optional() });\n\tconst BooleanSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"boolean\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tdefault: z.boolean().optional()\n\t});\n\tconst StringSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminLength: z.number().optional(),\n\t\tmaxLength: z.number().optional(),\n\t\tformat: z.enum([\n\t\t\t\"email\",\n\t\t\t\"uri\",\n\t\t\t\"date\",\n\t\t\t\"date-time\"\n\t\t]).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\tconst NumberSchemaSchema$1 = z.object({\n\t\ttype: z.enum([\"number\", \"integer\"]),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminimum: z.number().optional(),\n\t\tmaximum: z.number().optional(),\n\t\tdefault: z.number().optional()\n\t});\n\tconst UntitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tdefault: z.string().optional()\n\t});\n\tconst TitledSingleSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\toneOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})),\n\t\tdefault: z.string().optional()\n\t});\n\tconst LegacyTitledEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"string\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tenum: z.array(z.string()),\n\t\tenumNames: z.array(z.string()).optional(),\n\t\tdefault: z.string().optional()\n\t});\n\tconst SingleSelectEnumSchemaSchema$1 = z.union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);\n\tconst UntitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({\n\t\t\ttype: z.literal(\"string\"),\n\t\t\tenum: z.array(z.string())\n\t\t}),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\tconst TitledMultiSelectEnumSchemaSchema$1 = z.object({\n\t\ttype: z.literal(\"array\"),\n\t\ttitle: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tminItems: z.number().optional(),\n\t\tmaxItems: z.number().optional(),\n\t\titems: z.object({ anyOf: z.array(z.object({\n\t\t\tconst: z.string(),\n\t\t\ttitle: z.string()\n\t\t})) }),\n\t\tdefault: z.array(z.string()).optional()\n\t});\n\tconst MultiSelectEnumSchemaSchema$1 = z.union([UntitledMultiSelectEnumSchemaSchema$1, TitledMultiSelectEnumSchemaSchema$1]);\n\tconst EnumSchemaSchema$1 = z.union([\n\t\tLegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema$1\n\t]);\n\tconst PrimitiveSchemaDefinitionSchema$1 = z.union([\n\t\tEnumSchemaSchema$1,\n\t\tBooleanSchemaSchema$1,\n\t\tStringSchemaSchema$1,\n\t\tNumberSchemaSchema$1\n\t]);\n\tconst ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({\n\t\tmode: z.literal(\"form\").optional(),\n\t\tmessage: z.string(),\n\t\trequestedSchema: z.object({\n\t\t\ttype: z.literal(\"object\"),\n\t\t\tproperties: z.record(z.string(), PrimitiveSchemaDefinitionSchema$1),\n\t\t\trequired: z.array(z.string()).optional()\n\t\t}).catchall(z.unknown())\n\t});\n\tconst ResourceTemplateReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/resource\"),\n\t\turi: z.string()\n\t});\n\tconst PromptReferenceSchema$1 = z.object({\n\t\ttype: z.literal(\"ref/prompt\"),\n\t\tname: z.string()\n\t});\n\tconst RootSchema$1 = z.object({\n\t\turi: z.string().startsWith(\"file://\"),\n\t\tname: z.string().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\tconst sharedClientCapabilityShape = ClientCapabilitiesSchema$1.shape;\n\tconst ClientCapabilities2026Schema = z.object({\n\t\texperimental: sharedClientCapabilityShape.experimental,\n\t\tsampling: sharedClientCapabilityShape.sampling,\n\t\telicitation: sharedClientCapabilityShape.elicitation,\n\t\troots: sharedClientCapabilityShape.roots,\n\t\textensions: sharedClientCapabilityShape.extensions\n\t});\n\tconst sharedServerCapabilityShape = ServerCapabilitiesSchema$1.shape;\n\tconst ServerCapabilities2026Schema = z.object({\n\t\texperimental: sharedServerCapabilityShape.experimental,\n\t\tlogging: sharedServerCapabilityShape.logging,\n\t\tcompletions: sharedServerCapabilityShape.completions,\n\t\tprompts: sharedServerCapabilityShape.prompts,\n\t\tresources: sharedServerCapabilityShape.resources,\n\t\ttools: sharedServerCapabilityShape.tools,\n\t\textensions: sharedServerCapabilityShape.extensions\n\t});\n\t/**\n\t* The per-request `_meta` envelope carried by every request under protocol revision\n\t* 2026-07-28: the protocol version governing the request, the client implementation\n\t* info, and the client's capabilities — declared per request rather than once at\n\t* initialization — plus the optional log-level opt-in.\n\t*\n\t* This schema models the complete envelope on its own (loose: foreign keys\n\t* pass through - the lift extracts exactly the reserved keys, so enforcement\n\t* never sees extension material). Requiredness is enforced per request at\n\t* dispatch time by the 2026-era codec's `checkInboundEnvelope` step.\n\t*/\n\tconst RequestMetaEnvelopeSchema = z.looseObject({\n\t\tprogressToken: ProgressTokenSchema$1.optional(),\n\t\t[PROTOCOL_VERSION_META_KEY]: z.string(),\n\t\t[CLIENT_INFO_META_KEY]: ImplementationSchema$1.optional(),\n\t\t[CLIENT_CAPABILITIES_META_KEY]: ClientCapabilities2026Schema,\n\t\t[LOG_LEVEL_META_KEY]: LoggingLevelSchema$1.optional()\n\t});\n\t/** 2026-era Tool: anchor-exact — no `execution` (deleted vocabulary). */\n\tconst ToolSchema$1 = z.object({\n\t\t...BaseMetadataSchema$1.shape,\n\t\t...IconsSchema$1.shape,\n\t\tdescription: z.string().optional(),\n\t\tinputSchema: z.looseObject({\n\t\t\t$schema: z.string().optional(),\n\t\t\ttype: z.literal(\"object\")\n\t\t}),\n\t\toutputSchema: z.looseObject({ $schema: z.string().optional() }).optional(),\n\t\tannotations: ToolAnnotationsSchema$1.optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/** 2026-era ToolResultContent (anchor-exact: `structuredContent?: unknown`). */\n\tconst ToolResultContentSchema$1 = z.object({\n\t\ttype: z.literal(\"tool_result\"),\n\t\ttoolUseId: z.string(),\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.unknown().optional(),\n\t\tisError: z.boolean().optional(),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/** 2026-era sampling content union (composes the forked tool-result shape). */\n\tconst SamplingMessageContentBlockSchema$1 = z.union([\n\t\tTextContentSchema$1,\n\t\tImageContentSchema$1,\n\t\tAudioContentSchema$1,\n\t\tToolUseContentSchema$1,\n\t\tToolResultContentSchema$1\n\t]);\n\t/** 2026-era SamplingMessage (anchor-exact: single block or array). */\n\tconst SamplingMessageSchema$1 = z.object({\n\t\trole: RoleSchema$1,\n\t\tcontent: z.union([SamplingMessageContentBlockSchema$1, z.array(SamplingMessageContentBlockSchema$1)]),\n\t\t_meta: z.record(z.string(), z.unknown()).optional()\n\t});\n\t/** Open union per the anchor: 'complete' | 'input_required' | string. */\n\tconst ResultTypeSchema = z.string();\n\t/**\n\t* Result `_meta` (anchor `ResultMetaObject`, added by spec PR #3002):\n\t* loose, with the serverInfo key typed when present; the outbound stamp\n\t* is the encode contract's `stampServerInfoMeta` step.\n\t*/\n\tconst ResultMetaSchema = z.looseObject({ [SERVER_INFO_META_KEY]: ImplementationSchema$1.optional().catch(void 0) });\n\tconst wireMeta = ResultMetaSchema.optional();\n\tfunction wireResult(shape) {\n\t\treturn z.looseObject({\n\t\t\t_meta: wireMeta,\n\t\t\tresultType: ResultTypeSchema.default(\"complete\"),\n\t\t\t...shape\n\t\t});\n\t}\n\tconst ResultSchema$1 = wireResult({});\n\tconst PaginatedResultSchema$1 = wireResult({ nextCursor: CursorSchema$1.optional() });\n\tconst CallToolResultSchema$1 = wireResult({\n\t\tcontent: z.array(ContentBlockSchema$1),\n\t\tstructuredContent: z.unknown().optional(),\n\t\tisError: z.boolean().optional()\n\t});\n\tconst ListToolsResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\ttools: z.array(ToolSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst ListPromptsResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tprompts: z.array(PromptSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst GetPromptResultSchema$1 = wireResult({\n\t\tdescription: z.string().optional(),\n\t\tmessages: z.array(PromptMessageSchema$1)\n\t});\n\tconst ListResourcesResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tresources: z.array(ResourceSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst ListResourceTemplatesResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tresourceTemplates: z.array(ResourceTemplateSchema$1),\n\t\tnextCursor: CursorSchema$1.optional()\n\t});\n\tconst ReadResourceResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\tcontents: z.array(z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]))\n\t});\n\tconst CompleteResultSchema$1 = wireResult({ completion: z.object({\n\t\tvalues: z.array(z.string()).max(100),\n\t\ttotal: z.number().int().optional(),\n\t\thasMore: z.boolean().optional()\n\t}).loose() });\n\t/** CacheableResult (SEP-2549): ttlMs and cacheScope REQUIRED per the anchor. */\n\tconst CacheableResultSchema = wireResult({\n\t\tttlMs: z.number().int().min(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"])\n\t});\n\tconst DiscoverResultSchema$1 = wireResult({\n\t\tttlMs: z.number().int().min(0).catch(0),\n\t\tcacheScope: z.enum([\"public\", \"private\"]).catch(\"private\"),\n\t\tsupportedVersions: z.array(z.string()),\n\t\tcapabilities: ServerCapabilities2026Schema,\n\t\tinstructions: z.string().optional()\n\t});\n\t/** 2026-era CreateMessageRequestParams (anchor-exact: forked SamplingMessage/Tool, no task augmentation). */\n\tconst CreateMessageRequestParamsSchema$1 = z.object({\n\t\tmessages: z.array(SamplingMessageSchema$1),\n\t\tmodelPreferences: ModelPreferencesSchema$1.optional(),\n\t\tsystemPrompt: z.string().optional(),\n\t\tincludeContext: z.enum([\n\t\t\t\"none\",\n\t\t\t\"thisServer\",\n\t\t\t\"allServers\"\n\t\t]).optional(),\n\t\ttemperature: z.number().optional(),\n\t\tmaxTokens: z.number().int(),\n\t\tstopSequences: z.array(z.string()).optional(),\n\t\tmetadata: JSONObjectSchema$1.optional(),\n\t\ttools: z.array(ToolSchema$1).optional(),\n\t\ttoolChoice: ToolChoiceSchema$1.optional()\n\t});\n\t/** 2026-era embedded sampling request (de-JSON-RPC'd). */\n\tconst CreateMessageRequestSchema$1 = z.object({\n\t\tmethod: z.literal(\"sampling/createMessage\"),\n\t\tparams: CreateMessageRequestParamsSchema$1\n\t});\n\t/**\n\t* 2026-era embedded roots listing request (de-JSON-RPC'd). Embedded input\n\t* requests do NOT carry the per-request `_meta` envelope on this revision —\n\t* the anchor declares a bare optional `_meta` on `params`.\n\t*/\n\tconst ListRootsRequestSchema$1 = z.object({\n\t\tmethod: z.literal(\"roots/list\"),\n\t\tparams: z.object({ _meta: z.record(z.string(), z.unknown()).optional() }).optional()\n\t});\n\t/** 2026-era embedded sampling response (anchor-exact: extends the forked SamplingMessage). */\n\tconst CreateMessageResultSchema$1 = z.object({\n\t\t...SamplingMessageSchema$1.shape,\n\t\tmodel: z.string(),\n\t\tstopReason: z.string().optional()\n\t});\n\t/** 2026-era embedded roots listing response (anchor-exact: bare `roots` array). */\n\tconst ListRootsResultSchema$1 = z.object({ roots: z.array(RootSchema$1) });\n\t/** 2026-era embedded elicitation response (anchor-exact: bare result, restricted content value types). */\n\tconst ElicitResultSchema$1 = z.object({\n\t\taction: z.enum([\n\t\t\t\"accept\",\n\t\t\t\"decline\",\n\t\t\t\"cancel\"\n\t\t]),\n\t\tcontent: z.record(z.string(), z.union([\n\t\t\tz.string(),\n\t\t\tz.number(),\n\t\t\tz.boolean(),\n\t\t\tz.array(z.string())\n\t\t])).optional()\n\t});\n\t/**\n\t* 2026-era URL-mode elicitation params (anchor-exact fork): the draft removed\n\t* `elicitationId` (and the `notifications/elicitation/complete` channel it\n\t* keyed) — the shared schema keeps the field because it is required on the\n\t* frozen 2025-11-25 revision.\n\t*/\n\tconst ElicitRequestURLParamsSchema$1 = z.object({\n\t\tmode: z.literal(\"url\"),\n\t\tmessage: z.string(),\n\t\turl: z.string().url()\n\t});\n\t/** 2026-era elicitation params (form mode is revision-identical; URL mode is the fork above). */\n\tconst ElicitRequestParamsSchema$1 = z.union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);\n\t/** 2026-era embedded elicitation request (de-JSON-RPC'd; see the URL-mode fork above). */\n\tconst ElicitRequestSchema$1 = z.object({\n\t\tmethod: z.literal(\"elicitation/create\"),\n\t\tparams: ElicitRequestParamsSchema$1\n\t});\n\t/** A single embedded input request (one of the three demoted server→client requests). */\n\tconst InputRequestSchema = z.union([\n\t\tCreateMessageRequestSchema$1,\n\t\tListRootsRequestSchema$1,\n\t\tElicitRequestSchema$1\n\t]);\n\t/** A single embedded input response — the BARE result union (never a `{method, result}` wrapper). */\n\tconst InputResponseSchema = z.union([\n\t\tCreateMessageResultSchema$1,\n\t\tListRootsResultSchema$1,\n\t\tElicitResultSchema$1\n\t]);\n\t/** Map of embedded input requests, keyed by server-assigned identifiers. */\n\tconst InputRequestsSchema = z.record(z.string(), InputRequestSchema);\n\t/** Map of embedded input responses, keyed by the corresponding request identifiers. */\n\tconst InputResponsesSchema = z.record(z.string(), InputResponseSchema);\n\t/**\n\t* The wire InputRequiredResult: `resultType: 'input_required'` plus at least\n\t* one of `inputRequests` / `requestState` (the at-least-one rule is enforced\n\t* at the server seam, not by this parse shape).\n\t*/\n\tconst InputRequiredResultSchema = wireResult({\n\t\tinputRequests: InputRequestsSchema.optional(),\n\t\trequestState: z.string().optional()\n\t});\n\t/** The retry-channel members carried by client-initiated requests on this revision. */\n\tconst retryParamsShape = {\n\t\tinputResponses: InputResponsesSchema.optional(),\n\t\trequestState: z.string().optional()\n\t};\n\t/** Anchor InputResponseRequestParams: the retry channel on top of the required request `_meta` envelope. */\n\tconst InputResponseRequestParamsSchema = z.object({\n\t\t_meta: RequestMetaEnvelopeSchema,\n\t\t...retryParamsShape\n\t});\n\t/** Post-lift request `_meta` (progressToken + extension keys; loose). */\n\tconst DispatchRequestMetaSchema = z.looseObject({ progressToken: ProgressTokenSchema$1.optional() });\n\tfunction wireRequest(method, paramsShape) {\n\t\treturn z.object({\n\t\t\tmethod: z.literal(method),\n\t\t\tparams: z.object({\n\t\t\t\t_meta: RequestMetaEnvelopeSchema,\n\t\t\t\t...paramsShape\n\t\t\t})\n\t\t});\n\t}\n\tfunction dispatchRequest(method, paramsShape) {\n\t\treturn z.object({\n\t\t\tmethod: z.literal(method),\n\t\t\tparams: z.object({\n\t\t\t\t_meta: DispatchRequestMetaSchema.optional(),\n\t\t\t\t...paramsShape\n\t\t\t}).optional()\n\t\t});\n\t}\n\tconst callToolParamsShape = {\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.unknown()).optional(),\n\t\t...retryParamsShape\n\t};\n\tconst paginatedParamsShape = { cursor: CursorSchema$1.optional() };\n\tconst CallToolRequestSchema$1 = wireRequest(\"tools/call\", callToolParamsShape);\n\tconst ListToolsRequestSchema$1 = wireRequest(\"tools/list\", paginatedParamsShape);\n\tconst ListPromptsRequestSchema$1 = wireRequest(\"prompts/list\", paginatedParamsShape);\n\tconst GetPromptRequestSchema$1 = wireRequest(\"prompts/get\", {\n\t\tname: z.string(),\n\t\targuments: z.record(z.string(), z.string()).optional(),\n\t\t...retryParamsShape\n\t});\n\tconst ListResourcesRequestSchema$1 = wireRequest(\"resources/list\", paginatedParamsShape);\n\tconst ListResourceTemplatesRequestSchema$1 = wireRequest(\"resources/templates/list\", paginatedParamsShape);\n\tconst ReadResourceRequestSchema$1 = wireRequest(\"resources/read\", {\n\t\turi: z.string(),\n\t\t...retryParamsShape\n\t});\n\tconst completeParamsShape = {\n\t\tref: z.union([PromptReferenceSchema$1, ResourceTemplateReferenceSchema$1]),\n\t\targument: z.object({\n\t\t\tname: z.string(),\n\t\t\tvalue: z.string()\n\t\t}),\n\t\tcontext: z.object({ arguments: z.record(z.string(), z.string()).optional() }).optional()\n\t};\n\tconst CompleteRequestSchema$1 = wireRequest(\"completion/complete\", completeParamsShape);\n\tconst DiscoverRequestSchema$1 = wireRequest(\"server/discover\", {});\n\t/** Anchor SubscriptionFilter (2026-only). */\n\tconst SubscriptionFilterSchema$1 = z.object({\n\t\ttoolsListChanged: z.boolean().optional(),\n\t\tpromptsListChanged: z.boolean().optional(),\n\t\tresourcesListChanged: z.boolean().optional(),\n\t\tresourceSubscriptions: z.array(z.string()).optional()\n\t});\n\tconst subscriptionsListenParamsShape = { notifications: SubscriptionFilterSchema$1 };\n\tconst SubscriptionsListenRequestSchema$1 = wireRequest(\"subscriptions/listen\", subscriptionsListenParamsShape);\n\t/**\n\t* Anchor SubscriptionsListenResultMeta — required subscriptionId stamp on\n\t* the graceful-close result. Extends `ResultMetaObject` since spec PR\n\t* #3002 (composed, so the serverInfo key and its leniency stay single-sourced).\n\t*/\n\tconst SubscriptionsListenResultMetaSchema$1 = ResultMetaSchema.extend({ \"io.modelcontextprotocol/subscriptionId\": RequestIdSchema$1 });\n\t/**\n\t* Anchor SubscriptionsListenResult (2026-only). The empty `subscriptions/listen`\n\t* response signalling that the subscription has ended gracefully (server\n\t* shutdown). An abrupt transport close carries no response — the client treats\n\t* stream-close-without-result as a disconnect.\n\t*/\n\tconst SubscriptionsListenResultSchema$1 = z.looseObject({\n\t\t_meta: SubscriptionsListenResultMetaSchema$1,\n\t\tresultType: ResultTypeSchema.default(\"complete\")\n\t});\n\t/** Dispatch (post-lift) request schemas, keyed by method — registry-internal. */\n\tconst dispatchRequestSchemas = {\n\t\t\"tools/call\": dispatchRequest(\"tools/call\", callToolParamsShape),\n\t\t\"tools/list\": dispatchRequest(\"tools/list\", paginatedParamsShape),\n\t\t\"prompts/get\": dispatchRequest(\"prompts/get\", {\n\t\t\tname: z.string(),\n\t\t\targuments: z.record(z.string(), z.string()).optional()\n\t\t}),\n\t\t\"prompts/list\": dispatchRequest(\"prompts/list\", paginatedParamsShape),\n\t\t\"resources/list\": dispatchRequest(\"resources/list\", paginatedParamsShape),\n\t\t\"resources/templates/list\": dispatchRequest(\"resources/templates/list\", paginatedParamsShape),\n\t\t\"resources/read\": dispatchRequest(\"resources/read\", { uri: z.string() }),\n\t\t\"completion/complete\": dispatchRequest(\"completion/complete\", completeParamsShape),\n\t\t\"server/discover\": dispatchRequest(\"server/discover\", {}),\n\t\t\"subscriptions/listen\": dispatchRequest(\"subscriptions/listen\", subscriptionsListenParamsShape)\n\t};\n\t/** Dispatch (post-lift) result schemas, keyed by method — what the funnel\n\t* validates AFTER `decodeResult` consumed `resultType`. */\n\tfunction liftedResult(shape) {\n\t\treturn z.looseObject({\n\t\t\t_meta: wireMeta,\n\t\t\t...shape\n\t\t});\n\t}\n\tconst dispatchResultSchemas = {\n\t\t\"tools/call\": liftedResult({\n\t\t\tcontent: z.array(ContentBlockSchema$1),\n\t\t\tstructuredContent: z.unknown().optional(),\n\t\t\tisError: z.boolean().optional()\n\t\t}),\n\t\t\"tools/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\ttools: z.array(ToolSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"prompts/get\": liftedResult({\n\t\t\tdescription: z.string().optional(),\n\t\t\tmessages: z.array(PromptMessageSchema$1)\n\t\t}),\n\t\t\"prompts/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tprompts: z.array(PromptSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"resources/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tresources: z.array(ResourceSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"resources/templates/list\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tresourceTemplates: z.array(ResourceTemplateSchema$1),\n\t\t\tnextCursor: CursorSchema$1.optional()\n\t\t}),\n\t\t\"resources/read\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]),\n\t\t\tcontents: z.array(z.union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]))\n\t\t}),\n\t\t\"completion/complete\": liftedResult({ completion: z.object({\n\t\t\tvalues: z.array(z.string()).max(100),\n\t\t\ttotal: z.number().int().optional(),\n\t\t\thasMore: z.boolean().optional()\n\t\t}).loose() }),\n\t\t\"server/discover\": liftedResult({\n\t\t\tttlMs: z.number().int().min(0).catch(0),\n\t\t\tcacheScope: z.enum([\"public\", \"private\"]).catch(\"private\"),\n\t\t\tsupportedVersions: z.array(z.string()),\n\t\t\tcapabilities: ServerCapabilities2026Schema,\n\t\t\tinstructions: z.string().optional()\n\t\t}),\n\t\t\"subscriptions/listen\": liftedResult({})\n\t};\n\t/**\n\t* Notification `_meta` (anchor `NotificationMetaObject`): loose, with the\n\t* subscriptions/listen demux key typed when present. Only the anchor-exact\n\t* SHAPE is modeled here — listen delivery itself (filter gating, demux,\n\t* teardown) is #14 scope and not implemented by this module.\n\t*/\n\tconst NotificationMetaSchema = z.looseObject({ \"io.modelcontextprotocol/subscriptionId\": RequestIdSchema$1.optional() });\n\t/** Anchor SubscriptionsAcknowledgedNotification (2026-only). */\n\tconst SubscriptionsAcknowledgedNotificationSchema$1 = z.object({\n\t\tmethod: z.literal(\"notifications/subscriptions/acknowledged\"),\n\t\tparams: z.object({\n\t\t\t_meta: NotificationMetaSchema.optional(),\n\t\t\tnotifications: SubscriptionFilterSchema$1\n\t\t})\n\t});\n\t/**\n\t* 2026-era `notifications/cancelled` params (anchor-exact fork): `requestId`\n\t* is REQUIRED on this revision — the shared schema keeps it optional because\n\t* the frozen 2025-11-25 shape declares it optional (task cancellation goes\n\t* through `tasks/cancel` there). Requiredness is bare because no 2025-era\n\t* traffic touches this module.\n\t*/\n\tconst CancelledNotificationParamsSchema$1 = z.object({\n\t\t_meta: NotificationMetaSchema.optional(),\n\t\trequestId: RequestIdSchema$1,\n\t\treason: z.string().optional()\n\t});\n\t/** 2026-era `notifications/cancelled` (see the params fork above). */\n\tconst CancelledNotificationSchema$1 = z.object({\n\t\tmethod: z.literal(\"notifications/cancelled\"),\n\t\tparams: CancelledNotificationParamsSchema$1\n\t});\n\tconst notificationSchemas2026 = {\n\t\t\"notifications/cancelled\": CancelledNotificationSchema$1,\n\t\t\"notifications/progress\": ProgressNotificationSchema$1,\n\t\t\"notifications/message\": LoggingMessageNotificationSchema$1,\n\t\t\"notifications/resources/updated\": ResourceUpdatedNotificationSchema$1,\n\t\t\"notifications/resources/list_changed\": ResourceListChangedNotificationSchema$1,\n\t\t\"notifications/tools/list_changed\": ToolListChangedNotificationSchema$1,\n\t\t\"notifications/prompts/list_changed\": PromptListChangedNotificationSchema$1,\n\t\t\"notifications/subscriptions/acknowledged\": SubscriptionsAcknowledgedNotificationSchema$1\n\t};\n\tconst wireResultResponse = (result) => z.object({\n\t\tjsonrpc: z.literal(\"2.0\"),\n\t\tid: z.union([z.string(), z.number().int()]),\n\t\tresult\n\t}).strict();\n\treturn {\n\t\tJSONValueSchema: JSONValueSchema$1,\n\t\tJSONObjectSchema: JSONObjectSchema$1,\n\t\tProgressTokenSchema: ProgressTokenSchema$1,\n\t\tCursorSchema: CursorSchema$1,\n\t\tRequestIdSchema: RequestIdSchema$1,\n\t\tRoleSchema: RoleSchema$1,\n\t\tLoggingLevelSchema: LoggingLevelSchema$1,\n\t\tTaskMetadataSchema: TaskMetadataSchema$1,\n\t\tRelatedTaskMetadataSchema: RelatedTaskMetadataSchema$1,\n\t\tRequestMetaSchema: RequestMetaSchema$1,\n\t\tBaseRequestParamsSchema: BaseRequestParamsSchema$1,\n\t\tTaskAugmentedRequestParamsSchema: TaskAugmentedRequestParamsSchema$1,\n\t\tNotificationsParamsSchema: NotificationsParamsSchema$1,\n\t\tNotificationSchema: NotificationSchema$1,\n\t\tIconSchema: IconSchema$1,\n\t\tIconsSchema: IconsSchema$1,\n\t\tBaseMetadataSchema: BaseMetadataSchema$1,\n\t\tImplementationSchema: ImplementationSchema$1,\n\t\tClientTasksCapabilitySchema: ClientTasksCapabilitySchema$1,\n\t\tServerTasksCapabilitySchema: ServerTasksCapabilitySchema$1,\n\t\tClientCapabilitiesSchema: ClientCapabilitiesSchema$1,\n\t\tServerCapabilitiesSchema: ServerCapabilitiesSchema$1,\n\t\tProgressSchema: ProgressSchema$1,\n\t\tProgressNotificationParamsSchema: ProgressNotificationParamsSchema$1,\n\t\tProgressNotificationSchema: ProgressNotificationSchema$1,\n\t\tLoggingMessageNotificationParamsSchema: LoggingMessageNotificationParamsSchema$1,\n\t\tLoggingMessageNotificationSchema: LoggingMessageNotificationSchema$1,\n\t\tResourceContentsSchema: ResourceContentsSchema$1,\n\t\tTextResourceContentsSchema: TextResourceContentsSchema$1,\n\t\tBlobResourceContentsSchema: BlobResourceContentsSchema$1,\n\t\tAnnotationsSchema: AnnotationsSchema$1,\n\t\tResourceSchema: ResourceSchema$1,\n\t\tResourceTemplateSchema: ResourceTemplateSchema$1,\n\t\tResourceListChangedNotificationSchema: ResourceListChangedNotificationSchema$1,\n\t\tResourceUpdatedNotificationParamsSchema: ResourceUpdatedNotificationParamsSchema$1,\n\t\tResourceUpdatedNotificationSchema: ResourceUpdatedNotificationSchema$1,\n\t\tPromptArgumentSchema: PromptArgumentSchema$1,\n\t\tPromptSchema: PromptSchema$1,\n\t\tPromptListChangedNotificationSchema: PromptListChangedNotificationSchema$1,\n\t\tTextContentSchema: TextContentSchema$1,\n\t\tImageContentSchema: ImageContentSchema$1,\n\t\tAudioContentSchema: AudioContentSchema$1,\n\t\tToolUseContentSchema: ToolUseContentSchema$1,\n\t\tEmbeddedResourceSchema: EmbeddedResourceSchema$1,\n\t\tResourceLinkSchema: ResourceLinkSchema$1,\n\t\tContentBlockSchema: ContentBlockSchema$1,\n\t\tPromptMessageSchema: PromptMessageSchema$1,\n\t\tToolAnnotationsSchema: ToolAnnotationsSchema$1,\n\t\tToolListChangedNotificationSchema: ToolListChangedNotificationSchema$1,\n\t\tModelHintSchema: ModelHintSchema$1,\n\t\tModelPreferencesSchema: ModelPreferencesSchema$1,\n\t\tToolChoiceSchema: ToolChoiceSchema$1,\n\t\tBooleanSchemaSchema: BooleanSchemaSchema$1,\n\t\tStringSchemaSchema: StringSchemaSchema$1,\n\t\tNumberSchemaSchema: NumberSchemaSchema$1,\n\t\tUntitledSingleSelectEnumSchemaSchema: UntitledSingleSelectEnumSchemaSchema$1,\n\t\tTitledSingleSelectEnumSchemaSchema: TitledSingleSelectEnumSchemaSchema$1,\n\t\tLegacyTitledEnumSchemaSchema: LegacyTitledEnumSchemaSchema$1,\n\t\tSingleSelectEnumSchemaSchema: SingleSelectEnumSchemaSchema$1,\n\t\tUntitledMultiSelectEnumSchemaSchema: UntitledMultiSelectEnumSchemaSchema$1,\n\t\tTitledMultiSelectEnumSchemaSchema: TitledMultiSelectEnumSchemaSchema$1,\n\t\tMultiSelectEnumSchemaSchema: MultiSelectEnumSchemaSchema$1,\n\t\tEnumSchemaSchema: EnumSchemaSchema$1,\n\t\tPrimitiveSchemaDefinitionSchema: PrimitiveSchemaDefinitionSchema$1,\n\t\tElicitRequestFormParamsSchema: ElicitRequestFormParamsSchema$1,\n\t\tResourceTemplateReferenceSchema: ResourceTemplateReferenceSchema$1,\n\t\tPromptReferenceSchema: PromptReferenceSchema$1,\n\t\tRootSchema: RootSchema$1,\n\t\tClientCapabilities2026Schema,\n\t\tServerCapabilities2026Schema,\n\t\tRequestMetaEnvelopeSchema,\n\t\tToolSchema: ToolSchema$1,\n\t\tToolResultContentSchema: ToolResultContentSchema$1,\n\t\tSamplingMessageContentBlockSchema: SamplingMessageContentBlockSchema$1,\n\t\tSamplingMessageSchema: SamplingMessageSchema$1,\n\t\tResultTypeSchema,\n\t\tResultMetaSchema,\n\t\tResultSchema: ResultSchema$1,\n\t\tPaginatedResultSchema: PaginatedResultSchema$1,\n\t\tCallToolResultSchema: CallToolResultSchema$1,\n\t\tListToolsResultSchema: ListToolsResultSchema$1,\n\t\tListPromptsResultSchema: ListPromptsResultSchema$1,\n\t\tGetPromptResultSchema: GetPromptResultSchema$1,\n\t\tListResourcesResultSchema: ListResourcesResultSchema$1,\n\t\tListResourceTemplatesResultSchema: ListResourceTemplatesResultSchema$1,\n\t\tReadResourceResultSchema: ReadResourceResultSchema$1,\n\t\tCompleteResultSchema: CompleteResultSchema$1,\n\t\tCacheableResultSchema,\n\t\tDiscoverResultSchema: DiscoverResultSchema$1,\n\t\tCreateMessageRequestParamsSchema: CreateMessageRequestParamsSchema$1,\n\t\tCreateMessageRequestSchema: CreateMessageRequestSchema$1,\n\t\tListRootsRequestSchema: ListRootsRequestSchema$1,\n\t\tCreateMessageResultSchema: CreateMessageResultSchema$1,\n\t\tListRootsResultSchema: ListRootsResultSchema$1,\n\t\tElicitResultSchema: ElicitResultSchema$1,\n\t\tElicitRequestURLParamsSchema: ElicitRequestURLParamsSchema$1,\n\t\tElicitRequestParamsSchema: ElicitRequestParamsSchema$1,\n\t\tElicitRequestSchema: ElicitRequestSchema$1,\n\t\tInputRequestSchema,\n\t\tInputResponseSchema,\n\t\tInputRequestsSchema,\n\t\tInputResponsesSchema,\n\t\tInputRequiredResultSchema,\n\t\tInputResponseRequestParamsSchema,\n\t\tCallToolRequestSchema: CallToolRequestSchema$1,\n\t\tListToolsRequestSchema: ListToolsRequestSchema$1,\n\t\tListPromptsRequestSchema: ListPromptsRequestSchema$1,\n\t\tGetPromptRequestSchema: GetPromptRequestSchema$1,\n\t\tListResourcesRequestSchema: ListResourcesRequestSchema$1,\n\t\tListResourceTemplatesRequestSchema: ListResourceTemplatesRequestSchema$1,\n\t\tReadResourceRequestSchema: ReadResourceRequestSchema$1,\n\t\tCompleteRequestSchema: CompleteRequestSchema$1,\n\t\tDiscoverRequestSchema: DiscoverRequestSchema$1,\n\t\tSubscriptionFilterSchema: SubscriptionFilterSchema$1,\n\t\tSubscriptionsListenRequestSchema: SubscriptionsListenRequestSchema$1,\n\t\tSubscriptionsListenResultMetaSchema: SubscriptionsListenResultMetaSchema$1,\n\t\tSubscriptionsListenResultSchema: SubscriptionsListenResultSchema$1,\n\t\tdispatchRequestSchemas,\n\t\tdispatchResultSchemas,\n\t\tNotificationMetaSchema,\n\t\tSubscriptionsAcknowledgedNotificationSchema: SubscriptionsAcknowledgedNotificationSchema$1,\n\t\tCancelledNotificationParamsSchema: CancelledNotificationParamsSchema$1,\n\t\tCancelledNotificationSchema: CancelledNotificationSchema$1,\n\t\tnotificationSchemas2026,\n\t\tJSONRPCResultResponseSchema: wireResultResponse(ResultSchema$1),\n\t\tCallToolResultResponseSchema: wireResultResponse(z.union([CallToolResultSchema$1, InputRequiredResultSchema])),\n\t\tListToolsResultResponseSchema: wireResultResponse(ListToolsResultSchema$1),\n\t\tListPromptsResultResponseSchema: wireResultResponse(ListPromptsResultSchema$1),\n\t\tGetPromptResultResponseSchema: wireResultResponse(z.union([GetPromptResultSchema$1, InputRequiredResultSchema])),\n\t\tListResourcesResultResponseSchema: wireResultResponse(ListResourcesResultSchema$1),\n\t\tListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),\n\t\tReadResourceResultResponseSchema: wireResultResponse(z.union([ReadResourceResultSchema$1, InputRequiredResultSchema])),\n\t\tCompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),\n\t\tDiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1)\n\t};\n}\nlet memo;\n/**\n* Builds the era wire-schema set on first call and returns the same object\n* thereafter. Module evaluation stays construction-free so importing the\n* era codec/registry costs nothing until the first validation actually\n* needs a schema; the registry, the codec, and the eager `schemas.ts`\n* shim all pull through this memo, so reference identity holds across\n* every consumer.\n*/\nfunction buildSchemas2026() {\n\treturn memo ??= build();\n}\n\n//#endregion\n//#region ../core-internal/src/shared/resultCacheHints.ts\n/**\n* The operations whose results are cacheable on the 2026-07-28 revision (the\n* `CacheableResult` extenders). This list is closed: no other operation's\n* result ever receives cache fields from the SDK.\n*/\nconst CACHEABLE_RESULT_METHODS = [\n\t\"tools/list\",\n\t\"prompts/list\",\n\t\"resources/list\",\n\t\"resources/templates/list\",\n\t\"resources/read\",\n\t\"server/discover\"\n];\n/** Whether the given method's result is cacheable on the 2026-07-28 revision. */\nfunction isCacheableResultMethod(method) {\n\treturn CACHEABLE_RESULT_METHODS.includes(method);\n}\n/**\n* The symbol-keyed carrier for a configured cache hint on a result object.\n* Symbol properties are invisible to JSON serialization, so the carrier can be\n* attached era-blind: only the 2026-era encode seam consumes it.\n*/\nconst RESULT_CACHE_HINT_FALLBACK = Symbol(\"modelcontextprotocol.resultCacheHintFallback\");\n/**\n* Attaches a configured cache hint to a result as the encode-time fallback.\n* Returns the result unchanged when there is nothing to attach. When a more\n* specific hint is already attached, the two hints are combined per field\n* (most-specific-author-wins for each of `ttlMs` and `cacheScope`): the\n* per-registration hint attached by the feature layer keeps every field it\n* sets, and the server-level per-operation hint only fills the fields the\n* more specific hint leaves unset.\n*/\nfunction attachCacheHintFallback(result, hint) {\n\tif (hint === void 0) return result;\n\tconst attached = result[RESULT_CACHE_HINT_FALLBACK];\n\tif (attached === void 0) return {\n\t\t...result,\n\t\t[RESULT_CACHE_HINT_FALLBACK]: hint\n\t};\n\tconst merged = {};\n\tconst ttlMs = attached.ttlMs ?? hint.ttlMs;\n\tif (ttlMs !== void 0) merged.ttlMs = ttlMs;\n\tconst cacheScope = attached.cacheScope ?? hint.cacheScope;\n\tif (cacheScope !== void 0) merged.cacheScope = cacheScope;\n\treturn {\n\t\t...result,\n\t\t[RESULT_CACHE_HINT_FALLBACK]: merged\n\t};\n}\n/** Reads the configured cache-hint fallback attached to a result, if any. */\nfunction cacheHintFallbackOf(result) {\n\treturn result[RESULT_CACHE_HINT_FALLBACK];\n}\n/**\n* Whether a value is a valid `ttlMs`: a non-negative safe integer. Safe\n* integers are required because the wire schemas validate `ttlMs` as an\n* integer within `Number.MIN_SAFE_INTEGER`/`Number.MAX_SAFE_INTEGER`; a value\n* outside that range is treated as invalid here so it falls through to the\n* next author instead of being emitted and rejected downstream.\n*/\nfunction isValidCacheTtlMs(value) {\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0;\n}\n/** Whether a value is a valid `cacheScope`. */\nfunction isValidCacheScope(value) {\n\treturn value === \"public\" || value === \"private\";\n}\n/**\n* Validates a configured cache hint at configuration time. Throws a\n* `RangeError` naming the offending field, so misconfiguration fails at\n* startup/registration rather than silently degrading at encode time.\n*/\nfunction assertValidCacheHint(hint, context) {\n\tif (hint.ttlMs !== void 0 && !isValidCacheTtlMs(hint.ttlMs)) throw new RangeError(`Invalid cache hint for ${context}: ttlMs must be a non-negative safe integer (got ${String(hint.ttlMs)})`);\n\tif (hint.cacheScope !== void 0 && !isValidCacheScope(hint.cacheScope)) throw new RangeError(`Invalid cache hint for ${context}: cacheScope must be 'public' or 'private' (got ${String(hint.cacheScope)})`);\n}\n\n//#endregion\n//#region ../core-internal/src/types/enums.ts\n/**\n* Error codes for protocol errors that cross the wire as JSON-RPC error responses.\n* These follow the JSON-RPC specification and MCP-specific extensions.\n*/\nlet ProtocolErrorCode = /* @__PURE__ */ function(ProtocolErrorCode$1) {\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"ParseError\"] = -32700] = \"ParseError\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"InvalidRequest\"] = -32600] = \"InvalidRequest\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"MethodNotFound\"] = -32601] = \"MethodNotFound\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"InvalidParams\"] = -32602] = \"InvalidParams\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"InternalError\"] = -32603] = \"InternalError\";\n\t/**\n\t* Resource not found.\n\t*\n\t* Receive-tolerated only: the SDK never EMITS `-32002` — `resources/read`\n\t* misses answer `-32602` (Invalid Params) on every protocol revision per\n\t* the 2026-07-28 spec MUST, and a handler-thrown `-32002` is mapped to\n\t* `-32602` at the era encode seam. The member stays importable so clients\n\t* can recognise `-32002` from peers built on earlier SDK releases (the\n\t* spec's \"clients SHOULD also accept `-32002`\" backwards-compatibility\n\t* clause). Throw `ResourceNotFoundError` instead.\n\t*/\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"ResourceNotFound\"] = -32002] = \"ResourceNotFound\";\n\t/**\n\t* Processing the request requires a capability the client did not declare\n\t* in the request's `clientCapabilities` (protocol revision 2026-07-28).\n\t*/\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"MissingRequiredClientCapability\"] = -32021] = \"MissingRequiredClientCapability\";\n\t/**\n\t* The request's protocol version is unknown to the server or unsupported\n\t* by it (protocol revision 2026-07-28).\n\t*/\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"UnsupportedProtocolVersion\"] = -32022] = \"UnsupportedProtocolVersion\";\n\tProtocolErrorCode$1[ProtocolErrorCode$1[\"UrlElicitationRequired\"] = -32042] = \"UrlElicitationRequired\";\n\treturn ProtocolErrorCode$1;\n}({});\n\n//#endregion\n//#region ../core-internal/src/types/errors.ts\n/**\n* Protocol errors are JSON-RPC errors that cross the wire as error responses.\n* They use numeric error codes from the {@linkcode ProtocolErrorCode} enum.\n*\n* `instanceof` on this class (and its subclasses) is brand-matched, so it works\n* across separately bundled copies of the SDK — e.g. an error constructed by\n* `@modelcontextprotocol/client` matches the class re-exported by\n* `@modelcontextprotocol/server` in the same process.\n*/\nvar ProtocolError = class ProtocolError extends Error {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.ProtocolError\" });\n\t}\n\tstatic [Symbol.hasInstance](value) {\n\t\treturn brandedHasInstance(this, value);\n\t}\n\t/**\n\t* Brand-based type guard: equivalent to `value instanceof this`, as an\n\t* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads\n\t* the caller's own brand via `this`, so every branded subclass gets a\n\t* correctly-scoped guard by inheritance. Must be invoked on the class —\n\t* in callback position write `v => SdkError.isInstance(v)`, not\n\t* `.filter(SdkError.isInstance)` (detached calls throw rather than\n\t* silently matching nothing).\n\t*/\n\tstatic isInstance(value) {\n\t\tif (typeof this !== \"function\") throw new TypeError(\"isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`\");\n\t\treturn brandedHasInstance(this, value);\n\t}\n\tconstructor(code, message, data) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.data = data;\n\t\tthis.name = \"ProtocolError\";\n\t\tstampErrorBrands(this, new.target);\n\t}\n\t/**\n\t* Factory method to create the appropriate error type based on the error code and data\n\t*/\n\tstatic fromError(code, message, data) {\n\t\tif (code === ProtocolErrorCode.UrlElicitationRequired && data) {\n\t\t\tconst errorData = data;\n\t\t\tif (errorData.elicitations) return new UrlElicitationRequiredError(errorData.elicitations, message);\n\t\t}\n\t\tif (code === ProtocolErrorCode.UnsupportedProtocolVersion && data) {\n\t\t\tconst errorData = data;\n\t\t\tif (Array.isArray(errorData.supported) && typeof errorData.requested === \"string\") return new UnsupportedProtocolVersionError({\n\t\t\t\tsupported: errorData.supported,\n\t\t\t\trequested: errorData.requested\n\t\t\t}, message);\n\t\t}\n\t\tif (code === ProtocolErrorCode.InvalidParams || code === ProtocolErrorCode.ResourceNotFound) {\n\t\t\tconst errorData = data;\n\t\t\tif (typeof errorData?.uri === \"string\" && (code === ProtocolErrorCode.ResourceNotFound || Object.keys(errorData).length === 1)) return new ResourceNotFoundError(errorData.uri, message);\n\t\t}\n\t\tif (code === ProtocolErrorCode.MissingRequiredClientCapability && data) {\n\t\t\tconst errorData = data;\n\t\t\tif (errorData.requiredCapabilities !== null && typeof errorData.requiredCapabilities === \"object\" && !Array.isArray(errorData.requiredCapabilities)) return new MissingRequiredClientCapabilityError({ requiredCapabilities: errorData.requiredCapabilities }, message);\n\t\t}\n\t\treturn new ProtocolError(code, message, data);\n\t}\n};\n/**\n* Error type for a `resources/read` miss: the requested resource does not\n* exist. The wire code is `-32602` (Invalid Params) on every protocol\n* revision — the spec MUST for revision 2026-07-28, and the value the v1.x\n* SDK has always emitted on earlier revisions. The error data echoes the\n* requested URI.\n*\n* Recognise this error by checking `error.data` is exactly `{ uri: string }`\n* (a `-32602` whose data carries `uri` and nothing else is resource-not-found;\n* any other `-32602` is an ordinary Invalid Params). For backwards compatibility, clients should also\n* accept `-32002` as resource not found — earlier SDK builds emitted that\n* code, and {@linkcode ProtocolError.fromError} reconstructs this class for\n* either code **when `error.data` carries `uri`** (a bare `-32002` without\n* `data.uri` stays a generic {@linkcode ProtocolError}). `instanceof` checks\n* are brand-matched and work across separately bundled copies of the SDK.\n*/\nvar ResourceNotFoundError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.ResourceNotFoundError\" });\n\t}\n\tconstructor(uri, message = `Resource not found: ${uri}`) {\n\t\tsuper(ProtocolErrorCode.InvalidParams, message, { uri });\n\t}\n\t/** The URI that was requested and not found. */\n\tget uri() {\n\t\treturn this.data.uri;\n\t}\n};\n/**\n* Specialized error type when a tool requires a URL mode elicitation.\n* This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.\n*/\nvar UrlElicitationRequiredError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.UrlElicitationRequiredError\" });\n\t}\n\tconstructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? \"s\" : \"\"} required`) {\n\t\tsuper(ProtocolErrorCode.UrlElicitationRequired, message, { elicitations });\n\t}\n\tget elicitations() {\n\t\treturn this.data?.elicitations ?? [];\n\t}\n};\n/**\n* Error type for the `-32022` UnsupportedProtocolVersion protocol error (protocol\n* revision 2026-07-28): the request's protocol version is unknown to the server or\n* unsupported by it.\n*\n* The error data lists the protocol versions the receiver supports (`supported`),\n* so the sender can choose a mutually supported version and retry, and echoes the\n* version that was requested (`requested`).\n*/\nvar UnsupportedProtocolVersionError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.UnsupportedProtocolVersionError\" });\n\t}\n\tconstructor(data, message = `Unsupported protocol version: ${data.requested}`) {\n\t\tsuper(ProtocolErrorCode.UnsupportedProtocolVersion, message, data);\n\t}\n\t/**\n\t* Protocol versions the receiver supports.\n\t*/\n\tget supported() {\n\t\treturn this.data.supported;\n\t}\n\t/**\n\t* The protocol version that was requested.\n\t*/\n\tget requested() {\n\t\treturn this.data.requested;\n\t}\n};\n/**\n* Error type for the `-32021` MissingRequiredClientCapability protocol error\n* (protocol revision 2026-07-28): processing the request requires a capability\n* the client did not declare in the request's `clientCapabilities`.\n*\n* The error data lists the missing capabilities (`requiredCapabilities`) in\n* the `ClientCapabilities` shape, so the client can see exactly what it would\n* have to declare for the request to be served. On HTTP, the response status\n* is `400 Bad Request`.\n*\n* Recognize this error by its code and `data.requiredCapabilities`, or by\n* `instanceof` — checks are brand-matched and work across separately bundled\n* copies of the SDK.\n*/\nvar MissingRequiredClientCapabilityError = class extends ProtocolError {\n\tstatic {\n\t\tObject.defineProperty(this, \"mcpBrand\", { value: \"mcp.MissingRequiredClientCapabilityError\" });\n\t}\n\tconstructor(data, message = `Missing required client capabilities: ${Object.keys(data.requiredCapabilities).join(\", \")}`) {\n\t\tsuper(ProtocolErrorCode.MissingRequiredClientCapability, message, data);\n\t}\n\t/**\n\t* The capabilities the server requires from the client to process the\n\t* request (only the missing capabilities are listed).\n\t*/\n\tget requiredCapabilities() {\n\t\treturn this.data.requiredCapabilities;\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/encodeContract.ts\n/** The default cache policy when neither the handler nor configuration provides one. */\nconst DEFAULT_CACHE_TTL_MS = 0;\nconst DEFAULT_CACHE_SCOPE = \"private\";\n/**\n* Request methods whose spec result vocabulary goes beyond `'complete'` on the\n* 2026-07-28 revision: their results may be `input_required` (multi\n* round-trip requests), so a handler-provided `resultType` passes through the\n* stamp untouched. `subscriptions/listen` is NOT in this set: it never emits\n* a JSON-RPC result — termination is stream close (HTTP) or\n* `notifications/cancelled` (stdio) per the spec.\n*/\nconst EXTENDED_RESULT_TYPE_METHODS = [\n\t\"tools/call\",\n\t\"prompts/get\",\n\t\"resources/read\"\n];\n/**\n* Step 1 of the encode contract: ensure the outbound result carries the\n* required `resultType` discriminator.\n*\n* - No handler-provided value → stamp `'complete'`.\n* - Handler-provided `'complete'` → kept as-is.\n* - Handler-provided non-`'complete'` value on a method whose vocabulary\n* allows it ({@linkcode EXTENDED_RESULT_TYPE_METHODS}) → passes through.\n* The value is forwarded verbatim — the wire vocabulary is an open union and\n* the SDK does not validate the string, so emitting a `resultType` the\n* negotiated revision does not define is the handler author's\n* responsibility.\n* - Handler-provided non-`'complete'` value on any other method → internal\n* error (loud): the value would be mis-typed on the wire, and silently\n* rewriting it would hide a server bug.\n*/\nfunction stampResultType(method, result) {\n\tconst provided = result[\"resultType\"];\n\tif (provided === void 0) return {\n\t\t...result,\n\t\tresultType: \"complete\"\n\t};\n\tif (provided === \"complete\") return result;\n\tif (EXTENDED_RESULT_TYPE_METHODS.includes(method)) return result;\n\tthrow new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned resultType '${String(provided)}', but results of ${method} only support 'complete' on protocol revision 2026-07-28`);\n}\n/**\n* Step 2 of the encode contract: fill the required `ttlMs`/`cacheScope` fields\n* on cacheable results.\n*\n* Applies only when the (post-stamp) `resultType` is `'complete'` and the\n* method is one of the cacheable operations; everything else is returned\n* untouched apart from removing the configured-hint carrier. Field resolution\n* is per field, most specific author first: a valid handler-returned value,\n* then the configured cache hint attached by the server layer, then the\n* defaults. Handler-returned values are validated at encode time (`ttlMs`\n* must be a non-negative integer, `cacheScope` must be `'public'` or\n* `'private'`); invalid values are ignored rather than emitted.\n*/\nfunction fillCacheFields(method, result) {\n\tconst fallback = cacheHintFallbackOf(result);\n\tif (result[\"resultType\"] !== \"complete\" || !isCacheableResultMethod(method)) return fallback === void 0 ? result : stripCacheHintFallback(result);\n\tconst provided = result;\n\tconst ttlMs = isValidCacheTtlMs(provided[\"ttlMs\"]) ? provided[\"ttlMs\"] : resolveTtlMs(fallback);\n\tconst cacheScope = isValidCacheScope(provided[\"cacheScope\"]) ? provided[\"cacheScope\"] : resolveCacheScope(fallback);\n\tconst filled = {\n\t\t...provided,\n\t\tttlMs,\n\t\tcacheScope\n\t};\n\tdelete filled[RESULT_CACHE_HINT_FALLBACK];\n\treturn filled;\n}\nfunction isPlainObject$5(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/**\n* Step 3 of the encode contract: stamp the server's identity into the\n* result's `_meta` under `io.modelcontextprotocol/serverInfo` (spec PR #3002:\n* servers SHOULD include it on every response).\n*\n* - No `serverInfo` supplied (a client instance, or a hand-constructed\n* protocol object) → identity function.\n* - The result's `_meta` already carries the key → kept as-is (the handler\n* is the more specific author; mirrors the cache-fill resolution order).\n* - A present-but-non-object `_meta` (a dynamic-caller bug) → kept as-is:\n* the stamp never rewrites handler material, and the malformed value fails\n* loudly at the peer instead of being silently replaced here.\n* - Otherwise → the key is added, preserving any other `_meta` entries.\n*\n* Runs for every result regardless of `resultType`: the anchor types\n* `Result._meta` as `ResultMetaObject` on all results, `input_required`\n* included.\n*/\nfunction stampServerInfoMeta(result, serverInfo) {\n\tif (serverInfo === void 0) return result;\n\tconst meta = result[\"_meta\"];\n\tif (meta === void 0) return {\n\t\t...result,\n\t\t_meta: { [SERVER_INFO_META_KEY]: serverInfo }\n\t};\n\tif (!isPlainObject$5(meta)) return result;\n\tif (meta[SERVER_INFO_META_KEY] !== void 0) return result;\n\treturn {\n\t\t...result,\n\t\t_meta: {\n\t\t\t...meta,\n\t\t\t[SERVER_INFO_META_KEY]: serverInfo\n\t\t}\n\t};\n}\nfunction resolveTtlMs(fallback) {\n\treturn fallback !== void 0 && isValidCacheTtlMs(fallback.ttlMs) ? fallback.ttlMs : DEFAULT_CACHE_TTL_MS;\n}\nfunction resolveCacheScope(fallback) {\n\treturn fallback !== void 0 && isValidCacheScope(fallback.cacheScope) ? fallback.cacheScope : DEFAULT_CACHE_SCOPE;\n}\nfunction stripCacheHintFallback(result) {\n\tconst copy = { ...result };\n\tdelete copy[RESULT_CACHE_HINT_FALLBACK];\n\treturn copy;\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/inputRequired.ts\n/**\n* In-band input-request vocabulary of the 2026-07-28 revision (SEP-2322\n* multi round-trip requests), dispatch view.\n*\n* The three former server→client wire requests (`elicitation/create`,\n* `sampling/createMessage`, `roots/list`) are NOT wire request methods on\n* this revision — they are demoted to de-JSON-RPC'd payloads embedded in an\n* `input_required` result. The multi-round-trip driver dispatches those\n* embedded payloads to the client's registered handlers through the normal\n* handler machinery, and these are the schemas that dispatch parses them\n* with: lenient where the anchor's wire-true artifacts are strict (an\n* embedded request never carries the per-request `_meta` envelope), exact\n* where the vocabulary forks (the sampling shapes compose the forked\n* SamplingMessage/Tool payloads).\n*\n* Registry membership is intentionally NOT granted here — these methods stay\n* absent from the 2026-era request registry (a peer sending one as a wire\n* request still gets −32601 by absence). Only the codec's\n* `inputRequestSchema`/`inputResponseSchema` accessors expose them.\n*/\n/** The embedded input-request methods of the 2026-07-28 revision. */\nconst INPUT_REQUEST_METHODS_2026 = [\n\t\"elicitation/create\",\n\t\"sampling/createMessage\",\n\t\"roots/list\"\n];\nlet maps;\nfunction inputSchemaMaps() {\n\tif (maps) return maps;\n\tconst s = buildSchemas2026();\n\tmaps = {\n\t\trequest: {\n\t\t\t\"elicitation/create\": z.object({\n\t\t\t\tmethod: z.literal(\"elicitation/create\"),\n\t\t\t\tparams: s.ElicitRequestParamsSchema\n\t\t\t}),\n\t\t\t\"sampling/createMessage\": z.object({\n\t\t\t\tmethod: z.literal(\"sampling/createMessage\"),\n\t\t\t\tparams: s.CreateMessageRequestParamsSchema\n\t\t\t}),\n\t\t\t\"roots/list\": z.object({\n\t\t\t\tmethod: z.literal(\"roots/list\"),\n\t\t\t\tparams: z.looseObject({}).optional()\n\t\t\t})\n\t\t},\n\t\tresponse: {\n\t\t\t\"elicitation/create\": s.ElicitResultSchema,\n\t\t\t\"sampling/createMessage\": s.CreateMessageResultSchema,\n\t\t\t\"roots/list\": s.ListRootsResultSchema\n\t\t}\n\t};\n\treturn maps;\n}\n/**\n* Forces the lazy embedded-request maps (and, through them, the era's schema\n* memo). Warm-up hook for `preloadSchemas()` — no-op once the maps exist.\n*/\nfunction warmInputSchemaMaps2026() {\n\tinputSchemaMaps();\n}\nfunction isInputRequestMethod2026(method) {\n\treturn INPUT_REQUEST_METHODS_2026.includes(method);\n}\nfunction getInputRequestSchema2026(method) {\n\treturn isInputRequestMethod2026(method) ? inputSchemaMaps().request[method] : void 0;\n}\nfunction getInputResponseSchema2026(method) {\n\treturn isInputRequestMethod2026(method) ? inputSchemaMaps().response[method] : void 0;\n}\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/registry.ts\nconst requestMethodKeys = {\n\t\"tools/call\": null,\n\t\"tools/list\": null,\n\t\"prompts/get\": null,\n\t\"prompts/list\": null,\n\t\"resources/list\": null,\n\t\"resources/templates/list\": null,\n\t\"resources/read\": null,\n\t\"completion/complete\": null,\n\t\"server/discover\": null,\n\t\"subscriptions/listen\": null\n};\nconst notificationMethodKeys = {\n\t\"notifications/cancelled\": null,\n\t\"notifications/progress\": null,\n\t\"notifications/message\": null,\n\t\"notifications/resources/updated\": null,\n\t\"notifications/resources/list_changed\": null,\n\t\"notifications/tools/list_changed\": null,\n\t\"notifications/prompts/list_changed\": null,\n\t\"notifications/subscriptions/acknowledged\": null\n};\n/** The 2026-era request-method set (registry membership = the deletion story). */\nfunction hasRequestMethod2026(method) {\n\treturn Object.prototype.hasOwnProperty.call(requestMethodKeys, method);\n}\n/** The 2026-era notification-method set. */\nfunction hasNotificationMethod2026(method) {\n\treturn Object.prototype.hasOwnProperty.call(notificationMethodKeys, method);\n}\n/** Result-map membership (same key set as the request map on this era). */\nfunction hasResultMethod2026(method) {\n\treturn Object.prototype.hasOwnProperty.call(requestMethodKeys, method);\n}\nfunction getRequestSchema2026(method) {\n\treturn hasRequestMethod2026(method) ? buildSchemas2026().dispatchRequestSchemas[method] : void 0;\n}\nfunction getResultSchema2026(method) {\n\treturn hasResultMethod2026(method) ? buildSchemas2026().dispatchResultSchemas[method] : void 0;\n}\nfunction getNotificationSchema2026(method) {\n\treturn hasNotificationMethod2026(method) ? buildSchemas2026().notificationSchemas2026[method] : void 0;\n}\n/** Registry method lists (for the spec-method universe and the CI registry-diff oracle). */\nconst rev2026RequestMethods = Object.keys(requestMethodKeys);\nconst rev2026NotificationMethods = Object.keys(notificationMethodKeys);\n\n//#endregion\n//#region ../core-internal/src/wire/rev2026-07-28/codec.ts\nfunction isPlainObject$4(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/** Tri-state wrap of an optional Zod schema lookup (the function-only contract). */\nfunction triState(schema, raw) {\n\tif (schema === void 0) return {\n\t\tok: false,\n\t\treason: \"not-in-era\"\n\t};\n\tconst parsed = schema.safeParse(raw);\n\treturn parsed.success ? {\n\t\tok: true,\n\t\tvalue: parsed.data\n\t} : {\n\t\tok: false,\n\t\treason: \"invalid\",\n\t\tmessage: String(parsed.error)\n\t};\n}\nconst NOT_IN_ERA = {\n\tok: false,\n\treason: \"not-in-era\"\n};\n/**\n* The reserved `_meta` keys an envelope must carry on this era (in reporting\n* order). `clientInfo` is NOT here: spec PR #3002 demoted it to SHOULD, so a\n* request without it is accepted (a present-but-malformed value still fails\n* the envelope schema parse below).\n*/\nconst REQUIRED_ENVELOPE_KEYS = [PROTOCOL_VERSION_META_KEY, CLIENT_CAPABILITIES_META_KEY];\n/** Strip the known deleted-field set from an outbound result (Q1-SD3 iii). */\nfunction enforceDeletedFields(method, result) {\n\tlet next = result;\n\tlet copied = false;\n\tconst copy = () => {\n\t\tif (!copied) {\n\t\t\tnext = { ...next };\n\t\t\tcopied = true;\n\t\t}\n\t\treturn next;\n\t};\n\tconst tools = result.tools;\n\tif (method === \"tools/list\" && Array.isArray(tools) && tools.some((tool) => isPlainObject$4(tool) && \"execution\" in tool)) copy().tools = tools.map((tool) => {\n\t\tif (!isPlainObject$4(tool) || !(\"execution\" in tool)) return tool;\n\t\tconst rest = { ...tool };\n\t\tdelete rest[\"execution\"];\n\t\treturn rest;\n\t});\n\tconst capabilities = result.capabilities;\n\tif (isPlainObject$4(capabilities) && \"tasks\" in capabilities) {\n\t\tconst rest = { ...capabilities };\n\t\tdelete rest[\"tasks\"];\n\t\tcopy().capabilities = rest;\n\t}\n\treturn next;\n}\nconst rev2026Codec = {\n\tera: \"2026-07-28\",\n\thasRequestMethod: hasRequestMethod2026,\n\thasNotificationMethod: hasNotificationMethod2026,\n\thasInputRequestMethod: (method) => getInputRequestSchema2026(method) !== void 0,\n\tvalidateRequest: (method, raw) => triState(getRequestSchema2026(method), raw),\n\tvalidateResult: (method, raw) => triState(getResultSchema2026(method), raw),\n\tvalidateNotification: (method, raw) => triState(getNotificationSchema2026(method), raw),\n\tvalidateInputRequest: (method, raw) => triState(getInputRequestSchema2026(method), raw),\n\tvalidateInputResponse: (method, raw) => triState(getInputResponseSchema2026(method), raw),\n\tsamplingResultVariant: () => NOT_IN_ERA,\n\toutboundEnvelope(material) {\n\t\treturn {\n\t\t\t[PROTOCOL_VERSION_META_KEY]: material.protocolVersion,\n\t\t\t[CLIENT_INFO_META_KEY]: material.clientInfo,\n\t\t\t[CLIENT_CAPABILITIES_META_KEY]: material.clientCapabilities,\n\t\t\t...material.logLevel !== void 0 && { [LOG_LEVEL_META_KEY]: material.logLevel }\n\t\t};\n\t},\n\tvalidateEnvelopeMeta(meta) {\n\t\tconst issues = [];\n\t\tfor (const key of REQUIRED_ENVELOPE_KEYS) if (!(key in meta)) issues.push({\n\t\t\tkey,\n\t\t\tproblem: \"missing\"\n\t\t});\n\t\tconst parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(meta);\n\t\tif (!parsed.success) for (const issue of parsed.error.issues) {\n\t\t\tconst path = issue.path.map(String);\n\t\t\tconst key = path.length > 0 ? path.join(\".\") : \"_meta\";\n\t\t\tif (path.length === 1 && issues.some((existing) => existing.key === key && existing.problem === \"missing\")) continue;\n\t\t\tissues.push({\n\t\t\t\tkey,\n\t\t\t\tproblem: issue.message\n\t\t\t});\n\t\t}\n\t\treturn issues;\n\t},\n\tprojectCallToolResult: (result) => appendTextFallbackForNonObject(result),\n\tinputRequestSchema: getInputRequestSchema2026,\n\tdecodeResult(method, raw) {\n\t\tif (!isPlainObject$4(raw)) return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: not an object`, { method })\n\t\t};\n\t\tconst rawResultType = raw[\"resultType\"];\n\t\tif (rawResultType === void 0) return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`, {\n\t\t\t\tmethod,\n\t\t\t\tviolation: \"missing-resultType\"\n\t\t\t})\n\t\t};\n\t\tif (typeof rawResultType !== \"string\") return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: non-string resultType`, {\n\t\t\t\tmethod,\n\t\t\t\tresultType: rawResultType\n\t\t\t})\n\t\t};\n\t\tif (rawResultType === \"input_required\") {\n\t\t\tconst rawInputRequests = raw[\"inputRequests\"];\n\t\t\tconst inputRequests = isPlainObject$4(rawInputRequests) ? rawInputRequests : {};\n\t\t\tconst requestState = raw[\"requestState\"];\n\t\t\tif (Object.keys(inputRequests).length === 0 && typeof requestState !== \"string\") return {\n\t\t\t\tkind: \"invalid\",\n\t\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`, {\n\t\t\t\t\tmethod,\n\t\t\t\t\tviolation: \"input-required-missing-both\"\n\t\t\t\t})\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tkind: \"input_required\",\n\t\t\t\tinputRequests,\n\t\t\t\t...typeof requestState === \"string\" && { requestState }\n\t\t\t};\n\t\t}\n\t\tif (rawResultType !== \"complete\") return {\n\t\t\tkind: \"invalid\",\n\t\t\terror: new SdkError(SdkErrorCode.UnsupportedResultType, `Unsupported result type '${rawResultType}' for ${method}`, {\n\t\t\t\tresultType: rawResultType,\n\t\t\t\tmethod\n\t\t\t})\n\t\t};\n\t\tconst wireResultSchemas = getWireResultSchemas();\n\t\tconst wireSchema = Object.hasOwn(wireResultSchemas, method) ? wireResultSchemas[method] : void 0;\n\t\tif (wireSchema !== void 0) {\n\t\t\tconst parsed = wireSchema.safeParse(raw);\n\t\t\tif (!parsed.success) return {\n\t\t\t\tkind: \"invalid\",\n\t\t\t\terror: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: ${parsed.error}`, { method })\n\t\t\t};\n\t\t}\n\t\tconst lifted = { ...raw };\n\t\tdelete lifted[\"resultType\"];\n\t\treturn {\n\t\t\tkind: \"complete\",\n\t\t\tresult: lifted\n\t\t};\n\t},\n\tencodeResult(method, result, serverInfo) {\n\t\treturn stampServerInfoMeta(fillCacheFields(method, stampResultType(method, enforceDeletedFields(method, result))), serverInfo);\n\t},\n\tencodeErrorCode: (code) => code === -32002 ? -32602 : code,\n\tcheckInboundEnvelope(material) {\n\t\tif (material.envelope === void 0) return \"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)\";\n\t\tconst parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(material.envelope);\n\t\tif (!parsed.success) return `Invalid _meta envelope for protocol revision 2026-07-28: ${parsed.error.issues.map((issue) => issue.message).join(\"; \")}`;\n\t}\n};\n/** Wire-true result wrappers consulted by decode step 2, keyed by method —\n* built once through the era's schema memo on the first decode. */\nlet wireResultSchemasMemo;\nfunction getWireResultSchemas() {\n\tif (wireResultSchemasMemo) return wireResultSchemasMemo;\n\tconst s = buildSchemas2026();\n\twireResultSchemasMemo = {\n\t\t\"tools/call\": s.CallToolResultSchema,\n\t\t\"tools/list\": s.ListToolsResultSchema,\n\t\t\"prompts/get\": s.GetPromptResultSchema,\n\t\t\"prompts/list\": s.ListPromptsResultSchema,\n\t\t\"resources/list\": s.ListResourcesResultSchema,\n\t\t\"resources/templates/list\": s.ListResourceTemplatesResultSchema,\n\t\t\"resources/read\": s.ReadResourceResultSchema,\n\t\t\"completion/complete\": s.CompleteResultSchema,\n\t\t\"server/discover\": s.DiscoverResultSchema\n\t};\n\treturn wireResultSchemasMemo;\n}\n/**\n* Forces the lazy wire-result wrapper map (and, through it, the era's schema\n* memo). Warm-up hook for `preloadSchemas()` — no-op once the map exists.\n*/\nfunction warmWireResultSchemas2026() {\n\tgetWireResultSchemas();\n}\n\n//#endregion\n//#region ../core-internal/src/wire/codec.ts\n/**\n* The modern wire revision literal. Internal only — deliberately NOT a public\n* constant (G-D2-4: no public modern-version constant ships before era-aware\n* list semantics exist).\n*/\nconst MODERN_WIRE_REVISION = \"2026-07-28\";\n/**\n* Era resolution, many-to-one (Q1-SD1): every modern-era revision\n* (`>= 2026-07-28`) → the 2026-era codec; every legacy revision (the five\n* `SUPPORTED_PROTOCOL_VERSIONS`) and `undefined`/unknown → the 2025-era\n* codec (the DV-13 default posture — hand-constructed instances and\n* unclassified traffic are legacy-era). This is the same era predicate the\n* rest of the SDK uses ({@link isModernProtocolVersion}); a pinned modern\n* revision other than the literal '2026-07-28' must still resolve modern.\n*/\nfunction codecForVersion(version) {\n\treturn version !== void 0 && isModernProtocolVersion(version) ? rev2026Codec : rev2025Codec;\n}\n/**\n* The wire era an edge classification names (Q2 — produced at the\n* transport/entry edge; this layer only CONSUMES it). The dispatch funnel no\n* longer resolves a codec FROM the classification: era is instance state, and\n* a classified inbound message is VALIDATED against the instance era — a\n* mismatch is an entry/routing error, never a per-message era switch. The\n* exact `revision` wins over the coarse era flag when both are present.\n*/\nfunction classifiedWireEra(classification) {\n\tif (classification.revision !== void 0) return codecForVersion(classification.revision).era;\n\treturn classification.era === \"modern\" ? rev2026Codec.era : rev2025Codec.era;\n}\n/**\n* The derived spec-method universe: the union of every codec registry. A\n* method in this set is era-gated at dispatch and send time; a method outside\n* it is a consumer-owned extension method (era-blind, schema-explicit).\n* Derived from the registries — never hand-curated (the LEGACY_ONLY_METHODS\n* table class is exactly what registry membership replaces).\n*/\nfunction isSpecRequestMethod(method) {\n\treturn ALL_CODECS.some((codec) => codec.hasRequestMethod(method));\n}\nfunction isSpecNotificationMethod(method) {\n\treturn ALL_CODECS.some((codec) => codec.hasNotificationMethod(method));\n}\nconst ALL_CODECS = [rev2025Codec, rev2026Codec];\n\n//#endregion\n//#region ../core-internal/src/shared/envelope.ts\n/**\n* Per-request `_meta` envelope claim helpers (protocol revision 2026-07-28).\n*\n* Pure, value-returning helpers used by the inbound HTTP classifier\n* (`classifyInboundRequest`): claim detection and envelope validation with\n* self-identifying issues. The envelope schema itself stays the wire layer's\n* single source of truth (`RequestMetaEnvelopeSchema`); this module only maps\n* its outcomes into the shapes the validation ladder emits.\n*\n* Claim detection is deliberately narrow: a message claims the 2026-07-28\n* envelope mechanism if and only if the reserved protocol-version `_meta` key\n* is present in `params._meta`. Other reserved keys (client info, client\n* capabilities, log level), a bare `progressToken`, or unrelated keys under\n* the `io.modelcontextprotocol/` prefix do NOT constitute a claim on their\n* own — but once the claim key is present, a malformed envelope is a\n* validation error, never a silent fall back to legacy handling.\n*\n* The wire-exact envelope schema, the required-key set, and the per-key issue\n* mapping live in the wire layer (the 2026-era codec's `validateEnvelopeMeta`).\n* This module never reaches into a per-revision wire module directly.\n*/\nfunction isPlainObject$3(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/** The `_meta` object of a message's params, when present. */\nfunction requestMetaOf(params) {\n\tif (!isPlainObject$3(params)) return void 0;\n\tconst meta = params[\"_meta\"];\n\treturn isPlainObject$3(meta) ? meta : void 0;\n}\n/**\n* Whether a message's params carry the per-request envelope claim: the\n* reserved protocol-version `_meta` key is present (regardless of whether the\n* rest of the envelope is valid — validation is a separate, later step).\n*/\nfunction hasEnvelopeClaim(params) {\n\tconst meta = requestMetaOf(params);\n\treturn meta !== void 0 && PROTOCOL_VERSION_META_KEY in meta;\n}\n/**\n* The protocol version named by a message's envelope claim, when the claim is\n* present and carries a string value. A present claim with a non-string value\n* still counts as a claim ({@linkcode hasEnvelopeClaim}); it surfaces as a\n* validation issue instead of a version.\n*/\nfunction envelopeClaimVersion(params) {\n\tconst value = requestMetaOf(params)?.[PROTOCOL_VERSION_META_KEY];\n\treturn typeof value === \"string\" ? value : void 0;\n}\n/**\n* Validates a request's `_meta` object as a 2026-07-28 per-request envelope\n* and reports problems as self-identifying issues (which key, what problem).\n*\n* Returns an empty array when the envelope is valid. Missing required keys are\n* reported first (as `problem: 'missing'`), then schema violations inside\n* present keys, in a stable order.\n*/\nfunction validateEnvelopeMeta(meta) {\n\treturn codecForVersion(MODERN_WIRE_REVISION).validateEnvelopeMeta(meta);\n}\n\n//#endregion\n//#region ../core-internal/src/types/schemas.ts\nvar schemas_exports = /* @__PURE__ */ __exportAll({\n\tAnnotationsSchema: () => AnnotationsSchema,\n\tAudioContentSchema: () => AudioContentSchema,\n\tBaseMetadataSchema: () => BaseMetadataSchema,\n\tBaseRequestParamsSchema: () => BaseRequestParamsSchema,\n\tBlobResourceContentsSchema: () => BlobResourceContentsSchema,\n\tBooleanSchemaSchema: () => BooleanSchemaSchema,\n\tCallToolRequestParamsSchema: () => CallToolRequestParamsSchema,\n\tCallToolRequestSchema: () => CallToolRequestSchema,\n\tCallToolResultSchema: () => CallToolResultSchema,\n\tCancelTaskRequestSchema: () => CancelTaskRequestSchema,\n\tCancelTaskResultSchema: () => CancelTaskResultSchema,\n\tCancelledNotificationParamsSchema: () => CancelledNotificationParamsSchema,\n\tCancelledNotificationSchema: () => CancelledNotificationSchema,\n\tClientCapabilitiesSchema: () => ClientCapabilitiesSchema,\n\tClientNotificationSchema: () => ClientNotificationSchema,\n\tClientRequestSchema: () => ClientRequestSchema,\n\tClientResultSchema: () => ClientResultSchema,\n\tClientTasksCapabilitySchema: () => ClientTasksCapabilitySchema,\n\tCompatibilityCallToolResultSchema: () => CompatibilityCallToolResultSchema,\n\tCompleteRequestParamsSchema: () => CompleteRequestParamsSchema,\n\tCompleteRequestSchema: () => CompleteRequestSchema,\n\tCompleteResultSchema: () => CompleteResultSchema,\n\tContentBlockSchema: () => ContentBlockSchema,\n\tCreateMessageRequestParamsSchema: () => CreateMessageRequestParamsSchema,\n\tCreateMessageRequestSchema: () => CreateMessageRequestSchema,\n\tCreateMessageResultSchema: () => CreateMessageResultSchema,\n\tCreateMessageResultWithToolsSchema: () => CreateMessageResultWithToolsSchema,\n\tCreateTaskResultSchema: () => CreateTaskResultSchema,\n\tCursorSchema: () => CursorSchema,\n\tDiscoverRequestSchema: () => DiscoverRequestSchema,\n\tDiscoverResultSchema: () => DiscoverResultSchema,\n\tElicitRequestFormParamsSchema: () => ElicitRequestFormParamsSchema,\n\tElicitRequestParamsSchema: () => ElicitRequestParamsSchema,\n\tElicitRequestSchema: () => ElicitRequestSchema,\n\tElicitRequestURLParamsSchema: () => ElicitRequestURLParamsSchema,\n\tElicitResultSchema: () => ElicitResultSchema,\n\tElicitationCompleteNotificationParamsSchema: () => ElicitationCompleteNotificationParamsSchema,\n\tElicitationCompleteNotificationSchema: () => ElicitationCompleteNotificationSchema,\n\tEmbeddedResourceSchema: () => EmbeddedResourceSchema,\n\tEmptyResultSchema: () => EmptyResultSchema,\n\tEnumSchemaSchema: () => EnumSchemaSchema,\n\tGetPromptRequestParamsSchema: () => GetPromptRequestParamsSchema,\n\tGetPromptRequestSchema: () => GetPromptRequestSchema,\n\tGetPromptResultSchema: () => GetPromptResultSchema,\n\tGetTaskPayloadRequestSchema: () => GetTaskPayloadRequestSchema,\n\tGetTaskPayloadResultSchema: () => GetTaskPayloadResultSchema,\n\tGetTaskRequestSchema: () => GetTaskRequestSchema,\n\tGetTaskResultSchema: () => GetTaskResultSchema,\n\tIconSchema: () => IconSchema,\n\tIconsSchema: () => IconsSchema,\n\tImageContentSchema: () => ImageContentSchema,\n\tImplementationSchema: () => ImplementationSchema,\n\tInitializeRequestParamsSchema: () => InitializeRequestParamsSchema,\n\tInitializeRequestSchema: () => InitializeRequestSchema,\n\tInitializeResultSchema: () => InitializeResultSchema,\n\tInitializedNotificationSchema: () => InitializedNotificationSchema,\n\tJSONArraySchema: () => JSONArraySchema,\n\tJSONObjectSchema: () => JSONObjectSchema,\n\tJSONRPCErrorResponseSchema: () => JSONRPCErrorResponseSchema,\n\tJSONRPCMessageSchema: () => JSONRPCMessageSchema,\n\tJSONRPCNotificationSchema: () => JSONRPCNotificationSchema,\n\tJSONRPCRequestSchema: () => JSONRPCRequestSchema,\n\tJSONRPCResponseSchema: () => JSONRPCResponseSchema,\n\tJSONRPCResultResponseSchema: () => JSONRPCResultResponseSchema,\n\tJSONValueSchema: () => JSONValueSchema,\n\tLegacyTitledEnumSchemaSchema: () => LegacyTitledEnumSchemaSchema,\n\tListChangedOptionsBaseSchema: () => ListChangedOptionsBaseSchema,\n\tListPromptsRequestSchema: () => ListPromptsRequestSchema,\n\tListPromptsResultSchema: () => ListPromptsResultSchema,\n\tListResourceTemplatesRequestSchema: () => ListResourceTemplatesRequestSchema,\n\tListResourceTemplatesResultSchema: () => ListResourceTemplatesResultSchema,\n\tListResourcesRequestSchema: () => ListResourcesRequestSchema,\n\tListResourcesResultSchema: () => ListResourcesResultSchema,\n\tListRootsRequestSchema: () => ListRootsRequestSchema,\n\tListRootsResultSchema: () => ListRootsResultSchema,\n\tListTasksRequestSchema: () => ListTasksRequestSchema,\n\tListTasksResultSchema: () => ListTasksResultSchema,\n\tListToolsRequestSchema: () => ListToolsRequestSchema,\n\tListToolsResultSchema: () => ListToolsResultSchema,\n\tLoggingLevelSchema: () => LoggingLevelSchema,\n\tLoggingMessageNotificationParamsSchema: () => LoggingMessageNotificationParamsSchema,\n\tLoggingMessageNotificationSchema: () => LoggingMessageNotificationSchema,\n\tModelHintSchema: () => ModelHintSchema,\n\tModelPreferencesSchema: () => ModelPreferencesSchema,\n\tMultiSelectEnumSchemaSchema: () => MultiSelectEnumSchemaSchema,\n\tNotificationSchema: () => NotificationSchema,\n\tNotificationsParamsSchema: () => NotificationsParamsSchema,\n\tNumberSchemaSchema: () => NumberSchemaSchema,\n\tPaginatedRequestParamsSchema: () => PaginatedRequestParamsSchema,\n\tPaginatedRequestSchema: () => PaginatedRequestSchema,\n\tPaginatedResultSchema: () => PaginatedResultSchema,\n\tPingRequestSchema: () => PingRequestSchema,\n\tPrimitiveSchemaDefinitionSchema: () => PrimitiveSchemaDefinitionSchema,\n\tProgressNotificationParamsSchema: () => ProgressNotificationParamsSchema,\n\tProgressNotificationSchema: () => ProgressNotificationSchema,\n\tProgressSchema: () => ProgressSchema,\n\tProgressTokenSchema: () => ProgressTokenSchema,\n\tPromptArgumentSchema: () => PromptArgumentSchema,\n\tPromptListChangedNotificationSchema: () => PromptListChangedNotificationSchema,\n\tPromptMessageSchema: () => PromptMessageSchema,\n\tPromptReferenceSchema: () => PromptReferenceSchema,\n\tPromptSchema: () => PromptSchema,\n\tReadResourceRequestParamsSchema: () => ReadResourceRequestParamsSchema,\n\tReadResourceRequestSchema: () => ReadResourceRequestSchema,\n\tReadResourceResultSchema: () => ReadResourceResultSchema,\n\tRelatedTaskMetadataSchema: () => RelatedTaskMetadataSchema,\n\tRequestIdSchema: () => RequestIdSchema,\n\tRequestMetaSchema: () => RequestMetaSchema,\n\tRequestSchema: () => RequestSchema,\n\tResourceContentsSchema: () => ResourceContentsSchema,\n\tResourceLinkSchema: () => ResourceLinkSchema,\n\tResourceListChangedNotificationSchema: () => ResourceListChangedNotificationSchema,\n\tResourceRequestParamsSchema: () => ResourceRequestParamsSchema,\n\tResourceSchema: () => ResourceSchema,\n\tResourceTemplateReferenceSchema: () => ResourceTemplateReferenceSchema,\n\tResourceTemplateSchema: () => ResourceTemplateSchema,\n\tResourceUpdatedNotificationParamsSchema: () => ResourceUpdatedNotificationParamsSchema,\n\tResourceUpdatedNotificationSchema: () => ResourceUpdatedNotificationSchema,\n\tResultMetaObjectSchema: () => ResultMetaObjectSchema,\n\tResultSchema: () => ResultSchema,\n\tRoleSchema: () => RoleSchema,\n\tRootSchema: () => RootSchema,\n\tRootsListChangedNotificationSchema: () => RootsListChangedNotificationSchema,\n\tSamplingContentSchema: () => SamplingContentSchema,\n\tSamplingMessageContentBlockSchema: () => SamplingMessageContentBlockSchema,\n\tSamplingMessageSchema: () => SamplingMessageSchema,\n\tServerCapabilitiesSchema: () => ServerCapabilitiesSchema,\n\tServerNotificationSchema: () => ServerNotificationSchema,\n\tServerRequestSchema: () => ServerRequestSchema,\n\tServerResultSchema: () => ServerResultSchema,\n\tServerTasksCapabilitySchema: () => ServerTasksCapabilitySchema,\n\tSetLevelRequestParamsSchema: () => SetLevelRequestParamsSchema,\n\tSetLevelRequestSchema: () => SetLevelRequestSchema,\n\tSingleSelectEnumSchemaSchema: () => SingleSelectEnumSchemaSchema,\n\tStringSchemaSchema: () => StringSchemaSchema,\n\tSubscribeRequestParamsSchema: () => SubscribeRequestParamsSchema,\n\tSubscribeRequestSchema: () => SubscribeRequestSchema,\n\tSubscriptionFilterSchema: () => SubscriptionFilterSchema,\n\tSubscriptionsAcknowledgedNotificationParamsSchema: () => SubscriptionsAcknowledgedNotificationParamsSchema,\n\tSubscriptionsAcknowledgedNotificationSchema: () => SubscriptionsAcknowledgedNotificationSchema,\n\tSubscriptionsListenRequestParamsSchema: () => SubscriptionsListenRequestParamsSchema,\n\tSubscriptionsListenRequestSchema: () => SubscriptionsListenRequestSchema,\n\tSubscriptionsListenResultMetaSchema: () => SubscriptionsListenResultMetaSchema,\n\tSubscriptionsListenResultSchema: () => SubscriptionsListenResultSchema,\n\tTaskAugmentedRequestParamsSchema: () => TaskAugmentedRequestParamsSchema,\n\tTaskCreationParamsSchema: () => TaskCreationParamsSchema,\n\tTaskMetadataSchema: () => TaskMetadataSchema,\n\tTaskSchema: () => TaskSchema,\n\tTaskStatusNotificationParamsSchema: () => TaskStatusNotificationParamsSchema,\n\tTaskStatusNotificationSchema: () => TaskStatusNotificationSchema,\n\tTaskStatusSchema: () => TaskStatusSchema,\n\tTextContentSchema: () => TextContentSchema,\n\tTextResourceContentsSchema: () => TextResourceContentsSchema,\n\tTitledMultiSelectEnumSchemaSchema: () => TitledMultiSelectEnumSchemaSchema,\n\tTitledSingleSelectEnumSchemaSchema: () => TitledSingleSelectEnumSchemaSchema,\n\tToolAnnotationsSchema: () => ToolAnnotationsSchema,\n\tToolChoiceSchema: () => ToolChoiceSchema,\n\tToolExecutionSchema: () => ToolExecutionSchema,\n\tToolListChangedNotificationSchema: () => ToolListChangedNotificationSchema,\n\tToolResultContentSchema: () => ToolResultContentSchema,\n\tToolSchema: () => ToolSchema,\n\tToolUseContentSchema: () => ToolUseContentSchema,\n\tUnsubscribeRequestParamsSchema: () => UnsubscribeRequestParamsSchema,\n\tUnsubscribeRequestSchema: () => UnsubscribeRequestSchema,\n\tUntitledMultiSelectEnumSchemaSchema: () => UntitledMultiSelectEnumSchemaSchema,\n\tUntitledSingleSelectEnumSchemaSchema: () => UntitledSingleSelectEnumSchemaSchema\n});\n\n//#endregion\n//#region ../core-internal/src/types/guards.ts\n/**\n* Validates and parses an unknown value as a JSON-RPC message.\n*\n* Use this to validate incoming messages in custom transport implementations.\n* Throws if the value does not conform to the JSON-RPC message schema.\n*\n* @param value - The value to validate (typically a parsed JSON object).\n* @returns The validated {@linkcode JSONRPCMessage}.\n* @throws If validation fails.\n*/\nfunction parseJSONRPCMessage(value) {\n\treturn JSONRPCMessageSchema.parse(value);\n}\nconst isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;\nconst isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode JSONRPCResultResponse}.\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode JSONRPCResultResponse}, false otherwise.\n*/\nconst isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode JSONRPCErrorResponse}.\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode JSONRPCErrorResponse}, false otherwise.\n*/\nconst isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode JSONRPCResponse} (either a result or error response).\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode JSONRPCResponse}, false otherwise.\n*/\nconst isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;\n/**\n* Checks if a value is a valid {@linkcode CallToolResult}.\n*\n* This is a consumer-side VALUE check against the neutral model, not a wire\n* validator: a raw wire object that additionally carries wire-only members\n* (e.g. `resultType`) still passes through the loose index signature. Use a\n* transport-level parse to validate raw wire traffic.\n*\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode CallToolResult}, false otherwise.\n*/\nconst isCallToolResult = (value) => {\n\tif (typeof value !== \"object\" || value === null || value.content === void 0) return false;\n\treturn CallToolResultSchema.safeParse(value).success;\n};\n/**\n* Checks whether a value is an input-required result (protocol revision\n* 2026-07-28): the multi-round-trip return shape discriminated by\n* `resultType: 'input_required'`.\n*\n* This is a discriminator check, not a full validator — the at-least-one rule\n* (`inputRequests` or `requestState`) is enforced by the `inputRequired()`\n* builder and re-checked by the server seam for hand-built values.\n*\n* @param value - The value to check.\n* @returns True if the value carries the `input_required` discriminator.\n*/\nconst isInputRequiredResult = (value) => typeof value === \"object\" && value !== null && !Array.isArray(value) && value.resultType === \"input_required\";\n/**\n* Checks if a value is a valid {@linkcode TaskAugmentedRequestParams}.\n* @param value - The value to check.\n*\n* @returns True if the value is a valid {@linkcode TaskAugmentedRequestParams}, false otherwise.\n*\n* @deprecated Recognizes 2025-11-25 task wire vocabulary, which has no SDK\n* runtime; kept importable for interoperability only.\n*/\nconst isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;\nconst isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success;\nconst isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;\nfunction assertCompleteRequestPrompt(request) {\n\tif (request.params.ref.type !== \"ref/prompt\") throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);\n}\nfunction assertCompleteRequestResourceTemplate(request) {\n\tif (request.params.ref.type !== \"ref/resource\") throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);\n}\n\n//#endregion\n//#region ../core-internal/src/shared/mcpParamHeaders.ts\n/** The fixed prefix every custom-parameter header carries. */\nconst MCP_PARAM_HEADER_PREFIX = \"Mcp-Param-\";\n/** The schema-extension property name a tool's `inputSchema` carries. */\nconst X_MCP_HEADER_KEY = \"x-mcp-header\";\n/**\n* RFC 9110 §5.1 `token` syntax (`1*tchar`). Rejects empty, space, control\n* characters (including CR/LF), and the listed delimiters.\n*/\nconst RFC9110_TOKEN = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n/**\n* JSON Schema `type` values the spec admits on an `x-mcp-header` property.\n*\n* The spec text names `integer`, `string`, `boolean` and explicitly excludes\n* `number`. The published conformance referee at the pinned release ships its\n* `http-custom-headers` scenario with two `type: \"number\"` `x-mcp-header`\n* parameters and expects the client to mirror them, so `number` is accepted\n* here so that the conformance gate passes; the discrepancy is tracked\n* upstream. Everything else (`object`, `array`, `null`, absent) is rejected.\n*/\nconst PERMITTED_X_MCP_HEADER_TYPES = new Set([\n\t\"string\",\n\t\"integer\",\n\t\"boolean\",\n\t\"number\"\n]);\n/**\n* Scan a tool's JSON-serialized `inputSchema` for `x-mcp-header` declarations\n* and validate every constraint the spec places on them. Returns either the\n* collected declarations (possibly empty) or the first violated constraint.\n*\n* The walk descends through `properties` at any depth (the spec's \"any nesting\n* depth\" clause). The static-reachability MUST is enforced as a structural\n* sweep: every position the chain MUST NOT pass through (`items`/\n* `additionalProperties`, `oneOf`/`anyOf`/`allOf`/`not`, `if`/`then`/`else`,\n* `$defs`, `$ref` targets within `$defs`) is visited too, and an\n* `x-mcp-header` found anywhere on that path invalidates the schema — \"an\n* annotation anywhere else makes the tool definition invalid\".\n*/\nfunction scanXMcpHeaderDeclarations(inputSchema) {\n\tconst declarations = [];\n\tconst seenLower = /* @__PURE__ */ new Map();\n\tconst visit = (node, path, reachable) => {\n\t\tif (node === null || typeof node !== \"object\") return void 0;\n\t\tconst schema = node;\n\t\tif (X_MCP_HEADER_KEY in schema) {\n\t\t\tif (!reachable || path.length === 0) return `${pathName(path)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;\n\t\t\tconst raw = schema[X_MCP_HEADER_KEY];\n\t\t\tif (typeof raw !== \"string\" || raw.length === 0) return `${pathName(path)}: x-mcp-header MUST be a non-empty string`;\n\t\t\tif (!RFC9110_TOKEN.test(raw)) return `${pathName(path)}: x-mcp-header '${raw}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;\n\t\t\tconst type = typeof schema.type === \"string\" ? schema.type : void 0;\n\t\t\tif (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) return `${pathName(path)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${type ?? \"<none>\"}`;\n\t\t\tconst lower = raw.toLowerCase();\n\t\t\tconst prior = seenLower.get(lower);\n\t\t\tif (prior !== void 0) return `x-mcp-header '${raw}' is not case-insensitively unique (also declared as '${prior}')`;\n\t\t\tseenLower.set(lower, raw);\n\t\t\tdeclarations.push({\n\t\t\t\tpath,\n\t\t\t\theaderName: raw,\n\t\t\t\ttype\n\t\t\t});\n\t\t}\n\t\tconst properties = schema.properties;\n\t\tif (properties !== null && typeof properties === \"object\") for (const [key, child] of Object.entries(properties)) {\n\t\t\tconst fault$1 = visit(child, [...path, key], reachable);\n\t\t\tif (fault$1 !== void 0) return fault$1;\n\t\t}\n\t\tfor (const k of NON_REACHABLE_SUBSCHEMA_KEYWORDS) {\n\t\t\tconst sub = schema[k];\n\t\t\tif (sub === void 0) continue;\n\t\t\tconst branches = Array.isArray(sub) ? sub : sub !== null && typeof sub === \"object\" && OBJECT_VALUED_SUBSCHEMA_KEYWORDS.has(k) ? Object.values(sub) : [sub];\n\t\t\tfor (const branch of branches) {\n\t\t\t\tconst fault$1 = visit(branch, [...path, `<${k}>`], false);\n\t\t\t\tif (fault$1 !== void 0) return fault$1;\n\t\t\t}\n\t\t}\n\t};\n\tconst fault = visit(inputSchema, [], true);\n\treturn fault === void 0 ? {\n\t\tvalid: true,\n\t\tdeclarations\n\t} : {\n\t\tvalid: false,\n\t\treason: fault\n\t};\n}\n/**\n* JSON Schema keywords whose subschemas the SEP-2243 static-reachability\n* constraint excludes from the `properties`-only chain. An `x-mcp-header`\n* found under any of these invalidates the tool definition.\n*/\nconst NON_REACHABLE_SUBSCHEMA_KEYWORDS = [\n\t\"items\",\n\t\"prefixItems\",\n\t\"contains\",\n\t\"additionalProperties\",\n\t\"unevaluatedProperties\",\n\t\"unevaluatedItems\",\n\t\"propertyNames\",\n\t\"patternProperties\",\n\t\"dependentSchemas\",\n\t\"oneOf\",\n\t\"anyOf\",\n\t\"allOf\",\n\t\"not\",\n\t\"if\",\n\t\"then\",\n\t\"else\",\n\t\"$defs\",\n\t\"definitions\"\n];\n/**\n* Subschema-carrying keywords whose value is a `name → subschema` object\n* (not a single subschema or array of subschemas). The visit branches over\n* `Object.values()` for these.\n*/\nconst OBJECT_VALUED_SUBSCHEMA_KEYWORDS = new Set([\n\t\"patternProperties\",\n\t\"dependentSchemas\",\n\t\"$defs\",\n\t\"definitions\"\n]);\nfunction pathName(path) {\n\treturn path.length === 0 ? \"<root>\" : path.join(\".\");\n}\nconst BASE64_SENTINEL_PREFIX = \"=?base64?\";\nconst BASE64_SENTINEL_SUFFIX = \"?=\";\nconst BASE64_CANONICAL = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nconst CANONICAL_DECIMAL = /^-?\\d+(\\.\\d+)?$/;\n/**\n* Convert a primitive argument value to its string representation per the\n* spec's type-conversion rules: strings pass through, integers and numbers\n* become their decimal string, booleans become lowercase `'true'` / `'false'`.\n* Non-finite numbers and integers outside the safe range are refused (the\n* caller treats `undefined` as \"do not emit a header for this value\").\n*/\nfunction mcpParamPrimitiveToString(value) {\n\tif (typeof value === \"string\") return value;\n\tif (typeof value === \"boolean\") return value ? \"true\" : \"false\";\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) return void 0;\n\t\tif (Number.isInteger(value) && !Number.isSafeInteger(value)) return void 0;\n\t\treturn String(value);\n\t}\n}\nfunction base64ToUtf8(b64) {\n\tconst bin = atob(b64);\n\tconst bytes = new Uint8Array(bin.length);\n\tfor (let i = 0; i < bin.length; i++) bytes[i] = bin.codePointAt(i);\n\treturn new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes);\n}\n/**\n* Decode an `Mcp-Param-*` header value: when it carries the Base64 sentinel,\n* the payload is decoded as UTF-8; otherwise the value is returned as-is.\n* Returns `undefined` when the sentinel is present but the payload is not\n* canonical Base64 (or not valid UTF-8) — the spec requires servers to reject\n* such values.\n*/\nfunction decodeMcpParamValue(value) {\n\tif (!(value.startsWith(BASE64_SENTINEL_PREFIX) && value.endsWith(BASE64_SENTINEL_SUFFIX))) return value;\n\tconst b64 = value.slice(9, value.length - 2);\n\tif (!BASE64_CANONICAL.test(b64)) return void 0;\n\ttry {\n\t\treturn base64ToUtf8(b64);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction valueAtPath(root, path) {\n\tlet node = root;\n\tfor (const key of path) {\n\t\tif (node === null || typeof node !== \"object\") return void 0;\n\t\tnode = node[key];\n\t}\n\treturn node;\n}\n/**\n* The header/body comparison the server performs at tool-resolution time.\n*\n* For each `x-mcp-header` declaration on the named tool: when the body\n* `arguments` carries a value, the matching `Mcp-Param-{Name}` header MUST be\n* present and decode to an equal value; when the body value is `null` or\n* absent the server MUST NOT expect the header (a present header is ignored).\n* A sentinel-carrying header whose payload is not canonical Base64 / valid\n* UTF-8 is rejected as invalid characters.\n*\n* Integer-typed declarations are compared numerically (the spec's SHOULD —\n* `42.0` and `42` are equal); everything else is compared as decoded strings.\n*\n* Returns `undefined` when every check passes, or an\n* {@linkcode InboundLadderRejection} carrying the same `-32020`\n* (`HeaderMismatch`) shape the inbound classifier emits for the\n* standard-header cross-checks — `400 Bad Request` with the disagreeing pair\n* in `data.mismatch`.\n*/\nfunction validateMcpParamHeaders(declarations, args, headers) {\n\tfor (const decl of declarations) {\n\t\tconst headerKey = `${MCP_PARAM_HEADER_PREFIX}${decl.headerName}`;\n\t\tconst headerValue = headers.get(headerKey);\n\t\tconst bodyRaw = valueAtPath(args, decl.path);\n\t\tif (bodyRaw === void 0 || bodyRaw === null) continue;\n\t\tconst bodyString = mcpParamPrimitiveToString(bodyRaw);\n\t\tif (bodyString === void 0) continue;\n\t\tif (headerValue === null) return paramHeaderMismatchRejection(\"param-header-missing\", headerKey, `the body carries ${pathName(decl.path)}=${JSON.stringify(bodyRaw)} but the ${headerKey} header is absent`);\n\t\tconst decoded = decodeMcpParamValue(headerValue);\n\t\tif (decoded === void 0) return paramHeaderMismatchRejection(\"param-header-invalid-encoding\", headerKey, `the ${headerKey} header carries an invalid Base64 sentinel value`);\n\t\tif (!((decl.type === \"integer\" || decl.type === \"number\") && CANONICAL_DECIMAL.test(decoded) && typeof bodyRaw === \"number\" ? Number(decoded) === bodyRaw : decoded === bodyString)) return paramHeaderMismatchRejection(\"param-header-mismatch\", headerKey, `the ${headerKey} header decodes to ${JSON.stringify(decoded)} but the body carries ${pathName(decl.path)}=${JSON.stringify(bodyRaw)}`);\n\t}\n}\n/**\n* Build the `-32020` (`HeaderMismatch`) rejection for an `Mcp-Param-*`\n* disagreement. Same shape as the inbound classifier's standard-header\n* cross-check mismatch (HTTP `400`, `data.mismatch` naming the disagreeing\n* pair, `settled: true`); only the rung differs because this check runs at the\n* pre-dispatch step against a known tool's schema rather than at the edge.\n*/\nfunction paramHeaderMismatchRejection(cell, header, body) {\n\treturn {\n\t\tkind: \"reject\",\n\t\trung: \"param-header-validation\",\n\t\tcell,\n\t\thttpStatus: 400,\n\t\tcode: HEADER_MISMATCH_ERROR_CODE,\n\t\tmessage: `Bad Request: the request headers and body disagree: ${body}`,\n\t\tdata: { mismatch: {\n\t\t\theader,\n\t\t\tbody\n\t\t} },\n\t\tsettled: true\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inboundClassification.ts\n/**\n* Inbound HTTP request classification and the inbound validation ladder\n* (protocol revision 2026-07-28).\n*\n* `classifyInboundRequest` is the body-primary era predicate for an HTTP\n* entry that serves both protocol eras on one endpoint. It is evaluated\n* exactly once, at the entry boundary, on the already-parsed request body:\n*\n* - `initialize` is a legacy-era request by definition (the modern era has no\n* `initialize` handshake) — unless it carries a valid envelope claim naming\n* a modern revision, in which case the claim wins and the request is\n* classified like any other enveloped request (the modern era then answers\n* it with method-not-found, exactly like every other method it does not\n* define).\n* - A request whose `params._meta` carries the reserved protocol-version key\n* claims the per-request envelope mechanism and classifies into the era the\n* named revision belongs to (a malformed envelope behind a present claim is\n* a validation error, never a silent fall back to legacy handling).\n* - A request without a claim is legacy-era traffic.\n* - The `MCP-Protocol-Version` header is a cross-check only: it never\n* upgrades or downgrades a body-derived classification, and a disagreement\n* between header and body is an explicit ladder outcome.\n* - Notifications carry no envelope claim of their own under the current\n* spec, so for notification POSTs without a body claim the modern header is\n* determinative; the `Mcp-Method` header is validated against the body when\n* the message classifies modern and is never enforced on legacy traffic.\n* A notification that does carry a claim is treated body-primary like a\n* request, and a malformed claim is rejected the same way a request's\n* malformed claim is — never silently resolved against the header.\n* The notification-POST header cross-checks here are an SDK-defensive\n* posture, not a spec requirement: the spec leaves header rules for posted\n* notifications undefined (core client notifications do not occur over\n* Streamable HTTP); applying the request rules symmetrically is what an\n* ecosystem custom-notification POST expects, and the −32020 cells stay\n* passing for them.\n* - `GET`/`DELETE` (and any other non-`POST` method) are body-less 2025-era\n* session operations: the modern era is `POST`-only, so they are routed to\n* legacy serving when it is configured and rejected otherwise.\n* - Array (batch) bodies are classified element-wise: an array containing a\n* modern-claiming or invalid element is rejected, an all-legacy array is\n* legacy traffic unchanged, and a single-element array is still an array.\n*\n* The classifier returns plain values (it never throws and never touches a\n* transport): a routing outcome (`legacy`/`modern`) or a ladder rejection\n* carrying the JSON-RPC error to emit and the HTTP status to emit it with.\n* Legacy routing outcomes deliberately carry NO `MessageClassification` —\n* legacy and hand-wired traffic is never classified, which keeps its\n* dispatch behavior byte-identical to today's.\n*\n* Error codes for the modern-path rejection cells follow the published\n* conformance suite (and the spec text it asserts):\n*\n* - A header/body cross-check mismatch (the `MCP-Protocol-Version` header\n* disagreeing with the body, or the `Mcp-Method` header disagreeing with the\n* body method) is rejected with `-32020` (`HeaderMismatch`) on HTTP 400.\n* - A request whose protocol-version header names a modern revision but whose\n* body carries no `_meta` envelope claim — including an envelope present but\n* missing the required protocol-version key — is rejected with `-32602`\n* (invalid params) naming the missing key(s), on HTTP 400.\n*\n* Should a future spec revision or conformance release change these\n* assignments, the affected cells are re-derived against that release; the\n* `settled` flag on {@linkcode InboundLadderRejection} stays available to mark\n* a cell provisional again while such a change is in flight.\n*/\n/**\n* The error code emitted for header/body cross-check mismatches: the\n* `MCP-Protocol-Version` header disagreeing with the body's envelope claim (or\n* with the body's classification), and the `Mcp-Method` header disagreeing\n* with the body method.\n*\n* `-32020` is the draft schema's `HEADER_MISMATCH` constant (the SEP-2243\n* `HeaderMismatch` code; the spec requires HTTP 400 for it), as also asserted\n* by the published conformance suite for header-validation failures. It has no\n* {@linkcode ProtocolErrorCode} member because it is not part of the 2025-era\n* wire vocabulary; the validation ladder is its only emitter.\n*/\nconst HEADER_MISMATCH_ERROR_CODE = -32020;\n/**\n* The inbound validation ladder, expressed as data rather than control flow.\n*\n* The edge rungs are evaluated by {@linkcode classifyInboundRequest}; the\n* dispatch rungs are evaluated by the protocol layer once the classified\n* message is injected into a per-request server instance (the era registry\n* gate, the envelope requiredness check, and per-method params validation).\n* The client-capability rung is evaluated by the HTTP entry itself,\n* pre-dispatch, on the validated envelope the classifier produced — see that\n* rung's rationale for the ordering caveat. The order is the precedence: a\n* request that fails several rungs is answered by the earliest one.\n*/\nconst INBOUND_VALIDATION_LADDER = [\n\t{\n\t\trung: \"http-method\",\n\t\torder: 1,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [-32e3],\n\t\tconformance: [],\n\t\trationale: \"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read.\"\n\t},\n\t{\n\t\trung: \"jsonrpc-shape\",\n\t\torder: 2,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [ProtocolErrorCode.InvalidRequest],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic.\"\n\t},\n\t{\n\t\trung: \"era-classification\",\n\t\torder: 3,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [HEADER_MISMATCH_ERROR_CODE, ProtocolErrorCode.UnsupportedProtocolVersion],\n\t\tconformance: [\n\t\t\t\"server-stateless\",\n\t\t\t\"http-header-validation\",\n\t\t\t\"http-custom-header-server-validation\"\n\t\t],\n\t\trationale: \"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions.\"\n\t},\n\t{\n\t\trung: \"envelope\",\n\t\torder: 4,\n\t\tevaluatedAt: \"edge\",\n\t\tcodes: [ProtocolErrorCode.InvalidParams],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400.\"\n\t},\n\t{\n\t\trung: \"method-registry\",\n\t\torder: 5,\n\t\tevaluatedAt: \"dispatch\",\n\t\tcodes: [ProtocolErrorCode.MethodNotFound],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at.\"\n\t},\n\t{\n\t\trung: \"request-params\",\n\t\torder: 6,\n\t\tevaluatedAt: \"dispatch\",\n\t\tcodes: [ProtocolErrorCode.InvalidParams],\n\t\tconformance: [],\n\t\trationale: \"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table.\"\n\t},\n\t{\n\t\trung: \"standard-header-validation\",\n\t\torder: 7,\n\t\tevaluatedAt: \"pre-dispatch\",\n\t\tcodes: [HEADER_MISMATCH_ERROR_CODE],\n\t\tconformance: [\"http-header-validation\"],\n\t\trationale: \"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted.\"\n\t},\n\t{\n\t\trung: \"client-capabilities\",\n\t\torder: 8,\n\t\tevaluatedAt: \"pre-dispatch\",\n\t\tcodes: [ProtocolErrorCode.MissingRequiredClientCapability],\n\t\tconformance: [\"server-stateless\"],\n\t\trationale: \"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable.\"\n\t},\n\t{\n\t\trung: \"param-header-validation\",\n\t\torder: 9,\n\t\tevaluatedAt: \"pre-dispatch\",\n\t\tcodes: [HEADER_MISMATCH_ERROR_CODE],\n\t\tconformance: [\"http-custom-header-server-validation\"],\n\t\trationale: \"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung.\"\n\t}\n];\n/**\n* HTTP status for ladder-originated JSON-RPC error codes.\n*\n* Keyed on origin, not on the bare code: this table only applies to errors\n* the ladder (or a pre-handler protocol gate) produced. Errors produced by\n* request handlers — whatever their code — stay in-band on HTTP 200, and are\n* never mapped to an HTTP status by this table; in particular `-32603` and\n* domain-specific codes never become a blanket 500. The single exception is\n* `MissingRequiredClientCapability` (-32021) — see\n* {@linkcode httpStatusForErrorCode}.\n*\n* `-32602` (invalid params) deliberately has NO entry: the only invalid-params\n* rejection that maps to HTTP 400 is the classifier's own envelope rung\n* short-circuit, which carries its HTTP status directly. A dispatch- or\n* handler-produced invalid-params error is always in-band.\n*/\nconst LADDER_ERROR_HTTP_STATUS = {\n\t[ProtocolErrorCode.ParseError]: 400,\n\t[ProtocolErrorCode.InvalidRequest]: 400,\n\t[ProtocolErrorCode.MethodNotFound]: 404,\n\t[ProtocolErrorCode.UnsupportedProtocolVersion]: 400,\n\t[ProtocolErrorCode.MissingRequiredClientCapability]: 400,\n\t[HEADER_MISMATCH_ERROR_CODE]: 400\n};\n/**\n* The HTTP status to answer a JSON-RPC error with, keyed on the error's\n* origin. `in-band` errors (anything produced by a request handler) are\n* HTTP 200 — the JSON-RPC error response is the payload, not an HTTP\n* failure — with ONE exception: `MissingRequiredClientCapability` (-32021),\n* whose 400 the spec mandates on the error itself with no origin condition,\n* and which the SDK genuinely produces after dispatch (the `input_required`\n* capability gate). A handler relaying some downstream peer's `-32020`/`-32022`\n* is NOT that peer's spec error and stays in-band like every other handler\n* code. `ladder` errors map through {@linkcode LADDER_ERROR_HTTP_STATUS}.\n*\n* The per-request transport intentionally does NOT delegate to this function:\n* its `?? 400` ladder fallback is only correct for entry-gate codes known to\n* the table, and would wrongly map dispatch-window errors outside it (a\n* window `-32602` must stay in-band on 200). The transport indexes the table\n* directly; keep the two in agreement when editing either.\n*/\nfunction httpStatusForErrorCode(code, origin) {\n\tif (origin === \"in-band\") return code === ProtocolErrorCode.MissingRequiredClientCapability ? 400 : 200;\n\treturn LADDER_ERROR_HTTP_STATUS[code] ?? 400;\n}\nfunction rejection(rung, cell, httpStatus, error, settled) {\n\treturn {\n\t\tkind: \"reject\",\n\t\trung,\n\t\tcell,\n\t\thttpStatus,\n\t\tcode: error.code,\n\t\tmessage: error.message,\n\t\t...error.data !== void 0 && { data: error.data },\n\t\tsettled\n\t};\n}\nfunction crossCheckMismatch(cell, header, body, rung = \"era-classification\") {\n\treturn rejection(rung, cell, 400, new ProtocolError(HEADER_MISMATCH_ERROR_CODE, `Bad Request: the request headers and body disagree: ${body}`, { mismatch: {\n\t\theader,\n\t\tbody\n\t} }), true);\n}\n/**\n* The methods whose body carries a `params.name` / `params.uri` value the\n* `Mcp-Name` header must mirror, and which body field supplies it (SEP-2243\n* § Standard Request Headers, `Required For` column).\n*/\nconst MCP_NAME_HEADER_SOURCE = {\n\t\"tools/call\": \"name\",\n\t\"prompts/get\": \"name\",\n\t\"resources/read\": \"uri\"\n};\n/** Strip RFC 9110 optional whitespace (SP / HTAB) around a field value in linear time. */\nfunction stripHttpOws(value) {\n\tlet start = 0;\n\twhile (start < value.length) {\n\t\tconst code = value.codePointAt(start);\n\t\tif (code !== 9 && code !== 32) break;\n\t\tstart += 1;\n\t}\n\tlet end = value.length;\n\twhile (end > start) {\n\t\tconst code = value.codePointAt(end - 1);\n\t\tif (code !== 9 && code !== 32) break;\n\t\tend -= 1;\n\t}\n\treturn start === 0 && end === value.length ? value : value.slice(start, end);\n}\n/**\n* SEP-2243 standard-header server-side validation, evaluated by the HTTP\n* entry on a modern-classified request immediately after\n* {@linkcode classifyInboundRequest} returns a modern route.\n*\n* Returns the `-32020` (`HeaderMismatch`) ladder rejection (HTTP `400`,\n* `standard-header-validation` rung — the same shape\n* {@linkcode classifyInboundRequest} already emits on the edge\n* `era-classification` rung for the `MCP-Protocol-Version` and\n* `Mcp-Method` *mismatch* cells) when:\n*\n* - the required `Mcp-Method` header is absent;\n* - the required `Mcp-Name` header is absent on a `tools/call`,\n* `prompts/get`, or `resources/read` request whose body carries the\n* `params.name` / `params.uri` value the header mirrors;\n* - the `Mcp-Name` header carries an invalid `=?base64?…?=` sentinel; or\n* - the (decoded) `Mcp-Name` value disagrees with the body's\n* `params.name` / `params.uri`.\n*\n* Returns `undefined` (pass) for notifications (the spec table reads\n* \"All requests\"), for methods that have no `Mcp-Name` source, and when the\n* headers agree with the body. Never enforced on legacy traffic — the entry\n* only calls this on a modern route.\n*\n* Kept separate from {@linkcode classifyInboundRequest} so that a body-only\n* call to the classifier (no headers passed) keeps routing a modern request\n* unchanged: the classifier remains a pure body-primary router, and this\n* function is the presence/`Mcp-Name` half of the standard-header rung the\n* entry layers on top.\n*/\nfunction validateStandardRequestHeaders(request, route) {\n\tif (route.messageKind !== \"request\") return;\n\tconst method = route.message.method;\n\tif (request.mcpMethodHeader === void 0) return crossCheckMismatch(\"method-header-missing\", \"(missing)\", `the body names method ${method} but the required Mcp-Method header is absent`, \"standard-header-validation\");\n\tconst sourceField = Object.hasOwn(MCP_NAME_HEADER_SOURCE, method) ? MCP_NAME_HEADER_SOURCE[method] : void 0;\n\tif (sourceField === void 0) return;\n\tconst sourceValue = route.message.params?.[sourceField];\n\tconst bodyValue = typeof sourceValue === \"string\" ? sourceValue : void 0;\n\tif (request.mcpNameHeader === void 0) {\n\t\tif (bodyValue === void 0) return;\n\t\treturn crossCheckMismatch(\"name-header-missing\", \"(missing)\", `the body carries params.${sourceField}=\"${bodyValue}\" but the required Mcp-Name header is absent`, \"standard-header-validation\");\n\t}\n\tconst normalizedNameHeader = stripHttpOws(request.mcpNameHeader);\n\tconst decoded = decodeMcpParamValue(normalizedNameHeader);\n\tif (decoded === void 0) return crossCheckMismatch(\"name-header-invalid-encoding\", normalizedNameHeader, \"the Mcp-Name header carries an invalid Base64 sentinel value\", \"standard-header-validation\");\n\tif (bodyValue !== void 0 && decoded !== bodyValue) return crossCheckMismatch(\"name-header-mismatch\", normalizedNameHeader, `the body carries params.${sourceField}=\"${bodyValue}\" but the Mcp-Name header names \"${decoded}\"`, \"standard-header-validation\");\n}\nfunction isPlainObject$2(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\nfunction classificationForClaim(claimedVersion) {\n\tif (claimedVersion === void 0) return { era: \"modern\" };\n\treturn {\n\t\tera: isModernProtocolVersion(claimedVersion) ? \"modern\" : \"legacy\",\n\t\trevision: claimedVersion\n\t};\n}\n/**\n* Whether a request's params carry a per-request envelope claim that is both\n* well-formed and names a modern protocol revision.\n*\n* Used by the `initialize` precedence rule: only such a claim overrides the\n* `initialize` ⇒ legacy-handshake classification — a request carrying a valid\n* modern envelope is a modern request regardless of its method name, and the\n* modern era then answers `initialize` exactly like any other method it does\n* not define (method-not-found). A malformed claim, or one naming a pre-2026\n* revision, keeps the legacy-handshake routing unchanged.\n*\n* Exported on the core internal barrel for the stdio serving entry, which\n* applies the same precedence rule to a connection's opening message; not\n* public API.\n*/\nfunction carriesValidModernEnvelopeClaim(params) {\n\tif (!hasEnvelopeClaim(params)) return false;\n\tconst claimedVersion = envelopeClaimVersion(params);\n\tif (claimedVersion === void 0 || !isModernProtocolVersion(claimedVersion)) return false;\n\tconst meta = requestMetaOf(params);\n\treturn meta !== void 0 && validateEnvelopeMeta(meta).length === 0;\n}\nfunction classifyBatch(body) {\n\tif (body.length === 0) return rejection(\"jsonrpc-shape\", \"empty-batch\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: empty JSON-RPC batch\"), true);\n\tfor (const element of body) {\n\t\tif (hasEnvelopeClaim(isPlainObject$2(element) ? element[\"params\"] : void 0)) return rejection(\"jsonrpc-shape\", \"batch-with-modern-element\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later\"), true);\n\t\tif (!(isJSONRPCRequest(element) || isJSONRPCNotification(element) || isJSONRPCResultResponse(element) || isJSONRPCErrorResponse(element))) return rejection(\"jsonrpc-shape\", \"batch-with-invalid-element\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC batch contains an invalid message\"), true);\n\t}\n\treturn {\n\t\tkind: \"legacy\",\n\t\treason: \"batch\"\n\t};\n}\nfunction classifyRequestBody(request, body) {\n\tconst params = body.params;\n\tconst method = body.method;\n\tconst headerVersion = request.protocolVersionHeader;\n\tconst headerNamesModern = headerVersion !== void 0 && isModernProtocolVersion(headerVersion);\n\tif (method === \"initialize\" && !carriesValidModernEnvelopeClaim(params)) {\n\t\tif (headerNamesModern) return crossCheckMismatch(\"initialize-with-modern-header\", headerVersion, \"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header\");\n\t\tconst requestedVersion = isPlainObject$2(params) && typeof params[\"protocolVersion\"] === \"string\" ? params[\"protocolVersion\"] : void 0;\n\t\treturn {\n\t\t\tkind: \"legacy\",\n\t\t\treason: \"initialize\",\n\t\t\t...requestedVersion !== void 0 && { requestedVersion }\n\t\t};\n\t}\n\tif (hasEnvelopeClaim(params)) {\n\t\tconst meta = requestMetaOf(params);\n\t\tconst firstIssue = (meta === void 0 ? [] : validateEnvelopeMeta(meta))[0];\n\t\tif (firstIssue !== void 0) return rejection(\"envelope\", \"envelope-invalid\", 400, new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid _meta envelope for protocol revision 2026-07-28: ${firstIssue.key}: ${firstIssue.problem}`, { envelope: firstIssue }), true);\n\t\tconst claimedVersion = envelopeClaimVersion(params);\n\t\tif (headerVersion !== void 0 && claimedVersion !== void 0 && headerVersion !== claimedVersion) return crossCheckMismatch(\"header-body-version-mismatch\", headerVersion, `the body envelope names protocol version ${claimedVersion} but the MCP-Protocol-Version header names ${headerVersion}`);\n\t\tif (request.mcpMethodHeader !== void 0 && request.mcpMethodHeader !== method) return crossCheckMismatch(\"method-header-mismatch\", request.mcpMethodHeader, `the body names method ${method} but the Mcp-Method header names ${request.mcpMethodHeader}`);\n\t\treturn {\n\t\t\tkind: \"modern\",\n\t\t\tmessageKind: \"request\",\n\t\t\tmessage: body,\n\t\t\tclassification: classificationForClaim(claimedVersion)\n\t\t};\n\t}\n\tif (headerNamesModern) {\n\t\tconst meta = requestMetaOf(params);\n\t\tconst missingFromEnvelope = validateEnvelopeMeta(meta ?? {}).filter((issue) => issue.problem === \"missing\").map((issue) => issue.key);\n\t\tconst missing = meta === void 0 ? [\"_meta\"] : missingFromEnvelope.length > 0 ? missingFromEnvelope : [PROTOCOL_VERSION_META_KEY];\n\t\treturn rejection(\"envelope\", \"modern-header-without-claim\", 400, new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params: the MCP-Protocol-Version header names protocol revision ${headerVersion}, but the request is missing the required per-request envelope key(s): ${missing.join(\", \")}`, { envelope: { missing } }), true);\n\t}\n\treturn {\n\t\tkind: \"legacy\",\n\t\treason: \"no-claim\",\n\t\t...headerVersion !== void 0 && { requestedVersion: headerVersion }\n\t};\n}\nfunction classifyNotificationBody(request, body) {\n\tconst params = body.params;\n\tconst method = body.method;\n\tconst headerVersion = request.protocolVersionHeader;\n\tconst headerNamesModern = headerVersion !== void 0 && isModernProtocolVersion(headerVersion);\n\tif (hasEnvelopeClaim(params)) {\n\t\tconst claimedVersion = envelopeClaimVersion(params);\n\t\tif (claimedVersion === void 0) {\n\t\t\tconst meta = requestMetaOf(params);\n\t\t\tconst claimIssue = (meta === void 0 ? [] : validateEnvelopeMeta(meta)).find((issue) => issue.key === PROTOCOL_VERSION_META_KEY) ?? {\n\t\t\t\tkey: PROTOCOL_VERSION_META_KEY,\n\t\t\t\tproblem: \"expected a protocol version string\"\n\t\t\t};\n\t\t\treturn rejection(\"envelope\", \"notification-envelope-invalid\", 400, new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid _meta envelope for protocol revision 2026-07-28: ${claimIssue.key}: ${claimIssue.problem}`, { envelope: claimIssue }), true);\n\t\t}\n\t\tif (headerVersion !== void 0 && headerVersion !== claimedVersion) return crossCheckMismatch(\"notification-header-body-version-mismatch\", headerVersion, `the notification envelope names protocol version ${claimedVersion} but the MCP-Protocol-Version header names ${headerVersion}`);\n\t\tconst classification = classificationForClaim(claimedVersion);\n\t\tif (classification.era === \"modern\" && request.mcpMethodHeader !== void 0 && request.mcpMethodHeader !== method) return crossCheckMismatch(\"notification-method-header-mismatch\", request.mcpMethodHeader, `the notification body names method ${method} but the Mcp-Method header names ${request.mcpMethodHeader}`);\n\t\treturn {\n\t\t\tkind: \"modern\",\n\t\t\tmessageKind: \"notification\",\n\t\t\tmessage: body,\n\t\t\tclassification\n\t\t};\n\t}\n\tif (headerNamesModern) {\n\t\tif (request.mcpMethodHeader !== void 0 && request.mcpMethodHeader !== method) return crossCheckMismatch(\"notification-method-header-mismatch\", request.mcpMethodHeader, `the notification body names method ${method} but the Mcp-Method header names ${request.mcpMethodHeader}`);\n\t\treturn {\n\t\t\tkind: \"modern\",\n\t\t\tmessageKind: \"notification\",\n\t\t\tmessage: body,\n\t\t\tclassification: {\n\t\t\t\tera: \"modern\",\n\t\t\t\trevision: headerVersion\n\t\t\t}\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"legacy\",\n\t\treason: \"notification\",\n\t\t...headerVersion !== void 0 && { requestedVersion: headerVersion }\n\t};\n}\n/**\n* Classifies one inbound HTTP request for dual-era serving.\n*\n* The body-primary predicate, evaluated once at the entry boundary: see the\n* module documentation for the rules. Returns a routing outcome (`legacy` or\n* `modern`) or a ladder rejection; it never throws.\n*/\nfunction classifyInboundRequest(request) {\n\trequest = {\n\t\t...request,\n\t\t...request.protocolVersionHeader !== void 0 && { protocolVersionHeader: stripHttpOws(request.protocolVersionHeader) },\n\t\t...request.mcpMethodHeader !== void 0 && { mcpMethodHeader: stripHttpOws(request.mcpMethodHeader) },\n\t\t...request.mcpNameHeader !== void 0 && { mcpNameHeader: stripHttpOws(request.mcpNameHeader) }\n\t};\n\tif (request.httpMethod.toUpperCase() !== \"POST\") return {\n\t\tkind: \"legacy\",\n\t\treason: \"http-method\"\n\t};\n\tconst body = request.body;\n\tif (Array.isArray(body)) return classifyBatch(body);\n\tif (isJSONRPCResultResponse(body) || isJSONRPCErrorResponse(body)) return {\n\t\tkind: \"legacy\",\n\t\treason: \"response\"\n\t};\n\tif (isPlainObject$2(body) && isJSONRPCRequest(body)) return classifyRequestBody(request, body);\n\tif (isPlainObject$2(body) && isJSONRPCNotification(body)) return classifyNotificationBody(request, body);\n\treturn rejection(\"jsonrpc-shape\", \"invalid-json-rpc-body\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: the request body is not a valid JSON-RPC message\"), true);\n}\n/**\n* The rejection a modern-only endpoint (no legacy serving configured)\n* answers a legacy-classified request with.\n*\n* - Envelope-less requests (including `initialize`) are answered with the\n* unsupported-protocol-version error carrying the endpoint's supported\n* versions and echoing the version the request named (when it named one —\n* `requested` is omitted rather than fabricated when the request named no\n* version at all), so a legacy client can discover what the endpoint serves\n* from the error alone.\n* - Posted responses and batch arrays are invalid requests on the modern era.\n* - Non-`POST` methods are not allowed.\n* - Legacy-classified notifications return `undefined`: the caller answers\n* 202 with no body and does not dispatch the notification (accept-and-drop).\n*/\nfunction modernOnlyStrictRejection(route, supportedVersions) {\n\tswitch (route.reason) {\n\t\tcase \"http-method\": return rejection(\"http-method\", \"modern-only-method-not-allowed\", 405, new ProtocolError(-32e3, \"Method not allowed.\"), true);\n\t\tcase \"batch\": return rejection(\"jsonrpc-shape\", \"modern-only-batch-not-supported\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC batches are not supported by this endpoint\"), true);\n\t\tcase \"response\": return rejection(\"jsonrpc-shape\", \"modern-only-response-post\", 400, new ProtocolError(ProtocolErrorCode.InvalidRequest, \"Bad Request: JSON-RPC responses cannot be posted to this endpoint\"), true);\n\t\tcase \"notification\": return;\n\t\tcase \"initialize\":\n\t\tcase \"no-claim\": {\n\t\t\tconst requested = route.requestedVersion;\n\t\t\treturn rejection(\"era-classification\", \"modern-only-missing-envelope\", 400, requested === void 0 ? new ProtocolError(ProtocolErrorCode.UnsupportedProtocolVersion, \"Unsupported protocol version: the request did not name a protocol version\", { supported: [...supportedVersions] }) : new UnsupportedProtocolVersionError({\n\t\t\t\tsupported: [...supportedVersions],\n\t\t\t\trequested\n\t\t\t}), true);\n\t\t}\n\t}\n}\n\n//#endregion\n//#region ../core-internal/src/util/schema.ts\n/**\n* Internal Zod schema utilities for protocol handling.\n* These are used internally by the SDK for protocol message validation.\n*/\n/**\n* Parses data against a Zod schema (synchronous).\n* Returns a discriminated union with success/error.\n*/\nfunction parseSchema(schema, data) {\n\treturn z.safeParse(schema, data);\n}\n/**\n* Union of the declared shape keys across several Zod object schemas.\n*/\nfunction shapeKeys(schemas) {\n\treturn new Set(schemas.flatMap((schema) => Object.keys(schema.shape)));\n}\n\n//#endregion\n//#region ../core-internal/src/util/standardSchema.ts\n/**\n* Standard Schema utilities for user-provided schemas.\n* Supports Zod v4, Valibot, ArkType, and other Standard Schema implementations.\n* @see https://standardschema.dev\n*/\nfunction isStandardSchema(schema) {\n\tif (schema == null) return false;\n\tconst schemaType = typeof schema;\n\tif (schemaType !== \"object\" && schemaType !== \"function\") return false;\n\tif (!(\"~standard\" in schema)) return false;\n\treturn typeof schema[\"~standard\"]?.validate === \"function\";\n}\nlet warnedZodFallback = false;\n/** JSON Schema draft targeted by every conversion; shared so pattern references above stay in lockstep. */\nconst JSON_SCHEMA_CONVERSION_TARGET = \"draft-2020-12\";\n/**\n* Converts a StandardSchema to JSON Schema for use as an MCP tool/prompt schema.\n*\n* MCP requires `type: \"object\"` at the root of tool `inputSchema` and prompt\n* argument schemas; `outputSchema` may have any JSON Schema root (SEP-2106).\n* Zod's discriminated unions emit `{oneOf: [...]}` without a top-level `type`,\n* so for `io: 'input'` this function defaults `type` to `\"object\"` when absent\n* and throws on an explicit non-object `type` (e.g. `z.string()`). For\n* `io: 'output'` a non-object root is returned as-is; the `\"object\"` default is\n* applied only when the root is provably object-shaped.\n*/\nfunction standardSchemaToJsonSchema(schema, io = \"input\") {\n\tconst std = schema[\"~standard\"];\n\tlet result;\n\tif (std.jsonSchema) result = std.jsonSchema[io]({ target: JSON_SCHEMA_CONVERSION_TARGET });\n\telse if (std.vendor === \"zod\") {\n\t\tif (!(\"_zod\" in schema)) throw new Error(\"Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().\");\n\t\tif (!warnedZodFallback) {\n\t\t\twarnedZodFallback = true;\n\t\t\tconsole.warn(\"[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.\");\n\t\t}\n\t\tresult = z.toJSONSchema(schema, {\n\t\t\ttarget: JSON_SCHEMA_CONVERSION_TARGET,\n\t\t\tio\n\t\t});\n\t} else throw new Error(`Schema library \"${std.vendor}\" does not implement StandardJSONSchemaV1 (\\`~standard.jsonSchema\\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);\n\tif (io === \"output\") {\n\t\tif (result.type !== void 0) return result;\n\t\treturn isProvablyObjectShapedRoot(result) ? {\n\t\t\ttype: \"object\",\n\t\t\t...result\n\t\t} : result;\n\t}\n\tif (result.type !== void 0 && result.type !== \"object\") throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(result.type)}). Wrap your schema in z.object({...}) or equivalent.`);\n\treturn {\n\t\ttype: \"object\",\n\t\t...result\n\t};\n}\n/**\n* A typeless JSON Schema root is \"provably object-shaped\" when either it carries object keywords\n* directly (`properties`/`patternProperties`/`additionalProperties`/`required`), or it is a\n* composition (`oneOf`/`anyOf`/`allOf`) whose every member is itself `type:'object'` or recursively\n* provably object-shaped (e.g. a nested `discriminatedUnion`). `$ref` is not followed. Used to\n* decide whether stamping `type:'object'` is safe (redundant-but-valid) versus self-contradictory.\n*/\nfunction isProvablyObjectShapedRoot(schema) {\n\tif (\"properties\" in schema || \"patternProperties\" in schema || \"additionalProperties\" in schema || \"required\" in schema) return true;\n\tfor (const key of [\n\t\t\"oneOf\",\n\t\t\"anyOf\",\n\t\t\"allOf\"\n\t]) {\n\t\tconst members = schema[key];\n\t\tif (Array.isArray(members) && members.length > 0) return members.every((m) => m !== null && typeof m === \"object\" && (m.type === \"object\" || isProvablyObjectShapedRoot(m)));\n\t}\n\treturn false;\n}\nfunction formatIssue(issue) {\n\tif (!issue.path?.length) return issue.message;\n\treturn `${issue.path.map((p) => String(typeof p === \"object\" ? p.key : p)).join(\".\")}: ${issue.message}`;\n}\nasync function validateStandardSchema(schema, data) {\n\tconst result = await schema[\"~standard\"].validate(data);\n\tif (result.issues && result.issues.length > 0) return {\n\t\tsuccess: false,\n\t\terror: result.issues.map((i) => formatIssue(i)).join(\", \")\n\t};\n\treturn {\n\t\tsuccess: true,\n\t\tdata: result.value\n\t};\n}\nfunction zodEmittedPattern(schema) {\n\tconst jsonSchema = z.toJSONSchema(schema, {\n\t\ttarget: JSON_SCHEMA_CONVERSION_TARGET,\n\t\tio: \"input\"\n\t});\n\treturn typeof jsonSchema.pattern === \"string\" ? jsonSchema.pattern : void 0;\n}\nconst DATETIME_FRACTION_DIGITS = /\\\\\\.\\\\d\\{(\\d+)\\}/;\nfunction datetimeReferenceSchemas(pattern) {\n\tconst fractionDigits = DATETIME_FRACTION_DIGITS.exec(pattern);\n\tconst precisions = [\n\t\tvoid 0,\n\t\t-1,\n\t\t0\n\t];\n\tif (fractionDigits) precisions.push(Number(fractionDigits[1]));\n\treturn [false, true].flatMap((local) => [false, true].flatMap((offset) => precisions.map((precision) => z.iso.datetime({\n\t\tlocal,\n\t\toffset,\n\t\tprecision\n\t}))));\n}\nfunction referencePatternsForFormat(format, pattern) {\n\tlet referenceSchemas;\n\tswitch (format) {\n\t\tcase \"email\":\n\t\t\treferenceSchemas = [z.email()];\n\t\t\tbreak;\n\t\tcase \"uri\":\n\t\t\treferenceSchemas = [z.url()];\n\t\t\tbreak;\n\t\tcase \"date\":\n\t\t\treferenceSchemas = [z.iso.date()];\n\t\t\tbreak;\n\t\tcase \"date-time\":\n\t\t\treferenceSchemas = datetimeReferenceSchemas(pattern);\n\t\t\tbreak;\n\t}\n\treturn new Set(referenceSchemas.map((schema) => zodEmittedPattern(schema)).filter((emitted) => emitted !== void 0));\n}\n/** Whether `pattern` is the library's own realization of `format` (droppable) rather than a user customization. */\nfunction isLibraryFormatPattern(format, pattern, vendor) {\n\tif (vendor !== \"zod\") return true;\n\treturn referencePatternsForFormat(format, pattern).has(pattern);\n}\nfunction promptArgumentsFromStandardSchema(schema) {\n\tconst jsonSchema = standardSchemaToJsonSchema(schema, \"input\");\n\tconst properties = jsonSchema.properties || {};\n\tconst required = jsonSchema.required || [];\n\treturn Object.entries(properties).map(([name, prop]) => ({\n\t\tname,\n\t\tdescription: prop?.description,\n\t\trequired: required.includes(name)\n\t}));\n}\n\n//#endregion\n//#region ../core-internal/src/shared/elicitation.ts\nfunction isJsonObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction convertStandardElicitationSchema(schema) {\n\ttry {\n\t\treturn standardSchemaToJsonSchema(schema, \"input\");\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema must describe an object with flat primitive properties: ${detail}`);\n\t}\n}\nconst ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS = new Set([\n\t\"$comment\",\n\t\"deprecated\",\n\t\"description\",\n\t\"examples\",\n\t\"readOnly\",\n\t\"title\",\n\t\"writeOnly\"\n]);\nfunction isAnnotationOnlyJsonSchemaKeyword(key) {\n\treturn ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS.has(key) || key.startsWith(\"x-\");\n}\nconst ROOT_KEYS = new Set([\"$schema\", ...Object.keys(ElicitRequestFormParamsSchema.shape.requestedSchema.shape)]);\nconst PROPERTY_KEYS_BY_TYPE = {\n\tstring: shapeKeys([\n\t\tStringSchemaSchema,\n\t\tUntitledSingleSelectEnumSchemaSchema,\n\t\tTitledSingleSelectEnumSchemaSchema,\n\t\tLegacyTitledEnumSchemaSchema\n\t]),\n\tnumber: shapeKeys([NumberSchemaSchema]),\n\tinteger: shapeKeys([NumberSchemaSchema]),\n\tboolean: shapeKeys([BooleanSchemaSchema]),\n\tarray: shapeKeys([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema])\n};\nconst SUPPORTED_STRING_FORMATS = new Set(StringSchemaSchema.shape.format.unwrap().options);\n/** Walks one property node: keeps grammar keys, drops the library format pattern, rejects unknown constraints. */\nfunction walkProperty(node, path, vendor, unsupported) {\n\tif (!isJsonObject(node)) return node;\n\tconst allowedKeys = typeof node.type === \"string\" && Object.hasOwn(PROPERTY_KEYS_BY_TYPE, node.type) ? PROPERTY_KEYS_BY_TYPE[node.type] : void 0;\n\tif (allowedKeys === void 0) return node;\n\tconst pruned = {};\n\tfor (const [key, value] of Object.entries(node)) if (allowedKeys.has(key) || isAnnotationOnlyJsonSchemaKeyword(key)) pruned[key] = value;\n\telse if (key === \"pattern\" && node.type === \"string\" && typeof node.format === \"string\") {\n\t\tif (!SUPPORTED_STRING_FORMATS.has(node.format)) pruned[key] = value;\n\t\telse if (typeof value !== \"string\" || !isLibraryFormatPattern(node.format, value, vendor)) unsupported.push(`${path}.${key}`);\n\t} else unsupported.push(`${path}.${key}`);\n\treturn pruned;\n}\n/** Walks the schema root: keeps the spec root keys, drops annotations, rejects the rest. */\nfunction walkRequestedSchema(converted, vendor) {\n\tconst pruned = {};\n\tconst unsupported = [];\n\tfor (const [key, value] of Object.entries(converted)) if (key === \"properties\" && isJsonObject(value)) pruned[key] = Object.fromEntries(Object.entries(value).map(([name, node]) => [name, walkProperty(node, `properties.${name}`, vendor, unsupported)]));\n\telse if (ROOT_KEYS.has(key)) pruned[key] = value;\n\telse if (!isAnnotationOnlyJsonSchemaKeyword(key)) unsupported.push(key);\n\tif (unsupported.length > 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${unsupported.join(\", \")}`);\n\treturn pruned;\n}\n/** Names the properties that fail value validation, instead of surfacing a raw union dump. */\nfunction describeUnsupportedProperties(pruned, fallback) {\n\tif (!isJsonObject(pruned.properties)) return fallback;\n\tconst offenders = Object.entries(pruned.properties).filter(([, node]) => !parseSchema(PrimitiveSchemaDefinitionSchema, node).success).map(([name]) => `properties.${name}`);\n\treturn offenders.length > 0 ? offenders.join(\", \") : fallback;\n}\nfunction findDroppedConstraintPaths(original, parsed, path = \"\") {\n\tif (Array.isArray(original) && Array.isArray(parsed)) return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed[index], `${path}[${index}]`));\n\tif (!isJsonObject(original) || !isJsonObject(parsed)) return [];\n\treturn Object.entries(original).flatMap(([key, value]) => {\n\t\tconst childPath = path ? `${path}.${key}` : key;\n\t\tif (!Object.prototype.hasOwnProperty.call(parsed, key)) return isAnnotationOnlyJsonSchemaKeyword(key) ? [] : [childPath];\n\t\treturn findDroppedConstraintPaths(value, parsed[key], childPath);\n\t});\n}\n/** Converts an authoring-friendly elicitation input into its wire-ready form. */\nfunction normalizeElicitInputParams(input) {\n\tif (!isStandardSchema(input.requestedSchema)) return {\n\t\t...input,\n\t\tmode: \"form\",\n\t\trequestedSchema: input.requestedSchema\n\t};\n\tconst vendor = input.requestedSchema[\"~standard\"].vendor;\n\tconst pruned = walkRequestedSchema(convertStandardElicitationSchema(input.requestedSchema), vendor);\n\tconst parsed = parseSchema(ElicitRequestFormParamsSchema.shape.requestedSchema, pruned);\n\tif (!parsed.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${describeUnsupportedProperties(pruned, parsed.error.message)}`);\n\tconst droppedConstraints = findDroppedConstraintPaths(pruned, parsed.data);\n\tif (droppedConstraints.length > 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${droppedConstraints.join(\", \")}`);\n\tconst danglingRequired = (parsed.data.required ?? []).filter((key) => !Object.prototype.hasOwnProperty.call(parsed.data.properties, key));\n\tif (danglingRequired.length > 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation requestedSchema lists required properties that are not defined in properties: ${danglingRequired.join(\", \")}`);\n\treturn {\n\t\t...input,\n\t\tmode: \"form\",\n\t\trequestedSchema: parsed.data\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inputRequired.ts\n/**\n* Authoring helpers for multi-round-trip requests (protocol revision\n* 2026-07-28).\n*\n* A handler for one of the multi-round-trip methods (`tools/call`,\n* `prompts/get`, `resources/read`) requests additional client input by\n* returning an {@linkcode InputRequiredResult} instead of a final result. The\n* helpers here build that return value and its embedded requests as NEUTRAL\n* values; only the 2026-07-28 wire codec maps them to/from the wire. The\n* 2025-era codec has no input-required vocabulary — on a 2025-era request the\n* server's legacy shim (on by default) fulfils the embedded requests as real\n* server→client requests and re-enters the handler, so the same return shape\n* serves both eras; `ServerOptions.inputRequired.legacyShim: false` restores\n* the pre-shim loud failure.\n*\n* There is no nominal brand: `resultType: 'input_required'` is the\n* discriminator, and hand-built result literals are equally legal — the\n* server seam re-checks the at-least-one rule for them.\n*/\nfunction buildInputRequired(spec) {\n\tconst hasInputRequests = spec.inputRequests !== void 0 && Object.keys(spec.inputRequests).length > 0;\n\tconst hasRequestState = typeof spec.requestState === \"string\";\n\tif (!hasInputRequests && !hasRequestState) throw new TypeError(\"inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)\");\n\treturn {\n\t\tresultType: \"input_required\",\n\t\t...spec.inputRequests !== void 0 && { inputRequests: spec.inputRequests },\n\t\t...spec.requestState !== void 0 && { requestState: spec.requestState }\n\t};\n}\n/**\n* Builder for the input-required return value of multi-round-trip handlers,\n* with per-kind constructors for the embedded requests\n* (`inputRequired.elicit`, `inputRequired.elicitUrl`,\n* `inputRequired.createMessage`, `inputRequired.listRoots`).\n*\n* @example Write-once tool requesting confirmation\n* ```ts\n* server.registerTool('deploy', { inputSchema: z.object({ env: z.string() }) }, async ({ env }, ctx) => {\n* const confirmed = acceptedContent<{ confirm: boolean }>(ctx.mcpReq.inputResponses, 'confirm');\n* if (!confirmed) {\n* return inputRequired({\n* inputRequests: {\n* confirm: inputRequired.elicit({\n* message: `Deploy to ${env}?`,\n* requestedSchema: { type: 'object', properties: { confirm: { type: 'boolean' } }, required: ['confirm'] }\n* })\n* }\n* });\n* }\n* return { content: [{ type: 'text', text: `deployed to ${env}` }] };\n* });\n* ```\n*/\nconst inputRequired = Object.assign(buildInputRequired, {\n\telicit(params) {\n\t\ttry {\n\t\t\treturn {\n\t\t\t\tmethod: \"elicitation/create\",\n\t\t\t\tparams: normalizeElicitInputParams(params)\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tthrow error instanceof ProtocolError ? new TypeError(error.message, { cause: error }) : error;\n\t\t}\n\t},\n\telicitUrl(params) {\n\t\treturn {\n\t\t\tmethod: \"elicitation/create\",\n\t\t\tparams: {\n\t\t\t\t...params,\n\t\t\t\tmode: \"url\"\n\t\t\t}\n\t\t};\n\t},\n\tcreateMessage(params) {\n\t\treturn {\n\t\t\tmethod: \"sampling/createMessage\",\n\t\t\tparams\n\t\t};\n\t},\n\tlistRoots() {\n\t\treturn { method: \"roots/list\" };\n\t}\n});\nfunction acceptedContent(responses, key, schema) {\n\tconst view = inputResponse(responses, key);\n\tif (view.kind !== \"elicit\" || view.action !== \"accept\" || view.content === void 0) return void 0;\n\tif (schema === void 0) return view.content;\n\tconst outcome = schema[\"~standard\"].validate(view.content);\n\tif (outcome instanceof Promise) throw new TypeError(\"acceptedContent(responses, key, schema) requires a synchronously-validating schema\");\n\treturn outcome.issues === void 0 ? outcome.value : void 0;\n}\n/**\n* Reads one entry of a retried request's `inputResponses`\n* (`ctx.mcpReq.inputResponses`) as a discriminated view, covering\n* decline/cancel detection and the non-elicitation response kinds that\n* {@linkcode acceptedContent} does not surface.\n*\n* The values arrive from the client and are not re-validated here — treat\n* them as untrusted input (validate elicitation content with the\n* schema-aware {@linkcode acceptedContent} overload where it matters).\n*/\nfunction inputResponse(responses, key) {\n\tif (responses === void 0 || typeof responses !== \"object\" || responses === null) return { kind: \"missing\" };\n\tconst entry = responses[key];\n\tif (entry === null || typeof entry !== \"object\" || Array.isArray(entry)) return { kind: \"missing\" };\n\tconst candidate = entry;\n\tif (candidate[\"action\"] === \"accept\" || candidate[\"action\"] === \"decline\" || candidate[\"action\"] === \"cancel\") {\n\t\tconst content = candidate[\"content\"];\n\t\treturn {\n\t\t\tkind: \"elicit\",\n\t\t\taction: candidate[\"action\"],\n\t\t\t...content !== null && typeof content === \"object\" && !Array.isArray(content) && { content }\n\t\t};\n\t}\n\tif (Array.isArray(candidate[\"roots\"])) return {\n\t\tkind: \"roots\",\n\t\troots: candidate[\"roots\"]\n\t};\n\tif (typeof candidate[\"role\"] === \"string\" && candidate[\"content\"] !== void 0) return {\n\t\tkind: \"sampling\",\n\t\tresult: candidate\n\t};\n\treturn { kind: \"missing\" };\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inputRequiredDriver.ts\n/**\n* The multi-round-trip auto-fulfilment driver (protocol revision 2026-07-28).\n*\n* When a request to one of the multi-round-trip methods comes back as\n* `input_required`, the driver fulfils the embedded input requests by\n* dispatching them to the client's already-registered handlers (elicitation,\n* sampling, roots — one generic engine, no per-feature API), then retries the\n* original request with the collected `inputResponses` and a byte-exact echo\n* of `requestState`, on a fresh request id, until the server returns a\n* complete result or the round cap is exhausted.\n*\n* The driver is a LAYER OVER THE MANUAL PATH: each retry is issued with the\n* same primitive a manual caller uses (`allowInputRequired` semantics — the\n* retry hands back the next `input_required` payload instead of recursing),\n* so the loop, the cap, and the pacing live in one place and disabling\n* auto-fulfilment (`inputRequired.autoFulfill: false`) simply skips this\n* module. Timeouts ride the EXISTING knobs: the per-leg `timeout` applies to\n* every wire leg unchanged, and `maxTotalTimeout` bounds the whole flow by\n* shrinking the budget passed to each leg — no new timer system.\n*/\n/**\n* Fixed pacing applied before retrying a requestState-only (load-shedding)\n* leg — a leg that carries no embedded input requests, so nothing slows the\n* loop down naturally. Counted in the same round cap.\n*/\nconst REQUEST_STATE_ONLY_LEG_PACING_MS = 250;\n/**\n* The message both multi-round-trip loops emit when the round cap is\n* exhausted — the client driver as a typed error, the server-side legacy\n* shim as its per-family failure. One formatter so the texts cannot drift\n* (hosts and models read the tool-result copy verbatim).\n*/\nfunction inputRequiredRoundsExceededMessage(method, maxRounds) {\n\treturn `Multi-round-trip request '${method}' still required input after ${maxRounds} rounds (inputRequired.maxRounds)`;\n}\n/**\n* Abortable delay: resolves after `ms`, or rejects with the signal's reason\n* (wrapped in an `SdkError` when it isn't already one) if the signal aborts\n* first. Aborting after resolution is a no-op. Shared with the server-side\n* legacy shim (the pacing semantics must match per era).\n*/\nfunction sleep(ms, signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(signal.reason instanceof SdkError ? signal.reason : new SdkError(SdkErrorCode.RequestTimeout, String(signal.reason)));\n\t\t\treturn;\n\t\t}\n\t\tconst timer = setTimeout(() => {\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\tresolve();\n\t\t}, ms);\n\t\tconst onAbort = () => {\n\t\t\tclearTimeout(timer);\n\t\t\treject(signal?.reason instanceof SdkError ? signal.reason : new SdkError(SdkErrorCode.RequestTimeout, String(signal?.reason)));\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n}\n/**\n* A per-round abort linked to the caller's signal: the embedded sibling\n* dispatches share it, so the first failure (or a caller abort) cancels the\n* others instead of leaving them running. Shared with the server-side legacy\n* shim (the abort-linkage semantics must match per era).\n*/\nfunction linkedRoundAbort(outer) {\n\tconst controller = new AbortController();\n\tconst onOuterAbort = () => controller.abort(outer?.reason);\n\touter?.addEventListener(\"abort\", onOuterAbort, { once: true });\n\tif (outer?.aborted) controller.abort(outer.reason);\n\treturn {\n\t\tsignal: controller.signal,\n\t\tabort: (reason) => controller.abort(reason),\n\t\tdispose: () => outer?.removeEventListener(\"abort\", onOuterAbort)\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/types/specTypeSchema.ts\n/**\n* Explicit allowlist of protocol Zod schemas that correspond to a public spec type in `types.ts`.\n*\n* This intentionally excludes internal helper schemas exported from `schemas.ts` that have no\n* matching public type (e.g. `ListChangedOptionsBaseSchema`, `BaseRequestParamsSchema`,\n* `NotificationsParamsSchema`, `ClientTasksCapabilitySchema`, `ServerTasksCapabilitySchema`).\n* Keeping the list explicit means new public spec types must be added here deliberately, and\n* internals never leak into `SpecTypeName`.\n*\n* `ResourceTemplateSchema` is included; its public type is exported as `ResourceTemplateType`\n* (the bare name collides with the server package's `ResourceTemplate` class), so\n* `SpecTypes['ResourceTemplate']` is structurally equal to `ResourceTemplateType` rather than to\n* a type literally named `ResourceTemplate`.\n*/\nconst SPEC_SCHEMA_KEYS = [\n\t\"AnnotationsSchema\",\n\t\"AudioContentSchema\",\n\t\"BaseMetadataSchema\",\n\t\"BlobResourceContentsSchema\",\n\t\"BooleanSchemaSchema\",\n\t\"CallToolRequestSchema\",\n\t\"CallToolRequestParamsSchema\",\n\t\"CallToolResultSchema\",\n\t\"CancelledNotificationSchema\",\n\t\"CancelledNotificationParamsSchema\",\n\t\"CancelTaskRequestSchema\",\n\t\"CancelTaskResultSchema\",\n\t\"ClientCapabilitiesSchema\",\n\t\"ClientNotificationSchema\",\n\t\"ClientRequestSchema\",\n\t\"ClientResultSchema\",\n\t\"CompatibilityCallToolResultSchema\",\n\t\"CompleteRequestSchema\",\n\t\"CompleteRequestParamsSchema\",\n\t\"CompleteResultSchema\",\n\t\"ContentBlockSchema\",\n\t\"CreateMessageRequestSchema\",\n\t\"CreateMessageRequestParamsSchema\",\n\t\"CreateMessageResultSchema\",\n\t\"CreateMessageResultWithToolsSchema\",\n\t\"CreateTaskResultSchema\",\n\t\"CursorSchema\",\n\t\"DiscoverRequestSchema\",\n\t\"DiscoverResultSchema\",\n\t\"ElicitationCompleteNotificationSchema\",\n\t\"ElicitationCompleteNotificationParamsSchema\",\n\t\"ElicitRequestSchema\",\n\t\"ElicitRequestFormParamsSchema\",\n\t\"ElicitRequestParamsSchema\",\n\t\"ElicitRequestURLParamsSchema\",\n\t\"ElicitResultSchema\",\n\t\"EmbeddedResourceSchema\",\n\t\"EmptyResultSchema\",\n\t\"EnumSchemaSchema\",\n\t\"GetPromptRequestSchema\",\n\t\"GetPromptRequestParamsSchema\",\n\t\"GetPromptResultSchema\",\n\t\"GetTaskPayloadRequestSchema\",\n\t\"GetTaskPayloadResultSchema\",\n\t\"GetTaskRequestSchema\",\n\t\"GetTaskResultSchema\",\n\t\"IconSchema\",\n\t\"IconsSchema\",\n\t\"ImageContentSchema\",\n\t\"ImplementationSchema\",\n\t\"InitializedNotificationSchema\",\n\t\"InitializeRequestSchema\",\n\t\"InitializeRequestParamsSchema\",\n\t\"InitializeResultSchema\",\n\t\"JSONArraySchema\",\n\t\"JSONObjectSchema\",\n\t\"JSONRPCErrorResponseSchema\",\n\t\"JSONRPCMessageSchema\",\n\t\"JSONRPCNotificationSchema\",\n\t\"JSONRPCRequestSchema\",\n\t\"JSONRPCResponseSchema\",\n\t\"JSONRPCResultResponseSchema\",\n\t\"JSONValueSchema\",\n\t\"LegacyTitledEnumSchemaSchema\",\n\t\"ListPromptsRequestSchema\",\n\t\"ListPromptsResultSchema\",\n\t\"ListResourcesRequestSchema\",\n\t\"ListResourcesResultSchema\",\n\t\"ListResourceTemplatesRequestSchema\",\n\t\"ListResourceTemplatesResultSchema\",\n\t\"ListRootsRequestSchema\",\n\t\"ListRootsResultSchema\",\n\t\"ListTasksRequestSchema\",\n\t\"ListTasksResultSchema\",\n\t\"ListToolsRequestSchema\",\n\t\"ListToolsResultSchema\",\n\t\"LoggingLevelSchema\",\n\t\"LoggingMessageNotificationSchema\",\n\t\"LoggingMessageNotificationParamsSchema\",\n\t\"ModelHintSchema\",\n\t\"ModelPreferencesSchema\",\n\t\"MultiSelectEnumSchemaSchema\",\n\t\"NotificationSchema\",\n\t\"NumberSchemaSchema\",\n\t\"PaginatedRequestSchema\",\n\t\"PaginatedRequestParamsSchema\",\n\t\"PaginatedResultSchema\",\n\t\"PingRequestSchema\",\n\t\"PrimitiveSchemaDefinitionSchema\",\n\t\"ProgressSchema\",\n\t\"ProgressNotificationSchema\",\n\t\"ProgressNotificationParamsSchema\",\n\t\"ProgressTokenSchema\",\n\t\"PromptSchema\",\n\t\"PromptArgumentSchema\",\n\t\"PromptListChangedNotificationSchema\",\n\t\"PromptMessageSchema\",\n\t\"PromptReferenceSchema\",\n\t\"ReadResourceRequestSchema\",\n\t\"ReadResourceRequestParamsSchema\",\n\t\"ReadResourceResultSchema\",\n\t\"RelatedTaskMetadataSchema\",\n\t\"RequestSchema\",\n\t\"RequestIdSchema\",\n\t\"RequestMetaSchema\",\n\t\"ResourceSchema\",\n\t\"ResourceContentsSchema\",\n\t\"ResourceLinkSchema\",\n\t\"ResourceListChangedNotificationSchema\",\n\t\"ResourceRequestParamsSchema\",\n\t\"ResourceTemplateSchema\",\n\t\"ResourceTemplateReferenceSchema\",\n\t\"ResourceUpdatedNotificationSchema\",\n\t\"ResourceUpdatedNotificationParamsSchema\",\n\t\"ResultMetaObjectSchema\",\n\t\"ResultSchema\",\n\t\"RoleSchema\",\n\t\"RootSchema\",\n\t\"RootsListChangedNotificationSchema\",\n\t\"SamplingContentSchema\",\n\t\"SamplingMessageSchema\",\n\t\"SamplingMessageContentBlockSchema\",\n\t\"ServerCapabilitiesSchema\",\n\t\"ServerNotificationSchema\",\n\t\"ServerRequestSchema\",\n\t\"ServerResultSchema\",\n\t\"SetLevelRequestSchema\",\n\t\"SetLevelRequestParamsSchema\",\n\t\"SingleSelectEnumSchemaSchema\",\n\t\"StringSchemaSchema\",\n\t\"SubscribeRequestSchema\",\n\t\"SubscribeRequestParamsSchema\",\n\t\"SubscriptionFilterSchema\",\n\t\"SubscriptionsAcknowledgedNotificationSchema\",\n\t\"SubscriptionsAcknowledgedNotificationParamsSchema\",\n\t\"SubscriptionsListenRequestSchema\",\n\t\"SubscriptionsListenRequestParamsSchema\",\n\t\"SubscriptionsListenResultSchema\",\n\t\"SubscriptionsListenResultMetaSchema\",\n\t\"TaskAugmentedRequestParamsSchema\",\n\t\"TaskCreationParamsSchema\",\n\t\"TaskMetadataSchema\",\n\t\"TaskSchema\",\n\t\"TaskStatusSchema\",\n\t\"TaskStatusNotificationSchema\",\n\t\"TaskStatusNotificationParamsSchema\",\n\t\"TextContentSchema\",\n\t\"TextResourceContentsSchema\",\n\t\"TitledMultiSelectEnumSchemaSchema\",\n\t\"TitledSingleSelectEnumSchemaSchema\",\n\t\"ToolSchema\",\n\t\"ToolAnnotationsSchema\",\n\t\"ToolChoiceSchema\",\n\t\"ToolExecutionSchema\",\n\t\"ToolListChangedNotificationSchema\",\n\t\"ToolResultContentSchema\",\n\t\"ToolUseContentSchema\",\n\t\"UnsubscribeRequestSchema\",\n\t\"UnsubscribeRequestParamsSchema\",\n\t\"UntitledMultiSelectEnumSchemaSchema\",\n\t\"UntitledSingleSelectEnumSchemaSchema\"\n];\nconst authSchemas = {\n\tIdJagTokenExchangeResponseSchema,\n\tOAuthClientInformationFullSchema,\n\tOAuthClientInformationSchema,\n\tOAuthClientMetadataSchema,\n\tOAuthClientRegistrationErrorSchema,\n\tOAuthErrorResponseSchema,\n\tOAuthMetadataSchema,\n\tOAuthProtectedResourceMetadataSchema,\n\tOAuthTokenRevocationRequestSchema,\n\tOAuthTokensSchema,\n\tOpenIdProviderDiscoveryMetadataSchema,\n\tOpenIdProviderMetadataSchema\n};\nconst _specTypeSchemas = {};\nconst _isSpecType = {};\nfunction register(key, schema) {\n\tconst name = key.slice(0, -6);\n\t_specTypeSchemas[name] = schema;\n\t_isSpecType[name] = (v) => schema.safeParse(v).success;\n}\nfor (const key of SPEC_SCHEMA_KEYS) register(key, schemas_exports[key]);\nfor (const [key, schema] of Object.entries(authSchemas)) register(key, schema);\n/**\n* Runtime validators for every MCP spec type, keyed by type name.\n*\n* Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for\n* example an extension's custom-method payload that embeds a `CallToolResult`, or a value read from\n* storage that should be a `Tool`.\n*\n* Each entry implements the Standard Schema interface, so it composes with any\n* Standard-Schema-aware library. For a simple boolean check, use {@linkcode isSpecType} instead.\n*\n* @example\n* ```ts source=\"./specTypeSchema.examples.ts#specTypeSchemas_basicUsage\"\n* const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);\n* if (result.issues === undefined) {\n* // result.value is CallToolResult\n* }\n* ```\n*/\nconst specTypeSchemas = Object.freeze(_specTypeSchemas);\n/**\n* Type predicates for every MCP spec type, keyed by type name.\n*\n* Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and\n* transforms are applied), and narrows to that input type. For schemas with `.default()` or\n* `.preprocess()`, this may accept values that do not structurally match the named output type;\n* for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use\n* `specTypeSchemas.X['~standard'].validate(value)` when you need the validated output value.\n*\n* Each guard is a standalone function, so it can be passed directly as a callback.\n*\n* @example\n* ```ts source=\"./specTypeSchema.examples.ts#isSpecType_basicUsage\"\n* if (isSpecType.ContentBlock(value)) {\n* // value is ContentBlock\n* }\n*\n* const blocks = mixed.filter(isSpecType.ContentBlock);\n* ```\n*/\nconst isSpecType = Object.freeze(_isSpecType);\n\n//#endregion\n//#region ../core-internal/src/wire/bootstrap.ts\nfunction bootstrapOutboundCodec(method) {\n\tswitch (method) {\n\t\tcase \"initialize\":\n\t\tcase \"notifications/initialized\": return codecForVersion(void 0);\n\t\tcase \"server/discover\": return codecForVersion(MODERN_WIRE_REVISION);\n\t\tdefault: return;\n\t}\n}\n\n//#endregion\n//#region ../core-internal/src/shared/protocol.ts\n/**\n* The default request timeout, in milliseconds.\n*/\nconst DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;\n/**\n* The reserved per-request `_meta` envelope keys (protocol revision\n* 2026-07-28). The protocol layer lifts these out of inbound `_meta` before\n* handlers run and surfaces them at `ctx.mcpReq.envelope` — they are\n* wire-level bookkeeping, not handler material.\n*/\nconst RESERVED_ENVELOPE_META_KEYS = [\n\tPROTOCOL_VERSION_META_KEY,\n\tCLIENT_INFO_META_KEY,\n\tCLIENT_CAPABILITIES_META_KEY,\n\tLOG_LEVEL_META_KEY\n];\n/**\n* Top-level params members carrying multi-round-trip driver material\n* (protocol revision 2026-07-28). The spec reserves these names on\n* client-initiated REQUESTS only — notification params keep them untouched\n* (a vendor notification may legitimately use the same names).\n*/\nconst RETRY_PARAMS_KEYS = [\"inputResponses\", \"requestState\"];\n/**\n* Lift wire-only material out of an inbound message so handlers see exactly\n* the 2025-era shape, and surface it for the protocol layer (requests: via\n* `ctx.mcpReq`). What counts as wire-only depends on the message kind: the\n* reserved envelope `_meta` keys are reserved on every message, while the\n* multi-round-trip retry fields (`inputResponses`/`requestState`) are\n* reserved on client-initiated requests only — so notifications get only the\n* envelope lift, and their top-level params stay untouched. Messages without\n* wire-only material are returned unchanged (same reference).\n*/\nfunction liftWireOnlyMaterial(message, kind) {\n\tconst params = message.params;\n\tif (!isPlainObject$1(params)) return {\n\t\tmessage,\n\t\tlifted: {}\n\t};\n\tconst meta = params._meta;\n\tconst envelopeKeys = isPlainObject$1(meta) ? RESERVED_ENVELOPE_META_KEYS.filter((key) => key in meta) : [];\n\tconst retryKeys = kind === \"request\" ? RETRY_PARAMS_KEYS.filter((key) => key in params) : [];\n\tif (envelopeKeys.length === 0 && retryKeys.length === 0) return {\n\t\tmessage,\n\t\tlifted: {}\n\t};\n\tconst lifted = {};\n\tconst nextParams = { ...params };\n\tif (envelopeKeys.length > 0 && isPlainObject$1(meta)) {\n\t\tconst envelope = {};\n\t\tconst nextMeta = { ...meta };\n\t\tfor (const key of envelopeKeys) {\n\t\t\tenvelope[key] = meta[key];\n\t\t\tdelete nextMeta[key];\n\t\t}\n\t\tlifted.envelope = envelope;\n\t\tif (Object.keys(nextMeta).length > 0) nextParams._meta = nextMeta;\n\t\telse delete nextParams._meta;\n\t}\n\tfor (const key of retryKeys) {\n\t\tif (key === \"inputResponses\") lifted.inputResponses = nextParams[key];\n\t\tif (key === \"requestState\") lifted.requestState = nextParams[key];\n\t\tdelete nextParams[key];\n\t}\n\treturn {\n\t\tmessage: {\n\t\t\t...message,\n\t\t\tparams: nextParams\n\t\t},\n\t\tlifted\n\t};\n}\n/**\n* Standard Schema adapter over the era codec's `validateResult` function (the\n* function-only WireCodec contract exposes no schema objects). Used by the\n* spec-method `request()` overload so the request funnel keeps a single\n* `StandardSchemaV1`-shaped validation seam for both spec and explicit-schema\n* paths.\n*\n* Returns `undefined` when the method has no result entry on this era's\n* registry — the caller maps that to the synchronous \"pass a result schema\"\n* TypeError, exactly matching the pre-function-only behavior the\n* typedMapAlignment suite pins (the result map deliberately excludes the\n* `tasks/*` methods, so the spec-method overload refuses them up front).\n*/\nfunction codecResultValidator(codec, method) {\n\tconst probe = codec.validateResult(method, void 0);\n\tif (!probe.ok && probe.reason === \"not-in-era\") return void 0;\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"mcp-wire-codec\",\n\t\tvalidate(value) {\n\t\t\tconst outcome = codec.validateResult(method, value);\n\t\t\tif (outcome.ok) return { value: outcome.value };\n\t\t\treturn { issues: [{ message: outcome.reason === \"invalid\" ? outcome.message : `not-in-era: ${method}` }] };\n\t\t}\n\t} };\n}\n/**\n* Builds the `ctx.mcpReq.requestState` accessor for a resolved value. The\n* `as T` below is the one place {@linkcode RequestStateAccessor}'s\n* caller-asserted typing is implemented — no implementation can produce an\n* arbitrary `T` from a runtime value honestly.\n*/\nfunction requestStateAccessor(value) {\n\treturn () => value;\n}\n/** Shared no-state accessor: the common case allocates nothing per request. */\nconst NO_REQUEST_STATE = requestStateAccessor(void 0);\n/**\n* Returns a context whose `requestState` accessor reads the given value —\n* how the server seam hands a verify hook's decoded payload (or the legacy\n* shim's per-round echo) to the handler without mutating the original\n* context.\n*/\nfunction withRequestStateValue(ctx, value) {\n\treturn {\n\t\t...ctx,\n\t\tmcpReq: {\n\t\t\t...ctx.mcpReq,\n\t\t\trequestState: requestStateAccessor(value)\n\t\t}\n\t};\n}\nlet writeNegotiatedProtocolVersion;\n/**\n* Package-internal write channel for a {@linkcode Protocol} instance's\n* negotiated protocol version, for callers outside the class hierarchy:\n* tests and the (future) modern-era server entry that marks a factory\n* instance modern at binding time. Exported on the core internal barrel\n* only — never public API.\n*/\nfunction setNegotiatedProtocolVersion(instance, version) {\n\twriteNegotiatedProtocolVersion(instance, version);\n}\n/**\n* Implements MCP protocol framing on top of a pluggable transport, including\n* features like request/response linking, notifications, and progress.\n*\n* `Protocol` is abstract; `Client` and `Server` are the concrete role-specific\n* implementations most code should use.\n*/\nvar Protocol = class {\n\t_transport;\n\t_requestMessageId = 0;\n\t_requestHandlers = /* @__PURE__ */ new Map();\n\t_requestHandlerAbortControllers = /* @__PURE__ */ new Map();\n\t_notificationHandlers = /* @__PURE__ */ new Map();\n\t_responseHandlers = /* @__PURE__ */ new Map();\n\t_progressHandlers = /* @__PURE__ */ new Map();\n\t_timeoutInfo = /* @__PURE__ */ new Map();\n\t_pendingDebouncedNotifications = /* @__PURE__ */ new Set();\n\t/**\n\t* The protocol version negotiated for the current connection (`undefined`\n\t* before negotiation completes), which determines the wire era this\n\t* instance speaks. Set by the SDK's negotiation and initialize paths\n\t* (`Client.connect`, `Server._oninitialize`).\n\t*/\n\t_negotiatedProtocolVersion;\n\tstatic {\n\t\twriteNegotiatedProtocolVersion = (instance, version) => {\n\t\t\tinstance._negotiatedProtocolVersion = version;\n\t\t};\n\t}\n\t_supportedProtocolVersions;\n\t/**\n\t* Callback for when the connection is closed for any reason.\n\t*\n\t* This is invoked when {@linkcode Protocol.close | close()} is called as well.\n\t*/\n\tonclose;\n\t/**\n\t* Callback for when an error occurs.\n\t*\n\t* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.\n\t*/\n\tonerror;\n\t/**\n\t* A handler to invoke for any request types that do not have their own handler installed.\n\t*/\n\tfallbackRequestHandler;\n\t/**\n\t* A handler to invoke for any notification types that do not have their own handler installed.\n\t*/\n\tfallbackNotificationHandler;\n\tconstructor(_options) {\n\t\tthis._options = _options;\n\t\tthis._supportedProtocolVersions = _options?.supportedProtocolVersions ?? SUPPORTED_PROTOCOL_VERSIONS;\n\t\tthis.setNotificationHandler(\"notifications/cancelled\", (notification) => {\n\t\t\tthis._oncancel(notification);\n\t\t});\n\t\tthis.setNotificationHandler(\"notifications/progress\", (notification) => {\n\t\t\tthis._onprogress(notification);\n\t\t});\n\t\tthis.setRequestHandler(\"ping\", (_request) => ({}));\n\t}\n\t/**\n\t* Drop consult for inbound messages whose transport did not classify them\n\t* at the edge — long-lived channels such as stdio, where a role class may\n\t* need to decline traffic the negotiated era has no answer for (the\n\t* client-side inbound-request drop on modern-era connections: the\n\t* 2026-07-28 era has no server→client request channel, and on stdio the\n\t* client must never write JSON-RPC responses).\n\t*\n\t* Consulted ONLY when the transport supplied no\n\t* {@linkcode MessageExtraInfo.classification}: edge-classified traffic\n\t* never reaches the hook. Returning `'drop'` discards the message without\n\t* writing any response (requests are surfaced via `onerror`). The base\n\t* implementation returns `undefined`: unclassified traffic keeps today's\n\t* dispatch path unchanged. Era selection never happens here — era is\n\t* instance state, owned by the serving entry that constructed and\n\t* connected the instance.\n\t*/\n\t_shouldDropInbound(_message) {}\n\t/**\n\t* The per-request `_meta` envelope this instance attaches to every outgoing\n\t* request and notification, when one applies. The base implementation\n\t* returns `undefined` (no envelope — the 2025-era posture, so legacy-era\n\t* outbound traffic is byte-identical to a build without this seam).\n\t* `Client` overrides it on a connection that negotiated a modern (2026-07-28+)\n\t* era to return the reserved protocol-version / client-info /\n\t* client-capabilities keys. User-supplied `_meta` keys take precedence over\n\t* the auto-attached ones.\n\t*/\n\t_outboundMetaEnvelope() {}\n\t/**\n\t* Attach this instance's outbound `_meta` envelope (when one is configured)\n\t* to a request or notification. A no-op when the seam returns `undefined`\n\t* — the message returns by reference, so the legacy-era wire stays\n\t* byte-identical. User-supplied `_meta` keys are spread last so they win\n\t* over the auto-attached envelope keys.\n\t*/\n\t_envelopeOutbound(message) {\n\t\tconst envelope = this._outboundMetaEnvelope();\n\t\tif (envelope === void 0) return message;\n\t\tconst params = message.params ?? {};\n\t\treturn {\n\t\t\t...message,\n\t\t\tparams: {\n\t\t\t\t...params,\n\t\t\t\t_meta: {\n\t\t\t\t\t...envelope,\n\t\t\t\t\t...params._meta\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Extension point for non-`complete` decoded results in the response\n\t* funnel: a result the wire codec discriminated into a kind other than\n\t* `'complete'` or `'invalid'` is handed here for the role class to\n\t* resolve. The base default surfaces it as a typed\n\t* {@linkcode SdkErrorCode.UnsupportedResultType} error (no retry).\n\t*\n\t* Intended consumers (named so the seam stays accountable):\n\t* - the `Client`'s multi-round-trip auto-fulfilment engine, which fulfils\n\t* `'input_required'` results through the registered\n\t* elicitation/sampling/roots handlers and retries via `flow.retry`;\n\t* - a future client-side terminal-result handler for\n\t* `subscriptions/listen`, when the spec defines one.\n\t*\n\t* `Server` instances never receive `input_required` responses on their\n\t* outbound legs and leave the base behavior in place.\n\t*/\n\t_resolveNonCompleteResult(decoded, flow) {\n\t\treturn Promise.reject(new SdkError(SdkErrorCode.UnsupportedResultType, `Unsupported result type '${decoded.kind}' for ${flow.request.method}`, {\n\t\t\tresultType: decoded.kind,\n\t\t\tmethod: flow.request.method\n\t\t}));\n\t}\n\t/**\n\t* Protected accessor for a registered request handler. Used by role\n\t* classes that dispatch synthesized requests through the same stored\n\t* handler chain (e.g. the `Client` fulfilling an embedded multi-round-trip\n\t* input request).\n\t*/\n\t_getRequestHandler(method) {\n\t\treturn this._requestHandlers.get(method);\n\t}\n\tasync _oncancel(notification) {\n\t\tif (!notification.params.requestId) return;\n\t\tthis._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);\n\t}\n\t_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {\n\t\tthis._timeoutInfo.set(messageId, {\n\t\t\ttimeoutId: setTimeout(onTimeout, timeout),\n\t\t\tstartTime: Date.now(),\n\t\t\ttimeout,\n\t\t\tmaxTotalTimeout,\n\t\t\tresetTimeoutOnProgress,\n\t\t\tonTimeout\n\t\t});\n\t}\n\t_resetTimeout(messageId) {\n\t\tconst info = this._timeoutInfo.get(messageId);\n\t\tif (!info) return false;\n\t\tconst totalElapsed = Date.now() - info.startTime;\n\t\tif (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {\n\t\t\tthis._timeoutInfo.delete(messageId);\n\t\t\tthrow new SdkError(SdkErrorCode.RequestTimeout, \"Maximum total timeout exceeded\", {\n\t\t\t\tmaxTotalTimeout: info.maxTotalTimeout,\n\t\t\t\ttotalElapsed\n\t\t\t});\n\t\t}\n\t\tclearTimeout(info.timeoutId);\n\t\tinfo.timeoutId = setTimeout(info.onTimeout, info.timeout);\n\t\treturn true;\n\t}\n\t_cleanupTimeout(messageId) {\n\t\tconst info = this._timeoutInfo.get(messageId);\n\t\tif (info) {\n\t\t\tclearTimeout(info.timeoutId);\n\t\t\tthis._timeoutInfo.delete(messageId);\n\t\t}\n\t}\n\t/**\n\t* Attaches to the given transport, starts it, and starts listening for messages.\n\t*\n\t* The caller assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.\n\t*/\n\tasync connect(transport) {\n\t\tthis._transport = transport;\n\t\tconst _onclose = this.transport?.onclose;\n\t\tthis._transport.onclose = () => {\n\t\t\ttry {\n\t\t\t\t_onclose?.();\n\t\t\t} finally {\n\t\t\t\tthis._onclose();\n\t\t\t}\n\t\t};\n\t\tconst _onerror = this.transport?.onerror;\n\t\tthis._transport.onerror = (error) => {\n\t\t\t_onerror?.(error);\n\t\t\tthis._onerror(error);\n\t\t};\n\t\tconst _onmessage = this._transport?.onmessage;\n\t\tthis._transport.onmessage = (message, extra) => {\n\t\t\t_onmessage?.(message, extra);\n\t\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) this._onresponse(message);\n\t\t\telse if (isJSONRPCRequest(message)) this._onrequest(message, extra);\n\t\t\telse if (isJSONRPCNotification(message)) this._onnotification(message, extra);\n\t\t\telse this._onerror(/* @__PURE__ */ new Error(`Unknown message type: ${JSON.stringify(message)}`));\n\t\t};\n\t\ttransport.setSupportedProtocolVersions?.(this._supportedProtocolVersions);\n\t\tawait this._transport.start();\n\t}\n\t/**\n\t* Transport-close hook. Subclass overrides MUST call `super._onclose()`\n\t* after their own cleanup — base teardown (response-handler settlement,\n\t* timeout clearing, in-flight request abort) does not run otherwise.\n\t*/\n\t_onclose() {\n\t\tconst responseHandlers = this._responseHandlers;\n\t\tthis._responseHandlers = /* @__PURE__ */ new Map();\n\t\tthis._progressHandlers.clear();\n\t\tthis._pendingDebouncedNotifications.clear();\n\t\tfor (const info of this._timeoutInfo.values()) clearTimeout(info.timeoutId);\n\t\tthis._timeoutInfo.clear();\n\t\tconst requestHandlerAbortControllers = this._requestHandlerAbortControllers;\n\t\tthis._requestHandlerAbortControllers = /* @__PURE__ */ new Map();\n\t\tconst error = new SdkError(SdkErrorCode.ConnectionClosed, \"Connection closed\");\n\t\tthis._transport = void 0;\n\t\ttry {\n\t\t\tthis.onclose?.();\n\t\t} finally {\n\t\t\tfor (const handler of responseHandlers.values()) handler(error);\n\t\t\tfor (const controller of requestHandlerAbortControllers.values()) controller.abort(error);\n\t\t}\n\t}\n\t_onerror(error) {\n\t\tthis.onerror?.(error);\n\t}\n\t/**\n\t* Inbound-notification dispatch. Subclass overrides MUST delegate\n\t* unmatched traffic to `super._onnotification(rawNotification, extra)` —\n\t* an override that consumes only what it owns and falls through to base\n\t* dispatch for everything else.\n\t*/\n\t_onnotification(rawNotification, extra) {\n\t\tconst { message: notification } = liftWireOnlyMaterial(rawNotification, \"notification\");\n\t\tconst codec = this._negotiatedWireCodec();\n\t\tif (extra?.classification === void 0 && this._shouldDropInbound(rawNotification) === \"drop\") return;\n\t\tif (extra?.classification !== void 0) {\n\t\t\tconst classified = classifiedWireEra(extra.classification);\n\t\t\tif (classified !== codec.era) {\n\t\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Era mismatch on inbound notification '${notification.method}': classified as ${classified} but this instance serves ${codec.era}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (isSpecNotificationMethod(notification.method) && !codec.hasNotificationMethod(notification.method)) return;\n\t\tconst handler = this._notificationHandlers.get(notification.method);\n\t\tconst fallback = this.fallbackNotificationHandler;\n\t\tif (handler === void 0 && fallback === void 0) return;\n\t\tPromise.resolve().then(() => handler === void 0 ? fallback(notification) : handler(notification, codec)).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Uncaught error in notification handler: ${error}`)));\n\t}\n\t_onrequest(rawRequest, extra) {\n\t\tconst { message: request, lifted } = liftWireOnlyMaterial(rawRequest, \"request\");\n\t\tconst codec = this._negotiatedWireCodec();\n\t\tif (extra?.classification === void 0 && this._shouldDropInbound(rawRequest) === \"drop\") {\n\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Dropped inbound request '${rawRequest.method}': not servable on this connection's protocol era`));\n\t\t\treturn;\n\t\t}\n\t\tconst capturedTransport = this._transport;\n\t\tconst sendErrorResponse = (code, message, data) => {\n\t\t\tconst errorResponse = {\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: request.id,\n\t\t\t\terror: {\n\t\t\t\t\tcode,\n\t\t\t\t\tmessage,\n\t\t\t\t\t...data !== void 0 && { data }\n\t\t\t\t}\n\t\t\t};\n\t\t\tcapturedTransport?.send(errorResponse).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send an error response: ${error}`)));\n\t\t};\n\t\tif (extra?.classification !== void 0) {\n\t\t\tconst classified = classifiedWireEra(extra.classification);\n\t\t\tif (classified !== codec.era) {\n\t\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Era mismatch on inbound request '${request.method}': classified as ${classified} but this instance serves ${codec.era}`));\n\t\t\t\tconst requested = extra.classification.revision ?? classified;\n\t\t\t\tsendErrorResponse(ProtocolErrorCode.UnsupportedProtocolVersion, `Unsupported protocol version: ${requested}`, {\n\t\t\t\t\tsupported: this._supportedProtocolVersions,\n\t\t\t\t\trequested\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (isSpecRequestMethod(request.method) && !codec.hasRequestMethod(request.method)) {\n\t\t\tsendErrorResponse(ProtocolErrorCode.MethodNotFound, \"Method not found\");\n\t\t\treturn;\n\t\t}\n\t\tconst handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;\n\t\tif (handler === void 0) {\n\t\t\tsendErrorResponse(ProtocolErrorCode.MethodNotFound, \"Method not found\");\n\t\t\treturn;\n\t\t}\n\t\tconst envelopeError = codec.checkInboundEnvelope(lifted);\n\t\tif (envelopeError !== void 0) {\n\t\t\tsendErrorResponse(ProtocolErrorCode.InvalidParams, envelopeError);\n\t\t\treturn;\n\t\t}\n\t\tconst sendNotification = (notification, options) => this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, {\n\t\t\t...options,\n\t\t\trelatedRequestId: request.id\n\t\t});\n\t\tconst sendRequest = (r, resultSchema, options) => this._requestWithSchemaViaCodec(this._resolveOutboundCodec(r.method), r, resultSchema, {\n\t\t\t...options,\n\t\t\trelatedRequestId: request.id\n\t\t});\n\t\tconst abortController = new AbortController();\n\t\tthis._requestHandlerAbortControllers.set(request.id, abortController);\n\t\tconst partitionedInputResponses = lifted.inputResponses === void 0 ? void 0 : partitionInputResponses(lifted.inputResponses);\n\t\tconst baseCtx = {\n\t\t\tsessionId: capturedTransport?.sessionId,\n\t\t\tmcpReq: {\n\t\t\t\tid: request.id,\n\t\t\t\tmethod: request.method,\n\t\t\t\t_meta: request.params?._meta,\n\t\t\t\t...lifted.envelope !== void 0 && { envelope: lifted.envelope },\n\t\t\t\t...partitionedInputResponses !== void 0 && { inputResponses: partitionedInputResponses.accepted },\n\t\t\t\t...partitionedInputResponses !== void 0 && partitionedInputResponses.droppedKeys.length > 0 && { droppedInputResponseKeys: partitionedInputResponses.droppedKeys },\n\t\t\t\trequestState: lifted.requestState === void 0 ? NO_REQUEST_STATE : requestStateAccessor(lifted.requestState),\n\t\t\t\tsignal: abortController.signal,\n\t\t\t\tsend: ((r, schemaOrOptions, maybeOptions) => {\n\t\t\t\t\tconst sendCodec = this._resolveOutboundCodec(r.method);\n\t\t\t\t\tthis._assertOutboundRequestInEra(sendCodec, r.method);\n\t\t\t\t\tif (isStandardSchema(schemaOrOptions)) return sendRequest(r, schemaOrOptions, maybeOptions);\n\t\t\t\t\tconst validate = codecResultValidator(sendCodec, r.method);\n\t\t\t\t\tif (validate === void 0) throw new TypeError(`'${r.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);\n\t\t\t\t\treturn sendRequest(r, validate, schemaOrOptions);\n\t\t\t\t}),\n\t\t\t\tnotify: sendNotification\n\t\t\t},\n\t\t\thttp: extra?.authInfo ? { authInfo: extra.authInfo } : void 0\n\t\t};\n\t\tconst ctx = this.buildContext(baseCtx, extra);\n\t\tPromise.resolve().then(() => handler(request, ctx)).then(async (result) => {\n\t\t\tif (abortController.signal.aborted) return;\n\t\t\tlet encoded;\n\t\t\ttry {\n\t\t\t\tencoded = codec.encodeResult(request.method, result, this._outboundServerInfo());\n\t\t\t} catch (error) {\n\t\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Failed to encode result for ${request.method}: ${error}`));\n\t\t\t\tsendErrorResponse(ProtocolErrorCode.InternalError, \"Internal error\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst response = {\n\t\t\t\tresult: encoded,\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: request.id\n\t\t\t};\n\t\t\tawait capturedTransport?.send(response);\n\t\t}, async (error) => {\n\t\t\tif (abortController.signal.aborted) return;\n\t\t\tconst thrownCode = Number.isSafeInteger(error[\"code\"]) ? error[\"code\"] : ProtocolErrorCode.InternalError;\n\t\t\tconst errorResponse = {\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: request.id,\n\t\t\t\terror: {\n\t\t\t\t\tcode: codec.encodeErrorCode(thrownCode),\n\t\t\t\t\tmessage: error.message ?? \"Internal error\",\n\t\t\t\t\t...error[\"data\"] !== void 0 && { data: error[\"data\"] }\n\t\t\t\t}\n\t\t\t};\n\t\t\tawait capturedTransport?.send(errorResponse);\n\t\t}).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send response: ${error}`))).finally(() => {\n\t\t\tif (this._requestHandlerAbortControllers.get(request.id) === abortController) this._requestHandlerAbortControllers.delete(request.id);\n\t\t});\n\t}\n\t_onprogress(notification) {\n\t\tconst { progressToken, ...params } = notification.params;\n\t\tconst messageId = Number(progressToken);\n\t\tconst handler = this._progressHandlers.get(messageId);\n\t\tif (!handler) {\n\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));\n\t\t\treturn;\n\t\t}\n\t\tconst responseHandler = this._responseHandlers.get(messageId);\n\t\tconst timeoutInfo = this._timeoutInfo.get(messageId);\n\t\tif (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) try {\n\t\t\tthis._resetTimeout(messageId);\n\t\t} catch (error) {\n\t\t\tthis._responseHandlers.delete(messageId);\n\t\t\tthis._progressHandlers.delete(messageId);\n\t\t\tthis._cleanupTimeout(messageId);\n\t\t\tresponseHandler(error);\n\t\t\treturn;\n\t\t}\n\t\thandler(params);\n\t}\n\t/**\n\t* Inbound-response dispatch. Subclass overrides MUST delegate unmatched\n\t* traffic to `super._onresponse(response)` — an override that consumes\n\t* only what it owns and falls through to base dispatch for everything\n\t* else.\n\t*/\n\t_onresponse(response) {\n\t\tconst messageId = Number(response.id);\n\t\tconst handler = this._responseHandlers.get(messageId);\n\t\tif (handler === void 0) {\n\t\t\tthis._onerror(/* @__PURE__ */ new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));\n\t\t\treturn;\n\t\t}\n\t\tthis._responseHandlers.delete(messageId);\n\t\tthis._cleanupTimeout(messageId);\n\t\tthis._progressHandlers.delete(messageId);\n\t\tif (isJSONRPCResultResponse(response)) handler(response);\n\t\telse handler(ProtocolError.fromError(response.error.code, response.error.message, response.error.data));\n\t}\n\tget transport() {\n\t\treturn this._transport;\n\t}\n\t/**\n\t* Closes the connection.\n\t*/\n\tasync close() {\n\t\tawait this._transport?.close();\n\t}\n\trequest(request, schemaOrOptions, maybeOptions) {\n\t\tconst codec = this._resolveOutboundCodec(request.method);\n\t\tthis._assertOutboundRequestInEra(codec, request.method);\n\t\tif (isStandardSchema(schemaOrOptions)) return this._requestWithSchemaViaCodec(codec, request, schemaOrOptions, maybeOptions);\n\t\tconst validate = codecResultValidator(codec, request.method);\n\t\tif (validate === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);\n\t\treturn this._requestWithSchemaViaCodec(codec, request, validate, schemaOrOptions);\n\t}\n\t/**\n\t* The wire codec for this instance's negotiated era — the phase-2 truth:\n\t* everything an established connection sends and receives resolves\n\t* through it. Legacy until a version has been negotiated.\n\t*/\n\t_negotiatedWireCodec() {\n\t\treturn codecForVersion(this._negotiatedProtocolVersion);\n\t}\n\t/**\n\t* Protected accessor for the instance's negotiated wire codec, for role\n\t* classes (Client/Server/McpServer) routing era-dependent behavior\n\t* through the codec's function-only surface — `samplingResultVariant`,\n\t* `outboundEnvelope`, `projectCallToolResult` — instead of branching on\n\t* the protocol version themselves.\n\t*/\n\t_wireCodec() {\n\t\treturn this._negotiatedWireCodec();\n\t}\n\t/**\n\t* Outbound codec resolution: while the negotiated version is still unset\n\t* (the negotiation window), lifecycle messages are bootstrap-pinned BY\n\t* METHOD — they self-identify their era (`initialize` IS the legacy\n\t* handshake, `server/discover` IS the modern probe). Once a version has\n\t* been negotiated, the instance era is authoritative for everything — a\n\t* negotiated session never re-routes a method onto the other era.\n\t*/\n\t_resolveOutboundCodec(method) {\n\t\tif (this._negotiatedProtocolVersion === void 0) {\n\t\t\tconst pinned = bootstrapOutboundCodec(method);\n\t\t\tif (pinned) return pinned;\n\t\t}\n\t\treturn this._negotiatedWireCodec();\n\t}\n\t/**\n\t* Era gate for outbound requests — deletions are physical in BOTH\n\t* directions: sending a spec method that the resolved era does not define\n\t* dies locally with a typed error before anything reaches the transport.\n\t* Methods outside the spec universe are consumer-owned extension methods\n\t* and stay era-blind.\n\t*/\n\t_assertOutboundRequestInEra(codec, method) {\n\t\tif (isSpecRequestMethod(method) && !codec.hasRequestMethod(method)) throw new SdkError(SdkErrorCode.MethodNotSupportedByProtocolVersion, `Method '${method}' is not supported by the negotiated protocol version (wire era ${codec.era})`, {\n\t\t\tmethod,\n\t\t\tera: codec.era\n\t\t});\n\t}\n\t/**\n\t* Sends a request and waits for a response, using the provided schema for\n\t* validation instead of the era registry's method-keyed entry.\n\t*\n\t* This is the internal implementation used by SDK methods whose result\n\t* schema cannot be expressed as a method-keyed registry entry — the one\n\t* surviving case is `server.createMessage`, whose result schema depends\n\t* on the REQUEST params (tools vs no tools) — and by callers passing\n\t* explicit compatibility schemas. Spec methods are still era-gated here:\n\t* an explicit schema never smuggles a deleted method onto the wire.\n\t*/\n\t_requestWithSchema(request, resultSchema, options) {\n\t\tconst codec = this._resolveOutboundCodec(request.method);\n\t\tthis._assertOutboundRequestInEra(codec, request.method);\n\t\treturn this._requestWithSchemaViaCodec(codec, request, resultSchema, options);\n\t}\n\t/**\n\t* The request funnel proper, keyed by the resolved era codec: the codec\n\t* owns result decoding (raw-first `resultType` discrimination — V-1 —\n\t* and the era's lift posture) before the schema validation step.\n\t*/\n\t_requestWithSchemaViaCodec(codec, request, resultSchema, options) {\n\t\tconst { relatedRequestId, resumptionToken, onresumptiontoken, headers } = options ?? {};\n\t\tconst flowStartedAt = Date.now();\n\t\tlet onAbort;\n\t\tlet cleanupMessageId;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst earlyReject = (error) => {\n\t\t\t\treject(error);\n\t\t\t};\n\t\t\tif (!this._transport) {\n\t\t\t\tearlyReject(/* @__PURE__ */ new Error(\"Not connected\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._options?.enforceStrictCapabilities === true) try {\n\t\t\t\tthis.assertCapabilityForMethod(request.method);\n\t\t\t} catch (error) {\n\t\t\t\tearlyReject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options?.signal?.aborted) {\n\t\t\t\tconst reason = options.signal.reason;\n\t\t\t\tthrow reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason));\n\t\t\t}\n\t\t\tconst requestAbort = codec.era === MODERN_WIRE_REVISION && this._transport.hasPerRequestStream === true ? new AbortController() : void 0;\n\t\t\tconst messageId = this._requestMessageId++;\n\t\t\tcleanupMessageId = messageId;\n\t\t\tconst jsonrpcRequest = {\n\t\t\t\t...request,\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: messageId\n\t\t\t};\n\t\t\tif (options?.onprogress) {\n\t\t\t\tthis._progressHandlers.set(messageId, options.onprogress);\n\t\t\t\tjsonrpcRequest.params = {\n\t\t\t\t\t...request.params,\n\t\t\t\t\t_meta: {\n\t\t\t\t\t\t...request.params?._meta,\n\t\t\t\t\t\tprogressToken: messageId\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst outbound = this._envelopeOutbound(jsonrpcRequest);\n\t\t\tlet responseReceived = false;\n\t\t\tconst cancel = (reason) => {\n\t\t\t\tif (responseReceived) return;\n\t\t\t\tthis._progressHandlers.delete(messageId);\n\t\t\t\tif (requestAbort === void 0) this._transport?.send(this._envelopeOutbound({\n\t\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\t\tmethod: \"notifications/cancelled\",\n\t\t\t\t\tparams: {\n\t\t\t\t\t\trequestId: messageId,\n\t\t\t\t\t\treason: String(reason)\n\t\t\t\t\t}\n\t\t\t\t}), {\n\t\t\t\t\trelatedRequestId,\n\t\t\t\t\tresumptionToken,\n\t\t\t\t\tonresumptiontoken\n\t\t\t\t}).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));\n\t\t\t\telse requestAbort.abort();\n\t\t\t\treject(reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason)));\n\t\t\t};\n\t\t\tthis._responseHandlers.set(messageId, (response) => {\n\t\t\t\tif (options?.signal?.aborted) return;\n\t\t\t\tresponseReceived = true;\n\t\t\t\tif (response instanceof Error) return reject(response);\n\t\t\t\tlet decoded;\n\t\t\t\ttry {\n\t\t\t\t\tdecoded = codec.decodeResult(request.method, response.result);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn reject(error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t}\n\t\t\t\tif (decoded.kind === \"invalid\") return reject(decoded.error);\n\t\t\t\tif (decoded.kind === \"input_required\") {\n\t\t\t\t\tif (options?.allowInputRequired === true) return resolve(manualInputRequiredValue(decoded));\n\t\t\t\t\tconst flow = {\n\t\t\t\t\t\tcodec,\n\t\t\t\t\t\trequest,\n\t\t\t\t\t\tresultSchema,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\tflowStartedAt,\n\t\t\t\t\t\tretry: (params, legOptions) => this._requestWithSchemaViaCodec(codec, params === void 0 ? { method: request.method } : {\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tparams\n\t\t\t\t\t\t}, resultSchema, legOptions)\n\t\t\t\t\t};\n\t\t\t\t\treturn resolve(this._resolveNonCompleteResult(decoded, flow));\n\t\t\t\t}\n\t\t\t\tconst result = decoded.result;\n\t\t\t\tvalidateStandardSchema(resultSchema, result).then((parseResult) => {\n\t\t\t\t\tif (parseResult.success) resolve(parseResult.data);\n\t\t\t\t\telse reject(new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${request.method}: ${parseResult.error}`));\n\t\t\t\t}, reject);\n\t\t\t});\n\t\t\tonAbort = () => cancel(options?.signal?.reason);\n\t\t\toptions?.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\tconst timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;\n\t\t\tconst timeoutHandler = () => cancel(new SdkError(SdkErrorCode.RequestTimeout, \"Request timed out\", { timeout }));\n\t\t\tthis._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);\n\t\t\tthis._transport.send(outbound, {\n\t\t\t\trelatedRequestId,\n\t\t\t\tresumptionToken,\n\t\t\t\tonresumptiontoken,\n\t\t\t\theaders,\n\t\t\t\trequestSignal: requestAbort?.signal\n\t\t\t}).catch((error) => {\n\t\t\t\tthis._progressHandlers.delete(messageId);\n\t\t\t\treject(error);\n\t\t\t});\n\t\t}).finally(() => {\n\t\t\tif (onAbort) options?.signal?.removeEventListener(\"abort\", onAbort);\n\t\t\tif (cleanupMessageId !== void 0) {\n\t\t\t\tthis._responseHandlers.delete(cleanupMessageId);\n\t\t\t\tthis._cleanupTimeout(cleanupMessageId);\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Emits a notification, which is a one-way message that does not expect a response.\n\t*/\n\tasync notification(notification, options) {\n\t\treturn this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, options);\n\t}\n\t/**\n\t* The notification funnel proper, keyed by the resolved era codec —\n\t* direct sends and related notifications (`ctx.mcpReq.notify`) alike\n\t* resolve through the instance's negotiated era at send time.\n\t*/\n\tasync _notificationViaCodec(codec, notification, options) {\n\t\tif (!this._transport) throw new SdkError(SdkErrorCode.NotConnected, \"Not connected\");\n\t\tif (isSpecNotificationMethod(notification.method) && !codec.hasNotificationMethod(notification.method)) throw new SdkError(SdkErrorCode.MethodNotSupportedByProtocolVersion, `Notification '${notification.method}' is not supported by the negotiated protocol version (wire era ${codec.era})`, {\n\t\t\tmethod: notification.method,\n\t\t\tera: codec.era\n\t\t});\n\t\tthis.assertNotificationCapability(notification.method);\n\t\tconst jsonrpcNotification = this._envelopeOutbound({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\t...notification\n\t\t});\n\t\tif ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && !options?.relatedRequestId) {\n\t\t\tif (this._pendingDebouncedNotifications.has(notification.method)) return;\n\t\t\tthis._pendingDebouncedNotifications.add(notification.method);\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tthis._pendingDebouncedNotifications.delete(notification.method);\n\t\t\t\tif (!this._transport) return;\n\t\t\t\tthis._transport?.send(jsonrpcNotification, options).catch((error) => this._onerror(error));\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tawait this._transport.send(jsonrpcNotification, options);\n\t}\n\tsetRequestHandler(method, schemasOrHandler, maybeHandler) {\n\t\tthis.assertRequestHandlerCapability(method);\n\t\tlet stored;\n\t\tif (typeof schemasOrHandler === \"function\") {\n\t\t\tif (!isSpecRequestMethod(method)) throw new TypeError(`'${method}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);\n\t\t\tstored = (request, ctx) => {\n\t\t\t\tconst dispatchCodec = this._negotiatedWireCodec();\n\t\t\t\tlet outcome = dispatchCodec.validateRequest(method, request);\n\t\t\t\tif (!outcome.ok && outcome.reason === \"not-in-era\") outcome = dispatchCodec.validateInputRequest(method, request);\n\t\t\t\tif (!outcome.ok) {\n\t\t\t\t\tif (outcome.reason === \"not-in-era\") throw new ProtocolError(ProtocolErrorCode.InternalError, `No wire schema for ${method} in the resolved era`);\n\t\t\t\t\tthrow new Error(outcome.message);\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(schemasOrHandler(outcome.value, ctx));\n\t\t\t};\n\t\t} else if (maybeHandler) stored = async (request, ctx) => {\n\t\t\tconst parsed = await validateStandardSchema(schemasOrHandler.params, { ...request.params });\n\t\t\tif (!parsed.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for ${method}: ${parsed.error}`);\n\t\t\treturn maybeHandler(parsed.data, ctx);\n\t\t};\n\t\telse throw new TypeError(\"setRequestHandler: handler is required\");\n\t\tthis._requestHandlers.set(method, this._wrapHandler(method, stored));\n\t}\n\t/**\n\t* Hook for subclasses to wrap a registered request handler with role-specific\n\t* validation or behavior (e.g. `Server` validates `tools/call` results, `Client`\n\t* validates `elicitation/create` mode and result). Runs for both the 2-arg and\n\t* 3-arg registration paths. The default implementation is identity.\n\t*\n\t* Subclasses overriding this hook avoid redeclaring `setRequestHandler`'s overload set.\n\t*/\n\t_wrapHandler(_method, handler) {\n\t\treturn handler;\n\t}\n\t/**\n\t* Hook for subclasses to supply the implementation identity the 2026-era\n\t* encode seam stamps into outbound result `_meta` under\n\t* `io.modelcontextprotocol/serverInfo` (spec PR #3002: servers SHOULD\n\t* identify themselves on every response). The default is `undefined` — no\n\t* stamp. Only `Server` overrides this: the key identifies the software\n\t* producing a response, and the 2025-era codec never stamps anything\n\t* regardless (the never-stamp guarantee).\n\t*/\n\t_outboundServerInfo() {}\n\t/**\n\t* Removes the request handler for the given method.\n\t*/\n\tremoveRequestHandler(method) {\n\t\tthis._requestHandlers.delete(method);\n\t}\n\t/**\n\t* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.\n\t*/\n\tassertCanSetRequestHandler(method) {\n\t\tif (this._requestHandlers.has(method)) throw new Error(`A request handler for ${method} already exists, which would be overridden`);\n\t}\n\tsetNotificationHandler(method, schemasOrHandler, maybeHandler) {\n\t\tif (typeof schemasOrHandler === \"function\") {\n\t\t\tif (!isSpecNotificationMethod(method)) throw new TypeError(`'${method}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);\n\t\t\tthis._notificationHandlers.set(method, (notification, codec) => {\n\t\t\t\tconst outcome = codec.validateNotification(method, notification);\n\t\t\t\tif (!outcome.ok) {\n\t\t\t\t\tif (outcome.reason === \"not-in-era\") throw new ProtocolError(ProtocolErrorCode.InternalError, `No wire schema for ${method} in the resolved era`);\n\t\t\t\t\tthrow new Error(outcome.message);\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(schemasOrHandler(outcome.value));\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!maybeHandler) throw new TypeError(\"setNotificationHandler: handler is required\");\n\t\tthis._notificationHandlers.set(method, async (notification) => {\n\t\t\tconst parsed = await validateStandardSchema(schemasOrHandler.params, { ...notification.params });\n\t\t\tif (!parsed.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid params for notification ${method}: ${parsed.error}`);\n\t\t\tawait maybeHandler(parsed.data, notification);\n\t\t});\n\t}\n\t/**\n\t* Removes the notification handler for the given method.\n\t*/\n\tremoveNotificationHandler(method) {\n\t\tthis._notificationHandlers.delete(method);\n\t}\n};\nfunction isPlainObject$1(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\nfunction mergeCapabilities(base, additional) {\n\tconst result = { ...base };\n\tfor (const key in additional) {\n\t\tconst k = key;\n\t\tconst addValue = additional[k];\n\t\tif (addValue === void 0) continue;\n\t\tconst baseValue = result[k];\n\t\tresult[k] = isPlainObject$1(baseValue) && isPlainObject$1(addValue) ? {\n\t\t\t...baseValue,\n\t\t\t...addValue\n\t\t} : addValue;\n\t}\n\treturn result;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/inputRequiredEngine.ts\nfunction isPlainObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/**\n* Splits a retried request's `inputResponses` map into the BARE response\n* entries the spec defines and everything else. The spec's embedded responses\n* are the bare result objects (an `ElicitResult`, `CreateMessageResult`, or\n* `ListRootsResult`); a wrapped `{method, result}` envelope (a shape some\n* peers emit) is never accepted as a response — its key is recorded so the\n* handler can re-issue the corresponding input request.\n*/\nfunction partitionInputResponses(inputResponses) {\n\tconst accepted = {};\n\tconst droppedKeys = [];\n\tif (!isPlainObject(inputResponses)) return {\n\t\taccepted,\n\t\tdroppedKeys\n\t};\n\tfor (const [key, entry] of Object.entries(inputResponses)) {\n\t\tif (!isPlainObject(entry) || \"method\" in entry || \"result\" in entry) {\n\t\t\tdroppedKeys.push(key);\n\t\t\tcontinue;\n\t\t}\n\t\taccepted[key] = entry;\n\t}\n\treturn {\n\t\taccepted,\n\t\tdroppedKeys\n\t};\n}\n/**\n* Builds the manual-mode {@linkcode InputRequiredResult} value from the\n* codec's decoded payload — what an `allowInputRequired: true` caller\n* receives instead of the auto-fulfilled complete result.\n*/\nfunction manualInputRequiredValue(decoded) {\n\treturn {\n\t\tresultType: \"input_required\",\n\t\tinputRequests: decoded.inputRequests,\n\t\t...decoded.requestState !== void 0 && { requestState: decoded.requestState }\n\t};\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js\n/*!\n* content-type\n* Copyright(c) 2015 Douglas Christopher Wilson\n* MIT Licensed\n*/\nvar require_content_type = /* @__PURE__ */ __commonJSMin(((exports) => {\n\t/**\n\t* RegExp to match *( \";\" parameter ) in RFC 7231 sec 3.1.1.1\n\t*\n\t* parameter = token \"=\" ( token / quoted-string )\n\t* token = 1*tchar\n\t* tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" / \"*\"\n\t* / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n\t* / DIGIT / ALPHA\n\t* ; any VCHAR, except delimiters\n\t* quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE\n\t* qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text\n\t* obs-text = %x80-FF\n\t* quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n\t*/\n\tvar PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *(\"(?:[\\u000b\\u0020\\u0021\\u0023-\\u005b\\u005d-\\u007e\\u0080-\\u00ff]|\\\\[\\u000b\\u0020-\\u00ff])*\"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;\n\t/**\n\t* RegExp to match quoted-pair in RFC 7230 sec 3.2.6\n\t*\n\t* quoted-pair = \"\\\" ( HTAB / SP / VCHAR / obs-text )\n\t* obs-text = %x80-FF\n\t*/\n\tvar QESC_REGEXP = /\\\\([\\u000b\\u0020-\\u00ff])/g;\n\t/**\n\t* RegExp to match type in RFC 7231 sec 3.1.1.1\n\t*\n\t* media-type = type \"/\" subtype\n\t* type = token\n\t* subtype = token\n\t*/\n\tvar TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\texports.parse = parse;\n\t/**\n\t* Parse media type to object.\n\t*\n\t* @param {string|object} string\n\t* @return {Object}\n\t* @public\n\t*/\n\tfunction parse(string) {\n\t\tif (!string) throw new TypeError(\"argument string is required\");\n\t\tvar header = typeof string === \"object\" ? getcontenttype(string) : string;\n\t\tif (typeof header !== \"string\") throw new TypeError(\"argument string is required to be a string\");\n\t\tvar index = header.indexOf(\";\");\n\t\tvar type = index !== -1 ? header.slice(0, index).trim() : header.trim();\n\t\tif (!TYPE_REGEXP.test(type)) throw new TypeError(\"invalid media type\");\n\t\tvar obj = new ContentType(type.toLowerCase());\n\t\tif (index !== -1) {\n\t\t\tvar key;\n\t\t\tvar match;\n\t\t\tvar value;\n\t\t\tPARAM_REGEXP.lastIndex = index;\n\t\t\twhile (match = PARAM_REGEXP.exec(header)) {\n\t\t\t\tif (match.index !== index) throw new TypeError(\"invalid parameter format\");\n\t\t\t\tindex += match[0].length;\n\t\t\t\tkey = match[1].toLowerCase();\n\t\t\t\tvalue = match[2];\n\t\t\t\tif (value.charCodeAt(0) === 34) {\n\t\t\t\t\tvalue = value.slice(1, -1);\n\t\t\t\t\tif (value.indexOf(\"\\\\\") !== -1) value = value.replace(QESC_REGEXP, \"$1\");\n\t\t\t\t}\n\t\t\t\tobj.parameters[key] = value;\n\t\t\t}\n\t\t\tif (index !== header.length) throw new TypeError(\"invalid parameter format\");\n\t\t}\n\t\treturn obj;\n\t}\n\t/**\n\t* Get content-type from req/res objects.\n\t*\n\t* @param {object}\n\t* @return {Object}\n\t* @private\n\t*/\n\tfunction getcontenttype(obj) {\n\t\tvar header;\n\t\tif (typeof obj.getHeader === \"function\") header = obj.getHeader(\"content-type\");\n\t\telse if (typeof obj.headers === \"object\") header = obj.headers && obj.headers[\"content-type\"];\n\t\tif (typeof header !== \"string\") throw new TypeError(\"content-type header is missing from object\");\n\t\treturn header;\n\t}\n\t/**\n\t* Class to represent a content type.\n\t* @private\n\t*/\n\tfunction ContentType(type) {\n\t\tthis.parameters = Object.create(null);\n\t\tthis.type = type;\n\t}\n}));\n\n//#endregion\n//#region ../core-internal/src/shared/mediaType.ts\nvar import_content_type = /* @__PURE__ */ __toESM(require_content_type(), 1);\n/**\n* Extracts the media type (the lowercased `type/subtype` pair, without\n* parameters) from a raw `Content-Type` header value, or `undefined` when the\n* header is missing or empty.\n*\n* Content-Type comparisons must use the parsed media type, never a substring\n* search of the raw header: a value like `text/plain; a=application/json`\n* contains the substring `application/json` but its media type is\n* `text/plain`, and case variants or parameters make naive string comparison\n* wrong in both directions.\n*\n* \"Essence\" is the WHATWG MIME Sniffing standard's term for the bare\n* `type/subtype` pair (https://mimesniff.spec.whatwg.org/#mime-type-essence);\n* the Fetch standard's request classification is defined against it\n* (https://fetch.spec.whatwg.org/#cors-safelisted-request-header).\n*\n* Parsing is RFC 9110 (`content-type` package) first. When the parameter\n* section is malformed (`application/json;`, `application/json; charset=`),\n* browsers and most HTTP stacks still derive the media type from the segment\n* before the first `;` — the fallback matches that widely-implemented\n* behavior, so a header whose media type is unambiguous is not rejected for\n* a sloppy parameter section.\n*/\nfunction mediaTypeEssence(header) {\n\tif (!header) return;\n\ttry {\n\t\treturn import_content_type.parse(header).type;\n\t} catch {\n\t\tconst essence = (header.split(\";\", 1)[0] ?? \"\").trim().toLowerCase();\n\t\tif (essence === \"\" || header.slice(essence.length).includes(\",\")) return;\n\t\treturn essence;\n\t}\n}\n/**\n* Whether a raw `Content-Type` header value denotes `application/json`.\n* Parameters (for example `charset=utf-8`) are allowed and ignored; malformed\n* parameter sections do not reject a header whose media type is unambiguously\n* `application/json` (see `mediaTypeEssence` for the exact grammar).\n*/\nfunction isJsonContentType(header) {\n\tif (header === \"application/json\") return true;\n\treturn mediaTypeEssence(header) === \"application/json\";\n}\n\n//#endregion\n//#region ../core-internal/src/shared/metadataUtils.ts\n/**\n* Utilities for working with {@linkcode BaseMetadata} objects.\n*/\n/**\n* Gets the display name for an object with {@linkcode BaseMetadata}.\n* For tools, the precedence is: `title` → {@linkcode index.ToolAnnotations | annotations}.`title` → `name`\n* For other objects: `title` → `name`\n* This implements the spec requirement: \"if no title is provided, name should be used for display purposes\"\n*/\nfunction getDisplayName(metadata) {\n\tif (metadata.title !== void 0 && metadata.title !== \"\") return metadata.title;\n\tif (\"annotations\" in metadata && metadata.annotations?.title) return metadata.annotations.title;\n\treturn metadata.name;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/stdio.ts\nconst STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;\n/**\n* Buffers a continuous stdio stream into discrete JSON-RPC messages.\n*/\nvar ReadBuffer = class {\n\t_buffer;\n\t_maxBufferSize;\n\tconstructor(options) {\n\t\tthis._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;\n\t}\n\tappend(chunk) {\n\t\tif ((this._buffer?.length ?? 0) + chunk.length > this._maxBufferSize) {\n\t\t\tthis.clear();\n\t\t\tthrow new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);\n\t\t}\n\t\tthis._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;\n\t}\n\treadMessage() {\n\t\twhile (this._buffer) {\n\t\t\tconst index = this._buffer.indexOf(\"\\n\");\n\t\t\tif (index === -1) return null;\n\t\t\tconst line = this._buffer.toString(\"utf8\", 0, index).replace(/\\r$/, \"\");\n\t\t\tthis._buffer = this._buffer.subarray(index + 1);\n\t\t\ttry {\n\t\t\t\treturn deserializeMessage(line);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof SyntaxError) continue;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\tclear() {\n\t\tthis._buffer = void 0;\n\t}\n};\nfunction deserializeMessage(line) {\n\treturn JSONRPCMessageSchema.parse(JSON.parse(line));\n}\nfunction serializeMessage(message) {\n\treturn JSON.stringify(message) + \"\\n\";\n}\n\n//#endregion\n//#region ../core-internal/src/shared/toolNameValidation.ts\n/**\n* Tool name validation utilities according to SEP: Specify Format for Tool Names\n*\n* Tool names SHOULD be between 1 and 128 characters in length (inclusive).\n* Tool names are case-sensitive.\n* Allowed characters: uppercase and lowercase ASCII letters (`A-Z`, `a-z`), digits\n* (`0-9`), underscore (`_`), dash (`-`), and dot (`.`).\n* Tool names SHOULD NOT contain spaces, commas, or other special characters.\n*\n* @see {@link https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986 | SEP-986: Specify Format for Tool Names}\n*/\n/**\n* Regular expression for valid tool names according to SEP-986 specification\n*/\nconst TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;\n/**\n* Validates a tool name according to the SEP specification\n* @param name - The tool name to validate\n* @returns An object containing validation result and any warnings\n*/\nfunction validateToolName(name) {\n\tconst warnings = [];\n\tif (name.length === 0) return {\n\t\tisValid: false,\n\t\twarnings: [\"Tool name cannot be empty\"]\n\t};\n\tif (name.length > 128) return {\n\t\tisValid: false,\n\t\twarnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]\n\t};\n\tif (name.includes(\" \")) warnings.push(\"Tool name contains spaces, which may cause parsing issues\");\n\tif (name.includes(\",\")) warnings.push(\"Tool name contains commas, which may cause parsing issues\");\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) warnings.push(\"Tool name starts or ends with a dash, which may cause parsing issues in some contexts\");\n\tif (name.startsWith(\".\") || name.endsWith(\".\")) warnings.push(\"Tool name starts or ends with a dot, which may cause parsing issues in some contexts\");\n\tif (!TOOL_NAME_REGEX.test(name)) {\n\t\tconst invalidChars = [...name].filter((char) => !/[A-Za-z0-9._-]/.test(char)).filter((char, index, arr) => arr.indexOf(char) === index);\n\t\twarnings.push(`Tool name contains invalid characters: ${invalidChars.map((c) => `\"${c}\"`).join(\", \")}`, \"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)\");\n\t\treturn {\n\t\t\tisValid: false,\n\t\t\twarnings\n\t\t};\n\t}\n\treturn {\n\t\tisValid: true,\n\t\twarnings\n\t};\n}\n/**\n* Issues warnings for non-conforming tool names\n* @param name - The tool name that triggered the warnings\n* @param warnings - Array of warning messages\n*/\nfunction issueToolNameWarning(name, warnings) {\n\tif (warnings.length > 0) {\n\t\tconsole.warn(`Tool name validation warning for \"${name}\":`);\n\t\tfor (const warning of warnings) console.warn(` - ${warning}`);\n\t\tconsole.warn(\"Tool registration will proceed, but this may cause compatibility issues.\");\n\t\tconsole.warn(\"Consider updating the tool name to conform to the MCP tool naming standard.\");\n\t\tconsole.warn(\"See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.\");\n\t}\n}\n/**\n* Validates a tool name and issues warnings for non-conforming names\n* @param name - The tool name to validate\n* @returns `true` if the name is valid, `false` otherwise\n*/\nfunction validateAndWarnToolName(name) {\n\tconst result = validateToolName(name);\n\tissueToolNameWarning(name, result.warnings);\n\treturn result.isValid;\n}\n\n//#endregion\n//#region ../core-internal/src/shared/transport.ts\n/**\n* Normalizes `HeadersInit` to a plain `Record<string, string>` for manipulation.\n* Handles `Headers` objects, arrays of tuples, and plain objects.\n*/\nfunction normalizeHeaders(headers) {\n\tif (!headers) return {};\n\tif (headers instanceof Headers) return Object.fromEntries(headers.entries());\n\tif (Array.isArray(headers)) return Object.fromEntries(headers);\n\treturn { ...headers };\n}\n/**\n* Creates a fetch function that includes base `RequestInit` options.\n* This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.\n*\n* @param baseFetch - The base fetch function to wrap (defaults to global `fetch`)\n* @param baseInit - The base `RequestInit` to merge with each request\n* @returns A wrapped fetch function that merges base options with call-specific options\n*/\nfunction createFetchWithInit(baseFetch = fetch, baseInit) {\n\tif (!baseInit) return baseFetch;\n\treturn async (url, init) => {\n\t\treturn baseFetch(url, {\n\t\t\t...baseInit,\n\t\t\t...init,\n\t\t\theaders: init?.headers ? {\n\t\t\t\t...normalizeHeaders(baseInit.headers),\n\t\t\t\t...normalizeHeaders(init.headers)\n\t\t\t} : baseInit.headers\n\t\t});\n\t};\n}\n\n//#endregion\n//#region ../core-internal/src/shared/uriTemplate.ts\nconst MAX_TEMPLATE_LENGTH = 1e6;\nconst MAX_VARIABLE_LENGTH = 1e6;\nconst MAX_TEMPLATE_EXPRESSIONS = 1e4;\nconst MAX_REGEX_LENGTH = 1e6;\nvar UriTemplate = class UriTemplate {\n\t/**\n\t* Returns true if the given string contains any URI template expressions.\n\t* A template expression is a sequence of characters enclosed in curly braces,\n\t* like `{foo}` or `{?bar}`.\n\t*/\n\tstatic isTemplate(str) {\n\t\treturn /\\{[^}\\s]+\\}/.test(str);\n\t}\n\tstatic validateLength(str, max, context) {\n\t\tif (str.length > max) throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`);\n\t}\n\ttemplate;\n\tparts;\n\tget variableNames() {\n\t\treturn this.parts.flatMap((part) => typeof part === \"string\" ? [] : part.names);\n\t}\n\tconstructor(template) {\n\t\tUriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, \"Template\");\n\t\tthis.template = template;\n\t\tthis.parts = this.parse(template);\n\t}\n\ttoString() {\n\t\treturn this.template;\n\t}\n\tparse(template) {\n\t\tconst parts = [];\n\t\tlet currentText = \"\";\n\t\tlet i = 0;\n\t\tlet expressionCount = 0;\n\t\twhile (i < template.length) if (template[i] === \"{\") {\n\t\t\tif (currentText) {\n\t\t\t\tparts.push(currentText);\n\t\t\t\tcurrentText = \"\";\n\t\t\t}\n\t\t\tconst end = template.indexOf(\"}\", i);\n\t\t\tif (end === -1) throw new Error(\"Unclosed template expression\");\n\t\t\texpressionCount++;\n\t\t\tif (expressionCount > MAX_TEMPLATE_EXPRESSIONS) throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`);\n\t\t\tconst expr = template.slice(i + 1, end);\n\t\t\tconst operator = this.getOperator(expr);\n\t\t\tconst exploded = expr.includes(\"*\");\n\t\t\tconst names = this.getNames(expr);\n\t\t\tconst name = names[0];\n\t\t\tfor (const name$1 of names) UriTemplate.validateLength(name$1, MAX_VARIABLE_LENGTH, \"Variable name\");\n\t\t\tparts.push({\n\t\t\t\tname,\n\t\t\t\toperator,\n\t\t\t\tnames,\n\t\t\t\texploded\n\t\t\t});\n\t\t\ti = end + 1;\n\t\t} else {\n\t\t\tcurrentText += template[i];\n\t\t\ti++;\n\t\t}\n\t\tif (currentText) parts.push(currentText);\n\t\treturn parts;\n\t}\n\tgetOperator(expr) {\n\t\treturn [\n\t\t\t\"+\",\n\t\t\t\"#\",\n\t\t\t\".\",\n\t\t\t\"/\",\n\t\t\t\"?\",\n\t\t\t\"&\"\n\t\t].find((op) => expr.startsWith(op)) || \"\";\n\t}\n\tgetNames(expr) {\n\t\tconst operator = this.getOperator(expr);\n\t\treturn expr.slice(operator.length).split(\",\").map((name) => name.replace(\"*\", \"\").trim()).filter((name) => name.length > 0);\n\t}\n\tencodeValue(value, operator) {\n\t\tUriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, \"Variable value\");\n\t\tif (operator === \"+\" || operator === \"#\") return encodeURI(value);\n\t\treturn encodeURIComponent(value);\n\t}\n\texpandPart(part, variables) {\n\t\tif (part.operator === \"?\" || part.operator === \"&\") {\n\t\t\tconst pairs = part.names.map((name) => {\n\t\t\t\tconst value$1 = variables[name];\n\t\t\t\tif (value$1 === void 0) return \"\";\n\t\t\t\treturn `${name}=${Array.isArray(value$1) ? value$1.map((v) => this.encodeValue(v, part.operator)).join(\",\") : this.encodeValue(value$1.toString(), part.operator)}`;\n\t\t\t}).filter((pair) => pair.length > 0);\n\t\t\tif (pairs.length === 0) return \"\";\n\t\t\treturn (part.operator === \"?\" ? \"?\" : \"&\") + pairs.join(\"&\");\n\t\t}\n\t\tif (part.names.length > 1) {\n\t\t\tconst values = part.names.map((name) => variables[name]).filter((v) => v !== void 0);\n\t\t\tif (values.length === 0) return \"\";\n\t\t\treturn values.map((v) => Array.isArray(v) ? v[0] : v).join(\",\");\n\t\t}\n\t\tconst value = variables[part.name];\n\t\tif (value === void 0) return \"\";\n\t\tconst encoded = (Array.isArray(value) ? value : [value]).map((v) => this.encodeValue(v, part.operator));\n\t\tswitch (part.operator) {\n\t\t\tcase \"\": return encoded.join(\",\");\n\t\t\tcase \"+\": return encoded.join(\",\");\n\t\t\tcase \"#\": return \"#\" + encoded.join(\",\");\n\t\t\tcase \".\": return \".\" + encoded.join(\".\");\n\t\t\tcase \"/\": return \"/\" + encoded.join(\"/\");\n\t\t\tdefault: return encoded.join(\",\");\n\t\t}\n\t}\n\texpand(variables) {\n\t\tlet result = \"\";\n\t\tlet hasQueryParam = false;\n\t\tfor (const part of this.parts) {\n\t\t\tif (typeof part === \"string\") {\n\t\t\t\tresult += part;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst expanded = this.expandPart(part, variables);\n\t\t\tif (!expanded) continue;\n\t\t\tresult += (part.operator === \"?\" || part.operator === \"&\") && hasQueryParam ? expanded.replace(\"?\", \"&\") : expanded;\n\t\t\tif (part.operator === \"?\" || part.operator === \"&\") hasQueryParam = true;\n\t\t}\n\t\treturn result;\n\t}\n\tescapeRegExp(str) {\n\t\treturn str.replaceAll(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n\t}\n\tpartToRegExp(part) {\n\t\tconst patterns = [];\n\t\tfor (const name$1 of part.names) UriTemplate.validateLength(name$1, MAX_VARIABLE_LENGTH, \"Variable name\");\n\t\tif (part.operator === \"?\" || part.operator === \"&\") {\n\t\t\tfor (let i = 0; i < part.names.length; i++) {\n\t\t\t\tconst name$1 = part.names[i];\n\t\t\t\tconst prefix = i === 0 ? \"\\\\\" + part.operator : \"&\";\n\t\t\t\tpatterns.push({\n\t\t\t\t\tpattern: prefix + this.escapeRegExp(name$1) + \"=([^&]+)\",\n\t\t\t\t\tname: name$1\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn patterns;\n\t\t}\n\t\tlet pattern;\n\t\tconst name = part.name;\n\t\tswitch (part.operator) {\n\t\t\tcase \"\":\n\t\t\t\tpattern = part.exploded ? \"([^/,]+(?:,[^/,]+)*)\" : \"([^/,]+)\";\n\t\t\t\tbreak;\n\t\t\tcase \"+\":\n\t\t\tcase \"#\":\n\t\t\t\tpattern = \"(.+)\";\n\t\t\t\tbreak;\n\t\t\tcase \".\":\n\t\t\t\tpattern = String.raw`\\.([^/,]+)`;\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tpattern = \"/\" + (part.exploded ? \"([^/,]+(?:,[^/,]+)*)\" : \"([^/,]+)\");\n\t\t\t\tbreak;\n\t\t\tdefault: pattern = \"([^/]+)\";\n\t\t}\n\t\tpatterns.push({\n\t\t\tpattern,\n\t\t\tname\n\t\t});\n\t\treturn patterns;\n\t}\n\tmatch(uri) {\n\t\tUriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, \"URI\");\n\t\tlet pattern = \"^\";\n\t\tconst names = [];\n\t\tfor (const part of this.parts) if (typeof part === \"string\") pattern += this.escapeRegExp(part);\n\t\telse {\n\t\t\tconst patterns = this.partToRegExp(part);\n\t\t\tfor (const { pattern: partPattern, name } of patterns) {\n\t\t\t\tpattern += partPattern;\n\t\t\t\tnames.push({\n\t\t\t\t\tname,\n\t\t\t\t\texploded: part.exploded\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tpattern += \"$\";\n\t\tUriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, \"Generated regex pattern\");\n\t\tconst regex = new RegExp(pattern);\n\t\tconst match = uri.match(regex);\n\t\tif (!match) return null;\n\t\tconst result = {};\n\t\tfor (const [i, name_] of names.entries()) {\n\t\t\tconst { name, exploded } = name_;\n\t\t\tconst value = match[i + 1];\n\t\t\tconst cleanName = name.replace(\"*\", \"\");\n\t\t\tresult[cleanName] = exploded && value.includes(\",\") ? value.split(\",\") : value;\n\t\t}\n\t\treturn result;\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/util/inMemory.ts\n/**\n* In-memory transport for creating clients and servers that talk to each other within the same process.\n*\n* Intended for testing and development. For production in-process connections, use\n* `StreamableHTTPClientTransport` against a local server URL.\n*/\nvar InMemoryTransport = class InMemoryTransport {\n\t_otherTransport;\n\t_messageQueue = [];\n\t_closed = false;\n\tonclose;\n\tonerror;\n\tonmessage;\n\tsessionId;\n\t/**\n\t* Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a {@linkcode @modelcontextprotocol/client!client/client.Client | Client} and one to a {@linkcode @modelcontextprotocol/server!server/server.Server | Server}.\n\t*/\n\tstatic createLinkedPair() {\n\t\tconst clientTransport = new InMemoryTransport();\n\t\tconst serverTransport = new InMemoryTransport();\n\t\tclientTransport._otherTransport = serverTransport;\n\t\tserverTransport._otherTransport = clientTransport;\n\t\treturn [clientTransport, serverTransport];\n\t}\n\tasync start() {\n\t\twhile (this._messageQueue.length > 0) {\n\t\t\tconst queuedMessage = this._messageQueue.shift();\n\t\t\tthis.onmessage?.(queuedMessage.message, queuedMessage.extra);\n\t\t}\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tconst other = this._otherTransport;\n\t\tthis._otherTransport = void 0;\n\t\ttry {\n\t\t\tawait other?.close();\n\t\t} finally {\n\t\t\tthis.onclose?.();\n\t\t}\n\t}\n\t/**\n\t* Sends a message with optional auth info.\n\t* This is useful for testing authentication scenarios.\n\t*/\n\tasync send(message, options) {\n\t\tif (!this._otherTransport) throw new SdkError(SdkErrorCode.NotConnected, \"Not connected\");\n\t\tif (this._otherTransport.onmessage) this._otherTransport.onmessage(message, { authInfo: options?.authInfo });\n\t\telse this._otherTransport._messageQueue.push({\n\t\t\tmessage,\n\t\t\textra: { authInfo: options?.authInfo }\n\t\t});\n\t}\n};\n\n//#endregion\n//#region ../core-internal/src/util/zodCompat.ts\n/**\n* Zod-specific helpers for the v1-compat raw-shape shorthand on\n* `registerTool`/`registerPrompt`. Kept separate from `standardSchema.ts` so\n* that file stays library-agnostic per the Standard Schema spec.\n*/\nfunction isZodV4Schema(v) {\n\treturn typeof v === \"object\" && v !== null && \"_zod\" in v;\n}\nfunction looksLikeZodV3(v) {\n\treturn typeof v === \"object\" && v !== null && !(\"_zod\" in v) && \"_def\" in v && typeof v._def?.typeName === \"string\";\n}\n/**\n* Detects a \"raw shape\" — a plain object whose values are Zod field schemas,\n* e.g. `{ name: z.string() }`. Powers the auto-wrap in\n* {@linkcode normalizeRawShapeSchema}, which wraps with `z.object()`, so only\n* Zod values are supported.\n*\n* @internal\n*/\nfunction isZodRawShape(obj) {\n\tif (typeof obj !== \"object\" || obj === null) return false;\n\tif (isStandardSchema(obj)) return false;\n\tconst proto = Object.getPrototypeOf(obj);\n\tif (proto !== Object.prototype && proto !== null) return false;\n\treturn Object.values(obj).every((v) => isZodV4Schema(v));\n}\n/**\n* Accepts either a {@linkcode StandardSchemaWithJSON} or a raw Zod shape\n* `{ field: z.string() }` and returns a {@linkcode StandardSchemaWithJSON}.\n* Raw shapes are wrapped with `z.object()` so the rest of the pipeline sees a\n* uniform schema type; already-wrapped schemas pass through unchanged.\n*\n* @internal\n*/\nfunction normalizeRawShapeSchema(schema) {\n\tif (schema === void 0) return void 0;\n\tif (isZodRawShape(schema)) return z.object(schema);\n\tif (typeof schema === \"object\" && schema !== null && !isStandardSchema(schema) && Object.values(schema).some((v) => looksLikeZodV3(v))) throw new TypeError(\"Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.\");\n\tif (!isStandardSchema(schema)) throw new TypeError(\"inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).\");\n\treturn schema;\n}\n\n//#endregion\n//#region ../core-internal/src/wire/preload.ts\n/**\n* Explicit warm-up entry for the lazy wire-schema layers.\n*\n* The per-revision wire schemas are built lazily: each era's schema set sits\n* behind a memoized factory (`buildSchemas2025`/`buildSchemas2026`), and the\n* registry/codec lookup maps above those factories are memoized the same way.\n* That laziness is the right default on process-per-invocation runtimes (CLI\n* tools, dev servers), where module evaluation IS startup latency and most\n* short-lived processes never validate a message on both eras.\n*\n* On platforms that bill request CPU but not module evaluation — isolate-based\n* edge/serverless runtimes such as Cloudflare Workers — the trade inverts:\n* module-scope work runs during isolate warm-up outside any request, while\n* lazy construction lands inside the first request's billed (and latency\n* budgeted) CPU. `preloadSchemas()` lets deployments on such platforms move\n* the one-time construction cost back to module scope by calling it at module\n* scope themselves. The packages' own workerd shims already do this, so\n* Workers deployments get eager construction automatically.\n*/\n/**\n* Eagerly builds every lazily-constructed wire-schema layer, so that no later\n* validation pays schema-construction cost.\n*\n* Synchronous and idempotent: every layer is a memo, so the first call does\n* all the work and subsequent calls return immediately. Reference identity is\n* unaffected — this forces the same memos every lazy consumer pulls through.\n*\n* Call it at module scope on platforms that bill per-request CPU but not\n* module evaluation (isolate-based edge/serverless runtimes), where deferring\n* construction would move it into the first request of every fresh isolate:\n*\n* ```ts\n* // from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —\n* // each package bundles its own schema copy, so warm the one(s) you import.\n* preloadSchemas(); // module scope — runs during isolate warm-up\n* ```\n*\n* On Node CLIs and other process-per-invocation runtimes, prefer the lazy\n* default — there, module-scope construction is pure added boot latency.\n*/\nfunction preloadSchemas() {\n\tbuildSchemas2025();\n\tbuildSchemas2026();\n\twarmRegistryMaps2025();\n\twarmInputSchemaMaps2026();\n\twarmWireResultSchemas2026();\n}\n\n//#endregion\n//#region ../core-internal/src/validators/fromJsonSchema.ts\n/**\n* Wrap a raw JSON Schema object as a {@linkcode StandardSchemaWithJSON} so it can be\n* passed to `registerTool` / `registerPrompt`. Use this when you already have JSON\n* Schema (e.g. from TypeBox, or hand-written) and want to register it without going\n* through a Standard Schema library.\n*\n* The callback arguments will be typed `unknown` (raw JSON Schema has no TypeScript\n* types attached). Cast at the call site, or use the generic `fromJsonSchema<MyType>(...)`.\n*\n* @param schema - A JSON Schema object describing the expected shape\n* @param validator - A validator provider. When importing `fromJsonSchema` from\n* `@modelcontextprotocol/server` or `@modelcontextprotocol/client`, a runtime-appropriate\n* default is provided automatically (AJV on Node.js, CfWorker on edge runtimes).\n*\n* @example\n* ```ts source=\"./fromJsonSchema.examples.ts#fromJsonSchema_basicUsage\"\n* const inputSchema = fromJsonSchema<{ name: string }>(\n* { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] },\n* validator\n* );\n* // Use with server.registerTool('greet', { inputSchema }, handler)\n* ```\n*/\nfunction fromJsonSchema(schema, validator) {\n\tconst check = validator.getValidator(schema);\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"mcp\",\n\t\tjsonSchema: {\n\t\t\tinput: () => schema,\n\t\t\toutput: () => schema\n\t\t},\n\t\tvalidate: (data) => {\n\t\t\tconst result = check(data);\n\t\t\treturn result.valid ? { value: result.data } : { issues: [{ message: result.errorMessage }] };\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { isTaskAugmentedRequestParams as $, promptArgumentsFromStandardSchema as A, LATEST_PROTOCOL_VERSION as At, scanXMcpHeaderDeclarations as B, TRACESTATE_META_KEY as Bt, REQUEST_STATE_ONLY_LEG_PACING_MS as C, CLIENT_CAPABILITIES_META_KEY as Ct, acceptedContent as D, INVALID_PARAMS as Dt, sleep as E, INTERNAL_ERROR as Et, carriesValidModernEnvelopeClaim as F, RELATED_TASK_META_KEY as Ft, isInitializeRequest as G, resourceUrlFromServerUrl as Gt, assertCompleteRequestPrompt as H, requiredClientCapabilitiesForInputRequest as Ht, classifyInboundRequest as I, SERVER_INFO_META_KEY as It, isJSONRPCErrorResponse as J, SdkHttpError as Jt, isInitializedNotification as K, SdkError as Kt, httpStatusForErrorCode as L, SUBSCRIPTION_ID_META_KEY as Lt, validateStandardSchema as M, METHOD_NOT_FOUND as Mt, parseSchema as N, PARSE_ERROR as Nt, inputRequired as O, INVALID_REQUEST as Ot, LADDER_ERROR_HTTP_STATUS as P, PROTOCOL_VERSION_META_KEY as Pt, isJSONRPCResultResponse as Q, modernOnlyStrictRejection as R, SUPPORTED_PROTOCOL_VERSIONS as Rt, specTypeSchemas as S, BAGGAGE_META_KEY as St, linkedRoundAbort as T, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as Tt, assertCompleteRequestResourceTemplate as U, requiredClientCapabilitiesForRequest as Ut, validateMcpParamHeaders as V, missingClientCapabilities as Vt, isCallToolResult as W, checkResourceAllowed as Wt, isJSONRPCRequest as X, OAuthErrorCode as Xt, isJSONRPCNotification as Y, OAuthError as Yt, isJSONRPCResponse as Z, mergeCapabilities as _, normalizeContentlessToolResult as _t, UriTemplate as a, requestMetaOf as at, withRequestStateValue as b, legacyProtocolVersions as bt, ReadBuffer as c, codecForVersion as ct, serializeMessage as d, ResourceNotFoundError as dt, parseJSONRPCMessage as et, getDisplayName as f, UnsupportedProtocolVersionError as ft, Protocol as g, attachCacheHintFallback as gt, DEFAULT_REQUEST_TIMEOUT_MSEC as h, assertValidCacheHint as ht, InMemoryTransport as i, hasEnvelopeClaim as it, standardSchemaToJsonSchema as j, LOG_LEVEL_META_KEY as jt, inputResponse as k, JSONRPC_VERSION as kt, STDIO_DEFAULT_MAX_BUFFER_SIZE as l, MissingRequiredClientCapabilityError as lt, mediaTypeEssence as m, ProtocolErrorCode as mt, preloadSchemas as n, LoggingLevelSchema as nt, createFetchWithInit as o, validateEnvelopeMeta as ot, isJsonContentType as p, UrlElicitationRequiredError as pt, isInputRequiredResult as q, SdkErrorCode as qt, normalizeRawShapeSchema as r, envelopeClaimVersion as rt, validateAndWarnToolName as s, MODERN_WIRE_REVISION as st, fromJsonSchema as t, JSONRPCMessageSchema as tt, deserializeMessage as u, ProtocolError as ut, requestStateAccessor as v, SUPPORTED_MODERN_PROTOCOL_VERSIONS as vt, inputRequiredRoundsExceededMessage as w, CLIENT_INFO_META_KEY as wt, isSpecType as x, modernProtocolVersions as xt, setNegotiatedProtocolVersion as y, isModernProtocolVersion as yt, validateStandardRequestHeaders as z, TRACEPARENT_META_KEY as zt };\n//# sourceMappingURL=src-CX2iR2pK.mjs.map","import { r as __toESM, t as __commonJSMin } from \"./chunk-Br0eD_fh.mjs\";\nimport { t as declaredDialect } from \"./dialects-DoSzNhcb.mjs\";\n\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js\nvar require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;\n\tvar _CodeOrName = class {};\n\texports._CodeOrName = _CodeOrName;\n\texports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;\n\tvar Name = class extends _CodeOrName {\n\t\tconstructor(s) {\n\t\t\tsuper();\n\t\t\tif (!exports.IDENTIFIER.test(s)) throw new Error(\"CodeGen: name must be a valid identifier\");\n\t\t\tthis.str = s;\n\t\t}\n\t\ttoString() {\n\t\t\treturn this.str;\n\t\t}\n\t\temptyStr() {\n\t\t\treturn false;\n\t\t}\n\t\tget names() {\n\t\t\treturn { [this.str]: 1 };\n\t\t}\n\t};\n\texports.Name = Name;\n\tvar _Code = class extends _CodeOrName {\n\t\tconstructor(code) {\n\t\t\tsuper();\n\t\t\tthis._items = typeof code === \"string\" ? [code] : code;\n\t\t}\n\t\ttoString() {\n\t\t\treturn this.str;\n\t\t}\n\t\temptyStr() {\n\t\t\tif (this._items.length > 1) return false;\n\t\t\tconst item = this._items[0];\n\t\t\treturn item === \"\" || item === \"\\\"\\\"\";\n\t\t}\n\t\tget str() {\n\t\t\tvar _a;\n\t\t\treturn (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, \"\");\n\t\t}\n\t\tget names() {\n\t\t\tvar _a;\n\t\t\treturn (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => {\n\t\t\t\tif (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1;\n\t\t\t\treturn names;\n\t\t\t}, {});\n\t\t}\n\t};\n\texports._Code = _Code;\n\texports.nil = new _Code(\"\");\n\tfunction _(strs, ...args) {\n\t\tconst code = [strs[0]];\n\t\tlet i = 0;\n\t\twhile (i < args.length) {\n\t\t\taddCodeArg(code, args[i]);\n\t\t\tcode.push(strs[++i]);\n\t\t}\n\t\treturn new _Code(code);\n\t}\n\texports._ = _;\n\tconst plus = new _Code(\"+\");\n\tfunction str(strs, ...args) {\n\t\tconst expr = [safeStringify(strs[0])];\n\t\tlet i = 0;\n\t\twhile (i < args.length) {\n\t\t\texpr.push(plus);\n\t\t\taddCodeArg(expr, args[i]);\n\t\t\texpr.push(plus, safeStringify(strs[++i]));\n\t\t}\n\t\toptimize(expr);\n\t\treturn new _Code(expr);\n\t}\n\texports.str = str;\n\tfunction addCodeArg(code, arg) {\n\t\tif (arg instanceof _Code) code.push(...arg._items);\n\t\telse if (arg instanceof Name) code.push(arg);\n\t\telse code.push(interpolate(arg));\n\t}\n\texports.addCodeArg = addCodeArg;\n\tfunction optimize(expr) {\n\t\tlet i = 1;\n\t\twhile (i < expr.length - 1) {\n\t\t\tif (expr[i] === plus) {\n\t\t\t\tconst res = mergeExprItems(expr[i - 1], expr[i + 1]);\n\t\t\t\tif (res !== void 0) {\n\t\t\t\t\texpr.splice(i - 1, 3, res);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\texpr[i++] = \"+\";\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}\n\tfunction mergeExprItems(a, b) {\n\t\tif (b === \"\\\"\\\"\") return a;\n\t\tif (a === \"\\\"\\\"\") return b;\n\t\tif (typeof a == \"string\") {\n\t\t\tif (b instanceof Name || a[a.length - 1] !== \"\\\"\") return;\n\t\t\tif (typeof b != \"string\") return `${a.slice(0, -1)}${b}\"`;\n\t\t\tif (b[0] === \"\\\"\") return a.slice(0, -1) + b.slice(1);\n\t\t\treturn;\n\t\t}\n\t\tif (typeof b == \"string\" && b[0] === \"\\\"\" && !(a instanceof Name)) return `\"${a}${b.slice(1)}`;\n\t}\n\tfunction strConcat(c1, c2) {\n\t\treturn c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;\n\t}\n\texports.strConcat = strConcat;\n\tfunction interpolate(x) {\n\t\treturn typeof x == \"number\" || typeof x == \"boolean\" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(\",\") : x);\n\t}\n\tfunction stringify(x) {\n\t\treturn new _Code(safeStringify(x));\n\t}\n\texports.stringify = stringify;\n\tfunction safeStringify(x) {\n\t\treturn JSON.stringify(x).replace(/\\u2028/g, \"\\\\u2028\").replace(/\\u2029/g, \"\\\\u2029\");\n\t}\n\texports.safeStringify = safeStringify;\n\tfunction getProperty(key) {\n\t\treturn typeof key == \"string\" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;\n\t}\n\texports.getProperty = getProperty;\n\tfunction getEsmExportName(key) {\n\t\tif (typeof key == \"string\" && exports.IDENTIFIER.test(key)) return new _Code(`${key}`);\n\t\tthrow new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);\n\t}\n\texports.getEsmExportName = getEsmExportName;\n\tfunction regexpCode(rx) {\n\t\treturn new _Code(rx.toString());\n\t}\n\texports.regexpCode = regexpCode;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js\nvar require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;\n\tconst code_1 = require_code$1();\n\tvar ValueError = class extends Error {\n\t\tconstructor(name) {\n\t\t\tsuper(`CodeGen: \"code\" for ${name} not defined`);\n\t\t\tthis.value = name.value;\n\t\t}\n\t};\n\tvar UsedValueState;\n\t(function(UsedValueState) {\n\t\tUsedValueState[UsedValueState[\"Started\"] = 0] = \"Started\";\n\t\tUsedValueState[UsedValueState[\"Completed\"] = 1] = \"Completed\";\n\t})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));\n\texports.varKinds = {\n\t\tconst: new code_1.Name(\"const\"),\n\t\tlet: new code_1.Name(\"let\"),\n\t\tvar: new code_1.Name(\"var\")\n\t};\n\tvar Scope = class {\n\t\tconstructor({ prefixes, parent } = {}) {\n\t\t\tthis._names = {};\n\t\t\tthis._prefixes = prefixes;\n\t\t\tthis._parent = parent;\n\t\t}\n\t\ttoName(nameOrPrefix) {\n\t\t\treturn nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);\n\t\t}\n\t\tname(prefix) {\n\t\t\treturn new code_1.Name(this._newName(prefix));\n\t\t}\n\t\t_newName(prefix) {\n\t\t\tconst ng = this._names[prefix] || this._nameGroup(prefix);\n\t\t\treturn `${prefix}${ng.index++}`;\n\t\t}\n\t\t_nameGroup(prefix) {\n\t\t\tvar _a, _b;\n\t\t\tif (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) throw new Error(`CodeGen: prefix \"${prefix}\" is not allowed in this scope`);\n\t\t\treturn this._names[prefix] = {\n\t\t\t\tprefix,\n\t\t\t\tindex: 0\n\t\t\t};\n\t\t}\n\t};\n\texports.Scope = Scope;\n\tvar ValueScopeName = class extends code_1.Name {\n\t\tconstructor(prefix, nameStr) {\n\t\t\tsuper(nameStr);\n\t\t\tthis.prefix = prefix;\n\t\t}\n\t\tsetValue(value, { property, itemIndex }) {\n\t\t\tthis.value = value;\n\t\t\tthis.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;\n\t\t}\n\t};\n\texports.ValueScopeName = ValueScopeName;\n\tconst line = (0, code_1._)`\\n`;\n\tvar ValueScope = class extends Scope {\n\t\tconstructor(opts) {\n\t\t\tsuper(opts);\n\t\t\tthis._values = {};\n\t\t\tthis._scope = opts.scope;\n\t\t\tthis.opts = {\n\t\t\t\t...opts,\n\t\t\t\t_n: opts.lines ? line : code_1.nil\n\t\t\t};\n\t\t}\n\t\tget() {\n\t\t\treturn this._scope;\n\t\t}\n\t\tname(prefix) {\n\t\t\treturn new ValueScopeName(prefix, this._newName(prefix));\n\t\t}\n\t\tvalue(nameOrPrefix, value) {\n\t\t\tvar _a;\n\t\t\tif (value.ref === void 0) throw new Error(\"CodeGen: ref must be passed in value\");\n\t\t\tconst name = this.toName(nameOrPrefix);\n\t\t\tconst { prefix } = name;\n\t\t\tconst valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;\n\t\t\tlet vs = this._values[prefix];\n\t\t\tif (vs) {\n\t\t\t\tconst _name = vs.get(valueKey);\n\t\t\t\tif (_name) return _name;\n\t\t\t} else vs = this._values[prefix] = /* @__PURE__ */ new Map();\n\t\t\tvs.set(valueKey, name);\n\t\t\tconst s = this._scope[prefix] || (this._scope[prefix] = []);\n\t\t\tconst itemIndex = s.length;\n\t\t\ts[itemIndex] = value.ref;\n\t\t\tname.setValue(value, {\n\t\t\t\tproperty: prefix,\n\t\t\t\titemIndex\n\t\t\t});\n\t\t\treturn name;\n\t\t}\n\t\tgetValue(prefix, keyOrRef) {\n\t\t\tconst vs = this._values[prefix];\n\t\t\tif (!vs) return;\n\t\t\treturn vs.get(keyOrRef);\n\t\t}\n\t\tscopeRefs(scopeName, values = this._values) {\n\t\t\treturn this._reduceValues(values, (name) => {\n\t\t\t\tif (name.scopePath === void 0) throw new Error(`CodeGen: name \"${name}\" has no value`);\n\t\t\t\treturn (0, code_1._)`${scopeName}${name.scopePath}`;\n\t\t\t});\n\t\t}\n\t\tscopeCode(values = this._values, usedValues, getCode) {\n\t\t\treturn this._reduceValues(values, (name) => {\n\t\t\t\tif (name.value === void 0) throw new Error(`CodeGen: name \"${name}\" has no value`);\n\t\t\t\treturn name.value.code;\n\t\t\t}, usedValues, getCode);\n\t\t}\n\t\t_reduceValues(values, valueCode, usedValues = {}, getCode) {\n\t\t\tlet code = code_1.nil;\n\t\t\tfor (const prefix in values) {\n\t\t\t\tconst vs = values[prefix];\n\t\t\t\tif (!vs) continue;\n\t\t\t\tconst nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map();\n\t\t\t\tvs.forEach((name) => {\n\t\t\t\t\tif (nameSet.has(name)) return;\n\t\t\t\t\tnameSet.set(name, UsedValueState.Started);\n\t\t\t\t\tlet c = valueCode(name);\n\t\t\t\t\tif (c) {\n\t\t\t\t\t\tconst def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;\n\t\t\t\t\t\tcode = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;\n\t\t\t\t\t} else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) code = (0, code_1._)`${code}${c}${this.opts._n}`;\n\t\t\t\t\telse throw new ValueError(name);\n\t\t\t\t\tnameSet.set(name, UsedValueState.Completed);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn code;\n\t\t}\n\t};\n\texports.ValueScope = ValueScope;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js\nvar require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;\n\tconst code_1 = require_code$1();\n\tconst scope_1 = require_scope();\n\tvar code_2 = require_code$1();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"strConcat\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.strConcat;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"getProperty\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.getProperty;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"regexpCode\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.regexpCode;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn code_2.Name;\n\t\t}\n\t});\n\tvar scope_2 = require_scope();\n\tObject.defineProperty(exports, \"Scope\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.Scope;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"ValueScope\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.ValueScope;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"ValueScopeName\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.ValueScopeName;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"varKinds\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn scope_2.varKinds;\n\t\t}\n\t});\n\texports.operators = {\n\t\tGT: new code_1._Code(\">\"),\n\t\tGTE: new code_1._Code(\">=\"),\n\t\tLT: new code_1._Code(\"<\"),\n\t\tLTE: new code_1._Code(\"<=\"),\n\t\tEQ: new code_1._Code(\"===\"),\n\t\tNEQ: new code_1._Code(\"!==\"),\n\t\tNOT: new code_1._Code(\"!\"),\n\t\tOR: new code_1._Code(\"||\"),\n\t\tAND: new code_1._Code(\"&&\"),\n\t\tADD: new code_1._Code(\"+\")\n\t};\n\tvar Node = class {\n\t\toptimizeNodes() {\n\t\t\treturn this;\n\t\t}\n\t\toptimizeNames(_names, _constants) {\n\t\t\treturn this;\n\t\t}\n\t};\n\tvar Def = class extends Node {\n\t\tconstructor(varKind, name, rhs) {\n\t\t\tsuper();\n\t\t\tthis.varKind = varKind;\n\t\t\tthis.name = name;\n\t\t\tthis.rhs = rhs;\n\t\t}\n\t\trender({ es5, _n }) {\n\t\t\tconst varKind = es5 ? scope_1.varKinds.var : this.varKind;\n\t\t\tconst rhs = this.rhs === void 0 ? \"\" : ` = ${this.rhs}`;\n\t\t\treturn `${varKind} ${this.name}${rhs};` + _n;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (!names[this.name.str]) return;\n\t\t\tif (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};\n\t\t}\n\t};\n\tvar Assign = class extends Node {\n\t\tconstructor(lhs, rhs, sideEffects) {\n\t\t\tsuper();\n\t\t\tthis.lhs = lhs;\n\t\t\tthis.rhs = rhs;\n\t\t\tthis.sideEffects = sideEffects;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.lhs} = ${this.rhs};` + _n;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) return;\n\t\t\tthis.rhs = optimizeExpr(this.rhs, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn addExprNames(this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }, this.rhs);\n\t\t}\n\t};\n\tvar AssignOp = class extends Assign {\n\t\tconstructor(lhs, op, rhs, sideEffects) {\n\t\t\tsuper(lhs, rhs, sideEffects);\n\t\t\tthis.op = op;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.lhs} ${this.op}= ${this.rhs};` + _n;\n\t\t}\n\t};\n\tvar Label = class extends Node {\n\t\tconstructor(label) {\n\t\t\tsuper();\n\t\t\tthis.label = label;\n\t\t\tthis.names = {};\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.label}:` + _n;\n\t\t}\n\t};\n\tvar Break = class extends Node {\n\t\tconstructor(label) {\n\t\t\tsuper();\n\t\t\tthis.label = label;\n\t\t\tthis.names = {};\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `break${this.label ? ` ${this.label}` : \"\"};` + _n;\n\t\t}\n\t};\n\tvar Throw = class extends Node {\n\t\tconstructor(error) {\n\t\t\tsuper();\n\t\t\tthis.error = error;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `throw ${this.error};` + _n;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.error.names;\n\t\t}\n\t};\n\tvar AnyCode = class extends Node {\n\t\tconstructor(code) {\n\t\t\tsuper();\n\t\t\tthis.code = code;\n\t\t}\n\t\trender({ _n }) {\n\t\t\treturn `${this.code};` + _n;\n\t\t}\n\t\toptimizeNodes() {\n\t\t\treturn `${this.code}` ? this : void 0;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tthis.code = optimizeExpr(this.code, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.code instanceof code_1._CodeOrName ? this.code.names : {};\n\t\t}\n\t};\n\tvar ParentNode = class extends Node {\n\t\tconstructor(nodes = []) {\n\t\t\tsuper();\n\t\t\tthis.nodes = nodes;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn this.nodes.reduce((code, n) => code + n.render(opts), \"\");\n\t\t}\n\t\toptimizeNodes() {\n\t\t\tconst { nodes } = this;\n\t\t\tlet i = nodes.length;\n\t\t\twhile (i--) {\n\t\t\t\tconst n = nodes[i].optimizeNodes();\n\t\t\t\tif (Array.isArray(n)) nodes.splice(i, 1, ...n);\n\t\t\t\telse if (n) nodes[i] = n;\n\t\t\t\telse nodes.splice(i, 1);\n\t\t\t}\n\t\t\treturn nodes.length > 0 ? this : void 0;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tconst { nodes } = this;\n\t\t\tlet i = nodes.length;\n\t\t\twhile (i--) {\n\t\t\t\tconst n = nodes[i];\n\t\t\t\tif (n.optimizeNames(names, constants)) continue;\n\t\t\t\tsubtractNames(names, n.names);\n\t\t\t\tnodes.splice(i, 1);\n\t\t\t}\n\t\t\treturn nodes.length > 0 ? this : void 0;\n\t\t}\n\t\tget names() {\n\t\t\treturn this.nodes.reduce((names, n) => addNames(names, n.names), {});\n\t\t}\n\t};\n\tvar BlockNode = class extends ParentNode {\n\t\trender(opts) {\n\t\t\treturn \"{\" + opts._n + super.render(opts) + \"}\" + opts._n;\n\t\t}\n\t};\n\tvar Root = class extends ParentNode {};\n\tvar Else = class extends BlockNode {};\n\tElse.kind = \"else\";\n\tvar If = class If extends BlockNode {\n\t\tconstructor(condition, nodes) {\n\t\t\tsuper(nodes);\n\t\t\tthis.condition = condition;\n\t\t}\n\t\trender(opts) {\n\t\t\tlet code = `if(${this.condition})` + super.render(opts);\n\t\t\tif (this.else) code += \"else \" + this.else.render(opts);\n\t\t\treturn code;\n\t\t}\n\t\toptimizeNodes() {\n\t\t\tsuper.optimizeNodes();\n\t\t\tconst cond = this.condition;\n\t\t\tif (cond === true) return this.nodes;\n\t\t\tlet e = this.else;\n\t\t\tif (e) {\n\t\t\t\tconst ns = e.optimizeNodes();\n\t\t\t\te = this.else = Array.isArray(ns) ? new Else(ns) : ns;\n\t\t\t}\n\t\t\tif (e) {\n\t\t\t\tif (cond === false) return e instanceof If ? e : e.nodes;\n\t\t\t\tif (this.nodes.length) return this;\n\t\t\t\treturn new If(not(cond), e instanceof If ? [e] : e.nodes);\n\t\t\t}\n\t\t\tif (cond === false || !this.nodes.length) return void 0;\n\t\t\treturn this;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tvar _a;\n\t\t\tthis.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);\n\t\t\tif (!(super.optimizeNames(names, constants) || this.else)) return;\n\t\t\tthis.condition = optimizeExpr(this.condition, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\tconst names = super.names;\n\t\t\taddExprNames(names, this.condition);\n\t\t\tif (this.else) addNames(names, this.else.names);\n\t\t\treturn names;\n\t\t}\n\t};\n\tIf.kind = \"if\";\n\tvar For = class extends BlockNode {};\n\tFor.kind = \"for\";\n\tvar ForLoop = class extends For {\n\t\tconstructor(iteration) {\n\t\t\tsuper();\n\t\t\tthis.iteration = iteration;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `for(${this.iteration})` + super.render(opts);\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (!super.optimizeNames(names, constants)) return;\n\t\t\tthis.iteration = optimizeExpr(this.iteration, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn addNames(super.names, this.iteration.names);\n\t\t}\n\t};\n\tvar ForRange = class extends For {\n\t\tconstructor(varKind, name, from, to) {\n\t\t\tsuper();\n\t\t\tthis.varKind = varKind;\n\t\t\tthis.name = name;\n\t\t\tthis.from = from;\n\t\t\tthis.to = to;\n\t\t}\n\t\trender(opts) {\n\t\t\tconst varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;\n\t\t\tconst { name, from, to } = this;\n\t\t\treturn `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);\n\t\t}\n\t\tget names() {\n\t\t\treturn addExprNames(addExprNames(super.names, this.from), this.to);\n\t\t}\n\t};\n\tvar ForIter = class extends For {\n\t\tconstructor(loop, varKind, name, iterable) {\n\t\t\tsuper();\n\t\t\tthis.loop = loop;\n\t\t\tthis.varKind = varKind;\n\t\t\tthis.name = name;\n\t\t\tthis.iterable = iterable;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tif (!super.optimizeNames(names, constants)) return;\n\t\t\tthis.iterable = optimizeExpr(this.iterable, names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\treturn addNames(super.names, this.iterable.names);\n\t\t}\n\t};\n\tvar Func = class extends BlockNode {\n\t\tconstructor(name, args, async) {\n\t\t\tsuper();\n\t\t\tthis.name = name;\n\t\t\tthis.args = args;\n\t\t\tthis.async = async;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `${this.async ? \"async \" : \"\"}function ${this.name}(${this.args})` + super.render(opts);\n\t\t}\n\t};\n\tFunc.kind = \"func\";\n\tvar Return = class extends ParentNode {\n\t\trender(opts) {\n\t\t\treturn \"return \" + super.render(opts);\n\t\t}\n\t};\n\tReturn.kind = \"return\";\n\tvar Try = class extends BlockNode {\n\t\trender(opts) {\n\t\t\tlet code = \"try\" + super.render(opts);\n\t\t\tif (this.catch) code += this.catch.render(opts);\n\t\t\tif (this.finally) code += this.finally.render(opts);\n\t\t\treturn code;\n\t\t}\n\t\toptimizeNodes() {\n\t\t\tvar _a, _b;\n\t\t\tsuper.optimizeNodes();\n\t\t\t(_a = this.catch) === null || _a === void 0 || _a.optimizeNodes();\n\t\t\t(_b = this.finally) === null || _b === void 0 || _b.optimizeNodes();\n\t\t\treturn this;\n\t\t}\n\t\toptimizeNames(names, constants) {\n\t\t\tvar _a, _b;\n\t\t\tsuper.optimizeNames(names, constants);\n\t\t\t(_a = this.catch) === null || _a === void 0 || _a.optimizeNames(names, constants);\n\t\t\t(_b = this.finally) === null || _b === void 0 || _b.optimizeNames(names, constants);\n\t\t\treturn this;\n\t\t}\n\t\tget names() {\n\t\t\tconst names = super.names;\n\t\t\tif (this.catch) addNames(names, this.catch.names);\n\t\t\tif (this.finally) addNames(names, this.finally.names);\n\t\t\treturn names;\n\t\t}\n\t};\n\tvar Catch = class extends BlockNode {\n\t\tconstructor(error) {\n\t\t\tsuper();\n\t\t\tthis.error = error;\n\t\t}\n\t\trender(opts) {\n\t\t\treturn `catch(${this.error})` + super.render(opts);\n\t\t}\n\t};\n\tCatch.kind = \"catch\";\n\tvar Finally = class extends BlockNode {\n\t\trender(opts) {\n\t\t\treturn \"finally\" + super.render(opts);\n\t\t}\n\t};\n\tFinally.kind = \"finally\";\n\tvar CodeGen = class {\n\t\tconstructor(extScope, opts = {}) {\n\t\t\tthis._values = {};\n\t\t\tthis._blockStarts = [];\n\t\t\tthis._constants = {};\n\t\t\tthis.opts = {\n\t\t\t\t...opts,\n\t\t\t\t_n: opts.lines ? \"\\n\" : \"\"\n\t\t\t};\n\t\t\tthis._extScope = extScope;\n\t\t\tthis._scope = new scope_1.Scope({ parent: extScope });\n\t\t\tthis._nodes = [new Root()];\n\t\t}\n\t\ttoString() {\n\t\t\treturn this._root.render(this.opts);\n\t\t}\n\t\tname(prefix) {\n\t\t\treturn this._scope.name(prefix);\n\t\t}\n\t\tscopeName(prefix) {\n\t\t\treturn this._extScope.name(prefix);\n\t\t}\n\t\tscopeValue(prefixOrName, value) {\n\t\t\tconst name = this._extScope.value(prefixOrName, value);\n\t\t\t(this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set())).add(name);\n\t\t\treturn name;\n\t\t}\n\t\tgetScopeValue(prefix, keyOrRef) {\n\t\t\treturn this._extScope.getValue(prefix, keyOrRef);\n\t\t}\n\t\tscopeRefs(scopeName) {\n\t\t\treturn this._extScope.scopeRefs(scopeName, this._values);\n\t\t}\n\t\tscopeCode() {\n\t\t\treturn this._extScope.scopeCode(this._values);\n\t\t}\n\t\t_def(varKind, nameOrPrefix, rhs, constant) {\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\tif (rhs !== void 0 && constant) this._constants[name.str] = rhs;\n\t\t\tthis._leafNode(new Def(varKind, name, rhs));\n\t\t\treturn name;\n\t\t}\n\t\tconst(nameOrPrefix, rhs, _constant) {\n\t\t\treturn this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);\n\t\t}\n\t\tlet(nameOrPrefix, rhs, _constant) {\n\t\t\treturn this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);\n\t\t}\n\t\tvar(nameOrPrefix, rhs, _constant) {\n\t\t\treturn this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);\n\t\t}\n\t\tassign(lhs, rhs, sideEffects) {\n\t\t\treturn this._leafNode(new Assign(lhs, rhs, sideEffects));\n\t\t}\n\t\tadd(lhs, rhs) {\n\t\t\treturn this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));\n\t\t}\n\t\tcode(c) {\n\t\t\tif (typeof c == \"function\") c();\n\t\t\telse if (c !== code_1.nil) this._leafNode(new AnyCode(c));\n\t\t\treturn this;\n\t\t}\n\t\tobject(...keyValues) {\n\t\t\tconst code = [\"{\"];\n\t\t\tfor (const [key, value] of keyValues) {\n\t\t\t\tif (code.length > 1) code.push(\",\");\n\t\t\t\tcode.push(key);\n\t\t\t\tif (key !== value || this.opts.es5) {\n\t\t\t\t\tcode.push(\":\");\n\t\t\t\t\t(0, code_1.addCodeArg)(code, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcode.push(\"}\");\n\t\t\treturn new code_1._Code(code);\n\t\t}\n\t\tif(condition, thenBody, elseBody) {\n\t\t\tthis._blockNode(new If(condition));\n\t\t\tif (thenBody && elseBody) this.code(thenBody).else().code(elseBody).endIf();\n\t\t\telse if (thenBody) this.code(thenBody).endIf();\n\t\t\telse if (elseBody) throw new Error(\"CodeGen: \\\"else\\\" body without \\\"then\\\" body\");\n\t\t\treturn this;\n\t\t}\n\t\telseIf(condition) {\n\t\t\treturn this._elseNode(new If(condition));\n\t\t}\n\t\telse() {\n\t\t\treturn this._elseNode(new Else());\n\t\t}\n\t\tendIf() {\n\t\t\treturn this._endBlockNode(If, Else);\n\t\t}\n\t\t_for(node, forBody) {\n\t\t\tthis._blockNode(node);\n\t\t\tif (forBody) this.code(forBody).endFor();\n\t\t\treturn this;\n\t\t}\n\t\tfor(iteration, forBody) {\n\t\t\treturn this._for(new ForLoop(iteration), forBody);\n\t\t}\n\t\tforRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\treturn this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n\t\t}\n\t\tforOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\tif (this.opts.es5) {\n\t\t\t\tconst arr = iterable instanceof code_1.Name ? iterable : this.var(\"_arr\", iterable);\n\t\t\t\treturn this.forRange(\"_i\", 0, (0, code_1._)`${arr}.length`, (i) => {\n\t\t\t\t\tthis.var(name, (0, code_1._)`${arr}[${i}]`);\n\t\t\t\t\tforBody(name);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn this._for(new ForIter(\"of\", varKind, name, iterable), () => forBody(name));\n\t\t}\n\t\tforIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {\n\t\t\tif (this.opts.ownProperties) return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody);\n\t\t\tconst name = this._scope.toName(nameOrPrefix);\n\t\t\treturn this._for(new ForIter(\"in\", varKind, name, obj), () => forBody(name));\n\t\t}\n\t\tendFor() {\n\t\t\treturn this._endBlockNode(For);\n\t\t}\n\t\tlabel(label) {\n\t\t\treturn this._leafNode(new Label(label));\n\t\t}\n\t\tbreak(label) {\n\t\t\treturn this._leafNode(new Break(label));\n\t\t}\n\t\treturn(value) {\n\t\t\tconst node = new Return();\n\t\t\tthis._blockNode(node);\n\t\t\tthis.code(value);\n\t\t\tif (node.nodes.length !== 1) throw new Error(\"CodeGen: \\\"return\\\" should have one node\");\n\t\t\treturn this._endBlockNode(Return);\n\t\t}\n\t\ttry(tryBody, catchCode, finallyCode) {\n\t\t\tif (!catchCode && !finallyCode) throw new Error(\"CodeGen: \\\"try\\\" without \\\"catch\\\" and \\\"finally\\\"\");\n\t\t\tconst node = new Try();\n\t\t\tthis._blockNode(node);\n\t\t\tthis.code(tryBody);\n\t\t\tif (catchCode) {\n\t\t\t\tconst error = this.name(\"e\");\n\t\t\t\tthis._currNode = node.catch = new Catch(error);\n\t\t\t\tcatchCode(error);\n\t\t\t}\n\t\t\tif (finallyCode) {\n\t\t\t\tthis._currNode = node.finally = new Finally();\n\t\t\t\tthis.code(finallyCode);\n\t\t\t}\n\t\t\treturn this._endBlockNode(Catch, Finally);\n\t\t}\n\t\tthrow(error) {\n\t\t\treturn this._leafNode(new Throw(error));\n\t\t}\n\t\tblock(body, nodeCount) {\n\t\t\tthis._blockStarts.push(this._nodes.length);\n\t\t\tif (body) this.code(body).endBlock(nodeCount);\n\t\t\treturn this;\n\t\t}\n\t\tendBlock(nodeCount) {\n\t\t\tconst len = this._blockStarts.pop();\n\t\t\tif (len === void 0) throw new Error(\"CodeGen: not in self-balancing block\");\n\t\t\tconst toClose = this._nodes.length - len;\n\t\t\tif (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n\t\t\tthis._nodes.length = len;\n\t\t\treturn this;\n\t\t}\n\t\tfunc(name, args = code_1.nil, async, funcBody) {\n\t\t\tthis._blockNode(new Func(name, args, async));\n\t\t\tif (funcBody) this.code(funcBody).endFunc();\n\t\t\treturn this;\n\t\t}\n\t\tendFunc() {\n\t\t\treturn this._endBlockNode(Func);\n\t\t}\n\t\toptimize(n = 1) {\n\t\t\twhile (n-- > 0) {\n\t\t\t\tthis._root.optimizeNodes();\n\t\t\t\tthis._root.optimizeNames(this._root.names, this._constants);\n\t\t\t}\n\t\t}\n\t\t_leafNode(node) {\n\t\t\tthis._currNode.nodes.push(node);\n\t\t\treturn this;\n\t\t}\n\t\t_blockNode(node) {\n\t\t\tthis._currNode.nodes.push(node);\n\t\t\tthis._nodes.push(node);\n\t\t}\n\t\t_endBlockNode(N1, N2) {\n\t\t\tconst n = this._currNode;\n\t\t\tif (n instanceof N1 || N2 && n instanceof N2) {\n\t\t\t\tthis._nodes.pop();\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthrow new Error(`CodeGen: not in block \"${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}\"`);\n\t\t}\n\t\t_elseNode(node) {\n\t\t\tconst n = this._currNode;\n\t\t\tif (!(n instanceof If)) throw new Error(\"CodeGen: \\\"else\\\" without \\\"if\\\"\");\n\t\t\tthis._currNode = n.else = node;\n\t\t\treturn this;\n\t\t}\n\t\tget _root() {\n\t\t\treturn this._nodes[0];\n\t\t}\n\t\tget _currNode() {\n\t\t\tconst ns = this._nodes;\n\t\t\treturn ns[ns.length - 1];\n\t\t}\n\t\tset _currNode(node) {\n\t\t\tconst ns = this._nodes;\n\t\t\tns[ns.length - 1] = node;\n\t\t}\n\t};\n\texports.CodeGen = CodeGen;\n\tfunction addNames(names, from) {\n\t\tfor (const n in from) names[n] = (names[n] || 0) + (from[n] || 0);\n\t\treturn names;\n\t}\n\tfunction addExprNames(names, from) {\n\t\treturn from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;\n\t}\n\tfunction optimizeExpr(expr, names, constants) {\n\t\tif (expr instanceof code_1.Name) return replaceName(expr);\n\t\tif (!canOptimize(expr)) return expr;\n\t\treturn new code_1._Code(expr._items.reduce((items, c) => {\n\t\t\tif (c instanceof code_1.Name) c = replaceName(c);\n\t\t\tif (c instanceof code_1._Code) items.push(...c._items);\n\t\t\telse items.push(c);\n\t\t\treturn items;\n\t\t}, []));\n\t\tfunction replaceName(n) {\n\t\t\tconst c = constants[n.str];\n\t\t\tif (c === void 0 || names[n.str] !== 1) return n;\n\t\t\tdelete names[n.str];\n\t\t\treturn c;\n\t\t}\n\t\tfunction canOptimize(e) {\n\t\t\treturn e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);\n\t\t}\n\t}\n\tfunction subtractNames(names, from) {\n\t\tfor (const n in from) names[n] = (names[n] || 0) - (from[n] || 0);\n\t}\n\tfunction not(x) {\n\t\treturn typeof x == \"boolean\" || typeof x == \"number\" || x === null ? !x : (0, code_1._)`!${par(x)}`;\n\t}\n\texports.not = not;\n\tconst andCode = mappend(exports.operators.AND);\n\tfunction and(...args) {\n\t\treturn args.reduce(andCode);\n\t}\n\texports.and = and;\n\tconst orCode = mappend(exports.operators.OR);\n\tfunction or(...args) {\n\t\treturn args.reduce(orCode);\n\t}\n\texports.or = or;\n\tfunction mappend(op) {\n\t\treturn (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;\n\t}\n\tfunction par(x) {\n\t\treturn x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js\nvar require_util = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst code_1 = require_code$1();\n\tfunction toHash(arr) {\n\t\tconst hash = {};\n\t\tfor (const item of arr) hash[item] = true;\n\t\treturn hash;\n\t}\n\texports.toHash = toHash;\n\tfunction alwaysValidSchema(it, schema) {\n\t\tif (typeof schema == \"boolean\") return schema;\n\t\tif (Object.keys(schema).length === 0) return true;\n\t\tcheckUnknownRules(it, schema);\n\t\treturn !schemaHasRules(schema, it.self.RULES.all);\n\t}\n\texports.alwaysValidSchema = alwaysValidSchema;\n\tfunction checkUnknownRules(it, schema = it.schema) {\n\t\tconst { opts, self } = it;\n\t\tif (!opts.strictSchema) return;\n\t\tif (typeof schema === \"boolean\") return;\n\t\tconst rules = self.RULES.keywords;\n\t\tfor (const key in schema) if (!rules[key]) checkStrictMode(it, `unknown keyword: \"${key}\"`);\n\t}\n\texports.checkUnknownRules = checkUnknownRules;\n\tfunction schemaHasRules(schema, rules) {\n\t\tif (typeof schema == \"boolean\") return !schema;\n\t\tfor (const key in schema) if (rules[key]) return true;\n\t\treturn false;\n\t}\n\texports.schemaHasRules = schemaHasRules;\n\tfunction schemaHasRulesButRef(schema, RULES) {\n\t\tif (typeof schema == \"boolean\") return !schema;\n\t\tfor (const key in schema) if (key !== \"$ref\" && RULES.all[key]) return true;\n\t\treturn false;\n\t}\n\texports.schemaHasRulesButRef = schemaHasRulesButRef;\n\tfunction schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {\n\t\tif (!$data) {\n\t\t\tif (typeof schema == \"number\" || typeof schema == \"boolean\") return schema;\n\t\t\tif (typeof schema == \"string\") return (0, codegen_1._)`${schema}`;\n\t\t}\n\t\treturn (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;\n\t}\n\texports.schemaRefOrVal = schemaRefOrVal;\n\tfunction unescapeFragment(str) {\n\t\treturn unescapeJsonPointer(decodeURIComponent(str));\n\t}\n\texports.unescapeFragment = unescapeFragment;\n\tfunction escapeFragment(str) {\n\t\treturn encodeURIComponent(escapeJsonPointer(str));\n\t}\n\texports.escapeFragment = escapeFragment;\n\tfunction escapeJsonPointer(str) {\n\t\tif (typeof str == \"number\") return `${str}`;\n\t\treturn str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n\t}\n\texports.escapeJsonPointer = escapeJsonPointer;\n\tfunction unescapeJsonPointer(str) {\n\t\treturn str.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n\t}\n\texports.unescapeJsonPointer = unescapeJsonPointer;\n\tfunction eachItem(xs, f) {\n\t\tif (Array.isArray(xs)) for (const x of xs) f(x);\n\t\telse f(xs);\n\t}\n\texports.eachItem = eachItem;\n\tfunction makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) {\n\t\treturn (gen, from, to, toName) => {\n\t\t\tconst res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues(from, to);\n\t\t\treturn toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;\n\t\t};\n\t}\n\texports.mergeEvaluated = {\n\t\tprops: makeMergeEvaluated({\n\t\t\tmergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {\n\t\t\t\tgen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`));\n\t\t\t}),\n\t\t\tmergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => {\n\t\t\t\tif (from === true) gen.assign(to, true);\n\t\t\t\telse {\n\t\t\t\t\tgen.assign(to, (0, codegen_1._)`${to} || {}`);\n\t\t\t\t\tsetEvaluated(gen, to, from);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tmergeValues: (from, to) => from === true ? true : {\n\t\t\t\t...from,\n\t\t\t\t...to\n\t\t\t},\n\t\t\tresultToName: evaluatedPropsToName\n\t\t}),\n\t\titems: makeMergeEvaluated({\n\t\t\tmergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),\n\t\t\tmergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)),\n\t\t\tmergeValues: (from, to) => from === true ? true : Math.max(from, to),\n\t\t\tresultToName: (gen, items) => gen.var(\"items\", items)\n\t\t})\n\t};\n\tfunction evaluatedPropsToName(gen, ps) {\n\t\tif (ps === true) return gen.var(\"props\", true);\n\t\tconst props = gen.var(\"props\", (0, codegen_1._)`{}`);\n\t\tif (ps !== void 0) setEvaluated(gen, props, ps);\n\t\treturn props;\n\t}\n\texports.evaluatedPropsToName = evaluatedPropsToName;\n\tfunction setEvaluated(gen, props, ps) {\n\t\tObject.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));\n\t}\n\texports.setEvaluated = setEvaluated;\n\tconst snippets = {};\n\tfunction useFunc(gen, f) {\n\t\treturn gen.scopeValue(\"func\", {\n\t\t\tref: f,\n\t\t\tcode: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))\n\t\t});\n\t}\n\texports.useFunc = useFunc;\n\tvar Type;\n\t(function(Type) {\n\t\tType[Type[\"Num\"] = 0] = \"Num\";\n\t\tType[Type[\"Str\"] = 1] = \"Str\";\n\t})(Type || (exports.Type = Type = {}));\n\tfunction getErrorPath(dataProp, dataPropType, jsPropertySyntax) {\n\t\tif (dataProp instanceof codegen_1.Name) {\n\t\t\tconst isNumber = dataPropType === Type.Num;\n\t\t\treturn jsPropertySyntax ? isNumber ? (0, codegen_1._)`\"[\" + ${dataProp} + \"]\"` : (0, codegen_1._)`\"['\" + ${dataProp} + \"']\"` : isNumber ? (0, codegen_1._)`\"/\" + ${dataProp}` : (0, codegen_1._)`\"/\" + ${dataProp}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`;\n\t\t}\n\t\treturn jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : \"/\" + escapeJsonPointer(dataProp);\n\t}\n\texports.getErrorPath = getErrorPath;\n\tfunction checkStrictMode(it, msg, mode = it.opts.strictSchema) {\n\t\tif (!mode) return;\n\t\tmsg = `strict mode: ${msg}`;\n\t\tif (mode === true) throw new Error(msg);\n\t\tit.self.logger.warn(msg);\n\t}\n\texports.checkStrictMode = checkStrictMode;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js\nvar require_names = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst names = {\n\t\tdata: new codegen_1.Name(\"data\"),\n\t\tvalCxt: new codegen_1.Name(\"valCxt\"),\n\t\tinstancePath: new codegen_1.Name(\"instancePath\"),\n\t\tparentData: new codegen_1.Name(\"parentData\"),\n\t\tparentDataProperty: new codegen_1.Name(\"parentDataProperty\"),\n\t\trootData: new codegen_1.Name(\"rootData\"),\n\t\tdynamicAnchors: new codegen_1.Name(\"dynamicAnchors\"),\n\t\tvErrors: new codegen_1.Name(\"vErrors\"),\n\t\terrors: new codegen_1.Name(\"errors\"),\n\t\tthis: new codegen_1.Name(\"this\"),\n\t\tself: new codegen_1.Name(\"self\"),\n\t\tscope: new codegen_1.Name(\"scope\"),\n\t\tjson: new codegen_1.Name(\"json\"),\n\t\tjsonPos: new codegen_1.Name(\"jsonPos\"),\n\t\tjsonLen: new codegen_1.Name(\"jsonLen\"),\n\t\tjsonPart: new codegen_1.Name(\"jsonPart\")\n\t};\n\texports.default = names;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js\nvar require_errors = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst names_1 = require_names();\n\texports.keywordError = { message: ({ keyword }) => (0, codegen_1.str)`must pass \"${keyword}\" keyword validation` };\n\texports.keyword$DataError = { message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`\"${keyword}\" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`\"${keyword}\" keyword is invalid ($data)` };\n\tfunction reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {\n\t\tconst { it } = cxt;\n\t\tconst { gen, compositeRule, allErrors } = it;\n\t\tconst errObj = errorObjectCode(cxt, error, errorPaths);\n\t\tif (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) addError(gen, errObj);\n\t\telse returnErrors(it, (0, codegen_1._)`[${errObj}]`);\n\t}\n\texports.reportError = reportError;\n\tfunction reportExtraError(cxt, error = exports.keywordError, errorPaths) {\n\t\tconst { it } = cxt;\n\t\tconst { gen, compositeRule, allErrors } = it;\n\t\taddError(gen, errorObjectCode(cxt, error, errorPaths));\n\t\tif (!(compositeRule || allErrors)) returnErrors(it, names_1.default.vErrors);\n\t}\n\texports.reportExtraError = reportExtraError;\n\tfunction resetErrorsCount(gen, errsCount) {\n\t\tgen.assign(names_1.default.errors, errsCount);\n\t\tgen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));\n\t}\n\texports.resetErrorsCount = resetErrorsCount;\n\tfunction extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {\n\t\t/* istanbul ignore if */\n\t\tif (errsCount === void 0) throw new Error(\"ajv implementation error\");\n\t\tconst err = gen.name(\"err\");\n\t\tgen.forRange(\"i\", errsCount, names_1.default.errors, (i) => {\n\t\t\tgen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`);\n\t\t\tgen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));\n\t\t\tgen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`);\n\t\t\tif (it.opts.verbose) {\n\t\t\t\tgen.assign((0, codegen_1._)`${err}.schema`, schemaValue);\n\t\t\t\tgen.assign((0, codegen_1._)`${err}.data`, data);\n\t\t\t}\n\t\t});\n\t}\n\texports.extendErrors = extendErrors;\n\tfunction addError(gen, errObj) {\n\t\tconst err = gen.const(\"err\", errObj);\n\t\tgen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);\n\t\tgen.code((0, codegen_1._)`${names_1.default.errors}++`);\n\t}\n\tfunction returnErrors(it, errs) {\n\t\tconst { gen, validateName, schemaEnv } = it;\n\t\tif (schemaEnv.$async) gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`);\n\t\telse {\n\t\t\tgen.assign((0, codegen_1._)`${validateName}.errors`, errs);\n\t\t\tgen.return(false);\n\t\t}\n\t}\n\tconst E = {\n\t\tkeyword: new codegen_1.Name(\"keyword\"),\n\t\tschemaPath: new codegen_1.Name(\"schemaPath\"),\n\t\tparams: new codegen_1.Name(\"params\"),\n\t\tpropertyName: new codegen_1.Name(\"propertyName\"),\n\t\tmessage: new codegen_1.Name(\"message\"),\n\t\tschema: new codegen_1.Name(\"schema\"),\n\t\tparentSchema: new codegen_1.Name(\"parentSchema\")\n\t};\n\tfunction errorObjectCode(cxt, error, errorPaths) {\n\t\tconst { createErrors } = cxt.it;\n\t\tif (createErrors === false) return (0, codegen_1._)`{}`;\n\t\treturn errorObject(cxt, error, errorPaths);\n\t}\n\tfunction errorObject(cxt, error, errorPaths = {}) {\n\t\tconst { gen, it } = cxt;\n\t\tconst keyValues = [errorInstancePath(it, errorPaths), errorSchemaPath(cxt, errorPaths)];\n\t\textraErrorProps(cxt, error, keyValues);\n\t\treturn gen.object(...keyValues);\n\t}\n\tfunction errorInstancePath({ errorPath }, { instancePath }) {\n\t\tconst instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;\n\t\treturn [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];\n\t}\n\tfunction errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {\n\t\tlet schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;\n\t\tif (schemaPath) schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;\n\t\treturn [E.schemaPath, schPath];\n\t}\n\tfunction extraErrorProps(cxt, { params, message }, keyValues) {\n\t\tconst { keyword, data, schemaValue, it } = cxt;\n\t\tconst { opts, propertyName, topSchemaRef, schemaPath } = it;\n\t\tkeyValues.push([E.keyword, keyword], [E.params, typeof params == \"function\" ? params(cxt) : params || (0, codegen_1._)`{}`]);\n\t\tif (opts.messages) keyValues.push([E.message, typeof message == \"function\" ? message(cxt) : message]);\n\t\tif (opts.verbose) keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);\n\t\tif (propertyName) keyValues.push([E.propertyName, propertyName]);\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js\nvar require_boolSchema = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;\n\tconst errors_1 = require_errors();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst boolError = { message: \"boolean schema is false\" };\n\tfunction topBoolOrEmptySchema(it) {\n\t\tconst { gen, schema, validateName } = it;\n\t\tif (schema === false) falseSchemaError(it, false);\n\t\telse if (typeof schema == \"object\" && schema.$async === true) gen.return(names_1.default.data);\n\t\telse {\n\t\t\tgen.assign((0, codegen_1._)`${validateName}.errors`, null);\n\t\t\tgen.return(true);\n\t\t}\n\t}\n\texports.topBoolOrEmptySchema = topBoolOrEmptySchema;\n\tfunction boolOrEmptySchema(it, valid) {\n\t\tconst { gen, schema } = it;\n\t\tif (schema === false) {\n\t\t\tgen.var(valid, false);\n\t\t\tfalseSchemaError(it);\n\t\t} else gen.var(valid, true);\n\t}\n\texports.boolOrEmptySchema = boolOrEmptySchema;\n\tfunction falseSchemaError(it, overrideAllErrors) {\n\t\tconst { gen, data } = it;\n\t\tconst cxt = {\n\t\t\tgen,\n\t\t\tkeyword: \"false schema\",\n\t\t\tdata,\n\t\t\tschema: false,\n\t\t\tschemaCode: false,\n\t\t\tschemaValue: false,\n\t\t\tparams: {},\n\t\t\tit\n\t\t};\n\t\t(0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js\nvar require_rules = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.getRules = exports.isJSONType = void 0;\n\tconst jsonTypes = new Set([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"boolean\",\n\t\t\"null\",\n\t\t\"object\",\n\t\t\"array\"\n\t]);\n\tfunction isJSONType(x) {\n\t\treturn typeof x == \"string\" && jsonTypes.has(x);\n\t}\n\texports.isJSONType = isJSONType;\n\tfunction getRules() {\n\t\tconst groups = {\n\t\t\tnumber: {\n\t\t\t\ttype: \"number\",\n\t\t\t\trules: []\n\t\t\t},\n\t\t\tstring: {\n\t\t\t\ttype: \"string\",\n\t\t\t\trules: []\n\t\t\t},\n\t\t\tarray: {\n\t\t\t\ttype: \"array\",\n\t\t\t\trules: []\n\t\t\t},\n\t\t\tobject: {\n\t\t\t\ttype: \"object\",\n\t\t\t\trules: []\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\ttypes: {\n\t\t\t\t...groups,\n\t\t\t\tinteger: true,\n\t\t\t\tboolean: true,\n\t\t\t\tnull: true\n\t\t\t},\n\t\t\trules: [\n\t\t\t\t{ rules: [] },\n\t\t\t\tgroups.number,\n\t\t\t\tgroups.string,\n\t\t\t\tgroups.array,\n\t\t\t\tgroups.object\n\t\t\t],\n\t\t\tpost: { rules: [] },\n\t\t\tall: {},\n\t\t\tkeywords: {}\n\t\t};\n\t}\n\texports.getRules = getRules;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js\nvar require_applicability = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;\n\tfunction schemaHasRulesForType({ schema, self }, type) {\n\t\tconst group = self.RULES.types[type];\n\t\treturn group && group !== true && shouldUseGroup(schema, group);\n\t}\n\texports.schemaHasRulesForType = schemaHasRulesForType;\n\tfunction shouldUseGroup(schema, group) {\n\t\treturn group.rules.some((rule) => shouldUseRule(schema, rule));\n\t}\n\texports.shouldUseGroup = shouldUseGroup;\n\tfunction shouldUseRule(schema, rule) {\n\t\tvar _a;\n\t\treturn schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));\n\t}\n\texports.shouldUseRule = shouldUseRule;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js\nvar require_dataType = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;\n\tconst rules_1 = require_rules();\n\tconst applicability_1 = require_applicability();\n\tconst errors_1 = require_errors();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tvar DataType;\n\t(function(DataType) {\n\t\tDataType[DataType[\"Correct\"] = 0] = \"Correct\";\n\t\tDataType[DataType[\"Wrong\"] = 1] = \"Wrong\";\n\t})(DataType || (exports.DataType = DataType = {}));\n\tfunction getSchemaTypes(schema) {\n\t\tconst types = getJSONTypes(schema.type);\n\t\tif (types.includes(\"null\")) {\n\t\t\tif (schema.nullable === false) throw new Error(\"type: null contradicts nullable: false\");\n\t\t} else {\n\t\t\tif (!types.length && schema.nullable !== void 0) throw new Error(\"\\\"nullable\\\" cannot be used without \\\"type\\\"\");\n\t\t\tif (schema.nullable === true) types.push(\"null\");\n\t\t}\n\t\treturn types;\n\t}\n\texports.getSchemaTypes = getSchemaTypes;\n\tfunction getJSONTypes(ts) {\n\t\tconst types = Array.isArray(ts) ? ts : ts ? [ts] : [];\n\t\tif (types.every(rules_1.isJSONType)) return types;\n\t\tthrow new Error(\"type must be JSONType or JSONType[]: \" + types.join(\",\"));\n\t}\n\texports.getJSONTypes = getJSONTypes;\n\tfunction coerceAndCheckDataType(it, types) {\n\t\tconst { gen, data, opts } = it;\n\t\tconst coerceTo = coerceToTypes(types, opts.coerceTypes);\n\t\tconst checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));\n\t\tif (checkTypes) {\n\t\t\tconst wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);\n\t\t\tgen.if(wrongType, () => {\n\t\t\t\tif (coerceTo.length) coerceData(it, types, coerceTo);\n\t\t\t\telse reportTypeError(it);\n\t\t\t});\n\t\t}\n\t\treturn checkTypes;\n\t}\n\texports.coerceAndCheckDataType = coerceAndCheckDataType;\n\tconst COERCIBLE = new Set([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"boolean\",\n\t\t\"null\"\n\t]);\n\tfunction coerceToTypes(types, coerceTypes) {\n\t\treturn coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === \"array\" && t === \"array\") : [];\n\t}\n\tfunction coerceData(it, types, coerceTo) {\n\t\tconst { gen, data, opts } = it;\n\t\tconst dataType = gen.let(\"dataType\", (0, codegen_1._)`typeof ${data}`);\n\t\tconst coerced = gen.let(\"coerced\", (0, codegen_1._)`undefined`);\n\t\tif (opts.coerceTypes === \"array\") gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));\n\t\tgen.if((0, codegen_1._)`${coerced} !== undefined`);\n\t\tfor (const t of coerceTo) if (COERCIBLE.has(t) || t === \"array\" && opts.coerceTypes === \"array\") coerceSpecificType(t);\n\t\tgen.else();\n\t\treportTypeError(it);\n\t\tgen.endIf();\n\t\tgen.if((0, codegen_1._)`${coerced} !== undefined`, () => {\n\t\t\tgen.assign(data, coerced);\n\t\t\tassignParentData(it, coerced);\n\t\t});\n\t\tfunction coerceSpecificType(t) {\n\t\t\tswitch (t) {\n\t\t\t\tcase \"string\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${dataType} == \"number\" || ${dataType} == \"boolean\"`).assign(coerced, (0, codegen_1._)`\"\" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`\"\"`);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"number\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${dataType} == \"boolean\" || ${data} === null\n || (${dataType} == \"string\" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"integer\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${dataType} === \"boolean\" || ${data} === null\n || (${dataType} === \"string\" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"boolean\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${data} === \"false\" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === \"true\" || ${data} === 1`).assign(coerced, true);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"null\":\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${data} === \"\" || ${data} === 0 || ${data} === false`);\n\t\t\t\t\tgen.assign(coerced, null);\n\t\t\t\t\treturn;\n\t\t\t\tcase \"array\": gen.elseIf((0, codegen_1._)`${dataType} === \"string\" || ${dataType} === \"number\"\n || ${dataType} === \"boolean\" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);\n\t\t\t}\n\t\t}\n\t}\n\tfunction assignParentData({ gen, parentData, parentDataProperty }, expr) {\n\t\tgen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));\n\t}\n\tfunction checkDataType(dataType, data, strictNums, correct = DataType.Correct) {\n\t\tconst EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;\n\t\tlet cond;\n\t\tswitch (dataType) {\n\t\t\tcase \"null\": return (0, codegen_1._)`${data} ${EQ} null`;\n\t\t\tcase \"array\":\n\t\t\t\tcond = (0, codegen_1._)`Array.isArray(${data})`;\n\t\t\t\tbreak;\n\t\t\tcase \"object\":\n\t\t\t\tcond = (0, codegen_1._)`${data} && typeof ${data} == \"object\" && !Array.isArray(${data})`;\n\t\t\t\tbreak;\n\t\t\tcase \"integer\":\n\t\t\t\tcond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`);\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\tcond = numCond();\n\t\t\t\tbreak;\n\t\t\tdefault: return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`;\n\t\t}\n\t\treturn correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);\n\t\tfunction numCond(_cond = codegen_1.nil) {\n\t\t\treturn (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == \"number\"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);\n\t\t}\n\t}\n\texports.checkDataType = checkDataType;\n\tfunction checkDataTypes(dataTypes, data, strictNums, correct) {\n\t\tif (dataTypes.length === 1) return checkDataType(dataTypes[0], data, strictNums, correct);\n\t\tlet cond;\n\t\tconst types = (0, util_1.toHash)(dataTypes);\n\t\tif (types.array && types.object) {\n\t\t\tconst notObj = (0, codegen_1._)`typeof ${data} != \"object\"`;\n\t\t\tcond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`;\n\t\t\tdelete types.null;\n\t\t\tdelete types.array;\n\t\t\tdelete types.object;\n\t\t} else cond = codegen_1.nil;\n\t\tif (types.number) delete types.integer;\n\t\tfor (const t in types) cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));\n\t\treturn cond;\n\t}\n\texports.checkDataTypes = checkDataTypes;\n\tconst typeError = {\n\t\tmessage: ({ schema }) => `must be ${schema}`,\n\t\tparams: ({ schema, schemaValue }) => typeof schema == \"string\" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}`\n\t};\n\tfunction reportTypeError(it) {\n\t\tconst cxt = getTypeErrorContext(it);\n\t\t(0, errors_1.reportError)(cxt, typeError);\n\t}\n\texports.reportTypeError = reportTypeError;\n\tfunction getTypeErrorContext(it) {\n\t\tconst { gen, data, schema } = it;\n\t\tconst schemaCode = (0, util_1.schemaRefOrVal)(it, schema, \"type\");\n\t\treturn {\n\t\t\tgen,\n\t\t\tkeyword: \"type\",\n\t\t\tdata,\n\t\t\tschema: schema.type,\n\t\t\tschemaCode,\n\t\t\tschemaValue: schemaCode,\n\t\t\tparentSchema: schema,\n\t\t\tparams: {},\n\t\t\tit\n\t\t};\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js\nvar require_defaults = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.assignDefaults = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tfunction assignDefaults(it, ty) {\n\t\tconst { properties, items } = it.schema;\n\t\tif (ty === \"object\" && properties) for (const key in properties) assignDefault(it, key, properties[key].default);\n\t\telse if (ty === \"array\" && Array.isArray(items)) items.forEach((sch, i) => assignDefault(it, i, sch.default));\n\t}\n\texports.assignDefaults = assignDefaults;\n\tfunction assignDefault(it, prop, defaultValue) {\n\t\tconst { gen, compositeRule, data, opts } = it;\n\t\tif (defaultValue === void 0) return;\n\t\tconst childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`;\n\t\tif (compositeRule) {\n\t\t\t(0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);\n\t\t\treturn;\n\t\t}\n\t\tlet condition = (0, codegen_1._)`${childData} === undefined`;\n\t\tif (opts.useDefaults === \"empty\") condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === \"\"`;\n\t\tgen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js\nvar require_code = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst names_1 = require_names();\n\tconst util_2 = require_util();\n\tfunction checkReportMissingProp(cxt, prop) {\n\t\tconst { gen, data, it } = cxt;\n\t\tgen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {\n\t\t\tcxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true);\n\t\t\tcxt.error();\n\t\t});\n\t}\n\texports.checkReportMissingProp = checkReportMissingProp;\n\tfunction checkMissingProp({ gen, data, it: { opts } }, properties, missing) {\n\t\treturn (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));\n\t}\n\texports.checkMissingProp = checkMissingProp;\n\tfunction reportMissingProp(cxt, missing) {\n\t\tcxt.setParams({ missingProperty: missing }, true);\n\t\tcxt.error();\n\t}\n\texports.reportMissingProp = reportMissingProp;\n\tfunction hasPropFunc(gen) {\n\t\treturn gen.scopeValue(\"func\", {\n\t\t\tref: Object.prototype.hasOwnProperty,\n\t\t\tcode: (0, codegen_1._)`Object.prototype.hasOwnProperty`\n\t\t});\n\t}\n\texports.hasPropFunc = hasPropFunc;\n\tfunction isOwnProperty(gen, data, property) {\n\t\treturn (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;\n\t}\n\texports.isOwnProperty = isOwnProperty;\n\tfunction propertyInData(gen, data, property, ownProperties) {\n\t\tconst cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;\n\t\treturn ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;\n\t}\n\texports.propertyInData = propertyInData;\n\tfunction noPropertyInData(gen, data, property, ownProperties) {\n\t\tconst cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;\n\t\treturn ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;\n\t}\n\texports.noPropertyInData = noPropertyInData;\n\tfunction allSchemaProperties(schemaMap) {\n\t\treturn schemaMap ? Object.keys(schemaMap).filter((p) => p !== \"__proto__\") : [];\n\t}\n\texports.allSchemaProperties = allSchemaProperties;\n\tfunction schemaProperties(it, schemaMap) {\n\t\treturn allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));\n\t}\n\texports.schemaProperties = schemaProperties;\n\tfunction callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {\n\t\tconst dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;\n\t\tconst valCxt = [\n\t\t\t[names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],\n\t\t\t[names_1.default.parentData, it.parentData],\n\t\t\t[names_1.default.parentDataProperty, it.parentDataProperty],\n\t\t\t[names_1.default.rootData, names_1.default.rootData]\n\t\t];\n\t\tif (it.opts.dynamicRef) valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);\n\t\tconst args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;\n\t\treturn context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;\n\t}\n\texports.callValidateCode = callValidateCode;\n\tconst newRegExp = (0, codegen_1._)`new RegExp`;\n\tfunction usePattern({ gen, it: { opts } }, pattern) {\n\t\tconst u = opts.unicodeRegExp ? \"u\" : \"\";\n\t\tconst { regExp } = opts.code;\n\t\tconst rx = regExp(pattern, u);\n\t\treturn gen.scopeValue(\"pattern\", {\n\t\t\tkey: rx.toString(),\n\t\t\tref: rx,\n\t\t\tcode: (0, codegen_1._)`${regExp.code === \"new RegExp\" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`\n\t\t});\n\t}\n\texports.usePattern = usePattern;\n\tfunction validateArray(cxt) {\n\t\tconst { gen, data, keyword, it } = cxt;\n\t\tconst valid = gen.name(\"valid\");\n\t\tif (it.allErrors) {\n\t\t\tconst validArr = gen.let(\"valid\", true);\n\t\t\tvalidateItems(() => gen.assign(validArr, false));\n\t\t\treturn validArr;\n\t\t}\n\t\tgen.var(valid, true);\n\t\tvalidateItems(() => gen.break());\n\t\treturn valid;\n\t\tfunction validateItems(notValid) {\n\t\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\t\tgen.forRange(\"i\", 0, len, (i) => {\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword,\n\t\t\t\t\tdataProp: i,\n\t\t\t\t\tdataPropType: util_1.Type.Num\n\t\t\t\t}, valid);\n\t\t\t\tgen.if((0, codegen_1.not)(valid), notValid);\n\t\t\t});\n\t\t}\n\t}\n\texports.validateArray = validateArray;\n\tfunction validateUnion(cxt) {\n\t\tconst { gen, schema, keyword, it } = cxt;\n\t\t/* istanbul ignore if */\n\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\tif (schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)) && !it.opts.unevaluated) return;\n\t\tconst valid = gen.let(\"valid\", false);\n\t\tconst schValid = gen.name(\"_valid\");\n\t\tgen.block(() => schema.forEach((_sch, i) => {\n\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\tkeyword,\n\t\t\t\tschemaProp: i,\n\t\t\t\tcompositeRule: true\n\t\t\t}, schValid);\n\t\t\tgen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`);\n\t\t\tif (!cxt.mergeValidEvaluated(schCxt, schValid)) gen.if((0, codegen_1.not)(valid));\n\t\t}));\n\t\tcxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n\t}\n\texports.validateUnion = validateUnion;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js\nvar require_keyword = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst code_1 = require_code();\n\tconst errors_1 = require_errors();\n\tfunction macroKeywordCode(cxt, def) {\n\t\tconst { gen, keyword, schema, parentSchema, it } = cxt;\n\t\tconst macroSchema = def.macro.call(it.self, schema, parentSchema, it);\n\t\tconst schemaRef = useKeyword(gen, keyword, macroSchema);\n\t\tif (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true);\n\t\tconst valid = gen.name(\"valid\");\n\t\tcxt.subschema({\n\t\t\tschema: macroSchema,\n\t\t\tschemaPath: codegen_1.nil,\n\t\t\terrSchemaPath: `${it.errSchemaPath}/${keyword}`,\n\t\t\ttopSchemaRef: schemaRef,\n\t\t\tcompositeRule: true\n\t\t}, valid);\n\t\tcxt.pass(valid, () => cxt.error(true));\n\t}\n\texports.macroKeywordCode = macroKeywordCode;\n\tfunction funcKeywordCode(cxt, def) {\n\t\tvar _a;\n\t\tconst { gen, keyword, schema, parentSchema, $data, it } = cxt;\n\t\tcheckAsyncKeyword(it, def);\n\t\tconst validateRef = useKeyword(gen, keyword, !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate);\n\t\tconst valid = gen.let(\"valid\");\n\t\tcxt.block$data(valid, validateKeyword);\n\t\tcxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);\n\t\tfunction validateKeyword() {\n\t\t\tif (def.errors === false) {\n\t\t\t\tassignValid();\n\t\t\t\tif (def.modifying) modifyData(cxt);\n\t\t\t\treportErrs(() => cxt.error());\n\t\t\t} else {\n\t\t\t\tconst ruleErrs = def.async ? validateAsync() : validateSync();\n\t\t\t\tif (def.modifying) modifyData(cxt);\n\t\t\t\treportErrs(() => addErrs(cxt, ruleErrs));\n\t\t\t}\n\t\t}\n\t\tfunction validateAsync() {\n\t\t\tconst ruleErrs = gen.let(\"ruleErrs\", null);\n\t\t\tgen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));\n\t\t\treturn ruleErrs;\n\t\t}\n\t\tfunction validateSync() {\n\t\t\tconst validateErrs = (0, codegen_1._)`${validateRef}.errors`;\n\t\t\tgen.assign(validateErrs, null);\n\t\t\tassignValid(codegen_1.nil);\n\t\t\treturn validateErrs;\n\t\t}\n\t\tfunction assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {\n\t\t\tconst passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;\n\t\t\tconst passSchema = !(\"compile\" in def && !$data || def.schema === false);\n\t\t\tgen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);\n\t\t}\n\t\tfunction reportErrs(errors) {\n\t\t\tvar _a$1;\n\t\t\tgen.if((0, codegen_1.not)((_a$1 = def.valid) !== null && _a$1 !== void 0 ? _a$1 : valid), errors);\n\t\t}\n\t}\n\texports.funcKeywordCode = funcKeywordCode;\n\tfunction modifyData(cxt) {\n\t\tconst { gen, data, it } = cxt;\n\t\tgen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));\n\t}\n\tfunction addErrs(cxt, errs) {\n\t\tconst { gen } = cxt;\n\t\tgen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {\n\t\t\tgen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);\n\t\t\t(0, errors_1.extendErrors)(cxt);\n\t\t}, () => cxt.error());\n\t}\n\tfunction checkAsyncKeyword({ schemaEnv }, def) {\n\t\tif (def.async && !schemaEnv.$async) throw new Error(\"async keyword in sync schema\");\n\t}\n\tfunction useKeyword(gen, keyword, result) {\n\t\tif (result === void 0) throw new Error(`keyword \"${keyword}\" failed to compile`);\n\t\treturn gen.scopeValue(\"keyword\", typeof result == \"function\" ? { ref: result } : {\n\t\t\tref: result,\n\t\t\tcode: (0, codegen_1.stringify)(result)\n\t\t});\n\t}\n\tfunction validSchemaType(schema, schemaType, allowUndefined = false) {\n\t\treturn !schemaType.length || schemaType.some((st) => st === \"array\" ? Array.isArray(schema) : st === \"object\" ? schema && typeof schema == \"object\" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == \"undefined\");\n\t}\n\texports.validSchemaType = validSchemaType;\n\tfunction validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {\n\t\t/* istanbul ignore if */\n\t\tif (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) throw new Error(\"ajv implementation error\");\n\t\tconst deps = def.dependencies;\n\t\tif (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(\",\")}`);\n\t\tif (def.validateSchema) {\n\t\t\tif (!def.validateSchema(schema[keyword])) {\n\t\t\t\tconst msg = `keyword \"${keyword}\" value is invalid at path \"${errSchemaPath}\": ` + self.errorsText(def.validateSchema.errors);\n\t\t\t\tif (opts.validateSchema === \"log\") self.logger.error(msg);\n\t\t\t\telse throw new Error(msg);\n\t\t\t}\n\t\t}\n\t}\n\texports.validateKeywordUsage = validateKeywordUsage;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js\nvar require_subschema = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tfunction getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {\n\t\tif (keyword !== void 0 && schema !== void 0) throw new Error(\"both \\\"keyword\\\" and \\\"schema\\\" passed, only one allowed\");\n\t\tif (keyword !== void 0) {\n\t\t\tconst sch = it.schema[keyword];\n\t\t\treturn schemaProp === void 0 ? {\n\t\t\t\tschema: sch,\n\t\t\t\tschemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,\n\t\t\t\terrSchemaPath: `${it.errSchemaPath}/${keyword}`\n\t\t\t} : {\n\t\t\t\tschema: sch[schemaProp],\n\t\t\t\tschemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,\n\t\t\t\terrSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`\n\t\t\t};\n\t\t}\n\t\tif (schema !== void 0) {\n\t\t\tif (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) throw new Error(\"\\\"schemaPath\\\", \\\"errSchemaPath\\\" and \\\"topSchemaRef\\\" are required with \\\"schema\\\"\");\n\t\t\treturn {\n\t\t\t\tschema,\n\t\t\t\tschemaPath,\n\t\t\t\ttopSchemaRef,\n\t\t\t\terrSchemaPath\n\t\t\t};\n\t\t}\n\t\tthrow new Error(\"either \\\"keyword\\\" or \\\"schema\\\" must be passed\");\n\t}\n\texports.getSubschema = getSubschema;\n\tfunction extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {\n\t\tif (data !== void 0 && dataProp !== void 0) throw new Error(\"both \\\"data\\\" and \\\"dataProp\\\" passed, only one allowed\");\n\t\tconst { gen } = it;\n\t\tif (dataProp !== void 0) {\n\t\t\tconst { errorPath, dataPathArr, opts } = it;\n\t\t\tdataContextProps(gen.let(\"data\", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true));\n\t\t\tsubschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;\n\t\t\tsubschema.parentDataProperty = (0, codegen_1._)`${dataProp}`;\n\t\t\tsubschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];\n\t\t}\n\t\tif (data !== void 0) {\n\t\t\tdataContextProps(data instanceof codegen_1.Name ? data : gen.let(\"data\", data, true));\n\t\t\tif (propertyName !== void 0) subschema.propertyName = propertyName;\n\t\t}\n\t\tif (dataTypes) subschema.dataTypes = dataTypes;\n\t\tfunction dataContextProps(_nextData) {\n\t\t\tsubschema.data = _nextData;\n\t\t\tsubschema.dataLevel = it.dataLevel + 1;\n\t\t\tsubschema.dataTypes = [];\n\t\t\tit.definedProperties = /* @__PURE__ */ new Set();\n\t\t\tsubschema.parentData = it.data;\n\t\t\tsubschema.dataNames = [...it.dataNames, _nextData];\n\t\t}\n\t}\n\texports.extendSubschemaData = extendSubschemaData;\n\tfunction extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {\n\t\tif (compositeRule !== void 0) subschema.compositeRule = compositeRule;\n\t\tif (createErrors !== void 0) subschema.createErrors = createErrors;\n\t\tif (allErrors !== void 0) subschema.allErrors = allErrors;\n\t\tsubschema.jtdDiscriminator = jtdDiscriminator;\n\t\tsubschema.jtdMetadata = jtdMetadata;\n\t}\n\texports.extendSubschemaMode = extendSubschemaMode;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js\nvar require_fast_deep_equal = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = function equal(a, b) {\n\t\tif (a === b) return true;\n\t\tif (a && b && typeof a == \"object\" && typeof b == \"object\") {\n\t\t\tif (a.constructor !== b.constructor) return false;\n\t\t\tvar length, i, keys;\n\t\t\tif (Array.isArray(a)) {\n\t\t\t\tlength = a.length;\n\t\t\t\tif (length != b.length) return false;\n\t\t\t\tfor (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n\t\t\tif (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n\t\t\tif (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\t\t\tkeys = Object.keys(a);\n\t\t\tlength = keys.length;\n\t\t\tif (length !== Object.keys(b).length) return false;\n\t\t\tfor (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\t\t\tfor (i = length; i-- !== 0;) {\n\t\t\t\tvar key = keys[i];\n\t\t\t\tif (!equal(a[key], b[key])) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn a !== a && b !== b;\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js\nvar require_json_schema_traverse = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tvar traverse = module.exports = function(schema, opts, cb) {\n\t\tif (typeof opts == \"function\") {\n\t\t\tcb = opts;\n\t\t\topts = {};\n\t\t}\n\t\tcb = opts.cb || cb;\n\t\tvar pre = typeof cb == \"function\" ? cb : cb.pre || function() {};\n\t\tvar post = cb.post || function() {};\n\t\t_traverse(opts, pre, post, schema, \"\", schema);\n\t};\n\ttraverse.keywords = {\n\t\tadditionalItems: true,\n\t\titems: true,\n\t\tcontains: true,\n\t\tadditionalProperties: true,\n\t\tpropertyNames: true,\n\t\tnot: true,\n\t\tif: true,\n\t\tthen: true,\n\t\telse: true\n\t};\n\ttraverse.arrayKeywords = {\n\t\titems: true,\n\t\tallOf: true,\n\t\tanyOf: true,\n\t\toneOf: true\n\t};\n\ttraverse.propsKeywords = {\n\t\t$defs: true,\n\t\tdefinitions: true,\n\t\tproperties: true,\n\t\tpatternProperties: true,\n\t\tdependencies: true\n\t};\n\ttraverse.skipKeywords = {\n\t\tdefault: true,\n\t\tenum: true,\n\t\tconst: true,\n\t\trequired: true,\n\t\tmaximum: true,\n\t\tminimum: true,\n\t\texclusiveMaximum: true,\n\t\texclusiveMinimum: true,\n\t\tmultipleOf: true,\n\t\tmaxLength: true,\n\t\tminLength: true,\n\t\tpattern: true,\n\t\tformat: true,\n\t\tmaxItems: true,\n\t\tminItems: true,\n\t\tuniqueItems: true,\n\t\tmaxProperties: true,\n\t\tminProperties: true\n\t};\n\tfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n\t\tif (schema && typeof schema == \"object\" && !Array.isArray(schema)) {\n\t\t\tpre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n\t\t\tfor (var key in schema) {\n\t\t\t\tvar sch = schema[key];\n\t\t\t\tif (Array.isArray(sch)) {\n\t\t\t\t\tif (key in traverse.arrayKeywords) for (var i = 0; i < sch.length; i++) _traverse(opts, pre, post, sch[i], jsonPtr + \"/\" + key + \"/\" + i, rootSchema, jsonPtr, key, schema, i);\n\t\t\t\t} else if (key in traverse.propsKeywords) {\n\t\t\t\t\tif (sch && typeof sch == \"object\") for (var prop in sch) _traverse(opts, pre, post, sch[prop], jsonPtr + \"/\" + key + \"/\" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n\t\t\t\t} else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) _traverse(opts, pre, post, sch, jsonPtr + \"/\" + key, rootSchema, jsonPtr, key, schema);\n\t\t\t}\n\t\t\tpost(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n\t\t}\n\t}\n\tfunction escapeJsonPtr(str) {\n\t\treturn str.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js\nvar require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;\n\tconst util_1 = require_util();\n\tconst equal = require_fast_deep_equal();\n\tconst traverse = require_json_schema_traverse();\n\tconst SIMPLE_INLINED = new Set([\n\t\t\"type\",\n\t\t\"format\",\n\t\t\"pattern\",\n\t\t\"maxLength\",\n\t\t\"minLength\",\n\t\t\"maxProperties\",\n\t\t\"minProperties\",\n\t\t\"maxItems\",\n\t\t\"minItems\",\n\t\t\"maximum\",\n\t\t\"minimum\",\n\t\t\"uniqueItems\",\n\t\t\"multipleOf\",\n\t\t\"required\",\n\t\t\"enum\",\n\t\t\"const\"\n\t]);\n\tfunction inlineRef(schema, limit = true) {\n\t\tif (typeof schema == \"boolean\") return true;\n\t\tif (limit === true) return !hasRef(schema);\n\t\tif (!limit) return false;\n\t\treturn countKeys(schema) <= limit;\n\t}\n\texports.inlineRef = inlineRef;\n\tconst REF_KEYWORDS = new Set([\n\t\t\"$ref\",\n\t\t\"$recursiveRef\",\n\t\t\"$recursiveAnchor\",\n\t\t\"$dynamicRef\",\n\t\t\"$dynamicAnchor\"\n\t]);\n\tfunction hasRef(schema) {\n\t\tfor (const key in schema) {\n\t\t\tif (REF_KEYWORDS.has(key)) return true;\n\t\t\tconst sch = schema[key];\n\t\t\tif (Array.isArray(sch) && sch.some(hasRef)) return true;\n\t\t\tif (typeof sch == \"object\" && hasRef(sch)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tfunction countKeys(schema) {\n\t\tlet count = 0;\n\t\tfor (const key in schema) {\n\t\t\tif (key === \"$ref\") return Infinity;\n\t\t\tcount++;\n\t\t\tif (SIMPLE_INLINED.has(key)) continue;\n\t\t\tif (typeof schema[key] == \"object\") (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));\n\t\t\tif (count === Infinity) return Infinity;\n\t\t}\n\t\treturn count;\n\t}\n\tfunction getFullPath(resolver, id = \"\", normalize) {\n\t\tif (normalize !== false) id = normalizeId(id);\n\t\treturn _getFullPath(resolver, resolver.parse(id));\n\t}\n\texports.getFullPath = getFullPath;\n\tfunction _getFullPath(resolver, p) {\n\t\treturn resolver.serialize(p).split(\"#\")[0] + \"#\";\n\t}\n\texports._getFullPath = _getFullPath;\n\tconst TRAILING_SLASH_HASH = /#\\/?$/;\n\tfunction normalizeId(id) {\n\t\treturn id ? id.replace(TRAILING_SLASH_HASH, \"\") : \"\";\n\t}\n\texports.normalizeId = normalizeId;\n\tfunction resolveUrl(resolver, baseId, id) {\n\t\tid = normalizeId(id);\n\t\treturn resolver.resolve(baseId, id);\n\t}\n\texports.resolveUrl = resolveUrl;\n\tconst ANCHOR = /^[a-z_][-a-z0-9._]*$/i;\n\tfunction getSchemaRefs(schema, baseId) {\n\t\tif (typeof schema == \"boolean\") return {};\n\t\tconst { schemaId, uriResolver } = this.opts;\n\t\tconst schId = normalizeId(schema[schemaId] || baseId);\n\t\tconst baseIds = { \"\": schId };\n\t\tconst pathPrefix = getFullPath(uriResolver, schId, false);\n\t\tconst localRefs = {};\n\t\tconst schemaRefs = /* @__PURE__ */ new Set();\n\t\ttraverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {\n\t\t\tif (parentJsonPtr === void 0) return;\n\t\t\tconst fullPath = pathPrefix + jsonPtr;\n\t\t\tlet innerBaseId = baseIds[parentJsonPtr];\n\t\t\tif (typeof sch[schemaId] == \"string\") innerBaseId = addRef.call(this, sch[schemaId]);\n\t\t\taddAnchor.call(this, sch.$anchor);\n\t\t\taddAnchor.call(this, sch.$dynamicAnchor);\n\t\t\tbaseIds[jsonPtr] = innerBaseId;\n\t\t\tfunction addRef(ref) {\n\t\t\t\tconst _resolve = this.opts.uriResolver.resolve;\n\t\t\t\tref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);\n\t\t\t\tif (schemaRefs.has(ref)) throw ambiguos(ref);\n\t\t\t\tschemaRefs.add(ref);\n\t\t\t\tlet schOrRef = this.refs[ref];\n\t\t\t\tif (typeof schOrRef == \"string\") schOrRef = this.refs[schOrRef];\n\t\t\t\tif (typeof schOrRef == \"object\") checkAmbiguosRef(sch, schOrRef.schema, ref);\n\t\t\t\telse if (ref !== normalizeId(fullPath)) if (ref[0] === \"#\") {\n\t\t\t\t\tcheckAmbiguosRef(sch, localRefs[ref], ref);\n\t\t\t\t\tlocalRefs[ref] = sch;\n\t\t\t\t} else this.refs[ref] = fullPath;\n\t\t\t\treturn ref;\n\t\t\t}\n\t\t\tfunction addAnchor(anchor) {\n\t\t\t\tif (typeof anchor == \"string\") {\n\t\t\t\t\tif (!ANCHOR.test(anchor)) throw new Error(`invalid anchor \"${anchor}\"`);\n\t\t\t\t\taddRef.call(this, `#${anchor}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn localRefs;\n\t\tfunction checkAmbiguosRef(sch1, sch2, ref) {\n\t\t\tif (sch2 !== void 0 && !equal(sch1, sch2)) throw ambiguos(ref);\n\t\t}\n\t\tfunction ambiguos(ref) {\n\t\t\treturn /* @__PURE__ */ new Error(`reference \"${ref}\" resolves to more than one schema`);\n\t\t}\n\t}\n\texports.getSchemaRefs = getSchemaRefs;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js\nvar require_validate = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;\n\tconst boolSchema_1 = require_boolSchema();\n\tconst dataType_1 = require_dataType();\n\tconst applicability_1 = require_applicability();\n\tconst dataType_2 = require_dataType();\n\tconst defaults_1 = require_defaults();\n\tconst keyword_1 = require_keyword();\n\tconst subschema_1 = require_subschema();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst resolve_1 = require_resolve();\n\tconst util_1 = require_util();\n\tconst errors_1 = require_errors();\n\tfunction validateFunctionCode(it) {\n\t\tif (isSchemaObj(it)) {\n\t\t\tcheckKeywords(it);\n\t\t\tif (schemaCxtHasRules(it)) {\n\t\t\t\ttopSchemaObjCode(it);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tvalidateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));\n\t}\n\texports.validateFunctionCode = validateFunctionCode;\n\tfunction validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {\n\t\tif (opts.code.es5) gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {\n\t\t\tgen.code((0, codegen_1._)`\"use strict\"; ${funcSourceUrl(schema, opts)}`);\n\t\t\tdestructureValCxtES5(gen, opts);\n\t\t\tgen.code(body);\n\t\t});\n\t\telse gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));\n\t}\n\tfunction destructureValCxt(opts) {\n\t\treturn (0, codegen_1._)`{${names_1.default.instancePath}=\"\", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;\n\t}\n\tfunction destructureValCxtES5(gen, opts) {\n\t\tgen.if(names_1.default.valCxt, () => {\n\t\t\tgen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);\n\t\t\tgen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`);\n\t\t\tgen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);\n\t\t\tgen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`);\n\t\t\tif (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);\n\t\t}, () => {\n\t\t\tgen.var(names_1.default.instancePath, (0, codegen_1._)`\"\"`);\n\t\t\tgen.var(names_1.default.parentData, (0, codegen_1._)`undefined`);\n\t\t\tgen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`);\n\t\t\tgen.var(names_1.default.rootData, names_1.default.data);\n\t\t\tif (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);\n\t\t});\n\t}\n\tfunction topSchemaObjCode(it) {\n\t\tconst { schema, opts, gen } = it;\n\t\tvalidateFunction(it, () => {\n\t\t\tif (opts.$comment && schema.$comment) commentKeyword(it);\n\t\t\tcheckNoDefault(it);\n\t\t\tgen.let(names_1.default.vErrors, null);\n\t\t\tgen.let(names_1.default.errors, 0);\n\t\t\tif (opts.unevaluated) resetEvaluated(it);\n\t\t\ttypeAndKeywords(it);\n\t\t\treturnResults(it);\n\t\t});\n\t}\n\tfunction resetEvaluated(it) {\n\t\tconst { gen, validateName } = it;\n\t\tit.evaluated = gen.const(\"evaluated\", (0, codegen_1._)`${validateName}.evaluated`);\n\t\tgen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));\n\t\tgen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));\n\t}\n\tfunction funcSourceUrl(schema, opts) {\n\t\tconst schId = typeof schema == \"object\" && schema[opts.schemaId];\n\t\treturn schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;\n\t}\n\tfunction subschemaCode(it, valid) {\n\t\tif (isSchemaObj(it)) {\n\t\t\tcheckKeywords(it);\n\t\t\tif (schemaCxtHasRules(it)) {\n\t\t\t\tsubSchemaObjCode(it, valid);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t(0, boolSchema_1.boolOrEmptySchema)(it, valid);\n\t}\n\tfunction schemaCxtHasRules({ schema, self }) {\n\t\tif (typeof schema == \"boolean\") return !schema;\n\t\tfor (const key in schema) if (self.RULES.all[key]) return true;\n\t\treturn false;\n\t}\n\tfunction isSchemaObj(it) {\n\t\treturn typeof it.schema != \"boolean\";\n\t}\n\tfunction subSchemaObjCode(it, valid) {\n\t\tconst { schema, gen, opts } = it;\n\t\tif (opts.$comment && schema.$comment) commentKeyword(it);\n\t\tupdateContext(it);\n\t\tcheckAsyncSchema(it);\n\t\tconst errsCount = gen.const(\"_errs\", names_1.default.errors);\n\t\ttypeAndKeywords(it, errsCount);\n\t\tgen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);\n\t}\n\tfunction checkKeywords(it) {\n\t\t(0, util_1.checkUnknownRules)(it);\n\t\tcheckRefsAndKeywords(it);\n\t}\n\tfunction typeAndKeywords(it, errsCount) {\n\t\tif (it.opts.jtd) return schemaKeywords(it, [], false, errsCount);\n\t\tconst types = (0, dataType_1.getSchemaTypes)(it.schema);\n\t\tschemaKeywords(it, types, !(0, dataType_1.coerceAndCheckDataType)(it, types), errsCount);\n\t}\n\tfunction checkRefsAndKeywords(it) {\n\t\tconst { schema, errSchemaPath, opts, self } = it;\n\t\tif (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) self.logger.warn(`$ref: keywords ignored in schema at path \"${errSchemaPath}\"`);\n\t}\n\tfunction checkNoDefault(it) {\n\t\tconst { schema, opts } = it;\n\t\tif (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) (0, util_1.checkStrictMode)(it, \"default is ignored in the schema root\");\n\t}\n\tfunction updateContext(it) {\n\t\tconst schId = it.schema[it.opts.schemaId];\n\t\tif (schId) it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);\n\t}\n\tfunction checkAsyncSchema(it) {\n\t\tif (it.schema.$async && !it.schemaEnv.$async) throw new Error(\"async schema in sync schema\");\n\t}\n\tfunction commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {\n\t\tconst msg = schema.$comment;\n\t\tif (opts.$comment === true) gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);\n\t\telse if (typeof opts.$comment == \"function\") {\n\t\t\tconst schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`;\n\t\t\tconst rootName = gen.scopeValue(\"root\", { ref: schemaEnv.root });\n\t\t\tgen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);\n\t\t}\n\t}\n\tfunction returnResults(it) {\n\t\tconst { gen, schemaEnv, validateName, ValidationError, opts } = it;\n\t\tif (schemaEnv.$async) gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`));\n\t\telse {\n\t\t\tgen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors);\n\t\t\tif (opts.unevaluated) assignEvaluated(it);\n\t\t\tgen.return((0, codegen_1._)`${names_1.default.errors} === 0`);\n\t\t}\n\t}\n\tfunction assignEvaluated({ gen, evaluated, props, items }) {\n\t\tif (props instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.props`, props);\n\t\tif (items instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.items`, items);\n\t}\n\tfunction schemaKeywords(it, types, typeErrors, errsCount) {\n\t\tconst { gen, schema, data, allErrors, opts, self } = it;\n\t\tconst { RULES } = self;\n\t\tif (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {\n\t\t\tgen.block(() => keywordCode(it, \"$ref\", RULES.all.$ref.definition));\n\t\t\treturn;\n\t\t}\n\t\tif (!opts.jtd) checkStrictTypes(it, types);\n\t\tgen.block(() => {\n\t\t\tfor (const group of RULES.rules) groupKeywords(group);\n\t\t\tgroupKeywords(RULES.post);\n\t\t});\n\t\tfunction groupKeywords(group) {\n\t\t\tif (!(0, applicability_1.shouldUseGroup)(schema, group)) return;\n\t\t\tif (group.type) {\n\t\t\t\tgen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));\n\t\t\t\titerateKeywords(it, group);\n\t\t\t\tif (types.length === 1 && types[0] === group.type && typeErrors) {\n\t\t\t\t\tgen.else();\n\t\t\t\t\t(0, dataType_2.reportTypeError)(it);\n\t\t\t\t}\n\t\t\t\tgen.endIf();\n\t\t\t} else iterateKeywords(it, group);\n\t\t\tif (!allErrors) gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);\n\t\t}\n\t}\n\tfunction iterateKeywords(it, group) {\n\t\tconst { gen, schema, opts: { useDefaults } } = it;\n\t\tif (useDefaults) (0, defaults_1.assignDefaults)(it, group.type);\n\t\tgen.block(() => {\n\t\t\tfor (const rule of group.rules) if ((0, applicability_1.shouldUseRule)(schema, rule)) keywordCode(it, rule.keyword, rule.definition, group.type);\n\t\t});\n\t}\n\tfunction checkStrictTypes(it, types) {\n\t\tif (it.schemaEnv.meta || !it.opts.strictTypes) return;\n\t\tcheckContextTypes(it, types);\n\t\tif (!it.opts.allowUnionTypes) checkMultipleTypes(it, types);\n\t\tcheckKeywordTypes(it, it.dataTypes);\n\t}\n\tfunction checkContextTypes(it, types) {\n\t\tif (!types.length) return;\n\t\tif (!it.dataTypes.length) {\n\t\t\tit.dataTypes = types;\n\t\t\treturn;\n\t\t}\n\t\ttypes.forEach((t) => {\n\t\t\tif (!includesType(it.dataTypes, t)) strictTypesError(it, `type \"${t}\" not allowed by context \"${it.dataTypes.join(\",\")}\"`);\n\t\t});\n\t\tnarrowSchemaTypes(it, types);\n\t}\n\tfunction checkMultipleTypes(it, ts) {\n\t\tif (ts.length > 1 && !(ts.length === 2 && ts.includes(\"null\"))) strictTypesError(it, \"use allowUnionTypes to allow union type keyword\");\n\t}\n\tfunction checkKeywordTypes(it, ts) {\n\t\tconst rules = it.self.RULES.all;\n\t\tfor (const keyword in rules) {\n\t\t\tconst rule = rules[keyword];\n\t\t\tif (typeof rule == \"object\" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {\n\t\t\t\tconst { type } = rule.definition;\n\t\t\t\tif (type.length && !type.some((t) => hasApplicableType(ts, t))) strictTypesError(it, `missing type \"${type.join(\",\")}\" for keyword \"${keyword}\"`);\n\t\t\t}\n\t\t}\n\t}\n\tfunction hasApplicableType(schTs, kwdT) {\n\t\treturn schTs.includes(kwdT) || kwdT === \"number\" && schTs.includes(\"integer\");\n\t}\n\tfunction includesType(ts, t) {\n\t\treturn ts.includes(t) || t === \"integer\" && ts.includes(\"number\");\n\t}\n\tfunction narrowSchemaTypes(it, withTypes) {\n\t\tconst ts = [];\n\t\tfor (const t of it.dataTypes) if (includesType(withTypes, t)) ts.push(t);\n\t\telse if (withTypes.includes(\"integer\") && t === \"number\") ts.push(\"integer\");\n\t\tit.dataTypes = ts;\n\t}\n\tfunction strictTypesError(it, msg) {\n\t\tconst schemaPath = it.schemaEnv.baseId + it.errSchemaPath;\n\t\tmsg += ` at \"${schemaPath}\" (strictTypes)`;\n\t\t(0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);\n\t}\n\tvar KeywordCxt = class {\n\t\tconstructor(it, def, keyword) {\n\t\t\t(0, keyword_1.validateKeywordUsage)(it, def, keyword);\n\t\t\tthis.gen = it.gen;\n\t\t\tthis.allErrors = it.allErrors;\n\t\t\tthis.keyword = keyword;\n\t\t\tthis.data = it.data;\n\t\t\tthis.schema = it.schema[keyword];\n\t\t\tthis.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;\n\t\t\tthis.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);\n\t\t\tthis.schemaType = def.schemaType;\n\t\t\tthis.parentSchema = it.schema;\n\t\t\tthis.params = {};\n\t\t\tthis.it = it;\n\t\t\tthis.def = def;\n\t\t\tif (this.$data) this.schemaCode = it.gen.const(\"vSchema\", getData(this.$data, it));\n\t\t\telse {\n\t\t\t\tthis.schemaCode = this.schemaValue;\n\t\t\t\tif (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);\n\t\t\t}\n\t\t\tif (\"code\" in def ? def.trackErrors : def.errors !== false) this.errsCount = it.gen.const(\"_errs\", names_1.default.errors);\n\t\t}\n\t\tresult(condition, successAction, failAction) {\n\t\t\tthis.failResult((0, codegen_1.not)(condition), successAction, failAction);\n\t\t}\n\t\tfailResult(condition, successAction, failAction) {\n\t\t\tthis.gen.if(condition);\n\t\t\tif (failAction) failAction();\n\t\t\telse this.error();\n\t\t\tif (successAction) {\n\t\t\t\tthis.gen.else();\n\t\t\t\tsuccessAction();\n\t\t\t\tif (this.allErrors) this.gen.endIf();\n\t\t\t} else if (this.allErrors) this.gen.endIf();\n\t\t\telse this.gen.else();\n\t\t}\n\t\tpass(condition, failAction) {\n\t\t\tthis.failResult((0, codegen_1.not)(condition), void 0, failAction);\n\t\t}\n\t\tfail(condition) {\n\t\t\tif (condition === void 0) {\n\t\t\t\tthis.error();\n\t\t\t\tif (!this.allErrors) this.gen.if(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.gen.if(condition);\n\t\t\tthis.error();\n\t\t\tif (this.allErrors) this.gen.endIf();\n\t\t\telse this.gen.else();\n\t\t}\n\t\tfail$data(condition) {\n\t\t\tif (!this.$data) return this.fail(condition);\n\t\t\tconst { schemaCode } = this;\n\t\t\tthis.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);\n\t\t}\n\t\terror(append, errorParams, errorPaths) {\n\t\t\tif (errorParams) {\n\t\t\t\tthis.setParams(errorParams);\n\t\t\t\tthis._error(append, errorPaths);\n\t\t\t\tthis.setParams({});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(append, errorPaths);\n\t\t}\n\t\t_error(append, errorPaths) {\n\t\t\t(append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);\n\t\t}\n\t\t$dataError() {\n\t\t\t(0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);\n\t\t}\n\t\treset() {\n\t\t\tif (this.errsCount === void 0) throw new Error(\"add \\\"trackErrors\\\" to keyword definition\");\n\t\t\t(0, errors_1.resetErrorsCount)(this.gen, this.errsCount);\n\t\t}\n\t\tok(cond) {\n\t\t\tif (!this.allErrors) this.gen.if(cond);\n\t\t}\n\t\tsetParams(obj, assign) {\n\t\t\tif (assign) Object.assign(this.params, obj);\n\t\t\telse this.params = obj;\n\t\t}\n\t\tblock$data(valid, codeBlock, $dataValid = codegen_1.nil) {\n\t\t\tthis.gen.block(() => {\n\t\t\t\tthis.check$data(valid, $dataValid);\n\t\t\t\tcodeBlock();\n\t\t\t});\n\t\t}\n\t\tcheck$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {\n\t\t\tif (!this.$data) return;\n\t\t\tconst { gen, schemaCode, schemaType, def } = this;\n\t\t\tgen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid));\n\t\t\tif (valid !== codegen_1.nil) gen.assign(valid, true);\n\t\t\tif (schemaType.length || def.validateSchema) {\n\t\t\t\tgen.elseIf(this.invalid$data());\n\t\t\t\tthis.$dataError();\n\t\t\t\tif (valid !== codegen_1.nil) gen.assign(valid, false);\n\t\t\t}\n\t\t\tgen.else();\n\t\t}\n\t\tinvalid$data() {\n\t\t\tconst { gen, schemaCode, schemaType, def, it } = this;\n\t\t\treturn (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());\n\t\t\tfunction wrong$DataType() {\n\t\t\t\tif (schemaType.length) {\n\t\t\t\t\t/* istanbul ignore if */\n\t\t\t\t\tif (!(schemaCode instanceof codegen_1.Name)) throw new Error(\"ajv implementation error\");\n\t\t\t\t\tconst st = Array.isArray(schemaType) ? schemaType : [schemaType];\n\t\t\t\t\treturn (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;\n\t\t\t\t}\n\t\t\t\treturn codegen_1.nil;\n\t\t\t}\n\t\t\tfunction invalid$DataSchema() {\n\t\t\t\tif (def.validateSchema) {\n\t\t\t\t\tconst validateSchemaRef = gen.scopeValue(\"validate$data\", { ref: def.validateSchema });\n\t\t\t\t\treturn (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`;\n\t\t\t\t}\n\t\t\t\treturn codegen_1.nil;\n\t\t\t}\n\t\t}\n\t\tsubschema(appl, valid) {\n\t\t\tconst subschema = (0, subschema_1.getSubschema)(this.it, appl);\n\t\t\t(0, subschema_1.extendSubschemaData)(subschema, this.it, appl);\n\t\t\t(0, subschema_1.extendSubschemaMode)(subschema, appl);\n\t\t\tconst nextContext = {\n\t\t\t\t...this.it,\n\t\t\t\t...subschema,\n\t\t\t\titems: void 0,\n\t\t\t\tprops: void 0\n\t\t\t};\n\t\t\tsubschemaCode(nextContext, valid);\n\t\t\treturn nextContext;\n\t\t}\n\t\tmergeEvaluated(schemaCxt, toName) {\n\t\t\tconst { it, gen } = this;\n\t\t\tif (!it.opts.unevaluated) return;\n\t\t\tif (it.props !== true && schemaCxt.props !== void 0) it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);\n\t\t\tif (it.items !== true && schemaCxt.items !== void 0) it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);\n\t\t}\n\t\tmergeValidEvaluated(schemaCxt, valid) {\n\t\t\tconst { it, gen } = this;\n\t\t\tif (it.opts.unevaluated && (it.props !== true || it.items !== true)) {\n\t\t\t\tgen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t};\n\texports.KeywordCxt = KeywordCxt;\n\tfunction keywordCode(it, keyword, def, ruleType) {\n\t\tconst cxt = new KeywordCxt(it, def, keyword);\n\t\tif (\"code\" in def) def.code(cxt, ruleType);\n\t\telse if (cxt.$data && def.validate) (0, keyword_1.funcKeywordCode)(cxt, def);\n\t\telse if (\"macro\" in def) (0, keyword_1.macroKeywordCode)(cxt, def);\n\t\telse if (def.compile || def.validate) (0, keyword_1.funcKeywordCode)(cxt, def);\n\t}\n\tconst JSON_POINTER = /^\\/(?:[^~]|~0|~1)*$/;\n\tconst RELATIVE_JSON_POINTER = /^([0-9]+)(#|\\/(?:[^~]|~0|~1)*)?$/;\n\tfunction getData($data, { dataLevel, dataNames, dataPathArr }) {\n\t\tlet jsonPointer;\n\t\tlet data;\n\t\tif ($data === \"\") return names_1.default.rootData;\n\t\tif ($data[0] === \"/\") {\n\t\t\tif (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`);\n\t\t\tjsonPointer = $data;\n\t\t\tdata = names_1.default.rootData;\n\t\t} else {\n\t\t\tconst matches = RELATIVE_JSON_POINTER.exec($data);\n\t\t\tif (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`);\n\t\t\tconst up = +matches[1];\n\t\t\tjsonPointer = matches[2];\n\t\t\tif (jsonPointer === \"#\") {\n\t\t\t\tif (up >= dataLevel) throw new Error(errorMsg(\"property/index\", up));\n\t\t\t\treturn dataPathArr[dataLevel - up];\n\t\t\t}\n\t\t\tif (up > dataLevel) throw new Error(errorMsg(\"data\", up));\n\t\t\tdata = dataNames[dataLevel - up];\n\t\t\tif (!jsonPointer) return data;\n\t\t}\n\t\tlet expr = data;\n\t\tconst segments = jsonPointer.split(\"/\");\n\t\tfor (const segment of segments) if (segment) {\n\t\t\tdata = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;\n\t\t\texpr = (0, codegen_1._)`${expr} && ${data}`;\n\t\t}\n\t\treturn expr;\n\t\tfunction errorMsg(pointerType, up) {\n\t\t\treturn `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;\n\t\t}\n\t}\n\texports.getData = getData;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js\nvar require_validation_error = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tvar ValidationError = class extends Error {\n\t\tconstructor(errors) {\n\t\t\tsuper(\"validation failed\");\n\t\t\tthis.errors = errors;\n\t\t\tthis.ajv = this.validation = true;\n\t\t}\n\t};\n\texports.default = ValidationError;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js\nvar require_ref_error = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst resolve_1 = require_resolve();\n\tvar MissingRefError = class extends Error {\n\t\tconstructor(resolver, baseId, ref, msg) {\n\t\t\tsuper(msg || `can't resolve reference ${ref} from id ${baseId}`);\n\t\t\tthis.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);\n\t\t\tthis.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));\n\t\t}\n\t};\n\texports.default = MissingRefError;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js\nvar require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst validation_error_1 = require_validation_error();\n\tconst names_1 = require_names();\n\tconst resolve_1 = require_resolve();\n\tconst util_1 = require_util();\n\tconst validate_1 = require_validate();\n\tvar SchemaEnv = class {\n\t\tconstructor(env) {\n\t\t\tvar _a;\n\t\t\tthis.refs = {};\n\t\t\tthis.dynamicAnchors = {};\n\t\t\tlet schema;\n\t\t\tif (typeof env.schema == \"object\") schema = env.schema;\n\t\t\tthis.schema = env.schema;\n\t\t\tthis.schemaId = env.schemaId;\n\t\t\tthis.root = env.root || this;\n\t\t\tthis.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || \"$id\"]);\n\t\t\tthis.schemaPath = env.schemaPath;\n\t\t\tthis.localRefs = env.localRefs;\n\t\t\tthis.meta = env.meta;\n\t\t\tthis.$async = schema === null || schema === void 0 ? void 0 : schema.$async;\n\t\t\tthis.refs = {};\n\t\t}\n\t};\n\texports.SchemaEnv = SchemaEnv;\n\tfunction compileSchema(sch) {\n\t\tconst _sch = getCompilingSchema.call(this, sch);\n\t\tif (_sch) return _sch;\n\t\tconst rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId);\n\t\tconst { es5, lines } = this.opts.code;\n\t\tconst { ownProperties } = this.opts;\n\t\tconst gen = new codegen_1.CodeGen(this.scope, {\n\t\t\tes5,\n\t\t\tlines,\n\t\t\townProperties\n\t\t});\n\t\tlet _ValidationError;\n\t\tif (sch.$async) _ValidationError = gen.scopeValue(\"Error\", {\n\t\t\tref: validation_error_1.default,\n\t\t\tcode: (0, codegen_1._)`require(\"ajv/dist/runtime/validation_error\").default`\n\t\t});\n\t\tconst validateName = gen.scopeName(\"validate\");\n\t\tsch.validateName = validateName;\n\t\tconst schemaCxt = {\n\t\t\tgen,\n\t\t\tallErrors: this.opts.allErrors,\n\t\t\tdata: names_1.default.data,\n\t\t\tparentData: names_1.default.parentData,\n\t\t\tparentDataProperty: names_1.default.parentDataProperty,\n\t\t\tdataNames: [names_1.default.data],\n\t\t\tdataPathArr: [codegen_1.nil],\n\t\t\tdataLevel: 0,\n\t\t\tdataTypes: [],\n\t\t\tdefinedProperties: /* @__PURE__ */ new Set(),\n\t\t\ttopSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true ? {\n\t\t\t\tref: sch.schema,\n\t\t\t\tcode: (0, codegen_1.stringify)(sch.schema)\n\t\t\t} : { ref: sch.schema }),\n\t\t\tvalidateName,\n\t\t\tValidationError: _ValidationError,\n\t\t\tschema: sch.schema,\n\t\t\tschemaEnv: sch,\n\t\t\trootId,\n\t\t\tbaseId: sch.baseId || rootId,\n\t\t\tschemaPath: codegen_1.nil,\n\t\t\terrSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n\t\t\terrorPath: (0, codegen_1._)`\"\"`,\n\t\t\topts: this.opts,\n\t\t\tself: this\n\t\t};\n\t\tlet sourceCode;\n\t\ttry {\n\t\t\tthis._compilations.add(sch);\n\t\t\t(0, validate_1.validateFunctionCode)(schemaCxt);\n\t\t\tgen.optimize(this.opts.code.optimize);\n\t\t\tconst validateCode = gen.toString();\n\t\t\tsourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n\t\t\tif (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch);\n\t\t\tconst validate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode)(this, this.scope.get());\n\t\t\tthis.scope.value(validateName, { ref: validate });\n\t\t\tvalidate.errors = null;\n\t\t\tvalidate.schema = sch.schema;\n\t\t\tvalidate.schemaEnv = sch;\n\t\t\tif (sch.$async) validate.$async = true;\n\t\t\tif (this.opts.code.source === true) validate.source = {\n\t\t\t\tvalidateName,\n\t\t\t\tvalidateCode,\n\t\t\t\tscopeValues: gen._values\n\t\t\t};\n\t\t\tif (this.opts.unevaluated) {\n\t\t\t\tconst { props, items } = schemaCxt;\n\t\t\t\tvalidate.evaluated = {\n\t\t\t\t\tprops: props instanceof codegen_1.Name ? void 0 : props,\n\t\t\t\t\titems: items instanceof codegen_1.Name ? void 0 : items,\n\t\t\t\t\tdynamicProps: props instanceof codegen_1.Name,\n\t\t\t\t\tdynamicItems: items instanceof codegen_1.Name\n\t\t\t\t};\n\t\t\t\tif (validate.source) validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);\n\t\t\t}\n\t\t\tsch.validate = validate;\n\t\t\treturn sch;\n\t\t} catch (e) {\n\t\t\tdelete sch.validate;\n\t\t\tdelete sch.validateName;\n\t\t\tif (sourceCode) this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tthis._compilations.delete(sch);\n\t\t}\n\t}\n\texports.compileSchema = compileSchema;\n\tfunction resolveRef(root, baseId, ref) {\n\t\tvar _a;\n\t\tref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);\n\t\tconst schOrFunc = root.refs[ref];\n\t\tif (schOrFunc) return schOrFunc;\n\t\tlet _sch = resolve.call(this, root, ref);\n\t\tif (_sch === void 0) {\n\t\t\tconst schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];\n\t\t\tconst { schemaId } = this.opts;\n\t\t\tif (schema) _sch = new SchemaEnv({\n\t\t\t\tschema,\n\t\t\t\tschemaId,\n\t\t\t\troot,\n\t\t\t\tbaseId\n\t\t\t});\n\t\t}\n\t\tif (_sch === void 0) return;\n\t\treturn root.refs[ref] = inlineOrCompile.call(this, _sch);\n\t}\n\texports.resolveRef = resolveRef;\n\tfunction inlineOrCompile(sch) {\n\t\tif ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) return sch.schema;\n\t\treturn sch.validate ? sch : compileSchema.call(this, sch);\n\t}\n\tfunction getCompilingSchema(schEnv) {\n\t\tfor (const sch of this._compilations) if (sameSchemaEnv(sch, schEnv)) return sch;\n\t}\n\texports.getCompilingSchema = getCompilingSchema;\n\tfunction sameSchemaEnv(s1, s2) {\n\t\treturn s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;\n\t}\n\tfunction resolve(root, ref) {\n\t\tlet sch;\n\t\twhile (typeof (sch = this.refs[ref]) == \"string\") ref = sch;\n\t\treturn sch || this.schemas[ref] || resolveSchema.call(this, root, ref);\n\t}\n\tfunction resolveSchema(root, ref) {\n\t\tconst p = this.opts.uriResolver.parse(ref);\n\t\tconst refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);\n\t\tlet baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);\n\t\tif (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p, root);\n\t\tconst id = (0, resolve_1.normalizeId)(refPath);\n\t\tconst schOrRef = this.refs[id] || this.schemas[id];\n\t\tif (typeof schOrRef == \"string\") {\n\t\t\tconst sch = resolveSchema.call(this, root, schOrRef);\n\t\t\tif (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\") return;\n\t\t\treturn getJsonPointer.call(this, p, sch);\n\t\t}\n\t\tif (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\") return;\n\t\tif (!schOrRef.validate) compileSchema.call(this, schOrRef);\n\t\tif (id === (0, resolve_1.normalizeId)(ref)) {\n\t\t\tconst { schema } = schOrRef;\n\t\t\tconst { schemaId } = this.opts;\n\t\t\tconst schId = schema[schemaId];\n\t\t\tif (schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n\t\t\treturn new SchemaEnv({\n\t\t\t\tschema,\n\t\t\t\tschemaId,\n\t\t\t\troot,\n\t\t\t\tbaseId\n\t\t\t});\n\t\t}\n\t\treturn getJsonPointer.call(this, p, schOrRef);\n\t}\n\texports.resolveSchema = resolveSchema;\n\tconst PREVENT_SCOPE_CHANGE = new Set([\n\t\t\"properties\",\n\t\t\"patternProperties\",\n\t\t\"enum\",\n\t\t\"dependencies\",\n\t\t\"definitions\"\n\t]);\n\tfunction getJsonPointer(parsedRef, { baseId, schema, root }) {\n\t\tvar _a;\n\t\tif (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== \"/\") return;\n\t\tfor (const part of parsedRef.fragment.slice(1).split(\"/\")) {\n\t\t\tif (typeof schema === \"boolean\") return;\n\t\t\tconst partSchema = schema[(0, util_1.unescapeFragment)(part)];\n\t\t\tif (partSchema === void 0) return;\n\t\t\tschema = partSchema;\n\t\t\tconst schId = typeof schema === \"object\" && schema[this.opts.schemaId];\n\t\t\tif (!PREVENT_SCOPE_CHANGE.has(part) && schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n\t\t}\n\t\tlet env;\n\t\tif (typeof schema != \"boolean\" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {\n\t\t\tconst $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);\n\t\t\tenv = resolveSchema.call(this, root, $ref);\n\t\t}\n\t\tconst { schemaId } = this.opts;\n\t\tenv = env || new SchemaEnv({\n\t\t\tschema,\n\t\t\tschemaId,\n\t\t\troot,\n\t\t\tbaseId\n\t\t});\n\t\tif (env.schema !== env.root.schema) return env;\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.json\nvar require_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$id\": \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\",\n\t\t\"description\": \"Meta-schema for $data reference (JSON AnySchema extension proposal)\",\n\t\t\"type\": \"object\",\n\t\t\"required\": [\"$data\"],\n\t\t\"properties\": { \"$data\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"anyOf\": [{ \"format\": \"relative-json-pointer\" }, { \"format\": \"json-pointer\" }]\n\t\t} },\n\t\t\"additionalProperties\": false\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js\nvar require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\t/** @type {(value: string) => boolean} */\n\tconst isUUID = RegExp.prototype.test.bind(/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$/iu);\n\t/** @type {(value: string) => boolean} */\n\tconst isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$/u);\n\t/**\n\t* @param {Array<string>} input\n\t* @returns {string}\n\t*/\n\tfunction stringArrayToHexStripped(input) {\n\t\tlet acc = \"\";\n\t\tlet code = 0;\n\t\tlet i = 0;\n\t\tfor (i = 0; i < input.length; i++) {\n\t\t\tcode = input[i].charCodeAt(0);\n\t\t\tif (code === 48) continue;\n\t\t\tif (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return \"\";\n\t\t\tacc += input[i];\n\t\t\tbreak;\n\t\t}\n\t\tfor (i += 1; i < input.length; i++) {\n\t\t\tcode = input[i].charCodeAt(0);\n\t\t\tif (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return \"\";\n\t\t\tacc += input[i];\n\t\t}\n\t\treturn acc;\n\t}\n\t/**\n\t* @typedef {Object} GetIPV6Result\n\t* @property {boolean} error - Indicates if there was an error parsing the IPv6 address.\n\t* @property {string} address - The parsed IPv6 address.\n\t* @property {string} [zone] - The zone identifier, if present.\n\t*/\n\t/**\n\t* @param {string} value\n\t* @returns {boolean}\n\t*/\n\tconst nonSimpleDomain = RegExp.prototype.test.bind(/[^!\"$&'()*+,\\-.;=_`a-z{}~]/u);\n\t/**\n\t* @param {Array<string>} buffer\n\t* @returns {boolean}\n\t*/\n\tfunction consumeIsZone(buffer) {\n\t\tbuffer.length = 0;\n\t\treturn true;\n\t}\n\t/**\n\t* @param {Array<string>} buffer\n\t* @param {Array<string>} address\n\t* @param {GetIPV6Result} output\n\t* @returns {boolean}\n\t*/\n\tfunction consumeHextets(buffer, address, output) {\n\t\tif (buffer.length) {\n\t\t\tconst hex = stringArrayToHexStripped(buffer);\n\t\t\tif (hex !== \"\") address.push(hex);\n\t\t\telse {\n\t\t\t\toutput.error = true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbuffer.length = 0;\n\t\t}\n\t\treturn true;\n\t}\n\t/**\n\t* @param {string} input\n\t* @returns {GetIPV6Result}\n\t*/\n\tfunction getIPV6(input) {\n\t\tlet tokenCount = 0;\n\t\tconst output = {\n\t\t\terror: false,\n\t\t\taddress: \"\",\n\t\t\tzone: \"\"\n\t\t};\n\t\t/** @type {Array<string>} */\n\t\tconst address = [];\n\t\t/** @type {Array<string>} */\n\t\tconst buffer = [];\n\t\tlet endipv6Encountered = false;\n\t\tlet endIpv6 = false;\n\t\tlet consume = consumeHextets;\n\t\tfor (let i = 0; i < input.length; i++) {\n\t\t\tconst cursor = input[i];\n\t\t\tif (cursor === \"[\" || cursor === \"]\") continue;\n\t\t\tif (cursor === \":\") {\n\t\t\t\tif (endipv6Encountered === true) endIpv6 = true;\n\t\t\t\tif (!consume(buffer, address, output)) break;\n\t\t\t\tif (++tokenCount > 7) {\n\t\t\t\t\toutput.error = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (i > 0 && input[i - 1] === \":\") endipv6Encountered = true;\n\t\t\t\taddress.push(\":\");\n\t\t\t\tcontinue;\n\t\t\t} else if (cursor === \"%\") {\n\t\t\t\tif (!consume(buffer, address, output)) break;\n\t\t\t\tconsume = consumeIsZone;\n\t\t\t} else {\n\t\t\t\tbuffer.push(cursor);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (buffer.length) if (consume === consumeIsZone) output.zone = buffer.join(\"\");\n\t\telse if (endIpv6) address.push(buffer.join(\"\"));\n\t\telse address.push(stringArrayToHexStripped(buffer));\n\t\toutput.address = address.join(\"\");\n\t\treturn output;\n\t}\n\t/**\n\t* @typedef {Object} NormalizeIPv6Result\n\t* @property {string} host - The normalized host.\n\t* @property {string} [escapedHost] - The escaped host.\n\t* @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.\n\t*/\n\t/**\n\t* @param {string} host\n\t* @returns {NormalizeIPv6Result}\n\t*/\n\tfunction normalizeIPv6(host) {\n\t\tif (findToken(host, \":\") < 2) return {\n\t\t\thost,\n\t\t\tisIPV6: false\n\t\t};\n\t\tconst ipv6 = getIPV6(host);\n\t\tif (!ipv6.error) {\n\t\t\tlet newHost = ipv6.address;\n\t\t\tlet escapedHost = ipv6.address;\n\t\t\tif (ipv6.zone) {\n\t\t\t\tnewHost += \"%\" + ipv6.zone;\n\t\t\t\tescapedHost += \"%25\" + ipv6.zone;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\thost: newHost,\n\t\t\t\tisIPV6: true,\n\t\t\t\tescapedHost\n\t\t\t};\n\t\t} else return {\n\t\t\thost,\n\t\t\tisIPV6: false\n\t\t};\n\t}\n\t/**\n\t* @param {string} str\n\t* @param {string} token\n\t* @returns {number}\n\t*/\n\tfunction findToken(str, token) {\n\t\tlet ind = 0;\n\t\tfor (let i = 0; i < str.length; i++) if (str[i] === token) ind++;\n\t\treturn ind;\n\t}\n\t/**\n\t* @param {string} path\n\t* @returns {string}\n\t*\n\t* @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n\t*/\n\tfunction removeDotSegments(path) {\n\t\tlet input = path;\n\t\tconst output = [];\n\t\tlet nextSlash = -1;\n\t\tlet len = 0;\n\t\twhile (len = input.length) {\n\t\t\tif (len === 1) if (input === \".\") break;\n\t\t\telse if (input === \"/\") {\n\t\t\t\toutput.push(\"/\");\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\toutput.push(input);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (len === 2) {\n\t\t\t\tif (input[0] === \".\") {\n\t\t\t\t\tif (input[1] === \".\") break;\n\t\t\t\t\telse if (input[1] === \"/\") {\n\t\t\t\t\t\tinput = input.slice(2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (input[0] === \"/\") {\n\t\t\t\t\tif (input[1] === \".\" || input[1] === \"/\") {\n\t\t\t\t\t\toutput.push(\"/\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (len === 3) {\n\t\t\t\tif (input === \"/..\") {\n\t\t\t\t\tif (output.length !== 0) output.pop();\n\t\t\t\t\toutput.push(\"/\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (input[0] === \".\") {\n\t\t\t\tif (input[1] === \".\") {\n\t\t\t\t\tif (input[2] === \"/\") {\n\t\t\t\t\t\tinput = input.slice(3);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (input[1] === \"/\") {\n\t\t\t\t\tinput = input.slice(2);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (input[0] === \"/\") {\n\t\t\t\tif (input[1] === \".\") {\n\t\t\t\t\tif (input[2] === \"/\") {\n\t\t\t\t\t\tinput = input.slice(2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (input[2] === \".\") {\n\t\t\t\t\t\tif (input[3] === \"/\") {\n\t\t\t\t\t\t\tinput = input.slice(3);\n\t\t\t\t\t\t\tif (output.length !== 0) output.pop();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((nextSlash = input.indexOf(\"/\", 1)) === -1) {\n\t\t\t\toutput.push(input);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\toutput.push(input.slice(0, nextSlash));\n\t\t\t\tinput = input.slice(nextSlash);\n\t\t\t}\n\t\t}\n\t\treturn output.join(\"\");\n\t}\n\t/**\n\t* @param {import('../types/index').URIComponent} component\n\t* @param {boolean} esc\n\t* @returns {import('../types/index').URIComponent}\n\t*/\n\tfunction normalizeComponentEncoding(component, esc) {\n\t\tconst func = esc !== true ? escape : unescape;\n\t\tif (component.scheme !== void 0) component.scheme = func(component.scheme);\n\t\tif (component.userinfo !== void 0) component.userinfo = func(component.userinfo);\n\t\tif (component.host !== void 0) component.host = func(component.host);\n\t\tif (component.path !== void 0) component.path = func(component.path);\n\t\tif (component.query !== void 0) component.query = func(component.query);\n\t\tif (component.fragment !== void 0) component.fragment = func(component.fragment);\n\t\treturn component;\n\t}\n\t/**\n\t* @param {import('../types/index').URIComponent} component\n\t* @returns {string|undefined}\n\t*/\n\tfunction recomposeAuthority(component) {\n\t\tconst uriTokens = [];\n\t\tif (component.userinfo !== void 0) {\n\t\t\turiTokens.push(component.userinfo);\n\t\t\turiTokens.push(\"@\");\n\t\t}\n\t\tif (component.host !== void 0) {\n\t\t\tlet host = unescape(component.host);\n\t\t\tif (!isIPv4(host)) {\n\t\t\t\tconst ipV6res = normalizeIPv6(host);\n\t\t\t\tif (ipV6res.isIPV6 === true) host = `[${ipV6res.escapedHost}]`;\n\t\t\t\telse host = component.host;\n\t\t\t}\n\t\t\turiTokens.push(host);\n\t\t}\n\t\tif (typeof component.port === \"number\" || typeof component.port === \"string\") {\n\t\t\turiTokens.push(\":\");\n\t\t\turiTokens.push(String(component.port));\n\t\t}\n\t\treturn uriTokens.length ? uriTokens.join(\"\") : void 0;\n\t}\n\tmodule.exports = {\n\t\tnonSimpleDomain,\n\t\trecomposeAuthority,\n\t\tnormalizeComponentEncoding,\n\t\tremoveDotSegments,\n\t\tisIPv4,\n\t\tisUUID,\n\t\tnormalizeIPv6,\n\t\tstringArrayToHexStripped\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js\nvar require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst { isUUID } = require_utils();\n\tconst URN_REG = /([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)/iu;\n\tconst supportedSchemeNames = [\n\t\t\"http\",\n\t\t\"https\",\n\t\t\"ws\",\n\t\t\"wss\",\n\t\t\"urn\",\n\t\t\"urn:uuid\"\n\t];\n\t/** @typedef {supportedSchemeNames[number]} SchemeName */\n\t/**\n\t* @param {string} name\n\t* @returns {name is SchemeName}\n\t*/\n\tfunction isValidSchemeName(name) {\n\t\treturn supportedSchemeNames.indexOf(name) !== -1;\n\t}\n\t/**\n\t* @callback SchemeFn\n\t* @param {import('../types/index').URIComponent} component\n\t* @param {import('../types/index').Options} options\n\t* @returns {import('../types/index').URIComponent}\n\t*/\n\t/**\n\t* @typedef {Object} SchemeHandler\n\t* @property {SchemeName} scheme - The scheme name.\n\t* @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.\n\t* @property {SchemeFn} parse - Function to parse the URI component for this scheme.\n\t* @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.\n\t* @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.\n\t* @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.\n\t* @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.\n\t*/\n\t/**\n\t* @param {import('../types/index').URIComponent} wsComponent\n\t* @returns {boolean}\n\t*/\n\tfunction wsIsSecure(wsComponent) {\n\t\tif (wsComponent.secure === true) return true;\n\t\telse if (wsComponent.secure === false) return false;\n\t\telse if (wsComponent.scheme) return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === \"w\" || wsComponent.scheme[0] === \"W\") && (wsComponent.scheme[1] === \"s\" || wsComponent.scheme[1] === \"S\") && (wsComponent.scheme[2] === \"s\" || wsComponent.scheme[2] === \"S\");\n\t\telse return false;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction httpParse(component) {\n\t\tif (!component.host) component.error = component.error || \"HTTP URIs must have a host.\";\n\t\treturn component;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction httpSerialize(component) {\n\t\tconst secure = String(component.scheme).toLowerCase() === \"https\";\n\t\tif (component.port === (secure ? 443 : 80) || component.port === \"\") component.port = void 0;\n\t\tif (!component.path) component.path = \"/\";\n\t\treturn component;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction wsParse(wsComponent) {\n\t\twsComponent.secure = wsIsSecure(wsComponent);\n\t\twsComponent.resourceName = (wsComponent.path || \"/\") + (wsComponent.query ? \"?\" + wsComponent.query : \"\");\n\t\twsComponent.path = void 0;\n\t\twsComponent.query = void 0;\n\t\treturn wsComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction wsSerialize(wsComponent) {\n\t\tif (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === \"\") wsComponent.port = void 0;\n\t\tif (typeof wsComponent.secure === \"boolean\") {\n\t\t\twsComponent.scheme = wsComponent.secure ? \"wss\" : \"ws\";\n\t\t\twsComponent.secure = void 0;\n\t\t}\n\t\tif (wsComponent.resourceName) {\n\t\t\tconst [path, query] = wsComponent.resourceName.split(\"?\");\n\t\t\twsComponent.path = path && path !== \"/\" ? path : void 0;\n\t\t\twsComponent.query = query;\n\t\t\twsComponent.resourceName = void 0;\n\t\t}\n\t\twsComponent.fragment = void 0;\n\t\treturn wsComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnParse(urnComponent, options) {\n\t\tif (!urnComponent.path) {\n\t\t\turnComponent.error = \"URN can not be parsed\";\n\t\t\treturn urnComponent;\n\t\t}\n\t\tconst matches = urnComponent.path.match(URN_REG);\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponent.scheme || \"urn\";\n\t\t\turnComponent.nid = matches[1].toLowerCase();\n\t\t\turnComponent.nss = matches[2];\n\t\t\tconst schemeHandler = getSchemeHandler(`${scheme}:${options.nid || urnComponent.nid}`);\n\t\t\turnComponent.path = void 0;\n\t\t\tif (schemeHandler) urnComponent = schemeHandler.parse(urnComponent, options);\n\t\t} else urnComponent.error = urnComponent.error || \"URN can not be parsed.\";\n\t\treturn urnComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnSerialize(urnComponent, options) {\n\t\tif (urnComponent.nid === void 0) throw new Error(\"URN without nid cannot be serialized\");\n\t\tconst scheme = options.scheme || urnComponent.scheme || \"urn\";\n\t\tconst nid = urnComponent.nid.toLowerCase();\n\t\tconst schemeHandler = getSchemeHandler(`${scheme}:${options.nid || nid}`);\n\t\tif (schemeHandler) urnComponent = schemeHandler.serialize(urnComponent, options);\n\t\tconst uriComponent = urnComponent;\n\t\tconst nss = urnComponent.nss;\n\t\turiComponent.path = `${nid || options.nid}:${nss}`;\n\t\toptions.skipEscape = true;\n\t\treturn uriComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnuuidParse(urnComponent, options) {\n\t\tconst uuidComponent = urnComponent;\n\t\tuuidComponent.uuid = uuidComponent.nss;\n\t\tuuidComponent.nss = void 0;\n\t\tif (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) uuidComponent.error = uuidComponent.error || \"UUID is not valid.\";\n\t\treturn uuidComponent;\n\t}\n\t/** @type {SchemeFn} */\n\tfunction urnuuidSerialize(uuidComponent) {\n\t\tconst urnComponent = uuidComponent;\n\t\turnComponent.nss = (uuidComponent.uuid || \"\").toLowerCase();\n\t\treturn urnComponent;\n\t}\n\tconst http = {\n\t\tscheme: \"http\",\n\t\tdomainHost: true,\n\t\tparse: httpParse,\n\t\tserialize: httpSerialize\n\t};\n\tconst https = {\n\t\tscheme: \"https\",\n\t\tdomainHost: http.domainHost,\n\t\tparse: httpParse,\n\t\tserialize: httpSerialize\n\t};\n\tconst ws = {\n\t\tscheme: \"ws\",\n\t\tdomainHost: true,\n\t\tparse: wsParse,\n\t\tserialize: wsSerialize\n\t};\n\tconst wss = {\n\t\tscheme: \"wss\",\n\t\tdomainHost: ws.domainHost,\n\t\tparse: ws.parse,\n\t\tserialize: ws.serialize\n\t};\n\tconst urn = {\n\t\tscheme: \"urn\",\n\t\tparse: urnParse,\n\t\tserialize: urnSerialize,\n\t\tskipNormalize: true\n\t};\n\tconst urnuuid = {\n\t\tscheme: \"urn:uuid\",\n\t\tparse: urnuuidParse,\n\t\tserialize: urnuuidSerialize,\n\t\tskipNormalize: true\n\t};\n\tconst SCHEMES = {\n\t\thttp,\n\t\thttps,\n\t\tws,\n\t\twss,\n\t\turn,\n\t\t\"urn:uuid\": urnuuid\n\t};\n\tObject.setPrototypeOf(SCHEMES, null);\n\t/**\n\t* @param {string|undefined} scheme\n\t* @returns {SchemeHandler|undefined}\n\t*/\n\tfunction getSchemeHandler(scheme) {\n\t\treturn scheme && (SCHEMES[scheme] || SCHEMES[scheme.toLowerCase()]) || void 0;\n\t}\n\tmodule.exports = {\n\t\twsIsSecure,\n\t\tSCHEMES,\n\t\tisValidSchemeName,\n\t\tgetSchemeHandler\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js\nvar require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tconst { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();\n\tconst { SCHEMES, getSchemeHandler } = require_schemes();\n\t/**\n\t* @template {import('./types/index').URIComponent|string} T\n\t* @param {T} uri\n\t* @param {import('./types/index').Options} [options]\n\t* @returns {T}\n\t*/\n\tfunction normalize(uri, options) {\n\t\tif (typeof uri === \"string\") uri = serialize(parse(uri, options), options);\n\t\telse if (typeof uri === \"object\") uri = parse(serialize(uri, options), options);\n\t\treturn uri;\n\t}\n\t/**\n\t* @param {string} baseURI\n\t* @param {string} relativeURI\n\t* @param {import('./types/index').Options} [options]\n\t* @returns {string}\n\t*/\n\tfunction resolve(baseURI, relativeURI, options) {\n\t\tconst schemelessOptions = options ? Object.assign({ scheme: \"null\" }, options) : { scheme: \"null\" };\n\t\tconst resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);\n\t\tschemelessOptions.skipEscape = true;\n\t\treturn serialize(resolved, schemelessOptions);\n\t}\n\t/**\n\t* @param {import ('./types/index').URIComponent} base\n\t* @param {import ('./types/index').URIComponent} relative\n\t* @param {import('./types/index').Options} [options]\n\t* @param {boolean} [skipNormalization=false]\n\t* @returns {import ('./types/index').URIComponent}\n\t*/\n\tfunction resolveComponent(base, relative, options, skipNormalization) {\n\t\t/** @type {import('./types/index').URIComponent} */\n\t\tconst target = {};\n\t\tif (!skipNormalization) {\n\t\t\tbase = parse(serialize(base, options), options);\n\t\t\trelative = parse(serialize(relative, options), options);\n\t\t}\n\t\toptions = options || {};\n\t\tif (!options.tolerant && relative.scheme) {\n\t\t\ttarget.scheme = relative.scheme;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {\n\t\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\t\ttarget.host = relative.host;\n\t\t\t\ttarget.port = relative.port;\n\t\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\t\ttarget.query = relative.query;\n\t\t\t} else {\n\t\t\t\tif (!relative.path) {\n\t\t\t\t\ttarget.path = base.path;\n\t\t\t\t\tif (relative.query !== void 0) target.query = relative.query;\n\t\t\t\t\telse target.query = base.query;\n\t\t\t\t} else {\n\t\t\t\t\tif (relative.path[0] === \"/\") target.path = removeDotSegments(relative.path);\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) target.path = \"/\" + relative.path;\n\t\t\t\t\t\telse if (!base.path) target.path = relative.path;\n\t\t\t\t\t\telse target.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t\t}\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t}\n\t\t\t\ttarget.userinfo = base.userinfo;\n\t\t\t\ttarget.host = base.host;\n\t\t\t\ttarget.port = base.port;\n\t\t\t}\n\t\t\ttarget.scheme = base.scheme;\n\t\t}\n\t\ttarget.fragment = relative.fragment;\n\t\treturn target;\n\t}\n\t/**\n\t* @param {import ('./types/index').URIComponent|string} uriA\n\t* @param {import ('./types/index').URIComponent|string} uriB\n\t* @param {import ('./types/index').Options} options\n\t* @returns {boolean}\n\t*/\n\tfunction equal(uriA, uriB, options) {\n\t\tif (typeof uriA === \"string\") {\n\t\t\turiA = unescape(uriA);\n\t\t\turiA = serialize(normalizeComponentEncoding(parse(uriA, options), true), {\n\t\t\t\t...options,\n\t\t\t\tskipEscape: true\n\t\t\t});\n\t\t} else if (typeof uriA === \"object\") uriA = serialize(normalizeComponentEncoding(uriA, true), {\n\t\t\t...options,\n\t\t\tskipEscape: true\n\t\t});\n\t\tif (typeof uriB === \"string\") {\n\t\t\turiB = unescape(uriB);\n\t\t\turiB = serialize(normalizeComponentEncoding(parse(uriB, options), true), {\n\t\t\t\t...options,\n\t\t\t\tskipEscape: true\n\t\t\t});\n\t\t} else if (typeof uriB === \"object\") uriB = serialize(normalizeComponentEncoding(uriB, true), {\n\t\t\t...options,\n\t\t\tskipEscape: true\n\t\t});\n\t\treturn uriA.toLowerCase() === uriB.toLowerCase();\n\t}\n\t/**\n\t* @param {Readonly<import('./types/index').URIComponent>} cmpts\n\t* @param {import('./types/index').Options} [opts]\n\t* @returns {string}\n\t*/\n\tfunction serialize(cmpts, opts) {\n\t\tconst component = {\n\t\t\thost: cmpts.host,\n\t\t\tscheme: cmpts.scheme,\n\t\t\tuserinfo: cmpts.userinfo,\n\t\t\tport: cmpts.port,\n\t\t\tpath: cmpts.path,\n\t\t\tquery: cmpts.query,\n\t\t\tnid: cmpts.nid,\n\t\t\tnss: cmpts.nss,\n\t\t\tuuid: cmpts.uuid,\n\t\t\tfragment: cmpts.fragment,\n\t\t\treference: cmpts.reference,\n\t\t\tresourceName: cmpts.resourceName,\n\t\t\tsecure: cmpts.secure,\n\t\t\terror: \"\"\n\t\t};\n\t\tconst options = Object.assign({}, opts);\n\t\tconst uriTokens = [];\n\t\tconst schemeHandler = getSchemeHandler(options.scheme || component.scheme);\n\t\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);\n\t\tif (component.path !== void 0) if (!options.skipEscape) {\n\t\t\tcomponent.path = escape(component.path);\n\t\t\tif (component.scheme !== void 0) component.path = component.path.split(\"%3A\").join(\":\");\n\t\t} else component.path = unescape(component.path);\n\t\tif (options.reference !== \"suffix\" && component.scheme) uriTokens.push(component.scheme, \":\");\n\t\tconst authority = recomposeAuthority(component);\n\t\tif (authority !== void 0) {\n\t\t\tif (options.reference !== \"suffix\") uriTokens.push(\"//\");\n\t\t\turiTokens.push(authority);\n\t\t\tif (component.path && component.path[0] !== \"/\") uriTokens.push(\"/\");\n\t\t}\n\t\tif (component.path !== void 0) {\n\t\t\tlet s = component.path;\n\t\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) s = removeDotSegments(s);\n\t\t\tif (authority === void 0 && s[0] === \"/\" && s[1] === \"/\") s = \"/%2F\" + s.slice(2);\n\t\t\turiTokens.push(s);\n\t\t}\n\t\tif (component.query !== void 0) uriTokens.push(\"?\", component.query);\n\t\tif (component.fragment !== void 0) uriTokens.push(\"#\", component.fragment);\n\t\treturn uriTokens.join(\"\");\n\t}\n\tconst URI_PARSE = /^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?/u;\n\t/**\n\t* @param {string} uri\n\t* @param {import('./types/index').Options} [opts]\n\t* @returns\n\t*/\n\tfunction parse(uri, opts) {\n\t\tconst options = Object.assign({}, opts);\n\t\t/** @type {import('./types/index').URIComponent} */\n\t\tconst parsed = {\n\t\t\tscheme: void 0,\n\t\t\tuserinfo: void 0,\n\t\t\thost: \"\",\n\t\t\tport: void 0,\n\t\t\tpath: \"\",\n\t\t\tquery: void 0,\n\t\t\tfragment: void 0\n\t\t};\n\t\tlet isIP = false;\n\t\tif (options.reference === \"suffix\") if (options.scheme) uri = options.scheme + \":\" + uri;\n\t\telse uri = \"//\" + uri;\n\t\tconst matches = uri.match(URI_PARSE);\n\t\tif (matches) {\n\t\t\tparsed.scheme = matches[1];\n\t\t\tparsed.userinfo = matches[3];\n\t\t\tparsed.host = matches[4];\n\t\t\tparsed.port = parseInt(matches[5], 10);\n\t\t\tparsed.path = matches[6] || \"\";\n\t\t\tparsed.query = matches[7];\n\t\t\tparsed.fragment = matches[8];\n\t\t\tif (isNaN(parsed.port)) parsed.port = matches[5];\n\t\t\tif (parsed.host) if (isIPv4(parsed.host) === false) {\n\t\t\t\tconst ipv6result = normalizeIPv6(parsed.host);\n\t\t\t\tparsed.host = ipv6result.host.toLowerCase();\n\t\t\t\tisIP = ipv6result.isIPV6;\n\t\t\t} else isIP = true;\n\t\t\tif (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) parsed.reference = \"same-document\";\n\t\t\telse if (parsed.scheme === void 0) parsed.reference = \"relative\";\n\t\t\telse if (parsed.fragment === void 0) parsed.reference = \"absolute\";\n\t\t\telse parsed.reference = \"uri\";\n\t\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== parsed.reference) parsed.error = parsed.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t\tconst schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);\n\t\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t\tif (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) try {\n\t\t\t\t\tparsed.host = URL.domainToASCII(parsed.host.toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tparsed.error = parsed.error || \"Host's domain name can not be converted to ASCII: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {\n\t\t\t\tif (uri.indexOf(\"%\") !== -1) {\n\t\t\t\t\tif (parsed.scheme !== void 0) parsed.scheme = unescape(parsed.scheme);\n\t\t\t\t\tif (parsed.host !== void 0) parsed.host = unescape(parsed.host);\n\t\t\t\t}\n\t\t\t\tif (parsed.path) parsed.path = escape(unescape(parsed.path));\n\t\t\t\tif (parsed.fragment) parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));\n\t\t\t}\n\t\t\tif (schemeHandler && schemeHandler.parse) schemeHandler.parse(parsed, options);\n\t\t} else parsed.error = parsed.error || \"URI can not be parsed.\";\n\t\treturn parsed;\n\t}\n\tconst fastUri = {\n\t\tSCHEMES,\n\t\tnormalize,\n\t\tresolve,\n\t\tresolveComponent,\n\t\tequal,\n\t\tserialize,\n\t\tparse\n\t};\n\tmodule.exports = fastUri;\n\tmodule.exports.default = fastUri;\n\tmodule.exports.fastUri = fastUri;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js\nvar require_uri = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst uri = require_fast_uri();\n\turi.code = \"require(\\\"ajv/dist/runtime/uri\\\").default\";\n\texports.default = uri;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js\nvar require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tconst validation_error_1 = require_validation_error();\n\tconst ref_error_1 = require_ref_error();\n\tconst rules_1 = require_rules();\n\tconst compile_1 = require_compile();\n\tconst codegen_2 = require_codegen();\n\tconst resolve_1 = require_resolve();\n\tconst dataType_1 = require_dataType();\n\tconst util_1 = require_util();\n\tconst $dataRefSchema = require_data();\n\tconst uri_1 = require_uri();\n\tconst defaultRegExp = (str, flags) => new RegExp(str, flags);\n\tdefaultRegExp.code = \"new RegExp\";\n\tconst META_IGNORE_OPTIONS = [\n\t\t\"removeAdditional\",\n\t\t\"useDefaults\",\n\t\t\"coerceTypes\"\n\t];\n\tconst EXT_SCOPE_NAMES = new Set([\n\t\t\"validate\",\n\t\t\"serialize\",\n\t\t\"parse\",\n\t\t\"wrapper\",\n\t\t\"root\",\n\t\t\"schema\",\n\t\t\"keyword\",\n\t\t\"pattern\",\n\t\t\"formats\",\n\t\t\"validate$data\",\n\t\t\"func\",\n\t\t\"obj\",\n\t\t\"Error\"\n\t]);\n\tconst removedOptions = {\n\t\terrorDataPath: \"\",\n\t\tformat: \"`validateFormats: false` can be used instead.\",\n\t\tnullable: \"\\\"nullable\\\" keyword is supported by default.\",\n\t\tjsonPointers: \"Deprecated jsPropertySyntax can be used instead.\",\n\t\textendRefs: \"Deprecated ignoreKeywordsWithRef can be used instead.\",\n\t\tmissingRefs: \"Pass empty schema with $id that should be ignored to ajv.addSchema.\",\n\t\tprocessCode: \"Use option `code: {process: (code, schemaEnv: object) => string}`\",\n\t\tsourceCode: \"Use option `code: {source: true}`\",\n\t\tstrictDefaults: \"It is default now, see option `strict`.\",\n\t\tstrictKeywords: \"It is default now, see option `strict`.\",\n\t\tuniqueItems: \"\\\"uniqueItems\\\" keyword is always validated.\",\n\t\tunknownFormats: \"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).\",\n\t\tcache: \"Map is used as cache, schema object as key.\",\n\t\tserialize: \"Map is used as cache, schema object as key.\",\n\t\tajvErrors: \"It is default now.\"\n\t};\n\tconst deprecatedOptions = {\n\t\tignoreKeywordsWithRef: \"\",\n\t\tjsPropertySyntax: \"\",\n\t\tunicode: \"\\\"minLength\\\"/\\\"maxLength\\\" account for unicode characters by default.\"\n\t};\n\tconst MAX_EXPRESSION = 200;\n\tfunction requiredOptions(o) {\n\t\tvar _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;\n\t\tconst s = o.strict;\n\t\tconst _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;\n\t\tconst optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;\n\t\tconst regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;\n\t\tconst uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;\n\t\treturn {\n\t\t\tstrictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,\n\t\t\tstrictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,\n\t\t\tstrictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : \"log\",\n\t\t\tstrictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : \"log\",\n\t\t\tstrictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,\n\t\t\tcode: o.code ? {\n\t\t\t\t...o.code,\n\t\t\t\toptimize,\n\t\t\t\tregExp\n\t\t\t} : {\n\t\t\t\toptimize,\n\t\t\t\tregExp\n\t\t\t},\n\t\t\tloopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,\n\t\t\tloopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,\n\t\t\tmeta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,\n\t\t\tmessages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,\n\t\t\tinlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,\n\t\t\tschemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : \"$id\",\n\t\t\taddUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,\n\t\t\tvalidateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,\n\t\t\tvalidateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,\n\t\t\tunicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,\n\t\t\tint32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,\n\t\t\turiResolver\n\t\t};\n\t}\n\tvar Ajv = class {\n\t\tconstructor(opts = {}) {\n\t\t\tthis.schemas = {};\n\t\t\tthis.refs = {};\n\t\t\tthis.formats = {};\n\t\t\tthis._compilations = /* @__PURE__ */ new Set();\n\t\t\tthis._loading = {};\n\t\t\tthis._cache = /* @__PURE__ */ new Map();\n\t\t\topts = this.opts = {\n\t\t\t\t...opts,\n\t\t\t\t...requiredOptions(opts)\n\t\t\t};\n\t\t\tconst { es5, lines } = this.opts.code;\n\t\t\tthis.scope = new codegen_2.ValueScope({\n\t\t\t\tscope: {},\n\t\t\t\tprefixes: EXT_SCOPE_NAMES,\n\t\t\t\tes5,\n\t\t\t\tlines\n\t\t\t});\n\t\t\tthis.logger = getLogger(opts.logger);\n\t\t\tconst formatOpt = opts.validateFormats;\n\t\t\topts.validateFormats = false;\n\t\t\tthis.RULES = (0, rules_1.getRules)();\n\t\t\tcheckOptions.call(this, removedOptions, opts, \"NOT SUPPORTED\");\n\t\t\tcheckOptions.call(this, deprecatedOptions, opts, \"DEPRECATED\", \"warn\");\n\t\t\tthis._metaOpts = getMetaSchemaOptions.call(this);\n\t\t\tif (opts.formats) addInitialFormats.call(this);\n\t\t\tthis._addVocabularies();\n\t\t\tthis._addDefaultMetaSchema();\n\t\t\tif (opts.keywords) addInitialKeywords.call(this, opts.keywords);\n\t\t\tif (typeof opts.meta == \"object\") this.addMetaSchema(opts.meta);\n\t\t\taddInitialSchemas.call(this);\n\t\t\topts.validateFormats = formatOpt;\n\t\t}\n\t\t_addVocabularies() {\n\t\t\tthis.addKeyword(\"$async\");\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tconst { $data, meta, schemaId } = this.opts;\n\t\t\tlet _dataRefSchema = $dataRefSchema;\n\t\t\tif (schemaId === \"id\") {\n\t\t\t\t_dataRefSchema = { ...$dataRefSchema };\n\t\t\t\t_dataRefSchema.id = _dataRefSchema.$id;\n\t\t\t\tdelete _dataRefSchema.$id;\n\t\t\t}\n\t\t\tif (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);\n\t\t}\n\t\tdefaultMeta() {\n\t\t\tconst { meta, schemaId } = this.opts;\n\t\t\treturn this.opts.defaultMeta = typeof meta == \"object\" ? meta[schemaId] || meta : void 0;\n\t\t}\n\t\tvalidate(schemaKeyRef, data) {\n\t\t\tlet v;\n\t\t\tif (typeof schemaKeyRef == \"string\") {\n\t\t\t\tv = this.getSchema(schemaKeyRef);\n\t\t\t\tif (!v) throw new Error(`no schema with key or ref \"${schemaKeyRef}\"`);\n\t\t\t} else v = this.compile(schemaKeyRef);\n\t\t\tconst valid = v(data);\n\t\t\tif (!(\"$async\" in v)) this.errors = v.errors;\n\t\t\treturn valid;\n\t\t}\n\t\tcompile(schema, _meta) {\n\t\t\tconst sch = this._addSchema(schema, _meta);\n\t\t\treturn sch.validate || this._compileSchemaEnv(sch);\n\t\t}\n\t\tcompileAsync(schema, meta) {\n\t\t\tif (typeof this.opts.loadSchema != \"function\") throw new Error(\"options.loadSchema should be a function\");\n\t\t\tconst { loadSchema } = this.opts;\n\t\t\treturn runCompileAsync.call(this, schema, meta);\n\t\t\tasync function runCompileAsync(_schema, _meta) {\n\t\t\t\tawait loadMetaSchema.call(this, _schema.$schema);\n\t\t\t\tconst sch = this._addSchema(_schema, _meta);\n\t\t\t\treturn sch.validate || _compileAsync.call(this, sch);\n\t\t\t}\n\t\t\tasync function loadMetaSchema($ref) {\n\t\t\t\tif ($ref && !this.getSchema($ref)) await runCompileAsync.call(this, { $ref }, true);\n\t\t\t}\n\t\t\tasync function _compileAsync(sch) {\n\t\t\t\ttry {\n\t\t\t\t\treturn this._compileSchemaEnv(sch);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (!(e instanceof ref_error_1.default)) throw e;\n\t\t\t\t\tcheckLoaded.call(this, e);\n\t\t\t\t\tawait loadMissingSchema.call(this, e.missingSchema);\n\t\t\t\t\treturn _compileAsync.call(this, sch);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction checkLoaded({ missingSchema: ref, missingRef }) {\n\t\t\t\tif (this.refs[ref]) throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);\n\t\t\t}\n\t\t\tasync function loadMissingSchema(ref) {\n\t\t\t\tconst _schema = await _loadSchema.call(this, ref);\n\t\t\t\tif (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema);\n\t\t\t\tif (!this.refs[ref]) this.addSchema(_schema, ref, meta);\n\t\t\t}\n\t\t\tasync function _loadSchema(ref) {\n\t\t\t\tconst p = this._loading[ref];\n\t\t\t\tif (p) return p;\n\t\t\t\ttry {\n\t\t\t\t\treturn await (this._loading[ref] = loadSchema(ref));\n\t\t\t\t} finally {\n\t\t\t\t\tdelete this._loading[ref];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\taddSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {\n\t\t\tif (Array.isArray(schema)) {\n\t\t\t\tfor (const sch of schema) this.addSchema(sch, void 0, _meta, _validateSchema);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tlet id;\n\t\t\tif (typeof schema === \"object\") {\n\t\t\t\tconst { schemaId } = this.opts;\n\t\t\t\tid = schema[schemaId];\n\t\t\t\tif (id !== void 0 && typeof id != \"string\") throw new Error(`schema ${schemaId} must be string`);\n\t\t\t}\n\t\t\tkey = (0, resolve_1.normalizeId)(key || id);\n\t\t\tthis._checkUnique(key);\n\t\t\tthis.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);\n\t\t\treturn this;\n\t\t}\n\t\taddMetaSchema(schema, key, _validateSchema = this.opts.validateSchema) {\n\t\t\tthis.addSchema(schema, key, true, _validateSchema);\n\t\t\treturn this;\n\t\t}\n\t\tvalidateSchema(schema, throwOrLogError) {\n\t\t\tif (typeof schema == \"boolean\") return true;\n\t\t\tlet $schema;\n\t\t\t$schema = schema.$schema;\n\t\t\tif ($schema !== void 0 && typeof $schema != \"string\") throw new Error(\"$schema must be a string\");\n\t\t\t$schema = $schema || this.opts.defaultMeta || this.defaultMeta();\n\t\t\tif (!$schema) {\n\t\t\t\tthis.logger.warn(\"meta-schema not available\");\n\t\t\t\tthis.errors = null;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst valid = this.validate($schema, schema);\n\t\t\tif (!valid && throwOrLogError) {\n\t\t\t\tconst message = \"schema is invalid: \" + this.errorsText();\n\t\t\t\tif (this.opts.validateSchema === \"log\") this.logger.error(message);\n\t\t\t\telse throw new Error(message);\n\t\t\t}\n\t\t\treturn valid;\n\t\t}\n\t\tgetSchema(keyRef) {\n\t\t\tlet sch;\n\t\t\twhile (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\") keyRef = sch;\n\t\t\tif (sch === void 0) {\n\t\t\t\tconst { schemaId } = this.opts;\n\t\t\t\tconst root = new compile_1.SchemaEnv({\n\t\t\t\t\tschema: {},\n\t\t\t\t\tschemaId\n\t\t\t\t});\n\t\t\t\tsch = compile_1.resolveSchema.call(this, root, keyRef);\n\t\t\t\tif (!sch) return;\n\t\t\t\tthis.refs[keyRef] = sch;\n\t\t\t}\n\t\t\treturn sch.validate || this._compileSchemaEnv(sch);\n\t\t}\n\t\tremoveSchema(schemaKeyRef) {\n\t\t\tif (schemaKeyRef instanceof RegExp) {\n\t\t\t\tthis._removeAllSchemas(this.schemas, schemaKeyRef);\n\t\t\t\tthis._removeAllSchemas(this.refs, schemaKeyRef);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tswitch (typeof schemaKeyRef) {\n\t\t\t\tcase \"undefined\":\n\t\t\t\t\tthis._removeAllSchemas(this.schemas);\n\t\t\t\t\tthis._removeAllSchemas(this.refs);\n\t\t\t\t\tthis._cache.clear();\n\t\t\t\t\treturn this;\n\t\t\t\tcase \"string\": {\n\t\t\t\t\tconst sch = getSchEnv.call(this, schemaKeyRef);\n\t\t\t\t\tif (typeof sch == \"object\") this._cache.delete(sch.schema);\n\t\t\t\t\tdelete this.schemas[schemaKeyRef];\n\t\t\t\t\tdelete this.refs[schemaKeyRef];\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tcase \"object\": {\n\t\t\t\t\tconst cacheKey = schemaKeyRef;\n\t\t\t\t\tthis._cache.delete(cacheKey);\n\t\t\t\t\tlet id = schemaKeyRef[this.opts.schemaId];\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tid = (0, resolve_1.normalizeId)(id);\n\t\t\t\t\t\tdelete this.schemas[id];\n\t\t\t\t\t\tdelete this.refs[id];\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tdefault: throw new Error(\"ajv.removeSchema: invalid parameter\");\n\t\t\t}\n\t\t}\n\t\taddVocabulary(definitions) {\n\t\t\tfor (const def of definitions) this.addKeyword(def);\n\t\t\treturn this;\n\t\t}\n\t\taddKeyword(kwdOrDef, def) {\n\t\t\tlet keyword;\n\t\t\tif (typeof kwdOrDef == \"string\") {\n\t\t\t\tkeyword = kwdOrDef;\n\t\t\t\tif (typeof def == \"object\") {\n\t\t\t\t\tthis.logger.warn(\"these parameters are deprecated, see docs for addKeyword\");\n\t\t\t\t\tdef.keyword = keyword;\n\t\t\t\t}\n\t\t\t} else if (typeof kwdOrDef == \"object\" && def === void 0) {\n\t\t\t\tdef = kwdOrDef;\n\t\t\t\tkeyword = def.keyword;\n\t\t\t\tif (Array.isArray(keyword) && !keyword.length) throw new Error(\"addKeywords: keyword must be string or non-empty array\");\n\t\t\t} else throw new Error(\"invalid addKeywords parameters\");\n\t\t\tcheckKeyword.call(this, keyword, def);\n\t\t\tif (!def) {\n\t\t\t\t(0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tkeywordMetaschema.call(this, def);\n\t\t\tconst definition = {\n\t\t\t\t...def,\n\t\t\t\ttype: (0, dataType_1.getJSONTypes)(def.type),\n\t\t\t\tschemaType: (0, dataType_1.getJSONTypes)(def.schemaType)\n\t\t\t};\n\t\t\t(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));\n\t\t\treturn this;\n\t\t}\n\t\tgetKeyword(keyword) {\n\t\t\tconst rule = this.RULES.all[keyword];\n\t\t\treturn typeof rule == \"object\" ? rule.definition : !!rule;\n\t\t}\n\t\tremoveKeyword(keyword) {\n\t\t\tconst { RULES } = this;\n\t\t\tdelete RULES.keywords[keyword];\n\t\t\tdelete RULES.all[keyword];\n\t\t\tfor (const group of RULES.rules) {\n\t\t\t\tconst i = group.rules.findIndex((rule) => rule.keyword === keyword);\n\t\t\t\tif (i >= 0) group.rules.splice(i, 1);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\taddFormat(name, format) {\n\t\t\tif (typeof format == \"string\") format = new RegExp(format);\n\t\t\tthis.formats[name] = format;\n\t\t\treturn this;\n\t\t}\n\t\terrorsText(errors = this.errors, { separator = \", \", dataVar = \"data\" } = {}) {\n\t\t\tif (!errors || errors.length === 0) return \"No errors\";\n\t\t\treturn errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg);\n\t\t}\n\t\t$dataMetaSchema(metaSchema, keywordsJsonPointers) {\n\t\t\tconst rules = this.RULES.all;\n\t\t\tmetaSchema = JSON.parse(JSON.stringify(metaSchema));\n\t\t\tfor (const jsonPointer of keywordsJsonPointers) {\n\t\t\t\tconst segments = jsonPointer.split(\"/\").slice(1);\n\t\t\t\tlet keywords = metaSchema;\n\t\t\t\tfor (const seg of segments) keywords = keywords[seg];\n\t\t\t\tfor (const key in rules) {\n\t\t\t\t\tconst rule = rules[key];\n\t\t\t\t\tif (typeof rule != \"object\") continue;\n\t\t\t\t\tconst { $data } = rule.definition;\n\t\t\t\t\tconst schema = keywords[key];\n\t\t\t\t\tif ($data && schema) keywords[key] = schemaOrData(schema);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn metaSchema;\n\t\t}\n\t\t_removeAllSchemas(schemas, regex) {\n\t\t\tfor (const keyRef in schemas) {\n\t\t\t\tconst sch = schemas[keyRef];\n\t\t\t\tif (!regex || regex.test(keyRef)) {\n\t\t\t\t\tif (typeof sch == \"string\") delete schemas[keyRef];\n\t\t\t\t\telse if (sch && !sch.meta) {\n\t\t\t\t\t\tthis._cache.delete(sch.schema);\n\t\t\t\t\t\tdelete schemas[keyRef];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {\n\t\t\tlet id;\n\t\t\tconst { schemaId } = this.opts;\n\t\t\tif (typeof schema == \"object\") id = schema[schemaId];\n\t\t\telse if (this.opts.jtd) throw new Error(\"schema must be object\");\n\t\t\telse if (typeof schema != \"boolean\") throw new Error(\"schema must be object or boolean\");\n\t\t\tlet sch = this._cache.get(schema);\n\t\t\tif (sch !== void 0) return sch;\n\t\t\tbaseId = (0, resolve_1.normalizeId)(id || baseId);\n\t\t\tconst localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);\n\t\t\tsch = new compile_1.SchemaEnv({\n\t\t\t\tschema,\n\t\t\t\tschemaId,\n\t\t\t\tmeta,\n\t\t\t\tbaseId,\n\t\t\t\tlocalRefs\n\t\t\t});\n\t\t\tthis._cache.set(sch.schema, sch);\n\t\t\tif (addSchema && !baseId.startsWith(\"#\")) {\n\t\t\t\tif (baseId) this._checkUnique(baseId);\n\t\t\t\tthis.refs[baseId] = sch;\n\t\t\t}\n\t\t\tif (validateSchema) this.validateSchema(schema, true);\n\t\t\treturn sch;\n\t\t}\n\t\t_checkUnique(id) {\n\t\t\tif (this.schemas[id] || this.refs[id]) throw new Error(`schema with key or id \"${id}\" already exists`);\n\t\t}\n\t\t_compileSchemaEnv(sch) {\n\t\t\tif (sch.meta) this._compileMetaSchema(sch);\n\t\t\telse compile_1.compileSchema.call(this, sch);\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!sch.validate) throw new Error(\"ajv implementation error\");\n\t\t\treturn sch.validate;\n\t\t}\n\t\t_compileMetaSchema(sch) {\n\t\t\tconst currentOpts = this.opts;\n\t\t\tthis.opts = this._metaOpts;\n\t\t\ttry {\n\t\t\t\tcompile_1.compileSchema.call(this, sch);\n\t\t\t} finally {\n\t\t\t\tthis.opts = currentOpts;\n\t\t\t}\n\t\t}\n\t};\n\tAjv.ValidationError = validation_error_1.default;\n\tAjv.MissingRefError = ref_error_1.default;\n\texports.default = Ajv;\n\tfunction checkOptions(checkOpts, options, msg, log = \"error\") {\n\t\tfor (const key in checkOpts) {\n\t\t\tconst opt = key;\n\t\t\tif (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);\n\t\t}\n\t}\n\tfunction getSchEnv(keyRef) {\n\t\tkeyRef = (0, resolve_1.normalizeId)(keyRef);\n\t\treturn this.schemas[keyRef] || this.refs[keyRef];\n\t}\n\tfunction addInitialSchemas() {\n\t\tconst optsSchemas = this.opts.schemas;\n\t\tif (!optsSchemas) return;\n\t\tif (Array.isArray(optsSchemas)) this.addSchema(optsSchemas);\n\t\telse for (const key in optsSchemas) this.addSchema(optsSchemas[key], key);\n\t}\n\tfunction addInitialFormats() {\n\t\tfor (const name in this.opts.formats) {\n\t\t\tconst format = this.opts.formats[name];\n\t\t\tif (format) this.addFormat(name, format);\n\t\t}\n\t}\n\tfunction addInitialKeywords(defs) {\n\t\tif (Array.isArray(defs)) {\n\t\t\tthis.addVocabulary(defs);\n\t\t\treturn;\n\t\t}\n\t\tthis.logger.warn(\"keywords option as map is deprecated, pass array\");\n\t\tfor (const keyword in defs) {\n\t\t\tconst def = defs[keyword];\n\t\t\tif (!def.keyword) def.keyword = keyword;\n\t\t\tthis.addKeyword(def);\n\t\t}\n\t}\n\tfunction getMetaSchemaOptions() {\n\t\tconst metaOpts = { ...this.opts };\n\t\tfor (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt];\n\t\treturn metaOpts;\n\t}\n\tconst noLogs = {\n\t\tlog() {},\n\t\twarn() {},\n\t\terror() {}\n\t};\n\tfunction getLogger(logger) {\n\t\tif (logger === false) return noLogs;\n\t\tif (logger === void 0) return console;\n\t\tif (logger.log && logger.warn && logger.error) return logger;\n\t\tthrow new Error(\"logger must implement log, warn and error methods\");\n\t}\n\tconst KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;\n\tfunction checkKeyword(keyword, def) {\n\t\tconst { RULES } = this;\n\t\t(0, util_1.eachItem)(keyword, (kwd) => {\n\t\t\tif (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`);\n\t\t\tif (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`);\n\t\t});\n\t\tif (!def) return;\n\t\tif (def.$data && !(\"code\" in def || \"validate\" in def)) throw new Error(\"$data keyword must have \\\"code\\\" or \\\"validate\\\" function\");\n\t}\n\tfunction addRule(keyword, definition, dataType) {\n\t\tvar _a;\n\t\tconst post = definition === null || definition === void 0 ? void 0 : definition.post;\n\t\tif (dataType && post) throw new Error(\"keyword with \\\"post\\\" flag cannot have \\\"type\\\"\");\n\t\tconst { RULES } = this;\n\t\tlet ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);\n\t\tif (!ruleGroup) {\n\t\t\truleGroup = {\n\t\t\t\ttype: dataType,\n\t\t\t\trules: []\n\t\t\t};\n\t\t\tRULES.rules.push(ruleGroup);\n\t\t}\n\t\tRULES.keywords[keyword] = true;\n\t\tif (!definition) return;\n\t\tconst rule = {\n\t\t\tkeyword,\n\t\t\tdefinition: {\n\t\t\t\t...definition,\n\t\t\t\ttype: (0, dataType_1.getJSONTypes)(definition.type),\n\t\t\t\tschemaType: (0, dataType_1.getJSONTypes)(definition.schemaType)\n\t\t\t}\n\t\t};\n\t\tif (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before);\n\t\telse ruleGroup.rules.push(rule);\n\t\tRULES.all[keyword] = rule;\n\t\t(_a = definition.implements) === null || _a === void 0 || _a.forEach((kwd) => this.addKeyword(kwd));\n\t}\n\tfunction addBeforeRule(ruleGroup, rule, before) {\n\t\tconst i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);\n\t\tif (i >= 0) ruleGroup.rules.splice(i, 0, rule);\n\t\telse {\n\t\t\truleGroup.rules.push(rule);\n\t\t\tthis.logger.warn(`rule ${before} is not defined`);\n\t\t}\n\t}\n\tfunction keywordMetaschema(def) {\n\t\tlet { metaSchema } = def;\n\t\tif (metaSchema === void 0) return;\n\t\tif (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema);\n\t\tdef.validateSchema = this.compile(metaSchema, true);\n\t}\n\tconst $dataRef = { $ref: \"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#\" };\n\tfunction schemaOrData(schema) {\n\t\treturn { anyOf: [schema, $dataRef] };\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js\nvar require_id = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst def = {\n\t\tkeyword: \"id\",\n\t\tcode() {\n\t\t\tthrow new Error(\"NOT SUPPORTED: keyword \\\"id\\\", use \\\"$id\\\" for schema ID\");\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js\nvar require_ref = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.callRef = exports.getValidate = void 0;\n\tconst ref_error_1 = require_ref_error();\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst compile_1 = require_compile();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"$ref\",\n\t\tschemaType: \"string\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema: $ref, it } = cxt;\n\t\t\tconst { baseId, schemaEnv: env, validateName, opts, self } = it;\n\t\t\tconst { root } = env;\n\t\t\tif (($ref === \"#\" || $ref === \"#/\") && baseId === root.baseId) return callRootRef();\n\t\t\tconst schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);\n\t\t\tif (schOrEnv === void 0) throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);\n\t\t\tif (schOrEnv instanceof compile_1.SchemaEnv) return callValidate(schOrEnv);\n\t\t\treturn inlineRefSchema(schOrEnv);\n\t\t\tfunction callRootRef() {\n\t\t\t\tif (env === root) return callRef(cxt, validateName, env, env.$async);\n\t\t\t\tconst rootName = gen.scopeValue(\"root\", { ref: root });\n\t\t\t\treturn callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);\n\t\t\t}\n\t\t\tfunction callValidate(sch) {\n\t\t\t\tcallRef(cxt, getValidate(cxt, sch), sch, sch.$async);\n\t\t\t}\n\t\t\tfunction inlineRefSchema(sch) {\n\t\t\t\tconst schName = gen.scopeValue(\"schema\", opts.code.source === true ? {\n\t\t\t\t\tref: sch,\n\t\t\t\t\tcode: (0, codegen_1.stringify)(sch)\n\t\t\t\t} : { ref: sch });\n\t\t\t\tconst valid = gen.name(\"valid\");\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tschema: sch,\n\t\t\t\t\tdataTypes: [],\n\t\t\t\t\tschemaPath: codegen_1.nil,\n\t\t\t\t\ttopSchemaRef: schName,\n\t\t\t\t\terrSchemaPath: $ref\n\t\t\t\t}, valid);\n\t\t\t\tcxt.mergeEvaluated(schCxt);\n\t\t\t\tcxt.ok(valid);\n\t\t\t}\n\t\t}\n\t};\n\tfunction getValidate(cxt, sch) {\n\t\tconst { gen } = cxt;\n\t\treturn sch.validate ? gen.scopeValue(\"validate\", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue(\"wrapper\", { ref: sch })}.validate`;\n\t}\n\texports.getValidate = getValidate;\n\tfunction callRef(cxt, v, sch, $async) {\n\t\tconst { gen, it } = cxt;\n\t\tconst { allErrors, schemaEnv: env, opts } = it;\n\t\tconst passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;\n\t\tif ($async) callAsyncRef();\n\t\telse callSyncRef();\n\t\tfunction callAsyncRef() {\n\t\t\tif (!env.$async) throw new Error(\"async schema referenced by sync schema\");\n\t\t\tconst valid = gen.let(\"valid\");\n\t\t\tgen.try(() => {\n\t\t\t\tgen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);\n\t\t\t\taddEvaluatedFrom(v);\n\t\t\t\tif (!allErrors) gen.assign(valid, true);\n\t\t\t}, (e) => {\n\t\t\t\tgen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));\n\t\t\t\taddErrorsFrom(e);\n\t\t\t\tif (!allErrors) gen.assign(valid, false);\n\t\t\t});\n\t\t\tcxt.ok(valid);\n\t\t}\n\t\tfunction callSyncRef() {\n\t\t\tcxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));\n\t\t}\n\t\tfunction addErrorsFrom(source) {\n\t\t\tconst errs = (0, codegen_1._)`${source}.errors`;\n\t\t\tgen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);\n\t\t\tgen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);\n\t\t}\n\t\tfunction addEvaluatedFrom(source) {\n\t\t\tvar _a;\n\t\t\tif (!it.opts.unevaluated) return;\n\t\t\tconst schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;\n\t\t\tif (it.props !== true) if (schEvaluated && !schEvaluated.dynamicProps) {\n\t\t\t\tif (schEvaluated.props !== void 0) it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);\n\t\t\t} else {\n\t\t\t\tconst props = gen.var(\"props\", (0, codegen_1._)`${source}.evaluated.props`);\n\t\t\t\tit.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);\n\t\t\t}\n\t\t\tif (it.items !== true) if (schEvaluated && !schEvaluated.dynamicItems) {\n\t\t\t\tif (schEvaluated.items !== void 0) it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);\n\t\t\t} else {\n\t\t\t\tconst items = gen.var(\"items\", (0, codegen_1._)`${source}.evaluated.items`);\n\t\t\t\tit.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);\n\t\t\t}\n\t\t}\n\t}\n\texports.callRef = callRef;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js\nvar require_core$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst id_1 = require_id();\n\tconst ref_1 = require_ref();\n\tconst core = [\n\t\t\"$schema\",\n\t\t\"$id\",\n\t\t\"$defs\",\n\t\t\"$vocabulary\",\n\t\t{ keyword: \"$comment\" },\n\t\t\"definitions\",\n\t\tid_1.default,\n\t\tref_1.default\n\t];\n\texports.default = core;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js\nvar require_limitNumber = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst ops = codegen_1.operators;\n\tconst KWDs = {\n\t\tmaximum: {\n\t\t\tokStr: \"<=\",\n\t\t\tok: ops.LTE,\n\t\t\tfail: ops.GT\n\t\t},\n\t\tminimum: {\n\t\t\tokStr: \">=\",\n\t\t\tok: ops.GTE,\n\t\t\tfail: ops.LT\n\t\t},\n\t\texclusiveMaximum: {\n\t\t\tokStr: \"<\",\n\t\t\tok: ops.LT,\n\t\t\tfail: ops.GTE\n\t\t},\n\t\texclusiveMinimum: {\n\t\t\tokStr: \">\",\n\t\t\tok: ops.GT,\n\t\t\tfail: ops.LTE\n\t\t}\n\t};\n\tconst def = {\n\t\tkeyword: Object.keys(KWDs),\n\t\ttype: \"number\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,\n\t\t\tparams: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode } = cxt;\n\t\t\tcxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js\nvar require_multipleOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: \"multipleOf\",\n\t\ttype: \"number\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, schemaCode, it } = cxt;\n\t\t\tconst prec = it.opts.multipleOfPrecision;\n\t\t\tconst res = gen.let(\"res\");\n\t\t\tconst invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;\n\t\t\tcxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js\nvar require_ucs2length = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tfunction ucs2length(str) {\n\t\tconst len = str.length;\n\t\tlet length = 0;\n\t\tlet pos = 0;\n\t\tlet value;\n\t\twhile (pos < len) {\n\t\t\tlength++;\n\t\t\tvalue = str.charCodeAt(pos++);\n\t\t\tif (value >= 55296 && value <= 56319 && pos < len) {\n\t\t\t\tvalue = str.charCodeAt(pos);\n\t\t\t\tif ((value & 64512) === 56320) pos++;\n\t\t\t}\n\t\t}\n\t\treturn length;\n\t}\n\texports.default = ucs2length;\n\tucs2length.code = \"require(\\\"ajv/dist/runtime/ucs2length\\\").default\";\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js\nvar require_limitLength = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst ucs2length_1 = require_ucs2length();\n\tconst def = {\n\t\tkeyword: [\"maxLength\", \"minLength\"],\n\t\ttype: \"string\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage({ keyword, schemaCode }) {\n\t\t\t\tconst comp = keyword === \"maxLength\" ? \"more\" : \"fewer\";\n\t\t\t\treturn (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;\n\t\t\t},\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode, it } = cxt;\n\t\t\tconst op = keyword === \"maxLength\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n\t\t\tconst len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;\n\t\t\tcxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js\nvar require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst util_1 = require_util();\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: \"pattern\",\n\t\ttype: \"string\",\n\t\tschemaType: \"string\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ schemaCode }) => (0, codegen_1.str)`must match pattern \"${schemaCode}\"`,\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schema, schemaCode, it } = cxt;\n\t\t\tconst u = it.opts.unicodeRegExp ? \"u\" : \"\";\n\t\t\tif ($data) {\n\t\t\t\tconst { regExp } = it.opts.code;\n\t\t\t\tconst regExpCode = regExp.code === \"new RegExp\" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);\n\t\t\t\tconst valid = gen.let(\"valid\");\n\t\t\t\tgen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));\n\t\t\t\tcxt.fail$data((0, codegen_1._)`!${valid}`);\n\t\t\t} else {\n\t\t\t\tconst regExp = (0, code_1.usePattern)(cxt, schema);\n\t\t\t\tcxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js\nvar require_limitProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: [\"maxProperties\", \"minProperties\"],\n\t\ttype: \"object\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage({ keyword, schemaCode }) {\n\t\t\t\tconst comp = keyword === \"maxProperties\" ? \"more\" : \"fewer\";\n\t\t\t\treturn (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;\n\t\t\t},\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode } = cxt;\n\t\t\tconst op = keyword === \"maxProperties\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n\t\t\tcxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js\nvar require_required = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"required\",\n\t\ttype: \"object\",\n\t\tschemaType: \"array\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,\n\t\t\tparams: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, schemaCode, data, $data, it } = cxt;\n\t\t\tconst { opts } = it;\n\t\t\tif (!$data && schema.length === 0) return;\n\t\t\tconst useLoop = schema.length >= opts.loopRequired;\n\t\t\tif (it.allErrors) allErrorsMode();\n\t\t\telse exitOnErrorMode();\n\t\t\tif (opts.strictRequired) {\n\t\t\t\tconst props = cxt.parentSchema.properties;\n\t\t\t\tconst { definedProperties } = cxt.it;\n\t\t\t\tfor (const requiredKey of schema) if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {\n\t\t\t\t\tconst msg = `required property \"${requiredKey}\" is not defined at \"${it.schemaEnv.baseId + it.errSchemaPath}\" (strictRequired)`;\n\t\t\t\t\t(0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction allErrorsMode() {\n\t\t\t\tif (useLoop || $data) cxt.block$data(codegen_1.nil, loopAllRequired);\n\t\t\t\telse for (const prop of schema) (0, code_1.checkReportMissingProp)(cxt, prop);\n\t\t\t}\n\t\t\tfunction exitOnErrorMode() {\n\t\t\t\tconst missing = gen.let(\"missing\");\n\t\t\t\tif (useLoop || $data) {\n\t\t\t\t\tconst valid = gen.let(\"valid\", true);\n\t\t\t\t\tcxt.block$data(valid, () => loopUntilMissing(missing, valid));\n\t\t\t\t\tcxt.ok(valid);\n\t\t\t\t} else {\n\t\t\t\t\tgen.if((0, code_1.checkMissingProp)(cxt, schema, missing));\n\t\t\t\t\t(0, code_1.reportMissingProp)(cxt, missing);\n\t\t\t\t\tgen.else();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction loopAllRequired() {\n\t\t\t\tgen.forOf(\"prop\", schemaCode, (prop) => {\n\t\t\t\t\tcxt.setParams({ missingProperty: prop });\n\t\t\t\t\tgen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction loopUntilMissing(missing, valid) {\n\t\t\t\tcxt.setParams({ missingProperty: missing });\n\t\t\t\tgen.forOf(missing, schemaCode, () => {\n\t\t\t\t\tgen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));\n\t\t\t\t\tgen.if((0, codegen_1.not)(valid), () => {\n\t\t\t\t\t\tcxt.error();\n\t\t\t\t\t\tgen.break();\n\t\t\t\t\t});\n\t\t\t\t}, codegen_1.nil);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js\nvar require_limitItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: [\"maxItems\", \"minItems\"],\n\t\ttype: \"array\",\n\t\tschemaType: \"number\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage({ keyword, schemaCode }) {\n\t\t\t\tconst comp = keyword === \"maxItems\" ? \"more\" : \"fewer\";\n\t\t\t\treturn (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;\n\t\t\t},\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { keyword, data, schemaCode } = cxt;\n\t\t\tconst op = keyword === \"maxItems\" ? codegen_1.operators.GT : codegen_1.operators.LT;\n\t\t\tcxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js\nvar require_equal = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst equal = require_fast_deep_equal();\n\tequal.code = \"require(\\\"ajv/dist/runtime/equal\\\").default\";\n\texports.default = equal;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js\nvar require_uniqueItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dataType_1 = require_dataType();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst equal_1 = require_equal();\n\tconst def = {\n\t\tkeyword: \"uniqueItems\",\n\t\ttype: \"array\",\n\t\tschemaType: \"boolean\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,\n\t\t\tparams: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;\n\t\t\tif (!$data && !schema) return;\n\t\t\tconst valid = gen.let(\"valid\");\n\t\t\tconst itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];\n\t\t\tcxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`);\n\t\t\tcxt.ok(valid);\n\t\t\tfunction validateUniqueItems() {\n\t\t\t\tconst i = gen.let(\"i\", (0, codegen_1._)`${data}.length`);\n\t\t\t\tconst j = gen.let(\"j\");\n\t\t\t\tcxt.setParams({\n\t\t\t\t\ti,\n\t\t\t\t\tj\n\t\t\t\t});\n\t\t\t\tgen.assign(valid, true);\n\t\t\t\tgen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));\n\t\t\t}\n\t\t\tfunction canOptimize() {\n\t\t\t\treturn itemTypes.length > 0 && !itemTypes.some((t) => t === \"object\" || t === \"array\");\n\t\t\t}\n\t\t\tfunction loopN(i, j) {\n\t\t\t\tconst item = gen.name(\"item\");\n\t\t\t\tconst wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);\n\t\t\t\tconst indices = gen.const(\"indices\", (0, codegen_1._)`{}`);\n\t\t\t\tgen.for((0, codegen_1._)`;${i}--;`, () => {\n\t\t\t\t\tgen.let(item, (0, codegen_1._)`${data}[${i}]`);\n\t\t\t\t\tgen.if(wrongType, (0, codegen_1._)`continue`);\n\t\t\t\t\tif (itemTypes.length > 1) gen.if((0, codegen_1._)`typeof ${item} == \"string\"`, (0, codegen_1._)`${item} += \"_\"`);\n\t\t\t\t\tgen.if((0, codegen_1._)`typeof ${indices}[${item}] == \"number\"`, () => {\n\t\t\t\t\t\tgen.assign(j, (0, codegen_1._)`${indices}[${item}]`);\n\t\t\t\t\t\tcxt.error();\n\t\t\t\t\t\tgen.assign(valid, false).break();\n\t\t\t\t\t}).code((0, codegen_1._)`${indices}[${item}] = ${i}`);\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction loopN2(i, j) {\n\t\t\t\tconst eql = (0, util_1.useFunc)(gen, equal_1.default);\n\t\t\t\tconst outer = gen.name(\"outer\");\n\t\t\t\tgen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {\n\t\t\t\t\tcxt.error();\n\t\t\t\t\tgen.assign(valid, false).break(outer);\n\t\t\t\t})));\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js\nvar require_const = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst equal_1 = require_equal();\n\tconst def = {\n\t\tkeyword: \"const\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: \"must be equal to constant\",\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schemaCode, schema } = cxt;\n\t\t\tif ($data || schema && typeof schema == \"object\") cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);\n\t\t\telse cxt.fail((0, codegen_1._)`${schema} !== ${data}`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js\nvar require_enum = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst equal_1 = require_equal();\n\tconst def = {\n\t\tkeyword: \"enum\",\n\t\tschemaType: \"array\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: \"must be equal to one of the allowed values\",\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, $data, schema, schemaCode, it } = cxt;\n\t\t\tif (!$data && schema.length === 0) throw new Error(\"enum must have non-empty array\");\n\t\t\tconst useLoop = schema.length >= it.opts.loopEnum;\n\t\t\tlet eql;\n\t\t\tconst getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);\n\t\t\tlet valid;\n\t\t\tif (useLoop || $data) {\n\t\t\t\tvalid = gen.let(\"valid\");\n\t\t\t\tcxt.block$data(valid, loopEnum);\n\t\t\t} else {\n\t\t\t\t/* istanbul ignore if */\n\t\t\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\t\t\tconst vSchema = gen.const(\"vSchema\", schemaCode);\n\t\t\t\tvalid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));\n\t\t\t}\n\t\t\tcxt.pass(valid);\n\t\t\tfunction loopEnum() {\n\t\t\t\tgen.assign(valid, false);\n\t\t\t\tgen.forOf(\"v\", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));\n\t\t\t}\n\t\t\tfunction equalCode(vSchema, i) {\n\t\t\t\tconst sch = schema[i];\n\t\t\t\treturn typeof sch === \"object\" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js\nvar require_validation$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst limitNumber_1 = require_limitNumber();\n\tconst multipleOf_1 = require_multipleOf();\n\tconst limitLength_1 = require_limitLength();\n\tconst pattern_1 = require_pattern();\n\tconst limitProperties_1 = require_limitProperties();\n\tconst required_1 = require_required();\n\tconst limitItems_1 = require_limitItems();\n\tconst uniqueItems_1 = require_uniqueItems();\n\tconst const_1 = require_const();\n\tconst enum_1 = require_enum();\n\tconst validation = [\n\t\tlimitNumber_1.default,\n\t\tmultipleOf_1.default,\n\t\tlimitLength_1.default,\n\t\tpattern_1.default,\n\t\tlimitProperties_1.default,\n\t\trequired_1.default,\n\t\tlimitItems_1.default,\n\t\tuniqueItems_1.default,\n\t\t{\n\t\t\tkeyword: \"type\",\n\t\t\tschemaType: [\"string\", \"array\"]\n\t\t},\n\t\t{\n\t\t\tkeyword: \"nullable\",\n\t\t\tschemaType: \"boolean\"\n\t\t},\n\t\tconst_1.default,\n\t\tenum_1.default\n\t];\n\texports.default = validation;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js\nvar require_additionalItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateAdditionalItems = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"additionalItems\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\tbefore: \"uniqueItems\",\n\t\terror: {\n\t\t\tmessage: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,\n\t\t\tparams: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { parentSchema, it } = cxt;\n\t\t\tconst { items } = parentSchema;\n\t\t\tif (!Array.isArray(items)) {\n\t\t\t\t(0, util_1.checkStrictMode)(it, \"\\\"additionalItems\\\" is ignored when \\\"items\\\" is not an array of schemas\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvalidateAdditionalItems(cxt, items);\n\t\t}\n\t};\n\tfunction validateAdditionalItems(cxt, items) {\n\t\tconst { gen, schema, data, keyword, it } = cxt;\n\t\tit.items = true;\n\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\tif (schema === false) {\n\t\t\tcxt.setParams({ len: items.length });\n\t\t\tcxt.pass((0, codegen_1._)`${len} <= ${items.length}`);\n\t\t} else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\tconst valid = gen.var(\"valid\", (0, codegen_1._)`${len} <= ${items.length}`);\n\t\t\tgen.if((0, codegen_1.not)(valid), () => validateItems(valid));\n\t\t\tcxt.ok(valid);\n\t\t}\n\t\tfunction validateItems(valid) {\n\t\t\tgen.forRange(\"i\", items.length, len, (i) => {\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword,\n\t\t\t\t\tdataProp: i,\n\t\t\t\t\tdataPropType: util_1.Type.Num\n\t\t\t\t}, valid);\n\t\t\t\tif (!it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t});\n\t\t}\n\t}\n\texports.validateAdditionalItems = validateAdditionalItems;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js\nvar require_items = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateTuple = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst code_1 = require_code();\n\tconst def = {\n\t\tkeyword: \"items\",\n\t\ttype: \"array\",\n\t\tschemaType: [\n\t\t\t\"object\",\n\t\t\t\"array\",\n\t\t\t\"boolean\"\n\t\t],\n\t\tbefore: \"uniqueItems\",\n\t\tcode(cxt) {\n\t\t\tconst { schema, it } = cxt;\n\t\t\tif (Array.isArray(schema)) return validateTuple(cxt, \"additionalItems\", schema);\n\t\t\tit.items = true;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tcxt.ok((0, code_1.validateArray)(cxt));\n\t\t}\n\t};\n\tfunction validateTuple(cxt, extraItems, schArr = cxt.schema) {\n\t\tconst { gen, parentSchema, data, keyword, it } = cxt;\n\t\tcheckStrictTuple(parentSchema);\n\t\tif (it.opts.unevaluated && schArr.length && it.items !== true) it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);\n\t\tconst valid = gen.name(\"valid\");\n\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\tschArr.forEach((sch, i) => {\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, sch)) return;\n\t\t\tgen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({\n\t\t\t\tkeyword,\n\t\t\t\tschemaProp: i,\n\t\t\t\tdataProp: i\n\t\t\t}, valid));\n\t\t\tcxt.ok(valid);\n\t\t});\n\t\tfunction checkStrictTuple(sch) {\n\t\t\tconst { opts, errSchemaPath } = it;\n\t\t\tconst l = schArr.length;\n\t\t\tconst fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);\n\t\t\tif (opts.strictTuples && !fullTuple) {\n\t\t\t\tconst msg = `\"${keyword}\" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path \"${errSchemaPath}\"`;\n\t\t\t\t(0, util_1.checkStrictMode)(it, msg, opts.strictTuples);\n\t\t\t}\n\t\t}\n\t}\n\texports.validateTuple = validateTuple;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js\nvar require_prefixItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst items_1 = require_items();\n\tconst def = {\n\t\tkeyword: \"prefixItems\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"array\"],\n\t\tbefore: \"uniqueItems\",\n\t\tcode: (cxt) => (0, items_1.validateTuple)(cxt, \"items\")\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js\nvar require_items2020 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst code_1 = require_code();\n\tconst additionalItems_1 = require_additionalItems();\n\tconst def = {\n\t\tkeyword: \"items\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\tbefore: \"uniqueItems\",\n\t\terror: {\n\t\t\tmessage: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,\n\t\t\tparams: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { schema, parentSchema, it } = cxt;\n\t\t\tconst { prefixItems } = parentSchema;\n\t\t\tit.items = true;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tif (prefixItems) (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);\n\t\t\telse cxt.ok((0, code_1.validateArray)(cxt));\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js\nvar require_contains = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"contains\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\tbefore: \"uniqueItems\",\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,\n\t\t\tparams: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, data, it } = cxt;\n\t\t\tlet min;\n\t\t\tlet max;\n\t\t\tconst { minContains, maxContains } = parentSchema;\n\t\t\tif (it.opts.next) {\n\t\t\t\tmin = minContains === void 0 ? 1 : minContains;\n\t\t\t\tmax = maxContains;\n\t\t\t} else min = 1;\n\t\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\t\tcxt.setParams({\n\t\t\t\tmin,\n\t\t\t\tmax\n\t\t\t});\n\t\t\tif (max === void 0 && min === 0) {\n\t\t\t\t(0, util_1.checkStrictMode)(it, `\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (max !== void 0 && min > max) {\n\t\t\t\t(0, util_1.checkStrictMode)(it, `\"minContains\" > \"maxContains\" is always invalid`);\n\t\t\t\tcxt.fail();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\tlet cond = (0, codegen_1._)`${len} >= ${min}`;\n\t\t\t\tif (max !== void 0) cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;\n\t\t\t\tcxt.pass(cond);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tit.items = true;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tif (max === void 0 && min === 1) validateItems(valid, () => gen.if(valid, () => gen.break()));\n\t\t\telse if (min === 0) {\n\t\t\t\tgen.let(valid, true);\n\t\t\t\tif (max !== void 0) gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount);\n\t\t\t} else {\n\t\t\t\tgen.let(valid, false);\n\t\t\t\tvalidateItemsWithCount();\n\t\t\t}\n\t\t\tcxt.result(valid, () => cxt.reset());\n\t\t\tfunction validateItemsWithCount() {\n\t\t\t\tconst schValid = gen.name(\"_valid\");\n\t\t\t\tconst count = gen.let(\"count\", 0);\n\t\t\t\tvalidateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));\n\t\t\t}\n\t\t\tfunction validateItems(_valid, block) {\n\t\t\t\tgen.forRange(\"i\", 0, len, (i) => {\n\t\t\t\t\tcxt.subschema({\n\t\t\t\t\t\tkeyword: \"contains\",\n\t\t\t\t\t\tdataProp: i,\n\t\t\t\t\t\tdataPropType: util_1.Type.Num,\n\t\t\t\t\t\tcompositeRule: true\n\t\t\t\t\t}, _valid);\n\t\t\t\t\tblock();\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction checkLimits(count) {\n\t\t\t\tgen.code((0, codegen_1._)`${count}++`);\n\t\t\t\tif (max === void 0) gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());\n\t\t\t\telse {\n\t\t\t\t\tgen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());\n\t\t\t\t\tif (min === 1) gen.assign(valid, true);\n\t\t\t\t\telse gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js\nvar require_dependencies = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst code_1 = require_code();\n\texports.error = {\n\t\tmessage: ({ params: { property, depsCount, deps } }) => {\n\t\t\tconst property_ies = depsCount === 1 ? \"property\" : \"properties\";\n\t\t\treturn (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;\n\t\t},\n\t\tparams: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},\n missingProperty: ${missingProperty},\n depsCount: ${depsCount},\n deps: ${deps}}`\n\t};\n\tconst def = {\n\t\tkeyword: \"dependencies\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\terror: exports.error,\n\t\tcode(cxt) {\n\t\t\tconst [propDeps, schDeps] = splitDependencies(cxt);\n\t\t\tvalidatePropertyDeps(cxt, propDeps);\n\t\t\tvalidateSchemaDeps(cxt, schDeps);\n\t\t}\n\t};\n\tfunction splitDependencies({ schema }) {\n\t\tconst propertyDeps = {};\n\t\tconst schemaDeps = {};\n\t\tfor (const key in schema) {\n\t\t\tif (key === \"__proto__\") continue;\n\t\t\tconst deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;\n\t\t\tdeps[key] = schema[key];\n\t\t}\n\t\treturn [propertyDeps, schemaDeps];\n\t}\n\tfunction validatePropertyDeps(cxt, propertyDeps = cxt.schema) {\n\t\tconst { gen, data, it } = cxt;\n\t\tif (Object.keys(propertyDeps).length === 0) return;\n\t\tconst missing = gen.let(\"missing\");\n\t\tfor (const prop in propertyDeps) {\n\t\t\tconst deps = propertyDeps[prop];\n\t\t\tif (deps.length === 0) continue;\n\t\t\tconst hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);\n\t\t\tcxt.setParams({\n\t\t\t\tproperty: prop,\n\t\t\t\tdepsCount: deps.length,\n\t\t\t\tdeps: deps.join(\", \")\n\t\t\t});\n\t\t\tif (it.allErrors) gen.if(hasProperty, () => {\n\t\t\t\tfor (const depProp of deps) (0, code_1.checkReportMissingProp)(cxt, depProp);\n\t\t\t});\n\t\t\telse {\n\t\t\t\tgen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);\n\t\t\t\t(0, code_1.reportMissingProp)(cxt, missing);\n\t\t\t\tgen.else();\n\t\t\t}\n\t\t}\n\t}\n\texports.validatePropertyDeps = validatePropertyDeps;\n\tfunction validateSchemaDeps(cxt, schemaDeps = cxt.schema) {\n\t\tconst { gen, data, keyword, it } = cxt;\n\t\tconst valid = gen.name(\"valid\");\n\t\tfor (const prop in schemaDeps) {\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) continue;\n\t\t\tgen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword,\n\t\t\t\t\tschemaProp: prop\n\t\t\t\t}, valid);\n\t\t\t\tcxt.mergeValidEvaluated(schCxt, valid);\n\t\t\t}, () => gen.var(valid, true));\n\t\t\tcxt.ok(valid);\n\t\t}\n\t}\n\texports.validateSchemaDeps = validateSchemaDeps;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js\nvar require_propertyNames = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"propertyNames\",\n\t\ttype: \"object\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\terror: {\n\t\t\tmessage: \"property name must be valid\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, it } = cxt;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tgen.forIn(\"key\", data, (key) => {\n\t\t\t\tcxt.setParams({ propertyName: key });\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword: \"propertyNames\",\n\t\t\t\t\tdata: key,\n\t\t\t\t\tdataTypes: [\"string\"],\n\t\t\t\t\tpropertyName: key,\n\t\t\t\t\tcompositeRule: true\n\t\t\t\t}, valid);\n\t\t\t\tgen.if((0, codegen_1.not)(valid), () => {\n\t\t\t\t\tcxt.error(true);\n\t\t\t\t\tif (!it.allErrors) gen.break();\n\t\t\t\t});\n\t\t\t});\n\t\t\tcxt.ok(valid);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js\nvar require_additionalProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"additionalProperties\",\n\t\ttype: [\"object\"],\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\tallowUndefined: true,\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: \"must NOT have additional properties\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, data, errsCount, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!errsCount) throw new Error(\"ajv implementation error\");\n\t\t\tconst { allErrors, opts } = it;\n\t\t\tit.props = true;\n\t\t\tif (opts.removeAdditional !== \"all\" && (0, util_1.alwaysValidSchema)(it, schema)) return;\n\t\t\tconst props = (0, code_1.allSchemaProperties)(parentSchema.properties);\n\t\t\tconst patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);\n\t\t\tcheckAdditionalProperties();\n\t\t\tcxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);\n\t\t\tfunction checkAdditionalProperties() {\n\t\t\t\tgen.forIn(\"key\", data, (key) => {\n\t\t\t\t\tif (!props.length && !patProps.length) additionalPropertyCode(key);\n\t\t\t\t\telse gen.if(isAdditional(key), () => additionalPropertyCode(key));\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction isAdditional(key) {\n\t\t\t\tlet definedProp;\n\t\t\t\tif (props.length > 8) {\n\t\t\t\t\tconst propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, \"properties\");\n\t\t\t\t\tdefinedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);\n\t\t\t\t} else if (props.length) definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));\n\t\t\t\telse definedProp = codegen_1.nil;\n\t\t\t\tif (patProps.length) definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));\n\t\t\t\treturn (0, codegen_1.not)(definedProp);\n\t\t\t}\n\t\t\tfunction deleteAdditional(key) {\n\t\t\t\tgen.code((0, codegen_1._)`delete ${data}[${key}]`);\n\t\t\t}\n\t\t\tfunction additionalPropertyCode(key) {\n\t\t\t\tif (opts.removeAdditional === \"all\" || opts.removeAdditional && schema === false) {\n\t\t\t\t\tdeleteAdditional(key);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (schema === false) {\n\t\t\t\t\tcxt.setParams({ additionalProperty: key });\n\t\t\t\t\tcxt.error();\n\t\t\t\t\tif (!allErrors) gen.break();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\t\tconst valid = gen.name(\"valid\");\n\t\t\t\t\tif (opts.removeAdditional === \"failing\") {\n\t\t\t\t\t\tapplyAdditionalSchema(key, valid, false);\n\t\t\t\t\t\tgen.if((0, codegen_1.not)(valid), () => {\n\t\t\t\t\t\t\tcxt.reset();\n\t\t\t\t\t\t\tdeleteAdditional(key);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tapplyAdditionalSchema(key, valid);\n\t\t\t\t\t\tif (!allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction applyAdditionalSchema(key, valid, errors) {\n\t\t\t\tconst subschema = {\n\t\t\t\t\tkeyword: \"additionalProperties\",\n\t\t\t\t\tdataProp: key,\n\t\t\t\t\tdataPropType: util_1.Type.Str\n\t\t\t\t};\n\t\t\t\tif (errors === false) Object.assign(subschema, {\n\t\t\t\t\tcompositeRule: true,\n\t\t\t\t\tcreateErrors: false,\n\t\t\t\t\tallErrors: false\n\t\t\t\t});\n\t\t\t\tcxt.subschema(subschema, valid);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js\nvar require_properties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst validate_1 = require_validate();\n\tconst code_1 = require_code();\n\tconst util_1 = require_util();\n\tconst additionalProperties_1 = require_additionalProperties();\n\tconst def = {\n\t\tkeyword: \"properties\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, data, it } = cxt;\n\t\t\tif (it.opts.removeAdditional === \"all\" && parentSchema.additionalProperties === void 0) additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, \"additionalProperties\"));\n\t\t\tconst allProps = (0, code_1.allSchemaProperties)(schema);\n\t\t\tfor (const prop of allProps) it.definedProperties.add(prop);\n\t\t\tif (it.opts.unevaluated && allProps.length && it.props !== true) it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);\n\t\t\tconst properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));\n\t\t\tif (properties.length === 0) return;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tfor (const prop of properties) {\n\t\t\t\tif (hasDefault(prop)) applyPropertySchema(prop);\n\t\t\t\telse {\n\t\t\t\t\tgen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));\n\t\t\t\t\tapplyPropertySchema(prop);\n\t\t\t\t\tif (!it.allErrors) gen.else().var(valid, true);\n\t\t\t\t\tgen.endIf();\n\t\t\t\t}\n\t\t\t\tcxt.it.definedProperties.add(prop);\n\t\t\t\tcxt.ok(valid);\n\t\t\t}\n\t\t\tfunction hasDefault(prop) {\n\t\t\t\treturn it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;\n\t\t\t}\n\t\t\tfunction applyPropertySchema(prop) {\n\t\t\t\tcxt.subschema({\n\t\t\t\t\tkeyword: \"properties\",\n\t\t\t\t\tschemaProp: prop,\n\t\t\t\t\tdataProp: prop\n\t\t\t\t}, valid);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js\nvar require_patternProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst code_1 = require_code();\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst util_2 = require_util();\n\tconst def = {\n\t\tkeyword: \"patternProperties\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, parentSchema, it } = cxt;\n\t\t\tconst { opts } = it;\n\t\t\tconst patterns = (0, code_1.allSchemaProperties)(schema);\n\t\t\tconst alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));\n\t\t\tif (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) return;\n\t\t\tconst checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tif (it.props !== true && !(it.props instanceof codegen_1.Name)) it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);\n\t\t\tconst { props } = it;\n\t\t\tvalidatePatternProperties();\n\t\t\tfunction validatePatternProperties() {\n\t\t\t\tfor (const pat of patterns) {\n\t\t\t\t\tif (checkProperties) checkMatchingProperties(pat);\n\t\t\t\t\tif (it.allErrors) validateProperties(pat);\n\t\t\t\t\telse {\n\t\t\t\t\t\tgen.var(valid, true);\n\t\t\t\t\t\tvalidateProperties(pat);\n\t\t\t\t\t\tgen.if(valid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction checkMatchingProperties(pat) {\n\t\t\t\tfor (const prop in checkProperties) if (new RegExp(pat).test(prop)) (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);\n\t\t\t}\n\t\t\tfunction validateProperties(pat) {\n\t\t\t\tgen.forIn(\"key\", data, (key) => {\n\t\t\t\t\tgen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {\n\t\t\t\t\t\tconst alwaysValid = alwaysValidPatterns.includes(pat);\n\t\t\t\t\t\tif (!alwaysValid) cxt.subschema({\n\t\t\t\t\t\t\tkeyword: \"patternProperties\",\n\t\t\t\t\t\t\tschemaProp: pat,\n\t\t\t\t\t\t\tdataProp: key,\n\t\t\t\t\t\t\tdataPropType: util_2.Type.Str\n\t\t\t\t\t\t}, valid);\n\t\t\t\t\t\tif (it.opts.unevaluated && props !== true) gen.assign((0, codegen_1._)`${props}[${key}]`, true);\n\t\t\t\t\t\telse if (!alwaysValid && !it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js\nvar require_not = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"not\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\ttrackErrors: true,\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, it } = cxt;\n\t\t\tif ((0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\tcxt.fail();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tcxt.subschema({\n\t\t\t\tkeyword: \"not\",\n\t\t\t\tcompositeRule: true,\n\t\t\t\tcreateErrors: false,\n\t\t\t\tallErrors: false\n\t\t\t}, valid);\n\t\t\tcxt.failResult(valid, () => cxt.reset(), () => cxt.error());\n\t\t},\n\t\terror: { message: \"must NOT be valid\" }\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js\nvar require_anyOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst def = {\n\t\tkeyword: \"anyOf\",\n\t\tschemaType: \"array\",\n\t\ttrackErrors: true,\n\t\tcode: require_code().validateUnion,\n\t\terror: { message: \"must match a schema in anyOf\" }\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js\nvar require_oneOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"oneOf\",\n\t\tschemaType: \"array\",\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: \"must match exactly one schema in oneOf\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, parentSchema, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\t\tif (it.opts.discriminator && parentSchema.discriminator) return;\n\t\t\tconst schArr = schema;\n\t\t\tconst valid = gen.let(\"valid\", false);\n\t\t\tconst passing = gen.let(\"passing\", null);\n\t\t\tconst schValid = gen.name(\"_valid\");\n\t\t\tcxt.setParams({ passing });\n\t\t\tgen.block(validateOneOf);\n\t\t\tcxt.result(valid, () => cxt.reset(), () => cxt.error(true));\n\t\t\tfunction validateOneOf() {\n\t\t\t\tschArr.forEach((sch, i) => {\n\t\t\t\t\tlet schCxt;\n\t\t\t\t\tif ((0, util_1.alwaysValidSchema)(it, sch)) gen.var(schValid, true);\n\t\t\t\t\telse schCxt = cxt.subschema({\n\t\t\t\t\t\tkeyword: \"oneOf\",\n\t\t\t\t\t\tschemaProp: i,\n\t\t\t\t\t\tcompositeRule: true\n\t\t\t\t\t}, schValid);\n\t\t\t\t\tif (i > 0) gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else();\n\t\t\t\t\tgen.if(schValid, () => {\n\t\t\t\t\t\tgen.assign(valid, true);\n\t\t\t\t\t\tgen.assign(passing, i);\n\t\t\t\t\t\tif (schCxt) cxt.mergeEvaluated(schCxt, codegen_1.Name);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js\nvar require_allOf = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"allOf\",\n\t\tschemaType: \"array\",\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!Array.isArray(schema)) throw new Error(\"ajv implementation error\");\n\t\t\tconst valid = gen.name(\"valid\");\n\t\t\tschema.forEach((sch, i) => {\n\t\t\t\tif ((0, util_1.alwaysValidSchema)(it, sch)) return;\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword: \"allOf\",\n\t\t\t\t\tschemaProp: i\n\t\t\t\t}, valid);\n\t\t\t\tcxt.ok(valid);\n\t\t\t\tcxt.mergeEvaluated(schCxt);\n\t\t\t});\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js\nvar require_if = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"if\",\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: ({ params }) => (0, codegen_1.str)`must match \"${params.ifClause}\" schema`,\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, parentSchema, it } = cxt;\n\t\t\tif (parentSchema.then === void 0 && parentSchema.else === void 0) (0, util_1.checkStrictMode)(it, \"\\\"if\\\" without \\\"then\\\" and \\\"else\\\" is ignored\");\n\t\t\tconst hasThen = hasSchema(it, \"then\");\n\t\t\tconst hasElse = hasSchema(it, \"else\");\n\t\t\tif (!hasThen && !hasElse) return;\n\t\t\tconst valid = gen.let(\"valid\", true);\n\t\t\tconst schValid = gen.name(\"_valid\");\n\t\t\tvalidateIf();\n\t\t\tcxt.reset();\n\t\t\tif (hasThen && hasElse) {\n\t\t\t\tconst ifClause = gen.let(\"ifClause\");\n\t\t\t\tcxt.setParams({ ifClause });\n\t\t\t\tgen.if(schValid, validateClause(\"then\", ifClause), validateClause(\"else\", ifClause));\n\t\t\t} else if (hasThen) gen.if(schValid, validateClause(\"then\"));\n\t\t\telse gen.if((0, codegen_1.not)(schValid), validateClause(\"else\"));\n\t\t\tcxt.pass(valid, () => cxt.error(true));\n\t\t\tfunction validateIf() {\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword: \"if\",\n\t\t\t\t\tcompositeRule: true,\n\t\t\t\t\tcreateErrors: false,\n\t\t\t\t\tallErrors: false\n\t\t\t\t}, schValid);\n\t\t\t\tcxt.mergeEvaluated(schCxt);\n\t\t\t}\n\t\t\tfunction validateClause(keyword, ifClause) {\n\t\t\t\treturn () => {\n\t\t\t\t\tconst schCxt = cxt.subschema({ keyword }, schValid);\n\t\t\t\t\tgen.assign(valid, schValid);\n\t\t\t\t\tcxt.mergeValidEvaluated(schCxt, valid);\n\t\t\t\t\tif (ifClause) gen.assign(ifClause, (0, codegen_1._)`${keyword}`);\n\t\t\t\t\telse cxt.setParams({ ifClause: keyword });\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n\tfunction hasSchema(it, keyword) {\n\t\tconst schema = it.schema[keyword];\n\t\treturn schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);\n\t}\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js\nvar require_thenElse = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: [\"then\", \"else\"],\n\t\tschemaType: [\"object\", \"boolean\"],\n\t\tcode({ keyword, parentSchema, it }) {\n\t\t\tif (parentSchema.if === void 0) (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"if\" is ignored`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js\nvar require_applicator$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst additionalItems_1 = require_additionalItems();\n\tconst prefixItems_1 = require_prefixItems();\n\tconst items_1 = require_items();\n\tconst items2020_1 = require_items2020();\n\tconst contains_1 = require_contains();\n\tconst dependencies_1 = require_dependencies();\n\tconst propertyNames_1 = require_propertyNames();\n\tconst additionalProperties_1 = require_additionalProperties();\n\tconst properties_1 = require_properties();\n\tconst patternProperties_1 = require_patternProperties();\n\tconst not_1 = require_not();\n\tconst anyOf_1 = require_anyOf();\n\tconst oneOf_1 = require_oneOf();\n\tconst allOf_1 = require_allOf();\n\tconst if_1 = require_if();\n\tconst thenElse_1 = require_thenElse();\n\tfunction getApplicator(draft2020 = false) {\n\t\tconst applicator = [\n\t\t\tnot_1.default,\n\t\t\tanyOf_1.default,\n\t\t\toneOf_1.default,\n\t\t\tallOf_1.default,\n\t\t\tif_1.default,\n\t\t\tthenElse_1.default,\n\t\t\tpropertyNames_1.default,\n\t\t\tadditionalProperties_1.default,\n\t\t\tdependencies_1.default,\n\t\t\tproperties_1.default,\n\t\t\tpatternProperties_1.default\n\t\t];\n\t\tif (draft2020) applicator.push(prefixItems_1.default, items2020_1.default);\n\t\telse applicator.push(additionalItems_1.default, items_1.default);\n\t\tapplicator.push(contains_1.default);\n\t\treturn applicator;\n\t}\n\texports.default = getApplicator;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js\nvar require_format$2 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst def = {\n\t\tkeyword: \"format\",\n\t\ttype: [\"number\", \"string\"],\n\t\tschemaType: \"string\",\n\t\t$data: true,\n\t\terror: {\n\t\t\tmessage: ({ schemaCode }) => (0, codegen_1.str)`must match format \"${schemaCode}\"`,\n\t\t\tparams: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`\n\t\t},\n\t\tcode(cxt, ruleType) {\n\t\t\tconst { gen, data, $data, schema, schemaCode, it } = cxt;\n\t\t\tconst { opts, errSchemaPath, schemaEnv, self } = it;\n\t\t\tif (!opts.validateFormats) return;\n\t\t\tif ($data) validate$DataFormat();\n\t\t\telse validateFormat();\n\t\t\tfunction validate$DataFormat() {\n\t\t\t\tconst fmts = gen.scopeValue(\"formats\", {\n\t\t\t\t\tref: self.formats,\n\t\t\t\t\tcode: opts.code.formats\n\t\t\t\t});\n\t\t\t\tconst fDef = gen.const(\"fDef\", (0, codegen_1._)`${fmts}[${schemaCode}]`);\n\t\t\t\tconst fType = gen.let(\"fType\");\n\t\t\t\tconst format = gen.let(\"format\");\n\t\t\t\tgen.if((0, codegen_1._)`typeof ${fDef} == \"object\" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || \"string\"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`\"string\"`).assign(format, fDef));\n\t\t\t\tcxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));\n\t\t\t\tfunction unknownFmt() {\n\t\t\t\t\tif (opts.strictSchema === false) return codegen_1.nil;\n\t\t\t\t\treturn (0, codegen_1._)`${schemaCode} && !${format}`;\n\t\t\t\t}\n\t\t\t\tfunction invalidFmt() {\n\t\t\t\t\tconst callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;\n\t\t\t\t\tconst validData = (0, codegen_1._)`(typeof ${format} == \"function\" ? ${callFormat} : ${format}.test(${data}))`;\n\t\t\t\t\treturn (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction validateFormat() {\n\t\t\t\tconst formatDef = self.formats[schema];\n\t\t\t\tif (!formatDef) {\n\t\t\t\t\tunknownFormat();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (formatDef === true) return;\n\t\t\t\tconst [fmtType, format, fmtRef] = getFormat(formatDef);\n\t\t\t\tif (fmtType === ruleType) cxt.pass(validCondition());\n\t\t\t\tfunction unknownFormat() {\n\t\t\t\t\tif (opts.strictSchema === false) {\n\t\t\t\t\t\tself.logger.warn(unknownMsg());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Error(unknownMsg());\n\t\t\t\t\tfunction unknownMsg() {\n\t\t\t\t\t\treturn `unknown format \"${schema}\" ignored in schema at path \"${errSchemaPath}\"`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfunction getFormat(fmtDef) {\n\t\t\t\t\tconst code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;\n\t\t\t\t\tconst fmt = gen.scopeValue(\"formats\", {\n\t\t\t\t\t\tkey: schema,\n\t\t\t\t\t\tref: fmtDef,\n\t\t\t\t\t\tcode\n\t\t\t\t\t});\n\t\t\t\t\tif (typeof fmtDef == \"object\" && !(fmtDef instanceof RegExp)) return [\n\t\t\t\t\t\tfmtDef.type || \"string\",\n\t\t\t\t\t\tfmtDef.validate,\n\t\t\t\t\t\t(0, codegen_1._)`${fmt}.validate`\n\t\t\t\t\t];\n\t\t\t\t\treturn [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\tfmtDef,\n\t\t\t\t\t\tfmt\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\tfunction validCondition() {\n\t\t\t\t\tif (typeof formatDef == \"object\" && !(formatDef instanceof RegExp) && formatDef.async) {\n\t\t\t\t\t\tif (!schemaEnv.$async) throw new Error(\"async format in sync schema\");\n\t\t\t\t\t\treturn (0, codegen_1._)`await ${fmtRef}(${data})`;\n\t\t\t\t\t}\n\t\t\t\t\treturn typeof format == \"function\" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js\nvar require_format$1 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst format = [require_format$2().default];\n\texports.default = format;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js\nvar require_metadata = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.contentVocabulary = exports.metadataVocabulary = void 0;\n\texports.metadataVocabulary = [\n\t\t\"title\",\n\t\t\"description\",\n\t\t\"default\",\n\t\t\"deprecated\",\n\t\t\"readOnly\",\n\t\t\"writeOnly\",\n\t\t\"examples\"\n\t];\n\texports.contentVocabulary = [\n\t\t\"contentMediaType\",\n\t\t\"contentEncoding\",\n\t\t\"contentSchema\"\n\t];\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js\nvar require_draft7 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst core_1 = require_core$2();\n\tconst validation_1 = require_validation$2();\n\tconst applicator_1 = require_applicator$2();\n\tconst format_1 = require_format$1();\n\tconst metadata_1 = require_metadata();\n\tconst draft7Vocabularies = [\n\t\tcore_1.default,\n\t\tvalidation_1.default,\n\t\t(0, applicator_1.default)(),\n\t\tformat_1.default,\n\t\tmetadata_1.metadataVocabulary,\n\t\tmetadata_1.contentVocabulary\n\t];\n\texports.default = draft7Vocabularies;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js\nvar require_types = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.DiscrError = void 0;\n\tvar DiscrError;\n\t(function(DiscrError) {\n\t\tDiscrError[\"Tag\"] = \"tag\";\n\t\tDiscrError[\"Mapping\"] = \"mapping\";\n\t})(DiscrError || (exports.DiscrError = DiscrError = {}));\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js\nvar require_discriminator = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst types_1 = require_types();\n\tconst compile_1 = require_compile();\n\tconst ref_error_1 = require_ref_error();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"discriminator\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\terror: {\n\t\t\tmessage: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag \"${tagName}\" must be string` : `value of tag \"${tagName}\" must be in oneOf`,\n\t\t\tparams: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, schema, parentSchema, it } = cxt;\n\t\t\tconst { oneOf } = parentSchema;\n\t\t\tif (!it.opts.discriminator) throw new Error(\"discriminator: requires discriminator option\");\n\t\t\tconst tagName = schema.propertyName;\n\t\t\tif (typeof tagName != \"string\") throw new Error(\"discriminator: requires propertyName\");\n\t\t\tif (schema.mapping) throw new Error(\"discriminator: mapping is not supported\");\n\t\t\tif (!oneOf) throw new Error(\"discriminator: requires oneOf keyword\");\n\t\t\tconst valid = gen.let(\"valid\", false);\n\t\t\tconst tag = gen.const(\"tag\", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);\n\t\t\tgen.if((0, codegen_1._)`typeof ${tag} == \"string\"`, () => validateMapping(), () => cxt.error(false, {\n\t\t\t\tdiscrError: types_1.DiscrError.Tag,\n\t\t\t\ttag,\n\t\t\t\ttagName\n\t\t\t}));\n\t\t\tcxt.ok(valid);\n\t\t\tfunction validateMapping() {\n\t\t\t\tconst mapping = getMapping();\n\t\t\t\tgen.if(false);\n\t\t\t\tfor (const tagValue in mapping) {\n\t\t\t\t\tgen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);\n\t\t\t\t\tgen.assign(valid, applyTagSchema(mapping[tagValue]));\n\t\t\t\t}\n\t\t\t\tgen.else();\n\t\t\t\tcxt.error(false, {\n\t\t\t\t\tdiscrError: types_1.DiscrError.Mapping,\n\t\t\t\t\ttag,\n\t\t\t\t\ttagName\n\t\t\t\t});\n\t\t\t\tgen.endIf();\n\t\t\t}\n\t\t\tfunction applyTagSchema(schemaProp) {\n\t\t\t\tconst _valid = gen.name(\"valid\");\n\t\t\t\tconst schCxt = cxt.subschema({\n\t\t\t\t\tkeyword: \"oneOf\",\n\t\t\t\t\tschemaProp\n\t\t\t\t}, _valid);\n\t\t\t\tcxt.mergeEvaluated(schCxt, codegen_1.Name);\n\t\t\t\treturn _valid;\n\t\t\t}\n\t\t\tfunction getMapping() {\n\t\t\t\tvar _a;\n\t\t\t\tconst oneOfMapping = {};\n\t\t\t\tconst topRequired = hasRequired(parentSchema);\n\t\t\t\tlet tagRequired = true;\n\t\t\t\tfor (let i = 0; i < oneOf.length; i++) {\n\t\t\t\t\tlet sch = oneOf[i];\n\t\t\t\t\tif ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {\n\t\t\t\t\t\tconst ref = sch.$ref;\n\t\t\t\t\t\tsch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);\n\t\t\t\t\t\tif (sch instanceof compile_1.SchemaEnv) sch = sch.schema;\n\t\t\t\t\t\tif (sch === void 0) throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);\n\t\t\t\t\t}\n\t\t\t\t\tconst propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];\n\t\t\t\t\tif (typeof propSch != \"object\") throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have \"properties/${tagName}\"`);\n\t\t\t\t\ttagRequired = tagRequired && (topRequired || hasRequired(sch));\n\t\t\t\t\taddMappings(propSch, i);\n\t\t\t\t}\n\t\t\t\tif (!tagRequired) throw new Error(`discriminator: \"${tagName}\" must be required`);\n\t\t\t\treturn oneOfMapping;\n\t\t\t\tfunction hasRequired({ required }) {\n\t\t\t\t\treturn Array.isArray(required) && required.includes(tagName);\n\t\t\t\t}\n\t\t\t\tfunction addMappings(sch, i) {\n\t\t\t\t\tif (sch.const) addMapping(sch.const, i);\n\t\t\t\t\telse if (sch.enum) for (const tagValue of sch.enum) addMapping(tagValue, i);\n\t\t\t\t\telse throw new Error(`discriminator: \"properties/${tagName}\" must have \"const\" or \"enum\"`);\n\t\t\t\t}\n\t\t\t\tfunction addMapping(tagValue, i) {\n\t\t\t\t\tif (typeof tagValue != \"string\" || tagValue in oneOfMapping) throw new Error(`discriminator: \"${tagName}\" values must be unique strings`);\n\t\t\t\t\toneOfMapping[tagValue] = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.json\nvar require_json_schema_draft_07 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\t\t\"$id\": \"http://json-schema.org/draft-07/schema#\",\n\t\t\"title\": \"Core schema meta-schema\",\n\t\t\"definitions\": {\n\t\t\t\"schemaArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"items\": { \"$ref\": \"#\" }\n\t\t\t},\n\t\t\t\"nonNegativeInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"nonNegativeIntegerDefault0\": { \"allOf\": [{ \"$ref\": \"#/definitions/nonNegativeInteger\" }, { \"default\": 0 }] },\n\t\t\t\"simpleTypes\": { \"enum\": [\n\t\t\t\t\"array\",\n\t\t\t\t\"boolean\",\n\t\t\t\t\"integer\",\n\t\t\t\t\"null\",\n\t\t\t\t\"number\",\n\t\t\t\t\"object\",\n\t\t\t\t\"string\"\n\t\t\t] },\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"type\": \"string\" },\n\t\t\t\t\"uniqueItems\": true,\n\t\t\t\t\"default\": []\n\t\t\t}\n\t\t},\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"$id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$ref\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$comment\": { \"type\": \"string\" },\n\t\t\t\"title\": { \"type\": \"string\" },\n\t\t\t\"description\": { \"type\": \"string\" },\n\t\t\t\"default\": true,\n\t\t\t\"readOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"examples\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"exclusiveMinimum\": 0\n\t\t\t},\n\t\t\t\"maximum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMaximum\": { \"type\": \"number\" },\n\t\t\t\"minimum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMinimum\": { \"type\": \"number\" },\n\t\t\t\"maxLength\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n\t\t\t\"minLength\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"additionalItems\": { \"$ref\": \"#\" },\n\t\t\t\"items\": {\n\t\t\t\t\"anyOf\": [{ \"$ref\": \"#\" }, { \"$ref\": \"#/definitions/schemaArray\" }],\n\t\t\t\t\"default\": true\n\t\t\t},\n\t\t\t\"maxItems\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n\t\t\t\"minItems\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"contains\": { \"$ref\": \"#\" },\n\t\t\t\"maxProperties\": { \"$ref\": \"#/definitions/nonNegativeInteger\" },\n\t\t\t\"minProperties\": { \"$ref\": \"#/definitions/nonNegativeIntegerDefault0\" },\n\t\t\t\"required\": { \"$ref\": \"#/definitions/stringArray\" },\n\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\"definitions\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#\" },\n\t\t\t\t\"propertyNames\": { \"format\": \"regex\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"anyOf\": [{ \"$ref\": \"#\" }, { \"$ref\": \"#/definitions/stringArray\" }] }\n\t\t\t},\n\t\t\t\"propertyNames\": { \"$ref\": \"#\" },\n\t\t\t\"const\": true,\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true,\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t},\n\t\t\t\"type\": { \"anyOf\": [{ \"$ref\": \"#/definitions/simpleTypes\" }, {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"$ref\": \"#/definitions/simpleTypes\" },\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}] },\n\t\t\t\"format\": { \"type\": \"string\" },\n\t\t\t\"contentMediaType\": { \"type\": \"string\" },\n\t\t\t\"contentEncoding\": { \"type\": \"string\" },\n\t\t\t\"if\": { \"$ref\": \"#\" },\n\t\t\t\"then\": { \"$ref\": \"#\" },\n\t\t\t\"else\": { \"$ref\": \"#\" },\n\t\t\t\"allOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n\t\t\t\"anyOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n\t\t\t\"oneOf\": { \"$ref\": \"#/definitions/schemaArray\" },\n\t\t\t\"not\": { \"$ref\": \"#\" }\n\t\t},\n\t\t\"default\": true\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js\nvar require_ajv = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;\n\tconst core_1 = require_core$3();\n\tconst draft7_1 = require_draft7();\n\tconst discriminator_1 = require_discriminator();\n\tconst draft7MetaSchema = require_json_schema_draft_07();\n\tconst META_SUPPORT_DATA = [\"/properties\"];\n\tconst META_SCHEMA_ID = \"http://json-schema.org/draft-07/schema\";\n\tvar Ajv = class extends core_1.default {\n\t\t_addVocabularies() {\n\t\t\tsuper._addVocabularies();\n\t\t\tdraft7_1.default.forEach((v) => this.addVocabulary(v));\n\t\t\tif (this.opts.discriminator) this.addKeyword(discriminator_1.default);\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tsuper._addDefaultMetaSchema();\n\t\t\tif (!this.opts.meta) return;\n\t\t\tconst metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema;\n\t\t\tthis.addMetaSchema(metaSchema, META_SCHEMA_ID, false);\n\t\t\tthis.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n\t\t}\n\t\tdefaultMeta() {\n\t\t\treturn this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);\n\t\t}\n\t};\n\texports.Ajv = Ajv;\n\tmodule.exports = exports = Ajv;\n\tmodule.exports.Ajv = Ajv;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Ajv;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tvar validation_error_1 = require_validation_error();\n\tObject.defineProperty(exports, \"ValidationError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validation_error_1.default;\n\t\t}\n\t});\n\tvar ref_error_1 = require_ref_error();\n\tObject.defineProperty(exports, \"MissingRefError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn ref_error_1.default;\n\t\t}\n\t});\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js\nvar require_dynamicAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.dynamicAnchor = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst compile_1 = require_compile();\n\tconst ref_1 = require_ref();\n\tconst def = {\n\t\tkeyword: \"$dynamicAnchor\",\n\t\tschemaType: \"string\",\n\t\tcode: (cxt) => dynamicAnchor(cxt, cxt.schema)\n\t};\n\tfunction dynamicAnchor(cxt, anchor) {\n\t\tconst { gen, it } = cxt;\n\t\tit.schemaEnv.root.dynamicAnchors[anchor] = true;\n\t\tconst v = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;\n\t\tconst validate = it.errSchemaPath === \"#\" ? it.validateName : _getValidate(cxt);\n\t\tgen.if((0, codegen_1._)`!${v}`, () => gen.assign(v, validate));\n\t}\n\texports.dynamicAnchor = dynamicAnchor;\n\tfunction _getValidate(cxt) {\n\t\tconst { schemaEnv, schema, self } = cxt.it;\n\t\tconst { root, baseId, localRefs, meta } = schemaEnv.root;\n\t\tconst { schemaId } = self.opts;\n\t\tconst sch = new compile_1.SchemaEnv({\n\t\t\tschema,\n\t\t\tschemaId,\n\t\t\troot,\n\t\t\tbaseId,\n\t\t\tlocalRefs,\n\t\t\tmeta\n\t\t});\n\t\tcompile_1.compileSchema.call(self, sch);\n\t\treturn (0, ref_1.getValidate)(cxt, sch);\n\t}\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js\nvar require_dynamicRef = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.dynamicRef = void 0;\n\tconst codegen_1 = require_codegen();\n\tconst names_1 = require_names();\n\tconst ref_1 = require_ref();\n\tconst def = {\n\t\tkeyword: \"$dynamicRef\",\n\t\tschemaType: \"string\",\n\t\tcode: (cxt) => dynamicRef(cxt, cxt.schema)\n\t};\n\tfunction dynamicRef(cxt, ref) {\n\t\tconst { gen, keyword, it } = cxt;\n\t\tif (ref[0] !== \"#\") throw new Error(`\"${keyword}\" only supports hash fragment reference`);\n\t\tconst anchor = ref.slice(1);\n\t\tif (it.allErrors) _dynamicRef();\n\t\telse {\n\t\t\tconst valid = gen.let(\"valid\", false);\n\t\t\t_dynamicRef(valid);\n\t\t\tcxt.ok(valid);\n\t\t}\n\t\tfunction _dynamicRef(valid) {\n\t\t\tif (it.schemaEnv.root.dynamicAnchors[anchor]) {\n\t\t\t\tconst v = gen.let(\"_v\", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);\n\t\t\t\tgen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));\n\t\t\t} else _callRef(it.validateName, valid)();\n\t\t}\n\t\tfunction _callRef(validate, valid) {\n\t\t\treturn valid ? () => gen.block(() => {\n\t\t\t\t(0, ref_1.callRef)(cxt, validate);\n\t\t\t\tgen.let(valid, true);\n\t\t\t}) : () => (0, ref_1.callRef)(cxt, validate);\n\t\t}\n\t}\n\texports.dynamicRef = dynamicRef;\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js\nvar require_recursiveAnchor = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dynamicAnchor_1 = require_dynamicAnchor();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"$recursiveAnchor\",\n\t\tschemaType: \"boolean\",\n\t\tcode(cxt) {\n\t\t\tif (cxt.schema) (0, dynamicAnchor_1.dynamicAnchor)(cxt, \"\");\n\t\t\telse (0, util_1.checkStrictMode)(cxt.it, \"$recursiveAnchor: false is ignored\");\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js\nvar require_recursiveRef = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dynamicRef_1 = require_dynamicRef();\n\tconst def = {\n\t\tkeyword: \"$recursiveRef\",\n\t\tschemaType: \"string\",\n\t\tcode: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema)\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/dynamic/index.js\nvar require_dynamic = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dynamicAnchor_1 = require_dynamicAnchor();\n\tconst dynamicRef_1 = require_dynamicRef();\n\tconst recursiveAnchor_1 = require_recursiveAnchor();\n\tconst recursiveRef_1 = require_recursiveRef();\n\tconst dynamic = [\n\t\tdynamicAnchor_1.default,\n\t\tdynamicRef_1.default,\n\t\trecursiveAnchor_1.default,\n\t\trecursiveRef_1.default\n\t];\n\texports.default = dynamic;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js\nvar require_dependentRequired = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dependencies_1 = require_dependencies();\n\tconst def = {\n\t\tkeyword: \"dependentRequired\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\terror: dependencies_1.error,\n\t\tcode: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt)\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js\nvar require_dependentSchemas = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dependencies_1 = require_dependencies();\n\tconst def = {\n\t\tkeyword: \"dependentSchemas\",\n\t\ttype: \"object\",\n\t\tschemaType: \"object\",\n\t\tcode: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt)\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js\nvar require_limitContains = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: [\"maxContains\", \"minContains\"],\n\t\ttype: \"array\",\n\t\tschemaType: \"number\",\n\t\tcode({ keyword, parentSchema, it }) {\n\t\t\tif (parentSchema.contains === void 0) (0, util_1.checkStrictMode)(it, `\"${keyword}\" without \"contains\" is ignored`);\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/next.js\nvar require_next = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst dependentRequired_1 = require_dependentRequired();\n\tconst dependentSchemas_1 = require_dependentSchemas();\n\tconst limitContains_1 = require_limitContains();\n\tconst next = [\n\t\tdependentRequired_1.default,\n\t\tdependentSchemas_1.default,\n\t\tlimitContains_1.default\n\t];\n\texports.default = next;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js\nvar require_unevaluatedProperties = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst names_1 = require_names();\n\tconst def = {\n\t\tkeyword: \"unevaluatedProperties\",\n\t\ttype: \"object\",\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\ttrackErrors: true,\n\t\terror: {\n\t\t\tmessage: \"must NOT have unevaluated properties\",\n\t\t\tparams: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, errsCount, it } = cxt;\n\t\t\t/* istanbul ignore if */\n\t\t\tif (!errsCount) throw new Error(\"ajv implementation error\");\n\t\t\tconst { allErrors, props } = it;\n\t\t\tif (props instanceof codegen_1.Name) gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn(\"key\", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));\n\t\t\telse if (props !== true) gen.forIn(\"key\", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));\n\t\t\tit.props = true;\n\t\t\tcxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);\n\t\t\tfunction unevaluatedPropCode(key) {\n\t\t\t\tif (schema === false) {\n\t\t\t\t\tcxt.setParams({ unevaluatedProperty: key });\n\t\t\t\t\tcxt.error();\n\t\t\t\t\tif (!allErrors) gen.break();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\t\tconst valid = gen.name(\"valid\");\n\t\t\t\t\tcxt.subschema({\n\t\t\t\t\t\tkeyword: \"unevaluatedProperties\",\n\t\t\t\t\t\tdataProp: key,\n\t\t\t\t\t\tdataPropType: util_1.Type.Str\n\t\t\t\t\t}, valid);\n\t\t\t\t\tif (!allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction unevaluatedDynamic(evaluatedProps, key) {\n\t\t\t\treturn (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`;\n\t\t\t}\n\t\t\tfunction unevaluatedStatic(evaluatedProps, key) {\n\t\t\t\tconst ps = [];\n\t\t\t\tfor (const p in evaluatedProps) if (evaluatedProps[p] === true) ps.push((0, codegen_1._)`${key} !== ${p}`);\n\t\t\t\treturn (0, codegen_1.and)(...ps);\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js\nvar require_unevaluatedItems = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst codegen_1 = require_codegen();\n\tconst util_1 = require_util();\n\tconst def = {\n\t\tkeyword: \"unevaluatedItems\",\n\t\ttype: \"array\",\n\t\tschemaType: [\"boolean\", \"object\"],\n\t\terror: {\n\t\t\tmessage: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,\n\t\t\tparams: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`\n\t\t},\n\t\tcode(cxt) {\n\t\t\tconst { gen, schema, data, it } = cxt;\n\t\t\tconst items = it.items || 0;\n\t\t\tif (items === true) return;\n\t\t\tconst len = gen.const(\"len\", (0, codegen_1._)`${data}.length`);\n\t\t\tif (schema === false) {\n\t\t\t\tcxt.setParams({ len: items });\n\t\t\t\tcxt.fail((0, codegen_1._)`${len} > ${items}`);\n\t\t\t} else if (typeof schema == \"object\" && !(0, util_1.alwaysValidSchema)(it, schema)) {\n\t\t\t\tconst valid = gen.var(\"valid\", (0, codegen_1._)`${len} <= ${items}`);\n\t\t\t\tgen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));\n\t\t\t\tcxt.ok(valid);\n\t\t\t}\n\t\t\tit.items = true;\n\t\t\tfunction validateItems(valid, from) {\n\t\t\t\tgen.forRange(\"i\", from, len, (i) => {\n\t\t\t\t\tcxt.subschema({\n\t\t\t\t\t\tkeyword: \"unevaluatedItems\",\n\t\t\t\t\t\tdataProp: i,\n\t\t\t\t\t\tdataPropType: util_1.Type.Num\n\t\t\t\t\t}, valid);\n\t\t\t\t\tif (!it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break());\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\texports.default = def;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js\nvar require_unevaluated$1 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst unevaluatedProperties_1 = require_unevaluatedProperties();\n\tconst unevaluatedItems_1 = require_unevaluatedItems();\n\tconst unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];\n\texports.default = unevaluated;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json\nvar require_schema$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$vocabulary\": {\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/core\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/applicator\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/validation\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/meta-data\": true,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/format\": false,\n\t\t\t\"https://json-schema.org/draft/2019-09/vocab/content\": true\n\t\t},\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Core and Validation specifications meta-schema\",\n\t\t\"allOf\": [\n\t\t\t{ \"$ref\": \"meta/core\" },\n\t\t\t{ \"$ref\": \"meta/applicator\" },\n\t\t\t{ \"$ref\": \"meta/validation\" },\n\t\t\t{ \"$ref\": \"meta/meta-data\" },\n\t\t\t{ \"$ref\": \"meta/format\" },\n\t\t\t{ \"$ref\": \"meta/content\" }\n\t\t],\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"definitions\": {\n\t\t\t\t\"$comment\": \"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"$comment\": \"\\\"dependencies\\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\\"dependentSchemas\\\" and \\\"dependentRequired\\\"\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"anyOf\": [{ \"$recursiveRef\": \"#\" }, { \"$ref\": \"meta/validation#/$defs/stringArray\" }] }\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json\nvar require_applicator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/applicator\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/applicator\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Applicator vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"additionalItems\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"unevaluatedItems\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"items\": { \"anyOf\": [{ \"$recursiveRef\": \"#\" }, { \"$ref\": \"#/$defs/schemaArray\" }] },\n\t\t\t\"contains\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"unevaluatedProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"propertyNames\": { \"format\": \"regex\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependentSchemas\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" }\n\t\t\t},\n\t\t\t\"propertyNames\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"if\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"then\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"else\": { \"$recursiveRef\": \"#\" },\n\t\t\t\"allOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"anyOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"oneOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"not\": { \"$recursiveRef\": \"#\" }\n\t\t},\n\t\t\"$defs\": { \"schemaArray\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"minItems\": 1,\n\t\t\t\"items\": { \"$recursiveRef\": \"#\" }\n\t\t} }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json\nvar require_content$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/content\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/content\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Content vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"contentMediaType\": { \"type\": \"string\" },\n\t\t\t\"contentEncoding\": { \"type\": \"string\" },\n\t\t\t\"contentSchema\": { \"$recursiveRef\": \"#\" }\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json\nvar require_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/core\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/core\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Core vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"$id\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\",\n\t\t\t\t\"$comment\": \"Non-empty fragments not allowed.\",\n\t\t\t\t\"pattern\": \"^[^#]*#?$\"\n\t\t\t},\n\t\t\t\"$schema\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"$anchor\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"pattern\": \"^[A-Za-z][-A-Za-z0-9.:_]*$\"\n\t\t\t},\n\t\t\t\"$ref\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$recursiveRef\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t},\n\t\t\t\"$recursiveAnchor\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"$vocabulary\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"propertyNames\": {\n\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\"format\": \"uri\"\n\t\t\t\t},\n\t\t\t\t\"additionalProperties\": { \"type\": \"boolean\" }\n\t\t\t},\n\t\t\t\"$comment\": { \"type\": \"string\" },\n\t\t\t\"$defs\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$recursiveRef\": \"#\" },\n\t\t\t\t\"default\": {}\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json\nvar require_format = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/format\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/format\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Format vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": { \"format\": { \"type\": \"string\" } }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json\nvar require_meta_data$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/meta-data\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/meta-data\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Meta-data vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"title\": { \"type\": \"string\" },\n\t\t\t\"description\": { \"type\": \"string\" },\n\t\t\t\"default\": true,\n\t\t\t\"deprecated\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"readOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"writeOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"examples\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json\nvar require_validation$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2019-09/meta/validation\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2019-09/vocab/validation\": true },\n\t\t\"$recursiveAnchor\": true,\n\t\t\"title\": \"Validation vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"exclusiveMinimum\": 0\n\t\t\t},\n\t\t\t\"maximum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMaximum\": { \"type\": \"number\" },\n\t\t\t\"minimum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMinimum\": { \"type\": \"number\" },\n\t\t\t\"maxLength\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minLength\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"maxItems\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minItems\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxContains\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minContains\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 1\n\t\t\t},\n\t\t\t\"maxProperties\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minProperties\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"required\": { \"$ref\": \"#/$defs/stringArray\" },\n\t\t\t\"dependentRequired\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#/$defs/stringArray\" }\n\t\t\t},\n\t\t\t\"const\": true,\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t},\n\t\t\t\"type\": { \"anyOf\": [{ \"$ref\": \"#/$defs/simpleTypes\" }, {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"$ref\": \"#/$defs/simpleTypes\" },\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}] }\n\t\t},\n\t\t\"$defs\": {\n\t\t\t\"nonNegativeInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"nonNegativeIntegerDefault0\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 0\n\t\t\t},\n\t\t\t\"simpleTypes\": { \"enum\": [\n\t\t\t\t\"array\",\n\t\t\t\t\"boolean\",\n\t\t\t\t\"integer\",\n\t\t\t\t\"null\",\n\t\t\t\t\"number\",\n\t\t\t\t\"object\",\n\t\t\t\t\"string\"\n\t\t\t] },\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"type\": \"string\" },\n\t\t\t\t\"uniqueItems\": true,\n\t\t\t\t\"default\": []\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2019-09/index.js\nvar require_json_schema_2019_09 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst metaSchema = require_schema$1();\n\tconst applicator = require_applicator$1();\n\tconst content = require_content$1();\n\tconst core = require_core$1();\n\tconst format = require_format();\n\tconst metadata = require_meta_data$1();\n\tconst validation = require_validation$1();\n\tconst META_SUPPORT_DATA = [\"/properties\"];\n\tfunction addMetaSchema2019($data) {\n\t\t[\n\t\t\tmetaSchema,\n\t\t\tapplicator,\n\t\t\tcontent,\n\t\t\tcore,\n\t\t\twith$data(this, format),\n\t\t\tmetadata,\n\t\t\twith$data(this, validation)\n\t\t].forEach((sch) => this.addMetaSchema(sch, void 0, false));\n\t\treturn this;\n\t\tfunction with$data(ajv, sch) {\n\t\t\treturn $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;\n\t\t}\n\t}\n\texports.default = addMetaSchema2019;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/2019.js\nvar require__2019 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2019 = void 0;\n\tconst core_1 = require_core$3();\n\tconst draft7_1 = require_draft7();\n\tconst dynamic_1 = require_dynamic();\n\tconst next_1 = require_next();\n\tconst unevaluated_1 = require_unevaluated$1();\n\tconst discriminator_1 = require_discriminator();\n\tconst json_schema_2019_09_1 = require_json_schema_2019_09();\n\tconst META_SCHEMA_ID = \"https://json-schema.org/draft/2019-09/schema\";\n\tvar Ajv2019 = class extends core_1.default {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper({\n\t\t\t\t...opts,\n\t\t\t\tdynamicRef: true,\n\t\t\t\tnext: true,\n\t\t\t\tunevaluated: true\n\t\t\t});\n\t\t}\n\t\t_addVocabularies() {\n\t\t\tsuper._addVocabularies();\n\t\t\tthis.addVocabulary(dynamic_1.default);\n\t\t\tdraft7_1.default.forEach((v) => this.addVocabulary(v));\n\t\t\tthis.addVocabulary(next_1.default);\n\t\t\tthis.addVocabulary(unevaluated_1.default);\n\t\t\tif (this.opts.discriminator) this.addKeyword(discriminator_1.default);\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tsuper._addDefaultMetaSchema();\n\t\t\tconst { $data, meta } = this.opts;\n\t\t\tif (!meta) return;\n\t\t\tjson_schema_2019_09_1.default.call(this, $data);\n\t\t\tthis.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n\t\t}\n\t\tdefaultMeta() {\n\t\t\treturn this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);\n\t\t}\n\t};\n\texports.Ajv2019 = Ajv2019;\n\tmodule.exports = exports = Ajv2019;\n\tmodule.exports.Ajv2019 = Ajv2019;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Ajv2019;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tvar validation_error_1 = require_validation_error();\n\tObject.defineProperty(exports, \"ValidationError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validation_error_1.default;\n\t\t}\n\t});\n\tvar ref_error_1 = require_ref_error();\n\tObject.defineProperty(exports, \"MissingRefError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn ref_error_1.default;\n\t\t}\n\t});\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft2020.js\nvar require_draft2020 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst core_1 = require_core$2();\n\tconst validation_1 = require_validation$2();\n\tconst applicator_1 = require_applicator$2();\n\tconst dynamic_1 = require_dynamic();\n\tconst next_1 = require_next();\n\tconst unevaluated_1 = require_unevaluated$1();\n\tconst format_1 = require_format$1();\n\tconst metadata_1 = require_metadata();\n\tconst draft2020Vocabularies = [\n\t\tdynamic_1.default,\n\t\tcore_1.default,\n\t\tvalidation_1.default,\n\t\t(0, applicator_1.default)(true),\n\t\tformat_1.default,\n\t\tmetadata_1.metadataVocabulary,\n\t\tmetadata_1.contentVocabulary,\n\t\tnext_1.default,\n\t\tunevaluated_1.default\n\t];\n\texports.default = draft2020Vocabularies;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json\nvar require_schema = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$vocabulary\": {\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/core\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/applicator\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/unevaluated\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/validation\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/meta-data\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/format-annotation\": true,\n\t\t\t\"https://json-schema.org/draft/2020-12/vocab/content\": true\n\t\t},\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Core and Validation specifications meta-schema\",\n\t\t\"allOf\": [\n\t\t\t{ \"$ref\": \"meta/core\" },\n\t\t\t{ \"$ref\": \"meta/applicator\" },\n\t\t\t{ \"$ref\": \"meta/unevaluated\" },\n\t\t\t{ \"$ref\": \"meta/validation\" },\n\t\t\t{ \"$ref\": \"meta/meta-data\" },\n\t\t\t{ \"$ref\": \"meta/format-annotation\" },\n\t\t\t{ \"$ref\": \"meta/content\" }\n\t\t],\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"$comment\": \"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.\",\n\t\t\"properties\": {\n\t\t\t\"definitions\": {\n\t\t\t\t\"$comment\": \"\\\"definitions\\\" has been replaced by \\\"$defs\\\".\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"deprecated\": true,\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependencies\": {\n\t\t\t\t\"$comment\": \"\\\"dependencies\\\" has been split and replaced by \\\"dependentSchemas\\\" and \\\"dependentRequired\\\" in order to serve their differing semantics.\",\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"anyOf\": [{ \"$dynamicRef\": \"#meta\" }, { \"$ref\": \"meta/validation#/$defs/stringArray\" }] },\n\t\t\t\t\"deprecated\": true,\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"$recursiveAnchor\": {\n\t\t\t\t\"$comment\": \"\\\"$recursiveAnchor\\\" has been replaced by \\\"$dynamicAnchor\\\".\",\n\t\t\t\t\"$ref\": \"meta/core#/$defs/anchorString\",\n\t\t\t\t\"deprecated\": true\n\t\t\t},\n\t\t\t\"$recursiveRef\": {\n\t\t\t\t\"$comment\": \"\\\"$recursiveRef\\\" has been replaced by \\\"$dynamicRef\\\".\",\n\t\t\t\t\"$ref\": \"meta/core#/$defs/uriReferenceString\",\n\t\t\t\t\"deprecated\": true\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json\nvar require_applicator = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/applicator\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/applicator\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Applicator vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"prefixItems\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"items\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"contains\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"properties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"patternProperties\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"propertyNames\": { \"format\": \"regex\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"dependentSchemas\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\t\"default\": {}\n\t\t\t},\n\t\t\t\"propertyNames\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"if\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"then\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"else\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"allOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"anyOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"oneOf\": { \"$ref\": \"#/$defs/schemaArray\" },\n\t\t\t\"not\": { \"$dynamicRef\": \"#meta\" }\n\t\t},\n\t\t\"$defs\": { \"schemaArray\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"minItems\": 1,\n\t\t\t\"items\": { \"$dynamicRef\": \"#meta\" }\n\t\t} }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json\nvar require_unevaluated = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/unevaluated\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/unevaluated\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Unevaluated applicator vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"unevaluatedItems\": { \"$dynamicRef\": \"#meta\" },\n\t\t\t\"unevaluatedProperties\": { \"$dynamicRef\": \"#meta\" }\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json\nvar require_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/content\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/content\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Content vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"contentEncoding\": { \"type\": \"string\" },\n\t\t\t\"contentMediaType\": { \"type\": \"string\" },\n\t\t\t\"contentSchema\": { \"$dynamicRef\": \"#meta\" }\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json\nvar require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/core\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/core\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Core vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"$id\": {\n\t\t\t\t\"$ref\": \"#/$defs/uriReferenceString\",\n\t\t\t\t\"$comment\": \"Non-empty fragments not allowed.\",\n\t\t\t\t\"pattern\": \"^[^#]*#?$\"\n\t\t\t},\n\t\t\t\"$schema\": { \"$ref\": \"#/$defs/uriString\" },\n\t\t\t\"$ref\": { \"$ref\": \"#/$defs/uriReferenceString\" },\n\t\t\t\"$anchor\": { \"$ref\": \"#/$defs/anchorString\" },\n\t\t\t\"$dynamicRef\": { \"$ref\": \"#/$defs/uriReferenceString\" },\n\t\t\t\"$dynamicAnchor\": { \"$ref\": \"#/$defs/anchorString\" },\n\t\t\t\"$vocabulary\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"propertyNames\": { \"$ref\": \"#/$defs/uriString\" },\n\t\t\t\t\"additionalProperties\": { \"type\": \"boolean\" }\n\t\t\t},\n\t\t\t\"$comment\": { \"type\": \"string\" },\n\t\t\t\"$defs\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$dynamicRef\": \"#meta\" }\n\t\t\t}\n\t\t},\n\t\t\"$defs\": {\n\t\t\t\"anchorString\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"pattern\": \"^[A-Za-z_][-A-Za-z0-9._]*$\"\n\t\t\t},\n\t\t\t\"uriString\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri\"\n\t\t\t},\n\t\t\t\"uriReferenceString\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"uri-reference\"\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json\nvar require_format_annotation = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/format-annotation\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/format-annotation\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Format vocabulary meta-schema for annotation results\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": { \"format\": { \"type\": \"string\" } }\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json\nvar require_meta_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/meta-data\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/meta-data\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Meta-data vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"title\": { \"type\": \"string\" },\n\t\t\t\"description\": { \"type\": \"string\" },\n\t\t\t\"default\": true,\n\t\t\t\"deprecated\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"readOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"writeOnly\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"examples\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json\nvar require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tmodule.exports = {\n\t\t\"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n\t\t\"$id\": \"https://json-schema.org/draft/2020-12/meta/validation\",\n\t\t\"$vocabulary\": { \"https://json-schema.org/draft/2020-12/vocab/validation\": true },\n\t\t\"$dynamicAnchor\": \"meta\",\n\t\t\"title\": \"Validation vocabulary meta-schema\",\n\t\t\"type\": [\"object\", \"boolean\"],\n\t\t\"properties\": {\n\t\t\t\"type\": { \"anyOf\": [{ \"$ref\": \"#/$defs/simpleTypes\" }, {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"$ref\": \"#/$defs/simpleTypes\" },\n\t\t\t\t\"minItems\": 1,\n\t\t\t\t\"uniqueItems\": true\n\t\t\t}] },\n\t\t\t\"const\": true,\n\t\t\t\"enum\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": true\n\t\t\t},\n\t\t\t\"multipleOf\": {\n\t\t\t\t\"type\": \"number\",\n\t\t\t\t\"exclusiveMinimum\": 0\n\t\t\t},\n\t\t\t\"maximum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMaximum\": { \"type\": \"number\" },\n\t\t\t\"minimum\": { \"type\": \"number\" },\n\t\t\t\"exclusiveMinimum\": { \"type\": \"number\" },\n\t\t\t\"maxLength\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minLength\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"pattern\": {\n\t\t\t\t\"type\": \"string\",\n\t\t\t\t\"format\": \"regex\"\n\t\t\t},\n\t\t\t\"maxItems\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minItems\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"uniqueItems\": {\n\t\t\t\t\"type\": \"boolean\",\n\t\t\t\t\"default\": false\n\t\t\t},\n\t\t\t\"maxContains\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minContains\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 1\n\t\t\t},\n\t\t\t\"maxProperties\": { \"$ref\": \"#/$defs/nonNegativeInteger\" },\n\t\t\t\"minProperties\": { \"$ref\": \"#/$defs/nonNegativeIntegerDefault0\" },\n\t\t\t\"required\": { \"$ref\": \"#/$defs/stringArray\" },\n\t\t\t\"dependentRequired\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"additionalProperties\": { \"$ref\": \"#/$defs/stringArray\" }\n\t\t\t}\n\t\t},\n\t\t\"$defs\": {\n\t\t\t\"nonNegativeInteger\": {\n\t\t\t\t\"type\": \"integer\",\n\t\t\t\t\"minimum\": 0\n\t\t\t},\n\t\t\t\"nonNegativeIntegerDefault0\": {\n\t\t\t\t\"$ref\": \"#/$defs/nonNegativeInteger\",\n\t\t\t\t\"default\": 0\n\t\t\t},\n\t\t\t\"simpleTypes\": { \"enum\": [\n\t\t\t\t\"array\",\n\t\t\t\t\"boolean\",\n\t\t\t\t\"integer\",\n\t\t\t\t\"null\",\n\t\t\t\t\"number\",\n\t\t\t\t\"object\",\n\t\t\t\t\"string\"\n\t\t\t] },\n\t\t\t\"stringArray\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"items\": { \"type\": \"string\" },\n\t\t\t\t\"uniqueItems\": true,\n\t\t\t\t\"default\": []\n\t\t\t}\n\t\t}\n\t};\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js\nvar require_json_schema_2020_12 = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst metaSchema = require_schema();\n\tconst applicator = require_applicator();\n\tconst unevaluated = require_unevaluated();\n\tconst content = require_content();\n\tconst core = require_core();\n\tconst format = require_format_annotation();\n\tconst metadata = require_meta_data();\n\tconst validation = require_validation();\n\tconst META_SUPPORT_DATA = [\"/properties\"];\n\tfunction addMetaSchema2020($data) {\n\t\t[\n\t\t\tmetaSchema,\n\t\t\tapplicator,\n\t\t\tunevaluated,\n\t\t\tcontent,\n\t\t\tcore,\n\t\t\twith$data(this, format),\n\t\t\tmetadata,\n\t\t\twith$data(this, validation)\n\t\t].forEach((sch) => this.addMetaSchema(sch, void 0, false));\n\t\treturn this;\n\t\tfunction with$data(ajv, sch) {\n\t\t\treturn $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;\n\t\t}\n\t}\n\texports.default = addMetaSchema2020;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/2020.js\nvar require__2020 = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;\n\tconst core_1 = require_core$3();\n\tconst draft2020_1 = require_draft2020();\n\tconst discriminator_1 = require_discriminator();\n\tconst json_schema_2020_12_1 = require_json_schema_2020_12();\n\tconst META_SCHEMA_ID = \"https://json-schema.org/draft/2020-12/schema\";\n\tvar Ajv2020 = class extends core_1.default {\n\t\tconstructor(opts = {}) {\n\t\t\tsuper({\n\t\t\t\t...opts,\n\t\t\t\tdynamicRef: true,\n\t\t\t\tnext: true,\n\t\t\t\tunevaluated: true\n\t\t\t});\n\t\t}\n\t\t_addVocabularies() {\n\t\t\tsuper._addVocabularies();\n\t\t\tdraft2020_1.default.forEach((v) => this.addVocabulary(v));\n\t\t\tif (this.opts.discriminator) this.addKeyword(discriminator_1.default);\n\t\t}\n\t\t_addDefaultMetaSchema() {\n\t\t\tsuper._addDefaultMetaSchema();\n\t\t\tconst { $data, meta } = this.opts;\n\t\t\tif (!meta) return;\n\t\t\tjson_schema_2020_12_1.default.call(this, $data);\n\t\t\tthis.refs[\"http://json-schema.org/schema\"] = META_SCHEMA_ID;\n\t\t}\n\t\tdefaultMeta() {\n\t\t\treturn this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);\n\t\t}\n\t};\n\texports.Ajv2020 = Ajv2020;\n\tmodule.exports = exports = Ajv2020;\n\tmodule.exports.Ajv2020 = Ajv2020;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = Ajv2020;\n\tvar validate_1 = require_validate();\n\tObject.defineProperty(exports, \"KeywordCxt\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validate_1.KeywordCxt;\n\t\t}\n\t});\n\tvar codegen_1 = require_codegen();\n\tObject.defineProperty(exports, \"_\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1._;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"str\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.str;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"stringify\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.stringify;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"nil\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.nil;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"Name\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.Name;\n\t\t}\n\t});\n\tObject.defineProperty(exports, \"CodeGen\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn codegen_1.CodeGen;\n\t\t}\n\t});\n\tvar validation_error_1 = require_validation_error();\n\tObject.defineProperty(exports, \"ValidationError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn validation_error_1.default;\n\t\t}\n\t});\n\tvar ref_error_1 = require_ref_error();\n\tObject.defineProperty(exports, \"MissingRefError\", {\n\t\tenumerable: true,\n\t\tget: function() {\n\t\t\treturn ref_error_1.default;\n\t\t}\n\t});\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js\nvar require_formats = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.formatNames = exports.fastFormats = exports.fullFormats = void 0;\n\tfunction fmtDef(validate, compare) {\n\t\treturn {\n\t\t\tvalidate,\n\t\t\tcompare\n\t\t};\n\t}\n\texports.fullFormats = {\n\t\tdate: fmtDef(date, compareDate),\n\t\ttime: fmtDef(getTime(true), compareTime),\n\t\t\"date-time\": fmtDef(getDateTime(true), compareDateTime),\n\t\t\"iso-time\": fmtDef(getTime(), compareIsoTime),\n\t\t\"iso-date-time\": fmtDef(getDateTime(), compareIsoDateTime),\n\t\tduration: /^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/,\n\t\turi,\n\t\t\"uri-reference\": /^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'\"()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'\"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\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))$/i,\n\t\tregex,\n\t\tuuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\n\t\t\"json-pointer\": /^(?:\\/(?:[^~/]|~0|~1)*)*$/,\n\t\t\"json-pointer-uri-fragment\": /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\n\t\t\"relative-json-pointer\": /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,\n\t\tbyte,\n\t\tint32: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateInt32\n\t\t},\n\t\tint64: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateInt64\n\t\t},\n\t\tfloat: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateNumber\n\t\t},\n\t\tdouble: {\n\t\t\ttype: \"number\",\n\t\t\tvalidate: validateNumber\n\t\t},\n\t\tpassword: true,\n\t\tbinary: true\n\t};\n\texports.fastFormats = {\n\t\t...exports.fullFormats,\n\t\tdate: fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/, compareDate),\n\t\ttime: fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i, compareTime),\n\t\t\"date-time\": fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i, compareDateTime),\n\t\t\"iso-time\": fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i, compareIsoTime),\n\t\t\"iso-date-time\": fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i, compareIsoDateTime),\n\t\turi: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n\t\t\"uri-reference\": /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n\t\temail: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i\n\t};\n\texports.formatNames = Object.keys(exports.fullFormats);\n\tfunction isLeapYear(year) {\n\t\treturn year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n\t}\n\tconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\n\tconst DAYS = [\n\t\t0,\n\t\t31,\n\t\t28,\n\t\t31,\n\t\t30,\n\t\t31,\n\t\t30,\n\t\t31,\n\t\t31,\n\t\t30,\n\t\t31,\n\t\t30,\n\t\t31\n\t];\n\tfunction date(str) {\n\t\tconst matches = DATE.exec(str);\n\t\tif (!matches) return false;\n\t\tconst year = +matches[1];\n\t\tconst month = +matches[2];\n\t\tconst day = +matches[3];\n\t\treturn month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);\n\t}\n\tfunction compareDate(d1, d2) {\n\t\tif (!(d1 && d2)) return void 0;\n\t\tif (d1 > d2) return 1;\n\t\tif (d1 < d2) return -1;\n\t\treturn 0;\n\t}\n\tconst TIME = /^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i;\n\tfunction getTime(strictTimeZone) {\n\t\treturn function time(str) {\n\t\t\tconst matches = TIME.exec(str);\n\t\t\tif (!matches) return false;\n\t\t\tconst hr = +matches[1];\n\t\t\tconst min = +matches[2];\n\t\t\tconst sec = +matches[3];\n\t\t\tconst tz = matches[4];\n\t\t\tconst tzSign = matches[5] === \"-\" ? -1 : 1;\n\t\t\tconst tzH = +(matches[6] || 0);\n\t\t\tconst tzM = +(matches[7] || 0);\n\t\t\tif (tzH > 23 || tzM > 59 || strictTimeZone && !tz) return false;\n\t\t\tif (hr <= 23 && min <= 59 && sec < 60) return true;\n\t\t\tconst utcMin = min - tzM * tzSign;\n\t\t\tconst utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);\n\t\t\treturn (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;\n\t\t};\n\t}\n\tfunction compareTime(s1, s2) {\n\t\tif (!(s1 && s2)) return void 0;\n\t\tconst t1 = (/* @__PURE__ */ new Date(\"2020-01-01T\" + s1)).valueOf();\n\t\tconst t2 = (/* @__PURE__ */ new Date(\"2020-01-01T\" + s2)).valueOf();\n\t\tif (!(t1 && t2)) return void 0;\n\t\treturn t1 - t2;\n\t}\n\tfunction compareIsoTime(t1, t2) {\n\t\tif (!(t1 && t2)) return void 0;\n\t\tconst a1 = TIME.exec(t1);\n\t\tconst a2 = TIME.exec(t2);\n\t\tif (!(a1 && a2)) return void 0;\n\t\tt1 = a1[1] + a1[2] + a1[3];\n\t\tt2 = a2[1] + a2[2] + a2[3];\n\t\tif (t1 > t2) return 1;\n\t\tif (t1 < t2) return -1;\n\t\treturn 0;\n\t}\n\tconst DATE_TIME_SEPARATOR = /t|\\s/i;\n\tfunction getDateTime(strictTimeZone) {\n\t\tconst time = getTime(strictTimeZone);\n\t\treturn function date_time(str) {\n\t\t\tconst dateTime = str.split(DATE_TIME_SEPARATOR);\n\t\t\treturn dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);\n\t\t};\n\t}\n\tfunction compareDateTime(dt1, dt2) {\n\t\tif (!(dt1 && dt2)) return void 0;\n\t\tconst d1 = new Date(dt1).valueOf();\n\t\tconst d2 = new Date(dt2).valueOf();\n\t\tif (!(d1 && d2)) return void 0;\n\t\treturn d1 - d2;\n\t}\n\tfunction compareIsoDateTime(dt1, dt2) {\n\t\tif (!(dt1 && dt2)) return void 0;\n\t\tconst [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);\n\t\tconst [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);\n\t\tconst res = compareDate(d1, d2);\n\t\tif (res === void 0) return void 0;\n\t\treturn res || compareTime(t1, t2);\n\t}\n\tconst NOT_URI_FRAGMENT = /\\/|:/;\n\tconst URI = /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\?(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;\n\tfunction uri(str) {\n\t\treturn NOT_URI_FRAGMENT.test(str) && URI.test(str);\n\t}\n\tconst BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;\n\tfunction byte(str) {\n\t\tBYTE.lastIndex = 0;\n\t\treturn BYTE.test(str);\n\t}\n\tconst MIN_INT32 = -(2 ** 31);\n\tconst MAX_INT32 = 2 ** 31 - 1;\n\tfunction validateInt32(value) {\n\t\treturn Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;\n\t}\n\tfunction validateInt64(value) {\n\t\treturn Number.isInteger(value);\n\t}\n\tfunction validateNumber() {\n\t\treturn true;\n\t}\n\tconst Z_ANCHOR = /[^\\\\]\\\\Z/;\n\tfunction regex(str) {\n\t\tif (Z_ANCHOR.test(str)) return false;\n\t\ttry {\n\t\t\tnew RegExp(str);\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t}\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js\nvar require_limit = /* @__PURE__ */ __commonJSMin(((exports) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.formatLimitDefinition = void 0;\n\tconst ajv_1 = require_ajv();\n\tconst codegen_1 = require_codegen();\n\tconst ops = codegen_1.operators;\n\tconst KWDs = {\n\t\tformatMaximum: {\n\t\t\tokStr: \"<=\",\n\t\t\tok: ops.LTE,\n\t\t\tfail: ops.GT\n\t\t},\n\t\tformatMinimum: {\n\t\t\tokStr: \">=\",\n\t\t\tok: ops.GTE,\n\t\t\tfail: ops.LT\n\t\t},\n\t\tformatExclusiveMaximum: {\n\t\t\tokStr: \"<\",\n\t\t\tok: ops.LT,\n\t\t\tfail: ops.GTE\n\t\t},\n\t\tformatExclusiveMinimum: {\n\t\t\tokStr: \">\",\n\t\t\tok: ops.GT,\n\t\t\tfail: ops.LTE\n\t\t}\n\t};\n\tconst error = {\n\t\tmessage: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`,\n\t\tparams: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`\n\t};\n\texports.formatLimitDefinition = {\n\t\tkeyword: Object.keys(KWDs),\n\t\ttype: \"string\",\n\t\tschemaType: \"string\",\n\t\t$data: true,\n\t\terror,\n\t\tcode(cxt) {\n\t\t\tconst { gen, data, schemaCode, keyword, it } = cxt;\n\t\t\tconst { opts, self } = it;\n\t\t\tif (!opts.validateFormats) return;\n\t\t\tconst fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, \"format\");\n\t\t\tif (fCxt.$data) validate$DataFormat();\n\t\t\telse validateFormat();\n\t\t\tfunction validate$DataFormat() {\n\t\t\t\tconst fmts = gen.scopeValue(\"formats\", {\n\t\t\t\t\tref: self.formats,\n\t\t\t\t\tcode: opts.code.formats\n\t\t\t\t});\n\t\t\t\tconst fmt = gen.const(\"fmt\", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`);\n\t\t\t\tcxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != \"object\"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != \"function\"`, compareCode(fmt)));\n\t\t\t}\n\t\t\tfunction validateFormat() {\n\t\t\t\tconst format = fCxt.schema;\n\t\t\t\tconst fmtDef = self.formats[format];\n\t\t\t\tif (!fmtDef || fmtDef === true) return;\n\t\t\t\tif (typeof fmtDef != \"object\" || fmtDef instanceof RegExp || typeof fmtDef.compare != \"function\") throw new Error(`\"${keyword}\": format \"${format}\" does not define \"compare\" function`);\n\t\t\t\tconst fmt = gen.scopeValue(\"formats\", {\n\t\t\t\t\tkey: format,\n\t\t\t\t\tref: fmtDef,\n\t\t\t\t\tcode: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : void 0\n\t\t\t\t});\n\t\t\t\tcxt.fail$data(compareCode(fmt));\n\t\t\t}\n\t\t\tfunction compareCode(fmt) {\n\t\t\t\treturn (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;\n\t\t\t}\n\t\t},\n\t\tdependencies: [\"format\"]\n\t};\n\tconst formatLimitPlugin = (ajv) => {\n\t\tajv.addKeyword(exports.formatLimitDefinition);\n\t\treturn ajv;\n\t};\n\texports.default = formatLimitPlugin;\n}));\n\n//#endregion\n//#region ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js\nvar require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\tconst formats_1 = require_formats();\n\tconst limit_1 = require_limit();\n\tconst codegen_1 = require_codegen();\n\tconst fullName = new codegen_1.Name(\"fullFormats\");\n\tconst fastName = new codegen_1.Name(\"fastFormats\");\n\tconst formatsPlugin = (ajv, opts = { keywords: true }) => {\n\t\tif (Array.isArray(opts)) {\n\t\t\taddFormats(ajv, opts, formats_1.fullFormats, fullName);\n\t\t\treturn ajv;\n\t\t}\n\t\tconst [formats, exportName] = opts.mode === \"fast\" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];\n\t\taddFormats(ajv, opts.formats || formats_1.formatNames, formats, exportName);\n\t\tif (opts.keywords) (0, limit_1.default)(ajv);\n\t\treturn ajv;\n\t};\n\tformatsPlugin.get = (name, mode = \"full\") => {\n\t\tconst f = (mode === \"fast\" ? formats_1.fastFormats : formats_1.fullFormats)[name];\n\t\tif (!f) throw new Error(`Unknown format \"${name}\"`);\n\t\treturn f;\n\t};\n\tfunction addFormats(ajv, list, fs, exportName) {\n\t\tvar _a;\n\t\tvar _b;\n\t\t(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 || (_b.formats = (0, codegen_1._)`require(\"ajv-formats/dist/formats\").${exportName}`);\n\t\tfor (const f of list) ajv.addFormat(f, fs[f]);\n\t}\n\tmodule.exports = exports = formatsPlugin;\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = formatsPlugin;\n}));\n\n//#endregion\n//#region ../core-internal/src/validators/ajvProvider.ts\nvar import_ajv = require_ajv();\nvar import__2019 = require__2019();\nvar import__2020 = require__2020();\nvar import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);\n/** `ajv-formats` default export, normalised through the CJS/ESM interop wrapper. */\nconst addFormats = import_dist.default;\nfunction createDefaultAjvInstance(engineClass) {\n\tconst ajv = new engineClass({\n\t\tstrict: false,\n\t\tvalidateFormats: true,\n\t\tvalidateSchema: false,\n\t\tallErrors: true\n\t});\n\taddFormats(ajv);\n\treturn ajv;\n}\n/**\n* AJV-backed JSON Schema validator. See `@modelcontextprotocol/{client,server}/validators/ajv`\n* for the customisation entry point (re-exports `Ajv` and `addFormats` from the bundled copy).\n*\n* Default dispatches on the schema's declared dialect: no `$schema` or 2020-12 → `Ajv2020`\n* (SEP-1613); 2019-09 → `Ajv2019`; draft-07 or draft-06 → the classic draft-07 `Ajv` class\n* (draft-07's changes over draft-06 are additive, so one engine covers both). Known draft-07 deviation: classic Ajv\n* evaluates keywords adjacent to `$ref` (stricter than draft-07's ignore-siblings rule, matching\n* v1's default engine), while the cfworker provider ignores them per spec.\n* Schemas declaring any other `$schema` are\n* rejected with a plain `Error`; pass a pre-configured Ajv instance to validate\n* other dialects. The SDK bundles ajv internally but does not re-export `Ajv2020` (its type\n* graph tips downstream declaration bundling — see #2339). To construct a custom 2020-12\n* instance, add `ajv` to your own dependencies (matching the SDK's pinned version) and\n* `import { Ajv2020 } from 'ajv/dist/2020.js'` — `new Ajv(...)` is the draft-07 class and would\n* silently downgrade dialect.\n*\n* @example Use with default configuration\n* ```ts source=\"./ajvProvider.examples.ts#AjvJsonSchemaValidator_default\"\n* const validator = new AjvJsonSchemaValidator();\n* ```\n*\n* @example Use with a custom AJV instance\n* ```ts source=\"./ajvProvider.examples.ts#AjvJsonSchemaValidator_customInstance\"\n* // import { Ajv2020 } from 'ajv/dist/2020.js';\n* const ajv = new Ajv2020({ strict: false, validateSchema: false, allErrors: true });\n* const validator = new AjvJsonSchemaValidator(ajv);\n* ```\n*\n* @example Register ajv-formats\n* ```ts source=\"./ajvProvider.examples.ts#AjvJsonSchemaValidator_withFormats\"\n* // import { Ajv2020 } from 'ajv/dist/2020.js';\n* const ajv = new Ajv2020({ strict: false, validateSchema: false, allErrors: true });\n* addFormats(ajv);\n* const validator = new AjvJsonSchemaValidator(ajv);\n* ```\n*/\nvar AjvJsonSchemaValidator = class {\n\t_ajv;\n\t/** Lazy classic (draft-07) engine, built on the first draft-07/draft-06-declared schema. */\n\t_ajvDraft7;\n\t/** Lazy 2019-09 engine, built on the first 2019-09-declared schema. */\n\t_ajv2019;\n\t/** True iff the constructor received a caller-supplied engine; the `$schema` dispatch is skipped. */\n\t_userAjv;\n\t/**\n\t* @param ajv - Optional pre-configured AJV-compatible instance. When supplied, this instance is\n\t* used for **every** schema regardless of its declared `$schema` (the caller owns dialect\n\t* choice). When omitted, the provider constructs per-dialect engines (`Ajv2020`, `Ajv2019`,\n\t* and the classic draft-07 `Ajv` for draft-07/06-declared schemas) with\n\t* `strict: false`, `validateFormats: true`, `validateSchema: false`, `allErrors: true`, and\n\t* `ajv-formats` registered — **lazily, on the first {@linkcode getValidator} call needing each**, so\n\t* constructing the provider (e.g. as the default validator of a `Client`/`Server` that never\n\t* validates a JSON Schema) does not pay the ajv + ajv-formats instantiation cost. The parameter\n\t* is typed structurally so consumers who don't pass an instance need not have `ajv` installed.\n\t*/\n\tconstructor(ajv) {\n\t\tthis._userAjv = ajv !== void 0;\n\t\tthis._ajv = ajv;\n\t}\n\t/** The underlying 2020-12 engine — the default instance is created on first use. */\n\tget ajv() {\n\t\treturn this._ajv ??= createDefaultAjvInstance(import__2020.Ajv2020);\n\t}\n\t/**\n\t* Pick the engine for a schema's declared dialect. A caller-supplied engine is used for\n\t* every schema — do not second-guess by `$schema` (bring-your-own-validator means\n\t* bring-your-own-dialect). Otherwise: no `$schema` or 2020-12 → `Ajv2020`; 2019-09 →\n\t* `Ajv2019`; draft-07 or draft-06 → classic `Ajv`; anything else → `Error`.\n\t*/\n\t_engineFor(schema) {\n\t\tif (this._userAjv) return this.ajv;\n\t\tconst dialect = declaredDialect(schema, \"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.\");\n\t\tif (dialect === \"2020-12\") return this.ajv;\n\t\tif (dialect === \"2019-09\") return this._ajv2019 ??= createDefaultAjvInstance(import__2019.Ajv2019);\n\t\treturn this._ajvDraft7 ??= createDefaultAjvInstance(import_ajv.Ajv);\n\t}\n\tgetValidator(schema) {\n\t\tconst engine = this._engineFor(schema);\n\t\tconst ajvValidator = \"$id\" in schema && typeof schema.$id === \"string\" ? engine.getSchema(schema.$id) ?? engine.compile(schema) : engine.compile(schema);\n\t\treturn (input) => {\n\t\t\treturn ajvValidator(input) ? {\n\t\t\t\tvalid: true,\n\t\t\t\tdata: input,\n\t\t\t\terrorMessage: void 0\n\t\t\t} : {\n\t\t\t\tvalid: false,\n\t\t\t\tdata: void 0,\n\t\t\t\terrorMessage: engine.errorsText(ajvValidator.errors)\n\t\t\t};\n\t\t};\n\t}\n};\n/**\n* Draft-07 AJV class, re-exported for consumers who need to opt back to the pre-SEP-1613 default.\n* The full v1-equivalent construction is:\n*\n* ```ts\n* const ajv = new Ajv({ strict: false, validateFormats: true, validateSchema: false, allErrors: true });\n* addFormats(ajv);\n* new AjvJsonSchemaValidator(ajv);\n* ```\n*\n* (omitting `validateSchema: false` makes a 2020-12-stamped `$schema` fail with an opaque\n* \"no schema with key or ref …\" engine error; omitting `addFormats` silently drops `format`\n* validation that the v1 default had).\n*\n* The SDK bundles ajv internally but does not re-export `Ajv2020` (its type graph tips downstream\n* declaration bundling — see #2339). To construct a custom 2020-12 instance, add `ajv` to your own\n* dependencies (matching the SDK's pinned version) and `import { Ajv2020 } from 'ajv/dist/2020.js'`.\n*/\nconst Ajv = import_ajv.Ajv;\n\n//#endregion\nexport { AjvJsonSchemaValidator as n, addFormats as r, Ajv as t };\n//# sourceMappingURL=ajvProvider-CEoC__sr.mjs.map","import { A as promptArgumentsFromStandardSchema, At as LATEST_PROTOCOL_VERSION, B as scanXMcpHeaderDeclarations, C as REQUEST_STATE_ONLY_LEG_PACING_MS, Ct as CLIENT_CAPABILITIES_META_KEY, E as sleep, H as assertCompleteRequestPrompt, Ht as requiredClientCapabilitiesForInputRequest, It as SERVER_INFO_META_KEY, Kt as SdkError, Lt as SUBSCRIPTION_ID_META_KEY, M as validateStandardSchema, N as parseSchema, T as linkedRoundAbort, U as assertCompleteRequestResourceTemplate, Vt as missingClientCapabilities, _ as mergeCapabilities, _t as normalizeContentlessToolResult, a as UriTemplate, b as withRequestStateValue, bt as legacyProtocolVersions, ct as codecForVersion, dt as ResourceNotFoundError, g as Protocol, gt as attachCacheHintFallback, ht as assertValidCacheHint, j as standardSchemaToJsonSchema, jt as LOG_LEVEL_META_KEY, lt as MissingRequiredClientCapabilityError, mt as ProtocolErrorCode, nt as LoggingLevelSchema, q as isInputRequiredResult, qt as SdkErrorCode, r as normalizeRawShapeSchema, s as validateAndWarnToolName, st as MODERN_WIRE_REVISION, ut as ProtocolError, v as requestStateAccessor, w as inputRequiredRoundsExceededMessage, xt as modernProtocolVersions, yt as isModernProtocolVersion } from \"./src-CX2iR2pK.mjs\";\nimport { DefaultJsonSchemaValidator } from \"@modelcontextprotocol/server/_shims\";\n\n//#region src/server/completable.ts\nconst COMPLETABLE_SYMBOL = Symbol.for(\"mcp.completable\");\n/**\n* Wraps a schema to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP.\n*\n* @example\n* ```ts source=\"./completable.examples.ts#completable_basicUsage\"\n* server.registerPrompt(\n* 'review-code',\n* {\n* title: 'Code Review',\n* argsSchema: z.object({\n* language: completable(z.string().describe('Programming language'), value =>\n* ['typescript', 'javascript', 'python', 'rust', 'go'].filter(lang => lang.startsWith(value))\n* )\n* })\n* },\n* ({ language }) => ({\n* messages: [\n* {\n* role: 'user' as const,\n* content: {\n* type: 'text' as const,\n* text: `Review this ${language} code.`\n* }\n* }\n* ]\n* })\n* );\n* ```\n*\n* @see {@linkcode server/mcp.McpServer.registerPrompt | McpServer.registerPrompt} for using completable schemas in prompt argument definitions\n*/\nfunction completable(schema, complete) {\n\tObject.defineProperty(schema, COMPLETABLE_SYMBOL, {\n\t\tvalue: { complete },\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n\treturn schema;\n}\n/**\n* Checks if a schema is completable (has completion metadata).\n*/\nfunction isCompletable(schema) {\n\treturn !!schema && typeof schema === \"object\" && COMPLETABLE_SYMBOL in schema;\n}\n/**\n* Gets the completer callback from a completable schema, if it exists.\n*/\nfunction getCompleter(schema) {\n\treturn schema[COMPLETABLE_SYMBOL]?.complete;\n}\n\n//#endregion\n//#region src/server/sseKeepAlive.ts\n/** Default interval between SSE keep-alive comment frames. */\nconst DEFAULT_SSE_KEEP_ALIVE_MS = 15e3;\nconst MAX_TIMER_DELAY_MS = 2 ** 31 - 1;\n/** Arms an unref'd timer, or disables keep-alive for invalid delays. */\nfunction armSseKeepAlive(intervalMs, onTick) {\n\tif (!Number.isFinite(intervalMs) || intervalMs < 1) return;\n\tconst timer = setInterval(onTick, Math.min(intervalMs, MAX_TIMER_DELAY_MS));\n\ttimer.unref?.();\n\treturn timer;\n}\n\n//#endregion\n//#region src/server/serverEventBus.ts\n/**\n* A `ServerEventBus` backed by an in-process listener set.\n*\n* `publish()` delivers synchronously to the live listener set (a listener\n* unsubscribing itself mid-dispatch is safe; the entry's listen-router\n* listeners never unsubscribe peers). A throwing listener does not stop\n* delivery to the others.\n*/\nvar InMemoryServerEventBus = class {\n\t_listeners = /* @__PURE__ */ new Set();\n\t/**\n\t* @param onerror - Optional callback for errors thrown by listeners\n\t* during dispatch.\n\t*/\n\tconstructor(onerror) {\n\t\tthis.onerror = onerror;\n\t}\n\tpublish(event) {\n\t\tfor (const listener of this._listeners) try {\n\t\t\tlistener(event);\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error instanceof Error ? error : new Error(String(error)));\n\t\t}\n\t}\n\tsubscribe(listener) {\n\t\tthis._listeners.add(listener);\n\t\tlet live = true;\n\t\treturn () => {\n\t\t\tif (!live) return;\n\t\t\tlive = false;\n\t\t\tthis._listeners.delete(listener);\n\t\t};\n\t}\n\t/** The number of currently registered listeners (test/introspection only — the routers track capacity via their own open-subscription set). */\n\tget listenerCount() {\n\t\treturn this._listeners.size;\n\t}\n};\n/** Build a {@linkcode ServerNotifier} over a bus. */\nfunction createServerNotifier(bus) {\n\treturn {\n\t\ttoolsChanged: () => bus.publish({ kind: \"tools_list_changed\" }),\n\t\tpromptsChanged: () => bus.publish({ kind: \"prompts_list_changed\" }),\n\t\tresourcesChanged: () => bus.publish({ kind: \"resources_list_changed\" }),\n\t\tresourceUpdated: (uri) => bus.publish({\n\t\t\tkind: \"resource_updated\",\n\t\t\turi\n\t\t})\n\t};\n}\n/**\n* Whether a `subscriptions/listen` filter accepts a given change event.\n*\n* Pure: no I/O, no mutation. The filter governs ONLY the four\n* subscription-gated change types — non-gated notifications never reach the\n* bus and are not modeled here.\n*\n* `resource_updated` matches only when `resourceSubscriptions` is present and\n* contains the event's URI exactly (per the spec: \"for these resource URIs\").\n*/\nfunction listenFilterAccepts(filter, event) {\n\tswitch (event.kind) {\n\t\tcase \"tools_list_changed\": return filter.toolsListChanged === true;\n\t\tcase \"prompts_list_changed\": return filter.promptsListChanged === true;\n\t\tcase \"resources_list_changed\": return filter.resourcesListChanged === true;\n\t\tcase \"resource_updated\": return filter.resourceSubscriptions !== void 0 && filter.resourceSubscriptions.includes(event.uri);\n\t}\n}\n/**\n* The honored subset of a requested filter: keeps only the fields the client\n* explicitly opted in to (drops `false` and absent fields), narrowed against\n* the server's declared capabilities when supplied. The serving entry sends\n* this back in `notifications/subscriptions/acknowledged` so the ack reflects\n* what the server can actually deliver.\n*\n* - `toolsListChanged` is honored only when `capabilities.tools.listChanged`\n* is advertised; likewise `promptsListChanged` / `resourcesListChanged`.\n* - `resourceSubscriptions` is honored only when\n* `capabilities.resources.subscribe` is advertised.\n*\n* `capabilities` is optional on this pure helper for test convenience only —\n* both wired routers REQUIRE capabilities at the call site (the HTTP router's\n* `serve()` takes a required parameter; `StdioListenRouter.serve()` throws\n* before `setServerCapabilities()` was called), so the fail-open\n* `undefined → honor everything` branch is never reachable on a wired entry.\n*/\nfunction honoredSubset(requested, capabilities) {\n\tconst honored = {};\n\tconst allow = (bit) => capabilities === void 0 || bit === true;\n\tif (requested.toolsListChanged === true && allow(capabilities?.tools?.listChanged)) honored.toolsListChanged = true;\n\tif (requested.promptsListChanged === true && allow(capabilities?.prompts?.listChanged)) honored.promptsListChanged = true;\n\tif (requested.resourcesListChanged === true && allow(capabilities?.resources?.listChanged)) honored.resourcesListChanged = true;\n\tif (requested.resourceSubscriptions !== void 0 && requested.resourceSubscriptions.length > 0 && allow(capabilities?.resources?.subscribe)) honored.resourceSubscriptions = [...requested.resourceSubscriptions];\n\treturn honored;\n}\n/** Map a {@linkcode ServerEvent} onto its wire notification `{method, params}`. */\nfunction serverEventToNotification(event) {\n\tswitch (event.kind) {\n\t\tcase \"tools_list_changed\": return { method: \"notifications/tools/list_changed\" };\n\t\tcase \"prompts_list_changed\": return { method: \"notifications/prompts/list_changed\" };\n\t\tcase \"resources_list_changed\": return { method: \"notifications/resources/list_changed\" };\n\t\tcase \"resource_updated\": return {\n\t\t\tmethod: \"notifications/resources/updated\",\n\t\t\tparams: { uri: event.uri }\n\t\t};\n\t}\n}\n\n//#endregion\n//#region src/server/listenRouter.ts\n/** Default capacity guard: refuse a new subscription when this many are already open. */\nconst DEFAULT_MAX_SUBSCRIPTIONS = 1024;\nfunction jsonRpcError(id, code, message) {\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode,\n\t\t\tmessage\n\t\t},\n\t\tid\n\t}, { status: 200 });\n}\n/** Stamp the subscription id onto a notification's `_meta`. Non-mutating. */\nfunction stampSubscriptionId(notification, subscriptionId) {\n\treturn {\n\t\tmethod: notification.method,\n\t\tparams: {\n\t\t\t...notification.params,\n\t\t\t_meta: {\n\t\t\t\t...notification.params?._meta,\n\t\t\t\t[SUBSCRIPTION_ID_META_KEY]: subscriptionId\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* Read the requested filter off a `subscriptions/listen` request body.\n* Returns the validated filter, or `undefined` when `params.notifications`\n* is absent or fails the schema (the caller answers `-32602` — the spec\n* marks `notifications` REQUIRED on the listen request).\n*/\nfunction parseListenFilter(message) {\n\tconst outcome = codecForVersion(MODERN_WIRE_REVISION).validateRequest(\"subscriptions/listen\", message);\n\treturn outcome.ok ? outcome.value.params?.notifications : void 0;\n}\nfunction createListenRouter(options) {\n\tconst { bus, onerror } = options;\n\tconst maxSubscriptions = options.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS;\n\tconst keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;\n\tconst open = /* @__PURE__ */ new Set();\n\tfunction serve(message, signal, capabilities, serverInfo) {\n\t\tif (open.size >= maxSubscriptions) {\n\t\t\tonerror?.(/* @__PURE__ */ new Error(`subscriptions/listen refused: subscription limit reached (${maxSubscriptions})`));\n\t\t\treturn jsonRpcError(message.id, -32603, \"Subscription limit reached\");\n\t\t}\n\t\tconst filter = parseListenFilter(message);\n\t\tif (filter === void 0) return jsonRpcError(message.id, -32602, \"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter\");\n\t\tconst honored = honoredSubset(filter, capabilities);\n\t\tconst subscriptionId = message.id;\n\t\tconst encoder = new TextEncoder();\n\t\tlet controller;\n\t\tlet closed = false;\n\t\tlet unsubscribe;\n\t\tlet keepAliveTimer;\n\t\tlet abortCleanup;\n\t\tconst writeFrame = (frame) => {\n\t\t\tif (closed) return;\n\t\t\ttry {\n\t\t\t\tcontroller.enqueue(encoder.encode(frame));\n\t\t\t} catch (error) {\n\t\t\t\tonerror?.(error instanceof Error ? error : new Error(String(error)));\n\t\t\t}\n\t\t};\n\t\tconst writeNotification = (method, params) => {\n\t\t\twriteFrame(`event: message\\ndata: ${JSON.stringify({\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tmethod,\n\t\t\t\tparams\n\t\t\t})}\\n\\n`);\n\t\t};\n\t\tconst teardown = (graceful) => {\n\t\t\tif (closed) return;\n\t\t\tif (graceful) writeFrame(`event: message\\ndata: ${JSON.stringify({\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: subscriptionId,\n\t\t\t\tresult: {\n\t\t\t\t\tresultType: \"complete\",\n\t\t\t\t\t_meta: {\n\t\t\t\t\t\t[SUBSCRIPTION_ID_META_KEY]: subscriptionId,\n\t\t\t\t\t\t[SERVER_INFO_META_KEY]: serverInfo\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})}\\n\\n`);\n\t\t\tclosed = true;\n\t\t\ttry {\n\t\t\t\tunsubscribe?.();\n\t\t\t} catch (error) {\n\t\t\t\tonerror?.(error instanceof Error ? error : new Error(String(error)));\n\t\t\t}\n\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\tabortCleanup?.();\n\t\t\topen.delete(teardown);\n\t\t\ttry {\n\t\t\t\tcontroller.close();\n\t\t\t} catch {}\n\t\t};\n\t\tconst readable = new ReadableStream({\n\t\t\tstart(streamController) {\n\t\t\t\tcontroller = streamController;\n\t\t\t\tconst ack = stampSubscriptionId({\n\t\t\t\t\tmethod: \"notifications/subscriptions/acknowledged\",\n\t\t\t\t\tparams: { notifications: honored }\n\t\t\t\t}, subscriptionId);\n\t\t\t\twriteNotification(ack.method, ack.params);\n\t\t\t\tunsubscribe = bus.subscribe((event) => {\n\t\t\t\t\tif (closed || !listenFilterAccepts(honored, event)) return;\n\t\t\t\t\tconst note = stampSubscriptionId(serverEventToNotification(event), subscriptionId);\n\t\t\t\t\twriteNotification(note.method, note.params);\n\t\t\t\t});\n\t\t\t\tkeepAliveTimer = armSseKeepAlive(keepAliveMs, () => writeFrame(\": keepalive\\n\\n\"));\n\t\t\t\topen.add(teardown);\n\t\t\t},\n\t\t\tcancel() {\n\t\t\t\tteardown(false);\n\t\t\t}\n\t\t});\n\t\tif (signal !== void 0) if (signal.aborted) teardown(false);\n\t\telse {\n\t\t\tconst onAbort = () => teardown(false);\n\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\tabortCleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t\t}\n\t\treturn new Response(readable, {\n\t\t\tstatus: 200,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\tserve,\n\t\tcloseAll() {\n\t\t\tfor (const teardown of open) teardown(true);\n\t\t},\n\t\tget openCount() {\n\t\t\treturn open.size;\n\t\t}\n\t};\n}\nconst CHANGE_NOTIFICATION_METHODS = new Set([\n\t\"notifications/tools/list_changed\",\n\t\"notifications/prompts/list_changed\",\n\t\"notifications/resources/list_changed\",\n\t\"notifications/resources/updated\"\n]);\n/**\n* Per-connection listen state for the stdio entry. One instance is held by\n* `serveStdio` for the connection lifetime; it routes inbound\n* `subscriptions/listen` / `notifications/cancelled` and rewrites outbound\n* change notifications onto the active subscriptions. No bus — the long-lived\n* pinned instance's existing `send*ListChanged()` calls feed straight into\n* `routeOutbound()`.\n*/\nvar StdioListenRouter = class {\n\t/** Active subscriptions, keyed by the listen request's JSON-RPC id verbatim. */\n\t_subs = /* @__PURE__ */ new Map();\n\t/**\n\t* The serving instance's declared capabilities. Filled in by the entry\n\t* once the modern instance is constructed (the router is created before\n\t* the instance exists), so the acknowledged filter is narrowed against\n\t* what the server can actually deliver.\n\t*/\n\t_serverCapabilities;\n\t/**\n\t* The serving instance's identity, stamped onto the graceful-close\n\t* results' `_meta` (the spec's `SubscriptionsListenResultMeta` extends\n\t* `ResultMetaObject`). Handed over together with the capabilities.\n\t*/\n\t_serverInfo;\n\tconstructor(_maxSubscriptions = DEFAULT_MAX_SUBSCRIPTIONS, serverCapabilities, serverInfo) {\n\t\tthis._maxSubscriptions = _maxSubscriptions;\n\t\tthis._serverCapabilities = serverCapabilities;\n\t\tthis._serverInfo = serverInfo;\n\t}\n\t/**\n\t* Record the serving instance's declared capabilities and identity once\n\t* it has been constructed. Called by `serveStdio`'s connect path;\n\t* subsequent `serve()` calls narrow the honored filter against the\n\t* capabilities, and `teardownAll()` stamps the identity.\n\t*/\n\tsetServerCapabilities(capabilities, serverInfo) {\n\t\tthis._serverCapabilities = capabilities;\n\t\tif (serverInfo !== void 0) this._serverInfo = serverInfo;\n\t}\n\t/** Whether `id` is an active listen subscription on this connection. */\n\thas(id) {\n\t\treturn this._subs.has(id);\n\t}\n\t/**\n\t* Serve one inbound `subscriptions/listen` request: registers the\n\t* subscription and returns the stamped acknowledged notification (or, on\n\t* capacity / params rejection, the in-band JSON-RPC error response).\n\t*\n\t* @throws when called before {@linkcode setServerCapabilities} (or the\n\t* constructor) has supplied the serving instance's capabilities. Honoring a\n\t* filter without knowing the server's advertised capabilities would fail\n\t* open (deliver unadvertised types); the entry guarantees capabilities are\n\t* set before any listen request is routed here.\n\t*/\n\tserve(message) {\n\t\tif (this._serverCapabilities === void 0) throw new Error(\"StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities\");\n\t\tif (this._subs.size >= this._maxSubscriptions) return {\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid: message.id,\n\t\t\terror: {\n\t\t\t\tcode: -32603,\n\t\t\t\tmessage: \"Subscription limit reached\"\n\t\t\t}\n\t\t};\n\t\tconst filter = parseListenFilter(message);\n\t\tif (filter === void 0) return {\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid: message.id,\n\t\t\terror: {\n\t\t\t\tcode: -32602,\n\t\t\t\tmessage: \"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter\"\n\t\t\t}\n\t\t};\n\t\tconst honored = honoredSubset(filter, this._serverCapabilities);\n\t\tthis._subs.set(message.id, honored);\n\t\treturn stampSubscriptionId({\n\t\t\tmethod: \"notifications/subscriptions/acknowledged\",\n\t\t\tparams: { notifications: honored }\n\t\t}, message.id);\n\t}\n\t/**\n\t* Tear down one subscription (inbound `notifications/cancelled`). Returns\n\t* `true` when a subscription was removed. After this call NOTHING further\n\t* is delivered for that subscription id (the post-cancel hardening).\n\t*/\n\tcancel(id) {\n\t\treturn this._subs.delete(id);\n\t}\n\t/**\n\t* Route an outbound notification through the active subscriptions.\n\t*\n\t* - For a subscription-gated change notification, returns one stamped copy\n\t* per subscription that opted in to it (an empty array means it is\n\t* dropped — the modern era never delivers an un-requested change type).\n\t* - For any other outbound message, returns `'passthrough'` (the entry\n\t* forwards it as-is).\n\t*/\n\trouteOutbound(message) {\n\t\tif (!CHANGE_NOTIFICATION_METHODS.has(message.method)) return \"passthrough\";\n\t\tconst uriParam = message.params?.[\"uri\"];\n\t\tconst uri = typeof uriParam === \"string\" ? uriParam : void 0;\n\t\tconst event = notificationToServerEvent(message.method, uri);\n\t\tconst out = [];\n\t\tfor (const [subscriptionId, filter] of this._subs) if (listenFilterAccepts(filter, event)) out.push(stampSubscriptionId({\n\t\t\tmethod: message.method,\n\t\t\tparams: message.params ?? {}\n\t\t}, subscriptionId));\n\t\treturn out;\n\t}\n\t/**\n\t* Server-side graceful teardown of every active subscription: returns the\n\t* empty `subscriptions/listen` JSON-RPC result for each subscription id —\n\t* the spec's graceful-close signal, `_meta` carrying the subscription id\n\t* and the serving instance's identity — for the entry to emit before\n\t* closing the wire. Clears the set so nothing further is delivered.\n\t*/\n\tteardownAll() {\n\t\tconst out = [];\n\t\tfor (const id of this._subs.keys()) out.push({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid,\n\t\t\tresult: {\n\t\t\t\tresultType: \"complete\",\n\t\t\t\t_meta: {\n\t\t\t\t\t[SUBSCRIPTION_ID_META_KEY]: id,\n\t\t\t\t\t...this._serverInfo !== void 0 && { [SERVER_INFO_META_KEY]: this._serverInfo }\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis._subs.clear();\n\t\treturn out;\n\t}\n};\nfunction notificationToServerEvent(method, uri) {\n\tswitch (method) {\n\t\tcase \"notifications/tools/list_changed\": return { kind: \"tools_list_changed\" };\n\t\tcase \"notifications/prompts/list_changed\": return { kind: \"prompts_list_changed\" };\n\t\tcase \"notifications/resources/list_changed\": return { kind: \"resources_list_changed\" };\n\t\tdefault: return {\n\t\t\tkind: \"resource_updated\",\n\t\t\turi: uri ?? \"\"\n\t\t};\n\t}\n}\n\n//#endregion\n//#region src/server/legacyInputRequiredShim.ts\n/**\n* Default handler re-entries per originating request — tighter than the\n* client driver's 10 because the shim holds a live wire request open.\n*/\nconst DEFAULT_LEGACY_SHIM_MAX_ROUNDS = 8;\n/** Default per-leg timeout: legs are human-paced, so the 60s protocol default is wrong. */\nconst DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS = 6e5;\n/** Resolves and validates `ServerOptions.inputRequired`, failing loudly at construction time. */\nfunction resolveLegacyShimOptions(options) {\n\tif (options?.maxRounds !== void 0 && (!Number.isInteger(options.maxRounds) || options.maxRounds < 1)) throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${options.maxRounds})`);\n\tif (options?.roundTimeoutMs !== void 0 && (!Number.isFinite(options.roundTimeoutMs) || options.roundTimeoutMs <= 0)) throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${options.roundTimeoutMs})`);\n\treturn {\n\t\tmaxRounds: options?.maxRounds ?? DEFAULT_LEGACY_SHIM_MAX_ROUNDS,\n\t\troundTimeoutMs: options?.roundTimeoutMs ?? DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS,\n\t\tlegacyShim: options?.legacyShim ?? true\n\t};\n}\n/**\n* Validates one `inputRequests` entry: malformed or unknown kinds are server\n* bugs and fail loudly on both eras. Shared by the modern seam's capability\n* check and the shim's gate.\n*/\nfunction coerceEmbeddedInputRequest(method, key, entry) {\n\tif (entry === null || typeof entry !== \"object\" || typeof entry.method !== \"string\") throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an invalid input request '${key}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);\n\tconst embedded = entry;\n\tconst required = requiredClientCapabilitiesForInputRequest(embedded);\n\tif (required === void 0) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input request '${key}' of kind '${embedded.method}', which is not an embedded request the 2026-07-28 revision defines`);\n\treturn {\n\t\tembedded,\n\t\trequired\n\t};\n}\n/**\n* The 2025-11-25 URL-mode wire shape requires an `elicitationId`; the 2026\n* in-band shape has none, so URL legs mint one (CSPRNG-backed, with a\n* getRandomValues fallback for runtimes without `randomUUID`).\n*/\nfunction syntheticElicitationId() {\n\tconst webCrypto = globalThis.crypto;\n\tif (webCrypto?.randomUUID !== void 0) return webCrypto.randomUUID();\n\tconst bytes = new Uint8Array(16);\n\twebCrypto.getRandomValues(bytes);\n\tbytes[6] = bytes[6] & 15 | 64;\n\tbytes[8] = bytes[8] & 63 | 128;\n\tconst hex = [...bytes].map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n/** Per-family surfacing: tools/call → isError result (the 2025 idiom); prompts/resources → JSON-RPC error. */\nfunction legacyShimFailure(method, message) {\n\tif (method === \"tools/call\") return {\n\t\tcontent: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: message\n\t\t}],\n\t\tisError: true\n\t};\n\tthrow new ProtocolError(ProtocolErrorCode.InternalError, message);\n}\n/** The fulfilment loop — see the module doc for the contract. */\nvar LegacyInputRequiredShim = class {\n\tconstructor(_host) {\n\t\tthis._host = _host;\n\t}\n\tasync fulfill(method, handler, request, ctx, firstResult) {\n\t\tconst { maxRounds, roundTimeoutMs } = this._host;\n\t\tconst outerSignal = ctx.mcpReq.signal;\n\t\tlet current = firstResult;\n\t\tlet round = 0;\n\t\twhile (true) {\n\t\t\tround += 1;\n\t\t\tif (round > maxRounds) return legacyShimFailure(method, inputRequiredRoundsExceededMessage(method, maxRounds));\n\t\t\tconst inputRequests = current.inputRequests;\n\t\t\tconst hasInputRequests = inputRequests != null && Object.keys(inputRequests).length > 0;\n\t\t\tconst requestState = typeof current.requestState === \"string\" ? current.requestState : void 0;\n\t\t\tif (!hasInputRequests && requestState === void 0) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);\n\t\t\tlet responses;\n\t\t\tif (hasInputRequests) {\n\t\t\t\tconst declared = this._host.resolvedClientCapabilities(ctx);\n\t\t\t\tconst coerced = [];\n\t\t\t\tfor (const [key, entry] of Object.entries(inputRequests)) {\n\t\t\t\t\tconst { embedded, required } = coerceEmbeddedInputRequest(method, key, entry);\n\t\t\t\t\tif (embedded.method !== \"roots/list\" && embedded.params === void 0) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input request '${key}' of kind '${embedded.method}' without params`);\n\t\t\t\t\tif (missingClientCapabilities(required, declared) !== void 0) return legacyShimFailure(method, `Cannot request input '${key}' (${embedded.method}): the client on this 2025-era connection did not declare the required capability${declared === void 0 ? \" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)\" : \"\"}`);\n\t\t\t\t\tcoerced.push([key, embedded]);\n\t\t\t\t}\n\t\t\t\tconst roundAbort = linkedRoundAbort(outerSignal);\n\t\t\t\ttry {\n\t\t\t\t\tconst legOptions = {\n\t\t\t\t\t\trelatedRequestId: ctx.mcpReq.id,\n\t\t\t\t\t\ttimeout: roundTimeoutMs,\n\t\t\t\t\t\tresetTimeoutOnProgress: true,\n\t\t\t\t\t\tonprogress: () => {},\n\t\t\t\t\t\tsignal: roundAbort.signal\n\t\t\t\t\t};\n\t\t\t\t\tconst fulfilled = await Promise.all(coerced.map(async ([key, embedded]) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn [key, await this._dispatchLeg(embedded, legOptions)];\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\troundAbort.abort(error);\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t\tresponses = Object.fromEntries(fulfilled);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (outerSignal.aborted) throw error;\n\t\t\t\t\treturn legacyShimFailure(method, `Fulfilling input required by '${method}' failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t\t} finally {\n\t\t\t\t\troundAbort.dispose();\n\t\t\t\t}\n\t\t\t} else await sleep(REQUEST_STATE_ONLY_LEG_PACING_MS, outerSignal);\n\t\t\tlet ctxNext = {\n\t\t\t\t...ctx,\n\t\t\t\tmcpReq: {\n\t\t\t\t\t...ctx.mcpReq,\n\t\t\t\t\tinputResponses: responses,\n\t\t\t\t\tdroppedInputResponseKeys: void 0,\n\t\t\t\t\trequestState: requestStateAccessor(requestState)\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (requestState !== void 0) {\n\t\t\t\tconst decoded = await this._host.verifyRequestState(requestState, ctxNext, method);\n\t\t\t\tif (decoded !== void 0) ctxNext = withRequestStateValue(ctxNext, decoded);\n\t\t\t}\n\t\t\tconst next = await handler(request, ctxNext);\n\t\t\tif (!isInputRequiredResult(next)) return next;\n\t\t\tcurrent = next;\n\t\t}\n\t}\n\t/** Routes one embedded request through the host's existing 2025-era senders (gate already ran). */\n\tasync _dispatchLeg(embedded, options) {\n\t\tswitch (embedded.method) {\n\t\t\tcase \"elicitation/create\": {\n\t\t\t\tlet params = embedded.params;\n\t\t\t\tif (params.mode === \"url\" && params.elicitationId === void 0) params = {\n\t\t\t\t\t...params,\n\t\t\t\t\telicitationId: syntheticElicitationId()\n\t\t\t\t};\n\t\t\t\treturn await this._host.sendElicitation(params, options);\n\t\t\t}\n\t\t\tcase \"sampling/createMessage\": return await this._host.sendSampling(embedded.params, options);\n\t\t\tcase \"roots/list\": return await this._host.listRoots(embedded.params, options);\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/server/server.ts\n/**\n* The request methods whose 2026-07-28 result vocabulary includes\n* `input_required` (the multi round-trip methods). Returning an\n* input-required result from any other handler is a server bug.\n*/\nconst INPUT_REQUIRED_CAPABLE_METHODS = new Set([\n\t\"tools/call\",\n\t\"prompts/get\",\n\t\"resources/read\"\n]);\nlet writeClientIdentity;\nlet installDiscoverHandler;\nlet readServerIdentity;\n/**\n* Package-internal: backfills the connection-scoped client-identity fields of a\n* per-request server instance from the request's validated `_meta` envelope, so the\n* (deprecated) {@linkcode Server.getClientCapabilities} / {@linkcode Server.getClientVersion}\n* accessors keep answering on instances that never see an `initialize` handshake.\n* Not public API.\n*/\nfunction seedClientIdentityFromEnvelope(server, identity) {\n\twriteClientIdentity(server, identity);\n}\n/**\n* Package-internal: installs the modern-only `server/discover` handler on an instance\n* the HTTP entry has marked as serving the 2026-07-28 era, and makes sure the modern\n* revisions the entry serves appear in the instance's supported-versions list (so the\n* discover advertisement and version-mismatch errors name them). Idempotent.\n* Hand-constructed instances are unaffected: nothing else calls this, so they keep\n* answering `-32601` unless their own supported-versions list opts into a modern\n* revision. Not public API.\n*/\nfunction installModernOnlyHandlers(server, servedModernVersions) {\n\tinstallDiscoverHandler(server, servedModernVersions);\n}\n/**\n* Package-internal: the instance's implementation identity, for the serving\n* entries to stamp onto entry-built results (the `subscriptions/listen`\n* graceful-close result — built outside the encode seam, but the spec's\n* `SubscriptionsListenResultMeta` extends `ResultMetaObject`, so it carries\n* the serverInfo SHOULD like every other result). Not public API.\n*/\nfunction serverIdentityOf(server) {\n\treturn readServerIdentity(server);\n}\n/**\n* An MCP server on top of a pluggable transport.\n*\n* This server will automatically respond to the initialization flow as initiated from the client.\n*\n* @deprecated Use {@linkcode server/mcp.McpServer | McpServer} instead for the high-level API. Only use `Server` for advanced use cases.\n*/\nvar Server = class extends Protocol {\n\t_clientCapabilities;\n\t_clientVersion;\n\tstatic {\n\t\twriteClientIdentity = (server, identity) => {\n\t\t\tif (identity.clientCapabilities !== void 0) server._clientCapabilities = identity.clientCapabilities;\n\t\t\tif (identity.clientInfo !== void 0) server._clientVersion = identity.clientInfo;\n\t\t};\n\t\tinstallDiscoverHandler = (server, servedModernVersions) => {\n\t\t\tconst missing = servedModernVersions.filter((version) => !server._supportedProtocolVersions.includes(version));\n\t\t\tif (missing.length > 0) server._supportedProtocolVersions = [...server._supportedProtocolVersions, ...missing];\n\t\t\tserver.setRequestHandler(\"server/discover\", () => server._ondiscover());\n\t\t};\n\t\treadServerIdentity = (server) => server._serverInfo;\n\t}\n\t_capabilities;\n\t_instructions;\n\t_jsonSchemaValidator;\n\t_cacheHints;\n\t_requestStateVerify;\n\t_inputRequiredServing;\n\t_legacyShim;\n\t/** Lazily-built legacy shim; the loop lives in legacyInputRequiredShim.ts behind a narrow host contract. */\n\t_legacyInputRequiredShim() {\n\t\treturn this._legacyShim ??= new LegacyInputRequiredShim({\n\t\t\tmaxRounds: this._inputRequiredServing.maxRounds,\n\t\t\troundTimeoutMs: this._inputRequiredServing.roundTimeoutMs,\n\t\t\tresolvedClientCapabilities: (ctx) => this._inputRequestCapabilityView(ctx),\n\t\t\tverifyRequestState: (state, ctx, method) => this._verifyRequestState(state, ctx, method),\n\t\t\tsendElicitation: (params, options) => this._sendElicitationLeg(params, options, { validateAcceptedContent: false }),\n\t\t\tsendSampling: (params, options) => this.createMessage(params, options),\n\t\t\tlistRoots: (params, options) => this.listRoots(params, options)\n\t\t});\n\t}\n\t/**\n\t* Callback for when initialization has fully completed (i.e., the client has sent an `notifications/initialized` notification).\n\t*/\n\toninitialized;\n\t/**\n\t* Initializes this server with the given name and version information.\n\t*/\n\tconstructor(_serverInfo, options) {\n\t\tsuper(options);\n\t\tthis._serverInfo = _serverInfo;\n\t\tthis._capabilities = options?.capabilities ? { ...options.capabilities } : {};\n\t\tthis._instructions = options?.instructions;\n\t\tthis._jsonSchemaValidator = options?.jsonSchemaValidator ?? new DefaultJsonSchemaValidator();\n\t\tthis._requestStateVerify = options?.requestState?.verify;\n\t\tthis._inputRequiredServing = resolveLegacyShimOptions(options?.inputRequired);\n\t\tif (options?.cacheHints !== void 0) {\n\t\t\tfor (const [operation, hint] of Object.entries(options.cacheHints)) if (hint !== void 0) assertValidCacheHint(hint, `cacheHints['${operation}']`);\n\t\t\tthis._cacheHints = options.cacheHints;\n\t\t}\n\t\tthis.setRequestHandler(\"initialize\", (request) => this._oninitialize(request));\n\t\tthis.setNotificationHandler(\"notifications/initialized\", () => this.oninitialized?.());\n\t\tif (modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler(\"server/discover\", () => this._ondiscover());\n\t\tif (this._capabilities.logging) this._registerLoggingHandler();\n\t}\n\t/**\n\t* Registers the built-in `logging/setLevel` request handler.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Remains functional during the deprecation window (at least twelve months).\n\t* Migrate to stderr logging (STDIO servers) or OpenTelemetry.\n\t*/\n\t_registerLoggingHandler() {\n\t\tthis.setRequestHandler(\"logging/setLevel\", async (request, ctx) => {\n\t\t\tconst transportSessionId = ctx.sessionId || ctx.http?.req?.headers.get(\"mcp-session-id\") || void 0;\n\t\t\tconst { level } = request.params;\n\t\t\tconst parseResult = parseSchema(LoggingLevelSchema, level);\n\t\t\tif (parseResult.success) this._loggingLevels.set(transportSessionId, parseResult.data);\n\t\t\treturn {};\n\t\t});\n\t}\n\tbuildContext(ctx, transportInfo) {\n\t\tconst hasHttpInfo = ctx.http || transportInfo?.request || transportInfo?.closeSSEStream || transportInfo?.closeStandaloneSSEStream;\n\t\treturn {\n\t\t\t...ctx,\n\t\t\tmcpReq: {\n\t\t\t\t...ctx.mcpReq,\n\t\t\t\tlog: (level, data, logger) => {\n\t\t\t\t\tif (!this._capabilities.logging) return Promise.resolve();\n\t\t\t\t\tlet threshold;\n\t\t\t\t\tif (this._servedModernEra()) {\n\t\t\t\t\t\tthreshold = ctx.mcpReq.envelope?.[LOG_LEVEL_META_KEY];\n\t\t\t\t\t\tif (threshold === void 0) return Promise.resolve();\n\t\t\t\t\t} else threshold = this._loggingLevels.get(ctx.sessionId) ?? this._loggingLevels.get(void 0);\n\t\t\t\t\tif (threshold !== void 0 && this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(threshold)) return Promise.resolve();\n\t\t\t\t\treturn ctx.mcpReq.notify({\n\t\t\t\t\t\tmethod: \"notifications/message\",\n\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\tlevel,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tlogger\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\telicitInput: (params, options) => this.elicitInput(params, options),\n\t\t\t\trequestSampling: (params, options) => this.createMessage(params, options)\n\t\t\t},\n\t\t\thttp: hasHttpInfo ? {\n\t\t\t\t...ctx.http,\n\t\t\t\treq: transportInfo?.request,\n\t\t\t\tcloseSSE: transportInfo?.closeSSEStream,\n\t\t\t\tcloseStandaloneSSE: transportInfo?.closeStandaloneSSEStream\n\t\t\t} : void 0\n\t\t};\n\t}\n\t_loggingLevels = /* @__PURE__ */ new Map();\n\tLOG_LEVEL_SEVERITY = new Map(LoggingLevelSchema.options.map((level, index) => [level, index]));\n\tisMessageIgnored = (level, sessionId) => {\n\t\tconst currentLevel = this._loggingLevels.get(sessionId);\n\t\treturn currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;\n\t};\n\t/**\n\t* Registers new capabilities. This can only be called before connecting to a transport.\n\t*\n\t* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).\n\t*/\n\tregisterCapabilities(capabilities) {\n\t\tif (this.transport) throw new SdkError(SdkErrorCode.AlreadyConnected, \"Cannot register capabilities after connecting to transport\");\n\t\tconst hadLogging = !!this._capabilities.logging;\n\t\tthis._capabilities = mergeCapabilities(this._capabilities, capabilities);\n\t\tif (!hadLogging && this._capabilities.logging) this._registerLoggingHandler();\n\t}\n\t/**\n\t* Enforces server-side validation for `tools/call` results regardless of how the\n\t* handler was registered, attaches the configured per-operation cache hint\n\t* (when one exists) so the 2026-07-28 encode seam can fill `ttlMs`/`cacheScope`\n\t* for results that do not provide their own, and owns the multi-round-trip\n\t* seam: on the methods whose 2026-07-28 result vocabulary includes\n\t* `input_required` (`tools/call`, `prompts/get`, `resources/read`) an\n\t* input-required return skips result-schema validation and is checked\n\t* against the served era, the at-least-one rule, and the request's own\n\t* declared client capabilities; on every other method an input-required\n\t* return is a server bug and fails loudly. The hint rides a symbol-keyed\n\t* property that is never serialized, so 2025-era responses are unaffected.\n\t*/\n\t_wrapHandler(method, handler) {\n\t\tif (method !== \"tools/call\") {\n\t\t\tconst cacheHint = this._cacheHints?.[method];\n\t\t\tconst isInputRequiredCapable = INPUT_REQUIRED_CAPABLE_METHODS.has(method);\n\t\t\tif (cacheHint === void 0 && !isInputRequiredCapable) return async (request, ctx) => {\n\t\t\t\tconst result = await handler(request, ctx);\n\t\t\t\tif (isInputRequiredResult(result)) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\treturn async (request, ctx) => {\n\t\t\t\tconst result = isInputRequiredCapable ? await this._invokeInputRequiredCapableHandler(method, handler, request, ctx) : await handler(request, ctx);\n\t\t\t\tif (isInputRequiredResult(result)) {\n\t\t\t\t\tif (!isInputRequiredCapable) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\treturn cacheHint === void 0 ? result : attachCacheHintFallback(result, cacheHint);\n\t\t\t};\n\t\t}\n\t\treturn async (request, ctx) => {\n\t\t\tconst codec = codecForVersion(this._negotiatedProtocolVersion);\n\t\t\tconst validatedRequest = codec.validateRequest(\"tools/call\", request);\n\t\t\tif (!validatedRequest.ok) throw new ProtocolError(validatedRequest.reason === \"not-in-era\" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validatedRequest.reason === \"not-in-era\" ? \"No wire schema for tools/call in the resolved era\" : `Invalid tools/call request: ${validatedRequest.message}`);\n\t\t\tconst result = await this._invokeInputRequiredCapableHandler(\"tools/call\", handler, request, ctx);\n\t\t\tif (isInputRequiredResult(result)) return result;\n\t\t\tconst normalizedResult = normalizeContentlessToolResult(result);\n\t\t\tconst validationResult = codec.validateResult(\"tools/call\", normalizedResult);\n\t\t\tif (!validationResult.ok) throw new ProtocolError(validationResult.reason === \"not-in-era\" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validationResult.reason === \"not-in-era\" ? \"No wire schema for tools/call in the resolved era\" : `Invalid tools/call result: ${validationResult.message}`);\n\t\t\treturn validationResult.value;\n\t\t};\n\t}\n\t/**\n\t* Whether this instance is bound to a 2026-07-28-or-later protocol\n\t* revision. Era is instance state — a serving entry (`createMcpHandler`,\n\t* `serveStdio`) marks the instance modern at construction; a 2025-era\n\t* `initialize` handshake binds it legacy. The multi-round-trip seam reads\n\t* this directly: there is no per-request era consult.\n\t*/\n\t_servedModernEra() {\n\t\treturn this._negotiatedProtocolVersion !== void 0 && isModernProtocolVersion(this._negotiatedProtocolVersion);\n\t}\n\t/**\n\t* Invokes a handler for one of the multi-round-trip methods and applies\n\t* the input-required seam:\n\t*\n\t* - a `UrlElicitationRequiredError` (or any 2025-style server→client\n\t* request idiom) escaping the handler on a request served on the\n\t* 2026-07-28 era fails LOUDLY with a clear steer to\n\t* `inputRequired.elicitUrl(...)` — the `-32042` error never reaches the\n\t* 2026-07-28 wire and the throw is not silently converted. Requests\n\t* served on the 2025 era keep today's `-32042` behavior byte-exact (the\n\t* error is rethrown unchanged).\n\t* - an input-required RETURN toward a 2026-07-28 request must satisfy\n\t* the at-least-one rule, and every embedded request must be covered by\n\t* the capabilities declared on the request's envelope (violations\n\t* answer the typed `-32021` error). Toward a 2025-era request the\n\t* return is fulfilled by the default-on legacy shim, whose own gate\n\t* consults the initialize-declared capabilities and surfaces\n\t* violations per family; `inputRequired.legacyShim: false` restores\n\t* the pre-shim loud failure.\n\t*/\n\tasync _invokeInputRequiredCapableHandler(method, handler, request, ctx) {\n\t\tconst servedModern = this._servedModernEra();\n\t\tconst rawRequestState = ctx.mcpReq.requestState();\n\t\tif (rawRequestState !== void 0 && typeof rawRequestState !== \"string\") throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"Invalid or expired requestState\", { reason: \"invalid_request_state\" });\n\t\tlet ctxForHandler = ctx;\n\t\tif (typeof rawRequestState === \"string\") {\n\t\t\tconst decoded = await this._verifyRequestState(rawRequestState, ctx, method);\n\t\t\tif (decoded !== void 0) ctxForHandler = withRequestStateValue(ctx, decoded);\n\t\t}\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await handler(request, ctxForHandler);\n\t\t} catch (error) {\n\t\t\tif (error instanceof ProtocolError && error.code === ProtocolErrorCode.UrlElicitationRequired) {\n\t\t\t\tif (!servedModern) throw error;\n\t\t\t\tthrow new ProtocolError(ProtocolErrorCode.InternalError, `URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tif (!isInputRequiredResult(result)) return result;\n\t\tif (!servedModern) {\n\t\t\tif (!this._inputRequiredServing.legacyShim) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion ?? LATEST_PROTOCOL_VERSION}, which has no input_required vocabulary`);\n\t\t\treturn await this._legacyInputRequiredShim().fulfill(method, handler, request, ctxForHandler, result);\n\t\t}\n\t\tconst inputRequests = result.inputRequests;\n\t\tconst hasInputRequests = inputRequests != null && Object.keys(inputRequests).length > 0;\n\t\tconst hasRequestState = typeof result.requestState === \"string\";\n\t\tif (!hasInputRequests && !hasRequestState) throw new ProtocolError(ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);\n\t\tif (hasInputRequests) {\n\t\t\tconst declared = this._inputRequestCapabilityView(ctx);\n\t\t\tfor (const [key, entry] of Object.entries(inputRequests)) {\n\t\t\t\tconst { embedded, required } = coerceEmbeddedInputRequest(method, key, entry);\n\t\t\t\tconst missing = missingClientCapabilities(required, declared);\n\t\t\t\tif (missing !== void 0) throw new MissingRequiredClientCapabilityError({ requiredCapabilities: missing }, `Cannot request input '${key}' (${embedded.method}): the request's client capabilities do not declare the required capability`);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Runs the configured `requestState.verify` hook and returns its\n\t* resolved value (`undefined` when unconfigured or the hook returns\n\t* nothing). Deny-on-error: any hook failure answers the frozen `-32602`;\n\t* the reason goes to `onerror` only.\n\t*/\n\tasync _verifyRequestState(state, ctx, method) {\n\t\tif (this._requestStateVerify === void 0) return;\n\t\ttry {\n\t\t\treturn await this._requestStateVerify(state, ctx);\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(`requestState verification rejected ${method}: ${error instanceof Error ? error.message : String(error)}`));\n\t\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, \"Invalid or expired requestState\", { reason: \"invalid_request_state\" });\n\t\t}\n\t}\n\t/**\n\t* The per-request resolved client-capabilities view: the request's own\n\t* `_meta` envelope on the 2026 era; the `initialize`-declared state on a\n\t* 2025-era connection. Per-request instances that never saw an\n\t* initialize (stateless legacy) hold nothing, so gates refuse there.\n\t*/\n\t_inputRequestCapabilityView(ctx) {\n\t\treturn this._servedModernEra() ? ctx.mcpReq.envelope?.[CLIENT_CAPABILITIES_META_KEY] : this._clientCapabilities;\n\t}\n\t/**\n\t* Guard for the push-style server→client request APIs ({@linkcode createMessage},\n\t* {@linkcode elicitInput}, {@linkcode listRoots}, {@linkcode ping}) on a\n\t* modern-era instance: the 2026-07-28 revision has no server→client request\n\t* channel, so the call fails before any wire traffic with a typed error\n\t* whose message steers to `inputRequired(...)`. The base era gate would\n\t* also reject it; this guard runs first to carry the steer.\n\t*/\n\t_assertPushApiInServedEra(method) {\n\t\tif (this._servedModernEra()) throw new SdkError(SdkErrorCode.MethodNotSupportedByProtocolVersion, `Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${method}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`, {\n\t\t\tmethod,\n\t\t\tera: \"2026-07-28\"\n\t\t});\n\t}\n\tassertCapabilityForMethod(method) {\n\t\tswitch (method) {\n\t\t\tcase \"sampling/createMessage\":\n\t\t\t\tif (!this._clientCapabilities?.sampling) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support sampling (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"elicitation/create\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support elicitation (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"roots/list\":\n\t\t\t\tif (!this._clientCapabilities?.roots) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support listing roots (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"ping\": break;\n\t\t}\n\t}\n\tassertNotificationCapability(method) {\n\t\tswitch (method) {\n\t\t\tcase \"notifications/message\":\n\t\t\t\tif (!this._capabilities.logging) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support logging (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/resources/updated\":\n\t\t\tcase \"notifications/resources/list_changed\":\n\t\t\t\tif (!this._capabilities.resources) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support notifying about resources (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/tools/list_changed\":\n\t\t\t\tif (!this._capabilities.tools) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support notifying of tool list changes (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/prompts/list_changed\":\n\t\t\t\tif (!this._capabilities.prompts) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support notifying of prompt list changes (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/elicitation/complete\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation?.url) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support URL elicitation (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"notifications/cancelled\": break;\n\t\t\tcase \"notifications/progress\": break;\n\t\t}\n\t}\n\tassertRequestHandlerCapability(method) {\n\t\tswitch (method) {\n\t\t\tcase \"completion/complete\":\n\t\t\t\tif (!this._capabilities.completions) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support completions (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"logging/setLevel\":\n\t\t\t\tif (!this._capabilities.logging) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support logging (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"prompts/get\":\n\t\t\tcase \"prompts/list\":\n\t\t\t\tif (!this._capabilities.prompts) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support prompts (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"resources/list\":\n\t\t\tcase \"resources/templates/list\":\n\t\t\tcase \"resources/read\":\n\t\t\t\tif (!this._capabilities.resources) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support resources (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"tools/call\":\n\t\t\tcase \"tools/list\":\n\t\t\t\tif (!this._capabilities.tools) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support tools (required for ${method})`);\n\t\t\t\tbreak;\n\t\t\tcase \"ping\":\n\t\t\tcase \"initialize\": break;\n\t\t}\n\t}\n\tasync _oninitialize(request) {\n\t\tconst requestedVersion = request.params.protocolVersion;\n\t\tthis._clientCapabilities = request.params.capabilities;\n\t\tthis._clientVersion = request.params.clientInfo;\n\t\tconst legacyVersions = legacyProtocolVersions(this._supportedProtocolVersions);\n\t\tconst protocolVersion = legacyVersions.includes(requestedVersion) ? requestedVersion : legacyVersions[0] ?? LATEST_PROTOCOL_VERSION;\n\t\tthis._negotiatedProtocolVersion = protocolVersion;\n\t\tthis.transport?.setProtocolVersion?.(protocolVersion);\n\t\treturn {\n\t\t\tprotocolVersion,\n\t\t\tcapabilities: this.getCapabilities(),\n\t\t\tserverInfo: this._serverInfo,\n\t\t\t...this._instructions && { instructions: this._instructions }\n\t\t};\n\t}\n\t/**\n\t* Answers `server/discover` (protocol revision 2026-07-28). `supportedVersions`\n\t* lists only modern revisions (2025-era versions are negotiated via `initialize`);\n\t* the capabilities are advertised as-is, listChanged/subscribe bits included\n\t* (see {@linkcode discoverAdvertisedCapabilities}).\n\t*/\n\t_ondiscover() {\n\t\treturn {\n\t\t\tsupportedVersions: modernProtocolVersions(this._supportedProtocolVersions),\n\t\t\tcapabilities: discoverAdvertisedCapabilities(this.getCapabilities()),\n\t\t\t...this._instructions && { instructions: this._instructions }\n\t\t};\n\t}\n\t/**\n\t* The identity the 2026-era encode seam stamps into every outbound\n\t* result's `_meta` under `io.modelcontextprotocol/serverInfo` (spec PR\n\t* #3002: servers SHOULD identify themselves on every response).\n\t*/\n\t_outboundServerInfo() {\n\t\treturn this._serverInfo;\n\t}\n\t/**\n\t* After initialization has completed, this will be populated with the client's reported capabilities.\n\t*\n\t* @deprecated Read client identity from the per-request handler context instead: on\n\t* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's\n\t* declared capabilities, while on 2025-era connections this accessor keeps returning the\n\t* `initialize`-scoped value. The accessor remains functional — instances serving the\n\t* 2026-07-28 era are backfilled per request from the validated envelope.\n\t*/\n\tgetClientCapabilities() {\n\t\treturn this._clientCapabilities;\n\t}\n\t/**\n\t* After initialization has completed, this will be populated with information about the client's name and version.\n\t*\n\t* @deprecated Read client identity from the per-request handler context instead: on\n\t* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's\n\t* name and version, while on 2025-era connections this accessor keeps returning the\n\t* `initialize`-scoped value. The accessor remains functional — instances serving the\n\t* 2026-07-28 era are backfilled per request from the validated envelope.\n\t*/\n\tgetClientVersion() {\n\t\treturn this._clientVersion;\n\t}\n\t/**\n\t* After initialization has completed, this will be populated with the protocol version negotiated\n\t* with the client (the version the server responded with during the initialize handshake), or\n\t* `undefined` before initialization.\n\t*\n\t* @deprecated Read the protocol revision from the per-request handler context instead: on\n\t* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` names the revision the\n\t* request was sent for, while on 2025-era connections this accessor keeps returning the\n\t* `initialize`-negotiated version. The accessor remains functional — instances serving the\n\t* 2026-07-28 era report that revision.\n\t*/\n\tgetNegotiatedProtocolVersion() {\n\t\treturn this._negotiatedProtocolVersion;\n\t}\n\t/**\n\t* Project a `tools/call` result through this instance's negotiated wire\n\t* codec — the era-agnostic SEP-2106 §4.3 TextContent auto-append, plus on\n\t* the 2025 era the `{result:…}` wrap when `structuredContent` is a\n\t* non-object value or the advertised `outputSchema` had a non-object root.\n\t* Identity for object-shaped `structuredContent` on the 2026 era.\n\t*\n\t* `McpServer`'s built-in `tools/call` handler routes through this method.\n\t* Low-level `setRequestHandler('tools/call', …)` authors call it\n\t* themselves so the projection lives in one place (the codec) and the\n\t* server-side handler stays era-blind.\n\t*\n\t* This is the only codec function exposed on `Server` — the full\n\t* `WireCodec` is intentionally not part of the public surface.\n\t*/\n\tprojectCallToolResult(result, advertisedOutputSchema) {\n\t\treturn this._wireCodec().projectCallToolResult(result, advertisedOutputSchema);\n\t}\n\t/**\n\t* Returns the current server capabilities.\n\t*/\n\tgetCapabilities() {\n\t\treturn this._capabilities;\n\t}\n\t/**\n\t* Sends a `ping` request to the connected client.\n\t*\n\t* @deprecated The 2026-07-28 protocol removed ping; it throws on a 2026-07-28-era instance.\n\t* If your factory serves both eras, this only works on the legacy path.\n\t*/\n\tasync ping() {\n\t\tthis._assertPushApiInServedEra(\"ping\");\n\t\treturn this.request({ method: \"ping\" });\n\t}\n\tasync createMessage(params, options) {\n\t\tthis._assertPushApiInServedEra(\"sampling/createMessage\");\n\t\tif ((params.tools || params.toolChoice) && !this._clientCapabilities?.sampling?.tools) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support sampling tools capability.\");\n\t\tif (params.messages.length > 0) {\n\t\t\tconst lastMessage = params.messages.at(-1);\n\t\t\tconst lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];\n\t\t\tconst hasToolResults = lastContent.some((c) => c.type === \"tool_result\");\n\t\t\tconst previousMessage = params.messages.length > 1 ? params.messages.at(-2) : void 0;\n\t\t\tconst previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];\n\t\t\tconst hasPreviousToolUse = previousContent.some((c) => c.type === \"tool_use\");\n\t\t\tif (hasToolResults) {\n\t\t\t\tif (lastContent.some((c) => c.type !== \"tool_result\")) throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"The last message must contain only tool_result content if any is present\");\n\t\t\t\tif (!hasPreviousToolUse) throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"tool_result blocks are not matching any tool_use from the previous message\");\n\t\t\t}\n\t\t\tif (hasPreviousToolUse) {\n\t\t\t\tconst toolUseIds = new Set(previousContent.filter((c) => c.type === \"tool_use\").map((c) => c.id));\n\t\t\t\tconst toolResultIds = new Set(lastContent.filter((c) => c.type === \"tool_result\").map((c) => c.toolUseId));\n\t\t\t\tif (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) throw new ProtocolError(ProtocolErrorCode.InvalidParams, \"ids of tool_result blocks and tool_use blocks from previous message do not match\");\n\t\t\t}\n\t\t}\n\t\tconst hasTools = Boolean(params.tools || params.toolChoice);\n\t\tconst wide = await this.request({\n\t\t\tmethod: \"sampling/createMessage\",\n\t\t\tparams\n\t\t}, options);\n\t\tconst outcome = this._wireCodec().samplingResultVariant(hasTools, wide);\n\t\tif (!outcome.ok) throw new SdkError(SdkErrorCode.InvalidResult, `Invalid sampling/createMessage result: ${outcome.reason === \"invalid\" ? outcome.message : outcome.reason}`);\n\t\treturn outcome.value;\n\t}\n\t/**\n\t* Creates an elicitation request for the given parameters.\n\t* For backwards compatibility, `mode` may be omitted for form requests and will default to `\"form\"`.\n\t* @param params The parameters for the elicitation request.\n\t* @param options Optional request options.\n\t* @returns The result of the elicitation request.\n\t*\n\t* @deprecated Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip)\n\t* instead. The 2025 push-style server-to-client request model is replaced by input_required\n\t* results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the\n\t* legacy path.\n\t*/\n\tasync elicitInput(params, options) {\n\t\tthis._assertPushApiInServedEra(\"elicitation/create\");\n\t\tswitch (params.mode ?? \"form\") {\n\t\t\tcase \"url\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation?.url) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support url elicitation.\");\n\t\t\t\tbreak;\n\t\t\tcase \"form\":\n\t\t\t\tif (!this._clientCapabilities?.elicitation?.form) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support form elicitation.\");\n\t\t\t\tbreak;\n\t\t}\n\t\treturn this._sendElicitationLeg(params, options);\n\t}\n\t/**\n\t* The capability-check-free core of {@linkcode elicitInput}. The shim\n\t* uses it because its gate differs from the public checks: a bare\n\t* `elicitation: {}` counts as form support (the pre-mode rule), and\n\t* accepted content passes through unvalidated for parity with the\n\t* modern client driver (handlers validate via the schema-aware\n\t* `acceptedContent` overload and can re-ask).\n\t*/\n\tasync _sendElicitationLeg(params, options, behavior) {\n\t\tconst mode = params.mode ?? \"form\";\n\t\tconst validateAcceptedContent = behavior?.validateAcceptedContent ?? true;\n\t\tswitch (mode) {\n\t\t\tcase \"url\": {\n\t\t\t\tconst urlParams = params;\n\t\t\t\treturn this.request({\n\t\t\t\t\tmethod: \"elicitation/create\",\n\t\t\t\t\tparams: urlParams\n\t\t\t\t}, options);\n\t\t\t}\n\t\t\tcase \"form\": {\n\t\t\t\tconst formParams = params.mode === \"form\" ? params : {\n\t\t\t\t\t...params,\n\t\t\t\t\tmode: \"form\"\n\t\t\t\t};\n\t\t\t\tconst result = await this.request({\n\t\t\t\t\tmethod: \"elicitation/create\",\n\t\t\t\t\tparams: formParams\n\t\t\t\t}, options);\n\t\t\t\tif (validateAcceptedContent && result.action === \"accept\" && result.content && formParams.requestedSchema) try {\n\t\t\t\t\tconst validationResult = this._jsonSchemaValidator.getValidator(formParams.requestedSchema)(result.content);\n\t\t\t\t\tif (!validationResult.valid) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (error instanceof ProtocolError) throw error;\n\t\t\t\t\tthrow new ProtocolError(ProtocolErrorCode.InternalError, `Error validating elicitation response: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`\n\t* notification for the specified elicitation ID.\n\t*\n\t* The notification (and the `elicitationId` it references) exists only on protocol revision\n\t* 2025-11-25 — the 2026-07-28 revision removed both. On a connection negotiated at 2026-07-28 the\n\t* returned callback rejects with a typed local error before anything reaches the transport\n\t* (the method is not part of that revision's wire registry).\n\t*\n\t* @param elicitationId The ID of the elicitation to mark as complete.\n\t* @param options Optional notification options. Useful when the completion notification should be related to a prior request.\n\t* @returns A function that emits the completion notification when awaited.\n\t*/\n\tcreateElicitationCompletionNotifier(elicitationId, options) {\n\t\tif (!this._clientCapabilities?.elicitation?.url) throw new SdkError(SdkErrorCode.CapabilityNotSupported, \"Client does not support URL elicitation (required for notifications/elicitation/complete)\");\n\t\treturn () => this.notification({\n\t\t\tmethod: \"notifications/elicitation/complete\",\n\t\t\tparams: { elicitationId }\n\t\t}, options);\n\t}\n\t/**\n\t* Requests the list of roots from the client.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,\n\t* or migrate to passing paths via tool parameters, resource URIs, or configuration. The 2025\n\t* push-style server-to-client request model is replaced by input_required results in the\n\t* 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.\n\t*/\n\tasync listRoots(params, options) {\n\t\tthis._assertPushApiInServedEra(\"roots/list\");\n\t\treturn this.request({\n\t\t\tmethod: \"roots/list\",\n\t\t\tparams\n\t\t}, options);\n\t}\n\t/**\n\t* Sends a logging message to the client, if connected.\n\t* Note: You only need to send the parameters object, not the entire JSON-RPC message.\n\t* @see {@linkcode LoggingMessageNotification}\n\t* @param params\n\t* @param sessionId Optional for stateless transports and backward compatibility.\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Remains functional during the deprecation window (at least twelve months).\n\t* Migrate to stderr logging (STDIO servers) or OpenTelemetry.\n\t*/\n\tasync sendLoggingMessage(params, sessionId) {\n\t\tif (this._capabilities.logging && !this.isMessageIgnored(params.level, sessionId)) return this.notification({\n\t\t\tmethod: \"notifications/message\",\n\t\t\tparams\n\t\t});\n\t}\n\tasync sendResourceUpdated(params) {\n\t\treturn this.notification({\n\t\t\tmethod: \"notifications/resources/updated\",\n\t\t\tparams\n\t\t});\n\t}\n\tasync sendResourceListChanged() {\n\t\treturn this.notification({ method: \"notifications/resources/list_changed\" });\n\t}\n\tasync sendToolListChanged() {\n\t\treturn this.notification({ method: \"notifications/tools/list_changed\" });\n\t}\n\tasync sendPromptListChanged() {\n\t\treturn this.notification({ method: \"notifications/prompts/list_changed\" });\n\t}\n};\n/**\n* The capability set a server advertises on `server/discover`. Pure — never\n* mutates the input; the legacy `initialize` advertisement is untouched.\n*\n* The serving entries serve `subscriptions/listen` themselves, so the\n* `listChanged` and `resources.subscribe` capability bits are advertised\n* as-is: a modern-era client uses them to decide which notification types to\n* request on its listen filter.\n*/\nfunction discoverAdvertisedCapabilities(capabilities) {\n\treturn { ...capabilities };\n}\n\n//#endregion\n//#region src/server/mcp.ts\n/**\n* High-level MCP server that provides a simpler API for working with resources, tools, and prompts.\n* For advanced usage (like sending notifications or setting custom request handlers), use the underlying\n* {@linkcode Server} instance available via the {@linkcode McpServer.server | server} property.\n*\n* @example\n* ```ts source=\"./mcp.examples.ts#McpServer_basicUsage\"\n* const server = new McpServer({\n* name: 'my-server',\n* version: '1.0.0'\n* });\n* ```\n*/\nvar McpServer = class {\n\t/**\n\t* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.\n\t*/\n\tserver;\n\t_registeredResources = {};\n\t_registeredResourceTemplates = {};\n\t_registeredTools = {};\n\t_registeredPrompts = {};\n\t/**\n\t* Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243\n\t* registration-time scan and the pre-dispatch validation step share one\n\t* conversion instead of paying it twice per request under the\n\t* per-request-factory `createMcpHandler` model.\n\t*/\n\t_toolInputSchemaJson = {};\n\t/**\n\t* The JSON-serialized `inputSchema` of a registered tool, or `undefined`\n\t* when no such tool is registered. Used by the HTTP entry's pre-dispatch\n\t* SEP-2243 `Mcp-Param-*` validation step (which needs the same JSON Schema\n\t* `tools/list` would emit, before dispatch reaches the handler).\n\t*\n\t* @internal\n\t*/\n\ttoolInputSchemaJson(name) {\n\t\tconst tool = this._registeredTools[name];\n\t\tif (tool === void 0 || !tool.enabled) return void 0;\n\t\tif (Object.hasOwn(this._toolInputSchemaJson, name)) return this._toolInputSchemaJson[name];\n\t\tif (tool.inputSchema === void 0) return EMPTY_OBJECT_JSON_SCHEMA;\n\t\ttry {\n\t\t\tconst json = standardSchemaToJsonSchema(tool.inputSchema, \"input\");\n\t\t\tthis._toolInputSchemaJson[name] = json;\n\t\t\treturn json;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\tconstructor(serverInfo, options) {\n\t\tthis.server = new Server(serverInfo, options);\n\t\tif (options?.capabilities?.tools) this.setToolRequestHandlers();\n\t\tif (options?.capabilities?.resources) this.setResourceRequestHandlers();\n\t\tif (options?.capabilities?.prompts) this.setPromptRequestHandlers();\n\t}\n\t/**\n\t* Attaches to the given transport, starts it, and starts listening for messages.\n\t*\n\t* The `server` object assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.\n\t*\n\t* @example\n\t* ```ts source=\"./mcp.examples.ts#McpServer_connect_stdio\"\n\t* const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n\t* const transport = new StdioServerTransport();\n\t* await server.connect(transport);\n\t* ```\n\t*/\n\tasync connect(transport) {\n\t\treturn await this.server.connect(transport);\n\t}\n\t/**\n\t* Closes the connection.\n\t*/\n\tasync close() {\n\t\tawait this.server.close();\n\t}\n\t_toolHandlersInitialized = false;\n\tsetToolRequestHandlers() {\n\t\tif (this._toolHandlersInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"tools/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"tools/call\");\n\t\tthis.server.registerCapabilities({ tools: { listChanged: this.server.getCapabilities().tools?.listChanged ?? true } });\n\t\tthis.server.setRequestHandler(\"tools/list\", () => ({ tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => {\n\t\t\tconst toolDefinition = {\n\t\t\t\tname,\n\t\t\t\ttitle: tool.title,\n\t\t\t\tdescription: tool.description,\n\t\t\t\tinputSchema: tool.inputSchema ? standardSchemaToJsonSchema(tool.inputSchema, \"input\") : EMPTY_OBJECT_JSON_SCHEMA,\n\t\t\t\tannotations: tool.annotations,\n\t\t\t\ticons: tool.icons,\n\t\t\t\texecution: tool.execution,\n\t\t\t\t_meta: tool._meta\n\t\t\t};\n\t\t\tif (tool.outputSchema) toolDefinition.outputSchema = standardSchemaToJsonSchema(tool.outputSchema, \"output\");\n\t\t\treturn toolDefinition;\n\t\t}) }));\n\t\tthis.server.setRequestHandler(\"tools/call\", async (request, ctx) => {\n\t\t\tconst tool = this._registeredTools[request.params.name];\n\t\t\tif (!tool) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Tool ${request.params.name} not found`);\n\t\t\tif (!tool.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);\n\t\t\ttry {\n\t\t\t\tconst args = await this.validateToolInput(tool, request.params.arguments, request.params.name);\n\t\t\t\tconst result = await this.executeToolHandler(tool, args, ctx);\n\t\t\t\tawait this.validateToolOutput(tool, result, request.params.name);\n\t\t\t\tif (isInputRequiredResult(result)) return result;\n\t\t\t\treturn this.server.projectCallToolResult(result, tool.outputSchemaJson);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof ProtocolError && error.code === ProtocolErrorCode.UrlElicitationRequired) throw error;\n\t\t\t\treturn this.createToolError(error instanceof Error ? error.message : String(error));\n\t\t\t}\n\t\t});\n\t\tthis._toolHandlersInitialized = true;\n\t}\n\t/**\n\t* Creates a tool error result.\n\t*\n\t* @param errorMessage - The error message.\n\t* @returns The tool error result.\n\t*/\n\tcreateToolError(errorMessage) {\n\t\treturn {\n\t\t\tcontent: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: errorMessage\n\t\t\t}],\n\t\t\tisError: true\n\t\t};\n\t}\n\t/**\n\t* Validates tool input arguments against the tool's input schema.\n\t*/\n\tasync validateToolInput(tool, args, toolName) {\n\t\tif (!tool.inputSchema) return;\n\t\tconst parseResult = await validateStandardSchema(tool.inputSchema, args ?? {});\n\t\tif (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);\n\t\treturn parseResult.data;\n\t}\n\t/**\n\t* Validates tool output against the tool's output schema.\n\t*/\n\tasync validateToolOutput(tool, result, toolName) {\n\t\tif (!tool.outputSchema) return;\n\t\tif (isInputRequiredResult(result)) return;\n\t\tif (result.isError) return;\n\t\tif (result.structuredContent === void 0) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`);\n\t\tconst parseResult = await validateStandardSchema(tool.outputSchema, result.structuredContent);\n\t\tif (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${parseResult.error}`);\n\t}\n\t/**\n\t* Executes a tool handler.\n\t*/\n\tasync executeToolHandler(tool, args, ctx) {\n\t\treturn tool.executor(args, ctx);\n\t}\n\t_completionHandlerInitialized = false;\n\tsetCompletionRequestHandler() {\n\t\tif (this._completionHandlerInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"completion/complete\");\n\t\tthis.server.registerCapabilities({ completions: {} });\n\t\tthis.server.setRequestHandler(\"completion/complete\", async (request) => {\n\t\t\tswitch (request.params.ref.type) {\n\t\t\t\tcase \"ref/prompt\":\n\t\t\t\t\tassertCompleteRequestPrompt(request);\n\t\t\t\t\treturn this.handlePromptCompletion(request, request.params.ref);\n\t\t\t\tcase \"ref/resource\":\n\t\t\t\t\tassertCompleteRequestResourceTemplate(request);\n\t\t\t\t\treturn this.handleResourceCompletion(request, request.params.ref);\n\t\t\t\tdefault: throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`);\n\t\t\t}\n\t\t});\n\t\tthis._completionHandlerInitialized = true;\n\t}\n\tasync handlePromptCompletion(request, ref) {\n\t\tconst prompt = this._registeredPrompts[ref.name];\n\t\tif (!prompt) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${ref.name} not found`);\n\t\tif (!prompt.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${ref.name} disabled`);\n\t\tif (!prompt.argsSchema) return EMPTY_COMPLETION_RESULT;\n\t\tconst field = unwrapOptionalSchema(getSchemaShape(prompt.argsSchema)?.[request.params.argument.name]);\n\t\tif (!isCompletable(field)) return EMPTY_COMPLETION_RESULT;\n\t\tconst completer = getCompleter(field);\n\t\tif (!completer) return EMPTY_COMPLETION_RESULT;\n\t\treturn createCompletionResult(await completer(request.params.argument.value, request.params.context));\n\t}\n\tasync handleResourceCompletion(request, ref) {\n\t\tconst template = Object.values(this._registeredResourceTemplates).find((t) => t.resourceTemplate.uriTemplate.toString() === ref.uri);\n\t\tif (!template) {\n\t\t\tif (this._registeredResources[ref.uri]) return EMPTY_COMPLETION_RESULT;\n\t\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`);\n\t\t}\n\t\tconst completer = template.resourceTemplate.completeCallback(request.params.argument.name);\n\t\tif (!completer) return EMPTY_COMPLETION_RESULT;\n\t\treturn createCompletionResult(await completer(request.params.argument.value, request.params.context));\n\t}\n\t_resourceHandlersInitialized = false;\n\tsetResourceRequestHandlers() {\n\t\tif (this._resourceHandlersInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"resources/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"resources/templates/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"resources/read\");\n\t\tthis.server.registerCapabilities({ resources: { listChanged: this.server.getCapabilities().resources?.listChanged ?? true } });\n\t\tthis.server.setRequestHandler(\"resources/list\", async (_request, ctx) => {\n\t\t\tconst resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({\n\t\t\t\turi,\n\t\t\t\tname: resource.name,\n\t\t\t\t...resource.metadata\n\t\t\t}));\n\t\t\tconst templateResources = [];\n\t\t\tfor (const template of Object.values(this._registeredResourceTemplates)) {\n\t\t\t\tif (!template.resourceTemplate.listCallback) continue;\n\t\t\t\tconst result = await template.resourceTemplate.listCallback(ctx);\n\t\t\t\tfor (const resource of result.resources) templateResources.push({\n\t\t\t\t\t...template.metadata,\n\t\t\t\t\t...resource\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn { resources: [...resources, ...templateResources] };\n\t\t});\n\t\tthis.server.setRequestHandler(\"resources/templates/list\", async () => {\n\t\t\treturn { resourceTemplates: Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({\n\t\t\t\tname,\n\t\t\t\turiTemplate: template.resourceTemplate.uriTemplate.toString(),\n\t\t\t\t...template.metadata\n\t\t\t})) };\n\t\t});\n\t\tthis.server.setRequestHandler(\"resources/read\", async (request, ctx) => {\n\t\t\tlet uri;\n\t\t\ttry {\n\t\t\t\turi = new URL(request.params.uri);\n\t\t\t} catch {\n\t\t\t\tthrow new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource URI ${request.params.uri} is invalid`, {\n\t\t\t\t\turi: request.params.uri,\n\t\t\t\t\treason: \"invalid_uri\"\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst resource = this._registeredResources[uri.toString()];\n\t\t\tif (resource) {\n\t\t\t\tif (!resource.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource ${uri} disabled`);\n\t\t\t\treturn attachCacheHintFallback(await resource.readCallback(uri, ctx), resource.cacheHint);\n\t\t\t}\n\t\t\tfor (const template of Object.values(this._registeredResourceTemplates)) {\n\t\t\t\tconst variables = template.resourceTemplate.uriTemplate.match(uri.toString());\n\t\t\t\tif (variables) return attachCacheHintFallback(await template.readCallback(uri, variables, ctx), template.cacheHint);\n\t\t\t}\n\t\t\tthrow new ResourceNotFoundError(request.params.uri);\n\t\t});\n\t\tthis._resourceHandlersInitialized = true;\n\t}\n\t_promptHandlersInitialized = false;\n\tsetPromptRequestHandlers() {\n\t\tif (this._promptHandlersInitialized) return;\n\t\tthis.server.assertCanSetRequestHandler(\"prompts/list\");\n\t\tthis.server.assertCanSetRequestHandler(\"prompts/get\");\n\t\tthis.server.registerCapabilities({ prompts: { listChanged: this.server.getCapabilities().prompts?.listChanged ?? true } });\n\t\tthis.server.setRequestHandler(\"prompts/list\", () => ({ prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name, prompt]) => {\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\ttitle: prompt.title,\n\t\t\t\tdescription: prompt.description,\n\t\t\t\targuments: prompt.argsSchema ? promptArgumentsFromStandardSchema(prompt.argsSchema) : void 0,\n\t\t\t\ticons: prompt.icons,\n\t\t\t\t_meta: prompt._meta\n\t\t\t};\n\t\t}) }));\n\t\tthis.server.setRequestHandler(\"prompts/get\", async (request, ctx) => {\n\t\t\tconst prompt = this._registeredPrompts[request.params.name];\n\t\t\tif (!prompt) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${request.params.name} not found`);\n\t\t\tif (!prompt.enabled) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`);\n\t\t\treturn prompt.handler(request.params.arguments, ctx);\n\t\t});\n\t\tthis._promptHandlersInitialized = true;\n\t}\n\tregisterResource(name, uriOrTemplate, config, readCallback) {\n\t\tconst cacheHint = config.cacheHint;\n\t\tlet metadata = config;\n\t\tif (cacheHint !== void 0) {\n\t\t\tassertValidCacheHint(cacheHint, `resource ${name}`);\n\t\t\tconst rest = { ...config };\n\t\t\tdelete rest.cacheHint;\n\t\t\tmetadata = rest;\n\t\t}\n\t\tif (typeof uriOrTemplate === \"string\") {\n\t\t\tif (this._registeredResources[uriOrTemplate]) throw new Error(`Resource ${uriOrTemplate} is already registered`);\n\t\t\tconst registeredResource = this._createRegisteredResource(name, config.title, uriOrTemplate, metadata, readCallback);\n\t\t\tif (cacheHint !== void 0) registeredResource.cacheHint = cacheHint;\n\t\t\tthis.setResourceRequestHandlers();\n\t\t\tthis.sendResourceListChanged();\n\t\t\treturn registeredResource;\n\t\t} else {\n\t\t\tif (this._registeredResourceTemplates[name]) throw new Error(`Resource template ${name} is already registered`);\n\t\t\tconst registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config.title, uriOrTemplate, metadata, readCallback);\n\t\t\tif (cacheHint !== void 0) registeredResourceTemplate.cacheHint = cacheHint;\n\t\t\tthis.setResourceRequestHandlers();\n\t\t\tthis.sendResourceListChanged();\n\t\t\treturn registeredResourceTemplate;\n\t\t}\n\t}\n\t_createRegisteredResource(name, title, uri, metadata, readCallback) {\n\t\tconst registeredResource = {\n\t\t\tname,\n\t\t\ttitle,\n\t\t\tmetadata,\n\t\t\treadCallback,\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredResource.update({ enabled: false }),\n\t\t\tenable: () => registeredResource.update({ enabled: true }),\n\t\t\tremove: () => registeredResource.update({ uri: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.uri !== void 0 && updates.uri !== uri) {\n\t\t\t\t\tdelete this._registeredResources[uri];\n\t\t\t\t\tif (updates.uri) this._registeredResources[updates.uri] = registeredResource;\n\t\t\t\t}\n\t\t\t\tif (updates.name !== void 0) registeredResource.name = updates.name;\n\t\t\t\tif (updates.title !== void 0) registeredResource.title = updates.title;\n\t\t\t\tif (updates.metadata !== void 0) registeredResource.metadata = updates.metadata;\n\t\t\t\tif (updates.callback !== void 0) registeredResource.readCallback = updates.callback;\n\t\t\t\tif (updates.enabled !== void 0) registeredResource.enabled = updates.enabled;\n\t\t\t\tthis.sendResourceListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredResources[uri] = registeredResource;\n\t\treturn registeredResource;\n\t}\n\t_createRegisteredResourceTemplate(name, title, template, metadata, readCallback) {\n\t\tconst registeredResourceTemplate = {\n\t\t\tresourceTemplate: template,\n\t\t\ttitle,\n\t\t\tmetadata,\n\t\t\treadCallback,\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredResourceTemplate.update({ enabled: false }),\n\t\t\tenable: () => registeredResourceTemplate.update({ enabled: true }),\n\t\t\tremove: () => registeredResourceTemplate.update({ name: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.name !== void 0 && updates.name !== name) {\n\t\t\t\t\tdelete this._registeredResourceTemplates[name];\n\t\t\t\t\tif (updates.name) this._registeredResourceTemplates[updates.name] = registeredResourceTemplate;\n\t\t\t\t}\n\t\t\t\tif (updates.title !== void 0) registeredResourceTemplate.title = updates.title;\n\t\t\t\tif (updates.template !== void 0) registeredResourceTemplate.resourceTemplate = updates.template;\n\t\t\t\tif (updates.metadata !== void 0) registeredResourceTemplate.metadata = updates.metadata;\n\t\t\t\tif (updates.callback !== void 0) registeredResourceTemplate.readCallback = updates.callback;\n\t\t\t\tif (updates.enabled !== void 0) registeredResourceTemplate.enabled = updates.enabled;\n\t\t\t\tthis.sendResourceListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredResourceTemplates[name] = registeredResourceTemplate;\n\t\tconst variableNames = template.uriTemplate.variableNames;\n\t\tif (Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v))) this.setCompletionRequestHandler();\n\t\treturn registeredResourceTemplate;\n\t}\n\t_createRegisteredPrompt(name, title, description, argsSchema, callback, icons, _meta) {\n\t\tlet currentArgsSchema = argsSchema;\n\t\tlet currentCallback = callback;\n\t\tconst registeredPrompt = {\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\targsSchema,\n\t\t\ticons,\n\t\t\t_meta,\n\t\t\thandler: createPromptHandler(name, argsSchema, callback),\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredPrompt.update({ enabled: false }),\n\t\t\tenable: () => registeredPrompt.update({ enabled: true }),\n\t\t\tremove: () => registeredPrompt.update({ name: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.name !== void 0 && updates.name !== name) {\n\t\t\t\t\tdelete this._registeredPrompts[name];\n\t\t\t\t\tif (updates.name) this._registeredPrompts[updates.name] = registeredPrompt;\n\t\t\t\t}\n\t\t\t\tif (updates.title !== void 0) registeredPrompt.title = updates.title;\n\t\t\t\tif (updates.description !== void 0) registeredPrompt.description = updates.description;\n\t\t\t\tif (updates.icons !== void 0) registeredPrompt.icons = updates.icons;\n\t\t\t\tif (updates._meta !== void 0) registeredPrompt._meta = updates._meta;\n\t\t\t\tlet needsHandlerRegen = false;\n\t\t\t\tif (updates.argsSchema !== void 0) {\n\t\t\t\t\tregisteredPrompt.argsSchema = updates.argsSchema;\n\t\t\t\t\tcurrentArgsSchema = updates.argsSchema;\n\t\t\t\t\tneedsHandlerRegen = true;\n\t\t\t\t}\n\t\t\t\tif (updates.callback !== void 0) {\n\t\t\t\t\tcurrentCallback = updates.callback;\n\t\t\t\t\tneedsHandlerRegen = true;\n\t\t\t\t}\n\t\t\t\tif (needsHandlerRegen) registeredPrompt.handler = createPromptHandler(name, currentArgsSchema, currentCallback);\n\t\t\t\tif (updates.enabled !== void 0) registeredPrompt.enabled = updates.enabled;\n\t\t\t\tthis.sendPromptListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredPrompts[name] = registeredPrompt;\n\t\tif (argsSchema) {\n\t\t\tconst shape = getSchemaShape(argsSchema);\n\t\t\tif (shape) {\n\t\t\t\tif (Object.values(shape).some((field) => {\n\t\t\t\t\treturn isCompletable(unwrapOptionalSchema(field));\n\t\t\t\t})) this.setCompletionRequestHandler();\n\t\t\t}\n\t\t}\n\t\treturn registeredPrompt;\n\t}\n\t_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, _meta, handler) {\n\t\tvalidateAndWarnToolName(name);\n\t\tif (inputSchema !== void 0) try {\n\t\t\tconst json = standardSchemaToJsonSchema(inputSchema, \"input\");\n\t\t\tthis._toolInputSchemaJson[name] = json;\n\t\t\tconst scan = scanXMcpHeaderDeclarations(json);\n\t\t\tif (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);\n\t\t} catch {}\n\t\tlet currentHandler = handler;\n\t\tconst registeredTool = {\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tinputSchema,\n\t\t\toutputSchema,\n\t\t\toutputSchemaJson: convertOutputSchemaJson(outputSchema),\n\t\t\tannotations,\n\t\t\ticons,\n\t\t\texecution,\n\t\t\t_meta,\n\t\t\thandler,\n\t\t\texecutor: createToolExecutor(inputSchema, handler),\n\t\t\tenabled: true,\n\t\t\tdisable: () => registeredTool.update({ enabled: false }),\n\t\t\tenable: () => registeredTool.update({ enabled: true }),\n\t\t\tremove: () => registeredTool.update({ name: null }),\n\t\t\tupdate: (updates) => {\n\t\t\t\tif (updates.name !== void 0 && updates.name !== name) {\n\t\t\t\t\tif (typeof updates.name === \"string\") validateAndWarnToolName(updates.name);\n\t\t\t\t\tdelete this._registeredTools[name];\n\t\t\t\t\tdelete this._toolInputSchemaJson[name];\n\t\t\t\t\tif (updates.name) {\n\t\t\t\t\t\tdelete this._toolInputSchemaJson[updates.name];\n\t\t\t\t\t\tthis._registeredTools[updates.name] = registeredTool;\n\t\t\t\t\t\tname = updates.name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (updates.title !== void 0) registeredTool.title = updates.title;\n\t\t\t\tif (updates.description !== void 0) registeredTool.description = updates.description;\n\t\t\t\tlet needsExecutorRegen = false;\n\t\t\t\tif (updates.paramsSchema !== void 0) {\n\t\t\t\t\tregisteredTool.inputSchema = updates.paramsSchema;\n\t\t\t\t\tdelete this._toolInputSchemaJson[name];\n\t\t\t\t\tneedsExecutorRegen = true;\n\t\t\t\t}\n\t\t\t\tif (updates.callback !== void 0) {\n\t\t\t\t\tregisteredTool.handler = updates.callback;\n\t\t\t\t\tcurrentHandler = updates.callback;\n\t\t\t\t\tneedsExecutorRegen = true;\n\t\t\t\t}\n\t\t\t\tif (needsExecutorRegen) registeredTool.executor = createToolExecutor(registeredTool.inputSchema, currentHandler);\n\t\t\t\tif (updates.outputSchema !== void 0) {\n\t\t\t\t\tregisteredTool.outputSchema = updates.outputSchema;\n\t\t\t\t\tregisteredTool.outputSchemaJson = convertOutputSchemaJson(updates.outputSchema);\n\t\t\t\t}\n\t\t\t\tif (updates.annotations !== void 0) registeredTool.annotations = updates.annotations;\n\t\t\t\tif (updates.icons !== void 0) registeredTool.icons = updates.icons;\n\t\t\t\tif (updates._meta !== void 0) registeredTool._meta = updates._meta;\n\t\t\t\tif (updates.enabled !== void 0) registeredTool.enabled = updates.enabled;\n\t\t\t\tthis.sendToolListChanged();\n\t\t\t}\n\t\t};\n\t\tthis._registeredTools[name] = registeredTool;\n\t\tthis.setToolRequestHandlers();\n\t\tthis.sendToolListChanged();\n\t\treturn registeredTool;\n\t}\n\tregisterTool(name, config, cb) {\n\t\tif (this._registeredTools[name]) throw new Error(`Tool ${name} is already registered`);\n\t\tconst { title, description, inputSchema, outputSchema, annotations, icons, _meta } = config;\n\t\treturn this._createRegisteredTool(name, title, description, normalizeRawShapeSchema(inputSchema), normalizeRawShapeSchema(outputSchema), annotations, icons, void 0, _meta, cb);\n\t}\n\tregisterPrompt(name, config, cb) {\n\t\tif (this._registeredPrompts[name]) throw new Error(`Prompt ${name} is already registered`);\n\t\tconst { title, description, argsSchema, icons, _meta } = config;\n\t\tconst registeredPrompt = this._createRegisteredPrompt(name, title, description, normalizeRawShapeSchema(argsSchema), cb, icons, _meta);\n\t\tthis.setPromptRequestHandlers();\n\t\tthis.sendPromptListChanged();\n\t\treturn registeredPrompt;\n\t}\n\t/**\n\t* Checks if the server is connected to a transport.\n\t* @returns `true` if the server is connected\n\t*/\n\tisConnected() {\n\t\treturn this.server.transport !== void 0;\n\t}\n\t/**\n\t* Sends a logging message to the client, if connected.\n\t* Note: You only need to send the parameters object, not the entire JSON-RPC message.\n\t* @see {@linkcode LoggingMessageNotification}\n\t* @param params\n\t* @param sessionId Optional for stateless transports and backward compatibility.\n\t*\n\t* @example\n\t* ```ts source=\"./mcp.examples.ts#McpServer_sendLoggingMessage_basic\"\n\t* await server.sendLoggingMessage({\n\t* level: 'info',\n\t* data: 'Processing complete'\n\t* });\n\t* ```\n\t*\n\t* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).\n\t* Remains functional during the deprecation window (at least twelve months).\n\t* Migrate to stderr logging (STDIO servers) or OpenTelemetry.\n\t*/\n\tasync sendLoggingMessage(params, sessionId) {\n\t\treturn this.server.sendLoggingMessage(params, sessionId);\n\t}\n\t/**\n\t* Sends a resource list changed event to the client, if connected.\n\t*/\n\tsendResourceListChanged() {\n\t\tif (this.isConnected()) this.server.sendResourceListChanged();\n\t}\n\t/**\n\t* Sends a tool list changed event to the client, if connected.\n\t*/\n\tsendToolListChanged() {\n\t\tif (this.isConnected()) this.server.sendToolListChanged();\n\t}\n\t/**\n\t* Sends a prompt list changed event to the client, if connected.\n\t*/\n\tsendPromptListChanged() {\n\t\tif (this.isConnected()) this.server.sendPromptListChanged();\n\t}\n};\n/**\n* A resource template combines a URI pattern with optional functionality to enumerate\n* all resources matching that pattern.\n*/\nvar ResourceTemplate = class {\n\t_uriTemplate;\n\tconstructor(uriTemplate, _callbacks) {\n\t\tthis._callbacks = _callbacks;\n\t\tthis._uriTemplate = typeof uriTemplate === \"string\" ? new UriTemplate(uriTemplate) : uriTemplate;\n\t}\n\t/**\n\t* Gets the URI template pattern.\n\t*/\n\tget uriTemplate() {\n\t\treturn this._uriTemplate;\n\t}\n\t/**\n\t* Gets the list callback, if one was provided.\n\t*/\n\tget listCallback() {\n\t\treturn this._callbacks.list;\n\t}\n\t/**\n\t* Gets the callback for completing a specific URI template variable, if one was provided.\n\t*/\n\tcompleteCallback(variable) {\n\t\treturn this._callbacks.complete?.[variable];\n\t}\n};\n/**\n* Creates an executor that invokes the handler with the appropriate arguments.\n* When `inputSchema` is defined, the handler is called with `(args, ctx)`.\n* When `inputSchema` is undefined, the handler is called with just `(ctx)`.\n*/\nfunction createToolExecutor(inputSchema, handler) {\n\tif (inputSchema) {\n\t\tconst callback$1 = handler;\n\t\treturn async (args, ctx) => callback$1(args, ctx);\n\t}\n\tconst callback = handler;\n\treturn async (_args, ctx) => callback(ctx);\n}\nconst EMPTY_OBJECT_JSON_SCHEMA = {\n\ttype: \"object\",\n\tproperties: {}\n};\n/**\n* Convert a registered `outputSchema` to JSON Schema, memoised on {@link RegisteredTool.outputSchemaJson}\n* so `tools/call` passes the SAME advertised schema to the wire codec's `projectCallToolResult` that\n* `tools/list` emits (and that the 2025 codec's `encodeResult('tools/list', …)` may wrap). A conversion\n* failure yields `undefined` so the failure surfaces where it always has (`tools/list`).\n*/\nfunction convertOutputSchemaJson(outputSchema) {\n\tif (outputSchema === void 0) return void 0;\n\ttry {\n\t\treturn standardSchemaToJsonSchema(outputSchema, \"output\");\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* Creates a type-safe prompt handler that captures the schema and callback in a closure.\n* This eliminates the need for type assertions at the call site.\n*/\nfunction createPromptHandler(name, argsSchema, callback) {\n\tif (argsSchema) {\n\t\tconst typedCallback = callback;\n\t\treturn async (args, ctx) => {\n\t\t\tconst parseResult = await validateStandardSchema(argsSchema, args);\n\t\t\tif (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);\n\t\t\treturn typedCallback(parseResult.data, ctx);\n\t\t};\n\t} else {\n\t\tconst typedCallback = callback;\n\t\treturn async (_args, ctx) => {\n\t\t\treturn typedCallback(ctx);\n\t\t};\n\t}\n}\nfunction createCompletionResult(suggestions) {\n\treturn { completion: {\n\t\tvalues: suggestions.map(String).slice(0, 100),\n\t\ttotal: suggestions.length,\n\t\thasMore: suggestions.length > 100\n\t} };\n}\nconst EMPTY_COMPLETION_RESULT = { completion: {\n\tvalues: [],\n\thasMore: false\n} };\n/** @internal Gets the shape of a Zod object schema */\nfunction getSchemaShape(schema) {\n\tconst candidate = schema;\n\tif (candidate.shape && typeof candidate.shape === \"object\") return candidate.shape;\n}\n/** @internal Checks if a Zod schema is optional */\nfunction isOptionalSchema(schema) {\n\treturn schema?.type === \"optional\";\n}\n/** @internal Unwraps an optional Zod schema */\nfunction unwrapOptionalSchema(schema) {\n\tif (!isOptionalSchema(schema)) return schema;\n\treturn schema.def?.innerType ?? schema;\n}\n\n//#endregion\nexport { seedClientIdentityFromEnvelope as a, StdioListenRouter as c, createServerNotifier as d, DEFAULT_SSE_KEEP_ALIVE_MS as f, isCompletable as h, installModernOnlyHandlers as i, createListenRouter as l, completable as m, ResourceTemplate as n, serverIdentityOf as o, armSseKeepAlive as p, Server as r, DEFAULT_MAX_SUBSCRIPTIONS as s, McpServer as t, InMemoryServerEventBus as u };\n//# sourceMappingURL=mcp-DXXb3Vv3.mjs.map","import { a as seedClientIdentityFromEnvelope, d as createServerNotifier, f as DEFAULT_SSE_KEEP_ALIVE_MS, h as isCompletable, i as installModernOnlyHandlers, l as createListenRouter, m as completable, n as ResourceTemplate, o as serverIdentityOf, p as armSseKeepAlive, r as Server, s as DEFAULT_MAX_SUBSCRIPTIONS, t as McpServer, u as InMemoryServerEventBus } from \"./mcp-DXXb3Vv3.mjs\";\nimport { $ as isTaskAugmentedRequestParams, At as LATEST_PROTOCOL_VERSION, B as scanXMcpHeaderDeclarations, Bt as TRACESTATE_META_KEY, Ct as CLIENT_CAPABILITIES_META_KEY, D as acceptedContent, Dt as INVALID_PARAMS, Et as INTERNAL_ERROR, Ft as RELATED_TASK_META_KEY, G as isInitializeRequest, Gt as resourceUrlFromServerUrl, H as assertCompleteRequestPrompt, I as classifyInboundRequest, It as SERVER_INFO_META_KEY, J as isJSONRPCErrorResponse, Jt as SdkHttpError, K as isInitializedNotification, Kt as SdkError, L as httpStatusForErrorCode, Lt as SUBSCRIPTION_ID_META_KEY, Mt as METHOD_NOT_FOUND, Nt as PARSE_ERROR, O as inputRequired, Ot as INVALID_REQUEST, P as LADDER_ERROR_HTTP_STATUS, Pt as PROTOCOL_VERSION_META_KEY, Q as isJSONRPCResultResponse, R as modernOnlyStrictRejection, Rt as SUPPORTED_PROTOCOL_VERSIONS, S as specTypeSchemas, St as BAGGAGE_META_KEY, Tt as DEFAULT_NEGOTIATED_PROTOCOL_VERSION, U as assertCompleteRequestResourceTemplate, Ut as requiredClientCapabilitiesForRequest, V as validateMcpParamHeaders, Vt as missingClientCapabilities, W as isCallToolResult, Wt as checkResourceAllowed, X as isJSONRPCRequest, Xt as OAuthErrorCode, Y as isJSONRPCNotification, Yt as OAuthError, Z as isJSONRPCResponse, _ as mergeCapabilities, a as UriTemplate, at as requestMetaOf, c as ReadBuffer, d as serializeMessage, dt as ResourceNotFoundError, et as parseJSONRPCMessage, f as getDisplayName, ft as UnsupportedProtocolVersionError, g as Protocol, h as DEFAULT_REQUEST_TIMEOUT_MSEC, i as InMemoryTransport, jt as LOG_LEVEL_META_KEY, k as inputResponse, kt as JSONRPC_VERSION, l as STDIO_DEFAULT_MAX_BUFFER_SIZE, lt as MissingRequiredClientCapabilityError, m as mediaTypeEssence, mt as ProtocolErrorCode, n as preloadSchemas, o as createFetchWithInit, p as isJsonContentType, pt as UrlElicitationRequiredError, q as isInputRequiredResult, qt as SdkErrorCode, t as fromJsonSchema$1, tt as JSONRPCMessageSchema, u as deserializeMessage, ut as ProtocolError, vt as SUPPORTED_MODERN_PROTOCOL_VERSIONS, wt as CLIENT_INFO_META_KEY, x as isSpecType, y as setNegotiatedProtocolVersion, z as validateStandardRequestHeaders, zt as TRACEPARENT_META_KEY } from \"./src-CX2iR2pK.mjs\";\nimport { DefaultJsonSchemaValidator } from \"@modelcontextprotocol/server/_shims\";\n\n//#region src/server/perRequestTransport.ts\n/**\n* The per-request micro-transport: a real, connected `Transport` whose whole\n* lifetime is one HTTP exchange. See the module documentation for the\n* response shapes it produces.\n*/\nvar PerRequestHTTPServerTransport = class {\n\tonclose;\n\tonerror;\n\tonmessage;\n\t_classification;\n\t_responseMode;\n\t_started = false;\n\t_used = false;\n\t_closed = false;\n\t_terminalDelivered = false;\n\t/**\n\t* `true` only while the inbound message is being delivered synchronously\n\t* to the connected protocol layer. The pre-handler gates (the era\n\t* registry gate, the edge→instance handoff check, the missing-handler\n\t* rejection) answer inside this window; request handlers always run\n\t* after it (the protocol layer defers them to a microtask). An error\n\t* sent inside the window is therefore ladder-originated, and an error\n\t* sent after it is handler-produced.\n\t*/\n\t_dispatchWindowOpen = false;\n\t_requestId;\n\t_deferredResponse;\n\t_sse;\n\t_abortCleanup;\n\t_keepAliveMs;\n\tconstructor(options) {\n\t\tthis._classification = options.classification;\n\t\tthis._responseMode = options.responseMode ?? \"auto\";\n\t\tthis._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;\n\t}\n\tasync start() {\n\t\tif (this._started) throw new Error(\"PerRequestHTTPServerTransport is already started\");\n\t\tthis._started = true;\n\t}\n\t/**\n\t* Serves the single exchange: delivers the classified message to the\n\t* connected server instance and resolves with the HTTP response.\n\t*\n\t* Throws when called a second time (the transport is strictly\n\t* single-use), or before a server has been connected to the transport.\n\t* The returned promise rejects with a connection-closed error when the\n\t* transport is closed before a response was produced (for example because\n\t* the client disconnected).\n\t*/\n\tasync handleMessage(message, extra) {\n\t\tif (this._used) throw new Error(\"PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request\");\n\t\tif (!this._started || this.onmessage === void 0) throw new Error(\"PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message\");\n\t\tif (this._closed) throw new Error(\"PerRequestHTTPServerTransport is closed\");\n\t\tthis._used = true;\n\t\tconst signal = extra?.request?.signal;\n\t\tif (signal?.aborted) {\n\t\t\tawait this.close();\n\t\t\tthrow new SdkError(SdkErrorCode.ConnectionClosed, \"The request was aborted before it could be handled\");\n\t\t}\n\t\tconst messageExtra = {\n\t\t\tclassification: this._classification,\n\t\t\t...extra?.request !== void 0 && { request: extra.request },\n\t\t\t...extra?.authInfo !== void 0 && { authInfo: extra.authInfo }\n\t\t};\n\t\tif (isJSONRPCRequest(message)) {\n\t\t\tthis._requestId = message.id;\n\t\t\tlet resolve;\n\t\t\tlet reject;\n\t\t\tconst promise = new Promise((promiseResolve, promiseReject) => {\n\t\t\t\tresolve = promiseResolve;\n\t\t\t\treject = promiseReject;\n\t\t\t});\n\t\t\tthis._deferredResponse = {\n\t\t\t\tpromise,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t\tsettled: false\n\t\t\t};\n\t\t\tif (signal !== void 0) {\n\t\t\t\tconst onAbort = () => void this.close();\n\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\tthis._abortCleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t\t\t}\n\t\t\tthis._dispatchWindowOpen = true;\n\t\t\ttry {\n\t\t\t\tthis.onmessage(message, messageExtra);\n\t\t\t} finally {\n\t\t\t\tthis._dispatchWindowOpen = false;\n\t\t\t}\n\t\t\tif (this._responseMode === \"sse\" && !this._closed && !this._deferredResponse.settled) this.upgradeToSse();\n\t\t\treturn promise;\n\t\t}\n\t\tthis.onmessage(message, messageExtra);\n\t\treturn new Response(null, { status: 202 });\n\t}\n\tasync send(message, options) {\n\t\tif (this._closed) return;\n\t\tconst isResponse = isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message);\n\t\tconst relatedId = isResponse ? message.id : options?.relatedRequestId;\n\t\tif (this._requestId === void 0 || relatedId === void 0 || relatedId !== this._requestId) {\n\t\t\tif (isResponse) this.onerror?.(/* @__PURE__ */ new Error(`Received a response for an unknown request id: ${String(message.id)}`));\n\t\t\treturn;\n\t\t}\n\t\tif (isResponse) {\n\t\t\tif (this._terminalDelivered) return;\n\t\t\tthis._terminalDelivered = true;\n\t\t\tconst errorCode = isJSONRPCErrorResponse(message) ? message.error.code : void 0;\n\t\t\tconst ladderStatus = errorCode !== void 0 && (this._dispatchWindowOpen || errorCode === ProtocolErrorCode.MissingRequiredClientCapability) ? LADDER_ERROR_HTTP_STATUS[errorCode] : void 0;\n\t\t\tif (ladderStatus !== void 0 && this._sse === void 0) {\n\t\t\t\tthis.settleResponse(Response.json(message, {\n\t\t\t\t\tstatus: ladderStatus,\n\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t\t}));\n\t\t\t\tqueueMicrotask(() => void this.close());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._sse !== void 0 || this._responseMode === \"sse\") {\n\t\t\t\tif (this._sse === void 0) this.upgradeToSse();\n\t\t\t\tthis.writeMessageFrame(message);\n\t\t\t\tthis.finalizeStream();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.settleResponse(Response.json(message, {\n\t\t\t\tstatus: 200,\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t}));\n\t\t\tqueueMicrotask(() => void this.close());\n\t\t\treturn;\n\t\t}\n\t\tif (this._responseMode === \"json\") return;\n\t\tif (this._sse === void 0) this.upgradeToSse();\n\t\tthis.writeMessageFrame(message);\n\t}\n\t/**\n\t* Writes an SSE comment frame (a keep-alive heartbeat). Dropped when the\n\t* exchange is not currently streaming.\n\t*/\n\twriteCommentFrame(comment) {\n\t\tif (this._closed || this._sse === void 0 || this._sse.closed) return;\n\t\tconst frame = comment.split(\"\\n\").map((line) => `: ${line}`).join(\"\\n\");\n\t\tthis.writeFrame(`${frame}\\n\\n`);\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tthis._abortCleanup?.();\n\t\tthis._abortCleanup = void 0;\n\t\tif (this._sse?.keepAliveTimer !== void 0) clearInterval(this._sse.keepAliveTimer);\n\t\tif (this._sse !== void 0 && !this._sse.closed) {\n\t\t\tthis._sse.closed = true;\n\t\t\ttry {\n\t\t\t\tthis._sse.controller.close();\n\t\t\t} catch {}\n\t\t}\n\t\tif (this._deferredResponse !== void 0 && !this._deferredResponse.settled) {\n\t\t\tthis._deferredResponse.settled = true;\n\t\t\tthis._deferredResponse.reject(new SdkError(SdkErrorCode.ConnectionClosed, \"Connection closed before a response was produced\"));\n\t\t}\n\t\tthis.onclose?.();\n\t}\n\tsettleResponse(response) {\n\t\tif (this._deferredResponse === void 0 || this._deferredResponse.settled) return;\n\t\tthis._deferredResponse.settled = true;\n\t\tthis._deferredResponse.resolve(response);\n\t}\n\tupgradeToSse() {\n\t\tlet controller;\n\t\tconst readable = new ReadableStream({\n\t\t\tstart: (streamController) => {\n\t\t\t\tcontroller = streamController;\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tthis.close();\n\t\t\t}\n\t\t});\n\t\tthis._sse = {\n\t\t\tcontroller,\n\t\t\tencoder: new TextEncoder(),\n\t\t\tclosed: false\n\t\t};\n\t\tthis._sse.keepAliveTimer = armSseKeepAlive(this._keepAliveMs, () => this.writeCommentFrame(\"keepalive\"));\n\t\tthis.settleResponse(new Response(readable, {\n\t\t\tstatus: 200,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t}\n\t\t}));\n\t}\n\tfinalizeStream() {\n\t\tif (this._sse?.keepAliveTimer !== void 0) clearInterval(this._sse.keepAliveTimer);\n\t\tif (this._sse !== void 0 && !this._sse.closed) {\n\t\t\tthis._sse.closed = true;\n\t\t\ttry {\n\t\t\t\tthis._sse.controller.close();\n\t\t\t} catch {}\n\t\t}\n\t\tqueueMicrotask(() => void this.close());\n\t}\n\twriteMessageFrame(message) {\n\t\tthis.writeFrame(`event: message\\ndata: ${JSON.stringify(message)}\\n\\n`);\n\t}\n\twriteFrame(frame) {\n\t\tif (this._sse === void 0 || this._sse.closed) return;\n\t\ttry {\n\t\t\tthis._sse.controller.enqueue(this._sse.encoder.encode(frame));\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(`Failed to write to the response stream: ${error}`));\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/server/invoke.ts\n/**\n* Serves one classified inbound message on the given server instance and\n* returns the HTTP response for the exchange.\n*\n* The instance is connected to a fresh single-exchange transport, the message\n* is injected through the normal transport message path, and whatever the\n* dispatch layer produces (the handler result, a protocol-level rejection, or\n* streamed related messages followed by the result) is captured as the\n* returned `Response`. For request exchanges, teardown rides the transport's\n* close chain once the terminal response has been delivered; notification\n* exchanges resolve with the 202 response immediately and do NOT run the\n* close chain — the transport stays connected until the caller closes it or\n* drops the per-request instance, which is the caller's choice either way.\n*/\nasync function invoke(server, message, ctx) {\n\tconst transport = new PerRequestHTTPServerTransport({\n\t\tclassification: ctx.classification,\n\t\t...ctx.responseMode !== void 0 && { responseMode: ctx.responseMode },\n\t\t...ctx.keepAliveMs !== void 0 && { keepAliveMs: ctx.keepAliveMs }\n\t});\n\tawait server.connect(transport);\n\treturn transport.handleMessage(message, {\n\t\t...ctx.request !== void 0 && { request: ctx.request },\n\t\t...ctx.authInfo !== void 0 && { authInfo: ctx.authInfo }\n\t});\n}\n\n//#endregion\n//#region src/server/streamableHttp.ts\n/**\n* Server transport for Web Standards Streamable HTTP: this implements the MCP Streamable HTTP transport specification\n* using Web Standard APIs (`Request`, `Response`, `ReadableStream`).\n*\n* This transport works on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc.\n*\n* In stateful mode:\n* - Session ID is generated and included in response headers\n* - Session ID is always included in initialization responses\n* - Requests with invalid session IDs are rejected with `404 Not Found`\n* - Non-initialization requests without a session ID are rejected with `400 Bad Request`\n* - State is maintained in-memory (connections, message history)\n*\n* In stateless mode:\n* - No Session ID is included in any responses\n* - No session validation is performed\n*\n* @example Stateful setup\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_stateful\"\n* const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n*\n* const transport = new WebStandardStreamableHTTPServerTransport({\n* sessionIdGenerator: () => crypto.randomUUID()\n* });\n*\n* await server.connect(transport);\n* ```\n*\n* @example Stateless setup\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_stateless\"\n* const transport = new WebStandardStreamableHTTPServerTransport({\n* sessionIdGenerator: undefined\n* });\n* ```\n*\n* @example Hono.js\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_hono\"\n* app.all('/mcp', async c => {\n* return transport.handleRequest(c.req.raw);\n* });\n* ```\n*\n* @example Cloudflare Workers\n* ```ts source=\"./streamableHttp.examples.ts#WebStandardStreamableHTTPServerTransport_workers\"\n* const worker = {\n* async fetch(request: Request): Promise<Response> {\n* return transport.handleRequest(request);\n* }\n* };\n* ```\n*/\nvar WebStandardStreamableHTTPServerTransport = class {\n\tsessionIdGenerator;\n\t_started = false;\n\t_closed = false;\n\t_streamMapping = /* @__PURE__ */ new Map();\n\t_requestToStreamMapping = /* @__PURE__ */ new Map();\n\t_requestResponseMap = /* @__PURE__ */ new Map();\n\t_initialized = false;\n\t_enableJsonResponse = false;\n\t_standaloneSseStreamId = \"_GET_stream\";\n\t_eventStore;\n\t_onsessioninitialized;\n\t_onsessionclosed;\n\t_allowedHosts;\n\t_allowedOrigins;\n\t_enableDnsRebindingProtection;\n\t_retryInterval;\n\t_supportedProtocolVersions;\n\t_keepAliveMs;\n\tsessionId;\n\tonclose;\n\tonerror;\n\tonmessage;\n\tconstructor(options = {}) {\n\t\tthis.sessionIdGenerator = options.sessionIdGenerator;\n\t\tthis._enableJsonResponse = options.enableJsonResponse ?? false;\n\t\tthis._eventStore = options.eventStore;\n\t\tthis._onsessioninitialized = options.onsessioninitialized;\n\t\tthis._onsessionclosed = options.onsessionclosed;\n\t\tthis._allowedHosts = options.allowedHosts;\n\t\tthis._allowedOrigins = options.allowedOrigins;\n\t\tthis._enableDnsRebindingProtection = options.enableDnsRebindingProtection ?? false;\n\t\tthis._retryInterval = options.retryInterval;\n\t\tthis._supportedProtocolVersions = options.supportedProtocolVersions ?? SUPPORTED_PROTOCOL_VERSIONS;\n\t\tthis._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;\n\t}\n\tstartKeepAlive(controller, encoder) {\n\t\tif (this._closed) return void 0;\n\t\tconst timer = armSseKeepAlive(this._keepAliveMs, () => {\n\t\t\ttry {\n\t\t\t\tcontroller.enqueue(encoder.encode(\": keepalive\\n\\n\"));\n\t\t\t} catch {\n\t\t\t\tif (timer !== void 0) clearInterval(timer);\n\t\t\t}\n\t\t});\n\t\treturn timer;\n\t}\n\t/**\n\t* Starts the transport. This is required by the {@linkcode Transport} interface but is a no-op\n\t* for the Streamable HTTP transport as connections are managed per-request.\n\t*/\n\tasync start() {\n\t\tif (this._started) throw new Error(\"Transport already started\");\n\t\tthis._started = true;\n\t}\n\t/**\n\t* Sets the supported protocol versions for header validation.\n\t* Called by the server during {@linkcode server/server.Server.connect | connect()} to pass its supported versions.\n\t*/\n\tsetSupportedProtocolVersions(versions) {\n\t\tthis._supportedProtocolVersions = versions;\n\t}\n\t/**\n\t* Helper to create a JSON error response\n\t*/\n\tcreateJsonErrorResponse(status, code, message, options) {\n\t\tconst error = {\n\t\t\tcode,\n\t\t\tmessage\n\t\t};\n\t\tif (options?.data !== void 0) error.data = options.data;\n\t\treturn Response.json({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\terror,\n\t\t\tid: null\n\t\t}, {\n\t\t\tstatus,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t...options?.headers\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Validates request headers for DNS rebinding protection.\n\t* @returns Error response if validation fails, `undefined` if validation passes.\n\t*/\n\tvalidateRequestHeaders(req) {\n\t\tif (!this._enableDnsRebindingProtection) return;\n\t\tif (this._allowedHosts && this._allowedHosts.length > 0) {\n\t\t\tconst hostHeader = req.headers.get(\"host\");\n\t\t\tif (!hostHeader || !this._allowedHosts.includes(hostHeader)) {\n\t\t\t\tconst error = `Invalid Host header: ${hostHeader}`;\n\t\t\t\tthis.onerror?.(new Error(error));\n\t\t\t\treturn this.createJsonErrorResponse(403, -32e3, error);\n\t\t\t}\n\t\t}\n\t\tif (this._allowedOrigins && this._allowedOrigins.length > 0) {\n\t\t\tconst originHeader = req.headers.get(\"origin\");\n\t\t\tif (originHeader && !this._allowedOrigins.includes(originHeader)) {\n\t\t\t\tconst error = `Invalid Origin header: ${originHeader}`;\n\t\t\t\tthis.onerror?.(new Error(error));\n\t\t\t\treturn this.createJsonErrorResponse(403, -32e3, error);\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Handles an incoming HTTP request, whether `GET`, `POST`, or `DELETE`\n\t* Returns a `Response` object (Web Standard)\n\t*/\n\tasync handleRequest(req, options) {\n\t\tif (this._closed) return this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\tconst validationError = this.validateRequestHeaders(req);\n\t\tif (validationError) return validationError;\n\t\tswitch (req.method) {\n\t\t\tcase \"POST\": return this.handlePostRequest(req, options);\n\t\t\tcase \"GET\": return this.handleGetRequest(req);\n\t\t\tcase \"DELETE\": return this.handleDeleteRequest(req);\n\t\t\tdefault: return this.handleUnsupportedRequest();\n\t\t}\n\t}\n\t/**\n\t* Returns true if the client's protocol version supports empty SSE data in\n\t* priming events (the fix shipped with protocol version `2025-11-25`).\n\t*\n\t* The version is checked for membership in this transport instance's\n\t* supported protocol versions rather than with an open-ended\n\t* `>= '2025-11-25'` comparison: the value may come from an `initialize`\n\t* request body, which (unlike the `MCP-Protocol-Version` header) is not\n\t* validated against `supportedProtocolVersions` before reaching this\n\t* check. An unknown future version string must not silently enable\n\t* behavior reserved for versions this transport actually supports.\n\t*/\n\tsupportsEmptySSEData(protocolVersion) {\n\t\treturn this._supportedProtocolVersions.includes(protocolVersion) && protocolVersion >= \"2025-11-25\";\n\t}\n\t/**\n\t* Writes a priming event to establish resumption capability.\n\t* Only sends if `eventStore` is configured (opt-in for resumability) and\n\t* the client's protocol version supports empty SSE data (a supported\n\t* version that is >= `2025-11-25`).\n\t*/\n\tasync writePrimingEvent(controller, encoder, streamId, protocolVersion) {\n\t\tif (!this._eventStore) return;\n\t\tif (!this.supportsEmptySSEData(protocolVersion)) return;\n\t\tconst primingEventId = await this._eventStore.storeEvent(streamId, {});\n\t\tlet primingEvent = `id: ${primingEventId}\\ndata: \\n\\n`;\n\t\tif (this._retryInterval !== void 0) primingEvent = `id: ${primingEventId}\\nretry: ${this._retryInterval}\\ndata: \\n\\n`;\n\t\tcontroller.enqueue(encoder.encode(primingEvent));\n\t}\n\t/**\n\t* Handles `GET` requests for SSE stream\n\t*/\n\tasync handleGetRequest(req) {\n\t\tif (!req.headers.get(\"accept\")?.includes(\"text/event-stream\")) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Not Acceptable: Client must accept text/event-stream\"));\n\t\t\treturn this.createJsonErrorResponse(406, -32e3, \"Not Acceptable: Client must accept text/event-stream\");\n\t\t}\n\t\tconst sessionError = this.validateSession(req);\n\t\tif (sessionError) return sessionError;\n\t\tconst protocolError = this.validateProtocolVersion(req);\n\t\tif (protocolError) return protocolError;\n\t\tif (this._eventStore) {\n\t\t\tconst lastEventId = req.headers.get(\"last-event-id\");\n\t\t\tif (lastEventId) return this.replayEvents(lastEventId);\n\t\t}\n\t\tif (this._streamMapping.get(this._standaloneSseStreamId) !== void 0) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Conflict: Only one SSE stream is allowed per session\"));\n\t\t\treturn this.createJsonErrorResponse(409, -32e3, \"Conflict: Only one SSE stream is allowed per session\");\n\t\t}\n\t\tconst encoder = new TextEncoder();\n\t\tlet streamController;\n\t\tlet keepAliveTimer;\n\t\tconst readable = new ReadableStream({\n\t\t\tstart: (controller) => {\n\t\t\t\tstreamController = controller;\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\tif (this._streamMapping.get(this._standaloneSseStreamId)?.controller === streamController) this._streamMapping.delete(this._standaloneSseStreamId);\n\t\t\t}\n\t\t});\n\t\tconst headers = {\n\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\tConnection: \"keep-alive\",\n\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t};\n\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\tthis._streamMapping.set(this._standaloneSseStreamId, {\n\t\t\tcontroller: streamController,\n\t\t\tencoder,\n\t\t\tcleanup: () => {\n\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\tthis._streamMapping.delete(this._standaloneSseStreamId);\n\t\t\t\ttry {\n\t\t\t\t\tstreamController.close();\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t});\n\t\tkeepAliveTimer = this.startKeepAlive(streamController, encoder);\n\t\treturn new Response(readable, { headers });\n\t}\n\t/**\n\t* Replays events that would have been sent after the specified event ID\n\t* Only used when resumability is enabled\n\t*/\n\tasync replayEvents(lastEventId) {\n\t\tif (!this._eventStore) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Event store not configured\"));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Event store not configured\");\n\t\t}\n\t\ttry {\n\t\t\tlet streamId;\n\t\t\tif (this._eventStore.getStreamIdForEventId) {\n\t\t\t\tstreamId = await this._eventStore.getStreamIdForEventId(lastEventId);\n\t\t\t\tif (!streamId) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Invalid event ID format\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Invalid event ID format\");\n\t\t\t\t}\n\t\t\t\tif (this._streamMapping.get(streamId) !== void 0) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Conflict: Stream already has an active connection\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(409, -32e3, \"Conflict: Stream already has an active connection\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst headers = {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t};\n\t\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\t\tconst encoder = new TextEncoder();\n\t\t\tlet streamController;\n\t\t\tlet keepAliveTimer;\n\t\t\tlet cancelled = false;\n\t\t\tlet replayedStreamId;\n\t\t\tconst readable = new ReadableStream({\n\t\t\t\tstart: (controller) => {\n\t\t\t\t\tstreamController = controller;\n\t\t\t\t},\n\t\t\t\tcancel: () => {\n\t\t\t\t\tcancelled = true;\n\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\tif (replayedStreamId !== void 0 && this._streamMapping.get(replayedStreamId)?.controller === streamController) this._streamMapping.delete(replayedStreamId);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst replayedEventIds = /* @__PURE__ */ new Set();\n\t\t\treplayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, { send: async (eventId, message) => {\n\t\t\t\treplayedEventIds.add(eventId);\n\t\t\t\tif (!this.writeSSEEvent(streamController, encoder, message, eventId)) try {\n\t\t\t\t\tstreamController.close();\n\t\t\t\t} catch {}\n\t\t\t} });\n\t\t\tif (this._closed || cancelled) {\n\t\t\t\ttry {\n\t\t\t\t\tstreamController.close();\n\t\t\t\t} catch {}\n\t\t\t\treturn this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t\t}\n\t\t\tthis._streamMapping.get(replayedStreamId)?.cleanup();\n\t\t\tthis._streamMapping.set(replayedStreamId, {\n\t\t\t\tcontroller: streamController,\n\t\t\t\tencoder,\n\t\t\t\treplayedEventIds,\n\t\t\t\tcleanup: () => {\n\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\tthis._streamMapping.delete(replayedStreamId);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t} catch {}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (replayedStreamId !== this._standaloneSseStreamId) {\n\t\t\t\tif (![...this._requestToStreamMapping.values()].includes(replayedStreamId)) {\n\t\t\t\t\tthis._streamMapping.delete(replayedStreamId);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t} catch {}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._streamMapping.get(replayedStreamId)?.controller === streamController) keepAliveTimer = this.startKeepAlive(streamController, encoder);\n\t\t\treturn new Response(readable, { headers });\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t\treturn this.createJsonErrorResponse(500, -32e3, \"Error replaying events\");\n\t\t}\n\t}\n\t/**\n\t* Writes an event to an SSE stream via controller with proper formatting\n\t*/\n\twriteSSEEvent(controller, encoder, message, eventId) {\n\t\ttry {\n\t\t\tlet eventData = `event: message\\n`;\n\t\t\tif (eventId) eventData += `id: ${eventId}\\n`;\n\t\t\teventData += `data: ${JSON.stringify(message)}\\n\\n`;\n\t\t\tcontroller.enqueue(encoder.encode(eventData));\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t\treturn false;\n\t\t}\n\t}\n\t/**\n\t* Handles unsupported requests (`PUT`, `PATCH`, etc.)\n\t*/\n\thandleUnsupportedRequest() {\n\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Method not allowed.\"));\n\t\treturn Response.json({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\terror: {\n\t\t\t\tcode: -32e3,\n\t\t\t\tmessage: \"Method not allowed.\"\n\t\t\t},\n\t\t\tid: null\n\t\t}, {\n\t\t\tstatus: 405,\n\t\t\theaders: {\n\t\t\t\tAllow: \"GET, POST, DELETE\",\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Handles `POST` requests containing JSON-RPC messages\n\t*/\n\tasync handlePostRequest(req, options) {\n\t\ttry {\n\t\t\tconst acceptHeader = req.headers.get(\"accept\");\n\t\t\tif (!acceptHeader?.includes(\"application/json\") || !acceptHeader.includes(\"text/event-stream\")) {\n\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Not Acceptable: Client must accept both application/json and text/event-stream\"));\n\t\t\t\treturn this.createJsonErrorResponse(406, -32e3, \"Not Acceptable: Client must accept both application/json and text/event-stream\");\n\t\t\t}\n\t\t\tif (!isJsonContentType(req.headers.get(\"content-type\"))) {\n\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Unsupported Media Type: Content-Type must be application/json\"));\n\t\t\t\treturn this.createJsonErrorResponse(415, -32e3, \"Unsupported Media Type: Content-Type must be application/json\");\n\t\t\t}\n\t\t\tconst request = req;\n\t\t\tlet rawMessage;\n\t\t\tif (options?.parsedBody === void 0) try {\n\t\t\t\trawMessage = await req.json();\n\t\t\t} catch (error) {\n\t\t\t\tthis.onerror?.(error);\n\t\t\t\treturn this.createJsonErrorResponse(400, -32700, \"Parse error: Invalid JSON\");\n\t\t\t}\n\t\t\telse rawMessage = options.parsedBody;\n\t\t\tlet messages;\n\t\t\ttry {\n\t\t\t\tmessages = Array.isArray(rawMessage) ? rawMessage.map((msg) => JSONRPCMessageSchema.parse(msg)) : [JSONRPCMessageSchema.parse(rawMessage)];\n\t\t\t} catch (error) {\n\t\t\t\tthis.onerror?.(error);\n\t\t\t\treturn this.createJsonErrorResponse(400, -32700, \"Parse error: Invalid JSON-RPC message\");\n\t\t\t}\n\t\t\tif (this._closed) return this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t\tconst isInitializationRequest = messages.some((element) => isInitializeRequest(element));\n\t\t\tif (isInitializationRequest) {\n\t\t\t\tif (this._initialized && this.sessionId !== void 0) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Invalid Request: Server already initialized\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(400, -32600, \"Invalid Request: Server already initialized\");\n\t\t\t\t}\n\t\t\t\tif (messages.length > 1) {\n\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Invalid Request: Only one initialization request is allowed\"));\n\t\t\t\t\treturn this.createJsonErrorResponse(400, -32600, \"Invalid Request: Only one initialization request is allowed\");\n\t\t\t\t}\n\t\t\t\tthis.sessionId = this.sessionIdGenerator?.();\n\t\t\t\tthis._initialized = true;\n\t\t\t\tif (this.sessionId && this._onsessioninitialized) await Promise.resolve(this._onsessioninitialized(this.sessionId));\n\t\t\t}\n\t\t\tif (!isInitializationRequest) {\n\t\t\t\tconst sessionError = this.validateSession(req);\n\t\t\t\tif (sessionError) return sessionError;\n\t\t\t\tconst protocolError = this.validateProtocolVersion(req);\n\t\t\t\tif (protocolError) return protocolError;\n\t\t\t}\n\t\t\tif (this._closed) return this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t\tif (!messages.some((element) => isJSONRPCRequest(element))) {\n\t\t\t\tfor (const message of messages) this.onmessage?.(message, {\n\t\t\t\t\tauthInfo: options?.authInfo,\n\t\t\t\t\trequest\n\t\t\t\t});\n\t\t\t\treturn new Response(null, { status: 202 });\n\t\t\t}\n\t\t\tconst streamId = crypto.randomUUID();\n\t\t\tconst initRequest = messages.find((m) => isInitializeRequest(m));\n\t\t\tconst clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get(\"mcp-protocol-version\") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;\n\t\t\tif (this._enableJsonResponse) return new Promise((resolve) => {\n\t\t\t\tthis._streamMapping.set(streamId, {\n\t\t\t\t\tresolveJson: resolve,\n\t\t\t\t\tcleanup: () => {\n\t\t\t\t\t\tthis._streamMapping.delete(streamId);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfor (const message of messages) if (isJSONRPCRequest(message)) this._requestToStreamMapping.set(message.id, streamId);\n\t\t\t\tfor (const message of messages) this.onmessage?.(message, {\n\t\t\t\t\tauthInfo: options?.authInfo,\n\t\t\t\t\trequest\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst encoder = new TextEncoder();\n\t\t\tlet streamController;\n\t\t\tlet keepAliveTimer;\n\t\t\tconst readable = new ReadableStream({\n\t\t\t\tstart: (controller) => {\n\t\t\t\t\tstreamController = controller;\n\t\t\t\t},\n\t\t\t\tcancel: () => {\n\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\tif (this._streamMapping.get(streamId)?.controller === streamController) this._streamMapping.delete(streamId);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst headers = {\n\t\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\tConnection: \"keep-alive\",\n\t\t\t\t\"X-Accel-Buffering\": \"no\"\n\t\t\t};\n\t\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\t\tfor (const message of messages) if (isJSONRPCRequest(message)) {\n\t\t\t\tthis._streamMapping.set(streamId, {\n\t\t\t\t\tcontroller: streamController,\n\t\t\t\t\tencoder,\n\t\t\t\t\tcleanup: () => {\n\t\t\t\t\t\tif (keepAliveTimer !== void 0) clearInterval(keepAliveTimer);\n\t\t\t\t\t\tthis._streamMapping.delete(streamId);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tstreamController.close();\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis._requestToStreamMapping.set(message.id, streamId);\n\t\t\t}\n\t\t\tawait this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion);\n\t\t\tfor (const message of messages) {\n\t\t\t\tlet closeSSEStream;\n\t\t\t\tlet closeStandaloneSSEStream;\n\t\t\t\tif (isJSONRPCRequest(message) && this._eventStore && this.supportsEmptySSEData(clientProtocolVersion)) {\n\t\t\t\t\tcloseSSEStream = () => {\n\t\t\t\t\t\tthis.closeSSEStream(message.id);\n\t\t\t\t\t};\n\t\t\t\t\tcloseStandaloneSSEStream = () => {\n\t\t\t\t\t\tthis.closeStandaloneSSEStream();\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tthis.onmessage?.(message, {\n\t\t\t\t\tauthInfo: options?.authInfo,\n\t\t\t\t\trequest,\n\t\t\t\t\tcloseSSEStream,\n\t\t\t\t\tcloseStandaloneSSEStream\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (this._streamMapping.get(streamId)?.controller === streamController) keepAliveTimer = this.startKeepAlive(streamController, encoder);\n\t\t\treturn new Response(readable, {\n\t\t\t\tstatus: 200,\n\t\t\t\theaders\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t\treturn this.createJsonErrorResponse(400, -32700, \"Parse error\", { data: String(error) });\n\t\t}\n\t}\n\t/**\n\t* Handles `DELETE` requests to terminate sessions\n\t*/\n\tasync handleDeleteRequest(req) {\n\t\tconst sessionError = this.validateSession(req);\n\t\tif (sessionError) return sessionError;\n\t\tconst protocolError = this.validateProtocolVersion(req);\n\t\tif (protocolError) return protocolError;\n\t\ttry {\n\t\t\tawait Promise.resolve(this._onsessionclosed?.(this.sessionId));\n\t\t\treturn new Response(null, { status: 200 });\n\t\t} finally {\n\t\t\tawait this.close();\n\t\t}\n\t}\n\t/**\n\t* Validates session ID for non-initialization requests.\n\t* Returns `Response` error if invalid, `undefined` otherwise\n\t*/\n\tvalidateSession(req) {\n\t\tif (this.sessionIdGenerator === void 0) return;\n\t\tif (!this._initialized) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Bad Request: Server not initialized\"));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Bad Request: Server not initialized\");\n\t\t}\n\t\tconst sessionId = req.headers.get(\"mcp-session-id\");\n\t\tif (!sessionId) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Bad Request: Mcp-Session-Id header is required\"));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, \"Bad Request: Mcp-Session-Id header is required\");\n\t\t}\n\t\tif (sessionId !== this.sessionId) {\n\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(\"Session not found\"));\n\t\t\treturn this.createJsonErrorResponse(404, -32001, \"Session not found\");\n\t\t}\n\t}\n\t/**\n\t* Validates the `MCP-Protocol-Version` header on incoming requests.\n\t*\n\t* For initialization: Version negotiation handles unknown versions gracefully\n\t* (server responds with its supported version).\n\t*\n\t* For subsequent requests with `MCP-Protocol-Version` header:\n\t* - Accept if in supported list\n\t* - 400 if unsupported\n\t*\n\t* For HTTP requests without the `MCP-Protocol-Version` header:\n\t* - Accept and default to the version negotiated at initialization\n\t*/\n\tvalidateProtocolVersion(req) {\n\t\tconst protocolVersion = req.headers.get(\"mcp-protocol-version\");\n\t\tif (protocolVersion !== null && !this._supportedProtocolVersions.includes(protocolVersion)) {\n\t\t\tconst error = `Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${this._supportedProtocolVersions.join(\", \")})`;\n\t\t\tthis.onerror?.(new Error(error));\n\t\t\treturn this.createJsonErrorResponse(400, -32e3, error);\n\t\t}\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tfor (const { cleanup } of this._streamMapping.values()) cleanup();\n\t\tthis._streamMapping.clear();\n\t\tthis._requestResponseMap.clear();\n\t\tthis.onclose?.();\n\t}\n\t/**\n\t* Close an SSE stream for a specific request, triggering client reconnection.\n\t* Use this to implement polling behavior during long-running operations -\n\t* client will reconnect after the retry interval specified in the priming event.\n\t*/\n\tcloseSSEStream(requestId) {\n\t\tconst streamId = this._requestToStreamMapping.get(requestId);\n\t\tif (!streamId) return;\n\t\tconst stream = this._streamMapping.get(streamId);\n\t\tif (stream) stream.cleanup();\n\t}\n\t/**\n\t* Close the standalone `GET` SSE stream, triggering client reconnection.\n\t* Use this to implement polling behavior for server-initiated notifications.\n\t*/\n\tcloseStandaloneSSEStream() {\n\t\tconst stream = this._streamMapping.get(this._standaloneSseStreamId);\n\t\tif (stream) stream.cleanup();\n\t}\n\tasync send(message, options) {\n\t\tlet requestId = options?.relatedRequestId;\n\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) requestId = message.id;\n\t\tif (requestId === void 0) {\n\t\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) throw new Error(\"Cannot send a response on a standalone SSE stream unless resuming a previous client request\");\n\t\t\tlet eventId;\n\t\t\tif (this._eventStore) eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message);\n\t\t\tconst standaloneSse = this._streamMapping.get(this._standaloneSseStreamId);\n\t\t\tif (standaloneSse === void 0) return;\n\t\t\tif (standaloneSse.controller && standaloneSse.encoder && (eventId === void 0 || !standaloneSse.replayedEventIds?.has(eventId))) this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId);\n\t\t\treturn;\n\t\t}\n\t\tconst streamId = this._requestToStreamMapping.get(requestId);\n\t\tif (!streamId) throw new Error(`No connection established for request ID: ${String(requestId)}`);\n\t\tlet stream = this._streamMapping.get(streamId);\n\t\tif (!this._enableJsonResponse) {\n\t\t\tlet eventId;\n\t\t\tif (this._eventStore) {\n\t\t\t\teventId = await this._eventStore.storeEvent(streamId, message);\n\t\t\t\tstream = this._streamMapping.get(streamId);\n\t\t\t}\n\t\t\tif (stream?.controller && stream?.encoder && (eventId === void 0 || !stream.replayedEventIds?.has(eventId))) this.writeSSEEvent(stream.controller, stream.encoder, message, eventId);\n\t\t}\n\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {\n\t\t\tthis._requestResponseMap.set(requestId, message);\n\t\t\tconst relatedIds = [...this._requestToStreamMapping.entries()].filter(([_, sid]) => sid === streamId).map(([id]) => id);\n\t\t\tif (relatedIds.every((id) => this._requestResponseMap.has(id))) {\n\t\t\t\tif (!stream) {\n\t\t\t\t\tif (this._enableJsonResponse) throw new Error(`No connection established for request ID: ${String(requestId)}`);\n\t\t\t\t\tif (!this._eventStore) {\n\t\t\t\t\t\tthis.onerror?.(/* @__PURE__ */ new Error(`Response for request ID ${String(requestId)} is undeliverable: per-request stream is disconnected and no eventStore is configured`));\n\t\t\t\t\t\tfor (const id of relatedIds) {\n\t\t\t\t\t\t\tthis._requestResponseMap.delete(id);\n\t\t\t\t\t\t\tthis._requestToStreamMapping.delete(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const id of relatedIds) {\n\t\t\t\t\t\tthis._requestResponseMap.delete(id);\n\t\t\t\t\t\tthis._requestToStreamMapping.delete(id);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this._enableJsonResponse && stream.resolveJson) {\n\t\t\t\t\tconst headers = { \"Content-Type\": \"application/json\" };\n\t\t\t\t\tif (this.sessionId !== void 0) headers[\"mcp-session-id\"] = this.sessionId;\n\t\t\t\t\tconst responses = relatedIds.map((id) => this._requestResponseMap.get(id));\n\t\t\t\t\tif (responses.length === 1) stream.resolveJson(Response.json(responses[0], {\n\t\t\t\t\t\tstatus: 200,\n\t\t\t\t\t\theaders\n\t\t\t\t\t}));\n\t\t\t\t\telse stream.resolveJson(Response.json(responses, {\n\t\t\t\t\t\tstatus: 200,\n\t\t\t\t\t\theaders\n\t\t\t\t\t}));\n\t\t\t\t\tstream.cleanup();\n\t\t\t\t} else stream.cleanup();\n\t\t\t\tfor (const id of relatedIds) {\n\t\t\t\t\tthis._requestResponseMap.delete(id);\n\t\t\t\t\tthis._requestToStreamMapping.delete(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/server/createMcpHandler.ts\n/**\n* The JSON-RPC id to echo on an entry-built error response: the body's `id`\n* when the body is a single JSON-RPC request whose id is a string or number,\n* `null` otherwise. Error responses must carry the id of the request they\n* correspond to whenever it could be read; `null` is reserved for the cases\n* where no single request id is determinable — unparseable bodies, body-less\n* methods, notifications, posted responses and batch arrays.\n*/\nfunction echoableRequestId(body) {\n\tif (body === null || typeof body !== \"object\" || Array.isArray(body)) return null;\n\tconst { method, id } = body;\n\tif (typeof method !== \"string\") return null;\n\treturn typeof id === \"string\" || typeof id === \"number\" ? id : null;\n}\nfunction jsonRpcErrorResponse(httpStatus, code, message, data, id = null) {\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode,\n\t\t\tmessage,\n\t\t\t...data !== void 0 && { data }\n\t\t},\n\t\tid\n\t}, { status: httpStatus });\n}\nfunction rejectionResponse(rejection, id = null) {\n\treturn jsonRpcErrorResponse(rejection.httpStatus, rejection.code, rejection.message, rejection.data, id);\n}\nfunction toError(value) {\n\treturn value instanceof Error ? value : new Error(String(value));\n}\nfunction internalServerErrorResponse(id = null) {\n\treturn jsonRpcErrorResponse(500, -32603, \"Internal server error\", void 0, id);\n}\n/**\n* The entry's default legacy serving (`legacy: 'stateless'`): per-request\n* stateless serving of 2025-era traffic using the same factory as the modern\n* path. Exported as a standalone building block for hand-wired compositions\n* (for example mounting legacy stateless serving on its own route next to a\n* strict modern endpoint).\n*\n* Each POST is served by a fresh instance from the factory connected to a\n* fresh streamable HTTP transport constructed with only\n* `sessionIdGenerator: undefined` — the established stateless idiom, unchanged.\n* Because serving is per-request and stateless, GET and DELETE (2025 session\n* operations) are answered with `405` / `Method not allowed.`, exactly like the\n* canonical stateless example.\n*\n* The optional `onerror` callback receives factory and serving failures on\n* this leg (reporting only — the response stays the 500 internal-error body).\n* The entry passes its own `onerror` here when expanding the default, so\n* legacy-leg failures are never silently swallowed.\n*/\nfunction createLegacyStatelessFallback(factory, onerror, keepAliveMs) {\n\treturn async (request, options) => {\n\t\tif (request.method.toUpperCase() !== \"POST\") return jsonRpcErrorResponse(405, -32e3, \"Method not allowed.\");\n\t\ttry {\n\t\t\tconst product = await factory({\n\t\t\t\tera: \"legacy\",\n\t\t\t\t...options?.authInfo !== void 0 && { authInfo: options.authInfo },\n\t\t\t\trequestInfo: request\n\t\t\t});\n\t\t\tconst transport = new WebStandardStreamableHTTPServerTransport({\n\t\t\t\tsessionIdGenerator: void 0,\n\t\t\t\t...keepAliveMs !== void 0 && { keepAliveMs }\n\t\t\t});\n\t\t\tawait product.connect(transport);\n\t\t\tconst teardown = () => {\n\t\t\t\ttransport.close().catch(() => {});\n\t\t\t\tproduct.close().catch(() => {});\n\t\t\t};\n\t\t\trequest.signal?.addEventListener(\"abort\", teardown, { once: true });\n\t\t\tconst response = await transport.handleRequest(request, {\n\t\t\t\t...options?.authInfo !== void 0 && { authInfo: options.authInfo },\n\t\t\t\t...options?.parsedBody !== void 0 && { parsedBody: options.parsedBody }\n\t\t\t});\n\t\t\tif (response.body === null || mediaTypeEssence(response.headers.get(\"content-type\")) !== \"text/event-stream\") {\n\t\t\t\tteardown();\n\t\t\t\treturn response;\n\t\t\t}\n\t\t\tconst reader = response.body.getReader();\n\t\t\tlet toreDown = false;\n\t\t\tconst completeExchange = () => {\n\t\t\t\tif (!toreDown) {\n\t\t\t\t\ttoreDown = true;\n\t\t\t\t\tteardown();\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst monitoredBody = new ReadableStream({\n\t\t\t\tpull: async (controller) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\tcompleteExchange();\n\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (value !== void 0) controller.enqueue(value);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tcompleteExchange();\n\t\t\t\t\t\tcontroller.error(error);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcancel: (reason) => {\n\t\t\t\t\tcompleteExchange();\n\t\t\t\t\treturn reader.cancel(reason).catch(() => {});\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn new Response(monitoredBody, {\n\t\t\t\tstatus: response.status,\n\t\t\t\tstatusText: response.statusText,\n\t\t\t\theaders: response.headers\n\t\t\t});\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tonerror?.(toError(error));\n\t\t\t} catch {}\n\t\t\treturn internalServerErrorResponse(echoableRequestId(options?.parsedBody));\n\t\t}\n\t};\n}\nfunction legacyStatelessFallback(factory, onerror) {\n\treturn createLegacyStatelessFallback(factory, onerror);\n}\n/**\n* The entry's classification step: read the request body exactly once (unless\n* a pre-parsed body is supplied) and classify the request with\n* {@linkcode classifyInboundRequest}. This is the single code path behind both\n* {@linkcode createMcpHandler}'s routing and the exported\n* {@linkcode isLegacyRequest} predicate, so the two can never disagree.\n*\n* Pass `needsForward: false` when the caller never reads `forwardRequest` —\n* the body-preserving clone is then skipped and `forwardRequest` is the\n* (consumed) input request.\n*/\nasync function classifyEntryRequest(request, providedParsedBody, needsForward = true) {\n\tconst httpMethod = request.method.toUpperCase();\n\tlet body;\n\tlet parsedBody = providedParsedBody;\n\tlet forwardRequest = request;\n\tlet unparseable = false;\n\tif (httpMethod === \"POST\") {\n\t\tif (parsedBody === void 0) {\n\t\t\tif (needsForward) forwardRequest = request.clone();\n\t\t\tlet bodyText;\n\t\t\ttry {\n\t\t\t\tbodyText = await request.text();\n\t\t\t} catch {\n\t\t\t\treturn { step: \"unreadable-body\" };\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tbody = bodyText.length === 0 ? void 0 : JSON.parse(bodyText);\n\t\t\t} catch {\n\t\t\t\tunparseable = true;\n\t\t\t}\n\t\t\tif (!unparseable && body !== void 0) parsedBody = body;\n\t\t} else body = parsedBody;\n\t\tif (unparseable || body === void 0) return {\n\t\t\tstep: \"no-json-body\",\n\t\t\tforwardRequest\n\t\t};\n\t}\n\treturn {\n\t\tstep: \"classified\",\n\t\toutcome: classifyInboundRequest({\n\t\t\thttpMethod,\n\t\t\tprotocolVersionHeader: request.headers.get(\"mcp-protocol-version\") ?? void 0,\n\t\t\tmcpMethodHeader: request.headers.get(\"mcp-method\") ?? void 0,\n\t\t\tmcpNameHeader: request.headers.get(\"mcp-name\") ?? void 0,\n\t\t\t...body !== void 0 && { body }\n\t\t}),\n\t\tbody,\n\t\tparsedBody,\n\t\tforwardRequest\n\t};\n}\n/**\n* Whether {@linkcode createMcpHandler} would route this request to its legacy\n* (2025-era) serving rather than the modern (2026-07-28) path.\n*\n* Call it with just the request: `await isLegacyRequest(request)`. For a\n* `POST` the body is read from an internal clone, so the request you pass\n* stays fully readable for whichever handler you route it to — no second\n* argument is needed. (In a Node `(req, res)` handler, build that `Request`\n* with `toWebRequest(req)` from `@modelcontextprotocol/node`; behind a body\n* parser, which has already drained the Node stream, build it as\n* `toWebRequest(req, req.body)` so the bytes come from the parsed body —\n* either way the predicate still takes just the request.) The optional\n* `parsedBody` is a perf escape hatch for a body you already hold parsed:\n* pass it and the predicate classifies from the value directly, reading and\n* cloning nothing. It is needed, not just faster, when the request's own\n* body was already read — the internal clone is then impossible (cloning a\n* used body throws a `TypeError`), so such a single-argument call rejects\n* instead of guessing.\n*\n* This is the entry's own classification step exported as a predicate — it\n* runs exactly the code `createMcpHandler` runs to make the routing decision,\n* not a re-implementation — so a hand-wired composition that branches on it\n* can never disagree with the entry. It is classification only: hand-wired\n* compositions must validate Content-Type themselves (415 for POSTs whose\n* media type is not `application/json`, via {@linkcode isJsonContentType})\n* before dispatching either leg — routing the legacy leg into the SDK\n* transports gets their built-in check, but a custom modern leg has none. Use it to keep an existing legacy\n* deployment (for example a sessionful streamable HTTP wiring) serving 2025\n* traffic next to a strict modern endpoint, now that the entry has no\n* handler-valued `legacy` option:\n*\n* ```ts\n* import { createMcpHandler, isLegacyRequest } from '@modelcontextprotocol/server';\n*\n* const modern = createMcpHandler(factory, { legacy: 'reject' });\n*\n* export default {\n* async fetch(request: Request): Promise<Response> {\n* if (await isLegacyRequest(request)) {\n* // e.g. an existing sessionful WebStandardStreamableHTTPServerTransport wiring\n* return myExistingLegacyHandler(request);\n* }\n* return modern.fetch(request);\n* }\n* };\n* ```\n*\n* Semantics (identical to the entry's routing):\n*\n* - Returns `true` only for requests with no per-request `_meta` envelope\n* claim: claim-less POSTs (including the `initialize` handshake and 2025-era\n* notification POSTs without a modern protocol-version header), body-less\n* GET/DELETE session operations, all-legacy JSON-RPC batch arrays, posted\n* JSON-RPC responses, and POSTs whose body is empty or not valid JSON.\n* - Returns `false` for everything the modern path answers, including its\n* validation-ladder rejections: a request carrying the envelope claim (even\n* one naming a revision the endpoint does not serve — the modern path\n* answers it with the unsupported-protocol-version error), a malformed\n* envelope behind a present claim (answered `-32602`), a request whose\n* `MCP-Protocol-Version` header names a modern revision but that lacks the\n* envelope (`-32602`), and header/body mismatches (`-32020`). Consumers\n* routing on the predicate must send `false` traffic to the modern handler,\n* never to a legacy handler — the modern path owns those error answers.\n* - `server/discover` probes sent by negotiating clients always carry the\n* envelope claim, so they are never legacy; a hand-built claim-less POST to\n* a method named `server/discover` has no claim and classifies legacy,\n* exactly as the entry itself routes it.\n*/\nasync function isLegacyRequest(request, parsedBody) {\n\tconst classified = await classifyEntryRequest(parsedBody === void 0 && request.method.toUpperCase() === \"POST\" ? request.clone() : request, parsedBody, false);\n\treturn classified.step === \"no-json-body\" || classified.step === \"classified\" && classified.outcome.kind === \"legacy\";\n}\n/**\n* Creates an HTTP handler that serves the 2026-07-28 protocol revision from a\n* per-request server factory and, by default, falls back to old-school\n* stateless serving for 2025-era traffic. Pass `legacy: 'reject'` for a\n* modern-only strict endpoint.\n*\n* Mounting: `handler.fetch` is the web-standard face (Cloudflare Workers,\n* Deno, Bun, Hono's `c.req.raw`); for Express/Fastify/plain `node:http`, wrap\n* the handler once with `toNodeHandler(handler)` from\n* `@modelcontextprotocol/node`. When mounting bare on a fetch-native runtime,\n* put Origin/Host validation in front of the handler — the entry itself is\n* deliberately validation-free:\n*\n* ```ts\n* import { hostHeaderValidationResponse, originValidationResponse, localhostAllowedHostnames, localhostAllowedOrigins } from '@modelcontextprotocol/server';\n*\n* export default {\n* async fetch(request: Request): Promise<Response> {\n* const rejected =\n* hostHeaderValidationResponse(request, localhostAllowedHostnames()) ??\n* originValidationResponse(request, localhostAllowedOrigins());\n* return rejected ?? handler.fetch(request);\n* }\n* };\n* ```\n*\n* Use ONE factory for both legs: the same tools/resources/prompts definition\n* backs the modern path and the stateless legacy fallback, so the two eras can\n* never drift apart. To keep an existing legacy deployment (for example a\n* sessionful streamable HTTP wiring) serving 2025 traffic instead of the\n* stateless fallback, route in user land with {@linkcode isLegacyRequest} in\n* front of a strict handler — see that predicate's documentation for the\n* pattern. Power users composing transport-neutral routing can also use the\n* exported building blocks directly: {@linkcode classifyInboundRequest} for\n* the era decision and `PerRequestHTTPServerTransport` for single-exchange\n* serving — such compositions must reject POSTs whose Content-Type media type\n* is not `application/json` (415) before parsing the body, using\n* {@linkcode isJsonContentType}; neither building block performs this\n* validation itself.\n*\n* The entry performs no token verification: `authInfo` given to `fetch` is\n* passed through to handlers and the factory as-is and is never derived from\n* request headers.\n*/\nfunction createMcpHandler(factory, options = {}) {\n\tconst { legacy, onerror, responseMode } = options;\n\tif (typeof legacy === \"function\") throw new TypeError(\"The 'legacy' option only accepts 'stateless' or 'reject', not a handler function. To serve 2025-era traffic with your own handler, route in user land with the exported isLegacyRequest(request) predicate in front of a strict (legacy: 'reject') handler.\");\n\t/** Modern per-request instances with an exchange still in flight (close() tears these down). */\n\tconst inflight = /* @__PURE__ */ new Set();\n\tlet closed = false;\n\tconst reportError = (error) => {\n\t\ttry {\n\t\t\tonerror?.(error);\n\t\t} catch {}\n\t};\n\tconst bus = options.bus ?? new InMemoryServerEventBus(reportError);\n\tconst notify = createServerNotifier(bus);\n\tconst listenRouter = createListenRouter({\n\t\tbus,\n\t\tmaxSubscriptions: options.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS,\n\t\tkeepAliveMs: options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS,\n\t\tonerror: reportError\n\t});\n\tif (responseMode === \"json\") console.warn(\"responseMode: 'json' drops mid-call notifications. subscriptions/listen streams are always served over SSE regardless; other notifications emitted before a result are dropped.\");\n\tconst legacyHandler = legacy === \"reject\" ? void 0 : createLegacyStatelessFallback(factory, reportError, options.keepAliveMs);\n\tasync function serveModern(route, request, authInfo) {\n\t\tconst claimedRevision = route.classification.revision;\n\t\tif (claimedRevision === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedRevision)) {\n\t\t\tconst error = new UnsupportedProtocolVersionError({\n\t\t\t\tsupported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],\n\t\t\t\trequested: claimedRevision ?? \"unknown\"\n\t\t\t});\n\t\t\treportError(error);\n\t\t\treturn jsonRpcErrorResponse(400, error.code, error.message, error.data, echoableRequestId(route.message));\n\t\t}\n\t\tconst stdHeaderRejection = validateStandardRequestHeaders({\n\t\t\thttpMethod: request.method,\n\t\t\tmcpMethodHeader: request.headers.get(\"mcp-method\") ?? void 0,\n\t\t\tmcpNameHeader: request.headers.get(\"mcp-name\") ?? void 0\n\t\t}, route);\n\t\tif (stdHeaderRejection !== void 0) {\n\t\t\treportError(/* @__PURE__ */ new Error(`Rejected inbound request (${stdHeaderRejection.cell}): ${stdHeaderRejection.message}`));\n\t\t\treturn rejectionResponse(stdHeaderRejection, echoableRequestId(route.message));\n\t\t}\n\t\tconst meta = route.messageKind === \"request\" ? requestMetaOf(route.message.params) : void 0;\n\t\tconst declaredClientCapabilities = meta?.[CLIENT_CAPABILITIES_META_KEY];\n\t\tif (route.messageKind === \"request\") {\n\t\t\tconst required = requiredClientCapabilitiesForRequest(route.message.method);\n\t\t\tif (required !== void 0) {\n\t\t\t\tconst missing = missingClientCapabilities(required, declaredClientCapabilities);\n\t\t\t\tif (missing !== void 0) {\n\t\t\t\t\tconst error = new MissingRequiredClientCapabilityError({ requiredCapabilities: missing });\n\t\t\t\t\treportError(error);\n\t\t\t\t\treturn jsonRpcErrorResponse(httpStatusForErrorCode(error.code, \"ladder\"), error.code, error.message, error.data, route.message.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst product = await factory({\n\t\t\tera: \"modern\",\n\t\t\t...authInfo !== void 0 && { authInfo },\n\t\t\trequestInfo: request\n\t\t});\n\t\tconst server = product instanceof McpServer ? product.server : product;\n\t\tif (route.messageKind === \"request\" && route.message.method === \"subscriptions/listen\") {\n\t\t\tconst capabilities = server.getCapabilities();\n\t\t\tconst serverInfo = serverIdentityOf(server);\n\t\t\tproduct.close().catch(reportError);\n\t\t\treturn listenRouter.serve(route.message, request.signal, capabilities, serverInfo);\n\t\t}\n\t\tif (route.messageKind === \"request\" && route.message.method === \"tools/call\" && product instanceof McpServer) {\n\t\t\tconst callParams = route.message.params;\n\t\t\tconst toolName = typeof callParams?.name === \"string\" ? callParams.name : void 0;\n\t\t\tconst inputSchema = toolName === void 0 ? void 0 : product.toolInputSchemaJson(toolName);\n\t\t\tif (inputSchema !== void 0) {\n\t\t\t\tconst scan = scanXMcpHeaderDeclarations(inputSchema);\n\t\t\t\tif (scan.valid && scan.declarations.length > 0) {\n\t\t\t\t\tconst rejection = validateMcpParamHeaders(scan.declarations, callParams?.arguments, request.headers);\n\t\t\t\t\tif (rejection !== void 0) {\n\t\t\t\t\t\tproduct.close().catch(reportError);\n\t\t\t\t\t\treportError(/* @__PURE__ */ new Error(`Rejected inbound request (${rejection.cell}): ${rejection.message}`));\n\t\t\t\t\t\treturn rejectionResponse(rejection, route.message.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsetNegotiatedProtocolVersion(server, claimedRevision);\n\t\tinstallModernOnlyHandlers(server, SUPPORTED_MODERN_PROTOCOL_VERSIONS);\n\t\tif (meta !== void 0) seedClientIdentityFromEnvelope(server, {\n\t\t\tclientInfo: meta[CLIENT_INFO_META_KEY],\n\t\t\tclientCapabilities: declaredClientCapabilities\n\t\t});\n\t\tconst previousOnClose = server.onclose;\n\t\tinflight.add(server);\n\t\tserver.onclose = () => {\n\t\t\tinflight.delete(server);\n\t\t\tpreviousOnClose?.();\n\t\t};\n\t\ttry {\n\t\t\tconst response = await invoke(product, route.message, {\n\t\t\t\tclassification: route.classification,\n\t\t\t\trequest,\n\t\t\t\t...authInfo !== void 0 && { authInfo },\n\t\t\t\t...responseMode !== void 0 && { responseMode },\n\t\t\t\t...options.keepAliveMs !== void 0 && { keepAliveMs: options.keepAliveMs }\n\t\t\t});\n\t\t\tif (route.messageKind === \"notification\") queueMicrotask(() => void server.close().catch(() => {}));\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tif (error instanceof SdkError && error.code === SdkErrorCode.ConnectionClosed) return new Response(null, { status: 499 });\n\t\t\tawait server.close().catch(() => {});\n\t\t\tinflight.delete(server);\n\t\t\treportError(toError(error));\n\t\t\treturn internalServerErrorResponse(echoableRequestId(route.message));\n\t\t}\n\t}\n\tasync function serveLegacyRoute(route, forwardRequest, authInfo, parsedBody) {\n\t\tif (legacyHandler !== void 0) return legacyHandler(forwardRequest, {\n\t\t\t...authInfo !== void 0 && { authInfo },\n\t\t\t...parsedBody !== void 0 && { parsedBody }\n\t\t});\n\t\tconst strict = modernOnlyStrictRejection(route, SUPPORTED_MODERN_PROTOCOL_VERSIONS);\n\t\tif (strict === void 0) return new Response(null, { status: 202 });\n\t\treportError(/* @__PURE__ */ new Error(`Rejected 2025-era request on a modern-only endpoint (${strict.cell}): ${strict.message}`));\n\t\treturn rejectionResponse(strict, echoableRequestId(parsedBody));\n\t}\n\tasync function handle(request, requestOptions) {\n\t\tconst authInfo = requestOptions?.authInfo;\n\t\tif (request.method.toUpperCase() === \"POST\" && !isJsonContentType(request.headers.get(\"content-type\"))) {\n\t\t\treportError(/* @__PURE__ */ new Error(\"Unsupported Media Type: Content-Type must be application/json\"));\n\t\t\treturn jsonRpcErrorResponse(415, -32e3, \"Unsupported Media Type: Content-Type must be application/json\");\n\t\t}\n\t\tconst classified = await classifyEntryRequest(request, requestOptions?.parsedBody);\n\t\tif (classified.step === \"unreadable-body\") return jsonRpcErrorResponse(400, -32700, \"Parse error: the request body could not be read\");\n\t\tif (classified.step === \"no-json-body\") {\n\t\t\tif (legacyHandler !== void 0) return legacyHandler(classified.forwardRequest, { ...authInfo !== void 0 && { authInfo } });\n\t\t\treturn jsonRpcErrorResponse(400, -32700, \"Parse error: the request body is not valid JSON\");\n\t\t}\n\t\tconst { outcome, body, parsedBody, forwardRequest } = classified;\n\t\ttry {\n\t\t\tswitch (outcome.kind) {\n\t\t\t\tcase \"reject\":\n\t\t\t\t\treportError(/* @__PURE__ */ new Error(`Rejected inbound request (${outcome.cell}): ${outcome.message}`));\n\t\t\t\t\treturn rejectionResponse(outcome, echoableRequestId(body));\n\t\t\t\tcase \"modern\": return await serveModern(outcome, request, authInfo);\n\t\t\t\tcase \"legacy\": return await serveLegacyRoute(outcome, forwardRequest, authInfo, parsedBody);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treportError(toError(error));\n\t\t\treturn internalServerErrorResponse(echoableRequestId(body));\n\t\t}\n\t}\n\tconst fetchFace = async (request, requestOptions) => {\n\t\tif (closed) throw new Error(\"This MCP handler has been closed\");\n\t\ttry {\n\t\t\treturn await handle(request, requestOptions);\n\t\t} catch (error) {\n\t\t\treportError(toError(error));\n\t\t\treturn internalServerErrorResponse(echoableRequestId(requestOptions?.parsedBody));\n\t\t}\n\t};\n\treturn {\n\t\tfetch: fetchFace,\n\t\tnotify,\n\t\tbus,\n\t\tclose: async () => {\n\t\t\tclosed = true;\n\t\t\tlistenRouter.closeAll();\n\t\t\tconst closing = [...inflight].map((server) => server.close().catch(() => {}));\n\t\t\tinflight.clear();\n\t\t\tawait Promise.all(closing);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/server/middleware/bearerAuth.ts\nfunction headerQuotedValue(value) {\n\treturn value.replaceAll(/[\\\\\"]/g, String.raw`\\$&`).replaceAll(/[^\\u0020-\\u007E]/g, \" \");\n}\nfunction buildWwwAuthenticateHeader(errorCode, description, requiredScopes, resourceMetadataUrl) {\n\tlet header = `Bearer error=\"${headerQuotedValue(errorCode)}\", error_description=\"${headerQuotedValue(description)}\"`;\n\tif (requiredScopes.length > 0) header += `, scope=\"${requiredScopes.join(\" \")}\"`;\n\tif (resourceMetadataUrl) header += `, resource_metadata=\"${resourceMetadataUrl}\"`;\n\treturn header;\n}\n/**\n* Validate a raw `Authorization` header value as a Bearer token and return\n* the verified {@link AuthInfo}.\n*\n* The runtime-neutral core of Bearer authentication: it parses the header,\n* runs the verifier, enforces `requiredScopes`, and rejects tokens without an\n* expiration or past it. On any failure it throws an {@link OAuthError} —\n* pass that to {@link bearerAuthChallengeResponse} for the matching HTTP\n* answer, or use {@link requireBearerAuth} to get both steps as one call.\n*\n* Framework adapters build on this: `requireBearerAuth` from\n* `@modelcontextprotocol/express` feeds it `req.headers.authorization`.\n*/\nasync function verifyBearerToken(authorizationHeader, options) {\n\tconst { verifier, requiredScopes = [] } = options;\n\tif (!authorizationHeader) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Missing Authorization header\");\n\tconst [type, token] = authorizationHeader.split(\" \");\n\tif (type?.toLowerCase() !== \"bearer\" || !token) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Invalid Authorization header format, expected 'Bearer TOKEN'\");\n\tconst authInfo = await verifier.verifyAccessToken(token);\n\tif (requiredScopes.length > 0) {\n\t\tif (!requiredScopes.every((scope) => authInfo.scopes.includes(scope))) throw new OAuthError(OAuthErrorCode.InsufficientScope, \"Insufficient scope\");\n\t}\n\tif (typeof authInfo.expiresAt !== \"number\" || Number.isNaN(authInfo.expiresAt)) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Token has no expiration time\");\n\telse if (authInfo.expiresAt < Date.now() / 1e3) throw new OAuthError(OAuthErrorCode.InvalidToken, \"Token has expired\");\n\treturn authInfo;\n}\n/**\n* Build the HTTP answer for a Bearer authentication failure.\n*\n* Maps an {@link OAuthError} to its status — `401` for `invalid_token` and\n* `403` for `insufficient_scope` (both carrying the `WWW-Authenticate: Bearer …`\n* challenge, with `resource_metadata` when configured so clients can discover\n* the Authorization Server), `500` for `server_error`, `400` for anything\n* else. A non-`OAuthError` value answers `500 server_error`. The body is the\n* OAuth error JSON.\n*/\nfunction bearerAuthChallengeResponse(error, options) {\n\tconst { requiredScopes = [], resourceMetadataUrl } = options ?? {};\n\tif (!(error instanceof OAuthError)) {\n\t\tconst serverError = new OAuthError(OAuthErrorCode.ServerError, \"Internal Server Error\");\n\t\treturn Response.json(serverError.toResponseObject(), { status: 500 });\n\t}\n\tswitch (error.code) {\n\t\tcase OAuthErrorCode.InvalidToken: {\n\t\t\tconst challenge = buildWwwAuthenticateHeader(error.code, error.message, requiredScopes, resourceMetadataUrl);\n\t\t\treturn Response.json(error.toResponseObject(), {\n\t\t\t\tstatus: 401,\n\t\t\t\theaders: { \"WWW-Authenticate\": challenge }\n\t\t\t});\n\t\t}\n\t\tcase OAuthErrorCode.InsufficientScope: {\n\t\t\tconst challenge = buildWwwAuthenticateHeader(error.code, error.message, requiredScopes, resourceMetadataUrl);\n\t\t\treturn Response.json(error.toResponseObject(), {\n\t\t\t\tstatus: 403,\n\t\t\t\theaders: { \"WWW-Authenticate\": challenge }\n\t\t\t});\n\t\t}\n\t\tcase OAuthErrorCode.ServerError: return Response.json(error.toResponseObject(), { status: 500 });\n\t\tdefault: return Response.json(error.toResponseObject(), { status: 400 });\n\t}\n}\n/**\n* Require a valid Bearer token on web-standard requests.\n*\n* The framework-free counterpart of `requireBearerAuth` from\n* `@modelcontextprotocol/express`, for hosts whose HTTP surface is a\n* `fetch(request)` handler — Cloudflare Workers, Deno, Bun, Hono. The\n* returned gate resolves to the verified {@link AuthInfo}, or to the\n* ready-to-return challenge `Response` when the request must be refused.\n*\n* @example\n* ```ts source=\"./bearerAuth.examples.ts#requireBearerAuth_fetchGate\"\n* const gate = requireBearerAuth({ verifier, requiredScopes: ['mcp'] });\n*\n* async function fetchHandler(request: Request): Promise<Response> {\n* const auth: AuthInfo | Response = await gate(request);\n* if (auth instanceof Response) return auth;\n* return handler.fetch(request, { authInfo: auth });\n* }\n* ```\n*/\nfunction requireBearerAuth(options) {\n\tconst { verifier, requiredScopes = [], resourceMetadataUrl } = options;\n\tconst resolved = {\n\t\tverifier,\n\t\trequiredScopes,\n\t\tresourceMetadataUrl\n\t};\n\treturn async (request) => {\n\t\tconst [authorizationHeader] = (request.headers.get(\"authorization\") ?? \"\").split(\",\");\n\t\ttry {\n\t\t\treturn await verifyBearerToken(authorizationHeader || void 0, resolved);\n\t\t} catch (error) {\n\t\t\treturn bearerAuthChallengeResponse(error, resolved);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/server/middleware/hostHeaderValidation.ts\n/**\n* Parse and validate a `Host` header against an allowlist of hostnames (port-agnostic).\n*\n* - Input host header may include a port (e.g. `localhost:3000`) or IPv6 brackets (e.g. `[::1]:3000`).\n* - Allowlist items should be hostnames only (no ports). For IPv6, include brackets (e.g. `[::1]`).\n*/\nfunction validateHostHeader(hostHeader, allowedHostnames) {\n\tif (!hostHeader) return {\n\t\tok: false,\n\t\terrorCode: \"missing_host\",\n\t\tmessage: \"Missing Host header\"\n\t};\n\tlet hostname;\n\ttry {\n\t\thostname = new URL(`http://${hostHeader}`).hostname;\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\terrorCode: \"invalid_host_header\",\n\t\t\tmessage: `Invalid Host header: ${hostHeader}`,\n\t\t\thostHeader\n\t\t};\n\t}\n\tif (!allowedHostnames.includes(hostname)) return {\n\t\tok: false,\n\t\terrorCode: \"invalid_host\",\n\t\tmessage: `Invalid Host: ${hostname}`,\n\t\thostHeader,\n\t\thostname\n\t};\n\treturn {\n\t\tok: true,\n\t\thostname\n\t};\n}\n/**\n* Convenience allowlist for `localhost` DNS rebinding protection.\n*/\nfunction localhostAllowedHostnames() {\n\treturn [\n\t\t\"localhost\",\n\t\t\"127.0.0.1\",\n\t\t\"[::1]\"\n\t];\n}\n/**\n* Web-standard `Request` helper for DNS rebinding protection.\n* @example\n* ```ts source=\"./hostHeaderValidation.examples.ts#hostHeaderValidationResponse_basicUsage\"\n* const result = validateHostHeader(req.headers.get('host'), ['localhost']);\n* ```\n*/\nfunction hostHeaderValidationResponse(req, allowedHostnames) {\n\tconst result = validateHostHeader(req.headers.get(\"host\"), allowedHostnames);\n\tif (result.ok) return void 0;\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode: -32e3,\n\t\t\tmessage: result.message\n\t\t},\n\t\tid: null\n\t}, {\n\t\tstatus: 403,\n\t\theaders: { \"Content-Type\": \"application/json\" }\n\t});\n}\n\n//#endregion\n//#region src/server/middleware/oauthMetadata.ts\nfunction checkIssuerUrl(issuer, allowInsecure) {\n\tif (issuer.protocol !== \"https:\" && issuer.hostname !== \"localhost\" && issuer.hostname !== \"127.0.0.1\" && !allowInsecure) throw new Error(\"Issuer URL must be HTTPS\");\n\tif (issuer.hash) throw new Error(`Issuer URL must not have a fragment: ${issuer}`);\n\tif (issuer.search) throw new Error(`Issuer URL must not have a query string: ${issuer}`);\n}\n/**\n* Derive the RFC 9728 Protected Resource Metadata document from\n* {@link AuthMetadataOptions}, validating the Authorization Server issuer URL\n* (HTTPS required outside localhost) in the process.\n*\n* `oauthMetadataResponse` and the Express `mcpAuthMetadataRouter` both build\n* on this; use it directly when serving the document through your own\n* routing — or call it once at startup to fail fast on a misconfigured\n* issuer before any request arrives.\n*/\nfunction buildOAuthProtectedResourceMetadata(options) {\n\tcheckIssuerUrl(new URL(options.oauthMetadata.issuer), options.dangerouslyAllowInsecureIssuerUrl);\n\treturn {\n\t\tresource: options.resourceServerUrl.href,\n\t\tauthorization_servers: [options.oauthMetadata.issuer],\n\t\tscopes_supported: options.scopesSupported,\n\t\tresource_name: options.resourceName,\n\t\tresource_documentation: options.serviceDocumentationUrl?.href\n\t};\n}\n/**\n* Builds the RFC 9728 Protected Resource Metadata URL for a given MCP server\n* URL by inserting `/.well-known/oauth-protected-resource` ahead of the path.\n*\n* @example\n* ```ts\n* getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp'))\n* // → 'https://api.example.com/.well-known/oauth-protected-resource/mcp'\n* ```\n*/\nfunction getOAuthProtectedResourceMetadataUrl(serverUrl) {\n\treturn new URL(protectedResourceMetadataPath(serverUrl), serverUrl).href;\n}\n/** The RFC 9728 path-aware well-known path for a resource URL. */\nfunction protectedResourceMetadataPath(resourceServerUrl) {\n\tconst rsPath = stripTrailingSlash(resourceServerUrl.pathname);\n\treturn `/.well-known/oauth-protected-resource${rsPath === \"/\" ? \"\" : rsPath}`;\n}\nfunction stripTrailingSlash(path) {\n\treturn path.length > 1 && path.endsWith(\"/\") ? path.slice(0, -1) : path;\n}\nconst ALLOWED_METHODS = \"GET, HEAD, OPTIONS\";\nfunction metadataDocumentResponse(request, metadata) {\n\tif (request.method === \"OPTIONS\") {\n\t\tconst requestedHeaders = request.headers.get(\"access-control-request-headers\");\n\t\treturn new Response(null, {\n\t\t\tstatus: 204,\n\t\t\theaders: {\n\t\t\t\t\"Access-Control-Allow-Origin\": \"*\",\n\t\t\t\t\"Access-Control-Allow-Methods\": ALLOWED_METHODS,\n\t\t\t\t...requestedHeaders === null ? {} : {\n\t\t\t\t\t\"Access-Control-Allow-Headers\": requestedHeaders,\n\t\t\t\t\tVary: \"Access-Control-Request-Headers\"\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\tif (request.method !== \"GET\" && request.method !== \"HEAD\") {\n\t\tconst error = new OAuthError(OAuthErrorCode.MethodNotAllowed, `The method ${request.method} is not allowed for this endpoint`);\n\t\treturn Response.json(error.toResponseObject(), {\n\t\t\tstatus: 405,\n\t\t\theaders: {\n\t\t\t\tAllow: ALLOWED_METHODS,\n\t\t\t\t\"Access-Control-Allow-Origin\": \"*\"\n\t\t\t}\n\t\t});\n\t}\n\tconst response = Response.json(metadata, { headers: { \"Access-Control-Allow-Origin\": \"*\" } });\n\treturn request.method === \"HEAD\" ? new Response(null, {\n\t\tstatus: response.status,\n\t\theaders: response.headers\n\t}) : response;\n}\n/**\n* Serve the two OAuth discovery documents an MCP server acting as a Resource\n* Server exposes, from a web-standard `fetch(request)` handler:\n*\n* - `/.well-known/oauth-protected-resource[/<path>]` — RFC 9728 Protected\n* Resource Metadata, derived from the supplied options (path-aware: the\n* resource URL's path is reflected in the route).\n* - `/.well-known/oauth-authorization-server` — RFC 8414 Authorization\n* Server Metadata, passed through verbatim.\n*\n* Returns the matched document `Response` (JSON with permissive CORS, `405`\n* with an `Allow` header for non-GET methods, `204` for CORS preflight), or\n* `undefined` when the request path is neither well-known route — fall\n* through to your own routing. The framework-free counterpart of\n* `mcpAuthMetadataRouter` from `@modelcontextprotocol/express`; pair it with\n* `requireBearerAuth` and `getOAuthProtectedResourceMetadataUrl` so\n* unauthenticated clients can discover the AS from the `401` challenge.\n*\n* @example\n* ```ts source=\"./oauthMetadata.examples.ts#oauthMetadataResponse_fetchHandler\"\n* async function fetchHandler(request: Request): Promise<Response> {\n* return oauthMetadataResponse(request, options) ?? serveMcp(request);\n* }\n* ```\n*/\nfunction oauthMetadataResponse(request, options) {\n\tconst requestPath = stripTrailingSlash(new URL(request.url).pathname);\n\tif (requestPath === protectedResourceMetadataPath(options.resourceServerUrl)) return metadataDocumentResponse(request, buildOAuthProtectedResourceMetadata(options));\n\tif (requestPath === \"/.well-known/oauth-authorization-server\") {\n\t\tbuildOAuthProtectedResourceMetadata(options);\n\t\treturn metadataDocumentResponse(request, options.oauthMetadata);\n\t}\n}\n\n//#endregion\n//#region src/server/middleware/originValidation.ts\n/**\n* Validate an `Origin` header against an allowlist of hostnames (port-agnostic).\n*\n* - A missing/empty `Origin` header passes: non-browser clients do not send one,\n* and only browser-originated requests carry the header this check defends against.\n* - Allowlist items are hostnames only (no scheme, no port), the same convention as\n* `validateHostHeader`. For IPv6, include brackets (e.g. `[::1]`).\n* - Any present value that cannot be parsed as an origin URL — including the literal\n* `null` origin browsers send for opaque contexts — is rejected (deny on failure).\n*/\nfunction validateOriginHeader(originHeader, allowedOriginHostnames) {\n\tif (originHeader === null || originHeader === void 0 || originHeader === \"\") return { ok: true };\n\tlet hostname;\n\ttry {\n\t\thostname = new URL(originHeader).hostname;\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\terrorCode: \"invalid_origin_header\",\n\t\t\tmessage: `Invalid Origin header: ${originHeader}`,\n\t\t\toriginHeader\n\t\t};\n\t}\n\tif (hostname === \"\") return {\n\t\tok: false,\n\t\terrorCode: \"invalid_origin_header\",\n\t\tmessage: `Invalid Origin header: ${originHeader}`,\n\t\toriginHeader\n\t};\n\tif (!allowedOriginHostnames.includes(hostname)) return {\n\t\tok: false,\n\t\terrorCode: \"invalid_origin\",\n\t\tmessage: `Invalid Origin: ${hostname}`,\n\t\toriginHeader,\n\t\thostname\n\t};\n\treturn {\n\t\tok: true,\n\t\torigin: originHeader,\n\t\thostname\n\t};\n}\n/**\n* Convenience allowlist of localhost-class origin hostnames, mirroring\n* `localhostAllowedHostnames`.\n*/\nfunction localhostAllowedOrigins() {\n\treturn [\n\t\t\"localhost\",\n\t\t\"127.0.0.1\",\n\t\t\"[::1]\"\n\t];\n}\n/**\n* Web-standard `Request` helper for Origin validation: returns a `403` JSON-RPC\n* error response when the request's `Origin` header is not allowed, and\n* `undefined` when the request may proceed.\n*\n* ```ts\n* const rejected = originValidationResponse(request, localhostAllowedOrigins());\n* if (rejected) return rejected;\n* ```\n*/\nfunction originValidationResponse(req, allowedOriginHostnames) {\n\tconst result = validateOriginHeader(req.headers.get(\"origin\"), allowedOriginHostnames);\n\tif (result.ok) return void 0;\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode: -32e3,\n\t\t\tmessage: result.message\n\t\t},\n\t\tid: null\n\t}, {\n\t\tstatus: 403,\n\t\theaders: { \"Content-Type\": \"application/json\" }\n\t});\n}\n\n//#endregion\n//#region src/server/requestStateCodec.ts\nconst PREFIX = \"v1.\";\nfunction bytesToBase64Url(bytes) {\n\tlet bin = \"\";\n\tfor (const b of bytes) bin += String.fromCodePoint(b);\n\treturn btoa(bin).replaceAll(\"+\", \"-\").replaceAll(\"/\", \"_\").replace(/=+$/, \"\");\n}\nfunction constantTimeTagEqual(a, b) {\n\tif (a.length !== b.length) return false;\n\tlet r = 0;\n\tfor (let i = 0; i < a.length; i++) r |= a.codePointAt(i) ^ b.codePointAt(i);\n\treturn r === 0;\n}\nfunction base64UrlToBytes(s) {\n\tconst b64 = s.replaceAll(\"-\", \"+\").replaceAll(\"_\", \"/\");\n\tconst bin = atob(b64);\n\tconst bytes = new Uint8Array(bin.length);\n\tfor (let i = 0; i < bin.length; i++) bytes[i] = bin.codePointAt(i);\n\treturn bytes;\n}\n/**\n* Create an opt-in HMAC-SHA256 codec for the multi-round-trip `requestState`\n* (protocol revision 2026-07-28).\n*\n* `requestState` round-trips through the client and is attacker-controlled\n* input on re-entry. The SDK applies no protection of its own; this helper is\n* the convenience implementation of the spec's integrity MUST so authors don't\n* hand-roll HMAC. Wire shape:\n*\n* \"v1.\" b64url({\"p\":<payload>,\"exp\":<unixSeconds>,\"b\":<bindTag>?}) \".\" b64url(mac)\n*\n* where `bindTag` is `b64url(HMAC(key, \"mcp.requestState.bind:\" + bind(ctx))[:16])`\n* — the binding value is never embedded raw.\n*\n* The codec is **signed, not encrypted**: the body is integrity-protected but\n* the client can base64url-decode it and read the payload (`p`) in clear. Do\n* not put secrets in the payload; use an AEAD construction if confidentiality\n* is required. The handler reads its payload back via the typed\n* `ctx.mcpReq.requestState<T>()` accessor — the seam has already run `verify`\n* (integrity proven, payload decoded) by the time the handler is entered.\n*\n* Verification is fail-closed and constant-time (WebCrypto `subtle.verify` for\n* the body MAC; a fixed-length XOR-accumulator compare for the bind tag).\n* See `examples/mrtr/server.ts` for a worked end-to-end example.\n*\n* Design comparison (mcp.d `secureRequestState`, the peer SDK's reference\n* implementation): mcp.d additionally offers an AES-256-GCM encrypted mode and\n* derives independent cipher / bind-HMAC sub-keys from the operator secret via\n* HKDF-SHA256, with an auto-generated per-process ephemeral key when none is\n* supplied. This codec deliberately ships only the signed mode and a single\n* keyed HMAC (domain-separated by input prefix) — HKDF sub-key derivation and\n* an encrypted mode are intentionally out of scope for the initial release.\n*/\nfunction createRequestStateCodec(options) {\n\tconst subtle = globalThis.crypto?.subtle;\n\tif (subtle === void 0) throw new TypeError(\"createRequestStateCodec requires the Web Crypto API (globalThis.crypto.subtle); see https://ts.sdk.modelcontextprotocol.io/v2/troubleshooting for the Node.js polyfill instructions\");\n\tconst keyBytes = typeof options.key === \"string\" ? new TextEncoder().encode(options.key) : Uint8Array.from(options.key);\n\tif (keyBytes.byteLength < 32) throw new RangeError(`createRequestStateCodec: key must be at least 32 bytes (got ${keyBytes.byteLength})`);\n\tconst ttlSeconds = options.ttlSeconds ?? 600;\n\tif (!Number.isFinite(ttlSeconds)) throw new RangeError(\"createRequestStateCodec: ttlSeconds must be a finite number\");\n\tconst bind = options.bind;\n\tlet cryptoKey;\n\tconst importedKey = () => cryptoKey ??= subtle.importKey(\"raw\", keyBytes, {\n\t\tname: \"HMAC\",\n\t\thash: \"SHA-256\"\n\t}, false, [\"sign\", \"verify\"]);\n\tconst utf8 = new TextEncoder();\n\tconst BIND_LABEL = \"mcp.requestState.bind:\";\n\tconst bindTag = async (value) => {\n\t\treturn bytesToBase64Url(new Uint8Array(await subtle.sign(\"HMAC\", await importedKey(), utf8.encode(BIND_LABEL + value))).slice(0, 16));\n\t};\n\treturn {\n\t\tasync mint(payload, ctx) {\n\t\t\tconst envelope = {\n\t\t\t\tp: payload,\n\t\t\t\texp: Math.floor(Date.now() / 1e3) + ttlSeconds\n\t\t\t};\n\t\t\tif (bind !== void 0) {\n\t\t\t\tif (ctx === void 0) throw new TypeError(\"createRequestStateCodec: mint() requires ctx when a bind callback is configured\");\n\t\t\t\tenvelope.b = await bindTag(bind(ctx));\n\t\t\t}\n\t\t\tconst body = bytesToBase64Url(utf8.encode(JSON.stringify(envelope)));\n\t\t\treturn `${PREFIX}${body}.${bytesToBase64Url(new Uint8Array(await subtle.sign(\"HMAC\", await importedKey(), utf8.encode(PREFIX + body))))}`;\n\t\t},\n\t\tasync verify(state, ctx) {\n\t\t\tconst dot = state.lastIndexOf(\".\");\n\t\t\tif (!state.startsWith(PREFIX) || dot <= 3) throw new Error(\"malformed\");\n\t\t\tconst body = state.slice(3, dot);\n\t\t\tlet macBytes;\n\t\t\ttry {\n\t\t\t\tmacBytes = base64UrlToBytes(state.slice(dot + 1));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"malformed\");\n\t\t\t}\n\t\t\tif (!await subtle.verify(\"HMAC\", await importedKey(), macBytes, utf8.encode(PREFIX + body))) throw new Error(\"mac\");\n\t\t\tlet envelope;\n\t\t\ttry {\n\t\t\t\tenvelope = JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(base64UrlToBytes(body)));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"malformed\");\n\t\t\t}\n\t\t\tif (typeof envelope.exp !== \"number\" || envelope.exp < Math.floor(Date.now() / 1e3)) throw new Error(\"expired\");\n\t\t\tif (bind !== void 0) {\n\t\t\t\tconst expected = await bindTag(bind(ctx));\n\t\t\t\tif (envelope.b === void 0 || !constantTimeTagEqual(envelope.b, expected)) throw new Error(\"bind\");\n\t\t\t} else if (envelope.b !== void 0) throw new Error(\"bind\");\n\t\t\treturn envelope.p;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/fromJsonSchema.ts\nlet _defaultValidator;\nfunction fromJsonSchema(schema, validator) {\n\treturn fromJsonSchema$1(schema, validator ?? (_defaultValidator ??= new DefaultJsonSchemaValidator()));\n}\n\n//#endregion\nexport { BAGGAGE_META_KEY, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DEFAULT_REQUEST_TIMEOUT_MSEC, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, InMemoryServerEventBus, InMemoryTransport, JSONRPC_VERSION, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, METHOD_NOT_FOUND, McpServer, MissingRequiredClientCapabilityError, OAuthError, OAuthErrorCode, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PerRequestHTTPServerTransport, Protocol, ProtocolError, ProtocolErrorCode, RELATED_TASK_META_KEY, ReadBuffer, ResourceNotFoundError, ResourceTemplate, SERVER_INFO_META_KEY, STDIO_DEFAULT_MAX_BUFFER_SIZE, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SdkError, SdkErrorCode, SdkHttpError, Server, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, UnsupportedProtocolVersionError, UriTemplate, UrlElicitationRequiredError, WebStandardStreamableHTTPServerTransport, acceptedContent, assertCompleteRequestPrompt, assertCompleteRequestResourceTemplate, bearerAuthChallengeResponse, buildOAuthProtectedResourceMetadata, checkResourceAllowed, classifyInboundRequest, completable, createFetchWithInit, createMcpHandler, createRequestStateCodec, deserializeMessage, fromJsonSchema, getDisplayName, getOAuthProtectedResourceMetadataUrl, hostHeaderValidationResponse, inputRequired, inputResponse, isCallToolResult, isCompletable, isInitializeRequest, isInitializedNotification, isInputRequiredResult, isJSONRPCErrorResponse, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResponse, isJSONRPCResultResponse, isJsonContentType, isLegacyRequest, isSpecType, isTaskAugmentedRequestParams, legacyStatelessFallback, localhostAllowedHostnames, localhostAllowedOrigins, mergeCapabilities, oauthMetadataResponse, originValidationResponse, parseJSONRPCMessage, preloadSchemas, requireBearerAuth, resourceUrlFromServerUrl, serializeMessage, specTypeSchemas, validateHostHeader, validateOriginHeader, verifyBearerToken };\n//# sourceMappingURL=index.mjs.map","// src/server.ts\nimport { createServer as createServerHTTP } from \"http\";\n\n// src/listener.ts\nimport { Http2ServerRequest as Http2ServerRequest2, constants as h2constants } from \"http2\";\n\n// src/request.ts\nimport { Http2ServerRequest } from \"http2\";\nimport { Readable } from \"stream\";\nvar RequestError = class extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"RequestError\";\n }\n};\nvar toRequestError = (e) => {\n if (e instanceof RequestError) {\n return e;\n }\n return new RequestError(e.message, { cause: e });\n};\nvar GlobalRequest = global.Request;\nvar Request = class extends GlobalRequest {\n constructor(input, options) {\n if (typeof input === \"object\" && getRequestCache in input) {\n input = input[getRequestCache]();\n }\n if (typeof options?.body?.getReader !== \"undefined\") {\n ;\n options.duplex ??= \"half\";\n }\n super(input, options);\n }\n};\nvar newHeadersFromIncoming = (incoming) => {\n const headerRecord = [];\n const rawHeaders = incoming.rawHeaders;\n for (let i = 0; i < rawHeaders.length; i += 2) {\n const { [i]: key, [i + 1]: value } = rawHeaders;\n if (key.charCodeAt(0) !== /*:*/\n 58) {\n headerRecord.push([key, value]);\n }\n }\n return new Headers(headerRecord);\n};\nvar wrapBodyStream = Symbol(\"wrapBodyStream\");\nvar newRequestFromIncoming = (method, url, headers, incoming, abortController) => {\n const init = {\n method,\n headers,\n signal: abortController.signal\n };\n if (method === \"TRACE\") {\n init.method = \"GET\";\n const req = new Request(url, init);\n Object.defineProperty(req, \"method\", {\n get() {\n return \"TRACE\";\n }\n });\n return req;\n }\n if (!(method === \"GET\" || method === \"HEAD\")) {\n if (\"rawBody\" in incoming && incoming.rawBody instanceof Buffer) {\n init.body = new ReadableStream({\n start(controller) {\n controller.enqueue(incoming.rawBody);\n controller.close();\n }\n });\n } else if (incoming[wrapBodyStream]) {\n let reader;\n init.body = new ReadableStream({\n async pull(controller) {\n try {\n reader ||= Readable.toWeb(incoming).getReader();\n const { done, value } = await reader.read();\n if (done) {\n controller.close();\n } else {\n controller.enqueue(value);\n }\n } catch (error) {\n controller.error(error);\n }\n }\n });\n } else {\n init.body = Readable.toWeb(incoming);\n }\n }\n return new Request(url, init);\n};\nvar getRequestCache = Symbol(\"getRequestCache\");\nvar requestCache = Symbol(\"requestCache\");\nvar incomingKey = Symbol(\"incomingKey\");\nvar urlKey = Symbol(\"urlKey\");\nvar headersKey = Symbol(\"headersKey\");\nvar abortControllerKey = Symbol(\"abortControllerKey\");\nvar getAbortController = Symbol(\"getAbortController\");\nvar requestPrototype = {\n get method() {\n return this[incomingKey].method || \"GET\";\n },\n get url() {\n return this[urlKey];\n },\n get headers() {\n return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]);\n },\n [getAbortController]() {\n this[getRequestCache]();\n return this[abortControllerKey];\n },\n [getRequestCache]() {\n this[abortControllerKey] ||= new AbortController();\n return this[requestCache] ||= newRequestFromIncoming(\n this.method,\n this[urlKey],\n this.headers,\n this[incomingKey],\n this[abortControllerKey]\n );\n }\n};\n[\n \"body\",\n \"bodyUsed\",\n \"cache\",\n \"credentials\",\n \"destination\",\n \"integrity\",\n \"mode\",\n \"redirect\",\n \"referrer\",\n \"referrerPolicy\",\n \"signal\",\n \"keepalive\"\n].forEach((k) => {\n Object.defineProperty(requestPrototype, k, {\n get() {\n return this[getRequestCache]()[k];\n }\n });\n});\n[\"arrayBuffer\", \"blob\", \"clone\", \"formData\", \"json\", \"text\"].forEach((k) => {\n Object.defineProperty(requestPrototype, k, {\n value: function() {\n return this[getRequestCache]()[k]();\n }\n });\n});\nObject.defineProperty(requestPrototype, Symbol.for(\"nodejs.util.inspect.custom\"), {\n value: function(depth, options, inspectFn) {\n const props = {\n method: this.method,\n url: this.url,\n headers: this.headers,\n nativeRequest: this[requestCache]\n };\n return `Request (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;\n }\n});\nObject.setPrototypeOf(requestPrototype, Request.prototype);\nvar newRequest = (incoming, defaultHostname) => {\n const req = Object.create(requestPrototype);\n req[incomingKey] = incoming;\n const incomingUrl = incoming.url || \"\";\n if (incomingUrl[0] !== \"/\" && // short-circuit for performance. most requests are relative URL.\n (incomingUrl.startsWith(\"http://\") || incomingUrl.startsWith(\"https://\"))) {\n if (incoming instanceof Http2ServerRequest) {\n throw new RequestError(\"Absolute URL for :path is not allowed in HTTP/2\");\n }\n try {\n const url2 = new URL(incomingUrl);\n req[urlKey] = url2.href;\n } catch (e) {\n throw new RequestError(\"Invalid absolute URL\", { cause: e });\n }\n return req;\n }\n const host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;\n if (!host) {\n throw new RequestError(\"Missing host header\");\n }\n let scheme;\n if (incoming instanceof Http2ServerRequest) {\n scheme = incoming.scheme;\n if (!(scheme === \"http\" || scheme === \"https\")) {\n throw new RequestError(\"Unsupported scheme\");\n }\n } else {\n scheme = incoming.socket && incoming.socket.encrypted ? \"https\" : \"http\";\n }\n const url = new URL(`${scheme}://${host}${incomingUrl}`);\n if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\\d+$/, \"\")) {\n throw new RequestError(\"Invalid host header\");\n }\n req[urlKey] = url.href;\n return req;\n};\n\n// src/response.ts\nvar responseCache = Symbol(\"responseCache\");\nvar getResponseCache = Symbol(\"getResponseCache\");\nvar cacheKey = Symbol(\"cache\");\nvar GlobalResponse = global.Response;\nvar Response2 = class _Response {\n #body;\n #init;\n [getResponseCache]() {\n delete this[cacheKey];\n return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);\n }\n constructor(body, init) {\n let headers;\n this.#body = body;\n if (init instanceof _Response) {\n const cachedGlobalResponse = init[responseCache];\n if (cachedGlobalResponse) {\n this.#init = cachedGlobalResponse;\n this[getResponseCache]();\n return;\n } else {\n this.#init = init.#init;\n headers = new Headers(init.#init.headers);\n }\n } else {\n this.#init = init;\n }\n if (typeof body === \"string\" || typeof body?.getReader !== \"undefined\" || body instanceof Blob || body instanceof Uint8Array) {\n ;\n this[cacheKey] = [init?.status || 200, body, headers || init?.headers];\n }\n }\n get headers() {\n const cache = this[cacheKey];\n if (cache) {\n if (!(cache[2] instanceof Headers)) {\n cache[2] = new Headers(\n cache[2] || { \"content-type\": \"text/plain; charset=UTF-8\" }\n );\n }\n return cache[2];\n }\n return this[getResponseCache]().headers;\n }\n get status() {\n return this[cacheKey]?.[0] ?? this[getResponseCache]().status;\n }\n get ok() {\n const status = this.status;\n return status >= 200 && status < 300;\n }\n};\n[\"body\", \"bodyUsed\", \"redirected\", \"statusText\", \"trailers\", \"type\", \"url\"].forEach((k) => {\n Object.defineProperty(Response2.prototype, k, {\n get() {\n return this[getResponseCache]()[k];\n }\n });\n});\n[\"arrayBuffer\", \"blob\", \"clone\", \"formData\", \"json\", \"text\"].forEach((k) => {\n Object.defineProperty(Response2.prototype, k, {\n value: function() {\n return this[getResponseCache]()[k]();\n }\n });\n});\nObject.defineProperty(Response2.prototype, Symbol.for(\"nodejs.util.inspect.custom\"), {\n value: function(depth, options, inspectFn) {\n const props = {\n status: this.status,\n headers: this.headers,\n ok: this.ok,\n nativeResponse: this[responseCache]\n };\n return `Response (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;\n }\n});\nObject.setPrototypeOf(Response2, GlobalResponse);\nObject.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);\n\n// src/utils.ts\nasync function readWithoutBlocking(readPromise) {\n return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]);\n}\nfunction writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) {\n const cancel = (error) => {\n reader.cancel(error).catch(() => {\n });\n };\n writable.on(\"close\", cancel);\n writable.on(\"error\", cancel);\n (currentReadPromise ?? reader.read()).then(flow, handleStreamError);\n return reader.closed.finally(() => {\n writable.off(\"close\", cancel);\n writable.off(\"error\", cancel);\n });\n function handleStreamError(error) {\n if (error) {\n writable.destroy(error);\n }\n }\n function onDrain() {\n reader.read().then(flow, handleStreamError);\n }\n function flow({ done, value }) {\n try {\n if (done) {\n writable.end();\n } else if (!writable.write(value)) {\n writable.once(\"drain\", onDrain);\n } else {\n return reader.read().then(flow, handleStreamError);\n }\n } catch (e) {\n handleStreamError(e);\n }\n }\n}\nfunction writeFromReadableStream(stream, writable) {\n if (stream.locked) {\n throw new TypeError(\"ReadableStream is locked.\");\n } else if (writable.destroyed) {\n return;\n }\n return writeFromReadableStreamDefaultReader(stream.getReader(), writable);\n}\nvar buildOutgoingHttpHeaders = (headers) => {\n const res = {};\n if (!(headers instanceof Headers)) {\n headers = new Headers(headers ?? void 0);\n }\n const cookies = [];\n for (const [k, v] of headers) {\n if (k === \"set-cookie\") {\n cookies.push(v);\n } else {\n res[k] = v;\n }\n }\n if (cookies.length > 0) {\n res[\"set-cookie\"] = cookies;\n }\n res[\"content-type\"] ??= \"text/plain; charset=UTF-8\";\n return res;\n};\n\n// src/utils/response/constants.ts\nvar X_ALREADY_SENT = \"x-hono-already-sent\";\n\n// src/globals.ts\nimport crypto from \"crypto\";\nif (typeof global.crypto === \"undefined\") {\n global.crypto = crypto;\n}\n\n// src/listener.ts\nvar outgoingEnded = Symbol(\"outgoingEnded\");\nvar incomingDraining = Symbol(\"incomingDraining\");\nvar DRAIN_TIMEOUT_MS = 500;\nvar MAX_DRAIN_BYTES = 64 * 1024 * 1024;\nvar drainIncoming = (incoming) => {\n const incomingWithDrainState = incoming;\n if (incoming.destroyed || incomingWithDrainState[incomingDraining]) {\n return;\n }\n incomingWithDrainState[incomingDraining] = true;\n if (incoming instanceof Http2ServerRequest2) {\n try {\n ;\n incoming.stream?.close?.(h2constants.NGHTTP2_NO_ERROR);\n } catch {\n }\n return;\n }\n let bytesRead = 0;\n const cleanup = () => {\n clearTimeout(timer);\n incoming.off(\"data\", onData);\n incoming.off(\"end\", cleanup);\n incoming.off(\"error\", cleanup);\n };\n const forceClose = () => {\n cleanup();\n const socket = incoming.socket;\n if (socket && !socket.destroyed) {\n socket.destroySoon();\n }\n };\n const timer = setTimeout(forceClose, DRAIN_TIMEOUT_MS);\n timer.unref?.();\n const onData = (chunk) => {\n bytesRead += chunk.length;\n if (bytesRead > MAX_DRAIN_BYTES) {\n forceClose();\n }\n };\n incoming.on(\"data\", onData);\n incoming.on(\"end\", cleanup);\n incoming.on(\"error\", cleanup);\n incoming.resume();\n};\nvar handleRequestError = () => new Response(null, {\n status: 400\n});\nvar handleFetchError = (e) => new Response(null, {\n status: e instanceof Error && (e.name === \"TimeoutError\" || e.constructor.name === \"TimeoutError\") ? 504 : 500\n});\nvar handleResponseError = (e, outgoing) => {\n const err = e instanceof Error ? e : new Error(\"unknown error\", { cause: e });\n if (err.code === \"ERR_STREAM_PREMATURE_CLOSE\") {\n console.info(\"The user aborted a request.\");\n } else {\n console.error(e);\n if (!outgoing.headersSent) {\n outgoing.writeHead(500, { \"Content-Type\": \"text/plain\" });\n }\n outgoing.end(`Error: ${err.message}`);\n outgoing.destroy(err);\n }\n};\nvar flushHeaders = (outgoing) => {\n if (\"flushHeaders\" in outgoing && outgoing.writable) {\n outgoing.flushHeaders();\n }\n};\nvar responseViaCache = async (res, outgoing) => {\n let [status, body, header] = res[cacheKey];\n let hasContentLength = false;\n if (!header) {\n header = { \"content-type\": \"text/plain; charset=UTF-8\" };\n } else if (header instanceof Headers) {\n hasContentLength = header.has(\"content-length\");\n header = buildOutgoingHttpHeaders(header);\n } else if (Array.isArray(header)) {\n const headerObj = new Headers(header);\n hasContentLength = headerObj.has(\"content-length\");\n header = buildOutgoingHttpHeaders(headerObj);\n } else {\n for (const key in header) {\n if (key.length === 14 && key.toLowerCase() === \"content-length\") {\n hasContentLength = true;\n break;\n }\n }\n }\n if (!hasContentLength) {\n if (typeof body === \"string\") {\n header[\"Content-Length\"] = Buffer.byteLength(body);\n } else if (body instanceof Uint8Array) {\n header[\"Content-Length\"] = body.byteLength;\n } else if (body instanceof Blob) {\n header[\"Content-Length\"] = body.size;\n }\n }\n outgoing.writeHead(status, header);\n if (typeof body === \"string\" || body instanceof Uint8Array) {\n outgoing.end(body);\n } else if (body instanceof Blob) {\n outgoing.end(new Uint8Array(await body.arrayBuffer()));\n } else {\n flushHeaders(outgoing);\n await writeFromReadableStream(body, outgoing)?.catch(\n (e) => handleResponseError(e, outgoing)\n );\n }\n ;\n outgoing[outgoingEnded]?.();\n};\nvar isPromise = (res) => typeof res.then === \"function\";\nvar responseViaResponseObject = async (res, outgoing, options = {}) => {\n if (isPromise(res)) {\n if (options.errorHandler) {\n try {\n res = await res;\n } catch (err) {\n const errRes = await options.errorHandler(err);\n if (!errRes) {\n return;\n }\n res = errRes;\n }\n } else {\n res = await res.catch(handleFetchError);\n }\n }\n if (cacheKey in res) {\n return responseViaCache(res, outgoing);\n }\n const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);\n if (res.body) {\n const reader = res.body.getReader();\n const values = [];\n let done = false;\n let currentReadPromise = void 0;\n if (resHeaderRecord[\"transfer-encoding\"] !== \"chunked\") {\n let maxReadCount = 2;\n for (let i = 0; i < maxReadCount; i++) {\n currentReadPromise ||= reader.read();\n const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {\n console.error(e);\n done = true;\n });\n if (!chunk) {\n if (i === 1) {\n await new Promise((resolve) => setTimeout(resolve));\n maxReadCount = 3;\n continue;\n }\n break;\n }\n currentReadPromise = void 0;\n if (chunk.value) {\n values.push(chunk.value);\n }\n if (chunk.done) {\n done = true;\n break;\n }\n }\n if (done && !(\"content-length\" in resHeaderRecord)) {\n resHeaderRecord[\"content-length\"] = values.reduce((acc, value) => acc + value.length, 0);\n }\n }\n outgoing.writeHead(res.status, resHeaderRecord);\n values.forEach((value) => {\n ;\n outgoing.write(value);\n });\n if (done) {\n outgoing.end();\n } else {\n if (values.length === 0) {\n flushHeaders(outgoing);\n }\n await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise);\n }\n } else if (resHeaderRecord[X_ALREADY_SENT]) {\n } else {\n outgoing.writeHead(res.status, resHeaderRecord);\n outgoing.end();\n }\n ;\n outgoing[outgoingEnded]?.();\n};\nvar getRequestListener = (fetchCallback, options = {}) => {\n const autoCleanupIncoming = options.autoCleanupIncoming ?? true;\n if (options.overrideGlobalObjects !== false && global.Request !== Request) {\n Object.defineProperty(global, \"Request\", {\n value: Request\n });\n Object.defineProperty(global, \"Response\", {\n value: Response2\n });\n }\n return async (incoming, outgoing) => {\n let res, req;\n try {\n req = newRequest(incoming, options.hostname);\n let incomingEnded = !autoCleanupIncoming || incoming.method === \"GET\" || incoming.method === \"HEAD\";\n if (!incomingEnded) {\n ;\n incoming[wrapBodyStream] = true;\n incoming.on(\"end\", () => {\n incomingEnded = true;\n });\n if (incoming instanceof Http2ServerRequest2) {\n ;\n outgoing[outgoingEnded] = () => {\n if (!incomingEnded) {\n setTimeout(() => {\n if (!incomingEnded) {\n setTimeout(() => {\n drainIncoming(incoming);\n });\n }\n });\n }\n };\n }\n outgoing.on(\"finish\", () => {\n if (!incomingEnded) {\n drainIncoming(incoming);\n }\n });\n }\n outgoing.on(\"close\", () => {\n const abortController = req[abortControllerKey];\n if (abortController) {\n if (incoming.errored) {\n req[abortControllerKey].abort(incoming.errored.toString());\n } else if (!outgoing.writableFinished) {\n req[abortControllerKey].abort(\"Client connection prematurely closed.\");\n }\n }\n if (!incomingEnded) {\n setTimeout(() => {\n if (!incomingEnded) {\n setTimeout(() => {\n drainIncoming(incoming);\n });\n }\n });\n }\n });\n res = fetchCallback(req, { incoming, outgoing });\n if (cacheKey in res) {\n return responseViaCache(res, outgoing);\n }\n } catch (e) {\n if (!res) {\n if (options.errorHandler) {\n res = await options.errorHandler(req ? e : toRequestError(e));\n if (!res) {\n return;\n }\n } else if (!req) {\n res = handleRequestError();\n } else {\n res = handleFetchError(e);\n }\n } else {\n return handleResponseError(e, outgoing);\n }\n }\n try {\n return await responseViaResponseObject(res, outgoing, options);\n } catch (e) {\n return handleResponseError(e, outgoing);\n }\n };\n};\n\n// src/server.ts\nvar createAdaptorServer = (options) => {\n const fetchCallback = options.fetch;\n const requestListener = getRequestListener(fetchCallback, {\n hostname: options.hostname,\n overrideGlobalObjects: options.overrideGlobalObjects,\n autoCleanupIncoming: options.autoCleanupIncoming\n });\n const createServer = options.createServer || createServerHTTP;\n const server = createServer(options.serverOptions || {}, requestListener);\n return server;\n};\nvar serve = (options, listeningListener) => {\n const server = createAdaptorServer(options);\n server.listen(options?.port ?? 3e3, options.hostname, () => {\n const serverInfo = server.address();\n listeningListener && listeningListener(serverInfo);\n });\n return server;\n};\nexport {\n RequestError,\n createAdaptorServer,\n getRequestListener,\n serve\n};\n","import { WebStandardStreamableHTTPServerTransport, localhostAllowedHostnames, localhostAllowedOrigins, validateHostHeader, validateOriginHeader } from \"@modelcontextprotocol/server\";\nimport { getRequestListener } from \"@hono/node-server\";\n\n//#region src/middleware/hostHeaderValidation.ts\n/**\n* Node.js request guard for DNS rebinding protection.\n* Validates the `Host` header hostname (port-agnostic) against an allowed list.\n*\n* Unlike the framework adapters, plain `node:http` has no middleware chain, so\n* the guard returns whether the request may proceed: when it returns `false`\n* it has already answered the request with a `403` JSON-RPC error and the\n* caller must not handle it further.\n*\n* @param allowedHostnames - List of allowed hostnames (without ports).\n* For IPv6, provide the address with brackets (e.g., `[::1]`).\n*\n* @example\n* ```ts\n* const validateHost = hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']);\n* http.createServer((req, res) => {\n* if (!validateHost(req, res)) return;\n* void transport.handleRequest(req, res);\n* });\n* ```\n*/\nfunction hostHeaderValidation(allowedHostnames) {\n\treturn (req, res) => {\n\t\tconst result = validateHostHeader(req.headers.host, allowedHostnames);\n\t\tif (result.ok) return true;\n\t\tres.writeHead(403, { \"Content-Type\": \"application/json\" });\n\t\tres.end(JSON.stringify({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\terror: {\n\t\t\t\tcode: -32e3,\n\t\t\t\tmessage: result.message\n\t\t\t},\n\t\t\tid: null\n\t\t}));\n\t\treturn false;\n\t};\n}\n/**\n* Convenience guard for localhost DNS rebinding protection.\n* Allows only `localhost`, `127.0.0.1`, and `[::1]` (IPv6 localhost) hostnames.\n*/\nfunction localhostHostValidation() {\n\treturn hostHeaderValidation(localhostAllowedHostnames());\n}\n\n//#endregion\n//#region src/middleware/originValidation.ts\n/**\n* Node.js request guard for Origin header validation.\n* Validates the `Origin` header hostname (port-agnostic) against an allowed list.\n*\n* Requests without an `Origin` header pass (non-browser MCP clients do not send\n* one); a present value that is not allowed, or that cannot be parsed, is\n* rejected with `403`. The guard returns whether the request may proceed: when\n* it returns `false` it has already answered the request and the caller must\n* not handle it further.\n*\n* @param allowedOriginHostnames - List of allowed origin hostnames (without scheme or port).\n* For IPv6, provide the address with brackets (e.g., `[::1]`).\n*\n* @example\n* ```ts\n* const validateOrigin = originValidation(['localhost', '127.0.0.1', '[::1]']);\n* http.createServer((req, res) => {\n* if (!validateOrigin(req, res)) return;\n* void transport.handleRequest(req, res);\n* });\n* ```\n*/\nfunction originValidation(allowedOriginHostnames) {\n\treturn (req, res) => {\n\t\tconst result = validateOriginHeader(req.headers.origin, allowedOriginHostnames);\n\t\tif (result.ok) return true;\n\t\tres.writeHead(403, { \"Content-Type\": \"application/json\" });\n\t\tres.end(JSON.stringify({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\terror: {\n\t\t\t\tcode: -32e3,\n\t\t\t\tmessage: result.message\n\t\t\t},\n\t\t\tid: null\n\t\t}));\n\t\treturn false;\n\t};\n}\n/**\n* Convenience guard for localhost Origin validation.\n* Allows only origins whose hostname is `localhost`, `127.0.0.1`, or `[::1]` (IPv6 localhost).\n*/\nfunction localhostOriginValidation() {\n\treturn originValidation(localhostAllowedOrigins());\n}\n\n//#endregion\n//#region src/streamableHttp.ts\n/**\n* Server transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification.\n* It supports both SSE streaming and direct HTTP responses.\n*\n* This is a wrapper around {@linkcode WebStandardStreamableHTTPServerTransport} that provides Node.js HTTP compatibility.\n* It uses the `@hono/node-server` library to convert between Node.js HTTP and Web Standard APIs.\n*\n* In stateful mode:\n* - Session ID is generated and included in response headers\n* - Session ID is always included in initialization responses\n* - Requests with invalid session IDs are rejected with `404 Not Found`\n* - Non-initialization requests without a session ID are rejected with `400 Bad Request`\n* - State is maintained in-memory (connections, message history)\n*\n* In stateless mode:\n* - No Session ID is included in any responses\n* - No session validation is performed\n*\n* @example Stateful setup\n* ```ts source=\"./streamableHttp.examples.ts#NodeStreamableHTTPServerTransport_stateful\"\n* const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n*\n* const transport = new NodeStreamableHTTPServerTransport({\n* sessionIdGenerator: () => randomUUID()\n* });\n*\n* await server.connect(transport);\n* ```\n*\n* @example Stateless setup\n* ```ts source=\"./streamableHttp.examples.ts#NodeStreamableHTTPServerTransport_stateless\"\n* const transport = new NodeStreamableHTTPServerTransport({\n* sessionIdGenerator: undefined\n* });\n* ```\n*\n* @example Using with a pre-parsed request body (e.g. Express)\n* ```ts source=\"./streamableHttp.examples.ts#NodeStreamableHTTPServerTransport_express\"\n* app.post('/mcp', (req, res) => {\n* transport.handleRequest(req, res, req.body);\n* });\n* ```\n*/\nvar NodeStreamableHTTPServerTransport = class {\n\t_webStandardTransport;\n\t_requestListener;\n\t_requestContext = /* @__PURE__ */ new WeakMap();\n\tconstructor(options = {}) {\n\t\tthis._webStandardTransport = new WebStandardStreamableHTTPServerTransport(options);\n\t\tthis._requestListener = getRequestListener(async (webRequest) => {\n\t\t\tconst context = this._requestContext.get(webRequest);\n\t\t\treturn this._webStandardTransport.handleRequest(webRequest, {\n\t\t\t\tauthInfo: context?.authInfo,\n\t\t\t\tparsedBody: context?.parsedBody\n\t\t\t});\n\t\t}, { overrideGlobalObjects: false });\n\t}\n\t/**\n\t* Gets the session ID for this transport instance.\n\t*/\n\tget sessionId() {\n\t\treturn this._webStandardTransport.sessionId;\n\t}\n\t/**\n\t* Sets callback for when the transport is closed.\n\t*/\n\tset onclose(handler) {\n\t\tthis._webStandardTransport.onclose = handler;\n\t}\n\tget onclose() {\n\t\treturn this._webStandardTransport.onclose;\n\t}\n\t/**\n\t* Sets callback for transport errors.\n\t*/\n\tset onerror(handler) {\n\t\tthis._webStandardTransport.onerror = handler;\n\t}\n\tget onerror() {\n\t\treturn this._webStandardTransport.onerror;\n\t}\n\t/**\n\t* Sets callback for incoming messages.\n\t*/\n\tset onmessage(handler) {\n\t\tthis._webStandardTransport.onmessage = handler;\n\t}\n\tget onmessage() {\n\t\treturn this._webStandardTransport.onmessage;\n\t}\n\t/**\n\t* Starts the transport. This is required by the {@linkcode Transport} interface but is a no-op\n\t* for the Streamable HTTP transport as connections are managed per-request.\n\t*/\n\tasync start() {\n\t\treturn this._webStandardTransport.start();\n\t}\n\t/**\n\t* Closes the transport and all active connections.\n\t*/\n\tasync close() {\n\t\treturn this._webStandardTransport.close();\n\t}\n\t/**\n\t* Sends a JSON-RPC message through the transport.\n\t*/\n\tasync send(message, options) {\n\t\treturn this._webStandardTransport.send(message, options);\n\t}\n\t/**\n\t* Forwards the supported protocol versions to the wrapped Web Standard\n\t* transport for `MCP-Protocol-Version` header validation. Called by the\n\t* protocol layer during connect; without this delegation a server's\n\t* `supportedProtocolVersions` option never reached the Node adapter's\n\t* header validation.\n\t*/\n\tsetSupportedProtocolVersions(versions) {\n\t\tthis._webStandardTransport.setSupportedProtocolVersions(versions);\n\t}\n\t/**\n\t* Handles an incoming HTTP request, whether `GET` or `POST`.\n\t*\n\t* This method converts Node.js HTTP objects to Web Standard Request/Response\n\t* and delegates to the underlying {@linkcode WebStandardStreamableHTTPServerTransport}.\n\t*\n\t* @param req - Node.js `IncomingMessage`, optionally with `auth` property from middleware\n\t* @param res - Node.js `ServerResponse`\n\t* @param parsedBody - Optional pre-parsed body from body-parser middleware\n\t*/\n\tasync handleRequest(req, res, parsedBody) {\n\t\tconst authInfo = req.auth;\n\t\tawait getRequestListener(async (webRequest) => {\n\t\t\treturn this._webStandardTransport.handleRequest(webRequest, {\n\t\t\t\tauthInfo,\n\t\t\t\tparsedBody\n\t\t\t});\n\t\t}, { overrideGlobalObjects: false })(req, res);\n\t}\n\t/**\n\t* Close an SSE stream for a specific request, triggering client reconnection.\n\t* Use this to implement polling behavior during long-running operations -\n\t* client will reconnect after the retry interval specified in the priming event.\n\t*/\n\tcloseSSEStream(requestId) {\n\t\tthis._webStandardTransport.closeSSEStream(requestId);\n\t}\n\t/**\n\t* Close the standalone GET SSE stream, triggering client reconnection.\n\t* Use this to implement polling behavior for server-initiated notifications.\n\t*/\n\tcloseStandaloneSSEStream() {\n\t\tthis._webStandardTransport.closeStandaloneSSEStream();\n\t}\n};\n\n//#endregion\n//#region src/toNodeHandler.ts\n/**\n* Adapts a web-standard MCP handler (`handler.fetch`) to a Node.js\n* `(req, res, parsedBody?)` request handler. The returned function converts the\n* Node request to a web-standard `Request`, calls `handler.fetch`, then writes\n* the `Response` back to `res` (honoring write backpressure for streamed SSE\n* responses).\n*\n* `req.auth` is forwarded as the handler's pass-through `authInfo`. A function\n* third argument (Express's `next`) is ignored, never treated as a body.\n*\n* Pass `{ onerror }` to observe the adapter-level error fallback (request\n* conversion / `handler.fetch` throw) before the `500` response is written.\n*/\nfunction toNodeHandler(handler, opts) {\n\treturn async (req, res, parsedBody) => {\n\t\tif (typeof parsedBody === \"function\") parsedBody = void 0;\n\t\tlet finished = false;\n\t\tconst abort = new AbortController();\n\t\tres.on(\"close\", () => {\n\t\t\tif (!finished) abort.abort();\n\t\t});\n\t\tif (res.destroyed === true) abort.abort();\n\t\tlet response;\n\t\ttry {\n\t\t\tconst request = await toWebRequest(req, parsedBody, { signal: abort.signal });\n\t\t\tresponse = await handler.fetch(request, {\n\t\t\t\t...req.auth !== void 0 && { authInfo: req.auth },\n\t\t\t\t...parsedBody !== void 0 && { parsedBody }\n\t\t\t});\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\topts?.onerror?.(error instanceof Error ? error : new Error(String(error)));\n\t\t\t} catch {}\n\t\t\tresponse = internalServerErrorResponse(echoableRequestId(parsedBody));\n\t\t}\n\t\tconst headers = {};\n\t\tfor (const [name, value] of response.headers) headers[name] = value;\n\t\tres.writeHead(response.status, headers);\n\t\tif (response.body === null) {\n\t\t\tfinished = true;\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\t\tlet drainResolve;\n\t\tconst releaseDrainWait = () => {\n\t\t\tdrainResolve?.();\n\t\t\tdrainResolve = void 0;\n\t\t};\n\t\tres.on(\"drain\", releaseDrainWait);\n\t\tconst closed = new Promise((resolve) => {\n\t\t\tabort.signal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t\t});\n\t\ttry {\n\t\t\tfor await (const chunk of response.body) {\n\t\t\t\tif (abort.signal.aborted) break;\n\t\t\t\tif (res.write(chunk) === false) await Promise.race([new Promise((resolve) => {\n\t\t\t\t\tdrainResolve = resolve;\n\t\t\t\t}), closed]);\n\t\t\t}\n\t\t} catch {}\n\t\tfinished = true;\n\t\tres.end();\n\t};\n}\nfunction singleHeaderValue(value) {\n\treturn Array.isArray(value) ? value[0] : value;\n}\n/**\n* Convert a Node.js `IncomingMessage` (duck-typed — an Express `req` works) to\n* the web-standard `Request` that `handler.fetch()` and `isLegacyRequest()`\n* take. This is the conversion {@linkcode toNodeHandler} performs internally,\n* exported for hand-wired compositions:\n*\n* ```ts\n* const probe = await toWebRequest(req, req.body);\n* await ((await isLegacyRequest(probe)) ? legacy(req, res) : modern(req, res, req.body));\n* ```\n*\n* With no `parsedBody` the Node stream is read to completion — read the body\n* from the returned `Request` afterwards, not from `req`. When a body parser\n* already consumed the stream (`express.json()`), pass the parsed value as\n* `parsedBody` and nothing is read from `req`.\n*/\nasync function toWebRequest(req, parsedBody, options) {\n\tconst method = (req.method ?? \"GET\").toUpperCase();\n\tconst url = `http://${singleHeaderValue(req.headers[\"host\"]) ?? singleHeaderValue(req.headers[\":authority\"]) ?? \"localhost\"}${req.url ?? \"/\"}`;\n\tconst headers = new Headers();\n\tfor (const [name, value] of Object.entries(req.headers)) {\n\t\tif (value === void 0 || name.startsWith(\":\")) continue;\n\t\tif (Array.isArray(value)) for (const item of value) headers.append(name, item);\n\t\telse headers.set(name, value);\n\t}\n\tlet body;\n\tif (method !== \"GET\" && method !== \"HEAD\") if (parsedBody === void 0) {\n\t\tconst decoder = new TextDecoder();\n\t\tlet collected = \"\";\n\t\tfor await (const chunk of req) collected += typeof chunk === \"string\" ? chunk : decoder.decode(chunk, { stream: true });\n\t\tcollected += decoder.decode();\n\t\tif (collected.length > 0) body = collected;\n\t} else {\n\t\tconst serialized = JSON.stringify(parsedBody);\n\t\theaders.delete(\"content-encoding\");\n\t\theaders.delete(\"transfer-encoding\");\n\t\tif (serialized === void 0) headers.delete(\"content-length\");\n\t\telse {\n\t\t\tbody = serialized;\n\t\t\theaders.set(\"content-length\", String(new TextEncoder().encode(serialized).byteLength));\n\t\t}\n\t}\n\treturn new Request(url, {\n\t\tmethod,\n\t\theaders,\n\t\t...options?.signal !== void 0 && { signal: options.signal },\n\t\t...body !== void 0 && { body }\n\t});\n}\n/**\n* The JSON-RPC id to echo on an adapter-built error response: the body's `id`\n* when the body is a single JSON-RPC request whose id is a string or number,\n* `null` otherwise.\n*/\nfunction echoableRequestId(body) {\n\tif (body === null || typeof body !== \"object\" || Array.isArray(body)) return null;\n\tconst { method, id } = body;\n\tif (typeof method !== \"string\") return null;\n\treturn typeof id === \"string\" || typeof id === \"number\" ? id : null;\n}\nfunction internalServerErrorResponse(id) {\n\treturn Response.json({\n\t\tjsonrpc: \"2.0\",\n\t\terror: {\n\t\t\tcode: -32603,\n\t\t\tmessage: \"Internal server error\"\n\t\t},\n\t\tid\n\t}, { status: 500 });\n}\n\n//#endregion\nexport { NodeStreamableHTTPServerTransport, hostHeaderValidation, localhostHostValidation, localhostOriginValidation, originValidation, toNodeHandler, toWebRequest };\n//# sourceMappingURL=index.mjs.map","/**\n * Server transport for the handshake-era HTTP+SSE wire protocol (revision\n * 2024-11-05): messages go out over a long-lived SSE stream and come back as\n * HTTP POSTs to a per-session endpoint.\n *\n * Forked from\n * https://github.com/modelcontextprotocol/typescript-sdk/blob/v1.25.3/src/server/sse.ts\n * because the 2.x SDK packages dropped the SSE server transport entirely,\n * while this gateway must keep serving its /sse endpoint — losing it would\n * drop handshake-era clients that still speak the older transport. Changes\n * from the original: types come from the 2.x packages, and the POST body is\n * read with Node primitives instead of the SDK's raw-body/content-type\n * dependencies (same 4 MB limit and application/json requirement).\n */\nimport type { AuthInfo, JSONRPCMessage, MessageExtraInfo, Transport } from \"@modelcontextprotocol/server\";\n\nimport { JSONRPCMessageSchema } from \"@modelcontextprotocol/core\";\nimport { randomUUID } from \"node:crypto\";\nimport { type IncomingMessage, type ServerResponse } from \"node:http\";\nimport { URL } from \"node:url\";\n\nconst MAXIMUM_MESSAGE_SIZE_BYTES = 4 * 1024 * 1024;\n\n/**\n * Reads a request body as UTF-8 text, rejecting once it exceeds the size limit\n * (the raw-body semantics the v1 transport relied on, without the dependency).\n */\nconst readBody = (req: IncomingMessage, limitBytes: number): Promise<string> =>\n\tnew Promise((resolve, reject) => {\n\t\tconst chunks: Buffer[] = [];\n\t\tlet received = 0;\n\t\treq.on(\"data\", (chunk: Buffer) => {\n\t\t\treceived += chunk.length;\n\t\t\tif (received > limitBytes) {\n\t\t\t\treject(new Error(`request entity too large (limit ${limitBytes} bytes)`));\n\t\t\t\treq.destroy();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tchunks.push(chunk);\n\t\t});\n\t\treq.on(\"end\", () => resolve(Buffer.concat(chunks).toString(\"utf-8\")));\n\t\treq.on(\"error\", reject);\n\t});\n\n/**\n * Server transport for SSE: sends messages over an SSE connection and receives\n * messages from HTTP POST requests.\n *\n * This transport is only available in Node.js environments.\n */\nexport class SSEServerTransport implements Transport {\n\tonclose?: () => void;\n\tonerror?: (error: Error) => void;\n\tonmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void;\n\t/**\n\t * Returns the session ID for this transport.\n\t *\n\t * This can be used to route incoming POST requests.\n\t */\n\tget sessionId(): string {\n\t\treturn this._sessionId;\n\t}\n\tprivate _sessionId: string;\n\n\tprivate _sseResponse?: ServerResponse;\n\n\t/**\n\t * Creates a new SSE server transport, which will direct the client to POST\n\t * messages to the relative or absolute URL identified by `_endpoint`.\n\t */\n\tconstructor(\n\t\tprivate _endpoint: string,\n\t\tprivate res: ServerResponse\n\t) {\n\t\tthis._sessionId = randomUUID();\n\t}\n\n\tasync close(): Promise<void> {\n\t\tthis._sseResponse?.end();\n\t\tthis._sseResponse = undefined;\n\t\tthis.onclose?.();\n\t}\n\n\t/**\n\t * Handle a client message, regardless of how it arrived. This can be used\n\t * to inform the server of messages that arrive via a means different than\n\t * HTTP POST.\n\t */\n\tasync handleMessage(message: unknown, extra?: MessageExtraInfo): Promise<void> {\n\t\tlet parsedMessage: JSONRPCMessage;\n\t\ttry {\n\t\t\tparsedMessage = JSONRPCMessageSchema.parse(message) as JSONRPCMessage;\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error as Error);\n\t\t\tthrow error;\n\t\t}\n\n\t\tthis.onmessage?.(parsedMessage, extra);\n\t}\n\n\t/**\n\t * Handles incoming POST messages.\n\t *\n\t * This should be called when a POST request is made to send a message to\n\t * the server.\n\t */\n\tasync handlePostMessage(\n\t\treq: { auth?: AuthInfo } & IncomingMessage,\n\t\tres: ServerResponse,\n\t\tparsedBody?: unknown\n\t): Promise<void> {\n\t\tif (!this._sseResponse) {\n\t\t\tconst message = \"SSE connection not established\";\n\t\t\tres.writeHead(500).end(message);\n\t\t\tthrow new Error(message);\n\t\t}\n\n\t\tconst authInfo: AuthInfo | undefined = req.auth;\n\n\t\tlet body: string | unknown;\n\t\ttry {\n\t\t\tconst rawContentType = req.headers[\"content-type\"] ?? \"\";\n\t\t\tif (rawContentType.split(\";\")[0].trim().toLowerCase() !== \"application/json\") {\n\t\t\t\tthrow new Error(`Unsupported content-type: ${rawContentType}`);\n\t\t\t}\n\n\t\t\tbody = parsedBody ?? (await readBody(req, MAXIMUM_MESSAGE_SIZE_BYTES));\n\t\t} catch (error) {\n\t\t\tres.writeHead(400).end(String(error));\n\t\t\tthis.onerror?.(error as Error);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait this.handleMessage(typeof body === \"string\" ? JSON.parse(body) : body, { authInfo });\n\t\t} catch {\n\t\t\tres.writeHead(400).end(`Invalid message: ${body}`);\n\t\t\treturn;\n\t\t}\n\n\t\tres.writeHead(202).end(\"Accepted\");\n\t}\n\n\tasync send(message: JSONRPCMessage): Promise<void> {\n\t\tif (!this._sseResponse) {\n\t\t\tthrow new Error(\"Not connected\");\n\t\t}\n\n\t\tthis._sseResponse.write(`event: message\\ndata: ${JSON.stringify(message)}\\n\\n`);\n\t}\n\n\t/**\n\t * Handles the initial SSE connection request.\n\t *\n\t * This should be called when a GET request is made to establish the SSE\n\t * stream.\n\t */\n\tasync start(): Promise<void> {\n\t\tif (this._sseResponse) {\n\t\t\tthrow new Error(\"SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.\");\n\t\t}\n\n\t\tthis.res.writeHead(200, {\n\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\tConnection: \"keep-alive\",\n\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t});\n\n\t\t// Send the endpoint event. Use a dummy base URL because this._endpoint\n\t\t// is relative; URL/URLSearchParams gives robust parameter handling.\n\t\tconst dummyBase = \"http://localhost\";\n\t\tconst endpointUrl = new URL(this._endpoint, dummyBase);\n\t\tendpointUrl.searchParams.set(\"sessionId\", this._sessionId);\n\n\t\t// Reconstruct the relative URL string (pathname + search + hash)\n\t\tconst relativeUrlWithSession = endpointUrl.pathname + endpointUrl.search + endpointUrl.hash;\n\n\t\tthis.res.write(`event: endpoint\\ndata: ${relativeUrlWithSession}\\n\\n`);\n\n\t\tthis._sseResponse = this.res;\n\t\tthis.res.on(\"close\", () => {\n\t\t\tthis._sseResponse = undefined;\n\t\t\tthis.onclose?.();\n\t\t});\n\t}\n}\n","import type { EventStore, Server } from \"@modelcontextprotocol/server\";\n\nimport { NodeStreamableHTTPServerTransport as StreamableHTTPServerTransport } from \"@modelcontextprotocol/node\";\nimport { isInitializeRequest } from \"@modelcontextprotocol/server\";\n\nimport { SSEServerTransport } from \"./legacySseServerTransport.js\";\nimport { randomUUID } from \"node:crypto\";\nimport http from \"node:http\";\n\nimport { InMemoryEventStore } from \"./InMemoryEventStore.js\";\nimport { extractTraceIdFromHeaders, gatewayCorrelationId, logger, runWithTraceContextAsync } from \"./lib/logger.js\";\n\nexport type SSEServer = {\n\tclose: () => Promise<void>;\n};\n\ntype ServerLike = {\n\tclose: Server[\"close\"];\n\tconnect: Server[\"connect\"];\n};\n\nconst getBody = (request: http.IncomingMessage) => {\n\treturn new Promise((resolve) => {\n\t\tconst bodyParts: Buffer[] = [];\n\t\tlet body: string;\n\t\trequest\n\t\t\t.on(\"data\", (chunk) => {\n\t\t\t\tbodyParts.push(chunk);\n\t\t\t})\n\t\t\t.on(\"end\", () => {\n\t\t\t\tbody = Buffer.concat(bodyParts).toString();\n\t\t\t\ttry {\n\t\t\t\t\tresolve(JSON.parse(body));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger.error(\"Error parsing body\", {\n\t\t\t\t\t\tbodyLength: body.length,\n\t\t\t\t\t\tbodyPreview: body.substring(0, 100),\n\t\t\t\t\t\tcontentType: request.headers[\"content-type\"],\n\t\t\t\t\t\terror,\n\t\t\t\t\t});\n\t\t\t\t\tresolve(null);\n\t\t\t\t}\n\t\t\t});\n\t});\n};\n\n// Helper function to create JSON RPC error responses\nconst createJsonRpcErrorResponse = (code: number, message: string) => {\n\treturn JSON.stringify({\n\t\terror: { code, message },\n\t\tid: null,\n\t\tjsonrpc: \"2.0\",\n\t});\n};\n\n// Helper function to handle Response errors and send appropriate HTTP response\nconst handleResponseError = (\n\terror: unknown,\n\tres: http.ServerResponse,\n): boolean => {\n\tif (error instanceof Response) {\n\t\tconst fixedHeaders: http.OutgoingHttpHeaders = {};\n\t\terror.headers.forEach((value, key) => {\n\t\t\tif (fixedHeaders[key]) {\n\t\t\t\tif (Array.isArray(fixedHeaders[key])) {\n\t\t\t\t\t(fixedHeaders[key] as string[]).push(value);\n\t\t\t\t} else {\n\t\t\t\t\tfixedHeaders[key] = [fixedHeaders[key] as string, value];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfixedHeaders[key] = value;\n\t\t\t}\n\t\t});\n\t\tres\n\t\t\t.writeHead(error.status, error.statusText, fixedHeaders)\n\t\t\t.end(error.statusText);\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n// Helper function to clean up server resources\nconst cleanupServer = async <T extends ServerLike>(\n\tserver: T,\n\tonClose?: (server: T) => Promise<void>,\n) => {\n\tif (onClose) {\n\t\tawait onClose(server);\n\t}\n\n\ttry {\n\t\tawait server.close();\n\t} catch (error) {\n\t\tlogger.error(\"Error closing server\", { error, serverType: typeof server });\n\t}\n};\n\nconst handleStreamRequest = async <T extends ServerLike>({\n\tactiveTransports,\n\tcreateServer,\n\tenableJsonResponse,\n\tendpoint,\n\teventStore,\n\tonClose,\n\tonConnect,\n\treq,\n\tres,\n\tstateless,\n}: {\n\tactiveTransports: Record<\n\t\tstring,\n\t\t{ server: T; transport: StreamableHTTPServerTransport }\n\t>;\n\tcreateServer: (request: http.IncomingMessage) => Promise<T>;\n\tenableJsonResponse?: boolean;\n\tendpoint: string;\n\teventStore?: EventStore;\n\tonClose?: (server: T) => Promise<void>;\n\tonConnect?: (server: T) => Promise<void>;\n\treq: http.IncomingMessage;\n\tres: http.ServerResponse;\n\tstateless?: boolean;\n}) => {\n\tif (\n\t\treq.method === \"POST\" &&\n\t\tnew URL(req.url as string, \"http://localhost\").pathname === endpoint\n\t) {\n\t\ttry {\n\t\t\tconst sessionId = Array.isArray(req.headers[\"mcp-session-id\"])\n\t\t\t\t? req.headers[\"mcp-session-id\"][0]\n\t\t\t\t: req.headers[\"mcp-session-id\"];\n\n\t\t\tlet transport: StreamableHTTPServerTransport;\n\n\t\t\tlet server: T;\n\n\t\t\tconst body = await getBody(req);\n\n\t\t\tif (sessionId) {\n\t\t\t\tconst activeTransport = activeTransports[sessionId];\n\t\t\t\tif (!activeTransport) {\n\t\t\t\t\tres.setHeader(\"Content-Type\", \"application/json\");\n\t\t\t\t\tres\n\t\t\t\t\t\t.writeHead(404)\n\t\t\t\t\t\t.end(createJsonRpcErrorResponse(-32001, \"Session not found\"));\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\ttransport = activeTransport.transport;\n\t\t\t\tserver = activeTransport.server;\n\t\t\t} else if (!sessionId && isInitializeRequest(body)) {\n\t\t\t\t// Create a new transport for the session\n\t\t\t\ttransport = new StreamableHTTPServerTransport({\n\t\t\t\t\tenableJsonResponse,\n\t\t\t\t\teventStore: eventStore || new InMemoryEventStore(),\n\t\t\t\t\tonsessioninitialized: (_sessionId) => {\n\t\t\t\t\t\t// add only when the id Session id is generated (skip in stateless mode)\n\t\t\t\t\t\tif (!stateless && _sessionId) {\n\t\t\t\t\t\t\tactiveTransports[_sessionId] = {\n\t\t\t\t\t\t\t\tserver,\n\t\t\t\t\t\t\t\ttransport,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tsessionIdGenerator: stateless ? undefined : randomUUID,\n\t\t\t\t});\n\n\t\t\t\t// Handle the server close event\n\t\t\t\tlet isCleaningUp = false;\n\n\t\t\t\ttransport.onclose = async () => {\n\t\t\t\t\tconst sid = transport.sessionId;\n\n\t\t\t\t\tif (isCleaningUp) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisCleaningUp = true;\n\n\t\t\t\t\tif (!stateless && sid && activeTransports[sid]) {\n\t\t\t\t\t\tawait cleanupServer(server, onClose);\n\t\t\t\t\t\tdelete activeTransports[sid];\n\t\t\t\t\t} else if (stateless) {\n\t\t\t\t\t\t// In stateless mode, always call onClose when transport closes\n\t\t\t\t\t\tawait cleanupServer(server, onClose);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\ttry {\n\t\t\t\t\tserver = await createServer(req);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (handleResponseError(error, res)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tres.writeHead(500).end(\"Error creating server\");\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tserver.connect(transport);\n\n\t\t\t\tif (onConnect) {\n\t\t\t\t\tawait onConnect(server);\n\t\t\t\t}\n\n\t\t\t\tawait transport.handleRequest(req, res, body);\n\n\t\t\t\treturn true;\n\t\t\t} else if (stateless && !sessionId && !isInitializeRequest(body)) {\n\t\t\t\t// In stateless mode, handle non-initialize requests by creating a new transport\n\t\t\t\ttransport = new StreamableHTTPServerTransport({\n\t\t\t\t\tenableJsonResponse,\n\t\t\t\t\teventStore: eventStore || new InMemoryEventStore(),\n\t\t\t\t\tonsessioninitialized: () => {\n\t\t\t\t\t\t// No session tracking in stateless mode\n\t\t\t\t\t},\n\t\t\t\t\tsessionIdGenerator: undefined,\n\t\t\t\t});\n\n\t\t\t\ttry {\n\t\t\t\t\tserver = await createServer(req);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (handleResponseError(error, res)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tres.writeHead(500).end(\"Error creating server\");\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tserver.connect(transport);\n\n\t\t\t\tif (onConnect) {\n\t\t\t\t\tawait onConnect(server);\n\t\t\t\t}\n\n\t\t\t\tawait transport.handleRequest(req, res, body);\n\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// Error if the server is not created but the request is not an initialize request\n\t\t\t\tres.setHeader(\"Content-Type\", \"application/json\");\n\n\t\t\t\tres\n\t\t\t\t\t.writeHead(400)\n\t\t\t\t\t.end(\n\t\t\t\t\t\tcreateJsonRpcErrorResponse(\n\t\t\t\t\t\t\t-32000,\n\t\t\t\t\t\t\t\"Bad Request: No valid session ID provided\",\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Handle the request if the server is already created\n\t\t\tawait transport.handleRequest(req, res, body);\n\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tlogger.error(\"Error handling request\", { error });\n\n\t\t\tres.setHeader(\"Content-Type\", \"application/json\");\n\n\t\t\tres\n\t\t\t\t.writeHead(500)\n\t\t\t\t.end(createJsonRpcErrorResponse(-32603, \"Internal Server Error\"));\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (\n\t\treq.method === \"GET\" &&\n\t\tnew URL(req.url as string, \"http://localhost\").pathname === endpoint\n\t) {\n\t\tconst sessionId = req.headers[\"mcp-session-id\"] as string | undefined;\n\t\tconst activeTransport:\n\t\t\t| {\n\t\t\t\t\tserver: T;\n\t\t\t\t\ttransport: StreamableHTTPServerTransport;\n\t\t\t }\n\t\t\t| undefined = sessionId ? activeTransports[sessionId] : undefined;\n\n\t\tif (!sessionId) {\n\t\t\tres.writeHead(400).end(\"No sessionId\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!activeTransport) {\n\t\t\tres.writeHead(400).end(\"No active transport\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\tconst lastEventId = req.headers[\"last-event-id\"] as string | undefined;\n\n\t\tif (lastEventId) {\n\t\t\tlogger.info(\"Client reconnecting with Last-Event-ID for session\", { lastEventId, sessionId });\n\t\t} else {\n\t\t\tlogger.info(\"Establishing new SSE stream for session\", { sessionId });\n\t\t}\n\n\t\tawait activeTransport.transport.handleRequest(req, res);\n\n\t\treturn true;\n\t}\n\n\tif (\n\t\treq.method === \"DELETE\" &&\n\t\tnew URL(req.url as string, \"http://localhost\").pathname === endpoint\n\t) {\n\t\tlogger.info(\"Received delete request\");\n\n\t\tconst sessionId = req.headers[\"mcp-session-id\"] as string | undefined;\n\n\t\tif (!sessionId) {\n\t\t\tres.writeHead(400).end(\"Invalid or missing sessionId\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\tlogger.info(\"Received delete request for session\", { sessionId });\n\n\t\tconst activeTransport = activeTransports[sessionId];\n\n\t\tif (!activeTransport) {\n\t\t\tres.writeHead(400).end(\"No active transport\");\n\t\t\treturn true;\n\t\t}\n\n\t\ttry {\n\t\t\tawait activeTransport.transport.handleRequest(req, res);\n\n\t\t\tawait cleanupServer(activeTransport.server, onClose);\n\t\t} catch (error) {\n\t\t\tlogger.error(\"Error handling delete request\", { error });\n\n\t\t\tres.writeHead(500).end(\"Error handling delete request\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nconst handleSSERequest = async <T extends ServerLike>({\n\tactiveTransports,\n\tcreateServer,\n\tendpoint,\n\tonClose,\n\tonConnect,\n\treq,\n\tres,\n}: {\n\tactiveTransports: Record<string, SSEServerTransport>;\n\tcreateServer: (request: http.IncomingMessage) => Promise<T>;\n\tendpoint: string;\n\tonClose?: (server: T) => Promise<void>;\n\tonConnect?: (server: T) => Promise<void>;\n\treq: http.IncomingMessage;\n\tres: http.ServerResponse;\n}) => {\n\tif (\n\t\treq.method === \"GET\" &&\n\t\tnew URL(req.url as string, \"http://localhost\").pathname === endpoint\n\t) {\n\t\tconst transport = new SSEServerTransport(\"/messages\", res);\n\n\t\tlet server: T;\n\n\t\ttry {\n\t\t\tserver = await createServer(req);\n\t\t} catch (error) {\n\t\t\tif (handleResponseError(error, res)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tres.writeHead(500).end(\"Error creating server\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\tactiveTransports[transport.sessionId] = transport;\n\n\t\tlet closed = false;\n\t\tlet isCleaningUp = false;\n\n\t\tres.on(\"close\", async () => {\n\t\t\tclosed = true;\n\n\t\t\t// Prevent recursive cleanup\n\t\t\tif (isCleaningUp) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tisCleaningUp = true;\n\t\t\tawait cleanupServer(server, onClose);\n\n\t\t\tdelete activeTransports[transport.sessionId];\n\t\t});\n\n\t\ttry {\n\t\t\tawait server.connect(transport);\n\n\t\t\tawait transport.send({\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tmethod: \"sse/connection\",\n\t\t\t\tparams: { message: \"SSE Connection established\" },\n\t\t\t});\n\n\t\t\tif (onConnect) {\n\t\t\t\tawait onConnect(server);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (!closed) {\n\t\t\t\tlogger.error(\"Error connecting to server\", { error });\n\n\t\t\t\tres.writeHead(500).end(\"Error connecting to server\");\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tif (req.method === \"POST\" && req.url?.startsWith(\"/messages\")) {\n\t\tconst sessionId = new URL(req.url, \"https://example.com\").searchParams.get(\n\t\t\t\"sessionId\",\n\t\t);\n\n\t\tif (!sessionId) {\n\t\t\tres.writeHead(400).end(\"No sessionId\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\tconst activeTransport: SSEServerTransport | undefined =\n\t\t\tactiveTransports[sessionId];\n\n\t\tif (!activeTransport) {\n\t\t\tres.writeHead(400).end(\"No active transport\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\tawait activeTransport.handlePostMessage(req, res);\n\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nexport const startHTTPServer = async <T extends ServerLike>({\n\tcreateServer,\n\tenableJsonResponse,\n\teventStore,\n\thost = \"::\",\n\tonClose,\n\tonConnect,\n\tonUnhandledRequest,\n\tport,\n\tsseEndpoint = \"/sse\",\n\tstateless,\n\tstreamEndpoint = \"/mcp\",\n}: {\n\tcreateServer: (request: http.IncomingMessage) => Promise<T>;\n\tenableJsonResponse?: boolean;\n\teventStore?: EventStore;\n\thost?: string;\n\tonClose?: (server: T) => Promise<void>;\n\tonConnect?: (server: T) => Promise<void>;\n\tonUnhandledRequest?: (\n\t\treq: http.IncomingMessage,\n\t\tres: http.ServerResponse,\n\t) => Promise<void>;\n\tport: number;\n\tsseEndpoint?: null | string;\n\tstateless?: boolean;\n\tstreamEndpoint?: null | string;\n}): Promise<SSEServer> => {\n\tconst activeSSETransports: Record<string, SSEServerTransport> = {};\n\n\tconst activeStreamTransports: Record<\n\t\tstring,\n\t\t{\n\t\t\tserver: T;\n\t\t\ttransport: StreamableHTTPServerTransport;\n\t\t}\n\t> = {};\n\n\t/**\n\t * @author https://dev.classmethod.jp/articles/mcp-sse/\n\t */\n\tconst httpServer = http.createServer(async (req, res) => {\n\t\t// Extract trace_id from W3C traceparent header for log correlation\n\t\t// Use request-scoped context to avoid race conditions between concurrent requests\n\t\tconst traceId = extractTraceIdFromHeaders(req.headers as Record<string, string>) ?? gatewayCorrelationId;\n\n\t\tawait runWithTraceContextAsync(traceId, async () => {\n\t\t\tif (req.headers.origin) {\n\t\t\t\ttry {\n\t\t\t\t\tconst origin = new URL(req.headers.origin);\n\n\t\t\t\t\tres.setHeader(\"Access-Control-Allow-Origin\", origin.origin);\n\t\t\t\t\tres.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n\t\t\t\t\tres.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST, OPTIONS\");\n\t\t\t\t\tres.setHeader(\"Access-Control-Allow-Headers\", \"*\");\n\t\t\t\t\tres.setHeader(\"Access-Control-Expose-Headers\", \"mcp-session-id\");\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger.error(\"Error parsing origin\", { error });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (req.method === \"OPTIONS\") {\n\t\t\t\tres.writeHead(204);\n\t\t\t\tres.end();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (req.method === \"GET\" && req.url === `/ping`) {\n\t\t\t\tres.writeHead(200).end(\"pong\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tsseEndpoint &&\n\t\t\t\t(await handleSSERequest({\n\t\t\t\t\tactiveTransports: activeSSETransports,\n\t\t\t\t\tcreateServer,\n\t\t\t\t\tendpoint: sseEndpoint,\n\t\t\t\t\tonClose,\n\t\t\t\t\tonConnect,\n\t\t\t\t\treq,\n\t\t\t\t\tres,\n\t\t\t\t}))\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tstreamEndpoint &&\n\t\t\t\t(await handleStreamRequest({\n\t\t\t\t\tactiveTransports: activeStreamTransports,\n\t\t\t\t\tcreateServer,\n\t\t\t\t\tenableJsonResponse,\n\t\t\t\t\tendpoint: streamEndpoint,\n\t\t\t\t\teventStore,\n\t\t\t\t\tonClose,\n\t\t\t\t\tonConnect,\n\t\t\t\t\treq,\n\t\t\t\t\tres,\n\t\t\t\t\tstateless,\n\t\t\t\t}))\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (onUnhandledRequest) {\n\t\t\t\tawait onUnhandledRequest(req, res);\n\t\t\t} else {\n\t\t\t\tres.writeHead(404).end();\n\t\t\t}\n\t\t});\n\t});\n\n\tawait new Promise((resolve) => {\n\t\thttpServer.listen(port, host, () => {\n\t\t\tresolve(undefined);\n\t\t});\n\t});\n\n\treturn {\n\t\tclose: async () => {\n\t\t\tfor (const transport of Object.values(activeSSETransports)) {\n\t\t\t\tawait transport.close();\n\t\t\t}\n\n\t\t\tfor (const transport of Object.values(activeStreamTransports)) {\n\t\t\t\tawait transport.transport.close();\n\t\t\t}\n\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\thttpServer.close((error) => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t};\n};\n","import { c as StdioListenRouter, i as installModernOnlyHandlers, o as serverIdentityOf, s as DEFAULT_MAX_SUBSCRIPTIONS, t as McpServer } from \"./mcp-DXXb3Vv3.mjs\";\nimport { F as carriesValidModernEnvelopeClaim, J as isJSONRPCErrorResponse, Q as isJSONRPCResultResponse, R as modernOnlyStrictRejection, X as isJSONRPCRequest, Y as isJSONRPCNotification, at as requestMetaOf, c as ReadBuffer, d as serializeMessage, ft as UnsupportedProtocolVersionError, it as hasEnvelopeClaim, mt as ProtocolErrorCode, ot as validateEnvelopeMeta, rt as envelopeClaimVersion, vt as SUPPORTED_MODERN_PROTOCOL_VERSIONS, y as setNegotiatedProtocolVersion } from \"./src-CX2iR2pK.mjs\";\nimport { process } from \"@modelcontextprotocol/server/_shims\";\n\n//#region src/server/stdio.ts\n/**\n* Server transport for stdio: this communicates with an MCP client by reading from the current process' `stdin` and writing to `stdout`.\n*\n* This transport is only available in Node.js environments.\n*\n* @example\n* ```ts source=\"./stdio.examples.ts#StdioServerTransport_basicUsage\"\n* const server = new McpServer({ name: 'my-server', version: '1.0.0' });\n* const transport = new StdioServerTransport();\n* await server.connect(transport);\n* ```\n*/\nvar StdioServerTransport = class {\n\t_readBuffer;\n\t_started = false;\n\t_closed = false;\n\tconstructor(_stdin = process.stdin, _stdout = process.stdout, options) {\n\t\tthis._stdin = _stdin;\n\t\tthis._stdout = _stdout;\n\t\tthis._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });\n\t}\n\tonclose;\n\tonerror;\n\tonmessage;\n\t_ondata = (chunk) => {\n\t\ttry {\n\t\t\tthis._readBuffer.append(chunk);\n\t\t\tthis.processReadBuffer();\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t\tthis.close().catch(() => {});\n\t\t}\n\t};\n\t_onerror = (error) => {\n\t\tthis.onerror?.(error);\n\t};\n\t_onstdouterror = (error) => {\n\t\tthis.onerror?.(error);\n\t\tthis.close().catch(() => {});\n\t};\n\t/**\n\t* Starts listening for messages on `stdin`.\n\t*/\n\tasync start() {\n\t\tif (this._started) throw new Error(\"StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.\");\n\t\tthis._started = true;\n\t\tthis._stdin.on(\"data\", this._ondata);\n\t\tthis._stdin.on(\"error\", this._onerror);\n\t\tthis._stdout.on(\"error\", this._onstdouterror);\n\t}\n\tprocessReadBuffer() {\n\t\twhile (true) try {\n\t\t\tconst message = this._readBuffer.readMessage();\n\t\t\tif (message === null) break;\n\t\t\tthis.onmessage?.(message);\n\t\t} catch (error) {\n\t\t\tthis.onerror?.(error);\n\t\t}\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tthis._stdin.off(\"data\", this._ondata);\n\t\tthis._stdin.off(\"error\", this._onerror);\n\t\tthis._stdout.off(\"error\", this._onstdouterror);\n\t\tif (this._stdin.listenerCount(\"data\") === 0) this._stdin.pause();\n\t\tthis._readBuffer.clear();\n\t\tthis.onclose?.();\n\t}\n\tsend(message) {\n\t\tif (this._closed) return Promise.reject(/* @__PURE__ */ new Error(\"StdioServerTransport is closed\"));\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst json = serializeMessage(message);\n\t\t\tlet settled = false;\n\t\t\tconst onError = (error) => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tthis._stdout.off(\"error\", onError);\n\t\t\t\tthis._stdout.off(\"drain\", onDrain);\n\t\t\t\treject(error);\n\t\t\t};\n\t\t\tconst onDrain = () => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tthis._stdout.off(\"error\", onError);\n\t\t\t\tthis._stdout.off(\"drain\", onDrain);\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\tthis._stdout.once(\"error\", onError);\n\t\t\tif (this._stdout.write(json)) {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tthis._stdout.off(\"error\", onError);\n\t\t\t\tresolve();\n\t\t\t} else if (!settled) this._stdout.once(\"drain\", onDrain);\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/server/serveStdio.ts\n/**\n* How long the probe-discard path waits for the probe instance to answer the\n* requests it was delivered before closing it. The wait normally settles as\n* soon as the DiscoverResult is handed to the wire (or immediately, when a\n* delivered cancellation already settled the probe); the bound is a backstop\n* so no edge can ever hold the connection's inbound pump indefinitely behind\n* the discard.\n*/\nconst DISCARD_ANSWER_TIMEOUT_MS = 3e3;\n/**\n* The transport a pinned instance is connected to: a thin channel that writes\n* through to the entry-owned wire transport and receives the messages the\n* entry forwards. The wire transport itself is never handed to an instance —\n* that is what lets the entry discard an optimistic probe instance (close the\n* channel) without tearing down the connection.\n*/\nvar StdioConnectionChannel = class {\n\tonclose;\n\tonerror;\n\tonmessage;\n\t_closed = false;\n\t/** Request ids the entry delivered to the instance that the instance has not yet answered. */\n\t_pendingRequests = /* @__PURE__ */ new Set();\n\t_drainWaiters = [];\n\tconstructor(_wire, _onInstanceClose, _outboundIntercept) {\n\t\tthis._wire = _wire;\n\t\tthis._onInstanceClose = _onInstanceClose;\n\t\tthis._outboundIntercept = _outboundIntercept;\n\t}\n\tasync start() {}\n\tasync send(message, options) {\n\t\tif (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {\n\t\t\tconst { id } = message;\n\t\t\tif (id !== void 0) this._settle(id);\n\t\t}\n\t\tif (this._closed) return;\n\t\tif (this._outboundIntercept?.(message) === \"handled\") return;\n\t\treturn this._wire.send(message, options);\n\t}\n\tsetProtocolVersion = (version) => {\n\t\tthis._wire.setProtocolVersion?.(version);\n\t};\n\t/** Forwards one inbound message to the connected instance. */\n\tdeliver(message, extra) {\n\t\tif (this._closed) return;\n\t\tif (isJSONRPCRequest(message)) this._pendingRequests.add(message.id);\n\t\telse if (isJSONRPCNotification(message) && message.method === \"notifications/cancelled\") {\n\t\t\tconst cancelledId = message.params?.requestId;\n\t\t\tif (cancelledId !== void 0) this._settle(cancelledId);\n\t\t}\n\t\tthis.onmessage?.(message, extra);\n\t}\n\t/**\n\t* Resolves once every request delivered to the instance has been answered\n\t* through {@linkcode send}, settled by a delivered cancellation, or the\n\t* channel has been closed and nothing further can be answered. The wait is\n\t* bounded by `timeoutMs` as a backstop so no edge can hold the caller\n\t* indefinitely; resolves `false` only when the bound elapsed with requests\n\t* still unanswered. Used by the probe-discard path so a probe request the\n\t* entry accepted is never silently dropped.\n\t*/\n\tasync whenRequestsAnswered(timeoutMs) {\n\t\tif (this._closed || this._pendingRequests.size === 0) return true;\n\t\treturn await new Promise((resolve) => {\n\t\t\tconst waiter = () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(true);\n\t\t\t};\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tthis._drainWaiters = this._drainWaiters.filter((pending) => pending !== waiter);\n\t\t\t\tresolve(false);\n\t\t\t}, timeoutMs);\n\t\t\tthis._drainWaiters.push(waiter);\n\t\t});\n\t}\n\tasync close() {\n\t\tif (this._closed) return;\n\t\tthis._closed = true;\n\t\tthis._pendingRequests.clear();\n\t\tthis._releaseDrainWaiters();\n\t\ttry {\n\t\t\tthis._onInstanceClose();\n\t\t} finally {\n\t\t\tthis.onclose?.();\n\t\t}\n\t}\n\t_settle(id) {\n\t\tthis._pendingRequests.delete(id);\n\t\tif (this._pendingRequests.size === 0) this._releaseDrainWaiters();\n\t}\n\t_releaseDrainWaiters() {\n\t\tconst waiters = this._drainWaiters;\n\t\tthis._drainWaiters = [];\n\t\tfor (const waiter of waiters) waiter();\n\t}\n};\n/**\n* Classifies one message of the opening exchange with the same body-primary\n* rules the HTTP entry applies per request: `initialize` is the legacy\n* handshake unless it carries a valid modern envelope claim; a present claim\n* is validated (never silently ignored); a claim-less message is 2025-era\n* traffic. There is no header layer on stdio, so the body is the only signal.\n*/\nfunction classifyOpeningMessage(message) {\n\tconst params = message.params;\n\tif (message.method === \"initialize\" && !carriesValidModernEnvelopeClaim(params)) {\n\t\tconst requestedVersion = params !== null && typeof params === \"object\" && typeof params.protocolVersion === \"string\" ? params.protocolVersion : void 0;\n\t\treturn {\n\t\t\tkind: \"legacy\",\n\t\t\treason: \"initialize\",\n\t\t\t...requestedVersion !== void 0 && { requestedVersion }\n\t\t};\n\t}\n\tif (!hasEnvelopeClaim(params)) return {\n\t\tkind: \"legacy\",\n\t\treason: \"no-claim\"\n\t};\n\tconst meta = requestMetaOf(params);\n\tconst firstIssue = (meta === void 0 ? [] : validateEnvelopeMeta(meta))[0];\n\tif (firstIssue !== void 0) return {\n\t\tkind: \"invalid-envelope\",\n\t\tissue: firstIssue\n\t};\n\tconst claimedVersion = envelopeClaimVersion(params);\n\tif (claimedVersion === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedVersion)) return {\n\t\tkind: \"unsupported-revision\",\n\t\trequested: claimedVersion ?? \"unknown\"\n\t};\n\treturn {\n\t\tkind: \"modern\",\n\t\trevision: claimedVersion,\n\t\tclassification: {\n\t\t\tera: \"modern\",\n\t\t\trevision: claimedVersion\n\t\t}\n\t};\n}\n/**\n* Serves MCP over stdio from a server factory, owning the era decision for\n* the connection: the opening exchange selects the era, ONE instance from the\n* factory is pinned for the connection lifetime, and everything after passes\n* straight through to it. See the module documentation for the opening rules.\n*\n* ```ts\n* import { serveStdio } from '@modelcontextprotocol/server/stdio';\n*\n* serveStdio(() => {\n* const server = new McpServer({ name: 'my-server', version: '1.0.0' }, { capabilities: { tools: {} } });\n* // register tools/resources/prompts once — the same factory serves both eras\n* return server;\n* });\n* ```\n*/\nfunction serveStdio(factory, options = {}) {\n\tconst legacyMode = options.legacy ?? \"serve\";\n\tconst wire = options.transport ?? new StdioServerTransport();\n\tlet state = { phase: \"opening\" };\n\t/** Channel currently being discarded (its close must not tear the connection down). */\n\tlet discarding;\n\tlet closing = false;\n\t/**\n\t* Whether the connection has been torn down (`handle.close()` or the wire\n\t* closing). The opening arms re-check this after every await: a close can\n\t* race factory construction, and the continuation must neither resurrect\n\t* the connection state nor keep a late-resolved instance around.\n\t*/\n\tconst isTornDown = () => closing || state.phase === \"closed\";\n\tconst reportError = (error) => {\n\t\ttry {\n\t\t\toptions.onerror?.(error);\n\t\t} catch {}\n\t};\n\tconst writeErrorResponse = (id, code, message, data) => wire.send({\n\t\tjsonrpc: \"2.0\",\n\t\tid,\n\t\terror: {\n\t\t\tcode,\n\t\t\tmessage,\n\t\t\t...data !== void 0 && { data }\n\t\t}\n\t}).catch((error) => reportError(toError(error)));\n\t/**\n\t* Entry-handled `subscriptions/listen` for this connection: holds the\n\t* active subscriptions, serves inbound listen / cancelled-of-listen\n\t* before the pinned instance is consulted, and rewrites the instance's\n\t* outbound change notifications onto the active subscriptions. Only\n\t* consulted on a modern-pinned connection — on a legacy connection\n\t* change notifications pass straight through (the 2025 unsolicited\n\t* delivery model is unchanged).\n\t*/\n\tconst listenRouter = new StdioListenRouter(options.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS);\n\t/** Outbound intercept installed on a modern instance's channel. */\n\tconst modernOutboundIntercept = (message) => {\n\t\tif (!isJSONRPCNotification(message)) return void 0;\n\t\tconst routed = listenRouter.routeOutbound(message);\n\t\tif (routed === \"passthrough\") return void 0;\n\t\tfor (const stamped of routed) wire.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\t...stamped\n\t\t}).catch((error) => reportError(toError(error)));\n\t\treturn \"handled\";\n\t};\n\t/**\n\t* Entry-handled inbound listen routing for a modern-pinned connection.\n\t* Returns `true` when the message was served at the entry and must NOT\n\t* be delivered to the pinned instance.\n\t*/\n\tconst tryServeListen = async (message) => {\n\t\tif (isJSONRPCRequest(message) && message.method === \"subscriptions/listen\") {\n\t\t\tconst meta = requestMetaOf(message.params);\n\t\t\tconst issue = hasEnvelopeClaim(message.params) ? (meta === void 0 ? [] : validateEnvelopeMeta(meta))[0] : {\n\t\t\t\tkey: \"_meta\",\n\t\t\t\tproblem: \"the per-request envelope is required on protocol revision 2026-07-28\"\n\t\t\t};\n\t\t\tconst claimedVersion = envelopeClaimVersion(message.params);\n\t\t\tlet reply;\n\t\t\tif (issue !== void 0) reply = {\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tid: message.id,\n\t\t\t\terror: {\n\t\t\t\t\tcode: -32602,\n\t\t\t\t\tmessage: `Invalid _meta envelope: ${issue.key}: ${issue.problem}`\n\t\t\t\t}\n\t\t\t};\n\t\t\telse if (claimedVersion === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedVersion)) {\n\t\t\t\tconst error = new UnsupportedProtocolVersionError({\n\t\t\t\t\tsupported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],\n\t\t\t\t\trequested: claimedVersion ?? \"unknown\"\n\t\t\t\t});\n\t\t\t\treply = {\n\t\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\t\tid: message.id,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: error.code,\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t\tdata: error.data\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} else reply = listenRouter.serve(message);\n\t\t\tawait wire.send(\"error\" in reply ? reply : {\n\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\tmethod: reply.method,\n\t\t\t\tparams: reply.params\n\t\t\t}).catch((error) => reportError(toError(error)));\n\t\t\treturn true;\n\t\t}\n\t\tif (isJSONRPCNotification(message) && message.method === \"notifications/cancelled\") {\n\t\t\tconst cancelledId = message.params?.requestId;\n\t\t\tif (cancelledId !== void 0 && listenRouter.cancel(cancelledId)) return true;\n\t\t}\n\t\treturn false;\n\t};\n\t/** Answers a 2025-era request the entry will not serve (the modern-only rejection cells). */\n\tconst answerLegacyRejection = (request, reason, requestedVersion) => {\n\t\tconst rejection = modernOnlyStrictRejection({\n\t\t\tkind: \"legacy\",\n\t\t\treason,\n\t\t\t...requestedVersion !== void 0 && { requestedVersion }\n\t\t}, SUPPORTED_MODERN_PROTOCOL_VERSIONS);\n\t\tif (rejection === void 0) return Promise.resolve();\n\t\treportError(/* @__PURE__ */ new Error(`Rejected 2025-era request on a modern-only stdio connection (${rejection.cell}): ${rejection.message}`));\n\t\treturn writeErrorResponse(request.id, rejection.code, rejection.message, rejection.data);\n\t};\n\tconst onInstanceClosed = (channel) => {\n\t\tif (closing || channel === discarding) return;\n\t\tcloseAll();\n\t};\n\tconst connectInstance = async (era, revision) => {\n\t\tconst product = await factory({ era });\n\t\tconst server = product instanceof McpServer ? product.server : product;\n\t\tif (era === \"modern\") {\n\t\t\tsetNegotiatedProtocolVersion(server, revision);\n\t\t\tinstallModernOnlyHandlers(server, SUPPORTED_MODERN_PROTOCOL_VERSIONS);\n\t\t\tlistenRouter.setServerCapabilities(server.getCapabilities(), serverIdentityOf(server));\n\t\t}\n\t\tconst channel = new StdioConnectionChannel(wire, () => onInstanceClosed(channel), era === \"modern\" ? modernOutboundIntercept : void 0);\n\t\tawait product.connect(channel);\n\t\treturn {\n\t\t\tproduct,\n\t\t\tchannel\n\t\t};\n\t};\n\t/** Closes an instance whose factory resolved only after the connection was torn down. */\n\tconst disposeLateInstance = (instance) => instance.product.close().catch((error) => reportError(toError(error)));\n\tconst discardProbeInstance = async (instance) => {\n\t\tdiscarding = instance.channel;\n\t\ttry {\n\t\t\tif (!await instance.channel.whenRequestsAnswered(DISCARD_ANSWER_TIMEOUT_MS)) reportError(/* @__PURE__ */ new Error(`Discarded the probe instance with requests still unanswered after ${DISCARD_ANSWER_TIMEOUT_MS}ms; continuing with the fallback`));\n\t\t\tawait instance.product.close();\n\t\t} catch (error) {\n\t\t\treportError(toError(error));\n\t\t} finally {\n\t\t\tdiscarding = void 0;\n\t\t}\n\t};\n\tconst processMessage = async (message) => {\n\t\tif (state.phase === \"closed\") return;\n\t\tif (state.phase === \"pinned\") {\n\t\t\tif (state.era === \"modern\" && isJSONRPCRequest(message) && message.method === \"initialize\" && !carriesValidModernEnvelopeClaim(message.params)) {\n\t\t\t\tawait answerLegacyRejection(message, \"initialize\", message.params !== null && typeof message.params === \"object\" && typeof message.params.protocolVersion === \"string\" ? message.params.protocolVersion : void 0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (state.era === \"modern\" && await tryServeListen(message)) return;\n\t\t\tstate.instance.channel.deliver(message);\n\t\t\treturn;\n\t\t}\n\t\tif (!isJSONRPCRequest(message) && !isJSONRPCNotification(message)) {\n\t\t\treportError(/* @__PURE__ */ new Error(\"Discarded a JSON-RPC response received before the connection negotiated an era\"));\n\t\t\treturn;\n\t\t}\n\t\tconst opening = classifyOpeningMessage(message);\n\t\tswitch (opening.kind) {\n\t\t\tcase \"invalid-envelope\": {\n\t\t\t\tconst detail = `Invalid _meta envelope for protocol revision 2026-07-28: ${opening.issue.key}: ${opening.issue.problem}`;\n\t\t\t\tif (isJSONRPCRequest(message)) await writeErrorResponse(message.id, ProtocolErrorCode.InvalidParams, detail, { envelope: opening.issue });\n\t\t\t\telse reportError(/* @__PURE__ */ new Error(`Discarded a notification with a malformed envelope: ${detail}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"unsupported-revision\":\n\t\t\t\tif (isJSONRPCRequest(message)) {\n\t\t\t\t\tconst error = new UnsupportedProtocolVersionError({\n\t\t\t\t\t\tsupported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],\n\t\t\t\t\t\trequested: opening.requested\n\t\t\t\t\t});\n\t\t\t\t\treportError(error);\n\t\t\t\t\tawait writeErrorResponse(message.id, error.code, error.message, error.data);\n\t\t\t\t} else reportError(/* @__PURE__ */ new Error(`Discarded a notification claiming unsupported protocol revision ${opening.requested}`));\n\t\t\t\treturn;\n\t\t\tcase \"modern\":\n\t\t\t\tif (isJSONRPCRequest(message) && message.method === \"server/discover\") {\n\t\t\t\t\tif (state.phase === \"probe\") {\n\t\t\t\t\t\tstate.instance.channel.deliver(message, { classification: opening.classification });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst instance = await connectInstance(\"modern\", opening.revision);\n\t\t\t\t\tif (isTornDown()) {\n\t\t\t\t\t\tawait disposeLateInstance(instance);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tstate = {\n\t\t\t\t\t\tphase: \"probe\",\n\t\t\t\t\t\tinstance\n\t\t\t\t\t};\n\t\t\t\t\tinstance.channel.deliver(message, { classification: opening.classification });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (state.phase === \"probe\") {\n\t\t\t\t\tif (isJSONRPCNotification(message)) {\n\t\t\t\t\t\tstate.instance.channel.deliver(message, { classification: opening.classification });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tstate = {\n\t\t\t\t\t\tphase: \"pinned\",\n\t\t\t\t\t\tera: \"modern\",\n\t\t\t\t\t\tinstance: state.instance\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tconst instance = await connectInstance(\"modern\", opening.revision);\n\t\t\t\t\tif (isTornDown()) {\n\t\t\t\t\t\tawait disposeLateInstance(instance);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tstate = {\n\t\t\t\t\t\tphase: \"pinned\",\n\t\t\t\t\t\tera: \"modern\",\n\t\t\t\t\t\tinstance\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (await tryServeListen(message)) return;\n\t\t\t\tstate.instance.channel.deliver(message, { classification: opening.classification });\n\t\t\t\treturn;\n\t\t\tcase \"legacy\": {\n\t\t\t\tif (legacyMode === \"reject\") {\n\t\t\t\t\tif (isJSONRPCRequest(message)) await answerLegacyRejection(message, opening.reason, opening.requestedVersion);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (state.phase === \"probe\") {\n\t\t\t\t\tawait discardProbeInstance(state.instance);\n\t\t\t\t\tif (isTornDown()) return;\n\t\t\t\t\tstate = { phase: \"opening\" };\n\t\t\t\t}\n\t\t\t\tconst instance = await connectInstance(\"legacy\");\n\t\t\t\tif (isTornDown()) {\n\t\t\t\t\tawait disposeLateInstance(instance);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tstate = {\n\t\t\t\t\tphase: \"pinned\",\n\t\t\t\t\tera: \"legacy\",\n\t\t\t\t\tinstance\n\t\t\t\t};\n\t\t\t\tstate.instance.channel.deliver(message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\tconst queue = [];\n\tlet pumping = false;\n\tconst pump = async () => {\n\t\tif (pumping) return;\n\t\tpumping = true;\n\t\ttry {\n\t\t\twhile (queue.length > 0) {\n\t\t\t\tconst message = queue.shift();\n\t\t\t\ttry {\n\t\t\t\t\tawait processMessage(message);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (isJSONRPCRequest(message)) await writeErrorResponse(message.id, ProtocolErrorCode.InternalError, \"Internal server error\");\n\t\t\t\t\treportError(toError(error));\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tpumping = false;\n\t\t}\n\t};\n\tconst closeAll = async () => {\n\t\tif (closing || state.phase === \"closed\") return;\n\t\tclosing = true;\n\t\tconst current = state;\n\t\tstate = { phase: \"closed\" };\n\t\tfor (const result of listenRouter.teardownAll()) await wire.send(result).catch((error) => reportError(toError(error)));\n\t\tif (current.phase === \"probe\" || current.phase === \"pinned\") await current.instance.product.close().catch((error) => reportError(toError(error)));\n\t\tawait wire.close().catch((error) => reportError(toError(error)));\n\t};\n\twire.onmessage = (message) => {\n\t\tqueue.push(message);\n\t\tpump();\n\t};\n\twire.onerror = (error) => {\n\t\treportError(error);\n\t\tif (state.phase === \"probe\" || state.phase === \"pinned\") state.instance.channel.onerror?.(error);\n\t};\n\twire.onclose = () => {\n\t\tif (closing || state.phase === \"closed\") return;\n\t\tclosing = true;\n\t\tconst current = state;\n\t\tstate = { phase: \"closed\" };\n\t\tif (current.phase === \"probe\" || current.phase === \"pinned\") current.instance.product.close().catch((error) => reportError(toError(error)));\n\t};\n\tconst started = wire.start().catch((error) => {\n\t\treportError(toError(error));\n\t\tthrow error;\n\t});\n\tstarted.catch(() => {});\n\treturn { close: async () => {\n\t\tawait started.catch(() => {});\n\t\tawait closeAll();\n\t} };\n}\nfunction toError(value) {\n\treturn value instanceof Error ? value : new Error(String(value));\n}\n\n//#endregion\nexport { StdioServerTransport, serveStdio };\n//# sourceMappingURL=stdio.mjs.map","/**\n * Protocol-era negotiation policy for the gateway's UPSTREAM client.\n *\n * MCP has two wire eras: the handshake era (revisions 2024-11-05 … 2025-11-25,\n * opened by `initialize`) and the modern era (2026-07-28, which deleted\n * `initialize` — sessions open with a `server/discover` probe and every request\n * carries the negotiated version in `params._meta`). The gateway must be able\n * to wrap upstreams of EITHER era, so its client negotiates with the SDK's\n * `auto` mode: probe `server/discover` at connect, adopt the newest mutual era\n * on definitive modern evidence, and fall back to the plain `initialize`\n * handshake otherwise (an error/refusal of the probe classifies the upstream\n * as \"simply a legacy server\").\n *\n * Consequences of `auto`, measured against real servers and the crafted\n * fixtures in `mcp-gateway-tests/fixtures/era/`:\n *\n * - A handshake-only upstream is functionally unaffected: it refuses the\n * probe and the handshake proceeds. On stdio the probe runs IN PLACE on\n * the session pipe (the gateway's `StdioClientTransport` is a custom\n * `Transport`, not the SDK base class, so the SDK's disposable-sibling\n * spawn does not apply) and the fallback `initialize` follows on the same\n * pipe. A pathological upstream that answers the probe with SILENCE costs\n * the probe timeout (the SDK's standard request timeout) before falling\n * back; one that EXITS on an unknown pre-initialize request cannot be\n * wrapped with negotiation on — the kill switch is the escape hatch.\n * - A modern-only upstream (no `initialize` at all) becomes wrappable — the\n * point of negotiating.\n * - A DUAL-era upstream is now driven over the modern era (newest mutual\n * revision), no longer the handshake. Capabilities the upstream exposes\n * only on its legacy lane (e.g. `resources/subscribe` on servers that\n * never registered the modern `subscriptions/listen`) derive as absent —\n * the gateway then simply does not advertise them downstream.\n *\n * All of it is gated on the same kill switch as leg-1 dual-era serving\n * (`ONYX_MCP_GATEWAY_SUPPORT_NEW_MCP_PROTOCOL`): with the switch off this\n * returns `undefined`, which the SDK defaults to `'legacy'` — byte-identical\n * to the pre-negotiation upstream wire (pinned by\n * `bin/legacyHandshake.regression.test.ts`).\n *\n * Every upstream client construction site MUST take its `versionNegotiation`\n * from here — initial connect, transport fallback, retry, and mid-session\n * reconnect all have to negotiate the same way, or a reconnect could silently\n * land in a different era than the session it replaces.\n */\n\nimport type { ClientOptions } from \"@modelcontextprotocol/client\";\n\nimport { config } from \"../config/env.js\";\n\nexport const upstreamVersionNegotiation = (): ClientOptions[\"versionNegotiation\"] =>\n config.supportNewMcpProtocol ? { mode: \"auto\" } : undefined;\n"],"x_google_ignoreList":[8,9,10,11,12,13,14,15,18],"mappings":"+rNAYA,IAAa,GAAb,KAAsD,CACpD,QAAkB,EAClB,OACE,IAAI,IAMN,MAAM,kBACJ,EACA,CACE,QAEe,CACjB,GAAI,CAAC,GAAe,CAAC,KAAK,OAAO,IAAI,EAAY,CAC/C,MAAO,GAIT,IAAM,EAAW,KAAK,uBAAuB,EAAY,CAEzD,GAAI,CAAC,EACH,MAAO,GAGT,IAAI,EAAiB,GAGf,EAAe,CAAC,GAAG,KAAK,OAAO,SAAS,CAAC,CAAC,MAAM,EAAG,IACvD,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