{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://signalxjs.github.io/zero/schemas/lynx-manifest.schema.json",
    "title": "SignalX Zero design-system manifest \u2014 lynx target envelope",
    "description": "The manifest the lynx target ships as dist/lynx/manifest.json (written by @sigx/zero-kit's writeLynxArtifacts): the SAME content as dist/manifest.json \u2014 one design system, one truth about its themes, token vocabulary and wired axes \u2014 under an envelope that says how this copy is delivered: target 'lynx', the class-grammar version the emitted selectors speak (a runtime refuses CSS from a grammar it does not know), and the capability-finding counts (the findings themselves live in report.json under 'lynx'). Everything except the envelope is derived mechanically from ds-manifest.schema.json; the schemas test pins the derivation.",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "$schema",
        "manifestVersion",
        "zeroVersion",
        "name",
        "themes",
        "tokens",
        "components",
        "target",
        "classGrammarVersion",
        "capabilities"
    ],
    "properties": {
        "$schema": {
            "description": "Self-reference to this schema \u2014 the emitter always writes exactly this URL.",
            "const": "https://signalxjs.github.io/zero/schemas/lynx-manifest.schema.json"
        },
        "manifestVersion": {
            "description": "The version of THIS FILE's shape. Bumped when the manifest contract changes incompatibly; consumers hard-check it rather than sniffing keys.",
            "const": 1
        },
        "zeroVersion": {
            "description": "The @sigx/zero contract version the design system was compiled against (lockstep with @sigx/zero-kit).",
            "type": "string",
            "minLength": 1
        },
        "name": {
            "description": "The design system's own name, as declared to defineDesignSystem.",
            "type": "string",
            "minLength": 1
        },
        "themes": {
            "description": "The compiled themes \u2014 names, color-scheme, light/dark pairing and the swatch a picker samples.",
            "type": "array",
            "items": {
                "$ref": "#/$defs/theme"
            },
            "minItems": 1
        },
        "tokens": {
            "description": "The DECLARED token vocabulary \u2014 what the design system says, as opposed to components[*], which is what its recipes deliver.",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "roles",
                "sizes",
                "variants",
                "axes",
                "modifiers",
                "scopes",
                "custom",
                "breakpoints",
                "system",
                "systemDark",
                "properties"
            ],
            "properties": {
                "roles": {
                    "description": "Color roles: role name \u2192 declaration ({} = full role with -content and -soft). Doubles as the `color` axis vocabulary; empty for a design system with no colour axis.",
                    "type": "object",
                    "propertyNames": {
                        "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
                    },
                    "additionalProperties": {
                        "$ref": "#/$defs/roleDecl"
                    }
                },
                "sizes": {
                    "description": "The `size` axis ramp, resolved (declared, else the recommended ramp); [] when declared out of existence.",
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/kebabToken"
                    }
                },
                "variants": {
                    "description": "The `variant` axis vocabulary \u2014 the UNION of every scope's vocabulary once tokens.scopes restricts any ([] when undeclared).",
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/kebabToken"
                    }
                },
                "axes": {
                    "description": "Declared custom variant axes: axis name \u2192 values.",
                    "type": "object",
                    "propertyNames": {
                        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
                    },
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "$ref": "#/$defs/kebabToken"
                        }
                    }
                },
                "modifiers": {
                    "description": "Declared presence-only modifiers (rendered data-mod-<name>).",
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/kebabToken"
                    }
                },
                "scopes": {
                    "description": "Per-scope restrictions of the vocabularies above (#294; docs/architecture.md, \"Declared vocabulary\") \u2014 scope \u2192 its own vocabulary subset. {} when none are declared.",
                    "type": "object",
                    "propertyNames": {
                        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
                    },
                    "additionalProperties": {
                        "type": "object"
                    }
                },
                "custom": {
                    "description": "Free-form custom token declarations, as authored.",
                    "type": "object"
                },
                "breakpoints": {
                    "description": "Declared breakpoint names \u2192 CSS lengths.",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "system": {
                    "description": "DS-level values per token category id (radius, size, typography, \u2026), as authored.",
                    "type": "object"
                },
                "systemDark": {
                    "description": "Overrides applied to dark-scheme themes.",
                    "type": "object"
                },
                "properties": {
                    "description": "Every custom property the compiled tokens.css emits, flat and sorted.",
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "^--"
                    }
                }
            }
        },
        "components": {
            "description": "Scope \u2192 the axis vocabulary that scope's recipe actually WIRES (plus, when tokens.scopes restricts it, what the scope offers). A scope absent here has no recipe in this design system.",
            "type": "object",
            "propertyNames": {
                "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
            },
            "additionalProperties": {
                "$ref": "#/$defs/componentAxes"
            }
        },
        "api": {
            "description": "Scope \u2192 the vendor-named API surface \u2014 present iff the design system declares an `api` (issue #179).",
            "type": "object",
            "propertyNames": {
                "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
            },
            "additionalProperties": {
                "type": "object"
            }
        },
        "target": {
            "description": "The emit target this copy was compiled for.",
            "const": "lynx"
        },
        "classGrammarVersion": {
            "description": "The class grammar version the emitted selectors speak (zx-<scope>__<part> et al). A runtime checks it before trusting the stylesheet.",
            "const": 1
        },
        "capabilities": {
            "description": "Counts of capability findings \u2014 what the lynx emitters translated or dropped. The findings themselves live in report.json under 'lynx'.",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "translated",
                "dropped"
            ],
            "properties": {
                "translated": {
                    "type": "integer",
                    "minimum": 0
                },
                "dropped": {
                    "type": "integer",
                    "minimum": 0
                }
            }
        }
    },
    "$defs": {
        "kebabToken": {
            "description": "A kebab-case identifier that may start with a digit \u2014 the grammar for axis values and token keys.",
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
        },
        "roleDecl": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "content": {
                    "type": "boolean"
                },
                "soft": {
                    "type": "boolean"
                },
                "description": {
                    "type": "string"
                }
            }
        },
        "theme": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "name",
                "colorScheme",
                "swatch"
            ],
            "properties": {
                "name": {
                    "$ref": "#/$defs/kebabToken"
                },
                "colorScheme": {
                    "enum": [
                        "light",
                        "dark"
                    ]
                },
                "pair": {
                    "description": "The counterpart theme toggle() switches to.",
                    "$ref": "#/$defs/kebabToken"
                },
                "swatch": {
                    "description": "Representative colors for pickers: token \u2192 CSS color.",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                }
            }
        },
        "axisValues": {
            "type": "array",
            "items": {
                "$ref": "#/$defs/kebabToken"
            }
        },
        "componentAxes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "color",
                "size",
                "variant",
                "axes",
                "mods"
            ],
            "properties": {
                "color": {
                    "$ref": "#/$defs/axisValues"
                },
                "size": {
                    "$ref": "#/$defs/axisValues"
                },
                "variant": {
                    "$ref": "#/$defs/axisValues"
                },
                "axes": {
                    "description": "Custom axes this recipe wires: axis name \u2192 values.",
                    "type": "object",
                    "propertyNames": {
                        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
                    },
                    "additionalProperties": {
                        "$ref": "#/$defs/axisValues"
                    }
                },
                "mods": {
                    "$ref": "#/$defs/axisValues"
                },
                "defaults": {
                    "description": "The recipe's defaultVariants \u2014 manifest/docs only, never widens a union.",
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/$defs/kebabToken"
                    }
                },
                "offered": {
                    "description": "The vocabulary this scope OFFERS (its tokens.scopes entry, resolved) \u2014 the promise, where the sibling fields are the delivery.",
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "color": {
                            "$ref": "#/$defs/axisValues"
                        },
                        "size": {
                            "$ref": "#/$defs/axisValues"
                        },
                        "variant": {
                            "$ref": "#/$defs/axisValues"
                        },
                        "axes": {
                            "type": "object",
                            "additionalProperties": {
                                "$ref": "#/$defs/axisValues"
                            }
                        },
                        "mods": {
                            "$ref": "#/$defs/axisValues"
                        }
                    }
                }
            }
        }
    }
}
