import { type StatusSurfaceStreams } from "./status-surface.js"; /** * Single background producer of tmux status-bar text. * * The 2026-07-31 spawn storm: the installed surface embedded * `#(h2a status --bar ...)` in status-left AND status-right, and tmux re-runs * both commands once per status-interval for EVERY session — two node * startups per session per 5s (~16/s at 40 sessions, measured load 197). The * surface now embeds only `#(cat )`; this writer is the one process * that computes every session's bar text and publishes it to those files. * * Self-limiting by construction: a lease makes it single-instance per h2a * root, it exits once no installed session remains, and each tick costs two * bounded tmux list calls plus in-process rendering — never a subprocess per * session. */ /** Duplicated in @sentropic/h2a-runtime (tmux.ts): the CLI is a peer, not an import. */ export declare const STATUS_BAR_WRITER_LOCK_FILE = "writer.lock"; export interface WriterLeaseProbe { readonly pid: number; readonly isAlive: (pid: number) => boolean; readonly staleMs?: number; } /** * Take the single-writer lease. A held lock only blocks us while its holder * is alive AND fresh: liveness alone is not enough (pid reuse after a crash), * freshness alone is not enough (a hung writer keeps refreshing nothing). */ export declare function acquireStatusBarWriterLease(dir: string, probe: WriterLeaseProbe): boolean; /** Touch the lock so ensure-side staleness checks see a live writer. */ export declare function refreshStatusBarWriterLease(dir: string, pid: number): boolean; export declare function releaseStatusBarWriterLease(dir: string, pid: number): void; export interface StatusBarWriterOptions { readonly root: string; readonly signal?: AbortSignal; readonly intervalMs?: number; } export declare function runStatusBarWriter(options: StatusBarWriterOptions, streams: StatusSurfaceStreams): Promise; //# sourceMappingURL=status-bar-writer.d.ts.map