Skip to content

feat(desktop): D6, the whole desktop - #188

Merged
httpsphl merged 2 commits into
mainfrom
feat/desktop-whole
Oct 5, 2026
Merged

httpsphl merged 2 commits into
mainfrom
feat/desktop-whole

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

D6 of Desktop Use (spec 24.2, 24.4, 24.6, 24.10, 24.12): the daemon and the app's button.

What changes

  • desktop.grantWhole {botId, level, acceptedRisks} gives the whole desktop (scope: desktop).

    • Refused without the accepted risks.
    • The owner sets the level, and can lower it.
    • The grant keeps its options and saves accepted_risks_at.
    • It is never asked for in the chat.
  • With it, desktop_windows shows every title, and any window is read or pictured without asking. Acting needs the level to be "see and use"; with "see" only, using an app is still asked app by app in the chat.

  • desktop_screenshot without window takes the whole screen. This needs the whole desktop grant, and "while you are away" when the owner is away; the return notice then says "Desktop".

    • Platform: every_shown() lists every shown top-level window, including tool and untitled windows, but not the daemon's own.
    • Every window of a process that is never granted gets its DWM frame painted black. This happens even when another window covers it, so black may be left over but never missing.
    • The capture is a BitBlt of the virtual screen (all monitors, SRCCOPY | CAPTUREBLT). It is shrunk by the system scale to at most 1600 × 1200, and a locked screen is refused.
    • The outline, the bot cursor and the notice windows are excluded from capture (WDA_EXCLUDEFROMCAPTURE).
  • tools/desktop.rs stays under 300 lines: the whole-screen tool is in desktop_screen.rs, and used moved to desktop_grant.rs.

  • App:

    • "Dar o desktop inteiro" in the bot's "Seu desktop" section opens the risks screen with the level (Ver, or Ver e usar). Confirm lights only with "Entendi os riscos" checked.
    • The grant then shows as "O desktop inteiro" with its switches, and the button goes away.
    • Texts are in all three languages, and the fake daemon answers desktop.grantWhole. The first CI run failed without that handler.

Tests

  • App: the dialog's gating, the level, the listed grant, pt-BR words.
  • Store: one whole-desktop grant whose level the owner sets; it keeps its options.
  • Unit test: covering black only inside the picture.
  • tests/desktop_whole.rs (CI only). The owner is using the PC, so no window tests ran locally. It checks:
    • without the grant: no whole screen and no titles;
    • refused without accepted risks;
    • with the grant: titles show, a window is read without asking, and the whole screen comes back as an image.

Manual

  • With a password manager or a terminal open, give a bot the whole desktop and ask for a screenshot of the whole screen. Those windows should be black, and the outline and bot cursor should not appear in the picture.

desktop.grantWhole gives a bot the whole desktop at a level, only with
the risks accepted, and keeps when (spec 24.10). With it, every window
shows with its title and is read without asking, and desktop_screenshot
without a window is a picture of the whole screen: every monitor, copied
with BitBlt, with every shown window of a process never granted covered
in black, tool and untitled windows included. The daemon's outline and
notice are excluded from capture. Away from the computer it needs the
grant's "While you are away", and the app's notice on return says
"Desktop".
@httpsphl
httpsphl enabled auto-merge October 5, 2026 01:32
"Give the whole desktop" in the bot's "Your desktop" section opens the
risks screen with the level to give (see, or see and use); the confirm
button lights only once the owner checks that they understand the
risks. The grant then shows as "The whole desktop" with its options.
The fake daemon answers desktop.grantWhole, which the app check needs.
@httpsphl httpsphl changed the title feat(desktop): D6, the whole desktop (daemon) feat(desktop): D6, the whole desktop Oct 5, 2026
@httpsphl
httpsphl merged commit 691d58e into main Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant