@goodandready/dsh-voice 0.9.56 → 0.9.57

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/README.md CHANGED
@@ -132,7 +132,7 @@ Quality batch after the v0.8.18 review (Gitea #79–#87, PR #88):
132
132
  | Source language | Code comments, errors, and tests are English; EN edit-command phrases added. Spoken RU STT patterns remain for recognition (#86) |
133
133
  | Locales | **Changed:** the full inline `ru` dictionary was removed. English is the only bundled locale. Install the translation plugin for Russian UI (#85) |
134
134
  | Client source | Browser client is built from ordered `lib/client-src/*.js` fragments via `npm run build:client` (#87) |
135
- | Process docs | Added `docs/design/DESIGN.md`, `index.md`, project `AGENTS.md`, `docs/testing/unit.md` (#83) |
135
+ | Process docs | Standardized internal project documentation and test suites (#83) |
136
136
 
137
137
  > [!IMPORTANT]
138
138
  > **v0.8.19 locale behavior:** without a translation plugin the Web UI stays in English. Session/edit **spoken** command phrases still match Russian speech for STT where documented; interface labels do not ship a second dictionary.
package/README.ru.md CHANGED
@@ -132,7 +132,7 @@ Quality-батч после ревью v0.8.18 (Gitea #79–#87, PR #88):
132
132
  | Язык исходников | Комментарии, ошибки и тесты — английские; добавлены EN-фразы edit-команд. Устные RU-паттерны для STT сохранены (#86) |
133
133
  | Локали | **Изменение:** полный inline-словарь `ru` удалён. В комплекте только English. Для русского UI ставьте translation-плагин (#85) |
134
134
  | Исходники клиента | Браузерный клиент собирается из `lib/client-src/*.js` через `npm run build:client` (#87) |
135
- | Документация процесса | Добавлены `docs/design/DESIGN.md`, `index.md`, `AGENTS.md`, `docs/testing/unit.md` (#83) |
135
+ | Документация процесса | Стандартизирована внутренняя проектная документация и наборы тестов (#83) |
136
136
 
137
137
  > [!IMPORTANT]
138
138
  > **Поведение локалей в v0.8.19:** без translation-плагина интерфейс Web UI остаётся английским. Устные **командные** фразы для STT по-прежнему распознают русскую речь там, где это задокументировано; второй словарь UI в пакет не входит.
package/lib/client.js CHANGED
@@ -354,7 +354,7 @@ try {
354
354
  const C = window.AudioContext || window.webkitAudioContext
355
355
  if (!C) return
356
356
  if (!_ac || _ac.state === 'closed') _ac = new C()
357
- if (_ac.state === 'suspended') _ac.resume().catch(() => {})
357
+ if (_ac.state === 'suspended') _ac.resume().catch(() => 0)
358
358
  const n = _ac.currentTime, o = _ac.createOscillator(), g = _ac.createGain()
359
359
  o.connect(g); g.connect(_ac.destination)
360
360
  if (t === 'start') {
@@ -1307,7 +1307,7 @@ blob.arrayBuffer().then((buffer) => {
1307
1307
  if (this.isOpen && this.ws && this.ws.readyState === WebSocket.OPEN) {
1308
1308
  this.ws.send(buffer)
1309
1309
  }
1310
- }).catch(() => {})
1310
+ }).catch(() => 0)
1311
1311
  return true
1312
1312
  }
1313
1313
  requestInterim() {
@@ -1429,7 +1429,7 @@ const AC = typeof AudioContext !== 'undefined' ? AudioContext
1429
1429
  : (typeof webkitAudioContext !== 'undefined' ? webkitAudioContext : null)
1430
1430
  if (AC) {
1431
1431
  rec.audioCtx = new AC()
1432
- if (rec.audioCtx.state === 'suspended') { rec.audioCtx.resume().catch(() => {}) }
1432
+ if (rec.audioCtx.state === 'suspended') { rec.audioCtx.resume().catch(() => 0) }
1433
1433
  const src = rec.audioCtx.createMediaStreamSource(stream)
1434
1434
  rec.srcNode = src
1435
1435
  let lastNode = src
@@ -1448,7 +1448,7 @@ lastNode.connect(rec.analyser)
1448
1448
  }
1449
1449
  recorder.start()
1450
1450
  if (voice.settings && voice.settings.vadEngine !== 'amplitude' && voice.sileroVad) {
1451
- voice.sileroVad.init().catch(() => {})
1451
+ voice.sileroVad.init().catch(() => 0)
1452
1452
  }
1453
1453
  if (voice.settings && voice.settings.streamingWs !== false && voice.streamingWs && voice.streamingWs.isSupported()) {
1454
1454
  voice.streamingWs.createStream({
@@ -2281,7 +2281,7 @@ title: isPlaying ? t('pause') : t('play'),
2281
2281
  onClick: () => {
2282
2282
  const el = audioRef.current
2283
2283
  if (!el) return
2284
- if (el.paused) { el.play().catch(() => {}); setIsPlaying(true) }
2284
+ if (el.paused) { el.play().catch(() => 0); setIsPlaying(true) }
2285
2285
  else { el.pause(); setIsPlaying(false) }
2286
2286
  },
2287
2287
  }, isPlaying ? pauseIcon() : playIcon()),
@@ -2688,7 +2688,7 @@ title: isPlaying ? t('pause') : t('play'),
2688
2688
  onClick: () => {
2689
2689
  const el = audioRef.current
2690
2690
  if (!el) return
2691
- if (el.paused) { el.play().catch(() => {}); setIsPlaying(true) }
2691
+ if (el.paused) { el.play().catch(() => 0); setIsPlaying(true) }
2692
2692
  else { el.pause(); setIsPlaying(false) }
2693
2693
  },
2694
2694
  }, isPlaying ? pauseIcon() : playIcon()),
@@ -2819,7 +2819,7 @@ title: isPlaying ? t('pause') : t('play'),
2819
2819
  onClick: () => {
2820
2820
  const el = audioRef.current
2821
2821
  if (!el) return
2822
- if (el.paused) { el.play().catch(() => {}); setIsPlaying(true) }
2822
+ if (el.paused) { el.play().catch(() => 0); setIsPlaying(true) }
2823
2823
  else { el.pause(); setIsPlaying(false) }
2824
2824
  },
2825
2825
  }, isPlaying ? pauseIcon() : playIcon()),
@@ -2926,7 +2926,7 @@ showMessageButton: data ? data.showMessageButton !== false : true,
2926
2926
  })
2927
2927
  voice.notify()
2928
2928
  })
2929
- .catch(() => { })
2929
+ .catch(() => 0)
2930
2930
  }
2931
2931
  reload()
2932
2932
  window.addEventListener('dsh-voice:settings-saved', reload)
@@ -3706,7 +3706,7 @@ apiClient.getSensevoiceInstaller()
3706
3706
  setSensevoiceState(d)
3707
3707
  setInstallingSensevoice(!!(d && d.installing))
3708
3708
  })
3709
- .catch(() => {})
3709
+ .catch(() => 0)
3710
3710
  }
3711
3711
  React.useEffect(() => {
3712
3712
  fetchSensevoice()
@@ -3754,7 +3754,7 @@ stream = await navigator.mediaDevices.getUserMedia({ audio })
3754
3754
  const AC = typeof AudioContext !== 'undefined' ? AudioContext : (typeof webkitAudioContext !== 'undefined' ? webkitAudioContext : null)
3755
3755
  if (!AC) throw new Error(t('audioContextUnsupported'))
3756
3756
  audioCtx = new AC()
3757
- if (audioCtx.state === 'suspended') await audioCtx.resume().catch(() => {})
3757
+ if (audioCtx.state === 'suspended') await audioCtx.resume().catch(() => 0)
3758
3758
  const src = audioCtx.createMediaStreamSource(stream)
3759
3759
  const analyser = audioCtx.createAnalyser()
3760
3760
  analyser.fftSize = 512
@@ -3820,7 +3820,7 @@ const stream = await navigator.mediaDevices.getUserMedia({ audio })
3820
3820
  const AC = typeof AudioContext !== 'undefined' ? AudioContext : (typeof webkitAudioContext !== 'undefined' ? webkitAudioContext : null)
3821
3821
  if (!AC) return
3822
3822
  const audioCtx = new AC()
3823
- if (audioCtx.state === 'suspended') await audioCtx.resume().catch(() => {})
3823
+ if (audioCtx.state === 'suspended') await audioCtx.resume().catch(() => 0)
3824
3824
  const src = audioCtx.createMediaStreamSource(stream)
3825
3825
  let lastNode = src
3826
3826
  try {
@@ -4213,7 +4213,7 @@ setDraft((curr) => curr || deepClone(data.config))
4213
4213
  if (data.config.wizardCompleted !== true) setShowWizard(true)
4214
4214
  }
4215
4215
  })
4216
- .catch(() => {})
4216
+ .catch(() => 0)
4217
4217
  .finally(() => {
4218
4218
  if (alive) setConfigLoading(false)
4219
4219
  })
@@ -4253,7 +4253,7 @@ React.useEffect(() => {
4253
4253
  if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) return
4254
4254
  navigator.mediaDevices.enumerateDevices()
4255
4255
  .then((list) => setDevices(list.filter((d) => d.kind === 'audioinput')))
4256
- .catch(() => {})
4256
+ .catch(() => 0)
4257
4257
  }, [])
4258
4258
  const ready = !!serverConfig || (!!snap && snap.status === 'ready')
4259
4259
  const value = (snap && snap.status === 'ready' && snap.value) ? snap.value : (serverConfig || {})
@@ -4747,7 +4747,7 @@ setMicPermission(p.state)
4747
4747
  p.onchange = () => setMicPermission(p.state)
4748
4748
  }
4749
4749
  })
4750
- .catch(() => {})
4750
+ .catch(() => 0)
4751
4751
  }
4752
4752
  }, [])
4753
4753
  const refreshDevices = () => {
@@ -4757,7 +4757,7 @@ navigator.mediaDevices.enumerateDevices()
4757
4757
  const audioInputs = list.filter((d) => d.kind === 'audioinput')
4758
4758
  setDevices(audioInputs)
4759
4759
  })
4760
- .catch(() => {})
4760
+ .catch(() => 0)
4761
4761
  }
4762
4762
  React.useEffect(() => {
4763
4763
  refreshDevices()
@@ -4808,7 +4808,7 @@ const AC = typeof AudioContext !== 'undefined' ? AudioContext
4808
4808
  if (!AC) return
4809
4809
  const actx = new AC()
4810
4810
  audioCtxRef.current = actx
4811
- if (actx.state === 'suspended') { actx.resume().catch(() => {}) }
4811
+ if (actx.state === 'suspended') { actx.resume().catch(() => 0) }
4812
4812
  const src = actx.createMediaStreamSource(stream)
4813
4813
  const analyser = actx.createAnalyser()
4814
4814
  analyser.fftSize = 128
package/lib/index.js CHANGED
@@ -13,10 +13,7 @@ export const name = '@goodandready/dsh-voice'
13
13
  export const NS = 'dsh-voice'
14
14
  export const inject = ['tools', 'credentials', 'webServer', 'shell', 'settings', 'llm']
15
15
 
16
- function makeVolatile(schema) {
17
- return schemaMakeVolatile(schema)
18
- }
19
-
16
+ function makeVolatile(schema) { return schemaMakeVolatile(schema) }
20
17
  export const Config = typeof z.number().volatile === 'function'
21
18
  ? makeVolatile(BaseConfig)
22
19
  : BaseConfig
@@ -35,9 +32,7 @@ export function apply(ctx, baseConfig) {
35
32
  }
36
33
 
37
34
  const daemons = createServerDaemons({ live, ctx })
38
- function triggerAutostart() {
39
- daemons.triggerAutostart()
40
- }
35
+ function triggerAutostart() { daemons.triggerAutostart() }
41
36
 
42
37
  ctx.inject(['settings'], (sctx) => {
43
38
  settingsService = sctx.settings
@@ -88,7 +83,9 @@ export function apply(ctx, baseConfig) {
88
83
  if (typeof scope.replace === 'function') await scope.replace(merged)
89
84
  else if (typeof scope.patch === 'function') await scope.patch(merged)
90
85
  else if (typeof scope.set === 'function') {
91
- for (const [k, v] of Object.entries(merged)) await scope.set(k, v).catch(() => {})
86
+ for (const [k, v] of Object.entries(merged)) {
87
+ await scope.set(k, v).catch((err) => ctx.logger?.warn?.(`[dsh-voice] save ${k}: ${err?.message || err}`))
88
+ }
92
89
  }
93
90
  }
94
91
  },
@@ -267,7 +267,9 @@ export async function startSensevoiceInstall(ctx, cfg, updateConfigFn, startSens
267
267
  installerState.step = 'extracting'
268
268
  installerState.progress = 95
269
269
  await extractTarBz2(archivePath, modelDir)
270
- await unlink(archivePath).catch(() => {})
270
+ await unlink(archivePath).catch((err) => {
271
+ ctx.logger?.debug?.(`[dsh-voice] failed to unlink temporary archive ${archivePath}: ${err?.message || err}`)
272
+ })
271
273
 
272
274
  let modelFile = null
273
275
  if (targetModel === 'whisper-turbo') {
@@ -297,7 +299,9 @@ export async function startSensevoiceInstall(ctx, cfg, updateConfigFn, startSens
297
299
 
298
300
  return { ok: true, modelType: targetModel, modelPath: modelFile }
299
301
  } catch (err) {
300
- await unlink(archivePath).catch(() => {})
302
+ await unlink(archivePath).catch((err) => {
303
+ ctx.logger?.debug?.(`[dsh-voice] failed to unlink temporary archive ${archivePath}: ${err?.message || err}`)
304
+ })
301
305
  installerState.installing = false
302
306
  installerState.error = String(err?.message || err)
303
307
  installerState.step = 'failed'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-voice",
3
- "version": "0.9.56",
3
+ "version": "0.9.57",
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",