import { type RuntimeRecord } from "../domain/records.js"; import { type LinuxProcessIdentity } from "../runtime/process-identity.js"; import { type ConductorNotificationStore } from "./notifications.js"; declare const WAITER_STORE: unique symbol; export type ConductorWaiterState = "armed" | "notified" | "failed" | "superseded"; export type ConductorWaiterPayload = Record & { waiter_id: string; conductor_session_id: string; launch_generation: number; pane_id: string; conductor_process: LinuxProcessIdentity; waiter_process: LinuxProcessIdentity; armed_by: "SessionStart" | "Stop"; armed_at: string; notification_id: string | null; failure_code: string | null; terminal_at: string | null; updated_at: string; }; export type ConductorWaiterRecord = RuntimeRecord; export interface ConductorWaiterStore { readonly [WAITER_STORE]: true; arm(input: ArmConductorWaiterInput): Readonly<{ status: "armed" | "duplicate" | "recovery-required"; record: ConductorWaiterRecord; }>; notify(input: { waiterId: string; waiterProcess: LinuxProcessIdentity; notificationId: string; observedAt: string; }): Readonly<{ status: "notified" | "replayed"; record: ConductorWaiterRecord; }>; fail(input: { waiterId: string; waiterProcess: LinuxProcessIdentity; failureCode: string; observedAt: string; }): Readonly<{ status: "failed" | "replayed"; record: ConductorWaiterRecord; }>; supersedeDead(input: { waiterId: string; expectedVersion: number; observedAt: string; reasonCode: string; }): Readonly<{ status: "superseded" | "replayed"; record: ConductorWaiterRecord; }>; read(waiterId: string): ConductorWaiterRecord; list(sessionId?: string): readonly ConductorWaiterRecord[]; active(sessionId: string): ConductorWaiterRecord | undefined; } export interface ArmConductorWaiterInput { readonly conductorSessionId: string; readonly launchGeneration: number; readonly paneId: string; readonly conductorProcess: LinuxProcessIdentity; readonly waiterProcess: LinuxProcessIdentity; readonly armedBy: "SessionStart" | "Stop"; readonly observedAt: string; } export declare function createConductorWaiterStore(options: { recordsRoot: string; locksRoot: string; packageRoot: string; processIsLive?: (identity: LinuxProcessIdentity) => boolean; }): ConductorWaiterStore; export declare function assertConductorWaiterStore(value: unknown): asserts value is ConductorWaiterStore; export declare function waitForConductorNotification(options: { waiterStore: ConductorWaiterStore; notificationStore: ConductorNotificationStore; arm: ArmConductorWaiterInput; now?: () => string; pause?: () => Promise; shouldStop?: () => boolean; canDeliver?: () => boolean; conductorIsLive?: (identity: LinuxProcessIdentity) => boolean; onNotificationClaimed?: (notificationId: string, observedAt: string) => void; }): Promise>; export {};