
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
a2a-ruby
Advanced tools
The A2A Ruby SDK provides a complete implementation of Google's Agent2Agent (A2A) Protocol for Ruby applications. It enables seamless agent-to-agent communication via JSON-RPC 2.0, gRPC, and HTTP+JSON transports.
Add this line to your application's Gemfile:
gem 'a2a-ruby'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install a2a-ruby
require 'a2a'
# Create a client
client = A2A::Client::HttpClient.new("https://agent.example.com/a2a")
# Send a message
message = A2A::Types::Message.new(
message_id: SecureRandom.uuid,
role: "user",
parts: [
A2A::Types::TextPart.new(text: "Hello, agent!")
]
)
# Get response (streaming or blocking)
client.send_message(message) do |response|
case response
when A2A::Types::Message
puts "Agent replied: #{response.parts.first.text}"
when A2A::Types::Task
puts "Task created: #{response.id}"
end
end
class MyAgentController < ApplicationController
include A2A::Server::Agent
# Define agent skills
a2a_skill "greeting" do |skill|
skill.description = "Greet users in different languages"
skill.tags = ["greeting", "conversation", "multilingual"]
skill.examples = ["Hello", "Say hi in Spanish"]
end
# Define A2A methods
a2a_method "greet" do |params|
language = params[:language] || "en"
name = params[:name] || "there"
greeting = case language
when "es" then "¡Hola"
when "fr" then "Bonjour"
else "Hello"
end
{
message: "#{greeting}, #{name}!",
language: language
}
end
# Handle streaming responses
a2a_method "chat", streaming: true do |params|
Enumerator.new do |yielder|
# Yield task status updates
yielder << A2A::Types::TaskStatusUpdateEvent.new(
task_id: params[:task_id],
context_id: params[:context_id],
status: A2A::Types::TaskStatus.new(state: "working")
)
# Process and yield response
response = process_chat(params[:message])
yielder << A2A::Types::Message.new(
message_id: SecureRandom.uuid,
role: "agent",
parts: [A2A::Types::TextPart.new(text: response)]
)
end
end
end
# config/routes.rb
Rails.application.routes.draw do
mount A2A::Engine => "/a2a"
end
# The engine automatically provides:
# POST /a2a/rpc - JSON-RPC endpoint
# GET /a2a/agent-card - Agent card discovery
# GET /a2a/capabilities - Capabilities endpoint
A2A.configure do |config|
config.protocol_version = "0.3.0"
config.default_transport = "JSONRPC"
config.streaming_enabled = true
config.push_notifications_enabled = true
config.default_timeout = 30
config.log_level = :info
end
Essential Guides:
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/a2aproject/a2a-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the A2A Ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that a2a-ruby demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.