Skip to main content

Module media

Module media 

Source
Expand description

Shared media runtime types + small leaf helpers. Consumed by both mur-core (VLC control, media tools) and mur-agent-runtime (WatchScheduler), which cannot depend on mur-core — so the snapshot-selection and VLC-status-parsing logic that both need lives here rather than being duplicated.

Structs§

VlcRuntime
Per-session VLC HTTP connection details. Generated once and persisted so repeated tool calls reach the same running VLC instance.
VlcStatus
Parsed subset of VLC’s requests/status.xml.
WatchSession
Persisted proactive-watch session state. Written by the MCP watch_* tools (via mur-core) and read by the runtime WatchScheduler.

Enums§

Consent
Whether the user has agreed to proactive interjections this session.

Functions§

load_runtime
Load the persisted VLC runtime (vlc.json), or None if absent/unparseable. Used by the runtime supervisor to allowlist VLC’s HTTP port in the kernel sandbox, and anywhere else that needs the current VLC connection details.
load_watch
Load the watch session, or a default (all-off) session if absent/unparseable.
newest_file
Return the most recently modified regular file in dir, if any.
newest_file_excluding
Like newest_file, but returns None when the newest file equals exclude — the snapshot that already existed before a capture was requested. This requires a freshly captured frame rather than silently falling back to a stale snapshot from a previous session.
parse_status_xml
Parse the subset of VLC’s status.xml using a proper XML reader. Missing fields default sensibly.
runtime_dir
The shared runtime state directory (~/.mur/runtime). Holds vlc.json, watch.json, and the VLC snapshot dir — all owned by the runtime and lying outside any single agent’s home, so the sandbox must grant this directory (not the individual files) for co-watching to work under enforced confinement.
runtime_path
Path to the persisted VLC runtime config.
save_watch
Persist the watch session atomically (temp + rename).
watch_path
Path to the persisted watch session.