export declare const HOST_LIFECYCLE_INTERVAL_MS = 5000; export type HostLifecycleSweepReason = "startup" | "periodic"; export interface HostLifecyclePhaseContext { reason: HostLifecycleSweepReason; } export interface HostLifecyclePhase { name: string; run(context: HostLifecyclePhaseContext): Promise | void; } export interface HostLifecyclePhaseError { phase: string; reason: HostLifecycleSweepReason; error: unknown; } /** * Schedule one deferred callback and return a function that cancels it. * * A host may use this seam to choose whether the underlying timer is ref'ed or * unref'ed. The default scheduler uses a normal ref'ed Node.js timer. */ export type HostLifecycleSchedule = (callback: () => void, delayMs: number) => () => void; export interface HostLifecycleServiceOptions { intervalMs?: number; phases: readonly HostLifecyclePhase[]; onPhaseError(error: HostLifecyclePhaseError): void; schedule?: HostLifecycleSchedule; } export interface HostLifecycleService { start(): void; stop(): Promise; } /** * Run host-owned AKK reconciliation for as long as the embedding host is live. * * The service owns no process, Store, callback transport, or host configuration. * Its phases are compile-time injected by the host adapter and run sequentially * with independent error boundaries. */ export declare function createHostLifecycleService(options: HostLifecycleServiceOptions): HostLifecycleService;