/** * Quest stay-awake command * Uses Meta Scriptable Testing API (content://com.oculus.rc) to turn off * Quest protections (autosleep, guardian, system dialogs) for automated testing. * * Cleanup is critical: with autosleep off, the headset drains battery * quickly. A watchdog child process ensures cleanup happens even if the * parent is killed (TaskStop, terminal close, claude code exit). */ import { type BatteryInfo } from '../utils/adb.js'; import { type QuestProtections, buildSetPropertyArgs, parseQuestProtections } from '../utils/quest-protections.js'; export { type QuestProtections, buildSetPropertyArgs, parseQuestProtections }; /** * Accumulate how long the headset has been unplugged, across battery polls. * * Each poll either adds the elapsed interval (while `not charging`) or resets * the counter to zero (while `charging`/`fast charging`). A brief unplug that * returns to charging before the grace window elapses therefore clears itself, * so a cable bump or PD renegotiation doesn't end the session. * * @param accumulatedMs - unplugged time accumulated so far * @param state - current battery charge state * @param intervalMs - time since the previous poll * @returns the new accumulated unplugged time */ export declare function trackUnpluggedDuration(accumulatedMs: number, state: BatteryInfo['state'], intervalMs: number): number; /** * Decide whether to exit because the headset has been unplugged too long. * * A threshold of 0 (or negative) disables the feature — the session stays * awake on battery until the separate low-battery level exit fires. * * @param accumulatedUnpluggedMs - unplugged time accumulated so far * @param unpluggedTimeoutMs - grace window; 0/negative disables the check */ export declare function shouldExitOnUnplug(accumulatedUnpluggedMs: number, unpluggedTimeoutMs: number): boolean; /** * Show current Quest protection status */ export declare function stayAwakeStatus(): Promise; /** * Manually turn stay-awake off (restore all Quest protections) */ export declare function stayAwakeOff(cliPin?: string): Promise; /** * Per-serial PID file path for stay-awake, under the XDG runtime dir. */ export declare function stayAwakePidPath(serial: string): string; /** * Child watchdog process - polls for parent death and cleans up */ export declare function stayAwakeWatchdog(parentPid: number, pin: string, serial: string): Promise; /** * Main stay-awake command handler */ export declare function stayAwakeCommand(cliPin?: string, cliIdleTimeout?: number, cliLowBattery?: number, verbose?: boolean, cliUnpluggedTimeout?: number, serial?: string): Promise; //# sourceMappingURL=stay-awake.d.ts.map