Skip to main content

Module fs

Module fs 

Source
Expand description

Session-scoped staged filesystem mode.

hostlib_fs_set_mode({session_id, mode: "staged"}) makes hostlib file mutations land in a durable per-session overlay under .harn/state/staged/<session_id>/. Reads made by the same session consult that overlay first, so agent loops see their own pending writes without touching the working tree until hostlib_fs_commit_staged.

Structs§

CommitResult
Result returned after applying staged changes to disk.
DiscardResult
Result returned after dropping staged changes.
FsCapability
Hostlib filesystem capability handle.
PendingWrite
One pending staged filesystem change.
SafeTextPatchOutcome
Outcome of one safe_text_patch call. applied says whether the on-disk (or staged-overlay) bytes changed; result carries the structured discriminant used by the wire/JSON shape.
SetModeResult
Result returned after changing a session’s filesystem mode.
StagedStatus
Summary of staged filesystem changes for one session.

Enums§

FsMode
Filesystem mode for one hostlib session.
SafeTextPatchResult
Discriminant for a safe_text_patch outcome.

Functions§

commit_staged
Commit staged changes for all paths or for a filtered path list.
configure_session_root
Remember the workspace root associated with a live session.
configured_session_root
Return the root currently associated with a hostlib session.
discard_staged
Discard staged changes for all paths or for a filtered path list.
remove_session_state
Remove all persisted staged-fs state for a caller-owned throw-away session.
safe_text_patch
Atomic compare-and-swap-style text write.
set_mode
Set a session’s filesystem mode.
staged_status
Return the staged status for a session.