Skip to content

🤯 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.

632 B
Raw Blame
import { type StateCreator } from 'zustand/vanilla';

import { type ChatStore } from '@/store/chat/store';
import { flattenActions } from '@/store/utils/flattenActions';

import { type SearchAction } from './search';
import { SearchActionImpl } from './search';

export type ChatBuiltinToolAction = SearchAction;

export const chatToolSlice: StateCreator<
  ChatStore,
  [['zustand/devtools', never]],
  [],
  ChatBuiltinToolAction
> = (
  ...params: Parameters<
    StateCreator<ChatStore, [['zustand/devtools', never]], [], ChatBuiltinToolAction>
  >
) => flattenActions<ChatBuiltinToolAction>([new SearchActionImpl(...params)]);