mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-25 08:00:16 +08:00
refactor: 清理 parser worker rag merger 的历史类型问题
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
import * as fs from 'fs'
|
||||
import * as readline from 'readline'
|
||||
import * as path from 'path'
|
||||
import { KNOWN_PLATFORMS, ChatType, MessageType, type ChatPlatform } from '../../../../src/types/base'
|
||||
import { KNOWN_PLATFORMS, ChatType, MessageType } from '../../../../src/types/base'
|
||||
import type {
|
||||
FormatFeature,
|
||||
FormatModule,
|
||||
@@ -29,13 +29,10 @@ import type {
|
||||
ParsedMember,
|
||||
ParsedMessage,
|
||||
} from '../types'
|
||||
import { getFileSize, createProgress, readFileHeadBytes } from '../utils'
|
||||
import { getFileSize, createProgress } from '../utils'
|
||||
|
||||
// ==================== JSONL 行类型定义 ====================
|
||||
|
||||
/** JSONL 行类型 */
|
||||
type JsonlLineType = 'header' | 'member' | 'message'
|
||||
|
||||
/** Header 行结构 */
|
||||
interface JsonlHeader {
|
||||
_type: 'header'
|
||||
|
||||
@@ -362,7 +362,7 @@ function cleanupTempFile(filePath: string): void {
|
||||
* QQ Chat Exporter 预处理器
|
||||
*/
|
||||
export const qqPreprocessor: Preprocessor = {
|
||||
needsPreprocess(filePath: string, fileSize: number): boolean {
|
||||
needsPreprocess(_filePath: string, fileSize: number): boolean {
|
||||
return fileSize > PREPROCESS_THRESHOLD
|
||||
},
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ async function* parseDiscordExporter(options: ParseOptions): AsyncGenerator<Pars
|
||||
memberMap.set(author.id, {
|
||||
platformId: author.id,
|
||||
accountName: author.name,
|
||||
groupNickname: author.nickname || null,
|
||||
groupNickname: author.nickname || undefined,
|
||||
avatar: author.avatarUrl,
|
||||
roles: convertRoles(author.roles),
|
||||
})
|
||||
@@ -384,7 +384,7 @@ async function* parseDiscordExporter(options: ParseOptions): AsyncGenerator<Pars
|
||||
platformMessageId: msg.id, // 消息的平台原始 ID
|
||||
senderPlatformId: author.id,
|
||||
senderAccountName: author.name,
|
||||
senderGroupNickname: author.nickname || null,
|
||||
senderGroupNickname: author.nickname || undefined,
|
||||
timestamp: parseTimestamp(msg.timestamp),
|
||||
type: messageType,
|
||||
content: content || null,
|
||||
|
||||
Reference in New Issue
Block a user