domainforge-core 0.20.0

Rust core library implementing the SEA DSL primitives and validation engine.
Documentation
use clap::{Parser, Subcommand, ValueEnum};

pub mod authority;
pub mod contract;
pub mod envelope;
pub mod format;
pub mod import;
pub mod normalize;
pub mod pack;
pub mod parse;
pub mod project;
pub mod registry;
pub mod test;
pub mod validate;
pub mod validate_kg;

#[derive(Parser)]
#[command(name = "domainforge", version, about = "SEA DSL CLI")]
pub struct Cli {
    #[command(subcommand)]
    pub command: Commands,

    #[arg(long, global = true, conflicts_with = "quiet")]
    pub verbose: bool,

    #[arg(long, global = true, conflicts_with = "verbose")]
    pub quiet: bool,

    #[arg(long, global = true, value_enum, default_value_t = ColorChoice::Auto)]
    pub color: ColorChoice,
}

#[derive(Subcommand)]
pub enum Commands {
    /// Parse SEA files and output AST or Graph
    Parse(parse::ParseArgs),
    /// Validate SEA files
    Validate(validate::ValidateArgs),
    /// Import from other formats
    Import(import::ImportArgs),
    /// Project/Export to other formats
    Project(project::ProjectArgs),
    /// Format SEA files
    #[command(name = "format", alias = "fmt")]
    Format(format::FormatArgs),
    /// Run tests
    Test(test::TestArgs),
    /// Validate Knowledge Graph files
    #[command(name = "validate-kg")]
    ValidateKg(validate_kg::ValidateKgArgs),
    /// Normalize a policy expression
    Normalize(normalize::NormalizeArgs),
    /// Registry management commands
    Registry(registry::RegistryArgs),
    /// Evaluate authority decisions
    Authority(authority::AuthorityArgs),
    /// Semantic pack management commands
    Pack(pack::PackArgs),
    /// Resolve and print the Application Contract document
    Contract(contract::ContractArgs),
    /// Resolve and print the Canonical Semantic Envelope document
    Envelope(envelope::EnvelopeArgs),
}

#[derive(ValueEnum, Clone, Debug, Copy)]
pub enum ColorChoice {
    Auto,
    Always,
    Never,
}