-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Expand file tree
/
Copy pathflags.rs
More file actions
125 lines (98 loc) · 3.22 KB
/
Copy pathflags.rs
File metadata and controls
125 lines (98 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
use crate::{EnumFeatureFlag, FeatureFlag, PresenceFlag, register_feature_flag};
pub struct NotebookFeatureFlag;
impl FeatureFlag for NotebookFeatureFlag {
const NAME: &'static str = "notebooks";
type Value = PresenceFlag;
fn enabled_for_all() -> bool {
true
}
}
register_feature_flag!(NotebookFeatureFlag);
pub struct PanicFeatureFlag;
impl FeatureFlag for PanicFeatureFlag {
const NAME: &'static str = "panic";
type Value = PresenceFlag;
}
register_feature_flag!(PanicFeatureFlag);
/// A feature flag for granting access to beta ACP features.
///
/// We reuse this feature flag for new betas, so don't delete it if it is not currently in use.
pub struct AcpBetaFeatureFlag;
impl FeatureFlag for AcpBetaFeatureFlag {
const NAME: &'static str = "acp-beta";
type Value = PresenceFlag;
}
register_feature_flag!(AcpBetaFeatureFlag);
pub struct DiffReviewFeatureFlag;
impl FeatureFlag for DiffReviewFeatureFlag {
const NAME: &'static str = "diff-review";
type Value = PresenceFlag;
fn enabled_for_staff() -> bool {
false
}
}
register_feature_flag!(DiffReviewFeatureFlag);
/// Gates the `create_thread` and `list_agents_and_models` tools, which let
/// the agent spawn independent sibling threads that show up in the agent
/// panel sidebar.
pub struct CreateThreadToolFeatureFlag;
impl FeatureFlag for CreateThreadToolFeatureFlag {
const NAME: &'static str = "create-thread-tool";
type Value = PresenceFlag;
fn enabled_for_staff() -> bool {
true
}
}
register_feature_flag!(CreateThreadToolFeatureFlag);
pub struct LspToolFeatureFlag;
impl FeatureFlag for LspToolFeatureFlag {
const NAME: &'static str = "lsp-tool";
type Value = PresenceFlag;
fn enabled_for_staff() -> bool {
false
}
}
register_feature_flag!(LspToolFeatureFlag);
pub struct RenameToolFeatureFlag;
impl FeatureFlag for RenameToolFeatureFlag {
const NAME: &'static str = "rename-tool";
type Value = PresenceFlag;
fn enabled_for_staff() -> bool {
true
}
}
register_feature_flag!(RenameToolFeatureFlag);
/// Controls how agent thread worktree chips are labeled in the sidebar.
#[derive(Clone, Copy, PartialEq, Eq, Debug, EnumFeatureFlag)]
pub enum AgentThreadWorktreeLabel {
#[default]
Both,
Worktree,
Branch,
}
pub struct AgentThreadWorktreeLabelFlag;
impl FeatureFlag for AgentThreadWorktreeLabelFlag {
const NAME: &'static str = "agent-thread-worktree-label";
type Value = AgentThreadWorktreeLabel;
fn enabled_for_staff() -> bool {
false
}
}
register_feature_flag!(AgentThreadWorktreeLabelFlag);
/// Wraps agent-run terminal commands in an OS-level sandbox where supported,
/// and applies the shared per-host network grants to the `fetch` tool and the
/// out-of-project write grants to the `create_directory` tool. When off,
/// these tools run with the agent's full ambient permissions, as they always
/// have.
pub struct SandboxingFeatureFlag;
impl FeatureFlag for SandboxingFeatureFlag {
const NAME: &'static str = "sandboxing";
type Value = PresenceFlag;
fn enabled_for_all() -> bool {
true
}
fn enabled_for_staff() -> bool {
false
}
}
register_feature_flag!(SandboxingFeatureFlag);