feat(v2): screenView sees someone's Discord screen share in its popped-out window

The share target checks that the person asked about shares their screen in
Jarvis's voice channel, finds Discord's popped-out window (title not ending in
Discord, the voice channel's name first) and, when there is none, asks for it in
the channel and looks again every second for 30 s. Screen actions now wait as
long as PC actions in the worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-19 13:43:31 +09:00
parent 3af881935c
commit 844958d311
13 changed files with 287 additions and 28 deletions

View File

@@ -6,6 +6,8 @@ Eval: seeing the screen (src/jarvis/tools/builtin/screen_view.spec.md).
- When the app refuses (the person is not registered), the answer says it cannot see the screen and
does not describe one.
- A question that is not about the screen does not capture it.
- "철수 화면 뭐 하고 있어?" asks for 철수's Discord screen share (target share, person 철수), and
the answer reads that picture.
The screen backend is a fake that returns a fixed picture; the tool, the reply loop and the picture
transport (llm.py) run for real. Needs a model that reads pictures:
@@ -38,8 +40,8 @@ class FakeScreen:
{"number": 2, "width": 1280, "height": 720, "main": False}],
"windows": [{"program": "notepad", "title": "Untitled - Notepad",
"minimised": False}]}}
return {"ok": True, "item": {"what": f"모니터 {kw.get('monitor', 2)}", "width": 1280, "height": 720,
"parts": 1}, "images": [PICTURE]}
what = "화면공유" if kw.get("target") == "share" else f"모니터 {kw.get('monitor', 2)}"
return {"ok": True, "item": {"what": what, "width": 1280, "height": 720, "parts": 1}, "images": [PICTURE]}
def _run(mock_config, eval_db, eval_dialogue_memory, query, screen):
@@ -84,3 +86,11 @@ class TestScreenView:
screen = FakeScreen()
_run(mock_config, eval_db, eval_dialogue_memory, "고양이는 하루에 몇 시간 자?", screen)
assert not any(a == "capture" for a, _ in screen.acts), screen.acts
def test_someones_screen_share_is_asked_for_by_their_name(self, mock_config, eval_db, eval_dialogue_memory):
screen = FakeScreen()
reply = _run(mock_config, eval_db, eval_dialogue_memory, "철수 화면 뭐 하고 있어?", screen)
captures = [kw for a, kw in screen.acts if a == "capture"]
assert captures and captures[0].get("target") == "share" and "철수" in (captures[0].get("person") or ""), \
screen.acts
assert "BANANA" in reply.upper() or "바나나" in reply or "42" in reply, reply