vtcode_config/
constants.rs

1/// Application metadata constants shared across crates
2pub mod app {
3    pub const DISPLAY_NAME: &str = "VT Code";
4}
5
6/// Prompt path constants to avoid hardcoding throughout the codebase
7pub mod prompts {
8    pub const DEFAULT_SYSTEM_PROMPT_PATH: &str = "prompts/system.md";
9    pub const DEFAULT_CUSTOM_PROMPTS_DIR: &str = "~/.vtcode/prompts";
10    pub const DEFAULT_CUSTOM_SLASH_COMMANDS_DIR: &str = "~/.vtcode/commands";
11    pub const CUSTOM_PROMPTS_ENV_VAR: &str = "VTCODE_HOME";
12    pub const DEFAULT_CUSTOM_PROMPT_MAX_FILE_SIZE_KB: usize = 64;
13    pub const CORE_BUILTIN_PROMPTS_DIR: &str = "vtcode-core/prompts/custom";
14}
15
16/// Command execution defaults shared across the agent runtime
17pub mod commands {
18    pub const DEFAULT_EXTRA_PATH_ENTRIES: &[&str] = &[
19        "$HOME/.cargo/bin",
20        "$HOME/.local/bin",
21        "/opt/homebrew/bin",
22        "/usr/local/bin",
23        "$HOME/.asdf/bin",
24        "$HOME/.asdf/shims",
25        "$HOME/go/bin",
26    ];
27}
28
29/// Model ID constants to sync with docs/models.json
30pub mod models {
31    // Google/Gemini models
32    pub mod google {
33        /// Default model - using stable version for production reliability
34        pub const DEFAULT_MODEL: &str = "gemini-2.5-flash";
35
36        pub const SUPPORTED_MODELS: &[&str] = &[
37            "gemini-3-pro-preview",       // Latest flagship model with advanced reasoning
38            "gemini-3-flash-preview",     // Fast version of Gemini 3 Pro with 3-level thinking
39            "gemini-3-pro-image-preview", // Image generation model with 4K resolution
40            "gemini-2.5-pro",
41            "gemini-2.5-flash",
42            "gemini-2.5-flash-lite",
43            "gemini-2.5-flash-preview-05-20",
44            "gemini-1.5-pro",
45            "gemini-1.5-flash",
46        ];
47
48        /// Models that support thinking/reasoning capability with configurable thinking_level
49        /// Based on: https://ai.google.dev/gemini-api/docs/gemini-3
50        /// Gemini 3 Pro/Flash: supports low, high (default)
51        /// Gemini 3 Flash only: also supports minimal, medium
52        pub const REASONING_MODELS: &[&str] = &[
53            "gemini-3-pro-preview",
54            "gemini-3-flash-preview",
55            "gemini-2.5-pro",
56            "gemini-2.5-flash",
57            "gemini-2.5-flash-lite",
58            "gemini-2.5-flash-preview-05-20",
59            "gemini-1.5-pro",
60            "gemini-1.5-flash",
61        ];
62
63        /// Models that support Gemini 3 extended thinking levels (minimal, medium)
64        /// Only Gemini 3 Flash supports these additional levels beyond low/high
65        pub const EXTENDED_THINKING_MODELS: &[&str] = &["gemini-3-flash-preview"];
66
67        /// Models supporting image generation
68        pub const IMAGE_GENERATION_MODELS: &[&str] = &["gemini-3-pro-image-preview"];
69
70        /// Models that support context caching (min 2048 tokens required)
71        /// Context caching reduces costs for repeated API calls with similar contexts
72        /// Reference: https://ai.google.dev/gemini-api/docs/caching
73        pub const CACHING_MODELS: &[&str] = &[
74            "gemini-3-pro-preview",
75            "gemini-3-flash-preview",
76            "gemini-2.5-pro",
77            "gemini-2.5-flash",
78            "gemini-2.5-flash-lite",
79            "gemini-2.5-flash-preview-05-20",
80            "gemini-1.5-pro",
81            "gemini-1.5-flash",
82        ];
83
84        /// Models that support code execution (Python)
85        /// Code execution allows models to write and execute Python code
86        /// Reference: https://ai.google.dev/gemini-api/docs/code-execution
87        pub const CODE_EXECUTION_MODELS: &[&str] = &[
88            "gemini-3-pro-preview",
89            "gemini-3-flash-preview",
90            "gemini-2.5-pro",
91            "gemini-2.5-flash",
92            "gemini-2.5-flash-lite",
93            "gemini-2.5-flash-preview-05-20",
94            "gemini-1.5-pro",
95            "gemini-1.5-flash",
96        ];
97
98        // Convenience constants for commonly used models
99        pub const GEMINI_2_5_PRO: &str = "gemini-2.5-pro";
100        pub const GEMINI_2_5_FLASH: &str = "gemini-2.5-flash";
101        pub const GEMINI_2_5_FLASH_LITE: &str = "gemini-2.5-flash-lite";
102        pub const GEMINI_2_5_FLASH_PREVIEW: &str = "gemini-2.5-flash-preview-05-20";
103        pub const GEMINI_3_PRO_PREVIEW: &str = "gemini-3-pro-preview";
104        pub const GEMINI_3_FLASH_PREVIEW: &str = "gemini-3-flash-preview";
105        pub const GEMINI_3_PRO_IMAGE_PREVIEW: &str = "gemini-3-pro-image-preview";
106    }
107
108    // OpenAI models (from docs/models.json)
109    pub mod openai {
110        pub const DEFAULT_MODEL: &str = "gpt-5";
111        pub const SUPPORTED_MODELS: &[&str] = &[
112            "gpt-5",
113            "gpt-5-codex",
114            "gpt-5-mini",
115            "gpt-5-nano",
116            "gpt-5.2",
117            "gpt-5.2-2025-12-11",
118            "gpt-5.2-codex",
119            "gpt-5.1", // Enhanced version of GPT-5 with temperature support and streaming
120            "gpt-5.1-codex", // Enhanced version of GPT-5 Codex with temperature support and streaming
121            "gpt-5.1-codex-max", // Enhanced version of GPT-5 Codex with temperature support and streaming
122            "gpt-5.1-mini",      // Enhanced mini version with temperature support and streaming
123            "codex-mini-latest",
124            "gpt-oss-20b",
125            "gpt-oss-120b",
126        ];
127
128        /// Models that require the OpenAI Responses API
129        pub const RESPONSES_API_MODELS: &[&str] = &[
130            GPT_5,
131            GPT_5_CODEX,
132            GPT_5_MINI,
133            GPT_5_NANO,
134            GPT_5_2,
135            GPT_5_2_ALIAS,
136            GPT_5_2_CODEX,
137            GPT_5_1,
138            GPT_5_1_CODEX,
139            GPT_5_1_CODEX_MAX,
140            GPT_5_1_MINI,
141        ];
142
143        /// Models that support the OpenAI reasoning parameter payload
144        pub const REASONING_MODELS: &[&str] = &[
145            GPT_5,
146            GPT_5_CODEX,
147            GPT_5_MINI,
148            GPT_5_NANO,
149            GPT_5_2,
150            GPT_5_2_ALIAS,
151            GPT_5_2_CODEX,
152            GPT_5_1,
153            GPT_5_1_CODEX,
154            GPT_5_1_CODEX_MAX,
155        ];
156
157        /// Models that do not expose structured tool calling on the OpenAI platform
158        pub const TOOL_UNAVAILABLE_MODELS: &[&str] = &[];
159
160        /// GPT-OSS models that use harmony tokenization
161        pub const HARMONY_MODELS: &[&str] = &[GPT_OSS_20B, GPT_OSS_120B];
162
163        // Convenience constants for commonly used models
164        pub const GPT_5: &str = "gpt-5";
165        pub const GPT_5_CODEX: &str = "gpt-5-codex";
166        pub const GPT_5_MINI: &str = "gpt-5-mini";
167        pub const GPT_5_NANO: &str = "gpt-5-nano";
168        pub const GPT_5_2: &str = "gpt-5.2";
169        pub const GPT_5_2_ALIAS: &str = "gpt-5.2-2025-12-11";
170        pub const GPT_5_2_CODEX: &str = "gpt-5.2-codex";
171        pub const GPT_5_1: &str = "gpt-5.1"; // Enhanced version with temperature support and streaming
172        pub const GPT_5_1_CODEX: &str = "gpt-5.1-codex"; // Enhanced version with temperature support and streaming
173        pub const GPT_5_1_CODEX_MAX: &str = "gpt-5.1-codex-max"; // Enhanced version with temperature support and streaming
174        pub const GPT_5_1_MINI: &str = "gpt-5.1-mini"; // Enhanced version with temperature support and streaming
175        pub const CODEX_MINI_LATEST: &str = "codex-mini-latest";
176        pub const GPT_OSS_20B: &str = "gpt-oss-20b";
177        pub const GPT_OSS_120B: &str = "gpt-oss-120b";
178    }
179
180    // Hugging Face Inference Providers (OpenAI-compatible router)
181    pub mod huggingface {
182        pub const DEFAULT_MODEL: &str = OPENAI_GPT_OSS_120B;
183        pub const SUPPORTED_MODELS: &[&str] = &[
184            // Recommended conversational LLMs from HF docs
185            GOOGLE_GEMMA_2_2B_IT,
186            QWEN3_CODER_480B_A35B_INSTRUCT,
187            OPENAI_GPT_OSS_120B,
188            ZAI_GLM_45,
189            QWEN3_4B_THINKING_2507,
190            QWEN25_7B_INSTRUCT_1M,
191            QWEN25_CODER_32B_INSTRUCT,
192            DEEPSEEK_R1,
193            // Additional supported models
194            DEEPSEEK_V32,
195            OPENAI_GPT_OSS_20B,
196            ZAI_GLM_46,
197            ZAI_GLM_47,
198            ZAI_GLM_47_NOVITA,
199            MOONSHOT_KIMI_K2_THINKING,
200            // Recommended VLM
201            ZAI_GLM_45V,
202            // Novita inference provider models
203            MINIMAX_M2_1_NOVITA,
204            DEEPSEEK_V32_NOVITA,
205            XIAOMI_MIMO_V2_FLASH_NOVITA,
206        ];
207
208        // Recommended conversational LLMs
209        pub const GOOGLE_GEMMA_2_2B_IT: &str = "google/gemma-2-2b-it";
210        pub const QWEN3_CODER_480B_A35B_INSTRUCT: &str = "Qwen/Qwen3-Coder-480B-A35B-Instruct";
211        pub const OPENAI_GPT_OSS_120B: &str = "openai/gpt-oss-120b";
212        pub const ZAI_GLM_45: &str = "zai-org/GLM-4.5:zai-org";
213        pub const QWEN3_4B_THINKING_2507: &str = "Qwen/Qwen3-4B-Thinking-2507";
214        pub const QWEN25_7B_INSTRUCT_1M: &str = "Qwen/Qwen2.5-7B-Instruct-1M";
215        pub const QWEN25_CODER_32B_INSTRUCT: &str = "Qwen/Qwen2.5-Coder-32B-Instruct";
216        pub const DEEPSEEK_R1: &str = "deepseek-ai/DeepSeek-R1";
217
218        // Additional supported models
219        pub const DEEPSEEK_V32: &str = "deepseek-ai/DeepSeek-V3.2";
220        pub const OPENAI_GPT_OSS_20B: &str = "openai/gpt-oss-20b";
221        pub const ZAI_GLM_46: &str = "zai-org/GLM-4.6:zai-org";
222        pub const ZAI_GLM_47: &str = "zai-org/GLM-4.7:zai-org";
223        pub const ZAI_GLM_47_NOVITA: &str = "zai-org/GLM-4.7:novita";
224        pub const MOONSHOT_KIMI_K2_THINKING: &str = "moonshotai/Kimi-K2-Thinking";
225
226        // Recommended VLM
227        pub const ZAI_GLM_45V: &str = "zai-org/GLM-4.5V:zai-org";
228        pub const MINIMAX_M2_1_NOVITA: &str = "MiniMaxAI/MiniMax-M2.1:novita";
229        pub const DEEPSEEK_V32_NOVITA: &str = "deepseek-ai/DeepSeek-V3.2:novita";
230        pub const XIAOMI_MIMO_V2_FLASH_NOVITA: &str = "XiaomiMiMo/MiMo-V2-Flash:novita";
231
232        pub const REASONING_MODELS: &[&str] = &[
233            // All recommended models support reasoning
234            QWEN3_CODER_480B_A35B_INSTRUCT,
235            OPENAI_GPT_OSS_120B,
236            ZAI_GLM_45,
237            QWEN3_4B_THINKING_2507,
238            DEEPSEEK_R1,
239            // Additional reasoning models
240            DEEPSEEK_V32,
241            OPENAI_GPT_OSS_20B,
242            ZAI_GLM_46,
243            ZAI_GLM_47,
244            ZAI_GLM_47_NOVITA,
245            MOONSHOT_KIMI_K2_THINKING,
246            ZAI_GLM_45V,
247            DEEPSEEK_V32_NOVITA,
248            MINIMAX_M2_1_NOVITA,
249            XIAOMI_MIMO_V2_FLASH_NOVITA,
250        ];
251    }
252
253    // Z.AI models (direct API)
254    pub mod zai {
255        pub const DEFAULT_MODEL: &str = "glm-4.7";
256        pub const SUPPORTED_MODELS: &[&str] = &[
257            "glm-4-plus",
258            "glm-4.7",
259            "glm-4.6",
260            "glm-4.6v",
261            "glm-4.6v-flash",
262            "glm-4.6v-flashx",
263            "glm-4.5",
264            "glm-4.5-air",
265            "glm-4.5-x",
266            "glm-4.5-airx",
267            "glm-4.5-flash",
268            "glm-4.5v",
269            "glm-4-32b-0414-128k",
270        ];
271
272        pub const REASONING_MODELS: &[&str] = &[
273            "glm-4-plus",
274            "glm-4.7",
275            "glm-4.6",
276            "glm-4.5",
277            "glm-4.5-air",
278            "glm-4.5-x",
279            "glm-4.5-airx",
280            "glm-4.5-flash",
281        ];
282
283        pub const GLM_4_PLUS: &str = "glm-4-plus";
284        pub const GLM_4_PLUS_DEEP_THINKING: &str = "glm-4-plus:thinking";
285        pub const GLM_4_7: &str = "glm-4.7";
286        pub const GLM_4_7_DEEP_THINKING: &str = "glm-4.7:thinking";
287        pub const GLM_4_6: &str = "glm-4.6";
288        pub const GLM_4_6_DEEP_THINKING: &str = "glm-4.6:thinking";
289        pub const GLM_4_6V: &str = "glm-4.6v";
290        pub const GLM_4_6V_FLASH: &str = "glm-4.6v-flash";
291        pub const GLM_4_6V_FLASHX: &str = "glm-4.6v-flashx";
292        pub const GLM_4_5: &str = "glm-4.5";
293        pub const GLM_4_5_DEEP_THINKING: &str = "glm-4.5:thinking";
294        pub const GLM_4_5_AIR: &str = "glm-4.5-air";
295        pub const GLM_4_5_X: &str = "glm-4.5-x";
296        pub const GLM_4_5_AIRX: &str = "glm-4.5-airx";
297        pub const GLM_4_5_FLASH: &str = "glm-4.5-flash";
298        pub const GLM_4_5V: &str = "glm-4.5v";
299        pub const GLM_4_32B_0414_128K: &str = "glm-4-32b-0414-128k";
300    }
301
302    // Moonshot.ai models (direct API)
303    pub mod moonshot {
304        // Legacy Moonshot direct API models (kept for compatibility with tests)
305        pub const DEFAULT_MODEL: &str = "kimi-k2-0905";
306        pub const SUPPORTED_MODELS: &[&str] = &[DEFAULT_MODEL];
307    }
308
309    // OpenRouter models (extensible via vtcode.toml)
310    #[cfg(not(docsrs))]
311    pub mod openrouter {
312        include!(concat!(env!("OUT_DIR"), "/openrouter_constants.rs"));
313    }
314
315    #[cfg(docsrs)]
316    pub mod openrouter {
317        pub const SUPPORTED_MODELS: &[&str] = &[];
318        pub const REASONING_MODELS: &[&str] = &[];
319        pub const TOOL_UNAVAILABLE_MODELS: &[&str] = &[];
320
321        // Define the constants that are referenced elsewhere to avoid compile errors
322        pub const X_AI_GROK_CODE_FAST_1: &str = "x-ai/grok-code-fast-1";
323        pub const QWEN3_CODER: &str = "qwen/qwen3-coder";
324        pub const ANTHROPIC_CLAUDE_SONNET_4_5: &str = "anthropic/claude-sonnet-4.5";
325
326        pub mod vendor {
327            pub mod openrouter {
328                pub const MODELS: &[&str] = &[];
329            }
330        }
331    }
332
333    // LM Studio models (OpenAI-compatible local server)
334    pub mod lmstudio {
335        pub const DEFAULT_MODEL: &str = META_LLAMA_31_8B_INSTRUCT;
336        pub const SUPPORTED_MODELS: &[&str] = &[
337            META_LLAMA_3_8B_INSTRUCT,
338            META_LLAMA_31_8B_INSTRUCT,
339            QWEN25_7B_INSTRUCT,
340            GEMMA_2_2B_IT,
341            GEMMA_2_9B_IT,
342            PHI_31_MINI_4K_INSTRUCT,
343        ];
344
345        pub const META_LLAMA_3_8B_INSTRUCT: &str = "lmstudio-community/meta-llama-3-8b-instruct";
346        pub const META_LLAMA_31_8B_INSTRUCT: &str = "lmstudio-community/meta-llama-3.1-8b-instruct";
347        pub const QWEN25_7B_INSTRUCT: &str = "lmstudio-community/qwen2.5-7b-instruct";
348        pub const GEMMA_2_2B_IT: &str = "lmstudio-community/gemma-2-2b-it";
349        pub const GEMMA_2_9B_IT: &str = "lmstudio-community/gemma-2-9b-it";
350        pub const PHI_31_MINI_4K_INSTRUCT: &str = "lmstudio-community/phi-3.1-mini-4k-instruct";
351    }
352
353    pub mod ollama {
354        pub const DEFAULT_LOCAL_MODEL: &str = "gpt-oss:20b";
355        pub const DEFAULT_CLOUD_MODEL: &str = "gpt-oss:120b-cloud";
356        pub const DEFAULT_MODEL: &str = DEFAULT_LOCAL_MODEL;
357        pub const SUPPORTED_MODELS: &[&str] = &[
358            DEFAULT_LOCAL_MODEL,
359            QWEN3_1_7B,
360            DEFAULT_CLOUD_MODEL,
361            GPT_OSS_20B_CLOUD,
362            DEEPSEEK_V32_CLOUD,
363            QWEN3_NEXT_80B_CLOUD,
364            MISTRAL_LARGE_3_675B_CLOUD,
365            KIMI_K2_THINKING_CLOUD,
366            KIMI_K2_1T_CLOUD,
367            QWEN3_CODER_480B_CLOUD,
368            GLM_46_CLOUD,
369            GLM_47_CLOUD,
370            GEMINI_3_PRO_PREVIEW_LATEST_CLOUD,
371            GEMINI_3_FLASH_PREVIEW_CLOUD,
372            DEVSTRAL_2_123B_CLOUD,
373            MINIMAX_M2_CLOUD,
374            MINIMAX_M21_CLOUD,
375            NEMOTRON_3_NANO_30B_CLOUD,
376        ];
377
378        /// Models that emit structured reasoning traces when `think` is enabled
379        pub const REASONING_MODELS: &[&str] = &[
380            GPT_OSS_20B,
381            GPT_OSS_20B_CLOUD,
382            GPT_OSS_120B_CLOUD,
383            QWEN3_1_7B,
384            DEEPSEEK_V32_CLOUD,
385            QWEN3_NEXT_80B_CLOUD,
386            MISTRAL_LARGE_3_675B_CLOUD,
387            KIMI_K2_THINKING_CLOUD,
388            KIMI_K2_1T_CLOUD,
389            QWEN3_CODER_480B_CLOUD,
390            GLM_46_CLOUD,
391            GLM_47_CLOUD,
392            GEMINI_3_PRO_PREVIEW_LATEST_CLOUD,
393            GEMINI_3_FLASH_PREVIEW_CLOUD,
394            DEVSTRAL_2_123B_CLOUD,
395            MINIMAX_M2_CLOUD,
396            MINIMAX_M21_CLOUD,
397            NEMOTRON_3_NANO_30B_CLOUD,
398        ];
399
400        /// Models that require an explicit reasoning effort level instead of boolean toggle
401        pub const REASONING_LEVEL_MODELS: &[&str] = &[
402            GPT_OSS_20B,
403            GPT_OSS_20B_CLOUD,
404            GPT_OSS_120B_CLOUD,
405            GLM_46_CLOUD,
406            GLM_47_CLOUD,
407            MINIMAX_M2_CLOUD,
408            MINIMAX_M21_CLOUD,
409            GEMINI_3_FLASH_PREVIEW_CLOUD,
410        ];
411
412        pub const GPT_OSS_20B: &str = DEFAULT_LOCAL_MODEL;
413        pub const GPT_OSS_20B_CLOUD: &str = "gpt-oss:20b-cloud";
414        pub const GPT_OSS_120B_CLOUD: &str = DEFAULT_CLOUD_MODEL;
415        pub const QWEN3_1_7B: &str = "qwen3:1.7b";
416        pub const DEEPSEEK_V32_CLOUD: &str = "deepseek-v3.2:cloud";
417        pub const QWEN3_NEXT_80B_CLOUD: &str = "qwen3-next:80b-cloud";
418        pub const MISTRAL_LARGE_3_675B_CLOUD: &str = "mistral-large-3:675b-cloud";
419        pub const KIMI_K2_THINKING_CLOUD: &str = "kimi-k2-thinking:cloud";
420        pub const KIMI_K2_1T_CLOUD: &str = "kimi-k2:1t-cloud";
421        pub const QWEN3_CODER_480B_CLOUD: &str = "qwen3-coder:480b-cloud";
422        pub const GLM_46_CLOUD: &str = "glm-4.6:cloud";
423        pub const GLM_47_CLOUD: &str = "glm-4.7:cloud";
424        pub const GEMINI_3_PRO_PREVIEW_LATEST_CLOUD: &str = "gemini-3-pro-preview:latest";
425        pub const GEMINI_3_FLASH_PREVIEW_CLOUD: &str = "gemini-3-flash-preview:cloud";
426        pub const DEVSTRAL_2_123B_CLOUD: &str = "devstral-2:123b-cloud";
427        pub const MINIMAX_M2_CLOUD: &str = "minimax-m2:cloud";
428        pub const MINIMAX_M21_CLOUD: &str = "minimax-m2.1:cloud";
429        pub const NEMOTRON_3_NANO_30B_CLOUD: &str = "nemotron-3-nano:30b-cloud";
430    }
431
432    // DeepSeek models (native API) - V3.2 released 2025-12-01
433    pub mod deepseek {
434        pub const DEFAULT_MODEL: &str = "deepseek-chat";
435        pub const SUPPORTED_MODELS: &[&str] = &["deepseek-chat", "deepseek-reasoner"];
436
437        pub const DEEPSEEK_CHAT: &str = "deepseek-chat";
438        pub const DEEPSEEK_REASONER: &str = "deepseek-reasoner";
439    }
440
441    // Anthropic models (from docs/models.json)
442    pub mod anthropic {
443        // Standard model for straightforward tools - Sonnet 4.5 preferred for most use cases
444        pub const DEFAULT_MODEL: &str = "claude-sonnet-4-5-20250929";
445        pub const SUPPORTED_MODELS: &[&str] = &[
446            // Claude 4.5 series
447            "claude-sonnet-4-5-20250929", // Latest flagship model for complex agents and coding
448            "claude-haiku-4-5-20251001",  // Fastest model with near-frontier intelligence
449            "claude-opus-4-5-20251101",   // Premium flagship model with exceptional intelligence
450            "claude-opus-4-1-20250805",   // Specialized reasoning model
451            "claude-sonnet-4-5",          // Alias for latest Claude Sonnet 4.5
452            "claude-haiku-4-5",          // Alias for latest Claude Haiku 4.5
453            "claude-opus-4-5",           // Alias for latest Claude Opus 4.5
454            "claude-opus-4-1",           // Alias for latest Claude Opus 4.1
455            // Claude 4 series
456            "claude-sonnet-4-20250514",   // Claude 4 Sonnet
457            "claude-opus-4-20250514",     // Claude 4 Opus
458            "claude-sonnet-4-0",          // Alias for Claude 4 Sonnet
459            "claude-opus-4-0",           // Alias for Claude 4 Opus
460            // Claude 3.x series
461            "claude-3-7-sonnet-20250219", // Latest Claude 3.7 Sonnet
462            "claude-3-7-sonnet-latest",  // Alias for Claude 3.7 Sonnet
463            "claude-3-5-sonnet-20241022", // Latest Claude 3.5 Sonnet
464            "claude-3-5-sonnet-latest",  // Alias for Claude 3.5 Sonnet
465            "claude-3-5-haiku-20241022",  // Latest Claude 3.5 Haiku
466            "claude-3-5-haiku-latest",   // Alias for Claude 3.5 Haiku
467            "claude-3-opus-20240229",    // Legacy Claude 3 Opus
468            "claude-3-sonnet-20240229",  // Legacy Claude 3 Sonnet
469            "claude-3-haiku-20240307",   // Legacy Claude 3 Haiku
470        ];
471
472        // Convenience constants for versioned models
473        pub const CLAUDE_SONNET_4_5_20250929: &str = "claude-sonnet-4-5-20250929";
474        pub const CLAUDE_HAIKU_4_5_20251001: &str = "claude-haiku-4-5-20251001";
475        pub const CLAUDE_OPUS_4_5_20251101: &str = "claude-opus-4-5-20251101";
476        pub const CLAUDE_OPUS_4_1_20250805: &str = "claude-opus-4-1-20250805";
477        pub const CLAUDE_SONNET_4_20250514: &str = "claude-sonnet-4-20250514";
478        pub const CLAUDE_OPUS_4_20250514: &str = "claude-opus-4-20250514";
479        pub const CLAUDE_3_7_SONNET_20250219: &str = "claude-3-7-sonnet-20250219";
480        pub const CLAUDE_3_5_SONNET_20241022: &str = "claude-3-5-sonnet-20241022";
481        pub const CLAUDE_3_5_HAIKU_20241022: &str = "claude-3-5-haiku-20241022";
482
483        // Convenience constants for alias models
484        pub const CLAUDE_HAIKU_4_5: &str = "claude-haiku-4-5";
485        pub const CLAUDE_SONNET_4_5: &str = "claude-sonnet-4-5";
486        pub const CLAUDE_OPUS_4_5: &str = "claude-opus-4-5";
487        pub const CLAUDE_OPUS_4_1: &str = "claude-opus-4-1";
488        pub const CLAUDE_SONNET_4_0: &str = "claude-sonnet-4-0";
489        pub const CLAUDE_OPUS_4_0: &str = "claude-opus-4-0";
490        pub const CLAUDE_3_7_SONNET_LATEST: &str = "claude-3-7-sonnet-latest";
491        pub const CLAUDE_3_5_SONNET_LATEST: &str = "claude-3-5-sonnet-latest";
492        pub const CLAUDE_3_5_HAIKU_LATEST: &str = "claude-3-5-haiku-latest";
493
494        // Legacy aliases for backwards compatibility
495        pub const CLAUDE_OPUS_4_1_20250805_LEGACY: &str = "claude-opus-4-1-20250805";
496
497        /// Models that accept the reasoning effort parameter or extended thinking
498        pub const REASONING_MODELS: &[&str] = &[
499            CLAUDE_SONNET_4_5_20250929,
500            CLAUDE_HAIKU_4_5_20251001,
501            CLAUDE_OPUS_4_5_20251101,
502            CLAUDE_OPUS_4_1_20250805,
503            CLAUDE_SONNET_4_5,
504            CLAUDE_HAIKU_4_5,
505            CLAUDE_OPUS_4_5,
506            CLAUDE_OPUS_4_1,
507            "claude-sonnet-4-20250514",
508            "claude-opus-4-20250514",
509            "claude-sonnet-4-0",
510            "claude-opus-4-0",
511            "claude-3-7-sonnet-20250219",
512            "claude-3-7-sonnet-latest",
513        ];
514
515        /// Interleaved thinking configuration for Anthropic models
516        pub const INTERLEAVED_THINKING_BETA: &str = "interleaved-thinking-2025-05-14";
517        pub const INTERLEAVED_THINKING_TYPE_ENABLED: &str = "enabled";
518    }
519
520    // MiniMax models (Anthropic-compatible API, standalone provider)
521    pub mod minimax {
522        pub const DEFAULT_MODEL: &str = MINIMAX_M2_1;
523        pub const SUPPORTED_MODELS: &[&str] = &[MINIMAX_M2_1, MINIMAX_M2_1_LIGHTNING, MINIMAX_M2];
524        pub const MINIMAX_M2_1: &str = "MiniMax-M2.1";
525        pub const MINIMAX_M2_1_LIGHTNING: &str = "MiniMax-M2.1-lightning";
526        pub const MINIMAX_M2: &str = "MiniMax-M2";
527    }
528
529    // xAI models
530    pub mod xai {
531        pub const DEFAULT_MODEL: &str = "grok-4";
532        pub const SUPPORTED_MODELS: &[&str] = &[
533            "grok-4",
534            "grok-4-mini",
535            "grok-4-code",
536            "grok-4-code-latest",
537            "grok-4-vision",
538            "grok-4-1-fast",
539            "grok-code-fast-1",
540            "grok-4-fast",
541            "grok-3",
542            "grok-3-mini",
543            "grok-2-1212",
544            "grok-2-vision-1212",
545            "grok-beta",
546        ];
547
548        pub const GROK_4: &str = "grok-4";
549        pub const GROK_4_MINI: &str = "grok-4-mini";
550        pub const GROK_4_CODE: &str = "grok-4-code";
551        pub const GROK_4_CODE_LATEST: &str = "grok-4-code-latest";
552        pub const GROK_4_VISION: &str = "grok-4-vision";
553        pub const GROK_4_1_FAST: &str = "grok-4-1-fast";
554        pub const GROK_CODE_FAST_1: &str = "grok-code-fast-1";
555        pub const GROK_4_FAST: &str = "grok-4-fast";
556        pub const GROK_3: &str = "grok-3";
557        pub const GROK_3_MINI: &str = "grok-3-mini";
558        pub const GROK_2_1212: &str = "grok-2-1212";
559        pub const GROK_2_VISION_1212: &str = "grok-2-vision-1212";
560        pub const GROK_BETA: &str = "grok-beta";
561    }
562
563    // Backwards compatibility - keep old constants working
564    pub const GEMINI_2_5_FLASH_PREVIEW: &str = google::GEMINI_2_5_FLASH_PREVIEW;
565    pub const GEMINI_2_5_FLASH: &str = google::GEMINI_2_5_FLASH;
566    pub const GEMINI_2_5_PRO: &str = google::GEMINI_2_5_PRO;
567    pub const GEMINI_2_5_FLASH_LITE: &str = google::GEMINI_2_5_FLASH_LITE;
568    pub const GEMINI_3_PRO_PREVIEW: &str = google::GEMINI_3_PRO_PREVIEW;
569    pub const GEMINI_3_FLASH_PREVIEW: &str = google::GEMINI_3_FLASH_PREVIEW;
570    pub const GPT_5: &str = openai::GPT_5;
571    pub const GPT_5_CODEX: &str = openai::GPT_5_CODEX;
572    pub const GPT_5_MINI: &str = openai::GPT_5_MINI;
573    pub const GPT_5_NANO: &str = openai::GPT_5_NANO;
574    pub const GPT_5_2: &str = openai::GPT_5_2;
575    pub const GPT_5_2_ALIAS: &str = openai::GPT_5_2_ALIAS;
576    pub const GPT_5_1: &str = openai::GPT_5_1;
577    pub const GPT_5_1_CODEX: &str = openai::GPT_5_1_CODEX;
578    pub const GPT_5_1_CODEX_MAX: &str = openai::GPT_5_1_CODEX_MAX;
579    pub const GPT_5_1_MINI: &str = openai::GPT_5_1_MINI;
580    pub const CODEX_MINI: &str = openai::CODEX_MINI_LATEST;
581    pub const CODEX_MINI_LATEST: &str = openai::CODEX_MINI_LATEST;
582    pub const CLAUDE_OPUS_4_1_20250805: &str = anthropic::CLAUDE_OPUS_4_1_20250805;
583    pub const CLAUDE_OPUS_4_5_20251101: &str = anthropic::CLAUDE_OPUS_4_5_20251101;
584    pub const CLAUDE_OPUS_4_20250514: &str = anthropic::CLAUDE_OPUS_4_20250514;
585    pub const CLAUDE_SONNET_4_20250514: &str = anthropic::CLAUDE_SONNET_4_20250514;
586    pub const CLAUDE_3_7_SONNET_20250219: &str = anthropic::CLAUDE_3_7_SONNET_20250219;
587    pub const CLAUDE_3_5_SONNET_20241022: &str = anthropic::CLAUDE_3_5_SONNET_20241022;
588    pub const CLAUDE_SONNET_4_5: &str = anthropic::CLAUDE_SONNET_4_5;
589    pub const CLAUDE_HAIKU_4_5: &str = anthropic::CLAUDE_HAIKU_4_5;
590    pub const CLAUDE_SONNET_4_5_20250929: &str = anthropic::CLAUDE_SONNET_4_5_20250929;
591    pub const CLAUDE_HAIKU_4_5_20251001: &str = anthropic::CLAUDE_HAIKU_4_5_20251001;
592    pub const CLAUDE_OPUS_4_1: &str = anthropic::CLAUDE_OPUS_4_1;
593    pub const CLAUDE_OPUS_4_5: &str = anthropic::CLAUDE_OPUS_4_5;
594    pub const CLAUDE_SONNET_4_0: &str = anthropic::CLAUDE_SONNET_4_0;
595    pub const CLAUDE_OPUS_4_0: &str = anthropic::CLAUDE_OPUS_4_0;
596    pub const CLAUDE_3_7_SONNET_LATEST: &str = anthropic::CLAUDE_3_7_SONNET_LATEST;
597    pub const CLAUDE_3_5_SONNET_LATEST: &str = anthropic::CLAUDE_3_5_SONNET_LATEST;
598    pub const CLAUDE_3_5_HAIKU_20241022: &str = anthropic::CLAUDE_3_5_HAIKU_20241022;
599    pub const CLAUDE_3_5_HAIKU_LATEST: &str = anthropic::CLAUDE_3_5_HAIKU_LATEST;
600    pub const MINIMAX_M2: &str = minimax::MINIMAX_M2;
601    pub const XAI_GROK_4: &str = xai::GROK_4;
602    pub const XAI_GROK_4_MINI: &str = xai::GROK_4_MINI;
603    pub const XAI_GROK_4_CODE: &str = xai::GROK_4_CODE;
604    pub const XAI_GROK_4_CODE_LATEST: &str = xai::GROK_4_CODE_LATEST;
605    pub const XAI_GROK_4_VISION: &str = xai::GROK_4_VISION;
606    pub const XAI_GROK_3: &str = xai::GROK_3;
607    pub const XAI_GROK_2: &str = xai::GROK_2_1212;
608    pub const XAI_GROK_BETA: &str = xai::GROK_BETA;
609    pub const DEEPSEEK_CHAT: &str = deepseek::DEEPSEEK_CHAT;
610    pub const DEEPSEEK_REASONER: &str = deepseek::DEEPSEEK_REASONER;
611    #[cfg(not(docsrs))]
612    pub const OPENROUTER_X_AI_GROK_CODE_FAST_1: &str = openrouter::X_AI_GROK_CODE_FAST_1;
613    #[cfg(docsrs)]
614    pub const OPENROUTER_X_AI_GROK_CODE_FAST_1: &str = "x-ai/grok-code-fast-1";
615    #[cfg(not(docsrs))]
616    pub const OPENROUTER_QWEN3_CODER: &str = openrouter::QWEN3_CODER;
617    #[cfg(docsrs)]
618    pub const OPENROUTER_QWEN3_CODER: &str = "qwen/qwen3-coder";
619    #[cfg(not(docsrs))]
620    pub const OPENROUTER_ANTHROPIC_CLAUDE_SONNET_4_5: &str =
621        openrouter::ANTHROPIC_CLAUDE_SONNET_4_5;
622    #[cfg(docsrs)]
623    pub const OPENROUTER_ANTHROPIC_CLAUDE_SONNET_4_5: &str = "anthropic/claude-sonnet-4.5";
624}
625
626/// Prompt caching defaults shared across features and providers
627pub mod prompt_cache {
628    pub const DEFAULT_ENABLED: bool = true;
629    pub const DEFAULT_CACHE_DIR: &str = ".vtcode/cache/prompts";
630    pub const DEFAULT_MAX_ENTRIES: usize = 1_000;
631    pub const DEFAULT_MAX_AGE_DAYS: u64 = 30;
632    pub const DEFAULT_AUTO_CLEANUP: bool = true;
633    pub const DEFAULT_MIN_QUALITY_THRESHOLD: f64 = 0.7;
634
635    pub const OPENAI_MIN_PREFIX_TOKENS: u32 = 1_024;
636    pub const GEMINI_MIN_PREFIX_TOKENS: u32 = 1_024;
637    pub const OPENAI_IDLE_EXPIRATION_SECONDS: u64 = 60 * 60; // 1 hour max reuse window
638
639    pub const ANTHROPIC_DEFAULT_TTL_SECONDS: u64 = 5 * 60; // 5 minutes
640    pub const ANTHROPIC_EXTENDED_TTL_SECONDS: u64 = 60 * 60; // 1 hour option
641    pub const ANTHROPIC_MAX_BREAKPOINTS: u8 = 4;
642
643    pub const GEMINI_EXPLICIT_DEFAULT_TTL_SECONDS: u64 = 60 * 60; // 1 hour default for explicit caches
644
645    pub const OPENROUTER_CACHE_DISCOUNT_ENABLED: bool = true;
646    pub const XAI_CACHE_ENABLED: bool = true;
647    pub const DEEPSEEK_CACHE_ENABLED: bool = true;
648    pub const ZAI_CACHE_ENABLED: bool = false;
649    pub const MOONSHOT_CACHE_ENABLED: bool = true;
650}
651
652/// Model validation and helper functions
653pub mod model_helpers {
654    use super::models;
655
656    /// Get supported models for a provider
657    pub fn supported_for(provider: &str) -> Option<&'static [&'static str]> {
658        match provider {
659            "google" | "gemini" => Some(models::google::SUPPORTED_MODELS),
660            "openai" => Some(models::openai::SUPPORTED_MODELS),
661            "anthropic" => Some(models::anthropic::SUPPORTED_MODELS),
662            "minimax" => Some(models::minimax::SUPPORTED_MODELS),
663            "deepseek" => Some(models::deepseek::SUPPORTED_MODELS),
664            #[cfg(not(docsrs))]
665            "openrouter" => Some(models::openrouter::SUPPORTED_MODELS),
666            #[cfg(docsrs)]
667            "openrouter" => Some(&[]),
668            "moonshot" => Some(models::moonshot::SUPPORTED_MODELS),
669            "xai" => Some(models::xai::SUPPORTED_MODELS),
670            "zai" => Some(models::zai::SUPPORTED_MODELS),
671            "ollama" => Some(models::ollama::SUPPORTED_MODELS),
672            _ => None,
673        }
674    }
675
676    /// Get default model for a provider
677    pub fn default_for(provider: &str) -> Option<&'static str> {
678        match provider {
679            "google" | "gemini" => Some(models::google::DEFAULT_MODEL),
680            "openai" => Some(models::openai::DEFAULT_MODEL),
681            "anthropic" => Some(models::anthropic::DEFAULT_MODEL),
682            "minimax" => Some(models::minimax::DEFAULT_MODEL),
683            "deepseek" => Some(models::deepseek::DEFAULT_MODEL),
684            #[cfg(not(docsrs))]
685            "openrouter" => Some(models::openrouter::DEFAULT_MODEL),
686            #[cfg(docsrs)]
687            "openrouter" => Some("openrouter/auto"), // Fallback for docs.rs build
688            "xai" => Some(models::xai::DEFAULT_MODEL),
689            "zai" => Some(models::zai::DEFAULT_MODEL),
690            "ollama" => Some(models::ollama::DEFAULT_MODEL),
691            _ => None,
692        }
693    }
694
695    /// Validate if a model is supported by a provider
696    pub fn is_valid(provider: &str, model: &str) -> bool {
697        supported_for(provider)
698            .map(|list| list.contains(&model))
699            .unwrap_or(false)
700    }
701}
702
703/// Environment variable names shared across the application.
704pub mod env {
705    /// Agent Client Protocol specific environment keys
706    pub mod acp {
707        #[derive(Debug, Clone, Copy)]
708        pub enum AgentClientProtocolEnvKey {
709            Enabled,
710            ZedEnabled,
711            ZedToolsReadFileEnabled,
712            ZedToolsListFilesEnabled,
713            ZedWorkspaceTrust,
714        }
715
716        impl AgentClientProtocolEnvKey {
717            pub fn as_str(self) -> &'static str {
718                match self {
719                    Self::Enabled => "VT_ACP_ENABLED",
720                    Self::ZedEnabled => "VT_ACP_ZED_ENABLED",
721                    Self::ZedToolsReadFileEnabled => "VT_ACP_ZED_TOOLS_READ_FILE_ENABLED",
722                    Self::ZedToolsListFilesEnabled => "VT_ACP_ZED_TOOLS_LIST_FILES_ENABLED",
723                    Self::ZedWorkspaceTrust => "VT_ACP_ZED_WORKSPACE_TRUST",
724                }
725            }
726        }
727    }
728}
729
730/// Default configuration values
731pub mod defaults {
732    use super::{models, ui};
733
734    pub const DEFAULT_MODEL: &str = models::openai::DEFAULT_MODEL;
735    pub const DEFAULT_CLI_MODEL: &str = models::openai::DEFAULT_MODEL;
736    pub const DEFAULT_PROVIDER: &str = "openai";
737    pub const DEFAULT_API_KEY_ENV: &str = "OPENAI_API_KEY";
738    pub const DEFAULT_THEME: &str = "ciapre-dark";
739    pub const DEFAULT_FULL_AUTO_MAX_TURNS: usize = 30;
740    pub const DEFAULT_MAX_TOOL_LOOPS: usize = 200;
741    pub const DEFAULT_MAX_REPEATED_TOOL_CALLS: usize = 3;
742    pub const DEFAULT_PTY_STDOUT_TAIL_LINES: usize = 20;
743    pub const DEFAULT_PTY_SCROLLBACK_LINES: usize = 400;
744    pub const DEFAULT_TOOL_OUTPUT_MODE: &str = ui::TOOL_OUTPUT_MODE_COMPACT;
745
746    pub const DEFAULT_PTY_OUTPUT_MAX_TOKENS: usize = 8_000;
747
748    /// Byte fuse for PTY output - secondary safeguard after token truncation.
749    /// Protects against edge cases where token estimation underestimates size.
750    pub const DEFAULT_PTY_OUTPUT_BYTE_FUSE: usize = 40 * 1024; // 40 KiB
751}
752
753pub mod ui {
754    pub const TOOL_OUTPUT_MODE_COMPACT: &str = "compact";
755    pub const TOOL_OUTPUT_MODE_FULL: &str = "full";
756    pub const DEFAULT_INLINE_VIEWPORT_ROWS: u16 = 16;
757    pub const DEFAULT_REASONING_VISIBLE: bool = false;
758    pub const SLASH_SUGGESTION_LIMIT: usize = 50; // All commands are scrollable
759    pub const SLASH_PALETTE_MIN_WIDTH: u16 = 40;
760    pub const SLASH_PALETTE_MIN_HEIGHT: u16 = 9;
761    pub const SLASH_PALETTE_HORIZONTAL_MARGIN: u16 = 8;
762    pub const SLASH_PALETTE_TOP_OFFSET: u16 = 3;
763    pub const SLASH_PALETTE_CONTENT_PADDING: u16 = 6;
764    pub const SLASH_PALETTE_HINT_PRIMARY: &str = "Type to filter slash commands.";
765    pub const SLASH_PALETTE_HINT_SECONDARY: &str = "Press Enter to apply • Esc to dismiss.";
766    pub const MODAL_MIN_WIDTH: u16 = 36;
767    pub const MODAL_MIN_HEIGHT: u16 = 9;
768    pub const MODAL_LIST_MIN_HEIGHT: u16 = 12;
769    pub const MODAL_WIDTH_RATIO: f32 = 0.6;
770    pub const MODAL_HEIGHT_RATIO: f32 = 0.6;
771    pub const MODAL_MAX_WIDTH_RATIO: f32 = 0.9;
772    pub const MODAL_MAX_HEIGHT_RATIO: f32 = 0.8;
773    pub const MODAL_CONTENT_HORIZONTAL_PADDING: u16 = 8;
774    pub const MODAL_CONTENT_VERTICAL_PADDING: u16 = 6;
775    pub const MODAL_INSTRUCTIONS_TITLE: &str = "";
776    pub const MODAL_INSTRUCTIONS_BULLET: &str = "•";
777    pub const INLINE_HEADER_HEIGHT: u16 = 3;
778    pub const INLINE_INPUT_HEIGHT: u16 = 4;
779    pub const INLINE_INPUT_MAX_LINES: usize = 10;
780    pub const INLINE_NAVIGATION_PERCENT: u16 = 28;
781    pub const INLINE_NAVIGATION_MIN_WIDTH: u16 = 24;
782    pub const INLINE_CONTENT_MIN_WIDTH: u16 = 48;
783    pub const INLINE_STACKED_NAVIGATION_PERCENT: u16 = INLINE_NAVIGATION_PERCENT;
784    pub const INLINE_SCROLLBAR_EDGE_PADDING: u16 = 1;
785    pub const INLINE_TRANSCRIPT_BOTTOM_PADDING: u16 = 6;
786    pub const INLINE_PREVIEW_MAX_CHARS: usize = 56;
787    pub const INLINE_PREVIEW_ELLIPSIS: &str = "…";
788    pub const HEADER_HIGHLIGHT_PREVIEW_MAX_CHARS: usize = 48;
789    pub const INLINE_AGENT_MESSAGE_LEFT_PADDING: &str = "";
790    pub const INLINE_AGENT_QUOTE_PREFIX: &str = "";
791    pub const INLINE_USER_MESSAGE_DIVIDER_SYMBOL: &str = "─";
792
793    /// Scroll percentage format in status bar
794    pub const SCROLL_INDICATOR_FORMAT: &str = "↕";
795    /// Show scroll percentage in status bar
796    pub const SCROLL_INDICATOR_ENABLED: bool = true;
797
798    pub const INLINE_BLOCK_TOP_LEFT: &str = "â•­";
799    pub const INLINE_BLOCK_TOP_RIGHT: &str = "â•®";
800    pub const INLINE_BLOCK_BODY_LEFT: &str = "│";
801    pub const INLINE_BLOCK_BODY_RIGHT: &str = "│";
802    pub const INLINE_BLOCK_BOTTOM_LEFT: &str = "â•°";
803    pub const INLINE_BLOCK_BOTTOM_RIGHT: &str = "╯";
804    pub const INLINE_BLOCK_HORIZONTAL: &str = "─";
805    pub const INLINE_TOOL_HEADER_LABEL: &str = "Tool";
806    pub const INLINE_TOOL_ACTION_PREFIX: &str = "→";
807    pub const INLINE_TOOL_DETAIL_PREFIX: &str = "↳";
808    pub const INLINE_PTY_HEADER_LABEL: &str = "Terminal";
809    pub const INLINE_PTY_RUNNING_LABEL: &str = "running";
810    pub const INLINE_PTY_STATUS_LIVE: &str = "LIVE";
811    pub const INLINE_PTY_STATUS_DONE: &str = "DONE";
812    pub const INLINE_PTY_PLACEHOLDER: &str = "Terminal output";
813    pub const MODAL_LIST_HIGHLIGHT_SYMBOL: &str = "✦";
814    pub const MODAL_LIST_HIGHLIGHT_FULL: &str = "✦ ";
815    pub const MODAL_LIST_SUMMARY_FILTER_LABEL: &str = "Filter";
816    pub const MODAL_LIST_SUMMARY_SEPARATOR: &str = " • ";
817    pub const MODAL_LIST_SUMMARY_MATCHES_LABEL: &str = "Matches";
818    pub const MODAL_LIST_SUMMARY_TOTAL_LABEL: &str = "of";
819    pub const MODAL_LIST_SUMMARY_NO_MATCHES: &str = "No matches";
820    pub const MODAL_LIST_SUMMARY_RESET_HINT: &str = "Press Esc to reset";
821    pub const MODAL_LIST_NO_RESULTS_MESSAGE: &str = "No matching options";
822    pub const HEADER_VERSION_PROMPT: &str = "> ";
823    pub const HEADER_VERSION_PREFIX: &str = "VT Code";
824    pub const HEADER_VERSION_LEFT_DELIMITER: &str = "(";
825    pub const HEADER_VERSION_RIGHT_DELIMITER: &str = ")";
826    pub const HEADER_MODE_INLINE: &str = "Inline session";
827    pub const HEADER_MODE_ALTERNATE: &str = "Alternate session";
828    pub const HEADER_MODE_AUTO: &str = "Auto session";
829    pub const HEADER_MODE_FULL_AUTO_SUFFIX: &str = " (full)";
830    pub const HEADER_MODE_PRIMARY_SEPARATOR: &str = " | ";
831    pub const HEADER_MODE_SECONDARY_SEPARATOR: &str = " | ";
832    pub const HEADER_PROVIDER_PREFIX: &str = "Provider: ";
833    pub const HEADER_MODEL_PREFIX: &str = "Model: ";
834    pub const HEADER_REASONING_PREFIX: &str = "Reasoning effort: ";
835    pub const HEADER_TRUST_PREFIX: &str = "Trust: ";
836    pub const HEADER_TOOLS_PREFIX: &str = "Tools: ";
837    pub const HEADER_MCP_PREFIX: &str = "MCP: ";
838    pub const HEADER_GIT_PREFIX: &str = "git: ";
839    pub const HEADER_GIT_CLEAN_SUFFIX: &str = "✓";
840    pub const HEADER_GIT_DIRTY_SUFFIX: &str = "*";
841    pub const HEADER_UNKNOWN_PLACEHOLDER: &str = "unavailable";
842    pub const HEADER_STATUS_LABEL: &str = "Status";
843    pub const HEADER_STATUS_ACTIVE: &str = "Active";
844    pub const HEADER_STATUS_PAUSED: &str = "Paused";
845    pub const HEADER_MESSAGES_LABEL: &str = "Messages";
846    pub const HEADER_INPUT_LABEL: &str = "Input";
847    pub const HEADER_INPUT_ENABLED: &str = "Enabled";
848    pub const HEADER_INPUT_DISABLED: &str = "Disabled";
849    pub const INLINE_USER_PREFIX: &str = " ";
850    pub const CHAT_INPUT_PLACEHOLDER_BOOTSTRAP: &str =
851        "Implement {feature} in {file} (@files, #prompts, /commands)";
852    pub const CHAT_INPUT_PLACEHOLDER_FOLLOW_UP: &str =
853        "Build something (@files, #prompts, /commands or Shift+Tab to switch to modes)";
854    pub const HEADER_SHORTCUT_HINT: &str = "Shortcuts: Enter=submit | Shift+Enter=newline | Ctrl/Cmd+Enter=queue | Esc=cancel | Ctrl+C=interrupt | @=file picker | #=custom prompts | /=slash commands";
855    pub const HEADER_META_SEPARATOR: &str = "   ";
856    pub const WELCOME_TEXT_WIDTH: usize = 80;
857    pub const WELCOME_SHORTCUT_SECTION_TITLE: &str = "Keyboard Shortcuts";
858    pub const WELCOME_SHORTCUT_HINT_PREFIX: &str = "Shortcuts:";
859    pub const WELCOME_SHORTCUT_SEPARATOR: &str = "•";
860    pub const WELCOME_SHORTCUT_INDENT: &str = "  ";
861    pub const WELCOME_SLASH_COMMAND_SECTION_TITLE: &str = "Slash Commands";
862    pub const WELCOME_SLASH_COMMAND_LIMIT: usize = 6;
863    pub const WELCOME_SLASH_COMMAND_PREFIX: &str = "/";
864    pub const WELCOME_SLASH_COMMAND_INTRO: &str = "";
865    pub const WELCOME_SLASH_COMMAND_INDENT: &str = "  ";
866    pub const NAVIGATION_BLOCK_TITLE: &str = "Timeline";
867    pub const NAVIGATION_BLOCK_SHORTCUT_NOTE: &str = "Ctrl+T";
868    pub const NAVIGATION_EMPTY_LABEL: &str = "Waiting for activity";
869    pub const NAVIGATION_INDEX_PREFIX: &str = "#";
870    pub const NAVIGATION_LABEL_AGENT: &str = "Agent";
871    pub const NAVIGATION_LABEL_ERROR: &str = "Error";
872    pub const NAVIGATION_LABEL_INFO: &str = "Info";
873    pub const NAVIGATION_LABEL_POLICY: &str = "Policy";
874    pub const NAVIGATION_LABEL_TOOL: &str = "Tool";
875    pub const NAVIGATION_LABEL_USER: &str = "User";
876    pub const NAVIGATION_LABEL_PTY: &str = "PTY";
877    pub const PLAN_BLOCK_TITLE: &str = "TODOs";
878    pub const PLAN_STATUS_EMPTY: &str = "No TODOs";
879    pub const PLAN_STATUS_IN_PROGRESS: &str = "In progress";
880    pub const PLAN_STATUS_DONE: &str = "Done";
881    pub const PLAN_IN_PROGRESS_NOTE: &str = "in progress";
882    pub const SUGGESTION_BLOCK_TITLE: &str = "Slash Commands";
883    pub const STATUS_LINE_MODE: &str = "auto";
884    pub const STATUS_LINE_REFRESH_INTERVAL_MS: u64 = 1000;
885    pub const STATUS_LINE_COMMAND_TIMEOUT_MS: u64 = 200;
886
887    // TUI tick rate constants for smooth scrolling
888    /// Tick rate (Hz) when user is actively interacting with the TUI
889    pub const TUI_ACTIVE_TICK_RATE_HZ: f64 = 16.0;
890    /// Tick rate (Hz) when TUI is idle to save CPU
891    pub const TUI_IDLE_TICK_RATE_HZ: f64 = 4.0;
892    /// Duration (ms) to remain in active mode after last input
893    pub const TUI_ACTIVE_TIMEOUT_MS: u64 = 500;
894
895    // Theme and color constants
896    pub const THEME_MIN_CONTRAST_RATIO: f64 = 4.5;
897    pub const THEME_FOREGROUND_LIGHTEN_RATIO: f64 = 0.25;
898    pub const THEME_SECONDARY_LIGHTEN_RATIO: f64 = 0.2;
899    pub const THEME_MIX_RATIO: f64 = 0.35;
900    pub const THEME_TOOL_BODY_MIX_RATIO: f64 = 0.35;
901    pub const THEME_TOOL_BODY_LIGHTEN_RATIO: f64 = 0.2;
902    pub const THEME_RESPONSE_COLOR_LIGHTEN_RATIO: f64 = 0.15;
903    pub const THEME_REASONING_COLOR_LIGHTEN_RATIO: f64 = 0.3;
904    pub const THEME_USER_COLOR_LIGHTEN_RATIO: f64 = 0.2;
905    pub const THEME_SECONDARY_USER_COLOR_LIGHTEN_RATIO: f64 = 0.4;
906    pub const THEME_PRIMARY_STATUS_LIGHTEN_RATIO: f64 = 0.35;
907    pub const THEME_PRIMARY_STATUS_SECONDARY_LIGHTEN_RATIO: f64 = 0.5;
908    pub const THEME_LOGO_ACCENT_BANNER_LIGHTEN_RATIO: f64 = 0.35;
909    pub const THEME_LOGO_ACCENT_BANNER_SECONDARY_LIGHTEN_RATIO: f64 = 0.25;
910
911    // UI Color constants
912    pub const THEME_COLOR_WHITE_RED: u8 = 0xFF;
913    pub const THEME_COLOR_WHITE_GREEN: u8 = 0xFF;
914    pub const THEME_COLOR_WHITE_BLUE: u8 = 0xFF;
915    pub const THEME_MIX_RATIO_MIN: f64 = 0.0;
916    pub const THEME_MIX_RATIO_MAX: f64 = 1.0;
917    pub const THEME_BLEND_CLAMP_MIN: f64 = 0.0;
918    pub const THEME_BLEND_CLAMP_MAX: f64 = 255.0;
919
920    // WCAG contrast algorithm constants
921    pub const THEME_RELATIVE_LUMINANCE_CUTOFF: f64 = 0.03928;
922    pub const THEME_RELATIVE_LUMINANCE_LOW_FACTOR: f64 = 12.92;
923    pub const THEME_RELATIVE_LUMINANCE_OFFSET: f64 = 0.055;
924    pub const THEME_RELATIVE_LUMINANCE_EXPONENT: f64 = 2.4;
925    pub const THEME_CONTRAST_RATIO_OFFSET: f64 = 0.05;
926    pub const THEME_RED_LUMINANCE_COEFFICIENT: f64 = 0.2126;
927    pub const THEME_GREEN_LUMINANCE_COEFFICIENT: f64 = 0.7152;
928    pub const THEME_BLUE_LUMINANCE_COEFFICIENT: f64 = 0.0722;
929    pub const THEME_LUMINANCE_LIGHTEN_RATIO: f64 = 0.2;
930}
931
932/// Reasoning effort configuration constants
933pub mod reasoning {
934    pub const LOW: &str = "low";
935    pub const MEDIUM: &str = "medium";
936    pub const HIGH: &str = "high";
937    pub const ALLOWED_LEVELS: &[&str] = &["minimal", LOW, MEDIUM, HIGH, "xhigh"];
938    pub const LABEL_LOW: &str = "Low";
939    pub const LABEL_MEDIUM: &str = "Medium";
940    pub const LABEL_HIGH: &str = "High";
941    pub const DESCRIPTION_LOW: &str = "Fast responses with lightweight reasoning.";
942    pub const DESCRIPTION_MEDIUM: &str = "Balanced depth and speed for general tasks. (Note: May not be fully available for all models including Gemini 3 Pro)";
943    pub const DESCRIPTION_HIGH: &str = "Maximum reasoning depth for complex problems.";
944}
945
946/// Message role constants to avoid hardcoding strings
947pub mod message_roles {
948    pub const SYSTEM: &str = "system";
949    pub const USER: &str = "user";
950    pub const ASSISTANT: &str = "assistant";
951    pub const TOOL: &str = "tool";
952}
953
954/// URL constants for API endpoints
955pub mod urls {
956    pub const GEMINI_API_BASE: &str = "https://generativelanguage.googleapis.com/v1beta";
957    pub const OPENAI_API_BASE: &str = "https://api.openai.com/v1";
958    pub const HUGGINGFACE_API_BASE: &str = "https://router.huggingface.co/v1";
959    pub const ANTHROPIC_API_BASE: &str = "https://api.anthropic.com/v1";
960    pub const ANTHROPIC_API_VERSION: &str = "2023-06-01";
961    pub const MINIMAX_API_BASE: &str = "https://api.minimax.io/anthropic";
962    pub const OPENROUTER_API_BASE: &str = "https://openrouter.ai/api/v1";
963    pub const XAI_API_BASE: &str = "https://api.x.ai/v1";
964    pub const DEEPSEEK_API_BASE: &str = "https://api.deepseek.com/v1";
965    pub const Z_AI_API_BASE: &str = "https://api.z.ai/api/paas/v4";
966    pub const MOONSHOT_API_BASE: &str = "https://api.moonshot.cn/v1";
967    pub const LMSTUDIO_API_BASE: &str = "http://localhost:1234/v1";
968    pub const OLLAMA_API_BASE: &str = "http://localhost:11434";
969    pub const OLLAMA_CLOUD_API_BASE: &str = "https://ollama.com";
970}
971
972/// Environment variable names for overriding provider base URLs
973pub mod env_vars {
974    pub const GEMINI_BASE_URL: &str = "GEMINI_BASE_URL";
975    pub const OPENAI_BASE_URL: &str = "OPENAI_BASE_URL";
976    pub const HUGGINGFACE_BASE_URL: &str = "HUGGINGFACE_BASE_URL";
977    pub const ANTHROPIC_BASE_URL: &str = "ANTHROPIC_BASE_URL";
978    pub const OPENROUTER_BASE_URL: &str = "OPENROUTER_BASE_URL";
979    pub const XAI_BASE_URL: &str = "XAI_BASE_URL";
980    pub const DEEPSEEK_BASE_URL: &str = "DEEPSEEK_BASE_URL";
981    pub const Z_AI_BASE_URL: &str = "ZAI_BASE_URL";
982    pub const MOONSHOT_BASE_URL: &str = "MOONSHOT_BASE_URL";
983    pub const LMSTUDIO_BASE_URL: &str = "LMSTUDIO_BASE_URL";
984    pub const OLLAMA_BASE_URL: &str = "OLLAMA_BASE_URL";
985    pub const MINIMAX_BASE_URL: &str = "MINIMAX_BASE_URL";
986}
987
988/// HTTP header constants for provider integrations
989pub mod headers {
990    pub const ACCEPT_LANGUAGE: &str = "Accept-Language";
991    pub const ACCEPT_LANGUAGE_DEFAULT: &str = "en-US,en";
992}
993
994/// Tool name constants to avoid hardcoding strings throughout the codebase
995pub mod tools {
996    // ============================================================
997    // UNIFIED TOOLS (Primary Interface)
998    // ============================================================
999    /// Unified search & discovery tool (aliases: grep_file, list_files, code_intelligence, etc.)
1000    pub const UNIFIED_SEARCH: &str = "unified_search";
1001    /// Unified shell execution & code execution tool (aliases: run_pty_cmd, execute_code, etc.)
1002    pub const UNIFIED_EXEC: &str = "unified_exec";
1003    /// Unified file operations tool (aliases: read_file, write_file, edit_file, etc.)
1004    pub const UNIFIED_FILE: &str = "unified_file";
1005
1006    // ============================================================
1007    // SKILL MANAGEMENT TOOLS (Progressive Disclosure)
1008    // ============================================================
1009    /// List all available skills (local and dormant system utilities)
1010    pub const LIST_SKILLS: &str = "list_skills";
1011    /// Load a skill's instructions and activate its tools
1012    pub const LOAD_SKILL: &str = "load_skill";
1013    /// Load resources from a skill (scripts, templates, docs)
1014    pub const LOAD_SKILL_RESOURCE: &str = "load_skill_resource";
1015
1016    // ============================================================
1017    // AGENT CONTROL TOOLS (Delegation)
1018    // ============================================================
1019    /// Spawn a subagent for specialized tasks (explore, plan, general, etc.)
1020    pub const SPAWN_SUBAGENT: &str = "spawn_subagent";
1021
1022    // ============================================================
1023    // LEGACY SEARCH ALIASES (use unified_search instead)
1024    // ============================================================
1025    pub const GREP_FILE: &str = "grep_file";
1026    pub const LIST_FILES: &str = "list_files";
1027    pub const CODE_INTELLIGENCE: &str = "code_intelligence";
1028    pub const SEARCH_TOOLS: &str = "search_tools";
1029    pub const SKILL: &str = "skill";
1030    pub const AGENT_INFO: &str = "agent_info";
1031    pub const WEB_FETCH: &str = "web_fetch";
1032    pub const SEARCH: &str = "search";
1033    pub const FIND: &str = "find";
1034
1035    // ============================================================
1036    // LEGACY EXECUTION ALIASES (use unified_exec instead)
1037    // ============================================================
1038    pub const RUN_PTY_CMD: &str = "run_pty_cmd";
1039    pub const CREATE_PTY_SESSION: &str = "create_pty_session";
1040    pub const LIST_PTY_SESSIONS: &str = "list_pty_sessions";
1041    pub const CLOSE_PTY_SESSION: &str = "close_pty_session";
1042    pub const SEND_PTY_INPUT: &str = "send_pty_input";
1043    pub const READ_PTY_SESSION: &str = "read_pty_session";
1044    pub const RESIZE_PTY_SESSION: &str = "resize_pty_session";
1045    pub const EXECUTE_CODE: &str = "execute_code";
1046    pub const EXEC_PTY_CMD: &str = "exec_pty_cmd";
1047    pub const EXEC: &str = "exec";
1048    pub const SHELL: &str = "shell";
1049
1050    // ============================================================
1051    // LEGACY FILE OPERATION ALIASES (use unified_file instead)
1052    // ============================================================
1053    pub const READ_FILE: &str = "read_file";
1054    pub const WRITE_FILE: &str = "write_file";
1055    pub const EDIT_FILE: &str = "edit_file";
1056    pub const DELETE_FILE: &str = "delete_file";
1057    pub const CREATE_FILE: &str = "create_file";
1058    pub const APPLY_PATCH: &str = "apply_patch";
1059    pub const SEARCH_REPLACE: &str = "search_replace";
1060    pub const FILE_OP: &str = "file_op";
1061    pub const MOVE_FILE: &str = "move_file";
1062    pub const COPY_FILE: &str = "copy_file";
1063
1064    // ============================================================
1065    // ERROR & DIAGNOSTICS
1066    // ============================================================
1067    pub const GET_ERRORS: &str = "get_errors";
1068
1069    // ============================================================
1070    // HUMAN-IN-THE-LOOP (HITL)
1071    // ============================================================
1072    /// Ask the human a question via the interactive UI (TUI) and return the selection.
1073    pub const ASK_USER_QUESTION: &str = "ask_user_question";
1074
1075    // ============================================================
1076    // PLAN MODE
1077    // ============================================================
1078    /// Enter plan mode - enables read-only tools and planning workflow.
1079    pub const ENTER_PLAN_MODE: &str = "enter_plan_mode";
1080    /// Exit plan mode - triggers confirmation modal before execution.
1081    pub const EXIT_PLAN_MODE: &str = "exit_plan_mode";
1082
1083    // Special wildcard for full access
1084    pub const WILDCARD_ALL: &str = "*";
1085}
1086
1087/// Bash tool security validation constants
1088pub mod bash {
1089    /// Commands that are always blocked for security reasons
1090    pub const ALWAYS_BLOCKED_COMMANDS: &[&str] = &[
1091        "rm",
1092        "rmdir",
1093        "del",
1094        "format",
1095        "fdisk",
1096        "mkfs",
1097        "dd",
1098        "shred",
1099        "wipe",
1100        "srm",
1101        "unlink",
1102        "chmod",
1103        "chown",
1104        "passwd",
1105        "usermod",
1106        "userdel",
1107        "systemctl",
1108        "service",
1109        "kill",
1110        "killall",
1111        "pkill",
1112        "reboot",
1113        "shutdown",
1114        "halt",
1115        "poweroff",
1116        "sudo",
1117        "su",
1118        "doas",
1119        "runas",
1120        "mount",
1121        "umount",
1122        "fsck",
1123        "tune2fs", // Filesystem operations
1124        "iptables",
1125        "ufw",
1126        "firewalld", // Firewall
1127        "crontab",
1128        "at", // Scheduling
1129        "podman",
1130        "kubectl", // Container/orchestration
1131    ];
1132
1133    /// Network commands that require sandbox to be enabled
1134    pub const NETWORK_COMMANDS: &[&str] = &[
1135        "wget", "ftp", "scp", "rsync", "ssh", "telnet", "nc", "ncat", "socat",
1136    ];
1137
1138    /// Commands that are always allowed (safe development tools)
1139    pub const ALLOWED_COMMANDS: &[&str] = &[
1140        // File system and basic utilities
1141        "ls",
1142        "pwd",
1143        "cat",
1144        "head",
1145        "tail",
1146        "grep",
1147        "find",
1148        "wc",
1149        "sort",
1150        "uniq",
1151        "cut",
1152        "awk",
1153        "sed",
1154        "echo",
1155        "printf",
1156        "seq",
1157        "basename",
1158        "dirname",
1159        "date",
1160        "cal",
1161        "bc",
1162        "expr",
1163        "test",
1164        "[",
1165        "]",
1166        "true",
1167        "false",
1168        "sleep",
1169        "which",
1170        "type",
1171        "file",
1172        "stat",
1173        "du",
1174        "df",
1175        "ps",
1176        "top",
1177        "htop",
1178        "tree",
1179        "less",
1180        "more",
1181        "tac",
1182        "rev",
1183        "tr",
1184        "fold",
1185        "paste",
1186        "join",
1187        "comm",
1188        "diff",
1189        "patch",
1190        "gzip",
1191        "gunzip",
1192        "bzip2",
1193        "bunzip2",
1194        "xz",
1195        "unxz",
1196        "tar",
1197        "zip",
1198        "unzip",
1199        "shasum",
1200        "md5sum",
1201        "sha256sum",
1202        "sha512sum", // Hashing tools
1203        // Version control
1204        "git",
1205        "hg",
1206        "svn",
1207        "git-lfs",
1208        // Build systems and tools
1209        "make",
1210        "cmake",
1211        "ninja",
1212        "meson",
1213        "bazel",
1214        "buck2",
1215        "scons",
1216        "waf",
1217        "xcodebuild",
1218        // Rust/Cargo ecosystem
1219        "cargo",
1220        "rustc",
1221        "rustfmt",
1222        "rustup",
1223        "clippy",
1224        "cargo-clippy",
1225        "cargo-fmt",
1226        "cargo-build",
1227        "cargo-test",
1228        "cargo-run",
1229        "cargo-check",
1230        "cargo-doc",
1231        // Node.js/npm ecosystem
1232        "npm",
1233        "yarn",
1234        "pnpm",
1235        "bun",
1236        "npx",
1237        "node",
1238        "yarnpkg",
1239        "npm-run",
1240        "npm-test",
1241        "npm-start",
1242        "npm-build",
1243        "npm-lint",
1244        "npm-install",
1245        "yarn-test",
1246        "yarn-start",
1247        "yarn-build",
1248        "yarn-lint",
1249        "yarn-install",
1250        "pnpm-test",
1251        "pnpm-start",
1252        "pnpm-build",
1253        "pnpm-lint",
1254        "pnpm-install",
1255        "bun-test",
1256        "bun-start",
1257        "bun-build",
1258        "bun-lint",
1259        "bun-install",
1260        "bun-run",
1261        // Python ecosystem
1262        "python",
1263        "python3",
1264        "pip",
1265        "pip3",
1266        "virtualenv",
1267        "venv",
1268        "conda",
1269        "pytest",
1270        "python-m-pytest",
1271        "python3-m-pytest",
1272        "python-m-pip",
1273        "python3-m-pip",
1274        "python-m-venv",
1275        "python3-m-venv",
1276        "black",
1277        "flake8",
1278        "mypy",
1279        "pylint",
1280        "isort",
1281        "ruff",
1282        "bandit",
1283        // Java ecosystem
1284        "java",
1285        "javac",
1286        "jar",
1287        "jarsigner",
1288        "javadoc",
1289        "jmap",
1290        "jstack",
1291        "jstat",
1292        "jinfo",
1293        "mvn",
1294        "gradle",
1295        "gradlew",
1296        "./gradlew",
1297        "mvnw",
1298        "./mvnw",
1299        "mvn-test",
1300        "mvn-compile",
1301        "mvn-package",
1302        "mvn-install",
1303        "mvn-clean",
1304        "gradle-test",
1305        "gradle-build",
1306        "gradle-check",
1307        "gradle-run",
1308        "gradle-clean",
1309        // Go ecosystem
1310        "go",
1311        "gofmt",
1312        "goimports",
1313        "golint",
1314        "go-test",
1315        "go-build",
1316        "go-run",
1317        "go-mod",
1318        "golangci-lint",
1319        "go-doc",
1320        "go-vet",
1321        "go-install",
1322        "go-clean",
1323        // C/C++ ecosystem
1324        "gcc",
1325        "g++",
1326        "clang",
1327        "clang++",
1328        "clang-cl",
1329        "cpp",
1330        "cc",
1331        "c++",
1332        "gcc-ar",
1333        "gcc-nm",
1334        "gcc-ranlib",
1335        "ld",
1336        "lld",
1337        "gold",
1338        "bfdld",
1339        "make",
1340        "cmake",
1341        "ninja",
1342        "autotools",
1343        "autoconf",
1344        "automake",
1345        "libtool",
1346        "pkg-config",
1347        "pkgconfig",
1348        // Testing frameworks and tools
1349        "pytest",
1350        "jest",
1351        "mocha",
1352        "jasmine",
1353        "karma",
1354        "chai",
1355        "sinon",
1356        "vitest",
1357        "cypress",
1358        "selenium",
1359        "playwright",
1360        "testcafe",
1361        "tape",
1362        "ava",
1363        "qunit",
1364        "junit",
1365        "googletest",
1366        "catch2",
1367        "benchmark",
1368        "hyperfine",
1369        // Linting and formatting tools
1370        "eslint",
1371        "prettier",
1372        "tslint",
1373        "jshint",
1374        "jscs",
1375        "stylelint",
1376        "htmlhint",
1377        "jsonlint",
1378        "yamllint",
1379        "toml-check",
1380        "markdownlint",
1381        "remark-cli",
1382        "shellcheck",
1383        "hadolint",
1384        "rustfmt",
1385        "gofmt",
1386        "black",
1387        "isort",
1388        "ruff",
1389        "clang-format",
1390        "clang-tidy",
1391        // Documentation tools
1392        "doxygen",
1393        "sphinx",
1394        "mkdocs",
1395        "hugo",
1396        "jekyll",
1397        "gatsby",
1398        "next",
1399        "nuxt",
1400        "vuepress",
1401        "docusaurus",
1402        "storybook",
1403        "gitbook",
1404        "readthedocs",
1405        "pandoc",
1406        "mdbook",
1407        "mdBook",
1408        // Container tools (safe operations only)
1409        "docker",
1410        "docker-compose",
1411        "docker-buildx",
1412        "podman",
1413        "buildah",
1414        "docker-build",
1415        "docker-run",
1416        "docker-ps",
1417        "docker-images",
1418        "docker-inspect",
1419        "docker-exec",
1420        "docker-logs",
1421        "docker-stats",
1422        "docker-system",
1423        "docker-network",
1424        // Database tools (development usage)
1425        "sqlite3",
1426        "mysql",
1427        "psql",
1428        "mongosh",
1429        "redis-cli",
1430        "redis-server",
1431        // Cloud and deployment tools
1432        "aws",
1433        "gcloud",
1434        "az",
1435        "kubectl",
1436        "helm",
1437        "terraform",
1438        "tf",
1439        "terragrunt",
1440        "serverless",
1441        "sls",
1442        "pulumi",
1443        "cdk",
1444        "sam",
1445        "localstack",
1446        "minikube",
1447        // Security and analysis tools
1448        "gitleaks",
1449        "trivy",
1450        "snyk",
1451        "npm-audit",
1452        "pip-audit",
1453        "cargo-audit",
1454        "bandit",
1455        "safety",
1456        "pipenv",
1457        "poetry",
1458        // Performance profiling tools
1459        "perf",
1460        "strace",
1461        "ltrace",
1462        "valgrind",
1463        "gdb",
1464        "lldb",
1465        "sar",
1466        "iostat",
1467        "vmstat",
1468        "htop",
1469        "iotop",
1470        "nethogs",
1471        "iftop",
1472        "speedtest-cli",
1473        "ab",
1474        "wrk",
1475        "hey",
1476        // CI/CD tools
1477        "gh",
1478        "gitlab-ci",
1479        "bitbucket",
1480        "azure-pipelines",
1481        "circleci",
1482        "jenkins",
1483        "drone",
1484        "buildkite",
1485        "travis",
1486        "appveyor",
1487        // Package managers for various languages
1488        "composer",
1489        "pear",
1490        "gem",
1491        "rbenv",
1492        "rvm",
1493        "nvm",
1494        "nodenv",
1495        "pyenv",
1496        "rbenv",
1497        "sdkman",
1498        "jenv",
1499        "lein",
1500        "boot",
1501        "mix",
1502        "rebar3",
1503        "erl",
1504        "elixir",
1505        // Web development tools
1506        "webpack",
1507        "rollup",
1508        "vite",
1509        "parcel",
1510        "esbuild",
1511        "snowpack",
1512        "turbo",
1513        "swc",
1514        "babel",
1515        "postcss",
1516        "sass",
1517        "scss",
1518        "less",
1519        "stylus",
1520        "tailwindcss",
1521        // Mobile development tools
1522        "xcodebuild",
1523        "fastlane",
1524        "gradle",
1525        "./gradlew",
1526        "cordova",
1527        "ionic",
1528        "react-native",
1529        "flutter",
1530        "expo",
1531        "capacitor",
1532    ];
1533}
1534
1535pub mod mcp {
1536    pub const RENDERER_CONTEXT7: &str = "context7";
1537    pub const RENDERER_SEQUENTIAL_THINKING: &str = "sequential-thinking";
1538
1539    /// Default startup timeout for MCP servers in milliseconds (60 seconds)
1540    /// Can be overridden via config: mcp.startup_timeout_seconds
1541    pub const DEFAULT_STARTUP_TIMEOUT_MS: u64 = 60_000;
1542}
1543
1544pub mod project_doc {
1545    pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1546}
1547
1548pub mod instructions {
1549    pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1550}
1551
1552/// LLM generation parameters
1553pub mod llm_generation {
1554    /// Default temperature for main LLM responses (0.0-1.0)
1555    /// Controls randomness/creativity: 0=deterministic, 1=random
1556    /// 0.7 provides balanced creativity and consistency
1557    pub const DEFAULT_TEMPERATURE: f32 = 0.7;
1558
1559    /// Default temperature for prompt refinement (0.0-1.0)
1560    /// Lower than main temperature for more deterministic refinement
1561    pub const DEFAULT_REFINE_TEMPERATURE: f32 = 0.3;
1562}
1563
1564/// Context window management defaults
1565/// Context window management defaults (simplified - no token counting)
1566pub mod context {
1567    /// Head ratio percentage for code files (legacy, kept for compatibility)
1568    pub const CODE_HEAD_RATIO_PERCENT: usize = 60;
1569
1570    /// Head ratio percentage for log files (legacy, kept for compatibility)
1571    pub const LOG_HEAD_RATIO_PERCENT: usize = 20;
1572}
1573
1574/// Chunking constants for large file handling
1575pub mod chunking {
1576    /// Maximum lines before triggering chunking for read_file
1577    pub const MAX_LINES_THRESHOLD: usize = 2_000;
1578
1579    /// Number of lines to read from start of file when chunking
1580    pub const CHUNK_START_LINES: usize = 800;
1581
1582    /// Number of lines to read from end of file when chunking
1583    pub const CHUNK_END_LINES: usize = 800;
1584
1585    /// Maximum content size for write_file before chunking (in bytes)
1586    pub const MAX_WRITE_CONTENT_SIZE: usize = 500_000; // 500KB
1587
1588    /// Chunk size for write operations (in bytes)
1589    pub const WRITE_CHUNK_SIZE: usize = 50_000; // 50KB chunks
1590}
1591
1592/// Diff preview controls for file operations
1593pub mod diff {
1594    /// Maximum number of bytes allowed in diff preview inputs
1595    pub const MAX_PREVIEW_BYTES: usize = 200_000;
1596
1597    /// Number of context lines to include around changes in unified diff output
1598    pub const CONTEXT_RADIUS: usize = 3;
1599
1600    /// Maximum number of diff lines to keep in preview output before condensation
1601    pub const MAX_PREVIEW_LINES: usize = 160;
1602
1603    /// Number of leading diff lines to retain when condensing previews
1604    pub const HEAD_LINE_COUNT: usize = 96;
1605
1606    /// Number of trailing diff lines to retain when condensing previews
1607    pub const TAIL_LINE_COUNT: usize = 32;
1608
1609    /// Maximum number of files to show inline diffs for before suppression
1610    pub const MAX_INLINE_DIFF_FILES: usize = 10;
1611
1612    /// Maximum total diff lines across all files before suppression
1613    pub const MAX_TOTAL_DIFF_LINES: usize = 500;
1614
1615    /// Maximum additions + deletions in a single file before suppression
1616    pub const MAX_SINGLE_FILE_CHANGES: usize = 200;
1617
1618    /// Maximum number of files to list in suppression summary
1619    pub const MAX_FILES_IN_SUMMARY: usize = 20;
1620
1621    /// Message shown when inline diffs are suppressed
1622    pub const SUPPRESSION_MESSAGE: &str = "Inline diffs have been suppressed for recent changes because there are too many to display.";
1623
1624    /// Hint message shown with suppressed diffs
1625    pub const SUPPRESSION_HINT: &str = "Tip: Use `git diff` to view the full changes.";
1626}
1627
1628/// Memory monitoring thresholds and constants
1629pub mod memory {
1630    /// Soft memory limit in bytes (400 MB) - triggers warning and TTL reduction
1631    pub const SOFT_LIMIT_BYTES: usize = 400 * 1024 * 1024;
1632
1633    /// Hard memory limit in bytes (600 MB) - triggers aggressive eviction
1634    pub const HARD_LIMIT_BYTES: usize = 600 * 1024 * 1024;
1635
1636    /// Memory check interval in milliseconds (100 ms)
1637    pub const CHECK_INTERVAL_MS: u64 = 100;
1638
1639    /// TTL reduction factor under warning pressure (reduce from 5min to 2min)
1640    pub const WARNING_TTL_REDUCTION_FACTOR: f64 = 0.4;
1641
1642    /// TTL reduction factor under critical pressure (reduce from 5min to 30s)
1643    pub const CRITICAL_TTL_REDUCTION_FACTOR: f64 = 0.1;
1644
1645    /// Minimum RSA size to track in checkpoints (1 MB)
1646    /// Minimum RSS size to track in checkpoints (1 MiB)
1647    pub const MIN_RSS_CHECKPOINT_BYTES: usize = 1024 * 1024;
1648
1649    /// Maximum memory checkpoint history to keep
1650    pub const MAX_CHECKPOINT_HISTORY: usize = 100;
1651
1652    /// Default threshold for memory pressure report (MB)
1653    pub const DEFAULT_REPORT_THRESHOLD_MB: usize = 50;
1654}