x-callback-url 1.0 on the orgstar: scheme, Mac and iOS: orgstar://x-callback-url/<action> with x-success, x-error, x-cancel and x-source.
- Actions:
capture,open,agenda,clock-in,clock-out,clock-status. Logic inOrgApp/XCallback.swift(XCallbackRequest,XCallbackRunner,XCallbackApprovals); the apps only show sheets, alerts and open callbacks. capturefiles without the sheet whentemplateandtextare given and every prompt has a parameter named for its prompt text; otherwise the capture window/sheet opens andx-cancelfires if it closes without filing.url/titlework as org-protocol's.agendaruns a built-in orviews.tomlview and returnsresult(JSON array),count,total;limitdefaults to 50, capped at 200. Calendar events and reminders are left out.- Existing
orgstar://agenda|clock|review|capture|entrylinks are unchanged.
Decisions:
- Callbacks are opened only for other apps' schemes. Refused:
orgstar(loops),org-protocol(would capture),http,https,file,ftp,javascript,data,about,blob(results to a web server, or a download). The action still runs. - Safety: capture without the sheet,
clock-in,clock-out,agendaandclock-statusneed orgstar+ (as Shortcuts actions do) and ask once per source: Allow/Don't Allow, remembered on the device. A source is thex-sourcename plus the schemes of its callbacks, so a link naming an allowed app but sending results elsewhere asks again.x-sourceis unauthenticated; the scheme part is what keeps a web page from receiving data under an allowed name. Don't Allow repliesnot-allowed.openand capture through the sheet never ask, matching org-protocol capture: they show what they do and write nothing until the user files. Allowed apps are listed with Forget in Settings ▸ Capture (Mac) and the iOS Settings tab. - Errors are
errorCode(unknown-action,missing-parameter,invalid-parameter,not-found,capture-failed,clock-failed,no-clock,not-allowed,needs-orgstar-plus,not-ready) and an EnglisherrorMessage. - On iOS, capture and clock writes are saved at once, as the Shortcuts action does; the Mac follows its save setting, as Capture to orgstar does.
Manual: "orgstar:// links and x-callback-url" in 15-alongside-emacs.org, with pointers from Capture and iOS, including when to use Shortcuts' action instead.
Tested: swift test (new XCallbackTests: parsing, callback URL building and refused schemes, approvals, each action's results and errors) and both Xcode builds, no new warnings in Sources/. iPhone 17 simulator: approval alert, capture without the sheet (file written, shortcuts://?file=…&template=e opened), agenda (shortcuts://?count=3&result=…&total=9&view=TODO%20List opened), capture sheet for a missing prompt and x-cancel on Cancel, the Settings list. Mac (renamed-bundle copy, throwaway folders): capture without the window writes the file, capture window opens for a missing prompt, Settings ▸ Capture list. Not checked: the Mac approval alert (modal blocks the snapshot hook) and the Mac opening a callback URL. Gates: see comment.