feat: add event bus, WS workspace isolation, and global store migration
- Add internal event bus (server/internal/events/) with synchronous pub/sub and panic isolation per listener - Upgrade WebSocket Hub to workspace-scoped rooms with JWT auth and membership verification on connect - Add 10 new WS event types (comment CRUD, inbox read/archive, agent create/delete, workspace/member events) - Refactor all handlers and TaskService to publish events via Bus instead of direct Hub.Broadcast calls - Add WS broadcast listener that routes events to correct workspace - Frontend: WSClient sends token + workspace_id on connect with auto-reconnect refetch - Frontend: centralized useRealtimeSync hook dispatches all WS events to global Zustand stores - Migrate issues and inbox pages from local useState to global useIssueStore/useInboxStore - Make store addIssue/addItem idempotent to prevent duplicates - Remove dead packages/hooks/src/use-realtime.ts - Add feature tracking files for 4 planned features Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0ce25597d6
commit
9127e543d5
30 changed files with 1144 additions and 219 deletions
|
|
@ -7,8 +7,15 @@ const (
|
|||
EventIssueUpdated = "issue:updated"
|
||||
EventIssueDeleted = "issue:deleted"
|
||||
|
||||
// Comment events
|
||||
EventCommentCreated = "comment:created"
|
||||
EventCommentUpdated = "comment:updated"
|
||||
EventCommentDeleted = "comment:deleted"
|
||||
|
||||
// Agent events
|
||||
EventAgentStatus = "agent:status"
|
||||
EventAgentStatus = "agent:status"
|
||||
EventAgentCreated = "agent:created"
|
||||
EventAgentDeleted = "agent:deleted"
|
||||
|
||||
// Task events (server <-> daemon)
|
||||
EventTaskDispatch = "task:dispatch"
|
||||
|
|
@ -17,7 +24,16 @@ const (
|
|||
EventTaskFailed = "task:failed"
|
||||
|
||||
// Inbox events
|
||||
EventInboxNew = "inbox:new"
|
||||
EventInboxNew = "inbox:new"
|
||||
EventInboxRead = "inbox:read"
|
||||
EventInboxArchived = "inbox:archived"
|
||||
|
||||
// Workspace events
|
||||
EventWorkspaceUpdated = "workspace:updated"
|
||||
|
||||
// Member events
|
||||
EventMemberAdded = "member:added"
|
||||
EventMemberRemoved = "member:removed"
|
||||
|
||||
// Daemon events
|
||||
EventDaemonHeartbeat = "daemon:heartbeat"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue