openrtc 2.0.0-rc.11 → 2.0.0-rc.13

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 (66) hide show
  1. package/dist/{DelegatingRuntimeAdapter-BLNigcS4.d.ts → DelegatingRuntimeAdapter-Btvzi1s9.d.ts} +2 -2
  2. package/dist/OpenRTCShared-LDKG5RPN.js +1 -0
  3. package/dist/WasmBridge-7AS445EV.js +1 -0
  4. package/dist/chunk-GBIGWN5H.js +3 -0
  5. package/dist/{chunk-C6PAXO3N.js → chunk-MHQHFEYX.js} +1 -1
  6. package/dist/chunk-PQK5SJ47.js +1 -0
  7. package/dist/{chunk-23XC6TGK.js → chunk-QGGQ3SRF.js} +1 -1
  8. package/dist/{chunk-RD3JEGGF.js → chunk-QHSM5NFZ.js} +2 -2
  9. package/dist/{chunk-KWXAZUAZ.js → chunk-RLRBSNLB.js} +1 -1
  10. package/dist/{chunk-7Z6N46RB.js → chunk-RRMBD5OL.js} +1 -1
  11. package/dist/chunk-TAGQBG3A.js +2 -0
  12. package/dist/chunk-Z2WVSXPW.js +1 -0
  13. package/dist/chunk-ZI47WSO6.js +1 -0
  14. package/dist/dist-FIVA6EPA.js +277 -0
  15. package/dist/factories-CKVQIMP6.js +1 -0
  16. package/dist/index.d.ts +4 -6
  17. package/dist/index.js +1 -1
  18. package/dist/ipcFactory-KNWHT65X.js +1 -0
  19. package/dist/native.d.ts +4 -7
  20. package/dist/native.js +1 -1
  21. package/dist/openrtc-CBUEX4W4.js +2 -0
  22. package/dist/openrtc_bg.wasm +0 -0
  23. package/dist/runtime/WasmRuntimeAdapter.d.ts +2 -2
  24. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  25. package/dist/runtime/device-status.d.ts +2 -2
  26. package/dist/runtime/index.d.ts +22 -59
  27. package/dist/runtime/index.js +1 -2
  28. package/dist/testing.d.ts +7 -17
  29. package/dist/testing.js +1 -1
  30. package/dist/transport/index.d.ts +2 -2
  31. package/dist/transport/index.js +1 -1
  32. package/dist/{OpenRTCShared-BswnbjpG.d.ts → types-1ivghCqV.d.ts} +257 -7
  33. package/dist/{types-D0pqNSOf.d.ts → types-Br65RHyy.d.ts} +2 -2
  34. package/dist/{types-BHePJWbM.d.ts → types-DHuvdODq.d.ts} +1 -1
  35. package/package.json +1 -25
  36. package/dist/OpenRTCShared-TKAQLONA.js +0 -1
  37. package/dist/WasmBridge-B7NTRYN5.js +0 -1
  38. package/dist/auth/index.d.ts +0 -78
  39. package/dist/auth/index.js +0 -1
  40. package/dist/auth/internal.d.ts +0 -4
  41. package/dist/auth/internal.js +0 -1
  42. package/dist/chunk-2QHDEGVX.js +0 -1
  43. package/dist/chunk-4DFFBEWY.js +0 -1
  44. package/dist/chunk-A7AMB23L.js +0 -2
  45. package/dist/chunk-BXFXPIXO.js +0 -1
  46. package/dist/chunk-EUNCYGJD.js +0 -1
  47. package/dist/chunk-GQYLYKW4.js +0 -1
  48. package/dist/chunk-IAIGT5G3.js +0 -1
  49. package/dist/chunk-JIVVHBCB.js +0 -2
  50. package/dist/chunk-K37WVIZL.js +0 -1
  51. package/dist/chunk-N26S7V4N.js +0 -1
  52. package/dist/chunk-N4SX7C3W.js +0 -2
  53. package/dist/chunk-NB4H5TP3.js +0 -1
  54. package/dist/chunk-NCL672QJ.js +0 -3
  55. package/dist/chunk-O3D7S5MD.js +0 -1
  56. package/dist/chunk-VK6KX433.js +0 -1
  57. package/dist/factories-CTMQQAMD.js +0 -1
  58. package/dist/ipc-CflAVodw.d.ts +0 -11
  59. package/dist/ipcFactory-QOAZVE56.js +0 -1
  60. package/dist/openrtc-UU4BBJLG.js +0 -2
  61. package/dist/runtime/legacy.d.ts +0 -18
  62. package/dist/runtime/legacy.js +0 -1
  63. package/dist/runtime/tauri.d.ts +0 -6
  64. package/dist/runtime/tauri.js +0 -1
  65. package/dist/tauri-BgLgJoQA.d.ts +0 -33
  66. package/dist/types-byWIP-WI.d.ts +0 -234
@@ -1,18 +1,15 @@
1
- import { d as OpenRTCClient, P as PeerReconciliationStats } from '../OpenRTCShared-BswnbjpG.js';
2
- export { e as OPENRTC_RUNTIME_POLICY, R as RuntimeClient, f as RuntimePolicySnapshot, D as ScopedConnectionActorError, g as ScopedConnectionActorErrorKind, h as ScopedConnectionActorHandle, i as ScopedConnectionActorHandleOptions, j as ScopedConnectionActorRegistry, k as ScopedConnectionActorState, l as ScopedConnectionClose, m as ScopedConnectionDial, n as ScopedConnectionKey, o as ScopedLogicalChannelHandle, p as ScopedPreferredTransport, q as getRuntimePolicy, r as scopedConnectionKey, s as scopedConnectionKeyToString } from '../OpenRTCShared-BswnbjpG.js';
3
- import { f as OpenRTCCapabilityHandle } from '../types-byWIP-WI.js';
4
- import { C as Connection, r as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-D0pqNSOf.js';
5
- export { A as ChannelDescriptor, B as ConnectionEvent, D as ConnectionTarget, E as DeviceProfile, I as IncomingStream, P as PeerConnectOptions, F as PeerReadiness, G as PeerStreamOptions, H as PresenceLoopOptions, J as RawConnection, y as RuntimeApplicationPayloadReadinessOptions, K as RuntimeApplicationPayloadRouteOptions, L as RuntimeAuthContext, g as RuntimeAuthIdentity, M as RuntimeAutoConnectPolicy, R as RuntimeChannelDescriptor, a as RuntimeClientOptions, z as RuntimeConnectionEvent, c as RuntimeConnectionStateSnapshot, j as RuntimeDevice, n as RuntimeDeviceConnectOptions, N as RuntimeDevicePresenceStatus, O as RuntimeDeviceStatus, m as RuntimeDeviceStatusSnapshot, f as RuntimeIncomingStream, p as RuntimeJoinRoomOptions, h as RuntimeLocalDeviceInfo, i as RuntimeLocalDeviceProfile, Q as RuntimeLogicalChannelFraming, l as RuntimeManagedSession, S as RuntimeManagedSessionKind, k as RuntimeManagedSessionOptions, T as RuntimeManagedSessionPlatform, e as RuntimePeerConnectOptions, x as RuntimePeerHealth, U as RuntimePeerLifecycleStatus, d as RuntimePeerReadinessSnapshot, V as RuntimePeerScope, W as RuntimePeerSessionSnapshot, b as RuntimePeerState, u as RuntimePeerStreamOptions, w as RuntimePresenceLoopOptions, X as RuntimePresencePolicy, q as RuntimeRoomMember, s as RuntimeScopedChannelOptions, t as RuntimeScopedLogicalChannel, o as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-D0pqNSOf.js';
1
+ import { P as PlutoIpcBridge, x as OpenRTCClient, f as OpenRTCCapabilityHandle, y as PeerReconciliationStats } from '../types-1ivghCqV.js';
2
+ export { N as NativeIpcFailureKind, z as OPENRTC_RUNTIME_POLICY, A as PlutoIpcUnlisten, R as RuntimeClient, B as RuntimePolicySnapshot, D as ScopedConnectionActorError, C as ScopedConnectionActorErrorKind, E as ScopedConnectionActorHandle, F as ScopedConnectionActorHandleOptions, G as ScopedConnectionActorRegistry, H as ScopedConnectionActorState, I as ScopedConnectionClose, J as ScopedConnectionDial, K as ScopedConnectionKey, L as ScopedLogicalChannelHandle, M as ScopedPreferredTransport, v as classifyNativeIpcFailure, Q as getRuntimePolicy, w as isNativeIpcCommandUnavailable, S as scopedConnectionKey, T as scopedConnectionKeyToString } from '../types-1ivghCqV.js';
3
+ import { C as Connection, q as RuntimeConnectionTarget, u as RuntimeRawConnection } from '../types-Br65RHyy.js';
4
+ export { A as ChannelDescriptor, B as ConnectionEvent, D as ConnectionTarget, E as DeviceProfile, I as IncomingStream, P as PeerConnectOptions, F as PeerReadiness, G as PeerStreamOptions, H as PresenceLoopOptions, J as RawConnection, y as RuntimeApplicationPayloadReadinessOptions, K as RuntimeApplicationPayloadRouteOptions, L as RuntimeAuthContext, f as RuntimeAuthIdentity, M as RuntimeAutoConnectPolicy, v as RuntimeChannelDescriptor, e as RuntimeClientOptions, z as RuntimeConnectionEvent, a as RuntimeConnectionStateSnapshot, i as RuntimeDevice, m as RuntimeDeviceConnectOptions, N as RuntimeDevicePresenceStatus, O as RuntimeDeviceStatus, l as RuntimeDeviceStatusSnapshot, d as RuntimeIncomingStream, o as RuntimeJoinRoomOptions, g as RuntimeLocalDeviceInfo, h as RuntimeLocalDeviceProfile, Q as RuntimeLogicalChannelFraming, k as RuntimeManagedSession, S as RuntimeManagedSessionKind, j as RuntimeManagedSessionOptions, T as RuntimeManagedSessionPlatform, c as RuntimePeerConnectOptions, x as RuntimePeerHealth, U as RuntimePeerLifecycleStatus, b as RuntimePeerReadinessSnapshot, V as RuntimePeerScope, W as RuntimePeerSessionSnapshot, R as RuntimePeerState, t as RuntimePeerStreamOptions, w as RuntimePresenceLoopOptions, X as RuntimePresencePolicy, p as RuntimeRoomMember, r as RuntimeScopedChannelOptions, s as RuntimeScopedLogicalChannel, n as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-Br65RHyy.js';
6
5
  import * as Draft14 from '@moq/net';
7
- import { $ as SignalingOptions, I as ISignalingBackend, R as RuntimeIdentity, a as RoomMember, e as SignalingEnvelope, h as SignalingSession, b as Device, g as DesiredPeerProjection, m as BackendConnectionState, _ as AppLimits, G as GrantScope, J as JoinRoomOptions, x as IncomingStreamChannelMetadata, Q as ApplicationCryptoStreamTools, a0 as RoomCreationMode, C as ClientOptions, o as ApplicationPayloadCrypto, D as DiscoveryMode, O as ProtocolCapabilityMap, a1 as ScanningLoopOptions, a2 as ScanningLoopHandle, a3 as RuntimeBootstrapOptions, a4 as RuntimeBootstrapResult, p as ApplicationPayloadReadinessOptions, a5 as ManagedApplicationRouteOptions, t as PeerState, u as PeerScope, v as PeerHealth, w as ChannelDescriptor, a6 as JoinRequest, k as NativeConnectParams, l as NativeConnectResult, a7 as SpaceTokenProvider } from '../types-BHePJWbM.js';
6
+ import { $ as SignalingOptions, I as ISignalingBackend, R as RuntimeIdentity, a as RoomMember, e as SignalingEnvelope, h as SignalingSession, b as Device, g as DesiredPeerProjection, m as BackendConnectionState, C as ClientOptions, _ as AppLimits, G as GrantScope, J as JoinRoomOptions, x as IncomingStreamChannelMetadata, Q as ApplicationCryptoStreamTools, a0 as RoomCreationMode, o as ApplicationPayloadCrypto, D as DiscoveryMode, O as ProtocolCapabilityMap, a1 as ScanningLoopOptions, a2 as ScanningLoopHandle, a3 as RuntimeBootstrapOptions, a4 as RuntimeBootstrapResult, p as ApplicationPayloadReadinessOptions, a5 as ManagedApplicationRouteOptions, t as PeerState, u as PeerScope, v as PeerHealth, w as ChannelDescriptor, a6 as JoinRequest, k as NativeConnectParams, l as NativeConnectResult } from '../types-DHuvdODq.js';
8
7
  import { R as RuntimeCapabilities } from '../capabilities-YSskrE8H.js';
9
8
  export { B as BROWSER_WASM_RUNTIME_CAPABILITIES, b as BrowserRuntimeCapabilityHost, N as NATIVE_IPC_RUNTIME_CAPABILITIES, c as NativeRuntimeStatusSnapshot, d as NativeRuntimeTransportFeatureStatus, e as RuntimeAdapterKind, a as RuntimeCapabilityProfile, f as cloneRuntimeCapabilities, r as runtimeCapabilitiesForBrowserHost, g as runtimeCapabilitiesFromNativeStatus, h as runtimeCapabilityProfile } from '../capabilities-YSskrE8H.js';
10
9
  export { RuntimeDeviceActiveOptions, isRuntimeDeviceActive, isRuntimeDeviceConnectable, isRuntimeDeviceRoutable } from './device-status.js';
11
- export { I as IpcRuntimeAdapter, a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-BgLgJoQA.js';
12
- export { P as NativeBridge, N as NativeIpcFailureKind, P as PlutoIpcBridge, a as PlutoIpcUnlisten, c as classifyNativeIpcFailure, i as isNativeIpcCommandUnavailable } from '../ipc-CflAVodw.js';
10
+ import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from '../DelegatingRuntimeAdapter-Btvzi1s9.js';
13
11
  import '../IEngineBridge-BbsT8hof.js';
14
12
  import '../ITransport-BsPcaov7.js';
15
- import '../DelegatingRuntimeAdapter-BLNigcS4.js';
16
13
 
17
14
  declare class Signaling {
18
15
  private readonly appTag;
@@ -60,6 +57,20 @@ declare class Signaling {
60
57
  setWasmClient(client: any): void;
61
58
  }
62
59
 
60
+ interface NativeIpcBridgeOptions extends WasmBridgeOptions {
61
+ allowWasmFallback?: boolean;
62
+ ipcBridge?: PlutoIpcBridge;
63
+ transports?: ClientOptions['transports'];
64
+ strictMode?: boolean;
65
+ }
66
+
67
+ interface IpcRuntimeAdapterOptions extends NativeIpcBridgeOptions {
68
+ bridge: PlutoIpcBridge;
69
+ }
70
+ declare class IpcRuntimeAdapter extends DelegatingRuntimeAdapter {
71
+ constructor(options: IpcRuntimeAdapterOptions);
72
+ }
73
+
63
74
  type OpenRTCCapabilityRuntime = OpenRTCClient;
64
75
  /**
65
76
  * Low-level escape hatch used only by `openrtc/runtime`. Product code should
@@ -368,7 +379,7 @@ declare class Client {
368
379
  buildCompoundTicketWithToken(irohTicket: string, grantScope: GrantScope, maxConnections?: number): string;
369
380
  setManagedPresenceTicket(ticket: string | null): void;
370
381
  clearManagedPresenceTicket(): void;
371
- registerSessionToken(token: string, grantScope: GrantScope, maxConnections: number): void;
382
+ registerSessionToken(token: string, grantScope: GrantScope, maxConnections: number, expiresAtMs?: number): void;
372
383
  revokeSessionToken(token: string): void;
373
384
  revokeTokensByScope(grantScope: GrantScope): Promise<string[]>;
374
385
  clearSessionTokens(): Promise<void>;
@@ -525,52 +536,4 @@ declare function createRuntimeJsonFrameDecoder<T = unknown>(onValue: RuntimeJson
525
536
  declare function concatRuntimeBytes(a: ByteArrayLike, b: ByteArrayLike): ByteArray;
526
537
  declare function readRuntimeU32BE(bytes: ByteArrayLike, offset: number): number;
527
538
 
528
- type MintSpaceTokenRequest = {
529
- spaceKey: string;
530
- memberId?: string;
531
- ttl?: number;
532
- sandboxAppId?: string;
533
- };
534
- type MintSpaceTokenResponse = {
535
- token: string;
536
- expiresAt: number;
537
- tokenLifetimeSeconds: number;
538
- namespaceId: string;
539
- spaceAppTag: string;
540
- };
541
- /**
542
- * Mint a namespace-scoped Firebase custom token from your backend using the
543
- * OpenRTC `POST /v1/spaces/tokens` endpoint. Never call this from browser code
544
- * with a secret key — proxy through your server.
545
- */
546
- type EnableSpaceAuthResponse = {
547
- success: true;
548
- space: {
549
- namespaceId: string;
550
- requireScopedAuth: boolean;
551
- status: 'active' | 'revoked';
552
- };
553
- };
554
- /**
555
- * Opt a provisioned space into scoped-auth mode (required for all spaces).
556
- * Call from your backend with sk_live_... only.
557
- */
558
- declare function enableSpaceAuth(endpointUrl: string, secretKey: string, namespaceId: string): Promise<EnableSpaceAuthResponse>;
559
- declare function mintSpaceToken(endpointUrl: string, secretKey: string, request: MintSpaceTokenRequest): Promise<MintSpaceTokenResponse>;
560
- /**
561
- * Browser-safe space auth for static sites. Calls the rate-limited
562
- * `v1SpacePublicTokens` endpoint (pk_live_ + spaceKey only).
563
- */
564
- declare function createPublicSpaceTokenProvider(options: {
565
- apiKey: string;
566
- space?: string;
567
- spaceKey?: string;
568
- endpointUrl?: string;
569
- memberIdStorageKey?: string;
570
- sandboxAppId?: string;
571
- }): SpaceTokenProvider;
572
- declare function sandboxSpaceKey(spaceKey: string, sandboxAppId?: string): string;
573
- declare const spaceToken: typeof createPublicSpaceTokenProvider;
574
- declare const createSpaceTokenProvider: typeof createPublicSpaceTokenProvider;
575
-
576
- export { Connection, type CorrelationFields, type EnableSpaceAuthResponse, type MintSpaceTokenRequest, type MintSpaceTokenResponse, type OpenRTCCapabilityRuntime, RuntimeCapabilities, RuntimeConnectionController, RuntimeConnectionTarget, type RuntimeJsonFrameDecoderOptions, type RuntimeJsonFrameHandler, RuntimeRawConnection, type RuntimeU32BEFrameHandler, clog, concatRuntimeBytes, correlationForDriveGrantScope, createPublicSpaceTokenProvider, createRuntimeJsonFrameDecoder, createRuntimeU32BEFrameDecoder, createSpaceTokenProvider, decodeRuntimeJsonPayload, enableSpaceAuth, encodeRuntimeJsonFrame, encodeRuntimeJsonPayload, encodeRuntimeU32BEFrame, logOpenRtcTeardownTrace, mintSpaceToken, openRtcDebug, openRtcDebugEnabled, openRtcDebugInfo, openRtcDebugLog, readRuntimeU32BE, renderCorrelationFields, runtimeForCapability as runtimeFromCapability, sandboxSpaceKey, spaceToken };
539
+ export { Connection, type CorrelationFields, IpcRuntimeAdapter, type IpcRuntimeAdapterOptions, PlutoIpcBridge as NativeBridge, type OpenRTCCapabilityRuntime, PlutoIpcBridge, RuntimeCapabilities, RuntimeConnectionController, RuntimeConnectionTarget, type RuntimeJsonFrameDecoderOptions, type RuntimeJsonFrameHandler, RuntimeRawConnection, type RuntimeU32BEFrameHandler, clog, concatRuntimeBytes, correlationForDriveGrantScope, createRuntimeJsonFrameDecoder, createRuntimeU32BEFrameDecoder, decodeRuntimeJsonPayload, encodeRuntimeJsonFrame, encodeRuntimeJsonPayload, encodeRuntimeU32BEFrame, logOpenRtcTeardownTrace, openRtcDebug, openRtcDebugEnabled, openRtcDebugInfo, openRtcDebugLog, readRuntimeU32BE, renderCorrelationFields, runtimeForCapability as runtimeFromCapability };
@@ -1,2 +1 @@
1
- export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-O3D7S5MD.js';export{b as runtimeFromCapability}from'../chunk-23XC6TGK.js';export{b as Connection,t as RuntimeClient,c as RuntimeConnectionController,g as ScopedConnectionActorError,j as ScopedConnectionActorHandle,k as ScopedConnectionActorRegistry,f as clog,r as concatRuntimeBytes,e as correlationForDriveGrantScope,q as createRuntimeJsonFrameDecoder,m as createRuntimeU32BEFrameDecoder,o as decodeRuntimeJsonPayload,p as encodeRuntimeJsonFrame,n as encodeRuntimeJsonPayload,l as encodeRuntimeU32BEFrame,s as readRuntimeU32BE,d as renderCorrelationFields,h as scopedConnectionKey,i as scopedConnectionKeyToString}from'../chunk-NCL672QJ.js';export{f as IpcRuntimeAdapter}from'../chunk-A7AMB23L.js';import'../chunk-C6PAXO3N.js';import'../chunk-7Z6N46RB.js';export{q as BROWSER_WASM_RUNTIME_CAPABILITIES,r as NATIVE_IPC_RUNTIME_CAPABILITIES,o as OPENRTC_RUNTIME_POLICY,s as cloneRuntimeCapabilities,p as getRuntimePolicy,g as logOpenRtcTeardownTrace,t as runtimeCapabilitiesForBrowserHost,u as runtimeCapabilitiesFromNativeStatus,v as runtimeCapabilityProfile}from'../chunk-JIVVHBCB.js';export{b as openRtcDebug,a as openRtcDebugEnabled,c as openRtcDebugInfo,d as openRtcDebugLog}from'../chunk-VK6KX433.js';import'../chunk-NT5YHZQH.js';export{a as classifyNativeIpcFailure,b as isNativeIpcCommandUnavailable}from'../chunk-K37WVIZL.js';import'../chunk-BXFXPIXO.js';import {b}from'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';var j="https://api.openrtc.app";function c(e){if(typeof globalThis.crypto?.randomUUID!="function")throw new Error(`Secure request identity is unavailable for ${e}.`);return `${e}:${globalThis.crypto.randomUUID()}`}async function z(e,t,n){let o=e.replace(/\/$/,""),r=await fetch(`${o}/v1/spaces/${encodeURIComponent(n)}/scoped-auth`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":c("enable-space-auth")},body:"{}"}),a=await r.json().catch(()=>({}));if(!r.ok){let s=typeof a?.error=="string"?a.error:`enableSpaceAuth failed (${r.status})`;throw new Error(s)}return a}async function q(e,t,n){let o=await fetch(e,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":c("mint-space-token")},body:JSON.stringify(n)}),r=await o.json().catch(()=>({}));if(!o.ok){let a=typeof r?.error=="string"?r.error:`mintSpaceToken failed (${o.status})`;throw new Error(a)}if(typeof r?.token!="string"||!r.token.trim())throw new Error("mintSpaceToken response missing token");return r}function d(e){let t=e.apiKey.trim(),n=(e.spaceKey??e.space??"").trim(),o=g(e.sandboxAppId),r=(e.endpointUrl??j).replace(/\/$/,""),a=e.memberIdStorageKey??`openrtc:space-member:${n}${o?`:sandbox:${o}`:""}`;return async()=>{if(!t||!n)throw new Error("spaceToken requires apiKey and space");let s=null;typeof sessionStorage<"u"?(s=sessionStorage.getItem(a),s||(s=globalThis.crypto?.randomUUID?.()??`member-${Date.now()}`,sessionStorage.setItem(a,s))):s=`member-${Date.now()}`;let m=await b().getAppCheckToken(),i=await fetch(`${r}/v1SpacePublicTokens`,{method:"POST",headers:{"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":c("mint-public-space-token"),...m?{"X-Firebase-AppCheck":m}:{}},body:JSON.stringify({apiKey:t,spaceKey:n,memberId:s,...o?{sandboxAppId:o}:{}})}),{text:u,payload:p}=await B(i);if(!i.ok){let f=typeof p?.error=="string"?p.error:u.trim()?u.trim().slice(0,240):`public space token mint failed (${i.status})`;throw new Error(f)}let l=typeof p?.token=="string"?p.token.trim():"";if(!l)throw new Error("public space token response missing token");return {customToken:l}}}function M(e){if(!e.trim())return {};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return {}}}async function B(e){let t=e.text;if(typeof t=="function"){let o=await t.call(e).catch(()=>"");return {text:o,payload:M(o)}}let n=await e.json().catch(()=>({}));return {text:JSON.stringify(n),payload:n&&typeof n=="object"?n:{}}}function g(e){let t=e?.trim().toLowerCase()??"";if(!t)return "";if(!/^[a-z0-9][a-z0-9-]{0,47}$/.test(t))throw new Error("sandboxAppId must be 1-48 lowercase letters, numbers, or dashes.");return t}function J(e,t){let n=e.trim(),o=g(t);return o?`${n}::sandbox::${o}`:n}var L=d,H=d;
2
- export{d as createPublicSpaceTokenProvider,H as createSpaceTokenProvider,z as enableSpaceAuth,q as mintSpaceToken,J as sandboxSpaceKey,L as spaceToken};
1
+ export{b as Connection,u as IpcRuntimeAdapter,t as RuntimeClient,c as RuntimeConnectionController,g as ScopedConnectionActorError,j as ScopedConnectionActorHandle,k as ScopedConnectionActorRegistry,f as clog,r as concatRuntimeBytes,e as correlationForDriveGrantScope,q as createRuntimeJsonFrameDecoder,m as createRuntimeU32BEFrameDecoder,o as decodeRuntimeJsonPayload,p as encodeRuntimeJsonFrame,n as encodeRuntimeJsonPayload,l as encodeRuntimeU32BEFrame,s as readRuntimeU32BE,d as renderCorrelationFields,h as scopedConnectionKey,i as scopedConnectionKeyToString}from'../chunk-GBIGWN5H.js';export{a as classifyNativeIpcFailure,b as isNativeIpcCommandUnavailable}from'../chunk-Z2WVSXPW.js';export{b as runtimeFromCapability}from'../chunk-QGGQ3SRF.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';import'../chunk-MHQHFEYX.js';export{s as BROWSER_WASM_RUNTIME_CAPABILITIES,t as NATIVE_IPC_RUNTIME_CAPABILITIES,q as OPENRTC_RUNTIME_POLICY,u as cloneRuntimeCapabilities,r as getRuntimePolicy,i as logOpenRtcTeardownTrace,v as runtimeCapabilitiesForBrowserHost,w as runtimeCapabilitiesFromNativeStatus,x as runtimeCapabilityProfile}from'../chunk-TAGQBG3A.js';import'../chunk-NT5YHZQH.js';import'../chunk-RRMBD5OL.js';export{b as openRtcDebug,a as openRtcDebugEnabled,c as openRtcDebugInfo,d as openRtcDebugLog}from'../chunk-PQK5SJ47.js';import'../chunk-QHSM5NFZ.js';import'../chunk-C7YN5MSV.js';
package/dist/testing.d.ts CHANGED
@@ -1,11 +1,9 @@
1
- import { d as OpenRTCClient } from './OpenRTCShared-BswnbjpG.js';
2
- import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
3
- import { a as RuntimeClientOptions } from './types-D0pqNSOf.js';
4
- import { O as OpenRTCOptions, a as OpenRTCClient$1 } from './types-byWIP-WI.js';
5
- import './types-BHePJWbM.js';
1
+ import { O as OpenRTCOptions, P as PlutoIpcBridge, a as OpenRTCClient } from './types-1ivghCqV.js';
2
+ import './types-DHuvdODq.js';
6
3
  import './IEngineBridge-BbsT8hof.js';
7
- import './capabilities-YSskrE8H.js';
4
+ import './types-Br65RHyy.js';
8
5
  import './ITransport-BsPcaov7.js';
6
+ import './capabilities-YSskrE8H.js';
9
7
 
10
8
  interface OpenRTCV2Endpoints {
11
9
  controlPlane: string;
@@ -15,16 +13,8 @@ interface OpenRTCV2Endpoints {
15
13
  declare function createTestingOpenRTC(options: OpenRTCOptions, endpoints: OpenRTCV2Endpoints, testing?: {
16
14
  deviceId?: string;
17
15
  irohTestRelayUrl?: string;
18
- }): OpenRTCClient$1;
16
+ }): OpenRTCClient;
19
17
  /** Native equivalent for emulator and harness lanes; never import in product code. */
20
- declare function createTestingNativeOpenRTC(options: OpenRTCOptions, endpoints: OpenRTCV2Endpoints, bridge: PlutoIpcBridge): OpenRTCClient$1;
21
- /**
22
- * Rollback-harness constructor. This is intentionally confined to the
23
- * `openrtc/testing` export because it enables plaintext loopback coordination
24
- * for local emulators and also carries the time-bounded v1 runtime.
25
- */
26
- declare const createTestingLegacyOpenRTC: ((options: RuntimeClientOptions) => Promise<OpenRTCClient>) & {
27
- native: (options: RuntimeClientOptions, bridge?: PlutoIpcBridge) => OpenRTCClient;
28
- };
18
+ declare function createTestingNativeOpenRTC(options: OpenRTCOptions, endpoints: OpenRTCV2Endpoints, bridge: PlutoIpcBridge): OpenRTCClient;
29
19
 
30
- export { createTestingLegacyOpenRTC, createTestingNativeOpenRTC, createTestingOpenRTC };
20
+ export { createTestingNativeOpenRTC, createTestingOpenRTC };
package/dist/testing.js CHANGED
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-KWXAZUAZ.js';import {c}from'./chunk-23XC6TGK.js';import {a}from'./chunk-4DFFBEWY.js';import'./chunk-2QHDEGVX.js';import'./chunk-GQYLYKW4.js';import'./chunk-EUNCYGJD.js';import'./chunk-IAIGT5G3.js';import'./chunk-N4SX7C3W.js';import'./chunk-NCL672QJ.js';import'./chunk-A7AMB23L.js';import'./chunk-C6PAXO3N.js';import'./chunk-7Z6N46RB.js';import'./chunk-JIVVHBCB.js';import'./chunk-VK6KX433.js';import'./chunk-NT5YHZQH.js';import'./chunk-K37WVIZL.js';import'./chunk-BXFXPIXO.js';import'./chunk-N26S7V4N.js';import'./chunk-NB4H5TP3.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';function m(e,t,n={}){return c(e,{endpoints:t,testingAllowInsecureLoopback:true,platform:"web",...n.deviceId?{deviceIdProvider:async()=>n.deviceId}:{},...n.irohTestRelayUrl?{irohTestRelayUrl:n.irohTestRelayUrl}:{},runtimeFactory:async i=>{let{createWasmClient:o}=await import('./factories-CTMQQAMD.js');return o(i)}})}function d(e,t,n){return c(e,{endpoints:t,testingAllowInsecureLoopback:true,platform:"native",deviceKeyProvider:a$1(n),deviceIdProvider:async()=>{let i=await n.invoke("get_rtc_local_device_info");return String(i?.deviceId??"")},runtimeFactory:async i=>{let{createIpcClient:o}=await import('./ipcFactory-QOAZVE56.js');return o(i,n)}})}function p(e){let t=e.coordinationGateway;return {...e,...t?{coordinationGateway:{...t,testingAllowInsecureLoopback:true}}:{}}}var C=Object.assign(e=>a(p(e)),{native:(e,t)=>a.native(p(e),t)});export{C as createTestingLegacyOpenRTC,d as createTestingNativeOpenRTC,m as createTestingOpenRTC};
1
+ import {a}from'./chunk-RLRBSNLB.js';import {c}from'./chunk-QGGQ3SRF.js';function l(r,n,e={}){return c(r,{endpoints:n,testingAllowInsecureLoopback:true,platform:"web",...e.deviceId?{deviceIdProvider:async()=>e.deviceId}:{},...e.irohTestRelayUrl?{irohTestRelayUrl:e.irohTestRelayUrl}:{},runtimeFactory:async t=>{let{createWasmClient:i}=await import('./factories-CKVQIMP6.js');return i(t)}})}function s(r,n,e){return c(r,{endpoints:n,testingAllowInsecureLoopback:true,platform:"native",deviceKeyProvider:a(e),deviceIdProvider:async()=>{let t=await e.invoke("get_rtc_local_device_info");return String(t?.deviceId??"")},runtimeFactory:async t=>{let{createIpcClient:i}=await import('./ipcFactory-KNWHT65X.js');return i(t,e)}})}export{s as createTestingNativeOpenRTC,l as createTestingOpenRTC};
@@ -1,5 +1,5 @@
1
- import { r as ProtocolName, H as RouteDescriptor, K as ProtocolCapability, O as ProtocolCapabilityMap, o as ApplicationPayloadCrypto, Q as ApplicationCryptoStreamTools } from '../types-BHePJWbM.js';
2
- export { U as ApplicationCryptoBiStream, V as RouteFamily, W as RouteImplementationKind } from '../types-BHePJWbM.js';
1
+ import { r as ProtocolName, H as RouteDescriptor, K as ProtocolCapability, O as ProtocolCapabilityMap, o as ApplicationPayloadCrypto, Q as ApplicationCryptoStreamTools } from '../types-DHuvdODq.js';
2
+ export { U as ApplicationCryptoBiStream, V as RouteFamily, W as RouteImplementationKind } from '../types-DHuvdODq.js';
3
3
  import { I as ITransport } from '../ITransport-BsPcaov7.js';
4
4
 
5
5
  declare const TRANSPORT_LABELS: readonly ProtocolName[];
@@ -1 +1 @@
1
- export{e as KEY_AGREEMENT_ALGORITHM,d as KEY_AGREEMENT_PUBLIC_KEY_BYTES,g as deriveApplicationCryptoKey,i as encodeApplicationKeyAgreementPayload,f as generateEphemeralKeyAgreement,c as getPreferredProtocolOrder}from'../chunk-7Z6N46RB.js';export{e as TRANSPORT_LABELS,o as createApplicationCryptoStreamTools,n as createSharedSecretApplicationCrypto,m as isApplicationEncryptedPayload,h as isDirectIrohTransportLabel,l as isIndependentTransportLabel,g as isIrohBaseTransportLabel,i as isOptionalTransportLabel,j as isWebRtcTransportLabel,f as normalizeTransportLabel}from'../chunk-VK6KX433.js';import'../chunk-NB4H5TP3.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-C7YN5MSV.js';
1
+ export{e as KEY_AGREEMENT_ALGORITHM,d as KEY_AGREEMENT_PUBLIC_KEY_BYTES,g as deriveApplicationCryptoKey,i as encodeApplicationKeyAgreementPayload,f as generateEphemeralKeyAgreement,c as getPreferredProtocolOrder}from'../chunk-RRMBD5OL.js';export{o as TRANSPORT_LABELS,y as createApplicationCryptoStreamTools,x as createSharedSecretApplicationCrypto,w as isApplicationEncryptedPayload,r as isDirectIrohTransportLabel,v as isIndependentTransportLabel,q as isIrohBaseTransportLabel,s as isOptionalTransportLabel,t as isWebRtcTransportLabel,p as normalizeTransportLabel}from'../chunk-PQK5SJ47.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-C7YN5MSV.js';
@@ -1,8 +1,18 @@
1
- import { G as GrantScope, I as ISignalingBackend, X as ConnectDeviceHooks, Y as ConnectDeviceOptions, Z as ConnectDeviceResult, M as ManagedConnectionRecord, P as PeerSessionSnapshot, d as ResolvedPeerIdentity, _ as AppLimits, k as NativeConnectParams, l as NativeConnectResult, E as ExplicitFileDataSendParams } from './types-BHePJWbM.js';
1
+ import { G as GrantScope, I as ISignalingBackend, X as ConnectDeviceHooks, Y as ConnectDeviceOptions, Z as ConnectDeviceResult, M as ManagedConnectionRecord, P as PeerSessionSnapshot, d as ResolvedPeerIdentity, _ as AppLimits, k as NativeConnectParams, l as NativeConnectResult, E as ExplicitFileDataSendParams } from './types-DHuvdODq.js';
2
2
  import { A as AuthContext } from './IEngineBridge-BbsT8hof.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-D0pqNSOf.js';
3
+ import { R as RuntimePeerState, a as RuntimeConnectionStateSnapshot, b as RuntimePeerReadinessSnapshot, c as RuntimePeerConnectOptions, C as Connection, d as RuntimeIncomingStream, e as RuntimeClientOptions, f as RuntimeAuthIdentity, g as RuntimeLocalDeviceInfo, h as RuntimeLocalDeviceProfile, i as RuntimeDevice, j as RuntimeManagedSessionOptions, k as RuntimeManagedSession, l as RuntimeDeviceStatusSnapshot, m as RuntimeDeviceConnectOptions, n as RuntimeSession, o as RuntimeJoinRoomOptions, p as RuntimeRoomMember, q as RuntimeConnectionTarget, r as RuntimeScopedChannelOptions, s as RuntimeScopedLogicalChannel, t as RuntimePeerStreamOptions, u as RuntimeRawConnection, v as RuntimeChannelDescriptor, w as RuntimePresenceLoopOptions, x as RuntimePeerHealth, y as RuntimeApplicationPayloadReadinessOptions, z as RuntimeConnectionEvent } from './types-Br65RHyy.js';
4
4
  import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './capabilities-YSskrE8H.js';
5
5
 
6
+ type PlutoIpcUnlisten = () => void | Promise<void>;
7
+ interface PlutoIpcBridge {
8
+ invoke<T = unknown>(command: string, args?: Record<string, unknown>): Promise<T>;
9
+ listen<T = unknown>(event: string, handler: (payload: T) => void): Promise<PlutoIpcUnlisten>;
10
+ isAvailable?(): boolean | Promise<boolean>;
11
+ }
12
+ type NativeIpcFailureKind = 'command-unavailable' | 'runtime-unavailable' | 'timeout' | 'unknown';
13
+ declare function classifyNativeIpcFailure(error: unknown): NativeIpcFailureKind;
14
+ declare function isNativeIpcCommandUnavailable(error: unknown): boolean;
15
+
6
16
  /**
7
17
  * Coalesced peer reconciliation scheduler and full reconcile orchestration.
8
18
  *
@@ -230,7 +240,6 @@ interface RuntimePolicySnapshot {
230
240
  nativeStartRetryWindowMs: number;
231
241
  nativeStartRetryMinDelayMs: number;
232
242
  nativeStartRetryMaxDelayMs: number;
233
- reconciliationIntervalMs: number;
234
243
  deviceStatusRefreshDebounceMs: number;
235
244
  };
236
245
  browserAutoConnect: {
@@ -281,7 +290,6 @@ declare class RuntimeClient {
281
290
  private static readonly NATIVE_START_RETRY_WINDOW_MS;
282
291
  private static readonly NATIVE_START_RETRY_MIN_DELAY_MS;
283
292
  private static readonly NATIVE_START_RETRY_MAX_DELAY_MS;
284
- private static readonly MANAGED_RECONCILIATION_INTERVAL_MS;
285
293
  private static readonly DEVICE_STATUS_REFRESH_DEBOUNCE_MS;
286
294
  private static readonly MANAGED_USER_DEVICE_SCOPE;
287
295
  static readonly MANAGED_FRIEND_SCOPE: GrantScope;
@@ -298,7 +306,6 @@ declare class RuntimeClient {
298
306
  private managedSessionStartInFlight;
299
307
  private terminalShutdown;
300
308
  private readonly managedReconciliationTasks;
301
- private managedReconciliationTimer;
302
309
  private readonly managedReconciliationFollowupTimers;
303
310
  /**
304
311
  * The one per-`{scope, peerNodeId}` observer-side dial coalescer. It is
@@ -378,6 +385,19 @@ declare class RuntimeClient {
378
385
  * @param maxConnections 0 = unlimited.
379
386
  */
380
387
  getTicketWithToken(grantScope: GrantScope, maxConnections?: number): Promise<string>;
388
+ /**
389
+ * Register a product-issued admission token with the active runtime.
390
+ *
391
+ * Product code supplies the durable authorization decision, while OpenRTC
392
+ * remains the sole owner of the native/WASM admission registry. Restricted
393
+ * grants should always include their server-issued expiry.
394
+ */
395
+ registerAdmissionToken(input: {
396
+ token: string;
397
+ scope: GrantScope;
398
+ maxConnections?: number;
399
+ expiresAtMs?: number;
400
+ }): Promise<void>;
381
401
  /** Revoke all session tokens that match the given scope. */
382
402
  revokeTokensByScope(grantScope: GrantScope): Promise<string[]>;
383
403
  private revokeTokensByScopeInternal;
@@ -856,7 +876,7 @@ interface OpenRTCAdvancedNamespace {
856
876
  *
857
877
  * This is the unified type returned by OpenRTC() and OpenRTC.native().
858
878
  */
859
- interface OpenRTCClient extends RuntimeClient {
879
+ interface OpenRTCClient$1 extends RuntimeClient {
860
880
  readonly devices: OpenRTCDeviceNamespace;
861
881
  readonly peers: OpenRTCPeerNamespace;
862
882
  readonly channels: OpenRTCChannelNamespace;
@@ -941,4 +961,234 @@ interface OpenRTCClient extends RuntimeClient {
941
961
  readonly _assembly: PlutoRuntimeAssembly;
942
962
  }
943
963
 
944
- export { DriveGrantActorError as D, type OpenRTCPeerNamespace as O, type PeerReconciliationStats as P, RuntimeClient as R, type OpenRTCChannelNamespace as a, type OpenRTCDiagnosticsNamespace as b, type OpenRTCDeviceNamespace as c, type OpenRTCClient as d, OPENRTC_RUNTIME_POLICY as e, type RuntimePolicySnapshot as f, type DriveGrantActorErrorKind 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, getRuntimePolicy as q, driveGrantConnectionKey as r, driveGrantConnectionKeyToString as s };
964
+ interface OpenRTCAuthProvider {
965
+ /** Registered provider ID from the developer app capability manifest. */
966
+ readonly providerId?: string;
967
+ /**
968
+ * Stable, non-secret, local-only identifier for the currently signed-in
969
+ * principal. It changes on login, logout, or account switch, but never for
970
+ * an ordinary access-token refresh. OpenRTC hashes this value together
971
+ * with the app and installation-key thumbprint before persisting a lookup.
972
+ *
973
+ * Optional during the 2.0 RC compatibility window. Providers that omit it
974
+ * use the assertion-first flow and remain correct, but cannot skip the
975
+ * assertion exchange on a cold process start.
976
+ */
977
+ getSessionKey?(): Promise<string | null>;
978
+ getAssertion(input: {
979
+ audience: 'https://api.openrtc.app/v2/assertions/exchange';
980
+ forceRefresh: boolean;
981
+ /**
982
+ * Stable OpenRTC installation ID being enrolled. Consumer backends
983
+ * may bind product admission (for example a paid device allowance) to
984
+ * this value in the signed assertion. It is supplied only for an
985
+ * enrollment/renewal assertion, never for hourly gateway refreshes.
986
+ */
987
+ deviceId: string;
988
+ }): Promise<string | null>;
989
+ /**
990
+ * Optional identity-epoch observer. Notify only when the signed-in
991
+ * principal/session changes (login, logout, account switch, or explicit
992
+ * revocation). Do not notify for ordinary OAuth/Firebase access-token
993
+ * refreshes: OpenRTC refreshes its own avenue grant in place.
994
+ */
995
+ subscribe?(listener: (event: {
996
+ type: 'principal-changed';
997
+ sessionKey: string | null;
998
+ }) => void): () => void;
999
+ }
1000
+ interface OpenRTCEnrolledDevice {
1001
+ deviceId: string;
1002
+ name?: string;
1003
+ platform?: string;
1004
+ enrolledAtMs: number | null;
1005
+ lastGrantAtMs: number | null;
1006
+ current: boolean;
1007
+ }
1008
+ interface OpenRTCAttestationProvider {
1009
+ readonly kind: 'firebase-app-check' | 'apple-app-attest' | 'play-integrity' | `custom:${string}`;
1010
+ /**
1011
+ * Describes what the provider actually signs. Reusable app-integrity
1012
+ * tokens (for example Firebase App Check) do not become request-bound just
1013
+ * because OpenRTC supplies an enrollment challenge. The server derives and
1014
+ * enforces the authoritative binding from the registered provider kind;
1015
+ * this field keeps host integrations and diagnostics honest.
1016
+ */
1017
+ readonly evidenceBinding: 'app-session' | 'request-challenge';
1018
+ getEvidence(input: {
1019
+ challenge: string;
1020
+ apiKey: string;
1021
+ }): Promise<{
1022
+ token: string;
1023
+ }>;
1024
+ }
1025
+ /**
1026
+ * Optional consumer-owned bot challenge. Core OpenRTC does not render a UI or
1027
+ * load a CAPTCHA dependency; the host supplies a fresh token only when its
1028
+ * developer manifest requires anonymous capability verification.
1029
+ */
1030
+ interface OpenRTCBotVerificationProvider {
1031
+ getToken(input: {
1032
+ action: 'openrtc_capability';
1033
+ apiKey: string;
1034
+ }): Promise<string>;
1035
+ }
1036
+ interface OpenRTCUsageUpdate {
1037
+ sessionCreditsUsd: number;
1038
+ operation: string;
1039
+ estimated: boolean;
1040
+ }
1041
+ interface OpenRTCUsageWarning extends OpenRTCUsageUpdate {
1042
+ thresholdCreditsUsd: number;
1043
+ kind: 'warning' | 'session-limit';
1044
+ }
1045
+ interface OpenRTCTransportPreferences {
1046
+ iroh?: boolean;
1047
+ webrtc?: boolean;
1048
+ relay?: boolean;
1049
+ moq?: boolean;
1050
+ ble?: boolean;
1051
+ /**
1052
+ * Advanced privacy mode. `relay-only` suppresses direct Iroh addresses,
1053
+ * local discovery, and host/srflx WebRTC candidates. It also requires the
1054
+ * developer manifest's relay opt-in.
1055
+ */
1056
+ privacy?: 'direct' | 'relay-only';
1057
+ /**
1058
+ * Advanced native integration for hosts whose Rust process owns the
1059
+ * application protocol registry (for example, a Tauri file-transfer host).
1060
+ * Normal SDK consumers should leave this disabled.
1061
+ */
1062
+ nativeHostProtocols?: boolean;
1063
+ priority?: readonly ('iroh' | 'webrtc' | 'moq' | 'ble')[];
1064
+ }
1065
+ interface OpenRTCOptions {
1066
+ apiKey: string;
1067
+ auth?: OpenRTCAuthProvider;
1068
+ trust?: {
1069
+ attestation?: OpenRTCAttestationProvider;
1070
+ botVerification?: OpenRTCBotVerificationProvider;
1071
+ };
1072
+ usage?: {
1073
+ warnAtSessionCreditsUsd?: number;
1074
+ maxSessionCreditsUsd?: number;
1075
+ onUsage?: (event: OpenRTCUsageUpdate) => void;
1076
+ onWarning?: (warning: OpenRTCUsageWarning) => void;
1077
+ };
1078
+ transports?: OpenRTCTransportPreferences;
1079
+ }
1080
+ type OpenRTCAccessMode = 'capability' | 'authenticated';
1081
+ type OpenRTCLatestStateMode = 'reliable' | 'latest-state';
1082
+ interface OpenRTCCapabilityHandle {
1083
+ readonly kind: 'devices' | 'space' | 'room' | 'ticket';
1084
+ readonly id: string;
1085
+ readonly peers: OpenRTCPeerNamespace;
1086
+ readonly channels: OpenRTCChannelNamespace;
1087
+ readonly diagnostics: OpenRTCDiagnosticsNamespace;
1088
+ readonly closed: boolean;
1089
+ close(): Promise<void>;
1090
+ }
1091
+ interface OpenRTCDevicesHandle extends OpenRTCCapabilityHandle {
1092
+ readonly kind: 'devices';
1093
+ localId(): ReturnType<OpenRTCDeviceNamespace['localId']>;
1094
+ localInfo(): ReturnType<OpenRTCDeviceNamespace['localInfo']>;
1095
+ list(): ReturnType<OpenRTCDeviceNamespace['list']>;
1096
+ listWithStatus(): ReturnType<OpenRTCDeviceNamespace['listWithStatus']>;
1097
+ watch: OpenRTCDeviceNamespace['watch'];
1098
+ connect: OpenRTCDeviceNamespace['connect'];
1099
+ disconnect: OpenRTCDeviceNamespace['disconnect'];
1100
+ }
1101
+ interface OpenRTCSpaceHandle extends OpenRTCCapabilityHandle {
1102
+ readonly kind: 'space';
1103
+ readonly delivery: OpenRTCLatestStateMode;
1104
+ leave(): Promise<void>;
1105
+ }
1106
+ interface OpenRTCRoomHandle extends OpenRTCCapabilityHandle {
1107
+ readonly kind: 'room';
1108
+ readonly membership: 'ephemeral' | 'durable';
1109
+ leave(): Promise<void>;
1110
+ }
1111
+ interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
1112
+ readonly kind: 'ticket';
1113
+ readonly token: string;
1114
+ }
1115
+ interface OpenRTCDevicesStartOptions {
1116
+ auth?: OpenRTCAuthProvider;
1117
+ autoConnect?: 'none' | 'online';
1118
+ /** Optional local profile; it does not alter the durable device identity. */
1119
+ profile?: {
1120
+ name?: string;
1121
+ /**
1122
+ * Optional application-owned public presence metadata. It is bounded
1123
+ * to 4 KiB and folded into the initial connection/presence operation.
1124
+ */
1125
+ metadata?: string;
1126
+ };
1127
+ maxPeers?: number;
1128
+ /** Requires the app manifest's advanced-fanout opt-in. */
1129
+ advancedFanout?: boolean;
1130
+ }
1131
+ interface OpenRTCSpaceJoinOptions {
1132
+ access?: 'capability';
1133
+ identity?: 'ephemeral';
1134
+ payload?: OpenRTCLatestStateMode;
1135
+ maxPeers?: number;
1136
+ /** Requires the app manifest's advanced-fanout opt-in. */
1137
+ advancedFanout?: boolean;
1138
+ }
1139
+ interface OpenRTCRoomJoinOptions {
1140
+ access?: OpenRTCAccessMode;
1141
+ membership?: 'ephemeral' | 'durable';
1142
+ auth?: OpenRTCAuthProvider;
1143
+ maxPeers?: number;
1144
+ /** Requires the app manifest's advanced-fanout opt-in. */
1145
+ advancedFanout?: boolean;
1146
+ }
1147
+ interface OpenRTCTicketIssueOptions {
1148
+ maxPeers?: number;
1149
+ /** Requires the app manifest's advanced-fanout opt-in. */
1150
+ advancedFanout?: boolean;
1151
+ }
1152
+ interface OpenRTCChannelCatalog {
1153
+ register(descriptor: RuntimeChannelDescriptor): () => void;
1154
+ list(): readonly RuntimeChannelDescriptor[];
1155
+ }
1156
+ interface OpenRTCUsageNamespace {
1157
+ estimate(input: {
1158
+ operation: string;
1159
+ units?: number;
1160
+ }): {
1161
+ creditsUsd: number;
1162
+ estimated: true;
1163
+ };
1164
+ readonly sessionCreditsUsd: number;
1165
+ }
1166
+ interface OpenRTCClient {
1167
+ readonly devices: {
1168
+ start(options?: OpenRTCDevicesStartOptions): Promise<OpenRTCDevicesHandle>;
1169
+ listEnrolled(options?: {
1170
+ auth?: OpenRTCAuthProvider;
1171
+ }): Promise<OpenRTCEnrolledDevice[]>;
1172
+ revoke(deviceId: string, options?: {
1173
+ auth?: OpenRTCAuthProvider;
1174
+ }): Promise<void>;
1175
+ revokeAll(options?: {
1176
+ auth?: OpenRTCAuthProvider;
1177
+ exceptCurrent?: boolean;
1178
+ }): Promise<void>;
1179
+ };
1180
+ readonly spaces: {
1181
+ join(id: string, options?: OpenRTCSpaceJoinOptions): Promise<OpenRTCSpaceHandle>;
1182
+ };
1183
+ readonly rooms: {
1184
+ join(id: string, options?: OpenRTCRoomJoinOptions): Promise<OpenRTCRoomHandle>;
1185
+ };
1186
+ readonly tickets: {
1187
+ issue(id: string, options?: OpenRTCTicketIssueOptions): Promise<OpenRTCTicketHandle>;
1188
+ };
1189
+ readonly channels: OpenRTCChannelCatalog;
1190
+ readonly usage: OpenRTCUsageNamespace;
1191
+ close(): Promise<void>;
1192
+ }
1193
+
1194
+ export { type PlutoIpcUnlisten as A, type RuntimePolicySnapshot as B, type DriveGrantActorErrorKind as C, DriveGrantActorError as D, DriveGrantActorHandle as E, type DriveGrantActorHandleOptions as F, DriveGrantActorRegistry as G, type DriveGrantActorState as H, type DriveGrantClose as I, type DriveGrantDial as J, type DriveGrantConnectionKey as K, type DriveGrantLogicalChannelHandle as L, type DriveGrantPreferredTransport as M, type NativeIpcFailureKind as N, type OpenRTCOptions as O, type PlutoIpcBridge as P, getRuntimePolicy as Q, RuntimeClient as R, driveGrantConnectionKey as S, driveGrantConnectionKeyToString as T, type OpenRTCClient as a, type OpenRTCAccessMode as b, type OpenRTCAttestationProvider as c, type OpenRTCAuthProvider as d, type OpenRTCBotVerificationProvider as e, type OpenRTCCapabilityHandle as f, type OpenRTCChannelCatalog as g, type OpenRTCDevicesHandle as h, type OpenRTCDevicesStartOptions as i, type OpenRTCEnrolledDevice as j, type OpenRTCLatestStateMode as k, type OpenRTCRoomHandle as l, type OpenRTCRoomJoinOptions as m, type OpenRTCSpaceHandle as n, type OpenRTCSpaceJoinOptions as o, type OpenRTCTicketHandle as p, type OpenRTCTicketIssueOptions as q, type OpenRTCTransportPreferences as r, type OpenRTCUsageNamespace as s, type OpenRTCUsageUpdate as t, type OpenRTCUsageWarning as u, classifyNativeIpcFailure as v, isNativeIpcCommandUnavailable as w, type OpenRTCClient$1 as x, type PeerReconciliationStats as y, OPENRTC_RUNTIME_POLICY as z };
@@ -1,5 +1,5 @@
1
1
  import { A as AuthContext } from './IEngineBridge-BbsT8hof.js';
2
- import { n as ConnectionOptions, o as ApplicationPayloadCrypto, p as ApplicationPayloadReadinessOptions, q as ApplicationPayloadRouteOptions, r as ProtocolName, s as ApplicationPayloadSendOptions, T as TransportLatencySnapshot, t as PeerState, u as PeerScope, v as PeerHealth, w as ChannelDescriptor$1, x as IncomingStreamChannelMetadata, b as Device, m as BackendConnectionState, L as LocalDeviceInfo, c as DeviceStatusSnapshot, y as ManagedDeviceConnectOptions, C as ClientOptions, h as SignalingSession, R as RuntimeIdentity, J as JoinRoomOptions, a as RoomMember, z as DevicePresenceStatus, F as PeerLifecycleStatus, P as PeerSessionSnapshot } from './types-BHePJWbM.js';
2
+ import { n as ConnectionOptions, o as ApplicationPayloadCrypto, p as ApplicationPayloadReadinessOptions, q as ApplicationPayloadRouteOptions, r as ProtocolName, s as ApplicationPayloadSendOptions, T as TransportLatencySnapshot, t as PeerState, u as PeerScope, v as PeerHealth, w as ChannelDescriptor$1, x as IncomingStreamChannelMetadata, b as Device, m as BackendConnectionState, L as LocalDeviceInfo, c as DeviceStatusSnapshot, y as ManagedDeviceConnectOptions, C as ClientOptions, h as SignalingSession, R as RuntimeIdentity, J as JoinRoomOptions, a as RoomMember, z as DevicePresenceStatus, F as PeerLifecycleStatus, P as PeerSessionSnapshot } from './types-DHuvdODq.js';
3
3
  import { I as ITransport } from './ITransport-BsPcaov7.js';
4
4
 
5
5
  type ConnectionHealth = 'unknown' | 'healthy' | 'suspect' | 'stale';
@@ -595,4 +595,4 @@ type SessionOptions = RuntimeManagedSessionOptions;
595
595
  type Session = RuntimeManagedSession;
596
596
  type ChannelDescriptor = RuntimeChannelDescriptor;
597
597
 
598
- export { type Session as $, type ChannelDescriptor as A, type ConnectionEvent as B, Connection as C, type ConnectionTarget as D, type DeviceProfile as E, type PeerReadiness as F, type PeerStreamOptions as G, type PresenceLoopOptions as H, type IncomingStream as I, type RawConnection as J, type RuntimeApplicationPayloadRouteOptions as K, type RuntimeAuthContext as L, type RuntimeAutoConnectPolicy as M, type RuntimeDevicePresenceStatus as N, type RuntimeDeviceStatus as O, type PeerConnectOptions as P, type RuntimeLogicalChannelFraming as Q, type RuntimeChannelDescriptor as R, type RuntimeManagedSessionKind as S, type RuntimeManagedSessionPlatform as T, type RuntimePeerLifecycleStatus as U, type RuntimePeerScope as V, type RuntimePeerSessionSnapshot as W, type RuntimePresencePolicy as X, type RuntimeUiConnectionStatus as Y, type ScopedChannelOptions as Z, type ScopedLogicalChannel as _, type RuntimeClientOptions as a, type SessionOptions as a0, type RuntimePeerState as b, type RuntimeConnectionStateSnapshot as c, type RuntimePeerReadinessSnapshot as d, type RuntimePeerConnectOptions as e, type RuntimeIncomingStream as f, type RuntimeAuthIdentity as g, type RuntimeLocalDeviceInfo as h, type RuntimeLocalDeviceProfile as i, type RuntimeDevice as j, type RuntimeManagedSessionOptions as k, type RuntimeManagedSession as l, type RuntimeDeviceStatusSnapshot as m, type RuntimeDeviceConnectOptions as n, type RuntimeSession as o, type RuntimeJoinRoomOptions as p, type RuntimeRoomMember as q, type RuntimeConnectionTarget as r, type RuntimeScopedChannelOptions as s, type RuntimeScopedLogicalChannel as t, type RuntimePeerStreamOptions as u, type RuntimeRawConnection as v, type RuntimePresenceLoopOptions as w, type RuntimePeerHealth as x, type RuntimeApplicationPayloadReadinessOptions as y, type RuntimeConnectionEvent as z };
598
+ export { type Session as $, type ChannelDescriptor as A, type ConnectionEvent as B, Connection as C, type ConnectionTarget as D, type DeviceProfile as E, type PeerReadiness as F, type PeerStreamOptions as G, type PresenceLoopOptions as H, type IncomingStream as I, type RawConnection as J, type RuntimeApplicationPayloadRouteOptions as K, type RuntimeAuthContext as L, type RuntimeAutoConnectPolicy as M, type RuntimeDevicePresenceStatus as N, type RuntimeDeviceStatus as O, type PeerConnectOptions as P, type RuntimeLogicalChannelFraming as Q, type RuntimePeerState as R, type RuntimeManagedSessionKind as S, type RuntimeManagedSessionPlatform as T, type RuntimePeerLifecycleStatus as U, type RuntimePeerScope as V, type RuntimePeerSessionSnapshot as W, type RuntimePresencePolicy as X, type RuntimeUiConnectionStatus as Y, type ScopedChannelOptions as Z, type ScopedLogicalChannel as _, type RuntimeConnectionStateSnapshot as a, type SessionOptions as a0, type RuntimePeerReadinessSnapshot as b, type RuntimePeerConnectOptions as c, type RuntimeIncomingStream as d, type RuntimeClientOptions as e, type RuntimeAuthIdentity as f, type RuntimeLocalDeviceInfo as g, type RuntimeLocalDeviceProfile as h, type RuntimeDevice as i, type RuntimeManagedSessionOptions as j, type RuntimeManagedSession as k, type RuntimeDeviceStatusSnapshot as l, type RuntimeDeviceConnectOptions as m, type RuntimeSession as n, type RuntimeJoinRoomOptions as o, type RuntimeRoomMember as p, type RuntimeConnectionTarget as q, type RuntimeScopedChannelOptions as r, type RuntimeScopedLogicalChannel as s, type RuntimePeerStreamOptions as t, type RuntimeRawConnection as u, type RuntimeChannelDescriptor as v, type RuntimePresenceLoopOptions as w, type RuntimePeerHealth as x, type RuntimeApplicationPayloadReadinessOptions as y, type RuntimeConnectionEvent as z };
@@ -1080,4 +1080,4 @@ interface JoinRequest {
1080
1080
  state: 'pending' | 'accepted' | 'rejected';
1081
1081
  }
1082
1082
 
1083
- export type { SignalingOptions as $, AuthMode as A, BackendPeerBiStream as B, ClientOptions as C, DiscoveryMode as D, ExplicitFileDataSendParams as E, PeerLifecycleStatus as F, GrantScope as G, RouteDescriptor as H, ISignalingBackend as I, JoinRoomOptions as J, ProtocolCapability as K, LocalDeviceInfo as L, ManagedConnectionRecord as M, NativeManagedSessionStartResult as N, ProtocolCapabilityMap as O, PeerSessionSnapshot as P, ApplicationCryptoStreamTools as Q, RuntimeIdentity as R, SignalingMode as S, TransportLatencySnapshot as T, ApplicationCryptoBiStream as U, RouteFamily as V, RouteImplementationKind as W, ConnectDeviceHooks as X, ConnectDeviceOptions as Y, ConnectDeviceResult as Z, AppLimits as _, RoomMember as a, RoomCreationMode as a0, ScanningLoopOptions as a1, ScanningLoopHandle as a2, RuntimeBootstrapOptions as a3, RuntimeBootstrapResult as a4, ManagedApplicationRouteOptions as a5, JoinRequest as a6, SpaceTokenProvider as a7, Device as b, DeviceStatusSnapshot as c, ResolvedPeerIdentity as d, SignalingEnvelope as e, DeviceEvent as f, DesiredPeerProjection as g, SignalingSession as h, SessionEvent as i, BackendPeerUniStream as j, NativeConnectParams as k, NativeConnectResult as l, BackendConnectionState as m, ConnectionOptions as n, ApplicationPayloadCrypto as o, ApplicationPayloadReadinessOptions as p, ApplicationPayloadRouteOptions as q, ProtocolName as r, ApplicationPayloadSendOptions as s, PeerState as t, PeerScope as u, PeerHealth as v, ChannelDescriptor as w, IncomingStreamChannelMetadata as x, ManagedDeviceConnectOptions as y, DevicePresenceStatus as z };
1083
+ export type { SignalingOptions as $, AuthMode as A, BackendPeerBiStream as B, ClientOptions as C, DiscoveryMode as D, ExplicitFileDataSendParams as E, PeerLifecycleStatus as F, GrantScope as G, RouteDescriptor as H, ISignalingBackend as I, JoinRoomOptions as J, ProtocolCapability as K, LocalDeviceInfo as L, ManagedConnectionRecord as M, NativeManagedSessionStartResult as N, ProtocolCapabilityMap as O, PeerSessionSnapshot as P, ApplicationCryptoStreamTools as Q, RuntimeIdentity as R, SignalingMode as S, TransportLatencySnapshot as T, ApplicationCryptoBiStream as U, RouteFamily as V, RouteImplementationKind as W, ConnectDeviceHooks as X, ConnectDeviceOptions as Y, ConnectDeviceResult as Z, AppLimits as _, RoomMember as a, RoomCreationMode as a0, ScanningLoopOptions as a1, ScanningLoopHandle as a2, RuntimeBootstrapOptions as a3, RuntimeBootstrapResult as a4, ManagedApplicationRouteOptions as a5, JoinRequest as a6, Device as b, DeviceStatusSnapshot as c, ResolvedPeerIdentity as d, SignalingEnvelope as e, DeviceEvent as f, DesiredPeerProjection as g, SignalingSession as h, SessionEvent as i, BackendPeerUniStream as j, NativeConnectParams as k, NativeConnectResult as l, BackendConnectionState as m, ConnectionOptions as n, ApplicationPayloadCrypto as o, ApplicationPayloadReadinessOptions as p, ApplicationPayloadRouteOptions as q, ProtocolName as r, ApplicationPayloadSendOptions as s, PeerState as t, PeerScope as u, PeerHealth as v, ChannelDescriptor as w, IncomingStreamChannelMetadata as x, ManagedDeviceConnectOptions as y, DevicePresenceStatus as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrtc",
3
- "version": "2.0.0-rc.11",
3
+ "version": "2.0.0-rc.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -43,18 +43,10 @@
43
43
  "types": "./dist/testing.d.ts",
44
44
  "import": "./dist/testing.js"
45
45
  },
46
- "./auth": {
47
- "types": "./dist/auth/index.d.ts",
48
- "import": "./dist/auth/index.js"
49
- },
50
46
  "./runtime": {
51
47
  "types": "./dist/runtime/index.d.ts",
52
48
  "import": "./dist/runtime/index.js"
53
49
  },
54
- "./runtime/legacy": {
55
- "types": "./dist/runtime/legacy.d.ts",
56
- "import": "./dist/runtime/legacy.js"
57
- },
58
50
  "./runtime/device-status": {
59
51
  "types": "./dist/runtime/device-status.d.ts",
60
52
  "import": "./dist/runtime/device-status.js"
@@ -63,18 +55,10 @@
63
55
  "types": "./dist/runtime/WasmRuntimeAdapter.d.ts",
64
56
  "import": "./dist/runtime/WasmRuntimeAdapter.js"
65
57
  },
66
- "./runtime/tauri": {
67
- "types": "./dist/runtime/tauri.d.ts",
68
- "import": "./dist/runtime/tauri.js"
69
- },
70
58
  "./transport": {
71
59
  "types": "./dist/transport/index.d.ts",
72
60
  "import": "./dist/transport/index.js"
73
61
  },
74
- "./auth/internal": {
75
- "types": "./dist/auth/internal.d.ts",
76
- "import": "./dist/auth/internal.js"
77
- },
78
62
  "./package.json": "./package.json"
79
63
  },
80
64
  "scripts": {
@@ -107,14 +91,6 @@
107
91
  "@noble/hashes": "^1.8.0",
108
92
  "tweetnacl": "^1.0.3"
109
93
  },
110
- "peerDependencies": {
111
- "firebase": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0"
112
- },
113
- "peerDependenciesMeta": {
114
- "firebase": {
115
- "optional": true
116
- }
117
- },
118
94
  "devDependencies": {
119
95
  "@types/node": "^20.0.0",
120
96
  "@vitest/coverage-v8": "^4.0.18",
@@ -1 +0,0 @@
1
- export{a as resolveOptions,b as wrapAssembly}from'./chunk-2QHDEGVX.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';
@@ -1 +0,0 @@
1
- export{w as WasmBridge}from'./chunk-JIVVHBCB.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';