feat: 支持平台消息id和回复id,同时进行表迁移

This commit is contained in:
digua
2026-01-09 00:04:21 +08:00
committed by digua
parent d7291768b1
commit 32fd5139d4
10 changed files with 121 additions and 19 deletions
@@ -73,6 +73,7 @@ interface JsonlMessage {
timestamp: number
type: number
content: string | null
replyToMessageId?: string
}
/** 任意 JSONL 行 */
@@ -215,6 +216,7 @@ async function* parseChatLabJsonl(options: ParseOptions): AsyncGenerator<ParseEv
timestamp: parsed.timestamp,
type: parsed.type as MessageType,
content: parsed.content,
replyToMessageId: parsed.replyToMessageId,
})
messagesProcessed++
+2
View File
@@ -65,6 +65,7 @@ interface ChatLabMessage {
timestamp: number // 秒级时间戳
type: number // MessageType
content: string | null
replyToMessageId?: string // 回复的目标消息 ID(平台原始 ID)
}
interface ChatLabMember {
@@ -204,6 +205,7 @@ async function* parseChatLab(options: ParseOptions): AsyncGenerator<ParseEvent,
timestamp: msg.timestamp,
type: msg.type,
content: msg.content,
replyToMessageId: msg.replyToMessageId,
})
messagesProcessed++
@@ -387,6 +387,7 @@ async function* parseDiscordExporter(options: ParseOptions): AsyncGenerator<Pars
timestamp: parseTimestamp(msg.timestamp),
type: messageType,
content: content || null,
replyToMessageId: msg.reference?.messageId || undefined,
})
messagesProcessed++