/** * transport/tmux.ts — tmux implementation of SessionTransport (synchronous). * * Why tmux: cross-platform, scriptable, SSH/headless-friendly, and `send-keys -l` * sidesteps the AppleScript multi-line escaping bugs. Two hard-won lessons from * prior art (claude-code-tools' tmux-cli) are baked in: * * 1. Sending text and pressing Enter as ONE combined send is unreliable for * Claude Code. We send the literal text, confirm it landed, THEN send Enter * as a separate keystroke, retrying the literal send if it didn't appear. * 2. Pane ids (%0, %3 …) are ephemeral — they reset when the tmux server * restarts. So each pane gets a durable `@aibroker_id` user-option (scheme B) * that the persistent paiName store can key on across transports. * * Synchronous (spawnSync) to match core.ts and the daemon's existing call sites. */ import type { ManagedSession, SendOptions, SessionTransport, TransportKind } from "./session-transport.js"; export declare class TmuxTransport implements SessionTransport { readonly kind: TransportKind; isAvailable(): boolean; /** * Resolve a session's CURRENT pane id from a stable id. Accepts either a pane * id ("%3" — returned as-is) or an @aibroker_id (looked up live). Pane ids are * ephemeral and reused (every first pane is %0), so the public ops take the * durable @aibroker_id as identity and resolve the live pane here. Returns null * if no live pane carries that id. */ paneFor(stableId: string): string | null; /** * Durable @aibroker_id for a pane id (assigning one if the pane lacks it). * Used to translate an inbound caller's $TMUX_PANE into the stable identity. */ aibrokerIdForPane(paneId: string): string | null; listSessions(): ManagedSession[]; sendText(id: string, text: string, opts?: SendOptions): boolean; /** Send a single named tmux key (e.g. "C-u", "Enter") — no text, no retry. */ sendKey(id: string, key: string): boolean; capture(id: string, lines?: number): string | null; /** * ttys of terminals currently attached as tmux clients (e.g. an iTerm tab * running `tmux attach`). Used to de-dup: such a tab is a VIEWER of panes we * already enumerate directly, not a session of its own. */ attachedClientTtys(): Set; /** * tty of the terminal (e.g. iTerm tab) currently viewing the given pane's * session, or null if the session is detached. Lets callers map a tmux pane * back to its host iTerm tab so iTerm visuals (badge/tab title) can be set on * the tab the user is actually looking at. */ clientTtyForPane(id: string): string | null; isBusy(id: string): boolean; setTitle(id: string, title: string): boolean; } //# sourceMappingURL=tmux.d.ts.map