import { DaemonPostmortem } from './daemonForensics'; /** * Post-install environment diagnostics — the "will this machine stay alive?" * snapshot taken at the END of onboarding, while we still have an interactive * session. Fleet machines are usually remote and locked-down (bank laptops, * EDR); this is our best — sometimes only — chance to capture: * * - which EDR/AV products run here (read-only service probe, no PowerShell) * - whether PowerShell can spawn + whether the DPAPI key decrypts * - whether the daemon that onboarding just started is alive AND SURVIVES * a re-check a few seconds later (an EDR that kills the daemon does it * within seconds — catching that at install time beats discovering a * silent machine a day later) * - whether the watchdog liveness-beacon task actually registered * - any crash post-mortem left by a previous install's daemon * * Contract: NEVER throws, never blocks onboarding for more than the re-check * delay, every field is optional/best-effort. Diagnostics report problems — * they must never BE one. */ export interface EnvironmentDiagnostics { /** EDR/AV product names detected (Windows service probe). */ securityAgents?: string[]; powershellSpawnOk?: boolean; powershellDecryptOk?: boolean; daemonAlive: boolean; daemonPid?: number; /** Did the daemon still exist recheckDelayMs later? (false = killed within seconds — EDR signature) */ daemonSurvivedRecheck?: boolean; watchdogTaskInstalled: boolean; /** Unreported crash record from a previous daemon on this machine. */ lastCrash?: DaemonPostmortem; collectedAt: string; } export declare function collectEnvironmentDiagnostics(options?: { recheckDelayMs?: number; }): Promise; /** One-line human summary for the onboarding journal / MSI screen / daemon log. */ export declare function summarizeEnvironmentDiagnostics(diag: EnvironmentDiagnostics): string; /** * The silent updater stops the old daemon FORCEFULLY, so an upgrade always * leaves an "unclean death" post-mortem — of the OLD version. When the dead * daemon's version differs from the CLI running now, that death was the * upgrade replacing it: routine, expected, and not a health problem. */ export declare function crashLooksLikeUpgradeRestart(crash: DaemonPostmortem): boolean; /** * Verdict for the onboarding journal: healthy unless something on this * machine is actively interfering (daemon killed, PowerShell blocked, or a * fresh unexplained crash). Missing watchdog alone is a warning, not * interference — the daemon self-heals it at every boot. */ export declare function environmentLooksHealthy(diag: EnvironmentDiagnostics): boolean;