Skip to main content

nils_common/provider_runtime/
profile.rs

1use std::sync::atomic::AtomicBool;
2
3#[derive(Debug, Clone, Copy)]
4pub struct ProviderProfile {
5    pub provider_name: &'static str,
6    pub env: ProviderEnvKeys,
7    pub defaults: ProviderDefaults,
8    pub paths: PathsProfile,
9    pub exec: ExecProfile,
10}
11
12#[derive(Debug, Clone, Copy)]
13pub struct ProviderEnvKeys {
14    pub model: &'static str,
15    pub reasoning: &'static str,
16    pub allow_dangerous_enabled: &'static str,
17    pub secret_dir: &'static str,
18    pub auth_file: &'static str,
19    pub secret_cache_dir: &'static str,
20    pub starship_enabled: &'static str,
21    pub auto_refresh_enabled: &'static str,
22    pub auto_refresh_min_days: &'static str,
23}
24
25#[derive(Debug, Clone, Copy)]
26pub struct ProviderDefaults {
27    pub model: &'static str,
28    pub reasoning: &'static str,
29    pub starship_enabled: &'static str,
30    pub auto_refresh_enabled: &'static str,
31    pub auto_refresh_min_days: &'static str,
32}
33
34#[derive(Debug, Clone, Copy)]
35pub struct PathsProfile {
36    pub feature_name: &'static str,
37    pub feature_tool_script: &'static str,
38    pub secret_dir_home: HomePathSelection,
39    pub auth_file_home: HomePathSelection,
40    pub secret_cache_home: Option<&'static [&'static str]>,
41}
42
43#[derive(Debug, Clone, Copy)]
44pub enum HomePathSelection {
45    ModernOnly(&'static [&'static str]),
46}
47
48#[derive(Debug, Clone, Copy)]
49pub struct ExecProfile {
50    pub default_caller_prefix: &'static str,
51    pub missing_prompt_label: &'static str,
52    pub binary_name: &'static str,
53    pub failed_exec_message_prefix: &'static str,
54    pub invocation: ExecInvocation,
55    pub warned_invalid_allow_dangerous: &'static AtomicBool,
56}
57
58#[derive(Debug, Clone, Copy)]
59pub enum ExecInvocation {
60    CodexStyle,
61    GeminiStyle,
62}