mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-10 13:31:38 +00:00
Add the in-window floating pet (sprite, speech bubble, contact shadow, profile-scoped, resize-safe) and a pop-out always-on-top overlay window with gestures and notifications. Add the Cmd+K pet picker page plus the appearance gallery and size slider in settings. Includes the pet stores, electron overlay wiring, i18n strings, and store tests.
34 lines
947 B
TypeScript
34 lines
947 B
TypeScript
import { atom } from 'nanostores'
|
|
|
|
/** Whether the global command palette (Cmd/Ctrl+K) is currently open. */
|
|
export const $commandPaletteOpen = atom(false)
|
|
|
|
/** Optional nested page to open when the palette next opens (e.g. `pets`). */
|
|
export const $commandPalettePage = atom<string | null>(null)
|
|
|
|
export function openCommandPalette(): void {
|
|
$commandPaletteOpen.set(true)
|
|
}
|
|
|
|
/** Open the palette directly on a nested page (`theme`, `pets`, …). */
|
|
export function openCommandPalettePage(page: string): void {
|
|
$commandPalettePage.set(page)
|
|
$commandPaletteOpen.set(true)
|
|
}
|
|
|
|
export function closeCommandPalette(): void {
|
|
$commandPaletteOpen.set(false)
|
|
$commandPalettePage.set(null)
|
|
}
|
|
|
|
export function setCommandPaletteOpen(open: boolean): void {
|
|
$commandPaletteOpen.set(open)
|
|
|
|
if (!open) {
|
|
$commandPalettePage.set(null)
|
|
}
|
|
}
|
|
|
|
export function toggleCommandPalette(): void {
|
|
$commandPaletteOpen.set(!$commandPaletteOpen.get())
|
|
}
|