Add image-designer skill, align billing to DeepSeek ×1, and enrich Plaza demo.

Introduce AI image generation with chat shortcut and agent API, improve MindSpace chat-to-page save resolution, and seed Plaza covers with production deploy scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
John
2026-06-16 16:29:19 -07:00
parent 03690ee354
commit 6d99d762da
155 changed files with 2748 additions and 190 deletions
+32 -19
View File
@@ -507,30 +507,43 @@ export function useTKMindChat(
setChatState('loading');
setError(null);
let sessionId = readStoredSessionId(userRef.current?.id);
let staleSession = false;
let sessionId: string | null = null;
let freshSession: Session | null = null;
if (sessionId) {
try {
await getSession(sessionId);
} catch (err) {
if (err instanceof ApiError && (err.status === 403 || err.status === 404 || err.status === 400)) {
clearStoredSessionId(userRef.current?.id);
sessionId = null;
staleSession = true;
} else {
throw err;
}
}
setSessionsLoading(true);
try {
const items = sortAndTrim(await listSessions());
setSessions(items);
sessionId = items[0]?.id ?? null;
} catch {
// Fall back to stored session or create a new one when the list is unavailable.
} finally {
setSessionsLoading(false);
}
if (!sessionId) {
freshSession = await startSession();
sessionId = freshSession.id;
writeStoredSessionId(userRef.current?.id, sessionId);
if (staleSession) {
setNotice('上次会话已失效,已为你新建对话');
let staleSession = false;
sessionId = readStoredSessionId(userRef.current?.id);
if (sessionId) {
try {
await getSession(sessionId);
} catch (err) {
if (err instanceof ApiError && (err.status === 403 || err.status === 404 || err.status === 400)) {
clearStoredSessionId(userRef.current?.id);
sessionId = null;
staleSession = true;
} else {
throw err;
}
}
}
if (!sessionId) {
freshSession = await startSession();
sessionId = freshSession.id;
if (staleSession) {
setNotice('上次会话已失效,已为你新建对话');
}
}
}