/** Only the named, installed profile may be restarted. Model input never reaches an OS command. */ export interface RestartSupervisorConfig { dshHome: string; profile: string; databasePath: string; deliveryDatabasePath: string; policyDatabasePath: string; automationDatabasePath: string; policyEvaluatorPath: string; unit: string; expectedUnitDigest: string; profilePatchDigest: string; cohortReceiptDigest: string; sourceCommit: string; trustedFiles: readonly { path: string; digest: string; }[]; policyRules: readonly Record[]; restartOwnerRouteId: string; hostBindingDigest: string; hostReceiptPath: string; hostReceiptSourceDigest: string; readyTimeoutMs: number; stableWindowMs: number; maxRestarts: number; windowMs: number; } export interface RestartCandidate { id: string; inboxId: string; sourceInvocationId: string; status: string; updatedAt: number; } export interface RestartTaskAuthority { inboxId: string; eventId: string; sourceInvocationId: string; deadline: number; binding: { id: string; version: number; generation: number; sessionId: string; workspace: string; preset: string; policyRef: string; authorityHash: string; conversation: { channel: string; account: string; tenant: string; kind: string; chat: string; thread?: string; }; principal: { channel: string; account: string; tenant: string; user: string; }; }; owner: { principalRecordId: string; principalVersion: number; }; } /** The sidecar Store must implement these CAS operations with WAL and FULL sync. */ export interface RestartSupervisorLedger { listRequests(input: { statuses: readonly ('ready' | 'restarting')[]; limit: number; }): readonly RestartCandidate[]; getTask(inboxId: string): RestartTaskAuthority | undefined; countDispatchedSince(sinceMs: number): number; claimRestart(id: string, input: { holderId: string; invocationId: string; }): unknown; markRestarted(id: string, input: { invocationId: string; }): unknown; fail(id: string, code: string): unknown; } export interface RestartSupervisorLedgerHandle extends RestartSupervisorLedger { close(): void; } export interface RestartUnitState { invocationId: string; active: boolean; mainPid: number; fragmentPath: string; } export interface RestartSupervisorSystem { unit(unit: string): Promise; restart(unit: string, signal: AbortSignal): Promise; ready(unit: string, invocationId: string): Promise; withLock(home: string, task: () => Promise): Promise; transactionExists(home: string): Promise; unitDigest(fragmentPath: string): Promise; authority(config: RestartSupervisorConfig, task: RestartTaskAuthority): Promise; sleep(ms: number, signal: AbortSignal): Promise; } export type RestartSupervisorTick = 'idle' | 'deferred' | 'restarted' | 'failed' | 'observing'; export declare function validateRestartSupervisorConfig(value: RestartSupervisorConfig): RestartSupervisorConfig; /** Read-only Delivery witness. A possibly sent maintenance notice defers restart until reconciled. */ export declare function inspectRestartDeliveryAuthority(databasePath: string, task: RestartTaskAuthority, requestId: string): 'ready' | 'notice-pending' | 'invalid'; /** Scheduled/unknown work is durable; only live dispatch/attempts prevent process replacement. */ export declare function inspectRestartAutomationQuiescence(databasePath: string): boolean; /** A tick issues at most one command. A persisted restarting request is observation-only. */ export declare function runRestartSupervisorTick(configInput: RestartSupervisorConfig, ledger: RestartSupervisorLedger, options?: { system?: RestartSupervisorSystem; now?: () => number; holderId?: string; signal?: AbortSignal; }): Promise; /** Lock before opening either journal. The installer may be replacing the entire Home. */ export declare function runLockedRestartSupervisorTick(configInput: RestartSupervisorConfig, openLedger: () => RestartSupervisorLedgerHandle, options?: { system?: RestartSupervisorSystem; now?: () => number; holderId?: string; signal?: AbortSignal; }): Promise; /** Use the installed Policy's pure evaluator after verifying its frozen cohort bytes. */ export declare function inspectRestartPolicyAndCode(config: RestartSupervisorConfig, task: RestartTaskAuthority): Promise; export declare function createSystemRestartSupervisor(): RestartSupervisorSystem; //# sourceMappingURL=restart-supervisor.d.ts.map