permissions
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| CancelledPermissionOutcome aclientp.schema.v2.permissions No option was selected, e.g. because the session's work was cancelled. |
||
| CommandPermissionSubject aclientp.schema.v2.permissions Permission is requested before running a command. |
||
| PermissionOption aclientp.schema.v2.permissions An option offered to the user. |
||
| RequestPermissionRequest aclientp.schema.v2.permissions Parameters of ``session/request_permission``. |
||
| RequestPermissionResponse aclientp.schema.v2.permissions Response to ``session/request_permission``. |
||
| SelectedPermissionOutcome aclientp.schema.v2.permissions The user selected one of the offered options. |
||
| ToolCallPermissionSubject aclientp.schema.v2.permissions Permission is requested before executing a tool call. |
||
| UnknownPermissionOutcome aclientp.schema.v2.permissions A custom or future outcome; values starting with ``_`` are extensions. |
||
| UnknownPermissionSubject aclientp.schema.v2.permissions A custom or future subject; ``type`` values starting with ``_`` are extensions. |
🛈 DocStrings¶
v2 session/request_permission: asking the user before a sensitive operation.
v2 permission requests carry a required title and an optional subject: a tool
call (with the same payload as a tool_call_update) or a command.
PermissionOptionKind
module-attribute
¶
Nature of a permission option, for icons and UI. Values starting with _ are extensions.
RequestPermissionOutcome
module-attribute
¶
RequestPermissionOutcome = Annotated[
Annotated[CancelledPermissionOutcome, Tag("cancelled")]
| Annotated[SelectedPermissionOutcome, Tag("selected")]
| Annotated[UnknownPermissionOutcome, Tag(OTHER_TAG)],
Discriminator(open_discriminator("outcome", frozenset({"cancelled", "selected"}))),
]
The user's decision on a permission request.
RequestPermissionSubject
module-attribute
¶
RequestPermissionSubject = Annotated[
Annotated[ToolCallPermissionSubject, Tag("tool_call")]
| Annotated[CommandPermissionSubject, Tag("command")]
| Annotated[UnknownPermissionSubject, Tag(OTHER_TAG)],
Discriminator(open_discriminator("type", frozenset({"tool_call", "command"}))),
]
The operation that requires permission.
CancelledPermissionOutcome
¶
Bases: AnnotatedObject
No option was selected, e.g. because the session's work was cancelled.
Source code in src/aclientp/schema/v2/permissions.py
CommandPermissionSubject
¶
Bases: AnnotatedObject
Permission is requested before running a command.
Source code in src/aclientp/schema/v2/permissions.py
terminal_id
class-attribute
instance-attribute
¶
terminal_id: TerminalId | MISSING | None = MISSING
The associated terminal, when already known.
tool_call_id
class-attribute
instance-attribute
¶
tool_call_id: ToolCallId | MISSING | None = MISSING
The associated tool call, when known.
PermissionOption
¶
Bases: AnnotatedObject
An option offered to the user.
Source code in src/aclientp/schema/v2/permissions.py
option_id
instance-attribute
¶
option_id: PermissionOptionId
Identifier of the option; unique within the request.
RequestPermissionRequest
¶
Bases: AnnotatedObject
Parameters of session/request_permission.
Source code in src/aclientp/schema/v2/permissions.py
description
class-attribute
instance-attribute
¶
Why permission is needed.
options
class-attribute
instance-attribute
¶
options: Sequence[PermissionOption] = Field(min_length=1)
The options the user can choose from; at least one.
subject
class-attribute
instance-attribute
¶
subject: RequestPermissionSubject | MISSING | None = MISSING
Structured context about the operation.
title
instance-attribute
¶
Title of the permission prompt (not the title of a tool call).
RequestPermissionResponse
¶
Bases: AnnotatedObject
Response to session/request_permission.
Source code in src/aclientp/schema/v2/permissions.py
SelectedPermissionOutcome
¶
Bases: AnnotatedObject
The user selected one of the offered options.
An option_id that matches no offered option counts as rejection.
Source code in src/aclientp/schema/v2/permissions.py
ToolCallPermissionSubject
¶
Bases: AnnotatedObject
Permission is requested before executing a tool call.
Source code in src/aclientp/schema/v2/permissions.py
tool_call
instance-attribute
¶
tool_call: ToolCallUpdate
The tool call; clients apply it to their stored tool call like a tool_call_update.
UnknownPermissionOutcome
¶
Bases: Unknown
A custom or future outcome; values starting with _ are extensions.