Send Clipboard to Xen

● iOS Shortcut
One tap sends whatever's on your clipboard — text, a link, an image, a file — straight into Xen's session.

How it routes

Two endpoints, picked by clipboard type:

Text / URLPOST /api/dictate-inject (same as your voice shortcut; add wait:true if you want a spoken reply back).

Image / filePOST /api/dictate-attach (multipart/form-data; saves the file and notifies Xen with its path).

Build the Shortcut — "Send Clipboard to Xen"

  1. Get Clipboard
    Returns whatever's currently copied (text, URL, image, or file).
  2. If — "Clipboard" has any value & is Text or URL
    Get Contents of URL
    URL https://tui.xlrd.org/api/dictate-inject · POST · Header Content-Type: application/json
    JSON body: source = clipboard text = Clipboard wait = true (optional, for spoken reply)
    Otherwise (image / file) → Get Contents of URL
    URL https://tui.xlrd.org/api/dictate-attach · POST
    Request Body: Form — add a field, type File, value = Clipboard (Shortcuts sends it as multipart/form-data automatically).
  3. (Optional) Get Dictionary Value → Speak Text
    If you sent text with wait:true, grab reply and Speak it — same as the voice shortcut. For attachments the response is {ok:true,files:[…]}; you can Show Notification on success.

curl equivalents

# clipboard TEXT / URL
curl -sS -X POST https://tui.xlrd.org/api/dictate-inject \
  -H "Content-Type: application/json" \
  -d '{"source":"clipboard","text":"<clipboard text>","wait":true}'

# clipboard IMAGE / FILE (multipart)
curl -sS -X POST https://tui.xlrd.org/api/dictate-attach \
  -F "file=@/path/to/clip.png"
# → {"ok":true,"files":[{"name":"clip.png","path":"…","size":12345}]}

Notes

Text is instant — lands in the session like a dictation. Files get saved server-side and Xen is notified with the path so it can open/read them.

Known follow-up: the attach endpoint's save directory needs a one-line path correction to the canonical tree (tracked) — text path is unaffected and fully working.