Module: Legion::TTY::Screens::Chat::UiCommands

Includes:
Logging::Helper
Included in:
Legion::TTY::Screens::Chat
Defined in:
lib/legion/tty/screens/chat/ui_commands.rb

Constant Summary collapse

TIPS =
[
  'Press Tab after / to auto-complete commands',
  'Use /alias to create shortcuts (e.g., /alias s /save)',
  'Press Ctrl+K to open the command palette',
  'Use /grep for regex search (e.g., /grep error|warning)',
  'Pin important messages with /pin, export with /bookmark',
  'Use /compact 3 to keep only the last 3 message pairs',
  "Press 'o' in Extensions browser to open gem homepage",
  '/export html creates a styled dark-theme HTML export',
  'Use /snippet save name to save assistant responses for reuse',
  'The dashboard updates every 5 seconds; press r to refresh',
  '/context shows your full session state at a glance',
  'Use /personality technical for code-focused responses',
  '/debug shows internal state counters in the status bar',
  'Navigate dashboard panels with j/k or number keys 1-5',
  'Use /diff to see new messages since a session was loaded'
].freeze
HELP_TEXT =
[
  'SESSION : /save /load /sessions /delete /rename',
  'CHAT    : /clear /undo /compact /copy /search /grep /diff /stats',
  'LLM     : /model /system /personality /cost',
  'NAV     : /dashboard /extensions /config /palette /hotkeys',
  'DISPLAY : /theme /plan /debug /context /time /uptime',
  'TOOLS   : /tools /export /bookmark /pin /pins /alias /snippet /history',
  'UTILS   : /calc /rand',
  '',
  'Hotkeys: Ctrl+D=dashboard  Ctrl+K=palette  Ctrl+S=sessions  Esc=back'
].freeze
CALC_SAFE_PATTERN =
%r{\A[\d\s+\-*/.()%]*\z}
CALC_MATH_PATTERN =
%r{\A[\d\s+\-*/.()%]*(Math\.\w+\([\d\s+\-*/.()%,]*\)[\d\s+\-*/.()%]*)*\z}
FREQ_STOP_WORDS =
%w[
  the a an is are was were be been have has had do does did will would could should
  may might can shall to of in for on with at by from it this that i you we they
  he she my your our their and or but not no if then so as
].freeze
FREQ_ROW_FMT =
'  %<rank>2d. %-<word>20s %<count>5d  %<pct>5.1f%%'