Skip to main content

mermaid_cli/utils/
mod.rs

1// Gateway module for utils - follows the Train Station Pattern
2// All external access must go through this gateway
3
4// Private submodules - not directly accessible from outside
5mod auth;
6mod bounded;
7mod checks;
8mod confirm;
9mod host_memory;
10mod logger;
11mod mutex_ext;
12mod ndjson;
13mod net;
14mod open;
15mod private_tmp;
16mod redact;
17mod retry;
18mod sse;
19mod text;
20mod timestamp;
21mod tokenizer;
22
23// Public re-exports - the ONLY way to access utils functionality
24pub use auth::{resolve_api_key, resolve_api_key_with_fallback};
25pub use bounded::{CappedLine, read_capped, read_file_capped, read_line_capped};
26pub use checks::{CheckResult, check_ollama_available, check_ollama_model};
27pub use confirm::{confirm_or_refuse, is_affirmative, should_refuse_noninteractive};
28pub use host_memory::{gpu_vram_bytes, system_ram_bytes};
29pub use logger::{init_logger, log_debug, log_error, log_info, log_progress, log_warn};
30pub use mutex_ext::{MutexExt, lock_arc_mutex_safe};
31pub use ndjson::drain_complete_lines;
32pub use net::{HostClass, classify_host};
33pub use open::open_file;
34pub use private_tmp::private_temp_dir;
35pub use redact::{redact_json, redact_secrets};
36pub(crate) use retry::jitter;
37pub use retry::{RetryConfig, retry_async, retry_async_if};
38pub use sse::drain_sse_events;
39pub use text::{format_duration, format_tokens, truncate_content, truncate_web_content};
40pub use timestamp::format_relative_timestamp;
41pub use tokenizer::Tokenizer;