feat: add bridge session commands (#743)

This commit is contained in:
ekko
2026-05-15 12:04:03 +08:00
committed by GitHub
parent 13fad02db8
commit 48dcaee6c2
22 changed files with 1180 additions and 88 deletions
@@ -201,6 +201,14 @@ export function deleteSession(id: string): boolean {
return result.changes > 0
}
export function clearSessionMessages(id: string): number {
if (!isSqliteAvailable()) return 0
const db = getDb()!
const result = db.prepare(`DELETE FROM ${MESSAGES_TABLE} WHERE session_id = ?`).run(id)
updateSessionStats(id)
return Number(result.changes)
}
export function renameSession(id: string, title: string): boolean {
if (!isSqliteAvailable()) return false
const db = getDb()!