@ghostlytools/cli 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/{api-I_KbuXHa.js → api-BpQC8dAw.js} +68 -33
  3. package/dist/assets/api-BpQC8dAw.js.map +1 -0
  4. package/dist/assets/{api-Dj1yn0px.js → api-CttDF-S5.js} +2 -2
  5. package/dist/assets/{apiKit-C-_PWZvy.js → apiKit-CSMeHKgo.js} +2 -2
  6. package/dist/assets/{apiKit-C-_PWZvy.js.map → apiKit-CSMeHKgo.js.map} +1 -1
  7. package/dist/assets/{apps-DKIe8VjF.js → apps-DqTyZ40T.js} +2 -2
  8. package/dist/assets/{apps-DKIe8VjF.js.map → apps-DqTyZ40T.js.map} +1 -1
  9. package/dist/assets/{apps-DbEfL_3b.js → apps-DzFMdVt6.js} +1 -1
  10. package/dist/assets/{arkade-k1bdSm70.js → arkade-Cu3TbPxC.js} +2 -2
  11. package/dist/assets/{arkade-k1bdSm70.js.map → arkade-Cu3TbPxC.js.map} +1 -1
  12. package/dist/assets/{backup-Cdd6-HNu.js → backup-CLZOORFC.js} +1 -1
  13. package/dist/assets/{backup-beKfbfNk.js → backup-CyTZhu28.js} +4 -4
  14. package/dist/assets/{backup-beKfbfNk.js.map → backup-CyTZhu28.js.map} +1 -1
  15. package/dist/assets/{buttons-ClI13rdv.js → buttons-Bd9fR31r.js} +173 -20
  16. package/dist/assets/buttons-Bd9fR31r.js.map +1 -0
  17. package/dist/assets/buttons-c4CJnL6i.js +2 -0
  18. package/dist/assets/{envelope-B88yiCQj.js → envelope-CGfUsR1m.js} +2 -2
  19. package/dist/assets/{envelope-B88yiCQj.js.map → envelope-CGfUsR1m.js.map} +1 -1
  20. package/dist/assets/fixedHosts-BiukTsd9.js +24 -0
  21. package/dist/assets/fixedHosts-BiukTsd9.js.map +1 -0
  22. package/dist/assets/{ghostly_iroh_web-CO0onry8.js → ghostly_iroh_web-BzAXJUYH.js} +10 -10
  23. package/dist/assets/{ghostly_iroh_web-CO0onry8.js.map → ghostly_iroh_web-BzAXJUYH.js.map} +1 -1
  24. package/dist/assets/ghostly_iroh_web_bg.wasm +0 -0
  25. package/dist/assets/{groupFiles-DjQc5XXv.js → groupFiles-CeF9nPv9.js} +631 -12
  26. package/dist/assets/groupFiles-CeF9nPv9.js.map +1 -0
  27. package/dist/assets/{host-CNWGB3-j.js → host-CKAehWP6.js} +30 -18
  28. package/dist/assets/host-CKAehWP6.js.map +1 -0
  29. package/dist/assets/hyperdhtRelay-1wzya_0L.js +25 -0
  30. package/dist/assets/hyperdhtRelay-1wzya_0L.js.map +1 -0
  31. package/dist/assets/{hyperdhtRelay-g7eXzf5h.js → hyperdhtRelay-B8Pdykhg.js} +15 -3
  32. package/dist/assets/hyperdhtRelay-B8Pdykhg.js.map +1 -0
  33. package/dist/assets/{irohWeb-Bx8dI4be.js → irohWeb-D6tAPHZa.js} +11 -7
  34. package/dist/assets/{irohWeb-Bx8dI4be.js.map → irohWeb-D6tAPHZa.js.map} +1 -1
  35. package/dist/assets/{main-BRxhBctJ.js → main-BDY-pfpz.js} +17 -17
  36. package/dist/assets/{main-BRxhBctJ.js.map → main-BDY-pfpz.js.map} +1 -1
  37. package/dist/assets/{mainline-CwuS6ngj.js → mainline-3ueXpFQL.js} +2 -2
  38. package/dist/assets/{mainline-CwuS6ngj.js.map → mainline-3ueXpFQL.js.map} +1 -1
  39. package/dist/assets/{networkReason-CIAMieQm.js → networkReason-DhJYOomu.js} +2 -2
  40. package/dist/assets/{networkReason-CIAMieQm.js.map → networkReason-DhJYOomu.js.map} +1 -1
  41. package/dist/assets/{nwc-C9JLJJkL.js → nwc-B1Quqda-.js} +3 -3
  42. package/dist/assets/{nwc-C9JLJJkL.js.map → nwc-B1Quqda-.js.map} +1 -1
  43. package/dist/assets/{nwcProvider-pFMrsUJh.js → nwcProvider-DUB6xO-b.js} +2 -2
  44. package/dist/assets/{nwcProvider-pFMrsUJh.js.map → nwcProvider-DUB6xO-b.js.map} +1 -1
  45. package/dist/assets/ownDid-BfqHJdA6.js +281 -0
  46. package/dist/assets/ownDid-BfqHJdA6.js.map +1 -0
  47. package/dist/assets/{registry-DY2ixQfU.js → registry-CZTmtSws.js} +1 -1
  48. package/dist/assets/{registry-Cks7FA_o.js → registry-DwlTNQjr.js} +5 -246
  49. package/dist/assets/registry-DwlTNQjr.js.map +1 -0
  50. package/dist/assets/{resolve-C4Y2HPqQ.js → resolve-BVwhiYjj.js} +3 -280
  51. package/dist/assets/resolve-BVwhiYjj.js.map +1 -0
  52. package/dist/assets/{server-D9RAmGdm.js → server-Br3XPwFG.js} +365 -107
  53. package/dist/assets/server-Br3XPwFG.js.map +1 -0
  54. package/dist/assets/{src-1RU4TilT.js → src-C4sOH4zH.js} +233 -106
  55. package/dist/assets/src-C4sOH4zH.js.map +1 -0
  56. package/dist/assets/sshForges-CQQomStK.js +253 -0
  57. package/dist/assets/sshForges-CQQomStK.js.map +1 -0
  58. package/dist/assets/{translate-od5GbpvR.js → translate-C2aNyUkR.js} +11 -5
  59. package/dist/assets/translate-C2aNyUkR.js.map +1 -0
  60. package/dist/assets/{usdt-DldXV0MR.js → usdt-CMwatDnQ.js} +3 -3
  61. package/dist/assets/{usdt-DldXV0MR.js.map → usdt-CMwatDnQ.js.map} +1 -1
  62. package/dist/assets/{words-BS2qq_vV.js → words-CqN2KG1r.js} +2 -2
  63. package/dist/assets/{words-BS2qq_vV.js.map → words-CqN2KG1r.js.map} +1 -1
  64. package/dist/ghostly.mjs +1 -1
  65. package/package.json +1 -1
  66. package/dist/assets/api-I_KbuXHa.js.map +0 -1
  67. package/dist/assets/buttons-BO1_7V4L.js +0 -2
  68. package/dist/assets/buttons-ClI13rdv.js.map +0 -1
  69. package/dist/assets/groupFiles-DjQc5XXv.js.map +0 -1
  70. package/dist/assets/host-CNWGB3-j.js.map +0 -1
  71. package/dist/assets/hyperdhtRelay-BT_wRxab.js +0 -21
  72. package/dist/assets/hyperdhtRelay-BT_wRxab.js.map +0 -1
  73. package/dist/assets/hyperdhtRelay-g7eXzf5h.js.map +0 -1
  74. package/dist/assets/registry-Cks7FA_o.js.map +0 -1
  75. package/dist/assets/resolve-C4Y2HPqQ.js.map +0 -1
  76. package/dist/assets/server-D9RAmGdm.js.map +0 -1
  77. package/dist/assets/src-1RU4TilT.js.map +0 -1
  78. package/dist/assets/translate-od5GbpvR.js.map +0 -1
@@ -10146,6 +10146,18 @@ function cardUrl(value) {
10146
10146
  if (url.protocol !== "https:" || !url.hostname || url.username || url.password) return void 0;
10147
10147
  return url.href.length <= STATUS_CARD_LIMITS.url ? url.href : void 0;
10148
10148
  }
10149
+ /**
10150
+ * The link an app card names, sent or read (WISP 405 § An app): a card's link without its query or fragment. A
10151
+ * private file's read token rides in a query, and a card goes to a contact; a bundle is pinned by its digest, not its link.
10152
+ */
10153
+ function appCardUrl(value) {
10154
+ const href = cardUrl(value);
10155
+ if (!href) return void 0;
10156
+ const url = new URL(href);
10157
+ url.search = "";
10158
+ url.hash = "";
10159
+ return url.href;
10160
+ }
10149
10161
  var count = (value, min = 0) => typeof value === "number" && Number.isSafeInteger(value) && value >= min && value <= STATUS_CARD_LIMITS.count ? value : void 0;
10150
10162
  /** A time on a card as a reader keeps it: a positive whole number, never later than `latest`. */
10151
10163
  var time = (value, latest) => typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? Math.min(value, latest) : void 0;
@@ -10255,7 +10267,7 @@ function readStatusCard(raw, now = Date.now()) {
10255
10267
  if (!isAppRef(raw.ref) || id !== appCardId(raw.ref) || !isAppHash(raw.digest) || !appSequence(raw.sequence)) return void 0;
10256
10268
  const title = cardLine(raw.title, STATUS_CARD_LIMITS.appTitle);
10257
10269
  if (!title) return void 0;
10258
- const version = cardLine(raw.version, STATUS_CARD_LIMITS.appVersion), url = cardUrl(raw.url);
10270
+ const version = cardLine(raw.version, STATUS_CARD_LIMITS.appVersion), url = appCardUrl(raw.url);
10259
10271
  return {
10260
10272
  kind: "app",
10261
10273
  id,
@@ -10593,8 +10605,8 @@ function removedCardText(of, title) {
10593
10605
  function statusCardText(card) {
10594
10606
  if (card.kind === "removed") return removedCardText(card.of);
10595
10607
  if (card.kind === "app") {
10596
- const named = `${card.title}${card.version ? ` ${card.version}` : ""}`;
10597
- return [card.opened ? `🧩 Opened ${named} in this chat (Ghostly app)` : `🧩 ${named} (Ghostly app)`, ...card.url ? [card.url] : []].join("\n");
10608
+ const named = `${card.title}${card.version ? ` ${card.version}` : ""}`, url = appCardUrl(card.url);
10609
+ return [card.opened ? `🧩 Opened ${named} in this chat (Ghostly app)` : `🧩 ${named} (Ghostly app)`, ...url ? [url] : []].join("\n");
10598
10610
  }
10599
10611
  if (card.kind === "usage") {
10600
10612
  const left = `${usageLeft(card)}% left${card.window ? ` (${card.window})` : ""}`;
@@ -13281,7 +13293,7 @@ function irohRelayUrl(value, spelling = "dotted") {
13281
13293
  const host = url.hostname, name = host.replace(/\.$/, "");
13282
13294
  if (!name.includes(".") && name !== "localhost") return value;
13283
13295
  if (name.startsWith("[") || /^\d+(\.\d+){3}$/.test(name)) return value;
13284
- const wanted = spelling === "plain" || name === "localhost" ? name : `${name}.`;
13296
+ const wanted = spelling === "dotted" && /(^|\.)iroh\.link$/.test(name) ? `${name}.` : name;
13285
13297
  if (wanted === host) return value;
13286
13298
  url.hostname = wanted;
13287
13299
  return url.href;
@@ -13301,6 +13313,14 @@ function irohDescriptor(descriptor, spelling = "dotted") {
13301
13313
  * as a test relay is (the same rule as the relay settings).
13302
13314
  */
13303
13315
  var RELAY_URL = /^((https|wss):\/\/[^\s]{1,120}|(http|ws):\/\/(127\.0\.0\.1|localhost|\[::1\])(:\d{1,5})?(\/[^\s]{0,100})?)$/;
13316
+ /**
13317
+ * A relay URL with more than its server's address in it: a login, a query or a fragment, which no relay setting takes
13318
+ * (irohWeb.ts `irohRelayProblem`, hyperdhtRelay.ts `hyperdhtRelayProblem`). An older app named its HyperDHT relay as
13319
+ * set, with them; such a descriptor is not dialed or kept, and the rest of what the contact told still is.
13320
+ */
13321
+ var RELAY_WITH_SECRETS = /^[a-z]+:\/\/[^/?#]*@|[?#]/i;
13322
+ /** A relay URL a descriptor may name: `RELAY_URL`, with nothing but the server's address in it. */
13323
+ var relayUrl = (value) => typeof value === "string" && RELAY_URL.test(value) && !RELAY_WITH_SECRETS.test(value);
13304
13324
  var HEX_KEY = /^[0-9a-f]{64}$/;
13305
13325
  /** An Iroh direct address as the adapters parse it: an IPv4 or bracketed IPv6 address and its port. */
13306
13326
  var SOCKET_ADDRESS = /^(\d{1,3}(\.\d{1,3}){3}|\[[0-9A-Fa-f:.]{2,45}(%[A-Za-z0-9._-]{1,16})?\]):\d{1,5}$/;
@@ -13308,7 +13328,7 @@ var MAX_ADDRESSES = 8;
13308
13328
  /**
13309
13329
  * A contact's native descriptors as it tells them on a session (`paired-policy`, `paired-adapters`) or as this app
13310
13330
  * kept them: only what the adapters dial, each field in the shape its adapter makes. The keys are 64 hex characters,
13311
- * a relay passes `RELAY_URL` (the rule its capability record is read by), an Iroh descriptor lists at most eight
13331
+ * a relay passes `relayUrl` (the rule its capability record is read by), an Iroh descriptor lists at most eight
13312
13332
  * socket addresses. A descriptor that is anything else is left out, as one the contact never told; a field this app
13313
13333
  * does not know is not kept.
13314
13334
  */
@@ -13316,17 +13336,16 @@ function checkedDescriptors(value) {
13316
13336
  const out = {};
13317
13337
  if (!value || typeof value !== "object" || Array.isArray(value)) return out;
13318
13338
  const raw = value;
13319
- const relay = (v) => typeof v === "string" && RELAY_URL.test(v);
13320
13339
  const relayed = (v) => v === void 0 || typeof v === "boolean";
13321
13340
  const iroh = raw["iroh/1"];
13322
- if (iroh && typeof iroh === "object" && typeof iroh.id === "string" && HEX_KEY.test(iroh.id) && (iroh.relay === void 0 || iroh.relay === null || relay(iroh.relay)) && relayed(iroh.relayed) && Array.isArray(iroh.addresses) && iroh.addresses.length <= MAX_ADDRESSES && iroh.addresses.every((a) => typeof a === "string" && SOCKET_ADDRESS.test(a))) out["iroh/1"] = {
13341
+ if (iroh && typeof iroh === "object" && typeof iroh.id === "string" && HEX_KEY.test(iroh.id) && (iroh.relay === void 0 || iroh.relay === null || relayUrl(iroh.relay)) && relayed(iroh.relayed) && Array.isArray(iroh.addresses) && iroh.addresses.length <= MAX_ADDRESSES && iroh.addresses.every((a) => typeof a === "string" && SOCKET_ADDRESS.test(a))) out["iroh/1"] = {
13323
13342
  id: iroh.id,
13324
13343
  relay: iroh.relay ?? null,
13325
13344
  addresses: [...iroh.addresses],
13326
13345
  ...iroh.relayed !== void 0 ? { relayed: iroh.relayed } : {}
13327
13346
  };
13328
13347
  const hyper = raw["hyperdht/1"];
13329
- if (hyper && typeof hyper === "object" && typeof hyper.publicKey === "string" && HEX_KEY.test(hyper.publicKey) && (hyper.relay === void 0 || relay(hyper.relay)) && relayed(hyper.relayed)) out["hyperdht/1"] = {
13348
+ if (hyper && typeof hyper === "object" && typeof hyper.publicKey === "string" && HEX_KEY.test(hyper.publicKey) && (hyper.relay === void 0 || relayUrl(hyper.relay)) && relayed(hyper.relayed)) out["hyperdht/1"] = {
13330
13349
  publicKey: hyper.publicKey,
13331
13350
  ...hyper.relay !== void 0 ? { relay: hyper.relay } : {},
13332
13351
  ...hyper.relayed !== void 0 ? { relayed: hyper.relayed } : {}
@@ -15020,12 +15039,12 @@ function capsDescriptors(descriptors) {
15020
15039
  const iroh = descriptors?.["iroh/1"];
15021
15040
  if (iroh && typeof iroh.id === "string" && HEX64$1.test(iroh.id)) out["iroh/1"] = {
15022
15041
  id: hexToKey(iroh.id),
15023
- ...typeof iroh.relay === "string" && RELAY_URL.test(iroh.relay) ? { relay: iroh.relay } : {}
15042
+ ...relayUrl(iroh.relay) ? { relay: iroh.relay } : {}
15024
15043
  };
15025
15044
  const hyper = descriptors?.["hyperdht/1"];
15026
15045
  if (hyper && typeof hyper.publicKey === "string" && HEX64$1.test(hyper.publicKey)) out["hyperdht/1"] = {
15027
15046
  publicKey: hexToKey(hyper.publicKey),
15028
- ...typeof hyper.relay === "string" && RELAY_URL.test(hyper.relay) ? { relay: hyper.relay } : {}
15047
+ ...relayUrl(hyper.relay) ? { relay: hyper.relay } : {}
15029
15048
  };
15030
15049
  return out;
15031
15050
  }
@@ -15059,16 +15078,17 @@ function parseDescriptors(value) {
15059
15078
  const raw = value;
15060
15079
  const out = {};
15061
15080
  const iroh = raw["iroh/1"], hyper = raw["hyperdht/1"];
15081
+ const withSecrets = (relay) => typeof relay === "string" && RELAY_WITH_SECRETS.test(relay);
15062
15082
  if (iroh !== void 0) {
15063
15083
  if (!iroh || typeof iroh.id !== "string" || !KEY.test(iroh.id) || iroh.relay !== void 0 && (typeof iroh.relay !== "string" || !RELAY_URL.test(iroh.relay))) return null;
15064
- out["iroh/1"] = {
15084
+ if (!withSecrets(iroh.relay)) out["iroh/1"] = {
15065
15085
  id: iroh.id,
15066
15086
  ...iroh.relay !== void 0 ? { relay: iroh.relay } : {}
15067
15087
  };
15068
15088
  }
15069
15089
  if (hyper !== void 0) {
15070
15090
  if (!hyper || typeof hyper.publicKey !== "string" || !KEY.test(hyper.publicKey) || hyper.relay !== void 0 && (typeof hyper.relay !== "string" || !RELAY_URL.test(hyper.relay))) return null;
15071
- out["hyperdht/1"] = {
15091
+ if (!withSecrets(hyper.relay)) out["hyperdht/1"] = {
15072
15092
  publicKey: hyper.publicKey,
15073
15093
  ...hyper.relay !== void 0 ? { relay: hyper.relay } : {}
15074
15094
  };
@@ -18185,8 +18205,20 @@ var FILE_LIMITS = {
18185
18205
  stallMs: 6e4,
18186
18206
  /** A receiver makes what it stored durable, and records the point to resume from, this often. */
18187
18207
  checkpointBytes: 8388608,
18188
- /** A receiver confirms at least this often while writing. */
18208
+ /**
18209
+ * A receiver confirms at least this often while writing, and the file's last bytes at once. Its writes are buffered
18210
+ * and done at once, so confirming whenever they were all done too was confirming nearly every chunk: 6,400 confirms for
18211
+ * 100 MiB, each a native call and a progress update on both sides. A host that batches them (`batchConfirms`) does not.
18212
+ */
18189
18213
  ackEveryBytes: 131072,
18214
+ /**
18215
+ * Batched (`ChatFilesHost.batchConfirms`), bytes stored and not confirmed are confirmed this long after the first of
18216
+ * them was stored, at most. What a sender has in flight may be no more than `ackEveryBytes` (a window at its floor, one
18217
+ * chunk while the path is measured), and bytes waiting here for a confirm are bytes it cannot send: on a slow or
18218
+ * wavering path a confirm comes about every this long, as fast as the window needs. A round trip it measures is up to
18219
+ * this much longer, well inside the queue it allows (`queueMs`).
18220
+ */
18221
+ ackWaitMs: 10,
18190
18222
  /** A sender reads its file this much at a time. */
18191
18223
  readBytes: 1048576,
18192
18224
  /** The session refused a data frame (its send budget was full): the sender looks again after this long. */
@@ -18516,6 +18548,13 @@ var ChatFiles = class {
18516
18548
  peerRoomValue = null;
18517
18549
  /** What the chat's files may have in flight, sized by the path. */
18518
18550
  pace = new FilePace();
18551
+ /**
18552
+ * What the chat's files had in flight just before the last confirm. A receiver confirms many chunks at once
18553
+ * (`ackEveryBytes`), and the chunks sent for them go with that much in flight, the window: counted one by one, the
18554
+ * first went with the window less a confirm, and read as a path carrying that little, it shrank the window and ended
18555
+ * every trial of a larger one (a fifth of the rate on a wavering path). Confirmed chunk by chunk, it is what each sends with.
18556
+ */
18557
+ refill = 0;
18519
18558
  constructor(host) {
18520
18559
  this.host = host;
18521
18560
  }
@@ -18600,6 +18639,7 @@ var ChatFiles = class {
18600
18639
  this.attached = true;
18601
18640
  this.peerRoomValue = null;
18602
18641
  this.pace.reset();
18642
+ this.refill = 0;
18603
18643
  this.host.uplink?.join(this);
18604
18644
  this.sayRoom();
18605
18645
  this.sweep();
@@ -18635,7 +18675,11 @@ var ChatFiles = class {
18635
18675
  clearTimeout(entry.out.wake);
18636
18676
  entry.out.next = entry.record.confirmed;
18637
18677
  }
18638
- if (entry.in) clearTimeout(entry.in.timer);
18678
+ if (entry.in) {
18679
+ clearTimeout(entry.in.timer);
18680
+ clearTimeout(entry.in.ackTimer);
18681
+ entry.in.ackTimer = void 0;
18682
+ }
18639
18683
  if (entry.in && !transferEnded(entry.record)) this.checkpoint(entry);
18640
18684
  }
18641
18685
  }
@@ -18829,7 +18873,7 @@ var ChatFiles = class {
18829
18873
  out.sends.push({
18830
18874
  end: out.next,
18831
18875
  at: this.now(),
18832
- flight: this.inFlight(),
18876
+ flight: Math.max(this.inFlight(), Math.min(this.refill, this.pace.limit(this.floor()))),
18833
18877
  generation
18834
18878
  });
18835
18879
  }
@@ -19178,6 +19222,7 @@ var ChatFiles = class {
19178
19222
  /** An agreed file that ended here, offered again: taken again from the start. */
19179
19223
  async retake(entry) {
19180
19224
  await entry.in?.target?.then((t) => t.discard()).catch(() => {});
19225
+ clearTimeout(entry.in?.ackTimer);
19181
19226
  entry.in = {
19182
19227
  written: 0,
19183
19228
  stored: 0,
@@ -19230,15 +19275,8 @@ var ChatFiles = class {
19230
19275
  if (transferEnded(record) || incoming.dropped) return;
19231
19276
  await (await target).append(bytes);
19232
19277
  incoming.stored = offset + bytes.length;
19233
- if (incoming.stored === incoming.written || incoming.stored - incoming.acked >= FILE_LIMITS.ackEveryBytes) {
19234
- incoming.acked = incoming.stored;
19235
- this.send({
19236
- t: "pf-got",
19237
- id: record.id,
19238
- offset: incoming.stored
19239
- });
19240
- this.changed(entry, true);
19241
- }
19278
+ if (incoming.stored - incoming.acked >= FILE_LIMITS.ackEveryBytes || incoming.stored === record.file.size || !this.host.batchConfirms && incoming.stored === incoming.written) this.confirm(entry);
19279
+ else if (this.host.batchConfirms) incoming.ackTimer ??= setTimeout(() => this.confirm(entry), FILE_LIMITS.ackWaitMs);
19242
19280
  if (incoming.stored - incoming.checkpointed >= FILE_LIMITS.checkpointBytes) await this.checkpointNow(entry);
19243
19281
  }).catch((error) => {
19244
19282
  if (transferEnded(record)) return;
@@ -19252,6 +19290,20 @@ var ChatFiles = class {
19252
19290
  this.startNext();
19253
19291
  });
19254
19292
  }
19293
+ /** `pf-got` for what is stored and not confirmed yet. */
19294
+ confirm(entry) {
19295
+ const { record } = entry, incoming = entry.in;
19296
+ clearTimeout(incoming.ackTimer);
19297
+ incoming.ackTimer = void 0;
19298
+ if (transferEnded(record) || incoming.stored <= incoming.acked) return;
19299
+ incoming.acked = incoming.stored;
19300
+ this.send({
19301
+ t: "pf-got",
19302
+ id: record.id,
19303
+ offset: incoming.stored
19304
+ });
19305
+ this.changed(entry, true);
19306
+ }
19255
19307
  /** What was stored is durable, and a restart resumes from there. */
19256
19308
  async checkpoint(entry) {
19257
19309
  if (!entry.in?.target) return;
@@ -19417,6 +19469,7 @@ var ChatFiles = class {
19417
19469
  out.generation++;
19418
19470
  record.confirmed = frame.offset;
19419
19471
  out.next = frame.offset;
19472
+ this.refill = 0;
19420
19473
  record.state = "active";
19421
19474
  record.pausedBy = record.waitingFor = void 0;
19422
19475
  this.changed(outgoing);
@@ -19444,6 +19497,7 @@ var ChatFiles = class {
19444
19497
  return;
19445
19498
  case "pf-got": {
19446
19499
  if (!isInt$1(frame.offset) || frame.offset <= record.confirmed || frame.offset > out.next) return;
19500
+ this.refill = this.inFlight();
19447
19501
  this.pace.delivered += frame.offset - record.confirmed;
19448
19502
  record.confirmed = frame.offset;
19449
19503
  let sample;
@@ -19488,6 +19542,8 @@ var ChatFiles = class {
19488
19542
  if (entry.in) {
19489
19543
  const incoming = entry.in;
19490
19544
  clearTimeout(incoming.timer);
19545
+ clearTimeout(incoming.ackTimer);
19546
+ incoming.ackTimer = void 0;
19491
19547
  incoming.writing.finally(() => {
19492
19548
  if (transferEnded(record)) incoming.target = void 0;
19493
19549
  });
@@ -20212,6 +20268,8 @@ var CarriedTransport = class {
20212
20268
  seen = -1n;
20213
20269
  /** A read under way: resolved when a carried packet comes meanwhile. */
20214
20270
  waiting = null;
20271
+ /** The records of a publish refused before they were signed, while nobody could carry them: signed when one can (`latest`). */
20272
+ unsigned = null;
20215
20273
  /** The packet the relays have not got yet. */
20216
20274
  pending = null;
20217
20275
  /** How many carried packets of the member's came: a deferral that ends with none more says no member reaches it. */
@@ -20244,6 +20302,7 @@ var CarriedTransport = class {
20244
20302
  async publish(identity, records, options) {
20245
20303
  if (this.stopped || identity.pubKeyZ32 !== this.myKey) return this.inner.publish(identity, records, options);
20246
20304
  this.drop();
20305
+ this.unsigned = null;
20247
20306
  if (this.hooks.open()) {
20248
20307
  const relayOptions = options?.signal ? options : {
20249
20308
  ...options,
@@ -20257,6 +20316,16 @@ var CarriedTransport = class {
20257
20316
  if (this.hooks.direct && this.inner.publishPayload) published.then(() => this.handDirect(payload), () => {});
20258
20317
  return published;
20259
20318
  }
20319
+ if (this.hooks.canCarry && !this.hooks.canCarry()) {
20320
+ const held = this.inner.publishHeld?.(identity.pubKeyZ32, options);
20321
+ if (held) {
20322
+ this.unsigned = {
20323
+ identity,
20324
+ records
20325
+ };
20326
+ throw held;
20327
+ }
20328
+ }
20260
20329
  const payload = this.newest = this.stamp(identity, records);
20261
20330
  this.mine = payload;
20262
20331
  let carried = {
@@ -20423,13 +20492,20 @@ var CarriedTransport = class {
20423
20492
  }
20424
20493
  /** My newest packet for this edge while it is down, for a member that can pass it on now; null once it is up. */
20425
20494
  latest() {
20426
- return this.stopped || this.hooks.open() ? null : this.mine;
20495
+ if (this.stopped || this.hooks.open()) return null;
20496
+ if (this.unsigned) {
20497
+ const { identity, records } = this.unsigned;
20498
+ this.unsigned = null;
20499
+ this.mine = this.newest = this.stamp(identity, records);
20500
+ }
20501
+ return this.mine;
20427
20502
  }
20428
20503
  /** The edge is going: nothing more is deferred or carried, and a last packet goes straight to the relays. */
20429
20504
  stop() {
20430
20505
  this.stopped = true;
20431
20506
  this.drop();
20432
20507
  this.mine = null;
20508
+ this.unsigned = null;
20433
20509
  const waiting = this.waiting;
20434
20510
  this.waiting = null;
20435
20511
  waiting?.();
@@ -22640,6 +22716,9 @@ var GhostLink = class {
22640
22716
  this.advertiseTransports();
22641
22717
  this.options.events?.onTransportsChanged?.();
22642
22718
  };
22719
+ endpoint.onRelayBack = () => {
22720
+ if (this.endpoints.get(endpoint.transport) === endpoint) this.knockAgain(endpoint.transport);
22721
+ };
22643
22722
  this.advertiseTransports();
22644
22723
  if (this.resuming === endpoint.transport) this.knock(endpoint.transport);
22645
22724
  else this.joinRace(endpoint.transport);
@@ -22817,6 +22896,11 @@ var GhostLink = class {
22817
22896
  if (!this.transportOffer().includes(transport)) return;
22818
22897
  const epoch = this.connectionEpoch;
22819
22898
  this.dialing = true;
22899
+ const knocking = this.knocking = {
22900
+ transport,
22901
+ epoch,
22902
+ again: false
22903
+ };
22820
22904
  traceLink(this.myPubKeyZ32, "knock", { transport });
22821
22905
  try {
22822
22906
  const { channel, binding } = await endpoint.connect(descriptor);
@@ -22831,6 +22915,7 @@ var GhostLink = class {
22831
22915
  error: error instanceof Error ? error.message : String(error)
22832
22916
  });
22833
22917
  } finally {
22918
+ if (this.knocking === knocking) this.knocking = null;
22834
22919
  if (epoch === this.connectionEpoch) {
22835
22920
  this.dialing = false;
22836
22921
  this.settleCrossed();
@@ -22838,6 +22923,36 @@ var GhostLink = class {
22838
22923
  }
22839
22924
  if (!this.channel) this.maybeAutoConnect(this.presence);
22840
22925
  }
22926
+ /** The knock under way (`knock`): its transport, its attempt, and whether it was knocked again (`knockAgain`). */
22927
+ knocking = null;
22928
+ /**
22929
+ * The endpoint of a knock still under way is back on its relay (`NativeEndpoint.onRelayBack`): it is knocked again, once,
22930
+ * beside the first, and the first live wins. An Android phone back from Doze knocked at once through an Iroh whose relay
22931
+ * was gone; Iroh found it again only seconds later (its reconnect backoff, up to 16 s), and what the knock sent meanwhile
22932
+ * went nowhere: QUIC sends it again seconds on, and the dial is given 20 s. Live again 4.4 s and 9.8 s after the
22933
+ * return (away 5 and 15 minutes), and once not over Iroh at all (the emulator with a CLI bot, 2026-11-01).
22934
+ */
22935
+ async knockAgain(transport) {
22936
+ const knocking = this.knocking;
22937
+ if (!knocking || knocking.transport !== transport || knocking.again || knocking.epoch !== this.connectionEpoch) return;
22938
+ const endpoint = this.endpoints.get(transport), descriptor = this.peerDescriptors[transport];
22939
+ if (!endpoint || !descriptor || this.channel || this.stopped || this.streamBlocked || this.keyStopped) return;
22940
+ knocking.again = true;
22941
+ traceLink(this.myPubKeyZ32, "knock-again", { transport });
22942
+ try {
22943
+ const { channel, binding } = await endpoint.connect(descriptor);
22944
+ if (this.stopped || knocking.epoch !== this.connectionEpoch || this.channel) {
22945
+ channel.close();
22946
+ return;
22947
+ }
22948
+ this.attach(channel, binding);
22949
+ } catch (error) {
22950
+ traceLink(this.myPubKeyZ32, "knock-again-failed", {
22951
+ transport,
22952
+ error: error instanceof Error ? error.message : String(error)
22953
+ });
22954
+ }
22955
+ }
22841
22956
  canReleaseEndpoint(transport) {
22842
22957
  return this.activeBinding?.transport !== transport && this.candidate?.binding?.transport !== transport && !this.dialing && !this.switcher.pending && !this.transitionTarget;
22843
22958
  }
@@ -30330,16 +30445,10 @@ var GroupSession = class {
30330
30445
  /** Set while a save of what received messages changed is due (`persistSoon`). */
30331
30446
  saveTimer;
30332
30447
  /**
30333
- * The frames of members who left that each member was handed (`frameKey`), so an app that does not take them (from
30334
- * before revision 2026-10-13, and never marks them seen) is not handed them again at every sync. In memory only.
30448
+ * The removals of authors out of the roster that each member was handed (`editKey`), so an app that does not take
30449
+ * them is not handed them again at every sync. In memory only.
30335
30450
  */
30336
30451
  leaversHanded = /* @__PURE__ */ new Map();
30337
- /**
30338
- * The frames a commit took out of the logs (`pruneRelay`), newest last, and whether the app holds them with its
30339
- * messages: a removal's `left` mark can come after its commit, and what the leaver wrote is then kept again
30340
- * (`unprune`). In memory only: started again, the app's rows bring theirs back.
30341
- */
30342
- pruned = [];
30343
30452
  /** Syncs answered per member, a few a minute (`GROUP_LIMITS.syncAnswers`). In memory only. */
30344
30453
  syncsAnswered = /* @__PURE__ */ new Map();
30345
30454
  /**
@@ -30353,6 +30462,8 @@ var GroupSession = class {
30353
30462
  * message written just now. Each frame of the answer keeps it open: it goes a slice at a time. In memory only.
30354
30463
  */
30355
30464
  answering = /* @__PURE__ */ new Map();
30465
+ /** Per member ahead of me: the epoch its last sync said, up to which its answer to mine brings the chain. In memory only. */
30466
+ syncedEpoch = /* @__PURE__ */ new Map();
30356
30467
  /** Catch-up answers still going out, a slice at a time (`handOut`). */
30357
30468
  answers;
30358
30469
  /**
@@ -30375,20 +30486,20 @@ var GroupSession = class {
30375
30486
  if (onRows) {
30376
30487
  const held = new Set(onRows.map(frameKey$1));
30377
30488
  if (state.relay?.length) state.relay = state.relay.filter((f) => !held.has(frameKey$1(f)));
30378
- this.onRows = state.status === "active" ? onRows.filter((f) => this.handsOn(f.s, f.e)) : [];
30489
+ this.onRows = state.status === "active" ? onRows.filter((f) => this.handsOn(f.s)) : [];
30379
30490
  this.trimRelay();
30380
30491
  }
30381
30492
  this.answers = new CatchUpAnswers({
30382
30493
  send: (to, frame) => {
30383
- if ((frame.t === "group-msg" || frame.t === "group-edit") && !rosterHas(this.roster, frame.s)) {
30494
+ if (frame.t === "group-edit" && !rosterHas(this.roster, frame.s)) {
30384
30495
  const handed = this.leaversHanded.get(to) ?? /* @__PURE__ */ new Set();
30385
- this.leaversHanded.set(to, handed.add(frame.t === "group-edit" ? editKey(frame) : frameKey$1(frame)));
30496
+ this.leaversHanded.set(to, handed.add(editKey(frame)));
30386
30497
  }
30387
30498
  return hooks.send(to, frame);
30388
30499
  },
30389
30500
  ...hooks.handled && { handled: (to) => hooks.handled(to) },
30390
30501
  active: () => this.state.status === "active",
30391
- key: (frame) => frame.t === "group-msg" ? frameKey$1(frame) : void 0
30502
+ key: (frame) => frame.t === "group-msg" ? frameKey$1(frame) : frame.t === "group-commit" ? `commit:${frame.commit.e}` : void 0
30392
30503
  });
30393
30504
  this.provisional = new Set((state.provisional ?? []).slice(-GROUP_LIMITS.provisional));
30394
30505
  this.chainMovedAt = this.clock();
@@ -30677,8 +30788,9 @@ var GroupSession = class {
30677
30788
  return this.hooks.save(structuredClone(this.state));
30678
30789
  }
30679
30790
  /**
30680
- * A save within `GROUP_LIMITS.saveWithinMs`, for what a received message changes (what was seen, what is kept to hand
30681
- * on): the state holds the whole hand-on log, and a member back in a busy group wrote all of it once per message.
30791
+ * A save within `GROUP_LIMITS.saveWithinMs`, for what a received message, commit or secret changes (what was seen,
30792
+ * what is kept to hand on, the chain): the state holds the whole hand-on log and chain, and a member back in a busy
30793
+ * group wrote all of it once per message, and once per commit.
30682
30794
  * The message itself is stored before (`hooks.message`). An app killed before the save takes those frames again when
30683
30795
  * it syncs: its store has the messages already, and the state then catches up.
30684
30796
  */
@@ -30786,7 +30898,7 @@ var GroupSession = class {
30786
30898
  }
30787
30899
  transferAdmin(memberKey, now = Date.now()) {
30788
30900
  return this.serialize(async () => {
30789
- this.requireAdmin();
30901
+ this.requireAdmin("Only the admin can hand the admin role over");
30790
30902
  if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey) throw new Error("Not a member");
30791
30903
  await this.commit("role", memberKey, now);
30792
30904
  });
@@ -30847,18 +30959,10 @@ var GroupSession = class {
30847
30959
  this.hooks.changed();
30848
30960
  return { secret };
30849
30961
  }
30850
- /**
30851
- * Someone removed is not handed on any more, whatever they sent while in the roster; one who left still is, for the
30852
- * epochs before its leave (WISP 902 § Catch-up).
30853
- */
30962
+ /** Someone removed or gone is not handed on any more, whatever they sent while in the roster (WISP 902 § Catch-up). */
30854
30963
  pruneRelay() {
30855
- const prune = (log, row) => log.filter((f) => this.handsOn(f.s, f.e) || (this.pruned.push({
30856
- frame: f,
30857
- row
30858
- }), false));
30859
- if (this.state.relay?.length) this.state.relay = prune(this.state.relay, false);
30860
- if (this.onRows?.length) this.onRows = prune(this.onRows, true);
30861
- this.pruned.splice(0, this.pruned.length - GROUP_LIMITS.relay);
30964
+ if (this.state.relay?.length) this.state.relay = this.state.relay.filter((f) => this.handsOn(f.s));
30965
+ if (this.onRows?.length) this.onRows = this.onRows.filter((f) => this.handsOn(f.s));
30862
30966
  if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s) || this.isRemovalEdit(f));
30863
30967
  }
30864
30968
  /** Whether a kept edit is a removal (WISP 400 § Delete for everyone): its box, under its epoch's key, says `rm`. */
@@ -30872,18 +30976,6 @@ var GroupSession = class {
30872
30976
  return false;
30873
30977
  }
30874
30978
  }
30875
- /** The frames `pruneRelay` dropped that are handed on again now (a removal's `left` mark came after it), back in their logs. */
30876
- unprune() {
30877
- const back = this.pruned.filter((p) => this.handsOn(p.frame.s, p.frame.e));
30878
- if (!back.length) return;
30879
- this.pruned = this.pruned.filter((p) => !back.includes(p));
30880
- for (const { frame, row } of back) {
30881
- const log = row && this.onRows ? this.onRows : this.state.relay ??= [];
30882
- const at = log.findIndex((f) => f.ts > frame.ts);
30883
- log.splice(at < 0 ? log.length : at, 0, frame);
30884
- }
30885
- this.trimRelay();
30886
- }
30887
30979
  /** Another member's edit, kept to hand on: the latest per message; the oldest go once the log is full. False: one as new was kept. */
30888
30980
  keepEdit(frame) {
30889
30981
  const same = (f) => f.s === frame.s && f.e === frame.e && f.n === frame.n;
@@ -30948,7 +31040,6 @@ var GroupSession = class {
30948
31040
  this.state.sent = [];
30949
31041
  this.state.relay = [];
30950
31042
  if (this.onRows) this.onRows = [];
30951
- this.pruned = [];
30952
31043
  this.state.relayEdits = [];
30953
31044
  this.state.alone = [];
30954
31045
  this.waiting = [];
@@ -31451,8 +31542,8 @@ var GroupSession = class {
31451
31542
  }
31452
31543
  /**
31453
31544
  * A message, from its author's edge or handed on by another member. Handed on, it is taken only while both are in
31454
- * the roster (someone removed is neither heard from nor handed on, #300), or from a member in it when its author left
31455
- * after it (`handsOn`), and its boxes only with the author's `xs`.
31545
+ * the roster (someone removed or gone is neither heard from nor handed on, #300, `handsOn`), and its boxes only with
31546
+ * the author's `xs`.
31456
31547
  */
31457
31548
  async receiveMessage(from, raw, waited = false) {
31458
31549
  if (!isMessageFrame$1(raw)) return;
@@ -31463,7 +31554,7 @@ var GroupSession = class {
31463
31554
  const relayed = raw.s !== from;
31464
31555
  const now = this.now(), answer = (this.answering.get(from) ?? 0) > now;
31465
31556
  if (answer) this.answering.set(from, now + ANSWER_WINDOW_MS);
31466
- if (relayed && (!rosterHas(this.roster, from) || !this.handsOn(raw.s, raw.e))) return;
31557
+ if (relayed && (!rosterHas(this.roster, from) || !this.handsOn(raw.s))) return;
31467
31558
  if (this.isDuplicate(raw)) return;
31468
31559
  const signedWhole = relayed && this.wholeSigned(raw);
31469
31560
  if (!signedWhole && !verify(fromBase64Url(raw.sig), messageSigned$1(raw), publicKeyFromZ32(raw.s))) return;
@@ -31514,7 +31605,7 @@ var GroupSession = class {
31514
31605
  this.markSeen(raw);
31515
31606
  this.keep(clean(raw));
31516
31607
  this.persistSoon();
31517
- if (this.handsOn(raw.s, raw.e)) this.took(clean(raw));
31608
+ if (this.handsOn(raw.s)) this.took(clean(raw));
31518
31609
  return;
31519
31610
  }
31520
31611
  const id = first && !this.provisional.has(own) ? groupMessageId(raw.s, first.e, first.n) : own;
@@ -31552,7 +31643,7 @@ var GroupSession = class {
31552
31643
  if (firstFrame && rosterHas(this.state.chain[firstFrame.e]?.m ?? [], this.myKey)) this.markSeen(firstFrame);
31553
31644
  this.keep(clean(raw));
31554
31645
  this.persistSoon();
31555
- if (this.handsOn(raw.s, raw.e)) this.took(clean(raw));
31646
+ if (this.handsOn(raw.s)) this.took(clean(raw));
31556
31647
  }
31557
31648
  /**
31558
31649
  * An edit of a member's own message, from its author's edge or handed on by another member: believed only while its
@@ -31732,6 +31823,14 @@ var GroupSession = class {
31732
31823
  this.asked.set(from, now);
31733
31824
  this.hooks.send(from, this.syncFrame([], from));
31734
31825
  }
31826
+ /**
31827
+ * Whether my sync to `from` (the one my edge opened with) still waits for its answer, which has the chain from the
31828
+ * epoch it said: asking again on reading its newer sync, or a commit of that answer, had each commit I missed sent
31829
+ * twice, each with a secret sealed again (200 missed went as 400 frames, 1,456 when answers go a slice at a time).
31830
+ */
31831
+ awaitsAnswer(from) {
31832
+ return (this.answering.get(from) ?? 0) > this.now();
31833
+ }
31735
31834
  async replayWaiting() {
31736
31835
  await this.metaFollowsChain();
31737
31836
  const ready = this.waiting.filter((w) => w.frame.e <= this.epoch && !!this.state.secrets[w.frame.e]);
@@ -31746,15 +31845,13 @@ var GroupSession = class {
31746
31845
  const raw = frame.commit;
31747
31846
  if (!raw || typeof raw !== "object" || !Number.isSafeInteger(raw.e)) return;
31748
31847
  const e = raw.e;
31848
+ if (this.awaitsAnswer(from)) this.answering.set(from, this.now() + ANSWER_WINDOW_MS);
31749
31849
  if (e <= this.epoch) {
31750
31850
  const known = this.state.chain[e];
31751
31851
  const result = verifyCommit(raw, this.state.chain[e - 1] ?? null, this.id);
31752
31852
  if ("error" in result || result.commit.by !== known.by || result.commit.by !== this.admin) return;
31753
31853
  if (commitHash(result.commit) !== commitHash(known)) await this.fork(`Member ${from.slice(0, 8)} holds a different membership history for epoch ${e}`);
31754
- else if (this.takeLeftMark(known, frame.left)) {
31755
- this.unprune();
31756
- await this.persist();
31757
- }
31854
+ else if (this.takeLeftMark(known, frame.left)) await this.persist();
31758
31855
  return;
31759
31856
  }
31760
31857
  if (e > this.epoch + 1) {
@@ -31776,7 +31873,7 @@ var GroupSession = class {
31776
31873
  commit: result.commit,
31777
31874
  ...mark ? { left: mark } : {}
31778
31875
  });
31779
- if (this.state.status === "active" && !this.state.secrets[this.epoch]) this.ask(from);
31876
+ if (this.state.status === "active" && !this.state.secrets[this.epoch] && !(this.awaitsAnswer(from) && this.epoch < (this.syncedEpoch.get(from) ?? 0))) this.ask(from);
31780
31877
  const next = this.pendingCommits.get(this.epoch + 1);
31781
31878
  if (next) {
31782
31879
  this.pendingCommits.delete(this.epoch + 1);
@@ -31784,21 +31881,12 @@ var GroupSession = class {
31784
31881
  }
31785
31882
  }
31786
31883
  /**
31787
- * Whether a frame of `author` under `epoch` is taken from another member, kept and handed on: while its author is in
31788
- * the roster, or when it left (its removal marked `left`, and it is not back in) and the frame is from before that,
31789
- * and from after any removal of it before that was not a leave: let back in, it is not handed on for those epochs.
31884
+ * Whether a frame of `author` is taken from another member, kept and handed on: only while its author is in the
31885
+ * roster. One who left, as one removed, keeps its seed and the secrets of its epochs, and a copy of its state signs
31886
+ * frames for them after the leave, dated as it likes: whether the admin marked its removal `left` changes nothing.
31790
31887
  */
31791
- handsOn(author, epoch) {
31792
- if (rosterHas(this.roster, author)) return true;
31793
- const chain = this.state.chain;
31794
- let left = false;
31795
- for (let e = chain.length - 1; e > 0; e--) {
31796
- if (chain[e].k !== "remove" || chain[e].s !== author) continue;
31797
- if (left && epoch >= e) return true;
31798
- if (!this.state.leftMarks?.[e] || epoch >= e) return false;
31799
- left = true;
31800
- }
31801
- return left;
31888
+ handsOn(author) {
31889
+ return rosterHas(this.roster, author);
31802
31890
  }
31803
31891
  /** Keeps the admin's mark on a commit that took out a member who left (`GroupCommitFrame.left`) when it holds; true when new. */
31804
31892
  takeLeftMark(commit, mark) {
@@ -31825,7 +31913,7 @@ var GroupSession = class {
31825
31913
  if (sealed) this.takeSecret(commit.e, sealed);
31826
31914
  this.pruneSecrets();
31827
31915
  this.pruneRelay();
31828
- await this.persist();
31916
+ this.persistSoon();
31829
31917
  this.hooks.changed();
31830
31918
  await this.replayWaiting();
31831
31919
  }
@@ -31847,7 +31935,7 @@ var GroupSession = class {
31847
31935
  taken = this.takeSecret(entry.e, entry.s) || taken;
31848
31936
  }
31849
31937
  if (!taken) return;
31850
- await this.persist();
31938
+ this.persistSoon();
31851
31939
  this.hooks.changed();
31852
31940
  await this.replayWaiting();
31853
31941
  }
@@ -31858,7 +31946,8 @@ var GroupSession = class {
31858
31946
  if (!answered.take()) return;
31859
31947
  this.hear(frame);
31860
31948
  if (frame.e > this.epoch) {
31861
- this.ask(from);
31949
+ this.syncedEpoch.set(from, frame.e);
31950
+ if (!this.awaitsAnswer(from)) this.ask(from);
31862
31951
  this.offerMeta(from, frame.mt);
31863
31952
  this.handOwn(from, frame);
31864
31953
  return;
@@ -31895,12 +31984,7 @@ var GroupSession = class {
31895
31984
  });
31896
31985
  const lacks = missingIn(frame, from);
31897
31986
  const asked = new Set(Array.isArray(frame.ask) ? frame.ask.filter((k) => typeof k === "string" && k !== from && k !== this.myKey && rosterHas(this.roster, k)) : []);
31898
- const handed = this.leaversHanded.get(from);
31899
- const kept = !asked.size && !this.state.leftMarks ? [] : this.kept().filter((f) => {
31900
- if (!this.state.chain[f.e] || !rosterHas(this.state.chain[f.e].m, from) || !lacks(f) || this.isRemoved(f)) return false;
31901
- if (asked.has(f.s)) return true;
31902
- return !rosterHas(this.roster, f.s) && !handed?.has(frameKey$1(f)) && this.handsOn(f.s, f.e);
31903
- });
31987
+ const kept = !asked.size ? [] : this.kept().filter((f) => asked.has(f.s) && !!this.state.chain[f.e] && rosterHas(this.state.chain[f.e].m, from) && lacks(f) && !this.isRemoved(f));
31904
31988
  const written = asWritten(this.ownLacked(from, frame), kept);
31905
31989
  const metas = this.metaFor(from, frame.mt);
31906
31990
  for (const f of written) {
@@ -31912,6 +31996,7 @@ var GroupSession = class {
31912
31996
  const edits = (this.state.relayEdits ?? []).filter((f) => f.s === author && readable(f));
31913
31997
  answer.push(...edits.slice(-GROUP_LIMITS.handOnEdits));
31914
31998
  }
31999
+ const handed = this.leaversHanded.get(from);
31915
32000
  const gone = (this.state.relayEdits ?? []).filter((f) => !rosterHas(this.roster, f.s) && readable(f) && !handed?.has(editKey(f)));
31916
32001
  answer.push(...gone.slice(-GROUP_LIMITS.handOnEdits));
31917
32002
  answer.push(...metas.map((m) => m.frame));
@@ -32589,6 +32674,29 @@ function verifyCommunityCommit(raw, parent, parentRoster, groupId, before) {
32589
32674
  * member's second leave under the one statement there was, and no newcomer could enter that group again.
32590
32675
  */
32591
32676
  function verifyCommunityChain(raw, groupId) {
32677
+ const check = checkChain(raw, groupId);
32678
+ for (;;) {
32679
+ const step = check.next();
32680
+ if (step.done) return step.value;
32681
+ }
32682
+ }
32683
+ /**
32684
+ * `verifyCommunityChain` for a client whose engine shares its page's thread: the same checks, letting the thread go every
32685
+ * `CHAIN_SLICE_MS` of them. One commit's signature takes ~2.6 ms in JavaScript on a desktop CPU, several times that on a
32686
+ * phone, so a history near `COMMUNITY_LIMITS.chain` checked at once was an app that drew nothing for 5 s and more.
32687
+ */
32688
+ async function verifyCommunityChainPaced(raw, groupId) {
32689
+ const check = checkChain(raw, groupId), pause = pacer(CHAIN_SLICE_MS);
32690
+ for (;;) {
32691
+ const step = check.next();
32692
+ if (step.done) return step.value;
32693
+ await pause();
32694
+ }
32695
+ }
32696
+ /** `verifyCommunityChainPaced` checks commits for this long at most before it lets the thread go. */
32697
+ var CHAIN_SLICE_MS = 5;
32698
+ /** The chain's checks, one commit per step. */
32699
+ function* checkChain(raw, groupId) {
32592
32700
  if (!Array.isArray(raw) || raw.length === 0 || raw.length > COMMUNITY_LIMITS.chain) return { error: "Malformed membership chain" };
32593
32701
  const chain = [], rosters = [];
32594
32702
  let entry = "";
@@ -32598,6 +32706,7 @@ function verifyCommunityChain(raw, groupId) {
32598
32706
  chain.push(result.commit);
32599
32707
  rosters.push(result.roster);
32600
32708
  if (result.commit.x !== void 0) entry = result.commit.x;
32709
+ yield;
32601
32710
  }
32602
32711
  return {
32603
32712
  chain,
@@ -32749,6 +32858,18 @@ function isSealed(v) {
32749
32858
  "c"
32750
32859
  ].every((k) => typeof v[k] === "string" && B64.test(v[k]) && v[k].length <= 128);
32751
32860
  }
32861
+ /** A welcome's shape and the whole chain it and the pieces before it carry, not yet checked (`CommunitySession.join`). */
32862
+ function readWelcome(link, pieces, welcome) {
32863
+ if (!welcome || typeof welcome !== "object") return { error: "Malformed welcome" };
32864
+ const w = welcome;
32865
+ if (w.t !== "group-welcome" || w.v !== 2 || w.g !== link.g || !Array.isArray(w.commits) || !Array.isArray(w.secrets) || !isSealed(w.rv) || !isSealed(w.entry)) return { error: "Malformed welcome" };
32866
+ const commits = [...pieces.flatMap((p) => p && typeof p === "object" && Array.isArray(p.commits) ? p.commits : []), ...w.commits];
32867
+ if (commits.length > COMMUNITY_LIMITS.chain) return { error: "Membership chain too long" };
32868
+ return {
32869
+ welcome: w,
32870
+ commits
32871
+ };
32872
+ }
32752
32873
  /** A pair payload's box: an ephemeral key, a nonce and a ciphertext of at most `appBytes` sealed. */
32753
32874
  var MAX_PAIR_BOX = Math.ceil((COMMUNITY_LIMITS.appBytes + 16) * 4 / 3) + 4;
32754
32875
  function isPairBox(v) {
@@ -32763,7 +32884,7 @@ function isMessageFrame(v) {
32763
32884
  * One member's view of a community group: the branch it follows and the ones it knows, the
32764
32885
  * secrets it holds, what it has seen, and the recent frames it keeps for others.
32765
32886
  */
32766
- var CommunitySession = class {
32887
+ var CommunitySession = class CommunitySession {
32767
32888
  hooks;
32768
32889
  state;
32769
32890
  identity;
@@ -32876,12 +32997,17 @@ var CommunitySession = class {
32876
32997
  * add was made by another member (the first one to answer me went away) is as good.
32877
32998
  */
32878
32999
  static join(link, pieces, welcome, seedB64, now = Date.now()) {
32879
- if (!welcome || typeof welcome !== "object") return { error: "Malformed welcome" };
32880
- const w = welcome;
32881
- if (w.t !== "group-welcome" || w.v !== 2 || w.g !== link.g || !Array.isArray(w.commits) || !Array.isArray(w.secrets) || !isSealed(w.rv) || !isSealed(w.entry)) return { error: "Malformed welcome" };
32882
- const commits = [...pieces.flatMap((p) => p && typeof p === "object" && Array.isArray(p.commits) ? p.commits : []), ...w.commits];
32883
- if (commits.length > COMMUNITY_LIMITS.chain) return { error: "Membership chain too long" };
32884
- const verified = verifyCommunityChain(commits, link.g);
33000
+ const read = readWelcome(link, pieces, welcome);
33001
+ if ("error" in read) return read;
33002
+ return CommunitySession.joinVerified(link, read.welcome, verifyCommunityChain(read.commits, link.g), seedB64, now);
33003
+ }
33004
+ /** `join`, its chain checked a slice at a time (`verifyCommunityChainPaced`): what an app sharing its page's thread calls. */
33005
+ static async joinPaced(link, pieces, welcome, seedB64, now = Date.now()) {
33006
+ const read = readWelcome(link, pieces, welcome);
33007
+ if ("error" in read) return read;
33008
+ return CommunitySession.joinVerified(link, read.welcome, await verifyCommunityChainPaced(read.commits, link.g), seedB64, now);
33009
+ }
33010
+ static joinVerified(link, w, verified, seedB64, now) {
32885
33011
  if ("error" in verified) return verified;
32886
33012
  const { chain, roster, entry } = verified;
32887
33013
  const me = identityFromSeedB64(seedB64);
@@ -34362,6 +34488,7 @@ var CommunitySession = class {
34362
34488
  case "group-left": return this.receiveLeft(frame);
34363
34489
  case "group-entry": {
34364
34490
  if (frame.to !== this.myKey || !isSealed(frame.s) || frame.x !== this.currentEntryKey()) return false;
34491
+ if (this.state.entry.key === frame.x && this.state.entry.seedB64) return false;
34365
34492
  const seed = openSecret(this.identity.seed, this.myKey, frame.s, entryAad(this.id, this.myKey));
34366
34493
  return !!seed && this.takeEntrySeed(toBase64Url(seed));
34367
34494
  }
@@ -35594,6 +35721,6 @@ function readX401SdJwtVc(text) {
35594
35721
  };
35595
35722
  }
35596
35723
  //#endregion
35597
- export { SshSigError as $, ROUTINE_STATES as $a, isAppHash as $c, validExternalKey as $i, DEFAULT_RELAYS as $l, readGroupHave as $n, parseCallSignal as $o, wakeRequest as $r, ENROLL_DONE as $s, SEPOLIA_TEST_USDT as $t, knockIdentity as A, parseLinkPreview as Aa, openRequest as Ac, recordsFromWellKnown as Ai, deviceKeyZ32 as Al, fedimintRequestPayload as An, DirectPathWatch as Ao, FILE_LIMITS as Ar, handoffOfferFrame as As, didSignedMessages as At, toBase64Url as Au, GROUP_REACTED_FRAME as B, reactionIsNewer as Ba, appViewOf as Bc, IDENTITY_REVOCATION_LABEL as Bi, turnPutSummary as Bl, pairedMessageFrame as Bn, parseLocalTarget as Bo, GROUP_PIN_FRAME as Br, readHandoffHave as Bs, signingKeys as Bt, communityHasFrame as C, EDIT_RATE_WINDOW_MS as Ca, contactDay as Cc, domainTxtRecord as Ci, inviteOwnership as Cl, homeserverWebEndpoint as Cn, rosterHas as Co, pickHubs as Cr, handoffContext as Cs, DID_FILE_MAX_BYTES as Ct, MAX_AVATAR_LENGTH as Cu, decodeGroupEntryLink as D, dhtEditId as Da, linkRecords as Dc, nip05RootKey as Di, HANDOFF_CAPABILITY as Dl, decodeBolt11 as Dn, RatchetBox as Do, readLobby as Dr, handoffEphemeral as Ds, checkDidSignature as Dt, fromBase64Url as Du, KNOCK_TTL_MS as E, RateWindow as Ea, knockSlotRecords as Ec, isPublicAddress as Ei, ENROLL_CAPABILITY as El, resolveLightningDestination as En, RATCHET_CAPABILITY as Eo, readBeaconHead as Er, handoffDigest as Es, checkDidJws as Et, bytesEqual as Eu, GroupWakeLimiter as F, REACTION_LIMITS as Fa, APP_BUNDLE_LIMITS as Fc, DHT_TEXT_CAPABILITY as Fi, webCryptoSigner as Fl, GhostLink as Fn, RELAY_POLL_INTERVALS as Fo, TYPING_KINDS as Fr, handoffVersions as Fs, didWebHost as Ft, GROUP_EDIT_FRAME as G, readReply as Ga, readAppBundle as Gc, identityRevocationValue as Gi, readTurnPacket as Gl, GROUP_FILE_LIMITS as Gn, CALL_SIGNAL_MAX_AGE_MS as Go, pinNumberHolds as Gr, sealHandoffPiece as Gs, encodeDidDhtDeactivated as Gt, GroupSession as H, validReactionNumber as Ha, checkAppManifest as Hc, IdentityExchange as Hi, TURN_MAX as Hl, engineError as Hn, LIMITS as Ho, mayPin as Hr, readHandoffPake as Hs, strictBase64Url as Ht, groupWakeFrame as I, ReactionWindow as Ia, APP_BUNDLE_MAGIC as Ic, capsDescriptors as Ii, TURN_PUT_WINDOW_MS as Il, INVITE_TAKEN as In, WATCH_PEER_MS as Io, TYPING_REFRESH_MS as Ir, newHandoffId as Is, normalizeDid as It, parseCommunityEdit as J, BUTTON_STYLES as Ja, APP_PREFIXES as Jc, receivedIdentityStatus as Ji, turnInstance as Jl, GROUP_WANT_NO_FRAME as Jn, buildSdpFromSignal as Jo, WakeLimiter as Jr, readSetUpdate as Js, signDidDhtPacket as Jt, GROUP_EDIT_TEXT_BYTES as K, replySnippet as Ka, readAppBundleAsync as Kc, identityStatement as Ki, signTurnPacket as Kl, GROUP_HAVE_FRAME as Kn, RTC_CONFIG as Ko, readPin as Kr, SET_ACK as Ks, encodeDidDhtPacket as Kt, groupWakes as L, nextReactionNumber as La, APP_ICON_PATH as Lc, dialDescriptors as Li, TURN_RAISE_READ_TIMEOUT_MS as Ll, LIVENESS_PING_MS as Ln, presenceSeenAt as Lo, TypingSender as Lr, readHandoffAck as Ls, parseDid as Lt, mergeKnocks as M, readForwarded as Ma, readLinkRecord as Mc, txtValue as Mi, devicePingFrame as Ml, isFederationId as Mn, DHT_POLL_INTERVALS as Mo, sentWhole as Mr, handoffReleaseFrame as Ms, didWebFile as Mt, utf8Decode as Mu, readKnocks as N, COMMUNITY_REACTION_FRAME as Na, requestRecords as Nc, wellKnownUrl as Ni, newDeviceSetSecret as Nl, parseCashuRequestPayload as Nn, EXPECT_PEER_MS as No, transferEnded as Nr, handoffRetryAfter as Ns, didWebFileNames as Nt, utf8Encode as Nu, encodeGroupEntryLink as O, LINK_TRAILING as Oa, makeStampPaced as Oc, normalizeDomain as Oi, deviceEchoFrame as Ol, ENDPOINT as On, emptyRatchetState as Oo, shouldBeHub as Or, handoffHelloFrame as Os, didGhostlyServiceEntry as Ot, isZ32Key as Ou, GROUP_WAKE_FRAME as P, GROUP_REACTION_FRAME as Pa, seenEntry as Pc, CapsExchange as Pi, seedSigner as Pl, parseFedimintRequestPayload as Pn, PRESENCE_WINDOW as Po, transferStalled as Pr, handoffStreamKey as Ps, didWebFileUrl as Pt, SSHSIG_NAMESPACE as Q, PR_STATES as Qa, checkAppRevokeStatement as Qc, emptyProofLedger as Qi, turnVerifierMark as Ql, readGroupFileMeta as Qn, extractParamsFromSdp as Qo, relayRequest as Qr, verifySetUpdate as Qs, PaymentPreflightError as Qt, parseGroupWakeFrame as R, queueReaction as Ra, APP_PERMISSIONS as Rc, IDENTITY_MAX_EVIDENCE as Ri, TURN_SETTLE_MS as Rl, PAIRED_FRAME_TOO_LARGE as Rn, GhostlyHttpError as Ro, sanitizeTypingStatus as Rr, readHandoffCancel as Rs, parseDidDocument as Rt, GROUP_READ_NOTE_COMMUNITY as S, EDIT_BUFFER_MS as Sa, REQUEST_LIFETIME_MS as Sc, dnsProofName as Si, inviteLink as Sl, pubkyProofPath as Sn, rosterAdmin as So, newerHead as Sr, handoffCancelFrame as Ss, DID_DOCUMENT_MAX_BYTES as St, verify as Su, encodeCommunityLink as T, REMOVED_TEXT as Ta, knockSlotOf as Tc, encodeDnsQuery as Ti, DEVICES_CAPABILITY as Tl, requestLnurlInvoice as Tn, edgeParams as To, readBeacon as Tr, handoffDataFrame as Ts, DidError as Tt, sanitizeDisplayText as Tu, frameBytes as U, wireReaction as Ua, isAppUrl as Uc, boundVerifiedIdentity as Ui, firstDeviceSetSecret as Ul, engineText as Un, decodeControl as Uo, nextPinNumber as Ur, readHandoffTurnFrame as Us, didDhtDocument as Ut, GROUP_READ_NOTE as V, readReaction as Va, assembleAppBundle as Vc, IdentityCheckUnavailable as Vi, TURN_LAST_SEQUENCE as Vl, EngineError as Vn, webLocalFetch as Vo, PIN_LIMITS as Vr, readHandoffHello as Vs, staticDidDocument as Vt, COMMUNITY_EDIT_FRAME as W, pairedReplyAuthor as Wa, pacer as Wc, emptyIdentityLedger as Wi, nextTurnPosition as Wl, parseEngineError as Wn, encodeControl as Wo, pinIsNewer as Wr, readHandoffVerified as Ws, didDhtFromPublicKey as Wt, groupName as X, ITEM_STATES as Xa, appFingerprint as Xc, lastSharedWithMe as Xi, turnName as Xl, groupFileFallback as Xn, callSignalHeardAt as Xo, newWakeToken as Xr, setUpdateFrame as Xs, EVM_TEST_CHAINS as Xt, mentionsMember as Y, CRON_LINE as Ya, APP_STATEMENT_LIMITS as Yc, revokesIdentity as Yi, turnKeys as Yl, fetchesByItself as Yn, callRtcConfig as Yo, deviceWakeRequest as Yr, setAckFrame as Ys, ETHEREUM_USDT as Yt, SSHSIG_MAX_ARMOR as Z, PR_CHECKS as Za, appRef as Zc, PeerProofs as Zi, turnStatedVerifier as Zl, isGroupMessageId as Zn, contactRtcConfig as Zo, parseWakeFrame as Zr, signTombstone as Zs, ONCHAIN_PROVIDER as Zt, groupTypingEpoch as _, fileMessageText as _a, planKnocks as _c, isHoldUrl as _i, readDeviceInvite as _l, isPubkyProofFolder as _n, GROUP_MEMBER_CAP as _o, freshHubs as _r, filePartName as _s, normalizeAtprotoHandle as _t, parseRelayPayload as _u, appRevocationFor as a, DHT_MESSAGE_TTL as aa, enrollDigits as ac, chatAppId as ai, signAppObject as al, assertTokenUnits as an, cardLine as ao, SIGNAL_HOLD_MS as ar, HANDOFF_ACK as as, verifyBitcoinMessage as at, currentRelays as au, COMMUNITY_LIMITS as b, voiceLevel as ba, turnOff as bc, DOMAIN_FILE_MAX_BYTES as bi, decodeInviteCode as bl, pubkyProofCapability as bn, commitHash as bo, mergeBeacon as br, handoffAttemptSucceeded as bs, AtprotoProofError as bt, identityFromSeedB64 as bu, checkAppBeforeRun as c, dhtFileId as ca, enrollHelloFrame as cc, BUTTONS_CAPABILITY as ci, readImageMeta as cl, validatePaymentTarget as cn, sameButtonText as co, readGroupSignal as cr, HANDOFF_HAVE as cs, ATPROTO_DECLARED_SCOPE as ct, traceLink as cu, checkAppStoreIndex as d, sanitizeMime as da, readEnrollHello as dc, UPGRADE_CAPABILITY as di, readCanonicalJson as dl, SPARK_PROVIDER as dn, arrivalKey as do, meshHubs as dr, HANDOFF_PAKE as ds, ATPROTO_PROOF_SCOPE as dt, withRequestOptions as du, TRANSPORTS as ea, ENROLL_GRANT as ec, checkPushEndpoint as ei, isAppKey as el, SEPOLIA_TEST_USDT_FAUCET as en, RUN_RESULTS as eo, readGroupWant as er, signalHasVideo as es, parseSshPublicKey as et, HEDGE_MISSING_MS as eu, readAppStore as f, PLAYABLE_AUDIO as fa, verifyEnrollProof as fc, HOLD_CAPABILITY as fi, createContactLink as fl, sparkAddressKind as fn, claimedTime as fo, pickMeshHubs as fr, HANDOFF_PIECE_BYTES as fs, atprotoDidMethod as ft, PacketTooLargeError as fu, GroupTypingBoard as g, downsamplePeaks as ga, newInbox as gc, HoldRefusedError as gi, deviceInviteJoinerParams as gl, isPubkyKey as gn, GROUP_ADMIN_OFF_ERROR as go, doorHubs as gr, NO_ATTEMPTS as gs, isAtprotoDid as gt, openRelayPayload as gu, GROUP_TYPING_FRAME as h, baseMime as ha, inboxRecord as hc, HoldKeys as hi, createDeviceInvite as hl, PUBKY_PROOF_MAX_BYTES as hn, shownTime as ho, beaconRecords as hr, HANDOFF_VERIFIED as hs, checkAtprotoProofRecord as ht, newerPacket as hu, addedAppPermissions as i, DHT_FILE_TOO_LARGE as ia, enrollCancelReason as ic, APP_DATA_MAX_BYTES as ii, setAppSignatureFastPath as il, arkAddressPrefix as in, buttonLabelClash as io, SIGNAL_FRESH_MS as ir, serviceIdFromName as is, verifySshSignature as it, SLOW_MS as iu, knockRecords as j, forwardedAgain as ja, readKnockSlot as jc, recordsName as ji, deviceLinkPairing as jl, findEndpoint as jn, AWAITING_PEER_MS as jo, FileUplink as jr, handoffPakeFrame as js, didWebDocumentUrl as jt, toZ32 as ju, entryParams as k, linkStop as ka, mergeContactKnocks as kc, recordsFromTxt as ki, deviceEchoNonce as kl, cashuRequestPayload as kn, ratchetSessionOf as ko, ChatFiles as kr, handoffManifestFrames as ks, didJwsAlg as kt, randomBytes as ku, planAppUpdate as l, formatFileSize as la, enrollProofFrame as lc, EDIT_CAPABILITY as li, canonicalJson as ll, walletNetworkOf as ln, statusCardBytes as lo, MESH_HUBS as lr, HANDOFF_HELLO as ls, ATPROTO_FULL_SCOPE as lt, budgetRetryMs as lu, signAppStore as m, VOICE_METER as ma, endedRequests as mc, HOLD_LIMITS as mi, readContactLink as ml, isBitcoinAddress as mn, receivedTimestamp as mo, beaconKeys as mr, HANDOFF_TIMINGS as ms, atprotoProofRkey as mt, createRelayPayload as mu, readX401SdJwtVc as n, irohDescriptor as na, ENROLL_PROOF as nc, APP_RANGE_LIMITS as ni, readAppRevocation as nl, USDT_PUBLIC_RPC as nn, TASK_STATUSES as no, CarriedTransport as nr, HTTP_SERVICE_PROTO as ns, sameSshKey as nt, RelayTransport as nu, appStoreDecision as o, peekDhtMailbox as oa, enrollDoneFrame as oc, isAppVersion as oi, signAppRevocation as ol, assertWholeSats as on, cardUrl as oo, SIGNAL_REPLY_MS as or, HANDOFF_CANCEL as os, BitcoinAddressError as ot, normalizeRelayUrl as ou, readAppStoreSteps as p, VOICE_LIMITS as pa, clearMissed as pc, HOLD_DATED_BACK_MS as pi, encodeContactLink as pl, sparkInvoiceDetails as pn, heardTime as po, COMMUNITY_TOPOLOGY as pr, HANDOFF_REQUEST as ps, atprotoProofRecord as pt, RELAY_PAYLOAD_MAX_BYTES as pu, carryMentions as q, BUTTON_ID as qa, sha256Paced as qc, newIdentityBinding as qi, signTurnRelease as ql, GROUP_WANT_FRAME as qn, answersOffer as qo, WAKE_CALL_INTERVAL_MS as qr, SET_UPDATE as qs, resolveDidDht as qt, sameX401HolderJwk as r, irohRelayUrl as ra, enrollCancelFrame as rc, isServeId as ri, readAppRevocations as rl, WALLET_NETWORKS as rn, appCardId as ro, GROUP_SIGNAL_FRAME as rr, LEGACY_SERVICES as rs, sshSignCommand as rt, RelaysFailedError as ru, appUpdateDecision as s, DHT_FILE_CAPABILITY as sa, enrollGrantFrame as sc, APPS_CAPABILITY as si, parseImageMeta as sl, formatPaymentAmount as sn, checkStatusCard as so, groupSignalFrame as sr, HANDOFF_DONE as ss, decodeAnyBitcoinAddress as st, setLinkTraceSink as su, newX401HolderKey as t, automaticTransport as ta, ENROLL_HELLO as tc, vapidKeysMatch as ti, isAppRef as tl, TEST_USDT_FAUCET_AMOUNT as tn, STATUS_CARD_LIMITS as to, readGroupWantNo as tr, emptyLinkRecords as ts, parseSshSignature as tt, HEDGE_MS as tu, APP_STORE_LIMITS as u, sanitizeFileName as ua, readEnrollGrant as uc, STATUS_CARD_CAPABILITY as ui, canonicalJsonBytes as ul, SPARK_NETWORKS as un, statusCardText as uo, mayBeHub as ur, HANDOFF_OFFER as us, ATPROTO_PROOF_COLLECTION as ut, isDiscoveryBudgetError as uu, openGroupTyping as v, parseVoiceMeta as va, settleRequest as vc, newMailbox as vi, OwnInviteError as vl, newPubkyProofFolder as vn, MAX_GROUP_CHAIN as vo, lobbyKeys as vr, handoffAttemptAllowed as vs, parseAtprotoDidDocument as vt, createIdentity as vu, decodeCommunityLink as w, MAX_REMOVAL_NUMBER as wa, knockSlotIdentity as wc, domainWellKnownFile as wi, ownInviteRefusal as wl, pubkyHomeserverOf as wn, verifyCommitSignature as wo, rankHubs as wr, handoffContextProof as ws, DID_JWS_MAX_LENGTH as wt, sanitizeAvatar as wu, CommunitySession as x, parseVideoMeta as xa, ContactRequestError as xc, decodeDnsResponse as xi, encodeInviteCode as xl, pubkyProofFile as xn, parseGroupCommit as xo, mergeLobby as xr, handoffBusyFrame as xs, verifyAtprotoRecordProof as xt, publicKeyFromZ32 as xu, sealGroupTyping as y, voiceDownloadName as ya, takeRequest as yc, readManifest as yi, createChatInvite as yl, normalizePubkyKey as yn, MEMBER_KEY as yo, lobbyRecords as yr, handoffAttemptFailed as ys, shortAtprotoDid as yt, identityFromSeed as yu, GROUP_LIMITS as z, reactionEmoji as za, appDigest as zc, IDENTITY_MAX_VALIDITY as zi, classifyTurnRead as zl, pairedMessageFits as zn, formatLocalTarget as zo, typingActivity as zr, readHandoffDone as zs, parseDidSignaturePaste as zt };
35724
+ export { SshSigError as $, ROUTINE_STATES as $a, checkAppRevokeStatement as $c, validExternalKey as $i, turnStatedVerifier as $l, readGroupHave as $n, extractParamsFromSdp as $o, wakeRequest as $r, verifySetUpdate as $s, SEPOLIA_TEST_USDT as $t, knockIdentity as A, parseLinkPreview as Aa, mergeContactKnocks as Ac, recordsFromWellKnown as Ai, deviceEchoFrame as Al, fedimintRequestPayload as An, ratchetSessionOf as Ao, FILE_LIMITS as Ar, handoffManifestFrames as As, didSignedMessages as At, isZ32Key as Au, GROUP_REACTED_FRAME as B, reactionIsNewer as Ba, appDigest as Bc, IDENTITY_REVOCATION_LABEL as Bi, TURN_SETTLE_MS as Bl, pairedMessageFrame as Bn, formatLocalTarget as Bo, GROUP_PIN_FRAME as Br, readHandoffDone as Bs, signingKeys as Bt, communityHasFrame as C, EDIT_RATE_WINDOW_MS as Ca, REQUEST_LIFETIME_MS as Cc, domainTxtRecord as Ci, encodeInviteCode as Cl, homeserverWebEndpoint as Cn, rosterAdmin as Co, pickHubs as Cr, handoffCancelFrame as Cs, DID_FILE_MAX_BYTES as Ct, publicKeyFromZ32 as Cu, decodeGroupEntryLink as D, dhtEditId as Da, knockSlotRecords as Dc, nip05RootKey as Di, DEVICES_CAPABILITY as Dl, decodeBolt11 as Dn, RATCHET_CAPABILITY as Do, readLobby as Dr, handoffDigest as Ds, checkDidSignature as Dt, sanitizeDisplayText as Du, KNOCK_TTL_MS as E, RateWindow as Ea, knockSlotOf as Ec, isPublicAddress as Ei, ownInviteRefusal as El, resolveLightningDestination as En, edgeParams as Eo, readBeaconHead as Er, handoffDataFrame as Es, checkDidJws as Et, sanitizeAvatar as Eu, GroupWakeLimiter as F, REACTION_LIMITS as Fa, seenEntry as Fc, DHT_TEXT_CAPABILITY as Fi, newDeviceSetSecret as Fl, GhostLink as Fn, PRESENCE_WINDOW as Fo, TYPING_KINDS as Fr, handoffStreamKey as Fs, didWebHost as Ft, utf8Encode as Fu, GROUP_EDIT_FRAME as G, readReply as Ga, pacer as Gc, identityRevocationValue as Gi, firstDeviceSetSecret as Gl, GROUP_FILE_LIMITS as Gn, encodeControl as Go, pinNumberHolds as Gr, readHandoffVerified as Gs, encodeDidDhtDeactivated as Gt, GroupSession as H, validReactionNumber as Ha, assembleAppBundle as Hc, IdentityExchange as Hi, turnPutSummary as Hl, engineError as Hn, webLocalFetch as Ho, mayPin as Hr, readHandoffHello as Hs, strictBase64Url as Ht, groupWakeFrame as I, ReactionWindow as Ia, APP_BUNDLE_LIMITS as Ic, capsDescriptors as Ii, seedSigner as Il, INVITE_TAKEN as In, RELAY_POLL_INTERVALS as Io, TYPING_REFRESH_MS as Ir, handoffVersions as Is, normalizeDid as It, parseCommunityEdit as J, BUTTON_STYLES as Ja, sha256Paced as Jc, receivedIdentityStatus as Ji, signTurnPacket as Jl, GROUP_WANT_NO_FRAME as Jn, answersOffer as Jo, WakeLimiter as Jr, SET_UPDATE as Js, signDidDhtPacket as Jt, GROUP_EDIT_TEXT_BYTES as K, replySnippet as Ka, readAppBundle as Kc, identityStatement as Ki, nextTurnPosition as Kl, GROUP_HAVE_FRAME as Kn, CALL_SIGNAL_MAX_AGE_MS as Ko, readPin as Kr, sealHandoffPiece as Ks, encodeDidDhtPacket as Kt, groupWakes as L, nextReactionNumber as La, APP_BUNDLE_MAGIC as Lc, dialDescriptors as Li, webCryptoSigner as Ll, LIVENESS_PING_MS as Ln, WATCH_PEER_MS as Lo, TypingSender as Lr, newHandoffId as Ls, parseDid as Lt, mergeKnocks as M, readForwarded as Ma, readKnockSlot as Mc, txtValue as Mi, deviceKeyZ32 as Ml, isFederationId as Mn, AWAITING_PEER_MS as Mo, sentWhole as Mr, handoffPakeFrame as Ms, didWebFile as Mt, toBase64Url as Mu, readKnocks as N, COMMUNITY_REACTION_FRAME as Na, readLinkRecord as Nc, wellKnownUrl as Ni, deviceLinkPairing as Nl, parseCashuRequestPayload as Nn, DHT_POLL_INTERVALS as No, transferEnded as Nr, handoffReleaseFrame as Ns, didWebFileNames as Nt, toZ32 as Nu, encodeGroupEntryLink as O, LINK_TRAILING as Oa, linkRecords as Oc, normalizeDomain as Oi, ENROLL_CAPABILITY as Ol, ENDPOINT as On, RatchetBox as Oo, shouldBeHub as Or, handoffEphemeral as Os, didGhostlyServiceEntry as Ot, bytesEqual as Ou, GROUP_WAKE_FRAME as P, GROUP_REACTION_FRAME as Pa, requestRecords as Pc, CapsExchange as Pi, devicePingFrame as Pl, parseFedimintRequestPayload as Pn, EXPECT_PEER_MS as Po, transferStalled as Pr, handoffRetryAfter as Ps, didWebFileUrl as Pt, utf8Decode as Pu, SSHSIG_NAMESPACE as Q, PR_STATES as Qa, appRef as Qc, emptyProofLedger as Qi, turnName as Ql, readGroupFileMeta as Qn, contactRtcConfig as Qo, relayRequest as Qr, signTombstone as Qs, PaymentPreflightError as Qt, parseGroupWakeFrame as R, queueReaction as Ra, APP_ICON_PATH as Rc, IDENTITY_MAX_EVIDENCE as Ri, TURN_PUT_WINDOW_MS as Rl, PAIRED_FRAME_TOO_LARGE as Rn, presenceSeenAt as Ro, sanitizeTypingStatus as Rr, readHandoffAck as Rs, parseDidDocument as Rt, GROUP_READ_NOTE_COMMUNITY as S, EDIT_BUFFER_MS as Sa, ContactRequestError as Sc, dnsProofName as Si, decodeInviteCode as Sl, pubkyProofPath as Sn, parseGroupCommit as So, newerHead as Sr, handoffBusyFrame as Ss, DID_DOCUMENT_MAX_BYTES as St, identityFromSeedB64 as Su, encodeCommunityLink as T, REMOVED_TEXT as Ta, knockSlotIdentity as Tc, encodeDnsQuery as Ti, inviteOwnership as Tl, requestLnurlInvoice as Tn, verifyCommitSignature as To, readBeacon as Tr, handoffContextProof as Ts, DidError as Tt, MAX_AVATAR_LENGTH as Tu, frameBytes as U, wireReaction as Ua, checkAppManifest as Uc, boundVerifiedIdentity as Ui, TURN_LAST_SEQUENCE as Ul, engineText as Un, LIMITS as Uo, nextPinNumber as Ur, readHandoffPake as Us, didDhtDocument as Ut, GROUP_READ_NOTE as V, readReaction as Va, appViewOf as Vc, IdentityCheckUnavailable as Vi, classifyTurnRead as Vl, EngineError as Vn, parseLocalTarget as Vo, PIN_LIMITS as Vr, readHandoffHave as Vs, staticDidDocument as Vt, COMMUNITY_EDIT_FRAME as W, pairedReplyAuthor as Wa, isAppUrl as Wc, emptyIdentityLedger as Wi, TURN_MAX as Wl, parseEngineError as Wn, decodeControl as Wo, pinIsNewer as Wr, readHandoffTurnFrame as Ws, didDhtFromPublicKey as Wt, groupName as X, ITEM_STATES as Xa, APP_STATEMENT_LIMITS as Xc, lastSharedWithMe as Xi, turnInstance as Xl, groupFileFallback as Xn, callRtcConfig as Xo, newWakeToken as Xr, setAckFrame as Xs, EVM_TEST_CHAINS as Xt, mentionsMember as Y, CRON_LINE as Ya, APP_PREFIXES as Yc, revokesIdentity as Yi, signTurnRelease as Yl, fetchesByItself as Yn, buildSdpFromSignal as Yo, deviceWakeRequest as Yr, readSetUpdate as Ys, ETHEREUM_USDT as Yt, SSHSIG_MAX_ARMOR as Z, PR_CHECKS as Za, appFingerprint as Zc, PeerProofs as Zi, turnKeys as Zl, isGroupMessageId as Zn, callSignalHeardAt as Zo, parseWakeFrame as Zr, setUpdateFrame as Zs, ONCHAIN_PROVIDER as Zt, groupTypingEpoch as _, fileMessageText as _a, newInbox as _c, isHoldUrl as _i, createDeviceInvite as _l, isPubkyProofFolder as _n, GROUP_ADMIN_OFF_ERROR as _o, freshHubs as _r, NO_ATTEMPTS as _s, normalizeAtprotoHandle as _t, newerPacket as _u, appRevocationFor as a, DHT_MESSAGE_TTL as aa, enrollCancelReason as ac, chatAppId as ai, setAppSignatureFastPath as al, assertTokenUnits as an, buttonLabelClash as ao, SIGNAL_HOLD_MS as ar, serviceIdFromName as as, verifyBitcoinMessage as at, RelaysFailedError as au, COMMUNITY_LIMITS as b, voiceLevel as ba, takeRequest as bc, DOMAIN_FILE_MAX_BYTES as bi, OwnInviteError as bl, pubkyProofCapability as bn, MEMBER_KEY as bo, mergeBeacon as br, handoffAttemptFailed as bs, AtprotoProofError as bt, createIdentity as bu, checkAppBeforeRun as c, dhtFileId as ca, enrollGrantFrame as cc, BUTTONS_CAPABILITY as ci, exifOrientation as cl, validatePaymentTarget as cn, checkStatusCard as co, readGroupSignal as cr, HANDOFF_DONE as cs, ATPROTO_DECLARED_SCOPE as ct, normalizeRelayUrl as cu, checkAppStoreIndex as d, sanitizeMime as da, readEnrollGrant as dc, UPGRADE_CAPABILITY as di, canonicalJson as dl, SPARK_PROVIDER as dn, statusCardText as do, meshHubs as dr, HANDOFF_OFFER as ds, ATPROTO_PROOF_SCOPE as dt, budgetRetryMs as du, TRANSPORTS as ea, ENROLL_DONE as ec, checkPushEndpoint as ei, isAppHash as el, SEPOLIA_TEST_USDT_FAUCET as en, RUN_RESULTS as eo, readGroupWant as er, parseCallSignal as es, parseSshPublicKey as et, turnVerifierMark as eu, readAppStore as f, PLAYABLE_AUDIO as fa, readEnrollHello as fc, HOLD_CAPABILITY as fi, canonicalJsonBytes as fl, sparkAddressKind as fn, arrivalKey as fo, pickMeshHubs as fr, HANDOFF_PAKE as fs, atprotoDidMethod as ft, isDiscoveryBudgetError as fu, GroupTypingBoard as g, downsamplePeaks as ga, inboxRecord as gc, HoldRefusedError as gi, readContactLink as gl, isPubkyKey as gn, shownTime as go, doorHubs as gr, HANDOFF_VERIFIED as gs, isAtprotoDid as gt, createRelayPayload as gu, GROUP_TYPING_FRAME as h, baseMime as ha, endedRequests as hc, HoldKeys as hi, encodeContactLink as hl, PUBKY_PROOF_MAX_BYTES as hn, receivedTimestamp as ho, beaconRecords as hr, HANDOFF_TIMINGS as hs, checkAtprotoProofRecord as ht, RELAY_PAYLOAD_MAX_BYTES as hu, addedAppPermissions as i, DHT_FILE_TOO_LARGE as ia, enrollCancelFrame as ic, APP_DATA_MAX_BYTES as ii, readAppRevocations as il, arkAddressPrefix as in, appCardUrl as io, SIGNAL_FRESH_MS as ir, LEGACY_SERVICES as is, verifySshSignature as it, RelayTransport as iu, knockRecords as j, forwardedAgain as ja, openRequest as jc, recordsName as ji, deviceEchoNonce as jl, findEndpoint as jn, DirectPathWatch as jo, FileUplink as jr, handoffOfferFrame as js, didWebDocumentUrl as jt, randomBytes as ju, entryParams as k, linkStop as ka, makeStampPaced as kc, recordsFromTxt as ki, HANDOFF_CAPABILITY as kl, cashuRequestPayload as kn, emptyRatchetState as ko, ChatFiles as kr, handoffHelloFrame as ks, didJwsAlg as kt, fromBase64Url as ku, planAppUpdate as l, formatFileSize as la, enrollHelloFrame as lc, EDIT_CAPABILITY as li, parseImageMeta as ll, walletNetworkOf as ln, sameButtonText as lo, MESH_HUBS as lr, HANDOFF_HAVE as ls, ATPROTO_FULL_SCOPE as lt, setLinkTraceSink as lu, signAppStore as m, VOICE_METER as ma, clearMissed as mc, HOLD_LIMITS as mi, createContactLink as ml, isBitcoinAddress as mn, heardTime as mo, beaconKeys as mr, HANDOFF_REQUEST as ms, atprotoProofRkey as mt, PacketTooLargeError as mu, readX401SdJwtVc as n, irohDescriptor as na, ENROLL_HELLO as nc, APP_RANGE_LIMITS as ni, isAppRef as nl, USDT_PUBLIC_RPC as nn, TASK_STATUSES as no, CarriedTransport as nr, emptyLinkRecords as ns, sameSshKey as nt, HEDGE_MISSING_MS as nu, appStoreDecision as o, peekDhtMailbox as oa, enrollDigits as oc, isAppVersion as oi, signAppObject as ol, assertWholeSats as on, cardLine as oo, SIGNAL_REPLY_MS as or, HANDOFF_ACK as os, BitcoinAddressError as ot, SLOW_MS as ou, readAppStoreSteps as p, VOICE_LIMITS as pa, verifyEnrollProof as pc, HOLD_DATED_BACK_MS as pi, readCanonicalJson as pl, sparkInvoiceDetails as pn, claimedTime as po, COMMUNITY_TOPOLOGY as pr, HANDOFF_PIECE_BYTES as ps, atprotoProofRecord as pt, withRequestOptions as pu, carryMentions as q, BUTTON_ID as qa, readAppBundleAsync as qc, newIdentityBinding as qi, readTurnPacket as ql, GROUP_WANT_FRAME as qn, RTC_CONFIG as qo, WAKE_CALL_INTERVAL_MS as qr, SET_ACK as qs, resolveDidDht as qt, sameX401HolderJwk as r, irohRelayUrl as ra, ENROLL_PROOF as rc, isServeId as ri, readAppRevocation as rl, WALLET_NETWORKS as rn, appCardId as ro, GROUP_SIGNAL_FRAME as rr, HTTP_SERVICE_PROTO as rs, sshSignCommand as rt, HEDGE_MS as ru, appUpdateDecision as s, DHT_FILE_CAPABILITY as sa, enrollDoneFrame as sc, APPS_CAPABILITY as si, signAppRevocation as sl, formatPaymentAmount as sn, cardUrl as so, groupSignalFrame as sr, HANDOFF_CANCEL as ss, decodeAnyBitcoinAddress as st, currentRelays as su, newX401HolderKey as t, automaticTransport as ta, ENROLL_GRANT as tc, vapidKeysMatch as ti, isAppKey as tl, TEST_USDT_FAUCET_AMOUNT as tn, STATUS_CARD_LIMITS as to, readGroupWantNo as tr, signalHasVideo as ts, parseSshSignature as tt, DEFAULT_RELAYS as tu, APP_STORE_LIMITS as u, sanitizeFileName as ua, enrollProofFrame as uc, STATUS_CARD_CAPABILITY as ui, readImageMeta as ul, SPARK_NETWORKS as un, statusCardBytes as uo, mayBeHub as ur, HANDOFF_HELLO as us, ATPROTO_PROOF_COLLECTION as ut, traceLink as uu, openGroupTyping as v, parseVoiceMeta as va, planKnocks as vc, newMailbox as vi, deviceInviteJoinerParams as vl, newPubkyProofFolder as vn, GROUP_MEMBER_CAP as vo, lobbyKeys as vr, filePartName as vs, parseAtprotoDidDocument as vt, openRelayPayload as vu, decodeCommunityLink as w, MAX_REMOVAL_NUMBER as wa, contactDay as wc, domainWellKnownFile as wi, inviteLink as wl, pubkyHomeserverOf as wn, rosterHas as wo, rankHubs as wr, handoffContext as ws, DID_JWS_MAX_LENGTH as wt, verify as wu, CommunitySession as x, parseVideoMeta as xa, turnOff as xc, decodeDnsResponse as xi, createChatInvite as xl, pubkyProofFile as xn, commitHash as xo, mergeLobby as xr, handoffAttemptSucceeded as xs, verifyAtprotoRecordProof as xt, identityFromSeed as xu, sealGroupTyping as y, voiceDownloadName as ya, settleRequest as yc, readManifest as yi, readDeviceInvite as yl, normalizePubkyKey as yn, MAX_GROUP_CHAIN as yo, lobbyRecords as yr, handoffAttemptAllowed as ys, shortAtprotoDid as yt, parseRelayPayload as yu, GROUP_LIMITS as z, reactionEmoji as za, APP_PERMISSIONS as zc, IDENTITY_MAX_VALIDITY as zi, TURN_RAISE_READ_TIMEOUT_MS as zl, pairedMessageFits as zn, GhostlyHttpError as zo, typingActivity as zr, readHandoffCancel as zs, parseDidSignaturePaste as zt };
35598
35725
 
35599
- //# sourceMappingURL=src-1RU4TilT.js.map
35726
+ //# sourceMappingURL=src-C4sOH4zH.js.map