legion-tty 0.4.3 → 0.4.4
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/legion/tty/components/status_bar.rb +5 -1
- data/lib/legion/tty/screens/chat.rb +37 -2
- data/lib/legion/tty/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8ea19b2f60e08522ddf09e24a577b745804f35189f764a9e8150a802f3dc33b5
|
|
4
|
+
data.tar.gz: a1ff57a93aba51bc23f0421fa8f35525251f0dcd73f858b004965d68aeaf0083
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '00195e25f48241ad47b602d4d37b4d19bb1c1dc817d63ecc144ffa145e198974e37020065b2937c6864d5917ad13fd98870c9396d5bd0e2aafaf1e6d4f58e5e7'
|
|
7
|
+
data.tar.gz: 4b0c13ed2eaee447e559fd030f6e096c87ffac1b60316d525151a157820faf7510abda2fe40938916fffc67a1a385192511b3693b4005c43c89a62189bbcb231
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.4] - 2026-03-19
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Animated spinner in status bar thinking indicator (cycles through frames on each render)
|
|
7
|
+
- `/search <text>` command: case-insensitive search across chat message history
|
|
8
|
+
- `/theme <name>` command: switch between purple, green, blue, amber themes at runtime
|
|
9
|
+
- Chat input history: up/down arrow navigation through previous inputs (via TTY::Reader history_cycle)
|
|
10
|
+
|
|
3
11
|
## [0.4.3] - 2026-03-19
|
|
4
12
|
|
|
5
13
|
### Added
|
|
@@ -26,6 +26,8 @@ module Legion
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
SPINNER_FRAMES = %w[| / - \\].freeze
|
|
30
|
+
|
|
29
31
|
private
|
|
30
32
|
|
|
31
33
|
def build_segments
|
|
@@ -52,7 +54,9 @@ module Legion
|
|
|
52
54
|
def thinking_segment
|
|
53
55
|
return nil unless @state[:thinking]
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
@spinner_index = ((@spinner_index || 0) + 1) % SPINNER_FRAMES.size
|
|
58
|
+
frame = SPINNER_FRAMES[@spinner_index]
|
|
59
|
+
Theme.c(:warning, "#{frame} thinking...")
|
|
56
60
|
end
|
|
57
61
|
|
|
58
62
|
def tokens_segment
|
|
@@ -13,7 +13,7 @@ module Legion
|
|
|
13
13
|
# rubocop:disable Metrics/ClassLength
|
|
14
14
|
class Chat < Base
|
|
15
15
|
SLASH_COMMANDS = %w[/help /quit /clear /model /session /cost /export /tools /dashboard /hotkeys /save /load
|
|
16
|
-
/sessions /system /delete /plan /palette /extensions /config /theme].freeze
|
|
16
|
+
/sessions /system /delete /plan /palette /extensions /config /theme /search].freeze
|
|
17
17
|
|
|
18
18
|
attr_reader :message_stream, :status_bar
|
|
19
19
|
|
|
@@ -276,6 +276,7 @@ module Legion
|
|
|
276
276
|
when '/extensions' then handle_extensions_screen
|
|
277
277
|
when '/config' then handle_config_screen
|
|
278
278
|
when '/theme' then handle_theme(input)
|
|
279
|
+
when '/search' then handle_search(input)
|
|
279
280
|
else :handled
|
|
280
281
|
end
|
|
281
282
|
end
|
|
@@ -287,7 +288,8 @@ module Legion
|
|
|
287
288
|
content: "Commands:\n /help /quit /clear /model <name> /session <name> /cost\n " \
|
|
288
289
|
"/export [md|json] /tools /dashboard /hotkeys /save /load /sessions\n " \
|
|
289
290
|
"/system <prompt> /delete <session> /plan /palette /extensions /config\n " \
|
|
290
|
-
"/theme [name] -- switch color theme (purple, green, blue, amber)\n
|
|
291
|
+
"/theme [name] -- switch color theme (purple, green, blue, amber)\n " \
|
|
292
|
+
"/search <text> -- search message history\n\n" \
|
|
291
293
|
'Hotkeys: Ctrl+D=dashboard Ctrl+K=palette Ctrl+S=sessions Esc=back'
|
|
292
294
|
)
|
|
293
295
|
:handled
|
|
@@ -589,6 +591,39 @@ module Legion
|
|
|
589
591
|
:handled
|
|
590
592
|
end
|
|
591
593
|
|
|
594
|
+
def handle_search(input)
|
|
595
|
+
query = input.split(nil, 2)[1]
|
|
596
|
+
unless query
|
|
597
|
+
@message_stream.add_message(role: :system, content: 'Usage: /search <text>')
|
|
598
|
+
return :handled
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
results = search_messages(query)
|
|
602
|
+
if results.empty?
|
|
603
|
+
@message_stream.add_message(role: :system, content: "No messages matching '#{query}'.")
|
|
604
|
+
else
|
|
605
|
+
lines = results.map { |r| " [#{r[:role]}] #{truncate_text(r[:content], 80)}" }
|
|
606
|
+
@message_stream.add_message(
|
|
607
|
+
role: :system,
|
|
608
|
+
content: "Found #{results.size} message(s) matching '#{query}':\n#{lines.join("\n")}"
|
|
609
|
+
)
|
|
610
|
+
end
|
|
611
|
+
:handled
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
def search_messages(query)
|
|
615
|
+
pattern = query.downcase
|
|
616
|
+
@message_stream.messages.select do |msg|
|
|
617
|
+
msg[:content].is_a?(::String) && msg[:content].downcase.include?(pattern)
|
|
618
|
+
end
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
def truncate_text(text, max_length)
|
|
622
|
+
return text if text.length <= max_length
|
|
623
|
+
|
|
624
|
+
"#{text[0...max_length]}..."
|
|
625
|
+
end
|
|
626
|
+
|
|
592
627
|
def detect_provider
|
|
593
628
|
cfg = safe_config
|
|
594
629
|
provider = cfg[:provider].to_s.downcase
|
data/lib/legion/tty/version.rb
CHANGED