openrtc 1.0.27 → 2.0.0-rc.1

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 (67) hide show
  1. package/README.md +143 -205
  2. package/dist/DelegatingRuntimeAdapter-DqfHkjLy.d.ts +373 -0
  3. package/dist/ITransport-BsPcaov7.d.ts +16 -0
  4. package/dist/OpenRTCShared-TKAQLONA.js +1 -0
  5. package/dist/{assembly-CscFVHYK.d.ts → OpenRTCShared-ZQPu5LqL.d.ts} +255 -28
  6. package/dist/WasmBridge-2A22U7RU.js +1 -0
  7. package/dist/auth/index.js +1 -1
  8. package/dist/auth/internal.js +1 -1
  9. package/dist/{capabilities-CaqXOIUU.d.ts → capabilities-YSskrE8H.d.ts} +1 -1
  10. package/dist/chunk-2QHDEGVX.js +1 -0
  11. package/dist/chunk-3USHQ7QW.js +3 -0
  12. package/dist/chunk-5LRLWIT5.js +1 -0
  13. package/dist/chunk-6TAVJ46R.js +1 -0
  14. package/dist/chunk-7Z6N46RB.js +2 -0
  15. package/dist/chunk-A3IAG6EL.js +1 -0
  16. package/dist/chunk-BXFXPIXO.js +1 -0
  17. package/dist/chunk-F2XGNLXL.js +2 -0
  18. package/dist/chunk-GW7P3D54.js +1 -0
  19. package/dist/chunk-IEQTFQ3Q.js +1 -0
  20. package/dist/chunk-K37WVIZL.js +1 -0
  21. package/dist/chunk-N26S7V4N.js +1 -0
  22. package/dist/chunk-N4SX7C3W.js +2 -0
  23. package/dist/chunk-NB4H5TP3.js +1 -0
  24. package/dist/chunk-NT5YHZQH.js +1 -0
  25. package/dist/chunk-PODAMIL6.js +2 -0
  26. package/dist/chunk-RD3JEGGF.js +2 -0
  27. package/dist/chunk-UEYM6WTT.js +2 -0
  28. package/dist/chunk-VK6KX433.js +1 -0
  29. package/dist/chunk-YBXGNKM7.js +2 -0
  30. package/dist/chunk-YQWQDTQ3.js +2 -0
  31. package/dist/factories-SIVMTIHJ.js +1 -0
  32. package/dist/index.d.ts +12 -65
  33. package/dist/index.js +1 -1
  34. package/dist/ipcFactory-QY44OIKA.js +1 -0
  35. package/dist/native.d.ts +10 -15
  36. package/dist/native.js +1 -1
  37. package/dist/openrtc_bg.wasm +0 -0
  38. package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -3
  39. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  40. package/dist/runtime/device-status.d.ts +3 -2
  41. package/dist/runtime/index.d.ts +100 -15
  42. package/dist/runtime/index.js +2 -1
  43. package/dist/runtime/legacy.d.ts +18 -0
  44. package/dist/runtime/legacy.js +1 -0
  45. package/dist/runtime/tauri.d.ts +4 -4
  46. package/dist/runtime/tauri.js +1 -1
  47. package/dist/{tauri-BpsecNrp.d.ts → tauri-Cz9n17g8.d.ts} +2 -2
  48. package/dist/testing.d.ts +30 -0
  49. package/dist/testing.js +1 -0
  50. package/dist/transport/index.d.ts +47 -7
  51. package/dist/transport/index.js +1 -1
  52. package/dist/{types-zT2QwuCv.d.ts → types-BVJr065k.d.ts} +43 -3
  53. package/dist/types-DNl4KHHY.d.ts +195 -0
  54. package/dist/{types-BJU2GoVb.d.ts → types-DkgaCyqS.d.ts} +11 -17
  55. package/package.json +19 -4
  56. package/dist/DelegatingRuntimeAdapter-Cg3jFk1b.d.ts +0 -133
  57. package/dist/chunk-4IK5EKHY.js +0 -2
  58. package/dist/chunk-BW6OKBHV.js +0 -2
  59. package/dist/chunk-EVJYUIBK.js +0 -1
  60. package/dist/chunk-H5VWKP4Q.js +0 -2
  61. package/dist/chunk-HYHVKPQN.js +0 -3
  62. package/dist/chunk-LAUABWCB.js +0 -2
  63. package/dist/chunk-OCSZA6PK.js +0 -2
  64. package/dist/chunk-OMDHDMDJ.js +0 -1
  65. package/dist/chunk-QT2ASNI3.js +0 -1
  66. package/dist/framing-zRvEKOld.d.ts +0 -29
  67. package/dist/spaceTokens-CiwcKKr2.d.ts +0 -297
@@ -1,20 +1,21 @@
1
- import { e as RuntimeFactoryOptions, b as PlutoRuntimeAssembly, P as PeerReconciliationStats } from '../assembly-CscFVHYK.js';
2
- export { O as OPENRTC_RUNTIME_POLICY, R as RuntimeClient, a as RuntimePolicySnapshot, D as ScopedConnectionActorError, f as ScopedConnectionActorErrorKind, h as ScopedConnectionActorHandle, i as ScopedConnectionActorHandleOptions, j as ScopedConnectionActorRegistry, k as ScopedConnectionActorState, l as ScopedConnectionClose, m as ScopedConnectionDial, n as ScopedConnectionKey, o as ScopedLogicalChannelHandle, p as ScopedPreferredTransport, g as getRuntimePolicy, q as scopedConnectionKey, r as scopedConnectionKeyToString } from '../assembly-CscFVHYK.js';
1
+ import { R as RuntimeFactoryOptions, P as PlutoRuntimeAssembly, d as OpenRTCClient, e as PeerReconciliationStats } from '../OpenRTCShared-ZQPu5LqL.js';
2
+ export { f as OPENRTC_RUNTIME_POLICY, g as RuntimeClient, h as RuntimePolicySnapshot, D as ScopedConnectionActorError, i as ScopedConnectionActorErrorKind, j as ScopedConnectionActorHandle, k as ScopedConnectionActorHandleOptions, l as ScopedConnectionActorRegistry, m as ScopedConnectionActorState, n as ScopedConnectionClose, o as ScopedConnectionDial, p as ScopedConnectionKey, q as ScopedLogicalChannelHandle, r as ScopedPreferredTransport, s as getRuntimePolicy, t as scopedConnectionKey, u as scopedConnectionKeyToString } from '../OpenRTCShared-ZQPu5LqL.js';
3
+ import { f as OpenRTCCapabilityHandle } from '../types-DNl4KHHY.js';
4
+ import { C as Connection, r as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-DkgaCyqS.js';
5
+ export { A as ChannelDescriptor, B as ConnectionEvent, D as ConnectionTarget, E as DeviceProfile, I as IncomingStream, P as PeerConnectOptions, F as PeerReadiness, G as PeerStreamOptions, H as PresenceLoopOptions, J as RawConnection, y as RuntimeApplicationPayloadReadinessOptions, K as RuntimeApplicationPayloadRouteOptions, L as RuntimeAuthContext, g as RuntimeAuthIdentity, M as RuntimeAutoConnectPolicy, R as RuntimeChannelDescriptor, a as RuntimeClientOptions, z as RuntimeConnectionEvent, c as RuntimeConnectionStateSnapshot, j as RuntimeDevice, n as RuntimeDeviceConnectOptions, N as RuntimeDevicePresenceStatus, O as RuntimeDeviceStatus, m as RuntimeDeviceStatusSnapshot, f as RuntimeIncomingStream, p as RuntimeJoinRoomOptions, h as RuntimeLocalDeviceInfo, i as RuntimeLocalDeviceProfile, Q as RuntimeLogicalChannelFraming, l as RuntimeManagedSession, S as RuntimeManagedSessionKind, k as RuntimeManagedSessionOptions, T as RuntimeManagedSessionPlatform, e as RuntimePeerConnectOptions, x as RuntimePeerHealth, U as RuntimePeerLifecycleStatus, d as RuntimePeerReadinessSnapshot, V as RuntimePeerScope, W as RuntimePeerSessionSnapshot, b as RuntimePeerState, u as RuntimePeerStreamOptions, w as RuntimePresenceLoopOptions, X as RuntimePresencePolicy, q as RuntimeRoomMember, s as RuntimeScopedChannelOptions, t as RuntimeScopedLogicalChannel, o as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-DkgaCyqS.js';
3
6
  import * as Draft14 from '@moq/net';
4
- import { a4 as SignalingOptions, I as ISignalingBackend, f as RuntimeIdentity, g as RoomMember, j as SignalingEnvelope, m as SignalingSession, h as Device, l as DesiredPeerProjection, r as BackendConnectionState, Y as AppLimits, G as GrantScope, K as JoinRoomOptions, z as IncomingStreamChannelMetadata, X as ApplicationCryptoStreamTools, a5 as RoomCreationMode, e as ClientOptions, t as ApplicationPayloadCrypto, D as DiscoveryMode, W as ProtocolCapabilityMap, a6 as ScanningLoopOptions, a7 as ScanningLoopHandle, a8 as RuntimeBootstrapOptions, a9 as RuntimeBootstrapResult, u as ApplicationPayloadReadinessOptions, aa as ManagedApplicationRouteOptions, H as PeerState, O as PeerScope, J as PeerHealth, y as ChannelDescriptor, ab as JoinRequest, p as NativeConnectParams, q as NativeConnectResult } from '../types-zT2QwuCv.js';
5
- import { C as Connection, K as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-BJU2GoVb.js';
6
- export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, R as RuntimeClientOptions, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-BJU2GoVb.js';
7
- import { R as RuntimeCapabilities } from '../capabilities-CaqXOIUU.js';
8
- export { B as BROWSER_WASM_RUNTIME_CAPABILITIES, c as BrowserRuntimeCapabilityHost, N as NATIVE_IPC_RUNTIME_CAPABILITIES, d as NativeRuntimeStatusSnapshot, e as NativeRuntimeTransportFeatureStatus, b as RuntimeAdapterKind, a as RuntimeCapabilityProfile, f as cloneRuntimeCapabilities, r as runtimeCapabilitiesForBrowserHost, g as runtimeCapabilitiesFromNativeStatus, h as runtimeCapabilityProfile } from '../capabilities-CaqXOIUU.js';
7
+ import { a0 as SignalingOptions, q as ISignalingBackend, R as RuntimeIdentity, j as RoomMember, r as SignalingEnvelope, S as SignalingSession, D as Device, x as DesiredPeerProjection, B as BackendConnectionState, $ as AppLimits, H as GrantScope, J as JoinRoomOptions, I as IncomingStreamChannelMetadata, U as ApplicationCryptoStreamTools, a1 as RoomCreationMode, i as ClientOptions, A as ApplicationPayloadCrypto, n as DiscoveryMode, Q as ProtocolCapabilityMap, a2 as ScanningLoopOptions, a3 as ScanningLoopHandle, a4 as RuntimeBootstrapOptions, a5 as RuntimeBootstrapResult, a as ApplicationPayloadReadinessOptions, a6 as ManagedApplicationRouteOptions, d as PeerState, e as PeerScope, f as PeerHealth, g as ChannelDescriptor, a7 as JoinRequest, N as NativeConnectParams, z as NativeConnectResult, a8 as SpaceTokenProvider } from '../types-BVJr065k.js';
8
+ import { R as RuntimeCapabilities } from '../capabilities-YSskrE8H.js';
9
+ export { B as BROWSER_WASM_RUNTIME_CAPABILITIES, b as BrowserRuntimeCapabilityHost, N as NATIVE_IPC_RUNTIME_CAPABILITIES, c as NativeRuntimeStatusSnapshot, d as NativeRuntimeTransportFeatureStatus, e as RuntimeAdapterKind, a as RuntimeCapabilityProfile, f as cloneRuntimeCapabilities, r as runtimeCapabilitiesForBrowserHost, g as runtimeCapabilitiesFromNativeStatus, h as runtimeCapabilityProfile } from '../capabilities-YSskrE8H.js';
9
10
  export { RuntimeDeviceActiveOptions, isRuntimeDeviceActive, isRuntimeDeviceConnectable, isRuntimeDeviceRoutable } from './device-status.js';
10
- export { h as RuntimeJsonFrameDecoderOptions, R as RuntimeJsonFrameHandler, a as RuntimeU32BEFrameHandler, i as concatRuntimeBytes, c as createRuntimeJsonFrameDecoder, b as createRuntimeU32BEFrameDecoder, d as decodeRuntimeJsonPayload, e as encodeRuntimeJsonFrame, f as encodeRuntimeJsonPayload, g as encodeRuntimeU32BEFrame, r as readRuntimeU32BE } from '../framing-zRvEKOld.js';
11
- import { I as IpcRuntimeAdapter } from '../tauri-BpsecNrp.js';
12
- export { a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-BpsecNrp.js';
13
- import { WasmRuntimeAdapter } from './WasmRuntimeAdapter.js';
11
+ import { I as IpcRuntimeAdapter } from '../tauri-Cz9n17g8.js';
12
+ export { a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-Cz9n17g8.js';
13
+ import { a as WasmBridge } from '../DelegatingRuntimeAdapter-DqfHkjLy.js';
14
14
  import { P as PlutoIpcBridge } from '../ipc-CflAVodw.js';
15
15
  export { N as NativeIpcFailureKind, a as PlutoIpcUnlisten, c as classifyNativeIpcFailure, i as isNativeIpcCommandUnavailable } from '../ipc-CflAVodw.js';
16
+ export { WasmRuntimeAdapter } from './WasmRuntimeAdapter.js';
16
17
  import '../IEngineBridge-BbsT8hof.js';
17
- import '../DelegatingRuntimeAdapter-Cg3jFk1b.js';
18
+ import '../ITransport-BsPcaov7.js';
18
19
 
19
20
  declare class Signaling {
20
21
  private readonly appTag;
@@ -66,7 +67,7 @@ declare class Signaling {
66
67
  * @deprecated Legacy assembly helper. Use `OpenRTC()` for app code.
67
68
  * Removal target: OpenRTC 0.2.0.
68
69
  */
69
- declare function createWasmClient(options: RuntimeFactoryOptions): PlutoRuntimeAssembly<WasmRuntimeAdapter>;
70
+ declare function createWasmClient(options: RuntimeFactoryOptions): Promise<PlutoRuntimeAssembly<WasmBridge>>;
70
71
  /**
71
72
  * @deprecated Legacy assembly helper. Native applications should use
72
73
  * `createNativeOpenRTC` from `openrtc/native`.
@@ -74,6 +75,14 @@ declare function createWasmClient(options: RuntimeFactoryOptions): PlutoRuntimeA
74
75
  */
75
76
  declare function createIpcClient(options: RuntimeFactoryOptions, bridge: PlutoIpcBridge): PlutoRuntimeAssembly<IpcRuntimeAdapter>;
76
77
 
78
+ type OpenRTCCapabilityRuntime = OpenRTCClient;
79
+ /**
80
+ * Low-level escape hatch used only by `openrtc/runtime`. Product code should
81
+ * prefer the capability namespaces. Keeping this registry here prevents a
82
+ * runtime pointer from leaking onto the provider-neutral root surface.
83
+ */
84
+ declare function runtimeForCapability(handle: OpenRTCCapabilityHandle): OpenRTCCapabilityRuntime;
85
+
77
86
  interface MoQSubscriberOptions {
78
87
  maxPendingSubscriptions?: number;
79
88
  maxSubscribeRetries?: number;
@@ -217,7 +226,7 @@ declare class RoomManager {
217
226
  private requireCoordinationGateway;
218
227
  private get roomBackendTag();
219
228
  private resolveRoomUserId;
220
- private get appTag();
229
+ private resolveControlPlaneAppTag;
221
230
  private invokeRoomCallable;
222
231
  private isAlreadyExistsError;
223
232
  private normalizeRoomId;
@@ -503,4 +512,80 @@ declare function openRtcDebug(message: string, data?: unknown): void;
503
512
  declare function openRtcDebugInfo(message: string, data?: unknown): void;
504
513
  declare function openRtcDebugLog(message: string, data?: unknown): void;
505
514
 
506
- export { type CorrelationFields, IpcRuntimeAdapter, PlutoIpcBridge as NativeBridge, PlutoIpcBridge, PlutoRuntimeAssembly, RuntimeCapabilities, RuntimeConnectionController, RuntimeConnectionTarget, RuntimeFactoryOptions, RuntimeRawConnection, WasmRuntimeAdapter, clog, correlationForDriveGrantScope, createIpcClient, createWasmClient, logOpenRtcTeardownTrace, openRtcDebug, openRtcDebugEnabled, openRtcDebugInfo, openRtcDebugLog, renderCorrelationFields };
515
+ /**
516
+ * Pure byte / stream / timing helpers.
517
+ *
518
+ * Extracted from the `Client` god object (see
519
+ * `docs/plans/client-ts-decomposition.md` Phase 1). These functions are
520
+ * deliberately pure — no `Client` state, no `this`, no logging side effects — so
521
+ * the same helper is reused everywhere instead of being re-implemented inline
522
+ * (e.g. `concatBytes` previously existed both here and in `applicationCrypto.ts`,
523
+ * and three near-identical exponential-backoff helpers existed across the class).
524
+ */
525
+
526
+ type ByteArray = Uint8Array<ArrayBuffer>;
527
+ type ByteArrayLike = Uint8Array<ArrayBufferLike>;
528
+
529
+ type RuntimeU32BEFrameHandler = (payload: ByteArray) => void;
530
+ type RuntimeJsonFrameHandler<T = unknown> = (value: T, payload: ByteArray) => void;
531
+ interface RuntimeJsonFrameDecoderOptions {
532
+ onInvalidJson?: (error: unknown, payload: ByteArray) => void;
533
+ }
534
+ declare function encodeRuntimeU32BEFrame(payload: ByteArrayLike): ByteArray;
535
+ declare function createRuntimeU32BEFrameDecoder(onFrame: RuntimeU32BEFrameHandler): (chunk: ByteArrayLike) => void;
536
+ declare function encodeRuntimeJsonPayload(value: unknown): ByteArray;
537
+ declare function decodeRuntimeJsonPayload<T = unknown>(payload: ByteArrayLike): T;
538
+ declare function encodeRuntimeJsonFrame(value: unknown): ByteArray;
539
+ declare function createRuntimeJsonFrameDecoder<T = unknown>(onValue: RuntimeJsonFrameHandler<T>, options?: RuntimeJsonFrameDecoderOptions): (chunk: ByteArrayLike) => void;
540
+ declare function concatRuntimeBytes(a: ByteArrayLike, b: ByteArrayLike): ByteArray;
541
+ declare function readRuntimeU32BE(bytes: ByteArrayLike, offset: number): number;
542
+
543
+ type MintSpaceTokenRequest = {
544
+ spaceKey: string;
545
+ memberId?: string;
546
+ ttl?: number;
547
+ sandboxAppId?: string;
548
+ };
549
+ type MintSpaceTokenResponse = {
550
+ token: string;
551
+ expiresAt: number;
552
+ tokenLifetimeSeconds: number;
553
+ namespaceId: string;
554
+ spaceAppTag: string;
555
+ };
556
+ /**
557
+ * Mint a namespace-scoped Firebase custom token from your backend using the
558
+ * OpenRTC `POST /v1/spaces/tokens` endpoint. Never call this from browser code
559
+ * with a secret key — proxy through your server.
560
+ */
561
+ type EnableSpaceAuthResponse = {
562
+ success: true;
563
+ space: {
564
+ namespaceId: string;
565
+ requireScopedAuth: boolean;
566
+ status: 'active' | 'revoked';
567
+ };
568
+ };
569
+ /**
570
+ * Opt a provisioned space into scoped-auth mode (required for all spaces).
571
+ * Call from your backend with sk_live_... only.
572
+ */
573
+ declare function enableSpaceAuth(endpointUrl: string, secretKey: string, namespaceId: string): Promise<EnableSpaceAuthResponse>;
574
+ declare function mintSpaceToken(endpointUrl: string, secretKey: string, request: MintSpaceTokenRequest): Promise<MintSpaceTokenResponse>;
575
+ /**
576
+ * Browser-safe space auth for static sites. Calls the rate-limited
577
+ * `v1SpacePublicTokens` endpoint (pk_live_ + spaceKey only).
578
+ */
579
+ declare function createPublicSpaceTokenProvider(options: {
580
+ apiKey: string;
581
+ space?: string;
582
+ spaceKey?: string;
583
+ endpointUrl?: string;
584
+ memberIdStorageKey?: string;
585
+ sandboxAppId?: string;
586
+ }): SpaceTokenProvider;
587
+ declare function sandboxSpaceKey(spaceKey: string, sandboxAppId?: string): string;
588
+ declare const spaceToken: typeof createPublicSpaceTokenProvider;
589
+ declare const createSpaceTokenProvider: typeof createPublicSpaceTokenProvider;
590
+
591
+ export { Connection, type CorrelationFields, type EnableSpaceAuthResponse, IpcRuntimeAdapter, type MintSpaceTokenRequest, type MintSpaceTokenResponse, PlutoIpcBridge as NativeBridge, type OpenRTCCapabilityRuntime, PlutoIpcBridge, PlutoRuntimeAssembly, RuntimeCapabilities, RuntimeConnectionController, RuntimeConnectionTarget, RuntimeFactoryOptions, type RuntimeJsonFrameDecoderOptions, type RuntimeJsonFrameHandler, RuntimeRawConnection, type RuntimeU32BEFrameHandler, clog, concatRuntimeBytes, correlationForDriveGrantScope, createIpcClient, createPublicSpaceTokenProvider, createRuntimeJsonFrameDecoder, createRuntimeU32BEFrameDecoder, createSpaceTokenProvider, createWasmClient, decodeRuntimeJsonPayload, enableSpaceAuth, encodeRuntimeJsonFrame, encodeRuntimeJsonPayload, encodeRuntimeU32BEFrame, logOpenRtcTeardownTrace, mintSpaceToken, openRtcDebug, openRtcDebugEnabled, openRtcDebugInfo, openRtcDebugLog, readRuntimeU32BE, renderCorrelationFields, runtimeForCapability as runtimeFromCapability, sandboxSpaceKey, spaceToken };
@@ -1 +1,2 @@
1
- export{b as createIpcClient,a as createWasmClient}from'../chunk-H5VWKP4Q.js';export{z as RuntimeClient,i as RuntimeConnectionController,m as ScopedConnectionActorError,p as ScopedConnectionActorHandle,q as ScopedConnectionActorRegistry,l as clog,x as concatRuntimeBytes,k as correlationForDriveGrantScope,w as createRuntimeJsonFrameDecoder,s as createRuntimeU32BEFrameDecoder,u as decodeRuntimeJsonPayload,v as encodeRuntimeJsonFrame,t as encodeRuntimeJsonPayload,r as encodeRuntimeU32BEFrame,y as readRuntimeU32BE,j as renderCorrelationFields,n as scopedConnectionKey,o as scopedConnectionKeyToString}from'../chunk-HYHVKPQN.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';export{a as WasmRuntimeAdapter}from'../chunk-OMDHDMDJ.js';export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-EVJYUIBK.js';export{h as IpcRuntimeAdapter,e as classifyNativeIpcFailure,f as isNativeIpcCommandUnavailable}from'../chunk-4IK5EKHY.js';export{C as BROWSER_WASM_RUNTIME_CAPABILITIES,D as NATIVE_IPC_RUNTIME_CAPABILITIES,A as OPENRTC_RUNTIME_POLICY,E as cloneRuntimeCapabilities,B as getRuntimePolicy,n as logOpenRtcTeardownTrace,b as openRtcDebug,a as openRtcDebugEnabled,c as openRtcDebugInfo,d as openRtcDebugLog,F as runtimeCapabilitiesForBrowserHost,G as runtimeCapabilitiesFromNativeStatus,H as runtimeCapabilityProfile}from'../chunk-LAUABWCB.js';import'../chunk-QT2ASNI3.js';import'../chunk-OCSZA6PK.js';import'../chunk-C7YN5MSV.js';
1
+ export{a as WasmRuntimeAdapter}from'../chunk-GW7P3D54.js';export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-5LRLWIT5.js';export{b as runtimeFromCapability}from'../chunk-PODAMIL6.js';export{b as createIpcClient,a as createWasmClient}from'../chunk-YQWQDTQ3.js';export{b as Connection,t as RuntimeClient,c as RuntimeConnectionController,g as ScopedConnectionActorError,j as ScopedConnectionActorHandle,k as ScopedConnectionActorRegistry,f as clog,r as concatRuntimeBytes,e as correlationForDriveGrantScope,q as createRuntimeJsonFrameDecoder,m as createRuntimeU32BEFrameDecoder,o as decodeRuntimeJsonPayload,p as encodeRuntimeJsonFrame,n as encodeRuntimeJsonPayload,l as encodeRuntimeU32BEFrame,s as readRuntimeU32BE,d as renderCorrelationFields,h as scopedConnectionKey,i as scopedConnectionKeyToString}from'../chunk-3USHQ7QW.js';export{f as IpcRuntimeAdapter}from'../chunk-F2XGNLXL.js';import'../chunk-A3IAG6EL.js';import'../chunk-7Z6N46RB.js';export{q as BROWSER_WASM_RUNTIME_CAPABILITIES,r as NATIVE_IPC_RUNTIME_CAPABILITIES,o as OPENRTC_RUNTIME_POLICY,s as cloneRuntimeCapabilities,p as getRuntimePolicy,g as logOpenRtcTeardownTrace,t as runtimeCapabilitiesForBrowserHost,u as runtimeCapabilitiesFromNativeStatus,v as runtimeCapabilityProfile}from'../chunk-YBXGNKM7.js';export{b as openRtcDebug,a as openRtcDebugEnabled,c as openRtcDebugInfo,d as openRtcDebugLog}from'../chunk-VK6KX433.js';import'../chunk-NT5YHZQH.js';export{a as classifyNativeIpcFailure,b as isNativeIpcCommandUnavailable}from'../chunk-K37WVIZL.js';import'../chunk-BXFXPIXO.js';import {b}from'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';var j="https://api.openrtc.app";function c(e){if(typeof globalThis.crypto?.randomUUID!="function")throw new Error(`Secure request identity is unavailable for ${e}.`);return `${e}:${globalThis.crypto.randomUUID()}`}async function z(e,t,n){let o=e.replace(/\/$/,""),r=await fetch(`${o}/v1/spaces/${encodeURIComponent(n)}/scoped-auth`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":c("enable-space-auth")},body:"{}"}),a=await r.json().catch(()=>({}));if(!r.ok){let s=typeof a?.error=="string"?a.error:`enableSpaceAuth failed (${r.status})`;throw new Error(s)}return a}async function q(e,t,n){let o=await fetch(e,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":c("mint-space-token")},body:JSON.stringify(n)}),r=await o.json().catch(()=>({}));if(!o.ok){let a=typeof r?.error=="string"?r.error:`mintSpaceToken failed (${o.status})`;throw new Error(a)}if(typeof r?.token!="string"||!r.token.trim())throw new Error("mintSpaceToken response missing token");return r}function d(e){let t=e.apiKey.trim(),n=(e.spaceKey??e.space??"").trim(),o=g(e.sandboxAppId),r=(e.endpointUrl??j).replace(/\/$/,""),a=e.memberIdStorageKey??`openrtc:space-member:${n}${o?`:sandbox:${o}`:""}`;return async()=>{if(!t||!n)throw new Error("spaceToken requires apiKey and space");let s=null;typeof sessionStorage<"u"?(s=sessionStorage.getItem(a),s||(s=globalThis.crypto?.randomUUID?.()??`member-${Date.now()}`,sessionStorage.setItem(a,s))):s=`member-${Date.now()}`;let m=await b().getAppCheckToken(),i=await fetch(`${r}/v1SpacePublicTokens`,{method:"POST",headers:{"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":c("mint-public-space-token"),...m?{"X-Firebase-AppCheck":m}:{}},body:JSON.stringify({apiKey:t,spaceKey:n,memberId:s,...o?{sandboxAppId:o}:{}})}),{text:u,payload:p}=await B(i);if(!i.ok){let f=typeof p?.error=="string"?p.error:u.trim()?u.trim().slice(0,240):`public space token mint failed (${i.status})`;throw new Error(f)}let l=typeof p?.token=="string"?p.token.trim():"";if(!l)throw new Error("public space token response missing token");return {customToken:l}}}function M(e){if(!e.trim())return {};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return {}}}async function B(e){let t=e.text;if(typeof t=="function"){let o=await t.call(e).catch(()=>"");return {text:o,payload:M(o)}}let n=await e.json().catch(()=>({}));return {text:JSON.stringify(n),payload:n&&typeof n=="object"?n:{}}}function g(e){let t=e?.trim().toLowerCase()??"";if(!t)return "";if(!/^[a-z0-9][a-z0-9-]{0,47}$/.test(t))throw new Error("sandboxAppId must be 1-48 lowercase letters, numbers, or dashes.");return t}function J(e,t){let n=e.trim(),o=g(t);return o?`${n}::sandbox::${o}`:n}var L=d,H=d;
2
+ export{d as createPublicSpaceTokenProvider,H as createSpaceTokenProvider,z as enableSpaceAuth,q as mintSpaceToken,J as sandboxSpaceKey,L as spaceToken};
@@ -0,0 +1,18 @@
1
+ import { d as OpenRTCClient } from '../OpenRTCShared-ZQPu5LqL.js';
2
+ import { P as PlutoIpcBridge } from '../ipc-CflAVodw.js';
3
+ import { a as RuntimeClientOptions } from '../types-DkgaCyqS.js';
4
+ import '../types-BVJr065k.js';
5
+ import '../IEngineBridge-BbsT8hof.js';
6
+ import '../capabilities-YSskrE8H.js';
7
+ import '../ITransport-BsPcaov7.js';
8
+
9
+ /**
10
+ * Rollback-only constructor for the internal diagnostic sandbox. Shipping 2.0
11
+ * applications must use the root capability API.
12
+ */
13
+ declare function createLegacyOpenRTC(options: RuntimeClientOptions): Promise<OpenRTCClient>;
14
+ declare namespace createLegacyOpenRTC {
15
+ var native: (options: RuntimeClientOptions, bridge?: PlutoIpcBridge) => OpenRTCClient;
16
+ }
17
+
18
+ export { createLegacyOpenRTC };
@@ -0,0 +1 @@
1
+ export{a as createLegacyOpenRTC}from'../chunk-IEQTFQ3Q.js';import'../chunk-2QHDEGVX.js';import'../chunk-6TAVJ46R.js';import'../chunk-N4SX7C3W.js';import'../chunk-YQWQDTQ3.js';import'../chunk-3USHQ7QW.js';import'../chunk-F2XGNLXL.js';import'../chunk-A3IAG6EL.js';import'../chunk-7Z6N46RB.js';import'../chunk-YBXGNKM7.js';import'../chunk-VK6KX433.js';import'../chunk-NT5YHZQH.js';import'../chunk-K37WVIZL.js';import'../chunk-BXFXPIXO.js';import'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';
@@ -1,6 +1,6 @@
1
- export { T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-BpsecNrp.js';
1
+ export { T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-Cz9n17g8.js';
2
2
  import '../ipc-CflAVodw.js';
3
- import '../types-zT2QwuCv.js';
4
- import '../DelegatingRuntimeAdapter-Cg3jFk1b.js';
3
+ import '../types-BVJr065k.js';
4
+ import '../DelegatingRuntimeAdapter-DqfHkjLy.js';
5
+ import '../capabilities-YSskrE8H.js';
5
6
  import '../IEngineBridge-BbsT8hof.js';
6
- import '../capabilities-CaqXOIUU.js';
@@ -1 +1 @@
1
- export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-EVJYUIBK.js';import'../chunk-4IK5EKHY.js';import'../chunk-LAUABWCB.js';import'../chunk-QT2ASNI3.js';import'../chunk-OCSZA6PK.js';import'../chunk-C7YN5MSV.js';
1
+ export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-5LRLWIT5.js';import'../chunk-F2XGNLXL.js';import'../chunk-A3IAG6EL.js';import'../chunk-YBXGNKM7.js';import'../chunk-VK6KX433.js';import'../chunk-NT5YHZQH.js';import'../chunk-K37WVIZL.js';import'../chunk-BXFXPIXO.js';import'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';
@@ -1,5 +1,5 @@
1
- import { e as ClientOptions } from './types-zT2QwuCv.js';
2
- import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-Cg3jFk1b.js';
1
+ import { i as ClientOptions } from './types-BVJr065k.js';
2
+ import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-DqfHkjLy.js';
3
3
  import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
4
4
 
5
5
  interface NativeIpcBridgeOptions extends WasmBridgeOptions {
@@ -0,0 +1,30 @@
1
+ import { d as OpenRTCClient } from './OpenRTCShared-ZQPu5LqL.js';
2
+ import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
3
+ import { a as RuntimeClientOptions } from './types-DkgaCyqS.js';
4
+ import { O as OpenRTCOptions, a as OpenRTCClient$1 } from './types-DNl4KHHY.js';
5
+ import './types-BVJr065k.js';
6
+ import './IEngineBridge-BbsT8hof.js';
7
+ import './capabilities-YSskrE8H.js';
8
+ import './ITransport-BsPcaov7.js';
9
+
10
+ interface OpenRTCV2Endpoints {
11
+ controlPlane: string;
12
+ gateway: string;
13
+ }
14
+
15
+ declare function createTestingOpenRTC(options: OpenRTCOptions, endpoints: OpenRTCV2Endpoints, testing?: {
16
+ deviceId?: string;
17
+ irohTestRelayUrl?: string;
18
+ }): OpenRTCClient$1;
19
+ /** Native equivalent for emulator and harness lanes; never import in product code. */
20
+ declare function createTestingNativeOpenRTC(options: OpenRTCOptions, endpoints: OpenRTCV2Endpoints, bridge: PlutoIpcBridge): OpenRTCClient$1;
21
+ /**
22
+ * Rollback-harness constructor. This is intentionally confined to the
23
+ * `openrtc/testing` export because it enables plaintext loopback coordination
24
+ * for local emulators and also carries the time-bounded v1 runtime.
25
+ */
26
+ declare const createTestingLegacyOpenRTC: ((options: RuntimeClientOptions) => Promise<OpenRTCClient>) & {
27
+ native: (options: RuntimeClientOptions, bridge?: PlutoIpcBridge) => OpenRTCClient;
28
+ };
29
+
30
+ export { createTestingLegacyOpenRTC, createTestingNativeOpenRTC, createTestingOpenRTC };
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-UEYM6WTT.js';import {c}from'./chunk-PODAMIL6.js';import {a}from'./chunk-IEQTFQ3Q.js';import'./chunk-2QHDEGVX.js';import'./chunk-6TAVJ46R.js';import'./chunk-N4SX7C3W.js';import'./chunk-YQWQDTQ3.js';import'./chunk-3USHQ7QW.js';import'./chunk-F2XGNLXL.js';import'./chunk-A3IAG6EL.js';import'./chunk-7Z6N46RB.js';import'./chunk-YBXGNKM7.js';import'./chunk-VK6KX433.js';import'./chunk-NT5YHZQH.js';import'./chunk-K37WVIZL.js';import'./chunk-BXFXPIXO.js';import'./chunk-N26S7V4N.js';import'./chunk-NB4H5TP3.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';function m(e,t,n={}){return c(e,{endpoints:t,testingAllowInsecureLoopback:true,platform:"web",...n.deviceId?{deviceIdProvider:async()=>n.deviceId}:{},...n.irohTestRelayUrl?{irohTestRelayUrl:n.irohTestRelayUrl}:{},runtimeFactory:async i=>{let{createWasmClient:o}=await import('./factories-SIVMTIHJ.js');return o(i)}})}function d(e,t,n){return c(e,{endpoints:t,testingAllowInsecureLoopback:true,platform:"native",deviceKeyProvider:a$1(n),deviceIdProvider:async()=>{let i=await n.invoke("get_rtc_local_device_info");return String(i?.deviceId??"")},runtimeFactory:async i=>{let{createIpcClient:o}=await import('./ipcFactory-QY44OIKA.js');return o(i,n)}})}function p(e){let t=e.coordinationGateway;return {...e,...t?{coordinationGateway:{...t,testingAllowInsecureLoopback:true}}:{}}}var C=Object.assign(e=>a(p(e)),{native:(e,t)=>a.native(p(e),t)});export{C as createTestingLegacyOpenRTC,d as createTestingNativeOpenRTC,m as createTestingOpenRTC};
@@ -1,9 +1,6 @@
1
- import { a1 as RouteDescriptor, w as ProtocolName } from '../types-zT2QwuCv.js';
2
- export { a2 as RouteFamily, a3 as RouteImplementationKind } from '../types-zT2QwuCv.js';
3
-
4
- declare const ROUTE_DESCRIPTORS: readonly RouteDescriptor[];
5
- declare function getRouteDescriptor(id: ProtocolName): RouteDescriptor;
6
- declare function listRouteDescriptors(): readonly RouteDescriptor[];
1
+ import { P as ProtocolName, K as RouteDescriptor, O as ProtocolCapability, Q as ProtocolCapabilityMap, A as ApplicationPayloadCrypto, U as ApplicationCryptoStreamTools } from '../types-BVJr065k.js';
2
+ export { V as ApplicationCryptoBiStream, W as RouteFamily, X as RouteImplementationKind } from '../types-BVJr065k.js';
3
+ import { I as ITransport } from '../ITransport-BsPcaov7.js';
7
4
 
8
5
  declare const TRANSPORT_LABELS: readonly ProtocolName[];
9
6
  declare function normalizeTransportLabel(value: unknown): ProtocolName | undefined;
@@ -13,4 +10,47 @@ declare function isOptionalTransportLabel(value: unknown): boolean;
13
10
  declare function isWebRtcTransportLabel(value: unknown): boolean;
14
11
  declare function isIndependentTransportLabel(value: unknown): boolean;
15
12
 
16
- export { ProtocolName, ROUTE_DESCRIPTORS, RouteDescriptor, TRANSPORT_LABELS, getRouteDescriptor, isDirectIrohTransportLabel, isIndependentTransportLabel, isIrohBaseTransportLabel, isOptionalTransportLabel, isWebRtcTransportLabel, listRouteDescriptors, normalizeTransportLabel };
13
+ declare const ROUTE_DESCRIPTORS: readonly RouteDescriptor[];
14
+ declare function getRouteDescriptor(id: ProtocolName): RouteDescriptor;
15
+ declare function listRouteDescriptors(): readonly RouteDescriptor[];
16
+
17
+ declare class TransportFactory {
18
+ private static readonly capabilityMap;
19
+ /** @deprecated Only WebRTC implements the legacy ITransport construction API. */
20
+ static createTransport(name: ProtocolName): ITransport;
21
+ static getProtocolCapability(name: ProtocolName): ProtocolCapability;
22
+ static getProtocolCapabilities(): ProtocolCapabilityMap;
23
+ static getPreferredProtocolOrder(options?: {
24
+ runtime?: 'browser' | 'native' | 'any';
25
+ includePathLabels?: boolean;
26
+ }): ProtocolName[];
27
+ static assertProtocolAvailable(name: ProtocolName): void;
28
+ }
29
+ declare function getPreferredProtocolOrder(options?: Parameters<typeof TransportFactory.getPreferredProtocolOrder>[0]): ProtocolName[];
30
+
31
+ declare function isApplicationEncryptedPayload(payload: Uint8Array): boolean;
32
+ declare function createSharedSecretApplicationCrypto(key: Uint8Array, options?: {
33
+ requireEncrypted?: boolean;
34
+ randomBytes?: (byteLength: number) => Uint8Array;
35
+ replayProtection?: boolean;
36
+ }): ApplicationPayloadCrypto;
37
+ declare function createApplicationCryptoStreamTools(crypto: ApplicationPayloadCrypto, options?: {
38
+ typeId?: number;
39
+ maxFrameBytes?: number;
40
+ }): ApplicationCryptoStreamTools;
41
+
42
+ declare const KEY_AGREEMENT_PUBLIC_KEY_BYTES = 32;
43
+ declare const KEY_AGREEMENT_ALGORITHM = "openrtc:x25519-hkdf:v1";
44
+ interface ApplicationKeyAgreementPayload {
45
+ algorithm: typeof KEY_AGREEMENT_ALGORITHM;
46
+ publicKey: string;
47
+ }
48
+ interface EphemeralKeyAgreement {
49
+ publicKey: Uint8Array;
50
+ secretKey: Uint8Array;
51
+ }
52
+ declare function generateEphemeralKeyAgreement(randomBytes?: (byteLength: number) => Uint8Array): EphemeralKeyAgreement;
53
+ declare function deriveApplicationCryptoKey(localSecretKey: Uint8Array, remotePublicKey: Uint8Array, localNodeId: string, remoteNodeId: string): Uint8Array;
54
+ declare function encodeApplicationKeyAgreementPayload(publicKey: Uint8Array): ApplicationKeyAgreementPayload;
55
+
56
+ export { ApplicationCryptoStreamTools, type ApplicationKeyAgreementPayload, ApplicationPayloadCrypto, KEY_AGREEMENT_ALGORITHM, KEY_AGREEMENT_PUBLIC_KEY_BYTES, ProtocolName, ROUTE_DESCRIPTORS, RouteDescriptor, TRANSPORT_LABELS, createApplicationCryptoStreamTools, createSharedSecretApplicationCrypto, deriveApplicationCryptoKey, encodeApplicationKeyAgreementPayload, generateEphemeralKeyAgreement, getPreferredProtocolOrder, getRouteDescriptor, isApplicationEncryptedPayload, isDirectIrohTransportLabel, isIndependentTransportLabel, isIrohBaseTransportLabel, isOptionalTransportLabel, isWebRtcTransportLabel, listRouteDescriptors, normalizeTransportLabel };
@@ -1 +1 @@
1
- export{a as TRANSPORT_LABELS,d as isDirectIrohTransportLabel,h as isIndependentTransportLabel,c as isIrohBaseTransportLabel,e as isOptionalTransportLabel,f as isWebRtcTransportLabel,b as normalizeTransportLabel}from'../chunk-QT2ASNI3.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-C7YN5MSV.js';
1
+ export{e as KEY_AGREEMENT_ALGORITHM,d as KEY_AGREEMENT_PUBLIC_KEY_BYTES,g as deriveApplicationCryptoKey,i as encodeApplicationKeyAgreementPayload,f as generateEphemeralKeyAgreement,c as getPreferredProtocolOrder}from'../chunk-7Z6N46RB.js';export{e as TRANSPORT_LABELS,o as createApplicationCryptoStreamTools,n as createSharedSecretApplicationCrypto,m as isApplicationEncryptedPayload,h as isDirectIrohTransportLabel,l as isIndependentTransportLabel,g as isIrohBaseTransportLabel,i as isOptionalTransportLabel,j as isWebRtcTransportLabel,f as normalizeTransportLabel}from'../chunk-VK6KX433.js';import'../chunk-NB4H5TP3.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-C7YN5MSV.js';
@@ -17,6 +17,14 @@ interface CoordinationGatewayOptions {
17
17
  * verify the matching identity tenant and token audience.
18
18
  */
19
19
  environment: 'staging' | 'production';
20
+ /**
21
+ * Test-runtime authority for an insecure loopback gateway. The public v2
22
+ * constructor never sets this flag; `openrtc/testing` owns it for local
23
+ * emulator harnesses. Non-loopback HTTP/WS endpoints still fail closed.
24
+ *
25
+ * @internal
26
+ */
27
+ testingAllowInsecureLoopback?: boolean;
20
28
  /**
21
29
  * Opaque native trust token loader.
22
30
  *
@@ -29,6 +37,33 @@ interface CoordinationGatewayOptions {
29
37
  token: string;
30
38
  expiresAtMs: number;
31
39
  } | null | undefined>;
40
+ /**
41
+ * OpenRTC 2.0's provider-neutral grant source. This is installed by the
42
+ * public capability client, never supplied as a public endpoint or token
43
+ * hook by application code.
44
+ *
45
+ * @internal
46
+ */
47
+ grantProvider?: (input: CoordinationGatewayGrantRequest) => Promise<CoordinationGatewayGrant>;
48
+ }
49
+ interface CoordinationGatewayGrantRequest {
50
+ avenue: {
51
+ kind: 'user' | 'space' | 'room' | 'session';
52
+ id: string;
53
+ };
54
+ deviceId: string;
55
+ runtimeInstanceId: string;
56
+ ticketFingerprint: string;
57
+ purpose: 'presence' | 'device-control';
58
+ refreshGrant?: string;
59
+ }
60
+ interface CoordinationGatewayGrant {
61
+ protocolVersion: 1 | 2;
62
+ gatewayUrl: string;
63
+ routeKey: string;
64
+ token: string;
65
+ expiresAtMs: number;
66
+ avenue: CoordinationGatewayGrantRequest['avenue'];
32
67
  }
33
68
 
34
69
  interface AppLimits {
@@ -131,6 +166,8 @@ interface ChannelDescriptor {
131
166
  readiness: ChannelReadinessMode;
132
167
  promotionPolicy?: ChannelPromotionPolicy;
133
168
  signalingPolicy?: ChannelSignalingPolicy;
169
+ /** Drop queued superseded payloads while retaining reliable delivery for the newest state. */
170
+ delivery?: 'reliable' | 'latest-state';
134
171
  description?: string;
135
172
  }
136
173
  type ProtocolName = 'iroh' | 'iroh-quic' | 'iroh-relay' | 'iroh-lan' | 'ble' | 'webrtc' | 'webrtc-lan' | 'webrtc-turn' | 'moq';
@@ -182,8 +219,6 @@ interface ProtocolCapability {
182
219
  reason?: string;
183
220
  }
184
221
  type ProtocolCapabilityMap = Record<ProtocolName, ProtocolCapability>;
185
- /** Space discovery always uses namespace-scoped Firebase tokens. */
186
- type SpaceAuthMode = 'scoped-token';
187
222
  type SpaceTokenProvider = () => Promise<{
188
223
  customToken: string;
189
224
  uid?: string;
@@ -242,6 +277,11 @@ interface ClientOptions {
242
277
  * Hosted production clients receive the managed production default.
243
278
  */
244
279
  coordinationGateway?: CoordinationGatewayOptions;
280
+ /** @internal One capability maps to exactly one gateway avenue. */
281
+ coordinationAvenueOverride?: {
282
+ kind: 'user' | 'space' | 'room' | 'session';
283
+ id: string;
284
+ };
245
285
  /**
246
286
  * Supplies the provider-neutral platform-attestation token used by the
247
287
  * configured coordination control plane.
@@ -1040,4 +1080,4 @@ interface JoinRequest {
1040
1080
  state: 'pending' | 'accepted' | 'rejected';
1041
1081
  }
1042
1082
 
1043
- export type { ProtocolImplementationKind as $, AuthMode as A, BackendPeerBiStream as B, ConnectDeviceResult as C, DiscoveryMode as D, ExplicitFileDataSendParams as E, ManagedDeviceConnectOptions as F, GrantScope as G, PeerState as H, ISignalingBackend as I, PeerHealth as J, JoinRoomOptions as K, LocalDeviceInfo as L, ManagedConnectionRecord as M, NativeManagedSessionStartResult as N, PeerScope as O, PeerSessionSnapshot as P, DevicePresenceStatus as Q, ResolvedPeerIdentity as R, SpaceAuthMode as S, TransportLatencySnapshot as T, PeerLifecycleStatus as U, ProtocolCapability as V, ProtocolCapabilityMap as W, ApplicationCryptoStreamTools as X, AppLimits as Y, ApplicationCryptoBiStream as Z, ProtocolBaseName as _, SpaceTokenProvider as a, ProtocolLocality as a0, RouteDescriptor as a1, RouteFamily as a2, RouteImplementationKind as a3, SignalingOptions as a4, RoomCreationMode as a5, ScanningLoopOptions as a6, ScanningLoopHandle as a7, RuntimeBootstrapOptions as a8, RuntimeBootstrapResult as a9, ManagedApplicationRouteOptions as aa, JoinRequest as ab, ConnectDeviceHooks as b, ConnectDeviceOptions as c, SignalingMode as d, ClientOptions as e, RuntimeIdentity as f, RoomMember as g, Device as h, DeviceStatusSnapshot as i, SignalingEnvelope as j, DeviceEvent as k, DesiredPeerProjection as l, SignalingSession as m, SessionEvent as n, BackendPeerUniStream as o, NativeConnectParams as p, NativeConnectResult as q, BackendConnectionState as r, ConnectionOptions as s, ApplicationPayloadCrypto as t, ApplicationPayloadReadinessOptions as u, ApplicationPayloadRouteOptions as v, ProtocolName as w, ApplicationPayloadSendOptions as x, ChannelDescriptor as y, IncomingStreamChannelMetadata as z };
1083
+ export type { AppLimits as $, ApplicationPayloadCrypto as A, BackendConnectionState as B, ConnectionOptions as C, Device as D, ExplicitFileDataSendParams as E, SessionEvent as F, NativeManagedSessionStartResult as G, GrantScope as H, IncomingStreamChannelMetadata as I, JoinRoomOptions as J, RouteDescriptor as K, LocalDeviceInfo as L, ManagedDeviceConnectOptions as M, NativeConnectParams as N, ProtocolCapability as O, ProtocolName as P, ProtocolCapabilityMap as Q, RuntimeIdentity as R, SignalingSession as S, TransportLatencySnapshot as T, ApplicationCryptoStreamTools as U, ApplicationCryptoBiStream as V, RouteFamily as W, RouteImplementationKind as X, ConnectDeviceHooks as Y, ConnectDeviceOptions as Z, ConnectDeviceResult as _, ApplicationPayloadReadinessOptions as a, SignalingOptions as a0, RoomCreationMode as a1, ScanningLoopOptions as a2, ScanningLoopHandle as a3, RuntimeBootstrapOptions as a4, RuntimeBootstrapResult as a5, ManagedApplicationRouteOptions as a6, JoinRequest as a7, SpaceTokenProvider as a8, ApplicationPayloadRouteOptions as b, ApplicationPayloadSendOptions as c, PeerState as d, PeerScope as e, PeerHealth as f, ChannelDescriptor as g, DeviceStatusSnapshot as h, ClientOptions as i, RoomMember as j, DevicePresenceStatus as k, PeerLifecycleStatus as l, PeerSessionSnapshot as m, DiscoveryMode as n, AuthMode as o, SignalingMode as p, ISignalingBackend as q, SignalingEnvelope as r, BackendPeerBiStream as s, BackendPeerUniStream as t, ManagedConnectionRecord as u, ResolvedPeerIdentity as v, DeviceEvent as w, DesiredPeerProjection as x, CoreClientBridgeHost as y, NativeConnectResult as z };
@@ -0,0 +1,195 @@
1
+ import { O as OpenRTCPeerNamespace, a as OpenRTCChannelNamespace, b as OpenRTCDiagnosticsNamespace, c as OpenRTCDeviceNamespace } from './OpenRTCShared-ZQPu5LqL.js';
2
+ import { R as RuntimeChannelDescriptor } from './types-DkgaCyqS.js';
3
+
4
+ interface OpenRTCAuthProvider {
5
+ /** Registered provider ID from the developer app capability manifest. */
6
+ readonly providerId?: string;
7
+ getAssertion(input: {
8
+ audience: 'https://api.openrtc.app/v2/assertions/exchange';
9
+ forceRefresh: boolean;
10
+ }): Promise<string | null>;
11
+ /**
12
+ * Optional identity-epoch observer. Notify only when the signed-in
13
+ * principal/session changes (login, logout, account switch, or explicit
14
+ * revocation). Do not notify for ordinary OAuth/Firebase access-token
15
+ * refreshes: OpenRTC refreshes its own avenue grant in place.
16
+ */
17
+ subscribe?(listener: () => void): () => void;
18
+ }
19
+ interface OpenRTCAttestationProvider {
20
+ readonly kind: 'firebase-app-check' | 'apple-app-attest' | 'play-integrity' | `custom:${string}`;
21
+ /**
22
+ * Describes what the provider actually signs. Reusable app-integrity
23
+ * tokens (for example Firebase App Check) do not become request-bound just
24
+ * because OpenRTC supplies an enrollment challenge. The server derives and
25
+ * enforces the authoritative binding from the registered provider kind;
26
+ * this field keeps host integrations and diagnostics honest.
27
+ */
28
+ readonly evidenceBinding: 'app-session' | 'request-challenge';
29
+ getEvidence(input: {
30
+ challenge: string;
31
+ apiKey: string;
32
+ }): Promise<{
33
+ token: string;
34
+ }>;
35
+ }
36
+ /**
37
+ * Optional consumer-owned bot challenge. Core OpenRTC does not render a UI or
38
+ * load a CAPTCHA dependency; the host supplies a fresh token only when its
39
+ * developer manifest requires anonymous capability verification.
40
+ */
41
+ interface OpenRTCBotVerificationProvider {
42
+ getToken(input: {
43
+ action: 'openrtc_capability';
44
+ apiKey: string;
45
+ }): Promise<string>;
46
+ }
47
+ interface OpenRTCUsageUpdate {
48
+ sessionCreditsUsd: number;
49
+ operation: string;
50
+ estimated: boolean;
51
+ }
52
+ interface OpenRTCUsageWarning extends OpenRTCUsageUpdate {
53
+ thresholdCreditsUsd: number;
54
+ kind: 'warning' | 'session-limit';
55
+ }
56
+ interface OpenRTCTransportPreferences {
57
+ iroh?: boolean;
58
+ webrtc?: boolean;
59
+ relay?: boolean;
60
+ moq?: boolean;
61
+ ble?: boolean;
62
+ /**
63
+ * Advanced privacy mode. `relay-only` suppresses direct Iroh addresses,
64
+ * local discovery, and host/srflx WebRTC candidates. It also requires the
65
+ * developer manifest's relay opt-in.
66
+ */
67
+ privacy?: 'direct' | 'relay-only';
68
+ /**
69
+ * Advanced native integration for hosts whose Rust process owns the
70
+ * application protocol registry (for example, a Tauri file-transfer host).
71
+ * Normal SDK consumers should leave this disabled.
72
+ */
73
+ nativeHostProtocols?: boolean;
74
+ priority?: readonly ('iroh' | 'webrtc' | 'moq' | 'ble')[];
75
+ }
76
+ interface OpenRTCOptions {
77
+ apiKey: string;
78
+ auth?: OpenRTCAuthProvider;
79
+ trust?: {
80
+ attestation?: OpenRTCAttestationProvider;
81
+ botVerification?: OpenRTCBotVerificationProvider;
82
+ };
83
+ usage?: {
84
+ warnAtSessionCreditsUsd?: number;
85
+ maxSessionCreditsUsd?: number;
86
+ onUsage?: (event: OpenRTCUsageUpdate) => void;
87
+ onWarning?: (warning: OpenRTCUsageWarning) => void;
88
+ };
89
+ transports?: OpenRTCTransportPreferences;
90
+ }
91
+ type OpenRTCAccessMode = 'capability' | 'authenticated';
92
+ type OpenRTCLatestStateMode = 'reliable' | 'latest-state';
93
+ interface OpenRTCCapabilityHandle {
94
+ readonly kind: 'devices' | 'space' | 'room' | 'ticket';
95
+ readonly id: string;
96
+ readonly peers: OpenRTCPeerNamespace;
97
+ readonly channels: OpenRTCChannelNamespace;
98
+ readonly diagnostics: OpenRTCDiagnosticsNamespace;
99
+ readonly closed: boolean;
100
+ close(): Promise<void>;
101
+ }
102
+ interface OpenRTCDevicesHandle extends OpenRTCCapabilityHandle {
103
+ readonly kind: 'devices';
104
+ localId(): ReturnType<OpenRTCDeviceNamespace['localId']>;
105
+ localInfo(): ReturnType<OpenRTCDeviceNamespace['localInfo']>;
106
+ list(): ReturnType<OpenRTCDeviceNamespace['list']>;
107
+ listWithStatus(): ReturnType<OpenRTCDeviceNamespace['listWithStatus']>;
108
+ watch: OpenRTCDeviceNamespace['watch'];
109
+ connect: OpenRTCDeviceNamespace['connect'];
110
+ disconnect: OpenRTCDeviceNamespace['disconnect'];
111
+ }
112
+ interface OpenRTCSpaceHandle extends OpenRTCCapabilityHandle {
113
+ readonly kind: 'space';
114
+ readonly delivery: OpenRTCLatestStateMode;
115
+ leave(): Promise<void>;
116
+ }
117
+ interface OpenRTCRoomHandle extends OpenRTCCapabilityHandle {
118
+ readonly kind: 'room';
119
+ readonly membership: 'ephemeral' | 'durable';
120
+ leave(): Promise<void>;
121
+ }
122
+ interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
123
+ readonly kind: 'ticket';
124
+ readonly token: string;
125
+ }
126
+ interface OpenRTCDevicesStartOptions {
127
+ auth?: OpenRTCAuthProvider;
128
+ autoConnect?: 'none' | 'online';
129
+ /** Optional local profile; it does not alter the durable device identity. */
130
+ profile?: {
131
+ name?: string;
132
+ /**
133
+ * Optional application-owned public presence metadata. It is bounded
134
+ * to 4 KiB and folded into the initial connection/presence operation.
135
+ */
136
+ metadata?: string;
137
+ };
138
+ maxPeers?: number;
139
+ /** Requires the app manifest's advanced-fanout opt-in. */
140
+ advancedFanout?: boolean;
141
+ }
142
+ interface OpenRTCSpaceJoinOptions {
143
+ access?: 'capability';
144
+ identity?: 'ephemeral';
145
+ payload?: OpenRTCLatestStateMode;
146
+ maxPeers?: number;
147
+ /** Requires the app manifest's advanced-fanout opt-in. */
148
+ advancedFanout?: boolean;
149
+ }
150
+ interface OpenRTCRoomJoinOptions {
151
+ access?: OpenRTCAccessMode;
152
+ membership?: 'ephemeral' | 'durable';
153
+ auth?: OpenRTCAuthProvider;
154
+ maxPeers?: number;
155
+ /** Requires the app manifest's advanced-fanout opt-in. */
156
+ advancedFanout?: boolean;
157
+ }
158
+ interface OpenRTCTicketIssueOptions {
159
+ maxPeers?: number;
160
+ /** Requires the app manifest's advanced-fanout opt-in. */
161
+ advancedFanout?: boolean;
162
+ }
163
+ interface OpenRTCChannelCatalog {
164
+ register(descriptor: RuntimeChannelDescriptor): () => void;
165
+ list(): readonly RuntimeChannelDescriptor[];
166
+ }
167
+ interface OpenRTCUsageNamespace {
168
+ estimate(input: {
169
+ operation: string;
170
+ units?: number;
171
+ }): {
172
+ creditsUsd: number;
173
+ estimated: true;
174
+ };
175
+ readonly sessionCreditsUsd: number;
176
+ }
177
+ interface OpenRTCClient {
178
+ readonly devices: {
179
+ start(options?: OpenRTCDevicesStartOptions): Promise<OpenRTCDevicesHandle>;
180
+ };
181
+ readonly spaces: {
182
+ join(id: string, options?: OpenRTCSpaceJoinOptions): Promise<OpenRTCSpaceHandle>;
183
+ };
184
+ readonly rooms: {
185
+ join(id: string, options?: OpenRTCRoomJoinOptions): Promise<OpenRTCRoomHandle>;
186
+ };
187
+ readonly tickets: {
188
+ issue(id: string, options?: OpenRTCTicketIssueOptions): Promise<OpenRTCTicketHandle>;
189
+ };
190
+ readonly channels: OpenRTCChannelCatalog;
191
+ readonly usage: OpenRTCUsageNamespace;
192
+ close(): Promise<void>;
193
+ }
194
+
195
+ export type { OpenRTCOptions as O, OpenRTCClient as a, OpenRTCAccessMode as b, OpenRTCAttestationProvider as c, OpenRTCAuthProvider as d, OpenRTCBotVerificationProvider as e, OpenRTCCapabilityHandle as f, OpenRTCChannelCatalog as g, OpenRTCDevicesHandle as h, OpenRTCDevicesStartOptions as i, OpenRTCLatestStateMode as j, OpenRTCRoomHandle as k, OpenRTCRoomJoinOptions as l, OpenRTCSpaceHandle as m, OpenRTCSpaceJoinOptions as n, OpenRTCTicketHandle as o, OpenRTCTicketIssueOptions as p, OpenRTCTransportPreferences as q, OpenRTCUsageNamespace as r, OpenRTCUsageUpdate as s, OpenRTCUsageWarning as t };