/** * Subagent runtime — turns the SDK's `SubagentSpawner` interface into a * working factory that spawns child modes sharing the parent Session's * registries. * * Each child gets: * - Its own `EventLog` (isolated history, no cross-talk). * - Its own `sessionId` + `turnId` (so hooks / tool ctxs see distinct ids). * - The parent's providers, tools (optionally filtered), skills, permissions, * plugin host, and abort signal. * * As the child runs, this module streams its events into the parent's log * as `plugin_event` records with `subagent_*` subtypes — so the TUI, JSON * exporters, and other subscribers see live progress without waiting for * the child's final message. The captured final assistant message is * returned to the spawner caller via the `SubagentResult`. * * A child spawned with `retainSession: true` keeps its log + context alive in * the {@link RetainedChildSession} registry so `continue()` can append an * operator reply and run it again — the workflow `awaitInput` pause/resume * flow. `subagent_completed` is deferred until that follow-up turn (or a * `release()`). */ import type { SessionId, SubagentResult, SubagentSpawner, SubagentSpec, ToolRegistry, TurnId } from '@moxxy/sdk'; import type { SessionRuntime } from '../session-runtime.js'; export interface SubagentRuntime { readonly parentSession: SessionRuntime; readonly parentTurnId: TurnId; readonly parentSignal: AbortSignal; readonly parentModel: string; /** The tools the parent turn may use, when it may not use all of the session's (an @ mention withheld some). */ readonly parentTools?: ToolRegistry; } export declare function runChildTurn(args: { rt: SubagentRuntime; spec: SubagentSpec; retainSession: boolean; }): Promise; export declare function continueChildTurn(args: { childSessionId: SessionId; prompt: string; label?: string; }): Promise; export declare function createSubagentSpawner(rt: SubagentRuntime): SubagentSpawner; //# sourceMappingURL=run-child.d.ts.map