systemprompt-identifiers 0.2.2

Typed newtype identifiers (UserId, TraceId, AgentId, McpServerId…) for systemprompt.io AI governance infrastructure. Enforces type-safe IDs across every boundary in the MCP governance pipeline.
Documentation
crate::define_id!(UserId, schema);

impl UserId {
    pub fn anonymous() -> Self {
        Self("anonymous".to_string())
    }

    pub fn system() -> Self {
        Self("system".to_string())
    }

    pub fn is_system(&self) -> bool {
        self.0 == "system"
    }

    pub fn is_anonymous(&self) -> bool {
        self.0 == "anonymous"
    }
}