robot_lab-a2a
robot_lab-a2a exposes RobotLab robots and networks as Agent2Agent (A2A) protocol agents over HTTP and Server-Sent Events. It bridges RobotLab's terminal-based AskUser tool to A2A's input_required/resume lifecycle, enabling multi-turn conversational flows without any terminal dependency. HTTP serving is delegated to the simple_a2a gem.
Installation
bundle add robot_lab-a2aOr add to your Gemfile manually:
gem "robot_lab-a2a"Quick Start
Sync robot (no user input)
require "robot_lab/a2a"
robot = MyRobot.new # any RobotLab::Robot subclass
RobotLab::A2A::Server.new(port: 9292)
.add_robot(robot, name: "My Robot", description: "Does something useful")
.runInteractive robot (multi-turn via AskUserTool)
require "robot_lab/a2a"
robot = MyInteractiveRobot.new
RobotLab::A2A::Server.new(interactive: :a2a_tool, port: 9292)
.add_robot(robot, name: "Interactive Robot", description: "Asks clarifying questions")
.runNetwork pipeline
require "robot_lab/a2a"
network = MyPipeline.new
RobotLab::A2A::Server.new(port: 9292)
.add_network(network, name: "Pipeline", description: "Multi-stage pipeline")
.runRunning the Examples
From the repo root:
bundle exec ruby examples/run 01_sync_robot
bundle exec ruby examples/run 02_interactive_a2a_tool
bundle exec ruby examples/run 03_robot_networkOr from inside the examples/ directory:
./run 01_sync_robotEach example starts its own server. Use a second terminal or curl to interact with it. See docs/examples.md for expected output and two-turn client patterns.
Documentation
Full documentation lives in docs/:
Development
bin/setup # install dependencies
rake test # run the full test suite
rake quality # static analysis (if configured)
rake build # build the gem packageRun a single test file:
ruby -Ilib -Itest test/robot_lab/a2a_test.rbRun a single test by name:
ruby -Ilib -Itest test/robot_lab/registry_test.rb -n test_size_is_zero_when_emptyLicense
MIT