nils_common/provider_runtime/
profile.rs1use 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 PreferModernWhenPresentOrLegacyMissing {
47 modern: &'static [&'static str],
48 legacy: &'static [&'static str],
49 },
50}
51
52#[derive(Debug, Clone, Copy)]
53pub struct ExecProfile {
54 pub default_caller_prefix: &'static str,
55 pub missing_prompt_label: &'static str,
56 pub binary_name: &'static str,
57 pub failed_exec_message_prefix: &'static str,
58 pub invocation: ExecInvocation,
59 pub warned_invalid_allow_dangerous: &'static AtomicBool,
60}
61
62#[derive(Debug, Clone, Copy)]
63pub enum ExecInvocation {
64 CodexStyle,
65 GeminiStyle,
66}