vtcode_config/
constants.rs

1/// Prompt path constants to avoid hardcoding throughout the codebase
2pub mod prompts {
3    pub const DEFAULT_SYSTEM_PROMPT_PATH: &str = "prompts/system.md";
4    pub const DEFAULT_CUSTOM_PROMPTS_DIR: &str = "~/.vtcode/prompts";
5    pub const CUSTOM_PROMPTS_ENV_VAR: &str = "VTCODE_HOME";
6    pub const DEFAULT_CUSTOM_PROMPT_MAX_FILE_SIZE_KB: usize = 64;
7    pub const CORE_BUILTIN_PROMPTS_DIR: &str = "vtcode-core/prompts/custom";
8}
9
10/// Model ID constants to sync with docs/models.json
11pub mod models {
12    // Google/Gemini models
13    pub mod google {
14        pub const DEFAULT_MODEL: &str = "gemini-2.5-flash-preview-05-20";
15        pub const SUPPORTED_MODELS: &[&str] = &[
16            "gemini-2.5-flash-preview-05-20",
17            "gemini-2.5-pro",
18            "gemini-2.5-flash",
19            "gemini-2.5-flash-lite",
20        ];
21
22        // Convenience constants for commonly used models
23        pub const GEMINI_2_5_FLASH_PREVIEW: &str = "gemini-2.5-flash-preview-05-20";
24        pub const GEMINI_2_5_PRO: &str = "gemini-2.5-pro";
25        pub const GEMINI_2_5_FLASH: &str = "gemini-2.5-flash";
26        pub const GEMINI_2_5_FLASH_LITE: &str = "gemini-2.5-flash-lite";
27    }
28
29    // OpenAI models (from docs/models.json)
30    pub mod openai {
31        pub const DEFAULT_MODEL: &str = "gpt-5";
32        pub const SUPPORTED_MODELS: &[&str] = &[
33            "gpt-5",
34            "gpt-5-codex",
35            "gpt-5-mini",
36            "gpt-5-nano",
37            "codex-mini-latest",
38            "gpt-oss-20b",
39            "gpt-oss-120b",
40        ];
41
42        /// Models that require the OpenAI Responses API
43        pub const RESPONSES_API_MODELS: &[&str] = &[GPT_5, GPT_5_CODEX, GPT_5_MINI, GPT_5_NANO];
44
45        /// Models that support the OpenAI reasoning parameter payload
46        pub const REASONING_MODELS: &[&str] = &[GPT_5, GPT_5_CODEX];
47
48        /// Models that do not expose structured tool calling on the OpenAI platform
49        pub const TOOL_UNAVAILABLE_MODELS: &[&str] = &[];
50
51        /// GPT-OSS models that use harmony tokenization
52        pub const HARMONY_MODELS: &[&str] = &[GPT_OSS_20B, GPT_OSS_120B];
53
54        // Convenience constants for commonly used models
55        pub const GPT_5: &str = "gpt-5";
56        pub const GPT_5_CODEX: &str = "gpt-5-codex";
57        pub const GPT_5_MINI: &str = "gpt-5-mini";
58        pub const GPT_5_NANO: &str = "gpt-5-nano";
59        pub const CODEX_MINI_LATEST: &str = "codex-mini-latest";
60        pub const GPT_OSS_20B: &str = "gpt-oss-20b";
61        pub const GPT_OSS_120B: &str = "gpt-oss-120b";
62    }
63
64    // Z.AI models (direct API)
65    pub mod zai {
66        pub const DEFAULT_MODEL: &str = "glm-4.6";
67        pub const SUPPORTED_MODELS: &[&str] = &[
68            "glm-4.6",
69            "glm-4.5",
70            "glm-4.5-air",
71            "glm-4.5-x",
72            "glm-4.5-airx",
73            "glm-4.5-flash",
74            "glm-4-32b-0414-128k",
75        ];
76
77        pub const GLM_4_6: &str = "glm-4.6";
78        pub const GLM_4_5: &str = "glm-4.5";
79        pub const GLM_4_5_AIR: &str = "glm-4.5-air";
80        pub const GLM_4_5_X: &str = "glm-4.5-x";
81        pub const GLM_4_5_AIRX: &str = "glm-4.5-airx";
82        pub const GLM_4_5_FLASH: &str = "glm-4.5-flash";
83        pub const GLM_4_32B_0414_128K: &str = "glm-4-32b-0414-128k";
84    }
85
86    // Moonshot.ai models (direct API)
87    pub mod moonshot {
88        pub const DEFAULT_MODEL: &str = "kimi-k2-turbo-preview";
89        pub const SUPPORTED_MODELS: &[&str] = &[
90            "kimi-k2-turbo-preview",
91            "kimi-k2-0905-preview",
92            "kimi-k2-0711-preview",
93            "kimi-latest",
94            "kimi-latest-8k",
95            "kimi-latest-32k",
96            "kimi-latest-128k",
97        ];
98
99        pub const KIMI_K2_TURBO_PREVIEW: &str = "kimi-k2-turbo-preview";
100        pub const KIMI_K2_0905_PREVIEW: &str = "kimi-k2-0905-preview";
101        pub const KIMI_K2_0711_PREVIEW: &str = "kimi-k2-0711-preview";
102        pub const KIMI_LATEST: &str = "kimi-latest";
103        pub const KIMI_LATEST_8K: &str = "kimi-latest-8k";
104        pub const KIMI_LATEST_32K: &str = "kimi-latest-32k";
105        pub const KIMI_LATEST_128K: &str = "kimi-latest-128k";
106    }
107
108    // OpenRouter models (extensible via vtcode.toml)
109    pub mod openrouter {
110        include!(concat!(env!("OUT_DIR"), "/openrouter_constants.rs"));
111    }
112
113    // LM Studio models (OpenAI-compatible local server)
114    pub mod lmstudio {
115        pub const DEFAULT_MODEL: &str = META_LLAMA_31_8B_INSTRUCT;
116        pub const SUPPORTED_MODELS: &[&str] = &[
117            META_LLAMA_3_8B_INSTRUCT,
118            META_LLAMA_31_8B_INSTRUCT,
119            QWEN25_7B_INSTRUCT,
120            GEMMA_2_2B_IT,
121            GEMMA_2_9B_IT,
122            PHI_31_MINI_4K_INSTRUCT,
123        ];
124
125        pub const META_LLAMA_3_8B_INSTRUCT: &str = "lmstudio-community/meta-llama-3-8b-instruct";
126        pub const META_LLAMA_31_8B_INSTRUCT: &str = "lmstudio-community/meta-llama-3.1-8b-instruct";
127        pub const QWEN25_7B_INSTRUCT: &str = "lmstudio-community/qwen2.5-7b-instruct";
128        pub const GEMMA_2_2B_IT: &str = "lmstudio-community/gemma-2-2b-it";
129        pub const GEMMA_2_9B_IT: &str = "lmstudio-community/gemma-2-9b-it";
130        pub const PHI_31_MINI_4K_INSTRUCT: &str = "lmstudio-community/phi-3.1-mini-4k-instruct";
131    }
132
133    pub mod ollama {
134        pub const DEFAULT_LOCAL_MODEL: &str = "gpt-oss:20b";
135        pub const DEFAULT_CLOUD_MODEL: &str = "gpt-oss:120b-cloud";
136        pub const DEFAULT_MODEL: &str = DEFAULT_LOCAL_MODEL;
137        pub const SUPPORTED_MODELS: &[&str] = &[
138            DEFAULT_LOCAL_MODEL,
139            QWEN3_1_7B,
140            DEFAULT_CLOUD_MODEL,
141            GPT_OSS_20B_CLOUD,
142            DEEPSEEK_V31_671B_CLOUD,
143            KIMI_K2_1T_CLOUD,
144            QWEN3_CODER_480B_CLOUD,
145            GLM_46_CLOUD,
146            MINIMAX_M2_CLOUD,
147        ];
148
149        /// Models that emit structured reasoning traces when `think` is enabled
150        pub const REASONING_MODELS: &[&str] = &[
151            GPT_OSS_20B,
152            GPT_OSS_20B_CLOUD,
153            GPT_OSS_120B_CLOUD,
154            QWEN3_1_7B,
155            QWEN3_CODER_480B_CLOUD,
156            DEEPSEEK_V31_671B_CLOUD,
157            KIMI_K2_1T_CLOUD,
158            GLM_46_CLOUD,
159            MINIMAX_M2_CLOUD,
160        ];
161
162        /// Models that require an explicit reasoning effort level instead of boolean toggle
163        pub const REASONING_LEVEL_MODELS: &[&str] =
164            &[GPT_OSS_20B, GPT_OSS_20B_CLOUD, GPT_OSS_120B_CLOUD];
165
166        pub const GPT_OSS_20B: &str = DEFAULT_LOCAL_MODEL;
167        pub const GPT_OSS_20B_CLOUD: &str = "gpt-oss:20b-cloud";
168        pub const GPT_OSS_120B_CLOUD: &str = DEFAULT_CLOUD_MODEL;
169        pub const QWEN3_1_7B: &str = "qwen3:1.7b";
170        pub const DEEPSEEK_V31_671B_CLOUD: &str = "deepseek-v3.1:671b-cloud";
171        pub const KIMI_K2_1T_CLOUD: &str = "kimi-k2:1t-cloud";
172        pub const QWEN3_CODER_480B_CLOUD: &str = "qwen3-coder:480b-cloud";
173        pub const GLM_46_CLOUD: &str = "glm-4.6:cloud";
174        pub const MINIMAX_M2_CLOUD: &str = "minimax-m2:cloud";
175    }
176
177    // DeepSeek models (native API)
178    pub mod deepseek {
179        pub const DEFAULT_MODEL: &str = "deepseek-chat";
180        pub const SUPPORTED_MODELS: &[&str] = &["deepseek-chat", "deepseek-reasoner"];
181
182        pub const DEEPSEEK_CHAT: &str = "deepseek-chat";
183        pub const DEEPSEEK_REASONER: &str = "deepseek-reasoner";
184    }
185
186    // Anthropic models (from docs/models.json) - Updated for tool use best practices
187    pub mod anthropic {
188        // Standard model for straightforward tools - Sonnet 4 preferred for most use cases
189        pub const DEFAULT_MODEL: &str = "claude-sonnet-4-5";
190        pub const SUPPORTED_MODELS: &[&str] = &[
191            "claude-opus-4-1-20250805", // Latest: Opus 4.1 (2025-08-05)
192            "claude-sonnet-4-5",        // Latest: Sonnet 4.5 (2025-10-15)
193            "claude-haiku-4-5",         // Latest: Haiku 4.5 (2025-10-15)
194            "claude-sonnet-4-20250514", // Previous: Sonnet 4 (2025-05-14)
195        ];
196
197        // Convenience constants for commonly used models
198        pub const CLAUDE_OPUS_4_1_20250805: &str = "claude-opus-4-1-20250805";
199        pub const CLAUDE_SONNET_4_5: &str = "claude-sonnet-4-5";
200        pub const CLAUDE_HAIKU_4_5: &str = "claude-haiku-4-5";
201        pub const CLAUDE_SONNET_4_20250514: &str = "claude-sonnet-4-20250514";
202
203        /// Models that accept the reasoning effort parameter
204        pub const REASONING_MODELS: &[&str] = &[
205            CLAUDE_OPUS_4_1_20250805,
206            CLAUDE_SONNET_4_5,
207            CLAUDE_HAIKU_4_5,
208            CLAUDE_SONNET_4_20250514,
209        ];
210    }
211
212    // MiniMax models (Anthropic-compatible API, standalone provider)
213    pub mod minimax {
214        pub const DEFAULT_MODEL: &str = MINIMAX_M2;
215        pub const SUPPORTED_MODELS: &[&str] = &[MINIMAX_M2];
216        pub const MINIMAX_M2: &str = "MiniMax-M2";
217    }
218
219    // xAI models
220    pub mod xai {
221        pub const DEFAULT_MODEL: &str = "grok-4";
222        pub const SUPPORTED_MODELS: &[&str] = &[
223            "grok-4",
224            "grok-4-mini",
225            "grok-4-code",
226            "grok-4-code-latest",
227            "grok-4-vision",
228        ];
229
230        pub const GROK_4: &str = "grok-4";
231        pub const GROK_4_MINI: &str = "grok-4-mini";
232        pub const GROK_4_CODE: &str = "grok-4-code";
233        pub const GROK_4_CODE_LATEST: &str = "grok-4-code-latest";
234        pub const GROK_4_VISION: &str = "grok-4-vision";
235    }
236
237    // Backwards compatibility - keep old constants working
238    pub const GEMINI_2_5_FLASH_PREVIEW: &str = google::GEMINI_2_5_FLASH_PREVIEW;
239    pub const GEMINI_2_5_FLASH: &str = google::GEMINI_2_5_FLASH;
240    pub const GEMINI_2_5_PRO: &str = google::GEMINI_2_5_PRO;
241    pub const GEMINI_2_5_FLASH_LITE: &str = google::GEMINI_2_5_FLASH_LITE;
242    pub const GPT_5: &str = openai::GPT_5;
243    pub const GPT_5_CODEX: &str = openai::GPT_5_CODEX;
244    pub const GPT_5_MINI: &str = openai::GPT_5_MINI;
245    pub const GPT_5_NANO: &str = openai::GPT_5_NANO;
246    pub const CODEX_MINI: &str = openai::CODEX_MINI_LATEST;
247    pub const CODEX_MINI_LATEST: &str = openai::CODEX_MINI_LATEST;
248    pub const CLAUDE_OPUS_4_1_20250805: &str = anthropic::CLAUDE_OPUS_4_1_20250805;
249    pub const CLAUDE_SONNET_4_5: &str = anthropic::CLAUDE_SONNET_4_5;
250    pub const CLAUDE_HAIKU_4_5: &str = anthropic::CLAUDE_HAIKU_4_5;
251    pub const CLAUDE_SONNET_4_20250514: &str = anthropic::CLAUDE_SONNET_4_20250514;
252    pub const MINIMAX_M2: &str = minimax::MINIMAX_M2;
253    pub const MOONSHOT_KIMI_K2_TURBO_PREVIEW: &str = moonshot::KIMI_K2_TURBO_PREVIEW;
254    pub const MOONSHOT_KIMI_K2_0905_PREVIEW: &str = moonshot::KIMI_K2_0905_PREVIEW;
255    pub const MOONSHOT_KIMI_K2_0711_PREVIEW: &str = moonshot::KIMI_K2_0711_PREVIEW;
256    pub const MOONSHOT_KIMI_LATEST: &str = moonshot::KIMI_LATEST;
257    pub const MOONSHOT_KIMI_LATEST_8K: &str = moonshot::KIMI_LATEST_8K;
258    pub const MOONSHOT_KIMI_LATEST_32K: &str = moonshot::KIMI_LATEST_32K;
259    pub const MOONSHOT_KIMI_LATEST_128K: &str = moonshot::KIMI_LATEST_128K;
260    pub const XAI_GROK_4: &str = xai::GROK_4;
261    pub const XAI_GROK_4_MINI: &str = xai::GROK_4_MINI;
262    pub const XAI_GROK_4_CODE: &str = xai::GROK_4_CODE;
263    pub const XAI_GROK_4_CODE_LATEST: &str = xai::GROK_4_CODE_LATEST;
264    pub const XAI_GROK_4_VISION: &str = xai::GROK_4_VISION;
265    pub const DEEPSEEK_CHAT: &str = deepseek::DEEPSEEK_CHAT;
266    pub const DEEPSEEK_REASONER: &str = deepseek::DEEPSEEK_REASONER;
267    pub const OPENROUTER_X_AI_GROK_CODE_FAST_1: &str = openrouter::X_AI_GROK_CODE_FAST_1;
268    pub const OPENROUTER_QWEN3_CODER: &str = openrouter::QWEN3_CODER;
269    pub const OPENROUTER_ANTHROPIC_CLAUDE_SONNET_4_5: &str =
270        openrouter::ANTHROPIC_CLAUDE_SONNET_4_5;
271}
272
273/// Prompt caching defaults shared across features and providers
274pub mod prompt_cache {
275    pub const DEFAULT_ENABLED: bool = true;
276    pub const DEFAULT_CACHE_DIR: &str = ".vtcode/cache/prompts";
277    pub const DEFAULT_MAX_ENTRIES: usize = 1_000;
278    pub const DEFAULT_MAX_AGE_DAYS: u64 = 30;
279    pub const DEFAULT_AUTO_CLEANUP: bool = true;
280    pub const DEFAULT_MIN_QUALITY_THRESHOLD: f64 = 0.7;
281
282    pub const OPENAI_MIN_PREFIX_TOKENS: u32 = 1_024;
283    pub const OPENAI_IDLE_EXPIRATION_SECONDS: u64 = 60 * 60; // 1 hour max reuse window
284
285    pub const ANTHROPIC_DEFAULT_TTL_SECONDS: u64 = 5 * 60; // 5 minutes
286    pub const ANTHROPIC_EXTENDED_TTL_SECONDS: u64 = 60 * 60; // 1 hour option
287    pub const ANTHROPIC_MAX_BREAKPOINTS: u8 = 4;
288
289    pub const GEMINI_MIN_PREFIX_TOKENS: u32 = 1_024;
290    pub const GEMINI_EXPLICIT_DEFAULT_TTL_SECONDS: u64 = 60 * 60; // 1 hour default for explicit caches
291
292    pub const OPENROUTER_CACHE_DISCOUNT_ENABLED: bool = true;
293    pub const XAI_CACHE_ENABLED: bool = true;
294    pub const DEEPSEEK_CACHE_ENABLED: bool = true;
295    pub const ZAI_CACHE_ENABLED: bool = false;
296    pub const MOONSHOT_CACHE_ENABLED: bool = true;
297}
298
299/// Model validation and helper functions
300pub mod model_helpers {
301    use super::models;
302
303    /// Get supported models for a provider
304    pub fn supported_for(provider: &str) -> Option<&'static [&'static str]> {
305        match provider {
306            "google" | "gemini" => Some(models::google::SUPPORTED_MODELS),
307            "openai" => Some(models::openai::SUPPORTED_MODELS),
308            "anthropic" => Some(models::anthropic::SUPPORTED_MODELS),
309            "minimax" => Some(models::minimax::SUPPORTED_MODELS),
310            "deepseek" => Some(models::deepseek::SUPPORTED_MODELS),
311            "openrouter" => Some(models::openrouter::SUPPORTED_MODELS),
312            "moonshot" => Some(models::moonshot::SUPPORTED_MODELS),
313            "xai" => Some(models::xai::SUPPORTED_MODELS),
314            "zai" => Some(models::zai::SUPPORTED_MODELS),
315            "ollama" => Some(models::ollama::SUPPORTED_MODELS),
316            _ => None,
317        }
318    }
319
320    /// Get default model for a provider
321    pub fn default_for(provider: &str) -> Option<&'static str> {
322        match provider {
323            "google" | "gemini" => Some(models::google::DEFAULT_MODEL),
324            "openai" => Some(models::openai::DEFAULT_MODEL),
325            "anthropic" => Some(models::anthropic::DEFAULT_MODEL),
326            "minimax" => Some(models::minimax::DEFAULT_MODEL),
327            "deepseek" => Some(models::deepseek::DEFAULT_MODEL),
328            "openrouter" => Some(models::openrouter::DEFAULT_MODEL),
329            "moonshot" => Some(models::moonshot::DEFAULT_MODEL),
330            "xai" => Some(models::xai::DEFAULT_MODEL),
331            "zai" => Some(models::zai::DEFAULT_MODEL),
332            "ollama" => Some(models::ollama::DEFAULT_MODEL),
333            _ => None,
334        }
335    }
336
337    /// Validate if a model is supported by a provider
338    pub fn is_valid(provider: &str, model: &str) -> bool {
339        supported_for(provider)
340            .map(|list| list.contains(&model))
341            .unwrap_or(false)
342    }
343}
344
345/// Environment variable names shared across the application.
346pub mod env {
347    /// Toggle automatic update checks in the onboarding banner.
348    pub const UPDATE_CHECK: &str = "VT_UPDATE_CHECK";
349
350    /// Agent Client Protocol specific environment keys
351    pub mod acp {
352        #[derive(Debug, Clone, Copy)]
353        pub enum AgentClientProtocolEnvKey {
354            Enabled,
355            ZedEnabled,
356            ZedToolsReadFileEnabled,
357            ZedToolsListFilesEnabled,
358            ZedWorkspaceTrust,
359        }
360
361        impl AgentClientProtocolEnvKey {
362            pub fn as_str(self) -> &'static str {
363                match self {
364                    Self::Enabled => "VT_ACP_ENABLED",
365                    Self::ZedEnabled => "VT_ACP_ZED_ENABLED",
366                    Self::ZedToolsReadFileEnabled => "VT_ACP_ZED_TOOLS_READ_FILE_ENABLED",
367                    Self::ZedToolsListFilesEnabled => "VT_ACP_ZED_TOOLS_LIST_FILES_ENABLED",
368                    Self::ZedWorkspaceTrust => "VT_ACP_ZED_WORKSPACE_TRUST",
369                }
370            }
371        }
372    }
373}
374
375/// Default configuration values
376pub mod defaults {
377    use super::{models, ui};
378
379    pub const DEFAULT_MODEL: &str = models::openai::DEFAULT_MODEL;
380    pub const DEFAULT_CLI_MODEL: &str = models::openai::DEFAULT_MODEL;
381    pub const DEFAULT_PROVIDER: &str = "openai";
382    pub const DEFAULT_API_KEY_ENV: &str = "OPENAI_API_KEY";
383    pub const DEFAULT_THEME: &str = "ciapre-dark";
384    pub const DEFAULT_FULL_AUTO_MAX_TURNS: usize = 30;
385    pub const DEFAULT_MAX_TOOL_LOOPS: usize = 100;
386    pub const DEFAULT_MAX_REPEATED_TOOL_CALLS: usize = 3;
387    pub const ANTHROPIC_DEFAULT_MAX_TOKENS: u32 = 4_096;
388    pub const DEFAULT_PTY_STDOUT_TAIL_LINES: usize = 20;
389    pub const DEFAULT_PTY_SCROLLBACK_LINES: usize = 400;
390    pub const DEFAULT_TOOL_OUTPUT_MODE: &str = ui::TOOL_OUTPUT_MODE_COMPACT;
391}
392
393pub mod ui {
394    pub const TOOL_OUTPUT_MODE_COMPACT: &str = "compact";
395    pub const TOOL_OUTPUT_MODE_FULL: &str = "full";
396    pub const DEFAULT_INLINE_VIEWPORT_ROWS: u16 = 16;
397    pub const INLINE_SHOW_TIMELINE_PANE: bool = true;
398    pub const SLASH_SUGGESTION_LIMIT: usize = 50; // All commands are scrollable
399    pub const SLASH_PALETTE_MIN_WIDTH: u16 = 40;
400    pub const SLASH_PALETTE_MIN_HEIGHT: u16 = 9;
401    pub const SLASH_PALETTE_HORIZONTAL_MARGIN: u16 = 8;
402    pub const SLASH_PALETTE_TOP_OFFSET: u16 = 3;
403    pub const SLASH_PALETTE_CONTENT_PADDING: u16 = 6;
404    pub const SLASH_PALETTE_HINT_PRIMARY: &str = "Type to filter slash commands.";
405    pub const SLASH_PALETTE_HINT_SECONDARY: &str = "Press Enter to apply • Esc to dismiss.";
406    pub const MODAL_MIN_WIDTH: u16 = 36;
407    pub const MODAL_MIN_HEIGHT: u16 = 9;
408    pub const MODAL_LIST_MIN_HEIGHT: u16 = 12;
409    pub const MODAL_WIDTH_RATIO: f32 = 0.6;
410    pub const MODAL_HEIGHT_RATIO: f32 = 0.6;
411    pub const MODAL_MAX_WIDTH_RATIO: f32 = 0.9;
412    pub const MODAL_MAX_HEIGHT_RATIO: f32 = 0.8;
413    pub const MODAL_CONTENT_HORIZONTAL_PADDING: u16 = 8;
414    pub const MODAL_CONTENT_VERTICAL_PADDING: u16 = 6;
415    pub const MODAL_INSTRUCTIONS_TITLE: &str = "";
416    pub const MODAL_INSTRUCTIONS_BULLET: &str = "•";
417    pub const INLINE_HEADER_HEIGHT: u16 = 4;
418    pub const INLINE_INPUT_HEIGHT: u16 = 4;
419    pub const INLINE_INPUT_MAX_LINES: usize = 3;
420    pub const INLINE_NAVIGATION_PERCENT: u16 = 28;
421    pub const INLINE_NAVIGATION_MIN_WIDTH: u16 = 24;
422    pub const INLINE_CONTENT_MIN_WIDTH: u16 = 48;
423    pub const INLINE_STACKED_NAVIGATION_PERCENT: u16 = INLINE_NAVIGATION_PERCENT;
424    pub const INLINE_SCROLLBAR_EDGE_PADDING: u16 = 1;
425    pub const INLINE_TRANSCRIPT_BOTTOM_PADDING: u16 = 6;
426    pub const INLINE_PREVIEW_MAX_CHARS: usize = 56;
427    pub const INLINE_PREVIEW_ELLIPSIS: &str = "…";
428    pub const HEADER_HIGHLIGHT_PREVIEW_MAX_CHARS: usize = 48;
429    pub const INLINE_AGENT_MESSAGE_LEFT_PADDING: &str = "  ";
430    pub const INLINE_AGENT_QUOTE_PREFIX: &str = "";
431    pub const INLINE_USER_MESSAGE_DIVIDER_SYMBOL: &str = "─";
432    pub const INLINE_BLOCK_TOP_LEFT: &str = "â•­";
433    pub const INLINE_BLOCK_TOP_RIGHT: &str = "â•®";
434    pub const INLINE_BLOCK_BODY_LEFT: &str = "│";
435    pub const INLINE_BLOCK_BODY_RIGHT: &str = "│";
436    pub const INLINE_BLOCK_BOTTOM_LEFT: &str = "â•°";
437    pub const INLINE_BLOCK_BOTTOM_RIGHT: &str = "╯";
438    pub const INLINE_BLOCK_HORIZONTAL: &str = "─";
439    pub const INLINE_TOOL_HEADER_LABEL: &str = "Tool";
440    pub const INLINE_TOOL_ACTION_PREFIX: &str = "→";
441    pub const INLINE_TOOL_DETAIL_PREFIX: &str = "↳";
442    pub const INLINE_PTY_HEADER_LABEL: &str = "Terminal";
443    pub const INLINE_PTY_RUNNING_LABEL: &str = "running";
444    pub const INLINE_PTY_STATUS_LIVE: &str = "LIVE";
445    pub const INLINE_PTY_STATUS_DONE: &str = "DONE";
446    pub const INLINE_PTY_PLACEHOLDER: &str = "Terminal output";
447    pub const MODAL_LIST_HIGHLIGHT_SYMBOL: &str = "✦";
448    pub const MODAL_LIST_HIGHLIGHT_FULL: &str = "✦ ";
449    pub const MODAL_LIST_SUMMARY_FILTER_LABEL: &str = "Filter";
450    pub const MODAL_LIST_SUMMARY_SEPARATOR: &str = " • ";
451    pub const MODAL_LIST_SUMMARY_MATCHES_LABEL: &str = "Matches";
452    pub const MODAL_LIST_SUMMARY_TOTAL_LABEL: &str = "of";
453    pub const MODAL_LIST_SUMMARY_NO_MATCHES: &str = "No matches";
454    pub const MODAL_LIST_SUMMARY_RESET_HINT: &str = "Press Esc to reset";
455    pub const MODAL_LIST_NO_RESULTS_MESSAGE: &str = "No matching options";
456    pub const HEADER_VERSION_PROMPT: &str = "> ";
457    pub const HEADER_VERSION_PREFIX: &str = "VT Code";
458    pub const HEADER_VERSION_LEFT_DELIMITER: &str = "(";
459    pub const HEADER_VERSION_RIGHT_DELIMITER: &str = ")";
460    pub const HEADER_MODE_INLINE: &str = "Inline session";
461    pub const HEADER_MODE_ALTERNATE: &str = "Alternate session";
462    pub const HEADER_MODE_AUTO: &str = "Auto session";
463    pub const HEADER_MODE_FULL_AUTO_SUFFIX: &str = " (full)";
464    pub const HEADER_MODE_PRIMARY_SEPARATOR: &str = " | ";
465    pub const HEADER_MODE_SECONDARY_SEPARATOR: &str = " | ";
466    pub const HEADER_PROVIDER_PREFIX: &str = "Provider: ";
467    pub const HEADER_MODEL_PREFIX: &str = "Model: ";
468    pub const HEADER_REASONING_PREFIX: &str = "Reasoning effort: ";
469    pub const HEADER_TRUST_PREFIX: &str = "Trust: ";
470    pub const HEADER_TOOLS_PREFIX: &str = "Tools: ";
471    pub const HEADER_MCP_PREFIX: &str = "MCP: ";
472    pub const HEADER_GIT_PREFIX: &str = "git: ";
473    pub const HEADER_GIT_CLEAN_SUFFIX: &str = "✓";
474    pub const HEADER_GIT_DIRTY_SUFFIX: &str = "*";
475    pub const HEADER_UNKNOWN_PLACEHOLDER: &str = "unavailable";
476    pub const HEADER_STATUS_LABEL: &str = "Status";
477    pub const HEADER_STATUS_ACTIVE: &str = "Active";
478    pub const HEADER_STATUS_PAUSED: &str = "Paused";
479    pub const HEADER_MESSAGES_LABEL: &str = "Messages";
480    pub const HEADER_INPUT_LABEL: &str = "Input";
481    pub const HEADER_INPUT_ENABLED: &str = "Enabled";
482    pub const HEADER_INPUT_DISABLED: &str = "Disabled";
483    pub const CHAT_INPUT_PLACEHOLDER_BOOTSTRAP: &str = "Describe your next task (@ for file picker, # for custom prompts, / for slash commands) or run /init to rerun workspace setup.";
484    pub const CHAT_INPUT_PLACEHOLDER_FOLLOW_UP: &str =
485        "Command (@ for file picker, # for custom prompts, / for slash commands)";
486    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";
487    pub const HEADER_META_SEPARATOR: &str = "   ";
488    pub const WELCOME_TEXT_WIDTH: usize = 80;
489    pub const WELCOME_SHORTCUT_SECTION_TITLE: &str = "Keyboard Shortcuts";
490    pub const WELCOME_SHORTCUT_HINT_PREFIX: &str = "Shortcuts:";
491    pub const WELCOME_SHORTCUT_SEPARATOR: &str = "•";
492    pub const WELCOME_SHORTCUT_INDENT: &str = "  ";
493    pub const WELCOME_SLASH_COMMAND_SECTION_TITLE: &str = "Slash Commands";
494    pub const WELCOME_SLASH_COMMAND_LIMIT: usize = 6;
495    pub const WELCOME_SLASH_COMMAND_PREFIX: &str = "/";
496    pub const WELCOME_SLASH_COMMAND_INTRO: &str = "";
497    pub const WELCOME_SLASH_COMMAND_INDENT: &str = "  ";
498    pub const NAVIGATION_BLOCK_TITLE: &str = "Timeline";
499    pub const NAVIGATION_BLOCK_SHORTCUT_NOTE: &str = "Ctrl+T";
500    pub const NAVIGATION_EMPTY_LABEL: &str = "Waiting for activity";
501    pub const NAVIGATION_INDEX_PREFIX: &str = "#";
502    pub const NAVIGATION_LABEL_AGENT: &str = "Agent";
503    pub const NAVIGATION_LABEL_ERROR: &str = "Error";
504    pub const NAVIGATION_LABEL_INFO: &str = "Info";
505    pub const NAVIGATION_LABEL_POLICY: &str = "Policy";
506    pub const NAVIGATION_LABEL_TOOL: &str = "Tool";
507    pub const NAVIGATION_LABEL_USER: &str = "User";
508    pub const NAVIGATION_LABEL_PTY: &str = "PTY";
509    pub const PLAN_BLOCK_TITLE: &str = "TODOs";
510    pub const PLAN_STATUS_EMPTY: &str = "No TODOs";
511    pub const PLAN_STATUS_IN_PROGRESS: &str = "In progress";
512    pub const PLAN_STATUS_DONE: &str = "Done";
513    pub const PLAN_IN_PROGRESS_NOTE: &str = "in progress";
514    pub const SUGGESTION_BLOCK_TITLE: &str = "Slash Commands";
515    pub const STATUS_LINE_MODE: &str = "auto";
516    pub const STATUS_LINE_REFRESH_INTERVAL_MS: u64 = 1000;
517    pub const STATUS_LINE_COMMAND_TIMEOUT_MS: u64 = 200;
518}
519
520/// Reasoning effort configuration constants
521pub mod reasoning {
522    pub const LOW: &str = "low";
523    pub const MEDIUM: &str = "medium";
524    pub const HIGH: &str = "high";
525    pub const ALLOWED_LEVELS: &[&str] = &[LOW, MEDIUM, HIGH];
526    pub const LABEL_LOW: &str = "Low";
527    pub const LABEL_MEDIUM: &str = "Medium";
528    pub const LABEL_HIGH: &str = "High";
529    pub const DESCRIPTION_LOW: &str = "Fast responses with lightweight reasoning.";
530    pub const DESCRIPTION_MEDIUM: &str = "Balanced depth and speed for general tasks.";
531    pub const DESCRIPTION_HIGH: &str = "Maximum reasoning depth for complex problems.";
532}
533
534/// Message role constants to avoid hardcoding strings
535pub mod message_roles {
536    pub const SYSTEM: &str = "system";
537    pub const USER: &str = "user";
538    pub const ASSISTANT: &str = "assistant";
539    pub const TOOL: &str = "tool";
540}
541
542/// URL constants for API endpoints
543pub mod urls {
544    pub const GEMINI_API_BASE: &str = "https://generativelanguage.googleapis.com/v1beta";
545    pub const OPENAI_API_BASE: &str = "https://api.openai.com/v1";
546    pub const ANTHROPIC_API_BASE: &str = "https://api.anthropic.com/v1";
547    pub const ANTHROPIC_API_VERSION: &str = "2023-06-01";
548    pub const MINIMAX_API_BASE: &str = "https://api.minimax.io/anthropic/v1";
549    pub const OPENROUTER_API_BASE: &str = "https://openrouter.ai/api/v1";
550    pub const XAI_API_BASE: &str = "https://api.x.ai/v1";
551    pub const DEEPSEEK_API_BASE: &str = "https://api.deepseek.com/v1";
552    pub const Z_AI_API_BASE: &str = "https://api.z.ai/api";
553    pub const MOONSHOT_API_BASE: &str = "https://api.moonshot.cn/v1";
554    pub const LMSTUDIO_API_BASE: &str = "http://localhost:1234/v1";
555    pub const OLLAMA_API_BASE: &str = "http://localhost:11434";
556    pub const OLLAMA_CLOUD_API_BASE: &str = "https://ollama.com";
557}
558
559/// Environment variable names for overriding provider base URLs
560pub mod env_vars {
561    pub const GEMINI_BASE_URL: &str = "GEMINI_BASE_URL";
562    pub const OPENAI_BASE_URL: &str = "OPENAI_BASE_URL";
563    pub const ANTHROPIC_BASE_URL: &str = "ANTHROPIC_BASE_URL";
564    pub const OPENROUTER_BASE_URL: &str = "OPENROUTER_BASE_URL";
565    pub const XAI_BASE_URL: &str = "XAI_BASE_URL";
566    pub const DEEPSEEK_BASE_URL: &str = "DEEPSEEK_BASE_URL";
567    pub const Z_AI_BASE_URL: &str = "ZAI_BASE_URL";
568    pub const MOONSHOT_BASE_URL: &str = "MOONSHOT_BASE_URL";
569    pub const LMSTUDIO_BASE_URL: &str = "LMSTUDIO_BASE_URL";
570    pub const OLLAMA_BASE_URL: &str = "OLLAMA_BASE_URL";
571    pub const MINIMAX_BASE_URL: &str = "MINIMAX_BASE_URL";
572}
573
574/// HTTP header constants for provider integrations
575pub mod headers {
576    pub const ACCEPT_LANGUAGE: &str = "Accept-Language";
577    pub const ACCEPT_LANGUAGE_DEFAULT: &str = "en-US,en";
578}
579
580/// Tool name constants to avoid hardcoding strings throughout the codebase
581pub mod tools {
582    /// Sole content-search tool (ripgrep-backed)
583    pub const GREP_FILE: &str = "grep_file";
584    pub const LIST_FILES: &str = "list_files";
585    pub const RUN_COMMAND: &str = "run_terminal_cmd";
586    pub const RUN_PTY_CMD: &str = "run_pty_cmd";
587    pub const CREATE_PTY_SESSION: &str = "create_pty_session";
588    pub const LIST_PTY_SESSIONS: &str = "list_pty_sessions";
589    pub const CLOSE_PTY_SESSION: &str = "close_pty_session";
590    pub const SEND_PTY_INPUT: &str = "send_pty_input";
591    pub const READ_PTY_SESSION: &str = "read_pty_session";
592    pub const RESIZE_PTY_SESSION: &str = "resize_pty_session";
593    pub const READ_FILE: &str = "read_file";
594    pub const WRITE_FILE: &str = "write_file";
595    pub const EDIT_FILE: &str = "edit_file";
596    pub const DELETE_FILE: &str = "delete_file";
597    pub const CREATE_FILE: &str = "create_file";
598    pub const AST_GREP_SEARCH: &str = "ast_grep_search";
599    pub const APPLY_PATCH: &str = "apply_patch";
600    pub const CURL: &str = "curl";
601    pub const GIT_DIFF: &str = "git_diff";
602    pub const UPDATE_PLAN: &str = "update_plan";
603
604    // Special wildcard for full access
605    pub const WILDCARD_ALL: &str = "*";
606}
607
608/// Bash tool security validation constants
609pub mod bash {
610    /// Commands that are always blocked for security reasons
611    pub const ALWAYS_BLOCKED_COMMANDS: &[&str] = &[
612        "rm",
613        "rmdir",
614        "del",
615        "format",
616        "fdisk",
617        "mkfs",
618        "dd",
619        "shred",
620        "wipe",
621        "srm",
622        "unlink",
623        "chmod",
624        "chown",
625        "passwd",
626        "usermod",
627        "userdel",
628        "systemctl",
629        "service",
630        "kill",
631        "killall",
632        "pkill",
633        "reboot",
634        "shutdown",
635        "halt",
636        "poweroff",
637        "sudo",
638        "su",
639        "doas",
640        "runas",
641        "mount",
642        "umount",
643        "fsck",
644        "tune2fs", // Filesystem operations
645        "iptables",
646        "ufw",
647        "firewalld", // Firewall
648        "crontab",
649        "at", // Scheduling
650        "podman",
651        "kubectl", // Container/orchestration
652    ];
653
654    /// Network commands that require sandbox to be enabled
655    pub const NETWORK_COMMANDS: &[&str] = &[
656        "curl", "wget", "ftp", "scp", "rsync", "ssh", "telnet", "nc", "ncat", "socat",
657    ];
658
659    /// Commands that are always allowed (safe development tools)
660    pub const ALLOWED_COMMANDS: &[&str] = &[
661        // File system and basic utilities
662        "ls",
663        "pwd",
664        "cat",
665        "head",
666        "tail",
667        "grep",
668        "find",
669        "wc",
670        "sort",
671        "uniq",
672        "cut",
673        "awk",
674        "sed",
675        "echo",
676        "printf",
677        "seq",
678        "basename",
679        "dirname",
680        "date",
681        "cal",
682        "bc",
683        "expr",
684        "test",
685        "[",
686        "]",
687        "true",
688        "false",
689        "sleep",
690        "which",
691        "type",
692        "file",
693        "stat",
694        "du",
695        "df",
696        "ps",
697        "top",
698        "htop",
699        "tree",
700        "less",
701        "more",
702        "tac",
703        "rev",
704        "tr",
705        "fold",
706        "paste",
707        "join",
708        "comm",
709        "diff",
710        "patch",
711        "gzip",
712        "gunzip",
713        "bzip2",
714        "bunzip2",
715        "xz",
716        "unxz",
717        "tar",
718        "zip",
719        "unzip",
720        "shasum",
721        "md5sum",
722        "sha256sum",
723        "sha512sum", // Hashing tools
724        // Version control
725        "git",
726        "hg",
727        "svn",
728        "git-lfs",
729        // Build systems and tools
730        "make",
731        "cmake",
732        "ninja",
733        "meson",
734        "bazel",
735        "buck2",
736        "scons",
737        "waf",
738        "xcodebuild",
739        // Rust/Cargo ecosystem
740        "cargo",
741        "rustc",
742        "rustfmt",
743        "rustup",
744        "clippy",
745        "cargo-clippy",
746        "cargo-fmt",
747        "cargo-build",
748        "cargo-test",
749        "cargo-run",
750        "cargo-check",
751        "cargo-doc",
752        // Node.js/npm ecosystem
753        "npm",
754        "yarn",
755        "pnpm",
756        "bun",
757        "npx",
758        "node",
759        "yarnpkg",
760        "npm-run",
761        "npm-test",
762        "npm-start",
763        "npm-build",
764        "npm-lint",
765        "npm-install",
766        "yarn-test",
767        "yarn-start",
768        "yarn-build",
769        "yarn-lint",
770        "yarn-install",
771        "pnpm-test",
772        "pnpm-start",
773        "pnpm-build",
774        "pnpm-lint",
775        "pnpm-install",
776        "bun-test",
777        "bun-start",
778        "bun-build",
779        "bun-lint",
780        "bun-install",
781        "bun-run",
782        // Python ecosystem
783        "python",
784        "python3",
785        "pip",
786        "pip3",
787        "virtualenv",
788        "venv",
789        "conda",
790        "pytest",
791        "python-m-pytest",
792        "python3-m-pytest",
793        "python-m-pip",
794        "python3-m-pip",
795        "python-m-venv",
796        "python3-m-venv",
797        "black",
798        "flake8",
799        "mypy",
800        "pylint",
801        "isort",
802        "ruff",
803        "bandit",
804        // Java ecosystem
805        "java",
806        "javac",
807        "jar",
808        "jarsigner",
809        "javadoc",
810        "jmap",
811        "jstack",
812        "jstat",
813        "jinfo",
814        "mvn",
815        "gradle",
816        "gradlew",
817        "./gradlew",
818        "mvnw",
819        "./mvnw",
820        "mvn-test",
821        "mvn-compile",
822        "mvn-package",
823        "mvn-install",
824        "mvn-clean",
825        "gradle-test",
826        "gradle-build",
827        "gradle-check",
828        "gradle-run",
829        "gradle-clean",
830        // Go ecosystem
831        "go",
832        "gofmt",
833        "goimports",
834        "golint",
835        "go-test",
836        "go-build",
837        "go-run",
838        "go-mod",
839        "golangci-lint",
840        "go-doc",
841        "go-vet",
842        "go-install",
843        "go-clean",
844        // C/C++ ecosystem
845        "gcc",
846        "g++",
847        "clang",
848        "clang++",
849        "clang-cl",
850        "cpp",
851        "cc",
852        "c++",
853        "gcc-ar",
854        "gcc-nm",
855        "gcc-ranlib",
856        "ld",
857        "lld",
858        "gold",
859        "bfdld",
860        "make",
861        "cmake",
862        "ninja",
863        "autotools",
864        "autoconf",
865        "automake",
866        "libtool",
867        "pkg-config",
868        "pkgconfig",
869        // Testing frameworks and tools
870        "pytest",
871        "jest",
872        "mocha",
873        "jasmine",
874        "karma",
875        "chai",
876        "sinon",
877        "vitest",
878        "cypress",
879        "selenium",
880        "playwright",
881        "testcafe",
882        "tape",
883        "ava",
884        "qunit",
885        "junit",
886        "googletest",
887        "catch2",
888        "benchmark",
889        "hyperfine",
890        // Linting and formatting tools
891        "eslint",
892        "prettier",
893        "tslint",
894        "jshint",
895        "jscs",
896        "stylelint",
897        "htmlhint",
898        "jsonlint",
899        "yamllint",
900        "toml-check",
901        "markdownlint",
902        "remark-cli",
903        "shellcheck",
904        "hadolint",
905        "rustfmt",
906        "gofmt",
907        "black",
908        "isort",
909        "ruff",
910        "clang-format",
911        "clang-tidy",
912        // Documentation tools
913        "doxygen",
914        "sphinx",
915        "mkdocs",
916        "hugo",
917        "jekyll",
918        "gatsby",
919        "next",
920        "nuxt",
921        "vuepress",
922        "docusaurus",
923        "storybook",
924        "gitbook",
925        "readthedocs",
926        "pandoc",
927        "mdbook",
928        "mdBook",
929        // Container tools (safe operations only)
930        "docker",
931        "docker-compose",
932        "docker-buildx",
933        "podman",
934        "buildah",
935        "docker-build",
936        "docker-run",
937        "docker-ps",
938        "docker-images",
939        "docker-inspect",
940        "docker-exec",
941        "docker-logs",
942        "docker-stats",
943        "docker-system",
944        "docker-network",
945        // Database tools (development usage)
946        "sqlite3",
947        "mysql",
948        "psql",
949        "mongosh",
950        "redis-cli",
951        "redis-server",
952        // Cloud and deployment tools
953        "aws",
954        "gcloud",
955        "az",
956        "kubectl",
957        "helm",
958        "terraform",
959        "tf",
960        "terragrunt",
961        "serverless",
962        "sls",
963        "pulumi",
964        "cdk",
965        "sam",
966        "localstack",
967        "minikube",
968        // Security and analysis tools
969        "gitleaks",
970        "trivy",
971        "snyk",
972        "npm-audit",
973        "pip-audit",
974        "cargo-audit",
975        "bandit",
976        "safety",
977        "pipenv",
978        "poetry",
979        // Performance profiling tools
980        "perf",
981        "strace",
982        "ltrace",
983        "valgrind",
984        "gdb",
985        "lldb",
986        "sar",
987        "iostat",
988        "vmstat",
989        "htop",
990        "iotop",
991        "nethogs",
992        "iftop",
993        "speedtest-cli",
994        "ab",
995        "wrk",
996        "hey",
997        // CI/CD tools
998        "gh",
999        "gitlab-ci",
1000        "bitbucket",
1001        "azure-pipelines",
1002        "circleci",
1003        "jenkins",
1004        "drone",
1005        "buildkite",
1006        "travis",
1007        "appveyor",
1008        // Package managers for various languages
1009        "composer",
1010        "pear",
1011        "gem",
1012        "rbenv",
1013        "rvm",
1014        "nvm",
1015        "nodenv",
1016        "pyenv",
1017        "rbenv",
1018        "sdkman",
1019        "jenv",
1020        "lein",
1021        "boot",
1022        "mix",
1023        "rebar3",
1024        "erl",
1025        "elixir",
1026        // Web development tools
1027        "webpack",
1028        "rollup",
1029        "vite",
1030        "parcel",
1031        "esbuild",
1032        "snowpack",
1033        "turbo",
1034        "swc",
1035        "babel",
1036        "postcss",
1037        "sass",
1038        "scss",
1039        "less",
1040        "stylus",
1041        "tailwindcss",
1042        // Mobile development tools
1043        "xcodebuild",
1044        "fastlane",
1045        "gradle",
1046        "./gradlew",
1047        "cordova",
1048        "ionic",
1049        "react-native",
1050        "flutter",
1051        "expo",
1052        "capacitor",
1053    ];
1054}
1055
1056pub mod mcp {
1057    pub const RENDERER_CONTEXT7: &str = "context7";
1058    pub const RENDERER_SEQUENTIAL_THINKING: &str = "sequential-thinking";
1059
1060    /// Default startup timeout for MCP servers in milliseconds (30 seconds)
1061    pub const DEFAULT_STARTUP_TIMEOUT_MS: u64 = 30_000;
1062}
1063
1064pub mod project_doc {
1065    pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1066}
1067
1068pub mod instructions {
1069    pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1070}
1071
1072/// Context window management defaults
1073pub mod context {
1074    /// Approximate character count per token when estimating context size
1075    pub const CHAR_PER_TOKEN_APPROX: usize = 3;
1076
1077    /// Default maximum context window (in approximate tokens)
1078    pub const DEFAULT_MAX_TOKENS: usize = 90_000;
1079
1080    /// Trim target as a percentage of the maximum token budget
1081    pub const DEFAULT_TRIM_TO_PERCENT: u8 = 80;
1082
1083    /// Minimum allowed trim percentage (prevents overly aggressive retention)
1084    pub const MIN_TRIM_RATIO_PERCENT: u8 = 60;
1085
1086    /// Maximum allowed trim percentage (prevents minimal trimming)
1087    pub const MAX_TRIM_RATIO_PERCENT: u8 = 90;
1088
1089    /// Default number of recent turns to preserve verbatim
1090    pub const DEFAULT_PRESERVE_RECENT_TURNS: usize = 12;
1091
1092    /// Minimum number of recent turns that must remain after trimming
1093    pub const MIN_PRESERVE_RECENT_TURNS: usize = 6;
1094
1095    /// Maximum number of recent turns to keep when aggressively reducing context
1096    pub const AGGRESSIVE_PRESERVE_RECENT_TURNS: usize = 8;
1097
1098    /// Maximum number of retry attempts when the provider signals context overflow
1099    pub const CONTEXT_ERROR_RETRY_LIMIT: usize = 2;
1100}
1101
1102/// Chunking constants for large file handling
1103pub mod chunking {
1104    /// Maximum lines before triggering chunking for read_file
1105    pub const MAX_LINES_THRESHOLD: usize = 2_000;
1106
1107    /// Number of lines to read from start of file when chunking
1108    pub const CHUNK_START_LINES: usize = 800;
1109
1110    /// Number of lines to read from end of file when chunking
1111    pub const CHUNK_END_LINES: usize = 800;
1112
1113    /// Maximum lines for terminal command output before truncation
1114    pub const MAX_TERMINAL_OUTPUT_LINES: usize = 3_000;
1115
1116    /// Number of lines to show from start of terminal output when truncating
1117    pub const TERMINAL_OUTPUT_START_LINES: usize = 1_000;
1118
1119    /// Number of lines to show from end of terminal output when truncating
1120    pub const TERMINAL_OUTPUT_END_LINES: usize = 1_000;
1121
1122    /// Maximum content size for write_file before chunking (in bytes)
1123    pub const MAX_WRITE_CONTENT_SIZE: usize = 500_000; // 500KB
1124
1125    /// Chunk size for write operations (in bytes)
1126    pub const WRITE_CHUNK_SIZE: usize = 50_000; // 50KB chunks
1127}
1128
1129/// Diff preview controls for file operations
1130pub mod diff {
1131    /// Maximum number of bytes allowed in diff preview inputs
1132    pub const MAX_PREVIEW_BYTES: usize = 200_000;
1133
1134    /// Number of context lines to include around changes in unified diff output
1135    pub const CONTEXT_RADIUS: usize = 3;
1136
1137    /// Maximum number of diff lines to keep in preview output before condensation
1138    pub const MAX_PREVIEW_LINES: usize = 160;
1139
1140    /// Number of leading diff lines to retain when condensing previews
1141    pub const HEAD_LINE_COUNT: usize = 96;
1142
1143    /// Number of trailing diff lines to retain when condensing previews
1144    pub const TAIL_LINE_COUNT: usize = 32;
1145}