The “/ai” AI command
A “/” item with a prompt field — the model's answer lands in the Document as one edit, and the Field notice announces progress.
The AI command is the same Insert item with a popover as in the “Mentioning teammates” Recipe: the author writes a prompt, the popover closes, and the answer reaches the Document once the model is done.
Try it
Type /ai on an empty line or press Ctrl+Alt+J and ask for
“ideas for the launch”. The answer here is simulated, with no network.
How it works
Progress goes through showNotice
A Field notice (showNotice) with the status tone (“Writing a
draft…”) is only announced: nothing gets in the eye's way, and a screen reader hears that work is
going on. A failure is shown with the error tone — a line under the field.
One insert, one undo
The answer is inserted whole, not word by word: typing it out word by word would leave dozens of history steps.
The Schema cleans the model's answer
Whatever the model returns, only what the Schema allows reaches the Document — as with paste.
The API key stays on your server
The ask function in the example is where your backend request goes; the key never reaches the
browser.