| 1 | import { create } from 'zustand' |
| 2 | import { buildDefaultMasterConfig, type SessionMasterConfig } from '@shared/master' |
| 3 | |
| 4 | type MasterWorkbenchState = { |
| 5 | config: SessionMasterConfig |
| 6 | setConfig: (config: SessionMasterConfig) => void |
| 7 | updateConfig: (patch: Partial<SessionMasterConfig>) => void |
| 8 | } |
| 9 | |
| 10 | export const useMasterWorkbenchStore = create<MasterWorkbenchState>((set) => ({ |
| 11 | config: buildDefaultMasterConfig(), |
| 12 | setConfig: (config) => set({ config }), |
| 13 | updateConfig: (patch) => set((state) => ({ config: { ...state.config, ...patch } })) |
| 14 | })) |
| 15 |