openrtc 1.0.27 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +143 -205
  2. package/dist/DelegatingRuntimeAdapter-DqfHkjLy.d.ts +373 -0
  3. package/dist/ITransport-BsPcaov7.d.ts +16 -0
  4. package/dist/OpenRTCShared-TKAQLONA.js +1 -0
  5. package/dist/{assembly-CscFVHYK.d.ts → OpenRTCShared-ZQPu5LqL.d.ts} +255 -28
  6. package/dist/WasmBridge-2A22U7RU.js +1 -0
  7. package/dist/auth/index.js +1 -1
  8. package/dist/auth/internal.js +1 -1
  9. package/dist/{capabilities-CaqXOIUU.d.ts → capabilities-YSskrE8H.d.ts} +1 -1
  10. package/dist/chunk-2QHDEGVX.js +1 -0
  11. package/dist/chunk-3USHQ7QW.js +3 -0
  12. package/dist/chunk-5LRLWIT5.js +1 -0
  13. package/dist/chunk-6TAVJ46R.js +1 -0
  14. package/dist/chunk-7Z6N46RB.js +2 -0
  15. package/dist/chunk-A3IAG6EL.js +1 -0
  16. package/dist/chunk-BXFXPIXO.js +1 -0
  17. package/dist/chunk-F2XGNLXL.js +2 -0
  18. package/dist/chunk-GW7P3D54.js +1 -0
  19. package/dist/chunk-IEQTFQ3Q.js +1 -0
  20. package/dist/chunk-K37WVIZL.js +1 -0
  21. package/dist/chunk-N26S7V4N.js +1 -0
  22. package/dist/chunk-N4SX7C3W.js +2 -0
  23. package/dist/chunk-NB4H5TP3.js +1 -0
  24. package/dist/chunk-NT5YHZQH.js +1 -0
  25. package/dist/chunk-PODAMIL6.js +2 -0
  26. package/dist/chunk-RD3JEGGF.js +2 -0
  27. package/dist/chunk-UEYM6WTT.js +2 -0
  28. package/dist/chunk-VK6KX433.js +1 -0
  29. package/dist/chunk-YBXGNKM7.js +2 -0
  30. package/dist/chunk-YQWQDTQ3.js +2 -0
  31. package/dist/factories-SIVMTIHJ.js +1 -0
  32. package/dist/index.d.ts +12 -65
  33. package/dist/index.js +1 -1
  34. package/dist/ipcFactory-QY44OIKA.js +1 -0
  35. package/dist/native.d.ts +10 -15
  36. package/dist/native.js +1 -1
  37. package/dist/openrtc_bg.wasm +0 -0
  38. package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -3
  39. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  40. package/dist/runtime/device-status.d.ts +3 -2
  41. package/dist/runtime/index.d.ts +100 -15
  42. package/dist/runtime/index.js +2 -1
  43. package/dist/runtime/legacy.d.ts +18 -0
  44. package/dist/runtime/legacy.js +1 -0
  45. package/dist/runtime/tauri.d.ts +4 -4
  46. package/dist/runtime/tauri.js +1 -1
  47. package/dist/{tauri-BpsecNrp.d.ts → tauri-Cz9n17g8.d.ts} +2 -2
  48. package/dist/testing.d.ts +30 -0
  49. package/dist/testing.js +1 -0
  50. package/dist/transport/index.d.ts +47 -7
  51. package/dist/transport/index.js +1 -1
  52. package/dist/{types-zT2QwuCv.d.ts → types-BVJr065k.d.ts} +43 -3
  53. package/dist/types-DNl4KHHY.d.ts +195 -0
  54. package/dist/{types-BJU2GoVb.d.ts → types-DkgaCyqS.d.ts} +11 -17
  55. package/package.json +19 -4
  56. package/dist/DelegatingRuntimeAdapter-Cg3jFk1b.d.ts +0 -133
  57. package/dist/chunk-4IK5EKHY.js +0 -2
  58. package/dist/chunk-BW6OKBHV.js +0 -2
  59. package/dist/chunk-EVJYUIBK.js +0 -1
  60. package/dist/chunk-H5VWKP4Q.js +0 -2
  61. package/dist/chunk-HYHVKPQN.js +0 -3
  62. package/dist/chunk-LAUABWCB.js +0 -2
  63. package/dist/chunk-OCSZA6PK.js +0 -2
  64. package/dist/chunk-OMDHDMDJ.js +0 -1
  65. package/dist/chunk-QT2ASNI3.js +0 -1
  66. package/dist/framing-zRvEKOld.d.ts +0 -29
  67. package/dist/spaceTokens-CiwcKKr2.d.ts +0 -297
@@ -1,7 +1,7 @@
1
+ import { H as GrantScope, q as ISignalingBackend, Y as ConnectDeviceHooks, Z as ConnectDeviceOptions, _ as ConnectDeviceResult, u as ManagedConnectionRecord, m as PeerSessionSnapshot, v as ResolvedPeerIdentity, $ as AppLimits, N as NativeConnectParams, z as NativeConnectResult, E as ExplicitFileDataSendParams } from './types-BVJr065k.js';
1
2
  import { A as AuthContext } from './IEngineBridge-BbsT8hof.js';
2
- import { G as GrantScope, I as ISignalingBackend, b as ConnectDeviceHooks, c as ConnectDeviceOptions, C as ConnectDeviceResult, M as ManagedConnectionRecord, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, Y as AppLimits, p as NativeConnectParams, q as NativeConnectResult, E as ExplicitFileDataSendParams } from './types-zT2QwuCv.js';
3
- import { h as RuntimePeerState, s as RuntimeConnectionStateSnapshot, j as RuntimePeerReadinessSnapshot, i as RuntimePeerConnectOptions, C as Connection, n as RuntimeIncomingStream, R as RuntimeClientOptions, H as RuntimeAuthIdentity, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, c as RuntimeDevice, a as RuntimeManagedSessionOptions, b as RuntimeManagedSession, d as RuntimeDeviceStatusSnapshot, e as RuntimeDeviceConnectOptions, X as RuntimeSession, q as RuntimeJoinRoomOptions, r as RuntimeRoomMember, K as RuntimeConnectionTarget, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, m as RuntimePeerStreamOptions, v as RuntimeRawConnection, l as RuntimeChannelDescriptor, V as RuntimePresenceLoopOptions, k as RuntimePeerHealth, t as RuntimeApplicationPayloadReadinessOptions, u as RuntimeConnectionEvent } from './types-BJU2GoVb.js';
4
- import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './capabilities-CaqXOIUU.js';
3
+ import { b as RuntimePeerState, c as RuntimeConnectionStateSnapshot, d as RuntimePeerReadinessSnapshot, e as RuntimePeerConnectOptions, C as Connection, f as RuntimeIncomingStream, a as RuntimeClientOptions, g as RuntimeAuthIdentity, h as RuntimeLocalDeviceInfo, i as RuntimeLocalDeviceProfile, j as RuntimeDevice, k as RuntimeManagedSessionOptions, l as RuntimeManagedSession, m as RuntimeDeviceStatusSnapshot, n as RuntimeDeviceConnectOptions, o as RuntimeSession, p as RuntimeJoinRoomOptions, q as RuntimeRoomMember, r as RuntimeConnectionTarget, s as RuntimeScopedChannelOptions, t as RuntimeScopedLogicalChannel, u as RuntimePeerStreamOptions, v as RuntimeRawConnection, R as RuntimeChannelDescriptor, w as RuntimePresenceLoopOptions, x as RuntimePeerHealth, y as RuntimeApplicationPayloadReadinessOptions, z as RuntimeConnectionEvent } from './types-DkgaCyqS.js';
4
+ import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './capabilities-YSskrE8H.js';
5
5
 
6
6
  /**
7
7
  * Coalesced peer reconciliation scheduler and full reconcile orchestration.
@@ -75,30 +75,6 @@ interface Session {
75
75
  /** Tear down all subscriptions and disconnect scope-tagged connections. */
76
76
  dispose(): void;
77
77
  }
78
- declare class ScopedSession implements Session {
79
- readonly scope: string;
80
- private _disposed;
81
- private readonly runtime;
82
- private readonly allowAllPeers;
83
- private readonly allowedPeerIds;
84
- private readonly cleanups;
85
- constructor(runtime: RuntimeClient, options: SessionOptions);
86
- get disposed(): boolean;
87
- /** Returns true when this session should receive events for this peer. */
88
- private matchesPeer;
89
- private matchesConnectionState;
90
- private matchesStream;
91
- watchPeerStates(callback: (peers: RuntimePeerState[]) => void): () => void;
92
- onConnectionStateChange(callback: (state: RuntimeConnectionStateSnapshot) => void): (() => void) | Promise<() => void>;
93
- listConnectedPeers(): RuntimePeerState[];
94
- getPeerReadiness(peerId: string): Promise<RuntimePeerReadinessSnapshot>;
95
- connectPeer(options: RuntimePeerConnectOptions): Promise<Connection>;
96
- disconnectPeer(peerId: string): Promise<void>;
97
- onIncomingStream(callback: (stream: RuntimeIncomingStream) => void): () => void;
98
- dispose(): void;
99
- private releaseScopedPeersOnDispose;
100
- private assertNotDisposed;
101
- }
102
78
 
103
79
  /**
104
80
  * Phase 4 of the OpenRTC auth + connection remediation plan
@@ -320,6 +296,7 @@ declare class RuntimeClient {
320
296
  private managedSessionOptions;
321
297
  private managedSessionTransition;
322
298
  private managedSessionStartInFlight;
299
+ private terminalShutdown;
323
300
  private readonly managedReconciliationTasks;
324
301
  private managedReconciliationTimer;
325
302
  private readonly managedReconciliationFollowupTimers;
@@ -617,6 +594,14 @@ declare class RuntimeClient {
617
594
  connect(): Promise<void>;
618
595
  /** Disconnect from the runtime (alias for stop()) */
619
596
  disconnect(): void;
597
+ /**
598
+ * Await the provider-neutral terminal lifecycle before destroying this
599
+ * runtime instance. Consumers that may create a replacement runtime in the
600
+ * same page should use this instead of composing setOffline(), stop(), and
601
+ * destroy() themselves: the active adapter owns presence, coordination
602
+ * sockets, session readers, and scoped connection actors.
603
+ */
604
+ shutdown(): Promise<void>;
620
605
  /**
621
606
  * Terminal teardown of the runtime instance. Unlike stop()/disconnect()
622
607
  * (which only stop the listen loop and are used during normal operation),
@@ -715,4 +700,246 @@ interface PlutoRuntimeAssembly<TBackend extends RuntimeAdapterWithAuth = Runtime
715
700
  setAutoConnectExcluded(deviceId: string, excluded: boolean): Promise<void>;
716
701
  }
717
702
 
718
- export { DriveGrantActorError as D, OPENRTC_RUNTIME_POLICY as O, type PeerReconciliationStats as P, RuntimeClient as R, ScopedSession as S, type RuntimePolicySnapshot as a, type PlutoRuntimeAssembly as b, type Session as c, type SessionOptions as d, type RuntimeFactoryOptions as e, type DriveGrantActorErrorKind as f, getRuntimePolicy as g, DriveGrantActorHandle as h, type DriveGrantActorHandleOptions as i, DriveGrantActorRegistry as j, type DriveGrantActorState as k, type DriveGrantClose as l, type DriveGrantDial as m, type DriveGrantConnectionKey as n, type DriveGrantLogicalChannelHandle as o, type DriveGrantPreferredTransport as p, driveGrantConnectionKey as q, driveGrantConnectionKeyToString as r };
703
+ type OpenRTCChannelConnectOptions = Omit<RuntimeScopedChannelOptions, 'scope' | 'deviceId' | 'ticket'> & {
704
+ /**
705
+ * Device selected from `client.devices.*`. Passing the device object lets
706
+ * OpenRTC reuse its current ticket for native and ticket-gated routes.
707
+ */
708
+ device?: string | RuntimeDevice;
709
+ deviceId?: string | null;
710
+ ticket?: string;
711
+ /**
712
+ * Logical channel lifecycle scope. Most app channels should use the default
713
+ * `session`; pass a custom scope only when you intentionally manage peer
714
+ * lifecycle separately from the channel.
715
+ */
716
+ scope?: RuntimeScopedChannelOptions['scope'];
717
+ };
718
+ type OpenRTCDeviceSessionOptions = Omit<RuntimeManagedSessionOptions, 'platform'> & {
719
+ /**
720
+ * Runtime host for the managed user-device session. Normal apps can omit
721
+ * this: `OpenRTC(...)` defaults to `web`, and `OpenRTC.native(...)` defaults
722
+ * to `native`.
723
+ */
724
+ platform?: RuntimeManagedSessionOptions['platform'];
725
+ };
726
+ interface OpenRTCDeviceNamespace {
727
+ startSession(options?: OpenRTCDeviceSessionOptions): Promise<RuntimeManagedSession>;
728
+ stopSession(options?: {
729
+ preserveBackendSession?: boolean;
730
+ }): Promise<void>;
731
+ list(): Promise<RuntimeDevice[]>;
732
+ listWithStatus(): Promise<RuntimeDeviceStatusSnapshot[]>;
733
+ watch(callback: (devices: RuntimeDevice[]) => void): () => void;
734
+ watchWithStatus(callback: (devices: RuntimeDeviceStatusSnapshot[]) => void): () => void;
735
+ connect(device: string | RuntimeDevice, options?: RuntimeDeviceConnectOptions): Promise<ConnectDeviceResult>;
736
+ /**
737
+ * @deprecated Use `devices.connect()`. Retry and route recovery are owned by
738
+ * OpenRTC; legacy consumer-provided connection hooks are ignored.
739
+ */
740
+ connectWithRetry(device: string | RuntimeDevice, hooks: ConnectDeviceHooks, options: ConnectDeviceOptions): Promise<ConnectDeviceResult>;
741
+ disconnect(deviceId: string): Promise<void>;
742
+ update(deviceId: string, updates: {
743
+ deviceName?: string;
744
+ capabilities?: RuntimeDevice['capabilities'];
745
+ metadata?: string;
746
+ }): Promise<void>;
747
+ delete(deviceId: string): Promise<void>;
748
+ localId(): Promise<string | null>;
749
+ localInfo(): Promise<RuntimeLocalDeviceInfo | null>;
750
+ localProfile(options?: {
751
+ deviceName?: string;
752
+ localDeviceId?: string | null;
753
+ platform?: 'native' | 'web';
754
+ userId?: string | null;
755
+ }): Promise<RuntimeLocalDeviceProfile>;
756
+ updateLocalName(deviceName: string): Promise<RuntimeLocalDeviceInfo | null>;
757
+ }
758
+ interface OpenRTCPeerNamespace {
759
+ watch(callback: (peers: RuntimePeerState[]) => void): () => void;
760
+ watchLifecycle(callback: (peers: RuntimePeerState[]) => void): () => void;
761
+ get(id: string): RuntimePeerState | undefined;
762
+ listConnected(): RuntimePeerState[];
763
+ connect(options: RuntimePeerConnectOptions): Promise<Connection>;
764
+ disconnect(id: string, scope?: string): Promise<void>;
765
+ forceDisconnect(id: string): Promise<void>;
766
+ session(id: string): Promise<PeerSessionSnapshot | null>;
767
+ sessions(): Promise<PeerSessionSnapshot[]>;
768
+ waitConnected(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
769
+ readiness(id: string, timeoutMs?: number): Promise<RuntimePeerReadinessSnapshot>;
770
+ health(id: string): Promise<RuntimePeerHealth>;
771
+ identity(id: string): Promise<ResolvedPeerIdentity>;
772
+ addScope(id: string, scope?: string): RuntimePeerState | undefined;
773
+ releaseScope(id: string, scope?: string): RuntimePeerState | undefined;
774
+ scopes(id: string): string[];
775
+ refresh(): Promise<RuntimePeerState[]>;
776
+ }
777
+ interface OpenRTCChannelNamespace {
778
+ register(descriptor: RuntimeChannelDescriptor): void;
779
+ unregister(channelId: string): void;
780
+ list(): RuntimeChannelDescriptor[];
781
+ openBi(id: string, channelId: string, options?: Omit<RuntimePeerStreamOptions, 'channelId'>): Promise<{
782
+ connection: Connection;
783
+ readable: ReadableStream<Uint8Array>;
784
+ writable: WritableStream<Uint8Array>;
785
+ }>;
786
+ openUni(id: string, channelId: string, options?: Omit<RuntimePeerStreamOptions, 'channelId'>): Promise<{
787
+ connection: Connection;
788
+ writable: WritableStream<Uint8Array>;
789
+ }>;
790
+ onIncoming(callback: (stream: RuntimeIncomingStream) => boolean | void): () => void;
791
+ onIncomingChannel(channelId: string, callback: (stream: RuntimeIncomingStream & {
792
+ channel: NonNullable<RuntimeIncomingStream['channel']>;
793
+ }) => boolean | void): () => void;
794
+ connect(options: OpenRTCChannelConnectOptions): Promise<RuntimeScopedLogicalChannel>;
795
+ connectScoped(options: RuntimeScopedChannelOptions): Promise<RuntimeScopedLogicalChannel>;
796
+ }
797
+ interface OpenRTCRoomNamespace {
798
+ create(roomId?: string): Promise<string>;
799
+ join(roomId: string, options?: RuntimeJoinRoomOptions): Promise<Connection[]>;
800
+ leave(roomId: string): Promise<void>;
801
+ watch(roomId: string, callback: (members: RuntimeRoomMember[]) => void): () => void;
802
+ members(roomId: string): Promise<RuntimeRoomMember[]>;
803
+ }
804
+ interface OpenRTCTicketNamespace {
805
+ raw(): Promise<string>;
806
+ share(options?: {
807
+ maxConnections?: number;
808
+ }): Promise<string>;
809
+ grant(scope: GrantScope, options?: {
810
+ maxConnections?: number;
811
+ }): Promise<string>;
812
+ revoke(scope: GrantScope): Promise<string[]>;
813
+ }
814
+ interface OpenRTCDiagnosticsNamespace {
815
+ status(): Promise<{
816
+ runtime: 'tauri' | 'browser' | 'unknown';
817
+ wasmLoaded: boolean;
818
+ localNodeId?: string;
819
+ userId?: string;
820
+ }>;
821
+ policy(): RuntimePolicySnapshot;
822
+ capabilities(): RuntimeCapabilities;
823
+ capabilityProfile(): RuntimeCapabilityProfile;
824
+ connectionStates(): Promise<RuntimeConnectionStateSnapshot[]>;
825
+ onConnectionStateChange(callback: (state: RuntimeConnectionStateSnapshot) => void): Promise<() => void> | (() => void);
826
+ connections(): Connection[];
827
+ applicationReadyConnections(options?: RuntimeApplicationPayloadReadinessOptions): Connection[];
828
+ onConnection(callback: (connection: Connection) => void): () => void;
829
+ onDisconnection(callback: (connection: Connection) => void): () => void;
830
+ onConnectionEvent(callback: (event: RuntimeConnectionEvent) => void): () => void;
831
+ forceReconnectSnapshot(): void;
832
+ peerReconciliation(): Readonly<PeerReconciliationStats>;
833
+ }
834
+ interface OpenRTCAdvancedNamespace {
835
+ readonly runtime: RuntimeClient;
836
+ readonly assembly: PlutoRuntimeAssembly;
837
+ nodeId(): Promise<string>;
838
+ nodeIdFromTicket(ticket: string): Promise<string | null>;
839
+ endpointTicket(): Promise<string>;
840
+ connectRaw(target: {
841
+ ticket: string;
842
+ timeoutMs?: number;
843
+ }): Promise<RuntimeRawConnection>;
844
+ openBi(nodeId: string): Promise<{
845
+ readable: ReadableStream<Uint8Array>;
846
+ writable: WritableStream<Uint8Array>;
847
+ }>;
848
+ openUni(nodeId: string): Promise<WritableStream<Uint8Array>>;
849
+ isConnected(nodeId: string): Promise<boolean>;
850
+ disconnectNode(nodeId: string): Promise<void>;
851
+ setAutoConnectExcluded(deviceId: string, excluded: boolean): Promise<void>;
852
+ notifyNetworkChange(reason?: string): Promise<void>;
853
+ }
854
+ /**
855
+ * OpenRTCClient extends RuntimeClient with auth helpers that were
856
+ * previously only available on PlutoRuntimeAssembly.
857
+ *
858
+ * This is the unified type returned by OpenRTC() and OpenRTC.native().
859
+ */
860
+ interface OpenRTCClient extends RuntimeClient {
861
+ readonly devices: OpenRTCDeviceNamespace;
862
+ readonly peers: OpenRTCPeerNamespace;
863
+ readonly channels: OpenRTCChannelNamespace;
864
+ readonly rooms: OpenRTCRoomNamespace;
865
+ readonly tickets: OpenRTCTicketNamespace;
866
+ readonly diagnostics: OpenRTCDiagnosticsNamespace;
867
+ readonly advanced: OpenRTCAdvancedNamespace;
868
+ /** @deprecated Use setAuth() instead */
869
+ setAuthContext(context: AuthContext | null): Promise<void>;
870
+ /** Set auth context for the runtime */
871
+ setAuth(context: AuthContext | null): Promise<void>;
872
+ /** Sync Pluto-hosted auth to the runtime */
873
+ syncPlutoAuth(options?: {
874
+ userId?: string | null;
875
+ forceRefresh?: boolean;
876
+ }): Promise<void>;
877
+ /** Bind Pluto auth host to auto-sync on token changes */
878
+ bindPlutoAuthHost(): () => void;
879
+ /** Sign in via Pluto SSO */
880
+ signIn(): Promise<void>;
881
+ /** Sign out and clear auth context */
882
+ signOut(): Promise<void>;
883
+ /**
884
+ * @deprecated Use `client.devices.startSession(...)` for the public
885
+ * user-device avenue lifecycle. This top-level method remains for
886
+ * RuntimeClient compatibility and advanced integrations.
887
+ */
888
+ startManagedSession(options: RuntimeManagedSessionOptions): Promise<RuntimeManagedSession>;
889
+ /**
890
+ * @deprecated Use `client.devices.stopSession(...)` for the public
891
+ * user-device avenue lifecycle.
892
+ */
893
+ stopManagedSession(options?: {
894
+ preserveBackendSession?: boolean;
895
+ }): Promise<void>;
896
+ /** @deprecated Use `client.rooms.create(...)`. */
897
+ createRoom(roomId?: string): Promise<string>;
898
+ /** @deprecated Use `client.rooms.join(...)`. */
899
+ joinRoom(roomId: string, options?: RuntimeJoinRoomOptions): Promise<Connection[]>;
900
+ /** @deprecated Use `client.rooms.leave(...)`. */
901
+ leaveRoom(roomId: string): Promise<void>;
902
+ /** @deprecated Use `client.rooms.watch(...)`. */
903
+ watchRoom(roomId: string, callback: (members: RuntimeRoomMember[]) => void): () => void;
904
+ /** @deprecated Use `client.rooms.members(...)`. */
905
+ getRoomMembers(roomId: string): Promise<RuntimeRoomMember[]>;
906
+ /** @deprecated Use `client.tickets.raw(...)`. */
907
+ getInvite(): Promise<string>;
908
+ /** @deprecated Use `client.tickets.raw(...)`. */
909
+ getTicket(): Promise<string>;
910
+ /** @deprecated Use `client.tickets.share(...)` or `client.tickets.grant(...)`. */
911
+ getTicketWithToken(scope: GrantScope, maxConnections?: number): Promise<string>;
912
+ /** @deprecated Use `client.tickets.revoke(...)`. */
913
+ revokeTokensByScope(scope: GrantScope): Promise<string[]>;
914
+ /** @deprecated Use `client.peers.connect(...)`. */
915
+ connectPeer(options: RuntimePeerConnectOptions): Promise<Connection>;
916
+ /** @deprecated Use `client.peers.connect(...)`. */
917
+ connectTo(options: RuntimePeerConnectOptions): Promise<Connection>;
918
+ /** @deprecated Use `client.peers.waitConnected(...)`. */
919
+ waitForConnectedPeer(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
920
+ /** @deprecated Use `client.channels.connect(...)`; use `client.channels.connectScoped(...)` only for custom lifecycle scopes. */
921
+ connectScopedChannel(options: RuntimeScopedChannelOptions): Promise<RuntimeScopedLogicalChannel>;
922
+ /** @deprecated Use `client.channels.openBi(...)`. */
923
+ openPeerBi(id: string, options?: RuntimePeerStreamOptions): Promise<{
924
+ connection: Connection;
925
+ readable: ReadableStream<Uint8Array>;
926
+ writable: WritableStream<Uint8Array>;
927
+ }>;
928
+ /** @deprecated Use `client.channels.openUni(...)`. */
929
+ openPeerUni(id: string, options?: RuntimePeerStreamOptions): Promise<{
930
+ connection: Connection;
931
+ writable: WritableStream<Uint8Array>;
932
+ }>;
933
+ /**
934
+ * Access to the underlying PlutoRuntimeAssembly for backward compatibility.
935
+ * @deprecated Access methods directly on the client instead.
936
+ */
937
+ readonly runtime: RuntimeClient;
938
+ /**
939
+ * Access to the underlying PlutoRuntimeAssembly for backward compatibility.
940
+ * @internal
941
+ */
942
+ readonly _assembly: PlutoRuntimeAssembly;
943
+ }
944
+
945
+ export { DriveGrantActorError as D, type OpenRTCPeerNamespace as O, type PlutoRuntimeAssembly as P, type RuntimeFactoryOptions as R, type OpenRTCChannelNamespace as a, type OpenRTCDiagnosticsNamespace as b, type OpenRTCDeviceNamespace as c, type OpenRTCClient as d, type PeerReconciliationStats as e, OPENRTC_RUNTIME_POLICY as f, RuntimeClient as g, type RuntimePolicySnapshot as h, type DriveGrantActorErrorKind as i, DriveGrantActorHandle as j, type DriveGrantActorHandleOptions as k, DriveGrantActorRegistry as l, type DriveGrantActorState as m, type DriveGrantClose as n, type DriveGrantDial as o, type DriveGrantConnectionKey as p, type DriveGrantLogicalChannelHandle as q, type DriveGrantPreferredTransport as r, getRuntimePolicy as s, driveGrantConnectionKey as t, driveGrantConnectionKeyToString as u };
@@ -0,0 +1 @@
1
+ export{w as WasmBridge}from'./chunk-YBXGNKM7.js';import'./chunk-VK6KX433.js';import'./chunk-NT5YHZQH.js';import'./chunk-N26S7V4N.js';import'./chunk-NB4H5TP3.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';
@@ -1 +1 @@
1
- export{H as authHost,G as getAuthHost,F as registerDesktopAuthRelay}from'../chunk-OCSZA6PK.js';import'../chunk-C7YN5MSV.js';
1
+ import {c}from'../chunk-N4SX7C3W.js';export{d as authHost,b as getAuthHost,a as registerDesktopAuthRelay}from'../chunk-N4SX7C3W.js';import'../chunk-BXFXPIXO.js';import'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';c();
@@ -1 +1 @@
1
- export{F as registerDesktopAuthRelay}from'../chunk-OCSZA6PK.js';import'../chunk-C7YN5MSV.js';
1
+ import {c}from'../chunk-N4SX7C3W.js';export{a as registerDesktopAuthRelay}from'../chunk-N4SX7C3W.js';import'../chunk-BXFXPIXO.js';import'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';c();
@@ -98,4 +98,4 @@ declare function runtimeCapabilitiesForBrowserHost(host?: BrowserRuntimeCapabili
98
98
  declare function runtimeCapabilitiesFromNativeStatus(status: NativeRuntimeStatusSnapshot | null | undefined, allowWasmFallback?: boolean): RuntimeCapabilities;
99
99
  declare function runtimeCapabilityProfile(capabilities: RuntimeCapabilities): RuntimeCapabilityProfile;
100
100
 
101
- export { BROWSER_WASM_RUNTIME_CAPABILITIES as B, NATIVE_IPC_RUNTIME_CAPABILITIES as N, type RuntimeCapabilities as R, type RuntimeCapabilityProfile as a, type RuntimeAdapterKind as b, type BrowserRuntimeCapabilityHost as c, type NativeRuntimeStatusSnapshot as d, type NativeRuntimeTransportFeatureStatus as e, cloneRuntimeCapabilities as f, runtimeCapabilitiesFromNativeStatus as g, runtimeCapabilityProfile as h, runtimeCapabilitiesForBrowserHost as r };
101
+ export { BROWSER_WASM_RUNTIME_CAPABILITIES as B, NATIVE_IPC_RUNTIME_CAPABILITIES as N, type RuntimeCapabilities as R, type RuntimeCapabilityProfile as a, type BrowserRuntimeCapabilityHost as b, type NativeRuntimeStatusSnapshot as c, type NativeRuntimeTransportFeatureStatus as d, type RuntimeAdapterKind as e, cloneRuntimeCapabilities as f, runtimeCapabilitiesFromNativeStatus as g, runtimeCapabilityProfile as h, runtimeCapabilitiesForBrowserHost as r };
@@ -0,0 +1 @@
1
+ import {r}from'./chunk-RD3JEGGF.js';function O(i){let s=r({...i});if("auth"in i&&!i.authMode){let n=i.auth;s.authMode=n==="none"?"anonymous":n;}if("identity"in i){let n=i.identity,r=n==="temporary"?"ephemeral":n;!i.deviceIdPersistence&&!i.nodeIdPersistence&&(s.deviceIdPersistence=r),!i.endpointIdPersistence&&!i.nodeIdPersistence&&(s.endpointIdPersistence=r);}return "namespace"in i&&!i.storagePrefix&&(s.storagePrefix=i.namespace),"privacy"in i&&i.strictMode===void 0&&(s.strictMode=!!i.privacy),s}function I(i,s){let n=i.runtime,r=Object.create(n),l=async e=>{if(typeof e!="string")return e;let o=(await n.listDevices()).find(c=>c.deviceId===e);if(!o)throw new Error(`OpenRTC device '${e}' is not currently discoverable.`);return o},u=async e=>({...e,localDeviceId:e?.localDeviceId??await n.getLocalDeviceId()??""}),R=async e=>{let{device:t,scope:o,...c}=e,a=c.deviceId??(typeof t=="string"?t:t?.deviceId)??null,m=c.ticket??(typeof t=="string"?void 0:t?.ticket);a&&!m&&(m=(await l(a).catch(()=>null))?.ticket);let d={...c,scope:o??"session"};return a&&(d.deviceId=a),m&&(d.ticket=m),d},g={list:()=>n.listDevices(),startSession:(e={})=>n.startManagedSession({...e,platform:e.platform??s}),stopSession:e=>n.stopManagedSession(e),listWithStatus:()=>n.listDevicesWithStatus(),watch:e=>n.watchDevices(e),watchWithStatus:e=>n.watchDevicesWithStatus(e),connect:async(e,t)=>n.connectDevice(await l(e),await u(t)),connectWithRetry:async(e,t,o)=>n.connectDeviceWithRetry(await l(e),t,o),disconnect:e=>n.disconnectDevice(e),update:(e,t)=>n.updateDevice(e,t),delete:e=>n.deleteDevice(e),localId:()=>n.getLocalDeviceId(),localInfo:()=>n.getLocalDeviceInfo(),localProfile:e=>n.getLocalDeviceProfile(e),updateLocalName:e=>n.updateLocalDeviceName(e)},v={watch:e=>n.watchPeerStates(e),watchLifecycle:e=>n.watchPeerLifecycle(e),get:e=>n.getPeerState(e),listConnected:()=>n.listConnectedPeers(),connect:e=>n.connectPeer(e),disconnect:(e,t)=>n.disconnectPeer(e,t),forceDisconnect:e=>n.forceDisconnectPeer(e),session:e=>n.getPeerSession(e),sessions:()=>n.listPeerSessions(),waitConnected:(e,t)=>n.waitForConnectedPeer(e,t),readiness:(e,t)=>n.getPeerReadiness(e,t),health:e=>n.getPeerHealth(e),identity:e=>n.resolvePeerIdentity(e),addScope:(e,t)=>n.addPeerScope(e,t),releaseScope:(e,t)=>n.releasePeerScope(e,t),scopes:e=>n.getPeerScopes(e),refresh:()=>n.refreshPeerSnapshot()},C={register:e=>n.registerChannel(e),unregister:e=>n.unregisterChannel(e),list:()=>n.listChannels(),openBi:(e,t,o)=>n.openPeerBi(e,{...o,channelId:t}),openUni:(e,t,o)=>n.openPeerUni(e,{...o,channelId:t}),onIncoming:e=>n.onIncomingStream(e),onIncomingChannel:(e,t)=>n.onIncomingChannelStream(e,o=>{if(o.channel)return t(o)}),connect:async e=>n.connectScopedChannel(await R(e)),connectScoped:e=>n.connectScopedChannel(e)},P={create:e=>n.createRoom(e),join:(e,t)=>n.joinRoom(e,t),leave:e=>n.leaveRoom(e),watch:(e,t)=>n.watchRoom(e,t),members:e=>n.getRoomMembers(e)},h={raw:()=>n.getInvite(),share:e=>n.getTicketWithToken("share",e?.maxConnections??1),grant:(e,t)=>n.getTicketWithToken(e,t?.maxConnections??0),revoke:e=>n.revokeTokensByScope(e)},S={status:()=>n.getRuntimeStatus(),policy:()=>n.getRuntimePolicy(),capabilities:()=>n.getRuntimeCapabilities(),capabilityProfile:()=>n.getCapabilityProfile(),connectionStates:()=>n.getConnectionStates(),onConnectionStateChange:e=>n.onConnectionStateChange(e),connections:()=>n.getConnections(),applicationReadyConnections:e=>n.getApplicationReadyConnections(e),onConnection:e=>n.onConnection(e),onDisconnection:e=>n.onDisconnection(e),onConnectionEvent:e=>n.onConnectionEvent(e),forceReconnectSnapshot:()=>n.forceReconnectSnapshot(),peerReconciliation:()=>n.getPeerReconciliationStats()},b={runtime:n,assembly:i,nodeId:()=>n.getNodeId(),nodeIdFromTicket:e=>n.getNodeIdFromTicket(e),endpointTicket:()=>n.getEndpointTicket(),connectRaw:e=>n.connectRaw(e),openBi:e=>n.openBi(e),openUni:e=>n.openUni(e),isConnected:e=>n.isConnected(e),disconnectNode:e=>n.disconnectNode(e),setAutoConnectExcluded:(e,t)=>n.setAutoConnectExcluded(e,t),notifyNetworkChange:e=>n.notifyNetworkChange(e)};return Object.defineProperties(r,{devices:{get:()=>g,enumerable:true},peers:{get:()=>v,enumerable:true},channels:{get:()=>C,enumerable:true},rooms:{get:()=>P,enumerable:true},tickets:{get:()=>h,enumerable:true},diagnostics:{get:()=>S,enumerable:true},advanced:{get:()=>b,enumerable:true},setAuth:{value:e=>i.setAuthContext(e),enumerable:true,writable:true,configurable:true},setAuthContext:{value:e=>i.setAuthContext(e),enumerable:true,writable:true,configurable:true},syncPlutoAuth:{value:e=>i.syncPlutoAuth(e),enumerable:true,writable:true,configurable:true},bindPlutoAuthHost:{value:()=>i.bindPlutoAuthHost(),enumerable:true,writable:true,configurable:true},signIn:{value:()=>i.signInWithPluto(),enumerable:true,writable:true,configurable:true},signOut:{value:()=>i.signOut(),enumerable:true,writable:true,configurable:true},runtime:{get:()=>n,enumerable:false},_assembly:{get:()=>i,enumerable:false}}),r}export{O as a,I as b};