dsh-tinyasr 1.7.1 → 1.9.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 (3) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/index.js +19 -2
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this plugin. Entries up to 1.11.0 are local pre-release iterations of the
4
4
  1.0 line; the public package starts at 1.2.0.
5
5
 
6
+ ## 1.9.0 — 7 December 2026
7
+
8
+ - When both single-language passes come back empty, one combined-language pass decodes the take
9
+ before the recognizer gives up. A phone take that the language passes miss (mixed speech, a quiet
10
+ or interrupted recording) is now more likely to produce text instead of an empty result.
11
+
12
+ ## 1.8.0 — 7 December 2026
13
+
14
+ - A take is never lost to an empty resident result: when the resident worker returns no text for a
15
+ recording longer than 0.6 s, the take is retried once through a process per recording (the first
16
+ dictation after a restart used to come back empty).
17
+ - The mobile voice bridge is confirmed by `/api/tinyasr/state` (`mobileBridge: true`).
18
+
6
19
  ## 1.7.1 — 6 December 2026
7
20
 
8
21
  - `/api/tinyasr/state` reports whether the mobile voice bridge is installed, which makes the mobile
package/index.js CHANGED
@@ -249,7 +249,15 @@ export class TinyAsrProvider {
249
249
  const perProcess = async (langs) => await this.run(files, wav, langs, signal)
250
250
  if (this.worker === undefined) return await this.decode(perProcess, input, strategy)
251
251
  try {
252
- return await this.decode(async (langs) => await this.runResident(files, input.audio, langs, signal), input, strategy)
252
+ const heard = await this.decode(async (langs) => await this.runResident(files, input.audio, langs, signal), input, strategy)
253
+ // The resident worker occasionally trims a whole take (streaming VAD, first call after a
254
+ // restart). A non-empty per-process pass is the safety net: the take is never lost.
255
+ if (typeof heard.text === 'string' && heard.text.trim() !== '') return heard
256
+ if (heard.audioSeconds >= 0.6 && !signal.aborted) {
257
+ const second = await this.decode(perProcess, input, strategy)
258
+ if (second.text.trim() !== '') return second
259
+ }
260
+ return heard
253
261
  } catch (error) {
254
262
  if (signal.aborted) throw error
255
263
  this.logger?.warn?.('tinyasr: resident worker unavailable, using a process per recording', error)
@@ -267,7 +275,16 @@ export class TinyAsrProvider {
267
275
  const primary = await runOnce(this.config.primaryLanguage)
268
276
  if (!this.sparse(primary)) return primary
269
277
  const fallback = await runOnce(this.config.fallbackLanguage)
270
- return this.better(primary, fallback)
278
+ const best = this.better(primary, fallback)
279
+ if (best.text.trim() !== '') return best
280
+ // Both single-language passes came back empty (quiet take, mixed speech, a cancelled phone
281
+ // request): one combined pass decodes the audio with the whole language set before giving up.
282
+ const combinedLangs = this.languagesFor('auto')
283
+ if (combinedLangs.includes(',')) {
284
+ const combined = await runOnce(combinedLangs)
285
+ if (combined.text.trim() !== '') return combined
286
+ }
287
+ return best
271
288
  }
272
289
 
273
290
  /** One recording through the resident worker, which keeps the models loaded. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tinyasr",
3
- "version": "1.7.1",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "description": "Offline Russian and English dictation for the DeepSeek Harness Web GUI through the local tinyasr recognizer, with an optional model cleanup pass.",