schema-embed 0.8.20

Embedded JSON Schemas for yah's TOML manifest types (camp/machine/mirror/provider/service/workload). Distributed inside the yah binary so consumers don't fetch them at runtime.
//! Embedded JSON Schemas for yah's TOML manifests.
//!
//! Each constant is the byte-for-byte contents of the corresponding file in
//! `<workspace>/.yah/schema/`. Five of the six (machine/mirror/provider/
//! service/workload) are kept fresh by [`xtask::schemas`] and a drift test
//! at `xtask/tests/schema_drift.rs`; `camp.toml.schema.json` is hand-
//! authored and predates the xtask pipeline.
//!
//! Consumers (e.g. `yah skills install`, the desktop attach path, the
//! `yah schema sync` CLI command) write these into each project's
//! `.yah/schema/` so TOML-LSP can resolve the `#:schema ./schema/...`
//! directives at the top of each manifest. The yah binary is the source of
//! truth — per-project copies are derived artifacts.

/// Filename + body for every schema yah ships, in stable order.
pub const SCHEMAS: &[(&str, &str)] = &[
    ("camp.toml.schema.json", CAMP),
    ("machine.toml.schema.json", MACHINE),
    ("mirror.toml.schema.json", MIRROR),
    ("provider.toml.schema.json", PROVIDER),
    ("service.toml.schema.json", SERVICE),
    ("workload.toml.schema.json", WORKLOAD),
];

pub const CAMP: &str = include_str!("../../../../.yah/schema/camp.toml.schema.json");
pub const MACHINE: &str = include_str!("../../../../.yah/schema/machine.toml.schema.json");
pub const MIRROR: &str = include_str!("../../../../.yah/schema/mirror.toml.schema.json");
pub const PROVIDER: &str = include_str!("../../../../.yah/schema/provider.toml.schema.json");
pub const SERVICE: &str = include_str!("../../../../.yah/schema/service.toml.schema.json");
pub const WORKLOAD: &str = include_str!("../../../../.yah/schema/workload.toml.schema.json");

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn schemas_table_is_complete_and_nonempty() {
        assert_eq!(SCHEMAS.len(), 6, "expected six embedded schemas");
        for (name, body) in SCHEMAS {
            assert!(name.ends_with(".toml.schema.json"), "{name} missing suffix");
            assert!(!body.is_empty(), "{name} is empty");
            assert!(body.contains("\"$schema\""), "{name} missing $schema key");
        }
    }
}