Refine selected text
Rewrite a selection with an AI agent. The result shows in place with the old words struck through. In Editing mode a bar offers Keep and Discard: Enter keeps the change and Esc puts your text back. Keep typing and the change stays as a suggestion under the agent's name. In Suggesting mode the result arrives as that suggestion, and your text changes when you accept it.
Requires an AI agent installed outside Texpile
Select text, then right-click › Refine with {agent} and pick an action. With Toolbar on selection on in Preferences › Editor, the selection toolbar also has a Refine button. Ctrl+Shift+I opens the same card over the selection.

Match writing style rewrites the passage to match the text around it. Write an Instruction does what you type.
Works in LaTeX, Typst, Markdown, BibTeX and plain text, in a folder open in the desktop app. Refine is off for guests and while you host a shared session. The agent also gets the text around the selection: see Privacy.
If you see "The text from {agent} was not used", the result broke a rule, and the note names it. In LaTeX, Texpile drops a result that cites a key missing from your bibliography or removes a \label.
Write new text
Press Ctrl+Shift+I with nothing selected and type what to write. The agent writes it in the file's language, and it arrives at the cursor the same way. On an empty line the agent writes whole paragraphs. Anywhere else it continues the text at the cursor.
Hand off to the Agent tab
An instruction that needs more than new text, such as changes to other files, goes to the Agent tab with your selected lines.