@ping-app/ping-openmls-sdk 0.10.2 → 0.10.4

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.
@@ -115,7 +115,7 @@ interface DeviceReauthProof {
115
115
  }
116
116
  /** Link verification v2: an approving device's signed consent to ONE new device on
117
117
  * ONE server link session (`POST /v1/auth/link/sessions`). Produced by
118
- * `MessagingClient.signDeviceLinkApproval`. Not secret, but none of it belongs in a
118
+ * `MessagingClient.signDeviceLinkApprovalFor`. Not secret, but none of it belongs in a
119
119
  * log line. */
120
120
  interface DeviceLinkApproval {
121
121
  /** SHA-256 of the approving device's public key (32 bytes). */
@@ -133,15 +133,44 @@ interface DeviceLinkPossession {
133
133
  /** Ed25519 signature over the SDK-built possession message (64 bytes). */
134
134
  signature: Uint8Array;
135
135
  }
136
- interface LinkingTicket {
136
+ /**
137
+ * The linking ticket, version 3 (the device link under the root design):
138
+ * the account named by its root public key, the NEW device's version 2
139
+ * credential (its last link signed by the approving device's own key), the
140
+ * root's sealing key statement, the DeviceGroup Welcome and the catch-up
141
+ * snapshot. No account key signs it.
142
+ */
143
+ interface LinkingTicketV3 {
137
144
  v: number;
138
145
  user_id: UserId;
139
- user_pubkey: Bytes;
146
+ root_pubkey: Bytes;
140
147
  new_device_id: DeviceId;
141
- device_binding_sig: Bytes;
148
+ credential: Bytes;
149
+ sealing_statement: {
150
+ generation: number;
151
+ public_key: Bytes;
152
+ signature: Bytes;
153
+ };
142
154
  device_group_welcome: Bytes;
155
+ /** The DeviceGroup's log head at the Add: the new device anchors its
156
+ * DeviceGroup cursor there when it joins. No host step. */
157
+ device_group_head: number;
143
158
  catchup_snapshot: Bytes;
144
159
  }
160
+ /** The two account values of the link-auth envelope, version 6.
161
+ * `generationSecret` is a SECRET (32 bytes): it goes into the envelope the
162
+ * host seals with `sealLinkAuthFor`, and nowhere else. */
163
+ interface LinkGeneration {
164
+ generation: number;
165
+ generationSecret: Bytes;
166
+ }
167
+ /** What a completed link made. Public values. */
168
+ interface LinkedDevice {
169
+ userId: Bytes;
170
+ deviceId: Bytes;
171
+ generation: number;
172
+ depth: number;
173
+ }
145
174
  interface DiscoveredDevice {
146
175
  device_id: DeviceId;
147
176
  key_package: Bytes;
@@ -168,28 +197,6 @@ interface AdmitChatOutcome {
168
197
  /** Set when `status === "failed"`. The underlying transport / MLS error. */
169
198
  error?: string;
170
199
  }
171
- /** One conversation `rotateIdentity` could not rotate, with the error that
172
- * stopped it. Kept for type compatibility: `rotateIdentity` is retired and
173
- * always rejects. */
174
- interface IdentityRotationFailure {
175
- conversationId: ConversationId;
176
- /** The underlying transport / MLS error. */
177
- error: string;
178
- }
179
- /** Result of `rotateIdentity`. Kept for type compatibility: `rotateIdentity`
180
- * is retired and always rejects, so no call returns one. */
181
- interface IdentityRotation {
182
- /** The account id this client now presents in every new leaf, KeyPackage
183
- * and linking ticket. Equal to `userId()` after the call. */
184
- newUserId: UserId;
185
- /** The fresh DeviceGroup created for the new identity, with this device as
186
- * its sole member. The host re-registers DeviceGroup membership for it. */
187
- deviceGroupId: ConversationId;
188
- /** Conversations whose rotation Commit the server accepted. */
189
- rotated: ConversationId[];
190
- /** Conversations that keep their old leaf credential, with the error. */
191
- failed: IdentityRotationFailure[];
192
- }
193
200
  /** One conversation where a removed device still holds its leaf, or that this
194
201
  * device could not check, after `removeDeviceEverywhere` or
195
202
  * `removeOwnDevicesExcept`. */
@@ -251,8 +258,38 @@ interface HistoryAppEvent {
251
258
  * produced by a pre-`author` sender — replay falls back to the bundle sender id. */
252
259
  author?: string;
253
260
  }
261
+ /** A device's signed statement of its history delivery key: what it posts at
262
+ * every start, and what a sender is handed by the server. `device_id` is 32
263
+ * bytes, `public_key` 1216 (X-Wing), `signature` 64. `counter` is not a time. */
264
+ interface HistoryDeliveryKeyStatement {
265
+ device_id: Bytes;
266
+ counter: number;
267
+ public_key: Bytes;
268
+ signature: Bytes;
269
+ }
270
+ /** Whether history goes to a device of this account by itself (`automatic`),
271
+ * only after the person confirms on THIS device (`ask`), or not at all
272
+ * (`refused`: it is not a verified leaf of this account's DeviceGroup at the
273
+ * account's current generation; ship nothing, ask nothing, do not retry in a
274
+ * loop). */
275
+ type HistoryShipDecision = "automatic" | "ask" | "refused";
276
+ /** What opening a history transfer gave: the verified bundle, or
277
+ * `not_yet_member` (the sender is another account's device and this device
278
+ * does not hold the conversation yet: leave the transfer at the server and
279
+ * open it again after the join). */
280
+ interface OpenedHistory {
281
+ bundle?: HistoryBundle;
282
+ not_yet_member: boolean;
283
+ /** With a bundle (ruling V177): the id to hand to `confirmHistoryImport` AFTER the
284
+ * host's own store holds the bundle's events (49 bytes; an identifier, not a
285
+ * secret). Until that call the same transfer opens again as often as it is
286
+ * delivered. */
287
+ import_id?: Uint8Array;
288
+ }
254
289
  /** A conversation's decrypted history shipped device-to-device (linking / peer re-add).
255
- * Sealed+signed by `sealHistoryBundle`, opened+verified by `openHistoryBundle`. */
290
+ * Signed by the sender's device key and sealed by `sealHistoryBundleV3` (or
291
+ * `sealLinkHistoryBundle`), opened and verified by `openHistoryBundleV3`
292
+ * (or `openLinkHistoryBundle`). At most 256 events. */
256
293
  interface HistoryBundle {
257
294
  v: number;
258
295
  sender_device_id: Bytes;
@@ -262,22 +299,35 @@ interface HistoryBundle {
262
299
  window_end_ms: number;
263
300
  events: HistoryAppEvent[];
264
301
  }
265
- /** Decrypted recovery backup returned by `MessagingClient.decryptBackup`. `identity_export`
266
- * is the secret Ed25519 seed — pass it straight into `init({ identityExport })`. */
267
- interface RecoveryBackup {
268
- v: number;
269
- account_id: Bytes;
270
- identity_export: Bytes;
271
- device_group_snapshot: Bytes;
272
- /** External-conversation MLS state embedded in the backup. Empty unless the
273
- * backup was written with conversations included. Import each via
274
- * `importStateSnapshot` after restore to bring the chat + history back. */
275
- conversation_snapshots: {
276
- conversation_id: Bytes;
277
- group_state_bytes: Bytes;
278
- }[];
279
- created_at_ms: number;
280
- }
302
+ /** Why `MessagingClient.checkBackupPhrase` could not complete a check. Every value
303
+ * is a doubt about the CHECK, none is a statement about the phrase:
304
+ * - `invalidPhrase`: not a BIP39 phrase (word count, wordlist or checksum);
305
+ * - `unsupportedVersion`: the blob's version byte is one this build does not know;
306
+ * - `malformed`: not a backup this build can parse (too short, an Argon2 cost
307
+ * outside the accepted range, a payload that disagrees with its preamble);
308
+ * - `undecodable`: the authentication check PASSED (the phrase derived the right
309
+ * key) and this build cannot decode the payload;
310
+ * - `internal`: the check failed inside the SDK (the KDF refused its parameters or
311
+ * failed, a wasm trap, an out-of-memory failure, a worker that did not answer).
312
+ * No reason carries an input: all are safe to log and to persist. */
313
+ type BackupCheckFailure = "invalidPhrase" | "unsupportedVersion" | "malformed" | "undecodable" | "internal";
314
+ /** The answer of `MessagingClient.checkBackupPhrase`: whether a phrase opens a
315
+ * recovery backup, as a code to switch on.
316
+ * - `opens`: the phrase opens the backup.
317
+ * - `authenticationFailed`: PROOF. The backup's own authentication check (the
318
+ * AES-256-GCM tag) failed under the key derived from the phrase: the phrase does
319
+ * not open these exact bytes (wrong words, or bytes that are not what the words
320
+ * sealed). The only answer on which a host may delete a stored phrase.
321
+ * - `couldNotCheck`: DOUBT. Nothing is known about the phrase: delete nothing,
322
+ * claim nothing, ask again later. */
323
+ type BackupPhraseCheck = {
324
+ outcome: "opens";
325
+ } | {
326
+ outcome: "authenticationFailed";
327
+ } | {
328
+ outcome: "couldNotCheck";
329
+ reason: BackupCheckFailure;
330
+ };
281
331
  /** An envelope together with the server's log position for it. `serverSeq`
282
332
  * 0 means the host does not know the position (a transport that predates
283
333
  * positions); the envelope then takes the legacy per-sender path. */
@@ -313,6 +363,11 @@ interface LogHead {
313
363
  conversationId: ConversationId;
314
364
  headServerSeq: number;
315
365
  headEpoch: number;
366
+ /** The delivery service says a sealed GroupInfo is WANTED for this
367
+ * conversation (a device of a member account waits to let itself in):
368
+ * a member device at the head's epoch publishes one by itself, once per
369
+ * conversation per epoch. Absent reads as `false`. */
370
+ sealedGroupInfoWanted?: boolean;
316
371
  }
317
372
  /** A hole between what this device has applied and a live frame the SDK
318
373
  * holds: the rows from `appliedServerSeq + 1` to `firstBufferedServerSeq - 1`
@@ -383,6 +438,47 @@ interface StrandedConversation {
383
438
  * reported and the fill re-fetches them) or `retainedFrames` (page the
384
439
  * conversation to its end once it is held again). */
385
440
  type OverflowReason = "heldFrames" | "retainedFrames";
441
+ /** Why a position of a conversation's log was not applied on this device.
442
+ * `refusedCommit`: a Commit this device refused (what was sealed after it is
443
+ * unreadable here until the device is re-admitted); `cannotDecrypt`: sealed
444
+ * for an epoch this device does not hold; `notHeld`: the device did not hold
445
+ * the conversation; `invalid`: refused for what it is; `internal`: the
446
+ * device's own store failed. */
447
+ type HoleReason = "refusedCommit" | "cannotDecrypt" | "notHeld" | "invalid" | "internal"
448
+ /** Before my return (ruling V406 (b)): the range between what any device
449
+ * of the account last acknowledged and this device's own entry by an
450
+ * external Commit. Never handed to it; no content hashes. Fill it from
451
+ * the members' history hand-over or show the gap, then `resolveLogHole`. */
452
+ | "beforeReturn";
453
+ /** A range of a conversation's log this device did not apply: positions, a
454
+ * reason and the content hashes the envelopes named (at most 64). Never any
455
+ * content. `kept: true`: the SDK still holds those rows durably and tries
456
+ * them again by itself; `false`: recorded for good, until `resolveLogHole`. */
457
+ interface LogHole {
458
+ conversationId: ConversationId;
459
+ fromServerSeq: number;
460
+ toServerSeq: number;
461
+ reason: HoleReason;
462
+ contentHashes: Uint8Array[];
463
+ kept: boolean;
464
+ }
465
+ /** A position that is safe to acknowledge to the delivery service: stored by
466
+ * the call that reported it, with every row at or below it applied, kept
467
+ * durably, or a recorded hole. */
468
+ interface LogAck {
469
+ conversationId: ConversationId;
470
+ serverSeq: number;
471
+ }
472
+ /** Where a batch or a page stopped applying a conversation's rows because the
473
+ * SDK's pending-apply journal is full (the journal never drops a message the
474
+ * host has not confirmed). `serverSeq`: the first log position NOT applied (0
475
+ * when the row was handed without a position). `rows`: how many rows of the
476
+ * conversation the call left unapplied. */
477
+ interface JournalFullAt {
478
+ conversationId: ConversationId;
479
+ serverSeq: number;
480
+ rows: number;
481
+ }
386
482
  interface BufferOverflow {
387
483
  conversationId: ConversationId;
388
484
  reason: OverflowReason;
@@ -399,7 +495,11 @@ type AddMemberStatus = "added" | "alreadyMember" | "duplicateEntry" | "malformed
399
495
  * group's policy records an owner, this account is neither the owner nor
400
496
  * an admin, and the entry is not one of its own devices. Nothing is sent
401
497
  * for it; show "only an admin can do this". */
402
- | "notPermitted";
498
+ | "notPermitted"
499
+ /** Its device credential verifies at an older generation than this device
500
+ * knows for its account (2026-11-25). Nothing is sent for it; claim a
501
+ * fresh KeyPackage of that device and ask again. */
502
+ | "staleGeneration";
403
503
  interface AddMemberVerdict {
404
504
  deviceId: DeviceId;
405
505
  status: AddMemberStatus;
@@ -419,6 +519,23 @@ interface CommitInDoubt {
419
519
  attempts: number;
420
520
  nextAttemptAtMs: number;
421
521
  }
522
+ /** A device that entered a conversation by its own act (an external Commit
523
+ * this device merged). The ONLY source of the line "rejoined on a new
524
+ * device": no message announces a self-admission, so the joiner can neither
525
+ * forge the line nor leave it out. Do not log the ids. */
526
+ interface SelfAdmission {
527
+ conversationId: ConversationId;
528
+ /** The verified account identity of the joiner's leaf. */
529
+ identity: UserId;
530
+ deviceId: DeviceId;
531
+ /** The same device put its leaf back. */
532
+ replacedOwnLeaf: boolean;
533
+ /** The account is this client's own: a sibling device entered (read the
534
+ * sessions list for the new-device alert). */
535
+ ownAccount: boolean;
536
+ /** The MLS epoch the Commit was processed in. */
537
+ epoch: number;
538
+ }
422
539
  /** Outcome of `processSequencedBatch`. `messages` are the decrypted
423
540
  * application messages in apply order. */
424
541
  interface ApplyBatchResult {
@@ -450,6 +567,32 @@ interface ApplyBatchResult {
450
567
  proposalsPending: ConversationId[];
451
568
  /** Frames the bounded buffers could not keep. */
452
569
  overflow: BufferOverflow[];
570
+ /** Devices that entered by an external Commit this device merged, each
571
+ * reported once (with the batch that processed the Commit, or with the
572
+ * next result when an internal catch-up did). Empty for every other
573
+ * Commit and for a refused one. */
574
+ selfAdmissions: SelfAdmission[];
575
+ /** Positions recorded as holes since the last result that carried this
576
+ * field (all with `kept: false`). `logHoles` lists every hole. */
577
+ holes: LogHole[];
578
+ /** The positions this call STORED, per conversation: the ONLY positions a
579
+ * host may acknowledge to the delivery service from this result. A frame
580
+ * held ahead of a gap and a row whose checkpoint failed are never at or
581
+ * below one. */
582
+ acks: LogAck[];
583
+ /** Conversations in which this call left rows UNAPPLIED because the
584
+ * pending-apply journal is full. Nothing of those rows was taken: the
585
+ * position did not move for them, they are in no `acks` entry, they are
586
+ * neither kept nor holes. Save the messages handed over, call
587
+ * `confirmApplied`, then hand the rows again (the same batch, or the
588
+ * conversation's next page). Empty in every other case. */
589
+ journalFull: JournalFullAt[];
590
+ /** THE ACCOUNT'S STATE PART IS OWED A WRITE (2026-11-27): the anchor record
591
+ * changed (a join, a leave, a change of a group's owner or admins). Said
592
+ * once, with the batch at which the SDK saw it; the host calls
593
+ * `refreshStateBackup` at its next allowed write and stores the part.
594
+ * Present (and `true`) only on the batch that says it. */
595
+ stateBackupOwed?: boolean;
453
596
  }
454
597
  /** Outcome of one page of `syncConversationStep`. */
455
598
  interface SyncStepResult {
@@ -468,6 +611,15 @@ interface SyncStepResult {
468
611
  stranded: StrandedConversation[];
469
612
  proposalsPending: ConversationId[];
470
613
  overflow: BufferOverflow[];
614
+ /** As `ApplyBatchResult.selfAdmissions`. */
615
+ selfAdmissions: SelfAdmission[];
616
+ /** As `ApplyBatchResult.holes`. */
617
+ holes: LogHole[];
618
+ /** As `ApplyBatchResult.acks`. */
619
+ acks: LogAck[];
620
+ /** As `ApplyBatchResult.journalFull`. A page that stopped for the journal
621
+ * and moved no position answers `hasMore: false`. */
622
+ journalFull: JournalFullAt[];
471
623
  }
472
624
  /** Where a batch delivered to `onMessageBatch` came from: a live socket
473
625
  * batch, or a page of the server log (a gap fill, or the whole-account
@@ -540,6 +692,152 @@ interface Transport {
540
692
  * Welcome send. Hosts that route Welcomes differently (or don't need
541
693
  * per-recipient routing) may leave this unimplemented. */
542
694
  setNextWelcomeRecipients?(conversationId: ConversationId, recipientDeviceIds: DeviceId[]): Promise<void>;
695
+ /** Optional (self-admission). Post ONE external Commit. Reject with an
696
+ * error carrying a numeric `status` for a definite refusal, and with an
697
+ * error whose `epochOccupied` property is `true` when the delivery
698
+ * service answers that the epoch has moved. On ANY post (`send`,
699
+ * `sendBatch`, this one) reject with an error whose `staleGeneration`
700
+ * property is `true` when the service answers `409 stale_generation`:
701
+ * the SDK undoes the pending Commit and rejects the call with its
702
+ * stale verdict (`isStaleGenerationError`). A host that leaves the four
703
+ * self-admission methods unimplemented makes no self-admission. */
704
+ sendExternalCommit?(envelope: MessageEnvelope): Promise<void>;
705
+ /** Optional. What the delivery service states of up to 500 conversations
706
+ * of this device's ACCOUNT, in ONE request: at most one row per
707
+ * conversation asked for; no row reads as "nothing published".
708
+ * `unusable` (ruling V461; at most 64, each one of `conversations`, empty
709
+ * when the device names none): the conversations whose served
710
+ * publication this device could not use. Send them as
711
+ * `unopened_conversation_ids` of the same request; the delivery service
712
+ * then asks an online member device to publish. A host that ignores the
713
+ * argument behaves as before. */
714
+ fetchSelfAdmissionStates?(conversations: ConversationId[], unusable?: ConversationId[]): Promise<SelfAdmissionState[]>;
715
+ /** Optional. The sealed GroupInfos of up to 64 conversations in ONE
716
+ * request, each with THIS account's wrap; as many as fit in 2 MiB. */
717
+ fetchSealedGroupInfos?(conversations: ConversationId[]): Promise<SealedGroupInfoRow[]>;
718
+ /** Optional. External Commits of several conversations in ONE post: one
719
+ * answer per envelope, in the order given. Left unimplemented (or
720
+ * answering `null`), the SDK posts them one at a time through
721
+ * `sendExternalCommit`. */
722
+ sendExternalCommits?(envelopes: MessageEnvelope[]): Promise<(ExternalCommitAnswer | ExternalCommitPosted)[] | null>;
723
+ /** Optional (the publishing half of self-admission, ruling V320). The SDK
724
+ * calls the two methods BY ITSELF at the end of a batch; a host that
725
+ * leaves them unimplemented publishes nothing. The sealing-key
726
+ * statements of up to 64 member ACCOUNTS of ONE conversation in ONE
727
+ * request, as the server holds them (an account with no statement has no
728
+ * row). `conversation` (ruling S243) is the conversation the publication
729
+ * is for: send it as `conversation_id` of the request. `null`: no
730
+ * route. */
731
+ fetchSealingStatements?(accounts: UserId[], conversation: ConversationId): Promise<SealingStatementRow[] | null>;
732
+ /** Optional. Store the sealed GroupInfo of ONE conversation at ONE epoch
733
+ * with one wrap per member account, in ONE request. Resolve `true` ONLY
734
+ * when the service stored it (anything else reads as "no route" and the
735
+ * SDK asks nothing more in this session). Reject with an error whose
736
+ * `epochOccupied` property is `true` when the conversation is past that
737
+ * epoch, with a numeric `status` for a definite refusal, with anything
738
+ * else for "no answer" (the SDK offers it again with a later batch). */
739
+ publishSealedGroupInfo?(publication: SealedGroupInfoUpload): Promise<boolean>;
740
+ }
741
+ /** One account's sealing-key statement as the server holds it. Public
742
+ * values; nothing is trusted until the SDK has verified the statement
743
+ * under the root key of that account's leaf. */
744
+ interface SealingStatementRow {
745
+ userId: UserId;
746
+ generation?: number;
747
+ publicKey: Uint8Array;
748
+ signature: Uint8Array;
749
+ }
750
+ /** One member account's wrap of a publication's content key. */
751
+ interface SealedGroupInfoWrap {
752
+ userId: UserId;
753
+ wrap: Uint8Array;
754
+ }
755
+ /** What the SDK uploads for one conversation at one epoch. Sealed bytes:
756
+ * never a log value. */
757
+ interface SealedGroupInfoUpload {
758
+ conversationId: ConversationId;
759
+ epoch: number;
760
+ blob: Uint8Array;
761
+ wraps: SealedGroupInfoWrap[];
762
+ }
763
+ /** Why a self-admission did not happen now and may later. Never shown to a
764
+ * person: the host waits (for `notPublished` and `unanchored`: until the
765
+ * account event of a publication arrives). `anchorsWithheld` (the owner's
766
+ * decision OD33): this device restored its account and the anchor record it
767
+ * was owed did not open; it does not let itself in unanchored and comes back
768
+ * when a member adds it. */
769
+ type SelfAdmitWait = "markerMissing" | "proposalsPending" | "unanchored" | "notPublished" | "anchorsWithheld";
770
+ /** Why an entry point did not run the join, or why the join was refused. A
771
+ * name only. `notCompiled`: this build holds no self-admission and nothing
772
+ * was touched. `anchorRecord`: the record this device holds does not read. */
773
+ type SelfAdmitRefusal = "notCompiled" | "anchorRecord" | "tooManyRecipients" | "sealed" | "transport" | "transportRejected" | "engine" | "staleGeneration";
774
+ /** What a self-admission did. `unanchored`: the device held no anchor entry
775
+ * for the conversation, so nothing checked who built the tree it entered;
776
+ * kept for the record, no host shows anything for it. */
777
+ type SelfAdmitResult = {
778
+ kind: "joined";
779
+ epoch: number;
780
+ replacedOwnLeaf: boolean;
781
+ replayed: IncomingMessage[];
782
+ unanchored: boolean;
783
+ /** The range of the conversation's log the device could not read
784
+ * before its return, as a typed hole (`beforeReturn`), already
785
+ * recorded (`logHoles` lists it until `resolveLogHole`). Absent when
786
+ * the range is empty or the transport stated no position for the
787
+ * Commit (ruling V406 (b)). */
788
+ beforeReturn?: LogHole;
789
+ } | {
790
+ kind: "alreadyHeld";
791
+ } | {
792
+ kind: "stale";
793
+ currentEpoch?: number;
794
+ } | {
795
+ kind: "notYet";
796
+ reason: SelfAdmitWait;
797
+ } | {
798
+ kind: "refused";
799
+ refusal: SelfAdmitRefusal;
800
+ };
801
+ interface SelfAdmitManyEntry {
802
+ conversationId: ConversationId;
803
+ result: SelfAdmitResult;
804
+ }
805
+ /** What the delivery service returned for one conversation: the sealed
806
+ * blob, THIS account's wrap, the number of wraps of the publication and,
807
+ * when the service says so, the conversation's current epoch. Sealed
808
+ * bytes: never a log value. */
809
+ interface FetchedSealedGroupInfo {
810
+ blob: Uint8Array;
811
+ wrap: Uint8Array;
812
+ wrapCount: number;
813
+ currentEpoch?: number;
814
+ }
815
+ /** What the delivery service states of one conversation to a device of a
816
+ * member account that does not hold it. */
817
+ interface SelfAdmissionState {
818
+ conversationId: ConversationId;
819
+ currentEpoch: number;
820
+ /** The epoch of the sealed GroupInfo held with a wrap for this account. */
821
+ publishedEpoch?: number;
822
+ /** The server's `acknowledged_seq` (ruling V406 (b)): the highest log
823
+ * position any device of this account acknowledged there. It sizes the
824
+ * hole "before my return"; leave it out when the service states none. */
825
+ acknowledgedSeq?: number;
826
+ }
827
+ interface SealedGroupInfoRow extends FetchedSealedGroupInfo {
828
+ conversationId: ConversationId;
829
+ }
830
+ /** The delivery service's answer to ONE external Commit of a batched post.
831
+ * `accepted` ONLY when it took that Commit. */
832
+ type ExternalCommitAnswer = "accepted" | "epochOccupied" | "rejected" | "unanswered" | "staleGeneration";
833
+ /** RULINGS V406 AND V408: one answer of `sendExternalCommits` together with
834
+ * the position (`server_seq`) the delivery service gave an accepted Commit.
835
+ * With it the join leaves its conversation anchored at that position (the
836
+ * ordinary resume carries it, no page request a conversation) and states
837
+ * the range before it as a typed hole. */
838
+ interface ExternalCommitPosted {
839
+ answer: ExternalCommitAnswer;
840
+ serverSeq?: number;
543
841
  }
544
842
 
545
- export type { WelcomeFailure as $, AddMembersReport as A, BufferOverflow as B, ConversationId as C, DiscoveredDevice as D, ExpectedOwner as E, ConversationUpdate as F, DeviceInfo as G, HistoryBundle as H, IdentityRotation as I, DeviceRemovalFailure as J, KeyPackageEntry as K, LinkingTicket as L, MessageEnvelope as M, HistoryAppEvent as N, Hlc as O, PendingApply as P, IdentityRotationFailure as Q, RecoveryBackup as R, Storage as S, Transport as T, UserId as U, LogGap as V, MessageKind as W, OverflowReason as X, SenderRole as Y, StrandReason as Z, StrandedConversation as _, DeviceId as a, WelcomeFailureReason as a0, ConversationMeta as b, DeviceReauthProof as c, DeviceLinkApproval as d, DeviceLinkPossession as e, CommitInDoubt as f, MemberInfo as g, ConversationPolicy as h, IncomingMessage as i, SequencedEnvelope as j, ApplyBatchResult as k, SyncStepResult as l, LogPosition as m, LogHead as n, CatchupAppEvent as o, CatchupSnapshotView as p, AdmitChatEntry as q, AdmitChatOutcome as r, DeviceRemovalReport as s, ExportedSecret as t, MessageBatchMeta as u, AddMemberStatus as v, AddMemberVerdict as w, Bytes as x, CatchupSnapshotEntry as y, ConversationRemoval as z };
843
+ export type { ExternalCommitAnswer as $, AddMembersReport as A, BackupPhraseCheck as B, ConversationId as C, DiscoveredDevice as D, ExpectedOwner as E, FetchedSealedGroupInfo as F, MessageBatchMeta as G, HistoryDeliveryKeyStatement as H, IncomingMessage as I, AddMemberStatus as J, KeyPackageEntry as K, LinkingTicketV3 as L, MessageEnvelope as M, AddMemberVerdict as N, OpenedHistory as O, PendingApply as P, BackupCheckFailure as Q, BufferOverflow as R, Storage as S, Transport as T, UserId as U, Bytes as V, CatchupSnapshotEntry as W, ConversationRemoval as X, ConversationUpdate as Y, DeviceInfo as Z, DeviceRemovalFailure as _, DeviceId as a, ExternalCommitPosted as a0, HistoryAppEvent as a1, Hlc as a2, HoleReason as a3, JournalFullAt as a4, LogAck as a5, LogGap as a6, MessageKind as a7, OverflowReason as a8, SealedGroupInfoRow as a9, SealedGroupInfoUpload as aa, SealedGroupInfoWrap as ab, SealingStatementRow as ac, SelfAdmission as ad, SelfAdmissionState as ae, SelfAdmitRefusal as af, SelfAdmitWait as ag, SenderRole as ah, StrandReason as ai, StrandedConversation as aj, WelcomeFailure as ak, WelcomeFailureReason as al, ConversationMeta as b, DeviceReauthProof as c, DeviceLinkApproval as d, DeviceLinkPossession as e, CommitInDoubt as f, MemberInfo as g, ConversationPolicy as h, SelfAdmitResult as i, SelfAdmitManyEntry as j, SequencedEnvelope as k, ApplyBatchResult as l, SyncStepResult as m, LogPosition as n, LogHole as o, LogHead as p, CatchupSnapshotView as q, CatchupAppEvent as r, LinkGeneration as s, LinkedDevice as t, HistoryBundle as u, HistoryShipDecision as v, AdmitChatEntry as w, AdmitChatOutcome as x, DeviceRemovalReport as y, ExportedSecret as z };