/** * Native sudo backend selection (priority order). * * 1. Electron → `dialog.showMessageBox` * 2. macOS → `osascript` * 3. Windows → PowerShell * 4. Linux+GUI → `zenity` / `kdialog` * 5. headless → editable TTY * 6. no channel → fail closed (deny) + log * * The environment probe is injectable so tests can force any branch without * touching the real platform / spawning `which`. */ import type { SudoBackend } from './types.js'; /** Probed runtime facts used to pick a backend. */ export interface SudoEnv { platform: NodeJS.Platform; isElectron: boolean; hasDisplay: boolean; hasTty: boolean; which: (cmd: string) => boolean; } /** Probe the live environment. */ export declare function detectSudoEnv(): SudoEnv; /** * Select the highest-priority available backend for the given environment. * Always returns a backend — the deny backend is the fail-closed terminal. */ export declare function selectSudoBackend(env?: SudoEnv): SudoBackend;