legion-tty 0.4.12 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9506a28fb68d7623dd1e70e2b69b80e80b2a96486c068dbc2d13a7e2bd9a80ab
4
- data.tar.gz: 7ce9e32334ba94891569b073e04246240d8b1637edb930f0c8c86ed80841a155
3
+ metadata.gz: bc958211b7004e0392a9e96cf2a874d6c54d6f0c6f183d87d80f428e16d3b014
4
+ data.tar.gz: 13264f1761391724054983f250767d9308aab1a397d0dc1577292268a0f7e031
5
5
  SHA512:
6
- metadata.gz: b7cf759adc8fcaad726906fd6e95d12a00d5e09bbf3724685a1fae91bdd31d9df31036bc4d826cc7b756f2cb97ae2d560290dbb6c1f0473b8334da48508d5a39
7
- data.tar.gz: 7fcce87bc7f909f1e5b5c6d468871860a0a2be6f621a8b446d7948cf2761bf354035911d946c134b74d04b226e19f2b174c010d1fb9e7a39533162f826883865
6
+ metadata.gz: fd92069e863ebb5bd1185068adf3f50323fb276a2ae0479a8253e0220c1e4bc22a76abb7b8eb73a4c4a22c84be9f22cddf6eea22d510d7772fd459d3d74a1ff9
7
+ data.tar.gz: afcce634192c2e16f133b0d237cd3720536dfce07e2cae17089f208867546d82d75a58bb352887da1d0d29c0e651d047b79596fea0428d35f152e48f17707069
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.13] - 2026-03-19
4
+
5
+ ### Added
6
+ - Help overlay: `/help` now renders as a categorized overlay (SESSION/CHAT/LLM/NAV/DISPLAY/TOOLS) via screen manager
7
+ - Session message count in status bar ("N msgs" segment)
8
+ - `/welcome` command: redisplay the welcome message
9
+ - `/tips` command: show random usage tips (15 tips covering commands, hotkeys, features)
10
+
3
11
  ## [0.4.12] - 2026-03-19
4
12
 
5
13
  ### Added
data/README.md CHANGED
@@ -2,30 +2,36 @@
2
2
 
3
3
  Rich terminal UI for the LegionIO async cognition engine.
4
4
 
5
- **Version**: 0.4.8
5
+ **Version**: 0.4.12
6
6
 
7
- Think Claude Code meets Codex CLI, but for LegionIO: onboarding wizard with identity detection, streaming AI chat shell, operational dashboard, extensions browser, config editor, and session persistence - all rendered with the [tty-ruby](https://ttytoolkit.org/) gem ecosystem.
7
+ Think Claude Code meets Codex CLI, but for LegionIO: onboarding wizard with identity detection, streaming AI chat shell with 40 slash commands, operational dashboard, extensions browser, config editor, and session persistence - all rendered with the [tty-ruby](https://ttytoolkit.org/) gem ecosystem.
8
8
 
9
9
  ## Features
10
10
 
11
11
  - **Onboarding wizard** - First-run setup with Kerberos identity detection, GitHub profile probing, environment scanning, and LLM provider selection
12
12
  - **Digital rain intro** - Matrix-style rain using discovered LEX extension names
13
- - **AI chat shell** - Streaming LLM chat with 27 slash commands, tab completion, markdown rendering, and tool panels
14
- - **Operational dashboard** - Service status, extension inventory, system info, recent activity (Ctrl+D or `/dashboard`)
15
- - **Extensions browser** - Browse installed LEX gems by category (core, agentic, service, AI, other) with detail view
16
- - **Config viewer/editor** - View and edit `~/.legionio/settings/*.json` with vault:// masking
13
+ - **AI chat shell** - Streaming LLM chat with 40 slash commands, tab completion, markdown rendering, and tool panels
14
+ - **Operational dashboard** - Service/LLM status, extension inventory, system info, panel navigation (Ctrl+D or `/dashboard`)
15
+ - **Extensions browser** - Browse installed LEX gems by category with detail view and homepage opener ('o' key)
16
+ - **Config viewer/editor** - View and edit `~/.legionio/settings/*.json` with vault:// masking and JSON validation
17
17
  - **Command palette** - Fuzzy-search overlay for all commands, screens, and sessions (Ctrl+K or `/palette`)
18
18
  - **Model picker** - Switch LLM providers interactively
19
- - **Session management** - Auto-save on quit, `/save`, `/load`, `/sessions`, session picker (Ctrl+S)
19
+ - **Session management** - Auto-save on quit, `/save`, `/load`, `/sessions`, `/rename`, session picker (Ctrl+S)
20
20
  - **Token tracking** - Per-model pricing for 9 models across 8 providers via `/cost`
21
21
  - **Plan mode** - Bookmark messages without sending to LLM (`/plan`)
22
22
  - **Personality styles** - Switch between default, concise, detailed, friendly, technical (`/personality`)
23
23
  - **Theme selection** - Four built-in themes: purple (default), green, blue, amber (`/theme`)
24
- - **Conversation tools** - `/compact`, `/copy`, `/diff`, `/search`, `/stats`
24
+ - **Conversation tools** - `/compact`, `/copy`, `/diff`, `/search`, `/grep`, `/stats`, `/undo`
25
+ - **Message pinning** - Pin important messages (`/pin`), view pins (`/pins`), export bookmarks (`/bookmark`)
26
+ - **Command aliases** - Create custom shortcuts for frequently used commands (`/alias`)
27
+ - **Code snippets** - Save and load reusable text snippets (`/snippet`)
28
+ - **Debug mode** - Toggle internal state display (`/debug`)
29
+ - **Session context** - View active settings summary (`/context`)
30
+ - **Toast notifications** - Transient status bar messages for save/load/export/theme actions
25
31
  - **Hotkey navigation** - Ctrl+D (dashboard), Ctrl+K (palette), Ctrl+S (sessions), Escape (back)
26
32
  - **Tab completion** - Type `/` and Tab to auto-complete slash commands
27
- - **Input history** - Up/down arrow to navigate previous inputs
28
- - **Progress panel** - Visual progress bars for long operations (extension scanning, gem ops)
33
+ - **Input history** - Up/down arrow to navigate previous inputs, `/history` to view
34
+ - **Progress panel** - Visual progress bars for long operations
29
35
  - **Animated spinner** - Status bar spinner during LLM thinking
30
36
  - **Daemon routing** - Routes through LegionIO daemon when available, falls back to direct
31
37
  - **Second-run flow** - Skips onboarding, re-scans environment, drops into chat
@@ -74,9 +80,9 @@ legion chat prompt "explain async cognition"
74
80
  | `/quit` | Exit (auto-saves session) |
75
81
  | `/clear` | Clear message history |
76
82
  | `/model <name>` | Switch LLM model at runtime |
77
- | `/session <name>` | Rename current session |
83
+ | `/session <name>` | Set session name |
78
84
  | `/cost` | Show token usage and estimated cost |
79
- | `/export [md\|json]` | Export chat history to file |
85
+ | `/export [md\|json\|html]` | Export chat history to file |
80
86
  | `/tools` | List discovered LEX extensions |
81
87
  | `/dashboard` | Toggle operational dashboard |
82
88
  | `/hotkeys` | Show registered hotkey bindings |
@@ -91,11 +97,24 @@ legion chat prompt "explain async cognition"
91
97
  | `/config` | View and edit settings files |
92
98
  | `/theme [name]` | Switch color theme (purple/green/blue/amber) |
93
99
  | `/search <text>` | Search message history |
100
+ | `/grep <pattern>` | Regex search across messages |
94
101
  | `/compact [N]` | Keep last N message pairs, remove older |
95
102
  | `/copy` | Copy last assistant response to clipboard |
96
103
  | `/diff` | Show new messages since last session load |
97
104
  | `/stats` | Show conversation statistics |
98
105
  | `/personality [style]` | Switch personality (default/concise/detailed/friendly/technical) |
106
+ | `/undo` | Remove last user+assistant message pair |
107
+ | `/history` | Show input history |
108
+ | `/pin [N]` | Pin a message (last assistant or by index) |
109
+ | `/pins` | Show all pinned messages |
110
+ | `/rename <name>` | Rename current session (moves saved file) |
111
+ | `/context` | Show active session state summary |
112
+ | `/alias [name] [cmd]` | Create or list command aliases |
113
+ | `/snippet <action>` | Save/load/list/delete code snippets |
114
+ | `/debug` | Toggle debug mode |
115
+ | `/uptime` | Show session elapsed time |
116
+ | `/bookmark` | Export pinned messages to file |
117
+ | `/time` | Show current date and time |
99
118
 
100
119
  ## Hotkeys
101
120
 
@@ -120,16 +139,22 @@ legion-tty
120
139
 
121
140
  Screens/
122
141
  Onboarding # First-run wizard (rain -> intro -> wizard -> reveal)
123
- Chat # AI chat REPL with streaming + slash commands
124
- Dashboard # Operational status panels
125
- Extensions # LEX gem browser by category
126
- Config # Settings file viewer/editor
142
+ Chat # AI chat REPL with streaming + 40 slash commands
143
+ SessionCommands # save/load/sessions/delete/rename
144
+ ExportCommands # export/bookmark/html/json/markdown
145
+ MessageCommands # compact/copy/diff/search/grep/undo/pin/pins
146
+ UiCommands # help/clear/dashboard/hotkeys/palette/context/stats/debug/history/uptime/time
147
+ ModelCommands # model/system/personality switching
148
+ CustomCommands # alias/snippet management
149
+ Dashboard # Service/LLM status, panel navigation (j/k/1-5)
150
+ Extensions # LEX gem browser by category with homepage opener
151
+ Config # Settings file viewer/editor with JSON validation
127
152
 
128
153
  Components/
129
154
  DigitalRain # Matrix-style falling characters
130
- InputBar # Prompt line with tab completion + thinking indicator
131
- MessageStream # Scrollable message history with markdown rendering
132
- StatusBar # Model, plan mode, thinking, tokens, cost, session
155
+ InputBar # Prompt line with tab completion + input history
156
+ MessageStream # Scrollable message history with markdown + timestamps
157
+ StatusBar # Model, plan, debug, notifications, thinking, tokens, cost, session, scroll
133
158
  ToolPanel # Expandable tool use panels
134
159
  MarkdownView # TTY::Markdown rendering
135
160
  WizardPrompt # TTY::Prompt wrappers
@@ -161,6 +186,7 @@ Identity and credentials are stored in `~/.legionio/settings/`:
161
186
  - `credentials.json` - LLM provider and API key (chmod 600)
162
187
 
163
188
  Sessions are stored in `~/.legionio/sessions/`.
189
+ Snippets are stored in `~/.legionio/snippets/`.
164
190
  Exports go to `~/.legionio/exports/`.
165
191
  Boot logs go to `~/.legionio/logs/tty-boot.log`.
166
192
 
@@ -168,8 +194,8 @@ Boot logs go to `~/.legionio/logs/tty-boot.log`.
168
194
 
169
195
  ```bash
170
196
  bundle install
171
- bundle exec rspec # 653 examples, 0 failures
172
- bundle exec rubocop # 77 files, 0 offenses
197
+ bundle exec rspec # 836 examples, 0 failures
198
+ bundle exec rubocop # 92 files, 0 offenses
173
199
  ```
174
200
 
175
201
  ## License
@@ -6,10 +6,11 @@ require_relative 'notification'
6
6
  module Legion
7
7
  module TTY
8
8
  module Components
9
+ # rubocop:disable Metrics/ClassLength
9
10
  class StatusBar
10
11
  def initialize
11
12
  @state = { model: nil, tokens: 0, cost: 0.0, session: 'default', thinking: false, plan_mode: false,
12
- debug_mode: false }
13
+ debug_mode: false, message_count: 0 }
13
14
  @notifications = []
14
15
  end
15
16
 
@@ -46,6 +47,7 @@ module Legion
46
47
  notification_segment,
47
48
  tokens_segment,
48
49
  cost_segment,
50
+ message_count_segment,
49
51
  session_segment,
50
52
  scroll_segment
51
53
  ].compact
@@ -90,6 +92,11 @@ module Legion
90
92
  Theme.c(:success, format('$%.3f', @state[:cost])) if @state[:cost].to_f.positive?
91
93
  end
92
94
 
95
+ def message_count_segment
96
+ count = @state[:message_count].to_i
97
+ Theme.c(:muted, "#{count} msgs") if count.positive?
98
+ end
99
+
93
100
  def session_segment
94
101
  Theme.c(:muted, @state[:session]) if @state[:session]
95
102
  end
@@ -132,6 +139,7 @@ module Legion
132
139
  result
133
140
  end
134
141
  end
142
+ # rubocop:enable Metrics/ClassLength
135
143
  end
136
144
  end
137
145
  end
@@ -6,40 +6,61 @@ module Legion
6
6
  class Chat < Base
7
7
  # rubocop:disable Metrics/ModuleLength
8
8
  module UiCommands
9
+ TIPS = [
10
+ 'Press Tab after / to auto-complete commands',
11
+ 'Use /alias to create shortcuts (e.g., /alias s /save)',
12
+ 'Press Ctrl+K to open the command palette',
13
+ 'Use /grep for regex search (e.g., /grep error|warning)',
14
+ 'Pin important messages with /pin, export with /bookmark',
15
+ 'Use /compact 3 to keep only the last 3 message pairs',
16
+ "Press 'o' in Extensions browser to open gem homepage",
17
+ '/export html creates a styled dark-theme HTML export',
18
+ 'Use /snippet save name to save assistant responses for reuse',
19
+ 'The dashboard updates every 5 seconds; press r to refresh',
20
+ '/context shows your full session state at a glance',
21
+ 'Use /personality technical for code-focused responses',
22
+ '/debug shows internal state counters in the status bar',
23
+ 'Navigate dashboard panels with j/k or number keys 1-5',
24
+ 'Use /diff to see new messages since a session was loaded'
25
+ ].freeze
26
+
27
+ HELP_TEXT = [
28
+ 'SESSION : /save /load /sessions /delete /rename',
29
+ 'CHAT : /clear /undo /compact /copy /search /grep /diff /stats',
30
+ 'LLM : /model /system /personality /cost',
31
+ 'NAV : /dashboard /extensions /config /palette /hotkeys',
32
+ 'DISPLAY : /theme /plan /debug /context /time /uptime',
33
+ 'TOOLS : /tools /export /bookmark /pin /pins /alias /snippet /history',
34
+ '',
35
+ 'Hotkeys: Ctrl+D=dashboard Ctrl+K=palette Ctrl+S=sessions Esc=back'
36
+ ].freeze
37
+
9
38
  private
10
39
 
11
- # rubocop:disable Metrics/MethodLength
12
40
  def handle_help
41
+ text = HELP_TEXT.join("\n")
42
+ if @app.respond_to?(:screen_manager) && @app.screen_manager
43
+ @app.screen_manager.show_overlay(text)
44
+ else
45
+ @message_stream.add_message(role: :system, content: text)
46
+ end
47
+ :handled
48
+ end
49
+
50
+ def handle_welcome
51
+ cfg = safe_config
13
52
  @message_stream.add_message(
14
53
  role: :system,
15
- content: "Commands:\n /help /quit /clear /model <name> /session <name> /cost\n " \
16
- "/export [md|json] /tools /dashboard /hotkeys /save /load /sessions\n " \
17
- "/system <prompt> /delete <session> /plan /palette /extensions /config\n " \
18
- "/theme [name] -- switch color theme (purple, green, blue, amber)\n " \
19
- "/search <text> -- search message history\n " \
20
- "/grep <regex> -- regex search message history\n " \
21
- "/compact [n] -- keep last n message pairs (default 5)\n " \
22
- "/copy -- copy last assistant message to clipboard\n " \
23
- "/diff -- show new messages since session was loaded\n " \
24
- "/stats -- show conversation statistics\n " \
25
- "/personality [name] -- switch assistant personality\n " \
26
- "/undo -- remove last user+assistant message pair\n " \
27
- "/history -- show recent input history\n " \
28
- "/pin [N] -- pin last assistant message (or message at index N)\n " \
29
- "/pins -- show all pinned messages\n " \
30
- "/rename <name> -- rename current session\n " \
31
- "/context -- show active session context summary\n " \
32
- "/alias [shortname /command] -- create or list command aliases\n " \
33
- "/snippet save|load|list|delete <name> -- manage reusable text snippets\n " \
34
- "/debug -- toggle debug mode (shows internal state)\n " \
35
- "/uptime -- show how long this session has been active\n " \
36
- "/time -- show current date, time, and timezone\n " \
37
- "/bookmark -- export pinned messages to a markdown file\n\n" \
38
- 'Hotkeys: Ctrl+D=dashboard Ctrl+K=palette Ctrl+S=sessions Esc=back'
54
+ content: "Welcome#{", #{cfg[:name]}" if cfg[:name]}. Type /help for commands."
39
55
  )
40
56
  :handled
41
57
  end
42
- # rubocop:enable Metrics/MethodLength
58
+
59
+ def handle_tips
60
+ tip = TIPS.sample
61
+ @message_stream.add_message(role: :system, content: "Tip: #{tip}")
62
+ :handled
63
+ end
43
64
 
44
65
  def handle_clear
45
66
  @message_stream.messages.clear
@@ -28,7 +28,7 @@ module Legion
28
28
  SLASH_COMMANDS = %w[/help /quit /clear /compact /copy /diff /model /session /cost /export /tools /dashboard
29
29
  /hotkeys /save /load /sessions /system /delete /plan /palette /extensions /config
30
30
  /theme /search /grep /stats /personality /undo /history /pin /pins /rename
31
- /context /alias /snippet /debug /uptime /time /bookmark].freeze
31
+ /context /alias /snippet /debug /uptime /time /bookmark /welcome /tips].freeze
32
32
 
33
33
  PERSONALITIES = {
34
34
  'default' => 'You are Legion, an async cognition engine and AI assistant. Be helpful and concise.',
@@ -71,6 +71,7 @@ module Legion
71
71
  role: :system,
72
72
  content: "Welcome#{", #{cfg[:name]}" if cfg[:name]}. Type /help for commands."
73
73
  )
74
+ @status_bar.update(message_count: @message_stream.messages.size)
74
75
  end
75
76
 
76
77
  def running?
@@ -124,6 +125,7 @@ module Legion
124
125
  @message_stream.add_message(role: :assistant, content: '')
125
126
  send_to_llm(input)
126
127
  end
128
+ @status_bar.update(message_count: @message_stream.messages.size)
127
129
  render_screen
128
130
  end
129
131
 
@@ -336,6 +338,8 @@ module Legion
336
338
  when '/uptime' then handle_uptime
337
339
  when '/time' then handle_time
338
340
  when '/bookmark' then handle_bookmark
341
+ when '/welcome' then handle_welcome
342
+ when '/tips' then handle_tips
339
343
  else :handled
340
344
  end
341
345
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module TTY
5
- VERSION = '0.4.12'
5
+ VERSION = '0.4.13'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-tty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.12
4
+ version: 0.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity