refactor(phase-11): extract specialized stores from gatewayStore

Decompose monolithic gatewayStore.ts (1660 lines) into focused stores:

- connectionStore.ts (444 lines) - WebSocket, auth, local gateway
- agentStore.ts (256 lines) - Clones, usage stats, plugins
- handStore.ts (498 lines) - Hands, triggers, approvals
- workflowStore.ts (255 lines) - Workflows, runs
- configStore.ts (537 lines) - QuickConfig, channels, skills

Each store uses client injection pattern for loose coupling.
Coordinator layer to be added in next commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-15 20:17:17 +08:00
parent 6a66ce159d
commit f22b1a2095
6 changed files with 2006 additions and 1 deletions

View File

@@ -560,4 +560,19 @@ ZCLAW 是基于 **OpenFang** (Rust Agent OS) 的 AI Agent 桌面客户端,核
* ✅ chatStore 测试通过 (11/11)
* ✅ gatewayStore 测试通过 (17/17)
*下一步: Phase 11 Store 重构*
*Phase 11 进行中 🔄 (2026-03-15)* - Store 重构分解
* 新 Store 文件:
*`connectionStore.ts` (444 行) - WebSocket 连接、认证、本地 Gateway
*`agentStore.ts` (256 行) - Clones、使用统计、插件状态
*`handStore.ts` (498 行) - Hands、Triggers、Approvals
*`workflowStore.ts` (255 行) - Workflows、WorkflowRuns
*`configStore.ts` (537 行) - QuickConfig、Channels、Skills、Models
* Store 行数: gatewayStore 1660 → 5 个子 Store (平均 358 行)
* 待完成:
* 🔄 创建协调层 (coordinator)
* 🔄 更新组件导入
* 代码质量:
* ✅ TypeScript 类型检查通过
*下一步: Phase 11 协调层创建*