a2a-rb 0.1.1 → 0.2.3
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/CHANGELOG.md +32 -3
- data/lib/a2a/agent_capabilities.rb +1 -1
- data/lib/a2a/agent_card/builder.rb +4 -4
- data/lib/a2a/agent_card.rb +6 -6
- data/lib/a2a/agent_skill.rb +1 -1
- data/lib/a2a/artifact.rb +1 -1
- data/lib/a2a/client.rb +8 -7
- data/lib/a2a/message.rb +1 -1
- data/lib/a2a/operation/list_task_push_notification_configs.rb +1 -1
- data/lib/a2a/operation/list_tasks.rb +1 -1
- data/lib/a2a/protocol/http_json/transport.rb +2 -2
- data/lib/a2a/protocol/json_rpc/transport.rb +2 -2
- data/lib/a2a/security_requirement.rb +1 -1
- data/lib/a2a/security_scheme/open_id_connect.rb +1 -1
- data/lib/a2a/streaming/sse_parser.rb +3 -3
- data/lib/a2a/streaming/subscription.rb +2 -2
- data/lib/a2a/task.rb +2 -2
- data/lib/a2a/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcd1c6d3514c1666a496e469b097b52f878e6ca0cb21cb71eb1967e515669b9a
|
|
4
|
+
data.tar.gz: 3d02330a7c82deabc3710ac798cec921bdc197613d775d5e1f1482c1175c301a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 760540cb9834b366c0feee3991e9c6b59c377e1c1ed74153ec123f3cb61539d4ef0cf08ca26891b8ec4cb2135b8de7c73f10e7e48f74b8703ef683891104c7a3
|
|
7
|
+
data.tar.gz: 50eafa61112da31046ee8e5795f096eeaeaeb58d5d00a2b312e60064e03879817f4252377657a4122b6af14d14b1a138e1fc98663b6cbca5d73742e8da3933bf
|
data/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [0.
|
|
10
|
+
## [0.2.3] — 2026-06-26
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- switch to official rubygems/release-gem action
|
|
14
|
+
|
|
15
|
+
## [0.2.2] — 2026-06-26
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- add CODEOWNERS and verify tag is on main before publish
|
|
19
|
+
|
|
20
|
+
## [0.2.1] — 2026-06-26
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- fix RuboCop offenses from TargetRubyVersion 3.4 upgrade
|
|
24
|
+
|
|
25
|
+
## [0.2.0] — 2026-06-26
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- add CI/CD workflows and fix release script newline bug
|
|
29
|
+
|
|
30
|
+
## [0.1.1] — 2026-06-26
|
|
31
|
+
|
|
32
|
+
### Added
|
|
11
33
|
- wire up top-level A2A module with error classes and requires
|
|
12
34
|
- add JSONRPCEnvelope for server-side request/response handling
|
|
13
35
|
- add JSON-RPC and HTTP+JSON protocol bindings and client
|
|
@@ -32,7 +54,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
32
54
|
### Added
|
|
33
55
|
- Initial gem scaffold (lib, spec, bin/console, bin/setup, gemspec)
|
|
34
56
|
|
|
35
|
-
[Unreleased]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.
|
|
57
|
+
[Unreleased]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.2.3...HEAD
|
|
58
|
+
[0.1.1]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.1.0...v0.1.1
|
|
36
59
|
[0.1.0]: https://github.com/rafaelqfigueiredo/a2a-rb/releases/tag/v0.1.0
|
|
37
60
|
|
|
38
|
-
[0.
|
|
61
|
+
[0.2.0]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.1.1...v0.2.0
|
|
62
|
+
|
|
63
|
+
[0.2.1]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.2.0...v0.2.1
|
|
64
|
+
|
|
65
|
+
[0.2.2]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.2.1...v0.2.2
|
|
66
|
+
|
|
67
|
+
[0.2.3]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.2.2...v0.2.3
|
|
@@ -15,7 +15,7 @@ module A2A
|
|
|
15
15
|
new(
|
|
16
16
|
streaming: hash["streaming"],
|
|
17
17
|
push_notifications: hash["pushNotifications"],
|
|
18
|
-
extensions: hash["extensions"]&.map { AgentExtension.from_h(
|
|
18
|
+
extensions: hash["extensions"]&.map { AgentExtension.from_h(it) },
|
|
19
19
|
extended_agent_card: hash["extendedAgentCard"]
|
|
20
20
|
)
|
|
21
21
|
end
|
|
@@ -49,8 +49,8 @@ module A2A
|
|
|
49
49
|
|
|
50
50
|
# Appends a supported interface. Accepts either an AgentInterface object
|
|
51
51
|
# or kwargs forwarded to AgentInterface.new.
|
|
52
|
-
def interface(iface = nil, **
|
|
53
|
-
@interfaces << (iface.is_a?(AgentInterface) ? iface : AgentInterface.new(**
|
|
52
|
+
def interface(iface = nil, **)
|
|
53
|
+
@interfaces << (iface.is_a?(AgentInterface) ? iface : AgentInterface.new(**))
|
|
54
54
|
self
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -75,8 +75,8 @@ module A2A
|
|
|
75
75
|
|
|
76
76
|
# Appends a skill. Accepts either an AgentSkill object or kwargs
|
|
77
77
|
# forwarded to AgentSkill.new.
|
|
78
|
-
def skill(obj = nil, **
|
|
79
|
-
@skills << (obj.is_a?(AgentSkill) ? obj : AgentSkill.new(**
|
|
78
|
+
def skill(obj = nil, **)
|
|
79
|
+
@skills << (obj.is_a?(AgentSkill) ? obj : AgentSkill.new(**))
|
|
80
80
|
self
|
|
81
81
|
end
|
|
82
82
|
|
data/lib/a2a/agent_card.rb
CHANGED
|
@@ -43,17 +43,17 @@ module A2A
|
|
|
43
43
|
name: hash.fetch("name"),
|
|
44
44
|
description: hash.fetch("description"),
|
|
45
45
|
version: hash.fetch("version"),
|
|
46
|
-
supported_interfaces: hash.fetch("supportedInterfaces").map { AgentInterface.from_h(
|
|
46
|
+
supported_interfaces: hash.fetch("supportedInterfaces").map { AgentInterface.from_h(it) },
|
|
47
47
|
capabilities: AgentCapabilities.from_h(hash.fetch("capabilities")),
|
|
48
|
-
skills: hash.fetch("skills").map { AgentSkill.from_h(
|
|
49
|
-
security_schemes: (hash["securitySchemes"] || {}).transform_values { SecurityScheme.from_h(
|
|
48
|
+
skills: hash.fetch("skills").map { AgentSkill.from_h(it) },
|
|
49
|
+
security_schemes: (hash["securitySchemes"] || {}).transform_values { SecurityScheme.from_h(it) },
|
|
50
50
|
security_requirements: hash["security"],
|
|
51
51
|
default_input_modes: hash.fetch("defaultInputModes"),
|
|
52
52
|
default_output_modes: hash.fetch("defaultOutputModes"),
|
|
53
53
|
provider: hash["provider"] && AgentProvider.from_h(hash["provider"]),
|
|
54
54
|
documentation_url: hash["documentationUrl"],
|
|
55
55
|
icon_url: hash["iconUrl"],
|
|
56
|
-
signatures: hash["signatures"]&.map { Signature.from_h(
|
|
56
|
+
signatures: hash["signatures"]&.map { Signature.from_h(it) }
|
|
57
57
|
)
|
|
58
58
|
end
|
|
59
59
|
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
|
@@ -109,8 +109,8 @@ module A2A
|
|
|
109
109
|
|
|
110
110
|
def sort_keys_recursive(obj)
|
|
111
111
|
case obj
|
|
112
|
-
when Hash then obj.sort.to_h.transform_values { sort_keys_recursive(
|
|
113
|
-
when Array then obj.map { sort_keys_recursive(
|
|
112
|
+
when Hash then obj.sort.to_h.transform_values { sort_keys_recursive(it) }
|
|
113
|
+
when Array then obj.map { sort_keys_recursive(it) }
|
|
114
114
|
else obj
|
|
115
115
|
end
|
|
116
116
|
end
|
data/lib/a2a/agent_skill.rb
CHANGED
|
@@ -26,7 +26,7 @@ module A2A
|
|
|
26
26
|
examples: hash["examples"],
|
|
27
27
|
input_modes: hash["inputModes"],
|
|
28
28
|
output_modes: hash["outputModes"],
|
|
29
|
-
security_requirements: hash["securityRequirements"]&.map { SecurityRequirement.from_h(
|
|
29
|
+
security_requirements: hash["securityRequirements"]&.map { SecurityRequirement.from_h(it) }
|
|
30
30
|
)
|
|
31
31
|
end
|
|
32
32
|
|
data/lib/a2a/artifact.rb
CHANGED
|
@@ -20,7 +20,7 @@ module A2A
|
|
|
20
20
|
id: hash.fetch("artifactId"),
|
|
21
21
|
name: hash["name"],
|
|
22
22
|
description: hash["description"],
|
|
23
|
-
parts: Array(hash["parts"]).map { Part.from_h(
|
|
23
|
+
parts: Array(hash["parts"]).map { Part.from_h(it) },
|
|
24
24
|
extensions: hash["extensions"],
|
|
25
25
|
metadata: hash["metadata"]
|
|
26
26
|
)
|
data/lib/a2a/client.rb
CHANGED
|
@@ -37,17 +37,18 @@ module A2A
|
|
|
37
37
|
run Operation::SendMessage.new(message, configuration: configuration, metadata: metadata, tenant: tenant)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def send_streaming_message(message, configuration: {}, metadata: nil, tenant: nil, &
|
|
41
|
-
op = Operation::SendStreamingMessage.new(message, configuration: configuration, metadata: metadata,
|
|
42
|
-
|
|
40
|
+
def send_streaming_message(message, configuration: {}, metadata: nil, tenant: nil, &)
|
|
41
|
+
op = Operation::SendStreamingMessage.new(message, configuration: configuration, metadata: metadata,
|
|
42
|
+
tenant: tenant)
|
|
43
|
+
run(op, &)
|
|
43
44
|
end
|
|
44
45
|
|
|
45
46
|
def get_task(id, history_length: nil, tenant: nil)
|
|
46
47
|
run Operation::GetTask.new(id:, history_length:, tenant:)
|
|
47
48
|
end
|
|
48
49
|
|
|
49
|
-
def list_tasks(**
|
|
50
|
-
run Operation::ListTasks.new(**
|
|
50
|
+
def list_tasks(**)
|
|
51
|
+
run Operation::ListTasks.new(**)
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
def cancel_task(id, metadata: nil, tenant: nil)
|
|
@@ -59,8 +60,8 @@ module A2A
|
|
|
59
60
|
run Operation::CancelTask.new(id: task_id, metadata:, tenant:)
|
|
60
61
|
end
|
|
61
62
|
|
|
62
|
-
def subscribe_to_task(id, tenant: nil, &
|
|
63
|
-
run
|
|
63
|
+
def subscribe_to_task(id, tenant: nil, &)
|
|
64
|
+
run(Operation::SubscribeToTask.new(id:, tenant:), &)
|
|
64
65
|
end
|
|
65
66
|
|
|
66
67
|
def create_task_push_notification_config(config, tenant: nil)
|
data/lib/a2a/message.rb
CHANGED
|
@@ -24,7 +24,7 @@ module A2A
|
|
|
24
24
|
new(
|
|
25
25
|
id: hash.fetch("messageId"),
|
|
26
26
|
role: hash.fetch("role"),
|
|
27
|
-
parts: Array(hash["parts"]).map { Part.from_h(
|
|
27
|
+
parts: Array(hash["parts"]).map { Part.from_h(it) },
|
|
28
28
|
context_id: hash["contextId"],
|
|
29
29
|
task_id: hash["taskId"],
|
|
30
30
|
reference_task_ids: hash["referenceTaskIds"],
|
|
@@ -47,7 +47,7 @@ module A2A
|
|
|
47
47
|
|
|
48
48
|
def self.from_h(hash)
|
|
49
49
|
new(
|
|
50
|
-
configs: Array(hash["configs"]).map { PushNotification::Config.from_h(
|
|
50
|
+
configs: Array(hash["configs"]).map { PushNotification::Config.from_h(it) },
|
|
51
51
|
next_page_token: hash["nextPageToken"]
|
|
52
52
|
)
|
|
53
53
|
end
|
|
@@ -57,7 +57,7 @@ module A2A
|
|
|
57
57
|
|
|
58
58
|
def self.from_h(hash)
|
|
59
59
|
new(
|
|
60
|
-
tasks: Array(hash["tasks"]).map { Task.from_h(
|
|
60
|
+
tasks: Array(hash["tasks"]).map { Task.from_h(it) },
|
|
61
61
|
next_page_token: hash.fetch("nextPageToken"),
|
|
62
62
|
page_size: hash.fetch("pageSize"),
|
|
63
63
|
total_size: hash.fetch("totalSize")
|
|
@@ -36,11 +36,11 @@ module A2A
|
|
|
36
36
|
handle_delete_response(response)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
def stream(url, headers:, method: :post, body: {}, query: {}, &
|
|
39
|
+
def stream(url, headers:, method: :post, body: {}, query: {}, &)
|
|
40
40
|
uri = URI.parse(url)
|
|
41
41
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
42
42
|
http.use_ssl = uri.scheme == "https"
|
|
43
|
-
http.request(build_stream_request(uri, method, headers, body, query), &
|
|
43
|
+
http.request(build_stream_request(uri, method, headers, body, query), &)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
private
|
|
@@ -18,11 +18,11 @@ module A2A
|
|
|
18
18
|
handle_response(response)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
def stream(url, headers:, method: :post, body: {}, query: {}, &
|
|
21
|
+
def stream(url, headers:, method: :post, body: {}, query: {}, &)
|
|
22
22
|
uri = URI.parse(url)
|
|
23
23
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
24
24
|
http.use_ssl = uri.scheme == "https"
|
|
25
|
-
http.request(build_stream_request(uri, method, headers, body, query), &
|
|
25
|
+
http.request(build_stream_request(uri, method, headers, body, query), &)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
private
|
|
@@ -7,14 +7,14 @@ module A2A
|
|
|
7
7
|
module SseParser
|
|
8
8
|
# Parses a stream of SSE lines, yielding one Streaming::Response per
|
|
9
9
|
# logical event (blank-line delimited, multi-line data: concatenated).
|
|
10
|
-
def self.each(io, &
|
|
10
|
+
def self.each(io, &)
|
|
11
11
|
buffer = +""
|
|
12
12
|
|
|
13
13
|
io.each_line do |line|
|
|
14
14
|
line = line.chomp
|
|
15
15
|
|
|
16
16
|
if line.empty?
|
|
17
|
-
emit(buffer, &
|
|
17
|
+
emit(buffer, &) unless buffer.empty?
|
|
18
18
|
buffer = +""
|
|
19
19
|
elsif line.start_with?("data:")
|
|
20
20
|
# SSE spec: multiple data: lines are concatenated with U+000A
|
|
@@ -24,7 +24,7 @@ module A2A
|
|
|
24
24
|
# skip comment lines (":"), "event:", "id:", "retry:" fields
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
emit(buffer, &
|
|
27
|
+
emit(buffer, &) unless buffer.empty?
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def self.emit(buffer)
|
data/lib/a2a/task.rb
CHANGED
|
@@ -23,8 +23,8 @@ module A2A
|
|
|
23
23
|
id: hash.fetch("id"),
|
|
24
24
|
context_id: hash["contextId"],
|
|
25
25
|
status: Task::Status.from_h(hash.fetch("status")),
|
|
26
|
-
artifacts: Array(hash["artifacts"]).map { Artifact.from_h(
|
|
27
|
-
history: Array(hash["history"]).map { Message.from_h(
|
|
26
|
+
artifacts: Array(hash["artifacts"]).map { Artifact.from_h(it) },
|
|
27
|
+
history: Array(hash["history"]).map { Message.from_h(it) },
|
|
28
28
|
metadata: hash["metadata"]
|
|
29
29
|
)
|
|
30
30
|
end
|
data/lib/a2a/version.rb
CHANGED