import { Severity } from './severity.js'; export { SEVERITIES, SEVERITY_RANK, SEVERITY_WEIGHTS, SeverityLevel, compareSeverity, maxSeverity, severityLevel, severitySchema, sortBySeverity } from './severity.js'; import { Finding, AgentFormat, FindingFix } from './schemas/index.js'; export { GovernanceVerdict as CanonicalGovernanceVerdict, FindingReplaceClassTokenFix, FindingReplaceComponentFix, FindingReplaceImportFix, FindingReplacePropValueFix, FindingReplaceStyleValueFix, Fix, GovernanceVerdictMetadata, SuppressionDirective, ValidatorResult, Violation, agentFormatSchema, factEvidenceSchema, factLocationSchema, findingFixSchema, findingReplaceClassTokenFixSchema, findingReplaceComponentFixSchema, findingReplaceImportFixSchema, findingReplacePropValueFixSchema, findingReplaceStyleValueFixSchema, findingSchema, fixSchema, governanceVerdictMetadataSchema, governanceVerdictSchema, normalizeFinding, normalizeSeverity, normalizeViolation, suppressionDirectiveSchema, validatorResultSchema, violationSchema } from './schemas/index.js'; export { BridgeViolationInput, CODES, CodeCategory, CodeLifecycle, EXPLAIN_URL_BASE, FuiCode, bridgeSourceViolation, bridgeSourceViolations, byCode, byRuleId, explainUrlForCode } from './codes/index.js'; import { c as ContractDomain, d as ContractCatalogInput, G as GovernanceSeverity, b as CompiledFragment, e as GovernedFragmentDefinition, R as ResolvedGovernedFragmentDefinition, f as GovernanceConfig, g as FragmentsConfig, T as TokenConfig, h as FragmentComponent, B as BlockDefinition, C as CompiledBlock, F as FragmentDefinition, a as FragmentDefinitionV2, S as StorybookFilterConfig, i as FigmaStringMapping, j as FigmaBooleanMapping, k as FigmaEnumMapping, l as FigmaInstanceMapping, m as FigmaChildrenMapping, n as FigmaTextContentMapping, o as RelationshipType, V as VariantRenderOptions, p as VariantLoader, q as CanonicalSource } from './governance-CxGIYMFz.js'; export { A as AIMetadata, r as AccessibilityGovernanceBuilder, s as AppConfig, t as BaselineInfo, u as BoundingBox, v as CONTRACT_DOMAINS, w as CONTRACT_PREIMAGE_SCHEMA, x as CanonicalMappingStatus, y as CompiledFragmentsFile, z as CompiledRecipe, D as CompiledTokenData, E as CompiledTokenEntry, H as ComponentGovernanceBuilder, I as ComponentGovernanceRecord, J as ComponentRef, K as ComponentRelation, L as CompositionMetadata, M as ContractCanonicalMappingInput, N as ContractComponentInput, O as ContractPolicyInput, P as ContractPreimage, Q as ContractPropMappingInput, U as ContractTokenInput, W as ContractWaiverInput, X as ControlType, Y as DesignSystemConfig, Z as DiffResult, _ as FigmaPropMapping, $ as FragmentContract, a0 as FragmentExample, a1 as FragmentGenerated, a2 as FragmentGuidance, a3 as FragmentMeta, a4 as FragmentProvenance, a5 as FragmentUsage, a6 as FragmentVariant, a7 as GlobalGovernanceRecord, a8 as GlobalJsxGovernanceRecord, a9 as GlobalStyleGovernanceRecord, aa as GovernancePropValue, ab as InspectConfig, ac as LocalCanonicalDeclaration, ad as LocalCanonicalResolveRule, ae as Manifest, af as ObservedComponentUsage, ag as ObservedUsageProp, ah as PlayFunction, ai as PlayFunctionContext, aj as PropDefinition, ak as PropGovernanceBuilder, al as PropGovernanceOptions, am as PropKey, an as PropType, ao as RecipeDefinition, ap as RegistryOptions, aq as RepoRelativePath, ar as ScaleGovernanceRecord, as as Screenshot, at as ScreenshotConfig, au as ScreenshotMetadata, av as ServiceConfig, aw as SnapshotConfig, ax as SnippetPolicyConfig, ay as Theme, az as ThemeSeeds, aA as TokenSourceConfig, aB as TokenSourceFormat, aC as VerifyRequest, aD as VerifyResult, aE as Viewport, aF as componentGovernanceRecordSchema, aG as componentGovernanceRecordsSchema, aH as contractComponentsFromFragments, aI as contractPolicyFromGovernanceConfig, aJ as diffContractDomains, aK as g, aL as globalGovernanceRecordSchema, aM as globalJsxGovernanceRecordSchema, aN as globalStyleGovernanceRecordSchema, aO as governanceConfigSchema, aP as governanceConfigWithLocalCanonical, aQ as governanceSeveritySchema, aR as localCanonicalContractMappings, aS as normalizeGovernanceConfig, aT as projectContractPreimage, aU as scaleGovernanceRecordSchema } from './governance-CxGIYMFz.js'; import { z } from 'zod'; import { RegistryArtifact, RegistryDependency, RegistryInstallReceipt } from './registry.js'; export { REGISTRY_ARTIFACT_SCHEMA_VERSION, REGISTRY_INSTALL_RECEIPT_SCHEMA_VERSION, REGISTRY_MANIFEST_SCHEMA_VERSION, RegistryArtifactInput, RegistryComponent, RegistryComponentExport, RegistryDependencyType, RegistryEntrypoint, RegistryFile, RegistryFileContent, RegistryFileInput, RegistryFileRole, RegistryInstallProfile, RegistryInstallReceiptComponent, RegistryInstallReceiptFile, RegistryManifest, RegistryManifestDraft, RegistrySource, assertValidRegistryArtifact, buildRegistryArtifact, buildRegistryFile, computeRegistryHash, finalizeRegistryManifest, hashRegistryFileContent, registryArtifactDigest, registryArtifactSchema, registryComponentExportSchema, registryComponentSchema, registryDependencySchema, registryDependencyTypeSchema, registryEntrypointSchema, registryFileContentSchema, registryFileRoleSchema, registryFileSchema, registryFileSize, registryInstallProfileSchema, registryInstallReceiptComponentSchema, registryInstallReceiptFileSchema, registryInstallReceiptSchema, registryManifestCanonicalPreimage, registryManifestDraftSchema, registryManifestSchema, registrySourceSchema } from './registry.js'; import { ReactNode, ComponentType } from 'react'; export { ContextOptions, ContextResult, generateContext } from './generate/index.js'; import { C as ComponentGraph } from './types-xJ2xyp_G.js'; import * as react_jsx_runtime from 'react/jsx-runtime'; export { Area, AreaCriticality, AreaMatch, Topology, resolveArea } from './topology/index.js'; import { isExportStory as isExportStory$1, storyNameFromExport as storyNameFromExport$1, toId as toId$1 } from '@storybook/csf'; /** * Brand constants for easy rebranding if domain availability requires it. * All naming throughout the codebase should reference these constants. */ declare const BRAND: { /** Display name (e.g., "Fragments") */ readonly name: "Fragments"; /** Lowercase name for file paths and CLI (e.g., "fragments") */ readonly nameLower: "fragments"; /** File extension for fragment definition files — V2 canonical format */ readonly fileExtension: ".contract.json"; /** Legacy file extension for segments (still supported for migration) */ readonly legacyFileExtension: ".segment.tsx"; /** JSON file extension for compiled output */ readonly jsonExtension: ".fragment.json"; /** Default output file name (e.g., "fragments.json") */ readonly outFile: "fragments.json"; /** Config file name (e.g., "fragments.config.ts") */ readonly configFile: "fragments.config.ts"; /** Legacy config file name (still supported for migration) */ readonly legacyConfigFile: "segments.config.ts"; /** CLI command name (e.g., "fragments") */ readonly cliCommand: "fragments"; /** Package scope (e.g., "@fragments") */ readonly packageScope: "@fragments"; /** Directory for storing fragments, registry, and cache */ readonly dataDir: ".fragments"; /** Components subdirectory within .fragments/ */ readonly componentsDir: "components"; /** Registry file name */ readonly registryFile: "registry.json"; /** Default compiler governance report path */ readonly governanceFile: ".fragments/governance.json"; /** Context file name (AI-ready markdown) */ readonly contextFile: "context.md"; /** Screenshots subdirectory */ readonly screenshotsDir: "screenshots"; /** Cache subdirectory (gitignored) */ readonly cacheDir: "cache"; /** Diff output subdirectory (gitignored) */ readonly diffDir: "diff"; /** Manifest filename */ readonly manifestFile: "manifest.json"; /** Prefix for localStorage keys (e.g., "fragments-") */ readonly storagePrefix: "fragments-"; /** Static viewer HTML file name */ readonly viewerHtmlFile: "fragments-viewer.html"; /** MCP tool name prefix (e.g., "fragments_") */ readonly mcpToolPrefix: "fragments_"; /** File extension for block definition files */ readonly blockFileExtension: ".block.ts"; /** @deprecated Use blockFileExtension instead */ readonly recipeFileExtension: ".recipe.ts"; /** Vite plugin namespace */ readonly vitePluginNamespace: "fragments-core-shim"; }; type Brand = typeof BRAND; /** * Default configuration values for the service. * These can be overridden in fragments.config.ts */ declare const DEFAULTS: { /** Default viewport dimensions */ readonly viewport: { readonly width: 1280; readonly height: 800; }; /** Default diff threshold (percentage) */ readonly diffThreshold: 5; /** Browser pool size */ readonly poolSize: 3; /** Idle timeout before browser shutdown (ms) - 5 minutes */ readonly idleTimeoutMs: number; /** Delay after render before capture (ms) */ readonly captureDelayMs: 100; /** Font loading timeout (ms) */ readonly fontTimeoutMs: 3000; /** Default theme */ readonly theme: "light"; /** Dev server port */ readonly port: 6006; }; type Defaults = typeof DEFAULTS; /** * Shared contract for the design-system conform engine. * * These types are the single source of truth for the conform pipeline: * - `@fragments-sdk/extract` implements `conformSnippet(input, context)`. * - `@fragments-sdk/mcp` re-exports the result types as the tool contract. * - Cloud / CLI / standalone-MCP each build a `DesignSystemContext` from their * own data source (Convex catalog, local config, bundle) and call the engine. * * Keeping them here (a browser-safe, dependency-light package) lets every * surface agree on one shape without duplication. */ type ConformConfidence = "high" | "medium" | "low"; interface ConformInput { /** UI code to conform: JSX/TSX, HTML, or a CSS/SCSS block. */ code: string; /** Filename or extension hint used to pick the parser (defaults to TSX). */ filename?: string; /** deterministic (default) applies safe edits; none returns findings only. */ apply?: "deterministic" | "none"; } interface ConformLocation { line?: number; column?: number; endLine?: number; endColumn?: number; } interface ConformChange { kind: "swap-component" | "rewrite-import" | "rename-prop" | "replace-token" | "add-fallback"; ruleId?: string; /** Versioned diagnostic code, e.g. FUI0601. */ code?: string; severity: "error" | "warning" | "info"; message: string; before?: string; after?: string; /** Canonical primitive involved in the change, when applicable. */ canonical?: string; confidence: ConformConfidence; location?: ConformLocation; } interface ConformSuggestion { kind: "map-prop-value" | "choose-among-alternates" | "review-low-confidence" | "flag-accessibility"; message: string; canonical?: string; hint?: string; confidence: ConformConfidence; location?: ConformLocation; } interface ConformUnresolved { element?: string; canonical?: string; reason: string; location?: ConformLocation; } interface ConformPropMapping { rawProp: string; canonicalProp: string; /** * Confirmed value translation table for cross-library prop values, e.g. * `{ primary: "brand" }` to rewrite `color="primary"` into `variant="brand"`. * A value is only rewritten when it exactly matches a key here; anything else * is surfaced as a `map-prop-value` suggestion rather than guessed. */ valueMap?: Record; } interface ConformComponentMapping { /** * Canonical primitive name, e.g. "Button". This is the JSX identifier the * conform engine rewrites toward. */ name: string; /** Stable canonical vocabulary label when it differs from the component name. */ canonical?: string; /** Native HTML element this component replaces, e.g. "button". */ htmlEquivalent?: string; /** Import source to add or prefer for the canonical component. */ importPath?: string; /** Confirmed prop renames from raw usage to the canonical component API. */ propMapping?: ConformPropMapping[]; /** Classifier confidence, when known. Only confirmed mappings should be passed. */ confidence?: number; } interface ConformResult { /** Code with deterministic edits applied, or the original if apply=none / parse failed. */ conformed: string; changed: boolean; summary: string; designSystem?: { name?: string; importsAdded: string[]; }; /** Applied, deterministic edits. */ changes: ConformChange[]; /** Items needing agent judgment (e.g. cross-library prop-value translation). */ suggestions: ConformSuggestion[]; /** Elements/values with no design-system equivalent. */ unresolved: ConformUnresolved[]; /** * How much of the tenant's design system this run could evaluate against. * `evaluated` is false when the catalog supplied no tokens and no usable * component mappings — in that case a "clean" result proves nothing, so * callers (e.g. `prove_compliant`) must not certify compliance. */ coverage?: ConformCoverage; } interface ConformCoverage { /** Count of relevant tokens (color/spacing/radius) the engine evaluated against. */ tokens: number; /** Count of usable component mappings the engine evaluated against. */ components: number; /** True when there was at least one token or component to evaluate against. */ evaluated: boolean; } /** * A design-system token as the conform engine consumes it. Each surface maps * its own token model into this shape. */ interface ConformToken { /** Raw value to match against code, e.g. "#2563eb". */ value: string; /** * The authored CSS custom property, e.g. "--brand-600", when known. A token * is only eligible for an automatic rewrite when this is present — the engine * never guesses a variable name. */ cssVar?: string; /** Token category, e.g. "color" | "spacing". */ category?: string; /** Human-readable label for suggestions, e.g. "color.brand.600". */ label?: string; /** Tie-break ordering when two tokens share a value: "canonical" wins. */ tier?: string; } /** * Everything the conform engine needs about a tenant's design system. Built by * each surface (cloud from Convex, CLI from local config, MCP from a bundle). */ interface DesignSystemContext { designSystemName?: string; tokens: ConformToken[]; /** Confirmed canonical component replacements for this tenant. */ components?: ConformComponentMapping[]; } /** * Contract Mode — Phase 2: the prove-compliant loop as a PURE primitive. * * A validate-fix-validate loop over UI code: run the conform engine, apply its * deterministic fixes, and re-validate until the engine proves zero findings, * the pass budget is exhausted, or progress stalls. When deterministic fixes * stall on residual issues, an optional async `sampler` repairs them (model * call), and the loop re-validates the result — a sampled fix is never trusted * without a clean re-validation pass. * * This is the engine behind `contract.prove` (architecture §2 move #4). It is * deliberately framework-agnostic: it takes a `conform` callback (so Cloud, * CLI, and the standalone MCP each inject their own engine binding) and returns * a plain result — no MCP plumbing, no task store, no transport coupling. * * Determinism (architecture §6.3): the sampler receives `(seq, codeHashAtRequest)` * so a durable-replay layer can key recorded sampler output on the exact code it * was asked to repair, and hard-invalidate on a hash mismatch — instead of the * pass-index-only key the standalone MCP tool uses. * * Browser-safe: depends only on the conform contract types + the pure SHA-256 * in this package. No Node APIs. */ /** Upper bound on validate/fix passes. */ declare const PROVE_MAX_PASSES = 8; /** Default validate/fix passes when the caller does not specify. */ declare const PROVE_DEFAULT_MAX_PASSES = 4; /** * 3-valued verdict. `insufficient_coverage` is NOT a pass: a clean run over an * empty catalog (no tokens, no component mappings) proves nothing, so the loop * never certifies compliance it could not actually evaluate. */ type ProveVerdict = "pass" | "fail" | "insufficient_coverage"; interface ProvePassSampling { requested?: boolean; used?: boolean; model?: string; stopReason?: string; reason?: string; } interface ProvePass { pass: number; issues: number; deterministicChanges: number; suggestions: number; unresolved: number; changed: boolean; sampling?: ProvePassSampling; } interface ProveResidual { suggestions: ConformSuggestion[]; unresolved: ConformUnresolved[]; } interface ProveSample { /** Repaired code, or omitted/empty when the sampler declined. */ code?: string; model?: string; stopReason?: string; reason?: string; } interface ProveSamplerArgs { /** The current code the sampler is asked to repair. */ code: string; /** The residual findings deterministic fixes could not resolve. */ residual: ProveResidual; metadata: { /** 1-indexed validate/fix pass that stalled. */ pass: number; /** 0-indexed sampler attempt counter (independent of `pass`). */ seq: number; /** SHA-256 of `code` — the durable-replay key + hard-invalidation guard. */ codeHashAtRequest: string; }; } interface ProveCallbacks { /** Validate + apply deterministic fixes for one pass. */ conform(input: ConformInput): Promise | ConformResult; /** Optional model-backed repair for residual issues conform cannot resolve. */ sampler?(args: ProveSamplerArgs): Promise | ProveSample | null; } interface ProveOptions { /** Max validate/fix passes (clamped to 1..8). Defaults to 4. */ maxPasses?: number; /** Allow the sampler to repair residual issues. Defaults to true. */ allowSampling?: boolean; } interface ProveLoopResult { /** Code after all passes + sampling. */ conformed: string; /** Whether `conformed` differs from the input code. */ changed: boolean; verdict: ProveVerdict; /** True only on a clean, evaluated pass. */ provedCompliant: boolean; /** Findings remaining in the final pass (changes + suggestions + unresolved). */ issueCount: number; /** Total deterministic edits applied across all passes. */ corrections: number; passHistory: ProvePass[]; residual: ProveResidual; /** The final conform result (for receipt / summary rendering). */ result: ConformResult; /** Human-readable reason for the verdict. */ reason: string; } /** Total findings in a conform result: applied changes + suggestions + unresolved. */ declare function proveIssueCount(result: ConformResult): number; /** A neutral conform result for the "no result produced" fallback path. */ declare function emptyConformResult(code: string): ConformResult; /** * Resolve the 3-valued verdict. Coverage trumps everything: an unevaluated * catalog is `insufficient_coverage` regardless of issue count. */ declare function resolveProveVerdict(args: { coverageEvaluated: boolean; provedCompliant: boolean; }): ProveVerdict; /** Clamp a requested pass count into the supported 1..8 range (default 4). */ declare function clampMaxPasses(value: number | undefined): number; /** * Run the validate-fix-validate loop. Pure: never mutates `input`; all state * flows through the return value. */ declare function proveCompliant(input: ConformInput, callbacks: ProveCallbacks, options?: ProveOptions): Promise; /** * Frontend Contract hashing — the cross-runtime content-address (FCID). * * The keystone trust property of the Frontend Contract is that "what the agent * was served" and "what CI enforced" are provably the same bytes. That only * holds if the contract hash is computed by an *identical* function in every * runtime that touches it: the CLI (Node), the Convex isolate, and the browser. * * The fact-IR `hash64Hex` (FNV-1a, in `../facts/ids.ts`) is deliberately NOT * used here: it is a 64-bit non-cryptographic integrity reference for in-process * fact dedup, and Convex independently reaches for `crypto.subtle` (async, and a * *different* algorithm). Two different hashes over the same preimage cannot back * a "same 64 hex chars or the build is rejected" guarantee. * * So this module ships ONE function: a synchronous, dependency-free SHA-256 over * a number-normalizing canonical preimage. Synchronous so it composes with the * sync fact-compilation path; dependency-free so it is byte-identical across * Node, the Convex isolate, and the browser without a native/optional dep * (`crypto.subtle` is async; `@noble/hashes` is not a dependency of this MIT, * browser-safe package). `TextEncoder` is the only ambient global used, and it is * present in all three runtimes. */ /** * Deterministic, canonical serialization of a contract body for hashing. * * - object keys sorted lexicographically; attribute order is irrelevant * - `undefined` properties dropped (so optional fields don't perturb the hash) * - numbers normalized via {@link normalizeNumber} * - `bigint` encoded as its decimal string (JSON cannot represent it natively) * * This is intentionally a separate serializer from `facts/ids.ts#canonicalJson`: * that one targets in-process fact IDs and does not normalize numbers, and we * must not change its output (it would silently re-key existing fact IDs). */ declare function canonicalPreimage(value: unknown): string; /** * SHA-256 of a UTF-8 string, returned as 64 lowercase hex chars. * * Deterministic and synchronous in every runtime. Verified against the FIPS * 180-4 vectors in `hash.test.ts`. */ declare function sha256Hex(message: string): string; /** * The Frontend Contract ID: `sha256(canonicalPreimage(body))`, 64 lowercase hex * chars. Identical inputs produce an identical FCID in the CLI, the Convex * isolate, and the browser — which is what lets the gen-time agent view and the * CI enforcement reference the same contract by hash. */ declare function contractHash(body: unknown): string; /** * The shared contract pin formatter. Every surface that shows a human the * contract identity — MCP metadata, agent context files, hook output, LSP * diagnostics, CI check text, PR comments — interpolates the string this * function returns; no surface reformats it. One formatter is what makes * "compare the hashes yourself" a falsifiable claim instead of three surfaces * rendering the pin three ways. * * Display convention (spine "Identifiers"): never a bare hash without the * version, never a version without the hash. */ /** The committed agent context file every gate reads for local contract stamps. */ declare const AGENT_CONTEXT_RELATIVE_PATH = ".fragments/agent-context.md"; interface ContractStampPin { /** Monotonic, human-facing version from the ledger. */ contractVersion: number; /** The 64-hex FCID; abbreviated for display. */ fcid: string; } interface ContractStampRecord extends ContractStampPin { /** Full 64-hex domain sub-hashes, when known. */ domains?: Record; } /** * The bare `v12 · a3f9e21` form, for surfaces where "contract" is already said * by the surrounding copy (e.g. the hook staleness line's `local v11 · 9c01b22`). * {@link formatStampPin} delegates here so the two forms can never drift. */ declare function formatStampVersionHash(pin: ContractStampPin): string; /** * Render the canonical pin: `contract v12 · a3f9e21`. */ declare function formatStampPin(pin: ContractStampPin): string; /** The context-file header form: `fragments contract v12 · a3f9e21`. */ declare function formatStampHeader(pin: ContractStampPin): string; /** * Serialize pin + full fcid (+ domain hashes when known) as plain header lines — * no markdown syntax, so the block is safe inside YAML-ish frontmatter and * inside HTML-comment blocks. The first line carries the literal * {@link formatStampHeader} output; surfaces grep for that substring, so the * header form and the serialized form may never diverge. */ declare function serializeContractStamp(record: ContractStampRecord): string; /** * Parse a stamp record back out of arbitrary file text. Requires the * `contract:` + `contract-fcid:` lines and an abbreviated fcid that prefixes * the full one; `contract-domains` is optional. Returns null when absent or * malformed — never throws. */ declare function parseContractStamp(text: string): ContractStampRecord | null; /** * `catalog-fixture-a` — the committed reference catalog shared by the contract * acceptance cases (contract-identity ACCEPTANCE §1–§4) and the Cloud-side * parity test. Small but full-surface: components with props, tokens, one * confirmed + one proposed canonical mapping, a policy with rules, a * composition pattern, and one authored waiver. * * `CATALOG_FIXTURE_A_FCID` is the golden value for * `contractHash(projectContractPreimage(catalogFixtureA))`. Cloud's Convex * parity test imports BOTH from here, so an intentional projection change is * updated in exactly one place and every runtime follows (ACCEPTANCE §1). */ declare const catalogFixtureA: ContractCatalogInput; /** * Golden fcid for {@link catalogFixtureA}. Regenerate only on an intentional * projection change: `contractHash(projectContractPreimage(catalogFixtureA))`. */ declare const CATALOG_FIXTURE_A_FCID = "41ae847b36618f25a9aa73bda47851f6467e30ce4bcfb5a5aa25d27fee3fee54"; /** * The same fixture expressed as Cloud-shaped mint materials: the * `code-contracts` payload body and the DTCG token document that assemble to * exactly {@link catalogFixtureA} through the adapters. Kept here so a fixture * edit happens in one file — the core §1 test guards the payload↔components * equivalence, and Cloud's parity test asserts the golden fcid end to end. */ declare const catalogFixtureAContractPayload: { fragments: ({ meta: { name: string; parentComponentName?: undefined; }; props: { variant: {}; size: {}; disabled: {}; padding?: undefined; title?: undefined; }; contract: { bans: { prop: string; reason: string; }[]; }; structure?: undefined; } | { meta: { name: string; parentComponentName?: undefined; }; props: { padding: {}; variant?: undefined; size?: undefined; disabled?: undefined; title?: undefined; }; structure: { compoundChildren: { name: string; }[]; }; contract?: undefined; } | { meta: { name: string; parentComponentName: string; }; props: { title: {}; variant?: undefined; size?: undefined; disabled?: undefined; padding?: undefined; }; contract?: undefined; structure?: undefined; })[]; }; /** DTCG form of {@link catalogFixtureA}'s tokens (flattened Cloud-side). */ declare const catalogFixtureATokensDtcg: { "--fui-color-accent": { $value: string; $type: string; }; "--fui-space-2": { $value: string; $type: string; }; "--fui-radius-md": { $value: string; $type: string; }; }; /** * Fact IR — discriminated union of governance facts. * * Facts are content-addressed records. Their ID is a deterministic hash of a * canonical identity tuple (kind + identity fields), never the source location * — moving a line in a source file does not perturb component or policy fact * IDs. Usage facts include source location for evidence display, but their ID * is derived only from structural identity (file + node path + element). * * This module owns only the types. Hashing lives in `./ids.ts`, builders in * `./builders.ts`, the in-memory store in `./fact-index.ts`, and conversion * from compiled fragments + governance config in `./compile.ts`. */ declare const componentIdBrand: unique symbol; declare const factIdBrand: unique symbol; type ComponentId = string & { readonly [componentIdBrand]: void; }; type FactId = string & { readonly [factIdBrand]: void; }; interface FactLocation { file: string; line: number; column: number; endLine?: number; endColumn?: number; } interface BaseFact { id: FactId; } interface ComponentMetadataFact extends BaseFact { kind: "component"; componentId: ComponentId; name: string; description?: string; category?: string; filePath?: string; } interface ComponentCapabilityFact extends BaseFact { kind: "component_capability"; componentId: ComponentId; capability: string; } interface PropMetadataFact extends BaseFact { kind: "prop_metadata"; componentId: ComponentId; prop: string; type: string; values?: string[]; required: boolean; default?: unknown; description?: string; } interface PropValueAvoidedFact extends BaseFact { kind: "prop_value_avoided"; componentId: ComponentId; prop: string; value: unknown; because: string; suggest?: string; severity: GovernanceSeverity; } interface PropValueForbiddenFact extends BaseFact { kind: "prop_value_forbidden"; componentId: ComponentId; prop: string; value: unknown; pathPattern?: string; because: string; replaceWith?: unknown; severity: GovernanceSeverity; } interface A11yNameRequiredFact extends BaseFact { kind: "a11y_name_required"; componentId: ComponentId; because: string; severity: GovernanceSeverity; } interface ScaleFact extends BaseFact { kind: "scale"; name: string; unit: "px" | "rem"; rootFontSizePx?: number; emBasePx?: number; } interface ScaleValueFact extends BaseFact { kind: "scale_value"; scale: string; value: number; } interface StyleRawColorForbiddenFact extends BaseFact { kind: "style_raw_color_forbidden"; except: string[]; prefer: "token" | "css-variable"; severity: GovernanceSeverity; } interface StyleRawDimensionForbiddenFact extends BaseFact { kind: "style_raw_dimension_forbidden"; appliesTo: string[]; prefer: "token" | "css-variable"; severity: GovernanceSeverity; } interface StylePropertyScaleFact extends BaseFact { kind: "style_property_scale"; property: string; scale: string; severity: GovernanceSeverity; } interface StyleFontSizeScaleFact extends BaseFact { kind: "style_font_size_scale"; scale: string; severity: GovernanceSeverity; } interface StyleCssVarsMustBeDefinedFact extends BaseFact { kind: "style_css_vars_must_be_defined"; severity: GovernanceSeverity; } /** * A token name in the contract vocabulary (from the user's selected token source * files). A DEDICATED channel — separate from `token_definition` — so the * off-contract-drift rule (FUI2015) judges `var(--x)` against the CONTRACT * vocabulary, while the raw-* rules + scale detection keep reading the project's * local `token_definition` tokens unchanged. */ interface ContractTokenFact extends BaseFact { kind: "contract_token"; /** Custom-property name, normalized to `--`-prefixed form. */ name: string; } interface JsxUnknownPropsForbiddenFact extends BaseFact { kind: "jsx_unknown_props_forbidden"; severity: GovernanceSeverity; } interface JsxInlineStyleForbiddenRawFact extends BaseFact { kind: "jsx_inline_style_forbidden_raw"; property: string; severity: GovernanceSeverity; } interface JsxImportPathPreferredFact extends BaseFact { kind: "jsx_import_path_preferred"; from: string; to: string; imported?: string; because?: string; severity: GovernanceSeverity; } interface JsxComponentPreferredFact extends BaseFact { kind: "jsx_component_preferred"; from: ComponentId; to: ComponentId; because?: string; severity: GovernanceSeverity; } /** * A design token from the system. Used by fixes (e.g., raw color → token * substitution) and rules that need to know the token vocabulary. Identity is * the token `name`; two scans of the same token registry produce the same ID. */ interface TokenDefinitionFact extends BaseFact { kind: "token_definition"; /** Token identifier, e.g., "fui-color-accent" or "--fui-color-accent". */ name: string; /** Resolved value, e.g., "#2563eb". */ value: string; /** Loose category bucket. Phase 6 only differentiates `color` from others. */ category?: "color" | "spacing" | "typography" | "radius" | "shadow" | "other"; /** * How the token is referenced from authored styles, inferred from its source. * Governs whether a "use the token" fix can be *applied* automatically: a * `css-var`/`scss-var` reference resolves verbatim, but a `scss-map` member * (`$colors-primary` minted from a Sass map) or a `dtcg` JSON token (no CSS * custom property emitted) does not — those are surfaced as suggestions, not * deterministic rewrites, so the fixer never writes non-compiling output. * Absent on legacy/hand-built facts, which are treated as safe. */ referenceFormat?: "css-var" | "scss-var" | "scss-map" | "dtcg"; } interface TailwindPaletteAllowFact extends BaseFact { kind: "tailwind_palette_allow"; patterns: string[]; severity: GovernanceSeverity; } interface TailwindPaletteDenyFact extends BaseFact { kind: "tailwind_palette_deny"; patterns: string[]; severity: GovernanceSeverity; } interface TailwindUnknownClassEnabledFact extends BaseFact { kind: "tailwind_unknown_class_enabled"; severity: GovernanceSeverity; } interface GovernanceRuleConfigFact extends BaseFact { kind: "governance_rule_config"; ruleId: string; enabled: boolean; severity?: GovernanceSeverity; options?: Record; } interface UsageNodeFact extends BaseFact { kind: "usage_node"; file: string; /** * Stable structural path: a `rootIndex:` token (the root tree's index within * the file) then `/`-joined opaque segments, e.g. `"0:2/1"`. Segments are * emitted by the framework adapter (`computeNodePath`) and compared whole — * never parsed inside (see the usage-node-fact contract); `regionsByPrefix` * relies on this grammar. */ nodePath: string; element: string; /** * Normalized ARIA role of the element when statically declared (a * `role="status"` attribute or equivalent). Framework-neutral: every adapter * populates it from its own markup (JSX attribute, Vue/Svelte template * binding, …) so semantic rules can reason over roles without knowing the * framework. Never part of fact identity. */ role?: string; /** * Normalized interactivity signal: true when the element carries an * interaction handler (click/key/pointer/…) or is intrinsically interactive. * Framework-neutral — the adapter decides how to detect it. Never part of * fact identity. */ interactive?: boolean; location: FactLocation; } interface UsageComponentFact extends BaseFact { kind: "usage_component"; nodeId: FactId; componentId: ComponentId; } interface UsageImportFact extends BaseFact { kind: "usage_import"; file: string; local: string; imported: string; source: string; namespace?: boolean; location: FactLocation; } interface UsagePropResolvedFact extends BaseFact { kind: "usage_prop_resolved"; nodeId: FactId; prop: string; resolution: "static" | "dynamic" | "spread" | "jsx"; value?: unknown; location?: FactLocation; } interface UsageInlineStyleFact extends BaseFact { kind: "usage_inline_style"; nodeId: FactId; property: string; valueKind: "static" | "number" | "css-variable"; value: string; } interface UsageTextChildFact extends BaseFact { kind: "usage_text_child"; nodeId: FactId; text: string; index: number; } type ClassNameOrigin = "attribute" | "clsx" | "cn" | "classnames" | "twMerge" | "tw" | "cva-arg" | "template"; interface ClassNameLiteralFact extends BaseFact { kind: "classname_literal"; file: string; nodeId: FactId; attr: string; classes: string[]; origin: ClassNameOrigin; originPath: string; location: FactLocation; } type ClassNameDynamicReason = "identifier" | "computed" | "spread" | "unknown_helper" | "template_interpolation" | "cva-arg"; interface ClassNameDynamicFact extends BaseFact { kind: "classname_dynamic"; file: string; nodeId: FactId; attr: string; reason: ClassNameDynamicReason; snippet: string; originPath: string; location: FactLocation; } type ClassNameFact = ClassNameLiteralFact | ClassNameDynamicFact; type TailwindModifierKind = "media" | "state" | "dark" | "aria" | "data" | "selector" | "container" | "unknown"; interface TailwindModifier { raw: string; kind: TailwindModifierKind; } type TailwindValue = { kind: "token"; token: string; opacity?: string; } | { kind: "arbitrary"; raw: string; } | { kind: "css-variable"; ref: string; } | { kind: "none"; }; interface TailwindClassFact extends BaseFact { kind: "tailwind_class"; file: string; /** Joins to the parent JSX element and originating classname_literal. */ nodeId: FactId; /** Original class token, e.g. `dark:hover:!bg-red-500/50`. */ raw: string; /** Stable path from the originating classname_literal plus class index. */ originPath: string; prefix: string | null; modifiers: TailwindModifier[]; important: boolean; negative: boolean; utility: string; value: TailwindValue; location: FactLocation; } interface ThemeDeclarationFact extends BaseFact { kind: "theme_declaration"; file: string; name: string; value: string; declarationPath: string; inline: boolean; flavor: "default" | "inline" | "reference" | "static" | "unknown"; location: FactLocation; } interface SuppressionDirectiveFact extends BaseFact { kind: "suppression_directive"; file: string; line: number; column: number; code: string; reason: string; expiresOn?: string; attachedLine?: number; attachedTo?: FactId; /** * Which authoring syntax produced the directive. Absent (legacy facts) means * `@fragments-expect-error`; `"allow"` is the `fragments-allow FUI####: reason` * flavor, which carries no expiry syntax and is reported to Cloud as a bypass * event when it matches a finding. */ directive?: "expect-error" | "allow"; } type TailwindResolvedKind = "color" | "length" | "shadow" | "font-family" | "font-size" | "radius" | "duration" | "unknown"; type TailwindResolutionSource = "theme-css" | "default" | "unknown"; type TailwindResolvedValue = { kind: Exclude; value: string; source: Exclude; inline?: boolean; } | { kind: "unknown"; source: "unknown"; }; interface TailwindTokenResolvedFact extends BaseFact { kind: "tailwind_token_resolved"; utility: string; token: string; resolved: TailwindResolvedValue; } /** * A raw declaration extracted from a CSS/SCSS file. Distinct from * `usage_inline_style` because there is no JSX node — declarations live in a * selector chain. Identity is `{ file, selector, declarationPath, property }` * so the ID stays stable when other lines move. */ interface StyleDeclarationFact extends BaseFact { kind: "style_declaration"; file: string; /** Full selector chain (e.g., ".button .icon") or "" for root-level. */ selector: string; /** Stable structural index within the parent selector (e.g., "0", "0/2"). */ declarationPath: string; property: string; value: string; location: FactLocation; /** * True when the declaration came from a configured token source file. Raw * value rules use this to allow token registries to mint values while still * flagging ad hoc custom properties in product code. */ declaredTokenSource?: boolean; } type UnsupportedStyleReason = "dynamic-template-expression" | "dynamic-object-value" | "object-spread" | "unsupported-array-element"; interface StyleUnsupportedFact extends BaseFact { kind: "style_unsupported"; file: string; source: "css-in-js"; syntax: string; selector: string; declarationPath: string; property?: string; reason: UnsupportedStyleReason; location: FactLocation; } interface CanonicalCandidateFact extends BaseFact { kind: "canonical_candidate"; componentId: ComponentId; canonical: string; confidence: number; band: "auto" | "suggested" | "possible" | "tie" | "unknown"; location?: FactLocation; classifierVersion: string; vocabVersion: string; evidence: unknown[]; userConfirmed?: boolean; } interface CanonicalMappingFact extends BaseFact { kind: "canonical_mapping"; componentId: ComponentId; canonical: string; status: "confirmed" | "proposed" | "unknown"; confidence: number; location?: FactLocation; } interface StructuralConfidenceFact extends BaseFact { kind: "structural_confidence"; componentId: ComponentId; canonical: string; confidence: number; signalCount: number; location?: FactLocation; } interface CanonicalReplacementFact extends BaseFact { kind: "canonical_replacement"; componentId: ComponentId; canonical: string; importPath?: string; componentName?: string; confidence: number; location?: FactLocation; } type ComponentLevelFact = ComponentMetadataFact | ComponentCapabilityFact | PropMetadataFact; type PolicyFact = PropValueAvoidedFact | PropValueForbiddenFact | A11yNameRequiredFact | ScaleFact | ScaleValueFact | StyleRawColorForbiddenFact | StyleRawDimensionForbiddenFact | StylePropertyScaleFact | StyleFontSizeScaleFact | StyleCssVarsMustBeDefinedFact | ContractTokenFact | JsxUnknownPropsForbiddenFact | JsxInlineStyleForbiddenRawFact | JsxImportPathPreferredFact | JsxComponentPreferredFact | TokenDefinitionFact | TailwindPaletteAllowFact | TailwindPaletteDenyFact | TailwindUnknownClassEnabledFact | GovernanceRuleConfigFact; type UsageFact = UsageNodeFact | UsageComponentFact | UsageImportFact | UsagePropResolvedFact | UsageInlineStyleFact | UsageTextChildFact | StyleDeclarationFact | StyleUnsupportedFact | ClassNameLiteralFact | ClassNameDynamicFact | TailwindClassFact | ThemeDeclarationFact | SuppressionDirectiveFact | TailwindTokenResolvedFact | CanonicalCandidateFact | CanonicalMappingFact | StructuralConfidenceFact | CanonicalReplacementFact; type Fact = ComponentLevelFact | PolicyFact | UsageFact; type FactKind = Fact["kind"]; /** Narrows a Fact union by kind. */ type FactOfKind = Extract; /** * Content-addressed fact IDs. * * A fact ID is a deterministic function of (kind, identity). Two runs over the * same inputs produce identical IDs; identity attribute order is irrelevant * because the payload is canonicalized before hashing. * * The hash is a 64-bit FNV-1a (computed as two 32-bit halves with different * seeds). It is not a cryptographic hash — fact IDs are integrity references * inside one build, not security tokens. */ declare function canonicalJson(value: unknown): string; declare function hash64Hex(input: string): string; declare function componentId(packageName: string, name: string): ComponentId; declare function asComponentId(value: string): ComponentId; /** * Compute a content-addressed fact ID. Identity is canonicalized so attribute * order is irrelevant. */ declare function factId(kind: string, identity: Record): FactId; /** * Fact builders — factory functions that compute the content-addressed ID * from each fact's identity attributes. Use these everywhere instead of hand- * rolling fact objects so the identity contract stays consistent. * * The "identity" of a fact is the subset of attributes that determines its * ID. Other attributes (e.g., `because`, `description`) can change without * changing the ID — same logical fact, refined payload. */ declare function makeComponentMetadataFact(input: { componentId: ComponentId; name: string; description?: string; category?: string; filePath?: string; }): ComponentMetadataFact; declare function makeComponentCapabilityFact(input: { componentId: ComponentId; capability: string; }): ComponentCapabilityFact; declare function makeCanonicalCandidateFact(input: { componentId: ComponentId; canonical: string; confidence: number; band: CanonicalCandidateFact["band"]; location?: FactLocation; classifierVersion: string; vocabVersion: string; evidence: unknown[]; userConfirmed?: boolean; }): CanonicalCandidateFact; declare function makeCanonicalMappingFact(input: { componentId: ComponentId; canonical: string; status: CanonicalMappingFact["status"]; confidence: number; location?: FactLocation; }): CanonicalMappingFact; declare function makeStructuralConfidenceFact(input: { componentId: ComponentId; canonical: string; confidence: number; signalCount: number; location?: FactLocation; }): StructuralConfidenceFact; declare function makeCanonicalReplacementFact(input: { componentId: ComponentId; canonical: string; importPath?: string; componentName?: string; confidence: number; location?: FactLocation; }): CanonicalReplacementFact; declare function makePropMetadataFact(input: { componentId: ComponentId; prop: string; type: string; values?: string[]; required: boolean; default?: unknown; description?: string; }): PropMetadataFact; declare function makePropValueAvoidedFact(input: { componentId: ComponentId; prop: string; value: unknown; because: string; suggest?: string; severity: GovernanceSeverity; }): PropValueAvoidedFact; declare function makePropValueForbiddenFact(input: { componentId: ComponentId; prop: string; value: unknown; pathPattern?: string; because: string; replaceWith?: unknown; severity: GovernanceSeverity; }): PropValueForbiddenFact; declare function makeA11yNameRequiredFact(input: { componentId: ComponentId; because: string; severity: GovernanceSeverity; }): A11yNameRequiredFact; declare function makeScaleFact(input: { name: string; unit: "px" | "rem"; rootFontSizePx?: number; emBasePx?: number; }): ScaleFact; declare function makeScaleValueFact(input: { scale: string; value: number; }): ScaleValueFact; declare function makeStyleRawColorForbiddenFact(input: { except: string[]; prefer: "token" | "css-variable"; severity: GovernanceSeverity; }): StyleRawColorForbiddenFact; declare function makeStylePropertyScaleFact(input: { property: string; scale: string; severity: GovernanceSeverity; }): StylePropertyScaleFact; declare function makeStyleFontSizeScaleFact(input: { scale: string; severity: GovernanceSeverity; }): StyleFontSizeScaleFact; declare function makeStyleCssVarsMustBeDefinedFact(input: { severity: GovernanceSeverity; }): StyleCssVarsMustBeDefinedFact; declare function makeContractTokenFact(input: { name: string; }): ContractTokenFact; declare function makeJsxUnknownPropsForbiddenFact(input: { severity: GovernanceSeverity; }): JsxUnknownPropsForbiddenFact; declare function makeJsxInlineStyleForbiddenRawFact(input: { property: string; severity: GovernanceSeverity; }): JsxInlineStyleForbiddenRawFact; declare function makeJsxImportPathPreferredFact(input: { from: string; to: string; imported?: string; because?: string; severity: GovernanceSeverity; }): JsxImportPathPreferredFact; declare function makeJsxComponentPreferredFact(input: { from: ComponentId; to: ComponentId; because?: string; severity: GovernanceSeverity; }): JsxComponentPreferredFact; declare function makeTokenDefinitionFact(input: { name: string; value: string; category?: TokenDefinitionFact["category"]; referenceFormat?: TokenDefinitionFact["referenceFormat"]; }): TokenDefinitionFact; declare function makeTailwindPaletteAllowFact(input: { patterns: string[]; severity: GovernanceSeverity; }): TailwindPaletteAllowFact; declare function makeTailwindPaletteDenyFact(input: { patterns: string[]; severity: GovernanceSeverity; }): TailwindPaletteDenyFact; declare function makeTailwindUnknownClassEnabledFact(input: { severity: GovernanceSeverity; }): TailwindUnknownClassEnabledFact; declare function makeUsageNodeFact(input: { file: string; nodePath: string; element: string; role?: string; interactive?: boolean; location: FactLocation; }): UsageNodeFact; declare function makeUsageComponentFact(input: { nodeId: FactId; componentId: ComponentId; }): UsageComponentFact; declare function makeUsageImportFact(input: { file: string; local: string; imported: string; source: string; namespace?: boolean; location: FactLocation; }): UsageImportFact; declare function makeUsagePropResolvedFact(input: { nodeId: FactId; prop: string; resolution: "static" | "dynamic" | "spread" | "jsx"; value?: unknown; location?: FactLocation; }): UsagePropResolvedFact; declare function makeUsageInlineStyleFact(input: { nodeId: FactId; property: string; valueKind: "static" | "number" | "css-variable"; value: string; }): UsageInlineStyleFact; declare function makeUsageTextChildFact(input: { nodeId: FactId; text: string; index: number; }): UsageTextChildFact; declare function makeClassNameLiteralFact(input: { file: string; nodeId: FactId; attr: string; classes: string[]; origin: ClassNameOrigin; originPath: string; location: FactLocation; }): ClassNameLiteralFact; declare function makeClassNameDynamicFact(input: { file: string; nodeId: FactId; attr: string; reason: ClassNameDynamicReason; snippet: string; originPath: string; location: FactLocation; }): ClassNameDynamicFact; declare function makeTailwindClassFact(input: { file: string; nodeId: FactId; raw: string; originPath: string; prefix: string | null; modifiers: TailwindModifier[]; important: boolean; negative: boolean; utility: string; value: TailwindValue; location: FactLocation; }): TailwindClassFact; declare function makeThemeDeclarationFact(input: { file: string; name: string; value: string; declarationPath: string; inline: boolean; flavor: ThemeDeclarationFact["flavor"]; location: FactLocation; }): ThemeDeclarationFact; declare function makeTailwindTokenResolvedFact(input: { utility: string; token: string; resolved: TailwindResolvedValue; }): TailwindTokenResolvedFact; declare function makeStyleDeclarationFact(input: { file: string; selector: string; declarationPath: string; property: string; value: string; location: FactLocation; declaredTokenSource?: boolean; }): StyleDeclarationFact; declare function makeStyleUnsupportedFact(input: { file: string; source: "css-in-js"; syntax: string; selector: string; declarationPath: string; property?: string; reason: UnsupportedStyleReason; location: FactLocation; }): StyleUnsupportedFact; /** * In-memory index over Fact records. * * Rules consume the index, never raw fact arrays. The query surface is * intentionally narrow: components.byId / propsOf / propOf / capabilitiesOf, * and policy.(componentId, opts?). This keeps Phase 5 rules pure * and content-addressed. */ interface FactEvidence { factId: FactId; fact: Fact; } /** * Match a literal path against a simple glob pattern. `*` matches any run of * non-separator characters; `**` matches any run of characters including * separators. */ declare function matchesGlob(path: string, pattern: string): boolean; declare class FactIndex { private readonly facts; private readonly idsByKind; private readonly idsByComponent; add(fact: Fact): void; addMany(facts: Iterable): void; get(id: FactId): Fact | undefined; has(id: FactId): boolean; size(): number; all(): Fact[]; byKind(kind: K): Array>; /** * Resolve evidence for a list of fact IDs. Throws if any ID is missing — * findings must never reference facts that aren't in the index. */ evidence(ids: readonly FactId[]): FactEvidence[]; components: { list: () => ComponentMetadataFact[]; byId: (componentId: ComponentId) => ComponentMetadataFact | undefined; propsOf: (componentId: ComponentId) => PropMetadataFact[]; propOf: (componentId: ComponentId, prop: string) => PropMetadataFact | undefined; capabilitiesOf: (componentId: ComponentId) => ComponentCapabilityFact[]; }; policy: { forbiddenPropValues: (componentId: ComponentId, opts?: { prop?: string; path?: string; value?: unknown; }) => PropValueForbiddenFact[]; avoidedPropValues: (componentId: ComponentId, opts?: { prop?: string; value?: unknown; }) => PropValueAvoidedFact[]; a11yNameRequired: (componentId: ComponentId) => A11yNameRequiredFact | undefined; scales: () => ScaleFact[]; scale: (name: string) => ScaleFact | undefined; scaleValues: (name: string) => ScaleValueFact[]; rawColorPolicy: () => StyleRawColorForbiddenFact | undefined; rawDimensionPolicy: () => StyleRawDimensionForbiddenFact | undefined; propertyScale: (property: string) => StylePropertyScaleFact | undefined; fontSizeScale: () => StyleFontSizeScaleFact | undefined; cssVarsMustBeDefined: () => StyleCssVarsMustBeDefinedFact | undefined; tailwindPaletteAllow: () => TailwindPaletteAllowFact | undefined; tailwindPaletteDeny: () => TailwindPaletteDenyFact | undefined; tailwindUnknownClassEnabled: () => TailwindUnknownClassEnabledFact | undefined; ruleConfig: (ruleId: string) => GovernanceRuleConfigFact | undefined; jsxUnknownPropsForbidden: () => JsxUnknownPropsForbiddenFact | undefined; jsxInlineStyleForbiddenRaw: (opts?: { property?: string; }) => JsxInlineStyleForbiddenRawFact[]; jsxImportPathPreferred: (opts?: { from?: string; imported?: string; }) => JsxImportPathPreferredFact[]; jsxComponentPreferred: (opts?: { from?: ComponentId; }) => JsxComponentPreferredFact[]; }; tokens: { list: () => TokenDefinitionFact[]; byCategory: (category: TokenDefinitionFact["category"]) => TokenDefinitionFact[]; }; private byComponentOfKind; } /** * Compile facts from the existing IR. * * Two entry points: * - `compileGlobalGovernanceFacts(govern)` turns a `GovernanceConfig` into * scale + scale_value + style_* + jsx_* policy facts. * - `compileComponentFacts(componentId, fragment)` turns a governed * fragment definition (or a compiled fragment) into component metadata, * prop metadata, capability, and component-scoped policy facts. * * Both functions are pure and produce arrays sorted only by source order; the * caller is free to add them to a `FactIndex` in any order. */ declare function compileGlobalGovernanceFacts(govern: GovernanceConfig | undefined): PolicyFact[]; type ComponentFactInput = CompiledFragment | GovernedFragmentDefinition | ResolvedGovernedFragmentDefinition; declare function compileComponentFacts(componentId: ComponentId, input: ComponentFactInput): Fact[]; interface BuildAgentFormatInput { findings: readonly Finding[]; filesScanned: number; passed?: boolean; suppressions?: readonly SuppressionDirectiveFact[]; iteration?: number; maxIterations?: number; previousScore?: number; maxFindings?: number; includeEvidence?: boolean; includeFindings?: boolean; } declare function buildAgentFormat(input: BuildAgentFormatInput): AgentFormat; declare function normalizeConfigPath(path: string): string; declare function portableRepoPathError(path: string): string | null; declare function isPortableRepoPath(path: string): boolean; declare function resolveConfiguredAppPath(config: Pick): string; declare function topologyBase(config: Pick): "app" | "repo"; declare function tokenIncludesFromConfig(tokens: TokenConfig): string[]; /** * Performance budget presets and classification utilities. * * ESLint model: global defaults, zero-config, auto-measurement. * Users configure 0-3 numbers. Per-component overrides are the `eslint-disable` equivalent. */ interface PerformanceBudgets { /** Maximum gzipped bundle size in bytes */ bundleSize: number; } interface PerformanceConfig { preset: string; budgets: PerformanceBudgets; } type ComplexityTier = 'lightweight' | 'moderate' | 'heavy'; interface PerformanceData { /** Gzipped bundle size in bytes */ bundleSize: number; /** Raw (minified, not gzipped) bundle size in bytes */ rawSize: number; /** Complexity classification */ complexity: ComplexityTier; /** Percentage of budget used (0-100+) */ budgetPercent: number; /** Whether the component exceeds its budget */ overBudget: boolean; /** ISO timestamp when measured */ measuredAt: string; } interface PerformanceSummary { /** Preset name used */ preset: string; /** Budget applied in bytes */ budget: number; /** Total components measured */ total: number; /** Number of components over budget */ overBudget: number; /** Distribution by tier */ tiers: Record; } declare const PRESET_NAMES: readonly string[]; /** * Resolve a performance config from user input. * Accepts a preset name string or a custom config object. */ declare function resolvePerformanceConfig(input: string | { preset?: string; budgets?: Partial; } | undefined): PerformanceConfig; /** * Classify a component's complexity based on gzipped bundle size. * * - lightweight: < 5KB — simple, leaf components * - moderate: < 15KB — typical composed components * - heavy: >= 15KB — complex widgets with dependencies */ declare function classifyComplexity(gzipBytes: number): ComplexityTier; /** * Format bytes to a human-readable string (e.g. "2.1KB", "15.3KB"). */ declare function formatBytes(bytes: number): string; /** * Create a visual budget bar for terminal output. */ declare function budgetBar(percent: number, width?: number): string; /** * Design Token Types for Fragments * * These types define the structure for CSS custom property (CSS variable) discovery, * parsing, and reverse lookup capabilities. The token system enables: * * 1. Automatic discovery of design tokens from CSS/SCSS files * 2. Reverse lookup: given a computed value, find which token(s) produce it * 3. Detection of hardcoded values vs token usage * 4. AI-friendly fix suggestions */ /** * Token categories for grouping and filtering */ type TokenCategory = "color" | "spacing" | "typography" | "radius" | "shadow" | "sizing" | "border" | "animation" | "z-index" | "other"; /** * A single design token (CSS custom property) */ interface DesignToken { /** Token name with leading dashes (e.g., "--color-primary") */ name: string; /** Raw value as written in CSS (e.g., "var(--color-cobalt-50)") */ rawValue: string; /** Fully resolved value (e.g., "#0051c2") */ resolvedValue: string; /** Inferred category based on naming convention */ category: TokenCategory; /** * Token level in the design system hierarchy: * - 1 = Base/primitive tokens (raw values like colors, sizes) * - 2 = Semantic tokens (references to base tokens with meaning) * - 3 = Component tokens (component-specific tokens) */ level: 1 | 2 | 3; /** * Reference chain showing how the value was resolved * e.g., ["--color-primary", "--color-cobalt-50"] means * --color-primary references --color-cobalt-50 */ referenceChain: string[]; /** Source file where this token was defined */ sourceFile: string; /** Line number in source file */ lineNumber?: number; /** Theme this token belongs to (e.g., "default", "dark", "light") */ theme: string; /** CSS selector where this token is defined (e.g., ":root", "[data-theme='dark']") */ selector: string; /** Optional description from comments */ description?: string; } /** * Token registry for fast lookups */ interface TokenRegistry { /** Lookup by token name (e.g., "--color-primary") */ byName: Map; /** * REVERSE lookup: resolved value -> token names * Key is normalized value (e.g., "#0051c2" lowercase) * Value is array of token names that resolve to this value */ byValue: Map; /** Tokens grouped by theme */ byTheme: Map; /** Tokens grouped by category */ byCategory: Map; /** Registry metadata */ meta: TokenRegistryMeta; } /** * Token registry metadata */ interface TokenRegistryMeta { /** When tokens were discovered */ discoveredAt: Date; /** Source files that were parsed */ sourceFiles: string[]; /** Total number of tokens discovered */ totalTokens: number; /** Time taken to parse (ms) */ parseTimeMs: number; /** Number of circular references detected */ circularRefs: number; /** Number of unresolved references */ unresolvedRefs: number; } /** * Enhanced style diff item with token information */ interface EnhancedStyleDiffItem { /** CSS property name (e.g., "backgroundColor") */ property: string; /** Value from Figma design */ figma: string; /** Value from rendered component */ rendered: string; /** Whether values match (within tolerance) */ match: boolean; /** Token name if Figma value matches a known token */ figmaToken?: string; /** Token name if rendered value uses a token */ renderedToken?: string; /** * True if rendered value doesn't use a token but should * (i.e., Figma uses a token but code uses hardcoded value) */ isHardcoded: boolean; /** Suggested fix if hardcoded */ suggestedFix?: TokenFix; } /** * Token-based fix suggestion */ interface TokenFix { /** Token name to use (e.g., "--color-primary") */ tokenName: string; /** Token's resolved value */ tokenValue: string; /** Code snippet to fix the issue */ codeFix: string; /** Confidence score 0-1 */ confidence: number; /** Human-readable explanation */ reason: string; } /** * Result of parsing a CSS/SCSS file for tokens */ interface TokenParseResult { /** Tokens discovered in the file */ tokens: DesignToken[]; /** Errors encountered during parsing */ errors: TokenParseError[]; /** Warnings (non-fatal issues) */ warnings: string[]; /** Parse time in ms */ parseTimeMs: number; } /** * Error during token parsing */ interface TokenParseError { /** Error message */ message: string; /** File where error occurred */ file: string; /** Line number if known */ line?: number; /** The problematic content if available */ content?: string; } /** * Request to match a value to tokens */ interface TokenMatchRequest { /** The value to find tokens for (e.g., "#0051c2") */ value: string; /** Property type hint for better matching (e.g., "color") */ propertyType?: "color" | "spacing" | "typography" | "other"; /** Specific theme to search in */ theme?: string; } /** * Result of token matching */ interface TokenMatchResult { /** Exact matches (same resolved value) */ exactMatches: DesignToken[]; /** Close matches (similar value, useful for colors) */ closeMatches: Array<{ token: DesignToken; /** How close the match is (0-1, 1 = exact) */ similarity: number; }>; /** Whether any match was found */ found: boolean; } /** * Summary of token usage in a component */ interface TokenUsageSummary { /** Total CSS properties checked */ totalProperties: number; /** Properties using design tokens */ usingTokens: number; /** Properties with hardcoded values */ hardcoded: number; /** Properties matching but not using tokens explicitly */ implicitMatches: number; /** Compliance percentage (usingTokens / totalProperties * 100) */ compliancePercent: number; /** List of hardcoded properties with fix suggestions */ hardcodedProperties: EnhancedStyleDiffItem[]; } declare const bundleSchemaVersionSchema: z.ZodLiteral<1>; declare const bundleTargetSchema: z.ZodEnum<["cursor", "agents", "claude", "copilot"]>; declare const bundleArtifactMetadataSchema: z.ZodObject<{ kind: z.ZodEnum<["manifest", "tokens", "design-system", "readme", "helper", "component"]>; key: z.ZodString; label: z.ZodString; path: z.ZodString; etag: z.ZodString; updatedAt: z.ZodString; target: z.ZodOptional>; componentId: z.ZodOptional; contentType: z.ZodEnum<["application/json", "text/markdown"]>; }, "strip", z.ZodTypeAny, { path: string; kind: "tokens" | "component" | "manifest" | "design-system" | "readme" | "helper"; key: string; label: string; etag: string; updatedAt: string; contentType: "application/json" | "text/markdown"; componentId?: string | undefined; target?: "agents" | "cursor" | "claude" | "copilot" | undefined; }, { path: string; kind: "tokens" | "component" | "manifest" | "design-system" | "readme" | "helper"; key: string; label: string; etag: string; updatedAt: string; contentType: "application/json" | "text/markdown"; componentId?: string | undefined; target?: "agents" | "cursor" | "claude" | "copilot" | undefined; }>; declare const bundleManifestComponentEntrySchema: z.ZodObject<{ componentId: z.ZodString; file: z.ZodString; name: z.ZodString; publicSlug: z.ZodNullable; tier: z.ZodEnum<["core", "composition"]>; category: z.ZodString; status: z.ZodString; description: z.ZodString; propCount: z.ZodNumber; hasExamples: z.ZodBoolean; hasCompoundChildren: z.ZodBoolean; relations: z.ZodArray, "many">; compoundChildren: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { status: string; file: string; description: string; category: string; name: string; componentId: string; compoundChildren: { name: string; componentId: string; }[]; publicSlug: string | null; tier: "composition" | "core"; propCount: number; hasExamples: boolean; hasCompoundChildren: boolean; relations: { type: string; name: string; componentId: string; }[]; }, { status: string; file: string; description: string; category: string; name: string; componentId: string; compoundChildren: { name: string; componentId: string; }[]; publicSlug: string | null; tier: "composition" | "core"; propCount: number; hasExamples: boolean; hasCompoundChildren: boolean; relations: { type: string; name: string; componentId: string; }[]; }>; declare const bundleManifestSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; catalogRevision: z.ZodString; catalogUpdatedAt: z.ZodString; org: z.ZodObject<{ id: z.ZodString; name: z.ZodString; slug: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; id: string; slug: string; }, { name: string; id: string; slug: string; }>; designSystem: z.ZodObject<{ name: z.ZodString; packageName: z.ZodNullable; importPath: z.ZodNullable; }, "strip", z.ZodTypeAny, { name: string; importPath: string | null; packageName: string | null; }, { name: string; importPath: string | null; packageName: string | null; }>; sourceBinding: z.ZodObject<{ bindingId: z.ZodString; projectId: z.ZodString; projectName: z.ZodString; repoFullName: z.ZodString; resolution: z.ZodEnum<["explicit", "auto"]>; }, "strip", z.ZodTypeAny, { bindingId: string; projectId: string; projectName: string; repoFullName: string; resolution: "auto" | "explicit"; }, { bindingId: string; projectId: string; projectName: string; repoFullName: string; resolution: "auto" | "explicit"; }>; totalComponents: z.ZodNumber; totalTokens: z.ZodNumber; tokenCategories: z.ZodRecord; components: z.ZodRecord; tier: z.ZodEnum<["core", "composition"]>; category: z.ZodString; status: z.ZodString; description: z.ZodString; propCount: z.ZodNumber; hasExamples: z.ZodBoolean; hasCompoundChildren: z.ZodBoolean; relations: z.ZodArray, "many">; compoundChildren: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { status: string; file: string; description: string; category: string; name: string; componentId: string; compoundChildren: { name: string; componentId: string; }[]; publicSlug: string | null; tier: "composition" | "core"; propCount: number; hasExamples: boolean; hasCompoundChildren: boolean; relations: { type: string; name: string; componentId: string; }[]; }, { status: string; file: string; description: string; category: string; name: string; componentId: string; compoundChildren: { name: string; componentId: string; }[]; publicSlug: string | null; tier: "composition" | "core"; propCount: number; hasExamples: boolean; hasCompoundChildren: boolean; relations: { type: string; name: string; componentId: string; }[]; }>>; }, "strip", z.ZodTypeAny, { components: Record; schemaVersion: 1; designSystem: { name: string; importPath: string | null; packageName: string | null; }; catalogRevision: string; catalogUpdatedAt: string; org: { name: string; id: string; slug: string; }; sourceBinding: { bindingId: string; projectId: string; projectName: string; repoFullName: string; resolution: "auto" | "explicit"; }; totalComponents: number; totalTokens: number; tokenCategories: Record; }, { components: Record; schemaVersion: 1; designSystem: { name: string; importPath: string | null; packageName: string | null; }; catalogRevision: string; catalogUpdatedAt: string; org: { name: string; id: string; slug: string; }; sourceBinding: { bindingId: string; projectId: string; projectName: string; repoFullName: string; resolution: "auto" | "explicit"; }; totalComponents: number; totalTokens: number; tokenCategories: Record; }>; declare const bundleTokenFileSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; catalogRevision: z.ZodString; catalogUpdatedAt: z.ZodString; categories: z.ZodRecord; category: z.ZodString; value: z.ZodString; type: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }, { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { tokens: { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }[]; count: number; }, { tokens: { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }[]; count: number; }>>; flat: z.ZodArray; category: z.ZodString; value: z.ZodString; type: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }, { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { flat: { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }[]; schemaVersion: 1; catalogRevision: string; catalogUpdatedAt: string; categories: Record; }, { flat: { value: string; path: string[]; category: string; name: string; type?: string | undefined; description?: string | undefined; }[]; schemaVersion: 1; catalogRevision: string; catalogUpdatedAt: string; categories: Record; }>; declare const bundleComponentShardSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; catalogRevision: z.ZodString; catalogUpdatedAt: z.ZodString; componentId: z.ZodString; file: z.ZodString; component: z.ZodObject<{ componentKey: z.ZodString; publicRef: z.ZodString; publicId: z.ZodNullable; publicSlug: z.ZodNullable; isCanonical: z.ZodOptional; name: z.ZodString; tier: z.ZodEnum<["core", "composition"]>; category: z.ZodString; status: z.ZodString; description: z.ZodString; usageGuidance: z.ZodString; dos: z.ZodArray; donts: z.ZodArray; props: z.ZodRecord; relations: z.ZodArray, "many">; compoundChildren: z.ZodArray, "many">; examples: z.ZodArray, "many">; source: z.ZodLiteral<"design-system">; sourcePath: z.ZodOptional; sourceRepoFullName: z.ZodOptional; parentComponentName: z.ZodOptional; parentComponentKey: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: string; description: string; props: Record; category: string; name: string; componentKey: string; publicRef: string; compoundChildren: { name: string; componentId: string; }[]; source: "design-system"; publicSlug: string | null; tier: "composition" | "core"; relations: Record[]; publicId: string | null; usageGuidance: string; dos: string[]; donts: string[]; examples: Record[]; sourcePath?: string | undefined; isCanonical?: boolean | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; parentComponentKey?: string | undefined; }, { status: string; description: string; props: Record; category: string; name: string; componentKey: string; publicRef: string; compoundChildren: { name: string; componentId: string; }[]; source: "design-system"; publicSlug: string | null; tier: "composition" | "core"; relations: Record[]; publicId: string | null; usageGuidance: string; dos: string[]; donts: string[]; examples: Record[]; sourcePath?: string | undefined; isCanonical?: boolean | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; parentComponentKey?: string | undefined; }>; }, "strip", z.ZodTypeAny, { file: string; schemaVersion: 1; componentId: string; component: { status: string; description: string; props: Record; category: string; name: string; componentKey: string; publicRef: string; compoundChildren: { name: string; componentId: string; }[]; source: "design-system"; publicSlug: string | null; tier: "composition" | "core"; relations: Record[]; publicId: string | null; usageGuidance: string; dos: string[]; donts: string[]; examples: Record[]; sourcePath?: string | undefined; isCanonical?: boolean | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; parentComponentKey?: string | undefined; }; catalogRevision: string; catalogUpdatedAt: string; }, { file: string; schemaVersion: 1; componentId: string; component: { status: string; description: string; props: Record; category: string; name: string; componentKey: string; publicRef: string; compoundChildren: { name: string; componentId: string; }[]; source: "design-system"; publicSlug: string | null; tier: "composition" | "core"; relations: Record[]; publicId: string | null; usageGuidance: string; dos: string[]; donts: string[]; examples: Record[]; sourcePath?: string | undefined; isCanonical?: boolean | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; parentComponentKey?: string | undefined; }; catalogRevision: string; catalogUpdatedAt: string; }>; type BundleSchemaVersion = z.infer; type BundleTarget = z.infer; type BundleArtifactMetadata = z.infer; type BundleManifestComponentEntry = z.infer; type BundleManifest = z.infer; type BundleComponentShard = z.infer; type BundleTokenFile = z.infer; interface RegistryWritePlan { path: string; sourcePath: string; content: string; componentId?: string; } interface BuildRegistryInstallPlanInput { artifact: RegistryArtifact; requestedComponents: readonly string[]; targetPath: string; all?: boolean; includeTests?: boolean; } interface RegistryInstallPlan { componentNames: string[]; plans: RegistryWritePlan[]; dependencies: RegistryDependency[]; } declare function normalizeRegistryRepoPath(path: string): string; declare function assertPortableRegistryPath(path: string, label: string): string; declare function sourceToRegistryTargetPath(targetRoot: string, sourcePath: string): string; declare function selectedRegistryComponentNames(artifact: RegistryArtifact, requested: readonly string[], all: boolean | undefined): string[]; declare function collectRegistryInstallDependencies(artifact: RegistryArtifact, componentNames: readonly string[]): RegistryDependency[]; declare function buildRegistryInstallPlan(input: BuildRegistryInstallPlanInput): RegistryInstallPlan; declare function buildRegistryInstallReceipt(args: { artifact: RegistryArtifact; targetPath: string; importPath: string; componentNames: readonly string[]; plans: readonly RegistryWritePlan[]; dependencies: readonly RegistryDependency[]; installedAt?: string; }): RegistryInstallReceipt; declare const mcpSnapshotSchemaVersionSchema: z.ZodLiteral<1>; declare const mcpSourceTypeSchema: z.ZodEnum<["fragments-json", "cloud", "auto-extract", "custom-json", "bundle"]>; declare const mcpCapabilitySchema: z.ZodEnum<["components", "tokens", "blocks", "graph", "performance"]>; declare const mcpPerformanceImportSchema: z.ZodObject<{ path: z.ZodString; bytes: z.ZodNumber; percent: z.ZodNumber; }, "strip", z.ZodTypeAny, { path: string; bytes: number; percent: number; }, { path: string; bytes: number; percent: number; }>; declare const mcpPerformanceDataSchema: z.ZodObject<{ bundleSize: z.ZodNumber; rawSize: z.ZodNumber; complexity: z.ZodEnum<["lightweight", "moderate", "heavy"]>; budgetPercent: z.ZodNumber; overBudget: z.ZodBoolean; measuredAt: z.ZodString; imports: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; }, { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; }>; declare const mcpPerformanceSummarySchema: z.ZodObject<{ preset: z.ZodString; budget: z.ZodNumber; total: z.ZodNumber; overBudget: z.ZodNumber; tiers: z.ZodRecord, z.ZodNumber>; }, "strip", z.ZodTypeAny, { budget: number; overBudget: number; preset: string; total: number; tiers: Partial>; }, { budget: number; overBudget: number; preset: string; total: number; tiers: Partial>; }>; declare const mcpComponentPropSchema: z.ZodObject<{ type: z.ZodString; description: z.ZodDefault; required: z.ZodDefault; default: z.ZodOptional; values: z.ZodOptional>; constraints: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; description: string; required: boolean; values?: string[] | undefined; default?: unknown; constraints?: string[] | undefined; }, { type: string; values?: string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; }>; declare const mcpComponentExampleSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional; code: z.ZodOptional; kind: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }, { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }>; declare const mcpComponentRelationSchema: z.ZodObject<{ componentName: z.ZodString; componentId: z.ZodOptional; relationship: z.ZodString; note: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }, { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }>; declare const mcpCompoundChildSchema: z.ZodObject<{ name: z.ZodString; componentId: z.ZodOptional; description: z.ZodOptional; required: z.ZodOptional; accepts: z.ZodOptional>; visibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }, { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }>; declare const mcpGuidancePatternSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>; declare const mcpComponentGuidanceSchema: z.ZodObject<{ when: z.ZodDefault>; whenNot: z.ZodDefault>; guidelines: z.ZodDefault>; accessibility: z.ZodDefault>; usageGuidance: z.ZodOptional; dos: z.ZodDefault>; donts: z.ZodDefault>; patterns: z.ZodDefault; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { when: string[]; dos: string[]; donts: string[]; whenNot: string[]; guidelines: string[]; accessibility: string[]; patterns: { name: string; description?: string | undefined; }[]; usageGuidance?: string | undefined; }, { when?: string[] | undefined; usageGuidance?: string | undefined; dos?: string[] | undefined; donts?: string[] | undefined; whenNot?: string[] | undefined; guidelines?: string[] | undefined; accessibility?: string[] | undefined; patterns?: { name: string; description?: string | undefined; }[] | undefined; }>; declare const mcpComponentMetadataSchema: z.ZodObject<{ a11yRules: z.ZodDefault>; scenarioTags: z.ZodDefault>; }, "strip", z.ZodTypeAny, { a11yRules: string[]; scenarioTags: string[]; }, { a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; }>; declare const mcpComponentSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodDefault; category: z.ZodDefault; status: z.ZodDefault; tags: z.ZodDefault>; props: z.ZodDefault; required: z.ZodDefault; default: z.ZodOptional; values: z.ZodOptional>; constraints: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; description: string; required: boolean; values?: string[] | undefined; default?: unknown; constraints?: string[] | undefined; }, { type: string; values?: string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; }>>>; propsSummary: z.ZodDefault>; examples: z.ZodDefault; code: z.ZodOptional; kind: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }, { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }>, "many">>; relations: z.ZodDefault; relationship: z.ZodString; note: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }, { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }>, "many">>; compoundChildren: z.ZodDefault; description: z.ZodOptional; required: z.ZodOptional; accepts: z.ZodOptional>; visibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }, { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }>, "many">>; guidance: z.ZodDefault>; whenNot: z.ZodDefault>; guidelines: z.ZodDefault>; accessibility: z.ZodDefault>; usageGuidance: z.ZodOptional; dos: z.ZodDefault>; donts: z.ZodDefault>; patterns: z.ZodDefault; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { when: string[]; dos: string[]; donts: string[]; whenNot: string[]; guidelines: string[]; accessibility: string[]; patterns: { name: string; description?: string | undefined; }[]; usageGuidance?: string | undefined; }, { when?: string[] | undefined; usageGuidance?: string | undefined; dos?: string[] | undefined; donts?: string[] | undefined; whenNot?: string[] | undefined; guidelines?: string[] | undefined; accessibility?: string[] | undefined; patterns?: { name: string; description?: string | undefined; }[] | undefined; }>>; sourceType: z.ZodEnum<["fragments-json", "cloud", "auto-extract", "custom-json", "bundle"]>; sourcePath: z.ZodOptional; sourceRepoFullName: z.ZodOptional; packageName: z.ZodOptional; importPath: z.ZodOptional; publicRef: z.ZodOptional; publicSlug: z.ZodOptional>; isCanonical: z.ZodOptional; tier: z.ZodOptional; parentComponentId: z.ZodOptional; parentComponentName: z.ZodOptional; performance: z.ZodOptional; budgetPercent: z.ZodNumber; overBudget: z.ZodBoolean; measuredAt: z.ZodString; imports: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; }, { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; }>>; metadata: z.ZodDefault>; scenarioTags: z.ZodDefault>; }, "strip", z.ZodTypeAny, { a11yRules: string[]; scenarioTags: string[]; }, { a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { status: string; description: string; metadata: { a11yRules: string[]; scenarioTags: string[]; }; props: Record; category: string; name: string; compoundChildren: { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }[]; relations: { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }[]; id: string; examples: { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }[]; tags: string[]; propsSummary: string[]; guidance: { when: string[]; dos: string[]; donts: string[]; whenNot: string[]; guidelines: string[]; accessibility: string[]; patterns: { name: string; description?: string | undefined; }[]; usageGuidance?: string | undefined; }; sourceType: "fragments-json" | "cloud" | "auto-extract" | "custom-json" | "bundle"; performance?: { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; } | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; publicSlug?: string | null | undefined; tier?: string | undefined; packageName?: string | undefined; isCanonical?: boolean | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; parentComponentId?: string | undefined; }, { name: string; id: string; sourceType: "fragments-json" | "cloud" | "auto-extract" | "custom-json" | "bundle"; status?: string | undefined; description?: string | undefined; metadata?: { a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; } | undefined; props?: Record | undefined; performance?: { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; } | undefined; category?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; compoundChildren?: { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }[] | undefined; publicSlug?: string | null | undefined; tier?: string | undefined; relations?: { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }[] | undefined; packageName?: string | undefined; isCanonical?: boolean | undefined; examples?: { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }[] | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; tags?: string[] | undefined; propsSummary?: string[] | undefined; guidance?: { when?: string[] | undefined; usageGuidance?: string | undefined; dos?: string[] | undefined; donts?: string[] | undefined; whenNot?: string[] | undefined; guidelines?: string[] | undefined; accessibility?: string[] | undefined; patterns?: { name: string; description?: string | undefined; }[] | undefined; } | undefined; parentComponentId?: string | undefined; }>; declare const mcpBlockSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodDefault; category: z.ZodDefault; components: z.ZodDefault>; tags: z.ZodDefault>; code: z.ZodDefault; }, "strip", z.ZodTypeAny, { components: string[]; code: string; description: string; category: string; name: string; id: string; tags: string[]; }, { name: string; id: string; components?: string[] | undefined; code?: string | undefined; description?: string | undefined; category?: string | undefined; tags?: string[] | undefined; }>; declare const mcpTokenSchema: z.ZodObject<{ name: z.ZodString; category: z.ZodString; value: z.ZodOptional; description: z.ZodOptional; path: z.ZodOptional>; type: z.ZodOptional; }, "strip", z.ZodTypeAny, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }>; declare const mcpTokenDataSchema: z.ZodObject<{ prefix: z.ZodString; total: z.ZodNumber; categories: z.ZodRecord; description: z.ZodOptional; path: z.ZodOptional>; type: z.ZodOptional; }, "strip", z.ZodTypeAny, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }>, "many">>; flat: z.ZodDefault; description: z.ZodOptional; path: z.ZodOptional>; type: z.ZodOptional; }, "strip", z.ZodTypeAny, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { flat: { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }[]; categories: Record; total: number; prefix: string; }, { categories: Record; total: number; prefix: string; flat?: { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }[] | undefined; }>; declare const mcpSnapshotMetadataSchema: z.ZodObject<{ designSystemName: z.ZodOptional; packageName: z.ZodOptional; importPath: z.ZodOptional; revision: z.ZodOptional; updatedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { importPath?: string | undefined; updatedAt?: string | undefined; packageName?: string | undefined; designSystemName?: string | undefined; revision?: string | undefined; }, { importPath?: string | undefined; updatedAt?: string | undefined; packageName?: string | undefined; designSystemName?: string | undefined; revision?: string | undefined; }>; declare const mcpSnapshotSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; sourceType: z.ZodEnum<["fragments-json", "cloud", "auto-extract", "custom-json", "bundle"]>; sourceLabel: z.ZodString; capabilities: z.ZodArray, "many">; metadata: z.ZodDefault; packageName: z.ZodOptional; importPath: z.ZodOptional; revision: z.ZodOptional; updatedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { importPath?: string | undefined; updatedAt?: string | undefined; packageName?: string | undefined; designSystemName?: string | undefined; revision?: string | undefined; }, { importPath?: string | undefined; updatedAt?: string | undefined; packageName?: string | undefined; designSystemName?: string | undefined; revision?: string | undefined; }>>; components: z.ZodRecord; category: z.ZodDefault; status: z.ZodDefault; tags: z.ZodDefault>; props: z.ZodDefault; required: z.ZodDefault; default: z.ZodOptional; values: z.ZodOptional>; constraints: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; description: string; required: boolean; values?: string[] | undefined; default?: unknown; constraints?: string[] | undefined; }, { type: string; values?: string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; }>>>; propsSummary: z.ZodDefault>; examples: z.ZodDefault; code: z.ZodOptional; kind: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }, { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }>, "many">>; relations: z.ZodDefault; relationship: z.ZodString; note: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }, { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }>, "many">>; compoundChildren: z.ZodDefault; description: z.ZodOptional; required: z.ZodOptional; accepts: z.ZodOptional>; visibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }, { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }>, "many">>; guidance: z.ZodDefault>; whenNot: z.ZodDefault>; guidelines: z.ZodDefault>; accessibility: z.ZodDefault>; usageGuidance: z.ZodOptional; dos: z.ZodDefault>; donts: z.ZodDefault>; patterns: z.ZodDefault; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { when: string[]; dos: string[]; donts: string[]; whenNot: string[]; guidelines: string[]; accessibility: string[]; patterns: { name: string; description?: string | undefined; }[]; usageGuidance?: string | undefined; }, { when?: string[] | undefined; usageGuidance?: string | undefined; dos?: string[] | undefined; donts?: string[] | undefined; whenNot?: string[] | undefined; guidelines?: string[] | undefined; accessibility?: string[] | undefined; patterns?: { name: string; description?: string | undefined; }[] | undefined; }>>; sourceType: z.ZodEnum<["fragments-json", "cloud", "auto-extract", "custom-json", "bundle"]>; sourcePath: z.ZodOptional; sourceRepoFullName: z.ZodOptional; packageName: z.ZodOptional; importPath: z.ZodOptional; publicRef: z.ZodOptional; publicSlug: z.ZodOptional>; isCanonical: z.ZodOptional; tier: z.ZodOptional; parentComponentId: z.ZodOptional; parentComponentName: z.ZodOptional; performance: z.ZodOptional; budgetPercent: z.ZodNumber; overBudget: z.ZodBoolean; measuredAt: z.ZodString; imports: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; }, { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; }>>; metadata: z.ZodDefault>; scenarioTags: z.ZodDefault>; }, "strip", z.ZodTypeAny, { a11yRules: string[]; scenarioTags: string[]; }, { a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { status: string; description: string; metadata: { a11yRules: string[]; scenarioTags: string[]; }; props: Record; category: string; name: string; compoundChildren: { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }[]; relations: { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }[]; id: string; examples: { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }[]; tags: string[]; propsSummary: string[]; guidance: { when: string[]; dos: string[]; donts: string[]; whenNot: string[]; guidelines: string[]; accessibility: string[]; patterns: { name: string; description?: string | undefined; }[]; usageGuidance?: string | undefined; }; sourceType: "fragments-json" | "cloud" | "auto-extract" | "custom-json" | "bundle"; performance?: { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; } | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; publicSlug?: string | null | undefined; tier?: string | undefined; packageName?: string | undefined; isCanonical?: boolean | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; parentComponentId?: string | undefined; }, { name: string; id: string; sourceType: "fragments-json" | "cloud" | "auto-extract" | "custom-json" | "bundle"; status?: string | undefined; description?: string | undefined; metadata?: { a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; } | undefined; props?: Record | undefined; performance?: { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; } | undefined; category?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; compoundChildren?: { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }[] | undefined; publicSlug?: string | null | undefined; tier?: string | undefined; relations?: { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }[] | undefined; packageName?: string | undefined; isCanonical?: boolean | undefined; examples?: { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }[] | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; tags?: string[] | undefined; propsSummary?: string[] | undefined; guidance?: { when?: string[] | undefined; usageGuidance?: string | undefined; dos?: string[] | undefined; donts?: string[] | undefined; whenNot?: string[] | undefined; guidelines?: string[] | undefined; accessibility?: string[] | undefined; patterns?: { name: string; description?: string | undefined; }[] | undefined; } | undefined; parentComponentId?: string | undefined; }>>; blocks: z.ZodOptional; category: z.ZodDefault; components: z.ZodDefault>; tags: z.ZodDefault>; code: z.ZodDefault; }, "strip", z.ZodTypeAny, { components: string[]; code: string; description: string; category: string; name: string; id: string; tags: string[]; }, { name: string; id: string; components?: string[] | undefined; code?: string | undefined; description?: string | undefined; category?: string | undefined; tags?: string[] | undefined; }>>>; tokens: z.ZodOptional; description: z.ZodOptional; path: z.ZodOptional>; type: z.ZodOptional; }, "strip", z.ZodTypeAny, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }>, "many">>; flat: z.ZodDefault; description: z.ZodOptional; path: z.ZodOptional>; type: z.ZodOptional; }, "strip", z.ZodTypeAny, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }, { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { flat: { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }[]; categories: Record; total: number; prefix: string; }, { categories: Record; total: number; prefix: string; flat?: { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }[] | undefined; }>>; graph: z.ZodOptional; performanceSummary: z.ZodOptional, z.ZodNumber>; }, "strip", z.ZodTypeAny, { budget: number; overBudget: number; preset: string; total: number; tiers: Partial>; }, { budget: number; overBudget: number; preset: string; total: number; tiers: Partial>; }>>; packageMap: z.ZodDefault>; defaultPackageName: z.ZodOptional; }, "strip", z.ZodTypeAny, { components: Record; category: string; name: string; compoundChildren: { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }[]; relations: { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }[]; id: string; examples: { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }[]; tags: string[]; propsSummary: string[]; guidance: { when: string[]; dos: string[]; donts: string[]; whenNot: string[]; guidelines: string[]; accessibility: string[]; patterns: { name: string; description?: string | undefined; }[]; usageGuidance?: string | undefined; }; sourceType: "fragments-json" | "cloud" | "auto-extract" | "custom-json" | "bundle"; performance?: { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; } | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; publicSlug?: string | null | undefined; tier?: string | undefined; packageName?: string | undefined; isCanonical?: boolean | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; parentComponentId?: string | undefined; }>; metadata: { importPath?: string | undefined; updatedAt?: string | undefined; packageName?: string | undefined; designSystemName?: string | undefined; revision?: string | undefined; }; schemaVersion: 1; sourceType: "fragments-json" | "cloud" | "auto-extract" | "custom-json" | "bundle"; sourceLabel: string; capabilities: ("components" | "tokens" | "performance" | "blocks" | "graph")[]; packageMap: Record; tokens?: { flat: { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }[]; categories: Record; total: number; prefix: string; } | undefined; blocks?: Record | undefined; graph?: unknown; performanceSummary?: { budget: number; overBudget: number; preset: string; total: number; tiers: Partial>; } | undefined; defaultPackageName?: string | undefined; }, { components: Record | undefined; performance?: { bundleSize: number; rawSize: number; complexity: "moderate" | "lightweight" | "heavy"; budgetPercent: number; overBudget: boolean; measuredAt: string; imports?: { path: string; bytes: number; percent: number; }[] | undefined; } | undefined; category?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; compoundChildren?: { name: string; description?: string | undefined; componentId?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; visibility?: "public" | "internal" | undefined; }[] | undefined; publicSlug?: string | null | undefined; tier?: string | undefined; relations?: { componentName: string; relationship: string; description?: string | undefined; componentId?: string | undefined; note?: string | undefined; }[] | undefined; packageName?: string | undefined; isCanonical?: boolean | undefined; examples?: { name: string; code?: string | undefined; kind?: string | undefined; description?: string | undefined; }[] | undefined; sourceRepoFullName?: string | undefined; parentComponentName?: string | undefined; tags?: string[] | undefined; propsSummary?: string[] | undefined; guidance?: { when?: string[] | undefined; usageGuidance?: string | undefined; dos?: string[] | undefined; donts?: string[] | undefined; whenNot?: string[] | undefined; guidelines?: string[] | undefined; accessibility?: string[] | undefined; patterns?: { name: string; description?: string | undefined; }[] | undefined; } | undefined; parentComponentId?: string | undefined; }>; schemaVersion: 1; sourceType: "fragments-json" | "cloud" | "auto-extract" | "custom-json" | "bundle"; sourceLabel: string; capabilities: ("components" | "tokens" | "performance" | "blocks" | "graph")[]; metadata?: { importPath?: string | undefined; updatedAt?: string | undefined; packageName?: string | undefined; designSystemName?: string | undefined; revision?: string | undefined; } | undefined; tokens?: { categories: Record; total: number; prefix: string; flat?: { category: string; name: string; value?: string | undefined; path?: string[] | undefined; type?: string | undefined; description?: string | undefined; }[] | undefined; } | undefined; blocks?: Record | undefined; graph?: unknown; performanceSummary?: { budget: number; overBudget: number; preset: string; total: number; tiers: Partial>; } | undefined; packageMap?: Record | undefined; defaultPackageName?: string | undefined; }>; type McpSnapshotSchemaVersion = z.infer; type McpSourceType = z.infer; type McpCapability = z.infer; type McpPerformanceImport = z.infer; type McpPerformanceData = z.infer; type McpPerformanceSummary = z.infer; type McpComponentProp = z.infer; type McpComponentExample = z.infer; type McpComponentRelation = z.infer; type McpCompoundChild = z.infer; type McpGuidancePattern = z.infer; type McpComponentGuidance = z.infer; type McpComponentMetadata = z.infer; type McpComponent = z.infer; type McpBlock = z.infer; type McpToken = z.infer; type McpTokenData = z.infer; type McpSnapshotMetadata = z.infer; type McpSnapshot = z.infer; /** * Token registry interface for style comparison. * Subset of registry methods needed by the comparison engine. */ interface TokenLookup { findByValue(value: string, theme?: string): string[]; getToken(name: string): DesignToken | undefined; calculateUsageSummary(styleDiffs: Array<{ property: string; figma: string; rendered: string; match: boolean; }>, theme?: string): TokenUsageSummary; } interface RGB { r: number; g: number; b: number; } interface RGBA extends RGB { a?: number; } declare function hexToRgb(hex: string): RGB | null; declare function rgbToHex(r: number, g: number, b: number): string; declare function parseRgb(color: string): RGBA | null; declare function parseColor(color: string): RGBA | null; declare function parseColorToRgb(color: string): RGB | null; declare function normalizeColor(color: string): string; declare function isColorLike(value: string): boolean; declare function familyDistance(c1: RGB, c2: RGB): number; declare function colorSimilarity(c1: RGB, c2: RGB): number; declare function calculateDeltaE(c1: RGB, c2: RGB): number; interface NearestByDeltaEOptions { threshold?: number; limit?: number; } interface DeltaEMatch { item: T; distance: number; confidence: number; } declare function nearestByDeltaE(target: RGB | string, candidates: readonly T[], resolveColor: (candidate: T) => RGB | string | null | undefined, options?: NearestByDeltaEOptions): Array>; /** * Canonical Style Comparison Engine * * Pure comparison logic for design-code drift detection. * No React, no filesystem, no browser APIs, no Figma client, no Cloud types. * * This module is the single source of truth for style comparison. * Both @fragments-sdk/viewer and @fragments-sdk/cli consume these exports. */ /** * Source-agnostic normalized token for comparison. * * This is the canonical shape that all token sources (CSS vars, Tailwind, * DTCG, Figma) must produce before entering the comparison engine. * A `DesignToken` (CSS-custom-property-specific) can be converted to this * by dropping source-specific fields. */ interface NormalizedToken { /** Canonical token name (e.g., "--color-primary", "colors.primary") */ name: string; /** Normalized resolved value suitable for comparison (e.g., "#0051c2", "16px") */ value: string; /** Token category for grouping */ category: TokenCategory; /** Source system identifier */ source: "css-var" | "tailwind" | "dtcg" | "figma" | (string & {}); /** Original token name as declared in the source system */ originalName: string; /** Theme or mode (e.g., "default", "dark", "light") */ theme: string; } /** * Normalized style map: a record of CSS property names to their string values. * Used as the canonical input shape for both design-side and code-side styles. */ type NormalizedStyleMap = Record; /** * Options for configuring style comparison behavior. */ interface StyleComparisonOptions { /** Color comparison tolerance in RGB channel delta (default: 5) */ colorTolerance?: number; /** Numeric comparison tolerance in pixels (default: 1) */ numericTolerance?: number; /** Alpha channel comparison tolerance (default: 0.05) */ alphaTolerance?: number; /** CSS properties to compare. If omitted, uses DEFAULT_STYLE_PROPERTIES */ properties?: string[]; /** Theme to use for token lookup (default: "default") */ theme?: string; } /** * Style diff result for a single CSS property. */ interface StyleDiffItem { /** CSS property name */ property: string; /** Expected value from design source */ figma: string; /** Actual value from rendered component */ rendered: string; /** Whether values match (within tolerance) */ match: boolean; } /** * Result of comparing styles between design and code. */ interface StyleComparisonResult { /** Whether all styles match */ match: boolean; /** Individual property comparisons */ properties: StyleDiffItem[]; /** CSS properties from design source */ figmaStyles: NormalizedStyleMap; /** Computed CSS properties from rendered component */ renderedStyles: NormalizedStyleMap; } /** * Enhanced style comparison result with token information. */ interface EnhancedStyleComparisonResult extends StyleComparisonResult { /** Individual property comparisons with token info */ properties: EnhancedStyleDiffItem[]; /** Token usage summary */ tokenSummary?: TokenUsageSummary; } /** Default CSS properties compared by compareStyles() */ declare const DEFAULT_STYLE_PROPERTIES: readonly ["backgroundColor", "borderColor", "borderWidth", "borderRadius", "fontFamily", "fontSize", "fontWeight", "lineHeight", "letterSpacing", "textAlign", "boxShadow", "padding", "gap", "opacity"]; /** Default CSS properties compared by compareStylesWithTokens() (includes "color") */ declare const DEFAULT_ENHANCED_STYLE_PROPERTIES: readonly ["backgroundColor", "borderColor", "borderWidth", "borderRadius", "fontFamily", "fontSize", "fontWeight", "lineHeight", "letterSpacing", "textAlign", "boxShadow", "padding", "gap", "opacity", "color"]; /** * Normalize a style value for comparison. */ declare function normalizeStyleValue(prop: string, value: string): string; /** * Compare two color values with tolerance. */ declare function compareColors(color1: string, color2: string, tolerance: number, alphaTolerance?: number): boolean; /** * Compare numeric values (e.g., "10px" vs "11px") with tolerance. */ declare function compareNumericValues(value1: string, value2: string, tolerance: number): boolean; /** * Compare a single style value with tolerance for color and numeric differences. */ declare function compareStyleValue(prop: string, figma: string, rendered: string): boolean; /** * Compare design CSS properties with rendered computed styles. */ declare function compareStyles(figmaStyles: Record, renderedStyles: NormalizedStyleMap): StyleComparisonResult; /** * Compare styles with token awareness. * * This enhanced version: * 1. Performs normal style comparison * 2. Identifies which values match design tokens * 3. Flags hardcoded values that should use tokens * 4. Generates fix suggestions */ declare function compareStylesWithTokens(figmaStyles: Record, renderedStyles: NormalizedStyleMap, tokenLookup?: TokenLookup, theme?: string): EnhancedStyleComparisonResult; /** * Format token usage summary for display. */ declare function formatTokenSummary(summary: TokenUsageSummary): string; /** * Get status badge for token compliance level. */ declare function getComplianceBadge(compliancePercent: number): { label: string; color: string; }; declare const figmaPropMappingSchema: z.ZodDiscriminatedUnion<"__type", [z.ZodObject<{ __type: z.ZodLiteral<"figma-string">; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-string"; figmaProperty: string; }, { __type: "figma-string"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-boolean">; figmaProperty: z.ZodString; valueMapping: z.ZodOptional>; }, "strip", z.ZodTypeAny, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-enum">; figmaProperty: z.ZodString; valueMapping: z.ZodRecord; }, "strip", z.ZodTypeAny, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-instance">; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-instance"; figmaProperty: string; }, { __type: "figma-instance"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-children">; layers: z.ZodArray; }, "strip", z.ZodTypeAny, { __type: "figma-children"; layers: string[]; }, { __type: "figma-children"; layers: string[]; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-text-content">; layer: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-text-content"; layer: string; }, { __type: "figma-text-content"; layer: string; }>]>; declare const fragmentMetaSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; category: z.ZodString; tags: z.ZodOptional>; status: z.ZodOptional>; since: z.ZodOptional; dependencies: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; version: string; reason?: string | undefined; }, { name: string; version: string; reason?: string | undefined; }>, "many">>; figma: z.ZodOptional; figmaProps: z.ZodOptional; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-string"; figmaProperty: string; }, { __type: "figma-string"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-boolean">; figmaProperty: z.ZodString; valueMapping: z.ZodOptional>; }, "strip", z.ZodTypeAny, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-enum">; figmaProperty: z.ZodString; valueMapping: z.ZodRecord; }, "strip", z.ZodTypeAny, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-instance">; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-instance"; figmaProperty: string; }, { __type: "figma-instance"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-children">; layers: z.ZodArray; }, "strip", z.ZodTypeAny, { __type: "figma-children"; layers: string[]; }, { __type: "figma-children"; layers: string[]; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-text-content">; layer: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-text-content"; layer: string; }, { __type: "figma-text-content"; layer: string; }>]>>>; }, "strip", z.ZodTypeAny, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }>; declare const fragmentUsageSchema: z.ZodObject<{ when: z.ZodArray; whenNot: z.ZodArray; guidelines: z.ZodOptional>; accessibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }>; declare const propDefinitionSchema: z.ZodObject<{ type: z.ZodType; values: z.ZodOptional>>; default: z.ZodOptional; description: z.ZodOptional; required: z.ZodOptional; constraints: z.ZodOptional>; typeDetails: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }>; declare const componentRelationSchema: z.ZodObject<{ component: z.ZodString; relationship: z.ZodEnum<["alternative", "sibling", "parent", "child", "composition", "complementary", "used-by"]>; note: z.ZodString; }, "strip", z.ZodTypeAny, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }>; declare const fragmentVariantSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; render: z.ZodType<(...args: unknown[]) => unknown, z.ZodTypeDef, (...args: unknown[]) => unknown>; code: z.ZodOptional; figma: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }>; /** * Schema for banned patterns in codebase */ declare const fragmentBanSchema: z.ZodObject<{ pattern: z.ZodString; message: z.ZodString; }, "strip", z.ZodTypeAny, { message: string; pattern: string; }, { message: string; pattern: string; }>; /** * Schema for agent-optimized contract metadata */ declare const fragmentContractSchema: z.ZodObject<{ propsSummary: z.ZodOptional>; a11yRules: z.ZodOptional>; bans: z.ZodOptional, "many">>; scenarioTags: z.ZodOptional>; performanceBudget: z.ZodOptional; compoundChildren: z.ZodOptional; accepts: z.ZodOptional>; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }>>>; canonicalUsage: z.ZodOptional>; composition: z.ZodOptional; value: z.ZodOptional; }, "strip", z.ZodTypeAny, { component: string; value?: string | undefined; prop?: string | undefined; }, { component: string; value?: string | undefined; prop?: string | undefined; }>; }, "strip", z.ZodTypeAny, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }>, z.ZodObject<{ when: z.ZodObject<{ component: z.ZodString; prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; component: string; }, { value: string; prop: string; component: string; }>; require: z.ZodObject<{ prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; }, { value: string; prop: string; }>; }, "strip", z.ZodTypeAny, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }>]>; }, "strip", z.ZodTypeAny, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }>, "many">>; }, "strip", z.ZodTypeAny, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }>; /** * Schema for provenance tracking of generated fragments */ declare const fragmentGeneratedSchema: z.ZodObject<{ source: z.ZodEnum<["storybook", "manual", "ai"]>; sourceFile: z.ZodOptional; confidence: z.ZodOptional; timestamp: z.ZodOptional; }, "strip", z.ZodTypeAny, { source: "storybook" | "manual" | "ai"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; }, { source: "storybook" | "manual" | "ai"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; }>; /** * Schema for AI-specific metadata for playground context generation */ declare const aiMetadataSchema: z.ZodObject<{ compositionPattern: z.ZodOptional>; subComponents: z.ZodOptional>; requiredChildren: z.ZodOptional>; commonPatterns: z.ZodOptional>; }, "strip", z.ZodTypeAny, { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }, { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }>; /** * Schema for block definitions */ declare const blockDefinitionSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; category: z.ZodString; components: z.ZodArray; code: z.ZodString; tags: z.ZodOptional>; }, "strip", z.ZodTypeAny, { components: string[]; code: string; description: string; category: string; name: string; tags?: string[] | undefined; }, { components: string[]; code: string; description: string; category: string; name: string; tags?: string[] | undefined; }>; declare const fragmentDefinitionSchema: z.ZodObject<{ component: z.ZodAny; meta: z.ZodObject<{ name: z.ZodString; description: z.ZodString; category: z.ZodString; tags: z.ZodOptional>; status: z.ZodOptional>; since: z.ZodOptional; dependencies: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; version: string; reason?: string | undefined; }, { name: string; version: string; reason?: string | undefined; }>, "many">>; figma: z.ZodOptional; figmaProps: z.ZodOptional; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-string"; figmaProperty: string; }, { __type: "figma-string"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-boolean">; figmaProperty: z.ZodString; valueMapping: z.ZodOptional>; }, "strip", z.ZodTypeAny, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-enum">; figmaProperty: z.ZodString; valueMapping: z.ZodRecord; }, "strip", z.ZodTypeAny, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-instance">; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-instance"; figmaProperty: string; }, { __type: "figma-instance"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-children">; layers: z.ZodArray; }, "strip", z.ZodTypeAny, { __type: "figma-children"; layers: string[]; }, { __type: "figma-children"; layers: string[]; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-text-content">; layer: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-text-content"; layer: string; }, { __type: "figma-text-content"; layer: string; }>]>>>; }, "strip", z.ZodTypeAny, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }>; usage: z.ZodObject<{ when: z.ZodArray; whenNot: z.ZodArray; guidelines: z.ZodOptional>; accessibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }>; props: z.ZodRecord; values: z.ZodOptional>>; default: z.ZodOptional; description: z.ZodOptional; required: z.ZodOptional; constraints: z.ZodOptional>; typeDetails: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }>>; relations: z.ZodOptional; note: z.ZodString; }, "strip", z.ZodTypeAny, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }>, "many">>; variants: z.ZodArray unknown, z.ZodTypeDef, (...args: unknown[]) => unknown>; code: z.ZodOptional; figma: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }>, "many">; contract: z.ZodOptional>; a11yRules: z.ZodOptional>; bans: z.ZodOptional, "many">>; scenarioTags: z.ZodOptional>; performanceBudget: z.ZodOptional; compoundChildren: z.ZodOptional; accepts: z.ZodOptional>; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }>>>; canonicalUsage: z.ZodOptional>; composition: z.ZodOptional; value: z.ZodOptional; }, "strip", z.ZodTypeAny, { component: string; value?: string | undefined; prop?: string | undefined; }, { component: string; value?: string | undefined; prop?: string | undefined; }>; }, "strip", z.ZodTypeAny, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }>, z.ZodObject<{ when: z.ZodObject<{ component: z.ZodString; prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; component: string; }, { value: string; prop: string; component: string; }>; require: z.ZodObject<{ prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; }, { value: string; prop: string; }>; }, "strip", z.ZodTypeAny, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }>]>; }, "strip", z.ZodTypeAny, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }>, "many">>; }, "strip", z.ZodTypeAny, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }>>; ai: z.ZodOptional>; subComponents: z.ZodOptional>; requiredChildren: z.ZodOptional>; commonPatterns: z.ZodOptional>; }, "strip", z.ZodTypeAny, { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }, { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }>>; usages: z.ZodOptional; value: z.ZodOptional>; }, "strip", z.ZodTypeAny, { kind: "boolean" | "null" | "jsx" | "static" | "dynamic" | "spread"; name: string; value?: string | number | boolean | null | undefined; }, { kind: "boolean" | "null" | "jsx" | "static" | "dynamic" | "spread"; name: string; value?: string | number | boolean | null | undefined; }>, "many">; parentElement: z.ZodOptional; conditional: z.ZodOptional; }, "strip", z.ZodTypeAny, { file: string; line: number; column: number; props: { kind: "boolean" | "null" | "jsx" | "static" | "dynamic" | "spread"; name: string; value?: string | number | boolean | null | undefined; }[]; parentElement?: string | undefined; conditional?: boolean | undefined; }, { file: string; line: number; column: number; props: { kind: "boolean" | "null" | "jsx" | "static" | "dynamic" | "spread"; name: string; value?: string | number | boolean | null | undefined; }[]; parentElement?: string | undefined; conditional?: boolean | undefined; }>, "many">>; _generated: z.ZodOptional; sourceFile: z.ZodOptional; confidence: z.ZodOptional; timestamp: z.ZodOptional; }, "strip", z.ZodTypeAny, { source: "storybook" | "manual" | "ai"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; }, { source: "storybook" | "manual" | "ai"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { props: Record | undefined; }>; meta: { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }; usage: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; variants: { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }[]; contract?: { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; ai?: { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; component?: any; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; usages?: { file: string; line: number; column: number; props: { kind: "boolean" | "null" | "jsx" | "static" | "dynamic" | "spread"; name: string; value?: string | number | boolean | null | undefined; }[]; parentElement?: string | undefined; conditional?: boolean | undefined; }[] | undefined; _generated?: { source: "storybook" | "manual" | "ai"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; } | undefined; }, { props: Record | undefined; }>; meta: { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }; usage: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; variants: { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }[]; contract?: { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; ai?: { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; component?: any; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; usages?: { file: string; line: number; column: number; props: { kind: "boolean" | "null" | "jsx" | "static" | "dynamic" | "spread"; name: string; value?: string | number | boolean | null | undefined; }[]; parentElement?: string | undefined; conditional?: boolean | undefined; }[] | undefined; _generated?: { source: "storybook" | "manual" | "ai"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; } | undefined; }>; /** * Config schema - validates required fields, passes through optional config objects. * Type definitions are in types.ts - schema just ensures basic structure. */ declare const fragmentsConfigSchema: z.ZodObject<{ app: z.ZodOptional>; include: z.ZodOptional, "many">>; exclude: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { path?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; }, { path?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; }>>; designSystem: z.ZodOptional>; packageName: z.ZodOptional; components: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { components?: string[] | undefined; path?: string | undefined; packageName?: string | undefined; }, { components?: string[] | undefined; path?: string | undefined; packageName?: string | undefined; }>>; include: z.ZodOptional, "many">>; exclude: z.ZodOptional, "many">>; components: z.ZodOptional, "many">>; outFile: z.ZodOptional>; framework: z.ZodOptional>; figmaFile: z.ZodOptional; figmaToken: z.ZodOptional; screenshots: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; service: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; registry: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; tokens: z.ZodOptional, "many">>; sources: z.ZodOptional; format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }>, "many">>; exclude: z.ZodOptional, "many">>; themeSelectors: z.ZodOptional>; enabled: z.ZodOptional; format: z.ZodOptional>; namespace: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ include: z.ZodOptional, "many">>; sources: z.ZodOptional; format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }>, "many">>; exclude: z.ZodOptional, "many">>; themeSelectors: z.ZodOptional>; enabled: z.ZodOptional; format: z.ZodOptional>; namespace: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ include: z.ZodOptional, "many">>; sources: z.ZodOptional; format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }>, "many">>; exclude: z.ZodOptional, "many">>; themeSelectors: z.ZodOptional>; enabled: z.ZodOptional; format: z.ZodOptional>; namespace: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ include: z.ZodOptional, "many">>; sources: z.ZodOptional; format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }>, "many">>; exclude: z.ZodOptional, "many">>; themeSelectors: z.ZodOptional>; enabled: z.ZodOptional; format: z.ZodOptional>; namespace: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ include: z.ZodOptional, "many">>; sources: z.ZodOptional; format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }>, "many">>; exclude: z.ZodOptional, "many">>; themeSelectors: z.ZodOptional>; enabled: z.ZodOptional; format: z.ZodOptional>; namespace: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>>; snippets: z.ZodOptional>; scope: z.ZodOptional>; requireFullSnippet: z.ZodOptional; allowedExternalModules: z.ZodOptional>; }, "strip", z.ZodTypeAny, { scope?: "snippet" | "snippet+render" | undefined; mode?: "error" | "warn" | undefined; requireFullSnippet?: boolean | undefined; allowedExternalModules?: string[] | undefined; }, { scope?: "snippet" | "snippet+render" | undefined; mode?: "error" | "warn" | undefined; requireFullSnippet?: boolean | undefined; allowedExternalModules?: string[] | undefined; }>>; performance: z.ZodOptional, z.ZodObject<{ preset: z.ZodOptional>; budgets: z.ZodOptional; }, "strip", z.ZodTypeAny, { bundleSize?: number | undefined; }, { bundleSize?: number | undefined; }>>; }, "strip", z.ZodTypeAny, { preset?: "strict" | "relaxed" | "standard" | undefined; budgets?: { bundleSize?: number | undefined; } | undefined; }, { preset?: "strict" | "relaxed" | "standard" | undefined; budgets?: { bundleSize?: number | undefined; } | undefined; }>]>>; storybook: z.ZodOptional>; include: z.ZodOptional>; excludeDeprecated: z.ZodOptional; excludeTests: z.ZodOptional; excludeSvgIcons: z.ZodOptional; excludeSubComponents: z.ZodOptional; }, "strip", z.ZodTypeAny, { include?: string[] | undefined; exclude?: string[] | undefined; excludeDeprecated?: boolean | undefined; excludeTests?: boolean | undefined; excludeSvgIcons?: boolean | undefined; excludeSubComponents?: boolean | undefined; }, { include?: string[] | undefined; exclude?: string[] | undefined; excludeDeprecated?: boolean | undefined; excludeTests?: boolean | undefined; excludeSvgIcons?: boolean | undefined; excludeSubComponents?: boolean | undefined; }>>; topology: z.ZodOptional>; areas: z.ZodArray; owners: z.ZodArray; files: z.ZodArray, "many">; routes: z.ZodOptional>; priority: z.ZodOptional; }, "strip", z.ZodTypeAny, { criticality: "high" | "medium" | "low" | "revenue" | "regulated"; owners: string[]; name: string; id: string; files: string[]; routes?: string[] | undefined; priority?: number | undefined; }, { criticality: "high" | "medium" | "low" | "revenue" | "regulated"; owners: string[]; name: string; id: string; files: string[]; routes?: string[] | undefined; priority?: number | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { version: number; areas: { criticality: "high" | "medium" | "low" | "revenue" | "regulated"; owners: string[]; name: string; id: string; files: string[]; routes?: string[] | undefined; priority?: number | undefined; }[]; base?: "app" | "repo" | undefined; }, { version: number; areas: { criticality: "high" | "medium" | "low" | "revenue" | "regulated"; owners: string[]; name: string; id: string; files: string[]; routes?: string[] | undefined; priority?: number | undefined; }[]; base?: "app" | "repo" | undefined; }>>; govern: z.ZodOptional>; severity: z.ZodOptional>; rules: z.ZodOptional>; agents: z.ZodOptional>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ rules: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ rules: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">>>>; audit: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; runners: z.ZodOptional, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>; canonicalSources: z.ZodOptional; specifier: z.ZodString; implementationPath: z.ZodOptional; include: z.ZodOptional>; exclude: z.ZodOptional>; }, "strip", z.ZodTypeAny, { kind: "npm"; specifier: string; implementationPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; }, { kind: "npm"; specifier: string; implementationPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"directory">; path: z.ZodString; include: z.ZodOptional>; exclude: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; kind: "directory"; include?: string[] | undefined; exclude?: string[] | undefined; }, { path: string; kind: "directory"; include?: string[] | undefined; exclude?: string[] | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"registry">; registryId: z.ZodString; registryHash: z.ZodOptional; receiptPath: z.ZodDefault>; installPath: z.ZodEffects; importPath: z.ZodOptional; include: z.ZodOptional>; exclude: z.ZodOptional>; severity: z.ZodOptional>; }, "strip", z.ZodTypeAny, { kind: "registry"; registryId: string; receiptPath: string; installPath: string; severity?: "error" | "info" | "warn" | undefined; importPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registryHash?: string | undefined; }, { kind: "registry"; registryId: string; installPath: string; severity?: "error" | "info" | "warn" | undefined; importPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registryHash?: string | undefined; receiptPath?: string | undefined; }>]>, "many">>; presets: z.ZodOptional>; scales: z.ZodOptional>; name: z.ZodOptional; unit: z.ZodEnum<["px", "rem"]>; values: z.ZodArray; rootFontSizePx: z.ZodOptional; emBasePx: z.ZodOptional; }, "strip", z.ZodTypeAny, { values: number[]; kind: "scale"; unit: "px" | "rem"; name?: string | undefined; rootFontSizePx?: number | undefined; emBasePx?: number | undefined; }, { values: number[]; unit: "px" | "rem"; kind?: "scale" | undefined; name?: string | undefined; rootFontSizePx?: number | undefined; emBasePx?: number | undefined; }>>>; styles: z.ZodOptional; except: z.ZodArray; prefer: z.ZodEnum<["token", "css-variable"]>; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "style.rawColors.forbid"; severity: "error" | "info" | "warn"; except: string[]; prefer: "token" | "css-variable"; }, { kind: "style.rawColors.forbid"; severity: "error" | "info" | "warn"; except: string[]; prefer: "token" | "css-variable"; }>, z.ZodObject<{ kind: z.ZodLiteral<"style.rawDimensions.forbid">; appliesTo: z.ZodArray; prefer: z.ZodEnum<["token", "css-variable"]>; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "style.rawDimensions.forbid"; severity: "error" | "info" | "warn"; prefer: "token" | "css-variable"; appliesTo: string[]; }, { kind: "style.rawDimensions.forbid"; severity: "error" | "info" | "warn"; prefer: "token" | "css-variable"; appliesTo: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"style.rawSpacing.mustMatchScale">; scale: z.ZodString; appliesTo: z.ZodArray; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "style.rawSpacing.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; appliesTo: string[]; }, { kind: "style.rawSpacing.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; appliesTo: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"style.fontSize.mustMatchScale">; scale: z.ZodString; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "style.fontSize.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; }, { kind: "style.fontSize.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"style.cssVars.mustBeDefined">; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "style.cssVars.mustBeDefined"; severity: "error" | "info" | "warn"; }, { kind: "style.cssVars.mustBeDefined"; severity: "error" | "info" | "warn"; }>]>, "many">>; jsx: z.ZodOptional; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "jsx.unknownProps.forbid"; severity: "error" | "info" | "warn"; }, { kind: "jsx.unknownProps.forbid"; severity: "error" | "info" | "warn"; }>, z.ZodObject<{ kind: z.ZodLiteral<"jsx.inlineStyle.forbidRaw">; properties: z.ZodArray; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "jsx.inlineStyle.forbidRaw"; severity: "error" | "info" | "warn"; properties: string[]; }, { kind: "jsx.inlineStyle.forbidRaw"; severity: "error" | "info" | "warn"; properties: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"jsx.importPath.prefer">; from: z.ZodString; to: z.ZodString; imported: z.ZodOptional; because: z.ZodOptional; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "jsx.importPath.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; imported?: string | undefined; because?: string | undefined; }, { kind: "jsx.importPath.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; imported?: string | undefined; because?: string | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"jsx.component.prefer">; from: z.ZodString; to: z.ZodString; because: z.ZodOptional; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "jsx.component.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; because?: string | undefined; }, { kind: "jsx.component.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; because?: string | undefined; }>]>, "many">>; tailwind: z.ZodOptional>; deny: z.ZodOptional>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; }>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ palette: z.ZodOptional>; deny: z.ZodOptional>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; }>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ palette: z.ZodOptional>; deny: z.ZodOptional>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; }>>; }, z.ZodTypeAny, "passthrough">>>; agent: z.ZodOptional>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ repairOrder: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ repairOrder: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">>>; components: z.ZodOptional; capability: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "capability"; capability: string; }, { kind: "capability"; capability: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"prop.value.avoid">; prop: z.ZodString; value: z.ZodUnknown; because: z.ZodString; suggest: z.ZodOptional; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; }, { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"prop.value.forbid">; prop: z.ZodString; value: z.ZodUnknown; when: z.ZodOptional; }, "strip", z.ZodTypeAny, { path?: string | undefined; }, { path?: string | undefined; }>>; because: z.ZodString; fix: z.ZodOptional>; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; }, { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"a11y.requireName">; because: z.ZodString; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; }, { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; }>]>, "many">; status: z.ZodOptional>; }, "strict", z.ZodTypeAny, { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; status?: "active" | "draft" | "disabled" | undefined; }, { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; status?: "active" | "draft" | "disabled" | undefined; }>>>; overrides: z.ZodOptional; componentId: z.ZodOptional; publicRef: z.ZodOptional; importPath: z.ZodOptional; sourcePath: z.ZodOptional; path: z.ZodOptional; exportName: z.ZodOptional; export: z.ZodOptional; name: z.ZodOptional; scope: z.ZodOptional>; }, "strict", z.ZodTypeAny, { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }, { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }>; rules: z.ZodArray; capability: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "capability"; capability: string; }, { kind: "capability"; capability: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"prop.value.avoid">; prop: z.ZodString; value: z.ZodUnknown; because: z.ZodString; suggest: z.ZodOptional; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; }, { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"prop.value.forbid">; prop: z.ZodString; value: z.ZodUnknown; when: z.ZodOptional; }, "strip", z.ZodTypeAny, { path?: string | undefined; }, { path?: string | undefined; }>>; because: z.ZodString; fix: z.ZodOptional>; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; }, { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"a11y.requireName">; because: z.ZodString; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; }, { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; }>]>, "many">; status: z.ZodOptional>; }, "strict", z.ZodTypeAny, { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; match: { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }; status?: "active" | "draft" | "disabled" | undefined; }, { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; match: { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }; status?: "active" | "draft" | "disabled" | undefined; }>, "many">>; ci: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ failOnWarnings: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ failOnWarnings: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>>; }, "strict", z.ZodTypeAny, { components?: Record | undefined; severity?: "error" | "info" | "warn" | undefined; rules?: Record | undefined; scales?: Record | undefined; styles?: ({ kind: "style.rawColors.forbid"; severity: "error" | "info" | "warn"; except: string[]; prefer: "token" | "css-variable"; } | { kind: "style.rawDimensions.forbid"; severity: "error" | "info" | "warn"; prefer: "token" | "css-variable"; appliesTo: string[]; } | { kind: "style.rawSpacing.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; appliesTo: string[]; } | { kind: "style.fontSize.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; } | { kind: "style.cssVars.mustBeDefined"; severity: "error" | "info" | "warn"; })[] | undefined; jsx?: ({ kind: "jsx.unknownProps.forbid"; severity: "error" | "info" | "warn"; } | { kind: "jsx.inlineStyle.forbidRaw"; severity: "error" | "info" | "warn"; properties: string[]; } | { kind: "jsx.importPath.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; imported?: string | undefined; because?: string | undefined; } | { kind: "jsx.component.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; because?: string | undefined; })[] | undefined; tailwind?: z.objectOutputType<{ palette: z.ZodOptional>; deny: z.ZodOptional>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; }>>; }, z.ZodTypeAny, "passthrough"> | undefined; overrides?: { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; match: { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }; status?: "active" | "draft" | "disabled" | undefined; }[] | undefined; extends?: string[] | undefined; agents?: Record>; }, z.ZodTypeAny, "passthrough">> | undefined; audit?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; runners?: Record> | undefined; canonicalSources?: ({ kind: "npm"; specifier: string; implementationPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; } | { path: string; kind: "directory"; include?: string[] | undefined; exclude?: string[] | undefined; } | { kind: "registry"; registryId: string; receiptPath: string; installPath: string; severity?: "error" | "info" | "warn" | undefined; importPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registryHash?: string | undefined; })[] | undefined; presets?: string[] | undefined; agent?: z.objectOutputType<{ repairOrder: z.ZodOptional>; }, z.ZodTypeAny, "passthrough"> | undefined; ci?: z.objectOutputType<{ failOnWarnings: z.ZodOptional; }, z.ZodTypeAny, "passthrough"> | undefined; }, { components?: Record | undefined; severity?: "error" | "info" | "warn" | undefined; rules?: Record | undefined; scales?: Record | undefined; styles?: ({ kind: "style.rawColors.forbid"; severity: "error" | "info" | "warn"; except: string[]; prefer: "token" | "css-variable"; } | { kind: "style.rawDimensions.forbid"; severity: "error" | "info" | "warn"; prefer: "token" | "css-variable"; appliesTo: string[]; } | { kind: "style.rawSpacing.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; appliesTo: string[]; } | { kind: "style.fontSize.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; } | { kind: "style.cssVars.mustBeDefined"; severity: "error" | "info" | "warn"; })[] | undefined; jsx?: ({ kind: "jsx.unknownProps.forbid"; severity: "error" | "info" | "warn"; } | { kind: "jsx.inlineStyle.forbidRaw"; severity: "error" | "info" | "warn"; properties: string[]; } | { kind: "jsx.importPath.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; imported?: string | undefined; because?: string | undefined; } | { kind: "jsx.component.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; because?: string | undefined; })[] | undefined; tailwind?: z.objectInputType<{ palette: z.ZodOptional>; deny: z.ZodOptional>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; }>>; }, z.ZodTypeAny, "passthrough"> | undefined; overrides?: { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; match: { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }; status?: "active" | "draft" | "disabled" | undefined; }[] | undefined; extends?: string[] | undefined; agents?: Record>; }, z.ZodTypeAny, "passthrough">> | undefined; audit?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; runners?: Record> | undefined; canonicalSources?: ({ kind: "npm"; specifier: string; implementationPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; } | { path: string; kind: "directory"; include?: string[] | undefined; exclude?: string[] | undefined; } | { kind: "registry"; registryId: string; installPath: string; severity?: "error" | "info" | "warn" | undefined; importPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registryHash?: string | undefined; receiptPath?: string | undefined; })[] | undefined; presets?: string[] | undefined; agent?: z.objectInputType<{ repairOrder: z.ZodOptional>; }, z.ZodTypeAny, "passthrough"> | undefined; ci?: z.objectInputType<{ failOnWarnings: z.ZodOptional; }, z.ZodTypeAny, "passthrough"> | undefined; }>>; inspect: z.ZodOptional; inputType: z.ZodOptional; }, "strip", z.ZodTypeAny, { tag: string; role?: string | undefined; inputType?: string | undefined; }, { tag: string; role?: string | undefined; inputType?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { importPath: string; resolves: { tag: string; role?: string | undefined; inputType?: string | undefined; }[]; }, { importPath: string; resolves: { tag: string; role?: string | undefined; inputType?: string | undefined; }[]; }>>>; }, "strip", z.ZodTypeAny, { localCanonical?: Record | undefined; }, { localCanonical?: Record | undefined; }>>; recognizedClassHelpers: z.ZodOptional>; }, "strip", z.ZodTypeAny, { components?: string[] | undefined; screenshots?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; tokens?: z.objectOutputType<{ include: z.ZodOptional, "many">>; sources: z.ZodOptional; format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }>, "many">>; exclude: z.ZodOptional, "many">>; themeSelectors: z.ZodOptional>; enabled: z.ZodOptional; format: z.ZodOptional>; namespace: z.ZodOptional; }, z.ZodTypeAny, "passthrough"> | undefined; performance?: "strict" | "relaxed" | "standard" | { preset?: "strict" | "relaxed" | "standard" | undefined; budgets?: { bundleSize?: number | undefined; } | undefined; } | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registry?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; app?: { path?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; } | undefined; storybook?: { include?: string[] | undefined; exclude?: string[] | undefined; excludeDeprecated?: boolean | undefined; excludeTests?: boolean | undefined; excludeSvgIcons?: boolean | undefined; excludeSubComponents?: boolean | undefined; } | undefined; designSystem?: { components?: string[] | undefined; path?: string | undefined; packageName?: string | undefined; } | undefined; outFile?: string | undefined; framework?: "react" | "vue" | "svelte" | undefined; figmaFile?: string | undefined; figmaToken?: string | undefined; service?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; snippets?: { scope?: "snippet" | "snippet+render" | undefined; mode?: "error" | "warn" | undefined; requireFullSnippet?: boolean | undefined; allowedExternalModules?: string[] | undefined; } | undefined; topology?: { version: number; areas: { criticality: "high" | "medium" | "low" | "revenue" | "regulated"; owners: string[]; name: string; id: string; files: string[]; routes?: string[] | undefined; priority?: number | undefined; }[]; base?: "app" | "repo" | undefined; } | undefined; govern?: { components?: Record | undefined; severity?: "error" | "info" | "warn" | undefined; rules?: Record | undefined; scales?: Record | undefined; styles?: ({ kind: "style.rawColors.forbid"; severity: "error" | "info" | "warn"; except: string[]; prefer: "token" | "css-variable"; } | { kind: "style.rawDimensions.forbid"; severity: "error" | "info" | "warn"; prefer: "token" | "css-variable"; appliesTo: string[]; } | { kind: "style.rawSpacing.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; appliesTo: string[]; } | { kind: "style.fontSize.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; } | { kind: "style.cssVars.mustBeDefined"; severity: "error" | "info" | "warn"; })[] | undefined; jsx?: ({ kind: "jsx.unknownProps.forbid"; severity: "error" | "info" | "warn"; } | { kind: "jsx.inlineStyle.forbidRaw"; severity: "error" | "info" | "warn"; properties: string[]; } | { kind: "jsx.importPath.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; imported?: string | undefined; because?: string | undefined; } | { kind: "jsx.component.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; because?: string | undefined; })[] | undefined; tailwind?: z.objectOutputType<{ palette: z.ZodOptional>; deny: z.ZodOptional>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; }>>; }, z.ZodTypeAny, "passthrough"> | undefined; overrides?: { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; match: { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }; status?: "active" | "draft" | "disabled" | undefined; }[] | undefined; extends?: string[] | undefined; agents?: Record>; }, z.ZodTypeAny, "passthrough">> | undefined; audit?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; runners?: Record> | undefined; canonicalSources?: ({ kind: "npm"; specifier: string; implementationPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; } | { path: string; kind: "directory"; include?: string[] | undefined; exclude?: string[] | undefined; } | { kind: "registry"; registryId: string; receiptPath: string; installPath: string; severity?: "error" | "info" | "warn" | undefined; importPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registryHash?: string | undefined; })[] | undefined; presets?: string[] | undefined; agent?: z.objectOutputType<{ repairOrder: z.ZodOptional>; }, z.ZodTypeAny, "passthrough"> | undefined; ci?: z.objectOutputType<{ failOnWarnings: z.ZodOptional; }, z.ZodTypeAny, "passthrough"> | undefined; } | undefined; inspect?: { localCanonical?: Record | undefined; } | undefined; recognizedClassHelpers?: string[] | undefined; }, { components?: string[] | undefined; screenshots?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; tokens?: z.objectInputType<{ include: z.ZodOptional, "many">>; sources: z.ZodOptional; format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }, { path: string; format?: "tailwind" | "auto" | "css" | "scss" | "dtcg" | undefined; }>, "many">>; exclude: z.ZodOptional, "many">>; themeSelectors: z.ZodOptional>; enabled: z.ZodOptional; format: z.ZodOptional>; namespace: z.ZodOptional; }, z.ZodTypeAny, "passthrough"> | undefined; performance?: "strict" | "relaxed" | "standard" | { preset?: "strict" | "relaxed" | "standard" | undefined; budgets?: { bundleSize?: number | undefined; } | undefined; } | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registry?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; app?: { path?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; } | undefined; storybook?: { include?: string[] | undefined; exclude?: string[] | undefined; excludeDeprecated?: boolean | undefined; excludeTests?: boolean | undefined; excludeSvgIcons?: boolean | undefined; excludeSubComponents?: boolean | undefined; } | undefined; designSystem?: { components?: string[] | undefined; path?: string | undefined; packageName?: string | undefined; } | undefined; outFile?: string | undefined; framework?: "react" | "vue" | "svelte" | undefined; figmaFile?: string | undefined; figmaToken?: string | undefined; service?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; snippets?: { scope?: "snippet" | "snippet+render" | undefined; mode?: "error" | "warn" | undefined; requireFullSnippet?: boolean | undefined; allowedExternalModules?: string[] | undefined; } | undefined; topology?: { version: number; areas: { criticality: "high" | "medium" | "low" | "revenue" | "regulated"; owners: string[]; name: string; id: string; files: string[]; routes?: string[] | undefined; priority?: number | undefined; }[]; base?: "app" | "repo" | undefined; } | undefined; govern?: { components?: Record | undefined; severity?: "error" | "info" | "warn" | undefined; rules?: Record | undefined; scales?: Record | undefined; styles?: ({ kind: "style.rawColors.forbid"; severity: "error" | "info" | "warn"; except: string[]; prefer: "token" | "css-variable"; } | { kind: "style.rawDimensions.forbid"; severity: "error" | "info" | "warn"; prefer: "token" | "css-variable"; appliesTo: string[]; } | { kind: "style.rawSpacing.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; appliesTo: string[]; } | { kind: "style.fontSize.mustMatchScale"; severity: "error" | "info" | "warn"; scale: string; } | { kind: "style.cssVars.mustBeDefined"; severity: "error" | "info" | "warn"; })[] | undefined; jsx?: ({ kind: "jsx.unknownProps.forbid"; severity: "error" | "info" | "warn"; } | { kind: "jsx.inlineStyle.forbidRaw"; severity: "error" | "info" | "warn"; properties: string[]; } | { kind: "jsx.importPath.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; imported?: string | undefined; because?: string | undefined; } | { kind: "jsx.component.prefer"; from: string; to: string; severity: "error" | "info" | "warn"; because?: string | undefined; })[] | undefined; tailwind?: z.objectInputType<{ palette: z.ZodOptional>; deny: z.ZodOptional>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; }>>; }, z.ZodTypeAny, "passthrough"> | undefined; overrides?: { rules: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[]; match: { path?: string | undefined; scope?: "one" | "all" | undefined; name?: string | undefined; componentKey?: string | undefined; componentId?: string | undefined; publicRef?: string | undefined; importPath?: string | undefined; sourcePath?: string | undefined; exportName?: string | undefined; export?: string | undefined; }; status?: "active" | "draft" | "disabled" | undefined; }[] | undefined; extends?: string[] | undefined; agents?: Record>; }, z.ZodTypeAny, "passthrough">> | undefined; audit?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; runners?: Record> | undefined; canonicalSources?: ({ kind: "npm"; specifier: string; implementationPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; } | { path: string; kind: "directory"; include?: string[] | undefined; exclude?: string[] | undefined; } | { kind: "registry"; registryId: string; installPath: string; severity?: "error" | "info" | "warn" | undefined; importPath?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; registryHash?: string | undefined; receiptPath?: string | undefined; })[] | undefined; presets?: string[] | undefined; agent?: z.objectInputType<{ repairOrder: z.ZodOptional>; }, z.ZodTypeAny, "passthrough"> | undefined; ci?: z.objectInputType<{ failOnWarnings: z.ZodOptional; }, z.ZodTypeAny, "passthrough"> | undefined; } | undefined; inspect?: { localCanonical?: Record | undefined; } | undefined; recognizedClassHelpers?: string[] | undefined; }>; /** * Schema for v2 composition metadata (promoted from ai) * Uses shorter field names since parent field is `composition`. */ declare const compositionMetadataSchema: z.ZodObject<{ pattern: z.ZodOptional>; subComponents: z.ZodOptional>; requiredChildren: z.ZodOptional>; commonPatterns: z.ZodOptional>; }, "strip", z.ZodTypeAny, { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }, { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }>; /** * Schema for v2 extended provenance tracking */ declare const fragmentProvenanceSchema: z.ZodObject<{ source: z.ZodEnum<["storybook", "manual", "ai", "scan"]>; sourceFile: z.ZodOptional; confidence: z.ZodOptional; timestamp: z.ZodOptional; autoFields: z.ZodOptional>; humanFields: z.ZodOptional>; }, "strip", z.ZodTypeAny, { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; }, { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; }>; /** * Schema for v2 fragment definitions. * Accepts the v2 field names (guidance, examples, composition, _provenance). */ declare const fragmentDefinitionV2Schema: z.ZodObject<{ component: z.ZodAny; meta: z.ZodObject<{ name: z.ZodString; description: z.ZodString; category: z.ZodString; tags: z.ZodOptional>; status: z.ZodOptional>; since: z.ZodOptional; dependencies: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; version: string; reason?: string | undefined; }, { name: string; version: string; reason?: string | undefined; }>, "many">>; figma: z.ZodOptional; figmaProps: z.ZodOptional; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-string"; figmaProperty: string; }, { __type: "figma-string"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-boolean">; figmaProperty: z.ZodString; valueMapping: z.ZodOptional>; }, "strip", z.ZodTypeAny, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-enum">; figmaProperty: z.ZodString; valueMapping: z.ZodRecord; }, "strip", z.ZodTypeAny, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-instance">; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-instance"; figmaProperty: string; }, { __type: "figma-instance"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-children">; layers: z.ZodArray; }, "strip", z.ZodTypeAny, { __type: "figma-children"; layers: string[]; }, { __type: "figma-children"; layers: string[]; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-text-content">; layer: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-text-content"; layer: string; }, { __type: "figma-text-content"; layer: string; }>]>>>; }, "strip", z.ZodTypeAny, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }>; guidance: z.ZodObject<{ when: z.ZodArray; whenNot: z.ZodArray; guidelines: z.ZodOptional>; accessibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }>; props: z.ZodRecord; values: z.ZodOptional>>; default: z.ZodOptional; description: z.ZodOptional; required: z.ZodOptional; constraints: z.ZodOptional>; typeDetails: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }>>; relations: z.ZodOptional; note: z.ZodString; }, "strip", z.ZodTypeAny, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }>, "many">>; examples: z.ZodArray unknown, z.ZodTypeDef, (...args: unknown[]) => unknown>; code: z.ZodOptional; figma: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }>, "many">; composition: z.ZodOptional>; subComponents: z.ZodOptional>; requiredChildren: z.ZodOptional>; commonPatterns: z.ZodOptional>; }, "strip", z.ZodTypeAny, { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }, { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }>>; contract: z.ZodOptional>; a11yRules: z.ZodOptional>; bans: z.ZodOptional, "many">>; scenarioTags: z.ZodOptional>; performanceBudget: z.ZodOptional; compoundChildren: z.ZodOptional; accepts: z.ZodOptional>; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }>>>; canonicalUsage: z.ZodOptional>; composition: z.ZodOptional; value: z.ZodOptional; }, "strip", z.ZodTypeAny, { component: string; value?: string | undefined; prop?: string | undefined; }, { component: string; value?: string | undefined; prop?: string | undefined; }>; }, "strip", z.ZodTypeAny, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }>, z.ZodObject<{ when: z.ZodObject<{ component: z.ZodString; prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; component: string; }, { value: string; prop: string; component: string; }>; require: z.ZodObject<{ prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; }, { value: string; prop: string; }>; }, "strip", z.ZodTypeAny, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }>]>; }, "strip", z.ZodTypeAny, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }>, "many">>; }, "strip", z.ZodTypeAny, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }>>; _provenance: z.ZodOptional; sourceFile: z.ZodOptional; confidence: z.ZodOptional; timestamp: z.ZodOptional; autoFields: z.ZodOptional>; humanFields: z.ZodOptional>; }, "strip", z.ZodTypeAny, { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; }, { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { props: Record | undefined; }>; meta: { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }; examples: { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }[]; guidance: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; composition?: { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; contract?: { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; component?: any; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; _provenance?: { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; } | undefined; }, { props: Record | undefined; }>; meta: { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }; examples: { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }[]; guidance: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; composition?: { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; contract?: { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; component?: any; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; _provenance?: { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; } | undefined; }>; declare const governedFragmentDefinitionSchema: z.ZodObject<{ component: z.ZodAny; meta: z.ZodObject<{ name: z.ZodString; description: z.ZodString; category: z.ZodString; tags: z.ZodOptional>; status: z.ZodOptional>; since: z.ZodOptional; dependencies: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; version: string; reason?: string | undefined; }, { name: string; version: string; reason?: string | undefined; }>, "many">>; figma: z.ZodOptional; figmaProps: z.ZodOptional; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-string"; figmaProperty: string; }, { __type: "figma-string"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-boolean">; figmaProperty: z.ZodString; valueMapping: z.ZodOptional>; }, "strip", z.ZodTypeAny, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }, { __type: "figma-boolean"; figmaProperty: string; valueMapping?: { true?: unknown; false?: unknown; } | undefined; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-enum">; figmaProperty: z.ZodString; valueMapping: z.ZodRecord; }, "strip", z.ZodTypeAny, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }, { __type: "figma-enum"; figmaProperty: string; valueMapping: Record; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-instance">; figmaProperty: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-instance"; figmaProperty: string; }, { __type: "figma-instance"; figmaProperty: string; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-children">; layers: z.ZodArray; }, "strip", z.ZodTypeAny, { __type: "figma-children"; layers: string[]; }, { __type: "figma-children"; layers: string[]; }>, z.ZodObject<{ __type: z.ZodLiteral<"figma-text-content">; layer: z.ZodString; }, "strip", z.ZodTypeAny, { __type: "figma-text-content"; layer: string; }, { __type: "figma-text-content"; layer: string; }>]>>>; }, "strip", z.ZodTypeAny, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }, { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }>; guidance: z.ZodObject<{ when: z.ZodArray; whenNot: z.ZodArray; guidelines: z.ZodOptional>; accessibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }>; props: z.ZodOptional; values: z.ZodOptional>>; default: z.ZodOptional; description: z.ZodOptional; required: z.ZodOptional; constraints: z.ZodOptional>; typeDetails: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }, { type: string; values?: readonly string[] | undefined; description?: string | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; typeDetails?: Record | undefined; }>>>; relations: z.ZodOptional; note: z.ZodString; }, "strip", z.ZodTypeAny, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }>, "many">>; examples: z.ZodOptional unknown, z.ZodTypeDef, (...args: unknown[]) => unknown>; code: z.ZodOptional; figma: z.ZodOptional; }, "strip", z.ZodTypeAny, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }, { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }>, "many">>; composition: z.ZodOptional>; subComponents: z.ZodOptional>; requiredChildren: z.ZodOptional>; commonPatterns: z.ZodOptional>; }, "strip", z.ZodTypeAny, { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }, { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }>>; contract: z.ZodOptional>; a11yRules: z.ZodOptional>; bans: z.ZodOptional, "many">>; scenarioTags: z.ZodOptional>; performanceBudget: z.ZodOptional; compoundChildren: z.ZodOptional; accepts: z.ZodOptional>; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }>>>; canonicalUsage: z.ZodOptional>; composition: z.ZodOptional; value: z.ZodOptional; }, "strip", z.ZodTypeAny, { component: string; value?: string | undefined; prop?: string | undefined; }, { component: string; value?: string | undefined; prop?: string | undefined; }>; }, "strip", z.ZodTypeAny, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }>, z.ZodObject<{ when: z.ZodObject<{ component: z.ZodString; prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; component: string; }, { value: string; prop: string; component: string; }>; require: z.ZodObject<{ prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; }, { value: string; prop: string; }>; }, "strip", z.ZodTypeAny, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }>]>; }, "strip", z.ZodTypeAny, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }>, "many">>; }, "strip", z.ZodTypeAny, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }, { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }>>; _provenance: z.ZodOptional; sourceFile: z.ZodOptional; confidence: z.ZodOptional; timestamp: z.ZodOptional; autoFields: z.ZodOptional>; humanFields: z.ZodOptional>; }, "strip", z.ZodTypeAny, { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; }, { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; }>>; govern: z.ZodOptional, z.ZodUnknown>>; governance: z.ZodOptional; capability: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "capability"; capability: string; }, { kind: "capability"; capability: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"prop.value.avoid">; prop: z.ZodString; value: z.ZodUnknown; because: z.ZodString; suggest: z.ZodOptional; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; }, { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"prop.value.forbid">; prop: z.ZodString; value: z.ZodUnknown; when: z.ZodOptional; }, "strip", z.ZodTypeAny, { path?: string | undefined; }, { path?: string | undefined; }>>; because: z.ZodString; fix: z.ZodOptional>; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; }, { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"a11y.requireName">; because: z.ZodString; severity: z.ZodEnum<["error", "warn", "info"]>; }, "strip", z.ZodTypeAny, { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; }, { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; }>]>, "many">>; }, "strip", z.ZodTypeAny, { meta: { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }; guidance: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; composition?: { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; props?: Record | undefined; }> | undefined; contract?: { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; govern?: ((...args: unknown[]) => unknown) | undefined; component?: any; governance?: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[] | undefined; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; examples?: { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }[] | undefined; _provenance?: { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; } | undefined; }, { meta: { description: string; category: string; name: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; dependencies?: { name: string; version: string; reason?: string | undefined; }[] | undefined; tags?: string[] | undefined; figma?: string | undefined; since?: string | undefined; figmaProps?: Record; } | { __type: "figma-instance"; figmaProperty: string; } | { __type: "figma-children"; layers: string[]; } | { __type: "figma-text-content"; layer: string; }> | undefined; }; guidance: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; composition?: { pattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; props?: Record | undefined; }> | undefined; contract?: { composition?: { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }[] | undefined; compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; govern?: ((...args: unknown[]) => unknown) | undefined; component?: any; governance?: ({ kind: "capability"; capability: string; } | { kind: "prop.value.avoid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; suggest?: string | undefined; } | { kind: "prop.value.forbid"; prop: string; severity: "error" | "info" | "warn"; because: string; value?: unknown; fix?: { replaceWith?: unknown; } | undefined; when?: { path?: string | undefined; } | undefined; } | { kind: "a11y.requireName"; severity: "error" | "info" | "warn"; because: string; })[] | undefined; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; examples?: { description: string; name: string; render: (...args: unknown[]) => unknown; code?: string | undefined; figma?: string | undefined; }[] | undefined; _provenance?: { source: "storybook" | "manual" | "ai" | "scan"; confidence?: number | undefined; sourceFile?: string | undefined; timestamp?: string | undefined; autoFields?: string[] | undefined; humanFields?: string[] | undefined; } | undefined; }>; /** * @deprecated Use blockDefinitionSchema instead */ declare const recipeDefinitionSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; category: z.ZodString; components: z.ZodArray; code: z.ZodString; tags: z.ZodOptional>; }, "strip", z.ZodTypeAny, { components: string[]; code: string; description: string; category: string; name: string; tags?: string[] | undefined; }, { components: string[]; code: string; description: string; category: string; name: string; tags?: string[] | undefined; }>; declare function defineConfig(config: TConfig): TConfig; /** * Normalize a v2 definition to v1 shape for downstream compatibility. * The build pipeline, compiler, and validators all work with v1 internally. */ declare function normalizeToV1(def: FragmentDefinitionV2): FragmentDefinition; /** * Define a fragment for a component. * * This is the main API for creating fragment documentation. * It provides runtime validation and type safety. * * Accepts both v1 and v2 shapes: * - v1: `{ usage, variants, ai, _generated }` * - v2: `{ guidance, examples, composition, _provenance }` * * @example v1 * ```tsx * import { defineFragment } from '@fragments-sdk/core'; * import { Button } from './Button'; * * export default defineFragment({ * component: Button, * meta: { * name: 'Button', * description: 'Primary action trigger', * category: 'actions', * }, * usage: { * when: ['User needs to trigger an action'], * whenNot: ['Navigation without side effects'], * }, * props: { * variant: { * type: 'enum', * values: ['primary', 'secondary'], * default: 'primary', * description: 'Visual style', * }, * }, * variants: [ * { * name: 'Default', * description: 'Default button', * render: () => , * }, * ], * }); * ``` * * @example v2 * ```tsx * import { defineFragment } from '@fragments-sdk/core'; * import { Card } from './Card'; * * export default defineFragment({ * component: Card, * meta: { name: 'Card', description: 'Content container', category: 'layout' }, * guidance: { * when: ['Grouping related content'], * whenNot: ['Full-page layouts'], * }, * props: { ... }, * examples: [{ name: 'Default', description: 'Basic card', render: () => ... }], * composition: { pattern: 'compound', subComponents: ['Header', 'Body', 'Footer'] }, * }); * ``` */ declare function defineFragment(definition: GovernedFragmentDefinition): ResolvedGovernedFragmentDefinition; declare function defineFragment(definition: FragmentDefinition): FragmentDefinition; declare function defineFragment(definition: FragmentDefinitionV2): FragmentDefinitionV2; /** * Compile a fragment definition to JSON-serializable format. * Used for generating fragments.json for AI consumption. * * Accepts both v1 and v2 shapes. V2 is normalized to v1 internally. */ declare function compileFragment(definition: FragmentDefinition | FragmentDefinitionV2 | GovernedFragmentDefinition, filePath: string): CompiledFragment; /** * Define a composition block. * * Blocks are pure data describing how design system components * wire together for common use cases. */ declare function defineBlock(definition: BlockDefinition): BlockDefinition; /** * @deprecated Use defineBlock instead */ declare const defineRecipe: typeof defineBlock; /** * Compile a block definition to JSON-serializable format. */ declare function compileBlock(definition: BlockDefinition, filePath: string): CompiledBlock; /** * @deprecated Use compileBlock instead */ declare const compileRecipe: typeof compileBlock; /** * Type helper for extracting props type from a component */ type InferProps = T extends FragmentComponent ? P : never; declare const toId: typeof toId$1; declare const storyNameFromExport: typeof storyNameFromExport$1; declare const isExportStory: typeof isExportStory$1; /** * Runtime adapter for converting Storybook CSF modules to Fragment definitions. * * This operates on IMPORTED modules at runtime, not source code parsing. * By leveraging Vite's module system, we get 100% accurate render functions * without any regex or AST parsing complexity. * * Supports Storybook 8.x with both CSF2 (Template.bind) and CSF3 (object stories). */ /** * Storybook decorator function signature */ type Decorator = (Story: () => ReactNode, context: StoryContext) => ReactNode; /** * Storybook loader function signature */ type Loader = (context: StoryContext) => Promise>; /** * Storybook play function signature (internal, extends StoryContext) */ type StorybookPlayFunction = (context: StorybookPlayFunctionContext) => Promise; /** * Context passed to Storybook play functions (extends StoryContext for compatibility) */ interface StorybookPlayFunctionContext extends StoryContext { canvasElement: HTMLElement; step: (name: string, fn: () => Promise) => Promise; } /** * Context passed to decorators and render functions */ interface StoryContext { args: Record; argTypes: Record; globals: Record; parameters: Record; id: string; kind: string; name: string; story: string; viewMode: "story" | "docs"; loaded: Record; abortSignal: AbortSignal; componentId: string; title: string; } /** * Storybook Meta (default export) */ interface StoryMeta { title?: string; component?: ComponentType; subcomponents?: Record>; tags?: string[]; parameters?: Record & { docs?: { description?: { component?: string; }; }; }; argTypes?: Record; args?: Record; decorators?: Decorator[]; loaders?: Loader[]; render?: (args: Record, context?: StoryContext) => ReactNode; includeStories?: string[] | RegExp; excludeStories?: string[] | RegExp; } /** * Storybook argType definition */ interface StoryArgType { control?: string | false | { type: string; min?: number; max?: number; step?: number; presetColors?: string[]; }; options?: string[]; description?: string; table?: { defaultValue?: { summary: string; }; type?: { summary: string; }; category?: string; subcategory?: string; disable?: boolean; }; type?: { name: string; required?: boolean; }; name?: string; defaultValue?: unknown; if?: { arg?: string; exists?: boolean; }; mapping?: Record; action?: string; } /** * Storybook Story export (CSF3) */ interface Story { args?: Record; argTypes?: Record; render?: (args: Record, context?: StoryContext) => ReactNode; decorators?: Decorator[]; loaders?: Loader[]; play?: StorybookPlayFunction; parameters?: Record & { docs?: { description?: { story?: string; }; }; }; name?: string; storyName?: string; tags?: string[]; } /** * CSF2 story function (from Template.bind({})) with args attached */ type CSF2Story = ((args: Record) => ReactNode) & { args?: Record; argTypes?: Record; decorators?: Decorator[]; loaders?: Loader[]; play?: StorybookPlayFunction; parameters?: Record; storyName?: string; }; /** * A complete Storybook module with default meta and named story exports */ interface StoryModule { default: StoryMeta; [exportName: string]: Story | CSF2Story | StoryMeta | unknown; } /** * Global configuration from preview.tsx */ interface PreviewConfig { decorators?: Decorator[]; parameters?: Record; globalTypes?: Record; args?: Record; argTypes?: Record; loaders?: Loader[]; } /** * Set the global preview configuration loaded from .storybook/preview.tsx */ declare function setPreviewConfig(config: PreviewConfig): void; /** * Get the current global preview configuration */ declare function getPreviewConfig(): PreviewConfig; /** * Convert a Storybook module to a Fragment definition at runtime. * * @param storyModule - The imported Storybook module * @param filePath - File path for metadata extraction * @returns A complete FragmentDefinition ready for the viewer */ declare function storyModuleToFragment(storyModule: StoryModule, filePath: string): FragmentDefinition | null; /** * Smart filtering for Storybook adapter. * * Two layers: * 1. Per-file heuristics — checkStoryExclusion() checks title, tags, component name, etc. * 2. Cross-file sub-component detection — detectSubComponentPaths() uses directory structure. * * All functions are pure (no I/O, no side effects) for easy testing. */ type ExclusionReason = 'deprecated' | 'test-story' | 'svg-icon' | 'tag-excluded' | 'empty-variants' | 'sub-component' | 'config-excluded'; interface ExclusionResult { excluded: boolean; reason?: ExclusionReason; detail?: string; } interface CheckStoryExclusionOpts { storybookTitle?: string; componentName: string; componentDisplayName?: string; componentFunctionName?: string; tags?: string[]; variantCount: number; filePath: string; config: StorybookFilterConfig; } /** * Per-file exclusion check. Returns `{ excluded: true, reason, detail }` when * the fragment should be filtered out, or `{ excluded: false }` when it should * be kept. * * Config `include` trumps everything — if a name matches `include`, it is * never excluded by heuristics. */ declare function checkStoryExclusion(opts: CheckStoryExclusionOpts): ExclusionResult; /** * Given all story file relative paths, detect which ones are sub-components * based on directory structure. * * Heuristic: within a directory, if one story file's base name matches the * directory name, it is the "primary" component. All other story files in * the same directory are considered sub-components. * * Example: * src/components/Form/Form.stories.tsx → primary ("Form") * src/components/Form/Checkbox.stories.tsx → sub-component of "Form" * src/components/Form/RadioGroup.stories.tsx → sub-component of "Form" * * Returns a Map from relative path → parent component name. * Paths NOT in the map are standalone components. */ declare function detectSubComponentPaths(storyFiles: Array<{ relativePath: string; }>): Map; /** * Check if a component name matches the `storybook.include` patterns. * Include is a force-include that bypasses all heuristic filters. */ declare function isForceIncluded(name: string, config: StorybookFilterConfig): boolean; /** * Check if a component name matches the `storybook.exclude` patterns. */ declare function isConfigExcluded(name: string, config: StorybookFilterConfig): boolean; /** * Figma property mapping DSL * * Provides helpers for mapping Figma component properties to code props. * Inspired by Figma Code Connect's API. * * @example * ```tsx * import { defineFragment, figma } from '@fragments-sdk/cli/core'; * * export default defineFragment({ * component: Button, * meta: { * name: 'Button', * description: 'Primary action trigger', * category: 'actions', * figma: 'https://figma.com/file/abc/Design?node-id=1-2', * figmaProps: { * children: figma.string('Label'), * disabled: figma.boolean('Disabled'), * variant: figma.enum('Type', { * 'Primary': 'primary', * 'Secondary': 'secondary', * }), * }, * }, * // ... * }); * ``` */ /** * Map a Figma text property to a string prop. * * @param figmaProperty - The name of the text property in Figma * @returns A string mapping descriptor * * @example * ```tsx * figmaProps: { * label: figma.string('Button Text'), * placeholder: figma.string('Placeholder'), * } * ``` */ declare function string(figmaProperty: string): FigmaStringMapping; /** * Map a Figma boolean property to a boolean prop. * Optionally map true/false to different values. * * @param figmaProperty - The name of the boolean property in Figma * @param valueMapping - Optional mapping of true/false to other values * @returns A boolean mapping descriptor * * @example * ```tsx * figmaProps: { * disabled: figma.boolean('Disabled'), * // Map boolean to string values * size: figma.boolean('Large', { true: 'lg', false: 'md' }), * } * ``` */ declare function boolean(figmaProperty: string, valueMapping?: { true: unknown; false: unknown; }): FigmaBooleanMapping; /** * Map a Figma variant property to an enum prop. * * @param figmaProperty - The name of the variant property in Figma * @param valueMapping - Mapping of Figma values to code values * @returns An enum mapping descriptor * * @example * ```tsx * figmaProps: { * variant: figma.enum('Type', { * 'Primary': 'primary', * 'Secondary': 'secondary', * 'Outline': 'outline', * }), * size: figma.enum('Size', { * 'Small': 'sm', * 'Medium': 'md', * 'Large': 'lg', * }), * } * ``` */ declare function enumValue>(figmaProperty: string, valueMapping: T): FigmaEnumMapping; /** * Reference a nested Figma component instance. * Use this when a prop accepts a component that's represented * as an instance swap in Figma. * * @param figmaProperty - The name of the instance property in Figma * @returns An instance mapping descriptor * * @example * ```tsx * figmaProps: { * icon: figma.instance('Icon'), * avatar: figma.instance('Avatar'), * } * ``` */ declare function instance(figmaProperty: string): FigmaInstanceMapping; /** * Render children from specific Figma layers. * Use this when children are represented as named layers in Figma. * * @param layers - Array of layer names to include as children * @returns A children mapping descriptor * * @example * ```tsx * figmaProps: { * children: figma.children(['Title', 'Description', 'Actions']), * } * ``` */ declare function children(layers: string[]): FigmaChildrenMapping; /** * Extract text content from a Figma text layer. * Use this when a prop should be the actual text from a layer. * * @param layer - The name of the text layer in Figma * @returns A text content mapping descriptor * * @example * ```tsx * figmaProps: { * title: figma.textContent('Header Text'), * description: figma.textContent('Body Text'), * } * ``` */ declare function textContent(layer: string): FigmaTextContentMapping; /** * Figma property mapping helpers. * * Use these to define how Figma properties map to your component props. * The mappings are used for: * - Generating accurate code snippets in Figma Dev Mode * - AI agents understanding the design-to-code relationship * - Automated design verification */ declare const figma: { readonly string: typeof string; readonly boolean: typeof boolean; readonly enum: typeof enumValue; readonly instance: typeof instance; readonly children: typeof children; readonly textContent: typeof textContent; }; /** * Helper type to check if a value is a Figma prop mapping */ declare function isFigmaPropMapping(value: unknown): value is FigmaStringMapping | FigmaBooleanMapping | FigmaEnumMapping | FigmaInstanceMapping | FigmaChildrenMapping | FigmaTextContentMapping; /** * Resolve a Figma prop mapping to an actual value given Figma property values. * * @param mapping - The Figma prop mapping * @param figmaValues - Object containing Figma property values * @returns The resolved value for the code prop */ declare function resolveFigmaMapping(mapping: FigmaStringMapping | FigmaBooleanMapping | FigmaEnumMapping | FigmaInstanceMapping | FigmaChildrenMapping | FigmaTextContentMapping, figmaValues: Record): unknown; /** * TypeScript types for Fragment JSON files. * These types correspond to the JSON schemas in ./schema/ */ /** * Figma design links and mappings */ interface FragmentFigma { /** Figma file URL */ file?: string; /** Default Figma node ID for this component */ nodeId?: string; /** Mapping of variant names to Figma node IDs */ variants?: Record; } /** * Anti-pattern with optional alternative */ interface FragmentDoNotItem { /** What not to do */ text: string; /** Component name to use instead */ instead?: string; } /** * Usage pattern with code example */ interface FragmentPattern { /** Pattern name */ name: string; /** Code example */ code: string; /** When to use this pattern */ description?: string; } /** * Usage guidelines for AI agents and developers */ interface FragmentUsage { /** Scenarios when this component should be used */ when?: string[]; /** Anti-patterns and what to use instead */ doNot?: (string | FragmentDoNotItem)[]; /** Common usage patterns with code examples */ patterns?: FragmentPattern[]; } /** * Accessibility requirements and guidelines */ interface FragmentAccessibility { /** ARIA role this component implements */ role?: string; /** Accessibility requirements */ requirements?: string[]; /** Keyboard interaction patterns (key -> description) */ keyboard?: Record; } /** * Relationships to other components */ interface FragmentRelated { /** Similar components that might be alternatives */ similar?: string[]; /** Components commonly used together with this one */ composedWith?: string[]; /** Parent components or patterns where this is commonly used */ usedIn?: string[]; } /** * Administrative metadata */ interface FragmentMeta { /** Team or person responsible for this component */ owner?: string; /** Component lifecycle status */ status?: "draft" | "experimental" | "beta" | "stable" | "deprecated"; /** Version when this component was introduced */ since?: string; /** Version when this component was deprecated */ deprecatedSince?: string; /** Why this component was deprecated and what to use instead */ deprecatedReason?: string; /** Tags for categorization and search */ tags?: string[]; } /** * Fragment JSON file structure (.fragment.json) * Contains enrichment metadata for a component */ interface Fragment { /** JSON Schema reference */ $schema?: string; /** Component name (must match the component export name) */ name: string; /** Brief description of the component's purpose */ description?: string; /** Figma design links and mappings */ figma?: FragmentFigma; /** Usage guidelines for AI agents and developers */ usage?: FragmentUsage; /** Accessibility requirements and guidelines */ accessibility?: FragmentAccessibility; /** Relationships to other components */ related?: FragmentRelated; /** Administrative metadata */ meta?: FragmentMeta; } /** * Prop entry in the registry */ interface RegistryPropEntry { /** TypeScript type (e.g., 'string', 'boolean', enum values) */ type?: string; /** Simplified type category */ typeKind?: "string" | "number" | "boolean" | "enum" | "object" | "array" | "function" | "node" | "element" | "union" | "unknown"; /** For enum types, the allowed values */ options?: string[]; /** Default value if specified */ default?: unknown; /** Whether this prop is required */ required?: boolean; /** Prop description from JSDoc or TypeScript */ description?: string; } /** * Component entry in the registry (simplified - focuses on paths and enrichment) */ interface RegistryComponentEntry { /** Relative path to the component source file */ path: string; /** Relative path to the .fragment.json file (if exists) */ fragmentPath?: string; /** Relative path to the .stories.tsx file (if exists) */ storyPath?: string; /** Component category (inferred from directory or fragment) */ category?: string; /** Component lifecycle status (from fragment) */ status?: "draft" | "experimental" | "beta" | "stable" | "deprecated"; /** Component description (from fragment or JSDoc) */ description?: string; /** Has human-authored enrichment (fragment file exists with content beyond skeleton) */ hasEnrichment?: boolean; /** Extracted prop definitions - only included if config.registry.includeProps is true */ props?: Record; /** Named exports from the component file */ exports?: string[]; /** Component dependencies (other components used) */ dependencies?: string[]; /** Merged fragment enrichment data - only included if config.registry.embedFragments is true */ fragment?: Fragment; } /** * Minimal component index (.fragments/index.json) * Ultra-light name → path mapping for quick lookups */ interface FragmentIndex { /** Schema version */ version: string; /** When this index was generated */ generatedAt: string; /** Simple name → path mapping */ components: Record; /** Categories for grouping */ categories?: Record; } /** * Registry file structure (.fragments/registry.json) * Component index with resolved paths and optional metadata */ interface FragmentRegistry { /** JSON Schema reference */ $schema?: string; /** Schema version */ version: string; /** When this registry was generated */ generatedAt: string; /** Component count for quick reference */ componentCount: number; /** Component index keyed by component name */ components: Record; /** Components grouped by category */ categories?: Record; } /** * Context file options for generation */ interface FragmentContextOptions { /** Output format */ format?: "markdown" | "json"; /** Compact mode - minimal output for token efficiency */ compact?: boolean; /** What to include in the output */ include?: { /** Include prop details (default: true) */ props?: boolean; /** Include code examples (default: false) */ code?: boolean; /** Include related components (default: true) */ relations?: boolean; }; } interface ParsedToken { /** Full CSS variable name (e.g., "--fui-color-accent") */ name: string; /** Raw value from the declaration (e.g., "#{$fui-space-4}" or "16px") */ value?: string; /** Resolved value after SCSS variable substitution (e.g., "16px") */ resolvedValue?: string; /** Category inferred from comment or naming convention */ category: string; /** Description from inline comment, if any */ description?: string; } interface TokenParseOutput { /** Detected prefix (e.g., "--fui-") */ prefix: string; /** Tokens grouped by category */ categories: Record; /** Total number of tokens found */ total: number; } type TokenFormat = "auto" | "css" | "scss" | "dtcg" | "tailwind-v4"; interface ParseTokensOptions { format?: TokenFormat; filePath?: string; } interface DesignTokenParseOptions { filePath?: string; themeSelectors?: Record; includeTailwindV4?: boolean; } interface ThemeParserResult { tokens: DesignToken[]; errors: string[]; warnings: string[]; parseTimeMs: number; } declare function inferTokenCategory(name: string, value?: string): TokenCategory; declare function inferTokenGroup(name: string): string; declare function normalizeTokenGroupComment(comment: string): string; declare function parseScssVariables(content: string): Map; declare function resolveTokenValue(rawValue: string, scssVars: Map, cssVarValues: Map, depth?: number): string; declare function parseScssTokens(content: string, filePath?: string): TokenParseOutput; declare function parseCssTokens(content: string, filePath?: string): TokenParseOutput; declare const parseTokenFile: typeof parseScssTokens; declare function isDTCGFile(filePath: string): boolean; declare function parseDtcgTokens(content: string, filePath?: string): TokenParseOutput; declare function containsTailwindV4Theme(content: string): boolean; declare function parseTailwindV4Theme(cssContent: string, filePath?: string): ThemeParserResult; declare function parseDesignTokenContent(content: string, options?: DesignTokenParseOptions): TokenParseResult; declare function resolveDesignTokenValue(rawValue: string, tokensByName: Map, visited?: Set): { resolvedValue: string; chain: string[]; hasCircular: boolean; unresolvedRef?: string; }; declare function normalizeTokenValue(value: string): string; declare function parseTokens(content: string, formatOrOptions?: TokenFormat | ParseTokensOptions): TokenParseOutput; /** * W3C Design Token Community Group (DTCG) format types and Zod schemas. * * Implements the W3C DTCG specification for design token files. * @see https://www.designtokens.org/tr/2025.10/format/ */ type DTCGTokenType = 'color' | 'dimension' | 'fontFamily' | 'fontWeight' | 'duration' | 'cubicBezier' | 'number' | 'shadow' | 'border' | 'strokeStyle' | 'transition' | 'gradient' | 'typography'; /** Color value (sRGB) */ interface DTCGColorValue { colorSpace: string; components: number[]; hex?: string; alpha?: number; } /** Dimension value */ interface DTCGDimensionValue { value: number; unit: 'px' | 'rem'; } /** A single design token */ interface DTCGToken { $value: unknown; $type?: DTCGTokenType; $description?: string; $deprecated?: boolean | string; $extensions?: Record; } /** A group (recursive container for tokens and sub-groups) */ interface DTCGGroup { $type?: DTCGTokenType; $description?: string; $deprecated?: boolean | string; $extensions?: Record; $extends?: string; [key: string]: DTCGToken | DTCGGroup | unknown; } /** Root file structure — a top-level group */ type DTCGTokenFile = DTCGGroup; interface ResolvedDTCGToken { /** Dot-separated path (e.g., "color.brand.primary") */ path: string; /** Resolved type (inherited from group if not set on token) */ type: DTCGTokenType; /** Raw $value from the token */ rawValue: unknown; /** CSS-compatible string value */ cssValue: string; /** Description */ description?: string; /** Whether token is deprecated */ deprecated?: boolean | string; /** Extensions data */ extensions?: Record; } /** * Top-level schema for a DTCG token file. * Validates the root structure — individual tokens are validated by type * during parsing since the tree is recursive. */ declare const dtcgTokenFileSchema: z.ZodEffects, Record, Record>; /** * Component Contract Parser — converts .contract.json files to CompiledFragment. * * Maps the framework-agnostic ComponentContract format to the same * CompiledFragment type used by .fragment.tsx, so all downstream consumers * (MCP tools, governance, search) work unchanged. */ interface CompiledContractOutput { filePath: string; meta: { name: string; description: string; category: string; tags?: string[]; status?: 'stable' | 'beta' | 'deprecated' | 'experimental'; figma?: string; figmaProps?: Record; }; usage: { when: string[]; whenNot: string[]; guidelines?: string[]; accessibility?: string[]; }; props: Record; relations?: Array<{ component: string; relationship: 'alternative' | 'parent' | 'child' | 'sibling' | 'composition' | 'complementary' | 'used-by'; note: string; }>; variants: Array<{ name: string; description: string; code?: string; args?: Record; }>; contract?: { propsSummary?: string[]; scenarioTags?: string[]; a11yRules?: string[]; bans?: Array<{ pattern: string; message: string; }>; compoundChildren?: Record; canonicalUsage?: string[]; performanceBudget?: number; }; /** Framework hint from contract, used by extractor adapter selection */ framework?: string; /** AI metadata for compound component generation */ ai?: { compositionPattern?: 'compound' | 'simple' | 'controlled' | 'wrapper'; subComponents?: string[]; requiredChildren?: string[]; commonPatterns?: string[]; }; /** Top-level compact prop summaries for agent first-pass */ propsSummary?: string[]; /** Provenance tracking */ provenance?: { source: string; verified: boolean; frameworkSupport?: string; sourceHash?: string; extractedAt?: string; }; /** Source file path relative to config root */ sourcePath?: string; /** Named export from source file */ exportName?: string; } /** * Check if a file path is a component contract file. */ declare function isContractFile(filePath: string): boolean; /** * Parse a component contract JSON file into CompiledFragment-compatible output. */ declare function parseComponentContract(content: string, filePath: string): CompiledContractOutput; /** * Framework-agnostic component contract format. * * Allows non-React teams to define component metadata via `.contract.json` * files instead of `.fragment.tsx`. Maps trivially to CompiledFragment. */ interface ComponentContract { /** JSON Schema reference for tooling — required for validation */ $schema: string; /** Component name */ name: string; description: string; category: string; tags?: string[]; status?: 'stable' | 'beta' | 'deprecated' | 'experimental'; /** Framework hint (for extraction and documentation) */ framework?: 'react' | 'vue' | 'svelte' | 'web-components' | 'angular'; /** Path to the component source file, relative to fragments.config.ts root */ sourcePath: string; /** Named export from the source file */ exportName: string; /** Compact one-line-per-prop summaries for agent first-pass (e.g., "variant: primary|secondary (required)") */ propsSummary: string[]; /** Component props schema */ props: Record; /** Usage guidelines */ usage: { when: string[]; whenNot: string[]; guidelines?: string[]; accessibility?: string[]; }; /** Code examples (as strings, not render functions) */ examples?: Array<{ name: string; description: string; code: string; args?: Record; }>; /** Relations to other components */ relations?: Array<{ component: string; relationship: 'alternative' | 'parent' | 'child' | 'sibling' | 'composition' | 'complementary' | 'used-by'; note: string; }>; /** AI generation contract */ contract?: { propsSummary?: string[]; scenarioTags?: string[]; a11yRules?: string[]; bans?: Array<{ pattern: string; message: string; }>; /** Sub-component slot metadata for compound components */ compoundChildren?: Record; /** Canonical JSX usage examples */ canonicalUsage?: string[]; /** Per-component performance budget override in bytes (gzipped) */ performanceBudget?: number; }; /** AI metadata for compound component generation */ ai?: { compositionPattern?: 'compound' | 'simple' | 'controlled' | 'wrapper'; subComponents?: string[]; requiredChildren?: string[]; commonPatterns?: string[]; }; /** Per-component preview configuration */ preview?: { setupModule?: string; wrapperModule?: string; wrapperExport?: string; css?: string[]; theme?: 'light' | 'dark'; }; /** Provenance tracking — required for verification */ provenance: { source: 'manual' | 'extracted' | 'merged' | 'migrated'; verified: boolean; frameworkSupport?: 'native' | 'manual-only'; sourceHash?: string; extractedAt?: string; }; /** Design token references used by this component */ tokens?: string[]; /** Figma mappings (same DSL as .fragment.tsx but in JSON form) */ figma?: { nodeUrl?: string; propMappings?: Record; }>; }; } declare const componentContractSchema: z.ZodObject<{ $schema: z.ZodString; name: z.ZodString; description: z.ZodString; category: z.ZodString; tags: z.ZodOptional>; status: z.ZodOptional>; framework: z.ZodOptional>; sourcePath: z.ZodString; exportName: z.ZodString; propsSummary: z.ZodArray; props: z.ZodRecord>; default: z.ZodOptional; description: z.ZodString; required: z.ZodOptional; constraints: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; description: string; values?: string[] | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; }, { type: string; description: string; values?: string[] | undefined; default?: unknown; required?: boolean | undefined; constraints?: string[] | undefined; }>>; usage: z.ZodObject<{ when: z.ZodArray; whenNot: z.ZodArray; guidelines: z.ZodOptional>; accessibility: z.ZodOptional>; }, "strip", z.ZodTypeAny, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }, { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }>; examples: z.ZodOptional>; }, "strip", z.ZodTypeAny, { code: string; description: string; name: string; args?: Record | undefined; }, { code: string; description: string; name: string; args?: Record | undefined; }>, "many">>; relations: z.ZodOptional; note: z.ZodString; }, "strip", z.ZodTypeAny, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }, { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }>, "many">>; contract: z.ZodOptional>; scenarioTags: z.ZodOptional>; a11yRules: z.ZodOptional>; bans: z.ZodOptional, "many">>; compoundChildren: z.ZodOptional; accepts: z.ZodOptional>; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }, { description?: string | undefined; required?: boolean | undefined; accepts?: string[] | undefined; }>>>; canonicalUsage: z.ZodOptional>; performanceBudget: z.ZodOptional; }, "strip", z.ZodTypeAny, { compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }, { compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; }>>; ai: z.ZodOptional>; subComponents: z.ZodOptional>; requiredChildren: z.ZodOptional>; commonPatterns: z.ZodOptional>; }, "strip", z.ZodTypeAny, { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }, { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; }>>; preview: z.ZodOptional; wrapperModule: z.ZodOptional; wrapperExport: z.ZodOptional; css: z.ZodOptional>; theme: z.ZodOptional>; }, "strip", z.ZodTypeAny, { css?: string[] | undefined; theme?: "light" | "dark" | undefined; setupModule?: string | undefined; wrapperModule?: string | undefined; wrapperExport?: string | undefined; }, { css?: string[] | undefined; theme?: "light" | "dark" | undefined; setupModule?: string | undefined; wrapperModule?: string | undefined; wrapperExport?: string | undefined; }>>; provenance: z.ZodObject<{ source: z.ZodEnum<["manual", "extracted", "merged", "migrated"]>; verified: z.ZodBoolean; frameworkSupport: z.ZodOptional>; sourceHash: z.ZodOptional; extractedAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { source: "manual" | "extracted" | "merged" | "migrated"; verified: boolean; frameworkSupport?: "native" | "manual-only" | undefined; sourceHash?: string | undefined; extractedAt?: string | undefined; }, { source: "manual" | "extracted" | "merged" | "migrated"; verified: boolean; frameworkSupport?: "native" | "manual-only" | undefined; sourceHash?: string | undefined; extractedAt?: string | undefined; }>; tokens: z.ZodOptional>; figma: z.ZodOptional; propMappings: z.ZodOptional; figmaProperty: z.ZodString; values: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: "string" | "boolean" | "enum" | "instance" | "children" | "textContent"; figmaProperty: string; values?: Record | undefined; }, { type: "string" | "boolean" | "enum" | "instance" | "children" | "textContent"; figmaProperty: string; values?: Record | undefined; }>>>; }, "strip", z.ZodTypeAny, { nodeUrl?: string | undefined; propMappings?: Record | undefined; }> | undefined; }, { nodeUrl?: string | undefined; propMappings?: Record | undefined; }> | undefined; }>>; }, "strip", z.ZodTypeAny, { description: string; props: Record; category: string; name: string; sourcePath: string; exportName: string; provenance: { source: "manual" | "extracted" | "merged" | "migrated"; verified: boolean; frameworkSupport?: "native" | "manual-only" | undefined; sourceHash?: string | undefined; extractedAt?: string | undefined; }; propsSummary: string[]; usage: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; $schema: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; tokens?: string[] | undefined; contract?: { compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; ai?: { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; framework?: "react" | "vue" | "svelte" | "web-components" | "angular" | undefined; preview?: { css?: string[] | undefined; theme?: "light" | "dark" | undefined; setupModule?: string | undefined; wrapperModule?: string | undefined; wrapperExport?: string | undefined; } | undefined; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; examples?: { code: string; description: string; name: string; args?: Record | undefined; }[] | undefined; tags?: string[] | undefined; figma?: { nodeUrl?: string | undefined; propMappings?: Record | undefined; }> | undefined; } | undefined; }, { description: string; props: Record; category: string; name: string; sourcePath: string; exportName: string; provenance: { source: "manual" | "extracted" | "merged" | "migrated"; verified: boolean; frameworkSupport?: "native" | "manual-only" | undefined; sourceHash?: string | undefined; extractedAt?: string | undefined; }; propsSummary: string[]; usage: { when: string[]; whenNot: string[]; guidelines?: string[] | undefined; accessibility?: string[] | undefined; }; $schema: string; status?: "experimental" | "stable" | "deprecated" | "beta" | undefined; tokens?: string[] | undefined; contract?: { compoundChildren?: Record | undefined; a11yRules?: string[] | undefined; scenarioTags?: string[] | undefined; propsSummary?: string[] | undefined; bans?: { message: string; pattern: string; }[] | undefined; performanceBudget?: number | undefined; canonicalUsage?: string[] | undefined; } | undefined; ai?: { compositionPattern?: "compound" | "simple" | "controlled" | "wrapper" | undefined; subComponents?: string[] | undefined; requiredChildren?: string[] | undefined; commonPatterns?: string[] | undefined; } | undefined; framework?: "react" | "vue" | "svelte" | "web-components" | "angular" | undefined; preview?: { css?: string[] | undefined; theme?: "light" | "dark" | undefined; setupModule?: string | undefined; wrapperModule?: string | undefined; wrapperExport?: string | undefined; } | undefined; relations?: { component: string; relationship: "composition" | "alternative" | "sibling" | "parent" | "child" | "complementary" | "used-by"; note: string; }[] | undefined; examples?: { code: string; description: string; name: string; args?: Record | undefined; }[] | undefined; tags?: string[] | undefined; figma?: { nodeUrl?: string | undefined; propMappings?: Record | undefined; }> | undefined; } | undefined; }>; /** * DTCG Output Generators — generate CSS, SCSS, Tailwind, and Figma output * from a DTCG token source file. * * Makes DTCG the single source of truth with everything else as derived output. */ interface CSSGeneratorOptions { /** Token name prefix (e.g., 'ds' → '--ds-*') */ prefix?: string; /** CSS selector to wrap variables in (default: ':root') */ selector?: string; } /** * Generate CSS custom properties from a DTCG token file. */ declare function generateCSSCustomProperties(tokens: DTCGTokenFile, options?: CSSGeneratorOptions): string; interface SCSSGeneratorOptions { /** Token name prefix (e.g., 'ds' → '$ds-*') */ prefix?: string; } /** * Generate SCSS variables from a DTCG token file. */ declare function generateSCSSVariables(tokens: DTCGTokenFile, options?: SCSSGeneratorOptions): string; /** * Generate a Tailwind CSS configuration object from a DTCG token file. * Compatible with Tailwind v3 and v4. */ declare function generateTailwindConfig(tokens: DTCGTokenFile): Record; interface FigmaVariable { name: string; type: 'COLOR' | 'FLOAT' | 'STRING' | 'BOOLEAN'; value: unknown; description?: string; scopes?: string[]; } interface FigmaVariableCollection { name: string; modes: Array<{ name: string; modeId: string; }>; variables: FigmaVariable[]; } /** * Generate Figma Variables REST API-compatible payload from a DTCG token file. */ declare function generateFigmaVariables(tokens: DTCGTokenFile): FigmaVariableCollection[]; interface CompositionWarning { type: "missing_parent" | "missing_child" | "missing_composition" | "redundant_alternative" | "deprecated" | "experimental"; component: string; message: string; relatedComponent?: string; } interface CompositionSuggestion { component: string; reason: string; relationship: RelationshipType | "category_gap"; sourceComponent: string; } interface CompositionGuideline { component: string; guideline: string; } interface CompositionAnalysis { /** The validated component names (filtered to those that exist) */ components: string[]; /** Components requested but not found in the registry */ unknown: string[]; /** Issues with the current selection */ warnings: CompositionWarning[]; /** Components to consider adding */ suggestions: CompositionSuggestion[]; /** Relevant usage guidelines for the selected components */ guidelines: CompositionGuideline[]; } /** * Analyzes a set of components as a composition group. * Returns warnings about missing relations, usage conflicts, * and suggestions for additional components. * * When a ComponentGraph is provided via `options.graph`, the analysis is * enhanced with graph-based dependency detection and block-based suggestions. * * Browser-safe: no Node.js APIs used. */ declare function analyzeComposition(fragments: Record, componentNames: string[], _context?: string, options?: { graph?: ComponentGraph; }): CompositionAnalysis; /** * Minimal contract for rendering a preview variant. * Compatible with fragment variants and Storybook-adapted variants. */ interface PreviewVariantLike { render: (options?: VariantRenderOptions) => ReactNode; loaders?: VariantLoader[]; } interface PreviewRuntimeState { content: ReactNode | null; isLoading: boolean; error: Error | null; loadedData?: Record; } interface PreviewRuntimeOptions { variant?: PreviewVariantLike | null; loadedData?: Record; } /** * Execute all variant loaders and merge their payloads. * `loadedData` is applied last so host-level overrides win. */ declare function executeVariantLoaders(loaders: VariantLoader[] | undefined, loadedData?: Record): Promise | undefined>; /** * Resolve a full runtime state (loader execution + render) in one async call. * This is useful for testing and for hook/component orchestration. */ declare function resolvePreviewRuntimeState(options: PreviewRuntimeOptions): Promise; /** * Hook for rendering a preview variant with loader support. */ declare function usePreviewVariantRuntime(options: PreviewRuntimeOptions): PreviewRuntimeState; interface PreviewVariantRuntimeProps extends PreviewRuntimeOptions { children: (state: PreviewRuntimeState) => ReactNode; } /** * Render-prop component wrapper around `usePreviewVariantRuntime`. */ declare function PreviewVariantRuntime({ variant, loadedData, children, }: PreviewVariantRuntimeProps): react_jsx_runtime.JSX.Element; /** * Component discovery utilities. * * Extracted from the docs app component-registry so that any consumer * (govern presets, CLI tools, third-party integrations) can discover * components from a module's exports without duplicating the logic. */ /** * Check if a value is likely a React component. * Functions or objects with $$typeof (forwardRef, memo) qualify. */ declare function isReactComponent(value: unknown): boolean; interface DiscoverComponentsOptions { /** Set of export names to skip */ exclude?: Set; } /** * Discover all components and sub-components from a module's exports. * Returns a sorted array of component names including compound names (e.g. 'Card.Header'). * * @param moduleExports - The exports object from a component library (e.g. `import * as UI from '@fragments-sdk/ui'`) * @param options - Optional configuration */ declare function discoverComponents(moduleExports: Record, options?: DiscoverComponentsOptions): string[]; /** * Finding builder — assembles a `Finding` and computes its fingerprint. * * The fingerprint is a content-addressed hash of a small identity tuple chosen * by each rule. It is *not* the source location: two findings at different * lines for the same offending value should have different fingerprints, but * adding a blank line above them must not change either fingerprint. Rules * pick identity inputs that capture "what's wrong" (file, ruleId, componentId, * prop, property, value) without leaning on lineNumber/column. */ interface MakeFindingInput { ruleId: string; ruleVersion: string; severity: GovernanceSeverity | Severity; message: string; location: FactLocation; evidence: FactEvidence[]; fingerprintIdentity: Record; fix?: FindingFix; attributes?: Record; } declare function makeFinding(input: MakeFindingInput): Finding; /** * The ONLY rules whose findings may hard-deny a write: deterministic, * single-file-decidable, high-confidence classes (architecture Open Q2). A rule * is added here DELIBERATELY — new rules gain no blocking power by default, so a * future heuristic rule can't silently start denying writes. Heuristic/INFERRED * classes (`composition/*`, `tailwind/*arbitrary*`) are absent on purpose: at * most advisory, never a block. */ declare const BLOCKING_RULE_ALLOWLIST: ReadonlySet; /** * Mirrors `scanWithFacts`'s own CI exit logic: a finding gates CI when it is * error-severity, or warn-severity under `ci.failOnWarnings`. Gating on exactly * this set is what makes a local/emit deny imply a CI failure. */ declare function gatesCi(finding: Finding, failOnWarnings: boolean): boolean; /** A finding may deny iff it is allowlisted, gates CI, and is not a flagged-heuristic fix. */ declare function isDenyEligible(finding: Finding, failOnWarnings: boolean): boolean; /** * `components/unknown-prop` — fires when JSX uses a prop that isn't in the * component's declared prop schema and the global `jsx.unknownProps.forbid` * policy is active. Universal React/DOM props (data-*, aria-*, on*, key, ref, * className, style, etc.) are exempt. * * The rule only fires for components we have prop metadata for. If the * component has no `prop_metadata` facts (e.g., third-party imports we don't * model yet), we cannot tell whether a prop is unknown and the rule stays * silent. */ declare function ruleComponentsUnknownProp(ix: FactIndex): Finding[]; /** * `components/forbidden-prop-value` — fires when a JSX prop is assigned a * value that the component governance forbids. Path-scoped policies only * fire when the file matches the policy's path glob; unscoped policies fire * everywhere. * * Only static prop values are checked. Dynamic props (`variant={kind}`) and * spreads (`{...props}`) cannot be evaluated at scan time. */ declare function ruleComponentsForbiddenPropValue(ix: FactIndex): Finding[]; declare function ruleComponentsPreferLibrary(ix: FactIndex): Finding[]; /** * `props/invalid-value` — fires when a JSX prop is statically assigned a * value outside the component's declared enum values. * * The rule is intentionally conservative: it only runs for exact static * prop values and prop metadata that declares an allowed values list. * Dynamic expressions, spreads, JSX values, and open-ended prop schemas stay * silent so the scanner does not turn weak metadata into false certainty. */ declare function rulePropsInvalidValue(ix: FactIndex): Finding[]; declare function ruleJsxPreferredImportPath(ix: FactIndex): Finding[]; declare function ruleJsxPreferredComponent(ix: FactIndex): Finding[]; /** * `styles/no-raw-color` — fires when a color-bearing CSS declaration or JSX * inline style uses a raw color literal (hex, rgb/rgba, hsl/hsla, named) and * the global `style.rawColors.forbid` policy is active. Token references * (`var(--...)`) and policy-supplied exemptions (`transparent`, etc.) pass. * * The rule looks at any `style_declaration` or `usage_inline_style` whose * value contains a recognizable color literal, not just declarations whose * property name suggests a color — backgrounds use `background:` shorthand, * borders use `border-color:`, and SVG uses `fill:`/`stroke:`. Detecting on * the *value* keeps the rule property-agnostic. */ declare function ruleStylesNoRawColor(ix: FactIndex): Finding[]; /** * `styles/no-raw-dimensions` — fires when a length-bearing CSS declaration or * JSX inline style uses a raw dimension literal (`16px`, `1rem`, …) on a * property covered by the global `style.rawDimensions.forbid` policy. * * Suggestion strength is tiered, mirroring `styles/no-raw-spacing`: * * - **exact token match** — the raw value EXACTLY equals a tenant dimension * token of the same unit (units are never cross-converted — matching `1rem` * to a `16px` token would assume a root font size we cannot guarantee). Emits * a value-preserving, deterministic `var(--token)` fix. * - **off-scale single value** — `border-radius: 10px` when the tenant has no * `10px` token. Names the NEAREST token of the same unit via `suggestedToken` * and the message, but attaches NO fix — snapping changes the rendered value, * so it must stay a suggestion the author confirms, never an auto-rewrite. * Same-unit only: a `px` value never snaps to a `rem` token, keeping the * suggestion free of an assumed root-font-size. * - **no nearby token** (or a multi-value shorthand off-scale) — flagged with no * fix and no suggestion, leaving the choice to the author. * * Nearest snapping adds NO new findings and changes NO rendered values: an * off-scale dimension already fires under this policy; the snap only enriches * that finding with a `suggestedToken` hint. * * The policy is intentionally opt-in (no preset enables it): a plain * `fragments govern scan` never flags raw dimensions. Only callers that supply * a `style.rawDimensions.forbid` record (e.g. the conform tool) activate it. */ declare function ruleStylesNoRawDimensions(ix: FactIndex): Finding[]; /** * `styles/no-raw-spacing` — fires when a length-bearing CSS declaration or * JSX inline style on a scaled property uses a raw spacing literal instead of * a design token. * * The rule needs both a `style.property.scale` policy (which property is * scaled, and which scale name backs it) and a matching set of `scale_value` * facts (the allowed numbers). If either is missing the rule is silent for * that property. * * Two violation shapes, mirroring `styles/no-raw-color`: * * - **off the scale** — `padding: 13px` on a [0,4,8,12,16] scale. Flagged; the * suggested fix snaps to the nearest scale value (as the matching token when * one exists, else the raw grid value). Because snapping *changes* the * rendered value, the fix is a suggestion (non-deterministic) — never applied * silently. * - **on the scale but a raw literal that equals a token** — `padding: 16px` * where `--space-md` is `16px`. Flagged; the fix swaps in `var(--space-md)`. * This is value-preserving, so it is a deterministic, auto-applicable fix. * (Only fires when a matching spacing token exists — a pure-grid value with no * named token, like `0`, stays silent.) * * `padding: var(--space-3)` → silent (token reference). `padding: 1.5rem` on a * px scale → normalized through the configured root font size before matching. */ declare function ruleStylesNoRawSpacing(ix: FactIndex): Finding[]; /** * `styles/no-raw-typography` — fires when a `font-size` declaration or JSX * inline `fontSize` uses a raw length literal instead of a typography token. * * Consumes the `style.fontSize.mustMatchScale` policy (a `style_font_size_scale` * fact) plus a backing scale. Without both it is silent — typography is only * enforced once a project actually has a font-size scale (derived from its * detected typography tokens). This closes the teach-vs-enforce gap where the * agent context advertises typography tokens but nothing flags off-scale text. * * Behaviour mirrors `styles/no-raw-spacing`: * - off the scale (`font-size: 13px` on [12,14,16]) → suggestion, never applied * silently (snapping changes rendered size); * - on the scale but a raw literal equal to a token (`font-size: 16px` where * `--font-size-md` is `16px`) → deterministic, value-preserving token swap. */ declare function ruleStylesNoRawTypography(ix: FactIndex): Finding[]; /** * `tailwind/arbitrary-color` — flags color-bearing Tailwind utilities with * arbitrary raw color values, e.g. `bg-[#abc123]` or * `text-[rgb(10,20,30)]`. */ declare function ruleTailwindArbitraryColor(ix: FactIndex): Finding[]; /** * `tailwind/arbitrary-spacing` — flags arbitrary Tailwind spacing utilities * that cannot be proven to sit on the configured spacing scale. */ declare function ruleTailwindArbitrarySpacing(ix: FactIndex): Finding[]; /** * `tailwind/forbidden-palette` — enforces Tailwind palette allow/deny policy * against resolved token-form color utilities. */ declare function ruleTailwindForbiddenPalette(ix: FactIndex): Finding[]; /** * `tailwind/off-scale-spacing-token` — checks resolved Tailwind spacing * tokens against the same project spacing scale used for CSS declarations. */ declare function ruleTailwindOffScaleSpacingToken(ix: FactIndex): Finding[]; /** * `tailwind/raw-color-via-token` — flags Tailwind color tokens that resolve * to literal colors when policy requires named palette families. */ declare function ruleTailwindRawColorViaToken(ix: FactIndex): Finding[]; /** * `tailwind/unknown-class` — opt-in strict-mode diagnostics for classes that * either fail parser utility recognition or fail token resolution. */ declare function ruleTailwindUnknownClass(ix: FactIndex): Finding[]; declare function ruleTokensRequireDualFallback(ix: FactIndex): Finding[]; declare function ruleThemeNoThemeCoupledLiteral(ix: FactIndex): Finding[]; /** * `a11y/required-accessible-name` — fires for components with an * `a11y.requireName` policy whose JSX usage has no discoverable accessible * name. * * Accepted name sources (any one is enough): * - non-empty `usage_text_child` content * - `aria-label="..."` (static or dynamic both pass; we cannot prove a * dynamic value is empty at scan time) * - `aria-labelledby={...}` * - `title="..."` * * Components that explicitly opt out via `aria-hidden="true"` are skipped — * they are not part of the accessibility tree. */ declare function ruleA11yRequiredAccessibleName(ix: FactIndex): Finding[]; /** * Rule taxonomy — the single source of truth for tier classification. * * Every governance rule is either: * - **Tier A (contract vocabulary)** — measures drift from a vocabulary the * team *declared* (the two-choice contract: canonical components + token * source files). Headline-eligible; on by default but *inert until a * contract is authored* (each Tier-A rule self-gates on its contract facts). * - **Tier B (generic hygiene)** — generic best-practice opinions (raw values, * a11y, theme literals, Tailwind). Never the headline; off by default for * customers, opt-in per rule. * * This map is consumed by the core customer-default preset (`./presets.ts`), the * cloud policy composer, and the UI rules editor. There is exactly one copy — * importers derive their defaults from it rather than re-listing rules (DRY). * * Identifiers are stable: this introduces no new rule ids, it only attaches a * tier label to existing ones. */ type RuleTier = "contract" | "hygiene"; /** * Tier of every rule in `RULES`. Tier A is exactly the two-choice-contract * rules; everything else is hygiene. A coverage test asserts this map and * `RULES` stay in lock-step (every rule id classified, no strays). */ declare const RULE_TIER: Readonly>; /** * Rules removed from the customer default preset *entirely* — Fragments-internal * conventions that are meaningless on a customer repo. They remain available * under the full `fragments` preset for Fragments' own dogfooding; they are * never even an opt-in toggle in the customer default. * * `tokens/require-dual-fallback` — the `var(--x, $x)` SCSS micro-convention — * was ~51% of the dogfood flood and is the canonical example. */ declare const FRAGMENTS_INTERNAL_RULE_IDS: ReadonlySet; /** Tier of a rule id. Unknown ids fail safe to `hygiene` (off by default). */ declare function tierFor(ruleId: string): RuleTier; /** True when the rule measures declared-contract drift (headline-eligible). */ declare function isContractTierRule(ruleId: string): boolean; /** All Tier-A (contract vocabulary) rule ids, in declaration order. */ declare function contractTierRuleIds(): string[]; /** All Tier-B (generic hygiene) rule ids, in declaration order. */ declare function hygieneTierRuleIds(): string[]; /** Headline rank of a rule id (lower = higher in the vocabulary-first list). */ declare function vocabularyRank(ruleId: string): number; /** Comparator ordering rule ids vocabulary-first (Tier A before hygiene). */ declare function compareByVocabularyRank(a: string, b: string): number; /** * Rule presets — the customer default vs the full `fragments` dogfood preset. * * Both are derived from the tier SSOT (`./tiers.ts`); neither re-lists rules. * * - **customer default** — Tier A on (inert until a contract is authored), * Tier B off, Fragments-internal rules excluded entirely. This is the * vocabulary-first, no-flood default a customer repo gets. * - **`fragments`** — every rule on, for Fragments' own internal scans. * * These produce the rule-config half of a `GovernanceConfig`. The hygiene * *policy facts* (e.g. `style.rawColors.forbid`, spacing scales) are a separate * config axis the customer default simply omits — so a Tier-B rule that gates on * a policy fact (raw-color/spacing/typography) stays inert regardless of its * config flag, and the customer default produces zero findings without a * contract. */ interface PresetRuleState { enabled: boolean; severity?: "error" | "warn" | "info"; } /** * Customer default rule states: Tier A enabled (self-gating on contract facts), * Tier B disabled, Fragments-internal rules omitted entirely. Feed directly to * `compileGlobalGovernanceFacts({ rules })` (with no hygiene `styles` config). */ declare function customerDefaultRuleStates(): Record; /** * Full `fragments` preset rule states: every rule on. Includes the * Fragments-internal rules (e.g. `tokens/require-dual-fallback`) the customer * default excludes. */ declare function fragmentsPresetRuleStates(): Record; /** * The composition config contract — shared across the policy boundary. * * `CompositionPattern` is what the `composition/cardinality` and * `composition/co-occurrence` rules read from * `governance_rule_config.options.patterns`. Brief 03 defined it inline in the * rule; brief 04 lifted it here because the same shape now has to round-trip * across three boundaries that must not all hand-roll it: * - the rule's `isCompositionPattern` guard (validates untyped policy facts), * - cloud policy storage + delivery (`apps/cloud` validates on write against * `compositionPatternSchema` before persisting), and * - fragment authoring sugar (`lowerCompositionContract` lowers a fragment's * `contract.composition` block to the same `CompositionPattern[]`). * * Defining it once as a zod schema means the wire shape and the runtime guard * are the same artifact — the guard is `safeParse().success`, never a second * copy that can drift from the type. * * Browser-safe: imports `zod` only. No facts, no Node, no JSX. */ /** Which container a pattern applies to. `component` = canonical componentId. */ declare const compositionRegionSelectorSchema: z.ZodObject<{ component: z.ZodOptional; /** Marker attribute (e.g. `data-fui-region`). Typed; matched in a later brief. */ marker: z.ZodOptional; role: z.ZodOptional; }, "strip", z.ZodTypeAny, { role?: string | undefined; component?: string | undefined; marker?: string | undefined; }, { role?: string | undefined; component?: string | undefined; marker?: string | undefined; }>; /** Which children inside the region the constraint counts. */ declare const compositionChildSelectorSchema: z.ZodObject<{ component: z.ZodString; prop: z.ZodOptional; value: z.ZodOptional; }, "strip", z.ZodTypeAny, { component: string; value?: string | undefined; prop?: string | undefined; }, { component: string; value?: string | undefined; prop?: string | undefined; }>; declare const compositionConstraintSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"cardinality">; max: z.ZodOptional; min: z.ZodOptional; }, "strip", z.ZodTypeAny, { kind: "cardinality"; min?: number | undefined; max?: number | undefined; }, { kind: "cardinality"; min?: number | undefined; max?: number | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"co-occurrence">; requires: z.ZodObject<{ prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; }, { value: string; prop: string; }>; }, "strip", z.ZodTypeAny, { kind: "co-occurrence"; requires: { value: string; prop: string; }; }, { kind: "co-occurrence"; requires: { value: string; prop: string; }; }>]>; declare const compositionPatternSchema: z.ZodObject<{ region: z.ZodObject<{ component: z.ZodOptional; /** Marker attribute (e.g. `data-fui-region`). Typed; matched in a later brief. */ marker: z.ZodOptional; role: z.ZodOptional; }, "strip", z.ZodTypeAny, { role?: string | undefined; component?: string | undefined; marker?: string | undefined; }, { role?: string | undefined; component?: string | undefined; marker?: string | undefined; }>; select: z.ZodObject<{ component: z.ZodString; prop: z.ZodOptional; value: z.ZodOptional; }, "strip", z.ZodTypeAny, { component: string; value?: string | undefined; prop?: string | undefined; }, { component: string; value?: string | undefined; prop?: string | undefined; }>; constraint: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"cardinality">; max: z.ZodOptional; min: z.ZodOptional; }, "strip", z.ZodTypeAny, { kind: "cardinality"; min?: number | undefined; max?: number | undefined; }, { kind: "cardinality"; min?: number | undefined; max?: number | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"co-occurrence">; requires: z.ZodObject<{ prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; }, { value: string; prop: string; }>; }, "strip", z.ZodTypeAny, { kind: "co-occurrence"; requires: { value: string; prop: string; }; }, { kind: "co-occurrence"; requires: { value: string; prop: string; }; }>]>; }, "strip", z.ZodTypeAny, { select: { component: string; value?: string | undefined; prop?: string | undefined; }; region: { role?: string | undefined; component?: string | undefined; marker?: string | undefined; }; constraint: { kind: "cardinality"; min?: number | undefined; max?: number | undefined; } | { kind: "co-occurrence"; requires: { value: string; prop: string; }; }; }, { select: { component: string; value?: string | undefined; prop?: string | undefined; }; region: { role?: string | undefined; component?: string | undefined; marker?: string | undefined; }; constraint: { kind: "cardinality"; min?: number | undefined; max?: number | undefined; } | { kind: "co-occurrence"; requires: { value: string; prop: string; }; }; }>; type CompositionRegionSelector = z.infer; type CompositionChildSelector = z.infer; type CompositionConstraint = z.infer; type CompositionPattern = z.infer; /** * Type guard for a single policy entry. Config arrives untyped from cloud * policy / fragment prose and the facts layer passes `options` through without * a shape, so a malformed entry would otherwise emit garbage findings. The rule * filters `options.patterns` through this; a bad entry is skipped, the rest keep * scanning (architecture failure mode). */ declare function isCompositionPattern(value: unknown): value is CompositionPattern; /** * The structured block a fragment author writes in `contract.composition`. This * is the enforceable form of the prose they already keep (`relations`, * `usage.whenNot`); `lowerCompositionContract` turns it into the same * `CompositionPattern[]` the rule reads from cloud policy. v0 is this explicit * block — free-text inference from `whenNot` strings is out of scope. */ declare const compositionAuthoringEntrySchema: z.ZodObject<{ inRegion: z.ZodString; rule: z.ZodUnion<[z.ZodObject<{ atMost: z.ZodNumber; of: z.ZodObject<{ component: z.ZodString; prop: z.ZodOptional; value: z.ZodOptional; }, "strip", z.ZodTypeAny, { component: string; value?: string | undefined; prop?: string | undefined; }, { component: string; value?: string | undefined; prop?: string | undefined; }>; }, "strip", z.ZodTypeAny, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }, { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; }>, z.ZodObject<{ when: z.ZodObject<{ component: z.ZodString; prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; component: string; }, { value: string; prop: string; component: string; }>; require: z.ZodObject<{ prop: z.ZodString; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; prop: string; }, { value: string; prop: string; }>; }, "strip", z.ZodTypeAny, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }, { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }>]>; }, "strip", z.ZodTypeAny, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }, { rule: { atMost: number; of: { component: string; value?: string | undefined; prop?: string | undefined; }; } | { when: { value: string; prop: string; component: string; }; require: { value: string; prop: string; }; }; inRegion: string; }>; type CompositionAuthoringEntry = z.infer; /** * Lower a fragment's `contract.composition` block to the policy patterns the * rule consumes. The authoring shape ({ inRegion, rule }) and the rule shape * ({ region, select, constraint }) converge here, so fragment-authored and * cloud-delivered constraints reach the rule as one identical config. */ declare function lowerCompositionContract(entries: CompositionAuthoringEntry[] | undefined): CompositionPattern[]; /** * Rules — pure functions over `FactIndex` that return `Finding[]`. * * Phase 5 ships five generic rules. They are content-addressed: scanning the * same source twice produces the same fingerprints, so Cloud can dedupe and * preserve event history. Rules never reach into raw fact arrays — every * lookup goes through `FactIndex`. */ type RuleFn = (ix: FactIndex) => Finding[]; interface Rule { id: string; version: string; run: RuleFn; } declare const RULES: readonly Rule[]; /** * Run every Phase 5 rule and return findings sorted by `(file, line, column, * fingerprint)` so output is stable across runs. */ declare function runRules(ix: FactIndex): Finding[]; /** * Rule helpers — small internal queries shared by Phase 5 rules. * * These live next to the rules instead of on `FactIndex` until they prove * useful for two or more rules. The plan is to lift them onto the index only * when a third caller appears. */ declare function nearestSignedScaleValue(value: number, allowed: readonly number[]): number | null; interface SpacingResolutionScale { name: string; unit: "px" | "rem"; rootFontSizePx?: number; emBasePx?: number; } /** Spacing tokens keyed by their value normalized into a given scale's unit. */ type SpacingTokenLookup = Map; interface CheckedSpacingValue { normalizedValue: number; /** Best-effort suggestion for display, even when no fix is emitted. */ suggestedValue?: string; /** Token name backing suggestedValue, when the canonical token vocabulary has one. */ suggestedToken?: string; /** Whether a fix object should be attached (suggestion reliable enough). */ fixEmittable: boolean; deterministicFix: boolean; /** Dominant reason for the finding — drives message wording. */ reason: "off-scale" | "token-equivalent"; /** Token name when the violation is a raw literal that equals a token. */ matchedToken?: string; assumedRootFontSizePx?: number; assumedEmBasePx?: number; } declare function buildSpacingTokenLookup(tokens: readonly TokenDefinitionFact[], scale: SpacingResolutionScale): SpacingTokenLookup; declare function resolveSpacingValue(input: { raw: string; allowed: readonly number[]; scale: SpacingResolutionScale; tokens: SpacingTokenLookup; bareNumberFix?: boolean; }): CheckedSpacingValue | null; /** * Governance integrity — a pure verdict over a FULLY-resolved governance policy * that answers "is this governance actually armed, or merely declared?". * * The load-bearing distinction is **enabled ≠ armed**. A rule can be `enabled` * in the policy yet inert because it has no vocabulary to measure against: * `components/prefer-library` with no effective canonical source enforces * nothing; `tokens/css-vars-must-be-defined` with an empty token vocabulary * enforces nothing. This module derives, per rule *family*, whether the family * is armed (has both an enabled rule AND the vocabulary/signal it needs), then * rolls those up into a single status. * * Browser-safe and filesystem-free: it never reads the repo. All file-derived * signals (token vocabulary size, whether the css-vars rule is active) are * supplied by the caller, which is also responsible for fully resolving the * policy (merging presets / localCanonical / designSystem / enrichment) BEFORE * calling in. */ type GovernanceIntegrityStatus = "healthy" | "degraded" | "inert"; type GovernanceIntegrityFamilyId = "policy" | "components" | "tokens" | "hygiene" | "blocking-deny"; interface GovernanceIntegrityFamily { id: GovernanceIntegrityFamilyId; armed: boolean; rules: string[]; reason?: string; remediation?: string; } interface GovernanceIntegrityInput { /** * FULLY resolved policy — the caller merges presets / localCanonical / * designSystem / enrichment first. `undefined` means no policy at all. */ policy: GovernanceConfig | undefined; policySource: "config" | "preset" | "fallback" | "none"; /** Any governance intent signal present (caller computes). */ declared: boolean; /** Size of the contract token vocabulary; core cannot read files. */ tokenVocabularySize?: number; /** Whether `tokens/css-vars-must-be-defined` is activated (caller supplies). */ cssVarsActive?: boolean; mode?: "scan" | "ci" | "hook" | "doctor" | "setup"; } interface GovernanceIntegrityVerdict { status: GovernanceIntegrityStatus; declared: boolean; fatalForCi: boolean; blockingCapable: boolean; families: GovernanceIntegrityFamily[]; armed: GovernanceIntegrityFamilyId[]; summary: string; remediations: string[]; } /** * Whether a canonical source contributes an effective component vocabulary. * * Mirrors `sourceIncludesComponent` in `./rules/components-prefer-library.ts` * (a follow-up refactor will make that rule import this): a `directory` source * with no `include` is a wildcard (armed); an explicit `include` must be * non-empty; a package-like `npm`/`registry` source with no `include` is NOT an * effective vocabulary, because it has no export inventory to enumerate. */ declare function isEffectiveCanonicalSource(source: CanonicalSource): boolean; /** * Whether `components/prefer-library`'s effective options carry a real component * vocabulary: at least one canonical mapping, or at least one effective * canonical source. Accepts the raw fact `options` bag (values are `unknown`). */ declare function hasEffectiveComponentVocabulary(options: Record | undefined): boolean; declare function evaluateGovernanceIntegrity(input: GovernanceIntegrityInput): GovernanceIntegrityVerdict; type RawHtmlPrecisionTier = "exact-html" | "html-advisory" | "input-type" | "role-reimpl" | "interactive-nonsemantic" | "icon-only"; interface RawHtmlCanonicalMatch { canonical: string; tier: RawHtmlPrecisionTier; } declare const RAW_HTML_CANONICAL_TAGS: readonly { tagName: string; canonical: string; tier: "exact-html"; }[]; declare const RAW_HTML_ADVISORY_TAGS: readonly { tagName: string; canonical: string; tier: "html-advisory"; }[]; declare const RAW_HTML_INPUT_TYPE_CANONICALS: readonly { type: string; canonical: string; tier: "input-type"; }[]; declare const RAW_HTML_ROLE_CANONICALS: readonly { role: string; canonical: string; tier: "role-reimpl"; }[]; declare function resolveCanonicalForRawHtml(tagName: string, inputType?: string): RawHtmlCanonicalMatch | null; declare function resolveCanonicalForAriaRole(role: string): RawHtmlCanonicalMatch | null; declare function isRawHtmlAdvisoryTier(tier: RawHtmlPrecisionTier): boolean; /** * Decide whether a per-component `htmlEquivalent` mapping (raw `tag` → a * `canonical` component) may drive a bare-tag canonical-usage finding. * * The contract: * - Low-frequency SEMANTIC tags (dialog, select, textarea, input, …) are always * enforceable, so a custom-named component (`` → Modal) still maps. * - Common/ambiguous tags (button, a, …) enforce ONLY when the mapping AGREES * with the framework's curated canonical for that tag — so `