transcription_complete to paste the result. copy_selected_text is used at the start of a recording session to capture any pre-selected text for the select-to-transform feature.
transcription_complete
Pastes the supplied text into the previously active application by writing it to the clipboard and simulating a Ctrl+V keystroke.
Parameters
The fully formatted text to paste. This is the final output of the dictation pipeline — raw transcription optionally post-processed by the Groq Chat LLM.
Returns
Promise<void>
Behavior
Callingtranscription_complete performs the following steps in order:
- Hides the main overlay window and waits 90ms for the OS to restore focus to the target application.
- Writes
textto the system clipboard using thearboardcrate. - Simulates a Ctrl+V keystroke using the
enigocrate to trigger a paste in the focused application. - Waits 500ms before resolving, giving the target application time to process the paste.
If the
enigo-based paste fails (e.g., on a Wayland session where direct key injection is unavailable), the backend falls back to leaving the text in the clipboard and emits a show-warning event to the frontend so the user can paste manually.Full pipeline example
copy_selected_text
Simulates Ctrl+C to copy whatever text is currently selected in the focused application, then reads and returns the clipboard contents.
Returns
Promise<string | null> — The text that was in the clipboard after the simulated Ctrl+C, or null if nothing was selected.
Behavior
- Simulates a Ctrl+C keystroke via
enigo. - Reads the clipboard contents via
arboard. - Returns the clipboard text, or
nullif the clipboard is empty or contains non-text data.
Usage in the select-to-transform flow
copy_selected_text is called automatically at the start of each recording session (triggered from shortcuts.rs when the global hotkey fires). The selected text is passed to the LLM alongside the spoken instruction so the model can transform the selection according to the user’s spoken command.
