skrills_state/lib.rs
1//! Manages application state and configuration.
2//!
3//! This crate provides utilities for:
4//! - Reading environment variables for configuration.
5//! - Handling manifest settings and runtime overrides.
6//! - Network status detection for offline/cached mode.
7//! - Validation result caching for offline operation.
8//!
9//! Note: Legacy pin/history/autoload persistence was removed in 0.3.1
10//! as skill loading is now handled by Claude/Codex directly.
11//!
12//! # Examples
13//!
14//! ```
15//! use skrills_state::{cache_ttl, ManifestSettings};
16//!
17//! let ttl = cache_ttl(&|| Ok(ManifestSettings::default()));
18//! assert!(ttl.as_millis() > 0);
19//! ```
20
21#![deny(unsafe_code)]
22#![warn(missing_docs)]
23
24/// Error type for state operations.
25pub type Error = anyhow::Error;
26/// Result type for state operations.
27pub type Result<T> = std::result::Result<T, Error>;
28
29/// Environment and configuration utilities.
30pub mod env;
31
32/// Validation result caching for offline mode.
33pub mod cache;
34
35/// Network status detection.
36pub mod network;
37
38pub use cache::{
39 content_hash, human_age, staleness_indicator, CachedValidation, Staleness, ValidationCache,
40};
41pub use env::{
42 cache_ttl, env_auto_persist, env_diag, env_include_claude, env_include_marketplace,
43 extra_dirs_from_env, home_dir, load_manifest_settings, manifest_file, runtime_overrides_path,
44 ManifestSettings,
45};
46pub use network::{check_connectivity, is_online, NetworkStatus};