openrtc 2.0.0-rc.2 → 2.0.0-rc.21

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 (72) hide show
  1. package/README.md +11 -1
  2. package/dist/DelegatingRuntimeAdapter-7Y3gss5D.d.ts +134 -0
  3. package/dist/OpenRTCShared-LDKG5RPN.js +1 -0
  4. package/dist/WasmBridge-T5XMT6FH.js +1 -0
  5. package/dist/chunk-5OHYIHPT.js +1 -0
  6. package/dist/chunk-DA3HSI3K.js +2 -0
  7. package/dist/chunk-FAPRYEWI.js +2 -0
  8. package/dist/chunk-HTAWPIP2.js +2 -0
  9. package/dist/chunk-PPZRTJHE.js +3 -0
  10. package/dist/chunk-PQK5SJ47.js +1 -0
  11. package/dist/{chunk-RD3JEGGF.js → chunk-QHSM5NFZ.js} +2 -2
  12. package/dist/{chunk-7Z6N46RB.js → chunk-RRMBD5OL.js} +1 -1
  13. package/dist/{chunk-A3IAG6EL.js → chunk-WWC767HK.js} +1 -1
  14. package/dist/chunk-Z2WVSXPW.js +1 -0
  15. package/dist/deviceManagement-PHY5TIOS.js +1 -0
  16. package/dist/deviceProfile-3BEQZLJF.js +2 -0
  17. package/dist/deviceRoster-GHF6MWXF.js +1 -0
  18. package/dist/dist-FIVA6EPA.js +277 -0
  19. package/dist/factories-SMMQHXUH.js +1 -0
  20. package/dist/index.d.ts +4 -6
  21. package/dist/index.js +1 -1
  22. package/dist/ipcFactory-AR3VIBM4.js +1 -0
  23. package/dist/native.d.ts +4 -7
  24. package/dist/native.js +1 -1
  25. package/dist/openrtc-3YHRRPAG.js +2 -0
  26. package/dist/openrtc_bg.wasm +0 -0
  27. package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -3
  28. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  29. package/dist/runtime/device-status.d.ts +2 -2
  30. package/dist/runtime/index.d.ts +21 -73
  31. package/dist/runtime/index.js +1 -2
  32. package/dist/testing.d.ts +7 -17
  33. package/dist/testing.js +1 -1
  34. package/dist/transport/index.d.ts +2 -2
  35. package/dist/transport/index.js +1 -1
  36. package/dist/{types-BVJr065k.d.ts → types-BwmoJU2O.d.ts} +3 -1
  37. package/dist/{OpenRTCShared-ZQPu5LqL.d.ts → types-DE4iPkMB.d.ts} +268 -8
  38. package/dist/{types-DkgaCyqS.d.ts → types-oGGnaSW2.d.ts} +2 -2
  39. package/package.json +1 -25
  40. package/dist/DelegatingRuntimeAdapter-DqfHkjLy.d.ts +0 -373
  41. package/dist/OpenRTCShared-TKAQLONA.js +0 -1
  42. package/dist/WasmBridge-2A22U7RU.js +0 -1
  43. package/dist/auth/index.d.ts +0 -78
  44. package/dist/auth/index.js +0 -1
  45. package/dist/auth/internal.d.ts +0 -4
  46. package/dist/auth/internal.js +0 -1
  47. package/dist/chunk-2QHDEGVX.js +0 -1
  48. package/dist/chunk-3USHQ7QW.js +0 -3
  49. package/dist/chunk-5LRLWIT5.js +0 -1
  50. package/dist/chunk-6TAVJ46R.js +0 -1
  51. package/dist/chunk-BXFXPIXO.js +0 -1
  52. package/dist/chunk-F2XGNLXL.js +0 -2
  53. package/dist/chunk-GW7P3D54.js +0 -1
  54. package/dist/chunk-IEQTFQ3Q.js +0 -1
  55. package/dist/chunk-K37WVIZL.js +0 -1
  56. package/dist/chunk-N26S7V4N.js +0 -1
  57. package/dist/chunk-N4SX7C3W.js +0 -2
  58. package/dist/chunk-NB4H5TP3.js +0 -1
  59. package/dist/chunk-PODAMIL6.js +0 -2
  60. package/dist/chunk-UEYM6WTT.js +0 -2
  61. package/dist/chunk-VK6KX433.js +0 -1
  62. package/dist/chunk-YBXGNKM7.js +0 -2
  63. package/dist/chunk-YQWQDTQ3.js +0 -2
  64. package/dist/factories-SIVMTIHJ.js +0 -1
  65. package/dist/ipc-CflAVodw.d.ts +0 -11
  66. package/dist/ipcFactory-QY44OIKA.js +0 -1
  67. package/dist/runtime/legacy.d.ts +0 -18
  68. package/dist/runtime/legacy.js +0 -1
  69. package/dist/runtime/tauri.d.ts +0 -6
  70. package/dist/runtime/tauri.js +0 -1
  71. package/dist/tauri-Cz9n17g8.d.ts +0 -33
  72. package/dist/types-DNl4KHHY.d.ts +0 -195
@@ -1,373 +0,0 @@
1
- import { D as Device, n as DiscoveryMode, o as AuthMode, p as SignalingMode, i as ClientOptions, E as ExplicitFileDataSendParams, q as ISignalingBackend, j as RoomMember, R as RuntimeIdentity, r as SignalingEnvelope, h as DeviceStatusSnapshot, m as PeerSessionSnapshot, s as BackendPeerBiStream, t as BackendPeerUniStream, u as ManagedConnectionRecord, v as ResolvedPeerIdentity, w as DeviceEvent, x as DesiredPeerProjection, y as CoreClientBridgeHost, N as NativeConnectParams, z as NativeConnectResult, S as SignalingSession, F as SessionEvent, B as BackendConnectionState, L as LocalDeviceInfo, G as NativeManagedSessionStartResult, H as GrantScope } from './types-BVJr065k.js';
2
- import { R as RuntimeCapabilities } from './capabilities-YSskrE8H.js';
3
- import { A as AuthContext } from './IEngineBridge-BbsT8hof.js';
4
-
5
- interface NativeTrustToken {
6
- token: string;
7
- expiresAtMs: number;
8
- }
9
-
10
- /** Internal-only gateway record before normalization; includes namespace fields omitted from the public Device type. */
11
- type RawDeviceDoc = Device & {
12
- appTag?: string;
13
- tag?: string;
14
- };
15
-
16
- interface WasmBridgeOptions {
17
- apiKey?: string;
18
- discoveryMode?: DiscoveryMode;
19
- space?: string;
20
- spaceKey?: string;
21
- authMode?: AuthMode;
22
- signalingMode?: SignalingMode;
23
- projectId?: string;
24
- coordinationGateway?: ClientOptions['coordinationGateway'];
25
- coordinationAvenueOverride?: ClientOptions['coordinationAvenueOverride'];
26
- platformAttestationTokenProvider?: ClientOptions['platformAttestationTokenProvider'];
27
- /** Internal host hint used by the provider-neutral gateway projection. */
28
- coordinationPlatformType?: 'web' | 'desktop' | 'mobile';
29
- storagePrefix?: string;
30
- deviceIdPersistence?: 'persistent' | 'ephemeral';
31
- endpointIdPersistence?: 'persistent' | 'ephemeral';
32
- nodeIdPersistence?: 'persistent' | 'ephemeral';
33
- localDeviceId?: string;
34
- deviceName?: string;
35
- turnCredentialsProvider?: () => Promise<{
36
- iceServers?: RTCIceServer[];
37
- } | null | undefined>;
38
- applicationCrypto?: ExplicitFileDataSendParams['applicationCrypto'];
39
- spaceAuth?: 'scoped-token';
40
- }
41
- /**
42
- * WasmBridge is the browser host wrapper over the Rust/WASM runtime.
43
- *
44
- * Allowed:
45
- * - normalize JS/WASM binding shapes
46
- * - forward auth, discovery, signaling, and lifecycle calls into Rust
47
- * - expose typed browser-facing results
48
- *
49
- * Not allowed:
50
- * - become a second lifecycle engine
51
- * - invent peer identity or connect policy that is not backed by Rust
52
- * - normalize app-specific payload protocols into runtime behavior
53
- *
54
- * Source of truth:
55
- * - Rust/WASM owns transport/runtime connection state and lifecycle primitives
56
- * - The selected coordination provider owns browser delivery projections
57
- * - RuntimeClient owns app-facing orchestration across those surfaces
58
- */
59
- declare class WasmBridge implements ISignalingBackend {
60
- private static readonly EXPLICIT_FILE_PROTOCOL_TYPE;
61
- private static readonly EXPLICIT_FILE_CHUNK_SIZE_BYTES;
62
- private static readonly MAX_EXPLICIT_TRANSFER_HEADER_BYTES;
63
- private static readonly FALLBACK_EXPLICIT_FILE_NAME;
64
- private static readonly MAX_EXPLICIT_FILE_NAME_CHARS;
65
- private static readonly FALLBACK_EXPLICIT_MIME_TYPE;
66
- private static readonly MAX_EXPLICIT_MIME_TYPE_CHARS;
67
- app: any | null;
68
- auth: any | null;
69
- private readonly appTag;
70
- protected options: {
71
- appTag: string;
72
- apiKey?: string;
73
- discoveryMode?: DiscoveryMode;
74
- space?: string;
75
- spaceKey?: string;
76
- authMode: AuthMode;
77
- signalingMode?: SignalingMode;
78
- projectId: string;
79
- coordinationGateway?: ClientOptions['coordinationGateway'];
80
- coordinationAvenueOverride?: ClientOptions['coordinationAvenueOverride'];
81
- platformAttestationTokenProvider?: ClientOptions['platformAttestationTokenProvider'];
82
- coordinationPlatformType?: 'web' | 'desktop' | 'mobile';
83
- storagePrefix?: string;
84
- deviceIdPersistence?: 'persistent' | 'ephemeral';
85
- endpointIdPersistence?: 'persistent' | 'ephemeral';
86
- nodeIdPersistence?: 'persistent' | 'ephemeral';
87
- localDeviceId?: string;
88
- deviceName?: string;
89
- strictMode?: boolean;
90
- turnCredentialsProvider?: () => Promise<{
91
- iceServers?: RTCIceServer[];
92
- } | null | undefined>;
93
- applicationCrypto?: ExplicitFileDataSendParams['applicationCrypto'];
94
- spaceTokenProvider?: ClientOptions['spaceTokenProvider'];
95
- spaceAuth?: 'scoped-token';
96
- };
97
- private spaceNamespaceIdPromise;
98
- private cachedSpaceNamespaceId;
99
- private authListeners;
100
- private persistenceReady;
101
- wasmClient: any;
102
- private readonly createdAtMs;
103
- private missingWasmWarnings;
104
- private readonly wasmReadyWarningDelayMs;
105
- private browserCoordinationSignaling;
106
- private readonly nativeTrustTokens;
107
- private lastObservedFirebaseUserId;
108
- private sessionReaders;
109
- protected authContext: {
110
- userId: string;
111
- token?: string | null;
112
- refreshToken?: string | null;
113
- customToken?: string | null;
114
- tokenProvider?: (forceRefresh?: boolean) => Promise<string | null>;
115
- appCheckTokenProvider?: (forceRefresh?: boolean) => Promise<string | null>;
116
- expiresAtMs?: number | null;
117
- } | null;
118
- private injectedBrowserAuthSessionActive;
119
- private readonly presenceManager;
120
- private hasSyncedAuthToWasmClient;
121
- private lastWasmAuthUserId;
122
- private lastWasmAuthToken;
123
- private lastDeliveredConnectionStates;
124
- private authScopedRuntimeGeneration;
125
- private coreClient;
126
- private readonly applicationRouteEscalations;
127
- private applicationRouteEscalationUnsubscribe;
128
- private applicationRouteEscalationSubscriptionGeneration;
129
- private applicationRouteEscalationSubscriptionEpoch;
130
- constructor(options: WasmBridgeOptions);
131
- get tag(): string;
132
- getRuntimeCapabilities(): RuntimeCapabilities;
133
- private static readonly WEB_DEVICE_ID_STORAGE_PREFIX;
134
- private static readonly EPHEMERAL_DEVICE_ID_TTL_MS;
135
- private getDeviceIdentityStorageKey;
136
- private getDeviceIdPersistenceMode;
137
- private isTicketOnlyMode;
138
- private usesProviderNeutralGrant;
139
- private createRandomDeviceId;
140
- protected resolveWebLogicalDeviceId(): string;
141
- private getDefaultBrowserDeviceName;
142
- private getCoordinationSignaling;
143
- usesCoordinationGateway(): boolean;
144
- /** Restore the existing gateway delivery subscription after a native host resumes. */
145
- reconnectCoordinationAfterHostResume(): Promise<void>;
146
- getCoordinationNativeTrustToken(forceRefresh?: boolean): Promise<NativeTrustToken>;
147
- invalidateCoordinationNativeTrustToken(): void;
148
- subscribeCoordinationNativeTrustToken(listener: (token: NativeTrustToken | null) => void, options?: {
149
- emitCurrent?: boolean;
150
- }): () => void;
151
- setCoordinationLocalDeviceId(deviceId: string): void;
152
- /** Internal native-host hint for provider-neutral roster presentation. */
153
- setCoordinationPlatformType(platformType: 'desktop' | 'mobile'): void;
154
- setCoordinationExcludedPeers(excludedPeers: string[]): Promise<void>;
155
- joinCoordinationRoom(roomId: string, nodeId: string, ticket: string): Promise<void>;
156
- leaveCoordinationRoom(roomId: string): Promise<void>;
157
- getCoordinationRoomMembers(roomId: string): Promise<RoomMember[]>;
158
- watchCoordinationRoomMembers(roomId: string, callback: (members: RoomMember[]) => void): () => void;
159
- private withWebPresenceMetadata;
160
- setAuthContext(context: {
161
- userId: string;
162
- token?: string | null;
163
- refreshToken?: string | null;
164
- customToken?: string | null;
165
- tokenProvider?: (forceRefresh?: boolean) => Promise<string | null>;
166
- appCheckTokenProvider?: (forceRefresh?: boolean) => Promise<string | null>;
167
- expiresAtMs?: number | null;
168
- } | null): Promise<void>;
169
- private ensureBrowserPlatformAuth;
170
- private syncWasmAuthToken;
171
- private toRuntimeIdentity;
172
- protected getCurrentUserId(): string | null;
173
- getCurrentUserIdForScope(): string | null;
174
- getAuthContext(): Readonly<typeof this.authContext> | null;
175
- protected isSpaceMode(): boolean;
176
- getResolvedOptions(): Readonly<typeof this.options>;
177
- protected getDiscoveryScopeId(): string | null;
178
- protected matchesTag(device: Pick<RawDeviceDoc, 'tag' | 'appTag'>): boolean;
179
- matchesLegacyOrCurrentTag(device: Pick<RawDeviceDoc, 'tag' | 'appTag'>): boolean;
180
- private stopSessionSubscriptions;
181
- private stopRuntimeAuthScopedLoops;
182
- stopAuthScopedActivity(options?: {
183
- userId?: string | null;
184
- }): Promise<void>;
185
- setWasmClient(client: any): void;
186
- private warnMissingWasmOnce;
187
- private waitForWasmClient;
188
- protected normalizeDevice(raw: Record<string, any>, fallbackId?: string): Device;
189
- normalizeDeviceRecord(raw: Record<string, any>, fallbackId?: string): Device;
190
- getResolvedWebLogicalDeviceId(): string;
191
- private normalizeDeviceStatusSnapshot;
192
- private normalizePeerSessionSnapshot;
193
- private toBackendConnectionStateFromPeerSession;
194
- private normalizeConnectionStateSnapshot;
195
- private stabilizeConnectionState;
196
- private sameConnectionState;
197
- private deliverConnectionState;
198
- private get browserPresenceLoopState();
199
- private set browserPresenceLoopState(value);
200
- get currentUser(): RuntimeIdentity | null;
201
- onAuthChange(callback: (user: RuntimeIdentity | null) => void): () => void;
202
- checkForSSOToken(): Promise<void>;
203
- waitForAuth(): Promise<void>;
204
- signInAnonymously(): Promise<void>;
205
- signInWithPluto(): Promise<void>;
206
- signOut(): Promise<void>;
207
- getTurnCredentials(): Promise<any>;
208
- updatePresence(localNodeId: string, ticketStr: string, isOnline?: boolean, ttlMs?: number, metadata?: string, deviceNameOverride?: string): Promise<void>;
209
- refreshLivePresence(localNodeId: string, ticketStr: string, metadata?: string, deviceNameOverride?: string): Promise<void>;
210
- setOffline(localNodeId: string): Promise<void>;
211
- updateDevice(deviceId: string, updates: {
212
- deviceName?: string;
213
- capabilities?: Device['capabilities'];
214
- metadata?: string;
215
- excludedPeers?: string[];
216
- }): Promise<void>;
217
- deleteDevice(deviceId: string): Promise<void>;
218
- cleanupStaleDevices(): Promise<void>;
219
- sendMessage(targetId: string, payload: string, state?: string, replyPayload?: string): Promise<string>;
220
- pollMessages(targetId: string): Promise<SignalingEnvelope[]>;
221
- searchDevices(excludeNodeId?: string): Promise<Device[]>;
222
- listDevicesWithStatus(): Promise<DeviceStatusSnapshot[]>;
223
- getPeerSession(id: string): Promise<PeerSessionSnapshot | null>;
224
- listPeerSessions(): Promise<PeerSessionSnapshot[]>;
225
- waitForSettledPeer(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
226
- openPeerBi(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
227
- openPeerNativeBi(id: string, label: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
228
- openPeerBiTransportOnly(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
229
- openPeerUni(id: string, timeoutMs?: number): Promise<BackendPeerUniStream>;
230
- resolvePeerConnectionRecords(id: string): Promise<ManagedConnectionRecord[]>;
231
- resolvePeerIdentity(id: string): Promise<ResolvedPeerIdentity>;
232
- onDevicesChange(callback: (devices: Device[]) => void, excludeNodeId?: string): () => void;
233
- subscribeDevices(userId: string): Promise<ReadableStream<DeviceEvent[]>>;
234
- startAutoConnect(userId: string, localDeviceId: string): Promise<void>;
235
- startAutoConnectOnce(userId: string, localDeviceId: string): Promise<void>;
236
- notifyDisconnectRequested(remoteNodeId: string): void;
237
- setAutoConnectExcluded(deviceId: string, excluded: boolean): Promise<void>;
238
- disconnectDevice(deviceId: string): Promise<void>;
239
- submitDesiredPeerProjection(revision: number, peers: DesiredPeerProjection[]): Promise<void>;
240
- setCoreClient(client: CoreClientBridgeHost | null): void;
241
- private startApplicationRouteEscalationSubscription;
242
- private stopApplicationRouteEscalationSubscription;
243
- private retryManagedApplicationRouteEscalations;
244
- private escalateManagedApplicationRoute;
245
- connectToDevice(params: NativeConnectParams): Promise<NativeConnectResult>;
246
- forceReconnectSnapshot(): void;
247
- startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): void;
248
- private ensureSpaceNamespaceIdPromise;
249
- createSession(session: SignalingSession): Promise<void>;
250
- updateSession(sessionId: string, updateData: any): Promise<void>;
251
- subscribeSessions(localDeviceId: string): Promise<ReadableStream<SessionEvent[]>>;
252
- getLocalDeviceId(): Promise<string | null>;
253
- isConnected(node_id: string): Promise<boolean>;
254
- private hasConnectedIndependentPeerRoute;
255
- getConnectionStates(): Promise<BackendConnectionState[]>;
256
- onConnectionStateChange(callback: (state: BackendConnectionState) => void): Promise<() => void> | (() => void);
257
- sendExplicitFilePath(connectionId: string, filePath: string, transferId?: string): Promise<string>;
258
- private sanitizeExplicitFileName;
259
- private sanitizeExplicitMimeType;
260
- private assertExplicitTransferHeaderSize;
261
- private createWebRTCExplicitTransferId;
262
- private createWebRTCExplicitTransferFrame;
263
- sendExplicitFileData(params: ExplicitFileDataSendParams): Promise<void>;
264
- getTransferHistory(limit?: number): Promise<Array<[string, unknown]>>;
265
- deleteTransferJob(jobId: string): Promise<void>;
266
- watchFriendDevices(friendUserIds: string[], callback: (friendDevices: Map<string, any[]>) => void): () => void;
267
- updateFriendTicket(friendTicket: string | null): Promise<void>;
268
- }
269
-
270
- declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
271
- protected readonly backend: ISignalingBackend;
272
- protected constructor(backend: ISignalingBackend);
273
- get currentUser(): RuntimeIdentity | null;
274
- setAuthContext(context: AuthContext | null): Promise<void> | void;
275
- signInAnonymously(): Promise<void>;
276
- signInWithPluto(): Promise<void>;
277
- signOut(): Promise<void>;
278
- stopAuthScopedActivity(): Promise<void>;
279
- usesCoordinationGateway(): boolean;
280
- joinCoordinationRoom(roomId: string, nodeId: string, ticket: string): Promise<void>;
281
- leaveCoordinationRoom(roomId: string): Promise<void>;
282
- getCoordinationRoomMembers(roomId: string): Promise<RoomMember[]>;
283
- watchCoordinationRoomMembers(roomId: string, callback: (members: RoomMember[]) => void): () => void;
284
- getTurnCredentials(): Promise<any>;
285
- updatePresence(localNodeId: string, ticketStr: string, isOnline: boolean, ttlMs: number, metadata?: string): Promise<void>;
286
- refreshLivePresence(localNodeId: string, ticketStr: string, metadata?: string): Promise<void>;
287
- setOffline(localNodeId: string): Promise<void>;
288
- cleanupStaleDevices(): Promise<void>;
289
- searchDevices(excludeNodeId?: string): Promise<Device[]>;
290
- listDevicesWithStatus(): Promise<DeviceStatusSnapshot[]>;
291
- getPeerSession(id: string): Promise<PeerSessionSnapshot | null>;
292
- listPeerSessions(): Promise<PeerSessionSnapshot[]>;
293
- waitForSettledPeer(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
294
- resolvePeerIdentity(id: string): Promise<ResolvedPeerIdentity>;
295
- resolvePeerConnectionRecords(id: string): Promise<ManagedConnectionRecord[]>;
296
- updateDevice(deviceId: string, updates: {
297
- deviceName?: string;
298
- capabilities?: Device['capabilities'];
299
- metadata?: string;
300
- }): Promise<void>;
301
- deleteDevice(deviceId: string): Promise<void>;
302
- onDevicesChange(callback: (devices: Device[]) => void, excludeNodeId?: string): () => void;
303
- onAuthChange(callback: (user: RuntimeIdentity | null) => void): () => void;
304
- checkForSSOToken(): Promise<void>;
305
- waitForAuth(): Promise<void>;
306
- sendMessage(targetId: string, payload: string, state?: string, replyPayload?: string): Promise<string>;
307
- pollMessages(targetId: string): Promise<SignalingEnvelope[]>;
308
- watchFriendDevices(friendUserIds: string[], callback: (friendDevices: Map<string, Device[]>) => void): () => void;
309
- updateFriendTicket(friendTicket: string | null): Promise<void>;
310
- subscribeDevices(userId: string): Promise<ReadableStream<DeviceEvent[]>>;
311
- startAutoConnect(userId: string, localDeviceId: string): void;
312
- submitDesiredPeerProjection(revision: number, peers: DesiredPeerProjection[]): Promise<void>;
313
- startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): void;
314
- createSession(session: SignalingSession): Promise<void>;
315
- updateSession(sessionId: string, updateData: any): Promise<void>;
316
- subscribeSessions(localDeviceId: string): Promise<ReadableStream<SessionEvent[]>>;
317
- forceReconnectSnapshot(): void;
318
- getLocalDeviceId(): Promise<string | null>;
319
- getLocalDeviceInfo(): Promise<LocalDeviceInfo | null>;
320
- updateLocalDeviceName(deviceName: string): Promise<LocalDeviceInfo | null>;
321
- startManagedSessionNative(options: {
322
- userId: string;
323
- deviceName?: string;
324
- localDeviceId?: string | null;
325
- metadata?: string;
326
- autoConnect?: boolean;
327
- presence?: boolean;
328
- }): Promise<NativeManagedSessionStartResult>;
329
- notifyNetworkChange(options?: {
330
- reason?: string;
331
- }): Promise<unknown>;
332
- getManagedNodeId(options?: {
333
- initializeIfMissing?: boolean;
334
- }): Promise<string | null>;
335
- startPresenceLoopOnce(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): Promise<void>;
336
- startAutoConnectOnce(userId: string, localDeviceId: string): Promise<void>;
337
- getEndpointTicket(): Promise<string>;
338
- getEndpointTicketWithToken(scope: GrantScope, maxConnections: number): Promise<string | null>;
339
- registerSessionToken(token: string, scope: GrantScope, maxConnections: number): Promise<void>;
340
- revokeSessionTokensByScope(scope: GrantScope): Promise<string[]>;
341
- openPeerBi(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
342
- incoming_streams(): Promise<ReadableStream<unknown>>;
343
- is_current_transport_stable_id(endpointId: string, transportStableId: bigint): Promise<boolean>;
344
- openPeerNativeBi(id: string, label: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
345
- openPeerBiTransportOnly(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
346
- openPeerUni(id: string, timeoutMs?: number): Promise<BackendPeerUniStream>;
347
- connectToDevice(params: NativeConnectParams): Promise<NativeConnectResult>;
348
- disconnectDevice(deviceId: string): Promise<void>;
349
- setAutoConnectExcluded(deviceId: string, excluded: boolean): Promise<void>;
350
- isConnected(nodeId: string): Promise<boolean>;
351
- getConnectionStates(): Promise<BackendConnectionState[]>;
352
- onConnectionStateChange(callback: (state: BackendConnectionState) => void): Promise<() => void> | (() => void);
353
- /** @deprecated Use named channels or `openrtc-file-transfer`. */
354
- sendExplicitFilePath(connectionId: string, filePath: string, transferId?: string): Promise<string>;
355
- /** @deprecated Use named channels or `openrtc-file-transfer`. */
356
- sendExplicitFileData(params: ExplicitFileDataSendParams): Promise<void>;
357
- /** @deprecated Transfer history belongs to the consumer application. */
358
- getTransferHistory(limit?: number): Promise<Array<[string, unknown]>>;
359
- /** @deprecated Transfer history belongs to the consumer application. */
360
- deleteTransferJob(jobId: string): Promise<void>;
361
- getRuntimeCapabilities(): RuntimeCapabilities;
362
- onIncomingNativeMessage(callback: (connectionId: string, remoteNodeId: string | null, message: any) => void): Promise<() => void>;
363
- unwrap(): ISignalingBackend;
364
- /**
365
- * Forward setCoreClient() to the inner backend if it implements it. This
366
- * lets the core Client inject a reference into backends (e.g. WasmBridge)
367
- * that need to escalate transport-level dials into full Client.connect()
368
- * handshakes.
369
- */
370
- setCoreClient(client: unknown): void;
371
- }
372
-
373
- export { DelegatingRuntimeAdapter as D, type WasmBridgeOptions as W, WasmBridge as a };
@@ -1 +0,0 @@
1
- export{a as resolveOptions,b as wrapAssembly}from'./chunk-2QHDEGVX.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';
@@ -1 +0,0 @@
1
- export{w as WasmBridge}from'./chunk-YBXGNKM7.js';import'./chunk-VK6KX433.js';import'./chunk-NT5YHZQH.js';import'./chunk-N26S7V4N.js';import'./chunk-NB4H5TP3.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';
@@ -1,78 +0,0 @@
1
- import { FirebaseApp } from 'firebase/app';
2
- import { Functions } from 'firebase/functions';
3
- import { User, Auth } from 'firebase/auth';
4
-
5
- type ProviderName = 'google' | 'apple';
6
- interface SignInCredentialPayload {
7
- provider: ProviderName;
8
- idToken: string;
9
- accessToken?: string;
10
- nonce?: string;
11
- isCustomToken?: boolean;
12
- callbackId?: string;
13
- email?: string;
14
- displayName?: string;
15
- photoURL?: string;
16
- }
17
- type DesktopAuthRelay = (payload: {
18
- authToken: string | null;
19
- refreshToken: string | null;
20
- }) => Promise<void> | void;
21
- declare function registerDesktopAuthRelay(relay: DesktopAuthRelay | null): void;
22
- declare class AuthHost {
23
- private app;
24
- private auth;
25
- private functions;
26
- private appCheck;
27
- private persistenceReady;
28
- private redirectResultPromise;
29
- private redirectResultConsumed;
30
- private lastRelayedToken;
31
- private lastRelayedRefreshToken;
32
- private syncDesktopAuthToken;
33
- constructor();
34
- getApp(): FirebaseApp;
35
- getFunctions(): Functions;
36
- getAppCheckToken(forceRefresh?: boolean): Promise<string | null>;
37
- getCurrentUser(): User | null;
38
- getAuth(): Auth;
39
- onAuthStateChanged(callback: (user: User | null) => void): () => void;
40
- onIdTokenChanged(callback: (user: User | null) => void): () => void;
41
- getIdToken(options?: {
42
- forceRefresh?: boolean;
43
- }): Promise<string | null>;
44
- checkForSSOToken(): Promise<void>;
45
- signInWithCustomTokenValue(token: string): Promise<User>;
46
- signInWithPluto(options?: {
47
- redirectUri?: string;
48
- authorizeBaseUrl?: string;
49
- }): Promise<void>;
50
- waitForAuth(): Promise<void>;
51
- signInAnonymously(): Promise<void>;
52
- signIn(email: string, password: string): Promise<User>;
53
- signUp(email: string, password: string): Promise<User>;
54
- signOut(): Promise<void>;
55
- deleteAccount(): Promise<void>;
56
- signInWithCredential(payload: SignInCredentialPayload): Promise<User>;
57
- private mintSessionTokenFromProviderToken;
58
- signInWithPopup(provider: ProviderName): Promise<{
59
- idToken: string;
60
- refreshToken?: string;
61
- }>;
62
- signInWithRedirect(provider: ProviderName, options?: {
63
- nonce?: string;
64
- }): Promise<void>;
65
- consumeRedirectResult(): Promise<{
66
- fromRedirect: boolean;
67
- user: User | null;
68
- providerId?: string | null;
69
- idToken?: string | null;
70
- } | null>;
71
- startGoogleSignIn(): Promise<void>;
72
- startAppleSignIn(): Promise<void>;
73
- mintSessionToken(): Promise<string>;
74
- }
75
- declare function getAuthHost(): AuthHost;
76
- declare const authHost: AuthHost;
77
-
78
- export { authHost, getAuthHost, registerDesktopAuthRelay };
@@ -1 +0,0 @@
1
- import {c}from'../chunk-N4SX7C3W.js';export{d as authHost,b as getAuthHost,a as registerDesktopAuthRelay}from'../chunk-N4SX7C3W.js';import'../chunk-BXFXPIXO.js';import'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';c();
@@ -1,4 +0,0 @@
1
- export { registerDesktopAuthRelay } from './index.js';
2
- import 'firebase/app';
3
- import 'firebase/functions';
4
- import 'firebase/auth';
@@ -1 +0,0 @@
1
- import {c}from'../chunk-N4SX7C3W.js';export{a as registerDesktopAuthRelay}from'../chunk-N4SX7C3W.js';import'../chunk-BXFXPIXO.js';import'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';c();
@@ -1 +0,0 @@
1
- import {r}from'./chunk-RD3JEGGF.js';function O(i){let s=r({...i});if("auth"in i&&!i.authMode){let n=i.auth;s.authMode=n==="none"?"anonymous":n;}if("identity"in i){let n=i.identity,r=n==="temporary"?"ephemeral":n;!i.deviceIdPersistence&&!i.nodeIdPersistence&&(s.deviceIdPersistence=r),!i.endpointIdPersistence&&!i.nodeIdPersistence&&(s.endpointIdPersistence=r);}return "namespace"in i&&!i.storagePrefix&&(s.storagePrefix=i.namespace),"privacy"in i&&i.strictMode===void 0&&(s.strictMode=!!i.privacy),s}function I(i,s){let n=i.runtime,r=Object.create(n),l=async e=>{if(typeof e!="string")return e;let o=(await n.listDevices()).find(c=>c.deviceId===e);if(!o)throw new Error(`OpenRTC device '${e}' is not currently discoverable.`);return o},u=async e=>({...e,localDeviceId:e?.localDeviceId??await n.getLocalDeviceId()??""}),R=async e=>{let{device:t,scope:o,...c}=e,a=c.deviceId??(typeof t=="string"?t:t?.deviceId)??null,m=c.ticket??(typeof t=="string"?void 0:t?.ticket);a&&!m&&(m=(await l(a).catch(()=>null))?.ticket);let d={...c,scope:o??"session"};return a&&(d.deviceId=a),m&&(d.ticket=m),d},g={list:()=>n.listDevices(),startSession:(e={})=>n.startManagedSession({...e,platform:e.platform??s}),stopSession:e=>n.stopManagedSession(e),listWithStatus:()=>n.listDevicesWithStatus(),watch:e=>n.watchDevices(e),watchWithStatus:e=>n.watchDevicesWithStatus(e),connect:async(e,t)=>n.connectDevice(await l(e),await u(t)),connectWithRetry:async(e,t,o)=>n.connectDeviceWithRetry(await l(e),t,o),disconnect:e=>n.disconnectDevice(e),update:(e,t)=>n.updateDevice(e,t),delete:e=>n.deleteDevice(e),localId:()=>n.getLocalDeviceId(),localInfo:()=>n.getLocalDeviceInfo(),localProfile:e=>n.getLocalDeviceProfile(e),updateLocalName:e=>n.updateLocalDeviceName(e)},v={watch:e=>n.watchPeerStates(e),watchLifecycle:e=>n.watchPeerLifecycle(e),get:e=>n.getPeerState(e),listConnected:()=>n.listConnectedPeers(),connect:e=>n.connectPeer(e),disconnect:(e,t)=>n.disconnectPeer(e,t),forceDisconnect:e=>n.forceDisconnectPeer(e),session:e=>n.getPeerSession(e),sessions:()=>n.listPeerSessions(),waitConnected:(e,t)=>n.waitForConnectedPeer(e,t),readiness:(e,t)=>n.getPeerReadiness(e,t),health:e=>n.getPeerHealth(e),identity:e=>n.resolvePeerIdentity(e),addScope:(e,t)=>n.addPeerScope(e,t),releaseScope:(e,t)=>n.releasePeerScope(e,t),scopes:e=>n.getPeerScopes(e),refresh:()=>n.refreshPeerSnapshot()},C={register:e=>n.registerChannel(e),unregister:e=>n.unregisterChannel(e),list:()=>n.listChannels(),openBi:(e,t,o)=>n.openPeerBi(e,{...o,channelId:t}),openUni:(e,t,o)=>n.openPeerUni(e,{...o,channelId:t}),onIncoming:e=>n.onIncomingStream(e),onIncomingChannel:(e,t)=>n.onIncomingChannelStream(e,o=>{if(o.channel)return t(o)}),connect:async e=>n.connectScopedChannel(await R(e)),connectScoped:e=>n.connectScopedChannel(e)},P={create:e=>n.createRoom(e),join:(e,t)=>n.joinRoom(e,t),leave:e=>n.leaveRoom(e),watch:(e,t)=>n.watchRoom(e,t),members:e=>n.getRoomMembers(e)},h={raw:()=>n.getInvite(),share:e=>n.getTicketWithToken("share",e?.maxConnections??1),grant:(e,t)=>n.getTicketWithToken(e,t?.maxConnections??0),revoke:e=>n.revokeTokensByScope(e)},S={status:()=>n.getRuntimeStatus(),policy:()=>n.getRuntimePolicy(),capabilities:()=>n.getRuntimeCapabilities(),capabilityProfile:()=>n.getCapabilityProfile(),connectionStates:()=>n.getConnectionStates(),onConnectionStateChange:e=>n.onConnectionStateChange(e),connections:()=>n.getConnections(),applicationReadyConnections:e=>n.getApplicationReadyConnections(e),onConnection:e=>n.onConnection(e),onDisconnection:e=>n.onDisconnection(e),onConnectionEvent:e=>n.onConnectionEvent(e),forceReconnectSnapshot:()=>n.forceReconnectSnapshot(),peerReconciliation:()=>n.getPeerReconciliationStats()},b={runtime:n,assembly:i,nodeId:()=>n.getNodeId(),nodeIdFromTicket:e=>n.getNodeIdFromTicket(e),endpointTicket:()=>n.getEndpointTicket(),connectRaw:e=>n.connectRaw(e),openBi:e=>n.openBi(e),openUni:e=>n.openUni(e),isConnected:e=>n.isConnected(e),disconnectNode:e=>n.disconnectNode(e),setAutoConnectExcluded:(e,t)=>n.setAutoConnectExcluded(e,t),notifyNetworkChange:e=>n.notifyNetworkChange(e)};return Object.defineProperties(r,{devices:{get:()=>g,enumerable:true},peers:{get:()=>v,enumerable:true},channels:{get:()=>C,enumerable:true},rooms:{get:()=>P,enumerable:true},tickets:{get:()=>h,enumerable:true},diagnostics:{get:()=>S,enumerable:true},advanced:{get:()=>b,enumerable:true},setAuth:{value:e=>i.setAuthContext(e),enumerable:true,writable:true,configurable:true},setAuthContext:{value:e=>i.setAuthContext(e),enumerable:true,writable:true,configurable:true},syncPlutoAuth:{value:e=>i.syncPlutoAuth(e),enumerable:true,writable:true,configurable:true},bindPlutoAuthHost:{value:()=>i.bindPlutoAuthHost(),enumerable:true,writable:true,configurable:true},signIn:{value:()=>i.signInWithPluto(),enumerable:true,writable:true,configurable:true},signOut:{value:()=>i.signOut(),enumerable:true,writable:true,configurable:true},runtime:{get:()=>n,enumerable:false},_assembly:{get:()=>i,enumerable:false}}),r}export{O as a,I as b};