refactor(tts): consolidate TTS services under lib/tts with stable entrypoint (#551)

* refactor(tts): move service module into domain folder

* refactor(tts): move summarization helpers into domain folder

* refactor(tts): add module entrypoint exports

* docs(tts): add module documentation

* refactor(web): route TTS imports through tts entrypoint

* docs(agents): map TTS module documentation
This commit is contained in:
Nelson Pires
2026-02-28 16:00:39 +02:00
committed by GitHub
parent 6eb5d1afa9
commit a1f01cf5bd
6 changed files with 159 additions and 5 deletions
+4 -4
View File
@@ -6879,7 +6879,7 @@ async function main(options = {}) {
}
// Dynamically import the TTS service (ESM)
const { ttsService } = await import('./lib/tts-service.js');
const { ttsService } = await import('./lib/tts/index.js');
// Check availability - either server-configured or client-provided API key
const hasServerKey = ttsService.isAvailable();
@@ -6896,7 +6896,7 @@ async function main(options = {}) {
// Optionally summarize long text before speaking using zen API
if (summarize && textToSpeak.length > threshold) {
try {
const { summarizeText } = await import('./lib/summarization-service.js');
const { summarizeText } = await import('./lib/tts/index.js');
const speakZenModel = await resolveZenModel(typeof req.body?.zenModel === 'string' ? req.body.zenModel : undefined);
const result = await summarizeText({ text: textToSpeak, threshold, maxLength, zenModel: speakZenModel });
@@ -6956,7 +6956,7 @@ async function main(options = {}) {
});
// Import summarization service
const { summarizeText, sanitizeForTTS } = await import('./lib/summarization-service.js');
const { summarizeText, sanitizeForTTS } = await import('./lib/tts/index.js');
app.post('/api/tts/summarize', async (req, res) => {
try {
@@ -6981,7 +6981,7 @@ async function main(options = {}) {
// TTS status endpoint
app.get('/api/tts/status', async (_req, res) => {
try {
const { ttsService } = await import('./lib/tts-service.js');
const { ttsService } = await import('./lib/tts/index.js');
res.json({
available: ttsService.isAvailable(),
voices: [