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.
Structs
Section titled “Structs”AgentSlug
Section titled “AgentSlug”Methods
canonical
Section titled “canonical”fn canonical(&self) -> &strinto_string
Section titled “into_string”fn into_string(self) -> Stringfrom_canonical
Section titled “from_canonical”fn from_canonical(input: &str) -> Result<Self, TypeError>from_names
Section titled “from_names”fn from_names(tenant: &str, space: &str, agent: &str) -> Result<Self, TypeError>to_subject
Section titled “to_subject”fn to_subject(&self) -> Stringfrom_subject
Section titled “from_subject”fn from_subject(subject: &str) -> Result<Self, TypeError>TypeError
Section titled “TypeError”Variants
| Variant | Description |
|---|---|
InvalidSlugSegment { ... } | |
InvalidSubject(String) |
Functions
Section titled “Functions”normalize_name
Section titled “normalize_name”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.