@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
package/cjs/client.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { AssistMode, AiGuideCompanionState, BootstrapConfig, ConsentScope, HandoffRecoveryResult, LaunchResult, ExperienceMode, MessengerConversationState } from "./types.js";
|
|
2
|
+
import { type GuideAdmissionResult, type GuideLaunchIntent, type GuideLaunchRecoveryInput, type GuideLaunchRecoveryResult, type GuideLaunchResult, type GuideRecordingLinkInput, type GuideRecordingLinkResult } from "./guideTypes.js";
|
|
3
|
+
import type { LiveControlAuthorization } from "./liveControlChannel.js";
|
|
4
|
+
import type { LiveGuideLaunchIntent } from "./liveGuideAdmission.js";
|
|
2
5
|
export declare class RuntimeClientError extends Error {
|
|
3
6
|
readonly code: string;
|
|
4
7
|
readonly retryable: boolean;
|
|
@@ -88,6 +91,22 @@ export declare class RuntimeClient {
|
|
|
88
91
|
constructor(runtimeUrl: string, clientVersion: string);
|
|
89
92
|
bootstrap(siteKey: string, path: string, anonymousId: string, locale: string, signal: AbortSignal): Promise<BootstrapConfig>;
|
|
90
93
|
launch(input: LaunchInput, signal: AbortSignal): Promise<LaunchResult>;
|
|
94
|
+
bootstrapGuide(installKey: string, path: string, locale: string, signal: AbortSignal): Promise<BootstrapConfig>;
|
|
95
|
+
admitGuide(intent: GuideLaunchIntent, subjectCredential: string | undefined, signal: AbortSignal): Promise<GuideAdmissionResult>;
|
|
96
|
+
admitLiveGuide(intent: LiveGuideLaunchIntent, subjectCredential: string | undefined, signal: AbortSignal): Promise<GuideAdmissionResult & {
|
|
97
|
+
providerProtocol: "live";
|
|
98
|
+
}>;
|
|
99
|
+
launchLiveGuide(intent: LiveGuideLaunchIntent, admissionGrant: string, signal: AbortSignal): Promise<LiveControlAuthorization>;
|
|
100
|
+
endLiveGuide(input: GuideLaunchRecoveryInput, signal?: AbortSignal): Promise<{
|
|
101
|
+
schemaVersion: 3;
|
|
102
|
+
protocolVersion: 2;
|
|
103
|
+
providerProtocol: "live";
|
|
104
|
+
status: "end_requested";
|
|
105
|
+
launchRequestId: string;
|
|
106
|
+
}>;
|
|
107
|
+
launchGuide(intent: GuideLaunchIntent, admissionGrant: string, signal: AbortSignal): Promise<GuideLaunchResult>;
|
|
108
|
+
recoverGuideLaunch(input: GuideLaunchRecoveryInput, signal?: AbortSignal, keepalive?: boolean): Promise<GuideLaunchRecoveryResult>;
|
|
109
|
+
linkGuideRecording(sessionId: string, input: GuideRecordingLinkInput, signal: AbortSignal): Promise<GuideRecordingLinkResult>;
|
|
91
110
|
resume(sessionId: string, credential: string, path: string, protocolVersion: 1 | 2, signal: AbortSignal): Promise<LaunchResult>;
|
|
92
111
|
resumePendingHandoff(sessionId: string, credential: string, path: string, protocolVersion: 1 | 2, messengerBindingChallengeId: string, signal: AbortSignal): Promise<HandoffRecoveryResult>;
|
|
93
112
|
resumeModeUpgrade(input: ModeUpgradeResumeInput, signal: AbortSignal): Promise<LaunchResult>;
|
package/cjs/client.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RuntimeClient = exports.idempotencyKey = exports.isValidAssistSessionGrant = exports.isValidReplaySessionId = exports.MAX_ASSIST_SESSION_GRANT_LENGTH = exports.RuntimeClientError = void 0;
|
|
4
|
+
const guideTypes_js_1 = require("./guideTypes.js");
|
|
4
5
|
class RuntimeClientError extends Error {
|
|
5
6
|
constructor(code, message, retryable, retryAfterMs, status) {
|
|
6
7
|
super(message);
|
|
@@ -134,6 +135,7 @@ class RuntimeClient {
|
|
|
134
135
|
: {}),
|
|
135
136
|
...shared,
|
|
136
137
|
capabilitySummary: {
|
|
138
|
+
ctaOffer: true,
|
|
137
139
|
microphone: input.microphone,
|
|
138
140
|
webrtc: typeof RTCPeerConnection !== "undefined",
|
|
139
141
|
audioPlayback: typeof HTMLAudioElement !== "undefined",
|
|
@@ -150,6 +152,7 @@ class RuntimeClient {
|
|
|
150
152
|
protocolVersion: 1,
|
|
151
153
|
...shared,
|
|
152
154
|
capabilitySummary: {
|
|
155
|
+
ctaOffer: true,
|
|
153
156
|
microphone: input.microphone,
|
|
154
157
|
webrtc: typeof RTCPeerConnection !== "undefined",
|
|
155
158
|
reducedMotion: input.reducedMotion,
|
|
@@ -159,12 +162,56 @@ class RuntimeClient {
|
|
|
159
162
|
"Idempotency-Key": input.idempotencyKey,
|
|
160
163
|
}, signal);
|
|
161
164
|
}
|
|
165
|
+
async bootstrapGuide(installKey, path, locale, signal) {
|
|
166
|
+
if (!guideTypes_js_1.GUIDE_INSTALL_KEY_PATTERN.test(installKey))
|
|
167
|
+
throw new Error("Invalid AI Guide installation key.");
|
|
168
|
+
const url = new URL(`${this.baseUrl}/ai-live-assist/v1/public/bootstrap`);
|
|
169
|
+
url.searchParams.set("installKey", installKey);
|
|
170
|
+
url.searchParams.set("path", path);
|
|
171
|
+
url.searchParams.set("locale", boundedLocale(locale));
|
|
172
|
+
const response = await fetch(url, {
|
|
173
|
+
method: "GET",
|
|
174
|
+
mode: "cors",
|
|
175
|
+
credentials: "omit",
|
|
176
|
+
cache: "no-store",
|
|
177
|
+
headers: {
|
|
178
|
+
Accept: "application/json",
|
|
179
|
+
"X-Oxvo-Ai-Client-Version": this.clientVersion,
|
|
180
|
+
"X-Request-Id": requestId(),
|
|
181
|
+
},
|
|
182
|
+
signal,
|
|
183
|
+
});
|
|
184
|
+
return this.parseJson(response);
|
|
185
|
+
}
|
|
186
|
+
async admitGuide(intent, subjectCredential, signal) {
|
|
187
|
+
return this.postJson("/ai-live-assist/v1/public/admissions", { ...intent, ...(subjectCredential ? { subjectCredential } : {}) }, {}, signal);
|
|
188
|
+
}
|
|
189
|
+
async admitLiveGuide(intent, subjectCredential, signal) {
|
|
190
|
+
return this.postJson("/ai-live-assist/v1/public/live/admissions", { ...intent, ...(subjectCredential ? { subjectCredential } : {}) }, {}, signal);
|
|
191
|
+
}
|
|
192
|
+
async launchLiveGuide(intent, admissionGrant, signal) {
|
|
193
|
+
return this.postJson("/ai-live-assist/v1/public/live/launch", { ...intent, admissionGrant }, { "Idempotency-Key": intent.launchRequestId }, signal);
|
|
194
|
+
}
|
|
195
|
+
async endLiveGuide(input, signal) {
|
|
196
|
+
return this.postJson("/ai-live-assist/v1/public/live/launches/end", input, {}, signal, true);
|
|
197
|
+
}
|
|
198
|
+
async launchGuide(intent, admissionGrant, signal) {
|
|
199
|
+
return this.postJson("/ai-live-assist/v1/public/launch", { ...intent, admissionGrant }, { "Idempotency-Key": intent.launchRequestId }, signal);
|
|
200
|
+
}
|
|
201
|
+
async recoverGuideLaunch(input, signal, keepalive = false) {
|
|
202
|
+
return this.postJson("/ai-live-assist/v1/public/launches/recover", input, {}, signal, keepalive);
|
|
203
|
+
}
|
|
204
|
+
async linkGuideRecording(sessionId, input, signal) {
|
|
205
|
+
return this.postJson(`/ai-live-assist/v1/public/sessions/${encodeURIComponent(sessionId)}/recording-link`, input, {}, signal);
|
|
206
|
+
}
|
|
162
207
|
async resume(sessionId, credential, path, protocolVersion, signal) {
|
|
163
208
|
const request = this.postJson(`/ai-live-assist/v1/public/sessions/${encodeURIComponent(sessionId)}/resume`, {
|
|
164
209
|
schemaVersion: protocolVersion,
|
|
165
210
|
protocolVersion,
|
|
166
211
|
path,
|
|
167
212
|
reason: "navigation",
|
|
213
|
+
clientVersion: this.clientVersion,
|
|
214
|
+
ctaOffer: true,
|
|
168
215
|
}, { Authorization: `Bearer ${credential}` }, signal);
|
|
169
216
|
try {
|
|
170
217
|
return await request;
|
|
@@ -186,6 +233,8 @@ class RuntimeClient {
|
|
|
186
233
|
protocolVersion,
|
|
187
234
|
path,
|
|
188
235
|
reason: "handoff_recovery",
|
|
236
|
+
clientVersion: this.clientVersion,
|
|
237
|
+
ctaOffer: true,
|
|
189
238
|
messengerBindingChallengeId,
|
|
190
239
|
}, { Authorization: `Bearer ${credential}` }, signal);
|
|
191
240
|
}
|
|
@@ -206,6 +255,8 @@ class RuntimeClient {
|
|
|
206
255
|
protocolVersion: input.protocolVersion,
|
|
207
256
|
path: input.path,
|
|
208
257
|
reason: "mode_upgrade",
|
|
258
|
+
clientVersion: this.clientVersion,
|
|
259
|
+
ctaOffer: true,
|
|
209
260
|
modeUpgradeRequestId: input.requestId,
|
|
210
261
|
}, {
|
|
211
262
|
Authorization: `Bearer ${input.resumeCredential}`,
|
package/cjs/context.d.ts
CHANGED
|
@@ -24,7 +24,10 @@ export declare class PageContextCollector {
|
|
|
24
24
|
private captureTimer;
|
|
25
25
|
private mutationCaptureTimer;
|
|
26
26
|
private targetIds;
|
|
27
|
+
private pageScrollIds;
|
|
27
28
|
private navigationTargetBindings;
|
|
29
|
+
private fieldTargetBindings;
|
|
30
|
+
private fieldAppliedRevisions;
|
|
28
31
|
private textIds;
|
|
29
32
|
private optionIds;
|
|
30
33
|
private targets;
|
|
@@ -34,6 +37,8 @@ export declare class PageContextCollector {
|
|
|
34
37
|
private pendingNavigation;
|
|
35
38
|
private pendingCapture;
|
|
36
39
|
private deferredNavigation;
|
|
40
|
+
private releasedNavigation;
|
|
41
|
+
private releasedNavigationSettlement;
|
|
37
42
|
private navigationSettlementGeneration;
|
|
38
43
|
private navigationSettlement;
|
|
39
44
|
private recentSelection;
|
|
@@ -47,19 +52,36 @@ export declare class PageContextCollector {
|
|
|
47
52
|
captureAndPublish(): Promise<PageContextSnapshot | null>;
|
|
48
53
|
capture(): PageContextSnapshot;
|
|
49
54
|
private captureSnapshot;
|
|
55
|
+
private assessSelectorRegions;
|
|
56
|
+
private pageScrollAvailable;
|
|
57
|
+
private capturePageScrollTargets;
|
|
50
58
|
captureVisualContext(): VisualContextCapture | null;
|
|
51
59
|
execute(grant: ActionGrant, authorityIsCurrent?: () => boolean): Promise<ActionExecutionResult>;
|
|
52
60
|
completeActionExecution(actionId: string): Promise<string | null>;
|
|
61
|
+
/**
|
|
62
|
+
* Replays the exact approved link after its action result is durable. This
|
|
63
|
+
* gives same-document routers (including Framer) their normal click and
|
|
64
|
+
* overlay-close lifecycle. A slow or ignored router click fails closed so
|
|
65
|
+
* an active voice session is never destroyed by an unrequested reload.
|
|
66
|
+
*/
|
|
67
|
+
activateReleasedNavigation(url: string): Promise<'settled' | 'timed_out' | 'rejected'>;
|
|
53
68
|
private click;
|
|
54
69
|
private type;
|
|
55
70
|
private select;
|
|
56
71
|
private submit;
|
|
57
72
|
private safeState;
|
|
73
|
+
private scrollTargetIntoView;
|
|
74
|
+
private waitForScrollSettlement;
|
|
58
75
|
private actionApplied;
|
|
59
76
|
private clippedGeometry;
|
|
60
77
|
private scheduleCapture;
|
|
61
78
|
private scheduleMutationCapture;
|
|
62
79
|
private scheduleViewportCapture;
|
|
80
|
+
private mutationNodeIsInsideTrustedGuide;
|
|
81
|
+
private mutationIsInsideTrustedGuide;
|
|
82
|
+
private mutationNodeTouchesSemanticContext;
|
|
83
|
+
private mutationNodeContainsSemanticContext;
|
|
84
|
+
private mutationNeedsImmediateCapture;
|
|
63
85
|
private handleMutations;
|
|
64
86
|
private captureAndPublishIfChanged;
|
|
65
87
|
private semanticSignature;
|
|
@@ -71,8 +93,8 @@ export declare class PageContextCollector {
|
|
|
71
93
|
private observeCausalNavigationAfterMutation;
|
|
72
94
|
private reportCausalNavigationObservation;
|
|
73
95
|
private resetBoundTargetIds;
|
|
96
|
+
private finishReleasedNavigationSettlement;
|
|
74
97
|
private installNavigationHooks;
|
|
75
98
|
private restoreNavigationHooks;
|
|
76
|
-
private reducedMotion;
|
|
77
99
|
}
|
|
78
100
|
export {};
|