@liforma/client 0.3.0 → 0.4.1
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/CHANGELOG.md +28 -0
- package/README.md +14 -1
- package/dist/byo/audioCapture.d.ts +24 -0
- package/dist/byo/audioCapture.d.ts.map +1 -0
- package/dist/byo/index.d.ts +8 -0
- package/dist/byo/index.d.ts.map +1 -0
- package/dist/byo/index.js +307 -0
- package/dist/byo/index.js.map +1 -0
- package/dist/byo/mic.d.ts +27 -0
- package/dist/byo/mic.d.ts.map +1 -0
- package/dist/byo/pcm.d.ts +33 -0
- package/dist/byo/pcm.d.ts.map +1 -0
- package/dist/byo/pcmCarry.d.ts +17 -0
- package/dist/byo/pcmCarry.d.ts.map +1 -0
- package/dist/byo/resample.d.ts +18 -0
- package/dist/byo/resample.d.ts.map +1 -0
- package/dist/byo/turn.d.ts +39 -0
- package/dist/byo/turn.d.ts.map +1 -0
- package/dist/byo/types.d.ts +74 -0
- package/dist/byo/types.d.ts.map +1 -0
- package/dist/deepgram/connectDeepgramAgent.d.ts +51 -0
- package/dist/deepgram/connectDeepgramAgent.d.ts.map +1 -0
- package/dist/deepgram/deepgramAgentMessages.d.ts +31 -0
- package/dist/deepgram/deepgramAgentMessages.d.ts.map +1 -0
- package/dist/deepgram/index.d.ts +4 -0
- package/dist/deepgram/index.d.ts.map +1 -0
- package/dist/deepgram/index.js +142 -0
- package/dist/deepgram/index.js.map +1 -0
- package/dist/elevenlabs/connectElevenLabsAgent.d.ts +23 -0
- package/dist/elevenlabs/connectElevenLabsAgent.d.ts.map +1 -0
- package/dist/elevenlabs/index.d.ts +4 -0
- package/dist/elevenlabs/index.d.ts.map +1 -0
- package/dist/elevenlabs/index.js +89 -0
- package/dist/elevenlabs/index.js.map +1 -0
- package/dist/google/connectGeminiLive.d.ts +34 -0
- package/dist/google/connectGeminiLive.d.ts.map +1 -0
- package/dist/google/index.d.ts +4 -0
- package/dist/google/index.d.ts.map +1 -0
- package/dist/google/index.js +98 -0
- package/dist/google/index.js.map +1 -0
- package/dist/livekit/connectLiveKitAgent.d.ts +46 -0
- package/dist/livekit/connectLiveKitAgent.d.ts.map +1 -0
- package/dist/livekit/index.d.ts +3 -0
- package/dist/livekit/index.d.ts.map +1 -0
- package/dist/livekit/index.js +113 -0
- package/dist/livekit/index.js.map +1 -0
- package/dist/next/byo/audioCapture.d.ts +24 -0
- package/dist/next/byo/audioCapture.d.ts.map +1 -0
- package/dist/next/byo/pcm.d.ts +33 -0
- package/dist/next/byo/pcm.d.ts.map +1 -0
- package/dist/next/byo/resample.d.ts +18 -0
- package/dist/next/byo/resample.d.ts.map +1 -0
- package/dist/next/index.js +1135 -4183
- package/dist/next/index.js.map +1 -1
- package/dist/next/next/createLiformaSessionRouteHandler.d.ts +3 -1
- package/dist/next/next/createLiformaSessionRouteHandler.d.ts.map +1 -1
- package/dist/next/v2/api/mintPublicSession.d.ts +21 -15
- package/dist/next/v2/api/mintPublicSession.d.ts.map +1 -1
- package/dist/next/v2/api/sessionEndpointRequest.d.ts +8 -3
- package/dist/next/v2/api/sessionEndpointRequest.d.ts.map +1 -1
- package/dist/next/v2/embed/iframeHost.d.ts +24 -1
- package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/next/v2/embed/protocol.d.ts +61 -1
- package/dist/next/v2/embed/protocol.d.ts.map +1 -1
- package/dist/next/v2/experience.d.ts +66 -46
- package/dist/next/v2/experience.d.ts.map +1 -1
- package/dist/next/v2/experienceEvents.d.ts +3 -0
- package/dist/next/v2/experienceEvents.d.ts.map +1 -1
- package/dist/next/v2/speech/captureMediaStreamTrack.d.ts +1 -1
- package/dist/next/v2/speech/captureMediaStreamTrack.d.ts.map +1 -1
- package/dist/next/v2/speech/speechController.d.ts.map +1 -1
- package/dist/next/v2/speech/types.d.ts +13 -0
- package/dist/next/v2/speech/types.d.ts.map +1 -1
- package/dist/next/v2/types/sessionLaunch.d.ts +43 -0
- package/dist/next/v2/types/sessionLaunch.d.ts.map +1 -0
- package/dist/next/widget/mountExperienceWidget.d.ts.map +1 -1
- package/dist/next/widget/styles.d.ts +1 -1
- package/dist/next/widget/styles.d.ts.map +1 -1
- package/dist/next/widget/types.d.ts +6 -1
- package/dist/next/widget/types.d.ts.map +1 -1
- package/dist/npm/byo/audioCapture.d.ts +24 -0
- package/dist/npm/byo/audioCapture.d.ts.map +1 -0
- package/dist/npm/byo/pcm.d.ts +33 -0
- package/dist/npm/byo/pcm.d.ts.map +1 -0
- package/dist/npm/byo/resample.d.ts +18 -0
- package/dist/npm/byo/resample.d.ts.map +1 -0
- package/dist/npm/index.js +960 -4011
- package/dist/npm/index.js.map +1 -1
- package/dist/npm/v2/api/mintPublicSession.d.ts +21 -15
- package/dist/npm/v2/api/mintPublicSession.d.ts.map +1 -1
- package/dist/npm/v2/api/sessionEndpointRequest.d.ts +8 -3
- package/dist/npm/v2/api/sessionEndpointRequest.d.ts.map +1 -1
- package/dist/npm/v2/embed/iframeHost.d.ts +24 -1
- package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/npm/v2/embed/protocol.d.ts +61 -1
- package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
- package/dist/npm/v2/experience.d.ts +66 -46
- package/dist/npm/v2/experience.d.ts.map +1 -1
- package/dist/npm/v2/experienceEvents.d.ts +3 -0
- package/dist/npm/v2/experienceEvents.d.ts.map +1 -1
- package/dist/npm/v2/index.d.ts +1 -0
- package/dist/npm/v2/index.d.ts.map +1 -1
- package/dist/npm/v2/liforma-experience.d.ts.map +1 -1
- package/dist/npm/v2/npm.d.ts +1 -0
- package/dist/npm/v2/npm.d.ts.map +1 -1
- package/dist/npm/v2/speech/captureMediaStreamTrack.d.ts +1 -1
- package/dist/npm/v2/speech/captureMediaStreamTrack.d.ts.map +1 -1
- package/dist/npm/v2/speech/speechController.d.ts.map +1 -1
- package/dist/npm/v2/speech/types.d.ts +13 -0
- package/dist/npm/v2/speech/types.d.ts.map +1 -1
- package/dist/npm/v2/types/index.d.ts +2 -0
- package/dist/npm/v2/types/index.d.ts.map +1 -1
- package/dist/npm/v2/types/sessionLaunch.d.ts +43 -0
- package/dist/npm/v2/types/sessionLaunch.d.ts.map +1 -0
- package/dist/npm/widget/mountExperienceWidget.d.ts.map +1 -1
- package/dist/npm/widget/styles.d.ts +1 -1
- package/dist/npm/widget/styles.d.ts.map +1 -1
- package/dist/npm/widget/types.d.ts +6 -1
- package/dist/npm/widget/types.d.ts.map +1 -1
- package/dist/openai/connectOpenAiRealtime.d.ts +41 -0
- package/dist/openai/connectOpenAiRealtime.d.ts.map +1 -0
- package/dist/openai/connectOpenAiRealtimeWebRtc.d.ts +37 -0
- package/dist/openai/connectOpenAiRealtimeWebRtc.d.ts.map +1 -0
- package/dist/openai/index.d.ts +5 -0
- package/dist/openai/index.d.ts.map +1 -0
- package/dist/openai/index.js +282 -0
- package/dist/openai/index.js.map +1 -0
- package/dist/react/byo/audioCapture.d.ts +24 -0
- package/dist/react/byo/audioCapture.d.ts.map +1 -0
- package/dist/react/byo/pcm.d.ts +33 -0
- package/dist/react/byo/pcm.d.ts.map +1 -0
- package/dist/react/byo/resample.d.ts +18 -0
- package/dist/react/byo/resample.d.ts.map +1 -0
- package/dist/react/component/experienceComponentLaunch.d.ts +1 -0
- package/dist/react/component/experienceComponentLaunch.d.ts.map +1 -1
- package/dist/react/component/experienceComponentRuntime.d.ts +11 -1
- package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
- package/dist/react/component/experienceComponentTypes.d.ts +25 -10
- package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
- package/dist/react/index.js +1291 -4327
- package/dist/react/index.js.map +1 -1
- package/dist/react/react/Experience.d.ts.map +1 -1
- package/dist/react/v2/api/mintPublicSession.d.ts +21 -15
- package/dist/react/v2/api/mintPublicSession.d.ts.map +1 -1
- package/dist/react/v2/api/sessionEndpointRequest.d.ts +8 -3
- package/dist/react/v2/api/sessionEndpointRequest.d.ts.map +1 -1
- package/dist/react/v2/embed/iframeHost.d.ts +24 -1
- package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/react/v2/embed/protocol.d.ts +61 -1
- package/dist/react/v2/embed/protocol.d.ts.map +1 -1
- package/dist/react/v2/experience.d.ts +66 -46
- package/dist/react/v2/experience.d.ts.map +1 -1
- package/dist/react/v2/experienceEvents.d.ts +3 -0
- package/dist/react/v2/experienceEvents.d.ts.map +1 -1
- package/dist/react/v2/speech/captureMediaStreamTrack.d.ts +1 -1
- package/dist/react/v2/speech/captureMediaStreamTrack.d.ts.map +1 -1
- package/dist/react/v2/speech/speechController.d.ts.map +1 -1
- package/dist/react/v2/speech/types.d.ts +13 -0
- package/dist/react/v2/speech/types.d.ts.map +1 -1
- package/dist/react/v2/types/sessionLaunch.d.ts +43 -0
- package/dist/react/v2/types/sessionLaunch.d.ts.map +1 -0
- package/dist/react/widget/mountExperienceWidget.d.ts.map +1 -1
- package/dist/react/widget/styles.d.ts +1 -1
- package/dist/react/widget/styles.d.ts.map +1 -1
- package/dist/react/widget/types.d.ts +6 -1
- package/dist/react/widget/types.d.ts.map +1 -1
- package/dist/sdk/v2/client.js +33 -69
- package/dist/sdk/v2/client.js.map +1 -1
- package/dist/svelte/Experience.svelte +54 -38
- package/dist/svelte/Experience.svelte.d.ts +2 -1
- package/package.json +55 -7
- package/dist/next/v2/speechOnlyManifest.d.ts +0 -7
- package/dist/next/v2/speechOnlyManifest.d.ts.map +0 -1
- package/dist/next/v2/types/sessionManifestSchema.d.ts +0 -183
- package/dist/next/v2/types/sessionManifestSchema.d.ts.map +0 -1
- package/dist/react/v2/speechOnlyManifest.d.ts +0 -7
- package/dist/react/v2/speechOnlyManifest.d.ts.map +0 -1
- package/dist/react/v2/types/sessionManifestSchema.d.ts +0 -183
- package/dist/react/v2/types/sessionManifestSchema.d.ts.map +0 -1
package/dist/npm/v2/npm.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { fetchExperiencePreview, type ExperiencePreview } from './api/fetchExper
|
|
|
5
5
|
export { Experience, type ExperienceSession } from './experience';
|
|
6
6
|
export type { AttachOptions, CloseEvent, EmbedState, LiformaPlayer, ReadyEvent, StartSessionOptions } from './experience';
|
|
7
7
|
export type { SessionManifest, SessionManifestCharacter } from './types/sessionManifest';
|
|
8
|
+
export type { CloseButtonOptions, PlayerStatus, Session, SessionActivity, SessionCapabilities, SessionLaunchResponse, SessionMode } from './types/sessionLaunch';
|
|
8
9
|
export type { ExperienceEventName, ExperienceEvents } from './experienceEvents';
|
|
9
10
|
export type { CharacterSpeechEvent, CharacterSpeechSource, CharacterSpeechTerminalReason, ConversationMessage, ConversationProcessorContext, ConversationProcessorErrorEvent, ConversationProcessorFn, ConversationProcessorResult, ListenOnceOptions, SessionModeChange, SpeakOptions, TextSpeakResult, SpeechResult as LegacySpeakResult, UserSpeechBoundaryEvent, UserTranscriptUpdate, UtteranceResult, ExperienceFit, ExperienceMode, ResponseMode, SpeechInputMode, StartButtonAppearance, StartButtonOptions, StartButtonPlacement, StartButtonShadow, StartButtonSize, StartButtonVariant, StartedEvent } from './types/sessionInteraction';
|
|
10
11
|
export { SPEECH_LIMITS, SpeechBufferTimeoutError, SpeechRuntimeError, SpeechUtteranceClosedError, UnsupportedSpeechOperationError } from './speech';
|
package/dist/npm/v2/npm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../../src/v2/npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,0BAA0B,EAC1B,+BAA+B,EAC/B,wBAAwB,EACxB,wBAAwB,EACxB,+BAA+B,EAC/B,KAAK,YAAY,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,qBAAqB,EACrB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Z,eAAe,EACf,YAAY,IAAI,iBAAiB,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,+BAA+B,EAC/B,MAAM,UAAU,CAAC;AAClB,YAAY,EACX,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,MAAM,UAAU,CAAC"}
|
|
@@ -11,7 +11,7 @@ export type CaptureMediaStreamTrackOptions = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Capture a live audio track into an open utterance until the track ends or abort.
|
|
14
|
-
*
|
|
14
|
+
* Prefers AudioWorklet + cubic resample (ScriptProcessor fallback).
|
|
15
15
|
*/
|
|
16
16
|
export declare function pipeMediaStreamTrackToUtterance(options: CaptureMediaStreamTrackOptions): Promise<void>;
|
|
17
17
|
//# sourceMappingURL=captureMediaStreamTrack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureMediaStreamTrack.d.ts","sourceRoot":"","sources":["../../../../src/v2/speech/captureMediaStreamTrack.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"captureMediaStreamTrack.d.ts","sourceRoot":"","sources":["../../../../src/v2/speech/captureMediaStreamTrack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,8BAA8B,GAAG;IAC5C,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,wBAAsB,+BAA+B,CACpD,OAAO,EAAE,8BAA8B,GACrC,OAAO,CAAC,IAAI,CAAC,CA8Ef"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechController.d.ts","sourceRoot":"","sources":["../../../../src/v2/speech/speechController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAgBN,KAAK,gBAAgB,EAarB,MAAM,SAAS,CAAC;AA8CjB,YAAY,EACX,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,2BAA2B,EAC3B,kBAAkB,EAClB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,kBAAkB,GAAG;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,MAAM,kBAAkB,CAAC;IACnD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,MAAM,CAAC;IAC5C,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3C,CAAC;
|
|
1
|
+
{"version":3,"file":"speechController.d.ts","sourceRoot":"","sources":["../../../../src/v2/speech/speechController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAgBN,KAAK,gBAAgB,EAarB,MAAM,SAAS,CAAC;AA8CjB,YAAY,EACX,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,2BAA2B,EAC3B,kBAAkB,EAClB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,kBAAkB,GAAG;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,MAAM,kBAAkB,CAAC;IACnD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,MAAM,CAAC;IAC5C,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3C,CAAC;AAqSF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB,GAAG,gBAAgB,CAkMnF"}
|
|
@@ -109,6 +109,13 @@ export type SpeechCreateUtteranceOptions = {
|
|
|
109
109
|
readonly sampleRate?: number;
|
|
110
110
|
readonly characterId?: string;
|
|
111
111
|
readonly queue?: StreamingSpeechQueuePolicy;
|
|
112
|
+
/**
|
|
113
|
+
* Optional spoken text seed for force-aligned STA (lip sync).
|
|
114
|
+
* Non-empty transcript enables force-align for this utterance; omit / whitespace → free CTC.
|
|
115
|
+
* May be updated mid-turn via {@link SpeechUtterance.setTranscript} or finalized on
|
|
116
|
+
* {@link SpeechUtterance.close} `{ transcript }`.
|
|
117
|
+
*/
|
|
118
|
+
readonly transcript?: string;
|
|
112
119
|
readonly signal?: AbortSignal;
|
|
113
120
|
};
|
|
114
121
|
export type SpeechUtteranceCloseOptions = {
|
|
@@ -123,6 +130,12 @@ export type SpeechUtterance = {
|
|
|
123
130
|
readonly characterId: string;
|
|
124
131
|
readonly result: Promise<SpeechResult>;
|
|
125
132
|
write(audio: ArrayBuffer | Uint8Array, options?: SpeechWriteOptions): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Replace / set spoken text mid-turn for force-aligned STA.
|
|
135
|
+
* Non-empty text upgrades free decode → force-align (full-utterance on close).
|
|
136
|
+
* Empty / whitespace is a no-op.
|
|
137
|
+
*/
|
|
138
|
+
setTranscript(text: string): Promise<void>;
|
|
126
139
|
close(options?: SpeechUtteranceCloseOptions): Promise<SpeechResult>;
|
|
127
140
|
cancel(): Promise<SpeechResult>;
|
|
128
141
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/speech/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;CACrB,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAEpF,iDAAiD;AACjD,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;AAE3F,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAE/F,MAAM,MAAM,YAAY,GAAG;IAC1B,QAAQ,CAAC,WAAW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,qBAAa,0BAA2B,SAAQ,KAAK;IACpD,QAAQ,CAAC,IAAI,gCAAgC;gBACjC,OAAO,SAA4D;CAG/E;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,wBAAwB;gBACzB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAG1D;AAED,qBAAa,wBAAyB,SAAQ,KAAK;IAClD,QAAQ,CAAC,IAAI,8BAA8B;gBAC/B,OAAO,SAAkD;CAGrE;AAED,wBAAgB,oBAAoB,CACnC,IAAI,GAAE,mBAA4B,GAChC,YAAY,CAAC,WAAW,CAAC,CAM3B;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAU/D;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAkClE;AAED,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,4BAA4B,GACnC,iBAAiB,CAgBnB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAEvE;AAED,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,yBAAyB,GAAG,0BAA0B,GAAG,SAAS,GACvE,SAAS,GAAG,WAAW,CAGzB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export type { SessionManifest, SessionManifestCharacter } from './sessionManifest';
|
|
2
2
|
export { manifestHasSessionCredential, parseSessionManifest } from './sessionManifestSchema';
|
|
3
|
+
export type { CloseButtonOptions, PlayerStatus, Session, SessionActivity, SessionCapabilities, SessionLaunchResponse, SessionMode } from './sessionLaunch';
|
|
4
|
+
export { parseSession, parseSessionLaunchResponse } from './sessionLaunch';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EACN,4BAA4B,EAC5B,oBAAoB,EACpB,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EACN,4BAA4B,EAC5B,oBAAoB,EACpB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public Session Launch contract (integrator-facing).
|
|
3
|
+
* Runtime internals live inside the opaque `launch` string — do not parse it.
|
|
4
|
+
*/
|
|
5
|
+
export type SessionCapabilities = {
|
|
6
|
+
readonly avatar: boolean;
|
|
7
|
+
readonly speechInput: boolean;
|
|
8
|
+
readonly speechOutput: boolean;
|
|
9
|
+
readonly tools: boolean;
|
|
10
|
+
readonly externalAudio: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type SessionMode = 'conversation' | 'presenter';
|
|
13
|
+
export type Session = {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly experienceId: string;
|
|
16
|
+
readonly experienceRevisionId: string;
|
|
17
|
+
readonly expiresAt: string;
|
|
18
|
+
readonly locale: string;
|
|
19
|
+
/** Paired / learning language when dual; omitted for plain sessions. */
|
|
20
|
+
readonly secondaryLocale?: string;
|
|
21
|
+
readonly mode: SessionMode;
|
|
22
|
+
readonly capabilities: SessionCapabilities;
|
|
23
|
+
};
|
|
24
|
+
export type SessionLaunchResponse = {
|
|
25
|
+
readonly session: Session;
|
|
26
|
+
/**
|
|
27
|
+
* Asymmetrically signed opaque runtime bootstrap for the player.
|
|
28
|
+
* Contract-opaque (unsupported to parse), not confidentiality-opaque.
|
|
29
|
+
*/
|
|
30
|
+
readonly launch: string;
|
|
31
|
+
};
|
|
32
|
+
export type PlayerStatus = 'loading' | 'scene' | 'ready' | 'error';
|
|
33
|
+
/** Listening / speaking activity (replaces overloaded modeChange). */
|
|
34
|
+
export type SessionActivity = 'idle' | 'listening' | 'thinking' | 'speaking';
|
|
35
|
+
export type CloseButtonOptions = {
|
|
36
|
+
readonly visible?: boolean;
|
|
37
|
+
readonly style?: 'icon' | 'text';
|
|
38
|
+
readonly label?: string | null;
|
|
39
|
+
readonly position?: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function parseSession(raw: unknown): Session;
|
|
42
|
+
export declare function parseSessionLaunchResponse(raw: unknown): SessionLaunchResponse;
|
|
43
|
+
//# sourceMappingURL=sessionLaunch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionLaunch.d.ts","sourceRoot":"","sources":["../../../../src/v2/types/sessionLaunch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,mBAAmB,GAAG;IACjC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,WAAW,CAAC;AAEvD,MAAM,MAAM,OAAO,GAAG;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EA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AC;AAMjB,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAQvE;AA+JD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,uBAAuB,GAC9B,0BAA0B,
|
|
1
|
+
{"version":3,"file":"mountExperienceWidget.d.ts","sourceRoot":"","sources":["../../../src/widget/mountExperienceWidget.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACX,0BAA0B,EAC1B,uBAAuB,EAGvB,MAAM,SAAS,CAAC;AAMjB,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAQvE;AA+JD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,uBAAuB,GAC9B,0BAA0B,CAq7B5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Styles for ExperienceWidget (class prefix `liforma-ew`). */
|
|
2
|
-
export declare const EXPERIENCE_WIDGET_CSS = "\n.liforma-ew {\n\tbox-sizing: border-box;\n\tposition: relative;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n}\n\n/* Optional self-positioned FAB (position=bottom-right|bottom-left).\n * Cap at 50vmin so small phones don't get an oversized thumb (desktop 224px stays). */\n.liforma-ew[data-position='bottom-right'],\n.liforma-ew[data-position='bottom-left'] {\n\tposition: fixed;\n\twidth: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n\theight: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n\tbottom: var(--liforma-ew-offset, 16px);\n\tz-index: 2147482900;\n}\n\n.liforma-ew[data-position='bottom-right'] {\n\tright: var(--liforma-ew-offset, 16px);\n\tleft: auto;\n}\n\n.liforma-ew[data-position='bottom-left'] {\n\tleft: var(--liforma-ew-offset, 16px);\n\tright: auto;\n}\n\n/* While open, collapse the FAB box so a corner hole / thumb never remains. */\n.liforma-ew[data-position='bottom-right'][data-state='expanded'],\n.liforma-ew[data-position='bottom-right'][data-state='docked'],\n.liforma-ew[data-position='bottom-left'][data-state='expanded'],\n.liforma-ew[data-position='bottom-left'][data-state='docked'] {\n\twidth: 0;\n\theight: 0;\n\tmin-width: 0;\n\tmin-height: 0;\n\toverflow: visible;\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='expanded'] .liforma-ew__overlay,\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar,\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n\tpointer-events: auto;\n}\n\n.liforma-ew__hit {\n\tbox-sizing: border-box;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont: inherit;\n\tappearance: none;\n\t-webkit-tap-highlight-color: transparent;\n\ttransform: scale(1);\n\ttransform-origin: center center;\n\ttransition:\n\t\ttransform 180ms ease,\n\t\tfilter 180ms ease;\n\twill-change: transform;\n}\n\n/* Author display must not defeat the HTML hidden attribute. */\n.liforma-ew__hit[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__hit:focus-visible {\n\toutline: 2px solid #5b8def;\n\toutline-offset: 3px;\n\tborder-radius: 0.75rem;\n}\n\n@media (hover: hover) and (pointer: fine) {\n\t/* Scale the thumb whenever the collapsed FAB is hovered \u2014 including via the warm iframe hit layer. */\n\t.liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n\t.liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n\t\ttransform: scale(1.06);\n\t}\n\n\t.liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover .liforma-et,\n\t.liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-et {\n\t\tbox-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);\n\t}\n}\n\n.liforma-ew__face {\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n\tposition: relative;\n}\n\n.liforma-ew__face-status {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 1;\n\tdisplay: grid;\n\tplace-items: center;\n\tpadding: 0.5rem;\n\ttext-align: center;\n\tfont: 600 0.75rem/1.3 system-ui, sans-serif;\n\tcolor: #e8ecf4;\n\tbackground: rgba(10, 12, 18, 0.72);\n\tborder-radius: 0.75rem;\n\tpointer-events: none;\n}\n\n.liforma-ew__face-status[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__hit:disabled {\n\tcursor: default;\n\topacity: 0.85;\n}\n\n.liforma-ew__face .liforma-et {\n\tborder-radius: 0.75rem;\n\tbox-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);\n\ttransition: box-shadow 180ms ease;\n}\n\n.liforma-ew__warm {\n\tbox-sizing: border-box;\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 2;\n\tborder-radius: 0.75rem;\n\toverflow: hidden;\n\tbackground: transparent;\n\tpointer-events: none;\n\topacity: 1;\n\ttransition: opacity 1000ms ease;\n}\n\n/*\n * Collapsed: keep the warm iframe as an invisible hit target only.\n * Painting it over the thumb causes a \u201Cghost enlarge\u201D (face scales under a static iframe).\n */\n.liforma-ew[data-state='collapsed'] .liforma-ew__warm {\n\topacity: 0;\n\ttransition: none;\n}\n\n.liforma-ew[data-warm='true'] .liforma-ew__warm {\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-warm='true']:not([data-live='true']) .liforma-ew__hit {\n\tpointer-events: none;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__hit {\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-live='true'] .liforma-ew__warm,\n.liforma-ew[data-live='true'] .liforma-ew__stage {\n\t/* Hidden under the thumb / until post-resize fade-in (matches cold avatar reveal). */\n\topacity: 0;\n}\n\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__stage,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__stage {\n\topacity: 1;\n}\n\n.liforma-ew--session-concealing .liforma-ew__warm,\n.liforma-ew--session-concealing .liforma-ew__stage {\n\ttransition-duration: 280ms;\n}\n\n/* Instant hide while dock/maximize geometry settles (player morph resize ~160ms). */\n.liforma-ew--layout-settling .liforma-ew__warm,\n.liforma-ew--layout-settling .liforma-ew__stage {\n\topacity: 0 !important;\n\ttransition: none !important;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__warm {\n\t/* Keep the live iframe under the thumb; FAB click resumes the shell. */\n\tpointer-events: none;\n\topacity: 0;\n\t/* Instant hide when collapsed so the FAB never shows a resized live mesh. */\n\ttransition: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n\tposition: fixed;\n\t/* Match overlay panel inset so the warm iframe fills the conversation shell. */\n\tinset: clamp(12px, 3vw, 28px);\n\tz-index: 2147483001;\n\twidth: auto;\n\theight: auto;\n\tborder-radius: 16px;\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__warm {\n\tposition: fixed;\n\tinset: auto;\n\tz-index: 2147483001;\n\tborder-radius: 16px;\n\tpointer-events: auto;\n\t/* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew__toolbar {\n\tdisplay: none;\n\tposition: fixed;\n\tz-index: 2147483002;\n\tpointer-events: auto;\n\tbox-sizing: border-box;\n\talign-items: center;\n\tgap: 0.35rem;\n\tpadding: 0.35rem 0.4rem;\n\tborder-radius: 999px;\n\tbackground: rgba(12, 14, 20, 0.72);\n\tbackdrop-filter: blur(8px);\n\t-webkit-backdrop-filter: blur(8px);\n\tbox-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n\tdisplay: flex;\n\ttop: calc(clamp(12px, 3vw, 28px) + 10px);\n\tright: calc(clamp(12px, 3vw, 28px) + 10px);\n\tleft: auto;\n\tcursor: default;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n\tdisplay: flex;\n\t/* left/top set inline to track the panel; strip is the drag handle */\n\tcursor: grab;\n\ttouch-action: none;\n\tuser-select: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar.liforma-ew__toolbar--dragging {\n\tcursor: grabbing;\n}\n\n.liforma-ew__toolbar[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__icon-btn {\n\tappearance: none;\n\tbox-sizing: border-box;\n\tdisplay: inline-grid;\n\tplace-items: center;\n\twidth: 2rem;\n\theight: 2rem;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tborder-radius: 999px;\n\tcolor: #f5f7fb;\n\tbackground: transparent;\n\tcursor: pointer;\n}\n\n.liforma-ew__icon-btn:hover {\n\tbackground: rgba(255, 255, 255, 0.12);\n}\n\n.liforma-ew__icon-btn[aria-pressed='true'] {\n\tbackground: rgba(255, 255, 255, 0.2);\n}\n\n.liforma-ew__icon-btn:focus-visible {\n\toutline: 2px solid #5b8def;\n\toutline-offset: 2px;\n}\n\n.liforma-ew__icon-btn svg {\n\twidth: 1.05rem;\n\theight: 1.05rem;\n\tdisplay: block;\n}\n\n.liforma-ew__drag-grip {\n\tdisplay: none;\n\twidth: 0.85rem;\n\theight: 1.25rem;\n\tmargin: 0 0.15rem 0 0.25rem;\n\tbackground:\n\t\tradial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0 0 / 0.35rem 0.35rem,\n\t\tradial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0.35rem 0 / 0.35rem 0.35rem;\n\tbackground-repeat: repeat-y;\n\topacity: 0.55;\n\tcolor: #f5f7fb;\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__drag-grip {\n\tdisplay: block;\n}\n\n.liforma-ew__dock-toggle[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__overlay {\n\tposition: fixed;\n\tinset: 0;\n\tz-index: 2147483000;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: clamp(12px, 3vw, 28px);\n\tbox-sizing: border-box;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n\tpadding: 0;\n\talign-items: stretch;\n\tjustify-content: stretch;\n\tpointer-events: none;\n\tbackground: transparent;\n}\n\n.liforma-ew__overlay[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__backdrop {\n\tposition: absolute;\n\tinset: 0;\n\tborder: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbackground: rgba(6, 8, 14, 0.62);\n\tcursor: pointer;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__backdrop {\n\tdisplay: none !important;\n}\n\n.liforma-ew__panel {\n\tposition: relative;\n\tz-index: 1;\n\tdisplay: flex;\n\tflex-direction: column;\n\t/* Fill the overlay so player loading / start UI centers in the visible window. */\n\twidth: var(--liforma-ew-max-w, 100%);\n\theight: var(--liforma-ew-max-h, 100%);\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tborder-radius: 16px;\n\toverflow: hidden;\n\tbackground: #030508;\n\tbox-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);\n\t/* Warm iframe sits above as a sibling; keep panel as chrome shell. */\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n\tposition: fixed;\n\tinset: auto;\n\tmax-width: none;\n\tmax-height: none;\n\tpointer-events: auto;\n\t/* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew:not([data-warm='true']) .liforma-ew__panel {\n\tpointer-events: auto;\n}\n\n.liforma-ew__stage {\n\tposition: relative;\n\tflex: 1;\n\tmin-height: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground: #030508;\n\topacity: 1;\n\ttransition: opacity 1000ms ease;\n}\n\n.liforma-ew__status {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 1;\n\tdisplay: grid;\n\tplace-items: center;\n\tpadding: 1.5rem;\n\ttext-align: center;\n\tcolor: #d7dde8;\n\tfont: 500 0.9375rem/1.45 system-ui, sans-serif;\n\tbackground: rgba(3, 5, 8, 0.92);\n\tpointer-events: none;\n}\n\n.liforma-ew__status[hidden] {\n\tdisplay: none !important;\n}\n\n/* Mobile expanded: ~90% viewport, no reduce control. */\n@media (max-width: 767px) {\n\t.liforma-ew[data-state='expanded'] .liforma-ew__overlay {\n\t\tpadding: 5vh 5vw;\n\t}\n\n\t.liforma-ew[data-state='expanded'] .liforma-ew__panel {\n\t\twidth: 90vw;\n\t\theight: 90vh;\n\t\tmax-width: 90vw;\n\t\tmax-height: 90vh;\n\t}\n\n\t.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n\t\tinset: 5vh 5vw;\n\t}\n\n\t.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n\t\ttop: calc(5vh + 10px);\n\t\tright: calc(5vw + 10px);\n\t}\n\n\t.liforma-ew__dock-toggle {\n\t\tdisplay: none !important;\n\t}\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.liforma-ew__hit {\n\t\ttransition: none;\n\t\twill-change: auto;\n\t}\n\n\t.liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n\t.liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n\t\ttransform: none;\n\t}\n\n\t.liforma-ew__face .liforma-et {\n\t\tbox-shadow: none;\n\t\ttransition: none;\n\t}\n\n\t.liforma-ew__warm,\n\t.liforma-ew__stage {\n\t\ttransition: none;\n\t}\n}\n";
|
|
2
|
+
export declare const EXPERIENCE_WIDGET_CSS = "\n.liforma-ew {\n\tbox-sizing: border-box;\n\tposition: relative;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n}\n\n/* Optional self-positioned FAB (position=bottom-right|bottom-left).\n * Cap at 50vmin so small phones don't get an oversized thumb (desktop 224px stays). */\n.liforma-ew[data-position='bottom-right'],\n.liforma-ew[data-position='bottom-left'] {\n\tposition: fixed;\n\twidth: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n\theight: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n\tbottom: var(--liforma-ew-offset, 16px);\n\tz-index: 2147482900;\n}\n\n.liforma-ew[data-position='bottom-right'] {\n\tright: var(--liforma-ew-offset, 16px);\n\tleft: auto;\n}\n\n.liforma-ew[data-position='bottom-left'] {\n\tleft: var(--liforma-ew-offset, 16px);\n\tright: auto;\n}\n\n/* While open, collapse the FAB box so a corner hole / thumb never remains. */\n.liforma-ew[data-position='bottom-right'][data-state='expanded'],\n.liforma-ew[data-position='bottom-right'][data-state='docked'],\n.liforma-ew[data-position='bottom-left'][data-state='expanded'],\n.liforma-ew[data-position='bottom-left'][data-state='docked'] {\n\twidth: 0;\n\theight: 0;\n\tmin-width: 0;\n\tmin-height: 0;\n\toverflow: visible;\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='expanded'] .liforma-ew__overlay,\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar,\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n\tpointer-events: auto;\n}\n\n.liforma-ew__hit {\n\tbox-sizing: border-box;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont: inherit;\n\tappearance: none;\n\t-webkit-tap-highlight-color: transparent;\n\ttransform: scale(1);\n\ttransform-origin: center center;\n\ttransition:\n\t\ttransform 180ms ease,\n\t\tfilter 180ms ease;\n\twill-change: transform;\n}\n\n/* Author display must not defeat the HTML hidden attribute. */\n.liforma-ew__hit[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__hit:focus-visible {\n\toutline: 2px solid #5b8def;\n\toutline-offset: 3px;\n\tborder-radius: 0.75rem;\n}\n\n@media (hover: hover) and (pointer: fine) {\n\t/* Scale the thumb whenever the collapsed FAB is hovered \u2014 including via the warm iframe hit layer. */\n\t.liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n\t.liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n\t\ttransform: scale(1.06);\n\t}\n\n\t.liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover .liforma-et,\n\t.liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-et {\n\t\tbox-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);\n\t}\n}\n\n.liforma-ew__face {\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n\tposition: relative;\n}\n\n.liforma-ew__face-status {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 1;\n\tdisplay: grid;\n\tplace-items: center;\n\tpadding: 0.5rem;\n\ttext-align: center;\n\tfont: 600 0.75rem/1.3 system-ui, sans-serif;\n\tcolor: #e8ecf4;\n\tbackground: rgba(10, 12, 18, 0.72);\n\tborder-radius: 0.75rem;\n\tpointer-events: none;\n}\n\n.liforma-ew__face-status[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__hit:disabled {\n\tcursor: default;\n\topacity: 0.85;\n}\n\n.liforma-ew__face .liforma-et {\n\tborder-radius: 0.75rem;\n\tbox-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);\n\ttransition: box-shadow 180ms ease;\n}\n\n.liforma-ew__warm {\n\tbox-sizing: border-box;\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 2;\n\tborder-radius: 0.75rem;\n\toverflow: hidden;\n\tbackground: transparent;\n\tpointer-events: none;\n\topacity: 1;\n\ttransition: opacity 1000ms ease;\n}\n\n/*\n * Collapsed: keep the warm iframe as an invisible hit target only.\n * Painting it over the thumb causes a \u201Cghost enlarge\u201D (face scales under a static iframe).\n */\n.liforma-ew[data-state='collapsed'] .liforma-ew__warm {\n\topacity: 0;\n\ttransition: none;\n}\n\n.liforma-ew[data-warm='true'] .liforma-ew__warm {\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-warm='true']:not([data-live='true']) .liforma-ew__hit {\n\tpointer-events: none;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__hit {\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-live='true'] .liforma-ew__warm,\n.liforma-ew[data-live='true'] .liforma-ew__stage {\n\t/* Hidden under the thumb / until post-resize fade-in (matches cold avatar reveal). */\n\topacity: 0;\n}\n\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__stage,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__stage {\n\topacity: 1;\n}\n\n.liforma-ew--session-concealing .liforma-ew__warm,\n.liforma-ew--session-concealing .liforma-ew__stage {\n\ttransition-duration: 280ms;\n}\n\n/* Instant hide while dock/maximize geometry settles (player morph resize ~160ms). */\n.liforma-ew--layout-settling .liforma-ew__warm,\n.liforma-ew--layout-settling .liforma-ew__stage {\n\topacity: 0 !important;\n\ttransition: none !important;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__warm {\n\t/* Keep the live iframe under the thumb; FAB click resumes the shell. */\n\tpointer-events: none;\n\topacity: 0;\n\t/* Instant hide when collapsed so the FAB never shows a resized live mesh. */\n\ttransition: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n\tposition: fixed;\n\t/* Match overlay panel inset so the warm iframe fills the conversation shell. */\n\tinset: clamp(12px, 3vw, 28px);\n\tz-index: 2147483001;\n\twidth: auto;\n\theight: auto;\n\tborder-radius: 16px;\n\tpointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__warm {\n\tposition: fixed;\n\tinset: auto;\n\tz-index: 2147483001;\n\tborder-radius: 16px;\n\tpointer-events: auto;\n\t/* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew__toolbar {\n\tdisplay: none;\n\tposition: fixed;\n\tz-index: 2147483002;\n\tpointer-events: auto;\n\tbox-sizing: border-box;\n\talign-items: center;\n\tgap: 0.35rem;\n\tpadding: 0.35rem 0.4rem;\n\tborder-radius: 999px;\n\tbackground: rgba(12, 14, 20, 0.72);\n\tbackdrop-filter: blur(8px);\n\t-webkit-backdrop-filter: blur(8px);\n\tbox-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n\tdisplay: flex;\n\ttop: calc(clamp(12px, 3vw, 28px) + 10px);\n\tright: calc(clamp(12px, 3vw, 28px) + 10px);\n\tleft: auto;\n\tcursor: default;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n\tdisplay: flex;\n\t/* left/top set inline to track the panel; strip remains a drag handle */\n\tcursor: grab;\n\ttouch-action: none;\n\tuser-select: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__stage {\n\t/* Player also reports surface drags via postMessage when docked. */\n\tcursor: grab;\n\ttouch-action: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar.liforma-ew__toolbar--dragging,\n.liforma-ew--dock-dragging,\n.liforma-ew--dock-dragging .liforma-ew__toolbar,\n.liforma-ew--dock-dragging .liforma-ew__panel,\n.liforma-ew--dock-dragging .liforma-ew__warm,\n.liforma-ew--dock-dragging .liforma-ew__stage {\n\tcursor: grabbing;\n}\n\n\n.liforma-ew__toolbar[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__icon-btn {\n\tappearance: none;\n\tbox-sizing: border-box;\n\tdisplay: inline-grid;\n\tplace-items: center;\n\twidth: 2rem;\n\theight: 2rem;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tborder-radius: 999px;\n\tcolor: #f5f7fb;\n\tbackground: transparent;\n\tcursor: pointer;\n}\n\n.liforma-ew__icon-btn:hover {\n\tbackground: rgba(255, 255, 255, 0.12);\n}\n\n.liforma-ew__icon-btn[aria-pressed='true'] {\n\tbackground: rgba(255, 255, 255, 0.2);\n}\n\n.liforma-ew__icon-btn:focus-visible {\n\toutline: 2px solid #5b8def;\n\toutline-offset: 2px;\n}\n\n.liforma-ew__icon-btn svg {\n\twidth: 1.05rem;\n\theight: 1.05rem;\n\tdisplay: block;\n}\n\n.liforma-ew__drag-grip {\n\tdisplay: none;\n\twidth: 0.85rem;\n\theight: 1.25rem;\n\tmargin: 0 0.15rem 0 0.25rem;\n\tbackground:\n\t\tradial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0 0 / 0.35rem 0.35rem,\n\t\tradial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0.35rem 0 / 0.35rem 0.35rem;\n\tbackground-repeat: repeat-y;\n\topacity: 0.55;\n\tcolor: #f5f7fb;\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__drag-grip {\n\tdisplay: block;\n}\n\n.liforma-ew__dock-toggle[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__overlay {\n\tposition: fixed;\n\tinset: 0;\n\tz-index: 2147483000;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: clamp(12px, 3vw, 28px);\n\tbox-sizing: border-box;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n\tpadding: 0;\n\talign-items: stretch;\n\tjustify-content: stretch;\n\tpointer-events: none;\n\tbackground: transparent;\n}\n\n.liforma-ew__overlay[hidden] {\n\tdisplay: none !important;\n}\n\n.liforma-ew__backdrop {\n\tposition: absolute;\n\tinset: 0;\n\tborder: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbackground: rgba(6, 8, 14, 0.62);\n\tcursor: pointer;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__backdrop {\n\tdisplay: none !important;\n}\n\n.liforma-ew__panel {\n\tposition: relative;\n\tz-index: 1;\n\tdisplay: flex;\n\tflex-direction: column;\n\t/* Fill the overlay so player loading / start UI centers in the visible window. */\n\twidth: var(--liforma-ew-max-w, 100%);\n\theight: var(--liforma-ew-max-h, 100%);\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tborder-radius: 16px;\n\toverflow: hidden;\n\tbackground: #030508;\n\tbox-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);\n\t/* Warm iframe sits above as a sibling; keep panel as chrome shell. */\n\tpointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n\tposition: fixed;\n\tinset: auto;\n\tmax-width: none;\n\tmax-height: none;\n\tpointer-events: auto;\n\t/* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew:not([data-warm='true']) .liforma-ew__panel {\n\tpointer-events: auto;\n}\n\n.liforma-ew__stage {\n\tposition: relative;\n\tflex: 1;\n\tmin-height: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground: #030508;\n\topacity: 1;\n\ttransition: opacity 1000ms ease;\n}\n\n.liforma-ew__status {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 1;\n\tdisplay: grid;\n\tplace-items: center;\n\tpadding: 1.5rem;\n\ttext-align: center;\n\tcolor: #d7dde8;\n\tfont: 500 0.9375rem/1.45 system-ui, sans-serif;\n\tbackground: rgba(3, 5, 8, 0.92);\n\tpointer-events: none;\n}\n\n.liforma-ew__status[hidden] {\n\tdisplay: none !important;\n}\n\n/* Mobile expanded: ~90% viewport, no reduce control. */\n@media (max-width: 767px) {\n\t.liforma-ew[data-state='expanded'] .liforma-ew__overlay {\n\t\tpadding: 5vh 5vw;\n\t}\n\n\t.liforma-ew[data-state='expanded'] .liforma-ew__panel {\n\t\twidth: 90vw;\n\t\theight: 90vh;\n\t\tmax-width: 90vw;\n\t\tmax-height: 90vh;\n\t}\n\n\t.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n\t\tinset: 5vh 5vw;\n\t}\n\n\t.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n\t\ttop: calc(5vh + 10px);\n\t\tright: calc(5vw + 10px);\n\t}\n\n\t.liforma-ew__dock-toggle {\n\t\tdisplay: none !important;\n\t}\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.liforma-ew__hit {\n\t\ttransition: none;\n\t\twill-change: auto;\n\t}\n\n\t.liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n\t.liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n\t\ttransform: none;\n\t}\n\n\t.liforma-ew__face .liforma-et {\n\t\tbox-shadow: none;\n\t\ttransition: none;\n\t}\n\n\t.liforma-ew__warm,\n\t.liforma-ew__stage {\n\t\ttransition: none;\n\t}\n}\n";
|
|
3
3
|
export declare function ensureExperienceWidgetStyles(css?: string): void;
|
|
4
4
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/widget/styles.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/widget/styles.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,4nYAwejC,CAAC;AAIF,wBAAgB,4BAA4B,CAAC,GAAG,GAAE,MAA8B,GAAG,IAAI,CAYtF"}
|
|
@@ -26,7 +26,12 @@ export type ExperienceWidgetOptions = {
|
|
|
26
26
|
readonly offset?: number | string;
|
|
27
27
|
/** Optional authenticated / same-origin mint endpoint (same as Experience). */
|
|
28
28
|
readonly sessionEndpoint?: string;
|
|
29
|
-
|
|
29
|
+
/** BCP 47 locale (preferred). When omitted, defaults to `navigator.language`. */
|
|
30
|
+
readonly locale?: string;
|
|
31
|
+
readonly secondaryLocale?: string;
|
|
32
|
+
readonly learningLocale?: string;
|
|
33
|
+
/** @deprecated Prefer `locale`. */
|
|
34
|
+
readonly language?: 'en' | 'es' | string;
|
|
30
35
|
readonly mode?: ExperienceMode;
|
|
31
36
|
readonly speechInputMode?: SpeechInputMode;
|
|
32
37
|
readonly speechOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/widget/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACX,aAAa,EACb,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAC;AAEjF,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,CAAC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EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACxC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,MAAM,IAAI,IAAI,CAAC;IACf,QAAQ,IAAI,IAAI,CAAC;IACjB,mEAAmE;IACnE,IAAI,IAAI,IAAI,CAAC;IACb,0DAA0D;IAC1D,QAAQ,IAAI,IAAI,CAAC;IACjB,QAAQ,IAAI,IAAI,CAAC;IACjB,OAAO,IAAI,IAAI,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Realtime (WebSocket) → Liforma BYO voice helper.
|
|
3
|
+
*
|
|
4
|
+
* Mount a Liforma Experience (typically `mode="presenter"`, `speechInputMode="off"`),
|
|
5
|
+
* wait until the player has started (audio unlocked), mint an ephemeral client secret
|
|
6
|
+
* on your server, then call this helper.
|
|
7
|
+
*
|
|
8
|
+
* Why WebSocket here: per-turn PCM + transcript match the ElevenLabs createUtterance
|
|
9
|
+
* pattern. OpenAI’s preferred browser media path is WebRTC — see docs for that path.
|
|
10
|
+
*
|
|
11
|
+
* Docs: https://docs.liforma.ai/avatar-experiences/bring-your-own-voice/openai
|
|
12
|
+
*/
|
|
13
|
+
import { type ByoBridge, type ByoConnectCallbacks, type ByoMicCaptureOptions, type ByoPcmExperience } from '@liforma/client/byo';
|
|
14
|
+
export type OpenAiRealtimeExperience = ByoPcmExperience;
|
|
15
|
+
/** Default Realtime model when none is passed. */
|
|
16
|
+
export declare const DEFAULT_OPENAI_REALTIME_MODEL = "gpt-realtime-2.1";
|
|
17
|
+
/** Default OpenAI Realtime voice when none is passed. */
|
|
18
|
+
export declare const DEFAULT_OPENAI_REALTIME_VOICE = "marin";
|
|
19
|
+
/** OpenAI Realtime PCM rate used by this helper. */
|
|
20
|
+
export declare const OPENAI_REALTIME_PCM_RATE = 24000;
|
|
21
|
+
export type ConnectOpenAiRealtimeOptions = ByoConnectCallbacks & ByoMicCaptureOptions & {
|
|
22
|
+
/** Ephemeral client secret from your backend (never ship OPENAI_API_KEY to browsers). */
|
|
23
|
+
readonly ephemeralKey: string;
|
|
24
|
+
readonly model?: string;
|
|
25
|
+
readonly voice?: string;
|
|
26
|
+
/** Session instructions applied via `session.update`. */
|
|
27
|
+
readonly instructions?: string;
|
|
28
|
+
/**
|
|
29
|
+
* When true (default), send `response.create` after `session.updated` so the
|
|
30
|
+
* assistant speaks first. Set false if the host will drive turns itself.
|
|
31
|
+
*/
|
|
32
|
+
readonly autoResponse?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type OpenAiRealtimeBridge = ByoBridge;
|
|
35
|
+
/**
|
|
36
|
+
* Start OpenAI Realtime over WebSocket and pipe agent PCM + transcript into
|
|
37
|
+
* `experience.speech.createUtterance` so the Liforma avatar talks.
|
|
38
|
+
* Captures the host mic by default (Liforma mic stays off).
|
|
39
|
+
*/
|
|
40
|
+
export declare function connectOpenAiRealtime(experience: OpenAiRealtimeExperience, options: ConnectOpenAiRealtimeOptions): Promise<OpenAiRealtimeBridge>;
|
|
41
|
+
//# sourceMappingURL=connectOpenAiRealtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectOpenAiRealtime.d.ts","sourceRoot":"","sources":["../../src/openai/connectOpenAiRealtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAKN,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAExD,kDAAkD;AAClD,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAEhE,yDAAyD;AACzD,eAAO,MAAM,6BAA6B,UAAU,CAAC;AAErD,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,GAC7D,oBAAoB,GAAG;IACtB,yFAAyF;IACzF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAE7C;;;;GAIG;AACH,wBAAsB,qBAAqB,CAC1C,UAAU,EAAE,wBAAwB,EACpC,OAAO,EAAE,4BAA4B,GACnC,OAAO,CAAC,oBAAoB,CAAC,CA4M/B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Realtime (WebRTC) → Liforma BYO voice helper.
|
|
3
|
+
*
|
|
4
|
+
* Preferred browser media path: remote audio track → `createUtterance({ track })`,
|
|
5
|
+
* transcript side-channel on the `oai-events` data channel for force-align lipsync.
|
|
6
|
+
* Do **not** also attach the remote track to an `<audio>` element.
|
|
7
|
+
*
|
|
8
|
+
* Docs: https://docs.liforma.ai/avatar-experiences/bring-your-own-voice/openai
|
|
9
|
+
*/
|
|
10
|
+
import { type ByoBridge, type ByoConnectCallbacks, type ByoMicCaptureOptions, type ByoPcmExperience } from '@liforma/client/byo';
|
|
11
|
+
import { type OpenAiRealtimeExperience } from './connectOpenAiRealtime';
|
|
12
|
+
export type ConnectOpenAiRealtimeWebRtcOptions = ByoConnectCallbacks & ByoMicCaptureOptions & {
|
|
13
|
+
/** Ephemeral client secret from your backend (never ship OPENAI_API_KEY to browsers). */
|
|
14
|
+
readonly ephemeralKey: string;
|
|
15
|
+
readonly model?: string;
|
|
16
|
+
readonly voice?: string;
|
|
17
|
+
/** Session instructions applied via data-channel `session.update`. */
|
|
18
|
+
readonly instructions?: string;
|
|
19
|
+
/**
|
|
20
|
+
* When true (default), send `response.create` after `session.updated` so the
|
|
21
|
+
* assistant speaks first.
|
|
22
|
+
*/
|
|
23
|
+
readonly autoResponse?: boolean;
|
|
24
|
+
/** Sample-rate hint for track capture (OpenAI Realtime audio is typically 24 kHz). */
|
|
25
|
+
readonly sampleRate?: number;
|
|
26
|
+
};
|
|
27
|
+
export type OpenAiRealtimeWebRtcBridge = ByoBridge & {
|
|
28
|
+
readonly peerConnection: RTCPeerConnection;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Start OpenAI Realtime over WebRTC and pipe the remote audio track + transcript
|
|
32
|
+
* into `experience.speech.createUtterance` so the Liforma avatar talks.
|
|
33
|
+
*/
|
|
34
|
+
export declare function connectOpenAiRealtimeWebRtc(experience: OpenAiRealtimeExperience, options: ConnectOpenAiRealtimeWebRtcOptions): Promise<OpenAiRealtimeWebRtcBridge>;
|
|
35
|
+
/** @deprecated Prefer OpenAiRealtimeExperience — same duck type. */
|
|
36
|
+
export type OpenAiRealtimeWebRtcExperience = ByoPcmExperience;
|
|
37
|
+
//# sourceMappingURL=connectOpenAiRealtimeWebRtc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectOpenAiRealtimeWebRtc.d.ts","sourceRoot":"","sources":["../../src/openai/connectOpenAiRealtimeWebRtc.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEN,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIN,KAAK,wBAAwB,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,kCAAkC,GAAG,mBAAmB,GACnE,oBAAoB,GAAG;IACtB,yFAAyF;IACzF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,sFAAsF;IACtF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG;IACpD,QAAQ,CAAC,cAAc,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;GAGG;AACH,wBAAsB,2BAA2B,CAChD,UAAU,EAAE,wBAAwB,EACpC,OAAO,EAAE,kCAAkC,GACzC,OAAO,CAAC,0BAA0B,CAAC,CA+PrC;AAED,oEAAoE;AACpE,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { connectOpenAiRealtime, DEFAULT_OPENAI_REALTIME_MODEL, DEFAULT_OPENAI_REALTIME_VOICE, OPENAI_REALTIME_PCM_RATE, type ConnectOpenAiRealtimeOptions, type OpenAiRealtimeBridge, type OpenAiRealtimeExperience } from './connectOpenAiRealtime';
|
|
2
|
+
export { connectOpenAiRealtimeWebRtc, type ConnectOpenAiRealtimeWebRtcOptions, type OpenAiRealtimeWebRtcBridge, type OpenAiRealtimeWebRtcExperience } from './connectOpenAiRealtimeWebRtc';
|
|
3
|
+
export type { ByoPcmSpeechController as OpenAiSpeechController, ByoSpeechUtterance as OpenAiSpeechUtterance } from '@liforma/client/byo';
|
|
4
|
+
export { MAX_PCM_CHUNK_BYTES, base64ToPcmBytes, floatToPcm16Le, pcmBytesToBase64, resampleFloat32, writePcmInChunks } from '@liforma/client/byo';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,2BAA2B,EAC3B,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,MAAM,+BAA+B,CAAC;AAEvC,YAAY,EACX,sBAAsB,IAAI,sBAAsB,EAChD,kBAAkB,IAAI,qBAAqB,EAC3C,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,MAAM,qBAAqB,CAAC"}
|