refactor: add canonical transcript assembly seam

This commit is contained in:
tommy0103
2026-07-21 00:58:34 +08:00
parent 3ee44de4e5
commit f79f1b3e3b
39 changed files with 1741 additions and 670 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { setTimeout as delay } from 'node:timers/promises';
import { createSessionPatch } from '../src/shared/session-patch.mjs';
import { assembleSessionMessages } from '../src/shared/session-detail-assembly.mjs';
import { assembleSessionDetail } from '../src/shared/session-detail-assembly.mjs';
const here = dirname(fileURLToPath(import.meta.url));
const appRoot = join(here, '..');
@@ -106,13 +106,13 @@ function registerHandlers() {
ipcMain.handle('db:getSessionPatch', (_event, sessionId, cursor) => {
const fixture = fixtures[sessionId];
const patch = createSessionPatch({
messages: assembleSessionMessages({
messages: assembleSessionDetail({
messages: fixture.messages,
toolCalls: fixture.toolCalls,
toolResults: fixture.toolResults,
subagents: [],
workflows: [],
}),
}).messages,
workflows: [],
}, cursor);
return { ...patch, session: summary(sessionId) };