mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 01:51:44 +00:00
'top' and 'bottom' are positions relative to the input row, not the alt screen viewport: - top (default) → inline above the input, where the bar originally lived (what 'on' used to mean) - bottom → below the input, pinned to the last row - off → hidden Drops the literal top-of-screen placement; 'on' is kept as a backward- compat alias that resolves to 'top' at both the config layer (normalizeStatusBar, _coerce_statusbar) and the slash command.
32 lines
851 B
TypeScript
32 lines
851 B
TypeScript
import { atom } from 'nanostores'
|
|
|
|
import { ZERO } from '../domain/usage.js'
|
|
import { DEFAULT_THEME } from '../theme.js'
|
|
|
|
import type { UiState } from './interfaces.js'
|
|
|
|
const buildUiState = (): UiState => ({
|
|
bgTasks: new Set(),
|
|
busy: false,
|
|
compact: false,
|
|
detailsMode: 'collapsed',
|
|
info: null,
|
|
inlineDiffs: true,
|
|
showCost: false,
|
|
showReasoning: false,
|
|
sid: null,
|
|
status: 'summoning hermes…',
|
|
statusBar: 'top',
|
|
streaming: true,
|
|
theme: DEFAULT_THEME,
|
|
usage: ZERO
|
|
})
|
|
|
|
export const $uiState = atom<UiState>(buildUiState())
|
|
|
|
export const getUiState = () => $uiState.get()
|
|
|
|
export const patchUiState = (next: Partial<UiState> | ((state: UiState) => UiState)) =>
|
|
$uiState.set(typeof next === 'function' ? next($uiState.get()) : { ...$uiState.get(), ...next })
|
|
|
|
export const resetUiState = () => $uiState.set(buildUiState())
|