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
@@ -0,0 +1,44 @@
1
+ import { Ed25519Signer, AuthorityServiceGrantRequest, AuthorityServiceGrant, AuthorityAssignmentInput, AuthorityInterestAssignment, DelegatedAuthorityGrantRequest } from './service-node.js';
2
+ import './types-Cyc-mPjk.js';
3
+ import './coreClient.js';
4
+ import './assembly-DvfsYFCL.js';
5
+ import './Connection-CTpuImO-.js';
6
+ import './capabilities-CmzzxSvW.js';
7
+
8
+ /** Secret-bearing Node/server helpers. Do not import this entrypoint in browsers. */
9
+
10
+ interface AuthorityServiceOptions {
11
+ apiKey: string;
12
+ secretKey: string;
13
+ serviceId: string;
14
+ generation: number;
15
+ shardIds: string[];
16
+ deviceId: string;
17
+ deviceSigner: Ed25519Signer;
18
+ assignmentSigner: Ed25519Signer;
19
+ endpoint?: string;
20
+ fetch?: typeof globalThis.fetch;
21
+ }
22
+ /** Direct secret-backed grant issuer for a trusted Node/server process. */
23
+ declare class AuthorityServiceControlPlane {
24
+ private readonly authority;
25
+ constructor(options: AuthorityServiceOptions);
26
+ requestGrant(input: AuthorityServiceGrantRequest): Promise<AuthorityServiceGrant>;
27
+ signAssignment(input: AuthorityAssignmentInput): Promise<{
28
+ assignment: AuthorityInterestAssignment;
29
+ signature: string;
30
+ }>;
31
+ devicePublicKey(): Promise<{
32
+ kty: "OKP";
33
+ crv: "Ed25519";
34
+ x: string;
35
+ }>;
36
+ signDeviceBytes(payload: Uint8Array): Promise<string>;
37
+ /**
38
+ * Adapt this trusted issuer to `openrtc/service-node` in Node. Browser
39
+ * applications must call their own authenticated backend instead.
40
+ */
41
+ grantIssuer(): (request: DelegatedAuthorityGrantRequest) => Promise<AuthorityServiceGrant>;
42
+ }
43
+
44
+ export { AuthorityAssignmentInput, AuthorityInterestAssignment, AuthorityServiceControlPlane, AuthorityServiceGrant, AuthorityServiceGrantRequest, type AuthorityServiceOptions, Ed25519Signer };
package/dist/server.js ADDED
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-GHAJW6SZ.js';import'./chunk-Z54XUIKZ.js';import'./chunk-ZA44REGI.js';import'./chunk-LLZT3MR6.js';import'./chunk-DUY34MGT.js';import'./chunk-CCCYE3XN.js';import'./chunk-N6LGTNUI.js';import'./chunk-JPBW67B3.js';import'./chunk-2GX6GB6L.js';function y(n){let e=new URL(n??"https://api.openrtc.app"),t=e.protocol==="http:"&&["127.0.0.1","localhost","::1"].includes(e.hostname.toLowerCase());if(e.protocol!=="https:"&&!t||e.username||e.password||e.search||e.hash)throw new TypeError("[OpenRTC] authority control-plane endpoint is invalid.");return e.toString().replace(/\/$/,"")}function h(){if(typeof document<"u"||typeof window<"u")throw new Error("[OpenRTC] openrtc/server is unavailable in browsers; use openrtc/service-node with a delegated grant.")}var c=class{constructor(e){h();let t=e.secretKey?.trim()??"";if(!/^sk_(?:live|test)_[A-Za-z0-9_-]+$/.test(t))throw new TypeError("[OpenRTC] secretKey is invalid.");let i=e.fetch??globalThis.fetch;if(typeof i!="function")throw new TypeError("[OpenRTC] a Fetch-compatible implementation is required.");let u=y(e.endpoint);this.authority=new a({apiKey:e.apiKey,serviceId:e.serviceId,generation:e.generation,shardIds:e.shardIds,deviceId:e.deviceId,deviceSigner:e.deviceSigner,assignmentSigner:e.assignmentSigner,grantIssuer:async s=>{let r=await i(`${u}/v2/developer/authority/grants`,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json","x-openrtc-idempotency-key":s.idempotencyKey},body:JSON.stringify(s.body)});if(!r.ok){let o=await r.json().catch(()=>null),d=typeof o?.error=="string"?o.error.slice(0,256):`HTTP ${r.status}`;throw new Error(`[OpenRTC] authority service grant failed: ${d}`)}return r.json()}});}requestGrant(e){return this.authority.requestGrant(e)}signAssignment(e){return this.authority.signAssignment(e)}devicePublicKey(){return this.authority.devicePublicKey()}signDeviceBytes(e){return this.authority.signDeviceBytes(e)}grantIssuer(){return async e=>{let t=e.body;return this.requestGrant({roomId:String(t.avenue?.id??""),runtimeInstanceId:String(t.runtimeInstanceId??""),ticketFingerprint:String(t.ticketFingerprint??""),maxPeers:typeof t.maxPeers=="number"?t.maxPeers:void 0,refreshGrant:typeof t.refreshGrant=="string"?t.refreshGrant:void 0,features:typeof t.features=="object"&&t.features?t.features:void 0})}}};
2
+ export{c as AuthorityServiceControlPlane};
@@ -0,0 +1,155 @@
1
+ import { C as Client, X as Room, r as Connection } from './types-Cyc-mPjk.js';
2
+ import './coreClient.js';
3
+ import './assembly-DvfsYFCL.js';
4
+ import './Connection-CTpuImO-.js';
5
+ import './capabilities-CmzzxSvW.js';
6
+
7
+ /** Browser-safe and Node-host-neutral developer service-node facade. */
8
+
9
+ interface Ed25519Signer {
10
+ publicJwk(): JsonWebKey | Promise<JsonWebKey>;
11
+ sign(payload: Uint8Array): Uint8Array | Promise<Uint8Array>;
12
+ }
13
+ interface AuthorityServiceOptions {
14
+ apiKey: string;
15
+ /**
16
+ * App-backend delegation. Browser code must call a trusted developer
17
+ * backend here; it must never close over or embed an `sk_*` secret.
18
+ */
19
+ grantIssuer: AuthorityGrantIssuer;
20
+ serviceId: string;
21
+ generation: number;
22
+ shardIds: string[];
23
+ deviceId: string;
24
+ deviceSigner: Ed25519Signer;
25
+ assignmentSigner: Ed25519Signer;
26
+ }
27
+ interface DelegatedAuthorityGrantRequest {
28
+ apiKey: string;
29
+ idempotencyKey: string;
30
+ body: Record<string, unknown>;
31
+ }
32
+ type AuthorityGrantIssuer = (request: DelegatedAuthorityGrantRequest) => Promise<unknown>;
33
+ interface AuthorityServiceGrantRequest {
34
+ roomId: string;
35
+ runtimeInstanceId: string;
36
+ ticketFingerprint: string;
37
+ maxPeers?: number;
38
+ refreshGrant?: string;
39
+ features?: Partial<{
40
+ irohRelay: boolean;
41
+ managedTurn: boolean;
42
+ moq: boolean;
43
+ ble: boolean;
44
+ }>;
45
+ }
46
+ interface AuthorityServiceGrant {
47
+ protocolVersion: 2;
48
+ gatewayUrl: string;
49
+ routeKey: string;
50
+ token: string;
51
+ expiresAtMs: number;
52
+ avenue: {
53
+ kind: 'room';
54
+ id: string;
55
+ };
56
+ maxPeers: number;
57
+ architecture: 'authority';
58
+ roomAuthority: {
59
+ serviceId: string;
60
+ generation: number;
61
+ shardIds: string[];
62
+ assignmentPublicKeyJwk: {
63
+ kty: 'OKP';
64
+ crv: 'Ed25519';
65
+ x: string;
66
+ };
67
+ };
68
+ }
69
+ interface AuthorityInterestAssignment {
70
+ policyVersion: 'room-authority-assignment-v1';
71
+ serviceId: string;
72
+ generation: number;
73
+ revision: number;
74
+ subjectDeviceId: string;
75
+ shardId: string;
76
+ priorityDeviceIds: string[];
77
+ relevantEntityIds: string[];
78
+ issuedAtMs: number;
79
+ expiresAtMs: number;
80
+ }
81
+ interface AuthorityAssignmentInput {
82
+ revision: number;
83
+ subjectDeviceId: string;
84
+ shardId: string;
85
+ priorityDeviceIds?: string[];
86
+ relevantEntityIds?: string[];
87
+ ttlMs?: number;
88
+ }
89
+ interface ServiceNodeOptions extends AuthorityServiceOptions {
90
+ /** Browser uses WASM with delegated grants; `openrtc/node` uses the bundled Rust host. */
91
+ client: Client;
92
+ maxPeers?: number;
93
+ irohRelay?: boolean;
94
+ }
95
+ interface ServiceNodeConnectionEvent {
96
+ room: ServiceNodeRoom;
97
+ connection: Connection;
98
+ }
99
+ interface ServiceNodeRoom extends Room {
100
+ publishAssignment(input: AuthorityAssignmentInput): Promise<AuthorityInterestAssignment>;
101
+ }
102
+ /**
103
+ * Data-only server boundary for service grant issuance and signed AOI input.
104
+ * It does not own sockets, retries, topology, or transport selection.
105
+ */
106
+ declare class DelegatedAuthorityService {
107
+ private readonly apiKey;
108
+ private readonly applicationTag;
109
+ private readonly grantIssuer;
110
+ private readonly serviceId;
111
+ private readonly generation;
112
+ private readonly shardIds;
113
+ private readonly deviceId;
114
+ private readonly deviceSigner;
115
+ private readonly assignmentSigner;
116
+ constructor(options: AuthorityServiceOptions);
117
+ requestGrant(input: AuthorityServiceGrantRequest): Promise<AuthorityServiceGrant>;
118
+ devicePublicKey(): Promise<{
119
+ kty: 'OKP';
120
+ crv: 'Ed25519';
121
+ x: string;
122
+ }>;
123
+ assignmentPublicKey(): Promise<{
124
+ kty: 'OKP';
125
+ crv: 'Ed25519';
126
+ x: string;
127
+ }>;
128
+ signDeviceBytes(payload: Uint8Array): Promise<string>;
129
+ signAssignment(input: AuthorityAssignmentInput): Promise<{
130
+ assignment: AuthorityInterestAssignment;
131
+ signature: string;
132
+ }>;
133
+ }
134
+ /**
135
+ * Familiar application server facade. It handles application events only;
136
+ * OpenRTC's Rust/WASM owner still controls admission, dialing, retry, routes,
137
+ * and carrier switching.
138
+ */
139
+ declare class ServiceNode {
140
+ private readonly options;
141
+ private readonly authority;
142
+ private readonly rooms;
143
+ private readonly connectionListeners;
144
+ private readonly connectionCleanups;
145
+ private closed;
146
+ constructor(options: ServiceNodeOptions);
147
+ listen(roomId: string): Promise<ServiceNodeRoom>;
148
+ onConnection(listener: (event: ServiceNodeConnectionEvent) => void): () => void;
149
+ close(): Promise<void>;
150
+ private openRoom;
151
+ private evictRoom;
152
+ private attachConnectionListener;
153
+ }
154
+
155
+ export { type AuthorityAssignmentInput, type AuthorityGrantIssuer, type AuthorityInterestAssignment, type AuthorityServiceGrant, type AuthorityServiceGrantRequest, type AuthorityServiceOptions, type DelegatedAuthorityGrantRequest, DelegatedAuthorityService, type Ed25519Signer, ServiceNode, type ServiceNodeConnectionEvent, type ServiceNodeOptions, type ServiceNodeRoom };
@@ -0,0 +1 @@
1
+ export{a as DelegatedAuthorityService,b as ServiceNode}from'./chunk-GHAJW6SZ.js';import'./chunk-Z54XUIKZ.js';import'./chunk-ZA44REGI.js';import'./chunk-LLZT3MR6.js';import'./chunk-DUY34MGT.js';import'./chunk-CCCYE3XN.js';import'./chunk-N6LGTNUI.js';import'./chunk-JPBW67B3.js';import'./chunk-2GX6GB6L.js';
@@ -0,0 +1,11 @@
1
+ import { O as Options, C as Client } from '../types-Cyc-mPjk.js';
2
+ import { E as Endpoints } from '../protocol-BSBjMb7p.js';
3
+ import { P as PlutoIpcBridge } from '../ipc-DgzKqHH3.js';
4
+ import '../coreClient.js';
5
+ import '../assembly-DvfsYFCL.js';
6
+ import '../Connection-CTpuImO-.js';
7
+ import '../capabilities-CmzzxSvW.js';
8
+
9
+ declare function OpenRTC(options: Options, endpoints: Endpoints, bridge: PlutoIpcBridge): Client;
10
+
11
+ export { OpenRTC };
@@ -0,0 +1 @@
1
+ import {a as a$1}from'../chunk-VFDCIEP6.js';import {a}from'../chunk-VTYVIKTM.js';import'../chunk-NDR2ANQB.js';import {f}from'../chunk-Z54XUIKZ.js';import'../chunk-ZA44REGI.js';import'../chunk-LLZT3MR6.js';import'../chunk-DUY34MGT.js';import'../chunk-CCCYE3XN.js';import'../chunk-N6LGTNUI.js';import'../chunk-JPBW67B3.js';import'../chunk-2GX6GB6L.js';function v(c,p,e){let o=new a;return f(c,{endpoints:p,testingAllowInsecureLoopback:true,platform:"native",close:()=>o.close(),deviceKeyProvider:a$1(e),deviceIdProvider:async()=>{let t=await e.invoke("get_rtc_local_device_info");return String(t?.deviceId??"")},runtimeFactory:async t=>{let{createIpcClient:a}=await import('../ipcFactory-PRAJ7JP7.js');return a(t,e,o)}})}export{v as OpenRTC};
package/dist/testing.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { i as CoordinationGatewayGrantRequest, j as CoordinationGatewayGrant } from './ITransport-CjxCQ6q7.js';
2
- import { A as AttestationProvider, a as AuthProvider, B as BotVerificationProvider, e as DeviceProfile, O as Options, C as Client } from './types--jQzenZR.js';
3
- import { P as PlutoIpcBridge } from './ipc-CPnNwv6f.js';
1
+ import { R as RoomArchitectureMode, ag as CoordinationGatewayGrantRequest, ah as CoordinationGatewayGrant } from './Connection-CTpuImO-.js';
2
+ import { a as AttestationProvider, b as AuthProvider, B as BotVerificationProvider, e as BroadcastGrant, d as BroadcastCreateOptions, f as BroadcastInvite, g as BroadcastInviteOptions, D as Delivery, t as DeviceProfile, O as Options, C as Client } from './types-Cyc-mPjk.js';
3
+ import { E as Endpoints } from './protocol-BSBjMb7p.js';
4
4
  import './coreClient.js';
5
- import './assembly-Bmi65-tK.js';
6
- import './types-DDhMQkK8.js';
7
- import './capabilities-BPuynml5.js';
5
+ import './assembly-DvfsYFCL.js';
6
+ import './capabilities-CmzzxSvW.js';
8
7
 
9
8
  interface DeviceProof {
10
9
  publicKeyJwk: JsonWebKey;
@@ -15,32 +14,31 @@ interface DeviceProof {
15
14
  interface DeviceKey {
16
15
  readonly publicKeyJwk: JsonWebKey;
17
16
  readonly thumbprint: string;
17
+ /** Signs Rust-canonical protocol bytes without exporting private key material. */
18
+ sign(message: Uint8Array): Promise<string>;
18
19
  proof(challenge: (nonce: string, issuedAt: number) => string): Promise<DeviceProof>;
19
20
  }
20
21
  interface DeviceKeyProvider {
21
22
  getOrCreate(appTag: string): Promise<DeviceKey>;
22
23
  delete?(appTag: string): Promise<void>;
23
24
  /**
24
- * Optional platform-secure record storage. Native hosts use this for the
25
- * device certificate that is bound to the private key; browsers retain
26
- * their same-origin localStorage implementation.
25
+ * Optional host-private record storage. Native hosts use this for the
26
+ * device certificate bound to their non-exported signing key; the host
27
+ * chooses a prompt-free implementation. Browsers retain their same-origin
28
+ * storage implementation.
27
29
  */
28
30
  readSecureRecord?(appTag: string, key: string): Promise<string | null>;
29
31
  writeSecureRecord?(appTag: string, key: string, value: string): Promise<void>;
30
32
  deleteSecureRecord?(appTag: string, key: string): Promise<void>;
31
33
  }
32
34
 
33
- interface Endpoints {
34
- controlPlane: string;
35
- gateway: string;
36
- }
37
-
38
35
  interface CredentialSource {
39
36
  type: 'capability' | 'device-certificate';
40
37
  token: string;
41
38
  avenue: CoordinationGatewayGrantRequest['avenue'];
42
39
  expiresAtMs: number;
43
- relay: boolean;
40
+ irohRelay: boolean;
41
+ managedTurn: boolean;
44
42
  renew?: () => Promise<CredentialSource>;
45
43
  /**
46
44
  * Re-establishes an authenticated device certificate only after the
@@ -60,7 +58,8 @@ interface CachedDeviceCertificate {
60
58
  interface AuthenticatedDeviceCertificate extends CachedDeviceCertificate {
61
59
  principalId: string;
62
60
  enrolled: boolean;
63
- relay: boolean;
61
+ irohRelay: boolean;
62
+ managedTurn: boolean;
64
63
  }
65
64
  interface ControlPlaneEvents {
66
65
  beforeLogicalOperation?: (operation: string) => void;
@@ -83,8 +82,37 @@ declare class ControlPlane {
83
82
  private authEpoch;
84
83
  dispose(): void;
85
84
  private key;
85
+ /** Public half of the existing platform-issued device signer. */
86
+ deviceSigningPublicKey(): Promise<JsonWebKey>;
87
+ signDeviceBytes(message: Uint8Array): Promise<string>;
88
+ /**
89
+ * Resolve one opaque grant into a private provider allocation. The public
90
+ * grant is only a signed, device-bound authorization; relay credentials
91
+ * are returned solely to the private broadcast mechanics host.
92
+ */
93
+ resolveBroadcastAccess(grant: string, publicationVerifyingKey?: Uint8Array): Promise<{
94
+ token: string;
95
+ issuerPublicKey: Uint8Array;
96
+ signBindingChallenge(message: Uint8Array): Promise<Uint8Array>;
97
+ relay: {
98
+ relayUrl: string;
99
+ token: string;
100
+ namespace: string;
101
+ };
102
+ }>;
103
+ /** Authenticated owner operations. The server performs the atomic hard
104
+ * reservation before minting a grant or allocating provider capacity. */
105
+ manageBroadcast(input: {
106
+ action: 'create' | 'invite' | 'accept' | 'renew' | 'revoke' | 'leave' | 'close';
107
+ deviceId: string;
108
+ auth: AuthProvider;
109
+ grant?: BroadcastGrant;
110
+ create?: BroadcastCreateOptions;
111
+ invite?: BroadcastInvite;
112
+ invitation?: BroadcastInviteOptions;
113
+ }): Promise<BroadcastGrant | BroadcastInvite | undefined>;
86
114
  private post;
87
- capability(kind: 'space' | 'room' | 'ticket', id: string, maxPeers?: number, advancedFanout?: boolean): Promise<CredentialSource>;
115
+ capability(kind: 'space' | 'room' | 'ticket', id: string, maxPeers?: number, advancedFanout?: boolean, architecture?: RoomArchitectureMode, roomDelivery?: Delivery): Promise<CredentialSource>;
88
116
  deviceCertificate(auth: AuthProvider, deviceId: string, avenue?: CoordinationGatewayGrantRequest['avenue'], profile?: DeviceProfile, rejected?: AuthenticatedDeviceCertificate): Promise<{
89
117
  source: CredentialSource;
90
118
  principalId: string;
@@ -109,6 +137,8 @@ declare class ControlPlane {
109
137
  grantProvider(source: CredentialSource, input?: {
110
138
  maxPeers?: number;
111
139
  features?: Record<string, boolean>;
140
+ architecture?: RoomArchitectureMode;
141
+ roomDelivery?: Delivery;
112
142
  deviceProfile?: Pick<DeviceProfile, 'name' | 'platform'>;
113
143
  /**
114
144
  * Keeps the transport/admission credential relay synchronized
@@ -132,8 +162,5 @@ declare function OpenRTC(options: Options, endpoints: Endpoints, testing?: {
132
162
  deviceId?: string;
133
163
  irohTestRelayUrl?: string;
134
164
  }): Client;
135
- declare namespace OpenRTC {
136
- var native: (options: Options, endpoints: Endpoints, bridge: PlutoIpcBridge) => Client;
137
- }
138
165
 
139
166
  export { OpenRTC, controlPlane };
package/dist/testing.js CHANGED
@@ -1 +1 @@
1
- import {a}from'./chunk-Q6KXVTSH.js';import {a as a$1}from'./chunk-BOS554IK.js';import {c}from'./chunk-4MLJXEVV.js';import {b}from'./chunk-UILOGUOU.js';import'./chunk-ZA44REGI.js';import'./chunk-DUY34MGT.js';import'./chunk-HEAJ7ZUR.js';function d(o){let r=e=>`${e}:${o}`;return {getOrCreate:e=>c.getOrCreate(r(e)),delete:async e=>{await c.delete?.(r(e));},readSecureRecord:(e,t)=>c.readSecureRecord?.(r(e),t)??Promise.resolve(null),writeSecureRecord:(e,t,n)=>c.writeSecureRecord?.(r(e),t,n)??Promise.resolve(),deleteSecureRecord:(e,t)=>c.deleteSecureRecord?.(r(e),t)??Promise.resolve()}}function y(o,r,e){return new a(o,r,d(e))}function s(o,r,e={}){return b(o,{endpoints:r,testingAllowInsecureLoopback:true,platform:"web",...e.deviceId?{deviceIdProvider:async()=>e.deviceId}:{},...e.irohTestRelayUrl?{irohTestRelayUrl:e.irohTestRelayUrl}:{},runtimeFactory:async t=>{let{createWasmClient:n}=await import('./runtime/factories.js');return n(t)}})}s.native=function(o,r,e){return b(o,{endpoints:r,testingAllowInsecureLoopback:true,platform:"native",deviceKeyProvider:a$1(e),deviceIdProvider:async()=>{let t=await e.invoke("get_rtc_local_device_info");return String(t?.deviceId??"")},runtimeFactory:async t=>{let{createIpcClient:n}=await import('./ipcFactory-32R47AVK.js');return n(t,e)}})};export{s as OpenRTC,y as controlPlane};
1
+ import {a}from'./chunk-BFN3AVHA.js';import {c}from'./chunk-NDR2ANQB.js';import {f}from'./chunk-Z54XUIKZ.js';import'./chunk-ZA44REGI.js';import'./chunk-LLZT3MR6.js';import'./chunk-DUY34MGT.js';import'./chunk-CCCYE3XN.js';import'./chunk-N6LGTNUI.js';import'./chunk-JPBW67B3.js';import'./chunk-2GX6GB6L.js';function s(i){let r=e=>`${e}:${i}`;return {getOrCreate:e=>c.getOrCreate(r(e)),delete:async e=>{await c.delete?.(r(e));},readSecureRecord:(e,o)=>c.readSecureRecord?.(r(e),o)??Promise.resolve(null),writeSecureRecord:(e,o,n)=>c.writeSecureRecord?.(r(e),o,n)??Promise.resolve(),deleteSecureRecord:(e,o)=>c.deleteSecureRecord?.(r(e),o)??Promise.resolve()}}function m(i,r,e){return new a(i,r,s(e))}function u(i,r,e={}){return f(i,{endpoints:r,testingAllowInsecureLoopback:true,platform:"web",...e.deviceId?{deviceIdProvider:async()=>e.deviceId}:{},...e.irohTestRelayUrl?{irohTestRelayUrl:e.irohTestRelayUrl}:{},runtimeFactory:async o=>{let{createWasmClient:n}=await import('./runtime/factories.js');return n(o)}})}export{u as OpenRTC,m as controlPlane};
@@ -1,31 +1,20 @@
1
- import { c as ProtocolName, $ as RouteDescriptor, K as ITransport, a0 as ProtocolCapability, a1 as ProtocolCapabilityMap, z as PayloadCrypto, a2 as CryptoStreams } from '../ITransport-CjxCQ6q7.js';
2
- export { a3 as CryptoBiStream, a4 as RouteFamily, a5 as RouteKind } from '../ITransport-CjxCQ6q7.js';
1
+ import { g as ProtocolName, aq as RouteDescriptor, ar as PayloadCrypto, as as CryptoStreams } from '../Connection-CTpuImO-.js';
2
+ export { at as CryptoBiStream, au as RouteFamily, av as RouteKind } from '../Connection-CTpuImO-.js';
3
3
 
4
4
  declare const TRANSPORT_LABELS: readonly ProtocolName[];
5
5
  declare function normalizeTransport(value: unknown): ProtocolName | undefined;
6
6
  declare function isBaseIroh(value: unknown): boolean;
7
7
  declare function isDirectIroh(value: unknown): boolean;
8
- declare function isOptionalTransport(value: unknown): boolean;
9
8
  declare function isWebRtc(value: unknown): boolean;
10
- declare function isIndependent(value: unknown): boolean;
11
9
 
12
10
  declare const ROUTE_DESCRIPTORS: readonly RouteDescriptor[];
13
11
  declare function getRouteDescriptor(id: ProtocolName): RouteDescriptor;
14
12
  declare function listRouteDescriptors(): readonly RouteDescriptor[];
15
13
 
16
- declare class TransportFactory {
17
- private static readonly capabilityMap;
18
- /** @deprecated Only WebRTC implements the legacy ITransport construction API. */
19
- static createTransport(name: ProtocolName): ITransport;
20
- static getProtocolCapability(name: ProtocolName): ProtocolCapability;
21
- static getProtocolCapabilities(): ProtocolCapabilityMap;
22
- static preferredProtocols(options?: {
23
- runtime?: 'browser' | 'native' | 'any';
24
- includePathLabels?: boolean;
25
- }): ProtocolName[];
26
- static assertProtocolAvailable(name: ProtocolName): void;
27
- }
28
- declare function preferredProtocols(options?: Parameters<typeof TransportFactory.preferredProtocols>[0]): ProtocolName[];
14
+ declare function preferredProtocols(options?: {
15
+ runtime?: 'browser' | 'native' | 'any';
16
+ includePathLabels?: boolean;
17
+ }): ProtocolName[];
29
18
 
30
19
  declare function isEncryptedPayload(payload: Uint8Array): boolean;
31
20
  declare function createSharedCrypto(key: Uint8Array, options?: {
@@ -52,4 +41,4 @@ declare function createKeyAgreement(randomBytes?: (byteLength: number) => Uint8A
52
41
  declare function deriveCryptoKey(localSecretKey: Uint8Array, remotePublicKey: Uint8Array, localNodeId: string, remoteNodeId: string): Uint8Array;
53
42
  declare function encodeKeyAgreement(publicKey: Uint8Array): KeyAgreementPayload;
54
43
 
55
- export { CryptoStreams, KEY_ALGORITHM, type KeyAgreementPayload, PUBLIC_KEY_BYTES, PayloadCrypto, ProtocolName, ROUTE_DESCRIPTORS, RouteDescriptor, TRANSPORT_LABELS, createCryptoStreams, createKeyAgreement, createSharedCrypto, deriveCryptoKey, encodeKeyAgreement, getRouteDescriptor, isBaseIroh, isDirectIroh, isEncryptedPayload, isIndependent, isOptionalTransport, isWebRtc, listRouteDescriptors, normalizeTransport, preferredProtocols };
44
+ export { CryptoStreams, KEY_ALGORITHM, type KeyAgreementPayload, PUBLIC_KEY_BYTES, PayloadCrypto, ProtocolName, ROUTE_DESCRIPTORS, RouteDescriptor, TRANSPORT_LABELS, createCryptoStreams, createKeyAgreement, createSharedCrypto, deriveCryptoKey, encodeKeyAgreement, getRouteDescriptor, isBaseIroh, isDirectIroh, isEncryptedPayload, isWebRtc, listRouteDescriptors, normalizeTransport, preferredProtocols };
@@ -1 +1 @@
1
- export{e as KEY_ALGORITHM,d as PUBLIC_KEY_BYTES,f as createKeyAgreement,g as deriveCryptoKey,i as encodeKeyAgreement,c as preferredProtocols}from'../chunk-7BJKDBLP.js';export{o as TRANSPORT_LABELS,z as createCryptoStreams,y as createSharedCrypto,q as isBaseIroh,r as isDirectIroh,x as isEncryptedPayload,w as isIndependent,s as isOptionalTransport,t as isWebRtc,p as normalizeTransport}from'../chunk-2L6ULC32.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-2SUSPEC4.js';
1
+ export{g as KEY_ALGORITHM,f as PUBLIC_KEY_BYTES,c as createCryptoStreams,h as createKeyAgreement,b as createSharedCrypto,i as deriveCryptoKey,j as encodeKeyAgreement,a as isEncryptedPayload,e as preferredProtocols}from'../chunk-TYZS5LXQ.js';export{k as TRANSPORT_LABELS,m as isBaseIroh,n as isDirectIroh,o as isWebRtc,l as normalizeTransport}from'../chunk-OT7IPLZE.js';export{b as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'../chunk-OWKAJPOI.js';