@ping-app/ping-openmls-sdk 0.10.5 → 0.10.7

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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Storage, M as MessageEnvelope, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, L as LinkingTicketV3, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, I as IncomingMessage, F as FetchedSealedGroupInfo, i as SelfAdmitResult, j as SelfAdmitManyEntry, k as SequencedEnvelope, l as ApplyBatchResult, m as SyncStepResult, n as LogPosition, o as LogHole, p as LogHead, P as PendingApply, q as CatchupSnapshotView, r as CatchupAppEvent, s as LinkGeneration, t as LinkedDevice, B as BackupPhraseCheck, H as HistoryDeliveryKeyStatement, u as HistoryBundle, O as OpenedHistory, v as HistoryShipDecision, w as AdmitChatEntry, x as AdmitChatOutcome, y as DeviceRemovalReport, z as ExportedSecret, G as MessageBatchMeta } from './types-omhvRjtq.cjs';
2
- export { J as AddMemberStatus, N as AddMemberVerdict, Q as BackupCheckFailure, R as BufferOverflow, V as Bytes, W as CatchupSnapshotEntry, X as ConversationRemoval, Y as ConversationUpdate, Z as DeviceInfo, _ as DeviceRemovalFailure, D as DiscoveredDevice, $ as ExternalCommitAnswer, a0 as ExternalCommitPosted, a1 as HistoryAppEvent, a2 as Hlc, a3 as HoleReason, a4 as JournalFullAt, a5 as LogAck, a6 as LogGap, a7 as MessageKind, a8 as OverflowReason, a9 as SealedGroupInfoRow, aa as SealedGroupInfoUpload, ab as SealedGroupInfoWrap, ac as SealingStatementRow, ad as SelfAdmission, ae as SelfAdmissionState, af as SelfAdmitRefusal, ag as SelfAdmitWait, ah as SenderRole, ai as StrandReason, aj as StrandedConversation, ak as WelcomeFailure, al as WelcomeFailureReason } from './types-omhvRjtq.cjs';
1
+ import { S as Storage, M as MessageEnvelope, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, L as LinkingTicketV3, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, I as IncomingMessage, F as FetchedSealedGroupInfo, i as SelfAdmitResult, j as SelfAdmitManyEntry, k as SequencedEnvelope, l as ApplyBatchResult, m as SyncStepResult, n as LogPosition, o as LogHole, p as LogHead, P as PendingApply, q as CatchupSnapshotView, r as CatchupAppEvent, s as LinkGeneration, t as LinkedDevice, B as BackupPhraseCheck, H as HistoryDeliveryKeyStatement, u as HistoryBundle, O as OpenedHistory, v as HistoryShipDecision, w as AdmitChatEntry, x as AdmitChatOutcome, y as DeviceRemovalReport, z as ExportedSecret, G as MessageBatchMeta } from './types-D8fIp-_0.cjs';
2
+ export { J as AddMemberStatus, N as AddMemberVerdict, Q as BackupCheckFailure, R as BufferOverflow, V as Bytes, W as CatchupSnapshotEntry, X as ConversationRemoval, Y as ConversationUpdate, Z as DeviceInfo, _ as DeviceRemovalFailure, D as DiscoveredDevice, $ as ExternalCommitAnswer, a0 as ExternalCommitPosted, a1 as HistoryAppEvent, a2 as Hlc, a3 as HoleReason, a4 as JournalFullAt, a5 as LogAck, a6 as LogGap, a7 as MessageKind, a8 as OverflowReason, a9 as SealedGroupInfoRow, aa as SealedGroupInfoUpload, ab as SealedGroupInfoWrap, ac as SealingStatementRow, ad as SelfAdmission, ae as SelfAdmissionState, af as SelfAdmitRefusal, ag as SelfAdmitWait, ah as SenderRole, ai as StrandReason, aj as StrandedConversation, ak as WelcomeFailure, al as WelcomeFailureReason } from './types-D8fIp-_0.cjs';
3
3
  export { IndexedDbStorage } from './storage/indexeddb.cjs';
4
4
  export { WebSocketTransport } from './transport/websocket.cjs';
5
5
  export { MAX_PREVIEW_PREREQUISITES, NotificationPreviewOptions, NotificationPreviewSession, openNotificationPreview } from './notification-preview.cjs';
@@ -13,16 +13,38 @@ interface SealingStatement {
13
13
  /**
14
14
  * What a call that MADE a device answers: the public values the host registers
15
15
  * with the server, and the device key for the host's protected store.
16
+ * `devicePublicKey` is the device's public key (32 bytes; `deviceId` is its
17
+ * SHA-256): the value a host registers, so no host derives it from the secret.
16
18
  * `deviceSigningSecretKey` is a secret: keep it where a device key is kept
17
19
  * today, pass it to `MessagingClient.initFromDeviceRecord`, never log it.
18
20
  */
19
21
  interface NewAccountDevice {
20
22
  userId: Uint8Array;
21
23
  deviceId: Uint8Array;
24
+ devicePublicKey: Uint8Array;
22
25
  generation: number;
23
26
  statement: SealingStatement;
24
27
  deviceSigningSecretKey: Uint8Array;
25
28
  }
29
+ /**
30
+ * What `AccountSetup.prepareDeviceKey` answers: the device id (SHA-256 of the
31
+ * public key) and the public key a sign-in BY CODE names, and the device key
32
+ * for the host's protected store. `deviceSigningSecretKey` is a secret: store
33
+ * it BEFORE any request names the key, never log it.
34
+ */
35
+ interface PreparedDeviceKey {
36
+ deviceId: Uint8Array;
37
+ devicePublicKey: Uint8Array;
38
+ deviceSigningSecretKey: Uint8Array;
39
+ }
40
+ /**
41
+ * What `AccountSetup.deviceStartCheck` answers (ruling V904): what a start from
42
+ * the device record would answer on this store. `startable`: the store holds a
43
+ * device record and its device key (if it holds one yet) is the record's.
44
+ * `no-device-record`: set up, link or restore. `device-key-mismatch`: the
45
+ * store's device key, or the expected device id, is not the record's.
46
+ */
47
+ type DeviceStartCheck = "startable" | "no-device-record" | "device-key-mismatch";
26
48
  interface AccountBackupParts {
27
49
  rootPart: Uint8Array;
28
50
  statePart: Uint8Array;
@@ -30,6 +52,12 @@ interface AccountBackupParts {
30
52
  }
31
53
  /** `present`, `absent`, or `mismatch` (the pending root is LOST: copy B6). */
32
54
  type PendingRootStatus = "present" | "absent" | "mismatch";
55
+ /** What `discardPendingRoot` answers. `deleted`: the slot's pending root was
56
+ * deleted. `nothing-there`: the slot holds none. The other three are
57
+ * REFUSALS that deleted nothing: the slot's store holds a device record (the
58
+ * root may be an account's pinned root), a rotation record, or a begun link.
59
+ * Treat a value you do not know as a refusal. */
60
+ type PendingRootDiscard = "deleted" | "nothing-there" | "device-record-held" | "rotation-record-held" | "link-begun";
33
61
  /** What `POST /v1/account/generation/start` answered, as the host parsed it
34
62
  * (the account identity contract, 12.3). Public values, and the server's
35
63
  * word: the SDK believes it only as far as the root's signature goes. */
@@ -234,6 +262,30 @@ declare class AccountSetup {
234
262
  identityState: string | undefined;
235
263
  persistentStorage?: boolean;
236
264
  }): Promise<NewAccountDevice>;
265
+ /**
266
+ * THE PREPARED DEVICE KEY (rulings V895 to V900, V913, V965): the device key
267
+ * a sign-in BY CODE names on a store with no device record, before the
268
+ * account exists. The SDK draws it (no argument is a key), keeps it in one
269
+ * row of this store and answers it; a repeat answers the SAME key, and two
270
+ * tabs that call at once answer one key (the origin's account lock).
271
+ * `createAccount`, the in-memory session and `MessagingClient.beginDeviceLink`
272
+ * then make the device with that key; a restore or a take-back never uses
273
+ * it. Store the secret BEFORE any request names the key. Refusals:
274
+ * `account-already-set-up` (the store holds a device), `rotation-in-progress`,
275
+ * `device-key-held-by-link` (a link was begun in this slot: offer "Finish
276
+ * linking" or "Start over", never a retry), `prepared-key-mismatch`.
277
+ */
278
+ prepareDeviceKey(): Promise<PreparedDeviceKey>;
279
+ /** Delete a FREE prepared device key and nothing else; answers whether a
280
+ * row was deleted. Log the key's session out FIRST, and delete the host's
281
+ * own copy of the secret last. Refuses as `prepareDeviceKey` does. */
282
+ discardPreparedDeviceKey(): Promise<boolean>;
283
+ /** THE PREDICATE (ruling V904): what a start from the device record would
284
+ * answer on this store, as a typed value. It starts nothing, writes
285
+ * nothing and sends nothing. `expectedDeviceId` is the PUBLIC device id
286
+ * the host keeps, if it keeps one. Decide stop or retry on the answer,
287
+ * never on the words of an error. */
288
+ deviceStartCheck(expectedDeviceId?: Uint8Array): Promise<DeviceStartCheck>;
237
289
  /** Whether the slot holds the pending root this device expects (rule R32).
238
290
  * No prompt, no read of the seed. */
239
291
  pendingStatus(slot: string): Promise<PendingRootStatus>;
@@ -256,6 +308,14 @@ declare class AccountSetup {
256
308
  slot: string;
257
309
  fingerprint: Uint8Array;
258
310
  }): Promise<void>;
311
+ /** "Start over" on an account that was started on this device and never
312
+ * finished (rulings V1201, V1277): deletes the pending root of ONE slot and
313
+ * nothing else, or refuses with a typed answer (see `PendingRootDiscard`).
314
+ * THE HOST'S DUTY, which the SDK cannot check: the person chose it, the
315
+ * slot's stored account is the account signed in now, this sign-in's fresh
316
+ * answer is exactly `none_pinned`, and the slot's SDK store is emptied in
317
+ * the same erase. Never call it from a sweep. */
318
+ discardPendingRoot(slot: string): Promise<PendingRootDiscard>;
259
319
  /** Step 3 of a restore: the root part opens with the phrase to the PINNED
260
320
  * root; `hostState` is there when the root part's secret opens the state
261
321
  * part. Writes nothing. */
@@ -357,7 +417,10 @@ declare class AccountSetup {
357
417
  * Begin a set-up session whose root is in memory only (rule R34 a): for the
358
418
  * person who makes the backup during set-up. One session per object; it
359
419
  * lives in the Worker until `sessionFinish`, `sessionKeepAsPending` or
360
- * `close`.
420
+ * `close`. It begins ON THIS STORE (read, nothing written): the session's
421
+ * device is made for the store's free prepared device key, when
422
+ * `prepareDeviceKey` made one. `device-key-held-by-link`: a link was begun
423
+ * in this slot.
361
424
  */
362
425
  beginInMemory(identityState: string | undefined): Promise<void>;
363
426
  /** The session's backup. */
@@ -653,9 +716,11 @@ declare class MessagingClient {
653
716
  */
654
717
  private metaCache;
655
718
  /**
656
- * Per-conversation batching of sequenced live frames: the first frame goes
657
- * to the worker at once, frames that arrive while that batch is in flight
658
- * go out as ONE `processSequencedBatch` when it returns. See
719
+ * ONE lane of sequenced live frames for every conversation: the first
720
+ * frame goes to the worker at once, frames that arrive while that batch is
721
+ * in flight go out as ONE `processSequencedBatch` when it returns, in
722
+ * arrival order. Rows the engine did not take (`notTaken`) stay in the
723
+ * lane and are handed again after the next `confirmApplied`. See
659
724
  * {@link dispatchIncoming}.
660
725
  */
661
726
  private readonly coalescer;
@@ -907,10 +972,14 @@ declare class MessagingClient {
907
972
  * position, holds it ahead of a hole and drops it at or below what was
908
973
  * applied, whatever order it arrived in. What it needs is BATCHING: one
909
974
  * MLS checkpoint and one host transaction per burst instead of one per
910
- * frame. So the first frame for a conversation goes to the worker at once
911
- * as a batch of one, and frames that arrive while that batch is in flight
912
- * accumulate and go out as ONE `processSequencedBatch` when it returns; no
913
- * timer ever delays a frame. Own-device echoes are NOT dropped on this
975
+ * frame. So the first frame goes to the worker at once as a batch of one,
976
+ * and frames of ANY conversation that arrive while that batch is in flight
977
+ * accumulate and go out as ONE `processSequencedBatch` when it returns, in
978
+ * arrival order (one lane for all conversations: a catch-up of 200
979
+ * conversations is about 20 Worker calls, not 400); no timer ever delays a
980
+ * frame. Rows the engine did not take because the pending-apply journal
981
+ * had no room (`notTaken`) stay in the lane, in order, and are handed
982
+ * again after the next `confirmApplied`. Own-device echoes are NOT dropped on this
914
983
  * path: the core advances the position past them without touching MLS,
915
984
  * and dropping one would leave a hole the next frame reports as a gap. A
916
985
  * sequenced frame at `serverSeq` 0 is a legacy frame in a wrapper and
@@ -922,10 +991,12 @@ declare class MessagingClient {
922
991
  /** The actual routing, run inside the per-conversation chain. */
923
992
  private dispatchIncomingOrdered;
924
993
  /**
925
- * One coalesced batch of live frames. Errors are logged at debug and
926
- * swallowed, exactly as the legacy path treats a failed envelope: the
927
- * dispatch promise a transport may await resolves either way, and the
928
- * core retains anything it could not apply yet.
994
+ * One coalesced batch of live frames, of any number of conversations.
995
+ * Answers the indexes of the rows the engine did not take (the journal
996
+ * had no room): the lane keeps those and hands them again after the next
997
+ * `confirmApplied`. A rejection goes to the lane, which hands a refused
998
+ * batch again one conversation at a time; `dispatchIncoming` logs what
999
+ * still fails at debug and resolves.
929
1000
  */
930
1001
  private applyLiveBatch;
931
1002
  /** Start a fill for every gap a batch reported; each is single-flight. */
@@ -1194,6 +1265,14 @@ declare class MessagingClient {
1194
1265
  * an interactive call behind all of them. Resolves when every conversation
1195
1266
  * held at the start of the pass (plus any joined while it ran) has been
1196
1267
  * paged, with the decrypted application messages in apply order.
1268
+ *
1269
+ * Rejects with `StoreMovedError` when the client failed closed: before the
1270
+ * pass (it then asks nothing of the server), inside one of its steps (no
1271
+ * later conversation is asked; the pages before it were delivered), or
1272
+ * during its last step. A client that failed closed before or during the
1273
+ * pass never resolves at all, with an empty list or with any other. The
1274
+ * host drops the client and starts a new one on the same store, which
1275
+ * hands what was stored (`pendingApplies`).
1197
1276
  */
1198
1277
  syncConversations(): Promise<IncomingMessage[]>;
1199
1278
  /**
@@ -1882,14 +1961,18 @@ declare class SenderMismatchError extends Error {
1882
1961
  /** True when `e` is the typed sender refusal and no other failure. Accepts
1883
1962
  * the rejection itself, any object with a `message`, or the text. */
1884
1963
  declare function isSenderMismatchError(e: unknown): boolean;
1885
- /** How the rejection of a call reads when another writer wrote this client's
1886
- * MLS store since the client loaded it (the core's `Error::StoreMoved`). No
1887
- * other failure starts this way. Kept in lockstep with the core's display
1888
- * (`stringify` in `core/ping-wasm/src/lib.rs`, pinned by
1889
- * `ping-core/tests/release_after_durable.rs`). Raised by the file-backed
1890
- * store of the native builds only: the web SDK's stores have no writer
1891
- * claim yet, so a browser never sees it today; the class exists so the API
1892
- * is the same on every platform. */
1964
+ /** How the rejection of a call reads when this client can store nothing more
1965
+ * (the core's `Error::StoreMoved`). No other failure starts this way. Kept
1966
+ * in lockstep with the core's display (`stringify` in
1967
+ * `core/ping-wasm/src/lib.rs`, pinned by
1968
+ * `ping-core/tests/release_after_durable.rs`). Two causes. Another writer
1969
+ * wrote the client's MLS store since the client loaded it: raised by the
1970
+ * file-backed store of the native builds only (the web SDK's stores have no
1971
+ * writer claim yet). And THE CLIENT FAILED CLOSED, which a browser does
1972
+ * see: a run of rows could not store its message secrets, or a panic inside
1973
+ * the wasm closed the instance (every client of that Worker). The calls
1974
+ * that store, seal, send or acknowledge then reject with this text, and so
1975
+ * does `syncConversations()`. */
1893
1976
  declare const STORE_MOVED_PREFIX = "store moved: ";
1894
1977
  /** The stale-writer failure. Nothing was written and nothing was released (a
1895
1978
  * message being sent did not leave). The client is stale: drop it,
@@ -2096,4 +2179,4 @@ declare function emulateSendBatch(transport: Pick<Transport, "send">, envelopes:
2096
2179
  * server error code rides along for diagnostics. */
2097
2180
  declare function describeTransportError(e: unknown): string;
2098
2181
 
2099
- export { type AccountBackupParts, AccountSetup, AccountSetupClosedError, type AccountSetupConfig, AddMembersReport, AdmitChatEntry, AdmitChatOutcome, type AdoptedGeneration, ApplyBatchResult, BATCH_PARTIAL_PREFIX, BackupPhraseCheck, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DEVICE_GROUP_BEHIND_PREFIX, DeviceGroupBehindError, DeviceId, DeviceLinkApproval, type DeviceLinkBegun, type DeviceLinkClientConfig, DeviceLinkPossession, DeviceReauthProof, type DeviceRecordClientConfig, DeviceRemovalReport, EphemeralWorkerError, ExpectedOwner, ExportedSecret, FetchedSealedGroupInfo, HISTORY_REFUSED_PREFIX, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, HistoryDeliveryKeyStatement, type HistoryRefusalReason, HistoryRefusedError, HistoryShipDecision, IncomingMessage, JOURNAL_FULL_PREFIX, JournalFullError, KeyPackageEntry, LINK_ADD_REFUSED_PREFIX, LINK_CHAIN_TOO_DEEP_PREFIX, LINK_COMMITMENT_MISMATCH_PREFIX, LinkAddRefusedError, LinkChainTooDeepError, type LinkCommitment, LinkCommitmentMismatchError, type LinkExpected, LinkGeneration, LinkedDevice, LinkingTicketV3, LogHead, LogHole, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, type NewAccountDevice, NotPermittedError, OpenedHistory, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, type PendingRootStatus, type PendingRotation, READ_ONLY_PREFIX, ReadOnlyError, type RestoreJoined, type RestoreOpened, type RotationAnswer, type RotationBuild, type RotationBuilt, type RotationKeptRefusal, type RotationOutcome, type RotationPhase, type RotationPlan, type RotationRecordState, type RotationRequest, type RotationStart, type RotationStartDevice, SENDER_MISMATCH_PREFIX, STALE_GENERATION_PREFIX, STORE_MOVED_PREFIX, type SealingStatement, SelfAdmitManyEntry, SelfAdmitResult, SenderMismatchError, SequencedEnvelope, StaleGenerationError, type StateOpened, type StateRefreshed, Storage, StoreMovedError, SyncStepResult, Transport, UserId, ValidationError, type VerifiedLinkHandshakeInfo, WELCOME_MISLABELED_PREFIX, WELCOME_WAITS_PREFIX, WIRE_VERSION_MIN_ACCEPTED, WelcomeMislabeledError, WelcomeWaitsError, accountRefusalCode, backupPhraseCheckFromWire, describeTransportError, emulateSendBatch, isDeviceGroupBehindError, isHistoryRefusedError, isJournalFullError, isLinkAddRefusedError, isLinkChainTooDeepError, isLinkCommitmentMismatchError, isNotPermittedError, isReadOnlyError, isSenderMismatchError, isStaleGenerationError, isStoreMovedError, isWelcomeMislabeledError, isWelcomeWaitsError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };
2182
+ export { type AccountBackupParts, AccountSetup, AccountSetupClosedError, type AccountSetupConfig, AddMembersReport, AdmitChatEntry, AdmitChatOutcome, type AdoptedGeneration, ApplyBatchResult, BATCH_PARTIAL_PREFIX, BackupPhraseCheck, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DEVICE_GROUP_BEHIND_PREFIX, DeviceGroupBehindError, DeviceId, DeviceLinkApproval, type DeviceLinkBegun, type DeviceLinkClientConfig, DeviceLinkPossession, DeviceReauthProof, type DeviceRecordClientConfig, DeviceRemovalReport, type DeviceStartCheck, EphemeralWorkerError, ExpectedOwner, ExportedSecret, FetchedSealedGroupInfo, HISTORY_REFUSED_PREFIX, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, HistoryDeliveryKeyStatement, type HistoryRefusalReason, HistoryRefusedError, HistoryShipDecision, IncomingMessage, JOURNAL_FULL_PREFIX, JournalFullError, KeyPackageEntry, LINK_ADD_REFUSED_PREFIX, LINK_CHAIN_TOO_DEEP_PREFIX, LINK_COMMITMENT_MISMATCH_PREFIX, LinkAddRefusedError, LinkChainTooDeepError, type LinkCommitment, LinkCommitmentMismatchError, type LinkExpected, LinkGeneration, LinkedDevice, LinkingTicketV3, LogHead, LogHole, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, type NewAccountDevice, NotPermittedError, OpenedHistory, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, type PendingRootDiscard, type PendingRootStatus, type PendingRotation, type PreparedDeviceKey, READ_ONLY_PREFIX, ReadOnlyError, type RestoreJoined, type RestoreOpened, type RotationAnswer, type RotationBuild, type RotationBuilt, type RotationKeptRefusal, type RotationOutcome, type RotationPhase, type RotationPlan, type RotationRecordState, type RotationRequest, type RotationStart, type RotationStartDevice, SENDER_MISMATCH_PREFIX, STALE_GENERATION_PREFIX, STORE_MOVED_PREFIX, type SealingStatement, SelfAdmitManyEntry, SelfAdmitResult, SenderMismatchError, SequencedEnvelope, StaleGenerationError, type StateOpened, type StateRefreshed, Storage, StoreMovedError, SyncStepResult, Transport, UserId, ValidationError, type VerifiedLinkHandshakeInfo, WELCOME_MISLABELED_PREFIX, WELCOME_WAITS_PREFIX, WIRE_VERSION_MIN_ACCEPTED, WelcomeMislabeledError, WelcomeWaitsError, accountRefusalCode, backupPhraseCheckFromWire, describeTransportError, emulateSendBatch, isDeviceGroupBehindError, isHistoryRefusedError, isJournalFullError, isLinkAddRefusedError, isLinkChainTooDeepError, isLinkCommitmentMismatchError, isNotPermittedError, isReadOnlyError, isSenderMismatchError, isStaleGenerationError, isStoreMovedError, isWelcomeMislabeledError, isWelcomeWaitsError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Storage, M as MessageEnvelope, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, L as LinkingTicketV3, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, I as IncomingMessage, F as FetchedSealedGroupInfo, i as SelfAdmitResult, j as SelfAdmitManyEntry, k as SequencedEnvelope, l as ApplyBatchResult, m as SyncStepResult, n as LogPosition, o as LogHole, p as LogHead, P as PendingApply, q as CatchupSnapshotView, r as CatchupAppEvent, s as LinkGeneration, t as LinkedDevice, B as BackupPhraseCheck, H as HistoryDeliveryKeyStatement, u as HistoryBundle, O as OpenedHistory, v as HistoryShipDecision, w as AdmitChatEntry, x as AdmitChatOutcome, y as DeviceRemovalReport, z as ExportedSecret, G as MessageBatchMeta } from './types-omhvRjtq.js';
2
- export { J as AddMemberStatus, N as AddMemberVerdict, Q as BackupCheckFailure, R as BufferOverflow, V as Bytes, W as CatchupSnapshotEntry, X as ConversationRemoval, Y as ConversationUpdate, Z as DeviceInfo, _ as DeviceRemovalFailure, D as DiscoveredDevice, $ as ExternalCommitAnswer, a0 as ExternalCommitPosted, a1 as HistoryAppEvent, a2 as Hlc, a3 as HoleReason, a4 as JournalFullAt, a5 as LogAck, a6 as LogGap, a7 as MessageKind, a8 as OverflowReason, a9 as SealedGroupInfoRow, aa as SealedGroupInfoUpload, ab as SealedGroupInfoWrap, ac as SealingStatementRow, ad as SelfAdmission, ae as SelfAdmissionState, af as SelfAdmitRefusal, ag as SelfAdmitWait, ah as SenderRole, ai as StrandReason, aj as StrandedConversation, ak as WelcomeFailure, al as WelcomeFailureReason } from './types-omhvRjtq.js';
1
+ import { S as Storage, M as MessageEnvelope, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, L as LinkingTicketV3, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, I as IncomingMessage, F as FetchedSealedGroupInfo, i as SelfAdmitResult, j as SelfAdmitManyEntry, k as SequencedEnvelope, l as ApplyBatchResult, m as SyncStepResult, n as LogPosition, o as LogHole, p as LogHead, P as PendingApply, q as CatchupSnapshotView, r as CatchupAppEvent, s as LinkGeneration, t as LinkedDevice, B as BackupPhraseCheck, H as HistoryDeliveryKeyStatement, u as HistoryBundle, O as OpenedHistory, v as HistoryShipDecision, w as AdmitChatEntry, x as AdmitChatOutcome, y as DeviceRemovalReport, z as ExportedSecret, G as MessageBatchMeta } from './types-D8fIp-_0.js';
2
+ export { J as AddMemberStatus, N as AddMemberVerdict, Q as BackupCheckFailure, R as BufferOverflow, V as Bytes, W as CatchupSnapshotEntry, X as ConversationRemoval, Y as ConversationUpdate, Z as DeviceInfo, _ as DeviceRemovalFailure, D as DiscoveredDevice, $ as ExternalCommitAnswer, a0 as ExternalCommitPosted, a1 as HistoryAppEvent, a2 as Hlc, a3 as HoleReason, a4 as JournalFullAt, a5 as LogAck, a6 as LogGap, a7 as MessageKind, a8 as OverflowReason, a9 as SealedGroupInfoRow, aa as SealedGroupInfoUpload, ab as SealedGroupInfoWrap, ac as SealingStatementRow, ad as SelfAdmission, ae as SelfAdmissionState, af as SelfAdmitRefusal, ag as SelfAdmitWait, ah as SenderRole, ai as StrandReason, aj as StrandedConversation, ak as WelcomeFailure, al as WelcomeFailureReason } from './types-D8fIp-_0.js';
3
3
  export { IndexedDbStorage } from './storage/indexeddb.js';
4
4
  export { WebSocketTransport } from './transport/websocket.js';
5
5
  export { MAX_PREVIEW_PREREQUISITES, NotificationPreviewOptions, NotificationPreviewSession, openNotificationPreview } from './notification-preview.js';
@@ -13,16 +13,38 @@ interface SealingStatement {
13
13
  /**
14
14
  * What a call that MADE a device answers: the public values the host registers
15
15
  * with the server, and the device key for the host's protected store.
16
+ * `devicePublicKey` is the device's public key (32 bytes; `deviceId` is its
17
+ * SHA-256): the value a host registers, so no host derives it from the secret.
16
18
  * `deviceSigningSecretKey` is a secret: keep it where a device key is kept
17
19
  * today, pass it to `MessagingClient.initFromDeviceRecord`, never log it.
18
20
  */
19
21
  interface NewAccountDevice {
20
22
  userId: Uint8Array;
21
23
  deviceId: Uint8Array;
24
+ devicePublicKey: Uint8Array;
22
25
  generation: number;
23
26
  statement: SealingStatement;
24
27
  deviceSigningSecretKey: Uint8Array;
25
28
  }
29
+ /**
30
+ * What `AccountSetup.prepareDeviceKey` answers: the device id (SHA-256 of the
31
+ * public key) and the public key a sign-in BY CODE names, and the device key
32
+ * for the host's protected store. `deviceSigningSecretKey` is a secret: store
33
+ * it BEFORE any request names the key, never log it.
34
+ */
35
+ interface PreparedDeviceKey {
36
+ deviceId: Uint8Array;
37
+ devicePublicKey: Uint8Array;
38
+ deviceSigningSecretKey: Uint8Array;
39
+ }
40
+ /**
41
+ * What `AccountSetup.deviceStartCheck` answers (ruling V904): what a start from
42
+ * the device record would answer on this store. `startable`: the store holds a
43
+ * device record and its device key (if it holds one yet) is the record's.
44
+ * `no-device-record`: set up, link or restore. `device-key-mismatch`: the
45
+ * store's device key, or the expected device id, is not the record's.
46
+ */
47
+ type DeviceStartCheck = "startable" | "no-device-record" | "device-key-mismatch";
26
48
  interface AccountBackupParts {
27
49
  rootPart: Uint8Array;
28
50
  statePart: Uint8Array;
@@ -30,6 +52,12 @@ interface AccountBackupParts {
30
52
  }
31
53
  /** `present`, `absent`, or `mismatch` (the pending root is LOST: copy B6). */
32
54
  type PendingRootStatus = "present" | "absent" | "mismatch";
55
+ /** What `discardPendingRoot` answers. `deleted`: the slot's pending root was
56
+ * deleted. `nothing-there`: the slot holds none. The other three are
57
+ * REFUSALS that deleted nothing: the slot's store holds a device record (the
58
+ * root may be an account's pinned root), a rotation record, or a begun link.
59
+ * Treat a value you do not know as a refusal. */
60
+ type PendingRootDiscard = "deleted" | "nothing-there" | "device-record-held" | "rotation-record-held" | "link-begun";
33
61
  /** What `POST /v1/account/generation/start` answered, as the host parsed it
34
62
  * (the account identity contract, 12.3). Public values, and the server's
35
63
  * word: the SDK believes it only as far as the root's signature goes. */
@@ -234,6 +262,30 @@ declare class AccountSetup {
234
262
  identityState: string | undefined;
235
263
  persistentStorage?: boolean;
236
264
  }): Promise<NewAccountDevice>;
265
+ /**
266
+ * THE PREPARED DEVICE KEY (rulings V895 to V900, V913, V965): the device key
267
+ * a sign-in BY CODE names on a store with no device record, before the
268
+ * account exists. The SDK draws it (no argument is a key), keeps it in one
269
+ * row of this store and answers it; a repeat answers the SAME key, and two
270
+ * tabs that call at once answer one key (the origin's account lock).
271
+ * `createAccount`, the in-memory session and `MessagingClient.beginDeviceLink`
272
+ * then make the device with that key; a restore or a take-back never uses
273
+ * it. Store the secret BEFORE any request names the key. Refusals:
274
+ * `account-already-set-up` (the store holds a device), `rotation-in-progress`,
275
+ * `device-key-held-by-link` (a link was begun in this slot: offer "Finish
276
+ * linking" or "Start over", never a retry), `prepared-key-mismatch`.
277
+ */
278
+ prepareDeviceKey(): Promise<PreparedDeviceKey>;
279
+ /** Delete a FREE prepared device key and nothing else; answers whether a
280
+ * row was deleted. Log the key's session out FIRST, and delete the host's
281
+ * own copy of the secret last. Refuses as `prepareDeviceKey` does. */
282
+ discardPreparedDeviceKey(): Promise<boolean>;
283
+ /** THE PREDICATE (ruling V904): what a start from the device record would
284
+ * answer on this store, as a typed value. It starts nothing, writes
285
+ * nothing and sends nothing. `expectedDeviceId` is the PUBLIC device id
286
+ * the host keeps, if it keeps one. Decide stop or retry on the answer,
287
+ * never on the words of an error. */
288
+ deviceStartCheck(expectedDeviceId?: Uint8Array): Promise<DeviceStartCheck>;
237
289
  /** Whether the slot holds the pending root this device expects (rule R32).
238
290
  * No prompt, no read of the seed. */
239
291
  pendingStatus(slot: string): Promise<PendingRootStatus>;
@@ -256,6 +308,14 @@ declare class AccountSetup {
256
308
  slot: string;
257
309
  fingerprint: Uint8Array;
258
310
  }): Promise<void>;
311
+ /** "Start over" on an account that was started on this device and never
312
+ * finished (rulings V1201, V1277): deletes the pending root of ONE slot and
313
+ * nothing else, or refuses with a typed answer (see `PendingRootDiscard`).
314
+ * THE HOST'S DUTY, which the SDK cannot check: the person chose it, the
315
+ * slot's stored account is the account signed in now, this sign-in's fresh
316
+ * answer is exactly `none_pinned`, and the slot's SDK store is emptied in
317
+ * the same erase. Never call it from a sweep. */
318
+ discardPendingRoot(slot: string): Promise<PendingRootDiscard>;
259
319
  /** Step 3 of a restore: the root part opens with the phrase to the PINNED
260
320
  * root; `hostState` is there when the root part's secret opens the state
261
321
  * part. Writes nothing. */
@@ -357,7 +417,10 @@ declare class AccountSetup {
357
417
  * Begin a set-up session whose root is in memory only (rule R34 a): for the
358
418
  * person who makes the backup during set-up. One session per object; it
359
419
  * lives in the Worker until `sessionFinish`, `sessionKeepAsPending` or
360
- * `close`.
420
+ * `close`. It begins ON THIS STORE (read, nothing written): the session's
421
+ * device is made for the store's free prepared device key, when
422
+ * `prepareDeviceKey` made one. `device-key-held-by-link`: a link was begun
423
+ * in this slot.
361
424
  */
362
425
  beginInMemory(identityState: string | undefined): Promise<void>;
363
426
  /** The session's backup. */
@@ -653,9 +716,11 @@ declare class MessagingClient {
653
716
  */
654
717
  private metaCache;
655
718
  /**
656
- * Per-conversation batching of sequenced live frames: the first frame goes
657
- * to the worker at once, frames that arrive while that batch is in flight
658
- * go out as ONE `processSequencedBatch` when it returns. See
719
+ * ONE lane of sequenced live frames for every conversation: the first
720
+ * frame goes to the worker at once, frames that arrive while that batch is
721
+ * in flight go out as ONE `processSequencedBatch` when it returns, in
722
+ * arrival order. Rows the engine did not take (`notTaken`) stay in the
723
+ * lane and are handed again after the next `confirmApplied`. See
659
724
  * {@link dispatchIncoming}.
660
725
  */
661
726
  private readonly coalescer;
@@ -907,10 +972,14 @@ declare class MessagingClient {
907
972
  * position, holds it ahead of a hole and drops it at or below what was
908
973
  * applied, whatever order it arrived in. What it needs is BATCHING: one
909
974
  * MLS checkpoint and one host transaction per burst instead of one per
910
- * frame. So the first frame for a conversation goes to the worker at once
911
- * as a batch of one, and frames that arrive while that batch is in flight
912
- * accumulate and go out as ONE `processSequencedBatch` when it returns; no
913
- * timer ever delays a frame. Own-device echoes are NOT dropped on this
975
+ * frame. So the first frame goes to the worker at once as a batch of one,
976
+ * and frames of ANY conversation that arrive while that batch is in flight
977
+ * accumulate and go out as ONE `processSequencedBatch` when it returns, in
978
+ * arrival order (one lane for all conversations: a catch-up of 200
979
+ * conversations is about 20 Worker calls, not 400); no timer ever delays a
980
+ * frame. Rows the engine did not take because the pending-apply journal
981
+ * had no room (`notTaken`) stay in the lane, in order, and are handed
982
+ * again after the next `confirmApplied`. Own-device echoes are NOT dropped on this
914
983
  * path: the core advances the position past them without touching MLS,
915
984
  * and dropping one would leave a hole the next frame reports as a gap. A
916
985
  * sequenced frame at `serverSeq` 0 is a legacy frame in a wrapper and
@@ -922,10 +991,12 @@ declare class MessagingClient {
922
991
  /** The actual routing, run inside the per-conversation chain. */
923
992
  private dispatchIncomingOrdered;
924
993
  /**
925
- * One coalesced batch of live frames. Errors are logged at debug and
926
- * swallowed, exactly as the legacy path treats a failed envelope: the
927
- * dispatch promise a transport may await resolves either way, and the
928
- * core retains anything it could not apply yet.
994
+ * One coalesced batch of live frames, of any number of conversations.
995
+ * Answers the indexes of the rows the engine did not take (the journal
996
+ * had no room): the lane keeps those and hands them again after the next
997
+ * `confirmApplied`. A rejection goes to the lane, which hands a refused
998
+ * batch again one conversation at a time; `dispatchIncoming` logs what
999
+ * still fails at debug and resolves.
929
1000
  */
930
1001
  private applyLiveBatch;
931
1002
  /** Start a fill for every gap a batch reported; each is single-flight. */
@@ -1194,6 +1265,14 @@ declare class MessagingClient {
1194
1265
  * an interactive call behind all of them. Resolves when every conversation
1195
1266
  * held at the start of the pass (plus any joined while it ran) has been
1196
1267
  * paged, with the decrypted application messages in apply order.
1268
+ *
1269
+ * Rejects with `StoreMovedError` when the client failed closed: before the
1270
+ * pass (it then asks nothing of the server), inside one of its steps (no
1271
+ * later conversation is asked; the pages before it were delivered), or
1272
+ * during its last step. A client that failed closed before or during the
1273
+ * pass never resolves at all, with an empty list or with any other. The
1274
+ * host drops the client and starts a new one on the same store, which
1275
+ * hands what was stored (`pendingApplies`).
1197
1276
  */
1198
1277
  syncConversations(): Promise<IncomingMessage[]>;
1199
1278
  /**
@@ -1882,14 +1961,18 @@ declare class SenderMismatchError extends Error {
1882
1961
  /** True when `e` is the typed sender refusal and no other failure. Accepts
1883
1962
  * the rejection itself, any object with a `message`, or the text. */
1884
1963
  declare function isSenderMismatchError(e: unknown): boolean;
1885
- /** How the rejection of a call reads when another writer wrote this client's
1886
- * MLS store since the client loaded it (the core's `Error::StoreMoved`). No
1887
- * other failure starts this way. Kept in lockstep with the core's display
1888
- * (`stringify` in `core/ping-wasm/src/lib.rs`, pinned by
1889
- * `ping-core/tests/release_after_durable.rs`). Raised by the file-backed
1890
- * store of the native builds only: the web SDK's stores have no writer
1891
- * claim yet, so a browser never sees it today; the class exists so the API
1892
- * is the same on every platform. */
1964
+ /** How the rejection of a call reads when this client can store nothing more
1965
+ * (the core's `Error::StoreMoved`). No other failure starts this way. Kept
1966
+ * in lockstep with the core's display (`stringify` in
1967
+ * `core/ping-wasm/src/lib.rs`, pinned by
1968
+ * `ping-core/tests/release_after_durable.rs`). Two causes. Another writer
1969
+ * wrote the client's MLS store since the client loaded it: raised by the
1970
+ * file-backed store of the native builds only (the web SDK's stores have no
1971
+ * writer claim yet). And THE CLIENT FAILED CLOSED, which a browser does
1972
+ * see: a run of rows could not store its message secrets, or a panic inside
1973
+ * the wasm closed the instance (every client of that Worker). The calls
1974
+ * that store, seal, send or acknowledge then reject with this text, and so
1975
+ * does `syncConversations()`. */
1893
1976
  declare const STORE_MOVED_PREFIX = "store moved: ";
1894
1977
  /** The stale-writer failure. Nothing was written and nothing was released (a
1895
1978
  * message being sent did not leave). The client is stale: drop it,
@@ -2096,4 +2179,4 @@ declare function emulateSendBatch(transport: Pick<Transport, "send">, envelopes:
2096
2179
  * server error code rides along for diagnostics. */
2097
2180
  declare function describeTransportError(e: unknown): string;
2098
2181
 
2099
- export { type AccountBackupParts, AccountSetup, AccountSetupClosedError, type AccountSetupConfig, AddMembersReport, AdmitChatEntry, AdmitChatOutcome, type AdoptedGeneration, ApplyBatchResult, BATCH_PARTIAL_PREFIX, BackupPhraseCheck, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DEVICE_GROUP_BEHIND_PREFIX, DeviceGroupBehindError, DeviceId, DeviceLinkApproval, type DeviceLinkBegun, type DeviceLinkClientConfig, DeviceLinkPossession, DeviceReauthProof, type DeviceRecordClientConfig, DeviceRemovalReport, EphemeralWorkerError, ExpectedOwner, ExportedSecret, FetchedSealedGroupInfo, HISTORY_REFUSED_PREFIX, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, HistoryDeliveryKeyStatement, type HistoryRefusalReason, HistoryRefusedError, HistoryShipDecision, IncomingMessage, JOURNAL_FULL_PREFIX, JournalFullError, KeyPackageEntry, LINK_ADD_REFUSED_PREFIX, LINK_CHAIN_TOO_DEEP_PREFIX, LINK_COMMITMENT_MISMATCH_PREFIX, LinkAddRefusedError, LinkChainTooDeepError, type LinkCommitment, LinkCommitmentMismatchError, type LinkExpected, LinkGeneration, LinkedDevice, LinkingTicketV3, LogHead, LogHole, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, type NewAccountDevice, NotPermittedError, OpenedHistory, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, type PendingRootStatus, type PendingRotation, READ_ONLY_PREFIX, ReadOnlyError, type RestoreJoined, type RestoreOpened, type RotationAnswer, type RotationBuild, type RotationBuilt, type RotationKeptRefusal, type RotationOutcome, type RotationPhase, type RotationPlan, type RotationRecordState, type RotationRequest, type RotationStart, type RotationStartDevice, SENDER_MISMATCH_PREFIX, STALE_GENERATION_PREFIX, STORE_MOVED_PREFIX, type SealingStatement, SelfAdmitManyEntry, SelfAdmitResult, SenderMismatchError, SequencedEnvelope, StaleGenerationError, type StateOpened, type StateRefreshed, Storage, StoreMovedError, SyncStepResult, Transport, UserId, ValidationError, type VerifiedLinkHandshakeInfo, WELCOME_MISLABELED_PREFIX, WELCOME_WAITS_PREFIX, WIRE_VERSION_MIN_ACCEPTED, WelcomeMislabeledError, WelcomeWaitsError, accountRefusalCode, backupPhraseCheckFromWire, describeTransportError, emulateSendBatch, isDeviceGroupBehindError, isHistoryRefusedError, isJournalFullError, isLinkAddRefusedError, isLinkChainTooDeepError, isLinkCommitmentMismatchError, isNotPermittedError, isReadOnlyError, isSenderMismatchError, isStaleGenerationError, isStoreMovedError, isWelcomeMislabeledError, isWelcomeWaitsError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };
2182
+ export { type AccountBackupParts, AccountSetup, AccountSetupClosedError, type AccountSetupConfig, AddMembersReport, AdmitChatEntry, AdmitChatOutcome, type AdoptedGeneration, ApplyBatchResult, BATCH_PARTIAL_PREFIX, BackupPhraseCheck, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DEVICE_GROUP_BEHIND_PREFIX, DeviceGroupBehindError, DeviceId, DeviceLinkApproval, type DeviceLinkBegun, type DeviceLinkClientConfig, DeviceLinkPossession, DeviceReauthProof, type DeviceRecordClientConfig, DeviceRemovalReport, type DeviceStartCheck, EphemeralWorkerError, ExpectedOwner, ExportedSecret, FetchedSealedGroupInfo, HISTORY_REFUSED_PREFIX, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, HistoryDeliveryKeyStatement, type HistoryRefusalReason, HistoryRefusedError, HistoryShipDecision, IncomingMessage, JOURNAL_FULL_PREFIX, JournalFullError, KeyPackageEntry, LINK_ADD_REFUSED_PREFIX, LINK_CHAIN_TOO_DEEP_PREFIX, LINK_COMMITMENT_MISMATCH_PREFIX, LinkAddRefusedError, LinkChainTooDeepError, type LinkCommitment, LinkCommitmentMismatchError, type LinkExpected, LinkGeneration, LinkedDevice, LinkingTicketV3, LogHead, LogHole, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, type NewAccountDevice, NotPermittedError, OpenedHistory, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, type PendingRootDiscard, type PendingRootStatus, type PendingRotation, type PreparedDeviceKey, READ_ONLY_PREFIX, ReadOnlyError, type RestoreJoined, type RestoreOpened, type RotationAnswer, type RotationBuild, type RotationBuilt, type RotationKeptRefusal, type RotationOutcome, type RotationPhase, type RotationPlan, type RotationRecordState, type RotationRequest, type RotationStart, type RotationStartDevice, SENDER_MISMATCH_PREFIX, STALE_GENERATION_PREFIX, STORE_MOVED_PREFIX, type SealingStatement, SelfAdmitManyEntry, SelfAdmitResult, SenderMismatchError, SequencedEnvelope, StaleGenerationError, type StateOpened, type StateRefreshed, Storage, StoreMovedError, SyncStepResult, Transport, UserId, ValidationError, type VerifiedLinkHandshakeInfo, WELCOME_MISLABELED_PREFIX, WELCOME_WAITS_PREFIX, WIRE_VERSION_MIN_ACCEPTED, WelcomeMislabeledError, WelcomeWaitsError, accountRefusalCode, backupPhraseCheckFromWire, describeTransportError, emulateSendBatch, isDeviceGroupBehindError, isHistoryRefusedError, isJournalFullError, isLinkAddRefusedError, isLinkChainTooDeepError, isLinkCommitmentMismatchError, isNotPermittedError, isReadOnlyError, isSenderMismatchError, isStaleGenerationError, isStoreMovedError, isWelcomeMislabeledError, isWelcomeWaitsError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };