Skip to content

Commit 92d780e

Browse files
committed
feat!: Add method for fetching extended card
# Description This change adds support for a new JSON-RPC method `agent/getAuthenticatedExtendedCard` for fetching authenticated extended card. This is only applicable if `AgentCard.supportsAuthenticatedExtendedCard` bit is set to `true` that allows fetching authenticated context specific agent card. In the previous versions, the extended card was served via `{AgentCard.url}/../agent/authenticatedExtendedCard` endpoint. This endpoint is being removed in favor of the JSON-RPC method. This endpoint will be deprecated in the SDKs and will be removed in a future release. Release-As: 0.3.0
1 parent 0c91ec5 commit 92d780e

File tree

1 file changed

+80
-1
lines changed

1 file changed

+80
-1
lines changed

src/a2a/types.py

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

174174

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

377398

399+
class GetAuthenticatedExtendedCardRequest(A2ABaseModel):
400+
"""
401+
Represents a JSON-RPC request for the `agent/getAuthenticatedExtendedCard` method.
402+
"""
403+
404+
id: str | int
405+
"""
406+
The identifier for this request.
407+
"""
408+
jsonrpc: Literal['2.0'] = '2.0'
409+
"""
410+
The version of the JSON-RPC protocol. MUST be exactly "2.0".
411+
"""
412+
method: Literal['agent/getAuthenticatedExtendedCard'] = (
413+
'agent/getAuthenticatedExtendedCard'
414+
)
415+
"""
416+
The method name. Must be 'agent/getAuthenticatedExtendedCard'.
417+
"""
418+
419+
378420
class GetTaskPushNotificationConfigParams(A2ABaseModel):
379421
"""
380422
Defines parameters for fetching a specific push notification configuration for a task.
@@ -999,6 +1041,7 @@ class A2AError(
9991041
| UnsupportedOperationError
10001042
| ContentTypeNotSupportedError
10011043
| InvalidAgentResponseError
1044+
| AuthenticatedExtendedCardNotConfiguredError
10021045
]
10031046
):
10041047
root: (
@@ -1013,6 +1056,7 @@ class A2AError(
10131056
| UnsupportedOperationError
10141057
| ContentTypeNotSupportedError
10151058
| InvalidAgentResponseError
1059+
| AuthenticatedExtendedCardNotConfiguredError
10161060
)
10171061
"""
10181062
A discriminated union of all standard JSON-RPC and A2A-specific error types.
@@ -1170,6 +1214,7 @@ class JSONRPCErrorResponse(A2ABaseModel):
11701214
| UnsupportedOperationError
11711215
| ContentTypeNotSupportedError
11721216
| InvalidAgentResponseError
1217+
| AuthenticatedExtendedCardNotConfiguredError
11731218
)
11741219
"""
11751220
An object describing the error that occurred.
@@ -1625,6 +1670,7 @@ class A2ARequest(
16251670
| TaskResubscriptionRequest
16261671
| ListTaskPushNotificationConfigRequest
16271672
| DeleteTaskPushNotificationConfigRequest
1673+
| GetAuthenticatedExtendedCardRequest
16281674
]
16291675
):
16301676
root: (
@@ -1637,6 +1683,7 @@ class A2ARequest(
16371683
| TaskResubscriptionRequest
16381684
| ListTaskPushNotificationConfigRequest
16391685
| DeleteTaskPushNotificationConfigRequest
1686+
| GetAuthenticatedExtendedCardRequest
16401687
)
16411688
"""
16421689
A discriminated union representing all possible JSON-RPC 2.0 requests supported by the A2A specification.
@@ -1750,6 +1797,25 @@ class AgentCard(A2ABaseModel):
17501797
"""
17511798

17521799

1800+
class GetAuthenticatedExtendedCardSuccessResponse(A2ABaseModel):
1801+
"""
1802+
Represents a successful JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
1803+
"""
1804+
1805+
id: str | int | None = None
1806+
"""
1807+
The identifier established by the client.
1808+
"""
1809+
jsonrpc: Literal['2.0'] = '2.0'
1810+
"""
1811+
The version of the JSON-RPC protocol. MUST be exactly "2.0".
1812+
"""
1813+
result: AgentCard
1814+
"""
1815+
The result is an Agent Card object.
1816+
"""
1817+
1818+
17531819
class Task(A2ABaseModel):
17541820
"""
17551821
Represents a single, stateful operation or conversation between a client and an agent.
@@ -1769,7 +1835,7 @@ class Task(A2ABaseModel):
17691835
"""
17701836
id: str
17711837
"""
1772-
A unique identifier for the task, generated by the client for a new task or provided by the agent.
1838+
A unique identifier for the task, generated by the server for a new task.
17731839
"""
17741840
kind: Literal['task'] = 'task'
17751841
"""
@@ -1804,6 +1870,17 @@ class CancelTaskSuccessResponse(A2ABaseModel):
18041870
"""
18051871

18061872

1873+
class GetAuthenticatedExtendedCardResponse(
1874+
RootModel[
1875+
JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse
1876+
]
1877+
):
1878+
root: JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse
1879+
"""
1880+
Represents a JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
1881+
"""
1882+
1883+
18071884
class GetTaskSuccessResponse(A2ABaseModel):
18081885
"""
18091886
Represents a successful JSON-RPC response for the `tasks/get` method.
@@ -1889,6 +1966,7 @@ class JSONRPCResponse(
18891966
| GetTaskPushNotificationConfigSuccessResponse
18901967
| ListTaskPushNotificationConfigSuccessResponse
18911968
| DeleteTaskPushNotificationConfigSuccessResponse
1969+
| GetAuthenticatedExtendedCardSuccessResponse
18921970
]
18931971
):
18941972
root: (
@@ -1901,6 +1979,7 @@ class JSONRPCResponse(
19011979
| GetTaskPushNotificationConfigSuccessResponse
19021980
| ListTaskPushNotificationConfigSuccessResponse
19031981
| DeleteTaskPushNotificationConfigSuccessResponse
1982+
| GetAuthenticatedExtendedCardSuccessResponse
19041983
)
19051984
"""
19061985
A discriminated union representing all possible JSON-RPC 2.0 responses

0 commit comments

Comments
 (0)