openrtc 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +11 -8
  2. package/dist/{DelegatingRuntimeAdapter-BFZDC604.d.ts → DelegatingRuntimeAdapter-BkLR3TNN.d.ts} +33 -31
  3. package/dist/{ITransport-WV6gGMnX.d.ts → ITransport-yaruAmx3.d.ts} +50 -86
  4. package/dist/{IpcRuntimeAdapter-CJq3dRBF.d.ts → IpcRuntimeAdapter-DDKeQ6UC.d.ts} +6 -6
  5. package/dist/WasmBridge-DVQ2YPRB.js +1 -0
  6. package/dist/{assembly-q0jRRpsc.d.ts → assembly-BTzwQuwI.d.ts} +67 -74
  7. package/dist/{capabilities-BfZi4Cd7.d.ts → capabilities-BwzPe51I.d.ts} +19 -19
  8. package/dist/chunk-4N6UDVZR.js +1 -0
  9. package/dist/chunk-AJQVMVYW.js +1 -0
  10. package/dist/{chunk-VBUDERMM.js → chunk-BYOPTGET.js} +1 -1
  11. package/dist/chunk-DI5VSZ2T.js +2 -0
  12. package/dist/chunk-EDUGFJHN.js +2 -0
  13. package/dist/chunk-F4BJ72HN.js +1 -0
  14. package/dist/{chunk-LRT5GEGH.js → chunk-FKEKINIM.js} +2 -2
  15. package/dist/chunk-GND6UW37.js +1 -0
  16. package/dist/{chunk-Z2WVSXPW.js → chunk-HUG5AX7R.js} +1 -1
  17. package/dist/chunk-LN4ALFT6.js +1 -0
  18. package/dist/chunk-NXM5ZGHD.js +2 -0
  19. package/dist/chunk-OUFHVLDQ.js +2 -0
  20. package/dist/chunk-SUWCBTBQ.js +1 -0
  21. package/dist/chunk-UGZJJQPM.js +3 -0
  22. package/dist/chunk-ZA44REGI.js +2 -0
  23. package/dist/controlPlane-JJFURVOX.js +1 -0
  24. package/dist/{OpenRTCShared.d.ts → coreClient.d.ts} +61 -66
  25. package/dist/coreClient.js +1 -0
  26. package/dist/deviceEnrollment-Z2EHP2EX.js +2 -0
  27. package/dist/{deviceKey-SBNKLVYF.js → deviceKey-C6UE7QDV.js} +1 -1
  28. package/dist/deviceProfile-CR2C7OYR.js +2 -0
  29. package/dist/index.d.ts +30 -30
  30. package/dist/index.js +1 -1
  31. package/dist/{ipc-CflAVodw.d.ts → ipc-CPnNwv6f.d.ts} +3 -3
  32. package/dist/ipcFactory-DQFK65VE.js +1 -0
  33. package/dist/openrtc-DFZOQJ7V.js +2 -0
  34. package/dist/openrtc_bg.wasm +0 -0
  35. package/dist/runtime/WasmRuntimeAdapter.d.ts +4 -4
  36. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  37. package/dist/runtime/device-status.d.ts +10 -10
  38. package/dist/runtime/device-status.js +1 -1
  39. package/dist/runtime/factories.d.ts +8 -8
  40. package/dist/runtime/factories.js +1 -1
  41. package/dist/runtime/index.d.ts +50 -50
  42. package/dist/runtime/index.js +1 -1
  43. package/dist/testing.d.ts +126 -13
  44. package/dist/testing.js +1 -1
  45. package/dist/transport/index.d.ts +24 -24
  46. package/dist/transport/index.js +1 -1
  47. package/dist/{types-DVNSd5B9.d.ts → types-D67HlF0p.d.ts} +58 -102
  48. package/dist/{types-Di034GVQ.d.ts → types-DCdYg7za.d.ts} +74 -72
  49. package/package.json +4 -14
  50. package/dist/OpenRTCShared.js +0 -1
  51. package/dist/WasmBridge-5GYKXPXK.js +0 -1
  52. package/dist/chunk-45WBH7E3.js +0 -1
  53. package/dist/chunk-7FPG3MFF.js +0 -2
  54. package/dist/chunk-AG2F6MOB.js +0 -1
  55. package/dist/chunk-CWGKLGJZ.js +0 -1
  56. package/dist/chunk-D2OJN5S5.js +0 -1
  57. package/dist/chunk-H5R5ZXXN.js +0 -3
  58. package/dist/chunk-KJTJLLJE.js +0 -2
  59. package/dist/chunk-OEVPKC3W.js +0 -1
  60. package/dist/chunk-VOCOZ57Q.js +0 -2
  61. package/dist/chunk-XPL7PUBW.js +0 -2
  62. package/dist/chunk-Z6TZLF4B.js +0 -1
  63. package/dist/controlPlane-P66ZTVNW.js +0 -2
  64. package/dist/deviceEnrollment-GL4JPVGG.js +0 -2
  65. package/dist/deviceProfile-3BEQZLJF.js +0 -2
  66. package/dist/ipcFactory-B6HBECSU.js +0 -1
  67. package/dist/native.d.ts +0 -15
  68. package/dist/native.js +0 -1
  69. package/dist/openrtc-BFF336RG.js +0 -2
  70. /package/dist/{deviceManagement-PHY5TIOS.js → deviceManagement-SUMBRXXC.js} +0 -0
  71. /package/dist/{deviceRoster-VZA3TQOR.js → deviceRoster-EUF6BBF5.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { v as ConnectionOptions, w as ApplicationPayloadCrypto, x as ApplicationPayloadReadinessOptions, y as ApplicationPayloadRouteOptions, c as ProtocolName, z as ApplicationPayloadSendOptions, F as ITransport, H as TransportLatencySnapshot, J as PeerState, K as PeerScope, O as PeerHealth, Q as ChannelDescriptor$1, U as IncomingStreamChannelMetadata, D as Device, t as BackendConnectionState, L as LocalDeviceInfo, l as DeviceStatusSnapshot, V as ManagedDeviceConnectOptions, g as ClientOptions, r as SignalingSession, j as RuntimeIdentity, W as JoinRoomOptions, i as RoomMember, X as DevicePresenceStatus, Y as PeerLifecycleStatus, d as PeerSessionSnapshot } from './ITransport-WV6gGMnX.js';
1
+ import { y as ConnectionOptions, z as PayloadCrypto, F as ApplicationPayloadReadinessOptions, H as ApplicationPayloadRouteOptions, c as ProtocolName, J as ApplicationPayloadSendOptions, K as ITransport, O as LatencySnapshot, Q as PeerState, T as PeerScope, U as PeerHealth, V as ChannelDescriptor$1, W as ChannelMetadata, D as Device, w as BackendConnectionState, L as LocalDeviceInfo$1, o as DeviceStatusSnapshot, X as ManagedDeviceConnectOptions, h as ClientOptions, u as SignalingSession, m as RuntimeIdentity, Y as JoinRoomOptions$1, l as RoomMember, Z as DevicePresenceStatus, _ as PeerLifecycleStatus$1, d as PeerSessionSnapshot$1 } from './ITransport-yaruAmx3.js';
2
2
 
3
3
  type ConnectionHealth = 'unknown' | 'healthy' | 'suspect' | 'stale';
4
4
 
@@ -86,13 +86,12 @@ declare class Connection {
86
86
  private webRtcDisconnectedGraceTimer;
87
87
  private preferredWebRtcRole;
88
88
  constructor(id: string, localNodeId: string, remoteNodeId: string, writer: WritableStreamDefaultWriter<Uint8Array>, reader: ReadableStreamDefaultReader<Uint8Array>, options?: ConnectionOptions);
89
- setApplicationCrypto(applicationCrypto: ApplicationPayloadCrypto | undefined): void;
90
- markApplicationKeyAgreementObserved(): number;
91
- getApplicationKeyAgreementObservationEpoch(): number;
89
+ setApplicationCrypto(applicationCrypto: PayloadCrypto | undefined): void;
90
+ getKeyAgreementEpoch(): number;
92
91
  requireApplicationCrypto(): void;
93
92
  isApplicationCryptoRequired(): boolean;
94
- isReadyForApplicationPayload(options?: ApplicationPayloadReadinessOptions): boolean;
95
- getApplicationPayloadTransports(options?: ApplicationPayloadRouteOptions): ProtocolName[];
93
+ isPayloadReady(options?: ApplicationPayloadReadinessOptions): boolean;
94
+ payloadTransports(options?: ApplicationPayloadRouteOptions): ProtocolName[];
96
95
  private isTransportAvailableForApplicationPayload;
97
96
  private resolveApplicationCryptoWaiters;
98
97
  private rejectApplicationCryptoWaiters;
@@ -102,17 +101,6 @@ declare class Connection {
102
101
  * No-op when WebRTC is not configured or an upgrade already started.
103
102
  */
104
103
  requestWebRTCUpgrade(reason?: string): void;
105
- /**
106
- * Records that the current native base transport has completed session
107
- * admission and can now accept optional-route signaling.
108
- *
109
- * A replacement Iroh transport is projected before its token exchange has
110
- * necessarily completed. If a WebRTC attempt starts during that interval,
111
- * its renegotiate/SDP frames are intentionally rejected. Admission is the
112
- * authoritative event that makes one fresh attempt safe. The generation
113
- * fence prevents duplicate token approvals from creating a retry storm.
114
- */
115
- handleNativeSessionAdmissionAvailable(reason?: string): void;
116
104
  /**
117
105
  * Whether the current WebRTC route is provably alive: an open data channel
118
106
  * plus either a recent heartbeat round trip or a freshly opened channel. An
@@ -141,15 +129,6 @@ declare class Connection {
141
129
  }): void;
142
130
  private beginWebRtcRecovery;
143
131
  getUpgradeState(): UpgradeState;
144
- /**
145
- * Generation fence for asynchronous native-main signaling.
146
- *
147
- * WebRTC callbacks and control-stream opens can complete after their
148
- * transport has been replaced. A late SDP/candidate/renegotiate frame from
149
- * that retired generation must not be allowed to replace the current
150
- * negotiation on the peer.
151
- */
152
- isCurrentWebRtcNegotiationSignal(envelope: any): boolean;
153
132
  updateRTCConfig(rtcConfig: ConnectionOptions['rtcConfig']): void;
154
133
  onUpgradeStateChange(callback: (state: UpgradeState) => void): void;
155
134
  /**
@@ -204,7 +183,7 @@ declare class Connection {
204
183
  */
205
184
  sendOnTransport(transport: ProtocolName, message: string | object | ArrayBuffer | Uint8Array): Promise<void>;
206
185
  /** Last transport that accepted an application payload from this connection. */
207
- getLastApplicationPayloadTransport(): ProtocolName | null;
186
+ lastPayloadTransport(): ProtocolName | null;
208
187
  /**
209
188
  * Send plaintext control traffic that is required to bootstrap application
210
189
  * key agreement. This is intentionally separate from public app-data sends.
@@ -338,7 +317,7 @@ declare class Connection {
338
317
  parallelTransport: ProtocolName | null;
339
318
  };
340
319
  /** Passive RTT samples owned by the active transport heartbeats. */
341
- getTransportLatencySnapshot(): TransportLatencySnapshot;
320
+ getLatencySnapshot(): LatencySnapshot;
342
321
  private resolveParallelTransport;
343
322
  setNativeSignalSender(sender: (envelope: any) => Promise<void>): void;
344
323
  /**
@@ -356,14 +335,6 @@ declare class Connection {
356
335
  * accidentally routes control through the native sender.
357
336
  */
358
337
  sendNativeControlEnvelope(envelope: any): Promise<boolean>;
359
- /**
360
- * Promote a connection to the native-main control plane: switch its
361
- * control-frame mode to `native-main` and attach the native signal sender.
362
- * Used when native-main evidence arrives for a connection that bootstrapped
363
- * on a typed stream, so subsequent control traffic flows over the durable
364
- * native-main route even if the bootstrap stream later closes.
365
- */
366
- promoteToNativeMainControlRoute(sender: (envelope: any) => Promise<void>): void;
367
338
  private hasRequiredApplicationCrypto;
368
339
  private clearWebRtcApplicationRouteReady;
369
340
  private isCurrentWebRtcTransportApplicationRouteReady;
@@ -418,7 +389,7 @@ type AuthContext = {
418
389
  /**
419
390
  * App-facing options intentionally hide transport node identifiers from callbacks.
420
391
  */
421
- type RuntimeClientOptions = Omit<ClientOptions, 'onDevices' | 'onAutoConnect' | 'onIncomingSession'> & {
392
+ type RuntimeClientOptions = Omit<ClientOptions, 'onDevices' | 'onAutoConnect' | 'onIncomingSession' | 'coordinationAvenueOverride' | 'coordinationRoomGossipFanout' | 'coordinationPlatformType'> & {
422
393
  onDevices?: (devices: RuntimeDevice[]) => void;
423
394
  onAutoConnect?: (devices: RuntimeDevice[]) => void;
424
395
  onIncomingSession?: (session: RuntimeSession) => Promise<void>;
@@ -438,18 +409,18 @@ type RuntimeAuthContext = AuthContext;
438
409
  */
439
410
  type RuntimePeerState = Omit<PeerState, 'nodeId'>;
440
411
  type RuntimePeerHealth = PeerHealth;
441
- type RuntimePeerLifecycleStatus = PeerLifecycleStatus;
412
+ type PeerLifecycleStatus = PeerLifecycleStatus$1;
442
413
  type RuntimePeerScope = PeerScope;
443
414
  /**
444
415
  * App-facing peer session snapshot model. Runtime transport identifiers stay internal.
445
416
  */
446
- type RuntimePeerSessionSnapshot = Omit<PeerSessionSnapshot, 'nodeId'>;
447
- type RuntimeLocalDeviceInfo = LocalDeviceInfo;
417
+ type PeerSessionSnapshot = Omit<PeerSessionSnapshot$1, 'nodeId'>;
418
+ type LocalDeviceInfo = LocalDeviceInfo$1;
448
419
  type RuntimeRoomMember = RoomMember;
449
- type RuntimeDeviceConnectOptions = ManagedDeviceConnectOptions;
450
- type RuntimeJoinRoomOptions = JoinRoomOptions;
451
- type RuntimeChannelDescriptor = ChannelDescriptor$1;
452
- interface RuntimeConnectionTarget {
420
+ type DeviceConnectOptions = ManagedDeviceConnectOptions;
421
+ type JoinRoomOptions = JoinRoomOptions$1;
422
+ type ChannelDescriptor = ChannelDescriptor$1;
423
+ interface ConnectionTarget {
453
424
  ticket: string;
454
425
  timeoutMs?: number;
455
426
  }
@@ -458,7 +429,7 @@ interface RuntimeConnectionTarget {
458
429
  * gossip protocols. Implementations normally map these atomic operations to
459
430
  * IndexedDB; OpenRTC deliberately does not own a second browser database.
460
431
  */
461
- interface IrohBrowserProtocolStore {
432
+ interface BrowserProtocolStore {
462
433
  loadIdentity(): Promise<{
463
434
  defaultAuthor: Uint8Array;
464
435
  } | null>;
@@ -470,17 +441,17 @@ interface IrohBrowserProtocolStore {
470
441
  importAuthor(authorId: string, author: Uint8Array): Promise<void>;
471
442
  importNamespace(capability: unknown): Promise<void>;
472
443
  deleteNamespace(namespaceId: string): Promise<void>;
473
- applyEntryTransaction(mutation: unknown): Promise<void>;
444
+ applyEntry(mutation: unknown): Promise<void>;
474
445
  acknowledgeOutbox(operationId: string): Promise<void>;
475
446
  listBlobManifests(): Promise<unknown[]>;
476
447
  getBlobResumeState(contentHash: string): Promise<unknown | null>;
477
448
  readBlobRange(contentHash: string, offset: number, length: number): Promise<Uint8Array | null>;
478
449
  writeBlobRange(contentHash: string, size: number, chunkBytes: number, offset: number, bytes: Uint8Array): Promise<void>;
479
- finalizeBlobIfComplete(contentHash: string): Promise<boolean>;
450
+ finalizeBlob(contentHash: string): Promise<boolean>;
480
451
  readBlobOutboardNode(contentHash: string, nodeId: string): Promise<Uint8Array | null>;
481
- writeBlobOutboardNode(contentHash: string, nodeId: string, pair: Uint8Array): Promise<void>;
452
+ writeOutboard(contentHash: string, nodeId: string, pair: Uint8Array): Promise<void>;
482
453
  markBlobBaoReady(contentHash: string): Promise<void>;
483
- writeBlobStagingChunk(sessionId: string, chunkIndex: number, bytes: Uint8Array): Promise<void>;
454
+ writeStagingChunk(sessionId: string, chunkIndex: number, bytes: Uint8Array): Promise<void>;
484
455
  finalizeBlobStaging(sessionId: string, contentHash: string, size: number, chunkBytes: number): Promise<void>;
485
456
  abortBlobStaging(sessionId: string): Promise<void>;
486
457
  deleteBlob(contentHash: string, force: boolean): Promise<boolean>;
@@ -489,7 +460,7 @@ interface IrohBrowserProtocolStore {
489
460
  finalizeBlobImport(contentHash: string, size: number, chunkBytes: number): Promise<void>;
490
461
  flush(): Promise<void>;
491
462
  }
492
- interface IrohNamespaceDescriptor {
463
+ interface NamespaceDescriptor {
493
464
  namespaceId: string;
494
465
  capabilityKind: 'read' | 'write';
495
466
  capability: Uint8Array;
@@ -506,7 +477,7 @@ interface IrohDocEntry {
506
477
  contentHash: string;
507
478
  contentLength: number;
508
479
  }
509
- interface RuntimePeerConnectOptions {
480
+ interface PeerConnectOptions {
510
481
  deviceId?: string;
511
482
  ticket?: string;
512
483
  scope?: RuntimePeerScope;
@@ -518,16 +489,16 @@ interface RuntimePeerConnectOptions {
518
489
  * manual-disconnect projection for this app session. User-initiated manual
519
490
  * reconnects should leave this unset and clear the exclusion explicitly.
520
491
  */
521
- respectManualDisconnect?: boolean;
492
+ keepManualDisconnect?: boolean;
522
493
  }
523
- interface RuntimePeerStreamOptions {
494
+ interface PeerStreamOptions {
524
495
  ticket?: string;
525
496
  scope?: RuntimePeerScope;
526
497
  channelId?: string;
527
498
  timeoutMs?: number;
528
499
  }
529
- type RuntimeLogicalChannelFraming = 'raw' | 'u32be';
530
- interface RuntimeScopedChannelOptions {
500
+ type ChannelFraming = 'raw' | 'u32be';
501
+ interface ScopedChannelOptions {
531
502
  peerId?: string;
532
503
  peerNodeId?: string;
533
504
  deviceId?: string | null;
@@ -535,7 +506,7 @@ interface RuntimeScopedChannelOptions {
535
506
  scope: RuntimePeerScope;
536
507
  channelId: string;
537
508
  timeoutMs?: number;
538
- respectManualDisconnect?: boolean;
509
+ keepManualDisconnect?: boolean;
539
510
  /**
540
511
  * Reuse an application-ready route owned by an active capability and fail
541
512
  * if none exists. Protocol packages use this to open a named channel
@@ -548,9 +519,9 @@ interface RuntimeScopedChannelOptions {
548
519
  * apps do not need to choose raw transport APIs.
549
520
  */
550
521
  nativeLabel?: boolean;
551
- framing?: RuntimeLogicalChannelFraming;
522
+ framing?: ChannelFraming;
552
523
  }
553
- interface RuntimeScopedLogicalChannel {
524
+ interface ScopedLogicalChannel {
554
525
  channelId: string;
555
526
  peerId: string;
556
527
  connection: Connection;
@@ -564,7 +535,7 @@ interface RuntimeScopedLogicalChannel {
564
535
  hasSendOnWebRTC?: boolean;
565
536
  hasWebRTCTransport?: boolean;
566
537
  lastSendTransport?: ProtocolName | 'stream' | null;
567
- framing: RuntimeLogicalChannelFraming;
538
+ framing: ChannelFraming;
568
539
  nativeLabel: boolean;
569
540
  delivery: 'reliable' | 'latest-state';
570
541
  };
@@ -572,46 +543,45 @@ interface RuntimeScopedLogicalChannel {
572
543
  /**
573
544
  * App-facing device status snapshot model. Runtime transport identifiers stay internal.
574
545
  */
575
- type RuntimeDeviceStatusSnapshot = Omit<DeviceStatusSnapshot, 'nodeId'>;
576
- type RuntimeDeviceStatus = RuntimeDeviceStatusSnapshot;
577
- type RuntimeDevicePresenceStatus = DevicePresenceStatus;
578
- type RuntimeIncomingStream = {
546
+ type DeviceStatus = Omit<DeviceStatusSnapshot, 'nodeId'>;
547
+ type DevicePresence = DevicePresenceStatus;
548
+ type IncomingStream = {
579
549
  type: 'bi' | 'uni';
580
550
  stream: any;
581
551
  remoteNodeId: string;
582
552
  protocolHint?: 'control' | 'explicit' | 'native-main' | 'unknown';
583
- channel?: IncomingStreamChannelMetadata | null;
553
+ channel?: ChannelMetadata | null;
584
554
  };
585
- type RuntimeConnectionEvent = {
555
+ type ConnectionEvent = {
586
556
  type: 'connected' | 'disconnected';
587
557
  connectionId: string;
588
558
  localNodeId: string;
589
559
  remoteNodeId: string;
590
560
  transport: ProtocolName;
591
561
  };
592
- type RuntimeRawConnection = {
562
+ type RawConnection = {
593
563
  connectionId: string;
594
564
  localNodeId: string;
595
565
  remoteNodeId: string;
596
566
  };
597
- type RuntimePresenceLoopOptions = {
567
+ type PresenceLoopOptions = {
598
568
  deviceName?: string;
599
569
  ticket?: string;
600
570
  metadata?: string;
601
571
  };
602
- type RuntimeManagedSessionPlatform = 'native' | 'web';
603
- type RuntimeManagedSessionKind = 'app-user-device' | 'share-anonymous' | 'drive-grant-guest' | 'scoped-guest' | (string & {});
604
- type RuntimeAutoConnectPolicy = 'enabled' | 'disabled' | 'scoped-only';
605
- type RuntimePresencePolicy = 'online' | 'disabled';
606
- type RuntimeConnectionStateSnapshot = BackendConnectionState;
607
- type RuntimeApplicationPayloadReadinessOptions = ApplicationPayloadReadinessOptions;
608
- type RuntimeApplicationPayloadRouteOptions = ApplicationPayloadRouteOptions;
609
- type RuntimeUiConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'failed';
610
- interface RuntimePeerReadinessSnapshot {
572
+ type SessionPlatform = 'native' | 'web';
573
+ type SessionKind = 'app-user-device' | 'share-anonymous' | 'drive-grant-guest' | 'scoped-guest' | (string & {});
574
+ type AutoConnectPolicy = 'enabled' | 'disabled' | 'scoped-only';
575
+ type PresencePolicy = 'online' | 'disabled';
576
+ type ConnectionState = BackendConnectionState;
577
+ type ReadinessOptions = ApplicationPayloadReadinessOptions;
578
+ type PayloadRouteOptions = ApplicationPayloadRouteOptions;
579
+ type ConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'failed';
580
+ interface PeerReadiness {
611
581
  requestedId: string;
612
582
  connected: boolean;
613
583
  settledReady: boolean;
614
- status: RuntimeUiConnectionStatus;
584
+ status: ConnectionStatus;
615
585
  health: RuntimePeerHealth | 'unknown';
616
586
  deviceId?: string | null;
617
587
  deviceIdHint?: string | null;
@@ -620,21 +590,21 @@ interface RuntimePeerReadinessSnapshot {
620
590
  readinessReason?: string;
621
591
  scopes: string[];
622
592
  }
623
- interface RuntimeLocalDeviceProfile {
593
+ interface DeviceProfile {
624
594
  deviceId: string | null;
625
595
  deviceName: string;
626
596
  platformType: string;
627
597
  userId: string | null;
628
- capabilities: NonNullable<RuntimeLocalDeviceInfo['capabilities']>;
598
+ capabilities: NonNullable<LocalDeviceInfo['capabilities']>;
629
599
  lastSeenAt: string;
630
600
  localNodeId?: string | null;
631
601
  }
632
- interface RuntimeManagedSessionOptions {
633
- platform: RuntimeManagedSessionPlatform;
634
- sessionKind?: RuntimeManagedSessionKind;
602
+ interface ManagedOptions {
603
+ platform: SessionPlatform;
604
+ sessionKind?: SessionKind;
635
605
  scope?: string | null;
636
- autoConnectPolicy?: RuntimeAutoConnectPolicy;
637
- presencePolicy?: RuntimePresencePolicy;
606
+ autoConnectPolicy?: AutoConnectPolicy;
607
+ presencePolicy?: PresencePolicy;
638
608
  userId?: string | null;
639
609
  deviceName?: string;
640
610
  localDeviceId?: string | null;
@@ -642,24 +612,10 @@ interface RuntimeManagedSessionOptions {
642
612
  autoConnect?: boolean;
643
613
  presence?: boolean;
644
614
  }
645
- interface RuntimeManagedSession {
646
- mode: RuntimeManagedSessionPlatform;
647
- device: RuntimeLocalDeviceProfile;
615
+ interface ManagedSession {
616
+ mode: SessionPlatform;
617
+ device: DeviceProfile;
648
618
  stop: () => Promise<void>;
649
619
  }
650
- type ConnectionTarget = RuntimeConnectionTarget;
651
- type PeerConnectOptions = RuntimePeerConnectOptions;
652
- type PeerStreamOptions = RuntimePeerStreamOptions;
653
- type ScopedChannelOptions = RuntimeScopedChannelOptions;
654
- type ScopedLogicalChannel = RuntimeScopedLogicalChannel;
655
- type IncomingStream = RuntimeIncomingStream;
656
- type ConnectionEvent = RuntimeConnectionEvent;
657
- type RawConnection = RuntimeRawConnection;
658
- type PresenceLoopOptions = RuntimePresenceLoopOptions;
659
- type PeerReadiness = RuntimePeerReadinessSnapshot;
660
- type DeviceProfile = RuntimeLocalDeviceProfile;
661
- type SessionOptions = RuntimeManagedSessionOptions;
662
- type Session = RuntimeManagedSession;
663
- type ChannelDescriptor = RuntimeChannelDescriptor;
664
620
 
665
- export { type RuntimePeerSessionSnapshot as $, type AuthContext as A, type RuntimeSession as B, Connection as C, type RuntimeConnectionTarget as D, type RuntimePresenceLoopOptions as E, type ChannelDescriptor as F, type ConnectionEvent as G, type ConnectionTarget as H, type IrohBrowserProtocolStore as I, type DeviceProfile as J, type IncomingStream as K, type PeerReadiness as L, type PeerStreamOptions as M, type PresenceLoopOptions as N, type RawConnection as O, type PeerConnectOptions as P, type RuntimeApplicationPayloadRouteOptions as Q, type RuntimeChannelDescriptor as R, type RuntimeAuthContext as S, type RuntimeAutoConnectPolicy as T, type RuntimeDevicePresenceStatus as U, type RuntimeDeviceStatus as V, type RuntimeLogicalChannelFraming as W, type RuntimeManagedSessionKind as X, type RuntimeManagedSessionPlatform as Y, type RuntimePeerLifecycleStatus as Z, type RuntimePeerScope as _, type RuntimePeerState as a, type RuntimePresencePolicy as a0, type RuntimeUiConnectionStatus as a1, type ScopedChannelOptions as a2, type ScopedLogicalChannel as a3, type Session as a4, type SessionOptions as a5, type RuntimePeerConnectOptions as b, type RuntimePeerReadinessSnapshot as c, type RuntimePeerHealth as d, type RuntimePeerStreamOptions as e, type RuntimeIncomingStream as f, type RuntimeScopedChannelOptions as g, type RuntimeDevice as h, type RuntimeScopedLogicalChannel as i, type RuntimeConnectionStateSnapshot as j, type RuntimeApplicationPayloadReadinessOptions as k, type RuntimeConnectionEvent as l, type RuntimeManagedSessionOptions as m, type RuntimeManagedSession as n, type RuntimeDeviceStatusSnapshot as o, type RuntimeDeviceConnectOptions as p, type RuntimeLocalDeviceInfo as q, type RuntimeLocalDeviceProfile as r, type RuntimeRawConnection as s, type RuntimeJoinRoomOptions as t, type RuntimeRoomMember as u, type RuntimeClientOptions as v, type IrohNamespaceDescriptor as w, type IrohMutationReceipt as x, type IrohDocEntry as y, type RuntimeAuthIdentity as z };
621
+ export { type AuthContext as A, type BrowserProtocolStore as B, type ChannelDescriptor as C, type DeviceStatus as D, type PeerLifecycleStatus as E, type PeerSessionSnapshot as F, type PresencePolicy as G, type RuntimeAuthContext as H, type IncomingStream as I, type JoinRoomOptions as J, type RuntimePeerScope as K, type LocalDeviceInfo as L, type ManagedOptions as M, type NamespaceDescriptor as N, type SessionKind as O, type PeerConnectOptions as P, type SessionPlatform as Q, type RuntimePeerState as R, type ScopedChannelOptions as S, Connection as a, type PeerReadiness as b, type RuntimePeerHealth as c, type PeerStreamOptions as d, type RuntimeDevice as e, type ScopedLogicalChannel as f, type ConnectionState as g, type ReadinessOptions as h, type ConnectionEvent as i, type ManagedSession as j, type DeviceConnectOptions as k, type DeviceProfile as l, type RawConnection as m, type RuntimeRoomMember as n, type RuntimeClientOptions as o, type IrohMutationReceipt as p, type IrohDocEntry as q, type RuntimeAuthIdentity as r, type RuntimeSession as s, type ConnectionTarget as t, type PresenceLoopOptions as u, type AutoConnectPolicy as v, type ChannelFraming as w, type ConnectionStatus as x, type DevicePresence as y, type PayloadRouteOptions as z };
@@ -1,8 +1,8 @@
1
- import { OpenRTCPeerNamespace, OpenRTCChannelNamespace, OpenRTCDiagnosticsNamespace, OpenRTCDeviceNamespace } from './OpenRTCShared.js';
2
- import { R as RuntimeChannelDescriptor } from './types-DVNSd5B9.js';
3
- import { P as PlutoIrohConfiguration, a as PlutoRTCConfiguration, b as PlutoMoQConfiguration, T as TransportOptimization, c as ProtocolName } from './ITransport-WV6gGMnX.js';
1
+ import { PeerNamespace, ChannelNamespace, DiagnosticsNamespace, DeviceNamespace } from './coreClient.js';
2
+ import { C as ChannelDescriptor } from './types-D67HlF0p.js';
3
+ import { P as PlutoIrohConfiguration, a as PlutoRTCConfiguration, b as PlutoMoQConfiguration, R as RouteOptimization, c as ProtocolName } from './ITransport-yaruAmx3.js';
4
4
 
5
- interface OpenRTCAuthProvider {
5
+ interface AuthProvider {
6
6
  /** Registered provider ID from the developer app capability manifest. */
7
7
  readonly providerId?: string;
8
8
  /**
@@ -11,9 +11,8 @@ interface OpenRTCAuthProvider {
11
11
  * an ordinary access-token refresh. OpenRTC hashes this value together
12
12
  * with the app and installation-key thumbprint before persisting a lookup.
13
13
  *
14
- * Optional during the 2.0 RC compatibility window. Providers that omit it
15
- * use the assertion-first flow and remain correct, but cannot skip the
16
- * assertion exchange on a cold process start.
14
+ * Optional because assertion-only providers remain valid, though they
15
+ * cannot skip the assertion exchange on a cold process start.
17
16
  */
18
17
  getSessionKey?(): Promise<string | null>;
19
18
  getAssertion(input: {
@@ -45,7 +44,7 @@ interface OpenRTCAuthProvider {
45
44
  sessionKey: string | null;
46
45
  }) => void): () => void;
47
46
  }
48
- interface OpenRTCEnrolledDevice {
47
+ interface EnrolledDevice {
49
48
  deviceId: string;
50
49
  name?: string;
51
50
  platform?: string;
@@ -58,7 +57,7 @@ interface OpenRTCEnrolledDevice {
58
57
  * OpenRTC derives a useful browser default when these fields are omitted;
59
58
  * native hosts should pass the OS/device information reported by their host.
60
59
  */
61
- interface OpenRTCDeviceProfile {
60
+ interface DeviceProfile {
62
61
  /** Human-readable label such as `Bryant's iPhone` or `Chrome on Android`. */
63
62
  name?: string;
64
63
  /** Raw OS/runtime label such as `ios`, `android`, `macos`, or `web`. */
@@ -66,7 +65,7 @@ interface OpenRTCDeviceProfile {
66
65
  /** Optional application-owned public presence metadata, bounded to 4 KiB. */
67
66
  metadata?: string;
68
67
  }
69
- interface OpenRTCAttestationProvider {
68
+ interface AttestationProvider {
70
69
  readonly kind: 'firebase-app-check' | 'apple-app-attest' | 'play-integrity' | `custom:${string}`;
71
70
  /**
72
71
  * Describes what the provider actually signs. Reusable app-integrity
@@ -88,22 +87,22 @@ interface OpenRTCAttestationProvider {
88
87
  * load a CAPTCHA dependency; the host supplies a fresh token only when its
89
88
  * developer manifest requires anonymous capability verification.
90
89
  */
91
- interface OpenRTCBotVerificationProvider {
90
+ interface BotVerificationProvider {
92
91
  getToken(input: {
93
92
  action: 'openrtc_capability';
94
93
  apiKey: string;
95
94
  }): Promise<string>;
96
95
  }
97
- interface OpenRTCUsageUpdate {
96
+ interface UsageUpdate {
98
97
  sessionCreditsUsd: number;
99
98
  operation: string;
100
99
  estimated: boolean;
101
100
  }
102
- interface OpenRTCUsageWarning extends OpenRTCUsageUpdate {
101
+ interface UsageWarning extends UsageUpdate {
103
102
  thresholdCreditsUsd: number;
104
103
  kind: 'warning' | 'session-limit';
105
104
  }
106
- interface OpenRTCTransportPreferences {
105
+ interface Transports {
107
106
  iroh?: boolean | PlutoIrohConfiguration;
108
107
  webrtc?: boolean | PlutoRTCConfiguration;
109
108
  relay?: boolean;
@@ -116,7 +115,7 @@ interface OpenRTCTransportPreferences {
116
115
  */
117
116
  privacy?: 'direct' | 'relay-only';
118
117
  /** Optimize eligible routes for stability/cost or measured latency. */
119
- optimizeFor?: TransportOptimization;
118
+ optimizeFor?: RouteOptimization;
120
119
  /**
121
120
  * Advanced native integration for hosts whose Rust process owns the
122
121
  * application protocol registry (for example, a Tauri file-transfer host).
@@ -126,31 +125,31 @@ interface OpenRTCTransportPreferences {
126
125
  /** Exact route order. Unsupported routes are skipped, never treated as failures. */
127
126
  priority?: readonly ProtocolName[];
128
127
  }
129
- interface OpenRTCOptions {
128
+ interface Options {
130
129
  apiKey: string;
131
- auth?: OpenRTCAuthProvider;
130
+ auth?: AuthProvider;
132
131
  trust?: {
133
- attestation?: OpenRTCAttestationProvider;
134
- botVerification?: OpenRTCBotVerificationProvider;
132
+ attestation?: AttestationProvider;
133
+ botVerification?: BotVerificationProvider;
135
134
  };
136
135
  usage?: {
137
136
  warnAtSessionCreditsUsd?: number;
138
137
  maxSessionCreditsUsd?: number;
139
- onUsage?: (event: OpenRTCUsageUpdate) => void;
140
- onWarning?: (warning: OpenRTCUsageWarning) => void;
138
+ onUsage?: (event: UsageUpdate) => void;
139
+ onWarning?: (warning: UsageWarning) => void;
141
140
  };
142
- transports?: OpenRTCTransportPreferences;
141
+ transports?: Transports;
143
142
  }
144
- type OpenRTCAccessMode = 'capability' | 'authenticated';
145
- type OpenRTCLatestStateMode = 'reliable' | 'latest-state';
146
- interface OpenRTCConnection {
143
+ type AccessMode = 'capability' | 'authenticated';
144
+ type Delivery = 'reliable' | 'latest-state';
145
+ interface Connection {
147
146
  readonly id: string;
148
147
  readonly peerId: string;
149
148
  send(message: unknown): Promise<void>;
150
149
  onMessage<T = unknown>(callback: (message: T) => void): () => void;
151
150
  onClose(callback: () => void): () => void;
152
151
  }
153
- interface OpenRTCChannel<T> {
152
+ interface Channel<T> {
154
153
  send(message: T): Promise<void>;
155
154
  sendTo(peerId: string, message: T): Promise<void>;
156
155
  onMessage(callback: (event: {
@@ -158,7 +157,7 @@ interface OpenRTCChannel<T> {
158
157
  message: T;
159
158
  }) => void): () => void;
160
159
  }
161
- interface OpenRTCState<T> {
160
+ interface State<T> {
162
161
  /** Replace the locally published value. Delivery is best-effort and coalesced. */
163
162
  set(value: T): void;
164
163
  /** A null value means the peer disconnected. */
@@ -167,40 +166,40 @@ interface OpenRTCState<T> {
167
166
  value: T | null;
168
167
  }) => void): () => void;
169
168
  }
170
- interface OpenRTCCapabilityHandle {
169
+ interface Avenue {
171
170
  readonly kind: 'devices' | 'space' | 'room' | 'ticket';
172
171
  readonly id: string;
173
- readonly peers: OpenRTCPeerNamespace;
174
- readonly channels: OpenRTCChannelNamespace;
175
- readonly diagnostics: OpenRTCDiagnosticsNamespace;
172
+ readonly peers: PeerNamespace;
173
+ readonly channels: ChannelNamespace;
174
+ readonly diagnostics: DiagnosticsNamespace;
176
175
  readonly closed: boolean;
177
- state<T>(name: string): OpenRTCState<T>;
178
- channel<T>(name: string): OpenRTCChannel<T>;
176
+ state<T>(name: string): State<T>;
177
+ channel<T>(name: string): Channel<T>;
179
178
  /** Observe current and future connections without taking lifecycle ownership. */
180
- onConnection(callback: (connection: OpenRTCConnection) => void): () => void;
179
+ onConnection(callback: (connection: Connection) => void): () => void;
181
180
  close(): Promise<void>;
182
181
  }
183
- interface OpenRTCDevicesHandle extends OpenRTCCapabilityHandle {
182
+ interface Devices extends Avenue {
184
183
  readonly kind: 'devices';
185
- localId(): ReturnType<OpenRTCDeviceNamespace['localId']>;
186
- localInfo(): ReturnType<OpenRTCDeviceNamespace['localInfo']>;
187
- list(): ReturnType<OpenRTCDeviceNamespace['list']>;
188
- listWithStatus(): ReturnType<OpenRTCDeviceNamespace['listWithStatus']>;
189
- watch: OpenRTCDeviceNamespace['watch'];
190
- connect: OpenRTCDeviceNamespace['connect'];
191
- disconnect: OpenRTCDeviceNamespace['disconnect'];
184
+ localId(): ReturnType<DeviceNamespace['localId']>;
185
+ localInfo(): ReturnType<DeviceNamespace['localInfo']>;
186
+ list(): ReturnType<DeviceNamespace['list']>;
187
+ listWithStatus(): ReturnType<DeviceNamespace['listWithStatus']>;
188
+ watch: DeviceNamespace['watch'];
189
+ connect: DeviceNamespace['connect'];
190
+ disconnect: DeviceNamespace['disconnect'];
192
191
  }
193
- interface OpenRTCSpaceHandle extends OpenRTCCapabilityHandle {
192
+ interface Space extends Avenue {
194
193
  readonly kind: 'space';
195
- readonly delivery: OpenRTCLatestStateMode;
194
+ readonly delivery: Delivery;
196
195
  leave(): Promise<void>;
197
196
  }
198
- interface OpenRTCRoomHandle extends OpenRTCCapabilityHandle {
197
+ interface Room extends Avenue {
199
198
  readonly kind: 'room';
200
199
  readonly membership: 'ephemeral' | 'durable';
201
200
  leave(): Promise<void>;
202
201
  }
203
- interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
202
+ interface Ticket extends Avenue {
204
203
  readonly kind: 'ticket';
205
204
  /**
206
205
  * Opaque, install-bound OpenRTC capability credential. This is not a
@@ -211,41 +210,44 @@ interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
211
210
  */
212
211
  readonly token: string;
213
212
  }
214
- interface OpenRTCDevicesStartOptions {
215
- auth?: OpenRTCAuthProvider;
213
+ interface DeviceOptions {
214
+ auth?: AuthProvider;
216
215
  autoConnect?: 'none' | 'online';
217
216
  /** Optional local profile; it does not alter the durable device identity. */
218
- profile?: OpenRTCDeviceProfile;
217
+ profile?: DeviceProfile;
219
218
  maxPeers?: number;
220
219
  /** Requires the app manifest's advanced-fanout opt-in. */
221
220
  advancedFanout?: boolean;
222
221
  }
223
- interface OpenRTCSpaceJoinOptions {
222
+ interface SpaceOptions {
224
223
  access?: 'capability';
225
224
  identity?: 'ephemeral';
226
- payload?: OpenRTCLatestStateMode;
225
+ payload?: Delivery;
227
226
  maxPeers?: number;
228
227
  /** Requires the app manifest's advanced-fanout opt-in. */
229
228
  advancedFanout?: boolean;
230
229
  }
231
- interface OpenRTCRoomJoinOptions {
232
- access?: OpenRTCAccessMode;
230
+ interface RoomOptions {
231
+ access?: AccessMode;
233
232
  membership?: 'ephemeral' | 'durable';
234
- auth?: OpenRTCAuthProvider;
233
+ auth?: AuthProvider;
235
234
  maxPeers?: number;
236
- /** Requires the app manifest's advanced-fanout opt-in. */
235
+ /**
236
+ * Requires the app manifest's reviewed advanced-fanout opt-in. Rooms then
237
+ * use a four-neighbor sparse overlay with bounded named-channel gossip.
238
+ */
237
239
  advancedFanout?: boolean;
238
240
  }
239
- interface OpenRTCTicketIssueOptions {
241
+ interface TicketOptions {
240
242
  maxPeers?: number;
241
243
  /** Requires the app manifest's advanced-fanout opt-in. */
242
244
  advancedFanout?: boolean;
243
245
  }
244
- interface OpenRTCChannelCatalog {
245
- register(descriptor: RuntimeChannelDescriptor): () => void;
246
- list(): readonly RuntimeChannelDescriptor[];
246
+ interface Channels {
247
+ register(descriptor: ChannelDescriptor): () => void;
248
+ list(): readonly ChannelDescriptor[];
247
249
  }
248
- interface OpenRTCUsageNamespace {
250
+ interface Usage {
249
251
  estimate(input: {
250
252
  operation: string;
251
253
  units?: number;
@@ -255,37 +257,37 @@ interface OpenRTCUsageNamespace {
255
257
  };
256
258
  readonly sessionCreditsUsd: number;
257
259
  }
258
- interface OpenRTCClient {
260
+ interface Client {
259
261
  readonly devices: {
260
262
  /**
261
263
  * Returns this installation's durable, app-scoped device ID without
262
264
  * starting a capability or performing network work.
263
265
  */
264
266
  localId(): Promise<string>;
265
- start(options?: OpenRTCDevicesStartOptions): Promise<OpenRTCDevicesHandle>;
267
+ start(options?: DeviceOptions): Promise<Devices>;
266
268
  listEnrolled(options?: {
267
- auth?: OpenRTCAuthProvider;
268
- }): Promise<OpenRTCEnrolledDevice[]>;
269
+ auth?: AuthProvider;
270
+ }): Promise<EnrolledDevice[]>;
269
271
  revoke(deviceId: string, options?: {
270
- auth?: OpenRTCAuthProvider;
272
+ auth?: AuthProvider;
271
273
  }): Promise<void>;
272
274
  revokeAll(options?: {
273
- auth?: OpenRTCAuthProvider;
275
+ auth?: AuthProvider;
274
276
  exceptCurrent?: boolean;
275
277
  }): Promise<void>;
276
278
  };
277
279
  readonly spaces: {
278
- join(id: string, options?: OpenRTCSpaceJoinOptions): Promise<OpenRTCSpaceHandle>;
280
+ join(id: string, options?: SpaceOptions): Promise<Space>;
279
281
  };
280
282
  readonly rooms: {
281
- join(id: string, options?: OpenRTCRoomJoinOptions): Promise<OpenRTCRoomHandle>;
283
+ join(id: string, options?: RoomOptions): Promise<Room>;
282
284
  };
283
285
  readonly tickets: {
284
- issue(id: string, options?: OpenRTCTicketIssueOptions): Promise<OpenRTCTicketHandle>;
286
+ issue(id: string, options?: TicketOptions): Promise<Ticket>;
285
287
  };
286
- readonly channels: OpenRTCChannelCatalog;
287
- readonly usage: OpenRTCUsageNamespace;
288
+ readonly channels: Channels;
289
+ readonly usage: Usage;
288
290
  close(): Promise<void>;
289
291
  }
290
292
 
291
- export type { OpenRTCOptions as O, OpenRTCClient as a, OpenRTCAccessMode as b, OpenRTCAttestationProvider as c, OpenRTCAuthProvider as d, OpenRTCBotVerificationProvider as e, OpenRTCCapabilityHandle as f, OpenRTCChannel as g, OpenRTCChannelCatalog as h, OpenRTCConnection as i, OpenRTCDeviceProfile as j, OpenRTCDevicesHandle as k, OpenRTCDevicesStartOptions as l, OpenRTCEnrolledDevice as m, OpenRTCLatestStateMode as n, OpenRTCRoomHandle as o, OpenRTCRoomJoinOptions as p, OpenRTCSpaceHandle as q, OpenRTCSpaceJoinOptions as r, OpenRTCState as s, OpenRTCTicketHandle as t, OpenRTCTicketIssueOptions as u, OpenRTCTransportPreferences as v, OpenRTCUsageNamespace as w, OpenRTCUsageUpdate as x, OpenRTCUsageWarning as y };
293
+ export type { AttestationProvider as A, BotVerificationProvider as B, Client as C, DeviceOptions as D, EnrolledDevice as E, Options as O, Room as R, Space as S, Ticket as T, UsageUpdate as U, AuthProvider as a, Avenue as b, Channel as c, Connection as d, DeviceProfile as e, Devices as f, RoomOptions as g, SpaceOptions as h, State as i, TicketOptions as j, Transports as k, UsageWarning as l };