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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0b5296863ce5b960cf2b4a3f27c3f4e4e93399f93c13c003719437e62891582
4
- data.tar.gz: 52641e6cf375bcf43392e178b3e06aa21e8dc77a2eda334ee3bb7e33ce598453
3
+ metadata.gz: dcd1c6d3514c1666a496e469b097b52f878e6ca0cb21cb71eb1967e515669b9a
4
+ data.tar.gz: 3d02330a7c82deabc3710ac798cec921bdc197613d775d5e1f1482c1175c301a
5
5
  SHA512:
6
- metadata.gz: 99fbf4d17ac3d536da464f3893174c459ad63822e967b9c798840770eee9f255d72fc2270a90a4d3ef8b692fc943c902314705da510d23d181f73f4df480155d
7
- data.tar.gz: 700d3a88eebecb34044067b1b55eb89b74d4c3ba11840ffc205c0e8f3027ccdc8389599d6fe2d0943c62db23f182ec738c96e5d3cd7f21b8fe212f31370ed5eb
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.1.1] — 2026-06-26\n\n### Added
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.1.1...HEAD
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.1.1]: https://github.com/rafaelqfigueiredo/a2a-rb/compare/v0.1.0...v0.1.1
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(_1) },
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, **kwargs)
53
- @interfaces << (iface.is_a?(AgentInterface) ? iface : AgentInterface.new(**kwargs))
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, **kwargs)
79
- @skills << (obj.is_a?(AgentSkill) ? obj : AgentSkill.new(**kwargs))
78
+ def skill(obj = nil, **)
79
+ @skills << (obj.is_a?(AgentSkill) ? obj : AgentSkill.new(**))
80
80
  self
81
81
  end
82
82
 
@@ -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(_1) },
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(_1) },
49
- security_schemes: (hash["securitySchemes"] || {}).transform_values { SecurityScheme.from_h(_1) },
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(_1) }
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(_1) }
113
- when Array then obj.map { sort_keys_recursive(_1) }
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
@@ -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(_1) }
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(_1) },
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, &block)
41
- op = Operation::SendStreamingMessage.new(message, configuration: configuration, metadata: metadata, tenant: tenant)
42
- run op, &block
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(**kwargs)
50
- run Operation::ListTasks.new(**kwargs)
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, &block)
63
- run Operation::SubscribeToTask.new(id:, tenant:), &block
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(_1) },
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(_1) },
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(_1) },
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: {}, &block)
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), &block)
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: {}, &block)
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), &block)
25
+ http.request(build_stream_request(uri, method, headers, body, query), &)
26
26
  end
27
27
 
28
28
  private
@@ -9,7 +9,7 @@ module A2A
9
9
  end
10
10
 
11
11
  def self.from_h(hash)
12
- new(schemes: hash.transform_values { _1.is_a?(Array) ? _1 : _1["list"] })
12
+ new(schemes: hash.transform_values { it.is_a?(Array) ? it : it["list"] })
13
13
  end
14
14
 
15
15
  def to_h
@@ -13,7 +13,7 @@ module A2A
13
13
  def self.from_h(hash)
14
14
  new(
15
15
  open_id_connect_url: hash.fetch("openIdConnectUrl"),
16
- description: hash["description"],
16
+ description: hash["description"]
17
17
  )
18
18
  end
19
19
 
@@ -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, &block)
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, &block) unless buffer.empty?
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, &block) unless buffer.empty?
27
+ emit(buffer, &) unless buffer.empty?
28
28
  end
29
29
 
30
30
  def self.emit(buffer)
@@ -45,9 +45,9 @@ module A2A
45
45
  @response = response
46
46
  end
47
47
 
48
- def each_line(&block)
48
+ def each_line(&)
49
49
  @response.read_body do |chunk|
50
- chunk.each_line(&block)
50
+ chunk.each_line(&)
51
51
  end
52
52
  end
53
53
  end
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(_1) },
27
- history: Array(hash["history"]).map { Message.from_h(_1) },
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.3"
5
5
  SPEC_VERSION = "1.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a2a-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Figueiredo