/** * Scan Command * * Runs scan side of all plugin fixes. * Returns problems found (which are the fixes that need to run). * * Usage: * npx stack scan # Scan all stages * npx stack scan --dev # Scan dev only * npx stack scan --staging # Scan staging only * npx stack scan --prod # Scan prod only * * ============================================================ * STAGE EXECUTION PATTERN - DO NOT MODIFY WITHOUT READING * ============================================================ * * How this works: * * 1. User specifies stage: --dev, --staging, --prod * Or no flag = all stages in order * * 2. This file groups all plugin fixes by their stage property * * 3. For each requested stage, asks PIPELINE PLUGIN: canReach(stage)? * - { reachable: true, via: 'local' } → run fixes locally * - { reachable: false, reason: '...' } → show error, stop * * CRITICAL: This file does NOT know about: * - SSH keys (that's pipeline plugin's concern) * - How to reach servers (that's pipeline plugin's concern) * * This file ONLY: * - Collects fixes from all plugins * - Groups them by stage * - Asks pipeline if each stage is reachable * - Runs fixes for reachable stages * * This keeps scan.ts compatible with ANY pipeline plugin. * * ============================================================ * FOR PIPELINE PLUGIN AUTHORS: * ============================================================ * * When SSH-ing to a server, you MUST call the command with * the specific stage flag: * * npx stack fix --staging # NOT just "npx stack fix" * npx stack scan --prod # NOT just "npx stack scan" * * Without the stage flag, the command will try to run ALL stages * and may try to SSH out for stages it can't reach. * * Your canReach() should return 'local' when running on the * target server (e.g., check FACTIII_ON_SERVER env var). * * ============================================================ */ import type { FactiiiConfig, Stage, Fix, Reachability, ScanOptions, ScanProblems } from '../types/index.js'; interface PluginClass { id: string; category: string; fixes?: Fix[]; requiredEnvVars?: string[]; canReach?: (stage: Stage, config: FactiiiConfig) => Reachability; } /** * Generate env var fixes from plugin requiredEnvVars */ export declare function generateEnvVarFixes(plugin: PluginClass, rootDir: string, _config: FactiiiConfig): Fix[]; /** * Main scan function */ export declare function scan(options?: ScanOptions, _isRerun?: boolean): Promise; export default scan; //# sourceMappingURL=scan.d.ts.map