@stage5/lumine 0.3.3 → 0.3.4
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/sdk/BUILD_SDK_INDEX.md +21 -1
package/package.json
CHANGED
package/sdk/BUILD_SDK_INDEX.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Version: 1.63.0
|
|
4
4
|
Updated: 2026-09-28
|
|
5
|
-
Generated: 2026-09-
|
|
5
|
+
Generated: 2026-09-30T09:55:20.738Z
|
|
6
6
|
|
|
7
7
|
## Notes
|
|
8
8
|
- This SDK is injected into Build iframes via the Build preview/runtime.
|
|
@@ -551,6 +551,26 @@ const result = await Twinkle.ai.chat({ message, history: chatHistory, systemProm
|
|
|
551
551
|
- Only one music generation per viewer may run at a time (code ai_music_generation_in_progress). A retry with the same requestId returns the finished result without paying again (replayed: true), or code music_in_progress while it is still being made.
|
|
552
552
|
- Generation usually takes one to three minutes; the SDK timeout defaults to 600000ms. Show progress UI while waiting.
|
|
553
553
|
- Example: const song = await Twinkle.ai.generateMusic({ prompt: 'Warm lo-fi hip hop with dusty drums, a mellow Rhodes and rain in the background', instrumental: true }); audio.src = song.url;
|
|
554
|
+
- async generateSpeech({ text, voice, language, requestId, timeoutMs } = {}) | scopes: none
|
|
555
|
+
- Returns: { success, asset, url, mimeType, durationSeconds, alignment, text, voice, model, requestId, replayed?, aiUsagePolicy }
|
|
556
|
+
- Generate spoken audio with Eleven v4 and save it in the viewer's Twinkle.files. New generations use AI Battery.
|
|
557
|
+
- Signed-in viewers only. Each new generation uses AI Battery; show this before the viewer starts voice interaction.
|
|
558
|
+
- text: 1–2,000 characters. voice: warm (default), bright, or calm. language: optional ISO language code such as en.
|
|
559
|
+
- The MP3 is saved in the viewer's Twinkle.files and counts toward storage. Replay the saved URL to listen again without another AI request.
|
|
560
|
+
- alignment contains provider character timing for subtitles or animation. Respect Twinkle tab mute and browser playback controls.
|
|
561
|
+
- Reuse requestId after a lost response. Completed audio replays the saved asset and settles the same billing receipt without regeneration or duplicate charges.
|
|
562
|
+
- Only one speech or transcription request per viewer runs at a time. SDK timeout defaults to 180000ms.
|
|
563
|
+
- Example: const speech = await Twinkle.ai.generateSpeech({ text: 'Welcome to our club!', voice: 'warm', language: 'en' }); audio.src = speech.url;
|
|
564
|
+
- async transcribeAudio({ audioBase64, language, requestId, timeoutMs } = {}) | scopes: none
|
|
565
|
+
- Returns: { success, text, words: [{ text, start, end }], language, durationSeconds, model, requestId, replayed?, aiUsagePolicy }
|
|
566
|
+
- Recognize a short recording with ElevenLabs Scribe v2. New recognition requests use AI Battery.
|
|
567
|
+
- Signed-in viewers only. New recognition requests use AI Battery. Each successful response includes the canonical aiUsagePolicy.
|
|
568
|
+
- audioBase64 is plain base64 of a mono 16-bit PCM WAV at 8–48 kHz, between 0.2 and 30 seconds. The server validates the actual duration.
|
|
569
|
+
- Request microphone permission only after a viewer action, show a recording indicator, and stop microphone tracks when recording ends or the app closes.
|
|
570
|
+
- Audio is sent to the recognition provider without saving a Twinkle recording asset. Let the viewer review or correct the transcript before using it as their message.
|
|
571
|
+
- Reuse requestId after a lost response. Completed transcripts replay without recognition or duplicate charges. Word recognition is not a pronunciation score.
|
|
572
|
+
- Only one speech or transcription request per viewer runs at a time. SDK timeout defaults to 180000ms.
|
|
573
|
+
- Example: const transcript = await Twinkle.ai.transcribeAudio({ audioBase64: wavBase64, language: 'en' }); input.value = transcript.text;
|
|
554
574
|
- onImageGenerationStatus(listener) | scopes: none
|
|
555
575
|
- Returns: unsubscribe function
|
|
556
576
|
- Subscribe to real-time image generation status events forwarded into the build iframe.
|