/** * OMX HUD - CLI entry point * * Usage: * omx hud Show current HUD state * omx hud --watch Poll every 1s with terminal clear * omx hud --json Output raw state as JSON * omx hud --preset=X Use preset: minimal, focused, full * omx hud --tmux Open HUD in a tmux split pane (auto-detects orientation) * omx hud --reconcile-tmux */ import type { HudFlags, HudPreset, HudRenderContext, ResolvedHudConfig } from './types.js'; import { reconcileHudForPromptSubmit } from './reconcile.js'; import { buildHudRuntimeEnv } from './tmux.js'; export declare const HUD_USAGE: string; type SleepFn = (ms: number, signal?: AbortSignal) => Promise; export declare function watchRenderLoop(render: () => Promise, options?: { intervalMs?: number; signal?: AbortSignal; onError?: (error: unknown) => void; sleepFn?: SleepFn; }): Promise; interface RunWatchModeDependencies { isTTY: boolean; env: NodeJS.ProcessEnv; resolveWatchCwdFn: (launchCwd: string) => string; readAllStateFn: (cwd: string, config?: ResolvedHudConfig) => Promise; readHudConfigFn: (cwd: string) => Promise; renderHudFn: (ctx: HudRenderContext, preset: HudPreset, options?: { maxWidth?: number; maxLines?: number; }) => string; runAuthorityTickFn: (options: { cwd: string; }) => Promise; resizeTmuxPaneFn: (paneId: string, heightLines: number) => boolean; registerHudResizeHookFn: (hudPaneId: string, leaderPaneId: string | undefined, heightLines: number) => boolean; writeStdout: (text: string) => void; writeStderr: (text: string) => void; registerSigint: (handler: () => void) => void | (() => void); setIntervalFn: (handler: () => void, intervalMs: number) => ReturnType; clearIntervalFn: (timer: ReturnType) => void; } export interface ResolveHudWatchCwdDependencies { getCwd?: () => string; realpath?: (path: string) => string; readProcCwd?: () => string | null | undefined; } /** * Resolve the cwd a long-running HUD watch should read on this frame. * * tmux launches HUD with both a real cwd and a shell PWD string. If that * directory is later renamed and the original pathname is reused by a fresh * OMX run, the old HUD process can keep reading the reused launch path and * display the new run's state. Compare the launch path to the process' live * cwd inode/path each tick; when they diverge, follow the live cwd instead of * the stale launch path. */ export declare function resolveHudWatchCwd(launchCwd: string, deps?: ResolveHudWatchCwdDependencies): string; /** * Backward-compatible watch mode runner used by tests. */ export declare function runWatchMode(cwd: string, flags: HudFlags, deps?: Partial): Promise; export declare function hudCommand(args: string[], deps?: { cwd?: string; reconcileHudForPromptSubmit?: typeof reconcileHudForPromptSubmit; }): Promise; /** Shell-escape a string using single-quote wrapping (POSIX-safe). */ export declare function shellEscape(s: string): string; /** * Build the argument array for `execFileSync('tmux', args)`. * * By returning an argv array instead of a shell command string, `cwd` is * passed as a literal argument to tmux (no shell expansion). `omxBin` is * shell-escaped inside the command string that tmux will execute in a shell. */ export declare function buildTmuxSplitArgs(cwd: string, omxBin: string, preset?: string, sessionId?: string, omxRoot?: string, leaderPaneId?: string, heightLines?: number, rootEnv?: Parameters[0]): string[]; export {}; //# sourceMappingURL=index.d.ts.map