/** * Thread selector component for switching between conversation threads. * Uses pi-tui overlay pattern with search and navigation. */ import { Box } from '@mariozechner/pi-tui'; import type { Focusable, TUI } from '@mariozechner/pi-tui'; import type { HarnessThread } from '@mastra/core/harness'; export interface ThreadSelectorOptions { tui: TUI; threads: HarnessThread[]; currentThreadId: string | null; /** Current resource ID — threads from this resource sort to the top */ currentResourceId?: string; /** Current project root path — threads tagged with this directory sort above other same-resource threads */ currentProjectPath?: string; onSelect: (thread: HarnessThread) => void; onCancel: () => void; /** Called when user presses 'c' to clone the selected thread */ onClone?: (thread: HarnessThread) => void; /** Function to fetch message previews for currently visible threads */ getMessagePreviews?: (threadIds: string[]) => Promise>; initialMessagePreviews?: Map; initialAttemptedPreviewThreadIds?: Set; onMessagePreviewsLoaded?: (previews: Map, attemptedThreadIds: Set) => void; } export declare class ThreadSelectorComponent extends Box implements Focusable { private searchInput; private listContainer; private allThreads; private filteredThreads; private selectedIndex; private currentThreadId; private currentResourceId; private currentProjectPath; private onSelectCallback; private onCancelCallback; private onCloneCallback; private tui; private getMessagePreviews; private onMessagePreviewsLoaded; private messagePreviews; private attemptedPreviewThreadIds; private loadingPreviewThreadIds; private previewLoadVersion; private previewLoadTimeout; private _focused; get focused(): boolean; set focused(value: boolean); constructor(options: ThreadSelectorOptions); private getVisibleRange; private getVisibleThreads; private getPreviewCandidates; private scheduleMessagePreviewLoad; private loadMessagePreviews; private buildUI; private sortThreads; private filterThreads; private formatTimeAgo; private updateList; handleInput(keyData: string): void; } //# sourceMappingURL=thread-selector.d.ts.map