pub enum HookDecision {
Pass,
Allow,
Ask,
Deny,
}Expand description
BP-10 (catalog row “Hook/plugin permission veto”, semantics “Programmatic allow/deny/rewrite before the user sees it”): what a pre-tool hook decided about one call.
The three non-Pass values are TIERS OF THE ONE PERMISSIONS ENGINE, not
a second gate beside it — crate::agent::Agent’s
permissions_gate_denial_impl folds this in and the engine’s own
deny→ask→allow priority decides. In particular Self::Allow answers
an Ask on the user’s behalf (CC’s PermissionRequest-class reply) but
can never override a deny rule: a hard floor stays a hard floor.
Variants§
Pass
The hook expressed no opinion — the engine decides alone. The default, and what a silent (exit-0, no output) hook means.
Allow
Answer an Ask on the user’s behalf: the call proceeds WITHOUT a
prompt, unless a deny rule (or a protected path) already refused
it, in which case the refusal stands.
Ask
Force the call to the Ask tier even if the rules would have
allowed it — “let the user see this one”.
Deny
Refuse the call outright.
Trait Implementations§
Source§impl Clone for HookDecision
impl Clone for HookDecision
Source§fn clone(&self) -> HookDecision
fn clone(&self) -> HookDecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HookDecision
Source§impl Debug for HookDecision
impl Debug for HookDecision
Source§impl Default for HookDecision
impl Default for HookDecision
Source§fn default() -> HookDecision
fn default() -> HookDecision
impl Eq for HookDecision
Source§impl PartialEq for HookDecision
impl PartialEq for HookDecision
impl StructuralPartialEq for HookDecision
Auto Trait Implementations§
impl Freeze for HookDecision
impl RefUnwindSafe for HookDecision
impl Send for HookDecision
impl Sync for HookDecision
impl Unpin for HookDecision
impl UnsafeUnpin for HookDecision
impl UnwindSafe for HookDecision
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.