dsh-xiaomi-tts 0.1.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/LICENSE +21 -0
- package/README.en.md +47 -0
- package/README.md +102 -0
- package/README.zh-CN.md +148 -0
- package/assets/menu.png +0 -0
- package/assets/pause.png +0 -0
- package/assets/play.png +0 -0
- package/cordis.patch.yml +15 -0
- package/lib/client/index.d.ts +39 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/client/index.js +376 -0
- package/lib/client/index.js.map +1 -0
- package/lib/client.js +553 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +183 -0
- package/lib/index.js.map +1 -0
- package/package.json +103 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
3
|
+
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
const name = "xiaomi-mimo-tts";
|
|
6
|
+
const inject = ["webServer"];
|
|
7
|
+
const XIAOMI_MIMO_TTS_SETTINGS_NAMESPACE = settingsNamespace("xiaomi-mimo-tts");
|
|
8
|
+
const TTS_ROUTE = "/plugins/xiaomi-mimo-tts/synthesize";
|
|
9
|
+
const Config = z.object({
|
|
10
|
+
apiKey: z.string().role("secret").default(""),
|
|
11
|
+
baseURL: z.string().default("https://api.xiaomimimo.com/v1"),
|
|
12
|
+
model: z.string().default("mimo-v2.5-tts"),
|
|
13
|
+
voice: z.string().default("冰糖"),
|
|
14
|
+
format: z.union(["mp3", "wav"]).default("mp3"),
|
|
15
|
+
autoPlay: z.boolean().default(false),
|
|
16
|
+
instruction: z.string().default("请用自然、清晰、语速适中的语气朗读。"),
|
|
17
|
+
maxTextLength: z.number().step(1).min(1).default(12e3),
|
|
18
|
+
requestTimeoutMs: z.number().step(1).min(1e3).default(12e4)
|
|
19
|
+
});
|
|
20
|
+
const MAX_REQUEST_BODY_BYTES = 128 * 1024;
|
|
21
|
+
function json(res, status, body) {
|
|
22
|
+
res.statusCode = status;
|
|
23
|
+
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
24
|
+
res.setHeader("cache-control", "no-store");
|
|
25
|
+
res.end(JSON.stringify(body));
|
|
26
|
+
}
|
|
27
|
+
async function readJsonBody(req, limit) {
|
|
28
|
+
const chunks = [];
|
|
29
|
+
let size = 0;
|
|
30
|
+
for await (const chunk of req) {
|
|
31
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
32
|
+
size += bytes.byteLength;
|
|
33
|
+
if (size > limit) throw new Error("request-body-too-large");
|
|
34
|
+
chunks.push(bytes);
|
|
35
|
+
}
|
|
36
|
+
if (chunks.length === 0) return {};
|
|
37
|
+
return JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
38
|
+
}
|
|
39
|
+
function normalizeBaseURL(value) {
|
|
40
|
+
return value.replace(/\/+$/, "");
|
|
41
|
+
}
|
|
42
|
+
function apiErrorMessage(status, parsed) {
|
|
43
|
+
const detail = typeof parsed?.error === "string" ? parsed.error : parsed?.error?.message ?? parsed?.message;
|
|
44
|
+
return detail && detail.length > 0 ? detail : `Xiaomi MiMo TTS request failed (HTTP ${status})`;
|
|
45
|
+
}
|
|
46
|
+
function apply(ctx, config) {
|
|
47
|
+
let current = () => config;
|
|
48
|
+
installSettingsSection(ctx, XIAOMI_MIMO_TTS_SETTINGS_NAMESPACE, Config, config, {
|
|
49
|
+
setSource(source) {
|
|
50
|
+
current = source;
|
|
51
|
+
},
|
|
52
|
+
onChange() {},
|
|
53
|
+
validate(value) {
|
|
54
|
+
const endpoint = `${normalizeBaseURL(value.baseURL ?? "https://api.xiaomimimo.com/v1")}/chat/completions`;
|
|
55
|
+
if (!URL.canParse(endpoint)) throw new Error("baseURL must be a valid absolute URL");
|
|
56
|
+
if (value.model !== "mimo-v2.5-tts") throw new Error("this plugin currently supports the built-in voice model mimo-v2.5-tts only");
|
|
57
|
+
if (value.format !== "mp3" && value.format !== "wav") throw new Error("format must be mp3 or wav");
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
ctx.effect(() => ctx.webServer.register({
|
|
61
|
+
kind: "exact",
|
|
62
|
+
path: TTS_ROUTE,
|
|
63
|
+
async handler(req, res) {
|
|
64
|
+
if (req.method !== "POST") {
|
|
65
|
+
res.setHeader("allow", "POST");
|
|
66
|
+
json(res, 405, { error: "method-not-allowed" });
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
let body;
|
|
70
|
+
try {
|
|
71
|
+
body = await readJsonBody(req, MAX_REQUEST_BODY_BYTES);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
json(res, error instanceof Error && error.message === "request-body-too-large" ? 413 : 400, { error: error instanceof Error && error.message === "request-body-too-large" ? "request-body-too-large" : "invalid-json" });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const text = typeof body.text === "string" ? body.text.trim() : "";
|
|
77
|
+
const options = current();
|
|
78
|
+
if (text.length === 0) {
|
|
79
|
+
json(res, 400, { error: "text-required" });
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (text.length > options.maxTextLength) {
|
|
83
|
+
json(res, 413, {
|
|
84
|
+
error: "text-too-long",
|
|
85
|
+
maxTextLength: options.maxTextLength
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (options.apiKey.trim().length === 0) {
|
|
90
|
+
json(res, 409, { error: "api-key-not-configured" });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const controller = new AbortController();
|
|
94
|
+
const timeout = setTimeout(() => controller.abort(), options.requestTimeoutMs);
|
|
95
|
+
try {
|
|
96
|
+
const endpoint = `${normalizeBaseURL(options.baseURL)}/chat/completions`;
|
|
97
|
+
const messages = [];
|
|
98
|
+
if (options.instruction.trim().length > 0) messages.push({
|
|
99
|
+
role: "user",
|
|
100
|
+
content: options.instruction.trim()
|
|
101
|
+
});
|
|
102
|
+
messages.push({
|
|
103
|
+
role: "assistant",
|
|
104
|
+
content: text
|
|
105
|
+
});
|
|
106
|
+
const response = await fetch(endpoint, {
|
|
107
|
+
method: "POST",
|
|
108
|
+
redirect: "error",
|
|
109
|
+
headers: {
|
|
110
|
+
authorization: `Bearer ${options.apiKey.trim()}`,
|
|
111
|
+
"content-type": "application/json",
|
|
112
|
+
accept: "application/json",
|
|
113
|
+
"user-agent": "dsh-xiaomi-tts/0.1.0"
|
|
114
|
+
},
|
|
115
|
+
body: JSON.stringify({
|
|
116
|
+
model: options.model,
|
|
117
|
+
messages,
|
|
118
|
+
audio: {
|
|
119
|
+
format: options.format,
|
|
120
|
+
voice: options.voice
|
|
121
|
+
},
|
|
122
|
+
stream: false
|
|
123
|
+
}),
|
|
124
|
+
signal: controller.signal
|
|
125
|
+
});
|
|
126
|
+
let parsed;
|
|
127
|
+
try {
|
|
128
|
+
parsed = await response.json();
|
|
129
|
+
} catch {
|
|
130
|
+
parsed = void 0;
|
|
131
|
+
}
|
|
132
|
+
if (!response.ok) {
|
|
133
|
+
json(res, response.status, {
|
|
134
|
+
error: "xiaomi-api-error",
|
|
135
|
+
message: apiErrorMessage(response.status, parsed)
|
|
136
|
+
});
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const audioBase64 = parsed?.choices?.[0]?.message?.audio?.data;
|
|
140
|
+
if (typeof audioBase64 !== "string" || audioBase64.length === 0) {
|
|
141
|
+
json(res, 502, {
|
|
142
|
+
error: "invalid-xiaomi-response",
|
|
143
|
+
message: "Xiaomi MiMo response did not contain choices[0].message.audio.data"
|
|
144
|
+
});
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
let audio;
|
|
148
|
+
try {
|
|
149
|
+
audio = Buffer.from(audioBase64, "base64");
|
|
150
|
+
} catch {
|
|
151
|
+
json(res, 502, {
|
|
152
|
+
error: "invalid-audio-base64",
|
|
153
|
+
message: "Xiaomi MiMo returned invalid Base64 audio data"
|
|
154
|
+
});
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (audio.byteLength === 0) {
|
|
158
|
+
json(res, 502, {
|
|
159
|
+
error: "empty-audio",
|
|
160
|
+
message: "Xiaomi MiMo returned an empty audio payload"
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
res.statusCode = 200;
|
|
165
|
+
res.setHeader("content-type", options.format === "mp3" ? "audio/mpeg" : "audio/wav");
|
|
166
|
+
res.setHeader("content-length", String(audio.byteLength));
|
|
167
|
+
res.setHeader("cache-control", "no-store");
|
|
168
|
+
res.end(audio);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
const aborted = controller.signal.aborted;
|
|
171
|
+
json(res, aborted ? 504 : 502, {
|
|
172
|
+
error: aborted ? "xiaomi-timeout" : "xiaomi-request-failed",
|
|
173
|
+
message: error instanceof Error ? error.message : String(error)
|
|
174
|
+
});
|
|
175
|
+
} finally {
|
|
176
|
+
clearTimeout(timeout);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}), "xiaomi-mimo-tts: synthesis route");
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
export { Config, TTS_ROUTE, XIAOMI_MIMO_TTS_SETTINGS_NAMESPACE, apply, inject, name };
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAErF,MAAM,CAAC,MAAM,IAAI,GAAG,iBAAiB,CAAA;AACrC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,WAAW,CAAC,CAAA;AAEnC,MAAM,CAAC,MAAM,kCAAkC,GAAG,iBAA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AK,EAAE,aAAa;wBACpB,OAAO,EAAE,6CAA6C;qBACvD,CAAC,CAAA;oBACF,OAAM;gBACR,CAAC;gBAED,GAAG,CAAC,UAAU,GAAG,GAAG,CAAA;gBACpB,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;gBACpF,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAA;gBACzD,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;gBAC1C,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAA;gBACzC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE;oBAC7B,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,uBAAuB;oBAC3D,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBAChE,CAAC,CAAA;YACJ,CAAC;oBAAS,CAAC;gBACT,YAAY,CAAC,OAAO,CAAC,CAAA;YACvB,CAAC;QACH,CAAC;KACF,CAAC,EAAE,kCAAkC,CAAC,CAAA;AACzC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-xiaomi-tts",
|
|
3
|
+
"version": "0.1.0",
|
|
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.zh-CN.md",
|
|
38
|
+
"README.en.md",
|
|
39
|
+
"assets",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"dsh": {
|
|
43
|
+
"bundle": {
|
|
44
|
+
"patch": "./cordis.patch.yml"
|
|
45
|
+
},
|
|
46
|
+
"client": {
|
|
47
|
+
"platform": "web",
|
|
48
|
+
"inject": [
|
|
49
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
50
|
+
"@deepseek-ai/dsh-client-locale",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins",
|
|
53
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
54
|
+
],
|
|
55
|
+
"external": [
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-primitives"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsc && tsdown",
|
|
62
|
+
"typecheck": "tsc --noEmit",
|
|
63
|
+
"test": "pnpm run build && node --test test/*.test.mjs",
|
|
64
|
+
"prepare": "tsdown -c tsdown.prepare.config.ts",
|
|
65
|
+
"prepublishOnly": "pnpm run test",
|
|
66
|
+
"pack:check": "pnpm pack --dry-run"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
70
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
|
|
71
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
72
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.7",
|
|
77
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
78
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
79
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
80
|
+
"react": "^18.2.0"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
84
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
|
|
85
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
86
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.7",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.7",
|
|
91
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
92
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
93
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
94
|
+
"@types/node": "^24.0.0",
|
|
95
|
+
"@types/react": "~18.3.1",
|
|
96
|
+
"react": "^18.2.0",
|
|
97
|
+
"tsdown": "^0.15.0",
|
|
98
|
+
"typescript": "^5.8.0"
|
|
99
|
+
},
|
|
100
|
+
"publishConfig": {
|
|
101
|
+
"access": "public"
|
|
102
|
+
}
|
|
103
|
+
}
|