Skip to main content

validate_target

Function validate_target 

Source
pub fn validate_target<'a>(
    inventory: &'a AgentInventory,
    target_id: &str,
) -> Result<&'a AgentEntry, ValidationError>
Expand description

Validates a /tell target against the inventory.

Returns the matching AgentEntry (matching either slug or slash form), or a ValidationError::UnknownTarget carrying the candidate list so the caller can echo the available agents back to the user. This is the shared helper of design D6 — public so consumers outside the supervisor module can reuse the same validation semantics.

§Errors

Returns ValidationError::UnknownTarget when no entry matches.