/** * Shared collection + short-TTL cache for the /adopt V2 picker. * * The picker card is re-rendered on every search / page click, and Lark cards * are stateless server-side — so each click would otherwise re-run discovery. * Live discovery shells out to tmux (`tmux list-panes` + per-pane process-tree * walks) and scans the on-disk resume store, which is wasteful to repeat just * to flip a page. We snapshot candidates at first render, keyed by the card's * root message id, and serve search / page re-renders from that snapshot. * * Confirmation does NOT use the cache: a live pane may have exited between * render and click, so the card-handler re-discovers and re-validates the * chosen target before committing (mirrors the legacy adopt_select path). */ import type { DaemonSession } from '../core/types.js'; import type { AdoptableSession } from '../core/session-discovery.js'; import type { ZellijAdoptableSession } from '../core/zellij-adopt-discovery.js'; import type { ResumableSession } from '../adapters/cli/types.js'; export interface AdoptCandidates { sessions: Array; resumable: ResumableSession[]; /** The resume cap applied, so the card can show a truncation hint. */ resumeLimit: number; } /** * Discover adopt candidates for a bot: live panes (only this bot's CLI) plus * disk-resumable sessions. `discoverResumable` is injected to avoid a static * import cycle with command-handler (which owns the resume-discovery + limit). */ export declare function collectAdoptCandidates(botCliId: string | undefined, cliPathOverride: string | undefined, activeSessions: Map, discoverResumable: (cliId: any, cliPathOverride: string | undefined, activeSessions: Map, limit?: number) => Promise, resumeLimit: number, /** Exact live-process identity asserted only by a structured cliRuntime. * Kept separate from cliPathOverride because legacy paths may be wrappers. */ runtimeExecutable?: string): Promise; /** Store the candidates snapshot for a rendered picker card. */ export declare function cacheAdoptCandidates(rootId: string, candidates: AdoptCandidates, nowMs: number): void; /** Read a cached snapshot for search / page re-renders. Returns undefined when * absent or expired — caller re-discovers in that case. */ export declare function getCachedAdoptCandidates(rootId: string, nowMs: number): AdoptCandidates | undefined; /** Drop a card's snapshot (call on confirm / detach so it doesn't linger). */ export declare function clearAdoptCandidates(rootId: string): void; //# sourceMappingURL=adopt-picker.d.ts.map