2026-08-05 19:24:41 +08:00
|
|
|
import type { ChatSummary } from "./types";
|
|
|
|
|
|
2026-08-06 18:29:04 +08:00
|
|
|
const WEBSOCKET_SESSION_KEY_PREFIX = "websocket:";
|
2026-08-05 19:24:41 +08:00
|
|
|
|
2026-08-07 11:20:08 +08:00
|
|
|
export function createTemporaryChatSession(chatId: string): ChatSummary {
|
2026-08-05 19:24:41 +08:00
|
|
|
const now = new Date().toISOString();
|
|
|
|
|
return {
|
2026-08-06 18:29:04 +08:00
|
|
|
key: `${WEBSOCKET_SESSION_KEY_PREFIX}${chatId}`,
|
2026-08-05 19:24:41 +08:00
|
|
|
channel: "websocket",
|
|
|
|
|
chatId,
|
|
|
|
|
createdAt: now,
|
|
|
|
|
updatedAt: now,
|
|
|
|
|
preview: "",
|
|
|
|
|
};
|
|
|
|
|
}
|