Expand description
ACP Sprint-1 permission bridge.
Defines PermissionOutcome, PermissionDecision, and
a complete permission flow connecting the ACP session/request_permission
notification/response protocol to the agent’s PermissionHook.
§Architecture
- When a tool call requires permission,
AcpPermissionHook::checksends asession/request_permissionJSON-RPC notification to the client withpermission_id,tool_name, and argument details. - The client receives the notification (as a
session/updatewithsessionUpdate: "request_permission") and sends back asession/request_permissionJSON-RPC request with the outcome. - The ACP server’s dispatch loop routes this to
handle_request_permissionwhich resolves the pending oneshot channel. AcpPermissionHook::checkreceives the outcome and returnsAlloworDeny.- A 30-second timeout defaults to
Deny.
Structs§
- AcpPermission
Hook - A
PermissionHookthat communicates permission requests to the ACP client. - Pending
Permission Store - Thread-safe store of pending permission requests, keyed by permission ID.
Enums§
- Permission
Outcome - The outcome of a client permission decision.
Functions§
- handle_
request_ permission - Handle a
session/request_permissionrequest from the client. - translate
- Translate a
PermissionOutcometoPermissionDecision.