User commands: commands.toml, API version 1 and trust !527

merged merged by cmc on 2026-11-27 09:07 UTC · krz/orgstar:245-user-commands into main

Discussion

cmc 2026-11-27 09:06 UTC

Closes #245.

  • commands.toml + commands/*.js: read without running code, problems by file and key (Mac via ConfigSync, iOS via MobileModel/FolderPresenter; undownloaded iCloud modules reported and downloaded).
  • UserCommand (user.<name>, when via KeyContext) → .external(.userCommand); DocumentSession runs it on CommandHost with API 1 (org.text/selection/heading/outline/file/settings/prompt/message/fail), validates {edits, selection, message, copy} (UTF-16), applies one undo step at the base revision.
  • Trust: Run Once / Always / Don't Run; Always hashes the file and its imports in TrustStore; any change asks again.
  • Refused with decrypted entries; Cancel Running Task cancels (also added to the iOS Commands list).
  • Registered in the palette (hidden where when fails), keymap.toml validation, iOS Commands and [key-bar]; Emacs import notes bindings to user defuns.
  • Manual chapter 18, configuration and keys pages; strings in de, es, fr, ja, pt-BR.

Tests: manifest problems, API answers, result validation, when, trust on change, end-to-end runs through the real CommandHost (upcase title, prompt, edit during run refused, timeout, cancel, decrypted refusal), one undo step in OrgEditor. swift test, both Xcode builds and the gates pass (1 MB open 94 ms at load 3). Checked on the Mac (trust prompt, palette) and the iPhone 17 simulator (Commands list, trust sheet, result, undo).

Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form