/** * 从 main() 提取出的模块级辅助函数 * * 这些函数仅引用模块级导入(streamStateManager, outputBuffer, * chatSessionStore)和同模块的兄弟函数, * 不捕获任何 main() 局部变量。 * * 时间线、工具状态和流式输出相关函数已拆分至 main-helpers-timeline.ts, * 此文件通过 re-export 保持向后兼容。 */ import { type PermissionRequestEvent } from '../opencode/client.js'; import { type StreamCardData } from '../feishu/cards-stream.js'; export type PermissionChatResolution = { chatId?: string; source: 'session' | 'parent_session' | 'related_session' | 'tool_call' | 'message' | 'unresolved'; }; export declare function toSessionId(value: unknown): string; export declare function toNonEmptyString(value: unknown): string | undefined; export declare function setToolCallCorrelation(toolCallId: unknown, chatId: unknown): void; export declare function setMessageCorrelation(messageId: unknown, chatId: unknown): void; export declare function getToolCallCorrelation(toolCallId: unknown): string | undefined; export declare function getMessageCorrelation(messageId: unknown): string | undefined; export declare function setCorrelationChatRef(_map: unknown, key: unknown, chatId: unknown): void; export declare function getCorrelationChatRef(_map: unknown, key: unknown): string | undefined; export declare function resolvePermissionChat(event: PermissionRequestEvent): PermissionChatResolution; export declare function resolveSessionConversation(sessionId: string): { platform: string; conversationId: string; } | null; export declare function buildBufferKeyBySession(sessionId: string, conversationId: string): string; export declare function buildPermissionQueueKeyBySession(sessionId: string, conversationId: string): string; export declare function formatProviderError(raw: unknown): string; export declare function upsertLiveCardInteraction(chatId: string, replyMessageId: string | null, cardData: StreamCardData, bodyMessageIds: string[], thinkingMessageId: string | null, openCodeMsgId: string): void; export declare function applyFailureToSession(sessionID: string, errorText: string): Promise; export { getPendingPermissionForChat, getOrCreateTimelineState, trimTimeline, upsertTimelineSegment, appendTimelineText, setTimelineText, upsertTimelineTool, upsertTimelineNote, getTimelineSegments, getPendingQuestionForBuffer, normalizeToolStatus, getToolStatusText, stringifyToolOutput, asRecord, pickFirstDefined, buildToolTraceOutput, clipToolTrace, mergeToolOutput, getOrCreateToolStateBucket, syncToolsToBuffer, upsertToolState, markActiveToolsCompleted, appendTextFromPart, appendReasoningFromPart, clearPartSnapshotsForSession, } from './main-helpers-timeline.js'; //# sourceMappingURL=main-helpers.d.ts.map