openrtc 1.0.11 → 1.0.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.
- package/dist/{DelegatingRuntimeAdapter-lFDUNBy9.d.ts → DelegatingRuntimeAdapter-D_kGKQtW.d.ts} +9 -1
- package/dist/{assembly-C2G0P2L5.d.ts → assembly-DisGbrdH.d.ts} +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/auth/internal.js +1 -1
- package/dist/chunk-3SND2COC.js +1 -0
- package/dist/chunk-HXTGHALT.js +2 -0
- package/dist/chunk-KP5H3SYJ.js +2 -0
- package/dist/{chunk-MIWX2SUB.js → chunk-LVJSU53Y.js} +1 -1
- package/dist/chunk-NP3JZ2LD.js +3 -0
- package/dist/{chunk-N6UBUNGC.js → chunk-WFUW3BHK.js} +1 -1
- package/dist/chunk-YFNRKQEA.js +2 -0
- package/dist/{chunk-SJ5BFL6W.js → chunk-ZZIIBIEC.js} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/native.d.ts +5 -5
- package/dist/native.js +1 -1
- package/dist/openrtc_bg.wasm +0 -0
- package/dist/runtime/WasmRuntimeAdapter.d.ts +2 -2
- package/dist/runtime/WasmRuntimeAdapter.js +1 -1
- package/dist/runtime/device-status.d.ts +2 -2
- package/dist/runtime/index.d.ts +20 -8
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/tauri.d.ts +3 -3
- package/dist/runtime/tauri.js +1 -1
- package/dist/{spaceTokens-3sbs1mUF.d.ts → spaceTokens-Dc1CsMQt.d.ts} +3 -3
- package/dist/{tauri-WEvOC_Z6.d.ts → tauri-DSkrSuO-.d.ts} +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-N9s66nF8.d.ts → types-BSJ8IyBq.d.ts} +1 -1
- package/dist/{types-ZDsZknDI.d.ts → types-Cb_GFANp.d.ts} +28 -1
- package/package.json +3 -2
- package/dist/chunk-DI5IPRPM.js +0 -2
- package/dist/chunk-HVTYSEU7.js +0 -2
- package/dist/chunk-MNI6JGR2.js +0 -1
- package/dist/chunk-QAZ4NA4F.js +0 -3
- package/dist/chunk-YTUWXCRO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,h}from'./chunk-
|
|
1
|
+
import {g,h}from'./chunk-KP5H3SYJ.js';function c(){return g()}var i=class extends h{constructor(r){super({...r,bridge:g(),allowWasmFallback:r.allowWasmFallback??false});}};export{c as a,i as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {c as c$1}from'./chunk-C7YN5MSV.js';import {getApps,initializeApp}from'firebase/app';import {initializeAppCheck,ReCaptchaEnterpriseProvider}from'firebase/app-check';import {getFunctions,connectFunctionsEmulator,httpsCallable}from'firebase/functions';import {browserLocalPersistence,inMemoryPersistence,browserPopupRedirectResolver,initializeAuth,getAuth,connectAuthEmulator,setPersistence,onIdTokenChanged,getIdToken,signInWithCustomToken,onAuthStateChanged,signInAnonymously,signInWithEmailAndPassword,createUserWithEmailAndPassword,signOut,deleteUser,updateProfile,GoogleAuthProvider,OAuthProvider,signInWithCredential,signInWithPopup,signInWithRedirect,getRedirectResult}from'firebase/auth';function D(){return typeof window>"u"?false:!!(window.__TAURI_IPC__||window.__TAURI_INTERNALS__||window.__TAURI__||window.location.protocol==="tauri:"||window.location.hostname==="tauri.localhost")}var L=new Set;function I(t,e){L.has(t)||(L.add(t),console.warn(e));}function oe(t){return /^pk_(live|test)_[0-9a-f]{40}$/.test(t)}async function We(t,e){let n=`${t}:${e}`,o=new TextEncoder().encode(n),i=await crypto.subtle.digest("SHA-256",o);return Array.from(new Uint8Array(i)).map(d=>d.toString(16).padStart(2,"0")).join("")}function S(t){let e=typeof t.apiKey=="string"?t.apiKey.trim():"";if(e)return oe(e)||I(`invalid-api-key:${e.slice(0,10)}`,"[pluto-rtc] The provided `apiKey` does not match the expected format (pk_live_... or pk_test_...). Create an app at https://api.openrtc.app/developer."),`app_${e.slice(-16)}`;throw new Error("[openrtc] `apiKey` is required. Create an app at https://api.openrtc.app/developer.")}function T(t){return t.authMode?t.authMode:("apiKey"in t&&typeof t.apiKey=="string"&&t.apiKey.trim().length>0&&typeof(t.spaceKey??t.space)=="string"&&(t.spaceKey??t.space).trim().length>0||I("default-auth-mode","[pluto-rtc] `authMode` is not set; defaulting to `anonymous` for compatibility."),"anonymous")}function je(t){let e=typeof t.projectId=="string"?t.projectId.trim():"";return e||(I("default-project-id","[pluto-rtc] `projectId` is not set; defaulting to the built-in PlutoRTC Firebase project."),f)}function H(t){return t.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Ge(t){let e="storagePrefix"in t&&typeof t.storagePrefix=="string"?H(t.storagePrefix):"";return e||H(S(t))||"default"}var ie={devicesPerUser:100,maxRooms:1e4,maxMembersPerRoom:250,maxPersonalDevices:25e3},Qe=ie;var ae=[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun.cloudflare.com:3478"}],B={iceServers:ae},$e={};var F=["iroh-relay","iroh","moq"];function se(t){return (Array.isArray(t.urls)?t.urls:[t.urls]).some(n=>typeof n=="string"&&(n.startsWith("turn:")||n.startsWith("turns:")))}function ce(t){let n=(Array.isArray(t.urls)?t.urls:[t.urls]).filter(r=>typeof r=="string"&&!r.startsWith("stun:"));return n.length===0?null:{...t,urls:Array.isArray(t.urls)?n:n[0]}}function R(t){if(t)return t.map(e=>ce(e)).filter(e=>e!==null)}function K(t,e){let n=new Set(["iroh-relay","iroh","moq"]);e&&n.add("webrtc");let r=(t??F).filter(o=>n.has(o));return r.length>0?r:[...F]}function Ve(t){return !!t?.transports?.webrtc}function Je(t,e){let n=t?.transports?.webrtc||void 0;if(n)return t?.strictMode||n.privacyMode?{...n,iceServers:R(n.iceServers),iceTransportPolicy:"relay"}:n.iceTransportPolicy==="relay"&&!(Array.isArray(n.iceServers)&&n.iceServers.some(o=>se(o)))?(e?.("[Client] Overriding relay-only ICE policy to all because no TURN servers are configured"),{...n,iceTransportPolicy:"all"}):n}var le=/^[A-Za-z0-9._-]+$/,de="[redacted]";function q(t){let e;try{e=new URL(t);}catch{throw new Error("[OpenRTC] transports.moq.relayUrl must be a valid HTTPS URL.")}if(e.protocol!=="https:")throw new Error("[OpenRTC] transports.moq.relayUrl must use HTTPS/WebTransport.");if(e.hash)throw new Error("[OpenRTC] transports.moq.relayUrl must not contain a fragment.");if(e.searchParams.has("jwt"))throw new Error("[OpenRTC] transports.moq.relayUrl must not contain a jwt query parameter; use transports.moq.accessToken.");return e}function C(t){return q(t.trim()).toString()}function Ze(t,e){let n=q(t.trim());if(e!==void 0){let r=e.trim();if(!r)throw new Error("[OpenRTC] transports.moq.accessToken must not be empty when provided.");if(new TextEncoder().encode(r).byteLength>16384)throw new Error("[OpenRTC] transports.moq.accessToken exceeds the maximum supported size.");if(!le.test(r))throw new Error("[OpenRTC] transports.moq.accessToken must be a URL-safe JWT.");n.searchParams.append("jwt",r);}return n.toString()}function et(t){try{let e=new URL(t);return e.search="",e.hash="",e.toString()}catch{return "invalid-moq-relay-url"}}function tt(t,e){let n=t instanceof Error?`${t.name}: ${t.message}`:String(t),r=e?.trim();return r?n.split(r).join(de):n}var ue=[...c$1];function A(t){let e=t.spaceKey??t.space;return {...t,...e!==void 0?{spaceKey:e}:{}}}function W(t){return {...t,iceServers:t.iceServers?t.iceServers.map(e=>({...e})):t.iceServers}}function pe(t){return {...t}}function me(t){return {...t}}function ge(t){if(t)return {iroh:typeof t.iroh=="object"?me(t.iroh):t.iroh,webrtc:typeof t.webrtc=="object"?W(t.webrtc):t.webrtc,ble:typeof t.ble=="object"?{...t.ble}:t.ble,moq:typeof t.moq=="object"?pe(t.moq):t.moq}}function ye(t){if(t.strictMode&&!t.transports&&(t.transports={iroh:{relayOnly:true}}),!!t.transports){if(t.transports.webrtc===true?t.transports.webrtc=W(B):t.transports.webrtc===false&&(t.transports.webrtc=void 0),t.transports.moq===true)throw new Error("[OpenRTC] transports.moq=true is ambiguous because no anonymous MoQ relay is available; provide transports.moq.relayUrl explicitly.");if(t.transports.moq===false)t.transports.moq=void 0;else if(t.transports.moq&&typeof t.transports.moq=="object"){let e=t.transports.moq,n=e.relayUrl?.trim(),r=e.accessToken;if(r!==void 0&&!r.trim())throw new Error("[OpenRTC] transports.moq.accessToken must not be empty when provided.");t.transports.moq={...e,...n?{relayUrl:C(n)}:{},...r!==void 0?{accessToken:r.trim()}:{}};}t.transports.iroh===true?t.transports.iroh={}:t.transports.iroh===false&&(t.transports.iroh=void 0);}}function fe(t){if(!t.strictMode||!t.transports)return;let e=t.transports.iroh&&typeof t.transports.iroh=="object"?t.transports.iroh:{};t.transports.iroh={...e,relayOnly:true,relayTransportPolicy:e.relayTransportPolicy??"websocketRequired",localDiscovery:false,localDiscoveryMode:void 0},t.transports.ble=void 0;let n=t.transports.webrtc;n&&typeof n=="object"&&(t.transports.webrtc={...n,privacyMode:true,lanMode:false,iceServers:R(n.iceServers)??[],iceTransportPolicy:"relay"});let r=t.transports.moq;if(r&&typeof r=="object"){let o=r.relayUrl?.trim();if(!o)throw new Error("[OpenRTC] strictMode requires an explicit transports.moq.relayUrl.");t.transports.moq={...r,relayUrl:C(o)};}}function ct(t){let e=A(t),n=S(e),r=T(e),o={strictMode:false,disableIrohFallback:false,transportPriority:[...ue],...e,authMode:r,transports:ge(e.transports)};ye(o),fe(o),o.strictMode&&(o.transportPriority=K(e.transportPriority,!!o.transports?.webrtc));let i=j(o),a=(o.discoveryMode??"space")==="space"?"client-open":"client-auth";return {appTag:n,authMode:r,configuredPersistenceMode:i,options:o,roomCreationMode:a}}function j(t){let e=t.transports?.iroh;return t.endpointIdPersistence??t.nodeIdPersistence??(typeof e=="object"?e.persistenceMode:void 0)??"ephemeral"}function lt(t){return "options"in t&&"configuredPersistenceMode"in t?{apiKey:t.options.apiKey,authMode:T(t.options),projectId:t.options.projectId,storagePrefix:t.options.storagePrefix,nodeIdPersistence:t.configuredPersistenceMode}:{apiKey:t.apiKey,authMode:T(t),projectId:t.projectId,storagePrefix:t.storagePrefix,nodeIdPersistence:j(t)}}function dt(t,e){e&&(t.transports={...t.transports||{},...e});}var f="pluto-rtc-prod",he="https://openrtc-coordination-gateway.hargreaves-bryant.workers.dev",w={apiKey:"AIzaSyA62Krj-7ZYFT5xjrTUq7mXana41Ahj_mM",authDomain:"api.openrtc.app",projectId:f,storageBucket:"pluto-rtc-prod.firebasestorage.app",messagingSenderId:"607066575224",appId:"1:607066575224:web:ed3f51825ba228db92b88d",recaptchaSiteKey:"6LfGv2gtAAAAALFAuE_kpLYpNBpk2IsKiLIGdOGl"};function mt(t){let e=A(t),n=typeof e.projectId=="string"&&e.projectId.trim()?e.projectId.trim():void 0,r=n??f;return {...e,projectId:r,coordinationGateway:e.coordinationGateway??(!n&&r===f?{endpoint:he,environment:"production"}:void 0)}}function G(t){return new Promise(e=>setTimeout(e,t))}function yt(t){let e=new Uint8Array(t.byteLength);return e.set(t),e}function ft(t){let e=t.reduce((o,i)=>o+i.byteLength,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.byteLength;return n}function ht(t,e,n){let r=e*Math.pow(2,Math.max(0,t-1));return Math.min(n,r)}function bt(t){try{let e=t;return !!e&&!!e.send&&typeof e.send.getWriter=="function"&&!!e.recv&&typeof e.recv.getReader=="function"}catch{return false}}function Pt(t,e,n){let r=t;if(!r)return null;try{let o=r.send,i=r.recv;if(!o||typeof o.getWriter!="function"||!i||typeof i.getReader!="function")return null;let a=typeof r.endpoint_id=="string"&&r.endpoint_id.trim().length>0?r.endpoint_id:e,l=Number.isSafeInteger(r.transport_stable_id)&&Number(r.transport_stable_id)>0?Number(r.transport_stable_id):void 0,d=Number.isSafeInteger(n)&&Number(n)>0?Number(n):void 0;if(l!==void 0&&d!==void 0&&l!==d)return null;let s=l??d;return {send:o,recv:i,endpoint_id:a,...s?{transport_stable_id:s}:{}}}catch{return null}}function Tt(t,e){let n={send:t.send,recv:e,endpoint_id:typeof t.endpoint_id=="string"?t.endpoint_id:"",...Number.isSafeInteger(t.transport_stable_id)&&Number(t.transport_stable_id)>0?{transport_stable_id:Number(t.transport_stable_id)}:{}};return t?.applicationCryptoWrapped===true&&(n.applicationCryptoWrapped=true),n}async function vt(t,e){if(!t)return false;try{let n=t.send?.getWriter?.();if(n)try{await n.close();}catch{}finally{try{n.releaseLock();}catch{}}}catch{}try{let n=t.recv?.getReader?.();if(n)try{await n.cancel(e);}catch{}finally{try{n.releaseLock();}catch{}}}catch{}return true}function It(t,e,n={}){let r=n.context??"prependBytesToReader",o=n.traceId,i=e.byteLength===0,a=n.pendingRead??null,l=s=>n.release?.(s),d=(s,p)=>n.log?.(s,p);return new ReadableStream({async pull(s){if(!i){i=true,s.enqueue(e);return}if(a){let u=a;a=null;let m;try{m=await u;}catch(y){s.error(y),l("pending-read-error"),d("prepend-bytes:pending-read-error",{context:r,traceId:o||null,error:y?.message||String(y)});return}if(m.done){s.close(),l("pending-done");return}m.value&&s.enqueue(m.value);return}let p;try{p=await t.read();}catch(u){s.error(u),l("read-error"),d("prepend-bytes:read-error",{context:r,traceId:o||null,error:u?.message||String(u)});return}let{done:v,value:P}=p;if(v){s.close(),l("done");return}P&&s.enqueue(P);},async cancel(s){l("cancel");}})}async function St(t,e){let n=t.read(),r=e-Date.now();if(r<=0)return {status:"timeout",pendingRead:n};let o=Symbol("probe-timeout"),i,a=new Promise(l=>{i=setTimeout(()=>l(o),r);});try{let l=await Promise.race([n,a]);if(l===o)return {status:"timeout",pendingRead:n};let{done:d,value:s}=l;return d?{status:"done"}:{status:"data",value:s&&s.byteLength>0?new Uint8Array(s):new Uint8Array(0)}}finally{i&&clearTimeout(i);}}function z(t,e,n){let r;return new Promise((o,i)=>{r=setTimeout(()=>{if(r=void 0,typeof n=="function"){i(n());return}let a=n?`${n} timed out`:"timeout";i(new Error(`${a} after ${e}ms`));},e),t.then(a=>{r!==void 0&&clearTimeout(r),o(a);},a=>{r!==void 0&&clearTimeout(r),i(a);});})}var X="pluto-rtc-auth";function Le(t){let e=typeof import.meta<"u"?import.meta.env:null,n=String(e?.VITE_OPENRTC_APP_CHECK_SITE_KEY??globalThis.__OPENRTC_APP_CHECK_SITE_KEY__??w.recaptchaSiteKey??"").trim(),r=String(e?.VITE_OPENRTC_APP_CHECK_MODE??globalThis.__OPENRTC_APP_CHECK_MODE__??"monitor").trim().toLowerCase();if(!n){r==="enforce"&&console.error("[PLUTO-RTC][APP-CHECK] Enforcement requested without VITE_OPENRTC_APP_CHECK_SITE_KEY");return}let o=String(e?.VITE_OPENRTC_APP_CHECK_DEBUG_TOKEN??"").trim();o&&e?.DEV!==true?console.error("[PLUTO-RTC][APP-CHECK] Debug tokens are allowed only in development builds"):o&&typeof self<"u"&&(self.FIREBASE_APPCHECK_DEBUG_TOKEN=o==="true"?true:o);try{initializeAppCheck(t,{provider:new ReCaptchaEnterpriseProvider(n),isTokenAutoRefreshEnabled:!0});}catch(i){let a=i instanceof Error?i.message:String(i);a.toLowerCase().includes("already exists")||console.warn("[PLUTO-RTC][APP-CHECK] Initialization failed",{message:a});}}var _=null;function He(){if(typeof globalThis<"u"&&globalThis.__OPENRTC_DEBUG__===true)return true;if(typeof localStorage<"u")try{return localStorage.getItem("openrtc:debug")==="1"}catch{return false}return false}function c(t,e){if(He()){if(typeof e>"u"){console.log(t);return}console.log(t,e);}}function Ft(t){_=t;}function Be(){return D()}function ne(){return typeof navigator>"u"?false:/iPhone|iPad|iPod|Android/i.test(navigator.userAgent||"")}function Z(){return Be()&&ne()}function g(t,e,n){return z(t,e,()=>new Error(`${n} timeout after ${e}ms`))}function ee(t){let e="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._",n=new Uint8Array(t);window.crypto.getRandomValues(n);let r="";for(let o=0;o<t;o+=1)r+=e[n[o]%e.length];return r}async function te(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}var E=class{constructor(){this.redirectResultPromise=null;this.redirectResultConsumed=false;this.lastRelayedToken=null;this.lastRelayedRefreshToken=null;this.desktopTokenRefreshIntervalId=null;let e=getApps().find(o=>o.name===X);this.app=e||initializeApp(w,X),Le(this.app);let n=ne(),r=Z();if(n)try{let o=r?{persistence:[browserLocalPersistence,inMemoryPersistence]}:{persistence:[browserLocalPersistence,inMemoryPersistence],popupRedirectResolver:browserPopupRedirectResolver};this.auth=initializeAuth(this.app,o),c("[PLUTO-RTC][AUTH-HOST] Using mobile-safe Firebase auth initialization",{appName:this.app.name,persistence:"browserLocalPersistence->inMemoryPersistence",redirectResolver:r?"disabled-for-tauri-mobile":"browserPopupRedirectResolver",tauriMobile:r});}catch{this.auth=getAuth(this.app),console.warn("[PLUTO-RTC][AUTH-HOST] Mobile-safe auth initialization unavailable; falling back to default getAuth");}else this.auth=getAuth(this.app);this.functions=getFunctions(this.app);try{let o=typeof globalThis<"u"?String(globalThis.__OPENRTC_AUTH_EMULATOR_HOST__??"").trim():"",i=typeof globalThis<"u"?String(globalThis.__OPENRTC_FUNCTIONS_EMULATOR_HOST__??"").trim():"",a=typeof import.meta<"u"?import.meta.env:null;if(!!o||!!i||!!a&&String(a.VITE_USE_EMULATORS)==="true"&&(a.DEV||String(a.VITE_E2E)==="true")){let d=String(a?.VITE_OPENRTC_EMULATOR_HOST??"127.0.0.1").trim()||"127.0.0.1",[s,p]=o.split(":"),[v,P]=i.split(":"),u=(s??"").trim()||d,m=(v??"").trim()||d,y=Number(p??a?.VITE_OPENRTC_AUTH_EMULATOR_PORT??9100),re=Number(P??a?.VITE_OPENRTC_FUNCTIONS_EMULATOR_PORT??5002);try{connectAuthEmulator(this.auth,`http://${u}:${y}`,{disableWarnings:!0});}catch{}try{connectFunctionsEmulator(this.functions,m,re);}catch{}}}catch{}n?this.persistenceReady=Promise.resolve():this.persistenceReady=setPersistence(this.auth,browserLocalPersistence).catch(o=>{console.warn("[PLUTO-RTC][AUTH-HOST] Failed to set auth persistence",{message:o?.message});}),c("[PLUTO-RTC][AUTH-HOST] Initialized auth host",{appName:this.app.name,mobileSafeAuth:n}),onIdTokenChanged(this.auth,o=>{c("[PLUTO-RTC][AUTH-HOST] Firebase ID token changed",{hasUser:!!o,uid:o?.uid,providerDataCount:o?.providerData?.length||0}),this.syncDesktopAuthToken(o);}),this.desktopTokenRefreshIntervalId||(this.desktopTokenRefreshIntervalId=setInterval(()=>{this.syncDesktopAuthToken(this.auth.currentUser,true);},600*1e3));}async syncDesktopAuthToken(e,n=false){if(!_)return;let r=e?await getIdToken(e,n).catch(()=>null):null,o=e?e.refreshToken??null:null;if(r===this.lastRelayedToken&&o===this.lastRelayedRefreshToken)return;this.lastRelayedToken=r,this.lastRelayedRefreshToken=o;let i=await Promise.allSettled([Promise.resolve(_({authToken:r,refreshToken:o}))]);i[0]?.status==="rejected"&&console.warn("[PLUTO-RTC][AUTH-HOST] Failed to relay auth token to desktop backend",{message:i[0].reason?.message});}getApp(){return this.app}getCurrentUser(){return this.auth.currentUser}getAuth(){return this.auth}onAuthStateChanged(e){return c("[PLUTO-RTC][AUTH-HOST] onAuthStateChanged listener registered (via onIdTokenChanged)"),onIdTokenChanged(this.auth,e)}onIdTokenChanged(e){return c("[PLUTO-RTC][AUTH-HOST] onIdTokenChanged listener registered"),onIdTokenChanged(this.auth,e)}async getIdToken(e){return this.auth.currentUser?getIdToken(this.auth.currentUser,e?.forceRefresh??true):null}async checkForSSOToken(){if(typeof window>"u")return;let e=new URLSearchParams(window.location.search),n=new URLSearchParams(window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash),r=e.get("token")||n.get("token")||(e.get("custom_token")==="true"||n.get("custom_token")==="true"?e.get("id_token")||n.get("id_token"):null);if(r)try{await this.persistenceReady,await signInWithCustomToken(this.auth,r),window.history.replaceState({},document.title,window.location.pathname);}catch(o){console.error("[PLUTO-RTC][AUTH-HOST] SSO sign-in failed:",o);}}async signInWithCustomTokenValue(e){return await this.persistenceReady,(await signInWithCustomToken(this.auth,e)).user}async signInWithPluto(e){if(typeof window>"u")throw new Error("Pluto SSO requires a browser environment.");let n=e?.redirectUri||window.location.href,r=e?.authorizeBaseUrl||"https://pluto.openrtc.app/sso/authorize",o=new URL(r);o.searchParams.set("redirect_uri",n),window.location.assign(o.toString());}async waitForAuth(){if(await this.persistenceReady,!this.auth.currentUser)return new Promise(e=>{let n=onAuthStateChanged(this.auth,r=>{r&&(n(),e());});})}async signInAnonymously(){await signInAnonymously(this.auth);}async signIn(e,n){return (await signInWithEmailAndPassword(this.auth,e,n)).user}async signUp(e,n){return (await createUserWithEmailAndPassword(this.auth,e,n)).user}async signOut(){await signOut(this.auth);}async deleteAccount(){if(!this.auth.currentUser)throw new Error("No user signed in");await deleteUser(this.auth.currentUser);}async signInWithCredential(e){let n=Date.now();if(c("[PLUTO-RTC][AUTH-HOST] signInWithCredential start",{callbackId:e.callbackId,provider:e.provider,hasIdToken:!!e.idToken,hasAccessToken:!!e.accessToken,hasNonce:!!e.nonce}),e.isCustomToken){c("[PLUTO-RTC][AUTH-HOST] signInWithCredential: custom token detected, using signInWithCustomToken");try{if(Z())c("[PLUTO-RTC][AUTH-HOST] Skipping authStateReady before custom token sign-in on Tauri mobile",{callbackId:e.callbackId});else {c("[PLUTO-RTC][AUTH-HOST] Awaiting authStateReady...");try{await g(this.auth.authStateReady(),5e3,"authStateReady"),c("[PLUTO-RTC][AUTH-HOST] Auth state ready, signing in with custom token...");}catch(a){console.warn("[PLUTO-RTC][AUTH-HOST] authStateReady did not resolve in time; continuing custom token sign-in",{callbackId:e.callbackId,message:a?.message});}}let i;try{i=await g(signInWithCustomToken(this.auth,e.idToken),25e3,"signInWithCustomToken (custom token path)");}catch(a){console.warn("[PLUTO-RTC][AUTH-HOST] First custom token sign-in attempt failed; retrying once",{callbackId:e.callbackId,message:a?.message,code:a?.code}),await G(250),i=await g(signInWithCustomToken(this.auth,e.idToken),25e3,"signInWithCustomToken (custom token path retry)");}if(c("[PLUTO-RTC][AUTH-HOST] signInWithCustomToken success",{callbackId:e.callbackId,provider:e.provider,uid:i.user?.uid,elapsedMs:Date.now()-n}),i.user&&(e.displayName||e.photoURL))try{await updateProfile(i.user,{displayName:e.displayName||i.user.displayName||void 0,photoURL:e.photoURL||i.user.photoURL||void 0});}catch(a){console.warn("[PLUTO-RTC][AUTH-HOST] Failed to update custom-token user profile",{callbackId:e.callbackId,message:a?.message});}return i.user}catch(o){throw console.error("[PLUTO-RTC][AUTH-HOST] signInWithCustomToken failed",{callbackId:e.callbackId,error:o?.message,code:o?.code,stack:o?.stack,elapsedMs:Date.now()-n}),o}}let r;e.provider==="google"?r=GoogleAuthProvider.credential(e.idToken,e.accessToken):r=new OAuthProvider("apple.com").credential({idToken:e.idToken,rawNonce:e.nonce,accessToken:e.accessToken});try{let o=await g(signInWithCredential(this.auth,r),1e4,"firebase signInWithCredential");return c("[PLUTO-RTC][AUTH-HOST] signInWithCredential success",{callbackId:e.callbackId,provider:e.provider,uid:o.user?.uid,elapsedMs:Date.now()-n}),o.user}catch(o){console.warn("[PLUTO-RTC][AUTH-HOST] signInWithCredential primary path failed; trying custom token fallback",{callbackId:e.callbackId,provider:e.provider,elapsedMs:Date.now()-n,code:o?.code,message:o?.message});let i=await g(this.mintSessionTokenFromProviderToken(e),15e3,"mintSessionTokenFromProviderToken"),a=await g(signInWithCustomToken(this.auth,i),15e3,"signInWithCustomToken");return c("[PLUTO-RTC][AUTH-HOST] signInWithCustomToken fallback success",{callbackId:e.callbackId,provider:e.provider,uid:a.user?.uid,elapsedMs:Date.now()-n}),a.user}}async mintSessionTokenFromProviderToken(e){let n=httpsCallable(this.functions,"mintSessionToken");c("[PLUTO-RTC][AUTH-HOST] mintSessionToken fallback request start",{provider:e.provider,hasIdToken:!!e.idToken,hasNonce:!!e.nonce});let o=(await n({provider:e.provider,idToken:e.idToken,nonce:e.nonce})).data?.token;if(!o)throw new Error("mintSessionToken did not return a token for provider exchange");return c("[PLUTO-RTC][AUTH-HOST] mintSessionToken fallback request success",{provider:e.provider}),o}async signInWithPopup(e){if(e==="google"){let i=new GoogleAuthProvider;i.addScope("email"),i.addScope("profile"),i.setCustomParameters({prompt:"select_account"});let a=await signInWithPopup(this.auth,i);return {idToken:await getIdToken(a.user,true),refreshToken:a.user.refreshToken}}let n=new OAuthProvider("apple.com");n.addScope("email"),n.addScope("name");let r=ee(32);typeof sessionStorage<"u"&&sessionStorage.setItem("apple_auth_nonce",r),n.setCustomParameters({nonce:await te(r)});let o=await signInWithPopup(this.auth,n);return {idToken:await getIdToken(o.user,true),refreshToken:o.user.refreshToken}}async signInWithRedirect(e,n){if(e==="google"){let i=new GoogleAuthProvider;i.addScope("email"),i.addScope("profile"),i.setCustomParameters({prompt:"select_account"}),await signInWithRedirect(this.auth,i);return}let r=new OAuthProvider("apple.com");r.addScope("email"),r.addScope("name");let o=n?.nonce||ee(32);typeof sessionStorage<"u"&&sessionStorage.setItem("apple_auth_nonce",o),r.setCustomParameters({nonce:await te(o)}),await signInWithRedirect(this.auth,r);}async consumeRedirectResult(){return this.redirectResultConsumed?(c("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult skipped (already consumed)"),null):this.redirectResultPromise?this.redirectResultPromise:(this.redirectResultPromise=(async()=>{try{c("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult start");let e=await getRedirectResult(this.auth);if(!e)return c("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult: no redirect result"),{fromRedirect:!1,user:null};this.redirectResultConsumed=!0;let n=await getIdToken(e.user,!0).catch(()=>null),r=e.providerId||e.user.providerData?.[0]?.providerId||null;return c("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult success",{uid:e.user.uid,providerId:r,hasIdToken:!!n}),{fromRedirect:!0,user:e.user,providerId:r,idToken:n}}finally{this.redirectResultPromise=null;}})(),this.redirectResultPromise)}async startGoogleSignIn(){await this.signInWithRedirect("google");}async startAppleSignIn(){await this.signInWithRedirect("apple");}async mintSessionToken(){let r=(await httpsCallable(this.functions,"mintSessionToken")()).data;if(!r?.token)throw new Error("mintSessionToken did not return a token");return r.token}},M=null;function Fe(){return M||(M=new E),M}var Kt=new Proxy({},{get(t,e,n){let r=Fe(),o=r[e];return typeof o=="function"?o.bind(r):o}});
|
|
2
|
+
export{Tt as A,vt as B,It as C,St as D,z as E,Ft as F,Fe as G,Kt as H,We as a,S as b,T as c,je as d,Ge as e,Qe as f,ae as g,B as h,$e as i,Ve as j,Je as k,Ze as l,et as m,tt as n,A as o,ct as p,lt as q,dt as r,mt as s,D as t,G as u,yt as v,ft as w,ht as x,bt as y,Pt as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-YFNRKQEA.js';function D(t){let i=o({...t});if("auth"in t&&!t.authMode){let n=t.auth;i.authMode=n==="none"?"anonymous":n;}if("identity"in t){let n=t.identity,s=n==="temporary"?"ephemeral":n;!t.deviceIdPersistence&&!t.nodeIdPersistence&&(i.deviceIdPersistence=s),!t.endpointIdPersistence&&!t.nodeIdPersistence&&(i.endpointIdPersistence=s);}return "namespace"in t&&!t.storagePrefix&&(i.storagePrefix=t.namespace),"privacy"in t&&t.strictMode===void 0&&(i.strictMode=!!t.privacy),i}function x(t,i){let n=t.runtime,s=Object.create(n),r=async e=>{if(typeof e!="string")return e;let a=(await n.listDevices()).find(l=>l.deviceId===e);if(!a)throw new Error(`OpenRTC device '${e}' is not currently discoverable.`);return a},c=async e=>({...e,localDeviceId:e?.localDeviceId??await n.getLocalDeviceId()??""}),m=async e=>{let{device:o,scope:a,...l}=e,R=l.deviceId??(typeof o=="string"?o:o?.deviceId)??null,P=l.ticket??(typeof o=="string"?void 0:o?.ticket);R&&!P&&(P=(await r(R).catch(()=>null))?.ticket);let h={...l,scope:a??"session"};return R&&(h.deviceId=R),P&&(h.ticket=P),h},d={list:()=>n.listDevices(),startSession:(e={})=>n.startManagedSession({...e,platform:e.platform??i}),stopSession:e=>n.stopManagedSession(e),listWithStatus:()=>n.listDevicesWithStatus(),watch:e=>n.watchDevices(e),watchWithStatus:e=>n.watchDevicesWithStatus(e),connect:async(e,o)=>n.connectDevice(await r(e),await c(o)),connectWithRetry:async(e,o,a)=>n.connectDeviceWithRetry(await r(e),o,a),disconnect:e=>n.disconnectDevice(e),update:(e,o)=>n.updateDevice(e,o),delete:e=>n.deleteDevice(e),localId:()=>n.getLocalDeviceId(),localInfo:()=>n.getLocalDeviceInfo(),localProfile:e=>n.getLocalDeviceProfile(e),updateLocalName:e=>n.updateLocalDeviceName(e)},u={watch:e=>n.watchPeerStates(e),watchLifecycle:e=>n.watchPeerLifecycle(e),get:e=>n.getPeerState(e),listConnected:()=>n.listConnectedPeers(),connect:e=>n.connectPeer(e),disconnect:(e,o)=>n.disconnectPeer(e,o),forceDisconnect:e=>n.forceDisconnectPeer(e),session:e=>n.getPeerSession(e),sessions:()=>n.listPeerSessions(),waitConnected:(e,o)=>n.waitForConnectedPeer(e,o),readiness:(e,o)=>n.getPeerReadiness(e,o),health:e=>n.getPeerHealth(e),identity:e=>n.resolvePeerIdentity(e),addScope:(e,o)=>n.addPeerScope(e,o),releaseScope:(e,o)=>n.releasePeerScope(e,o),scopes:e=>n.getPeerScopes(e),refresh:()=>n.refreshPeerSnapshot()},p={register:e=>n.registerChannel(e),unregister:e=>n.unregisterChannel(e),list:()=>n.listChannels(),openBi:(e,o,a)=>n.openPeerBi(e,{...a,channelId:o}),openUni:(e,o,a)=>n.openPeerUni(e,{...a,channelId:o}),onIncoming:e=>n.onIncomingStream(e),onIncomingChannel:(e,o)=>n.onIncomingChannelStream(e,a=>{if(a.channel)return o(a)}),connect:async e=>n.connectScopedChannel(await m(e)),connectScoped:e=>n.connectScopedChannel(e)},g={create:e=>n.createRoom(e),join:(e,o)=>n.joinRoom(e,o),leave:e=>n.leaveRoom(e),watch:(e,o)=>n.watchRoom(e,o),members:e=>n.getRoomMembers(e)},v={raw:()=>n.getInvite(),share:e=>n.getTicketWithToken("share",e?.maxConnections??1),grant:(e,o)=>n.getTicketWithToken(e,o?.maxConnections??0),revoke:e=>n.revokeTokensByScope(e)},b={status:()=>n.getRuntimeStatus(),policy:()=>n.getRuntimePolicy(),capabilities:()=>n.getRuntimeCapabilities(),capabilityProfile:()=>n.getCapabilityProfile(),connectionStates:()=>n.getConnectionStates(),onConnectionStateChange:e=>n.onConnectionStateChange(e),connections:()=>n.getConnections(),applicationReadyConnections:e=>n.getApplicationReadyConnections(e),onConnection:e=>n.onConnection(e),onDisconnection:e=>n.onDisconnection(e),onConnectionEvent:e=>n.onConnectionEvent(e),forceReconnectSnapshot:()=>n.forceReconnectSnapshot(),peerReconciliation:()=>n.getPeerReconciliationStats()},f={runtime:n,assembly:t,nodeId:()=>n.getNodeId(),nodeIdFromTicket:e=>n.getNodeIdFromTicket(e),endpointTicket:()=>n.getEndpointTicket(),connectRaw:e=>n.connectRaw(e),openBi:e=>n.openBi(e),openUni:e=>n.openUni(e),isConnected:e=>n.isConnected(e),disconnectNode:e=>n.disconnectNode(e),setAutoConnectExcluded:(e,o)=>n.setAutoConnectExcluded(e,o),notifyNetworkChange:e=>n.notifyNetworkChange(e)};return Object.defineProperties(s,{devices:{get:()=>d,enumerable:true},peers:{get:()=>u,enumerable:true},channels:{get:()=>p,enumerable:true},rooms:{get:()=>g,enumerable:true},tickets:{get:()=>v,enumerable:true},diagnostics:{get:()=>b,enumerable:true},advanced:{get:()=>f,enumerable:true},setAuth:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},setAuthContext:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},syncPlutoAuth:{value:e=>t.syncPlutoAuth(e),enumerable:true,writable:true,configurable:true},bindPlutoAuthHost:{value:()=>t.bindPlutoAuthHost(),enumerable:true,writable:true,configurable:true},signIn:{value:()=>t.signInWithPluto(),enumerable:true,writable:true,configurable:true},signOut:{value:()=>t.signOut(),enumerable:true,writable:true,configurable:true},runtime:{get:()=>n,enumerable:false},_assembly:{get:()=>t,enumerable:false}}),s}var I="https://api.openrtc.app";async function N(t,i,n){let s=t.replace(/\/$/,""),r=await fetch(`${s}/v1/spaces/${encodeURIComponent(n)}/scoped-auth`,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:"{}"}),c=await r.json().catch(()=>({}));if(!r.ok){let m=typeof c?.error=="string"?c.error:`enableSpaceAuth failed (${r.status})`;throw new Error(m)}return c}async function M(t,i,n){let s=await fetch(t,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(n)}),r=await s.json().catch(()=>({}));if(!s.ok){let c=typeof r?.error=="string"?r.error:`mintSpaceToken failed (${s.status})`;throw new Error(c)}if(typeof r?.token!="string"||!r.token.trim())throw new Error("mintSpaceToken response missing token");return r}function S(t){let i=t.apiKey.trim(),n=(t.spaceKey??t.space??"").trim(),s=y(t.sandboxAppId),r=(t.endpointUrl??I).replace(/\/$/,""),c=t.memberIdStorageKey??`openrtc:space-member:${n}${s?`:sandbox:${s}`:""}`;return async()=>{if(!i||!n)throw new Error("spaceToken requires apiKey and space");let m=null;typeof sessionStorage<"u"?(m=sessionStorage.getItem(c),m||(m=globalThis.crypto?.randomUUID?.()??`member-${Date.now()}`,sessionStorage.setItem(c,m))):m=`member-${Date.now()}`;let d=await fetch(`${r}/v1SpacePublicTokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:i,spaceKey:n,memberId:m,...s?{sandboxAppId:s}:{}})}),{text:u,payload:p}=await k(d);if(!d.ok){let v=typeof p?.error=="string"?p.error:u.trim()?u.trim().slice(0,240):`public space token mint failed (${d.status})`;throw new Error(v)}let g=typeof p?.token=="string"?p.token.trim():"";if(!g)throw new Error("public space token response missing token");return {customToken:g}}}function O(t){if(!t.trim())return {};try{let i=JSON.parse(t);return i&&typeof i=="object"?i:{}}catch{return {}}}async function k(t){let i=t.text;if(typeof i=="function"){let s=await i.call(t).catch(()=>"");return {text:s,payload:O(s)}}let n=await t.json().catch(()=>({}));return {text:JSON.stringify(n),payload:n&&typeof n=="object"?n:{}}}function y(t){let i=t?.trim().toLowerCase()??"";if(!i)return "";if(!/^[a-z0-9][a-z0-9-]{0,47}$/.test(i))throw new Error("sandboxAppId must be 1-48 lowercase letters, numbers, or dashes.");return i}function E(t,i){let n=t.trim(),s=y(i);return s?`${n}::sandbox::${s}`:n}var L=S,U=S;
|
|
2
2
|
export{D as a,x as b,N as c,M as d,S as e,E as f,L as g,U as h};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { R as RuntimeClientOptions, I as ITransport } from './types-
|
|
2
|
-
export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, K as RuntimeConnectionTarget, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, v as RuntimeRawConnection, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel } from './types-
|
|
1
|
+
import { R as RuntimeClientOptions, I as ITransport } from './types-BSJ8IyBq.js';
|
|
2
|
+
export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, K as RuntimeConnectionTarget, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, v as RuntimeRawConnection, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel } from './types-BSJ8IyBq.js';
|
|
3
3
|
import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
|
|
4
|
-
import { O as OpenRTCClient } from './spaceTokens-
|
|
5
|
-
export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-
|
|
6
|
-
import {
|
|
7
|
-
export { X as AppLimits, Y as ApplicationCryptoBiStream,
|
|
4
|
+
import { O as OpenRTCClient } from './spaceTokens-Dc1CsMQt.js';
|
|
5
|
+
export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-Dc1CsMQt.js';
|
|
6
|
+
import { v as ProtocolName, U as ProtocolCapability, V as ProtocolCapabilityMap, s as ApplicationPayloadCrypto, W as ApplicationCryptoStreamTools } from './types-Cb_GFANp.js';
|
|
7
|
+
export { X as AppLimits, Y as ApplicationCryptoBiStream, t as ApplicationPayloadReadinessOptions, u as ApplicationPayloadRouteOptions, w as ApplicationPayloadSendOptions, A as AuthMode, O as DevicePresenceStatus, D as DiscoveryMode, G as GrantScope, Z as ProtocolBaseName, _ as ProtocolImplementationKind, $ as ProtocolLocality, a0 as RouteDescriptor, a1 as RouteFamily, a2 as RouteImplementationKind, d as SignalingMode, S as SpaceAuthMode, a as SpaceTokenProvider } from './types-Cb_GFANp.js';
|
|
8
8
|
export { ROUTE_DESCRIPTORS, TRANSPORT_LABELS, getRouteDescriptor, isDirectIrohTransportLabel, isIndependentTransportLabel, isIrohBaseTransportLabel, isOptionalTransportLabel, isWebRtcTransportLabel, listRouteDescriptors, normalizeTransportLabel } from './transport/index.js';
|
|
9
9
|
export { isRuntimeDeviceActive, isRuntimeDeviceConnectable, isRuntimeDeviceRoutable } from './runtime/device-status.js';
|
|
10
10
|
export { R as RuntimeJsonFrameHandler, a as RuntimeU32BEFrameHandler, c as createRuntimeJsonFrameDecoder, b as createRuntimeU32BEFrameDecoder, d as decodeRuntimeJsonPayload, e as encodeRuntimeJsonFrame, f as encodeRuntimeJsonPayload, g as encodeRuntimeU32BEFrame } from './framing-zRvEKOld.js';
|
|
11
|
-
export { O as OPENRTC_RUNTIME_POLICY, a as RuntimePolicySnapshot, S as ScopedSession, c as Session, d as SessionOptions, g as getRuntimePolicy } from './assembly-
|
|
11
|
+
export { O as OPENRTC_RUNTIME_POLICY, a as RuntimePolicySnapshot, S as ScopedSession, c as Session, d as SessionOptions, g as getRuntimePolicy } from './assembly-DisGbrdH.js';
|
|
12
12
|
export { b as RuntimeAdapterKind, R as RuntimeCapabilities } from './capabilities-C4Dqs_pB.js';
|
|
13
13
|
import './IEngineBridge-C7OT2CRv.js';
|
|
14
14
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b}from'./chunk-
|
|
1
|
+
import {a,b}from'./chunk-ZZIIBIEC.js';export{e as createPublicSpaceTokenProvider,h as createSpaceTokenProvider,c as enableSpaceAuth,d as mintSpaceToken,f as sandboxSpaceKey,g as spaceToken}from'./chunk-ZZIIBIEC.js';import {a as a$1,b as b$1}from'./chunk-LVJSU53Y.js';export{d as KEY_AGREEMENT_ALGORITHM,c as KEY_AGREEMENT_PUBLIC_KEY_BYTES,h as ScopedSession,w as createRuntimeJsonFrameDecoder,s as createRuntimeU32BEFrameDecoder,u as decodeRuntimeJsonPayload,f as deriveApplicationCryptoKey,g as encodeApplicationKeyAgreementPayload,v as encodeRuntimeJsonFrame,t as encodeRuntimeJsonPayload,r as encodeRuntimeU32BEFrame,e as generateEphemeralKeyAgreement,b as getPreferredProtocolOrder}from'./chunk-NP3JZ2LD.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'./chunk-CK6WQV7J.js';import'./chunk-3SND2COC.js';import {g}from'./chunk-KP5H3SYJ.js';export{x as OPENRTC_RUNTIME_POLICY,o as createApplicationCryptoStreamTools,n as createSharedSecretApplicationCrypto,y as getRuntimePolicy,m as isApplicationEncryptedPayload}from'./chunk-HXTGHALT.js';export{a as TRANSPORT_LABELS,d as isDirectIrohTransportLabel,h as isIndependentTransportLabel,c as isIrohBaseTransportLabel,e as isOptionalTransportLabel,f as isWebRtcTransportLabel,b as normalizeTransportLabel}from'./chunk-QT2ASNI3.js';import'./chunk-YFNRKQEA.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'./chunk-C7YN5MSV.js';function s(e){let t=a(e),o=a$1(t);return b(o,"web")}s.native=function(e,t){let o=a(e),c=t??g(),m=b$1(o,c);return b(m,"native")};export{s as OpenRTC};
|
package/dist/native.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { R as RuntimeClientOptions } from './types-
|
|
1
|
+
import { R as RuntimeClientOptions } from './types-BSJ8IyBq.js';
|
|
2
2
|
import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
|
|
3
3
|
export { c as classifyNativeIpcFailure, i as isNativeIpcCommandUnavailable } from './ipc-CflAVodw.js';
|
|
4
|
-
import { O as OpenRTCClient } from './spaceTokens-
|
|
5
|
-
export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-
|
|
6
|
-
export { S as SpaceAuthMode, a as SpaceTokenProvider } from './types-
|
|
4
|
+
import { O as OpenRTCClient } from './spaceTokens-Dc1CsMQt.js';
|
|
5
|
+
export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-Dc1CsMQt.js';
|
|
6
|
+
export { S as SpaceAuthMode, a as SpaceTokenProvider } from './types-Cb_GFANp.js';
|
|
7
7
|
import './IEngineBridge-C7OT2CRv.js';
|
|
8
|
-
import './assembly-
|
|
8
|
+
import './assembly-DisGbrdH.js';
|
|
9
9
|
import './capabilities-C4Dqs_pB.js';
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b}from'./chunk-
|
|
1
|
+
import {a,b}from'./chunk-ZZIIBIEC.js';export{e as createPublicSpaceTokenProvider,h as createSpaceTokenProvider,c as enableSpaceAuth,d as mintSpaceToken,f as sandboxSpaceKey,g as spaceToken}from'./chunk-ZZIIBIEC.js';import {A as A$1}from'./chunk-NP3JZ2LD.js';import {h}from'./chunk-KP5H3SYJ.js';export{e as classifyNativeIpcFailure,f as isNativeIpcCommandUnavailable}from'./chunk-KP5H3SYJ.js';import'./chunk-HXTGHALT.js';import'./chunk-QT2ASNI3.js';import {s}from'./chunk-YFNRKQEA.js';import'./chunk-C7YN5MSV.js';function c(t,p){let e=s(t);return A$1(e,new h({...e,bridge:p}))}function A(t,p){let e=c(a(t),p);return b(e,"native")}export{A as createNativeOpenRTC};
|
package/dist/openrtc_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DelegatingRuntimeAdapter, W as WasmBridgeOptions } from '../DelegatingRuntimeAdapter-
|
|
2
|
-
import '../types-
|
|
1
|
+
import { D as DelegatingRuntimeAdapter, W as WasmBridgeOptions } from '../DelegatingRuntimeAdapter-D_kGKQtW.js';
|
|
2
|
+
import '../types-Cb_GFANp.js';
|
|
3
3
|
import '../IEngineBridge-C7OT2CRv.js';
|
|
4
4
|
import '../capabilities-C4Dqs_pB.js';
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as WasmRuntimeAdapter}from'../chunk-
|
|
1
|
+
export{a as WasmRuntimeAdapter}from'../chunk-3SND2COC.js';import'../chunk-HXTGHALT.js';import'../chunk-QT2ASNI3.js';import'../chunk-YFNRKQEA.js';import'../chunk-C7YN5MSV.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot } from '../types-
|
|
1
|
+
import { c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot } from '../types-BSJ8IyBq.js';
|
|
2
2
|
import '../IEngineBridge-C7OT2CRv.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-Cb_GFANp.js';
|
|
4
4
|
|
|
5
5
|
interface RuntimeDeviceActiveOptions {
|
|
6
6
|
now?: number;
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { e as RuntimeFactoryOptions, b as PlutoRuntimeAssembly, P as PeerReconciliationStats } from '../assembly-
|
|
2
|
-
export { O as OPENRTC_RUNTIME_POLICY, R as RuntimeClient, a as RuntimePolicySnapshot, D as ScopedConnectionActorError, f 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, g as getRuntimePolicy, q as scopedConnectionKey, r as scopedConnectionKeyToString } from '../assembly-
|
|
1
|
+
import { e as RuntimeFactoryOptions, b as PlutoRuntimeAssembly, P as PeerReconciliationStats } from '../assembly-DisGbrdH.js';
|
|
2
|
+
export { O as OPENRTC_RUNTIME_POLICY, R as RuntimeClient, a as RuntimePolicySnapshot, D as ScopedConnectionActorError, f 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, g as getRuntimePolicy, q as scopedConnectionKey, r as scopedConnectionKeyToString } from '../assembly-DisGbrdH.js';
|
|
3
3
|
import * as Draft14 from '@moq/net';
|
|
4
|
-
import { a3 as SignalingOptions, I as ISignalingBackend,
|
|
5
|
-
import { C as Connection, K as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-
|
|
6
|
-
export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, R as RuntimeClientOptions, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-
|
|
4
|
+
import { a3 as SignalingOptions, I as ISignalingBackend, f as RuntimeIdentity, g as RoomMember, j as SignalingEnvelope, l as SignalingSession, h as Device, q as BackendConnectionState, X as AppLimits, G as GrantScope, J as JoinRoomOptions, y as IncomingStreamChannelMetadata, W as ApplicationCryptoStreamTools, a4 as RoomCreationMode, e as ClientOptions, s as ApplicationPayloadCrypto, D as DiscoveryMode, V as ProtocolCapabilityMap, a5 as ScanningLoopOptions, a6 as ScanningLoopHandle, a7 as RuntimeBootstrapOptions, a8 as RuntimeBootstrapResult, t as ApplicationPayloadReadinessOptions, a9 as ManagedApplicationRouteOptions, F as PeerState, K as PeerScope, H as PeerHealth, x as ChannelDescriptor, aa as JoinRequest, o as NativeConnectParams, p as NativeConnectResult } from '../types-Cb_GFANp.js';
|
|
5
|
+
import { C as Connection, K as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-BSJ8IyBq.js';
|
|
6
|
+
export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, R as RuntimeClientOptions, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-BSJ8IyBq.js';
|
|
7
7
|
import { FirebaseApp } from 'firebase/app';
|
|
8
8
|
import { R as RuntimeCapabilities } from '../capabilities-C4Dqs_pB.js';
|
|
9
9
|
export { B as BROWSER_WASM_RUNTIME_CAPABILITIES, c as BrowserRuntimeCapabilityHost, N as NATIVE_IPC_RUNTIME_CAPABILITIES, d as NativeRuntimeStatusSnapshot, e as NativeRuntimeTransportFeatureStatus, b as RuntimeAdapterKind, a as RuntimeCapabilityProfile, f as cloneRuntimeCapabilities, r as runtimeCapabilitiesForBrowserHost, g as runtimeCapabilitiesFromNativeStatus, h as runtimeCapabilityProfile } from '../capabilities-C4Dqs_pB.js';
|
|
10
10
|
export { RuntimeDeviceActiveOptions, isRuntimeDeviceActive, isRuntimeDeviceConnectable, isRuntimeDeviceRoutable } from './device-status.js';
|
|
11
11
|
export { h as RuntimeJsonFrameDecoderOptions, R as RuntimeJsonFrameHandler, a as RuntimeU32BEFrameHandler, i as concatRuntimeBytes, c as createRuntimeJsonFrameDecoder, b as createRuntimeU32BEFrameDecoder, d as decodeRuntimeJsonPayload, e as encodeRuntimeJsonFrame, f as encodeRuntimeJsonPayload, g as encodeRuntimeU32BEFrame, r as readRuntimeU32BE } from '../framing-zRvEKOld.js';
|
|
12
|
-
import { I as IpcRuntimeAdapter } from '../tauri-
|
|
13
|
-
export { a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-
|
|
12
|
+
import { I as IpcRuntimeAdapter } from '../tauri-DSkrSuO-.js';
|
|
13
|
+
export { a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-DSkrSuO-.js';
|
|
14
14
|
import { WasmRuntimeAdapter } from './WasmRuntimeAdapter.js';
|
|
15
15
|
import { P as PlutoIpcBridge } from '../ipc-CflAVodw.js';
|
|
16
16
|
export { N as NativeIpcFailureKind, a as PlutoIpcUnlisten, c as classifyNativeIpcFailure, i as isNativeIpcCommandUnavailable } from '../ipc-CflAVodw.js';
|
|
17
17
|
import '../IEngineBridge-C7OT2CRv.js';
|
|
18
|
-
import '../DelegatingRuntimeAdapter-
|
|
18
|
+
import '../DelegatingRuntimeAdapter-D_kGKQtW.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* RtdbPresence — Phase 1 RTDB-backed device presence.
|
|
@@ -79,12 +79,16 @@ interface RtdbMemberPresence {
|
|
|
79
79
|
}
|
|
80
80
|
type RtdbRoomPresenceMap = Record<string, RtdbMemberPresence>;
|
|
81
81
|
declare class RtdbPresence {
|
|
82
|
+
private readonly app;
|
|
83
|
+
private readonly auth;
|
|
82
84
|
private readonly db;
|
|
83
85
|
private readonly runtimeInstanceId;
|
|
84
86
|
private readonly desiredOnlineNodes;
|
|
85
87
|
private connected;
|
|
86
88
|
private connectedUnsubscribe;
|
|
87
89
|
private leaseRefreshTimer;
|
|
90
|
+
private readonly activeSubscriptions;
|
|
91
|
+
private readonly economicPresenceLease;
|
|
88
92
|
constructor(app: FirebaseApp, runtimeInstanceId?: string);
|
|
89
93
|
private ensureReconnectWatch;
|
|
90
94
|
private publishDesiredOnline;
|
|
@@ -155,6 +159,11 @@ declare class Signaling {
|
|
|
155
159
|
waitForAuth(): Promise<void>;
|
|
156
160
|
get currentUser(): RuntimeIdentity | null;
|
|
157
161
|
getRtdbPresence(): RtdbPresence | null;
|
|
162
|
+
usesCoordinationGateway(): boolean;
|
|
163
|
+
joinCoordinationRoom(roomId: string, nodeId: string, ticket: string): Promise<void>;
|
|
164
|
+
leaveCoordinationRoom(roomId: string): Promise<void>;
|
|
165
|
+
getCoordinationRoomMembers(roomId: string): Promise<RoomMember[]>;
|
|
166
|
+
watchCoordinationRoomMembers(roomId: string, callback: (members: RoomMember[]) => void): () => void;
|
|
158
167
|
onAuthChange(callback: (user: RuntimeIdentity | null) => void): () => void;
|
|
159
168
|
signInAnonymously(): Promise<void>;
|
|
160
169
|
signInWithPluto(): Promise<void>;
|
|
@@ -293,6 +302,7 @@ declare class MoQPublisher {
|
|
|
293
302
|
private closed;
|
|
294
303
|
constructor(session: MoQSession, options?: MoQPublisherOptions);
|
|
295
304
|
announce(namespace: string): Promise<void>;
|
|
305
|
+
hasNamespace(namespace: string): boolean;
|
|
296
306
|
hasTrackSubscriber(namespace: string, name: string): boolean;
|
|
297
307
|
createTrack(namespace: string, name: string): Promise<TrackPublisher>;
|
|
298
308
|
close(): void;
|
|
@@ -343,6 +353,8 @@ declare class RoomManager {
|
|
|
343
353
|
setRtdbPresence(rtdbPresence: RtdbPresence): void;
|
|
344
354
|
private syncRtdbPresenceFromSignaling;
|
|
345
355
|
private usesDirectRoomBackend;
|
|
356
|
+
private usesCoordinationGateway;
|
|
357
|
+
private usesManagedRoomControlPlane;
|
|
346
358
|
private get roomBackendTag();
|
|
347
359
|
private resolveRoomUserId;
|
|
348
360
|
private get appTag();
|
package/dist/runtime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as createIpcClient,a as createWasmClient}from'../chunk-
|
|
1
|
+
export{b as createIpcClient,a as createWasmClient}from'../chunk-LVJSU53Y.js';export{z as RuntimeClient,i as RuntimeConnectionController,m as ScopedConnectionActorError,p as ScopedConnectionActorHandle,q as ScopedConnectionActorRegistry,l as clog,x as concatRuntimeBytes,k as correlationForDriveGrantScope,w as createRuntimeJsonFrameDecoder,s as createRuntimeU32BEFrameDecoder,u as decodeRuntimeJsonPayload,v as encodeRuntimeJsonFrame,t as encodeRuntimeJsonPayload,r as encodeRuntimeU32BEFrame,y as readRuntimeU32BE,j as renderCorrelationFields,n as scopedConnectionKey,o as scopedConnectionKeyToString}from'../chunk-NP3JZ2LD.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';export{a as WasmRuntimeAdapter}from'../chunk-3SND2COC.js';export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-WFUW3BHK.js';export{h as IpcRuntimeAdapter,e as classifyNativeIpcFailure,f as isNativeIpcCommandUnavailable}from'../chunk-KP5H3SYJ.js';export{z as BROWSER_WASM_RUNTIME_CAPABILITIES,A as NATIVE_IPC_RUNTIME_CAPABILITIES,x as OPENRTC_RUNTIME_POLICY,B as cloneRuntimeCapabilities,y as getRuntimePolicy,p as logOpenRtcTeardownTrace,c as openRtcDebug,b as openRtcDebugEnabled,d as openRtcDebugInfo,e as openRtcDebugLog,C as runtimeCapabilitiesForBrowserHost,D as runtimeCapabilitiesFromNativeStatus,E as runtimeCapabilityProfile}from'../chunk-HXTGHALT.js';import'../chunk-QT2ASNI3.js';import'../chunk-YFNRKQEA.js';import'../chunk-C7YN5MSV.js';
|
package/dist/runtime/tauri.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-
|
|
1
|
+
export { T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-DSkrSuO-.js';
|
|
2
2
|
import '../ipc-CflAVodw.js';
|
|
3
|
-
import '../types-
|
|
4
|
-
import '../DelegatingRuntimeAdapter-
|
|
3
|
+
import '../types-Cb_GFANp.js';
|
|
4
|
+
import '../DelegatingRuntimeAdapter-D_kGKQtW.js';
|
|
5
5
|
import '../IEngineBridge-C7OT2CRv.js';
|
|
6
6
|
import '../capabilities-C4Dqs_pB.js';
|
package/dist/runtime/tauri.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-
|
|
1
|
+
export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-WFUW3BHK.js';import'../chunk-KP5H3SYJ.js';import'../chunk-HXTGHALT.js';import'../chunk-QT2ASNI3.js';import'../chunk-YFNRKQEA.js';import'../chunk-C7YN5MSV.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as RuntimeClient, a as RuntimePolicySnapshot, P as PeerReconciliationStats, b as PlutoRuntimeAssembly } from './assembly-
|
|
2
|
-
import { C as ConnectDeviceResult, b as ConnectDeviceHooks, c as ConnectDeviceOptions, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, G as GrantScope, a as SpaceTokenProvider } from './types-
|
|
1
|
+
import { R as RuntimeClient, a as RuntimePolicySnapshot, P as PeerReconciliationStats, b as PlutoRuntimeAssembly } from './assembly-DisGbrdH.js';
|
|
2
|
+
import { C as ConnectDeviceResult, b as ConnectDeviceHooks, c as ConnectDeviceOptions, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, G as GrantScope, a as SpaceTokenProvider } from './types-Cb_GFANp.js';
|
|
3
3
|
import { A as AuthContext } from './IEngineBridge-C7OT2CRv.js';
|
|
4
|
-
import { a as RuntimeManagedSessionOptions, b as RuntimeManagedSession, c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot, e as RuntimeDeviceConnectOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, h as RuntimePeerState, i as RuntimePeerConnectOptions, C as Connection, j as RuntimePeerReadinessSnapshot, k as RuntimePeerHealth, l as RuntimeChannelDescriptor, m as RuntimePeerStreamOptions, n as RuntimeIncomingStream, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, q as RuntimeJoinRoomOptions, r as RuntimeRoomMember, s as RuntimeConnectionStateSnapshot, t as RuntimeApplicationPayloadReadinessOptions, u as RuntimeConnectionEvent, v as RuntimeRawConnection } from './types-
|
|
4
|
+
import { a as RuntimeManagedSessionOptions, b as RuntimeManagedSession, c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot, e as RuntimeDeviceConnectOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, h as RuntimePeerState, i as RuntimePeerConnectOptions, C as Connection, j as RuntimePeerReadinessSnapshot, k as RuntimePeerHealth, l as RuntimeChannelDescriptor, m as RuntimePeerStreamOptions, n as RuntimeIncomingStream, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, q as RuntimeJoinRoomOptions, r as RuntimeRoomMember, s as RuntimeConnectionStateSnapshot, t as RuntimeApplicationPayloadReadinessOptions, u as RuntimeConnectionEvent, v as RuntimeRawConnection } from './types-BSJ8IyBq.js';
|
|
5
5
|
import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './capabilities-C4Dqs_pB.js';
|
|
6
6
|
|
|
7
7
|
type OpenRTCChannelConnectOptions = Omit<RuntimeScopedChannelOptions, 'scope' | 'deviceId' | 'ticket'> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-
|
|
1
|
+
import { e as ClientOptions } from './types-Cb_GFANp.js';
|
|
2
|
+
import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-D_kGKQtW.js';
|
|
3
3
|
import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
|
|
4
4
|
|
|
5
5
|
interface NativeIpcBridgeOptions extends WasmBridgeOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a0 as RouteDescriptor,
|
|
2
|
-
export { a1 as RouteFamily, a2 as RouteImplementationKind } from '../types-
|
|
1
|
+
import { a0 as RouteDescriptor, v as ProtocolName } from '../types-Cb_GFANp.js';
|
|
2
|
+
export { a1 as RouteFamily, a2 as RouteImplementationKind } from '../types-Cb_GFANp.js';
|
|
3
3
|
|
|
4
4
|
declare const ROUTE_DESCRIPTORS: readonly RouteDescriptor[];
|
|
5
5
|
declare function getRouteDescriptor(id: ProtocolName): RouteDescriptor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as AuthContext } from './IEngineBridge-C7OT2CRv.js';
|
|
2
|
-
import {
|
|
2
|
+
import { r as ConnectionOptions, s as ApplicationPayloadCrypto, t as ApplicationPayloadReadinessOptions, u as ApplicationPayloadRouteOptions, v as ProtocolName, w as ApplicationPayloadSendOptions, T as TransportLatencySnapshot, x as ChannelDescriptor$1, L as LocalDeviceInfo, y as IncomingStreamChannelMetadata, e as ClientOptions, h as Device, l as SignalingSession, f as RuntimeIdentity, i as DeviceStatusSnapshot, z as ManagedDeviceConnectOptions, F as PeerState, H as PeerHealth, J as JoinRoomOptions, g as RoomMember, K as PeerScope, q as BackendConnectionState, O as DevicePresenceStatus, Q as PeerLifecycleStatus, P as PeerSessionSnapshot } from './types-Cb_GFANp.js';
|
|
3
3
|
|
|
4
4
|
interface ITransport {
|
|
5
5
|
readonly name: string;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
interface CoordinationGatewayOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Provider-neutral coordination gateway endpoint.
|
|
4
|
+
* Credentials are delivered in the first WebSocket frame, never this URL.
|
|
5
|
+
*/
|
|
6
|
+
endpoint: string;
|
|
7
|
+
/**
|
|
8
|
+
* Fail-closed lane marker. The credential issuer and Worker independently
|
|
9
|
+
* verify the matching Firebase project and token audience.
|
|
10
|
+
*/
|
|
11
|
+
environment: 'staging' | 'production';
|
|
12
|
+
}
|
|
13
|
+
|
|
1
14
|
interface AppLimits {
|
|
2
15
|
/** Max devices per authenticated user. -1 = unlimited. */
|
|
3
16
|
devicesPerUser: number;
|
|
@@ -199,6 +212,14 @@ interface ClientOptions {
|
|
|
199
212
|
allowAnonymousHostedDefaults?: boolean;
|
|
200
213
|
signalingMode?: SignalingMode;
|
|
201
214
|
projectId?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Provider-neutral coordination gateway.
|
|
217
|
+
*
|
|
218
|
+
* When set, hot presence, roster, and signaling operations fail closed
|
|
219
|
+
* through the gateway; the SDK never falls back to direct Firestore/RTDB.
|
|
220
|
+
* Hosted production clients receive the managed production default.
|
|
221
|
+
*/
|
|
222
|
+
coordinationGateway?: CoordinationGatewayOptions;
|
|
202
223
|
storagePrefix?: string;
|
|
203
224
|
deviceTTL?: number;
|
|
204
225
|
deviceName?: string;
|
|
@@ -274,6 +295,7 @@ interface Device {
|
|
|
274
295
|
deviceName: string;
|
|
275
296
|
online: boolean;
|
|
276
297
|
ticket: string;
|
|
298
|
+
friendTicket?: string;
|
|
277
299
|
presenceStatus?: DevicePresenceStatus;
|
|
278
300
|
presenceUpdatedAt?: number;
|
|
279
301
|
presenceExpiresAt?: number;
|
|
@@ -685,6 +707,11 @@ interface ISignalingBackend {
|
|
|
685
707
|
signInWithPluto?(): Promise<void>;
|
|
686
708
|
signOut(): Promise<void>;
|
|
687
709
|
stopAuthScopedActivity?(): Promise<void>;
|
|
710
|
+
usesCoordinationGateway?(): boolean;
|
|
711
|
+
joinCoordinationRoom?(roomId: string, nodeId: string, ticket: string): Promise<void>;
|
|
712
|
+
leaveCoordinationRoom?(roomId: string): Promise<void>;
|
|
713
|
+
getCoordinationRoomMembers?(roomId: string): Promise<RoomMember[]>;
|
|
714
|
+
watchCoordinationRoomMembers?(roomId: string, callback: (members: RoomMember[]) => void): () => void;
|
|
688
715
|
getTurnCredentials(): Promise<any>;
|
|
689
716
|
updatePresence(localNodeId: string, ticketStr: string, isOnline: boolean, ttlMs: number, metadata?: string): Promise<void>;
|
|
690
717
|
refreshLivePresence?(localNodeId: string, ticketStr: string, metadata?: string): Promise<void>;
|
|
@@ -934,4 +961,4 @@ interface JoinRequest {
|
|
|
934
961
|
state: 'pending' | 'accepted' | 'rejected';
|
|
935
962
|
}
|
|
936
963
|
|
|
937
|
-
export type { ProtocolLocality as $, AuthMode as A, BackendPeerBiStream as B, ConnectDeviceResult as C, DiscoveryMode as D, ExplicitFileDataSendParams as E,
|
|
964
|
+
export type { ProtocolLocality as $, AuthMode as A, BackendPeerBiStream as B, ConnectDeviceResult as C, DiscoveryMode as D, ExplicitFileDataSendParams as E, PeerState as F, GrantScope as G, PeerHealth as H, ISignalingBackend as I, JoinRoomOptions as J, PeerScope as K, LocalDeviceInfo as L, ManagedConnectionRecord as M, NativeManagedSessionStartResult as N, DevicePresenceStatus as O, PeerSessionSnapshot as P, PeerLifecycleStatus as Q, ResolvedPeerIdentity as R, SpaceAuthMode as S, TransportLatencySnapshot as T, ProtocolCapability as U, ProtocolCapabilityMap as V, ApplicationCryptoStreamTools as W, AppLimits as X, ApplicationCryptoBiStream as Y, ProtocolBaseName as Z, ProtocolImplementationKind as _, SpaceTokenProvider as a, RouteDescriptor as a0, RouteFamily as a1, RouteImplementationKind as a2, SignalingOptions as a3, RoomCreationMode as a4, ScanningLoopOptions as a5, ScanningLoopHandle as a6, RuntimeBootstrapOptions as a7, RuntimeBootstrapResult as a8, ManagedApplicationRouteOptions as a9, JoinRequest as aa, ConnectDeviceHooks as b, ConnectDeviceOptions as c, SignalingMode as d, ClientOptions as e, RuntimeIdentity as f, RoomMember as g, Device as h, DeviceStatusSnapshot as i, SignalingEnvelope as j, DeviceEvent as k, SignalingSession as l, SessionEvent as m, BackendPeerUniStream as n, NativeConnectParams as o, NativeConnectResult as p, BackendConnectionState as q, ConnectionOptions as r, ApplicationPayloadCrypto as s, ApplicationPayloadReadinessOptions as t, ApplicationPayloadRouteOptions as u, ProtocolName as v, ApplicationPayloadSendOptions as w, ChannelDescriptor as x, IncomingStreamChannelMetadata as y, ManagedDeviceConnectOptions as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrtc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -108,7 +108,8 @@
|
|
|
108
108
|
"playwright": "^1.58.2",
|
|
109
109
|
"tsup": "^8.5.1",
|
|
110
110
|
"typescript": "^5.0.0",
|
|
111
|
-
"vitest": "^4.0.18"
|
|
111
|
+
"vitest": "^4.0.18",
|
|
112
|
+
"zod": "^4.4.3"
|
|
112
113
|
},
|
|
113
114
|
"directories": {
|
|
114
115
|
"example": "examples",
|
package/dist/chunk-DI5IPRPM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {w,F,C,E,A,c,p,b,o,r,s,t as t$1,u as u$1,v as v$1}from'./chunk-YTUWXCRO.js';import {x,u,a,g,t,E as E$1,G}from'./chunk-HVTYSEU7.js';function ie(d){let e=String(d?.message??d??"").toLowerCase();return e?e.includes("__tauri_internals__")||e.includes("window is not defined")||e.includes("cannot read properties of undefined")?"runtime-unavailable":e.includes("timeout after")?"timeout":e.includes("not found")||e.includes("not allowed")||e.includes("unknown command")||e.includes("plugin not found")||e.includes("plugin:openrtc-tauri-plugin")||e.includes("plugin:openrtc")?"command-unavailable":"unknown":"unknown"}function O(d){return ie(d)==="command-unavailable"}function T(d,e="native runtime"){if(!d||typeof d!="object")throw new Error(`[openrtc] ${e} requires a valid IPC bridge object.`);if(typeof d.invoke!="function")throw new Error(`[openrtc] ${e} IPC bridge is missing invoke(command, args).`);if(typeof d.listen!="function")throw new Error(`[openrtc] ${e} IPC bridge is missing listen(event, handler).`);return d}var B=null;async function ne(){return B||(B=(async()=>{let d="openrtc-tauri",e="../../../tauri/src/runtime/ipc";try{return await import(d)}catch(t){try{return await import(e)}catch(i){let n=new Error("[openrtc] Native support now lives in the first-party `openrtc-tauri` package. Install `openrtc-tauri` (and `@tauri-apps/api`) or pass an explicit IPC bridge to OpenRTC.native(...).");throw n.cause={packageError:t,workspaceError:i},n}}})()),B}function Q(){let d=null,e=async()=>(d||(d=ne().then(t=>T(t.createTauriIpcBridge(),"openrtc-tauri"))),d);return {async invoke(t,i){return (await e()).invoke(t,i)},async listen(t,i){return (await e()).listen(t,i)},async isAvailable(){try{let t=await e();return typeof t.isAvailable=="function"?!!await t.isAvailable():!0}catch{return false}}}}var ae="relay-only endpoint ticket unavailable",re=12e3,se=250,oe=1500;function ce(d){return String(d?.message??d??"").toLowerCase().includes(ae)}async function q(d,e={}){let t=e.windowMs??re,i=e.minDelayMs??se,n=e.maxDelayMs??oe,r=Date.now(),s=0,a=null;for(;e.isActive?.()??true;){s+=1;try{return await d()}catch(u$1){if(a=u$1,!ce(u$1))throw u$1;let o=Date.now()-r;if(o>=t)throw u$1;let c=Math.min(x(s,i,n),Math.max(0,t-o));c>0&&await u(c);}}throw a||new Error("endpoint ticket minting stopped before a ticket was available")}function Z(d){let e=d?.split(".")[1];if(!e)return null;try{let t=e.replace(/-/g,"+").replace(/_/g,"/"),i=(4-t.length%4)%4,n=atob(t+"=".repeat(i)),r=JSON.parse(n);return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function X(d,e){let t=d?.[e];return typeof t=="string"&&t.trim()?t.trim():null}function ee(d,e){return X(d,"namespaceId")===e||X(d,"appTag")===`space::${e}`}var v=class v{constructor(e){this.subscriptionNonce=0;this.lastSyncedAuthToken=null;this.cachedLocalDeviceId=null;this.cachedLocalDeviceName=null;this.tauriCoreAvailability=null;this.tauriCoreAvailabilityValue=null;this.tauriCoreAvailabilityCheckedAtMs=0;this.authSyncInFlight=null;this.nativeRuntimeCapabilitiesSyncInFlight=null;this.lastNativeAuthSyncAtMs=0;this.hasLoggedMissingAuthForDevices=false;this.runtimeCapabilities=C(null,false);this.fallback=new E(e),this.app=this.fallback.app,this.auth=this.fallback.auth,this.appTag=this.fallback.tag,this.options=this.fallback.getResolvedOptions(),this.transportOptions=e.transports,this.strictMode=e.strictMode===true,this.turnCredentialsProvider=e.turnCredentialsProvider,this.allowWasmFallback=e.allowWasmFallback??false,this.ipcBridge=T(e.ipcBridge??Q(),"NativeIpcBridge"),this.runtimeCapabilities=C(null,this.allowWasmFallback),this.syncNativeRuntimeCapabilities("constructor");}get currentUser(){return this.fallback.currentUser}get tag(){return this.fallback.tag}getRuntimeCapabilities(){let e=A(this.runtimeCapabilities);return e.fallback.wasm=this.allowWasmFallback,e}setWasmClient(e){if(!this.allowWasmFallback){let t="[NativeIpcBridge][NATIVE-GUARD] Refusing WasmClient attachment because native IPC is authoritative and WASM fallback is disabled.";throw console.error(t,{capabilities:this.getRuntimeCapabilities()}),new Error(t)}this.fallback.setWasmClient(e);}onAuthChange(e){return this.fallback.onAuthChange(e)}checkForSSOToken(){return this.fallback.checkForSSOToken()}waitForAuth(){return this.fallback.waitForAuth()}signInAnonymously(){return this.fallback.signInAnonymously()}getTurnCredentials(){return this.fallback.getTurnCredentials()}cleanupStaleDevices(){return this.fallback.cleanupStaleDevices()}sendMessage(e,t,i,n){return this.fallback.sendMessage(e,t,i,n)}pollMessages(e){return this.fallback.pollMessages(e)}createSession(e){return this.fallback.createSession(e)}updateSession(e,t){return this.fallback.updateSession(e,t)}async openPeerBi(e,t){return await this.canUseTauriIpc()?this.openPeerBiViaIpc("open_peer_bi_stream",{peerId:e,timeoutMs:t??null}):this.fallback.openPeerBi(e,t)}async openPeerBiTransportOnly(e,t){return await this.canUseTauriIpc()?this.openPeerBiViaIpc("open_peer_bi_transport_only_stream",{peerId:e,timeoutMs:t??null},{fallbackCommand:"open_peer_bi_stream"}):this.fallback.openPeerBiTransportOnly(e,t)}async openPeerNativeBi(e,t,i){return await this.canUseTauriIpc()?this.openPeerBiViaIpc("open_peer_native_bi_stream",{peerId:e,label:t,timeoutMs:i??null},{fallbackCommand:"open_peer_bi_stream",fallbackArgs:{peerId:e,timeoutMs:i??null}}):this.fallback.openPeerNativeBi(e,t,i)}async incoming_streams(){if(!await this.canUseTauriIpc()){let r=this.fallback;if(typeof r.incoming_streams=="function")return r.incoming_streams();throw new Error("Native incoming stream bridge is unavailable")}let e=`native-incoming-${Date.now()}-${++this.subscriptionNonce}`,t=null,i=false,n=async()=>{i=true;let r=t;t=null,await Promise.allSettled([r?Promise.resolve(r()):Promise.resolve(),this.invokeIpc("stop_rtc_subscription",{requestId:e},{timeoutMs:null}).catch(()=>{})]);};return new ReadableStream({start:async r=>{try{t=await this.listenIpc("openrtc://peer-bi-stream/incoming",s=>{if(i)return;let a=s.payload,u=typeof a?.requestId=="string"?a.requestId:typeof a?.request_id=="string"?a.request_id:"";if(u!==e){c("[NativeIpcBridge][incoming-application-stream] ignored request id",{expectedRequestId:e,eventRequestId:u});return}let o=typeof a?.streamId=="string"?a.streamId.trim():typeof a?.stream_id=="string"?a.stream_id.trim():"";if(!o)return;let c$1=typeof a?.remoteNodeId=="string"?a.remoteNodeId.trim():typeof a?.remote_node_id=="string"?a.remote_node_id.trim():"",l=Number.isSafeInteger(a?.transportStableId)?Number(a.transportStableId):Number.isSafeInteger(a?.transport_stable_id)?Number(a.transport_stable_id):0;if(!c$1||l<=0){c("[NativeIpcBridge][incoming-application-stream] ignored invalid generation",{requestId:e,remoteNodeId:c$1,transportStableId:l});return}c("[NativeIpcBridge][incoming-application-stream] accepted event",{requestId:e,remoteNodeId:c$1,transportStableId:l});let g=this.peerBiStreamFromId(o,{startReadAfterListeners:!0});r.enqueue({type:"bi",stream:{send:g.writable,recv:g.readable,endpoint_id:c$1},endpointId:c$1,transportStableId:l,protocolHint:"unknown",channel:null});}),await this.invokeIpc("start_incoming_peer_bi_streams",{requestId:e},{timeoutMs:null});}catch(s){i=true,r.error(s),await n();}},cancel:async()=>{await n();}})}async is_current_transport_stable_id(e,t){if(!await this.canUseTauriIpc()){let i=this.fallback;return typeof i.is_current_transport_stable_id=="function"?i.is_current_transport_stable_id(e,t):false}return !e.trim()||t<=0n||t>BigInt(Number.MAX_SAFE_INTEGER)?false:this.invokeIpc("is_current_transport_stable_id",{endpointId:e.trim(),transportStableId:Number(t)})}openPeerUni(e,t){return this.fallback.openPeerUni(e,t)}isConnected(e){return this.fallback.isConnected(e)}getAuthContext(){return this.fallback.getAuthContext()}resolveNativeAuthScopedUserId(e){return this.currentUser?.id??this.getAuthContext()?.userId??e??null}resolveConfiguredSpaceKey(){let e=this.options.spaceKey??this.options.space;return typeof e=="string"?e.trim():""}usesAnonymousSpaceMode(){return this.options.authMode==="anonymous"&&this.resolveConfiguredSpaceKey().length>0}requiresNativeAuthToken(){return !this.usesAnonymousSpaceMode()||typeof this.options.spaceTokenProvider=="function"}async nativeAuthTokenMatchesExpectedScope(e){if(!this.usesAnonymousSpaceMode())return true;let t=typeof this.options.apiKey=="string"?this.options.apiKey.trim():"",i=this.resolveConfiguredSpaceKey();if(!t||!i)return true;let n=await a(t,i).catch(()=>null);return n?ee(Z(e),n):true}resolveNativeSignalingUserId(e){return this.usesAnonymousSpaceMode()?(typeof e=="string"?e.trim():"")||this.resolveConfiguredSpaceKey()||null:this.resolveNativeAuthScopedUserId(e)}getCurrentUserId(){return this.resolveNativeSignalingUserId(this.fallback.getCurrentUserIdForScope())}nativeAuthWaitMs(){return this.requiresNativeAuthToken()?v.AUTH_REQUIRED_WAIT_MS:0}resolveWebLogicalDeviceId(){return this.fallback.getResolvedWebLogicalDeviceId()}normalizeDevice(e,t){return this.fallback.normalizeDeviceRecord(e,t)}matchesTag(e){return this.fallback.matchesLegacyOrCurrentTag(e)}nativeRosterTagDisposition(e){let t=p(e);if(this.matchesTag(t))return {keep:true,classification:"match"};let i=typeof t.appTag=="string"&&t.appTag.trim().length>0?t.appTag.trim():typeof t.tag=="string"&&t.tag.trim().length>0?t.tag.trim():void 0;return i===void 0?{keep:true,classification:"untagged"}:{keep:false,classification:"foreign",foreignTag:i}}filterNativeRosterByTag(e,t){let i=new Set,n=e.filter(r=>{let s=this.nativeRosterTagDisposition(r);return !s.keep&&s.foreignTag&&i.add(s.foreignTag),s.keep});return e.length>0&&n.length===0&&i.size>0?console.warn(`[NativeIpcBridge] ${t}: dropped ALL ${e.length} native device(s) as foreign-app \u2014 this is the app-tag drift signature (empty native device list). The native Rust OpenRTC app tag does not match the SDK app tag; check that the desktop binary and the web bundle use the same VITE_PLUTO_OPENRTC_API_KEY / VITE_PLUTO_OPENRTC_APP_TAG for this environment lane.`,{sdkAppTag:this.appTag,foreignTags:Array.from(i),droppedCount:e.length}):i.size>0&&c(`[NativeIpcBridge] ${t}: filtered ${e.length-n.length} foreign-app device(s) from the native roster`,{sdkAppTag:this.appTag,foreignTags:Array.from(i)}),n}normalizeNativeIceServer(e){let t=e.urls,i=Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.trim().length>0):typeof t=="string"&&t.trim().length>0?[t]:[];return i.length===0?null:{urls:i,username:typeof e.username=="string"&&e.username.trim().length>0?e.username:void 0,credential:typeof e.credential=="string"&&e.credential.trim().length>0?e.credential:void 0}}filterNativeStunServers(e){return e.map(t=>({...t,urls:t.urls.filter(i=>!i.startsWith("stun:"))})).filter(t=>t.urls.length>0)}nativeIceServerHasTurnUrl(e){return e.urls.some(t=>t.startsWith("turn:")||t.startsWith("turns:"))}async loadNativeTurnIceServers(){if(typeof this.turnCredentialsProvider!="function")return [];let e=await this.turnCredentialsProvider().catch(t=>(console.warn("[NativeIpcBridge] TURN credential provider failed:",t),null));return !e||!Array.isArray(e.iceServers)?[]:e.iceServers.map(t=>this.normalizeNativeIceServer(t)).filter(t=>!!t)}async buildNativeTransportConfigPayload(){let e=this.transportOptions;if(!e&&!this.strictMode)return null;let t=null;if(!this.strictMode&&e?.iroh&&typeof e.iroh=="object"){let o=e.iroh;o.localDiscovery===true&&(t={enabled:true,advertise:o.localDiscoveryMode!=="passive"});}let i=null;if(e?.webrtc===true||e?.webrtc&&typeof e.webrtc=="object"){let o=e.webrtc===true?null:e.webrtc,c=o?.useDefaultIceServers!==false,l=Array.isArray(o?.iceServers)&&o.iceServers.length>0?o.iceServers.map(m=>this.normalizeNativeIceServer(m)).filter(m=>!!m):c?g.map(m=>this.normalizeNativeIceServer(m)).filter(m=>!!m):[],g$1=this.strictMode||o?.privacyMode===true;(this.strictMode||o?.privacyMode===true||o?.useTurn===true)&&(l=[...l,...await this.loadNativeTurnIceServers()]),g$1&&(l=this.filterNativeStunServers(l));let h=l.some(m=>this.nativeIceServerHasTurnUrl(m)),f=g$1&&h;g$1&&!h&&console.warn("[NativeIpcBridge] Relay-only WebRTC requested, but no TURN servers are configured; native WebRTC override disabled");let k=o?.lanMode===true;(l.length>0||f||k||!c)&&(i={iceServers:l.length>0||!c?l:void 0,privacyMode:f,lanMode:k||void 0});}let n=null;if(e?.moq&&typeof e.moq=="object"){let o=typeof e.moq.relayUrl=="string"&&e.moq.relayUrl.trim().length>0?e.moq.relayUrl:void 0;if(o){let c=typeof e.moq.accessToken=="string"&&e.moq.accessToken.trim().length>0?e.moq.accessToken.trim():void 0;n={relayUrl:o,accessToken:c};}}let r=null;if(!this.strictMode&&(e?.ble===true||e?.ble&&typeof e.ble=="object")){let o=e.ble===true?null:e.ble,c=Number(o?.connectTimeoutMs);r={enabled:o?.enabled!==false,connectTimeoutMs:Number.isFinite(c)&&c>0?Math.round(c):void 0};}let s=this.strictMode||e?.iroh&&typeof e.iroh=="object"&&e.iroh.relayOnly===true,a=e?.iroh&&typeof e.iroh=="object"?e.iroh.relayTransportPolicy:void 0,u=this.strictMode?a??"auto":a;return !s&&!u&&!i&&!n&&!t&&!r?null:{irohRelayOnly:s||void 0,irohRelayTransportPolicy:u,irohLan:t,webrtc:i,moq:n,ble:r}}isTauriEnv(){return t()}nextConnectionEventRetryDelayMs(e){return x(e,v.CONNECTION_EVENT_RETRY_MIN_DELAY_MS,v.CONNECTION_EVENT_RETRY_MAX_DELAY_MS)}async clearNativeAuthRelay(e){if(await this.canUseTauriIpc())try{await this.invokeIpc("desktop_set_pluto_auth_token",{authToken:null,refreshToken:null}),this.lastSyncedAuthToken=null,this.lastNativeAuthSyncAtMs=0,c(`[NativeIpcBridge] cleared native auth relay (${e})`);}catch(t){console.warn(`[NativeIpcBridge] failed clearing native auth relay (${e}):`,t);}}async relayNativeAuthToken(e,t,i,n){if(!await this.canUseTauriIpc())return true;if(!await this.nativeAuthTokenMatchesExpectedScope(e))return c(`[NativeIpcBridge] auth sync deferred (${i}): token claims do not match configured space`),false;if(e===this.lastSyncedAuthToken)return true;try{await this.invokeIpc("desktop_set_pluto_auth_token",{authToken:e,refreshToken:t??null});}catch(r){return O(r)?console.warn(`[NativeIpcBridge] desktop auth relay unavailable (${i}); install/register openrtc-tauri-plugin and include its default permission set.`,r):console.warn(`[NativeIpcBridge] desktop auth relay failed (${i}):`,r),false}return this.lastSyncedAuthToken=e,this.lastNativeAuthSyncAtMs=Date.now(),c(`[NativeIpcBridge] auth token relayed to native runtime (${i}) user_id=${n??this.currentUser?.id??"unknown"}`),true}async relayExplicitNativeAuthContext(e){let t=this.authSyncInFlight,i=(async()=>(await t?.catch(()=>{}),this.relayNativeAuthToken(e.token,e.refreshToken,"setAuthContext",e.userId)))();this.authSyncInFlight=i;try{return await i}finally{this.authSyncInFlight===i&&(this.authSyncInFlight=null);}}applyNativeRuntimeStatus(e){this.runtimeCapabilities=C(e,this.allowWasmFallback);}syncNativeRuntimeCapabilities(e){return this.ipcBridge?this.nativeRuntimeCapabilitiesSyncInFlight?this.nativeRuntimeCapabilitiesSyncInFlight:(this.nativeRuntimeCapabilitiesSyncInFlight=(async()=>{try{let t=await this.invokeIpc("rtc_native_status",void 0,{timeoutMs:v.NATIVE_STATUS_IPC_TIMEOUT_MS});this.applyNativeRuntimeStatus(t),c(`[NativeIpcBridge] refreshed native runtime capabilities (${e})`);}catch(t){b("[NativeIpcBridge] native runtime capability refresh skipped",t);}})().finally(()=>{this.nativeRuntimeCapabilitiesSyncInFlight=null;}),this.nativeRuntimeCapabilitiesSyncInFlight):Promise.resolve()}async canUseTauriIpc(){if(this.ipcBridge){let e=typeof this.ipcBridge.isAvailable=="function"?!!await this.ipcBridge.isAvailable():true;return e&&this.syncNativeRuntimeCapabilities("ipc-available"),e}return typeof window>"u"?false:this.tauriCoreAvailabilityValue===true?true:this.tauriCoreAvailabilityValue===false&&Date.now()-this.tauriCoreAvailabilityCheckedAtMs<v.TAURI_IPC_NEGATIVE_CACHE_MS?false:(this.tauriCoreAvailability||(this.tauriCoreAvailability=(async()=>{try{if(this.isTauriEnv())return this.tauriCoreAvailabilityValue=!0,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),this.syncNativeRuntimeCapabilities("tauri-env"),!0;try{let e=await this.invokeIpc("rtc_native_status");return this.applyNativeRuntimeStatus(e),c("[NativeIpcBridge] Resolved Tauri IPC via rtc_native_status probe"),this.tauriCoreAvailabilityValue=!0,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),!0}catch(e){let t=String(e?.message??e??"");return t.includes("__TAURI_INTERNALS__")||t.includes("Cannot read properties of undefined")||t.includes("window is not defined")?(this.tauriCoreAvailabilityValue=!1,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),!1):(c("[NativeIpcBridge] Tauri IPC probe reached native layer (command-level error acceptable)"),this.tauriCoreAvailabilityValue=!0,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),!0)}}catch{return this.tauriCoreAvailabilityValue=false,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),false}})().finally(()=>{this.tauriCoreAvailability=null;})),this.tauriCoreAvailability)}async invokeIpc(e,t,i){let n=this.ipcBridge.invoke(e,t),r=i&&Object.prototype.hasOwnProperty.call(i,"timeoutMs")?i.timeoutMs:v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS;return r==null||r<=0?n:E$1(n,r,()=>new Error(`${e} timeout after ${r}ms`))}async listenIpc(e,t){return this.ipcBridge.listen(e,i=>{t({payload:i});})}async openPeerBiViaIpc(e,t,i){let n=await this.invokePeerBiOpen(e,t,i),r=typeof n?.streamId=="string"?n.streamId.trim():typeof n?.stream_id=="string"?n.stream_id.trim():"";if(!r)throw new Error(`${e} returned no streamId`);return this.peerBiStreamFromId(r)}peerBiStreamFromId(e,t={}){let i=this,n=null,r=null,s=false,a=null,u=null,o=async()=>{let h=[n,r];n=null,r=null,await Promise.allSettled(h.filter(f=>typeof f=="function").map(f=>Promise.resolve(f())));},c=(async()=>{n=await this.listenIpc("openrtc://peer-bi-stream/chunk",h=>{let f=h.payload;if((typeof f?.streamId=="string"?f.streamId:typeof f?.stream_id=="string"?f.stream_id:"")!==e||s||!a)return;let w=f?.bytes;w instanceof Uint8Array?a.enqueue(w):Array.isArray(w)&&a.enqueue(new Uint8Array(w));}),r=await this.listenIpc("openrtc://peer-bi-stream/closed",h=>{let f=h.payload;if((typeof f?.streamId=="string"?f.streamId:typeof f?.stream_id=="string"?f.stream_id:"")!==e||s||!a)return;s=true;let w=typeof f?.error=="string"?f.error.trim():"";w?a.error(new Error(w)):a.close(),o();}),t.startReadAfterListeners&&await this.invokeIpc("start_peer_bi_stream_read",{streamId:e},{timeoutMs:null});})().catch(h=>{u=h,a&&!s&&(s=true,a.error(h));}),l=async()=>{await this.invokeIpc("close_peer_bi_stream",{streamId:e},{timeoutMs:null}).catch(()=>{}),await o();},g=new ReadableStream({async start(h){a=h,await c,u&&!s&&(s=true,h.error(u));},async cancel(){s=true,await l();}}),y=new WritableStream({write:async h=>{await i.invokeIpc("write_peer_bi_stream",{streamId:e,bytes:Array.from(h)},{timeoutMs:null});},close:l,abort:l});return {readable:g,writable:y}}async invokePeerBiOpen(e,t,i){try{return await this.invokeIpc(e,t)}catch(n){if(!i?.fallbackCommand||!this.isMissingNativeCommandError(n))throw n;return this.invokeIpc(i.fallbackCommand,i.fallbackArgs??t)}}isMissingNativeCommandError(e){let t=e instanceof Error?e.message:String(e??"");return t.includes("Command")&&t.includes("not found")}async shouldUseTauriSignaling(){if(await this.canUseTauriIpc())return true;if(this.allowWasmFallback)return false;throw new Error("[pluto-rtc] Tauri runtime adapter requires native IPC, but it is unavailable.")}async signInWithPluto(){if(!await this.canUseTauriIpc()){await this.fallback.signInWithPluto();return}let e=await this.invokeIpc("rtc_sign_in_with_pluto"),t=typeof e?.customToken=="string"?e.customToken.trim():"";if(!t)throw new Error("[pluto-rtc] Native Pluto SSO did not return a custom token.");await G().signInWithCustomTokenValue(t),await this.ensureNativeAuth("pluto-sso",{requireToken:true,maxWaitMs:1e4});}async setAuthContext(e){let t=this.getAuthContext()?.userId??null,i=typeof e?.userId=="string"&&e.userId.trim()||null,n=this.fallback.setAuthContext(e);if(t&&i&&t!==i&&await this.stopNativeAuthScopedActivity(t),await n,!e?.token)await this.clearNativeAuthRelay("setAuthContext");else if(!await this.relayExplicitNativeAuthContext(e))throw new Error("Native auth token unavailable for setAuthContext")}async signOut(){await this.fallback.signOut(),await this.clearNativeAuthRelay("signOut");}async stopAuthScopedActivity(e){let t=this.resolveNativeSignalingUserId(e?.userId??null);await this.stopNativeAuthScopedActivity(t);}async stopNativeAuthScopedActivity(e){let t=await this.shouldUseTauriSignaling();if(o("NativeIpcBridge.stopAuthScopedActivity",{userId:e,useTauri:t}),t)try{await Promise.allSettled([this.revokeSessionTokensByScope("user-device"),this.invokeIpc("stop_rtc_presence_loop"),this.invokeIpc("stop_rtc_auto_connect"),e?this.invokeIpc("set_rtc_offline",{userId:e}):Promise.resolve()]);}catch(i){console.warn("[NativeIpcBridge] Failed to stop native auth-scoped RTC activity:",i);}await this.fallback.stopAuthScopedActivity({userId:e});}async ensureNativeAuthOnce(e,t){if(!await this.canUseTauriIpc())return true;if(this.authSyncInFlight)return this.authSyncInFlight;let i=(async()=>{try{if(!this.currentUser)return c(`[NativeIpcBridge] auth sync deferred (${e}): no current user`),!t;let n=Date.now()-this.lastNativeAuthSyncAtMs>=480*1e3,r=this.currentUser?.getToken?await this.currentUser.getToken(n):null,a=this.getAuthContext()?.refreshToken??this.auth?.currentUser?.refreshToken??null;return r?this.relayNativeAuthToken(r,a,e,this.currentUser?.id):(c(`[NativeIpcBridge] auth sync deferred (${e}): missing token for user ${this.currentUser?.id}`),!t)}catch(n){return console.error("[NativeIpcBridge] auth sync failed:",n),false}})();this.authSyncInFlight=i;try{return await i}finally{this.authSyncInFlight===i&&(this.authSyncInFlight=null);}}async ensureNativeAuth(e="runtime",t){if(!await this.canUseTauriIpc())return true;let i=t?.requireToken??false,n=t?.maxWaitMs??(i?v.AUTH_REQUIRED_WAIT_MS:0),r=t?.pollMs??250,s=Date.now()+Math.max(0,n);for(;;){if(await this.ensureNativeAuthOnce(e,i))return true;if(!i||Date.now()>=s)return false;await u(r);}}decodeNativeDeviceIdentity(e){let t=e?.systemInfo??e?.system_info??null,i=typeof e?.deviceId=="string"?e.deviceId.trim():typeof e?.device_id=="string"?e.device_id.trim():"",n=typeof e?.deviceName=="string"?e.deviceName.trim():typeof e?.device_name=="string"?e.device_name.trim():"",r=typeof e?.platformType=="string"?e.platformType.trim():typeof e?.platform_type=="string"?e.platform_type.trim():typeof t?.platformType=="string"?t.platformType.trim():typeof t?.platform_type=="string"?t.platform_type.trim():"";return {deviceId:i,deviceName:n,platformType:r}}async resolveLocalDeviceId(){if(this.cachedLocalDeviceId)return this.cachedLocalDeviceId;if(await this.canUseTauriIpc())try{let t=await this.invokeIpc("get_rtc_local_device_info"),{deviceId:i,deviceName:n}=this.decodeNativeDeviceIdentity(t);if(i)return this.cachedLocalDeviceId=i,n&&(this.cachedLocalDeviceName=n),i}catch(t){console.warn("[NativeIpcBridge] get_rtc_local_device_info failed:",t);}let e=this.resolveWebLogicalDeviceId();return this.cachedLocalDeviceId=e,e}async resolveLocalDeviceName(){if(this.cachedLocalDeviceName)return this.cachedLocalDeviceName;if(await this.canUseTauriIpc())try{let e=await this.invokeIpc("get_rtc_local_device_info"),{deviceName:t}=this.decodeNativeDeviceIdentity(e);if(t){let i=this.normalizeNativeDeviceName(t);return this.cachedLocalDeviceName=i,i}}catch(e){console.warn("[NativeIpcBridge] get_rtc_local_device_info failed:",e);}return this.defaultDeviceNameFallback()}normalizeNativeDeviceName(e){let t=e.trim();if(!t)return this.defaultDeviceNameFallback();if(t==="Desktop Device"){let i=this.defaultDeviceNameFallback();if(i!=="Desktop Device")return i}return t}defaultDeviceNameFallback(){if(typeof window>"u"||typeof navigator>"u")return "Desktop Device";let e=navigator.userAgent||"";return /iPhone|iPad|iPod/i.test(e)?"iPhone":/Android/i.test(e)?"Android":"Desktop Device"}inferNativePlatformTypeFallback(){if(typeof window>"u"||typeof navigator>"u")return "desktop";if(!this.isTauriEnv())return "web";let e=navigator.userAgent||"";return /iPhone|iPad|iPod|Android|Mobile/i.test(e)?"mobile":"desktop"}withPresenceMetadata(e,t){try{let i=e?JSON.parse(e):{};return JSON.stringify({...i,deviceId:t,plutoVersion:"0.1.0-desktop"})}catch{return JSON.stringify({deviceId:t,plutoVersion:"0.1.0-desktop",rawMetadata:e})}}async searchDevices(e){if(await this.shouldUseTauriSignaling()){if(!await this.ensureNativeAuth("searchDevices",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for searchDevices");let i=await this.invokeIpc("search_rtc_devices",{userId:this.getCurrentUserId()});if(Array.isArray(i?.devices)){let n=i.devices.map(r=>this.normalizeDevice(r));return e&&(n=n.filter(r=>r.ticket!==e&&r.deviceId!==e&&r.nodeId!==e)),n}throw typeof i?.message=="string"?new Error(String(i.message)):new Error("Unexpected response for search_rtc_devices")}return this.fallback.searchDevices(e)}async listDevicesWithStatus(){if(await this.shouldUseTauriSignaling()){if(!await this.ensureNativeAuth("listDevicesWithStatus",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for listDevicesWithStatus");let t=await this.invokeIpc("search_rtc_devices_with_status",{userId:this.getCurrentUserId()});if(Array.isArray(t?.devices)){let i=t.devices,n=this.filterNativeRosterByTag(i,"listDevicesWithStatus").map(a=>r(a)),r$1=await this.resolveLocalDeviceId().catch(()=>null),s=!!r$1&&n.some(a=>a.deviceId===r$1);return b("[NativeIpcBridge] listDevicesWithStatus result",{rawCount:i.length,count:n.length,localDeviceId:r$1,selfIncluded:s,devices:n.map(a=>({deviceId:a.deviceId,deviceName:a.deviceName,online:!!a.online,presenceStatus:a.presenceStatus,connectable:a.connectable,connectionStatus:a.connectionStatus,settledReady:!!a.settledReady,peerHealth:a.peerHealth,scopes:a.scopes,connectionId:a.connectionId??null,deviceIdHint:a.deviceIdHint??null,nodeId:a.nodeId??null,activeTransport:a.activeTransport??null,parallelTransport:a.parallelTransport??null}))}),r$1&&!s&&b("[NativeIpcBridge] native status snapshot excludes local device by design",{localDeviceId:r$1,count:n.length}),n}throw typeof t?.message=="string"?new Error(String(t.message)):new Error("Unexpected response for search_rtc_devices_with_status")}return this.fallback.listDevicesWithStatus()}async getPeerSession(e){if(await this.shouldUseTauriSignaling()){let t=await this.invokeIpc("get_rtc_peer_session",{id:e});return !t||typeof t!="object"?null:s(t)}return this.fallback.getPeerSession(e)}async listPeerSessions(){if(await this.shouldUseTauriSignaling()){let e=await this.invokeIpc("list_rtc_peer_sessions");return (Array.isArray(e)?e:[]).map(t=>s(t))}return this.fallback.listPeerSessions()}async waitForSettledPeer(e,t){if(await this.shouldUseTauriSignaling()){let i=typeof t=="number"?Math.max(v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS,t+1e3):v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS,n=await this.invokeIpc("wait_for_rtc_settled_peer",{id:e,timeoutMs:t},{timeoutMs:i});return !n||typeof n!="object"?null:s(n)}return this.fallback.waitForSettledPeer(e,t)}async resolvePeerConnectionRecords(e){if(await this.shouldUseTauriSignaling()){let t=await this.invokeIpc("resolve_rtc_peer_connection_records",{id:e});return (Array.isArray(t)?t:[]).map(i=>t$1(i))}return this.fallback.resolvePeerConnectionRecords(e)}async resolvePeerIdentity(e){if(await this.shouldUseTauriSignaling()){let t=await this.invokeIpc("resolve_rtc_peer_identity",{id:e});return u$1(t)}return this.fallback.resolvePeerIdentity(e)}async setOffline(e){if(await this.shouldUseTauriSignaling())try{if(!await this.ensureNativeAuth("setOffline",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for setOffline");let i=this.getCurrentUserId();await this.invokeIpc("set_rtc_offline",{userId:i});return}catch(t){console.warn("[NativeIpcBridge] set_rtc_offline failed:",t);}return this.fallback.setOffline(e)}async updateDevice(e,t){if(await this.shouldUseTauriSignaling()){if(!await this.ensureNativeAuth("updateDevice",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for updateDevice");let r=this.getCurrentUserId();if(!r)throw new Error("updateDevice requires authenticated user scope");try{await this.invokeIpc("update_rtc_device",{userId:r,deviceId:e,deviceName:t.deviceName??null,capabilities:t.capabilities??null,metadata:t.metadata??null});return}catch(s){throw console.warn("[NativeIpcBridge] update_rtc_device failed:",s),s instanceof Error?s:new Error(String(s))}}return this.fallback.updateDevice(e,t)}async deleteDevice(e){if(await this.shouldUseTauriSignaling()){if(!await this.ensureNativeAuth("deleteDevice",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for deleteDevice");let n=this.getCurrentUserId();if(!n)throw new Error("deleteDevice requires authenticated user scope");try{await this.invokeIpc("delete_rtc_device",{userId:n,deviceId:e});return}catch(r){throw console.warn("[NativeIpcBridge] delete_rtc_device failed:",r),r instanceof Error?r:new Error(String(r))}}return this.fallback.deleteDevice(e)}async getLocalDeviceInfo(){if(!await this.canUseTauriIpc()){let e=await this.getLocalDeviceId?.();return e?{deviceId:e,deviceName:this.defaultDeviceNameFallback(),platformType:this.inferNativePlatformTypeFallback()}:null}try{let e=await this.invokeIpc("get_rtc_local_device_info"),t=this.decodeNativeDeviceIdentity(e),{deviceId:i}=t;return i?{deviceId:i,deviceName:this.normalizeNativeDeviceName(t.deviceName),platformType:t.platformType||this.inferNativePlatformTypeFallback(),capabilities:e?.capabilities??void 0,lastSeenAt:typeof e?.last_seen_at=="string"?e.last_seen_at:void 0}:null}catch(e){return console.warn("[NativeIpcBridge] getLocalDeviceInfo failed:",e),null}}async updateLocalDeviceName(e){if(!await this.canUseTauriIpc())return null;try{let t=await this.invokeIpc("update_rtc_local_device_name",{deviceName:e}),i=this.decodeNativeDeviceIdentity(t),{deviceId:n}=i;return n?(this.cachedLocalDeviceName=this.normalizeNativeDeviceName(e),{deviceId:n,deviceName:this.cachedLocalDeviceName,platformType:i.platformType||this.inferNativePlatformTypeFallback(),capabilities:t?.capabilities??void 0,lastSeenAt:typeof t?.last_seen_at=="string"?t.last_seen_at:void 0}):null}catch(t){return console.warn("[NativeIpcBridge] updateLocalDeviceName failed:",t),null}}async startManagedSessionNative(e){if(!await this.shouldUseTauriSignaling())throw new Error("[pluto-rtc] Native IPC unavailable for startManagedSessionNative().");if(!await this.ensureNativeAuth("startManagedSessionNative",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for startManagedSessionNative");let i=this.resolveNativeSignalingUserId(e.userId);if(!i)throw new Error("Native managed session startup requires a runtime auth-scoped user id.");i!==e.userId&&console.info("[NativeIpcBridge][managed-session][user-id-remap]",{requestedUserId:e.userId,runtimeUserId:this.currentUser?.id??this.getAuthContext()?.userId??null,effectiveUserId:i});let n=this.resolveConfiguredSpaceKey();console.info("[NativeIpcBridge][managed-session][start-request]",{requestedUserId:e.userId,runtimeUserId:this.currentUser?.id??this.getAuthContext()?.userId??null,effectiveUserId:i,spaceKey:n?"[configured]":null,deviceName:e.deviceName??null,localDeviceId:e.localDeviceId??null,presence:e.presence!==false,autoConnect:e.autoConnect!==false,hasMetadata:typeof e.metadata=="string"&&e.metadata.trim().length>0});let r=await this.buildNativeTransportConfigPayload(),s={userId:i,deviceName:e.deviceName??null,localDeviceId:e.localDeviceId??null,metadata:e.metadata??null,...r?{transports:r}:{},autoConnect:e.autoConnect!==false,presence:e.presence!==false,apiKey:this.options.apiKey??null,spaceKey:n||null},a=await this.invokeIpc("start_rtc_managed_session",s,{timeoutMs:null});this.syncNativeRuntimeCapabilities("managed-session-started");let u=typeof a?.ticket=="string"&&a.ticket.trim().length>0?a.ticket.trim():null,o=a?.localDevice&&typeof a.localDevice=="object"?a.localDevice:a?.local_device&&typeof a.local_device=="object"?a.local_device:null,c=o?{deviceId:typeof o.deviceId=="string"?o.deviceId:typeof o.device_id=="string"?o.device_id:"",deviceName:this.normalizeNativeDeviceName(typeof o.deviceName=="string"?o.deviceName:typeof o.device_name=="string"?o.device_name:""),platformType:typeof o.platformType=="string"?o.platformType:typeof o.platform_type=="string"?o.platform_type:"desktop",capabilities:o.capabilities??void 0,lastSeenAt:typeof o.lastSeenAt=="string"?o.lastSeenAt:typeof o.last_seen_at=="string"?o.last_seen_at:void 0}:null,l={localNodeId:typeof a?.localNodeId=="string"?a.localNodeId:typeof a?.local_node_id=="string"?a.local_node_id:null,ticket:u,ticketScope:typeof a?.ticketScope=="string"?a.ticketScope:typeof a?.ticket_scope=="string"?a.ticket_scope:null,presenceStarted:typeof a?.presenceStarted=="boolean"?a.presenceStarted:!!a?.presence_started,autoConnectStarted:typeof a?.autoConnectStarted=="boolean"?a.autoConnectStarted:!!a?.auto_connect_started,localDevice:c?.deviceId?c:null};return console.info("[NativeIpcBridge][managed-session][ipc-started]",{requestedUserId:e.userId,runtimeUserId:this.currentUser?.id??this.getAuthContext()?.userId??null,effectiveUserId:i,localNodeId:l.localNodeId,ticketScope:l.ticketScope,presenceStarted:l.presenceStarted,autoConnectStarted:l.autoConnectStarted,localDeviceId:l.localDevice?.deviceId??null}),l}async reconcileNativeManagedSession(e){if(!await this.shouldUseTauriSignaling())return null;if(!await this.ensureNativeAuth("reconcileNativeManagedSession",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for reconcileNativeManagedSession");return this.invokeIpc("reconcile_mobile_rtc_after_resume",{reason:e?.reason??"frontend"})}async notifyNetworkChange(e){return await this.canUseTauriIpc()?(c("[NativeIpcBridge] forwarding host network-change hint",{reason:e?.reason??"host"}),this.invokeIpc("notify_rtc_network_change")):null}async getManagedNodeId(e){let t=e?.initializeIfMissing??true;console.info("[NativeIpcBridge][getManagedNodeId] enter",{initializeIfMissing:t});let i=await this.canUseTauriIpc();if(console.info("[NativeIpcBridge][getManagedNodeId] canUseTauriIpc",{canUse:i}),!i)return null;try{console.info("[NativeIpcBridge][getManagedNodeId] invoking get_iroh_node_id");let n=await this.invokeIpc("get_iroh_node_id");if(console.info("[NativeIpcBridge][getManagedNodeId] get_iroh_node_id returned",{existing:n}),n||!t)return n;console.info("[NativeIpcBridge][getManagedNodeId] invoking start_iroh_node");let r=await this.invokeIpc("start_iroh_node");return console.info("[NativeIpcBridge][getManagedNodeId] start_iroh_node returned",{started:r}),r}catch(n){if(console.warn("[NativeIpcBridge] getManagedNodeId failed:",n),!t)return null;throw n}}async getEndpointTicket(){if(!await this.canUseTauriIpc())throw new Error("[pluto-rtc] getEndpointTicket requires native IPC in Tauri runtime.");return q(()=>this.invokeIpc("get_iroh_endpoint_ticket"))}async connectToDevice(e){if(!await this.canUseTauriIpc())throw new Error("[pluto-rtc] connectToDevice requires native IPC in Tauri runtime.");this.options.authMode!=="anonymous"?await this.ensureNativeAuth("connectToDevice",{requireToken:true,maxWaitMs:v.AUTH_REQUIRED_WAIT_MS}):c("[NativeIpcBridge] connectToDevice using anonymous native ticket path");let t=Math.max(1,Math.floor(e.timeoutMs??v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS));return this.invokeIpc("connect_to_device",{deviceId:e.deviceId??null,endpointTicket:e.endpointTicket,timeoutMs:t},{timeoutMs:t+1e3})}async registerSessionToken(e,t,i){await this.canUseTauriIpc()&&await this.invokeIpc("register_session_token",{token:e,scope:t,maxConnections:i});}async getEndpointTicketWithToken(e,t){if(!await this.canUseTauriIpc())return null;try{return await q(()=>this.invokeIpc("get_endpoint_ticket_with_token",{scope:e,maxConnections:t}))}catch{return null}}async validateSessionToken(e,t){if(!await this.canUseTauriIpc())return null;try{return await this.invokeIpc("validate_session_token",{token:e,connectionId:t??null})}catch{return null}}async revokeSessionTokensByScope(e){if(o("NativeIpcBridge.revokeSessionTokensByScope",{grantScope:e}),!await this.canUseTauriIpc())return [];try{return await this.invokeIpc("revoke_session_tokens_by_scope",{scope:e})}catch{return []}}async disconnectDevice(e){if(!await this.canUseTauriIpc())throw new Error("[pluto-rtc] disconnectDevice requires native IPC in Tauri runtime.");await this.invokeIpc("disconnect_device",{deviceId:e});}async setAutoConnectExcluded(e,t){await this.canUseTauriIpc()&&await this.invokeIpc("set_auto_connect_excluded",{deviceId:e,excluded:t});}onDevicesChange(e,t){let i=false,n=new Map,r=null,s=false,a=false,u$1=()=>{if(a=false,i)return;let g=Array.from(n.values());t&&(g=g.filter(y=>y.ticket!==t&&y.deviceId!==t&&y.nodeId!==t)),e(g);},o=()=>{if(!a){if(a=true,typeof queueMicrotask=="function"){queueMicrotask(u$1);return}Promise.resolve().then(u$1);}},c$1=async()=>{if(!await this.shouldUseTauriSignaling()){console.warn("[NativeIpcBridge] onDevicesChange falling back to wasm signaling (Tauri IPC unavailable)"),l=this.fallback.onDevicesChange(e,t);return}for(;!i;)try{let g=this.requiresNativeAuthToken()?15e3:0,y=Date.now()+g,h=this.getCurrentUserId();for(;!i&&!h&&Date.now()<y&&(this.hasLoggedMissingAuthForDevices||(this.hasLoggedMissingAuthForDevices=!0,c("[NativeIpcBridge] onDevicesChange waiting for authenticated user before subscription")),h=this.getCurrentUserId(),!h);)await u(250);if(!h){!i&&!s&&(console.warn("[NativeIpcBridge] onDevicesChange could not resolve authenticated user; keeping subscription in retry mode"),e([]),s=!0),await u(1e3);continue}if(!await this.ensureNativeAuth("onDevicesChange",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:Math.max(0,y-Date.now())})){!i&&!s&&(console.warn("[NativeIpcBridge] onDevicesChange timed out waiting for auth token; keeping subscription in retry mode"),e([]),s=!0),await u(1e3);continue}this.hasLoggedMissingAuthForDevices=!1,s=!1,c(`[NativeIpcBridge] onDevicesChange starting subscription user_id=${h}`);let k=await this.listDevicesWithStatus().catch(async m=>(c(`[NativeIpcBridge] onDevicesChange full-roster seed failed; falling back to online-only search: ${m}`),this.searchDevices(t)));n.clear();for(let m of k)m?.deviceId&&n.set(m.deviceId,m);for(o(),r=(await this.subscribeDevices(h)).getReader();!i;){let{done:m,value:L}=await r.read();if(m||!L)break;for(let N of L){if(N.type==="removed"){n.delete(N.deviceId);continue}let M=N.device?.deviceId,R=this.nativeRosterTagDisposition(N.device??{});if(!R.keep){R.foreignTag&&c("[NativeIpcBridge] onDevicesChange dropped foreign-app device event",{sdkAppTag:this.appTag,foreignTag:R.foreignTag,deviceId:M??null}),M&&n.delete(M);continue}let E=this.normalizeDevice(N.device);E.deviceId&&n.set(E.deviceId,E);}o();}}catch(g){i||(console.error("[NativeIpcBridge] onDevicesChange stream failed; retrying subscription:",g),await u(1e3));}finally{if(r){try{await r.cancel();}catch{}r=null;}}},l=()=>{i=true,r&&(r.cancel(),r=null);};return c$1(),()=>l()}async subscribeDevices(e){if(await this.shouldUseTauriSignaling()){if(!await this.ensureNativeAuth("subscribeDevices",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for subscribeDevices");let i=`sub-${Math.random().toString(36).substring(2,11)}`,n=null,r=null,s=false,a=async()=>{if(!s&&(s=true,n&&(await Promise.resolve(n()),n=null),r)){try{await r();}catch{}r=null;}};return new ReadableStream({start:async u=>{c(`[NativeIpcBridge] subscribeDevices request start user_id=${e} request_id=${i}`),n=await this.listenIpc("rtc-device-events",o=>{if(s)return;let c=o.payload;if(c.requestId===i){if(c.type==="deviceEvents"){let l=Array.isArray(c.events)?c.events.length:0;b(`[NativeIpcBridge] subscribeDevices event batch request_id=${i} count=${l}`);try{u.enqueue(c.events);}catch{a();}}else if(c.type==="error"&&(console.warn(`[NativeIpcBridge] subscribeDevices stream error request_id=${i}: ${c.message}`),!s)){try{u.error(c.message);}catch{}a();}}}),r=async()=>{await this.invokeIpc("stop_rtc_subscription",{requestId:i});};try{await this.invokeIpc("start_rtc_device_subscription",{requestId:i,userId:e});}catch(o){try{u.error(o);}catch{}await a();}},cancel:async()=>{c(`[NativeIpcBridge] subscribeDevices request stop request_id=${i}`),await a();}})}return this.fallback.subscribeDevices(e)}async subscribeSessions(e){if(await this.shouldUseTauriSignaling()){if(!await this.ensureNativeAuth("subscribeSessions",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for subscribeSessions");let i=`sub-${Math.random().toString(36).substring(2,11)}`,n=await this.resolveLocalDeviceId()||e,r=null,s=null,a=false,u=async()=>{if(!a&&(a=true,r&&(await Promise.resolve(r()),r=null),s)){try{await s();}catch{}s=null;}};return new ReadableStream({start:async o=>{r=await this.listenIpc("rtc-session-events",c=>{if(a)return;let l=c.payload;if(l.requestId===i){if(l.type==="sessionEvents")try{o.enqueue(l.events);}catch{u();}else if(l.type==="error"&&!a){try{o.error(l.message);}catch{}u();}}}),s=async()=>{await this.invokeIpc("stop_rtc_subscription",{requestId:i});};try{await this.invokeIpc("start_rtc_session_subscription",{requestId:i,localDeviceId:n});}catch(c){try{o.error(c);}catch{}await u();}},cancel:async()=>{await u();}})}return this.fallback.subscribeSessions(e)}async getLocalDeviceId(){return this.resolveLocalDeviceId()}async updatePresence(e,t,i=true,n=3e5,r){if(await this.shouldUseTauriSignaling())try{if(!await this.ensureNativeAuth("updatePresence",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for updatePresence");let a=this.resolveNativeSignalingUserId(),u=await this.resolveLocalDeviceId(),o=await this.resolveLocalDeviceName();await this.invokeIpc("update_rtc_presence",{userId:a,deviceName:o,ticket:t,metadata:this.withPresenceMetadata(r,u)});return}catch(s){console.warn("[NativeIpcBridge] update_rtc_presence failed:",s);}return this.fallback.updatePresence(e,t,i,n,r)}startAutoConnect(e,t){(async()=>{try{if(!await this.shouldUseTauriSignaling()){console.error("[NativeIpcBridge] startAutoConnect requires native Rust signaling; IPC unavailable");return}let i=await this.resolveLocalDeviceId()||t;await this.startAutoConnectOnce(e,i);}catch(i){console.warn("[NativeIpcBridge] startAutoConnect failed:",i);}})();}forceReconnectSnapshot(){(async()=>{if(!await this.shouldUseTauriSignaling()){console.error("[NativeIpcBridge] forceReconnectSnapshot requires native Rust signaling; IPC unavailable");return}try{await this.invokeIpc("force_rtc_reconnect_snapshot");}catch(e){console.warn("[NativeIpcBridge] force_rtc_reconnect_snapshot failed:",e);}})();}startPresenceLoop(e,t,i,n,r){(async()=>{try{if(!await this.shouldUseTauriSignaling()){console.warn("[NativeIpcBridge] startPresenceLoop falling back to wasm signaling (Tauri IPC unavailable)"),this.fallback.startPresenceLoop(e,t,i,n,r);return}let s=await this.resolveLocalDeviceId(),a=this.shouldUseResolvedDeviceName(i)?await this.resolveLocalDeviceName():i.trim(),u=this.withPresenceMetadata(r,s);await this.startPresenceLoopOnce(e,t,a,n,u);}catch(s){console.warn("[NativeIpcBridge] startPresenceLoop failed:",s);}})();}async startAutoConnectOnce(e,t){if(!await this.shouldUseTauriSignaling())throw new Error("[pluto-rtc] Native IPC unavailable for startAutoConnectOnce().");if(!await this.ensureNativeAuth("startAutoConnect",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for startAutoConnect");let n=this.resolveNativeSignalingUserId(e);if(!n)throw new Error("Native auto-connect requires a runtime auth-scoped user id.");await this.invokeIpc("start_rtc_auto_connect",{userId:n,localDeviceId:t});}async startPresenceLoopOnce(e,t,i,n,r){if(!await this.shouldUseTauriSignaling())throw new Error("[pluto-rtc] Native IPC unavailable for startPresenceLoopOnce().");if(console.info("[NativeIpcBridge][presence][start-request]",{userId:e,localNodeId:t,deviceName:i,hasMetadata:typeof r=="string"&&r.trim().length>0,hasCompoundTicket:typeof n=="string"&&n.includes(".")}),!await this.ensureNativeAuth("startPresenceLoop",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for startPresenceLoop");let a=this.resolveNativeSignalingUserId(e);if(!a)throw new Error("Native presence loop requires a runtime auth-scoped user id.");console.info("[NativeIpcBridge][presence][auth-ready]",{requestedUserId:e,runtimeUserId:this.currentUser?.id??this.getAuthContext()?.userId??null,effectiveUserId:a,localNodeId:t}),await this.invokeIpc("start_rtc_presence_loop",{userId:a,localNodeId:t,deviceName:i,ticket:n,metadata:r,apiKey:this.options.apiKey??null,spaceKey:this.resolveConfiguredSpaceKey()||null}),console.info("[NativeIpcBridge][presence][ipc-started]",{requestedUserId:e,effectiveUserId:a,localNodeId:t,deviceName:i});}shouldUseResolvedDeviceName(e){let t=e.trim();return t.length===0||t==="Unknown Device"||t==="Desktop Device"}async sendExplicitFilePath(e,t,i=""){if(c("[NativeIpcBridge] sendExplicitFilePath start",{connectionId:e,filePath:t,transferId:i||null,authMode:this.options.authMode}),await this.canUseTauriIpc()){this.options.authMode!=="anonymous"?await this.ensureNativeAuth("sendExplicitFilePath"):c("[NativeIpcBridge] sendExplicitFilePath using anonymous native path");let n=await this.invokeIpc("send_file",{connectionId:e,filePath:t,transferId:i});return c("[NativeIpcBridge] sendExplicitFilePath completed",{connectionId:e,transferId:i||null,result:n}),n}return this.fallback.sendExplicitFilePath(e,t,i)}async sendExplicitFileData(e){c("[NativeIpcBridge] sendExplicitFileData start",{connectionId:e.connectionId??null,connectionRemoteNodeId:e.connection?.remoteNodeId??null,remoteNodeId:e.remoteNodeId??null,transferId:e.transferId??null,fileName:e.file.name,fileSize:e.file.size,authMode:this.options.authMode});let t=e.applicationCrypto??this.options.applicationCrypto;if(await this.canUseTauriIpc()){this.options.authMode!=="anonymous"?await this.ensureNativeAuth("sendExplicitFileData"):c("[NativeIpcBridge] sendExplicitFileData using anonymous native path");let i=e.connectionId||e.connection?.deviceId||e.connection?.remoteNodeId||e.remoteNodeId||"";if(!i)throw new Error("sendExplicitFileData requires a settled peer identifier in native runtime");let n=new Uint8Array(await e.file.arrayBuffer());await this.invokeIpc("send_file_data",{connectionId:i,filename:e.file.name,data:Array.from(n),transferId:e.transferId}),c("[NativeIpcBridge] sendExplicitFileData completed",{connectionId:i,transferId:e.transferId??null,fileName:e.file.name,fileSize:e.file.size});return}return this.fallback.sendExplicitFileData({...e,applicationCrypto:t})}async getConnectionStates(){if(await this.canUseTauriIpc())try{this.options.authMode!=="anonymous"&&await this.ensureNativeAuth("getConnectionStates");let e=await this.invokeIpc("list_rtc_connection_states");return (Array.isArray(e)?e:[]).map(t=>v$1(t)).filter(t=>!!t)}catch(e){return O(e)?c("[NativeIpcBridge] native connection-state replay unavailable; continuing without replay. Install/register openrtc-tauri-plugin default permissions to enable it."):console.warn("[NativeIpcBridge] Failed to fetch native connection states:",e),[]}return []}async getConnectionState(e){let t=e.trim();if(!t||!await this.canUseTauriIpc())return null;try{return this.options.authMode!=="anonymous"&&await this.ensureNativeAuth("getConnectionState"),v$1(await this.invokeIpc("get_rtc_connection_state",{connectionId:t}))}catch(i){return console.warn("[NativeIpcBridge] Failed to fetch native connection state:",{connectionId:t,error:i}),null}}async onConnectionStateChange(e){let t=false,i=null,n=new Map,r=Date.now(),s=0,a=()=>{let c=i;c&&Promise.resolve(c());},u$1=async()=>{try{let c=await this.getConnectionStates();c.length>0&&(b("[NativeIpcBridge] replaying current native connection states",c.map(l=>({connectionId:l.connectionId,deviceId:l.deviceId??null,deviceIdHint:l.deviceIdHint??null,remoteNodeId:l.remoteNodeId??null,state:l.state,transportState:l.transportState??null,protocolState:l.protocolState??null,routable:l.routable??null}))),c.forEach(l=>e(l)));}catch(c){console.warn("[NativeIpcBridge] Failed to replay native connection states after event subscription:",c);}},o=async c=>{let l=(n.get(c)??0)+1;n.set(c,l);let g=await this.getConnectionState(c);if(!g||t||n.get(c)!==l)return;if(["closed","failed","disconnected"].includes(String(g.state??"").trim().toLowerCase())){if(await u(v.CONNECTION_TERMINAL_CONFIRMATION_MS),t||n.get(c)!==l)return;g=await this.getConnectionState(c)??g;}!t&&n.get(c)===l&&e(g);};for(;!t&&Date.now()-r<=v.CONNECTION_EVENT_SUBSCRIBE_WINDOW_MS;){if(s+=1,!await this.canUseTauriIpc()){await u(this.nextConnectionEventRetryDelayMs(s));continue}return i=await this.listenIpc("connection-state-changed",c=>{let l=v$1(c?.payload);l&&(b("[NativeIpcBridge] connection-state-changed trigger",{connectionId:l.connectionId}),o(l.connectionId));}),await u$1(),()=>{t=true,a();}}return ()=>{t=true,a();}}async onIncomingNativeMessage(e){if(!await this.canUseTauriIpc())return ()=>{};let t=await this.listenIpc("iroh://message",i=>{if(i?.payload?.data&&i.payload.streamId==="main")try{let n=new Uint8Array(i.payload.data);if(n.length<2||n[0]!==0)return;let s=n.slice(1),a=new TextDecoder().decode(s),u=JSON.parse(a);e(i.payload.connectionId,i.payload.remoteNodeId??null,u);}catch{}});return typeof t=="function"?t:()=>{}}async getTransferHistory(e=50){return await this.canUseTauriIpc()?this.invokeIpc("get_transfer_history",{limit:e}):[]}async deleteTransferJob(e){await this.canUseTauriIpc()&&await this.invokeIpc("delete_transfer_job",{jobId:e});}};v.AUTH_REQUIRED_WAIT_MS=w.nativeIpc.authRequiredWaitMs,v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS=w.nativeIpc.defaultBoundedCommandTimeoutMs,v.CONNECTION_EVENT_SUBSCRIBE_WINDOW_MS=w.nativeIpc.connectionEventSubscribeWindowMs,v.CONNECTION_EVENT_RETRY_MIN_DELAY_MS=w.nativeIpc.connectionEventRetryMinDelayMs,v.CONNECTION_EVENT_RETRY_MAX_DELAY_MS=w.nativeIpc.connectionEventRetryMaxDelayMs,v.CONNECTION_TERMINAL_CONFIRMATION_MS=1500,v.TAURI_IPC_NEGATIVE_CACHE_MS=w.nativeIpc.tauriIpcNegativeCacheMs,v.NATIVE_STATUS_IPC_TIMEOUT_MS=2500;var D=v;var te=class extends F{constructor(e){let t=T(e.bridge,"IpcRuntimeAdapter");super(new D({...e,ipcBridge:t,allowWasmFallback:e.allowWasmFallback??false}));}};
|
|
2
|
-
export{Z as a,X as b,ee as c,q as d,ie as e,O as f,Q as g,te as h};
|