Expand description
Per-session tree snapshots.
Unix files are created mode 0600. XDG_CACHE_HOME wins on every OS so
tests can point at a temp directory. Without it, Windows uses
%LOCALAPPDATA%\computer-use\cache and other platforms use ~/.cache.
dirs::cache_dir is not used: on macOS that is ~/Library/Caches, and the
session path contract is ~/.cache.
Structs§
- Prune
Options - Options for
prune_sessions. - Prune
Report - Directories
prune_sessionsremoved or left in place. - Snapshot
- One saved observation. Secure-field values are already redacted in
root.
Constants§
- DEFAULT_
SESSION_ TTL - Sessions older than this, whose owner process is not alive, are stale.
Functions§
- cache_
dir - Cache root:
foreground.lockandoverlay.socklive here, next tosessions/. - clear_
restores - Drop Electron edits after a successful restore so a second teardown is a no-op.
- load
- Read the snapshot for one app window, if a previous call stored one.
- load_
screenshot_ map - Read the last screenshot map for this session, if one was stored.
- pending_
restores - Electron edits recorded for this session, one per pid.
- pid_
alive - True when
pidis still running. Signal 0 does not deliver a signal. - prune_
empty_ sessions - Drop empty session directories under the real cache. Content is left alone.
- prune_
sessions - Remove empty session directories and stale ones under
root. - session_
dir - Directory for one session. Creates it, mode
0700, and writesowner.jsononce. - sessions_
root - Directory that holds every session. This does not create it.
- store
- Write a snapshot. An older Electron edit is kept when the new one has none.
- store_
screenshot_ map - Write the last screenshot map. This file is not a tree snapshot.
- write_
secret_ bytes - Write bytes with mode
0600on Unix.