ccproxy.api.ui.terminal_permission_handler¶
ccproxy.api.ui.terminal_permission_handler
¶
Terminal UI handler for confirmation requests using Textual with request stacking support.
PendingRequest
dataclass
¶
Represents a pending confirmation request with its response future.
ConfirmationScreen
¶
Bases: ModalScreen[bool]
Modal screen for displaying a single confirmation request.
Source code in ccproxy/api/ui/terminal_permission_handler.py
compose
¶
Compose the confirmation dialog.
Source code in ccproxy/api/ui/terminal_permission_handler.py
on_mount
¶
update_countdown
¶
Update the countdown display.
Source code in ccproxy/api/ui/terminal_permission_handler.py
action_confirm
¶
action_deny
¶
action_cancel
¶
Cancel the request (Ctrl+C).
Source code in ccproxy/api/ui/terminal_permission_handler.py
ConfirmationApp
¶
Bases: App[bool]
Simple Textual app for a single confirmation request.
Source code in ccproxy/api/ui/terminal_permission_handler.py
compose
¶
Compose the confirmation dialog directly.
Source code in ccproxy/api/ui/terminal_permission_handler.py
on_mount
¶
update_countdown
¶
Update the countdown display.
Source code in ccproxy/api/ui/terminal_permission_handler.py
action_confirm
¶
action_deny
¶
action_cancel
¶
Cancel the request (Ctrl+C).
Source code in ccproxy/api/ui/terminal_permission_handler.py
on_key
async
¶
Handle global key events, especially Ctrl+C.
Source code in ccproxy/api/ui/terminal_permission_handler.py
TerminalPermissionHandler
¶
Handles confirmation requests in the terminal using Textual with request stacking.
Implements ConfirmationHandlerProtocol for type safety and interoperability.
Source code in ccproxy/api/ui/terminal_permission_handler.py
handle_permission
async
¶
Handle a permission request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
PermissionRequest
|
The permission request to handle |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the user confirmed, False otherwise |
Source code in ccproxy/api/ui/terminal_permission_handler.py
cancel_confirmation
¶
Cancel an ongoing confirmation request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_id
|
str
|
The ID of the request to cancel |
required |
reason
|
str
|
The reason for cancellation |
'cancelled'
|
Source code in ccproxy/api/ui/terminal_permission_handler.py
shutdown
async
¶
Shutdown the handler and cleanup resources.