import type { CommandMessage, ChildSessionVerdict, SubAgentEntry } from "../types.js"; import { type DurableSessionRuntime, type PendingShutdownState, type ShutdownMode } from "./state.js"; export type { PendingShutdownState, ShutdownMode }; export declare function isSubAgentTerminalStatus(status?: string): boolean; /** Preserve child answers when a status probe only has orchestration exit output. */ export declare function getChildResultFromStatus(child: { result?: unknown; resultSource?: string; }, previous?: string): string | undefined; /** * A status that satisfies a parent's wait: the child either finished * (terminal) or will never speak again on its own — idle after answering, or * blocked asking for input. "running" and "waiting" (child on a timer) stay * pending: those children will still act without help. Without the idle * mapping a wait_for_agents parent polls an idle child forever (observed * live: 70+ minutes of 30s polls until a human poked). */ export declare function isAgentWaitSettledStatus(status?: string): boolean; export declare function parseChildUpdate(promptText?: string): { sessionId: string; updateType: string; content: string; cycleOrigin?: "cron" | "cron_at"; cycleStatus?: "quiet" | "material" | "blocked"; verdict?: ChildSessionVerdict; } | null; export declare function defaultShutdownReason(mode: ShutdownMode): string; export declare function buildShutdownWaitReason(shutdown: PendingShutdownState): string; export declare function findTrackedAgentByOrchId(subAgents: SubAgentEntry[], orchId: string): SubAgentEntry | undefined; export declare function areTrackedAgentsTerminal(subAgents: SubAgentEntry[], agentIds: string[]): boolean; export declare function getStillRunningAgentIds(subAgents: SubAgentEntry[], agentIds: string[]): string[]; export declare function buildWaitForAgentsFollowup(subAgents: SubAgentEntry[], targetIds: string[]): string; export declare function buildSubAgentSystemMessage(options: { parentSessionId: string; childNestingLevel: number; maxNestingLevel: number; agentTask: string; agentIsSystem: boolean; parentSystemMessage: string; }): string; export declare function applyChildUpdate(runtime: DurableSessionRuntime, update: { sessionId: string; updateType: string; content: string; }): Generator; export declare function refreshTrackedSubAgents(runtime: DurableSessionRuntime, options?: { preserveTerminalTaskStatus?: boolean; }): Generator; export declare function notifyParentOfTerminalState(runtime: DurableSessionRuntime, updateType: "completed" | "cancelled", reason: string, commandId?: string, requestedBy?: string): Generator; export declare function completeSession(runtime: DurableSessionRuntime, reason: string, commandId?: string, requestedBy?: string): Generator; export declare function cancelSession(runtime: DurableSessionRuntime, reason: string, commandId?: string, deleteAfterCancel?: boolean, requestedBy?: string): Generator; export declare function failPendingShutdown(runtime: DurableSessionRuntime, errorMessage: string): Generator; /** * Best-effort cancel of a distiller SERVICE SESSION still running when its * regen is torn down (cancel_regen, a pre-flip failure, or the served session * shutting down). Without this the distiller finishes its LLM turn then parks * idle forever — the sweeper never reclaims a LIVE session, so each abort leaks * one (adversarial-review finding). The cancel is a queued cmd (the activity * swallows its own errors), so it is safe to yield from any teardown path. */ export declare function cancelInFlightDistiller(runtime: DurableSessionRuntime): Generator; export declare function finalizePendingShutdown(runtime: DurableSessionRuntime): Generator; export declare function maybeResolveAgentWaitCompletion(runtime: DurableSessionRuntime): Generator; export declare function beginGracefulShutdown(runtime: DurableSessionRuntime, mode: ShutdownMode, cmdMsg: CommandMessage): Generator; export declare function handleSubAgentAction(runtime: DurableSessionRuntime, result: any): Generator; //# sourceMappingURL=agents.d.ts.map