@lavitre/apps 1.49.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.
Files changed (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +121 -0
  3. package/dist/Common/AiChannel.d.ts +59 -0
  4. package/dist/Common/AiChannel.js +97 -0
  5. package/dist/Common/AiChannel.js.map +1 -0
  6. package/dist/Common/BlobStore.d.ts +44 -0
  7. package/dist/Common/BlobStore.js +186 -0
  8. package/dist/Common/BlobStore.js.map +1 -0
  9. package/dist/Common/Common.Model.d.ts +1020 -0
  10. package/dist/Common/Common.Model.js +21 -0
  11. package/dist/Common/Common.Model.js.map +1 -0
  12. package/dist/Common/CrdtChannel.d.ts +198 -0
  13. package/dist/Common/CrdtChannel.js +659 -0
  14. package/dist/Common/CrdtChannel.js.map +1 -0
  15. package/dist/Common/Version.d.ts +21 -0
  16. package/dist/Common/Version.js +62 -0
  17. package/dist/Common/Version.js.map +1 -0
  18. package/dist/Common/index.d.ts +6 -0
  19. package/dist/Common/index.js +32 -0
  20. package/dist/Common/index.js.map +1 -0
  21. package/dist/CompanionConnector/CompanionConnector.Model.d.ts +85 -0
  22. package/dist/CompanionConnector/CompanionConnector.Model.js +17 -0
  23. package/dist/CompanionConnector/CompanionConnector.Model.js.map +1 -0
  24. package/dist/CompanionConnector/CompanionConnector.d.ts +28 -0
  25. package/dist/CompanionConnector/CompanionConnector.js +385 -0
  26. package/dist/CompanionConnector/CompanionConnector.js.map +1 -0
  27. package/dist/CompanionConnector/index.d.ts +2 -0
  28. package/dist/CompanionConnector/index.js +3 -0
  29. package/dist/CompanionConnector/index.js.map +1 -0
  30. package/dist/CompanionFrame/CompanionFrame.d.ts +103 -0
  31. package/dist/CompanionFrame/CompanionFrame.js +100 -0
  32. package/dist/CompanionFrame/CompanionFrame.js.map +1 -0
  33. package/dist/CompanionFrame/index.d.ts +1 -0
  34. package/dist/CompanionFrame/index.js +2 -0
  35. package/dist/CompanionFrame/index.js.map +1 -0
  36. package/dist/Connector/Connector.Model.d.ts +567 -0
  37. package/dist/Connector/Connector.Model.js +2 -0
  38. package/dist/Connector/Connector.Model.js.map +1 -0
  39. package/dist/Connector/Connector.d.ts +227 -0
  40. package/dist/Connector/Connector.js +1337 -0
  41. package/dist/Connector/Connector.js.map +1 -0
  42. package/dist/Connector/index.d.ts +2 -0
  43. package/dist/Connector/index.js +3 -0
  44. package/dist/Connector/index.js.map +1 -0
  45. package/dist/Frame/Frame.Model.d.ts +533 -0
  46. package/dist/Frame/Frame.Model.js +2 -0
  47. package/dist/Frame/Frame.Model.js.map +1 -0
  48. package/dist/Frame/Frame.d.ts +309 -0
  49. package/dist/Frame/Frame.js +1408 -0
  50. package/dist/Frame/Frame.js.map +1 -0
  51. package/dist/Frame/SyncAdapter.d.ts +75 -0
  52. package/dist/Frame/SyncAdapter.js +134 -0
  53. package/dist/Frame/SyncAdapter.js.map +1 -0
  54. package/dist/Frame/index.d.ts +3 -0
  55. package/dist/Frame/index.js +4 -0
  56. package/dist/Frame/index.js.map +1 -0
  57. package/dist/MediaLink/MediaLink.d.ts +178 -0
  58. package/dist/MediaLink/MediaLink.js +1432 -0
  59. package/dist/MediaLink/MediaLink.js.map +1 -0
  60. package/dist/MediaLink/index.d.ts +1 -0
  61. package/dist/MediaLink/index.js +2 -0
  62. package/dist/MediaLink/index.js.map +1 -0
  63. package/dist/Native/index.d.ts +170 -0
  64. package/dist/Native/index.js +19 -0
  65. package/dist/Native/index.js.map +1 -0
  66. package/dist/Version.d.ts +1 -0
  67. package/dist/Version.js +2 -0
  68. package/dist/Version.js.map +1 -0
  69. package/package.json +76 -0
@@ -0,0 +1,533 @@
1
+ import type { AiInboundMessage, AiOutboundMessage, AppMessage, BluetoothFromApp, BluetoothToApp, BorderOptions, ChangePrivacy, ChangeTeamSpace, ChangeTeamSpaceGuest, CompanionFramePeerJoined, CompanionFramePeerLeft, CompanionFramePeersUpdated, ConnectedMediaDevice, ConnectionCodeUpdated, Device, DeviceFrameReference, DeviceFullscreenUpdated, DeviceJoined, DeviceLeft, DeviceMessageReceived, DevicePrivacyChanged, DeviceScalingUpdated, DisconnectGuests, EnumerateLoadedFrames, EnumerateLoadedFramesCompleted, EventTelemetry, FieldUpdated, FileData, CompanionInformation, FrameTouchMode, GetStats, HideNotification, HostInformation, I18nMap, Interaction, KnockKnock, LayoutPosition, LocalConnectorMessageReceived, MenuClicked, MenuEntry, NotificationButtonClicked, NotificationDismissed, NotificationInfo, PendingDevicesInfo, PositionUpdated, PrivacyChanged, Rect, RequestSerialPortAccess, SerialPortAccessResult, RequestStreamSizeUpdate, ResizeMode, SaveSettings, SendKnockKnock, SendMessageTo, SendMessageToAll, SendToLocalFrame, SendToSerialPort, SetReducedAudioMode, SettingsUpdated, SetVisibility, ShareDataRequest, ShareFileRequest, Size, StartEventTelemetry, StateReplaced, StatsResponse, StreamCapture, UpdateState, VideoContentHint, ViewMode, VisibilityChanged, VitreSettings, VitreSettingsSetter, VoiceAction, VoiceActionDetection } from '../Common/index.js';
2
+ import type { MediaTrackInfo, ReplaceShareStream, ShareStream, ShareStreamCompleted, ShareStreamTrack, StopShareStream } from '../Connector/Connector.Model.js';
3
+ export type SharedStreamAvailable = {
4
+ streamId: string;
5
+ tracks: ShareStreamTrack[];
6
+ };
7
+ export type SharedStreamRemoved = {
8
+ streamId: string;
9
+ };
10
+ export type AvailableExportSource = {
11
+ supportedFormats: string[];
12
+ label: I18nMap;
13
+ fileSuffix?: string;
14
+ fileExtension?: string;
15
+ binaryHeader?: ArrayBufferLike;
16
+ tag?: any;
17
+ id: string;
18
+ menu?: MenuEntry[];
19
+ /**
20
+ * SDK 1.46 — whether this export source is offered to connected
21
+ * companions. Defaults to `true`.
22
+ *
23
+ * When `false` the Vitre never advertises the source to a companion, so
24
+ * it appears in no companion menu: neither "share to another app" nor
25
+ * "download to this device". The Vitre's own export menu is unaffected.
26
+ *
27
+ * Use it for sources that only make sense on the Vitre (huge payloads,
28
+ * formats a phone cannot open, host-local side effects).
29
+ */
30
+ availableForCompanion?: boolean;
31
+ };
32
+ export type LoadingFileData = {
33
+ id: string;
34
+ name: string;
35
+ mime: string;
36
+ };
37
+ export type InitFrameOptions = {
38
+ frameConnectorId: string;
39
+ streamId?: string;
40
+ name: string;
41
+ url: string;
42
+ size: Size;
43
+ minSize?: Size;
44
+ maxSize?: Size;
45
+ touchMode: FrameTouchMode;
46
+ allowFullscreen: boolean;
47
+ resizeMode: ResizeMode;
48
+ data?: any;
49
+ file?: FileData;
50
+ border: BorderOptions;
51
+ syncedTimeOffset: number;
52
+ };
53
+ export type InitializeFrame = {
54
+ hostInfo: HostInformation;
55
+ /**
56
+ * The companion's own identity/runtime context, present only when this
57
+ * frame is loaded by a la Vitre **companion** (mirrors
58
+ * `hostInfo.isCompanion`). Surfaced as `frame.companionInformation`.
59
+ * Undefined on Vitre-side frames. Added 1.19.
60
+ */
61
+ companionInfo?: CompanionInformation;
62
+ initiator: Device;
63
+ id: string;
64
+ appId?: string;
65
+ options: InitFrameOptions;
66
+ isFullscreen: boolean;
67
+ /**
68
+ * @deprecated Use options.border.mode
69
+ */
70
+ isBorderless: boolean;
71
+ state?: Record<string, any>;
72
+ position: Rect;
73
+ };
74
+ export type FrameDefaultMenuCategory = {
75
+ type: 'defaultMenu';
76
+ label?: string;
77
+ description?: string;
78
+ order?: number;
79
+ };
80
+ export type FrameMenuCategory = {
81
+ type: 'iconMenu';
82
+ } | FrameDefaultMenuCategory;
83
+ export type FrameMenuEntry = Omit<MenuEntry, 'category'> & {
84
+ category?: FrameMenuCategory;
85
+ };
86
+ export type SetFrameMenu = {
87
+ menu: FrameMenuEntry[];
88
+ };
89
+ export type ViewOptions = {
90
+ name: string;
91
+ minSize?: Size;
92
+ maxSize?: Size;
93
+ size?: Size;
94
+ /**
95
+ * @deprecated Use interaction property
96
+ */
97
+ touchMode?: FrameTouchMode;
98
+ allowFullscreen?: boolean;
99
+ hideMenu?: boolean;
100
+ resizeMode?: ResizeMode;
101
+ menu?: FrameMenuEntry[];
102
+ exportSources?: AvailableExportSource[];
103
+ /**
104
+ * @deprecated Use interaction property
105
+ */
106
+ interactionEnabled?: boolean;
107
+ interaction?: Interaction;
108
+ mode?: ViewMode;
109
+ closable?: boolean;
110
+ closeLabel?: string;
111
+ };
112
+ export type FrameInitialized = {
113
+ options: ViewOptions;
114
+ };
115
+ export type SetFullscreen = {
116
+ type: 'setFullscreen';
117
+ };
118
+ export type SetWindowed = {
119
+ type: 'setWindowed';
120
+ };
121
+ /**
122
+ * Replace the video track of THIS frame's shared stream with a new
123
+ * `getUserMedia` capture (e.g. switch camera) while keeping the same share
124
+ * (same `sharedStreamId`) — results in a `replaceTrack` on the host, no
125
+ * WebRTC renegotiation. The host applies an `{ exact }` deviceId constraint.
126
+ */
127
+ export type ReplaceFrameStream = {
128
+ requestId: string;
129
+ constraints: MediaStreamConstraints;
130
+ };
131
+ export type ApplyStreamAdvancedConstraints = {
132
+ streamId?: string;
133
+ contentHint?: VideoContentHint;
134
+ whiteBalanceMode?: string;
135
+ focusMode?: string;
136
+ resizeMode?: string;
137
+ exposureMode?: string;
138
+ colorTemperature?: number;
139
+ exposureCompensation?: number;
140
+ brightness?: number;
141
+ contrast?: number;
142
+ exposureTime?: number;
143
+ saturation?: number;
144
+ sharpness?: number;
145
+ focusDistance?: number;
146
+ width?: number;
147
+ height?: number;
148
+ mirror?: boolean;
149
+ };
150
+ export type IsInteractingChanged = {
151
+ isInteracting: boolean;
152
+ };
153
+ export type FileProgress = {
154
+ bytes: number;
155
+ totalBytes: number;
156
+ };
157
+ export type FileLoaded = {
158
+ file: ArrayBufferLike;
159
+ };
160
+ export type SetExportSources = {
161
+ /**
162
+ * The full replacement list. Was mistyped as a single
163
+ * `AvailableExportSource` until 1.47; the host has always decoded an
164
+ * array here (`Decode.array` on the `setExportSources` message), so no
165
+ * emitter can have relied on the singular form — nothing shipped could
166
+ * send this message before 1.47 anyway, `Frame.setExportSources` being
167
+ * the first emitter.
168
+ */
169
+ exportSources: AvailableExportSource[];
170
+ };
171
+ export type ExportRequest = {
172
+ id: string;
173
+ format?: string;
174
+ tag?: any;
175
+ exportSourceId: string;
176
+ menuId?: string;
177
+ };
178
+ export type ExportData = {
179
+ format: string;
180
+ name: string;
181
+ buffer: ArrayBufferLike;
182
+ };
183
+ export type ExportDone = {
184
+ request: ExportRequest;
185
+ data?: ExportData;
186
+ error?: string;
187
+ };
188
+ export type SetSize = {
189
+ width: number;
190
+ height: number;
191
+ };
192
+ export type BorderlessUpdated = {
193
+ isBorderless: boolean;
194
+ };
195
+ export type FullscreenUpdated = {
196
+ isFullscreen: boolean;
197
+ };
198
+ export type UpdateFrameName = {
199
+ name: string;
200
+ };
201
+ export type UpdateName = {
202
+ name: string;
203
+ };
204
+ export type SharedStreamPlayState = 'playing' | 'paused';
205
+ export type LocalSharedStreamUpdate = {
206
+ volume: number;
207
+ };
208
+ export type StreamAction = {
209
+ action: 'play';
210
+ } | {
211
+ action: 'pause';
212
+ } | {
213
+ action: 'seek';
214
+ position: number;
215
+ isRelative: boolean;
216
+ } | {
217
+ action: 'volume';
218
+ volume: number;
219
+ muted: boolean;
220
+ };
221
+ export type FrameApiMessagesIn = ({
222
+ type: 'enumerateLoadedFramesCompleted';
223
+ } & EnumerateLoadedFramesCompleted) | ({
224
+ type: 'initialize';
225
+ } & InitializeFrame) | ({
226
+ type: 'deviceJoined';
227
+ } & DeviceJoined) | ({
228
+ type: 'deviceLeft';
229
+ } & DeviceLeft) | ({
230
+ type: 'deviceMessageReceived';
231
+ } & DeviceMessageReceived) | ({
232
+ type: 'localConnectorMessageReceived';
233
+ } & LocalConnectorMessageReceived) | ({
234
+ type: 'menuClicked';
235
+ } & MenuClicked) | ({
236
+ type: 'fieldUpdated';
237
+ } & FieldUpdated) | ({
238
+ type: 'privacyChanged';
239
+ } & PrivacyChanged) | ({
240
+ type: 'isInteractingChanged';
241
+ } & IsInteractingChanged) | ({
242
+ type: 'fileLoaded';
243
+ } & FileLoaded) | ({
244
+ type: 'fileProgress';
245
+ } & FileProgress) | ({
246
+ type: 'exportRequest';
247
+ } & ExportRequest) | ({
248
+ type: 'vitreSettingsResponse';
249
+ } & VitreSettings) | ({
250
+ type: 'knockKnockReceived';
251
+ } & KnockKnock) | ({
252
+ type: 'settingsUpdated';
253
+ } & SettingsUpdated) | ({
254
+ type: 'vitreSettingsUpdated';
255
+ } & VitreSettings) | ({
256
+ type: 'notificationDismissed';
257
+ } & NotificationDismissed) | ({
258
+ type: 'notificationButtonClicked';
259
+ } & NotificationButtonClicked) | ({
260
+ type: 'devicePrivacyChanged';
261
+ } & DevicePrivacyChanged) | ({
262
+ type: 'deviceFrameUnloaded';
263
+ } & DeviceFrameReference) | ({
264
+ type: 'deviceFrameLoaded';
265
+ } & DeviceFrameReference) | ({
266
+ type: 'deviceFrameConnectorLoaded';
267
+ } & DeviceFrameReference) | ({
268
+ type: 'pendingDevicesConnectionRequested';
269
+ } & PendingDevicesInfo) | ({
270
+ type: 'borderlessUpdated';
271
+ } & BorderlessUpdated) | ({
272
+ type: 'fullscreenUpdated';
273
+ } & FullscreenUpdated) | ({
274
+ type: 'borderOptionsUpdated';
275
+ } & BorderOptions) | ({
276
+ type: 'voiceActionDetected';
277
+ } & VoiceActionDetection) | {
278
+ type: 'streamFrameCapturedResponse';
279
+ requestId: string;
280
+ response?: StreamCapture;
281
+ error: string;
282
+ } | {
283
+ type: 'replaceFrameStreamCompleted';
284
+ requestId: string;
285
+ tracks?: MediaTrackInfo[];
286
+ error?: string;
287
+ } | ({
288
+ type: 'stateReplaced';
289
+ } & StateReplaced) | ({
290
+ type: 'deviceFullscreenUpdated';
291
+ } & DeviceFullscreenUpdated) | ({
292
+ type: 'visibilityChanged';
293
+ } & VisibilityChanged) | ({
294
+ type: 'positionUpdated';
295
+ } & PositionUpdated) | ({
296
+ type: 'deviceScalingUpdated';
297
+ } & DeviceScalingUpdated) | ({
298
+ type: 'updateFrameName';
299
+ } & UpdateFrameName) | ({
300
+ type: 'localSharedStreamUpdate';
301
+ } & LocalSharedStreamUpdate) | ({
302
+ type: 'statsResponse';
303
+ } & StatsResponse) | {
304
+ type: 'iceServersResponse';
305
+ requestId: string;
306
+ iceServers: IceServerConfig[];
307
+ } | ({
308
+ type: 'serialPortAccessResult';
309
+ requestId: string;
310
+ } & SerialPortAccessResult) | ({
311
+ type: 'connectionCodeUpdated';
312
+ } & ConnectionCodeUpdated) | ({
313
+ type: 'mediaDevicesChanged';
314
+ } & MediaDevicesChanged) | ({
315
+ type: 'bluetooth';
316
+ } & BluetoothToApp) | {
317
+ type: 'crdtUpdate';
318
+ update: ArrayBufferLike;
319
+ } | {
320
+ type: 'crdtSyncComplete';
321
+ } | {
322
+ type: 'crdtRequestSync';
323
+ } | {
324
+ type: 'crdtAwarenessUpdate';
325
+ update: ArrayBufferLike;
326
+ } | {
327
+ type: 'crdtSubdocUpdate';
328
+ guid: string;
329
+ update: ArrayBufferLike;
330
+ } | {
331
+ type: 'crdtSubdocSyncComplete';
332
+ guid: string;
333
+ } | {
334
+ type: 'crdtSubdocTransferProgress';
335
+ guid: string;
336
+ receivedBytes: number;
337
+ totalBytes: number;
338
+ } | {
339
+ type: 'crdtSubdocRequestSync';
340
+ guid: string;
341
+ } | ({
342
+ type: 'companionFramePeerJoined';
343
+ } & CompanionFramePeerJoined) | ({
344
+ type: 'companionFramePeerLeft';
345
+ } & CompanionFramePeerLeft) | ({
346
+ type: 'companionFramePeersUpdated';
347
+ } & CompanionFramePeersUpdated) | ({
348
+ type: 'shareStreamCompleted';
349
+ } & ShareStreamCompleted) | ({
350
+ type: 'sharedStreamAvailable';
351
+ } & SharedStreamAvailable) | ({
352
+ type: 'sharedStreamRemoved';
353
+ } & SharedStreamRemoved) | {
354
+ type: 'attachStreamCompleted';
355
+ requestId: string;
356
+ error?: string;
357
+ } | AiInboundMessage;
358
+ export type MediaDevicesChanged = {
359
+ devices: ConnectedMediaDevice[];
360
+ };
361
+ /** Companion frame → Vitre main connector (see CompanionFrame.sendMessageToVitreConnector). */
362
+ export type SendToVitreConnector = {
363
+ frameConnectorId: string;
364
+ message: string;
365
+ fileData?: FileData;
366
+ };
367
+ /**
368
+ * ICE / TURN server config the HOST already uses for its own WebRTC P2P,
369
+ * sourced from the connection handshake (`StartWebRTCOffer.IceServers` on a
370
+ * Vitre, `WebRTCOffer.iceServers` on a companion). The shape matches the
371
+ * browser `RTCIceServer` so the result of {@link Frame.getIceServers} can be
372
+ * passed straight to `new RTCPeerConnection({ iceServers })` — letting an app
373
+ * stand up its own peer connection (e.g. a companion-camera frame connecting
374
+ * directly to its paired Vitre transform frame) that traverses NAT through the
375
+ * same TURN relays as the platform, without shipping its own credentials.
376
+ */
377
+ export type IceServerConfig = {
378
+ urls: string[];
379
+ username?: string;
380
+ credential?: string;
381
+ };
382
+ export type FrameApiMessagesOut = ({
383
+ type: 'sendMessageTo';
384
+ } & SendMessageTo) | ({
385
+ type: 'sendMessageToAll';
386
+ } & SendMessageToAll) | ({
387
+ type: 'frameInitialized';
388
+ } & FrameInitialized) | {
389
+ type: 'setFullscreen';
390
+ } | {
391
+ type: 'setWindowed';
392
+ } | {
393
+ type: 'close';
394
+ } | ({
395
+ type: 'setFrameMenu';
396
+ } & SetFrameMenu) | ({
397
+ type: 'sendToLocalFrame';
398
+ } & SendToLocalFrame) | ({
399
+ type: 'sendToVitreConnector';
400
+ } & SendToVitreConnector) | ({
401
+ type: 'enumerateLoadedFrames';
402
+ } & EnumerateLoadedFrames) | ({
403
+ type: 'setExportSources';
404
+ } & SetExportSources) | ({
405
+ type: 'applyStreamAdvancedConstraints';
406
+ } & ApplyStreamAdvancedConstraints) | ({
407
+ type: 'replaceFrameStream';
408
+ } & ReplaceFrameStream) | {
409
+ type: 'stopInteracting';
410
+ } | {
411
+ type: 'startInteracting';
412
+ } | ({
413
+ type: 'exportDone';
414
+ } & ExportDone) | ({
415
+ type: 'setSize';
416
+ } & SetSize) | {
417
+ type: 'getVitreSettings';
418
+ } | ({
419
+ type: 'setVitreSettings';
420
+ } & VitreSettingsSetter) | ({
421
+ type: 'shareFile';
422
+ } & ShareFileRequest) | ({
423
+ type: 'shareData';
424
+ } & ShareDataRequest) | ({
425
+ type: 'saveSettings';
426
+ } & SaveSettings) | ({
427
+ type: 'changeTeamSpace';
428
+ } & ChangeTeamSpace) | ({
429
+ type: 'changeTeamSpaceGuest';
430
+ } & ChangeTeamSpaceGuest) | ({
431
+ type: 'showNotification';
432
+ } & NotificationInfo) | ({
433
+ type: 'hideNotification';
434
+ } & HideNotification) | ({
435
+ type: 'changePrivacy';
436
+ } & ChangePrivacy) | ({
437
+ type: 'appMessage';
438
+ } & AppMessage) | ({
439
+ type: 'extensionMessage';
440
+ } & AppMessage) | ({
441
+ type: 'trackEvent';
442
+ } & EventTelemetry) | ({
443
+ type: 'startTrackEvent';
444
+ } & StartEventTelemetry) | ({
445
+ type: 'stopTrackEvent';
446
+ } & EventTelemetry) | ({
447
+ type: 'setBorderOptions';
448
+ } & BorderOptions) | {
449
+ type: 'setVoiceActions';
450
+ actions: VoiceAction[];
451
+ } | {
452
+ type: 'streamFrameCaptureRequest';
453
+ requestId: string;
454
+ } | ({
455
+ type: 'updateState';
456
+ } & UpdateState) | ({
457
+ type: 'setPosition';
458
+ } & LayoutPosition) | ({
459
+ type: 'setVisibility';
460
+ } & SetVisibility) | ({
461
+ type: 'sharedStreamAction';
462
+ } & StreamAction) | ({
463
+ type: 'sendKnockKnock';
464
+ } & SendKnockKnock) | ({
465
+ type: 'getStats';
466
+ } & GetStats) | {
467
+ type: 'getIceServers';
468
+ requestId: string;
469
+ } | ({
470
+ type: 'setReducedAudioMode';
471
+ } & SetReducedAudioMode) | ({
472
+ type: 'sendToSerialPort';
473
+ } & SendToSerialPort) | ({
474
+ type: 'requestSerialPortAccess';
475
+ requestId: string;
476
+ } & RequestSerialPortAccess) | ({
477
+ type: 'bluetooth';
478
+ } & BluetoothFromApp) | ({
479
+ type: 'disconnectGuests';
480
+ } & DisconnectGuests) | ({
481
+ type: 'requestStreamSizeUpdate';
482
+ } & RequestStreamSizeUpdate) | ({
483
+ type: 'updateName';
484
+ } & UpdateName) | ({
485
+ type: 'shareStream';
486
+ } & ShareStream) | ({
487
+ type: 'replaceShareStream';
488
+ } & ReplaceShareStream) | ({
489
+ type: 'stopShareStream';
490
+ } & StopShareStream) | {
491
+ type: 'attachStream';
492
+ requestId: string;
493
+ targetFrameConnectorId?: string;
494
+ tracks: ShareStreamTrack[];
495
+ } | {
496
+ type: 'detachStream';
497
+ targetFrameConnectorId?: string;
498
+ } | {
499
+ type: 'crdtUpdate';
500
+ update: ArrayBufferLike;
501
+ } | {
502
+ type: 'crdtRequestSync';
503
+ } | {
504
+ type: 'crdtAwarenessUpdate';
505
+ update: ArrayBufferLike;
506
+ } | {
507
+ type: 'crdtRequestAwareness';
508
+ } | {
509
+ type: 'crdtSubdocUpdate';
510
+ guid: string;
511
+ update: ArrayBufferLike;
512
+ } | {
513
+ type: 'crdtSubdocRequestSync';
514
+ guid: string;
515
+ }
516
+ /**
517
+ * Companion-frame-only: close the iframe locally on the companion and
518
+ * remove this companion from the per-frame `framePresence` on the Vitre,
519
+ * WITHOUT closing the Vitre's own frame (which keeps showing for other
520
+ * peers + the local Vitre app). The companion's resulting state matches
521
+ * "frame was open on the Vitre when I late-joined the space": iframe
522
+ * unmounted, not in framePresence, can be re-opened by clicking the
523
+ * matching menu entry again or by autoOpen on next reconnect.
524
+ *
525
+ * Sent by `CompanionFrame.closeOnCompanion()`. The Vitre host's path is
526
+ * the existing `CompanionToVitreReq.FrameClosed` — semantics are
527
+ * "remove from presence, don't kill the Vitre frame" so no new wire
528
+ * case is needed. The `close` arm of this union remains the global
529
+ * close (deprecated for use on companion frames).
530
+ */
531
+ | {
532
+ type: 'closeOnCompanion';
533
+ } | AiOutboundMessage;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Frame.Model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Frame.Model.js","sourceRoot":"","sources":["../../Frame/Frame.Model.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AiInboundMessage,\n AiOutboundMessage,\n AppMessage,\n BluetoothFromApp,\n BluetoothToApp,\n BorderOptions,\n ChangePrivacy,\n ChangeTeamSpace,\n ChangeTeamSpaceGuest,\n CompanionFramePeerJoined,\n CompanionFramePeerLeft,\n CompanionFramePeersUpdated,\n ConnectedMediaDevice,\n ConnectionCodeUpdated,\n Device,\n DeviceFrameReference,\n DeviceFullscreenUpdated,\n DeviceJoined,\n DeviceLeft,\n DeviceMessageReceived,\n DevicePrivacyChanged,\n DeviceScalingUpdated,\n DisconnectGuests,\n EnumerateLoadedFrames,\n EnumerateLoadedFramesCompleted,\n EventTelemetry,\n FieldUpdated,\n FileData,\n CompanionInformation,\n FrameTouchMode,\n GetStats,\n HideNotification,\n HostInformation,\n I18nMap,\n Interaction,\n KnockKnock,\n LayoutPosition,\n LocalConnectorMessageReceived,\n MenuClicked,\n MenuEntry,\n NotificationButtonClicked,\n NotificationDismissed,\n NotificationInfo,\n PendingDevicesInfo,\n PositionUpdated,\n PrivacyChanged,\n Rect,\n RequestSerialPortAccess,\n SerialPortAccessResult,\n RequestStreamSizeUpdate,\n ResizeMode,\n SaveSettings,\n SendKnockKnock,\n SendMessageTo,\n SendMessageToAll,\n SendToLocalFrame,\n SendToSerialPort,\n SetReducedAudioMode,\n SettingsUpdated,\n SetVisibility,\n ShareDataRequest,\n ShareFileRequest,\n Size,\n StartEventTelemetry,\n StateReplaced,\n StatsResponse,\n StreamCapture,\n UpdateState,\n VideoContentHint,\n ViewMode,\n VisibilityChanged,\n VitreSettings,\n VitreSettingsSetter,\n VoiceAction,\n VoiceActionDetection,\n} from '../Common/index.js'\nimport type {\n MediaTrackInfo,\n ReplaceShareStream,\n ShareStream,\n ShareStreamCompleted,\n ShareStreamTrack,\n StopShareStream,\n} from '../Connector/Connector.Model.js'\n\n/// Host → Frame (reverse breakout box): the Vitre exposes a live `MediaStream`\n/// it owns into a frame. Each track carries a transferable `readable`\n/// (MediaStreamTrackProcessor output); the frame rebuilds a live\n/// MediaStreamTrack via MediaStreamTrackGenerator. `streamId` lets the frame\n/// match a later `sharedStreamRemoved`. Symmetric inverse of `ShareStream`.\nexport type SharedStreamAvailable = {\n streamId: string\n tracks: ShareStreamTrack[]\n}\n\nexport type SharedStreamRemoved = {\n streamId: string\n}\n\nexport type AvailableExportSource = {\n supportedFormats: string[]\n label: I18nMap\n fileSuffix?: string\n fileExtension?: string\n binaryHeader?: ArrayBufferLike\n tag?: any\n id: string\n menu?: MenuEntry[]\n /**\n * SDK 1.46 — whether this export source is offered to connected\n * companions. Defaults to `true`.\n *\n * When `false` the Vitre never advertises the source to a companion, so\n * it appears in no companion menu: neither \"share to another app\" nor\n * \"download to this device\". The Vitre's own export menu is unaffected.\n *\n * Use it for sources that only make sense on the Vitre (huge payloads,\n * formats a phone cannot open, host-local side effects).\n */\n availableForCompanion?: boolean\n}\n\nexport type LoadingFileData = {\n id: string\n name: string\n mime: string\n}\n\nexport type InitFrameOptions = {\n frameConnectorId: string\n streamId?: string\n name: string\n url: string\n size: Size\n minSize?: Size\n maxSize?: Size\n touchMode: FrameTouchMode\n allowFullscreen: boolean\n resizeMode: ResizeMode\n data?: any\n file?: FileData\n border: BorderOptions\n syncedTimeOffset: number\n}\n\nexport type InitializeFrame = {\n hostInfo: HostInformation\n /**\n * The companion's own identity/runtime context, present only when this\n * frame is loaded by a la Vitre **companion** (mirrors\n * `hostInfo.isCompanion`). Surfaced as `frame.companionInformation`.\n * Undefined on Vitre-side frames. Added 1.19.\n */\n companionInfo?: CompanionInformation\n initiator: Device\n id: string\n appId?: string\n options: InitFrameOptions\n isFullscreen: boolean\n /**\n * @deprecated Use options.border.mode\n */\n isBorderless: boolean\n state?: Record<string, any>\n position: Rect\n}\n\nexport type FrameDefaultMenuCategory = {\n type: 'defaultMenu'\n label?: string\n description?: string\n order?: number\n}\n\nexport type FrameMenuCategory = { type: 'iconMenu' } | FrameDefaultMenuCategory\n\nexport type FrameMenuEntry = Omit<MenuEntry, 'category'> & {\n category?: FrameMenuCategory\n}\n\nexport type SetFrameMenu = {\n menu: FrameMenuEntry[]\n}\n\nexport type ViewOptions = {\n name: string\n minSize?: Size\n maxSize?: Size\n size?: Size\n /**\n * @deprecated Use interaction property\n */\n touchMode?: FrameTouchMode\n allowFullscreen?: boolean\n hideMenu?: boolean\n resizeMode?: ResizeMode\n menu?: FrameMenuEntry[]\n exportSources?: AvailableExportSource[]\n /**\n * @deprecated Use interaction property\n */\n interactionEnabled?: boolean\n interaction?: Interaction\n mode?: ViewMode\n closable?: boolean\n closeLabel?: string\n}\n\nexport type FrameInitialized = {\n options: ViewOptions\n}\n\nexport type SetFullscreen = {\n type: 'setFullscreen'\n}\n\nexport type SetWindowed = {\n type: 'setWindowed'\n}\n\n/**\n * Replace the video track of THIS frame's shared stream with a new\n * `getUserMedia` capture (e.g. switch camera) while keeping the same share\n * (same `sharedStreamId`) — results in a `replaceTrack` on the host, no\n * WebRTC renegotiation. The host applies an `{ exact }` deviceId constraint.\n */\nexport type ReplaceFrameStream = {\n requestId: string\n constraints: MediaStreamConstraints\n}\n\nexport type ApplyStreamAdvancedConstraints = {\n streamId?: string\n contentHint?: VideoContentHint\n whiteBalanceMode?: string\n focusMode?: string\n resizeMode?: string\n exposureMode?: string\n\n colorTemperature?: number\n exposureCompensation?: number\n brightness?: number\n contrast?: number\n exposureTime?: number\n saturation?: number\n sharpness?: number\n focusDistance?: number\n width?: number\n height?: number\n mirror?: boolean\n}\n\nexport type IsInteractingChanged = {\n isInteracting: boolean\n}\n\nexport type FileProgress = {\n bytes: number\n totalBytes: number\n}\n\nexport type FileLoaded = {\n file: ArrayBufferLike\n}\n\nexport type SetExportSources = {\n /**\n * The full replacement list. Was mistyped as a single\n * `AvailableExportSource` until 1.47; the host has always decoded an\n * array here (`Decode.array` on the `setExportSources` message), so no\n * emitter can have relied on the singular form — nothing shipped could\n * send this message before 1.47 anyway, `Frame.setExportSources` being\n * the first emitter.\n */\n exportSources: AvailableExportSource[]\n}\n\nexport type ExportRequest = {\n id: string\n format?: string\n tag?: any\n exportSourceId: string\n menuId?: string\n}\n\nexport type ExportData = {\n format: string\n name: string\n buffer: ArrayBufferLike\n}\n\nexport type ExportDone = {\n request: ExportRequest\n data?: ExportData\n error?: string\n}\n\nexport type SetSize = {\n width: number\n height: number\n}\n\nexport type BorderlessUpdated = {\n isBorderless: boolean\n}\n\nexport type FullscreenUpdated = {\n isFullscreen: boolean\n}\n\nexport type UpdateFrameName = { name: string }\n\nexport type UpdateName = { name: string }\n\nexport type SharedStreamPlayState = 'playing' | 'paused'\n\nexport type LocalSharedStreamUpdate = {\n volume: number\n}\n\nexport type StreamAction =\n | { action: 'play' }\n | { action: 'pause' }\n | { action: 'seek'; position: number; isRelative: boolean }\n | { action: 'volume'; volume: number; muted: boolean }\n\nexport type FrameApiMessagesIn =\n | ({\n type: 'enumerateLoadedFramesCompleted'\n } & EnumerateLoadedFramesCompleted)\n | ({ type: 'initialize' } & InitializeFrame)\n | ({ type: 'deviceJoined' } & DeviceJoined)\n | ({ type: 'deviceLeft' } & DeviceLeft)\n | ({ type: 'deviceMessageReceived' } & DeviceMessageReceived)\n | ({ type: 'localConnectorMessageReceived' } & LocalConnectorMessageReceived)\n | ({ type: 'menuClicked' } & MenuClicked)\n | ({ type: 'fieldUpdated' } & FieldUpdated)\n | ({ type: 'privacyChanged' } & PrivacyChanged)\n | ({ type: 'isInteractingChanged' } & IsInteractingChanged)\n | ({ type: 'fileLoaded' } & FileLoaded)\n | ({ type: 'fileProgress' } & FileProgress)\n | ({ type: 'exportRequest' } & ExportRequest)\n | ({ type: 'vitreSettingsResponse' } & VitreSettings)\n | ({ type: 'knockKnockReceived' } & KnockKnock)\n | ({ type: 'settingsUpdated' } & SettingsUpdated)\n | ({ type: 'vitreSettingsUpdated' } & VitreSettings)\n | ({ type: 'notificationDismissed' } & NotificationDismissed)\n | ({ type: 'notificationButtonClicked' } & NotificationButtonClicked)\n | ({ type: 'devicePrivacyChanged' } & DevicePrivacyChanged)\n | ({ type: 'deviceFrameUnloaded' } & DeviceFrameReference)\n | ({ type: 'deviceFrameLoaded' } & DeviceFrameReference)\n | ({ type: 'deviceFrameConnectorLoaded' } & DeviceFrameReference)\n | ({ type: 'pendingDevicesConnectionRequested' } & PendingDevicesInfo)\n | ({ type: 'borderlessUpdated' } & BorderlessUpdated)\n | ({ type: 'fullscreenUpdated' } & FullscreenUpdated)\n | ({ type: 'borderOptionsUpdated' } & BorderOptions)\n | ({ type: 'voiceActionDetected' } & VoiceActionDetection)\n | {\n type: 'streamFrameCapturedResponse'\n requestId: string\n response?: StreamCapture\n error: string\n }\n | {\n type: 'replaceFrameStreamCompleted'\n requestId: string\n tracks?: MediaTrackInfo[]\n error?: string\n }\n | ({ type: 'stateReplaced' } & StateReplaced)\n | ({ type: 'deviceFullscreenUpdated' } & DeviceFullscreenUpdated)\n | ({ type: 'visibilityChanged' } & VisibilityChanged)\n | ({ type: 'positionUpdated' } & PositionUpdated)\n | ({ type: 'deviceScalingUpdated' } & DeviceScalingUpdated)\n | ({ type: 'updateFrameName' } & UpdateFrameName)\n | ({ type: 'localSharedStreamUpdate' } & LocalSharedStreamUpdate)\n | ({ type: 'statsResponse' } & StatsResponse)\n | { type: 'iceServersResponse'; requestId: string; iceServers: IceServerConfig[] }\n | ({ type: 'serialPortAccessResult'; requestId: string } & SerialPortAccessResult)\n | ({ type: 'connectionCodeUpdated' } & ConnectionCodeUpdated)\n | ({ type: 'mediaDevicesChanged' } & MediaDevicesChanged)\n | ({ type: 'bluetooth' } & BluetoothToApp)\n | { type: 'crdtUpdate'; update: ArrayBufferLike }\n | { type: 'crdtSyncComplete' }\n | { type: 'crdtRequestSync' }\n | { type: 'crdtAwarenessUpdate'; update: ArrayBufferLike }\n | { type: 'crdtSubdocUpdate'; guid: string; update: ArrayBufferLike }\n | { type: 'crdtSubdocSyncComplete'; guid: string }\n | {\n type: 'crdtSubdocTransferProgress'\n guid: string\n receivedBytes: number\n totalBytes: number\n }\n | { type: 'crdtSubdocRequestSync'; guid: string }\n | ({ type: 'companionFramePeerJoined' } & CompanionFramePeerJoined)\n | ({ type: 'companionFramePeerLeft' } & CompanionFramePeerLeft)\n | ({ type: 'companionFramePeersUpdated' } & CompanionFramePeersUpdated)\n | ({ type: 'shareStreamCompleted' } & ShareStreamCompleted)\n | ({ type: 'sharedStreamAvailable' } & SharedStreamAvailable)\n | ({ type: 'sharedStreamRemoved' } & SharedStreamRemoved)\n | { type: 'attachStreamCompleted'; requestId: string; error?: string }\n // AI tool channel: the host asks this frame to run one of its registered tools.\n | AiInboundMessage\n\nexport type MediaDevicesChanged = {\n devices: ConnectedMediaDevice[]\n}\n\n/** Companion frame → Vitre main connector (see CompanionFrame.sendMessageToVitreConnector). */\nexport type SendToVitreConnector = {\n frameConnectorId: string\n message: string\n fileData?: FileData\n}\n\n/**\n * ICE / TURN server config the HOST already uses for its own WebRTC P2P,\n * sourced from the connection handshake (`StartWebRTCOffer.IceServers` on a\n * Vitre, `WebRTCOffer.iceServers` on a companion). The shape matches the\n * browser `RTCIceServer` so the result of {@link Frame.getIceServers} can be\n * passed straight to `new RTCPeerConnection({ iceServers })` — letting an app\n * stand up its own peer connection (e.g. a companion-camera frame connecting\n * directly to its paired Vitre transform frame) that traverses NAT through the\n * same TURN relays as the platform, without shipping its own credentials.\n */\nexport type IceServerConfig = {\n urls: string[]\n username?: string\n credential?: string\n}\n\nexport type FrameApiMessagesOut =\n | ({ type: 'sendMessageTo' } & SendMessageTo)\n | ({ type: 'sendMessageToAll' } & SendMessageToAll)\n | ({ type: 'frameInitialized' } & FrameInitialized)\n | { type: 'setFullscreen' }\n | { type: 'setWindowed' }\n | { type: 'close' }\n | ({ type: 'setFrameMenu' } & SetFrameMenu)\n | ({ type: 'sendToLocalFrame' } & SendToLocalFrame)\n | ({ type: 'sendToVitreConnector' } & SendToVitreConnector)\n | ({ type: 'enumerateLoadedFrames' } & EnumerateLoadedFrames)\n | ({ type: 'setExportSources' } & SetExportSources)\n | ({\n type: 'applyStreamAdvancedConstraints'\n } & ApplyStreamAdvancedConstraints)\n | ({ type: 'replaceFrameStream' } & ReplaceFrameStream)\n | { type: 'stopInteracting' }\n | { type: 'startInteracting' }\n | ({ type: 'exportDone' } & ExportDone)\n | ({ type: 'setSize' } & SetSize)\n | { type: 'getVitreSettings' }\n | ({ type: 'setVitreSettings' } & VitreSettingsSetter)\n | ({ type: 'shareFile' } & ShareFileRequest)\n | ({ type: 'shareData' } & ShareDataRequest)\n | ({ type: 'saveSettings' } & SaveSettings)\n | ({ type: 'changeTeamSpace' } & ChangeTeamSpace)\n | ({ type: 'changeTeamSpaceGuest' } & ChangeTeamSpaceGuest)\n | ({ type: 'showNotification' } & NotificationInfo)\n | ({ type: 'hideNotification' } & HideNotification)\n | ({ type: 'changePrivacy' } & ChangePrivacy)\n | ({ type: 'appMessage' } & AppMessage)\n | ({ type: 'extensionMessage' } & AppMessage)\n | ({ type: 'trackEvent' } & EventTelemetry)\n | ({ type: 'startTrackEvent' } & StartEventTelemetry)\n | ({ type: 'stopTrackEvent' } & EventTelemetry)\n | ({ type: 'setBorderOptions' } & BorderOptions)\n | { type: 'setVoiceActions'; actions: VoiceAction[] }\n | { type: 'streamFrameCaptureRequest'; requestId: string }\n | ({ type: 'updateState' } & UpdateState)\n | ({ type: 'setPosition' } & LayoutPosition)\n | ({ type: 'setVisibility' } & SetVisibility)\n | ({ type: 'sharedStreamAction' } & StreamAction)\n | ({ type: 'sendKnockKnock' } & SendKnockKnock)\n | ({ type: 'getStats' } & GetStats)\n | { type: 'getIceServers'; requestId: string }\n | ({ type: 'setReducedAudioMode' } & SetReducedAudioMode)\n | ({ type: 'sendToSerialPort' } & SendToSerialPort)\n | ({ type: 'requestSerialPortAccess'; requestId: string } & RequestSerialPortAccess)\n | ({ type: 'bluetooth' } & BluetoothFromApp)\n | ({ type: 'disconnectGuests' } & DisconnectGuests)\n | ({ type: 'requestStreamSizeUpdate' } & RequestStreamSizeUpdate)\n | ({ type: 'updateName' } & UpdateName)\n | ({ type: 'shareStream' } & ShareStream)\n | ({ type: 'replaceShareStream' } & ReplaceShareStream)\n | ({ type: 'stopShareStream' } & StopShareStream)\n | {\n type: 'attachStream'\n requestId: string\n targetFrameConnectorId?: string\n tracks: ShareStreamTrack[]\n }\n | { type: 'detachStream'; targetFrameConnectorId?: string }\n | { type: 'crdtUpdate'; update: ArrayBufferLike }\n | { type: 'crdtRequestSync' }\n | { type: 'crdtAwarenessUpdate'; update: ArrayBufferLike }\n | { type: 'crdtRequestAwareness' }\n | { type: 'crdtSubdocUpdate'; guid: string; update: ArrayBufferLike }\n | { type: 'crdtSubdocRequestSync'; guid: string }\n /**\n * Companion-frame-only: close the iframe locally on the companion and\n * remove this companion from the per-frame `framePresence` on the Vitre,\n * WITHOUT closing the Vitre's own frame (which keeps showing for other\n * peers + the local Vitre app). The companion's resulting state matches\n * \"frame was open on the Vitre when I late-joined the space\": iframe\n * unmounted, not in framePresence, can be re-opened by clicking the\n * matching menu entry again or by autoOpen on next reconnect.\n *\n * Sent by `CompanionFrame.closeOnCompanion()`. The Vitre host's path is\n * the existing `CompanionToVitreReq.FrameClosed` — semantics are\n * \"remove from presence, don't kill the Vitre frame\" so no new wire\n * case is needed. The `close` arm of this union remains the global\n * close (deprecated for use on companion frames).\n */\n | { type: 'closeOnCompanion' }\n // AI tool channel: publish/withdraw this frame's tool catalog + answer invocations.\n | AiOutboundMessage\n"]}