agent2agent 1.0.8 → 1.1.0
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/lib/a2a/agent.rb +165 -117
- data/lib/a2a/client.rb +470 -51
- data/lib/a2a/errors/json_rpc_error.rb +71 -0
- data/lib/a2a/errors/rest_error.rb +68 -0
- data/lib/a2a/errors.rb +535 -0
- data/lib/a2a/faraday/middleware/json_rpc/request.rb +96 -0
- data/lib/a2a/faraday/middleware/json_rpc/response.rb +131 -0
- data/lib/a2a/faraday/middleware/rest/request.rb +166 -0
- data/lib/a2a/faraday/middleware/rest/response.rb +144 -0
- data/lib/a2a/faraday/middleware/schema_request.rb +69 -0
- data/lib/a2a/middleware/extract_message.rb +120 -0
- data/lib/a2a/middleware/fetch_task.rb +228 -0
- data/lib/a2a/middleware/limit_history_length.rb +123 -0
- data/lib/a2a/middleware/limit_pagination_size.rb +133 -0
- data/lib/a2a/middleware/sse_stream.rb +235 -0
- data/lib/a2a/middleware.rb +7 -0
- data/lib/a2a/schema/definition.rb +35 -1
- data/lib/a2a/schema.rb +126 -0
- data/lib/a2a/{bindings → server/bindings}/json_rpc.rb +12 -8
- data/lib/a2a/{bindings → server/bindings}/rest.rb +12 -8
- data/lib/a2a/server/dispatcher.rb +52 -54
- data/lib/a2a/server/env.rb +4 -6
- data/lib/a2a/server/triage.rb +1 -1
- data/lib/a2a/server.rb +10 -10
- data/lib/a2a/sse/event_parser.rb +202 -0
- data/lib/a2a/sse/json_rpc_stream.rb +27 -5
- data/lib/a2a/sse/rest_stream.rb +17 -5
- data/lib/a2a/sse/stream.rb +135 -7
- data/lib/a2a/sse.rb +1 -0
- data/lib/a2a/test_helpers.rb +89 -0
- data/lib/a2a/version.rb +1 -1
- data/lib/a2a.rb +6 -2
- data/lib/traces/provider/a2a/{bindings → server/bindings}/json_rpc.rb +2 -2
- data/lib/traces/provider/a2a/{bindings → server/bindings}/rest.rb +2 -2
- data/lib/traces/provider/a2a.rb +2 -2
- metadata +49 -22
- data/lib/a2a/server/cancel_task.rb +0 -14
- data/lib/a2a/server/create_task_push_notification_config.rb +0 -14
- data/lib/a2a/server/delete_task_push_notification_config.rb +0 -14
- data/lib/a2a/server/get_extended_agent_card.rb +0 -15
- data/lib/a2a/server/get_task.rb +0 -14
- data/lib/a2a/server/get_task_push_notification_config.rb +0 -14
- data/lib/a2a/server/list_task_push_notification_configs.rb +0 -14
- data/lib/a2a/server/list_tasks.rb +0 -14
- data/lib/a2a/server/send_message.rb +0 -14
- data/lib/a2a/server/send_streaming_message.rb +0 -14
- data/lib/a2a/server/subscribe_to_task.rb +0 -14
- data/lib/a2a/store/processor.rb +0 -136
- data/lib/a2a/store/pub_sub.rb +0 -149
- data/lib/a2a/store/sqlite.rb +0 -533
- data/lib/a2a/store/webhooks.rb +0 -94
- data/lib/a2a/store.rb +0 -6
- data/lib/a2a/task_store.rb +0 -315
data/lib/a2a/sse/stream.rb
CHANGED
|
@@ -19,11 +19,11 @@ module A2A
|
|
|
19
19
|
#
|
|
20
20
|
# Usage:
|
|
21
21
|
#
|
|
22
|
-
# stream = A2A::SSE::
|
|
22
|
+
# stream = A2A::SSE::RestStream.new(task_id: "t1", context_id: "c1")
|
|
23
23
|
#
|
|
24
24
|
# Async do
|
|
25
|
-
# stream.
|
|
26
|
-
# stream.
|
|
25
|
+
# stream.task(status: { state: "TASK_STATE_WORKING", timestamp: "..." })
|
|
26
|
+
# stream.status_update(status: { state: "TASK_STATE_COMPLETED", timestamp: "..." })
|
|
27
27
|
# stream.finish
|
|
28
28
|
# end
|
|
29
29
|
#
|
|
@@ -38,6 +38,14 @@ module A2A
|
|
|
38
38
|
"connection" => "keep-alive",
|
|
39
39
|
}.freeze
|
|
40
40
|
|
|
41
|
+
attr_reader :task_id, :context_id
|
|
42
|
+
|
|
43
|
+
def initialize(task_id:, context_id:, **options)
|
|
44
|
+
@task_id = task_id
|
|
45
|
+
@context_id = context_id
|
|
46
|
+
super(**options)
|
|
47
|
+
end
|
|
48
|
+
|
|
41
49
|
# Emit an SSE event.
|
|
42
50
|
#
|
|
43
51
|
# @param data [Hash, String] the event payload (Hashes are JSON-encoded)
|
|
@@ -71,6 +79,45 @@ module A2A
|
|
|
71
79
|
def self.headers
|
|
72
80
|
SSE_HEADERS
|
|
73
81
|
end
|
|
82
|
+
|
|
83
|
+
# --- Typed event emitters -------------------------------------------
|
|
84
|
+
#
|
|
85
|
+
# Dynamically generated from the StreamResponse schema.
|
|
86
|
+
# Each property in StreamResponse (task, message, statusUpdate,
|
|
87
|
+
# artifactUpdate) gets a snake_case method that:
|
|
88
|
+
#
|
|
89
|
+
# 1. Injects @task_id and @context_id (using the correct key name
|
|
90
|
+
# for each type — Task uses `id`, others use `task_id`)
|
|
91
|
+
# 2. Builds the schema Definition from kwargs
|
|
92
|
+
# 3. Wraps it in the StreamResponse envelope
|
|
93
|
+
# 4. Calls #event to emit the SSE wire format
|
|
94
|
+
#
|
|
95
|
+
# This means you never pass task_id/context_id manually:
|
|
96
|
+
#
|
|
97
|
+
# stream.task(status: { state: "TASK_STATE_WORKING" })
|
|
98
|
+
# stream.artifact_update(artifact: { ... }, append: false, last_chunk: true)
|
|
99
|
+
# stream.status_update(status: { state: "TASK_STATE_COMPLETED" })
|
|
100
|
+
# stream.message(role: "ROLE_AGENT", parts: [{ text: "Hello" }])
|
|
101
|
+
#
|
|
102
|
+
|
|
103
|
+
stream_response = A2A::Schema["Stream Response"]
|
|
104
|
+
|
|
105
|
+
stream_response.property_refs.each do |camel_key, (_kind, title)|
|
|
106
|
+
target_props = A2A::Schema[title].schema_properties
|
|
107
|
+
|
|
108
|
+
# Task uses `id` for the task identifier; the other three use `taskId`
|
|
109
|
+
task_id_key = target_props.include?("id") ? :id : :task_id
|
|
110
|
+
|
|
111
|
+
# camelCase -> snake_case method name
|
|
112
|
+
method_name = camel_key
|
|
113
|
+
.gsub(/([A-Z])/) { "_#{$1.downcase}" }
|
|
114
|
+
.delete_prefix("_")
|
|
115
|
+
|
|
116
|
+
define_method(method_name) do |**kwargs|
|
|
117
|
+
merged = { task_id_key => @task_id, context_id: @context_id }.merge(kwargs)
|
|
118
|
+
event({ camel_key => A2A::Schema[title].new(merged).to_h })
|
|
119
|
+
end
|
|
120
|
+
end
|
|
74
121
|
end
|
|
75
122
|
end
|
|
76
123
|
end
|
|
@@ -80,7 +127,7 @@ test do
|
|
|
80
127
|
|
|
81
128
|
describe "A2A::SSE::Stream" do
|
|
82
129
|
it "formats SSE events correctly" do
|
|
83
|
-
stream = A2A::SSE::Stream.new
|
|
130
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
84
131
|
|
|
85
132
|
stream.event({ "task" => { "id" => "t1" } })
|
|
86
133
|
stream.finish
|
|
@@ -95,7 +142,7 @@ test do
|
|
|
95
142
|
end
|
|
96
143
|
|
|
97
144
|
it "includes event type when provided" do
|
|
98
|
-
stream = A2A::SSE::Stream.new
|
|
145
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
99
146
|
|
|
100
147
|
stream.event("hello", type: "ping")
|
|
101
148
|
stream.finish
|
|
@@ -106,7 +153,7 @@ test do
|
|
|
106
153
|
end
|
|
107
154
|
|
|
108
155
|
it "includes event id when provided" do
|
|
109
|
-
stream = A2A::SSE::Stream.new
|
|
156
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
110
157
|
|
|
111
158
|
stream.event("test", id: "42")
|
|
112
159
|
stream.finish
|
|
@@ -116,7 +163,7 @@ test do
|
|
|
116
163
|
end
|
|
117
164
|
|
|
118
165
|
it "is a Protocol::HTTP::Body::Readable" do
|
|
119
|
-
stream = A2A::SSE::Stream.new
|
|
166
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
120
167
|
stream.is_a?(Protocol::HTTP::Body::Readable).should == true
|
|
121
168
|
end
|
|
122
169
|
|
|
@@ -125,5 +172,86 @@ test do
|
|
|
125
172
|
headers["content-type"].should == "text/event-stream"
|
|
126
173
|
headers["cache-control"].should.include("no-cache")
|
|
127
174
|
end
|
|
175
|
+
|
|
176
|
+
it "stores task_id and context_id" do
|
|
177
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
178
|
+
stream.task_id.should == "t1"
|
|
179
|
+
stream.context_id.should == "c1"
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# --- Typed emit methods ---
|
|
183
|
+
|
|
184
|
+
it "#task emits a task event with injected id and context_id" do
|
|
185
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
186
|
+
|
|
187
|
+
stream.task(status: { state: "TASK_STATE_WORKING", timestamp: "2025-01-01T00:00:00Z" })
|
|
188
|
+
stream.finish
|
|
189
|
+
|
|
190
|
+
chunk = stream.read
|
|
191
|
+
parsed = JSON.parse(chunk.sub(/\Adata: /, "").strip)
|
|
192
|
+
parsed["task"]["id"].should == "t1"
|
|
193
|
+
parsed["task"]["contextId"].should == "c1"
|
|
194
|
+
parsed["task"]["status"]["state"].should == "TASK_STATE_WORKING"
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
it "#status_update emits with injected task_id and context_id" do
|
|
198
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
199
|
+
|
|
200
|
+
stream.status_update(status: { state: "TASK_STATE_COMPLETED", timestamp: "2025-01-01T00:00:00Z" })
|
|
201
|
+
stream.finish
|
|
202
|
+
|
|
203
|
+
chunk = stream.read
|
|
204
|
+
parsed = JSON.parse(chunk.sub(/\Adata: /, "").strip)
|
|
205
|
+
parsed["statusUpdate"]["taskId"].should == "t1"
|
|
206
|
+
parsed["statusUpdate"]["contextId"].should == "c1"
|
|
207
|
+
parsed["statusUpdate"]["status"]["state"].should == "TASK_STATE_COMPLETED"
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
it "#artifact_update emits with injected task_id and context_id" do
|
|
211
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
212
|
+
|
|
213
|
+
stream.artifact_update(
|
|
214
|
+
artifact: { artifact_id: "a1", parts: [{ text: "hello" }] },
|
|
215
|
+
append: false,
|
|
216
|
+
last_chunk: true
|
|
217
|
+
)
|
|
218
|
+
stream.finish
|
|
219
|
+
|
|
220
|
+
chunk = stream.read
|
|
221
|
+
parsed = JSON.parse(chunk.sub(/\Adata: /, "").strip)
|
|
222
|
+
parsed["artifactUpdate"]["taskId"].should == "t1"
|
|
223
|
+
parsed["artifactUpdate"]["contextId"].should == "c1"
|
|
224
|
+
parsed["artifactUpdate"]["artifact"]["artifactId"].should == "a1"
|
|
225
|
+
parsed["artifactUpdate"]["append"].should == false
|
|
226
|
+
parsed["artifactUpdate"]["lastChunk"].should == true
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
it "#message emits with injected task_id and context_id" do
|
|
230
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
231
|
+
|
|
232
|
+
stream.message(
|
|
233
|
+
message_id: "m1",
|
|
234
|
+
role: "ROLE_AGENT",
|
|
235
|
+
parts: [{ text: "Hello" }]
|
|
236
|
+
)
|
|
237
|
+
stream.finish
|
|
238
|
+
|
|
239
|
+
chunk = stream.read
|
|
240
|
+
parsed = JSON.parse(chunk.sub(/\Adata: /, "").strip)
|
|
241
|
+
parsed["message"]["taskId"].should == "t1"
|
|
242
|
+
parsed["message"]["contextId"].should == "c1"
|
|
243
|
+
parsed["message"]["role"].should == "ROLE_AGENT"
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
it "typed methods allow overriding injected values" do
|
|
247
|
+
stream = A2A::SSE::Stream.new(task_id: "t1", context_id: "c1")
|
|
248
|
+
|
|
249
|
+
stream.task(id: "override", status: { state: "TASK_STATE_WORKING" })
|
|
250
|
+
stream.finish
|
|
251
|
+
|
|
252
|
+
chunk = stream.read
|
|
253
|
+
parsed = JSON.parse(chunk.sub(/\Adata: /, "").strip)
|
|
254
|
+
parsed["task"]["id"].should == "override"
|
|
255
|
+
end
|
|
128
256
|
end
|
|
129
257
|
end
|
data/lib/a2a/sse.rb
CHANGED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "a2a"
|
|
4
|
+
require "a2a/agent"
|
|
5
|
+
require "a2a/proto"
|
|
6
|
+
require "a2a/schema"
|
|
7
|
+
|
|
8
|
+
module A2A
|
|
9
|
+
module TestHelpers
|
|
10
|
+
# Returns a stub agent that handles all A2A operations with
|
|
11
|
+
# minimal valid responses. Useful for integration tests that
|
|
12
|
+
# need a working server without real business logic.
|
|
13
|
+
def self.stub_agent
|
|
14
|
+
Agent.new do
|
|
15
|
+
on "SendMessage" do
|
|
16
|
+
respond_with -> (env) {
|
|
17
|
+
A2A::Schema["Send Message Response"].new({})
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
on "SendStreamingMessage" do
|
|
22
|
+
respond_with -> (env) {
|
|
23
|
+
A2A::Schema["Stream Response"].new({})
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
on "GetTask" do
|
|
28
|
+
respond_with -> (env) {
|
|
29
|
+
A2A::Schema["Task"].new(
|
|
30
|
+
"id" => "test-id",
|
|
31
|
+
"contextId" => "ctx-1",
|
|
32
|
+
"status" => { "state" => "TASK_STATE_COMPLETED", "timestamp" => "2025-01-01T00:00:00Z" }
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
on "ListTasks" do
|
|
38
|
+
respond_with -> (env) {
|
|
39
|
+
A2A::Schema["List Tasks Response"].new({})
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
on "CancelTask" do
|
|
44
|
+
respond_with -> (env) {
|
|
45
|
+
A2A::Schema["Task"].new(
|
|
46
|
+
"id" => "test-id",
|
|
47
|
+
"contextId" => "ctx-1",
|
|
48
|
+
"status" => { "state" => "TASK_STATE_CANCELED", "timestamp" => "2025-01-01T00:00:00Z" }
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
on "SubscribeToTask" do
|
|
54
|
+
respond_with -> (env) {
|
|
55
|
+
A2A::Schema["Stream Response"].new({})
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
on "CreateTaskPushNotificationConfig" do
|
|
60
|
+
respond_with -> (env) {
|
|
61
|
+
A2A::Schema["Task Push Notification Config"].new("url" => "http://example.com")
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
on "GetTaskPushNotificationConfig" do
|
|
66
|
+
respond_with -> (env) {
|
|
67
|
+
A2A::Schema["Task Push Notification Config"].new("url" => "http://example.com")
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
on "ListTaskPushNotificationConfigs" do
|
|
72
|
+
respond_with -> (env) {
|
|
73
|
+
A2A::Schema["List Task Push Notification Configs Response"].new({})
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
on "GetExtendedAgentCard" do
|
|
78
|
+
respond_with -> (env) {
|
|
79
|
+
A2A::Schema["Agent Card"].new("name" => "Test", "version" => "1.0")
|
|
80
|
+
}
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
on "DeleteTaskPushNotificationConfig" do
|
|
84
|
+
respond_with -> (env) { nil }
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
data/lib/a2a/version.rb
CHANGED
data/lib/a2a.rb
CHANGED
|
@@ -12,15 +12,19 @@ require "rack"
|
|
|
12
12
|
module A2A
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
require "a2a/errors"
|
|
15
16
|
require "a2a/proto"
|
|
16
17
|
require "a2a/schema"
|
|
17
18
|
require "a2a/schema/definition"
|
|
18
19
|
require "a2a/schema/validation_error"
|
|
19
|
-
require "a2a/task_store"
|
|
20
|
-
require "a2a/store"
|
|
21
20
|
require "a2a/sse"
|
|
22
21
|
require "a2a/agent"
|
|
23
22
|
|
|
24
23
|
require "a2a/server"
|
|
25
24
|
|
|
25
|
+
require "a2a/faraday/middleware/schema_request"
|
|
26
|
+
require "a2a/faraday/middleware/json_rpc/request"
|
|
27
|
+
require "a2a/faraday/middleware/json_rpc/response"
|
|
28
|
+
require "a2a/faraday/middleware/rest/request"
|
|
29
|
+
require "a2a/faraday/middleware/rest/response"
|
|
26
30
|
require "a2a/client"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "
|
|
3
|
+
require_relative "../../../../../a2a/server/bindings/json_rpc"
|
|
4
4
|
require "traces/provider"
|
|
5
5
|
|
|
6
|
-
Traces::Provider(A2A::Bindings::JsonRpc) do
|
|
6
|
+
Traces::Provider(A2A::Server::Bindings::JsonRpc) do
|
|
7
7
|
def call(env)
|
|
8
8
|
Traces.trace("a2a.bindings.json_rpc.call") do |span|
|
|
9
9
|
super.tap do |status, headers, body|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "
|
|
3
|
+
require_relative "../../../../../a2a/server/bindings/rest"
|
|
4
4
|
require "traces/provider"
|
|
5
5
|
|
|
6
|
-
Traces::Provider(A2A::Bindings::Rest) do
|
|
6
|
+
Traces::Provider(A2A::Server::Bindings::Rest) do
|
|
7
7
|
def call(env)
|
|
8
8
|
Traces.trace("a2a.bindings.rest.call") do |span|
|
|
9
9
|
super.tap do |status, headers, body|
|
data/lib/traces/provider/a2a.rb
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
require_relative "a2a/server"
|
|
4
4
|
require_relative "a2a/server/dispatcher"
|
|
5
5
|
require_relative "a2a/server/triage"
|
|
6
|
-
require_relative "a2a/bindings/json_rpc"
|
|
7
|
-
require_relative "a2a/bindings/rest"
|
|
6
|
+
require_relative "a2a/server/bindings/json_rpc"
|
|
7
|
+
require_relative "a2a/server/bindings/rest"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: agent2agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- A2A Contributors
|
|
@@ -135,6 +135,34 @@ dependencies:
|
|
|
135
135
|
- - ">="
|
|
136
136
|
- !ruby/object:Gem::Version
|
|
137
137
|
version: '0'
|
|
138
|
+
- !ruby/object:Gem::Dependency
|
|
139
|
+
name: faraday
|
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - "~>"
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '2.0'
|
|
145
|
+
type: :runtime
|
|
146
|
+
prerelease: false
|
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - "~>"
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '2.0'
|
|
152
|
+
- !ruby/object:Gem::Dependency
|
|
153
|
+
name: async-http-faraday
|
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - "~>"
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '0.22'
|
|
159
|
+
type: :runtime
|
|
160
|
+
prerelease: false
|
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
162
|
+
requirements:
|
|
163
|
+
- - "~>"
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: '0.22'
|
|
138
166
|
- !ruby/object:Gem::Dependency
|
|
139
167
|
name: rake
|
|
140
168
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -175,43 +203,42 @@ files:
|
|
|
175
203
|
- data/spec.txt
|
|
176
204
|
- lib/a2a.rb
|
|
177
205
|
- lib/a2a/agent.rb
|
|
178
|
-
- lib/a2a/bindings/json_rpc.rb
|
|
179
|
-
- lib/a2a/bindings/rest.rb
|
|
180
206
|
- lib/a2a/client.rb
|
|
207
|
+
- lib/a2a/errors.rb
|
|
208
|
+
- lib/a2a/errors/json_rpc_error.rb
|
|
209
|
+
- lib/a2a/errors/rest_error.rb
|
|
210
|
+
- lib/a2a/faraday/middleware/json_rpc/request.rb
|
|
211
|
+
- lib/a2a/faraday/middleware/json_rpc/response.rb
|
|
212
|
+
- lib/a2a/faraday/middleware/rest/request.rb
|
|
213
|
+
- lib/a2a/faraday/middleware/rest/response.rb
|
|
214
|
+
- lib/a2a/faraday/middleware/schema_request.rb
|
|
215
|
+
- lib/a2a/middleware.rb
|
|
216
|
+
- lib/a2a/middleware/extract_message.rb
|
|
217
|
+
- lib/a2a/middleware/fetch_task.rb
|
|
218
|
+
- lib/a2a/middleware/limit_history_length.rb
|
|
219
|
+
- lib/a2a/middleware/limit_pagination_size.rb
|
|
220
|
+
- lib/a2a/middleware/sse_stream.rb
|
|
181
221
|
- lib/a2a/proto.rb
|
|
182
222
|
- lib/a2a/schema.rb
|
|
183
223
|
- lib/a2a/schema/definition.rb
|
|
184
224
|
- lib/a2a/schema/validation_error.rb
|
|
185
225
|
- lib/a2a/server.rb
|
|
186
|
-
- lib/a2a/server/
|
|
187
|
-
- lib/a2a/server/
|
|
188
|
-
- lib/a2a/server/delete_task_push_notification_config.rb
|
|
226
|
+
- lib/a2a/server/bindings/json_rpc.rb
|
|
227
|
+
- lib/a2a/server/bindings/rest.rb
|
|
189
228
|
- lib/a2a/server/dispatcher.rb
|
|
190
229
|
- lib/a2a/server/env.rb
|
|
191
|
-
- lib/a2a/server/get_extended_agent_card.rb
|
|
192
|
-
- lib/a2a/server/get_task.rb
|
|
193
|
-
- lib/a2a/server/get_task_push_notification_config.rb
|
|
194
|
-
- lib/a2a/server/list_task_push_notification_configs.rb
|
|
195
|
-
- lib/a2a/server/list_tasks.rb
|
|
196
|
-
- lib/a2a/server/send_message.rb
|
|
197
|
-
- lib/a2a/server/send_streaming_message.rb
|
|
198
|
-
- lib/a2a/server/subscribe_to_task.rb
|
|
199
230
|
- lib/a2a/server/triage.rb
|
|
200
231
|
- lib/a2a/sse.rb
|
|
232
|
+
- lib/a2a/sse/event_parser.rb
|
|
201
233
|
- lib/a2a/sse/json_rpc_stream.rb
|
|
202
234
|
- lib/a2a/sse/rest_stream.rb
|
|
203
235
|
- lib/a2a/sse/stream.rb
|
|
204
|
-
- lib/a2a/
|
|
205
|
-
- lib/a2a/store/processor.rb
|
|
206
|
-
- lib/a2a/store/pub_sub.rb
|
|
207
|
-
- lib/a2a/store/sqlite.rb
|
|
208
|
-
- lib/a2a/store/webhooks.rb
|
|
209
|
-
- lib/a2a/task_store.rb
|
|
236
|
+
- lib/a2a/test_helpers.rb
|
|
210
237
|
- lib/a2a/version.rb
|
|
211
238
|
- lib/traces/provider/a2a.rb
|
|
212
|
-
- lib/traces/provider/a2a/bindings/json_rpc.rb
|
|
213
|
-
- lib/traces/provider/a2a/bindings/rest.rb
|
|
214
239
|
- lib/traces/provider/a2a/server.rb
|
|
240
|
+
- lib/traces/provider/a2a/server/bindings/json_rpc.rb
|
|
241
|
+
- lib/traces/provider/a2a/server/bindings/rest.rb
|
|
215
242
|
- lib/traces/provider/a2a/server/dispatcher.rb
|
|
216
243
|
- lib/traces/provider/a2a/server/triage.rb
|
|
217
244
|
licenses:
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "a2a"
|
|
5
|
-
|
|
6
|
-
module A2A
|
|
7
|
-
module Server
|
|
8
|
-
class CreateTaskPushNotificationConfig
|
|
9
|
-
def call(env)
|
|
10
|
-
env["a2a.result"] = Schema["Task Push Notification Config"].new({})
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "a2a"
|
|
5
|
-
|
|
6
|
-
module A2A
|
|
7
|
-
module Server
|
|
8
|
-
class GetExtendedAgentCard
|
|
9
|
-
def call(env)
|
|
10
|
-
card = env["a2a.agent_card"] || {}
|
|
11
|
-
env["a2a.result"] = Schema["Agent Card"].new(card)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
data/lib/a2a/server/get_task.rb
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "a2a"
|
|
5
|
-
|
|
6
|
-
module A2A
|
|
7
|
-
module Server
|
|
8
|
-
class GetTaskPushNotificationConfig
|
|
9
|
-
def call(env)
|
|
10
|
-
env["a2a.result"] = Schema["Task Push Notification Config"].new({})
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "a2a"
|
|
5
|
-
|
|
6
|
-
module A2A
|
|
7
|
-
module Server
|
|
8
|
-
class ListTaskPushNotificationConfigs
|
|
9
|
-
def call(env)
|
|
10
|
-
env["a2a.result"] = Schema["List Task Push Notification Configs Response"].new({})
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|