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 proc;
17mod redact;
18mod retry;
19mod sse;
20mod text;
21mod timestamp;
22mod tokenizer;
23
24// Public re-exports - the ONLY way to access utils functionality
25pub use auth::{resolve_api_key, resolve_api_key_with_fallback};
26pub use bounded::{CappedLine, read_capped, read_file_capped, read_line_capped};
27pub use checks::{CheckResult, check_ollama_available, check_ollama_model};
28pub use confirm::{confirm_or_refuse, is_affirmative, should_refuse_noninteractive};
29pub use host_memory::{gpu_vram_bytes, system_ram_bytes};
30pub use logger::{init_logger, log_debug, log_error, log_info, log_progress, log_warn};
31pub use mutex_ext::{MutexExt, lock_arc_mutex_safe};
32pub use ndjson::drain_complete_lines;
33pub use net::{HostClass, classify_host};
34pub use open::open_file;
35pub use private_tmp::private_temp_dir;
36pub use proc::{Grace, terminate_tree, terminate_tree_blocking};
37pub use redact::{redact_json, redact_secrets};
38pub(crate) use retry::jitter;
39pub use retry::{RetryConfig, retry_async, retry_async_if};
40pub use sse::drain_sse_events;
41pub use text::{format_duration, format_tokens, truncate_content, truncate_web_content};
42pub use timestamp::format_relative_timestamp;
43pub use tokenizer::Tokenizer;