mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-26 07:25:55 +00:00
Route in-process Xpra/Desktop screenshot observations through context-scoped ephemeral image refs with vision_load payloads, matching the privacy posture of computer-use and browser screenshots. Keep desktopctl shell observations path-based with aggressive pruning so image payloads are not printed into shell logs, and preserve explicit screenshot paths as durable user-owned artifacts.
18 lines
635 B
Python
18 lines
635 B
Python
from __future__ import annotations
|
|
|
|
from plugins._desktop.helpers import desktop_state
|
|
|
|
|
|
def build_context(context_id: str = "") -> str:
|
|
if not desktop_state.session_manifest_exists():
|
|
return ""
|
|
try:
|
|
return desktop_state.compact_prompt_context(
|
|
desktop_state.collect_state(include_screenshot=False, context_id=context_id),
|
|
)
|
|
except Exception as exc:
|
|
return (
|
|
"[DESKTOP STATE]\n"
|
|
f"- unavailable={exc}\n"
|
|
"- next=Open the Desktop surface manually, then run plugins/_desktop/skills/linux-desktop/scripts/desktopctl.sh observe --json."
|
|
)
|