winbrew_models/
lib.rs

1//! Typed model contracts for the Winbrew workspace.
2//!
3//! `winbrew-models` owns the stable Rust data types shared by the parser,
4//! storage, engines, UI, and CLI layers. The crate is intentionally split into
5//! a small set of domain families so consumers can import the exact concept
6//! they need without depending on a broad compatibility surface.
7//!
8//! Public namespaces:
9//!
10//! - `shared`: errors, validation, identifiers, config, hash, deployment, and version
11//! - `package`: package identity, queries, dependencies, and package aggregates
12//! - `catalog`: typed catalog records and raw upstream catalog payloads
13//! - `command_resolution`: command exposure results, confidence, provenance, and fingerprinting
14//! - `install`: installer metadata, engine receipts, installed state, and removal planning
15//! - `reporting`: diagnostics, health reports, and recovery findings
16//! - `msi_inventory`: MSI snapshot records used for repair and inventory persistence
17//!
18//! The `domains` facade remains as the stable grouping layer for downstream
19//! callers. Inside this crate, prefer the owning module paths; outside the
20//! crate, prefer `crate::domains::...` when a grouped namespace is clearer than
21//! a direct module path.
22
23pub mod catalog;
24pub mod command_resolution;
25pub mod install;
26pub mod msi_inventory;
27pub mod package;
28pub mod reporting;
29pub mod shared;
30
31/// Grouped namespace for the major model families.
32pub mod domains {
33    pub mod shared {
34        pub use crate::shared::config::{ConfigSection, ConfigValue, ConfigValueSource};
35        pub use crate::shared::deployment::DeploymentKind;
36        pub use crate::shared::error::ModelError;
37        pub use crate::shared::hash::HashAlgorithm;
38        pub use crate::shared::identifiers::{BucketName, CatalogId, PackageName};
39        pub use crate::shared::validation::Validate;
40        pub use crate::shared::version::Version;
41    }
42
43    pub mod package {
44        pub use crate::package::dependency::Dependency;
45        pub use crate::package::model::{Package, PackageKind, PackageSource};
46        pub use crate::package::query::PackageQuery;
47        pub use crate::package::reference::{PackageId, PackageRef};
48        pub use crate::shared::identifiers::PackageName;
49    }
50
51    pub mod catalog {
52        pub use crate::catalog::installer_type::CatalogInstallerType;
53        pub use crate::catalog::metadata::CatalogMetadata;
54        pub use crate::catalog::package::{CatalogInstaller, CatalogPackage};
55        pub use crate::catalog::raw::{RawCatalogInstaller, RawCatalogPackage};
56    }
57
58    pub mod command_resolution {
59        pub use crate::command_resolution::{
60            CatalogFingerprintError, CommandSource, Confidence, ResolverResult, UnresolvedReason,
61            VersionScope, catalog_fingerprint, resolve_command_exposure,
62        };
63    }
64
65    pub mod installed {
66        pub use crate::install::installed::{InstalledPackage, PackageStatus};
67    }
68
69    pub mod install {
70        pub use crate::install::engine::{
71            EngineInstallReceipt, EngineKind, EngineMetadata, InstallScope,
72        };
73        pub use crate::install::installer::{Architecture, Installer, InstallerType};
74        pub use crate::install::model::{InstallFailureClass, InstallOutcome, InstallResult};
75        pub use crate::install::removal::RemovalPlan;
76    }
77
78    pub mod reporting {
79        pub use crate::reporting::diagnostics::{DiagnosisResult, DiagnosisSeverity};
80        pub use crate::reporting::info::InfoReport;
81        pub use crate::reporting::report::{
82            HealthReport, HealthScanTimings, RecoveryActionGroup, RecoveryFinding,
83            RecoveryIssueKind, ReportSection, RuntimeReport,
84        };
85    }
86
87    pub mod inventory {
88        pub use crate::msi_inventory::records::{
89            MsiComponentRecord, MsiFileRecord, MsiInventoryReceipt, MsiInventorySnapshot,
90            MsiRegistryRecord, MsiShortcutRecord,
91        };
92    }
93}