@goodandready/dsh-voice 0.8.1 → 0.8.2

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 (2) hide show
  1. package/lib/client.js +19 -1
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -1289,7 +1289,25 @@ window.__ModuleLoader__.load({
1289
1289
 
1290
1290
  exports.inject = ['timer', 'slots', 'settingsScope', 'locale']
1291
1291
  exports.apply = function apply(ctx) {
1292
- ctx.effect(() => ctx.locale.register(NS, { en, ru }), 'dsh-voice: словари')
1292
+ // Язык может принести не только плагин: словарные пакеты объявляют
1293
+ // русский для чужих пространств. Ядро на повторное объявление той же
1294
+ // пары «пространство + язык» бросает исключение, и незащищённый вызов
1295
+ // уносил с собой весь плагин — в интерфейсе это выглядело как «Failed to
1296
+ // load plugins» с перечнем ни в чём не повинных соседей.
1297
+ //
1298
+ // Поэтому каждый язык объявляется отдельно и по-хорошему: заняли до нас —
1299
+ // уступаем, свой английский при этом всё равно встаёт на место.
1300
+ const addLocale = (locale, dictionary) => {
1301
+ try {
1302
+ return ctx.locale.register(NS, locale, dictionary)
1303
+ } catch (alreadyTaken) {
1304
+ return () => {}
1305
+ }
1306
+ }
1307
+ ctx.effect(() => {
1308
+ const undo = [addLocale('en', en), addLocale('ru', ru)]
1309
+ return () => { for (const off of undo) off() }
1310
+ }, 'dsh-voice: словари')
1293
1311
  moduleT = ctx.locale.bind(NS)
1294
1312
  registerComposer(ctx)
1295
1313
  registerSettings(ctx)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-voice",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Voice input for DeepSeek Harness: dictation chunked by pauses and voice messages, each with its own provider fallback chain (Deepgram, Groq, HuggingFace, local whisper.cpp, plus any OpenAI-compatible API of your own).",
5
5
  "license": "MIT",
6
6
  "type": "module",