@oxvo/ai-live-assist 7.4.50 → 7.5.0
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/cjs/AiLiveAssist.d.ts +76 -11
- package/cjs/AiLiveAssist.js +1771 -298
- package/cjs/client.d.ts +19 -0
- package/cjs/client.js +51 -0
- package/cjs/context.d.ts +23 -1
- package/cjs/context.js +713 -126
- package/cjs/control.d.ts +2 -0
- package/cjs/control.js +42 -3
- package/cjs/ctaOffer.d.ts +11 -0
- package/cjs/ctaOffer.js +185 -0
- package/cjs/dialogFocusScope.js +1 -1
- package/cjs/guideAdmission.d.ts +46 -0
- package/cjs/guideAdmission.js +397 -0
- package/cjs/guideHost.d.ts +47 -0
- package/cjs/guideHost.js +48 -0
- package/cjs/guideInstallation.d.ts +12 -0
- package/cjs/guideInstallation.js +60 -0
- package/cjs/guideInstaller.d.ts +4 -0
- package/cjs/guideInstaller.js +116 -0
- package/cjs/guideMount.d.ts +22 -0
- package/cjs/guideMount.js +84 -0
- package/cjs/guideRecording.d.ts +64 -0
- package/cjs/guideRecording.js +176 -0
- package/cjs/guideRecordingSession.d.ts +35 -0
- package/cjs/guideRecordingSession.js +167 -0
- package/cjs/guideSubjectStore.d.ts +32 -0
- package/cjs/guideSubjectStore.js +105 -0
- package/cjs/guideTypes.d.ts +117 -0
- package/cjs/guideTypes.js +15 -0
- package/cjs/index.d.ts +6 -0
- package/cjs/index.js +25 -11
- package/cjs/liveAudioProcessor.d.ts +92 -0
- package/cjs/liveAudioProcessor.js +269 -0
- package/cjs/liveAudioQueue.d.ts +40 -0
- package/cjs/liveAudioQueue.js +130 -0
- package/cjs/liveAudioWorklet.d.ts +1 -0
- package/cjs/liveAudioWorklet.js +63 -0
- package/cjs/liveBrowserDetector.d.ts +16 -0
- package/cjs/liveBrowserDetector.js +75 -0
- package/cjs/liveBrowserDetectorWorker.d.ts +1 -0
- package/cjs/liveBrowserDetectorWorker.js +72 -0
- package/cjs/liveControlChannel.d.ts +176 -0
- package/cjs/liveControlChannel.js +829 -0
- package/cjs/liveDuplexMedia.d.ts +204 -0
- package/cjs/liveDuplexMedia.js +740 -0
- package/cjs/liveGuideAdmission.d.ts +21 -0
- package/cjs/liveGuideAdmission.js +94 -0
- package/cjs/liveGuideWidget.d.ts +68 -0
- package/cjs/liveGuideWidget.js +451 -0
- package/cjs/liveSpeechAssets.d.ts +36 -0
- package/cjs/liveSpeechAssets.js +39 -0
- package/cjs/liveSpeechCaptureBridge.d.ts +32 -0
- package/cjs/liveSpeechCaptureBridge.js +140 -0
- package/cjs/liveSpeechDetector.d.ts +62 -0
- package/cjs/liveSpeechDetector.js +206 -0
- package/cjs/liveSpeechModel.d.ts +46 -0
- package/cjs/liveSpeechModel.js +105 -0
- package/cjs/liveSpeechResampler.d.ts +22 -0
- package/cjs/liveSpeechResampler.js +93 -0
- package/cjs/liveSpeechWorker.d.ts +56 -0
- package/cjs/liveSpeechWorker.js +143 -0
- package/cjs/locales/resources.js +568 -8
- package/cjs/media.d.ts +11 -0
- package/cjs/media.js +78 -9
- package/cjs/messages.js +22 -8
- package/cjs/pageAssistancePreference.d.ts +15 -3
- package/cjs/pageAssistancePreference.js +46 -7
- package/cjs/preview.d.ts +4 -1
- package/cjs/preview.js +42 -1
- package/cjs/recording.d.ts +12 -0
- package/cjs/recording.js +150 -0
- package/cjs/standalone.d.ts +6 -0
- package/cjs/standalone.js +12 -0
- package/cjs/types.d.ts +31 -5
- package/cjs/types.js +14 -0
- package/cjs/ui.d.ts +128 -4
- package/cjs/ui.js +1918 -276
- package/cjs/version.d.ts +1 -1
- package/cjs/version.js +1 -1
- package/cjs/voicePresenceUi.d.ts +52 -4
- package/cjs/voicePresenceUi.js +659 -57
- package/lib/AiLiveAssist.d.ts +76 -11
- package/lib/AiLiveAssist.js +1772 -299
- package/lib/client.d.ts +19 -0
- package/lib/client.js +51 -0
- package/lib/context.d.ts +23 -1
- package/lib/context.js +713 -126
- package/lib/control.d.ts +2 -0
- package/lib/control.js +42 -3
- package/lib/ctaOffer.d.ts +11 -0
- package/lib/ctaOffer.js +179 -0
- package/lib/dialogFocusScope.js +1 -1
- package/lib/guideAdmission.d.ts +46 -0
- package/lib/guideAdmission.js +392 -0
- package/lib/guideHost.d.ts +47 -0
- package/lib/guideHost.js +42 -0
- package/lib/guideInstallation.d.ts +12 -0
- package/lib/guideInstallation.js +56 -0
- package/lib/guideInstaller.d.ts +4 -0
- package/lib/guideInstaller.js +113 -0
- package/lib/guideMount.d.ts +22 -0
- package/lib/guideMount.js +77 -0
- package/lib/guideRecording.d.ts +64 -0
- package/lib/guideRecording.js +172 -0
- package/lib/guideRecordingSession.d.ts +35 -0
- package/lib/guideRecordingSession.js +163 -0
- package/lib/guideSubjectStore.d.ts +32 -0
- package/lib/guideSubjectStore.js +101 -0
- package/lib/guideTypes.d.ts +117 -0
- package/lib/guideTypes.js +11 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +21 -10
- package/lib/liveAudioProcessor.d.ts +92 -0
- package/lib/liveAudioProcessor.js +265 -0
- package/lib/liveAudioQueue.d.ts +40 -0
- package/lib/liveAudioQueue.js +126 -0
- package/lib/liveAudioWorklet.d.ts +1 -0
- package/lib/liveAudioWorklet.js +61 -0
- package/lib/liveBrowserDetector.d.ts +16 -0
- package/lib/liveBrowserDetector.js +71 -0
- package/lib/liveBrowserDetectorWorker.d.ts +1 -0
- package/lib/liveBrowserDetectorWorker.js +70 -0
- package/lib/liveControlChannel.d.ts +176 -0
- package/lib/liveControlChannel.js +825 -0
- package/lib/liveDuplexMedia.d.ts +204 -0
- package/lib/liveDuplexMedia.js +736 -0
- package/lib/liveGuideAdmission.d.ts +21 -0
- package/lib/liveGuideAdmission.js +90 -0
- package/lib/liveGuideWidget.d.ts +68 -0
- package/lib/liveGuideWidget.js +447 -0
- package/lib/liveSpeechAssets.d.ts +36 -0
- package/lib/liveSpeechAssets.js +35 -0
- package/lib/liveSpeechCaptureBridge.d.ts +32 -0
- package/lib/liveSpeechCaptureBridge.js +136 -0
- package/lib/liveSpeechDetector.d.ts +62 -0
- package/lib/liveSpeechDetector.js +202 -0
- package/lib/liveSpeechModel.d.ts +46 -0
- package/lib/liveSpeechModel.js +101 -0
- package/lib/liveSpeechResampler.d.ts +22 -0
- package/lib/liveSpeechResampler.js +89 -0
- package/lib/liveSpeechWorker.d.ts +56 -0
- package/lib/liveSpeechWorker.js +137 -0
- package/lib/locales/resources.js +568 -8
- package/lib/media.d.ts +11 -0
- package/lib/media.js +77 -8
- package/lib/messages.js +22 -8
- package/lib/pageAssistancePreference.d.ts +15 -3
- package/lib/pageAssistancePreference.js +46 -7
- package/lib/preview.d.ts +4 -1
- package/lib/preview.js +42 -1
- package/lib/recording.d.ts +12 -0
- package/lib/recording.js +146 -0
- package/lib/standalone.d.ts +6 -0
- package/lib/standalone.js +6 -0
- package/lib/types.d.ts +31 -5
- package/lib/types.js +14 -0
- package/lib/ui.d.ts +128 -4
- package/lib/ui.js +1919 -277
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/voicePresenceUi.d.ts +52 -4
- package/lib/voicePresenceUi.js +659 -57
- package/package.json +16 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { type LiveDuplexMediaOptions, type LiveDuplexMediaDependencies } from './liveDuplexMedia.js';
|
|
2
|
+
export declare const LIVE_CONTROL_CLIENT_VERSION = "7.5.0";
|
|
3
|
+
export declare const LIVE_CONTROL_CLIENT_CAPABILITIES: readonly ["live_duplex_v1", "live_local_wake_v1", "live_fragment_captions_v1"];
|
|
4
|
+
declare const phases: readonly ["voice_off", "local_listening", "wake_buffering", "starting", "active", "tentative_idle", "closing", "uncertain", "muted", "suspended", "budget_blocked", "ended"];
|
|
5
|
+
export type LiveControlState = {
|
|
6
|
+
phase: typeof phases[number];
|
|
7
|
+
captureEpoch: number;
|
|
8
|
+
requiresUserGesture: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type LiveControlChannelFailure = 'ended' | 'aborted' | 'protocol' | 'transport' | 'timeout' | 'expired' | 'media';
|
|
11
|
+
export type LiveControlPrivacyFence = 'mute' | 'pause' | 'hidden' | 'permission_lost' | 'audio_suspended' | 'mode_change';
|
|
12
|
+
export interface LiveControlAuthorization {
|
|
13
|
+
schemaVersion: 3;
|
|
14
|
+
protocolVersion: 2;
|
|
15
|
+
providerProtocol: 'live';
|
|
16
|
+
status: 'control_authorized';
|
|
17
|
+
projectId: number;
|
|
18
|
+
guideId: string;
|
|
19
|
+
subjectId: string;
|
|
20
|
+
sessionId: string;
|
|
21
|
+
launchRequestId: string;
|
|
22
|
+
controlCredential: string;
|
|
23
|
+
controlUrl: string;
|
|
24
|
+
controlExpiresAt: string;
|
|
25
|
+
logicalDeadlineAt: string;
|
|
26
|
+
}
|
|
27
|
+
export interface LiveControlClock {
|
|
28
|
+
now(): number;
|
|
29
|
+
wallNow(): number;
|
|
30
|
+
schedule(callback: () => void, milliseconds: number): unknown;
|
|
31
|
+
cancel(timer: unknown): void;
|
|
32
|
+
}
|
|
33
|
+
type MediaOptions = Omit<LiveDuplexMediaOptions, 'dependencies' | 'onMetadata' | 'onFailSafeClose'> & {
|
|
34
|
+
dependencies: Omit<LiveDuplexMediaDependencies, 'isAnswerAuthorized' | 'isPcmActivationAuthorized' | 'isTerminalAuthorized'>;
|
|
35
|
+
};
|
|
36
|
+
export interface LiveControlChannelOptions {
|
|
37
|
+
authorization: LiveControlAuthorization;
|
|
38
|
+
/** Trusted configured API origin, not an origin learned from the launch URL. */
|
|
39
|
+
trustedRuntimeOrigin: string;
|
|
40
|
+
tabId: string;
|
|
41
|
+
media: MediaOptions;
|
|
42
|
+
clock?: LiveControlClock;
|
|
43
|
+
createWebSocket?: (url: string, protocols: string[]) => WebSocket;
|
|
44
|
+
randomUUID?: () => string;
|
|
45
|
+
onState(state: LiveControlState): void;
|
|
46
|
+
onClose(reason: LiveControlChannelFailure): void;
|
|
47
|
+
onRepeatAfterReady?(reason: 'wake_deadline' | 'wake_capacity' | 'start_limit' | 'detector_unhealthy'): void;
|
|
48
|
+
onTextAnswer?(value: {
|
|
49
|
+
taskId: string;
|
|
50
|
+
inputEpoch: number;
|
|
51
|
+
text: string;
|
|
52
|
+
}): void;
|
|
53
|
+
onTranscript?(value: {
|
|
54
|
+
streamId: string;
|
|
55
|
+
eventId: string;
|
|
56
|
+
role: 'user' | 'assistant';
|
|
57
|
+
startMs: number;
|
|
58
|
+
endMs: number;
|
|
59
|
+
text: string;
|
|
60
|
+
}): void;
|
|
61
|
+
onTaskState?(value: {
|
|
62
|
+
taskId: string | null;
|
|
63
|
+
inputEpoch: number;
|
|
64
|
+
status: 'working' | 'waiting' | 'blocked' | 'cancelled' | 'failed' | 'fresh_task_required';
|
|
65
|
+
}): void;
|
|
66
|
+
}
|
|
67
|
+
export type LiveControlReady = Readonly<{
|
|
68
|
+
fencingToken: number;
|
|
69
|
+
authorityGeneration: number;
|
|
70
|
+
commandEpoch: number;
|
|
71
|
+
credentialExpiresAt: string;
|
|
72
|
+
logicalDeadlineAt: string;
|
|
73
|
+
}>;
|
|
74
|
+
/** Dedicated Live voice bridge. It performs no HTTP/provider/financial calls,
|
|
75
|
+
* reconnect, session reconstruction, feature enablement or speech inference.
|
|
76
|
+
* Caller-provided capture reports must come from actual current detector/media
|
|
77
|
+
* observations; this class never invents a heartbeat or speech result. */
|
|
78
|
+
export declare class LiveControlChannel {
|
|
79
|
+
private readonly options;
|
|
80
|
+
private readonly clock;
|
|
81
|
+
private readonly authorization;
|
|
82
|
+
private credential;
|
|
83
|
+
private readonly url;
|
|
84
|
+
private readonly lifetime;
|
|
85
|
+
private readonly proofs;
|
|
86
|
+
private readonly hardFencedMedia;
|
|
87
|
+
private readonly outbound;
|
|
88
|
+
private readonly usedOperations;
|
|
89
|
+
private readonly barriers;
|
|
90
|
+
private pendingCommands;
|
|
91
|
+
private readonly cleanups;
|
|
92
|
+
private socket;
|
|
93
|
+
private media;
|
|
94
|
+
private attempt;
|
|
95
|
+
private pendingWake;
|
|
96
|
+
private ready;
|
|
97
|
+
private connectResolve;
|
|
98
|
+
private connectReject;
|
|
99
|
+
private detachExternal;
|
|
100
|
+
private connectedOnce;
|
|
101
|
+
private closed;
|
|
102
|
+
private sequence;
|
|
103
|
+
private serverSequence;
|
|
104
|
+
private serverEpoch;
|
|
105
|
+
private commandEpoch;
|
|
106
|
+
private captureEpoch;
|
|
107
|
+
private requiresGesture;
|
|
108
|
+
private voicePrepared;
|
|
109
|
+
private lastNow;
|
|
110
|
+
private readonly originalMono;
|
|
111
|
+
private readonly originalWall;
|
|
112
|
+
private deadline;
|
|
113
|
+
private connectionTimer;
|
|
114
|
+
private expiryTimer;
|
|
115
|
+
constructor(options: LiveControlChannelOptions);
|
|
116
|
+
connect(signal: AbortSignal): Promise<LiveControlReady>;
|
|
117
|
+
/** Call directly in the visitor's gesture; no microphone is acquired by connect. */
|
|
118
|
+
prepareVoice(input: {
|
|
119
|
+
captureEpoch: number;
|
|
120
|
+
operationId: string;
|
|
121
|
+
requestInitialGreeting: boolean;
|
|
122
|
+
playbackAuthorized: boolean;
|
|
123
|
+
signal: AbortSignal;
|
|
124
|
+
}): Promise<void>;
|
|
125
|
+
reportCapture(input: {
|
|
126
|
+
captureEpoch: number;
|
|
127
|
+
sequence: number;
|
|
128
|
+
speaking: boolean;
|
|
129
|
+
playing: boolean;
|
|
130
|
+
}): void;
|
|
131
|
+
wake(input: {
|
|
132
|
+
operationId: string;
|
|
133
|
+
captureEpoch: number;
|
|
134
|
+
reason: 'speech' | 'spoken_response';
|
|
135
|
+
bufferedMs: number;
|
|
136
|
+
}): void;
|
|
137
|
+
submitText(input: {
|
|
138
|
+
inputId: string;
|
|
139
|
+
inputEpoch: number;
|
|
140
|
+
text: string;
|
|
141
|
+
}): void;
|
|
142
|
+
stop(): void;
|
|
143
|
+
fence(reason: LiveControlPrivacyFence): void;
|
|
144
|
+
end(): void;
|
|
145
|
+
private now;
|
|
146
|
+
private assertReady;
|
|
147
|
+
private armExpiry;
|
|
148
|
+
private command;
|
|
149
|
+
private priority;
|
|
150
|
+
private write;
|
|
151
|
+
private receive;
|
|
152
|
+
private acceptReady;
|
|
153
|
+
private handle;
|
|
154
|
+
private beginWake;
|
|
155
|
+
private armAttempt;
|
|
156
|
+
private offer;
|
|
157
|
+
private wakeBinding;
|
|
158
|
+
private binding;
|
|
159
|
+
private attempts;
|
|
160
|
+
private findWake;
|
|
161
|
+
private findGeneration;
|
|
162
|
+
private current;
|
|
163
|
+
private proof;
|
|
164
|
+
private authorized;
|
|
165
|
+
private metadata;
|
|
166
|
+
private stopAttempt;
|
|
167
|
+
private retire;
|
|
168
|
+
private finishRetirement;
|
|
169
|
+
private ackRetired;
|
|
170
|
+
private dropUnpaid;
|
|
171
|
+
private mediaClosed;
|
|
172
|
+
private failAttempt;
|
|
173
|
+
private suppressPlayback;
|
|
174
|
+
private close;
|
|
175
|
+
}
|
|
176
|
+
export {};
|