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