@earendil-works/pi-voice 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -0
  3. package/catalog/recommendations.json +710 -0
  4. package/index.ts +1 -0
  5. package/package.json +69 -0
  6. package/src/async-limiter.ts +77 -0
  7. package/src/audio-constants.ts +1 -0
  8. package/src/audio.ts +193 -0
  9. package/src/catalog.generated.ts +1305 -0
  10. package/src/catalog.ts +89 -0
  11. package/src/chinese.ts +52 -0
  12. package/src/deferred.ts +30 -0
  13. package/src/dictation-controller.ts +204 -0
  14. package/src/file-audio.ts +164 -0
  15. package/src/file-transcription.ts +212 -0
  16. package/src/index.ts +114 -0
  17. package/src/install-migration.ts +47 -0
  18. package/src/keybindings.ts +118 -0
  19. package/src/languages.ts +22 -0
  20. package/src/microphone-picker.ts +99 -0
  21. package/src/model-activation.ts +74 -0
  22. package/src/model-cells.ts +218 -0
  23. package/src/model-picker.ts +1026 -0
  24. package/src/model-ratings-help.md +41 -0
  25. package/src/model-ratings-help.ts +146 -0
  26. package/src/model-selection-controller.ts +185 -0
  27. package/src/models.ts +263 -0
  28. package/src/onboarding.ts +314 -0
  29. package/src/pcm-chunker.ts +42 -0
  30. package/src/pcm.ts +19 -0
  31. package/src/recommendation-picker.ts +512 -0
  32. package/src/recommendations.ts +423 -0
  33. package/src/runtime.ts +501 -0
  34. package/src/settings-menu.ts +410 -0
  35. package/src/settings-path.ts +13 -0
  36. package/src/settings.ts +235 -0
  37. package/src/shortcut-core.ts +85 -0
  38. package/src/shortcuts.ts +167 -0
  39. package/src/startup-shortcut.ts +24 -0
  40. package/src/transcript-preview.ts +52 -0
  41. package/src/transcription-service.ts +548 -0
  42. package/src/transcription.ts +186 -0
  43. package/src/try-it.ts +327 -0
  44. package/src/ui-components.ts +432 -0
  45. package/src/visualizer.ts +269 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Earendil Works contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Pi Voice
2
+
3
+ Local speech-to-text for Pi.
4
+
5
+ Press a keyboard shortcut, talk, and the resulting transcript will be put directly into your chat.
6
+
7
+ ## Install
8
+
9
+ Install the npm package:
10
+
11
+ ```bash
12
+ pi install npm:@earendil-works/pi-voice
13
+ ```
14
+
15
+ If you prefer being on the development tip, you can install from GitHub:
16
+
17
+ ```bash
18
+ pi install ssh://git@github.com/earendil-works/pi-voice
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ The extension registers:
24
+
25
+ - a configurable terminal shortcut (`Ctrl+Alt+Z` by default) to start and stop recording;
26
+ - a `transcribe_file` tool that the agent can use to transcribe local audio or video files;
27
+ - `/voice-settings` for preferred languages, model, transcription language, microphone, and shortcut settings.
28
+
29
+ `/transcribe` remains available as a compatibility alias for `/voice-settings`. The `/voice` command is reserved for a future voice mode.
30
+
31
+ ## Upgrading from pi-transcribe
32
+
33
+ It's recommended to install Pi Voice via NPM. If you have an older install of pi-transcribe uninstall it via:
34
+
35
+ ```bash
36
+ pi remove git:github.com/earendil-works/pi-transcribe
37
+ ```
38
+
39
+ If you installed it into a project with `-l`, run `pi remove -l git:github.com/earendil-works/pi-transcribe` from that project instead. Then install Pi Voice with:
40
+
41
+ ```bash
42
+ pi install npm:@earendil-works/pi-voice
43
+ ```
44
+
45
+ ## File transcription and FFmpeg
46
+
47
+ The agent can call `transcribe_file` for local audio or video files. Decoded audio is limited to 128 MiB (about 35 minutes). File decoding requires the `ffmpeg` executable. Install FFmpeg with your system package manager if you don't already have it installed
48
+
49
+ ```bash
50
+ # macOS with Homebrew
51
+ brew install ffmpeg
52
+
53
+ # Debian or Ubuntu
54
+ sudo apt install ffmpeg
55
+
56
+ # Windows with winget
57
+ winget install Gyan.FFmpeg
58
+ ```
59
+
60
+ If FFmpeg is installed outside `PATH`, point Pi Voice at it before starting Pi:
61
+
62
+ ```bash
63
+ export PI_VOICE_FFMPEG_PATH=/path/to/ffmpeg
64
+ ```
65
+
66
+ The legacy `PI_TRANSCRIBE_FFMPEG_PATH` variable remains supported when `PI_VOICE_FFMPEG_PATH` is not set.
67
+
68
+ When FFmpeg is unavailable, `transcribe_file` reports platform-specific guidance to the agent. The agent should ask before running a package-manager command. Model setup is still explicit: run `/voice-settings` once in the interactive TUI to choose and, after confirmation, download a local model.
69
+
70
+ ## Developing & Building Pi Voice
71
+
72
+ To develop or run it from a checkout:
73
+
74
+ ```bash
75
+ git clone git@github.com:earendil-works/pi-voice.git
76
+ cd pi-voice
77
+ npm install --ignore-scripts
78
+ pi -e .
79
+ ```
80
+
81
+ If you want to be able to re-run onboarding you can enable the debug env var when starting Pi. This enables the `/voice-onboarding` command.
82
+
83
+ ```bash
84
+ PI_VOICE_DEBUG=1 pi -e /absolute/path/to/pi-voice
85
+ ```
86
+