import type { StoreApi } from 'zustand'; import type { AgentChatStoreType } from '../types'; import { agentActions } from './agentActions'; import { messageActions } from './messageActions'; import { streamingActionsMiddleware } from './streamingActions'; export const basicActions = ( set: StoreApi['setState'], get: StoreApi['getState'], api: StoreApi, ) => ({ ...agentActions(set, get), ...messageActions(set, get), ...streamingActionsMiddleware(set, get, api), setLoading: (loading: boolean) => { set({ loading }); }, setError: (error: Error | null) => { set({ error }); }, clearError: () => { set({ error: null }); }, });