pub mod constants;
pub mod fs;
mod interner;
pub mod system;
pub use constants::{
CONNECT_TIMEOUT, DECOMPOSE_TIMEOUT, EXEC_TIMEOUT, FETCH_TIMEOUT, INVOKE_TASK_DEADLINE,
MCP_CALL_TIMEOUT, RECONNECT_TIMEOUT, REDIRECT_LIMIT, STREAM_CHUNK_TIMEOUT,
};
pub use fs::{atomic_write, check_preview_size, format_size};
pub use interner::intern;
pub fn truncate_str(s: &str, max_bytes: usize) -> &str {
if s.len() <= max_bytes {
return s;
}
let mut end = max_bytes;
while end > 0 && !s.is_char_boundary(end) {
end -= 1;
}
&s[..end]
}