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