/** * Sends delegated task results to their parent and conversation results to * the caller of each turn. */ import type { TurnCaller } from "#channel/types.js"; import type { RuntimeSubagentChildResult } from "#runtime/actions/types.js"; import type { AgentTurnOutcome } from "#shared/agent-turn-outcome.js"; import type { TokenUsage } from "#shared/token-usage.js"; /** * Resumes the parent driver's hook with a delegated subagent result. * No-op for root sessions. * * `usage` — the completed child's session-total token spend — is * attached to success results so the caller can attribute the * subagent's tokens. Error results never carry usage. */ export declare function notifyDelegatedParentStep(input: { readonly result: RuntimeSubagentChildResult | undefined; readonly serializedContext: Record; readonly usage?: TokenUsage; }): Promise; /** Settled turn payload forwarded from the driver to the caller. */ export interface SettledTurnNotification { readonly output: unknown; readonly isError?: boolean; /** Usage this turn added; omitted (zero) on crash and expiry paths. */ readonly usage?: TokenUsage; } /** * Sends a settled conversation turn to the caller that started it. * * `lifecycle` is the child engine's explicit verdict — `parked` when the * child session survived the turn and can accept another delivery, * `terminal` when it ended with this turn. It is carried on the result as * an {@link AgentTurnOutcome} so the caller never infers lifecycle from * success or error codes. */ export declare function notifyTurnCallerStep(input: { readonly caller: TurnCaller | undefined; readonly lifecycle: AgentTurnOutcome["kind"]; readonly sessionId: string; readonly settled: SettledTurnNotification; }): Promise; /** Resolves the caller that created a delegated conversation session. */ export declare function resolveInitialTurnCallerStep(input: { readonly serializedContext: Record; }): Promise;