🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
import { shallow } from 'zustand/shallow';
import { createWithEqualityFn } from 'zustand/traditional';
import { type StateCreator } from 'zustand/vanilla';
import { createDevtools } from '../middleware/createDevtools';
import { expose } from '../middleware/expose';
import { flattenActions } from '../utils/flattenActions';
import { type ResetableStore, ResetableStoreAction } from '../utils/resetableStore';
import { type NotebookAction } from './action';
import { createNotebookAction } from './action';
import { type NotebookState } from './initialState';
import { initialNotebookState } from './initialState';
export type NotebookStore = NotebookState & NotebookAction & ResetableStore;
class NotebookStoreResetAction extends ResetableStoreAction<NotebookStore> {
protected readonly resetActionName = 'resetNotebookStore';
}
const createStore: StateCreator<NotebookStore, [['zustand/devtools', never]]> = (
...parameters: Parameters<StateCreator<NotebookStore, [['zustand/devtools', never]]>>
) => ({
...initialNotebookState,
...flattenActions<NotebookAction & ResetableStore>([
createNotebookAction(...parameters),
new NotebookStoreResetAction(...parameters),
]),
});
const devtools = createDevtools('notebook');
export const useNotebookStore = createWithEqualityFn<NotebookStore>()(
devtools(createStore),
shallow,
);
expose('notebook', useNotebookStore);
export const getNotebookStoreState = () => useNotebookStore.getState();