export interface LayoutPane {
    /** Foreground command (argv0) zellij introspected for this pane, e.g. "claude". */
    command: string;
    /** Explicit pane name if set (zellij `name=`), else undefined. */
    name?: string;
    /** Absolute cwd of the pane (layout base cwd joined with the pane's relative cwd). */
    cwd?: string;
    /** Command args, when present in the dump. */
    args: string[];
}
export interface ListedPane {
    /** "terminal_<n>" — the id used to target zellij `action` commands. */
    paneId: string;
    isPlugin: boolean;
    isFloating: boolean;
    title?: string;
    terminalCommand?: string | null;
}
export interface DiscoveredCli {
    session: string;
    paneId: string;
    command: string;
    cwd?: string;
    args: string[];
    title?: string;
}
/**
 * Parse `zellij action dump-layout` output, returning only the panes that have
 * a foreground `command=` (i.e. real terminal panes running something) in
 * document order. Template sections (new_tab_template / swap_*_layout) are cut
 * off first — their bare `pane` nodes have no command and would otherwise add
 * noise. Plugin panes (tab-bar / status-bar / about) have no command= and are
 * naturally excluded.
 */
export declare function parseDumpLayoutPanes(kdl: string): LayoutPane[];
export interface LeafPane {
    /** Foreground command (argv0) if the pane is running one; undefined for an
     *  idle shell pane (zellij emits a bare `pane` with no command=). */
    command?: string;
    name?: string;
    cwd?: string;
    args: string[];
}
/**
 * Parse `zellij action dump-layout` into the ordered list of LEAF terminal
 * panes — both command-bearing panes AND idle bare shell panes — skipping
 * plugin panes (tab-bar/status-bar/about), container panes (splits), and the
 * floating subtree. Preserving bare panes is what makes a positional join to
 * `list-panes` correct: a bare shell pane that sorts before the CLI pane would
 * otherwise shift every command pane onto the wrong pane id (the bug Codex
 * found). Templates (new_tab_template / swap_*) are cut off first.
 *
 * zellij always pretty-prints dump-layout one node per line, so a brace-stack
 * line walk is reliable here.
 */
export declare function parseDumpLayoutLeafPanes(kdl: string): LeafPane[];
/** Parse `zellij action list-panes --json` into a flat list (document order). */
export declare function parseListPanesJson(json: string): ListedPane[];
/**
 * Join dump-layout command panes with list-panes terminal panes by document
 * order: the i-th command pane ↔ the i-th non-plugin terminal pane (sorted by
 * id). zellij assigns pane ids in creation order and walks the tree in a stable
 * order, so this aligns for normal layouts. Returns one DiscoveredCli per
 * command pane that could be bound to an id.
 */
export declare function joinPanes(session: string, layoutPanes: LayoutPane[], listed: ListedPane[]): DiscoveredCli[];
/** Names of live (non-exited) zellij sessions. */
export declare function listLiveSessions(): string[];
/** Discover CLIs running in one session. */
export declare function discoverSessionClis(session: string): DiscoveredCli[];
/** Discover CLIs across every live zellij session. */
export declare function discoverAllClis(): DiscoveredCli[];
//# sourceMappingURL=zellij-session-discovery.d.ts.map