flags.rs

  1use crate::{EnumFeatureFlag, FeatureFlag, PresenceFlag, register_feature_flag};
  2
  3pub struct NotebookFeatureFlag;
  4
  5impl FeatureFlag for NotebookFeatureFlag {
  6    const NAME: &'static str = "notebooks";
  7    type Value = PresenceFlag;
  8}
  9register_feature_flag!(NotebookFeatureFlag);
 10
 11pub struct PanicFeatureFlag;
 12
 13impl FeatureFlag for PanicFeatureFlag {
 14    const NAME: &'static str = "panic";
 15    type Value = PresenceFlag;
 16}
 17register_feature_flag!(PanicFeatureFlag);
 18
 19pub struct AgentV2FeatureFlag;
 20
 21impl FeatureFlag for AgentV2FeatureFlag {
 22    const NAME: &'static str = "agent-v2";
 23    type Value = PresenceFlag;
 24
 25    fn enabled_for_staff() -> bool {
 26        true
 27    }
 28}
 29register_feature_flag!(AgentV2FeatureFlag);
 30
 31/// A feature flag for granting access to beta ACP features.
 32///
 33/// We reuse this feature flag for new betas, so don't delete it if it is not currently in use.
 34pub struct AcpBetaFeatureFlag;
 35
 36impl FeatureFlag for AcpBetaFeatureFlag {
 37    const NAME: &'static str = "acp-beta";
 38    type Value = PresenceFlag;
 39}
 40register_feature_flag!(AcpBetaFeatureFlag);
 41
 42pub struct AgentSharingFeatureFlag;
 43
 44impl FeatureFlag for AgentSharingFeatureFlag {
 45    const NAME: &'static str = "agent-sharing";
 46    type Value = PresenceFlag;
 47}
 48register_feature_flag!(AgentSharingFeatureFlag);
 49
 50pub struct DiffReviewFeatureFlag;
 51
 52impl FeatureFlag for DiffReviewFeatureFlag {
 53    const NAME: &'static str = "diff-review";
 54    type Value = PresenceFlag;
 55
 56    fn enabled_for_staff() -> bool {
 57        false
 58    }
 59}
 60register_feature_flag!(DiffReviewFeatureFlag);
 61
 62pub struct StreamingEditFileToolFeatureFlag;
 63
 64impl FeatureFlag for StreamingEditFileToolFeatureFlag {
 65    const NAME: &'static str = "streaming-edit-file-tool";
 66    type Value = PresenceFlag;
 67
 68    fn enabled_for_staff() -> bool {
 69        true
 70    }
 71}
 72register_feature_flag!(StreamingEditFileToolFeatureFlag);
 73
 74pub struct UpdatePlanToolFeatureFlag;
 75
 76impl FeatureFlag for UpdatePlanToolFeatureFlag {
 77    const NAME: &'static str = "update-plan-tool";
 78    type Value = PresenceFlag;
 79
 80    fn enabled_for_staff() -> bool {
 81        false
 82    }
 83}
 84register_feature_flag!(UpdatePlanToolFeatureFlag);
 85
 86pub struct ProjectPanelUndoRedoFeatureFlag;
 87
 88impl FeatureFlag for ProjectPanelUndoRedoFeatureFlag {
 89    const NAME: &'static str = "project-panel-undo-redo";
 90    type Value = PresenceFlag;
 91
 92    fn enabled_for_staff() -> bool {
 93        true
 94    }
 95}
 96register_feature_flag!(ProjectPanelUndoRedoFeatureFlag);
 97
 98/// Controls how agent thread worktree chips are labeled in the sidebar.
 99#[derive(Clone, Copy, PartialEq, Eq, Debug, EnumFeatureFlag)]
100pub enum AgentThreadWorktreeLabel {
101    #[default]
102    Both,
103    Worktree,
104    Branch,
105}
106
107pub struct AgentThreadWorktreeLabelFlag;
108
109impl FeatureFlag for AgentThreadWorktreeLabelFlag {
110    const NAME: &'static str = "agent-thread-worktree-label";
111    type Value = AgentThreadWorktreeLabel;
112
113    fn enabled_for_staff() -> bool {
114        false
115    }
116}
117register_feature_flag!(AgentThreadWorktreeLabelFlag);