feat(session-title): integrate queries ACP and TUI

This commit is contained in:
Tianyi Cui
2026-07-21 01:53:37 +08:00
parent 58dc5f94de
commit f71f96d292
131 changed files with 6142 additions and 5771 deletions

View File

@@ -7,6 +7,8 @@
import { Context, Service } from 'cordis'
import z from 'schemastery'
import type { SessionId } from '@deepseek-ai/dsh-session'
import { foldSessionTitle } from '@deepseek-ai/dsh-session-title'
import type { SessionTitleSnapshot } from '@deepseek-ai/dsh-session-title'
import type {
SessionEventReadRequest,
SessionEventRecord,
@@ -64,6 +66,16 @@ export class SessionQueryService extends Service {
return this._corpus.listSessions()
}
/**
* Fold the latest log-backed title from one live-preferred logical session.
* @param sessionId - live or persisted session id to read.
* @returns latest title snapshot, or `undefined` when the log has no title event.
*/
async readTitle(sessionId: SessionId): Promise<SessionTitleSnapshot | undefined> {
const loaded = await this._corpus.load(sessionId)
return foldSessionTitle(loaded.events)
}
/**
* List lightweight raw-log event records for one logical session.
* @param sessionId - live-preferred session id to read.