Files
hermes-agent/ui-tui/src/constants.ts
Brooklyn Nicholson af0f4a52fe feat: cute spinners
2026-04-08 13:45:34 -05:00

102 lines
2.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { Theme } from './theme.js'
import type { Role, Usage } from './types.js'
export const FACES = [
'(。•́︿•̀。)',
'(◔_◔)',
'(¬‿¬)',
'( •_•)>⌐■-■',
'(⌐■_■)',
'(´・_・`)',
'◉_◉',
'(°ロ°)',
'( ˘⌣˘)♡',
'ヽ(>∀<☆)☆',
'٩(๑❛ᴗ❛๑)۶',
'(⊙_⊙)',
'(¬_¬)',
'( ͡° ͜ʖ ͡°)',
'ಠ_ಠ'
]
export const HOTKEYS: [string, string][] = [
['Ctrl+C', 'interrupt / clear / exit'],
['Ctrl+D', 'exit'],
['Ctrl+G', 'open $EDITOR for prompt'],
['Ctrl+L', 'new session (clear)'],
['Ctrl+V', 'paste clipboard image'],
['Tab', 'apply completion'],
['↑/↓', 'completions / queue edit / history'],
['Esc', 'clear input'],
['Ctrl+A/E', 'home / end of line'],
['Ctrl+W', 'delete word'],
['Ctrl+U/K', 'delete to start / end'],
['Ctrl+←/→', 'jump word'],
['Home/End', 'start / end of line'],
['\\+Enter', 'multi-line continuation'],
['!cmd', 'run shell command'],
['{!cmd}', 'interpolate shell output inline']
]
export const INTERPOLATION_RE = /\{!(.+?)\}/g
export const LONG_MSG = 300
export const MAX_CTX = 128_000
export const PLACEHOLDERS = [
'Ask me anything…',
'Try "explain this codebase"',
'Try "write a test for…"',
'Try "refactor the auth module"',
'Try "/help" for commands',
'Try "fix the lint errors"',
'Try "how does the config loader work?"'
]
export const ROLE: Record<Role, (t: Theme) => { body: string; glyph: string; prefix: string }> = {
assistant: t => ({ body: t.color.cornsilk, glyph: t.brand.tool, prefix: t.color.bronze }),
system: t => ({ body: '', glyph: '·', prefix: t.color.dim }),
tool: t => ({ body: t.color.dim, glyph: '⚡', prefix: t.color.dim }),
user: t => ({ body: t.color.label, glyph: t.brand.prompt, prefix: t.color.label })
}
export const TOOL_VERBS: Record<string, string> = {
browser: '🌐 browsing',
clarify: '❓ asking',
create_file: '📝 creating',
delegate_task: '🤖 delegating',
delete_file: '🗑️ deleting',
execute_code: '⚡ executing',
image_generate: '🎨 generating',
list_files: '📂 listing',
memory: '🧠 remembering',
patch: '🩹 patching',
read_file: '📖 reading',
run_command: '⚙️ running',
search_code: '🔍 searching',
search_files: '🔍 searching',
terminal: '💻 terminal',
web_search: '🌐 searching',
write_file: '✏️ writing'
}
export const VERBS = [
'pondering',
'contemplating',
'musing',
'cogitating',
'ruminating',
'deliberating',
'mulling',
'reflecting',
'processing',
'reasoning',
'analyzing',
'computing',
'synthesizing',
'formulating',
'brainstorming'
]
export const ZERO: Usage = { calls: 0, input: 0, output: 0, total: 0 }