#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CommandProviderId(pub String);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CommandMode {
Agent,
Plan,
Operate,
}
impl CommandMode {
#[must_use]
pub fn parse(value: &str) -> Option<Self> {
match value.trim().to_ascii_lowercase().as_str() {
"agent" | "act" | "work" | "auto" | "1" => Some(Self::Agent),
"plan" | "2" => Some(Self::Plan),
"operate" | "operation" | "ops" | "3" => Some(Self::Operate),
other if Self::is_legacy_bypass_alias(other) => Some(Self::Agent),
_ => None,
}
}
#[must_use]
pub fn is_legacy_bypass_alias(value: &str) -> bool {
matches!(
value.trim().to_ascii_lowercase().as_str(),
"yolo" | "4" | "bypass" | "bypass-permissions" | "bypasspermissions"
)
}
#[must_use]
pub fn display_name(self) -> &'static str {
match self {
Self::Agent => "Work",
Self::Plan => "Plan",
Self::Operate => "Operate",
}
}
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub enum CommandApprovalMode {
Auto,
Bypass,
#[default]
Suggest,
Never,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CommandCurrency {
Usd,
Cny,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CommandScreenMode {
Fullscreen,
Inline,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CommandWorkSurfacePlacement {
Bottom,
Top,
Left,
Right,
Off,
}
impl CommandWorkSurfacePlacement {
#[must_use]
pub const fn as_setting(self) -> &'static str {
match self {
Self::Bottom => "bottom",
Self::Top => "top",
Self::Left => "left",
Self::Right => "right",
Self::Off => "off",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CommandRailPanel {
Agents,
Tasks,
Background,
Terminal,
Files,
Notepad,
Context,
Git,
Price,
}