import { W as WidgetUsage, c as ConnectionFacts, S as ServerRequirements, H as HostCompatReport, d as HostCompatProfile, a as CompatProvenance, e as HostImageSupport } from '../types-CvzKKUsd.js'; export { b as CompatFinding, f as CompatFindingCode, g as CompatFindingSeverity, h as CompatLane, i as CompatLaneVerdict, C as CompatVerdict, I as ImagePlacement, j as ImageSourceSupport, k as WidgetCapabilityNeed, s as scanWidgetMeta, l as scanWidgetPermissionNames, m as scanWidgetSource } from '../types-CvzKKUsd.js'; import { j as McpAppsCapabilities, d as ModelVisibleMcpToolResults, h as McpToolResultImageRenderingPolicy } from '../types-HXAijHji.js'; import { S as SeededHostConfigInput } from '../empty-input-B9KwG3Aa.js'; import { z } from 'zod'; /** * Minimal tool shape the requirement derivation needs — a name plus the * optional `_meta` bag. Structural so callers can pass an MCP `ListToolsResult` * tool directly. */ interface HostCompatTool { name: string; _meta?: Record; } /** * Tools input for `deriveServerRequirements`. `toolsMetadata` mirrors the * inspector's connect-time metadata map (tool name → `_meta`); when present it * wins over an inline `tool._meta`. */ interface HostCompatToolsInput { tools: HostCompatTool[]; toolsMetadata?: Record>; } /** * Derive what a server demands of a host from its tools list (apps lane) + * optional widget-usage scan (L1) + connection facts (server lane). Pure — the * caller supplies the inputs (inspector hook, CLI, or API all gather them their * own way). */ declare function deriveServerRequirements(toolsData?: HostCompatToolsInput | null, widgetUsage?: WidgetUsage, connectionFacts?: ConnectionFacts): ServerRequirements; declare function evaluateHostCompat(requirements: ServerRequirements, profile: HostCompatProfile): HostCompatReport; type HostCompatEvaluation = { requirements: ServerRequirements; reports: HostCompatReport[]; }; /** Optional inputs that aren't the tools list. */ interface EvaluateAllHostsOptions { widgetUsage?: WidgetUsage; connectionFacts?: ConnectionFacts; /** * The tools list may be incomplete (e.g. pagination was capped before the * server ran out of tools). When true, a confident `works` can't be * justified — a later, unseen tool could declare a widget that breaks a host * — so every host that would read `works` is demoted to `unknown`, and an * unknown dimension records why. */ toolsTruncated?: boolean; } /** * Evaluate a server against a set of host profiles. The caller supplies the * profiles (the SDK ships the engine, not a fixed host catalog — a market-host * catalog comes in a follow-up so CLI/API/UI can share one). */ declare function evaluateAllHosts(toolsData: HostCompatToolsInput | null | undefined, profiles: HostCompatProfile[], options?: EvaluateAllHostsOptions): HostCompatEvaluation; type DocumentedCapabilityEvidence = { status: "supported" | "unsupported" | "limited"; mcpAppsEquivalent?: string; note?: string; }; type HostCompatibilityEvidence = { profileLabel: string; sourceUrl: string; sourceUpdatedAt: number; componentBridge: Record; toolDescriptorMeta: Record; toolAnnotations: Record; componentResourceMeta: Record; cspProperties: Record; hostProvidedToolResultMeta: Record; clientProvidedMeta: Record; deployment: { supportedUiStandards: string[]; productionAuthentication: string[]; developmentAuthentication: string[]; widgetHostPattern: string; oauthRedirectUris: Array<{ surface: string; uri: string; }>; entraSsoRedirectUris: Array<{ surface: string; uri: string; }>; minimumAgentsToolkitVersion: string; defaultToolDiscovery: string; notes: string[]; }; }; /** * The host-compat catalog facts as pure data. The live backend catalog is the * normal source of truth; the SDK carries a generated fallback snapshot for * offline/CLI/dev paths. */ type HostCatalogMetadata = { id: string; label: string; provenance: CompatProvenance; rendersMcpApps: boolean; /** * MCP base-protocol versions this host advertises. Omitted when the template * doesn't pin a version. */ supportedProtocolVersions?: string[]; /** When this host's facts were last verified (ms epoch). */ verifiedAt?: number; /** Tool-result image handling (see `HostImageSupport`). */ imageSupport?: HostImageSupport; /** Structured vendor-document evidence that does not shape execution. */ compatibilityEvidence?: HostCompatibilityEvidence; /** * Style variables per theme, for hosts that resolve their tokens and send * literals rather than `light-dark(…)`. The host config carries only the one * theme the emulated host announces, so the pair lives here; each side is * optional because a host may have been probed in a single theme. */ styleVariablesByTheme?: { light?: Record; dark?: Record; }; }; /** * One catalog host. Compare/display facts and the creation config live on the * same object. */ type HostCompatCatalogHost = HostCatalogMetadata & SeededHostConfigInput; /** * The catalog document served by the backend and proxied by the inspector. * `hostsById` is the single source of truth for each built-in host style. */ type HostCompatCatalog = { hostsById: Record; }; /** * The SDK's bundled fallback catalog. Generated from the backend seed during * release/build workflow; stale between releases by design. Deep-frozen and * shared so consumers cannot accidentally mutate process-wide fallback facts. */ declare function bundledHostCompatCatalog(): HostCompatCatalog; /** * Return a catalog whose `hostsById` entries are directly usable as full host * objects. `imageSupport` is a compare/display summary derived from the * concrete host-template image fields. */ declare function hydrateHostCompatCatalog(catalog: HostCompatCatalog): HostCompatCatalog; declare function getTemplateMcpAppsCapabilities(catalog: HostCompatCatalog, hostStyle: string): McpAppsCapabilities | undefined; declare function getCatalogHost(catalog: HostCompatCatalog, hostStyle: string): HostCompatCatalogHost | undefined; declare function getCatalogTemplate(catalog: HostCompatCatalog, hostStyle: string): SeededHostConfigInput | undefined; declare function getCatalogHosts(catalog: HostCompatCatalog): HostCompatCatalogHost[]; /** * Build host-compat profiles from a catalog document — the derivation half of * the data/engine split. Load-bearing semantics: * * - `rendersOpenAiApps` comes from the host object's * `mcpProfile.apps.compatRuntime.openaiApps`. * - `rendersWidgets = rendersMcpApps || rendersOpenAiApps`; the capability * matrix applies only when the host renders widgets at all, reading the * matrix from `hostsById[id].mcpProfile.apps.mcpAppsOverrides` and * defaulting to `MCP_APPS_NO_CLAIMS` when the template carries no matrix. * * Does not mutate or freeze the input catalog. */ declare function buildHostProfilesFromCatalog(catalog: HostCompatCatalog): HostCompatProfile[]; /** * Build the market-host compat profiles from the bundled fallback catalog. * The build runs once (cached); each call returns fresh copies so a caller * sorting the array or tweaking a profile can't change later evaluations. */ declare function buildMarketHostProfiles(): HostCompatProfile[]; interface EvaluateMarketHostsOptions extends EvaluateAllHostsOptions { /** * A live-fetched catalog to evaluate against instead of the bundled fallback. */ catalog?: HostCompatCatalog; } /** * Convenience: evaluate a server against the market-host catalog. Pass * `options.catalog` to use a live-fetched backend catalog. */ declare function evaluateMarketHosts(toolsData: HostCompatToolsInput | null | undefined, options?: EvaluateMarketHostsOptions): HostCompatEvaluation; declare function imageSupportToHostConfigFields(imageSupport: HostImageSupport): { modelVisibleMcpToolResults: ModelVisibleMcpToolResults; mcpToolResultImageRendering: McpToolResultImageRenderingPolicy; }; declare function hostConfigFieldsToImageSupport(hostConfig: { modelVisibleMcpToolResults?: ModelVisibleMcpToolResults; mcpToolResultImageRendering?: McpToolResultImageRenderingPolicy; }): HostImageSupport | undefined; /** * Zod schema for the host-compat catalog document + the envelope the backend * endpoint (`GET /public/host-catalog`, proxied at `/api/v1/host-catalog`) * serves. * * Forward-compat policy (schema skew: old SDK, newer catalog): * - Unknown object keys are stripped (Zod default) — the backend may add * fields within the current schema version without breaking older SDKs. * - Enum widening is absorbed rather than fatal: unknown display modes are * filtered out; an unknown `provenance` falls back to `assumed` (weakest * trust); an unknown `widgetDisplayModeRequests` reads as unset. * - Anything else unparseable fails the WHOLE parse — callers fall back to * the bundled catalog, never partially apply a fetched one. */ /** * The catalog document schema version this SDK understands. Additive backend * changes stay within this version (Zod strips unknown keys); a breaking * change bumps it, and an envelope carrying any other version fails the parse * below so the caller falls back to the bundled catalog rather than applying a * document it can't correctly interpret. */ declare const SUPPORTED_CATALOG_SCHEMA_VERSION = 2; declare const mcpAppsCapabilitiesSchema: z.ZodObject<{ availableDisplayModes: z.ZodPipe, z.ZodOptional>>>; toolInputPartial: z.ZodOptional; toolCancelled: z.ZodOptional; hostContextChanged: z.ZodOptional; resourceTeardown: z.ZodOptional; toolInfo: z.ZodOptional; openLinks: z.ZodOptional; serverTools: z.ZodOptional; serverResources: z.ZodOptional; logging: z.ZodOptional; updateModelContext: z.ZodOptional; message: z.ZodOptional; sandboxPermissions: z.ZodOptional; cspFrameDomains: z.ZodOptional; cspBaseUriDomains: z.ZodOptional; cspConnectDomains: z.ZodOptional; xhr: z.ZodOptional; websocket: z.ZodOptional; }, z.core.$strip>>; cspResourceDomains: z.ZodOptional; stylesheet: z.ZodOptional; image: z.ZodOptional; font: z.ZodOptional; media: z.ZodOptional; }, z.core.$strip>>; resourceCacheTtl: z.ZodOptional; toolResult: z.ZodOptional; content: z.ZodOptional; image: z.ZodOptional; audio: z.ZodOptional; resource: z.ZodOptional; resourceLink: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; resourcePrefersBorder: z.ZodOptional; downloadFile: z.ZodOptional; requestTeardown: z.ZodOptional; widgetDisplayModeRequests: z.ZodCatch>>; }, z.core.$strip>; declare const hostCompatCatalogSchema: z.ZodObject<{ hostsById: z.ZodRecord>; rendersMcpApps: z.ZodBoolean; supportedProtocolVersions: z.ZodOptional>; verifiedAt: z.ZodOptional; imageSupport: z.ZodOptional; embeddedResourceImages: z.ZodObject<{ model: z.ZodBoolean; ui: z.ZodBoolean; }, z.core.$strip>; resourceLinkImages: z.ZodObject<{ model: z.ZodBoolean; ui: z.ZodBoolean; }, z.core.$strip>; placement: z.ZodCatch>; }, z.core.$strip>>; compatibilityEvidence: z.ZodOptional; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; toolDescriptorMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; toolAnnotations: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; componentResourceMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; cspProperties: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; hostProvidedToolResultMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; clientProvidedMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; deployment: z.ZodObject<{ supportedUiStandards: z.ZodArray; productionAuthentication: z.ZodArray; developmentAuthentication: z.ZodArray; widgetHostPattern: z.ZodString; oauthRedirectUris: z.ZodArray>; entraSsoRedirectUris: z.ZodArray>; minimumAgentsToolkitVersion: z.ZodString; defaultToolDiscovery: z.ZodString; notes: z.ZodArray; }, z.core.$strip>; }, z.core.$strip>>; styleVariablesByTheme: z.ZodOptional>; dark: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodType>>>; }, z.core.$strip>; /** The wire envelope around a catalog document. `source` is annotated by the * serving proxy (`live` | `bundled`); absent when hitting Convex directly. */ declare const hostCompatCatalogEnvelopeSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<2>; version: z.ZodNumber; contentHash: z.ZodString; publishedAt: z.ZodNumber; catalog: z.ZodObject<{ hostsById: z.ZodRecord>; rendersMcpApps: z.ZodBoolean; supportedProtocolVersions: z.ZodOptional>; verifiedAt: z.ZodOptional; imageSupport: z.ZodOptional; embeddedResourceImages: z.ZodObject<{ model: z.ZodBoolean; ui: z.ZodBoolean; }, z.core.$strip>; resourceLinkImages: z.ZodObject<{ model: z.ZodBoolean; ui: z.ZodBoolean; }, z.core.$strip>; placement: z.ZodCatch>; }, z.core.$strip>>; compatibilityEvidence: z.ZodOptional; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; toolDescriptorMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; toolAnnotations: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; componentResourceMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; cspProperties: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; hostProvidedToolResultMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; clientProvidedMeta: z.ZodRecord; mcpAppsEquivalent: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>>; deployment: z.ZodObject<{ supportedUiStandards: z.ZodArray; productionAuthentication: z.ZodArray; developmentAuthentication: z.ZodArray; widgetHostPattern: z.ZodString; oauthRedirectUris: z.ZodArray>; entraSsoRedirectUris: z.ZodArray>; minimumAgentsToolkitVersion: z.ZodString; defaultToolDiscovery: z.ZodString; notes: z.ZodArray; }, z.core.$strip>; }, z.core.$strip>>; styleVariablesByTheme: z.ZodOptional>; dark: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodType>>>; }, z.core.$strip>; source: z.ZodOptional; }, z.core.$strip>; type HostCompatCatalogEnvelope = z.infer; /** * Fetch the live host-compat catalog from the platform API. Deliberately NOT * a `PlatformApiClient` method: the endpoint is unauthenticated public * metadata, and consumers (CLI `compat`, inspector client) must be able to * call it with zero credentials. Never throws — every failure collapses to a * `{ok: false, reason}` so callers fall back to `bundledHostCompatCatalog()`. */ type FetchHostCompatCatalogOptions = { /** API origin + version prefix. Defaults to the hosted production API. */ baseUrl?: string; /** Abort the request after this long. Default 3000ms. */ timeoutMs?: number; /** Injectable for tests / non-global-fetch runtimes. */ fetchImpl?: typeof fetch; }; type FetchHostCompatCatalogResult = { ok: true; catalog: HostCompatCatalog; version: number; contentHash: string; publishedAt: number; /** `live` | `bundled` from the serving proxy; defaults to `live`. */ source: string; } | { ok: false; /** * `network` = request failed outright; `timeout` = aborted at * `timeoutMs`; `unavailable` = non-2xx (e.g. 503 catalog-not-seeded); * `invalid` = body wasn't a parseable catalog envelope. */ reason: "network" | "timeout" | "invalid" | "unavailable"; }; declare function fetchHostCompatCatalog(options?: FetchHostCompatCatalogOptions): Promise; /** Full surface — every dimension on. Claude's baseline. */ declare const MCP_APPS_FULL: McpAppsCapabilities; /** Claude web — full bridge surface with probe-captured CSP behavior. */ declare const MCP_APPS_CLAUDE: McpAppsCapabilities; /** * ChatGPT — full bridge surface with probe-captured CSP behavior. * * `connect-src` is ONE directive, so its three subtypes cannot diverge. The * 2026-08-19 probe declared `wss://ws.postman-echo.com` and it connected while * the undeclared `wss://echo.websocket.org` took a real connect-src violation * — no host baseline carries a Postman echo endpoint, so ChatGPT honors the * declared connect list. The fetch/xhr canary that passed (`unpkg.com`) is in * ChatGPT's own baseline allowlist, which the catalog row carries as * `cspDirectives`; it is not evidence the declaration was ignored. * * The 2026-08-23 paired probe (captured 2026-08-24Z) declared * `fastly.jsdelivr.net`, outside that baseline, and every declared resource * subtype loaded in the treatment fixture, so the resource declaration is * honored. */ declare const MCP_APPS_CHATGPT: McpAppsCapabilities; /** Mistral Le Chat — Apps-side `ui/initialize` evidence (no pip / download / teardown). */ declare const MCP_APPS_MISTRAL: McpAppsCapabilities; /** Cursor 3.14.27 probe — full minus updateModelContext + message. */ declare const MCP_APPS_CURSOR: McpAppsCapabilities; /** Goose Desktop 1.38.0 capture — only openLinks (+ toolInfo) advertised. */ declare const MCP_APPS_GOOSE: McpAppsCapabilities; /** Microsoft 365 Copilot — published component-bridge table. */ declare const MCP_APPS_COPILOT: McpAppsCapabilities; /** Slackbot — probe-captured from Slackbot's `ui/initialize` (2026-06-24). No * updateModelContext / message / downloadFile; no pip. Mirrors the slack host * template's `mcpAppsOverrides` in `seed-host-template.ts`. */ declare const MCP_APPS_SLACK: McpAppsCapabilities; /** VS Code 1.130.0 — captured from a live VS Code MCP Apps host probe on * 2026-07-23. Advertises inline-only display, typed updateModelContext, * downloadFile, and host-context changes. Unexercised behavior deliberately * retains the existing emulator defaults. */ declare const MCP_APPS_VSCODE: McpAppsCapabilities; /** Spec-default "no claims" — every advertise key off. Fallback baseline. */ declare const MCP_APPS_NO_CLAIMS: McpAppsCapabilities; /** A resource read shaped like an MCP `resources/read` result. */ interface ReadResourceResult { contents?: Array<{ text?: string; blob?: string; _meta?: unknown; }>; } /** Injected `resources/read` — browser, Node, CLI, and API each supply theirs. */ type ReadResourceFn = (uri: string) => Promise; /** * L1 widget-usage scan for one server's tools — the shared contract behind the * inspector hook, the CLI, and the API. For each widget-bearing tool, reads its * UI resource via the injected `readResource`, then scans the HTML (+ the * resource's declared `_meta.ui`) for the host APIs it uses. * * Each widget URI is read once even when several tools share it; every tool * pointing at that widget inherits its needs. * * Returns `undefined` when the tools aren't loaded OR every read failed — the * load-bearing "unknown" the engine needs so it withholds capability findings * rather than guess. `{}` means "scanned, nothing notable used". */ declare function scanWidgetUsage(toolsData: HostCompatToolsInput | null | undefined, readResource: ReadResourceFn): Promise; /** * Narrow, host-compat-specific bridge detection from a tool's `_meta`. * * This is NOT canonical widget detection — it deliberately classifies only the * `_meta`-declared bridge (MCP Apps `ui.resourceUri` and/or OpenAI Apps * `openai/outputTemplate`), which is all the compat engine needs to bucket a * tool. It does NOT scan tool *results* for inline `ui://` resources; the * canonical detector that does lives in `@mcpjam/widget-react`. Named narrowly * so it can't be mistaken for general detection. */ /** The widget bridge a tool declares in its `_meta`. */ declare enum HostCompatBridge { /** MCP Apps only (`_meta.ui.resourceUri`). */ MCP_APPS = "mcp-apps", /** OpenAI Apps only (`openai/outputTemplate`). */ OPENAI_SDK = "openai-sdk", /** Declares both bridges. */ OPENAI_SDK_AND_MCP_APPS = "openai-sdk-and-mcp-apps" } declare function detectHostCompatBridgeFromMeta(toolMeta: Record | undefined): HostCompatBridge | null; export { CompatProvenance, ConnectionFacts, type DocumentedCapabilityEvidence, type EvaluateAllHostsOptions, type EvaluateMarketHostsOptions, type FetchHostCompatCatalogOptions, type FetchHostCompatCatalogResult, HostCompatBridge, type HostCompatCatalog, type HostCompatCatalogEnvelope, type HostCompatCatalogHost, type HostCompatEvaluation, HostCompatProfile, HostCompatReport, type HostCompatTool, type HostCompatToolsInput, type HostCompatibilityEvidence, HostImageSupport, MCP_APPS_CHATGPT, MCP_APPS_CLAUDE, MCP_APPS_COPILOT, MCP_APPS_CURSOR, MCP_APPS_FULL, MCP_APPS_GOOSE, MCP_APPS_MISTRAL, MCP_APPS_NO_CLAIMS, MCP_APPS_SLACK, MCP_APPS_VSCODE, type ReadResourceFn, type ReadResourceResult, SUPPORTED_CATALOG_SCHEMA_VERSION, ServerRequirements, WidgetUsage, buildHostProfilesFromCatalog, buildMarketHostProfiles, bundledHostCompatCatalog, deriveServerRequirements, detectHostCompatBridgeFromMeta, evaluateAllHosts, evaluateHostCompat, evaluateMarketHosts, fetchHostCompatCatalog, getCatalogHost, getCatalogHosts, getCatalogTemplate, getTemplateMcpAppsCapabilities, hostCompatCatalogEnvelopeSchema, hostCompatCatalogSchema, hostConfigFieldsToImageSupport, hydrateHostCompatCatalog, imageSupportToHostConfigFields, mcpAppsCapabilitiesSchema, scanWidgetUsage };