pub struct AgentCommandFile {
pub created_by: CommandAuthor,
pub source_agent: Option<String>,
pub created_at: Option<String>,
pub action: CustomActionConfig,
}Expand description
One command file on disk.
Fields§
§created_by: CommandAuthorWho authored this command. Absent deserializes as CommandAuthor::User.
source_agent: Option<String>The authoring agent, required when created_by == agent. Validated on
load; ignored (and pointless) for user commands.
created_at: Option<String>Creation timestamp (RFC 3339). Informational only.
action: CustomActionConfigThe wrapped action. Exactly one CustomActionConfig variant.
Implementations§
Source§impl AgentCommandFile
impl AgentCommandFile
Sourcepub fn is_script(&self) -> bool
pub fn is_script(&self) -> bool
Whether this is a script command (a shell_command action) — the only
kind subject to first-run confirmation (D4b).
Sourcepub fn body_hash(&self) -> String
pub fn body_hash(&self) -> String
SHA-256 over the canonical serialization of the action payload.
Any change to the action produces a new hash, resetting confirmation.
Sourcepub fn palette_label(&self) -> String
pub fn palette_label(&self) -> String
Palette label per the design: <title> · agent (<source_agent>) for
agent commands, plain <title> for user commands.
Trait Implementations§
Source§impl Clone for AgentCommandFile
impl Clone for AgentCommandFile
Source§impl Debug for AgentCommandFile
impl Debug for AgentCommandFile
Source§impl<'de> Deserialize<'de> for AgentCommandFile
impl<'de> Deserialize<'de> for AgentCommandFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AgentCommandFile
impl PartialEq for AgentCommandFile
Source§impl Serialize for AgentCommandFile
impl Serialize for AgentCommandFile
impl StructuralPartialEq for AgentCommandFile
Auto Trait Implementations§
impl Forget for AgentCommandFile
impl Freeze for AgentCommandFile
impl Move for AgentCommandFile
impl RefUnwindSafe for AgentCommandFile
impl Send for AgentCommandFile
impl Sync for AgentCommandFile
impl Unpin for AgentCommandFile
impl UnsafeUnpin for AgentCommandFile
impl UnwindSafe for AgentCommandFile
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