feat: screen viewing, Jarvis sees the whole screen, a monitor or a window for registered people

- screenView tool (screen_view.spec.md): whole screen, monitor by number, window by part of its
  title or program, or the list of monitors and windows; fast, normal or detailed pictures.
- The app captures with Windows Graphics Capture (app/src/screen.rs, admin.spec.md "Screen
  viewing"), decides for the asker (only people registered for PC control), never picks, lists
  or shows excluded programs (pcControl.screenExclude, password managers by default), refuses
  minimised windows and black pictures, and records screen.view in the activity log.
- Pictures ride on the tool message (ToolExecutionResult.images); llm.py sends them to
  OpenAI-compatible servers as image parts after the tool messages. They stay in that reply only:
  not in the tool carryover, logs or prompt dumps.
- The LLM reads pictures only when screen viewing is available (--vision gpu normally, cpu in a
  game), measured apart for the placement; otherwise screenView is a disabled tool.
- Worker: screen_action / screen_action_result, 4 MiB messages.
- Eval evals/test_screen_view_tool.py; Windows check tests/screen_windows.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-15 17:02:59 +09:00
parent bd7b69d4f4
commit 53bccb620d
39 changed files with 1844 additions and 68 deletions

View File

@@ -387,6 +387,16 @@ Behaviour:
- **User-facing logging**: prints `🧩 Tool digest: N chars — "preview…"` when the digest replaces the raw payload, or the NONE fallback line above. Debug logs under the `tools` category record raw→digest size plus batch counts.
- **Raw payload preserved in debug**: the debug logs capture the original length so field captures can compare digested vs raw behaviour.
### Pictures from tools
A tool may return pictures with its result (`ToolExecutionResult.images`, base64 JPEG; v2's
`screenView`, `src/jarvis/tools/builtin/screen_view.spec.md`). The loop puts them on that tool
result's message as `images`, both on the model's own tool calls and on the planner's direct
execution. `llm.py` sends them: to an OpenAI-compatible server as one user message of `image_url`
parts right after the run of tool messages, labelled as that tool's pictures; to Ollama's own API on
the message as they are. Pictures never leave the reply: the tool carryover drops them
(`DialogueMemory.record_tool_turn`), and debug logs and prompt dumps show only how many there were.
### Logging and Privacy
- Use `debug_log` for key steps: `memory`, `planning`, and `voice` categories.
- Avoid excessive logging; logs must remain readable and privacy-preserving.