Expand description
Cross-platform permission preflight for Common Agent Runtime.
Unifies macOS TCC, Windows privacy/consent APIs, and Linux
xdg-desktop-portal / polkit / filesystem-permissions semantics under
one surface:
status— current grant staterequest— trigger a native prompt if the OS supports oneexplain— human-readable diagnostic + the user-visible fixdomains— whichDomains are meaningful on the current OS
§Honest modeling
A domain that doesn’t exist on the current OS returns
PermissionStatus::NotApplicable — NOT Denied. Callers should branch
on NotApplicable and skip, rather than treating it as failure.
§No private APIs
Backends use only public, documented interfaces. On macOS that means
querying TCC through Apple’s public Security/AppKit paths (or returning
NotDetermined when only private access would give better data).
Structs§
- Context
- Context modifiers for a status/request/explain call. Most domains
ignore all fields;
Automationon macOS requirestarget_bundle_id. - Permission
Explanation - Per-domain diagnostic + user-visible fix hint.
#[non_exhaustive].
Enums§
- Domain
- Capability domains. A domain may be
NotApplicableon some OSes — the enum is the union across all supported platforms. - Permission
Error - Permission
Status - Permission state.
#[non_exhaustive]— future variants are additive.
Functions§
- domains
- All domains defined by this crate. Callers can filter to the ones that
are meaningful on the current OS by checking
status() != NotApplicable. - explain
- Human-readable explanation + fix suggestion.
- explain_
with - request
- Trigger a native prompt (where the OS supports one). Returns the new status after the user responds, or the current status if no prompt was shown.
- request_
with - status
- Current status of a single domain.
- status_
with - Status with per-domain context — see
Context.