Skip to content

Commit 6f656f3

Browse files
committed
Update to specification from 6fb2b771b022ff3659f0819b307b680a6cef917c
1 parent 2444034 commit 6f656f3

File tree

1 file changed

+79
-1
lines changed

1 file changed

+79
-1
lines changed

src/a2a/types.py

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,26 @@ class AgentSkill(A2ABaseModel):
172172
"""
173173

174174

175+
class AuthenticatedExtendedCardNotConfiguredError(A2ABaseModel):
176+
"""
177+
An A2A-specific error indicating that the agent does not have an Authenticated Extended Card configured
178+
"""
179+
180+
code: Literal[-32007] = -32007
181+
"""
182+
The error code for when an authenticated extended card is not configured.
183+
"""
184+
data: Any | None = None
185+
"""
186+
A primitive or structured value containing additional information about the error.
187+
This may be omitted.
188+
"""
189+
message: str | None = 'Authenticated Extended Card is not configured'
190+
"""
191+
The error message.
192+
"""
193+
194+
175195
class AuthorizationCodeOAuthFlow(A2ABaseModel):
176196
"""
177197
Defines configuration details for the OAuth 2.0 Authorization Code flow.
@@ -375,6 +395,27 @@ class FileWithUri(A2ABaseModel):
375395
"""
376396

377397

398+
class GetAuthenticatedExtendedCardRequest(A2ABaseModel):
399+
"""
400+
Represents a JSON-RPC request for the `agent/getAuthenticatedExtendedCard` method.
401+
"""
402+
403+
id: str | int
404+
"""
405+
The identifier for this request.
406+
"""
407+
jsonrpc: Literal['2.0'] = '2.0'
408+
"""
409+
The version of the JSON-RPC protocol. MUST be exactly "2.0".
410+
"""
411+
method: Literal['agent/getAuthenticatedExtendedCard'] = (
412+
'agent/getAuthenticatedExtendedCard'
413+
)
414+
"""
415+
The method name. Must be 'agent/getAuthenticatedExtendedCard'.
416+
"""
417+
418+
378419
class GetTaskPushNotificationConfigParams(A2ABaseModel):
379420
"""
380421
Defines parameters for fetching a specific push notification configuration for a task.
@@ -999,6 +1040,7 @@ class A2AError(
9991040
| UnsupportedOperationError
10001041
| ContentTypeNotSupportedError
10011042
| InvalidAgentResponseError
1043+
| AuthenticatedExtendedCardNotConfiguredError
10021044
]
10031045
):
10041046
root: (
@@ -1013,6 +1055,7 @@ class A2AError(
10131055
| UnsupportedOperationError
10141056
| ContentTypeNotSupportedError
10151057
| InvalidAgentResponseError
1058+
| AuthenticatedExtendedCardNotConfiguredError
10161059
)
10171060
"""
10181061
A discriminated union of all standard JSON-RPC and A2A-specific error types.
@@ -1170,6 +1213,7 @@ class JSONRPCErrorResponse(A2ABaseModel):
11701213
| UnsupportedOperationError
11711214
| ContentTypeNotSupportedError
11721215
| InvalidAgentResponseError
1216+
| AuthenticatedExtendedCardNotConfiguredError
11731217
)
11741218
"""
11751219
An object describing the error that occurred.
@@ -1625,6 +1669,7 @@ class A2ARequest(
16251669
| TaskResubscriptionRequest
16261670
| ListTaskPushNotificationConfigRequest
16271671
| DeleteTaskPushNotificationConfigRequest
1672+
| GetAuthenticatedExtendedCardRequest
16281673
]
16291674
):
16301675
root: (
@@ -1637,6 +1682,7 @@ class A2ARequest(
16371682
| TaskResubscriptionRequest
16381683
| ListTaskPushNotificationConfigRequest
16391684
| DeleteTaskPushNotificationConfigRequest
1685+
| GetAuthenticatedExtendedCardRequest
16401686
)
16411687
"""
16421688
A discriminated union representing all possible JSON-RPC 2.0 requests supported by the A2A specification.
@@ -1750,6 +1796,25 @@ class AgentCard(A2ABaseModel):
17501796
"""
17511797

17521798

1799+
class GetAuthenticatedExtendedCardSuccessResponse(A2ABaseModel):
1800+
"""
1801+
Represents a successful JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
1802+
"""
1803+
1804+
id: str | int | None = None
1805+
"""
1806+
The identifier established by the client.
1807+
"""
1808+
jsonrpc: Literal['2.0'] = '2.0'
1809+
"""
1810+
The version of the JSON-RPC protocol. MUST be exactly "2.0".
1811+
"""
1812+
result: AgentCard
1813+
"""
1814+
The result is an Agent Card object.
1815+
"""
1816+
1817+
17531818
class Task(A2ABaseModel):
17541819
"""
17551820
Represents a single, stateful operation or conversation between a client and an agent.
@@ -1769,7 +1834,7 @@ class Task(A2ABaseModel):
17691834
"""
17701835
id: str
17711836
"""
1772-
A unique identifier for the task, generated by the client for a new task or provided by the agent.
1837+
A unique identifier for the task, generated by the server for a new task.
17731838
"""
17741839
kind: Literal['task'] = 'task'
17751840
"""
@@ -1804,6 +1869,17 @@ class CancelTaskSuccessResponse(A2ABaseModel):
18041869
"""
18051870

18061871

1872+
class GetAuthenticatedExtendedCardResponse(
1873+
RootModel[
1874+
JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse
1875+
]
1876+
):
1877+
root: JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse
1878+
"""
1879+
Represents a JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
1880+
"""
1881+
1882+
18071883
class GetTaskSuccessResponse(A2ABaseModel):
18081884
"""
18091885
Represents a successful JSON-RPC response for the `tasks/get` method.
@@ -1889,6 +1965,7 @@ class JSONRPCResponse(
18891965
| GetTaskPushNotificationConfigSuccessResponse
18901966
| ListTaskPushNotificationConfigSuccessResponse
18911967
| DeleteTaskPushNotificationConfigSuccessResponse
1968+
| GetAuthenticatedExtendedCardSuccessResponse
18921969
]
18931970
):
18941971
root: (
@@ -1901,6 +1978,7 @@ class JSONRPCResponse(
19011978
| GetTaskPushNotificationConfigSuccessResponse
19021979
| ListTaskPushNotificationConfigSuccessResponse
19031980
| DeleteTaskPushNotificationConfigSuccessResponse
1981+
| GetAuthenticatedExtendedCardSuccessResponse
19041982
)
19051983
"""
19061984
A discriminated union representing all possible JSON-RPC 2.0 responses

0 commit comments

Comments
 (0)