openrtc 2.0.1 → 2.2.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 (73) hide show
  1. package/README.md +11 -8
  2. package/dist/{DelegatingRuntimeAdapter-fgz5OPQx.d.ts → DelegatingRuntimeAdapter-BkLR3TNN.d.ts} +33 -31
  3. package/dist/{ITransport-UNOXiRJD.d.ts → ITransport-yaruAmx3.d.ts} +48 -84
  4. package/dist/{IpcRuntimeAdapter-CI3vCzk0.d.ts → IpcRuntimeAdapter-DDKeQ6UC.d.ts} +6 -6
  5. package/dist/WasmBridge-DVQ2YPRB.js +1 -0
  6. package/dist/{assembly-CLdwe5T-.d.ts → assembly-BTzwQuwI.d.ts} +67 -74
  7. package/dist/{capabilities-BUe5YldR.d.ts → capabilities-BwzPe51I.d.ts} +19 -19
  8. package/dist/chunk-2IRNZN3N.js +1 -0
  9. package/dist/chunk-4MLJXEVV.js +2 -0
  10. package/dist/chunk-AJQVMVYW.js +1 -0
  11. package/dist/chunk-BOS554IK.js +2 -0
  12. package/dist/chunk-DI5VSZ2T.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-33NZEARB.js → deviceEnrollment-Z2EHP2EX.js} +1 -1
  27. package/dist/deviceKey-Y35WSEQQ.js +1 -0
  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-INQDCF23.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 +29 -28
  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-DhmY9hBy.d.ts → types-C4TIUgOJ.d.ts} +74 -70
  48. package/dist/{types-l3m3GrOe.d.ts → types-D67HlF0p.d.ts} +58 -102
  49. package/package.json +2 -6
  50. package/dist/OpenRTCShared.js +0 -1
  51. package/dist/WasmBridge-P5646IVR.js +0 -1
  52. package/dist/chunk-45WBH7E3.js +0 -1
  53. package/dist/chunk-5OTF7W2N.js +0 -3
  54. package/dist/chunk-7FPG3MFF.js +0 -2
  55. package/dist/chunk-AG2F6MOB.js +0 -1
  56. package/dist/chunk-CWGKLGJZ.js +0 -1
  57. package/dist/chunk-HIXXBEWX.js +0 -1
  58. package/dist/chunk-IKZ33R7R.js +0 -2
  59. package/dist/chunk-KJTJLLJE.js +0 -2
  60. package/dist/chunk-QCPSLUKO.js +0 -1
  61. package/dist/chunk-VBUDERMM.js +0 -2
  62. package/dist/chunk-XPL7PUBW.js +0 -2
  63. package/dist/chunk-Y35AKFCM.js +0 -1
  64. package/dist/chunk-ZQF5KSOK.js +0 -2
  65. package/dist/controlPlane-YAMXWHAF.js +0 -1
  66. package/dist/deviceKey-SBNKLVYF.js +0 -1
  67. package/dist/deviceProfile-3BEQZLJF.js +0 -2
  68. package/dist/ipcFactory-JTMNUTZI.js +0 -1
  69. package/dist/native.d.ts +0 -15
  70. package/dist/native.js +0 -1
  71. package/dist/openrtc-JUV7TOTL.js +0 -2
  72. /package/dist/{deviceManagement-PHY5TIOS.js → deviceManagement-SUMBRXXC.js} +0 -0
  73. /package/dist/{deviceRoster-VZA3TQOR.js → deviceRoster-EUF6BBF5.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { OpenRTCPeerNamespace, OpenRTCChannelNamespace, OpenRTCDiagnosticsNamespace, OpenRTCDeviceNamespace } from './OpenRTCShared.js';
2
- import { R as RuntimeChannelDescriptor } from './types-l3m3GrOe.js';
3
- import { P as PlutoIrohConfiguration, a as PlutoRTCConfiguration, b as PlutoMoQConfiguration, T as TransportOptimization, c as ProtocolName } from './ITransport-UNOXiRJD.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
  /**
@@ -44,7 +44,7 @@ interface OpenRTCAuthProvider {
44
44
  sessionKey: string | null;
45
45
  }) => void): () => void;
46
46
  }
47
- interface OpenRTCEnrolledDevice {
47
+ interface EnrolledDevice {
48
48
  deviceId: string;
49
49
  name?: string;
50
50
  platform?: string;
@@ -57,7 +57,7 @@ interface OpenRTCEnrolledDevice {
57
57
  * OpenRTC derives a useful browser default when these fields are omitted;
58
58
  * native hosts should pass the OS/device information reported by their host.
59
59
  */
60
- interface OpenRTCDeviceProfile {
60
+ interface DeviceProfile {
61
61
  /** Human-readable label such as `Bryant's iPhone` or `Chrome on Android`. */
62
62
  name?: string;
63
63
  /** Raw OS/runtime label such as `ios`, `android`, `macos`, or `web`. */
@@ -65,7 +65,7 @@ interface OpenRTCDeviceProfile {
65
65
  /** Optional application-owned public presence metadata, bounded to 4 KiB. */
66
66
  metadata?: string;
67
67
  }
68
- interface OpenRTCAttestationProvider {
68
+ interface AttestationProvider {
69
69
  readonly kind: 'firebase-app-check' | 'apple-app-attest' | 'play-integrity' | `custom:${string}`;
70
70
  /**
71
71
  * Describes what the provider actually signs. Reusable app-integrity
@@ -87,22 +87,22 @@ interface OpenRTCAttestationProvider {
87
87
  * load a CAPTCHA dependency; the host supplies a fresh token only when its
88
88
  * developer manifest requires anonymous capability verification.
89
89
  */
90
- interface OpenRTCBotVerificationProvider {
90
+ interface BotVerificationProvider {
91
91
  getToken(input: {
92
92
  action: 'openrtc_capability';
93
93
  apiKey: string;
94
94
  }): Promise<string>;
95
95
  }
96
- interface OpenRTCUsageUpdate {
96
+ interface UsageUpdate {
97
97
  sessionCreditsUsd: number;
98
98
  operation: string;
99
99
  estimated: boolean;
100
100
  }
101
- interface OpenRTCUsageWarning extends OpenRTCUsageUpdate {
101
+ interface UsageWarning extends UsageUpdate {
102
102
  thresholdCreditsUsd: number;
103
103
  kind: 'warning' | 'session-limit';
104
104
  }
105
- interface OpenRTCTransportPreferences {
105
+ interface Transports {
106
106
  iroh?: boolean | PlutoIrohConfiguration;
107
107
  webrtc?: boolean | PlutoRTCConfiguration;
108
108
  relay?: boolean;
@@ -115,7 +115,7 @@ interface OpenRTCTransportPreferences {
115
115
  */
116
116
  privacy?: 'direct' | 'relay-only';
117
117
  /** Optimize eligible routes for stability/cost or measured latency. */
118
- optimizeFor?: TransportOptimization;
118
+ optimizeFor?: RouteOptimization;
119
119
  /**
120
120
  * Advanced native integration for hosts whose Rust process owns the
121
121
  * application protocol registry (for example, a Tauri file-transfer host).
@@ -125,31 +125,31 @@ interface OpenRTCTransportPreferences {
125
125
  /** Exact route order. Unsupported routes are skipped, never treated as failures. */
126
126
  priority?: readonly ProtocolName[];
127
127
  }
128
- interface OpenRTCOptions {
128
+ interface Options {
129
129
  apiKey: string;
130
- auth?: OpenRTCAuthProvider;
130
+ auth?: AuthProvider;
131
131
  trust?: {
132
- attestation?: OpenRTCAttestationProvider;
133
- botVerification?: OpenRTCBotVerificationProvider;
132
+ attestation?: AttestationProvider;
133
+ botVerification?: BotVerificationProvider;
134
134
  };
135
135
  usage?: {
136
136
  warnAtSessionCreditsUsd?: number;
137
137
  maxSessionCreditsUsd?: number;
138
- onUsage?: (event: OpenRTCUsageUpdate) => void;
139
- onWarning?: (warning: OpenRTCUsageWarning) => void;
138
+ onUsage?: (event: UsageUpdate) => void;
139
+ onWarning?: (warning: UsageWarning) => void;
140
140
  };
141
- transports?: OpenRTCTransportPreferences;
141
+ transports?: Transports;
142
142
  }
143
- type OpenRTCAccessMode = 'capability' | 'authenticated';
144
- type OpenRTCLatestStateMode = 'reliable' | 'latest-state';
145
- interface OpenRTCConnection {
143
+ type AccessMode = 'capability' | 'authenticated';
144
+ type Delivery = 'reliable' | 'latest-state';
145
+ interface Connection {
146
146
  readonly id: string;
147
147
  readonly peerId: string;
148
148
  send(message: unknown): Promise<void>;
149
149
  onMessage<T = unknown>(callback: (message: T) => void): () => void;
150
150
  onClose(callback: () => void): () => void;
151
151
  }
152
- interface OpenRTCChannel<T> {
152
+ interface Channel<T> {
153
153
  send(message: T): Promise<void>;
154
154
  sendTo(peerId: string, message: T): Promise<void>;
155
155
  onMessage(callback: (event: {
@@ -157,7 +157,7 @@ interface OpenRTCChannel<T> {
157
157
  message: T;
158
158
  }) => void): () => void;
159
159
  }
160
- interface OpenRTCState<T> {
160
+ interface State<T> {
161
161
  /** Replace the locally published value. Delivery is best-effort and coalesced. */
162
162
  set(value: T): void;
163
163
  /** A null value means the peer disconnected. */
@@ -166,40 +166,40 @@ interface OpenRTCState<T> {
166
166
  value: T | null;
167
167
  }) => void): () => void;
168
168
  }
169
- interface OpenRTCCapabilityHandle {
169
+ interface Avenue {
170
170
  readonly kind: 'devices' | 'space' | 'room' | 'ticket';
171
171
  readonly id: string;
172
- readonly peers: OpenRTCPeerNamespace;
173
- readonly channels: OpenRTCChannelNamespace;
174
- readonly diagnostics: OpenRTCDiagnosticsNamespace;
172
+ readonly peers: PeerNamespace;
173
+ readonly channels: ChannelNamespace;
174
+ readonly diagnostics: DiagnosticsNamespace;
175
175
  readonly closed: boolean;
176
- state<T>(name: string): OpenRTCState<T>;
177
- channel<T>(name: string): OpenRTCChannel<T>;
176
+ state<T>(name: string): State<T>;
177
+ channel<T>(name: string): Channel<T>;
178
178
  /** Observe current and future connections without taking lifecycle ownership. */
179
- onConnection(callback: (connection: OpenRTCConnection) => void): () => void;
179
+ onConnection(callback: (connection: Connection) => void): () => void;
180
180
  close(): Promise<void>;
181
181
  }
182
- interface OpenRTCDevicesHandle extends OpenRTCCapabilityHandle {
182
+ interface Devices extends Avenue {
183
183
  readonly kind: 'devices';
184
- localId(): ReturnType<OpenRTCDeviceNamespace['localId']>;
185
- localInfo(): ReturnType<OpenRTCDeviceNamespace['localInfo']>;
186
- list(): ReturnType<OpenRTCDeviceNamespace['list']>;
187
- listWithStatus(): ReturnType<OpenRTCDeviceNamespace['listWithStatus']>;
188
- watch: OpenRTCDeviceNamespace['watch'];
189
- connect: OpenRTCDeviceNamespace['connect'];
190
- 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'];
191
191
  }
192
- interface OpenRTCSpaceHandle extends OpenRTCCapabilityHandle {
192
+ interface Space extends Avenue {
193
193
  readonly kind: 'space';
194
- readonly delivery: OpenRTCLatestStateMode;
194
+ readonly delivery: Delivery;
195
195
  leave(): Promise<void>;
196
196
  }
197
- interface OpenRTCRoomHandle extends OpenRTCCapabilityHandle {
197
+ interface Room extends Avenue {
198
198
  readonly kind: 'room';
199
199
  readonly membership: 'ephemeral' | 'durable';
200
200
  leave(): Promise<void>;
201
201
  }
202
- interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
202
+ interface Ticket extends Avenue {
203
203
  readonly kind: 'ticket';
204
204
  /**
205
205
  * Opaque, install-bound OpenRTC capability credential. This is not a
@@ -210,41 +210,45 @@ interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
210
210
  */
211
211
  readonly token: string;
212
212
  }
213
- interface OpenRTCDevicesStartOptions {
214
- auth?: OpenRTCAuthProvider;
213
+ interface DeviceOptions {
214
+ auth?: AuthProvider;
215
215
  autoConnect?: 'none' | 'online';
216
216
  /** Optional local profile; it does not alter the durable device identity. */
217
- profile?: OpenRTCDeviceProfile;
217
+ profile?: DeviceProfile;
218
218
  maxPeers?: number;
219
219
  /** Requires the app manifest's advanced-fanout opt-in. */
220
220
  advancedFanout?: boolean;
221
221
  }
222
- interface OpenRTCSpaceJoinOptions {
222
+ interface SpaceOptions {
223
223
  access?: 'capability';
224
- identity?: 'ephemeral';
225
- payload?: OpenRTCLatestStateMode;
224
+ /** Use a new memory-only identity for this OpenRTC client run. */
225
+ identity?: 'session';
226
+ payload?: Delivery;
226
227
  maxPeers?: number;
227
228
  /** Requires the app manifest's advanced-fanout opt-in. */
228
229
  advancedFanout?: boolean;
229
230
  }
230
- interface OpenRTCRoomJoinOptions {
231
- access?: OpenRTCAccessMode;
231
+ interface RoomOptions {
232
+ access?: AccessMode;
232
233
  membership?: 'ephemeral' | 'durable';
233
- auth?: OpenRTCAuthProvider;
234
+ auth?: AuthProvider;
234
235
  maxPeers?: number;
235
- /** Requires the app manifest's advanced-fanout opt-in. */
236
+ /**
237
+ * Requires the app manifest's reviewed advanced-fanout opt-in. Rooms then
238
+ * use a four-neighbor sparse overlay with bounded named-channel gossip.
239
+ */
236
240
  advancedFanout?: boolean;
237
241
  }
238
- interface OpenRTCTicketIssueOptions {
242
+ interface TicketOptions {
239
243
  maxPeers?: number;
240
244
  /** Requires the app manifest's advanced-fanout opt-in. */
241
245
  advancedFanout?: boolean;
242
246
  }
243
- interface OpenRTCChannelCatalog {
244
- register(descriptor: RuntimeChannelDescriptor): () => void;
245
- list(): readonly RuntimeChannelDescriptor[];
247
+ interface Channels {
248
+ register(descriptor: ChannelDescriptor): () => void;
249
+ list(): readonly ChannelDescriptor[];
246
250
  }
247
- interface OpenRTCUsageNamespace {
251
+ interface Usage {
248
252
  estimate(input: {
249
253
  operation: string;
250
254
  units?: number;
@@ -254,37 +258,37 @@ interface OpenRTCUsageNamespace {
254
258
  };
255
259
  readonly sessionCreditsUsd: number;
256
260
  }
257
- interface OpenRTCClient {
261
+ interface Client {
258
262
  readonly devices: {
259
263
  /**
260
264
  * Returns this installation's durable, app-scoped device ID without
261
265
  * starting a capability or performing network work.
262
266
  */
263
267
  localId(): Promise<string>;
264
- start(options?: OpenRTCDevicesStartOptions): Promise<OpenRTCDevicesHandle>;
268
+ start(options?: DeviceOptions): Promise<Devices>;
265
269
  listEnrolled(options?: {
266
- auth?: OpenRTCAuthProvider;
267
- }): Promise<OpenRTCEnrolledDevice[]>;
270
+ auth?: AuthProvider;
271
+ }): Promise<EnrolledDevice[]>;
268
272
  revoke(deviceId: string, options?: {
269
- auth?: OpenRTCAuthProvider;
273
+ auth?: AuthProvider;
270
274
  }): Promise<void>;
271
275
  revokeAll(options?: {
272
- auth?: OpenRTCAuthProvider;
276
+ auth?: AuthProvider;
273
277
  exceptCurrent?: boolean;
274
278
  }): Promise<void>;
275
279
  };
276
280
  readonly spaces: {
277
- join(id: string, options?: OpenRTCSpaceJoinOptions): Promise<OpenRTCSpaceHandle>;
281
+ join(id: string, options?: SpaceOptions): Promise<Space>;
278
282
  };
279
283
  readonly rooms: {
280
- join(id: string, options?: OpenRTCRoomJoinOptions): Promise<OpenRTCRoomHandle>;
284
+ join(id: string, options?: RoomOptions): Promise<Room>;
281
285
  };
282
286
  readonly tickets: {
283
- issue(id: string, options?: OpenRTCTicketIssueOptions): Promise<OpenRTCTicketHandle>;
287
+ issue(id: string, options?: TicketOptions): Promise<Ticket>;
284
288
  };
285
- readonly channels: OpenRTCChannelCatalog;
286
- readonly usage: OpenRTCUsageNamespace;
289
+ readonly channels: Channels;
290
+ readonly usage: Usage;
287
291
  close(): Promise<void>;
288
292
  }
289
293
 
290
- 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 };
294
+ 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 };
@@ -1,4 +1,4 @@
1
- import { x as ConnectionOptions, y as ApplicationPayloadCrypto, z as ApplicationPayloadReadinessOptions, F as ApplicationPayloadRouteOptions, c as ProtocolName, H as ApplicationPayloadSendOptions, J as ITransport, K as TransportLatencySnapshot, O as PeerState, Q as PeerScope, U as PeerHealth, V as ChannelDescriptor$1, W as IncomingStreamChannelMetadata, D as Device, v as BackendConnectionState, L as LocalDeviceInfo, n as DeviceStatusSnapshot, X as ManagedDeviceConnectOptions, g as ClientOptions, t as SignalingSession, l as RuntimeIdentity, Y as JoinRoomOptions, k as RoomMember, Z as DevicePresenceStatus, _ as PeerLifecycleStatus, d as PeerSessionSnapshot } from './ITransport-UNOXiRJD.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 };