feat(webui): add temporary chat mode

This commit is contained in:
Xubin Ren
2026-08-08 23:20:59 +08:00
parent 113e8d67ad
commit c9a6145878
41 changed files with 1500 additions and 119 deletions
+21
View File
@@ -0,0 +1,21 @@
import type { ChatSummary } from "./types";
export const TEMPORARY_CHAT_ID_PREFIX = "temporary-";
export const TEMPORARY_CHAT_ROUTE_KEY = "__temporary_chat__";
export function isTemporaryChatId(value: string): boolean {
return value.startsWith(TEMPORARY_CHAT_ID_PREFIX);
}
export function createTemporaryChatSession(): ChatSummary {
const chatId = `${TEMPORARY_CHAT_ID_PREFIX}${crypto.randomUUID()}`;
const now = new Date().toISOString();
return {
key: `websocket:${chatId}`,
channel: "websocket",
chatId,
createdAt: now,
updatedAt: now,
preview: "",
};
}