1pub mod app {
3 pub const DISPLAY_NAME: &str = "VT Code";
4}
5
6pub 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
16pub 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
29pub mod models {
31 pub mod google {
33 pub const DEFAULT_MODEL: &str = "gemini-2.5-flash";
35
36 pub const SUPPORTED_MODELS: &[&str] = &[
37 "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-3-pro-image-preview", "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 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 pub const EXTENDED_THINKING_MODELS: &[&str] = &["gemini-3-flash-preview"];
66
67 pub const IMAGE_GENERATION_MODELS: &[&str] = &["gemini-3-pro-image-preview"];
69
70 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 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 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 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", "gpt-5.1-codex", "gpt-5.1-codex-max", "gpt-5.1-mini", "codex-mini-latest",
124 "gpt-oss-20b",
125 "gpt-oss-120b",
126 ];
127
128 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 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 pub const TOOL_UNAVAILABLE_MODELS: &[&str] = &[];
159
160 pub const HARMONY_MODELS: &[&str] = &[GPT_OSS_20B, GPT_OSS_120B];
162
163 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"; pub const GPT_5_1_CODEX: &str = "gpt-5.1-codex"; pub const GPT_5_1_CODEX_MAX: &str = "gpt-5.1-codex-max"; pub const GPT_5_1_MINI: &str = "gpt-5.1-mini"; 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 pub mod huggingface {
182 pub const DEFAULT_MODEL: &str = OPENAI_GPT_OSS_120B;
183 pub const SUPPORTED_MODELS: &[&str] = &[
184 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 DEEPSEEK_V32,
195 OPENAI_GPT_OSS_20B,
196 ZAI_GLM_46,
197 ZAI_GLM_47,
198 ZAI_GLM_47_NOVITA,
199 ZAI_GLM_47_FLASH_NOVITA,
200 MOONSHOT_KIMI_K2_THINKING,
201 ZAI_GLM_45V,
203 MINIMAX_M2_1_NOVITA,
205 DEEPSEEK_V32_NOVITA,
206 XIAOMI_MIMO_V2_FLASH_NOVITA,
207 ];
208
209 pub const GOOGLE_GEMMA_2_2B_IT: &str = "google/gemma-2-2b-it";
211 pub const QWEN3_CODER_480B_A35B_INSTRUCT: &str = "Qwen/Qwen3-Coder-480B-A35B-Instruct";
212 pub const OPENAI_GPT_OSS_120B: &str = "openai/gpt-oss-120b";
213 pub const ZAI_GLM_45: &str = "zai-org/GLM-4.5:zai-org";
214 pub const QWEN3_4B_THINKING_2507: &str = "Qwen/Qwen3-4B-Thinking-2507";
215 pub const QWEN25_7B_INSTRUCT_1M: &str = "Qwen/Qwen2.5-7B-Instruct-1M";
216 pub const QWEN25_CODER_32B_INSTRUCT: &str = "Qwen/Qwen2.5-Coder-32B-Instruct";
217 pub const DEEPSEEK_R1: &str = "deepseek-ai/DeepSeek-R1";
218
219 pub const DEEPSEEK_V32: &str = "deepseek-ai/DeepSeek-V3.2";
221 pub const OPENAI_GPT_OSS_20B: &str = "openai/gpt-oss-20b";
222 pub const ZAI_GLM_46: &str = "zai-org/GLM-4.6:zai-org";
223 pub const ZAI_GLM_47: &str = "zai-org/GLM-4.7:zai-org";
224 pub const ZAI_GLM_47_NOVITA: &str = "zai-org/GLM-4.7:novita";
225 pub const ZAI_GLM_47_FLASH_NOVITA: &str = "zai-org/GLM-4.7-Flash:novita";
226 pub const MOONSHOT_KIMI_K2_THINKING: &str = "moonshotai/Kimi-K2-Thinking";
227
228 pub const ZAI_GLM_45V: &str = "zai-org/GLM-4.5V:zai-org";
230 pub const MINIMAX_M2_1_NOVITA: &str = "MiniMaxAI/MiniMax-M2.1:novita";
231 pub const DEEPSEEK_V32_NOVITA: &str = "deepseek-ai/DeepSeek-V3.2:novita";
232 pub const XIAOMI_MIMO_V2_FLASH_NOVITA: &str = "XiaomiMiMo/MiMo-V2-Flash:novita";
233
234 pub const REASONING_MODELS: &[&str] = &[
235 QWEN3_CODER_480B_A35B_INSTRUCT,
237 OPENAI_GPT_OSS_120B,
238 ZAI_GLM_45,
239 QWEN3_4B_THINKING_2507,
240 DEEPSEEK_R1,
241 DEEPSEEK_V32,
243 OPENAI_GPT_OSS_20B,
244 ZAI_GLM_46,
245 ZAI_GLM_47,
246 ZAI_GLM_47_NOVITA,
247 ZAI_GLM_47_FLASH_NOVITA,
248 MOONSHOT_KIMI_K2_THINKING,
249 ZAI_GLM_45V,
250 DEEPSEEK_V32_NOVITA,
251 MINIMAX_M2_1_NOVITA,
252 XIAOMI_MIMO_V2_FLASH_NOVITA,
253 ];
254 }
255
256 pub mod zai {
258 pub const DEFAULT_MODEL: &str = "glm-4.7";
259 pub const SUPPORTED_MODELS: &[&str] = &[
260 "glm-4-plus",
261 "glm-4.7",
262 "glm-4.7-flash",
263 "glm-4.6",
264 "glm-4.6v",
265 "glm-4.6v-flash",
266 "glm-4.6v-flashx",
267 "glm-4.5",
268 "glm-4.5-air",
269 "glm-4.5-x",
270 "glm-4.5-airx",
271 "glm-4.5-flash",
272 "glm-4.5v",
273 "glm-4-32b-0414-128k",
274 ];
275
276 pub const REASONING_MODELS: &[&str] = &[
277 "glm-4-plus",
278 "glm-4.7",
279 "glm-4.7-flash",
280 "glm-4.6",
281 "glm-4.5",
282 "glm-4.5-air",
283 "glm-4.5-x",
284 "glm-4.5-airx",
285 "glm-4.5-flash",
286 ];
287
288 pub const GLM_4_PLUS: &str = "glm-4-plus";
289 pub const GLM_4_PLUS_DEEP_THINKING: &str = "glm-4-plus:thinking";
290 pub const GLM_4_7: &str = "glm-4.7";
291 pub const GLM_4_7_DEEP_THINKING: &str = "glm-4.7:thinking";
292 pub const GLM_4_7_FLASH: &str = "glm-4.7-flash";
293 pub const GLM_4_6: &str = "glm-4.6";
294 pub const GLM_4_6_DEEP_THINKING: &str = "glm-4.6:thinking";
295 pub const GLM_4_6V: &str = "glm-4.6v";
296 pub const GLM_4_6V_FLASH: &str = "glm-4.6v-flash";
297 pub const GLM_4_6V_FLASHX: &str = "glm-4.6v-flashx";
298 pub const GLM_4_5: &str = "glm-4.5";
299 pub const GLM_4_5_DEEP_THINKING: &str = "glm-4.5:thinking";
300 pub const GLM_4_5_AIR: &str = "glm-4.5-air";
301 pub const GLM_4_5_X: &str = "glm-4.5-x";
302 pub const GLM_4_5_AIRX: &str = "glm-4.5-airx";
303 pub const GLM_4_5_FLASH: &str = "glm-4.5-flash";
304 pub const GLM_4_5V: &str = "glm-4.5v";
305 pub const GLM_4_32B_0414_128K: &str = "glm-4-32b-0414-128k";
306 }
307
308 pub mod moonshot {
310 pub const DEFAULT_MODEL: &str = "kimi-k2-0905";
312 pub const SUPPORTED_MODELS: &[&str] = &[DEFAULT_MODEL];
313 }
314
315 #[cfg(not(docsrs))]
317 pub mod openrouter {
318 include!(concat!(env!("OUT_DIR"), "/openrouter_constants.rs"));
319 }
320
321 #[cfg(docsrs)]
322 pub mod openrouter {
323 pub const SUPPORTED_MODELS: &[&str] = &[];
324 pub const REASONING_MODELS: &[&str] = &[];
325 pub const TOOL_UNAVAILABLE_MODELS: &[&str] = &[];
326
327 pub const X_AI_GROK_CODE_FAST_1: &str = "x-ai/grok-code-fast-1";
329 pub const QWEN3_CODER: &str = "qwen/qwen3-coder";
330 pub const ANTHROPIC_CLAUDE_SONNET_4_5: &str = "anthropic/claude-sonnet-4.5";
331
332 pub mod vendor {
333 pub mod openrouter {
334 pub const MODELS: &[&str] = &[];
335 }
336 }
337 }
338
339 pub mod lmstudio {
341 pub const DEFAULT_MODEL: &str = META_LLAMA_31_8B_INSTRUCT;
342 pub const SUPPORTED_MODELS: &[&str] = &[
343 META_LLAMA_3_8B_INSTRUCT,
344 META_LLAMA_31_8B_INSTRUCT,
345 QWEN25_7B_INSTRUCT,
346 GEMMA_2_2B_IT,
347 GEMMA_2_9B_IT,
348 PHI_31_MINI_4K_INSTRUCT,
349 ];
350
351 pub const META_LLAMA_3_8B_INSTRUCT: &str = "lmstudio-community/meta-llama-3-8b-instruct";
352 pub const META_LLAMA_31_8B_INSTRUCT: &str = "lmstudio-community/meta-llama-3.1-8b-instruct";
353 pub const QWEN25_7B_INSTRUCT: &str = "lmstudio-community/qwen2.5-7b-instruct";
354 pub const GEMMA_2_2B_IT: &str = "lmstudio-community/gemma-2-2b-it";
355 pub const GEMMA_2_9B_IT: &str = "lmstudio-community/gemma-2-9b-it";
356 pub const PHI_31_MINI_4K_INSTRUCT: &str = "lmstudio-community/phi-3.1-mini-4k-instruct";
357 }
358
359 pub mod ollama {
360 pub const DEFAULT_LOCAL_MODEL: &str = "gpt-oss:20b";
361 pub const DEFAULT_CLOUD_MODEL: &str = "gpt-oss:120b-cloud";
362 pub const DEFAULT_MODEL: &str = DEFAULT_LOCAL_MODEL;
363 pub const SUPPORTED_MODELS: &[&str] = &[
364 DEFAULT_LOCAL_MODEL,
365 QWEN3_1_7B,
366 DEFAULT_CLOUD_MODEL,
367 GPT_OSS_20B_CLOUD,
368 DEEPSEEK_V32_CLOUD,
369 QWEN3_NEXT_80B_CLOUD,
370 MISTRAL_LARGE_3_675B_CLOUD,
371 KIMI_K2_THINKING_CLOUD,
372 KIMI_K2_1T_CLOUD,
373 QWEN3_CODER_480B_CLOUD,
374 GLM_46_CLOUD,
375 GLM_47_CLOUD,
376 GEMINI_3_PRO_PREVIEW_LATEST_CLOUD,
377 GEMINI_3_FLASH_PREVIEW_CLOUD,
378 DEVSTRAL_2_123B_CLOUD,
379 MINIMAX_M2_CLOUD,
380 MINIMAX_M21_CLOUD,
381 NEMOTRON_3_NANO_30B_CLOUD,
382 ];
383
384 pub const REASONING_MODELS: &[&str] = &[
386 GPT_OSS_20B,
387 GPT_OSS_20B_CLOUD,
388 GPT_OSS_120B_CLOUD,
389 QWEN3_1_7B,
390 DEEPSEEK_V32_CLOUD,
391 QWEN3_NEXT_80B_CLOUD,
392 MISTRAL_LARGE_3_675B_CLOUD,
393 KIMI_K2_THINKING_CLOUD,
394 KIMI_K2_1T_CLOUD,
395 QWEN3_CODER_480B_CLOUD,
396 GLM_46_CLOUD,
397 GLM_47_CLOUD,
398 GEMINI_3_PRO_PREVIEW_LATEST_CLOUD,
399 GEMINI_3_FLASH_PREVIEW_CLOUD,
400 DEVSTRAL_2_123B_CLOUD,
401 MINIMAX_M2_CLOUD,
402 MINIMAX_M21_CLOUD,
403 NEMOTRON_3_NANO_30B_CLOUD,
404 ];
405
406 pub const REASONING_LEVEL_MODELS: &[&str] = &[
408 GPT_OSS_20B,
409 GPT_OSS_20B_CLOUD,
410 GPT_OSS_120B_CLOUD,
411 GLM_46_CLOUD,
412 GLM_47_CLOUD,
413 MINIMAX_M2_CLOUD,
414 MINIMAX_M21_CLOUD,
415 GEMINI_3_FLASH_PREVIEW_CLOUD,
416 ];
417
418 pub const GPT_OSS_20B: &str = DEFAULT_LOCAL_MODEL;
419 pub const GPT_OSS_20B_CLOUD: &str = "gpt-oss:20b-cloud";
420 pub const GPT_OSS_120B_CLOUD: &str = DEFAULT_CLOUD_MODEL;
421 pub const QWEN3_1_7B: &str = "qwen3:1.7b";
422 pub const DEEPSEEK_V32_CLOUD: &str = "deepseek-v3.2:cloud";
423 pub const QWEN3_NEXT_80B_CLOUD: &str = "qwen3-next:80b-cloud";
424 pub const MISTRAL_LARGE_3_675B_CLOUD: &str = "mistral-large-3:675b-cloud";
425 pub const KIMI_K2_THINKING_CLOUD: &str = "kimi-k2-thinking:cloud";
426 pub const KIMI_K2_1T_CLOUD: &str = "kimi-k2:1t-cloud";
427 pub const QWEN3_CODER_480B_CLOUD: &str = "qwen3-coder:480b-cloud";
428 pub const GLM_46_CLOUD: &str = "glm-4.6:cloud";
429 pub const GLM_47_CLOUD: &str = "glm-4.7:cloud";
430 pub const GEMINI_3_PRO_PREVIEW_LATEST_CLOUD: &str = "gemini-3-pro-preview:latest";
431 pub const GEMINI_3_FLASH_PREVIEW_CLOUD: &str = "gemini-3-flash-preview:cloud";
432 pub const DEVSTRAL_2_123B_CLOUD: &str = "devstral-2:123b-cloud";
433 pub const MINIMAX_M2_CLOUD: &str = "minimax-m2:cloud";
434 pub const MINIMAX_M21_CLOUD: &str = "minimax-m2.1:cloud";
435 pub const NEMOTRON_3_NANO_30B_CLOUD: &str = "nemotron-3-nano:30b-cloud";
436 }
437
438 pub mod deepseek {
440 pub const DEFAULT_MODEL: &str = "deepseek-chat";
441 pub const SUPPORTED_MODELS: &[&str] = &["deepseek-chat", "deepseek-reasoner"];
442
443 pub const DEEPSEEK_CHAT: &str = "deepseek-chat";
444 pub const DEEPSEEK_REASONER: &str = "deepseek-reasoner";
445 }
446
447 pub mod anthropic {
449 pub const DEFAULT_MODEL: &str = "claude-sonnet-4-5-20250929";
451 pub const SUPPORTED_MODELS: &[&str] = &[
452 "claude-sonnet-4-5-20250929", "claude-haiku-4-5-20251001", "claude-opus-4-5-20251101", "claude-opus-4-1-20250805", "claude-sonnet-4-5", "claude-haiku-4-5", "claude-opus-4-5", "claude-opus-4-1", "claude-sonnet-4-20250514", "claude-opus-4-20250514", "claude-sonnet-4-0", "claude-opus-4-0", "claude-3-7-sonnet-20250219", "claude-3-7-sonnet-latest", "claude-3-5-sonnet-20241022", "claude-3-5-sonnet-latest", "claude-3-5-haiku-20241022", "claude-3-5-haiku-latest", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", ];
477
478 pub const CLAUDE_SONNET_4_5_20250929: &str = "claude-sonnet-4-5-20250929";
480 pub const CLAUDE_HAIKU_4_5_20251001: &str = "claude-haiku-4-5-20251001";
481 pub const CLAUDE_OPUS_4_5_20251101: &str = "claude-opus-4-5-20251101";
482 pub const CLAUDE_OPUS_4_1_20250805: &str = "claude-opus-4-1-20250805";
483 pub const CLAUDE_SONNET_4_20250514: &str = "claude-sonnet-4-20250514";
484 pub const CLAUDE_OPUS_4_20250514: &str = "claude-opus-4-20250514";
485 pub const CLAUDE_3_7_SONNET_20250219: &str = "claude-3-7-sonnet-20250219";
486 pub const CLAUDE_3_5_SONNET_20241022: &str = "claude-3-5-sonnet-20241022";
487 pub const CLAUDE_3_5_HAIKU_20241022: &str = "claude-3-5-haiku-20241022";
488
489 pub const CLAUDE_HAIKU_4_5: &str = "claude-haiku-4-5";
491 pub const CLAUDE_SONNET_4_5: &str = "claude-sonnet-4-5";
492 pub const CLAUDE_OPUS_4_5: &str = "claude-opus-4-5";
493 pub const CLAUDE_OPUS_4_1: &str = "claude-opus-4-1";
494 pub const CLAUDE_SONNET_4_0: &str = "claude-sonnet-4-0";
495 pub const CLAUDE_OPUS_4_0: &str = "claude-opus-4-0";
496 pub const CLAUDE_3_7_SONNET_LATEST: &str = "claude-3-7-sonnet-latest";
497 pub const CLAUDE_3_5_SONNET_LATEST: &str = "claude-3-5-sonnet-latest";
498 pub const CLAUDE_3_5_HAIKU_LATEST: &str = "claude-3-5-haiku-latest";
499
500 pub const CLAUDE_OPUS_4_1_20250805_LEGACY: &str = "claude-opus-4-1-20250805";
502
503 pub const REASONING_MODELS: &[&str] = &[
505 CLAUDE_SONNET_4_5_20250929,
506 CLAUDE_HAIKU_4_5_20251001,
507 CLAUDE_OPUS_4_5_20251101,
508 CLAUDE_OPUS_4_1_20250805,
509 CLAUDE_SONNET_4_5,
510 CLAUDE_HAIKU_4_5,
511 CLAUDE_OPUS_4_5,
512 CLAUDE_OPUS_4_1,
513 "claude-sonnet-4-20250514",
514 "claude-opus-4-20250514",
515 "claude-sonnet-4-0",
516 "claude-opus-4-0",
517 "claude-3-7-sonnet-20250219",
518 "claude-3-7-sonnet-latest",
519 ];
520
521 pub const INTERLEAVED_THINKING_BETA: &str = "interleaved-thinking-2025-05-14";
523 pub const INTERLEAVED_THINKING_TYPE_ENABLED: &str = "enabled";
524 }
525
526 pub mod minimax {
528 pub const DEFAULT_MODEL: &str = MINIMAX_M2_1;
529 pub const SUPPORTED_MODELS: &[&str] = &[MINIMAX_M2_1, MINIMAX_M2_1_LIGHTNING, MINIMAX_M2];
530 pub const MINIMAX_M2_1: &str = "MiniMax-M2.1";
531 pub const MINIMAX_M2_1_LIGHTNING: &str = "MiniMax-M2.1-lightning";
532 pub const MINIMAX_M2: &str = "MiniMax-M2";
533 }
534
535 pub mod xai {
537 pub const DEFAULT_MODEL: &str = "grok-4";
538 pub const SUPPORTED_MODELS: &[&str] = &[
539 "grok-4",
540 "grok-4-mini",
541 "grok-4-code",
542 "grok-4-code-latest",
543 "grok-4-vision",
544 "grok-4-1-fast",
545 "grok-code-fast-1",
546 "grok-4-fast",
547 "grok-3",
548 "grok-3-mini",
549 "grok-2-1212",
550 "grok-2-vision-1212",
551 "grok-beta",
552 ];
553
554 pub const GROK_4: &str = "grok-4";
555 pub const GROK_4_MINI: &str = "grok-4-mini";
556 pub const GROK_4_CODE: &str = "grok-4-code";
557 pub const GROK_4_CODE_LATEST: &str = "grok-4-code-latest";
558 pub const GROK_4_VISION: &str = "grok-4-vision";
559 pub const GROK_4_1_FAST: &str = "grok-4-1-fast";
560 pub const GROK_CODE_FAST_1: &str = "grok-code-fast-1";
561 pub const GROK_4_FAST: &str = "grok-4-fast";
562 pub const GROK_3: &str = "grok-3";
563 pub const GROK_3_MINI: &str = "grok-3-mini";
564 pub const GROK_2_1212: &str = "grok-2-1212";
565 pub const GROK_2_VISION_1212: &str = "grok-2-vision-1212";
566 pub const GROK_BETA: &str = "grok-beta";
567 }
568
569 pub const GEMINI_2_5_FLASH_PREVIEW: &str = google::GEMINI_2_5_FLASH_PREVIEW;
571 pub const GEMINI_2_5_FLASH: &str = google::GEMINI_2_5_FLASH;
572 pub const GEMINI_2_5_PRO: &str = google::GEMINI_2_5_PRO;
573 pub const GEMINI_2_5_FLASH_LITE: &str = google::GEMINI_2_5_FLASH_LITE;
574 pub const GEMINI_3_PRO_PREVIEW: &str = google::GEMINI_3_PRO_PREVIEW;
575 pub const GEMINI_3_FLASH_PREVIEW: &str = google::GEMINI_3_FLASH_PREVIEW;
576 pub const GPT_5: &str = openai::GPT_5;
577 pub const GPT_5_CODEX: &str = openai::GPT_5_CODEX;
578 pub const GPT_5_MINI: &str = openai::GPT_5_MINI;
579 pub const GPT_5_NANO: &str = openai::GPT_5_NANO;
580 pub const GPT_5_2: &str = openai::GPT_5_2;
581 pub const GPT_5_2_ALIAS: &str = openai::GPT_5_2_ALIAS;
582 pub const GPT_5_1: &str = openai::GPT_5_1;
583 pub const GPT_5_1_CODEX: &str = openai::GPT_5_1_CODEX;
584 pub const GPT_5_1_CODEX_MAX: &str = openai::GPT_5_1_CODEX_MAX;
585 pub const GPT_5_1_MINI: &str = openai::GPT_5_1_MINI;
586 pub const CODEX_MINI: &str = openai::CODEX_MINI_LATEST;
587 pub const CODEX_MINI_LATEST: &str = openai::CODEX_MINI_LATEST;
588 pub const CLAUDE_OPUS_4_1_20250805: &str = anthropic::CLAUDE_OPUS_4_1_20250805;
589 pub const CLAUDE_OPUS_4_5_20251101: &str = anthropic::CLAUDE_OPUS_4_5_20251101;
590 pub const CLAUDE_OPUS_4_20250514: &str = anthropic::CLAUDE_OPUS_4_20250514;
591 pub const CLAUDE_SONNET_4_20250514: &str = anthropic::CLAUDE_SONNET_4_20250514;
592 pub const CLAUDE_3_7_SONNET_20250219: &str = anthropic::CLAUDE_3_7_SONNET_20250219;
593 pub const CLAUDE_3_5_SONNET_20241022: &str = anthropic::CLAUDE_3_5_SONNET_20241022;
594 pub const CLAUDE_SONNET_4_5: &str = anthropic::CLAUDE_SONNET_4_5;
595 pub const CLAUDE_HAIKU_4_5: &str = anthropic::CLAUDE_HAIKU_4_5;
596 pub const CLAUDE_SONNET_4_5_20250929: &str = anthropic::CLAUDE_SONNET_4_5_20250929;
597 pub const CLAUDE_HAIKU_4_5_20251001: &str = anthropic::CLAUDE_HAIKU_4_5_20251001;
598 pub const CLAUDE_OPUS_4_1: &str = anthropic::CLAUDE_OPUS_4_1;
599 pub const CLAUDE_OPUS_4_5: &str = anthropic::CLAUDE_OPUS_4_5;
600 pub const CLAUDE_SONNET_4_0: &str = anthropic::CLAUDE_SONNET_4_0;
601 pub const CLAUDE_OPUS_4_0: &str = anthropic::CLAUDE_OPUS_4_0;
602 pub const CLAUDE_3_7_SONNET_LATEST: &str = anthropic::CLAUDE_3_7_SONNET_LATEST;
603 pub const CLAUDE_3_5_SONNET_LATEST: &str = anthropic::CLAUDE_3_5_SONNET_LATEST;
604 pub const CLAUDE_3_5_HAIKU_20241022: &str = anthropic::CLAUDE_3_5_HAIKU_20241022;
605 pub const CLAUDE_3_5_HAIKU_LATEST: &str = anthropic::CLAUDE_3_5_HAIKU_LATEST;
606 pub const MINIMAX_M2: &str = minimax::MINIMAX_M2;
607 pub const XAI_GROK_4: &str = xai::GROK_4;
608 pub const XAI_GROK_4_MINI: &str = xai::GROK_4_MINI;
609 pub const XAI_GROK_4_CODE: &str = xai::GROK_4_CODE;
610 pub const XAI_GROK_4_CODE_LATEST: &str = xai::GROK_4_CODE_LATEST;
611 pub const XAI_GROK_4_VISION: &str = xai::GROK_4_VISION;
612 pub const XAI_GROK_3: &str = xai::GROK_3;
613 pub const XAI_GROK_2: &str = xai::GROK_2_1212;
614 pub const XAI_GROK_BETA: &str = xai::GROK_BETA;
615 pub const DEEPSEEK_CHAT: &str = deepseek::DEEPSEEK_CHAT;
616 pub const DEEPSEEK_REASONER: &str = deepseek::DEEPSEEK_REASONER;
617 #[cfg(not(docsrs))]
618 pub const OPENROUTER_X_AI_GROK_CODE_FAST_1: &str = openrouter::X_AI_GROK_CODE_FAST_1;
619 #[cfg(docsrs)]
620 pub const OPENROUTER_X_AI_GROK_CODE_FAST_1: &str = "x-ai/grok-code-fast-1";
621 #[cfg(not(docsrs))]
622 pub const OPENROUTER_QWEN3_CODER: &str = openrouter::QWEN3_CODER;
623 #[cfg(docsrs)]
624 pub const OPENROUTER_QWEN3_CODER: &str = "qwen/qwen3-coder";
625 #[cfg(not(docsrs))]
626 pub const OPENROUTER_ANTHROPIC_CLAUDE_SONNET_4_5: &str =
627 openrouter::ANTHROPIC_CLAUDE_SONNET_4_5;
628 #[cfg(docsrs)]
629 pub const OPENROUTER_ANTHROPIC_CLAUDE_SONNET_4_5: &str = "anthropic/claude-sonnet-4.5";
630}
631
632pub mod prompt_cache {
634 pub const DEFAULT_ENABLED: bool = true;
635 pub const DEFAULT_CACHE_DIR: &str = ".vtcode/cache/prompts";
636 pub const DEFAULT_MAX_ENTRIES: usize = 1_000;
637 pub const DEFAULT_MAX_AGE_DAYS: u64 = 30;
638 pub const DEFAULT_AUTO_CLEANUP: bool = true;
639 pub const DEFAULT_MIN_QUALITY_THRESHOLD: f64 = 0.7;
640
641 pub const OPENAI_MIN_PREFIX_TOKENS: u32 = 1_024;
642 pub const GEMINI_MIN_PREFIX_TOKENS: u32 = 1_024;
643 pub const OPENAI_IDLE_EXPIRATION_SECONDS: u64 = 60 * 60; pub const ANTHROPIC_DEFAULT_TTL_SECONDS: u64 = 5 * 60; pub const ANTHROPIC_EXTENDED_TTL_SECONDS: u64 = 60 * 60; pub const ANTHROPIC_TOOLS_TTL_SECONDS: u64 = 60 * 60; pub const ANTHROPIC_MESSAGES_TTL_SECONDS: u64 = 5 * 60; pub const ANTHROPIC_MAX_BREAKPOINTS: u8 = 4;
650 pub const ANTHROPIC_MIN_MESSAGE_LENGTH_FOR_CACHE: usize = 256;
651
652 pub const GEMINI_EXPLICIT_DEFAULT_TTL_SECONDS: u64 = 60 * 60; pub const OPENROUTER_CACHE_DISCOUNT_ENABLED: bool = true;
655 pub const XAI_CACHE_ENABLED: bool = true;
656 pub const DEEPSEEK_CACHE_ENABLED: bool = true;
657 pub const ZAI_CACHE_ENABLED: bool = false;
658 pub const MOONSHOT_CACHE_ENABLED: bool = true;
659}
660
661pub mod model_helpers {
663 use super::models;
664
665 pub fn supported_for(provider: &str) -> Option<&'static [&'static str]> {
667 match provider {
668 "google" | "gemini" => Some(models::google::SUPPORTED_MODELS),
669 "openai" => Some(models::openai::SUPPORTED_MODELS),
670 "anthropic" => Some(models::anthropic::SUPPORTED_MODELS),
671 "minimax" => Some(models::minimax::SUPPORTED_MODELS),
672 "deepseek" => Some(models::deepseek::SUPPORTED_MODELS),
673 #[cfg(not(docsrs))]
674 "openrouter" => Some(models::openrouter::SUPPORTED_MODELS),
675 #[cfg(docsrs)]
676 "openrouter" => Some(&[]),
677 "moonshot" => Some(models::moonshot::SUPPORTED_MODELS),
678 "xai" => Some(models::xai::SUPPORTED_MODELS),
679 "zai" => Some(models::zai::SUPPORTED_MODELS),
680 "ollama" => Some(models::ollama::SUPPORTED_MODELS),
681 _ => None,
682 }
683 }
684
685 pub fn default_for(provider: &str) -> Option<&'static str> {
687 match provider {
688 "google" | "gemini" => Some(models::google::DEFAULT_MODEL),
689 "openai" => Some(models::openai::DEFAULT_MODEL),
690 "anthropic" => Some(models::anthropic::DEFAULT_MODEL),
691 "minimax" => Some(models::minimax::DEFAULT_MODEL),
692 "deepseek" => Some(models::deepseek::DEFAULT_MODEL),
693 #[cfg(not(docsrs))]
694 "openrouter" => Some(models::openrouter::DEFAULT_MODEL),
695 #[cfg(docsrs)]
696 "openrouter" => Some("openrouter/auto"), "xai" => Some(models::xai::DEFAULT_MODEL),
698 "zai" => Some(models::zai::DEFAULT_MODEL),
699 "ollama" => Some(models::ollama::DEFAULT_MODEL),
700 _ => None,
701 }
702 }
703
704 pub fn is_valid(provider: &str, model: &str) -> bool {
706 supported_for(provider)
707 .map(|list| list.contains(&model))
708 .unwrap_or(false)
709 }
710}
711
712pub mod env {
714 pub mod acp {
716 #[derive(Debug, Clone, Copy)]
717 pub enum AgentClientProtocolEnvKey {
718 Enabled,
719 ZedEnabled,
720 ZedToolsReadFileEnabled,
721 ZedToolsListFilesEnabled,
722 ZedWorkspaceTrust,
723 }
724
725 impl AgentClientProtocolEnvKey {
726 pub fn as_str(self) -> &'static str {
727 match self {
728 Self::Enabled => "VT_ACP_ENABLED",
729 Self::ZedEnabled => "VT_ACP_ZED_ENABLED",
730 Self::ZedToolsReadFileEnabled => "VT_ACP_ZED_TOOLS_READ_FILE_ENABLED",
731 Self::ZedToolsListFilesEnabled => "VT_ACP_ZED_TOOLS_LIST_FILES_ENABLED",
732 Self::ZedWorkspaceTrust => "VT_ACP_ZED_WORKSPACE_TRUST",
733 }
734 }
735 }
736 }
737}
738
739pub mod defaults {
741 use super::{models, ui};
742
743 pub const DEFAULT_MODEL: &str = models::openai::DEFAULT_MODEL;
744 pub const DEFAULT_CLI_MODEL: &str = models::openai::DEFAULT_MODEL;
745 pub const DEFAULT_PROVIDER: &str = "openai";
746 pub const DEFAULT_API_KEY_ENV: &str = "OPENAI_API_KEY";
747 pub const DEFAULT_THEME: &str = "ciapre-dark";
748 pub const DEFAULT_FULL_AUTO_MAX_TURNS: usize = 30;
749 pub const DEFAULT_MAX_TOOL_LOOPS: usize = 200;
750 pub const DEFAULT_MAX_REPEATED_TOOL_CALLS: usize = 3;
751 pub const DEFAULT_PTY_STDOUT_TAIL_LINES: usize = 20;
752 pub const DEFAULT_PTY_SCROLLBACK_LINES: usize = 400;
753 pub const DEFAULT_TOOL_OUTPUT_MODE: &str = ui::TOOL_OUTPUT_MODE_COMPACT;
754
755 pub const DEFAULT_PTY_OUTPUT_MAX_TOKENS: usize = 8_000;
756
757 pub const DEFAULT_PTY_OUTPUT_BYTE_FUSE: usize = 40 * 1024; }
761
762pub mod ui {
763 pub const TOOL_OUTPUT_MODE_COMPACT: &str = "compact";
764 pub const TOOL_OUTPUT_MODE_FULL: &str = "full";
765 pub const DEFAULT_INLINE_VIEWPORT_ROWS: u16 = 16;
766 pub const DEFAULT_REASONING_VISIBLE: bool = false;
767 pub const SLASH_SUGGESTION_LIMIT: usize = 50; pub const SLASH_PALETTE_MIN_WIDTH: u16 = 40;
769 pub const SLASH_PALETTE_MIN_HEIGHT: u16 = 9;
770 pub const SLASH_PALETTE_HORIZONTAL_MARGIN: u16 = 8;
771 pub const SLASH_PALETTE_TOP_OFFSET: u16 = 3;
772 pub const SLASH_PALETTE_CONTENT_PADDING: u16 = 6;
773 pub const SLASH_PALETTE_HINT_PRIMARY: &str = "Type to filter slash commands.";
774 pub const SLASH_PALETTE_HINT_SECONDARY: &str = "Press Enter to apply • Esc to dismiss.";
775 pub const MODAL_MIN_WIDTH: u16 = 36;
776 pub const MODAL_MIN_HEIGHT: u16 = 9;
777 pub const MODAL_LIST_MIN_HEIGHT: u16 = 12;
778 pub const MODAL_WIDTH_RATIO: f32 = 0.6;
779 pub const MODAL_HEIGHT_RATIO: f32 = 0.6;
780 pub const MODAL_MAX_WIDTH_RATIO: f32 = 0.9;
781 pub const MODAL_MAX_HEIGHT_RATIO: f32 = 0.8;
782 pub const MODAL_CONTENT_HORIZONTAL_PADDING: u16 = 8;
783 pub const MODAL_CONTENT_VERTICAL_PADDING: u16 = 6;
784 pub const MODAL_INSTRUCTIONS_TITLE: &str = "";
785 pub const MODAL_INSTRUCTIONS_BULLET: &str = "•";
786 pub const INLINE_HEADER_HEIGHT: u16 = 3;
787 pub const INLINE_INPUT_HEIGHT: u16 = 4;
788 pub const INLINE_INPUT_MAX_LINES: usize = 10;
789 pub const INLINE_NAVIGATION_PERCENT: u16 = 28;
790 pub const INLINE_NAVIGATION_MIN_WIDTH: u16 = 24;
791 pub const INLINE_CONTENT_MIN_WIDTH: u16 = 48;
792 pub const INLINE_STACKED_NAVIGATION_PERCENT: u16 = INLINE_NAVIGATION_PERCENT;
793 pub const INLINE_SCROLLBAR_EDGE_PADDING: u16 = 1;
794 pub const INLINE_TRANSCRIPT_BOTTOM_PADDING: u16 = 6;
795 pub const INLINE_PREVIEW_MAX_CHARS: usize = 56;
796 pub const INLINE_PREVIEW_ELLIPSIS: &str = "…";
797 pub const HEADER_HIGHLIGHT_PREVIEW_MAX_CHARS: usize = 48;
798 pub const INLINE_AGENT_MESSAGE_LEFT_PADDING: &str = "";
799 pub const INLINE_AGENT_QUOTE_PREFIX: &str = "";
800 pub const INLINE_USER_MESSAGE_DIVIDER_SYMBOL: &str = "─";
801
802 pub const SCROLL_INDICATOR_FORMAT: &str = "↕";
804 pub const SCROLL_INDICATOR_ENABLED: bool = true;
806
807 pub const INLINE_BLOCK_TOP_LEFT: &str = "â•";
808 pub const INLINE_BLOCK_TOP_RIGHT: &str = "â•®";
809 pub const INLINE_BLOCK_BODY_LEFT: &str = "│";
810 pub const INLINE_BLOCK_BODY_RIGHT: &str = "│";
811 pub const INLINE_BLOCK_BOTTOM_LEFT: &str = "â•°";
812 pub const INLINE_BLOCK_BOTTOM_RIGHT: &str = "╯";
813 pub const INLINE_BLOCK_HORIZONTAL: &str = "─";
814 pub const INLINE_TOOL_HEADER_LABEL: &str = "Tool";
815 pub const INLINE_TOOL_ACTION_PREFIX: &str = "→";
816 pub const INLINE_TOOL_DETAIL_PREFIX: &str = "↳";
817 pub const INLINE_PTY_HEADER_LABEL: &str = "Terminal";
818 pub const INLINE_PTY_RUNNING_LABEL: &str = "running";
819 pub const INLINE_PTY_STATUS_LIVE: &str = "LIVE";
820 pub const INLINE_PTY_STATUS_DONE: &str = "DONE";
821 pub const INLINE_PTY_PLACEHOLDER: &str = "Terminal output";
822 pub const MODAL_LIST_HIGHLIGHT_SYMBOL: &str = "✦";
823 pub const MODAL_LIST_HIGHLIGHT_FULL: &str = "✦ ";
824 pub const MODAL_LIST_SUMMARY_FILTER_LABEL: &str = "Filter";
825 pub const MODAL_LIST_SUMMARY_SEPARATOR: &str = " • ";
826 pub const MODAL_LIST_SUMMARY_MATCHES_LABEL: &str = "Matches";
827 pub const MODAL_LIST_SUMMARY_TOTAL_LABEL: &str = "of";
828 pub const MODAL_LIST_SUMMARY_NO_MATCHES: &str = "No matches";
829 pub const MODAL_LIST_SUMMARY_RESET_HINT: &str = "Press Esc to reset";
830 pub const MODAL_LIST_NO_RESULTS_MESSAGE: &str = "No matching options";
831 pub const HEADER_VERSION_PROMPT: &str = "> ";
832 pub const HEADER_VERSION_PREFIX: &str = "VT Code";
833 pub const HEADER_VERSION_LEFT_DELIMITER: &str = "(";
834 pub const HEADER_VERSION_RIGHT_DELIMITER: &str = ")";
835 pub const HEADER_MODE_INLINE: &str = "Inline session";
836 pub const HEADER_MODE_ALTERNATE: &str = "Alternate session";
837 pub const HEADER_MODE_AUTO: &str = "Auto session";
838 pub const HEADER_MODE_FULL_AUTO_SUFFIX: &str = " (full)";
839 pub const HEADER_MODE_PRIMARY_SEPARATOR: &str = " | ";
840 pub const HEADER_MODE_SECONDARY_SEPARATOR: &str = " | ";
841 pub const HEADER_PROVIDER_PREFIX: &str = "Provider: ";
842 pub const HEADER_MODEL_PREFIX: &str = "Model: ";
843 pub const HEADER_REASONING_PREFIX: &str = "Reasoning effort: ";
844 pub const HEADER_TRUST_PREFIX: &str = "Trust: ";
845 pub const HEADER_TOOLS_PREFIX: &str = "Tools: ";
846 pub const HEADER_MCP_PREFIX: &str = "MCP: ";
847 pub const HEADER_GIT_PREFIX: &str = "git: ";
848 pub const HEADER_GIT_CLEAN_SUFFIX: &str = "✓";
849 pub const HEADER_GIT_DIRTY_SUFFIX: &str = "*";
850 pub const HEADER_UNKNOWN_PLACEHOLDER: &str = "unavailable";
851 pub const HEADER_STATUS_LABEL: &str = "Status";
852 pub const HEADER_STATUS_ACTIVE: &str = "Active";
853 pub const HEADER_STATUS_PAUSED: &str = "Paused";
854 pub const HEADER_MESSAGES_LABEL: &str = "Messages";
855 pub const HEADER_INPUT_LABEL: &str = "Input";
856 pub const HEADER_INPUT_ENABLED: &str = "Enabled";
857 pub const HEADER_INPUT_DISABLED: &str = "Disabled";
858 pub const INLINE_USER_PREFIX: &str = " ";
859 pub const CHAT_INPUT_PLACEHOLDER_BOOTSTRAP: &str =
860 "Implement {feature} in {file} (@files, #prompts, /commands)";
861 pub const CHAT_INPUT_PLACEHOLDER_FOLLOW_UP: &str =
862 "Build something (@files, #prompts, /commands or Shift+Tab to switch to modes)";
863 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";
864 pub const HEADER_META_SEPARATOR: &str = " ";
865 pub const WELCOME_TEXT_WIDTH: usize = 80;
866 pub const WELCOME_SHORTCUT_SECTION_TITLE: &str = "Keyboard Shortcuts";
867 pub const WELCOME_SHORTCUT_HINT_PREFIX: &str = "Shortcuts:";
868 pub const WELCOME_SHORTCUT_SEPARATOR: &str = "•";
869 pub const WELCOME_SHORTCUT_INDENT: &str = " ";
870 pub const WELCOME_SLASH_COMMAND_SECTION_TITLE: &str = "Slash Commands";
871 pub const WELCOME_SLASH_COMMAND_LIMIT: usize = 6;
872 pub const WELCOME_SLASH_COMMAND_PREFIX: &str = "/";
873 pub const WELCOME_SLASH_COMMAND_INTRO: &str = "";
874 pub const WELCOME_SLASH_COMMAND_INDENT: &str = " ";
875 pub const NAVIGATION_BLOCK_TITLE: &str = "Timeline";
876 pub const NAVIGATION_BLOCK_SHORTCUT_NOTE: &str = "Ctrl+T";
877 pub const NAVIGATION_EMPTY_LABEL: &str = "Waiting for activity";
878 pub const NAVIGATION_INDEX_PREFIX: &str = "#";
879 pub const NAVIGATION_LABEL_AGENT: &str = "Agent";
880 pub const NAVIGATION_LABEL_ERROR: &str = "Error";
881 pub const NAVIGATION_LABEL_INFO: &str = "Info";
882 pub const NAVIGATION_LABEL_POLICY: &str = "Policy";
883 pub const NAVIGATION_LABEL_TOOL: &str = "Tool";
884 pub const NAVIGATION_LABEL_USER: &str = "User";
885 pub const NAVIGATION_LABEL_PTY: &str = "PTY";
886 pub const PLAN_BLOCK_TITLE: &str = "TODOs";
887 pub const PLAN_STATUS_EMPTY: &str = "No TODOs";
888 pub const PLAN_STATUS_IN_PROGRESS: &str = "In progress";
889 pub const PLAN_STATUS_DONE: &str = "Done";
890 pub const PLAN_IN_PROGRESS_NOTE: &str = "in progress";
891 pub const SUGGESTION_BLOCK_TITLE: &str = "Slash Commands";
892 pub const STATUS_LINE_MODE: &str = "auto";
893 pub const STATUS_LINE_REFRESH_INTERVAL_MS: u64 = 1000;
894 pub const STATUS_LINE_COMMAND_TIMEOUT_MS: u64 = 200;
895
896 pub const TUI_ACTIVE_TICK_RATE_HZ: f64 = 16.0;
899 pub const TUI_IDLE_TICK_RATE_HZ: f64 = 4.0;
901 pub const TUI_ACTIVE_TIMEOUT_MS: u64 = 500;
903
904 pub const THEME_MIN_CONTRAST_RATIO: f64 = 4.5;
906 pub const THEME_FOREGROUND_LIGHTEN_RATIO: f64 = 0.25;
907 pub const THEME_SECONDARY_LIGHTEN_RATIO: f64 = 0.2;
908 pub const THEME_MIX_RATIO: f64 = 0.35;
909 pub const THEME_TOOL_BODY_MIX_RATIO: f64 = 0.35;
910 pub const THEME_TOOL_BODY_LIGHTEN_RATIO: f64 = 0.2;
911 pub const THEME_RESPONSE_COLOR_LIGHTEN_RATIO: f64 = 0.15;
912 pub const THEME_REASONING_COLOR_LIGHTEN_RATIO: f64 = 0.3;
913 pub const THEME_USER_COLOR_LIGHTEN_RATIO: f64 = 0.2;
914 pub const THEME_SECONDARY_USER_COLOR_LIGHTEN_RATIO: f64 = 0.4;
915 pub const THEME_PRIMARY_STATUS_LIGHTEN_RATIO: f64 = 0.35;
916 pub const THEME_PRIMARY_STATUS_SECONDARY_LIGHTEN_RATIO: f64 = 0.5;
917 pub const THEME_LOGO_ACCENT_BANNER_LIGHTEN_RATIO: f64 = 0.35;
918 pub const THEME_LOGO_ACCENT_BANNER_SECONDARY_LIGHTEN_RATIO: f64 = 0.25;
919
920 pub const THEME_COLOR_WHITE_RED: u8 = 0xFF;
922 pub const THEME_COLOR_WHITE_GREEN: u8 = 0xFF;
923 pub const THEME_COLOR_WHITE_BLUE: u8 = 0xFF;
924 pub const THEME_MIX_RATIO_MIN: f64 = 0.0;
925 pub const THEME_MIX_RATIO_MAX: f64 = 1.0;
926 pub const THEME_BLEND_CLAMP_MIN: f64 = 0.0;
927 pub const THEME_BLEND_CLAMP_MAX: f64 = 255.0;
928
929 pub const THEME_RELATIVE_LUMINANCE_CUTOFF: f64 = 0.03928;
931 pub const THEME_RELATIVE_LUMINANCE_LOW_FACTOR: f64 = 12.92;
932 pub const THEME_RELATIVE_LUMINANCE_OFFSET: f64 = 0.055;
933 pub const THEME_RELATIVE_LUMINANCE_EXPONENT: f64 = 2.4;
934 pub const THEME_CONTRAST_RATIO_OFFSET: f64 = 0.05;
935 pub const THEME_RED_LUMINANCE_COEFFICIENT: f64 = 0.2126;
936 pub const THEME_GREEN_LUMINANCE_COEFFICIENT: f64 = 0.7152;
937 pub const THEME_BLUE_LUMINANCE_COEFFICIENT: f64 = 0.0722;
938 pub const THEME_LUMINANCE_LIGHTEN_RATIO: f64 = 0.2;
939}
940
941pub mod reasoning {
943 pub const LOW: &str = "low";
944 pub const MEDIUM: &str = "medium";
945 pub const HIGH: &str = "high";
946 pub const ALLOWED_LEVELS: &[&str] = &["minimal", LOW, MEDIUM, HIGH, "xhigh"];
947 pub const LABEL_LOW: &str = "Low";
948 pub const LABEL_MEDIUM: &str = "Medium";
949 pub const LABEL_HIGH: &str = "High";
950 pub const DESCRIPTION_LOW: &str = "Fast responses with lightweight reasoning.";
951 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)";
952 pub const DESCRIPTION_HIGH: &str = "Maximum reasoning depth for complex problems.";
953}
954
955pub mod message_roles {
957 pub const SYSTEM: &str = "system";
958 pub const USER: &str = "user";
959 pub const ASSISTANT: &str = "assistant";
960 pub const TOOL: &str = "tool";
961}
962
963pub mod urls {
965 pub const GEMINI_API_BASE: &str = "https://generativelanguage.googleapis.com/v1beta";
966 pub const OPENAI_API_BASE: &str = "https://api.openai.com/v1";
967 pub const HUGGINGFACE_API_BASE: &str = "https://router.huggingface.co/v1";
968 pub const ANTHROPIC_API_BASE: &str = "https://api.anthropic.com/v1";
969 pub const ANTHROPIC_API_VERSION: &str = "2023-06-01";
970 pub const MINIMAX_API_BASE: &str = "https://api.minimax.io/anthropic";
971 pub const OPENROUTER_API_BASE: &str = "https://openrouter.ai/api/v1";
972 pub const XAI_API_BASE: &str = "https://api.x.ai/v1";
973 pub const DEEPSEEK_API_BASE: &str = "https://api.deepseek.com/v1";
974 pub const Z_AI_API_BASE: &str = "https://api.z.ai/api/paas/v4";
975 pub const MOONSHOT_API_BASE: &str = "https://api.moonshot.cn/v1";
976 pub const LMSTUDIO_API_BASE: &str = "http://localhost:1234/v1";
977 pub const OLLAMA_API_BASE: &str = "http://localhost:11434";
978 pub const OLLAMA_CLOUD_API_BASE: &str = "https://ollama.com";
979}
980
981pub mod env_vars {
983 pub const GEMINI_BASE_URL: &str = "GEMINI_BASE_URL";
984 pub const OPENAI_BASE_URL: &str = "OPENAI_BASE_URL";
985 pub const HUGGINGFACE_BASE_URL: &str = "HUGGINGFACE_BASE_URL";
986 pub const ANTHROPIC_BASE_URL: &str = "ANTHROPIC_BASE_URL";
987 pub const OPENROUTER_BASE_URL: &str = "OPENROUTER_BASE_URL";
988 pub const XAI_BASE_URL: &str = "XAI_BASE_URL";
989 pub const DEEPSEEK_BASE_URL: &str = "DEEPSEEK_BASE_URL";
990 pub const Z_AI_BASE_URL: &str = "ZAI_BASE_URL";
991 pub const MOONSHOT_BASE_URL: &str = "MOONSHOT_BASE_URL";
992 pub const LMSTUDIO_BASE_URL: &str = "LMSTUDIO_BASE_URL";
993 pub const OLLAMA_BASE_URL: &str = "OLLAMA_BASE_URL";
994 pub const MINIMAX_BASE_URL: &str = "MINIMAX_BASE_URL";
995}
996
997pub mod headers {
999 pub const ACCEPT_LANGUAGE: &str = "Accept-Language";
1000 pub const ACCEPT_LANGUAGE_DEFAULT: &str = "en-US,en";
1001}
1002
1003pub mod tools {
1005 pub const UNIFIED_SEARCH: &str = "unified_search";
1010 pub const UNIFIED_EXEC: &str = "unified_exec";
1012 pub const UNIFIED_FILE: &str = "unified_file";
1014
1015 pub const LIST_SKILLS: &str = "list_skills";
1020 pub const LOAD_SKILL: &str = "load_skill";
1022 pub const LOAD_SKILL_RESOURCE: &str = "load_skill_resource";
1024
1025 pub const SPAWN_SUBAGENT: &str = "spawn_subagent";
1030
1031 pub const GREP_FILE: &str = "grep_file";
1035 pub const LIST_FILES: &str = "list_files";
1036 pub const CODE_INTELLIGENCE: &str = "code_intelligence";
1037 pub const SEARCH_TOOLS: &str = "search_tools";
1038 pub const SKILL: &str = "skill";
1039 pub const AGENT_INFO: &str = "agent_info";
1040 pub const WEB_FETCH: &str = "web_fetch";
1041 pub const SEARCH: &str = "search";
1042 pub const FIND: &str = "find";
1043
1044 pub const RUN_PTY_CMD: &str = "run_pty_cmd";
1048 pub const CREATE_PTY_SESSION: &str = "create_pty_session";
1049 pub const LIST_PTY_SESSIONS: &str = "list_pty_sessions";
1050 pub const CLOSE_PTY_SESSION: &str = "close_pty_session";
1051 pub const SEND_PTY_INPUT: &str = "send_pty_input";
1052 pub const READ_PTY_SESSION: &str = "read_pty_session";
1053 pub const RESIZE_PTY_SESSION: &str = "resize_pty_session";
1054 pub const EXECUTE_CODE: &str = "execute_code";
1055 pub const EXEC_PTY_CMD: &str = "exec_pty_cmd";
1056 pub const EXEC: &str = "exec";
1057 pub const SHELL: &str = "shell";
1058
1059 pub const READ_FILE: &str = "read_file";
1063 pub const WRITE_FILE: &str = "write_file";
1064 pub const EDIT_FILE: &str = "edit_file";
1065 pub const DELETE_FILE: &str = "delete_file";
1066 pub const CREATE_FILE: &str = "create_file";
1067 pub const APPLY_PATCH: &str = "apply_patch";
1068 pub const SEARCH_REPLACE: &str = "search_replace";
1069 pub const FILE_OP: &str = "file_op";
1070 pub const MOVE_FILE: &str = "move_file";
1071 pub const COPY_FILE: &str = "copy_file";
1072
1073 pub const GET_ERRORS: &str = "get_errors";
1077
1078 pub const ASK_USER_QUESTION: &str = "ask_user_question";
1083
1084 pub const ENTER_PLAN_MODE: &str = "enter_plan_mode";
1089 pub const EXIT_PLAN_MODE: &str = "exit_plan_mode";
1091
1092 pub const WILDCARD_ALL: &str = "*";
1094}
1095
1096pub mod bash {
1098 pub const ALWAYS_BLOCKED_COMMANDS: &[&str] = &[
1100 "rm",
1101 "rmdir",
1102 "del",
1103 "format",
1104 "fdisk",
1105 "mkfs",
1106 "dd",
1107 "shred",
1108 "wipe",
1109 "srm",
1110 "unlink",
1111 "chmod",
1112 "chown",
1113 "passwd",
1114 "usermod",
1115 "userdel",
1116 "systemctl",
1117 "service",
1118 "kill",
1119 "killall",
1120 "pkill",
1121 "reboot",
1122 "shutdown",
1123 "halt",
1124 "poweroff",
1125 "sudo",
1126 "su",
1127 "doas",
1128 "runas",
1129 "mount",
1130 "umount",
1131 "fsck",
1132 "tune2fs", "iptables",
1134 "ufw",
1135 "firewalld", "crontab",
1137 "at", "podman",
1139 "kubectl", ];
1141
1142 pub const NETWORK_COMMANDS: &[&str] = &[
1144 "wget", "ftp", "scp", "rsync", "ssh", "telnet", "nc", "ncat", "socat",
1145 ];
1146
1147 pub const ALLOWED_COMMANDS: &[&str] = &[
1149 "ls",
1151 "pwd",
1152 "cat",
1153 "head",
1154 "tail",
1155 "grep",
1156 "find",
1157 "wc",
1158 "sort",
1159 "uniq",
1160 "cut",
1161 "awk",
1162 "sed",
1163 "echo",
1164 "printf",
1165 "seq",
1166 "basename",
1167 "dirname",
1168 "date",
1169 "cal",
1170 "bc",
1171 "expr",
1172 "test",
1173 "[",
1174 "]",
1175 "true",
1176 "false",
1177 "sleep",
1178 "which",
1179 "type",
1180 "file",
1181 "stat",
1182 "du",
1183 "df",
1184 "ps",
1185 "top",
1186 "htop",
1187 "tree",
1188 "less",
1189 "more",
1190 "tac",
1191 "rev",
1192 "tr",
1193 "fold",
1194 "paste",
1195 "join",
1196 "comm",
1197 "diff",
1198 "patch",
1199 "gzip",
1200 "gunzip",
1201 "bzip2",
1202 "bunzip2",
1203 "xz",
1204 "unxz",
1205 "tar",
1206 "zip",
1207 "unzip",
1208 "shasum",
1209 "md5sum",
1210 "sha256sum",
1211 "sha512sum", "git",
1214 "hg",
1215 "svn",
1216 "git-lfs",
1217 "make",
1219 "cmake",
1220 "ninja",
1221 "meson",
1222 "bazel",
1223 "buck2",
1224 "scons",
1225 "waf",
1226 "xcodebuild",
1227 "cargo",
1229 "rustc",
1230 "rustfmt",
1231 "rustup",
1232 "clippy",
1233 "cargo-clippy",
1234 "cargo-fmt",
1235 "cargo-build",
1236 "cargo-test",
1237 "cargo-run",
1238 "cargo-check",
1239 "cargo-doc",
1240 "npm",
1242 "yarn",
1243 "pnpm",
1244 "bun",
1245 "npx",
1246 "node",
1247 "yarnpkg",
1248 "npm-run",
1249 "npm-test",
1250 "npm-start",
1251 "npm-build",
1252 "npm-lint",
1253 "npm-install",
1254 "yarn-test",
1255 "yarn-start",
1256 "yarn-build",
1257 "yarn-lint",
1258 "yarn-install",
1259 "pnpm-test",
1260 "pnpm-start",
1261 "pnpm-build",
1262 "pnpm-lint",
1263 "pnpm-install",
1264 "bun-test",
1265 "bun-start",
1266 "bun-build",
1267 "bun-lint",
1268 "bun-install",
1269 "bun-run",
1270 "python",
1272 "python3",
1273 "pip",
1274 "pip3",
1275 "virtualenv",
1276 "venv",
1277 "conda",
1278 "pytest",
1279 "python-m-pytest",
1280 "python3-m-pytest",
1281 "python-m-pip",
1282 "python3-m-pip",
1283 "python-m-venv",
1284 "python3-m-venv",
1285 "black",
1286 "flake8",
1287 "mypy",
1288 "pylint",
1289 "isort",
1290 "ruff",
1291 "bandit",
1292 "java",
1294 "javac",
1295 "jar",
1296 "jarsigner",
1297 "javadoc",
1298 "jmap",
1299 "jstack",
1300 "jstat",
1301 "jinfo",
1302 "mvn",
1303 "gradle",
1304 "gradlew",
1305 "./gradlew",
1306 "mvnw",
1307 "./mvnw",
1308 "mvn-test",
1309 "mvn-compile",
1310 "mvn-package",
1311 "mvn-install",
1312 "mvn-clean",
1313 "gradle-test",
1314 "gradle-build",
1315 "gradle-check",
1316 "gradle-run",
1317 "gradle-clean",
1318 "go",
1320 "gofmt",
1321 "goimports",
1322 "golint",
1323 "go-test",
1324 "go-build",
1325 "go-run",
1326 "go-mod",
1327 "golangci-lint",
1328 "go-doc",
1329 "go-vet",
1330 "go-install",
1331 "go-clean",
1332 "gcc",
1334 "g++",
1335 "clang",
1336 "clang++",
1337 "clang-cl",
1338 "cpp",
1339 "cc",
1340 "c++",
1341 "gcc-ar",
1342 "gcc-nm",
1343 "gcc-ranlib",
1344 "ld",
1345 "lld",
1346 "gold",
1347 "bfdld",
1348 "make",
1349 "cmake",
1350 "ninja",
1351 "autotools",
1352 "autoconf",
1353 "automake",
1354 "libtool",
1355 "pkg-config",
1356 "pkgconfig",
1357 "pytest",
1359 "jest",
1360 "mocha",
1361 "jasmine",
1362 "karma",
1363 "chai",
1364 "sinon",
1365 "vitest",
1366 "cypress",
1367 "selenium",
1368 "playwright",
1369 "testcafe",
1370 "tape",
1371 "ava",
1372 "qunit",
1373 "junit",
1374 "googletest",
1375 "catch2",
1376 "benchmark",
1377 "hyperfine",
1378 "eslint",
1380 "prettier",
1381 "tslint",
1382 "jshint",
1383 "jscs",
1384 "stylelint",
1385 "htmlhint",
1386 "jsonlint",
1387 "yamllint",
1388 "toml-check",
1389 "markdownlint",
1390 "remark-cli",
1391 "shellcheck",
1392 "hadolint",
1393 "rustfmt",
1394 "gofmt",
1395 "black",
1396 "isort",
1397 "ruff",
1398 "clang-format",
1399 "clang-tidy",
1400 "doxygen",
1402 "sphinx",
1403 "mkdocs",
1404 "hugo",
1405 "jekyll",
1406 "gatsby",
1407 "next",
1408 "nuxt",
1409 "vuepress",
1410 "docusaurus",
1411 "storybook",
1412 "gitbook",
1413 "readthedocs",
1414 "pandoc",
1415 "mdbook",
1416 "mdBook",
1417 "docker",
1419 "docker-compose",
1420 "docker-buildx",
1421 "podman",
1422 "buildah",
1423 "docker-build",
1424 "docker-run",
1425 "docker-ps",
1426 "docker-images",
1427 "docker-inspect",
1428 "docker-exec",
1429 "docker-logs",
1430 "docker-stats",
1431 "docker-system",
1432 "docker-network",
1433 "sqlite3",
1435 "mysql",
1436 "psql",
1437 "mongosh",
1438 "redis-cli",
1439 "redis-server",
1440 "aws",
1442 "gcloud",
1443 "az",
1444 "kubectl",
1445 "helm",
1446 "terraform",
1447 "tf",
1448 "terragrunt",
1449 "serverless",
1450 "sls",
1451 "pulumi",
1452 "cdk",
1453 "sam",
1454 "localstack",
1455 "minikube",
1456 "gitleaks",
1458 "trivy",
1459 "snyk",
1460 "npm-audit",
1461 "pip-audit",
1462 "cargo-audit",
1463 "bandit",
1464 "safety",
1465 "pipenv",
1466 "poetry",
1467 "perf",
1469 "strace",
1470 "ltrace",
1471 "valgrind",
1472 "gdb",
1473 "lldb",
1474 "sar",
1475 "iostat",
1476 "vmstat",
1477 "htop",
1478 "iotop",
1479 "nethogs",
1480 "iftop",
1481 "speedtest-cli",
1482 "ab",
1483 "wrk",
1484 "hey",
1485 "gh",
1487 "gitlab-ci",
1488 "bitbucket",
1489 "azure-pipelines",
1490 "circleci",
1491 "jenkins",
1492 "drone",
1493 "buildkite",
1494 "travis",
1495 "appveyor",
1496 "composer",
1498 "pear",
1499 "gem",
1500 "rbenv",
1501 "rvm",
1502 "nvm",
1503 "nodenv",
1504 "pyenv",
1505 "rbenv",
1506 "sdkman",
1507 "jenv",
1508 "lein",
1509 "boot",
1510 "mix",
1511 "rebar3",
1512 "erl",
1513 "elixir",
1514 "webpack",
1516 "rollup",
1517 "vite",
1518 "parcel",
1519 "esbuild",
1520 "snowpack",
1521 "turbo",
1522 "swc",
1523 "babel",
1524 "postcss",
1525 "sass",
1526 "scss",
1527 "less",
1528 "stylus",
1529 "tailwindcss",
1530 "xcodebuild",
1532 "fastlane",
1533 "gradle",
1534 "./gradlew",
1535 "cordova",
1536 "ionic",
1537 "react-native",
1538 "flutter",
1539 "expo",
1540 "capacitor",
1541 ];
1542}
1543
1544pub mod mcp {
1545 pub const RENDERER_CONTEXT7: &str = "context7";
1546 pub const RENDERER_SEQUENTIAL_THINKING: &str = "sequential-thinking";
1547
1548 pub const DEFAULT_STARTUP_TIMEOUT_MS: u64 = 60_000;
1551}
1552
1553pub mod project_doc {
1554 pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1555}
1556
1557pub mod instructions {
1558 pub const DEFAULT_MAX_BYTES: usize = 16 * 1024;
1559}
1560
1561pub mod llm_generation {
1563 pub const DEFAULT_TEMPERATURE: f32 = 0.7;
1567
1568 pub const DEFAULT_REFINE_TEMPERATURE: f32 = 0.3;
1571}
1572
1573pub mod context {
1577 pub const CODE_HEAD_RATIO_PERCENT: usize = 60;
1579
1580 pub const LOG_HEAD_RATIO_PERCENT: usize = 20;
1582
1583 pub const STANDARD_CONTEXT_WINDOW: usize = 200_000;
1589
1590 pub const EXTENDED_CONTEXT_WINDOW: usize = 1_000_000;
1594
1595 pub const ENTERPRISE_CONTEXT_WINDOW: usize = 500_000;
1597
1598 pub const TOKEN_BUDGET_WARNING_THRESHOLD: f64 = 0.70;
1605
1606 pub const TOKEN_BUDGET_HIGH_THRESHOLD: f64 = 0.85;
1609
1610 pub const TOKEN_BUDGET_CRITICAL_THRESHOLD: f64 = 0.90;
1613
1614 pub const MIN_THINKING_BUDGET: u32 = 1_024;
1620
1621 pub const RECOMMENDED_THINKING_BUDGET: u32 = 10_000;
1623
1624 pub const DEFAULT_THINKING_BUDGET: u32 = 16_000;
1626
1627 pub const BETA_CONTEXT_1M: &str = "context-1m-2025-08-07";
1634
1635 pub const CONTEXT_AWARE_MODELS: &[&str] = &[
1643 "claude-sonnet-4-5",
1644 "claude-sonnet-4-5-20250514",
1645 "claude-haiku-4-5",
1646 "claude-haiku-4-5-20250514",
1647 ];
1648
1649 pub fn supports_context_awareness(model: &str) -> bool {
1651 CONTEXT_AWARE_MODELS.iter().any(|m| model.contains(m))
1652 }
1653
1654 pub const EXTENDED_CONTEXT_ELIGIBLE_MODELS: &[&str] = &[
1657 "claude-sonnet-4",
1658 "claude-sonnet-4-5",
1659 "claude-sonnet-4-20250514",
1660 "claude-sonnet-4-5-20250514",
1661 ];
1662
1663 pub fn supports_extended_context(model: &str) -> bool {
1665 EXTENDED_CONTEXT_ELIGIBLE_MODELS
1666 .iter()
1667 .any(|m| model.contains(m))
1668 }
1669}
1670
1671pub mod chunking {
1673 pub const MAX_LINES_THRESHOLD: usize = 2_000;
1675
1676 pub const CHUNK_START_LINES: usize = 800;
1678
1679 pub const CHUNK_END_LINES: usize = 800;
1681
1682 pub const MAX_WRITE_CONTENT_SIZE: usize = 500_000; pub const WRITE_CHUNK_SIZE: usize = 50_000; }
1688
1689pub mod diff {
1691 pub const MAX_PREVIEW_BYTES: usize = 200_000;
1693
1694 pub const CONTEXT_RADIUS: usize = 3;
1696
1697 pub const MAX_PREVIEW_LINES: usize = 160;
1699
1700 pub const HEAD_LINE_COUNT: usize = 96;
1702
1703 pub const TAIL_LINE_COUNT: usize = 32;
1705
1706 pub const MAX_INLINE_DIFF_FILES: usize = 10;
1708
1709 pub const MAX_TOTAL_DIFF_LINES: usize = 500;
1711
1712 pub const MAX_SINGLE_FILE_CHANGES: usize = 200;
1714
1715 pub const MAX_FILES_IN_SUMMARY: usize = 20;
1717
1718 pub const SUPPRESSION_MESSAGE: &str = "Inline diffs have been suppressed for recent changes because there are too many to display.";
1720
1721 pub const SUPPRESSION_HINT: &str = "Tip: Use `git diff` to view the full changes.";
1723}
1724
1725pub mod memory {
1727 pub const SOFT_LIMIT_BYTES: usize = 400 * 1024 * 1024;
1729
1730 pub const HARD_LIMIT_BYTES: usize = 600 * 1024 * 1024;
1732
1733 pub const CHECK_INTERVAL_MS: u64 = 100;
1735
1736 pub const WARNING_TTL_REDUCTION_FACTOR: f64 = 0.4;
1738
1739 pub const CRITICAL_TTL_REDUCTION_FACTOR: f64 = 0.1;
1741
1742 pub const MIN_RSS_CHECKPOINT_BYTES: usize = 1024 * 1024;
1745
1746 pub const MAX_CHECKPOINT_HISTORY: usize = 100;
1748
1749 pub const DEFAULT_REPORT_THRESHOLD_MB: usize = 50;
1751}