openrtc 0.2.0 → 1.0.0
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/LICENSE +92 -0
- package/README.md +100 -10
- package/dist/{DelegatingRuntimeAdapter-CjHzBEBA.d.ts → DelegatingRuntimeAdapter-By7pziBs.d.ts} +36 -15
- package/dist/IEngineBridge-C7OT2CRv.d.ts +10 -0
- package/dist/{IpcRuntimeAdapter-CtckyMol.d.ts → IpcRuntimeAdapter-DymXAsNU.d.ts} +6 -3
- package/dist/auth/index.js +1 -1
- package/dist/auth/internal.js +1 -1
- package/dist/chunk-3KDNLXT6.js +3 -0
- package/dist/chunk-5RXNKNPH.js +2 -0
- package/dist/chunk-6TIOSMVJ.js +1 -0
- package/dist/chunk-BLOEZIFJ.js +1 -0
- package/dist/chunk-CK6WQV7J.js +1 -0
- package/dist/chunk-KH227SE4.js +1 -0
- package/dist/chunk-KYDLXXNM.js +1 -0
- package/dist/chunk-W5JHUOK5.js +2 -0
- package/dist/device-status-nkXepu97.d.ts +560 -0
- package/dist/{factories-CwZiIRg1.d.ts → framing-BUtu0oZK.d.ts} +47 -520
- package/dist/index.d.ts +113 -9
- package/dist/index.js +2 -2
- package/dist/openrtc_bg.wasm +0 -0
- package/dist/runtime/WasmRuntimeAdapter.d.ts +3 -2
- package/dist/runtime/WasmRuntimeAdapter.js +1 -1
- package/dist/runtime/device-status.d.ts +3 -0
- package/dist/runtime/device-status.js +1 -0
- package/dist/runtime/index.d.ts +94 -84
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/tauri.d.ts +4 -3
- package/dist/runtime/tauri.js +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/{types-DyCGvj9l.d.ts → types-CzIpGV9x.d.ts} +117 -14
- package/package.json +22 -10
- package/dist/chunk-3VTF5RKW.js +0 -1
- package/dist/chunk-JXGKO7SX.js +0 -1
- package/dist/chunk-MFT6SOZ6.js +0 -3
- package/dist/chunk-SGZWR63E.js +0 -1
- package/dist/chunk-VARALO7G.js +0 -1
- package/dist/chunk-WOHFM6DI.js +0 -2
- package/dist/chunk-YHJOXD46.js +0 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Required Notice: Copyright (c) 2026 Bryant Hargreaves and OpenRTC contributors.
|
|
2
|
+
Licensor Line of Business: OpenRTC realtime collaboration runtime, SDKs, developer services, and related tools (https://openrtc.app)
|
|
3
|
+
|
|
4
|
+
# PolyForm Shield License 1.0.0
|
|
5
|
+
|
|
6
|
+
<https://polyformproject.org/licenses/shield/1.0.0>
|
|
7
|
+
|
|
8
|
+
## Acceptance
|
|
9
|
+
|
|
10
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
11
|
+
|
|
12
|
+
## Copyright License
|
|
13
|
+
|
|
14
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
15
|
+
|
|
16
|
+
## Distribution License
|
|
17
|
+
|
|
18
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
19
|
+
|
|
20
|
+
## Notices
|
|
21
|
+
|
|
22
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
23
|
+
|
|
24
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
25
|
+
|
|
26
|
+
## Changes and New Works License
|
|
27
|
+
|
|
28
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
29
|
+
|
|
30
|
+
## Patent License
|
|
31
|
+
|
|
32
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
33
|
+
|
|
34
|
+
## Noncompete
|
|
35
|
+
|
|
36
|
+
Any purpose is a permitted purpose, except for providing any product that competes with the software or any product the licensor or any of its affiliates provides using the software.
|
|
37
|
+
|
|
38
|
+
## Competition
|
|
39
|
+
|
|
40
|
+
Goods and services compete even when they provide functionality through different kinds of interfaces or for different technical platforms. Applications can compete with services, libraries with plugins, frameworks with development tools, and so on, even if they're written in different programming languages or for different computer architectures. Goods and services compete even when provided free of charge. If you market a product as a practical substitute for the software or another product, it definitely competes.
|
|
41
|
+
|
|
42
|
+
## New Products
|
|
43
|
+
|
|
44
|
+
If you are using the software to provide a product that does not compete, but the licensor or any of its affiliates brings your product into competition by providing a new version of the software or another product using the software, you may continue using versions of the software available under these terms beforehand to provide your competing product, but not any later versions.
|
|
45
|
+
|
|
46
|
+
## Discontinued Products
|
|
47
|
+
|
|
48
|
+
You may begin using the software to compete with a product or service that the licensor or any of its affiliates has stopped providing, unless the licensor includes a plain-text line beginning with `Licensor Line of Business:` with the software that mentions that line of business. For example:
|
|
49
|
+
|
|
50
|
+
> Licensor Line of Business: YoyodyneCMS Content Management System (http://example.com/cms)
|
|
51
|
+
|
|
52
|
+
## Sales of Business
|
|
53
|
+
|
|
54
|
+
If the licensor or any of its affiliates sells a line of business developing the software or using the software to provide a product, the buyer can also enforce [Noncompete](#noncompete) for that product.
|
|
55
|
+
|
|
56
|
+
## Fair Use
|
|
57
|
+
|
|
58
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
59
|
+
|
|
60
|
+
## No Other Rights
|
|
61
|
+
|
|
62
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
63
|
+
|
|
64
|
+
## Patent Defense
|
|
65
|
+
|
|
66
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
67
|
+
|
|
68
|
+
## Violations
|
|
69
|
+
|
|
70
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
71
|
+
|
|
72
|
+
## No Liability
|
|
73
|
+
|
|
74
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
75
|
+
|
|
76
|
+
## Definitions
|
|
77
|
+
|
|
78
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
79
|
+
|
|
80
|
+
A **product** can be a good or service, or a combination of them.
|
|
81
|
+
|
|
82
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
83
|
+
|
|
84
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all its affiliates.
|
|
85
|
+
|
|
86
|
+
**Affiliates** means the other organizations than an organization has control over, is under the control of, or is under common control with.
|
|
87
|
+
|
|
88
|
+
**Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
89
|
+
|
|
90
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
91
|
+
|
|
92
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
package/README.md
CHANGED
|
@@ -8,27 +8,40 @@ It does not implement a second realtime engine. It exposes the Rust runtime to:
|
|
|
8
8
|
|
|
9
9
|
## Recommended Usage
|
|
10
10
|
|
|
11
|
-
Use the OpenRTC client entry points for new integrations
|
|
11
|
+
Use the OpenRTC client entry points for new integrations, and choose the
|
|
12
|
+
avenue that matches your product:
|
|
13
|
+
|
|
14
|
+
- `user-scoped` for a signed-in user's durable device mesh
|
|
15
|
+
- `space` for a small live shared namespace
|
|
16
|
+
- rooms for intentional group membership
|
|
17
|
+
- tickets/share grants for explicit one-off pairing without a roster
|
|
12
18
|
|
|
13
19
|
```ts
|
|
14
20
|
import { OpenRTC } from 'openrtc';
|
|
15
21
|
|
|
16
22
|
const client = OpenRTC({
|
|
17
23
|
apiKey: 'pk_live_...',
|
|
24
|
+
discoveryMode: 'user-scoped',
|
|
18
25
|
authMode: 'external',
|
|
19
26
|
});
|
|
20
27
|
|
|
21
28
|
await client.connect();
|
|
29
|
+
await client.devices.startSession({
|
|
30
|
+
deviceName: 'Work Laptop',
|
|
31
|
+
});
|
|
22
32
|
```
|
|
23
33
|
|
|
24
34
|
For normal app code, the default flow is:
|
|
25
35
|
|
|
26
|
-
1. discover or select a
|
|
27
|
-
2.
|
|
28
|
-
3.
|
|
29
|
-
4. open app channel streams with `client.channels.openBi(...)` / `client.channels.openUni(...)`
|
|
36
|
+
1. discover or select a device
|
|
37
|
+
2. open a named logical app channel with `client.channels.connect({ device, channelId })`
|
|
38
|
+
3. send and receive app payloads on that channel
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
`channels.connect(...)` owns the peer dial, readiness wait, channel selection,
|
|
41
|
+
roster-ticket reuse, and default `session` lifecycle scope. Use `client.peers.connect(...)`,
|
|
42
|
+
`client.channels.openBi(...)`, `connectScoped(...)`, `openPeerBi(...)`, or
|
|
43
|
+
`openPeerUni(...)` only when you need explicit lifecycle, stream, or transport
|
|
44
|
+
control.
|
|
32
45
|
|
|
33
46
|
## Naming Guide
|
|
34
47
|
|
|
@@ -51,7 +64,25 @@ const client = OpenRTC({
|
|
|
51
64
|
|
|
52
65
|
- Use `space` instead of `spaceKey` in app code.
|
|
53
66
|
- Use `spaceTokenProvider` and `spaceToken(...)` for scoped shared-space auth.
|
|
54
|
-
- Use `client.devices.*`, `client.
|
|
67
|
+
- Use `client.devices.*`, `client.rooms.*`, `client.tickets.*`,
|
|
68
|
+
`client.channels.*`, and `client.peers.*` before reaching for lower-level
|
|
69
|
+
runtime names.
|
|
70
|
+
|
|
71
|
+
## Discovery Avenues
|
|
72
|
+
|
|
73
|
+
OpenRTC discovery is not one generic live device list:
|
|
74
|
+
|
|
75
|
+
- User-scope/user-device is the persistent owned-device avenue. Devices remain
|
|
76
|
+
visible while `presenceStatus` degrades `online` -> `idle` -> `offline`, and
|
|
77
|
+
are removed only by explicit deletion or offline retention expiry.
|
|
78
|
+
- Spaces and rooms are ephemeral collaboration avenues. Active rosters may
|
|
79
|
+
filter or clean up stale entries.
|
|
80
|
+
- Ticket-only/share flows do not use a hosted discovery roster; the ticket or
|
|
81
|
+
grant is the bootstrap avenue.
|
|
82
|
+
|
|
83
|
+
Status-aware device APIs should preserve presence-only changes and merge
|
|
84
|
+
authoritative roster refreshes with live watch state so no avenue-specific
|
|
85
|
+
device disappears just because one read model missed it.
|
|
55
86
|
|
|
56
87
|
## What This Package Owns
|
|
57
88
|
- runtime factories and adapters
|
|
@@ -77,17 +108,37 @@ Those responsibilities belong to the Rust runtime and the host platform adapter.
|
|
|
77
108
|
|
|
78
109
|
The recommended TypeScript extension path is:
|
|
79
110
|
|
|
80
|
-
1.
|
|
81
|
-
2. open a
|
|
111
|
+
1. choose the public avenue (`user-scoped`, `space`, room, or ticket/share)
|
|
112
|
+
2. open a named logical channel with `client.channels.connect(...)`
|
|
82
113
|
3. implement your own framing and message semantics in app code
|
|
83
114
|
|
|
84
115
|
This keeps the runtime responsible for peer/session establishment while leaving
|
|
85
116
|
full control of channel/message specifics to the developer.
|
|
86
117
|
|
|
118
|
+
Register a `RuntimeChannelDescriptor` with `client.channels.register(...)` and
|
|
119
|
+
install one process-level `client.channels.onIncomingChannel(...)` handler when
|
|
120
|
+
the protocol needs explicit readiness, routing, or framing metadata. This is an
|
|
121
|
+
application protocol extension. It does not replace the incoming router or
|
|
122
|
+
grant authority over admission, peer scopes, dialing, retry, transport
|
|
123
|
+
promotion, recovery, or settlement.
|
|
124
|
+
|
|
125
|
+
`OpenRTCClient` still inherits `RuntimeClient` compatibility methods, and
|
|
126
|
+
`openrtc/runtime`, `client.peers.addScope()` / `releaseScope()`, and
|
|
127
|
+
`client.advanced` expose authority-capable manual surfaces. They are not the
|
|
128
|
+
recommended extension model and must not be used to build a parallel lifecycle.
|
|
129
|
+
Their narrowing is future-version work.
|
|
130
|
+
|
|
87
131
|
Advanced custom ALPN protocol plugins are a Rust-first/native-first feature.
|
|
88
132
|
Browser parity is guaranteed at the connected-peer stream layer, not at the
|
|
89
133
|
full ALPN plugin layer.
|
|
90
134
|
|
|
135
|
+
For applications that want a reusable file protocol without making it part of
|
|
136
|
+
the core runtime, install `openrtc-file-transfer`. It implements versioned,
|
|
137
|
+
bounded file framing, acknowledgement, progress, cancellation, optional
|
|
138
|
+
integrity verification, and streaming receive sinks over `client.channels`.
|
|
139
|
+
Filesystem destinations, persistent queues, history, acceptance prompts, and
|
|
140
|
+
product policy remain consumer-owned.
|
|
141
|
+
|
|
91
142
|
## Main Surfaces
|
|
92
143
|
|
|
93
144
|
### Root Package
|
|
@@ -106,15 +157,54 @@ full ALPN plugin layer.
|
|
|
106
157
|
- `openrtc-tauri`
|
|
107
158
|
- `createTauriIpcBridge()`
|
|
108
159
|
- `TauriRuntimeAdapter`
|
|
160
|
+
- Rust plugin crate: `openrtc-tauri-plugin`
|
|
109
161
|
- `openrtc/runtime/tauri` remains as a deprecated compatibility shim for one release cycle
|
|
110
162
|
|
|
163
|
+
For Tauri desktop/mobile apps, use `OpenRTC.native(options)` with the
|
|
164
|
+
`openrtc-tauri` bridge and register `openrtc-tauri-plugin` in the Rust Tauri
|
|
165
|
+
builder. Do not copy product-owned RTC command files into new apps. The plugin
|
|
166
|
+
owns the native IPC command set and delegates lifecycle, discovery, presence,
|
|
167
|
+
auto-connect, and connection state to one `openrtc::client::Client`. Do not use
|
|
168
|
+
`OpenRTC(options)` inside a Tauri shell unless you intentionally want the
|
|
169
|
+
browser/WASM runtime for a prototype; that path bypasses the native Rust runtime
|
|
170
|
+
and can hide native lifecycle/presence issues from tests.
|
|
171
|
+
|
|
172
|
+
Mobile hosts should forward connectivity-restored callbacks through
|
|
173
|
+
`client.advanced.notifyNetworkChange(reason)`. The Tauri plugin passes this hint
|
|
174
|
+
to the existing Iroh endpoint so it can reconsider relay and direct paths; it
|
|
175
|
+
does not create a second OpenRTC dial or retry loop.
|
|
176
|
+
|
|
111
177
|
## Auth Model
|
|
112
178
|
- `anonymous`: no Pluto auth required
|
|
113
179
|
- `required`: Pluto auth required; the SDK may initiate Pluto SSO
|
|
114
180
|
- `external`: Pluto auth still required, but the host app acquires it and injects it into the runtime
|
|
115
181
|
|
|
182
|
+
## Security Boundary
|
|
183
|
+
|
|
184
|
+
Iroh authenticates endpoint keys and encrypts transport traffic. OpenRTC's
|
|
185
|
+
managed avenues add scoped session-token admission and application payload
|
|
186
|
+
encryption. These protections are cumulative: transport connectivity alone is
|
|
187
|
+
not permission to invoke a product action.
|
|
188
|
+
|
|
189
|
+
- Prefer `client.devices`, `client.rooms`, `client.tickets`, and
|
|
190
|
+
`client.channels` managed flows; they retain admission and protected-route
|
|
191
|
+
checks across transport replacement.
|
|
192
|
+
- Treat raw endpoint tickets and low-level manual peer APIs as transport
|
|
193
|
+
primitives. A consumer using them must define its own authorization boundary.
|
|
194
|
+
- Authorize every privileged message against the accepted OpenRTC scope and the
|
|
195
|
+
consumer application's current ACL. Never trust a payload's self-declared
|
|
196
|
+
sender, role, or scope.
|
|
197
|
+
- Keep compound tickets and session tokens out of logs, telemetry, query
|
|
198
|
+
strings, crash reports, and UI diagnostics. Use URL fragments for intentional
|
|
199
|
+
browser handoff and scrub them immediately after capture.
|
|
200
|
+
- Revocation must invalidate the matching scope and product ACL; reconnecting a
|
|
201
|
+
transport must not restore revoked access.
|
|
202
|
+
|
|
203
|
+
The full owner and release contract is in
|
|
204
|
+
[`docs/architecture/application-security-and-delivery-contract.md`](../../docs/architecture/application-security-and-delivery-contract.md).
|
|
205
|
+
|
|
116
206
|
## Design Rule
|
|
117
|
-
If a feature requires discovery, signaling, presence, or lifecycle state, the TypeScript package should delegate to Rust rather than reimplement it locally, except for the scoped browser Firebase host layer where the official browser SDK is the source of truth.
|
|
207
|
+
If a feature requires discovery, signaling, presence, or lifecycle state, the TypeScript package should delegate to Rust rather than reimplement it locally, except for the scoped browser Firebase host layer where the official browser SDK is the source of truth. In both cases, keep the avenue semantics intact: persistent user-device rosters are not space/room live rosters.
|
|
118
208
|
|
|
119
209
|
## Allowed vs. Not Allowed
|
|
120
210
|
|
package/dist/{DelegatingRuntimeAdapter-CjHzBEBA.d.ts → DelegatingRuntimeAdapter-By7pziBs.d.ts}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { D as DiscoveryMode, A as AuthMode, S as SignalingMode, E as ExplicitFileDataSendParams, I as ISignalingBackend, R as RuntimeIdentity, a as Device, b as DeviceStatusSnapshot, P as PeerSessionSnapshot, c as ResolvedPeerIdentity, M as ManagedConnectionRecord, d as SignalingEnvelope, e as DeviceEvent, f as SignalingSession, g as SessionEvent, L as LocalDeviceInfo, N as NativeManagedSessionStartResult, G as GrantScope, B as BackendPeerBiStream, h as BackendPeerUniStream, i as
|
|
1
|
+
import { D as DiscoveryMode, A as AuthMode, S as SignalingMode, E as ExplicitFileDataSendParams, I as ISignalingBackend, R as RuntimeIdentity, a as Device, b as DeviceStatusSnapshot, P as PeerSessionSnapshot, c as ResolvedPeerIdentity, M as ManagedConnectionRecord, d as SignalingEnvelope, e as DeviceEvent, f as SignalingSession, g as SessionEvent, L as LocalDeviceInfo, N as NativeManagedSessionStartResult, G as GrantScope, B as BackendPeerBiStream, h as BackendPeerUniStream, i as NativeConnectParams, j as NativeConnectResult, k as BackendConnectionState } from './types-CzIpGV9x.js';
|
|
2
|
+
import { A as AuthContext } from './IEngineBridge-C7OT2CRv.js';
|
|
2
3
|
|
|
3
4
|
type RuntimeAdapterKind = 'browser-wasm' | 'native-ipc' | 'tauri-ipc' | 'unknown';
|
|
4
5
|
interface RuntimeCapabilities {
|
|
@@ -58,28 +59,42 @@ interface RuntimeCapabilityProfile {
|
|
|
58
59
|
};
|
|
59
60
|
nativeProtocols: RuntimeCapabilities['nativeProtocols'];
|
|
60
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
|
+
}
|
|
61
81
|
declare const BROWSER_WASM_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
62
82
|
declare const NATIVE_IPC_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
63
83
|
declare function cloneRuntimeCapabilities(capabilities: RuntimeCapabilities): RuntimeCapabilities;
|
|
84
|
+
declare function runtimeCapabilitiesFromNativeStatus(status: NativeRuntimeStatusSnapshot | null | undefined, allowWasmFallback?: boolean): RuntimeCapabilities;
|
|
64
85
|
declare function runtimeCapabilityProfile(capabilities: RuntimeCapabilities): RuntimeCapabilityProfile;
|
|
65
86
|
|
|
66
|
-
type AuthContext = {
|
|
67
|
-
userId: string;
|
|
68
|
-
token?: string | null;
|
|
69
|
-
refreshToken?: string | null;
|
|
70
|
-
customToken?: string | null;
|
|
71
|
-
tokenProvider?: (forceRefresh?: boolean) => Promise<string | null>;
|
|
72
|
-
expiresAtMs?: number | null;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
87
|
interface WasmBridgeOptions {
|
|
76
88
|
apiKey?: string;
|
|
77
89
|
discoveryMode?: DiscoveryMode;
|
|
90
|
+
space?: string;
|
|
78
91
|
spaceKey?: string;
|
|
79
92
|
authMode?: AuthMode;
|
|
80
93
|
signalingMode?: SignalingMode;
|
|
81
94
|
projectId?: string;
|
|
82
95
|
storagePrefix?: string;
|
|
96
|
+
deviceIdPersistence?: 'persistent' | 'ephemeral';
|
|
97
|
+
endpointIdPersistence?: 'persistent' | 'ephemeral';
|
|
83
98
|
nodeIdPersistence?: 'persistent' | 'ephemeral';
|
|
84
99
|
localDeviceId?: string;
|
|
85
100
|
deviceName?: string;
|
|
@@ -101,6 +116,7 @@ declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
|
101
116
|
stopAuthScopedActivity(): Promise<void>;
|
|
102
117
|
getTurnCredentials(): Promise<any>;
|
|
103
118
|
updatePresence(localNodeId: string, ticketStr: string, isOnline: boolean, ttlMs: number, metadata?: string): Promise<void>;
|
|
119
|
+
refreshLivePresence(localNodeId: string, ticketStr: string, metadata?: string): Promise<void>;
|
|
104
120
|
setOffline(localNodeId: string): Promise<void>;
|
|
105
121
|
cleanupStaleDevices(): Promise<void>;
|
|
106
122
|
searchDevices(excludeNodeId?: string): Promise<Device[]>;
|
|
@@ -140,6 +156,9 @@ declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
|
140
156
|
autoConnect?: boolean;
|
|
141
157
|
presence?: boolean;
|
|
142
158
|
}): Promise<NativeManagedSessionStartResult>;
|
|
159
|
+
notifyNetworkChange(options?: {
|
|
160
|
+
reason?: string;
|
|
161
|
+
}): Promise<unknown>;
|
|
143
162
|
getManagedNodeId(options?: {
|
|
144
163
|
initializeIfMissing?: boolean;
|
|
145
164
|
}): Promise<string | null>;
|
|
@@ -150,20 +169,22 @@ declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
|
150
169
|
registerSessionToken(token: string, scope: GrantScope, maxConnections: number): Promise<void>;
|
|
151
170
|
revokeSessionTokensByScope(scope: GrantScope): Promise<string[]>;
|
|
152
171
|
openPeerBi(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
172
|
+
incoming_streams(): Promise<ReadableStream<unknown>>;
|
|
153
173
|
openPeerNativeBi(id: string, label: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
154
174
|
openPeerBiTransportOnly(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
155
175
|
openPeerUni(id: string, timeoutMs?: number): Promise<BackendPeerUniStream>;
|
|
156
|
-
connectToDevice(params:
|
|
157
|
-
deviceId?: string | null;
|
|
158
|
-
endpointTicket: string;
|
|
159
|
-
}): Promise<NativeConnectResult>;
|
|
176
|
+
connectToDevice(params: NativeConnectParams): Promise<NativeConnectResult>;
|
|
160
177
|
disconnectDevice(deviceId: string): Promise<void>;
|
|
161
178
|
isConnected(nodeId: string): Promise<boolean>;
|
|
162
179
|
getConnectionStates(): Promise<BackendConnectionState[]>;
|
|
163
180
|
onConnectionStateChange(callback: (state: BackendConnectionState) => void): Promise<() => void> | (() => void);
|
|
181
|
+
/** @deprecated Use named channels or `openrtc-file-transfer`. */
|
|
164
182
|
sendExplicitFilePath(connectionId: string, filePath: string, transferId?: string): Promise<string>;
|
|
183
|
+
/** @deprecated Use named channels or `openrtc-file-transfer`. */
|
|
165
184
|
sendExplicitFileData(params: ExplicitFileDataSendParams): Promise<void>;
|
|
185
|
+
/** @deprecated Transfer history belongs to the consumer application. */
|
|
166
186
|
getTransferHistory(limit?: number): Promise<Array<[string, unknown]>>;
|
|
187
|
+
/** @deprecated Transfer history belongs to the consumer application. */
|
|
167
188
|
deleteTransferJob(jobId: string): Promise<void>;
|
|
168
189
|
getRuntimeCapabilities(): RuntimeCapabilities;
|
|
169
190
|
onIncomingNativeMessage(callback: (connectionId: string, remoteNodeId: string | null, message: any) => void): Promise<() => void>;
|
|
@@ -177,4 +198,4 @@ declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
|
177
198
|
setCoreClient(client: unknown): void;
|
|
178
199
|
}
|
|
179
200
|
|
|
180
|
-
export {
|
|
201
|
+
export { BROWSER_WASM_RUNTIME_CAPABILITIES as B, DelegatingRuntimeAdapter as D, NATIVE_IPC_RUNTIME_CAPABILITIES as N, type RuntimeCapabilities as R, type WasmBridgeOptions as W, type RuntimeCapabilityProfile as a, type RuntimeAdapterKind as b, type NativeRuntimeStatusSnapshot as c, type NativeRuntimeTransportFeatureStatus as d, cloneRuntimeCapabilities as e, runtimeCapabilityProfile as f, runtimeCapabilitiesFromNativeStatus as r };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type AuthContext = {
|
|
2
|
+
userId: string;
|
|
3
|
+
token?: string | null;
|
|
4
|
+
refreshToken?: string | null;
|
|
5
|
+
customToken?: string | null;
|
|
6
|
+
tokenProvider?: (forceRefresh?: boolean) => Promise<string | null>;
|
|
7
|
+
expiresAtMs?: number | null;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type { AuthContext as A };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientOptions } from './types-
|
|
2
|
-
import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-
|
|
1
|
+
import { C as ClientOptions } from './types-CzIpGV9x.js';
|
|
2
|
+
import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-By7pziBs.js';
|
|
3
3
|
|
|
4
4
|
type PlutoIpcUnlisten = () => void | Promise<void>;
|
|
5
5
|
interface PlutoIpcBridge {
|
|
@@ -7,6 +7,9 @@ interface PlutoIpcBridge {
|
|
|
7
7
|
listen<T = unknown>(event: string, handler: (payload: T) => void): Promise<PlutoIpcUnlisten>;
|
|
8
8
|
isAvailable?(): boolean | Promise<boolean>;
|
|
9
9
|
}
|
|
10
|
+
type NativeIpcFailureKind = 'command-unavailable' | 'runtime-unavailable' | 'timeout' | 'unknown';
|
|
11
|
+
declare function classifyNativeIpcFailure(error: unknown): NativeIpcFailureKind;
|
|
12
|
+
declare function isNativeIpcCommandUnavailable(error: unknown): boolean;
|
|
10
13
|
|
|
11
14
|
interface NativeIpcBridgeOptions extends WasmBridgeOptions {
|
|
12
15
|
allowWasmFallback?: boolean;
|
|
@@ -22,4 +25,4 @@ declare class IpcRuntimeAdapter extends DelegatingRuntimeAdapter {
|
|
|
22
25
|
constructor(options: IpcRuntimeAdapterOptions);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
export { IpcRuntimeAdapter as I, type NativeIpcBridgeOptions as N, type PlutoIpcBridge as P, type IpcRuntimeAdapterOptions as a, type
|
|
28
|
+
export { IpcRuntimeAdapter as I, type NativeIpcBridgeOptions as N, type PlutoIpcBridge as P, type IpcRuntimeAdapterOptions as a, type NativeIpcFailureKind as b, type PlutoIpcUnlisten as c, classifyNativeIpcFailure as d, isNativeIpcCommandUnavailable as i };
|
package/dist/auth/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{H as authHost,G as getAuthHost,F as registerDesktopAuthRelay}from'../chunk-W5JHUOK5.js';
|
package/dist/auth/internal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{F as registerDesktopAuthRelay}from'../chunk-W5JHUOK5.js';
|