import type { ToolResult } from "../types.js"; import type { ToolRunOptions } from "./tool-types.js"; export declare const SUDO_SESSION_TTL_MS: number; export declare function formatSudoStdinPassword(password: string): string; export type SudoAuthOutcome = { readonly status: "granted"; readonly password: string; readonly fromCache: boolean; } | { readonly status: "cancelled"; } | { readonly status: "failed"; readonly detail: string; }; export interface SudoAuthOptions { readonly requestSecret: (request: { title: string; prompt: string; }) => Promise; readonly title: string; readonly prompt: string; readonly signal?: AbortSignal | undefined; readonly onOutput?: ToolRunOptions["onOutput"]; } export interface SudoAuthDependencies { readonly runAuth?: ((args: { command: string; argv: string[]; stdinText?: string | undefined; timeoutMs?: number | undefined; signal?: AbortSignal | undefined; onOutput?: ToolRunOptions["onOutput"]; noArtifact?: boolean | undefined; interactiveStdin?: boolean | "auto" | undefined; }) => Promise) | undefined; readonly now?: (() => number) | undefined; readonly ttlMs?: number | undefined; } export declare function obtainSudoPassword(options: SudoAuthOptions, dependencies?: SudoAuthDependencies): Promise; export declare function looksLikeSudoAuthError(output: string): boolean; export declare function evictSudoSession(expected?: string): void; export declare function resetSudoSession(): void;