@chatpanel/gateway 0.6.94 → 0.6.95

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": "@chatpanel/gateway",
3
- "version": "0.6.94",
3
+ "version": "0.6.95",
4
4
  "description": "Local privacy gateway — redacts PII out of OpenAI/Anthropic API traffic before it reaches a model, then restores it in the reply. Point opencode, codex, aider, Claude Code, etc. at it.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -275,6 +275,14 @@ export class PocketTTS {
275
275
 
276
276
  async load(bundle = DEFAULT_BUNDLE, { quant = '_int8', onProgress, log = () => {} } = {}) {
277
277
  const dir = await ensureBundle(bundle, quant, { onProgress, log });
278
+ // The built-in speakers come WITH the model. `ensureVoicesBin` existed and nothing called
279
+ // it: the eight names were listed as "downloads on first use", the default voice was one
280
+ // of them, and picking any of them failed with "unknown built-in voice" on every machine
281
+ // but the one where the file had been fetched by hand. Best-effort — a failed download
282
+ // costs the stock voices and leaves cloning untouched.
283
+ if (!voicesBinOnDisk(bundle)) {
284
+ try { await ensureVoicesBin(bundle, { onProgress, log }); } catch (e) { log(`[pocket-tts] built-in voices not downloaded (${e.message}) — cloning still works`); }
285
+ }
278
286
  const ort = await getOrt();
279
287
  this.meta = JSON.parse(readFileSync(join(dir, 'bundle.json'), 'utf8'));
280
288
  this.tok = new SentencePieceUnigram(new Uint8Array(readFileSync(join(dir, 'tokenizer.model'))));
package/src/server.js CHANGED
@@ -63,7 +63,7 @@ import * as openai from './openai.js';
63
63
  import * as responses from './responses.js';
64
64
  import * as anthropic from './anthropic.js';
65
65
 
66
- export const VERSION = '0.6.94';
66
+ export const VERSION = '0.6.95';
67
67
 
68
68
  // WARM search tier — SQLite + FTS5 record store (falls back to an encrypted-JSON
69
69
  // store if SQLite can't load), fed by the extension's ingest sync + backup-ingest.
@@ -1502,6 +1502,7 @@ export function createGateway(cfg = loadConfig()) {
1502
1502
  // A model needing the native runtime is still LISTED on the binary, with the
1503
1503
  // reason — hiding it makes "why can't I clone my voice?" unanswerable.
1504
1504
  const nativeOk = rawOrtAvailable();
1505
+ const activeEntry = TTS_MODEL_CATALOG.find((m) => m.id === active) || null;
1505
1506
  const available = /** @type {any[]} */ (TTS_MODEL_CATALOG.map((m) => ({
1506
1507
  ...m,
1507
1508
  installed: ttsEngine.modelOnDisk(m.id),
@@ -1524,8 +1525,12 @@ export function createGateway(cfg = loadConfig()) {
1524
1525
  // a style bank, VITS/MMS is single-speaker. An empty list tells the UI to
1525
1526
  // hide the picker rather than offer choices that cannot take effect.
1526
1527
  arch: ttsEngine.arch(),
1527
- supportsVoices: ttsEngine.supportsVoices(),
1528
- supportsCustomVoices: ttsEngine.supportsCustomVoices(),
1528
+ // Until a model is LOADED the engine knows nothing, and answering "no voices"
1529
+ // for a model that has eight made the client hide its picker on every fresh
1530
+ // install (state 'off' → supportsVoices false → the single-speaker branch). Before
1531
+ // the first load, the catalog answers for the active model.
1532
+ supportsVoices: ttsEngine.arch() ? ttsEngine.supportsVoices() : (activeEntry ? activeEntry.arch === 'style-tts2' && !!activeEntry.voices : true),
1533
+ supportsCustomVoices: ttsEngine.arch() ? ttsEngine.supportsCustomVoices() : !!activeEntry?.customVoices,
1529
1534
  sampleRate: ttsEngine.sampleRate(),
1530
1535
  // Built-in voices belong to Kokoro alone. VITS is single-speaker and
1531
1536
  // SpeechT5 speaks only in a RECORDED voice, so offering Kokoro's list