Closed feature request

Add clipboard verbs (desktop_clipboard_set / desktop_clipboard_get) - enables non-focus-stealing 'clipboard-assist'

John Lauer · 23d ago ·closed by John Lauer

Feature request from the native-browser bridge thread. AD has no clipboard verb today (no desktop_clipboard_* / desktop_set_clipboard / etc. - verified against the verb list). A pair of simple verbs would be broadly useful:

  • desktop_clipboard_set { text } -> put text on the user's clipboard.
  • desktop_clipboard_get {} -> read the current clipboard text.

Why it matters

The cleanest, least-rude way to fill native dialogs the agent can't drive in the background is "clipboard-assist": put the value on the clipboard and let the USER paste it. Concrete case: the Load-unpacked folder picker during browser-extension install. Its Folder field has no UIA ValuePattern (so desktop_ui_set can't fill it), and typing it with desktop_type/desktop_press_key foregrounds the window (steals focus, and the user's keystrokes then leak into it). Clipboard-assist sidesteps both: AD sets the path on the clipboard, captions "paste with Ctrl+V, then Select Folder," and the user finishes the one keyboard step without us stealing focus.

Current workaround (works, but clunky)

shell_execute + PowerShell: Set-Clipboard -Value '<text>' / Get-Clipboard. Issues: nested-quote escaping is fragile (JSON + cmd + PowerShell), echo <text>| clip appends a newline, and there's no clean save/restore. A native verb removes all of that.

Nice-to-haves

  • A polite set that optionally returns the prior contents (so the agent can restore it after).
  • Text only is fine for v1 (no image/file clipboard needed).

Repro/consumer: adom/adom-browser-extension install flow (the installing-the-extension skill's clipboard-assist picker-fill).

1 Reply

John Lauer · 23d ago

Shipped in v1.9.35 — both verbs, native (no PowerShell).

  • desktop_clipboard_set { text, returnPrior? } → puts text on the clipboard in the background (no foreground/focus). returnPrior:true also reads + returns the previous clipboard text (in prior) so you can restore it after.
  • desktop_clipboard_get {} → returns { text, length }. An empty/non-text clipboard returns text:"" (not an error).

Implemented with the arboard crate — not a shell_execute + PowerShell shell-out, so the nested-quote fragility and the echo|clip trailing-newline are both gone (exactly your ask). Both verbs are gated by shell-auto-approve: write modifies user state, and read can expose secrets the user just copied.

clipboard-assist recipe (the Load-unpacked picker)

desktop_clipboard_set { "text": "C:\\path\\to\\unpacked-extension", "returnPrior": true }
desktop_cursor { "action": "show", "label": "Paste the folder path with Ctrl+V, then Select Folder" }
# user pastes + confirms
desktop_clipboard_set { "text": "<the prior value you got back>" }   # optional: restore their clipboard

No focus theft, no fragile escaping. The installing-the-extension skill's picker-fill step can drop the PowerShell workaround and use these.

Ships in the v1.9.35 pkg (adom-wiki pkg update / pkg install adom/adom-desktop) + the laptop GUI build. Thanks for the crisp spec — text-only v1 as requested; returnPrior covers the polite save/restore nice-to-have.

Log in to reply.