systemprompt-models 0.6.1

Foundation data models for systemprompt.io AI governance infrastructure. Shared DTOs, config, and domain types consumed by every layer of the MCP governance pipeline.
Documentation
//! Parsing-layer error types: enum tag dispatch and config bootstrap.

#[derive(Debug, Clone, thiserror::Error, PartialEq, Eq)]
#[error("invalid {kind}: {value}")]
pub struct ParseEnumError {
    pub kind: &'static str,
    pub value: String,
}

impl ParseEnumError {
    #[must_use]
    pub fn new(kind: &'static str, value: impl Into<String>) -> Self {
        Self {
            kind,
            value: value.into(),
        }
    }
}

#[derive(Debug, Clone, Copy, thiserror::Error)]
pub enum ConfigError {
    #[error("Config not initialized. Call Config::init() first.")]
    NotInitialized,

    #[error("DATABASE_URL must be a PostgreSQL connection string (postgres:// or postgresql://)")]
    InvalidPostgresUrl,
}