Skip to main content

pair_ai_agent_in

Function pair_ai_agent_in 

Source
pub fn pair_ai_agent_in(
    library: &mut Library,
    network: &Network,
    code: &PairingCode,
    (name, spaces): (&str, &[SpaceId]),
    showing: Showing<'_>,
    now: &dyn Fn() -> u64,
    rng: &mut impl CryptoRng,
) -> Result<Paired, NodeError>
Expand description

Pairs a new replica of an AI agent as pair_ai_agent does, and lists it in spaces too, besides the personal one, as the person chose (technical design: sharing): its key signs its listing in each as it joins, and it takes each from the personal space, which gives it their first keys. A shared space must allow AI agents, which an admin’s replica says, if it does not yet, once the AI agent’s replica has joined. The AI agent’s replica gets no other space; it is paired anew to change them.

§Errors

Returns the errors of pair_ai_agent; and, before the code is shown, NodeError::NeverShared for a space without members, NodeError::NotListed for one this replica is not listed in, and NodeError::AiAgentsNotAllowed for one that allows no AI agents, where this replica’s member is no admin.