oc_chat
Loading...
Searching...
No Matches
filesystem.py File Reference

Go to the source code of this file.

Namespaces

namespace  oc_chat
namespace  oc_chat.tools
namespace  oc_chat.tools.filesystem

Functions

Iterator[None] oc_chat.tools.filesystem.human_confirmed_write (str target)
bool oc_chat.tools.filesystem._plan_envelope_covers_write (str target)
dict oc_chat.tools.filesystem._make_protected_write_block (str target, str reason)
dict oc_chat.tools.filesystem.deny_protected_write (dict result, *, str note="")
"Path | dict" oc_chat.tools.filesystem._enforce_write_gates (str path)
Path oc_chat.tools.filesystem._safe_path (str path)
Path|None oc_chat.tools.filesystem._find_worktree_root (Path|None start=None)
tuple[Path, str] oc_chat.tools.filesystem._sandbox_root_info ()
Path oc_chat.tools.filesystem._sandbox_root ()
"tuple[Path, Path]" oc_chat.tools.filesystem._resolve_unclamped (str path)
"str | None" oc_chat.tools.filesystem._outside_sandbox_error (str path)
bool oc_chat.tools.filesystem._was_discovery_rescue (str requested, Path resolved)
Path oc_chat.tools.filesystem._discover_file_path (str path)
Path oc_chat.tools.filesystem._discover_dir_path (str path)
dict oc_chat.tools.filesystem.list_dir (str path=".", int max_depth=2, bool exclude_hidden=True)
ReadFileResult|ToolError oc_chat.tools.filesystem.read_file (str path, int max_bytes=50_000, int offset=0)
str oc_chat.tools.filesystem._normalize_newlines (str content)
WriteFileResult|ToolError oc_chat.tools.filesystem.write_file (str path, str content, int chunk_size=0, int max_chunks=0)
list[int] oc_chat.tools.filesystem._match_start_lines (str text, str anchor)
str oc_chat.tools.filesystem._edit_near_miss_message (str text, str anchor, str path)
str oc_chat.tools.filesystem._edit_context_snippet (str edited_text, str replacement, int start_line, int radius=2)
None oc_chat.tools.filesystem._atomic_write_bytes (Path target, bytes data)
dict oc_chat.tools.filesystem.edit_file (str path, str old_string, str new_string, int expected_count=1)
dict oc_chat.tools.filesystem.file_info (str path)
dict oc_chat.tools.filesystem.read_chunks (str path, int chunk_size=10_000, int max_chunks=10, int offset=0)
dict oc_chat.tools.filesystem.search_files (str root_dir=".", str pattern="*")
str oc_chat.tools.filesystem.read_prompt_file (str filepath, *, bool allow_absolute=False)

Variables

 oc_chat.tools.filesystem._HARDCODED_ROOT = Path(__file__).parent.parent.parent.resolve()
 oc_chat.tools.filesystem.ROOT = _HARDCODED_ROOT
str oc_chat.tools.filesystem._PROTECTED_READ_MSG = "Reading this file is not permitted: it is in the protected-read (secret) class."
str oc_chat.tools.filesystem._PROTECTED_WRITE_MSG = "Writing this file is not permitted: it is in the protected-write class (integrity / config-as-code / secret)."
contextvars oc_chat.tools.filesystem._human_approved_write
dict oc_chat.tools.filesystem.TOOLS
list oc_chat.tools.filesystem.SCHEMAS