/** Whether the updater installs updates automatically or only sends notifications. */ export type AutoUpdateMode = "notify-only" | "auto-apply"; /** Classification of the semver distance between the current and latest version. */ export type AutoUpdateKind = "none" | "patch" | "minor" | "major"; /** Whether the gateway can be restarted automatically after an update. */ export type RestartCapability = "unknown" | "capable" | "not-capable"; /** * Resolved auto-update configuration. * * Produced by {@link resolveAutoUpdateConfig} from the raw plugin config block. * All fields have safe defaults so the block can be omitted entirely. */ export interface AutoUpdateConfig { enabled: boolean; mode: AutoUpdateMode; pollIntervalMinutes: number; startupDelaySeconds: number; allowPatch: boolean; allowMinor: boolean; /** Hard policy: always `false`. Major versions require manual update. */ allowMajor: boolean; failureBackoffMinutes: number; maxBackoffMinutes: number; /** Internal key written by the auto-updater to trigger gateway restart via config reload. */ lastRestartTrigger?: string; } /** * Persistent state tracked across auto-update poll cycles. * * Serialised to {@link AUTO_UPDATE_STATE_FILE} in the plugin state directory * so that deduplication (e.g. "already notified for this major") survives restarts. */ export interface AutoUpdateState { currentVersionLastSeen: string; latestVersionLastSeen: string; lastAppliedVersion?: string; lastCheckedAt: string; lastAttemptAt?: string; lastSuccessAt?: string; lastFailureAt?: string; lastFailureReason?: string; lastNotifiedMajorVersion?: string; lastNotifiedUpdateVersion?: string; lastLoggedAwaitingRestartVersion?: string; consecutiveFailures: number; effectiveMode: AutoUpdateMode; restartCapability: RestartCapability; restartCapabilityReasons: string[]; restartCapabilityMode?: string; lastRestartTriggerAt?: string; lastRestartTriggerMode?: string; } /** * Result of the preflight environment check performed before the first poll. * * The preflight may downgrade {@link AutoUpdateConfig.mode} if the runtime * environment cannot execute plugin updates (e.g. missing CLI). */ export interface AutoUpdatePreflightResult { ok: boolean; effectiveMode: AutoUpdateMode; reasons: string[]; } /** Aggregate health of the auto-update subsystem, surfaced via gateway RPCs. */ export type AutoUpdateHealth = "healthy" | "degraded" | "unhealthy" | "disabled"; /** * Point-in-time snapshot of the auto-update subsystem exposed through * the `senpi.getHealthStatus` and `senpi.getSystemState` gateway RPCs. */ export interface AutoUpdateSnapshot { enabled: boolean; configuredMode: AutoUpdateMode; effectiveMode: AutoUpdateMode; health: AutoUpdateHealth; currentVersion: string; latestVersion: string; lastCheckedAt: string | null; lastAction: string; lastError: string | null; consecutiveFailures: number; nextCheckAt: string | null; preflightReasons: string[]; restartCapability: RestartCapability; restartCapabilityReasons: string[]; lastRestartTriggerAt: string | null; lastRestartTriggerMode: string | null; } /** * Why a forced {@link AutoUpdateCoordinator.checkNow} call did or did not run a cycle. * * - `ran` — a full check cycle was executed and has finished. * - `already-running` — a cycle was already in flight, so no second one was started. * - `disabled` — the coordinator is stopped or auto-update is off; nothing was run or armed. */ export type AutoUpdateCheckNowOutcome = "ran" | "already-running" | "disabled"; /** Result of a forced {@link AutoUpdateCoordinator.checkNow} call. */ export interface AutoUpdateCheckNowResult { outcome: AutoUpdateCheckNowOutcome; /** Plain-language explanation, so a caller can report why nothing happened. */ reason: string; } /** Filename used by {@link AutoUpdateStateStore} for persistent state. */ export declare const AUTO_UPDATE_STATE_FILE = "auto-update-state.json"; /** * Parse and normalise the raw `autoUpdate` config block from the plugin config. * * When the block is `undefined` (user omitted it), all defaults apply: * enabled, auto-apply mode, 1-minute poll interval, 120-second startup delay. * Numeric values are clamped to safe ranges. `allowMajor` is always forced to `false`. * * @param value - Raw `autoUpdate` value from the plugin config (may be undefined). * @returns Fully resolved {@link AutoUpdateConfig} with safe defaults. */ export declare function resolveAutoUpdateConfig(value: unknown): AutoUpdateConfig; /** * Create a blank {@link AutoUpdateState} for a fresh install or when * the persisted state file cannot be loaded. */ export declare function createDefaultAutoUpdateState(currentVersion: string, effectiveMode: AutoUpdateMode): AutoUpdateState; //# sourceMappingURL=types.d.ts.map