/** * Earliest sign that a session is about to spawn subagents: its model is * streaming spawning tool calls. Main-thread sessions feed their streamed * assistant events here and, whenever the expected number of spawns grows, * let the worker pool start a worker those spawns will need * (`prewarmSubagentWorker`), so it boots while the arguments are still * streaming instead of after dispatch. * * Spawning calls: a `task` call (one spawn from its first event, then one per * `tasks[]` item whose opening brace has streamed), and an `eval` call once its streamed code * mentions `agent(` or `workpool(` (the eval subagent helpers; most cells never * spawn, so the name alone is no signal; counted as one spawn). */ import type { AssistantMessageEvent } from "@oh-my-pi/pi-ai"; /** Per-message counter of spawns its streaming tool calls are about to make; see the module doc. */ export declare class SubagentSpawnSignal { #private; /** * Feed one streamed assistant event; returns the number of spawns the message's tool * calls are expected to make whenever it grows, else `undefined`. */ observe(event: AssistantMessageEvent): number | undefined; }