mod batch_edit;
mod edit;
mod glob_targets;
mod import_rewrite;
mod list_dir;
mod path_input;
mod read;
mod refactor_imports;
mod restore_file;
mod schemas;
mod search_replace;
mod write;
pub use batch_edit::BatchEditTool;
pub use refactor_imports::RefactorImportsTool;
pub use restore_file::RestoreFileTool;
pub use edit::EditFileTool;
pub use list_dir::ListDirTool;
pub use read::{ReadFileTool, sniff_encoding_label};
pub use write::WriteFileTool;
pub(crate) use read::{detect_and_decode, read_pdf};
pub(crate) use write::{
DecodedFile, atomic_write, encode_text, normalize_line_endings, read_decoded_for_edit,
};
pub(crate) fn line_ending_of(text: &str) -> &'static str {
if text.contains("\r\n") { "\r\n" } else { "\n" }
}
pub(crate) const MAX_FILE_SIZE: u64 = 100 * 1024 * 1024;
pub(crate) const FILE_SIZE_LINE_COUNT_LIMIT: u64 = 10 * 1024 * 1024;
pub(crate) const DEFAULT_LIMIT: usize = 2000;
pub(crate) const MAX_LIMIT: usize = 5000;
pub(crate) const MAX_WRITE_SIZE: usize = 100 * 1024 * 1024;
pub(crate) const DIFF_MAX_INPUT_BYTES: usize = 256 * 1024;
pub(crate) const MAX_BATCH_FILES: usize = 32;
pub(crate) const MAX_BATCH_DIFF_BYTES: usize = 512 * 1024;
pub(crate) const WRITE_PREVIEW_LINES: usize = 20;
#[cfg(test)]
mod tests;