/** * adapters/iterm/sessions.ts — Higher-level iTerm2 session management. * * Session variables, tab naming, discovery, creation, and lifecycle. * Does NOT import any transport send functions — callers handle message delivery. */ import { type SessionSnapshot } from "./core.js"; export declare function setItermSessionVar(itermSessionId: string, name: string): void; export declare function setItermTabName(itermSessionId: string, name: string): void; export declare function setItermBadge(itermSessionId: string, text: string): void; /** * Bring a session to the front by its iTerm2 unique ID. * * Returns false when no session carries that ID — which is the answer a caller * needs in order to fall back to relaunching, rather than reporting a dead * session as an unexplained failure. */ export declare function revealItermSession(itermSessionId: string): boolean; export declare function getItermSessionVar(itermSessionId: string): string | null; /** * Re-write chosen names onto tabs whose title has materially diverged. * * "Materially" is judged after normaliseLabel() strips the benign decorations * (spinner glyph prefix, "(node)"/"(claude)" process suffix): a busy marker on * the right name is not divergence, an auto-title "Name-smooth-fiddle" is. * Case and separators already fold, so only a real takeover triggers a write. * * Setters are injectable so tests observe the writes instead of performing * them; the production defaults are exactly what the rename handler uses. * Returns the count actually re-pinned — 0 means every surface already agrees. */ export declare function reassertPersistentTitles(deps?: { sessions?: SessionSnapshot[]; setTabName?: (id: string, name: string) => void; setSessionVar?: (id: string, name: string) => void; setBadge?: (id: string, name: string) => void; setPaneTitle?: (id: string, name: string) => boolean; viewerFor?: (paneId: string) => string | null; }): number; /** * The name an AUTO path (launch fallback, re-home default) may write: the * chosen name if the session has one, else the generated fallback. Launch * paths can be handed a reused live tab (see openSessionScript's busy guard), * and a generated name must not displace what the user chose there. */ export declare function autoTabName(sessionId: string, fallback: string): string; export declare function findItermSessionForTermId(termSessionId: string, itermSessionIdHint?: string): string | null; /** `pai worker follow` panes are not sessions; list surfaces skip them. */ export declare function isListed(s: { workerPane?: boolean; }): boolean; export declare function listClaudeSessions(): Array<{ id: string; name: string; }>; /** * Build a full session list with type classification and PAI name resolution. * Returns the data used by /s command. */ export declare function getSessionList(): Array<{ id: string; name: string; path: string; type: "claude" | "terminal"; paiName: string | null; atPrompt: boolean; }>; export declare function createClaudeSession(command?: string): string | null; export declare function createTerminalTab(command?: string): string | null; export declare function restartSession(itermSessionId: string, command?: string): Promise; export declare function killSession(itermSessionId: string): void; //# sourceMappingURL=sessions.d.ts.map