chore(chat): refactor chat init into separate quota and history actors

Split `chatInitActor` into `loadQuotaActor` (guest quota fetch) and `loadHistoryActor` (local → network → save sync), and add `quotaLoaded` / `historyLoaded` state flags so the UI can display loading status during the new local-first history hydration flow. Also drop the now-unused `ChatInit` event and pipe Next.js stdout/stderr to a persistent log file in the post-receive hook for easier troubleshooting.
This commit is contained in:
2026-06-15 16:21:40 +08:00
parent cfc6de5a8c
commit 1f3980d461
8 changed files with 296 additions and 152 deletions
-2
View File
@@ -16,8 +16,6 @@
* chat-screen **不**直接创建 ChatWebSocket / 不读 AuthStorage(除 token 取值)。
*/
export type ChatEvent =
// 内部 UI 事件
| { type: "ChatInit" }
// 鉴权生命周期(**用户**显式触发登录后由 chat-screen 派)
| { type: "ChatGuestLogin" }
| { type: "ChatNonGuestLogin"; token: string }