import { RunFlightLedger, type ChildFlightState } from "./run-flight-ledger.js"; import { type ChildTerminalIdentity, type ChildTerminalObservation, type ChildTerminalEvidence } from "./child-terminal-reconciliation.js"; export declare const DEFAULT_CHILD_DEADLINE_MS: number; export declare const DEFAULT_CHILD_CHECK_WAIT_MS = 5000; export interface ChildLifecycleDescriptor { readonly identity: ChildTerminalIdentity; readonly deadline_ms: number; } export interface ChildLifecycleRuntime { observe(): Promise<{ observation: ChildTerminalObservation; evidence: ChildTerminalEvidence; }>; /** Optional host policy entry. A terminal result means the same lifecycle completed a live takeover. */ takeover?(): Promise; /** Resolves only after the host's normal process-tree stop request has completed. */ stop(): Promise; release(): Promise; terminal(state: ChildFlightState): Promise; } export type ChildLifecycleResult = { status: "terminal"; state: ChildFlightState; } | { status: "waiting"; reason: string; }; export interface ChildLifecycleOptions { readonly checkWaitMs?: number; } /** One lifecycle for implementation, diagnosis, and escalation; the host retains process ownership. */ export declare class CancellableChildLifecycle { #private; readonly descriptor: ChildLifecycleDescriptor; readonly ledger: RunFlightLedger; readonly runtime: ChildLifecycleRuntime; readonly checkWaitMs: number; private constructor(); static open(descriptor: ChildLifecycleDescriptor, ledger: RunFlightLedger, runtime: ChildLifecycleRuntime, options?: ChildLifecycleOptions): Promise; get stopping(): boolean; arm(): void; dispose(): void; check(explicitCancellation?: boolean): Promise; /** Live takeover uses the same bounded stop/release path, but must name the currently registered attempt. */ stopForTakeover(identity: ChildTerminalIdentity): Promise; }