feat(09-01): define granular event types, IPC channels, entity getters, and Zustand patch methods

- Add 5 granular event interfaces (TaskUpdated, RunUpdated, ApprovalUpdated, AgentUpdated, BudgetChanged) to DesktopEvent union
- Add 4 entity getter IPC channels (getTask, getAgent, getRun, getApproval) with Zod validation and company ownership checks
- Add getRun method to AppDatabase following existing getTask pattern
- Add 4 preload bridge methods for entity getters
- Add 8 patch/remove methods and refreshBadges to CompanySlice
- Add selective-ipc.test.ts with exhaustive union type tests
- Extend store.test.ts with 14 patch method tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 4.6 committed 2026-03-27 19:33:33 -04:00
1 parent c1de05a7f1
commit 920a764856
8 files changed
+631 -5

No files matched your search

+4
View File
@@ -82,6 +82,10 @@ const api: DesktopApi = {
ipcRenderer.invoke("recovery:dismiss", { taskId }),
recoveryFail: (taskId: string) =>
ipcRenderer.invoke("recovery:fail", { taskId }),
getTask: (input) => ipcRenderer.invoke(IPC_CHANNELS.getTask, input),
getAgent: (input) => ipcRenderer.invoke(IPC_CHANNELS.getAgent, input),
getRun: (input) => ipcRenderer.invoke(IPC_CHANNELS.getRun, input),
getApproval: (input) => ipcRenderer.invoke(IPC_CHANNELS.getApproval, input),
subscribe: (callback: (event: DesktopEvent) => void) => {
const listener = (_event: Electron.IpcRendererEvent, payload: DesktopEvent) => callback(payload);
ipcRenderer.on(IPC_CHANNELS.rendererEvent, listener);