import type { AgentControllerEvent, AgentControllerThread } from '@mastra/core/agent-controller'; import type { SourceControlStorageHandle } from '../storage/domains/source-control/base.js'; export interface ThreadTitleMirrorSession { readonly identity: { getResourceId(): string; }; readonly thread: { getById(args: { threadId: string; }): Promise; }; subscribe(listener: (event: AgentControllerEvent) => void): () => void; } export interface ThreadTitleMirrorDependencies { sourceControl: { sessions: Pick; }; } /** * Project the bound thread's title onto its source-control session row, from * whichever namer produced it — core on the first turn, the observational-memory * observer as the thread grows, or an explicit rename. * * The factory sidebar reads the session row, which otherwise keeps the raw first * prompt (chat sessions) or nothing at all (work sessions, which then show their * branch). Binding a thread reconciles the row against the stored title, so a * session started before this ran — or one whose rename event was missed — is * named the next time it is opened. * * A session names threads it is no longer showing, and each write reads the row * before replacing it. Titles for any other thread are therefore dropped, and * writes run one at a time so the last event wins rather than the fastest. */ export declare function observeSessionThreadTitle(session: ThreadTitleMirrorSession, { sourceControl }: ThreadTitleMirrorDependencies): () => void; //# sourceMappingURL=thread-title-mirror.d.ts.map