refactor(stores): split state and event unions into separate files

Extract `<Name>Context` interface + `initialContext` const into
`<name>-context.ts` and the event union into `<name>-events.ts` for
all four state machines (auth, chat, sidebar, user) under src/stores/.

- `*-machine.ts` keeps helpers, actors, actions, and the
  `setup().createMachine()` body; re-exports the types/initial value
  to preserve its public API.
- `*-types.ts` re-exports from the new files for backward compatibility
  (sidebar keeps enum re-exports, chat keeps GuestChatQuota).
- `index.ts` barrels updated to re-export the new files.
- Removed unused model imports (AuthMode, AuthPanelMode) from
  auth-machine.ts; kept LoginType, UiMessage, UserView where still
  used by actors/helpers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kanban
2026-06-10 18:21:28 +08:00
committed by chenhang
parent 0593920318
commit 744e23fc29
20 changed files with 233 additions and 171 deletions
+3
View File
@@ -5,7 +5,10 @@
* - reducer 逻辑已合并到 sidebar-machine.ts
* - 类型由 sidebar-types.ts 重新导出
* - React 入口为 sidebar-context.tsxuseMachine 包装)
* - Context 形状与初始值位于 sidebar-context.ts
* - 事件联合位于 sidebar-events.ts
*/
export * from "./sidebar-context";
export * from "./sidebar-events";
export * from "./sidebar-types";
export { sidebarMachine } from "./sidebar-machine";