pub struct PolicyMode {
pub id: String,
pub name: String,
pub description: Option<String>,
pub policy: Arc<dyn SandboxPolicy>,
}Expand description
A permission mode entry that can be selected by an ACP client.
defect-agent does not know about the higher-level SandboxMode (that is a
defect-config concept; this crate is a dependency base of it and cannot have a
reverse dependency). The assembler (CLI) provides each
crate::policy::SandboxPolicy together with a stable id, a display name, and a
description; this crate only performs “look up by id and swap the active policy” on
opaque entries, corresponding one-to-one with the SessionMode in ACP
session/set_mode.
Fields§
§id: StringStable identifier — the mode_id on the ACP wire. Convention is kebab-case (e.g.
ask-writes), aligned with SandboxMode::as_str().
name: StringA human-readable name for display to clients.
description: Option<String>Optional description, shown in the client UI.
policy: Arc<dyn SandboxPolicy>The decision policy for this mode. When set_mode matches this entry, the policy
is swapped in entirely.
Trait Implementations§
Source§impl Clone for PolicyMode
impl Clone for PolicyMode
Source§fn clone(&self) -> PolicyMode
fn clone(&self) -> PolicyMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more