/** * Auto-Update Workflow * * Orchestrates: scan → auto-source → check updates → download → rescan → summary. * Used by both the CLI command and the UI auto-update tab. * * @since v2.4.24 */ import { type PromotionEngine, type PromotionRunReport } from '../core/promotion/index.js'; import type { SourceRegistry } from '../core/sources/index.js'; import type { Plugin, SourceConfig } from '../core/types/index.js'; export type AutoUpdatePhase = 'scanning' | 'assigning' | 'checking' | 'downloading' | 'rescanning' | 'promoting' | 'complete' | 'cancelled'; export interface AutoUpdateProgress { phase: AutoUpdatePhase; message: string; pluginName?: string; current?: number; total?: number; } export interface AutoUpdateSummaryPlugin { name: string; oldVersion: string; newVersion: string; /** * Non-blocking compatibility-gate findings from the install (Phase 4 * roadmap 4.2) — carried per plugin, never swallowed. */ warnings?: string[]; } export interface AutoUpdateSummary { /** Applied in place — these are live (or live on next start). */ updated: AutoUpdateSummaryPlugin[]; /** * Validated + staged into the server's update folder because the target * server was RUNNING (Phase 4 safe-apply) — these apply on the next * server restart. Consumers must never report them as already updated. */ staged: AutoUpdateSummaryPlugin[]; manualRequired: Array; noSource: string[]; /** * Plugins the user explicitly excluded via `IGNORED_PLUGINS` — bespoke/ * private jars with no public update channel. Still scanned (so they're * known to exist), but skipped from assignment, checks, and installs. NEVER * counted as noSource/manualRequired/failed (roadmap "exclude for now"). */ ignored: string[]; failed: Array<{ name: string; error: string; }>; upToDateCount: number; duration: number; cancelled: boolean; /** * Scheduled test→prod promotion step report (Phase 4 roadmap 4.4). * Present only when ScheduleConfig.promotionEnabled is true (default OFF) * and a prod server path was provided. A failing promotion step never * fails the auto-update run — failures surface here. */ promotion?: PromotionRunReport; } export interface AutoUpdateOptions { testServerPath: string; prodServerPath?: string; dryRun?: boolean; onProgress?: (progress: AutoUpdateProgress) => void; signal?: AbortSignal; sourceConfigs?: SourceConfig[]; /** * Plugin names (case-insensitive) the user excluded via `IGNORED_PLUGINS`. * Scanned but never assigned/checked/installed; surfaced in summary.ignored. */ ignoredPlugins?: string[]; /** * Compat-gate fallback MC version when detection from the test server * directory finds nothing (callers thread the configured TEST_MC_VERSION). * Phase 4 roadmap 4.2. */ serverMcVersion?: string; /** Host JVM feature release for the Java class-version gate. */ hostJavaMajor?: number; /** Escalate newer-MC-major mismatches from 'warn' to 'block'. */ strictCompat?: boolean; /** * Running-state probe override for the test server (tests). Default: * detection on the target plugins directory inside the downloader. */ isTargetServerRunning?: () => Promise; /** * Injection points for the scheduled-promotion step (tests). Production * callers leave this unset — gating comes from the persisted * ScheduleConfig (promotionEnabled, default OFF). */ promotion?: { engine?: PromotionEngine; scheduleStatePath?: string; nowMs?: number; }; } /** * Build a SourceRegistry for update checks. * * Thin delegate kept for backward compatibility — construction lives in the * unified factory (cli-source-helpers.ts buildSourceRegistry). With no args * it falls back to DEFAULT_SOURCES (all enabled bundled source types), NOT * the historical spigot/modrinth/github trio that left hangar/geysermc/ * jenkins-typed plugins permanently uncheckable (June 9 2026 audit, P0). * Prefer loadSourceRegistry() in flows that should honor the user's * sources.json + GITHUB_TOKEN. */ export declare function createSourceRegistry(sourceConfigs?: SourceConfig[]): SourceRegistry; /** * Persist a plugin config file ATOMICALLY (tmp + rename). * * This is the UNATTENDED workflow's write path for plugins-test.json / * plugins-prod.json — a bare `writeFile` here meant a crash mid-write * corrupted the exact files startup-health then flags as corrupt, with data * loss (June 9 2026 audit, workflows-infra §6 P1). Exported for tests only. */ export declare function savePluginsToFile(plugins: Plugin[], path?: string): Promise; /** * Run the full auto-update pipeline holding the cross-process 'update' lock * (Phase 4 roadmap 4.5): overlapping cron runs / daemon + interactive * sessions bow out with a clean "another Pluginator update run is in * progress (pid N)" error instead of mutating the same server concurrently. * The lock is re-entrant for the inner downloadBatch. */ export declare function runAutoUpdate(options: AutoUpdateOptions): Promise; //# sourceMappingURL=auto-update.d.ts.map