dsh-xiaomi-tts 2.3.3 → 2.3.4
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.en.md +198 -198
- package/README.md +193 -194
- package/assets/menu.png +0 -0
- package/assets/preset.png +0 -0
- package/lib/client/conversation.d.ts.map +1 -1
- package/lib/client/live-speech-controller.d.ts.map +1 -1
- package/lib/client/localization.d.ts +5 -0
- package/lib/client/localization.d.ts.map +1 -1
- package/lib/client/playback-controller.d.ts +4 -0
- package/lib/client/playback-controller.d.ts.map +1 -1
- package/lib/client/playback-types.d.ts +1 -1
- package/lib/client/playback-types.d.ts.map +1 -1
- package/lib/client/settings-card.d.ts.map +1 -1
- package/lib/client/settings-scope.d.ts.map +1 -1
- package/lib/client.js +321 -18
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/{shared-Cf9qZwUl.js → shared-CIx9nBxX.js} +124 -14
- package/lib/shared.d.ts +19 -4
- package/lib/shared.d.ts.map +1 -1
- package/lib/shared.js +2 -2
- package/package.json +104 -103
package/lib/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const Config: z<Schemastery.ObjectS<{
|
|
|
17
17
|
voiceDesignCustomPrompt: z<string, string>;
|
|
18
18
|
presetStylePrompt: z<string, string>;
|
|
19
19
|
format: z<"pcm" | "mp3" | "wav", "pcm" | "mp3" | "wav">;
|
|
20
|
+
voiceDesignPlaybackMode: z<"complete" | "segmented", "complete" | "segmented">;
|
|
20
21
|
autoPlay: z<boolean, boolean>;
|
|
21
22
|
instruction: z<string, string>;
|
|
22
23
|
maxTextLength: z<number, number>;
|
|
@@ -34,6 +35,7 @@ export declare const Config: z<Schemastery.ObjectS<{
|
|
|
34
35
|
voiceDesignCustomPrompt: z<string, string>;
|
|
35
36
|
presetStylePrompt: z<string, string>;
|
|
36
37
|
format: z<"pcm" | "mp3" | "wav", "pcm" | "mp3" | "wav">;
|
|
38
|
+
voiceDesignPlaybackMode: z<"complete" | "segmented", "complete" | "segmented">;
|
|
37
39
|
autoPlay: z<boolean, boolean>;
|
|
38
40
|
instruction: z<string, string>;
|
|
39
41
|
maxTextLength: z<number, number>;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAYxC,gCAAgC;AAChC,eAAO,MAAM,IAAI,oBAAoB,CAAA;AAErC,6CAA6C;AAC7C,eAAO,MAAM,MAAM,UAAgB,CAAA;AAEnC,uDAAuD;AACvD,eAAO,MAAM,kCAAkC,uDAA4C,CAAA;AAE3F,sCAAsC;AACtC,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAYxC,gCAAgC;AAChC,eAAO,MAAM,IAAI,oBAAoB,CAAA;AAErC,6CAA6C;AAC7C,eAAO,MAAM,MAAM,UAAgB,CAAA;AAEnC,uDAAuD;AACvD,eAAO,MAAM,kCAAkC,uDAA4C,CAAA;AAE3F,sCAAsC;AACtC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkBjB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAA;AAmT9C,iEAAiE;AACjE,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CA2YxD"}
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as isNewerTtsVersion, C as TTS_VOICE_DESIGN_ASSET_ROUTE, E as TTS_VOICE_PRESETS, N as prepareTtsText, P as resolveTtsBaseURL, R as strictBase64DecodedLength, S as TTS_VOICE_ASSET_ROUTE, T as TTS_VOICE_DESIGN_PRESETS, _ as TTS_STREAM_ROUTE, b as TTS_VERSION, d as TTS_API_KEY_STATUS_ROUTE, f as TTS_AUDIO_RESPONSE_JSON_OVERHEAD_BYTES, g as TTS_SETTINGS_NAMESPACE, h as TTS_ROUTE, j as isSupportedTtsApiKey, m as TTS_MODELS, o as DEFAULT_TTS_SETTINGS, p as TTS_FORMATS, v as TTS_UNINSTALL_ROUTE, w as TTS_VOICE_DESIGN_PLAYBACK_MODES, y as TTS_UPDATE_ROUTE } from "./shared-CIx9nBxX.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -30,6 +30,7 @@ const Config = z.object({
|
|
|
30
30
|
voiceDesignCustomPrompt: z.string().default(DEFAULT_TTS_SETTINGS.voiceDesignCustomPrompt),
|
|
31
31
|
presetStylePrompt: z.string().default(DEFAULT_TTS_SETTINGS.presetStylePrompt),
|
|
32
32
|
format: z.union(TTS_FORMATS).default(DEFAULT_TTS_SETTINGS.format),
|
|
33
|
+
voiceDesignPlaybackMode: z.union(TTS_VOICE_DESIGN_PLAYBACK_MODES).default(DEFAULT_TTS_SETTINGS.voiceDesignPlaybackMode),
|
|
33
34
|
autoPlay: z.boolean().default(DEFAULT_TTS_SETTINGS.autoPlay),
|
|
34
35
|
instruction: z.string().default(DEFAULT_TTS_SETTINGS.instruction),
|
|
35
36
|
maxTextLength: z.number().step(1).min(1).default(DEFAULT_TTS_SETTINGS.maxTextLength),
|
|
@@ -522,7 +523,7 @@ function apply(ctx, config) {
|
|
|
522
523
|
req.once("aborted", abortOnRequest);
|
|
523
524
|
res.once("close", abortOnResponseClose);
|
|
524
525
|
try {
|
|
525
|
-
const format = completeAudioFormat(options);
|
|
526
|
+
const format = body.format === "wav" ? "wav" : completeAudioFormat(options);
|
|
526
527
|
const endpoint = `${normalizeBaseURL(resolveTtsBaseURL(options.apiKey, options.baseURL))}/chat/completions`;
|
|
527
528
|
const response = await fetch(endpoint, {
|
|
528
529
|
method: "POST",
|
|
@@ -10,7 +10,7 @@ const TTS_UNINSTALL_ROUTE = "/plugins/xiaomi-mimo-tts/uninstall";
|
|
|
10
10
|
/** Same-origin route that checks the published npm version. */
|
|
11
11
|
const TTS_UPDATE_ROUTE = "/plugins/xiaomi-mimo-tts/update";
|
|
12
12
|
/** Keep the UI version visible without making the browser bundle load package.json. */
|
|
13
|
-
const TTS_VERSION = "2.3.
|
|
13
|
+
const TTS_VERSION = "2.3.4";
|
|
14
14
|
const SEMVER = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;
|
|
15
15
|
/** Return true only when `candidate` is a strictly newer semantic version. */
|
|
16
16
|
function isNewerTtsVersion(candidate, current) {
|
|
@@ -171,6 +171,11 @@ const TTS_FORMATS = [
|
|
|
171
171
|
"mp3",
|
|
172
172
|
"wav"
|
|
173
173
|
];
|
|
174
|
+
/** Voice-design playback strategies. Segmented playback keeps each upstream request short. */
|
|
175
|
+
const TTS_VOICE_DESIGN_PLAYBACK_MODES = ["complete", "segmented"];
|
|
176
|
+
const DEFAULT_TTS_SEGMENT_CHARACTERS = 120;
|
|
177
|
+
const MAX_TTS_SEGMENT_CHARACTERS = 180;
|
|
178
|
+
const MIN_TTS_SEGMENT_CHARACTERS = 40;
|
|
174
179
|
/** Minimum spoken characters to accumulate before starting one PCM stream request. */
|
|
175
180
|
const MIN_TTS_STREAM_CHARACTERS = 20;
|
|
176
181
|
/** Maximum decoded complete MP3 payload accepted from Xiaomi MiMo. */
|
|
@@ -194,21 +199,33 @@ const TTS_PUNCTUATION = {
|
|
|
194
199
|
/** Decorative punctuation can make TTS emit non-speech artifacts, so omit it entirely. */
|
|
195
200
|
const TTS_NON_SPEECH_PUNCTUATION = /[()\[\]【】[]〔〕〖〗{}{}「」『』《》〈〉“”‘’"'`<>:…—–-~]/gu;
|
|
196
201
|
const TTS_URL_PATTERN = /\b(?:https?|ftp):\/\/[^\s<>()]+|\bwww\.[^\s<>()]+|\b(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+(?:com|cn|net|org|io|ai|dev|me|co|edu|gov|xyz|tech|info|app|site|link)(?:[/:?#][^\s<>()]*)?/giu;
|
|
197
|
-
const TTS_WINDOWS_PATH_PATTERN = /(?:\b[A-Za-z]:[\\/]|\\\\)(?:[A-Za-z0-9._ -]+[\\/])
|
|
198
|
-
const TTS_UNIX_PATH_PATTERN = /\/(?:[A-Za-z0-9._-]+\/)
|
|
202
|
+
const TTS_WINDOWS_PATH_PATTERN = /(?:\b[A-Za-z]:[\\/]|\\\\)(?:[A-Za-z0-9._ -]+[\\/])+(?:[A-Za-z0-9._ -]+)/gu;
|
|
203
|
+
const TTS_UNIX_PATH_PATTERN = /\/(?:[A-Za-z0-9._-]+\/)+(?:[A-Za-z0-9._-]+)/gu;
|
|
199
204
|
const TTS_RELATIVE_PATH_PATTERN = /(?:\.\.?[\\/])(?:[A-Za-z0-9._-]+[\\/])*(?:[A-Za-z0-9._-]+(?:\.[A-Za-z0-9_-]+)?)/gu;
|
|
200
205
|
const TTS_PROJECT_PATH_PATTERN = /\b(?:[A-Za-z0-9_-]+[\\/])+[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/gu;
|
|
206
|
+
/** Combined Markdown syntax and path removal in a single pass. */
|
|
207
|
+
const MARKDOWN_CODE_BLOCK_RE = /```[\s\S]*?```|~~~[\s\S]*?~~~/g;
|
|
208
|
+
const MARKDOWN_INDENTED_CODE_RE = /(^|\n)(?: {4}|\t)[^\n]*(?=\n|$)/g;
|
|
209
|
+
const MARKDOWN_IMAGE_RE = /!\[([^\]\r\n]*)\]\([^\)\r\n]*\)/g;
|
|
210
|
+
const MARKDOWN_LINK_RE = /\[([^\]\r\n]*)\]\([^\)\r\n]*\)/g;
|
|
211
|
+
const MARKDOWN_HTML_TAG_RE = /<[^>\r\n]*>/g;
|
|
212
|
+
const MARKDOWN_HEADING_RE = /(^|\n)\s{0,3}#{1,6}\s+/g;
|
|
213
|
+
const MARKDOWN_LIST_RE = /(^|\n)\s*(?:[-*+]|\d+[.)])\s+/g;
|
|
214
|
+
const MARKDOWN_BLOCKQUOTE_RE = /(^|\n)\s*>\s?/g;
|
|
215
|
+
const MARKDOWN_INLINE_FORMAT_RE = /`+|[*_~]{1,3}/g;
|
|
216
|
+
const MARKDOWN_TABLE_SEP_RE = /[|]/g;
|
|
201
217
|
function removeTtsPaths(value) {
|
|
202
218
|
return value.replace(TTS_WINDOWS_PATH_PATTERN, " ").replace(TTS_RELATIVE_PATH_PATTERN, " ").replace(TTS_PROJECT_PATH_PATTERN, " ").replace(TTS_UNIX_PATH_PATTERN, " ");
|
|
203
219
|
}
|
|
204
220
|
function removeTtsMarkup(value) {
|
|
205
|
-
let text = value.replace(
|
|
221
|
+
let text = value.replace(MARKDOWN_CODE_BLOCK_RE, " ").replace(MARKDOWN_INDENTED_CODE_RE, "$1").replace(MARKDOWN_IMAGE_RE, " ").replace(MARKDOWN_LINK_RE, "$1").replace(MARKDOWN_HTML_TAG_RE, " ").replace(MARKDOWN_HEADING_RE, "$1").replace(MARKDOWN_LIST_RE, "$1").replace(MARKDOWN_BLOCKQUOTE_RE, "$1").replace(MARKDOWN_INLINE_FORMAT_RE, "").replace(MARKDOWN_TABLE_SEP_RE, " ");
|
|
206
222
|
text = text.replace(TTS_URL_PATTERN, " ");
|
|
207
223
|
return removeTtsPaths(text);
|
|
208
224
|
}
|
|
209
225
|
function removeTtsSymbols(value) {
|
|
210
226
|
return value.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF]/g, " ").replace(/(?:\p{Extended_Pictographic}|\p{Emoji_Presentation}|\p{Regional_Indicator}|\p{Emoji_Modifier}|\p{So}|\uFE0E|\uFE0F|\u200D|\u20E3)/gu, " ");
|
|
211
227
|
}
|
|
228
|
+
/** Combined punctuation normalization: collapse adjacent punctuation, remove non-speech characters, and normalize Chinese punctuation. */
|
|
212
229
|
function normalizeTtsPunctuation(value) {
|
|
213
230
|
return value.replace(TTS_NON_SPEECH_PUNCTUATION, "").replace(/[,。!?;、() ]/gu, (character) => TTS_PUNCTUATION[character] ?? character).replace(/(^|\s)[,;:!?]+(?=\s|$)/g, "$1").replace(/([,;:])\s*([.!?])/g, "$2").replace(/\s+([,.;:!?])/g, "$1");
|
|
214
231
|
}
|
|
@@ -222,24 +239,116 @@ function prepareTtsText(value) {
|
|
|
222
239
|
if (value.length === 0) return "";
|
|
223
240
|
return normalizeTtsPunctuation(removeTtsSymbols(removeTtsMarkup(value).replace(/\\[rn]|\/n/gi, " ").replace(/\r\n?|\n/g, "."))).replace(/\s+/g, " ").trim();
|
|
224
241
|
}
|
|
225
|
-
/**
|
|
242
|
+
/** Locate fenced code blocks in raw streaming text so their content is never read aloud. */
|
|
243
|
+
function findFencedCodeRegions(value) {
|
|
244
|
+
const regions = [];
|
|
245
|
+
let pendingStart = null;
|
|
246
|
+
const fence = /(^|\n)[ \t]{0,3}(`{3,}|~{3,})[^\r\n]*/g;
|
|
247
|
+
let open = null;
|
|
248
|
+
for (const match of value.matchAll(fence)) {
|
|
249
|
+
const lineStart = match.index + (match[1] === "\n" ? 1 : 0);
|
|
250
|
+
const char = match[2][0];
|
|
251
|
+
if (open === null) open = {
|
|
252
|
+
start: lineStart,
|
|
253
|
+
char
|
|
254
|
+
};
|
|
255
|
+
else if (open.char === char) {
|
|
256
|
+
regions.push([open.start, match.index + match[0].length]);
|
|
257
|
+
open = null;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (open !== null) pendingStart = open.start;
|
|
261
|
+
return {
|
|
262
|
+
regions,
|
|
263
|
+
pendingStart
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/** Split an accumulated model delta at completed sentence-ending punctuation, skipping fenced code blocks whole. */
|
|
226
267
|
function splitCompletedTtsSentences(value) {
|
|
227
|
-
const
|
|
268
|
+
const { regions, pendingStart } = findFencedCodeRegions(value);
|
|
269
|
+
const limit = pendingStart ?? value.length;
|
|
228
270
|
const boundary = /[。!?!?;;\n]+(?:[”’)】》〕\]}'"]*\s*)/gu;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
271
|
+
const sentences = [];
|
|
272
|
+
let sentenceStart = 0;
|
|
273
|
+
let consumed = 0;
|
|
274
|
+
const splitSegment = (from, to) => {
|
|
275
|
+
boundary.lastIndex = from;
|
|
276
|
+
let match;
|
|
277
|
+
while ((match = boundary.exec(value)) !== null) {
|
|
278
|
+
const end = match.index + match[0].length;
|
|
279
|
+
if (end > to) break;
|
|
280
|
+
const sentence = value.slice(sentenceStart, end);
|
|
281
|
+
if (sentence.trim().length > 0) sentences.push(sentence);
|
|
282
|
+
sentenceStart = end;
|
|
283
|
+
consumed = end;
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
let pos = 0;
|
|
287
|
+
for (const [start, end] of regions) {
|
|
288
|
+
if (start >= limit) break;
|
|
289
|
+
if (pos < start) splitSegment(pos, Math.min(start, limit));
|
|
290
|
+
sentenceStart = Math.max(sentenceStart, end);
|
|
291
|
+
consumed = Math.max(consumed, end);
|
|
292
|
+
pos = end;
|
|
234
293
|
}
|
|
294
|
+
if (pos < limit) splitSegment(pos, limit);
|
|
295
|
+
if (pendingStart !== null) return {
|
|
296
|
+
sentences,
|
|
297
|
+
remainder: value.slice(pendingStart),
|
|
298
|
+
consumed: pendingStart,
|
|
299
|
+
inCode: true
|
|
300
|
+
};
|
|
235
301
|
return {
|
|
236
302
|
sentences,
|
|
237
|
-
remainder: value.slice(
|
|
303
|
+
remainder: value.slice(consumed),
|
|
304
|
+
consumed,
|
|
305
|
+
inCode: false
|
|
238
306
|
};
|
|
239
307
|
}
|
|
240
308
|
/** Count text-bearing characters only, excluding punctuation and whitespace. */
|
|
241
309
|
function countTtsSpeechCharacters(value) {
|
|
242
|
-
return
|
|
310
|
+
return (value.match(/[\p{L}\p{N}]/gu) ?? []).length;
|
|
311
|
+
}
|
|
312
|
+
/** Split cleaned speech text on natural boundaries while bounding VoiceDesign requests. */
|
|
313
|
+
function splitTtsSegments(value, target = DEFAULT_TTS_SEGMENT_CHARACTERS, maximum = MAX_TTS_SEGMENT_CHARACTERS) {
|
|
314
|
+
const text = prepareTtsText(value);
|
|
315
|
+
if (text.length === 0) return [];
|
|
316
|
+
const preferred = Math.max(MIN_TTS_SEGMENT_CHARACTERS, Math.min(target, maximum));
|
|
317
|
+
const pieces = text.match(/[^.!?;]+[.!?;]*|[.!?;]+/gu) ?? [text];
|
|
318
|
+
const segments = [];
|
|
319
|
+
let pending = "";
|
|
320
|
+
const append = (piece) => {
|
|
321
|
+
const candidate = `${pending}${piece}`.trim();
|
|
322
|
+
if (candidate.length === 0) return;
|
|
323
|
+
if (countTtsSpeechCharacters(candidate) <= maximum) {
|
|
324
|
+
pending = candidate;
|
|
325
|
+
if (countTtsSpeechCharacters(pending) >= preferred) {
|
|
326
|
+
segments.push(pending);
|
|
327
|
+
pending = "";
|
|
328
|
+
}
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if (pending.length > 0) {
|
|
332
|
+
segments.push(pending);
|
|
333
|
+
pending = "";
|
|
334
|
+
}
|
|
335
|
+
let rest = piece.trim();
|
|
336
|
+
while (countTtsSpeechCharacters(rest) > maximum) {
|
|
337
|
+
let cut = Math.min(rest.length, maximum);
|
|
338
|
+
const boundary = Math.max(rest.lastIndexOf(",", cut), rest.lastIndexOf(" ", cut), rest.lastIndexOf(":", cut));
|
|
339
|
+
if (boundary >= MIN_TTS_SEGMENT_CHARACTERS) cut = boundary + 1;
|
|
340
|
+
segments.push(rest.slice(0, cut).trim());
|
|
341
|
+
rest = rest.slice(cut).trim();
|
|
342
|
+
}
|
|
343
|
+
pending = rest;
|
|
344
|
+
};
|
|
345
|
+
for (const piece of pieces) append(piece);
|
|
346
|
+
if (pending.length > 0) {
|
|
347
|
+
const last = segments.at(-1);
|
|
348
|
+
if (last !== void 0 && countTtsSpeechCharacters(pending) < MIN_TTS_SEGMENT_CHARACTERS && countTtsSpeechCharacters(`${last}${pending}`) <= maximum) segments[segments.length - 1] = `${last}${pending}`;
|
|
349
|
+
else segments.push(pending);
|
|
350
|
+
}
|
|
351
|
+
return segments;
|
|
243
352
|
}
|
|
244
353
|
/** Return the exact decoded size of canonical padded Base64, or null when invalid. */
|
|
245
354
|
function strictBase64DecodedLength(value) {
|
|
@@ -337,6 +446,7 @@ const DEFAULT_TTS_SETTINGS = {
|
|
|
337
446
|
voiceDesignCustomPrompt: "青年女性,声线清亮、亲切自然,吐字清楚,语速适中,情绪温柔克制。",
|
|
338
447
|
presetStylePrompt: "使用清晰、自然、准确的声音朗读,语速适中,停顿自然,语气平和克制,避免夸张表达。",
|
|
339
448
|
format: "pcm",
|
|
449
|
+
voiceDesignPlaybackMode: "complete",
|
|
340
450
|
autoPlay: true,
|
|
341
451
|
instruction: "请忠实朗读原文,根据文本语气自然表达,不添加或改写内容。",
|
|
342
452
|
maxTextLength: 12e3,
|
|
@@ -369,4 +479,4 @@ function resolveTtsSettings(value) {
|
|
|
369
479
|
}
|
|
370
480
|
|
|
371
481
|
//#endregion
|
|
372
|
-
export {
|
|
482
|
+
export { isNewerTtsVersion as A, TTS_VOICE_DESIGN_ASSET_ROUTE as C, batchTtsStreamText as D, TTS_VOICE_PRESETS as E, resolveTtsSettings as F, splitCompletedTtsSentences as I, splitTtsSegments as L, parseSseRecords as M, prepareTtsText as N, classifyLiveSpeechTransition as O, resolveTtsBaseURL as P, strictBase64DecodedLength as R, TTS_VOICE_ASSET_ROUTE as S, TTS_VOICE_DESIGN_PRESETS as T, TTS_STREAM_ROUTE as _, DEFAULT_TTS_SEGMENT_CHARACTERS as a, TTS_VERSION as b, MIN_TTS_SEGMENT_CHARACTERS as c, TTS_API_KEY_STATUS_ROUTE as d, TTS_AUDIO_RESPONSE_JSON_OVERHEAD_BYTES as f, TTS_SETTINGS_NAMESPACE as g, TTS_ROUTE as h, DEFAULT_MAX_WAV_AUDIO_BYTES as i, isSupportedTtsApiKey as j, countTtsSpeechCharacters as k, MIN_TTS_STREAM_CHARACTERS as l, TTS_MODELS as m, DEFAULT_MAX_MP3_AUDIO_BYTES as n, DEFAULT_TTS_SETTINGS as o, TTS_FORMATS as p, DEFAULT_MAX_PAUSED_PCM_BYTES as r, MAX_TTS_SEGMENT_CHARACTERS as s, AbortableSentenceQueue as t, TOKEN_PLAN_TTS_BASE_URL as u, TTS_UNINSTALL_ROUTE as v, TTS_VOICE_DESIGN_PLAYBACK_MODES as w, TTS_VOICES as x, TTS_UPDATE_ROUTE as y };
|
package/lib/shared.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const TTS_UNINSTALL_ROUTE = "/plugins/xiaomi-mimo-tts/uninstall";
|
|
|
9
9
|
/** Same-origin route that checks the published npm version. */
|
|
10
10
|
export declare const TTS_UPDATE_ROUTE = "/plugins/xiaomi-mimo-tts/update";
|
|
11
11
|
/** Keep the UI version visible without making the browser bundle load package.json. */
|
|
12
|
-
export declare const TTS_VERSION = "2.3.
|
|
12
|
+
export declare const TTS_VERSION = "2.3.4";
|
|
13
13
|
/** Return true only when `candidate` is a strictly newer semantic version. */
|
|
14
14
|
export declare function isNewerTtsVersion(candidate: string, current: string): boolean;
|
|
15
15
|
/** Same-origin route that reports API key configuration status without exposing the key. */
|
|
@@ -114,6 +114,12 @@ export declare const TTS_VOICE_DESIGN_PRESETS: readonly [{
|
|
|
114
114
|
/** Supported audio formats. */
|
|
115
115
|
export declare const TTS_FORMATS: readonly ["pcm", "mp3", "wav"];
|
|
116
116
|
export type TtsFormat = typeof TTS_FORMATS[number];
|
|
117
|
+
/** Voice-design playback strategies. Segmented playback keeps each upstream request short. */
|
|
118
|
+
export declare const TTS_VOICE_DESIGN_PLAYBACK_MODES: readonly ["complete", "segmented"];
|
|
119
|
+
export type TtsVoiceDesignPlaybackMode = typeof TTS_VOICE_DESIGN_PLAYBACK_MODES[number];
|
|
120
|
+
export declare const DEFAULT_TTS_SEGMENT_CHARACTERS = 120;
|
|
121
|
+
export declare const MAX_TTS_SEGMENT_CHARACTERS = 180;
|
|
122
|
+
export declare const MIN_TTS_SEGMENT_CHARACTERS = 40;
|
|
117
123
|
/** Minimum spoken characters to accumulate before starting one PCM stream request. */
|
|
118
124
|
export declare const MIN_TTS_STREAM_CHARACTERS = 20;
|
|
119
125
|
/** Maximum decoded complete MP3 payload accepted from Xiaomi MiMo. */
|
|
@@ -130,13 +136,20 @@ export declare const TTS_AUDIO_RESPONSE_JSON_OVERHEAD_BYTES: number;
|
|
|
130
136
|
* @returns Text with non-speech content removed and punctuation normalized.
|
|
131
137
|
*/
|
|
132
138
|
export declare function prepareTtsText(value: string): string;
|
|
133
|
-
|
|
134
|
-
export declare function splitCompletedTtsSentences(value: string): {
|
|
139
|
+
export interface TtsSentenceSplit {
|
|
135
140
|
sentences: string[];
|
|
136
141
|
remainder: string;
|
|
137
|
-
|
|
142
|
+
/** How many characters of the input were consumed (sentences plus skipped code blocks). */
|
|
143
|
+
consumed: number;
|
|
144
|
+
/** True when the remainder is an unclosed code block that must not be read aloud. */
|
|
145
|
+
inCode: boolean;
|
|
146
|
+
}
|
|
147
|
+
/** Split an accumulated model delta at completed sentence-ending punctuation, skipping fenced code blocks whole. */
|
|
148
|
+
export declare function splitCompletedTtsSentences(value: string): TtsSentenceSplit;
|
|
138
149
|
/** Count text-bearing characters only, excluding punctuation and whitespace. */
|
|
139
150
|
export declare function countTtsSpeechCharacters(value: string): number;
|
|
151
|
+
/** Split cleaned speech text on natural boundaries while bounding VoiceDesign requests. */
|
|
152
|
+
export declare function splitTtsSegments(value: string, target?: number, maximum?: number): string[];
|
|
140
153
|
/** Return the exact decoded size of canonical padded Base64, or null when invalid. */
|
|
141
154
|
export declare function strictBase64DecodedLength(value: string): number | null;
|
|
142
155
|
/** Accumulate short sentences so a PCM stream has enough text to sound natural. */
|
|
@@ -185,6 +198,7 @@ export interface TtsSettings {
|
|
|
185
198
|
voiceDesignCustomPrompt?: string;
|
|
186
199
|
presetStylePrompt?: string;
|
|
187
200
|
format?: TtsFormat;
|
|
201
|
+
voiceDesignPlaybackMode?: TtsVoiceDesignPlaybackMode;
|
|
188
202
|
autoPlay?: boolean;
|
|
189
203
|
instruction?: string;
|
|
190
204
|
maxTextLength?: number;
|
|
@@ -203,6 +217,7 @@ export interface ResolvedTtsSettings {
|
|
|
203
217
|
voiceDesignCustomPrompt: string;
|
|
204
218
|
presetStylePrompt: string;
|
|
205
219
|
format: TtsFormat;
|
|
220
|
+
voiceDesignPlaybackMode: TtsVoiceDesignPlaybackMode;
|
|
206
221
|
autoPlay: boolean;
|
|
207
222
|
instruction: string;
|
|
208
223
|
maxTextLength: number;
|
package/lib/shared.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,eAAO,MAAM,sBAAsB,oBAAoB,CAAA;AAEvD,6EAA6E;AAC7E,eAAO,MAAM,SAAS,wCAAwC,CAAA;AAE9D,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,+CAA+C,CAAA;AAE5E,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,uCAAuC,CAAA;AAEvE,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,oCAAoC,CAAA;AAEjE,uFAAuF;AACvF,eAAO,MAAM,WAAW,UAAU,CAAA;AAIlC,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,C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BAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAG5D;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,mBAAmB,CAYtF"}
|
package/lib/shared.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as isNewerTtsVersion, C as TTS_VOICE_DESIGN_ASSET_ROUTE, D as batchTtsStreamText, E as TTS_VOICE_PRESETS, F as resolveTtsSettings, I as splitCompletedTtsSentences, L as splitTtsSegments, M as parseSseRecords, N as prepareTtsText, O as classifyLiveSpeechTransition, P as resolveTtsBaseURL, R as strictBase64DecodedLength, S as TTS_VOICE_ASSET_ROUTE, T as TTS_VOICE_DESIGN_PRESETS, _ as TTS_STREAM_ROUTE, a as DEFAULT_TTS_SEGMENT_CHARACTERS, b as TTS_VERSION, c as MIN_TTS_SEGMENT_CHARACTERS, d as TTS_API_KEY_STATUS_ROUTE, f as TTS_AUDIO_RESPONSE_JSON_OVERHEAD_BYTES, g as TTS_SETTINGS_NAMESPACE, h as TTS_ROUTE, i as DEFAULT_MAX_WAV_AUDIO_BYTES, j as isSupportedTtsApiKey, k as countTtsSpeechCharacters, l as MIN_TTS_STREAM_CHARACTERS, m as TTS_MODELS, n as DEFAULT_MAX_MP3_AUDIO_BYTES, o as DEFAULT_TTS_SETTINGS, p as TTS_FORMATS, r as DEFAULT_MAX_PAUSED_PCM_BYTES, s as MAX_TTS_SEGMENT_CHARACTERS, t as AbortableSentenceQueue, u as TOKEN_PLAN_TTS_BASE_URL, v as TTS_UNINSTALL_ROUTE, w as TTS_VOICE_DESIGN_PLAYBACK_MODES, x as TTS_VOICES, y as TTS_UPDATE_ROUTE } from "./shared-CIx9nBxX.js";
|
|
2
2
|
|
|
3
|
-
export { AbortableSentenceQueue, DEFAULT_MAX_MP3_AUDIO_BYTES, DEFAULT_MAX_PAUSED_PCM_BYTES, DEFAULT_MAX_WAV_AUDIO_BYTES, DEFAULT_TTS_SETTINGS, MIN_TTS_STREAM_CHARACTERS, TOKEN_PLAN_TTS_BASE_URL, TTS_API_KEY_STATUS_ROUTE, TTS_AUDIO_RESPONSE_JSON_OVERHEAD_BYTES, TTS_FORMATS, TTS_MODELS, TTS_ROUTE, TTS_SETTINGS_NAMESPACE, TTS_STREAM_ROUTE, TTS_UNINSTALL_ROUTE, TTS_UPDATE_ROUTE, TTS_VERSION, TTS_VOICES, TTS_VOICE_ASSET_ROUTE, TTS_VOICE_DESIGN_ASSET_ROUTE, TTS_VOICE_DESIGN_PRESETS, TTS_VOICE_PRESETS, batchTtsStreamText, classifyLiveSpeechTransition, countTtsSpeechCharacters, isNewerTtsVersion, isSupportedTtsApiKey, parseSseRecords, prepareTtsText, resolveTtsBaseURL, resolveTtsSettings, splitCompletedTtsSentences, strictBase64DecodedLength };
|
|
3
|
+
export { AbortableSentenceQueue, DEFAULT_MAX_MP3_AUDIO_BYTES, DEFAULT_MAX_PAUSED_PCM_BYTES, DEFAULT_MAX_WAV_AUDIO_BYTES, DEFAULT_TTS_SEGMENT_CHARACTERS, DEFAULT_TTS_SETTINGS, MAX_TTS_SEGMENT_CHARACTERS, MIN_TTS_SEGMENT_CHARACTERS, MIN_TTS_STREAM_CHARACTERS, TOKEN_PLAN_TTS_BASE_URL, TTS_API_KEY_STATUS_ROUTE, TTS_AUDIO_RESPONSE_JSON_OVERHEAD_BYTES, TTS_FORMATS, TTS_MODELS, TTS_ROUTE, TTS_SETTINGS_NAMESPACE, TTS_STREAM_ROUTE, TTS_UNINSTALL_ROUTE, TTS_UPDATE_ROUTE, TTS_VERSION, TTS_VOICES, TTS_VOICE_ASSET_ROUTE, TTS_VOICE_DESIGN_ASSET_ROUTE, TTS_VOICE_DESIGN_PLAYBACK_MODES, TTS_VOICE_DESIGN_PRESETS, TTS_VOICE_PRESETS, batchTtsStreamText, classifyLiveSpeechTransition, countTtsSpeechCharacters, isNewerTtsVersion, isSupportedTtsApiKey, parseSseRecords, prepareTtsText, resolveTtsBaseURL, resolveTtsSettings, splitCompletedTtsSentences, splitTtsSegments, strictBase64DecodedLength };
|
package/package.json
CHANGED
|
@@ -1,103 +1,104 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-xiaomi-tts",
|
|
3
|
-
"version": "2.3.
|
|
4
|
-
"description": "Xiaomi MiMo text-to-speech controls for DeepSeek Harness Web assistant messages",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"deepseek-harness",
|
|
9
|
-
"dsh-plugin",
|
|
10
|
-
"xiaomi",
|
|
11
|
-
"mimo",
|
|
12
|
-
"tts",
|
|
13
|
-
"text-to-speech"
|
|
14
|
-
],
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts.git"
|
|
18
|
-
},
|
|
19
|
-
"main": "lib/index.js",
|
|
20
|
-
"types": "lib/index.d.ts",
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"types": "./lib/index.d.ts",
|
|
24
|
-
"default": "./lib/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./client": {
|
|
27
|
-
"types": "./lib/client/index.d.ts",
|
|
28
|
-
"default": "./lib/client.js"
|
|
29
|
-
},
|
|
30
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
31
|
-
"./package.json": "./package.json"
|
|
32
|
-
},
|
|
33
|
-
"files": [
|
|
34
|
-
"lib",
|
|
35
|
-
"cordis.patch.yml",
|
|
36
|
-
"README.md",
|
|
37
|
-
"README.en.md",
|
|
38
|
-
"assets",
|
|
39
|
-
"LICENSE"
|
|
40
|
-
],
|
|
41
|
-
"dsh": {
|
|
42
|
-
"bundle": {
|
|
43
|
-
"patch": "./cordis.patch.yml"
|
|
44
|
-
},
|
|
45
|
-
"client": {
|
|
46
|
-
"platform": "web",
|
|
47
|
-
"inject": [
|
|
48
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
49
|
-
"@deepseek-ai/dsh-client-locale",
|
|
50
|
-
"@deepseek-ai/dsh-client-ui-settings",
|
|
51
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
52
|
-
"@deepseek-ai/dsh-client-ui-conversation"
|
|
53
|
-
],
|
|
54
|
-
"external": [
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-primitives"
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"scripts": {
|
|
60
|
-
"build": "tsdown -c tsdown.prepare.config.ts && tsc --emitDeclarationOnly",
|
|
61
|
-
"typecheck": "tsc --noEmit",
|
|
62
|
-
"test": "pnpm run build && node --test test/*.test.mjs",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"@deepseek-ai/
|
|
71
|
-
"@deepseek-ai/dsh-client-
|
|
72
|
-
"@deepseek-ai/dsh-client-
|
|
73
|
-
"@deepseek-ai/dsh-client-ui-
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-settings
|
|
77
|
-
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
78
|
-
"@deepseek-ai/dsh-
|
|
79
|
-
"@deepseek-ai/
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"@deepseek-ai/
|
|
85
|
-
"@deepseek-ai/dsh-client-
|
|
86
|
-
"@deepseek-ai/dsh-client-
|
|
87
|
-
"@deepseek-ai/dsh-client-ui-
|
|
88
|
-
"@deepseek-ai/dsh-client-ui-
|
|
89
|
-
"@deepseek-ai/dsh-client-ui-
|
|
90
|
-
"@deepseek-ai/dsh-client-ui-settings
|
|
91
|
-
"@deepseek-ai/dsh-
|
|
92
|
-
"@deepseek-ai/dsh-
|
|
93
|
-
"@deepseek-ai/
|
|
94
|
-
"@
|
|
95
|
-
"@types/
|
|
96
|
-
"react": "
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-xiaomi-tts",
|
|
3
|
+
"version": "2.3.4",
|
|
4
|
+
"description": "Xiaomi MiMo text-to-speech controls for DeepSeek Harness Web assistant messages",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"deepseek-harness",
|
|
9
|
+
"dsh-plugin",
|
|
10
|
+
"xiaomi",
|
|
11
|
+
"mimo",
|
|
12
|
+
"tts",
|
|
13
|
+
"text-to-speech"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/ppy-web/dsh-plugin-xiaomi-mimo-tts.git"
|
|
18
|
+
},
|
|
19
|
+
"main": "lib/index.js",
|
|
20
|
+
"types": "lib/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./lib/index.d.ts",
|
|
24
|
+
"default": "./lib/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./client": {
|
|
27
|
+
"types": "./lib/client/index.d.ts",
|
|
28
|
+
"default": "./lib/client.js"
|
|
29
|
+
},
|
|
30
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"lib",
|
|
35
|
+
"cordis.patch.yml",
|
|
36
|
+
"README.md",
|
|
37
|
+
"README.en.md",
|
|
38
|
+
"assets",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"dsh": {
|
|
42
|
+
"bundle": {
|
|
43
|
+
"patch": "./cordis.patch.yml"
|
|
44
|
+
},
|
|
45
|
+
"client": {
|
|
46
|
+
"platform": "web",
|
|
47
|
+
"inject": [
|
|
48
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
49
|
+
"@deepseek-ai/dsh-client-locale",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
53
|
+
],
|
|
54
|
+
"external": [
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-primitives"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsdown -c tsdown.prepare.config.ts && tsc --emitDeclarationOnly",
|
|
61
|
+
"typecheck": "tsc --noEmit",
|
|
62
|
+
"test": "pnpm run build && node --test test/*.test.mjs",
|
|
63
|
+
"text": "node test/filter-test-server.mjs",
|
|
64
|
+
"release:check": "pnpm run test",
|
|
65
|
+
"prepare": "pnpm run build",
|
|
66
|
+
"prepack": "pnpm run build",
|
|
67
|
+
"pack:check": "pnpm pack --dry-run"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
71
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
|
|
72
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.7",
|
|
78
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
79
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
80
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
81
|
+
"react": "^18.2.0"
|
|
82
|
+
},
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
85
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
|
|
86
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.7",
|
|
92
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
93
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
94
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
95
|
+
"@types/node": "^24.0.0",
|
|
96
|
+
"@types/react": "~18.3.1",
|
|
97
|
+
"react": "^18.2.0",
|
|
98
|
+
"tsdown": "^0.15.0",
|
|
99
|
+
"typescript": "^5.8.0"
|
|
100
|
+
},
|
|
101
|
+
"publishConfig": {
|
|
102
|
+
"access": "public"
|
|
103
|
+
}
|
|
104
|
+
}
|