pub struct PermissionDecision {
inner: DecisionKind,
}Expand description
The decision a callback returns.
Wraps the CLI’s PermissionResultAllow / PermissionResultDeny as a
single enum with constructor helpers.
Fields§
§inner: DecisionKindImplementations§
Source§impl PermissionDecision
impl PermissionDecision
Sourcepub fn allow_with_input(updated_input: Value) -> Self
pub fn allow_with_input(updated_input: Value) -> Self
Approve the tool call with a modified input payload. The claude
binary will receive the modified input in place of the model’s
original.
Sourcepub fn deny(reason: impl Into<String>) -> Self
pub fn deny(reason: impl Into<String>) -> Self
Deny the tool call. reason is forwarded to the model as feedback.
Sourcepub fn with_updated_permissions(self, updates: Vec<PermissionUpdate>) -> Self
pub fn with_updated_permissions(self, updates: Vec<PermissionUpdate>) -> Self
Attach a list of PermissionUpdates to an allow decision. These
are forwarded to the claude binary as updatedPermissions on the
wire and applied to the session’s permission state. No-op on a
deny decision - the CLI’s PermissionResultDeny has no equivalent
channel.
Sourcepub fn updated_input(&self) -> Option<&Value>
pub fn updated_input(&self) -> Option<&Value>
For an allow decision with modified input, returns the modified input.
Sourcepub fn updated_permissions(&self) -> &[PermissionUpdate]
pub fn updated_permissions(&self) -> &[PermissionUpdate]
Permission updates attached to an allow decision. Empty slice for deny, or for an allow that carries no updates.