@oxvo/ai-live-assist 7.3.4 → 7.4.23

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.
Files changed (67) hide show
  1. package/cjs/AiLiveAssist.d.ts +588 -6
  2. package/cjs/AiLiveAssist.js +14892 -1240
  3. package/cjs/client.d.ts +71 -10
  4. package/cjs/client.js +316 -58
  5. package/cjs/context.d.ts +15 -5
  6. package/cjs/context.js +568 -73
  7. package/cjs/control.d.ts +72 -7
  8. package/cjs/control.js +594 -71
  9. package/cjs/dialogFocusScope.d.ts +37 -0
  10. package/cjs/dialogFocusScope.js +227 -0
  11. package/cjs/experienceState.js +1 -1
  12. package/cjs/index.d.ts +1 -1
  13. package/cjs/index.js +2 -2
  14. package/cjs/media.d.ts +14 -3
  15. package/cjs/media.js +128 -19
  16. package/cjs/messages.js +26 -3
  17. package/cjs/messengerLoader.d.ts +3 -0
  18. package/cjs/messengerLoader.js +156 -0
  19. package/cjs/pageAssistancePreference.d.ts +78 -0
  20. package/cjs/pageAssistancePreference.js +488 -0
  21. package/cjs/preview.d.ts +33 -0
  22. package/cjs/preview.js +567 -0
  23. package/cjs/tabLock.d.ts +54 -3
  24. package/cjs/tabLock.js +752 -72
  25. package/cjs/types.d.ts +152 -4
  26. package/cjs/ui.d.ts +200 -10
  27. package/cjs/ui.js +6946 -523
  28. package/cjs/version.d.ts +1 -1
  29. package/cjs/version.js +1 -1
  30. package/cjs/voicePresenceUi.d.ts +48 -9
  31. package/cjs/voicePresenceUi.js +863 -125
  32. package/lib/AiLiveAssist.d.ts +588 -6
  33. package/lib/AiLiveAssist.js +14897 -1248
  34. package/lib/client.d.ts +71 -10
  35. package/lib/client.js +313 -57
  36. package/lib/context.d.ts +15 -5
  37. package/lib/context.js +566 -72
  38. package/lib/control.d.ts +72 -7
  39. package/lib/control.js +594 -71
  40. package/lib/dialogFocusScope.d.ts +37 -0
  41. package/lib/dialogFocusScope.js +223 -0
  42. package/lib/experienceState.js +1 -1
  43. package/lib/index.d.ts +1 -1
  44. package/lib/index.js +2 -2
  45. package/lib/media.d.ts +14 -3
  46. package/lib/media.js +128 -19
  47. package/lib/messages.js +26 -3
  48. package/lib/messengerLoader.d.ts +3 -0
  49. package/lib/messengerLoader.js +151 -0
  50. package/lib/pageAssistancePreference.d.ts +78 -0
  51. package/lib/pageAssistancePreference.js +482 -0
  52. package/lib/preview.d.ts +33 -0
  53. package/lib/preview.js +561 -0
  54. package/lib/tabLock.d.ts +54 -3
  55. package/lib/tabLock.js +752 -72
  56. package/lib/types.d.ts +152 -4
  57. package/lib/ui.d.ts +200 -10
  58. package/lib/ui.js +6947 -524
  59. package/lib/version.d.ts +1 -1
  60. package/lib/version.js +1 -1
  61. package/lib/voicePresenceUi.d.ts +48 -9
  62. package/lib/voicePresenceUi.js +863 -125
  63. package/package.json +8 -3
  64. package/cjs/recordingPolicy.d.ts +0 -2
  65. package/cjs/recordingPolicy.js +0 -12
  66. package/lib/recordingPolicy.d.ts +0 -2
  67. package/lib/recordingPolicy.js +0 -8
@@ -0,0 +1,488 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageAssistancePreferenceStore = exports.PageAssistanceRecoveryStore = exports.digestPageAssistanceVisitor = exports.MAX_PAGE_ASSISTANCE_RECOVERY_TTL_MS = exports.MAX_PAGE_ASSISTANCE_PREFERENCE_TTL_MS = void 0;
4
+ const STORAGE_PREFIX = "__oxvo_ai_live_assist_page_assistance_v1_";
5
+ const STORAGE_RECORD_VERSION = 1;
6
+ const STORAGE_RECORD_KIND = "page_assistance_receipt";
7
+ const MAX_STORAGE_RECORD_LENGTH = 8192;
8
+ const MAX_RECEIPT_LENGTH = 512;
9
+ const MIN_RECEIPT_LENGTH = 32;
10
+ const MAX_SITE_KEY_LENGTH = 256;
11
+ const MAX_VISITOR_ID_LENGTH = 512;
12
+ const RECOVERY_STORAGE_PREFIX = "__oxvo_ai_live_assist_page_assistance_recovery_v1_";
13
+ const RECOVERY_RECORD_KIND = "page_assistance_recovery";
14
+ const MAX_RECOVERY_RECORD_LENGTH = 2048;
15
+ const OPAQUE_ID_PATTERN = /^[A-Za-z0-9_.:-]{8,128}$/;
16
+ const CHECKSUM_PATTERN = /^[0-9a-f]{64}$/;
17
+ exports.MAX_PAGE_ASSISTANCE_PREFERENCE_TTL_MS = 180 * 24 * 60 * 60 * 1000;
18
+ exports.MAX_PAGE_ASSISTANCE_RECOVERY_TTL_MS = 5 * 60 * 1000;
19
+ const validBoundedString = (value, maximum) => typeof value === "string" &&
20
+ value.length > 0 &&
21
+ value.length <= maximum &&
22
+ value.trim() === value &&
23
+ !/[\u0000-\u001f\u007f]/.test(value);
24
+ const validPositiveInteger = (value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0;
25
+ const validNonNegativeInteger = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
26
+ const validOrigin = (value) => {
27
+ if (!validBoundedString(value, 2048))
28
+ return false;
29
+ try {
30
+ const parsed = new URL(value);
31
+ return ((parsed.protocol === "https:" || parsed.protocol === "http:") &&
32
+ parsed.origin === value);
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ };
38
+ const validSiteKey = (value) => validBoundedString(value, MAX_SITE_KEY_LENGTH) &&
39
+ /^[A-Za-z0-9_.:-]+$/.test(value);
40
+ const validVisitorDigest = (value) => typeof value === "string" && /^sha256:[0-9a-f]{64}$/.test(value);
41
+ const validReceipt = (value) => typeof value === "string" &&
42
+ value.length >= MIN_RECEIPT_LENGTH &&
43
+ value.length <= MAX_RECEIPT_LENGTH &&
44
+ /^[A-Za-z0-9_-]+$/.test(value);
45
+ const validExpiry = (value, now) => {
46
+ if (typeof value !== "string" || value.length > 64)
47
+ return false;
48
+ const expiresAt = Date.parse(value);
49
+ return (Number.isFinite(expiresAt) &&
50
+ expiresAt > now &&
51
+ expiresAt <= now + exports.MAX_PAGE_ASSISTANCE_PREFERENCE_TTL_MS);
52
+ };
53
+ const parseBinding = (value) => {
54
+ if (!value || typeof value !== "object" || Array.isArray(value))
55
+ return null;
56
+ const candidate = value;
57
+ if (!validOrigin(candidate.origin) ||
58
+ !validSiteKey(candidate.siteKey) ||
59
+ !validVisitorDigest(candidate.visitorDigest) ||
60
+ !validPositiveInteger(candidate.schemaVersion) ||
61
+ !validPositiveInteger(candidate.configRevision) ||
62
+ !validPositiveInteger(candidate.policyVersion) ||
63
+ candidate.capability !== "browser_control") {
64
+ return null;
65
+ }
66
+ return {
67
+ origin: candidate.origin,
68
+ siteKey: candidate.siteKey,
69
+ visitorDigest: candidate.visitorDigest,
70
+ schemaVersion: candidate.schemaVersion,
71
+ configRevision: candidate.configRevision,
72
+ policyVersion: candidate.policyVersion,
73
+ capability: "browser_control",
74
+ };
75
+ };
76
+ const sameBinding = (left, right) => left.origin === right.origin &&
77
+ left.siteKey === right.siteKey &&
78
+ left.visitorDigest === right.visitorDigest &&
79
+ left.schemaVersion === right.schemaVersion &&
80
+ left.configRevision === right.configRevision &&
81
+ left.policyVersion === right.policyVersion &&
82
+ left.capability === right.capability;
83
+ const sameReceipt = (left, right) => left?.receipt === right?.receipt && left?.expiresAt === right?.expiresAt;
84
+ const defaultStorage = () => {
85
+ try {
86
+ return typeof localStorage === "undefined" ? null : localStorage;
87
+ }
88
+ catch {
89
+ return null;
90
+ }
91
+ };
92
+ const defaultEventTarget = () => typeof window === "undefined" ? null : window;
93
+ const defaultSessionStorage = () => {
94
+ try {
95
+ return typeof sessionStorage === "undefined" ? null : sessionStorage;
96
+ }
97
+ catch {
98
+ return null;
99
+ }
100
+ };
101
+ const canonicalJson = (value) => JSON.stringify(Object.fromEntries(Object.entries(value).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0)));
102
+ const recoveryDigest = async (value, subtle) => {
103
+ if (!subtle)
104
+ return null;
105
+ try {
106
+ const input = new TextEncoder().encode(canonicalJson({
107
+ version: 1,
108
+ kind: RECOVERY_RECORD_KIND,
109
+ ...value,
110
+ }));
111
+ const digest = new Uint8Array(await subtle.digest("SHA-256", input));
112
+ if (digest.byteLength !== 32)
113
+ return null;
114
+ return Array.from(digest, (byte) => byte.toString(16).padStart(2, "0")).join("");
115
+ }
116
+ catch {
117
+ return null;
118
+ }
119
+ };
120
+ const validRecoveryInput = (value, now) => OPAQUE_ID_PATTERN.test(value.sessionId ?? "") &&
121
+ OPAQUE_ID_PATTERN.test(value.tabId ?? "") &&
122
+ OPAQUE_ID_PATTERN.test(value.bindingGeneration ?? "") &&
123
+ OPAQUE_ID_PATTERN.test(value.requestId ?? "") &&
124
+ CHECKSUM_PATTERN.test(value.proposalChecksum ?? "") &&
125
+ validNonNegativeInteger(value.authorityEpoch) &&
126
+ (value.decision === "allow_session" ||
127
+ value.decision === "allow_persistent") &&
128
+ ((value.decision === "allow_session" && value.persistentReceipt === null) ||
129
+ (value.decision === "allow_persistent" &&
130
+ (value.persistentReceipt === null ||
131
+ validReceipt(value.persistentReceipt)))) &&
132
+ validPositiveInteger(value.configRevision) &&
133
+ validPositiveInteger(value.policyVersion) &&
134
+ validPositiveInteger(value.expiresAt) &&
135
+ value.expiresAt > now &&
136
+ value.expiresAt <= now + exports.MAX_PAGE_ASSISTANCE_RECOVERY_TTL_MS;
137
+ const sameRecovery = (left, right) => left.sessionId === right.sessionId &&
138
+ left.tabId === right.tabId &&
139
+ left.bindingGeneration === right.bindingGeneration &&
140
+ left.requestId === right.requestId &&
141
+ left.proposalChecksum === right.proposalChecksum &&
142
+ left.authorityEpoch === right.authorityEpoch &&
143
+ left.decision === right.decision &&
144
+ left.persistentReceipt === right.persistentReceipt &&
145
+ left.configRevision === right.configRevision &&
146
+ left.policyVersion === right.policyVersion &&
147
+ left.expiresAt === right.expiresAt &&
148
+ left.submissionDigest === right.submissionDigest;
149
+ const digestPageAssistanceVisitor = async (visitorId, subtle = globalThis.crypto?.subtle) => {
150
+ if (!validBoundedString(visitorId, MAX_VISITOR_ID_LENGTH) ||
151
+ visitorId.length < 8 ||
152
+ !subtle) {
153
+ return null;
154
+ }
155
+ try {
156
+ const input = new TextEncoder().encode(`oxvo:page-assistance:visitor:v1\u0000${visitorId}`);
157
+ const digest = new Uint8Array(await subtle.digest("SHA-256", input));
158
+ if (digest.byteLength !== 32)
159
+ return null;
160
+ const hex = Array.from(digest, (byte) => byte.toString(16).padStart(2, "0")).join("");
161
+ return `sha256:${hex}`;
162
+ }
163
+ catch {
164
+ return null;
165
+ }
166
+ };
167
+ exports.digestPageAssistanceVisitor = digestPageAssistanceVisitor;
168
+ class PageAssistanceRecoveryStore {
169
+ constructor(siteKey, options = {}) {
170
+ this.key = validSiteKey(siteKey)
171
+ ? `${RECOVERY_STORAGE_PREFIX}${encodeURIComponent(siteKey)}`
172
+ : null;
173
+ this.storage =
174
+ options.storage === undefined ? defaultSessionStorage() : options.storage;
175
+ this.now = options.now ?? Date.now;
176
+ this.subtle = options.subtle ?? globalThis.crypto?.subtle;
177
+ }
178
+ async remember(value, isCurrent) {
179
+ if (!isCurrent() ||
180
+ !this.key ||
181
+ !this.storage ||
182
+ !validRecoveryInput(value, this.now())) {
183
+ return null;
184
+ }
185
+ const submissionDigest = await recoveryDigest(value, this.subtle);
186
+ if (!isCurrent() || !submissionDigest)
187
+ return null;
188
+ const receipt = {
189
+ ...value,
190
+ submissionDigest,
191
+ };
192
+ const record = {
193
+ version: 1,
194
+ kind: RECOVERY_RECORD_KIND,
195
+ ...receipt,
196
+ };
197
+ try {
198
+ const serialized = JSON.stringify(record);
199
+ if (serialized.length > MAX_RECOVERY_RECORD_LENGTH)
200
+ return null;
201
+ if (!isCurrent())
202
+ return null;
203
+ this.storage.setItem(this.key, serialized);
204
+ const stored = await this.read();
205
+ if (!isCurrent())
206
+ return null;
207
+ return stored && sameRecovery(stored, receipt) ? stored : null;
208
+ }
209
+ catch {
210
+ return null;
211
+ }
212
+ }
213
+ storedRecordPresent() {
214
+ if (!this.key || !this.storage)
215
+ return null;
216
+ try {
217
+ return this.storage.getItem(this.key) !== null;
218
+ }
219
+ catch {
220
+ return null;
221
+ }
222
+ }
223
+ async read() {
224
+ if (!this.key || !this.storage)
225
+ return null;
226
+ let encoded = null;
227
+ try {
228
+ encoded = this.storage.getItem(this.key);
229
+ if (!encoded || encoded.length > MAX_RECOVERY_RECORD_LENGTH) {
230
+ if (encoded)
231
+ this.clearIfUnchanged(encoded);
232
+ return null;
233
+ }
234
+ const candidate = JSON.parse(encoded);
235
+ const recoveryCandidate = candidate;
236
+ const expectedKeys = [
237
+ "authorityEpoch",
238
+ "bindingGeneration",
239
+ "configRevision",
240
+ "decision",
241
+ "expiresAt",
242
+ "kind",
243
+ "persistentReceipt",
244
+ "policyVersion",
245
+ "proposalChecksum",
246
+ "requestId",
247
+ "sessionId",
248
+ "submissionDigest",
249
+ "tabId",
250
+ "version",
251
+ ];
252
+ if (Object.keys(candidate).sort().join("|") !== expectedKeys.join("|") ||
253
+ candidate.version !== 1 ||
254
+ candidate.kind !== RECOVERY_RECORD_KIND ||
255
+ !validRecoveryInput(recoveryCandidate, this.now()) ||
256
+ !CHECKSUM_PATTERN.test(candidate.submissionDigest ?? "")) {
257
+ this.clearIfUnchanged(encoded);
258
+ return null;
259
+ }
260
+ const value = {
261
+ sessionId: recoveryCandidate.sessionId,
262
+ tabId: recoveryCandidate.tabId,
263
+ bindingGeneration: recoveryCandidate.bindingGeneration,
264
+ requestId: recoveryCandidate.requestId,
265
+ proposalChecksum: recoveryCandidate.proposalChecksum,
266
+ authorityEpoch: recoveryCandidate.authorityEpoch,
267
+ decision: recoveryCandidate.decision,
268
+ persistentReceipt: recoveryCandidate.persistentReceipt,
269
+ configRevision: recoveryCandidate.configRevision,
270
+ policyVersion: recoveryCandidate.policyVersion,
271
+ expiresAt: recoveryCandidate.expiresAt,
272
+ };
273
+ const submissionDigest = await recoveryDigest(value, this.subtle);
274
+ if (!submissionDigest ||
275
+ submissionDigest !== candidate.submissionDigest) {
276
+ this.clearIfUnchanged(encoded);
277
+ return null;
278
+ }
279
+ return { ...value, submissionDigest };
280
+ }
281
+ catch {
282
+ if (encoded)
283
+ this.clearIfUnchanged(encoded);
284
+ return null;
285
+ }
286
+ }
287
+ consume(submissionDigest) {
288
+ if (!CHECKSUM_PATTERN.test(submissionDigest) ||
289
+ !this.key ||
290
+ !this.storage) {
291
+ return false;
292
+ }
293
+ try {
294
+ const encoded = this.storage.getItem(this.key);
295
+ if (!encoded)
296
+ return false;
297
+ if (encoded.length > MAX_RECOVERY_RECORD_LENGTH)
298
+ return false;
299
+ const candidate = JSON.parse(encoded);
300
+ if (candidate.submissionDigest !== submissionDigest)
301
+ return false;
302
+ if (this.storage.getItem(this.key) !== encoded)
303
+ return false;
304
+ this.storage.removeItem(this.key);
305
+ return this.storage.getItem(this.key) === null;
306
+ }
307
+ catch {
308
+ return false;
309
+ }
310
+ }
311
+ clearIfUnchanged(expected) {
312
+ if (!this.key || !this.storage)
313
+ return;
314
+ try {
315
+ if (this.storage.getItem(this.key) === expected) {
316
+ this.storage.removeItem(this.key);
317
+ }
318
+ }
319
+ catch {
320
+ // A concurrent replacement must never be removed on stale read failure.
321
+ }
322
+ }
323
+ clear() {
324
+ if (!this.key || !this.storage)
325
+ return;
326
+ try {
327
+ this.storage.removeItem(this.key);
328
+ }
329
+ catch {
330
+ // Permission recovery is optional and fails closed without storage.
331
+ }
332
+ }
333
+ }
334
+ exports.PageAssistanceRecoveryStore = PageAssistanceRecoveryStore;
335
+ class PageAssistancePreferenceStore {
336
+ constructor(binding, options = {}) {
337
+ this.listeners = new Set();
338
+ this.lastKnownReceipt = null;
339
+ this.destroyed = false;
340
+ this.onStorage = (event) => {
341
+ if (this.destroyed ||
342
+ !this.key ||
343
+ (event.key !== this.key && event.key !== null) ||
344
+ (event.storageArea !== null && event.storageArea !== this.storage)) {
345
+ return;
346
+ }
347
+ const previous = event.key === this.key
348
+ ? (this.parse(event.oldValue) ?? this.lastKnownReceipt)
349
+ : this.lastKnownReceipt;
350
+ let value = null;
351
+ if (event.key === this.key) {
352
+ value = this.parse(event.newValue);
353
+ }
354
+ else if (this.storage) {
355
+ try {
356
+ value = this.parse(this.storage.getItem(this.key));
357
+ }
358
+ catch {
359
+ value = null;
360
+ }
361
+ }
362
+ this.notify(value, previous);
363
+ };
364
+ this.binding = parseBinding(binding);
365
+ this.key = this.binding
366
+ ? `${STORAGE_PREFIX}${encodeURIComponent(this.binding.siteKey)}`
367
+ : null;
368
+ this.storage =
369
+ options.storage === undefined ? defaultStorage() : options.storage;
370
+ this.eventTarget =
371
+ options.eventTarget === undefined
372
+ ? defaultEventTarget()
373
+ : options.eventTarget;
374
+ this.now = options.now ?? Date.now;
375
+ if (this.key)
376
+ this.eventTarget?.addEventListener("storage", this.onStorage);
377
+ }
378
+ read() {
379
+ if (this.destroyed || !this.key || !this.storage)
380
+ return null;
381
+ try {
382
+ const value = this.parse(this.storage.getItem(this.key));
383
+ this.lastKnownReceipt = value;
384
+ return value;
385
+ }
386
+ catch {
387
+ this.lastKnownReceipt = null;
388
+ return null;
389
+ }
390
+ }
391
+ remember(value) {
392
+ if (this.destroyed ||
393
+ !this.binding ||
394
+ !this.key ||
395
+ !this.storage ||
396
+ !validReceipt(value.receipt) ||
397
+ !validExpiry(value.expiresAt, this.now())) {
398
+ return false;
399
+ }
400
+ const previous = this.read();
401
+ const record = {
402
+ version: STORAGE_RECORD_VERSION,
403
+ kind: STORAGE_RECORD_KIND,
404
+ binding: this.binding,
405
+ receipt: value.receipt,
406
+ expiresAt: value.expiresAt,
407
+ };
408
+ try {
409
+ const serialized = JSON.stringify(record);
410
+ if (serialized.length > MAX_STORAGE_RECORD_LENGTH)
411
+ return false;
412
+ this.storage.setItem(this.key, serialized);
413
+ const stored = this.read();
414
+ if (stored?.receipt !== value.receipt ||
415
+ stored.expiresAt !== value.expiresAt) {
416
+ return false;
417
+ }
418
+ this.notify(stored, previous);
419
+ return true;
420
+ }
421
+ catch {
422
+ return false;
423
+ }
424
+ }
425
+ clear() {
426
+ if (this.destroyed || !this.key || !this.storage)
427
+ return;
428
+ const previous = this.read();
429
+ try {
430
+ this.storage.removeItem(this.key);
431
+ }
432
+ catch {
433
+ return;
434
+ }
435
+ this.notify(null, previous);
436
+ }
437
+ subscribe(listener) {
438
+ if (this.destroyed)
439
+ return () => undefined;
440
+ this.listeners.add(listener);
441
+ return () => this.listeners.delete(listener);
442
+ }
443
+ destroy() {
444
+ if (this.destroyed)
445
+ return;
446
+ this.destroyed = true;
447
+ this.eventTarget?.removeEventListener("storage", this.onStorage);
448
+ this.listeners.clear();
449
+ }
450
+ parse(value) {
451
+ if (!value || value.length > MAX_STORAGE_RECORD_LENGTH || !this.binding) {
452
+ return null;
453
+ }
454
+ try {
455
+ const candidate = JSON.parse(value);
456
+ const binding = parseBinding(candidate.binding);
457
+ if (candidate.version !== STORAGE_RECORD_VERSION ||
458
+ candidate.kind !== STORAGE_RECORD_KIND ||
459
+ !binding ||
460
+ !sameBinding(binding, this.binding) ||
461
+ !validReceipt(candidate.receipt) ||
462
+ !validExpiry(candidate.expiresAt, this.now())) {
463
+ return null;
464
+ }
465
+ return {
466
+ receipt: candidate.receipt,
467
+ expiresAt: candidate.expiresAt,
468
+ };
469
+ }
470
+ catch {
471
+ return null;
472
+ }
473
+ }
474
+ notify(value, previous) {
475
+ this.lastKnownReceipt = value;
476
+ if (sameReceipt(value, previous))
477
+ return;
478
+ for (const listener of this.listeners) {
479
+ try {
480
+ listener(value, previous);
481
+ }
482
+ catch {
483
+ // Consumer callbacks cannot interrupt permission revocation.
484
+ }
485
+ }
486
+ }
487
+ }
488
+ exports.PageAssistancePreferenceStore = PageAssistancePreferenceStore;
@@ -0,0 +1,33 @@
1
+ import type { AiGuidePreviewBridge, AiGuidePreviewController, AiGuidePreviewControllerState, AiGuidePreviewInput, BootstrapConfig } from "./types.js";
2
+ export declare const AI_GUIDE_PREVIEW_PARENT_SOURCE = "oxvo-ai-guide-settings-preview";
3
+ export declare const AI_GUIDE_PREVIEW_WIDGET_SOURCE = "oxvo-ai-guide-widget-preview";
4
+ export declare const AI_GUIDE_PREVIEW_PROTOCOL_VERSION = 1;
5
+ export declare const AI_GUIDE_PREVIEW_RENDERER_VERSION = "1.0.27";
6
+ export declare const buildAiGuidePreviewBootstrap: (draft: unknown) => BootstrapConfig;
7
+ export declare class AiGuidePreviewControllerImpl implements AiGuidePreviewController {
8
+ private readonly port;
9
+ private readonly nonce;
10
+ private view;
11
+ private config;
12
+ private display;
13
+ private mode;
14
+ private destroyed;
15
+ private rendering;
16
+ constructor(port: MessagePort, nonce: string);
17
+ update(input: AiGuidePreviewInput): void;
18
+ getState(): AiGuidePreviewControllerState;
19
+ destroy(): void;
20
+ private resolveMode;
21
+ private resolveModeForConfig;
22
+ private hasInteractiveMode;
23
+ private scheduleRender;
24
+ private callbacks;
25
+ private render;
26
+ private blockNavigation;
27
+ private onMessage;
28
+ private post;
29
+ }
30
+ export declare const installAiGuidePreview: (options: {
31
+ parentOrigin: string;
32
+ nonce: string;
33
+ }, currentWindow?: Window) => AiGuidePreviewBridge | undefined;