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-sonnet-4-5-20250929", // Latest flagship model for complex agents and coding
447            "claude-haiku-4-5-20251001",  // Fastest model with near-frontier intelligence
448            "claude-opus-4-1-20250805",   // Exceptional model for specialized reasoning tasks
449            "claude-opus-4-5-20251101", // Latest flagship model with exceptional reasoning capabilities
450            "claude-sonnet-4-5",        // Alias for latest Claude Sonnet 4.5
451            "claude-haiku-4-5",         // Alias for latest Claude Haiku 4.5
452            "claude-opus-4-1",          // Alias for latest Claude Opus 4.1
453            "claude-opus-4-5",          // Alias for latest Claude Opus 4.5
454        ];
455
456        // Convenience constants for versioned models
457        pub const CLAUDE_SONNET_4_5_20250929: &str = "claude-sonnet-4-5-20250929";
458        pub const CLAUDE_HAIKU_4_5_20251001: &str = "claude-haiku-4-5-20251001";
459        pub const CLAUDE_OPUS_4_1_20250805: &str = "claude-opus-4-1-20250805";
460        pub const CLAUDE_OPUS_4_5_20251101: &str = "claude-opus-4-5-20251101";
461
462        // Convenience constants for alias models
463        pub const CLAUDE_HAIKU_4_5: &str = "claude-haiku-4-5";
464        pub const CLAUDE_SONNET_4_5: &str = "claude-sonnet-4-5";
465        pub const CLAUDE_OPUS_4_1: &str = "claude-opus-4-1";
466        pub const CLAUDE_OPUS_4_5: &str = "claude-opus-4-5";
467
468        // Legacy aliases for backwards compatibility
469        pub const CLAUDE_OPUS_4_1_20250805_LEGACY: &str = "claude-opus-4-1-20250805"; // legacy alias
470
471        /// Models that accept the reasoning effort parameter
472        pub const REASONING_MODELS: &[&str] = &[
473            CLAUDE_SONNET_4_5_20250929,
474            CLAUDE_HAIKU_4_5_20251001,
475            CLAUDE_OPUS_4_1_20250805,
476            CLAUDE_OPUS_4_5_20251101,
477            CLAUDE_SONNET_4_5,
478            CLAUDE_HAIKU_4_5,
479            CLAUDE_OPUS_4_1,
480            CLAUDE_OPUS_4_5,
481        ];
482
483        /// Interleaved thinking configuration for Anthropic models
484        pub const INTERLEAVED_THINKING_BETA: &str = "interleaved-thinking-2025-05-14";
485        pub const INTERLEAVED_THINKING_TYPE_ENABLED: &str = "enabled";
486    }
487
488    // MiniMax models (Anthropic-compatible API, standalone provider)
489    pub mod minimax {
490        pub const DEFAULT_MODEL: &str = MINIMAX_M2_1;
491        pub const SUPPORTED_MODELS: &[&str] = &[MINIMAX_M2_1, MINIMAX_M2_1_LIGHTNING, MINIMAX_M2];
492        pub const MINIMAX_M2_1: &str = "MiniMax-M2.1";
493        pub const MINIMAX_M2_1_LIGHTNING: &str = "MiniMax-M2.1-lightning";
494        pub const MINIMAX_M2: &str = "MiniMax-M2";
495    }
496
497    // xAI models
498    pub mod xai {
499        pub const DEFAULT_MODEL: &str = "grok-4";
500        pub const SUPPORTED_MODELS: &[&str] = &[
501            "grok-4",
502            "grok-4-mini",
503            "grok-4-code",
504            "grok-4-code-latest",
505            "grok-4-vision",
506            "grok-4-1-fast",
507            "grok-code-fast-1",
508            "grok-4-fast",
509            "grok-3",
510            "grok-3-mini",
511            "grok-2-1212",
512            "grok-2-vision-1212",
513            "grok-beta",
514        ];
515
516        pub const GROK_4: &str = "grok-4";
517        pub const GROK_4_MINI: &str = "grok-4-mini";
518        pub const GROK_4_CODE: &str = "grok-4-code";
519        pub const GROK_4_CODE_LATEST: &str = "grok-4-code-latest";
520        pub const GROK_4_VISION: &str = "grok-4-vision";
521        pub const GROK_4_1_FAST: &str = "grok-4-1-fast";
522        pub const GROK_CODE_FAST_1: &str = "grok-code-fast-1";
523        pub const GROK_4_FAST: &str = "grok-4-fast";
524        pub const GROK_3: &str = "grok-3";
525        pub const GROK_3_MINI: &str = "grok-3-mini";
526        pub const GROK_2_1212: &str = "grok-2-1212";
527        pub const GROK_2_VISION_1212: &str = "grok-2-vision-1212";
528        pub const GROK_BETA: &str = "grok-beta";
529    }
530
531    // Backwards compatibility - keep old constants working
532    pub const GEMINI_2_5_FLASH_PREVIEW: &str = google::GEMINI_2_5_FLASH_PREVIEW;
533    pub const GEMINI_2_5_FLASH: &str = google::GEMINI_2_5_FLASH;
534    pub const GEMINI_2_5_PRO: &str = google::GEMINI_2_5_PRO;
535    pub const GEMINI_2_5_FLASH_LITE: &str = google::GEMINI_2_5_FLASH_LITE;
536    pub const GEMINI_3_PRO_PREVIEW: &str = google::GEMINI_3_PRO_PREVIEW;
537    pub const GEMINI_3_FLASH_PREVIEW: &str = google::GEMINI_3_FLASH_PREVIEW;
538    pub const GPT_5: &str = openai::GPT_5;
539    pub const GPT_5_CODEX: &str = openai::GPT_5_CODEX;
540    pub const GPT_5_MINI: &str = openai::GPT_5_MINI;
541    pub const GPT_5_NANO: &str = openai::GPT_5_NANO;
542    pub const GPT_5_2: &str = openai::GPT_5_2;
543    pub const GPT_5_2_ALIAS: &str = openai::GPT_5_2_ALIAS;
544    pub const GPT_5_1: &str = openai::GPT_5_1;
545    pub const GPT_5_1_CODEX: &str = openai::GPT_5_1_CODEX;
546    pub const GPT_5_1_CODEX_MAX: &str = openai::GPT_5_1_CODEX_MAX;
547    pub const GPT_5_1_MINI: &str = openai::GPT_5_1_MINI;
548    pub const CODEX_MINI: &str = openai::CODEX_MINI_LATEST;
549    pub const CODEX_MINI_LATEST: &str = openai::CODEX_MINI_LATEST;
550    pub const CLAUDE_OPUS_4_1_20250805: &str = anthropic::CLAUDE_OPUS_4_1_20250805;
551    pub const CLAUDE_OPUS_4_5_20251101: &str = anthropic::CLAUDE_OPUS_4_5_20251101;
552    pub const CLAUDE_SONNET_4_5: &str = anthropic::CLAUDE_SONNET_4_5;
553    pub const CLAUDE_HAIKU_4_5: &str = anthropic::CLAUDE_HAIKU_4_5;
554    pub const CLAUDE_SONNET_4_5_20250929: &str = anthropic::CLAUDE_SONNET_4_5_20250929;
555    pub const CLAUDE_HAIKU_4_5_20251001: &str = anthropic::CLAUDE_HAIKU_4_5_20251001;
556    pub const CLAUDE_OPUS_4_1: &str = anthropic::CLAUDE_OPUS_4_1;
557    pub const CLAUDE_OPUS_4_5: &str = anthropic::CLAUDE_OPUS_4_5;
558    pub const MINIMAX_M2: &str = minimax::MINIMAX_M2;
559    pub const XAI_GROK_4: &str = xai::GROK_4;
560    pub const XAI_GROK_4_MINI: &str = xai::GROK_4_MINI;
561    pub const XAI_GROK_4_CODE: &str = xai::GROK_4_CODE;
562    pub const XAI_GROK_4_CODE_LATEST: &str = xai::GROK_4_CODE_LATEST;
563    pub const XAI_GROK_4_VISION: &str = xai::GROK_4_VISION;
564    pub const XAI_GROK_3: &str = xai::GROK_3;
565    pub const XAI_GROK_2: &str = xai::GROK_2_1212;
566    pub const XAI_GROK_BETA: &str = xai::GROK_BETA;
567    pub const DEEPSEEK_CHAT: &str = deepseek::DEEPSEEK_CHAT;
568    pub const DEEPSEEK_REASONER: &str = deepseek::DEEPSEEK_REASONER;
569    #[cfg(not(docsrs))]
570    pub const OPENROUTER_X_AI_GROK_CODE_FAST_1: &str = openrouter::X_AI_GROK_CODE_FAST_1;
571    #[cfg(docsrs)]
572    pub const OPENROUTER_X_AI_GROK_CODE_FAST_1: &str = "x-ai/grok-code-fast-1";
573    #[cfg(not(docsrs))]
574    pub const OPENROUTER_QWEN3_CODER: &str = openrouter::QWEN3_CODER;
575    #[cfg(docsrs)]
576    pub const OPENROUTER_QWEN3_CODER: &str = "qwen/qwen3-coder";
577    #[cfg(not(docsrs))]
578    pub const OPENROUTER_ANTHROPIC_CLAUDE_SONNET_4_5: &str =
579        openrouter::ANTHROPIC_CLAUDE_SONNET_4_5;
580    #[cfg(docsrs)]
581    pub const OPENROUTER_ANTHROPIC_CLAUDE_SONNET_4_5: &str = "anthropic/claude-sonnet-4.5";
582}
583
584/// Prompt caching defaults shared across features and providers
585pub mod prompt_cache {
586    pub const DEFAULT_ENABLED: bool = true;
587    pub const DEFAULT_CACHE_DIR: &str = ".vtcode/cache/prompts";
588    pub const DEFAULT_MAX_ENTRIES: usize = 1_000;
589    pub const DEFAULT_MAX_AGE_DAYS: u64 = 30;
590    pub const DEFAULT_AUTO_CLEANUP: bool = true;
591    pub const DEFAULT_MIN_QUALITY_THRESHOLD: f64 = 0.7;
592
593    pub const OPENAI_MIN_PREFIX_TOKENS: u32 = 1_024;
594    pub const GEMINI_MIN_PREFIX_TOKENS: u32 = 1_024;
595    pub const OPENAI_IDLE_EXPIRATION_SECONDS: u64 = 60 * 60; // 1 hour max reuse window
596
597    pub const ANTHROPIC_DEFAULT_TTL_SECONDS: u64 = 5 * 60; // 5 minutes
598    pub const ANTHROPIC_EXTENDED_TTL_SECONDS: u64 = 60 * 60; // 1 hour option
599    pub const ANTHROPIC_MAX_BREAKPOINTS: u8 = 4;
600
601    pub const GEMINI_EXPLICIT_DEFAULT_TTL_SECONDS: u64 = 60 * 60; // 1 hour default for explicit caches
602
603    pub const OPENROUTER_CACHE_DISCOUNT_ENABLED: bool = true;
604    pub const XAI_CACHE_ENABLED: bool = true;
605    pub const DEEPSEEK_CACHE_ENABLED: bool = true;
606    pub const ZAI_CACHE_ENABLED: bool = false;
607    pub const MOONSHOT_CACHE_ENABLED: bool = true;
608}
609
610/// Model validation and helper functions
611pub mod model_helpers {
612    use super::models;
613
614    /// Get supported models for a provider
615    pub fn supported_for(provider: &str) -> Option<&'static [&'static str]> {
616        match provider {
617            "google" | "gemini" => Some(models::google::SUPPORTED_MODELS),
618            "openai" => Some(models::openai::SUPPORTED_MODELS),
619            "anthropic" => Some(models::anthropic::SUPPORTED_MODELS),
620            "minimax" => Some(models::minimax::SUPPORTED_MODELS),
621            "deepseek" => Some(models::deepseek::SUPPORTED_MODELS),
622            #[cfg(not(docsrs))]
623            "openrouter" => Some(models::openrouter::SUPPORTED_MODELS),
624            #[cfg(docsrs)]
625            "openrouter" => Some(&[]),
626            "moonshot" => Some(models::moonshot::SUPPORTED_MODELS),
627            "xai" => Some(models::xai::SUPPORTED_MODELS),
628            "zai" => Some(models::zai::SUPPORTED_MODELS),
629            "ollama" => Some(models::ollama::SUPPORTED_MODELS),
630            _ => None,
631        }
632    }
633
634    /// Get default model for a provider
635    pub fn default_for(provider: &str) -> Option<&'static str> {
636        match provider {
637            "google" | "gemini" => Some(models::google::DEFAULT_MODEL),
638            "openai" => Some(models::openai::DEFAULT_MODEL),
639            "anthropic" => Some(models::anthropic::DEFAULT_MODEL),
640            "minimax" => Some(models::minimax::DEFAULT_MODEL),
641            "deepseek" => Some(models::deepseek::DEFAULT_MODEL),
642            #[cfg(not(docsrs))]
643            "openrouter" => Some(models::openrouter::DEFAULT_MODEL),
644            #[cfg(docsrs)]
645            "openrouter" => Some("openrouter/auto"), // Fallback for docs.rs build
646            "xai" => Some(models::xai::DEFAULT_MODEL),
647            "zai" => Some(models::zai::DEFAULT_MODEL),
648            "ollama" => Some(models::ollama::DEFAULT_MODEL),
649            _ => None,
650        }
651    }
652
653    /// Validate if a model is supported by a provider
654    pub fn is_valid(provider: &str, model: &str) -> bool {
655        supported_for(provider)
656            .map(|list| list.contains(&model))
657            .unwrap_or(false)
658    }
659}
660
661/// Environment variable names shared across the application.
662pub mod env {
663    /// Agent Client Protocol specific environment keys
664    pub mod acp {
665        #[derive(Debug, Clone, Copy)]
666        pub enum AgentClientProtocolEnvKey {
667            Enabled,
668            ZedEnabled,
669            ZedToolsReadFileEnabled,
670            ZedToolsListFilesEnabled,
671            ZedWorkspaceTrust,
672        }
673
674        impl AgentClientProtocolEnvKey {
675            pub fn as_str(self) -> &'static str {
676                match self {
677                    Self::Enabled => "VT_ACP_ENABLED",
678                    Self::ZedEnabled => "VT_ACP_ZED_ENABLED",
679                    Self::ZedToolsReadFileEnabled => "VT_ACP_ZED_TOOLS_READ_FILE_ENABLED",
680                    Self::ZedToolsListFilesEnabled => "VT_ACP_ZED_TOOLS_LIST_FILES_ENABLED",
681                    Self::ZedWorkspaceTrust => "VT_ACP_ZED_WORKSPACE_TRUST",
682                }
683            }
684        }
685    }
686}
687
688/// Default configuration values
689pub mod defaults {
690    use super::{models, ui};
691
692    pub const DEFAULT_MODEL: &str = models::openai::DEFAULT_MODEL;
693    pub const DEFAULT_CLI_MODEL: &str = models::openai::DEFAULT_MODEL;
694    pub const DEFAULT_PROVIDER: &str = "openai";
695    pub const DEFAULT_API_KEY_ENV: &str = "OPENAI_API_KEY";
696    pub const DEFAULT_THEME: &str = "ciapre-dark";
697    pub const DEFAULT_FULL_AUTO_MAX_TURNS: usize = 30;
698    pub const DEFAULT_MAX_TOOL_LOOPS: usize = 200;
699    pub const DEFAULT_MAX_REPEATED_TOOL_CALLS: usize = 3;
700    pub const DEFAULT_PTY_STDOUT_TAIL_LINES: usize = 20;
701    pub const DEFAULT_PTY_SCROLLBACK_LINES: usize = 400;
702    pub const DEFAULT_TOOL_OUTPUT_MODE: &str = ui::TOOL_OUTPUT_MODE_COMPACT;
703
704    pub const DEFAULT_PTY_OUTPUT_MAX_TOKENS: usize = 8_000;
705
706    /// Byte fuse for PTY output - secondary safeguard after token truncation.
707    /// Protects against edge cases where token estimation underestimates size.
708    pub const DEFAULT_PTY_OUTPUT_BYTE_FUSE: usize = 40 * 1024; // 40 KiB
709}
710
711pub mod ui {
712    pub const TOOL_OUTPUT_MODE_COMPACT: &str = "compact";
713    pub const TOOL_OUTPUT_MODE_FULL: &str = "full";
714    pub const DEFAULT_INLINE_VIEWPORT_ROWS: u16 = 16;
715    pub const SLASH_SUGGESTION_LIMIT: usize = 50; // All commands are scrollable
716    pub const SLASH_PALETTE_MIN_WIDTH: u16 = 40;
717    pub const SLASH_PALETTE_MIN_HEIGHT: u16 = 9;
718    pub const SLASH_PALETTE_HORIZONTAL_MARGIN: u16 = 8;
719    pub const SLASH_PALETTE_TOP_OFFSET: u16 = 3;
720    pub const SLASH_PALETTE_CONTENT_PADDING: u16 = 6;
721    pub const SLASH_PALETTE_HINT_PRIMARY: &str = "Type to filter slash commands.";
722    pub const SLASH_PALETTE_HINT_SECONDARY: &str = "Press Enter to apply • Esc to dismiss.";
723    pub const MODAL_MIN_WIDTH: u16 = 36;
724    pub const MODAL_MIN_HEIGHT: u16 = 9;
725    pub const MODAL_LIST_MIN_HEIGHT: u16 = 12;
726    pub const MODAL_WIDTH_RATIO: f32 = 0.6;
727    pub const MODAL_HEIGHT_RATIO: f32 = 0.6;
728    pub const MODAL_MAX_WIDTH_RATIO: f32 = 0.9;
729    pub const MODAL_MAX_HEIGHT_RATIO: f32 = 0.8;
730    pub const MODAL_CONTENT_HORIZONTAL_PADDING: u16 = 8;
731    pub const MODAL_CONTENT_VERTICAL_PADDING: u16 = 6;
732    pub const MODAL_INSTRUCTIONS_TITLE: &str = "";
733    pub const MODAL_INSTRUCTIONS_BULLET: &str = "•";
734    pub const INLINE_HEADER_HEIGHT: u16 = 3;
735    pub const INLINE_INPUT_HEIGHT: u16 = 4;
736    pub const INLINE_INPUT_MAX_LINES: usize = 10;
737    pub const INLINE_NAVIGATION_PERCENT: u16 = 28;
738    pub const INLINE_NAVIGATION_MIN_WIDTH: u16 = 24;
739    pub const INLINE_CONTENT_MIN_WIDTH: u16 = 48;
740    pub const INLINE_STACKED_NAVIGATION_PERCENT: u16 = INLINE_NAVIGATION_PERCENT;
741    pub const INLINE_SCROLLBAR_EDGE_PADDING: u16 = 1;
742    pub const INLINE_TRANSCRIPT_BOTTOM_PADDING: u16 = 6;
743    pub const INLINE_PREVIEW_MAX_CHARS: usize = 56;
744    pub const INLINE_PREVIEW_ELLIPSIS: &str = "…";
745    pub const HEADER_HIGHLIGHT_PREVIEW_MAX_CHARS: usize = 48;
746    pub const INLINE_AGENT_MESSAGE_LEFT_PADDING: &str = "";
747    pub const INLINE_AGENT_QUOTE_PREFIX: &str = "";
748    pub const INLINE_USER_MESSAGE_DIVIDER_SYMBOL: &str = "─";
749
750    /// Scroll percentage format in status bar
751    pub const SCROLL_INDICATOR_FORMAT: &str = "↕";
752    /// Show scroll percentage in status bar
753    pub const SCROLL_INDICATOR_ENABLED: bool = true;
754
755    pub const INLINE_BLOCK_TOP_LEFT: &str = "â•­";
756    pub const INLINE_BLOCK_TOP_RIGHT: &str = "â•®";
757    pub const INLINE_BLOCK_BODY_LEFT: &str = "│";
758    pub const INLINE_BLOCK_BODY_RIGHT: &str = "│";
759    pub const INLINE_BLOCK_BOTTOM_LEFT: &str = "â•°";
760    pub const INLINE_BLOCK_BOTTOM_RIGHT: &str = "╯";
761    pub const INLINE_BLOCK_HORIZONTAL: &str = "─";
762    pub const INLINE_TOOL_HEADER_LABEL: &str = "Tool";
763    pub const INLINE_TOOL_ACTION_PREFIX: &str = "→";
764    pub const INLINE_TOOL_DETAIL_PREFIX: &str = "↳";
765    pub const INLINE_PTY_HEADER_LABEL: &str = "Terminal";
766    pub const INLINE_PTY_RUNNING_LABEL: &str = "running";
767    pub const INLINE_PTY_STATUS_LIVE: &str = "LIVE";
768    pub const INLINE_PTY_STATUS_DONE: &str = "DONE";
769    pub const INLINE_PTY_PLACEHOLDER: &str = "Terminal output";
770    pub const MODAL_LIST_HIGHLIGHT_SYMBOL: &str = "✦";
771    pub const MODAL_LIST_HIGHLIGHT_FULL: &str = "✦ ";
772    pub const MODAL_LIST_SUMMARY_FILTER_LABEL: &str = "Filter";
773    pub const MODAL_LIST_SUMMARY_SEPARATOR: &str = " • ";
774    pub const MODAL_LIST_SUMMARY_MATCHES_LABEL: &str = "Matches";
775    pub const MODAL_LIST_SUMMARY_TOTAL_LABEL: &str = "of";
776    pub const MODAL_LIST_SUMMARY_NO_MATCHES: &str = "No matches";
777    pub const MODAL_LIST_SUMMARY_RESET_HINT: &str = "Press Esc to reset";
778    pub const MODAL_LIST_NO_RESULTS_MESSAGE: &str = "No matching options";
779    pub const HEADER_VERSION_PROMPT: &str = "> ";
780    pub const HEADER_VERSION_PREFIX: &str = "VT Code";
781    pub const HEADER_VERSION_LEFT_DELIMITER: &str = "(";
782    pub const HEADER_VERSION_RIGHT_DELIMITER: &str = ")";
783    pub const HEADER_MODE_INLINE: &str = "Inline session";
784    pub const HEADER_MODE_ALTERNATE: &str = "Alternate session";
785    pub const HEADER_MODE_AUTO: &str = "Auto session";
786    pub const HEADER_MODE_FULL_AUTO_SUFFIX: &str = " (full)";
787    pub const HEADER_MODE_PRIMARY_SEPARATOR: &str = " | ";
788    pub const HEADER_MODE_SECONDARY_SEPARATOR: &str = " | ";
789    pub const HEADER_PROVIDER_PREFIX: &str = "Provider: ";
790    pub const HEADER_MODEL_PREFIX: &str = "Model: ";
791    pub const HEADER_REASONING_PREFIX: &str = "Reasoning effort: ";
792    pub const HEADER_TRUST_PREFIX: &str = "Trust: ";
793    pub const HEADER_TOOLS_PREFIX: &str = "Tools: ";
794    pub const HEADER_MCP_PREFIX: &str = "MCP: ";
795    pub const HEADER_GIT_PREFIX: &str = "git: ";
796    pub const HEADER_GIT_CLEAN_SUFFIX: &str = "✓";
797    pub const HEADER_GIT_DIRTY_SUFFIX: &str = "*";
798    pub const HEADER_UNKNOWN_PLACEHOLDER: &str = "unavailable";
799    pub const HEADER_STATUS_LABEL: &str = "Status";
800    pub const HEADER_STATUS_ACTIVE: &str = "Active";
801    pub const HEADER_STATUS_PAUSED: &str = "Paused";
802    pub const HEADER_MESSAGES_LABEL: &str = "Messages";
803    pub const HEADER_INPUT_LABEL: &str = "Input";
804    pub const HEADER_INPUT_ENABLED: &str = "Enabled";
805    pub const HEADER_INPUT_DISABLED: &str = "Disabled";
806    pub const INLINE_USER_PREFIX: &str = " ";
807    pub const CHAT_INPUT_PLACEHOLDER_BOOTSTRAP: &str =
808        "Implement {feature} in {file} (@files, #prompts, /commands)";
809    pub const CHAT_INPUT_PLACEHOLDER_FOLLOW_UP: &str =
810        "Build something (@files, #prompts, /commands or Shift+Tab to switch to modes)";
811    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";
812    pub const HEADER_META_SEPARATOR: &str = "   ";
813    pub const WELCOME_TEXT_WIDTH: usize = 80;
814    pub const WELCOME_SHORTCUT_SECTION_TITLE: &str = "Keyboard Shortcuts";
815    pub const WELCOME_SHORTCUT_HINT_PREFIX: &str = "Shortcuts:";
816    pub const WELCOME_SHORTCUT_SEPARATOR: &str = "•";
817    pub const WELCOME_SHORTCUT_INDENT: &str = "  ";
818    pub const WELCOME_SLASH_COMMAND_SECTION_TITLE: &str = "Slash Commands";
819    pub const WELCOME_SLASH_COMMAND_LIMIT: usize = 6;
820    pub const WELCOME_SLASH_COMMAND_PREFIX: &str = "/";
821    pub const WELCOME_SLASH_COMMAND_INTRO: &str = "";
822    pub const WELCOME_SLASH_COMMAND_INDENT: &str = "  ";
823    pub const NAVIGATION_BLOCK_TITLE: &str = "Timeline";
824    pub const NAVIGATION_BLOCK_SHORTCUT_NOTE: &str = "Ctrl+T";
825    pub const NAVIGATION_EMPTY_LABEL: &str = "Waiting for activity";
826    pub const NAVIGATION_INDEX_PREFIX: &str = "#";
827    pub const NAVIGATION_LABEL_AGENT: &str = "Agent";
828    pub const NAVIGATION_LABEL_ERROR: &str = "Error";
829    pub const NAVIGATION_LABEL_INFO: &str = "Info";
830    pub const NAVIGATION_LABEL_POLICY: &str = "Policy";
831    pub const NAVIGATION_LABEL_TOOL: &str = "Tool";
832    pub const NAVIGATION_LABEL_USER: &str = "User";
833    pub const NAVIGATION_LABEL_PTY: &str = "PTY";
834    pub const PLAN_BLOCK_TITLE: &str = "TODOs";
835    pub const PLAN_STATUS_EMPTY: &str = "No TODOs";
836    pub const PLAN_STATUS_IN_PROGRESS: &str = "In progress";
837    pub const PLAN_STATUS_DONE: &str = "Done";
838    pub const PLAN_IN_PROGRESS_NOTE: &str = "in progress";
839    pub const SUGGESTION_BLOCK_TITLE: &str = "Slash Commands";
840    pub const STATUS_LINE_MODE: &str = "auto";
841    pub const STATUS_LINE_REFRESH_INTERVAL_MS: u64 = 1000;
842    pub const STATUS_LINE_COMMAND_TIMEOUT_MS: u64 = 200;
843
844    // TUI tick rate constants for smooth scrolling
845    /// Tick rate (Hz) when user is actively interacting with the TUI
846    pub const TUI_ACTIVE_TICK_RATE_HZ: f64 = 16.0;
847    /// Tick rate (Hz) when TUI is idle to save CPU
848    pub const TUI_IDLE_TICK_RATE_HZ: f64 = 4.0;
849    /// Duration (ms) to remain in active mode after last input
850    pub const TUI_ACTIVE_TIMEOUT_MS: u64 = 500;
851
852    // Theme and color constants
853    pub const THEME_MIN_CONTRAST_RATIO: f64 = 4.5;
854    pub const THEME_FOREGROUND_LIGHTEN_RATIO: f64 = 0.25;
855    pub const THEME_SECONDARY_LIGHTEN_RATIO: f64 = 0.2;
856    pub const THEME_MIX_RATIO: f64 = 0.35;
857    pub const THEME_TOOL_BODY_MIX_RATIO: f64 = 0.35;
858    pub const THEME_TOOL_BODY_LIGHTEN_RATIO: f64 = 0.2;
859    pub const THEME_RESPONSE_COLOR_LIGHTEN_RATIO: f64 = 0.15;
860    pub const THEME_REASONING_COLOR_LIGHTEN_RATIO: f64 = 0.3;
861    pub const THEME_USER_COLOR_LIGHTEN_RATIO: f64 = 0.2;
862    pub const THEME_SECONDARY_USER_COLOR_LIGHTEN_RATIO: f64 = 0.4;
863    pub const THEME_PRIMARY_STATUS_LIGHTEN_RATIO: f64 = 0.35;
864    pub const THEME_PRIMARY_STATUS_SECONDARY_LIGHTEN_RATIO: f64 = 0.5;
865    pub const THEME_LOGO_ACCENT_BANNER_LIGHTEN_RATIO: f64 = 0.35;
866    pub const THEME_LOGO_ACCENT_BANNER_SECONDARY_LIGHTEN_RATIO: f64 = 0.25;
867
868    // UI Color constants
869    pub const THEME_COLOR_WHITE_RED: u8 = 0xFF;
870    pub const THEME_COLOR_WHITE_GREEN: u8 = 0xFF;
871    pub const THEME_COLOR_WHITE_BLUE: u8 = 0xFF;
872    pub const THEME_MIX_RATIO_MIN: f64 = 0.0;
873    pub const THEME_MIX_RATIO_MAX: f64 = 1.0;
874    pub const THEME_BLEND_CLAMP_MIN: f64 = 0.0;
875    pub const THEME_BLEND_CLAMP_MAX: f64 = 255.0;
876
877    // WCAG contrast algorithm constants
878    pub const THEME_RELATIVE_LUMINANCE_CUTOFF: f64 = 0.03928;
879    pub const THEME_RELATIVE_LUMINANCE_LOW_FACTOR: f64 = 12.92;
880    pub const THEME_RELATIVE_LUMINANCE_OFFSET: f64 = 0.055;
881    pub const THEME_RELATIVE_LUMINANCE_EXPONENT: f64 = 2.4;
882    pub const THEME_CONTRAST_RATIO_OFFSET: f64 = 0.05;
883    pub const THEME_RED_LUMINANCE_COEFFICIENT: f64 = 0.2126;
884    pub const THEME_GREEN_LUMINANCE_COEFFICIENT: f64 = 0.7152;
885    pub const THEME_BLUE_LUMINANCE_COEFFICIENT: f64 = 0.0722;
886    pub const THEME_LUMINANCE_LIGHTEN_RATIO: f64 = 0.2;
887}
888
889/// Reasoning effort configuration constants
890pub mod reasoning {
891    pub const LOW: &str = "low";
892    pub const MEDIUM: &str = "medium";
893    pub const HIGH: &str = "high";
894    pub const ALLOWED_LEVELS: &[&str] = &["minimal", LOW, MEDIUM, HIGH, "xhigh"];
895    pub const LABEL_LOW: &str = "Low";
896    pub const LABEL_MEDIUM: &str = "Medium";
897    pub const LABEL_HIGH: &str = "High";
898    pub const DESCRIPTION_LOW: &str = "Fast responses with lightweight reasoning.";
899    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)";
900    pub const DESCRIPTION_HIGH: &str = "Maximum reasoning depth for complex problems.";
901}
902
903/// Message role constants to avoid hardcoding strings
904pub mod message_roles {
905    pub const SYSTEM: &str = "system";
906    pub const USER: &str = "user";
907    pub const ASSISTANT: &str = "assistant";
908    pub const TOOL: &str = "tool";
909}
910
911/// URL constants for API endpoints
912pub mod urls {
913    pub const GEMINI_API_BASE: &str = "https://generativelanguage.googleapis.com/v1beta";
914    pub const OPENAI_API_BASE: &str = "https://api.openai.com/v1";
915    pub const HUGGINGFACE_API_BASE: &str = "https://router.huggingface.co/v1";
916    pub const ANTHROPIC_API_BASE: &str = "https://api.anthropic.com/v1";
917    pub const ANTHROPIC_API_VERSION: &str = "2023-06-01";
918    pub const MINIMAX_API_BASE: &str = "https://api.minimax.io/anthropic";
919    pub const OPENROUTER_API_BASE: &str = "https://openrouter.ai/api/v1";
920    pub const XAI_API_BASE: &str = "https://api.x.ai/v1";
921    pub const DEEPSEEK_API_BASE: &str = "https://api.deepseek.com/v1";
922    pub const Z_AI_API_BASE: &str = "https://api.z.ai/api/paas/v4";
923    pub const MOONSHOT_API_BASE: &str = "https://api.moonshot.cn/v1";
924    pub const LMSTUDIO_API_BASE: &str = "http://localhost:1234/v1";
925    pub const OLLAMA_API_BASE: &str = "http://localhost:11434";
926    pub const OLLAMA_CLOUD_API_BASE: &str = "https://ollama.com";
927}
928
929/// Environment variable names for overriding provider base URLs
930pub mod env_vars {
931    pub const GEMINI_BASE_URL: &str = "GEMINI_BASE_URL";
932    pub const OPENAI_BASE_URL: &str = "OPENAI_BASE_URL";
933    pub const HUGGINGFACE_BASE_URL: &str = "HUGGINGFACE_BASE_URL";
934    pub const ANTHROPIC_BASE_URL: &str = "ANTHROPIC_BASE_URL";
935    pub const OPENROUTER_BASE_URL: &str = "OPENROUTER_BASE_URL";
936    pub const XAI_BASE_URL: &str = "XAI_BASE_URL";
937    pub const DEEPSEEK_BASE_URL: &str = "DEEPSEEK_BASE_URL";
938    pub const Z_AI_BASE_URL: &str = "ZAI_BASE_URL";
939    pub const MOONSHOT_BASE_URL: &str = "MOONSHOT_BASE_URL";
940    pub const LMSTUDIO_BASE_URL: &str = "LMSTUDIO_BASE_URL";
941    pub const OLLAMA_BASE_URL: &str = "OLLAMA_BASE_URL";
942    pub const MINIMAX_BASE_URL: &str = "MINIMAX_BASE_URL";
943}
944
945/// HTTP header constants for provider integrations
946pub mod headers {
947    pub const ACCEPT_LANGUAGE: &str = "Accept-Language";
948    pub const ACCEPT_LANGUAGE_DEFAULT: &str = "en-US,en";
949}
950
951/// Tool name constants to avoid hardcoding strings throughout the codebase
952pub mod tools {
953    // ============================================================
954    // UNIFIED TOOLS (Primary Interface)
955    // ============================================================
956    /// Unified search & discovery tool (aliases: grep_file, list_files, code_intelligence, etc.)
957    pub const UNIFIED_SEARCH: &str = "unified_search";
958    /// Unified shell execution & code execution tool (aliases: run_pty_cmd, execute_code, etc.)
959    pub const UNIFIED_EXEC: &str = "unified_exec";
960    /// Unified file operations tool (aliases: read_file, write_file, edit_file, etc.)
961    pub const UNIFIED_FILE: &str = "unified_file";
962
963    // ============================================================
964    // SKILL MANAGEMENT TOOLS (Progressive Disclosure)
965    // ============================================================
966    /// List all available skills (local and dormant system utilities)
967    pub const LIST_SKILLS: &str = "list_skills";
968    /// Load a skill's instructions and activate its tools
969    pub const LOAD_SKILL: &str = "load_skill";
970    /// Load resources from a skill (scripts, templates, docs)
971    pub const LOAD_SKILL_RESOURCE: &str = "load_skill_resource";
972
973    // ============================================================
974    // AGENT CONTROL TOOLS (Delegation)
975    // ============================================================
976    /// Spawn a subagent for specialized tasks (explore, plan, general, etc.)
977    pub const SPAWN_SUBAGENT: &str = "spawn_subagent";
978
979    // ============================================================
980    // LEGACY SEARCH ALIASES (use unified_search instead)
981    // ============================================================
982    pub const GREP_FILE: &str = "grep_file";
983    pub const LIST_FILES: &str = "list_files";
984    pub const CODE_INTELLIGENCE: &str = "code_intelligence";
985    pub const SEARCH_TOOLS: &str = "search_tools";
986    pub const SKILL: &str = "skill";
987    pub const AGENT_INFO: &str = "agent_info";
988    pub const WEB_FETCH: &str = "web_fetch";
989    pub const SEARCH: &str = "search";
990    pub const FIND: &str = "find";
991
992    // ============================================================
993    // LEGACY EXECUTION ALIASES (use unified_exec instead)
994    // ============================================================
995    pub const RUN_PTY_CMD: &str = "run_pty_cmd";
996    pub const CREATE_PTY_SESSION: &str = "create_pty_session";
997    pub const LIST_PTY_SESSIONS: &str = "list_pty_sessions";
998    pub const CLOSE_PTY_SESSION: &str = "close_pty_session";
999    pub const SEND_PTY_INPUT: &str = "send_pty_input";
1000    pub const READ_PTY_SESSION: &str = "read_pty_session";
1001    pub const RESIZE_PTY_SESSION: &str = "resize_pty_session";
1002    pub const EXECUTE_CODE: &str = "execute_code";
1003    pub const EXEC_PTY_CMD: &str = "exec_pty_cmd";
1004    pub const EXEC: &str = "exec";
1005    pub const SHELL: &str = "shell";
1006
1007    // ============================================================
1008    // LEGACY FILE OPERATION ALIASES (use unified_file instead)
1009    // ============================================================
1010    pub const READ_FILE: &str = "read_file";
1011    pub const WRITE_FILE: &str = "write_file";
1012    pub const EDIT_FILE: &str = "edit_file";
1013    pub const DELETE_FILE: &str = "delete_file";
1014    pub const CREATE_FILE: &str = "create_file";
1015    pub const APPLY_PATCH: &str = "apply_patch";
1016    pub const SEARCH_REPLACE: &str = "search_replace";
1017    pub const FILE_OP: &str = "file_op";
1018    pub const MOVE_FILE: &str = "move_file";
1019    pub const COPY_FILE: &str = "copy_file";
1020
1021    // ============================================================
1022    // ERROR & DIAGNOSTICS
1023    // ============================================================
1024    pub const GET_ERRORS: &str = "get_errors";
1025
1026    // ============================================================
1027    // HUMAN-IN-THE-LOOP (HITL)
1028    // ============================================================
1029    /// Ask the human a question via the interactive UI (TUI) and return the selection.
1030    pub const ASK_USER_QUESTION: &str = "ask_user_question";
1031
1032    // ============================================================
1033    // PLAN MODE
1034    // ============================================================
1035    /// Enter plan mode - enables read-only tools and planning workflow.
1036    pub const ENTER_PLAN_MODE: &str = "enter_plan_mode";
1037    /// Exit plan mode - triggers confirmation modal before execution.
1038    pub const EXIT_PLAN_MODE: &str = "exit_plan_mode";
1039
1040    // Special wildcard for full access
1041    pub const WILDCARD_ALL: &str = "*";
1042}
1043
1044/// Bash tool security validation constants
1045pub mod bash {
1046    /// Commands that are always blocked for security reasons
1047    pub const ALWAYS_BLOCKED_COMMANDS: &[&str] = &[
1048        "rm",
1049        "rmdir",
1050        "del",
1051        "format",
1052        "fdisk",
1053        "mkfs",
1054        "dd",
1055        "shred",
1056        "wipe",
1057        "srm",
1058        "unlink",
1059        "chmod",
1060        "chown",
1061        "passwd",
1062        "usermod",
1063        "userdel",
1064        "systemctl",
1065        "service",
1066        "kill",
1067        "killall",
1068        "pkill",
1069        "reboot",
1070        "shutdown",
1071        "halt",
1072        "poweroff",
1073        "sudo",
1074        "su",
1075        "doas",
1076        "runas",
1077        "mount",
1078        "umount",
1079        "fsck",
1080        "tune2fs", // Filesystem operations
1081        "iptables",
1082        "ufw",
1083        "firewalld", // Firewall
1084        "crontab",
1085        "at", // Scheduling
1086        "podman",
1087        "kubectl", // Container/orchestration
1088    ];
1089
1090    /// Network commands that require sandbox to be enabled
1091    pub const NETWORK_COMMANDS: &[&str] = &[
1092        "wget", "ftp", "scp", "rsync", "ssh", "telnet", "nc", "ncat", "socat",
1093    ];
1094
1095    /// Commands that are always allowed (safe development tools)
1096    pub const ALLOWED_COMMANDS: &[&str] = &[
1097        // File system and basic utilities
1098        "ls",
1099        "pwd",
1100        "cat",
1101        "head",
1102        "tail",
1103        "grep",
1104        "find",
1105        "wc",
1106        "sort",
1107        "uniq",
1108        "cut",
1109        "awk",
1110        "sed",
1111        "echo",
1112        "printf",
1113        "seq",
1114        "basename",
1115        "dirname",
1116        "date",
1117        "cal",
1118        "bc",
1119        "expr",
1120        "test",
1121        "[",
1122        "]",
1123        "true",
1124        "false",
1125        "sleep",
1126        "which",
1127        "type",
1128        "file",
1129        "stat",
1130        "du",
1131        "df",
1132        "ps",
1133        "top",
1134        "htop",
1135        "tree",
1136        "less",
1137        "more",
1138        "tac",
1139        "rev",
1140        "tr",
1141        "fold",
1142        "paste",
1143        "join",
1144        "comm",
1145        "diff",
1146        "patch",
1147        "gzip",
1148        "gunzip",
1149        "bzip2",
1150        "bunzip2",
1151        "xz",
1152        "unxz",
1153        "tar",
1154        "zip",
1155        "unzip",
1156        "shasum",
1157        "md5sum",
1158        "sha256sum",
1159        "sha512sum", // Hashing tools
1160        // Version control
1161        "git",
1162        "hg",
1163        "svn",
1164        "git-lfs",
1165        // Build systems and tools
1166        "make",
1167        "cmake",
1168        "ninja",
1169        "meson",
1170        "bazel",
1171        "buck2",
1172        "scons",
1173        "waf",
1174        "xcodebuild",
1175        // Rust/Cargo ecosystem
1176        "cargo",
1177        "rustc",
1178        "rustfmt",
1179        "rustup",
1180        "clippy",
1181        "cargo-clippy",
1182        "cargo-fmt",
1183        "cargo-build",
1184        "cargo-test",
1185        "cargo-run",
1186        "cargo-check",
1187        "cargo-doc",
1188        // Node.js/npm ecosystem
1189        "npm",
1190        "yarn",
1191        "pnpm",
1192        "bun",
1193        "npx",
1194        "node",
1195        "yarnpkg",
1196        "npm-run",
1197        "npm-test",
1198        "npm-start",
1199        "npm-build",
1200        "npm-lint",
1201        "npm-install",
1202        "yarn-test",
1203        "yarn-start",
1204        "yarn-build",
1205        "yarn-lint",
1206        "yarn-install",
1207        "pnpm-test",
1208        "pnpm-start",
1209        "pnpm-build",
1210        "pnpm-lint",
1211        "pnpm-install",
1212        "bun-test",
1213        "bun-start",
1214        "bun-build",
1215        "bun-lint",
1216        "bun-install",
1217        "bun-run",
1218        // Python ecosystem
1219        "python",
1220        "python3",
1221        "pip",
1222        "pip3",
1223        "virtualenv",
1224        "venv",
1225        "conda",
1226        "pytest",
1227        "python-m-pytest",
1228        "python3-m-pytest",
1229        "python-m-pip",
1230        "python3-m-pip",
1231        "python-m-venv",
1232        "python3-m-venv",
1233        "black",
1234        "flake8",
1235        "mypy",
1236        "pylint",
1237        "isort",
1238        "ruff",
1239        "bandit",
1240        // Java ecosystem
1241        "java",
1242        "javac",
1243        "jar",
1244        "jarsigner",
1245        "javadoc",
1246        "jmap",
1247        "jstack",
1248        "jstat",
1249        "jinfo",
1250        "mvn",
1251        "gradle",
1252        "gradlew",
1253        "./gradlew",
1254        "mvnw",
1255        "./mvnw",
1256        "mvn-test",
1257        "mvn-compile",
1258        "mvn-package",
1259        "mvn-install",
1260        "mvn-clean",
1261        "gradle-test",
1262        "gradle-build",
1263        "gradle-check",
1264        "gradle-run",
1265        "gradle-clean",
1266        // Go ecosystem
1267        "go",
1268        "gofmt",
1269        "goimports",
1270        "golint",
1271        "go-test",
1272        "go-build",
1273        "go-run",
1274        "go-mod",
1275        "golangci-lint",
1276        "go-doc",
1277        "go-vet",
1278        "go-install",
1279        "go-clean",
1280        // C/C++ ecosystem
1281        "gcc",
1282        "g++",
1283        "clang",
1284        "clang++",
1285        "clang-cl",
1286        "cpp",
1287        "cc",
1288        "c++",
1289        "gcc-ar",
1290        "gcc-nm",
1291        "gcc-ranlib",
1292        "ld",
1293        "lld",
1294        "gold",
1295        "bfdld",
1296        "make",
1297        "cmake",
1298        "ninja",
1299        "autotools",
1300        "autoconf",
1301        "automake",
1302        "libtool",
1303        "pkg-config",
1304        "pkgconfig",
1305        // Testing frameworks and tools
1306        "pytest",
1307        "jest",
1308        "mocha",
1309        "jasmine",
1310        "karma",
1311        "chai",
1312        "sinon",
1313        "vitest",
1314        "cypress",
1315        "selenium",
1316        "playwright",
1317        "testcafe",
1318        "tape",
1319        "ava",
1320        "qunit",
1321        "junit",
1322        "googletest",
1323        "catch2",
1324        "benchmark",
1325        "hyperfine",
1326        // Linting and formatting tools
1327        "eslint",
1328        "prettier",
1329        "tslint",
1330        "jshint",
1331        "jscs",
1332        "stylelint",
1333        "htmlhint",
1334        "jsonlint",
1335        "yamllint",
1336        "toml-check",
1337        "markdownlint",
1338        "remark-cli",
1339        "shellcheck",
1340        "hadolint",
1341        "rustfmt",
1342        "gofmt",
1343        "black",
1344        "isort",
1345        "ruff",
1346        "clang-format",
1347        "clang-tidy",
1348        // Documentation tools
1349        "doxygen",
1350        "sphinx",
1351        "mkdocs",
1352        "hugo",
1353        "jekyll",
1354        "gatsby",
1355        "next",
1356        "nuxt",
1357        "vuepress",
1358        "docusaurus",
1359        "storybook",
1360        "gitbook",
1361        "readthedocs",
1362        "pandoc",
1363        "mdbook",
1364        "mdBook",
1365        // Container tools (safe operations only)
1366        "docker",
1367        "docker-compose",
1368        "docker-buildx",
1369        "podman",
1370        "buildah",
1371        "docker-build",
1372        "docker-run",
1373        "docker-ps",
1374        "docker-images",
1375        "docker-inspect",
1376        "docker-exec",
1377        "docker-logs",
1378        "docker-stats",
1379        "docker-system",
1380        "docker-network",
1381        // Database tools (development usage)
1382        "sqlite3",
1383        "mysql",
1384        "psql",
1385        "mongosh",
1386        "redis-cli",
1387        "redis-server",
1388        // Cloud and deployment tools
1389        "aws",
1390        "gcloud",
1391        "az",
1392        "kubectl",
1393        "helm",
1394        "terraform",
1395        "tf",
1396        "terragrunt",
1397        "serverless",
1398        "sls",
1399        "pulumi",
1400        "cdk",
1401        "sam",
1402        "localstack",
1403        "minikube",
1404        // Security and analysis tools
1405        "gitleaks",
1406        "trivy",
1407        "snyk",
1408        "npm-audit",
1409        "pip-audit",
1410        "cargo-audit",
1411        "bandit",
1412        "safety",
1413        "pipenv",
1414        "poetry",
1415        // Performance profiling tools
1416        "perf",
1417        "strace",
1418        "ltrace",
1419        "valgrind",
1420        "gdb",
1421        "lldb",
1422        "sar",
1423        "iostat",
1424        "vmstat",
1425        "htop",
1426        "iotop",
1427        "nethogs",
1428        "iftop",
1429        "speedtest-cli",
1430        "ab",
1431        "wrk",
1432        "hey",
1433        // CI/CD tools
1434        "gh",
1435        "gitlab-ci",
1436        "bitbucket",
1437        "azure-pipelines",
1438        "circleci",
1439        "jenkins",
1440        "drone",
1441        "buildkite",
1442        "travis",
1443        "appveyor",
1444        // Package managers for various languages
1445        "composer",
1446        "pear",
1447        "gem",
1448        "rbenv",
1449        "rvm",
1450        "nvm",
1451        "nodenv",
1452        "pyenv",
1453        "rbenv",
1454        "sdkman",
1455        "jenv",
1456        "lein",
1457        "boot",
1458        "mix",
1459        "rebar3",
1460        "erl",
1461        "elixir",
1462        // Web development tools
1463        "webpack",
1464        "rollup",
1465        "vite",
1466        "parcel",
1467        "esbuild",
1468        "snowpack",
1469        "turbo",
1470        "swc",
1471        "babel",
1472        "postcss",
1473        "sass",
1474        "scss",
1475        "less",
1476        "stylus",
1477        "tailwindcss",
1478        // Mobile development tools
1479        "xcodebuild",
1480        "fastlane",
1481        "gradle",
1482        "./gradlew",
1483        "cordova",
1484        "ionic",
1485        "react-native",
1486        "flutter",
1487        "expo",
1488        "capacitor",
1489    ];
1490}
1491
1492pub mod mcp {
1493    pub const RENDERER_CONTEXT7: &str = "context7";
1494    pub const RENDERER_SEQUENTIAL_THINKING: &str = "sequential-thinking";
1495
1496    /// Default startup timeout for MCP servers in milliseconds (60 seconds)
1497    /// Can be overridden via config: mcp.startup_timeout_seconds
1498    pub const DEFAULT_STARTUP_TIMEOUT_MS: u64 = 60_000;
1499}
1500
1501pub mod project_doc {
1502    pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1503}
1504
1505pub mod instructions {
1506    pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1507}
1508
1509/// LLM generation parameters
1510pub mod llm_generation {
1511    /// Default temperature for main LLM responses (0.0-1.0)
1512    /// Controls randomness/creativity: 0=deterministic, 1=random
1513    /// 0.7 provides balanced creativity and consistency
1514    pub const DEFAULT_TEMPERATURE: f32 = 0.7;
1515
1516    /// Default temperature for prompt refinement (0.0-1.0)
1517    /// Lower than main temperature for more deterministic refinement
1518    pub const DEFAULT_REFINE_TEMPERATURE: f32 = 0.3;
1519}
1520
1521/// Context window management defaults
1522/// Context window management defaults (simplified - no token counting)
1523pub mod context {
1524    /// Head ratio percentage for code files (legacy, kept for compatibility)
1525    pub const CODE_HEAD_RATIO_PERCENT: usize = 60;
1526
1527    /// Head ratio percentage for log files (legacy, kept for compatibility)
1528    pub const LOG_HEAD_RATIO_PERCENT: usize = 20;
1529}
1530
1531/// Chunking constants for large file handling
1532pub mod chunking {
1533    /// Maximum lines before triggering chunking for read_file
1534    pub const MAX_LINES_THRESHOLD: usize = 2_000;
1535
1536    /// Number of lines to read from start of file when chunking
1537    pub const CHUNK_START_LINES: usize = 800;
1538
1539    /// Number of lines to read from end of file when chunking
1540    pub const CHUNK_END_LINES: usize = 800;
1541
1542    /// Maximum content size for write_file before chunking (in bytes)
1543    pub const MAX_WRITE_CONTENT_SIZE: usize = 500_000; // 500KB
1544
1545    /// Chunk size for write operations (in bytes)
1546    pub const WRITE_CHUNK_SIZE: usize = 50_000; // 50KB chunks
1547}
1548
1549/// Diff preview controls for file operations
1550pub mod diff {
1551    /// Maximum number of bytes allowed in diff preview inputs
1552    pub const MAX_PREVIEW_BYTES: usize = 200_000;
1553
1554    /// Number of context lines to include around changes in unified diff output
1555    pub const CONTEXT_RADIUS: usize = 3;
1556
1557    /// Maximum number of diff lines to keep in preview output before condensation
1558    pub const MAX_PREVIEW_LINES: usize = 160;
1559
1560    /// Number of leading diff lines to retain when condensing previews
1561    pub const HEAD_LINE_COUNT: usize = 96;
1562
1563    /// Number of trailing diff lines to retain when condensing previews
1564    pub const TAIL_LINE_COUNT: usize = 32;
1565
1566    /// Maximum number of files to show inline diffs for before suppression
1567    pub const MAX_INLINE_DIFF_FILES: usize = 10;
1568
1569    /// Maximum total diff lines across all files before suppression
1570    pub const MAX_TOTAL_DIFF_LINES: usize = 500;
1571
1572    /// Maximum additions + deletions in a single file before suppression
1573    pub const MAX_SINGLE_FILE_CHANGES: usize = 200;
1574
1575    /// Maximum number of files to list in suppression summary
1576    pub const MAX_FILES_IN_SUMMARY: usize = 20;
1577
1578    /// Message shown when inline diffs are suppressed
1579    pub const SUPPRESSION_MESSAGE: &str = "Inline diffs have been suppressed for recent changes because there are too many to display.";
1580
1581    /// Hint message shown with suppressed diffs
1582    pub const SUPPRESSION_HINT: &str = "Tip: Use `git diff` to view the full changes.";
1583}
1584
1585/// Memory monitoring thresholds and constants
1586pub mod memory {
1587    /// Soft memory limit in bytes (400 MB) - triggers warning and TTL reduction
1588    pub const SOFT_LIMIT_BYTES: usize = 400 * 1024 * 1024;
1589
1590    /// Hard memory limit in bytes (600 MB) - triggers aggressive eviction
1591    pub const HARD_LIMIT_BYTES: usize = 600 * 1024 * 1024;
1592
1593    /// Memory check interval in milliseconds (100 ms)
1594    pub const CHECK_INTERVAL_MS: u64 = 100;
1595
1596    /// TTL reduction factor under warning pressure (reduce from 5min to 2min)
1597    pub const WARNING_TTL_REDUCTION_FACTOR: f64 = 0.4;
1598
1599    /// TTL reduction factor under critical pressure (reduce from 5min to 30s)
1600    pub const CRITICAL_TTL_REDUCTION_FACTOR: f64 = 0.1;
1601
1602    /// Minimum RSA size to track in checkpoints (1 MB)
1603    /// Minimum RSS size to track in checkpoints (1 MiB)
1604    pub const MIN_RSS_CHECKPOINT_BYTES: usize = 1024 * 1024;
1605
1606    /// Maximum memory checkpoint history to keep
1607    pub const MAX_CHECKPOINT_HISTORY: usize = 100;
1608
1609    /// Default threshold for memory pressure report (MB)
1610    pub const DEFAULT_REPORT_THRESHOLD_MB: usize = 50;
1611}