Skip to main content

Module cache

Module cache 

Source
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§

PruneOptions
Options for prune_sessions.
PruneReport
Directories prune_sessions removed 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.lock and overlay.sock live here, next to sessions/.
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 pid is 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 writes owner.json once.
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 0600 on Unix.