openrtc 1.0.4 → 1.0.5
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 +12 -4
- package/dist/{DelegatingRuntimeAdapter-D2_dgabz.d.ts → DelegatingRuntimeAdapter-DlC0TZB0.d.ts} +3 -102
- package/dist/OpenRTCShared-BvTf2gFH.d.ts +249 -0
- package/dist/{framing-rPdckqn5.d.ts → assembly-BH-ZekkH.d.ts} +4 -46
- package/dist/auth/index.js +1 -1
- package/dist/auth/internal.js +1 -1
- package/dist/capabilities-C4Dqs_pB.d.ts +101 -0
- package/dist/chunk-4AXAWVC6.js +2 -0
- package/dist/chunk-7352ZIXN.js +3 -0
- package/dist/chunk-DI5IPRPM.js +2 -0
- package/dist/{chunk-34LATQZZ.js → chunk-HVTYSEU7.js} +1 -1
- package/dist/chunk-MNI6JGR2.js +1 -0
- package/dist/{chunk-RRCARL4S.js → chunk-N6UBUNGC.js} +1 -1
- package/dist/chunk-WUREK3SW.js +1 -0
- package/dist/chunk-YTUWXCRO.js +1 -0
- package/dist/framing-zRvEKOld.d.ts +29 -0
- package/dist/index.d.ts +18 -260
- package/dist/index.js +2 -2
- package/dist/ipc-CflAVodw.d.ts +11 -0
- package/dist/native.d.ts +20 -0
- package/dist/native.js +1 -0
- package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -2
- package/dist/runtime/WasmRuntimeAdapter.js +1 -1
- package/dist/runtime/device-status.d.ts +37 -2
- package/dist/runtime/index.d.ts +28 -11
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/tauri.d.ts +5 -19
- package/dist/runtime/tauri.js +1 -1
- package/dist/tauri-BVSxK0jq.d.ts +33 -0
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-ByZyADCn.d.ts → types-BCkKK8dy.d.ts} +1 -1
- package/dist/{device-status-CR27Ak7c.d.ts → types-QMj23Nvm.d.ts} +3 -36
- package/package.json +7 -2
- package/dist/IpcRuntimeAdapter-B8rkqNrq.d.ts +0 -28
- package/dist/chunk-BGQX25BO.js +0 -1
- package/dist/chunk-L6OUJ6YN.js +0 -2
- package/dist/chunk-MESPJTUA.js +0 -1
- package/dist/chunk-NCRP5ODV.js +0 -3
package/README.md
CHANGED
|
@@ -147,6 +147,11 @@ product policy remain consumer-owned.
|
|
|
147
147
|
- `OpenRTC()`
|
|
148
148
|
- `OpenRTC.native()`
|
|
149
149
|
|
|
150
|
+
### Native-only Entrypoint
|
|
151
|
+
- `openrtc/native`
|
|
152
|
+
- `createNativeOpenRTC(options, bridge)`
|
|
153
|
+
- excludes the browser WASM adapter and binary from Tauri webview bundles
|
|
154
|
+
|
|
150
155
|
### Runtime Secondary Entrypoint
|
|
151
156
|
- `openrtc/runtime`
|
|
152
157
|
- `RuntimeClient`
|
|
@@ -162,14 +167,17 @@ product policy remain consumer-owned.
|
|
|
162
167
|
- Rust plugin crate: `openrtc-tauri-plugin`
|
|
163
168
|
- `openrtc/runtime/tauri` remains as a deprecated compatibility shim for one release cycle
|
|
164
169
|
|
|
165
|
-
For Tauri desktop/mobile apps, use `
|
|
166
|
-
`openrtc
|
|
170
|
+
For Tauri desktop/mobile apps, use `createNativeOpenRTC(options, bridge)` from
|
|
171
|
+
`openrtc/native` with the `openrtc-tauri` bridge and register
|
|
172
|
+
`openrtc-tauri-plugin` in the Rust Tauri
|
|
167
173
|
builder. Do not copy product-owned RTC command files into new apps. The plugin
|
|
168
174
|
owns the native IPC command set and delegates lifecycle, discovery, presence,
|
|
169
175
|
auto-connect, and connection state to one `openrtc::client::Client`. Do not use
|
|
170
|
-
`OpenRTC(options)`
|
|
176
|
+
`OpenRTC(options)` or the compatibility `OpenRTC.native(options)` entry inside a
|
|
177
|
+
Tauri shell unless you intentionally want the
|
|
171
178
|
browser/WASM runtime for a prototype; that path bypasses the native Rust runtime
|
|
172
|
-
and can hide native
|
|
179
|
+
or retains browser-runtime bundle reachability and can hide native
|
|
180
|
+
lifecycle/presence issues from tests.
|
|
173
181
|
|
|
174
182
|
Mobile hosts should forward connectivity-restored callbacks through
|
|
175
183
|
`client.advanced.notifyNetworkChange(reason)`. The Tauri plugin passes this hint
|
package/dist/{DelegatingRuntimeAdapter-D2_dgabz.d.ts → DelegatingRuntimeAdapter-DlC0TZB0.d.ts}
RENAMED
|
@@ -1,105 +1,6 @@
|
|
|
1
|
-
import { D as DiscoveryMode, A as AuthMode, S as SignalingMode, E as ExplicitFileDataSendParams, I as ISignalingBackend,
|
|
1
|
+
import { D as DiscoveryMode, A as AuthMode, S as SignalingMode, E as ExplicitFileDataSendParams, I as ISignalingBackend, c as RuntimeIdentity, d as Device, e as DeviceStatusSnapshot, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, M as ManagedConnectionRecord, f as SignalingEnvelope, g as DeviceEvent, h as SignalingSession, i as SessionEvent, L as LocalDeviceInfo, N as NativeManagedSessionStartResult, G as GrantScope, B as BackendPeerBiStream, j as BackendPeerUniStream, k as NativeConnectParams, l as NativeConnectResult, m as BackendConnectionState } from './types-BCkKK8dy.js';
|
|
2
2
|
import { A as AuthContext } from './IEngineBridge-C7OT2CRv.js';
|
|
3
|
-
|
|
4
|
-
type RuntimeAdapterKind = 'browser-wasm' | 'native-ipc' | 'tauri-ipc' | 'unknown';
|
|
5
|
-
interface RuntimeCapabilities {
|
|
6
|
-
adapter: RuntimeAdapterKind;
|
|
7
|
-
signaling: {
|
|
8
|
-
firestore: boolean;
|
|
9
|
-
nativeIpc: boolean;
|
|
10
|
-
rtdbPresence: boolean;
|
|
11
|
-
};
|
|
12
|
-
transport: {
|
|
13
|
-
irohQuic: boolean;
|
|
14
|
-
irohLan: boolean;
|
|
15
|
-
webRtcUpgrade: boolean;
|
|
16
|
-
webRtcLan: boolean;
|
|
17
|
-
nativeWebRtc: boolean;
|
|
18
|
-
moq: boolean;
|
|
19
|
-
ble: boolean;
|
|
20
|
-
wasm: boolean;
|
|
21
|
-
};
|
|
22
|
-
nativeProtocols: {
|
|
23
|
-
productAlpn: boolean;
|
|
24
|
-
irohDocs: boolean;
|
|
25
|
-
irohBlobs: boolean;
|
|
26
|
-
irohGossip: boolean;
|
|
27
|
-
};
|
|
28
|
-
lifecycle: {
|
|
29
|
-
managedSession: boolean;
|
|
30
|
-
autoConnect: boolean;
|
|
31
|
-
manualDisconnect: boolean;
|
|
32
|
-
connectionStateEvents: boolean;
|
|
33
|
-
peerSessions: boolean;
|
|
34
|
-
};
|
|
35
|
-
transfers: {
|
|
36
|
-
explicitFilePath: boolean;
|
|
37
|
-
explicitFileData: boolean;
|
|
38
|
-
history: boolean;
|
|
39
|
-
};
|
|
40
|
-
fallback: {
|
|
41
|
-
wasm: boolean;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
interface RuntimeCapabilityProfile {
|
|
45
|
-
environment: 'web' | 'native' | 'unknown';
|
|
46
|
-
transports: {
|
|
47
|
-
quic: boolean;
|
|
48
|
-
irohRelay: boolean;
|
|
49
|
-
irohLan: boolean;
|
|
50
|
-
webRtc: boolean;
|
|
51
|
-
webRtcLan: boolean;
|
|
52
|
-
moq: boolean;
|
|
53
|
-
ble: boolean;
|
|
54
|
-
};
|
|
55
|
-
lifecycle: RuntimeCapabilities['lifecycle'];
|
|
56
|
-
storage: {
|
|
57
|
-
localFileSystem: boolean;
|
|
58
|
-
transferHistory: boolean;
|
|
59
|
-
};
|
|
60
|
-
nativeProtocols: RuntimeCapabilities['nativeProtocols'];
|
|
61
|
-
}
|
|
62
|
-
interface NativeRuntimeTransportFeatureStatus {
|
|
63
|
-
compiled?: boolean;
|
|
64
|
-
enabled?: boolean;
|
|
65
|
-
}
|
|
66
|
-
interface NativeRuntimeStatusSnapshot {
|
|
67
|
-
ready?: boolean;
|
|
68
|
-
nodeId?: string | null;
|
|
69
|
-
node_id?: string | null;
|
|
70
|
-
transport?: {
|
|
71
|
-
irohQuic?: NativeRuntimeTransportFeatureStatus;
|
|
72
|
-
irohLan?: NativeRuntimeTransportFeatureStatus;
|
|
73
|
-
webRtc?: NativeRuntimeTransportFeatureStatus;
|
|
74
|
-
webRtcLan?: NativeRuntimeTransportFeatureStatus;
|
|
75
|
-
moq?: NativeRuntimeTransportFeatureStatus;
|
|
76
|
-
ble?: NativeRuntimeTransportFeatureStatus;
|
|
77
|
-
irohRelayOnly?: boolean;
|
|
78
|
-
irohRelayTransportPolicy?: string | null;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
declare const BROWSER_WASM_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
82
|
-
/**
|
|
83
|
-
* The small host surface that browser WebRTC capability reporting needs.
|
|
84
|
-
*
|
|
85
|
-
* This is deliberately a feature check only: capability reporting must not
|
|
86
|
-
* create a peer connection, probe ICE, or influence route ownership.
|
|
87
|
-
*/
|
|
88
|
-
interface BrowserRuntimeCapabilityHost {
|
|
89
|
-
RTCPeerConnection?: unknown;
|
|
90
|
-
}
|
|
91
|
-
declare const NATIVE_IPC_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
92
|
-
declare function cloneRuntimeCapabilities(capabilities: RuntimeCapabilities): RuntimeCapabilities;
|
|
93
|
-
/**
|
|
94
|
-
* Returns browser/WASM capabilities for a concrete JavaScript host.
|
|
95
|
-
*
|
|
96
|
-
* The static browser baseline describes package support. WebRTC additionally
|
|
97
|
-
* requires the browser primitive to exist at runtime. Passing the host keeps
|
|
98
|
-
* the resolver deterministic in SSR and test environments.
|
|
99
|
-
*/
|
|
100
|
-
declare function runtimeCapabilitiesForBrowserHost(host?: BrowserRuntimeCapabilityHost | null | undefined): RuntimeCapabilities;
|
|
101
|
-
declare function runtimeCapabilitiesFromNativeStatus(status: NativeRuntimeStatusSnapshot | null | undefined, allowWasmFallback?: boolean): RuntimeCapabilities;
|
|
102
|
-
declare function runtimeCapabilityProfile(capabilities: RuntimeCapabilities): RuntimeCapabilityProfile;
|
|
3
|
+
import { R as RuntimeCapabilities } from './capabilities-C4Dqs_pB.js';
|
|
103
4
|
|
|
104
5
|
interface WasmBridgeOptions {
|
|
105
6
|
apiKey?: string;
|
|
@@ -216,4 +117,4 @@ declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
|
216
117
|
setCoreClient(client: unknown): void;
|
|
217
118
|
}
|
|
218
119
|
|
|
219
|
-
export {
|
|
120
|
+
export { DelegatingRuntimeAdapter as D, type WasmBridgeOptions as W };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { R as RuntimeClient, a as RuntimePolicySnapshot, P as PeerReconciliationStats, b as PlutoRuntimeAssembly } from './assembly-BH-ZekkH.js';
|
|
2
|
+
import { C as ConnectDeviceResult, a as ConnectDeviceHooks, b as ConnectDeviceOptions, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, G as GrantScope } from './types-BCkKK8dy.js';
|
|
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-QMj23Nvm.js';
|
|
5
|
+
import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './capabilities-C4Dqs_pB.js';
|
|
6
|
+
|
|
7
|
+
type OpenRTCChannelConnectOptions = Omit<RuntimeScopedChannelOptions, 'scope' | 'deviceId' | 'ticket'> & {
|
|
8
|
+
/**
|
|
9
|
+
* Device selected from `client.devices.*`. Passing the device object lets
|
|
10
|
+
* OpenRTC reuse its current ticket for native and ticket-gated routes.
|
|
11
|
+
*/
|
|
12
|
+
device?: string | RuntimeDevice;
|
|
13
|
+
deviceId?: string | null;
|
|
14
|
+
ticket?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Logical channel lifecycle scope. Most app channels should use the default
|
|
17
|
+
* `session`; pass a custom scope only when you intentionally manage peer
|
|
18
|
+
* lifecycle separately from the channel.
|
|
19
|
+
*/
|
|
20
|
+
scope?: RuntimeScopedChannelOptions['scope'];
|
|
21
|
+
};
|
|
22
|
+
type OpenRTCDeviceSessionOptions = Omit<RuntimeManagedSessionOptions, 'platform'> & {
|
|
23
|
+
/**
|
|
24
|
+
* Runtime host for the managed user-device session. Normal apps can omit
|
|
25
|
+
* this: `OpenRTC(...)` defaults to `web`, and `OpenRTC.native(...)` defaults
|
|
26
|
+
* to `native`.
|
|
27
|
+
*/
|
|
28
|
+
platform?: RuntimeManagedSessionOptions['platform'];
|
|
29
|
+
};
|
|
30
|
+
interface OpenRTCDeviceNamespace {
|
|
31
|
+
startSession(options?: OpenRTCDeviceSessionOptions): Promise<RuntimeManagedSession>;
|
|
32
|
+
stopSession(options?: {
|
|
33
|
+
preserveBackendSession?: boolean;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
list(): Promise<RuntimeDevice[]>;
|
|
36
|
+
listWithStatus(): Promise<RuntimeDeviceStatusSnapshot[]>;
|
|
37
|
+
watch(callback: (devices: RuntimeDevice[]) => void): () => void;
|
|
38
|
+
watchWithStatus(callback: (devices: RuntimeDeviceStatusSnapshot[]) => void): () => void;
|
|
39
|
+
connect(device: string | RuntimeDevice, options?: RuntimeDeviceConnectOptions): Promise<ConnectDeviceResult>;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use `devices.connect()`. Retry and route recovery are owned by
|
|
42
|
+
* OpenRTC; legacy consumer-provided connection hooks are ignored.
|
|
43
|
+
*/
|
|
44
|
+
connectWithRetry(device: string | RuntimeDevice, hooks: ConnectDeviceHooks, options: ConnectDeviceOptions): Promise<ConnectDeviceResult>;
|
|
45
|
+
disconnect(deviceId: string): Promise<void>;
|
|
46
|
+
update(deviceId: string, updates: {
|
|
47
|
+
deviceName?: string;
|
|
48
|
+
capabilities?: RuntimeDevice['capabilities'];
|
|
49
|
+
metadata?: string;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
delete(deviceId: string): Promise<void>;
|
|
52
|
+
localId(): Promise<string | null>;
|
|
53
|
+
localInfo(): Promise<RuntimeLocalDeviceInfo | null>;
|
|
54
|
+
localProfile(options?: {
|
|
55
|
+
deviceName?: string;
|
|
56
|
+
localDeviceId?: string | null;
|
|
57
|
+
platform?: 'native' | 'web';
|
|
58
|
+
userId?: string | null;
|
|
59
|
+
}): Promise<RuntimeLocalDeviceProfile>;
|
|
60
|
+
updateLocalName(deviceName: string): Promise<RuntimeLocalDeviceInfo | null>;
|
|
61
|
+
}
|
|
62
|
+
interface OpenRTCPeerNamespace {
|
|
63
|
+
watch(callback: (peers: RuntimePeerState[]) => void): () => void;
|
|
64
|
+
watchLifecycle(callback: (peers: RuntimePeerState[]) => void): () => void;
|
|
65
|
+
get(id: string): RuntimePeerState | undefined;
|
|
66
|
+
listConnected(): RuntimePeerState[];
|
|
67
|
+
connect(options: RuntimePeerConnectOptions): Promise<Connection>;
|
|
68
|
+
disconnect(id: string, scope?: string): Promise<void>;
|
|
69
|
+
forceDisconnect(id: string): Promise<void>;
|
|
70
|
+
session(id: string): Promise<PeerSessionSnapshot | null>;
|
|
71
|
+
sessions(): Promise<PeerSessionSnapshot[]>;
|
|
72
|
+
waitConnected(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
|
|
73
|
+
readiness(id: string, timeoutMs?: number): Promise<RuntimePeerReadinessSnapshot>;
|
|
74
|
+
health(id: string): Promise<RuntimePeerHealth>;
|
|
75
|
+
identity(id: string): Promise<ResolvedPeerIdentity>;
|
|
76
|
+
addScope(id: string, scope?: string): RuntimePeerState | undefined;
|
|
77
|
+
releaseScope(id: string, scope?: string): RuntimePeerState | undefined;
|
|
78
|
+
scopes(id: string): string[];
|
|
79
|
+
refresh(): Promise<RuntimePeerState[]>;
|
|
80
|
+
}
|
|
81
|
+
interface OpenRTCChannelNamespace {
|
|
82
|
+
register(descriptor: RuntimeChannelDescriptor): void;
|
|
83
|
+
unregister(channelId: string): void;
|
|
84
|
+
list(): RuntimeChannelDescriptor[];
|
|
85
|
+
openBi(id: string, channelId: string, options?: Omit<RuntimePeerStreamOptions, 'channelId'>): Promise<{
|
|
86
|
+
connection: Connection;
|
|
87
|
+
readable: ReadableStream<Uint8Array>;
|
|
88
|
+
writable: WritableStream<Uint8Array>;
|
|
89
|
+
}>;
|
|
90
|
+
openUni(id: string, channelId: string, options?: Omit<RuntimePeerStreamOptions, 'channelId'>): Promise<{
|
|
91
|
+
connection: Connection;
|
|
92
|
+
writable: WritableStream<Uint8Array>;
|
|
93
|
+
}>;
|
|
94
|
+
onIncoming(callback: (stream: RuntimeIncomingStream) => boolean | void): () => void;
|
|
95
|
+
onIncomingChannel(channelId: string, callback: (stream: RuntimeIncomingStream & {
|
|
96
|
+
channel: NonNullable<RuntimeIncomingStream['channel']>;
|
|
97
|
+
}) => boolean | void): () => void;
|
|
98
|
+
connect(options: OpenRTCChannelConnectOptions): Promise<RuntimeScopedLogicalChannel>;
|
|
99
|
+
connectScoped(options: RuntimeScopedChannelOptions): Promise<RuntimeScopedLogicalChannel>;
|
|
100
|
+
}
|
|
101
|
+
interface OpenRTCRoomNamespace {
|
|
102
|
+
create(roomId?: string): Promise<string>;
|
|
103
|
+
join(roomId: string, options?: RuntimeJoinRoomOptions): Promise<Connection[]>;
|
|
104
|
+
leave(roomId: string): Promise<void>;
|
|
105
|
+
watch(roomId: string, callback: (members: RuntimeRoomMember[]) => void): () => void;
|
|
106
|
+
members(roomId: string): Promise<RuntimeRoomMember[]>;
|
|
107
|
+
}
|
|
108
|
+
interface OpenRTCTicketNamespace {
|
|
109
|
+
raw(): Promise<string>;
|
|
110
|
+
share(options?: {
|
|
111
|
+
maxConnections?: number;
|
|
112
|
+
}): Promise<string>;
|
|
113
|
+
grant(scope: GrantScope, options?: {
|
|
114
|
+
maxConnections?: number;
|
|
115
|
+
}): Promise<string>;
|
|
116
|
+
revoke(scope: GrantScope): Promise<string[]>;
|
|
117
|
+
}
|
|
118
|
+
interface OpenRTCDiagnosticsNamespace {
|
|
119
|
+
status(): Promise<{
|
|
120
|
+
runtime: 'tauri' | 'browser' | 'unknown';
|
|
121
|
+
wasmLoaded: boolean;
|
|
122
|
+
localNodeId?: string;
|
|
123
|
+
userId?: string;
|
|
124
|
+
}>;
|
|
125
|
+
policy(): RuntimePolicySnapshot;
|
|
126
|
+
capabilities(): RuntimeCapabilities;
|
|
127
|
+
capabilityProfile(): RuntimeCapabilityProfile;
|
|
128
|
+
connectionStates(): Promise<RuntimeConnectionStateSnapshot[]>;
|
|
129
|
+
onConnectionStateChange(callback: (state: RuntimeConnectionStateSnapshot) => void): Promise<() => void> | (() => void);
|
|
130
|
+
connections(): Connection[];
|
|
131
|
+
applicationReadyConnections(options?: RuntimeApplicationPayloadReadinessOptions): Connection[];
|
|
132
|
+
onConnection(callback: (connection: Connection) => void): () => void;
|
|
133
|
+
onDisconnection(callback: (connection: Connection) => void): () => void;
|
|
134
|
+
onConnectionEvent(callback: (event: RuntimeConnectionEvent) => void): () => void;
|
|
135
|
+
forceReconnectSnapshot(): void;
|
|
136
|
+
peerReconciliation(): Readonly<PeerReconciliationStats>;
|
|
137
|
+
}
|
|
138
|
+
interface OpenRTCAdvancedNamespace {
|
|
139
|
+
readonly runtime: RuntimeClient;
|
|
140
|
+
readonly assembly: PlutoRuntimeAssembly;
|
|
141
|
+
nodeId(): Promise<string>;
|
|
142
|
+
nodeIdFromTicket(ticket: string): Promise<string | null>;
|
|
143
|
+
endpointTicket(): Promise<string>;
|
|
144
|
+
connectRaw(target: {
|
|
145
|
+
ticket: string;
|
|
146
|
+
timeoutMs?: number;
|
|
147
|
+
}): Promise<RuntimeRawConnection>;
|
|
148
|
+
openBi(nodeId: string): Promise<{
|
|
149
|
+
readable: ReadableStream<Uint8Array>;
|
|
150
|
+
writable: WritableStream<Uint8Array>;
|
|
151
|
+
}>;
|
|
152
|
+
openUni(nodeId: string): Promise<WritableStream<Uint8Array>>;
|
|
153
|
+
isConnected(nodeId: string): Promise<boolean>;
|
|
154
|
+
disconnectNode(nodeId: string): Promise<void>;
|
|
155
|
+
setAutoConnectExcluded(deviceId: string, excluded: boolean): Promise<void>;
|
|
156
|
+
notifyNetworkChange(reason?: string): Promise<void>;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* OpenRTCClient extends RuntimeClient with auth helpers that were
|
|
160
|
+
* previously only available on PlutoRuntimeAssembly.
|
|
161
|
+
*
|
|
162
|
+
* This is the unified type returned by OpenRTC() and OpenRTC.native().
|
|
163
|
+
*/
|
|
164
|
+
interface OpenRTCClient extends RuntimeClient {
|
|
165
|
+
readonly devices: OpenRTCDeviceNamespace;
|
|
166
|
+
readonly peers: OpenRTCPeerNamespace;
|
|
167
|
+
readonly channels: OpenRTCChannelNamespace;
|
|
168
|
+
readonly rooms: OpenRTCRoomNamespace;
|
|
169
|
+
readonly tickets: OpenRTCTicketNamespace;
|
|
170
|
+
readonly diagnostics: OpenRTCDiagnosticsNamespace;
|
|
171
|
+
readonly advanced: OpenRTCAdvancedNamespace;
|
|
172
|
+
/** @deprecated Use setAuth() instead */
|
|
173
|
+
setAuthContext(context: AuthContext | null): Promise<void>;
|
|
174
|
+
/** Set auth context for the runtime */
|
|
175
|
+
setAuth(context: AuthContext | null): Promise<void>;
|
|
176
|
+
/** Sync Pluto-hosted auth to the runtime */
|
|
177
|
+
syncPlutoAuth(options?: {
|
|
178
|
+
userId?: string | null;
|
|
179
|
+
forceRefresh?: boolean;
|
|
180
|
+
}): Promise<void>;
|
|
181
|
+
/** Bind Pluto auth host to auto-sync on token changes */
|
|
182
|
+
bindPlutoAuthHost(): () => void;
|
|
183
|
+
/** Sign in via Pluto SSO */
|
|
184
|
+
signIn(): Promise<void>;
|
|
185
|
+
/** Sign out and clear auth context */
|
|
186
|
+
signOut(): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* @deprecated Use `client.devices.startSession(...)` for the public
|
|
189
|
+
* user-device avenue lifecycle. This top-level method remains for
|
|
190
|
+
* RuntimeClient compatibility and advanced integrations.
|
|
191
|
+
*/
|
|
192
|
+
startManagedSession(options: RuntimeManagedSessionOptions): Promise<RuntimeManagedSession>;
|
|
193
|
+
/**
|
|
194
|
+
* @deprecated Use `client.devices.stopSession(...)` for the public
|
|
195
|
+
* user-device avenue lifecycle.
|
|
196
|
+
*/
|
|
197
|
+
stopManagedSession(options?: {
|
|
198
|
+
preserveBackendSession?: boolean;
|
|
199
|
+
}): Promise<void>;
|
|
200
|
+
/** @deprecated Use `client.rooms.create(...)`. */
|
|
201
|
+
createRoom(roomId?: string): Promise<string>;
|
|
202
|
+
/** @deprecated Use `client.rooms.join(...)`. */
|
|
203
|
+
joinRoom(roomId: string, options?: RuntimeJoinRoomOptions): Promise<Connection[]>;
|
|
204
|
+
/** @deprecated Use `client.rooms.leave(...)`. */
|
|
205
|
+
leaveRoom(roomId: string): Promise<void>;
|
|
206
|
+
/** @deprecated Use `client.rooms.watch(...)`. */
|
|
207
|
+
watchRoom(roomId: string, callback: (members: RuntimeRoomMember[]) => void): () => void;
|
|
208
|
+
/** @deprecated Use `client.rooms.members(...)`. */
|
|
209
|
+
getRoomMembers(roomId: string): Promise<RuntimeRoomMember[]>;
|
|
210
|
+
/** @deprecated Use `client.tickets.raw(...)`. */
|
|
211
|
+
getInvite(): Promise<string>;
|
|
212
|
+
/** @deprecated Use `client.tickets.raw(...)`. */
|
|
213
|
+
getTicket(): Promise<string>;
|
|
214
|
+
/** @deprecated Use `client.tickets.share(...)` or `client.tickets.grant(...)`. */
|
|
215
|
+
getTicketWithToken(scope: GrantScope, maxConnections?: number): Promise<string>;
|
|
216
|
+
/** @deprecated Use `client.tickets.revoke(...)`. */
|
|
217
|
+
revokeTokensByScope(scope: GrantScope): Promise<string[]>;
|
|
218
|
+
/** @deprecated Use `client.peers.connect(...)`. */
|
|
219
|
+
connectPeer(options: RuntimePeerConnectOptions): Promise<Connection>;
|
|
220
|
+
/** @deprecated Use `client.peers.connect(...)`. */
|
|
221
|
+
connectTo(options: RuntimePeerConnectOptions): Promise<Connection>;
|
|
222
|
+
/** @deprecated Use `client.peers.waitConnected(...)`. */
|
|
223
|
+
waitForConnectedPeer(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
|
|
224
|
+
/** @deprecated Use `client.channels.connect(...)`; use `client.channels.connectScoped(...)` only for custom lifecycle scopes. */
|
|
225
|
+
connectScopedChannel(options: RuntimeScopedChannelOptions): Promise<RuntimeScopedLogicalChannel>;
|
|
226
|
+
/** @deprecated Use `client.channels.openBi(...)`. */
|
|
227
|
+
openPeerBi(id: string, options?: RuntimePeerStreamOptions): Promise<{
|
|
228
|
+
connection: Connection;
|
|
229
|
+
readable: ReadableStream<Uint8Array>;
|
|
230
|
+
writable: WritableStream<Uint8Array>;
|
|
231
|
+
}>;
|
|
232
|
+
/** @deprecated Use `client.channels.openUni(...)`. */
|
|
233
|
+
openPeerUni(id: string, options?: RuntimePeerStreamOptions): Promise<{
|
|
234
|
+
connection: Connection;
|
|
235
|
+
writable: WritableStream<Uint8Array>;
|
|
236
|
+
}>;
|
|
237
|
+
/**
|
|
238
|
+
* Access to the underlying PlutoRuntimeAssembly for backward compatibility.
|
|
239
|
+
* @deprecated Access methods directly on the client instead.
|
|
240
|
+
*/
|
|
241
|
+
readonly runtime: RuntimeClient;
|
|
242
|
+
/**
|
|
243
|
+
* Access to the underlying PlutoRuntimeAssembly for backward compatibility.
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
readonly _assembly: PlutoRuntimeAssembly;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export type { OpenRTCClient as O, OpenRTCChannelConnectOptions as a, OpenRTCDeviceNamespace as b, OpenRTCDeviceSessionOptions as c, OpenRTCRoomNamespace as d, OpenRTCTicketNamespace as e };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { A as AuthContext } from './IEngineBridge-C7OT2CRv.js';
|
|
2
|
-
import { G as GrantScope, I as ISignalingBackend,
|
|
3
|
-
import { h as RuntimePeerState, s as RuntimeConnectionStateSnapshot, j as RuntimePeerReadinessSnapshot, i as RuntimePeerConnectOptions, C as Connection, n as RuntimeIncomingStream, R as RuntimeClientOptions, H as RuntimeAuthIdentity, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, c as RuntimeDevice, a as RuntimeManagedSessionOptions, b as RuntimeManagedSession, d as RuntimeDeviceStatusSnapshot, e as RuntimeDeviceConnectOptions, X as RuntimeSession, q as RuntimeJoinRoomOptions, r as RuntimeRoomMember, K as RuntimeConnectionTarget, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, m as RuntimePeerStreamOptions, v as RuntimeRawConnection, l as RuntimeChannelDescriptor, V as RuntimePresenceLoopOptions, k as RuntimePeerHealth, t as RuntimeApplicationPayloadReadinessOptions, u as RuntimeConnectionEvent } from './
|
|
4
|
-
import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './
|
|
5
|
-
import { P as PlutoIpcBridge, I as IpcRuntimeAdapter } from './IpcRuntimeAdapter-B8rkqNrq.js';
|
|
6
|
-
import { WasmRuntimeAdapter } from './runtime/WasmRuntimeAdapter.js';
|
|
2
|
+
import { G as GrantScope, I as ISignalingBackend, a as ConnectDeviceHooks, b as ConnectDeviceOptions, C as ConnectDeviceResult, M as ManagedConnectionRecord, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, W as AppLimits, k as NativeConnectParams, l as NativeConnectResult, E as ExplicitFileDataSendParams } from './types-BCkKK8dy.js';
|
|
3
|
+
import { h as RuntimePeerState, s as RuntimeConnectionStateSnapshot, j as RuntimePeerReadinessSnapshot, i as RuntimePeerConnectOptions, C as Connection, n as RuntimeIncomingStream, R as RuntimeClientOptions, H as RuntimeAuthIdentity, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, c as RuntimeDevice, a as RuntimeManagedSessionOptions, b as RuntimeManagedSession, d as RuntimeDeviceStatusSnapshot, e as RuntimeDeviceConnectOptions, X as RuntimeSession, q as RuntimeJoinRoomOptions, r as RuntimeRoomMember, K as RuntimeConnectionTarget, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, m as RuntimePeerStreamOptions, v as RuntimeRawConnection, l as RuntimeChannelDescriptor, V as RuntimePresenceLoopOptions, k as RuntimePeerHealth, t as RuntimeApplicationPayloadReadinessOptions, u as RuntimeConnectionEvent } from './types-QMj23Nvm.js';
|
|
4
|
+
import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './capabilities-C4Dqs_pB.js';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Coalesced peer reconciliation scheduler and full reconcile orchestration.
|
|
@@ -716,45 +714,5 @@ interface PlutoRuntimeAssembly<TBackend extends RuntimeAdapterWithAuth = Runtime
|
|
|
716
714
|
connectDevice(device: any, options: any): Promise<any>;
|
|
717
715
|
setAutoConnectExcluded(deviceId: string, excluded: boolean): Promise<void>;
|
|
718
716
|
}
|
|
719
|
-
/**
|
|
720
|
-
* @deprecated Legacy assembly helper. Use `OpenRTC()` for app code.
|
|
721
|
-
* Removal target: OpenRTC 0.2.0. This remains available from `openrtc/runtime`
|
|
722
|
-
* only for advanced integrations that still need `PlutoRuntimeAssembly`.
|
|
723
|
-
*/
|
|
724
|
-
declare function createWasmClient(options: RuntimeFactoryOptions): PlutoRuntimeAssembly<WasmRuntimeAdapter>;
|
|
725
|
-
/**
|
|
726
|
-
* @deprecated Legacy assembly helper. Use `OpenRTC.native()` for app code.
|
|
727
|
-
* Removal target: OpenRTC 0.2.0. This remains available from `openrtc/runtime`
|
|
728
|
-
* only for advanced integrations that still need `PlutoRuntimeAssembly`.
|
|
729
|
-
*/
|
|
730
|
-
declare function createIpcClient(options: RuntimeFactoryOptions, bridge: PlutoIpcBridge): PlutoRuntimeAssembly<IpcRuntimeAdapter>;
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* Pure byte / stream / timing helpers.
|
|
734
|
-
*
|
|
735
|
-
* Extracted from the `Client` god object (see
|
|
736
|
-
* `docs/plans/client-ts-decomposition.md` Phase 1). These functions are
|
|
737
|
-
* deliberately pure — no `Client` state, no `this`, no logging side effects — so
|
|
738
|
-
* the same helper is reused everywhere instead of being re-implemented inline
|
|
739
|
-
* (e.g. `concatBytes` previously existed both here and in `applicationCrypto.ts`,
|
|
740
|
-
* and three near-identical exponential-backoff helpers existed across the class).
|
|
741
|
-
*/
|
|
742
|
-
|
|
743
|
-
type ByteArray = Uint8Array<ArrayBuffer>;
|
|
744
|
-
type ByteArrayLike = Uint8Array<ArrayBufferLike>;
|
|
745
|
-
|
|
746
|
-
type RuntimeU32BEFrameHandler = (payload: ByteArray) => void;
|
|
747
|
-
type RuntimeJsonFrameHandler<T = unknown> = (value: T, payload: ByteArray) => void;
|
|
748
|
-
interface RuntimeJsonFrameDecoderOptions {
|
|
749
|
-
onInvalidJson?: (error: unknown, payload: ByteArray) => void;
|
|
750
|
-
}
|
|
751
|
-
declare function encodeRuntimeU32BEFrame(payload: ByteArrayLike): ByteArray;
|
|
752
|
-
declare function createRuntimeU32BEFrameDecoder(onFrame: RuntimeU32BEFrameHandler): (chunk: ByteArrayLike) => void;
|
|
753
|
-
declare function encodeRuntimeJsonPayload(value: unknown): ByteArray;
|
|
754
|
-
declare function decodeRuntimeJsonPayload<T = unknown>(payload: ByteArrayLike): T;
|
|
755
|
-
declare function encodeRuntimeJsonFrame(value: unknown): ByteArray;
|
|
756
|
-
declare function createRuntimeJsonFrameDecoder<T = unknown>(onValue: RuntimeJsonFrameHandler<T>, options?: RuntimeJsonFrameDecoderOptions): (chunk: ByteArrayLike) => void;
|
|
757
|
-
declare function concatRuntimeBytes(a: ByteArrayLike, b: ByteArrayLike): ByteArray;
|
|
758
|
-
declare function readRuntimeU32BE(bytes: ByteArrayLike, offset: number): number;
|
|
759
717
|
|
|
760
|
-
export {
|
|
718
|
+
export { DriveGrantActorError as D, OPENRTC_RUNTIME_POLICY as O, type PeerReconciliationStats as P, RuntimeClient as R, ScopedSession as S, type RuntimePolicySnapshot as a, type PlutoRuntimeAssembly as b, type Session as c, type SessionOptions as d, type RuntimeFactoryOptions as e, type DriveGrantActorErrorKind as f, getRuntimePolicy as g, DriveGrantActorHandle as h, type DriveGrantActorHandleOptions as i, DriveGrantActorRegistry as j, type DriveGrantActorState as k, type DriveGrantClose as l, type DriveGrantDial as m, type DriveGrantConnectionKey as n, type DriveGrantLogicalChannelHandle as o, type DriveGrantPreferredTransport as p, driveGrantConnectionKey as q, driveGrantConnectionKeyToString as r };
|
package/dist/auth/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{H as authHost,G as getAuthHost,F as registerDesktopAuthRelay}from'../chunk-
|
|
1
|
+
export{H as authHost,G as getAuthHost,F as registerDesktopAuthRelay}from'../chunk-HVTYSEU7.js';import'../chunk-C7YN5MSV.js';
|
package/dist/auth/internal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{F as registerDesktopAuthRelay}from'../chunk-
|
|
1
|
+
export{F as registerDesktopAuthRelay}from'../chunk-HVTYSEU7.js';import'../chunk-C7YN5MSV.js';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
type RuntimeAdapterKind = 'browser-wasm' | 'native-ipc' | 'tauri-ipc' | 'unknown';
|
|
2
|
+
interface RuntimeCapabilities {
|
|
3
|
+
adapter: RuntimeAdapterKind;
|
|
4
|
+
signaling: {
|
|
5
|
+
firestore: boolean;
|
|
6
|
+
nativeIpc: boolean;
|
|
7
|
+
rtdbPresence: boolean;
|
|
8
|
+
};
|
|
9
|
+
transport: {
|
|
10
|
+
irohQuic: boolean;
|
|
11
|
+
irohLan: boolean;
|
|
12
|
+
webRtcUpgrade: boolean;
|
|
13
|
+
webRtcLan: boolean;
|
|
14
|
+
nativeWebRtc: boolean;
|
|
15
|
+
moq: boolean;
|
|
16
|
+
ble: boolean;
|
|
17
|
+
wasm: boolean;
|
|
18
|
+
};
|
|
19
|
+
nativeProtocols: {
|
|
20
|
+
productAlpn: boolean;
|
|
21
|
+
irohDocs: boolean;
|
|
22
|
+
irohBlobs: boolean;
|
|
23
|
+
irohGossip: boolean;
|
|
24
|
+
};
|
|
25
|
+
lifecycle: {
|
|
26
|
+
managedSession: boolean;
|
|
27
|
+
autoConnect: boolean;
|
|
28
|
+
manualDisconnect: boolean;
|
|
29
|
+
connectionStateEvents: boolean;
|
|
30
|
+
peerSessions: boolean;
|
|
31
|
+
};
|
|
32
|
+
transfers: {
|
|
33
|
+
explicitFilePath: boolean;
|
|
34
|
+
explicitFileData: boolean;
|
|
35
|
+
history: boolean;
|
|
36
|
+
};
|
|
37
|
+
fallback: {
|
|
38
|
+
wasm: boolean;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
interface RuntimeCapabilityProfile {
|
|
42
|
+
environment: 'web' | 'native' | 'unknown';
|
|
43
|
+
transports: {
|
|
44
|
+
quic: boolean;
|
|
45
|
+
irohRelay: boolean;
|
|
46
|
+
irohLan: boolean;
|
|
47
|
+
webRtc: boolean;
|
|
48
|
+
webRtcLan: boolean;
|
|
49
|
+
moq: boolean;
|
|
50
|
+
ble: boolean;
|
|
51
|
+
};
|
|
52
|
+
lifecycle: RuntimeCapabilities['lifecycle'];
|
|
53
|
+
storage: {
|
|
54
|
+
localFileSystem: boolean;
|
|
55
|
+
transferHistory: boolean;
|
|
56
|
+
};
|
|
57
|
+
nativeProtocols: RuntimeCapabilities['nativeProtocols'];
|
|
58
|
+
}
|
|
59
|
+
interface NativeRuntimeTransportFeatureStatus {
|
|
60
|
+
compiled?: boolean;
|
|
61
|
+
enabled?: boolean;
|
|
62
|
+
}
|
|
63
|
+
interface NativeRuntimeStatusSnapshot {
|
|
64
|
+
ready?: boolean;
|
|
65
|
+
nodeId?: string | null;
|
|
66
|
+
node_id?: string | null;
|
|
67
|
+
transport?: {
|
|
68
|
+
irohQuic?: NativeRuntimeTransportFeatureStatus;
|
|
69
|
+
irohLan?: NativeRuntimeTransportFeatureStatus;
|
|
70
|
+
webRtc?: NativeRuntimeTransportFeatureStatus;
|
|
71
|
+
webRtcLan?: NativeRuntimeTransportFeatureStatus;
|
|
72
|
+
moq?: NativeRuntimeTransportFeatureStatus;
|
|
73
|
+
ble?: NativeRuntimeTransportFeatureStatus;
|
|
74
|
+
irohRelayOnly?: boolean;
|
|
75
|
+
irohRelayTransportPolicy?: string | null;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
declare const BROWSER_WASM_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
79
|
+
/**
|
|
80
|
+
* The small host surface that browser WebRTC capability reporting needs.
|
|
81
|
+
*
|
|
82
|
+
* This is deliberately a feature check only: capability reporting must not
|
|
83
|
+
* create a peer connection, probe ICE, or influence route ownership.
|
|
84
|
+
*/
|
|
85
|
+
interface BrowserRuntimeCapabilityHost {
|
|
86
|
+
RTCPeerConnection?: unknown;
|
|
87
|
+
}
|
|
88
|
+
declare const NATIVE_IPC_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
89
|
+
declare function cloneRuntimeCapabilities(capabilities: RuntimeCapabilities): RuntimeCapabilities;
|
|
90
|
+
/**
|
|
91
|
+
* Returns browser/WASM capabilities for a concrete JavaScript host.
|
|
92
|
+
*
|
|
93
|
+
* The static browser baseline describes package support. WebRTC additionally
|
|
94
|
+
* requires the browser primitive to exist at runtime. Passing the host keeps
|
|
95
|
+
* the resolver deterministic in SSR and test environments.
|
|
96
|
+
*/
|
|
97
|
+
declare function runtimeCapabilitiesForBrowserHost(host?: BrowserRuntimeCapabilityHost | null | undefined): RuntimeCapabilities;
|
|
98
|
+
declare function runtimeCapabilitiesFromNativeStatus(status: NativeRuntimeStatusSnapshot | null | undefined, allowWasmFallback?: boolean): RuntimeCapabilities;
|
|
99
|
+
declare function runtimeCapabilityProfile(capabilities: RuntimeCapabilities): RuntimeCapabilityProfile;
|
|
100
|
+
|
|
101
|
+
export { BROWSER_WASM_RUNTIME_CAPABILITIES as B, NATIVE_IPC_RUNTIME_CAPABILITIES as N, type RuntimeCapabilities as R, type RuntimeCapabilityProfile as a, type RuntimeAdapterKind as b, type BrowserRuntimeCapabilityHost as c, type NativeRuntimeStatusSnapshot as d, type NativeRuntimeTransportFeatureStatus as e, cloneRuntimeCapabilities as f, runtimeCapabilitiesFromNativeStatus as g, runtimeCapabilityProfile as h, runtimeCapabilitiesForBrowserHost as r };
|