Download src/stores/agent-store.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/stores/agent-store.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/stores/agent-store.ts
-
curl -L -o agent-store.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/stores/agent-store.ts
543 Bytes
| import { create } from "zustand"; | |
| import { AgentState } from "#/types/agent-state"; | |
| interface AgentStateData { | |
| curAgentState: AgentState; | |
| } | |
| interface AgentStore extends AgentStateData { | |
| setCurrentAgentState: (state: AgentState) => void; | |
| reset: () => void; | |
| } | |
| const initialState: AgentStateData = { | |
| curAgentState: AgentState.LOADING, | |
| }; | |
| export const useAgentStore = create<AgentStore>((set) => ({ | |
| ...initialState, | |
| setCurrentAgentState: (state: AgentState) => set({ curAgentState: state }), | |
| reset: () => set(initialState), | |
| })); | |