Skip to content

pf_types

Lightweight naming and validation primitives for the PromptFleet agent ecosystem.

This crate provides [AgentSlug] (the canonical tenant:space:agent address) and name normalisation helpers. It has no runtime dependencies beyond thiserror and optional serde — intentionally kept small so WASM agents and third-party integrations can depend on it without pulling in cloud platform concerns.

Methods

fn canonical(&self) -> &str
fn into_string(self) -> String
fn from_canonical(input: &str) -> Result<Self, TypeError>
fn from_names(tenant: &str, space: &str, agent: &str) -> Result<Self, TypeError>
fn to_subject(&self) -> String
fn from_subject(subject: &str) -> Result<Self, TypeError>

Variants

VariantDescription
InvalidSlugSegment { ... }
InvalidSubject(String)
fn normalize_name(input: &str) -> Result<String, TypeError>

Normalize a name segment to a K8s-label-safe, lowercase string.

Public so downstream crates can apply the same normalisation rules.