@moxxy/plugin-stt-local 0.41.2 → 0.42.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/plugin-stt-local",
3
- "version": "0.41.2",
3
+ "version": "0.42.0",
4
4
  "description": "Fully local, on-device speech-to-text Transcriber for moxxy. Runs multilingual Whisper (English + Polish) via sherpa-onnx in a forked sidecar process; models download once on first use from sherpa-onnx's pinned releases (sha256-verified). No API key, no network at transcription time. Plugs into the session TranscriberRegistry — the TUI and channel voice notes consume it transparently.",
5
5
  "keywords": [
6
6
  "moxxy",
@@ -48,15 +48,15 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "sherpa-onnx-node": "^1.13.8",
51
- "@moxxy/model-fetch": "0.1.0",
52
- "@moxxy/sdk": "0.41.2"
51
+ "@moxxy/sdk": "0.42.0",
52
+ "@moxxy/model-fetch": "0.1.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@types/node": "^22.10.0",
55
+ "@types/node": "^22.20.5",
56
56
  "typescript": "^6.0.3",
57
- "vitest": "^4.1.11",
58
- "@moxxy/tsconfig": "0.0.0",
59
- "@moxxy/vitest-preset": "0.0.0"
57
+ "vitest": "^5.0.3",
58
+ "@moxxy/vitest-preset": "0.0.0",
59
+ "@moxxy/tsconfig": "0.0.0"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsc -p tsconfig.json",
package/src/live.test.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { mkdtemp, rm } from 'node:fs/promises';
1
+ import { mkdtemp } from 'node:fs/promises';
2
2
  import { tmpdir } from 'node:os';
3
3
  import path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url';
6
6
  import { afterAll, beforeAll, describe, expect, it } from 'vitest';
7
7
 
8
8
  import { createLocalWhisperTranscriber } from './local-stt.js';
9
+ import { removeDir } from '@moxxy/vitest-preset/fs';
9
10
 
10
11
  // vitest runs the TypeScript SOURCE, so `import.meta.url` here is src/. The
11
12
  // sidecar must be the COMPILED entry, so point at dist/sidecar.js (build first:
@@ -59,7 +60,7 @@ beforeAll(async () => {
59
60
  modelsDir = await mkdtemp(path.join(tmpdir(), 'stt-local-live-'));
60
61
  });
61
62
  afterAll(async () => {
62
- if (modelsDir) await rm(modelsDir, { recursive: true, force: true });
63
+ if (modelsDir) await removeDir(modelsDir);
63
64
  });
64
65
 
65
66
  describe.skipIf(!LIVE)('local STT (live, real download + native sidecar)', () => {
@@ -1,3 +1,4 @@
1
+ import * as path from 'node:path';
1
2
  import { describe, expect, it } from 'vitest';
2
3
 
3
4
  import { MOXXY_PCM16_24KHZ_MIME } from '@moxxy/sdk';
@@ -87,7 +88,7 @@ describe('LocalWhisperTranscriber.transcribe', () => {
87
88
  'https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-base.tar.bz2',
88
89
  ]);
89
90
  const req = host.reqs[0]!;
90
- expect(req.encoder).toContain('sherpa-onnx-whisper-base/base-encoder.onnx');
91
+ expect(req.encoder).toContain(path.join('sherpa-onnx-whisper-base', 'base-encoder.onnx'));
91
92
  expect(req.decoder).toContain('base-decoder.onnx');
92
93
  expect(req.tokens).toContain('base-tokens.txt');
93
94
  expect(req.sampleRate).toBe(16_000);