import { type QuickCommitAiOptions } from "./git-quick-commit.js"; import type { ConversationTurn } from "./types.js"; /** * PTY 终端视图里,只有底部输入框整段提交(shortcutKey=enter_text)才总结标题。 * 逐键 pty_input / 方向键 / 单独回车不能触发,避免把按键当主题。 */ export declare function shouldGenerateSessionTopicFromPtyInput(view?: "chat" | "terminal", shortcutKey?: string): boolean; export interface SessionTopic { title: string; description: string; } export interface SessionTopicRequest { messages?: readonly ConversationTurn[]; input: string; cwd?: string; language?: string; ai?: QuickCommitAiOptions; onGenerating(generating: boolean): void; onTopic(topic: SessionTopic): void; onError(error: unknown): void; } export declare function isSameSessionTitle(left: string, right: string): boolean; /** Parent task / directory names must not become a terminal's displayed title. */ export declare function collectSessionTopicBlocklist(input: { taskName?: string | null; workspaceName?: string | null; cwd?: string; }): string[]; export declare function shouldAcceptGeneratedSessionTitle(title: string, blockedTitles?: readonly string[]): boolean; /** Immediate title from the user's command, without waiting for the model. */ export declare function summarizeSessionTitleFromInput(input: string, options?: { blockedTitles?: readonly string[]; }): string; export declare function summarizeSessionDescriptionFromInput(input: string): string; export declare function provisionalSessionTopic(input: string, blockedTitles?: readonly string[]): SessionTopic | null; export declare function sessionTopicBlocklistForSnapshot(snapshot: { cwd?: string; workspaceTaskId?: string; }, storage: { getWorkspaceTask(id: string): { name: string; workspaceId: string; } | null; getWorkspace(id: string): { name: string; } | null; }): string[]; /** Collect every completed user turn plus the newly submitted input in order. */ export declare function collectSessionTopicMessages(messages: readonly ConversationTurn[] | undefined, input: string): string[]; export declare function generateSessionTopic(userMessages: readonly string[], cwd?: string, language?: string, ai?: QuickCommitAiOptions): Promise; /** * Coalesces title refreshes per session. A newer user message invalidates an * in-flight result and is summarized together with every earlier user turn. */ export declare class SessionTopicCoordinator { private readonly generate; private readonly states; private disposed; constructor(generate?: typeof generateSessionTopic); request(sessionId: string, request: SessionTopicRequest): void; clear(): void; private run; }