{"version":3,"file":"adapter.mjs","names":["compareText"],"sources":["../src/adapter-model.ts","../src/adapter-native-profile.ts","../src/adapter-validate.ts","../src/adapter-compatibility.ts","../src/adapter-negotiate.ts"],"sourcesContent":["/** Current serialized adapter-capability manifest format. */\nexport const ADAPTER_CAPABILITY_FORMAT_VERSION = 1 as const;\n\n/** Inclusive version range supported for one capability contract. */\nexport interface AdapterCapabilitySupport {\n  /** Stable capability identifier from an application marquette. */\n  readonly id: string;\n  /** Oldest supported capability contract version, inclusive. */\n  readonly minVersion: number;\n  /** Newest supported capability contract version, inclusive. */\n  readonly maxVersion: number;\n}\n\n/** Versioned, language-neutral capabilities offered by one adapter. */\nexport interface AdapterCapabilityManifest {\n  /**\n   * Serialized manifest format.\n   *\n   * @default 1\n   */\n  readonly formatVersion?: typeof ADAPTER_CAPABILITY_FORMAT_VERSION;\n  /** Stable adapter identifier shown in diagnostics and reports. */\n  readonly adapter: string;\n  /**\n   * Supported capability ranges.\n   *\n   * @default []\n   */\n  readonly capabilities?: readonly AdapterCapabilitySupport[];\n}\n\n/** Stable validation code for an adapter capability manifest. */\nexport type AdapterCapabilityDiagnosticCode =\n  | \"invalid-format-version\"\n  | \"invalid-adapter-id\"\n  | \"invalid-capability-id\"\n  | \"invalid-version\"\n  | \"invalid-version-range\"\n  | \"duplicate-capability\";\n\n/** Deterministic validation diagnostic for an adapter capability manifest. */\nexport interface AdapterCapabilityDiagnostic {\n  /** Stable machine-readable diagnostic code. */\n  readonly code: AdapterCapabilityDiagnosticCode;\n  /** JSON-style path of the invalid value. */\n  readonly path: string;\n  /** Human-readable explanation. */\n  readonly message: string;\n}\n\n/** Stable incompatibility code emitted during capability negotiation. */\nexport type AdapterCapabilityMismatchCode =\n  | \"unknown-requirement\"\n  | \"missing-capability\"\n  | \"version-below-minimum\"\n  | \"version-above-maximum\";\n\n/** One failed adapter capability requirement. */\nexport interface AdapterCapabilityMismatch {\n  /** Stable machine-readable mismatch code. */\n  readonly code: AdapterCapabilityMismatchCode;\n  /** Required capability identifier. */\n  readonly capability: string;\n  /** JSON-style path of the unsupported application capability requirement. */\n  readonly path: string;\n  /** Human-readable explanation with stable wording for renderer diagnostics. */\n  readonly message: string;\n  /** Required contract version when the capability is declared. */\n  readonly requiredVersion?: number;\n  /** Adapter minimum when support exists. */\n  readonly minVersion?: number;\n  /** Adapter maximum when support exists. */\n  readonly maxVersion?: number;\n}\n\n/** Deterministic result of negotiating requirements with one adapter. */\nexport interface AdapterCapabilityNegotiation {\n  /** Adapter whose support was inspected. */\n  readonly adapter: string;\n  /** Whether the manifest is valid and every requirement is supported. */\n  readonly compatible: boolean;\n  /** Manifest validation failures, in stable path order. */\n  readonly diagnostics: readonly AdapterCapabilityDiagnostic[];\n  /** Unsupported or unknown requirements, in stable capability order. */\n  readonly mismatches: readonly AdapterCapabilityMismatch[];\n}\n\n/** Compatibility classification for one adapter capability change. */\nexport type CompatibilityChangeKind = \"additive\" | \"breaking\";\n\n/** One stable adapter capability compatibility change. */\nexport interface AdapterCapabilityCompatibilityChange {\n  /** Compatibility classification. */\n  readonly kind: CompatibilityChangeKind;\n  /** JSON-style path of the changed capability support. */\n  readonly path: string;\n  /** Human-readable summary. */\n  readonly message: string;\n}\n\n/** Deterministic compatibility report between two adapter manifests. */\nexport interface AdapterCapabilityCompatibilityReport {\n  /** Validation failures in the previous manifest. */\n  readonly previousDiagnostics: readonly AdapterCapabilityDiagnostic[];\n  /** Validation failures in the next manifest. */\n  readonly nextDiagnostics: readonly AdapterCapabilityDiagnostic[];\n  /** All changes in stable path order. */\n  readonly changes: readonly AdapterCapabilityCompatibilityChange[];\n}\n","import type { AdapterCapabilitySupport } from \"./adapter-model.js\";\n\n/** Current contract version shared by the native-engine capability profile. */\nexport const NATIVE_ENGINE_CAPABILITY_VERSION = 1 as const;\n\n/** Closed set of capability identifiers required from a native rendering engine. */\nexport const NATIVE_ENGINE_CAPABILITY_IDS = [\n  \"native.rendering\",\n  \"native.events\",\n  \"native.layout\",\n  \"native.text\",\n  \"native.images\",\n  \"native.animation\",\n  \"native.accessibility\",\n  \"native.lifecycle\",\n] as const;\n\n/** One identifier from the canonical native-engine capability profile. */\nexport type NativeEngineCapabilityId = (typeof NATIVE_ENGINE_CAPABILITY_IDS)[number];\n\n/**\n * Creates the canonical version-one native-engine capability profile.\n *\n * A fresh list is returned so an adapter can extend its manifest without\n * mutating the shared profile seen by another consumer.\n */\nexport function nativeEngineCapabilityProfile(): readonly AdapterCapabilitySupport[] {\n  return NATIVE_ENGINE_CAPABILITY_IDS.map((id) => ({\n    id,\n    minVersion: NATIVE_ENGINE_CAPABILITY_VERSION,\n    maxVersion: NATIVE_ENGINE_CAPABILITY_VERSION,\n  }));\n}\n","import {\n  ADAPTER_CAPABILITY_FORMAT_VERSION,\n  type AdapterCapabilityDiagnostic,\n  type AdapterCapabilityDiagnosticCode,\n  type AdapterCapabilityManifest,\n} from \"./adapter-model.js\";\n\nconst IDENTIFIER = /^[a-z0-9][a-z0-9._-]*$/;\nconst DIAGNOSTIC_ORDER: Record<AdapterCapabilityDiagnosticCode, number> = {\n  \"invalid-format-version\": 0,\n  \"invalid-adapter-id\": 1,\n  \"invalid-capability-id\": 2,\n  \"invalid-version\": 3,\n  \"invalid-version-range\": 4,\n  \"duplicate-capability\": 5,\n};\n\n/** Validates an adapter capability manifest without mutating it. */\nexport function validateAdapterCapabilityManifest(\n  manifest: AdapterCapabilityManifest,\n): AdapterCapabilityDiagnostic[] {\n  const diagnostics: AdapterCapabilityDiagnostic[] = [];\n  if ((manifest.formatVersion ?? 1) !== ADAPTER_CAPABILITY_FORMAT_VERSION) {\n    diagnostics.push(\n      diagnostic(\n        \"invalid-format-version\",\n        \"formatVersion\",\n        \"unsupported adapter capability manifest format version\",\n      ),\n    );\n  }\n  if (!IDENTIFIER.test(manifest.adapter)) {\n    diagnostics.push(\n      diagnostic(\n        \"invalid-adapter-id\",\n        \"adapter\",\n        \"adapter must be a lowercase portable identifier\",\n      ),\n    );\n  }\n\n  const seen = new Set<string>();\n  for (const [index, capability] of (manifest.capabilities ?? []).entries()) {\n    const path = `capabilities.${index}`;\n    if (!IDENTIFIER.test(capability.id)) {\n      diagnostics.push(\n        diagnostic(\n          \"invalid-capability-id\",\n          `${path}.id`,\n          \"capability id must be a lowercase portable identifier\",\n        ),\n      );\n    }\n    if (seen.has(capability.id)) {\n      diagnostics.push(\n        diagnostic(\n          \"duplicate-capability\",\n          `${path}.id`,\n          \"capability id must be unique within the adapter manifest\",\n        ),\n      );\n    }\n    seen.add(capability.id);\n    if (capability.minVersion <= 0) {\n      diagnostics.push(\n        diagnostic(\n          \"invalid-version\",\n          `${path}.minVersion`,\n          \"minimum supported version must be greater than zero\",\n        ),\n      );\n    }\n    if (capability.maxVersion <= 0) {\n      diagnostics.push(\n        diagnostic(\n          \"invalid-version\",\n          `${path}.maxVersion`,\n          \"maximum supported version must be greater than zero\",\n        ),\n      );\n    }\n    if (capability.minVersion > capability.maxVersion) {\n      diagnostics.push(\n        diagnostic(\n          \"invalid-version-range\",\n          path,\n          \"minimum supported version must not exceed maximum supported version\",\n        ),\n      );\n    }\n  }\n\n  return diagnostics.sort(\n    (left, right) =>\n      compareText(left.path, right.path) ||\n      DIAGNOSTIC_ORDER[left.code] - DIAGNOSTIC_ORDER[right.code] ||\n      compareText(left.message, right.message),\n  );\n}\n\n/**\n * Parses an untrusted manifest with strict field and primitive checks.\n *\n * Unknown fields, missing required fields, and mismatched primitive types\n * throw before negotiation. Semantic range errors remain available from\n * {@link validateAdapterCapabilityManifest}.\n */\nexport function parseAdapterCapabilityManifest(value: unknown): AdapterCapabilityManifest {\n  assertRecord(value, \"manifest\");\n  assertKnownFields(value, [\"formatVersion\", \"adapter\", \"capabilities\"], \"manifest\");\n  if (value.formatVersion !== undefined && typeof value.formatVersion !== \"number\") {\n    throw new TypeError(\"formatVersion must be a number\");\n  }\n  if (typeof value.adapter !== \"string\") {\n    throw new TypeError(\"adapter must be a string\");\n  }\n  if (value.capabilities !== undefined) {\n    if (!Array.isArray(value.capabilities)) {\n      throw new TypeError(\"capabilities must be an array\");\n    }\n    for (const [index, capability] of value.capabilities.entries()) {\n      const path = `capabilities.${index}`;\n      assertRecord(capability, path);\n      assertKnownFields(capability, [\"id\", \"minVersion\", \"maxVersion\"], path);\n      if (typeof capability.id !== \"string\") throw new TypeError(`${path}.id must be a string`);\n      if (\n        typeof capability.minVersion !== \"number\" ||\n        !Number.isSafeInteger(capability.minVersion) ||\n        capability.minVersion < 0\n      ) {\n        throw new TypeError(`${path}.minVersion must be a safe integer`);\n      }\n      if (\n        typeof capability.maxVersion !== \"number\" ||\n        !Number.isSafeInteger(capability.maxVersion) ||\n        capability.maxVersion < 0\n      ) {\n        throw new TypeError(`${path}.maxVersion must be a safe integer`);\n      }\n    }\n  }\n  return value as unknown as AdapterCapabilityManifest;\n}\n\nfunction diagnostic(\n  code: AdapterCapabilityDiagnosticCode,\n  path: string,\n  message: string,\n): AdapterCapabilityDiagnostic {\n  return { code, path, message };\n}\n\nfunction assertRecord(value: unknown, path: string): asserts value is Record<string, unknown> {\n  if (value == null || typeof value !== \"object\" || Array.isArray(value)) {\n    throw new TypeError(`${path} must be an object`);\n  }\n}\n\nfunction assertKnownFields(\n  value: Record<string, unknown>,\n  expected: readonly string[],\n  path: string,\n): void {\n  const known = new Set(expected);\n  const unknown = Object.keys(value).find((field) => !known.has(field));\n  if (unknown !== undefined) throw new TypeError(`${path} has unknown field ${unknown}`);\n}\n\nfunction compareText(left: string, right: string): number {\n  return left < right ? -1 : left > right ? 1 : 0;\n}\n","import type {\n  AdapterCapabilityCompatibilityChange,\n  AdapterCapabilityCompatibilityReport,\n  AdapterCapabilityManifest,\n  AdapterCapabilitySupport,\n  CompatibilityChangeKind,\n} from \"./adapter-model.js\";\nimport { validateAdapterCapabilityManifest } from \"./adapter-validate.js\";\n\n/**\n * Compares adapter capability support from older to newer.\n *\n * Adding support or widening an inclusive version range is additive.\n * Removing support or narrowing either bound is breaking.\n */\nexport function compareAdapterCapabilities(\n  previous: AdapterCapabilityManifest,\n  next: AdapterCapabilityManifest,\n): AdapterCapabilityCompatibilityReport {\n  const previousDiagnostics = validateAdapterCapabilityManifest(previous);\n  const nextDiagnostics = validateAdapterCapabilityManifest(next);\n  if (previousDiagnostics.length > 0 || nextDiagnostics.length > 0) {\n    return { previousDiagnostics, nextDiagnostics, changes: [] };\n  }\n\n  const changes: AdapterCapabilityCompatibilityChange[] = [];\n  if (previous.adapter !== next.adapter) {\n    changes.push(change(\"breaking\", \"adapter\", \"adapter identity changed\"));\n  }\n\n  const oldSupport = byId(previous);\n  const newSupport = byId(next);\n  for (const id of [...oldSupport.keys()].filter((id) => !newSupport.has(id)).sort()) {\n    changes.push(change(\"breaking\", `capabilities.${id}`, \"capability support was removed\"));\n  }\n  for (const id of [...newSupport.keys()].filter((id) => !oldSupport.has(id)).sort()) {\n    changes.push(change(\"additive\", `capabilities.${id}`, \"capability support was added\"));\n  }\n  for (const [id, old] of oldSupport) {\n    const current = newSupport.get(id);\n    if (current === undefined) continue;\n    if (old.minVersion !== current.minVersion) {\n      changes.push(\n        change(\n          current.minVersion < old.minVersion ? \"additive\" : \"breaking\",\n          `capabilities.${id}.minVersion`,\n          current.minVersion < old.minVersion\n            ? \"minimum supported version decreased\"\n            : \"minimum supported version increased\",\n        ),\n      );\n    }\n    if (old.maxVersion !== current.maxVersion) {\n      changes.push(\n        change(\n          current.maxVersion > old.maxVersion ? \"additive\" : \"breaking\",\n          `capabilities.${id}.maxVersion`,\n          current.maxVersion > old.maxVersion\n            ? \"maximum supported version increased\"\n            : \"maximum supported version decreased\",\n        ),\n      );\n    }\n  }\n\n  changes.sort(\n    (left, right) => compareText(left.path, right.path) || compareText(left.kind, right.kind),\n  );\n  return { previousDiagnostics, nextDiagnostics, changes };\n}\n\nfunction byId(manifest: AdapterCapabilityManifest): Map<string, AdapterCapabilitySupport> {\n  return new Map((manifest.capabilities ?? []).map((value) => [value.id, value] as const));\n}\n\nfunction change(\n  kind: CompatibilityChangeKind,\n  path: string,\n  message: string,\n): AdapterCapabilityCompatibilityChange {\n  return { kind, path, message };\n}\n\nfunction compareText(left: string, right: string): number {\n  return left < right ? -1 : left > right ? 1 : 0;\n}\n","import type { ApplicationMarquette } from \"./model.js\";\nimport type {\n  AdapterCapabilityManifest,\n  AdapterCapabilityMismatch,\n  AdapterCapabilityMismatchCode,\n  AdapterCapabilityNegotiation,\n  AdapterCapabilitySupport,\n} from \"./adapter-model.js\";\nimport { validateAdapterCapabilityManifest } from \"./adapter-validate.js\";\n\n/**\n * Negotiates application capability requirements against one adapter.\n *\n * Requirement identifiers are deduplicated and sorted. Unknown application\n * capability identifiers fail closed instead of being treated as adapter\n * omissions. An invalid manifest never produces a compatible result.\n */\nexport function negotiateAdapterCapabilities(\n  marquette: ApplicationMarquette,\n  requiredCapabilities: readonly string[],\n  manifest: AdapterCapabilityManifest,\n): AdapterCapabilityNegotiation {\n  const diagnostics = validateAdapterCapabilityManifest(manifest);\n  const support = new Map(\n    (manifest.capabilities ?? []).map((capability) => [capability.id, capability] as const),\n  );\n  const mismatches = [...new Set(requiredCapabilities)]\n    .sort()\n    .flatMap((id) => mismatch(marquette, id, support.get(id), diagnostics.length === 0));\n\n  return {\n    adapter: manifest.adapter,\n    compatible: diagnostics.length === 0 && mismatches.length === 0,\n    diagnostics,\n    mismatches,\n  };\n}\n\nfunction mismatch(\n  marquette: ApplicationMarquette,\n  id: string,\n  support: AdapterCapabilitySupport | undefined,\n  manifestIsValid: boolean,\n): AdapterCapabilityMismatch[] {\n  const requirement = marquette.capabilities?.[id];\n  if (requirement === undefined) return [problem(\"unknown-requirement\", id)];\n  if (!manifestIsValid) return [];\n\n  const requiredVersion = requirement.version ?? 1;\n  if (support === undefined) return [problem(\"missing-capability\", id, requiredVersion)];\n  if (requiredVersion < support.minVersion) {\n    return [problem(\"version-below-minimum\", id, requiredVersion, support)];\n  }\n  if (requiredVersion > support.maxVersion) {\n    return [problem(\"version-above-maximum\", id, requiredVersion, support)];\n  }\n  return [];\n}\n\nfunction problem(\n  code: AdapterCapabilityMismatchCode,\n  capability: string,\n  requiredVersion?: number,\n  support?: AdapterCapabilitySupport,\n): AdapterCapabilityMismatch {\n  return {\n    code,\n    capability,\n    path: `capabilities.${capability}`,\n    message: mismatchMessage(code),\n    ...(requiredVersion === undefined ? {} : { requiredVersion }),\n    ...(support === undefined\n      ? {}\n      : { minVersion: support.minVersion, maxVersion: support.maxVersion }),\n  };\n}\n\nfunction mismatchMessage(code: AdapterCapabilityMismatchCode): string {\n  switch (code) {\n    case \"unknown-requirement\":\n      return \"application references an undeclared capability requirement\";\n    case \"missing-capability\":\n      return \"adapter does not support the required capability\";\n    case \"version-below-minimum\":\n      return \"application requires a capability version below the adapter minimum\";\n    case \"version-above-maximum\":\n      return \"application requires a capability version above the adapter maximum\";\n  }\n}\n"],"mappings":";;AACA,MAAa,oCAAoC;;;;ACEjD,MAAa,mCAAmC;;AAGhD,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;AAWA,SAAgB,gCAAqE;CACnF,OAAO,6BAA6B,KAAK,QAAQ;EAC/C;EACA,YAAA;EACA,YAAA;CACF,EAAE;AACJ;;;ACzBA,MAAM,aAAa;AACnB,MAAM,mBAAoE;CACxE,0BAA0B;CAC1B,sBAAsB;CACtB,yBAAyB;CACzB,mBAAmB;CACnB,yBAAyB;CACzB,wBAAwB;AAC1B;;AAGA,SAAgB,kCACd,UAC+B;CAC/B,MAAM,cAA6C,CAAC;CACpD,KAAK,SAAS,iBAAiB,OAAA,GAC7B,YAAY,KACV,WACE,0BACA,iBACA,wDACF,CACF;CAEF,IAAI,CAAC,WAAW,KAAK,SAAS,OAAO,GACnC,YAAY,KACV,WACE,sBACA,WACA,iDACF,CACF;CAGF,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,CAAC,OAAO,gBAAgB,SAAS,gBAAgB,CAAC,GAAG,QAAQ,GAAG;EACzE,MAAM,OAAO,gBAAgB;EAC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