Expand description
Permission normalization and relay for the uniform per-command approval (“ask”) mode.
Each backend CLI that supports interactive, per-command approval exposes the
approval handshake over a different JSON wire format. This module translates
those native frames into a single normalized permission_request event and
translates a normalized decision (once | always | reject) back into the
native response frame that the CLI expects on its stdin.
Only tools with a drivable JSON request/response permission protocol can be
relayed (see ASK_SUPPORTED_TOOLS). Tools whose only native approval
mechanism is a static policy (opencode), a sandbox coupling (codex), or a
non-streaming approval flag (qwen, gemini) are documented in the parity
table but fail clearly when ask mode is requested — mirroring the
--read-only unsupported-tool pattern.
This is the Rust mirror of js/src/permissions/.
Structs§
- Normalized
Permission Request - A normalized permission request, uniform across every relayable backend.
- Permission
Parity Row - A single row of the per-command approval parity table.
- Permission
Relay - Relay native permission requests to a consumer and forward decisions back.
Constants§
- ASK_
DECISIONS - Normalized decisions a consumer may return for a permission request.
- ASK_
SUPPORTED_ TOOLS - Tools that expose a relayable per-command approval protocol over JSON.
Functions§
- ask_
scope - Scope of an
alwaysdecision for each backend. The reviewer (m13v) flagged that “always” does not mean the same thing across CLIs, so the normalized event and the parity table both carry this scope. - ask_
unsupported_ error - Build the standard error for tools without a relayable per-command approval
mechanism (ask mode). Mirrors
crate::command_builder::read_only_unsupported_error. - build_
permission_ response - Build the native response frame for a normalized decision.
- normalize_
permission_ request - Normalize a native permission request frame into a uniform event.
- permission_
parity - Parity description for each tool’s native per-command approval mechanism.
- supports_
ask - Whether agent-commander can relay per-command approvals for the given tool.