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 confirm;
8mod host_memory;
9mod logger;
10mod ndjson;
11mod net;
12mod open;
13mod private_tmp;
14mod proc;
15mod redact;
16mod retry;
17pub mod serde_base64;
18mod sse;
19mod text;
20mod timestamp;
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 confirm::{confirm_or_refuse, is_affirmative, should_refuse_noninteractive};
26pub use host_memory::{gpu_vram_bytes, system_ram_bytes};
27pub use logger::{init_logger, log_debug, log_error, log_info, log_progress, log_warn};
28pub use ndjson::drain_complete_lines;
29pub use net::{HostClass, classify_host};
30pub use open::open_file;
31pub use private_tmp::private_temp_dir;
32#[cfg(target_os = "windows")]
33pub use proc::{CREATE_NEW_PROCESS_GROUP, DETACHED_PROCESS};
34pub use proc::{
35    Grace, output_with_timeout, terminate_tree, terminate_tree_blocking, write_stdin_with_timeout,
36};
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, truncate_content, truncate_web_content};
42pub use timestamp::format_relative_timestamp;