robot_lab-web 0.2.7 → 0.2.8
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/.envrc +3 -0
- data/CHANGELOG.md +4 -0
- data/Rakefile +0 -1
- data/_typos.toml +7 -0
- data/lib/robot_lab/web/components/chat.rb +1 -0
- data/lib/robot_lab/web/components/dashboard.rb +1 -0
- data/lib/robot_lab/web/components/layout.rb +1 -0
- data/lib/robot_lab/web/components/message.rb +3 -2
- data/lib/robot_lab/web/event.rb +3 -0
- data/lib/robot_lab/web/event_sink.rb +4 -3
- data/lib/robot_lab/web/registry.rb +1 -0
- data/lib/robot_lab/web/version.rb +1 -1
- data/lib/robot_lab/web.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f6722eba1efc89ffadf06fb4757b17992704b5e152c6e93610f420505bc7a62
|
|
4
|
+
data.tar.gz: e416fb9603ebe0e3a8bef300623ad0b638d4fc580b2555aa336f0245202e87db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13d2ffb486bbdcdcddc38bb639f2330d54634f230786c11933cba029adfa9d2bb4f2589caf86ed2fa1d75b39af5ced548a06ba494761a583d103897f6630841c
|
|
7
|
+
data.tar.gz: 216cf0740d673be16c993cfc9f9456bc52fb67c5a9cbb7273deed8a95401f3664ea1ffac6c104228a421b5206f5621d51cbfca1633797ba1a461f51287715456
|
data/.envrc
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.2.8] - 2026-09-09
|
|
4
|
+
|
|
5
|
+
Released in lockstep with `robot_lab` core v0.2.8: this gem now resolves the released core gem from RubyGems instead of the local sibling checkout (local-path development remains available via `BUNDLE_GEMFILE=Gemfile.local`). Also in this release: reek warnings triaged to zero, reek added to the development bundle, and the Rakefile slimmed down to the tasks asgard delegates to.
|
|
6
|
+
|
|
3
7
|
### Changed
|
|
4
8
|
- Use **Falcon** as the application server (replacing Puma). Its async/fiber
|
|
5
9
|
reactor is the right fit for the long-lived SSE streams this console serves —
|
data/Rakefile
CHANGED
data/_typos.toml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# False-positive suppressions for the typos quality gate (asgard).
|
|
2
|
+
# Everything here was reviewed by hand — see git history for context.
|
|
3
|
+
|
|
4
|
+
[default.extend-identifiers]
|
|
5
|
+
# test_run.rb streams "Hello!" as the fragments %w[Hel lo!] to exercise
|
|
6
|
+
# token-delta streaming; "Hel" is a deliberate partial token, not a typo.
|
|
7
|
+
Hel = "Hel"
|
|
@@ -10,6 +10,7 @@ module RobotLab
|
|
|
10
10
|
@name = name
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
# :reek:TooManyStatements -- a Phlex template is one linear markup sequence; splitting it would scatter the page structure.
|
|
13
14
|
def view_template
|
|
14
15
|
h1(class: "flex items-center gap-2") do
|
|
15
16
|
a(href: "/", class: "inline-flex") do
|
|
@@ -25,11 +25,12 @@ module RobotLab
|
|
|
25
25
|
|
|
26
26
|
def body_text
|
|
27
27
|
c = @event.content
|
|
28
|
+
name = @event.tool_name
|
|
28
29
|
case @event.role
|
|
29
30
|
when :tool_call
|
|
30
|
-
"#{
|
|
31
|
+
"#{name}(#{c[:args].to_json})"
|
|
31
32
|
when :tool_result
|
|
32
|
-
c[:error] ? "#{
|
|
33
|
+
c[:error] ? "#{name} → error: #{c[:error]}" : "#{name} → #{c[:result]}"
|
|
33
34
|
when :error
|
|
34
35
|
@event.error_message.to_s
|
|
35
36
|
else
|
data/lib/robot_lab/web/event.rb
CHANGED
|
@@ -22,6 +22,7 @@ module RobotLab
|
|
|
22
22
|
Event = Struct.new(:role, :content, :robot_name, :timestamp, :event_id, keyword_init: true) do
|
|
23
23
|
ROLES = %i[user delta robot tool_call tool_result error].freeze # rubocop:disable Lint/ConstantDefinitionInBlock
|
|
24
24
|
|
|
25
|
+
# :reek:ControlParameter -- nil timestamp/event_id mean "generate one"; `|| default` also covers explicit nils from .from_h.
|
|
25
26
|
def initialize(role:, content:, robot_name: nil, timestamp: nil, event_id: nil)
|
|
26
27
|
role = role.to_sym
|
|
27
28
|
raise ArgumentError, "invalid role: #{role.inspect} (expected one of #{ROLES.inspect})" unless ROLES.include?(role)
|
|
@@ -87,6 +88,8 @@ module RobotLab
|
|
|
87
88
|
|
|
88
89
|
private
|
|
89
90
|
|
|
91
|
+
# :reek:DuplicateMethodCall -- one freeze per case branch; exactly one executes per call.
|
|
92
|
+
# :reek:FeatureEnvy -- a recursive freeze necessarily walks the argument, not self.
|
|
90
93
|
def deep_freeze(obj)
|
|
91
94
|
case obj
|
|
92
95
|
when Hash
|
|
@@ -22,11 +22,12 @@ module RobotLab
|
|
|
22
22
|
# Run the block with +sink+ (any callable taking an Event) installed as
|
|
23
23
|
# the current consumer. Restores the previous sink afterward.
|
|
24
24
|
def capture(sink)
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
thread = Thread.current
|
|
26
|
+
previous = thread[KEY]
|
|
27
|
+
thread[KEY] = sink
|
|
27
28
|
yield
|
|
28
29
|
ensure
|
|
29
|
-
|
|
30
|
+
thread[KEY] = previous
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
def current
|
|
@@ -12,6 +12,7 @@ module RobotLab
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
# Register a robot (anything responding to #run and #name).
|
|
15
|
+
# :reek:ControlParameter -- nil name means "use the robot's own name", an override default, not a mode switch.
|
|
15
16
|
def register(robot, name: nil)
|
|
16
17
|
key = (name || robot.name).to_s
|
|
17
18
|
store[key] = robot
|
data/lib/robot_lab/web.rb
CHANGED
|
@@ -51,6 +51,7 @@ module RobotLab
|
|
|
51
51
|
#
|
|
52
52
|
# events = []
|
|
53
53
|
# RobotLab::Web.run(robot, "hello") { |event| events << event }
|
|
54
|
+
# :reek:TooManyStatements -- the one linear sink-install/run/stream orchestration the web routes wrap.
|
|
54
55
|
def run(robot, message, sink = nil, &block)
|
|
55
56
|
sink ||= block
|
|
56
57
|
name = robot.respond_to?(:name) ? robot.name : nil
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: robot_lab-web
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dewayne VanHoozer
|
|
@@ -126,6 +126,7 @@ files:
|
|
|
126
126
|
- LICENSE.txt
|
|
127
127
|
- README.md
|
|
128
128
|
- Rakefile
|
|
129
|
+
- _typos.toml
|
|
129
130
|
- config.ru
|
|
130
131
|
- docs/api_reference.md
|
|
131
132
|
- docs/getting_started.md
|
|
@@ -171,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
171
172
|
- !ruby/object:Gem::Version
|
|
172
173
|
version: '0'
|
|
173
174
|
requirements: []
|
|
174
|
-
rubygems_version: 4.0.
|
|
175
|
+
rubygems_version: 4.0.20
|
|
175
176
|
specification_version: 4
|
|
176
177
|
summary: 'Browser console for robot_lab: stream a robot''s run over Server-Sent Events.'
|
|
177
178
|
test_files: []
|