Skip to main content

Crate systemprompt_config

Crate systemprompt_config 

Source
Expand description

§systemprompt-config

Profile-based configuration for systemprompt.io. This crate is the bootstrap layer: it loads the active profile YAML, the matching secrets document, and installs both into process-wide singletons before any other layer (database, runtime, agent) starts.

§Public surface

§Errors

All public APIs return ConfigResult<T> (i.e. Result<T, ConfigError>). ConfigError composes the bootstrap, profile, secrets, schema-validation, and lower-level serde/std::io errors via #[from] so callers can use ? transparently.

§Feature flags

This crate has no Cargo features — every dependency is required at compile time. The [package.metadata.docs.rs] section in Cargo.toml enables all-features = true for parity with the rest of the workspace.

Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.

Re-exports§

pub use bootstrap::ENCRYPTION_MASTER_KEY_BYTES;
pub use bootstrap::KeyMaterialError;
pub use bootstrap::MANIFEST_SIGNING_SEED_BYTES;
pub use bootstrap::ProfileBootstrap;
pub use bootstrap::ProfileBootstrapError;
pub use bootstrap::ResolvedSource;
pub use bootstrap::SecretsBootstrap;
pub use bootstrap::SecretsBootstrapError;
pub use bootstrap::SecretsDocument;
pub use bootstrap::SecretsProvider;
pub use bootstrap::VaultAttemptFailure;
pub use bootstrap::VaultError;
pub use bootstrap::VaultKvProvider;
pub use bootstrap::build_loaded_secrets_message;
pub use bootstrap::decode_master_key;
pub use bootstrap::decode_seed;
pub use bootstrap::generate_master_key;
pub use bootstrap::generate_seed;
pub use bootstrap::load_secrets_from_path;
pub use bootstrap::persist_seed;
pub use bootstrap::resolve_source;
pub use error::ConfigError;
pub use error::ConfigResult;
pub use paths::AppPaths;
pub use paths::BuildPaths;
pub use paths::PathError;
pub use paths::StoragePaths;
pub use paths::SystemPaths;
pub use paths::WebPaths;
pub use paths::WritableRoot;
pub use private_file::write_private_atomic;
pub use state_dir::StateDirError;
pub use state_dir::StateDirsError;
pub use state_dir::create_state_dir;
pub use state_dir::ensure_state_dirs_writable;

Modules§

bootstrap
Bootstrap entry points.
error
Public error type for systemprompt-config.
path_validation
Filesystem existence checks for the paths a profile declares.
paths
Filesystem projection of a profile’s paths block.
private_file
Atomic, owner-only file writes for secrets, private keys and tokens.
state_dir
Runtime-state directories must be writable by the server process, checked once before any route or extension initialises.

Structs§

ModelSpec
ProviderCatalogService
ProviderSpec
SecurityChange
SecurityConfigService
SecurityUpdate
SkillConfigValidator

Enums§

ConfigValidationError

Functions§

build_from_profile
generate_schema
resolve_instance_id
try_init_config
validate_config
validate_database_config
validate_yaml_file
validate_yaml_str