From 4a4ce6c585cafc1dac7d579a52f920d05b96b6e9 Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Sat, 24 Oct 2026 15:30:10 -0400 Subject: [PATCH 1/3] Add OpenSuperWhisper local voice input Install the opensuperwhisper cask and add home.activation.openSuperWhisper to download the Whisper V3 Large turbo model once, verify its SHA256, and set the app defaults. Model and defaults stay outside the Nix store; macOS TCC grants remain manual. Document first-run steps, permissions, and the default shortcut in readme.md and AGENTS.md. --- AGENTS.md | 1 + configuration.nix | 1 + home.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ readme.md | 17 +++++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index bc2920e..15aef11 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,6 +11,7 @@ Deliberate decisions in this repo - do NOT silently revert them: - firstmate lives at `~/Documents/firstmate` as a mutable git clone (not in the Nix store). `home.activation.firstmate` clones it if missing and seeds `config/backend=herdr` + `config/crew-harness=opencode` only when those files are absent. Crew routing is `home/.config/firstmate/crew-dispatch.json` (symlinked in): per the captain's order 2026-10-20, every coding crewmate and scout uses `opencode` + `opencode/deepseek-v4.1-flash-free` through the OpenCode CLI, because the paid Go subscription was close to emptying its monthly window. The validation pipeline stays on Pi with `opencode-go/deepseek-v4.1-flash` steps and the `opencode-go/glm-5.3-flash` reviewer. The free tier rate-limits under heavy parallel work, so a stalled worker falls back to the paid Go model only on the captain's word. Avoid the `muse-spark-*-contributor` models, which train on prompts, and the `exo-free`, `mimo-*-free`, and `nemotron-*-free` models, whose data may be used to improve the model. `cat-jam-free` retains for 30 days. Crews inherit the primary's OpenCode login through the spawn-owned symlink (the isolated worker data root links the primary `/opencode/auth.json`; no `~/.pi/agent/auth.json` reliance). Launch with shell alias `fm` (`cd` + OpenCode 2 via `~/.local/bin/oc2`); the primary stays OpenCode 2, only crews run on the opencode harness. Self-update via `/updatefirstmate`, not rebuild. - OpenCode 2 is the firstmate primary. It is not a Homebrew formula: install `@opencode-ai/cli@beta` with Homebrew's npm (`home.activation.opencode2`). Launch through `home/bin/oc2` so `OPENCODE_CONFIG` stays at `home/.config/opencode2/opencode.json` and cannot rewrite OpenCode 1.x's `~/.config/opencode`. Do not add a brew `opencode` / `opencode2` formula; `zap` would fight the npm install. firstmate harness detection matches `*opencode*`, so the `opencode2` process name still classifies as OpenCode. - Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo), `fm` (firstmate via OpenCode 2), `oc2` (OpenCode 2, isolated). They are intentional high-agency shortcuts. +- OpenSuperWhisper is installed by the `opensuperwhisper` cask, and `home.activation.openSuperWhisper` owns its Whisper model download (`ggml-large-v3-turbo.bin` under the app's Application Support directory, never the Nix store) and app defaults. Microphone/Accessibility/Input Monitoring grants stay manual because macOS TCC cannot be declarative; do not kill a running app to apply defaults. The model is local-only. ## Maintaining this file diff --git a/configuration.nix b/configuration.nix index d0b7f0b..417c283 100644 --- a/configuration.nix +++ b/configuration.nix @@ -66,6 +66,7 @@ "codex" # Codex CLI; shares ~/.codex/config.toml with the desktop app "docker-desktop" "grok-build" + "opensuperwhisper" # local Whisper dictation, model + defaults in home.nix "puremac" "utm" "wezterm" diff --git a/home.nix b/home.nix index 289da8f..73ee96c 100644 --- a/home.nix +++ b/home.nix @@ -401,4 +401,46 @@ in # Ensure daemon running (launchd on macOS) "$bin" daemon restart >/dev/null 2>&1 || "$bin" daemon start >/dev/null 2>&1 || true ''; + + # OpenSuperWhisper - local voice-first prompting (cask in configuration.nix). + # The app reads its model from its own Application Support directory, so the + # 1.6 GB Whisper model is downloaded here once and kept outside the Nix store. + # A failed download must not fail the switch: warn, drop the partial file, and + # let the app's Settings download it later. Never write hasCompletedOnboarding - + # onboarding must still run so the captain can grant Microphone/Accessibility + # (macOS TCC grants are manual by design). A running app picks up new defaults + # on its next launch; do not kill it here. + home.activation.openSuperWhisper = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + set -euo pipefail + supportDir="$HOME/Library/Application Support/ru.starmel.OpenSuperWhisper" + modelDir="$supportDir/whisper-models" + modelPath="$modelDir/ggml-large-v3-turbo.bin" + modelUrl="https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo.bin?download=true" + modelSha="1fc70f774d38eb169993ac391eea357ef47c88757ef72ee5943879b7e8e2bc69" + curl="${pkgs.curl}/bin/curl" + + mkdir -p "$modelDir" + if [ ! -f "$modelPath" ]; then + tmp="$(${pkgs.coreutils}/bin/mktemp "$modelDir/.ggml-large-v3-turbo.XXXXXX")" + if "$curl" -fL --retry 3 --connect-timeout 30 -o "$tmp" "$modelUrl" \ + && printf '%s %s\n' "$modelSha" "$tmp" | ${pkgs.coreutils}/bin/sha256sum -c - >/dev/null 2>&1; then + mv "$tmp" "$modelPath" + else + echo "openSuperWhisper: WARNING: could not download or verify the Whisper model." >&2 + echo "openSuperWhisper: the app still works; download \"Whisper V3 Large\" in Settings later." >&2 + ${pkgs.coreutils}/bin/rm -f "$tmp" + fi + fi + + defaults=/usr/bin/defaults + "$defaults" write ru.starmel.OpenSuperWhisper selectedEngine -string whisper + "$defaults" write ru.starmel.OpenSuperWhisper whisperLanguage -string en + "$defaults" write ru.starmel.OpenSuperWhisper autoPasteTranscription -bool true + "$defaults" write ru.starmel.OpenSuperWhisper holdToRecord -bool true + "$defaults" write ru.starmel.OpenSuperWhisper addSpaceAfterSentence -bool true + "$defaults" write ru.starmel.OpenSuperWhisper startHiddenInMenuBar -bool true + if [ -f "$modelPath" ]; then + "$defaults" write ru.starmel.OpenSuperWhisper selectedWhisperModelPath -string "$modelPath" + fi + ''; } diff --git a/readme.md b/readme.md index ce77b6a..09ed42f 100644 --- a/readme.md +++ b/readme.md @@ -14,3 +14,20 @@ The firstmate crew dispatch + Gitea PR helper are wired by `darwin-rebuild`, but git remote set-url origin http://unraid.local:3003/transnet/investor-flow Verify: `fm` launches OpenCode 2 as the first mate (isolated `~/.config/opencode2`); `oc2 --version` prints an OpenCode 2 version; `pi --list-models mimo` shows `opencode-go/mimo-v2.5-pro`; `tea pulls list --repo transnet/investor-flow` works. + +## OpenSuperWhisper (local voice input) + +Hold a shortcut, speak, release, and the transcript pastes into the focused app. Everything runs on the Mac: no audio or transcript leaves the machine. + +First run: + +1. The `opensuperwhisper` cask is installed and `home.activation.openSuperWhisper` pre-downloads the model to `~/Library/Application Support/ru.starmel.OpenSuperWhisper/whisper-models/ggml-large-v3-turbo.bin` and selects "Whisper V3 Large". +2. Open the app. Onboarding should already show "Whisper V3 Large" as downloaded. +3. Grant **Microphone** and **Accessibility** when macOS asks. **Input Monitoring** is only needed if you change the shortcut to a single modifier key. +4. Keep the default shortcut (Option plus the backtick key). Hold it, speak, release. Auto-paste puts the text into the focused terminal or editor. + +Notes: + +- The model is local-only (about 1.6 GB). If the download failed during the rebuild, rerun `./rebuild.sh` or download "Whisper V3 Large" in the app's Settings. +- Voice is for prompts and prose. Type URLs, file paths, and exact identifiers yourself. +- The first-run steps above are manual on purpose: macOS TCC permissions cannot be granted declaratively. From 16677278bac40cb441de4d4daa5038c7738f70f9 Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Sat, 24 Oct 2026 15:46:06 -0400 Subject: [PATCH 2/3] no-mistakes(review): Seed OpenSuperWhisper model path only, stop overwriting app settings --- AGENTS.md | 2 +- home.nix | 19 ++++++++----------- readme.md | 7 ++++--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 15aef11..3e9f686 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,7 +11,7 @@ Deliberate decisions in this repo - do NOT silently revert them: - firstmate lives at `~/Documents/firstmate` as a mutable git clone (not in the Nix store). `home.activation.firstmate` clones it if missing and seeds `config/backend=herdr` + `config/crew-harness=opencode` only when those files are absent. Crew routing is `home/.config/firstmate/crew-dispatch.json` (symlinked in): per the captain's order 2026-10-20, every coding crewmate and scout uses `opencode` + `opencode/deepseek-v4.1-flash-free` through the OpenCode CLI, because the paid Go subscription was close to emptying its monthly window. The validation pipeline stays on Pi with `opencode-go/deepseek-v4.1-flash` steps and the `opencode-go/glm-5.3-flash` reviewer. The free tier rate-limits under heavy parallel work, so a stalled worker falls back to the paid Go model only on the captain's word. Avoid the `muse-spark-*-contributor` models, which train on prompts, and the `exo-free`, `mimo-*-free`, and `nemotron-*-free` models, whose data may be used to improve the model. `cat-jam-free` retains for 30 days. Crews inherit the primary's OpenCode login through the spawn-owned symlink (the isolated worker data root links the primary `/opencode/auth.json`; no `~/.pi/agent/auth.json` reliance). Launch with shell alias `fm` (`cd` + OpenCode 2 via `~/.local/bin/oc2`); the primary stays OpenCode 2, only crews run on the opencode harness. Self-update via `/updatefirstmate`, not rebuild. - OpenCode 2 is the firstmate primary. It is not a Homebrew formula: install `@opencode-ai/cli@beta` with Homebrew's npm (`home.activation.opencode2`). Launch through `home/bin/oc2` so `OPENCODE_CONFIG` stays at `home/.config/opencode2/opencode.json` and cannot rewrite OpenCode 1.x's `~/.config/opencode`. Do not add a brew `opencode` / `opencode2` formula; `zap` would fight the npm install. firstmate harness detection matches `*opencode*`, so the `opencode2` process name still classifies as OpenCode. - Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo), `fm` (firstmate via OpenCode 2), `oc2` (OpenCode 2, isolated). They are intentional high-agency shortcuts. -- OpenSuperWhisper is installed by the `opensuperwhisper` cask, and `home.activation.openSuperWhisper` owns its Whisper model download (`ggml-large-v3-turbo.bin` under the app's Application Support directory, never the Nix store) and app defaults. Microphone/Accessibility/Input Monitoring grants stay manual because macOS TCC cannot be declarative; do not kill a running app to apply defaults. The model is local-only. +- OpenSuperWhisper is installed by the `opensuperwhisper` cask, and `home.activation.openSuperWhisper` downloads its Whisper model (`ggml-large-v3-turbo.bin` under the app's Application Support directory, never the Nix store) and seeds the model selection only when it is missing or dangling. All other app settings (trigger, language, paste behavior) belong to the app and must not be rewritten by a rebuild, so `modifierOnlyHotkey = rightOption` on this machine stays the effective trigger. Microphone/Accessibility/Input Monitoring grants stay manual because macOS TCC cannot be declarative; do not kill a running app to apply defaults. The model is local-only. ## Maintaining this file diff --git a/home.nix b/home.nix index 73ee96c..5f49dc0 100644 --- a/home.nix +++ b/home.nix @@ -406,10 +406,12 @@ in # The app reads its model from its own Application Support directory, so the # 1.6 GB Whisper model is downloaded here once and kept outside the Nix store. # A failed download must not fail the switch: warn, drop the partial file, and - # let the app's Settings download it later. Never write hasCompletedOnboarding - - # onboarding must still run so the captain can grant Microphone/Accessibility - # (macOS TCC grants are manual by design). A running app picks up new defaults - # on its next launch; do not kill it here. + # let the app's Settings download it later. Only a missing or unusable model + # selection is seeded; every other setting belongs to the app and survives the + # rebuild. Never write hasCompletedOnboarding - onboarding must still run so the + # captain can grant Microphone/Accessibility (macOS TCC grants are manual by + # design). A running app picks up new defaults on its next launch; do not kill + # it here. home.activation.openSuperWhisper = lib.hm.dag.entryAfter [ "writeBoundary" ] '' set -euo pipefail supportDir="$HOME/Library/Application Support/ru.starmel.OpenSuperWhisper" @@ -433,13 +435,8 @@ in fi defaults=/usr/bin/defaults - "$defaults" write ru.starmel.OpenSuperWhisper selectedEngine -string whisper - "$defaults" write ru.starmel.OpenSuperWhisper whisperLanguage -string en - "$defaults" write ru.starmel.OpenSuperWhisper autoPasteTranscription -bool true - "$defaults" write ru.starmel.OpenSuperWhisper holdToRecord -bool true - "$defaults" write ru.starmel.OpenSuperWhisper addSpaceAfterSentence -bool true - "$defaults" write ru.starmel.OpenSuperWhisper startHiddenInMenuBar -bool true - if [ -f "$modelPath" ]; then + selectedModel="$("$defaults" read ru.starmel.OpenSuperWhisper selectedWhisperModelPath 2>/dev/null || true)" + if [ -f "$modelPath" ] && { [ -z "$selectedModel" ] || [ ! -f "$selectedModel" ]; }; then "$defaults" write ru.starmel.OpenSuperWhisper selectedWhisperModelPath -string "$modelPath" fi ''; diff --git a/readme.md b/readme.md index 09ed42f..9560a29 100644 --- a/readme.md +++ b/readme.md @@ -21,13 +21,14 @@ Hold a shortcut, speak, release, and the transcript pastes into the focused app. First run: -1. The `opensuperwhisper` cask is installed and `home.activation.openSuperWhisper` pre-downloads the model to `~/Library/Application Support/ru.starmel.OpenSuperWhisper/whisper-models/ggml-large-v3-turbo.bin` and selects "Whisper V3 Large". +1. The `opensuperwhisper` cask is installed and `home.activation.openSuperWhisper` pre-downloads the model to `~/Library/Application Support/ru.starmel.OpenSuperWhisper/whisper-models/ggml-large-v3-turbo.bin`. It selects "Whisper V3 Large" only when no model is selected or the selected file is gone, so a model you pick in the app stays selected. 2. Open the app. Onboarding should already show "Whisper V3 Large" as downloaded. -3. Grant **Microphone** and **Accessibility** when macOS asks. **Input Monitoring** is only needed if you change the shortcut to a single modifier key. -4. Keep the default shortcut (Option plus the backtick key). Hold it, speak, release. Auto-paste puts the text into the focused terminal or editor. +3. Grant **Microphone**, **Accessibility**, and **Input Monitoring** when macOS asks. Input Monitoring is needed because the trigger is Right Option, a single modifier key. +4. Keep the Right Option trigger (or change it in the app's settings). Hold it, speak, release. Auto-paste puts the text into the focused terminal or editor. Notes: +- A fresh install starts with Option plus backtick instead of Right Option, and that combination needs no Input Monitoring. The activation never writes the trigger, the language, or the paste settings, so whatever you choose in the app survives the next rebuild. - The model is local-only (about 1.6 GB). If the download failed during the rebuild, rerun `./rebuild.sh` or download "Whisper V3 Large" in the app's Settings. - Voice is for prompts and prose. Type URLs, file paths, and exact identifiers yourself. - The first-run steps above are manual on purpose: macOS TCC permissions cannot be granted declaratively. From 86844a36468e27ffc03e9be6c02db06ef67c5d0b Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Sat, 24 Oct 2026 15:56:33 -0400 Subject: [PATCH 3/3] no-mistakes(document): Fix OpenSuperWhisper cask comment and Settings model label --- configuration.nix | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 417c283..68e6b4e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -66,7 +66,7 @@ "codex" # Codex CLI; shares ~/.codex/config.toml with the desktop app "docker-desktop" "grok-build" - "opensuperwhisper" # local Whisper dictation, model + defaults in home.nix + "opensuperwhisper" # local Whisper dictation; model seed in home.nix "puremac" "utm" "wezterm" diff --git a/readme.md b/readme.md index 9560a29..2c1fad0 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,6 @@ First run: Notes: - A fresh install starts with Option plus backtick instead of Right Option, and that combination needs no Input Monitoring. The activation never writes the trigger, the language, or the paste settings, so whatever you choose in the app survives the next rebuild. -- The model is local-only (about 1.6 GB). If the download failed during the rebuild, rerun `./rebuild.sh` or download "Whisper V3 Large" in the app's Settings. +- The model is local-only (about 1.6 GB). If the download failed during the rebuild, rerun `./rebuild.sh` or download the large Turbo V3 model ("Turbo V3 large" in the app's Settings) by hand. - Voice is for prompts and prose. Type URLs, file paths, and exact identifiers yourself. - The first-run steps above are manual on purpose: macOS TCC permissions cannot be granted declaratively.