openrtc 2.0.0-rc.0 → 2.0.0-rc.2

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.
@@ -1,2 +1,2 @@
1
- export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-DTWEQS3J.js';export{a as createLegacyOpenRTC}from'../chunk-WMRCP3YX.js';import'../chunk-2QHDEGVX.js';export{b as createIpcClient,a as createWasmClient}from'../chunk-XE43HAXV.js';import'../chunk-YGJ6OAPR.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-CEMN2JKR.js';export{f as IpcRuntimeAdapter}from'../chunk-4K2QPYGT.js';import'../chunk-7Z6N46RB.js';export{b as runtimeFromCapability}from'../chunk-PODAMIL6.js';export{a as classifyNativeIpcFailure,b as isNativeIpcCommandUnavailable}from'../chunk-K37WVIZL.js';import'../chunk-N4SX7C3W.js';import'../chunk-BXFXPIXO.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';export{a as WasmRuntimeAdapter}from'../chunk-GW7P3D54.js';import'../chunk-A3IAG6EL.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';import {b}from'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';var z="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 q(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 p=typeof a?.error=="string"?a.error:`enableSpaceAuth failed (${r.status})`;throw new Error(p)}return a}async function M(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??z).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 p=null;typeof sessionStorage<"u"?(p=sessionStorage.getItem(a),p||(p=globalThis.crypto?.randomUUID?.()??`member-${Date.now()}`,sessionStorage.setItem(a,p))):p=`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:p,...o?{sandboxAppId:o}:{}})}),{text:u,payload:s}=await L(i);if(!i.ok){let f=typeof s?.error=="string"?s.error:u.trim()?u.trim().slice(0,240):`public space token mint failed (${i.status})`;throw new Error(f)}let l=typeof s?.token=="string"?s.token.trim():"";if(!l)throw new Error("public space token response missing token");return {customToken:l}}}function B(e){if(!e.trim())return {};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return {}}}async function L(e){let t=e.text;if(typeof t=="function"){let o=await t.call(e).catch(()=>"");return {text:o,payload:B(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 H=d,X=d;
2
- export{d as createPublicSpaceTokenProvider,X as createSpaceTokenProvider,q as enableSpaceAuth,M as mintSpaceToken,J as sandboxSpaceKey,H as spaceToken};
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};
@@ -0,0 +1,18 @@
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 '../types-BVJr065k.js';
5
+ import '../IEngineBridge-BbsT8hof.js';
6
+ import '../capabilities-YSskrE8H.js';
7
+ import '../ITransport-BsPcaov7.js';
8
+
9
+ /**
10
+ * Rollback-only constructor for the internal diagnostic sandbox. Shipping 2.0
11
+ * applications must use the root capability API.
12
+ */
13
+ declare function createLegacyOpenRTC(options: RuntimeClientOptions): Promise<OpenRTCClient>;
14
+ declare namespace createLegacyOpenRTC {
15
+ var native: (options: RuntimeClientOptions, bridge?: PlutoIpcBridge) => OpenRTCClient;
16
+ }
17
+
18
+ export { createLegacyOpenRTC };
@@ -0,0 +1 @@
1
+ export{a as createLegacyOpenRTC}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';
@@ -1 +1 @@
1
- export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-DTWEQS3J.js';import'../chunk-4K2QPYGT.js';import'../chunk-K37WVIZL.js';import'../chunk-BXFXPIXO.js';import'../chunk-A3IAG6EL.js';import'../chunk-YBXGNKM7.js';import'../chunk-VK6KX433.js';import'../chunk-NT5YHZQH.js';import'../chunk-N26S7V4N.js';import'../chunk-NB4H5TP3.js';import'../chunk-RD3JEGGF.js';import'../chunk-C7YN5MSV.js';
1
+ export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-5LRLWIT5.js';import'../chunk-F2XGNLXL.js';import'../chunk-A3IAG6EL.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';
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { u as OpenRTCClient, O as OpenRTCOptions, a as OpenRTCClient$1 } from './types-BDc7AZYI.js';
1
+ import { d as OpenRTCClient } from './OpenRTCShared-ZQPu5LqL.js';
2
2
  import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
3
- import { R as RuntimeClientOptions } from './types-BUXwspL0.js';
3
+ import { a as RuntimeClientOptions } from './types-DkgaCyqS.js';
4
+ import { O as OpenRTCOptions, a as OpenRTCClient$1 } from './types-DNl4KHHY.js';
4
5
  import './types-BVJr065k.js';
5
6
  import './IEngineBridge-BbsT8hof.js';
6
7
  import './capabilities-YSskrE8H.js';
package/dist/testing.js CHANGED
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-UEYM6WTT.js';import {a}from'./chunk-WMRCP3YX.js';import'./chunk-2QHDEGVX.js';import'./chunk-XE43HAXV.js';import'./chunk-YGJ6OAPR.js';import'./chunk-CEMN2JKR.js';import'./chunk-4K2QPYGT.js';import'./chunk-7Z6N46RB.js';import {c}from'./chunk-PODAMIL6.js';import'./chunk-K37WVIZL.js';import'./chunk-N4SX7C3W.js';import'./chunk-BXFXPIXO.js';import'./chunk-A3IAG6EL.js';import'./chunk-YBXGNKM7.js';import'./chunk-VK6KX433.js';import'./chunk-NT5YHZQH.js';import'./chunk-N26S7V4N.js';import'./chunk-NB4H5TP3.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';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-O5575ECL.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-FBNUVH7V.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 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};
@@ -0,0 +1,195 @@
1
+ import { O as OpenRTCPeerNamespace, a as OpenRTCChannelNamespace, b as OpenRTCDiagnosticsNamespace, c as OpenRTCDeviceNamespace } from './OpenRTCShared-ZQPu5LqL.js';
2
+ import { R as RuntimeChannelDescriptor } from './types-DkgaCyqS.js';
3
+
4
+ interface OpenRTCAuthProvider {
5
+ /** Registered provider ID from the developer app capability manifest. */
6
+ readonly providerId?: string;
7
+ getAssertion(input: {
8
+ audience: 'https://api.openrtc.app/v2/assertions/exchange';
9
+ forceRefresh: boolean;
10
+ }): Promise<string | null>;
11
+ /**
12
+ * Optional identity-epoch observer. Notify only when the signed-in
13
+ * principal/session changes (login, logout, account switch, or explicit
14
+ * revocation). Do not notify for ordinary OAuth/Firebase access-token
15
+ * refreshes: OpenRTC refreshes its own avenue grant in place.
16
+ */
17
+ subscribe?(listener: () => void): () => void;
18
+ }
19
+ interface OpenRTCAttestationProvider {
20
+ readonly kind: 'firebase-app-check' | 'apple-app-attest' | 'play-integrity' | `custom:${string}`;
21
+ /**
22
+ * Describes what the provider actually signs. Reusable app-integrity
23
+ * tokens (for example Firebase App Check) do not become request-bound just
24
+ * because OpenRTC supplies an enrollment challenge. The server derives and
25
+ * enforces the authoritative binding from the registered provider kind;
26
+ * this field keeps host integrations and diagnostics honest.
27
+ */
28
+ readonly evidenceBinding: 'app-session' | 'request-challenge';
29
+ getEvidence(input: {
30
+ challenge: string;
31
+ apiKey: string;
32
+ }): Promise<{
33
+ token: string;
34
+ }>;
35
+ }
36
+ /**
37
+ * Optional consumer-owned bot challenge. Core OpenRTC does not render a UI or
38
+ * load a CAPTCHA dependency; the host supplies a fresh token only when its
39
+ * developer manifest requires anonymous capability verification.
40
+ */
41
+ interface OpenRTCBotVerificationProvider {
42
+ getToken(input: {
43
+ action: 'openrtc_capability';
44
+ apiKey: string;
45
+ }): Promise<string>;
46
+ }
47
+ interface OpenRTCUsageUpdate {
48
+ sessionCreditsUsd: number;
49
+ operation: string;
50
+ estimated: boolean;
51
+ }
52
+ interface OpenRTCUsageWarning extends OpenRTCUsageUpdate {
53
+ thresholdCreditsUsd: number;
54
+ kind: 'warning' | 'session-limit';
55
+ }
56
+ interface OpenRTCTransportPreferences {
57
+ iroh?: boolean;
58
+ webrtc?: boolean;
59
+ relay?: boolean;
60
+ moq?: boolean;
61
+ ble?: boolean;
62
+ /**
63
+ * Advanced privacy mode. `relay-only` suppresses direct Iroh addresses,
64
+ * local discovery, and host/srflx WebRTC candidates. It also requires the
65
+ * developer manifest's relay opt-in.
66
+ */
67
+ privacy?: 'direct' | 'relay-only';
68
+ /**
69
+ * Advanced native integration for hosts whose Rust process owns the
70
+ * application protocol registry (for example, a Tauri file-transfer host).
71
+ * Normal SDK consumers should leave this disabled.
72
+ */
73
+ nativeHostProtocols?: boolean;
74
+ priority?: readonly ('iroh' | 'webrtc' | 'moq' | 'ble')[];
75
+ }
76
+ interface OpenRTCOptions {
77
+ apiKey: string;
78
+ auth?: OpenRTCAuthProvider;
79
+ trust?: {
80
+ attestation?: OpenRTCAttestationProvider;
81
+ botVerification?: OpenRTCBotVerificationProvider;
82
+ };
83
+ usage?: {
84
+ warnAtSessionCreditsUsd?: number;
85
+ maxSessionCreditsUsd?: number;
86
+ onUsage?: (event: OpenRTCUsageUpdate) => void;
87
+ onWarning?: (warning: OpenRTCUsageWarning) => void;
88
+ };
89
+ transports?: OpenRTCTransportPreferences;
90
+ }
91
+ type OpenRTCAccessMode = 'capability' | 'authenticated';
92
+ type OpenRTCLatestStateMode = 'reliable' | 'latest-state';
93
+ interface OpenRTCCapabilityHandle {
94
+ readonly kind: 'devices' | 'space' | 'room' | 'ticket';
95
+ readonly id: string;
96
+ readonly peers: OpenRTCPeerNamespace;
97
+ readonly channels: OpenRTCChannelNamespace;
98
+ readonly diagnostics: OpenRTCDiagnosticsNamespace;
99
+ readonly closed: boolean;
100
+ close(): Promise<void>;
101
+ }
102
+ interface OpenRTCDevicesHandle extends OpenRTCCapabilityHandle {
103
+ readonly kind: 'devices';
104
+ localId(): ReturnType<OpenRTCDeviceNamespace['localId']>;
105
+ localInfo(): ReturnType<OpenRTCDeviceNamespace['localInfo']>;
106
+ list(): ReturnType<OpenRTCDeviceNamespace['list']>;
107
+ listWithStatus(): ReturnType<OpenRTCDeviceNamespace['listWithStatus']>;
108
+ watch: OpenRTCDeviceNamespace['watch'];
109
+ connect: OpenRTCDeviceNamespace['connect'];
110
+ disconnect: OpenRTCDeviceNamespace['disconnect'];
111
+ }
112
+ interface OpenRTCSpaceHandle extends OpenRTCCapabilityHandle {
113
+ readonly kind: 'space';
114
+ readonly delivery: OpenRTCLatestStateMode;
115
+ leave(): Promise<void>;
116
+ }
117
+ interface OpenRTCRoomHandle extends OpenRTCCapabilityHandle {
118
+ readonly kind: 'room';
119
+ readonly membership: 'ephemeral' | 'durable';
120
+ leave(): Promise<void>;
121
+ }
122
+ interface OpenRTCTicketHandle extends OpenRTCCapabilityHandle {
123
+ readonly kind: 'ticket';
124
+ readonly token: string;
125
+ }
126
+ interface OpenRTCDevicesStartOptions {
127
+ auth?: OpenRTCAuthProvider;
128
+ autoConnect?: 'none' | 'online';
129
+ /** Optional local profile; it does not alter the durable device identity. */
130
+ profile?: {
131
+ name?: string;
132
+ /**
133
+ * Optional application-owned public presence metadata. It is bounded
134
+ * to 4 KiB and folded into the initial connection/presence operation.
135
+ */
136
+ metadata?: string;
137
+ };
138
+ maxPeers?: number;
139
+ /** Requires the app manifest's advanced-fanout opt-in. */
140
+ advancedFanout?: boolean;
141
+ }
142
+ interface OpenRTCSpaceJoinOptions {
143
+ access?: 'capability';
144
+ identity?: 'ephemeral';
145
+ payload?: OpenRTCLatestStateMode;
146
+ maxPeers?: number;
147
+ /** Requires the app manifest's advanced-fanout opt-in. */
148
+ advancedFanout?: boolean;
149
+ }
150
+ interface OpenRTCRoomJoinOptions {
151
+ access?: OpenRTCAccessMode;
152
+ membership?: 'ephemeral' | 'durable';
153
+ auth?: OpenRTCAuthProvider;
154
+ maxPeers?: number;
155
+ /** Requires the app manifest's advanced-fanout opt-in. */
156
+ advancedFanout?: boolean;
157
+ }
158
+ interface OpenRTCTicketIssueOptions {
159
+ maxPeers?: number;
160
+ /** Requires the app manifest's advanced-fanout opt-in. */
161
+ advancedFanout?: boolean;
162
+ }
163
+ interface OpenRTCChannelCatalog {
164
+ register(descriptor: RuntimeChannelDescriptor): () => void;
165
+ list(): readonly RuntimeChannelDescriptor[];
166
+ }
167
+ interface OpenRTCUsageNamespace {
168
+ estimate(input: {
169
+ operation: string;
170
+ units?: number;
171
+ }): {
172
+ creditsUsd: number;
173
+ estimated: true;
174
+ };
175
+ readonly sessionCreditsUsd: number;
176
+ }
177
+ interface OpenRTCClient {
178
+ readonly devices: {
179
+ start(options?: OpenRTCDevicesStartOptions): Promise<OpenRTCDevicesHandle>;
180
+ };
181
+ readonly spaces: {
182
+ join(id: string, options?: OpenRTCSpaceJoinOptions): Promise<OpenRTCSpaceHandle>;
183
+ };
184
+ readonly rooms: {
185
+ join(id: string, options?: OpenRTCRoomJoinOptions): Promise<OpenRTCRoomHandle>;
186
+ };
187
+ readonly tickets: {
188
+ issue(id: string, options?: OpenRTCTicketIssueOptions): Promise<OpenRTCTicketHandle>;
189
+ };
190
+ readonly channels: OpenRTCChannelCatalog;
191
+ readonly usage: OpenRTCUsageNamespace;
192
+ close(): Promise<void>;
193
+ }
194
+
195
+ export type { OpenRTCOptions as O, OpenRTCClient as a, OpenRTCAccessMode as b, OpenRTCAttestationProvider as c, OpenRTCAuthProvider as d, OpenRTCBotVerificationProvider as e, OpenRTCCapabilityHandle as f, OpenRTCChannelCatalog as g, OpenRTCDevicesHandle as h, OpenRTCDevicesStartOptions as i, OpenRTCLatestStateMode as j, OpenRTCRoomHandle as k, OpenRTCRoomJoinOptions as l, OpenRTCSpaceHandle as m, OpenRTCSpaceJoinOptions as n, OpenRTCTicketHandle as o, OpenRTCTicketIssueOptions as p, OpenRTCTransportPreferences as q, OpenRTCUsageNamespace as r, OpenRTCUsageUpdate as s, OpenRTCUsageWarning as t };
@@ -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 RuntimeClientOptions 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 RuntimePeerState as a, type SessionOptions as a0, type RuntimeConnectionStateSnapshot as b, type RuntimePeerReadinessSnapshot as c, type RuntimePeerConnectOptions as d, type RuntimeIncomingStream 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrtc",
3
- "version": "2.0.0-rc.0",
3
+ "version": "2.0.0-rc.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -51,6 +51,10 @@
51
51
  "types": "./dist/runtime/index.d.ts",
52
52
  "import": "./dist/runtime/index.js"
53
53
  },
54
+ "./runtime/legacy": {
55
+ "types": "./dist/runtime/legacy.d.ts",
56
+ "import": "./dist/runtime/legacy.js"
57
+ },
54
58
  "./runtime/device-status": {
55
59
  "types": "./dist/runtime/device-status.d.ts",
56
60
  "import": "./dist/runtime/device-status.js"
@@ -1 +0,0 @@
1
- import {b as b$1,a as a$2}from'./chunk-2QHDEGVX.js';import {a as a$1}from'./chunk-XE43HAXV.js';import {a as a$3}from'./chunk-YGJ6OAPR.js';import {d}from'./chunk-K37WVIZL.js';import {b}from'./chunk-N4SX7C3W.js';import {a}from'./chunk-N26S7V4N.js';async function c(t){return a(b),b$1(await a$1(a$2(t)),"web")}c.native=function(t,a$1=d()){return a(b),b$1(a$3(a$2(t),a$1),"native")};export{c as a};
@@ -1 +0,0 @@
1
- import {u}from'./chunk-CEMN2JKR.js';import {f}from'./chunk-4K2QPYGT.js';import {c}from'./chunk-RD3JEGGF.js';function s(i,r){let t=c(i);return u(t,new f({...t,bridge:r}))}export{s as a};
@@ -1 +0,0 @@
1
- export{b as createIpcClient,a as createWasmClient}from'./chunk-XE43HAXV.js';import'./chunk-CEMN2JKR.js';import'./chunk-4K2QPYGT.js';import'./chunk-7Z6N46RB.js';import'./chunk-K37WVIZL.js';import'./chunk-BXFXPIXO.js';import'./chunk-A3IAG6EL.js';import'./chunk-YBXGNKM7.js';import'./chunk-VK6KX433.js';import'./chunk-NT5YHZQH.js';import'./chunk-N26S7V4N.js';import'./chunk-NB4H5TP3.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';
@@ -1 +0,0 @@
1
- export{a as createIpcClient}from'./chunk-YGJ6OAPR.js';import'./chunk-CEMN2JKR.js';import'./chunk-4K2QPYGT.js';import'./chunk-7Z6N46RB.js';import'./chunk-K37WVIZL.js';import'./chunk-BXFXPIXO.js';import'./chunk-A3IAG6EL.js';import'./chunk-YBXGNKM7.js';import'./chunk-VK6KX433.js';import'./chunk-NT5YHZQH.js';import'./chunk-N26S7V4N.js';import'./chunk-NB4H5TP3.js';import'./chunk-RD3JEGGF.js';import'./chunk-C7YN5MSV.js';