openrtc 1.0.6 → 1.0.8

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.
@@ -1,573 +0,0 @@
1
- import { A as AuthContext } from './IEngineBridge-C7OT2CRv.js';
2
- import { o as ConnectionOptions, p as ApplicationPayloadCrypto, q as ApplicationPayloadReadinessOptions, r as ApplicationPayloadRouteOptions, s as ProtocolName, t as ApplicationPayloadSendOptions, T as TransportLatencySnapshot, u as ChannelDescriptor$1, L as LocalDeviceInfo, v as IncomingStreamChannelMetadata, n as ClientOptions, d as Device, h as SignalingSession, c as RuntimeIdentity, e as DeviceStatusSnapshot, w as ManagedDeviceConnectOptions, x as PeerState, y as PeerHealth, J as JoinRoomOptions, z as RoomMember, F as PeerScope, m as BackendConnectionState, H as DevicePresenceStatus, K as PeerLifecycleStatus, P as PeerSessionSnapshot } from './types-BCkKK8dy.js';
3
-
4
- interface ITransport {
5
- readonly name: string;
6
- readonly isReady: boolean;
7
- init(localNodeId: string, remoteNodeId: string, options: any): Promise<void>;
8
- send(data: Uint8Array): Promise<void>;
9
- close(): void;
10
- onMessage(callback: (data: Uint8Array) => void): void;
11
- onStateChange(callback: (state: 'connecting' | 'connected' | 'failed' | 'disconnected') => void): void;
12
- handleSignalingMessage?(msg: any): void;
13
- getSignalingHandler?(): (msg: any) => Promise<void>;
14
- getNativeTransport?(): any;
15
- getNegotiationId?(): string | null;
16
- getDataChannelReadyState?(): string | null;
17
- }
18
-
19
- type ConnectionHealth = 'unknown' | 'healthy' | 'suspect' | 'stale';
20
-
21
- type UpgradeState = 'none' | 'upgrading' | 'upgraded' | 'failed';
22
- declare class Connection {
23
- private static readonly textDecoder;
24
- private static readonly textEncoder;
25
- private static readonly UPGRADE_RETRY_DELAY_MS;
26
- private static readonly MAX_UPGRADE_RETRIES;
27
- private static readonly UPGRADE_REDRIVE_DELAYS_MS;
28
- private static readonly WEBRTC_DISCONNECTED_GRACE_MS;
29
- private static readonly MAX_PENDING_MESSAGES;
30
- private static readonly DEFAULT_APPLICATION_CRYPTO_WAIT_MS;
31
- /**
32
- * Must exceed `WEBRTC_ICE_CONNECT_TIMEOUT_MS` in `WebRTCTransport`: the transport
33
- * waits that long for ICE + DataChannel before `failed`. A shorter watchdog here
34
- * tears the PC down early, burns `MAX_UPGRADE_RETRIES`, and stretches upgrades to ~60s+ under load.
35
- */
36
- private static readonly WEBRTC_UPGRADE_ATTEMPT_TIMEOUT_MS;
37
- private static readonly MAX_PENDING_ENCRYPTED_APPLICATION_PAYLOADS;
38
- private static readonly WEBRTC_APPLICATION_ROUTE_PROOF_TIMEOUT_MS;
39
- private static readonly WEBRTC_APPLICATION_ROUTE_PROOF_DELAYS_MS;
40
- private static readonly WEBRTC_APPLICATION_ROUTE_PROOF_MAX_ID_LENGTH;
41
- private listeners;
42
- private pendingMessages;
43
- private pendingEncryptedApplicationPayloads;
44
- private lastApplicationPayloadTransport;
45
- private webrtcBinaryHandlers;
46
- private closeListeners;
47
- private upgradeStateListeners;
48
- private writer;
49
- private reader;
50
- private _isClosed;
51
- get isClosed(): boolean;
52
- private receiveBuffer;
53
- readonly id: string;
54
- readonly remoteNodeId: string;
55
- /** @deprecated Compatibility alias for legacy consumers. This is the remote node id, not a device id. */
56
- readonly deviceId: string;
57
- readonly localNodeId: string;
58
- private options;
59
- private writeMutex;
60
- private applicationCryptoWaiters;
61
- private applicationKeyAgreementObservationEpoch;
62
- private nativeSignalSender;
63
- private webrtcTransport;
64
- private webRtcApplicationRouteReadyTransport;
65
- private webRtcApplicationRouteReadyNegotiationId;
66
- private upgradeState;
67
- private upgradeRequested;
68
- private negotiationSwitchCount;
69
- private upgradeAttemptActive;
70
- private upgradeRetryCount;
71
- private lastBaseTransportGeneration;
72
- private lastBaseTransportStableId;
73
- private upgradeReDriveCount;
74
- private upgradeReDriveTimer;
75
- private upgradeRetryTimer;
76
- private upgradeAttemptTimeoutTimer;
77
- private lastReportedTransportStatus;
78
- private pendingTransportStatusReport;
79
- private transportStatusReportInFlight;
80
- private applicationRouteMissingNotified;
81
- private upgradeTerminalFailure;
82
- private pendingSignals;
83
- private activeNegotiationId;
84
- private pendingAvailabilityHint;
85
- private webrtcHeartbeat;
86
- private webRtcHeartbeatProbeInFlight;
87
- private webRtcApplicationRouteProbeInFlight;
88
- private pendingWebRtcApplicationRouteProof;
89
- private webRtcHeartbeatConsecutiveProbeFailures;
90
- private irohHealthListeners;
91
- private webrtcHealthListeners;
92
- private lastWebRtcHeartbeatOkAt;
93
- private lastWebRtcDataChannelOpenAt;
94
- private lastApplicationRouteReadyReportAt;
95
- private static readonly WEBRTC_RENEGOTIATE_LIVENESS_WINDOW_MS;
96
- private static readonly MAX_NEGOTIATION_SWITCHES;
97
- private lastForegroundAt;
98
- private webRtcDisconnectedGraceTimer;
99
- private preferredWebRtcRole;
100
- constructor(id: string, localNodeId: string, remoteNodeId: string, writer: WritableStreamDefaultWriter<Uint8Array>, reader: ReadableStreamDefaultReader<Uint8Array>, options?: ConnectionOptions);
101
- setApplicationCrypto(applicationCrypto: ApplicationPayloadCrypto | undefined): void;
102
- markApplicationKeyAgreementObserved(): number;
103
- getApplicationKeyAgreementObservationEpoch(): number;
104
- requireApplicationCrypto(): void;
105
- isApplicationCryptoRequired(): boolean;
106
- isReadyForApplicationPayload(options?: ApplicationPayloadReadinessOptions): boolean;
107
- getApplicationPayloadTransports(options?: ApplicationPayloadRouteOptions): ProtocolName[];
108
- private isTransportAvailableForApplicationPayload;
109
- private resolveApplicationCryptoWaiters;
110
- private rejectApplicationCryptoWaiters;
111
- private waitForRequiredApplicationCrypto;
112
- /**
113
- * Starts WebRTC upgrade only when peer capability negotiation allows it.
114
- * No-op when WebRTC is not configured or an upgrade already started.
115
- */
116
- requestWebRTCUpgrade(reason?: string): void;
117
- /**
118
- * Whether the current WebRTC route is provably alive: an open data channel
119
- * plus either a recent heartbeat round trip or a freshly opened channel. An
120
- * `open` readyState alone is not proof — it lingers for many seconds after the
121
- * remote vanishes (e.g. a page reload), so a dead-but-`open` channel reports
122
- * not-live and can be replaced rather than trusted.
123
- */
124
- private isWebRtcRouteHeartbeatLive;
125
- requestTransportRecovery(reason: string, options?: {
126
- forceRenegotiate?: boolean;
127
- replaceExisting?: boolean;
128
- }): void;
129
- private static readonly FOREGROUND_PROBE_TIMEOUT_MS;
130
- handleAppForeground(): void;
131
- /**
132
- * Accept authoritative proof that the base control route can send again.
133
- * Browser `online` fires before Iroh/WebTransport is necessarily routable,
134
- * so the successful control send is the boundary that may replenish a spent
135
- * optional-route recovery round. This Connection remains the sole retry owner.
136
- */
137
- handleBaseTransportAvailable(source: string, proof?: {
138
- transportState?: string | null;
139
- transportGeneration?: number | null;
140
- transportStableId?: number | null;
141
- }): void;
142
- private beginWebRtcRecovery;
143
- getUpgradeState(): UpgradeState;
144
- updateRTCConfig(rtcConfig: ConnectionOptions['rtcConfig']): void;
145
- onUpgradeStateChange(callback: (state: UpgradeState) => void): void;
146
- /**
147
- * Best-effort transport diagnostics for developer tooling.
148
- *
149
- * - `usesRelay=true` means the selected WebRTC candidate pair includes a relay candidate.
150
- * - `usesRelay=false` means we found a selected pair and it is direct.
151
- * - `usesRelay=null` means there is not enough data yet.
152
- */
153
- getTransportDiagnostics(): Promise<{
154
- activeTransport: ProtocolName;
155
- parallelTransport: ProtocolName | null;
156
- usesRelay: boolean | null;
157
- relaySource: string | null;
158
- webrtc: {
159
- iceConnectionState: string | null;
160
- iceGatheringState: string | null;
161
- localCandidateType: string | null;
162
- remoteCandidateType: string | null;
163
- localProtocol: string | null;
164
- remoteProtocol: string | null;
165
- candidateTypeSummary: string | null;
166
- } | null;
167
- }>;
168
- private collectTransportDiagnostics;
169
- private refreshWebRtcCandidatePairObservation;
170
- private lastWebRtcLocalCandidateType;
171
- private lastWebRtcRemoteCandidateType;
172
- private clearWebRtcCandidatePairObservation;
173
- private webRtcTransportLabel;
174
- get transportType(): ProtocolName;
175
- private _peerMoQReady;
176
- get peerMoQReady(): boolean;
177
- set peerMoQReady(value: boolean);
178
- private _remoteSupportsWebRTC;
179
- get remoteSupportsWebRTC(): boolean;
180
- set remoteSupportsWebRTC(value: boolean);
181
- private mediaListeners;
182
- /**
183
- * Send a message to the other peer.
184
- * Messages can be strings or objects (JSON stringified).
185
- */
186
- send(message: string | object | ArrayBuffer | Uint8Array, options?: ApplicationPayloadSendOptions): Promise<void>;
187
- /**
188
- * Send media data (video/audio header + payload)
189
- * Internal use for now.
190
- */
191
- sendMedia(type: 'audio' | 'video', data: Uint8Array): Promise<void>;
192
- /**
193
- * Send a data message on a specific transport without fallback.
194
- * Throws when the requested transport is unavailable.
195
- */
196
- sendOnTransport(transport: ProtocolName, message: string | object | ArrayBuffer | Uint8Array): Promise<void>;
197
- /** Last transport that accepted an application payload from this connection. */
198
- getLastApplicationPayloadTransport(): ProtocolName | null;
199
- /**
200
- * Send plaintext control traffic that is required to bootstrap application
201
- * key agreement. This is intentionally separate from public app-data sends.
202
- */
203
- sendControl(message: string | object | ArrayBuffer | Uint8Array): Promise<void>;
204
- /**
205
- * Write an already-framed payload directly on the underlying iroh control stream.
206
- * Used by native-main signaling paths that must preserve protocol framing.
207
- */
208
- sendRawIrohFrame(frame: Uint8Array): Promise<void>;
209
- /**
210
- * Compatibility/diagnostic view of currently usable transports.
211
- *
212
- * Lifecycle projection and route selection must use getTransportStatus().
213
- * This legacy list intentionally remains for older callers and tests that
214
- * need a human-readable inventory, but it is not an authority for active
215
- * versus fallback transport state.
216
- */
217
- getAvailableTransports(): ProtocolName[];
218
- onWebRTCBinaryMessage(handler: (data: Uint8Array) => boolean): void;
219
- private dispatchWebRtcBinaryHandlers;
220
- getWebRTCTransport(): ITransport | null;
221
- sendOnWebRTC(data: Uint8Array): Promise<void>;
222
- private encodePayload;
223
- private protectApplicationPayload;
224
- private protectRequiredApplicationPayload;
225
- private openApplicationPayload;
226
- private openUntypedApplicationPayload;
227
- private isPlaintextBootstrapPayload;
228
- private queueEncryptedApplicationPayload;
229
- private flushPendingEncryptedApplicationPayloads;
230
- private buildFrame;
231
- private sendOverIroh;
232
- private sendUsingTransport;
233
- private sendTypedOnTransport;
234
- private sendTyped;
235
- private getSendTransportPriorities;
236
- /**
237
- * Disconnect the connection
238
- */
239
- disconnect(): Promise<void>;
240
- /**
241
- * Listen for incoming messages
242
- */
243
- onMessage(callback: (message: any) => void): void;
244
- /**
245
- * Listen for incoming media
246
- */
247
- onMedia(callback: (type: 'audio' | 'video', data: Uint8Array) => void): void;
248
- /**
249
- * Listen for disconnection
250
- */
251
- onDisconnect(callback: () => void): void;
252
- private close;
253
- private preserveWebRtcConnectionAfterBaseTransportLoss;
254
- private readLoop;
255
- injectData(chunk: Uint8Array): void;
256
- private handleData;
257
- /**
258
- * Deliver one independently framed application body to this logical
259
- * connection. Fresh `system/peer-default` streams use this entrypoint so
260
- * their bytes never interleave with the bootstrap stream's receive buffer.
261
- */
262
- receiveFrameBody(body: Uint8Array): void;
263
- private tryHandlePlaintextNativeSignal;
264
- private static isUntypedDataFrame;
265
- private processDataPayload;
266
- private isLikelyTextPayload;
267
- private emitMedia;
268
- private emitMessage;
269
- receiveMessage(msg: any): void;
270
- receiveDataPayload(messageData: Uint8Array): void;
271
- private trackListeners;
272
- private warnedSrtpApplicationCryptoBoundary;
273
- private warnSrtpApplicationCryptoBoundary;
274
- addTrack(track: MediaStreamTrack): RTCRtpSender | null;
275
- addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver | null;
276
- onTrack(callback: (event: RTCTrackEvent) => void): void;
277
- private hasRecoverableBasePath;
278
- private hasBaseApplicationRoute;
279
- private isWebRtcDataChannelOpen;
280
- private clearWebRtcDisconnectedGraceTimer;
281
- private transportStillLikelyAlive;
282
- private handleUnhealthyWebRtcTransportStateWithGrace;
283
- private attemptUpgrade;
284
- private setUpgradeState;
285
- private handleUpgradeFailure;
286
- private scheduleUpgradeReDrive;
287
- private clearUpgradeReDriveTimer;
288
- private shouldRetryUpgrade;
289
- private scheduleUpgradeRetry;
290
- private clearUpgradeRetryTimer;
291
- private startUpgradeAttemptTimeout;
292
- private clearUpgradeAttemptTimeoutTimer;
293
- private teardownWebRTCTransport;
294
- private startWebRtcHeartbeat;
295
- private stopWebRtcHeartbeat;
296
- private notifyWebRtcApplicationRouteMissing;
297
- private currentWebRtcNegotiationId;
298
- private createWebRtcApplicationRouteProofId;
299
- private isCurrentWebRtcApplicationRouteProof;
300
- private cancelWebRtcApplicationRouteProofForTransport;
301
- private cancelWebRtcApplicationRouteProof;
302
- private completeWebRtcApplicationRouteProofAck;
303
- private sendWebRtcApplicationRouteProofFrame;
304
- private tryHandleWebRtcApplicationRouteProofBytes;
305
- private tryHandleWebRtcApplicationRouteProofPayload;
306
- private isWebRtcApplicationRouteProofFrame;
307
- private startWebRtcApplicationRouteProbe;
308
- private sendIrohHeartbeatPong;
309
- /** Register a listener for WebRTC heartbeat health changes. */
310
- onWebRtcHeartbeatHealth(cb: (health: ConnectionHealth) => void): void;
311
- /** Register a listener for iroh heartbeat health changes (WASM path). */
312
- onIrohHeartbeatHealth(cb: (health: ConnectionHealth) => void): void;
313
- reportTransportStatusIfChanged(): void;
314
- private drainTransportStatusReports;
315
- private reportApplicationRouteReady;
316
- /**
317
- * Single connection-owned transport snapshot for status reporting,
318
- * lifecycle projection, and diagnostics. The active route is application
319
- * ready; the parallel route is its usable fallback or candidate.
320
- */
321
- getTransportStatus(): {
322
- activeTransport: ProtocolName;
323
- parallelTransport: ProtocolName | null;
324
- };
325
- /** Passive RTT samples owned by the active transport heartbeats. */
326
- getTransportLatencySnapshot(): TransportLatencySnapshot;
327
- private resolveParallelTransport;
328
- setNativeSignalSender(sender: (envelope: any) => Promise<void>): void;
329
- /**
330
- * Structured connection-lifecycle log. One event per meaningful transition
331
- * (upgrade requested/started/failed, route promoted, app route ready, …) with
332
- * the connection's current lifecycle snapshot, so the whole connection flow
333
- * can be reconstructed from logs. Emits both a human line and a JSON line.
334
- */
335
- private traceLifecycle;
336
- getControlFrameMode(): NonNullable<ConnectionOptions['controlFrameMode']>;
337
- /**
338
- * Send a control envelope over the native-main signal route. Returns false
339
- * (without sending) unless this connection is in `native-main` control-frame
340
- * mode and has a native signal sender, so a typed connection never
341
- * accidentally routes control through the native sender.
342
- */
343
- sendNativeControlEnvelope(envelope: any): Promise<boolean>;
344
- /**
345
- * Promote a connection to the native-main control plane: switch its
346
- * control-frame mode to `native-main` and attach the native signal sender.
347
- * Used when native-main evidence arrives for a connection that bootstrapped
348
- * on a typed stream, so subsequent control traffic flows over the durable
349
- * native-main route even if the bootstrap stream later closes.
350
- */
351
- promoteToNativeMainControlRoute(sender: (envelope: any) => Promise<void>): void;
352
- private hasRequiredApplicationCrypto;
353
- private clearWebRtcApplicationRouteReady;
354
- private isCurrentWebRtcTransportApplicationRouteReady;
355
- private isWebRtcApplicationRouteReadyForTransport;
356
- /**
357
- * Mark the upgraded WebRTC data plane as carrying a proven application route
358
- * (data channel open + required crypto present). Idempotent. Promotes the
359
- * active transport projection to `webrtc` via reportTransportStatusIfChanged.
360
- */
361
- private markWebRtcApplicationRouteReady;
362
- /**
363
- * True only when the WebRTC transport is upgraded AND its application route
364
- * is proven (crypto present). The active route must not advertise `webrtc`
365
- * until this holds, so a half-open data channel never looks routable.
366
- */
367
- isWebRtcApplicationRouteReady(): boolean;
368
- /**
369
- * MoQ has a different data-plane shape than WebRTC: it is a shared relay
370
- * session on the Client plus a peer capability/subscription bit on this
371
- * Connection. Even so, it follows the same lifecycle invariant as every
372
- * custom transport: do not advertise it as the active application route until
373
- * the local transport is ready, the peer route is enabled, and the required
374
- * application crypto is available, and the current relay session has
375
- * completed a protected probe/ACK exchange with this peer.
376
- */
377
- isMoQApplicationRouteReady(): boolean;
378
- private isMoQDataRouteReady;
379
- private sendInternalSignal;
380
- receiveInternalSignal(content: any): void;
381
- private handleInternalSignal;
382
- private createNegotiationId;
383
- private getDeterministicWebRtcRole;
384
- private normalizeNegotiationId;
385
- }
386
-
387
- /**
388
- * App-facing options intentionally hide transport node identifiers from callbacks.
389
- */
390
- type RuntimeClientOptions = Omit<ClientOptions, 'onDevices' | 'onAutoConnect' | 'onIncomingSession'> & {
391
- onDevices?: (devices: RuntimeDevice[]) => void;
392
- onAutoConnect?: (devices: RuntimeDevice[]) => void;
393
- onIncomingSession?: (session: RuntimeSession) => Promise<void>;
394
- };
395
- /**
396
- * App-facing device model. Runtime transport identifiers stay internal.
397
- */
398
- type RuntimeDevice = Omit<Device, 'nodeId'>;
399
- /**
400
- * App-facing session model. Node identifiers are runtime-internal metadata.
401
- */
402
- type RuntimeSession = Omit<SignalingSession, 'initiatorNodeId' | 'targetNodeId' | 'appTag'>;
403
- type RuntimeAuthIdentity = RuntimeIdentity;
404
- type RuntimeAuthContext = AuthContext;
405
- /**
406
- * App-facing peer state model. Runtime transport identifiers stay internal.
407
- */
408
- type RuntimePeerState = Omit<PeerState, 'nodeId'>;
409
- type RuntimePeerHealth = PeerHealth;
410
- type RuntimePeerLifecycleStatus = PeerLifecycleStatus;
411
- type RuntimePeerScope = PeerScope;
412
- /**
413
- * App-facing peer session snapshot model. Runtime transport identifiers stay internal.
414
- */
415
- type RuntimePeerSessionSnapshot = Omit<PeerSessionSnapshot, 'nodeId'>;
416
- type RuntimeLocalDeviceInfo = LocalDeviceInfo;
417
- type RuntimeRoomMember = RoomMember;
418
- type RuntimeDeviceConnectOptions = ManagedDeviceConnectOptions;
419
- type RuntimeJoinRoomOptions = JoinRoomOptions;
420
- type RuntimeChannelDescriptor = ChannelDescriptor$1;
421
- interface RuntimeConnectionTarget {
422
- ticket: string;
423
- timeoutMs?: number;
424
- }
425
- interface RuntimePeerConnectOptions {
426
- deviceId?: string;
427
- ticket?: string;
428
- scope?: RuntimePeerScope;
429
- channelId?: string;
430
- /** Total wall-clock budget for dial, admission, and peer settlement. */
431
- timeoutMs?: number;
432
- /**
433
- * When true, automatic/observer dials fail fast if the peer has a sticky
434
- * manual-disconnect projection for this app session. User-initiated manual
435
- * reconnects should leave this unset and clear the exclusion explicitly.
436
- */
437
- respectManualDisconnect?: boolean;
438
- }
439
- interface RuntimePeerStreamOptions {
440
- ticket?: string;
441
- scope?: RuntimePeerScope;
442
- channelId?: string;
443
- timeoutMs?: number;
444
- }
445
- type RuntimeLogicalChannelFraming = 'raw' | 'u32be';
446
- interface RuntimeScopedChannelOptions {
447
- peerId?: string;
448
- peerNodeId?: string;
449
- deviceId?: string | null;
450
- ticket?: string;
451
- scope: RuntimePeerScope;
452
- channelId: string;
453
- timeoutMs?: number;
454
- respectManualDisconnect?: boolean;
455
- /**
456
- * Native product protocols such as Plutonium drive-view expect a plaintext
457
- * stream label before payload frames. OpenRTC owns that handshake here so
458
- * apps do not need to choose raw transport APIs.
459
- */
460
- nativeLabel?: boolean;
461
- framing?: RuntimeLogicalChannelFraming;
462
- }
463
- interface RuntimeScopedLogicalChannel {
464
- channelId: string;
465
- peerId: string;
466
- connection: Connection;
467
- send(payload: Uint8Array): Promise<void>;
468
- onMessage(callback: (payload: Uint8Array) => void): () => void;
469
- close(): Promise<void>;
470
- diagnostics(): {
471
- connectionId: string | null;
472
- remoteNodeId: string | null;
473
- transports: string[];
474
- hasSendOnWebRTC?: boolean;
475
- hasWebRTCTransport?: boolean;
476
- lastSendTransport?: ProtocolName | 'stream' | null;
477
- framing: RuntimeLogicalChannelFraming;
478
- nativeLabel: boolean;
479
- };
480
- }
481
- /**
482
- * App-facing device status snapshot model. Runtime transport identifiers stay internal.
483
- */
484
- type RuntimeDeviceStatusSnapshot = Omit<DeviceStatusSnapshot, 'nodeId'>;
485
- type RuntimeDeviceStatus = RuntimeDeviceStatusSnapshot;
486
- type RuntimeDevicePresenceStatus = DevicePresenceStatus;
487
- type RuntimeIncomingStream = {
488
- type: 'bi' | 'uni';
489
- stream: any;
490
- remoteNodeId: string;
491
- protocolHint?: 'control' | 'explicit' | 'native-main' | 'unknown';
492
- channel?: IncomingStreamChannelMetadata | null;
493
- };
494
- type RuntimeConnectionEvent = {
495
- type: 'connected' | 'disconnected';
496
- connectionId: string;
497
- localNodeId: string;
498
- remoteNodeId: string;
499
- transport: ProtocolName;
500
- };
501
- type RuntimeRawConnection = {
502
- connectionId: string;
503
- localNodeId: string;
504
- remoteNodeId: string;
505
- };
506
- type RuntimePresenceLoopOptions = {
507
- deviceName?: string;
508
- ticket?: string;
509
- metadata?: string;
510
- };
511
- type RuntimeManagedSessionPlatform = 'native' | 'web';
512
- type RuntimeManagedSessionKind = 'app-user-device' | 'share-anonymous' | 'drive-grant-guest' | 'scoped-guest' | (string & {});
513
- type RuntimeAutoConnectPolicy = 'enabled' | 'disabled' | 'scoped-only';
514
- type RuntimePresencePolicy = 'online' | 'disabled';
515
- type RuntimeConnectionStateSnapshot = BackendConnectionState;
516
- type RuntimeApplicationPayloadReadinessOptions = ApplicationPayloadReadinessOptions;
517
- type RuntimeUiConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'failed';
518
- interface RuntimePeerReadinessSnapshot {
519
- requestedId: string;
520
- connected: boolean;
521
- settledReady: boolean;
522
- status: RuntimeUiConnectionStatus;
523
- health: RuntimePeerHealth | 'unknown';
524
- deviceId?: string | null;
525
- deviceIdHint?: string | null;
526
- activeConnectionId?: string | null;
527
- readinessState?: string;
528
- readinessReason?: string;
529
- scopes: string[];
530
- }
531
- interface RuntimeLocalDeviceProfile {
532
- deviceId: string | null;
533
- deviceName: string;
534
- platformType: string;
535
- userId: string | null;
536
- capabilities: NonNullable<RuntimeLocalDeviceInfo['capabilities']>;
537
- lastSeenAt: string;
538
- localNodeId?: string | null;
539
- }
540
- interface RuntimeManagedSessionOptions {
541
- platform: RuntimeManagedSessionPlatform;
542
- sessionKind?: RuntimeManagedSessionKind;
543
- scope?: string | null;
544
- autoConnectPolicy?: RuntimeAutoConnectPolicy;
545
- presencePolicy?: RuntimePresencePolicy;
546
- userId?: string | null;
547
- deviceName?: string;
548
- localDeviceId?: string | null;
549
- metadata?: string;
550
- autoConnect?: boolean;
551
- presence?: boolean;
552
- }
553
- interface RuntimeManagedSession {
554
- mode: RuntimeManagedSessionPlatform;
555
- device: RuntimeLocalDeviceProfile;
556
- stop: () => Promise<void>;
557
- }
558
- type ConnectionTarget = RuntimeConnectionTarget;
559
- type PeerConnectOptions = RuntimePeerConnectOptions;
560
- type PeerStreamOptions = RuntimePeerStreamOptions;
561
- type ScopedChannelOptions = RuntimeScopedChannelOptions;
562
- type ScopedLogicalChannel = RuntimeScopedLogicalChannel;
563
- type IncomingStream = RuntimeIncomingStream;
564
- type ConnectionEvent = RuntimeConnectionEvent;
565
- type RawConnection = RuntimeRawConnection;
566
- type PresenceLoopOptions = RuntimePresenceLoopOptions;
567
- type PeerReadiness = RuntimePeerReadinessSnapshot;
568
- type DeviceProfile = RuntimeLocalDeviceProfile;
569
- type SessionOptions = RuntimeManagedSessionOptions;
570
- type Session = RuntimeManagedSession;
571
- type ChannelDescriptor = RuntimeChannelDescriptor;
572
-
573
- export { type Session as $, type PeerReadiness as A, type PeerStreamOptions as B, Connection as C, type DeviceProfile as D, type PresenceLoopOptions as E, type RawConnection as F, type RuntimeAuthContext as G, type RuntimeAuthIdentity as H, type ITransport as I, type RuntimeAutoConnectPolicy as J, type RuntimeConnectionTarget as K, type RuntimeDevicePresenceStatus as L, type RuntimeDeviceStatus as M, type RuntimeLogicalChannelFraming as N, type RuntimeManagedSessionKind as O, type PeerConnectOptions as P, type RuntimeManagedSessionPlatform as Q, type RuntimeClientOptions as R, type RuntimePeerLifecycleStatus as S, type RuntimePeerScope as T, type RuntimePeerSessionSnapshot as U, type RuntimePresenceLoopOptions as V, type RuntimePresencePolicy as W, type RuntimeSession as X, type RuntimeUiConnectionStatus as Y, type ScopedChannelOptions as Z, type ScopedLogicalChannel as _, type RuntimeManagedSessionOptions as a, type SessionOptions as a0, type RuntimeManagedSession as b, type RuntimeDevice as c, type RuntimeDeviceStatusSnapshot as d, type RuntimeDeviceConnectOptions as e, type RuntimeLocalDeviceInfo as f, type RuntimeLocalDeviceProfile as g, type RuntimePeerState as h, type RuntimePeerConnectOptions as i, type RuntimePeerReadinessSnapshot as j, type RuntimePeerHealth as k, type RuntimeChannelDescriptor as l, type RuntimePeerStreamOptions as m, type RuntimeIncomingStream as n, type RuntimeScopedChannelOptions as o, type RuntimeScopedLogicalChannel as p, type RuntimeJoinRoomOptions as q, type RuntimeRoomMember as r, type RuntimeConnectionStateSnapshot as s, type RuntimeApplicationPayloadReadinessOptions as t, type RuntimeConnectionEvent as u, type RuntimeRawConnection as v, type ChannelDescriptor as w, type ConnectionEvent as x, type ConnectionTarget as y, type IncomingStream as z };