SwarmOptions
Interface: SwarmOptions
Defined in: src/patterns/Swarm.ts:35
Properties
agents
readonlyagents: readonlySwarmAgent[]
Defined in: src/patterns/Swarm.ts:40
The fixed agent roster. Must contain >= 2 agents. The order doesn't
matter — the route function selects by id.
id?
readonlyoptionalid?:string
Defined in: src/patterns/Swarm.ts:51
maxHandoffs?
readonlyoptionalmaxHandoffs?:number
Defined in: src/patterns/Swarm.ts:49
Max hand-offs before the loop halts. Default 10.
name?
readonlyoptionalname?:string
Defined in: src/patterns/Swarm.ts:50
route
readonlyroute: (input) =>string|undefined
Defined in: src/patterns/Swarm.ts:47
Routing function — receives the current message and returns the
selected agent's id. Pure sync; evaluated before each iteration's
chosen agent runs. Return undefined or an unknown id to halt
the swarm (the loop's until guard fires).
Parameters
input
message
string
Returns
string | undefined
