Skip to main content

mermaid_cli/
constants.rs

1/// Constants module to avoid magic numbers in the codebase
2// Network Configuration
3pub const DEFAULT_OLLAMA_PORT: u16 = 11434;
4
5// Timeouts
6pub const COMMAND_TIMEOUT_SECS: u64 = 30;
7pub const HTTP_REQUEST_TIMEOUT_SECS: u64 = 600; // 10 minutes for large model requests
8
9// UI Configuration
10pub const UI_REFRESH_INTERVAL_MS: u64 = 50;
11pub const UI_SCROLL_LINES: u16 = 3;
12pub const UI_DEFAULT_VIEWPORT_HEIGHT: u16 = 20;
13pub const UI_STATUS_MESSAGE_THRESHOLD: u16 = 3; // For auto-scroll detection
14pub const UI_ERROR_LOG_MAX_SIZE: usize = 50; // Maximum number of errors to keep in log
15
16// Default Model Configuration
17pub const DEFAULT_TEMPERATURE: f32 = 0.7;
18pub const DEFAULT_MAX_TOKENS: usize = 4096;
19
20// File Patterns
21pub const DEFAULT_EXCLUDE_PATTERNS: &[&str] = &[
22    "*.log",
23    "*.tmp",
24    ".git/*",
25    ".env",
26    "target/*",
27    "node_modules/*",
28    "__pycache__/*",
29    ".venv/*",
30    "venv/*",
31    "*.pyc",
32    "*.pyo",
33    ".DS_Store",
34    "Thumbs.db",
35    "*.swp",
36    "*.swo",
37    "*~",
38    ".idea/*",
39    ".vscode/*",
40    "*.iml",
41    ".pytest_cache/*",
42    ".mypy_cache/*",
43    ".ruff_cache/*",
44    "dist/*",
45    "build/*",
46    "*.egg-info/*",
47];
48