@hxnnxs/opencode-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.
- package/CHANGELOG.md +17 -0
- package/CONTRIBUTING.md +22 -0
- package/LICENSE +21 -0
- package/PUBLISHING.md +36 -0
- package/README.es.md +174 -0
- package/README.md +174 -0
- package/README.ru.md +174 -0
- package/README.zh.md +174 -0
- package/SECURITY.md +19 -0
- package/assets/opencode-voice-dark.svg +27 -0
- package/assets/opencode-voice-light.svg +27 -0
- package/bin/opencode-voice.js +179 -0
- package/index.js +819 -0
- package/lib/download.js +129 -0
- package/lib/engine.js +406 -0
- package/lib/engines.js +337 -0
- package/lib/models.js +161 -0
- package/package.json +70 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here.
|
|
4
|
+
|
|
5
|
+
## 0.1.0 - 2026-06-12
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Initial OpenCode TUI voice input plugin.
|
|
10
|
+
- Local `whisper.cpp` transcription flow with model selection and verified downloads.
|
|
11
|
+
- Helper CLI for install guidance and local diagnostics.
|
|
12
|
+
- Managed engine status/import/remove commands for local `whisper-cli`.
|
|
13
|
+
- Managed engine auto-install from the opencode-voice GitHub Release registry.
|
|
14
|
+
- GitHub Actions workflow for building and publishing `whisper-cli` engine assets.
|
|
15
|
+
- Model verification markers so existing model files must pass SHA256 before activation.
|
|
16
|
+
- GitHub Actions release check workflow.
|
|
17
|
+
- npm packaging metadata and release checks.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve `opencode-voice`.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
- Use Node.js 20 or newer.
|
|
8
|
+
- Run `npm run check` before opening a change.
|
|
9
|
+
- Run `npm pack --dry-run` before release-oriented changes.
|
|
10
|
+
- Keep generated audio, downloaded models, and local logs out of git.
|
|
11
|
+
|
|
12
|
+
This package has no build step. Runtime code is shipped directly from `index.js`, `lib/`, and `bin/`.
|
|
13
|
+
|
|
14
|
+
## Release Checklist
|
|
15
|
+
|
|
16
|
+
- Update `CHANGELOG.md` for user-visible changes.
|
|
17
|
+
- Confirm `package.json` version and npm package contents.
|
|
18
|
+
- Run `npm run check`.
|
|
19
|
+
- Run `npm pack --dry-run` and inspect the file list.
|
|
20
|
+
- Create the GitHub release from the matching tag.
|
|
21
|
+
|
|
22
|
+
Do not publish prerelease artifacts as `latest` unless that is intentional.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
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/PUBLISHING.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Publishing
|
|
2
|
+
|
|
3
|
+
## npm name
|
|
4
|
+
|
|
5
|
+
The package publishes as `@hxnnxs/opencode-voice`.
|
|
6
|
+
|
|
7
|
+
The unscoped npm name `opencode-voice` is already published by another author, so do not publish this project under the unscoped name.
|
|
8
|
+
|
|
9
|
+
Before publishing:
|
|
10
|
+
|
|
11
|
+
1. Confirm `package.json#name` is `@hxnnxs/opencode-voice`.
|
|
12
|
+
2. Keep the OpenCode plugin id as `opencode-voice` unless you want users to see a different plugin id.
|
|
13
|
+
3. Confirm published install examples in all `README*.md` files use `@hxnnxs/opencode-voice`.
|
|
14
|
+
4. Create the GitHub repository `ihxnnxs/opencode-voice` and push `main`.
|
|
15
|
+
5. Run the **Engine Release** GitHub Actions workflow first. It must publish:
|
|
16
|
+
|
|
17
|
+
```txt
|
|
18
|
+
https://github.com/ihxnnxs/opencode-voice/releases/download/v0.1.0/registry.json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
6. Confirm the registry contains assets for the target release platforms.
|
|
22
|
+
7. Run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm run check
|
|
26
|
+
npm pack --dry-run --json
|
|
27
|
+
npm publish --dry-run
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Release checklist
|
|
31
|
+
|
|
32
|
+
- Confirm `bin/opencode-voice.js` is executable in `npm pack --dry-run --json` (`mode: 493`).
|
|
33
|
+
- Confirm `opencode-voice engine install whisper.cpp` downloads and probes the managed engine from the release registry.
|
|
34
|
+
- Confirm `opencode-voice doctor` reports a working managed engine probe.
|
|
35
|
+
- Confirm model downloads write `.sha256` verification markers.
|
|
36
|
+
- Tag the release after the GitHub Actions release check passes.
|
package/README.es.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/ihxnnxs/opencode-voice">
|
|
3
|
+
<picture>
|
|
4
|
+
<source srcset="assets/opencode-voice-dark.svg" media="(prefers-color-scheme: dark)">
|
|
5
|
+
<source srcset="assets/opencode-voice-light.svg" media="(prefers-color-scheme: light)">
|
|
6
|
+
<img src="assets/opencode-voice-light.svg" alt="opencode voice logo">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center">Speech-to-text local para OpenCode TUI.</p>
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img alt="status" src="https://img.shields.io/badge/status-mvp-orange?style=flat-square" />
|
|
13
|
+
<img alt="license" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" />
|
|
14
|
+
<img alt="opencode" src="https://img.shields.io/badge/opencode-%3E%3D1.17.4-black?style=flat-square" />
|
|
15
|
+
<img alt="stt" src="https://img.shields.io/badge/STT-local_whisper.cpp-purple?style=flat-square" />
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md">English</a> |
|
|
20
|
+
<a href="README.ru.md">Русский</a> |
|
|
21
|
+
<a href="README.zh.md">简体中文</a> |
|
|
22
|
+
<a href="README.es.md">Español</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Instalación
|
|
28
|
+
|
|
29
|
+
Una sola orden mediante OpenCode:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
opencode plugin @hxnnxs/opencode-voice
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Reinicia OpenCode después de instalar. En el primer inicio, el plugin descarga el managed `whisper.cpp` engine y el modelo elegido. El usuario no instala `whisper-cli` manualmente.
|
|
36
|
+
|
|
37
|
+
Instalador CLI opcional. Ejecuta el mismo comando de instalación de OpenCode y predescarga el managed engine:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @hxnnxs/opencode-voice install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
No clones el repositorio salvo que quieras desarrollar el plugin.
|
|
44
|
+
|
|
45
|
+
> [!TIP]
|
|
46
|
+
> El primer inicio abre un selector de modelo. Elige un modelo Whisper, espera la descarga y usa `ctrl+r` para dictar en el prompt.
|
|
47
|
+
|
|
48
|
+
### Requisitos
|
|
49
|
+
|
|
50
|
+
El plugin gestiona el STT engine y los modelos:
|
|
51
|
+
|
|
52
|
+
- descarga `whisper.cpp` desde el GitHub Release registry de opencode-voice
|
|
53
|
+
- lo guarda en `~/.cache/opencode-voice/engines/whisper.cpp/<platform>-<arch>/`
|
|
54
|
+
- descarga el modelo Whisper elegido durante el primer setup
|
|
55
|
+
|
|
56
|
+
Instalar `whisper-cli` manualmente es opcional. Si ya existe un binary local, `opencode-voice` puede importarlo o usarlo.
|
|
57
|
+
|
|
58
|
+
Comprueba tu máquina:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx @hxnnxs/opencode-voice doctor
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Instala el managed engine sin abrir OpenCode:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx @hxnnxs/opencode-voice engine install whisper.cpp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Uso
|
|
71
|
+
|
|
72
|
+
Comandos:
|
|
73
|
+
|
|
74
|
+
- `/voice` - alterna la grabación e inserta la transcripción
|
|
75
|
+
- `/voice-submit` - alterna la grabación, inserta la transcripción y envía
|
|
76
|
+
- `/voice-stop` - cancela la grabación o transcripción activa
|
|
77
|
+
- `/voice-settings` - abre ajustes de modelo, hotkeys, micrófono y diagnóstico
|
|
78
|
+
|
|
79
|
+
Hotkey por defecto:
|
|
80
|
+
|
|
81
|
+
```txt
|
|
82
|
+
ctrl+r -> iniciar grabación
|
|
83
|
+
ctrl+r -> detener, transcribir e insertar texto
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Hold-to-talk está desactivado por defecto porque los terminal release events cambian entre terminales. Puedes configurar un hotkey hold en `/voice-settings`.
|
|
87
|
+
|
|
88
|
+
### Modelos
|
|
89
|
+
|
|
90
|
+
Disponibles ahora mediante `whisper.cpp`:
|
|
91
|
+
|
|
92
|
+
| Modelo | Tamaño | Notas |
|
|
93
|
+
| -------------------- | ------ | ----------------------------- |
|
|
94
|
+
| Whisper Small | 465 MB | por defecto, multilingue |
|
|
95
|
+
| Whisper Medium Q4_1 | 469 MB | mejor precisión |
|
|
96
|
+
| Whisper Turbo | 1.5 GB | grande, más rápido que large completo |
|
|
97
|
+
| Whisper Large Q5_0 | 1.0 GB | preciso, más lento |
|
|
98
|
+
|
|
99
|
+
Las descargas de modelos soportan resume, retry, progreso y verificación SHA256.
|
|
100
|
+
|
|
101
|
+
Modelos sidecar planeados:
|
|
102
|
+
|
|
103
|
+
- Parakeet V3
|
|
104
|
+
- GigaAM v3
|
|
105
|
+
- Moonshine V2 Small
|
|
106
|
+
|
|
107
|
+
### Estado Por Plataforma
|
|
108
|
+
|
|
109
|
+
| Plataforma | Estado |
|
|
110
|
+
| ---------- | ------ |
|
|
111
|
+
| Linux | instalación engine/model en una orden; la grabación usa `arecord`, `ffmpeg` o `sox` |
|
|
112
|
+
| macOS | instalación engine/model en una orden; la grabación usa `ffmpeg` AVFoundation hasta el native recorder sidecar |
|
|
113
|
+
| Windows | ruta de descarga de engine lista; la grabación necesita el native recorder sidecar |
|
|
114
|
+
|
|
115
|
+
### Arquitectura
|
|
116
|
+
|
|
117
|
+
El paquete sigue la forma pública de plugin TUI que usan los plugins de la comunidad de OpenCode.
|
|
118
|
+
|
|
119
|
+
- npm package exporta `./tui`
|
|
120
|
+
- el desarrollo local puede apuntar `tui.json` a una ruta absoluta
|
|
121
|
+
- la instalación publicada usa `opencode plugin @hxnnxs/opencode-voice`
|
|
122
|
+
- runtime settings viven en OpenCode TUI plugin storage
|
|
123
|
+
|
|
124
|
+
Archivos:
|
|
125
|
+
|
|
126
|
+
- `index.js` - entrada TUI, comandos, dialogs, keymap layer
|
|
127
|
+
- `lib/models.js` - registry de modelos, cache paths, default settings
|
|
128
|
+
- `lib/download.js` - descarga resumible y verificación SHA256
|
|
129
|
+
- `lib/engine.js` - selección de recorder y transcripción con `whisper-cli`
|
|
130
|
+
- `lib/engines.js` - descarga, estado, importación y eliminación de managed native engine
|
|
131
|
+
- `bin/opencode-voice.js` - install wrapper y diagnostics CLI
|
|
132
|
+
|
|
133
|
+
La entrada por voz necesita native audio y STT binaries. El plugin JS gestiona OpenCode UI, settings, engine/model downloads y prompt insertion. Un native sidecar futuro debe reemplazar shell recorders y añadir fast VAD más Handy-style models.
|
|
134
|
+
|
|
135
|
+
### Roadmap
|
|
136
|
+
|
|
137
|
+
- publicar managed `whisper-cli` release assets antes del npm release
|
|
138
|
+
- Rust recorder sidecar con `cpal` y VAD
|
|
139
|
+
- soporte para Parakeet, GigaAM, SenseVoice, Canary y Moonshine
|
|
140
|
+
- Windows recorder support
|
|
141
|
+
- streaming-style transcription más rápida
|
|
142
|
+
|
|
143
|
+
### Desarrollo
|
|
144
|
+
|
|
145
|
+
Ejecuta las comprobaciones:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
npm run check
|
|
149
|
+
npm pack --dry-run
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Este MVP no tiene build step.
|
|
153
|
+
|
|
154
|
+
Instalación de desarrollo desde un checkout:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
git clone https://github.com/ihxnnxs/opencode-voice.git opencode-voice
|
|
158
|
+
cd opencode-voice
|
|
159
|
+
opencode plugin "$(pwd)"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Estado Del Proyecto
|
|
163
|
+
|
|
164
|
+
Este es un OpenCode plugin independiente. No está construido por el equipo de OpenCode y no está afiliado con OpenCode.
|
|
165
|
+
|
|
166
|
+
### Créditos
|
|
167
|
+
|
|
168
|
+
- OpenCode wordmark SVG adaptado del [OpenCode repository](https://github.com/anomalyco/opencode). La marca `voice` se añadió para este plugin.
|
|
169
|
+
- La transcripción local usa [`whisper.cpp`](https://github.com/ggml-org/whisper.cpp).
|
|
170
|
+
- La metadata de descarga de modelos sigue el UX local-first investigado en [Handy](https://github.com/cjpais/Handy).
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
**OpenCode** [Website](https://opencode.ai) | [Docs](https://opencode.ai/docs) | [Discord](https://opencode.ai/discord)
|
package/README.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/ihxnnxs/opencode-voice">
|
|
3
|
+
<picture>
|
|
4
|
+
<source srcset="assets/opencode-voice-dark.svg" media="(prefers-color-scheme: dark)">
|
|
5
|
+
<source srcset="assets/opencode-voice-light.svg" media="(prefers-color-scheme: light)">
|
|
6
|
+
<img src="assets/opencode-voice-light.svg" alt="opencode voice logo">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center">Local speech-to-text for the OpenCode TUI.</p>
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img alt="status" src="https://img.shields.io/badge/status-mvp-orange?style=flat-square" />
|
|
13
|
+
<img alt="license" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" />
|
|
14
|
+
<img alt="opencode" src="https://img.shields.io/badge/opencode-%3E%3D1.17.4-black?style=flat-square" />
|
|
15
|
+
<img alt="stt" src="https://img.shields.io/badge/STT-local_whisper.cpp-purple?style=flat-square" />
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md">English</a> |
|
|
20
|
+
<a href="README.ru.md">Русский</a> |
|
|
21
|
+
<a href="README.zh.md">简体中文</a> |
|
|
22
|
+
<a href="README.es.md">Español</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Installation
|
|
28
|
+
|
|
29
|
+
One command through OpenCode:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
opencode plugin @hxnnxs/opencode-voice
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Restart OpenCode after installing. First launch downloads the managed `whisper.cpp` engine and then the selected model. The user does not install `whisper-cli` manually.
|
|
36
|
+
|
|
37
|
+
Optional CLI installer. It runs the same OpenCode plugin install command and pre-downloads the managed engine:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @hxnnxs/opencode-voice install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Do not clone the repo unless you want to develop the plugin.
|
|
44
|
+
|
|
45
|
+
> [!TIP]
|
|
46
|
+
> First launch opens a model picker. Choose a Whisper model, let it download, then use `ctrl+r` to dictate into the prompt.
|
|
47
|
+
|
|
48
|
+
### Requirements
|
|
49
|
+
|
|
50
|
+
The plugin manages the STT engine and models:
|
|
51
|
+
|
|
52
|
+
- downloads `whisper.cpp` from the opencode-voice GitHub Release registry
|
|
53
|
+
- stores it in `~/.cache/opencode-voice/engines/whisper.cpp/<platform>-<arch>/`
|
|
54
|
+
- downloads the selected Whisper model on first setup
|
|
55
|
+
|
|
56
|
+
Manual `whisper-cli` install is optional. If a local binary already exists, `opencode-voice` can still import or use it.
|
|
57
|
+
|
|
58
|
+
Check your machine:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx @hxnnxs/opencode-voice doctor
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Install the managed engine without opening OpenCode:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx @hxnnxs/opencode-voice engine install whisper.cpp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Usage
|
|
71
|
+
|
|
72
|
+
Commands:
|
|
73
|
+
|
|
74
|
+
- `/voice` - toggle recording and append transcription
|
|
75
|
+
- `/voice-submit` - toggle recording, append transcription, and submit
|
|
76
|
+
- `/voice-stop` - cancel active recording or transcription
|
|
77
|
+
- `/voice-settings` - open model, hotkey, microphone, and diagnostics settings
|
|
78
|
+
|
|
79
|
+
Default hotkey:
|
|
80
|
+
|
|
81
|
+
```txt
|
|
82
|
+
ctrl+r -> start recording
|
|
83
|
+
ctrl+r -> stop, transcribe, and append
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Hold-to-talk is disabled by default because terminal release events vary by terminal. You can still configure a hold hotkey in `/voice-settings`.
|
|
87
|
+
|
|
88
|
+
### Models
|
|
89
|
+
|
|
90
|
+
Available now through `whisper.cpp`:
|
|
91
|
+
|
|
92
|
+
| Model | Size | Notes |
|
|
93
|
+
| -------------------- | ------ | ----------------------------- |
|
|
94
|
+
| Whisper Small | 465 MB | default, multilingual |
|
|
95
|
+
| Whisper Medium Q4_1 | 469 MB | better accuracy |
|
|
96
|
+
| Whisper Turbo | 1.5 GB | large, faster than full large |
|
|
97
|
+
| Whisper Large Q5_0 | 1.0 GB | accurate, slower |
|
|
98
|
+
|
|
99
|
+
Model downloads support resume, retry, progress, and SHA256 verification.
|
|
100
|
+
|
|
101
|
+
Planned sidecar models:
|
|
102
|
+
|
|
103
|
+
- Parakeet V3
|
|
104
|
+
- GigaAM v3
|
|
105
|
+
- Moonshine V2 Small
|
|
106
|
+
|
|
107
|
+
### Platform Status
|
|
108
|
+
|
|
109
|
+
| Platform | Status |
|
|
110
|
+
| -------- | ------ |
|
|
111
|
+
| Linux | one-command engine/model install; recording uses `arecord`, `ffmpeg`, or `sox` |
|
|
112
|
+
| macOS | one-command engine/model install; recording uses `ffmpeg` AVFoundation until the native recorder sidecar ships |
|
|
113
|
+
| Windows | engine download path ready; recording needs the native recorder sidecar |
|
|
114
|
+
|
|
115
|
+
### Architecture
|
|
116
|
+
|
|
117
|
+
The package follows the public OpenCode TUI plugin shape used by community plugins.
|
|
118
|
+
|
|
119
|
+
- npm package exports `./tui`
|
|
120
|
+
- local development can point `tui.json` at an absolute path
|
|
121
|
+
- published install uses `opencode plugin @hxnnxs/opencode-voice`
|
|
122
|
+
- runtime settings live in OpenCode TUI plugin storage
|
|
123
|
+
|
|
124
|
+
Files:
|
|
125
|
+
|
|
126
|
+
- `index.js` - TUI plugin entrypoint, commands, dialogs, keymap layer
|
|
127
|
+
- `lib/models.js` - model registry, cache paths, default settings
|
|
128
|
+
- `lib/download.js` - resumable model download and SHA256 verification
|
|
129
|
+
- `lib/engine.js` - recorder selection and `whisper-cli` transcription
|
|
130
|
+
- `lib/engines.js` - managed native engine download, status, import, and removal
|
|
131
|
+
- `bin/opencode-voice.js` - install wrapper and diagnostics CLI
|
|
132
|
+
|
|
133
|
+
Voice input needs native audio and STT binaries. The JS plugin manages OpenCode UI, settings, engine/model downloads, and prompt insertion. A future native sidecar should replace shell recorders and add fast VAD plus Handy-style models.
|
|
134
|
+
|
|
135
|
+
### Roadmap
|
|
136
|
+
|
|
137
|
+
- publish managed `whisper-cli` release assets before npm release
|
|
138
|
+
- Rust recorder sidecar with `cpal` and VAD
|
|
139
|
+
- Parakeet, GigaAM, SenseVoice, Canary, and Moonshine model support
|
|
140
|
+
- Windows recorder support
|
|
141
|
+
- faster streaming-style transcription
|
|
142
|
+
|
|
143
|
+
### Development
|
|
144
|
+
|
|
145
|
+
Run checks:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
npm run check
|
|
149
|
+
npm pack --dry-run
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
This MVP has no build step.
|
|
153
|
+
|
|
154
|
+
Development install from a checkout:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
git clone https://github.com/ihxnnxs/opencode-voice.git opencode-voice
|
|
158
|
+
cd opencode-voice
|
|
159
|
+
opencode plugin "$(pwd)"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Project Status
|
|
163
|
+
|
|
164
|
+
This is an independent OpenCode plugin. It is not built by the OpenCode team and is not affiliated with OpenCode.
|
|
165
|
+
|
|
166
|
+
### Credits
|
|
167
|
+
|
|
168
|
+
- OpenCode wordmark SVG adapted from the public [OpenCode repository](https://github.com/anomalyco/opencode). The `voice` mark was added for this plugin.
|
|
169
|
+
- Local transcription uses [`whisper.cpp`](https://github.com/ggml-org/whisper.cpp).
|
|
170
|
+
- Model download metadata follows the local-first UX researched from [Handy](https://github.com/cjpais/Handy).
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
**OpenCode** [Website](https://opencode.ai) | [Docs](https://opencode.ai/docs) | [Discord](https://opencode.ai/discord)
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/ihxnnxs/opencode-voice">
|
|
3
|
+
<picture>
|
|
4
|
+
<source srcset="assets/opencode-voice-dark.svg" media="(prefers-color-scheme: dark)">
|
|
5
|
+
<source srcset="assets/opencode-voice-light.svg" media="(prefers-color-scheme: light)">
|
|
6
|
+
<img src="assets/opencode-voice-light.svg" alt="opencode voice logo">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center">Локальный speech-to-text для OpenCode TUI.</p>
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img alt="status" src="https://img.shields.io/badge/status-mvp-orange?style=flat-square" />
|
|
13
|
+
<img alt="license" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" />
|
|
14
|
+
<img alt="opencode" src="https://img.shields.io/badge/opencode-%3E%3D1.17.4-black?style=flat-square" />
|
|
15
|
+
<img alt="stt" src="https://img.shields.io/badge/STT-local_whisper.cpp-purple?style=flat-square" />
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md">English</a> |
|
|
20
|
+
<a href="README.ru.md">Русский</a> |
|
|
21
|
+
<a href="README.zh.md">简体中文</a> |
|
|
22
|
+
<a href="README.es.md">Español</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Установка
|
|
28
|
+
|
|
29
|
+
Одна команда через OpenCode:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
opencode plugin @hxnnxs/opencode-voice
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Перезапустите OpenCode после установки. При первом запуске плагин сам скачает managed `whisper.cpp` engine и выбранную модель. Пользователь не ставит `whisper-cli` руками.
|
|
36
|
+
|
|
37
|
+
Опциональный CLI-установщик. Он запускает ту же установку через OpenCode и заранее скачивает managed engine:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @hxnnxs/opencode-voice install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Не клонируйте репозиторий, если не собираетесь разрабатывать плагин.
|
|
44
|
+
|
|
45
|
+
> [!TIP]
|
|
46
|
+
> При первом запуске откроется выбор модели. Выберите Whisper-модель, дождитесь загрузки и используйте `ctrl+r`, чтобы диктовать в prompt.
|
|
47
|
+
|
|
48
|
+
### Требования
|
|
49
|
+
|
|
50
|
+
Плагин сам управляет STT engine и моделями:
|
|
51
|
+
|
|
52
|
+
- скачивает `whisper.cpp` из GitHub Release registry проекта
|
|
53
|
+
- кладет его в `~/.cache/opencode-voice/engines/whisper.cpp/<platform>-<arch>/`
|
|
54
|
+
- скачивает выбранную Whisper-модель при первом setup
|
|
55
|
+
|
|
56
|
+
Ручная установка `whisper-cli` не нужна. Если локальный binary уже есть, `opencode-voice` всё ещё может импортировать или использовать его.
|
|
57
|
+
|
|
58
|
+
Проверить машину:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx @hxnnxs/opencode-voice doctor
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Установить managed engine без открытия OpenCode:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx @hxnnxs/opencode-voice engine install whisper.cpp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Использование
|
|
71
|
+
|
|
72
|
+
Команды:
|
|
73
|
+
|
|
74
|
+
- `/voice` - переключить запись и вставить транскрипцию
|
|
75
|
+
- `/voice-submit` - переключить запись, вставить транскрипцию и отправить
|
|
76
|
+
- `/voice-stop` - отменить активную запись или транскрибацию
|
|
77
|
+
- `/voice-settings` - открыть настройки модели, хоткеев, микрофона и диагностики
|
|
78
|
+
|
|
79
|
+
Хоткей по умолчанию:
|
|
80
|
+
|
|
81
|
+
```txt
|
|
82
|
+
ctrl+r -> начать запись
|
|
83
|
+
ctrl+r -> остановить, распознать и вставить текст
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Hold-to-talk отключен по умолчанию, потому что terminal release events зависят от терминала. Его можно включить в `/voice-settings`.
|
|
87
|
+
|
|
88
|
+
### Модели
|
|
89
|
+
|
|
90
|
+
Доступно сейчас через `whisper.cpp`:
|
|
91
|
+
|
|
92
|
+
| Модель | Размер | Примечание |
|
|
93
|
+
| ------------------- | ------ | ----------------------------- |
|
|
94
|
+
| Whisper Small | 465 MB | дефолт, multilingual |
|
|
95
|
+
| Whisper Medium Q4_1 | 469 MB | выше точность |
|
|
96
|
+
| Whisper Turbo | 1.5 GB | крупная, быстрее full large |
|
|
97
|
+
| Whisper Large Q5_0 | 1.0 GB | точная, медленнее |
|
|
98
|
+
|
|
99
|
+
Загрузка моделей поддерживает resume, retry, progress и SHA256 verification.
|
|
100
|
+
|
|
101
|
+
Запланированные sidecar-модели:
|
|
102
|
+
|
|
103
|
+
- Parakeet V3
|
|
104
|
+
- GigaAM v3
|
|
105
|
+
- Moonshine V2 Small
|
|
106
|
+
|
|
107
|
+
### Статус платформ
|
|
108
|
+
|
|
109
|
+
| Платформа | Статус |
|
|
110
|
+
| --------- | ------ |
|
|
111
|
+
| Linux | one-command engine/model install; запись использует `arecord`, `ffmpeg` или `sox` |
|
|
112
|
+
| macOS | one-command engine/model install; запись использует `ffmpeg` AVFoundation до native recorder sidecar |
|
|
113
|
+
| Windows | путь скачивания engine готов; recording ждёт native recorder sidecar |
|
|
114
|
+
|
|
115
|
+
### Архитектура
|
|
116
|
+
|
|
117
|
+
Пакет повторяет публичную форму OpenCode TUI-плагинов, которую используют community-плагины.
|
|
118
|
+
|
|
119
|
+
- npm package экспортирует `./tui`
|
|
120
|
+
- локальная разработка может указать абсолютный путь в `tui.json`
|
|
121
|
+
- published install использует `opencode plugin @hxnnxs/opencode-voice`
|
|
122
|
+
- runtime settings хранятся в OpenCode TUI plugin storage
|
|
123
|
+
|
|
124
|
+
Файлы:
|
|
125
|
+
|
|
126
|
+
- `index.js` - TUI entrypoint, команды, dialogs, keymap layer
|
|
127
|
+
- `lib/models.js` - registry моделей, cache paths, default settings
|
|
128
|
+
- `lib/download.js` - resumable download и SHA256 verification
|
|
129
|
+
- `lib/engine.js` - выбор recorder и transcription через `whisper-cli`
|
|
130
|
+
- `lib/engines.js` - managed native engine download, status, import и removal
|
|
131
|
+
- `bin/opencode-voice.js` - install wrapper и diagnostics CLI
|
|
132
|
+
|
|
133
|
+
Voice input требует native audio и STT binaries. JS-плагин управляет OpenCode UI, settings, engine/model downloads и prompt insertion. Будущий native sidecar должен заменить shell recorders и добавить fast VAD плюс Handy-style models.
|
|
134
|
+
|
|
135
|
+
### Roadmap
|
|
136
|
+
|
|
137
|
+
- опубликовать managed `whisper-cli` release assets перед npm release
|
|
138
|
+
- Rust recorder sidecar с `cpal` и VAD
|
|
139
|
+
- поддержка Parakeet, GigaAM, SenseVoice, Canary и Moonshine
|
|
140
|
+
- Windows recorder support
|
|
141
|
+
- более быстрая streaming-style transcription
|
|
142
|
+
|
|
143
|
+
### Разработка
|
|
144
|
+
|
|
145
|
+
Запустить проверки:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
npm run check
|
|
149
|
+
npm pack --dry-run
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
У этого MVP нет build step.
|
|
153
|
+
|
|
154
|
+
Установка из checkout для разработки:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
git clone https://github.com/ihxnnxs/opencode-voice.git opencode-voice
|
|
158
|
+
cd opencode-voice
|
|
159
|
+
opencode plugin "$(pwd)"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Статус проекта
|
|
163
|
+
|
|
164
|
+
Это независимый OpenCode plugin. Его не разрабатывает команда OpenCode, и он не связан с OpenCode официально.
|
|
165
|
+
|
|
166
|
+
### Кредиты
|
|
167
|
+
|
|
168
|
+
- OpenCode wordmark SVG адаптирован из публичного [OpenCode repository](https://github.com/anomalyco/opencode). Метка `voice` добавлена для этого плагина.
|
|
169
|
+
- Локальная транскрибация использует [`whisper.cpp`](https://github.com/ggml-org/whisper.cpp).
|
|
170
|
+
- Metadata загрузки моделей следует local-first UX, изученному в [Handy](https://github.com/cjpais/Handy).
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
**OpenCode** [Website](https://opencode.ai) | [Docs](https://opencode.ai/docs) | [Discord](https://opencode.ai/discord)
|