a2a 0.1.0 → 0.2.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.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.agent-docs/ROADMAP.md +423 -0
  3. data/.agent-docs/index.md +124 -0
  4. data/.agent-docs/llms.txt +318 -0
  5. data/.agent-docs/specification/json.json +2575 -0
  6. data/.agent-docs/specification.md +1924 -0
  7. data/.agent-docs/topics/a2a-and-mcp.md +132 -0
  8. data/.agent-docs/topics/agent-discovery.md +96 -0
  9. data/.agent-docs/topics/enterprise-ready.md +139 -0
  10. data/.agent-docs/topics/extensions.md +260 -0
  11. data/.agent-docs/topics/key-concepts.md +99 -0
  12. data/.agent-docs/topics/life-of-a-task.md +255 -0
  13. data/.agent-docs/topics/streaming-and-async.md +111 -0
  14. data/.agent-docs/topics/what-is-a2a.md +218 -0
  15. data/.agent-docs/tutorials/index.md +31 -0
  16. data/.agent-docs/tutorials/python/1-introduction.md +32 -0
  17. data/.agent-docs/tutorials/python/2-setup.md +55 -0
  18. data/.agent-docs/tutorials/python/3-agent-skills-and-card.md +48 -0
  19. data/.agent-docs/tutorials/python/4-agent-executor.md +57 -0
  20. data/.agent-docs/tutorials/python/5-start-server.md +55 -0
  21. data/.agent-docs/tutorials/python/6-interact-with-server.md +95 -0
  22. data/.agent-docs/tutorials/python/7-streaming-and-multiturn.md +97 -0
  23. data/.agent-docs/tutorials/python/8-next-steps.md +40 -0
  24. data/.agent-docs/types.ts +1544 -0
  25. data/.agent-docs/types_mapping.md +196 -0
  26. data/.claude/commands/gemfile/update.md +52 -0
  27. data/.claude/settings.local.json +23 -0
  28. data/.tool-versions +1 -1
  29. data/CHANGELOG.md +68 -1
  30. data/CLAUDE.md +98 -0
  31. data/README.md +20 -14
  32. data/Rakefile +1 -3
  33. data/WARP.md +115 -0
  34. data/lib/a2a/extensions/json_deserialization.rb +1 -3
  35. data/lib/a2a/types/agent_capabilities.rb +3 -0
  36. data/lib/a2a/types/agent_card.rb +49 -17
  37. data/lib/a2a/types/agent_card_signature.rb +17 -0
  38. data/lib/a2a/types/agent_extension.rb +19 -0
  39. data/lib/a2a/types/agent_interface.rb +13 -0
  40. data/lib/a2a/types/agent_provider.rb +2 -2
  41. data/lib/a2a/types/agent_skill.rb +11 -4
  42. data/lib/a2a/types/api_key_security_scheme.rb +15 -0
  43. data/lib/a2a/types/artifact.rb +10 -15
  44. data/lib/a2a/types/authenticated_extended_card_not_configured_error.rb +43 -0
  45. data/lib/a2a/types/authorization_code_oauth_flow.rb +22 -0
  46. data/lib/a2a/types/cancel_task_request.rb +5 -2
  47. data/lib/a2a/types/cancel_task_response.rb +3 -3
  48. data/lib/a2a/types/client_credentials_oauth_flow.rb +16 -0
  49. data/lib/a2a/types/content_type_not_supported_error.rb +42 -0
  50. data/lib/a2a/types/data_part.rb +5 -8
  51. data/lib/a2a/types/delete_task_push_notification_config_params.rb +9 -0
  52. data/lib/a2a/types/delete_task_push_notification_config_request.rb +18 -0
  53. data/lib/a2a/types/delete_task_push_notification_config_response.rb +13 -0
  54. data/lib/a2a/types/error.rb +19 -0
  55. data/lib/a2a/types/error_codes.rb +6 -0
  56. data/lib/a2a/types/file_base.rb +12 -0
  57. data/lib/a2a/types/file_part.rb +7 -9
  58. data/lib/a2a/types/file_with_bytes.rb +9 -0
  59. data/lib/a2a/types/file_with_uri.rb +9 -0
  60. data/lib/a2a/types/get_authenticated_extended_card_request.rb +15 -0
  61. data/lib/a2a/types/get_authenticated_extended_card_response.rb +13 -0
  62. data/lib/a2a/types/get_task_push_notification_config_params.rb +9 -0
  63. data/lib/a2a/types/get_task_push_notification_config_request.rb +21 -0
  64. data/lib/a2a/types/get_task_push_notification_request.rb +5 -2
  65. data/lib/a2a/types/get_task_push_notification_response.rb +4 -4
  66. data/lib/a2a/types/get_task_request.rb +5 -2
  67. data/lib/a2a/types/get_task_response.rb +3 -3
  68. data/lib/a2a/types/http_auth_security_scheme.rb +18 -0
  69. data/lib/a2a/types/implicit_oauth_flow.rb +16 -0
  70. data/lib/a2a/types/invalid_agent_response_error.rb +41 -0
  71. data/lib/a2a/types/list_task_push_notification_config_params.rb +8 -0
  72. data/lib/a2a/types/list_task_push_notification_config_request.rb +18 -0
  73. data/lib/a2a/types/list_task_push_notification_config_response.rb +13 -0
  74. data/lib/a2a/types/message.rb +24 -4
  75. data/lib/a2a/types/message_send_configuration.rb +20 -0
  76. data/lib/a2a/types/message_send_params.rb +16 -0
  77. data/lib/a2a/types/mutual_tls_security_scheme.rb +9 -0
  78. data/lib/a2a/types/oauth2_security_scheme.rb +16 -0
  79. data/lib/a2a/types/oauth_flows.rb +20 -0
  80. data/lib/a2a/types/openid_connect_security_scheme.rb +12 -0
  81. data/lib/a2a/types/part.rb +2 -1
  82. data/lib/a2a/types/part_base.rb +9 -0
  83. data/lib/a2a/types/password_oauth_flow.rb +16 -0
  84. data/lib/a2a/types/push_notification_authentication_info.rb +12 -0
  85. data/lib/a2a/types/push_notification_config.rb +11 -6
  86. data/lib/a2a/types/push_notification_not_supported_error.rb +37 -10
  87. data/lib/a2a/types/request.rb +15 -0
  88. data/lib/a2a/types/security_scheme.rb +11 -0
  89. data/lib/a2a/types/security_scheme_base.rb +9 -0
  90. data/lib/a2a/types/send_message_request.rb +18 -0
  91. data/lib/a2a/types/send_message_response.rb +13 -0
  92. data/lib/a2a/types/send_streaming_message_request.rb +18 -0
  93. data/lib/a2a/types/send_streaming_message_response.rb +15 -0
  94. data/lib/a2a/types/set_task_push_notification_config_request.rb +18 -0
  95. data/lib/a2a/types/set_task_push_notification_request.rb +5 -2
  96. data/lib/a2a/types/set_task_push_notification_response.rb +4 -4
  97. data/lib/a2a/types/task.rb +15 -11
  98. data/lib/a2a/types/task_artifact_update_event.rb +18 -7
  99. data/lib/a2a/types/task_not_cancelable_error.rb +37 -10
  100. data/lib/a2a/types/task_not_found_error.rb +37 -10
  101. data/lib/a2a/types/task_resubscription_request.rb +5 -2
  102. data/lib/a2a/types/task_state.rb +2 -1
  103. data/lib/a2a/types/task_status_update_event.rb +13 -6
  104. data/lib/a2a/types/text_part.rb +5 -8
  105. data/lib/a2a/types/transport_protocol.rb +6 -0
  106. data/lib/a2a/types/unsupported_operation_error.rb +37 -10
  107. data/lib/a2a/types.rb +13 -0
  108. data/lib/a2a/version.rb +1 -1
  109. data/lib/a2a.rb +15 -5
  110. metadata +101 -19
  111. data/lib/a2a/types/agent_authentication.rb +0 -13
  112. data/lib/a2a/types/authentication_info.rb +0 -9
  113. data/lib/a2a/types/file_content.rb +0 -18
  114. data/lib/a2a/types/internal_error.rb +0 -15
  115. data/lib/a2a/types/invalid_params_error.rb +0 -15
  116. data/lib/a2a/types/invalid_request_error.rb +0 -15
  117. data/lib/a2a/types/json_parse_error.rb +0 -15
  118. data/lib/a2a/types/jsonrpc_error.rb +0 -15
  119. data/lib/a2a/types/jsonrpc_message.rb +0 -12
  120. data/lib/a2a/types/jsonrpc_request.rb +0 -15
  121. data/lib/a2a/types/jsonrpc_response.rb +0 -12
  122. data/lib/a2a/types/method_not_found_error.rb +0 -15
  123. data/lib/a2a/types/send_task_request.rb +0 -15
  124. data/lib/a2a/types/send_task_response.rb +0 -13
  125. data/lib/a2a/types/send_task_streaming_request.rb +0 -15
  126. data/lib/a2a/types/send_task_streaming_response.rb +0 -15
  127. data/lib/a2a/types/task_send_params.rb +0 -26
@@ -1,25 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- # Represents a task being processed by an agent.
4
+ # Represents a single, stateful operation or conversation between a client and an agent.
5
5
  class Task < ProtocolStruct
6
- # @return [String] Unique identifier for the task.
6
+ # @return [String] A unique identifier (e.g. UUID) for the task, generated by the server for a new task.
7
7
  attribute :id, Types::String
8
8
 
9
- # @return [String, nil] Optional identifier for the session this task belongs to.
10
- attribute? :session_id, Types::String.optional
9
+ # @return [String] A server-generated unique identifier (e.g. UUID) for maintaining context across multiple related
10
+ # tasks or interactions.
11
+ attribute :context_id, Types::String
11
12
 
12
- # @return [TaskStatus] The current status of the task.
13
+ # @return [TaskStatus] The current status of the task, including its state and a descriptive message.
13
14
  attribute :status, Types::Constructor(TaskStatus)
14
15
 
15
- # @return [Array<Artifact>, nil] Optional list of artifacts associated with the task
16
- # (e.g., outputs, intermediate files).
17
- attribute? :artifacts, Types::Array.of(Types::Constructor(Artifact)).optional
18
-
19
- # @return [Array<Message>, nil] Optional history of messages exchanged during the task.
16
+ # @return [Array<Message>, nil] An array of messages exchanged during the task, representing the conversation
17
+ # history.
20
18
  attribute? :history, Types::Array.of(Types::Constructor(Message)).optional
21
19
 
22
- # @return [Hash, nil] Optional metadata associated with the task.
20
+ # @return [Array<Artifact>, nil] A collection of artifacts generated by the agent during the execution of the task.
21
+ attribute? :artifacts, Types::Array.of(Types::Constructor(Artifact)).optional
22
+
23
+ # @return [Hash, nil] Optional metadata for extensions. The key is an extension-specific identifier.
23
24
  attribute? :metadata, Types::Hash.optional
25
+
26
+ # @return [String] The type of this object, used as a discriminator. Always 'task' for a Task.
27
+ attribute :kind, Types::String.constant('task')
24
28
  end
25
29
  end
@@ -1,18 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- # Represents an artifact update event for a task, typically used in streaming scenarios.
4
+ # An event sent by the agent to notify the client that an artifact has been
5
+ # generated or updated. This is typically used in streaming models.
5
6
  class TaskArtifactUpdateEvent < ProtocolStruct
6
- # @return [String] The ID of the task being updated.
7
- attribute :id, Types::String
7
+ # @return [String] The ID of the task this artifact belongs to.
8
+ attribute :task_id, Types::String
8
9
 
9
- # @return [Artifact] The new or updated artifact for the task.
10
+ # @return [String] The context ID associated with the task.
11
+ attribute :context_id, Types::String
12
+
13
+ # @return [String] The type of this event, used as a discriminator. Always 'artifact-update'.
14
+ attribute :kind, Types::String.constant('artifact-update')
15
+
16
+ # @return [Artifact] The artifact that was generated or updated.
10
17
  attribute :artifact, Types::Constructor(Artifact)
11
18
 
12
- # @return [Boolean, nil] Flag indicating if this is the final update for the task.
13
- attribute? :final, Types::Bool.optional
19
+ # @return [Boolean, nil] If true, the content of this artifact should be appended to a previously sent artifact
20
+ # with the same ID.
21
+ attribute? :append, Types::Bool.optional
22
+
23
+ # @return [Boolean, nil] If true, this is the final chunk of the artifact.
24
+ attribute? :last_chunk, Types::Bool.optional
14
25
 
15
- # @return [Hash, nil] Optional metadata associated with this update event.
26
+ # @return [Hash, nil] Optional metadata for extensions.
16
27
  attribute? :metadata, Types::Hash.optional
17
28
  end
18
29
  end
@@ -1,15 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- # Error for task not cancelable
5
- class TaskNotCancelableError < JSONRPCError
6
- # @return [Integer] Error code (-32002)
7
- attribute :code, Types::Integer.constant(ErrorCodes::TASK_NOT_CANCELABLE)
8
-
9
- # @return [String] Error message
10
- attribute :message, Types::String.constant('Task cannot be canceled')
11
-
12
- # @return [nil] No additional data
13
- attribute? :data, Types::Nil.constant(nil)
4
+ # Error non-cancelable tasks (-32002)
5
+ #
6
+ # Raised when a task cannot be canceled. An attempt was made to cancel a task that is not in a cancelable state
7
+ # (e.g., it has already reached a terminal state like completed, failed, or canceled).
8
+ #
9
+ # @api public
10
+ #
11
+ # @example Create a task not cancelable error
12
+ # error = JSONRPC::Errors::TaskNotCancelableError.new
13
+ #
14
+ class TaskNotCancelableError < JSONRPC::Error
15
+ # Creates a new Task Not Cancelable Error with code -32002
16
+ #
17
+ # @api public
18
+ #
19
+ # @example Create a task not cancelable error with default message
20
+ # error = JSONRPC::TaskNotCancelableError.new
21
+ #
22
+ # @example Create a task not cancelable error with exception details
23
+ # error = JSONRPC::TaskNotCancelableError.new(data: { exception: 'Task reached terminal state' }, request_id: 1)
24
+ #
25
+ # @param message [String] short description of the error
26
+ # @param data [Hash, Array, String, Number, Boolean, nil] additional error information
27
+ # @param request_id [String, Integer, nil] the request identifier
28
+ #
29
+ def initialize(
30
+ message = 'Task cannot be canceled.',
31
+ data: nil,
32
+ request_id: nil
33
+ )
34
+ super(
35
+ message,
36
+ code: ErrorCodes::TASK_NOT_CANCELABLE,
37
+ data:,
38
+ request_id:
39
+ )
40
+ end
14
41
  end
15
42
  end
@@ -1,15 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- # Error for task not found
5
- class TaskNotFoundError < JSONRPCError
6
- # @return [Integer] Error code (-32001)
7
- attribute :code, Types::Integer.constant(ErrorCodes::TASK_NOT_FOUND)
8
-
9
- # @return [String] Error message
10
- attribute :message, Types::String.constant('Task not found')
11
-
12
- # @return [nil] No additional data
13
- attribute? :data, Types::Nil.constant(nil)
4
+ # Error for missing tasks (-32001)
5
+ #
6
+ # Raised when the specified task ID does not correspond to an existing or active task.
7
+ # It might be invalid, expired, or already completed and purged.
8
+ #
9
+ # @api public
10
+ #
11
+ # @example Create a task not found error
12
+ # error = JSONRPC::TaskNotFoundError.new
13
+ #
14
+ class TaskNotFoundError < JSONRPC::Error
15
+ # Creates a new Task Not Found Error with code -32001
16
+ #
17
+ # @api public
18
+ #
19
+ # @example Create a task not found error with default message
20
+ # error = JSONRPC::TaskNotFoundError.new
21
+ #
22
+ # @example Create a task not found error with exception details
23
+ # error = JSONRPC::TaskNotFoundError.new(data: { task_id: 'invalid-id' }, request_id: 1)
24
+ #
25
+ # @param message [String] short description of the error
26
+ # @param data [Hash, Array, String, Number, Boolean, nil] additional error information
27
+ # @param request_id [String, Integer, nil] the request identifier
28
+ #
29
+ def initialize(
30
+ message = 'Task not found.',
31
+ data: nil,
32
+ request_id: nil
33
+ )
34
+ super(
35
+ message,
36
+ code: ErrorCodes::TASK_NOT_FOUND,
37
+ data:,
38
+ request_id:
39
+ )
40
+ end
14
41
  end
15
42
  end
@@ -2,9 +2,12 @@
2
2
 
3
3
  module A2A
4
4
  # Request to resubscribe to updates for a task after a connection interruption.
5
- class TaskResubscriptionRequest < JSONRPCRequest
5
+ class TaskResubscriptionRequest < JSONRPC::Request
6
6
  # @return [String] Method name for resubscribing to task updates.
7
- attribute :method, Types::String.constant('tasks/resubscribe')
7
+ METHOD = 'tasks/resubscribe'
8
+
9
+ # @return [String] Method name for resubscribing to task updates.
10
+ attribute :method, Types::String.constant(METHOD)
8
11
 
9
12
  # @return [TaskQueryParams] Parameters for the task resubscription method.
10
13
  attribute :params, Types::Constructor(TaskQueryParams)
@@ -2,5 +2,6 @@
2
2
 
3
3
  module A2A
4
4
  # The current state of the task
5
- TaskState = Types::String.enum('submitted', 'working', 'input-required', 'completed', 'canceled', 'failed', 'unknown')
5
+ TaskState = Types::String.enum('submitted', 'working', 'input-required', 'completed', 'canceled', 'failed',
6
+ 'rejected', 'auth-required', 'unknown')
6
7
  end
@@ -1,18 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- # Represents a status update event for a task, typically used in streaming scenarios.
4
+ # An event sent by the agent to notify the client of a change in a task's status.
5
+ # This is typically used in streaming or subscription models.
5
6
  class TaskStatusUpdateEvent < ProtocolStruct
6
- # @return [String] The ID of the task being updated.
7
- attribute :id, Types::String
7
+ # @return [String] The ID of the task that was updated.
8
+ attribute :task_id, Types::String
9
+
10
+ # @return [String] The context ID associated with the task.
11
+ attribute :context_id, Types::String
12
+
13
+ # @return [String] The type of this event, used as a discriminator. Always 'status-update'.
14
+ attribute :kind, Types::String.constant('status-update')
8
15
 
9
16
  # @return [TaskStatus] The new status of the task.
10
17
  attribute :status, Types::Constructor(TaskStatus)
11
18
 
12
- # @return [Boolean] Flag indicating if this is the final update for the task.
13
- attribute? :final, Types::Bool.default(false)
19
+ # @return [Boolean] If true, this is the final event in the stream for this interaction.
20
+ attribute :final, Types::Bool
14
21
 
15
- # @return [Hash, nil] Optional metadata associated with this update event.
22
+ # @return [Hash, nil] Optional metadata for extensions.
16
23
  attribute? :metadata, Types::Hash.optional
17
24
  end
18
25
  end
@@ -1,15 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- # Represents a part of a message containing text content.
5
- class TextPart < ProtocolStruct
6
- # @return [String] Type identifier for this part.
7
- attribute :type, Types::String.constant('text')
4
+ # Represents a text segment within a message or artifact.
5
+ class TextPart < PartBase
6
+ # @return [String] The type of this part, used as a discriminator. Always 'text'.
7
+ attribute :kind, Types::String.constant('text')
8
8
 
9
- # @return [String] The text content.
9
+ # @return [String] The string content of the text part.
10
10
  attribute :text, Types::String
11
-
12
- # @return [Hash, nil] Optional metadata associated with this text part.
13
- attribute? :metadata, Types::Hash.optional
14
11
  end
15
12
  end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module A2A
4
+ # Supported A2A transport protocols.
5
+ TransportProtocol = Types::String.enum('JSONRPC', 'GRPC', 'HTTP+JSON')
6
+ end
@@ -1,15 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- # Error for unsupported operations
5
- class UnsupportedOperationError < JSONRPCError
6
- # @return [Integer] Error code (-32004)
7
- attribute :code, Types::Integer.constant(ErrorCodes::UNSUPPORTED_OPERATION)
8
-
9
- # @return [String] Error message
10
- attribute :message, Types::String.constant('This operation is not supported')
11
-
12
- # @return [nil] No additional data
13
- attribute? :data, Types::Nil.constant(nil)
4
+ # Error for unsupported operations (-32004)
5
+ #
6
+ # Raised when the requested operation or a specific aspect of it (perhaps implied by parameters)
7
+ # is not supported by this server agent implementation. Broader than just method not found.
8
+ #
9
+ # @api public
10
+ #
11
+ # @example Create an unsupported operation error
12
+ # error = JSONRPC::UnsupportedOperationError.new
13
+ #
14
+ class UnsupportedOperationError < JSONRPC::Error
15
+ # Creates a new Unsupported Operation Error with code -32004
16
+ #
17
+ # @api public
18
+ #
19
+ # @example Create an unsupported operation error with default message
20
+ # error = JSONRPC::UnsupportedOperationError.new
21
+ #
22
+ # @example Create an unsupported operation error with exception details
23
+ # error = JSONRPC::UnsupportedOperationError.new(data: { operation: 'streaming' }, request_id: 1)
24
+ #
25
+ # @param message [String] short description of the error
26
+ # @param data [Hash, Array, String, Number, Boolean, nil] additional error information
27
+ # @param request_id [String, Integer, nil] the request identifier
28
+ #
29
+ def initialize(
30
+ message = 'This operation is not supported.',
31
+ data: nil,
32
+ request_id: nil
33
+ )
34
+ super(
35
+ message,
36
+ code: ErrorCodes::UNSUPPORTED_OPERATION,
37
+ data:,
38
+ request_id:
39
+ )
40
+ end
14
41
  end
15
42
  end
data/lib/a2a/types.rb CHANGED
@@ -8,5 +8,18 @@ module A2A
8
8
  include Dry.Types()
9
9
 
10
10
  Dry::Types.define_builder(:constant) { |type, value| type.default(value).enum(value) }
11
+
12
+ # Custom URI type that accepts both String and URI objects
13
+ # and ensures the result is always a URI object
14
+ URI = Types.Constructor(::URI) do |value|
15
+ case value
16
+ when ::URI
17
+ value
18
+ when String
19
+ ::URI.parse(value)
20
+ else
21
+ raise ArgumentError, "Expected String or URI, got #{value.class}"
22
+ end
23
+ end
11
24
  end
12
25
  end
data/lib/a2a/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
data/lib/a2a.rb CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  require 'dry/inflector'
4
4
  require 'zeitwerk'
5
+ require 'jsonrpc'
6
+ require 'a2a/rails/railtie' if defined?(Rails)
5
7
 
6
8
  # Encapsulates all the gem's logic
7
9
  module A2A
@@ -13,14 +15,22 @@ end
13
15
  loader = Zeitwerk::Loader.for_gem
14
16
  loader.inflector.inflect(
15
17
  'a2a' => 'A2A',
18
+ 'api_key_security_scheme' => 'APIKeySecurityScheme',
19
+ 'authorization_code_oauth_flow' => 'AuthorizationCodeOAuthFlow',
20
+ 'client_credentials_oauth_flow' => 'ClientCredentialsOAuthFlow',
21
+ 'http_auth_security_scheme' => 'HTTPAuthSecurityScheme',
22
+ 'implicit_oauth_flow' => 'ImplicitOAuthFlow',
16
23
  'json_deserialization' => 'JSONDeserialization',
17
- 'jsonrpc_error' => 'JSONRPCError',
18
- 'jsonrpc_message' => 'JSONRPCMessage',
19
- 'jsonrpc_request' => 'JSONRPCRequest',
20
- 'jsonrpc_response' => 'JSONRPCResponse',
21
- 'json_parse_error' => 'JSONParseError'
24
+ 'jsonrpc_helpers' => 'JSONRPCHelpers',
25
+ 'mutual_tls_security_scheme' => 'MutualTLSSecurityScheme',
26
+ 'oauth2_security_scheme' => 'OAuth2SecurityScheme',
27
+ 'oauth_flows' => 'OAuthFlows',
28
+ 'openid_connect_security_scheme' => 'OpenIdConnectSecurityScheme',
29
+ 'password_oauth_flow' => 'PasswordOAuthFlow',
30
+ 'uri' => 'URI'
22
31
  )
23
32
  loader.collapse("#{__dir__}/a2a/types")
33
+ loader.ignore("#{__dir__}/a2a/rails/railtie.rb")
24
34
  loader.enable_reloading
25
35
  loader.setup
26
36
  loader.eager_load
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a2a
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilson Silva
@@ -23,6 +23,34 @@ dependencies:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
25
  version: '1.8'
26
+ - !ruby/object:Gem::Dependency
27
+ name: jsonrpc-middleware
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: 0.6.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: 0.6.0
40
+ - !ruby/object:Gem::Dependency
41
+ name: rack
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '3.2'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.2'
26
54
  - !ruby/object:Gem::Dependency
27
55
  name: zeitwerk
28
56
  requirement: !ruby/object:Gem::Requirement
@@ -45,6 +73,32 @@ executables: []
45
73
  extensions: []
46
74
  extra_rdoc_files: []
47
75
  files:
76
+ - ".agent-docs/ROADMAP.md"
77
+ - ".agent-docs/index.md"
78
+ - ".agent-docs/llms.txt"
79
+ - ".agent-docs/specification.md"
80
+ - ".agent-docs/specification/json.json"
81
+ - ".agent-docs/topics/a2a-and-mcp.md"
82
+ - ".agent-docs/topics/agent-discovery.md"
83
+ - ".agent-docs/topics/enterprise-ready.md"
84
+ - ".agent-docs/topics/extensions.md"
85
+ - ".agent-docs/topics/key-concepts.md"
86
+ - ".agent-docs/topics/life-of-a-task.md"
87
+ - ".agent-docs/topics/streaming-and-async.md"
88
+ - ".agent-docs/topics/what-is-a2a.md"
89
+ - ".agent-docs/tutorials/index.md"
90
+ - ".agent-docs/tutorials/python/1-introduction.md"
91
+ - ".agent-docs/tutorials/python/2-setup.md"
92
+ - ".agent-docs/tutorials/python/3-agent-skills-and-card.md"
93
+ - ".agent-docs/tutorials/python/4-agent-executor.md"
94
+ - ".agent-docs/tutorials/python/5-start-server.md"
95
+ - ".agent-docs/tutorials/python/6-interact-with-server.md"
96
+ - ".agent-docs/tutorials/python/7-streaming-and-multiturn.md"
97
+ - ".agent-docs/tutorials/python/8-next-steps.md"
98
+ - ".agent-docs/types.ts"
99
+ - ".agent-docs/types_mapping.md"
100
+ - ".claude/commands/gemfile/update.md"
101
+ - ".claude/settings.local.json"
48
102
  - ".editorconfig"
49
103
  - ".overcommit.yml"
50
104
  - ".rspec"
@@ -52,52 +106,80 @@ files:
52
106
  - ".tool-versions"
53
107
  - ".yardstick.yml"
54
108
  - CHANGELOG.md
109
+ - CLAUDE.md
55
110
  - CODE_OF_CONDUCT.md
56
111
  - Guardfile
57
112
  - LICENSE.txt
58
113
  - README.md
59
114
  - Rakefile
60
115
  - Steepfile
116
+ - WARP.md
61
117
  - lib/a2a.rb
62
118
  - lib/a2a/extensions/additional_properties.rb
63
119
  - lib/a2a/extensions/case_transformation.rb
64
120
  - lib/a2a/extensions/json_deserialization.rb
65
121
  - lib/a2a/types.rb
66
- - lib/a2a/types/agent_authentication.rb
67
122
  - lib/a2a/types/agent_capabilities.rb
68
123
  - lib/a2a/types/agent_card.rb
124
+ - lib/a2a/types/agent_card_signature.rb
125
+ - lib/a2a/types/agent_extension.rb
126
+ - lib/a2a/types/agent_interface.rb
69
127
  - lib/a2a/types/agent_provider.rb
70
128
  - lib/a2a/types/agent_skill.rb
129
+ - lib/a2a/types/api_key_security_scheme.rb
71
130
  - lib/a2a/types/artifact.rb
72
- - lib/a2a/types/authentication_info.rb
131
+ - lib/a2a/types/authenticated_extended_card_not_configured_error.rb
132
+ - lib/a2a/types/authorization_code_oauth_flow.rb
73
133
  - lib/a2a/types/cancel_task_request.rb
74
134
  - lib/a2a/types/cancel_task_response.rb
135
+ - lib/a2a/types/client_credentials_oauth_flow.rb
136
+ - lib/a2a/types/content_type_not_supported_error.rb
75
137
  - lib/a2a/types/data_part.rb
138
+ - lib/a2a/types/delete_task_push_notification_config_params.rb
139
+ - lib/a2a/types/delete_task_push_notification_config_request.rb
140
+ - lib/a2a/types/delete_task_push_notification_config_response.rb
141
+ - lib/a2a/types/error.rb
76
142
  - lib/a2a/types/error_codes.rb
77
- - lib/a2a/types/file_content.rb
143
+ - lib/a2a/types/file_base.rb
78
144
  - lib/a2a/types/file_part.rb
145
+ - lib/a2a/types/file_with_bytes.rb
146
+ - lib/a2a/types/file_with_uri.rb
147
+ - lib/a2a/types/get_authenticated_extended_card_request.rb
148
+ - lib/a2a/types/get_authenticated_extended_card_response.rb
149
+ - lib/a2a/types/get_task_push_notification_config_params.rb
150
+ - lib/a2a/types/get_task_push_notification_config_request.rb
79
151
  - lib/a2a/types/get_task_push_notification_request.rb
80
152
  - lib/a2a/types/get_task_push_notification_response.rb
81
153
  - lib/a2a/types/get_task_request.rb
82
154
  - lib/a2a/types/get_task_response.rb
83
- - lib/a2a/types/internal_error.rb
84
- - lib/a2a/types/invalid_params_error.rb
85
- - lib/a2a/types/invalid_request_error.rb
86
- - lib/a2a/types/json_parse_error.rb
87
- - lib/a2a/types/jsonrpc_error.rb
88
- - lib/a2a/types/jsonrpc_message.rb
89
- - lib/a2a/types/jsonrpc_request.rb
90
- - lib/a2a/types/jsonrpc_response.rb
155
+ - lib/a2a/types/http_auth_security_scheme.rb
156
+ - lib/a2a/types/implicit_oauth_flow.rb
157
+ - lib/a2a/types/invalid_agent_response_error.rb
158
+ - lib/a2a/types/list_task_push_notification_config_params.rb
159
+ - lib/a2a/types/list_task_push_notification_config_request.rb
160
+ - lib/a2a/types/list_task_push_notification_config_response.rb
91
161
  - lib/a2a/types/message.rb
92
- - lib/a2a/types/method_not_found_error.rb
162
+ - lib/a2a/types/message_send_configuration.rb
163
+ - lib/a2a/types/message_send_params.rb
164
+ - lib/a2a/types/mutual_tls_security_scheme.rb
165
+ - lib/a2a/types/oauth2_security_scheme.rb
166
+ - lib/a2a/types/oauth_flows.rb
167
+ - lib/a2a/types/openid_connect_security_scheme.rb
93
168
  - lib/a2a/types/part.rb
169
+ - lib/a2a/types/part_base.rb
170
+ - lib/a2a/types/password_oauth_flow.rb
94
171
  - lib/a2a/types/protocol_struct.rb
172
+ - lib/a2a/types/push_notification_authentication_info.rb
95
173
  - lib/a2a/types/push_notification_config.rb
96
174
  - lib/a2a/types/push_notification_not_supported_error.rb
97
- - lib/a2a/types/send_task_request.rb
98
- - lib/a2a/types/send_task_response.rb
99
- - lib/a2a/types/send_task_streaming_request.rb
100
- - lib/a2a/types/send_task_streaming_response.rb
175
+ - lib/a2a/types/request.rb
176
+ - lib/a2a/types/security_scheme.rb
177
+ - lib/a2a/types/security_scheme_base.rb
178
+ - lib/a2a/types/send_message_request.rb
179
+ - lib/a2a/types/send_message_response.rb
180
+ - lib/a2a/types/send_streaming_message_request.rb
181
+ - lib/a2a/types/send_streaming_message_response.rb
182
+ - lib/a2a/types/set_task_push_notification_config_request.rb
101
183
  - lib/a2a/types/set_task_push_notification_request.rb
102
184
  - lib/a2a/types/set_task_push_notification_response.rb
103
185
  - lib/a2a/types/task.rb
@@ -108,11 +190,11 @@ files:
108
190
  - lib/a2a/types/task_push_notification_config.rb
109
191
  - lib/a2a/types/task_query_params.rb
110
192
  - lib/a2a/types/task_resubscription_request.rb
111
- - lib/a2a/types/task_send_params.rb
112
193
  - lib/a2a/types/task_state.rb
113
194
  - lib/a2a/types/task_status.rb
114
195
  - lib/a2a/types/task_status_update_event.rb
115
196
  - lib/a2a/types/text_part.rb
197
+ - lib/a2a/types/transport_protocol.rb
116
198
  - lib/a2a/types/unsupported_operation_error.rb
117
199
  - lib/a2a/version.rb
118
200
  - sig/a2a.rbs
@@ -138,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
220
  - !ruby/object:Gem::Version
139
221
  version: '0'
140
222
  requirements: []
141
- rubygems_version: 3.6.8
223
+ rubygems_version: 3.7.2
142
224
  specification_version: 4
143
225
  summary: Implementation of the A2A (Agent2Agent) protocol.
144
226
  test_files: []
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module A2A
4
- # Defines the authentication schemes and credentials for an agent.
5
- class AgentAuthentication < ProtocolStruct
6
- # @return [Array<String>] List of supported authentication schemes.
7
- attribute :schemes, Types::Array.of(Types::String)
8
-
9
- # @return [String, nil] Credentials for authentication. Can be a string (e.g., token) or null if not
10
- # required initially.
11
- attribute? :credentials, Types::String.optional
12
- end
13
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module A2A
4
- # Authentication information, potentially including additional properties beyond the standard ones.
5
- # (Note: Schema allows additional properties).
6
- class AuthenticationInfo < AgentAuthentication
7
- include Extensions::AdditionalProperties
8
- end
9
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module A2A
4
- # Represents the content of a file, either as base64 encoded bytes or a URI.
5
- class FileContent < ProtocolStruct
6
- # @return [String, nil] Optional name of the file.
7
- attribute? :name, Types::String.optional
8
-
9
- # @return [String, nil] Optional MIME type of the file content.
10
- attribute? :mime_type, Types::String.optional
11
-
12
- # @return [String, nil] File content encoded as a Base64 string. Use this OR `uri`.
13
- attribute? :bytes, Types::String.optional
14
-
15
- # @return [String, nil] URI pointing to the file content. Use this OR `bytes`.
16
- attribute? :uri, Types::String.optional
17
- end
18
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module A2A
4
- # Error for internal server errors
5
- class InternalError < JSONRPCError
6
- # @return [Integer] Error code (-32603)
7
- attribute :code, Types::Integer.constant(ErrorCodes::INTERNAL_ERROR)
8
-
9
- # @return [String] Error message
10
- attribute :message, Types::String.constant('Internal error')
11
-
12
- # @return [Object, nil] Additional error data
13
- attribute? :data, Types::Nominal::Any.optional
14
- end
15
- end