openrtc 2.9.3 → 2.9.4
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/README.md +21 -0
- package/dist/{Connection-BU8g28lx.d.ts → Connection-gaN-X7kf.d.ts} +14 -1
- package/dist/{DelegatingRuntimeAdapter-DLrTF5Nr.d.ts → DelegatingRuntimeAdapter-Bh0rLvly.d.ts} +5 -3
- package/dist/{IpcRuntimeAdapter-BVTYrfIe.d.ts → IpcRuntimeAdapter-DZj7Rn-o.d.ts} +6 -2
- package/dist/NativeProjectionBroker-VFPBNUGH.js +1 -0
- package/dist/WasmBridge-42DIXTE6.js +1 -0
- package/dist/{assembly-CJjfcYrA.d.ts → assembly-DX6MlDlZ.d.ts} +12 -2
- package/dist/{capabilities-BOyxv_kT.d.ts → capabilities-wJO8ZWyF.d.ts} +1 -1
- package/dist/{chunk-ONV44QWS.js → chunk-2QE5HAPB.js} +1 -1
- package/dist/chunk-AZHDR5G7.js +2 -0
- package/dist/{chunk-XK2JESZY.js → chunk-DMCUS3TY.js} +1 -1
- package/dist/{chunk-3PDMPSVP.js → chunk-DZR5WWVW.js} +1 -1
- package/dist/chunk-F5ORG763.js +1 -0
- package/dist/{chunk-2MQS2BNY.js → chunk-FXVEX4SB.js} +1 -1
- package/dist/chunk-IJXTRVQS.js +2 -0
- package/dist/{chunk-CNAW5BZ3.js → chunk-L2ZZXECX.js} +1 -1
- package/dist/chunk-LJBVXWWV.js +1 -0
- package/dist/{chunk-5VCDW5BC.js → chunk-QO5WF4IG.js} +1 -1
- package/dist/chunk-TRUMV4SI.js +1 -0
- package/dist/chunk-US64VGDU.js +1 -0
- package/dist/controlPlane-U6XREYI4.js +1 -0
- package/dist/coreClient.d.ts +5 -3
- package/dist/coreClient.js +1 -1
- package/dist/{deviceEnrollment-ZRMFBH5R.js → deviceEnrollment-3AOGMX7C.js} +1 -1
- package/dist/{deviceHandle-OAF6XJPY.js → deviceHandle-2DLEXKFM.js} +1 -1
- package/dist/external-broadcast.d.ts +4 -4
- package/dist/external-broadcast.js +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.js +1 -1
- package/dist/ipcFactory-7DTAMYUQ.js +1 -0
- package/dist/native.d.ts +5 -5
- package/dist/native.js +1 -1
- package/dist/node.d.ts +6 -6
- package/dist/node.js +2 -2
- package/dist/openrtc-4UMTYB7M.js +2 -0
- package/dist/openrtc_bg.wasm +0 -0
- package/dist/{room-52G6ONQZ.js → room-5FG5L44X.js} +1 -1
- package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -3
- package/dist/runtime/WasmRuntimeAdapter.js +1 -1
- package/dist/runtime/device-status.d.ts +1 -1
- package/dist/runtime/factories.d.ts +9 -7
- package/dist/runtime/factories.js +1 -1
- package/dist/runtime/index.d.ts +11 -9
- package/dist/runtime/index.js +1 -1
- package/dist/server-browser.d.ts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +1 -1
- package/dist/service-node.d.ts +4 -4
- package/dist/service-node.js +1 -1
- package/dist/testing/native.d.ts +4 -4
- package/dist/testing/native.js +1 -1
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +1 -1
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-ldAq2oqi.d.ts → types-CzogmfJl.d.ts} +1 -1
- package/native/darwin-arm64/openrtc-node-host +0 -0
- package/native/darwin-arm64/openrtc-node-host.manifest.json +4 -4
- package/native/darwin-x64/openrtc-node-host +0 -0
- package/native/darwin-x64/openrtc-node-host.manifest.json +4 -4
- package/native/linux-x64/openrtc-node-host +0 -0
- package/native/linux-x64/openrtc-node-host.manifest.json +4 -4
- package/package.json +1 -1
- package/dist/NativeProjectionBroker-2OH2SCPF.js +0 -1
- package/dist/WasmBridge-EWVV4DFE.js +0 -1
- package/dist/chunk-3B4IDT2M.js +0 -1
- package/dist/chunk-7KWWA3M6.js +0 -2
- package/dist/chunk-KXXQNKRK.js +0 -1
- package/dist/chunk-PEDATFS2.js +0 -2
- package/dist/chunk-PNPW22EQ.js +0 -1
- package/dist/chunk-RT7YTAXU.js +0 -1
- package/dist/controlPlane-HPGXZDDD.js +0 -1
- package/dist/ipcFactory-WNHLLXCB.js +0 -1
- package/dist/openrtc-SP4ISKSK.js +0 -2
package/README.md
CHANGED
|
@@ -271,3 +271,24 @@ mesh limit require
|
|
|
271
271
|
the explicitly enabled, content-blind managed path. `advancedFanout: true` is a
|
|
272
272
|
one-release alias for fixed sparse latest-state delivery. `state()` remains
|
|
273
273
|
unavailable in sparse rooms; use a named channel with application revisions.
|
|
274
|
+
|
|
275
|
+
### Passive connection metrics
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
const stop = ticket.diagnostics.watchConnectionMetrics((connections) => {
|
|
279
|
+
for (const connection of connections) {
|
|
280
|
+
console.log(connection.latencyMs, connection.activeTransport, connection.carrier);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
// Stop observing when the view closes. Ticket peers remain SDK-owned.
|
|
284
|
+
stop();
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
OpenRTC automatically samples local Rust/WASM connection diagnostics every two
|
|
288
|
+
seconds while observed. All observers of a runtime share one sampler. It sends
|
|
289
|
+
no pings and makes no coordination requests. Ticket observers see only that
|
|
290
|
+
ticket's scope. Iroh supplies passive selected-path RTT and the observed carrier
|
|
291
|
+
or path (`webrtc`, `moq`, `iroh-quic`, `iroh-lan`, `iroh-relay`, or `ble`).
|
|
292
|
+
A missing, unadmitted, replaced, or retired path has null measurements. Samples
|
|
293
|
+
carry the existing transport stable ID, transport/route generations, and
|
|
294
|
+
`metricsSampledAtMs`. These read-only diagnostics do not determine readiness.
|
|
@@ -305,6 +305,14 @@ interface ManagedSession {
|
|
|
305
305
|
device: DeviceProfile;
|
|
306
306
|
stop: () => Promise<void>;
|
|
307
307
|
}
|
|
308
|
+
/** Immutable ticket-owner readiness for this exact physical route. No credential material. */
|
|
309
|
+
type TicketMeshPeerReadiness = {
|
|
310
|
+
peerId: string;
|
|
311
|
+
activeConnectionId: string | null;
|
|
312
|
+
activeTransportStableId: number | null;
|
|
313
|
+
transportGeneration: number;
|
|
314
|
+
routeGeneration: number;
|
|
315
|
+
};
|
|
308
316
|
|
|
309
317
|
/** Public protocol identifiers; provider prices and safety ceilings stay private. */
|
|
310
318
|
declare const SERVICE_ERROR_CODES: {
|
|
@@ -863,6 +871,11 @@ interface BackendConnectionState {
|
|
|
863
871
|
transportGeneration?: number;
|
|
864
872
|
routeGeneration?: number;
|
|
865
873
|
transportStableId?: number | null;
|
|
874
|
+
/** Passive selected-path RTT; null if unavailable or this generation is not admitted. */
|
|
875
|
+
latencyMs?: number | null;
|
|
876
|
+
/** Observed Iroh path/carrier; never a second public connection. */
|
|
877
|
+
carrier?: ProtocolName | null;
|
|
878
|
+
metricsSampledAtMs?: number | null;
|
|
866
879
|
replacementInProgress?: boolean;
|
|
867
880
|
lastTransitionAtMs?: number;
|
|
868
881
|
transitionCount?: number;
|
|
@@ -1661,4 +1674,4 @@ declare class Connection {
|
|
|
1661
1674
|
private close;
|
|
1662
1675
|
}
|
|
1663
1676
|
|
|
1664
|
-
export { type SignalingEnvelope as $, type DeviceProfile as A, type RawConnection as B, type ChannelDescriptor$1 as C, type DeviceStatus as D, type EffectiveRoomArchitecture as E, type RuntimeRoomMember as F, type GrantScope as G, type AuthContext as H, type IncomingStream as I, type JoinRoomOptions$1 as J, type RuntimeClientOptions as K, type LocalDeviceInfo$1 as L, type ManagedOptions as M, type DiscoveryMode as N, type AuthMode as O, type PlutoIrohConfiguration as P, type SignalingMode as Q, type RoomArchitectureMode as R, type ServiceErrorObservation as S, type ClientOptions as T, type ExplicitFileDataSendParams as U, type ISignalingBackend as V, type RuntimeIdentity as W, type RoomMember as X, type Device as Y, type DeviceStatusSnapshot as Z, type ManagedConnectionRecord as _, type RoomArchitectureReason as a, type
|
|
1677
|
+
export { type SignalingEnvelope as $, type DeviceProfile as A, type RawConnection as B, type ChannelDescriptor$1 as C, type DeviceStatus as D, type EffectiveRoomArchitecture as E, type RuntimeRoomMember as F, type GrantScope as G, type AuthContext as H, type IncomingStream as I, type JoinRoomOptions$1 as J, type RuntimeClientOptions as K, type LocalDeviceInfo$1 as L, type ManagedOptions as M, type DiscoveryMode as N, type AuthMode as O, type PlutoIrohConfiguration as P, type SignalingMode as Q, type RoomArchitectureMode as R, type ServiceErrorObservation as S, type ClientOptions as T, type ExplicitFileDataSendParams as U, type ISignalingBackend as V, type RuntimeIdentity as W, type RoomMember as X, type Device as Y, type DeviceStatusSnapshot as Z, type ManagedConnectionRecord as _, type RoomArchitectureReason as a, type PresencePolicy as a$, type DeviceEvent as a0, type DesiredPeerProjection as a1, type SignalingSession as a2, type SessionEvent as a3, type LocalDeviceInfo as a4, type NativeManagedSessionStartResult as a5, type TicketMeshPeerReadiness as a6, type BackendPeerBiStream as a7, type BackendPeerUniStream as a8, type PortableMediaPublish as a9, type RuntimeSession as aA, type AppLimits as aB, type ConnectionTarget as aC, type PresenceLoopOptions as aD, type SignalingOptions as aE, type JoinRoomOptions as aF, type ChannelMetadata as aG, type RoomCreationMode as aH, type ProtocolCapabilityMap as aI, type ScanningLoopOptions as aJ, type ScanningLoopHandle as aK, type RuntimeBootstrapOptions as aL, type RuntimeBootstrapResult as aM, type ApplicationPayloadReadinessOptions as aN, type ManagedApplicationRouteOptions as aO, type PeerState as aP, type PeerScope as aQ, type PeerHealth as aR, type ChannelDescriptor as aS, type JoinRequest as aT, type AutoConnectPolicy as aU, type ChannelFraming as aV, type ConnectionStatus as aW, type DevicePresence as aX, type PayloadRouteOptions as aY, type PeerLifecycleStatus$1 as aZ, type PeerSessionSnapshot$1 as a_, type PortableMediaPublicationStart as aa, type PortableMediaSample as ab, type PortableMediaChunk as ac, type PortableMediaControl as ad, type NativeConnectParams as ae, type NativeConnectResult as af, type BackendConnectionState as ag, type NativePeerDataEvent as ah, type ServiceErrorMetadata as ai, type CoordinationGatewayGrantRequest as aj, type CoordinationGatewayGrant as ak, type BrowserWasmRuntimeModule as al, type BrowserProtocolStore as am, type NamespaceDescriptor as an, type IrohMutationReceipt as ao, type IrohDocEntry as ap, type CoordinationSignalingStore as aq, type ManagedRoomMessage as ar, type CoreClientBridgeHost as as, type RouteDescriptor as at, type PayloadCrypto as au, type CryptoStreams as av, type CryptoBiStream as aw, type RouteFamily as ax, type RouteKind as ay, type RuntimeAuthIdentity as az, type RoomArchitectureSnapshot as b, type RuntimeAuthContext as b0, type RuntimePeerScope as b1, type SessionKind as b2, type SessionPlatform as b3, type RoomAuthorityAssignment as c, type PlutoRTCConfiguration as d, type PlutoMoQConfiguration as e, type RouteOptimization as f, type ProtocolName as g, type RuntimePeerState as h, type PeerConnectOptions as i, Connection as j, type PeerSessionSnapshot as k, type PeerReadiness as l, type RuntimePeerHealth as m, type ResolvedPeerIdentity as n, type PeerStreamOptions as o, type ScopedChannelOptions as p, type RuntimeDevice as q, type ScopedLogicalChannel as r, type ConnectionState as s, type ReadinessOptions as t, type ConnectionEvent as u, type ManagedSession as v, type DeviceConnectOptions as w, type ConnectDeviceResult as x, type ConnectDeviceHooks as y, type ConnectDeviceOptions as z };
|
package/dist/{DelegatingRuntimeAdapter-DLrTF5Nr.d.ts → DelegatingRuntimeAdapter-Bh0rLvly.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as DiscoveryMode, O as AuthMode, Q as SignalingMode, T as ClientOptions, U as ExplicitFileDataSendParams, V as ISignalingBackend, W as RuntimeIdentity, H as AuthContext, X as RoomMember, Y as Device, Z as DeviceStatusSnapshot, k as PeerSessionSnapshot, n as ResolvedPeerIdentity, _ as ManagedConnectionRecord, $ as SignalingEnvelope, a0 as DeviceEvent, a1 as DesiredPeerProjection, a2 as SignalingSession, a3 as SessionEvent, a4 as LocalDeviceInfo, a5 as NativeManagedSessionStartResult, g as ProtocolName, G as GrantScope, a6 as
|
|
2
|
-
import { R as RuntimeCapabilities } from './capabilities-
|
|
1
|
+
import { N as DiscoveryMode, O as AuthMode, Q as SignalingMode, T as ClientOptions, U as ExplicitFileDataSendParams, V as ISignalingBackend, W as RuntimeIdentity, H as AuthContext, X as RoomMember, Y as Device, Z as DeviceStatusSnapshot, k as PeerSessionSnapshot, n as ResolvedPeerIdentity, _ as ManagedConnectionRecord, $ as SignalingEnvelope, a0 as DeviceEvent, a1 as DesiredPeerProjection, a2 as SignalingSession, a3 as SessionEvent, a4 as LocalDeviceInfo, a5 as NativeManagedSessionStartResult, g as ProtocolName, G as GrantScope, a6 as TicketMeshPeerReadiness, a7 as BackendPeerBiStream, a8 as BackendPeerUniStream, a9 as PortableMediaPublish, aa as PortableMediaPublicationStart, ab as PortableMediaSample, ac as PortableMediaChunk, ad as PortableMediaControl, ae as NativeConnectParams, af as NativeConnectResult, ag as BackendConnectionState, ah as NativePeerDataEvent } from './Connection-gaN-X7kf.js';
|
|
2
|
+
import { R as RuntimeCapabilities } from './capabilities-wJO8ZWyF.js';
|
|
3
3
|
|
|
4
4
|
/** Host-neutral configuration shared by browser/WASM and native/IPC adapters. */
|
|
5
5
|
interface RuntimeBridgeOptions {
|
|
@@ -35,13 +35,14 @@ interface RuntimeBridgeOptions {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
type TicketMeshAction = {
|
|
38
|
-
type: 'connect' | 'send' | 'invite';
|
|
38
|
+
type: 'connect' | 'retain-recovery' | 'send' | 'invite' | 'peers';
|
|
39
39
|
nodeId?: string;
|
|
40
40
|
ticket?: string;
|
|
41
41
|
frame?: string;
|
|
42
42
|
timeoutMs?: number;
|
|
43
43
|
id?: string;
|
|
44
44
|
invitation?: string;
|
|
45
|
+
peers?: TicketMeshPeerReadiness[];
|
|
45
46
|
};
|
|
46
47
|
declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
47
48
|
protected readonly backend: ISignalingBackend;
|
|
@@ -118,6 +119,7 @@ declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
|
118
119
|
issueTicketMesh(id: string, maxPeers: number, onAction?: (action: TicketMeshAction) => Promise<void>): Promise<string>;
|
|
119
120
|
joinTicketMesh(invitation: string, onAction?: (action: TicketMeshAction) => Promise<void>): Promise<string>;
|
|
120
121
|
onTicketMeshInvite(id: string, callback: (invitation: string) => void): Promise<() => void>;
|
|
122
|
+
onTicketMeshPeers(id: string, callback: (peers: TicketMeshPeerReadiness[]) => void): Promise<() => void>;
|
|
121
123
|
receiveTicketMeshFrame(id: string, connectionId: string, frame: string): Promise<void>;
|
|
122
124
|
ticketMeshIssuerNode(id: string): Promise<string>;
|
|
123
125
|
closeTicketMesh(id: string): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as RuntimeBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-
|
|
1
|
+
import { R as RuntimeBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-Bh0rLvly.js';
|
|
2
2
|
import { P as PlutoIpcBridge } from './ipc-DgzKqHH3.js';
|
|
3
|
-
import { S as ServiceErrorObservation,
|
|
3
|
+
import { S as ServiceErrorObservation, ag as BackendConnectionState, ah as NativePeerDataEvent, Y as Device } from './Connection-gaN-X7kf.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Root-client owner for the one native WebView projection.
|
|
@@ -16,6 +16,9 @@ import { S as ServiceErrorObservation, af as BackendConnectionState, ag as Nativ
|
|
|
16
16
|
*/
|
|
17
17
|
interface NativeProjectionHost {
|
|
18
18
|
incoming_projected_streams(): Promise<ReadableStream<NativeRootProjectionEvent>>;
|
|
19
|
+
/** Read-only identity fence of this capability's existing native adapter.
|
|
20
|
+
* The shared Channel host may be an unrelated anonymous ticket adapter. */
|
|
21
|
+
acceptsNativeIdentity?(identityId: string): boolean;
|
|
19
22
|
isCurrentTransport(endpointId: string, transportStableId: bigint): Promise<boolean>;
|
|
20
23
|
/**
|
|
21
24
|
* Drop the process-owned Tauri projection Channel. Required because an
|
|
@@ -38,6 +41,7 @@ type NativeRootProjectionEvent = {
|
|
|
38
41
|
kind: 'service-error';
|
|
39
42
|
capabilityKeys: readonly string[];
|
|
40
43
|
payload: {
|
|
44
|
+
identityId: string;
|
|
41
45
|
avenue: ServiceErrorObservation['avenue'];
|
|
42
46
|
runtimeInstanceId: string;
|
|
43
47
|
serviceError: unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as NativeProjectionBroker}from'./chunk-LJBVXWWV.js';import'./chunk-COXQYBTI.js';import'./chunk-WALOTASO.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as WasmBridge,a as loadBrowserWasmRuntimeModule}from'./chunk-US64VGDU.js';import'./chunk-AYHD4X2R.js';import'./chunk-DMCUS3TY.js';import'./chunk-XMYBBLYK.js';import'./chunk-OT7IPLZE.js';import'./chunk-OWKAJPOI.js';import'./chunk-COXQYBTI.js';import'./chunk-L2ZZXECX.js';import'./chunk-CCCYE3XN.js';import'./chunk-JPBW67B3.js';import'./chunk-F5ORG763.js';import'./chunk-WALOTASO.js';import'./chunk-2GX6GB6L.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as RuntimePeerState, s as ConnectionState, l as PeerReadiness, i as PeerConnectOptions, j as Connection, I as IncomingStream, G as GrantScope, K as RuntimeClientOptions, V as ISignalingBackend,
|
|
2
|
-
import { R as RuntimeCapabilities, C as CapabilityProfile } from './capabilities-
|
|
1
|
+
import { h as RuntimePeerState, s as ConnectionState, l as PeerReadiness, i as PeerConnectOptions, j as Connection, I as IncomingStream, G as GrantScope, K as RuntimeClientOptions, V as ISignalingBackend, az as RuntimeAuthIdentity, H as AuthContext, g as ProtocolName, L as LocalDeviceInfo, A as DeviceProfile, am as BrowserProtocolStore, an as NamespaceDescriptor, ao as IrohMutationReceipt, ap as IrohDocEntry, af as NativeConnectResult, q as RuntimeDevice, M as ManagedOptions, v as ManagedSession, D as DeviceStatus, y as ConnectDeviceHooks, z as ConnectDeviceOptions, x as ConnectDeviceResult, w as DeviceConnectOptions, _ as ManagedConnectionRecord, k as PeerSessionSnapshot, n as ResolvedPeerIdentity, aA as RuntimeSession, aB as AppLimits, J as JoinRoomOptions, F as RuntimeRoomMember, aC as ConnectionTarget, p as ScopedChannelOptions, r as ScopedLogicalChannel, o as PeerStreamOptions, ae as NativeConnectParams, B as RawConnection, C as ChannelDescriptor, U as ExplicitFileDataSendParams, aD as PresenceLoopOptions, b as RoomArchitectureSnapshot, c as RoomAuthorityAssignment, m as RuntimePeerHealth, t as ReadinessOptions, u as ConnectionEvent } from './Connection-gaN-X7kf.js';
|
|
2
|
+
import { R as RuntimeCapabilities, C as CapabilityProfile } from './capabilities-wJO8ZWyF.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Coalesced peer reconciliation scheduler and full reconcile orchestration.
|
|
@@ -296,6 +296,10 @@ declare class RuntimeClient {
|
|
|
296
296
|
private managedSessionStartInFlight;
|
|
297
297
|
private readonly ticketMeshMessageStops;
|
|
298
298
|
private readonly ticketMeshInviteStops;
|
|
299
|
+
private readonly ticketMeshProjectionOwners;
|
|
300
|
+
private readonly ticketMeshPeerStops;
|
|
301
|
+
private readonly ticketMeshPeers;
|
|
302
|
+
private readonly ticketMeshPeerListeners;
|
|
299
303
|
private readonly ticketMeshInvites;
|
|
300
304
|
private readonly ticketMeshInviteListeners;
|
|
301
305
|
private readonly activeTicketMeshes;
|
|
@@ -303,6 +307,7 @@ declare class RuntimeClient {
|
|
|
303
307
|
private readonly ticketMeshStarts;
|
|
304
308
|
private readonly ticketMeshCloseInFlight;
|
|
305
309
|
private browserInitialization;
|
|
310
|
+
private managedSessionRun;
|
|
306
311
|
private terminalShutdown;
|
|
307
312
|
private readonly managedReconciliationTasks;
|
|
308
313
|
private readonly managedReconciliationFollowupTimers;
|
|
@@ -429,6 +434,9 @@ declare class RuntimeClient {
|
|
|
429
434
|
joinTicketMesh(invitation: string): Promise<string>;
|
|
430
435
|
closeTicketMesh(id: string): Promise<void>;
|
|
431
436
|
ticketMeshIssuerNode(id: string): Promise<string>;
|
|
437
|
+
isTicketMeshPeerReady(id: string, peer: RuntimePeerState): boolean;
|
|
438
|
+
watchTicketMeshPeers(id: string, callback: () => void): () => void;
|
|
439
|
+
private publishTicketMeshPeers;
|
|
432
440
|
watchTicketMeshInvite(id: string, callback: (invitation: string) => void): () => void;
|
|
433
441
|
private publishTicketMeshInvite;
|
|
434
442
|
private assertTicketMeshStartAvailable;
|
|
@@ -655,6 +663,8 @@ declare class RuntimeClient {
|
|
|
655
663
|
disconnectPeer(id: string, scope?: string): Promise<void>;
|
|
656
664
|
forceDisconnectPeer(id: string): Promise<void>;
|
|
657
665
|
getPeerHealth(id: string): Promise<RuntimePeerHealth>;
|
|
666
|
+
private readonly connectionMetrics;
|
|
667
|
+
watchConnectionMetrics(callback: (states: readonly ConnectionState[]) => void): () => void;
|
|
658
668
|
getConnectionStates(): Promise<ConnectionState[]>;
|
|
659
669
|
/**
|
|
660
670
|
* Subscribe to raw backend connection diagnostics.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as ProtocolName, f as RouteOptimization } from './Connection-
|
|
1
|
+
import { g as ProtocolName, f as RouteOptimization } from './Connection-gaN-X7kf.js';
|
|
2
2
|
|
|
3
3
|
type RuntimeAdapterKind = 'browser-wasm' | 'native-ipc' | 'tauri-ipc' | 'unknown';
|
|
4
4
|
type CapabilityMaturity = 'stable' | 'preview' | 'support-only' | 'unavailable';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d as d$1,a as a$1}from'./chunk-
|
|
1
|
+
import {d as d$1,a as a$1}from'./chunk-F5ORG763.js';var s="openrtc-ticket-v1.",c=16*1024,d=/^[A-Za-z0-9_.:@-]{1,160}$/;function n(t){return d$1(a$1.TICKET_INVITE_INVALID,t,{retryable:false,plane:"admission"})}function a(t){if(!/^[A-Za-z0-9_-]+$/.test(t))throw n("[OpenRTC] Invalid ticket invitation encoding.");return atob(t.replace(/-/g,"+").replace(/_/g,"/"))}function g(t){if(typeof t.id!="string"||!d.test(t.id)||!Number.isSafeInteger(t.maxPeers)||t.maxPeers<2||t.maxPeers>8||typeof t.mesh!="boolean"||typeof t.ticket!="string"||!t.ticket||t.ticket.length>c)throw n("[OpenRTC] Invalid ticket invitation.");let i=t.ticket.lastIndexOf(".");if(i<1)throw n("[OpenRTC] Ticket invitation has no endpoint grant.");let e;try{e=JSON.parse(a(t.ticket.slice(i+1)));}catch{throw n("[OpenRTC] Ticket invitation has an invalid endpoint grant.")}if(!e||typeof e!="object"||Array.isArray(e)||e.s!==`ticket:${t.id}`||typeof e.t!="string"||!e.t||e.m!==0||typeof e.h!="string"||!e.h||typeof e.e!="number"||!Number.isSafeInteger(e.e)||e.e<=Date.now()||e.a!=="openrtc:endpoint-ticket:v1"||typeof e.n!="string"||!e.n)throw n("[OpenRTC] Ticket invitation grant does not match its avenue.");return t}function u(t){if(t.length>c||!t.startsWith(s))throw n("[OpenRTC] Invalid ticket invitation format.");let i;try{i=JSON.parse(a(t.slice(s.length)));}catch{throw n("[OpenRTC] Invalid ticket invitation body.")}if(!i||typeof i!="object"||Array.isArray(i)||Object.keys(i).some(e=>!["id","ticket","max_peers","mesh"].includes(e)))throw n("[OpenRTC] Invalid ticket invitation body.");return g({id:i.id,ticket:i.ticket,maxPeers:i.max_peers,mesh:i.mesh})}var l=class{constructor(i){this.transmit=i;this.pending=null;this.running=false;this.closedError=null;}send(i){return this.closedError?Promise.reject(this.closedError):new Promise((e,p)=>{this.pending&&this.pending.resolve(),this.pending={payload:i.slice(),resolve:e,reject:p},this.pump();})}close(i=new Error("Latest-state channel is closed.")){this.closedError=i;let e=this.pending;this.pending=null,e?.reject(i);}pump(){this.running||this.closedError||(this.running=true,(async()=>{for(;this.pending&&!this.closedError;){let i=this.pending;this.pending=null;try{await this.transmit(i.payload),i.resolve();}catch(e){i.reject(e);}}})().finally(()=>{this.running=false,this.pending&&!this.closedError&&this.pump();}));}};export{l as a,u as b};
|