{"version":3,"sources":["../src/index.ts","../src/loader.ts","../src/defaults.ts","../src/define.ts","../src/resolve.ts","../src/validators/field-types.ts","../src/validators/layout.ts","../src/validators/field-options.ts","../src/validators/formspec.ts"],"sourcesContent":["/**\n * \\@formspec/config\n *\n * Constraint validation for FormSpec - restrict features based on target\n * environment capabilities.\n *\n * This package provides:\n * - Type definitions for constraint configuration\n * - YAML/TypeScript config file loading\n * - Core validation logic for FormSpec elements\n * - JSON Schema for .formspec.yml validation\n *\n * @example\n * ```ts\n * import { loadConfig, validateFormSpecElements } from '@formspec/config';\n * import { formspec, field } from '@formspec/dsl';\n *\n * // Load constraints from .formspec.yml\n * const { config } = await loadConfig();\n *\n * // Create a form\n * const form = formspec(\n *   field.text(\"name\"),\n *   field.dynamicEnum(\"country\", \"countries\"),\n * );\n *\n * // Validate against constraints\n * const result = validateFormSpecElements(form.elements, { constraints: config });\n *\n * if (!result.valid) {\n *   console.error('Validation failed:', result.issues);\n * }\n * ```\n *\n * @packageDocumentation\n */\n\n// Types\nexport type {\n  Severity,\n  FieldTypeConstraints,\n  LayoutConstraints,\n  LayoutTypeConstraints,\n  RuleEffectConstraints,\n  RuleConstraints,\n  UISchemaConstraints,\n  FieldOptionConstraints,\n  ControlOptionConstraints,\n  ConstraintConfig,\n  ResolvedConstraintConfig,\n  ResolvedUISchemaConstraints,\n  ResolvedRuleConstraints,\n  FormSpecConfig,\n  FormSpecPackageOverride,\n  ValidationIssue,\n  ValidationResult,\n} from \"./types.js\";\nexport type {\n  AnyField,\n  ArrayField,\n  BooleanField,\n  Conditional,\n  DynamicEnumField,\n  DynamicSchemaField,\n  EnumOption,\n  EnumOptionValue,\n  FormElement,\n  FormSpec,\n  Group,\n  NumberField,\n  ObjectField,\n  StaticEnumField,\n  TextField,\n} from \"@formspec/core\";\n\n// Logger contract (re-exported so LoadConfigOptions.logger resolves in the API surface)\nexport type { LoggerLike } from \"@formspec/core\";\n\n// Config loading\nexport {\n  loadFormSpecConfig,\n  // eslint-disable-next-line @typescript-eslint/no-deprecated -- backward-compatible re-export\n  loadConfig,\n  defineConstraints,\n  type LoadConfigOptions,\n  type LoadConfigResult,\n  type LoadConfigFoundResult,\n  type LoadConfigNotFoundResult,\n} from \"./loader.js\";\n\n// Config factory + resolution\nexport { defineFormSpecConfig } from \"./define.js\";\nexport { resolveConfigForFile, type ResolvedFormSpecConfig } from \"./resolve.js\";\n\n// Defaults\nexport { DEFAULT_CONSTRAINTS, DEFAULT_CONFIG, mergeWithDefaults } from \"./defaults.js\";\n\n// Validators\nexport {\n  validateFormSpecElements,\n  validateFormSpec,\n  type FormSpecValidationOptions,\n} from \"./validators/formspec.js\";\n\nexport {\n  validateFieldTypes,\n  isFieldTypeAllowed,\n  getFieldTypeSeverity,\n  type FieldTypeContext,\n} from \"./validators/field-types.js\";\n\nexport {\n  validateLayout,\n  isLayoutTypeAllowed,\n  isNestingDepthAllowed,\n  type LayoutContext,\n} from \"./validators/layout.js\";\n\nexport {\n  validateFieldOptions,\n  extractFieldOptions,\n  isFieldOptionAllowed,\n  getFieldOptionSeverity,\n  type FieldOptionsContext,\n  type FieldOption,\n} from \"./validators/field-options.js\";\n","import { readFile } from \"node:fs/promises\";\nimport { resolve, dirname } from \"node:path\";\n// Lazy import — jiti is Node-only and must not be statically analyzed\n// by browser bundlers (e.g., the playground's Vite build).\nasync function getJiti() {\n  const { createJiti } = await import(\"jiti\");\n  return createJiti(import.meta.url);\n}\nimport type { LoggerLike } from \"@formspec/core\";\nimport { noopLogger } from \"@formspec/core\";\nimport type { FormSpecConfig, ConstraintConfig, ResolvedConstraintConfig } from \"./types.js\";\nimport { mergeWithDefaults } from \"./defaults.js\";\n\n/**\n * Config file names to search for, in priority order.\n */\nconst CONFIG_FILE_NAMES = [\n  \"formspec.config.ts\",\n  \"formspec.config.mts\",\n  \"formspec.config.js\",\n  \"formspec.config.mjs\",\n];\n\n/**\n * Options for loading configuration.\n *\n * @public\n */\nexport interface LoadConfigOptions {\n  /**\n   * The directory to start searching from.\n   * Defaults to process.cwd().\n   */\n  searchFrom?: string;\n\n  /**\n   * Explicit path to a config file.\n   * If provided, skips file discovery entirely.\n   */\n  configPath?: string;\n\n  /**\n   * Optional logger for diagnostic output. Defaults to a no-op logger so\n   * existing callers produce no output.\n   */\n  logger?: LoggerLike | undefined;\n}\n\n/**\n * Result when a config file was found and loaded.\n *\n * @public\n */\nexport interface LoadConfigFoundResult {\n  /** The loaded configuration */\n  config: FormSpecConfig;\n  /** The absolute path to the config file that was loaded */\n  configPath: string;\n  /** Whether a config file was found */\n  found: true;\n}\n\n/**\n * Result when no config file was found.\n *\n * @public\n */\nexport interface LoadConfigNotFoundResult {\n  /** Whether a config file was found */\n  found: false;\n}\n\n/**\n * Result of loading configuration.\n *\n * @public\n */\nexport type LoadConfigResult = LoadConfigFoundResult | LoadConfigNotFoundResult;\n\n/**\n * Checks if a directory is a workspace root by looking for a package.json\n * with a \"workspaces\" field.\n */\nasync function isWorkspaceRoot(dir: string): Promise<boolean> {\n  const pkgPath = resolve(dir, \"package.json\");\n  try {\n    const content = await readFile(pkgPath, \"utf-8\");\n    const pkg = JSON.parse(content) as Record<string, unknown>;\n    return \"workspaces\" in pkg;\n  } catch {\n    return false;\n  }\n}\n\n/**\n * Walks up the directory tree from startDir, searching for a config file.\n * Stops at the filesystem root or a directory containing a workspace root package.json.\n */\nasync function findConfigFile(startDir: string): Promise<string | null> {\n  let currentDir = resolve(startDir);\n\n  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- intentional infinite loop with explicit break conditions\n  while (true) {\n    for (const fileName of CONFIG_FILE_NAMES) {\n      const filePath = resolve(currentDir, fileName);\n      try {\n        await readFile(filePath);\n        return filePath;\n      } catch {\n        // File doesn't exist, try next name\n      }\n    }\n\n    // Stop at workspace root — don't cross workspace boundaries\n    if (await isWorkspaceRoot(currentDir)) {\n      break;\n    }\n\n    const parentDir = dirname(currentDir);\n    // Reached filesystem root when dirname returns same path\n    if (parentDir === currentDir) {\n      break;\n    }\n    currentDir = parentDir;\n  }\n\n  return null;\n}\n\n/**\n * Loads and validates a TypeScript/JavaScript config file using jiti.\n * The file must have a default export of a FormSpecConfig object.\n */\nasync function loadConfigFile(filePath: string): Promise<FormSpecConfig> {\n  const jiti = await getJiti();\n  const mod = await jiti.import(filePath);\n\n  const defaultExport = (mod as { default?: unknown }).default ?? mod;\n\n  if (defaultExport === null || defaultExport === undefined) {\n    return {};\n  }\n\n  if (typeof defaultExport !== \"object\" || Array.isArray(defaultExport)) {\n    throw new Error(\n      `Invalid config file at ${filePath}: default export must be a FormSpecConfig object, got ${Array.isArray(defaultExport) ? \"array\" : typeof defaultExport}`\n    );\n  }\n\n  const config = defaultExport as FormSpecConfig;\n  validateLoadedConfig(config, filePath);\n  return config;\n}\n\n/**\n * Validates known fields of a loaded config for structural correctness.\n * Catches common misconfiguration with clear error messages.\n */\nfunction validateLoadedConfig(config: FormSpecConfig, filePath: string): void {\n  if (config.extensions !== undefined && !Array.isArray(config.extensions)) {\n    throw new Error(\n      `Invalid config at ${filePath}: \"extensions\" must be an array, got ${typeof config.extensions}`\n    );\n  }\n  if (\n    config.vendorPrefix !== undefined &&\n    (typeof config.vendorPrefix !== \"string\" || !config.vendorPrefix.startsWith(\"x-\"))\n  ) {\n    throw new Error(\n      `Invalid config at ${filePath}: \"vendorPrefix\" must be a string starting with \"x-\", got ${JSON.stringify(config.vendorPrefix)}`\n    );\n  }\n  validateEnumSerializationValue(config.enumSerialization, \"enumSerialization\", filePath);\n  validatePackageOverrides(config.packages, filePath);\n}\n\nfunction validatePackageOverrides(packages: unknown, filePath: string): void {\n  if (packages === undefined) {\n    return;\n  }\n  if (!isStringKeyedRecord(packages)) {\n    throw new Error(\n      `Invalid config at ${filePath}: \"packages\" must be an object mapping glob patterns to override objects, got ${JSON.stringify(packages)}`\n    );\n  }\n\n  for (const [pattern, override] of Object.entries(packages)) {\n    // Fail fast with a precise pointer rather than letting a later property access\n    // throw a raw `TypeError` against a non-object override value.\n    if (!isStringKeyedRecord(override)) {\n      throw new Error(\n        `Invalid config at ${filePath}: \"packages[${JSON.stringify(pattern)}]\" must be an override object, got ${JSON.stringify(override)}`\n      );\n    }\n    validateEnumSerializationValue(\n      override[\"enumSerialization\"],\n      `packages[${JSON.stringify(pattern)}].enumSerialization`,\n      filePath\n    );\n  }\n}\n\n/**\n * Full plain-object guard. Rejects arrays, wrapped primitives\n * (`Object(10n)`), class instances (`new Map()`, `new Date()`), and\n * symbol-keyed objects — shapes that would otherwise slip past a naive\n * `typeof === \"object\"` check and silently defeat validation.\n */\nfunction isStringKeyedRecord(value: unknown): value is Record<string, unknown> {\n  if (typeof value !== \"object\" || value === null) return false;\n  if (Array.isArray(value)) return false;\n  if (Object.getPrototypeOf(value) !== Object.prototype) return false;\n  if (Object.getOwnPropertySymbols(value).length > 0) return false;\n  return true;\n}\n\nfunction validateEnumSerializationValue(value: unknown, label: string, filePath: string): void {\n  if (value !== undefined && value !== \"enum\" && value !== \"oneOf\" && value !== \"smart-size\") {\n    throw new Error(\n      `Invalid config at ${filePath}: \"${label}\" must be \"enum\", \"oneOf\", or \"smart-size\", got ${JSON.stringify(value)}`\n    );\n  }\n}\n\n/**\n * Loads FormSpec configuration from a TypeScript config file.\n *\n * Searches for `formspec.config.ts` (and `.mts`, `.js`, `.mjs` variants)\n * starting from `searchFrom` and walking up the directory tree. Stops at\n * the filesystem root or a workspace root (a directory with a package.json\n * containing a \"workspaces\" field).\n *\n * @param options - Options for loading configuration\n * @returns The loaded configuration, or `{ found: false }` if no config file exists\n *\n * @example\n * ```ts\n * // Discover config from current directory\n * const result = await loadFormSpecConfig();\n * if (result.found) {\n *   console.log(result.config, result.configPath);\n * }\n *\n * // Discover config from a specific directory\n * const result = await loadFormSpecConfig({ searchFrom: '/path/to/project' });\n *\n * // Load a specific config file\n * const result = await loadFormSpecConfig({ configPath: '/path/to/formspec.config.ts' });\n * ```\n *\n * @public\n */\nexport async function loadFormSpecConfig(\n  options: LoadConfigOptions = {}\n): Promise<LoadConfigResult> {\n  const { searchFrom = process.cwd(), configPath, logger: rawLogger } = options;\n  const logger = (rawLogger ?? noopLogger).child({ stage: \"config\" });\n\n  let resolvedPath: string | null = null;\n\n  if (configPath) {\n    resolvedPath = resolve(configPath);\n    try {\n      await readFile(resolvedPath);\n    } catch {\n      throw new Error(`Config file not found at ${resolvedPath}`);\n    }\n  } else {\n    resolvedPath = await findConfigFile(searchFrom);\n  }\n\n  if (!resolvedPath) {\n    logger.debug(\"no config file found\", { searchFrom });\n    return { found: false };\n  }\n\n  logger.debug(\"loading config file\", {\n    configPath: resolvedPath,\n    source: configPath ? \"explicit\" : \"discovered\",\n  });\n  const config = await loadConfigFile(resolvedPath);\n\n  return {\n    config,\n    configPath: resolvedPath,\n    found: true,\n  };\n}\n\n/**\n * Loads FormSpec constraint configuration from a config file.\n * Returns the resolved constraints with defaults applied.\n *\n * @deprecated Use `loadFormSpecConfig` instead, which returns the full `FormSpecConfig`.\n *\n * @param options - Options for loading configuration\n * @returns The loaded configuration with defaults applied\n *\n * @public\n */\nexport async function loadConfig(options: LoadConfigOptions = {}): Promise<{\n  config: ResolvedConstraintConfig;\n  configPath: string | null;\n  found: boolean;\n}> {\n  // Pass the logger through to the underlying implementation\n  const result = await loadFormSpecConfig(options);\n\n  if (!result.found) {\n    return {\n      config: mergeWithDefaults(undefined),\n      configPath: null,\n      found: false,\n    };\n  }\n\n  return {\n    config: mergeWithDefaults(result.config.constraints),\n    configPath: result.configPath,\n    found: true,\n  };\n}\n\n/**\n * Creates a constraint configuration directly from an object.\n * Useful for programmatic configuration without a config file.\n *\n * @param config - Partial constraint configuration\n * @returns Complete configuration with defaults applied\n *\n * @example\n * ```ts\n * const config = defineConstraints({\n *   fieldTypes: {\n *     dynamicEnum: 'error',\n *     dynamicSchema: 'error',\n *   },\n *   layout: {\n *     group: 'error',\n *   },\n * });\n * ```\n *\n * @public\n */\nexport function defineConstraints(config: ConstraintConfig): ResolvedConstraintConfig {\n  return mergeWithDefaults(config);\n}\n","import type { ConstraintConfig, FormSpecConfig, ResolvedConstraintConfig } from \"./types.js\";\n\n/**\n * Default constraint configuration that allows all features.\n * All constraints default to \"off\" (allowed).\n *\n * @beta\n */\nexport const DEFAULT_CONSTRAINTS: ResolvedConstraintConfig = {\n  fieldTypes: {\n    text: \"off\",\n    number: \"off\",\n    boolean: \"off\",\n    staticEnum: \"off\",\n    dynamicEnum: \"off\",\n    dynamicSchema: \"off\",\n    array: \"off\",\n    object: \"off\",\n  },\n  layout: {\n    group: \"off\",\n    conditionals: \"off\",\n    maxNestingDepth: Infinity,\n  },\n  uiSchema: {\n    layouts: {\n      VerticalLayout: \"off\",\n      HorizontalLayout: \"off\",\n      Group: \"off\",\n      Categorization: \"off\",\n      Category: \"off\",\n    },\n    rules: {\n      enabled: \"off\",\n      effects: {\n        SHOW: \"off\",\n        HIDE: \"off\",\n        ENABLE: \"off\",\n        DISABLE: \"off\",\n      },\n    },\n  },\n  fieldOptions: {\n    label: \"off\",\n    placeholder: \"off\",\n    required: \"off\",\n    minValue: \"off\",\n    maxValue: \"off\",\n    minItems: \"off\",\n    maxItems: \"off\",\n  },\n  controlOptions: {\n    format: \"off\",\n    readonly: \"off\",\n    multi: \"off\",\n    showUnfocusedDescription: \"off\",\n    hideRequiredAsterisk: \"off\",\n    custom: {},\n  },\n};\n\n/**\n * Default FormSpec configuration.\n *\n * @beta\n */\nexport const DEFAULT_CONFIG: FormSpecConfig = {\n  constraints: DEFAULT_CONSTRAINTS,\n};\n\n/**\n * Merges user constraints with defaults, filling in any missing values.\n *\n * @beta\n */\nexport function mergeWithDefaults(config: ConstraintConfig | undefined): ResolvedConstraintConfig {\n  if (!config) {\n    return DEFAULT_CONSTRAINTS;\n  }\n\n  return {\n    fieldTypes: {\n      ...DEFAULT_CONSTRAINTS.fieldTypes,\n      ...config.fieldTypes,\n    },\n    layout: {\n      ...DEFAULT_CONSTRAINTS.layout,\n      ...config.layout,\n    },\n    uiSchema: {\n      layouts: {\n        ...DEFAULT_CONSTRAINTS.uiSchema.layouts,\n        ...config.uiSchema?.layouts,\n      },\n      rules: {\n        enabled: config.uiSchema?.rules?.enabled ?? DEFAULT_CONSTRAINTS.uiSchema.rules.enabled,\n        effects: {\n          ...DEFAULT_CONSTRAINTS.uiSchema.rules.effects,\n          ...config.uiSchema?.rules?.effects,\n        },\n      },\n    },\n    fieldOptions: {\n      ...DEFAULT_CONSTRAINTS.fieldOptions,\n      ...config.fieldOptions,\n    },\n    controlOptions: {\n      ...DEFAULT_CONSTRAINTS.controlOptions,\n      ...config.controlOptions,\n      custom: {\n        ...DEFAULT_CONSTRAINTS.controlOptions.custom,\n        ...config.controlOptions?.custom,\n      },\n    },\n  };\n}\n","import type { FormSpecConfig } from \"./types.js\";\n\n/**\n * Identity function that provides type checking and IDE autocompletion\n * for FormSpec configuration objects.\n *\n * @example\n * ```typescript\n * import { defineFormSpecConfig } from '@formspec/config';\n *\n * export default defineFormSpecConfig({\n *   extensions: [myExtension],\n *   vendorPrefix: 'x-acme',\n * });\n * ```\n *\n * @public\n */\nexport function defineFormSpecConfig(config: FormSpecConfig): FormSpecConfig {\n  return config;\n}\n","import type {\n  FormSpecConfig,\n  FormSpecPackageOverride,\n  ConstraintConfig,\n  ResolvedConstraintConfig,\n} from \"./types.js\";\nimport { mergeWithDefaults } from \"./defaults.js\";\n\n/**\n * Resolved configuration for a specific file, with all defaults applied\n * and per-package overrides merged.\n *\n * @public\n */\nexport interface ResolvedFormSpecConfig {\n  /** Resolved extensions (empty array if none configured). */\n  readonly extensions: readonly import(\"@formspec/core\").ExtensionDefinition[];\n  /** Resolved constraint config with all defaults filled in. */\n  readonly constraints: ResolvedConstraintConfig;\n  /** Resolved metadata policy, or undefined for FormSpec built-in. */\n  readonly metadata: import(\"@formspec/core\").MetadataPolicyInput | undefined;\n  /** Resolved vendor prefix. */\n  readonly vendorPrefix: string;\n  /** Resolved enum serialization mode. */\n  readonly enumSerialization: \"enum\" | \"oneOf\" | \"smart-size\";\n}\n\n/**\n * Resolves the effective config for a specific file by matching against\n * the `packages` glob map and merging with root-level settings.\n *\n * Package overrides are evaluated in declaration order — the first matching\n * pattern wins. Declare more specific patterns before broader ones.\n *\n * @param config - The root FormSpecConfig\n * @param filePath - Absolute or relative path to the file being processed\n * @param configDir - Directory containing the config file (for relative path resolution)\n * @returns Fully resolved config with defaults applied\n *\n * @public\n */\nexport function resolveConfigForFile(\n  config: FormSpecConfig,\n  filePath: string,\n  configDir: string\n): ResolvedFormSpecConfig {\n  const override = findMatchingOverride(config.packages, filePath, configDir);\n  const merged = applyOverride(config, override);\n\n  return {\n    extensions: merged.extensions ?? [],\n    constraints: mergeWithDefaults(merged.constraints),\n    metadata: merged.metadata,\n    vendorPrefix: merged.vendorPrefix ?? \"x-formspec\",\n    enumSerialization: merged.enumSerialization ?? \"enum\",\n  };\n}\n\n/**\n * Finds the first matching package override for the given file path.\n */\nfunction findMatchingOverride(\n  packages: FormSpecConfig[\"packages\"],\n  filePath: string,\n  configDir: string\n): FormSpecPackageOverride | undefined {\n  if (packages === undefined) return undefined;\n\n  // Normalize the file path relative to the config directory\n  const relative = relativePath(filePath, configDir);\n\n  for (const [pattern, override] of Object.entries(packages)) {\n    if (matchGlob(pattern, relative)) {\n      return override;\n    }\n  }\n\n  return undefined;\n}\n\n/**\n * Deep-merges a package override into the root config. Override values\n * take precedence on conflict; unspecified override fields inherit from root.\n */\nfunction applyOverride(\n  config: FormSpecConfig,\n  override: FormSpecPackageOverride | undefined\n): FormSpecConfig {\n  if (override === undefined) return config;\n\n  return {\n    ...config,\n    ...(override.constraints !== undefined && {\n      constraints: deepMergeConstraints(config.constraints, override.constraints),\n    }),\n    ...(override.enumSerialization !== undefined && {\n      enumSerialization: override.enumSerialization,\n    }),\n    ...(override.metadata !== undefined && { metadata: override.metadata }),\n  };\n}\n\n/**\n * Deep-merges constraint configs. Override fields take precedence;\n * unspecified override sub-fields inherit from the base.\n */\nfunction deepMergeConstraints(\n  base: ConstraintConfig | undefined,\n  override: ConstraintConfig\n): ConstraintConfig {\n  if (base === undefined) return override;\n\n  const merged: ConstraintConfig = {\n    fieldTypes: { ...base.fieldTypes, ...override.fieldTypes },\n    layout: { ...base.layout, ...override.layout },\n    fieldOptions: { ...base.fieldOptions, ...override.fieldOptions },\n  };\n\n  // Merge uiSchema if either side defines it\n  if (base.uiSchema !== undefined || override.uiSchema !== undefined) {\n    merged.uiSchema = {\n      layouts: { ...base.uiSchema?.layouts, ...override.uiSchema?.layouts },\n    };\n    if (base.uiSchema?.rules !== undefined || override.uiSchema?.rules !== undefined) {\n      merged.uiSchema.rules = {\n        ...base.uiSchema?.rules,\n        ...override.uiSchema?.rules,\n      };\n      if (\n        base.uiSchema?.rules?.effects !== undefined ||\n        override.uiSchema?.rules?.effects !== undefined\n      ) {\n        merged.uiSchema.rules.effects = {\n          ...base.uiSchema?.rules?.effects,\n          ...override.uiSchema?.rules?.effects,\n        };\n      }\n    }\n  }\n\n  // Merge controlOptions with nested custom dict\n  if (base.controlOptions !== undefined || override.controlOptions !== undefined) {\n    merged.controlOptions = {\n      ...base.controlOptions,\n      ...override.controlOptions,\n    };\n    if (\n      base.controlOptions?.custom !== undefined ||\n      override.controlOptions?.custom !== undefined\n    ) {\n      merged.controlOptions.custom = {\n        ...base.controlOptions?.custom,\n        ...override.controlOptions?.custom,\n      };\n    }\n  }\n\n  return merged;\n}\n\n/**\n * Computes a relative path from configDir to filePath.\n * Handles both absolute and already-relative paths.\n */\nfunction relativePath(filePath: string, configDir: string): string {\n  // Simple implementation — strip the configDir prefix if present\n  const normalized = filePath.replace(/\\\\/g, \"/\");\n  const normalizedDir = configDir.replace(/\\\\/g, \"/\").replace(/\\/$/, \"\") + \"/\";\n\n  if (normalized.startsWith(normalizedDir)) {\n    return normalized.slice(normalizedDir.length);\n  }\n\n  return normalized;\n}\n\n/**\n * Minimal glob matching supporting `*`, `**`, and `?` patterns.\n * Does not support brace expansion, character classes, or negation.\n *\n * @internal\n */\nfunction matchGlob(pattern: string, path: string): boolean {\n  const regexStr = pattern\n    .replace(/\\\\/g, \"/\")\n    .replace(/[.+?^${}()|[\\]]/g, \"\\\\$&\") // escape regex special chars (incl. ?)\n    .replace(/\\\\\\?/g, \"[^/]\") // glob ? = single non-separator char\n    .replace(/\\*\\*/g, \"{{GLOBSTAR}}\") // placeholder for **\n    .replace(/\\*/g, \"[^/]*\") // * matches within a segment\n    .replace(/{{GLOBSTAR}}/g, \".*\"); // ** matches across segments\n\n  return new RegExp(`^${regexStr}$`).test(path);\n}\n","import type { FieldTypeConstraints, Severity, ValidationIssue } from \"../types.js\";\n\n/**\n * Maps FormSpec field._field values to constraint config keys.\n */\nconst FIELD_TYPE_MAP: Record<string, keyof FieldTypeConstraints> = {\n  text: \"text\",\n  number: \"number\",\n  boolean: \"boolean\",\n  enum: \"staticEnum\",\n  dynamic_enum: \"dynamicEnum\",\n  dynamic_schema: \"dynamicSchema\",\n  array: \"array\",\n  object: \"object\",\n};\n\n/**\n * Human-readable names for field types.\n */\nconst FIELD_TYPE_NAMES: Record<string, string> = {\n  text: \"text field\",\n  number: \"number field\",\n  boolean: \"boolean field\",\n  enum: \"static enum field\",\n  dynamic_enum: \"dynamic enum field\",\n  dynamic_schema: \"dynamic schema field\",\n  array: \"array field\",\n  object: \"object field\",\n};\n\n/**\n * Context for field type validation.\n *\n * @beta\n */\nexport interface FieldTypeContext {\n  /** The _field discriminator value (e.g., \"text\", \"number\", \"enum\") */\n  fieldType: string;\n  /** The field name */\n  fieldName: string;\n  /** Optional path for nested fields */\n  path?: string;\n}\n\n/**\n * Validates a field type against constraints.\n *\n * @param context - Information about the field being validated\n * @param constraints - Field type constraints\n * @returns Array of validation issues (empty if valid)\n *\n * @beta\n */\nexport function validateFieldTypes(\n  context: FieldTypeContext,\n  constraints: FieldTypeConstraints\n): ValidationIssue[] {\n  const issues: ValidationIssue[] = [];\n\n  const constraintKey = FIELD_TYPE_MAP[context.fieldType];\n  if (!constraintKey) {\n    // Unknown field type, skip validation\n    return issues;\n  }\n\n  const severity = constraints[constraintKey];\n  if (severity && severity !== \"off\") {\n    const fieldTypeName = FIELD_TYPE_NAMES[context.fieldType] ?? context.fieldType;\n    issues.push(createFieldTypeIssue(context, fieldTypeName, severity));\n  }\n\n  return issues;\n}\n\n/**\n * Creates a validation issue for a disallowed field type.\n */\nfunction createFieldTypeIssue(\n  context: FieldTypeContext,\n  fieldTypeName: string,\n  severity: Severity\n): ValidationIssue {\n  const path = context.path ?? context.fieldName;\n  return {\n    code: \"DISALLOWED_FIELD_TYPE\",\n    message: `Field \"${context.fieldName}\" uses ${fieldTypeName}, which is not allowed in this project`,\n    severity: severity === \"error\" ? \"error\" : \"warning\",\n    category: \"fieldTypes\",\n    path,\n    fieldName: context.fieldName,\n    fieldType: context.fieldType,\n  };\n}\n\n/**\n * Checks if a field type is allowed by the constraints.\n * Useful for quick checks without generating issues.\n *\n * @param fieldType - The _field discriminator value\n * @param constraints - Field type constraints\n * @returns true if allowed, false if disallowed\n *\n * @beta\n */\nexport function isFieldTypeAllowed(fieldType: string, constraints: FieldTypeConstraints): boolean {\n  const constraintKey = FIELD_TYPE_MAP[fieldType];\n  if (!constraintKey) {\n    return true; // Unknown types are allowed by default\n  }\n\n  const severity = constraints[constraintKey];\n  return !severity || severity === \"off\";\n}\n\n/**\n * Gets the severity level for a field type.\n *\n * @param fieldType - The _field discriminator value\n * @param constraints - Field type constraints\n * @returns Severity level, or \"off\" if not constrained\n *\n * @beta\n */\nexport function getFieldTypeSeverity(\n  fieldType: string,\n  constraints: FieldTypeConstraints\n): Severity {\n  const constraintKey = FIELD_TYPE_MAP[fieldType];\n  if (!constraintKey) {\n    return \"off\";\n  }\n\n  return constraints[constraintKey] ?? \"off\";\n}\n","import type { LayoutConstraints, Severity, ValidationIssue } from \"../types.js\";\n\n/**\n * Context for layout validation.\n *\n * @beta\n */\nexport interface LayoutContext {\n  /** The type of layout element (\"group\" | \"conditional\") */\n  layoutType: \"group\" | \"conditional\";\n  /** Optional label for the element (for groups) */\n  label?: string;\n  /** Current nesting depth */\n  depth: number;\n  /** Path to this element */\n  path?: string;\n}\n\n/**\n * Validates a layout element against constraints.\n *\n * @param context - Information about the layout element\n * @param constraints - Layout constraints\n * @returns Array of validation issues (empty if valid)\n *\n * @beta\n */\nexport function validateLayout(\n  context: LayoutContext,\n  constraints: LayoutConstraints\n): ValidationIssue[] {\n  const issues: ValidationIssue[] = [];\n\n  // Check if groups are allowed\n  if (context.layoutType === \"group\") {\n    const groupSeverity = constraints.group;\n    if (groupSeverity && groupSeverity !== \"off\") {\n      issues.push(createGroupIssue(context, groupSeverity));\n    }\n  }\n\n  // Check if conditionals are allowed\n  if (context.layoutType === \"conditional\") {\n    const conditionalSeverity = constraints.conditionals;\n    if (conditionalSeverity && conditionalSeverity !== \"off\") {\n      issues.push(createConditionalIssue(context, conditionalSeverity));\n    }\n  }\n\n  // Check nesting depth (applies to both groups and fields within nested structures)\n  const maxDepth = constraints.maxNestingDepth;\n  if (maxDepth !== undefined && context.depth > maxDepth) {\n    issues.push(createNestingDepthIssue(context, maxDepth));\n  }\n\n  return issues;\n}\n\n/**\n * Creates a validation issue for a disallowed group.\n */\nfunction createGroupIssue(context: LayoutContext, severity: Severity): ValidationIssue {\n  const labelInfo = context.label ? ` \"${context.label}\"` : \"\";\n  const issue: ValidationIssue = {\n    code: \"DISALLOWED_GROUP\",\n    message: `Group${labelInfo} is not allowed - visual grouping is not supported in this project`,\n    severity: severity === \"error\" ? \"error\" : \"warning\",\n    category: \"layout\",\n  };\n  if (context.path !== undefined) {\n    issue.path = context.path;\n  }\n  return issue;\n}\n\n/**\n * Creates a validation issue for a disallowed conditional.\n */\nfunction createConditionalIssue(context: LayoutContext, severity: Severity): ValidationIssue {\n  const issue: ValidationIssue = {\n    code: \"DISALLOWED_CONDITIONAL\",\n    message: `Conditional visibility (when/is) is not allowed in this project`,\n    severity: severity === \"error\" ? \"error\" : \"warning\",\n    category: \"layout\",\n  };\n  if (context.path !== undefined) {\n    issue.path = context.path;\n  }\n  return issue;\n}\n\n/**\n * Creates a validation issue for exceeding nesting depth.\n */\nfunction createNestingDepthIssue(context: LayoutContext, maxDepth: number): ValidationIssue {\n  const issue: ValidationIssue = {\n    code: \"EXCEEDED_NESTING_DEPTH\",\n    message: `Nesting depth ${String(context.depth)} exceeds maximum allowed depth of ${String(maxDepth)}`,\n    severity: \"error\",\n    category: \"layout\",\n  };\n  if (context.path !== undefined) {\n    issue.path = context.path;\n  }\n  return issue;\n}\n\n/**\n * Checks if a layout type is allowed by the constraints.\n *\n * @param layoutType - The type of layout element\n * @param constraints - Layout constraints\n * @returns true if allowed, false if disallowed\n *\n * @beta\n */\nexport function isLayoutTypeAllowed(\n  layoutType: \"group\" | \"conditional\",\n  constraints: LayoutConstraints\n): boolean {\n  if (layoutType === \"group\") {\n    const severity = constraints.group;\n    return !severity || severity === \"off\";\n  }\n\n  // layoutType === \"conditional\"\n  const severity = constraints.conditionals;\n  return !severity || severity === \"off\";\n}\n\n/**\n * Checks if a nesting depth is allowed.\n *\n * @param depth - Current nesting depth\n * @param constraints - Layout constraints\n * @returns true if allowed, false if exceeds limit\n *\n * @beta\n */\nexport function isNestingDepthAllowed(depth: number, constraints: LayoutConstraints): boolean {\n  const maxDepth = constraints.maxNestingDepth;\n  if (maxDepth === undefined) {\n    return true;\n  }\n  return depth <= maxDepth;\n}\n","import type { FieldOptionConstraints, Severity, ValidationIssue } from \"../types.js\";\n\n/**\n * Known field options that can be validated.\n *\n * @beta\n */\nexport type FieldOption =\n  | \"label\"\n  | \"placeholder\"\n  | \"required\"\n  | \"minValue\"\n  | \"maxValue\"\n  | \"minItems\"\n  | \"maxItems\";\n\n/**\n * Context for field option validation.\n *\n * @beta\n */\nexport interface FieldOptionsContext {\n  /** The field name */\n  fieldName: string;\n  /** Which options are present on this field */\n  presentOptions: FieldOption[];\n  /** Path to this field */\n  path?: string;\n}\n\n/**\n * Validates field options against constraints.\n *\n * @param context - Information about the field and its options\n * @param constraints - Field option constraints\n * @returns Array of validation issues (empty if valid)\n *\n * @beta\n */\nexport function validateFieldOptions(\n  context: FieldOptionsContext,\n  constraints: FieldOptionConstraints\n): ValidationIssue[] {\n  const issues: ValidationIssue[] = [];\n\n  for (const option of context.presentOptions) {\n    const severity = constraints[option];\n    if (severity && severity !== \"off\") {\n      issues.push(createFieldOptionIssue(context, option, severity));\n    }\n  }\n\n  return issues;\n}\n\n/**\n * Creates a validation issue for a disallowed field option.\n */\nfunction createFieldOptionIssue(\n  context: FieldOptionsContext,\n  option: FieldOption,\n  severity: Severity\n): ValidationIssue {\n  const path = context.path ?? context.fieldName;\n  return {\n    code: \"DISALLOWED_FIELD_OPTION\",\n    message: `Field \"${context.fieldName}\" uses the \"${option}\" option, which is not allowed in this project`,\n    severity: severity === \"error\" ? \"error\" : \"warning\",\n    category: \"fieldOptions\",\n    path,\n    fieldName: context.fieldName,\n  };\n}\n\n/**\n * Extracts which options are present on a field object.\n * Works with FormSpec field types.\n *\n * @param field - A field object with potential options\n * @returns Array of present option names\n *\n * @beta\n */\nexport function extractFieldOptions(field: Record<string, unknown>): FieldOption[] {\n  const options: FieldOption[] = [];\n\n  if (field[\"label\"] !== undefined) options.push(\"label\");\n  if (field[\"placeholder\"] !== undefined) options.push(\"placeholder\");\n  if (field[\"required\"] !== undefined) options.push(\"required\");\n  // NumberField uses \"min\"/\"max\" in core types, map to \"minValue\"/\"maxValue\" constraints\n  if (field[\"min\"] !== undefined || field[\"minValue\"] !== undefined) options.push(\"minValue\");\n  if (field[\"max\"] !== undefined || field[\"maxValue\"] !== undefined) options.push(\"maxValue\");\n  if (field[\"minItems\"] !== undefined) options.push(\"minItems\");\n  if (field[\"maxItems\"] !== undefined) options.push(\"maxItems\");\n\n  return options;\n}\n\n/**\n * Checks if a specific field option is allowed.\n *\n * @param option - The option to check\n * @param constraints - Field option constraints\n * @returns true if allowed, false if disallowed\n *\n * @beta\n */\nexport function isFieldOptionAllowed(\n  option: FieldOption,\n  constraints: FieldOptionConstraints\n): boolean {\n  const severity = constraints[option];\n  return !severity || severity === \"off\";\n}\n\n/**\n * Gets the severity level for a field option.\n *\n * @param option - The option to check\n * @param constraints - Field option constraints\n * @returns Severity level, or \"off\" if not constrained\n *\n * @beta\n */\nexport function getFieldOptionSeverity(\n  option: FieldOption,\n  constraints: FieldOptionConstraints\n): Severity {\n  return constraints[option] ?? \"off\";\n}\n","import type { FormElement, FormSpec, AnyField } from \"@formspec/core\";\nimport type {\n  ConstraintConfig,\n  ResolvedConstraintConfig,\n  ValidationIssue,\n  ValidationResult,\n} from \"../types.js\";\nimport { mergeWithDefaults } from \"../defaults.js\";\nimport { validateFieldTypes } from \"./field-types.js\";\nimport { validateLayout } from \"./layout.js\";\nimport { validateFieldOptions, extractFieldOptions } from \"./field-options.js\";\n\n/**\n * Options for validating FormSpec elements.\n *\n * @public\n */\nexport interface FormSpecValidationOptions {\n  /** Constraint configuration (will be merged with defaults) */\n  constraints?: ConstraintConfig;\n}\n\n/**\n * Validates FormSpec elements against constraints.\n *\n * This is the main entry point for validating a form specification\n * against a constraint configuration. It walks through all elements\n * and checks each one against the configured constraints.\n *\n * @param elements - FormSpec elements to validate\n * @param options - Validation options including constraints\n * @returns Validation result with all issues found\n *\n * @example\n * ```ts\n * import { formspec, field, group } from '@formspec/dsl';\n * import { validateFormSpecElements, defineConstraints } from '@formspec/config';\n *\n * const form = formspec(\n *   group(\"Contact\",\n *     field.text(\"name\"),\n *     field.dynamicEnum(\"country\", \"countries\"),\n *   ),\n * );\n *\n * const result = validateFormSpecElements(form.elements, {\n *   constraints: {\n *     fieldTypes: { dynamicEnum: 'error' },\n *     layout: { group: 'error' },\n *   },\n * });\n *\n * if (!result.valid) {\n *   console.error('Validation failed:', result.issues);\n * }\n * ```\n *\n * @public\n */\nexport function validateFormSpecElements(\n  elements: readonly FormElement[],\n  options: FormSpecValidationOptions = {}\n): ValidationResult {\n  const constraints = mergeWithDefaults(options.constraints);\n  const issues: ValidationIssue[] = [];\n\n  // Walk through all elements\n  walkElements(elements, constraints, issues, \"\", 0);\n\n  return {\n    valid: !issues.some((issue) => issue.severity === \"error\"),\n    issues,\n  };\n}\n\n/**\n * Validates a complete FormSpec against constraints.\n *\n * @param formSpec - The FormSpec to validate\n * @param options - Validation options including constraints\n * @returns Validation result with all issues found\n *\n * @public\n */\nexport function validateFormSpec(\n  formSpec: FormSpec<readonly FormElement[]>,\n  options: FormSpecValidationOptions = {}\n): ValidationResult {\n  return validateFormSpecElements(formSpec.elements, options);\n}\n\n/**\n * Recursively walks through FormSpec elements and validates each one.\n */\nfunction walkElements(\n  elements: readonly FormElement[],\n  constraints: ResolvedConstraintConfig,\n  issues: ValidationIssue[],\n  pathPrefix: string,\n  depth: number\n): void {\n  for (const element of elements) {\n    const elementPath = pathPrefix;\n\n    if (element._type === \"field\") {\n      validateField(element, constraints, issues, elementPath, depth);\n    } else if (element._type === \"group\") {\n      validateGroup(element, constraints, issues, elementPath, depth);\n    } else {\n      // element._type === \"conditional\"\n      validateConditional(element, constraints, issues, elementPath, depth);\n    }\n  }\n}\n\n/**\n * Validates a field element.\n */\nfunction validateField(\n  field: AnyField,\n  constraints: ResolvedConstraintConfig,\n  issues: ValidationIssue[],\n  pathPrefix: string,\n  depth: number\n): void {\n  const fieldPath = pathPrefix ? `${pathPrefix}/${field.name}` : field.name;\n\n  // Validate field type\n  const fieldTypeIssues = validateFieldTypes(\n    {\n      fieldType: field._field,\n      fieldName: field.name,\n      path: fieldPath,\n    },\n    constraints.fieldTypes\n  );\n  issues.push(...fieldTypeIssues);\n\n  // Validate field options\n  const presentOptions = extractFieldOptions(field as unknown as Record<string, unknown>);\n  if (presentOptions.length > 0) {\n    const optionIssues = validateFieldOptions(\n      {\n        fieldName: field.name,\n        presentOptions,\n        path: fieldPath,\n      },\n      constraints.fieldOptions\n    );\n    issues.push(...optionIssues);\n  }\n\n  // Check nesting depth for array/object fields\n  if (field._field === \"array\" || field._field === \"object\") {\n    const layoutIssues = validateLayout(\n      {\n        layoutType: \"group\", // Arrays/objects contribute to nesting depth\n        depth: depth + 1,\n        path: fieldPath,\n      },\n      constraints.layout\n    );\n    // Only add nesting depth issues, not group issues\n    issues.push(...layoutIssues.filter((issue) => issue.code === \"EXCEEDED_NESTING_DEPTH\"));\n\n    // Recursively validate nested elements\n    if (field._field === \"array\" && \"items\" in field) {\n      walkElements(\n        field.items as readonly FormElement[],\n        constraints,\n        issues,\n        `${fieldPath}[]`,\n        depth + 1\n      );\n    } else if (\"properties\" in field) {\n      // field._field === \"object\"\n      walkElements(\n        field.properties as readonly FormElement[],\n        constraints,\n        issues,\n        fieldPath,\n        depth + 1\n      );\n    }\n  }\n}\n\n/**\n * Validates a group element.\n */\nfunction validateGroup(\n  group: {\n    readonly _type: \"group\";\n    readonly label: string;\n    readonly elements: readonly FormElement[];\n  },\n  constraints: ResolvedConstraintConfig,\n  issues: ValidationIssue[],\n  pathPrefix: string,\n  depth: number\n): void {\n  const groupPath = pathPrefix ? `${pathPrefix}/[group:${group.label}]` : `[group:${group.label}]`;\n\n  // Validate group usage\n  const layoutIssues = validateLayout(\n    {\n      layoutType: \"group\",\n      label: group.label,\n      depth,\n      path: groupPath,\n    },\n    constraints.layout\n  );\n  issues.push(...layoutIssues);\n\n  // Recursively validate nested elements (groups don't increase nesting depth for schema)\n  walkElements(group.elements, constraints, issues, pathPrefix, depth);\n}\n\n/**\n * Validates a conditional element.\n */\nfunction validateConditional(\n  conditional: {\n    readonly _type: \"conditional\";\n    readonly field: string;\n    readonly value: unknown;\n    readonly elements: readonly FormElement[];\n  },\n  constraints: ResolvedConstraintConfig,\n  issues: ValidationIssue[],\n  pathPrefix: string,\n  depth: number\n): void {\n  const condPath = pathPrefix\n    ? `${pathPrefix}/[when:${conditional.field}=${String(conditional.value)}]`\n    : `[when:${conditional.field}=${String(conditional.value)}]`;\n\n  // Validate conditional usage\n  const layoutIssues = validateLayout(\n    {\n      layoutType: \"conditional\",\n      depth,\n      path: condPath,\n    },\n    constraints.layout\n  );\n  issues.push(...layoutIssues);\n\n  // Recursively validate nested elements\n  walkElements(conditional.elements, constraints, issues, pathPrefix, depth);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sBAAyB;AACzB,uBAAiC;AAQjC,kBAA2B;;;ACDpB,IAAM,sBAAgD;AAAA,EAC3D,YAAY;AAAA,IACV,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,eAAe;AAAA,IACf,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,cAAc;AAAA,IACd,iBAAiB;AAAA,EACnB;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,OAAO;AAAA,MACP,gBAAgB;AAAA,MAChB,UAAU;AAAA,IACZ;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,aAAa;AAAA,IACb,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,gBAAgB;AAAA,IACd,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,0BAA0B;AAAA,IAC1B,sBAAsB;AAAA,IACtB,QAAQ,CAAC;AAAA,EACX;AACF;AAOO,IAAM,iBAAiC;AAAA,EAC5C,aAAa;AACf;AAOO,SAAS,kBAAkB,QAAgE;AACh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