Skip to main content

Module file_ops

Module file_ops 

Source

Functions§

compute_edit_file_diff
Return a formatted diff string for an edit_file operation without applying it. Lines prefixed “- “ are removals, “+ “ are additions. Returns Err if the search string cannot be located (caller falls through to normal tool dispatch).
compute_msr_diff
Return a formatted diff string for a multi_search_replace operation without applying it.
compute_patch_hunk_diff
Return a formatted diff string for a patch_hunk operation without applying it.
create_directory
edit_file
grep_files
hematite_dir
Returns the directory where Hematite’s runtime state (.hematite/) should live.
inspect_lines
is_project_workspace
Returns true if the workspace root looks like a real project. A bare .git alone (e.g. accidental git init in the home folder) doesn’t count — at least one explicit build/package marker must also be present.
is_sovereign_directory
Returns true if path is a known sovereign OS directory (Desktop, Downloads, Documents, Pictures, Videos, Music). These directories should not accumulate .hematite/ workspace state — they use the global ~/.hematite/ instead.
list_files
multi_search_replace
open_in_system_editor
patch_hunk
pop_ghost_ledger
read_file
tail_file
workspace_root
Resolve the workspace root by looking upward for common markers.
write_file