@hxnnxs/opencode-voice 0.1.8 → 0.2.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 +27 -0
- package/PUBLISHING.md +3 -3
- package/README.md +75 -35
- package/bin/opencode-voice.js +26 -5
- package/docs/README.es.md +5 -2
- package/docs/README.ru.md +5 -2
- package/docs/README.zh.md +10 -7
- package/index.js +265 -150
- package/lib/engine.js +44 -17
- package/lib/engines.js +130 -60
- package/lib/handy-model-catalog.js +820 -0
- package/lib/models.js +183 -24
- package/package.json +3 -2
package/lib/models.js
CHANGED
|
@@ -1,11 +1,88 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
2
3
|
import os from "node:os";
|
|
3
4
|
import path from "node:path";
|
|
5
|
+
import { HANDY_MODEL_CATALOG_SHA256, HANDY_MODELS } from "./handy-model-catalog.js";
|
|
4
6
|
|
|
5
7
|
export const PLUGIN_ID = "opencode-voice";
|
|
6
8
|
export const DEFAULT_MODEL_ID = "whisper-small";
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
const handyCatalogDigest = createHash("sha256").update(JSON.stringify(HANDY_MODELS, null, 2)).digest("hex");
|
|
11
|
+
if (handyCatalogDigest !== HANDY_MODEL_CATALOG_SHA256) throw new Error("Handy model catalog integrity check failed");
|
|
12
|
+
|
|
13
|
+
const BUILTIN_MODELS = [
|
|
14
|
+
{
|
|
15
|
+
id: "whisper-tiny-q5_1",
|
|
16
|
+
name: "Whisper Tiny Q5_1",
|
|
17
|
+
engine: "whisper.cpp",
|
|
18
|
+
implemented: true,
|
|
19
|
+
filename: "ggml-tiny-q5_1.bin",
|
|
20
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny-q5_1.bin",
|
|
21
|
+
sha256: "818710568da3ca15689e31a743197b520007872ff9576237bda97bd1b469c3d7",
|
|
22
|
+
sizeMB: 31,
|
|
23
|
+
languages: "multilingual",
|
|
24
|
+
description: "Fastest and smallest option. Best for short, clear dictation when accuracy is less important.",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "whisper-tiny",
|
|
28
|
+
name: "Whisper Tiny",
|
|
29
|
+
engine: "whisper.cpp",
|
|
30
|
+
implemented: true,
|
|
31
|
+
filename: "ggml-tiny.bin",
|
|
32
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin",
|
|
33
|
+
sha256: "be07e048e1e599ad46341c8d2a135645097a538221678b7acdd1b1919c6e1b21",
|
|
34
|
+
sizeMB: 74,
|
|
35
|
+
languages: "multilingual",
|
|
36
|
+
description: "Tiny multilingual model with a little more accuracy than the compact Q5_1 build.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "whisper-tiny-en",
|
|
40
|
+
name: "Whisper Tiny English",
|
|
41
|
+
engine: "whisper.cpp",
|
|
42
|
+
implemented: true,
|
|
43
|
+
filename: "ggml-tiny.en.bin",
|
|
44
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin",
|
|
45
|
+
sha256: "921e4cf8686fdd993dcd081a5da5b6c365bfde1162e72b08d75ac75289920b1f",
|
|
46
|
+
sizeMB: 74,
|
|
47
|
+
languages: "English",
|
|
48
|
+
description: "Fastest English-only Whisper model.",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "whisper-base-q5_1",
|
|
52
|
+
name: "Whisper Base Q5_1",
|
|
53
|
+
engine: "whisper.cpp",
|
|
54
|
+
implemented: true,
|
|
55
|
+
filename: "ggml-base-q5_1.bin",
|
|
56
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base-q5_1.bin",
|
|
57
|
+
sha256: "422f1ae452ade6f30a004d7e5c6a43195e4433bc370bf23fac9cc591f01a8898",
|
|
58
|
+
sizeMB: 57,
|
|
59
|
+
languages: "multilingual",
|
|
60
|
+
description: "Small multilingual model for lower-memory machines.",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "whisper-base",
|
|
64
|
+
name: "Whisper Base",
|
|
65
|
+
engine: "whisper.cpp",
|
|
66
|
+
implemented: true,
|
|
67
|
+
filename: "ggml-base.bin",
|
|
68
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.bin",
|
|
69
|
+
sha256: "60ed5bc3dd14eea856493d334349b405782ddcaf0028d4b5df4088345fba2efe",
|
|
70
|
+
sizeMB: 141,
|
|
71
|
+
languages: "multilingual",
|
|
72
|
+
description: "Balanced small multilingual model.",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "whisper-base-en",
|
|
76
|
+
name: "Whisper Base English",
|
|
77
|
+
engine: "whisper.cpp",
|
|
78
|
+
implemented: true,
|
|
79
|
+
filename: "ggml-base.en.bin",
|
|
80
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin",
|
|
81
|
+
sha256: "a03779c86df3323075f5e796cb2ce5029f00ec8869eee3fdfb897afe36c6d002",
|
|
82
|
+
sizeMB: 141,
|
|
83
|
+
languages: "English",
|
|
84
|
+
description: "Balanced small English-only model.",
|
|
85
|
+
},
|
|
9
86
|
{
|
|
10
87
|
id: "whisper-small",
|
|
11
88
|
name: "Whisper Small",
|
|
@@ -20,6 +97,66 @@ export const MODELS = [
|
|
|
20
97
|
languages: "multilingual",
|
|
21
98
|
description: "Good first local model. Multilingual, including Russian, but not tiny.",
|
|
22
99
|
},
|
|
100
|
+
{
|
|
101
|
+
id: "whisper-small-q5_1",
|
|
102
|
+
name: "Whisper Small Q5_1",
|
|
103
|
+
engine: "whisper.cpp",
|
|
104
|
+
implemented: true,
|
|
105
|
+
filename: "ggml-small-q5_1.bin",
|
|
106
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small-q5_1.bin",
|
|
107
|
+
sha256: "ae85e4a935d7a567bd102fe55afc16bb595bdb618e11b2fc7591bc08120411bb",
|
|
108
|
+
sizeMB: 181,
|
|
109
|
+
languages: "multilingual",
|
|
110
|
+
description: "Compact version of Small with a better speed and memory trade-off.",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "whisper-small-en",
|
|
114
|
+
name: "Whisper Small English",
|
|
115
|
+
engine: "whisper.cpp",
|
|
116
|
+
implemented: true,
|
|
117
|
+
filename: "ggml-small.en.bin",
|
|
118
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin",
|
|
119
|
+
sha256: "c6138d6d58ecc8322097e0f987c32f1be8bb0a18532a3f88f734d1bbf9c41e5d",
|
|
120
|
+
sizeMB: 465,
|
|
121
|
+
languages: "English",
|
|
122
|
+
description: "Small English-only model with better English recognition than Tiny or Base.",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "whisper-medium-q5_0",
|
|
126
|
+
name: "Whisper Medium Q5_0",
|
|
127
|
+
engine: "whisper.cpp",
|
|
128
|
+
implemented: true,
|
|
129
|
+
filename: "ggml-medium-q5_0.bin",
|
|
130
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium-q5_0.bin",
|
|
131
|
+
sha256: "19fea4b380c3a618ec4723c3eef2eb785ffba0d0538cf43f8f235e7b3b34220f",
|
|
132
|
+
sizeMB: 514,
|
|
133
|
+
languages: "multilingual",
|
|
134
|
+
description: "Higher-quality multilingual model for machines with more memory.",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "whisper-medium",
|
|
138
|
+
name: "Whisper Medium",
|
|
139
|
+
engine: "whisper.cpp",
|
|
140
|
+
implemented: true,
|
|
141
|
+
filename: "ggml-medium.bin",
|
|
142
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium.bin",
|
|
143
|
+
sha256: "6c14d5adee5f86394037b4e4e8b59f1673b6cee10e3cf0b11bbdbee79c156208",
|
|
144
|
+
sizeMB: 1463,
|
|
145
|
+
languages: "multilingual",
|
|
146
|
+
description: "Full-precision Medium for higher multilingual accuracy.",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: "whisper-medium-en",
|
|
150
|
+
name: "Whisper Medium English",
|
|
151
|
+
engine: "whisper.cpp",
|
|
152
|
+
implemented: true,
|
|
153
|
+
filename: "ggml-medium.en.bin",
|
|
154
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium.en.bin",
|
|
155
|
+
sha256: "cc37e93478338ec7700281a7ac30a10128929eb8f427dda2e865faa8f6da4356",
|
|
156
|
+
sizeMB: 1463,
|
|
157
|
+
languages: "English",
|
|
158
|
+
description: "Full-precision Medium optimized for English.",
|
|
159
|
+
},
|
|
23
160
|
{
|
|
24
161
|
id: "whisper-medium-q4_1",
|
|
25
162
|
name: "Whisper Medium Q4_1",
|
|
@@ -46,6 +183,18 @@ export const MODELS = [
|
|
|
46
183
|
languages: "multilingual",
|
|
47
184
|
description: "Large and accurate. Download only if you want the bigger model.",
|
|
48
185
|
},
|
|
186
|
+
{
|
|
187
|
+
id: "whisper-turbo-q5_0",
|
|
188
|
+
name: "Whisper Turbo Q5_0",
|
|
189
|
+
engine: "whisper.cpp",
|
|
190
|
+
implemented: true,
|
|
191
|
+
filename: "ggml-large-v3-turbo-q5_0.bin",
|
|
192
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q5_0.bin",
|
|
193
|
+
sha256: "394221709cd5ad1f40c46e6031ca61bce88931e6e088c188294c6d5a55ffa7e2",
|
|
194
|
+
sizeMB: 547,
|
|
195
|
+
languages: "multilingual",
|
|
196
|
+
description: "Quantized Turbo: stronger recognition than Small in less space than full Turbo.",
|
|
197
|
+
},
|
|
49
198
|
{
|
|
50
199
|
id: "whisper-large-q5_0",
|
|
51
200
|
name: "Whisper Large Q5_0",
|
|
@@ -60,37 +209,47 @@ export const MODELS = [
|
|
|
60
209
|
description: "Accurate but slower. Good machines only.",
|
|
61
210
|
},
|
|
62
211
|
{
|
|
63
|
-
id: "
|
|
64
|
-
name: "
|
|
65
|
-
engine: "
|
|
66
|
-
implemented:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
212
|
+
id: "whisper-large-v1",
|
|
213
|
+
name: "Whisper Large V1",
|
|
214
|
+
engine: "whisper.cpp",
|
|
215
|
+
implemented: true,
|
|
216
|
+
filename: "ggml-large-v1.bin",
|
|
217
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v1.bin",
|
|
218
|
+
sha256: "7d99f41a10525d0206bddadd86760181fa920438b6b33237e3118ff6c83bb53d",
|
|
219
|
+
sizeMB: 2951,
|
|
220
|
+
languages: "multilingual",
|
|
221
|
+
description: "Original full Large model. Very large and slow on CPU.",
|
|
70
222
|
},
|
|
71
223
|
{
|
|
72
|
-
id: "
|
|
73
|
-
name: "
|
|
74
|
-
engine: "
|
|
75
|
-
implemented:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
224
|
+
id: "whisper-large-v2",
|
|
225
|
+
name: "Whisper Large V2",
|
|
226
|
+
engine: "whisper.cpp",
|
|
227
|
+
implemented: true,
|
|
228
|
+
filename: "ggml-large-v2.bin",
|
|
229
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v2.bin",
|
|
230
|
+
sha256: "9a423fe4d40c82774b6af34115b8b935f34152246eb19e80e376071d3f999487",
|
|
231
|
+
sizeMB: 2951,
|
|
232
|
+
languages: "multilingual",
|
|
233
|
+
description: "Second-generation full Large model. Very large and slow on CPU.",
|
|
79
234
|
},
|
|
80
235
|
{
|
|
81
|
-
id: "
|
|
82
|
-
name: "
|
|
83
|
-
engine: "
|
|
84
|
-
implemented:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
236
|
+
id: "whisper-large-v3",
|
|
237
|
+
name: "Whisper Large V3",
|
|
238
|
+
engine: "whisper.cpp",
|
|
239
|
+
implemented: true,
|
|
240
|
+
filename: "ggml-large-v3.bin",
|
|
241
|
+
url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3.bin",
|
|
242
|
+
sha256: "64d182b440b98d5203c4f9bd541544d84c605196c4f7b845dfa11fb23594d1e2",
|
|
243
|
+
sizeMB: 2952,
|
|
244
|
+
languages: "multilingual",
|
|
245
|
+
description: "Latest full Large model. Highest resource requirement in the Whisper set.",
|
|
88
246
|
},
|
|
89
247
|
];
|
|
90
248
|
|
|
249
|
+
export const MODELS = [...BUILTIN_MODELS, ...HANDY_MODELS];
|
|
250
|
+
|
|
91
251
|
export const DEFAULT_SETTINGS = {
|
|
92
|
-
|
|
93
|
-
toggleHotkey: "ctrl+r",
|
|
252
|
+
recordingHotkey: "ctrl+r",
|
|
94
253
|
submitHotkey: "",
|
|
95
254
|
model: DEFAULT_MODEL_ID,
|
|
96
255
|
language: "auto",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hxnnxs/opencode-voice",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Local voice input plugin for OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"LICENSE"
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
|
-
"check": "node --check index.js && node --check lib/models.js && node --check lib/download.js && node --check lib/engine.js && node --check lib/engines.js && node --check bin/opencode-voice.js && node --check scripts/package-engine-asset.mjs && node --check scripts/build-engine-registry.mjs",
|
|
45
|
+
"check": "node --check index.js && node --check lib/models.js && node --check lib/handy-model-catalog.js && node --check lib/download.js && node --check lib/engine.js && node --check lib/engines.js && node --check bin/opencode-voice.js && node --check scripts/package-engine-asset.mjs && node --check scripts/build-engine-registry.mjs && node --check scripts/update-handy-model-catalog.mjs",
|
|
46
|
+
"update-handy-model-catalog": "node scripts/update-handy-model-catalog.mjs",
|
|
46
47
|
"prepack": "npm run check"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|