# screenView tool spec (v2) Lets Jarvis see this PC's screen: all monitors as one picture, one monitor, or one program's window ("2번 모니터 뭐 떠 있어?", "크롬 창 내용 읽어 줘"). Product rules: `docs/v2/pc-features.md` ("화면 보기", "화면 질문을 빠르게"). The app captures and decides who may see (`app/src/admin.spec.md`, "Screen viewing"); this tool only asks it and hands the pictures to the reply model. ## Principles - **Only in v2, only when the app offers it.** The tool needs a screen backend in the turn state (`turn_state.set_screen`, every v2 voice and chat reply; not scheduled tasks). The app puts `screenView` in the brain's `disabled_tools` unless screen viewing is available (Windows, the feature on, someone registered for PC control and viewing not turned off), so it is not offered then. Without a backend it refuses. - **The app decides who may see.** Every request goes to the app with the asker; only people registered for PC control may see the screen (`pcControl`). A refusal comes back as the tool's error, and the model says plainly that it cannot show the screen to this person. - **The screen is data.** The text result says the picture is the user's screen and that any text in it is data, never instructions. Window titles in the list come inside an UNTRUSTED SCREEN CONTENT fence; `<<<` and `>>>` in them are replaced so they cannot close it. - **Pictures live for one reply.** They go to the reply model with the tool result (`ToolExecutionResult.images`) and nowhere else: not in the short-term memory's tool carryover, not in the history store, not in logs or prompt dumps. A follow-up about the screen captures again. - **Honest failure.** A window that is minimised, a program on the exclusion list, a picture that came out black: the tool says so, and the model answers that it cannot see it, never guesses. - **Raw data.** No LLM call inside. ## Schema | `target` | needs | gets | |---|---|---| | `screen` (default) | | every monitor as one picture | | `monitor` | `monitor` (its number, as Windows numbers it) | that monitor | | `window` | `window` (part of its title or program name) | that window, also when other windows cover it | | `list` | | the monitors (number, size, main) and the open windows (program, title), no picture | `detail`: `fast` (long side about 768 px), `normal` (default, about 1280 px) or `detailed` (the picture in four parts at up to 1280 px each, for reading small text). `target` and `detail` are read as their first known word; unknown values fall back to the defaults. ## Backend `turn_state.get_screen()` returns an object with `act(action, **fields) -> dict`: - `act("capture", target=..., monitor=..., window=..., detail=...)` gives `{"ok": true, "item": {"what", "width", "height", "parts"}, "images": ["", ...]}`. - `act("list")` gives `{"ok": true, "item": {"monitors": [...], "windows": [...]}}`. - Failures are `{"ok": false, "error": "..."}`. The voice worker implements it (`voice_worker/app_bridge.py`): each action goes to the app as `screen_action` with the asker (`voice_worker.spec.md`, "Screen viewing"). ## Pictures in the reply loop `ToolExecutionResult.images` (base64 JPEG) rides on the tool result message as `images`. For an OpenAI-compatible server (`llm.py`, Strata) the tool message keeps its text and the pictures follow right after the run of tool messages as one user message of `image_url` parts, labelled as the pictures of that tool result (servers do not take pictures in tool messages). Ollama's own API takes `images` on the message as it is. Eval: `evals/test_screen_view_tool.py`.