/** * GUI + fail-closed native sudo backends for the node-server float. * * Each backend turns a {@link SudoApproveRequest} into a real OS gesture * (osascript / PowerShell / zenity / kdialog) and parses the result into a * {@link SudoDecision}. They are deliberately injectable via {@link ExecFn} so * tests can assert the argv and parsing without spawning a real dialog. * * Fail-closed contract: a dismissed dialog, a non-zero exit, an unparsable * result, or a thrown error all resolve to `deny`. An `always` result with an * empty pattern falls back to the suggested default. */ import type { SudoApproveRequest, SudoBackend } from './types.js'; /** Minimal exec seam: run a binary with args, resolve its stdout. */ export type ExecFn = (cmd: string, args: string[]) => Promise<{ stdout: string; }>; /** Human-readable one-liner describing the gated action. */ export declare function describeRequest(req: SudoApproveRequest): string; /** macOS: single `osascript display dialog` with 3 buttons + a text field. */ export declare function createOsascriptBackend(exec?: ExecFn): SudoBackend; /** Windows: MessageBox (Yes/No/Cancel) + InputBox for the "Always" pattern. */ export declare function createPowerShellBackend(exec?: ExecFn): SudoBackend; /** Linux GUI: `zenity --question` (+ `--entry` for the pattern). */ export declare function createZenityBackend(exec?: ExecFn): SudoBackend; /** Linux GUI: `kdialog --warningyesnocancel` (+ `--inputbox`). */ export declare function createKdialogBackend(exec?: ExecFn): SudoBackend; /** A backend that always denies — used when no native channel exists. */ export declare function createDenyBackend(name?: string): SudoBackend;