server: reconcile ai_sessions persistence to Chunk 9 AISession shape
Reshape the ai_sessions table (migration 003) and mapping/routes to the full AISession contract: title, kind, notes, created_at, last_message_at; drop legacy role/model/settings. toAISession now maps the new columns and routes create/patch/messages handlers use the new shape.
This commit is contained in:
@@ -24,7 +24,7 @@ import type {
|
||||
} from "@pubscript/core";
|
||||
|
||||
/** A persisted session row. */
|
||||
interface SessionRow {
|
||||
export interface SessionRow {
|
||||
id: string;
|
||||
projectId: string;
|
||||
title: string;
|
||||
@@ -76,7 +76,8 @@ export function createIndexedDBPersistence(dbName = "pubscript"): AISessionPersi
|
||||
return table.where("projectId").equals(projectId).sortBy("updatedAt").then((rows) => rows.reverse());
|
||||
},
|
||||
async get(id: string) {
|
||||
return table.get(id) ?? null;
|
||||
const row = await table.get(id);
|
||||
return row ?? null;
|
||||
},
|
||||
async save(row: SessionRow) {
|
||||
await table.put(row);
|
||||
|
||||
Reference in New Issue
Block a user