mermaid_cli/constants.rs
1//! Constants module to avoid magic numbers in the codebase
2
3// Network Configuration
4pub const DEFAULT_OLLAMA_PORT: u16 = 11434;
5
6// Timeouts
7pub const COMMAND_TIMEOUT_SECS: u64 = 30;
8pub const COMMAND_MAX_TIMEOUT_SECS: u64 = 300;
9
10// UI Configuration
11pub const UI_POLL_INTERVAL_MS: u64 = 50;
12pub const UI_MOUSE_SCROLL_LINES: u16 = 3;
13pub const UI_ERROR_LOG_MAX_SIZE: usize = 50;
14
15// Default Model Configuration
16pub const DEFAULT_TEMPERATURE: f32 = 0.7;
17pub const DEFAULT_MAX_TOKENS: usize = 4096;
18
19// Context Management
20/// Maximum context tokens for managed message history
21pub const MAX_CONTEXT_TOKENS: usize = 75_000;
22/// Tokens reserved for the model's response within the context window
23pub const CONTEXT_RESERVE_TOKENS: usize = 4_000;
24
25// Web Content
26/// Maximum characters to keep when truncating fetched web content
27pub const WEB_CONTENT_MAX_CHARS: usize = 5_000;
28
29// UI Cache
30/// Maximum entries in the markdown parse cache before eviction
31pub const MARKDOWN_CACHE_MAX_ENTRIES: usize = 200;
32
33// Subagent Configuration
34/// Maximum number of concurrent subagents that can be spawned by a single parent call
35pub const MAX_CONCURRENT_AGENTS: usize = 10;