openrtc 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/{ITransport-CjxCQ6q7.d.ts → Connection-DZ5eP5hL.d.ts} +445 -94
  2. package/dist/DelegatingRuntimeAdapter-4cgiIWMN.d.ts +150 -0
  3. package/dist/IpcRuntimeAdapter-Dduaxscj.d.ts +80 -0
  4. package/dist/WasmBridge-3W2HHADU.js +1 -0
  5. package/dist/{assembly-Bmi65-tK.d.ts → assembly-By3UBQsE.d.ts} +36 -19
  6. package/dist/{capabilities-BPuynml5.d.ts → capabilities-B2mHv_H7.d.ts} +2 -6
  7. package/dist/chunk-2GX6GB6L.js +1 -0
  8. package/dist/chunk-2LATKLCC.js +118 -0
  9. package/dist/{chunk-KRJECX7X.js → chunk-5XOLKH66.js} +1 -1
  10. package/dist/chunk-6OFAKLDB.js +2 -0
  11. package/dist/chunk-72NEEJQG.js +1 -0
  12. package/dist/chunk-BCGCJGIV.js +2 -0
  13. package/dist/chunk-GNW63SM6.js +2 -0
  14. package/dist/chunk-JPBW67B3.js +1 -0
  15. package/dist/chunk-MI3ZMVPK.js +2 -0
  16. package/dist/chunk-OT7IPLZE.js +1 -0
  17. package/dist/chunk-OWKAJPOI.js +1 -0
  18. package/dist/chunk-P2SHJMS3.js +1 -0
  19. package/dist/chunk-TYZS5LXQ.js +2 -0
  20. package/dist/chunk-WB66633N.js +1 -0
  21. package/dist/chunk-XEHBTMJQ.js +1 -0
  22. package/dist/chunk-YYI6AY6W.js +2 -0
  23. package/dist/{controlPlane-KVFZ7BR5.js → controlPlane-7E6KGQPP.js} +1 -1
  24. package/dist/coreClient.d.ts +3 -4
  25. package/dist/coreClient.js +1 -1
  26. package/dist/{deviceEnrollment-VACC64CQ.js → deviceEnrollment-CBJYXZ43.js} +2 -2
  27. package/dist/index.d.ts +6 -7
  28. package/dist/index.js +1 -1
  29. package/dist/{ipc-CPnNwv6f.d.ts → ipc-DgzKqHH3.d.ts} +3 -0
  30. package/dist/ipcFactory-4PCGKZIN.js +1 -0
  31. package/dist/native.d.ts +21 -0
  32. package/dist/native.js +1 -0
  33. package/dist/openrtc-5HAYVDHT.js +2 -0
  34. package/dist/openrtc_bg.wasm +0 -0
  35. package/dist/protocol-BSBjMb7p.d.ts +6 -0
  36. package/dist/runtime/WasmRuntimeAdapter.d.ts +4 -5
  37. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  38. package/dist/runtime/device-status.d.ts +1 -2
  39. package/dist/runtime/factories.d.ts +283 -8
  40. package/dist/runtime/factories.js +1 -1
  41. package/dist/runtime/index.d.ts +13 -160
  42. package/dist/runtime/index.js +1 -1
  43. package/dist/testing/native.d.ts +11 -0
  44. package/dist/testing/native.js +1 -0
  45. package/dist/testing.d.ts +13 -19
  46. package/dist/testing.js +1 -1
  47. package/dist/transport/index.d.ts +7 -18
  48. package/dist/transport/index.js +1 -1
  49. package/dist/{types--jQzenZR.d.ts → types-BArEthJr.d.ts} +178 -10
  50. package/package.json +11 -2
  51. package/dist/DelegatingRuntimeAdapter-DE4LTGAJ.d.ts +0 -399
  52. package/dist/IpcRuntimeAdapter-CE0va9Tr.d.ts +0 -19
  53. package/dist/WasmBridge-75F6GKHG.js +0 -1
  54. package/dist/chunk-2L6ULC32.js +0 -1
  55. package/dist/chunk-2SUSPEC4.js +0 -1
  56. package/dist/chunk-7BJKDBLP.js +0 -2
  57. package/dist/chunk-DUY34MGT.js +0 -1
  58. package/dist/chunk-HEAJ7ZUR.js +0 -1
  59. package/dist/chunk-HUG5AX7R.js +0 -1
  60. package/dist/chunk-Q6KXVTSH.js +0 -2
  61. package/dist/chunk-R35AWMNY.js +0 -1
  62. package/dist/chunk-UILOGUOU.js +0 -1
  63. package/dist/chunk-WA434EWD.js +0 -2
  64. package/dist/chunk-XAL4T6TB.js +0 -3
  65. package/dist/chunk-Z2IS6NH2.js +0 -2
  66. package/dist/ipcFactory-32R47AVK.js +0 -1
  67. package/dist/openrtc-4EZPCHWM.js +0 -2
  68. package/dist/types-DDhMQkK8.d.ts +0 -621
@@ -1,17 +1,15 @@
1
- import { a as PeerReconciliationStats } from '../assembly-Bmi65-tK.js';
2
- export { D as ConnectionActor, d as ConnectionActorError, e as ConnectionActorErrorKind, f as ConnectionActorKey, g as ConnectionActorOptions, h as ConnectionActorState, i as ConnectionActors, j as ConnectionClose, k as ConnectionDial, l as LogicalChannel, P as PolicySnapshot, m as PreferredTransport, n as RUNTIME_POLICY, R as RuntimeClient, o as connectionActorKey, p as connectionActorKeyString, q as getRuntimePolicy } from '../assembly-Bmi65-tK.js';
1
+ import { a as PeerReconciliationStats } from '../assembly-By3UBQsE.js';
2
+ export { D as ConnectionActor, d as ConnectionActorError, e as ConnectionActorErrorKind, f as ConnectionActorKey, g as ConnectionActorOptions, h as ConnectionActorState, i as ConnectionActors, j as ConnectionClose, k as ConnectionDial, l as LogicalChannel, P as PolicySnapshot, m as PreferredTransport, n as RUNTIME_POLICY, R as RuntimeClient, o as connectionActorKey, p as connectionActorKeyString, q as getRuntimePolicy } from '../assembly-By3UBQsE.js';
3
3
  import { Client as Client$1 } from '../coreClient.js';
4
- import { b as Avenue } from '../types--jQzenZR.js';
5
- import * as Draft14 from '@moq/net';
6
- import { a7 as SignalingOptions, I as ISignalingBackend, m as RuntimeIdentity, l as RoomMember, n as SignalingEnvelope, u as SignalingSession, D as Device, r as DesiredPeerProjection, w as BackendConnectionState, a6 as AppLimits, G as GrantScope, Y as JoinRoomOptions, W as ChannelMetadata, a2 as CryptoStreams, a8 as RoomCreationMode, h as ClientOptions, z as PayloadCrypto, k as DiscoveryMode, a1 as ProtocolCapabilityMap, a9 as ScanningLoopOptions, aa as ScanningLoopHandle, ab as RuntimeBootstrapOptions, ac as RuntimeBootstrapResult, F as ApplicationPayloadReadinessOptions, ad as ManagedApplicationRouteOptions, Q as PeerState, T as PeerScope, U as PeerHealth, V as ChannelDescriptor, ae as JoinRequest, N as NativeConnectParams, t as NativeConnectResult } from '../ITransport-CjxCQ6q7.js';
7
- import { a as Connection, t as ConnectionTarget, m as RawConnection } from '../types-DDhMQkK8.js';
8
- export { v as AutoConnectPolicy, B as BrowserProtocolStore, C as ChannelDescriptor, w as ChannelFraming, i as ConnectionEvent, g as ConnectionState, x as ConnectionStatus, k as DeviceConnectOptions, y as DevicePresence, l as DeviceProfile, D as DeviceStatus, I as IncomingStream, q as IrohDocEntry, p as IrohMutationReceipt, J as JoinRoomOptions, L as LocalDeviceInfo, M as ManagedOptions, j as ManagedSession, N as NamespaceDescriptor, z as PayloadRouteOptions, P as PeerConnectOptions, E as PeerLifecycleStatus, b as PeerReadiness, F as PeerSessionSnapshot, d as PeerStreamOptions, u as PresenceLoopOptions, G as PresencePolicy, h as ReadinessOptions, H as RuntimeAuthContext, r as RuntimeAuthIdentity, o as RuntimeClientOptions, e as RuntimeDevice, c as RuntimePeerHealth, K as RuntimePeerScope, R as RuntimePeerState, n as RuntimeRoomMember, s as RuntimeSession, S as ScopedChannelOptions, f as ScopedLogicalChannel, O as SessionKind, Q as SessionPlatform } from '../types-DDhMQkK8.js';
9
- import { R as RuntimeCapabilities } from '../capabilities-BPuynml5.js';
10
- export { B as BROWSER_CAPABILITIES, a as CapabilityHost, C as CapabilityProfile, N as NATIVE_CAPABILITIES, b as NativeRuntimeStatus, c as RuntimeAdapterKind, T as TransportStatus, d as browserCapabilities, e as capabilityProfile, f as cloneCapabilities, s as statusCapabilities } from '../capabilities-BPuynml5.js';
4
+ import { c as Avenue } from '../types-BArEthJr.js';
5
+ import { au as SignalingOptions, K as ISignalingBackend, N as RuntimeIdentity, O as RoomMember, V as SignalingEnvelope, Y as SignalingSession, Q as Device, X as DesiredPeerProjection, a9 as BackendConnectionState, ar as AppLimits, G as GrantScope, f as Connection, av as JoinRoomOptions, aw as ChannelMetadata, al as CryptoStreams, ax as RoomCreationMode, F as ClientOptions, ak as PayloadCrypto, z as DiscoveryMode, ay as ProtocolCapabilityMap, az as ScanningLoopOptions, aA as ScanningLoopHandle, aB as RuntimeBootstrapOptions, aC as RuntimeBootstrapResult, aD as ApplicationPayloadReadinessOptions, aE as ManagedApplicationRouteOptions, aF as PeerState, aG as PeerScope, aH as PeerHealth, aI as ChannelDescriptor, aJ as JoinRequest, a7 as NativeConnectParams, a8 as NativeConnectResult, as as ConnectionTarget, w as RawConnection } from '../Connection-DZ5eP5hL.js';
6
+ export { aK as AutoConnectPolicy, ae as BrowserProtocolStore, C as ChannelDescriptor, aL as ChannelFraming, p as ConnectionEvent, n as ConnectionState, aM as ConnectionStatus, r as DeviceConnectOptions, aN as DevicePresence, v as DeviceProfile, D as DeviceStatus, I as IncomingStream, ah as IrohDocEntry, ag as IrohMutationReceipt, J as JoinRoomOptions, L as LocalDeviceInfo, M as ManagedOptions, q as ManagedSession, af as NamespaceDescriptor, aO as PayloadRouteOptions, e as PeerConnectOptions, aP as PeerLifecycleStatus, h as PeerReadiness, aQ as PeerSessionSnapshot, k as PeerStreamOptions, a5 as PortableMediaChunk, a6 as PortableMediaControl, a3 as PortableMediaPublicationStart, a2 as PortableMediaPublish, a4 as PortableMediaSample, at as PresenceLoopOptions, aR as PresencePolicy, o as ReadinessOptions, aS as RuntimeAuthContext, ap as RuntimeAuthIdentity, y as RuntimeClientOptions, l as RuntimeDevice, i as RuntimePeerHealth, aT as RuntimePeerScope, d as RuntimePeerState, x as RuntimeRoomMember, aq as RuntimeSession, S as ScopedChannelOptions, m as ScopedLogicalChannel, aU as SessionKind, aV as SessionPlatform } from '../Connection-DZ5eP5hL.js';
7
+ import { R as RuntimeCapabilities } from '../capabilities-B2mHv_H7.js';
8
+ export { B as BROWSER_CAPABILITIES, a as CapabilityHost, C as CapabilityProfile, N as NATIVE_CAPABILITIES, b as NativeRuntimeStatus, c as RuntimeAdapterKind, T as TransportStatus, d as browserCapabilities, e as capabilityProfile, f as cloneCapabilities, s as statusCapabilities } from '../capabilities-B2mHv_H7.js';
11
9
  export { DeviceActiveOptions, isDeviceActive, isDeviceConnectable, isDeviceRoutable } from './device-status.js';
12
- export { a as IpcAdapterOptions, I as IpcRuntimeAdapter } from '../IpcRuntimeAdapter-CE0va9Tr.js';
13
- export { P as NativeBridge, N as NativeIpcFailureKind, P as PlutoIpcBridge, a as PlutoIpcUnlisten, c as classifyIpcFailure, i as isIpcUnavailable } from '../ipc-CPnNwv6f.js';
14
- import '../DelegatingRuntimeAdapter-DE4LTGAJ.js';
10
+ export { a as IpcAdapterOptions, I as IpcRuntimeAdapter } from '../IpcRuntimeAdapter-Dduaxscj.js';
11
+ export { P as NativeBridge, N as NativeIpcFailureKind, P as PlutoIpcBridge, a as PlutoIpcUnlisten, c as classifyIpcFailure, i as isIpcUnavailable } from '../ipc-DgzKqHH3.js';
12
+ import '../DelegatingRuntimeAdapter-4cgiIWMN.js';
15
13
 
16
14
  declare class Signaling {
17
15
  private readonly appTag;
@@ -71,142 +69,6 @@ type CapabilityRuntime = Client$1;
71
69
  */
72
70
  declare function runtimeForCapability(handle: Avenue): CapabilityRuntime;
73
71
 
74
- interface MoQSubscriberOptions {
75
- maxPendingSubscriptions?: number;
76
- maxSubscribeRetries?: number;
77
- subscribeRetryDelayMs?: number;
78
- maxBufferedGroupsPerTrack?: number;
79
- maxBufferedFramesPerGroup?: number;
80
- maxBufferedBytesPerTrack?: number;
81
- maxObjectPayloadBytes?: number;
82
- onSubscriptionTerminated?: (namespace: string, name: string, error: unknown) => void;
83
- }
84
- /** Draft-14 subscriber facade; session reconnect remains owned by MoQController. */
85
- declare class MoQSubscriber {
86
- private readonly session;
87
- private readonly onObject;
88
- private readonly subscriptions;
89
- private readonly maxSubscriptions;
90
- private readonly maxSubscribeRetries;
91
- private readonly subscribeRetryDelayMs;
92
- private readonly maxObjectPayloadBytes;
93
- private readonly onSubscriptionTerminated?;
94
- private closed;
95
- constructor(session: MoQSession, onObject: (trackNamespace: string, trackName: string, object: Uint8Array, metadata: unknown) => void, options?: MoQSubscriberOptions);
96
- subscribe(namespace: string, name: string): Promise<void>;
97
- close(): void;
98
- private consume;
99
- }
100
-
101
- interface TransportInterface {
102
- createBidirectionalStream(): Promise<{
103
- readable: ReadableStream<Uint8Array>;
104
- writable: WritableStream<Uint8Array>;
105
- }>;
106
- createUnidirectionalStream(): Promise<WritableStream<Uint8Array>>;
107
- incomingBidirectionalStreams: ReadableStream<unknown>;
108
- incomingUnidirectionalStreams: ReadableStream<ReadableStream<Uint8Array>>;
109
- close(): void;
110
- ready: Promise<void>;
111
- }
112
- interface MoQSessionOptions {
113
- onSubscriptionTerminated?: (namespace: string, name: string, error: unknown) => void;
114
- }
115
- interface MoQDatagramDuplex {
116
- readonly maxDatagramSize?: number;
117
- readonly readable: ReadableStream<Uint8Array>;
118
- readonly writable: WritableStream<Uint8Array>;
119
- close(): void;
120
- }
121
- /**
122
- * Draft-14 MoQT adapter. The OpenRTC controller owns reconnect and lifecycle;
123
- * this class owns only one negotiated relay session and its protocol handles.
124
- */
125
- declare class MoQSession {
126
- readonly transport: TransportInterface;
127
- private readonly relayUrl;
128
- readonly publisher: MoQPublisher;
129
- readonly subscriber: MoQSubscriber;
130
- setupComplete: boolean;
131
- private connection;
132
- private closeListeners;
133
- private closed;
134
- private closeEmitted;
135
- private setupResolve;
136
- private readonly setupPromise;
137
- constructor(transport: TransportInterface, onObject?: (ns: string, name: string, obj: Uint8Array, meta: unknown) => void, role?: number, relayUrl?: URL, options?: MoQSessionOptions);
138
- requireConnection(): Draft14.Connection.Established;
139
- /**
140
- * Open the patched Draft 14 object-datagram surface used only by the Iroh
141
- * packet carrier. Existing application-data publishing remains on subgroup
142
- * streams and never shares readiness with this duplex.
143
- */
144
- openDatagramDuplex(publishNamespace: string, subscribeNamespace: string, trackName: string): Promise<MoQDatagramDuplex>;
145
- init(): Promise<void>;
146
- waitForSetup(): Promise<void>;
147
- onClose(callback: (reason?: unknown) => void): () => void;
148
- close(): void;
149
- private emitClose;
150
- }
151
-
152
- interface MoQPublisherOptions {
153
- maxPendingAnnounces?: number;
154
- announceTimeoutMs?: number;
155
- maxSubscribedTracks?: number;
156
- maxActivePublishers?: number;
157
- maxTrackIdChars?: number;
158
- /**
159
- * Reject an application object before it reaches a relay track. This must
160
- * match the receiver-side default so browser and native clients apply the
161
- * same hard egress boundary.
162
- */
163
- maxObjectPayloadBytes?: number;
164
- }
165
- interface TrackPublisher {
166
- close(): void;
167
- push(data: Uint8Array, init: {
168
- isKey: boolean;
169
- timestamp: number;
170
- closeAfterPush?: boolean;
171
- }): Promise<void>;
172
- }
173
- /** Draft-14 publisher facade preserving OpenRTC's existing data-track API. */
174
- declare class MoQPublisher {
175
- private readonly session;
176
- private readonly namespaces;
177
- private readonly activePublishers;
178
- private readonly maxNamespaces;
179
- private readonly maxSubscribedTracks;
180
- private readonly maxActivePublishers;
181
- private readonly maxTrackIdChars;
182
- private readonly maxObjectPayloadBytes;
183
- private closed;
184
- constructor(session: MoQSession, options?: MoQPublisherOptions);
185
- announce(namespace: string): Promise<void>;
186
- hasNamespace(namespace: string): boolean;
187
- hasTrackSubscriber(namespace: string, name: string): boolean;
188
- createTrack(namespace: string, name: string): Promise<TrackPublisher>;
189
- close(): void;
190
- private acceptTrackRequests;
191
- private totalSubscriberCount;
192
- private resolveTrackId;
193
- }
194
-
195
- /**
196
- * Browser MoQ session controller.
197
- *
198
- * Owns the WebTransport-backed MoQ relay session, reconnect state, peer
199
- * subscriptions, and direct MoQ data helpers. `Client` remains the facade so
200
- * existing SDK calls and test spies keep working while MoQ stops contributing
201
- * more lifecycle state to the god object.
202
- */
203
-
204
- type MoQBundle = {
205
- session: MoQSession;
206
- publisher: MoQPublisher;
207
- subscriber: MoQSubscriber;
208
- };
209
-
210
72
  interface RoomClientHost {
211
73
  wasmClient: any;
212
74
  roomCreationMode: 'client-open' | 'client-auth' | 'server-only';
@@ -251,11 +113,13 @@ type ProtocolHint = 'control' | 'explicit' | 'native-main' | 'unknown';
251
113
  type IncomingStreamEvent = {
252
114
  type: 'bi' | 'uni';
253
115
  stream: any;
116
+ connectionId?: string;
254
117
  remoteNodeId: string;
255
118
  transportStableId?: number;
256
119
  traceId?: string;
257
120
  protocolHint?: ProtocolHint;
258
121
  channel?: ChannelMetadata | null;
122
+ applicationAuthorized?: boolean;
259
123
  applicationCrypto?: CryptoStreams;
260
124
  invalid?: boolean;
261
125
  };
@@ -318,18 +182,11 @@ declare class Client {
318
182
  subscribeSessions(localDeviceId: string, callback: (session: SignalingSession) => void | Promise<void>): Promise<() => void>;
319
183
  startScanningLoop(options: ScanningLoopOptions): Promise<ScanningLoopHandle>;
320
184
  bootstrapRuntime(options: RuntimeBootstrapOptions): Promise<RuntimeBootstrapResult>;
321
- updateTransportConfig(transports: ClientOptions['transports']): void;
185
+ updateTransportConfig(transports: ClientOptions['transports']): Promise<void>;
322
186
  init(): Promise<void>;
323
187
  ensureAuthenticated(reason: 'init' | 'room-op' | 'discovery'): Promise<void>;
324
188
  refreshRuntimeAuthToken(reason?: 'runtime-start' | 'managed-session'): Promise<void>;
325
- get moqState(): string;
326
- get moq(): MoQBundle | null;
327
- onMoQReady(cb: () => void): () => void;
328
- onMoQFailed(cb: () => void): () => void;
329
189
  refreshTransportCapabilities(reason?: string): Promise<void>;
330
- onMoQObject(callback: (ns: string, name: string, obj: Uint8Array, meta: any) => void): () => void;
331
- subscribeMoQPeer(connection: Connection): void;
332
- subscribeMoQPeerNode(peerId: string, subscriptionKey?: string): void;
333
190
  connect(ticket: string, timeoutMs?: number, expectedDeviceId?: string | null, channelId?: string, options?: {
334
191
  admissionAlreadyPresented?: boolean;
335
192
  approvedScope?: string | null;
@@ -413,10 +270,6 @@ declare class Client {
413
270
  listChannels(): ChannelDescriptor[];
414
271
  onChannelStream(channelId: string, callback: (stream: IncomingStreamEvent) => boolean | void): () => void;
415
272
  onRoomJoinRequest(callback: (request: JoinRequest) => void): () => void;
416
- isMoQDataReady(peerId: string | null): boolean;
417
- sendMoQData(peerId: string | null, data: Uint8Array, options?: {
418
- alreadyProtected?: boolean;
419
- }): Promise<void>;
420
273
  }
421
274
 
422
275
  /**
@@ -1 +1 @@
1
- export{a as runtimeFromCapability}from'../chunk-UILOGUOU.js';import'../chunk-ZA44REGI.js';export{a as isDeviceActive,c as isDeviceConnectable,b as isDeviceRoutable}from'../chunk-CK6WQV7J.js';export{i as ConnectionActor,f as ConnectionActorError,j as ConnectionActors,b as ConnectionController,t as IpcRuntimeAdapter,s as RuntimeClient,e as clog,q as concatRuntimeBytes,g as connectionActorKey,h as connectionActorKeyString,p as createJsonDecoder,l as createU32Decoder,n as decodeJsonPayload,o as encodeJsonFrame,m as encodeJsonPayload,k as encodeU32Frame,d as grantCorrelation,r as readRuntimeU32BE,c as renderCorrelation}from'../chunk-XAL4T6TB.js';export{a as classifyIpcFailure,b as isIpcUnavailable}from'../chunk-HUG5AX7R.js';import'../chunk-DUY34MGT.js';import'../chunk-R35AWMNY.js';export{s as BROWSER_CAPABILITIES,t as NATIVE_CAPABILITIES,q as RUNTIME_POLICY,v as browserCapabilities,x as capabilityProfile,u as cloneCapabilities,r as getRuntimePolicy,i as logTeardownTrace,w as statusCapabilities}from'../chunk-Z2IS6NH2.js';import'../chunk-AJQVMVYW.js';import'../chunk-WA434EWD.js';import'../chunk-HEAJ7ZUR.js';import'../chunk-7BJKDBLP.js';export{b as openRtcDebug,a as openRtcDebugEnabled,c as openRtcDebugInfo,d as openRtcDebugLog}from'../chunk-2L6ULC32.js';import'../chunk-2SUSPEC4.js';
1
+ export{a as runtimeFromCapability}from'../chunk-2LATKLCC.js';import'../chunk-ZA44REGI.js';export{a as isDeviceActive,c as isDeviceConnectable,b as isDeviceRoutable}from'../chunk-CK6WQV7J.js';export{h as ConnectionActor,e as ConnectionActorError,i as ConnectionActors,a as ConnectionController,s as IpcRuntimeAdapter,r as RuntimeClient,d as clog,p as concatRuntimeBytes,f as connectionActorKey,g as connectionActorKeyString,o as createJsonDecoder,k as createU32Decoder,m as decodeJsonPayload,n as encodeJsonFrame,l as encodeJsonPayload,j as encodeU32Frame,c as grantCorrelation,q as readRuntimeU32BE,b as renderCorrelation}from'../chunk-6OFAKLDB.js';import'../chunk-XEHBTMJQ.js';export{B as BROWSER_CAPABILITIES,C as NATIVE_CAPABILITIES,z as RUNTIME_POLICY,E as browserCapabilities,G as capabilityProfile,D as cloneCapabilities,A as getRuntimePolicy,m as logTeardownTrace,c as openRtcDebug,b as openRtcDebugEnabled,d as openRtcDebugInfo,e as openRtcDebugLog,F as statusCapabilities}from'../chunk-GNW63SM6.js';import'../chunk-TYZS5LXQ.js';import'../chunk-OT7IPLZE.js';import'../chunk-AJQVMVYW.js';export{a as classifyIpcFailure,b as isIpcUnavailable}from'../chunk-72NEEJQG.js';import'../chunk-WB66633N.js';import'../chunk-JPBW67B3.js';import'../chunk-MI3ZMVPK.js';import'../chunk-OWKAJPOI.js';import'../chunk-2GX6GB6L.js';
@@ -0,0 +1,11 @@
1
+ import { O as Options, C as Client } from '../types-BArEthJr.js';
2
+ import { E as Endpoints } from '../protocol-BSBjMb7p.js';
3
+ import { P as PlutoIpcBridge } from '../ipc-DgzKqHH3.js';
4
+ import '../coreClient.js';
5
+ import '../assembly-By3UBQsE.js';
6
+ import '../Connection-DZ5eP5hL.js';
7
+ import '../capabilities-B2mHv_H7.js';
8
+
9
+ declare function OpenRTC(options: Options, endpoints: Endpoints, bridge: PlutoIpcBridge): Client;
10
+
11
+ export { OpenRTC };
@@ -0,0 +1 @@
1
+ import {a as a$1}from'../chunk-BOS554IK.js';import'../chunk-4MLJXEVV.js';import {b}from'../chunk-2LATKLCC.js';import'../chunk-ZA44REGI.js';import {a}from'../chunk-P2SHJMS3.js';import'../chunk-WB66633N.js';import'../chunk-JPBW67B3.js';import'../chunk-2GX6GB6L.js';function v(c,p,e){let o=new a;return b(c,{endpoints:p,testingAllowInsecureLoopback:true,platform:"native",close:()=>o.close(),deviceKeyProvider:a$1(e),deviceIdProvider:async()=>{let t=await e.invoke("get_rtc_local_device_info");return String(t?.deviceId??"")},runtimeFactory:async t=>{let{createIpcClient:a}=await import('../ipcFactory-4PCGKZIN.js');return a(t,e,o)}})}export{v as OpenRTC};
package/dist/testing.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { i as CoordinationGatewayGrantRequest, j as CoordinationGatewayGrant } from './ITransport-CjxCQ6q7.js';
2
- import { A as AttestationProvider, a as AuthProvider, B as BotVerificationProvider, e as DeviceProfile, O as Options, C as Client } from './types--jQzenZR.js';
3
- import { P as PlutoIpcBridge } from './ipc-CPnNwv6f.js';
1
+ import { ab as CoordinationGatewayGrantRequest, ac as CoordinationGatewayGrant } from './Connection-DZ5eP5hL.js';
2
+ import { a as AttestationProvider, b as AuthProvider, B as BotVerificationProvider, h as DeviceProfile, O as Options, C as Client } from './types-BArEthJr.js';
3
+ import { E as Endpoints } from './protocol-BSBjMb7p.js';
4
4
  import './coreClient.js';
5
- import './assembly-Bmi65-tK.js';
6
- import './types-DDhMQkK8.js';
7
- import './capabilities-BPuynml5.js';
5
+ import './assembly-By3UBQsE.js';
6
+ import './capabilities-B2mHv_H7.js';
8
7
 
9
8
  interface DeviceProof {
10
9
  publicKeyJwk: JsonWebKey;
@@ -21,26 +20,23 @@ interface DeviceKeyProvider {
21
20
  getOrCreate(appTag: string): Promise<DeviceKey>;
22
21
  delete?(appTag: string): Promise<void>;
23
22
  /**
24
- * Optional platform-secure record storage. Native hosts use this for the
25
- * device certificate that is bound to the private key; browsers retain
26
- * their same-origin localStorage implementation.
23
+ * Optional host-private record storage. Native hosts use this for the
24
+ * device certificate bound to their non-exported signing key; the host
25
+ * chooses a prompt-free implementation. Browsers retain their same-origin
26
+ * storage implementation.
27
27
  */
28
28
  readSecureRecord?(appTag: string, key: string): Promise<string | null>;
29
29
  writeSecureRecord?(appTag: string, key: string, value: string): Promise<void>;
30
30
  deleteSecureRecord?(appTag: string, key: string): Promise<void>;
31
31
  }
32
32
 
33
- interface Endpoints {
34
- controlPlane: string;
35
- gateway: string;
36
- }
37
-
38
33
  interface CredentialSource {
39
34
  type: 'capability' | 'device-certificate';
40
35
  token: string;
41
36
  avenue: CoordinationGatewayGrantRequest['avenue'];
42
37
  expiresAtMs: number;
43
- relay: boolean;
38
+ irohRelay: boolean;
39
+ managedTurn: boolean;
44
40
  renew?: () => Promise<CredentialSource>;
45
41
  /**
46
42
  * Re-establishes an authenticated device certificate only after the
@@ -60,7 +56,8 @@ interface CachedDeviceCertificate {
60
56
  interface AuthenticatedDeviceCertificate extends CachedDeviceCertificate {
61
57
  principalId: string;
62
58
  enrolled: boolean;
63
- relay: boolean;
59
+ irohRelay: boolean;
60
+ managedTurn: boolean;
64
61
  }
65
62
  interface ControlPlaneEvents {
66
63
  beforeLogicalOperation?: (operation: string) => void;
@@ -132,8 +129,5 @@ declare function OpenRTC(options: Options, endpoints: Endpoints, testing?: {
132
129
  deviceId?: string;
133
130
  irohTestRelayUrl?: string;
134
131
  }): Client;
135
- declare namespace OpenRTC {
136
- var native: (options: Options, endpoints: Endpoints, bridge: PlutoIpcBridge) => Client;
137
- }
138
132
 
139
133
  export { OpenRTC, controlPlane };
package/dist/testing.js CHANGED
@@ -1 +1 @@
1
- import {a}from'./chunk-Q6KXVTSH.js';import {a as a$1}from'./chunk-BOS554IK.js';import {c}from'./chunk-4MLJXEVV.js';import {b}from'./chunk-UILOGUOU.js';import'./chunk-ZA44REGI.js';import'./chunk-DUY34MGT.js';import'./chunk-HEAJ7ZUR.js';function d(o){let r=e=>`${e}:${o}`;return {getOrCreate:e=>c.getOrCreate(r(e)),delete:async e=>{await c.delete?.(r(e));},readSecureRecord:(e,t)=>c.readSecureRecord?.(r(e),t)??Promise.resolve(null),writeSecureRecord:(e,t,n)=>c.writeSecureRecord?.(r(e),t,n)??Promise.resolve(),deleteSecureRecord:(e,t)=>c.deleteSecureRecord?.(r(e),t)??Promise.resolve()}}function y(o,r,e){return new a(o,r,d(e))}function s(o,r,e={}){return b(o,{endpoints:r,testingAllowInsecureLoopback:true,platform:"web",...e.deviceId?{deviceIdProvider:async()=>e.deviceId}:{},...e.irohTestRelayUrl?{irohTestRelayUrl:e.irohTestRelayUrl}:{},runtimeFactory:async t=>{let{createWasmClient:n}=await import('./runtime/factories.js');return n(t)}})}s.native=function(o,r,e){return b(o,{endpoints:r,testingAllowInsecureLoopback:true,platform:"native",deviceKeyProvider:a$1(e),deviceIdProvider:async()=>{let t=await e.invoke("get_rtc_local_device_info");return String(t?.deviceId??"")},runtimeFactory:async t=>{let{createIpcClient:n}=await import('./ipcFactory-32R47AVK.js');return n(t,e)}})};export{s as OpenRTC,y as controlPlane};
1
+ import {a}from'./chunk-BCGCJGIV.js';import {c}from'./chunk-4MLJXEVV.js';import {b}from'./chunk-2LATKLCC.js';import'./chunk-ZA44REGI.js';import'./chunk-WB66633N.js';import'./chunk-JPBW67B3.js';import'./chunk-2GX6GB6L.js';function s(i){let r=e=>`${e}:${i}`;return {getOrCreate:e=>c.getOrCreate(r(e)),delete:async e=>{await c.delete?.(r(e));},readSecureRecord:(e,o)=>c.readSecureRecord?.(r(e),o)??Promise.resolve(null),writeSecureRecord:(e,o,n)=>c.writeSecureRecord?.(r(e),o,n)??Promise.resolve(),deleteSecureRecord:(e,o)=>c.deleteSecureRecord?.(r(e),o)??Promise.resolve()}}function m(i,r,e){return new a(i,r,s(e))}function u(i,r,e={}){return b(i,{endpoints:r,testingAllowInsecureLoopback:true,platform:"web",...e.deviceId?{deviceIdProvider:async()=>e.deviceId}:{},...e.irohTestRelayUrl?{irohTestRelayUrl:e.irohTestRelayUrl}:{},runtimeFactory:async o=>{let{createWasmClient:n}=await import('./runtime/factories.js');return n(o)}})}export{u as OpenRTC,m as controlPlane};
@@ -1,31 +1,20 @@
1
- import { c as ProtocolName, $ as RouteDescriptor, K as ITransport, a0 as ProtocolCapability, a1 as ProtocolCapabilityMap, z as PayloadCrypto, a2 as CryptoStreams } from '../ITransport-CjxCQ6q7.js';
2
- export { a3 as CryptoBiStream, a4 as RouteFamily, a5 as RouteKind } from '../ITransport-CjxCQ6q7.js';
1
+ import { c as ProtocolName, aj as RouteDescriptor, ak as PayloadCrypto, al as CryptoStreams } from '../Connection-DZ5eP5hL.js';
2
+ export { am as CryptoBiStream, an as RouteFamily, ao as RouteKind } from '../Connection-DZ5eP5hL.js';
3
3
 
4
4
  declare const TRANSPORT_LABELS: readonly ProtocolName[];
5
5
  declare function normalizeTransport(value: unknown): ProtocolName | undefined;
6
6
  declare function isBaseIroh(value: unknown): boolean;
7
7
  declare function isDirectIroh(value: unknown): boolean;
8
- declare function isOptionalTransport(value: unknown): boolean;
9
8
  declare function isWebRtc(value: unknown): boolean;
10
- declare function isIndependent(value: unknown): boolean;
11
9
 
12
10
  declare const ROUTE_DESCRIPTORS: readonly RouteDescriptor[];
13
11
  declare function getRouteDescriptor(id: ProtocolName): RouteDescriptor;
14
12
  declare function listRouteDescriptors(): readonly RouteDescriptor[];
15
13
 
16
- declare class TransportFactory {
17
- private static readonly capabilityMap;
18
- /** @deprecated Only WebRTC implements the legacy ITransport construction API. */
19
- static createTransport(name: ProtocolName): ITransport;
20
- static getProtocolCapability(name: ProtocolName): ProtocolCapability;
21
- static getProtocolCapabilities(): ProtocolCapabilityMap;
22
- static preferredProtocols(options?: {
23
- runtime?: 'browser' | 'native' | 'any';
24
- includePathLabels?: boolean;
25
- }): ProtocolName[];
26
- static assertProtocolAvailable(name: ProtocolName): void;
27
- }
28
- declare function preferredProtocols(options?: Parameters<typeof TransportFactory.preferredProtocols>[0]): ProtocolName[];
14
+ declare function preferredProtocols(options?: {
15
+ runtime?: 'browser' | 'native' | 'any';
16
+ includePathLabels?: boolean;
17
+ }): ProtocolName[];
29
18
 
30
19
  declare function isEncryptedPayload(payload: Uint8Array): boolean;
31
20
  declare function createSharedCrypto(key: Uint8Array, options?: {
@@ -52,4 +41,4 @@ declare function createKeyAgreement(randomBytes?: (byteLength: number) => Uint8A
52
41
  declare function deriveCryptoKey(localSecretKey: Uint8Array, remotePublicKey: Uint8Array, localNodeId: string, remoteNodeId: string): Uint8Array;
53
42
  declare function encodeKeyAgreement(publicKey: Uint8Array): KeyAgreementPayload;
54
43
 
55
- export { CryptoStreams, KEY_ALGORITHM, type KeyAgreementPayload, PUBLIC_KEY_BYTES, PayloadCrypto, ProtocolName, ROUTE_DESCRIPTORS, RouteDescriptor, TRANSPORT_LABELS, createCryptoStreams, createKeyAgreement, createSharedCrypto, deriveCryptoKey, encodeKeyAgreement, getRouteDescriptor, isBaseIroh, isDirectIroh, isEncryptedPayload, isIndependent, isOptionalTransport, isWebRtc, listRouteDescriptors, normalizeTransport, preferredProtocols };
44
+ export { CryptoStreams, KEY_ALGORITHM, type KeyAgreementPayload, PUBLIC_KEY_BYTES, PayloadCrypto, ProtocolName, ROUTE_DESCRIPTORS, RouteDescriptor, TRANSPORT_LABELS, createCryptoStreams, createKeyAgreement, createSharedCrypto, deriveCryptoKey, encodeKeyAgreement, getRouteDescriptor, isBaseIroh, isDirectIroh, isEncryptedPayload, isWebRtc, listRouteDescriptors, normalizeTransport, preferredProtocols };
@@ -1 +1 @@
1
- export{e as KEY_ALGORITHM,d as PUBLIC_KEY_BYTES,f as createKeyAgreement,g as deriveCryptoKey,i as encodeKeyAgreement,c as preferredProtocols}from'../chunk-7BJKDBLP.js';export{o as TRANSPORT_LABELS,z as createCryptoStreams,y as createSharedCrypto,q as isBaseIroh,r as isDirectIroh,x as isEncryptedPayload,w as isIndependent,s as isOptionalTransport,t as isWebRtc,p as normalizeTransport}from'../chunk-2L6ULC32.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-2SUSPEC4.js';
1
+ export{g as KEY_ALGORITHM,f as PUBLIC_KEY_BYTES,c as createCryptoStreams,h as createKeyAgreement,b as createSharedCrypto,i as deriveCryptoKey,j as encodeKeyAgreement,a as isEncryptedPayload,e as preferredProtocols}from'../chunk-TYZS5LXQ.js';export{k as TRANSPORT_LABELS,m as isBaseIroh,n as isDirectIroh,o as isWebRtc,l as normalizeTransport}from'../chunk-OT7IPLZE.js';export{b as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-OWKAJPOI.js';
@@ -1,6 +1,5 @@
1
1
  import { PeerNamespace, ChannelNamespace, DiagnosticsNamespace, DeviceNamespace } from './coreClient.js';
2
- import { C as ChannelDescriptor } from './types-DDhMQkK8.js';
3
- import { P as PlutoIrohConfiguration, a as PlutoRTCConfiguration, b as PlutoMoQConfiguration, R as RouteOptimization, c as ProtocolName } from './ITransport-CjxCQ6q7.js';
2
+ import { C as ChannelDescriptor, P as PlutoIrohConfiguration, a as PlutoRTCConfiguration, b as PlutoMoQConfiguration, R as RouteOptimization, c as ProtocolName } from './Connection-DZ5eP5hL.js';
4
3
 
5
4
  interface AuthProvider {
6
5
  /** Registered provider ID from the developer app capability manifest. */
@@ -105,7 +104,11 @@ interface UsageWarning extends UsageUpdate {
105
104
  interface Transports {
106
105
  iroh?: boolean | PlutoIrohConfiguration;
107
106
  webrtc?: boolean | PlutoRTCConfiguration;
108
- /** Allow managed relay fallback. Defaults to true; set false for direct-only P2P. */
107
+ /**
108
+ * Allow relay mechanisms. Defaults to true; set false for direct-only P2P.
109
+ * The authenticated runtime tracks Iroh relay and managed TURN readiness
110
+ * independently; this option is intent, not proof that either is deployed.
111
+ */
109
112
  relay?: boolean;
110
113
  moq?: boolean | PlutoMoQConfiguration;
111
114
  ble?: boolean;
@@ -117,12 +120,6 @@ interface Transports {
117
120
  privacy?: 'direct' | 'relay-only';
118
121
  /** Optimize eligible routes for stability/cost or measured latency. */
119
122
  optimizeFor?: RouteOptimization;
120
- /**
121
- * Advanced native integration for hosts whose Rust process owns the
122
- * application protocol registry (for example, a Tauri file-transfer host).
123
- * Normal SDK consumers should leave this disabled.
124
- */
125
- nativeHostProtocols?: boolean;
126
123
  /** Exact route order. Unsupported routes are skipped, never treated as failures. */
127
124
  priority?: readonly ProtocolName[];
128
125
  }
@@ -143,9 +140,176 @@ interface Options {
143
140
  }
144
141
  type AccessMode = 'capability' | 'authenticated';
145
142
  type Delivery = 'reliable' | 'latest-state';
143
+ interface PeerStreamOptions {
144
+ /** Registered application protocol used by the single incoming classifier. */
145
+ protocol: string;
146
+ timeoutMs?: number;
147
+ }
148
+ interface PeerBidirectionalStream {
149
+ readonly protocol: string;
150
+ readonly readable: ReadableStream<Uint8Array>;
151
+ readonly writable: WritableStream<Uint8Array>;
152
+ }
153
+ interface IncomingPeerBidirectionalStream extends PeerBidirectionalStream {
154
+ readonly peerId: string;
155
+ }
156
+ interface IncomingPeerUnidirectionalStream {
157
+ readonly peerId: string;
158
+ readonly protocol: string;
159
+ readonly readable: ReadableStream<Uint8Array>;
160
+ }
161
+ interface PeerDatagramDuplexStream {
162
+ readonly maxDatagramSize: number;
163
+ /** Drop received datagrams older than this many milliseconds; `null` disables expiry. */
164
+ incomingMaxAge: number | null;
165
+ /** Drop queued outgoing datagrams older than this many milliseconds; `null` disables expiry. */
166
+ outgoingMaxAge: number | null;
167
+ /** Bounded application receive queue. */
168
+ incomingMaxBufferedDatagrams: number;
169
+ /** Bounded application send queue. */
170
+ outgoingMaxBufferedDatagrams: number;
171
+ readonly readable: ReadableStream<Uint8Array>;
172
+ readonly writable: WritableStream<Uint8Array>;
173
+ getStats(): PeerDatagramStats;
174
+ }
175
+ interface PeerDatagramStats {
176
+ received: number;
177
+ sent: number;
178
+ bytesReceived: number;
179
+ bytesSent: number;
180
+ droppedIncoming: number;
181
+ droppedOutgoing: number;
182
+ expiredIncoming: number;
183
+ expiredOutgoing: number;
184
+ sendFailures: number;
185
+ incomingBufferedDatagrams: number;
186
+ outgoingBufferedDatagrams: number;
187
+ }
188
+ interface PeerStreamTransport {
189
+ createBidirectionalStream(options: PeerStreamOptions): Promise<PeerBidirectionalStream>;
190
+ createUnidirectionalStream(options: PeerStreamOptions): Promise<WritableStream<Uint8Array>>;
191
+ readonly incomingBidirectionalStreams: ReadableStream<IncomingPeerBidirectionalStream>;
192
+ readonly incomingUnidirectionalStreams: ReadableStream<IncomingPeerUnidirectionalStream>;
193
+ readonly datagrams: PeerDatagramDuplexStream;
194
+ }
195
+ type MediaKind = 'audio' | 'video';
196
+ interface MediaTrackOptions {
197
+ streams?: readonly MediaStream[];
198
+ /** Browser codec preference. Web Audio edges default to PCM; other browser audio defaults to Opus. */
199
+ codec?: string;
200
+ bitrate?: number;
201
+ }
202
+ /** Bounded local monotonic-clock samples; this is not cross-peer latency. */
203
+ interface MediaLatencySummary {
204
+ samples: number;
205
+ p50Ms: number;
206
+ p95Ms: number;
207
+ p99Ms: number;
208
+ maxMs: number;
209
+ }
210
+ interface MediaSenderStats {
211
+ publicationId: string;
212
+ mediaGeneration: number;
213
+ accepted: number;
214
+ /** Encoded chunks currently waiting on the protected logical stream. */
215
+ queued: number;
216
+ /** Encoded payload bytes currently waiting on the protected logical stream. */
217
+ queuedBytes: number;
218
+ /** Age of the oldest currently queued encoded payload. */
219
+ queuedAgeMs: number;
220
+ transmitted: number;
221
+ dropped: number;
222
+ bytes: number;
223
+ maxQueued: number;
224
+ maxQueuedBytes: number;
225
+ maxQueuedAgeMs: number;
226
+ /** Most recent asynchronous encoder or protected-stream failure, if any. */
227
+ lastError?: string;
228
+ encodeLatency: MediaLatencySummary;
229
+ protectedWriteLatency: MediaLatencySummary;
230
+ }
231
+ interface MediaReceiverStats {
232
+ publicationId: string;
233
+ mediaGeneration: number;
234
+ received: number;
235
+ decoded: number;
236
+ rendered: number;
237
+ dropped: number;
238
+ integrityFailures: number;
239
+ malformedFrames: number;
240
+ replayDrops: number;
241
+ /** Successful resumptions on a video keyframe after corruption or loss. */
242
+ videoRecoveries: number;
243
+ /** Whether dependent video is currently being discarded until a keyframe. */
244
+ awaitingKeyframe: boolean;
245
+ /** Longest local receive-side wait for a recovery keyframe. */
246
+ maxVideoRecoveryMs: number;
247
+ bytes: number;
248
+ decoderQueued: number;
249
+ maxDecoderQueued: number;
250
+ renderQueued: number;
251
+ maxRenderQueued: number;
252
+ receiveToDecodeLatency: MediaLatencySummary;
253
+ renderWriteLatency: MediaLatencySummary;
254
+ }
255
+ interface MediaIncomingDemuxStats {
256
+ /** Whether this connection's protected peer-stream channel listener is installed. */
257
+ registered: boolean;
258
+ /** Existing public peers known to this capability router. */
259
+ peers: number;
260
+ /** Rust logical connection identities bound to those peers. */
261
+ boundConnections: number;
262
+ /** Protected streams offered to this capability router. */
263
+ observed: number;
264
+ /** Streams claimed by an existing public peer and protocol handler. */
265
+ accepted: number;
266
+ /** Streams this capability correctly left for another capability router. */
267
+ declined: number;
268
+ /** Most recent identifier-free ownership decision. */
269
+ lastResolution: 'none' | 'connection' | 'remote-peer' | 'peer-alias' | 'unbound-connection';
270
+ }
271
+ interface MediaStats {
272
+ senders: readonly MediaSenderStats[];
273
+ receivers: readonly MediaReceiverStats[];
274
+ /** Bounded receiver setup/runtime failures for streams that never produced a receiver. */
275
+ incomingFailures: readonly string[];
276
+ /** Number of protected publication streams delivered by protocol dispatch. */
277
+ incomingProtocolStreams: number;
278
+ /** Transport-agnostic protected-stream ownership diagnostics. */
279
+ incomingDemux: MediaIncomingDemuxStats;
280
+ }
281
+ interface MediaSender {
282
+ readonly id: string;
283
+ readonly track: MediaStreamTrack | null;
284
+ replaceTrack(track: MediaStreamTrack | null): Promise<void>;
285
+ setEnabled(enabled: boolean): Promise<void>;
286
+ stop(): Promise<void>;
287
+ getStats(): Promise<MediaSenderStats>;
288
+ }
289
+ interface MediaReceiver {
290
+ readonly id: string;
291
+ readonly track: MediaStreamTrack;
292
+ getStats(): Promise<MediaReceiverStats>;
293
+ }
294
+ interface MediaTrackEvent {
295
+ readonly track: MediaStreamTrack;
296
+ readonly receiver: MediaReceiver;
297
+ readonly streams: readonly MediaStream[];
298
+ }
299
+ interface MediaConnection {
300
+ addTrack(track: MediaStreamTrack, options?: MediaTrackOptions): Promise<MediaSender>;
301
+ removeTrack(sender: MediaSender): Promise<void>;
302
+ onTrack(callback: (event: MediaTrackEvent) => void): () => void;
303
+ senders(): readonly MediaSender[];
304
+ receivers(): readonly MediaReceiver[];
305
+ getStats(): Promise<MediaStats>;
306
+ }
146
307
  interface Connection {
308
+ /** Stable logical peer identity. It does not change when Rust replaces a physical connection or carrier. */
147
309
  readonly id: string;
148
310
  readonly peerId: string;
311
+ readonly streams: PeerStreamTransport;
312
+ readonly media: MediaConnection;
149
313
  send(message: unknown): Promise<void>;
150
314
  onMessage<T = unknown>(callback: (message: T) => void): () => void;
151
315
  onClose(callback: () => void): () => void;
@@ -232,6 +396,8 @@ interface SpaceOptions {
232
396
  interface RoomOptions {
233
397
  access?: AccessMode;
234
398
  membership?: 'ephemeral' | 'durable';
399
+ /** Use a new memory-only identity for this anonymous room client run. */
400
+ identity?: 'session';
235
401
  auth?: AuthProvider;
236
402
  maxPeers?: number;
237
403
  /**
@@ -241,6 +407,8 @@ interface RoomOptions {
241
407
  advancedFanout?: boolean;
242
408
  }
243
409
  interface TicketOptions {
410
+ /** Use a new memory-only identity for this ticket client run. */
411
+ identity?: 'session';
244
412
  maxPeers?: number;
245
413
  /** Requires the app manifest's advanced-fanout opt-in. */
246
414
  advancedFanout?: boolean;
@@ -292,4 +460,4 @@ interface Client {
292
460
  close(): Promise<void>;
293
461
  }
294
462
 
295
- export type { AttestationProvider as A, BotVerificationProvider as B, Client as C, DeviceOptions as D, EnrolledDevice as E, Options as O, Room as R, Space as S, Ticket as T, UsageUpdate as U, AuthProvider as a, Avenue as b, Channel as c, Connection as d, DeviceProfile as e, Devices as f, RoomOptions as g, SpaceOptions as h, State as i, TicketOptions as j, Transports as k, UsageWarning as l };
463
+ export type { AccessMode as A, BotVerificationProvider as B, Client as C, Delivery as D, EnrolledDevice as E, State as F, TicketOptions as G, Transports as H, IncomingPeerBidirectionalStream as I, UsageUpdate as J, UsageWarning as K, MediaConnection as M, Options as O, PeerBidirectionalStream as P, Room as R, Space as S, Ticket as T, Usage as U, AttestationProvider as a, AuthProvider as b, Avenue as c, Channel as d, Channels as e, Connection as f, DeviceOptions as g, DeviceProfile as h, Devices as i, IncomingPeerUnidirectionalStream as j, MediaIncomingDemuxStats as k, MediaKind as l, MediaLatencySummary as m, MediaReceiver as n, MediaReceiverStats as o, MediaSender as p, MediaSenderStats as q, MediaStats as r, MediaTrackEvent as s, MediaTrackOptions as t, PeerDatagramDuplexStream as u, PeerDatagramStats as v, PeerStreamOptions as w, PeerStreamTransport as x, RoomOptions as y, SpaceOptions as z };