Skip to content

Commit 274a661

Browse files
authored
chore(spec): Update A2A types from specification 🤖 (#350)
This PR updates `src/a2a/types.py` based on the latest `specification/json/a2a.json` from [a2aproject/A2A](a2aproject/A2A@ef4a305).
1 parent 70b4999 commit 274a661

File tree

4 files changed

+124
-80
lines changed

4 files changed

+124
-80
lines changed

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ INR
4545
isready
4646
JPY
4747
JSONRPCt
48+
JWS
4849
kwarg
4950
langgraph
5051
lifecycles

src/a2a/grpc/a2a_pb2.py

Lines changed: 84 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/a2a/grpc/a2a_pb2.pyi

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class AgentInterface(_message.Message):
202202
def __init__(self, url: _Optional[str] = ..., transport: _Optional[str] = ...) -> None: ...
203203

204204
class AgentCard(_message.Message):
205-
__slots__ = ("protocol_version", "name", "description", "url", "preferred_transport", "additional_interfaces", "provider", "version", "documentation_url", "capabilities", "security_schemes", "security", "default_input_modes", "default_output_modes", "skills", "supports_authenticated_extended_card")
205+
__slots__ = ("protocol_version", "name", "description", "url", "preferred_transport", "additional_interfaces", "provider", "version", "documentation_url", "capabilities", "security_schemes", "security", "default_input_modes", "default_output_modes", "skills", "supports_authenticated_extended_card", "signatures")
206206
class SecuritySchemesEntry(_message.Message):
207207
__slots__ = ("key", "value")
208208
KEY_FIELD_NUMBER: _ClassVar[int]
@@ -226,6 +226,7 @@ class AgentCard(_message.Message):
226226
DEFAULT_OUTPUT_MODES_FIELD_NUMBER: _ClassVar[int]
227227
SKILLS_FIELD_NUMBER: _ClassVar[int]
228228
SUPPORTS_AUTHENTICATED_EXTENDED_CARD_FIELD_NUMBER: _ClassVar[int]
229+
SIGNATURES_FIELD_NUMBER: _ClassVar[int]
229230
protocol_version: str
230231
name: str
231232
description: str
@@ -242,7 +243,8 @@ class AgentCard(_message.Message):
242243
default_output_modes: _containers.RepeatedScalarFieldContainer[str]
243244
skills: _containers.RepeatedCompositeFieldContainer[AgentSkill]
244245
supports_authenticated_extended_card: bool
245-
def __init__(self, protocol_version: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., url: _Optional[str] = ..., preferred_transport: _Optional[str] = ..., additional_interfaces: _Optional[_Iterable[_Union[AgentInterface, _Mapping]]] = ..., provider: _Optional[_Union[AgentProvider, _Mapping]] = ..., version: _Optional[str] = ..., documentation_url: _Optional[str] = ..., capabilities: _Optional[_Union[AgentCapabilities, _Mapping]] = ..., security_schemes: _Optional[_Mapping[str, SecurityScheme]] = ..., security: _Optional[_Iterable[_Union[Security, _Mapping]]] = ..., default_input_modes: _Optional[_Iterable[str]] = ..., default_output_modes: _Optional[_Iterable[str]] = ..., skills: _Optional[_Iterable[_Union[AgentSkill, _Mapping]]] = ..., supports_authenticated_extended_card: bool = ...) -> None: ...
246+
signatures: _containers.RepeatedCompositeFieldContainer[AgentCardSignature]
247+
def __init__(self, protocol_version: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., url: _Optional[str] = ..., preferred_transport: _Optional[str] = ..., additional_interfaces: _Optional[_Iterable[_Union[AgentInterface, _Mapping]]] = ..., provider: _Optional[_Union[AgentProvider, _Mapping]] = ..., version: _Optional[str] = ..., documentation_url: _Optional[str] = ..., capabilities: _Optional[_Union[AgentCapabilities, _Mapping]] = ..., security_schemes: _Optional[_Mapping[str, SecurityScheme]] = ..., security: _Optional[_Iterable[_Union[Security, _Mapping]]] = ..., default_input_modes: _Optional[_Iterable[str]] = ..., default_output_modes: _Optional[_Iterable[str]] = ..., skills: _Optional[_Iterable[_Union[AgentSkill, _Mapping]]] = ..., supports_authenticated_extended_card: bool = ..., signatures: _Optional[_Iterable[_Union[AgentCardSignature, _Mapping]]] = ...) -> None: ...
246248

247249
class AgentProvider(_message.Message):
248250
__slots__ = ("url", "organization")
@@ -292,6 +294,16 @@ class AgentSkill(_message.Message):
292294
output_modes: _containers.RepeatedScalarFieldContainer[str]
293295
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[str]] = ..., examples: _Optional[_Iterable[str]] = ..., input_modes: _Optional[_Iterable[str]] = ..., output_modes: _Optional[_Iterable[str]] = ...) -> None: ...
294296

297+
class AgentCardSignature(_message.Message):
298+
__slots__ = ("protected", "signature", "header")
299+
PROTECTED_FIELD_NUMBER: _ClassVar[int]
300+
SIGNATURE_FIELD_NUMBER: _ClassVar[int]
301+
HEADER_FIELD_NUMBER: _ClassVar[int]
302+
protected: str
303+
signature: str
304+
header: _struct_pb2.Struct
305+
def __init__(self, protected: _Optional[str] = ..., signature: _Optional[str] = ..., header: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ...
306+
295307
class TaskPushNotificationConfig(_message.Message):
296308
__slots__ = ("name", "push_notification_config")
297309
NAME_FIELD_NUMBER: _ClassVar[int]

src/a2a/types.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,27 @@ class APIKeySecurityScheme(A2ABaseModel):
4848
"""
4949

5050

51+
class AgentCardSignature(A2ABaseModel):
52+
"""
53+
AgentCardSignature represents a JWS signature of an AgentCard.
54+
This follows the JSON format of an RFC 7515 JSON Web Signature (JWS).
55+
"""
56+
57+
header: dict[str, Any] | None = None
58+
"""
59+
The unprotected JWS header values.
60+
"""
61+
protected: str
62+
"""
63+
The protected JWS header for the signature. This is a Base64url-encoded
64+
JSON object, as per RFC 7515.
65+
"""
66+
signature: str
67+
"""
68+
The computed signature, Base64url-encoded.
69+
"""
70+
71+
5172
class AgentExtension(A2ABaseModel):
5273
"""
5374
A declaration of a protocol extension supported by an Agent.
@@ -1705,6 +1726,10 @@ class AgentCard(A2ABaseModel):
17051726
A declaration of the security schemes available to authorize requests. The key is the
17061727
scheme name. Follows the OpenAPI 3.0 Security Scheme Object.
17071728
"""
1729+
signatures: list[AgentCardSignature] | None = None
1730+
"""
1731+
JSON Web Signatures computed for this AgentCard.
1732+
"""
17081733
skills: list[AgentSkill]
17091734
"""
17101735
The set of skills, or distinct capabilities, that the agent can perform.

0 commit comments

Comments
 (0)