fix: 修复导出日期、语音和联系人名字问题

- 导出的 HTML:点月份先看日期,选中日期后才跳到对应消息。
- 语音转文字:不同账号、不同聊天里的语音不会再串到一起。
- 联系人名字:正常昵称显示不变;昵称异常时使用可见的备注或账号,导出文件名也能正常使用。
This commit is contained in:
Wxw-Gu committed 2026-09-13 11:15:30 +08:00
1 parent ab3b3731b7
commit add16885fe
19 files changed
+702 -150

No files matched your search

+139 -15
View File
@@ -329,6 +329,32 @@ body {
color: var(--accent);
}
.timeline-month small { color: inherit; }
.timeline-month-entry { display: grid; gap: 2px; }
.timeline-days {
display: grid;
gap: 1px;
margin: 0 0 4px 11px;
padding-left: 8px;
border-left: 1px solid var(--border);
}
.timeline-days[hidden] { display: none; }
.timeline-day {
width: 100%;
display: flex;
justify-content: space-between;
gap: 8px;
border: 0;
border-radius: 6px;
background: transparent;
color: var(--muted);
padding: 5px 7px;
cursor: pointer;
font: inherit;
font-size: 11px;
text-align: left;
}
.timeline-day:hover, .timeline-day.active { background: var(--accent-soft); color: var(--accent); }
.timeline-day small { color: inherit; }
.scroll { width: 100%; max-width: 100%; overflow: auto; min-width: 0; padding: 10px 8px 36px; }
.lazy-hint {
width: min(100%, 820px);
@@ -787,6 +813,23 @@ body {
}
.timeline-months { display: flex; gap: 6px; }
.timeline-months[hidden] { display: none; }
.timeline-month-entry { display: grid; gap: 2px; }
.timeline-days {
display: flex;
gap: 4px;
margin: 0;
padding: 0;
border-left: 0;
}
.timeline-days[hidden] { display: none; }
.timeline-day {
width: auto;
flex: 0 0 auto;
border-bottom: 2px solid transparent;
padding: 5px 6px;
white-space: nowrap;
}
.timeline-day:hover, .timeline-day.active { border-bottom-color: var(--accent); }
.timeline-month {
flex: 0 0 auto;
width: auto;
@@ -879,6 +922,9 @@ const renderExportScript = (name: string): string => `
let scrollLoadSuppressed = false
let activeMonthUpdatePending = false
let expandedTimelineYear = ''
let expandedTimelineMonth = ''
let selectedTimelineMonth = ''
let selectedTimelineDate = ''
const tabPositions = new Map()
let lastScrollTop = 0
let zoom = 1
@@ -941,6 +987,13 @@ const renderExportScript = (name: string): string => `
const date = new Date(timestamp * 1000)
return date.getFullYear() + '-' + pad(date.getMonth() + 1)
}
const dateKey = (message) => {
const timestamp = Number(message.createTime || 0)
if (!timestamp) return 'unknown'
const date = new Date(timestamp * 1000)
if (Number.isNaN(date.getTime())) return 'unknown'
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate())
}
const kindOf = (message) => {
const data = message.contentData || {}
const shareType = String(data.typeVal || '')
@@ -1317,6 +1370,15 @@ const renderExportScript = (name: string): string => `
if (months) months.hidden = !expanded
})
}
const setExpandedTimelineMonth = (month) => {
expandedTimelineMonth = month || ''
timeline.querySelectorAll('.timeline-month').forEach((button) => {
const expanded = button.dataset.month === expandedTimelineMonth
button.setAttribute('aria-expanded', String(expanded))
const days = button.nextElementSibling
if (days) days.hidden = !expanded
})
}
const renderTimeline = () => {
if (filtered.length === 0) {
expandedTimelineYear = ''
@@ -1327,18 +1389,36 @@ const renderExportScript = (name: string): string => `
for (const message of filtered) {
const key = monthKey(message)
if (key === 'unknown') continue
groups.set(key, (groups.get(key) || 0) + 1)
const date = dateKey(message)
const group = groups.get(key) || { total: 0, days: new Map() }
group.total += 1
if (date !== 'unknown') group.days.set(date, (group.days.get(date) || 0) + 1)
groups.set(key, group)
}
const yearGroups = new Map()
for (const [key, total] of groups) {
for (const [key, group] of groups) {
const parts = key.split('-')
if (!yearGroups.has(parts[0])) yearGroups.set(parts[0], [])
yearGroups.get(parts[0]).push({ key, month: Number(parts[1]), total })
yearGroups.get(parts[0]).push({
key,
month: Number(parts[1]),
total: group.total,
days: Array.from(group.days.entries())
.sort(([left], [right]) => left.localeCompare(right))
.map(([date, total]) => ({ date, day: Number(date.slice(-2)), total }))
})
}
const years = Array.from(yearGroups.keys())
const years = Array.from(yearGroups.keys()).sort((left, right) => left.localeCompare(right))
if (!years.includes(expandedTimelineYear)) {
expandedTimelineYear = years[years.length - 1] || ''
}
for (const entries of yearGroups.values()) {
entries.sort((left, right) => left.key.localeCompare(right.key))
}
const allMonthKeys = Array.from(groups.keys()).sort((left, right) => left.localeCompare(right))
if (!allMonthKeys.includes(expandedTimelineMonth)) {
expandedTimelineMonth = allMonthKeys[allMonthKeys.length - 1] || ''
}
let html = ''
for (const year of years) {
const expanded = year === expandedTimelineYear
@@ -1348,10 +1428,18 @@ const renderExportScript = (name: string): string => `
'" aria-expanded="' + String(expanded) + '" aria-controls="' + esc(monthsId) + '">' +
esc(year) + ' 年</button>' +
'<div class="timeline-months" id="' + esc(monthsId) + '"' + (expanded ? '' : ' hidden') + '>' +
yearGroups.get(year).map((entry) =>
'<button class="timeline-month" type="button" data-month="' + esc(entry.key) + '">' +
'<span>' + entry.month + ' 月</span><small>' + entry.total + '</small></button>'
).join('') + '</div></section>'
yearGroups.get(year).map((entry) => {
const monthExpanded = entry.key === expandedTimelineMonth
return '<div class="timeline-month-entry">' +
'<button class="timeline-month" type="button" data-month="' + esc(entry.key) +
'" aria-expanded="' + String(monthExpanded) + '">' +
'<span>' + entry.month + ' 月</span><small>' + entry.total + '</small></button>' +
'<div class="timeline-days" data-days-for-month="' + esc(entry.key) + '"' +
(monthExpanded ? '' : ' hidden') + '>' + entry.days.map((day) =>
'<button class="timeline-day" type="button" data-date="' + esc(day.date) + '">' +
'<span>' + esc(day.date.slice(5)) + '</span><small>' + day.total + '</small></button>'
).join('') + '</div></div>'
}).join('') + '</div></section>'
}
timeline.innerHTML = html || '<div class="timeline-empty">时间信息不可用</div>'
}
@@ -1377,16 +1465,27 @@ const renderExportScript = (name: string): string => `
const activeMessage = atBottom
? visible[visible.length - 1] || messages[messages.length - 1]
: anchoredMessage || visible[0] || messages[0]
const key = activeMessage && activeMessage.dataset.month
const key = selectedTimelineMonth || (selectedTimelineDate
? selectedTimelineDate.slice(0, 7)
: '') ||
(activeMessage && activeMessage.dataset.month)
const activeIndex = activeMessage ? Number(activeMessage.dataset.index) : -1
const activeDate =
selectedTimelineDate ||
(activeIndex >= 0 && filtered[activeIndex] ? dateKey(filtered[activeIndex]) : '')
let activeButton
timeline.querySelectorAll('.timeline-month').forEach((button) => {
const active = button.dataset.month === key
button.classList.toggle('active', active)
if (active) activeButton = button
})
timeline.querySelectorAll('.timeline-day').forEach((button) => {
button.classList.toggle('active', button.dataset.date === activeDate)
})
if (!activeButton) return
const activeYear = key.split('-')[0]
if (activeYear !== expandedTimelineYear) setExpandedTimelineYear(activeYear)
if (key !== expandedTimelineMonth) setExpandedTimelineMonth(key)
const timelineBounds = timeline.getBoundingClientRect()
const buttonBounds = activeButton.getBoundingClientRect()
if (buttonBounds.top < timelineBounds.top) {
@@ -1535,6 +1634,8 @@ const renderExportScript = (name: string): string => `
)
}
const applyFilters = (restorePosition = false) => {
selectedTimelineMonth = ''
selectedTimelineDate = ''
filtered = matchingMessages()
renderTimeline()
if (!restorePosition || !restoreTabPosition()) resetWindow(true)
@@ -1572,18 +1673,32 @@ const renderExportScript = (name: string): string => `
target.classList.add('located')
window.setTimeout(() => target.classList.remove('located'), 1600)
}
const jumpToMonth = (key) => {
const index = filtered.findIndex((message) => monthKey(message) === key)
const selectTimelineMonth = (key) => {
if (!filtered.some((message) => monthKey(message) === key)) return
selectedTimelineMonth = key
selectedTimelineDate = ''
setExpandedTimelineYear(key.split('-')[0])
setExpandedTimelineMonth(key)
timeline.querySelectorAll('.timeline-month').forEach((button) => {
button.classList.toggle('active', button.dataset.month === key)
})
}
const jumpToDate = (key) => {
const index = filtered.findIndex((message) => dateKey(message) === key)
if (index < 0) return
selectedTimelineMonth = ''
selectedTimelineDate = key
windowStart = Math.max(0, index - Math.floor(PAGE_SIZE / 4))
windowEnd = Math.min(filtered.length, windowStart + PAGE_SIZE)
windowStart = Math.max(0, windowEnd - PAGE_SIZE)
renderWindow()
const target = list.querySelector('.message[data-index="' + index + '"]')
setScrollTop(target ? Math.max(0, scrollTopForTarget(target, 24)) : 0)
setExpandedTimelineYear(key.split('-')[0])
timeline.querySelectorAll('.timeline-month').forEach((button) => {
button.classList.toggle('active', button.dataset.month === key)
const month = key.slice(0, 7)
setExpandedTimelineYear(month.slice(0, 4))
setExpandedTimelineMonth(month)
timeline.querySelectorAll('.timeline-day').forEach((button) => {
button.classList.toggle('active', button.dataset.date === key)
})
}
const slideWindow = (direction) => {
@@ -1620,6 +1735,10 @@ const renderExportScript = (name: string): string => `
const nearTop = currentTop < 180
const nearBottom = list.scrollHeight - currentTop - list.clientHeight < 240
lastScrollTop = currentTop
if (!scrollLoadSuppressed) {
selectedTimelineMonth = ''
selectedTimelineDate = ''
}
scheduleActiveMonthUpdate()
if (scrollLoadSuppressed) return
if (movingUp && nearTop) scheduleWindowSlide(-1)
@@ -1676,7 +1795,12 @@ const renderExportScript = (name: string): string => `
return
}
const button = event.target.closest('[data-month]')
if (button) jumpToMonth(button.dataset.month)
if (button) {
selectTimelineMonth(button.dataset.month)
return
}
const dayButton = event.target.closest('[data-date]')
if (dayButton) jumpToDate(dayButton.dataset.date)
})
const updateZoom = () => preview.style.setProperty('--zoom', zoom)
+130 -74
View File
@@ -25,11 +25,12 @@ import { mergeCachedSelfInfo, type CachedSelfInfo } from './services/bootstrap-c
import type { VoiceRecognitionUseCase } from './voice-pipeline/voice-recognition-use-case'
import { imageFileQuality } from '../shared/image-quality'
import { resolveMemberName } from '../shared/member-names'
import { filesystemSafeName } from '../shared/contact-name'
const jobs = new Set<string>()
const activeArchives = new Map<string, Archiver>()
const safeFilePart = (value: string): string =>
value.replace(/[\\/:*?"<>|]/g, '_').trim() || '聊天档案'
const safeFilePart = (value: string, fallback = '聊天档案'): string =>
filesystemSafeName(value, fallback)
const copyWritableExportFile = async (source: string, destination: string): Promise<void> => {
try {
await fs.chmod(destination, 0o644)
@@ -643,6 +644,7 @@ const kindOf = (message: Message): ExportMessageKind => {
return 'text'
}
const csv = (value: unknown): string => `"${String(value ?? '').replace(/"/g, '""')}"`
const csvBom = '\uFEFF'
function render(format: ExportRequest['format'], messages: Message[], name: string): string {
if (format === 'html') return renderExportPage(name)
@@ -650,7 +652,7 @@ function render(format: ExportRequest['format'], messages: Message[], name: stri
return JSON.stringify({ name, exportedAt: new Date().toISOString(), messages }, null, 2)
if (format === 'markdown')
return `# ${name}\n\n${messages.map((m) => `**${m.name || (m.isSender ? '我' : '联系人')}** · ${m.datetime}\n\n${m.content || `[${m.type}]`}${m.exportMediaUrl || m.voiceDataUrl || m.exportMediaError ? `\n\n媒体:${m.exportMediaUrl || m.voiceDataUrl || m.exportMediaError}` : ''}\n`).join('\n')}`
return [
return csvBom + [
'时间,发送者,类型,内容,媒体路径,媒体状态',
...messages.map((m) =>
[
@@ -664,7 +666,7 @@ function render(format: ExportRequest['format'], messages: Message[], name: stri
.map(csv)
.join(',')
)
].join('\n')
].join('\r\n')
}
interface SingleExportOptions {
@@ -681,6 +683,8 @@ interface AllExportManifestEntry {
type: ExportTarget['type']
folder: string
messageCount: number
status: 'completed' | 'failed'
error?: string
}
const writeAllExportManifest = async (
@@ -1086,7 +1090,10 @@ async function runSingleExport(
}
const voiceService =
request.includeMedia && chat.getChatDb()
? new VoiceService(chat.getChatDb()!.getWcdb4Client())
? new VoiceService(
chat.getChatDb()!.getWcdb4Client(),
chat.getChatDb()!.getWcdb4Client().getAccountRoot()
)
: null
const voiceMessages = messages.filter((message) => kindOf(message) === 'voice')
const voicePhase = request.includeVoiceTranscripts ? 'transcribing' : 'media'
@@ -1635,6 +1642,8 @@ async function runAllExport(
let outputDir = ''
const manifest: AllExportManifestEntry[] = []
let totalMessages = 0
let failedCount = 0
const failureMessages: string[] = []
try {
const targets = [...(request.targets || [])].sort((left, right) =>
left.type === right.type ? 0 : left.type === 'group' ? -1 : 1
@@ -1667,80 +1676,121 @@ async function runAllExport(
const categoryName = target.type === 'group' ? '群聊' : '联系人'
const categoryDir = join(outputDir, categoryName)
const folderName = folderNames.get(target.userMd5) || safeFilePart(target.name)
await fs.mkdir(categoryDir, { recursive: true })
const conversationOutputRoot =
request.format === 'html' ? categoryDir : join(categoryDir, folderName)
const basePercent = Math.floor((targetIndex / targets.length) * 100)
send({
jobId: request.jobId,
phase: 'reading',
processed: 0,
percent: basePercent,
currentTargetIndex: targetIndex + 1,
currentTargetCount: targets.length,
currentTargetName: target.name,
currentTargetType: target.type
})
const folder = `${categoryName}/${folderName}`
let result: ExportResult
try {
await fs.mkdir(categoryDir, { recursive: true })
const conversationOutputRoot =
request.format === 'html' ? categoryDir : join(categoryDir, folderName)
const basePercent = Math.floor((targetIndex / targets.length) * 100)
send({
jobId: request.jobId,
phase: 'reading',
processed: 0,
percent: basePercent,
currentTargetIndex: targetIndex + 1,
currentTargetCount: targets.length,
currentTargetName: target.name,
currentTargetType: target.type
})
const result = await runSingleExport(
{
...request,
targets: [target],
outputName: target.name,
zip: false
},
win,
voiceRecognition,
{
outputRoot: conversationOutputRoot,
outputFolderName: request.format === 'html' ? folderName : undefined,
manageJob: false,
selfInfo,
sendProgress: (childProgress) => {
const childPercent = Math.max(0, Math.min(100, childProgress.percent || 0))
const percent = Math.min(
99,
Math.floor(((targetIndex + childPercent / 100) / targets.length) * 100)
)
const phase = childProgress.phase === 'completed' ? 'writing' : childProgress.phase
const now = Date.now()
const progressKey = `${targetIndex}:${phase}:${percent}`
const terminal = phase === 'failed' || phase === 'cancelled'
if (!terminal && progressKey === lastProgressKey && now - lastProgressAt < 500) return
lastProgressKey = progressKey
lastProgressAt = now
send({
...childProgress,
jobId: request.jobId,
phase,
percent,
outputPath: undefined,
currentTargetIndex: targetIndex + 1,
currentTargetCount: targets.length,
currentTargetName: target.name,
currentTargetType: target.type
})
result = await runSingleExport(
{
...request,
targets: [target],
outputName: target.name,
zip: false
},
win,
voiceRecognition,
{
outputRoot: conversationOutputRoot,
outputFolderName: request.format === 'html' ? folderName : undefined,
manageJob: false,
selfInfo,
sendProgress: (childProgress) => {
const childPercent = Math.max(0, Math.min(100, childProgress.percent || 0))
const percent = Math.min(
99,
Math.floor(((targetIndex + childPercent / 100) / targets.length) * 100)
)
const phase = childProgress.phase === 'completed' ? 'writing' : childProgress.phase
const now = Date.now()
const progressKey = `${targetIndex}:${phase}:${percent}`
const terminal = phase === 'failed' || phase === 'cancelled'
if (!terminal && progressKey === lastProgressKey && now - lastProgressAt < 500) return
lastProgressKey = progressKey
lastProgressAt = now
send({
...childProgress,
jobId: request.jobId,
phase,
percent,
outputPath: undefined,
currentTargetIndex: targetIndex + 1,
currentTargetCount: targets.length,
currentTargetName: target.name,
currentTargetType: target.type
})
}
}
}
)
if (!result.success) {
if (result.error === '已取消') throw new Error('已取消')
throw new Error(`${target.name}:${result.error || '导出失败'}`)
)
} catch (error) {
const message = error instanceof Error ? error.message : String(error)
if (message === '已取消' || !jobs.has(request.jobId)) throw new Error('已取消')
result = { success: false, error: message }
}
const messageCount = result.messageCount || 0
totalMessages += messageCount
manifest.push({
id: target.userMd5,
name: target.name,
type: target.type,
folder: `${categoryName}/${folderName}`,
messageCount
})
if (!result.success) {
if (result.error === '已取消' || !jobs.has(request.jobId)) throw new Error('已取消')
const error = `${target.name}:${result.error || '导出失败'}`
failedCount += 1
failureMessages.push(error)
manifest.push({
id: target.userMd5,
name: target.name,
type: target.type,
folder,
messageCount: 0,
status: 'failed',
error: result.error || '导出失败'
})
const failedPercent = Math.min(
99,
Math.floor(((targetIndex + 1) / targets.length) * 100)
)
send({
jobId: request.jobId,
phase: 'failed',
processed: totalMessages,
total: totalMessages,
percent: failedPercent,
error,
currentTargetIndex: targetIndex + 1,
currentTargetCount: targets.length,
currentTargetName: target.name,
currentTargetType: target.type
})
} else {
const messageCount = result.messageCount || 0
totalMessages += messageCount
manifest.push({
id: target.userMd5,
name: target.name,
type: target.type,
folder,
messageCount,
status: 'completed'
})
}
await writeAllExportManifest(outputDir, manifest, totalMessages, 'running')
}
await writeAllExportManifest(outputDir, manifest, totalMessages, 'completed')
const finalStatus = failedCount ? 'failed' : 'completed'
const finalError = failedCount
? `全部导出完成:成功 ${targets.length - failedCount} 个,失败 ${failedCount} 个。${failureMessages.join(';')}`
: undefined
await writeAllExportManifest(outputDir, manifest, totalMessages, finalStatus, finalError)
let completedPath = outputDir
if (request.zip) {
@@ -1759,17 +1809,23 @@ async function runAllExport(
send({
jobId: request.jobId,
phase: 'completed',
phase: failedCount ? 'failed' : 'completed',
processed: totalMessages,
total: totalMessages,
percent: 100,
error: finalError,
outputPath: completedPath,
currentTargetIndex: targets.length,
currentTargetCount: targets.length,
currentTargetName: targets.at(-1)?.name,
currentTargetType: targets.at(-1)?.type
})
return { success: true, outputPath: completedPath, messageCount: totalMessages }
return {
success: failedCount === 0,
outputPath: completedPath,
messageCount: totalMessages,
...(finalError ? { error: finalError } : {})
}
} catch (error) {
const message = error instanceof Error ? error.message : String(error)
const cancelled = !jobs.has(request.jobId) || message === '已取消'
+2 -2
View File
@@ -818,7 +818,7 @@ app.whenReady().then(async () => {
const wcdb4Client = nextWechatDb.getWcdb4Client()
const sessions = await wcdb4Client.getSessionsAsync({ hydrateDisplayNames: false })
configureRecallProtection(wcdb4Client, resolvedRoot, settings.recallProtectionEnabled)
voiceService = new VoiceService(wcdb4Client)
voiceService = new VoiceService(wcdb4Client, resolvedRoot)
voiceRecognition?.connect(voiceService, resolvedRoot)
stickerService = new StickerService(wcdb4Client)
videoAssetService = new VideoAssetService(wcdb4Client)
@@ -1958,7 +1958,7 @@ app.whenReady().then(async () => {
if (!ok) return { success: false, error: '数据库未初始化或重新打开失败' }
const client = chat.getChatDb()?.getWcdb4Client()
if (client) {
voiceService = new VoiceService(client)
voiceService = new VoiceService(client, client.getAccountRoot())
voiceRecognition?.connect(voiceService, client.getAccountRoot())
const monitoring = await client.startMonitor((type, json) => {
client.invalidateSessionCache()
+13 -11
View File
@@ -4,6 +4,7 @@ import {
createDefaultAudioDecoderRegistry,
type EncodedVoiceSource
} from './voice-pipeline/audio-decoder'
import { voiceAccountIdentity, voiceMessageIdentity } from './voice-pipeline/voice-message-identity'
export {
findSilkWasmRuntimeLocation,
@@ -36,12 +37,16 @@ export interface VoiceReference {
export class VoiceService {
private wcdb4Client: Wcdb4Client
private readonly accountIdentity: string
private voiceCache = new Map<string, string>()
private pcmCache = new Map<string, ResolvedPcmAudio>()
private readonly decoderRegistry = createDefaultAudioDecoderRegistry()
constructor(wcdb4Client: Wcdb4Client) {
constructor(wcdb4Client: Wcdb4Client, accountRoot?: string) {
this.wcdb4Client = wcdb4Client
const clientWithRoot = wcdb4Client as unknown as { getAccountRoot?: () => string }
const resolvedRoot = accountRoot || clientWithRoot.getAccountRoot?.() || 'unbound-account'
this.accountIdentity = voiceAccountIdentity(resolvedRoot)
}
async resolveVoice(
@@ -50,7 +55,8 @@ export class VoiceService {
createTime: number,
svrId?: string | number
): Promise<{ success: boolean; data?: string; error?: string }> {
const cacheKey = this.buildCacheKey(sessionId, localId, createTime)
const reference = { sessionId, localId, createTime, svrId }
const cacheKey = this.buildCacheKey(reference)
const cached = this.voiceCache.get(cacheKey)
if (cached) {
@@ -89,7 +95,7 @@ export class VoiceService {
const missing: Array<{ index: number; reference: VoiceReference }> = []
references.forEach((reference, index) => {
const cached = this.voiceCache.get(
this.buildCacheKey(reference.sessionId, reference.localId, reference.createTime)
this.buildCacheKey(reference)
)
if (cached) results[index] = { success: true, data: cached }
else missing.push({ index, reference })
@@ -131,11 +137,7 @@ export class VoiceService {
decoded.channels
)
const data = wavData.toString('base64')
const cacheKey = this.buildCacheKey(
reference.sessionId,
reference.localId,
reference.createTime
)
const cacheKey = this.buildCacheKey(reference)
this.voiceCache.set(cacheKey, data)
this.pcmCache.set(cacheKey, { ...decoded, codec: 'silk' })
results[index] = { success: true, data }
@@ -168,7 +170,7 @@ export class VoiceService {
createTime: number,
svrId?: string | number
): Promise<ResolvePcmResult> {
const cacheKey = this.buildCacheKey(sessionId, localId, createTime)
const cacheKey = this.buildCacheKey({ sessionId, localId, createTime, svrId })
const cached = this.pcmCache.get(cacheKey)
if (cached) return { success: true, audio: cached }
@@ -217,8 +219,8 @@ export class VoiceService {
}
}
private buildCacheKey(sessionId: string, localId: number, createTime: number): string {
return `${sessionId}-${localId}-${createTime}`
private buildCacheKey(reference: VoiceReference): string {
return `voice-cache-v2:${this.accountIdentity}:${voiceMessageIdentity(reference)}`
}
private buildCandidates(sessionId: string): string[] {