import type { EffortLevel } from '../commands/effort.js'; import type { ChatSessionData, InteractionRecord, SessionBindingOptions, ConversationBindingRecord, SessionOrderMode } from './session-types.js'; export type { ChatSessionData, InteractionRecord, SessionBindingOptions, ConversationBindingRecord, ChatSessionType, SessionOrderMode, } from './session-types.js'; declare class ChatSessionStore { private data; private sessionAliases; private chatIdToKeysIndex; constructor(); private load; private rebuildChatIdIndex; private addToChatIdIndex; private removeFromChatIdIndex; private hasChatIdInIndex; private save; private inferChatTypeFromTitle; private makeConversationKey; private parseConversationKey; private isNamespacedKey; private legacyToNamespacedKey; private hasLegacyKey; private getChatDataLegacyOrNamespaced; /** * 获取会话 ID(平台感知版本) * @param platform 平台标识(如 'feishu', 'discord') * @param conversationId 平台原生会话 ID * @returns sessionId 或 null */ getSessionIdByConversation(platform: string, conversationId: string): string | null; /** * 获取会话数据(平台感知版本) * @param platform 平台标识 * @param conversationId 平台原生会话 ID * @returns ChatSessionData 或 undefined */ getSessionByConversation(platform: string, conversationId: string): ChatSessionData | undefined; /** * 反向查找:通过 sessionId 获取 {platform, conversationId} * @param sessionId 会话 ID * @returns { platform, conversationId } 或 null */ getConversationBySessionId(sessionId: string): { platform: string; conversationId: string; } | null; /** * 旧版 getSessionId(兼容 Feishu 调用方) * 读取时优先 namespaced key,回退到 legacy key */ getSessionId(chatId: string): string | null; /** * 旧版 getSession(兼容 Feishu 调用方) * 读取时优先 namespaced key,回退到 legacy key */ getSession(chatId: string): ChatSessionData | undefined; getKnownDirectories(): string[]; getChatId(sessionId: string): string | undefined; private cleanupExpiredSessionAliases; private removeExistingBindingsForSession; /** * 设置会话(平台感知版本) * @param platform 平台标识 * @param conversationId 平台原生会话 ID * @param sessionId 会话 ID * @param creatorId 创建者 ID * @param title 会话标题 * @param options 绑定选项 */ setSessionByConversation(platform: string, conversationId: string, sessionId: string, creatorId: string, title?: string, options?: SessionBindingOptions): void; /** * 旧版 setSession(兼容 Feishu 调用方) * 写入时使用命名空间键(feishu 为默认平台) */ setSession(chatId: string, sessionId: string, creatorId: string, title?: string, options?: SessionBindingOptions): void; rememberSessionAlias(sessionId: string, chatId: string, ttlMs?: number): void; isSessionDeleteProtected(chatId: string): boolean; isPrivateChatSession(chatId: string): boolean; isGroupChatSession(chatId: string): boolean; updateConfig(chatId: string, config: { preferredModel?: string; preferredAgent?: string; preferredEffort?: EffortLevel; defaultDirectory?: string; sessionOrderMode?: SessionOrderMode; qqOutputOnlyText?: boolean; helpWithQc?: boolean; sessionWithCtl?: boolean; sessionWithChange?: boolean; }): void; updateConfigByConversation(platform: string, conversationId: string, config: { preferredModel?: string; preferredAgent?: string; preferredEffort?: EffortLevel; defaultDirectory?: string; sessionOrderMode?: SessionOrderMode; qqOutputOnlyText?: boolean; helpWithQc?: boolean; sessionWithCtl?: boolean; sessionWithChange?: boolean; }): void; updateTitle(chatId: string, title: string): void; updateTitleByConversation(platform: string, conversationId: string, title: string): void; updateResolvedDirectory(chatId: string, directory: string): void; private updateLegacyPointers; addInteraction(chatId: string, record: InteractionRecord): void; popInteraction(chatId: string): InteractionRecord | undefined; popInteractionByConversation(platform: string, conversationId: string): InteractionRecord | undefined; getLastInteraction(chatId: string): InteractionRecord | undefined; findInteractionByBotMsgId(chatId: string, msgId: string): InteractionRecord | undefined; updateInteraction(chatId: string, predicate: (r: InteractionRecord) => boolean, updater: (r: InteractionRecord) => void): void; updateLastInteraction(chatId: string, userMsgId: string, aiMsgId?: string): void; ensureInteraction(chatId: string, record: InteractionRecord): void; removeSession(chatId: string): void; removeSessionByConversation(platform: string, conversationId: string): void; markReminderSent(platform: string, conversationId: string): void; getChatsByCreator(userId: string): ChatSessionData[]; getConversationBindings(): ConversationBindingRecord[]; findPrivateConversationByCreator(userId: string, preferredPlatform?: string): ConversationBindingRecord | null; getAllChatIds(): string[]; /** * 获取指定平台的所有会话 ID * @param platform 平台标识(如 'feishu', 'discord') * @returns 该平台所有会话的 chatId 列表 */ getChatIdsByPlatform(platform: string): string[]; hasConversationId(conversationId: string): boolean; } export declare const chatSessionStore: ChatSessionStore; //# sourceMappingURL=chat-session.d.ts.map