@lavitre/apps 1.55.0 → 1.56.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/README.md +70 -0
- package/dist/Common/Common.Model.d.ts +125 -0
- package/dist/Common/Common.Model.js.map +1 -1
- package/dist/Common/PrivateStorage.d.ts +249 -0
- package/dist/Common/PrivateStorage.js +158 -0
- package/dist/Common/PrivateStorage.js.map +1 -0
- package/dist/Common/index.d.ts +1 -0
- package/dist/Common/index.js +1 -0
- package/dist/Common/index.js.map +1 -1
- package/dist/CompanionConnector/CompanionConnector.Model.d.ts +11 -3
- package/dist/CompanionConnector/CompanionConnector.Model.js.map +1 -1
- package/dist/CompanionConnector/CompanionConnector.d.ts +14 -0
- package/dist/CompanionConnector/CompanionConnector.js +122 -0
- package/dist/CompanionConnector/CompanionConnector.js.map +1 -1
- package/dist/CompanionFrame/CompanionFrame.d.ts +13 -2
- package/dist/CompanionFrame/CompanionFrame.js.map +1 -1
- package/dist/Connector/Connector.Model.d.ts +13 -1
- package/dist/Connector/Connector.Model.js.map +1 -1
- package/dist/Connector/Connector.d.ts +12 -0
- package/dist/Connector/Connector.js +106 -0
- package/dist/Connector/Connector.js.map +1 -1
- package/dist/Frame/Frame.Model.d.ts +13 -1
- package/dist/Frame/Frame.Model.js.map +1 -1
- package/dist/Frame/Frame.d.ts +13 -0
- package/dist/Frame/Frame.js +107 -0
- package/dist/Frame/Frame.js.map +1 -1
- package/dist/Version.d.ts +1 -1
- package/dist/Version.js +1 -1
- package/dist/Version.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AiInboundMessage, AiOutboundMessage, AppMessage, AppSettingsChanged, AppSettingsResponse, BluetoothFromApp, BluetoothToApp, BorderOptions, ChangePrivacy, ChangeTeamSpace, ChangeTeamSpaceGuest, CompanionFramePeerJoined, CompanionFramePeerLeft, CompanionFramePeersUpdated, ConnectedMediaDevice, ConnectionCodeUpdated, DeletePublicFile, Device, DeviceFrameReference, DeviceFullscreenUpdated, DeviceJoined, DeviceLeft, DeviceMessageReceived, DevicePrivacyChanged, DeviceScalingUpdated, DisconnectGuests, EnumerateLoadedFrames, EnumerateLoadedFramesCompleted, EventTelemetry, FieldUpdated, FileData, CompanionInformation, FrameTouchMode, GetAppSettings, GetStats, HideNotification, HostInformation, I18nMap, Interaction, KnockKnock, LayoutPosition, ListPublicFiles, LocalConnectorMessageReceived, MenuClicked, MenuEntry, NotificationButtonClicked, NotificationDismissed, NotificationInfo, PendingDevicesInfo, PositionUpdated, SafeAreaInsets, SafeAreaInsetsUpdated, PrivacyChanged, PublicStorageResponse, PutPublicFile, Rect, RequestSerialPortAccess, SerialPortAccessResult, RequestStreamSizeUpdate, ResizeMode, SaveSettings, SendKnockKnock, SendMessageTo, SendMessageToAll, SendToLocalFrame, SendToSerialPort, SetAppSettings, SetReducedAudioMode, SettingsUpdated, SetVisibility, ShareDataRequest, ShareFileRequest, Size, StartEventTelemetry, StateReplaced, StatsResponse, StreamCapture, UpdateState, VideoContentHint, ViewMode, VisibilityChanged, VitreSettings, VitreSettingsSetter, VoiceAction, VoiceActionDetection } from '../Common/index.js';
|
|
1
|
+
import type { AiInboundMessage, AiOutboundMessage, AppMessage, AppSettingsChanged, AppSettingsResponse, BluetoothFromApp, BluetoothToApp, BorderOptions, ChangePrivacy, ChangeTeamSpace, ChangeTeamSpaceGuest, CompanionFramePeerJoined, CompanionFramePeerLeft, CompanionFramePeersUpdated, ConnectedMediaDevice, ConnectionCodeUpdated, DeletePublicFile, DeletePrivateFile, GetPrivateFile, GetPrivateFileLink, ListPrivateFiles, PrivateStorageResponse, PutPrivateFile, Device, DeviceFrameReference, DeviceFullscreenUpdated, DeviceJoined, DeviceLeft, DeviceMessageReceived, DevicePrivacyChanged, DeviceScalingUpdated, DisconnectGuests, EnumerateLoadedFrames, EnumerateLoadedFramesCompleted, EventTelemetry, FieldUpdated, FileData, CompanionInformation, FrameTouchMode, GetAppSettings, GetStats, HideNotification, HostInformation, I18nMap, Interaction, KnockKnock, LayoutPosition, ListPublicFiles, LocalConnectorMessageReceived, MenuClicked, MenuEntry, NotificationButtonClicked, NotificationDismissed, NotificationInfo, PendingDevicesInfo, PositionUpdated, SafeAreaInsets, SafeAreaInsetsUpdated, PrivacyChanged, PublicStorageResponse, PutPublicFile, Rect, RequestSerialPortAccess, SerialPortAccessResult, RequestStreamSizeUpdate, ResizeMode, SaveSettings, SendKnockKnock, SendMessageTo, SendMessageToAll, SendToLocalFrame, SendToSerialPort, SetAppSettings, SetReducedAudioMode, SettingsUpdated, SetVisibility, ShareDataRequest, ShareFileRequest, Size, StartEventTelemetry, StateReplaced, StatsResponse, StreamCapture, UpdateState, VideoContentHint, ViewMode, VisibilityChanged, VitreSettings, VitreSettingsSetter, VoiceAction, VoiceActionDetection } from '../Common/index.js';
|
|
2
2
|
import type { MediaTrackInfo, ReplaceShareStream, ShareStream, ShareStreamCompleted, ShareStreamTrack, StopShareStream } from '../Connector/Connector.Model.js';
|
|
3
3
|
export type SharedStreamAvailable = {
|
|
4
4
|
streamId: string;
|
|
@@ -268,6 +268,8 @@ export type FrameApiMessagesIn = ({
|
|
|
268
268
|
} & AppSettingsChanged) | ({
|
|
269
269
|
type: 'publicStorageResponse';
|
|
270
270
|
} & PublicStorageResponse) | ({
|
|
271
|
+
type: 'privateStorageResponse';
|
|
272
|
+
} & PrivateStorageResponse) | ({
|
|
271
273
|
type: 'vitreSettingsUpdated';
|
|
272
274
|
} & VitreSettings) | ({
|
|
273
275
|
type: 'notificationDismissed';
|
|
@@ -455,6 +457,16 @@ export type FrameApiMessagesOut = ({
|
|
|
455
457
|
} & DeletePublicFile) | ({
|
|
456
458
|
type: 'listPublicFiles';
|
|
457
459
|
} & ListPublicFiles) | ({
|
|
460
|
+
type: 'putPrivateFile';
|
|
461
|
+
} & PutPrivateFile) | ({
|
|
462
|
+
type: 'deletePrivateFile';
|
|
463
|
+
} & DeletePrivateFile) | ({
|
|
464
|
+
type: 'listPrivateFiles';
|
|
465
|
+
} & ListPrivateFiles) | ({
|
|
466
|
+
type: 'getPrivateFile';
|
|
467
|
+
} & GetPrivateFile) | ({
|
|
468
|
+
type: 'getPrivateFileLink';
|
|
469
|
+
} & GetPrivateFileLink) | ({
|
|
458
470
|
type: 'changeTeamSpace';
|
|
459
471
|
} & ChangeTeamSpace) | ({
|
|
460
472
|
type: 'changeTeamSpaceGuest';
|
|
@@ -1 +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 AppSettingsChanged,\n AppSettingsResponse,\n BluetoothFromApp,\n BluetoothToApp,\n BorderOptions,\n ChangePrivacy,\n ChangeTeamSpace,\n ChangeTeamSpaceGuest,\n CompanionFramePeerJoined,\n CompanionFramePeerLeft,\n CompanionFramePeersUpdated,\n ConnectedMediaDevice,\n ConnectionCodeUpdated,\n DeletePublicFile,\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 GetAppSettings,\n GetStats,\n HideNotification,\n HostInformation,\n I18nMap,\n Interaction,\n KnockKnock,\n LayoutPosition,\n ListPublicFiles,\n LocalConnectorMessageReceived,\n MenuClicked,\n MenuEntry,\n NotificationButtonClicked,\n NotificationDismissed,\n NotificationInfo,\n PendingDevicesInfo,\n PositionUpdated,\n SafeAreaInsets,\n SafeAreaInsetsUpdated,\n PrivacyChanged,\n PublicStorageResponse,\n PutPublicFile,\n Rect,\n RequestSerialPortAccess,\n SerialPortAccessResult,\n RequestStreamSizeUpdate,\n ResizeMode,\n SaveSettings,\n SendKnockKnock,\n SendMessageTo,\n SendMessageToAll,\n SendToLocalFrame,\n SendToSerialPort,\n SetAppSettings,\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\n/// Host → Frame, fallback for `SharedStreamAvailable` when the host cannot\n/// transfer track readables into this frame (frame on another site, or no\n/// MediaStreamTrackProcessor). The stream travels over a local\n/// RTCPeerConnection signaled through `port` (see SharedStreamPeer.ts).\nexport type SharedStreamOffer = {\n streamId: string\n port: MessagePort\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 * Insets the frame must keep its controls clear of, when the host runs it\n * edge-to-edge (`CompanionFrameOption.edgeToEdge`); later changes arrive\n * as `safeAreaInsetsUpdated`. Absent from hosts before 1.51 — read as all\n * zero. Added 1.51.\n */\n safeAreaInsets?: SafeAreaInsets\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: 'appSettingsResponse' } & AppSettingsResponse)\n | ({ type: 'appSettingsChanged' } & AppSettingsChanged)\n | ({ type: 'publicStorageResponse' } & PublicStorageResponse)\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: 'safeAreaInsetsUpdated' } & SafeAreaInsetsUpdated)\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: 'sharedStreamOffer' } & SharedStreamOffer)\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: 'getAppSettings' } & GetAppSettings)\n | ({ type: 'setAppSettings' } & SetAppSettings)\n | ({ type: 'putPublicFile' } & PutPublicFile)\n | ({ type: 'deletePublicFile' } & DeletePublicFile)\n | ({ type: 'listPublicFiles' } & ListPublicFiles)\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 | ({\n type: 'requestSerialPortAccess'\n requestId: string\n } & 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"]}
|
|
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 AppSettingsChanged,\n AppSettingsResponse,\n BluetoothFromApp,\n BluetoothToApp,\n BorderOptions,\n ChangePrivacy,\n ChangeTeamSpace,\n ChangeTeamSpaceGuest,\n CompanionFramePeerJoined,\n CompanionFramePeerLeft,\n CompanionFramePeersUpdated,\n ConnectedMediaDevice,\n ConnectionCodeUpdated,\n DeletePublicFile,\n DeletePrivateFile,\n GetPrivateFile,\n GetPrivateFileLink,\n ListPrivateFiles,\n PrivateStorageResponse,\n PutPrivateFile,\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 GetAppSettings,\n GetStats,\n HideNotification,\n HostInformation,\n I18nMap,\n Interaction,\n KnockKnock,\n LayoutPosition,\n ListPublicFiles,\n LocalConnectorMessageReceived,\n MenuClicked,\n MenuEntry,\n NotificationButtonClicked,\n NotificationDismissed,\n NotificationInfo,\n PendingDevicesInfo,\n PositionUpdated,\n SafeAreaInsets,\n SafeAreaInsetsUpdated,\n PrivacyChanged,\n PublicStorageResponse,\n PutPublicFile,\n Rect,\n RequestSerialPortAccess,\n SerialPortAccessResult,\n RequestStreamSizeUpdate,\n ResizeMode,\n SaveSettings,\n SendKnockKnock,\n SendMessageTo,\n SendMessageToAll,\n SendToLocalFrame,\n SendToSerialPort,\n SetAppSettings,\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\n/// Host → Frame, fallback for `SharedStreamAvailable` when the host cannot\n/// transfer track readables into this frame (frame on another site, or no\n/// MediaStreamTrackProcessor). The stream travels over a local\n/// RTCPeerConnection signaled through `port` (see SharedStreamPeer.ts).\nexport type SharedStreamOffer = {\n streamId: string\n port: MessagePort\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 * Insets the frame must keep its controls clear of, when the host runs it\n * edge-to-edge (`CompanionFrameOption.edgeToEdge`); later changes arrive\n * as `safeAreaInsetsUpdated`. Absent from hosts before 1.51 — read as all\n * zero. Added 1.51.\n */\n safeAreaInsets?: SafeAreaInsets\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: 'appSettingsResponse' } & AppSettingsResponse)\n | ({ type: 'appSettingsChanged' } & AppSettingsChanged)\n | ({ type: 'publicStorageResponse' } & PublicStorageResponse)\n | ({ type: 'privateStorageResponse' } & PrivateStorageResponse)\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: 'safeAreaInsetsUpdated' } & SafeAreaInsetsUpdated)\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: 'sharedStreamOffer' } & SharedStreamOffer)\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: 'getAppSettings' } & GetAppSettings)\n | ({ type: 'setAppSettings' } & SetAppSettings)\n | ({ type: 'putPublicFile' } & PutPublicFile)\n | ({ type: 'deletePublicFile' } & DeletePublicFile)\n | ({ type: 'listPublicFiles' } & ListPublicFiles)\n | ({ type: 'putPrivateFile' } & PutPrivateFile)\n | ({ type: 'deletePrivateFile' } & DeletePrivateFile)\n | ({ type: 'listPrivateFiles' } & ListPrivateFiles)\n | ({ type: 'getPrivateFile' } & GetPrivateFile)\n | ({ type: 'getPrivateFileLink' } & GetPrivateFileLink)\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 | ({\n type: 'requestSerialPortAccess'\n requestId: string\n } & 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"]}
|
package/dist/Frame/Frame.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { CrdtChannel } from '../Common/CrdtChannel.js';
|
|
|
3
3
|
import { BlobStore } from '../Common/BlobStore.js';
|
|
4
4
|
import { AiChannel } from '../Common/AiChannel.js';
|
|
5
5
|
import type { PublicStorageApi } from '../Common/PublicStorage.js';
|
|
6
|
+
import type { PrivateStorageApi } from '../Common/PrivateStorage.js';
|
|
6
7
|
import type { AppId, AppSettingsLevel, AppSettingsValue, BluetoothFromApp, BluetoothToApp, BorderOptions, CompanionInformation, ConnectedMediaDevice, Device, DeviceFrameReference, DeviceFullscreenUpdated, DeviceMessageReceived, DeviceScalingUpdated, Field, FileData, FramePeer, HostInformation, KnockKnock, LayoutPosition, LoadedFrame, MessageTarget, NotificationButtonClicked, NotificationInfo, PositionUpdated, SafeAreaInsets, SafeAreaInsetsUpdated, Privacy, Rect, ReplacedBy, RequestSerialPortAccess, RequestStreamSizeUpdate, SendKnockKnock, SendMessageTo, SendMessageToAll, SendToSerialPort, StatsResponse, StreamCapture, UpdatedStateEntry, UpdateStateEntry, Visibility, VisibilityChanged, VitreSettings, VitreSettingsSetter, VoiceAction, VoiceActionDetection } from '../Common/index.js';
|
|
7
8
|
import type { Connector, ShareStreamOptions } from '../Connector/index.js';
|
|
8
9
|
import type { MediaTrackInfo } from '../Connector/Connector.Model.js';
|
|
@@ -153,6 +154,16 @@ export declare class Frame {
|
|
|
153
154
|
* Vitre-hosted frame has this — a companion frame cannot write.
|
|
154
155
|
*/
|
|
155
156
|
readonly publicStorage: PublicStorageApi;
|
|
157
|
+
/**
|
|
158
|
+
* Private file storage scoped to the vitre's TEAM — see the README
|
|
159
|
+
* "Private storage" section for the full semantics. Unlike
|
|
160
|
+
* `publicStorage`, files here have no public link: readable by any
|
|
161
|
+
* vitre or companion of the team via `get` or a temporary `getLink`
|
|
162
|
+
* signed link, never by an anonymous visitor. Full (put/delete/list/
|
|
163
|
+
* get/getLink) on a Vitre-hosted frame; a companion frame only has
|
|
164
|
+
* `list`/`get`/`getLink` (see the `CompanionFrame` exported type).
|
|
165
|
+
*/
|
|
166
|
+
readonly privateStorage: PrivateStorageApi;
|
|
156
167
|
/**
|
|
157
168
|
* AI tool channel — publish a catalog of tools the on-prem agent's LLM can call
|
|
158
169
|
* on this frame: `ai.registerTools([{ name, description, parameters, sensitive }],
|
|
@@ -253,6 +264,8 @@ export declare class Frame {
|
|
|
253
264
|
* buffer, in case it's a subarray) so the transferred bytes match the
|
|
254
265
|
* size the caller intended. */
|
|
255
266
|
private toPublicFileBuffer;
|
|
267
|
+
/** Same normalization as {@link toPublicFileBuffer}, for `privateStorage.put`. */
|
|
268
|
+
private toPrivateFileBuffer;
|
|
256
269
|
private toShareTracks;
|
|
257
270
|
/**
|
|
258
271
|
* Share a `MediaStream` the frame produced (e.g. a WebGL-transformed track,
|
package/dist/Frame/Frame.js
CHANGED
|
@@ -6,6 +6,7 @@ import { AiChannel, MIN_AI_HOST_VERSION } from '../Common/AiChannel.js';
|
|
|
6
6
|
import { isMinVersion } from '../Common/index.js';
|
|
7
7
|
import { AppSettingsError, APP_SETTINGS_TIMEOUT_MS } from '../Common/AppSettings.js';
|
|
8
8
|
import { PublicStorageError, PUBLIC_STORAGE_TIMEOUT_MS, PUBLIC_STORAGE_PUT_TIMEOUT_MS, MAX_PUBLIC_FILE_SIZE_BYTES, validateExpiresIn, putPublicFileExpiryField, withDownloadUrlFallback, } from '../Common/PublicStorage.js';
|
|
9
|
+
import { PrivateStorageError, PRIVATE_STORAGE_TIMEOUT_MS, PRIVATE_STORAGE_PUT_TIMEOUT_MS, PRIVATE_STORAGE_GET_TIMEOUT_MS, MAX_PRIVATE_FILE_SIZE_BYTES, validatePrivatePath, validatePrivateExpiresIn, validateLinkExpiresIn, privateFileExpiryField, } from '../Common/PrivateStorage.js';
|
|
9
10
|
import { apiVersion } from '../Version.js';
|
|
10
11
|
import { acceptSharedStreamOffer, } from './SharedStreamPeer.js';
|
|
11
12
|
export class Frame {
|
|
@@ -534,6 +535,101 @@ export class Frame {
|
|
|
534
535
|
},
|
|
535
536
|
}
|
|
536
537
|
});
|
|
538
|
+
/**
|
|
539
|
+
* Private file storage scoped to the vitre's TEAM — see the README
|
|
540
|
+
* "Private storage" section for the full semantics. Unlike
|
|
541
|
+
* `publicStorage`, files here have no public link: readable by any
|
|
542
|
+
* vitre or companion of the team via `get` or a temporary `getLink`
|
|
543
|
+
* signed link, never by an anonymous visitor. Full (put/delete/list/
|
|
544
|
+
* get/getLink) on a Vitre-hosted frame; a companion frame only has
|
|
545
|
+
* `list`/`get`/`getLink` (see the `CompanionFrame` exported type).
|
|
546
|
+
*/
|
|
547
|
+
Object.defineProperty(this, "privateStorage", {
|
|
548
|
+
enumerable: true,
|
|
549
|
+
configurable: true,
|
|
550
|
+
writable: true,
|
|
551
|
+
value: {
|
|
552
|
+
put: async (path, data, contentType, scope = 'app', options) => {
|
|
553
|
+
validatePrivatePath(path);
|
|
554
|
+
validatePrivateExpiresIn(options?.expiresIn);
|
|
555
|
+
const buffer = await this.toPrivateFileBuffer(data);
|
|
556
|
+
if (buffer.byteLength > MAX_PRIVATE_FILE_SIZE_BYTES) {
|
|
557
|
+
throw new PrivateStorageError('tooLarge');
|
|
558
|
+
}
|
|
559
|
+
const requestId = randomUuid();
|
|
560
|
+
return await this.postRequest({
|
|
561
|
+
type: 'putPrivateFile',
|
|
562
|
+
requestId,
|
|
563
|
+
scope,
|
|
564
|
+
path,
|
|
565
|
+
contentType,
|
|
566
|
+
data: buffer,
|
|
567
|
+
...privateFileExpiryField(options?.expiresIn),
|
|
568
|
+
}, (msg, resolve, reject) => {
|
|
569
|
+
if (msg.type === 'privateStorageResponse' && msg.requestId === requestId) {
|
|
570
|
+
if (msg.ok) {
|
|
571
|
+
resolve(msg.file ?? { path, size: buffer.byteLength, contentType });
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
reject(new PrivateStorageError(msg.error ?? 'failed'));
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}, [buffer], { ms: PRIVATE_STORAGE_PUT_TIMEOUT_MS, onTimeout: () => new PrivateStorageError('unsupported') });
|
|
578
|
+
},
|
|
579
|
+
delete: async (path, scope = 'app') => {
|
|
580
|
+
const requestId = randomUuid();
|
|
581
|
+
await this.postRequest({ type: 'deletePrivateFile', requestId, scope, path }, (msg, resolve, reject) => {
|
|
582
|
+
if (msg.type === 'privateStorageResponse' && msg.requestId === requestId) {
|
|
583
|
+
if (msg.ok)
|
|
584
|
+
resolve(undefined);
|
|
585
|
+
else
|
|
586
|
+
reject(new PrivateStorageError(msg.error ?? 'failed'));
|
|
587
|
+
}
|
|
588
|
+
}, undefined, { ms: PRIVATE_STORAGE_TIMEOUT_MS, onTimeout: () => new PrivateStorageError('unsupported') });
|
|
589
|
+
},
|
|
590
|
+
list: async (prefix, scope = 'app') => {
|
|
591
|
+
const requestId = randomUuid();
|
|
592
|
+
return await this.postRequest({ type: 'listPrivateFiles', requestId, scope, prefix }, (msg, resolve, reject) => {
|
|
593
|
+
if (msg.type === 'privateStorageResponse' && msg.requestId === requestId) {
|
|
594
|
+
if (msg.ok)
|
|
595
|
+
resolve({ scope, files: msg.files ?? [] });
|
|
596
|
+
else
|
|
597
|
+
reject(new PrivateStorageError(msg.error ?? 'failed'));
|
|
598
|
+
}
|
|
599
|
+
}, undefined, { ms: PRIVATE_STORAGE_TIMEOUT_MS, onTimeout: () => new PrivateStorageError('unsupported') });
|
|
600
|
+
},
|
|
601
|
+
get: async (path, scope = 'app') => {
|
|
602
|
+
const requestId = randomUuid();
|
|
603
|
+
return await this.postRequest({ type: 'getPrivateFile', requestId, scope, path }, (msg, resolve, reject) => {
|
|
604
|
+
if (msg.type === 'privateStorageResponse' && msg.requestId === requestId) {
|
|
605
|
+
if (msg.ok && msg.data)
|
|
606
|
+
resolve({ data: msg.data, contentType: msg.contentType ?? '' });
|
|
607
|
+
else
|
|
608
|
+
reject(new PrivateStorageError(msg.error ?? 'failed'));
|
|
609
|
+
}
|
|
610
|
+
}, undefined, { ms: PRIVATE_STORAGE_GET_TIMEOUT_MS, onTimeout: () => new PrivateStorageError('unsupported') });
|
|
611
|
+
},
|
|
612
|
+
getLink: async (path, options) => {
|
|
613
|
+
validateLinkExpiresIn(options?.expiresIn);
|
|
614
|
+
const scope = options?.scope ?? 'app';
|
|
615
|
+
const requestId = randomUuid();
|
|
616
|
+
return await this.postRequest({
|
|
617
|
+
type: 'getPrivateFileLink',
|
|
618
|
+
requestId,
|
|
619
|
+
scope,
|
|
620
|
+
path,
|
|
621
|
+
...privateFileExpiryField(options?.expiresIn),
|
|
622
|
+
}, (msg, resolve, reject) => {
|
|
623
|
+
if (msg.type === 'privateStorageResponse' && msg.requestId === requestId) {
|
|
624
|
+
if (msg.ok && msg.link)
|
|
625
|
+
resolve(msg.link);
|
|
626
|
+
else
|
|
627
|
+
reject(new PrivateStorageError(msg.error ?? 'failed'));
|
|
628
|
+
}
|
|
629
|
+
}, undefined, { ms: PRIVATE_STORAGE_TIMEOUT_MS, onTimeout: () => new PrivateStorageError('unsupported') });
|
|
630
|
+
},
|
|
631
|
+
}
|
|
632
|
+
});
|
|
537
633
|
/**
|
|
538
634
|
* AI tool channel — publish a catalog of tools the on-prem agent's LLM can call
|
|
539
635
|
* on this frame: `ai.registerTools([{ name, description, parameters, sensitive }],
|
|
@@ -788,6 +884,9 @@ export class Frame {
|
|
|
788
884
|
case 'publicStorageResponse':
|
|
789
885
|
// Handled by requestResolvers (postRequest pattern)
|
|
790
886
|
break;
|
|
887
|
+
case 'privateStorageResponse':
|
|
888
|
+
// Handled by requestResolvers (postRequest pattern)
|
|
889
|
+
break;
|
|
791
890
|
case 'vitreSettingsUpdated':
|
|
792
891
|
this.hostInformation = {
|
|
793
892
|
...this.hostInformation,
|
|
@@ -1213,6 +1312,14 @@ export class Frame {
|
|
|
1213
1312
|
return await data.arrayBuffer();
|
|
1214
1313
|
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
1215
1314
|
}
|
|
1315
|
+
/** Same normalization as {@link toPublicFileBuffer}, for `privateStorage.put`. */
|
|
1316
|
+
async toPrivateFileBuffer(data) {
|
|
1317
|
+
if (data instanceof ArrayBuffer)
|
|
1318
|
+
return data;
|
|
1319
|
+
if (data instanceof Blob)
|
|
1320
|
+
return await data.arrayBuffer();
|
|
1321
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
1322
|
+
}
|
|
1216
1323
|
toShareTracks(stream) {
|
|
1217
1324
|
const tracks = [];
|
|
1218
1325
|
const transfer = [];
|