Module: A2A::Proto
- Defined in:
- lib/a2a/proto.rb
Overview
Parses the A2A protocol’s .proto file to extract service operations and bridge them to Schema definition classes for request/response validation.
The .proto file is the single normative source for the A2A protocol. This module extracts the service definition (RPC names, request/response types, streaming flags, HTTP bindings) and connects each operation to the corresponding Schema[] class so callers can validate data:
op = A2A::Proto.operation("SendMessage")
op.request_schema.new(params).valid!
op.response_schema.new(result).valid!
A2A::Proto.operations
#=> [Operation("SendMessage", ...), Operation("GetTask", ...), ...]
Defined Under Namespace
Classes: HttpBinding, Operation
Constant Summary collapse
- PROTO_PATH =
File.("../../data/a2a.proto", __dir__).freeze
Class Method Summary collapse
- .operation(name) ⇒ Object
- .operations ⇒ Object
-
.reset! ⇒ Object
Reset cached state (for tests).
Class Method Details
.operation(name) ⇒ Object
86 87 88 |
# File 'lib/a2a/proto.rb', line 86 def operation(name) operations.find { |op| op.name == name } end |
.operations ⇒ Object
82 83 84 |
# File 'lib/a2a/proto.rb', line 82 def operations @operations ||= parse_operations end |
.reset! ⇒ Object
Reset cached state (for tests).
91 92 93 |
# File 'lib/a2a/proto.rb', line 91 def reset! @operations = nil end |