@ghostlytools/sdk 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -755,6 +755,13 @@ var READ_STARVED_MS = 6e4;
755
755
  /** How long a read that let an older one go first waits before it asks again. */
756
756
  var TURN_WAIT_MS = 1e3;
757
757
  /**
758
+ * A background read the budget held back far down the turns asks again no later than this (`backgroundTurnIn`). The
759
+ * requests past the background share go to a read held back long (`READ_STARVED_MS`) that is there when one frees: asked
760
+ * only at its estimated turn, a web app with 200 chats away read each contact every 7 to 8 minutes, not every 6, and
761
+ * one with 100 left half the writes' share unused at 20 s.
762
+ */
763
+ var BACKGROUND_TURN_MAX_MS = 15e3;
764
+ /**
758
765
  * Once a group's read found a relay's minute full, the groups' reads there are spread over the minute for a minute
759
766
  * (`GROUP_RATION_MS`): at most a sixth of it in any 10 s (5 on a relay of 30), the key read longest ago first. A sliding
760
767
  * minute that demand keeps full hands out its requests in bursts: the minute is spent in 25 to 35 s as requests age
@@ -786,6 +793,12 @@ var FRESH_READ_MS = 500;
786
793
  /** A relay that missed a key's newest packet gets it (`catchUpLater`) no sooner than this, and tries again this often. */
787
794
  var CATCH_UP_MIN_MS = 1e3;
788
795
  var CATCH_UP_RETRY_MS = 5e3;
796
+ /**
797
+ * The longest another background write is told to wait behind the packets queued for a relay (`catchUpLater`): the
798
+ * link and the DHT floor try again within a minute anyway, and longer kept a chat's upkeep off a relay with a long queue
799
+ * for most of the presence window.
800
+ */
801
+ var CATCH_UP_BEHIND_MAX_MS = 6e4;
789
802
  /** A catch-up put waits behind every link's request: a background write. A group edge's offer or answer goes as its own (`putEverywhere`). */
790
803
  var CATCH_UP_ASKER = {
791
804
  background: true,
@@ -1025,6 +1038,8 @@ var RelayTransport = class {
1025
1038
  lastPut = /* @__PURE__ */ new Map();
1026
1039
  /** Per relay and key, the newest packet that relay held back for its budget while another relay took it (`catchUpLater`). */
1027
1040
  catchUp = /* @__PURE__ */ new Map();
1041
+ /** Per relay, how many packets wait in `catchUp` for it: background reads leave them their share (`heldFor`). */
1042
+ catchUpWaiting = /* @__PURE__ */ new Map();
1028
1043
  catchUpTimer = null;
1029
1044
  /**
1030
1045
  * Per key whose reads the budget held back since its last read went out: when a request frees for it
@@ -1401,7 +1416,6 @@ var RelayTransport = class {
1401
1416
  putEverywhere(pubKeyZ32, payload, timestamp, options, conflict) {
1402
1417
  this.readAt.delete(pubKeyZ32);
1403
1418
  this.missing.delete(pubKeyZ32);
1404
- for (const relay of this.relays) this.catchUp.delete(`${relay} ${pubKeyZ32}`);
1405
1419
  const waitingBefore = new Map(this.writeWaiting);
1406
1420
  const writer = firstWriter(asker(options, true));
1407
1421
  const noWriteWaits = () => {
@@ -1433,8 +1447,10 @@ var RelayTransport = class {
1433
1447
  } catch (error) {
1434
1448
  if (!isDiscoveryBudgetError(error) && !(error instanceof RelayLeftAloneError)) failed.add(relay);
1435
1449
  nowhere[i] = isDiscoveryBudgetError(error) || error instanceof RelayLeftAloneError || error instanceof RelayNoAnswerError && !error.sent;
1450
+ if (this.catchUp.has(slot) && isDiscoveryBudgetError(error)) this.catchUpLater(relay, pubKeyZ32, payload, timestamp, asker(options, true));
1436
1451
  throw error;
1437
1452
  }
1453
+ if (response.ok && (this.catchUp.get(slot)?.timestamp ?? 0n) <= timestamp) this.dropCatchUp(relay, pubKeyZ32);
1438
1454
  nowhere[i] = response.status >= 400 && response.status < 500;
1439
1455
  if (response.status >= 500 || response.status === 428) failed.add(relay);
1440
1456
  if (response.status === 409) conflict?.(relay);
@@ -1626,6 +1642,7 @@ var RelayTransport = class {
1626
1642
  }
1627
1643
  const resting = this.relays.every((r) => this.isCoolingDown(r, "GET") || this.breaker.blockedFor(r) > 0 || this.heldFor(r, who, Date.now(), pubKeyZ32) > 0);
1628
1644
  const known = down ? this.newest.get(pubKeyZ32) : newerPacket(this.newest.get(pubKeyZ32), this.written.get(pubKeyZ32));
1645
+ if (!down && budgetWait < Infinity) budgetWait = Math.max(budgetWait, this.backgroundTurnIn(pubKeyZ32, who, Date.now()));
1629
1646
  if (resting && known) {
1630
1647
  if (down && !keptOnFailure) throw new RelaysFailedError(known);
1631
1648
  if (!down && budgetWait < Infinity) this.heldBackUntil(pubKeyZ32, Date.now() + budgetWait);
@@ -1761,7 +1778,8 @@ var RelayTransport = class {
1761
1778
  /**
1762
1779
  * A relay whose budget (this client's, or its own rate limit) held a packet back that another relay took: it gets
1763
1780
  * that packet when it frees a request, as a background write (`who`: a group edge's offer or answer as its own, also
1764
- * after that relay failed it). Only the newest per key and relay; a newer packet put everywhere drops it. Without this,
1781
+ * after that relay failed it). Only the newest per key and relay, until that relay takes this packet or a newer one (one
1782
+ * the budget holds there takes its place). Without this,
1765
1783
  * that relay kept the key's older packet for good, and an app that restarted and read it first found a contact's offer
1766
1784
  * long answered, answered it again, and waited on it (bug hunt r7a).
1767
1785
  */
@@ -1770,7 +1788,7 @@ var RelayTransport = class {
1770
1788
  if ((this.lastPut.get(slot) ?? 0n) > timestamp) return;
1771
1789
  const pending = this.catchUp.get(slot);
1772
1790
  if (pending && pending.timestamp >= timestamp) return;
1773
- this.catchUp.set(slot, {
1791
+ this.keepCatchUp(slot, {
1774
1792
  relay,
1775
1793
  key,
1776
1794
  payload,
@@ -1779,6 +1797,16 @@ var RelayTransport = class {
1779
1797
  });
1780
1798
  this.scheduleCatchUp(CATCH_UP_MIN_MS);
1781
1799
  }
1800
+ keepCatchUp(slot, item) {
1801
+ if (!this.catchUp.has(slot)) this.catchUpWaiting.set(item.relay, (this.catchUpWaiting.get(item.relay) ?? 0) + 1);
1802
+ this.catchUp.set(slot, item);
1803
+ }
1804
+ dropCatchUp(relay, key) {
1805
+ if (!this.catchUp.delete(`${relay} ${key}`)) return;
1806
+ const left = (this.catchUpWaiting.get(relay) ?? 1) - 1;
1807
+ if (left > 0) this.catchUpWaiting.set(relay, left);
1808
+ else this.catchUpWaiting.delete(relay);
1809
+ }
1782
1810
  scheduleCatchUp(inMs) {
1783
1811
  if (this.catchUpTimer || this.catchUp.size === 0) return;
1784
1812
  this.catchUpTimer = setTimeout(() => {
@@ -1791,21 +1819,25 @@ var RelayTransport = class {
1791
1819
  for (const [slot, item] of [...this.catchUp]) {
1792
1820
  if (this.catchUp.get(slot) !== item) continue;
1793
1821
  const coolingDown = (this.networkCooldown.get(`PUT ${item.relay}`) ?? 0) - Date.now();
1794
- const wait = Math.max(this.heldFor(item.relay, item.who), this.rateLimitedFor(item.relay), this.breaker.blockedFor(item.relay), coolingDown);
1822
+ const who = {
1823
+ ...item.who,
1824
+ catchUp: true
1825
+ };
1826
+ const wait = Math.max(this.heldFor(item.relay, who), this.rateLimitedFor(item.relay), this.breaker.blockedFor(item.relay), coolingDown);
1795
1827
  if (wait > 0) {
1796
1828
  next = Math.min(next, wait);
1797
1829
  continue;
1798
1830
  }
1799
- this.catchUp.delete(slot);
1831
+ this.dropCatchUp(item.relay, item.key);
1800
1832
  try {
1801
- const response = await this.put(item.relay, item.key, item.payload, void 0, item.who);
1833
+ const response = await this.put(item.relay, item.key, item.payload, void 0, who);
1802
1834
  if ((response.status === 428 || response.status === 429) && !this.catchUp.has(slot)) {
1803
- this.catchUp.set(slot, item);
1835
+ this.keepCatchUp(slot, item);
1804
1836
  next = Math.min(next, CATCH_UP_RETRY_MS);
1805
1837
  }
1806
1838
  } catch (error) {
1807
1839
  if (isDiscoveryBudgetError(error) && !this.catchUp.has(slot)) {
1808
- this.catchUp.set(slot, item);
1840
+ this.keepCatchUp(slot, item);
1809
1841
  next = Math.min(next, error.retryInMs);
1810
1842
  }
1811
1843
  }
@@ -1961,10 +1993,17 @@ var RelayTransport = class {
1961
1993
  const groupOver = within$1(this.spentGroupOver.get(relay) ?? [], now, GROUP_OVER_PACE_MS);
1962
1994
  this.spentGroupOver.set(relay, groupOver);
1963
1995
  if (isGroupSignal(who) && !who.write && recent.length >= limit && groupOver.length > 0) wait = Math.max(wait, groupOver[groupOver.length - 1] + GROUP_OVER_PACE_MS - now);
1996
+ const backgroundShare = Math.min(this.backgroundPerMinute, Math.ceil(limit * 2 / 3));
1997
+ const writesShare = Math.max(1, Math.floor(backgroundShare * BACKGROUND_WRITES_SHARE));
1998
+ const caughtUp = this.catchUpWaiting.get(relay) ?? 0;
1999
+ if (who.background && !who.write && caughtUp) {
2000
+ const writesLeft = writesShare - recentBackgroundWrites.length;
2001
+ if (writesLeft > 0) wait = Math.max(wait, over(recent, Math.max(1, limit - writesLeft)), over(recentBackground, Math.max(1, backgroundShare - writesLeft)));
2002
+ }
2003
+ if (who.background && who.write && !who.catchUp && caughtUp) wait = Math.max(wait, Math.min(CATCH_UP_BEHIND_MAX_MS, Math.ceil(caughtUp * 6e4 / writesShare)));
1964
2004
  if (who.background && !starved) {
1965
- const backgroundShare = Math.min(this.backgroundPerMinute, Math.ceil(limit * 2 / 3));
1966
2005
  wait = Math.max(wait, over(recentBackground, backgroundShare));
1967
- if (who.write) wait = Math.max(wait, over(recentBackgroundWrites, Math.max(1, Math.floor(backgroundShare * BACKGROUND_WRITES_SHARE))));
2006
+ if (who.write) wait = Math.max(wait, over(recentBackgroundWrites, writesShare));
1968
2007
  const signaling = this.urgentAt + SIGNALING_WINDOW_MS - now;
1969
2008
  if (signaling > 0 && !who.door) wait = Math.max(wait, Math.min(signaling, over(recentBackground, Math.min(this.backgroundWhileSignaling, Math.ceil(limit / 6)))));
1970
2009
  }
@@ -2128,6 +2167,29 @@ var RelayTransport = class {
2128
2167
  }
2129
2168
  return false;
2130
2169
  }
2170
+ /**
2171
+ * How long until a background read of `key` the budget held back is likely to have its turn: the background reads of
2172
+ * keys ahead of it in turn (read longer ago, still asking; `turnAhead`), one after the other at the relays' background
2173
+ * share. Told only when the budget frees the next request, every held key asked again then, and lost it to the key
2174
+ * whose turn it was: a daemon whose 50 contacts were away asked about 600 times a minute for some 50 reads, and one
2175
+ * with 200 three times as often after four hours as after 15 minutes (bug hunts, 2026-11-06 and 2026-11-14).
2176
+ */
2177
+ backgroundTurnIn(key, who, now) {
2178
+ if (!who.background || !isTurnRead(who)) return 0;
2179
+ const mine = this.keyTurns.get(key);
2180
+ if (!mine) return 0;
2181
+ const since = (k) => this.heldBack.get(k)?.since ?? now;
2182
+ const mineSince = since(key);
2183
+ let ahead = 0, read = 0;
2184
+ for (const [other, turn] of this.keyTurns) {
2185
+ if (other !== key && turn.who.background && now - turn.servedAt < 6e4) read++;
2186
+ if (other === key || !turn.waiting || !turn.who.background || staleTurn(turn, now)) continue;
2187
+ if (turn.servedAt < mine.servedAt || turn.servedAt === mine.servedAt && (since(other) < mineSince || since(other) === mineSince && other < key)) ahead++;
2188
+ }
2189
+ if (ahead === 0) return 0;
2190
+ const perMinute = this.relays.reduce((sum, relay) => sum + Math.min(this.backgroundPerMinute, Math.ceil(this.limitOf(relay) * 2 / 3)), 0);
2191
+ return Math.min(BACKGROUND_TURN_MAX_MS, Math.ceil(ahead * 6e4 / Math.max(1, perMinute, read)));
2192
+ }
2131
2193
  /** A 1:1 chat's read of `key` the budget has held back for `READ_STARVED_MS` without a break. */
2132
2194
  starved(key, who, now) {
2133
2195
  const since = this.heldBack.get(key)?.since;
@@ -7849,7 +7911,8 @@ function viewerServicePolicy(relayOnly) {
7849
7911
  * The browser features a contact's app in the extension's viewer tab may not use. Its tab is a site of its own, so
7850
7912
  * what the person granted it (camera, microphone, location, a device) would be a site setting of the browser's, which
7851
7913
  * no Delete chat, Clear all data or Delete profile reaches; denied here, the browser never asks and ignores a grant
7852
- * made before. The web app's view is a frame of another site, which gets none of them, and Desktop's window grants none.
7914
+ * made before. The web app's view is a frame of another site, which gets none of them, and Desktop's window grants none
7915
+ * and is served the same value (`PERMISSIONS_POLICY` in `apps/desktop/src/viewer.rs`).
7853
7916
  */
7854
7917
  var VIEWER_PERMISSIONS_POLICY = [
7855
7918
  "camera",
@@ -8421,7 +8484,14 @@ var HttpClient = class {
8421
8484
  * refuses `javascript:` URLs (its own Trusted Types default policy: one passes every other string on as it is);
8422
8485
  * - refuses a declarative shadow root the page's script would make (`setHTMLUnsafe`, `Document.parseHTMLUnsafe`,
8423
8486
  * `document.write`, a write split in two too): its `srcdoc` frames would be out of the guard's sight;
8424
- * - listens for frames' loads again after `document.open()`, which takes every listener of the document away.
8487
+ * - listens for frames' loads again after `document.open()`, which takes every listener of the document away;
8488
+ * - starts a worker made from a `blob:` URL of the page's own (`URL.createObjectURL` in that window) from a script of its
8489
+ * own that makes a pass-through Trusted Types `default` policy there first and then runs the page's (`importScripts`;
8490
+ * for a module worker, a static `import` of the policy's module, then of the page's): such a worker takes the page's
8491
+ * policy, Trusted Types included, and no guard runs in it to make one. A `SharedWorker` made twice from one blob gets
8492
+ * the same script, so it is the same worker; the page's revoke of the blob's URL drops the guard's own a minute later.
8493
+ * A `data:` worker, and a blob made in another window, in a worker or already revoked, run as they were. Once per
8494
+ * window, whichever guard runs first (`ghostlyWorkerGuard`, `CLIPBOARD_GUARD_SCRIPT` does the same).
8425
8495
  * It uses nothing the page can change after it ran (the page's own code runs later, in the same realm).
8426
8496
  *
8427
8497
  * What a script put in the page cannot do, so where the viewer does not run it per document this is not a guarantee:
@@ -8544,12 +8614,71 @@ var VIEWER_GUARD_SCRIPT = `(function noWebRtc(w) {
8544
8614
  return root;
8545
8615
  };
8546
8616
  }
8617
+ if (w.trustedTypes && w.URL && w.Blob && !describe(w, "ghostlyWorkerGuard")) {
8618
+ try {
8619
+ define(w, "ghostlyWorkerGuard", { value: true });
8620
+ const construct = Reflect.construct;
8621
+ const json = JSON.stringify;
8622
+ const later = w.setTimeout;
8623
+ const Blob = w.Blob;
8624
+ const sized = describe(Blob.prototype, "size").get;
8625
+ const make = w.URL.createObjectURL;
8626
+ const revoke = w.URL.revokeObjectURL;
8627
+ const policy = "if (self.trustedTypes && !self.trustedTypes.defaultPolicy) { try { self.trustedTypes.createPolicy('default', { createHTML: (s) => s, createScript: (s) => s, createScriptURL: (s) => s }); } catch (e) {} }";
8628
+ const script = (code) => apply(make, null, [new Blob([code], { type: "text/javascript" })]);
8629
+ const known = { __proto__: null };
8630
+ let first = null;
8631
+ w.URL.createObjectURL = function createObjectURL(object) {
8632
+ const made = apply(make, this, arguments);
8633
+ try { apply(sized, object, []); known[made] = { blob: object, inner: null, classic: null, module: null }; } catch (e) {}
8634
+ return made;
8635
+ };
8636
+ w.URL.revokeObjectURL = function revokeObjectURL(url) {
8637
+ try {
8638
+ const key = text(url);
8639
+ const entry = known[key];
8640
+ if (entry) {
8641
+ delete known[key];
8642
+ const ours = [entry.inner, entry.classic, entry.module];
8643
+ apply(later, w, [() => { for (let i = 0; i < 3; i++) { if (ours[i] !== null) apply(revoke, null, [ours[i]]); } }, 60000]);
8644
+ }
8645
+ } catch (e) {}
8646
+ return apply(revoke, this, arguments);
8647
+ };
8648
+ const start = (url, options) => {
8649
+ const entry = known[text(url)];
8650
+ if (!entry) return url;
8651
+ const kind = options && typeof options === "object" && options.type === "module" ? "module" : "classic";
8652
+ if (entry[kind] === null) {
8653
+ if (entry.inner === null) entry.inner = apply(make, null, [entry.blob]);
8654
+ if (kind === "module" && first === null) first = script(policy);
8655
+ entry[kind] = script(kind === "module" ? "import " + json(first) + "; import " + json(entry.inner) + ";" : policy + " importScripts(" + json(entry.inner) + ");");
8656
+ }
8657
+ return entry[kind];
8658
+ };
8659
+ for (const name of ["Worker", "SharedWorker"]) {
8660
+ const Real = w[name];
8661
+ if (typeof Real !== "function") continue;
8662
+ const started = function (url) {
8663
+ if (new.target === undefined) return apply(Real, this, arguments);
8664
+ const args = [];
8665
+ for (let i = 0; i < arguments.length; i++) args[i] = arguments[i];
8666
+ if (args.length > 0) { try { args[0] = start(url, args[1]); } catch (e) {} }
8667
+ return construct(Real, args, new.target);
8668
+ };
8669
+ define(started, "name", { value: name });
8670
+ started.prototype = Real.prototype;
8671
+ define(Real.prototype, "constructor", { value: started, writable: true, enumerable: false, configurable: true });
8672
+ w[name] = started;
8673
+ }
8674
+ } catch (e) {}
8675
+ }
8547
8676
  apply(listen, home, ["load", sweep, true]);
8548
8677
  watch(home, w.Document.prototype.querySelectorAll);
8549
8678
  } catch (e) {}
8550
8679
  })(window)`;
8551
8680
  /** `VIEWER_GUARD_SCRIPT`'s hash, as a CSP source: a contact's own policy that would refuse it is given it (`allowingViewerGuard`). */
8552
- var VIEWER_GUARD_HASH = "'sha256-P3jYgJwfoJ/cAS31rQz7Tk99bBwsSeN2wDDqJubDMZw='";
8681
+ var VIEWER_GUARD_HASH = "'sha256-DweV0mr/eyHFWESxtsRrzk0i6VjF4GSCokjozAiXkbQ='";
8553
8682
  /**
8554
8683
  * With the guard, where it is put in the page and not run by the viewer in every frame: frames only from the app's own
8555
8684
  * origin (a `data:` or `blob:` frame would run before the guard could), and Trusted Types, which hands each
@@ -8791,7 +8920,9 @@ async function guardViewerAnswer(headers, body, destination, guards = [WEBRTC_GU
8791
8920
  * this script first, a declarative shadow root the page's script would make is refused, and with `VIEWER_GUARD_CSP`
8792
8921
  * a `javascript:` URL is refused (its own Trusted Types default policy; one passes every other string on as it is,
8793
8922
  * or, once the page made its own `default` policy, to that one's rules: the page's `createPolicy("default")` gets the
8794
- * guard's policy back with them, and the copy of itself it puts in a `srcdoc` frame skips them).
8923
+ * guard's policy back with them, and the copy of itself it puts in a `srcdoc` frame skips them);
8924
+ * - starts a worker made from a `blob:` URL of the page's own from a script that makes a pass-through Trusted Types
8925
+ * `default` policy in it first, as the WebRTC guard does (`VIEWER_GUARD_SCRIPT`, whichever of the two runs first).
8795
8926
  * A frame's window keeps what was run in it on its first, empty page when the page it loads is of the same origin (the
8796
8927
  * bridge's guard reaches the app's frame then): there this script only watches the new document. Each document it
8797
8928
  * watches is marked (`ghostlyClipboardGuard`, fixed in place): the bridge reads that to know the guard ran in the page
@@ -8971,6 +9102,66 @@ var CLIPBOARD_GUARD_SCRIPT = `(function noClipboardWrites(w) {
8971
9102
  };
8972
9103
  } catch (e) {}
8973
9104
  }
9105
+ if (types && w.URL && w.Blob && !describe(w, "ghostlyWorkerGuard")) {
9106
+ try {
9107
+ define(w, "ghostlyWorkerGuard", { value: true });
9108
+ const construct = w.Reflect.construct;
9109
+ const json = w.JSON.stringify;
9110
+ const later = w.setTimeout;
9111
+ const Blob = w.Blob;
9112
+ const sized = describe(Blob.prototype, "size").get;
9113
+ const make = w.URL.createObjectURL;
9114
+ const revoke = w.URL.revokeObjectURL;
9115
+ const policy = "if (self.trustedTypes && !self.trustedTypes.defaultPolicy) { try { self.trustedTypes.createPolicy('default', { createHTML: (s) => s, createScript: (s) => s, createScriptURL: (s) => s }); } catch (e) {} }";
9116
+ const script = (code) => apply(make, null, [new Blob([code], { type: "text/javascript" })]);
9117
+ const known = { __proto__: null };
9118
+ let first = null;
9119
+ w.URL.createObjectURL = function createObjectURL(object) {
9120
+ const made = apply(make, this, arguments);
9121
+ try { apply(sized, object, []); known[made] = { blob: object, inner: null, classic: null, module: null }; } catch (e) {}
9122
+ return made;
9123
+ };
9124
+ w.URL.revokeObjectURL = function revokeObjectURL(url) {
9125
+ try {
9126
+ const key = text(url);
9127
+ const entry = known[key];
9128
+ if (entry) {
9129
+ delete known[key];
9130
+ const ours = [entry.inner, entry.classic, entry.module];
9131
+ apply(later, w, [() => { for (let i = 0; i < 3; i++) { if (ours[i] !== null) apply(revoke, null, [ours[i]]); } }, 60000]);
9132
+ }
9133
+ } catch (e) {}
9134
+ return apply(revoke, this, arguments);
9135
+ };
9136
+ const start = (url, options) => {
9137
+ const entry = known[text(url)];
9138
+ if (!entry) return url;
9139
+ const kind = options && typeof options === "object" && options.type === "module" ? "module" : "classic";
9140
+ if (entry[kind] === null) {
9141
+ if (entry.inner === null) entry.inner = apply(make, null, [entry.blob]);
9142
+ if (kind === "module" && first === null) first = script(policy);
9143
+ entry[kind] = script(kind === "module" ? "import " + json(first) + "; import " + json(entry.inner) + ";" : policy + " importScripts(" + json(entry.inner) + ");");
9144
+ }
9145
+ return entry[kind];
9146
+ };
9147
+ const makers = ["Worker", "SharedWorker"];
9148
+ for (let i = 0; i < makers.length; i++) {
9149
+ const Real = w[makers[i]];
9150
+ if (typeof Real !== "function") continue;
9151
+ const started = function (url) {
9152
+ if (new.target === undefined) return apply(Real, this, arguments);
9153
+ const args = [];
9154
+ for (let j = 0; j < arguments.length; j++) args[j] = arguments[j];
9155
+ if (args.length > 0) { try { args[0] = start(url, args[1]); } catch (e) {} }
9156
+ return construct(Real, args, new.target);
9157
+ };
9158
+ define(started, "name", { value: makers[i] });
9159
+ started.prototype = Real.prototype;
9160
+ define(Real.prototype, "constructor", { value: started, writable: true, enumerable: false, configurable: true });
9161
+ w[makers[i]] = started;
9162
+ }
9163
+ } catch (e) {}
9164
+ }
8974
9165
  const reopen = proto.open;
8975
9166
  proto.open = function () {
8976
9167
  const got = apply(reopen, this, arguments);
@@ -9036,7 +9227,7 @@ var CLIPBOARD_GUARD_SCRIPT = `(function noClipboardWrites(w) {
9036
9227
  } catch (e) {}
9037
9228
  })(window)`;
9038
9229
  /** `CLIPBOARD_GUARD_SCRIPT`'s hash, as a CSP source: the bridge's policy and a contact's own are given it. */
9039
- var CLIPBOARD_GUARD_HASH = "'sha256-ay9kpYD2BIflB8W9w+iAbo1krsFBwIJunUmXTACfhao='";
9230
+ var CLIPBOARD_GUARD_HASH = "'sha256-D8U3zSg1xP77RbZuV/DekRuM6nx80gIN5mh2TQAtZ40='";
9040
9231
  // ../core/src/link.ts
9041
9232
  /** What Ghostly Desktop uses against the DHT. */
9042
9233
  var DHT_POLL_INTERVALS = {
@@ -13439,6 +13630,14 @@ var DhtDelivery = class DhtDelivery {
13439
13630
  announceTimer = null;
13440
13631
  chain = Promise.resolve();
13441
13632
  lastPublish = 0;
13633
+ /**
13634
+ * A withdrawn text's envelope may still be on the relays, and the one to replace it has not gone (`withdraw`): it is
13635
+ * tried again with a text's backoff, `MAX_ATTEMPTS` times at most, until `until` (when no reader takes the withdrawn
13636
+ * one any more), not at the next keep-alive four minutes on. Any envelope that goes out replaces it.
13637
+ */
13638
+ withdrawal;
13639
+ /** When the last withdrawal's envelope went (its `lastPublish`), for `withdrawalWaits`. */
13640
+ withdrewAt = -1;
13442
13641
  /** The sequence of the last envelope of the contact that was past its expiry (traced once). */
13443
13642
  expiredSeen = 0;
13444
13643
  controlDue = 0;
@@ -13480,6 +13679,8 @@ var DhtDelivery = class DhtDelivery {
13480
13679
  namedRev;
13481
13680
  /** A reaction of this side waits to ride on an envelope, or the contact's reactions wait to be said taken. */
13482
13681
  reactionsDue = false;
13682
+ /** The text on the floor whose envelope left the reactions no room (its id): they wait for the ones its backoff publishes. */
13683
+ crowdedBy;
13483
13684
  constructor(options) {
13484
13685
  this.options = options;
13485
13686
  const { peerRejected: _peerRejected, ...state } = structuredClone(options.state ?? emptyDhtDeliveryState());
@@ -13880,6 +14081,11 @@ var DhtDelivery = class DhtDelivery {
13880
14081
  };
13881
14082
  this.peerNewAt = bounded(this.peerNewAt, now);
13882
14083
  this.lastPublish = bounded(this.lastPublish, now);
14084
+ if (this.withdrawal) this.withdrawal = {
14085
+ ...this.withdrawal,
14086
+ until: bounded(this.withdrawal.until, now, DHT_MESSAGE_TTL + DHT_EXPIRY_SKEW_MS),
14087
+ next: bounded(this.withdrawal.next, now, BACKOFF_MAX_MS)
14088
+ };
13883
14089
  this.networkBackAt = bounded(this.networkBackAt, now);
13884
14090
  this.pinnedProbeAt = bounded(this.pinnedProbeAt, now);
13885
14091
  this.controlDue = bounded(this.controlDue, now, Math.max(24e4, UNUSED_INVITE_UPKEEP_MS, this.options.firstControlAfterMs ?? 0));
@@ -13894,23 +14100,25 @@ var DhtDelivery = class DhtDelivery {
13894
14100
  if (edit !== void 0 && (reply !== void 0 || !ID$3.test(edit[0]) || !validEditNumber(edit[1]))) return "Invalid message.";
13895
14101
  if (utf8Encode(text).length > 256) return DHT_TEXT_TOO_LONG;
13896
14102
  if (/cashu[AB][A-Za-z0-9_-]+/i.test(text)) return "Payment tokens cannot be sent through DHT delivery.";
13897
- const now = this.clock(), pending = this.state.pending;
13898
- if (pending && pending.expires > now && pending.message[0] !== id) return "One DHT text can await a receipt at a time. Wait for its receipt or expiry before sending another.";
13899
- if (pending?.message[0] === id && pending.expires > now && pending.attempts >= MAX_ATTEMPTS) return "DHT retry budget exhausted. Wait for expiry before retrying this message.";
13900
- const next = pending?.message[0] === id && pending.expires > now ? pending : {
14103
+ const now = this.clock(), pending = this.state.pending, mine = pending?.message[0] === id && pending.expires > now ? pending : void 0;
14104
+ const next = mine ?? {
13901
14105
  message: [
13902
14106
  id,
13903
14107
  timestamp,
13904
14108
  text
13905
14109
  ],
13906
- expires: now + DHT_MESSAGE_TTL,
14110
+ expires: now + 3e5,
13907
14111
  attempts: 0,
13908
14112
  next: now,
13909
14113
  ...reply && { reply },
13910
14114
  ...edit && { edit }
13911
14115
  };
13912
14116
  const error = this.packetError(next.message, next.expires, next.reply, next.edit);
13913
- return error && next.reply ? this.packetError(next.message, next.expires) : error;
14117
+ const tooBig = error && next.reply ? this.packetError(next.message, next.expires) : error;
14118
+ if (tooBig) return tooBig;
14119
+ if (pending && pending.expires > now && !mine) return "One DHT text can await a receipt at a time. Wait for its receipt or expiry before sending another.";
14120
+ if (mine && mine.attempts >= MAX_ATTEMPTS) return "DHT retry budget exhausted. Wait for expiry before retrying this message.";
14121
+ return null;
13914
14122
  }
13915
14123
  /**
13916
14124
  * Measured, not built (`bodyFits`): the outbox asks it of every waiting text at each look, and a text that waits as no
@@ -13963,6 +14171,10 @@ var DhtDelivery = class DhtDelivery {
13963
14171
  pending: next
13964
14172
  });
13965
14173
  this.changed();
14174
+ if (this.withdrawalWaits()) {
14175
+ this.schedule();
14176
+ return null;
14177
+ }
13966
14178
  try {
13967
14179
  await this.publish(true);
13968
14180
  this.schedule();
@@ -14066,6 +14278,10 @@ var DhtDelivery = class DhtDelivery {
14066
14278
  pending: next
14067
14279
  });
14068
14280
  this.changed();
14281
+ if (this.withdrawalWaits()) {
14282
+ this.schedule();
14283
+ return null;
14284
+ }
14069
14285
  try {
14070
14286
  await this.publish(true);
14071
14287
  } catch (error) {
@@ -14087,25 +14303,44 @@ var DhtDelivery = class DhtDelivery {
14087
14303
  * A text of mine (or an edit of it) deleted here while it waits on the floor leaves it: the state no longer holds it
14088
14304
  * (nor as `confirmed`: no receipt came), and, while its envelope was still in effect, a new one without it takes that
14089
14305
  * one's place on the relays, so a contact who looks later finds no text. Resolves once the state without it is saved;
14090
- * the new envelope goes after.
14306
+ * the new envelope goes after. One that does not go (no relay reachable) is tried again within seconds (`withdrawal`):
14307
+ * a reader takes the withdrawn envelope until its expiry and the clock skew allowed past it (`DHT_EXPIRY_SKEW_MS`).
14308
+ * It goes at once, spacing or not: the deleted text is out of reach from then on. The text that takes the floor next
14309
+ * waits out the spacing instead (`withdrawalWaits`).
14091
14310
  */
14092
14311
  async withdraw(wireId) {
14093
- if (await this.serialize(async () => {
14312
+ const expires = await this.serialize(async () => {
14094
14313
  const pending = this.state.pending;
14095
- if (!pending || pending.message[0] !== wireId && pending.edit?.[0] !== wireId) return false;
14314
+ if (!pending || pending.message[0] !== wireId && pending.edit?.[0] !== wireId) return 0;
14096
14315
  await this.persist({
14097
14316
  ...this.state,
14098
14317
  pending: void 0
14099
14318
  });
14100
14319
  this.changed();
14101
- return pending.attempts > 0 && pending.expires > this.clock();
14102
- })) this.serialize(async () => {
14320
+ return pending.attempts > 0 && pending.expires > this.clock() ? pending.expires : 0;
14321
+ });
14322
+ if (expires) this.serialize(async () => {
14323
+ this.withdrawal = {
14324
+ until: expires + DHT_EXPIRY_SKEW_MS,
14325
+ attempts: 0,
14326
+ next: 0
14327
+ };
14103
14328
  try {
14104
14329
  await this.publish(true);
14105
14330
  } catch {}
14331
+ this.withdrewAt = this.lastPublish;
14106
14332
  this.schedule();
14107
14333
  });
14108
14334
  }
14335
+ /**
14336
+ * The last envelope was a withdrawal's, inside the publication spacing: the text that takes the floor now goes once
14337
+ * the spacing allows (`schedule`), not in an envelope of its own at once. Deleted then, it never went, so it costs
14338
+ * no withdrawal: deleting 10 texts queued for an away contact one after the other, each one's withdrawal and the next
14339
+ * text's envelope put 10 envelopes on every relay in under 2 s, each replaced a moment later (bug hunt, 2026-11-15).
14340
+ */
14341
+ withdrawalWaits() {
14342
+ return this.withdrewAt === this.lastPublish && this.clock() - this.lastPublish < 4e3;
14343
+ }
14109
14344
  /** The id of what awaits its receipt on the floor now, if anything does. */
14110
14345
  get pendingId() {
14111
14346
  const now = this.clock(), pending = this.state.pending;
@@ -14140,6 +14375,7 @@ var DhtDelivery = class DhtDelivery {
14140
14375
  async announceReactions() {
14141
14376
  if (!this.options.reactions?.().length) return;
14142
14377
  this.reactionsDue = true;
14378
+ this.crowdedBy = void 0;
14143
14379
  await this.serialize(async () => {
14144
14380
  try {
14145
14381
  await this.publish();
@@ -14221,7 +14457,9 @@ var DhtDelivery = class DhtDelivery {
14221
14457
  const receipt = this.state.receipt && this.state.receipt.expires > now && this.state.receipt.attempts < MAX_ATTEMPTS ? this.state.receipt : void 0;
14222
14458
  const receiptDue = !!receipt && !receipt.settled && (receipt.next ?? 0) <= now;
14223
14459
  const reseal = this.resealDue;
14224
- const keepAlive = !force && (!pending || pending.next > now) && !receiptDue && !this.reactionsDue && !reseal;
14460
+ const withdrawal = this.withdrawal && this.withdrawal.until > now && this.withdrawal.attempts < MAX_ATTEMPTS ? this.withdrawal : void 0;
14461
+ if (!withdrawal) this.withdrawal = void 0;
14462
+ const keepAlive = !force && (!pending || pending.next > now) && !receiptDue && !this.reactionsPress && !reseal && !(withdrawal && withdrawal.next <= now);
14225
14463
  if (keepAlive && (this.controlDue > now || this.state.inviteTaken)) return;
14226
14464
  const expires = pending?.expires ?? now - 12e4 + CONTROL_TTL;
14227
14465
  const issued = Math.min(now, Math.max(now - DHT_ISSUED_BACK_MS, expires - (pending ? DHT_MESSAGE_TTL : CONTROL_TTL), (pending?.message[1] ?? 0) - 3e4));
@@ -14236,10 +14474,16 @@ var DhtDelivery = class DhtDelivery {
14236
14474
  }, void 0, void 0);
14237
14475
  throw held;
14238
14476
  }
14477
+ if (withdrawal) this.withdrawal = {
14478
+ ...withdrawal,
14479
+ attempts: withdrawal.attempts + 1,
14480
+ next: now + backoff(withdrawal.attempts)
14481
+ };
14239
14482
  const fittedEnvelope = this.fitted(this.sequence + 1, issued, expires, pending?.message ?? null, receipt?.id ?? null, pending?.reply, pending?.edit, pending?.forwarded, pending?.file);
14240
14483
  const { body, reactions } = fittedEnvelope;
14241
14484
  const reactionsWereDue = this.reactionsDue;
14242
14485
  this.reactionsDue = !reactions && !!this.options.reactions?.().length;
14486
+ this.crowdedBy = this.reactionsDue && pending ? pending.message[0] : void 0;
14243
14487
  const sequence = body[1];
14244
14488
  await this.persist({
14245
14489
  ...this.state,
@@ -14275,9 +14519,13 @@ var DhtDelivery = class DhtDelivery {
14275
14519
  await this.options.transport.publish(identity, records, options);
14276
14520
  } catch (error) {
14277
14521
  this.reactionsDue ||= reactionsWereDue;
14278
- if (isDiscoveryBudgetError(error)) await this.heldBack(error, now, before, pending, receipt);
14522
+ if (isDiscoveryBudgetError(error)) {
14523
+ if (withdrawal) this.withdrawal = withdrawal;
14524
+ await this.heldBack(error, now, before, pending, receipt);
14525
+ }
14279
14526
  throw error;
14280
14527
  }
14528
+ this.withdrawal = void 0;
14281
14529
  this.namedRev = body[8] ?? void 0;
14282
14530
  if (options?.signal) this.leavingOut = false;
14283
14531
  if (identity === this.identity) this.unsealedOut = !this.options.credentials.peerKey;
@@ -14289,6 +14537,14 @@ var DhtDelivery = class DhtDelivery {
14289
14537
  return this.unsealedOut && !!this.options.credentials.peerKey;
14290
14538
  }
14291
14539
  /**
14540
+ * Reactions due (`reactionsDue`) that force an envelope of their own: not while the text that left them no room
14541
+ * (`crowdedBy`) is still retried, or each publication spends one of its attempts 4 s apart instead of at its backoff.
14542
+ */
14543
+ get reactionsPress() {
14544
+ const pending = this.state.pending, now = Date.now();
14545
+ return this.reactionsDue && !(pending && pending.message[0] === this.crowdedBy && pending.expires > now && pending.attempts < MAX_ATTEMPTS);
14546
+ }
14547
+ /**
14292
14548
  * The relays' request budget held the envelope back: nothing went out, so it was no attempt (a text keeps its eight),
14293
14549
  * and what it carried (a text, a receipt, a new mode) goes the moment the budget frees a request: the text and the
14294
14550
  * receipt as they were before, and no publication before then (`budgetUntil`) but a forced one.
@@ -14526,7 +14782,10 @@ var DhtDelivery = class DhtDelivery {
14526
14782
  const theirs = this.options.reaction ? readDhtReactions(reactions) : [];
14527
14783
  for (const reaction of theirs) await this.options.reaction?.(reaction);
14528
14784
  const newest = theirs.reduce((max, r) => Math.max(max, r.n), 0);
14529
- if (theirs.length) this.reactionsDue = true;
14785
+ if (theirs.length) {
14786
+ this.reactionsDue = true;
14787
+ this.crowdedBy = void 0;
14788
+ }
14530
14789
  const confirmed = receipt && this.state.pending?.message[0] === receipt ? receipt : this.state.confirmed;
14531
14790
  if (mode !== this.state.peerMode) traceLink(this.from, "dht-peer-mode", { peerMode: mode });
14532
14791
  if (peerPinned !== this.state.peerPinned) traceLink(this.from, "dht-peer-pinned", { peerPinned });
@@ -14746,9 +15005,13 @@ var DhtDelivery = class DhtDelivery {
14746
15005
  if (!this.running || this.ticking) return;
14747
15006
  if (this.timer) clearTimeout(this.timer);
14748
15007
  const held = this.budgetUntil - this.clock();
14749
- const due = this.reactionsDue || this.resealDue && !this.errors.publish ? Math.max(0, this.lastPublish + 4e3 - Date.now(), held) : Infinity;
15008
+ const due = this.reactionsPress || this.resealDue && !this.errors.publish ? Math.max(0, this.lastPublish + 4e3 - Date.now(), held) : Infinity;
15009
+ const withdrawal = this.withdrawal, now = Date.now();
15010
+ const retry = withdrawal && withdrawal.until > now && withdrawal.attempts < MAX_ATTEMPTS ? Math.max(0, withdrawal.next - now, this.lastPublish + 4e3 - now, held) : Infinity;
15011
+ const pending = this.state.pending;
15012
+ const waiting = pending && pending.attempts === 0 && pending.expires > now ? Math.max(0, this.lastPublish + 4e3 - now, held) : Infinity;
14750
15013
  const readHeld = this.readHeldUntil > 0 ? Math.max(1e3, this.readHeldUntil - Date.now()) : Infinity;
14751
- this.timer = setTimeout(() => void this.tick(), Math.min(held > 0 ? Math.min(this.pollMs, held) : this.pollMs, due, readHeld));
15014
+ this.timer = setTimeout(() => void this.tick(), Math.min(held > 0 ? Math.min(this.pollMs, held) : this.pollMs, due, retry, waiting, readHeld));
14752
15015
  }
14753
15016
  };
14754
15017
  var DHT_TEXT_REFUSED = "Your contact's app does not accept text over the DHT. It is sent when you are live.";
@@ -19261,6 +19524,11 @@ var ChatFiles = class {
19261
19524
  /** Files that stopped sending for the chat's window alone: they go on once another's bytes are confirmed. */
19262
19525
  held = /* @__PURE__ */ new Set();
19263
19526
  /**
19527
+ * The entries not ended (`track`): what is still to come or under way is read from these, not from every file the
19528
+ * chat ever had, which it keeps for good. An offer read all of them, in every chat, at 100,000 files about 10 ms each.
19529
+ */
19530
+ unended = /* @__PURE__ */ new Set();
19531
+ /**
19264
19532
  * Files this side cancelled while no session carried the cancel (`pf-abort`), said on the next one. The session also
19265
19533
  * goes for a moment when a move swaps it (its capabilities are agreed again): unsaid, the receiver showed the file
19266
19534
  * moving, its bytes kept, until its idle nudge asked 30 s later.
@@ -19312,7 +19580,10 @@ var ChatFiles = class {
19312
19580
  checkpointed: record.confirmed,
19313
19581
  writing: Promise.resolve()
19314
19582
  };
19583
+ const replaced = this.entries.get(key(record.direction, record.id));
19584
+ if (replaced) this.unended.delete(replaced);
19315
19585
  this.entries.set(key(record.direction, record.id), entry);
19586
+ this.track(entry);
19316
19587
  }
19317
19588
  }
19318
19589
  get live() {
@@ -19325,6 +19596,23 @@ var ChatFiles = class {
19325
19596
  records() {
19326
19597
  return [...this.entries.values()].map((e) => ({ ...e.record }));
19327
19598
  }
19599
+ /** Bytes still to come of the files taken here, not ended (one still asked about is not taken yet). */
19600
+ stillToCome() {
19601
+ let due = 0;
19602
+ for (const { record } of this.unended) if (record.direction === "in" && record.state !== "asking" && !transferEnded(record)) due += Math.max(0, record.file.size - record.confirmed);
19603
+ return due;
19604
+ }
19605
+ /** A transfer under way: offered, moving, or being checked. */
19606
+ underWay() {
19607
+ for (const { record } of this.unended) if (record.state === "offered" || record.state === "active" || record.state === "verifying") return true;
19608
+ return false;
19609
+ }
19610
+ /** Bytes of the files received here that were taken without asking and are kept (or on their way). */
19611
+ takenUnasked() {
19612
+ let taken = 0;
19613
+ for (const { record } of this.entries.values()) if (record.direction === "in" && !record.consented && record.state !== "asking" && record.state !== "failed" && record.state !== "declined" && record.state !== "cancelled") taken += record.file.size;
19614
+ return taken;
19615
+ }
19328
19616
  get(direction, id) {
19329
19617
  const record = this.entries.get(key(direction, id))?.record;
19330
19618
  return record && { ...record };
@@ -19342,8 +19630,17 @@ var ChatFiles = class {
19342
19630
  return entry.in && !transferEnded(entry.record) ? Math.max(entry.in.stored, entry.record.confirmed) : entry.record.confirmed;
19343
19631
  }
19344
19632
  changed(entry, progress = false) {
19633
+ this.track(entry);
19345
19634
  this.host.changed({ ...entry.record }, this.moved(entry), progress);
19346
19635
  }
19636
+ /**
19637
+ * Keeps `unended` to the entries of this chat not ended. Each change of a record's state is reported (`changed`),
19638
+ * so that is where a file that ended leaves it, and one taken or sent again comes back.
19639
+ */
19640
+ track(entry) {
19641
+ if (!transferEnded(entry.record) && this.entries.get(key(entry.record.direction, entry.record.id)) === entry) this.unended.add(entry);
19642
+ else this.unended.delete(entry);
19643
+ }
19347
19644
  send(frame) {
19348
19645
  return this.attached && this.host.send(frame);
19349
19646
  }
@@ -20329,6 +20626,7 @@ var ChatFiles = class {
20329
20626
  const entry = this.entries.get(key("in", id));
20330
20627
  if (!entry || transferEnded(entry.record)) return;
20331
20628
  this.entries.delete(key("in", id));
20629
+ this.unended.delete(entry);
20332
20630
  const incoming = entry.in;
20333
20631
  entry.record.state = "failed";
20334
20632
  clearTimeout(incoming.timer);
@@ -20465,6 +20763,7 @@ var ChatFiles = class {
20465
20763
  if (!entry) return;
20466
20764
  if (!transferEnded(entry.record)) this.cancel(direction, id);
20467
20765
  this.entries.delete(key(direction, id));
20766
+ this.unended.delete(entry);
20468
20767
  }
20469
20768
  };
20470
20769
  // ../core/src/pairedCalls.ts
@@ -22055,8 +22354,6 @@ var QUIET_FRAMES = /* @__PURE__ */ new Set([
22055
22354
  "paired-payments",
22056
22355
  "paired-groups",
22057
22356
  "paired-services",
22058
- "paired-reconnect",
22059
- "paired-reconnect-ack",
22060
22357
  CONTACT_ASKER_FRAME
22061
22358
  ]);
22062
22359
  /**
@@ -22268,8 +22565,6 @@ var GhostLink = class {
22268
22565
  nativeFailures = /* @__PURE__ */ new Map();
22269
22566
  demotedUntil = /* @__PURE__ */ new Map();
22270
22567
  connectionEpoch = 0;
22271
- switchAllowedUntil = 0;
22272
- switchAck = null;
22273
22568
  switcher;
22274
22569
  /** `plan`: a switch both sides agreed; without one, a replacement the contact dialled (`attachReplacement`). */
22275
22570
  candidate = null;
@@ -23909,10 +24204,6 @@ var GhostLink = class {
23909
24204
  this.attachCandidate(channel, binding, plan).catch(() => {});
23910
24205
  return;
23911
24206
  }
23912
- if (this.channel && Date.now() < this.switchAllowedUntil) {
23913
- this.switchAllowedUntil = 0;
23914
- this.disconnect();
23915
- }
23916
24207
  if (this.stopped || this.leaving || this.yielding || !this.transportOffer().includes(binding.transport)) {
23917
24208
  channel.close();
23918
24209
  return;
@@ -26865,15 +27156,6 @@ var GhostLink = class {
26865
27156
  });
26866
27157
  return;
26867
27158
  }
26868
- if (frame?.t === "paired-reconnect") {
26869
- this.switchAllowedUntil = Date.now() + 3e4;
26870
- channel.send(JSON.stringify({ t: "paired-reconnect-ack" }));
26871
- return;
26872
- }
26873
- if (frame?.t === "paired-reconnect-ack") {
26874
- this.switchAck?.();
26875
- return;
26876
- }
26877
27159
  if (frame?.t === "paired-adapters") {
26878
27160
  if (!frame.descriptors || typeof frame.descriptors !== "object" || JSON.stringify(frame.descriptors).length > 4096) return;
26879
27161
  const descriptors = checkedDescriptors(frame.descriptors);
@@ -29046,7 +29328,12 @@ async function videoMetadataPatches(file, mime, audio = false) {
29046
29328
  * (its `info` strings, a marker's names in `strg`, `edct` comments, `uuid` chunks).
29047
29329
  * - WavPack: its APEv2 and ID3v1 tags at the end as an MP3's, and the source file's header and trailer each block may
29048
29330
  * keep for a lossless restore (a WAV's INFO list, an AIFF's NAME) made a sub-block that says nothing, zeroed.
29049
- * - TTA: its tags at the end (and an ID3v2 before it) as an MP3's.
29331
+ * - TTA, Monkey's Audio, Musepack (SV7 and SV8) and OptimFROG: their tags at the end (and an ID3v2 before them) as an MP3's.
29332
+ * - DSF: the ID3v2 tag its header points at emptied as an MP3's; any other byte after its sound, zeros.
29333
+ * - DSDIFF: every chunk but its sound's (`FVER`, `PROP`, `DSD `, `DST `, `DSTI`) becomes `JUNK`, zeroed (COMT, DIIN
29334
+ * with its artist and title, MANF, an `ID3 ` chunk), and any byte after its form.
29335
+ * - MIDI: the text of its meta events (a copyright, a track's name, lyrics, markers) and a sequencer's own data become
29336
+ * zeros, their lengths kept; its notes and SysEx as they are.
29050
29337
  * - Sun AU: its annotation, zeros.
29051
29338
  * - WebM and Matroska, audio or video: `Tags`, `Attachments`, `Chapters`, the title, the date, the file names and each
29052
29339
  * track's name become `Void` elements (and the SeekHead's entries for them); the muxer's and the writing app's names
@@ -29540,6 +29827,160 @@ async function wavpack(read, size, at, patches) {
29540
29827
  }
29541
29828
  return at;
29542
29829
  }
29830
+ /** A 64-bit size at `at` of `b`, little- or big-endian: one past what a file can hold is refused. */
29831
+ function u64$1(b, at, little) {
29832
+ const n = little ? u32le(b, at) + u32le(b, at + 4) * 2 ** 32 : u32be(b, at) * 2 ** 32 + u32be(b, at + 4);
29833
+ check(Number.isSafeInteger(n));
29834
+ return n;
29835
+ }
29836
+ /**
29837
+ * A DSF: its `DSD `, `fmt ` and `data` chunks kept, the ID3v2 tag its header's metadata pointer names emptied where it
29838
+ * is, and any byte after its data that is not that tag zeroed.
29839
+ */
29840
+ async function dsf(read, size, patches) {
29841
+ const head = await read(0, 28);
29842
+ check(u64$1(head, 4, true) === 28);
29843
+ const fmt = await read(28, 12);
29844
+ check(text(fmt, 0, 4) === "fmt ");
29845
+ const dataAt = 28 + u64$1(fmt, 4, true);
29846
+ const data = await read(dataAt, 12);
29847
+ check(text(data, 0, 4) === "data");
29848
+ let end = dataAt + u64$1(data, 4, true);
29849
+ check(end <= size);
29850
+ const pointer = u64$1(head, 20, true);
29851
+ if (pointer) {
29852
+ check(pointer >= end);
29853
+ const tag = await read(pointer, 10);
29854
+ check(isId3(tag));
29855
+ if (pointer > end) patches.push({
29856
+ start: end,
29857
+ end: pointer
29858
+ });
29859
+ end = await emptyId3(read, size, pointer, tag, patches);
29860
+ }
29861
+ if (end < size) patches.push({
29862
+ start: end,
29863
+ end: size
29864
+ });
29865
+ }
29866
+ /** The chunks a DSDIFF's sound is made of, kept; any other (COMT, DIIN with its artist and title, MANF, an `ID3 `) becomes `JUNK`, zeroed. */
29867
+ var DSDIFF_KEEPS = /* @__PURE__ */ new Set([
29868
+ "FVER",
29869
+ "PROP",
29870
+ "DSD ",
29871
+ "DST ",
29872
+ "DSTI"
29873
+ ]);
29874
+ /** A DSDIFF's chunks within its `FRM8`: big-endian 64-bit sizes, each padded to an even length; any byte after the form zeroed. */
29875
+ async function dsdiff(read, size, patches) {
29876
+ const formEnd = 12 + u64$1(await read(4, 8), 0, false);
29877
+ check(formEnd >= 16 && formEnd <= size);
29878
+ const count = counter();
29879
+ for (let at = 16; at < formEnd;) {
29880
+ count();
29881
+ const head = await read(at, 12);
29882
+ const id = text(head, 0, 4), length = u64$1(head, 4, false), end = at + 12 + length;
29883
+ check(end <= formEnd);
29884
+ if (!DSDIFF_KEEPS.has(id)) {
29885
+ patches.push({
29886
+ start: at,
29887
+ end: at + 4,
29888
+ bytes: latin("JUNK")
29889
+ });
29890
+ if (length) patches.push({
29891
+ start: at + 12,
29892
+ end
29893
+ });
29894
+ }
29895
+ at = Math.min(end + length % 2, formEnd);
29896
+ }
29897
+ if (formEnd < size) patches.push({
29898
+ start: formEnd,
29899
+ end: size
29900
+ });
29901
+ }
29902
+ /** The meta events whose data is text (a text, a copyright, a track's or an instrument's name, a lyric, a marker, a cue point, a program's or a device's name) or a sequencer's own. */
29903
+ var MIDI_TEXT = /* @__PURE__ */ new Set([
29904
+ 1,
29905
+ 2,
29906
+ 3,
29907
+ 4,
29908
+ 5,
29909
+ 6,
29910
+ 7,
29911
+ 8,
29912
+ 9,
29913
+ 127
29914
+ ]);
29915
+ /**
29916
+ * A Standard MIDI File's chunks: each track's events walked, the data of its text meta events zeroed (their lengths
29917
+ * kept, so every delta time and event stays where it was), any byte after its end of track zeroed; a chunk that is
29918
+ * neither a header nor a track zeroed.
29919
+ */
29920
+ async function midi(read, size, patches) {
29921
+ const count = counter();
29922
+ let at = 0;
29923
+ for (; at + 8 <= size;) {
29924
+ count();
29925
+ const head = await read(at, 8);
29926
+ const id = text(head, 0, 4), start = at + 8, end = start + u32be(head, 4);
29927
+ check(end <= size);
29928
+ if (id === "MTrk") {
29929
+ const b = await read(start, end - start);
29930
+ let i = 0, running = 0;
29931
+ const varlen = () => {
29932
+ let value = 0;
29933
+ for (let n = 0;; n++) {
29934
+ check(i < b.length && n < 4);
29935
+ const byte = b[i++];
29936
+ value = value * 128 + (byte & 127);
29937
+ if (!(byte & 128)) return value;
29938
+ }
29939
+ };
29940
+ while (i < b.length) {
29941
+ count();
29942
+ varlen();
29943
+ check(i < b.length);
29944
+ const status = b[i];
29945
+ if (status === 255 || status === 240 || status === 247) {
29946
+ const type = status === 255 ? b[++i] : void 0;
29947
+ i++;
29948
+ const length = varlen();
29949
+ check(i + length <= b.length);
29950
+ if (type !== void 0 && MIDI_TEXT.has(type) && length) patches.push({
29951
+ start: start + i,
29952
+ end: start + i + length
29953
+ });
29954
+ i += length;
29955
+ running = 0;
29956
+ if (type === 47) {
29957
+ if (i < b.length) patches.push({
29958
+ start: start + i,
29959
+ end
29960
+ });
29961
+ break;
29962
+ }
29963
+ } else {
29964
+ if (status & 128) {
29965
+ running = status;
29966
+ i++;
29967
+ }
29968
+ check(running >= 128 && running < 240);
29969
+ i += (running & 224) === 192 ? 1 : 2;
29970
+ check(i <= b.length);
29971
+ }
29972
+ }
29973
+ } else if (id !== "MThd" && end > start) patches.push({
29974
+ start,
29975
+ end
29976
+ });
29977
+ at = end;
29978
+ }
29979
+ if (at < size) patches.push({
29980
+ start: at,
29981
+ end: size
29982
+ });
29983
+ }
29543
29984
  /** A Sun AU's annotation: from its 24-byte header to its sound. */
29544
29985
  async function au(read, size, patches) {
29545
29986
  const offset = u32be(await read(4, 4), 0);
@@ -29807,7 +30248,14 @@ async function audioMetadataPatches(file, mime) {
29807
30248
  else if (head.length >= 8 && text(head, 0, 4) === "caff") await caf(read, size, patches);
29808
30249
  else if (head.length >= 24 && text(head, 0, 4) === ".snd") await au(read, size, patches);
29809
30250
  else if (text(head, 0, 4) === "wvpk") await trailingTags(read, size, await wavpack(read, size, 0, patches), patches);
29810
- else if (text(head, 0, 4) === "TTA1") await trailingTags(read, size, 0, patches);
30251
+ else if (text(head, 0, 4) === "TTA1" || [
30252
+ "MAC ",
30253
+ "MPCK",
30254
+ "OFR "
30255
+ ].includes(text(head, 0, 4)) || text(head, 0, 3) === "MP+") await trailingTags(read, size, 0, patches);
30256
+ else if (text(head, 0, 4) === "DSD ") await dsf(read, size, patches);
30257
+ else if (head.length >= 16 && text(head, 0, 4) === "FRM8" && text(head, 12, 4) === "DSD ") await dsdiff(read, size, patches);
30258
+ else if (head.length >= 14 && text(head, 0, 4) === "MThd") await midi(read, size, patches);
29811
30259
  else if (isAsf(head)) check(false);
29812
30260
  else if (text(head, 0, 4) === "fLaC") await trailingTags(read, size, await flac(read, size, 0, patches), patches);
29813
30261
  else if (isId3(head) || isFrame(head, 0)) {
@@ -33971,6 +34419,11 @@ var ANSWER_WINDOW_MS$1 = 5e3;
33971
34419
  */
33972
34420
  var UNNAMED_KEPT_MS = 6e4;
33973
34421
  /**
34422
+ * After the admin role moved to me: how long I still take the statement of the admin I took it from (WISP 902
34423
+ * § Metadata), one that was on its way while the commit reached me first. Past it, only the admin's is taken, as for anyone.
34424
+ */
34425
+ var GROUP_TAKEOVER_META_MS = 6e5;
34426
+ /**
33974
34427
  * One member's messages (or edits) taken: its whole log handed back at once twice over (`AUTHOR_BURST`: an edge opening
33975
34428
  * hears it, with what the member says live beside it, and the edits its app says again), then
33976
34429
  * `GROUP_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`, as a community's `MessagePace`.
@@ -34420,6 +34873,13 @@ var GroupSession = class {
34420
34873
  queue = Promise.resolve();
34421
34874
  /** Metadata frames that name a commit or an epoch I do not have yet, one signed by the admin and one by anyone else (`waitMeta`): tried again when the chain moves. */
34422
34875
  pendingMeta = {};
34876
+ /** The admin as of the last `metaFollowsChain`. In memory only. */
34877
+ adminSeen;
34878
+ /**
34879
+ * After the admin role moved to me (`metaFollowsChain`): whom from, until when I take their statement, and the last
34880
+ * one of theirs I signed again (what I held then, until one of theirs comes). In memory only.
34881
+ */
34882
+ takeover;
34423
34883
  /** While `handle` runs: the frames it took that a hub passes on (`handle`'s result). */
34424
34884
  passOn = null;
34425
34885
  /** The frames kept to hand on that the app holds with its messages, oldest first; undefined when the state holds them all. */
@@ -34497,6 +34957,7 @@ var GroupSession = class {
34497
34957
  this.provisional = new Set((state.provisional ?? []).slice(-GROUP_LIMITS.provisional));
34498
34958
  for (const [key, record] of Object.entries(state.names ?? {})) this.nickAt.set(key, record.v);
34499
34959
  this.chainMovedAt = this.clock();
34960
+ this.adminSeen = this.admin;
34500
34961
  }
34501
34962
  clock() {
34502
34963
  return this.hooks.clock?.() ?? Date.now();
@@ -34914,6 +35375,7 @@ var GroupSession = class {
34914
35375
  this.requireAdmin();
34915
35376
  if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey) throw new Error("Not a member");
34916
35377
  await this.commit("remove", memberKey, now, left);
35378
+ if (!left && memberKey === this.takeover?.from) this.takeover = void 0;
34917
35379
  });
34918
35380
  }
34919
35381
  transferAdmin(memberKey, now = Date.now()) {
@@ -36508,8 +36970,10 @@ var GroupSession = class {
36508
36970
  /**
36509
36971
  * Signs a body under my current commit, keeps it and sends it to every member. Inside `serialize`. Like a commit, only
36510
36972
  * with admin work on and a good turn read (WISP 06 § Forced takeover): refused otherwise, or, `quiet`, not made.
36973
+ * `taken`: a former admin's statement signed again (`signAgainTaken`): the line credits them, and the one held is not
36974
+ * kept to hand on when it was no change (an older statement signed again).
36511
36975
  */
36512
- async publishMeta(body, now, quiet = false) {
36976
+ async publishMeta(body, now, quiet = false, taken) {
36513
36977
  const refused = this.hooks.adminWork?.() === false ? new Error(GROUP_ADMIN_OFF_ERROR) : this.hooks.adminTurn && !await this.hooks.adminTurn() ? engineError("groupTurnUnconfirmed") : void 0;
36514
36978
  if (refused) {
36515
36979
  if (quiet) return;
@@ -36524,7 +36988,7 @@ var GroupSession = class {
36524
36988
  ts: now
36525
36989
  }, body, this.identity.seed, this.myKey);
36526
36990
  this.state.meta = meta;
36527
- this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
36991
+ if (!taken?.replaces) this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
36528
36992
  await this.persist();
36529
36993
  const secret = this.secret(this.epoch);
36530
36994
  if (secret) {
@@ -36532,7 +36996,7 @@ var GroupSession = class {
36532
36996
  for (const key of this.others) this.hooks.send(key, frame);
36533
36997
  }
36534
36998
  const change = groupMetaChange(before, meta, this.state.name);
36535
- if (change) this.hooks.metaChanged?.(this.myKey, change, meta.ts);
36999
+ if (change) this.hooks.metaChanged?.(taken?.by ?? this.myKey, change, meta.ts);
36536
37000
  this.hooks.changed();
36537
37001
  }
36538
37002
  /** My statement, to a member whose sync says it holds an older one (or none); nothing to an app that says nothing. */
@@ -36552,19 +37016,20 @@ var GroupSession = class {
36552
37016
  /**
36553
37017
  * A metadata statement: kept when it is newer than mine, its commit is on my chain, its signer was
36554
37018
  * the admin of that commit and is the admin now, its signature holds, and it opens under the epoch
36555
- * it names into metadata Ghostly shows. One naming what I do not have yet waits for the chain.
37019
+ * it names into metadata Ghostly shows. One naming what I do not have yet waits for the chain. Just after the admin
37020
+ * role moved to me, the former admin's is signed again as mine (`takesOver`).
36556
37021
  */
36557
37022
  async receiveMeta(from, raw) {
36558
37023
  const frame = parseGroupMetaFrame(raw);
36559
37024
  if (!frame || frame.statement.g !== this.id || typeof frame.k !== "number" || !rosterHas(this.roster, from)) return;
36560
- const s = frame.statement;
36561
- if (!groupMetaNewer(s, this.state.meta)) return;
37025
+ const s = frame.statement, taking = this.takesOver(s);
37026
+ if (!taking && !groupMetaNewer(s, this.state.meta)) return;
36562
37027
  if (s.e > this.epoch || frame.k > this.epoch) {
36563
37028
  this.waitMeta(from, raw, s);
36564
37029
  return;
36565
37030
  }
36566
37031
  const commit = this.state.chain[s.e];
36567
- if (commitHash(commit) !== s.h || rosterAdmin(commit.m) !== s.by || this.admin !== s.by || !verifyGroupMetaSignature(s)) return;
37032
+ if (commitHash(commit) !== s.h || rosterAdmin(commit.m) !== s.by || !taking && this.admin !== s.by || !verifyGroupMetaSignature(s)) return;
36568
37033
  const secret = this.secret(frame.k);
36569
37034
  if (!secret) {
36570
37035
  this.waitMeta(from, raw, s);
@@ -36572,6 +37037,10 @@ var GroupSession = class {
36572
37037
  }
36573
37038
  const opened = openGroupMeta(frame, epochKeys(secret, this.id, frame.k).message);
36574
37039
  if (!opened) return;
37040
+ if (taking) {
37041
+ await this.signAgainTaken(opened.meta, opened.body);
37042
+ return;
37043
+ }
36575
37044
  const before = this.state.meta;
36576
37045
  this.state.meta = opened.meta;
36577
37046
  this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, opened.meta);
@@ -36588,6 +37057,37 @@ var GroupSession = class {
36588
37057
  });
36589
37058
  }
36590
37059
  /**
37060
+ * Whether I take a statement though its signer is no longer the admin (WISP 902 § Metadata): I am the admin since
37061
+ * moments ago, they were the admin before me, and it is later than the one of theirs I signed again. A member who had
37062
+ * not synced when the role moved to them signed again what they held (or nothing), and the statement on its way would
37063
+ * be refused for good: their next rename, picture or hubs change would then be built on the older body.
37064
+ */
37065
+ takesOver(s) {
37066
+ const t = this.takeover;
37067
+ return !!t && this.isAdmin && s.by === t.from && this.clock() <= t.until && groupMetaNewer(s, t.base);
37068
+ }
37069
+ /**
37070
+ * The former admin's statement, taken (`takesOver`): signed again as mine, each field I changed since keeping my
37071
+ * value. Dated as theirs, and credited to them, when I changed nothing; what I held was then no change to hand on.
37072
+ */
37073
+ async signAgainTaken(meta, theirs) {
37074
+ const t = this.takeover, base = groupMetaBody(t.base), mine = groupMetaBody(this.state.meta);
37075
+ t.base = meta;
37076
+ const pick = (k) => JSON.stringify(mine[k]) === JSON.stringify(base[k]) ? theirs[k] : mine[k];
37077
+ const body = encodeGroupMetaBody({
37078
+ name: pick("name"),
37079
+ pic: pick("pic"),
37080
+ hubs: pick("hubs"),
37081
+ call: pick("call")
37082
+ });
37083
+ if (body === this.state.meta?.body) return;
37084
+ const changed = encodeGroupMetaBody(mine) !== encodeGroupMetaBody(base);
37085
+ await this.publishMeta(body, changed ? this.clock() : meta.ts, true, {
37086
+ by: meta.by,
37087
+ replaces: !changed
37088
+ });
37089
+ }
37090
+ /**
36591
37091
  * A statement that waits for the chain: only one its signer signed, so an altered copy cannot push out the one
36592
37092
  * waiting. The admin I know has a place of their own, which another member's statement cannot take, and in each
36593
37093
  * place only a later statement takes the one waiting.
@@ -36619,6 +37119,15 @@ var GroupSession = class {
36619
37119
  }
36620
37120
  /** After the chain or my secrets moved: the waiting statement, and, if I became the admin, the name and picture signed again as mine. */
36621
37121
  async metaFollowsChain() {
37122
+ if (this.admin !== this.adminSeen) {
37123
+ const from = this.adminSeen;
37124
+ this.takeover = this.isAdmin && from && from !== this.myKey ? {
37125
+ from,
37126
+ until: this.clock() + GROUP_TAKEOVER_META_MS,
37127
+ base: this.state.meta
37128
+ } : void 0;
37129
+ this.adminSeen = this.admin;
37130
+ }
36622
37131
  const { admin, other } = this.pendingMeta;
36623
37132
  this.pendingMeta = {};
36624
37133
  for (const pending of [admin, other]) if (pending) await this.receiveMeta(pending.from, pending.frame);
@@ -36903,6 +37412,8 @@ var COMMUNITY_LIMITS = {
36903
37412
  chainPiece: 100,
36904
37413
  /** Admissions members other than the admin may commit in a row while the admin is away (`memberAdmissions`). */
36905
37414
  memberAdmissions: 32,
37415
+ /** Commits back in which a leave of a key a member let in counts against `memberAdmissions`, the admin there or not. */
37416
+ memberLeaves: 256,
36906
37417
  pendingLeaves: 64,
36907
37418
  /** Leaves whose mark (`group-left`) is kept, and the epochs one names. */
36908
37419
  leftMarks: 64,
@@ -36941,6 +37452,11 @@ var COMMUNITY_LIMITS = {
36941
37452
  * frame of the answer keeps it open, since it goes a slice at a time. As a private group's.
36942
37453
  */
36943
37454
  var ANSWER_WINDOW_MS = 5e3;
37455
+ /**
37456
+ * After the admin role moved to me: how long I still take the statement of the admin I took it from (WISP 903
37457
+ * § Metadata), one that was on its way while the commit reached me first. Past it, condition 4 holds as for anyone.
37458
+ */
37459
+ var COMMUNITY_TAKEOVER_META_MS = 6e5;
36944
37460
  /** What every member should know about who can read what, and what the link does, in the words the apps show. */
36945
37461
  var GROUP_READ_NOTE_COMMUNITY = `Anyone with the group's link can join, and any member can let people in. Everyone in the group can read everything sent while they are a member; someone removed cannot read what comes after, someone who joins later cannot read what came before. Members who were away get the last ${COMMUNITY_LIMITS.store} messages from whoever is there when they return.`;
36946
37462
  /** A community group's link: `group2/<group id>/<entry key>` (web: `#/join/group2/…`). */
@@ -37013,12 +37529,21 @@ var ADMIN_ONLY = /* @__PURE__ */ new Set([
37013
37529
  * the admin clears keys let in would otherwise make room for as many more each time. An admission is a member's
37014
37530
  * right, and costs nothing: a key nobody holds is as good as anyone's, so without a bound one member could fill the
37015
37531
  * group to its cap in seconds. `COMMUNITY_LIMITS.memberAdmissions` in a row, then the admin's turn.
37532
+ * A leave among the last `COMMUNITY_LIMITS.memberLeaves` commits that ends an admission a member other than the admin
37533
+ * signed counts as one more, whether or not the admin was there since: the key leaves the roster as it was, and a
37534
+ * member that lets in keys it made up and commits their own leaves would otherwise fill the history with two commits
37535
+ * for each one the admin lets in at the door.
37016
37536
  */
37017
37537
  function memberAdmissions(admin, before) {
37018
- let n = 0;
37538
+ let n = 0, run = true, seen = 0;
37539
+ const leavers = /* @__PURE__ */ new Set();
37019
37540
  for (const c of before) {
37020
- if (c.k === "create" || c.k === "role" || c.by === admin && c.k !== "remove" && c.k !== "leave") break;
37021
- if (c.k === "add") n++;
37541
+ if (run && (c.k === "create" || c.k === "role" || c.by === admin && c.k !== "remove" && c.k !== "leave")) run = false;
37542
+ if (run && c.k === "add") n++;
37543
+ const recent = ++seen <= COMMUNITY_LIMITS.memberLeaves;
37544
+ if (c.k === "add" && c.s && leavers.delete(c.s) && c.by !== admin) n++;
37545
+ if (recent && c.k === "leave" && c.s) leavers.add(c.s);
37546
+ if (!run && !recent && !leavers.size) break;
37022
37547
  }
37023
37548
  return n;
37024
37549
  }
@@ -37490,6 +38015,13 @@ var CommunitySession = class CommunitySession {
37490
38015
  saveTimer;
37491
38016
  /** Metadata frames naming a commit or a secret I do not have yet, one signed by the admin and one by anyone else (`waitMeta`): tried again when the chain or my secrets move. */
37492
38017
  pendingMeta = {};
38018
+ /** The admin as of the last `metaFollowsChain`. In memory only. */
38019
+ adminSeen;
38020
+ /**
38021
+ * After the admin role moved to me (`metaFollowsChain`): whom from, until when I take their statement, and the last
38022
+ * one of theirs I signed again (what I held then, until one of theirs comes). In memory only.
38023
+ */
38024
+ takeover;
37493
38025
  /** The store's frames the app holds with their messages (`storeKey` → message id): in memory here, not in what is saved. */
37494
38026
  onRows = /* @__PURE__ */ new Map();
37495
38027
  /** The oldest epoch whose seen marks are kept, as of the last `pruneSeen`. In memory only. */
@@ -37513,6 +38045,7 @@ var CommunitySession = class CommunitySession {
37513
38045
  });
37514
38046
  this.rebuild();
37515
38047
  this.pruneSeen();
38048
+ this.adminSeen = this.admin;
37516
38049
  if ((state.status === "active" || state.status === "lost") && this.bestBranch().tip !== this.topHash) this.serialize(() => this.chooseBranch());
37517
38050
  }
37518
38051
  static create(name, now = Date.now()) {
@@ -38657,6 +39190,7 @@ var CommunitySession = class CommunitySession {
38657
39190
  return true;
38658
39191
  }
38659
39192
  await this.commit("remove", { s: next }, now);
39193
+ if (next === this.takeover?.from) this.takeover = void 0;
38660
39194
  return false;
38661
39195
  })) return;
38662
39196
  }
@@ -40025,8 +40559,10 @@ var CommunitySession = class CommunitySession {
40025
40559
  * Signs a body under my current commit, keeps it and sends it to everyone (hubs relay it). Inside `serialize`. Like a
40026
40560
  * commit, only with admin work on and a good turn read (WISP 06 § Forced takeover): refused otherwise, or, `quiet`,
40027
40561
  * not made. Its revision is never under the floor (WISP 06 § Raised counters).
40562
+ * `taken`: a former admin's statement signed again (`signAgainTaken`): the line credits them, and the one held is not
40563
+ * kept to hand on when it was no change (an older statement signed again).
40028
40564
  */
40029
- async publishMeta(body, now, quiet = false) {
40565
+ async publishMeta(body, now, quiet = false, taken) {
40030
40566
  const refused = !this.adminWork ? new Error(GROUP_ADMIN_OFF_ERROR) : this.hooks.adminTurn && !await this.hooks.adminTurn() ? engineError("groupTurnUnconfirmed") : void 0;
40031
40567
  if (refused) {
40032
40568
  if (quiet) return;
@@ -40041,12 +40577,12 @@ var CommunitySession = class CommunitySession {
40041
40577
  ts: now
40042
40578
  }, body, this.identity.seed, this.myKey);
40043
40579
  this.state.meta = meta;
40044
- this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
40580
+ if (!taken?.replaces) this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
40045
40581
  await this.persist();
40046
40582
  const frame = this.metaFrame(meta);
40047
40583
  if (frame) this.hooks.broadcast(frame);
40048
40584
  const change = groupMetaChange(before, meta, this.state.name);
40049
- if (change) this.hooks.metaChanged?.(this.myKey, change, meta.ts);
40585
+ if (change) this.hooks.metaChanged?.(taken?.by ?? this.myKey, change, meta.ts);
40050
40586
  this.hooks.changed();
40051
40587
  }
40052
40588
  /** A statement sealed under my current epoch, when I hold its secret. */
@@ -40070,19 +40606,20 @@ var CommunitySession = class CommunitySession {
40070
40606
  * A metadata statement (from its author's edge or a hub's): kept when it is newer than mine, its
40071
40607
  * commit is on my main branch, its signer was the admin after that commit and is the admin now,
40072
40608
  * its signature holds, and it opens under the epoch it names into metadata Ghostly shows. Returns
40073
- * whether it was new, so a hub relays it. One naming what I do not have yet waits for the chain.
40609
+ * whether it was new, so a hub relays it. One naming what I do not have yet waits for the chain. Just after the admin
40610
+ * role moved to me, the former admin's is signed again as mine (`takesOver`).
40074
40611
  */
40075
40612
  async receiveMeta(from, raw) {
40076
40613
  const frame = parseGroupMetaFrame(raw);
40077
40614
  if (!frame || frame.statement.g !== this.id || typeof frame.k !== "string" || !this.isRecentMember(from)) return false;
40078
- const s = frame.statement;
40079
- if (!groupMetaNewer(s, this.state.meta)) return false;
40615
+ const s = frame.statement, taking = this.takesOver(s);
40616
+ if (!taking && !groupMetaNewer(s, this.state.meta)) return false;
40080
40617
  const at = this.mainIndex.get(s.h);
40081
40618
  if (at === void 0) {
40082
40619
  if (s.e >= this.epoch - COMMUNITY_LIMITS.window) this.waitMeta(from, raw, s);
40083
40620
  return false;
40084
40621
  }
40085
- if (at !== s.e || rosterAdmin(this.rosterAt(s.h) ?? []) !== s.by || this.admin !== s.by || !verifyGroupMetaSignature(s)) return false;
40622
+ if (at !== s.e || rosterAdmin(this.rosterAt(s.h) ?? []) !== s.by || !taking && this.admin !== s.by || !verifyGroupMetaSignature(s)) return false;
40086
40623
  const secret = this.state.secrets[frame.k], sealedUnder = this.known.get(frame.k);
40087
40624
  if (!secret || !sealedUnder) {
40088
40625
  this.waitMeta(from, raw, s);
@@ -40090,6 +40627,10 @@ var CommunitySession = class CommunitySession {
40090
40627
  }
40091
40628
  const opened = openGroupMeta(frame, epochKeys(fromBase64Url(secret), this.id, sealedUnder.e).message);
40092
40629
  if (!opened) return false;
40630
+ if (taking) {
40631
+ await this.signAgainTaken(opened.meta, opened.body);
40632
+ return false;
40633
+ }
40093
40634
  const before = this.state.meta;
40094
40635
  this.state.meta = opened.meta;
40095
40636
  this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, opened.meta);
@@ -40100,6 +40641,37 @@ var CommunitySession = class CommunitySession {
40100
40641
  return true;
40101
40642
  }
40102
40643
  /**
40644
+ * Whether I take a statement though its signer is no longer the admin (WISP 903 § Metadata): I am the admin since
40645
+ * moments ago, they were the admin before me, and it is later than the one of theirs I signed again. A member who had
40646
+ * not synced when the role moved to them signed again what they held (or nothing), and the statement on its way would
40647
+ * be refused for good: a rename of theirs, or a member back from away, would then lose the group's call node.
40648
+ */
40649
+ takesOver(s) {
40650
+ const t = this.takeover;
40651
+ return !!t && this.isAdmin && s.by === t.from && (this.hooks.clock?.() ?? Date.now()) <= t.until && groupMetaNewer(s, t.base);
40652
+ }
40653
+ /**
40654
+ * The former admin's statement, taken (`takesOver`): signed again as mine, each field I changed since keeping my
40655
+ * value. Dated as theirs, and credited to them, when I changed nothing; what I held was then no change to hand on.
40656
+ */
40657
+ async signAgainTaken(meta, theirs) {
40658
+ const t = this.takeover, base = groupMetaBody(t.base), mine = groupMetaBody(this.state.meta);
40659
+ t.base = meta;
40660
+ const pick = (k) => JSON.stringify(mine[k]) === JSON.stringify(base[k]) ? theirs[k] : mine[k];
40661
+ const body = encodeGroupMetaBody({
40662
+ name: pick("name"),
40663
+ pic: pick("pic"),
40664
+ hubs: pick("hubs"),
40665
+ call: pick("call")
40666
+ });
40667
+ if (body === this.state.meta?.body) return;
40668
+ const changed = encodeGroupMetaBody(mine) !== encodeGroupMetaBody(base);
40669
+ await this.publishMeta(body, changed ? this.hooks.clock?.() ?? Date.now() : meta.ts, true, {
40670
+ by: meta.by,
40671
+ replaces: !changed
40672
+ });
40673
+ }
40674
+ /**
40103
40675
  * A statement that waits for the chain: only one its signer signed, so an altered copy cannot push out the one
40104
40676
  * waiting. The admin I know has a place of their own, which another member's statement cannot take, and in each
40105
40677
  * place only a later statement takes the one waiting.
@@ -40139,6 +40711,15 @@ var CommunitySession = class CommunitySession {
40139
40711
  * went with a branch that lost a fork, the name and picture signed again as mine under the main branch.
40140
40712
  */
40141
40713
  async metaFollowsChain() {
40714
+ if (this.admin !== this.adminSeen) {
40715
+ const from = this.adminSeen;
40716
+ this.takeover = this.isAdmin && from && from !== this.myKey ? {
40717
+ from,
40718
+ until: (this.hooks.clock?.() ?? Date.now()) + COMMUNITY_TAKEOVER_META_MS,
40719
+ base: this.state.meta
40720
+ } : void 0;
40721
+ this.adminSeen = this.admin;
40722
+ }
40142
40723
  const { admin, other } = this.pendingMeta;
40143
40724
  this.pendingMeta = {};
40144
40725
  for (const pending of [admin, other]) if (pending && await this.receiveMeta(pending.from, pending.frame)) this.hooks.relay?.(pending.frame);
@@ -40260,6 +40841,125 @@ function verifyGroupCallRequest(raw, sfu, now, seen) {
40260
40841
  }
40261
40842
  };
40262
40843
  }
40844
+ /**
40845
+ * An admin's request to act on a member in its group's call (WISP 602 · Group Calls § Moderation): what it sends to
40846
+ * `POST <sfu>/sfu/group-moderate`, signed by its group key over the node's origin as a token request is, under its own
40847
+ * tag, so neither request can stand for the other.
40848
+ *
40849
+ * {"v":1,"g":"<group>","k":"<admin key>","room":"g_<group>","act":"mute","target":"<member key>","src":["microphone"],
40850
+ * "ts":1794700800,"n":"<nonce>","sig":"…"}
40851
+ *
40852
+ * `mute` takes `src` away from `target`, `allow` gives it back, `remove` takes `target` out of the call and keeps it
40853
+ * out, `unban` lets it back in, and `state` changes nothing (the reply says who is muted and banned). Whether `k` is
40854
+ * the group's admin is the node's to say, from its roster.
40855
+ */
40856
+ /** What an admin can take from a member, in the sorted order a request lists them in. */
40857
+ var GROUP_CALL_SOURCES = [
40858
+ "camera",
40859
+ "microphone",
40860
+ "screen_share"
40861
+ ];
40862
+ var GROUP_CALL_MODERATION_ACTS = [
40863
+ "mute",
40864
+ "allow",
40865
+ "remove",
40866
+ "unban",
40867
+ "state"
40868
+ ];
40869
+ var takesSources = (act) => act === "mute" || act === "allow";
40870
+ /** Exactly the bytes an admin signs: the array form, as the token request's. */
40871
+ var groupCallModerationBytes = (sfu, g, room, k, act, target, src, ts, n) => utf8Encode(JSON.stringify([
40872
+ "ghostly-sfu/1 moderate",
40873
+ sfu,
40874
+ g,
40875
+ room,
40876
+ k,
40877
+ act,
40878
+ target,
40879
+ src,
40880
+ ts,
40881
+ n
40882
+ ]));
40883
+ /** A moderation request for `sfu`, signed by the admin's group key `seed`; `src` is listed unique and sorted. */
40884
+ function signGroupCallModeration(input, seed) {
40885
+ const k = identityFromSeed(seed).pubKeyZ32;
40886
+ const room = groupCallRoom(input.g);
40887
+ const target = input.act === "state" ? "" : input.target ?? "";
40888
+ const src = takesSources(input.act) ? [...new Set(input.src ?? [])].sort() : [];
40889
+ const ts = input.ts ?? Math.floor(Date.now() / 1e3);
40890
+ const n = input.n ?? toBase64Url(randomBytes(16));
40891
+ const sig = toBase64Url(sign(groupCallModerationBytes(input.sfu, input.g, room, k, input.act, target, src, ts, n), seed));
40892
+ return {
40893
+ v: 1,
40894
+ g: input.g,
40895
+ k,
40896
+ room,
40897
+ act: input.act,
40898
+ target,
40899
+ src,
40900
+ ts,
40901
+ n,
40902
+ sig
40903
+ };
40904
+ }
40905
+ /** `src` as an act takes it: unique known sources in sorted order, at least one, for `mute` and `allow`; none otherwise. */
40906
+ function sourcesFit(act, src) {
40907
+ if (!Array.isArray(src)) return false;
40908
+ if (!takesSources(act)) return src.length === 0;
40909
+ return src.length > 0 && src.every((s, i) => GROUP_CALL_SOURCES.includes(s) && (i === 0 || src[i - 1] < s));
40910
+ }
40911
+ /**
40912
+ * The node's checks of a moderation request but the roster, in order: the shape (a known act, a `target` that is a
40913
+ * member key other than `k`, or `""` for `state`, and `src` as the act takes it), the time within `GROUP_CALL_SKEW_S`
40914
+ * of `now` (ms), a nonce not in `seen`, and the signature over the node's own origin `sfu`. A request that passes has
40915
+ * its nonce added to `seen`; entries older than `GROUP_CALL_NONCE_S` are dropped on the way.
40916
+ */
40917
+ function verifyGroupCallModeration(raw, sfu, now, seen) {
40918
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {
40919
+ ok: false,
40920
+ reason: "malformed"
40921
+ };
40922
+ const f = raw;
40923
+ const act = f.act;
40924
+ if (f.v !== 1 || typeof f.g !== "string" || !GROUP_ID.test(f.g) || !isZ32Key(f.k) || f.room !== groupCallRoom(f.g) || !GROUP_CALL_MODERATION_ACTS.includes(act) || (act === "state" ? f.target !== "" : !isZ32Key(f.target) || f.target === f.k) || !sourcesFit(act, f.src) || !Number.isSafeInteger(f.ts) || f.ts <= 0 || typeof f.n !== "string" || !NONCE.test(f.n) || toBase64Url(fromBase64Url(f.n)) !== f.n || typeof f.sig !== "string" || !SIG.test(f.sig)) return {
40925
+ ok: false,
40926
+ reason: "malformed"
40927
+ };
40928
+ const room = groupCallRoom(f.g), target = f.target, src = f.src, ts = f.ts, nowS = Math.floor(now / 1e3);
40929
+ if (Math.abs(nowS - ts) > 60) return {
40930
+ ok: false,
40931
+ reason: "stale"
40932
+ };
40933
+ for (const [n, at] of seen) if (nowS - at > 120) seen.delete(n);
40934
+ if (seen.has(f.n)) return {
40935
+ ok: false,
40936
+ reason: "replayed"
40937
+ };
40938
+ let holds = false;
40939
+ try {
40940
+ holds = verify(fromBase64Url(f.sig), groupCallModerationBytes(sfu, f.g, room, f.k, act, target, src, ts, f.n), publicKeyFromZ32(f.k));
40941
+ } catch {}
40942
+ if (!holds) return {
40943
+ ok: false,
40944
+ reason: "signature"
40945
+ };
40946
+ seen.set(f.n, nowS);
40947
+ return {
40948
+ ok: true,
40949
+ request: {
40950
+ v: 1,
40951
+ g: f.g,
40952
+ k: f.k,
40953
+ room,
40954
+ act,
40955
+ target,
40956
+ src: [...src],
40957
+ ts,
40958
+ n: f.n,
40959
+ sig: f.sig
40960
+ }
40961
+ };
40962
+ }
40263
40963
  // ../core/src/groupTyping.ts
40264
40964
  /**
40265
40965
  * The typing indicator of a private group (WISP 902 · Group Mesh § Typing): "Ana is typing", said on the group's
@@ -41682,6 +42382,6 @@ function x401ApprovalDigest(subject) {
41682
42382
  ]);
41683
42383
  return toBase64Url(sha256(utf8Encode(canonical)));
41684
42384
  }
41685
- export { ACTIVE_DHT_POLL_MS, ACTIVE_TASK_STATUSES, ANSWERS_REFUSED_PAUSES, ANSWERS_REFUSED_PAUSE_MS, ANSWER_READ_ALLOWANCE, ANSWER_READ_FIRST_MS, ANSWER_READ_SPACING_MS, ANSWER_REFUSED_REDIALS, APPS_CAPABILITY, APP_BUNDLE_LIMITS, APP_BUNDLE_MAGIC, APP_CLIENTS, APP_CLIENT_NAME, APP_DATA_MAX_BYTES, APP_FORBIDDEN_KEYS, APP_FRAME, APP_ICON_PATH, APP_NAME, APP_PEER_OPEN_MAX, APP_PERMISSIONS, APP_PREFIXES, APP_RANGES_CAPABILITY, APP_RANGE_DATA_KIND, APP_RANGE_ERRORS, APP_RANGE_FRAMES, APP_RANGE_LIMITS, APP_RATE_LIMIT, APP_RATE_WINDOW_MS, APP_RESUME_GRACE_MS, APP_SCREENSHOTS_DIR, APP_SEND_LIMIT, APP_STATEMENT_LIMITS, APP_STORE_KINDS, APP_STORE_LIMITS, APP_VERSION_MAX, APP_VIEWS, ATPROTO_DECLARED_SCOPE, ATPROTO_FULL_SCOPE, ATPROTO_PROOF_COLLECTION, ATPROTO_PROOF_SCOPE, AUDIO_METADATA_LIMITS, AUTOMATIC_ORDER, AWAITED_READS, AWAITING_PEER_MS, AppRanges, AppSessions, AtprotoCid, AtprotoProofError, BACKGROUND_REQUESTS_PER_MINUTE, BACKGROUND_WHILE_SIGNALING, BACKGROUND_WRITES_SHARE, BIP322_REVISION, BITCOIN_NETWORKS, BLOCKED_DIAL_WAIT_MS, BOLT11_PATTERN, BREAKER_ALL_DOWN_PROBE_MS, BREAKER_BASE_MS, BREAKER_MAX_MS, BREAKER_THRESHOLD, BURST_RING_MS, BUTTONS_CAPABILITY, BUTTON_ID, BUTTON_STYLES, BitcoinAddressError, ByteReader, CALLS_CAPABILITY, CALL_RATE_WINDOW_MS, CALL_RECEIVE_LIMIT, CALL_SIGNAL_FUTURE_MS, CALL_SIGNAL_MAX_AGE_MS, CAPS_ISSUED_BACK_MS, CAPS_LABEL, CAPS_LIMITS, CAPS_PUBLISH_SPACING_MS, CAPS_REFRESH_MS, CARRIED_DEFER_MS, CATCH_UP_PAUSE_MS, CATCH_UP_SLICE, CHAT_RESERVE, CHAT_RESERVE_MOST_SHARE, CHAT_RESERVE_PER_CHAT, CHAT_WATCH_SHARE, CHUNK_FLAG_END, CHUNK_KIND, CLIPBOARD_GUARD_HASH, CLIPBOARD_GUARD_SCRIPT, CLOCK_EVIDENCE_MS, CLOCK_OFF_MS, CLOCK_PEERS, CLOCK_PEER_READ_GAP_MS, CLOCK_SERVERS, COMMUNITY_EDIT_FRAME, COMMUNITY_LIMITS, COMMUNITY_PIN_FRAME, COMMUNITY_PROFILE, COMMUNITY_REACTION_FRAME, COMMUNITY_TOPOLOGY, CONNECT_TIMEOUT_MS, CONTACT_ASKER_FRAME, CONTACT_LINK_BYTES, CONTACT_LINK_VERSION, CONTACT_RECORD_TTL, CRON_LINE, CROSSED_FRESH_MS, CROSSED_PROBE_MS, CROSSED_WAIT_MS, CapsExchange, CapsKeys, CapsRefusedError, CarriedTransport, CatchUpAnswers, ChatFiles, ClockWatch, CommunitySession, ContactRequestError, DAEMON_WATCH_PEER_IDLE_MS, DATA_CHANNEL_ID, DATA_CHANNEL_LABEL, DATA_SETTLE_MS, DEFAULT_RELAYS, DEMOTE_AFTER_FAILURES, DEMOTE_MS, DEPARTED_READS, DEPARTED_READ_MS, DEVICES_CAPABILITY, DEVICE_CAPABILITIES, DEVICE_ECHO_FRAME, DEVICE_INVITE_BYTES, DEVICE_INVITE_LIFETIME_S, DEVICE_INVITE_OWN_DEVICE, DEVICE_INVITE_VERSION, DEVICE_KINDS, DEVICE_PING_FRAME, DEVICE_WAKE_TTL_SECONDS, DHT_FILE_CAPABILITY, DHT_FILE_REFUSED, DHT_FILE_TOO_LARGE, DHT_MESSAGE_TTL, DHT_PIN_GRACE_MS, DHT_POLL_INTERVALS, DHT_TEXT_BYTES, DHT_TEXT_CAPABILITY, DHT_TEXT_REFUSED, DIALED_IN_CONTENDERS, DID_DHT_MAX_PAYLOAD, DID_DHT_PREFIX, DID_DHT_TTL, DID_DHT_VERSION, DID_DOCUMENT_MAX_BYTES, DID_FILE_MAX_BYTES, DID_GHOSTLY_SERVICE, DID_JWS_ALGS, DID_JWS_MAX_LENGTH, DID_MAX_LENGTH, DID_METHODS, DIRECT_EVIDENCE_MS, DIRECT_OWN_ATTEMPTS, DIRECT_PEERS, DNS_LABEL, DNS_TYPE, DOMAIN_FILE_MAX_BYTES, DOMAIN_MAX_RECORDS, DOMAIN_METHODS, DOMAIN_TXT_MAX_BYTES, DataLink, DhtDelivery, DidDhtError, DidError, DirectPathWatch, DiscoveryBudgetError, EARLY_DIAL_JOIN_MS, EDITED_FRAME, EDIT_BUFFER_MAX, EDIT_BUFFER_MS, EDIT_CAPABILITY, EDIT_FRAME, EDIT_RATE_WINDOW_MS, EDIT_RECEIVE_LIMIT, EDIT_SEND_LIMIT, ENDPOINT, ENGINE_ERRORS, ENROLL_CANCEL, ENROLL_CANCEL_REASONS, ENROLL_CAPABILITY, ENROLL_DONE, ENROLL_GRANT, ENROLL_HELLO, ENROLL_PROOF, ETHEREUM_USDT, EVM_TEST_CHAINS, EXPECT_PEER_MS, EngineError, FILES_BINARY_CAPABILITY, FILES_CAPABILITY, FILE_DATA_KIND, FILE_FRAMES, FILE_LIMITS, FIRST_PAIRING_PACE_MS, FIRST_PUBLISH_MAX_MS, FLOOD_PER_DAY, FOLLOW_MS, FORWARD_LIMITS, FRESH_READ_MS, FileTransfers, FileUplink, GATHER_ATTEMPTS, GATHER_STALL_MS, GROUP_ADMIN_OFF_ERROR, GROUP_BURST_MS, GROUP_BURST_ONE_LINK, GROUP_CALL_NONCE_S, GROUP_CALL_SKEW_S, GROUP_CALL_VERSION, GROUP_EDIT_FRAME, GROUP_EDIT_TEXT_BYTES, GROUP_ENTRY_PROFILE, GROUP_FILE_LIMITS, GROUP_HAVE_FRAME, GROUP_ID, GROUP_LIMITS, GROUP_MEMBER_CAP, GROUP_META_PAST, GROUP_META_PAST_CHARS, GROUP_OVER_PACE_MS, GROUP_PIN_FRAME, GROUP_PROFILE, GROUP_RATION_WINDOW_MS, GROUP_REACTED_FRAME, GROUP_REACTION_FRAME, GROUP_READ_NOTE, GROUP_READ_NOTE_COMMUNITY, GROUP_SIGNALING_ALLOWANCE_SHARE, GROUP_SIGNAL_FRAME, GROUP_TYPING_FRAME, GROUP_VERSION_FILES, GROUP_VERSION_HUBS, GROUP_VERSION_LARGE, GROUP_VERSION_SIGNALS, GROUP_WAKE_FRAME, GROUP_WAKE_GROUP_LIMIT, GROUP_WAKE_GROUP_WINDOW_MS, GROUP_WAKE_MEMBER_INTERVAL_MS, GROUP_WAKE_RECEIVE_LIMIT, GROUP_WANT_FRAME, GROUP_WANT_NO_FRAME, GhostLink, GhostlyHttpError, GroupSession, GroupTypingBoard, GroupWakeLimiter, HANDLED_WAIT_MS, HANDOFF_ACK, HANDOFF_ATTEMPTS, HANDOFF_BUSY, HANDOFF_BUSY_REASONS, HANDOFF_CANCEL, HANDOFF_CANCEL_REASONS, HANDOFF_CAPABILITY, HANDOFF_DATA, HANDOFF_DONE, HANDOFF_FILE_MISSING, HANDOFF_FILE_REQUEST, HANDOFF_HAVE, HANDOFF_HELLO, HANDOFF_LATER_BYTES, HANDOFF_LIST_PER_FRAME, HANDOFF_MANIFEST, HANDOFF_OFFER, HANDOFF_PAKE, HANDOFF_PIECE_BYTES, HANDOFF_PIECE_OVERHEAD, HANDOFF_RELEASE, HANDOFF_REQUEST, HANDOFF_TIMINGS, HANDOFF_VERIFIED, HANDOFF_VERSION, HANDOFF_WINDOW, HEDGE_MISSING_MS, HEDGE_MS, HOLD_CAPABILITY, HOLD_DATED_BACK_MS, HOLD_LIMITS, HTTP_SERVICE_PROTO, HoldKeys, HoldRefusedError, HttpClient, HttpHost, IDENTITY_CHALLENGE_WINDOW, IDENTITY_CHECK_UNAVAILABLE, IDENTITY_CLOCK_SKEW, IDENTITY_FRAME_LIMIT, IDENTITY_FRAME_WINDOW_MS, IDENTITY_MAX_CHECKS_PER_HOUR, IDENTITY_MAX_EVIDENCE, IDENTITY_MAX_FRAME, IDENTITY_MAX_RECEIVED, IDENTITY_MAX_VALIDITY, IDENTITY_MEMO_IDLE_MS, IDENTITY_MEMO_MAX, IDENTITY_MEMO_SIZE, IDENTITY_PROOF_CAPABILITY, IDENTITY_PROVIDER_ID, IDENTITY_REUSE_CHECK_S, IDENTITY_REVOCATION_LABEL, IDENTITY_STATEMENT_PREFIX, IDENTITY_SUBJECT, IDENTITY_TIMELINE_MAX, IDLE_THRESHOLD, IMAGE_LIMITS, INVITER_DIAL_GRACE_MS, INVITE_HRP, INVITE_LINK_ORIGIN, INVITE_MAX_LENGTH, INVITE_TAKEN, INVITE_VERSION, ITEM_STATES, IdentityCheckUnavailable, IdentityExchange, KNOCK_SLOTS, KNOCK_SLOT_LABEL, KNOCK_TTL_MS, KNOWN_SESSION_CAPABILITIES, LABEL, LATE_ANSWER_MS, LEGACY_GROUP_MEMBERS, LEGACY_SERVICES, LIGHTNING_DESTINATION_PATTERN, LIMITS, LINK_MAX_CHARS, LINK_PREVIEW_LIMITS, LINK_RECORD_LABEL, LINK_TRAILING, LIVENESS_MISSED_PINGS, LIVENESS_PING_MS, LIVE_POLL_MS, LNURL_LIMITS, LinkSession, MAX_AVATAR_LENGTH, MAX_AVATAR_SIDE, MAX_CHUNK_PAYLOAD_BYTES, MAX_DHT_TEXT_BYTES, MAX_DNS_PACKET_BYTES, MAX_DONE, MAX_EDITS_PER_MESSAGE, MAX_GROUP_CALL_NAME, MAX_GROUP_CALL_SFU, MAX_GROUP_CHAIN, MAX_GROUP_MEMBERS, MAX_GROUP_META_BODY, MAX_GROUP_NAME_BYTES, MAX_GROUP_NAME_LENGTH, MAX_GROUP_PICTURE_LENGTH, MAX_KNOCKS, MAX_MISSED, MAX_MSGS_PAYLOAD_B64, MAX_NICK_LENGTH, MAX_PAIRED_CALL_SIGNAL, MAX_PAIRED_MESSAGE_FRAME, MAX_REMOVAL_NUMBER, MAX_SEEN, MAX_SERVICES, MAX_SHARED_APPS, MAX_SKIP, MAX_SKIPPED_KEYS, MAX_SLOT_KNOCKS, MAX_WAITING, MEMBER_KEY, MENTION_EVERYONE, MENTION_LIMITS, MESH_HUBS, MESSAGE_CLOCK_SKEW_MS, MESSAGE_RECEIVE_LIMITS, MessageRefusal, NEW_PER_HOUR, NIP05_PATH, NO_ATTEMPTS, NO_AUDIO_METADATA, NO_HUB_POLICY, NO_PICTURE_METADATA, NO_VIDEO_METADATA, OFFER_FAST_MS, OFFER_HOST_GATHER_MS, OFFER_LOOK_MS, OFFER_STEP_MAX, ONCHAIN_PROVIDER, OWN_FRAME_LIMIT, OwnInviteError, PAIRED_CALL_CANDIDATES, PAIRED_CALL_FRAME, PAIRED_FRAME_TOO_LARGE, PAIRED_PROFILE, PAIRED_REPLY_AUTHORS, PAIRING_ATTEMPT_MS, PAIRING_RETRY_MS, PICTURE_METADATA_LIMITS, PINNED_FRAME, PIN_CAPABILITY, PIN_CLOCK_SKEW_MS, PIN_FRAME, PIN_LIMITS, PKARR_FUTURE_SKEW_MS, PLAYABLE_AUDIO, PLAYABLE_VIDEO, PONG_WAIT_MS, PRESENCES, PRESENCE_HEARTBEAT, PRESENCE_WINDOW, PREVIEWABLE_IMAGE, PREVIOUS_DEFAULT_RELAYS, PROOF_ADAPTERS, PROOF_CAPABILITY, PROTOCOL_VERSION, PR_CHECKS, PR_STATES, PUBKY_PROOF_MAX_BYTES, PUBKY_PROOF_ROOT, PUSH_PAD_BYTES, PUSH_SERVICE_HOSTS, PacketTooLargeError, PairedCalls, PairedSession, PairingTracker, PaymentPreflightError, PeerProofs, PublishFailedError, QUICK_REACTIONS, QUICK_REDIAL_MS, RACE_ANSWERED_MS, RACE_DIRECT_MS, RACE_RELAYED_MS, RATCHET_CAPABILITY, RATCHET_HEADER_BYTES, RATCHET_KEEP_MS, RATCHET_OVERHEAD, REACTED_FRAME, REACTIONS_CAPABILITY, REACTION_FRAME, REACTION_LIMITS, REANSWERS, RECORDING_TYPES, RECORD_TTL, REDESCRIBED_GRACE_MS, RELAYED_FIRST_MS, RELAY_PAYLOAD_MAX_BYTES, RELAY_POLL_INTERVALS, RELAY_REQUESTS_PER_MINUTE, RELAY_URL, RELAY_WITH_SECRETS, REMOVABLE_KINDS, REMOVED_TEXT, REOPEN_BELOW, REPLY_ID, REPLY_LIMITS, REQUESTS_PER_MINUTE, REQUEST_CLOCK_SKEW_MS, REQUEST_LABEL, REQUEST_LIFETIME_MS, REQUEST_NAME_UNITS, REQUEST_PACKET_BYTES, REQUEST_TEXT_BYTES, RESUME_WAIT_MS, RING_LIFETIME, ROUTINE_STATES, RTC_CONFIG, RTC_SIGNAL_FUTURE_MS, RTC_SIGNAL_MAX_AGE_MS, RTC_SIGNAL_RATE_WINDOW_MS, RTC_SIGNAL_RECEIVE_LIMIT, RTC_UNSTARTED_MS, RUN_RESULTS, RatchetBox, RateWindow, ReactionWindow, RelayBreaker, RelayTransport, RelaysFailedError, SAID_AGAIN, SEPOLIA_TEST_USDT, SEPOLIA_TEST_USDT_FAUCET, SERVICES_CAPABILITY, SERVICES_VERSION, SESSION_CAPABILITIES_FRAME, SESSION_FRAME_MAX, SESSION_RECEIVE_PENDING, SET_ACK, SET_UPDATE, SIGNALING_ALLOWANCE_SHARE, SIGNALING_WINDOW_MS, SIGNALS_PER_MINUTE, SIGNAL_CARRIERS, SIGNAL_DUE_READS, SIGNAL_FRESH_MS, SIGNAL_HOLD_MS, SIGNAL_OUT_READS, SIGNAL_PROVEN_MS, SIGNAL_REPLY_MS, SLOW_DEMOTE_MS, SLOW_MS, SPARK_NETWORKS, SPARK_PROVIDER, SSHSIG_MAX_ARMOR, SSHSIG_NAMESPACE, SSH_KEY_TYPES, SSH_PUBLIC_KEY_MAX, STALLED_EVIDENCE_MS, STALLED_LOOK_MS, STAMP_BITS_DEFAULT, STAMP_BITS_MAX, STAMP_BITS_MIN, STATUS_AVAILABILITIES, STATUS_CAPABILITY, STATUS_CARD_CAPABILITY, STATUS_CARD_LIMITS, STATUS_FRAME, STATUS_IDLE_AFTER_MS, STATUS_RATE_LIMIT, STATUS_RATE_WINDOW_MS, STATUS_SEND_INTERVAL_MS, STATUS_TEXT_MAX, STORAGE_LIFETIME, STORAGE_ROOT, SWITCH_RETIRE_MS, SessionCapabilities, SshSigError, StatusReceiver, StatusSender, TASK_STATUSES, TEST_USDT_FAUCET_AMOUNT, TOMBSTONE_SEQUENCE, TOMBSTONE_TURN, TRANSPORTS, TRANSPORTS_GONE_MS, TURN_BODY_BYTES, TURN_LABEL, TURN_LAST_SEQUENCE, TURN_MAX, TURN_NAME_BYTES, TURN_NO_ACTIVE, TURN_PUT_WINDOW_MS, TURN_RAISE_READ_TIMEOUT_MS, TURN_REV_LIMIT, TURN_SEALED_BYTES, TURN_SETTLE_MS, TURN_SIGNED_BYTES, TURN_SLOTS, TURN_SOURCE_TIMEOUT_MS, TURN_TTL, TURN_VERSION, TURN_VISIBLE_MS, TYPING_CAPABILITY, TYPING_FRAME, TYPING_KINDS, TYPING_RATE_LIMIT, TYPING_RATE_WINDOW_MS, TYPING_REFRESH_MS, TYPING_SEND_LIMIT, TYPING_STATUS_MAX, TYPING_TIMEOUT_MS, TurnRecordError, TypingReceiver, TypingSender, UNPROVEN_AUTH_MS, UNUSED_INVITE_READS_PER_MINUTE, UNUSED_INVITE_UPKEEP_MS, UNUSED_INVITE_WAIT_MAX_MS, UPGRADE_CAPABILITY, USDT_PUBLIC_RPC, VIDEO_LIMITS, VIDEO_METADATA_LIMITS, VIEWER_DROPPED_DIRECTIVES, VIEWER_DROPPED_HEADERS, VIEWER_GUARD_CSP, VIEWER_GUARD_HASH, VIEWER_GUARD_SCRIPT, VIEWER_PERMISSIONS_POLICY, VIEWER_SERVICE_CSP, VIEWER_SERVICE_CSP_RELAY_ONLY, VIEWER_WORKER_GUARD_CSP, VOICE_LIMITS, VOICE_METER, WAKE_ANSWER_GRACE_MS, WAKE_CALL_INTERVAL_MS, WAKE_CALL_TTL_SECONDS, WAKE_CALL_WAIT_MS, WAKE_SESSION_CAPABILITY as WAKE_CAPABILITY, WAKE_SESSION_CAPABILITY, WAKE_FRAME, WAKE_INTERVAL_MS, WAKE_LOST_MS, WAKE_ONLINE_BATCH, WAKE_ONLINE_BATCH_MS, WAKE_ONLINE_DELAY_MS, WAKE_ONLINE_INTERVAL_MS, WAKE_ONLINE_TTL_SECONDS, WAKE_RETRY_MS, WAKE_SUBJECT, WAKE_TTL_SECONDS, WALLET_NETWORKS, WATCH_PEER_MS, WATCH_SHARE, WAY_BACK_SHARE, WEBRTC_GUARD, WELL_KNOWN_PATH, WRITE_FIRST_MS, WakeLimiter, WebPushError, X401_CREDENTIAL_LIMITS, X401_DCQL_LIMITS, X401_HEADERS, X401_LIMITS, X401_PROTOCOLS, X401_REQUEST_LIMITS, X401_RESPONSE_MODES, X401_SCHEME, X401_VERSION, addedAppPermissions, allowingViewerGuard, answersOffer, appCardId, appCardUrl, appCloseFrame, appDataBytes, appDataFrame, appDigest, appFingerprint, appOpenFrame, appRangeCancelFrame, appRangeChunk, appRangeDataFrame, appRangeEndFrame, appRangeErrorFrame, appRangeGetFrame, appRef, appRefPublisher, appRevocationFor, appRevocationId, appSignedBytes, appStoreDecision, appUpdateDecision, appViewOf, applyIdentityEvent, arkAddressPrefix, arrivalKey, asWritten, assembleAppBundle, assertTokenUnits, assertWholeSats, atprotoCidFor, atprotoDidMethod, atprotoProofRecord, atprotoProofRkey, audioMetadataPatches, automaticTransport, baseMime, beaconKeys, beaconRecords, bip322MessageHash, bip322ToSign, bip322ToSpend, boundIdentityDisplay, boundVerifiedIdentity, budgetRetryMs, buildAppBundle, buildDataSdp, buildLinkRecords, buildSdpFromSignal, buildX401ProofRequest, buildX401ProofResult, buildX401ResultArtifact, buildX401TokenObject, buttonLabelClash, bytesEqual, callRtcConfig, callSignalHeardAt, canonicalJson, canonicalJsonBytes, canonicalUrl, capsDescriptors, cardEditNumber, cardLine, cardLinkHost, cardTimeUtc, cardUrl, carryMentions, cashuRequestPayload, chainPieces, chatAppId, checkAppBeforeRun, checkAppListing, checkAppManifest, checkAppRevokeStatement, checkAppStoreIndex, checkAtprotoProofRecord, checkDidJws, checkDidSignature, checkPushEndpoint, checkStatusCard, checkedDescriptors, claimedTime, classifyTurnRead, clearMissed, clockOffset, commitHash, commitUntaggedHash, communityCommitHash, communityEditFrame, communityGroupId, communityHasFrame, communityMessageAuthor, communityMessageId, communityRoster, communityUntaggedHash, compactSize, compareVersions, compressSdp, concatBytes, confirmationMatches, confirmationTag, contactAskerFrame, contactAskerHolds, contactDay, contactRtcConfig, countUnusedInvite, createChatInvite, createContactLink, createDeviceInvite, createIdentity, createLink, createRelayPayload, currentRelays, decodeAnyBitcoinAddress, decodeAppRangeData, decodeAtprotoCommit, decodeBase64, decodeBitcoinAddress, decodeBolt11, decodeChunk, decodeCommunityLink, decodeControl, decodeDagCbor, decodeDidDhtPacket, decodeDnsAnswers, decodeDnsResponse, decodeFileData, decodeGroupEntryLink, decodeInviteCode, decodeServices, decodeSvcbRecords, decodeTx, decodeTxtPacket, decodeWitness, decodeX401Header, decompressSdp, decrypt, decryptPushPayload, decryptText, derivedSecret, deviceEchoFrame, deviceEchoNonce, deviceFrameCapability, deviceInviteJoinerKeyZ32, deviceInviteJoinerParams, deviceKeyZ32, deviceLinkPairing, deviceLinkParams, deviceLinkRendezvousSeed, deviceLinkSealKey, deviceLinkSecret, devicePingFrame, deviceWakeRequest, dhtEditId, dhtFileElements, dhtFileId, dialDescriptors, dialableIrohRelay, didDhtDocument, didDhtFromPublicKey, didDhtKey, didDhtRecords, didGhostlyServiceEntry, didJwsAlg, didSignedMessages, didWebDocumentUrl, didWebFile, didWebFileNames, didWebFileUrl, didWebHost, directBlocked, dnsProofName, domainTxtRecord, domainWellKnownFile, doorHubs, downsamplePeaks, dropLoneJoiners, edgeParams, editFrame, editedFrame, emptyCapsState, emptyDhtDeliveryState, emptyIdentityLedger, emptyLinkRecords, emptyProofLedger, emptyRatchetState, encodeAppRangeData, encodeChunk, encodeCommunityLink, encodeContactLink, encodeControl, encodeDagCbor, encodeDeviceInvite, encodeDidDhtDeactivated, encodeDidDhtPacket, encodeDnsQuery, encodeFileData, encodeGhostlyInvite, encodeGroupEntryLink, encodeGroupMetaBody, encodeInviteCode, encodePacketTransports, encodeServices, encodeSetSlots, encodeSvcbPacket, encodeTurnFields, encodeTx, encodeTxtPacket, encodeWitness, encodeX401Header, encrypt, encryptPushPayload, encryptText, endedRequests, engineError, engineText, enrollCancelFrame, enrollCancelReason, enrollDigits, enrollDoneFrame, enrollGrantFrame, enrollHelloFrame, enrollMessage, enrollProofFrame, entryParams, epochKeys, exifOrientation, expectedRoster, extractParamsFromSdp, extractRtcParams, fedimintRequestPayload, fetchLnurlJson, fetchesByItself, fileMessageText, filePartDigest, filePartName, findAppForbiddenKey, findBolt11, findEndpoint, findInMst, findLightningDestination, firstDeviceSetSecret, formatEnrollDigits, formatFileSize, formatLocalTarget, formatPaymentAmount, formatVideoDuration, formatVoiceDuration, forwardedAgain, forwardedMany, frameBytes, freshHubs, fromBase64, fromBase64Url, fromZ32, generateEncryptionKey, generateVapidKeys, groupCallE2ee, groupCallKey, groupCallRequestBytes, groupCallRoom, groupCallSfu, groupDisplayName, groupEntryUrl, groupFileFallback, groupMessageId, groupMetaBody, groupMetaChange, groupMetaNewer, groupMetaPicture, groupMetaTag, groupMetaToHand, groupName, groupReplyAuthor, groupSignalFrame, groupTypingEpoch, groupWakeFrame, groupWakes, guardViewerAnswer, handoffAckFrame, handoffAttemptAllowed, handoffAttemptFailed, handoffAttemptSucceeded, handoffBusyFrame, handoffCancelFrame, handoffContext, handoffContextProof, handoffDataFrame, handoffDigest, handoffDoneFrame, handoffEphemeral, handoffFileMissingFrame, handoffFileRequestFrame, handoffHaveFrames, handoffHelloFrame, handoffManifestFrames, handoffOfferFrame, handoffPakeFrame, handoffReleaseFrame, handoffRequestFrame, handoffRetryAfter, handoffStreamKey, handoffVerifiedFrame, handoffVerifiedMessage, handoffVersions, hasVisible, hash160, heardCallSignal, heardTime, heldBackError, homeserverWebEndpoint, hubRank, identityFromSeed, identityFromSeedB64, identityPresentationBytes, identityRefusal, identityRevocationValue, identityStatement, identityStatementText, imageSize, importedProof, inboxRecord, inviteLink, inviteOwnership, inviteQrSegments, inviteQrText, invoiceCallbackUrl, irohDescriptor, irohRelayUrl, isAppHash, isAppKey, isAppLicense, isAppLine, isAppPath, isAppRef, isAppSignature, isAppUrl, isAppVersion, isAsf, isAtprotoDid, isBitcoinAddress, isCandidateAddress, isChatAppId, isDiscoveryBudgetError, isEmptyLinkPacket, isFederationId, isGlobalIpv4Host, isGroupMessageId, isHandoffPartName, isHoldUrl, isIdentityBinding, isImageMime, isLegacySignature, isNewerVersion, isPlayableAudioType, isPlayableVideoType, isProofAdapter, isPubkyKey, isPubkyProofFolder, isPublicAddress, isRatcheted, isServeId, isSparkAddress, isStrippedPicture, isValidServiceId, isVideoMime, isViewerTag, isWalletNetwork, isX401Protocol, isZ32Key, jpegSize, jwkThumbprint, keepPastGroupMeta, keepsToRelays, keptAtEqualSequence, knockHolds, knockIdentity, knockRecords, knockSlotIdentity, knockSlotOf, knockSlotRecords, lastSharedWithMe, leaveStands, leaveStatement, leaveStatement3, leftStatement, legacyMessageHash, linkEnd, linkRecords, linkStop, linkTail, linksIn, liveStatus, lobbyKeys, lobbyRecords, makeStamp, makeStampPaced, matchX401Dcql, mayBeHub, mayPin, measureRecords, mentionedMembers, mentionsBytes, mentionsMember, mergeBeacon, mergeContactKnocks, mergeKnocks, mergeLobby, meshHubs, meshMessageRef, meshRendezvous, newDeviceSetSecret, newEpochSecret, newHandoffId, newMailbox as newHoldMailbox, newIdentityBinding, newInbox, newPubkyProofFolder, newWakeToken, newX401HolderKey, newerHead, newerPacket, nextGroupMetaRevision, nextPinNumber, nextReactionNumber, nextTurnPosition, nip05RootKey, normalizeAtprotoHandle, normalizeDid, normalizeDomain, normalizePubkyKey, normalizeRelayUrl, nostrProofTemplate, offerIsFresh, openDidDhtPayload, openGroupMeta, openGroupTyping, openHandoffPiece, openPair, openRelayPayload, openRequest, openSecret, openTurnValue, ownInviteRefusal, pacer, pairedEditFits, pairedMessageFits, pairedMessageFrame, pairedReplyAuthor, parseAppFrame, parseAppRangeFrame, parseAtprotoCar, parseAtprotoDidDocument, parseAtprotoDidKey, parseAtprotoVerificationKey, parseCallSignal, parseCashuRequestPayload, parseCommunityEdit, parseDid, parseDidDocument, parseDidJws, parseDidSignaturePaste, parseDomainTxt, parseEditFrame, parseEditedFrame, parseEngineError, parseFedimintRequestPayload, parseGroupCommit, parseGroupMetaBody, parseGroupMetaFrame, parseGroupMetaStatement, parseGroupMetaTag, parseGroupWakeFrame, parseHubPolicy, parseImageMeta, parseInvoiceCallback, parseLightningDestination, parseLinkPreview, parseLinkRecords, parseLocalTarget, parsePacketTransports, parsePairedCallFrame, parsePayParams, parsePaymentAmount, parsePaymentNetworks, parsePinFrame, parsePinnedFrame, parseReactedFrame, parseReactionFrame, parseRelayPayload, parseRtcSignal, parseSessionCapabilities, parseSshPublicKey, parseSshSignature, parseStatusFrame, parseTypingActivity, parseTypingFrame, parseVideoMeta, parseVoiceMeta, parseWakeFrame, pastedAgain, paymentUri, peekDhtMailbox, personStatus, pickCallCandidates, pickHubs, pickMeshHubs, pinFrame, pinIsNewer, pinNumberHolds, pinnedFrame, plainStatusLine, planAppUpdate, planKnocks, presenceSeenAt, presentX401SdJwtVc, previewImageSize, previewable, proofCapability, proofHash, proofStatement, pubkyHomeserverOf, pubkyProofCapability, pubkyProofFile, pubkyProofPath, publicKeyFromZ32, publishFailure, publishedNowhere, pushRequest, qrText, queueReaction, randomBytes, rankHubs, rankTransports, ratchetHeard, ratchetOn, ratchetOpen, ratchetRoot, ratchetSeal, ratchetSessionOf, ratchetUnknownSession, reactedFrame, reactionEmoji, reactionFrame, reactionIsNewer, readAppBundle, readAppBundleAsync, readAppFrame, readAppListing, readAppRangeFrame, readAppRevocation, readAppRevocationShape, readAppRevocations, readAppSignature, readAppStore, readAppStoreSteps, readAtprotoCid, readBeacon, readBeaconHead, readCanonicalJson, readContactLink, readDeviceInvite, readDhtFile, readDhtReactions, readDnsName, readEnrollGrant, readEnrollHello, readForwarded, readGroupFileMeta, readGroupHave, readGroupSignal, readGroupWant, readGroupWantNo, readHandoffAck, readHandoffBusy, readHandoffCancel, readHandoffData, readHandoffDone, readHandoffFileFrame, readHandoffHave, readHandoffHello, readHandoffManifest, readHandoffPake, readHandoffRelease, readHandoffTurnFrame, readHandoffVerified, readImageMeta, readInviteCode, readKnockSlot, readKnocks, readLinkRecord, readLobby, readManifest, readOwnRelayPayload, readPin, readReaction, readRelayBody, readReply, readSetUpdate, readStatusCard, readTurnBody, readTurnPacket, readWake, readWakePayload, readX401DcqlQuery, readX401OpenId4VpRequest, readX401ProofRequest, readX401ProofRequestHeader, readX401ProofResponse, readX401ProofResponseHeader, readX401ProofResult, readX401ProofResultHeader, readX401SdJwtVc, readingAhead, receivedIdentityStatus, receivedTimestamp, recordingMime, recordsFromTxt, recordsFromWellKnown, recordsName, refusalText, relativizeLocation, relayRequest, relayUrl, relayUrlProblem, relayUrlTooLong, relayedTransports, rememberAlone, removedCardText, repeatedJsonKey, replySnippet, requestLnurlInvoice, requestPlaintextBytes, requestRecords, resolveDidDht, resolveLightningDestination, resolveTargetUrl, revokesIdentity, ringAuthorization, ringClaims, ringEvidence, rosterAdmin, rosterHas, rosterHash, routedCommunityFrame, safeBlobType, sameButtonText, sameSshKey, sameStatusState, sameX401HolderJwk, sanitizeAvatar, sanitizeDisplayText, sanitizeFileName, sanitizeMime, sanitizeNick, sanitizePreviewImage, sanitizeRequestHeaders, sanitizeResponseHeaders, sanitizeStatusText, sanitizeTypingStatus, satsToBtc, sdpHasCandidates, sealGroupTyping, sealHandoffPiece, sealPair, sealSecret, sealTurnBody, sealedLength, seedSigner, seenEntry, sendBody, sentWhole, serviceIdFromName, servicesFromWire, servicesToWire, sessionCapabilitiesFrame, setAckFrame, setAppSignatureFastPath, setLinkTraceSink, setPublicKeyFastPath, setUpdateFrame, setUpdateMessage, settleRequest, sha256Hex, sha256Paced, sha256d, shortAtprotoDid, shortHash, shouldBeHub, shownTime, sign, signAppObject, signAppRevocation, signAppStore, signCommit, signCommunity, signDeviceTransports, signDidDhtPacket, signGroupCallRequest, signGroupMeta, signIdentityPresentation, signRelayPayload, signTombstone, signTurnBody, signTurnPacket, signTurnRelease, signalHasVideo, signingKeys, sortParts, sortRoster, sparkAddressKind, sparkInvoiceDetails, sparkNetworkOf, sshFingerprint, sshKeyDigestHex, sshSignCommand, stampHolds, staticDidDocument, statusCardBytes, statusCardText, statusFrame, statusState, storageProof, storageProofBody, storageProofPath, strictBase64Url, stripHidden, stripPictureMetadata, symmetricNat, takeRequest, taskProgress, toBase64, toBase64Url, toZ32, traceLink, transferEnded, transferStalled, transportOrder, trimEndOf, tryDecrypt, turnInstance, turnKeys, turnName, turnOff, turnPacket, turnPayloadSequence, turnPutSummary, turnReleaseMessage, turnSequence, turnSignedMessage, turnStatedVerifier, turnVerifierMark, txHash, txtValue, typingActivity, typingFrame, typingKindOf, u32, u64, unsignedCommitBytes, unsignedDeviceTransports, unusedInviteWait, unwrapPasted, uriEnd, usageLeft, utf8Decode, utf8Encode, validDomainRecord, validEditMessage, validEditNumber, validEditText, validExternalKey, validHead, validMentions, validReactionNumber, validRemovalNumber, validRingKey, validatePaymentTarget, vapidAuthorization, vapidKeysMatch, varBytes, verify, verifyAppRevocation, verifyAppSignature, verifyAppStatementBytes, verifyAtprotoRecordProof, verifyAtprotoSignature, verifyBip322, verifyBitcoinMessage, verifyChain, verifyCommit, verifyCommitSignature, verifyCommunityChain, verifyCommunityChainPaced, verifyCommunityCommit, verifyDeviceTransports, verifyEnrollProof, verifyGroupCallRequest, verifyGroupMetaSignature, verifyIdentityPresentation, verifyNostrProof, verifyPeerProof, verifyRingAuthorization, verifyRingEvidence, verifySetUpdate, verifySshSignature, videoMetadataPatches, viewerGuardOffset, viewerResponseHeaders, viewerServicePolicy, viewerTag, voiceDownloadName, voiceFileName, voiceLevel, voiceLevelsOf, voicePeaksOf, waitForIceGathering, wakeFrame, wakePayload, wakeRequest, walletNetworkOf, webCryptoSigner, webLocalFetch, wellKnownUrl, wireHubPolicy, wireMentions, wireReaction, wireReply, withRequestOptions, withViewerPolicy, withoutAudioMetadata, withoutPictureMetadata, withoutVideoMetadata, wrapDataChannel, wrapGroupMeta, x401AnswerableRequests, x401ApprovalDigest, x401HolderJwk, x401VpToken, yieldThread };
42385
+ export { ACTIVE_DHT_POLL_MS, ACTIVE_TASK_STATUSES, ANSWERS_REFUSED_PAUSES, ANSWERS_REFUSED_PAUSE_MS, ANSWER_READ_ALLOWANCE, ANSWER_READ_FIRST_MS, ANSWER_READ_SPACING_MS, ANSWER_REFUSED_REDIALS, APPS_CAPABILITY, APP_BUNDLE_LIMITS, APP_BUNDLE_MAGIC, APP_CLIENTS, APP_CLIENT_NAME, APP_DATA_MAX_BYTES, APP_FORBIDDEN_KEYS, APP_FRAME, APP_ICON_PATH, APP_NAME, APP_PEER_OPEN_MAX, APP_PERMISSIONS, APP_PREFIXES, APP_RANGES_CAPABILITY, APP_RANGE_DATA_KIND, APP_RANGE_ERRORS, APP_RANGE_FRAMES, APP_RANGE_LIMITS, APP_RATE_LIMIT, APP_RATE_WINDOW_MS, APP_RESUME_GRACE_MS, APP_SCREENSHOTS_DIR, APP_SEND_LIMIT, APP_STATEMENT_LIMITS, APP_STORE_KINDS, APP_STORE_LIMITS, APP_VERSION_MAX, APP_VIEWS, ATPROTO_DECLARED_SCOPE, ATPROTO_FULL_SCOPE, ATPROTO_PROOF_COLLECTION, ATPROTO_PROOF_SCOPE, AUDIO_METADATA_LIMITS, AUTOMATIC_ORDER, AWAITED_READS, AWAITING_PEER_MS, AppRanges, AppSessions, AtprotoCid, AtprotoProofError, BACKGROUND_REQUESTS_PER_MINUTE, BACKGROUND_WHILE_SIGNALING, BACKGROUND_WRITES_SHARE, BIP322_REVISION, BITCOIN_NETWORKS, BLOCKED_DIAL_WAIT_MS, BOLT11_PATTERN, BREAKER_ALL_DOWN_PROBE_MS, BREAKER_BASE_MS, BREAKER_MAX_MS, BREAKER_THRESHOLD, BURST_RING_MS, BUTTONS_CAPABILITY, BUTTON_ID, BUTTON_STYLES, BitcoinAddressError, ByteReader, CALLS_CAPABILITY, CALL_RATE_WINDOW_MS, CALL_RECEIVE_LIMIT, CALL_SIGNAL_FUTURE_MS, CALL_SIGNAL_MAX_AGE_MS, CAPS_ISSUED_BACK_MS, CAPS_LABEL, CAPS_LIMITS, CAPS_PUBLISH_SPACING_MS, CAPS_REFRESH_MS, CARRIED_DEFER_MS, CATCH_UP_PAUSE_MS, CATCH_UP_SLICE, CHAT_RESERVE, CHAT_RESERVE_MOST_SHARE, CHAT_RESERVE_PER_CHAT, CHAT_WATCH_SHARE, CHUNK_FLAG_END, CHUNK_KIND, CLIPBOARD_GUARD_HASH, CLIPBOARD_GUARD_SCRIPT, CLOCK_EVIDENCE_MS, CLOCK_OFF_MS, CLOCK_PEERS, CLOCK_PEER_READ_GAP_MS, CLOCK_SERVERS, COMMUNITY_EDIT_FRAME, COMMUNITY_LIMITS, COMMUNITY_PIN_FRAME, COMMUNITY_PROFILE, COMMUNITY_REACTION_FRAME, COMMUNITY_TAKEOVER_META_MS, COMMUNITY_TOPOLOGY, CONNECT_TIMEOUT_MS, CONTACT_ASKER_FRAME, CONTACT_LINK_BYTES, CONTACT_LINK_VERSION, CONTACT_RECORD_TTL, CRON_LINE, CROSSED_FRESH_MS, CROSSED_PROBE_MS, CROSSED_WAIT_MS, CapsExchange, CapsKeys, CapsRefusedError, CarriedTransport, CatchUpAnswers, ChatFiles, ClockWatch, CommunitySession, ContactRequestError, DAEMON_WATCH_PEER_IDLE_MS, DATA_CHANNEL_ID, DATA_CHANNEL_LABEL, DATA_SETTLE_MS, DEFAULT_RELAYS, DEMOTE_AFTER_FAILURES, DEMOTE_MS, DEPARTED_READS, DEPARTED_READ_MS, DEVICES_CAPABILITY, DEVICE_CAPABILITIES, DEVICE_ECHO_FRAME, DEVICE_INVITE_BYTES, DEVICE_INVITE_LIFETIME_S, DEVICE_INVITE_OWN_DEVICE, DEVICE_INVITE_VERSION, DEVICE_KINDS, DEVICE_PING_FRAME, DEVICE_WAKE_TTL_SECONDS, DHT_FILE_CAPABILITY, DHT_FILE_REFUSED, DHT_FILE_TOO_LARGE, DHT_MESSAGE_TTL, DHT_PIN_GRACE_MS, DHT_POLL_INTERVALS, DHT_TEXT_BYTES, DHT_TEXT_CAPABILITY, DHT_TEXT_REFUSED, DIALED_IN_CONTENDERS, DID_DHT_MAX_PAYLOAD, DID_DHT_PREFIX, DID_DHT_TTL, DID_DHT_VERSION, DID_DOCUMENT_MAX_BYTES, DID_FILE_MAX_BYTES, DID_GHOSTLY_SERVICE, DID_JWS_ALGS, DID_JWS_MAX_LENGTH, DID_MAX_LENGTH, DID_METHODS, DIRECT_EVIDENCE_MS, DIRECT_OWN_ATTEMPTS, DIRECT_PEERS, DNS_LABEL, DNS_TYPE, DOMAIN_FILE_MAX_BYTES, DOMAIN_MAX_RECORDS, DOMAIN_METHODS, DOMAIN_TXT_MAX_BYTES, DataLink, DhtDelivery, DidDhtError, DidError, DirectPathWatch, DiscoveryBudgetError, EARLY_DIAL_JOIN_MS, EDITED_FRAME, EDIT_BUFFER_MAX, EDIT_BUFFER_MS, EDIT_CAPABILITY, EDIT_FRAME, EDIT_RATE_WINDOW_MS, EDIT_RECEIVE_LIMIT, EDIT_SEND_LIMIT, ENDPOINT, ENGINE_ERRORS, ENROLL_CANCEL, ENROLL_CANCEL_REASONS, ENROLL_CAPABILITY, ENROLL_DONE, ENROLL_GRANT, ENROLL_HELLO, ENROLL_PROOF, ETHEREUM_USDT, EVM_TEST_CHAINS, EXPECT_PEER_MS, EngineError, FILES_BINARY_CAPABILITY, FILES_CAPABILITY, FILE_DATA_KIND, FILE_FRAMES, FILE_LIMITS, FIRST_PAIRING_PACE_MS, FIRST_PUBLISH_MAX_MS, FLOOD_PER_DAY, FOLLOW_MS, FORWARD_LIMITS, FRESH_READ_MS, FileTransfers, FileUplink, GATHER_ATTEMPTS, GATHER_STALL_MS, GROUP_ADMIN_OFF_ERROR, GROUP_BURST_MS, GROUP_BURST_ONE_LINK, GROUP_CALL_MODERATION_ACTS, GROUP_CALL_NONCE_S, GROUP_CALL_SKEW_S, GROUP_CALL_SOURCES, GROUP_CALL_VERSION, GROUP_EDIT_FRAME, GROUP_EDIT_TEXT_BYTES, GROUP_ENTRY_PROFILE, GROUP_FILE_LIMITS, GROUP_HAVE_FRAME, GROUP_ID, GROUP_LIMITS, GROUP_MEMBER_CAP, GROUP_META_PAST, GROUP_META_PAST_CHARS, GROUP_OVER_PACE_MS, GROUP_PIN_FRAME, GROUP_PROFILE, GROUP_RATION_WINDOW_MS, GROUP_REACTED_FRAME, GROUP_REACTION_FRAME, GROUP_READ_NOTE, GROUP_READ_NOTE_COMMUNITY, GROUP_SIGNALING_ALLOWANCE_SHARE, GROUP_SIGNAL_FRAME, GROUP_TAKEOVER_META_MS, GROUP_TYPING_FRAME, GROUP_VERSION_FILES, GROUP_VERSION_HUBS, GROUP_VERSION_LARGE, GROUP_VERSION_SIGNALS, GROUP_WAKE_FRAME, GROUP_WAKE_GROUP_LIMIT, GROUP_WAKE_GROUP_WINDOW_MS, GROUP_WAKE_MEMBER_INTERVAL_MS, GROUP_WAKE_RECEIVE_LIMIT, GROUP_WANT_FRAME, GROUP_WANT_NO_FRAME, GhostLink, GhostlyHttpError, GroupSession, GroupTypingBoard, GroupWakeLimiter, HANDLED_WAIT_MS, HANDOFF_ACK, HANDOFF_ATTEMPTS, HANDOFF_BUSY, HANDOFF_BUSY_REASONS, HANDOFF_CANCEL, HANDOFF_CANCEL_REASONS, HANDOFF_CAPABILITY, HANDOFF_DATA, HANDOFF_DONE, HANDOFF_FILE_MISSING, HANDOFF_FILE_REQUEST, HANDOFF_HAVE, HANDOFF_HELLO, HANDOFF_LATER_BYTES, HANDOFF_LIST_PER_FRAME, HANDOFF_MANIFEST, HANDOFF_OFFER, HANDOFF_PAKE, HANDOFF_PIECE_BYTES, HANDOFF_PIECE_OVERHEAD, HANDOFF_RELEASE, HANDOFF_REQUEST, HANDOFF_TIMINGS, HANDOFF_VERIFIED, HANDOFF_VERSION, HANDOFF_WINDOW, HEDGE_MISSING_MS, HEDGE_MS, HOLD_CAPABILITY, HOLD_DATED_BACK_MS, HOLD_LIMITS, HTTP_SERVICE_PROTO, HoldKeys, HoldRefusedError, HttpClient, HttpHost, IDENTITY_CHALLENGE_WINDOW, IDENTITY_CHECK_UNAVAILABLE, IDENTITY_CLOCK_SKEW, IDENTITY_FRAME_LIMIT, IDENTITY_FRAME_WINDOW_MS, IDENTITY_MAX_CHECKS_PER_HOUR, IDENTITY_MAX_EVIDENCE, IDENTITY_MAX_FRAME, IDENTITY_MAX_RECEIVED, IDENTITY_MAX_VALIDITY, IDENTITY_MEMO_IDLE_MS, IDENTITY_MEMO_MAX, IDENTITY_MEMO_SIZE, IDENTITY_PROOF_CAPABILITY, IDENTITY_PROVIDER_ID, IDENTITY_REUSE_CHECK_S, IDENTITY_REVOCATION_LABEL, IDENTITY_STATEMENT_PREFIX, IDENTITY_SUBJECT, IDENTITY_TIMELINE_MAX, IDLE_THRESHOLD, IMAGE_LIMITS, INVITER_DIAL_GRACE_MS, INVITE_HRP, INVITE_LINK_ORIGIN, INVITE_MAX_LENGTH, INVITE_TAKEN, INVITE_VERSION, ITEM_STATES, IdentityCheckUnavailable, IdentityExchange, KNOCK_SLOTS, KNOCK_SLOT_LABEL, KNOCK_TTL_MS, KNOWN_SESSION_CAPABILITIES, LABEL, LATE_ANSWER_MS, LEGACY_GROUP_MEMBERS, LEGACY_SERVICES, LIGHTNING_DESTINATION_PATTERN, LIMITS, LINK_MAX_CHARS, LINK_PREVIEW_LIMITS, LINK_RECORD_LABEL, LINK_TRAILING, LIVENESS_MISSED_PINGS, LIVENESS_PING_MS, LIVE_POLL_MS, LNURL_LIMITS, LinkSession, MAX_AVATAR_LENGTH, MAX_AVATAR_SIDE, MAX_CHUNK_PAYLOAD_BYTES, MAX_DHT_TEXT_BYTES, MAX_DNS_PACKET_BYTES, MAX_DONE, MAX_EDITS_PER_MESSAGE, MAX_GROUP_CALL_NAME, MAX_GROUP_CALL_SFU, MAX_GROUP_CHAIN, MAX_GROUP_MEMBERS, MAX_GROUP_META_BODY, MAX_GROUP_NAME_BYTES, MAX_GROUP_NAME_LENGTH, MAX_GROUP_PICTURE_LENGTH, MAX_KNOCKS, MAX_MISSED, MAX_MSGS_PAYLOAD_B64, MAX_NICK_LENGTH, MAX_PAIRED_CALL_SIGNAL, MAX_PAIRED_MESSAGE_FRAME, MAX_REMOVAL_NUMBER, MAX_SEEN, MAX_SERVICES, MAX_SHARED_APPS, MAX_SKIP, MAX_SKIPPED_KEYS, MAX_SLOT_KNOCKS, MAX_WAITING, MEMBER_KEY, MENTION_EVERYONE, MENTION_LIMITS, MESH_HUBS, MESSAGE_CLOCK_SKEW_MS, MESSAGE_RECEIVE_LIMITS, MessageRefusal, NEW_PER_HOUR, NIP05_PATH, NO_ATTEMPTS, NO_AUDIO_METADATA, NO_HUB_POLICY, NO_PICTURE_METADATA, NO_VIDEO_METADATA, OFFER_FAST_MS, OFFER_HOST_GATHER_MS, OFFER_LOOK_MS, OFFER_STEP_MAX, ONCHAIN_PROVIDER, OWN_FRAME_LIMIT, OwnInviteError, PAIRED_CALL_CANDIDATES, PAIRED_CALL_FRAME, PAIRED_FRAME_TOO_LARGE, PAIRED_PROFILE, PAIRED_REPLY_AUTHORS, PAIRING_ATTEMPT_MS, PAIRING_RETRY_MS, PICTURE_METADATA_LIMITS, PINNED_FRAME, PIN_CAPABILITY, PIN_CLOCK_SKEW_MS, PIN_FRAME, PIN_LIMITS, PKARR_FUTURE_SKEW_MS, PLAYABLE_AUDIO, PLAYABLE_VIDEO, PONG_WAIT_MS, PRESENCES, PRESENCE_HEARTBEAT, PRESENCE_WINDOW, PREVIEWABLE_IMAGE, PREVIOUS_DEFAULT_RELAYS, PROOF_ADAPTERS, PROOF_CAPABILITY, PROTOCOL_VERSION, PR_CHECKS, PR_STATES, PUBKY_PROOF_MAX_BYTES, PUBKY_PROOF_ROOT, PUSH_PAD_BYTES, PUSH_SERVICE_HOSTS, PacketTooLargeError, PairedCalls, PairedSession, PairingTracker, PaymentPreflightError, PeerProofs, PublishFailedError, QUICK_REACTIONS, QUICK_REDIAL_MS, RACE_ANSWERED_MS, RACE_DIRECT_MS, RACE_RELAYED_MS, RATCHET_CAPABILITY, RATCHET_HEADER_BYTES, RATCHET_KEEP_MS, RATCHET_OVERHEAD, REACTED_FRAME, REACTIONS_CAPABILITY, REACTION_FRAME, REACTION_LIMITS, REANSWERS, RECORDING_TYPES, RECORD_TTL, REDESCRIBED_GRACE_MS, RELAYED_FIRST_MS, RELAY_PAYLOAD_MAX_BYTES, RELAY_POLL_INTERVALS, RELAY_REQUESTS_PER_MINUTE, RELAY_URL, RELAY_WITH_SECRETS, REMOVABLE_KINDS, REMOVED_TEXT, REOPEN_BELOW, REPLY_ID, REPLY_LIMITS, REQUESTS_PER_MINUTE, REQUEST_CLOCK_SKEW_MS, REQUEST_LABEL, REQUEST_LIFETIME_MS, REQUEST_NAME_UNITS, REQUEST_PACKET_BYTES, REQUEST_TEXT_BYTES, RESUME_WAIT_MS, RING_LIFETIME, ROUTINE_STATES, RTC_CONFIG, RTC_SIGNAL_FUTURE_MS, RTC_SIGNAL_MAX_AGE_MS, RTC_SIGNAL_RATE_WINDOW_MS, RTC_SIGNAL_RECEIVE_LIMIT, RTC_UNSTARTED_MS, RUN_RESULTS, RatchetBox, RateWindow, ReactionWindow, RelayBreaker, RelayTransport, RelaysFailedError, SAID_AGAIN, SEPOLIA_TEST_USDT, SEPOLIA_TEST_USDT_FAUCET, SERVICES_CAPABILITY, SERVICES_VERSION, SESSION_CAPABILITIES_FRAME, SESSION_FRAME_MAX, SESSION_RECEIVE_PENDING, SET_ACK, SET_UPDATE, SIGNALING_ALLOWANCE_SHARE, SIGNALING_WINDOW_MS, SIGNALS_PER_MINUTE, SIGNAL_CARRIERS, SIGNAL_DUE_READS, SIGNAL_FRESH_MS, SIGNAL_HOLD_MS, SIGNAL_OUT_READS, SIGNAL_PROVEN_MS, SIGNAL_REPLY_MS, SLOW_DEMOTE_MS, SLOW_MS, SPARK_NETWORKS, SPARK_PROVIDER, SSHSIG_MAX_ARMOR, SSHSIG_NAMESPACE, SSH_KEY_TYPES, SSH_PUBLIC_KEY_MAX, STALLED_EVIDENCE_MS, STALLED_LOOK_MS, STAMP_BITS_DEFAULT, STAMP_BITS_MAX, STAMP_BITS_MIN, STATUS_AVAILABILITIES, STATUS_CAPABILITY, STATUS_CARD_CAPABILITY, STATUS_CARD_LIMITS, STATUS_FRAME, STATUS_IDLE_AFTER_MS, STATUS_RATE_LIMIT, STATUS_RATE_WINDOW_MS, STATUS_SEND_INTERVAL_MS, STATUS_TEXT_MAX, STORAGE_LIFETIME, STORAGE_ROOT, SWITCH_RETIRE_MS, SessionCapabilities, SshSigError, StatusReceiver, StatusSender, TASK_STATUSES, TEST_USDT_FAUCET_AMOUNT, TOMBSTONE_SEQUENCE, TOMBSTONE_TURN, TRANSPORTS, TRANSPORTS_GONE_MS, TURN_BODY_BYTES, TURN_LABEL, TURN_LAST_SEQUENCE, TURN_MAX, TURN_NAME_BYTES, TURN_NO_ACTIVE, TURN_PUT_WINDOW_MS, TURN_RAISE_READ_TIMEOUT_MS, TURN_REV_LIMIT, TURN_SEALED_BYTES, TURN_SETTLE_MS, TURN_SIGNED_BYTES, TURN_SLOTS, TURN_SOURCE_TIMEOUT_MS, TURN_TTL, TURN_VERSION, TURN_VISIBLE_MS, TYPING_CAPABILITY, TYPING_FRAME, TYPING_KINDS, TYPING_RATE_LIMIT, TYPING_RATE_WINDOW_MS, TYPING_REFRESH_MS, TYPING_SEND_LIMIT, TYPING_STATUS_MAX, TYPING_TIMEOUT_MS, TurnRecordError, TypingReceiver, TypingSender, UNPROVEN_AUTH_MS, UNUSED_INVITE_READS_PER_MINUTE, UNUSED_INVITE_UPKEEP_MS, UNUSED_INVITE_WAIT_MAX_MS, UPGRADE_CAPABILITY, USDT_PUBLIC_RPC, VIDEO_LIMITS, VIDEO_METADATA_LIMITS, VIEWER_DROPPED_DIRECTIVES, VIEWER_DROPPED_HEADERS, VIEWER_GUARD_CSP, VIEWER_GUARD_HASH, VIEWER_GUARD_SCRIPT, VIEWER_PERMISSIONS_POLICY, VIEWER_SERVICE_CSP, VIEWER_SERVICE_CSP_RELAY_ONLY, VIEWER_WORKER_GUARD_CSP, VOICE_LIMITS, VOICE_METER, WAKE_ANSWER_GRACE_MS, WAKE_CALL_INTERVAL_MS, WAKE_CALL_TTL_SECONDS, WAKE_CALL_WAIT_MS, WAKE_SESSION_CAPABILITY as WAKE_CAPABILITY, WAKE_SESSION_CAPABILITY, WAKE_FRAME, WAKE_INTERVAL_MS, WAKE_LOST_MS, WAKE_ONLINE_BATCH, WAKE_ONLINE_BATCH_MS, WAKE_ONLINE_DELAY_MS, WAKE_ONLINE_INTERVAL_MS, WAKE_ONLINE_TTL_SECONDS, WAKE_RETRY_MS, WAKE_SUBJECT, WAKE_TTL_SECONDS, WALLET_NETWORKS, WATCH_PEER_MS, WATCH_SHARE, WAY_BACK_SHARE, WEBRTC_GUARD, WELL_KNOWN_PATH, WRITE_FIRST_MS, WakeLimiter, WebPushError, X401_CREDENTIAL_LIMITS, X401_DCQL_LIMITS, X401_HEADERS, X401_LIMITS, X401_PROTOCOLS, X401_REQUEST_LIMITS, X401_RESPONSE_MODES, X401_SCHEME, X401_VERSION, addedAppPermissions, allowingViewerGuard, answersOffer, appCardId, appCardUrl, appCloseFrame, appDataBytes, appDataFrame, appDigest, appFingerprint, appOpenFrame, appRangeCancelFrame, appRangeChunk, appRangeDataFrame, appRangeEndFrame, appRangeErrorFrame, appRangeGetFrame, appRef, appRefPublisher, appRevocationFor, appRevocationId, appSignedBytes, appStoreDecision, appUpdateDecision, appViewOf, applyIdentityEvent, arkAddressPrefix, arrivalKey, asWritten, assembleAppBundle, assertTokenUnits, assertWholeSats, atprotoCidFor, atprotoDidMethod, atprotoProofRecord, atprotoProofRkey, audioMetadataPatches, automaticTransport, baseMime, beaconKeys, beaconRecords, bip322MessageHash, bip322ToSign, bip322ToSpend, boundIdentityDisplay, boundVerifiedIdentity, budgetRetryMs, buildAppBundle, buildDataSdp, buildLinkRecords, buildSdpFromSignal, buildX401ProofRequest, buildX401ProofResult, buildX401ResultArtifact, buildX401TokenObject, buttonLabelClash, bytesEqual, callRtcConfig, callSignalHeardAt, canonicalJson, canonicalJsonBytes, canonicalUrl, capsDescriptors, cardEditNumber, cardLine, cardLinkHost, cardTimeUtc, cardUrl, carryMentions, cashuRequestPayload, chainPieces, chatAppId, checkAppBeforeRun, checkAppListing, checkAppManifest, checkAppRevokeStatement, checkAppStoreIndex, checkAtprotoProofRecord, checkDidJws, checkDidSignature, checkPushEndpoint, checkStatusCard, checkedDescriptors, claimedTime, classifyTurnRead, clearMissed, clockOffset, commitHash, commitUntaggedHash, communityCommitHash, communityEditFrame, communityGroupId, communityHasFrame, communityMessageAuthor, communityMessageId, communityRoster, communityUntaggedHash, compactSize, compareVersions, compressSdp, concatBytes, confirmationMatches, confirmationTag, contactAskerFrame, contactAskerHolds, contactDay, contactRtcConfig, countUnusedInvite, createChatInvite, createContactLink, createDeviceInvite, createIdentity, createLink, createRelayPayload, currentRelays, decodeAnyBitcoinAddress, decodeAppRangeData, decodeAtprotoCommit, decodeBase64, decodeBitcoinAddress, decodeBolt11, decodeChunk, decodeCommunityLink, decodeControl, decodeDagCbor, decodeDidDhtPacket, decodeDnsAnswers, decodeDnsResponse, decodeFileData, decodeGroupEntryLink, decodeInviteCode, decodeServices, decodeSvcbRecords, decodeTx, decodeTxtPacket, decodeWitness, decodeX401Header, decompressSdp, decrypt, decryptPushPayload, decryptText, derivedSecret, deviceEchoFrame, deviceEchoNonce, deviceFrameCapability, deviceInviteJoinerKeyZ32, deviceInviteJoinerParams, deviceKeyZ32, deviceLinkPairing, deviceLinkParams, deviceLinkRendezvousSeed, deviceLinkSealKey, deviceLinkSecret, devicePingFrame, deviceWakeRequest, dhtEditId, dhtFileElements, dhtFileId, dialDescriptors, dialableIrohRelay, didDhtDocument, didDhtFromPublicKey, didDhtKey, didDhtRecords, didGhostlyServiceEntry, didJwsAlg, didSignedMessages, didWebDocumentUrl, didWebFile, didWebFileNames, didWebFileUrl, didWebHost, directBlocked, dnsProofName, domainTxtRecord, domainWellKnownFile, doorHubs, downsamplePeaks, dropLoneJoiners, edgeParams, editFrame, editedFrame, emptyCapsState, emptyDhtDeliveryState, emptyIdentityLedger, emptyLinkRecords, emptyProofLedger, emptyRatchetState, encodeAppRangeData, encodeChunk, encodeCommunityLink, encodeContactLink, encodeControl, encodeDagCbor, encodeDeviceInvite, encodeDidDhtDeactivated, encodeDidDhtPacket, encodeDnsQuery, encodeFileData, encodeGhostlyInvite, encodeGroupEntryLink, encodeGroupMetaBody, encodeInviteCode, encodePacketTransports, encodeServices, encodeSetSlots, encodeSvcbPacket, encodeTurnFields, encodeTx, encodeTxtPacket, encodeWitness, encodeX401Header, encrypt, encryptPushPayload, encryptText, endedRequests, engineError, engineText, enrollCancelFrame, enrollCancelReason, enrollDigits, enrollDoneFrame, enrollGrantFrame, enrollHelloFrame, enrollMessage, enrollProofFrame, entryParams, epochKeys, exifOrientation, expectedRoster, extractParamsFromSdp, extractRtcParams, fedimintRequestPayload, fetchLnurlJson, fetchesByItself, fileMessageText, filePartDigest, filePartName, findAppForbiddenKey, findBolt11, findEndpoint, findInMst, findLightningDestination, firstDeviceSetSecret, formatEnrollDigits, formatFileSize, formatLocalTarget, formatPaymentAmount, formatVideoDuration, formatVoiceDuration, forwardedAgain, forwardedMany, frameBytes, freshHubs, fromBase64, fromBase64Url, fromZ32, generateEncryptionKey, generateVapidKeys, groupCallE2ee, groupCallKey, groupCallModerationBytes, groupCallRequestBytes, groupCallRoom, groupCallSfu, groupDisplayName, groupEntryUrl, groupFileFallback, groupMessageId, groupMetaBody, groupMetaChange, groupMetaNewer, groupMetaPicture, groupMetaTag, groupMetaToHand, groupName, groupReplyAuthor, groupSignalFrame, groupTypingEpoch, groupWakeFrame, groupWakes, guardViewerAnswer, handoffAckFrame, handoffAttemptAllowed, handoffAttemptFailed, handoffAttemptSucceeded, handoffBusyFrame, handoffCancelFrame, handoffContext, handoffContextProof, handoffDataFrame, handoffDigest, handoffDoneFrame, handoffEphemeral, handoffFileMissingFrame, handoffFileRequestFrame, handoffHaveFrames, handoffHelloFrame, handoffManifestFrames, handoffOfferFrame, handoffPakeFrame, handoffReleaseFrame, handoffRequestFrame, handoffRetryAfter, handoffStreamKey, handoffVerifiedFrame, handoffVerifiedMessage, handoffVersions, hasVisible, hash160, heardCallSignal, heardTime, heldBackError, homeserverWebEndpoint, hubRank, identityFromSeed, identityFromSeedB64, identityPresentationBytes, identityRefusal, identityRevocationValue, identityStatement, identityStatementText, imageSize, importedProof, inboxRecord, inviteLink, inviteOwnership, inviteQrSegments, inviteQrText, invoiceCallbackUrl, irohDescriptor, irohRelayUrl, isAppHash, isAppKey, isAppLicense, isAppLine, isAppPath, isAppRef, isAppSignature, isAppUrl, isAppVersion, isAsf, isAtprotoDid, isBitcoinAddress, isCandidateAddress, isChatAppId, isDiscoveryBudgetError, isEmptyLinkPacket, isFederationId, isGlobalIpv4Host, isGroupMessageId, isHandoffPartName, isHoldUrl, isIdentityBinding, isImageMime, isLegacySignature, isNewerVersion, isPlayableAudioType, isPlayableVideoType, isProofAdapter, isPubkyKey, isPubkyProofFolder, isPublicAddress, isRatcheted, isServeId, isSparkAddress, isStrippedPicture, isValidServiceId, isVideoMime, isViewerTag, isWalletNetwork, isX401Protocol, isZ32Key, jpegSize, jwkThumbprint, keepPastGroupMeta, keepsToRelays, keptAtEqualSequence, knockHolds, knockIdentity, knockRecords, knockSlotIdentity, knockSlotOf, knockSlotRecords, lastSharedWithMe, leaveStands, leaveStatement, leaveStatement3, leftStatement, legacyMessageHash, linkEnd, linkRecords, linkStop, linkTail, linksIn, liveStatus, lobbyKeys, lobbyRecords, makeStamp, makeStampPaced, matchX401Dcql, mayBeHub, mayPin, measureRecords, memberAdmissions, mentionedMembers, mentionsBytes, mentionsMember, mergeBeacon, mergeContactKnocks, mergeKnocks, mergeLobby, meshHubs, meshMessageRef, meshRendezvous, newDeviceSetSecret, newEpochSecret, newHandoffId, newMailbox as newHoldMailbox, newIdentityBinding, newInbox, newPubkyProofFolder, newWakeToken, newX401HolderKey, newerHead, newerPacket, nextGroupMetaRevision, nextPinNumber, nextReactionNumber, nextTurnPosition, nip05RootKey, normalizeAtprotoHandle, normalizeDid, normalizeDomain, normalizePubkyKey, normalizeRelayUrl, nostrProofTemplate, offerIsFresh, openDidDhtPayload, openGroupMeta, openGroupTyping, openHandoffPiece, openPair, openRelayPayload, openRequest, openSecret, openTurnValue, ownInviteRefusal, pacer, pairedEditFits, pairedMessageFits, pairedMessageFrame, pairedReplyAuthor, parseAppFrame, parseAppRangeFrame, parseAtprotoCar, parseAtprotoDidDocument, parseAtprotoDidKey, parseAtprotoVerificationKey, parseCallSignal, parseCashuRequestPayload, parseCommunityEdit, parseDid, parseDidDocument, parseDidJws, parseDidSignaturePaste, parseDomainTxt, parseEditFrame, parseEditedFrame, parseEngineError, parseFedimintRequestPayload, parseGroupCommit, parseGroupMetaBody, parseGroupMetaFrame, parseGroupMetaStatement, parseGroupMetaTag, parseGroupWakeFrame, parseHubPolicy, parseImageMeta, parseInvoiceCallback, parseLightningDestination, parseLinkPreview, parseLinkRecords, parseLocalTarget, parsePacketTransports, parsePairedCallFrame, parsePayParams, parsePaymentAmount, parsePaymentNetworks, parsePinFrame, parsePinnedFrame, parseReactedFrame, parseReactionFrame, parseRelayPayload, parseRtcSignal, parseSessionCapabilities, parseSshPublicKey, parseSshSignature, parseStatusFrame, parseTypingActivity, parseTypingFrame, parseVideoMeta, parseVoiceMeta, parseWakeFrame, pastedAgain, paymentUri, peekDhtMailbox, personStatus, pickCallCandidates, pickHubs, pickMeshHubs, pinFrame, pinIsNewer, pinNumberHolds, pinnedFrame, plainStatusLine, planAppUpdate, planKnocks, presenceSeenAt, presentX401SdJwtVc, previewImageSize, previewable, proofCapability, proofHash, proofStatement, pubkyHomeserverOf, pubkyProofCapability, pubkyProofFile, pubkyProofPath, publicKeyFromZ32, publishFailure, publishedNowhere, pushRequest, qrText, queueReaction, randomBytes, rankHubs, rankTransports, ratchetHeard, ratchetOn, ratchetOpen, ratchetRoot, ratchetSeal, ratchetSessionOf, ratchetUnknownSession, reactedFrame, reactionEmoji, reactionFrame, reactionIsNewer, readAppBundle, readAppBundleAsync, readAppFrame, readAppListing, readAppRangeFrame, readAppRevocation, readAppRevocationShape, readAppRevocations, readAppSignature, readAppStore, readAppStoreSteps, readAtprotoCid, readBeacon, readBeaconHead, readCanonicalJson, readContactLink, readDeviceInvite, readDhtFile, readDhtReactions, readDnsName, readEnrollGrant, readEnrollHello, readForwarded, readGroupFileMeta, readGroupHave, readGroupSignal, readGroupWant, readGroupWantNo, readHandoffAck, readHandoffBusy, readHandoffCancel, readHandoffData, readHandoffDone, readHandoffFileFrame, readHandoffHave, readHandoffHello, readHandoffManifest, readHandoffPake, readHandoffRelease, readHandoffTurnFrame, readHandoffVerified, readImageMeta, readInviteCode, readKnockSlot, readKnocks, readLinkRecord, readLobby, readManifest, readOwnRelayPayload, readPin, readReaction, readRelayBody, readReply, readSetUpdate, readStatusCard, readTurnBody, readTurnPacket, readWake, readWakePayload, readX401DcqlQuery, readX401OpenId4VpRequest, readX401ProofRequest, readX401ProofRequestHeader, readX401ProofResponse, readX401ProofResponseHeader, readX401ProofResult, readX401ProofResultHeader, readX401SdJwtVc, readingAhead, receivedIdentityStatus, receivedTimestamp, recordingMime, recordsFromTxt, recordsFromWellKnown, recordsName, refusalText, relativizeLocation, relayRequest, relayUrl, relayUrlProblem, relayUrlTooLong, relayedTransports, rememberAlone, removedCardText, repeatedJsonKey, replySnippet, requestLnurlInvoice, requestPlaintextBytes, requestRecords, resolveDidDht, resolveLightningDestination, resolveTargetUrl, revokesIdentity, ringAuthorization, ringClaims, ringEvidence, rosterAdmin, rosterHas, rosterHash, routedCommunityFrame, safeBlobType, sameButtonText, sameSshKey, sameStatusState, sameX401HolderJwk, sanitizeAvatar, sanitizeDisplayText, sanitizeFileName, sanitizeMime, sanitizeNick, sanitizePreviewImage, sanitizeRequestHeaders, sanitizeResponseHeaders, sanitizeStatusText, sanitizeTypingStatus, satsToBtc, sdpHasCandidates, sealGroupTyping, sealHandoffPiece, sealPair, sealSecret, sealTurnBody, sealedLength, seedSigner, seenEntry, sendBody, sentWhole, serviceIdFromName, servicesFromWire, servicesToWire, sessionCapabilitiesFrame, setAckFrame, setAppSignatureFastPath, setLinkTraceSink, setPublicKeyFastPath, setUpdateFrame, setUpdateMessage, settleRequest, sha256Hex, sha256Paced, sha256d, shortAtprotoDid, shortHash, shouldBeHub, shownTime, sign, signAppObject, signAppRevocation, signAppStore, signCommit, signCommunity, signDeviceTransports, signDidDhtPacket, signGroupCallModeration, signGroupCallRequest, signGroupMeta, signIdentityPresentation, signRelayPayload, signTombstone, signTurnBody, signTurnPacket, signTurnRelease, signalHasVideo, signingKeys, sortParts, sortRoster, sparkAddressKind, sparkInvoiceDetails, sparkNetworkOf, sshFingerprint, sshKeyDigestHex, sshSignCommand, stampHolds, staticDidDocument, statusCardBytes, statusCardText, statusFrame, statusState, storageProof, storageProofBody, storageProofPath, strictBase64Url, stripHidden, stripPictureMetadata, symmetricNat, takeRequest, taskProgress, toBase64, toBase64Url, toZ32, traceLink, transferEnded, transferStalled, transportOrder, trimEndOf, tryDecrypt, turnInstance, turnKeys, turnName, turnOff, turnPacket, turnPayloadSequence, turnPutSummary, turnReleaseMessage, turnSequence, turnSignedMessage, turnStatedVerifier, turnVerifierMark, txHash, txtValue, typingActivity, typingFrame, typingKindOf, u32, u64, unsignedCommitBytes, unsignedDeviceTransports, unusedInviteWait, unwrapPasted, uriEnd, usageLeft, utf8Decode, utf8Encode, validDomainRecord, validEditMessage, validEditNumber, validEditText, validExternalKey, validHead, validMentions, validReactionNumber, validRemovalNumber, validRingKey, validatePaymentTarget, vapidAuthorization, vapidKeysMatch, varBytes, verify, verifyAppRevocation, verifyAppSignature, verifyAppStatementBytes, verifyAtprotoRecordProof, verifyAtprotoSignature, verifyBip322, verifyBitcoinMessage, verifyChain, verifyCommit, verifyCommitSignature, verifyCommunityChain, verifyCommunityChainPaced, verifyCommunityCommit, verifyDeviceTransports, verifyEnrollProof, verifyGroupCallModeration, verifyGroupCallRequest, verifyGroupMetaSignature, verifyIdentityPresentation, verifyNostrProof, verifyPeerProof, verifyRingAuthorization, verifyRingEvidence, verifySetUpdate, verifySshSignature, videoMetadataPatches, viewerGuardOffset, viewerResponseHeaders, viewerServicePolicy, viewerTag, voiceDownloadName, voiceFileName, voiceLevel, voiceLevelsOf, voicePeaksOf, waitForIceGathering, wakeFrame, wakePayload, wakeRequest, walletNetworkOf, webCryptoSigner, webLocalFetch, wellKnownUrl, wireHubPolicy, wireMentions, wireReaction, wireReply, withRequestOptions, withViewerPolicy, withoutAudioMetadata, withoutPictureMetadata, withoutVideoMetadata, wrapDataChannel, wrapGroupMeta, x401AnswerableRequests, x401ApprovalDigest, x401HolderJwk, x401VpToken, yieldThread };
41686
42386
 
41687
42387
  //# sourceMappingURL=core.js.map