@oxiaom/adoremix 1.0.7 → 1.0.8
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 +1 -1
- package/src/config/defaults.js +9 -0
- package/src/install.js +27 -0
package/package.json
CHANGED
package/src/config/defaults.js
CHANGED
|
@@ -94,5 +94,14 @@ module.exports = {
|
|
|
94
94
|
maxBackups: 2,
|
|
95
95
|
timestampFormat: 'dd.MM.yyyy hh:mm:ss.zzz',
|
|
96
96
|
msgFormat: '{timestamp} {typeNr} {type} {thread} {msg}'
|
|
97
|
+
},
|
|
98
|
+
TTS: {
|
|
99
|
+
provider: 'xf',
|
|
100
|
+
xf_appid: '',
|
|
101
|
+
xf_apiSecret: '',
|
|
102
|
+
xf_apiKey: '',
|
|
103
|
+
xf_voice_override: '',
|
|
104
|
+
minimax_token: '',
|
|
105
|
+
edge_voice_override: ''
|
|
97
106
|
}
|
|
98
107
|
};
|
package/src/install.js
CHANGED
|
@@ -113,6 +113,32 @@ function installHelperDeps(workdir, skipNpmInstall) {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
// 部署多 provider TTS dispatcher(xf/minimax/edge)
|
|
117
|
+
// 覆盖原 Dockerfile 拷的旧 tts.js(讯飞专用版),换成统一 dispatcher
|
|
118
|
+
function deployTtsDispatcher(workdir) {
|
|
119
|
+
const ttsSrcDir = path.join(__dirname, '..', 'tts');
|
|
120
|
+
if (!fs.existsSync(ttsSrcDir)) {
|
|
121
|
+
logger.warn('主包无 tts/ 目录(旧版?),跳过 TTS dispatcher 部署');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const ttsDstDir = path.join(workdir, 'adoremix-tts');
|
|
125
|
+
// 复制整个 tts/ 目录(dispatcher + providers + voice-mapping)
|
|
126
|
+
fse.copySync(ttsSrcDir, ttsDstDir, {
|
|
127
|
+
filter: (src) => {
|
|
128
|
+
const base = path.basename(src);
|
|
129
|
+
// 不复制 tts-wrapper.js(它要复制到顶层当 tts.js)
|
|
130
|
+
return base !== 'tts-wrapper.js';
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
// 顶层 tts.js 用 wrapper 覆盖原版(Qt 调用入口)
|
|
134
|
+
const wrapperSrc = path.join(ttsSrcDir, 'tts-wrapper.js');
|
|
135
|
+
const ttsJs = path.join(workdir, 'tts.js');
|
|
136
|
+
fse.copyFileSync(wrapperSrc, ttsJs);
|
|
137
|
+
logger.ok('部署 TTS dispatcher(xf/minimax/edge 三选一)');
|
|
138
|
+
logger.log(' 配置:adoremix tts config');
|
|
139
|
+
logger.log(' 测试:adoremix tts test "你好"');
|
|
140
|
+
}
|
|
141
|
+
|
|
116
142
|
async function runInstall(opts) {
|
|
117
143
|
opts = opts || {};
|
|
118
144
|
const workdir = opts.workdir || paths.defaultWorkdir();
|
|
@@ -149,6 +175,7 @@ async function runInstall(opts) {
|
|
|
149
175
|
} catch (e) {
|
|
150
176
|
return 1;
|
|
151
177
|
}
|
|
178
|
+
deployTtsDispatcher(workdir);
|
|
152
179
|
|
|
153
180
|
const config = require('./config');
|
|
154
181
|
const cfgOk = await config.ensureConfig(workdir, { interactive: opts.interactive !== false, force: opts.force });
|