openrtc 2.0.0-rc.2 → 2.0.0-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +11 -1
  2. package/dist/DelegatingRuntimeAdapter-7Y3gss5D.d.ts +134 -0
  3. package/dist/OpenRTCShared-LDKG5RPN.js +1 -0
  4. package/dist/WasmBridge-VN3MA4LT.js +1 -0
  5. package/dist/chunk-FQH6O3SU.js +2 -0
  6. package/dist/chunk-KEPDY3LB.js +3 -0
  7. package/dist/{chunk-A3IAG6EL.js → chunk-NCMT4MKM.js} +1 -1
  8. package/dist/chunk-NW25RLPN.js +2 -0
  9. package/dist/chunk-PQK5SJ47.js +1 -0
  10. package/dist/{chunk-RD3JEGGF.js → chunk-QHSM5NFZ.js} +2 -2
  11. package/dist/chunk-R2QM2IDY.js +2 -0
  12. package/dist/chunk-RGRVKR66.js +1 -0
  13. package/dist/{chunk-7Z6N46RB.js → chunk-RRMBD5OL.js} +1 -1
  14. package/dist/chunk-Z2WVSXPW.js +1 -0
  15. package/dist/deviceProfile-3BEQZLJF.js +2 -0
  16. package/dist/deviceRoster-GHF6MWXF.js +1 -0
  17. package/dist/dist-FIVA6EPA.js +277 -0
  18. package/dist/factories-NLQVWWJE.js +1 -0
  19. package/dist/index.d.ts +4 -6
  20. package/dist/index.js +1 -1
  21. package/dist/ipcFactory-SMUMTEMH.js +1 -0
  22. package/dist/native.d.ts +4 -7
  23. package/dist/native.js +1 -1
  24. package/dist/openrtc-3YHRRPAG.js +2 -0
  25. package/dist/openrtc_bg.wasm +0 -0
  26. package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -3
  27. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  28. package/dist/runtime/device-status.d.ts +2 -2
  29. package/dist/runtime/index.d.ts +21 -73
  30. package/dist/runtime/index.js +1 -2
  31. package/dist/testing.d.ts +7 -17
  32. package/dist/testing.js +1 -1
  33. package/dist/transport/index.d.ts +2 -2
  34. package/dist/transport/index.js +1 -1
  35. package/dist/{types-BVJr065k.d.ts → types-BwmoJU2O.d.ts} +3 -1
  36. package/dist/{OpenRTCShared-ZQPu5LqL.d.ts → types-DE4iPkMB.d.ts} +268 -8
  37. package/dist/{types-DkgaCyqS.d.ts → types-oGGnaSW2.d.ts} +2 -2
  38. package/package.json +1 -25
  39. package/dist/DelegatingRuntimeAdapter-DqfHkjLy.d.ts +0 -373
  40. package/dist/OpenRTCShared-TKAQLONA.js +0 -1
  41. package/dist/WasmBridge-2A22U7RU.js +0 -1
  42. package/dist/auth/index.d.ts +0 -78
  43. package/dist/auth/index.js +0 -1
  44. package/dist/auth/internal.d.ts +0 -4
  45. package/dist/auth/internal.js +0 -1
  46. package/dist/chunk-2QHDEGVX.js +0 -1
  47. package/dist/chunk-3USHQ7QW.js +0 -3
  48. package/dist/chunk-5LRLWIT5.js +0 -1
  49. package/dist/chunk-6TAVJ46R.js +0 -1
  50. package/dist/chunk-BXFXPIXO.js +0 -1
  51. package/dist/chunk-F2XGNLXL.js +0 -2
  52. package/dist/chunk-GW7P3D54.js +0 -1
  53. package/dist/chunk-IEQTFQ3Q.js +0 -1
  54. package/dist/chunk-K37WVIZL.js +0 -1
  55. package/dist/chunk-N26S7V4N.js +0 -1
  56. package/dist/chunk-N4SX7C3W.js +0 -2
  57. package/dist/chunk-NB4H5TP3.js +0 -1
  58. package/dist/chunk-PODAMIL6.js +0 -2
  59. package/dist/chunk-UEYM6WTT.js +0 -2
  60. package/dist/chunk-VK6KX433.js +0 -1
  61. package/dist/chunk-YBXGNKM7.js +0 -2
  62. package/dist/chunk-YQWQDTQ3.js +0 -2
  63. package/dist/factories-SIVMTIHJ.js +0 -1
  64. package/dist/ipc-CflAVodw.d.ts +0 -11
  65. package/dist/ipcFactory-QY44OIKA.js +0 -1
  66. package/dist/runtime/legacy.d.ts +0 -18
  67. package/dist/runtime/legacy.js +0 -1
  68. package/dist/runtime/tauri.d.ts +0 -6
  69. package/dist/runtime/tauri.js +0 -1
  70. package/dist/tauri-Cz9n17g8.d.ts +0 -33
  71. package/dist/types-DNl4KHHY.d.ts +0 -195
@@ -1,19 +1,13 @@
1
- import { R as RuntimeFactoryOptions, P as PlutoRuntimeAssembly, d as OpenRTCClient, e as PeerReconciliationStats } from '../OpenRTCShared-ZQPu5LqL.js';
2
- export { f as OPENRTC_RUNTIME_POLICY, g as RuntimeClient, h as RuntimePolicySnapshot, D as ScopedConnectionActorError, i as ScopedConnectionActorErrorKind, j as ScopedConnectionActorHandle, k as ScopedConnectionActorHandleOptions, l as ScopedConnectionActorRegistry, m as ScopedConnectionActorState, n as ScopedConnectionClose, o as ScopedConnectionDial, p as ScopedConnectionKey, q as ScopedLogicalChannelHandle, r as ScopedPreferredTransport, s as getRuntimePolicy, t as scopedConnectionKey, u as scopedConnectionKeyToString } from '../OpenRTCShared-ZQPu5LqL.js';
3
- import { f as OpenRTCCapabilityHandle } from '../types-DNl4KHHY.js';
4
- import { C as Connection, r as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-DkgaCyqS.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-DkgaCyqS.js';
1
+ import { P as PlutoIpcBridge, y as OpenRTCClient, f as OpenRTCCapabilityHandle, z as PeerReconciliationStats } from '../types-DE4iPkMB.js';
2
+ export { N as NativeIpcFailureKind, A as OPENRTC_RUNTIME_POLICY, B as PlutoIpcUnlisten, R as RuntimeClient, C as RuntimePolicySnapshot, D as ScopedConnectionActorError, E as ScopedConnectionActorErrorKind, F as ScopedConnectionActorHandle, G as ScopedConnectionActorHandleOptions, H as ScopedConnectionActorRegistry, I as ScopedConnectionActorState, J as ScopedConnectionClose, K as ScopedConnectionDial, L as ScopedConnectionKey, M as ScopedLogicalChannelHandle, Q as ScopedPreferredTransport, w as classifyNativeIpcFailure, S as getRuntimePolicy, x as isNativeIpcCommandUnavailable, T as scopedConnectionKey, U as scopedConnectionKeyToString } from '../types-DE4iPkMB.js';
3
+ import { C as Connection, q as RuntimeConnectionTarget, u as RuntimeRawConnection } from '../types-oGGnaSW2.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-oGGnaSW2.js';
6
5
  import * as Draft14 from '@moq/net';
7
- import { a0 as SignalingOptions, q as ISignalingBackend, R as RuntimeIdentity, j as RoomMember, r as SignalingEnvelope, S as SignalingSession, D as Device, x as DesiredPeerProjection, B as BackendConnectionState, $ as AppLimits, H as GrantScope, J as JoinRoomOptions, I as IncomingStreamChannelMetadata, U as ApplicationCryptoStreamTools, a1 as RoomCreationMode, i as ClientOptions, A as ApplicationPayloadCrypto, n as DiscoveryMode, Q as ProtocolCapabilityMap, a2 as ScanningLoopOptions, a3 as ScanningLoopHandle, a4 as RuntimeBootstrapOptions, a5 as RuntimeBootstrapResult, a as ApplicationPayloadReadinessOptions, a6 as ManagedApplicationRouteOptions, d as PeerState, e as PeerScope, f as PeerHealth, g as ChannelDescriptor, a7 as JoinRequest, N as NativeConnectParams, z as NativeConnectResult, a8 as SpaceTokenProvider } from '../types-BVJr065k.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-BwmoJU2O.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
- import { I as IpcRuntimeAdapter } from '../tauri-Cz9n17g8.js';
12
- export { a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-Cz9n17g8.js';
13
- import { a as WasmBridge } from '../DelegatingRuntimeAdapter-DqfHkjLy.js';
14
- import { P as PlutoIpcBridge } from '../ipc-CflAVodw.js';
15
- export { N as NativeIpcFailureKind, a as PlutoIpcUnlisten, c as classifyNativeIpcFailure, i as isNativeIpcCommandUnavailable } from '../ipc-CflAVodw.js';
16
- export { WasmRuntimeAdapter } from './WasmRuntimeAdapter.js';
10
+ import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from '../DelegatingRuntimeAdapter-7Y3gss5D.js';
17
11
  import '../IEngineBridge-BbsT8hof.js';
18
12
  import '../ITransport-BsPcaov7.js';
19
13
 
@@ -63,17 +57,19 @@ declare class Signaling {
63
57
  setWasmClient(client: any): void;
64
58
  }
65
59
 
66
- /**
67
- * @deprecated Legacy assembly helper. Use `OpenRTC()` for app code.
68
- * Removal target: OpenRTC 0.2.0.
69
- */
70
- declare function createWasmClient(options: RuntimeFactoryOptions): Promise<PlutoRuntimeAssembly<WasmBridge>>;
71
- /**
72
- * @deprecated Legacy assembly helper. Native applications should use
73
- * `createNativeOpenRTC` from `openrtc/native`.
74
- * Removal target: OpenRTC 0.2.0.
75
- */
76
- declare function createIpcClient(options: RuntimeFactoryOptions, bridge: PlutoIpcBridge): PlutoRuntimeAssembly<IpcRuntimeAdapter>;
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
+ }
77
73
 
78
74
  type OpenRTCCapabilityRuntime = OpenRTCClient;
79
75
  /**
@@ -383,7 +379,7 @@ declare class Client {
383
379
  buildCompoundTicketWithToken(irohTicket: string, grantScope: GrantScope, maxConnections?: number): string;
384
380
  setManagedPresenceTicket(ticket: string | null): void;
385
381
  clearManagedPresenceTicket(): void;
386
- registerSessionToken(token: string, grantScope: GrantScope, maxConnections: number): void;
382
+ registerSessionToken(token: string, grantScope: GrantScope, maxConnections: number, expiresAtMs?: number): void;
387
383
  revokeSessionToken(token: string): void;
388
384
  revokeTokensByScope(grantScope: GrantScope): Promise<string[]>;
389
385
  clearSessionTokens(): Promise<void>;
@@ -540,52 +536,4 @@ declare function createRuntimeJsonFrameDecoder<T = unknown>(onValue: RuntimeJson
540
536
  declare function concatRuntimeBytes(a: ByteArrayLike, b: ByteArrayLike): ByteArray;
541
537
  declare function readRuntimeU32BE(bytes: ByteArrayLike, offset: number): number;
542
538
 
543
- type MintSpaceTokenRequest = {
544
- spaceKey: string;
545
- memberId?: string;
546
- ttl?: number;
547
- sandboxAppId?: string;
548
- };
549
- type MintSpaceTokenResponse = {
550
- token: string;
551
- expiresAt: number;
552
- tokenLifetimeSeconds: number;
553
- namespaceId: string;
554
- spaceAppTag: string;
555
- };
556
- /**
557
- * Mint a namespace-scoped Firebase custom token from your backend using the
558
- * OpenRTC `POST /v1/spaces/tokens` endpoint. Never call this from browser code
559
- * with a secret key — proxy through your server.
560
- */
561
- type EnableSpaceAuthResponse = {
562
- success: true;
563
- space: {
564
- namespaceId: string;
565
- requireScopedAuth: boolean;
566
- status: 'active' | 'revoked';
567
- };
568
- };
569
- /**
570
- * Opt a provisioned space into scoped-auth mode (required for all spaces).
571
- * Call from your backend with sk_live_... only.
572
- */
573
- declare function enableSpaceAuth(endpointUrl: string, secretKey: string, namespaceId: string): Promise<EnableSpaceAuthResponse>;
574
- declare function mintSpaceToken(endpointUrl: string, secretKey: string, request: MintSpaceTokenRequest): Promise<MintSpaceTokenResponse>;
575
- /**
576
- * Browser-safe space auth for static sites. Calls the rate-limited
577
- * `v1SpacePublicTokens` endpoint (pk_live_ + spaceKey only).
578
- */
579
- declare function createPublicSpaceTokenProvider(options: {
580
- apiKey: string;
581
- space?: string;
582
- spaceKey?: string;
583
- endpointUrl?: string;
584
- memberIdStorageKey?: string;
585
- sandboxAppId?: string;
586
- }): SpaceTokenProvider;
587
- declare function sandboxSpaceKey(spaceKey: string, sandboxAppId?: string): string;
588
- declare const spaceToken: typeof createPublicSpaceTokenProvider;
589
- declare const createSpaceTokenProvider: typeof createPublicSpaceTokenProvider;
590
-
591
- export { Connection, type CorrelationFields, type EnableSpaceAuthResponse, IpcRuntimeAdapter, type MintSpaceTokenRequest, type MintSpaceTokenResponse, PlutoIpcBridge as NativeBridge, type OpenRTCCapabilityRuntime, PlutoIpcBridge, PlutoRuntimeAssembly, RuntimeCapabilities, RuntimeConnectionController, RuntimeConnectionTarget, RuntimeFactoryOptions, type RuntimeJsonFrameDecoderOptions, type RuntimeJsonFrameHandler, RuntimeRawConnection, type RuntimeU32BEFrameHandler, clog, concatRuntimeBytes, correlationForDriveGrantScope, createIpcClient, createPublicSpaceTokenProvider, createRuntimeJsonFrameDecoder, createRuntimeU32BEFrameDecoder, createSpaceTokenProvider, createWasmClient, 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{a as WasmRuntimeAdapter}from'../chunk-GW7P3D54.js';export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-5LRLWIT5.js';export{b as runtimeFromCapability}from'../chunk-PODAMIL6.js';export{b as createIpcClient,a as createWasmClient}from'../chunk-YQWQDTQ3.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-3USHQ7QW.js';export{f as IpcRuntimeAdapter}from'../chunk-F2XGNLXL.js';import'../chunk-A3IAG6EL.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-YBXGNKM7.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-KEPDY3LB.js';export{a as classifyNativeIpcFailure,b as isNativeIpcCommandUnavailable}from'../chunk-Z2WVSXPW.js';export{b as runtimeFromCapability}from'../chunk-NW25RLPN.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';import'../chunk-NCMT4MKM.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-FQH6O3SU.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-ZQPu5LqL.js';
2
- import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
3
- import { a as RuntimeClientOptions } from './types-DkgaCyqS.js';
4
- import { O as OpenRTCOptions, a as OpenRTCClient$1 } from './types-DNl4KHHY.js';
5
- import './types-BVJr065k.js';
1
+ import { O as OpenRTCOptions, P as PlutoIpcBridge, a as OpenRTCClient } from './types-DE4iPkMB.js';
2
+ import './types-BwmoJU2O.js';
6
3
  import './IEngineBridge-BbsT8hof.js';
7
- import './capabilities-YSskrE8H.js';
4
+ import './types-oGGnaSW2.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-UEYM6WTT.js';import {c}from'./chunk-PODAMIL6.js';import {a}from'./chunk-IEQTFQ3Q.js';import'./chunk-2QHDEGVX.js';import'./chunk-6TAVJ46R.js';import'./chunk-N4SX7C3W.js';import'./chunk-YQWQDTQ3.js';import'./chunk-3USHQ7QW.js';import'./chunk-F2XGNLXL.js';import'./chunk-A3IAG6EL.js';import'./chunk-7Z6N46RB.js';import'./chunk-YBXGNKM7.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-SIVMTIHJ.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-QY44OIKA.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-R2QM2IDY.js';import {c}from'./chunk-NW25RLPN.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-NLQVWWJE.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-SMUMTEMH.js');return i(t,e)}})}export{s as createTestingNativeOpenRTC,l as createTestingOpenRTC};
@@ -1,5 +1,5 @@
1
- import { P as ProtocolName, K as RouteDescriptor, O as ProtocolCapability, Q as ProtocolCapabilityMap, A as ApplicationPayloadCrypto, U as ApplicationCryptoStreamTools } from '../types-BVJr065k.js';
2
- export { V as ApplicationCryptoBiStream, W as RouteFamily, X as RouteImplementationKind } from '../types-BVJr065k.js';
1
+ import { r as ProtocolName, H as RouteDescriptor, K as ProtocolCapability, O as ProtocolCapabilityMap, o as ApplicationPayloadCrypto, Q as ApplicationCryptoStreamTools } from '../types-BwmoJU2O.js';
2
+ export { U as ApplicationCryptoBiStream, V as RouteFamily, W as RouteImplementationKind } from '../types-BwmoJU2O.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';
@@ -282,6 +282,8 @@ interface ClientOptions {
282
282
  kind: 'user' | 'space' | 'room' | 'session';
283
283
  id: string;
284
284
  };
285
+ /** @internal Raw host platform metadata used only for roster presentation. */
286
+ coordinationPlatformType?: string;
285
287
  /**
286
288
  * Supplies the provider-neutral platform-attestation token used by the
287
289
  * configured coordination control plane.
@@ -1080,4 +1082,4 @@ interface JoinRequest {
1080
1082
  state: 'pending' | 'accepted' | 'rejected';
1081
1083
  }
1082
1084
 
1083
- export type { AppLimits as $, ApplicationPayloadCrypto as A, BackendConnectionState as B, ConnectionOptions as C, Device as D, ExplicitFileDataSendParams as E, SessionEvent as F, NativeManagedSessionStartResult as G, GrantScope as H, IncomingStreamChannelMetadata as I, JoinRoomOptions as J, RouteDescriptor as K, LocalDeviceInfo as L, ManagedDeviceConnectOptions as M, NativeConnectParams as N, ProtocolCapability as O, ProtocolName as P, ProtocolCapabilityMap as Q, RuntimeIdentity as R, SignalingSession as S, TransportLatencySnapshot as T, ApplicationCryptoStreamTools as U, ApplicationCryptoBiStream as V, RouteFamily as W, RouteImplementationKind as X, ConnectDeviceHooks as Y, ConnectDeviceOptions as Z, ConnectDeviceResult as _, ApplicationPayloadReadinessOptions as a, SignalingOptions as a0, RoomCreationMode as a1, ScanningLoopOptions as a2, ScanningLoopHandle as a3, RuntimeBootstrapOptions as a4, RuntimeBootstrapResult as a5, ManagedApplicationRouteOptions as a6, JoinRequest as a7, SpaceTokenProvider as a8, ApplicationPayloadRouteOptions as b, ApplicationPayloadSendOptions as c, PeerState as d, PeerScope as e, PeerHealth as f, ChannelDescriptor as g, DeviceStatusSnapshot as h, ClientOptions as i, RoomMember as j, DevicePresenceStatus as k, PeerLifecycleStatus as l, PeerSessionSnapshot as m, DiscoveryMode as n, AuthMode as o, SignalingMode as p, ISignalingBackend as q, SignalingEnvelope as r, BackendPeerBiStream as s, BackendPeerUniStream as t, ManagedConnectionRecord as u, ResolvedPeerIdentity as v, DeviceEvent as w, DesiredPeerProjection as x, CoreClientBridgeHost as y, NativeConnectResult as z };
1085
+ 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 };
@@ -1,8 +1,18 @@
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
+ 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-BwmoJU2O.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-DkgaCyqS.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-oGGnaSW2.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;
@@ -675,7 +695,6 @@ declare class RuntimeClient {
675
695
  type RuntimeAdapterWithAuth = ISignalingBackend & {
676
696
  setAuthContext?: (context: AuthContext | null) => Promise<void> | void;
677
697
  };
678
- type RuntimeFactoryOptions = RuntimeClientOptions;
679
698
  interface PlutoRuntimeAssembly<TBackend extends RuntimeAdapterWithAuth = RuntimeAdapterWithAuth> {
680
699
  runtime: RuntimeClient;
681
700
  identity: any;
@@ -857,7 +876,7 @@ interface OpenRTCAdvancedNamespace {
857
876
  *
858
877
  * This is the unified type returned by OpenRTC() and OpenRTC.native().
859
878
  */
860
- interface OpenRTCClient extends RuntimeClient {
879
+ interface OpenRTCClient$1 extends RuntimeClient {
861
880
  readonly devices: OpenRTCDeviceNamespace;
862
881
  readonly peers: OpenRTCPeerNamespace;
863
882
  readonly channels: OpenRTCChannelNamespace;
@@ -942,4 +961,245 @@ interface OpenRTCClient extends RuntimeClient {
942
961
  readonly _assembly: PlutoRuntimeAssembly;
943
962
  }
944
963
 
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 };
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
+ /**
1009
+ * Public, non-secret presentation metadata for one enrolled installation.
1010
+ * OpenRTC derives a useful browser default when these fields are omitted;
1011
+ * native hosts should pass the OS/device information reported by their host.
1012
+ */
1013
+ interface OpenRTCDeviceProfile {
1014
+ /** Human-readable label such as `Bryant's iPhone` or `Chrome on Android`. */
1015
+ name?: string;
1016
+ /** Raw OS/runtime label such as `ios`, `android`, `macos`, or `web`. */
1017
+ platform?: string;
1018
+ /** Optional application-owned public presence metadata, bounded to 4 KiB. */
1019
+ metadata?: string;
1020
+ }
1021
+ interface OpenRTCAttestationProvider {
1022
+ readonly kind: 'firebase-app-check' | 'apple-app-attest' | 'play-integrity' | `custom:${string}`;
1023
+ /**
1024
+ * Describes what the provider actually signs. Reusable app-integrity
1025
+ * tokens (for example Firebase App Check) do not become request-bound just
1026
+ * because OpenRTC supplies an enrollment challenge. The server derives and
1027
+ * enforces the authoritative binding from the registered provider kind;
1028
+ * this field keeps host integrations and diagnostics honest.
1029
+ */
1030
+ readonly evidenceBinding: 'app-session' | 'request-challenge';
1031
+ getEvidence(input: {
1032
+ challenge: string;
1033
+ apiKey: string;
1034
+ }): Promise<{
1035
+ token: string;
1036
+ }>;
1037
+ }
1038
+ /**
1039
+ * Optional consumer-owned bot challenge. Core OpenRTC does not render a UI or
1040
+ * load a CAPTCHA dependency; the host supplies a fresh token only when its
1041
+ * developer manifest requires anonymous capability verification.
1042
+ */
1043
+ interface OpenRTCBotVerificationProvider {
1044
+ getToken(input: {
1045
+ action: 'openrtc_capability';
1046
+ apiKey: string;
1047
+ }): Promise<string>;
1048
+ }
1049
+ interface OpenRTCUsageUpdate {
1050
+ sessionCreditsUsd: number;
1051
+ operation: string;
1052
+ estimated: boolean;
1053
+ }
1054
+ interface OpenRTCUsageWarning extends OpenRTCUsageUpdate {
1055
+ thresholdCreditsUsd: number;
1056
+ kind: 'warning' | 'session-limit';
1057
+ }
1058
+ interface OpenRTCTransportPreferences {
1059
+ iroh?: boolean;
1060
+ webrtc?: boolean;
1061
+ relay?: boolean;
1062
+ moq?: boolean;
1063
+ ble?: boolean;
1064
+ /**
1065
+ * Advanced privacy mode. `relay-only` suppresses direct Iroh addresses,
1066
+ * local discovery, and host/srflx WebRTC candidates. It also requires the
1067
+ * developer manifest's relay opt-in.
1068
+ */
1069
+ privacy?: 'direct' | 'relay-only';
1070
+ /**
1071
+ * Advanced native integration for hosts whose Rust process owns the
1072
+ * application protocol registry (for example, a Tauri file-transfer host).
1073
+ * Normal SDK consumers should leave this disabled.
1074
+ */
1075
+ nativeHostProtocols?: boolean;
1076
+ priority?: readonly ('iroh' | 'webrtc' | 'moq' | 'ble')[];
1077
+ }
1078
+ interface OpenRTCOptions {
1079
+ apiKey: string;
1080
+ auth?: OpenRTCAuthProvider;
1081
+ trust?: {
1082
+ attestation?: OpenRTCAttestationProvider;
1083
+ botVerification?: OpenRTCBotVerificationProvider;
1084
+ };
1085
+ usage?: {
1086
+ warnAtSessionCreditsUsd?: number;
1087
+ maxSessionCreditsUsd?: number;
1088
+ onUsage?: (event: OpenRTCUsageUpdate) => void;
1089
+ onWarning?: (warning: OpenRTCUsageWarning) => void;
1090
+ };
1091
+ transports?: OpenRTCTransportPreferences;
1092
+ }
1093
+ type OpenRTCAccessMode = 'capability' | 'authenticated';
1094
+ type OpenRTCLatestStateMode = 'reliable' | 'latest-state';
1095
+ interface OpenRTCCapabilityHandle {
1096
+ readonly kind: 'devices' | 'space' | 'room' | 'ticket';
1097
+ readonly id: string;
1098
+ readonly peers: OpenRTCPeerNamespace;
1099
+ readonly channels: OpenRTCChannelNamespace;
1100
+ readonly diagnostics: OpenRTCDiagnosticsNamespace;
1101
+ readonly closed: boolean;
1102
+ close(): Promise<void>;
1103
+ }
1104
+ interface OpenRTCDevicesHandle extends OpenRTCCapabilityHandle {
1105
+ readonly kind: 'devices';
1106
+ localId(): ReturnType<OpenRTCDeviceNamespace['localId']>;
1107
+ localInfo(): ReturnType<OpenRTCDeviceNamespace['localInfo']>;
1108
+ list(): ReturnType<OpenRTCDeviceNamespace['list']>;
1109
+ listWithStatus(): ReturnType<OpenRTCDeviceNamespace['listWithStatus']>;
1110
+ watch: OpenRTCDeviceNamespace['watch'];
1111
+ connect: OpenRTCDeviceNamespace['connect'];
1112
+ disconnect: OpenRTCDeviceNamespace['disconnect'];
1113
+ }
1114
+ interface OpenRTCSpaceHandle extends OpenRTCCapabilityHandle {
1115
+ readonly kind: 'space';
1116
+ readonly delivery: OpenRTCLatestStateMode;
1117
+ leave(): Promise<void>;
1118
+ }
1119
+ interface OpenRTCRoomHandle extends OpenRTCCapabilityHandle {
1120
+ readonly kind: 'room';
1121
+ readonly membership: 'ephemeral' | 'durable';
1122
+ leave(): Promise<void>;
1123
+ }
1124
+ interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
1125
+ readonly kind: 'ticket';
1126
+ readonly token: string;
1127
+ }
1128
+ interface OpenRTCDevicesStartOptions {
1129
+ auth?: OpenRTCAuthProvider;
1130
+ autoConnect?: 'none' | 'online';
1131
+ /** Optional local profile; it does not alter the durable device identity. */
1132
+ profile?: OpenRTCDeviceProfile;
1133
+ maxPeers?: number;
1134
+ /** Requires the app manifest's advanced-fanout opt-in. */
1135
+ advancedFanout?: boolean;
1136
+ }
1137
+ interface OpenRTCSpaceJoinOptions {
1138
+ access?: 'capability';
1139
+ identity?: 'ephemeral';
1140
+ payload?: OpenRTCLatestStateMode;
1141
+ maxPeers?: number;
1142
+ /** Requires the app manifest's advanced-fanout opt-in. */
1143
+ advancedFanout?: boolean;
1144
+ }
1145
+ interface OpenRTCRoomJoinOptions {
1146
+ access?: OpenRTCAccessMode;
1147
+ membership?: 'ephemeral' | 'durable';
1148
+ auth?: OpenRTCAuthProvider;
1149
+ maxPeers?: number;
1150
+ /** Requires the app manifest's advanced-fanout opt-in. */
1151
+ advancedFanout?: boolean;
1152
+ }
1153
+ interface OpenRTCTicketIssueOptions {
1154
+ maxPeers?: number;
1155
+ /** Requires the app manifest's advanced-fanout opt-in. */
1156
+ advancedFanout?: boolean;
1157
+ }
1158
+ interface OpenRTCChannelCatalog {
1159
+ register(descriptor: RuntimeChannelDescriptor): () => void;
1160
+ list(): readonly RuntimeChannelDescriptor[];
1161
+ }
1162
+ interface OpenRTCUsageNamespace {
1163
+ estimate(input: {
1164
+ operation: string;
1165
+ units?: number;
1166
+ }): {
1167
+ creditsUsd: number;
1168
+ estimated: true;
1169
+ };
1170
+ readonly sessionCreditsUsd: number;
1171
+ }
1172
+ interface OpenRTCClient {
1173
+ readonly devices: {
1174
+ /**
1175
+ * Returns this installation's durable, app-scoped device ID without
1176
+ * starting a capability or performing network work.
1177
+ */
1178
+ localId(): Promise<string>;
1179
+ start(options?: OpenRTCDevicesStartOptions): Promise<OpenRTCDevicesHandle>;
1180
+ listEnrolled(options?: {
1181
+ auth?: OpenRTCAuthProvider;
1182
+ }): Promise<OpenRTCEnrolledDevice[]>;
1183
+ revoke(deviceId: string, options?: {
1184
+ auth?: OpenRTCAuthProvider;
1185
+ }): Promise<void>;
1186
+ revokeAll(options?: {
1187
+ auth?: OpenRTCAuthProvider;
1188
+ exceptCurrent?: boolean;
1189
+ }): Promise<void>;
1190
+ };
1191
+ readonly spaces: {
1192
+ join(id: string, options?: OpenRTCSpaceJoinOptions): Promise<OpenRTCSpaceHandle>;
1193
+ };
1194
+ readonly rooms: {
1195
+ join(id: string, options?: OpenRTCRoomJoinOptions): Promise<OpenRTCRoomHandle>;
1196
+ };
1197
+ readonly tickets: {
1198
+ issue(id: string, options?: OpenRTCTicketIssueOptions): Promise<OpenRTCTicketHandle>;
1199
+ };
1200
+ readonly channels: OpenRTCChannelCatalog;
1201
+ readonly usage: OpenRTCUsageNamespace;
1202
+ close(): Promise<void>;
1203
+ }
1204
+
1205
+ export { OPENRTC_RUNTIME_POLICY as A, type PlutoIpcUnlisten as B, type RuntimePolicySnapshot as C, DriveGrantActorError as D, type DriveGrantActorErrorKind as E, DriveGrantActorHandle as F, type DriveGrantActorHandleOptions as G, DriveGrantActorRegistry as H, type DriveGrantActorState as I, type DriveGrantClose as J, type DriveGrantDial as K, type DriveGrantConnectionKey as L, type DriveGrantLogicalChannelHandle as M, type NativeIpcFailureKind as N, type OpenRTCOptions as O, type PlutoIpcBridge as P, type DriveGrantPreferredTransport as Q, RuntimeClient as R, getRuntimePolicy as S, driveGrantConnectionKey as T, driveGrantConnectionKeyToString as U, 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 OpenRTCDeviceProfile as h, type OpenRTCDevicesHandle as i, type OpenRTCDevicesStartOptions as j, type OpenRTCEnrolledDevice as k, type OpenRTCLatestStateMode as l, type OpenRTCRoomHandle as m, type OpenRTCRoomJoinOptions as n, type OpenRTCSpaceHandle as o, type OpenRTCSpaceJoinOptions as p, type OpenRTCTicketHandle as q, type OpenRTCTicketIssueOptions as r, type OpenRTCTransportPreferences as s, type OpenRTCUsageNamespace as t, type OpenRTCUsageUpdate as u, type OpenRTCUsageWarning as v, classifyNativeIpcFailure as w, isNativeIpcCommandUnavailable as x, type OpenRTCClient$1 as y, type PeerReconciliationStats as z };
@@ -1,5 +1,5 @@
1
1
  import { A as AuthContext } from './IEngineBridge-BbsT8hof.js';
2
- import { C as ConnectionOptions, A as ApplicationPayloadCrypto, a as ApplicationPayloadReadinessOptions, b as ApplicationPayloadRouteOptions, P as ProtocolName, c as ApplicationPayloadSendOptions, T as TransportLatencySnapshot, d as PeerState, e as PeerScope, f as PeerHealth, g as ChannelDescriptor$1, I as IncomingStreamChannelMetadata, D as Device, B as BackendConnectionState, L as LocalDeviceInfo, h as DeviceStatusSnapshot, M as ManagedDeviceConnectOptions, i as ClientOptions, S as SignalingSession, R as RuntimeIdentity, J as JoinRoomOptions, j as RoomMember, k as DevicePresenceStatus, l as PeerLifecycleStatus, m as PeerSessionSnapshot } from './types-BVJr065k.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-BwmoJU2O.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 };