retiam 2.0.1 → 2.0.3
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/THIRD_PARTY_NOTICES.md +3 -3
- package/agent/AGENTS.md +70 -0
- package/agent/CLAUDE.md +2 -0
- package/agent/skill/SKILL.md +114 -0
- package/agent/skill/examples/AreaLesson.ts +48 -0
- package/agent/skill/examples/ExplainMotion.ts +32 -0
- package/agent/skill/examples/NarratedMotion.ts +50 -0
- package/agent/skill/examples/SecantToTangent.ts +142 -0
- package/agent/skill/references/api.md +111 -0
- package/agent/skill/references/explainers.md +123 -0
- package/agent/skill/references/quality.md +151 -0
- package/agent/skill/references/styles.md +58 -0
- package/agent/skill/references/tts.md +166 -0
- package/agent/templates/explainer/lesson.json +25 -0
- package/agent/templates/explainer/review.json +6 -0
- package/agent/templates/explainer/styles.json +92 -0
- package/bin/agent-kit.js +26 -0
- package/bin/cli.js +24 -4
- package/bin/context.js +57 -0
- package/bin/init.js +71 -12
- package/bin/lesson-project.js +30 -0
- package/bin/lesson.js +195 -0
- package/bin/lint.js +6 -6
- package/bin/snapshot-runtime.js +185 -0
- package/bin/snapshot.js +32 -225
- package/dist/THIRD_PARTY_NOTICES.md +3 -3
- package/dist/UTIF-D6vx2UEX.min.js +1 -0
- package/dist/{UTIF-2Ear_0Uo.js → UTIF-mkffT70R.js} +1 -1
- package/dist/decompress-D7LzbvPD.min.js +15 -0
- package/dist/{index-B2sJBy4c.js → index-CdBPrYbr.js} +3830 -3795
- package/dist/index-jgFyrc2D.min.js +10472 -0
- package/dist/libs/explainer/example.d.ts +3 -0
- package/dist/libs/explainer/index.d.ts +5 -0
- package/dist/libs/explainer/index.js +135 -0
- package/dist/libs/explainer/plan.d.ts +12 -0
- package/dist/libs/explainer/plan.js +219 -0
- package/dist/libs/explainer/runtime.d.ts +24 -0
- package/dist/libs/explainer/styles.d.ts +3 -0
- package/dist/libs/explainer/types.d.ts +124 -0
- package/dist/libs/explainer/visuals.d.ts +18 -0
- package/dist/libs/tts/animations/Speak.d.ts +13 -7
- package/dist/libs/tts/components/TTSNarrationComponent.d.ts +9 -7
- package/dist/libs/tts/core/TTSCache.d.ts +3 -3
- package/dist/libs/tts/core/TTSClient.d.ts +3 -3
- package/dist/libs/tts/core/types.d.ts +48 -6
- package/dist/libs/tts/index.d.ts +2 -1
- package/dist/libs/tts/index.js +203 -1333
- package/dist/libs/tts/node/index.d.ts +10 -0
- package/dist/libs/tts/node/index.js +791 -0
- package/dist/libs/tts/providers/ElevenLabsTTSProvider.d.ts +30 -0
- package/dist/libs/tts/providers/ITTSProvider.d.ts +2 -2
- package/dist/libs/vite/index.d.ts +28 -0
- package/dist/libs/vite/index.js +158 -0
- package/dist/main-Cc4QQbSK.min.js +5939 -0
- package/dist/{main-D_G4uIju.js → main-DMu_5Qy7.js} +1 -1
- package/dist/msEdgeV2-D3w4Xsn-.js +642 -0
- package/dist/opentype.module-B-1cYAb-.min.js +1 -0
- package/dist/retiam.es.js +1 -1
- package/dist/retiam.es.min.js +1 -0
- package/dist/src/engine/animation/Animation.d.ts +1 -0
- package/dist/src/engine/entities/composites/text/mathjaxInterop.d.ts +6 -0
- package/package.json +15 -8
- package/readme.md +27 -7
|
@@ -7,9 +7,9 @@ export declare class TTSCache {
|
|
|
7
7
|
private readonly cache;
|
|
8
8
|
constructor(maxSize?: number);
|
|
9
9
|
private static createKey;
|
|
10
|
-
get(text: string, voice: string, speed: number): TTSAudioResult | undefined;
|
|
11
|
-
set(text: string, voice: string, speed: number, result: TTSAudioResult): void;
|
|
12
|
-
has(text: string, voice: string, speed: number): boolean;
|
|
10
|
+
get(text: string, voice: string, speed: number, variant?: string): TTSAudioResult | undefined;
|
|
11
|
+
set(text: string, voice: string, speed: number, result: TTSAudioResult, variant?: string): void;
|
|
12
|
+
has(text: string, voice: string, speed: number, variant?: string): boolean;
|
|
13
13
|
clear(): void;
|
|
14
14
|
get size(): number;
|
|
15
15
|
}
|
|
@@ -34,7 +34,7 @@ export declare class TTSClient {
|
|
|
34
34
|
/** Releases provider resources and cached audio. */
|
|
35
35
|
dispose(): Promise<void>;
|
|
36
36
|
}
|
|
37
|
-
/** Global
|
|
37
|
+
/** Global speech facade for Retiam scenes. */
|
|
38
38
|
export declare class TTS {
|
|
39
39
|
/** Replaces the global client configuration and restores the built-in provider. */
|
|
40
40
|
static configure(config: TTSConfig): void;
|
|
@@ -46,7 +46,7 @@ export declare class TTS {
|
|
|
46
46
|
static get provider(): ITTSProvider;
|
|
47
47
|
/** Synthesizes text to speech. */
|
|
48
48
|
static synthesize(text: string, options?: TTSGenerateOptions): Promise<TTSAudioResult>;
|
|
49
|
-
/**
|
|
49
|
+
/** Legacy synthesis alias; follows the active provider. */
|
|
50
50
|
static msedge(text: string, options?: TTSGenerateOptions): Promise<TTSAudioResult>;
|
|
51
51
|
/** Streams synthesized speech sentence by sentence. */
|
|
52
52
|
static stream(text: string, options?: TTSGenerateOptions): AsyncGenerator<TTSStreamChunk>;
|
|
@@ -57,7 +57,7 @@ export declare class TTS {
|
|
|
57
57
|
}>;
|
|
58
58
|
/** Returns the active provider's voices. */
|
|
59
59
|
static getVoices(): VoiceInfo[];
|
|
60
|
-
/** Finds a
|
|
60
|
+
/** Finds a voice exposed by the active provider. */
|
|
61
61
|
static findVoice(query: string): VoiceInfo | undefined;
|
|
62
62
|
/** Recommended default voice. */
|
|
63
63
|
static readonly DEFAULT_VOICE: MsEdgeVoiceId;
|
|
@@ -4,7 +4,7 @@ import { AudioManager, VoiceoverOptions } from 'retiam';
|
|
|
4
4
|
* The open string union preserves autocomplete while accepting any current voice ID.
|
|
5
5
|
*/
|
|
6
6
|
export type MsEdgeVoiceId = "en-US-JennyNeural" | "en-US-GuyNeural" | "en-US-AriaNeural" | "en-US-AndrewNeural" | "en-US-AvaNeural" | "en-US-EmmaNeural" | "en-US-BrianNeural" | "en-US-ChristopherNeural" | "en-US-EricNeural" | "en-US-MichelleNeural" | "en-US-AnaNeural" | "en-US-SteffanNeural" | "en-US-AndrewMultilingualNeural" | "en-US-AvaMultilingualNeural" | "en-US-BrianMultilingualNeural" | "en-US-EmmaMultilingualNeural" | "en-GB-SoniaNeural" | "en-GB-RyanNeural" | "en-GB-LibbyNeural" | "en-GB-ThomasNeural" | "en-AU-NatashaNeural" | "en-AU-WilliamMultilingualNeural" | "en-CA-ClaraNeural" | "en-CA-LiamNeural" | "en-IN-NeerjaNeural" | "en-IN-PrabhatNeural" | "es-ES-ElviraNeural" | "fr-FR-DeniseNeural" | "fr-FR-HenriNeural" | "de-DE-KatjaNeural" | "de-DE-KillianNeural" | "it-IT-ElsaNeural" | "ja-JP-NanamiNeural" | "ja-JP-KeitaNeural" | "zh-CN-XiaoxiaoNeural" | "zh-CN-YunxiNeural" | (string & {});
|
|
7
|
-
/**
|
|
7
|
+
/** Provider voice identifier; preserves autocomplete for the built-in Edge voices. */
|
|
8
8
|
export type VoiceId = MsEdgeVoiceId;
|
|
9
9
|
/** Word or sentence timing metadata for synchronized captions. */
|
|
10
10
|
export interface WordBoundary {
|
|
@@ -18,13 +18,13 @@ export interface VoiceInfo {
|
|
|
18
18
|
id: string;
|
|
19
19
|
name: string;
|
|
20
20
|
language: string;
|
|
21
|
-
gender: "Female" | "Male";
|
|
21
|
+
gender: "Female" | "Male" | "Unknown";
|
|
22
22
|
traits?: string;
|
|
23
23
|
targetQuality?: string;
|
|
24
24
|
overallGrade?: string;
|
|
25
|
-
provider?: "msedge";
|
|
25
|
+
provider?: "msedge" | "elevenlabs";
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/** Shared speech configuration and built-in Microsoft Edge settings. */
|
|
28
28
|
export interface TTSConfig {
|
|
29
29
|
/** Browser proxy endpoint. Defaults to "/api/tts/msedge". */
|
|
30
30
|
msedgeEndpoint?: string;
|
|
@@ -33,10 +33,48 @@ export interface TTSConfig {
|
|
|
33
33
|
/** Maximum utterances retained by the LRU cache. Defaults to 128. */
|
|
34
34
|
maxCacheSize?: number;
|
|
35
35
|
}
|
|
36
|
+
export type ElevenLabsModelId = "eleven_multilingual_v2" | "eleven_v3" | "eleven_v4" | "eleven_flash_v2_5" | "eleven_turbo_v2_5" | (string & {});
|
|
37
|
+
/** MP3 formats supported by the Retiam audio container and duration parser. */
|
|
38
|
+
export type ElevenLabsOutputFormat = "mp3_22050_32" | "mp3_24000_48" | "mp3_44100_32" | "mp3_44100_64" | "mp3_44100_96" | "mp3_44100_128" | "mp3_44100_192";
|
|
39
|
+
/** Settings are model-dependent; omitted fields use the voice's stored settings. */
|
|
40
|
+
export interface ElevenLabsVoiceSettings {
|
|
41
|
+
stability?: number;
|
|
42
|
+
similarityBoost?: number;
|
|
43
|
+
style?: number;
|
|
44
|
+
useSpeakerBoost?: boolean;
|
|
45
|
+
/** Speaking-rate multiplier, from 0.7 to 1.2. */
|
|
46
|
+
speed?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface ElevenLabsGenerateOptions {
|
|
49
|
+
modelId?: ElevenLabsModelId;
|
|
50
|
+
voiceSettings?: ElevenLabsVoiceSettings;
|
|
51
|
+
languageCode?: string;
|
|
52
|
+
seed?: number;
|
|
53
|
+
previousText?: string;
|
|
54
|
+
nextText?: string;
|
|
55
|
+
applyTextNormalization?: "auto" | "on" | "off";
|
|
56
|
+
pronunciationDictionaries?: {
|
|
57
|
+
id: string;
|
|
58
|
+
versionId?: string;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
/** Passed directly to ElevenLabsTTSProvider.init(); no Vite plugin is required. */
|
|
62
|
+
export interface ElevenLabsTTSConfig extends TTSConfig, ElevenLabsGenerateOptions {
|
|
63
|
+
/** Caller-supplied credential, retained only by this provider instance. */
|
|
64
|
+
apiKey?: string;
|
|
65
|
+
/** Default ElevenLabs voice ID. May also be supplied per utterance. */
|
|
66
|
+
voiceId?: string;
|
|
67
|
+
/** Defaults to https://api.elevenlabs.io. */
|
|
68
|
+
baseUrl?: string;
|
|
69
|
+
/** Defaults to mp3_44100_128. */
|
|
70
|
+
outputFormat?: ElevenLabsOutputFormat;
|
|
71
|
+
/** Request timeout, including response download. Defaults to 90000 ms. */
|
|
72
|
+
timeoutMs?: number;
|
|
73
|
+
}
|
|
36
74
|
/** Per-utterance synthesis options. */
|
|
37
75
|
export interface TTSGenerateOptions {
|
|
38
|
-
/**
|
|
39
|
-
voice?:
|
|
76
|
+
/** Voice ID; defaults to the active provider's configured voice. */
|
|
77
|
+
voice?: VoiceId;
|
|
40
78
|
/** Speaking-rate multiplier. Defaults to 1.0. */
|
|
41
79
|
speed?: number;
|
|
42
80
|
/** SSML pitch shift such as "+0Hz", "+5st", or "+10%". */
|
|
@@ -45,6 +83,10 @@ export interface TTSGenerateOptions {
|
|
|
45
83
|
volume?: string | number;
|
|
46
84
|
/** Custom sentence splitter for progressive streaming. */
|
|
47
85
|
splitPattern?: RegExp;
|
|
86
|
+
/** Caption text when synthesis text contains delivery tags or pronunciation markup. */
|
|
87
|
+
displayText?: string;
|
|
88
|
+
/** ElevenLabs model, delivery, pronunciation, and continuity overrides. */
|
|
89
|
+
elevenlabs?: ElevenLabsGenerateOptions;
|
|
48
90
|
}
|
|
49
91
|
/** Playback options for Retiam's voiceover bus. */
|
|
50
92
|
export interface TTSPlaybackOptions extends VoiceoverOptions {
|
package/dist/libs/tts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Retiam
|
|
2
|
+
* Retiam speech synthesis, expressive narration, and subtitles with Edge and ElevenLabs.
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
@@ -11,6 +11,7 @@ export * from './core/TTSCache';
|
|
|
11
11
|
export * from './core/TTSClient';
|
|
12
12
|
export * from './providers/ITTSProvider';
|
|
13
13
|
export * from './providers/MsEdgeTTSProvider';
|
|
14
|
+
export * from './providers/ElevenLabsTTSProvider';
|
|
14
15
|
export * from './components/TTSNarrationComponent';
|
|
15
16
|
export * from './components/Subtitles';
|
|
16
17
|
export * from './animations/Speak';
|