Skip to main content

build_agent

Function build_agent 

Source
pub fn build_agent(
    world: &mut World,
    deps: SpawnDeps<'_>,
    args: &SpawnArgs,
) -> Result<Entity, String>
Expand description

Load the blueprint at args.blueprint_path, spawn the agent into world, register its tool state, and return the new entity. Operates on the raw ECS World so it is callable both from the host’s spawner (via PipelineWorld::world_mut) and from a fan-out world-system.

Enforces the required-at-spawn region gate - a fresh spawn whose required caller-input regions weren’t provided fails here. Use build_agent_for_reload on the recovery path, where the window is restored from a snapshot afterward and the gate must not re-fire.