/** * transport/sync-facade.ts — Drop-in replacements for the iTerm primitives, * with MULTI-TRANSPORT enumeration. * * The daemon historically imported `snapshotAllSessions`, `typeIntoSession`, * `pasteTextIntoSession`, and `isClaudeRunningInSession` directly from * adapters/iterm/core.ts. Those imports are repointed here. Every function keeps * the EXACT same signature. * * Transport selection (decided once at module load): * AIBROKER_TRANSPORT=iterm → iTerm only * AIBROKER_TRANSPORT=tmux → tmux only * AIBROKER_TRANSPORT=multi → both (subject to availability) * unset / anything else → AUTO: enumerate whatever is available right now * * AUTO is the default and is safe: on a Mac with no tmux server it resolves to * iTerm-only (byte-identical to the pre-transport behaviour — verified). The * instant a tmux server exists, its panes merge into the same session list, so * iTerm and tmux sessions show up together. This is what makes the iTerm→tmux * migration seamless and unblocks PAILot seeing both worlds at once. * * The iTerm path calls core.ts VERBATIM (raw SessionSnapshot: name=process name, * tabTitle separate, paiName=null) so every downstream consumer — gateway * displayName resolution, atPrompt heuristics, name matching — is unchanged. * * Per-id ops (send / busy) route by id shape: tmux pane ids start with "%", * iTerm uses GUIDs. With one transport active, everything routes to it. */ import type { SessionSnapshot } from "../adapters/iterm/core.js"; /** Enumerate sessions across all permitted transports, availability checked live. */ export declare function snapshotAllSessions(): SessionSnapshot[]; /** Translate a caller's $TMUX_PANE into the durable @aibroker_id identity. */ export declare function aibrokerIdForPane(paneId: string): string | null; /** Inject text + Enter into a session. Refuses a shell unless `allowShell`. */ export declare function typeIntoSession(id: string, text: string, opts?: { allowShell?: boolean; }): boolean; /** Inject text WITHOUT Enter (chunked / partial sends). Same guard. */ export declare function pasteTextIntoSession(id: string, text: string, opts?: { allowShell?: boolean; }): boolean; /** * Clear whatever is on the input line with Ctrl-U, WITHOUT typing or * submitting anything. Used only by the read-back-first typing sequence, and * only after text has been confirmed to have sat unchanged for minutes — see * inputLineDecision. Never sent blind ahead of a type. */ export declare function sendControlU(id: string): boolean; /** Send a bare Enter/CR — the last step of the read-back-first sequence, * only once the line has been read back and verified. */ export declare function sendEnterKey(id: string): boolean; /** * Escape a possible vi-normal-mode stall in the input box before typing. * iTerm-specific (AppleScript's `write text` into Claude Code's input can * land in vi normal mode); tmux's raw key injection never gets stuck this * way, so this is a no-op there. Safe to call on an already-empty line: 'i' * enters insert mode (or types nothing new if already in it beyond one * transient char), the backspace removes exactly what that keystroke added. */ export declare function escapeInputMode(id: string): void; /** Drop a cached readiness verdict (call right after launching into a tab). */ export declare function invalidateReadyCache(id?: string): void; /** True when the session is currently showing a live Claude prompt. */ export declare function isClaudeSession(id: string): boolean; /** * Read what a session is currently showing. Used by checkpoint's ack detection, * which watches for the screen to change (message landed) and then settle * (Claude finished). Returns null when the session can't be read. */ export declare function captureSession(id: string, lines?: number): string | null; /** True when a foreground program (Claude) is running, not at a shell prompt. */ export declare function isClaudeRunningInSession(id: string): boolean; /** * Set a tmux pane's title. Returns false for non-tmux ids — iTerm visuals are * set separately by the caller via the iTerm sessions adapter. */ export declare function setSessionTitle(id: string, title: string): boolean; /** * For a tmux pane id, return the iTerm2 session id of the tab currently viewing * it (via the tmux client tty → iTerm tty match), or null if detached / not on * iTerm. Uses the RAW iTerm enumeration (not the de-duped facade list, which * suppresses viewer tabs) so the host tab can still receive iTerm visuals. */ export declare function itermViewerSessionId(tmuxPaneId: string): string | null; //# sourceMappingURL=sync-facade.d.ts.map