Skip to content

ccproxy.api.ui.permission_handler_protocol

ccproxy.api.ui.permission_handler_protocol

Protocol definition for confirmation handlers.

ConfirmationHandlerProtocol

Bases: Protocol

Protocol for confirmation request handlers.

This protocol defines the interface that all confirmation handlers must implement to be compatible with the CLI confirmation system.

handle_permission async

handle_permission(request)

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/permission_handler_protocol.py
async def handle_permission(self, request: PermissionRequest) -> bool:
    """Handle a permission request.

    Args:
        request: The permission request to handle

    Returns:
        bool: True if the user confirmed, False otherwise
    """
    ...

cancel_confirmation

cancel_confirmation(request_id, reason='cancelled')

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/permission_handler_protocol.py
def cancel_confirmation(self, request_id: str, reason: str = "cancelled") -> None:
    """Cancel an ongoing confirmation request.

    Args:
        request_id: The ID of the request to cancel
        reason: The reason for cancellation
    """
    ...