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
//! Domain model for persisted application setting keys.
use std::fmt;
/// Stable keys used in the `setting` and `project_setting` tables.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum SettingName {
/// Persists the active project selection.
ActiveProjectId,
/// Persists the active list tab selection.
ActiveTab,
/// Persists the provider that owns the fast-model default.
DefaultFastAgent,
/// Persists the project or global fast-model selection.
DefaultFastModel,
/// Persists the reasoning level paired with the fast-model default.
DefaultFastReasoningLevel,
/// Persists the response speed paired with the fast-model default.
DefaultFastSpeedMode,
/// Persists the provider that owns the review-model default.
DefaultReviewAgent,
/// Persists the project or global review-model selection.
DefaultReviewModel,
/// Persists the reasoning level paired with the review-model default.
DefaultReviewReasoningLevel,
/// Persists the response speed paired with the review-model default.
DefaultReviewSpeedMode,
/// Persists the default response style for newly created sessions.
DefaultResponseStyle,
/// Persists the provider that owns the smart-model default.
DefaultSmartAgent,
/// Persists the project or global smart-model selection.
DefaultSmartModel,
/// Persists the reasoning level paired with the smart-model default.
DefaultSmartReasoningLevel,
/// Persists the response speed paired with the smart-model default.
DefaultSmartSpeedMode,
/// Persists whether generated session commits append the Agentty coauthor
/// trailer.
IncludeCoauthoredByAgentty,
/// Persists the configured launch-configuration override.
LaunchConfiguration,
/// Persists whether the last used model should become the default.
LastUsedModelAsDefault,
/// Distinguishes registered projects from non-repository launch contexts.
ProjectCatalogVisible,
/// Records dismissal of the one-time project discovery suggestion.
ProjectDiscoveryPromptSeen,
/// Persists the random installation ID attached to telemetry events.
TelemetryInstallationId,
/// Persists the active terminal color theme.
Theme,
}
impl SettingName {
/// Returns the persisted key string for one setting.
pub fn as_str(self) -> &'static str {
match self {
Self::ActiveProjectId => "ActiveProjectId",
Self::ActiveTab => "ActiveTab",
Self::DefaultFastAgent => "DefaultFastAgent",
Self::DefaultFastModel => "DefaultFastModel",
Self::DefaultFastReasoningLevel => "DefaultFastReasoningLevel",
Self::DefaultFastSpeedMode => "DefaultFastSpeedMode",
Self::DefaultReviewAgent => "DefaultReviewAgent",
Self::DefaultReviewModel => "DefaultReviewModel",
Self::DefaultReviewReasoningLevel => "DefaultReviewReasoningLevel",
Self::DefaultReviewSpeedMode => "DefaultReviewSpeedMode",
Self::DefaultResponseStyle => "DefaultResponseStyle",
Self::DefaultSmartAgent => "DefaultSmartAgent",
Self::DefaultSmartModel => "DefaultSmartModel",
Self::DefaultSmartReasoningLevel => "DefaultSmartReasoningLevel",
Self::DefaultSmartSpeedMode => "DefaultSmartSpeedMode",
Self::IncludeCoauthoredByAgentty => "IncludeCoauthoredByAgentty",
Self::LaunchConfiguration => "LaunchConfiguration",
Self::LastUsedModelAsDefault => "LastUsedModelAsDefault",
Self::ProjectCatalogVisible => "ProjectCatalogVisible",
Self::ProjectDiscoveryPromptSeen => "ProjectDiscoveryPromptSeen",
Self::TelemetryInstallationId => "TelemetryInstallationId",
Self::Theme => "Theme",
}
}
}
impl fmt::Display for SettingName {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(self.as_str())
}
}
#[cfg(test)]
#[path = "setting_test.rs"]
mod tests;