Update TTS providers and story markup

This commit is contained in:
2026-05-20 22:13:31 +02:00
parent b911c40d89
commit 8258ea2321
36 changed files with 1482 additions and 197 deletions
+8 -3
View File
@@ -291,12 +291,13 @@ class SocketClientModule extends BaseModule {
}
}
await this.storeAndQueueBlocks(turnBlocks);
const choices = Array.isArray(data.choices) ? data.choices : [];
const inputMode = data.inputMode || (choices.length > 0 ? 'choice' : 'none');
this.dispatchChoices(choices);
this.dispatchInputMode(inputMode);
await this.storeAndQueueBlocks(turnBlocks);
document.dispatchEvent(new CustomEvent('story:turn-complete', {
detail: { turnId, turn: data, choices, inputMode }
}));
@@ -392,6 +393,9 @@ class SocketClientModule extends BaseModule {
const glossaryEntries = markupParser && typeof markupParser.extractGlossaryTags === 'function'
? markupParser.extractGlossaryTags(tags)
: [];
const ttsInstructions = markupParser && typeof markupParser.extractTtsInstructionTags === 'function'
? markupParser.extractTtsInstructionTags(tags)
: [];
const cueTags = tags.filter(tag => this.isTimedCueTag(tag));
const deferredTags = tags.filter(tag => this.isDeferredPopupTag(tag));
const immediateTags = tags.filter(tag =>
@@ -433,6 +437,7 @@ class SocketClientModule extends BaseModule {
text,
layoutText,
glossaryEntries,
ttsInstructions,
cueMarkers,
deferredTags: [
...(Array.isArray(pending.deferredTags) ? pending.deferredTags : []),
@@ -503,7 +508,7 @@ class SocketClientModule extends BaseModule {
isRenderMetadataTag(tag) {
const key = String(tag?.key || '').toLowerCase();
return ['gloss'].includes(key);
return key === 'gloss' || key === 'tts' || key.startsWith('tts-');
}
isDeferredPopupTag(tag) {