@ghostlytools/sdk 1.2.3 → 1.2.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.
@@ -640,6 +640,7 @@ function withRequestOptions(transport, extra) {
640
640
  if (transport.subscribe) wrapped.subscribe = (listener) => transport.subscribe(listener);
641
641
  if (transport.networkChanged) wrapped.networkChanged = () => transport.networkChanged();
642
642
  if (transport.readAnsweredAt) wrapped.readAnsweredAt = (pubKeyZ32) => transport.readAnsweredAt(pubKeyZ32);
643
+ if (transport.readHeldBackFor) wrapped.readHeldBackFor = (pubKeyZ32) => transport.readHeldBackFor(pubKeyZ32);
643
644
  if (transport.onServerTime) wrapped.onServerTime = (listener) => transport.onServerTime(listener);
644
645
  if (transport.configure) wrapped.configure = (options) => transport.configure(options);
645
646
  if (transport.turnRead) wrapped.turnRead = (pubKeyZ32, options) => transport.turnRead(pubKeyZ32, options);
@@ -887,6 +888,11 @@ var isGroupSignal = (who) => who.group && !who.background && (who.signal || isWa
887
888
  var watchLane = (who) => `${+who.urgent}${+who.background}`;
888
889
  /** A group's read that is not a background one: an edge's, a private group's knock poll (`GROUP_RATION_WINDOW_MS`). */
889
890
  var isGroupRead = (who) => who.group && !who.write && !who.background;
891
+ /**
892
+ * A read that takes its turn per key with the others (`READ_TURN_MS`): a background one, and a 1:1 chat's at any pace.
893
+ * Not a community door's bell.
894
+ */
895
+ var isTurnRead = (who) => !who.write && !who.door && (who.background || !who.group);
890
896
  /** A write that goes first once the budget frees a request (see `WRITE_FIRST_MS`): a chat's or a group's, never a background one. */
891
897
  var firstWriter = (who) => !who.write || who.background ? null : who.group ? "group" : "chat";
892
898
  /**
@@ -998,6 +1004,29 @@ var WATCH_SHARE = 1 / 3;
998
1004
  * waits, the others wait too (`WATCH_SHARE`, `GROUP_RATION_WINDOW_MS`). One that stops asking loses it.
999
1005
  */
1000
1006
  var WATCH_TURN_MS = 5e3;
1007
+ /**
1008
+ * Background reads, and a 1:1 chat's at any pace, take turns per key the same way: while a key read longer ago asked
1009
+ * within this long and was not read since, a read of another key waits (a chat's, at a pace that is not the background
1010
+ * one, only for another chat's key). A saved chat that is not live reads its contact every 30 s in the
1011
+ * background, and one the budget refused read again only at its next poll. A request frees 60 s after the one that took
1012
+ * it, which is the poll after next of the chat that took it: the same chats took every request that freed. A daemon with
1013
+ * 30 chats and 5 groups, back after a restart while its groups signaled, read some contacts once in 10 min, and those
1014
+ * chats stayed down although both sides were online and offering (CLI bug hunt, 2026-10-12). A link's background read
1015
+ * the budget refused reads again when it frees a request (`LinkSession`), so the key whose turn it is is there to take it.
1016
+ * A chat not live after a restart looks fast while its offer is out, and those reads took no turn: the budget answered
1017
+ * them from the packet read before, every 2 to 8 s for 10 minutes, while the chats that were live already, the groups'
1018
+ * edges and the writes took every request that freed. A quarter of a daemon's 30 chats read their contact once in 10
1019
+ * minutes, their contacts online and offering, and showed them offline at 6 minutes (CLI bug hunt, 2026-10-13).
1020
+ */
1021
+ var READ_TURN_MS = 5e3;
1022
+ /**
1023
+ * A 1:1 chat's read the budget held back this long without a break is starved: it goes before the writes that wait
1024
+ * (`WRITE_FIRST_MS`) and past the background share, within the minute, the key held back longest first. A daemon back
1025
+ * after a restart spends its whole minute on writes (each chat's and edge's offer, its packets after the attempt), which
1026
+ * go first, and requests free in bursts as the minute's first requests age out: every burst went to the writes that
1027
+ * waited, and the reads of the chats that were not in an attempt never had their turn (CLI restart lab, 2026-10-13).
1028
+ */
1029
+ var READ_STARVED_MS = 6e4;
1001
1030
  /** How long a read that let an older one go first waits before it asks again. */
1002
1031
  var TURN_WAIT_MS = 1e3;
1003
1032
  /**
@@ -1144,6 +1173,8 @@ var RelayTransport = class {
1144
1173
  * it is under the watch share (`WATCH_SHARE`) and while the groups' reads are rationed (`GROUP_RATION_WINDOW_MS`).
1145
1174
  */
1146
1175
  readTurns = /* @__PURE__ */ new Map();
1176
+ /** Per key read in turn (`isTurnRead`), when a read of it last went out and when it last asked (`READ_TURN_MS`). */
1177
+ keyTurns = /* @__PURE__ */ new Map();
1147
1178
  /** Groups' reads (not background ones) on each relay in the last `GROUP_RATION_WINDOW_MS`. */
1148
1179
  spentGroupReads = /* @__PURE__ */ new Map();
1149
1180
  /** When a group's read last found each relay's minute full: its reads there are rationed for `GROUP_RATION_MS`. */
@@ -1163,6 +1194,11 @@ var RelayTransport = class {
1163
1194
  /** Per relay and key, the newest packet that relay held back for its budget while another relay took it (`catchUpLater`). */
1164
1195
  catchUp = /* @__PURE__ */ new Map();
1165
1196
  catchUpTimer = null;
1197
+ /**
1198
+ * Per key whose reads the budget held back since its last read went out: when a request frees for it
1199
+ * (`readHeldBackFor`), how many times in a row, and since when (`READ_STARVED_MS`).
1200
+ */
1201
+ heldBack = /* @__PURE__ */ new Map();
1166
1202
  /** When the relays last answered a read of each key, for `FRESH_READ_MS`. */
1167
1203
  readAt = /* @__PURE__ */ new Map();
1168
1204
  freshReadMs;
@@ -1552,8 +1588,14 @@ var RelayTransport = class {
1552
1588
  }
1553
1589
  const resting = this.relays.every((r) => this.isCoolingDown(r, "GET") || this.breaker.blockedFor(r) > 0 || this.heldFor(r, who, Date.now(), pubKeyZ32) > 0);
1554
1590
  const known = down ? this.newest.get(pubKeyZ32) : newerPacket(this.newest.get(pubKeyZ32), this.written.get(pubKeyZ32));
1555
- if (resting && known) return known;
1556
- if (!down && budgetWait < Infinity) throw new DiscoveryBudgetError(budgetWait);
1591
+ if (resting && known) {
1592
+ if (!down && budgetWait < Infinity) this.heldBackUntil(pubKeyZ32, Date.now() + budgetWait);
1593
+ return known;
1594
+ }
1595
+ if (!down && budgetWait < Infinity) {
1596
+ this.heldBackUntil(pubKeyZ32, Date.now() + budgetWait);
1597
+ throw new DiscoveryBudgetError(budgetWait);
1598
+ }
1557
1599
  throw new Error("No Pkarr relay reachable");
1558
1600
  }
1559
1601
  /** The order a key's read asks the relays in: in turn per key (see `resolve`), relays found slow lately last. */
@@ -1620,9 +1662,25 @@ var RelayTransport = class {
1620
1662
  readAnsweredAt(pubKeyZ32) {
1621
1663
  return this.readAt.get(pubKeyZ32);
1622
1664
  }
1665
+ readHeldBackFor(pubKeyZ32) {
1666
+ const held = this.heldBack.get(pubKeyZ32);
1667
+ const left = held === void 0 ? 0 : held.until - Date.now();
1668
+ return left > 0 ? left : void 0;
1669
+ }
1670
+ heldBackUntil(pubKeyZ32, until) {
1671
+ const held = this.heldBack.get(pubKeyZ32), times = (held?.times ?? 0) + 1;
1672
+ this.heldBack.delete(pubKeyZ32);
1673
+ this.heldBack.set(pubKeyZ32, {
1674
+ until,
1675
+ times,
1676
+ since: held?.since ?? Date.now()
1677
+ });
1678
+ if (this.heldBack.size > READ_TURNS_KEPT) this.heldBack.delete(this.heldBack.keys().next().value);
1679
+ }
1623
1680
  /** The relays answered a read of this key now; answers older than `FRESH_READ_MS` are dropped as the list grows. */
1624
1681
  answeredRead(pubKeyZ32) {
1625
1682
  const now = Date.now();
1683
+ this.heldBack.delete(pubKeyZ32);
1626
1684
  this.readAt.delete(pubKeyZ32);
1627
1685
  this.readAt.set(pubKeyZ32, now);
1628
1686
  if (this.readAt.size > 64) for (const [key, at] of this.readAt) {
@@ -1738,6 +1796,7 @@ var RelayTransport = class {
1738
1796
  if (isChat(who)) this.chatNeed(key).urgentAt = now;
1739
1797
  }
1740
1798
  if (isGroupRead(who)) this.readAsked(key, who, now);
1799
+ if (isTurnRead(who)) this.turnAsked(key, who, now);
1741
1800
  if (this.heldFor(relay, who, now, key) > 0) {
1742
1801
  if (isGroupRead(who) && (this.spent.get(relay)?.length ?? 0) >= this.limitOf(relay)) this.groupsFullAt.set(relay, now);
1743
1802
  if (isChat(who)) this.chatNeed(key).refused.set(relay, now);
@@ -1761,6 +1820,12 @@ var RelayTransport = class {
1761
1820
  lane: watchLane(who)
1762
1821
  });
1763
1822
  }
1823
+ if (isTurnRead(who)) this.keyTurns.set(key, {
1824
+ servedAt: now,
1825
+ askedAt: now,
1826
+ waiting: false,
1827
+ who
1828
+ });
1764
1829
  return true;
1765
1830
  }
1766
1831
  /**
@@ -1772,7 +1837,7 @@ var RelayTransport = class {
1772
1837
  * signaling goes over the limit by its allowance (`SIGNALING_ALLOWANCE_SHARE`), and so do a few of its reads of a
1773
1838
  * contact that just went away (`DEPARTED_READS`).
1774
1839
  */
1775
- heldFor(relay, who, now = Date.now(), key) {
1840
+ heldFor(relay, who, now = Date.now(), key, turns = true) {
1776
1841
  const recent = (this.spent.get(relay) ?? []).filter((at) => now - at < 6e4);
1777
1842
  const recentBackground = (this.spentBackground.get(relay) ?? []).filter((at) => now - at < 6e4);
1778
1843
  this.spent.set(relay, recent);
@@ -1782,10 +1847,11 @@ var RelayTransport = class {
1782
1847
  const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.departedReads(key, now) < 6;
1783
1848
  const share = isChatSignal(who) || departed ? SIGNALING_ALLOWANCE_SHARE : isGroupSignal(who) ? GROUP_SIGNALING_ALLOWANCE_SHARE : 0;
1784
1849
  let wait = over(recent, limit + (share ? Math.max(0, Math.floor(limit * share) - (who.write ? 0 : 1)) : 0));
1850
+ const starved = key !== void 0 && this.starved(key, who, now);
1785
1851
  const groupOver = (this.spentGroupOver.get(relay) ?? []).filter((at) => now - at < GROUP_OVER_PACE_MS);
1786
1852
  this.spentGroupOver.set(relay, groupOver);
1787
1853
  if (isGroupSignal(who) && !who.write && recent.length >= limit && groupOver.length > 0) wait = Math.max(wait, groupOver[groupOver.length - 1] + GROUP_OVER_PACE_MS - now);
1788
- if (who.background) {
1854
+ if (who.background && !starved) {
1789
1855
  wait = Math.max(wait, over(recentBackground, this.backgroundPerMinute));
1790
1856
  const signaling = this.urgentAt + SIGNALING_WINDOW_MS - now;
1791
1857
  if (signaling > 0 && !who.door) wait = Math.max(wait, Math.min(signaling, over(recentBackground, this.backgroundWhileSignaling)));
@@ -1820,8 +1886,9 @@ var RelayTransport = class {
1820
1886
  const at = this.writeWaiting.get(`${lane} ${relay}`);
1821
1887
  return at !== void 0 && now - at < 5e3 ? at + WRITE_FIRST_MS - now : 0;
1822
1888
  };
1823
- if (writer !== "chat" && !departed) wait = Math.max(wait, waiting("chat"));
1824
- if (writer === null && who.group && !pastLimit || who.background) wait = Math.max(wait, waiting("group"));
1889
+ if (writer !== "chat" && !departed && !starved) wait = Math.max(wait, waiting("chat"));
1890
+ if ((writer === null && who.group && !pastLimit || who.background) && !starved) wait = Math.max(wait, waiting("group"));
1891
+ if (turns && wait <= 0 && isTurnRead(who) && this.turnAhead(relay, key, who, now)) wait = TURN_WAIT_MS;
1825
1892
  return Math.max(wait, 0);
1826
1893
  }
1827
1894
  /** A group's read of `key` asks: it waits for its turn from now on, unless it is taken (`readsAhead`). */
@@ -1851,6 +1918,39 @@ var RelayTransport = class {
1851
1918
  }
1852
1919
  return ahead;
1853
1920
  }
1921
+ /** A read of `key` that takes turns asks: it waits for its turn from now on, unless it is taken (`turnAhead`). */
1922
+ turnAsked(key, who, now) {
1923
+ for (const [other, turn] of this.keyTurns) if (now - Math.max(turn.askedAt, turn.servedAt) >= 6e4) this.keyTurns.delete(other);
1924
+ this.keyTurns.set(key, {
1925
+ servedAt: this.keyTurns.get(key)?.servedAt ?? -Infinity,
1926
+ askedAt: now,
1927
+ waiting: true,
1928
+ who
1929
+ });
1930
+ }
1931
+ /**
1932
+ * Whether a key read in turn longer ago than `key`, still asking, would take this relay's next request: one read in the
1933
+ * background for a background read, and a chat's that is starved (`READ_STARVED_MS`) for any. One asks again after
1934
+ * the budget held it back (a link's poll does, a one-off look does not), and keeps asking within `READ_TURN_MS` of its
1935
+ * last ask, or of when it was told the budget frees a request for it (`readHeldBackFor`).
1936
+ * One the budget holds back on its own account (a group's read, for the chats' reserve) keeps no turn: a group key
1937
+ * waiting for the chats held every chat's read back (CLI lab, 2026-10-13).
1938
+ */
1939
+ turnAhead(relay, key, who, now) {
1940
+ const mine = key === void 0 ? -Infinity : this.keyTurns.get(key)?.servedAt ?? -Infinity;
1941
+ for (const [other, turn] of this.keyTurns) {
1942
+ const held = this.heldBack.get(other);
1943
+ if (other === key || !turn.waiting || turn.servedAt >= mine || !held || held.times < 2) continue;
1944
+ if (!(who.background && turn.who.background) && !this.starved(other, turn.who, now)) continue;
1945
+ if (now - Math.max(turn.askedAt, held.until) < READ_TURN_MS && this.heldFor(relay, turn.who, now, other, false) === 0) return true;
1946
+ }
1947
+ return false;
1948
+ }
1949
+ /** A 1:1 chat's read of `key` the budget has held back for `READ_STARVED_MS` without a break. */
1950
+ starved(key, who, now) {
1951
+ const since = this.heldBack.get(key)?.since;
1952
+ return !who.group && !who.write && !who.door && since !== void 0 && now - since >= READ_STARVED_MS;
1953
+ }
1854
1954
  /** This contact's departed reads past the limit in the last minute (`DEPARTED_READS`). */
1855
1955
  departedReads(key, now) {
1856
1956
  const reads = (this.departedOver.get(key) ?? []).filter((at) => now - at < 6e4);
@@ -6546,13 +6646,15 @@ var LinkSession = class {
6546
6646
  nextInMs: 0
6547
6647
  });
6548
6648
  const started = Date.now();
6649
+ let heldBackMs;
6549
6650
  try {
6550
6651
  const pace = this.pace();
6551
6652
  const signal = pace === "fast" && this.fastStepsAfter > 0 && this.rtcSignalOut !== null;
6552
6653
  const watch = !signal && this.watching();
6553
6654
  const departed = !signal && Date.now() < this.departedUntil;
6655
+ const background = pace === "background" || pace === "connected";
6554
6656
  const packet = await this.transport.resolve(this.peerPubKeyZ32, {
6555
- background: pace === "background" || pace === "connected",
6657
+ background,
6556
6658
  urgent: pace === "fast",
6557
6659
  ...signal && { signal },
6558
6660
  ...watch && { watch },
@@ -6567,6 +6669,7 @@ var LinkSession = class {
6567
6669
  const read = answered !== void 0 && answered >= started;
6568
6670
  if (read) this.lastReadAt = started;
6569
6671
  this.readMissed = !!this.transport.readAnsweredAt && !read;
6672
+ if (this.readMissed) heldBackMs = this.transport.readHeldBackFor?.(this.peerPubKeyZ32);
6570
6673
  let receivedNew = false;
6571
6674
  const batch = packet ? parseLinkRecords(packet, this.encKey) : null;
6572
6675
  if (batch && isEmptyLinkPacket(batch)) {
@@ -6655,7 +6758,8 @@ var LinkSession = class {
6655
6758
  ms: Date.now() - started,
6656
6759
  error: String(error)
6657
6760
  });
6658
- if (!isDiscoveryBudgetError(error)) {
6761
+ if (isDiscoveryBudgetError(error)) heldBackMs = error.retryInMs;
6762
+ else {
6659
6763
  this.discoveryResult("read", error);
6660
6764
  this.events.onStatus?.("error");
6661
6765
  }
@@ -6673,7 +6777,7 @@ var LinkSession = class {
6673
6777
  this.poll();
6674
6778
  } else if (this.running && !this.pollTimer) {
6675
6779
  const interval = this.nextInterval();
6676
- const wait = Math.max(MIN_POLL_GAP_MS, interval - (Date.now() - started));
6780
+ const wait = heldBackMs !== void 0 ? Math.min(interval, Math.max(BUDGET_RETRY_MIN_MS, heldBackMs)) : Math.max(MIN_POLL_GAP_MS, interval - (Date.now() - started));
6677
6781
  this.events.onPoll?.({
6678
6782
  polling: false,
6679
6783
  nextInMs: wait
@@ -9768,6 +9872,13 @@ var DHT_EXPIRY_SKEW_MS = PKARR_FUTURE_SKEW_MS;
9768
9872
  */
9769
9873
  var DHT_ISSUED_BACK_MS = 12e4;
9770
9874
  var MAX_ATTEMPTS = 8;
9875
+ /**
9876
+ * Envelope sequences are set aside this many at a time (`DhtDeliveryState.sequence` is the highest set aside): a
9877
+ * keep-alive, every four minutes per chat, and one the relays' budget turns away, every 30 s on a profile idling at
9878
+ * it, then cost no disk write of their own. A reader only needs the sequence to grow, so those a restart skips cost
9879
+ * nothing; one the budget turned away is not used again, as it may have gone out on the DHT (the CLI puts there too).
9880
+ */
9881
+ var SEQUENCE_BLOCK = 64;
9771
9882
  /** The wait before publication attempt `attempts + 1` of a text, or of a receipt the contact still asks for. */
9772
9883
  var backoff = (attempts) => Math.min(6e4, 4e3 * 2 ** attempts);
9773
9884
  /** The contact's mailbox is read this often while either side is DHT-only, and otherwise… */
@@ -9821,6 +9932,10 @@ var emptyDhtDeliveryState = () => ({
9821
9932
  var DhtDelivery = class DhtDelivery {
9822
9933
  options;
9823
9934
  state;
9935
+ /** The state as last saved: a save that would write the same row again is skipped. */
9936
+ saved;
9937
+ /** The sequence of the last envelope signed here; the state's is the highest set aside (`SEQUENCE_BLOCK`). */
9938
+ sequence;
9824
9939
  mode;
9825
9940
  running = false;
9826
9941
  ticking = false;
@@ -9875,6 +9990,8 @@ var DhtDelivery = class DhtDelivery {
9875
9990
  const { peerRejected: _peerRejected, ...state } = structuredClone(options.state ?? emptyDhtDeliveryState());
9876
9991
  this.state = state;
9877
9992
  this.mode = options.mode;
9993
+ this.sequence = state.sequence;
9994
+ if (options.state) this.saved = JSON.stringify(state);
9878
9995
  this.unsealedOut = state.sequence > 0 && !options.credentials.peerKey;
9879
9996
  this.from = identityFromSeedB64(options.params.seedB64).pubKeyZ32;
9880
9997
  this.to = options.params.peerPubKeyZ32;
@@ -9963,7 +10080,11 @@ var DhtDelivery = class DhtDelivery {
9963
10080
  return operation;
9964
10081
  }
9965
10082
  async persist(next) {
9966
- await this.options.save(structuredClone(next));
10083
+ const json = JSON.stringify(next);
10084
+ if (json !== this.saved) {
10085
+ await this.options.save(structuredClone(next));
10086
+ this.saved = json;
10087
+ }
9967
10088
  this.state = next;
9968
10089
  }
9969
10090
  sealedKey(peer) {
@@ -10138,7 +10259,7 @@ var DhtDelivery = class DhtDelivery {
10138
10259
  }
10139
10260
  packetError(message, expires, reply, edit) {
10140
10261
  try {
10141
- this.records(this.body(this.state.sequence + 1, Date.now(), expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", reply, [], edit), this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
10262
+ this.records(this.body(this.sequence + 1, Date.now(), expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", reply, [], edit), this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
10142
10263
  return null;
10143
10264
  } catch (error) {
10144
10265
  return error instanceof Error ? error.message : String(error);
@@ -10146,7 +10267,7 @@ var DhtDelivery = class DhtDelivery {
10146
10267
  }
10147
10268
  /** Whether a text with its hop count fits the packet and what a reader reads (`MAX_ENVELOPE_PLAINTEXT`). */
10148
10269
  roomForHops(message, expires, reply, forwarded) {
10149
- const body = this.body(this.state.sequence + 1, Date.now(), expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", reply, [], void 0, forwarded);
10270
+ const body = this.body(this.sequence + 1, Date.now(), expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", reply, [], void 0, forwarded);
10150
10271
  try {
10151
10272
  this.records(body, this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
10152
10273
  } catch {
@@ -10225,7 +10346,7 @@ var DhtDelivery = class DhtDelivery {
10225
10346
  ], expires = now + DHT_MESSAGE_TTL;
10226
10347
  const hops = readForwarded(forwarded);
10227
10348
  const fits = (element, withReply, withHops) => {
10228
- const body = this.body(this.state.sequence + 1, now, expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", withReply ? reply : void 0, [], void 0, withHops ? hops : void 0, element);
10349
+ const body = this.body(this.sequence + 1, now, expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", withReply ? reply : void 0, [], void 0, withHops ? hops : void 0, element);
10229
10350
  try {
10230
10351
  this.records(body, this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
10231
10352
  } catch {
@@ -10414,13 +10535,14 @@ var DhtDelivery = class DhtDelivery {
10414
10535
  if (keepAlive && this.controlDue > now) return;
10415
10536
  const expires = pending?.expires ?? now - 12e4 + CONTROL_TTL;
10416
10537
  const issued = Math.min(now, Math.max(now - DHT_ISSUED_BACK_MS, expires - (pending ? DHT_MESSAGE_TTL : CONTROL_TTL), (pending?.message[1] ?? 0) - 3e4));
10417
- const { body, records, reactions } = this.fitted(this.state.sequence + 1, issued, expires, pending?.message ?? null, receipt?.id ?? null, pending?.reply, pending?.edit, pending?.forwarded, pending?.file);
10538
+ const { body, records, reactions } = this.fitted(this.sequence + 1, issued, expires, pending?.message ?? null, receipt?.id ?? null, pending?.reply, pending?.edit, pending?.forwarded, pending?.file);
10418
10539
  const reactionsWereDue = this.reactionsDue;
10419
10540
  this.reactionsDue = !reactions && !!this.options.reactions?.().length;
10420
10541
  const identity = !reseal && this.state.peerPinned && this.state.peerPinned !== "can" && this.pinned()?.identity || this.identity;
10542
+ const sequence = body[1];
10421
10543
  await this.persist({
10422
10544
  ...this.state,
10423
- sequence: body[1],
10545
+ sequence: sequence > this.state.sequence ? sequence + SEQUENCE_BLOCK - 1 : this.state.sequence,
10424
10546
  pending: pending ? {
10425
10547
  ...pending,
10426
10548
  attempts: pending.attempts + 1,
@@ -10432,6 +10554,7 @@ var DhtDelivery = class DhtDelivery {
10432
10554
  next: now + backoff(receipt.attempts)
10433
10555
  } : this.state.receipt
10434
10556
  });
10557
+ this.sequence = sequence;
10435
10558
  const before = {
10436
10559
  lastPublish: this.lastPublish,
10437
10560
  controlDue: this.controlDue
@@ -11809,7 +11932,7 @@ async function verifyPeerProof(event, c, readStorage) {
11809
11932
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
11810
11933
  } else if (c.adapter === "keet-import") {
11811
11934
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
11812
- const { default: IdentityKey } = await import("./keet-identity-key-BylxCPl4.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
11935
+ const { default: IdentityKey } = await import("./keet-identity-key-BLli1rE4.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
11813
11936
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
11814
11937
  } else throw new Error("Unsupported proof adapter");
11815
11938
  }
@@ -16348,7 +16471,7 @@ var ChatFiles = class {
16348
16471
  }
16349
16472
  return;
16350
16473
  case "pf-done":
16351
- if (record.state !== "verifying") return;
16474
+ if (record.state !== "verifying" && record.confirmed !== record.file.size) return;
16352
16475
  record.confirmed = record.file.size;
16353
16476
  this.end(outgoing, "done");
16354
16477
  return;
@@ -17607,6 +17730,7 @@ var ENGINE_ERRORS = {
17607
17730
  notEnoughSats: "Not enough sats in your wallet",
17608
17731
  noSharedMint: "You share no mint with this contact",
17609
17732
  ecashAlreadySpent: "This ecash was already spent somewhere else",
17733
+ ecashBeingReceived: "This ecash is already being received",
17610
17734
  ecashOtherUnit: "This ecash is in {unit}: only sat ecash can be redeemed here",
17611
17735
  reviewedEcashSpent: "The ecash for this payment was already spent somewhere else. Nothing was sent, and your balance now shows what the mint still holds.",
17612
17736
  reviewedSatsGone: "The sats this payment was reviewed with went to another payment. Nothing was sent: review it again.",
@@ -17727,8 +17851,15 @@ var PACKET_TRANSPORTS_FAST_ATTEMPTS = 3;
17727
17851
  var DHT_PIN_GRACE_MS = 1e4;
17728
17852
  /** Back after a restart (`resume`), dials wait this long at most for the native endpoint that carried the chat to start. */
17729
17853
  var RESUME_WAIT_MS = 1e4;
17730
- /** Two dials crossing: how long the lower key's side waits for its own to connect before it takes the contact's. */
17731
- var CROSSED_WAIT_MS = 3e3;
17854
+ /**
17855
+ * Two dials crossing: how long the lower key's side waits for its own to connect before it takes the contact's. Two
17856
+ * dials that both go through connect within a round trip of each other: each side's preface goes out as the other's
17857
+ * dial reaches it. One not connected by then has stalled (a HyperDHT stream that opened and carries nothing, dialled
17858
+ * again only 2 s later) or goes to an endpoint the contact no longer runs: waiting for it held a working connection
17859
+ * back 0.9-1.9 s (DHT-direct lab, 5 of 20 first pairings). Taken, this side's dial is closed when it lands, and on the
17860
+ * contact's side it never authenticates (`attachReplacement`).
17861
+ */
17862
+ var CROSSED_WAIT_MS = 500;
17732
17863
  /**
17733
17864
  * A session this side dialled this recently is one a crossing dial of the contact's may meet (both connected): the
17734
17865
  * lower key keeps its own. Older, the session is one the contact has since lost (its app restarted), and its dial
@@ -18098,10 +18229,15 @@ var GhostLink = class {
18098
18229
  * was the app's in the background, not a restart (`resumeAfterAbsence`).
18099
18230
  */
18100
18231
  offered;
18232
+ /**
18233
+ * The WebRTC offer this side's dial made last, fallback allowed or not: one made before the contact's record was read
18234
+ * races once it is (`raceStandingOffer`).
18235
+ */
18236
+ offerMade;
18101
18237
  /** The attempt (its epoch) whose direct transports were knocked on as its offer went out (`knockEarly`), and whether that is under way. */
18102
18238
  knockedEarly = -1;
18103
18239
  knockingEarly = false;
18104
- /** When that offer's answer was applied (`RACE_ANSWERED_MS`); 0 while the data link is not connecting on it. */
18240
+ /** When this side's offer's answer was applied (`RACE_ANSWERED_MS`); 0 while the data link is not connecting on it. */
18105
18241
  answeredAt = 0;
18106
18242
  /** This side's offer is out unanswered, or answered and not connected yet: what is ranked after WebRTC may race it. */
18107
18243
  get offerOut() {
@@ -18434,6 +18570,7 @@ var GhostLink = class {
18434
18570
  channel.close();
18435
18571
  return;
18436
18572
  }
18573
+ if (this.rtcStartedUnpinned) this.openedUnpinned.add(channel);
18437
18574
  const plan = this.switcher.pending;
18438
18575
  if (plan?.choices.includes("webrtc/1") && this.paired?.state.status === "ready") this.attachCandidate(channel, void 0, plan).catch(() => {});
18439
18576
  else if (this.activeBinding) channel.close();
@@ -18449,6 +18586,7 @@ var GhostLink = class {
18449
18586
  const was = this.lastDataLinkState;
18450
18587
  traceLink(this.myPubKeyZ32, "datalink", { state });
18451
18588
  this.trackDataLink(state);
18589
+ if (state === "offering" || state === "answering") this.rtcStartedUnpinned = !options.pairing?.credentials.peerKey && !options.pairing?.credentials.expectedPeerKey;
18452
18590
  if (this.activeBinding) return;
18453
18591
  events.onDataLinkState?.(state);
18454
18592
  if (state === "open") {
@@ -18468,9 +18606,9 @@ var GhostLink = class {
18468
18606
  }
18469
18607
  }
18470
18608
  this.answeredAt = 0;
18471
- if (state === "connecting" && was === "offering" && this.offered?.epoch === this.connectionEpoch) {
18609
+ if (state === "connecting" && was === "offering" && this.offerMade?.epoch === this.connectionEpoch) {
18472
18610
  this.answeredAt = Date.now();
18473
- this.scheduleRace(this.offered.epoch, this.offered.at);
18611
+ if (this.offered?.epoch === this.connectionEpoch) this.scheduleRace(this.offered.epoch, this.offered.at);
18474
18612
  }
18475
18613
  if (state !== "idle") return;
18476
18614
  this.dialUnseen = was === "offering" && this.offerUnsent;
@@ -19061,6 +19199,7 @@ var GhostLink = class {
19061
19199
  }
19062
19200
  if (held && heldOn && reidentified.has(heldOn) && this.restartedRedial(held, heldOn)) return;
19063
19201
  if (this.redescribedDial()) return;
19202
+ if (!this.dialing) this.raceStandingOffer();
19064
19203
  if (this.channel || this.dialing) return;
19065
19204
  if (news || !again) {
19066
19205
  this.autoConnectFailures = 0;
@@ -19638,6 +19777,10 @@ var GhostLink = class {
19638
19777
  ...resume && { resume },
19639
19778
  ...woke && { woke }
19640
19779
  } : void 0;
19780
+ this.offerMade = {
19781
+ epoch,
19782
+ at: offeredAt
19783
+ };
19641
19784
  const gate = this.dialGate;
19642
19785
  this.dialGate = void 0;
19643
19786
  const replaced = new Promise((resolve) => {
@@ -19649,10 +19792,12 @@ var GhostLink = class {
19649
19792
  traceLink(this.myPubKeyZ32, "dial-held", {});
19650
19793
  this.afterRtc = void 0;
19651
19794
  this.offered = void 0;
19795
+ this.offerMade = void 0;
19652
19796
  return;
19653
19797
  }
19654
19798
  if (this.dataLink.state !== "idle" || epoch !== this.connectionEpoch) {
19655
19799
  this.scheduleRace(epoch, offeredAt);
19800
+ this.raceStandingOffer();
19656
19801
  return;
19657
19802
  }
19658
19803
  this.rtcUnstarted();
@@ -19818,6 +19963,31 @@ var GhostLink = class {
19818
19963
  }, Math.max(0, Math.min(...at) - now));
19819
19964
  }
19820
19965
  /**
19966
+ * This side's offer went out before the contact's record was read (a joiner's early one, `dialEarly`): nothing was
19967
+ * known of what the contact runs, so it was made with no fallback and nothing raced it. Once the record says, and both
19968
+ * sides allow it, the offer races what both run as one made then would: answered and not connected `RACE_ANSWERED_MS`
19969
+ * later, the relayed ones too. Behind a VPN that drops UDP, a first pairing went live over the relayed Iroh only once
19970
+ * the attempt timed out and the next one raced, 32 to 66 s in (zero's VPN lab, 2026-10-13).
19971
+ */
19972
+ raceStandingOffer() {
19973
+ const made = this.offerMade, epoch = this.connectionEpoch;
19974
+ if (!made || made.epoch !== epoch || this.offered?.epoch === epoch || !this.offerOut || this.channel || this.stopped) return;
19975
+ if (!this.fallback || !this.peerFallback || !this.peerTransports) return;
19976
+ const relayed = relayedTransports(this.localDescriptors(), this.peerDescriptors);
19977
+ const rest = rankTransports(this.transportOffer(), this.peerTransports, relayed).filter((t) => t !== "webrtc/1");
19978
+ if (!rest.length) return;
19979
+ this.offered = {
19980
+ epoch,
19981
+ at: made.at
19982
+ };
19983
+ this.afterRtc = {
19984
+ epoch,
19985
+ rest
19986
+ };
19987
+ traceLink(this.myPubKeyZ32, "race-standing", { transports: rest });
19988
+ this.scheduleRace(epoch, made.at);
19989
+ }
19990
+ /**
19821
19991
  * Back after an absence, this side answers an offer the contact made while it was away (it dials whatever its key):
19822
19992
  * the contact looks for that answer at the pace of an offer out a while (every 8 s on the relays), and its attempt may
19823
19993
  * end before it does. The direct transports both run are knocked on meanwhile, and the relayed ones where both apps
@@ -19950,6 +20120,7 @@ var GhostLink = class {
19950
20120
  const left = next.rest.filter((t) => t !== "webrtc/1" && !due.includes(t));
19951
20121
  if (!due.length) {
19952
20122
  this.scheduleRace(epoch, offeredAt);
20123
+ this.raceStandingOffer();
19953
20124
  return;
19954
20125
  }
19955
20126
  this.afterRtc = left.length ? {
@@ -19974,6 +20145,7 @@ var GhostLink = class {
19974
20145
  if (live || epoch !== this.connectionEpoch || this.channel || this.stopped) return;
19975
20146
  if (this.dataLink.state !== "idle") {
19976
20147
  this.scheduleRace(epoch, offeredAt);
20148
+ this.raceStandingOffer();
19977
20149
  return;
19978
20150
  }
19979
20151
  const rest = this.afterRtc;
@@ -21049,8 +21221,8 @@ var GhostLink = class {
21049
21221
  * Both sides dialled at once (two apps back after a restart, each knocking): the lower key's dial carries the chat, on
21050
21222
  * both sides; the higher key's side takes it over as a replacement (`attachReplacement`). Here, on the lower key's
21051
21223
  * side, the contact's connection waits: dropped once this side's own dial connects, taken if that dial fails, or has
21052
- * not connected within `CROSSED_WAIT_MS` (the contact may be dialling an app that is not up yet, for as long as its
21053
- * dial takes to give up).
21224
+ * not connected within `CROSSED_WAIT_MS` (it stalled, or goes to an endpoint the contact no longer runs, for as long
21225
+ * as it takes to give up).
21054
21226
  */
21055
21227
  crossed = null;
21056
21228
  parkCrossed(channel, binding) {
@@ -21067,7 +21239,7 @@ var GhostLink = class {
21067
21239
  this.dialing = false;
21068
21240
  this.attempt = null;
21069
21241
  this.attach(channel, binding);
21070
- }, CROSSED_WAIT_MS);
21242
+ }, 500);
21071
21243
  channel.onClose = () => {
21072
21244
  if (this.crossed?.channel === channel) {
21073
21245
  clearTimeout(timer);
@@ -21149,6 +21321,8 @@ var GhostLink = class {
21149
21321
  dialedIn = /* @__PURE__ */ new WeakSet();
21150
21322
  /** Connections whose session started with no key pinned nor named by the invite. */
21151
21323
  openedUnpinned = /* @__PURE__ */ new WeakSet();
21324
+ /** The WebRTC offer under way was made or answered with no key pinned nor named by the invite (its channel opens later). */
21325
+ rtcStartedUnpinned = false;
21152
21326
  /**
21153
21327
  * `migration`: the channel is a candidate that takes over from the session open now once it authenticated. With a
21154
21328
  * `plan`, a live switch both sides agreed; without one, a replacement (`attachReplacement`): the contact dialled
@@ -26213,6 +26387,12 @@ var byeSigned = (f) => utf8Encode(JSON.stringify([
26213
26387
  f.e,
26214
26388
  f.ts
26215
26389
  ]));
26390
+ var leftSigned = (commit) => utf8Encode(JSON.stringify([
26391
+ "ghostly-group/1 left",
26392
+ commit.g,
26393
+ commit.e,
26394
+ commitHash(commit)
26395
+ ]));
26216
26396
  var editSigned = (f) => utf8Encode(JSON.stringify([
26217
26397
  "ghostly-group/1 edit",
26218
26398
  f.g,
@@ -26693,11 +26873,43 @@ var GroupSession = class {
26693
26873
  }];
26694
26874
  });
26695
26875
  }
26696
- remove(memberKey, now = Date.now()) {
26876
+ /**
26877
+ * A welcome for a member already in the roster that never got the first one (its chat closed while it was let in):
26878
+ * nothing is committed. It carries the secrets of the epochs it was in, from its admission on, sealed to its key.
26879
+ */
26880
+ rewelcome(memberKey) {
26881
+ return this.serialize(async () => {
26882
+ this.requireAdmin();
26883
+ if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey) throw new Error("Not a member");
26884
+ const chain = this.state.chain;
26885
+ let admitted = chain.length - 1;
26886
+ while (admitted >= 0 && !(chain[admitted].k === "add" && chain[admitted].s === memberKey)) admitted--;
26887
+ if (admitted < 0) throw new Error("Not a member");
26888
+ const secrets = chain.slice(admitted).filter((c) => this.state.secrets[c.e] && rosterHas(c.m, memberKey)).map((c) => ({
26889
+ e: c.e,
26890
+ s: sealSecret(memberKey, this.secret(c.e), secretAad$1(this.id, c.e, memberKey))
26891
+ }));
26892
+ const pieces = chainPieces(chain);
26893
+ const tail = pieces.pop();
26894
+ return [...pieces.map((commits) => ({
26895
+ t: "group-chain",
26896
+ g: this.id,
26897
+ commits
26898
+ })), {
26899
+ t: "group-welcome",
26900
+ g: this.id,
26901
+ name: this.name,
26902
+ commits: tail,
26903
+ secrets
26904
+ }];
26905
+ });
26906
+ }
26907
+ /** `left`: the member asked to leave (on the admin's chat), and the commit says so (`GroupCommitFrame.left`). */
26908
+ remove(memberKey, now = Date.now(), { left = false } = {}) {
26697
26909
  return this.serialize(async () => {
26698
26910
  this.requireAdmin();
26699
26911
  if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey) throw new Error("Not a member");
26700
- await this.commit("remove", memberKey, now);
26912
+ await this.commit("remove", memberKey, now, left);
26701
26913
  });
26702
26914
  }
26703
26915
  transferAdmin(memberKey, now = Date.now()) {
@@ -26714,7 +26926,7 @@ var GroupSession = class {
26714
26926
  await this.commit("rotate", void 0, now);
26715
26927
  });
26716
26928
  }
26717
- async commit(kind, subject, now) {
26929
+ async commit(kind, subject, now, left = false) {
26718
26930
  if (this.hooks.adminWork?.() === false) throw new Error(GROUP_ADMIN_OFF_ERROR);
26719
26931
  if (this.hooks.adminTurn && !await this.hooks.adminTurn()) throw engineError("groupTurnUnconfirmed");
26720
26932
  if (this.state.chain.length >= 1024) throw new Error("This group has reached its membership history limit. Create a new group.");
@@ -26738,6 +26950,8 @@ var GroupSession = class {
26738
26950
  ...draft,
26739
26951
  c: confirmationTag(epochKeys(secret, this.id, epoch).confirm, commitUntaggedHash(draft))
26740
26952
  }, this.identity.seed);
26953
+ const mark = left && kind === "remove" ? toBase64Url(sign(leftSigned(commit), this.identity.seed)) : void 0;
26954
+ if (mark) (this.state.leftMarks ??= {})[epoch] = mark;
26741
26955
  this.state.chain.push(commit);
26742
26956
  this.chainMovedAt = this.clock();
26743
26957
  this.state.secrets[epoch] = toBase64Url(secret);
@@ -26753,7 +26967,8 @@ var GroupSession = class {
26753
26967
  t: "group-commit",
26754
26968
  g: this.id,
26755
26969
  commit,
26756
- ...member ? { secret: sealSecret(key, secret, secretAad$1(this.id, epoch, key)) } : {}
26970
+ ...member ? { secret: sealSecret(key, secret, secretAad$1(this.id, epoch, key)) } : {},
26971
+ ...mark ? { left: mark } : {}
26757
26972
  });
26758
26973
  }
26759
26974
  this.hooks.changed();
@@ -27153,7 +27368,7 @@ var GroupSession = class {
27153
27368
  case "group-bye":
27154
27369
  await this.receiveBye(from, raw);
27155
27370
  break;
27156
- case "group-leave": if (this.isAdmin && this.hooks.adminWork?.() !== false && rosterHas(this.roster, from) && from !== this.myKey) await this.commitUnlessTurnUnconfirmed("remove", from);
27371
+ case "group-leave": if (this.isAdmin && this.hooks.adminWork?.() !== false && rosterHas(this.roster, from) && from !== this.myKey) await this.commitUnlessTurnUnconfirmed("remove", from, true);
27157
27372
  }
27158
27373
  return this.state.status === "active" ? this.passOn : this.state.status === "removed" ? this.passOn.filter((f) => f.t === "group-commit") : [];
27159
27374
  } finally {
@@ -27268,7 +27483,7 @@ var GroupSession = class {
27268
27483
  return;
27269
27484
  }
27270
27485
  if (bye.e < this.admittedAt(bye.k)) return;
27271
- if (this.isAdmin && this.hooks.adminWork?.() !== false && await this.commitUnlessTurnUnconfirmed("remove", bye.k)) return;
27486
+ if (this.isAdmin && this.hooks.adminWork?.() !== false && await this.commitUnlessTurnUnconfirmed("remove", bye.k, true)) return;
27272
27487
  if (from !== bye.k && this.byesPassed.get(bye.k)?.sig === bye.sig) return;
27273
27488
  this.byesPassed.set(bye.k, bye);
27274
27489
  this.took(bye);
@@ -27293,9 +27508,9 @@ var GroupSession = class {
27293
27508
  * An automatic commit (a member's leave): made, or not made when no fresh turn read says this device is the active
27294
27509
  * one (`adminTurn`). Then false, and the caller goes on as a member would. Any other refusal is thrown as before.
27295
27510
  */
27296
- async commitUnlessTurnUnconfirmed(kind, subject) {
27511
+ async commitUnlessTurnUnconfirmed(kind, subject, left = false) {
27297
27512
  try {
27298
- await this.commit(kind, subject, Date.now());
27513
+ await this.commit(kind, subject, Date.now(), left);
27299
27514
  return true;
27300
27515
  } catch (error) {
27301
27516
  if (error instanceof EngineError && error.engineCode === "groupTurnUnconfirmed") return false;
@@ -27557,6 +27772,7 @@ var GroupSession = class {
27557
27772
  const result = verifyCommit(raw, this.state.chain[e - 1] ?? null, this.id);
27558
27773
  if ("error" in result || result.commit.by !== known.by) return;
27559
27774
  if (commitHash(result.commit) !== commitHash(known)) await this.fork(`Member ${from.slice(0, 8)} holds a different membership history for epoch ${e}`);
27775
+ else if (this.takeLeftMark(known, frame.left)) await this.persist();
27560
27776
  return;
27561
27777
  }
27562
27778
  if (e > this.epoch + 1) {
@@ -27570,11 +27786,13 @@ var GroupSession = class {
27570
27786
  if (result.error.startsWith("Commit does not follow") && verifyCommitSignature(raw)?.by === this.admin) await this.fork(`Member ${from.slice(0, 8)} holds a different membership history for epoch ${e}`);
27571
27787
  return;
27572
27788
  }
27789
+ const mark = this.takeLeftMark(result.commit, frame.left) ? frame.left : void 0;
27573
27790
  await this.apply(result.commit, frame.secret);
27574
27791
  this.took({
27575
27792
  t: "group-commit",
27576
27793
  g: this.id,
27577
- commit: result.commit
27794
+ commit: result.commit,
27795
+ ...mark ? { left: mark } : {}
27578
27796
  });
27579
27797
  if (this.state.status === "active" && !this.state.secrets[this.epoch]) this.ask(from);
27580
27798
  const next = this.pendingCommits.get(this.epoch + 1);
@@ -27583,6 +27801,17 @@ var GroupSession = class {
27583
27801
  await this.receiveCommit(from, next);
27584
27802
  }
27585
27803
  }
27804
+ /** Keeps the admin's mark on a commit that took out a member who left (`GroupCommitFrame.left`) when it holds; true when new. */
27805
+ takeLeftMark(commit, mark) {
27806
+ if (commit.k !== "remove" || typeof mark !== "string" || mark.length !== 86 || !B64$1.test(mark) || this.state.leftMarks?.[commit.e]) return false;
27807
+ try {
27808
+ if (!verify(fromBase64Url(mark), leftSigned(commit), publicKeyFromZ32(commit.by))) return false;
27809
+ } catch {
27810
+ return false;
27811
+ }
27812
+ (this.state.leftMarks ??= {})[commit.e] = mark;
27813
+ return true;
27814
+ }
27586
27815
  async apply(commit, sealed) {
27587
27816
  this.state.chain.push(commit);
27588
27817
  this.chainMovedAt = this.clock();
@@ -27645,11 +27874,13 @@ var GroupSession = class {
27645
27874
  const answer = [];
27646
27875
  for (let e = frame.e + 1; e <= this.epoch; e++) {
27647
27876
  const commit = this.state.chain[e], secret = this.secret(e);
27877
+ const left = this.state.leftMarks?.[e];
27648
27878
  answer.push({
27649
27879
  t: "group-commit",
27650
27880
  g: this.id,
27651
27881
  commit,
27652
- ...secret && rosterHas(commit.m, from) ? { secret: sealSecret(from, secret, secretAad$1(this.id, e, from)) } : {}
27882
+ ...secret && rosterHas(commit.m, from) ? { secret: sealSecret(from, secret, secretAad$1(this.id, e, from)) } : {},
27883
+ ...left ? { left } : {}
27653
27884
  });
27654
27885
  }
27655
27886
  const theirs = new Set(Array.isArray(frame.secrets) ? frame.secrets.filter((n) => Number.isSafeInteger(n)) : []);
@@ -28668,6 +28899,15 @@ var CommunitySession = class {
28668
28899
  return -1;
28669
28900
  }
28670
28901
  /**
28902
+ * Someone the chain removed (not one who left) and who is not back in: nothing it signs is heard any more, even for
28903
+ * an epoch it was in. What one who left wrote while in the group is still taken and handed on, for the epochs it was
28904
+ * in (WISP 903 § Leaving and removal): its goodbye reaches the members who were away.
28905
+ */
28906
+ wasExpelled(key) {
28907
+ const i = this.outIndex(key);
28908
+ return i >= 0 && this.state.chain[i].k === "remove";
28909
+ }
28910
+ /**
28671
28911
  * What someone the chain took out is told when it comes back (WISP 903 § Leaving and removal): the commits from where
28672
28912
  * it says it is (`sync`: its tip, or its locator) up to the one that took it out, and nothing after. Later commits
28673
28913
  * are not its business (a `link` commit names the new entry key); no secret, no stored frame, no seed goes with them.
@@ -29630,7 +29870,7 @@ var CommunitySession = class {
29630
29870
  return false;
29631
29871
  }
29632
29872
  if (!verify(fromBase64Url(raw.sig), messageSigned(raw), publicKeyFromZ32(raw.s))) return false;
29633
- if (this.wasRemoved(raw.s)) return false;
29873
+ if (this.wasExpelled(raw.s)) return false;
29634
29874
  const found = this.commitByShort(raw.e, raw.h);
29635
29875
  if (!found) {
29636
29876
  this.park(from, raw);
@@ -29874,7 +30114,7 @@ var CommunitySession = class {
29874
30114
  if (stored.s === from) continue;
29875
30115
  const high = have[stored.s]?.[seenKey(stored.e, stored.h)];
29876
30116
  if (Number.isSafeInteger(high) && high >= stored.n) continue;
29877
- if (this.wasRemoved(stored.s)) continue;
30117
+ if (this.wasExpelled(stored.s)) continue;
29878
30118
  const found = this.commitByShort(stored.e, stored.h);
29879
30119
  if (!found) continue;
29880
30120
  const reads = rosterHas(this.rosterAt(found.hash) ?? [], from), mine = stored.s === this.myKey && unheard.has(frameKey(stored));
@@ -31053,4 +31293,4 @@ function appStoreDecision(held, read) {
31053
31293
  //#endregion
31054
31294
  export { rosterHash as $, enrollMessage as $_, GROUP_HAVE_FRAME as $a, sanitizeAvatar as $b, isHoldUrl as $c, parseEditedFrame as $d, cardEditNumber as $f, handoffFileRequestFrame as $g, emptyLinkRecords as $h, invoiceCallbackUrl as $i, emptyIdentityLedger as $l, WATCH_PEER_MS as $m, ATPROTO_FULL_SCOPE as $n, ChatFiles as $o, commitUntaggedHash as $p, DID_DHT_VERSION as $r, wakeRequest as $s, groupDisplayName as $t, DhtDelivery as $u, TURN_RAISE_READ_TIMEOUT_MS as $v, PREVIOUS_DEFAULT_RELAYS as $y, isAppLicense as A, sortParts as A_, MAX_PAIRED_MESSAGE_FRAME as Aa, measureRecords as Ab, EDIT_CAPABILITY as Ac, voiceFileName as Ad, readReaction as Af, HANDOFF_PIECE_OVERHEAD as Ag, parseRtcSignal as Ah, isSparkAddress as Ai, CapsExchange as Al, STALLED_EVIDENCE_MS as Am, BIP322_REVISION as An, wireHubPolicy as Ao, readAppRevocation as Ap, DID_METHODS as Ar, parsePinnedFrame as As, chainPieces as At, verifyPeerProof as Au, DEVICES_CAPABILITY as Av, turnInstance as Ay, COMMUNITY_PROFILE as B, DEVICE_KINDS as B_, SWITCH_RETIRE_MS as Ba, identityFromSeed as Bb, UPGRADE_CAPABILITY as Bc, EDITED_FRAME as Bd, wireReply as Bf, handoffAckFrame as Bg, decompressSdp as Bh, newPubkyProofFolder as Bi, IDENTITY_CHECK_UNAVAILABLE as Bl, EXPECT_PEER_MS as Bm, decodeAnyBitcoinAddress as Bn, mergeLobby as Bo, canonicalJsonBytes as Bp, didWebFileUrl as Br, WAKE_FRAME as Bs, parseCommunityEdit as Bt, automaticTransport as Bu, deviceLinkPairing as Bv, BACKGROUND_REQUESTS_PER_MINUTE as By, APP_VIEWS as C, readHandoffManifest as C_, EARLY_DIAL_JOIN_MS as Ca, isDiscoveryBudgetError as Cb, isAppVersion as Cc, downsamplePeaks as Cd, parseReactionFrame as Cf, HANDOFF_HELLO as Cg, DATA_CHANNEL_ID as Ch, formatPaymentAmount as Ci, validDomainRecord as Cl, CONNECT_TIMEOUT_MS as Cm, sshFingerprint as Cn, MESH_HUBS as Co, appRevocationId as Cp, verifyAtprotoSignature as Cr, PINNED_FRAME as Cs, mentionedMembers as Ct, proofHash as Cu, encodeInviteCode as Cv, openTurnValue as Cy, buildAppBundle as D, readHandoffVerified as D_, INVITE_TAKEN as Da, PacketTooLargeError as Db, APPS_CAPABILITY as Dc, parseVoiceMeta as Dd, reactionFrame as Df, HANDOFF_OFFER as Dg, buildDataSdp as Dh, walletNetworkOf as Di, CAPS_LIMITS as Dl, GATHER_STALL_MS as Dm, isLegacySignature as Dn, meshRendezvous as Do, isAppKey as Dp, DID_JWS_ALGS as Dr, mayPin as Ds, GROUP_READ_NOTE as Dt, storageProofPath as Du, inviteQrText as Dv, signTurnBody as Dy, assembleAppBundle as E, readHandoffTurnFrame as E_, INVITER_DIAL_GRACE_MS as Ea, PKARR_FUTURE_SKEW_MS as Eb, readAppFrame as Ec, isPlayableAudioType as Ed, reactionEmoji as Ef, HANDOFF_MANIFEST as Eg, RTC_SIGNAL_MAX_AGE_MS as Eh, validatePaymentTarget as Ei, CAPS_LABEL as El, GATHER_ATTEMPTS as Em, verifySshSignature as En, meshHubs as Eo, isAppHash as Ep, DID_GHOSTLY_SERVICE as Er, PIN_LIMITS as Es, GROUP_REACTED_FRAME as Et, storageProofBody as Eu, inviteQrSegments as Ev, sealTurnBody as Ey, GroupTypingBoard as F, setAckFrame as F_, RACE_DIRECT_MS as Fa, decodeDnsAnswers as Fb, SERVICES_CAPABILITY as Fc, VIDEO_LIMITS as Fd, REPLY_LIMITS as Ff, HANDOFF_VERSION as Fg, answersOffer as Fh, isBitcoinAddress as Fi, dialDescriptors as Fl, directBlocked as Fm, decodeBase64 as Fn, freshHubs as Fo, signAppRevocation as Fp, didJwsAlg as Fr, readPin as Fs, GROUP_EDIT_TEXT_BYTES as Ft, validRingKey as Fu, HANDOFF_CAPABILITY as Fv, turnReleaseMessage as Fy, communityHasFrame as G, ENROLL_HELLO as G_, publishFailure as Ga, decrypt as Gb, PairedSession as Gc, EDIT_RECEIVE_LIMIT as Gd, PR_CHECKS as Gf, handoffCancelFrame as Gg, pickCallCandidates as Gh, decodeSvcbRecords as Gi, IDENTITY_PROOF_CAPABILITY as Gl, OFFER_FAST_MS as Gm, encodeWitness as Gn, readBeaconHead as Go, GROUP_VERSION_LARGE as Gp, parseDidJws as Gr, deviceWakeRequest as Gs, mentionsMember as Gt, relayedTransports as Gu, devicePingFrame as Gv, FRESH_READ_MS as Gy, GROUP_READ_NOTE_COMMUNITY as H, ENROLL_CANCEL_REASONS as H_, WAKE_LOST_MS as Ha, publicKeyFromZ32 as Hb, parseSessionCapabilities as Hc, EDIT_BUFFER_MS as Hd, BUTTON_ID as Hf, handoffAttemptFailed as Hg, heardCallSignal as Hh, pubkyProofCapability as Hi, IDENTITY_MAX_EVIDENCE as Hl, IDLE_THRESHOLD as Hm, decodeTx as Hn, pickHubs as Ho, GROUP_ADMIN_OFF_ERROR as Hp, normalizeDid as Hr, WAKE_SUBJECT as Hs, MENTION_EVERYONE as Ht, irohDescriptor as Hu, deviceLinkRendezvousSeed as Hv, CHAT_RESERVE as Hy, groupTypingEpoch as I, setUpdateFrame as I_, RACE_RELAYED_MS as Ia, decodeTxtPacket as Ib, SESSION_CAPABILITIES_FRAME as Ic, formatVideoDuration as Id, groupReplyAuthor as If, HANDOFF_WINDOW as Ig, buildSdpFromSignal as Ih, PUBKY_PROOF_MAX_BYTES as Ii, emptyCapsState as Il, symmetricNat as Im, verifyBip322 as In, hubRank as Io, verifyAppRevocation as Ip, didSignedMessages as Ir, DEVICE_WAKE_TTL_SECONDS as Is, carryMentions as It, verifyRingAuthorization as Iu, deviceEchoFrame as Iv, turnSequence as Iy, communityUntaggedHash as J, enrollCancelReason as J_, engineError as Ja, sealedLength as Jb, HOLD_CAPABILITY as Jc, RateWindow as Jd, RUN_RESULTS as Jf, handoffDataFrame as Jg, waitForIceGathering as Jh, pubkyHomeserverOf as Ji, IDENTITY_STATEMENT_PREFIX as Jl, PRESENCE_HEARTBEAT as Jm, txHash as Jn, validHead as Jo, MAX_GROUP_MEMBERS as Jp, staticDidDocument as Jr, readWake as Js, MAX_GROUP_META_BODY as Jt, DHT_FILE_REFUSED as Ju, unsignedDeviceTransports as Jv, GROUP_OVER_PACE_MS as Jy, communityMessageId as K, ENROLL_PROOF as K_, ENGINE_ERRORS as Ka, encrypt as Kb, SESSION_FRAME_MAX as Kc, EDIT_SEND_LIMIT as Kd, PR_STATES as Kf, handoffContext as Kg, sdpHasCandidates as Kh, encodeSvcbPacket as Ki, IDENTITY_PROVIDER_ID as Kl, OFFER_LOOK_MS as Km, hash160 as Kn, readLobby as Ko, LEGACY_GROUP_MEMBERS as Kp, parseDidSignaturePaste as Kr, newWakeToken as Ks, validMentions as Kt, transportOrder as Ku, newDeviceSetSecret as Kv, GROUP_BURST_MS as Ky, openGroupTyping as L, setUpdateMessage as L_, REDESCRIBED_GRACE_MS as La, encodeTxtPacket as Lb, STATUS_CARD_CAPABILITY as Lc, isPlayableVideoType as Ld, pairedReplyAuthor as Lf, NO_ATTEMPTS as Lg, callRtcConfig as Lh, PUBKY_PROOF_ROOT as Li, encodePacketTransports as Ll, AWAITING_PEER_MS as Lm, BitcoinAddressError as Ln, lobbyKeys as Lo, verifyAppSignature as Lp, didWebDocumentUrl as Lr, WAKE_CALL_INTERVAL_MS as Ls, communityEditFrame as Lt, verifyRingEvidence as Lu, deviceEchoNonce as Lv, turnSignedMessage as Ly, isAppUrl as M, SET_UPDATE as M_, PAIRING_RETRY_MS as Ma, openRelayPayload as Mb, KNOWN_SESSION_CAPABILITIES as Mc, voiceLevelsOf as Md, wireReaction as Mf, HANDOFF_REQUEST as Mg, CALL_SIGNAL_MAX_AGE_MS as Mh, sparkInvoiceDetails as Mi, CapsRefusedError as Ml, DIRECT_OWN_ATTEMPTS as Mm, bip322MessageHash as Mn, beaconKeys as Mo, readAppRevocations as Mp, checkDidJws as Mr, pinIsNewer as Ms, groupMessageId as Mt, ringAuthorization as Mu, DEVICE_ECHO_FRAME as Mv, turnName as My, readAppBundle as N, encodeSetSlots as N_, PONG_WAIT_MS as Na, parseRelayPayload as Nb, PIN_CAPABILITY as Nc, voicePeaksOf as Nd, PAIRED_REPLY_AUTHORS as Nf, HANDOFF_TIMINGS as Ng, PAIRED_CALL_CANDIDATES as Nh, sparkNetworkOf as Ni, DHT_TEXT_CAPABILITY as Nl, DIRECT_PEERS as Nm, bip322ToSign as Nn, beaconRecords as No, readAppSignature as Np, checkDidSignature as Nr, pinNumberHolds as Ns, COMMUNITY_EDIT_FRAME as Nt, ringClaims as Nu, DEVICE_PING_FRAME as Nv, turnPacket as Ny, checkAppManifest as O, sameDigest as O_, LIVENESS_MISSED_PINGS as Oa, RELAY_PAYLOAD_MAX_BYTES as Ob, BUTTONS_CAPABILITY as Oc, recordingMime as Od, reactionIsNewer as Of, HANDOFF_PAKE as Og, extractRtcParams as Oh, SPARK_NETWORKS as Oi, CAPS_PUBLISH_SPACING_MS as Ol, OFFER_HOST_GATHER_MS as Om, legacyMessageHash as On, parseHubPolicy as Oo, isAppRef as Op, DID_JWS_MAX_LENGTH as Or, nextPinNumber as Os, GroupSession as Ot, validExternalKey as Ou, ownInviteRefusal as Ov, signTurnPacket as Oy, GROUP_TYPING_FRAME as P, readSetUpdate as P_, RACE_ANSWERED_MS as Pa, signRelayPayload as Pb, REACTIONS_CAPABILITY as Pc, PLAYABLE_VIDEO as Pd, REPLY_ID as Pf, HANDOFF_VERIFIED as Pg, RTC_CONFIG as Ph, BITCOIN_NETWORKS as Pi, capsDescriptors as Pl, DirectPathWatch as Pm, bip322ToSpend as Pn, doorHubs as Po, signAppObject as Pp, didGhostlyServiceEntry as Pr, pinnedFrame as Ps, GROUP_EDIT_FRAME as Pt, ringEvidence as Pu, ENROLL_CAPABILITY as Pv, turnPayloadSequence as Py, leaveStatement as Q, enrollHelloFrame as Q_, GROUP_FILE_LIMITS as Qa, jpegSize$1 as Qb, HoldRefusedError as Qc, parseEditFrame as Qd, buttonLabelClash as Qf, handoffFileMissingFrame as Qg, buildLinkRecords as Qh, findLightningDestination as Qi, boundVerifiedIdentity as Ql, TRANSPORTS_GONE_MS as Qm, ATPROTO_DECLARED_SCOPE as Qn, parsePairedCallFrame as Qo, commitHash as Qp, DID_DHT_TTL as Qr, wakePayload as Qs, encodeGroupMetaBody as Qt, DHT_TEXT_REFUSED as Qu, TURN_PUT_WINDOW_MS as Qv, HEDGE_MS as Qy, sealGroupTyping as R, signTombstone as R_, RESUME_WAIT_MS as Ra, readDnsName as Rb, SessionCapabilities as Rc, isVideoMime as Rd, readReply as Rf, filePartDigest as Rg, callSignalHeardAt as Rh, isPubkyKey as Ri, parsePacketTransports as Rl, DEPARTED_READ_MS as Rm, ByteReader as Rn, lobbyRecords as Ro, verifyAppStatementBytes as Rp, didWebFile as Rr, WAKE_CALL_TTL_SECONDS as Rs, communityMessageAuthor as Rt, RELAY_URL as Ru, deviceFrameCapability as Rv, turnStatedVerifier as Ry, APP_SCREENSHOTS_DIR as S, readHandoffHello as S_, DHT_PIN_GRACE_MS as Sa, heldBackError as Sb, chatAppId as Sc, baseMime as Sd, parseReactedFrame as Sf, HANDOFF_HAVE as Sg, wrapDataChannel as Sh, assertWholeSats as Si, txtValue as Sl, ANSWER_REFUSED_REDIALS as Sm, sameSshKey as Sn, GROUP_VERSION_HUBS as So, appRefPublisher as Sp, verifyAtprotoRecordProof as Sr, GROUP_PIN_FRAME as Ss, groupWakes as St, proofCapability as Su, encodeGhostlyInvite as Sv, nextTurnPosition as Sy, appViewOf as T, readHandoffRelease as T_, HANDLED_WAIT_MS as Ta, MAX_DNS_PACKET_BYTES as Tb, parseAppFrame as Tc, formatVoiceDuration as Td, reactedFrame as Tf, HANDOFF_LIST_PER_FRAME as Tg, RTC_SIGNAL_FUTURE_MS as Th, parsePaymentAmount as Ti, CAPS_ISSUED_BACK_MS as Tl, DataLink as Tm, sshSignCommand as Tn, mayBeHub as To, checkAppRevokeStatement as Tp, DID_FILE_MAX_BYTES as Tr, PIN_FRAME as Ts, GROUP_LIMITS as Tt, storageProof as Tu, inviteOwnership as Tv, readTurnPacket as Ty, communityCommitHash as U, ENROLL_DONE as U_, pairedMessageFrame as Ua, sign as Ub, sessionCapabilitiesFrame as Uc, EDIT_FRAME as Ud, BUTTON_STYLES as Uf, handoffAttemptSucceeded as Ug, isGlobalIpv4Host as Uh, pubkyProofFile as Ui, IDENTITY_MAX_FRAME as Ul, LinkSession as Um, decodeWitness as Un, rankHubs as Uo, GROUP_ID as Up, parseDid as Ur, WAKE_TTL_SECONDS as Us, MENTION_LIMITS as Ut, irohRelayUrl as Uu, deviceLinkSealKey as Uv, DEFAULT_RELAYS as Uy, CommunitySession as V, ENROLL_CANCEL as V_, UNPROVEN_AUTH_MS as Va, identityFromSeedB64 as Vb, WAKE_SESSION_CAPABILITY as Vc, EDIT_BUFFER_MAX as Vd, ACTIVE_TASK_STATUSES as Vf, handoffAttemptAllowed as Vg, extractParamsFromSdp as Vh, normalizePubkyKey as Vi, IDENTITY_CLOCK_SKEW as Vl, FIRST_PUBLISH_MAX_MS as Vm, decodeBitcoinAddress as Vn, newerHead as Vo, readCanonicalJson as Vp, didWebHost as Vr, WAKE_INTERVAL_MS as Vs, validEditText as Vt, checkedDescriptors as Vu, deviceLinkParams as Vv, BACKGROUND_WHILE_SIGNALING as Vy, communityGroupId as W, ENROLL_GRANT as W_, parsePaymentNetworks as Wa, verify as Wb, PAIRED_PROFILE as Wc, EDIT_RATE_WINDOW_MS as Wd, ITEM_STATES as Wf, handoffBusyFrame as Wg, parseCallSignal as Wh, pubkyProofPath as Wi, IDENTITY_MAX_VALIDITY as Wl, MAX_DHT_TEXT_BYTES as Wm, encodeTx as Wn, readBeacon as Wo, GROUP_MEMBER_CAP as Wp, parseDidDocument as Wr, WakeLimiter as Ws, mentionsBytes as Wt, rankTransports as Wu, deviceLinkSecret as Wv, DEPARTED_READS as Wy, derivedSecret as X, enrollDoneFrame as X_, parseEngineError as Xa, MAX_AVATAR_LENGTH as Xb, HOLD_LIMITS as Xc, editFrame as Xd, TASK_STATUSES as Xf, handoffDoneFrame as Xg, MAX_MSGS_PAYLOAD_B64 as Xh, LNURL_LIMITS as Xi, IdentityCheckUnavailable as Xl, RELAY_POLL_INTERVALS as Xm, u64 as Xn, PAIRED_CALL_FRAME as Xo, OWN_FRAME_LIMIT as Xp, DID_DHT_MAX_PAYLOAD as Xr, relayRequest as Xs, MAX_GROUP_NAME_LENGTH as Xt, DHT_MESSAGE_TTL as Xu, seedSigner as Xv, GROUP_SIGNALING_ALLOWANCE_SHARE as Xy, decodeCommunityLink as Y, enrollDigits as Y_, engineText as Ya, tryDecrypt as Yb, HOLD_DATED_BACK_MS as Yc, dhtEditId as Yd, STATUS_CARD_LIMITS as Yf, handoffDigest as Yg, LABEL$1 as Yh, LIGHTNING_DESTINATION_PATTERN as Yi, IDENTITY_SUBJECT as Yl, PRESENCE_WINDOW as Ym, u32$2 as Yn, MAX_PAIRED_CALL_SIGNAL as Yo, MEMBER_KEY as Yp, strictBase64Url as Yr, readWakePayload as Ys, MAX_GROUP_NAME_BYTES as Yt, DHT_FILE_TOO_LARGE as Yu, verifyDeviceTransports as Yv, GROUP_RATION_WINDOW_MS as Yy, encodeCommunityLink as Z, enrollGrantFrame as Z_, PairingTracker as Za, MAX_AVATAR_SIDE as Zb, HoldKeys as Zc, editedFrame as Zd, appCardId as Zf, handoffEphemeral as Zg, RECORD_TTL as Zh, fetchLnurlJson as Zi, IdentityExchange as Zl, STALLED_LOOK_MS as Zm, varBytes as Zn, PairedCalls as Zo, SAID_AGAIN as Zp, DID_DHT_PREFIX as Zr, wakeFrame as Zs, MAX_GROUP_PICTURE_LENGTH as Zt, DHT_TEXT_BYTES as Zu, webCryptoSigner as Zv, HEDGE_MISSING_MS as Zy, APP_CLIENTS as _, readHandoffCancel as __, BLOCKED_DIAL_WAIT_MS as _a, BREAKER_MAX_MS as _b, AppSessions as _c, sanitizeMime as _d, REACTED_FRAME as _f, HANDOFF_CANCEL_REASONS as _g, decodeChunk as _h, SEPOLIA_TEST_USDT_FAUCET as _i, normalizeDomain as _l, openPair as _m, SSH_KEY_TYPES as _n, SIGNAL_HOLD_MS as _o, APP_NAME as _p, parseAtprotoCar as _r, sanitizeTypingStatus as _s, GROUP_WAKE_GROUP_WINDOW_MS as _t, STORAGE_ROOT as _u, INVITE_VERSION as _v, __commonJSMin as _x, TURN_TTL as _y, checkAppBeforeRun as a, handoffReleaseFrame as a_, BOLT11_PATTERN as aa, SLOW_DEMOTE_MS as ab, generateVapidKeys as ac, dhtFileId as ad, linkEnd as af, SERVICES_VERSION as ag, parseLocalTarget as ah, didDhtRecords as ai, DOMAIN_MAX_RECORDS as al, sortRoster as am, groupName as an, isGroupMessageId as ao, readStatusCard as ap, checkAtprotoProofRecord as ar, TYPING_FRAME as as, KNOCK_TTL_MS as at, newIdentityBinding as au, DEVICE_INVITE_BYTES as av, trimEndOf as ax, TOMBSTONE_SEQUENCE as ay, APP_ICON_PATH as b, readHandoffFileFrame as b_, DEMOTE_AFTER_FAILURES as ba, DiscoveryBudgetError as bb, appDataFrame as bc, VOICE_LIMITS as bd, ReactionWindow as bf, HANDOFF_FILE_MISSING as bg, encodeControl as bh, WALLET_NETWORKS as bi, recordsFromWellKnown as bl, sealSecret as bm, parseSshPublicKey as bn, groupSignalFrame as bo, appFingerprint as bp, readAtprotoCid as br, typingKindOf as bs, GroupWakeLimiter as bt, isProofAdapter as bu, createLink as bv, __require as bx, encodeTurnFields as by, APP_STORE_LIMITS as c, handoffStreamKey as c_, ENDPOINT as ca, WATCH_SHARE as cb, vapidKeysMatch as cc, imageSize as cd, previewImageSize as cf, isValidServiceId as cg, sanitizeRequestHeaders as ch, jwkThumbprint as ci, NIP05_PATH as cl, verifyCommitSignature as cm, parseGroupMetaBody as cn, readGroupWant as co, statusCardText as cp, parseAtprotoDidDocument as cr, TYPING_RATE_WINDOW_MS as cs, encodeGroupEntryLink as ct, signIdentityPresentation as cu, createDeviceInvite as cv, fromBase64 as cx, TURN_LABEL as cy, readAppListing as d, handoffVersions as d_, findEndpoint as da, normalizeRelayUrl as db, APP_PEER_OPEN_MAX as dc, readImageMeta as dd, forwardedAgain as df, servicesToWire as dg, webLocalFetch as dh, signDidDhtPacket as di, dnsProofName as dl, confirmationTag as dm, parseGroupMetaTag as dn, CarriedTransport as do, MESSAGE_CLOCK_SKEW_MS as dp, AtprotoProofError as dr, TYPING_STATUS_MAX as ds, knockIdentity as dt, applyIdentityEvent as du, encodeDeviceInvite as dv, randomBytes as dx, TURN_NAME_BYTES as dy, handoffHaveFrames as e_, parseInvoiceCallback as ea, RELAY_REQUESTS_PER_MINUTE as eb, PUSH_SERVICE_HOSTS as ec, LIVE_POLL_MS as ed, validEditMessage as ef, isEmptyLinkPacket as eg, presenceSeenAt as eh, DidDhtError as ei, newMailbox as el, expectedRoster as em, groupMetaBody as en, GROUP_VERSION_FILES as eo, cardLine as ep, ATPROTO_PROOF_COLLECTION as er, FILE_FRAMES as es, shortHash as et, identityPresentationBytes as eu, enrollProofFrame as ev, MAX_NICK_LENGTH as ex, TURN_SETTLE_MS as ey, readAppStore as f, isHandoffPartName as f_, isFederationId as fa, readRelayBody as fb, APP_RATE_LIMIT as fc, FileTransfers as fd, forwardedMany as ff, HANDOFF_ACK as fg, CHUNK_FLAG_END as fh, ETHEREUM_USDT as fi, domainTxtRecord as fl, decryptText as fm, signGroupMeta as fn, GROUP_SIGNAL_FRAME as fo, arrivalKey as fp, atprotoCidFor as fr, TYPING_TIMEOUT_MS as fs, knockRecords as ft, lastSharedWithMe as fu, readDeviceInvite as fv, toBase64 as fx, TURN_NO_ACTIVE as fy, APP_BUNDLE_MAGIC as g, readHandoffBusy as g_, ANSWERS_REFUSED_PAUSE_MS as ga, BREAKER_BASE_MS as gb, APP_VERSION_MAX as gc, sanitizeFileName as gd, QUICK_REACTIONS as gf, HANDOFF_CANCEL as gg, PROTOCOL_VERSION as gh, SEPOLIA_TEST_USDT as gi, nip05RootKey as gl, newEpochSecret as gm, SSHSIG_NAMESPACE as gn, SIGNAL_FRESH_MS as go, shownTime as gp, findInMst as gr, parseTypingFrame as gs, GROUP_WAKE_GROUP_LIMIT as gt, STORAGE_LIFETIME as gu, INVITE_MAX_LENGTH as gv, utf8Encode as gx, TURN_SLOTS as gy, APP_BUNDLE_LIMITS as h, readHandoffAck as h_, ANSWERS_REFUSED_PAUSES as ha, BREAKER_ALL_DOWN_PROBE_MS as hb, APP_SEND_LIMIT as hc, safeBlobType as hd, GROUP_REACTION_FRAME as hf, HANDOFF_BUSY_REASONS as hg, MAX_CHUNK_PAYLOAD_BYTES as hh, PaymentPreflightError as hi, isPublicAddress as hl, epochKeys as hm, SSHSIG_MAX_ARMOR as hn, SIGNAL_CARRIERS as ho, receivedTimestamp as hp, encodeDagCbor as hr, parseTypingActivity as hs, GROUP_WAKE_FRAME as ht, PeerProofs as hu, INVITE_LINK_ORIGIN as hv, utf8Decode as hx, TURN_SIGNED_BYTES as hy, appUpdateDecision as i, handoffPakeFrame as i_, resolveLightningDestination as ia, SIGNALING_WINDOW_MS as ib, encryptPushPayload as ic, dhtFileElements as id, canonicalUrl as if, MAX_SERVICES as ig, formatLocalTarget as ih, didDhtKey as ii, DOMAIN_FILE_MAX_BYTES as il, signCommit as im, groupMetaTag as in, groupFileFallback as io, checkStatusCard as ip, atprotoProofRkey as ir, transferStalled as is, GROUP_ENTRY_PROFILE as it, isIdentityBinding as iu, verifyEnrollProof as iv, stripHidden as ix, turnPutSummary as iy, isAppPath as j, SET_ACK as j_, PAIRING_ATTEMPT_MS as ja, newerPacket as jb, FILES_CAPABILITY as jc, voiceLevel as jd, validReactionNumber as jf, HANDOFF_RELEASE as jg, CALL_SIGNAL_FUTURE_MS as jh, sparkAddressKind as ji, CapsKeys as jl, DIRECT_EVIDENCE_MS as jm, MessageRefusal as jn, COMMUNITY_TOPOLOGY as jo, readAppRevocationShape as jp, DidError as jr, pinFrame as js, frameBytes as jt, RING_LIFETIME as ju, DEVICE_CAPABILITIES as jv, turnKeys as jy, findAppForbiddenKey as k, sealHandoffPiece as k_, LIVENESS_PING_MS as ka, createRelayPayload as kb, CALLS_CAPABILITY as kc, voiceDownloadName as kd, readDhtReactions as kf, HANDOFF_PIECE_BYTES as kg, offerIsFresh as kh, SPARK_PROVIDER as ki, CAPS_REFRESH_MS as kl, REANSWERS as km, verifyBitcoinMessage as kn, pickMeshHubs as ko, isAppSignature as kp, DID_MAX_LENGTH as kr, parsePinFrame as ks, asWritten as kt, verifyNostrProof as ku, readInviteCode as kv, signTurnRelease as ky, checkAppListing as l, handoffVerifiedFrame as l_, cashuRequestPayload as la, WRITE_FIRST_MS as lb, APP_DATA_MAX_BYTES as lc, isImageMime as ld, sanitizePreviewImage as lf, serviceIdFromName as lg, sanitizeResponseHeaders as lh, openDidDhtPayload as li, WELL_KNOWN_PATH as ll, GROUP_PROFILE as lm, parseGroupMetaFrame as ln, readGroupWantNo as lo, taskProgress as lp, shortAtprotoDid as lr, TYPING_REFRESH_MS as ls, entryParams as lt, verifyIdentityPresentation as lu, deviceInviteJoinerKeyZ32 as lv, fromBase64Url as lx, TURN_LAST_SEQUENCE as ly, signAppStore as m, openHandoffPiece as m_, parseFedimintRequestPayload as ma, traceLink as mb, APP_RESUME_GRACE_MS as mc, formatFileSize as md, COMMUNITY_REACTION_FRAME as mf, HANDOFF_BUSY as mg, LIMITS as mh, ONCHAIN_PROVIDER as mi, encodeDnsQuery as ml, encryptText as mm, wrapGroupMeta as mn, SIGNALS_PER_MINUTE as mo, heardTime as mp, decodeDagCbor as mr, TypingSender as ms, readKnocks as mt, PROOF_CAPABILITY as mu, INVITE_HRP as mv, toZ32 as mx, TURN_SEALED_BYTES as my, appRevocationFor as n, handoffManifestFrames as n_, parsePayParams as na, RelayTransport as nb, checkPushEndpoint as nc, peekDhtMailbox as nd, LINK_MAX_CHARS as nf, HTTP_SERVICE_PROTO as ng, HttpClient as nh, didDhtDocument as ni, DNS_LABEL as nl, rosterAdmin as nm, groupMetaNewer as nn, GROUP_WANT_NO_FRAME as no, cardTimeUtc as np, atprotoDidMethod as nr, refusalText as ns, verifyCommunityChain as nt, identityStatement as nu, readEnrollGrant as nv, sanitizeDisplayText as nx, classifyTurnRead as ny, planAppUpdate as o, handoffRequestFrame as o_, decodeBolt11 as oa, SLOW_MS as ob, pushRequest as oc, readDhtFile as od, linksIn as of, decodeServices as og, relativizeLocation as oh, encodeDidDhtDeactivated as oi, DOMAIN_METHODS as ol, verifyChain as om, nextGroupMetaRevision as on, readGroupFileMeta as oo, sameButtonText as op, isAtprotoDid as or, TYPING_KINDS as os, MAX_KNOCKS as ot, receivedIdentityStatus as ou, DEVICE_INVITE_LIFETIME_S as ov, bytesEqual as ox, TOMBSTONE_TURN as oy, readAppStoreSteps as p, newHandoffId as p_, parseCashuRequestPayload as pa, setLinkTraceSink as pb, APP_RATE_WINDOW_MS as pc, PREVIEWABLE_IMAGE as pd, readForwarded as pf, HANDOFF_ATTEMPTS as pg, CHUNK_KIND as ph, EVM_TEST_CHAINS as pi, domainWellKnownFile as pl, edgeParams as pm, verifyGroupMetaSignature as pn, GROUP_VERSION_SIGNALS as po, claimedTime as pp, decodeAtprotoCommit as pr, TypingReceiver as ps, mergeKnocks as pt, PROOF_ADAPTERS as pu, DEVICE_INVITE_VERSION as pv, toBase64Url as px, TURN_REV_LIMIT as py, communityRoster as q, enrollCancelFrame as q_, EngineError as qa, generateEncryptionKey as qb, SESSION_RECEIVE_PENDING as qc, MAX_EDITS_PER_MESSAGE as qd, ROUTINE_STATES as qf, handoffContextProof as qg, signalHasVideo as qh, homeserverWebEndpoint as qi, IDENTITY_REVOCATION_LABEL as ql, OFFER_STEP_MAX as qm, sha256d as qn, shouldBeHub as qo, MAX_GROUP_CHAIN as qp, signingKeys as qr, parseWakeFrame as qs, wireMentions as qt, ACTIVE_DHT_POLL_MS as qu, signDeviceTransports as qv, GROUP_BURST_ONE_LINK as qy, appStoreDecision as r, handoffOfferFrame as r_, requestLnurlInvoice as ra, SIGNALING_ALLOWANCE_SHARE as rb, decryptPushPayload as rc, DHT_FILE_CAPABILITY as rd, LINK_PREVIEW_LIMITS as rf, LEGACY_SERVICES as rg, HttpHost as rh, didDhtFromPublicKey as ri, DNS_TYPE as rl, rosterHas as rm, groupMetaPicture as rn, fetchesByItself as ro, cardUrl as rp, atprotoProofRecord as rr, transferEnded as rs, verifyCommunityCommit as rt, identityStatementText as ru, readEnrollHello as rv, sanitizeNick as rx, keptAtEqualSequence as ry, APP_STORE_KINDS as s, handoffRetryAfter as s_, findBolt11 as sa, TURN_SOURCE_TIMEOUT_MS as sb, vapidAuthorization as sc, IMAGE_LIMITS as sd, parseLinkPreview as sf, encodeServices as sg, resolveTargetUrl as sh, encodeDidDhtPacket as si, DOMAIN_TXT_MAX_BYTES as sl, verifyCommit as sm, openGroupMeta as sn, readGroupHave as so, statusCardBytes as sp, normalizeAtprotoHandle as sr, TYPING_RATE_LIMIT as ss, decodeGroupEntryLink as st, revokesIdentity as su, DEVICE_INVITE_OWN_DEVICE as sv, concatBytes as sx, TURN_BODY_BYTES as sy, addedAppPermissions as t, handoffHelloFrame as t_, parseLightningDestination as ta, REQUESTS_PER_MINUTE as tb, WebPushError as tc, emptyDhtDeliveryState as td, validEditNumber as tf, parseLinkRecords as tg, GhostlyHttpError as th, decodeDidDhtPacket as ti, readManifest as tl, rememberAlone as tm, groupMetaChange as tn, GROUP_WANT_FRAME as to, cardLinkHost as tp, ATPROTO_PROOF_SCOPE as tr, FILE_LIMITS as ts, signCommunity as tt, identityRevocationValue as tu, formatEnrollDigits as tv, hasVisible as tx, TURN_VISIBLE_MS as ty, checkAppStoreIndex as u, handoffVerifiedMessage as u_, fedimintRequestPayload as ua, currentRelays as ub, APP_FRAME as uc, parseImageMeta as ud, FORWARD_LIMITS as uf, servicesFromWire as ug, viewerResponseHeaders as uh, resolveDidDht as ui, decodeDnsResponse as ul, confirmationMatches as um, parseGroupMetaStatement as un, CARRIED_DEFER_MS as uo, usageLeft as up, AtprotoCid as ur, TYPING_SEND_LIMIT as us, groupEntryUrl as ut, IDENTITY_TIMELINE_MAX as uu, deviceInviteJoinerParams as uv, fromZ32 as ux, TURN_MAX as uy, APP_CLIENT_NAME as v, readHandoffData as v_, CROSSED_FRESH_MS as va, BREAKER_THRESHOLD as vb, appCloseFrame as vc, PLAYABLE_AUDIO as vd, REACTION_FRAME as vf, HANDOFF_DATA as vg, decodeControl as vh, TEST_USDT_FAUCET_AMOUNT as vi, parseDomainTxt as vl, openSecret as vm, SSH_PUBLIC_KEY_MAX as vn, SIGNAL_PROVEN_MS as vo, APP_PREFIXES as vp, parseAtprotoDidKey as vr, typingActivity as vs, GROUP_WAKE_MEMBER_INTERVAL_MS as vt, emptyProofLedger as vu, OwnInviteError as vv, __esmMin as vx, TURN_VERSION as vy, appDigest as w, readHandoffPake as w_, GhostLink as wa, withRequestOptions as wb, isChatAppId as wc, fileMessageText as wd, queueReaction as wf, HANDOFF_LATER_BYTES as wg, DATA_CHANNEL_LABEL as wh, isWalletNetwork as wi, wellKnownUrl as wl, DATA_SETTLE_MS as wm, sshKeyDigestHex as wn, NO_HUB_POLICY as wo, appSignedBytes as wp, DID_DOCUMENT_MAX_BYTES as wr, PIN_CLOCK_SKEW_MS as ws, parseGroupWakeFrame as wt, proofStatement as wu, inviteLink as wv, readTurnBody as wy, APP_PERMISSIONS as x, readHandoffHave as x_, DEMOTE_MS as xa, budgetRetryMs as xb, appOpenFrame as xc, VOICE_METER as xd, nextReactionNumber as xf, HANDOFF_FILE_REQUEST as xg, sendBody as xh, assertTokenUnits as xi, recordsName as xl, sha256Hex as xm, parseSshSignature as xn, readGroupSignal as xo, appRef as xp, unsignedCommitBytes as xr, COMMUNITY_PIN_FRAME as xs, groupWakeFrame as xt, nostrProofTemplate as xu, decodeInviteCode as xv, __toCommonJS as xx, firstDeviceSetSecret as xy, APP_FORBIDDEN_KEYS as y, readHandoffDone as y_, CROSSED_WAIT_MS as ya, RelayBreaker as yb, appDataBytes as yc, RECORDING_TYPES as yd, REACTION_LIMITS as yf, HANDOFF_DONE as yg, encodeChunk as yh, USDT_PUBLIC_RPC as yi, recordsFromTxt as yl, sealPair as ym, SshSigError as yn, SIGNAL_REPLY_MS as yo, APP_STATEMENT_LIMITS as yp, parseAtprotoVerificationKey as yr, typingFrame as ys, GROUP_WAKE_RECEIVE_LIMIT as yt, importedProof as yu, createChatInvite as yv, __exportAll as yx, TurnRecordError as yy, COMMUNITY_LIMITS as z, verifySetUpdate as z_, RTC_UNSTARTED_MS as za, createIdentity as zb, TYPING_CAPABILITY as zc, parseVideoMeta as zd, replySnippet as zf, filePartName as zg, compressSdp as zh, isPubkyProofFolder as zi, IDENTITY_CHALLENGE_WINDOW as zl, DHT_POLL_INTERVALS as zm, compactSize as zn, mergeBeacon as zo, canonicalJson as zp, didWebFileNames as zr, WAKE_CALL_WAIT_MS as zs, meshMessageRef as zt, TRANSPORTS as zu, deviceKeyZ32 as zv, turnVerifierMark as zy };
31055
31295
 
31056
- //# sourceMappingURL=src-DCeLPsi-.js.map
31296
+ //# sourceMappingURL=src-BqHTnRWH.js.map