@palbase/web 1.0.1 → 1.1.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.
- package/dist/{analytics-facade-DV2uAiSg.d.cts → analytics-facade-CAKBIH_U.d.cts} +351 -5
- package/dist/{analytics-facade-CE_vGf1F.d.ts → analytics-facade-DLH-KivI.d.ts} +351 -5
- package/dist/chunk-EMQGOKW6.js +6842 -0
- package/dist/chunk-EMQGOKW6.js.map +1 -0
- package/dist/index.cjs +3616 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +207 -4
- package/dist/index.d.ts +207 -4
- package/dist/index.js +7 -1
- package/dist/internal.cjs +3612 -167
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +4 -3
- package/dist/internal.d.ts +4 -3
- package/dist/internal.js +1 -1
- package/dist/next/client.cjs +3610 -177
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +1 -1
- package/dist/next/index.cjs +3615 -170
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +3 -8
- package/dist/next/index.d.ts +3 -8
- package/dist/next/index.js +14 -5
- package/dist/next/index.js.map +1 -1
- package/dist/{pb-EMn_MF9g.d.ts → pb-DioxNuEV.d.cts} +3 -1
- package/dist/{pb-DcknUtCh.d.cts → pb-HegMSSk-.d.ts} +3 -1
- package/dist/pkg/palbe_mls_bg.wasm +0 -0
- package/dist/react/index.cjs +97 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +28 -2
- package/dist/react/index.d.ts +28 -2
- package/dist/react/index.js +86 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +6 -3
- package/dist/chunk-AVEXGXRQ.js +0 -3384
- package/dist/chunk-AVEXGXRQ.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,212 @@
|
|
|
1
|
-
export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, F as FlagsView, M as MagicLinkResult, O as OAuthExchangeResult, P as PalbeAnalytics,
|
|
1
|
+
export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, C as Call, e as CallChangeCallback, f as CallParticipant, g as CallState, h as Chat, i as ChatBackend, j as ChatDraft, k as ChatKind, l as ChatMember, m as ChatMessage, n as ChatMessageKind, o as ChatRole, p as ChatState, q as CommsPrefs, F as FlagsView, M as MagicLinkResult, r as MessageDirection, O as OAuthExchangeResult, P as PalbeAnalytics, s as PalbeAuth, t as PalbeCalls, u as PalbeConfig, v as PalbeFlags, w as PalbeMessaging, x as PalbeOAuthConfig, y as PalbeRealtime, z as PresenceState, R as RealtimeChannel, B as RealtimeConnectionState, D as RealtimeHandler, E as RealtimePayload, G as RealtimeStatus, H as RealtimeStatusSnapshot, I as RealtimeSubscription, S as SentReceipt, U as Unsubscribe } from './analytics-facade-CAKBIH_U.cjs';
|
|
2
2
|
export { B as BackendError, a as BackendErrorKind, F as FieldError, i as isBackendError } from './errors-fDoNdTrJ.cjs';
|
|
3
|
-
export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-
|
|
3
|
+
export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-DioxNuEV.cjs';
|
|
4
4
|
export { P as PersistedSession, S as SessionStorageAdapter, l as localStorageSessionStorage, m as memorySessionStorage } from './storage-BPaeSG8K.cjs';
|
|
5
5
|
export { F as FlagValue } from './pooled-flags-Bwq4usn0.js';
|
|
6
|
+
import 'livekit-client';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
/* tslint:disable */
|
|
9
|
+
/* eslint-disable */
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Host group-state storage. Mirrors the native PalbeGroupStateStorage
|
|
13
|
+
* (state / epoch / write / maxEpochId). All blobs are opaque MLS bytes.
|
|
14
|
+
*
|
|
15
|
+
* IMPORTANT: these methods are SYNCHRONOUS — mls-rs calls them inside the
|
|
16
|
+
* engine's locked critical section. Back them with an in-memory cache and
|
|
17
|
+
* flush to IndexedDB + WebCrypto sealing asynchronously OUTSIDE the engine call.
|
|
18
|
+
*/
|
|
19
|
+
interface IGroupStateStorage {
|
|
20
|
+
/** Latest serialized group state for groupId, or undefined/null if unknown. */
|
|
21
|
+
state(groupId: Uint8Array): Uint8Array | undefined | null;
|
|
22
|
+
/** A specific stored prior-epoch record, or undefined/null if unknown. */
|
|
23
|
+
epoch(groupId: Uint8Array, epochId: bigint): Uint8Array | undefined | null;
|
|
24
|
+
/** Persist new group state + prior-epoch inserts/updates atomically. */
|
|
25
|
+
write(
|
|
26
|
+
groupId: Uint8Array,
|
|
27
|
+
groupState: Uint8Array,
|
|
28
|
+
epochInserts: { id: bigint; data: Uint8Array }[],
|
|
29
|
+
epochUpdates: { id: bigint; data: Uint8Array }[],
|
|
30
|
+
): void;
|
|
31
|
+
/** Highest stored prior-epoch id for groupId, or undefined/null if none. */
|
|
32
|
+
maxEpochId(groupId: Uint8Array): bigint | undefined | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Host key-package secret storage (restart-safe join). Mirrors the native
|
|
37
|
+
* PalbeKeyPackageStorage (delete / insert / get). Blobs are SECRET-BEARING
|
|
38
|
+
* (HPKE init/leaf private keys) — seal at rest. Synchronous, same contract as
|
|
39
|
+
* IGroupStateStorage.
|
|
40
|
+
*/
|
|
41
|
+
interface IKeyPackageStorage {
|
|
42
|
+
/** Securely erase the key-package secrets referenced by id. */
|
|
43
|
+
delete(id: Uint8Array): void;
|
|
44
|
+
/** Store the opaque (secret-bearing) key-package data under id. */
|
|
45
|
+
insert(id: Uint8Array, data: Uint8Array): void;
|
|
46
|
+
/** Retrieve the stored key-package data, or undefined/null if unknown. */
|
|
47
|
+
get(id: Uint8Array): Uint8Array | undefined | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Browser binding of [`PalbeMlsClient`]. Holds the same `Arc<PalbeMlsClient>`
|
|
52
|
+
* the native FFI would; every method delegates to the engine.
|
|
53
|
+
*/
|
|
54
|
+
declare class MlsClient {
|
|
55
|
+
private constructor();
|
|
56
|
+
free(): void;
|
|
57
|
+
[Symbol.dispose](): void;
|
|
58
|
+
/**
|
|
59
|
+
* The MLS Capabilities wire bytes (the keydir's `capabilities`).
|
|
60
|
+
*/
|
|
61
|
+
capabilities(): Uint8Array;
|
|
62
|
+
/**
|
|
63
|
+
* Create a new group at epoch 0. `groupId` `undefined`/`null` lets mls-rs
|
|
64
|
+
* mint a globally-unique id (the rfc_group_id routing key).
|
|
65
|
+
*/
|
|
66
|
+
createGroup(group_id?: Uint8Array | null): MlsGroup;
|
|
67
|
+
/**
|
|
68
|
+
* The MLS Credential wire bytes (the keydir's `credential`).
|
|
69
|
+
*/
|
|
70
|
+
credential(): Uint8Array;
|
|
71
|
+
/**
|
|
72
|
+
* The MLS-encoded enrollment material `{ signatureKey, credential,
|
|
73
|
+
* capabilities }` (byte fields as arrays-of-numbers — wrap in Uint8Array as
|
|
74
|
+
* needed). Base64 these into the SP-0 keydir enroll body.
|
|
75
|
+
*/
|
|
76
|
+
enrollmentMaterial(): any;
|
|
77
|
+
/**
|
|
78
|
+
* Mint a one-use KeyPackage (RAW RFC 9420 §10 bytes) — uploaded to the
|
|
79
|
+
* keydir, consumed by an adder's `addMember`.
|
|
80
|
+
*/
|
|
81
|
+
generateKeyPackage(): Uint8Array;
|
|
82
|
+
/**
|
|
83
|
+
* Join a group from a Welcome (opaque MLSMessage bytes).
|
|
84
|
+
*/
|
|
85
|
+
joinGroup(welcome: Uint8Array): MlsGroup;
|
|
86
|
+
/**
|
|
87
|
+
* Re-hydrate a previously-persisted group by its `groupId` (restart-safe
|
|
88
|
+
* reload of an already-joined group).
|
|
89
|
+
*/
|
|
90
|
+
loadGroup(group_id: Uint8Array): MlsGroup;
|
|
91
|
+
/**
|
|
92
|
+
* The serialized STABLE signature keypair (secret-bearing). Persist sealed
|
|
93
|
+
* and pass back as `signatureKeypair` on restart so the device keeps the
|
|
94
|
+
* SAME MLS signing identity.
|
|
95
|
+
*/
|
|
96
|
+
signatureKeypair(): Uint8Array;
|
|
97
|
+
/**
|
|
98
|
+
* The device's STABLE signature PUBLIC key bytes (the keydir's
|
|
99
|
+
* `signature_key`).
|
|
100
|
+
*/
|
|
101
|
+
signaturePublicKey(): Uint8Array;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Browser binding of [`PalbeMlsGroup`].
|
|
106
|
+
*/
|
|
107
|
+
declare class MlsGroup {
|
|
108
|
+
private constructor();
|
|
109
|
+
free(): void;
|
|
110
|
+
[Symbol.dispose](): void;
|
|
111
|
+
/**
|
|
112
|
+
* Stage a member add. Returns `{ commit, welcome?, addedLeafIndices }`
|
|
113
|
+
* (byte fields as arrays-of-numbers). The group is PENDING after this.
|
|
114
|
+
*/
|
|
115
|
+
addMember(key_package_msg: Uint8Array): any;
|
|
116
|
+
/**
|
|
117
|
+
* Apply the staged commit (advances the local epoch). Call ONLY after the
|
|
118
|
+
* server accepted the commit.
|
|
119
|
+
*/
|
|
120
|
+
applyPendingCommit(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Discard the staged commit without advancing (the 409-rebase path).
|
|
123
|
+
*/
|
|
124
|
+
clearPendingCommit(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Stage a SINGLE atomic add+remove commit. `addKeyPackages` is an
|
|
127
|
+
* `Array<Uint8Array>` of one-use key packages; `removeMemberIds` an
|
|
128
|
+
* `Array<Uint8Array>` of member identity bytes. Returns the same
|
|
129
|
+
* `AddResult` shape as `addMember`. PENDING after this.
|
|
130
|
+
*/
|
|
131
|
+
commitChanges(add_key_packages: Uint8Array[], remove_member_ids: Uint8Array[]): any;
|
|
132
|
+
/**
|
|
133
|
+
* The current (applied) epoch as a JS BigInt (u64 exceeds safe-integer).
|
|
134
|
+
*/
|
|
135
|
+
currentEpoch(): bigint;
|
|
136
|
+
/**
|
|
137
|
+
* Inspect an incoming Commit and return the membership delta it WOULD
|
|
138
|
+
* effect WITHOUT applying it (the reconciliation gate's crypto-truth).
|
|
139
|
+
* Returns `{ kind, addedIdentities, removedIdentities }`.
|
|
140
|
+
*/
|
|
141
|
+
describeIncomingCommit(commit_msg: Uint8Array): any;
|
|
142
|
+
/**
|
|
143
|
+
* Encrypt an application message at the current epoch. Returns the opaque
|
|
144
|
+
* MLSMessage bytes (PrivateMessage).
|
|
145
|
+
*/
|
|
146
|
+
encryptApplicationMessage(plaintext: Uint8Array): Uint8Array;
|
|
147
|
+
/**
|
|
148
|
+
* The MLS group id (the rfc_group_id routing key / storage key).
|
|
149
|
+
*/
|
|
150
|
+
groupId(): Uint8Array;
|
|
151
|
+
/**
|
|
152
|
+
* True while a staged (unapplied) commit exists.
|
|
153
|
+
*/
|
|
154
|
+
hasPendingCommit(): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Process an incoming MLSMessage and apply its effect. Returns a
|
|
157
|
+
* `ReceivedMessage` plain object (serde-tagged enum): e.g.
|
|
158
|
+
* `{ Application: { sender, data } }`, `{ CommitApplied: { epoch,
|
|
159
|
+
* removedSelf } }`, `"Proposal"`, or `"Other"`.
|
|
160
|
+
*/
|
|
161
|
+
processIncomingMessage(message: Uint8Array): any;
|
|
162
|
+
/**
|
|
163
|
+
* Stage a member remove (by the member's identity bytes). Returns
|
|
164
|
+
* `{ commit }`. PENDING after this.
|
|
165
|
+
*/
|
|
166
|
+
removeMember(member_id: Uint8Array): any;
|
|
167
|
+
/**
|
|
168
|
+
* Persist the current group state through the JS group storage callback.
|
|
169
|
+
*/
|
|
170
|
+
writeToStorage(): void;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Mint a device MLS client (browser binding of [`engine::generate_client`]).
|
|
175
|
+
*
|
|
176
|
+
* - `id`: the member identity bytes (the SP-0 device id `mdv_`).
|
|
177
|
+
* - `group_storage`: a JS object implementing `IGroupStateStorage`.
|
|
178
|
+
* - `key_package_storage`: a JS object implementing `IKeyPackageStorage`.
|
|
179
|
+
* - `signature_keypair`: `undefined`/`null` on first run (a fresh keypair is
|
|
180
|
+
* minted), or the previously-persisted serialized secret-key bytes on restart.
|
|
181
|
+
*/
|
|
182
|
+
declare function generateClient(
|
|
183
|
+
id: Uint8Array,
|
|
184
|
+
group_storage: IGroupStateStorage,
|
|
185
|
+
key_package_storage: IKeyPackageStorage,
|
|
186
|
+
signature_keypair?: Uint8Array | null,
|
|
187
|
+
): MlsClient;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Install the browser console panic hook so a Rust panic shows a readable
|
|
191
|
+
* stack in the devtools console instead of an opaque `unreachable`. Idempotent;
|
|
192
|
+
* the TS facade calls this once at module init.
|
|
193
|
+
*/
|
|
194
|
+
declare function setPanicHook(): void;
|
|
195
|
+
|
|
196
|
+
/** The subset of the glue surface the bridge calls. */
|
|
197
|
+
interface MlsGlue {
|
|
198
|
+
generateClient: typeof generateClient;
|
|
199
|
+
setPanicHook: typeof setPanicHook;
|
|
200
|
+
MlsClient: typeof MlsClient;
|
|
201
|
+
MlsGroup: typeof MlsGroup;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Initialize the MLS WASM engine. Idempotent — call it once before any
|
|
205
|
+
* messaging crypto op (the facade does this on `pb.messaging.start()` and
|
|
206
|
+
* before the first chat op). Returns the glue surface (the bridge uses it).
|
|
207
|
+
*/
|
|
208
|
+
declare function initMls(): Promise<MlsGlue>;
|
|
209
|
+
|
|
210
|
+
declare const VERSION = "1.1.1";
|
|
211
|
+
|
|
212
|
+
export { VERSION, initMls };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,212 @@
|
|
|
1
|
-
export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, F as FlagsView, M as MagicLinkResult, O as OAuthExchangeResult, P as PalbeAnalytics,
|
|
1
|
+
export { A as AnalyticsProperties, a as AuthChangeEvent, b as AuthState, c as AuthSuccess, d as AuthUser, C as Call, e as CallChangeCallback, f as CallParticipant, g as CallState, h as Chat, i as ChatBackend, j as ChatDraft, k as ChatKind, l as ChatMember, m as ChatMessage, n as ChatMessageKind, o as ChatRole, p as ChatState, q as CommsPrefs, F as FlagsView, M as MagicLinkResult, r as MessageDirection, O as OAuthExchangeResult, P as PalbeAnalytics, s as PalbeAuth, t as PalbeCalls, u as PalbeConfig, v as PalbeFlags, w as PalbeMessaging, x as PalbeOAuthConfig, y as PalbeRealtime, z as PresenceState, R as RealtimeChannel, B as RealtimeConnectionState, D as RealtimeHandler, E as RealtimePayload, G as RealtimeStatus, H as RealtimeStatusSnapshot, I as RealtimeSubscription, S as SentReceipt, U as Unsubscribe } from './analytics-facade-DLH-KivI.js';
|
|
2
2
|
export { B as BackendError, a as BackendErrorKind, F as FieldError, i as isBackendError } from './errors-fDoNdTrJ.js';
|
|
3
|
-
export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-
|
|
3
|
+
export { C as CallOptions, P as PB, U as UploadOptions, a as UploadProgress, p as pb } from './pb-HegMSSk-.js';
|
|
4
4
|
export { P as PersistedSession, S as SessionStorageAdapter, l as localStorageSessionStorage, m as memorySessionStorage } from './storage-BPaeSG8K.js';
|
|
5
5
|
export { F as FlagValue } from './pooled-flags-Bwq4usn0.js';
|
|
6
|
+
import 'livekit-client';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
/* tslint:disable */
|
|
9
|
+
/* eslint-disable */
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Host group-state storage. Mirrors the native PalbeGroupStateStorage
|
|
13
|
+
* (state / epoch / write / maxEpochId). All blobs are opaque MLS bytes.
|
|
14
|
+
*
|
|
15
|
+
* IMPORTANT: these methods are SYNCHRONOUS — mls-rs calls them inside the
|
|
16
|
+
* engine's locked critical section. Back them with an in-memory cache and
|
|
17
|
+
* flush to IndexedDB + WebCrypto sealing asynchronously OUTSIDE the engine call.
|
|
18
|
+
*/
|
|
19
|
+
interface IGroupStateStorage {
|
|
20
|
+
/** Latest serialized group state for groupId, or undefined/null if unknown. */
|
|
21
|
+
state(groupId: Uint8Array): Uint8Array | undefined | null;
|
|
22
|
+
/** A specific stored prior-epoch record, or undefined/null if unknown. */
|
|
23
|
+
epoch(groupId: Uint8Array, epochId: bigint): Uint8Array | undefined | null;
|
|
24
|
+
/** Persist new group state + prior-epoch inserts/updates atomically. */
|
|
25
|
+
write(
|
|
26
|
+
groupId: Uint8Array,
|
|
27
|
+
groupState: Uint8Array,
|
|
28
|
+
epochInserts: { id: bigint; data: Uint8Array }[],
|
|
29
|
+
epochUpdates: { id: bigint; data: Uint8Array }[],
|
|
30
|
+
): void;
|
|
31
|
+
/** Highest stored prior-epoch id for groupId, or undefined/null if none. */
|
|
32
|
+
maxEpochId(groupId: Uint8Array): bigint | undefined | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Host key-package secret storage (restart-safe join). Mirrors the native
|
|
37
|
+
* PalbeKeyPackageStorage (delete / insert / get). Blobs are SECRET-BEARING
|
|
38
|
+
* (HPKE init/leaf private keys) — seal at rest. Synchronous, same contract as
|
|
39
|
+
* IGroupStateStorage.
|
|
40
|
+
*/
|
|
41
|
+
interface IKeyPackageStorage {
|
|
42
|
+
/** Securely erase the key-package secrets referenced by id. */
|
|
43
|
+
delete(id: Uint8Array): void;
|
|
44
|
+
/** Store the opaque (secret-bearing) key-package data under id. */
|
|
45
|
+
insert(id: Uint8Array, data: Uint8Array): void;
|
|
46
|
+
/** Retrieve the stored key-package data, or undefined/null if unknown. */
|
|
47
|
+
get(id: Uint8Array): Uint8Array | undefined | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Browser binding of [`PalbeMlsClient`]. Holds the same `Arc<PalbeMlsClient>`
|
|
52
|
+
* the native FFI would; every method delegates to the engine.
|
|
53
|
+
*/
|
|
54
|
+
declare class MlsClient {
|
|
55
|
+
private constructor();
|
|
56
|
+
free(): void;
|
|
57
|
+
[Symbol.dispose](): void;
|
|
58
|
+
/**
|
|
59
|
+
* The MLS Capabilities wire bytes (the keydir's `capabilities`).
|
|
60
|
+
*/
|
|
61
|
+
capabilities(): Uint8Array;
|
|
62
|
+
/**
|
|
63
|
+
* Create a new group at epoch 0. `groupId` `undefined`/`null` lets mls-rs
|
|
64
|
+
* mint a globally-unique id (the rfc_group_id routing key).
|
|
65
|
+
*/
|
|
66
|
+
createGroup(group_id?: Uint8Array | null): MlsGroup;
|
|
67
|
+
/**
|
|
68
|
+
* The MLS Credential wire bytes (the keydir's `credential`).
|
|
69
|
+
*/
|
|
70
|
+
credential(): Uint8Array;
|
|
71
|
+
/**
|
|
72
|
+
* The MLS-encoded enrollment material `{ signatureKey, credential,
|
|
73
|
+
* capabilities }` (byte fields as arrays-of-numbers — wrap in Uint8Array as
|
|
74
|
+
* needed). Base64 these into the SP-0 keydir enroll body.
|
|
75
|
+
*/
|
|
76
|
+
enrollmentMaterial(): any;
|
|
77
|
+
/**
|
|
78
|
+
* Mint a one-use KeyPackage (RAW RFC 9420 §10 bytes) — uploaded to the
|
|
79
|
+
* keydir, consumed by an adder's `addMember`.
|
|
80
|
+
*/
|
|
81
|
+
generateKeyPackage(): Uint8Array;
|
|
82
|
+
/**
|
|
83
|
+
* Join a group from a Welcome (opaque MLSMessage bytes).
|
|
84
|
+
*/
|
|
85
|
+
joinGroup(welcome: Uint8Array): MlsGroup;
|
|
86
|
+
/**
|
|
87
|
+
* Re-hydrate a previously-persisted group by its `groupId` (restart-safe
|
|
88
|
+
* reload of an already-joined group).
|
|
89
|
+
*/
|
|
90
|
+
loadGroup(group_id: Uint8Array): MlsGroup;
|
|
91
|
+
/**
|
|
92
|
+
* The serialized STABLE signature keypair (secret-bearing). Persist sealed
|
|
93
|
+
* and pass back as `signatureKeypair` on restart so the device keeps the
|
|
94
|
+
* SAME MLS signing identity.
|
|
95
|
+
*/
|
|
96
|
+
signatureKeypair(): Uint8Array;
|
|
97
|
+
/**
|
|
98
|
+
* The device's STABLE signature PUBLIC key bytes (the keydir's
|
|
99
|
+
* `signature_key`).
|
|
100
|
+
*/
|
|
101
|
+
signaturePublicKey(): Uint8Array;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Browser binding of [`PalbeMlsGroup`].
|
|
106
|
+
*/
|
|
107
|
+
declare class MlsGroup {
|
|
108
|
+
private constructor();
|
|
109
|
+
free(): void;
|
|
110
|
+
[Symbol.dispose](): void;
|
|
111
|
+
/**
|
|
112
|
+
* Stage a member add. Returns `{ commit, welcome?, addedLeafIndices }`
|
|
113
|
+
* (byte fields as arrays-of-numbers). The group is PENDING after this.
|
|
114
|
+
*/
|
|
115
|
+
addMember(key_package_msg: Uint8Array): any;
|
|
116
|
+
/**
|
|
117
|
+
* Apply the staged commit (advances the local epoch). Call ONLY after the
|
|
118
|
+
* server accepted the commit.
|
|
119
|
+
*/
|
|
120
|
+
applyPendingCommit(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Discard the staged commit without advancing (the 409-rebase path).
|
|
123
|
+
*/
|
|
124
|
+
clearPendingCommit(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Stage a SINGLE atomic add+remove commit. `addKeyPackages` is an
|
|
127
|
+
* `Array<Uint8Array>` of one-use key packages; `removeMemberIds` an
|
|
128
|
+
* `Array<Uint8Array>` of member identity bytes. Returns the same
|
|
129
|
+
* `AddResult` shape as `addMember`. PENDING after this.
|
|
130
|
+
*/
|
|
131
|
+
commitChanges(add_key_packages: Uint8Array[], remove_member_ids: Uint8Array[]): any;
|
|
132
|
+
/**
|
|
133
|
+
* The current (applied) epoch as a JS BigInt (u64 exceeds safe-integer).
|
|
134
|
+
*/
|
|
135
|
+
currentEpoch(): bigint;
|
|
136
|
+
/**
|
|
137
|
+
* Inspect an incoming Commit and return the membership delta it WOULD
|
|
138
|
+
* effect WITHOUT applying it (the reconciliation gate's crypto-truth).
|
|
139
|
+
* Returns `{ kind, addedIdentities, removedIdentities }`.
|
|
140
|
+
*/
|
|
141
|
+
describeIncomingCommit(commit_msg: Uint8Array): any;
|
|
142
|
+
/**
|
|
143
|
+
* Encrypt an application message at the current epoch. Returns the opaque
|
|
144
|
+
* MLSMessage bytes (PrivateMessage).
|
|
145
|
+
*/
|
|
146
|
+
encryptApplicationMessage(plaintext: Uint8Array): Uint8Array;
|
|
147
|
+
/**
|
|
148
|
+
* The MLS group id (the rfc_group_id routing key / storage key).
|
|
149
|
+
*/
|
|
150
|
+
groupId(): Uint8Array;
|
|
151
|
+
/**
|
|
152
|
+
* True while a staged (unapplied) commit exists.
|
|
153
|
+
*/
|
|
154
|
+
hasPendingCommit(): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Process an incoming MLSMessage and apply its effect. Returns a
|
|
157
|
+
* `ReceivedMessage` plain object (serde-tagged enum): e.g.
|
|
158
|
+
* `{ Application: { sender, data } }`, `{ CommitApplied: { epoch,
|
|
159
|
+
* removedSelf } }`, `"Proposal"`, or `"Other"`.
|
|
160
|
+
*/
|
|
161
|
+
processIncomingMessage(message: Uint8Array): any;
|
|
162
|
+
/**
|
|
163
|
+
* Stage a member remove (by the member's identity bytes). Returns
|
|
164
|
+
* `{ commit }`. PENDING after this.
|
|
165
|
+
*/
|
|
166
|
+
removeMember(member_id: Uint8Array): any;
|
|
167
|
+
/**
|
|
168
|
+
* Persist the current group state through the JS group storage callback.
|
|
169
|
+
*/
|
|
170
|
+
writeToStorage(): void;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Mint a device MLS client (browser binding of [`engine::generate_client`]).
|
|
175
|
+
*
|
|
176
|
+
* - `id`: the member identity bytes (the SP-0 device id `mdv_`).
|
|
177
|
+
* - `group_storage`: a JS object implementing `IGroupStateStorage`.
|
|
178
|
+
* - `key_package_storage`: a JS object implementing `IKeyPackageStorage`.
|
|
179
|
+
* - `signature_keypair`: `undefined`/`null` on first run (a fresh keypair is
|
|
180
|
+
* minted), or the previously-persisted serialized secret-key bytes on restart.
|
|
181
|
+
*/
|
|
182
|
+
declare function generateClient(
|
|
183
|
+
id: Uint8Array,
|
|
184
|
+
group_storage: IGroupStateStorage,
|
|
185
|
+
key_package_storage: IKeyPackageStorage,
|
|
186
|
+
signature_keypair?: Uint8Array | null,
|
|
187
|
+
): MlsClient;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Install the browser console panic hook so a Rust panic shows a readable
|
|
191
|
+
* stack in the devtools console instead of an opaque `unreachable`. Idempotent;
|
|
192
|
+
* the TS facade calls this once at module init.
|
|
193
|
+
*/
|
|
194
|
+
declare function setPanicHook(): void;
|
|
195
|
+
|
|
196
|
+
/** The subset of the glue surface the bridge calls. */
|
|
197
|
+
interface MlsGlue {
|
|
198
|
+
generateClient: typeof generateClient;
|
|
199
|
+
setPanicHook: typeof setPanicHook;
|
|
200
|
+
MlsClient: typeof MlsClient;
|
|
201
|
+
MlsGroup: typeof MlsGroup;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Initialize the MLS WASM engine. Idempotent — call it once before any
|
|
205
|
+
* messaging crypto op (the facade does this on `pb.messaging.start()` and
|
|
206
|
+
* before the first chat op). Returns the glue surface (the bridge uses it).
|
|
207
|
+
*/
|
|
208
|
+
declare function initMls(): Promise<MlsGlue>;
|
|
209
|
+
|
|
210
|
+
declare const VERSION = "1.1.1";
|
|
211
|
+
|
|
212
|
+
export { VERSION, initMls };
|
package/dist/index.js
CHANGED
|
@@ -2,23 +2,29 @@ import {
|
|
|
2
2
|
BackendError,
|
|
3
3
|
PalbeAnalytics,
|
|
4
4
|
PalbeAuth,
|
|
5
|
+
PalbeCalls,
|
|
5
6
|
PalbeFlags,
|
|
7
|
+
PalbeMessaging,
|
|
6
8
|
PalbeRealtime,
|
|
7
9
|
RealtimeChannel,
|
|
8
10
|
VERSION,
|
|
11
|
+
initMls,
|
|
9
12
|
isBackendError,
|
|
10
13
|
localStorageSessionStorage,
|
|
11
14
|
memorySessionStorage,
|
|
12
15
|
pb
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EMQGOKW6.js";
|
|
14
17
|
export {
|
|
15
18
|
BackendError,
|
|
16
19
|
PalbeAnalytics,
|
|
17
20
|
PalbeAuth,
|
|
21
|
+
PalbeCalls,
|
|
18
22
|
PalbeFlags,
|
|
23
|
+
PalbeMessaging,
|
|
19
24
|
PalbeRealtime,
|
|
20
25
|
RealtimeChannel,
|
|
21
26
|
VERSION,
|
|
27
|
+
initMls,
|
|
22
28
|
isBackendError,
|
|
23
29
|
localStorageSessionStorage,
|
|
24
30
|
memorySessionStorage,
|