riffer-rig 0.2.0 → 0.2.1

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: f87fb650798f95679ff56654620a0fcb3cc383d8ce650849d9e33382a7837a6f
4
- data.tar.gz: e8784d13f472d45c5ffb7f1d269c5ab8ff7d0b41a62cfae446ceaee2345413b9
3
+ metadata.gz: 935cb9bdd3c8aee780466f38ac5ee4122b22e63718140399df5f94e1c0d4dd26
4
+ data.tar.gz: 3ddc6c58d14e306f12a6d14f86d958df336f718a4d4c0b12be19ee34e9736dad
5
5
  SHA512:
6
- metadata.gz: '09252fc5c265fdc91be5fc8753b3407560c3be9f94af9616b2d3ae9e8e3c28f100374bb1014d7b8038bd51abc5f86875e6116fc874733ba58dda87254b15e3cc'
7
- data.tar.gz: 7f1cc7dae6f6ccf69cf370296458d1eef837111f01041adae31a59e48df6719903c1c43630cf0248ba4b7ba140d420f663a585dcb13f5c945d5f105eaa2b8fc9
6
+ metadata.gz: 629aa97a63e9437f086f36e373c1720965936f86aa5d4dfbc9d546143a42c8500bd89e3b820a655fcc848df53e25903c57ad1b744d9b4c33975b7858db714cef
7
+ data.tar.gz: 6e73d9d8d1f6d2ef95b5692e1a506eb2b7440937475a873a3db73713d130591b1f47926bec7c34ff57218f2c230f167077160ce22358bd508ae7a0fe36be5196
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.1](https://github.com/bottrall/riffer-rig/compare/v0.2.0...v0.2.1) (2026-09-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **ui:** hide the cursor while a turn is in flight ([#161](https://github.com/bottrall/riffer-rig/issues/161)) ([0d18fe0](https://github.com/bottrall/riffer-rig/commit/0d18fe06c51bb75a8f3002d22d64bda23671bad6))
9
+ * **ui:** stop the equalizer before the end-of-turn newline ([#158](https://github.com/bottrall/riffer-rig/issues/158)) ([00edaa3](https://github.com/bottrall/riffer-rig/commit/00edaa3bbf35a7d797ca3596820d11bd8c62789a))
10
+
3
11
  ## [0.2.0](https://github.com/bottrall/riffer-rig/compare/v0.1.2...v0.2.0) (2026-09-08)
4
12
 
5
13
 
@@ -4,11 +4,12 @@ class Riffer::Rig::REPL
4
4
  EXIT_COMMANDS = ['/exit', '/quit'].freeze
5
5
  SKILL_COMMAND = %r{\A/skill:([a-z0-9]+(?:-[a-z0-9]+)*)(?:\s+(.*))?\z}m
6
6
 
7
- def initialize(agent:, renderer:, input: $stdin, output: $stdout, theme: Riffer::Rig::UI::Theme.for(output), animator: Riffer::Rig::UI::Animator.new(io: output, theme:), smoother: Riffer::Rig::UI::Smoother.new(io: output, theme:))
7
+ def initialize(agent:, renderer:, input: $stdin, output: $stdout, theme: Riffer::Rig::UI::Theme.for(output), animator: Riffer::Rig::UI::Animator.new(io: output, theme:), smoother: Riffer::Rig::UI::Smoother.new(io: output, theme:), cursor: Riffer::Rig::UI::Cursor.new(io: output, theme:))
8
8
  @agent = agent
9
9
  @renderer = renderer
10
10
  @animator = animator
11
11
  @smoother = smoother
12
+ @cursor = cursor
12
13
  @theme = theme
13
14
  @input = input
14
15
  @output = output
@@ -40,6 +41,7 @@ class Riffer::Rig::REPL
40
41
  private
41
42
 
42
43
  def run_turn(prompt)
44
+ @cursor.hide
43
45
  @animator.start
44
46
  @smoother.start
45
47
  @agent.stream(prompt).each do |event|
@@ -65,6 +67,7 @@ class Riffer::Rig::REPL
65
67
  end
66
68
  @renderer.render(event)
67
69
  end
70
+ @animator.stop
68
71
  @smoother.finish
69
72
  @output.puts
70
73
  rescue StandardError => e
@@ -72,6 +75,7 @@ class Riffer::Rig::REPL
72
75
  ensure
73
76
  @smoother.finish
74
77
  @animator.stop
78
+ @cursor.show
75
79
  end
76
80
 
77
81
  def run_skill_command(name, args)
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Hides the terminal cursor while a turn is in flight: a hidden cursor can't
4
+ # flicker against the animator's erase-and-redraw churn.
5
+ class Riffer::Rig::UI::Cursor
6
+ HIDE = "\e[?25l"
7
+ SHOW = "\e[?25h"
8
+
9
+ def initialize(io: $stdout, theme: Riffer::Rig::UI::Theme.for(io))
10
+ @io = io
11
+ @theme = theme
12
+ end
13
+
14
+ def hide
15
+ write(HIDE)
16
+ end
17
+
18
+ def show
19
+ write(SHOW)
20
+ end
21
+
22
+ private
23
+
24
+ def write(sequence)
25
+ return unless enabled?
26
+
27
+ @io.print(sequence)
28
+ @io.flush
29
+ end
30
+
31
+ def enabled?
32
+ @theme.enabled && @io.respond_to?(:tty?) && @io.tty?
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Riffer
4
4
  module Rig
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riffer-rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bottrall
@@ -104,6 +104,7 @@ files:
104
104
  - lib/riffer/rig/tools/write.rb
105
105
  - lib/riffer/rig/ui/animator.rb
106
106
  - lib/riffer/rig/ui/banner.rb
107
+ - lib/riffer/rig/ui/cursor.rb
107
108
  - lib/riffer/rig/ui/palette.rb
108
109
  - lib/riffer/rig/ui/renderer.rb
109
110
  - lib/riffer/rig/ui/smoother.rb