LIVE cartercole.net --:--:-- UTC

// 04 RESTRICTED

voice-control

TYPESCRIPT SWIFT TREE-SITTER ACCESS RESTRICTED

A VS Code extension for programming by voice that edits by syntax rather than by cursor. Say take second method, change string to hello world or move greet after init, and it acts on a node of an incrementally updated tree-sitter tree for TypeScript, TSX, JavaScript, JSX or Python. A Swift sidecar recognizes speech on the Mac with SpeechAnalyzer, so audio never leaves the machine. A deterministic grammar runs the commands, and what it can't parse goes to an assistant that may only pick commands, never edit text itself.

Scopes, not cursors

Fourteen scope types, from class, method and lambda down to argument, string and comment. Each has a whole range, a body, usually a name, and a removal range that leaves valid code behind: one adjacent comma for an argument, whole lines for a statement. One query file per language maps the syntax onto them. Commands count (second argument, last method), find by name while forgiving mishearings, and chain (take method then delete it). A step that finds nothing stops the rest, so take method bark then delete it leaves things alone when there is no bark.

Macros are recorded from the editor, not the microphone, so typing, clicks and voice all count, and each step is saved as the spoken command that would redo it, measured from scopes rather than line numbers. A step is kept only if replaying it finds exactly what was selected or edited.

Hearing the right things

An open microphone also hears the TV. Push to talk keeps that out; in open-mic mode, speech the recognizer is less than 0.4 sure of and stray single words are shown faintly and ignored, and the listener sleeps after 120 seconds with nothing done. A command that would remove a lot of code waits for a spoken yes. What counts as a lot is scored by cev on Qwen3-0.6B in about 80 ms, 2 for a whole function or class and 0 for a line, and every yes and no teaches it. Until the model loads, ten lines is the bar.

The assistant is Claude, or GitHub Copilot's models through VS Code. It sees only utterances the grammar didn't understand, with the file's outline and the code around the cursor; one- and two-word fragments are never sent, and it can be switched off.

Stated honestly