openrtc 2.4.0 → 2.5.2

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 (85) hide show
  1. package/README.md +97 -5
  2. package/dist/BrowserManagedBroadcastHost-ARCP5MGJ.js +1 -0
  3. package/dist/{Connection-DZ5eP5hL.d.ts → Connection-CTpuImO-.d.ts} +168 -4
  4. package/dist/{DelegatingRuntimeAdapter-4cgiIWMN.d.ts → DelegatingRuntimeAdapter-D67Ozqo3.d.ts} +7 -3
  5. package/dist/{IpcRuntimeAdapter-Dduaxscj.d.ts → IpcRuntimeAdapter-Ddx0MtSI.d.ts} +8 -2
  6. package/dist/NativeManagedBroadcastHost-WCQ6TPUU.js +1 -0
  7. package/dist/WasmBridge-LWMCETW4.js +1 -0
  8. package/dist/{assembly-By3UBQsE.d.ts → assembly-LOFcpH3S.d.ts} +9 -3
  9. package/dist/{capabilities-B2mHv_H7.d.ts → capabilities-CmzzxSvW.d.ts} +13 -2
  10. package/dist/chunk-6Q2LAXM4.js +1 -0
  11. package/dist/chunk-AAZPQQXX.js +2 -0
  12. package/dist/chunk-AYHD4X2R.js +1 -0
  13. package/dist/chunk-BFN3AVHA.js +2 -0
  14. package/dist/chunk-BGWJHPBC.js +2 -0
  15. package/dist/chunk-CCCYE3XN.js +1 -0
  16. package/dist/chunk-CNAW5BZ3.js +2 -0
  17. package/dist/chunk-DUY34MGT.js +1 -0
  18. package/dist/{chunk-5XOLKH66.js → chunk-EFTDXE6M.js} +1 -1
  19. package/dist/chunk-FB5M6GIW.js +2 -0
  20. package/dist/chunk-J7NBMQQA.js +2 -0
  21. package/dist/chunk-LLZT3MR6.js +118 -0
  22. package/dist/chunk-N6LGTNUI.js +1 -0
  23. package/dist/{chunk-4MLJXEVV.js → chunk-NDR2ANQB.js} +1 -1
  24. package/dist/chunk-PLIWPC45.js +1 -0
  25. package/dist/chunk-TZLNKQNJ.js +1 -0
  26. package/dist/chunk-VFDCIEP6.js +2 -0
  27. package/dist/{chunk-P2SHJMS3.js → chunk-VTYVIKTM.js} +1 -1
  28. package/dist/chunk-XTYALGJN.js +2 -0
  29. package/dist/{controlPlane-7E6KGQPP.js → controlPlane-IIPEJ77Q.js} +1 -1
  30. package/dist/coreClient.d.ts +3 -3
  31. package/dist/coreClient.js +1 -1
  32. package/dist/{deviceEnrollment-CBJYXZ43.js → deviceEnrollment-ZQZ2WP5H.js} +1 -1
  33. package/dist/{deviceKey-Y35WSEQQ.js → deviceKey-EIMDBAQS.js} +1 -1
  34. package/dist/index.d.ts +6 -5
  35. package/dist/index.js +1 -1
  36. package/dist/ipcFactory-PDVLUG2W.js +1 -0
  37. package/dist/native.d.ts +5 -5
  38. package/dist/native.js +1 -1
  39. package/dist/node-browser.d.ts +8 -0
  40. package/dist/node-browser.js +1 -0
  41. package/dist/node.d.ts +91 -0
  42. package/dist/node.js +2 -0
  43. package/dist/openrtc-SQF7H4ZE.js +2 -0
  44. package/dist/openrtc_bg.wasm +0 -0
  45. package/dist/room-A2FMQRNZ.js +1 -0
  46. package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -3
  47. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  48. package/dist/runtime/device-status.d.ts +1 -1
  49. package/dist/runtime/factories.d.ts +75 -6
  50. package/dist/runtime/factories.js +1 -1
  51. package/dist/runtime/index.d.ts +11 -10
  52. package/dist/runtime/index.js +1 -1
  53. package/dist/server-browser.d.ts +14 -0
  54. package/dist/server-browser.js +1 -0
  55. package/dist/server.d.ts +44 -0
  56. package/dist/server.js +2 -0
  57. package/dist/service-node.d.ts +156 -0
  58. package/dist/service-node.js +1 -0
  59. package/dist/testing/native.d.ts +4 -4
  60. package/dist/testing/native.js +1 -1
  61. package/dist/testing.d.ts +40 -5
  62. package/dist/testing.js +1 -1
  63. package/dist/transport/index.d.ts +2 -2
  64. package/dist/{types-BArEthJr.d.ts → types-Cyc-mPjk.d.ts} +189 -2
  65. package/native/darwin-arm64/openrtc-node-host +0 -0
  66. package/native/darwin-arm64/openrtc-node-host.manifest.json +20 -0
  67. package/native/darwin-x64/openrtc-node-host +0 -0
  68. package/native/darwin-x64/openrtc-node-host.manifest.json +20 -0
  69. package/native/linux-x64/openrtc-node-host +0 -0
  70. package/native/linux-x64/openrtc-node-host.manifest.json +20 -0
  71. package/native/openrtc-node-host-signing-public.pem +3 -0
  72. package/package.json +28 -4
  73. package/dist/WasmBridge-3W2HHADU.js +0 -1
  74. package/dist/chunk-2LATKLCC.js +0 -118
  75. package/dist/chunk-6OFAKLDB.js +0 -2
  76. package/dist/chunk-AJQVMVYW.js +0 -1
  77. package/dist/chunk-BCGCJGIV.js +0 -2
  78. package/dist/chunk-BOS554IK.js +0 -2
  79. package/dist/chunk-GNW63SM6.js +0 -2
  80. package/dist/chunk-MI3ZMVPK.js +0 -2
  81. package/dist/chunk-WB66633N.js +0 -1
  82. package/dist/chunk-XEHBTMJQ.js +0 -1
  83. package/dist/chunk-YYI6AY6W.js +0 -2
  84. package/dist/ipcFactory-4PCGKZIN.js +0 -1
  85. package/dist/openrtc-5HAYVDHT.js +0 -2
@@ -1,8 +1,8 @@
1
- import { c as RuntimeFactoryOptions, b as PlutoRuntimeAssembly } from '../assembly-By3UBQsE.js';
2
- import { N as NativeProjectionBroker, I as IpcRuntimeAdapter } from '../IpcRuntimeAdapter-Dduaxscj.js';
3
- import { Q as Device, K as ISignalingBackend, z as DiscoveryMode, B as AuthMode, E as SignalingMode, F as ClientOptions, H as ExplicitFileDataSendParams, ad as BrowserWasmRuntimeModule, _ as LocalDeviceInfo, O as RoomMember, ae as BrowserProtocolStore, af as NamespaceDescriptor, ag as IrohMutationReceipt, ah as IrohDocEntry, N as RuntimeIdentity, V as SignalingEnvelope, T as DeviceStatusSnapshot, g as PeerSessionSnapshot, a0 as BackendPeerBiStream, a1 as BackendPeerUniStream, a2 as PortableMediaPublish, a3 as PortableMediaPublicationStart, a4 as PortableMediaSample, a5 as PortableMediaChunk, a6 as PortableMediaControl, U as ManagedConnectionRecord, j as ResolvedPeerIdentity, W as DeviceEvent, X as DesiredPeerProjection, ai as CoreClientBridgeHost, a7 as NativeConnectParams, a8 as NativeConnectResult, Y as SignalingSession, Z as SessionEvent, a9 as BackendConnectionState } from '../Connection-DZ5eP5hL.js';
4
- import { R as RuntimeCapabilities } from '../capabilities-B2mHv_H7.js';
5
- import { R as RuntimeBridgeOptions } from '../DelegatingRuntimeAdapter-4cgiIWMN.js';
1
+ import { c as RuntimeFactoryOptions, b as PlutoRuntimeAssembly } from '../assembly-LOFcpH3S.js';
2
+ import { N as NativeProjectionBroker, I as IpcRuntimeAdapter } from '../IpcRuntimeAdapter-Ddx0MtSI.js';
3
+ import { X as Device, U as ISignalingBackend, K as DiscoveryMode, N as AuthMode, O as SignalingMode, Q as ClientOptions, T as ExplicitFileDataSendParams, ai as BrowserWasmRuntimeModule, a3 as LocalDeviceInfo, W as RoomMember, aj as BrowserProtocolStore, ak as NamespaceDescriptor, al as IrohMutationReceipt, am as IrohDocEntry, V as RuntimeIdentity, _ as SignalingEnvelope, Y as DeviceStatusSnapshot, k as PeerSessionSnapshot, a5 as BackendPeerBiStream, a6 as BackendPeerUniStream, a7 as PortableMediaPublish, a8 as PortableMediaPublicationStart, a9 as PortableMediaSample, aa as PortableMediaChunk, ab as PortableMediaControl, Z as ManagedConnectionRecord, n as ResolvedPeerIdentity, b as RoomArchitectureSnapshot, c as RoomAuthorityAssignment, an as CoordinationSignalingStore, ao as ManagedRoomMessage, $ as DeviceEvent, a0 as DesiredPeerProjection, ap as CoreClientBridgeHost, ac as NativeConnectParams, ad as NativeConnectResult, a1 as SignalingSession, a2 as SessionEvent, ae as BackendConnectionState } from '../Connection-CTpuImO-.js';
4
+ import { R as RuntimeCapabilities } from '../capabilities-CmzzxSvW.js';
5
+ import { R as RuntimeBridgeOptions } from '../DelegatingRuntimeAdapter-D67Ozqo3.js';
6
6
  import { P as PlutoIpcBridge } from '../ipc-DgzKqHH3.js';
7
7
 
8
8
  interface NativeTrustToken {
@@ -16,6 +16,44 @@ type RawDeviceDoc = Device & {
16
16
  tag?: string;
17
17
  };
18
18
 
19
+ /** Public verification material plus an opaque Rust/WASM signer handle. */
20
+ interface WasmPublisherSignerDescriptor {
21
+ handle: string;
22
+ publicKey: Uint8Array;
23
+ }
24
+ interface ResolvedWasmBroadcastGrant {
25
+ token: string;
26
+ issuerPublicKey: Uint8Array;
27
+ signBindingChallenge(message: Uint8Array): Promise<Uint8Array>;
28
+ }
29
+ interface BrowserBroadcastWasmBindings {
30
+ __createOpenRtcBroadcastPublisherSigner(): WasmPublisherSignerDescriptor;
31
+ __prepareOpenRtcBroadcastGrant(token: string, issuerPublicKey: Uint8Array, nowMs: number): {
32
+ handle: string;
33
+ signingBytes: Uint8Array;
34
+ expiresAtMs: number;
35
+ };
36
+ __openOpenRtcBroadcast(token: string, issuerPublicKey: Uint8Array, bindingChallengeHandle: string, bindingSignature: Uint8Array, publisherSignerHandle: string | undefined, nowMs: number): unknown;
37
+ __releaseOpenRtcBroadcastPublisherSigner(handle: string): boolean;
38
+ }
39
+ /**
40
+ * Private browser publisher boundary used by the managed broadcast host.
41
+ *
42
+ * Rust/WASM owns the signing key. JavaScript receives only a public key and an
43
+ * opaque handle, has no sign operation, and cannot export private key bytes.
44
+ * The shared Rust core canonicalizes and verifies every signed media group.
45
+ */
46
+ declare class BrowserBroadcastWasmPublisher {
47
+ private readonly wasm;
48
+ readonly verificationKey: Uint8Array;
49
+ private handle;
50
+ private constructor();
51
+ static create(wasm: BrowserBroadcastWasmBindings): BrowserBroadcastWasmPublisher;
52
+ /** Open a publisher grant previously bound to `verificationKey`. */
53
+ open(grant: ResolvedWasmBroadcastGrant, nowMs?: number): Promise<unknown>;
54
+ close(): void;
55
+ }
56
+
19
57
  type WasmBridgeOptions = RuntimeBridgeOptions;
20
58
  /**
21
59
  * WasmBridge is the browser host wrapper over the Rust/WASM runtime.
@@ -58,6 +96,10 @@ declare class WasmBridge implements ISignalingBackend {
58
96
  coordinationGateway?: ClientOptions['coordinationGateway'];
59
97
  coordinationAvenueOverride?: ClientOptions['coordinationAvenueOverride'];
60
98
  coordinationRoomGossipFanout?: ClientOptions['coordinationRoomGossipFanout'];
99
+ coordinationRoomArchitecture?: ClientOptions['coordinationRoomArchitecture'];
100
+ coordinationDevicePublicKeyX?: ClientOptions['coordinationDevicePublicKeyX'];
101
+ coordinationDeviceSign?: ClientOptions['coordinationDeviceSign'];
102
+ initialAutoConnectExcludedDeviceIds?: ClientOptions['initialAutoConnectExcludedDeviceIds'];
61
103
  attestationTokenProvider?: ClientOptions['attestationTokenProvider'];
62
104
  coordinationPlatformType?: string;
63
105
  storagePrefix?: string;
@@ -85,6 +127,7 @@ declare class WasmBridge implements ISignalingBackend {
85
127
  private readonly coordinationHost;
86
128
  /** Test seam only; production gateway ownership remains in coordinationHost. */
87
129
  private browserCoordinationSignaling;
130
+ private effectiveRoomArchitecture;
88
131
  private lastObservedFirebaseUserId;
89
132
  private sessionReaders;
90
133
  protected authContext: {
@@ -171,6 +214,8 @@ declare class WasmBridge implements ISignalingBackend {
171
214
  userId?: string | null;
172
215
  }): Promise<void>;
173
216
  setWasmClient(client: any): void;
217
+ /** Private managed-broadcast edge. Rust/WASM retains the private signer. */
218
+ createBroadcastPublisher(): Promise<BrowserBroadcastWasmPublisher>;
174
219
  initializePersistentIrohProtocols(store: BrowserProtocolStore): Promise<void>;
175
220
  createPersistentIrohNamespace(generation: number, shareRevision: number): Promise<NamespaceDescriptor>;
176
221
  importPersistentIrohTicket(ticket: string, generation: number, shareRevision: number): Promise<string>;
@@ -193,6 +238,19 @@ declare class WasmBridge implements ISignalingBackend {
193
238
  protected normalizeDevice(raw: Record<string, any>, fallbackId?: string): Device;
194
239
  normalizeDeviceRecord(raw: Record<string, any>, fallbackId?: string): Device;
195
240
  getResolvedWebLogicalDeviceId(): string;
241
+ encodeSparseFanoutMessage(capability: string, payload: Uint8Array): Promise<Uint8Array>;
242
+ acceptSparseFanoutMessage(capability: string, sourcePeerId: string, payload: Uint8Array): Promise<{
243
+ payload: Uint8Array;
244
+ authorDeviceId: string;
245
+ authorPeerId: string;
246
+ topologyRevision: number;
247
+ hop: number;
248
+ forwardPeerIds: string[];
249
+ forwardPeerLimit: number;
250
+ forwardQueueCapacity: number;
251
+ forward?: Uint8Array;
252
+ }>;
253
+ recordSparseFanoutForwardQueueDrop(capability: string, count: number): Promise<void>;
196
254
  private normalizeDeviceStatusSnapshot;
197
255
  private normalizePeerSessionSnapshot;
198
256
  private toBackendConnectionStateFromPeerSession;
@@ -245,6 +303,17 @@ declare class WasmBridge implements ISignalingBackend {
245
303
  resolvePeerRecords(id: string): Promise<ManagedConnectionRecord[]>;
246
304
  resolvePeerIdentity(id: string): Promise<ResolvedPeerIdentity>;
247
305
  onDevicesChange(callback: (devices: Device[]) => void, excludeNodeId?: string): () => void;
306
+ onRoomArchitectureChange(callback: (snapshot: RoomArchitectureSnapshot) => void): () => void;
307
+ onRoomAuthorityAssignmentChange(callback: (assignment: RoomAuthorityAssignment | null) => void): () => void;
308
+ publishAuthorityAssignment(input: Parameters<NonNullable<CoordinationSignalingStore['publishAuthorityAssignment']>>[0]): Promise<void>;
309
+ publishManagedRoomMessage(input: {
310
+ messageId: string;
311
+ channel: string;
312
+ priority: 0 | 1 | 2 | 3;
313
+ zoneId?: string;
314
+ payload: Uint8Array;
315
+ }): Promise<void>;
316
+ onManagedRoomMessage(callback: (message: ManagedRoomMessage) => void): () => void;
248
317
  subscribeDevices(userId: string): Promise<ReadableStream<DeviceEvent[]>>;
249
318
  startAutoConnect(userId: string, localDeviceId: string): Promise<void>;
250
319
  startAutoConnectOnce(userId: string, localDeviceId: string): Promise<void>;
@@ -259,7 +328,7 @@ declare class WasmBridge implements ISignalingBackend {
259
328
  private escalateManagedApplicationRoute;
260
329
  connectToDevice(params: NativeConnectParams): Promise<NativeConnectResult>;
261
330
  forceReconnect(): void;
262
- startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): void;
331
+ startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): Promise<void>;
263
332
  private ensureSpaceNamespaceIdPromise;
264
333
  createSession(session: SignalingSession): Promise<void>;
265
334
  updateSession(sessionId: string, updateData: any): Promise<void>;
@@ -1 +1 @@
1
- import {a as a$2}from'../chunk-5XOLKH66.js';import {a}from'../chunk-P2SHJMS3.js';import {s}from'../chunk-6OFAKLDB.js';import'../chunk-XEHBTMJQ.js';import'../chunk-GNW63SM6.js';import'../chunk-TYZS5LXQ.js';import'../chunk-OT7IPLZE.js';import'../chunk-AJQVMVYW.js';import'../chunk-72NEEJQG.js';import'../chunk-WB66633N.js';import'../chunk-JPBW67B3.js';import {a as a$1}from'../chunk-MI3ZMVPK.js';import'../chunk-OWKAJPOI.js';import'../chunk-2GX6GB6L.js';async function l(e){let t=a$1(e),{WasmBridge:o}=await import('../WasmBridge-3W2HHADU.js');return a$2(t,new o(t))}function y(e,t,o=new a){let m=a$1(e);return a$2(m,new s({...m,bridge:t,projectionBroker:o}))}export{y as createIpcClient,l as createWasmClient};
1
+ import {a as a$2}from'../chunk-EFTDXE6M.js';import {s}from'../chunk-FB5M6GIW.js';import'../chunk-BGWJHPBC.js';import'../chunk-6Q2LAXM4.js';import'../chunk-AAZPQQXX.js';import {a as a$1}from'../chunk-XTYALGJN.js';import'../chunk-TYZS5LXQ.js';import'../chunk-OT7IPLZE.js';import'../chunk-OWKAJPOI.js';import {a}from'../chunk-VTYVIKTM.js';import'../chunk-72NEEJQG.js';import'../chunk-CNAW5BZ3.js';import'../chunk-DUY34MGT.js';import'../chunk-CCCYE3XN.js';import'../chunk-N6LGTNUI.js';import'../chunk-JPBW67B3.js';import'../chunk-2GX6GB6L.js';async function l(e){let t=a$1(e),{WasmBridge:o}=await import('../WasmBridge-LWMCETW4.js');return a$2(t,new o(t))}function y(e,t,o=new a){let m=a$1(e);return a$2(m,new s({...m,bridge:t,projectionBroker:o}))}export{y as createIpcClient,l as createWasmClient};
@@ -1,15 +1,15 @@
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';
1
+ import { a as PeerReconciliationStats } from '../assembly-LOFcpH3S.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-LOFcpH3S.js';
3
3
  import { Client as Client$1 } from '../coreClient.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';
4
+ import { c as Avenue } from '../types-Cyc-mPjk.js';
5
+ import { aB as SignalingOptions, U as ISignalingBackend, V as RuntimeIdentity, W as RoomMember, _ as SignalingEnvelope, a1 as SignalingSession, X as Device, a0 as DesiredPeerProjection, ae as BackendConnectionState, ay as AppLimits, G as GrantScope, j as Connection, aC as JoinRoomOptions, aD as ChannelMetadata, as as CryptoStreams, aE as RoomCreationMode, Q as ClientOptions, ar as PayloadCrypto, K as DiscoveryMode, aF as ProtocolCapabilityMap, aG as ScanningLoopOptions, aH as ScanningLoopHandle, aI as RuntimeBootstrapOptions, aJ as RuntimeBootstrapResult, aK as ApplicationPayloadReadinessOptions, aL as ManagedApplicationRouteOptions, aM as PeerState, aN as PeerScope, aO as PeerHealth, aP as ChannelDescriptor, aQ as JoinRequest, ac as NativeConnectParams, ad as NativeConnectResult, az as ConnectionTarget, A as RawConnection } from '../Connection-CTpuImO-.js';
6
+ export { aR as AutoConnectPolicy, aj as BrowserProtocolStore, C as ChannelDescriptor, aS as ChannelFraming, t as ConnectionEvent, r as ConnectionState, aT as ConnectionStatus, v as DeviceConnectOptions, aU as DevicePresence, z as DeviceProfile, D as DeviceStatus, I as IncomingStream, am as IrohDocEntry, al as IrohMutationReceipt, J as JoinRoomOptions, L as LocalDeviceInfo, M as ManagedOptions, u as ManagedSession, ak as NamespaceDescriptor, aV as PayloadRouteOptions, i as PeerConnectOptions, aW as PeerLifecycleStatus, l as PeerReadiness, aX as PeerSessionSnapshot, o as PeerStreamOptions, aa as PortableMediaChunk, ab as PortableMediaControl, a8 as PortableMediaPublicationStart, a7 as PortableMediaPublish, a9 as PortableMediaSample, aA as PresenceLoopOptions, aY as PresencePolicy, s as ReadinessOptions, aZ as RuntimeAuthContext, aw as RuntimeAuthIdentity, H as RuntimeClientOptions, p as RuntimeDevice, m as RuntimePeerHealth, a_ as RuntimePeerScope, h as RuntimePeerState, B as RuntimeRoomMember, ax as RuntimeSession, S as ScopedChannelOptions, q as ScopedLogicalChannel, a$ as SessionKind, b0 as SessionPlatform } from '../Connection-CTpuImO-.js';
7
+ import { R as RuntimeCapabilities } from '../capabilities-CmzzxSvW.js';
8
+ export { B as BROWSER_CAPABILITIES, a as CapabilityHost, b as CapabilityMaturity, C as CapabilityProfile, N as NATIVE_CAPABILITIES, c as NativeRuntimeStatus, P as ProductCapabilityMaturity, d as RuntimeAdapterKind, T as TransportStatus, e as browserCapabilities, f as capabilityProfile, g as cloneCapabilities, s as statusCapabilities } from '../capabilities-CmzzxSvW.js';
9
9
  export { DeviceActiveOptions, isDeviceActive, isDeviceConnectable, isDeviceRoutable } from './device-status.js';
10
- export { a as IpcAdapterOptions, I as IpcRuntimeAdapter } from '../IpcRuntimeAdapter-Dduaxscj.js';
10
+ export { a as IpcAdapterOptions, I as IpcRuntimeAdapter } from '../IpcRuntimeAdapter-Ddx0MtSI.js';
11
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';
12
+ import '../DelegatingRuntimeAdapter-D67Ozqo3.js';
13
13
 
14
14
  declare class Signaling {
15
15
  private readonly appTag;
@@ -52,7 +52,7 @@ declare class Signaling {
52
52
  startAutoConnect(userId: string, localDeviceId: string): void;
53
53
  submitDesiredPeerProjection(revision: number, peers: DesiredPeerProjection[]): Promise<void>;
54
54
  notifyDisconnectRequested(remoteNodeId: string): void;
55
- startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): void;
55
+ startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): Promise<void>;
56
56
  forceReconnect(): void;
57
57
  isConnected(nodeId: string): Promise<boolean>;
58
58
  getConnectionStates(): Promise<BackendConnectionState[]>;
@@ -120,6 +120,7 @@ type IncomingStreamEvent = {
120
120
  protocolHint?: ProtocolHint;
121
121
  channel?: ChannelMetadata | null;
122
122
  applicationAuthorized?: boolean;
123
+ admissionCandidate?: boolean;
123
124
  applicationCrypto?: CryptoStreams;
124
125
  invalid?: boolean;
125
126
  };
@@ -1 +1 @@
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';
1
+ 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-FB5M6GIW.js';import'../chunk-BGWJHPBC.js';import'../chunk-6Q2LAXM4.js';export{q as BROWSER_CAPABILITIES,r as NATIVE_CAPABILITIES,o as RUNTIME_POLICY,t as browserCapabilities,v as capabilityProfile,s as cloneCapabilities,p as getRuntimePolicy,h as logTeardownTrace,d as openRtcDebug,c as openRtcDebugEnabled,e as openRtcDebugInfo,f as openRtcDebugLog,u as statusCapabilities}from'../chunk-AAZPQQXX.js';import'../chunk-XTYALGJN.js';import'../chunk-TYZS5LXQ.js';import'../chunk-OT7IPLZE.js';import'../chunk-OWKAJPOI.js';export{a as classifyIpcFailure,b as isIpcUnavailable}from'../chunk-72NEEJQG.js';import'../chunk-CNAW5BZ3.js';export{c as runtimeFromCapability}from'../chunk-TZLNKQNJ.js';import'../chunk-ZA44REGI.js';import'../chunk-LLZT3MR6.js';import'../chunk-DUY34MGT.js';import'../chunk-CCCYE3XN.js';import'../chunk-N6LGTNUI.js';import'../chunk-JPBW67B3.js';import'../chunk-2GX6GB6L.js';
@@ -0,0 +1,14 @@
1
+ export { AuthorityAssignmentInput, AuthorityInterestAssignment, AuthorityServiceGrant, AuthorityServiceGrantRequest, Ed25519Signer } from './service-node.js';
2
+ import './types-Cyc-mPjk.js';
3
+ import './coreClient.js';
4
+ import './assembly-LOFcpH3S.js';
5
+ import './Connection-CTpuImO-.js';
6
+ import './capabilities-CmzzxSvW.js';
7
+
8
+ /** Browser export for `openrtc/server`; secret-bearing helpers are unavailable. */
9
+
10
+ declare class AuthorityServiceControlPlane {
11
+ constructor();
12
+ }
13
+
14
+ export { AuthorityServiceControlPlane };
@@ -0,0 +1 @@
1
+ var e=class{constructor(){throw new Error("[OpenRTC] openrtc/server is unavailable in browsers; request a delegated grant from your backend.")}};export{e as AuthorityServiceControlPlane};
@@ -0,0 +1,44 @@
1
+ import { Ed25519Signer, AuthorityServiceGrantRequest, AuthorityServiceGrant, AuthorityAssignmentInput, AuthorityInterestAssignment, DelegatedAuthorityGrantRequest } from './service-node.js';
2
+ import './types-Cyc-mPjk.js';
3
+ import './coreClient.js';
4
+ import './assembly-LOFcpH3S.js';
5
+ import './Connection-CTpuImO-.js';
6
+ import './capabilities-CmzzxSvW.js';
7
+
8
+ /** Secret-bearing Node/server helpers. Do not import this entrypoint in browsers. */
9
+
10
+ interface AuthorityServiceOptions {
11
+ apiKey: string;
12
+ secretKey: string;
13
+ serviceId: string;
14
+ generation: number;
15
+ shardIds: string[];
16
+ deviceId: string;
17
+ deviceSigner: Ed25519Signer;
18
+ assignmentSigner: Ed25519Signer;
19
+ endpoint?: string;
20
+ fetch?: typeof globalThis.fetch;
21
+ }
22
+ /** Direct secret-backed grant issuer for a trusted Node/server process. */
23
+ declare class AuthorityServiceControlPlane {
24
+ private readonly authority;
25
+ constructor(options: AuthorityServiceOptions);
26
+ requestGrant(input: AuthorityServiceGrantRequest): Promise<AuthorityServiceGrant>;
27
+ signAssignment(input: AuthorityAssignmentInput): Promise<{
28
+ assignment: AuthorityInterestAssignment;
29
+ signature: string;
30
+ }>;
31
+ devicePublicKey(): Promise<{
32
+ kty: "OKP";
33
+ crv: "Ed25519";
34
+ x: string;
35
+ }>;
36
+ signDeviceBytes(payload: Uint8Array): Promise<string>;
37
+ /**
38
+ * Adapt this trusted issuer to `openrtc/service-node` in Node. Browser
39
+ * applications must call their own authenticated backend instead.
40
+ */
41
+ grantIssuer(): (request: DelegatedAuthorityGrantRequest) => Promise<AuthorityServiceGrant>;
42
+ }
43
+
44
+ export { AuthorityAssignmentInput, AuthorityInterestAssignment, AuthorityServiceControlPlane, AuthorityServiceGrant, AuthorityServiceGrantRequest, type AuthorityServiceOptions, Ed25519Signer };
package/dist/server.js ADDED
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-J7NBMQQA.js';import'./chunk-TZLNKQNJ.js';import'./chunk-ZA44REGI.js';import'./chunk-LLZT3MR6.js';import'./chunk-DUY34MGT.js';import'./chunk-CCCYE3XN.js';import'./chunk-N6LGTNUI.js';import'./chunk-JPBW67B3.js';import'./chunk-2GX6GB6L.js';function y(n){let e=new URL(n??"https://api.openrtc.app"),t=e.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(e.hostname.toLowerCase());if(e.protocol!=="https:"&&!t||e.username||e.password||e.search||e.hash)throw new TypeError("[OpenRTC] authority control-plane endpoint is invalid.");return e.toString().replace(/\/$/,"")}function h(){if(typeof document<"u"||typeof window<"u")throw new Error("[OpenRTC] openrtc/server is unavailable in browsers; use openrtc/service-node with a delegated grant.")}var c=class{constructor(e){h();let t=e.secretKey?.trim()??"";if(!/^sk_(?:live|test)_[A-Za-z0-9_-]+$/.test(t))throw new TypeError("[OpenRTC] secretKey is invalid.");let i=e.fetch??globalThis.fetch;if(typeof i!="function")throw new TypeError("[OpenRTC] a Fetch-compatible implementation is required.");let u=y(e.endpoint);this.authority=new a({apiKey:e.apiKey,serviceId:e.serviceId,generation:e.generation,shardIds:e.shardIds,deviceId:e.deviceId,deviceSigner:e.deviceSigner,assignmentSigner:e.assignmentSigner,grantIssuer:async s=>{let r=await i(`${u}/v2/developer/authority/grants`,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json","x-openrtc-idempotency-key":s.idempotencyKey},body:JSON.stringify(s.body)});if(!r.ok){let o=await r.json().catch(()=>null),d=typeof o?.error=="string"?o.error.slice(0,256):`HTTP ${r.status}`;throw new Error(`[OpenRTC] authority service grant failed: ${d}`)}return r.json()}});}requestGrant(e){return this.authority.requestGrant(e)}signAssignment(e){return this.authority.signAssignment(e)}devicePublicKey(){return this.authority.devicePublicKey()}signDeviceBytes(e){return this.authority.signDeviceBytes(e)}grantIssuer(){return async e=>{let t=e.body;return this.requestGrant({roomId:String(t.avenue?.id??""),runtimeInstanceId:String(t.runtimeInstanceId??""),ticketFingerprint:String(t.ticketFingerprint??""),maxPeers:typeof t.maxPeers=="number"?t.maxPeers:void 0,refreshGrant:typeof t.refreshGrant=="string"?t.refreshGrant:void 0,features:typeof t.features=="object"&&t.features?t.features:void 0})}}};
2
+ export{c as AuthorityServiceControlPlane};
@@ -0,0 +1,156 @@
1
+ import { C as Client, X as Room, r as Connection } from './types-Cyc-mPjk.js';
2
+ import './coreClient.js';
3
+ import './assembly-LOFcpH3S.js';
4
+ import './Connection-CTpuImO-.js';
5
+ import './capabilities-CmzzxSvW.js';
6
+
7
+ /** Browser-safe and Node-host-neutral developer service-node facade. */
8
+
9
+ interface Ed25519Signer {
10
+ publicJwk(): JsonWebKey | Promise<JsonWebKey>;
11
+ sign(payload: Uint8Array): Uint8Array | Promise<Uint8Array>;
12
+ }
13
+ interface AuthorityServiceOptions {
14
+ apiKey: string;
15
+ /**
16
+ * App-backend delegation. Browser code must call a trusted developer
17
+ * backend here; it must never close over or embed an `sk_*` secret.
18
+ */
19
+ grantIssuer: AuthorityGrantIssuer;
20
+ serviceId: string;
21
+ generation: number;
22
+ shardIds: string[];
23
+ deviceId: string;
24
+ deviceSigner: Ed25519Signer;
25
+ assignmentSigner: Ed25519Signer;
26
+ }
27
+ interface DelegatedAuthorityGrantRequest {
28
+ apiKey: string;
29
+ idempotencyKey: string;
30
+ body: Record<string, unknown>;
31
+ }
32
+ type AuthorityGrantIssuer = (request: DelegatedAuthorityGrantRequest) => Promise<unknown>;
33
+ interface AuthorityServiceGrantRequest {
34
+ roomId: string;
35
+ runtimeInstanceId: string;
36
+ ticketFingerprint: string;
37
+ /** Total room members, including services; 1..50, limited further by app policy. */
38
+ maxPeers?: number;
39
+ refreshGrant?: string;
40
+ features?: Partial<{
41
+ irohRelay: boolean;
42
+ managedTurn: boolean;
43
+ moq: boolean;
44
+ ble: boolean;
45
+ }>;
46
+ }
47
+ interface AuthorityServiceGrant {
48
+ protocolVersion: 2;
49
+ gatewayUrl: string;
50
+ routeKey: string;
51
+ token: string;
52
+ expiresAtMs: number;
53
+ avenue: {
54
+ kind: 'room';
55
+ id: string;
56
+ };
57
+ maxPeers: number;
58
+ architecture: 'authority';
59
+ roomAuthority: {
60
+ serviceId: string;
61
+ generation: number;
62
+ shardIds: string[];
63
+ assignmentPublicKeyJwk: {
64
+ kty: 'OKP';
65
+ crv: 'Ed25519';
66
+ x: string;
67
+ };
68
+ };
69
+ }
70
+ interface AuthorityInterestAssignment {
71
+ policyVersion: 'room-authority-assignment-v1';
72
+ serviceId: string;
73
+ generation: number;
74
+ revision: number;
75
+ subjectDeviceId: string;
76
+ shardId: string;
77
+ priorityDeviceIds: string[];
78
+ relevantEntityIds: string[];
79
+ issuedAtMs: number;
80
+ expiresAtMs: number;
81
+ }
82
+ interface AuthorityAssignmentInput {
83
+ revision: number;
84
+ subjectDeviceId: string;
85
+ shardId: string;
86
+ priorityDeviceIds?: string[];
87
+ relevantEntityIds?: string[];
88
+ ttlMs?: number;
89
+ }
90
+ interface ServiceNodeOptions extends AuthorityServiceOptions {
91
+ /** Browser uses WASM with delegated grants; `openrtc/node` uses the bundled Rust host. */
92
+ client: Client;
93
+ maxPeers?: number;
94
+ irohRelay?: boolean;
95
+ }
96
+ interface ServiceNodeConnectionEvent {
97
+ room: ServiceNodeRoom;
98
+ connection: Connection;
99
+ }
100
+ interface ServiceNodeRoom extends Room {
101
+ publishAssignment(input: AuthorityAssignmentInput): Promise<AuthorityInterestAssignment>;
102
+ }
103
+ /**
104
+ * Data-only server boundary for service grant issuance and signed AOI input.
105
+ * It does not own sockets, retries, topology, or transport selection.
106
+ */
107
+ declare class DelegatedAuthorityService {
108
+ private readonly apiKey;
109
+ private readonly applicationTag;
110
+ private readonly grantIssuer;
111
+ private readonly serviceId;
112
+ private readonly generation;
113
+ private readonly shardIds;
114
+ private readonly deviceId;
115
+ private readonly deviceSigner;
116
+ private readonly assignmentSigner;
117
+ constructor(options: AuthorityServiceOptions);
118
+ requestGrant(input: AuthorityServiceGrantRequest): Promise<AuthorityServiceGrant>;
119
+ devicePublicKey(): Promise<{
120
+ kty: 'OKP';
121
+ crv: 'Ed25519';
122
+ x: string;
123
+ }>;
124
+ assignmentPublicKey(): Promise<{
125
+ kty: 'OKP';
126
+ crv: 'Ed25519';
127
+ x: string;
128
+ }>;
129
+ signDeviceBytes(payload: Uint8Array): Promise<string>;
130
+ signAssignment(input: AuthorityAssignmentInput): Promise<{
131
+ assignment: AuthorityInterestAssignment;
132
+ signature: string;
133
+ }>;
134
+ }
135
+ /**
136
+ * Familiar application server facade. It handles application events only;
137
+ * OpenRTC's Rust/WASM owner still controls admission, dialing, retry, routes,
138
+ * and carrier switching.
139
+ */
140
+ declare class ServiceNode {
141
+ private readonly options;
142
+ private readonly authority;
143
+ private readonly rooms;
144
+ private readonly connectionListeners;
145
+ private readonly connectionCleanups;
146
+ private closed;
147
+ constructor(options: ServiceNodeOptions);
148
+ listen(roomId: string): Promise<ServiceNodeRoom>;
149
+ onConnection(listener: (event: ServiceNodeConnectionEvent) => void): () => void;
150
+ close(): Promise<void>;
151
+ private openRoom;
152
+ private evictRoom;
153
+ private attachConnectionListener;
154
+ }
155
+
156
+ export { type AuthorityAssignmentInput, type AuthorityGrantIssuer, type AuthorityInterestAssignment, type AuthorityServiceGrant, type AuthorityServiceGrantRequest, type AuthorityServiceOptions, type DelegatedAuthorityGrantRequest, DelegatedAuthorityService, type Ed25519Signer, ServiceNode, type ServiceNodeConnectionEvent, type ServiceNodeOptions, type ServiceNodeRoom };
@@ -0,0 +1 @@
1
+ export{a as DelegatedAuthorityService,b as ServiceNode}from'./chunk-J7NBMQQA.js';import'./chunk-TZLNKQNJ.js';import'./chunk-ZA44REGI.js';import'./chunk-LLZT3MR6.js';import'./chunk-DUY34MGT.js';import'./chunk-CCCYE3XN.js';import'./chunk-N6LGTNUI.js';import'./chunk-JPBW67B3.js';import'./chunk-2GX6GB6L.js';
@@ -1,10 +1,10 @@
1
- import { O as Options, C as Client } from '../types-BArEthJr.js';
1
+ import { O as Options, C as Client } from '../types-Cyc-mPjk.js';
2
2
  import { E as Endpoints } from '../protocol-BSBjMb7p.js';
3
3
  import { P as PlutoIpcBridge } from '../ipc-DgzKqHH3.js';
4
4
  import '../coreClient.js';
5
- import '../assembly-By3UBQsE.js';
6
- import '../Connection-DZ5eP5hL.js';
7
- import '../capabilities-B2mHv_H7.js';
5
+ import '../assembly-LOFcpH3S.js';
6
+ import '../Connection-CTpuImO-.js';
7
+ import '../capabilities-CmzzxSvW.js';
8
8
 
9
9
  declare function OpenRTC(options: Options, endpoints: Endpoints, bridge: PlutoIpcBridge): Client;
10
10
 
@@ -1 +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};
1
+ import {a as a$1}from'../chunk-VFDCIEP6.js';import {a}from'../chunk-VTYVIKTM.js';import'../chunk-NDR2ANQB.js';import {i}from'../chunk-TZLNKQNJ.js';import'../chunk-ZA44REGI.js';import'../chunk-LLZT3MR6.js';import'../chunk-DUY34MGT.js';import'../chunk-CCCYE3XN.js';import'../chunk-N6LGTNUI.js';import'../chunk-JPBW67B3.js';import'../chunk-2GX6GB6L.js';function v(c,p,e){let o=new a;return i(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-PDVLUG2W.js');return a(t,e,o)}})}export{v as OpenRTC};
package/dist/testing.d.ts CHANGED
@@ -1,9 +1,9 @@
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';
1
+ import { R as RoomArchitectureMode, ag as CoordinationGatewayGrantRequest, ah as CoordinationGatewayGrant } from './Connection-CTpuImO-.js';
2
+ import { a as AttestationProvider, b as AuthProvider, B as BotVerificationProvider, e as BroadcastGrant, d as BroadcastCreateOptions, f as BroadcastInvite, g as BroadcastInviteOptions, D as Delivery, t as DeviceProfile, O as Options, C as Client } from './types-Cyc-mPjk.js';
3
3
  import { E as Endpoints } from './protocol-BSBjMb7p.js';
4
4
  import './coreClient.js';
5
- import './assembly-By3UBQsE.js';
6
- import './capabilities-B2mHv_H7.js';
5
+ import './assembly-LOFcpH3S.js';
6
+ import './capabilities-CmzzxSvW.js';
7
7
 
8
8
  interface DeviceProof {
9
9
  publicKeyJwk: JsonWebKey;
@@ -14,6 +14,8 @@ interface DeviceProof {
14
14
  interface DeviceKey {
15
15
  readonly publicKeyJwk: JsonWebKey;
16
16
  readonly thumbprint: string;
17
+ /** Signs Rust-canonical protocol bytes without exporting private key material. */
18
+ sign(message: Uint8Array): Promise<string>;
17
19
  proof(challenge: (nonce: string, issuedAt: number) => string): Promise<DeviceProof>;
18
20
  }
19
21
  interface DeviceKeyProvider {
@@ -80,8 +82,37 @@ declare class ControlPlane {
80
82
  private authEpoch;
81
83
  dispose(): void;
82
84
  private key;
85
+ /** Public half of the existing platform-issued device signer. */
86
+ deviceSigningPublicKey(): Promise<JsonWebKey>;
87
+ signDeviceBytes(message: Uint8Array): Promise<string>;
88
+ /**
89
+ * Resolve one opaque grant into a private provider allocation. The public
90
+ * grant is only a signed, device-bound authorization; relay credentials
91
+ * are returned solely to the private broadcast mechanics host.
92
+ */
93
+ resolveBroadcastAccess(grant: string, publicationVerifyingKey?: Uint8Array): Promise<{
94
+ token: string;
95
+ issuerPublicKey: Uint8Array;
96
+ signBindingChallenge(message: Uint8Array): Promise<Uint8Array>;
97
+ relay: {
98
+ relayUrl: string;
99
+ token: string;
100
+ namespace: string;
101
+ };
102
+ }>;
103
+ /** Authenticated owner operations. The server performs the atomic hard
104
+ * reservation before minting a grant or allocating provider capacity. */
105
+ manageBroadcast(input: {
106
+ action: 'create' | 'invite' | 'accept' | 'renew' | 'revoke' | 'leave' | 'close';
107
+ deviceId: string;
108
+ auth: AuthProvider;
109
+ grant?: BroadcastGrant;
110
+ create?: BroadcastCreateOptions;
111
+ invite?: BroadcastInvite;
112
+ invitation?: BroadcastInviteOptions;
113
+ }): Promise<BroadcastGrant | BroadcastInvite | undefined>;
83
114
  private post;
84
- capability(kind: 'space' | 'room' | 'ticket', id: string, maxPeers?: number, advancedFanout?: boolean): Promise<CredentialSource>;
115
+ capability(kind: 'space' | 'room' | 'ticket', id: string, maxPeers?: number, advancedFanout?: boolean, architecture?: RoomArchitectureMode, roomDelivery?: Delivery): Promise<CredentialSource>;
85
116
  deviceCertificate(auth: AuthProvider, deviceId: string, avenue?: CoordinationGatewayGrantRequest['avenue'], profile?: DeviceProfile, rejected?: AuthenticatedDeviceCertificate): Promise<{
86
117
  source: CredentialSource;
87
118
  principalId: string;
@@ -106,6 +137,8 @@ declare class ControlPlane {
106
137
  grantProvider(source: CredentialSource, input?: {
107
138
  maxPeers?: number;
108
139
  features?: Record<string, boolean>;
140
+ architecture?: RoomArchitectureMode;
141
+ roomDelivery?: Delivery;
109
142
  deviceProfile?: Pick<DeviceProfile, 'name' | 'platform'>;
110
143
  /**
111
144
  * Keeps the transport/admission credential relay synchronized
@@ -128,6 +161,8 @@ declare function controlPlane(apiKey: string, endpoints: Endpoints, keyNamespace
128
161
  declare function OpenRTC(options: Options, endpoints: Endpoints, testing?: {
129
162
  deviceId?: string;
130
163
  irohTestRelayUrl?: string;
164
+ /** Local expiry fixture only; affects the first ticket before publication. */
165
+ initialTicketLifetimeMs?: 90_000;
131
166
  }): Client;
132
167
 
133
168
  export { OpenRTC, controlPlane };
package/dist/testing.js CHANGED
@@ -1 +1 @@
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
+ import {a}from'./chunk-BFN3AVHA.js';import {a as a$1,d,c}from'./chunk-CNAW5BZ3.js';import {c as c$1}from'./chunk-NDR2ANQB.js';import {i}from'./chunk-TZLNKQNJ.js';import'./chunk-ZA44REGI.js';import'./chunk-LLZT3MR6.js';import'./chunk-DUY34MGT.js';import'./chunk-CCCYE3XN.js';import'./chunk-N6LGTNUI.js';import'./chunk-JPBW67B3.js';import'./chunk-2GX6GB6L.js';function v(o){let t=e=>`${e}:${o}`;return {getOrCreate:e=>c$1.getOrCreate(t(e)),delete:async e=>{await c$1.delete?.(t(e));},readSecureRecord:(e,i)=>c$1.readSecureRecord?.(t(e),i)??Promise.resolve(null),writeSecureRecord:(e,i,c)=>c$1.writeSecureRecord?.(t(e),i,c)??Promise.resolve(),deleteSecureRecord:(e,i)=>c$1.deleteSecureRecord?.(t(e),i)??Promise.resolve()}}function b(o,t,e){return new a(o,t,v(e))}function g(o,t,e={}){if(e.initialTicketLifetimeMs!==void 0){let i=(c,s)=>{let r=new URL(c);return r.protocol===s&&["127.0.0.1","[::1]"].includes(r.hostname)&&Number(r.port)>0&&r.pathname==="/"&&!r.username&&!r.password&&!r.search&&!r.hash};if(e.initialTicketLifetimeMs!==9e4||o.apiKey!=="pk_test_0000000000000000000000000000000000000000"||!i(t.controlPlane,"http:")||!i(t.gateway,"http:")||!e.irohTestRelayUrl||!i(e.irohTestRelayUrl,"https:"))throw new Error("Short initial tickets require the disposable local service lane")}return i(o,{endpoints:t,testingAllowInsecureLoopback:true,platform:"web",...e.deviceId?{deviceIdProvider:async()=>e.deviceId}:{},...e.irohTestRelayUrl?{irohTestRelayUrl:e.irohTestRelayUrl}:{},runtimeFactory:async i=>{let{createWasmClient:c$1}=await import('./runtime/factories.js'),s=await c$1(i);if(e.initialTicketLifetimeMs!==void 0){let r=s.runtime,p=r.getTicketWithToken.bind(r);r.getTicketWithToken=async(l,d$1=0)=>{if(r.getTicketWithToken=p,!l.startsWith("v2:room:"))throw new Error("Short initial ticket requires room scope");let{irohTicket:u,tokenSuffix:m}=a$1(await p(l,d$1)),n=m&&d(u,m);if(!n||!n.t||n.s!==l||n.m!==d$1)throw new Error("Invalid initial service ticket");let h=Date.now()+9e4;return await r.registerToken({token:n.t,scope:l,maxConnections:d$1,expiresAtMs:h}),c(u,n.t,l,d$1,h)};}return s}})}export{g as OpenRTC,b as controlPlane};
@@ -1,5 +1,5 @@
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';
1
+ import { g as ProtocolName, aq as RouteDescriptor, ar as PayloadCrypto, as as CryptoStreams } from '../Connection-CTpuImO-.js';
2
+ export { at as CryptoBiStream, au as RouteFamily, av as RouteKind } from '../Connection-CTpuImO-.js';
3
3
 
4
4
  declare const TRANSPORT_LABELS: readonly ProtocolName[];
5
5
  declare function normalizeTransport(value: unknown): ProtocolName | undefined;