Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 79 additions & 1 deletion src/a2a/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,26 @@ class AgentSkill(A2ABaseModel):
"""


class AuthenticatedExtendedCardNotConfiguredError(A2ABaseModel):
"""
An A2A-specific error indicating that the agent does not have an Authenticated Extended Card configured
"""

code: Literal[-32007] = -32007
"""
The error code for when an authenticated extended card is not configured.
"""
data: Any | None = None
"""
A primitive or structured value containing additional information about the error.
This may be omitted.
"""
message: str | None = 'Authenticated Extended Card is not configured'
"""
The error message.
"""
Comment thread
kthota-g marked this conversation as resolved.


class AuthorizationCodeOAuthFlow(A2ABaseModel):
"""
Defines configuration details for the OAuth 2.0 Authorization Code flow.
Expand Down Expand Up @@ -375,6 +395,27 @@ class FileWithUri(A2ABaseModel):
"""


class GetAuthenticatedExtendedCardRequest(A2ABaseModel):
"""
Represents a JSON-RPC request for the `agent/getAuthenticatedExtendedCard` method.
"""

id: str | int
"""
The identifier for this request.
"""
jsonrpc: Literal['2.0'] = '2.0'
"""
The version of the JSON-RPC protocol. MUST be exactly "2.0".
"""
method: Literal['agent/getAuthenticatedExtendedCard'] = (
'agent/getAuthenticatedExtendedCard'
)
"""
The method name. Must be 'agent/getAuthenticatedExtendedCard'.
"""


class GetTaskPushNotificationConfigParams(A2ABaseModel):
"""
Defines parameters for fetching a specific push notification configuration for a task.
Expand Down Expand Up @@ -999,6 +1040,7 @@ class A2AError(
| UnsupportedOperationError
| ContentTypeNotSupportedError
| InvalidAgentResponseError
| AuthenticatedExtendedCardNotConfiguredError
]
):
root: (
Expand All @@ -1013,6 +1055,7 @@ class A2AError(
| UnsupportedOperationError
| ContentTypeNotSupportedError
| InvalidAgentResponseError
| AuthenticatedExtendedCardNotConfiguredError
)
"""
A discriminated union of all standard JSON-RPC and A2A-specific error types.
Expand Down Expand Up @@ -1170,6 +1213,7 @@ class JSONRPCErrorResponse(A2ABaseModel):
| UnsupportedOperationError
| ContentTypeNotSupportedError
| InvalidAgentResponseError
| AuthenticatedExtendedCardNotConfiguredError
)
"""
An object describing the error that occurred.
Expand Down Expand Up @@ -1625,6 +1669,7 @@ class A2ARequest(
| TaskResubscriptionRequest
| ListTaskPushNotificationConfigRequest
| DeleteTaskPushNotificationConfigRequest
| GetAuthenticatedExtendedCardRequest
]
):
root: (
Expand All @@ -1637,6 +1682,7 @@ class A2ARequest(
| TaskResubscriptionRequest
| ListTaskPushNotificationConfigRequest
| DeleteTaskPushNotificationConfigRequest
| GetAuthenticatedExtendedCardRequest
)
"""
A discriminated union representing all possible JSON-RPC 2.0 requests supported by the A2A specification.
Expand Down Expand Up @@ -1750,6 +1796,25 @@ class AgentCard(A2ABaseModel):
"""


class GetAuthenticatedExtendedCardSuccessResponse(A2ABaseModel):
"""
Represents a successful JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
"""

id: str | int | None = None
"""
The identifier established by the client.
"""
jsonrpc: Literal['2.0'] = '2.0'
"""
The version of the JSON-RPC protocol. MUST be exactly "2.0".
"""
result: AgentCard
"""
The result is an Agent Card object.
"""


class Task(A2ABaseModel):
"""
Represents a single, stateful operation or conversation between a client and an agent.
Expand All @@ -1769,7 +1834,7 @@ class Task(A2ABaseModel):
"""
id: str
"""
A unique identifier for the task, generated by the client for a new task or provided by the agent.
A unique identifier for the task, generated by the server for a new task.
"""
kind: Literal['task'] = 'task'
"""
Expand Down Expand Up @@ -1804,6 +1869,17 @@ class CancelTaskSuccessResponse(A2ABaseModel):
"""


class GetAuthenticatedExtendedCardResponse(
RootModel[
JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse
]
):
root: JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse
"""
Represents a JSON-RPC response for the `agent/getAuthenticatedExtendedCard` method.
"""


class GetTaskSuccessResponse(A2ABaseModel):
"""
Represents a successful JSON-RPC response for the `tasks/get` method.
Expand Down Expand Up @@ -1889,6 +1965,7 @@ class JSONRPCResponse(
| GetTaskPushNotificationConfigSuccessResponse
| ListTaskPushNotificationConfigSuccessResponse
| DeleteTaskPushNotificationConfigSuccessResponse
| GetAuthenticatedExtendedCardSuccessResponse
]
):
root: (
Expand All @@ -1901,6 +1978,7 @@ class JSONRPCResponse(
| GetTaskPushNotificationConfigSuccessResponse
| ListTaskPushNotificationConfigSuccessResponse
| DeleteTaskPushNotificationConfigSuccessResponse
| GetAuthenticatedExtendedCardSuccessResponse
)
"""
A discriminated union representing all possible JSON-RPC 2.0 responses
Expand Down
Loading