Skip to main content

Module spawn

Module spawn 

Source
Expand description

Spawn block: starts a worker of one agent with a brief (the Drone real-world jobs spec §4.2).

Block config (node.data):

  • leader required, the agent the worker is of: its id, slug or name. Written in the graph, never a {{reference}}: a value from outside must not pick who spends (§6.2).
  • brief required, the worker’s task. The graph’s words stay as written; every {{...}} value is put in as quoted data (§6.2), after a standing line saying so.
  • model optional, the worker’s model. Graph-only, like leader.
  • account optional, the account it runs on. Graph-only, like leader.

It goes through the path an agent’s own spawn takes, so the leader must be running, a worker can not be a leader, at most MAX_LIVE_WORKERS are open at once, and unless the person’s settings let agents start agents they are shown a card with a countdown first.

Output: { "spawned": true, "agent_id": "<id>", "name": "<name>", "message_to": "<slug>", "block_id": "<pane>", "asked_user": bool }.

Structs§

SpawnSpec 🔒
What the block starts.

Functions§

compose 🔒
The leader, brief, model and account the block starts a worker with. Pure, so the checks and the quoting are testable without a server.
fixed 🔒
A graph-only text field: trimmed, empty when absent, never a {{reference}}.
pick_leader 🔒
The agent name means: its id, else its slug or its name (not minding case). More than one by name is refused, since a worker must not start under the wrong leader.
run