import { type ElevatedEndpoint } from "@aicommander/priv-helper"; import type { ElevatedUnavailableReason } from "@aicommander/protocol"; import { discoverHelperDetailed } from "./elevated-executor.js"; /** A reachable helper, or the reason there is none. */ export type ElevatedAvailability = { available: true; bootId: string; endpoint: ElevatedEndpoint; } | { available: false; reason: ElevatedUnavailableReason; }; /** Test seam: drop the memoized Windows registration answer. */ export declare function __resetRegistrationCache(): void; /** * The part of the verdict that costs nothing to know: no helper on this platform * at all, or the installed files are not there. `undefined` means "everything * cheap says a helper could be here" — never that one is reachable, which only a * handshake can establish. * * SYNCHRONOUS, and that is what it is for. connection.ts registers the moment the * socket opens, before helper discovery has had a chance to run, and used to send * that first frame with no reason at all — so on every helper-less machine (all * of Linux, every mac/Windows box without one) the first reconcile found a reason * where there had been none and sent a SECOND register. On the relay each * register is two storage writes, a pending-register clear, a broadcast to every * dashboard and a ping; the fleet paid all of it twice for a fact that was * knowable in two `existsSync` calls. Both verdicts this returns are final — * discovery cannot overturn "there is no helper on this platform" or "the files * are missing" — so the frame that carries one is right the first time. */ export declare function staticElevatedUnavailableReason(): ElevatedUnavailableReason | undefined; /** * Resolve the machine's elevated-execution state. * * The order is the doctor's order, because each step is only meaningful once the * one before it holds: no helper on this platform at all → files present? → the * OS told to run them? → does it answer, on our protocol, as one identity? * * `opts` exists for tests only; production callers pass nothing. */ export declare function resolveElevatedAvailability(opts?: { discover?: typeof discoverHelperDetailed; registered?: () => Promise; }): Promise;