{"version":3,"sources":["../src/protocol.ts","../src/tag-registry.ts","../src/semantic-protocol.ts"],"sourcesContent":["export type {\n  FormSpecAnalysisDeclarationSummary,\n  FormSpecAnalysisCommentSnapshot,\n  FormSpecAnalysisDiagnosticCategory,\n  FormSpecAnalysisDiagnosticDataValue,\n  FormSpecAnalysisDiagnosticLocation,\n  FormSpecAnalysisDiagnostic,\n  FormSpecAnalysisFileSnapshot,\n  FormSpecAnalysisManifest,\n  FormSpecAnalysisTagSnapshot,\n  FormSpecIpcEndpoint,\n  FormSpecSerializedDeclarationFact,\n  FormSpecSerializedExplicitMetadataSource,\n  FormSpecSerializedJsonValue,\n  FormSpecSerializedMetadataEntry,\n  FormSpecSerializedResolvedMetadata,\n  FormSpecSerializedResolvedScalarMetadata,\n  FormSpecSemanticQuery,\n  FormSpecSemanticResponse,\n  FormSpecSerializedCommentTargetSpecifier,\n  FormSpecSerializedCompletionContext,\n  FormSpecSerializedHoverInfo,\n  FormSpecSerializedTagDefinition,\n  FormSpecSerializedTagSemanticContext,\n  FormSpecSerializedTagSignature,\n} from \"./semantic-protocol.js\";\nexport type { CommentSourceSpan, CommentSpan } from \"./comment-syntax.js\";\nexport type { FormSpecPlacement, FormSpecTargetKind } from \"./tag-registry.js\";\nexport {\n  FORMSPEC_ANALYSIS_PROTOCOL_VERSION,\n  FORMSPEC_ANALYSIS_SCHEMA_VERSION,\n  computeFormSpecTextHash,\n  isFormSpecAnalysisManifest,\n  isFormSpecSemanticQuery,\n  isFormSpecSemanticResponse,\n} from \"./semantic-protocol.js\";\n","import {\n  BUILTIN_CONSTRAINT_DEFINITIONS,\n  UnreachableError,\n  normalizeConstraintTagName,\n  type AnnotationInheritancePolicy,\n  type BuiltinConstraintName,\n  type CustomAnnotationTagDocumentation,\n  type MetadataDeclarationKind,\n  type MetadataSlotRegistration,\n} from \"@stripe/formspec-core/internals\";\n\nexport type FormSpecValueKind =\n  | \"number\"\n  | \"integer\"\n  | \"signedInteger\"\n  | \"string\"\n  | \"json\"\n  | \"boolean\"\n  | \"condition\";\n\n/**\n * Target syntaxes that a FormSpec tag can accept.\n *\n * @public\n */\nexport type FormSpecTargetKind = \"none\" | \"path\" | \"member\" | \"variant\";\nexport type FormSpecTagCategory = \"constraint\" | \"annotation\" | \"structure\" | \"ecosystem\";\n\n/**\n * Declaration contexts where a FormSpec tag may appear.\n *\n * @public\n */\nexport type FormSpecPlacement =\n  | \"class\"\n  | \"class-field\"\n  | \"class-method\"\n  | \"interface\"\n  | \"interface-field\"\n  | \"type-alias\"\n  | \"type-alias-field\"\n  | \"variable\"\n  | \"function\"\n  | \"function-parameter\"\n  | \"method-parameter\";\n\nexport type SemanticCapability =\n  | \"numeric-comparable\"\n  | \"string-like\"\n  | \"array-like\"\n  | \"enum-member-addressable\"\n  | \"json-like\"\n  | \"condition-like\"\n  | \"object-like\";\n\nexport interface TagSignatureParameter {\n  readonly kind: \"value\" | \"target-path\" | \"target-member\" | \"target-variant\";\n  readonly label: string;\n  readonly optional?: boolean;\n  readonly capability?: SemanticCapability;\n  readonly valueKind?: FormSpecValueKind;\n}\n\nexport interface TagSignature {\n  readonly label: string;\n  readonly placements: readonly FormSpecPlacement[];\n  readonly parameters: readonly TagSignatureParameter[];\n}\n\nexport interface TagDefinition {\n  readonly canonicalName: string;\n  readonly valueKind: FormSpecValueKind | null;\n  readonly requiresArgument: boolean;\n  readonly supportedTargets: readonly FormSpecTargetKind[];\n  readonly allowDuplicates: boolean;\n  readonly category: FormSpecTagCategory;\n  readonly placements: readonly FormSpecPlacement[];\n  /**\n   * Type-level semantic inheritance policy for annotation tags. Omitted\n   * registrations behave as `\"never\"`. `\"local-wins\"` means a derived\n   * declaration inherits this annotation only when it does not provide the\n   * same annotation identity locally.\n   */\n  readonly inheritFromBase?: AnnotationInheritancePolicy;\n  /**\n   * The semantic capabilities required of the field type for this tag to be\n   * applicable. At most one capability may be declared per tag.\n   *\n   * The \"at most one\" invariant is structural: all `capabilitiesForValueKind`\n   * return paths yield 0 or 1 elements, and no tag definition supplies 2+\n   * capabilities. The tuple type enforces this at the type level so future\n   * additions that accidentally provide two capabilities produce a type error.\n   */\n  readonly capabilities: readonly [SemanticCapability] | readonly [];\n  readonly completionDetail: string;\n  readonly hoverSummary: string;\n  readonly hoverMarkdown: string;\n  readonly signatures: readonly TagSignature[];\n}\n\nexport type FormSpecTagDefinition = TagDefinition;\nexport type FormSpecTagOverload = TagSignature;\nexport type FormSpecTagParameter = TagSignatureParameter;\n\nexport interface ExtensionConstraintTagSource {\n  readonly tagName: string;\n}\n\nexport interface ExtensionAnnotationTagSource {\n  readonly annotationName: string;\n  readonly inheritFromBase?: AnnotationInheritancePolicy;\n  readonly tagDocumentation?: CustomAnnotationTagDocumentation;\n}\n\n/**\n * Type declaration metadata for extension-registered custom types.\n * Used by host-checker-aware consumers to recognize declarations that reference\n * extension-provided type names.\n */\nexport interface ExtensionCustomTypeSource {\n  /** TypeScript surface names that resolve to this type (e.g., ['Decimal']) */\n  readonly tsTypeNames: readonly string[];\n}\n\nexport interface ExtensionTagSource {\n  readonly extensionId: string;\n  readonly constraintTags?: readonly ExtensionConstraintTagSource[];\n  readonly annotations?: readonly ExtensionAnnotationTagSource[];\n  readonly metadataSlots?: readonly MetadataSlotRegistration[];\n  /** Custom types registered by this extension */\n  readonly customTypes?: readonly ExtensionCustomTypeSource[];\n}\n\nexport interface SettingsExtensionTypeRegistration {\n  readonly extensionId: string;\n  readonly registration: { readonly typeName: string };\n}\n\nexport interface SettingsExtensionDefinition {\n  readonly constraintTags?: readonly { readonly tagName: unknown }[];\n  readonly metadataSlots?: readonly { readonly tagName: unknown }[];\n  readonly annotations?: readonly { readonly annotationName: unknown }[];\n}\n\nexport interface SettingsExtensionRegistry {\n  readonly extensions?: readonly SettingsExtensionDefinition[];\n  readonly findTypeByName?: (typeName: string) => SettingsExtensionTypeRegistration | undefined;\n  readonly findBuiltinConstraintBroadening?: (\n    typeId: string,\n    tagName: string\n  ) => object | undefined;\n}\n\nexport const FORM_SPEC_PLACEMENTS = [\n  \"class\",\n  \"class-field\",\n  \"class-method\",\n  \"interface\",\n  \"interface-field\",\n  \"type-alias\",\n  \"type-alias-field\",\n  \"variable\",\n  \"function\",\n  \"function-parameter\",\n  \"method-parameter\",\n] as const satisfies readonly FormSpecPlacement[];\n\nexport const FORM_SPEC_TARGET_KINDS = [\n  \"none\",\n  \"path\",\n  \"member\",\n  \"variant\",\n] as const satisfies readonly FormSpecTargetKind[];\n\nconst FIELD_PLACEMENTS = [\n  \"class-field\",\n  \"interface-field\",\n  \"type-alias-field\",\n  \"variable\",\n  \"function-parameter\",\n  \"method-parameter\",\n] as const satisfies readonly FormSpecPlacement[];\n\nconst TYPE_PLACEMENTS = [\n  \"class\",\n  \"interface\",\n  \"type-alias\",\n] as const satisfies readonly FormSpecPlacement[];\n\nconst DECLARATION_PLACEMENTS = [\n  \"class-method\",\n  \"function\",\n] as const satisfies readonly FormSpecPlacement[];\n\nconst ALL_PLACEMENTS = [\n  ...TYPE_PLACEMENTS,\n  ...FIELD_PLACEMENTS,\n  ...DECLARATION_PLACEMENTS,\n] as const satisfies readonly FormSpecPlacement[];\n\nconst INTEGER_VALUE_TAGS = new Set([\"minLength\", \"maxLength\", \"minItems\", \"maxItems\"]);\nconst SIGNED_INTEGER_VALUE_TAGS = new Set([\"order\"]);\nconst JSON_VALUE_TAGS = new Set([\"const\", \"enumOptions\"]);\nconst BOOLEAN_VALUE_TAGS = new Set([\"uniqueItems\"]);\nconst STRING_VALUE_TAGS = new Set([\n  \"pattern\",\n  \"displayName\",\n  \"format\",\n  \"placeholder\",\n  \"group\",\n  \"example\",\n  \"remarks\",\n  \"see\",\n  \"apiName\",\n]);\nconst CONDITION_VALUE_TAGS = new Set([\"showWhen\", \"hideWhen\", \"enableWhen\", \"disableWhen\"]);\n\nconst CONSTRAINT_COMPLETION_DETAIL: Record<string, string> = {\n  minimum: \"Minimum numeric value (inclusive). Example: `@minimum 0`\",\n  maximum: \"Maximum numeric value (inclusive). Example: `@maximum 100`\",\n  exclusiveMinimum: \"Minimum numeric value (exclusive). Example: `@exclusiveMinimum 0`\",\n  exclusiveMaximum: \"Maximum numeric value (exclusive). Example: `@exclusiveMaximum 100`\",\n  multipleOf: \"Value must be a multiple of this number. Example: `@multipleOf 0.01`\",\n  minLength: \"Minimum string length. Example: `@minLength 1`\",\n  maxLength: \"Maximum string length. Example: `@maxLength 255`\",\n  minItems: \"Minimum number of array items. Example: `@minItems 1`\",\n  maxItems: \"Maximum number of array items. Example: `@maxItems 10`\",\n  uniqueItems: \"Require all array items to be distinct. Example: `@uniqueItems`\",\n  pattern: \"Regular expression pattern for string validation. Example: `@pattern ^[a-z]+$`\",\n  enumOptions: 'Inline JSON array of allowed enum values. Example: `@enumOptions [\"a\",\"b\",\"c\"]`',\n  const: 'Require a constant JSON value. Example: `@const \"USD\"`',\n};\n\nconst CONSTRAINT_HOVER_DOCS: Record<string, string> = {\n  minimum: [\n    \"**@minimum** `<number>`\",\n    \"\",\n    \"Sets an inclusive lower bound on a numeric field.\",\n    \"\",\n    \"Maps to `minimum` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@minimum [:path] <number>`\",\n  ].join(\"\\n\"),\n  maximum: [\n    \"**@maximum** `<number>`\",\n    \"\",\n    \"Sets an inclusive upper bound on a numeric field.\",\n    \"\",\n    \"Maps to `maximum` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@maximum [:path] <number>`\",\n  ].join(\"\\n\"),\n  exclusiveMinimum: [\n    \"**@exclusiveMinimum** `<number>`\",\n    \"\",\n    \"Sets an exclusive lower bound on a numeric field.\",\n    \"\",\n    \"Maps to `exclusiveMinimum` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@exclusiveMinimum [:path] <number>`\",\n  ].join(\"\\n\"),\n  exclusiveMaximum: [\n    \"**@exclusiveMaximum** `<number>`\",\n    \"\",\n    \"Sets an exclusive upper bound on a numeric field.\",\n    \"\",\n    \"Maps to `exclusiveMaximum` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@exclusiveMaximum [:path] <number>`\",\n  ].join(\"\\n\"),\n  multipleOf: [\n    \"**@multipleOf** `<number>`\",\n    \"\",\n    \"Requires the numeric value to be a multiple of the given number.\",\n    \"\",\n    \"Maps to `multipleOf` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@multipleOf [:path] <number>`\",\n  ].join(\"\\n\"),\n  minLength: [\n    \"**@minLength** `<integer>`\",\n    \"\",\n    \"Sets a minimum character length on a string field.\",\n    \"\",\n    \"Maps to `minLength` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@minLength [:path] <integer>`\",\n  ].join(\"\\n\"),\n  maxLength: [\n    \"**@maxLength** `<integer>`\",\n    \"\",\n    \"Sets a maximum character length on a string field.\",\n    \"\",\n    \"Maps to `maxLength` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@maxLength [:path] <integer>`\",\n  ].join(\"\\n\"),\n  minItems: [\n    \"**@minItems** `<integer>`\",\n    \"\",\n    \"Sets a minimum number of items in an array field.\",\n    \"\",\n    \"Maps to `minItems` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@minItems [:path] <integer>`\",\n  ].join(\"\\n\"),\n  maxItems: [\n    \"**@maxItems** `<integer>`\",\n    \"\",\n    \"Sets a maximum number of items in an array field.\",\n    \"\",\n    \"Maps to `maxItems` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@maxItems [:path] <integer>`\",\n  ].join(\"\\n\"),\n  uniqueItems: [\n    \"**@uniqueItems**\",\n    \"\",\n    \"Requires all items in an array field to be distinct.\",\n    \"\",\n    \"Maps to `uniqueItems` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@uniqueItems [:path]`\",\n  ].join(\"\\n\"),\n  pattern: [\n    \"**@pattern** `<regex>`\",\n    \"\",\n    \"Sets a regular expression pattern that a string field must match.\",\n    \"\",\n    \"Maps to `pattern` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@pattern [:path] <regex>`\",\n  ].join(\"\\n\"),\n  enumOptions: [\n    \"**@enumOptions** `<json-array>`\",\n    \"\",\n    \"Specifies the allowed values for an enum field as an inline JSON array.\",\n    \"\",\n    \"Maps to `enum` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@enumOptions <json-array>`\",\n  ].join(\"\\n\"),\n  const: [\n    \"**@const** `<json-literal>`\",\n    \"\",\n    \"Requires the field value to equal a single constant JSON value.\",\n    \"\",\n    \"Maps to `const` in JSON Schema.\",\n    \"\",\n    \"**Signature:** `@const [:path] <json-literal>`\",\n  ].join(\"\\n\"),\n};\n\nconst CONSTRAINT_HOVER_SUMMARIES: Record<BuiltinConstraintName, string> = {\n  minimum: \"Sets an inclusive lower bound on a numeric field.\",\n  maximum: \"Sets an inclusive upper bound on a numeric field.\",\n  exclusiveMinimum: \"Sets an exclusive lower bound on a numeric field.\",\n  exclusiveMaximum: \"Sets an exclusive upper bound on a numeric field.\",\n  multipleOf: \"Requires the numeric value to be a multiple of the given number.\",\n  minLength: \"Sets a minimum character length on a string field.\",\n  maxLength: \"Sets a maximum character length on a string field.\",\n  minItems: \"Sets a minimum number of items in an array field.\",\n  maxItems: \"Sets a maximum number of items in an array field.\",\n  uniqueItems: \"Requires all items in an array field to be distinct.\",\n  pattern: \"Sets a regular expression pattern that a string field must match.\",\n  enumOptions: \"Specifies the allowed values for an enum field as an inline JSON array.\",\n  const: \"Requires the field value to equal a single constant JSON value.\",\n};\n\ntype SupportedSignatureTarget = Exclude<FormSpecTargetKind, \"none\">;\n\ninterface ExtraTagSpec {\n  readonly requiresArgument: boolean;\n  readonly supportedTargets: readonly FormSpecTargetKind[];\n  readonly allowDuplicates: boolean;\n  readonly category: FormSpecTagCategory;\n  readonly placements: readonly FormSpecPlacement[];\n  readonly inheritFromBase?: AnnotationInheritancePolicy;\n  readonly completionDetail: string;\n  readonly hoverSummary: string;\n  readonly valueKind?: FormSpecValueKind | null;\n  readonly valueLabel?: string;\n  readonly targetPlacements?: Partial<\n    Record<SupportedSignatureTarget, readonly FormSpecPlacement[]>\n  >;\n}\n\nfunction inferValueKind(name: string): FormSpecValueKind | null {\n  if (INTEGER_VALUE_TAGS.has(name)) return \"integer\";\n  if (SIGNED_INTEGER_VALUE_TAGS.has(name)) return \"signedInteger\";\n  if (JSON_VALUE_TAGS.has(name)) return \"json\";\n  if (BOOLEAN_VALUE_TAGS.has(name)) return \"boolean\";\n  if (STRING_VALUE_TAGS.has(name)) return \"string\";\n  if (CONDITION_VALUE_TAGS.has(name)) return \"condition\";\n  return null;\n}\n\nfunction getBuiltinValueKind(name: BuiltinConstraintName): FormSpecValueKind {\n  return inferValueKind(name) ?? \"number\";\n}\n\nfunction getBuiltinConstraintCapability(name: BuiltinConstraintName): SemanticCapability {\n  switch (name) {\n    case \"minimum\":\n    case \"maximum\":\n    case \"exclusiveMinimum\":\n    case \"exclusiveMaximum\":\n    case \"multipleOf\":\n      return \"numeric-comparable\";\n    case \"minLength\":\n    case \"maxLength\":\n    case \"pattern\":\n      return \"string-like\";\n    case \"minItems\":\n    case \"maxItems\":\n    case \"uniqueItems\":\n      return \"array-like\";\n    case \"enumOptions\":\n      return \"enum-member-addressable\";\n    case \"const\":\n      return \"json-like\";\n    default: {\n      const exhaustive: never = name;\n      return exhaustive;\n    }\n  }\n}\n\nfunction capabilitiesForValueKind(\n  valueKind: FormSpecValueKind | null\n): readonly [SemanticCapability] | readonly [] {\n  switch (valueKind) {\n    case \"number\":\n    case \"integer\":\n    case \"signedInteger\":\n      return [\"numeric-comparable\"] as const;\n    case \"string\":\n      return [\"string-like\"] as const;\n    case \"json\":\n      return [\"json-like\"] as const;\n    case \"condition\":\n      return [\"condition-like\"] as const;\n    case \"boolean\":\n    case null:\n      return [] as const;\n    default: {\n      const exhaustive: never = valueKind;\n      return exhaustive;\n    }\n  }\n}\n\nfunction valueLabelForKind(valueKind: FormSpecValueKind | null, fallback = \"<value>\"): string {\n  switch (valueKind) {\n    case \"number\":\n      return \"<number>\";\n    case \"integer\":\n    case \"signedInteger\":\n      return \"<integer>\";\n    case \"string\":\n      return \"<text>\";\n    case \"json\":\n      return \"<json>\";\n    case \"condition\":\n      return \"<condition>\";\n    case \"boolean\":\n    case null:\n      return \"\";\n    default: {\n      const exhaustive: never = valueKind;\n      void exhaustive;\n      return fallback;\n    }\n  }\n}\n\nfunction targetLabelForKind(kind: SupportedSignatureTarget): string {\n  switch (kind) {\n    case \"path\":\n      return \"[:path]\";\n    case \"member\":\n      return \":member\";\n    case \"variant\":\n      return \":variant\";\n    default: {\n      const exhaustive: never = kind;\n      return exhaustive;\n    }\n  }\n}\n\nfunction parameterKindForTarget(\n  targetKind: SupportedSignatureTarget\n): TagSignatureParameter[\"kind\"] {\n  switch (targetKind) {\n    case \"path\":\n      return \"target-path\";\n    case \"member\":\n      return \"target-member\";\n    case \"variant\":\n      return \"target-variant\";\n    default: {\n      const exhaustive: never = targetKind;\n      return exhaustive;\n    }\n  }\n}\n\nfunction createTargetParameter(\n  targetKind: SupportedSignatureTarget,\n  valueKind: FormSpecValueKind | null,\n  pathCapability?: SemanticCapability\n): TagSignatureParameter {\n  const base: TagSignatureParameter = {\n    kind: parameterKindForTarget(targetKind),\n    label: targetLabelForKind(targetKind),\n    optional: targetKind === \"path\",\n  };\n\n  if (targetKind === \"path\") {\n    const capability = pathCapability ?? capabilitiesForValueKind(valueKind)[0];\n    return capability === undefined ? base : { ...base, capability };\n  }\n\n  if (targetKind === \"member\") {\n    return { ...base, capability: \"enum-member-addressable\" };\n  }\n\n  return base;\n}\n\nfunction createSignature(\n  name: string,\n  placements: readonly FormSpecPlacement[],\n  targetKind: SupportedSignatureTarget | null,\n  valueKind: FormSpecValueKind | null,\n  valueLabel: string,\n  pathCapability?: SemanticCapability\n): TagSignature {\n  const parameters: TagSignatureParameter[] = [];\n\n  if (targetKind !== null) {\n    parameters.push(createTargetParameter(targetKind, valueKind, pathCapability));\n  }\n  if (valueLabel !== \"\") {\n    parameters.push(\n      valueKind === null\n        ? {\n            kind: \"value\",\n            label: valueLabel,\n          }\n        : {\n            kind: \"value\",\n            label: valueLabel,\n            valueKind,\n          }\n    );\n  }\n\n  const targetLabel = targetKind === null ? \"\" : ` ${targetLabelForKind(targetKind)}`;\n  const valueLabelSuffix = valueLabel === \"\" ? \"\" : ` ${valueLabel}`;\n\n  return {\n    label: `@${name}${targetLabel}${valueLabelSuffix}`,\n    placements,\n    parameters,\n  };\n}\n\nfunction buildHoverMarkdown(\n  name: string,\n  hoverSummary: string,\n  signatures: readonly TagSignature[],\n  valueLabel: string\n): string {\n  const header = valueLabel === \"\" ? `**@${name}**` : `**@${name}** \\`${valueLabel}\\``;\n  const signatureLines =\n    signatures.length === 1\n      ? [`**Signature:** \\`${signatures[0]?.label ?? `@${name}`}\\``]\n      : [\"**Signatures:**\", ...signatures.map((signature) => `- \\`${signature.label}\\``)];\n\n  return [header, \"\", hoverSummary, \"\", ...signatureLines].join(\"\\n\");\n}\n\nfunction makeConstraintSignatures(name: BuiltinConstraintName): readonly TagSignature[] {\n  const valueKind = getBuiltinValueKind(name);\n  const subjectCapability = getBuiltinConstraintCapability(name);\n  const valueLabel =\n    name === \"pattern\"\n      ? \"<regex>\"\n      : name === \"enumOptions\"\n        ? \"<json-array>\"\n        : name === \"const\"\n          ? \"<json-literal>\"\n          : valueLabelForKind(valueKind);\n\n  return [\n    createSignature(name, FIELD_PLACEMENTS, null, valueKind, valueLabel),\n    createSignature(name, FIELD_PLACEMENTS, \"path\", valueKind, valueLabel, subjectCapability),\n  ];\n}\n\nconst BUILTIN_TAG_DEFINITIONS = Object.fromEntries(\n  (Object.keys(BUILTIN_CONSTRAINT_DEFINITIONS) as BuiltinConstraintName[]).map((name) => {\n    const valueKind = getBuiltinValueKind(name);\n    const subjectCapability = getBuiltinConstraintCapability(name);\n    return [\n      name,\n      {\n        canonicalName: name,\n        valueKind,\n        requiresArgument: valueKind !== \"boolean\",\n        supportedTargets: [\"none\", \"path\"] as const,\n        allowDuplicates: false,\n        category: \"constraint\" as const,\n        placements: FIELD_PLACEMENTS,\n        capabilities: [subjectCapability] as const,\n        completionDetail: CONSTRAINT_COMPLETION_DETAIL[name] ?? `@${name}`,\n        hoverSummary: CONSTRAINT_HOVER_SUMMARIES[name],\n        hoverMarkdown: CONSTRAINT_HOVER_DOCS[name] ?? `**@${name}**`,\n        signatures: makeConstraintSignatures(name),\n      } satisfies TagDefinition,\n    ];\n  })\n) as Record<string, TagDefinition>;\n\nconst EXTRA_TAG_SPECS = {\n  displayName: {\n    requiresArgument: true,\n    supportedTargets: [\"none\", \"member\", \"variant\"],\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements: [...TYPE_PLACEMENTS, ...FIELD_PLACEMENTS],\n    completionDetail: \"Display label for a type, field, or enum member.\",\n    hoverSummary: \"Provides a user-facing display label.\",\n    valueLabel: \"<label>\",\n    targetPlacements: {\n      member: FIELD_PLACEMENTS,\n      variant: TYPE_PLACEMENTS,\n    },\n  },\n  format: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements: FIELD_PLACEMENTS,\n    inheritFromBase: \"local-wins\",\n    completionDetail: \"Format hint for a field.\",\n    hoverSummary: \"Provides a format hint for a field.\",\n    valueLabel: \"<format>\",\n  },\n  placeholder: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Placeholder text for a field.\",\n    hoverSummary: \"Provides placeholder text for a field.\",\n  },\n  order: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Field display order hint.\",\n    hoverSummary: \"Provides an integer ordering hint for UI layout.\",\n  },\n  apiName: {\n    requiresArgument: true,\n    supportedTargets: [\"none\", \"member\", \"variant\"],\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements: [...TYPE_PLACEMENTS, ...FIELD_PLACEMENTS],\n    completionDetail: \"API-facing serialized name for a type, field, or variant.\",\n    hoverSummary: \"Overrides the serialized API name used in generated schema output.\",\n    valueLabel: \"<identifier>\",\n    targetPlacements: {\n      member: FIELD_PLACEMENTS,\n      variant: TYPE_PLACEMENTS,\n    },\n  },\n  group: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: false,\n    category: \"structure\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Assigns a field to a UI group.\",\n    hoverSummary: \"Assigns the field to a named grouping container.\",\n    valueLabel: \"<group>\",\n  },\n  showWhen: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: true,\n    category: \"structure\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Conditional visibility rule.\",\n    hoverSummary: \"Shows the field only when the condition is satisfied.\",\n  },\n  hideWhen: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: true,\n    category: \"structure\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Conditional visibility suppression rule.\",\n    hoverSummary: \"Hides the field when the condition is satisfied.\",\n  },\n  enableWhen: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: true,\n    category: \"structure\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Conditional interactivity rule.\",\n    hoverSummary: \"Enables the field only when the condition is satisfied.\",\n  },\n  disableWhen: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: true,\n    category: \"structure\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Conditional disablement rule.\",\n    hoverSummary: \"Disables the field when the condition is satisfied.\",\n  },\n  defaultValue: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: false,\n    category: \"ecosystem\",\n    placements: FIELD_PLACEMENTS,\n    completionDetail: \"Default JSON value for a field.\",\n    hoverSummary: \"Provides a default JSON value for ecosystem integrations.\",\n    valueLabel: \"<value>\",\n  },\n  deprecated: {\n    requiresArgument: false,\n    supportedTargets: [\"none\"],\n    allowDuplicates: false,\n    category: \"ecosystem\",\n    placements: ALL_PLACEMENTS,\n    inheritFromBase: \"local-wins\",\n    completionDetail: \"Marks a declaration as deprecated.\",\n    hoverSummary: \"Marks the declaration as deprecated.\",\n  },\n  example: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: true,\n    category: \"ecosystem\",\n    placements: [...TYPE_PLACEMENTS, ...FIELD_PLACEMENTS],\n    completionDetail: \"Example serialized value.\",\n    hoverSummary: \"Provides an example value for documentation and tooling.\",\n  },\n  discriminator: {\n    requiresArgument: true,\n    supportedTargets: [\"path\"],\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements: TYPE_PLACEMENTS,\n    completionDetail: \"Declare a discriminator field for a generic object type.\",\n    hoverSummary: \"Declares the field used as the discriminator for a generic object type.\",\n    valueLabel: \"<typeParam>\",\n  },\n  remarks: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: false,\n    category: \"ecosystem\",\n    placements: ALL_PLACEMENTS,\n    completionDetail: \"Additional remarks text.\",\n    hoverSummary: \"Provides additional remarks for the declaration.\",\n  },\n  see: {\n    requiresArgument: true,\n    supportedTargets: [\"none\"],\n    allowDuplicates: true,\n    category: \"ecosystem\",\n    placements: ALL_PLACEMENTS,\n    completionDetail: \"Reference to related documentation.\",\n    hoverSummary: \"References related documentation or declarations.\",\n    valueLabel: \"<reference>\",\n  },\n} as const satisfies Record<string, ExtraTagSpec>;\n\nfunction buildExtraTagDefinition(canonicalName: string, spec: ExtraTagSpec): TagDefinition {\n  const valueKind = spec.valueKind ?? inferValueKind(canonicalName);\n  const valueLabel = spec.requiresArgument ? (spec.valueLabel ?? valueLabelForKind(valueKind)) : \"\";\n  const signatures: TagSignature[] = [];\n\n  if (spec.supportedTargets.includes(\"none\")) {\n    signatures.push(createSignature(canonicalName, spec.placements, null, valueKind, valueLabel));\n  }\n  if (spec.supportedTargets.includes(\"path\")) {\n    signatures.push(\n      createSignature(\n        canonicalName,\n        spec.targetPlacements?.path ?? spec.placements,\n        \"path\",\n        valueKind,\n        valueLabel\n      )\n    );\n  }\n  if (spec.supportedTargets.includes(\"member\")) {\n    signatures.push(\n      createSignature(\n        canonicalName,\n        spec.targetPlacements?.member ?? spec.placements,\n        \"member\",\n        valueKind,\n        valueLabel\n      )\n    );\n  }\n  if (spec.supportedTargets.includes(\"variant\")) {\n    signatures.push(\n      createSignature(\n        canonicalName,\n        spec.targetPlacements?.variant ?? spec.placements,\n        \"variant\",\n        valueKind,\n        valueLabel\n      )\n    );\n  }\n\n  return {\n    canonicalName,\n    valueKind,\n    requiresArgument: spec.requiresArgument,\n    supportedTargets: spec.supportedTargets,\n    allowDuplicates: spec.allowDuplicates,\n    category: spec.category,\n    placements: spec.placements,\n    ...(spec.inheritFromBase === undefined ? {} : { inheritFromBase: spec.inheritFromBase }),\n    // Capabilities express a *field-type* requirement (e.g. `@minLength` needs\n    // a string-like field). Only constraint-category tags carry that meaning;\n    // annotation, structure, and ecosystem tags describe or decorate the field\n    // regardless of its type, so their value-kind must not leak into a field\n    // constraint. `EXTRA_TAG_SPECS` currently has no constraint entries, but\n    // we keep the `spec.category === \"constraint\"` check for future-proofing.\n    capabilities:\n      spec.category === \"constraint\" ? capabilitiesForValueKind(valueKind) : ([] as const),\n    completionDetail: spec.completionDetail,\n    hoverSummary: spec.hoverSummary,\n    hoverMarkdown: buildHoverMarkdown(canonicalName, spec.hoverSummary, signatures, valueLabel),\n    signatures,\n  };\n}\n\nfunction placementsForMetadataDeclarationKinds(\n  declarationKinds: readonly MetadataDeclarationKind[]\n): readonly FormSpecPlacement[] {\n  const placements = new Set<FormSpecPlacement>();\n\n  for (const declarationKind of declarationKinds) {\n    switch (declarationKind) {\n      case \"type\":\n        for (const placement of TYPE_PLACEMENTS) {\n          placements.add(placement);\n        }\n        break;\n      case \"field\":\n        for (const placement of FIELD_PLACEMENTS) {\n          placements.add(placement);\n        }\n        break;\n      case \"method\":\n        placements.add(\"class-method\");\n        placements.add(\"function\");\n        break;\n      default: {\n        const _exhaustive: never = declarationKind;\n        return _exhaustive;\n      }\n    }\n  }\n\n  return [...placements];\n}\n\nfunction buildExtensionMetadataTagDefinition(\n  extensionId: string,\n  slot: MetadataSlotRegistration\n): TagDefinition {\n  const canonicalName = normalizeFormSpecTagName(slot.tagName);\n  const supportsQualifiers = (slot.qualifiers?.length ?? 0) > 0;\n  if (slot.allowBare === false && !supportsQualifiers) {\n    throw new Error(\n      `Metadata tag \"@${canonicalName}\" must allow bare usage or declare at least one qualifier.`\n    );\n  }\n  const supportedTargets: readonly FormSpecTargetKind[] = supportsQualifiers\n    ? slot.allowBare === false\n      ? [\"variant\"]\n      : [\"none\", \"variant\"]\n    : slot.allowBare === false\n      ? []\n      : [\"none\"];\n  const placements = placementsForMetadataDeclarationKinds(slot.declarationKinds);\n  const signatures: TagSignature[] = [];\n  const valueKind = \"string\";\n\n  if (supportedTargets.includes(\"none\")) {\n    signatures.push(createSignature(canonicalName, placements, null, valueKind, \"<value>\"));\n  }\n  if (supportedTargets.includes(\"variant\")) {\n    signatures.push(createSignature(canonicalName, placements, \"variant\", valueKind, \"<value>\"));\n  }\n\n  return {\n    canonicalName,\n    valueKind,\n    requiresArgument: true,\n    supportedTargets,\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements,\n    // Extension metadata tags are always annotations — they attach a typed\n    // value to a declaration without constraining the declaration's type.\n    // See `buildExtraTagDefinition` for the rationale.\n    capabilities: [] as const,\n    completionDetail: `Extension metadata tag from ${extensionId}`,\n    hoverSummary: `Extension-defined metadata tag from \\`${extensionId}\\`.`,\n    hoverMarkdown: [\n      `**@${canonicalName}** \\`<value>\\``,\n      \"\",\n      `Extension-defined metadata tag from \\`${extensionId}\\`.`,\n      \"\",\n      signatures.map((signature) => `**Signature:** \\`${signature.label}\\``).join(\"\\n\"),\n    ].join(\"\\n\"),\n    signatures,\n  };\n}\n\nfunction buildExtensionAnnotationTagDefinition(\n  annotation: ExtensionAnnotationTagSource\n): TagDefinition {\n  const canonicalName = normalizeFormSpecTagName(annotation.annotationName);\n  const valueKind = \"string\";\n  const payloadLabel = annotation.tagDocumentation?.payloadLabel ?? \"<payload>\";\n  const signatures = [\n    createSignature(canonicalName, ALL_PLACEMENTS, null, valueKind, payloadLabel),\n  ] as const satisfies readonly TagSignature[];\n  const hoverSummary = annotation.tagDocumentation?.hoverSummary ?? \"\";\n  const hoverMarkdown =\n    annotation.tagDocumentation?.hoverMarkdown ??\n    [\n      `**@${canonicalName}** \\`${payloadLabel}\\``,\n      \"\",\n      `**Signature:** \\`@${canonicalName} ${payloadLabel}\\``,\n    ].join(\"\\n\");\n\n  return {\n    canonicalName,\n    valueKind,\n    requiresArgument: true,\n    supportedTargets: [\"none\"] as const,\n    allowDuplicates: false,\n    category: \"annotation\",\n    placements: ALL_PLACEMENTS,\n    ...(annotation.inheritFromBase === undefined\n      ? {}\n      : { inheritFromBase: annotation.inheritFromBase }),\n    capabilities: [] as const,\n    completionDetail: annotation.tagDocumentation?.completionDetail ?? \"\",\n    hoverSummary,\n    hoverMarkdown,\n    signatures,\n  };\n}\n\nconst EXTRA_TAG_DEFINITIONS: Record<string, TagDefinition> = Object.fromEntries(\n  Object.entries(EXTRA_TAG_SPECS).map(([canonicalName, spec]) => [\n    canonicalName,\n    buildExtraTagDefinition(canonicalName, spec),\n  ])\n);\n\nlet defaultInheritableAnnotationKeys: ReadonlySet<string> | undefined;\nconst inheritableAnnotationKeysByExtensionArray = new WeakMap<\n  readonly ExtensionTagSource[],\n  ReadonlySet<string>\n>();\n\nexport function normalizeFormSpecTagName(rawName: string): string {\n  return normalizeConstraintTagName(rawName);\n}\n\nfunction getCustomAnnotationInheritanceKey(extensionId: string, annotationName: string): string {\n  return `custom:${extensionId}/${annotationName}`;\n}\n\nfunction buildInheritableAnnotationKeys(\n  extensions?: readonly ExtensionTagSource[]\n): ReadonlySet<string> {\n  const keys = new Set<string>();\n  for (const definition of Object.values(EXTRA_TAG_DEFINITIONS)) {\n    if (!doesInheritFromBase(definition.inheritFromBase)) continue;\n    keys.add(definition.canonicalName);\n  }\n  for (const annotation of getExtensionAnnotationTags(extensions)) {\n    if (!doesInheritFromBase(annotation.annotation.inheritFromBase)) continue;\n    keys.add(\n      getCustomAnnotationInheritanceKey(\n        annotation.extensionId,\n        annotation.annotation.annotationName\n      )\n    );\n  }\n  return keys;\n}\n\nfunction doesInheritFromBase(policy: AnnotationInheritancePolicy | undefined): boolean {\n  const effectivePolicy = policy ?? \"never\";\n  switch (effectivePolicy) {\n    case \"local-wins\":\n      return true;\n    case \"never\":\n      return false;\n    default:\n      throw new UnreachableError(\n        effectivePolicy,\n        `Unsupported annotation inheritance policy: ${String(effectivePolicy)}`\n      );\n  }\n}\n\nexport function getInheritableAnnotationKeys(\n  extensions?: readonly ExtensionTagSource[]\n): ReadonlySet<string> {\n  if (extensions === undefined) {\n    defaultInheritableAnnotationKeys ??= buildInheritableAnnotationKeys();\n    return defaultInheritableAnnotationKeys;\n  }\n\n  const cached = inheritableAnnotationKeysByExtensionArray.get(extensions);\n  if (cached !== undefined) return cached;\n\n  const next = buildInheritableAnnotationKeys(extensions);\n  inheritableAnnotationKeysByExtensionArray.set(extensions, next);\n  return next;\n}\n\n/**\n * Reads the extension registry that FormSpec integrations place in settings.\n *\n * ESLint, the TypeScript plugin, and the language server all receive this value\n * through a weakly typed host boundary, so the shared analysis layer owns the\n * defensive object checks instead of each consumer casting settings locally.\n */\nexport function readExtensionRegistryFromSettings(\n  settings: Readonly<Record<string, unknown>>\n): SettingsExtensionRegistry | undefined {\n  const formspec = settings[\"formspec\"];\n  if (typeof formspec !== \"object\" || formspec === null) return undefined;\n  const registry = (formspec as Record<string, unknown>)[\"extensionRegistry\"];\n  if (typeof registry !== \"object\" || registry === null) return undefined;\n\n  const record = registry as Record<string, unknown>;\n  const extensions = record[\"extensions\"];\n  const findTypeByName = record[\"findTypeByName\"];\n  const findBuiltinConstraintBroadening = record[\"findBuiltinConstraintBroadening\"];\n  const validShape =\n    (extensions === undefined ||\n      (Array.isArray(extensions) && extensions.every(isSettingsExtensionDefinition))) &&\n    (findTypeByName === undefined || typeof findTypeByName === \"function\") &&\n    (findBuiltinConstraintBroadening === undefined ||\n      typeof findBuiltinConstraintBroadening === \"function\");\n\n  if (validShape) {\n    return registry as SettingsExtensionRegistry;\n  }\n\n  return {\n    ...(Array.isArray(extensions)\n      ? { extensions: extensions.filter(isSettingsExtensionDefinition) }\n      : {}),\n    ...(typeof findTypeByName === \"function\"\n      ? {\n          findTypeByName: findTypeByName as NonNullable<\n            SettingsExtensionRegistry[\"findTypeByName\"]\n          >,\n        }\n      : {}),\n    ...(typeof findBuiltinConstraintBroadening === \"function\"\n      ? {\n          findBuiltinConstraintBroadening: findBuiltinConstraintBroadening as NonNullable<\n            SettingsExtensionRegistry[\"findBuiltinConstraintBroadening\"]\n          >,\n        }\n      : {}),\n  };\n}\n\n/**\n * Strips a leading `@` from a tag name before applying FormSpec's shared tag\n * normalization. Extension registries can store names in either spelling, while\n * parsed comments use normalized names without the TSDoc prefix.\n */\nfunction normalizeExtensionTagName(rawName: string): string {\n  const stripped = rawName.startsWith(\"@\") ? rawName.slice(1) : rawName;\n  return normalizeFormSpecTagName(stripped);\n}\n\nfunction readRegisteredExtensionTagName(record: unknown, propertyName: string): string | null {\n  if (typeof record !== \"object\" || record === null) return null;\n  const rawName = (record as Record<string, unknown>)[propertyName];\n  return typeof rawName === \"string\" ? normalizeExtensionTagName(rawName) : null;\n}\n\nfunction isSettingsExtensionDefinition(value: unknown): value is SettingsExtensionDefinition {\n  return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction readArrayProperty(\n  record: SettingsExtensionDefinition,\n  propertyName: string\n): readonly unknown[] {\n  const value = (record as Record<string, unknown>)[propertyName];\n  return Array.isArray(value) ? value : [];\n}\n\nfunction readExtensionDefinitionTagNames(\n  extension: SettingsExtensionDefinition\n): readonly string[] {\n  const names: string[] = [];\n  for (const tag of readArrayProperty(extension, \"constraintTags\")) {\n    const name = readRegisteredExtensionTagName(tag, \"tagName\");\n    if (name !== null) names.push(name);\n  }\n  for (const slot of readArrayProperty(extension, \"metadataSlots\")) {\n    const name = readRegisteredExtensionTagName(slot, \"tagName\");\n    if (name !== null) names.push(name);\n  }\n  for (const annotation of readArrayProperty(extension, \"annotations\")) {\n    const name = readRegisteredExtensionTagName(annotation, \"annotationName\");\n    if (name !== null) names.push(name);\n  }\n  return names;\n}\n\nconst RESERVED_UNSUPPORTED_TAG_NAMES = new Set([\"description\"]);\n\n/**\n * Reads every tag name registered by extensions in FormSpec settings.\n *\n * Constraint tags, metadata slots, and annotations store their names under\n * different property names; callers should treat them as one extension-defined\n * tag-name set. Malformed settings entries are ignored so host tooling never\n * crashes while linting partially configured projects.\n */\nexport function readExtensionTagNames(\n  settings: Readonly<Record<string, unknown>>\n): ReadonlySet<string> {\n  const registry = readExtensionRegistryFromSettings(settings);\n  const extensions =\n    registry === undefined ? undefined : (registry as Record<string, unknown>)[\"extensions\"];\n  if (!Array.isArray(extensions)) return new Set();\n\n  const names = new Set<string>();\n  for (const extension of extensions) {\n    if (!isSettingsExtensionDefinition(extension)) continue;\n    for (const name of readExtensionDefinitionTagNames(extension)) {\n      names.add(name);\n    }\n  }\n  return names;\n}\n\nexport function getTagDefinition(\n  rawName: string,\n  extensions?: readonly ExtensionTagSource[]\n): TagDefinition | null {\n  const normalized = normalizeFormSpecTagName(rawName);\n  if (RESERVED_UNSUPPORTED_TAG_NAMES.has(normalized)) {\n    return null;\n  }\n\n  const builtin = BUILTIN_TAG_DEFINITIONS[normalized];\n  if (builtin !== undefined) {\n    return builtin;\n  }\n\n  const extra = EXTRA_TAG_DEFINITIONS[normalized];\n  if (extra !== undefined) {\n    return extra;\n  }\n\n  const extensionRegistration = getExtensionConstraintTags(extensions).find(\n    (tag) => tag.tagName === normalized\n  );\n\n  if (extensionRegistration !== undefined) {\n    return {\n      canonicalName: extensionRegistration.tagName,\n      valueKind: null,\n      requiresArgument: true,\n      supportedTargets: [\"none\"] as const,\n      allowDuplicates: true,\n      category: \"constraint\",\n      placements: FIELD_PLACEMENTS,\n      capabilities: [] as const,\n      completionDetail: `Extension constraint tag from ${extensionRegistration.extensionId}`,\n      hoverSummary: `Extension-defined constraint tag from \\`${extensionRegistration.extensionId}\\`.`,\n      hoverMarkdown: [\n        `**@${extensionRegistration.tagName}** \\`<value>\\``,\n        \"\",\n        `Extension-defined constraint tag from \\`${extensionRegistration.extensionId}\\`.`,\n        \"\",\n        `**Signature:** \\`@${extensionRegistration.tagName} <value>\\``,\n      ].join(\"\\n\"),\n      signatures: [\n        {\n          label: `@${extensionRegistration.tagName} <value>`,\n          placements: FIELD_PLACEMENTS,\n          parameters: [{ kind: \"value\", label: \"<value>\" }],\n        },\n      ],\n    };\n  }\n\n  const extensionAnnotation = getExtensionAnnotationTags(extensions).find(\n    (annotation) => annotation.tagName === normalized\n  );\n\n  if (extensionAnnotation !== undefined) {\n    return buildExtensionAnnotationTagDefinition(extensionAnnotation.annotation);\n  }\n\n  const extensionMetadata = getExtensionMetadataSlots(extensions).find(\n    (slot) => slot.tagName === normalized\n  );\n  return extensionMetadata === undefined\n    ? null\n    : buildExtensionMetadataTagDefinition(extensionMetadata.extensionId, extensionMetadata.slot);\n}\n\nexport function getConstraintTagDefinitions(\n  extensions?: readonly ExtensionTagSource[]\n): readonly TagDefinition[] {\n  const builtins = Object.values(BUILTIN_TAG_DEFINITIONS);\n  const custom = getExtensionConstraintTags(extensions)\n    .map((tag) => getTagDefinition(tag.tagName, extensions))\n    .filter((tag): tag is TagDefinition => tag !== null);\n  return [...builtins, ...custom];\n}\n\nexport function getAllTagDefinitions(\n  extensions?: readonly ExtensionTagSource[]\n): readonly TagDefinition[] {\n  const builtins = Object.values(BUILTIN_TAG_DEFINITIONS);\n  const extras = Object.values(EXTRA_TAG_DEFINITIONS);\n  const custom = getExtensionConstraintTags(extensions)\n    .map((tag) => getTagDefinition(tag.tagName, extensions))\n    .filter((tag): tag is TagDefinition => tag !== null);\n  const customMetadata = getExtensionMetadataSlots(extensions)\n    .map((slot) => getTagDefinition(slot.tagName, extensions))\n    .filter((tag): tag is TagDefinition => tag !== null);\n  const customAnnotations = getExtensionAnnotationTags(extensions)\n    .map((annotation) => getTagDefinition(annotation.tagName, extensions))\n    .filter((tag): tag is TagDefinition => tag !== null);\n  return [...builtins, ...extras, ...custom, ...customMetadata, ...customAnnotations];\n}\n\nexport function getTagHoverMarkdown(\n  rawName: string,\n  extensions?: readonly ExtensionTagSource[]\n): string | null {\n  return getTagDefinition(rawName, extensions)?.hoverMarkdown ?? null;\n}\n\nfunction getExtensionConstraintTags(\n  extensions: readonly ExtensionTagSource[] | undefined\n): readonly { extensionId: string; tagName: string }[] {\n  return (\n    extensions?.flatMap((extension) => {\n      const tagRecords = extension.constraintTags ?? [];\n      return tagRecords.map((tag) => ({\n        extensionId: extension.extensionId,\n        tagName: normalizeFormSpecTagName(tag.tagName),\n      }));\n    }) ?? []\n  );\n}\n\nfunction getExtensionMetadataSlots(\n  extensions: readonly ExtensionTagSource[] | undefined\n): readonly { extensionId: string; tagName: string; slot: MetadataSlotRegistration }[] {\n  return (\n    extensions?.flatMap((extension) =>\n      (extension.metadataSlots ?? []).map((slot) => ({\n        extensionId: extension.extensionId,\n        tagName: normalizeFormSpecTagName(slot.tagName),\n        slot,\n      }))\n    ) ?? []\n  );\n}\n\nfunction getExtensionAnnotationTags(\n  extensions: readonly ExtensionTagSource[] | undefined\n): readonly {\n  extensionId: string;\n  tagName: string;\n  annotation: ExtensionAnnotationTagSource;\n}[] {\n  if (extensions === undefined) return [];\n\n  const seenTags = new Set<string>();\n  const tags: {\n    extensionId: string;\n    tagName: string;\n    annotation: ExtensionAnnotationTagSource;\n  }[] = [];\n  for (const extension of extensions) {\n    for (const annotation of extension.annotations ?? []) {\n      const tagName = normalizeFormSpecTagName(annotation.annotationName);\n      if (seenTags.has(tagName)) {\n        throw new Error(`Duplicate annotation tag: \"@${tagName}\"`);\n      }\n      seenTags.add(tagName);\n      tags.push({\n        extensionId: extension.extensionId,\n        tagName,\n        annotation,\n      });\n    }\n  }\n  return tags;\n}\n","import type {\n  CommentSpan,\n  ParsedCommentTag,\n  ParsedCommentTargetSpecifier,\n} from \"./comment-syntax.js\";\nimport type {\n  CommentHoverInfo,\n  CommentTagSemanticContext,\n  SemanticCommentCompletionContext,\n} from \"./cursor-context.js\";\nimport {\n  FORM_SPEC_PLACEMENTS,\n  FORM_SPEC_TARGET_KINDS,\n  type FormSpecPlacement,\n  type FormSpecTargetKind,\n} from \"./tag-registry.js\";\n\n/**\n * Version of the transport protocol shared by analysis producers and consumers.\n *\n * @public\n */\nexport const FORMSPEC_ANALYSIS_PROTOCOL_VERSION = 4;\n/**\n * Version of the serialized analysis payload schema.\n *\n * @public\n */\nexport const FORMSPEC_ANALYSIS_SCHEMA_VERSION = 2;\n\n/**\n * Serializable source details for one explicit metadata value.\n *\n * @public\n */\nexport interface FormSpecSerializedExplicitMetadataSource {\n  /** Tag name associated with the explicit value, without the `@` prefix. */\n  readonly tagName: string;\n  /** Whether the explicit value used a bare or qualified tag form. */\n  readonly form: \"bare\" | \"qualified\";\n  /** Full range covering the explicit tag occurrence. */\n  readonly fullRange: CommentSpan;\n  /** Range covering only the tag name token. */\n  readonly tagNameRange: CommentSpan;\n  /** Range covering the qualifier text, when present. */\n  readonly qualifierRange?: CommentSpan | undefined;\n  /** Range covering only the explicit value text. */\n  readonly valueRange: CommentSpan;\n  /** Qualifier text without the leading colon, when present. */\n  readonly qualifier?: string | undefined;\n}\n\n/**\n * Serializable scalar metadata value plus its provenance.\n *\n * @public\n */\nexport interface FormSpecSerializedResolvedScalarMetadata {\n  /** Effective metadata value after policy resolution. */\n  readonly value: string;\n  /** Whether the value was authored directly or inferred. */\n  readonly source: \"explicit\" | \"inferred\";\n}\n\n/**\n * Serializable built-in metadata projection for one declaration.\n *\n * @public\n */\nexport interface FormSpecSerializedResolvedMetadata {\n  /** Effective JSON-facing singular name. */\n  readonly apiName?: FormSpecSerializedResolvedScalarMetadata | undefined;\n  /** Effective human-facing singular label. */\n  readonly displayName?: FormSpecSerializedResolvedScalarMetadata | undefined;\n  /** Effective JSON-facing plural name, where applicable. */\n  readonly apiNamePlural?: FormSpecSerializedResolvedScalarMetadata | undefined;\n  /** Effective human-facing plural label, where applicable. */\n  readonly displayNamePlural?: FormSpecSerializedResolvedScalarMetadata | undefined;\n}\n\n/**\n * Serializable metadata slot resolution for one declaration.\n *\n * @public\n */\nexport interface FormSpecSerializedMetadataEntry {\n  /** Stable logical slot identifier. */\n  readonly slotId: string;\n  /** Tag name associated with the slot, without the `@` prefix. */\n  readonly tagName: string;\n  /** Optional qualifier text without the leading colon. */\n  readonly qualifier?: string | undefined;\n  /** Effective value after explicit/inferred resolution. */\n  readonly value: string;\n  /** Whether the value was authored directly or inferred. */\n  readonly source: \"explicit\" | \"inferred\";\n  /** Fixer-oriented source details when the winning value was explicit. */\n  readonly explicitSource?: FormSpecSerializedExplicitMetadataSource | undefined;\n}\n\n/**\n * JSON-safe value carried by declaration summary facts.\n *\n * @public\n */\nexport type FormSpecSerializedJsonValue =\n  | string\n  | number\n  | boolean\n  | null\n  | readonly FormSpecSerializedJsonValue[]\n  | { readonly [key: string]: FormSpecSerializedJsonValue };\n\n/**\n * Structured declaration-level fact derived from one or more comment tags.\n *\n * @public\n */\nexport type FormSpecSerializedDeclarationFact =\n  | {\n      /** Summary text attached to the declaration body before the first tag. */\n      readonly kind: \"description\";\n      /** Summary text rendered from the declaration doc comment. */\n      readonly value: string;\n    }\n  | {\n      /** Additional remarks text attached to the declaration. */\n      readonly kind: \"remarks\";\n      /** Remarks text as authored. */\n      readonly value: string;\n    }\n  | {\n      /** Default JSON value carried by the declaration metadata. */\n      readonly kind: \"default-value\";\n      /** Parsed JSON-safe default value. */\n      readonly value: FormSpecSerializedJsonValue;\n    }\n  | {\n      /** Example text attached to the declaration. */\n      readonly kind: \"example\";\n      /** Example text as authored. */\n      readonly value: string;\n    }\n  | {\n      /** Deprecation status for the declaration. */\n      readonly kind: \"deprecated\";\n      /** Optional deprecation guidance authored alongside the tag. */\n      readonly message: string | null;\n    }\n  | {\n      /** Combined numeric constraints for one declaration target. */\n      readonly kind: \"numeric-constraints\";\n      /** Target path receiving the constraints, or `null` for the declaration itself. */\n      readonly targetPath: string | null;\n      /** Inclusive lower bound, when present. */\n      readonly minimum?: number | undefined;\n      /** Inclusive upper bound, when present. */\n      readonly maximum?: number | undefined;\n      /** Exclusive lower bound, when present. */\n      readonly exclusiveMinimum?: number | undefined;\n      /** Exclusive upper bound, when present. */\n      readonly exclusiveMaximum?: number | undefined;\n      /** Divisibility constraint, when present. */\n      readonly multipleOf?: number | undefined;\n    }\n  | {\n      /** Combined string constraints for one declaration target. */\n      readonly kind: \"string-constraints\";\n      /** Target path receiving the constraints, or `null` for the declaration itself. */\n      readonly targetPath: string | null;\n      /** Minimum string length, when present. */\n      readonly minLength?: number | undefined;\n      /** Maximum string length, when present. */\n      readonly maxLength?: number | undefined;\n      /** Regex patterns that must all be satisfied. */\n      readonly patterns: readonly string[];\n    }\n  | {\n      /** Combined array constraints for one declaration target. */\n      readonly kind: \"array-constraints\";\n      /** Target path receiving the constraints, or `null` for the declaration itself. */\n      readonly targetPath: string | null;\n      /** Minimum item count, when present. */\n      readonly minItems?: number | undefined;\n      /** Maximum item count, when present. */\n      readonly maxItems?: number | undefined;\n      /** Whether items must be unique. */\n      readonly uniqueItems?: boolean | undefined;\n    }\n  | {\n      /** Enum/member whitelist constraint for one declaration target. */\n      readonly kind: \"allowed-members\";\n      /** Target path receiving the constraint, or `null` for the declaration itself. */\n      readonly targetPath: string | null;\n      /** Allowed member identifiers after normalization. */\n      readonly members: readonly (string | number)[];\n    }\n  | {\n      /** Constant-value constraint for one declaration target. */\n      readonly kind: \"const\";\n      /** Target path receiving the constraint, or `null` for the declaration itself. */\n      readonly targetPath: string | null;\n      /** Constant JSON-safe value. */\n      readonly value: FormSpecSerializedJsonValue;\n    }\n  | {\n      /** Extension-defined constraint fact for one declaration target. */\n      readonly kind: \"custom-constraint\";\n      /** Target path receiving the constraint, or `null` for the declaration itself. */\n      readonly targetPath: string | null;\n      /** Stable extension-qualified constraint identifier. */\n      readonly constraintId: string;\n      /** Composition rule used when combining repeated applications. */\n      readonly compositionRule: \"intersect\" | \"override\";\n      /** JSON-safe payload parsed from the authored tag. */\n      readonly payload: FormSpecSerializedJsonValue;\n    };\n\n/**\n * Public declaration-level semantic summary for one documented declaration.\n *\n * @public\n */\nexport interface FormSpecAnalysisDeclarationSummary {\n  /** Summary text attached to the declaration before the first tag, if present. */\n  readonly summaryText: string | null;\n  /** Built-in resolved metadata projected for the declaration. */\n  readonly resolvedMetadata: FormSpecSerializedResolvedMetadata | null;\n  /** Resolved metadata entries, including extension-contributed slots. */\n  readonly metadataEntries: readonly FormSpecSerializedMetadataEntry[];\n  /** Structured declaration facts derived by FormSpec. */\n  readonly facts: readonly FormSpecSerializedDeclarationFact[];\n  /** Pre-rendered markdown optimized for declaration hover surfaces. */\n  readonly hoverMarkdown: string;\n}\n\n/**\n * Cross-process endpoint used by the language server to reach the semantic\n * tsserver plugin on the current workspace host.\n *\n * @public\n */\nexport interface FormSpecIpcEndpoint {\n  /** Transport kind used to reach the semantic service. */\n  readonly kind: \"unix-socket\" | \"windows-pipe\";\n  /** Socket path or named-pipe address for the service. */\n  readonly address: string;\n}\n\n/**\n * Discovery record written by the tsserver plugin so other FormSpec tooling\n * can locate and validate the matching semantic service for a workspace.\n *\n * @public\n */\nexport interface FormSpecAnalysisManifest {\n  /** Protocol version expected by consumers of this manifest. */\n  readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n  /** Schema version for the serialized analysis payload. */\n  readonly analysisSchemaVersion: typeof FORMSPEC_ANALYSIS_SCHEMA_VERSION;\n  /** Absolute root of the workspace being analyzed. */\n  readonly workspaceRoot: string;\n  /** Stable workspace identifier used for runtime artifacts. */\n  readonly workspaceId: string;\n  /** IPC endpoint for the active semantic service. */\n  readonly endpoint: FormSpecIpcEndpoint;\n  /** TypeScript version reported by the host runtime. */\n  readonly typescriptVersion: string;\n  /** Hash of the active extension set for the workspace. */\n  readonly extensionFingerprint: string;\n  /** Monotonic generation number for the manifest file. */\n  readonly generation: number;\n  /** ISO timestamp for the last manifest update. */\n  readonly updatedAt: string;\n}\n\n/**\n * Serializable subset of tag metadata needed by hover and completion UIs.\n *\n * @public\n */\nexport interface FormSpecSerializedTagDefinition {\n  /** Canonical tag name, including the leading `@`. */\n  readonly canonicalName: string;\n  /** Short completion detail shown in UI pickers. */\n  readonly completionDetail: string;\n  /** Markdown hover text for the tag name. */\n  readonly hoverMarkdown: string;\n}\n\n/**\n * Serializable overload/signature summary for one comment tag form.\n *\n * @public\n */\nexport interface FormSpecSerializedTagSignature {\n  /** Human-readable label for the signature form. */\n  readonly label: string;\n  /** Target kinds accepted by this signature. */\n  readonly placements: readonly FormSpecPlacement[];\n}\n\n/**\n * Serialized representation of a parsed target specifier with exact spans.\n *\n * @public\n */\nexport interface FormSpecSerializedCommentTargetSpecifier {\n  /** Raw target text without the leading colon. */\n  readonly rawText: string;\n  /** Whether the target parsed cleanly. */\n  readonly valid: boolean;\n  /** Classified target kind used by completion and hover. */\n  readonly kind: \"path\" | \"member\" | \"variant\" | \"ambiguous\";\n  /** Full span covering the colon and target text. */\n  readonly fullSpan: CommentSpan;\n  /** Span covering only the leading colon. */\n  readonly colonSpan: CommentSpan;\n  /** Span covering the target text after the colon. */\n  readonly span: CommentSpan;\n}\n\n/**\n * Semantic facts about one parsed tag, reduced to JSON-safe data for IPC.\n *\n * @public\n */\nexport interface FormSpecSerializedTagSemanticContext {\n  /** Tag name in canonical `@tag` form. */\n  readonly tagName: string;\n  /** Resolved tag definition, if the tag is recognized. */\n  readonly tagDefinition: FormSpecSerializedTagDefinition | null;\n  /** Placement inferred for the tag in the current comment. */\n  readonly placement: FormSpecPlacement | null;\n  /** Usage variants filtered to the active tag occurrence. */\n  readonly contextualSignatures: readonly FormSpecSerializedTagSignature[];\n  /** Target kinds supported by the tag. */\n  readonly supportedTargets: readonly FormSpecTargetKind[];\n  /** Completion candidates for tag targets. */\n  readonly targetCompletions: readonly string[];\n  /** Path targets compatible with the current cursor context. */\n  readonly compatiblePathTargets: readonly string[];\n  /** Display labels for known argument values. */\n  readonly valueLabels: readonly string[];\n  /** Completion candidates for the argument position. */\n  readonly argumentCompletions: readonly string[];\n  /** Markdown hover content for the tag in the active occurrence context. */\n  readonly contextualTagHoverMarkdown: string | null;\n  /** Summaries of the tag's overloads or signatures. */\n  readonly signatures: readonly FormSpecSerializedTagSignature[];\n  /** Markdown hover content for the tag itself. */\n  readonly tagHoverMarkdown: string | null;\n  /** Markdown hover content for the target, if applicable. */\n  readonly targetHoverMarkdown: string | null;\n  /** Markdown hover content for the argument, if applicable. */\n  readonly argumentHoverMarkdown: string | null;\n}\n\n/**\n * Cursor-scoped completion context serialized for transport between the\n * semantic tsserver plugin and the lightweight LSP.\n *\n * @public\n */\nexport type FormSpecSerializedCompletionContext =\n  | {\n      /** Completion mode indicating the cursor is on a tag name. */\n      readonly kind: \"tag-name\";\n      /** Current partially typed tag prefix. */\n      readonly prefix: string;\n      /** Tags available at the current cursor location. */\n      readonly availableTags: readonly FormSpecSerializedTagDefinition[];\n    }\n  | {\n      /** Completion mode indicating the cursor is on a target specifier. */\n      readonly kind: \"target\";\n      /** Semantic context for the active tag. */\n      readonly semantic: FormSpecSerializedTagSemanticContext;\n    }\n  | {\n      /** Completion mode indicating the cursor is in an argument position. */\n      readonly kind: \"argument\";\n      /** Semantic context for the active tag. */\n      readonly semantic: FormSpecSerializedTagSemanticContext;\n      /** Suggested value labels for argument completion. */\n      readonly valueLabels: readonly string[];\n    }\n  | {\n      /** Sentinel indicating that no FormSpec completion is available. */\n      readonly kind: \"none\";\n    };\n\n/**\n * Hover payload for a single comment token under the cursor.\n *\n * @public\n */\nexport interface FormSpecSerializedHoverInfo {\n  /** Token kind that produced this hover payload. */\n  readonly kind: \"tag-name\" | \"target\" | \"argument\" | \"declaration\";\n  /** Markdown content returned to the hover UI. */\n  readonly markdown: string;\n}\n\n/**\n * Machine-readable diagnostic category used by FormSpec tooling surfaces.\n *\n * @public\n */\nexport type FormSpecAnalysisDiagnosticCategory =\n  | \"tag-recognition\"\n  | \"value-parsing\"\n  | \"type-compatibility\"\n  | \"target-resolution\"\n  | \"constraint-validation\"\n  | \"infrastructure\";\n\n/**\n * Primitive structured values carried in diagnostic facts for white-label\n * downstream rendering.\n *\n * @public\n */\nexport type FormSpecAnalysisDiagnosticDataValue =\n  | string\n  | number\n  | boolean\n  | readonly string[]\n  | readonly number[]\n  | readonly boolean[];\n\n/**\n * Additional source location associated with a diagnostic.\n *\n * @public\n */\nexport interface FormSpecAnalysisDiagnosticLocation {\n  /** Absolute path to the related source file. */\n  readonly filePath: string;\n  /** Span associated with the related location. */\n  readonly range: CommentSpan;\n  /** Optional human-readable note for the location. */\n  readonly message?: string;\n}\n\n/**\n * File-local diagnostic derived from comment parsing or semantic analysis.\n *\n * @public\n */\nexport interface FormSpecAnalysisDiagnostic {\n  /** Stable diagnostic code for programmatic handling. */\n  readonly code: string;\n  /** Diagnostic family used by the analysis pipeline. */\n  readonly category: FormSpecAnalysisDiagnosticCategory;\n  /** Human-readable diagnostic message. */\n  readonly message: string;\n  /** Primary source span for the diagnostic. */\n  readonly range: CommentSpan;\n  /** Diagnostic severity reported to consumers. */\n  readonly severity: \"error\" | \"warning\" | \"info\";\n  /** Additional related source locations. */\n  readonly relatedLocations: readonly FormSpecAnalysisDiagnosticLocation[];\n  /** Structured diagnostic metadata. */\n  readonly data: Record<string, FormSpecAnalysisDiagnosticDataValue>;\n}\n\n/**\n * Serializable view of a single parsed FormSpec tag within a doc comment.\n *\n * @public\n */\nexport interface FormSpecAnalysisTagSnapshot {\n  /** Raw tag name as written in the comment. */\n  readonly rawTagName: string;\n  /** Normalized tag name used for lookup. */\n  readonly normalizedTagName: string;\n  /** Whether the tag was recognized by the registry. */\n  readonly recognized: boolean;\n  /** Full span covering the parsed tag. */\n  readonly fullSpan: CommentSpan;\n  /** Span of the tag name itself. */\n  readonly tagNameSpan: CommentSpan;\n  /** Span of the payload after the tag name. */\n  readonly payloadSpan: CommentSpan | null;\n  /** Parsed target specifier, if one was present. */\n  readonly target: FormSpecSerializedCommentTargetSpecifier | null;\n  /** Span covering the argument text, if present. */\n  readonly argumentSpan: CommentSpan | null;\n  /** Raw argument text. */\n  readonly argumentText: string;\n  /** Serialized semantic data for the tag. */\n  readonly semantic: FormSpecSerializedTagSemanticContext;\n}\n\n/**\n * Serializable view of one declaration-attached doc comment in a source file.\n *\n * @public\n */\nexport interface FormSpecAnalysisCommentSnapshot {\n  /** Span covering the doc comment itself. */\n  readonly commentSpan: CommentSpan;\n  /** Span covering the associated declaration. */\n  readonly declarationSpan: CommentSpan;\n  /** Where the comment was attached in relation to the declaration. */\n  readonly placement: FormSpecPlacement | null;\n  /** Resolved type of the documented subject, if known. */\n  readonly subjectType: string | null;\n  /** Resolved host type that owns the comment, if known. */\n  readonly hostType: string | null;\n  /** Declaration-level applied metadata and constraints derived by FormSpec. */\n  readonly declarationSummary: FormSpecAnalysisDeclarationSummary;\n  /** Parsed tags contained in the doc comment. */\n  readonly tags: readonly FormSpecAnalysisTagSnapshot[];\n}\n\n/**\n * Serializable analysis artifact for a single source file.\n *\n * @public\n */\nexport interface FormSpecAnalysisFileSnapshot {\n  /** Absolute path to the analyzed file. */\n  readonly filePath: string;\n  /** Stable hash of the file contents. */\n  readonly sourceHash: string;\n  /** ISO timestamp when the snapshot was generated. */\n  readonly generatedAt: string;\n  /** Parsed doc comments found in the file. */\n  readonly comments: readonly FormSpecAnalysisCommentSnapshot[];\n  /** Diagnostics emitted for the file. */\n  readonly diagnostics: readonly FormSpecAnalysisDiagnostic[];\n}\n\n/**\n * Query variants supported by the semantic tsserver plugin.\n *\n * @public\n */\nexport type FormSpecSemanticQuery =\n  | {\n      /** Protocol version carried with every request. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Query variant requesting health/manifest information. */\n      readonly kind: \"health\";\n    }\n  | {\n      /** Protocol version carried with every request. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Query variant requesting completion context. */\n      readonly kind: \"completion\";\n      /** Absolute path of the source file. */\n      readonly filePath: string;\n      /** Zero-based cursor offset in the file. */\n      readonly offset: number;\n    }\n  | {\n      /** Protocol version carried with every request. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Query variant requesting hover information. */\n      readonly kind: \"hover\";\n      /** Absolute path of the source file. */\n      readonly filePath: string;\n      /** Zero-based cursor offset in the file. */\n      readonly offset: number;\n    }\n  | {\n      /** Protocol version carried with every request. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Query variant requesting diagnostics only. */\n      readonly kind: \"diagnostics\";\n      /** Absolute path of the source file. */\n      readonly filePath: string;\n    }\n  | {\n      /** Protocol version carried with every request. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Query variant requesting a full serialized file snapshot. */\n      readonly kind: \"file-snapshot\";\n      /** Absolute path of the source file. */\n      readonly filePath: string;\n    };\n\n/**\n * Response variants returned by the semantic tsserver plugin.\n *\n * @public\n */\nexport type FormSpecSemanticResponse =\n  | {\n      /** Protocol version carried with every response. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Response variant carrying health information. */\n      readonly kind: \"health\";\n      /** Manifest describing the active semantic service. */\n      readonly manifest: FormSpecAnalysisManifest;\n    }\n  | {\n      /** Protocol version carried with every response. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Response variant carrying completion context. */\n      readonly kind: \"completion\";\n      /** Source hash used to validate cursor data freshness. */\n      readonly sourceHash: string;\n      /** Completion context for the requested cursor position. */\n      readonly context: FormSpecSerializedCompletionContext;\n    }\n  | {\n      /** Protocol version carried with every response. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Response variant carrying hover information. */\n      readonly kind: \"hover\";\n      /** Source hash used to validate hover freshness. */\n      readonly sourceHash: string;\n      /** Hover payload, if one is available. */\n      readonly hover: FormSpecSerializedHoverInfo | null;\n    }\n  | {\n      /** Protocol version carried with every response. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Response variant carrying diagnostics. */\n      readonly kind: \"diagnostics\";\n      /** Source hash used to validate diagnostic freshness. */\n      readonly sourceHash: string;\n      /** Diagnostics for the requested file. */\n      readonly diagnostics: readonly FormSpecAnalysisDiagnostic[];\n    }\n  | {\n      /** Protocol version carried with every response. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Response variant carrying a serialized file snapshot. */\n      readonly kind: \"file-snapshot\";\n      /** Snapshot of the requested file, if available. */\n      readonly snapshot: FormSpecAnalysisFileSnapshot | null;\n    }\n  | {\n      /** Protocol version carried with every response. */\n      readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n      /** Error response variant. */\n      readonly kind: \"error\";\n      /** Human-readable error message. */\n      readonly error: string;\n    };\n\nfunction isObjectRecord(value: unknown): value is Record<string, unknown> {\n  return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isCommentSpan(value: unknown): value is CommentSpan {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<CommentSpan>;\n  return typeof candidate.start === \"number\" && typeof candidate.end === \"number\";\n}\n\nfunction isStringArray(value: unknown): value is readonly string[] {\n  return Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n}\n\nfunction isNumberArray(value: unknown): value is readonly number[] {\n  return Array.isArray(value) && value.every((entry) => typeof entry === \"number\");\n}\n\nfunction isFiniteNumber(value: unknown): value is number {\n  return typeof value === \"number\" && Number.isFinite(value);\n}\n\nfunction isBooleanArray(value: unknown): value is readonly boolean[] {\n  return Array.isArray(value) && value.every((entry) => typeof entry === \"boolean\");\n}\n\nfunction isJsonValue(value: unknown): value is FormSpecSerializedJsonValue {\n  if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n    return true;\n  }\n\n  if (isFiniteNumber(value)) {\n    return true;\n  }\n\n  if (Array.isArray(value)) {\n    return value.every(isJsonValue);\n  }\n\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  return Object.values(value).every(isJsonValue);\n}\n\nfunction isDiagnosticDataValue(value: unknown): value is FormSpecAnalysisDiagnosticDataValue {\n  return (\n    typeof value === \"string\" ||\n    typeof value === \"number\" ||\n    typeof value === \"boolean\" ||\n    isStringArray(value) ||\n    isNumberArray(value) ||\n    isBooleanArray(value)\n  );\n}\n\nfunction isDiagnosticDataRecord(\n  value: unknown\n): value is Record<string, FormSpecAnalysisDiagnosticDataValue> {\n  return isObjectRecord(value) && Object.values(value).every(isDiagnosticDataValue);\n}\n\nconst FORM_SPEC_PLACEMENT_VALUES = new Set<FormSpecPlacement>(FORM_SPEC_PLACEMENTS);\n\nconst FORM_SPEC_TARGET_KIND_VALUES = new Set<FormSpecTargetKind>(FORM_SPEC_TARGET_KINDS);\n\nfunction isPlacementValue(value: unknown): value is FormSpecPlacement {\n  return typeof value === \"string\" && FORM_SPEC_PLACEMENT_VALUES.has(value as FormSpecPlacement);\n}\n\nfunction isTargetKindValue(value: unknown): value is FormSpecTargetKind {\n  return typeof value === \"string\" && FORM_SPEC_TARGET_KIND_VALUES.has(value as FormSpecTargetKind);\n}\n\nfunction isPlacementArray(value: unknown): value is readonly FormSpecPlacement[] {\n  return Array.isArray(value) && value.every(isPlacementValue);\n}\n\nfunction isTargetKindArray(value: unknown): value is readonly FormSpecTargetKind[] {\n  return Array.isArray(value) && value.every(isTargetKindValue);\n}\n\nfunction isDiagnosticCategory(value: unknown): value is FormSpecAnalysisDiagnosticCategory {\n  return (\n    value === \"tag-recognition\" ||\n    value === \"value-parsing\" ||\n    value === \"type-compatibility\" ||\n    value === \"target-resolution\" ||\n    value === \"constraint-validation\" ||\n    value === \"infrastructure\"\n  );\n}\n\nfunction isIpcEndpoint(value: unknown): value is FormSpecIpcEndpoint {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecIpcEndpoint>;\n  return (\n    (candidate.kind === \"unix-socket\" || candidate.kind === \"windows-pipe\") &&\n    typeof candidate.address === \"string\"\n  );\n}\n\nfunction isSerializedTagDefinition(value: unknown): value is FormSpecSerializedTagDefinition {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedTagDefinition>;\n  return (\n    typeof candidate.canonicalName === \"string\" &&\n    typeof candidate.completionDetail === \"string\" &&\n    typeof candidate.hoverMarkdown === \"string\"\n  );\n}\n\nfunction isSerializedTagSignature(value: unknown): value is FormSpecSerializedTagSignature {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedTagSignature>;\n  return typeof candidate.label === \"string\" && isPlacementArray(candidate.placements);\n}\n\nfunction isSerializedCommentTargetSpecifier(\n  value: unknown\n): value is FormSpecSerializedCommentTargetSpecifier {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedCommentTargetSpecifier>;\n  return (\n    typeof candidate.rawText === \"string\" &&\n    typeof candidate.valid === \"boolean\" &&\n    typeof candidate.kind === \"string\" &&\n    isCommentSpan(candidate.fullSpan) &&\n    isCommentSpan(candidate.colonSpan) &&\n    isCommentSpan(candidate.span)\n  );\n}\n\nfunction isSerializedTagSemanticContext(\n  value: unknown\n): value is FormSpecSerializedTagSemanticContext {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedTagSemanticContext>;\n  return (\n    typeof candidate.tagName === \"string\" &&\n    (candidate.tagDefinition === null || isSerializedTagDefinition(candidate.tagDefinition)) &&\n    (candidate.placement === null || isPlacementValue(candidate.placement)) &&\n    Array.isArray(candidate.contextualSignatures) &&\n    candidate.contextualSignatures.every(isSerializedTagSignature) &&\n    isTargetKindArray(candidate.supportedTargets) &&\n    isStringArray(candidate.targetCompletions) &&\n    isStringArray(candidate.compatiblePathTargets) &&\n    isStringArray(candidate.valueLabels) &&\n    isStringArray(candidate.argumentCompletions) &&\n    Array.isArray(candidate.signatures) &&\n    candidate.signatures.every(isSerializedTagSignature) &&\n    (candidate.contextualTagHoverMarkdown === null ||\n      typeof candidate.contextualTagHoverMarkdown === \"string\") &&\n    (candidate.tagHoverMarkdown === null || typeof candidate.tagHoverMarkdown === \"string\") &&\n    (candidate.targetHoverMarkdown === null || typeof candidate.targetHoverMarkdown === \"string\") &&\n    (candidate.argumentHoverMarkdown === null ||\n      typeof candidate.argumentHoverMarkdown === \"string\")\n  );\n}\n\nfunction isSerializedCompletionContext(\n  value: unknown\n): value is FormSpecSerializedCompletionContext {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedCompletionContext>;\n  if (typeof candidate.kind !== \"string\") {\n    return false;\n  }\n\n  switch (candidate.kind) {\n    case \"tag-name\":\n      return typeof candidate.prefix === \"string\" && Array.isArray(candidate.availableTags)\n        ? candidate.availableTags.every(isSerializedTagDefinition)\n        : false;\n    case \"target\":\n      return isSerializedTagSemanticContext(candidate.semantic);\n    case \"argument\":\n      return (\n        isSerializedTagSemanticContext(candidate.semantic) && isStringArray(candidate.valueLabels)\n      );\n    case \"none\":\n      return true;\n    default:\n      return false;\n  }\n}\n\nfunction isSerializedHoverInfo(value: unknown): value is FormSpecSerializedHoverInfo {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedHoverInfo>;\n  return (\n    (candidate.kind === \"tag-name\" ||\n      candidate.kind === \"target\" ||\n      candidate.kind === \"argument\" ||\n      candidate.kind === \"declaration\") &&\n    typeof candidate.markdown === \"string\"\n  );\n}\n\nfunction hasCurrentProtocolVersion(\n  value: unknown\n): value is { readonly protocolVersion: typeof FORMSPEC_ANALYSIS_PROTOCOL_VERSION } {\n  return isObjectRecord(value) && value[\"protocolVersion\"] === FORMSPEC_ANALYSIS_PROTOCOL_VERSION;\n}\n\nfunction isAnalysisDiagnosticLocation(value: unknown): value is FormSpecAnalysisDiagnosticLocation {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecAnalysisDiagnosticLocation>;\n  return (\n    typeof candidate.filePath === \"string\" &&\n    isCommentSpan(candidate.range) &&\n    (candidate.message === undefined || typeof candidate.message === \"string\")\n  );\n}\n\nfunction isAnalysisDiagnostic(value: unknown): value is FormSpecAnalysisDiagnostic {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecAnalysisDiagnostic>;\n  return (\n    typeof candidate.code === \"string\" &&\n    isDiagnosticCategory(candidate.category) &&\n    typeof candidate.message === \"string\" &&\n    isCommentSpan(candidate.range) &&\n    (candidate.severity === \"error\" ||\n      candidate.severity === \"warning\" ||\n      candidate.severity === \"info\") &&\n    Array.isArray(candidate.relatedLocations) &&\n    candidate.relatedLocations.every(isAnalysisDiagnosticLocation) &&\n    isDiagnosticDataRecord(candidate.data)\n  );\n}\n\nfunction isAnalysisTagSnapshot(value: unknown): value is FormSpecAnalysisTagSnapshot {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecAnalysisTagSnapshot>;\n  return (\n    typeof candidate.rawTagName === \"string\" &&\n    typeof candidate.normalizedTagName === \"string\" &&\n    typeof candidate.recognized === \"boolean\" &&\n    isCommentSpan(candidate.fullSpan) &&\n    isCommentSpan(candidate.tagNameSpan) &&\n    (candidate.payloadSpan === null || isCommentSpan(candidate.payloadSpan)) &&\n    (candidate.target === null || isSerializedCommentTargetSpecifier(candidate.target)) &&\n    (candidate.argumentSpan === null || isCommentSpan(candidate.argumentSpan)) &&\n    typeof candidate.argumentText === \"string\" &&\n    isSerializedTagSemanticContext(candidate.semantic)\n  );\n}\n\nfunction isExplicitMetadataSource(\n  value: unknown\n): value is FormSpecSerializedExplicitMetadataSource {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedExplicitMetadataSource>;\n  return (\n    typeof candidate.tagName === \"string\" &&\n    (candidate.form === \"bare\" || candidate.form === \"qualified\") &&\n    isCommentSpan(candidate.fullRange) &&\n    isCommentSpan(candidate.tagNameRange) &&\n    (candidate.qualifierRange === undefined || isCommentSpan(candidate.qualifierRange)) &&\n    isCommentSpan(candidate.valueRange) &&\n    (candidate.qualifier === undefined || typeof candidate.qualifier === \"string\")\n  );\n}\n\nfunction isResolvedScalarMetadata(\n  value: unknown\n): value is FormSpecSerializedResolvedScalarMetadata {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedResolvedScalarMetadata>;\n  return (\n    typeof candidate.value === \"string\" &&\n    (candidate.source === \"explicit\" || candidate.source === \"inferred\")\n  );\n}\n\nfunction isResolvedMetadata(value: unknown): value is FormSpecSerializedResolvedMetadata {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedResolvedMetadata>;\n  return (\n    (candidate.apiName === undefined || isResolvedScalarMetadata(candidate.apiName)) &&\n    (candidate.displayName === undefined || isResolvedScalarMetadata(candidate.displayName)) &&\n    (candidate.apiNamePlural === undefined || isResolvedScalarMetadata(candidate.apiNamePlural)) &&\n    (candidate.displayNamePlural === undefined ||\n      isResolvedScalarMetadata(candidate.displayNamePlural))\n  );\n}\n\nfunction isMetadataEntry(value: unknown): value is FormSpecSerializedMetadataEntry {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedMetadataEntry>;\n  return (\n    typeof candidate.slotId === \"string\" &&\n    typeof candidate.tagName === \"string\" &&\n    (candidate.qualifier === undefined || typeof candidate.qualifier === \"string\") &&\n    typeof candidate.value === \"string\" &&\n    (candidate.source === \"explicit\" || candidate.source === \"inferred\") &&\n    (candidate.explicitSource === undefined || isExplicitMetadataSource(candidate.explicitSource))\n  );\n}\n\nfunction isDeclarationFact(value: unknown): value is FormSpecSerializedDeclarationFact {\n  if (!isObjectRecord(value) || typeof value[\"kind\"] !== \"string\") {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSerializedDeclarationFact>;\n  switch (candidate.kind) {\n    case \"description\":\n    case \"remarks\":\n    case \"example\":\n      return typeof candidate.value === \"string\";\n    case \"default-value\":\n      return isJsonValue(candidate.value);\n    case \"deprecated\":\n      return candidate.message === null || typeof candidate.message === \"string\";\n    case \"numeric-constraints\":\n      return (\n        (candidate.targetPath === null || typeof candidate.targetPath === \"string\") &&\n        (candidate.minimum === undefined || isFiniteNumber(candidate.minimum)) &&\n        (candidate.maximum === undefined || isFiniteNumber(candidate.maximum)) &&\n        (candidate.exclusiveMinimum === undefined || isFiniteNumber(candidate.exclusiveMinimum)) &&\n        (candidate.exclusiveMaximum === undefined || isFiniteNumber(candidate.exclusiveMaximum)) &&\n        (candidate.multipleOf === undefined || isFiniteNumber(candidate.multipleOf))\n      );\n    case \"string-constraints\":\n      return (\n        (candidate.targetPath === null || typeof candidate.targetPath === \"string\") &&\n        (candidate.minLength === undefined || isFiniteNumber(candidate.minLength)) &&\n        (candidate.maxLength === undefined || isFiniteNumber(candidate.maxLength)) &&\n        isStringArray(candidate.patterns)\n      );\n    case \"array-constraints\":\n      return (\n        (candidate.targetPath === null || typeof candidate.targetPath === \"string\") &&\n        (candidate.minItems === undefined || isFiniteNumber(candidate.minItems)) &&\n        (candidate.maxItems === undefined || isFiniteNumber(candidate.maxItems)) &&\n        (candidate.uniqueItems === undefined || typeof candidate.uniqueItems === \"boolean\")\n      );\n    case \"allowed-members\":\n      return (\n        (candidate.targetPath === null || typeof candidate.targetPath === \"string\") &&\n        Array.isArray(candidate.members) &&\n        candidate.members.every((member) => typeof member === \"string\" || isFiniteNumber(member))\n      );\n    case \"const\":\n      return (\n        (candidate.targetPath === null || typeof candidate.targetPath === \"string\") &&\n        isJsonValue(candidate.value)\n      );\n    case \"custom-constraint\":\n      return (\n        (candidate.targetPath === null || typeof candidate.targetPath === \"string\") &&\n        typeof candidate.constraintId === \"string\" &&\n        (candidate.compositionRule === \"intersect\" || candidate.compositionRule === \"override\") &&\n        isJsonValue(candidate.payload)\n      );\n    default:\n      return false;\n  }\n}\n\nfunction isDeclarationSummary(value: unknown): value is FormSpecAnalysisDeclarationSummary {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecAnalysisDeclarationSummary>;\n  return (\n    (candidate.summaryText === null || typeof candidate.summaryText === \"string\") &&\n    (candidate.resolvedMetadata === null || isResolvedMetadata(candidate.resolvedMetadata)) &&\n    Array.isArray(candidate.metadataEntries) &&\n    candidate.metadataEntries.every(isMetadataEntry) &&\n    Array.isArray(candidate.facts) &&\n    candidate.facts.every(isDeclarationFact) &&\n    typeof candidate.hoverMarkdown === \"string\"\n  );\n}\n\nfunction isAnalysisCommentSnapshot(value: unknown): value is FormSpecAnalysisCommentSnapshot {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecAnalysisCommentSnapshot>;\n  return (\n    isCommentSpan(candidate.commentSpan) &&\n    isCommentSpan(candidate.declarationSpan) &&\n    (candidate.placement === null || isPlacementValue(candidate.placement)) &&\n    (candidate.subjectType === null || typeof candidate.subjectType === \"string\") &&\n    (candidate.hostType === null || typeof candidate.hostType === \"string\") &&\n    isDeclarationSummary(candidate.declarationSummary) &&\n    Array.isArray(candidate.tags) &&\n    candidate.tags.every(isAnalysisTagSnapshot)\n  );\n}\n\nfunction isAnalysisFileSnapshot(value: unknown): value is FormSpecAnalysisFileSnapshot {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecAnalysisFileSnapshot>;\n  return (\n    typeof candidate.filePath === \"string\" &&\n    typeof candidate.sourceHash === \"string\" &&\n    typeof candidate.generatedAt === \"string\" &&\n    Array.isArray(candidate.comments) &&\n    candidate.comments.every(isAnalysisCommentSnapshot) &&\n    Array.isArray(candidate.diagnostics) &&\n    candidate.diagnostics.every(isAnalysisDiagnostic)\n  );\n}\n\n/**\n * Validates an unknown manifest payload from disk before consumers trust it.\n *\n * @public\n */\nexport function isFormSpecAnalysisManifest(value: unknown): value is FormSpecAnalysisManifest {\n  if (!isObjectRecord(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecAnalysisManifest>;\n  return (\n    candidate.protocolVersion === FORMSPEC_ANALYSIS_PROTOCOL_VERSION &&\n    candidate.analysisSchemaVersion === FORMSPEC_ANALYSIS_SCHEMA_VERSION &&\n    typeof candidate.workspaceRoot === \"string\" &&\n    typeof candidate.workspaceId === \"string\" &&\n    isIpcEndpoint(candidate.endpoint) &&\n    typeof candidate.typescriptVersion === \"string\" &&\n    typeof candidate.extensionFingerprint === \"string\" &&\n    typeof candidate.generation === \"number\" &&\n    typeof candidate.updatedAt === \"string\"\n  );\n}\n\n/**\n * Validates an unknown inbound IPC request before dispatching it.\n *\n * @public\n */\nexport function isFormSpecSemanticQuery(value: unknown): value is FormSpecSemanticQuery {\n  if (!hasCurrentProtocolVersion(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSemanticQuery>;\n  if (typeof candidate.kind !== \"string\") {\n    return false;\n  }\n\n  switch (candidate.kind) {\n    case \"health\":\n      return true;\n    case \"completion\":\n    case \"hover\":\n      return typeof candidate.filePath === \"string\" && typeof candidate.offset === \"number\";\n    case \"diagnostics\":\n    case \"file-snapshot\":\n      return typeof candidate.filePath === \"string\";\n    default:\n      return false;\n  }\n}\n\n/**\n * Validates an unknown IPC response before the language server consumes it.\n *\n * @public\n */\nexport function isFormSpecSemanticResponse(value: unknown): value is FormSpecSemanticResponse {\n  if (!hasCurrentProtocolVersion(value)) {\n    return false;\n  }\n\n  const candidate = value as Partial<FormSpecSemanticResponse>;\n  if (typeof candidate.kind !== \"string\") {\n    return false;\n  }\n\n  switch (candidate.kind) {\n    case \"health\":\n      return isFormSpecAnalysisManifest(candidate.manifest);\n    case \"completion\":\n      return (\n        typeof candidate.sourceHash === \"string\" && isSerializedCompletionContext(candidate.context)\n      );\n    case \"hover\":\n      return (\n        typeof candidate.sourceHash === \"string\" &&\n        (candidate.hover === null || isSerializedHoverInfo(candidate.hover))\n      );\n    case \"diagnostics\":\n      return (\n        typeof candidate.sourceHash === \"string\" &&\n        Array.isArray(candidate.diagnostics) &&\n        candidate.diagnostics.every(isAnalysisDiagnostic)\n      );\n    case \"file-snapshot\":\n      return candidate.snapshot === null || isAnalysisFileSnapshot(candidate.snapshot);\n    case \"error\":\n      return typeof candidate.error === \"string\";\n    default:\n      return false;\n  }\n}\n\n/**\n * Computes a stable, non-cryptographic hash for document staleness checks\n * across the plugin/LSP boundary.\n *\n * @public\n */\nexport function computeFormSpecTextHash(text: string): string {\n  let hash = 0x811c9dc5;\n  for (let index = 0; index < text.length; index += 1) {\n    hash ^= text.charCodeAt(index);\n    hash = Math.imul(hash, 0x01000193);\n  }\n\n  return (hash >>> 0).toString(16).padStart(8, \"0\");\n}\n\n/**\n * Converts a parsed target specifier into its transport-safe JSON form.\n *\n * @internal\n */\nexport function serializeCommentTargetSpecifier(\n  target: ParsedCommentTargetSpecifier | null\n): FormSpecSerializedCommentTargetSpecifier | null {\n  if (target === null) {\n    return null;\n  }\n\n  return {\n    rawText: target.rawText,\n    valid: target.valid,\n    kind: target.kind,\n    fullSpan: target.fullSpan,\n    colonSpan: target.colonSpan,\n    span: target.span,\n  };\n}\n\n/**\n * Serializes tag-level semantic context for cross-process consumption.\n *\n * @internal\n */\nexport function serializeCommentTagSemanticContext(\n  semantic: CommentTagSemanticContext\n): FormSpecSerializedTagSemanticContext {\n  return {\n    tagName: semantic.tag.normalizedTagName,\n    tagDefinition:\n      semantic.tagDefinition === null\n        ? null\n        : {\n            canonicalName: semantic.tagDefinition.canonicalName,\n            completionDetail: semantic.tagDefinition.completionDetail,\n            hoverMarkdown: semantic.tagDefinition.hoverMarkdown,\n          },\n    placement: semantic.placement,\n    contextualSignatures: semantic.contextualSignatures.map((signature) => ({\n      label: signature.label,\n      placements: signature.placements,\n    })),\n    supportedTargets: semantic.supportedTargets,\n    targetCompletions: semantic.targetCompletions,\n    compatiblePathTargets: semantic.compatiblePathTargets,\n    valueLabels: semantic.valueLabels,\n    argumentCompletions: semantic.argumentCompletions,\n    contextualTagHoverMarkdown: semantic.contextualTagHoverMarkdown,\n    signatures: semantic.signatures.map((signature) => ({\n      label: signature.label,\n      placements: signature.placements,\n    })),\n    tagHoverMarkdown: semantic.tagHoverMarkdown,\n    targetHoverMarkdown: semantic.targetHoverMarkdown,\n    argumentHoverMarkdown: semantic.argumentHoverMarkdown,\n  };\n}\n\n/**\n * Serializes a cursor-scoped completion context for IPC.\n *\n * @internal\n */\nexport function serializeCompletionContext(\n  context: SemanticCommentCompletionContext\n): FormSpecSerializedCompletionContext {\n  switch (context.kind) {\n    case \"tag-name\":\n      return {\n        kind: \"tag-name\",\n        prefix: context.prefix,\n        availableTags: context.availableTags.map((tag) => ({\n          canonicalName: tag.canonicalName,\n          completionDetail: tag.completionDetail,\n          hoverMarkdown: tag.hoverMarkdown,\n        })),\n      };\n    case \"target\":\n      return {\n        kind: \"target\",\n        semantic: serializeCommentTagSemanticContext(context.semantic),\n      };\n    case \"argument\":\n      return {\n        kind: \"argument\",\n        semantic: serializeCommentTagSemanticContext(context.semantic),\n        valueLabels: context.valueLabels,\n      };\n    case \"none\":\n      return { kind: \"none\" };\n    default: {\n      const exhaustive: never = context;\n      return exhaustive;\n    }\n  }\n}\n\n/**\n * Serializes hover information for cross-process transport.\n *\n * @internal\n */\nexport function serializeHoverInfo(\n  hover: CommentHoverInfo | null\n): FormSpecSerializedHoverInfo | null {\n  return hover === null\n    ? null\n    : {\n        kind: hover.kind,\n        markdown: hover.markdown,\n      };\n}\n\n/**\n * Serializes a parsed tag plus its semantic context into a file snapshot entry.\n *\n * @internal\n */\nexport function serializeParsedCommentTag(\n  tag: ParsedCommentTag,\n  semantic: CommentTagSemanticContext\n): FormSpecAnalysisTagSnapshot {\n  return {\n    rawTagName: tag.rawTagName,\n    normalizedTagName: tag.normalizedTagName,\n    recognized: tag.recognized,\n    fullSpan: tag.fullSpan,\n    tagNameSpan: tag.tagNameSpan,\n    payloadSpan: tag.payloadSpan,\n    target: serializeCommentTargetSpecifier(tag.target),\n    argumentSpan: tag.argumentSpan,\n    argumentText: tag.argumentText,\n    semantic: serializeCommentTagSemanticContext(semantic),\n  };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,uBASO;AAgJA,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,kBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,yBAAyB;AAAA,EAC7B;AAAA,EACA;AACF;AAEA,IAAM,iBAAiB;AAAA,EACrB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,IAAM,qBAAqB,oBAAI,IAAI,CAAC,aAAa,aAAa,YAAY,UAAU,CAAC;AACrF,IAAM,4BAA4B,oBAAI,IAAI,CAAC,OAAO,CAAC;AACnD,IAAM,kBAAkB,oBAAI,IAAI,CAAC,SAAS,aAAa,CAAC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