import { type CliContext } from '../context.js'; export interface DashboardOptions { /** Print a single frame and exit (no live loop). */ once?: boolean; /** Refresh interval in seconds. */ interval?: string; /** * Emit the state as JSON instead of drawing it, and exit. * * Deliberately the same code path as the screen rather than a second one * beside it. Two surfaces assembling their own view of ccx would drift, and * they would drift on the thing that matters most: which account can * actually be used right now. */ json?: boolean; } /** * The screen-entry and screen-exit sequences for a platform. * * The alternate screen buffer is a nicety: it restores whatever was on the * terminal before the dashboard when the dashboard exits. But LEAVING it * (`?1049l`) is a buffer swap, and on Windows that swap, landing at the moment * the process exits or hands the screen to a sign-in, races the pseudo-terminal * (ConPTY) being torn down and can crash the console host, which takes the * parent shell with it. That is the reported "pressing q closed my whole * terminal" and "starting a sign-in from the dashboard crashed the terminal", * and it was measured: the sign-in flow crashed the shell about half the time * with the alternate screen and not once without it. * * So on Windows the dashboard stays on the MAIN screen. It already repaints in * place from the top of the screen every frame, so nothing about the live view * changes; the only thing given up is the on-exit scrollback restore, a fair * price for not crashing the terminal. Every other platform keeps the alternate * screen and its restore. * * Pure and exported so both branches are testable without spoofing the host OS. * - enter: what to write when taking the screen. The alternate screen * elsewhere; a one-time clear-and-home on Windows, so the main-screen * dashboard starts on a clean frame instead of over whatever was there. * - epilogue: what the raw-terminal restore writes on the way out. The cursor * is always shown again; the alternate screen is left ONLY where one was * entered. On Windows there is deliberately no `?1049l`. */ export declare function screenSequences(platform: NodeJS.Platform): { usesAltScreen: boolean; enter: string; epilogue: string; }; /** Live account dashboard. `--once` prints a single frame (script/CI friendly). */ export declare function dashboardCommand(context: CliContext, options?: DashboardOptions): Promise;