pub enum PromptStrategy {
Prompt,
HeadlessDeny,
AllowAll,
AcceptEdits,
}Expand description
How PermissionExtension resolves a tool call that steps 1-3 of
decide() left unanswered.
Tag-only enum (v0.10): no longer carries ui_tx inline. The
extension holds ui_tx: Option<mpsc::Sender<UiEvent>> separately;
the strategy tells decide() what to DO with that sender (or whether
to short-circuit).
Variants§
Prompt
Interactive: emit UiEvent::PermissionRequested, await user decision via the resolver oneshot.
HeadlessDeny
Non-interactive (--json without --dangerously-allow-all): deny anything that would prompt.
AllowAll
v0.10 bypass mode: skip the prompt, return Allowed (after hard-block + allowlist).
AcceptEdits
v0.10 accept-edits mode: auto-allow write/edit (after hard-block); bash falls through to Prompt or HeadlessDeny depending on whether ui_tx is Some.
Trait Implementations§
Source§impl Clone for PromptStrategy
impl Clone for PromptStrategy
Source§fn clone(&self) -> PromptStrategy
fn clone(&self) -> PromptStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptStrategy
impl Debug for PromptStrategy
Source§impl PartialEq for PromptStrategy
impl PartialEq for PromptStrategy
Source§fn eq(&self, other: &PromptStrategy) -> bool
fn eq(&self, other: &PromptStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PromptStrategy
impl Eq for PromptStrategy
impl StructuralPartialEq for PromptStrategy
Auto Trait Implementations§
impl Freeze for PromptStrategy
impl RefUnwindSafe for PromptStrategy
impl Send for PromptStrategy
impl Sync for PromptStrategy
impl Unpin for PromptStrategy
impl UnsafeUnpin for PromptStrategy
impl UnwindSafe for PromptStrategy
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
Mutably borrows from an owned value. Read more
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.