openrtc 2.3.1 → 2.5.1

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.
Files changed (92) hide show
  1. package/README.md +77 -5
  2. package/dist/BrowserManagedBroadcastHost-ARCP5MGJ.js +1 -0
  3. package/dist/{ITransport-CjxCQ6q7.d.ts → Connection-CTpuImO-.d.ts} +610 -95
  4. package/dist/DelegatingRuntimeAdapter-D67Ozqo3.d.ts +154 -0
  5. package/dist/IpcRuntimeAdapter-Ddx0MtSI.d.ts +86 -0
  6. package/dist/WasmBridge-ZXBCXBBM.js +1 -0
  7. package/dist/{assembly-Bmi65-tK.d.ts → assembly-DvfsYFCL.d.ts} +41 -19
  8. package/dist/{capabilities-BPuynml5.d.ts → capabilities-CmzzxSvW.d.ts} +14 -7
  9. package/dist/chunk-2GX6GB6L.js +1 -0
  10. package/dist/chunk-2K47N3QP.js +2 -0
  11. package/dist/chunk-72NEEJQG.js +1 -0
  12. package/dist/chunk-AYHD4X2R.js +1 -0
  13. package/dist/chunk-BFN3AVHA.js +2 -0
  14. package/dist/chunk-BGWJHPBC.js +2 -0
  15. package/dist/chunk-CCCYE3XN.js +1 -0
  16. package/dist/chunk-EIJNERKZ.js +1 -0
  17. package/dist/chunk-FEF3DPPB.js +1 -0
  18. package/dist/chunk-GHAJW6SZ.js +2 -0
  19. package/dist/chunk-GTHSRQ7Y.js +2 -0
  20. package/dist/chunk-JPBW67B3.js +1 -0
  21. package/dist/chunk-LLZT3MR6.js +118 -0
  22. package/dist/chunk-N6LGTNUI.js +1 -0
  23. package/dist/{chunk-4MLJXEVV.js → chunk-NDR2ANQB.js} +1 -1
  24. package/dist/chunk-OT7IPLZE.js +1 -0
  25. package/dist/chunk-OWKAJPOI.js +1 -0
  26. package/dist/chunk-TYZS5LXQ.js +2 -0
  27. package/dist/chunk-VFDCIEP6.js +2 -0
  28. package/dist/chunk-VTYVIKTM.js +1 -0
  29. package/dist/chunk-XTYALGJN.js +2 -0
  30. package/dist/{chunk-KRJECX7X.js → chunk-Z4KJHIV5.js} +1 -1
  31. package/dist/chunk-Z54XUIKZ.js +1 -0
  32. package/dist/{controlPlane-KVFZ7BR5.js → controlPlane-IIPEJ77Q.js} +1 -1
  33. package/dist/coreClient.d.ts +3 -4
  34. package/dist/coreClient.js +1 -1
  35. package/dist/{deviceEnrollment-VACC64CQ.js → deviceEnrollment-ZQZ2WP5H.js} +2 -2
  36. package/dist/{deviceKey-Y35WSEQQ.js → deviceKey-EIMDBAQS.js} +1 -1
  37. package/dist/{dist-FIVA6EPA.js → dist-XO466BRG.js} +18 -0
  38. package/dist/index.d.ts +7 -7
  39. package/dist/index.js +1 -1
  40. package/dist/{ipc-CPnNwv6f.d.ts → ipc-DgzKqHH3.d.ts} +3 -0
  41. package/dist/ipcFactory-PRAJ7JP7.js +1 -0
  42. package/dist/native.d.ts +21 -0
  43. package/dist/native.js +1 -0
  44. package/dist/node-browser.d.ts +8 -0
  45. package/dist/node-browser.js +1 -0
  46. package/dist/node.d.ts +87 -0
  47. package/dist/node.js +2 -0
  48. package/dist/openrtc-VCS6V3AN.js +2 -0
  49. package/dist/openrtc_bg.wasm +0 -0
  50. package/dist/protocol-BSBjMb7p.d.ts +6 -0
  51. package/dist/room-ULZ2FGWV.js +1 -0
  52. package/dist/runtime/WasmRuntimeAdapter.d.ts +4 -5
  53. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  54. package/dist/runtime/device-status.d.ts +1 -2
  55. package/dist/runtime/factories.d.ts +352 -8
  56. package/dist/runtime/factories.js +1 -1
  57. package/dist/runtime/index.d.ts +15 -161
  58. package/dist/runtime/index.js +1 -1
  59. package/dist/server-browser.d.ts +14 -0
  60. package/dist/server-browser.js +1 -0
  61. package/dist/server.d.ts +44 -0
  62. package/dist/server.js +2 -0
  63. package/dist/service-node.d.ts +155 -0
  64. package/dist/service-node.js +1 -0
  65. package/dist/testing/native.d.ts +11 -0
  66. package/dist/testing/native.js +1 -0
  67. package/dist/testing.d.ts +47 -20
  68. package/dist/testing.js +1 -1
  69. package/dist/transport/index.d.ts +7 -18
  70. package/dist/transport/index.js +1 -1
  71. package/dist/types-Cyc-mPjk.d.ts +650 -0
  72. package/package.json +35 -3
  73. package/dist/DelegatingRuntimeAdapter-DE4LTGAJ.d.ts +0 -399
  74. package/dist/IpcRuntimeAdapter-CE0va9Tr.d.ts +0 -19
  75. package/dist/WasmBridge-75F6GKHG.js +0 -1
  76. package/dist/chunk-2L6ULC32.js +0 -1
  77. package/dist/chunk-2SUSPEC4.js +0 -1
  78. package/dist/chunk-7BJKDBLP.js +0 -2
  79. package/dist/chunk-AJQVMVYW.js +0 -1
  80. package/dist/chunk-BOS554IK.js +0 -2
  81. package/dist/chunk-HEAJ7ZUR.js +0 -1
  82. package/dist/chunk-HUG5AX7R.js +0 -1
  83. package/dist/chunk-Q6KXVTSH.js +0 -2
  84. package/dist/chunk-R35AWMNY.js +0 -1
  85. package/dist/chunk-UILOGUOU.js +0 -1
  86. package/dist/chunk-WA434EWD.js +0 -2
  87. package/dist/chunk-XAL4T6TB.js +0 -3
  88. package/dist/chunk-Z2IS6NH2.js +0 -2
  89. package/dist/ipcFactory-32R47AVK.js +0 -1
  90. package/dist/openrtc-MWLNTJI7.js +0 -2
  91. package/dist/types--jQzenZR.d.ts +0 -295
  92. package/dist/types-DDhMQkK8.d.ts +0 -621
@@ -1,295 +0,0 @@
1
- import { PeerNamespace, ChannelNamespace, DiagnosticsNamespace, DeviceNamespace } from './coreClient.js';
2
- import { C as ChannelDescriptor } from './types-DDhMQkK8.js';
3
- import { P as PlutoIrohConfiguration, a as PlutoRTCConfiguration, b as PlutoMoQConfiguration, R as RouteOptimization, c as ProtocolName } from './ITransport-CjxCQ6q7.js';
4
-
5
- interface AuthProvider {
6
- /** Registered provider ID from the developer app capability manifest. */
7
- readonly providerId?: string;
8
- /**
9
- * Stable, non-secret, local-only identifier for the currently signed-in
10
- * principal. It changes on login, logout, or account switch, but never for
11
- * an ordinary access-token refresh. OpenRTC hashes this value together
12
- * with the app and installation-key thumbprint before persisting a lookup.
13
- *
14
- * Optional because assertion-only providers remain valid, though they
15
- * cannot skip the assertion exchange on a cold process start.
16
- */
17
- getSessionKey?(): Promise<string | null>;
18
- getAssertion(input: {
19
- audience: 'https://api.openrtc.app/v2/assertions/exchange';
20
- forceRefresh: boolean;
21
- /**
22
- * Stable OpenRTC installation ID being enrolled. Consumer backends
23
- * may bind product admission (for example a paid device allowance) to
24
- * this value in the signed assertion. It is supplied only for an
25
- * enrollment/renewal assertion, never for hourly gateway refreshes.
26
- */
27
- deviceId: string;
28
- /**
29
- * Present only after OpenRTC receives the exact structured response
30
- * indicating that this installation ID is enrolled with another
31
- * public key. Consumer backends should require recent interactive
32
- * authentication before authorizing the replacement.
33
- */
34
- recoveryReason?: 'device-key-rotation';
35
- }): Promise<string | null>;
36
- /**
37
- * Optional identity-epoch observer. Notify only when the signed-in
38
- * principal/session changes (login, logout, account switch, or explicit
39
- * revocation). Do not notify for ordinary OAuth/Firebase access-token
40
- * refreshes: OpenRTC refreshes its own avenue grant in place.
41
- */
42
- subscribe?(listener: (event: {
43
- type: 'principal-changed';
44
- sessionKey: string | null;
45
- }) => void): () => void;
46
- }
47
- interface EnrolledDevice {
48
- deviceId: string;
49
- name?: string;
50
- platform?: string;
51
- enrolledAtMs: number | null;
52
- lastGrantAtMs: number | null;
53
- current: boolean;
54
- }
55
- /**
56
- * Public, non-secret presentation metadata for one enrolled installation.
57
- * OpenRTC derives a useful browser default when these fields are omitted;
58
- * native hosts should pass the OS/device information reported by their host.
59
- */
60
- interface DeviceProfile {
61
- /** Human-readable label such as `Bryant's iPhone` or `Chrome on Android`. */
62
- name?: string;
63
- /** Raw OS/runtime label such as `ios`, `android`, `macos`, or `web`. */
64
- platform?: string;
65
- /** Optional application-owned public presence metadata, bounded to 4 KiB. */
66
- metadata?: string;
67
- }
68
- interface AttestationProvider {
69
- readonly kind: 'firebase-app-check' | 'apple-app-attest' | 'play-integrity' | `custom:${string}`;
70
- /**
71
- * Describes what the provider actually signs. Reusable app-integrity
72
- * tokens (for example Firebase App Check) do not become request-bound just
73
- * because OpenRTC supplies an enrollment challenge. The server derives and
74
- * enforces the authoritative binding from the registered provider kind;
75
- * this field keeps host integrations and diagnostics honest.
76
- */
77
- readonly evidenceBinding: 'app-session' | 'request-challenge';
78
- getEvidence(input: {
79
- challenge: string;
80
- apiKey: string;
81
- }): Promise<{
82
- token: string;
83
- }>;
84
- }
85
- /**
86
- * Optional consumer-owned bot challenge. Core OpenRTC does not render a UI or
87
- * load a CAPTCHA dependency; the host supplies a fresh token only when its
88
- * developer manifest requires anonymous capability verification.
89
- */
90
- interface BotVerificationProvider {
91
- getToken(input: {
92
- action: 'openrtc_capability';
93
- apiKey: string;
94
- }): Promise<string>;
95
- }
96
- interface UsageUpdate {
97
- sessionCreditsUsd: number;
98
- operation: string;
99
- estimated: boolean;
100
- }
101
- interface UsageWarning extends UsageUpdate {
102
- thresholdCreditsUsd: number;
103
- kind: 'warning' | 'session-limit';
104
- }
105
- interface Transports {
106
- iroh?: boolean | PlutoIrohConfiguration;
107
- webrtc?: boolean | PlutoRTCConfiguration;
108
- /** Allow managed relay fallback. Defaults to true; set false for direct-only P2P. */
109
- relay?: boolean;
110
- moq?: boolean | PlutoMoQConfiguration;
111
- ble?: boolean;
112
- /**
113
- * Advanced privacy mode. `relay-only` suppresses direct Iroh addresses,
114
- * local discovery, and host/srflx WebRTC candidates. It also requires the
115
- * developer manifest's relay opt-in.
116
- */
117
- privacy?: 'direct' | 'relay-only';
118
- /** Optimize eligible routes for stability/cost or measured latency. */
119
- optimizeFor?: RouteOptimization;
120
- /**
121
- * Advanced native integration for hosts whose Rust process owns the
122
- * application protocol registry (for example, a Tauri file-transfer host).
123
- * Normal SDK consumers should leave this disabled.
124
- */
125
- nativeHostProtocols?: boolean;
126
- /** Exact route order. Unsupported routes are skipped, never treated as failures. */
127
- priority?: readonly ProtocolName[];
128
- }
129
- interface Options {
130
- apiKey: string;
131
- auth?: AuthProvider;
132
- trust?: {
133
- attestation?: AttestationProvider;
134
- botVerification?: BotVerificationProvider;
135
- };
136
- usage?: {
137
- warnAtSessionCreditsUsd?: number;
138
- maxSessionCreditsUsd?: number;
139
- onUsage?: (event: UsageUpdate) => void;
140
- onWarning?: (warning: UsageWarning) => void;
141
- };
142
- transports?: Transports;
143
- }
144
- type AccessMode = 'capability' | 'authenticated';
145
- type Delivery = 'reliable' | 'latest-state';
146
- interface Connection {
147
- readonly id: string;
148
- readonly peerId: string;
149
- send(message: unknown): Promise<void>;
150
- onMessage<T = unknown>(callback: (message: T) => void): () => void;
151
- onClose(callback: () => void): () => void;
152
- }
153
- interface Channel<T> {
154
- send(message: T): Promise<void>;
155
- sendTo(peerId: string, message: T): Promise<void>;
156
- onMessage(callback: (event: {
157
- peerId: string;
158
- message: T;
159
- }) => void): () => void;
160
- }
161
- interface State<T> {
162
- /** Replace the locally published value. Delivery is best-effort and coalesced. */
163
- set(value: T): void;
164
- /** A null value means the peer disconnected. */
165
- watch(callback: (event: {
166
- peerId: string;
167
- value: T | null;
168
- }) => void): () => void;
169
- }
170
- interface Avenue {
171
- readonly kind: 'devices' | 'space' | 'room' | 'ticket';
172
- readonly id: string;
173
- readonly peers: PeerNamespace;
174
- readonly channels: ChannelNamespace;
175
- readonly diagnostics: DiagnosticsNamespace;
176
- readonly closed: boolean;
177
- state<T>(name: string): State<T>;
178
- channel<T>(name: string): Channel<T>;
179
- /** Observe current and future connections without taking lifecycle ownership. */
180
- onConnection(callback: (connection: Connection) => void): () => void;
181
- close(): Promise<void>;
182
- }
183
- interface Devices extends Avenue {
184
- readonly kind: 'devices';
185
- localId(): ReturnType<DeviceNamespace['localId']>;
186
- localInfo(): ReturnType<DeviceNamespace['localInfo']>;
187
- list(): ReturnType<DeviceNamespace['list']>;
188
- listWithStatus(): ReturnType<DeviceNamespace['listWithStatus']>;
189
- watch: DeviceNamespace['watch'];
190
- connect: DeviceNamespace['connect'];
191
- disconnect: DeviceNamespace['disconnect'];
192
- }
193
- interface Space extends Avenue {
194
- readonly kind: 'space';
195
- readonly delivery: Delivery;
196
- leave(): Promise<void>;
197
- }
198
- interface Room extends Avenue {
199
- readonly kind: 'room';
200
- readonly membership: 'ephemeral' | 'durable';
201
- leave(): Promise<void>;
202
- }
203
- interface Ticket extends Avenue {
204
- readonly kind: 'ticket';
205
- /**
206
- * Opaque, install-bound OpenRTC capability credential. This is not a
207
- * transferable invitation or recipient redemption token. Do not display,
208
- * log, persist, or send it to another installation.
209
- * @deprecated This credential exposure is retained only for RC source
210
- * compatibility and will not be part of the stable invitation workflow.
211
- */
212
- readonly token: string;
213
- }
214
- interface DeviceOptions {
215
- auth?: AuthProvider;
216
- autoConnect?: 'none' | 'online';
217
- /** Optional local profile; it does not alter the durable device identity. */
218
- profile?: DeviceProfile;
219
- maxPeers?: number;
220
- /** Requires the app manifest's advanced-fanout opt-in. */
221
- advancedFanout?: boolean;
222
- }
223
- interface SpaceOptions {
224
- access?: 'capability';
225
- /** Use a new memory-only identity for this OpenRTC client run. */
226
- identity?: 'session';
227
- payload?: Delivery;
228
- maxPeers?: number;
229
- /** Requires the app manifest's advanced-fanout opt-in. */
230
- advancedFanout?: boolean;
231
- }
232
- interface RoomOptions {
233
- access?: AccessMode;
234
- membership?: 'ephemeral' | 'durable';
235
- auth?: AuthProvider;
236
- maxPeers?: number;
237
- /**
238
- * Requires the app manifest's reviewed advanced-fanout opt-in. Rooms then
239
- * use a four-neighbor sparse overlay with bounded named-channel gossip.
240
- */
241
- advancedFanout?: boolean;
242
- }
243
- interface TicketOptions {
244
- maxPeers?: number;
245
- /** Requires the app manifest's advanced-fanout opt-in. */
246
- advancedFanout?: boolean;
247
- }
248
- interface Channels {
249
- register(descriptor: ChannelDescriptor): () => void;
250
- list(): readonly ChannelDescriptor[];
251
- }
252
- interface Usage {
253
- estimate(input: {
254
- operation: string;
255
- units?: number;
256
- }): {
257
- creditsUsd: number;
258
- estimated: true;
259
- };
260
- readonly sessionCreditsUsd: number;
261
- }
262
- interface Client {
263
- readonly devices: {
264
- /**
265
- * Returns this installation's durable, app-scoped device ID without
266
- * starting a capability or performing network work.
267
- */
268
- localId(): Promise<string>;
269
- start(options?: DeviceOptions): Promise<Devices>;
270
- listEnrolled(options?: {
271
- auth?: AuthProvider;
272
- }): Promise<EnrolledDevice[]>;
273
- revoke(deviceId: string, options?: {
274
- auth?: AuthProvider;
275
- }): Promise<void>;
276
- revokeAll(options?: {
277
- auth?: AuthProvider;
278
- exceptCurrent?: boolean;
279
- }): Promise<void>;
280
- };
281
- readonly spaces: {
282
- join(id: string, options?: SpaceOptions): Promise<Space>;
283
- };
284
- readonly rooms: {
285
- join(id: string, options?: RoomOptions): Promise<Room>;
286
- };
287
- readonly tickets: {
288
- issue(id: string, options?: TicketOptions): Promise<Ticket>;
289
- };
290
- readonly channels: Channels;
291
- readonly usage: Usage;
292
- close(): Promise<void>;
293
- }
294
-
295
- export type { AttestationProvider as A, BotVerificationProvider as B, Client as C, DeviceOptions as D, EnrolledDevice as E, Options as O, Room as R, Space as S, Ticket as T, UsageUpdate as U, AuthProvider as a, Avenue as b, Channel as c, Connection as d, DeviceProfile as e, Devices as f, RoomOptions as g, SpaceOptions as h, State as i, TicketOptions as j, Transports as k, UsageWarning as l };