openrtc 0.2.0 → 1.0.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.
- package/LICENSE +92 -0
- package/README.md +100 -10
- package/dist/{DelegatingRuntimeAdapter-CjHzBEBA.d.ts → DelegatingRuntimeAdapter-By7pziBs.d.ts} +36 -15
- package/dist/IEngineBridge-C7OT2CRv.d.ts +10 -0
- package/dist/{IpcRuntimeAdapter-CtckyMol.d.ts → IpcRuntimeAdapter-DymXAsNU.d.ts} +6 -3
- package/dist/auth/index.js +1 -1
- package/dist/auth/internal.js +1 -1
- package/dist/chunk-3KDNLXT6.js +3 -0
- package/dist/chunk-5RXNKNPH.js +2 -0
- package/dist/chunk-6TIOSMVJ.js +1 -0
- package/dist/chunk-BLOEZIFJ.js +1 -0
- package/dist/chunk-CK6WQV7J.js +1 -0
- package/dist/chunk-KH227SE4.js +1 -0
- package/dist/chunk-KYDLXXNM.js +1 -0
- package/dist/chunk-W5JHUOK5.js +2 -0
- package/dist/device-status-nkXepu97.d.ts +560 -0
- package/dist/{factories-CwZiIRg1.d.ts → framing-BUtu0oZK.d.ts} +47 -520
- package/dist/index.d.ts +113 -9
- package/dist/index.js +2 -2
- package/dist/openrtc_bg.wasm +0 -0
- package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -2
- package/dist/runtime/WasmRuntimeAdapter.js +1 -1
- package/dist/runtime/device-status.d.ts +3 -0
- package/dist/runtime/device-status.js +1 -0
- package/dist/runtime/index.d.ts +94 -84
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/tauri.d.ts +4 -3
- package/dist/runtime/tauri.js +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/{types-DyCGvj9l.d.ts → types-CzIpGV9x.d.ts} +117 -14
- package/package.json +22 -10
- package/dist/chunk-3VTF5RKW.js +0 -1
- package/dist/chunk-JXGKO7SX.js +0 -1
- package/dist/chunk-MFT6SOZ6.js +0 -3
- package/dist/chunk-SGZWR63E.js +0 -1
- package/dist/chunk-VARALO7G.js +0 -1
- package/dist/chunk-WOHFM6DI.js +0 -2
- package/dist/chunk-YHJOXD46.js +0 -2
package/dist/runtime/tauri.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { I as IpcRuntimeAdapter, N as NativeIpcBridgeOptions, P as PlutoIpcBridge } from '../IpcRuntimeAdapter-
|
|
2
|
-
import '../types-
|
|
3
|
-
import '../DelegatingRuntimeAdapter-
|
|
1
|
+
import { I as IpcRuntimeAdapter, N as NativeIpcBridgeOptions, P as PlutoIpcBridge } from '../IpcRuntimeAdapter-DymXAsNU.js';
|
|
2
|
+
import '../types-CzIpGV9x.js';
|
|
3
|
+
import '../DelegatingRuntimeAdapter-By7pziBs.js';
|
|
4
|
+
import '../IEngineBridge-C7OT2CRv.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @deprecated Native Tauri support now lives in the first-party `openrtc-tauri` package.
|
package/dist/runtime/tauri.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-
|
|
1
|
+
export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-KH227SE4.js';import'../chunk-5RXNKNPH.js';import'../chunk-KYDLXXNM.js';import'../chunk-W5JHUOK5.js';import'../chunk-BLOEZIFJ.js';
|
package/dist/transport/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as TRANSPORT_LABELS,d as isDirectIrohTransportLabel,g as isIndependentTransportLabel,c as isIrohBaseTransportLabel,e as isOptionalTransportLabel,f as isWebRtcTransportLabel,b as normalizeTransportLabel}from'../chunk-
|
|
1
|
+
export{a as TRANSPORT_LABELS,d as isDirectIrohTransportLabel,g as isIndependentTransportLabel,c as isIrohBaseTransportLabel,e as isOptionalTransportLabel,f as isWebRtcTransportLabel,b as normalizeTransportLabel}from'../chunk-BLOEZIFJ.js';
|
|
@@ -20,8 +20,16 @@ interface LocalPeerSnapshot {
|
|
|
20
20
|
discoveredAtMs: number;
|
|
21
21
|
localReachable: boolean;
|
|
22
22
|
}
|
|
23
|
+
interface PlutoMoQServerCertificateHash {
|
|
24
|
+
algorithm: 'sha-256';
|
|
25
|
+
value: ArrayBuffer;
|
|
26
|
+
}
|
|
23
27
|
interface PlutoMoQConfiguration {
|
|
24
28
|
relayUrl?: string;
|
|
29
|
+
/** Relay JWT appended only at WebTransport connection time. Never include it in relayUrl. */
|
|
30
|
+
accessToken?: string;
|
|
31
|
+
/** Explicit certificate pins for self-signed development relays. */
|
|
32
|
+
serverCertificateHashes?: PlutoMoQServerCertificateHash[];
|
|
25
33
|
}
|
|
26
34
|
interface PlutoIrohConfiguration {
|
|
27
35
|
relayOnly?: boolean;
|
|
@@ -37,10 +45,6 @@ interface PlutoBleConfiguration {
|
|
|
37
45
|
enabled?: boolean;
|
|
38
46
|
/** Timeout for a single BLE connection attempt. */
|
|
39
47
|
connectTimeoutMs?: number;
|
|
40
|
-
/** Preferred retry budget for native BLE connection establishment. */
|
|
41
|
-
retryAttempts?: number;
|
|
42
|
-
/** Backoff between BLE retry attempts. */
|
|
43
|
-
retryBackoffMs?: number;
|
|
44
48
|
}
|
|
45
49
|
interface TurnCredentials {
|
|
46
50
|
iceServers?: RTCIceServer[];
|
|
@@ -53,6 +57,7 @@ type RoomCreationMode = 'client-open' | 'client-auth' | 'server-only';
|
|
|
53
57
|
type EndpointKind = 'device' | 'ephemeral';
|
|
54
58
|
type PeerLifecycleStatus = 'disconnected' | 'connecting' | 'connected' | 'failed' | 'closed';
|
|
55
59
|
type PeerHealth = 'unknown' | 'healthy' | 'suspect' | 'stale';
|
|
60
|
+
type DevicePresenceStatus = 'online' | 'idle' | 'offline';
|
|
56
61
|
type PeerLifecycleStage = 'discovered' | 'dialing' | 'base-connected' | 'admitted' | 'protocol-ready' | 'upgrading' | 'webrtc-ready' | 'degraded' | 'reconnecting' | 'closed';
|
|
57
62
|
type PeerBaseTransportState = 'unknown' | 'connecting' | 'connected' | 'degraded' | 'closed';
|
|
58
63
|
type PeerAdmissionState = 'unknown' | 'pending' | 'admitted' | 'rejected' | 'expired';
|
|
@@ -119,23 +124,30 @@ interface ClientOptions {
|
|
|
119
124
|
*/
|
|
120
125
|
apiKey?: string;
|
|
121
126
|
/**
|
|
122
|
-
* Discovery
|
|
123
|
-
*
|
|
124
|
-
*
|
|
127
|
+
* Discovery avenue for this runtime.
|
|
128
|
+
*
|
|
129
|
+
* Set this explicitly in new apps:
|
|
130
|
+
* - `space`: a small live shared namespace backed by scoped space tokens.
|
|
131
|
+
* - `user-scoped`: a signed-in user's durable owned-device roster.
|
|
125
132
|
*
|
|
126
|
-
*
|
|
133
|
+
* Rooms and ticket/share grants are separate layers. Do not use `space`
|
|
134
|
+
* as a generic account device list, and do not expect `user-scoped`
|
|
135
|
+
* discovery to show other users unless a room or explicit grant connects them.
|
|
127
136
|
*/
|
|
128
137
|
discoveryMode?: DiscoveryMode;
|
|
129
138
|
/**
|
|
130
|
-
* Shared space name for
|
|
131
|
-
*
|
|
139
|
+
* Shared space name for `space` discovery mode. Use this for lightweight
|
|
140
|
+
* lobbies, demos, cursors, and other live-only collaboration surfaces.
|
|
141
|
+
* This is the beginner-facing name for `spaceKey`; if both are set,
|
|
142
|
+
* `spaceKey` wins.
|
|
132
143
|
*/
|
|
133
144
|
space?: string;
|
|
134
145
|
/**
|
|
135
|
-
*
|
|
146
|
+
* Compatibility name for `space`. The SDK derives a namespace from
|
|
136
147
|
* apiKey + spaceKey, then authenticates with spaceTokenProvider.
|
|
137
148
|
*
|
|
138
|
-
*
|
|
149
|
+
* Prefer `space` in public app code. Only used when discoveryMode is
|
|
150
|
+
* `space`; ignored for user-scoped discovery.
|
|
139
151
|
*/
|
|
140
152
|
spaceKey?: string;
|
|
141
153
|
/**
|
|
@@ -154,6 +166,21 @@ interface ClientOptions {
|
|
|
154
166
|
storagePrefix?: string;
|
|
155
167
|
deviceTTL?: number;
|
|
156
168
|
deviceName?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Persistence of the app-facing logical device identity. Defaults to
|
|
171
|
+
* `persistent` in browsers so a reload updates one durable device record.
|
|
172
|
+
*/
|
|
173
|
+
deviceIdPersistence?: 'persistent' | 'ephemeral';
|
|
174
|
+
/**
|
|
175
|
+
* Persistence of the Iroh endpoint secret/EndpointId. Browser runtimes
|
|
176
|
+
* default to `ephemeral` so each tab/process incarnation has an unambiguous
|
|
177
|
+
* transport identity. Native hosts may persist their endpoint explicitly.
|
|
178
|
+
*/
|
|
179
|
+
endpointIdPersistence?: 'persistent' | 'ephemeral';
|
|
180
|
+
/**
|
|
181
|
+
* @deprecated Use `deviceIdPersistence` and `endpointIdPersistence`.
|
|
182
|
+
* When supplied, this legacy option remains an explicit override for both.
|
|
183
|
+
*/
|
|
157
184
|
nodeIdPersistence?: 'persistent' | 'ephemeral';
|
|
158
185
|
secretKey?: string;
|
|
159
186
|
strictMode?: boolean;
|
|
@@ -202,7 +229,7 @@ interface ClientOptions {
|
|
|
202
229
|
/**
|
|
203
230
|
* Mints a namespace-scoped Firebase custom token for space discovery.
|
|
204
231
|
* Required when `discoveryMode` is `space` and `space`/`spaceKey` is set.
|
|
205
|
-
* Use `spaceToken` for browser demos.
|
|
232
|
+
* Use `spaceToken(...)` for browser demos and simple static sites.
|
|
206
233
|
*/
|
|
207
234
|
spaceTokenProvider?: SpaceTokenProvider;
|
|
208
235
|
}
|
|
@@ -211,6 +238,10 @@ interface Device {
|
|
|
211
238
|
deviceName: string;
|
|
212
239
|
online: boolean;
|
|
213
240
|
ticket: string;
|
|
241
|
+
presenceStatus?: DevicePresenceStatus;
|
|
242
|
+
presenceUpdatedAt?: number;
|
|
243
|
+
presenceExpiresAt?: number;
|
|
244
|
+
connectable?: boolean;
|
|
214
245
|
kind?: EndpointKind | string;
|
|
215
246
|
nodeId?: string;
|
|
216
247
|
platformType?: string;
|
|
@@ -256,6 +287,7 @@ interface PeerState {
|
|
|
256
287
|
routable?: boolean;
|
|
257
288
|
activeTransportStableId?: number | null;
|
|
258
289
|
transportGeneration?: number;
|
|
290
|
+
routeGeneration?: number;
|
|
259
291
|
activeTransport?: ProtocolName;
|
|
260
292
|
fallbackTransport?: ProtocolName | null;
|
|
261
293
|
parallelTransport?: ProtocolName | null;
|
|
@@ -281,6 +313,7 @@ interface BackendConnectionState {
|
|
|
281
313
|
readinessState?: string;
|
|
282
314
|
readinessReason?: string;
|
|
283
315
|
transportGeneration?: number;
|
|
316
|
+
routeGeneration?: number;
|
|
284
317
|
activeTransportStableId?: number | null;
|
|
285
318
|
replacementInProgress?: boolean;
|
|
286
319
|
lastLifecycleTransitionAtMs?: number;
|
|
@@ -302,6 +335,12 @@ interface NativeConnectResult {
|
|
|
302
335
|
state: string;
|
|
303
336
|
approvedScope?: string | null;
|
|
304
337
|
}
|
|
338
|
+
interface NativeConnectParams {
|
|
339
|
+
deviceId?: string | null;
|
|
340
|
+
endpointTicket: string;
|
|
341
|
+
/** Total native dial/admission budget. The host command must enforce it. */
|
|
342
|
+
timeoutMs?: number;
|
|
343
|
+
}
|
|
305
344
|
interface BackendPeerBiStream {
|
|
306
345
|
readable: ReadableStream<Uint8Array>;
|
|
307
346
|
writable: WritableStream<Uint8Array>;
|
|
@@ -341,6 +380,7 @@ interface JoinRoomOptions {
|
|
|
341
380
|
}
|
|
342
381
|
interface SignalingEnvelope {
|
|
343
382
|
name?: string;
|
|
383
|
+
appTag?: string;
|
|
344
384
|
senderId: string;
|
|
345
385
|
targetId: string;
|
|
346
386
|
senderUserId?: string;
|
|
@@ -349,6 +389,7 @@ interface SignalingEnvelope {
|
|
|
349
389
|
payload: string;
|
|
350
390
|
replyPayload?: string;
|
|
351
391
|
timestamp?: number;
|
|
392
|
+
expiresAt?: number;
|
|
352
393
|
}
|
|
353
394
|
interface SignalingSession {
|
|
354
395
|
connectionId: string;
|
|
@@ -438,6 +479,14 @@ interface ManagedDeviceConnectOptions {
|
|
|
438
479
|
onConnected?: (device: Device) => void | Promise<void>;
|
|
439
480
|
}
|
|
440
481
|
interface DeviceStatusSnapshot extends Device {
|
|
482
|
+
/**
|
|
483
|
+
* Presence/liveness for the roster entry. This is separate from
|
|
484
|
+
* `connectionStatus`, which describes the runtime route to the peer.
|
|
485
|
+
*/
|
|
486
|
+
presenceStatus: DevicePresenceStatus;
|
|
487
|
+
presenceUpdatedAt?: number;
|
|
488
|
+
presenceExpiresAt?: number;
|
|
489
|
+
connectable: boolean;
|
|
441
490
|
connectionStatus: PeerLifecycleStatus | 'online';
|
|
442
491
|
settledReady?: boolean;
|
|
443
492
|
readinessState?: string;
|
|
@@ -450,6 +499,7 @@ interface DeviceStatusSnapshot extends Device {
|
|
|
450
499
|
deviceIdHint?: string;
|
|
451
500
|
activeTransportStableId?: number | null;
|
|
452
501
|
transportGeneration?: number;
|
|
502
|
+
routeGeneration?: number;
|
|
453
503
|
activeTransport?: ProtocolName;
|
|
454
504
|
parallelTransport?: ProtocolName | null;
|
|
455
505
|
availableTransports?: ProtocolName[];
|
|
@@ -461,9 +511,11 @@ interface ManagedConnectionRecord {
|
|
|
461
511
|
deviceIdHint?: string | null;
|
|
462
512
|
endpointId?: string | null;
|
|
463
513
|
transportGeneration: number;
|
|
514
|
+
routeGeneration?: number;
|
|
464
515
|
transportStableId?: number | null;
|
|
465
516
|
transportSource?: string | null;
|
|
466
517
|
lastTransportChangeAtMs: number;
|
|
518
|
+
lastRouteChangeAtMs?: number;
|
|
467
519
|
state: string;
|
|
468
520
|
statusReason?: string | null;
|
|
469
521
|
transitionCount?: number;
|
|
@@ -494,6 +546,7 @@ interface PeerSessionSnapshot {
|
|
|
494
546
|
readinessState?: string;
|
|
495
547
|
activeTransportStableId?: number | null;
|
|
496
548
|
transportGeneration?: number;
|
|
549
|
+
routeGeneration?: number;
|
|
497
550
|
activeTransport?: ProtocolName;
|
|
498
551
|
parallelTransport?: ProtocolName | null;
|
|
499
552
|
replacementPending?: boolean;
|
|
@@ -572,6 +625,7 @@ interface ExplicitFileDataSendParams {
|
|
|
572
625
|
file: File;
|
|
573
626
|
transferId: string;
|
|
574
627
|
channelId?: string;
|
|
628
|
+
receiverPlatformType?: string | null;
|
|
575
629
|
applicationCrypto?: ApplicationPayloadCrypto;
|
|
576
630
|
requireApplicationCrypto?: boolean;
|
|
577
631
|
}
|
|
@@ -583,6 +637,7 @@ interface ISignalingBackend {
|
|
|
583
637
|
stopAuthScopedActivity?(): Promise<void>;
|
|
584
638
|
getTurnCredentials(): Promise<any>;
|
|
585
639
|
updatePresence(localNodeId: string, ticketStr: string, isOnline: boolean, ttlMs: number, metadata?: string): Promise<void>;
|
|
640
|
+
refreshLivePresence?(localNodeId: string, ticketStr: string, metadata?: string): Promise<void>;
|
|
586
641
|
setOffline(localNodeId: string): Promise<void>;
|
|
587
642
|
cleanupStaleDevices(): Promise<void>;
|
|
588
643
|
searchDevices(excludeNodeId?: string): Promise<Device[]>;
|
|
@@ -628,6 +683,9 @@ interface ISignalingBackend {
|
|
|
628
683
|
reconcileNativeManagedSession?(options?: {
|
|
629
684
|
reason?: string;
|
|
630
685
|
}): Promise<unknown>;
|
|
686
|
+
notifyNetworkChange?(options?: {
|
|
687
|
+
reason?: string;
|
|
688
|
+
}): Promise<unknown>;
|
|
631
689
|
getManagedNodeId?(options?: {
|
|
632
690
|
initializeIfMissing?: boolean;
|
|
633
691
|
}): Promise<string | null>;
|
|
@@ -650,9 +708,13 @@ interface ISignalingBackend {
|
|
|
650
708
|
isConnected(nodeId: string): Promise<boolean>;
|
|
651
709
|
getConnectionStates?(): Promise<BackendConnectionState[]>;
|
|
652
710
|
onConnectionStateChange?(callback: (state: BackendConnectionState) => void): Promise<() => void> | (() => void);
|
|
711
|
+
/** @deprecated Implement file protocols over named channels, or use `openrtc-file-transfer`. */
|
|
653
712
|
sendExplicitFilePath?(connectionId: string, filePath: string, transferId?: string): Promise<string>;
|
|
713
|
+
/** @deprecated Implement file protocols over named channels, or use `openrtc-file-transfer`. */
|
|
654
714
|
sendExplicitFileData?(params: ExplicitFileDataSendParams): Promise<void>;
|
|
715
|
+
/** @deprecated Transfer history is consumer-owned application state. */
|
|
655
716
|
getTransferHistory?(limit?: number): Promise<Array<[string, unknown]>>;
|
|
717
|
+
/** @deprecated Transfer history is consumer-owned application state. */
|
|
656
718
|
deleteTransferJob?(jobId: string): Promise<void>;
|
|
657
719
|
}
|
|
658
720
|
interface CoreClientBridgeHost {
|
|
@@ -660,11 +722,25 @@ interface CoreClientBridgeHost {
|
|
|
660
722
|
admissionAlreadyPresented?: boolean;
|
|
661
723
|
approvedScope?: string | null;
|
|
662
724
|
}): Promise<{
|
|
725
|
+
id?: string | null;
|
|
726
|
+
remoteNodeId?: string | null;
|
|
727
|
+
deviceId?: string | null;
|
|
728
|
+
} | unknown>;
|
|
729
|
+
ensureManagedApplicationRoute?(options: ManagedApplicationRouteOptions): Promise<{
|
|
730
|
+
id?: string | null;
|
|
663
731
|
remoteNodeId?: string | null;
|
|
664
732
|
deviceId?: string | null;
|
|
665
733
|
} | unknown>;
|
|
666
734
|
waitForApplicationCryptoForPeer?(peerId?: string, timeoutMs?: number): Promise<unknown>;
|
|
667
735
|
hasApplicationRouteForPeer?(connectionId?: string, remoteNodeId?: string): boolean;
|
|
736
|
+
rememberRouteRepairTokenFromTicket?(ticket: string): Promise<boolean>;
|
|
737
|
+
}
|
|
738
|
+
interface ManagedApplicationRouteOptions {
|
|
739
|
+
ticket: string;
|
|
740
|
+
connectionId?: string | null;
|
|
741
|
+
remoteNodeId?: string | null;
|
|
742
|
+
expectedDeviceId?: string | null;
|
|
743
|
+
timeoutMs?: number;
|
|
668
744
|
}
|
|
669
745
|
interface SignalingOptions {
|
|
670
746
|
apiKey?: string;
|
|
@@ -680,6 +756,7 @@ interface TransportContext {
|
|
|
680
756
|
priorities: ProtocolName[];
|
|
681
757
|
disableIrohFallback: boolean;
|
|
682
758
|
isMoQReady: () => boolean;
|
|
759
|
+
isMoQDataReady?: () => boolean;
|
|
683
760
|
runtimeFlow?: 'default' | 'ticket-only';
|
|
684
761
|
readerCloseStrategy?: 'cancel' | 'release-lock';
|
|
685
762
|
}
|
|
@@ -729,11 +806,28 @@ interface ApplicationPayloadRouteOptions extends ApplicationPayloadReadinessOpti
|
|
|
729
806
|
}
|
|
730
807
|
interface ApplicationPayloadSendOptions extends ApplicationPayloadRouteOptions {
|
|
731
808
|
}
|
|
809
|
+
interface ApplicationRouteReadyObservation {
|
|
810
|
+
connectionId: string;
|
|
811
|
+
remoteNodeId: string;
|
|
812
|
+
activeTransport: ProtocolName;
|
|
813
|
+
parallelTransport?: ProtocolName | null;
|
|
814
|
+
reason: 'webrtc-route-ready' | 'webrtc-heartbeat-healthy' | 'webrtc-application-send' | 'base-transport-loss-preserved';
|
|
815
|
+
transportStableId?: number;
|
|
816
|
+
transportGeneration?: number;
|
|
817
|
+
routeGeneration?: number;
|
|
818
|
+
}
|
|
732
819
|
interface ConnectionOptions {
|
|
733
820
|
reliable?: boolean;
|
|
734
821
|
rtcConfig?: PlutoRTCConfiguration;
|
|
735
822
|
transportContext?: TransportContext;
|
|
736
823
|
applicationCrypto?: ApplicationPayloadCrypto;
|
|
824
|
+
/**
|
|
825
|
+
* Whether the constructor's reader/writer represent a routable base
|
|
826
|
+
* application stream. Transport-only ticket channels set this to false:
|
|
827
|
+
* their placeholder streams exist only to satisfy the compatibility object,
|
|
828
|
+
* while application bytes use named runtime channels.
|
|
829
|
+
*/
|
|
830
|
+
hasBaseApplicationStream?: boolean;
|
|
737
831
|
/** Framing used by the underlying iroh control stream. */
|
|
738
832
|
controlFrameMode?: 'typed' | 'native-main';
|
|
739
833
|
/**
|
|
@@ -746,7 +840,16 @@ interface ConnectionOptions {
|
|
|
746
840
|
onTransportStatusChange?: (status: {
|
|
747
841
|
activeTransport: ProtocolName;
|
|
748
842
|
parallelTransport?: ProtocolName | null;
|
|
843
|
+
transportStableId?: number;
|
|
844
|
+
transportGeneration?: number;
|
|
845
|
+
routeGeneration?: number;
|
|
749
846
|
}) => void;
|
|
847
|
+
/**
|
|
848
|
+
* Fired when a connection-owned application route has proven it can carry
|
|
849
|
+
* app traffic. Consumers should use this as a lifecycle signal for the same
|
|
850
|
+
* connection record, not as an independent projection source.
|
|
851
|
+
*/
|
|
852
|
+
onApplicationRouteReady?: (event: ApplicationRouteReadyObservation) => void;
|
|
750
853
|
/**
|
|
751
854
|
* Fired when the WebRTC data plane has proven a ping/pong round trip but the
|
|
752
855
|
* mandatory application crypto route is not installed yet. Connection owns
|
|
@@ -766,4 +869,4 @@ interface JoinRequest {
|
|
|
766
869
|
state: 'pending' | 'accepted' | 'rejected';
|
|
767
870
|
}
|
|
768
871
|
|
|
769
|
-
export type {
|
|
872
|
+
export type { PeerState as $, AuthMode as A, BackendPeerBiStream as B, ClientOptions as C, DiscoveryMode as D, ExplicitFileDataSendParams as E, ProtocolBaseName as F, GrantScope as G, ProtocolImplementationKind as H, ISignalingBackend as I, ProtocolLocality as J, SpaceAuthMode as K, LocalDeviceInfo as L, ManagedConnectionRecord as M, NativeManagedSessionStartResult as N, SignalingOptions as O, PeerSessionSnapshot as P, JoinRoomOptions as Q, RuntimeIdentity as R, SignalingMode as S, RoomMember as T, IncomingStreamChannelMetadata as U, RoomCreationMode as V, ScanningLoopOptions as W, ScanningLoopHandle as X, RuntimeBootstrapOptions as Y, RuntimeBootstrapResult as Z, ManagedApplicationRouteOptions as _, Device as a, PeerScope as a0, PeerHealth as a1, ChannelDescriptor as a2, JoinRequest as a3, ConnectionOptions as a4, ManagedDeviceConnectOptions as a5, PeerLifecycleStatus as a6, DeviceStatusSnapshot as b, ResolvedPeerIdentity as c, SignalingEnvelope as d, DeviceEvent as e, SignalingSession as f, SessionEvent as g, BackendPeerUniStream as h, NativeConnectParams as i, NativeConnectResult as j, BackendConnectionState as k, ConnectDeviceResult as l, ConnectDeviceHooks as m, ConnectDeviceOptions as n, ProtocolName as o, ProtocolCapability as p, ProtocolCapabilityMap as q, ApplicationPayloadCrypto as r, ApplicationCryptoStreamTools as s, SpaceTokenProvider as t, AppLimits as u, ApplicationCryptoBiStream as v, ApplicationPayloadReadinessOptions as w, ApplicationPayloadRouteOptions as x, ApplicationPayloadSendOptions as y, DevicePresenceStatus as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrtc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"runtime"
|
|
16
16
|
],
|
|
17
17
|
"author": "Bryant Hargreaves",
|
|
18
|
-
"license": "
|
|
18
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
19
19
|
"homepage": "https://openrtc.app",
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/bluestarburst/
|
|
22
|
+
"url": "git+https://github.com/bluestarburst/openrtc.git"
|
|
23
23
|
},
|
|
24
24
|
"main": "dist/index.js",
|
|
25
25
|
"types": "dist/index.d.ts",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"dist/**/*.js",
|
|
28
28
|
"dist/**/*.d.ts",
|
|
29
29
|
"dist/**/*.wasm",
|
|
30
|
+
"LICENSE",
|
|
30
31
|
"README.md"
|
|
31
32
|
],
|
|
32
33
|
"exports": {
|
|
@@ -42,6 +43,10 @@
|
|
|
42
43
|
"types": "./dist/runtime/index.d.ts",
|
|
43
44
|
"import": "./dist/runtime/index.js"
|
|
44
45
|
},
|
|
46
|
+
"./runtime/device-status": {
|
|
47
|
+
"types": "./dist/runtime/device-status.d.ts",
|
|
48
|
+
"import": "./dist/runtime/device-status.js"
|
|
49
|
+
},
|
|
45
50
|
"./runtime/wasm": {
|
|
46
51
|
"types": "./dist/runtime/WasmRuntimeAdapter.d.ts",
|
|
47
52
|
"import": "./dist/runtime/WasmRuntimeAdapter.js"
|
|
@@ -62,19 +67,26 @@
|
|
|
62
67
|
},
|
|
63
68
|
"scripts": {
|
|
64
69
|
"build": "tsup",
|
|
70
|
+
"build:clean": "rm -rf dist && pnpm run build",
|
|
71
|
+
"release:prepare": "pnpm run build:wasm && pnpm run build:clean",
|
|
65
72
|
"build:types": "tsc --noEmit",
|
|
66
73
|
"build:wasm": "cd ../../crates/openrtc && OPENRTC_REPO_ROOT=$(cd ../.. && pwd) && CARGO_REGISTRY_ROOT=${CARGO_HOME:-$HOME/.cargo} && RUSTUP_TOOLCHAIN=nightly RUSTFLAGS=\"-Zlocation-detail=none --remap-path-prefix=$HOME=/home --remap-path-prefix=$CARGO_REGISTRY_ROOT=/cargo --remap-path-prefix=$OPENRTC_REPO_ROOT=/openrtc\" wasm-pack build --target web --out-dir ../../packages/openrtc/wasm && rm -rf ../../packages/openrtc/wasm/.gitignore",
|
|
67
|
-
"test": "pnpm run test:deterministic",
|
|
68
|
-
"test:deterministic": "
|
|
74
|
+
"test": "pnpm run test:deterministic && pnpm run test:emulator",
|
|
75
|
+
"test:deterministic": "OPENRTC_DETERMINISTIC_TESTS=1 vitest run tests/unit tests/contract",
|
|
69
76
|
"test:emulator": "node ../../tests/emulator/run-emulator-suite.mjs",
|
|
70
|
-
"test:
|
|
71
|
-
"test:
|
|
72
|
-
"test:
|
|
77
|
+
"test:avenues:openrtc": "OPENRTC_EMULATOR_TEST_FILTER='tests/emulator/AvenueRetention.emulator.test.ts tests/emulator/MagicLink.ephemeral-session.wasm-wasm.emulator.test.ts tests/emulator/MultiDeviceStress.transport-matrix.emulator.test.ts tests/emulator/NativeStandaloneAuth.parity.emulator.test.ts tests/emulator/RealOpenRtcAcceptance.native-wasm.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.wasm-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.offer-answer.native-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.reliability.native-wasm.emulator.test.ts' pnpm run test:emulator",
|
|
78
|
+
"test:avenues:tauri": "OPENRTC_EMULATOR_TEST_FILTER='tests/emulator/DriveGrant.revoke-enforcement.desktop-wasm.emulator.test.ts tests/emulator/DriveGrant.zombie-replacement.native-wasm.emulator.test.ts tests/emulator/MagicLink.ephemeral-session.desktop-wasm.emulator.test.ts tests/emulator/ThreeStoreReconciliation.disconnect.desktop-wasm.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.desktop-desktop.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.desktop-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.preexisting-acl-share.desktop-desktop.emulator.test.ts tests/emulator/WebRtcUpgrade.preexisting-acl-share.desktop-wasm.emulator.test.ts' pnpm run test:emulator",
|
|
79
|
+
"test:avenues:full": "OPENRTC_EMULATOR_TRANSPORT_MATRIX_FULL=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_FIVE=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_REFRESH_FOCUS=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_FLICKER=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_RELAY_ONLY=1 OPENRTC_EMULATOR_TEST_FILTER='tests/emulator/AvenueRetention.emulator.test.ts tests/emulator/DriveGrant.revoke-enforcement.desktop-wasm.emulator.test.ts tests/emulator/DriveGrant.zombie-replacement.native-wasm.emulator.test.ts tests/emulator/MagicLink.ephemeral-session.desktop-wasm.emulator.test.ts tests/emulator/MagicLink.ephemeral-session.wasm-wasm.emulator.test.ts tests/emulator/MultiDeviceStress.transport-matrix.emulator.test.ts tests/emulator/NativeStandaloneAuth.parity.emulator.test.ts tests/emulator/RealOpenRtcAcceptance.native-wasm.emulator.test.ts tests/emulator/ThreeStoreReconciliation.disconnect.desktop-wasm.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.desktop-desktop.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.desktop-wasm.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.wasm-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.offer-answer.native-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.preexisting-acl-share.desktop-desktop.emulator.test.ts tests/emulator/WebRtcUpgrade.preexisting-acl-share.desktop-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.reliability.native-wasm.emulator.test.ts' pnpm run test:emulator",
|
|
80
|
+
"test:emulator:running": "FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9100 FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 OPENRTC_FIRESTORE_HOST=127.0.0.1:8082 VITE_USE_EMULATORS=true VITE_OPENRTC_FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 VITE_OPENRTC_RTDB_EMULATOR_HOST=127.0.0.1:9001 vitest run tests/emulator --no-file-parallelism --maxWorkers=1 --maxConcurrency=1",
|
|
81
|
+
"test:acceptance:native:running": "FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9100 FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 OPENRTC_FIRESTORE_HOST=127.0.0.1:8082 VITE_USE_EMULATORS=true VITE_OPENRTC_FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 VITE_OPENRTC_RTDB_EMULATOR_HOST=127.0.0.1:9001 vitest run tests/emulator/RealOpenRtcAcceptance.native-wasm.emulator.test.ts --no-file-parallelism --maxWorkers=1 --maxConcurrency=1",
|
|
82
|
+
"test:live": "pnpm run build:wasm && pnpm run build && vitest run tests/live",
|
|
83
|
+
"test:live:emulator": "FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099 vitest run tests/live",
|
|
73
84
|
"test:watch": "vitest",
|
|
74
85
|
"coverage": "vitest run --coverage",
|
|
75
|
-
"prepublishOnly": "
|
|
86
|
+
"prepublishOnly": "pnpm run release:prepare"
|
|
76
87
|
},
|
|
77
88
|
"dependencies": {
|
|
89
|
+
"@moq/net": "0.1.9",
|
|
78
90
|
"@noble/ciphers": "^2.2.0",
|
|
79
91
|
"@noble/curves": "^1.9.0",
|
|
80
92
|
"@noble/hashes": "^1.8.0",
|
|
@@ -98,6 +110,6 @@
|
|
|
98
110
|
"test": "tests"
|
|
99
111
|
},
|
|
100
112
|
"bugs": {
|
|
101
|
-
"url": "https://github.com/bluestarburst/
|
|
113
|
+
"url": "https://github.com/bluestarburst/openrtc/issues"
|
|
102
114
|
}
|
|
103
115
|
}
|
package/dist/chunk-3VTF5RKW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=["iroh","iroh-quic","iroh-relay","iroh-lan","ble","webrtc","webrtc-lan","moq"],t=new Set(e);function r(n){if(typeof n!="string")return;let o=n.trim().toLowerCase();return t.has(o)?o:void 0}function a(n){let o=r(n);return o==="iroh"||o==="iroh-quic"||o==="iroh-relay"||o==="iroh-lan"||o==="ble"}function i(n){let o=r(n);return o==="iroh-quic"||o==="iroh-lan"||o==="ble"}function l(n){let o=r(n);return o==="webrtc"||o==="webrtc-lan"||o==="moq"}function c(n){let o=r(n);return o==="webrtc"||o==="webrtc-lan"}function s(n){let o=r(n);return o==="webrtc"||o==="moq"}export{e as a,r as b,a as c,i as d,l as e,c as f,s as g};
|