Download src/stores/browser-store.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 719 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/stores/browser-store.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/stores/browser-store.ts
-
curl -L -o browser-store.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/stores/browser-store.ts
719 Bytes
| import { create } from "zustand"; | |
| interface BrowserState { | |
| // URL of the last page the agent navigated to in the browser panel. | |
| url: string; | |
| // Base64-encoded screenshot of the browser window, when the tool provides one. | |
| screenshotSrc: string; | |
| } | |
| interface BrowserStore extends BrowserState { | |
| setUrl: (url: string) => void; | |
| setScreenshotSrc: (screenshotSrc: string) => void; | |
| reset: () => void; | |
| } | |
| const initialState: BrowserState = { | |
| url: "", | |
| screenshotSrc: "", | |
| }; | |
| export const useBrowserStore = create<BrowserStore>((set) => ({ | |
| ...initialState, | |
| setUrl: (url: string) => set({ url }), | |
| setScreenshotSrc: (screenshotSrc: string) => set({ screenshotSrc }), | |
| reset: () => set(initialState), | |
| })); | |