export interface TmuxPaneSnapshot { paneId: string; currentCommand: string; startCommand: string; panePid?: string; paneDead?: boolean; currentPath?: string; paneLeft?: number; paneTop?: number; paneWidth?: number; paneHeight?: number; paneBottom?: number; windowWidth?: number; windowHeight?: number; } export declare const OMX_TMUX_HUD_LEADER_PANE_ENV = "OMX_TMUX_HUD_LEADER_PANE"; export declare const TMUX_PANE_FIELD_SEPARATOR = "\u001F"; export declare const TMUX_PANE_FIELD_SEPARATOR_OCTAL_ESCAPE = "\\037"; export interface HudPaneOwner { sessionId?: string; sessionIds?: string[]; leaderPaneId?: string; } export type HudRuntimeRootSource = 'team-env' | 'omx-root-env' | 'omx-state-root-env' | 'cwd-default'; export interface HudRuntimeEnvInput { sessionId?: string; leaderPaneId?: string; omxRoot?: string; omxStateRoot?: string; omxTeamStateRoot?: string; rootSource?: HudRuntimeRootSource; } export interface HudRuntimeEnvOutput { env: Record; owner: HudPaneOwner; } type TmuxExecSync = (args: string[]) => string; export declare function parseCanonicalTmuxPaneId(value: string | null | undefined): string | null; /** * Parses tmux output used as authority. Authority frames are deliberately * transport-strict: a nonempty body followed by exactly one LF or CRLF. */ export declare function parseExactTmuxAuthorityLines(output: string): string[] | null; /** Parses one exact, nonempty tmux authority scalar. */ export declare function parseExactTmuxAuthorityScalar(output: string): string | null; export interface RegisterHudResizeHookOptions { cwd?: string; env?: NodeJS.ProcessEnv; } export declare function parseTmuxPaneSnapshot(output: string, authoritativePaneIds?: ReadonlySet): TmuxPaneSnapshot[]; export declare function isHudWatchPane(pane: TmuxPaneSnapshot): boolean; export declare function readHudPaneOwner(pane: TmuxPaneSnapshot): HudPaneOwner; export declare function hasValidHudOwnerMarker(pane: TmuxPaneSnapshot): boolean; export declare function findLegacyFocusedHudWatchPaneIds(panes: TmuxPaneSnapshot[], currentPaneId?: string): string[]; export declare function hudPaneMatchesOwner(pane: TmuxPaneSnapshot, owner?: HudPaneOwner): boolean; export declare function findHudWatchPaneIds(panes: TmuxPaneSnapshot[], currentPaneId?: string, owner?: HudPaneOwner): string[]; export declare function reapDeadHudPanes(panes: TmuxPaneSnapshot[], opts?: { isLivePane?: (paneId: string) => boolean; killPane?: (paneId: string) => boolean; }): { reaped: string[]; preserved: string[]; }; export declare function parsePaneIdFromTmuxOutput(rawOutput: string): string | null; export declare function shellEscapeSingle(value: string): string; export declare function buildHudResizeHookName(sessionId: string, windowId: string, leaderPaneId: string): string; export declare function buildHudResizeHookSlot(hookName: string): string; export declare function buildHudLayoutHookSlot(hookName: string): string; export interface HudResizeHookContext { sessionId: string; windowId: string; leaderPaneId: string; leaderPanePid: string; hudPaneId: string; hudPanePid: string; hookName: string; hookSlot: string; layoutHookSlot: string; } export declare function parseHudResizeHookContext(output: string, leaderPaneId: string, hudPaneId?: string, incarnations?: { leaderPanePid: string; hudPanePid: string; }): HudResizeHookContext | null; export declare function readHudResizeHookContext(hudPaneId: string | undefined, leaderPaneId: string | undefined, execTmuxSync?: TmuxExecSync): HudResizeHookContext | null; export interface HudCommandWriterOptions { omxEntry: string; runtimeEnv: Record; nodeCommand: string; preset?: string; platform?: NodeJS.Platform; powerShellEnvelope?: boolean; quoteOwnerValue?: boolean; } /** The sole platform-aware serializer for tmux HUD watch commands. */ export declare function writeHudWatchCommand(options: HudCommandWriterOptions): string; export declare function buildHudRuntimeEnv(input?: HudRuntimeEnvInput): HudRuntimeEnvOutput; export declare function buildHudWatchCommand(omxBin: string, preset?: string, sessionId?: string, omxRoot?: string, leaderPaneId?: string, rootEnv?: Pick, platform?: NodeJS.Platform): string; export declare function listCurrentWindowPanes(execTmuxSync?: TmuxExecSync, currentPaneId?: string): TmuxPaneSnapshot[]; export declare function readActiveTmuxPaneId(execTmuxSync?: TmuxExecSync): string | null; export declare function listCurrentWindowHudPaneIds(currentPaneId?: string, execTmuxSync?: TmuxExecSync, owner?: HudPaneOwner): string[]; export declare function readCurrentWindowSize(execTmuxSync?: TmuxExecSync, currentPaneId?: string): { width: number | null; height: number | null; }; /** Freshly validates retained split proof and sustained global liveness before a HUD mutation sink. */ export declare function verifyHudWatchPaneAuthority(paneId: string, execTmuxSync?: TmuxExecSync): boolean; /** Kills only a pane still bound to this process's exact split proof. */ export declare function rollbackHudWatchPaneAuthority(paneId: string, execTmuxSync?: TmuxExecSync): boolean; export declare function createHudWatchPane(cwd: string, hudCmd: string, options?: { heightLines?: number; fullWidth?: boolean; targetPaneId?: string; }, execTmuxSync?: TmuxExecSync): string | null; /** Executes a split-owned pane mutation only while its immutable owner proof and exact incarnation remain current. */ export declare function mutateHudWatchPaneIfCurrent(paneId: string, expectedPanePid: string, mutation: string, execTmuxSync?: TmuxExecSync): boolean; /** Kills a pane only while its exact live incarnation remains the target. */ export declare function killTmuxPaneIfCurrent(paneId: string, expectedPanePid: string, execTmuxSync?: TmuxExecSync): boolean; /** Resizes a pane only while its exact live incarnation remains the target. */ export declare function resizeTmuxPaneIfCurrent(paneId: string, expectedPanePid: string, heightLines: number, execTmuxSync?: TmuxExecSync): boolean; export declare function killTmuxPane(paneId: string, execTmuxSync?: TmuxExecSync): boolean; export declare function resizeTmuxPane(paneId: string, heightLines: number, execTmuxSync?: TmuxExecSync): boolean; export declare function registerHudResizeHook(hudPaneId: string, leaderPaneId: string | undefined, heightLines: number, optionsOrExecTmuxSync?: RegisterHudResizeHookOptions | TmuxExecSync, maybeExecTmuxSync?: TmuxExecSync): boolean; export declare function unregisterHudResizeHook(leaderPaneId: string | undefined, execTmuxSync?: TmuxExecSync): boolean; export {}; //# sourceMappingURL=tmux.d.ts.map