@ghostlytools/sdk 1.2.4 → 1.3.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.
Files changed (32) hide show
  1. package/dist/app.js +10 -4
  2. package/dist/app.js.map +1 -1
  3. package/dist/core.js +2 -2
  4. package/dist/{fakes-JOzOFxn3.js → fakes-BlpK1WuW.js} +2 -2
  5. package/dist/{fakes-JOzOFxn3.js.map → fakes-BlpK1WuW.js.map} +1 -1
  6. package/dist/fakes.js +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/{keet-identity-key-BLli1rE4.js → keet-identity-key-GE5nr3zt.js} +2 -2
  9. package/dist/{keet-identity-key-BLli1rE4.js.map → keet-identity-key-GE5nr3zt.js.map} +1 -1
  10. package/dist/{src-BqHTnRWH.js → src-JQitqFJD.js} +769 -108
  11. package/dist/src-JQitqFJD.js.map +1 -0
  12. package/dist/testing.js +3 -3
  13. package/dist/types/core/src/appBundle.d.ts +28 -0
  14. package/dist/types/core/src/chatFiles.d.ts +41 -1
  15. package/dist/types/core/src/datalink.d.ts +13 -7
  16. package/dist/types/core/src/dhtDelivery.d.ts +5 -0
  17. package/dist/types/core/src/frames.d.ts +5 -0
  18. package/dist/types/core/src/ghostlink.d.ts +56 -3
  19. package/dist/types/core/src/groupCommunity.d.ts +35 -5
  20. package/dist/types/core/src/groupFiles.d.ts +6 -2
  21. package/dist/types/core/src/groupSession.d.ts +38 -5
  22. package/dist/types/core/src/groupSignals.d.ts +2 -0
  23. package/dist/types/core/src/link.d.ts +15 -0
  24. package/dist/types/core/src/miniApp.d.ts +10 -4
  25. package/dist/types/core/src/pairedCapabilities.d.ts +6 -1
  26. package/dist/types/core/src/pkarr.d.ts +6 -0
  27. package/dist/types/core/src/relay.d.ts +38 -4
  28. package/dist/types/core/src/transport.d.ts +5 -0
  29. package/dist/{verify-RjMx7eW6.js → verify-afQj9kHW.js} +2 -2
  30. package/dist/{verify-RjMx7eW6.js.map → verify-afQj9kHW.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/src-BqHTnRWH.js.map +0 -1
@@ -571,27 +571,31 @@ function signRelayPayload(identity, dnsPacket, seq) {
571
571
  new DataView(timestamp.buffer).setBigUint64(0, seq);
572
572
  return concatBytes(signature, timestamp, dnsPacket);
573
573
  }
574
- /** Checks a relay payload's size and signature. Returns its sequence number and DNS packet, not decoded. */
575
- function openRelayPayload(pubKeyZ32, payload) {
574
+ /** A relay payload's parts, its size checked: the signature, the sequence number and the DNS packet (not decoded). */
575
+ function splitRelayPayload(payload) {
576
576
  if (payload.length < 84) throw new Error("Relay payload too short");
577
577
  if (payload.length > 1072) throw new PacketTooLargeError(payload.length);
578
+ return {
579
+ signature: payload.subarray(0, SIGNATURE_LENGTH),
580
+ seq: new DataView(payload.buffer, payload.byteOffset + SIGNATURE_LENGTH, TIMESTAMP_LENGTH).getBigUint64(0),
581
+ dnsPacket: payload.subarray(72)
582
+ };
583
+ }
584
+ /** Checks a relay payload's size and signature. Returns its sequence number and DNS packet, not decoded. */
585
+ function openRelayPayload(pubKeyZ32, payload) {
586
+ const { signature, seq, dnsPacket } = splitRelayPayload(payload);
578
587
  const publicKey = publicKeyFromZ32(pubKeyZ32);
579
- const signature = payload.subarray(0, SIGNATURE_LENGTH);
580
- const seq = new DataView(payload.buffer, payload.byteOffset + SIGNATURE_LENGTH, TIMESTAMP_LENGTH).getBigUint64(0);
581
- const dnsPacket = payload.subarray(72);
582
588
  if (!verify(signature, signable(seq, dnsPacket), publicKey)) throw new Error("Invalid signature");
583
589
  return {
584
590
  seq,
585
591
  dnsPacket
586
592
  };
587
593
  }
588
- /** Verifies and decodes a relay payload. Throws if the signature does not match. */
589
- function parseRelayPayload(pubKeyZ32, payload) {
590
- const { seq: timestampMicros, dnsPacket } = openRelayPayload(pubKeyZ32, payload);
594
+ function decodeRelayPayload(pubKeyZ32, seq, dnsPacket) {
591
595
  const suffix = `.${pubKeyZ32}`;
592
596
  return {
593
597
  pubKeyZ32,
594
- timestampMicros,
598
+ timestampMicros: seq,
595
599
  records: decodeTxtPacket(dnsPacket).map((r) => ({
596
600
  label: r.name.endsWith(suffix) ? r.name.slice(0, -suffix.length) : r.name,
597
601
  value: r.value,
@@ -599,6 +603,20 @@ function parseRelayPayload(pubKeyZ32, payload) {
599
603
  }))
600
604
  };
601
605
  }
606
+ /** Verifies and decodes a relay payload. Throws if the signature does not match. */
607
+ function parseRelayPayload(pubKeyZ32, payload) {
608
+ const { seq, dnsPacket } = openRelayPayload(pubKeyZ32, payload);
609
+ return decodeRelayPayload(pubKeyZ32, seq, dnsPacket);
610
+ }
611
+ /**
612
+ * Decodes a payload whose signature this process made or already checked (one it is putting), without checking it
613
+ * again: an Ed25519 verify costs about 1 ms, and a CLI daemon at its relay budget checked its own packets ~500 times a
614
+ * minute. Never for bytes read from elsewhere: `parseRelayPayload` is.
615
+ */
616
+ function readOwnRelayPayload(pubKeyZ32, payload) {
617
+ const { seq, dnsPacket } = splitRelayPayload(payload);
618
+ return decodeRelayPayload(pubKeyZ32, seq, dnsPacket);
619
+ }
602
620
  /** How far ahead of this clock a packet's time may be and still count as now: clocks drift, not by this much. */
603
621
  var PKARR_FUTURE_SKEW_MS = 6e5;
604
622
  /**
@@ -935,8 +953,8 @@ var BACKGROUND_REQUESTS_PER_MINUTE = 20;
935
953
  var WRITE_FIRST_MS = 5e3;
936
954
  /**
937
955
  * Once a 1:1 chat needs the relays (the budget refused one of its requests there, or it read urgently anywhere: it polls
938
- * fast for a signal due any moment), group requests leave it the last this many of each minute, for a minute. Groups
939
- * that spend the whole budget spend it over the minute, so the chat then takes the next request that frees, within
956
+ * fast for a signal due any moment), group requests and background ones leave it the last this many of each minute (more
957
+ * for several chats, `CHAT_RESERVE_PER_CHAT`), for a minute. Groups that spend the whole budget spend it over the minute, so the chat then takes the next request that frees, within
940
958
  * seconds, and has room for what follows (the receipt). Waiting for a refusal was too late when a contact went away
941
959
  * from a chat and from groups at once: the chat and the groups' edges all watched fast for it, the edges spent both
942
960
  * relays' minute in 40 s, and the chat read the contact's offer half a minute late (2026-09-27). A chat with nothing
@@ -947,6 +965,18 @@ var WRITE_FIRST_MS = 5e3;
947
965
  */
948
966
  var CHAT_RESERVE = 10;
949
967
  /**
968
+ * …and more while several chats need the relays at once: this many requests each (a read, an offer or answer, the read
969
+ * for the answer to it), up to `CHAT_RESERVE_MOST_SHARE` of the minute. Background requests leave it too, not the
970
+ * groups' alone: the looks of chats whose contacts are not there, and their presence (upkeep, `LinkSession`). An app
971
+ * opened while 30 of its 50 chats' contacts were online spent both relays' minute in its first second, on the presence
972
+ * of the chats whose contacts were long gone, its groups' records and every chat's first read: 12 of the 30 offers and
973
+ * answers went out, no read for an answer could, and 0 of the 30 chats were live 60 s after the start (bug hunt,
974
+ * 2026-10-13).
975
+ */
976
+ var CHAT_RESERVE_PER_CHAT = 3;
977
+ /** The most of a relay's minute the chats' reserve takes, however many chats need it: the rest stays for everything else. */
978
+ var CHAT_RESERVE_MOST_SHARE = 5 / 6;
979
+ /**
950
980
  * A 1:1 chat's signaling (a new offer or answer, and its reads for the answer to its offer, `signal`) may go over a
951
981
  * relay's minute by this fraction of it: 6 on a relay of 30, 12 on one of 60, 1 on relay.pkarr.org's 5 (it allows 10),
952
982
  * and never more than that in any minute; its reads leave the last of those to a write. Everything else still stops at
@@ -1321,14 +1351,22 @@ var RelayTransport = class {
1321
1351
  }
1322
1352
  /**
1323
1353
  * Signs the records, dated by `nextTimestamp`, and hands the payload to `put` (the relays; the CLI adds the DHT).
1354
+ * When every relay's budget (or rate limit) holds this asker back, it throws that wait before signing anything
1355
+ * (`publishWait`): a daemon at its budget signed about 500 packets a minute that never went out. `elsewhere`: `put`
1356
+ * also takes the packet where no budget holds it back (the CLI's DHT), so it is signed whatever the relays say.
1324
1357
  * `put` calls `conflict` for a relay that answered 409: it holds a packet under this key dated at or after this one,
1325
1358
  * which this client has not read (an inviter's warm packet under the key it gave its contact, from a clock ahead of
1326
1359
  * this one). That packet is read from that relay, and the records go again dated just past it, once. Without this
1327
1360
  * the packet was refused until this device's clock passed the other one's, however long that took, and on a relay
1328
1361
  * that did take it, readers still preferred the later-dated empty packet of another relay.
1329
1362
  */
1330
- async publishDated(identity, records, put, options = {}, again = false) {
1331
- const key = identity.pubKeyZ32, timestamp = this.nextTimestamp(key);
1363
+ async publishDated(identity, records, put, options = {}, again = false, elsewhere = false) {
1364
+ const key = identity.pubKeyZ32;
1365
+ if (!again && !elsewhere) {
1366
+ const held = this.publishWait(key, asker(options, true));
1367
+ if (held) throw new DiscoveryBudgetError(held.wait, `Publish held back on every relay: ${held.reasons.join("; ")}`);
1368
+ }
1369
+ const timestamp = this.nextTimestamp(key);
1332
1370
  let redated;
1333
1371
  const conflict = (relay) => {
1334
1372
  if (again || redated) return;
@@ -1340,7 +1378,7 @@ var RelayTransport = class {
1340
1378
  relay
1341
1379
  });
1342
1380
  if (this.lastTimestamp.get(key) !== timestamp) return true;
1343
- await this.publishDated(identity, records, put, options, true);
1381
+ await this.publishDated(identity, records, put, options, true, elsewhere);
1344
1382
  return true;
1345
1383
  })();
1346
1384
  redated.catch(() => {});
@@ -1352,6 +1390,46 @@ var RelayTransport = class {
1352
1390
  if (!pending || !await pending) throw error;
1353
1391
  }
1354
1392
  }
1393
+ /**
1394
+ * How long until some relay takes a publish of this asker, and why each holds it back; null when one would now. Walks the relays as `put` does,
1395
+ * without asking any: a relay the budget holds back gets its refused `take` (the asker's write then waits first in
1396
+ * line, as when `put` is refused), one rate limiting or throttling this address is a wait, one left alone for failing
1397
+ * is none. Null too when a relay fails another way (its network cooling down): the publish then goes, and fails, as
1398
+ * before, and when no relay is held back at all.
1399
+ */
1400
+ publishWait(pubKeyZ32, who) {
1401
+ const probe = this.breaker.allDownProbe(this.relays);
1402
+ let wait = Infinity;
1403
+ const held = [], reasons = [];
1404
+ for (const relay of this.relays) {
1405
+ if (relay !== probe && this.networkCoolingDown(relay, "PUT")) return null;
1406
+ const limited = this.rateLimitedFor(relay);
1407
+ if (limited > 0) {
1408
+ wait = Math.min(wait, limited);
1409
+ reasons.push(`${relay}: Discovery relay is cooling down after a 429; retry shortly`);
1410
+ continue;
1411
+ }
1412
+ const blocked = relay === probe ? 0 : this.breaker.blockedFor(relay);
1413
+ if (blocked > 0) {
1414
+ if (this.breaker.blockedKind(relay) === "throttled") {
1415
+ wait = Math.min(wait, blocked);
1416
+ reasons.push(`${relay}: Discovery relay is throttling this address; retry shortly`);
1417
+ } else reasons.push(`${relay} is left alone after failing`);
1418
+ continue;
1419
+ }
1420
+ if (this.heldFor(relay, who, Date.now(), pubKeyZ32) <= 0) return null;
1421
+ held.push(relay);
1422
+ const left = this.heldFor(relay, who);
1423
+ wait = Math.min(wait, left);
1424
+ reasons.push(`${relay}: discovery budget reached; retry in ${Math.ceil(left / 1e3)} s`);
1425
+ }
1426
+ if (wait === Infinity) return null;
1427
+ for (const relay of held) this.take(relay, who, pubKeyZ32);
1428
+ return {
1429
+ wait,
1430
+ reasons
1431
+ };
1432
+ }
1355
1433
  /** One relay's packet for a key, read now: its time, kept for `nextTimestamp`. Null when it has none or does not answer. */
1356
1434
  async heldAt(relay, pubKeyZ32, who) {
1357
1435
  if (!this.take(relay, who, pubKeyZ32)) return null;
@@ -1371,10 +1449,22 @@ var RelayTransport = class {
1371
1449
  sawTimestamp(pubKeyZ32, timestamp) {
1372
1450
  if (timestamp > (this.seenTimestamp.get(pubKeyZ32) ?? 0n)) this.seenTimestamp.set(pubKeyZ32, timestamp);
1373
1451
  }
1374
- /** Puts a payload signed elsewhere (a did:dht document), byte for byte, on every relay. `conflict`: as `publishDated` gives it. */
1452
+ /**
1453
+ * Puts a payload `publishDated` just signed, dated `timestamp`, on every relay. Its signature is not checked: it was
1454
+ * made here (`publishPayload` checks one signed elsewhere, to read its sequence number). `conflict`: as `publishDated`
1455
+ * gives it.
1456
+ */
1457
+ async putSigned(pubKeyZ32, payload, timestamp, options = {}, conflict) {
1458
+ if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
1459
+ await this.putEverywhere(pubKeyZ32, payload, timestamp, options, conflict);
1460
+ }
1461
+ /**
1462
+ * Puts a payload signed elsewhere (a did:dht document), byte for byte, on every relay; one signed here says its date
1463
+ * (`signedAt`) and is not checked again. `conflict`: as `publishDated` gives it.
1464
+ */
1375
1465
  async publishPayload(pubKeyZ32, payload, options = {}, conflict) {
1376
1466
  if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
1377
- const { seq } = openRelayPayload(pubKeyZ32, payload);
1467
+ const seq = options.signedAt ?? openRelayPayload(pubKeyZ32, payload).seq;
1378
1468
  await this.putEverywhere(pubKeyZ32, payload, seq, options, conflict);
1379
1469
  }
1380
1470
  /**
@@ -1415,7 +1505,7 @@ var RelayTransport = class {
1415
1505
  accepted = true;
1416
1506
  noWriteWaits();
1417
1507
  try {
1418
- this.written.set(pubKeyZ32, parseRelayPayload(pubKeyZ32, payload));
1508
+ this.written.set(pubKeyZ32, readOwnRelayPayload(pubKeyZ32, payload));
1419
1509
  } catch {}
1420
1510
  resolve();
1421
1511
  }, () => {});
@@ -1877,9 +1967,9 @@ var RelayTransport = class {
1877
1967
  if (rationed.length >= most) wait = Math.max(wait, rationed[rationed.length - most] + GROUP_RATION_WINDOW_MS - now);
1878
1968
  if (this.readsAhead(key, now) > 0) wait = Math.max(wait, TURN_WAIT_MS);
1879
1969
  }
1880
- if (who.group) {
1970
+ if (who.group || who.background) {
1881
1971
  const reserved = this.chatReservedFor(relay, now);
1882
- if (reserved > 0) wait = Math.max(wait, Math.min(reserved, over(recent, limit - this.reserveOf(relay))));
1972
+ if (reserved > 0) wait = Math.max(wait, Math.min(reserved, over(recent, limit - this.chatReserveOf(relay, now))));
1883
1973
  }
1884
1974
  const writer = firstWriter(who);
1885
1975
  const waiting = (lane) => {
@@ -1989,6 +2079,12 @@ var RelayTransport = class {
1989
2079
  if (share === void 0) return this.perMinute;
1990
2080
  return this.perMinuteGiven ? Math.min(this.perMinute, share) : share;
1991
2081
  }
2082
+ /** What the chats that need the relays keep on this relay (`CHAT_RESERVE_PER_CHAT`), never less than `reserveOf`. */
2083
+ chatReserveOf(relay, now) {
2084
+ let needing = 0;
2085
+ for (const need of this.chatNeeds.values()) if (now - Math.max(need.urgentAt, need.refused.get(relay) ?? -Infinity) < 6e4) needing++;
2086
+ return Math.max(this.reserveOf(relay), Math.min(needing * 3, Math.floor(this.limitOf(relay) * CHAT_RESERVE_MOST_SHARE)));
2087
+ }
1992
2088
  /** What groups leave a chat on this relay: `CHAT_RESERVE`, or a third of a smaller budget. */
1993
2089
  reserveOf(relay) {
1994
2090
  return Math.min(10, Math.floor(this.limitOf(relay) / 3));
@@ -5505,6 +5601,7 @@ function wrapDataChannel(dc) {
5505
5601
  close() {
5506
5602
  dc.close();
5507
5603
  },
5604
+ binary: true,
5508
5605
  onMessage: null,
5509
5606
  onClose: null
5510
5607
  };
@@ -6141,6 +6238,17 @@ var DEPARTED_READ_MS = EXPECT_PEER_MS;
6141
6238
  /** A chat whose contact was never seen (an invite just sent) keeps looking at the active pace this long. */
6142
6239
  var AWAITING_PEER_MS = 6e5;
6143
6240
  /**
6241
+ * An invite this side made that nobody used, once no longer awaited (`AWAITING_PEER_MS`), is read less often the older
6242
+ * it is: a fifth of its age between reads, up to this. Read at the background pace instead, 15 unused invites (their
6243
+ * keys and their mailboxes) asked the relays for 60 reads a minute for as long as the app ran: the relays' minute went
6244
+ * to invites nobody may ever open, and a join on one was noticed 90 s later (bug hunt 1013-1642, 2026-10-13).
6245
+ */
6246
+ var UNUSED_INVITE_WAIT_MAX_MS = 18e4;
6247
+ /** The wait between reads of an unused invite of age `age` (`UNUSED_INVITE_WAIT_MAX_MS`), never shorter than the pace's `interval`. */
6248
+ function unusedInviteWait(age, interval) {
6249
+ return Math.max(interval, Math.min(UNUSED_INVITE_WAIT_MAX_MS, Math.round(age / 5)));
6250
+ }
6251
+ /**
6144
6252
  * A group link's peer whose packet advertises and carries no `_tr` on every read for this long publishes none: what it
6145
6253
  * said before is forgotten (WISP 902 § Transports). Not at the first such packet: an app with no WebRTC (a Linux
6146
6254
  * Desktop) publishes its `_tr` only once a native endpoint is up, seconds after its first packet of a run, and what it
@@ -6206,6 +6314,8 @@ var LinkSession = class {
6206
6314
  startedAt = Date.now();
6207
6315
  /** From when a peer never seen is awaited (`AWAITING_PEER_MS`): never later than this start, whatever the clock said when the chat was made. */
6208
6316
  awaitingSince;
6317
+ /** This side's invite, nobody used yet (`LinkSessionOptions.invite`). */
6318
+ invite;
6209
6319
  intervals;
6210
6320
  fastPollUntil = 0;
6211
6321
  /** An offer to a saved contact is out: from then on its fast window looks less often (`OFFER_FAST_MS`); 0 for none. */
@@ -6261,6 +6371,7 @@ var LinkSession = class {
6261
6371
  this.events = options.events ?? {};
6262
6372
  this.firstPublish = options.firstPublish ?? "at-start";
6263
6373
  this.awaitingSince = Math.min(options.awaitingSince ?? this.startedAt, this.startedAt);
6374
+ this.invite = options.invite ?? (() => false);
6264
6375
  }
6265
6376
  get peerPresence() {
6266
6377
  return this.presence;
@@ -6434,8 +6545,8 @@ var LinkSession = class {
6434
6545
  async setRtcSignal(signal, reportFailure = false) {
6435
6546
  if (this.rtcSignal === signal) return;
6436
6547
  this.rtcSignal = signal;
6437
- if (reportFailure) await this.publish();
6438
- else await this.publish().catch(() => {});
6548
+ if (reportFailure) await this.publish(signal === null);
6549
+ else await this.publish(signal === null).catch(() => {});
6439
6550
  if (signal) this.pollNow();
6440
6551
  }
6441
6552
  /**
@@ -6508,6 +6619,7 @@ var LinkSession = class {
6508
6619
  const stepping = this.fastStepsAfter ? Date.now() - this.fastStepsAfter : -1;
6509
6620
  if (pace === "fast" && stepping >= 0) return Math.min(4 * interval, Math.max(2 * interval, stepping));
6510
6621
  if (pace === "fast" || pace === "connected" || since < 0) return interval;
6622
+ if (pace === "background" && this.presence.lastPacketAt === 0 && this.invite()) return unusedInviteWait(Date.now() - this.awaitingSince, interval);
6511
6623
  return Math.min(interval, Math.max(2 * this.intervals.fast, since));
6512
6624
  }
6513
6625
  /**
@@ -6519,13 +6631,17 @@ var LinkSession = class {
6519
6631
  watching() {
6520
6632
  return Date.now() < this.watchUntil && this.rtcSignal === null && !(this.presence.online && this.presence.lastPacketAt > this.watchFrom);
6521
6633
  }
6634
+ /** A contact never seen, whose invite was sent lately (`AWAITING_PEER_MS`): its join is due. */
6635
+ awaitingPeer() {
6636
+ return this.presence.lastPacketAt === 0 && Date.now() - this.awaitingSince < 6e5;
6637
+ }
6522
6638
  /** How urgently this link looks right now. */
6523
6639
  pace() {
6524
6640
  if (Date.now() < this.stalledUntil) return "fast";
6525
6641
  if (this.connected) return "connected";
6526
6642
  if (Date.now() < this.fastPollUntil) return "fast";
6527
6643
  if (Date.now() < this.watchUntil) return "active";
6528
- if (!this.active && this.presence.lastPacketAt === 0 && Date.now() - this.awaitingSince < 6e5) return "active";
6644
+ if (!this.active && this.awaitingPeer()) return "active";
6529
6645
  if (!this.active) return "background";
6530
6646
  return Date.now() - this.lastActivity > 6e4 ? "idle" : "active";
6531
6647
  }
@@ -6582,7 +6698,9 @@ var LinkSession = class {
6582
6698
  }, this.encKey);
6583
6699
  const started = Date.now();
6584
6700
  try {
6585
- const options = rtcSignal && rtcSignal !== this.rtcSignalOut ? { signal: true } : this.watching() ? { watch: true } : upkeep && this.connected ? { background: true } : void 0;
6701
+ const awaited = this.connected || this.presence.online || this.sentBuffer.length > 0 || this.callSignal !== null || this.awaitingPeer();
6702
+ const takesBack = !rtcSignal && this.rtcSignalOut !== null;
6703
+ const options = rtcSignal && rtcSignal !== this.rtcSignalOut ? { signal: true } : this.watching() ? { watch: true } : upkeep && (this.connected || takesBack) || !rtcSignal && !awaited ? { background: true } : void 0;
6586
6704
  await this.transport.publish(this.identity, built.records, options);
6587
6705
  } catch (error) {
6588
6706
  const ms = Date.now() - started, waiting = isDiscoveryBudgetError(error);
@@ -6891,7 +7009,9 @@ var ICE_GATHERING_TIMEOUT_MS = 5e3;
6891
7009
  * settle); where they do not, every offer of a first pairing waited the full 5 s, twice when the inviter offered too
6892
7010
  * (One's e2e runs: 13 offers of 89 at 5 s, 9 more at 1.3-3 s, 2026-10-05). An offer without one still connects to most
6893
7011
  * contacts (their checks learn this side's address from its own); behind a restricted NAT on the contact's side it may
6894
- * not, and the next offer of the chat then waits as long as it takes (`fullGather`).
7012
+ * not, and the next offer of the chat then waits as long as it takes (`fullGather`). An answer is bounded the same way:
7013
+ * it waited the full 5 s, and two CLI daemons whose STUN server swallowed every request went live 10 s after the offer
7014
+ * rather than 2 s (calls bug hunt, 2026-10-12).
6895
7015
  */
6896
7016
  var OFFER_HOST_GATHER_MS = 2e3;
6897
7017
  /** The data link keeps collecting this long after the candidate it waited for came (a call keeps 400 ms). */
@@ -6922,6 +7042,14 @@ var REANSWERS = 2;
6922
7042
  * backoff (meshSignals, PR #1363). Offers through members cost no relay request; over the relays four is still a few.
6923
7043
  */
6924
7044
  var ANSWER_REFUSED_REDIALS = 4;
7045
+ /**
7046
+ * The same race a moment later: setRemoteDescription resolves, and the connection closes right after it (8 ms on a
7047
+ * loaded core). A connection that ends within this long of its answer going in was refused too: no network fails one
7048
+ * that soon (ICE gives up after tens of seconds), so it says nothing about direct connections (`DirectEvidence`).
7049
+ * Taken for a network that lets none through, an edge between two CLIs left WebRTC for the run, and a member whose
7050
+ * app has WebRTC alone (one from before native group links) was never reached again (groupCompat, 2026-10-12).
7051
+ */
7052
+ var ANSWER_REFUSED_AFTER_MS = 1e3;
6925
7053
  /** An offer this close to the end of the offerer's attempt is not answered again: the new answer would come too late. */
6926
7054
  var REANSWER_MARGIN_MS = 15e3;
6927
7055
  /**
@@ -6953,12 +7081,13 @@ var DataLink = class {
6953
7081
  pc = null;
6954
7082
  myOfferTs = 0;
6955
7083
  /**
6956
- * An offer of this side's that went without a public candidate came to nothing (it was answered, and no path
6957
- * connected): the next one waits for its STUN servers as long as it takes (`ICE_GATHERING_TIMEOUT_MS`).
7084
+ * An offer or answer of this side's that went without a public candidate came to nothing (both descriptions were
7085
+ * exchanged, and no path connected): the next one waits for its STUN servers as long as it takes
7086
+ * (`ICE_GATHERING_TIMEOUT_MS`).
6958
7087
  */
6959
7088
  fullGather = false;
6960
- /** The offer out has no public candidate (as it went: the connection's description gains any that come later). */
6961
- offerLacksPublic = false;
7089
+ /** The offer or answer out has no public candidate (as it went: the connection's description gains any that come later). */
7090
+ sentLacksPublic = false;
6962
7091
  lastSignalTs = 0;
6963
7092
  /** The peer's description as this connection was given it: Chrome shows it as `remoteDescription` only once applied. */
6964
7093
  remoteSdp = null;
@@ -7004,7 +7133,7 @@ var DataLink = class {
7004
7133
  this.options.setFastPoll(true, true);
7005
7134
  }
7006
7135
  this.myOfferTs = Date.now();
7007
- this.offerLacksPublic = !PUBLIC_CANDIDATE.test(pc.localDescription?.sdp ?? "");
7136
+ this.sentLacksPublic = !PUBLIC_CANDIDATE.test(pc.localDescription?.sdp ?? "");
7008
7137
  const signal = {
7009
7138
  t: "o",
7010
7139
  ts: this.myOfferTs,
@@ -7110,9 +7239,12 @@ var DataLink = class {
7110
7239
  this.reset();
7111
7240
  if (evidence) this.options.onDirect?.(evidence);
7112
7241
  }
7113
- /** This side's offer went with no public candidate, was answered, and came to nothing: the next offer gathers for as long as it takes. */
7242
+ /**
7243
+ * This side's offer went with no public candidate and was answered, or its answer went with none, and it came to
7244
+ * nothing: the next offer or answer gathers for as long as it takes.
7245
+ */
7114
7246
  noteNoPublic(ended) {
7115
- if (ended && this.myOfferTs && this.offerLacksPublic && this.state === "connecting") this.fullGather = true;
7247
+ if (ended && (this.myOfferTs || this.answered) && this.sentLacksPublic && this.state === "connecting") this.fullGather = true;
7116
7248
  }
7117
7249
  /**
7118
7250
  * What this attempt says about direct connections if it ends now without opening: nothing unless both descriptions
@@ -7127,17 +7259,22 @@ var DataLink = class {
7127
7259
  /**
7128
7260
  * The attempt on this connection failed (it timed out, ICE failed or closed, its channel closed). An answer the
7129
7261
  * offerer may not have read yet is made again for the same offer while it still stands (`REANSWERS`); anything
7130
- * else goes back to idle.
7262
+ * else goes back to idle. `byConnection`: the connection said so itself, rather than a timer of this link's.
7131
7263
  */
7132
- failed() {
7264
+ failed(byConnection = false) {
7133
7265
  if (this.state === "offering" && this.remoteSdp) {
7134
7266
  this.answerRefused("failed");
7135
7267
  return;
7136
7268
  }
7269
+ if (byConnection && this.state === "connecting" && this.myOfferTs && Date.now() - this.connectingSince < ANSWER_REFUSED_AFTER_MS) {
7270
+ this.answerRefused("failed");
7271
+ return;
7272
+ }
7137
7273
  const answered = this.state === "connecting" ? this.answered : null;
7138
7274
  const left = answered ? CONNECT_TIMEOUT_MS - (Date.now() - answered.at) : 0;
7139
- const evidence = this.directEvidence();
7140
- this.noteNoPublic(true);
7275
+ const givenUp = !!answered && this.options.offerStanding?.(answered.offer.ts) === false;
7276
+ const evidence = givenUp ? null : this.directEvidence();
7277
+ this.noteNoPublic(!givenUp);
7141
7278
  if (answered && answered.again < 2 && left > REANSWER_MARGIN_MS && this.options.offerStanding?.(answered.offer.ts)) {
7142
7279
  answered.again++;
7143
7280
  traceLink(this.options.myPubKeyZ32, "reanswer", {
@@ -7178,6 +7315,7 @@ var DataLink = class {
7178
7315
  await pc.setLocalDescription(await pc.createAnswer());
7179
7316
  });
7180
7317
  if (!pc) return;
7318
+ this.sentLacksPublic = !PUBLIC_CANDIDATE.test(pc.localDescription?.sdp ?? "");
7181
7319
  const signal = {
7182
7320
  t: "a",
7183
7321
  ts: Date.now(),
@@ -7207,7 +7345,7 @@ var DataLink = class {
7207
7345
  await waitForIceGathering(pc, ICE_GATHERING_TIMEOUT_MS, {
7208
7346
  stallMs: GATHER_STALL_MS,
7209
7347
  settleMs: 150,
7210
- ...offer && !this.fullGather ? { hostBoundMs: OFFER_HOST_GATHER_MS } : {}
7348
+ ...!this.fullGather ? { hostBoundMs: OFFER_HOST_GATHER_MS } : {}
7211
7349
  });
7212
7350
  if (this.pc !== pc) return null;
7213
7351
  const ms = Date.now() - gathering;
@@ -7254,7 +7392,7 @@ var DataLink = class {
7254
7392
  tracePair(this.options.myPubKeyZ32, pc);
7255
7393
  });
7256
7394
  dc.addEventListener("close", () => {
7257
- if (this.pc === pc) this.failed();
7395
+ if (this.pc === pc) this.failed(true);
7258
7396
  });
7259
7397
  pc.addEventListener("connectionstatechange", () => {
7260
7398
  if (this.pc !== pc) return;
@@ -7263,7 +7401,7 @@ var DataLink = class {
7263
7401
  if (pc.connectionState === "connected") this.options.onDisconnected?.(false);
7264
7402
  }
7265
7403
  this.disconnectTimer = null;
7266
- if (pc.connectionState === "failed" || pc.connectionState === "closed") this.failed();
7404
+ if (pc.connectionState === "failed" || pc.connectionState === "closed") this.failed(true);
7267
7405
  else if (pc.connectionState === "disconnected") {
7268
7406
  if (this.state === "open") this.options.onDisconnected?.(true);
7269
7407
  this.disconnectTimer = setTimeout(() => {
@@ -9946,6 +10084,7 @@ var DhtDelivery = class DhtDelivery {
9946
10084
  fastUntil = 0;
9947
10085
  live = false;
9948
10086
  active = false;
10087
+ startedAt = Date.now();
9949
10088
  /** The next read was asked for (a refresh, a fresh packet of the contact): it is not a background one. */
9950
10089
  urgent = false;
9951
10090
  /** Reads left that are signaling: the contact is leaving DHT only, and the live link waits on them (`expect`). */
@@ -10889,11 +11028,20 @@ var DhtDelivery = class DhtDelivery {
10889
11028
  get pollMs() {
10890
11029
  if (this.options.pollMs) return this.options.pollMs;
10891
11030
  const now = Date.now();
11031
+ const unused = this.unusedInviteAge(now);
11032
+ if (unused !== void 0 && !this.active && now >= this.fastUntil) return unusedInviteWait(unused, this.mode === "dht" ? DHT_POLL_MS : STREAM_POLL_MS);
10892
11033
  if (this.mode === "dht" || this.state.peerMode === "dht" && now < this.leavingUntil || now < this.fastUntil) return DHT_POLL_MS;
10893
11034
  if (this.live) return LIVE_POLL_MS;
10894
11035
  if (this.state.pending && this.state.pending.expires > now) return DHT_POLL_MS;
10895
11036
  return this.active ? ACTIVE_DHT_POLL_MS : STREAM_POLL_MS;
10896
11037
  }
11038
+ /** How long ago this side's invite was made, while nobody used it and it is no longer awaited (`AWAITING_PEER_MS`). */
11039
+ unusedInviteAge(now) {
11040
+ const madeAt = this.options.inviteMadeAt;
11041
+ if (madeAt === void 0 || this.options.credentials.peerKey || this.state.peerSequence) return void 0;
11042
+ const age = now - Math.min(madeAt, this.startedAt);
11043
+ return age >= 6e5 ? age : void 0;
11044
+ }
10897
11045
  schedule() {
10898
11046
  if (!this.running || this.ticking) return;
10899
11047
  if (this.timer) clearTimeout(this.timer);
@@ -11932,7 +12080,7 @@ async function verifyPeerProof(event, c, readStorage) {
11932
12080
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
11933
12081
  } else if (c.adapter === "keet-import") {
11934
12082
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
11935
- const { default: IdentityKey } = await import("./keet-identity-key-BLli1rE4.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
12083
+ const { default: IdentityKey } = await import("./keet-identity-key-GE5nr3zt.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
11936
12084
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
11937
12085
  } else throw new Error("Unsupported proof adapter");
11938
12086
  }
@@ -14475,6 +14623,11 @@ var SERVICES_CAPABILITY = "services/1";
14475
14623
  * confirmed byte, checked by digest (`pf-offer` … frames, `chatFiles.ts`). Without it, files/2 and 100 MiB.
14476
14624
  */
14477
14625
  var FILES_CAPABILITY = "files/3";
14626
+ /**
14627
+ * A file's bytes as binary messages (WISP 501 § files/4): beside `files/3`, on a session whose channel carries binary
14628
+ * messages, a chunk travels as it is (`encodeFileData`, `chatFiles.ts`) and not as base64url text in a `pf-data` frame.
14629
+ */
14630
+ var FILES_BINARY_CAPABILITY = "files/4";
14478
14631
  /** The typing indicator: `paired-typing` frames on this session, 1:1 chats only (WISP 401 § Typing, `pairedTyping.ts`). */
14479
14632
  var TYPING_CAPABILITY = "typing/1";
14480
14633
  /** Reactions to messages: `paired-reaction` frames on this session, 1:1 chats only (WISP 401 § Reactions, `reactions.ts`). */
@@ -14514,6 +14667,7 @@ var KNOWN_SESSION_CAPABILITIES = [
14514
14667
  CALLS_CAPABILITY,
14515
14668
  SERVICES_CAPABILITY,
14516
14669
  FILES_CAPABILITY,
14670
+ FILES_BINARY_CAPABILITY,
14517
14671
  TYPING_CAPABILITY,
14518
14672
  REACTIONS_CAPABILITY,
14519
14673
  EDIT_CAPABILITY,
@@ -15539,6 +15693,11 @@ var FILE_LIMITS = {
15539
15693
  chunkBytes: 16384,
15540
15694
  /** Bytes a sender has sent and not seen confirmed: throughput is this per round trip. */
15541
15695
  windowBytes: 1048576,
15696
+ /**
15697
+ * Bytes all of a chat's files have sent and not seen confirmed, together. Three files' windows at once were 3 MiB, and
15698
+ * as base64 text past what a session's receive queue holds (`SESSION_RECEIVE_PENDING`, 3.75 MiB).
15699
+ */
15700
+ chatWindowBytes: 2097152,
15542
15701
  /** A receiver asks its person before taking a file larger than this. */
15543
15702
  askAboveBytes: 26214400,
15544
15703
  /** Files taken without asking, per contact, while stored. Past it, every file is asked about. */
@@ -15607,6 +15766,44 @@ function transferStalled(record, movedAt, restored, now) {
15607
15766
  }
15608
15767
  var key = (direction, id) => `${direction}:${id}`;
15609
15768
  var isInt$1 = (value, max = Number.MAX_SAFE_INTEGER) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 && value <= max;
15769
+ /**
15770
+ * files/4 (WISP 501 § files/4): a chunk as one binary message of the session, in place of the base64url text of a
15771
+ * `pf-data` frame, which is a third more than the bytes it carries:
15772
+ *
15773
+ * kind 0x04 (1) | id length (1) | id (ASCII) | offset (8, big endian) | data (1 to `FILE_LIMITS.chunkBytes`)
15774
+ */
15775
+ var FILE_DATA_KIND = 4;
15776
+ var FILE_DATA_OFFSET_BYTES = 8;
15777
+ /** The binary message for the bytes of file `id` at `offset`. Throws on what no receiver would take. */
15778
+ function encodeFileData(id, offset, data) {
15779
+ if (!ID.test(id) || !isInt$1(offset) || !data.length || data.length > FILE_LIMITS.chunkBytes) throw new Error("Invalid file data");
15780
+ const head = 2 + id.length;
15781
+ const out = new Uint8Array(head + FILE_DATA_OFFSET_BYTES + data.length);
15782
+ out[0] = 4;
15783
+ out[1] = id.length;
15784
+ for (let i = 0; i < id.length; i++) out[2 + i] = id.charCodeAt(i);
15785
+ const view = new DataView(out.buffer);
15786
+ view.setUint32(head, Math.floor(offset / 2 ** 32));
15787
+ view.setUint32(head + 4, offset % 2 ** 32);
15788
+ out.set(data, head + FILE_DATA_OFFSET_BYTES);
15789
+ return out;
15790
+ }
15791
+ /** What a binary message from the contact says, or null when it is not a well-formed file data message. `data` is a view of `message`. */
15792
+ function decodeFileData(message) {
15793
+ if (message.length < 2 || message[0] !== 4) return null;
15794
+ const head = 2 + message[1], body = head + FILE_DATA_OFFSET_BYTES;
15795
+ if (message.length <= body || message.length - body > FILE_LIMITS.chunkBytes) return null;
15796
+ const id = String.fromCharCode(...message.subarray(2, head));
15797
+ if (!ID.test(id)) return null;
15798
+ const view = new DataView(message.buffer, message.byteOffset, message.byteLength);
15799
+ const high = view.getUint32(head);
15800
+ if (high > 2097151) return null;
15801
+ return {
15802
+ id,
15803
+ offset: high * 2 ** 32 + view.getUint32(head + 4),
15804
+ data: message.subarray(body)
15805
+ };
15806
+ }
15610
15807
  /** What a refusal means to the sender's person. */
15611
15808
  function refusalText(why, room) {
15612
15809
  switch (why) {
@@ -15643,6 +15840,10 @@ function refusalText(why, room) {
15643
15840
  var ChatFiles = class {
15644
15841
  host;
15645
15842
  entries = /* @__PURE__ */ new Map();
15843
+ /** Files sending that may have bytes not confirmed yet: what `inFlight` adds up (the rest are left out as it goes). */
15844
+ moving = /* @__PURE__ */ new Set();
15845
+ /** Files that stopped sending for the chat's window alone: they go on once another's bytes are confirmed. */
15846
+ held = /* @__PURE__ */ new Set();
15646
15847
  attached = false;
15647
15848
  peerRoomValue = null;
15648
15849
  constructor(host) {
@@ -15702,6 +15903,15 @@ var ChatFiles = class {
15702
15903
  send(frame) {
15703
15904
  return this.attached && this.host.send(frame);
15704
15905
  }
15906
+ sendData(id, offset, data) {
15907
+ if (!this.host.sendData) return this.send({
15908
+ t: "pf-data",
15909
+ id,
15910
+ offset,
15911
+ data: toBase64Url(data)
15912
+ });
15913
+ return this.attached && this.host.sendData(id, offset, data);
15914
+ }
15705
15915
  /** A session that agreed files/3 is open: say what fits here, then offer again what is not finished. */
15706
15916
  attach() {
15707
15917
  this.attached = true;
@@ -15720,6 +15930,8 @@ var ChatFiles = class {
15720
15930
  if (!this.attached) return;
15721
15931
  this.attached = false;
15722
15932
  this.peerRoomValue = null;
15933
+ this.moving.clear();
15934
+ this.held.clear();
15723
15935
  for (const entry of this.entries.values()) {
15724
15936
  if (entry.out) {
15725
15937
  entry.out.generation++;
@@ -15843,10 +16055,34 @@ var ChatFiles = class {
15843
16055
  const at = offset - out.block.start;
15844
16056
  return out.block.bytes.subarray(at, at + length);
15845
16057
  }
15846
- shouldPump(entry) {
16058
+ /** Whether this file's own window lets it send more. */
16059
+ fileMayPump(entry) {
15847
16060
  const { record } = entry, out = entry.out;
15848
16061
  return this.attached && record.state === "active" && out.next < record.file.size && out.next - record.confirmed < FILE_LIMITS.windowBytes;
15849
16062
  }
16063
+ shouldPump(entry) {
16064
+ return this.fileMayPump(entry) && this.inFlight() < FILE_LIMITS.chatWindowBytes;
16065
+ }
16066
+ /** Bytes this chat's files sent and have not seen confirmed. */
16067
+ inFlight() {
16068
+ let bytes = 0;
16069
+ for (const entry of this.moving) {
16070
+ const out = entry.out, { record } = entry;
16071
+ if (!out || record.state !== "active" || out.next <= record.confirmed) {
16072
+ this.moving.delete(entry);
16073
+ continue;
16074
+ }
16075
+ bytes += out.next - record.confirmed;
16076
+ }
16077
+ return bytes;
16078
+ }
16079
+ /** Bytes were confirmed, or a file stopped sending: the files the chat's window held go on, before the one that freed it. */
16080
+ wakeHeld() {
16081
+ for (const entry of [...this.held]) {
16082
+ this.held.delete(entry);
16083
+ this.pump(entry);
16084
+ }
16085
+ }
15850
16086
  /**
15851
16087
  * Whether the next `length` bytes go. Within the file's size they always do; past it the receiver is having parts
15852
16088
  * sent again, which nothing it says bounds, so this side does.
@@ -15877,17 +16113,13 @@ var ChatFiles = class {
15877
16113
  this.end(entry, "failed", "Your contact asked for the same part of this file too many times");
15878
16114
  break;
15879
16115
  }
15880
- if (!this.send({
15881
- t: "pf-data",
15882
- id: entry.record.id,
15883
- offset,
15884
- data: toBase64Url(chunk)
15885
- })) {
16116
+ if (!this.sendData(entry.record.id, offset, chunk)) {
15886
16117
  refused = true;
15887
16118
  break;
15888
16119
  }
15889
16120
  out.next = offset + chunk.length;
15890
16121
  out.sent += chunk.length;
16122
+ this.moving.add(entry);
15891
16123
  }
15892
16124
  } catch (error) {
15893
16125
  if (generation === out.generation) {
@@ -15902,7 +16134,7 @@ var ChatFiles = class {
15902
16134
  if (generation === out.generation && this.shouldPump(entry)) {
15903
16135
  if (refused) out.wake = setTimeout(() => void this.pump(entry), FILE_LIMITS.sendRetryMs);
15904
16136
  else this.pump(entry);
15905
- }
16137
+ } else if (generation === out.generation && this.fileMayPump(entry)) this.held.add(entry);
15906
16138
  }
15907
16139
  }
15908
16140
  async sendSum(entry) {
@@ -15934,7 +16166,7 @@ var ChatFiles = class {
15934
16166
  return [...this.entries.values()].filter((e) => e.record.direction === "in" && e.record.state === "asking").length;
15935
16167
  }
15936
16168
  activeIncoming(except) {
15937
- return [...this.entries.values()].filter((e) => e !== except && e.record.direction === "in" && (e.record.state === "active" || e.record.state === "verifying")).length;
16169
+ return [...this.entries.values()].filter((e) => e !== except && e.record.direction === "in" && (e.record.state === "active" || e.record.state === "verifying" || e.in?.starting)).length;
15938
16170
  }
15939
16171
  /**
15940
16172
  * Removes what this side stored of an incoming file that ends here. Through its target, opened now if need be: after
@@ -15961,9 +16193,15 @@ var ChatFiles = class {
15961
16193
  }
15962
16194
  return incoming.target;
15963
16195
  }
15964
- /** An accepted file goes when a session is open and fewer than three others arrive at once. */
16196
+ /**
16197
+ * An accepted file goes when a session is open and fewer than three others arrive at once. One whose target is still
16198
+ * being opened counts among the three: counted only once active, every file offered or queued meanwhile went too, and
16199
+ * the windows of ten files and more at once overflowed the session's receive queue.
16200
+ */
15965
16201
  startIncoming(entry) {
15966
16202
  if (!this.attached || transferEnded(entry.record) || entry.record.state === "asking" || entry.record.state === "paused" && entry.record.pausedBy === "me") return;
16203
+ const incoming = entry.in;
16204
+ if (incoming.starting) return;
15967
16205
  if (this.activeIncoming(entry) >= FILE_LIMITS.maxActiveIncoming) {
15968
16206
  if (entry.record.state !== "queued") {
15969
16207
  entry.record.state = "queued";
@@ -15976,9 +16214,13 @@ var ChatFiles = class {
15976
16214
  });
15977
16215
  return;
15978
16216
  }
16217
+ incoming.starting = true;
15979
16218
  this.target(entry).then(() => {
15980
- if (transferEnded(entry.record) || !this.attached) return;
15981
- if (entry.record.state === "paused" && entry.record.pausedBy === "me") return;
16219
+ incoming.starting = false;
16220
+ if (transferEnded(entry.record) || !this.attached || entry.record.state === "paused" && entry.record.pausedBy === "me") {
16221
+ this.startNext();
16222
+ return;
16223
+ }
15982
16224
  entry.record.state = "active";
15983
16225
  entry.record.pausedBy = void 0;
15984
16226
  entry.in.gapAt = void 0;
@@ -15991,12 +16233,14 @@ var ChatFiles = class {
15991
16233
  entry.in.heardAt = this.now();
15992
16234
  this.armNudge(entry);
15993
16235
  }, (error) => {
16236
+ incoming.starting = false;
15994
16237
  this.end(entry, "failed", `Could not store the file: ${error instanceof Error ? error.message : String(error)}`);
15995
16238
  this.send({
15996
16239
  t: "pf-refuse",
15997
16240
  id: entry.record.id,
15998
16241
  why: "no-room"
15999
16242
  });
16243
+ this.startNext();
16000
16244
  });
16001
16245
  }
16002
16246
  /** The next file waiting its turn, once one ends. */
@@ -16235,7 +16479,9 @@ var ChatFiles = class {
16235
16479
  if (record.state !== "active" || !incoming.target) return;
16236
16480
  incoming.heardAt = this.now();
16237
16481
  const { offset, data } = frame;
16238
- if (!isInt$1(offset) || typeof data !== "string" || !data.length || data.length > Math.ceil(FILE_LIMITS.chunkBytes * 4 / 3) || !DATA.test(data)) return;
16482
+ const binary = data instanceof Uint8Array;
16483
+ if (!isInt$1(offset) || !(binary || typeof data === "string") || !data.length) return;
16484
+ if (!binary && (data.length > Math.ceil(FILE_LIMITS.chunkBytes * 4 / 3) || !DATA.test(data))) return;
16239
16485
  if (offset < incoming.written) {
16240
16486
  if (incoming.stored === incoming.written) this.send({
16241
16487
  t: "pf-got",
@@ -16255,7 +16501,7 @@ var ChatFiles = class {
16255
16501
  }
16256
16502
  return;
16257
16503
  }
16258
- const bytes = fromBase64Url(data);
16504
+ const bytes = binary ? data : fromBase64Url(data);
16259
16505
  if (!bytes.length || bytes.length > FILE_LIMITS.chunkBytes || offset + bytes.length > record.file.size) return;
16260
16506
  incoming.written += bytes.length;
16261
16507
  const target = incoming.target;
@@ -16440,6 +16686,7 @@ var ChatFiles = class {
16440
16686
  record.state = "active";
16441
16687
  record.pausedBy = record.waitingFor = void 0;
16442
16688
  this.changed(outgoing);
16689
+ this.wakeHeld();
16443
16690
  if (record.confirmed === record.file.size) this.sendSum(outgoing);
16444
16691
  else {
16445
16692
  this.armStall(outgoing);
@@ -16459,11 +16706,13 @@ var ChatFiles = class {
16459
16706
  record.waitingFor = frame.why === "busy" ? "busy" : "consent";
16460
16707
  }
16461
16708
  this.changed(outgoing);
16709
+ this.wakeHeld();
16462
16710
  return;
16463
16711
  case "pf-got":
16464
16712
  if (!isInt$1(frame.offset) || frame.offset <= record.confirmed || frame.offset > out.next) return;
16465
16713
  record.confirmed = frame.offset;
16466
16714
  this.changed(outgoing, true);
16715
+ this.wakeHeld();
16467
16716
  if (record.confirmed === record.file.size) this.sendSum(outgoing);
16468
16717
  else {
16469
16718
  this.armStall(outgoing);
@@ -16493,6 +16742,8 @@ var ChatFiles = class {
16493
16742
  clearTimeout(entry.out.wake);
16494
16743
  entry.out.block = void 0;
16495
16744
  entry.out.source = void 0;
16745
+ this.moving.delete(entry);
16746
+ this.held.delete(entry);
16496
16747
  }
16497
16748
  if (entry.in) {
16498
16749
  const incoming = entry.in;
@@ -16502,6 +16753,7 @@ var ChatFiles = class {
16502
16753
  });
16503
16754
  }
16504
16755
  this.changed(entry);
16756
+ if (entry.out) this.wakeHeld();
16505
16757
  }
16506
16758
  entry(direction, id) {
16507
16759
  const entry = this.entries.get(key(direction, id));
@@ -16550,6 +16802,7 @@ var ChatFiles = class {
16550
16802
  this.startNext();
16551
16803
  }
16552
16804
  this.changed(entry);
16805
+ if (entry.out) this.wakeHeld();
16553
16806
  }
16554
16807
  resume(direction, id) {
16555
16808
  const entry = this.entry(direction, id), { record } = entry;
@@ -17198,6 +17451,8 @@ var CarriedTransport = class {
17198
17451
  /** My last packet while the edge is down: what a member that just became reachable is handed. */
17199
17452
  mine = null;
17200
17453
  lastTimestamp = 0n;
17454
+ /** The date each packet `stamp` signed carries: the relays' transport takes it rather than check the signature again. */
17455
+ dated = /* @__PURE__ */ new WeakMap();
17201
17456
  /** My newest packet, wherever it went: what the edge hands the member over itself once it is ready (`linkReady`). */
17202
17457
  newest = null;
17203
17458
  /** The newest packet of the member's that came through a carrier, and the timestamp of the one a read last returned. */
@@ -17277,7 +17532,9 @@ var CarriedTransport = class {
17277
17532
  stamp(identity, records) {
17278
17533
  const now = BigInt(Date.now()) * 1000n;
17279
17534
  this.lastTimestamp = now > this.lastTimestamp ? now : this.lastTimestamp + 1n;
17280
- return createRelayPayload(identity, records, this.lastTimestamp);
17535
+ const payload = createRelayPayload(identity, records, this.lastTimestamp);
17536
+ this.dated.set(payload, this.lastTimestamp);
17537
+ return payload;
17281
17538
  }
17282
17539
  /**
17283
17540
  * The relays get the very packet members carried or the edge itself handed over, byte for byte, where the transport
@@ -17287,7 +17544,11 @@ var CarriedTransport = class {
17287
17544
  * its restart and then wait 40 s for (7 of 16 goodbyes on the admin in the member-back runs, 1 of 16 on dev, 2026-10-03).
17288
17545
  */
17289
17546
  toRelays(identity, records, payload, options) {
17290
- return this.inner.publishPayload ? this.inner.publishPayload(identity.pubKeyZ32, payload, options) : this.inner.publish(identity, records, options);
17547
+ const signedAt = this.dated.get(payload);
17548
+ return this.inner.publishPayload ? this.inner.publishPayload(identity.pubKeyZ32, payload, signedAt === void 0 ? options : {
17549
+ ...options,
17550
+ signedAt
17551
+ }) : this.inner.publish(identity, records, options);
17291
17552
  }
17292
17553
  /**
17293
17554
  * The packet the relays just took, handed to the member over the edge itself while it is up. An edge up reads nothing
@@ -17432,8 +17693,12 @@ var GROUP_FILE_LIMITS = {
17432
17693
  heardAhead: 256,
17433
17694
  /** Message ids in one `group-have`. */
17434
17695
  haveIds: 32,
17435
- /** A private group's `group-have` goes on an edge at most this often; a community's, from a member, every `communityHaveEveryMs`. */
17436
- haveEveryMs: 1e4,
17696
+ /**
17697
+ * `group-have` frames a private group's edge takes in `haveWindowMs`: what is to say is gathered for a second, then
17698
+ * goes. A community's, from a member, goes every `communityHaveEveryMs`.
17699
+ */
17700
+ haveFrames: 10,
17701
+ haveWindowMs: 1e4,
17437
17702
  communityHaveEveryMs: 6e4,
17438
17703
  /**
17439
17704
  * How long a want waits for an offer before the next holder is asked; a transfer that does not move for as long is
@@ -17866,6 +18131,14 @@ var CROSSED_WAIT_MS = 500;
17866
18131
  * takes over.
17867
18132
  */
17868
18133
  var CROSSED_FRESH_MS = 1e4;
18134
+ /**
18135
+ * A dial of the contact's that meets such a session waits this long for that session to answer a ping. It answers when
18136
+ * the dials crossed (the contact holds this side's dial too); it does not when the contact's app ended since and is
18137
+ * back: its dial then takes over. Refused outright, that dial left the contact waiting for the dead session's end, 16.6
18138
+ * to 18.9 s (CLI daemons over HyperDHT, the contact killed 1 to 3 s after this side's knock, 5 of 5). A round trip is
18139
+ * 7 ms on loopback and under 0.5 s over a relayed Iroh.
18140
+ */
18141
+ var CROSSED_PROBE_MS = 1500;
17869
18142
  /** A WebRTC attempt under way, not yet open: what a member's packet saying it has no WebRTC ends (`peerPacketTransports`). */
17870
18143
  var WEBRTC_ATTEMPT = /* @__PURE__ */ new Set([
17871
18144
  "offering",
@@ -18007,6 +18280,18 @@ var HANDLED_WAIT_MS = 1e4;
18007
18280
  * away (a phone that put it to sleep): the chat resumes as after a restart, not as a session the contact closed.
18008
18281
  */
18009
18282
  var WAKE_LOST_MS = 1e4;
18283
+ /**
18284
+ * What files/3 may hold on a session's channel (WISP 501, Backpressure): a quarter of its send budget (native and iroh
18285
+ * channels throw past 120 KiB), or the high water mark of a WebRTC channel, which has none.
18286
+ */
18287
+ function filesCap(channel) {
18288
+ return channel.sendBudget ? channel.sendBudget / 4 : LIMITS.sendHighWaterMark;
18289
+ }
18290
+ /**
18291
+ * How long after files last wrote on a channel, or last waited for room on it, an app's data keeps its own quarter above
18292
+ * their line (WISP 1200 § In a chat): a file waiting for `pf-got` holds its share meanwhile.
18293
+ */
18294
+ var FILES_IN_USE_MS = 2e3;
18010
18295
  /** Largest `paired-message` frame sent with a preview: a session fails on a frame over 60 KiB (`PairedSession`). */
18011
18296
  var MAX_PAIRED_MESSAGE_FRAME = 57344;
18012
18297
  /**
@@ -18357,6 +18642,7 @@ var GhostLink = class {
18357
18642
  });
18358
18643
  options.events?.onPairingProgress?.(progress);
18359
18644
  }) : null;
18645
+ const invite = options.pairingProgress?.role === "inviter" && !!options.pairing && !options.pairing.credentials.peerKey;
18360
18646
  this.dht = options.params.profile && options.pairing && options.dht ? new DhtDelivery({
18361
18647
  params: options.params,
18362
18648
  mode: this.deliveryMode,
@@ -18366,6 +18652,7 @@ var GhostLink = class {
18366
18652
  save: options.dht.save,
18367
18653
  pollMs: options.dht.pollMs,
18368
18654
  firstControlAfterMs: options.dht.firstControlAfterMs,
18655
+ ...invite && { inviteMadeAt: options.madeAt ?? Date.now() },
18369
18656
  capsRev: options.dht.capsRev,
18370
18657
  peerCapsRev: options.dht.peerCapsRev,
18371
18658
  peerAcceptsText: options.dht.peerAcceptsText,
@@ -18381,6 +18668,7 @@ var GhostLink = class {
18381
18668
  },
18382
18669
  pin: async (key) => {
18383
18670
  await options.pairing.pinPeer(key, true);
18671
+ if (invite) this.session.lookNow();
18384
18672
  if (this.isDataLinkOpen || !this.tracker || this.tracker.done) return;
18385
18673
  if (this.deliveryMode === "dht") {
18386
18674
  this.tracker.onDht("chosen");
@@ -18451,6 +18739,7 @@ var GhostLink = class {
18451
18739
  lastSeenTimestamp: options.lastSeenTimestamp,
18452
18740
  pollIntervals: options.pollIntervals,
18453
18741
  awaitingSince: options.madeAt,
18742
+ ...invite && { invite: () => !options.pairing.credentials.peerKey },
18454
18743
  getServices: options.getServices,
18455
18744
  firstPublish: options.firstPublish ?? (this.tracker && options.pairingProgress?.role === "joiner" && options.rtcAvailable !== false || this.resuming ? "after-first-poll" : "at-start"),
18456
18745
  events: {
@@ -18963,11 +19252,11 @@ var GhostLink = class {
18963
19252
  }
18964
19253
  start() {
18965
19254
  if (this.saidTransports) this.publishPacketTransports();
18966
- if (this.deliveryMode !== "dht") this.session.start();
18967
19255
  if (this.resuming && this.deliveryMode !== "dht") {
18968
19256
  this.session.expectPeer();
18969
19257
  this.resumeWaitUntil = Date.now() + RESUME_WAIT_MS;
18970
19258
  }
19259
+ if (this.deliveryMode !== "dht") this.session.start();
18971
19260
  if (this.tracker && !this.tracker.done && this.options.pairingProgress?.role === "joiner") {
18972
19261
  this.dht?.expect();
18973
19262
  this.dialEarly();
@@ -19089,6 +19378,7 @@ var GhostLink = class {
19089
19378
  disconnect() {
19090
19379
  this.closeRetired();
19091
19380
  this.dropCrossed();
19381
+ this.dropCrossedProbe();
19092
19382
  this.dropBlockedDial();
19093
19383
  this.switcher.stop();
19094
19384
  this.cancelCandidate();
@@ -20095,6 +20385,18 @@ var GhostLink = class {
20095
20385
  if (!this.options.params.profile || this.options.packetTransports) return true;
20096
20386
  return this.transportOffer().some((t) => t === "webrtc/1" ? !this.peerTransports || this.peerTransports.includes(t) : this.canDial(t) && !!this.peerTransports?.includes(t));
20097
20387
  }
20388
+ /**
20389
+ * Neither side can dial the other until something changes, past a first pairing: what the contact runs is known, and
20390
+ * no transport both run has WebRTC on both sides or an endpoint up on both (this side's, and the one its record
20391
+ * describes). A chat that gave its listener up to another (`yieldEndpoint`), or whose contact did, is so. It dials
20392
+ * again when that changes (a listener taken back, `registerEndpoint`; the record describing one, `learnPeerTransports`),
20393
+ * and reads at its own pace meanwhile: looks every 20 s for a dial with nothing to try, and the contact's fast looks
20394
+ * for an offer that could not come, read its key 2.5x to 4x as often as the background pace, for good (bug hunt,
20395
+ * 2026-10-12). A first pairing keeps both: the records are what it is reading for.
20396
+ */
20397
+ nothingToDialEitherWay() {
20398
+ return !(!!this.tracker && !this.tracker.done && this.tracker.progress.stage !== "on-dht") && !!this.peerTransports && !this.anythingToDial();
20399
+ }
20098
20400
  clearRace() {
20099
20401
  if (this.raceTimer) clearTimeout(this.raceTimer);
20100
20402
  this.raceTimer = null;
@@ -20394,7 +20696,7 @@ var GhostLink = class {
20394
20696
  return;
20395
20697
  }
20396
20698
  } else if (role !== "joiner" && this.myPubKeyZ32 > this.options.params.peerPubKeyZ32 && !this.resuming && !this.dialsPastRtc()) {
20397
- if (Date.now() - presenceSeenAt(presence) < 3e4 && presence.lastPacketAt !== this.offerAwaitedFor) {
20699
+ if (Date.now() - presenceSeenAt(presence) < 3e4 && presence.lastPacketAt !== this.offerAwaitedFor && !this.nothingToDialEitherWay()) {
20398
20700
  this.offerAwaitedFor = presence.lastPacketAt;
20399
20701
  this.session.expectPeer();
20400
20702
  }
@@ -20472,6 +20774,7 @@ var GhostLink = class {
20472
20774
  this.retryLook = null;
20473
20775
  const from = this.lastAutoConnectAt;
20474
20776
  if (!from || this.stopped || this.leaving || this.streamBlocked || this.keyStopped || !this.options.autoConnect) return;
20777
+ if (this.nothingToDialEitherWay()) return;
20475
20778
  this.retryLook = setTimeout(() => {
20476
20779
  this.retryLook = null;
20477
20780
  if (this.lastAutoConnectAt !== from || this.stopped || this.leaving || this.yielding || this.streamBlocked || this.keyStopped || this.channel || this.dialing || this.dataLink.state !== "idle") return;
@@ -20731,6 +21034,7 @@ var GhostLink = class {
20731
21034
  if (this.options.callsSupport) offered.push(CALLS_CAPABILITY);
20732
21035
  if (this.options.servicesSupport) offered.push(SERVICES_CAPABILITY);
20733
21036
  if (this.options.largeFilesSupport) offered.push(FILES_CAPABILITY);
21037
+ if (this.options.largeFilesSupport && this.options.binaryFilesSupport && this.channel?.binary) offered.push(FILES_BINARY_CAPABILITY);
20734
21038
  if (this.options.typingSupport) offered.push(TYPING_CAPABILITY);
20735
21039
  if (this.options.reactionsSupport) offered.push(REACTIONS_CAPABILITY);
20736
21040
  if (this.options.editSupport) offered.push(EDIT_CAPABILITY);
@@ -20767,6 +21071,10 @@ var GhostLink = class {
20767
21071
  get supportsLargeFiles() {
20768
21072
  return this.isDataLinkOpen && this.sessionCapabilities.agreed("files/3");
20769
21073
  }
21074
+ /** Both sides offer `files/4` beside `files/3` on the open session: a file's bytes go as binary messages. */
21075
+ get supportsBinaryFiles() {
21076
+ return this.supportsLargeFiles && this.sessionCapabilities.agreed("files/4");
21077
+ }
20770
21078
  /** Both sides offer `typing/1` on the open session: typing can be said and shown. */
20771
21079
  get supportsTyping() {
20772
21080
  return this.isDataLinkOpen && this.sessionCapabilities.agreed("typing/1");
@@ -20930,13 +21238,18 @@ var GhostLink = class {
20930
21238
  }
20931
21239
  /**
20932
21240
  * One data frame of an app open on both sides, on the live session only. An error when it did not go: nothing is
20933
- * kept to send later.
21241
+ * kept to send later. While the channel already holds a quarter of what it may queue (its send budget, or the high
21242
+ * water mark of a WebRTC channel), the frame is refused with `too-fast`, so the chat's messages and pings never wait
21243
+ * behind an app's data on a link slower than it sends (WISP 1200 § In a chat). While a file goes, that quarter sits
21244
+ * above what files may hold (`filesWritable`): files keep the channel at their own line for the whole transfer.
20934
21245
  */
20935
21246
  sendAppData(app, data) {
20936
21247
  if (!this.apps.open.has(app)) return "not-open";
20937
21248
  if (appDataBytes(data) > 32768) return "too-large";
20938
21249
  if (!this.channel || !this.isDataLinkOpen) return "offline";
20939
21250
  if (!this.supportsApps) return "peer-closed";
21251
+ const files = this.filesUse?.channel === this.channel && (this.filesUse.waiting > 0 || Date.now() - this.filesUse.at < FILES_IN_USE_MS) ? filesCap(this.channel) : 0;
21252
+ if (this.channel.bufferedAmount >= files + (this.channel.sendBudget ?? LIMITS.sendHighWaterMark) / 4) return "too-fast";
20940
21253
  const refused = this.apps.canSend(app, data);
20941
21254
  if (refused) return refused;
20942
21255
  try {
@@ -20987,19 +21300,57 @@ var GhostLink = class {
20987
21300
  }
20988
21301
  }
20989
21302
  /**
21303
+ * A file's bytes to the contact, on the open session: one binary message while both sides agreed `files/4` on it,
21304
+ * the `pf-data` frame with them as base64url text otherwise (WISP 501 § files/4). The form is chosen for each chunk,
21305
+ * so a transfer follows the session it is on. False when files/3 cannot flow now, or the channel has no room.
21306
+ */
21307
+ sendFileData(id, offset, data) {
21308
+ if (!this.supportsLargeFiles || !this.channel) return false;
21309
+ try {
21310
+ this.channel.send(this.supportsBinaryFiles ? encodeFileData(id, offset, data) : JSON.stringify({
21311
+ t: "pf-data",
21312
+ id,
21313
+ offset,
21314
+ data: toBase64Url(data)
21315
+ }));
21316
+ this.filesUsing(this.channel).at = Date.now();
21317
+ return true;
21318
+ } catch {
21319
+ return false;
21320
+ }
21321
+ }
21322
+ /** Files on a channel: when they last wrote on it, and how many wait for room. An app's data gets room above theirs. */
21323
+ filesUse = null;
21324
+ filesUsing(channel) {
21325
+ if (this.filesUse?.channel !== channel) this.filesUse = {
21326
+ channel,
21327
+ at: 0,
21328
+ waiting: 0
21329
+ };
21330
+ return this.filesUse;
21331
+ }
21332
+ /**
20990
21333
  * Resolves once the open session can take another files/3 data frame; undefined when it can now. A channel with a send budget (native and
20991
21334
  * iroh ones throw past 120 KiB) gives files a quarter of it, so a ping, a message or any other frame still fits
20992
- * while a file goes; others keep under the high water mark, as files/2 does.
21335
+ * while a file goes; others keep under the high water mark, as files/2 does. An app's data gets a quarter above that
21336
+ * line meanwhile (`sendAppData`).
20993
21337
  */
20994
21338
  filesWritable() {
20995
21339
  const channel = this.channel;
20996
21340
  if (!channel) return;
20997
- const cap = channel.sendBudget ? channel.sendBudget / 4 : LIMITS.sendHighWaterMark;
21341
+ const cap = filesCap(channel);
20998
21342
  if (channel.bufferedAmount < cap) return;
21343
+ const use = this.filesUsing(channel);
21344
+ use.waiting++;
20999
21345
  return (async () => {
21000
- while (this.channel === channel && channel.bufferedAmount >= cap) {
21001
- await channel.drained().catch(() => {});
21002
- if (this.channel === channel && channel.bufferedAmount >= cap) await new Promise((resolve) => setTimeout(resolve, 20));
21346
+ try {
21347
+ while (this.channel === channel && channel.bufferedAmount >= cap) {
21348
+ await channel.drained().catch(() => {});
21349
+ if (this.channel === channel && channel.bufferedAmount >= cap) await new Promise((resolve) => setTimeout(resolve, 20));
21350
+ }
21351
+ } finally {
21352
+ use.waiting--;
21353
+ use.at = Date.now();
21003
21354
  }
21004
21355
  })();
21005
21356
  }
@@ -21297,13 +21648,20 @@ var GhostLink = class {
21297
21648
  }
21298
21649
  const held = this.channel;
21299
21650
  if (held && this.activeBinding && !this.dialedIn.has(held) && Date.now() - this.channelSince < 1e4 && this.myPubKeyZ32 < this.options.params.peerPubKeyZ32) {
21300
- traceLink(this.myPubKeyZ32, "dial-crossed", {
21301
- transport: binding.transport,
21302
- held: true
21303
- });
21304
- channel.close();
21651
+ if (this.paired?.state.status !== "ready") {
21652
+ traceLink(this.myPubKeyZ32, "dial-crossed", {
21653
+ transport: binding.transport,
21654
+ held: true
21655
+ });
21656
+ channel.close();
21657
+ return;
21658
+ }
21659
+ this.probeCrossed(held, channel, binding);
21305
21660
  return;
21306
21661
  }
21662
+ this.replaceWith(channel, binding);
21663
+ }
21664
+ replaceWith(channel, binding) {
21307
21665
  traceLink(this.myPubKeyZ32, "replacing", {
21308
21666
  transport: binding.transport,
21309
21667
  held: this.paired?.state.transport
@@ -21314,6 +21672,62 @@ var GhostLink = class {
21314
21672
  });
21315
21673
  }
21316
21674
  /**
21675
+ * The contact dialled in while this side's own fresh dial holds the chat (`CROSSED_FRESH_MS`): the dials crossed, or
21676
+ * the contact's app ended since that dial and is back. The held session is pinged; heard from within
21677
+ * `CROSSED_PROBE_MS`, the contact holds this side's dial too and its own closes. Not heard from, the contact's dial
21678
+ * takes over.
21679
+ */
21680
+ crossedProbe = null;
21681
+ /** Frames heard on the open session, counted from its start: whether the contact answered `probeCrossed`. */
21682
+ framesHeard = 0;
21683
+ probeCrossed(held, channel, binding) {
21684
+ this.dropCrossedProbe();
21685
+ traceLink(this.myPubKeyZ32, "dial-crossed", {
21686
+ transport: binding.transport,
21687
+ held: true,
21688
+ probe: true
21689
+ });
21690
+ const heard = this.framesHeard;
21691
+ try {
21692
+ this.sendPing(held, false);
21693
+ } catch {}
21694
+ const timer = setTimeout(() => {
21695
+ if (this.crossedProbe?.channel !== channel) return;
21696
+ this.crossedProbe = null;
21697
+ if (this.stopped || this.leaving || this.candidate) {
21698
+ channel.close();
21699
+ return;
21700
+ }
21701
+ if (!this.channel) {
21702
+ this.attach(channel, binding);
21703
+ return;
21704
+ }
21705
+ if (this.channel === held && this.framesHeard !== heard) {
21706
+ channel.close();
21707
+ return;
21708
+ }
21709
+ traceLink(this.myPubKeyZ32, "crossed-held-silent", { transport: binding.transport });
21710
+ this.replaceWith(channel, binding);
21711
+ }, CROSSED_PROBE_MS);
21712
+ channel.onClose = () => {
21713
+ if (this.crossedProbe?.channel === channel) {
21714
+ clearTimeout(timer);
21715
+ this.crossedProbe = null;
21716
+ }
21717
+ };
21718
+ this.crossedProbe = {
21719
+ channel,
21720
+ timer
21721
+ };
21722
+ }
21723
+ dropCrossedProbe() {
21724
+ const probe = this.crossedProbe;
21725
+ if (!probe) return;
21726
+ this.crossedProbe = null;
21727
+ clearTimeout(probe.timer);
21728
+ probe.channel.close();
21729
+ }
21730
+ /**
21317
21731
  * Connections that came in on this side's native endpoints. Their address was in the capability record, which before
21318
21732
  * the pin anyone holding a copy of the invite could read: a key other than the pinned one on such a connection proves
21319
21733
  * no more than on the DHT, so it closes that connection and nothing else.
@@ -21508,7 +21922,18 @@ var GhostLink = class {
21508
21922
  if (this.channel !== channel) return;
21509
21923
  this.unansweredPings = 0;
21510
21924
  this.heardFromPeer();
21511
- if (typeof data !== "string" || data.length > 61440) return;
21925
+ this.framesHeard++;
21926
+ if (typeof data !== "string") {
21927
+ const chunk = this.supportsBinaryFiles ? decodeFileData(data) : null;
21928
+ if (!chunk) return;
21929
+ this.activityAt = Date.now();
21930
+ await this.options.events?.onFilesFrame?.({
21931
+ t: "pf-data",
21932
+ ...chunk
21933
+ });
21934
+ return;
21935
+ }
21936
+ if (data.length > 61440) return;
21512
21937
  let frame;
21513
21938
  try {
21514
21939
  frame = JSON.parse(data);
@@ -26425,6 +26850,7 @@ function readFirstPlace(o, epoch) {
26425
26850
  /** One of my own frames, among mine: `e:n`. */
26426
26851
  var ownKey = (f) => `${f.e}:${f.n}`;
26427
26852
  /** What a frame weighs in a log, roughly: its boxes plus the fixed fields around them. */
26853
+ var frameKey$1 = (f) => `${f.s}:${f.e}:${f.n}`;
26428
26854
  /** What a kept frame counts for against `GROUP_LIMITS.relayBytes`. */
26429
26855
  var frameBytes = (f) => f.c.length + (f.m?.c.length ?? 0) + (f.r?.c.length ?? 0) + (f.sc?.c.length ?? 0) + (f.fl?.c.length ?? 0) + 400;
26430
26856
  /** Only the fields an edit frame has, as `clean` does for a message. */
@@ -26545,8 +26971,15 @@ var GroupSession = class {
26545
26971
  pendingMeta;
26546
26972
  /** While `handle` runs: the frames it took that a hub passes on (`handle`'s result). */
26547
26973
  passOn = null;
26974
+ /** The frames kept to hand on that the app holds with its messages, oldest first; undefined when the state holds them all. */
26975
+ onRows;
26548
26976
  /** Set while a save of what received messages changed is due (`persistSoon`). */
26549
26977
  saveTimer;
26978
+ /**
26979
+ * The frames of members who left that each member was handed (`frameKey`), so an app that does not take them (from
26980
+ * before revision 2026-10-13, and never marks them seen) is not handed them again at every sync. In memory only.
26981
+ */
26982
+ leaversHanded = /* @__PURE__ */ new Map();
26550
26983
  /** Syncs answered per member, a few a minute (`GROUP_LIMITS.syncAnswers`). In memory only. */
26551
26984
  syncsAnswered = /* @__PURE__ */ new Map();
26552
26985
  /** Catch-up answers still going out, a slice at a time (`handOut`). */
@@ -26559,10 +26992,21 @@ var GroupSession = class {
26559
26992
  provisional;
26560
26993
  /** When my chain last moved (a commit made or applied), by `hooks.clock`: frames are said again once it has settled. */
26561
26994
  chainMovedAt;
26562
- constructor(state, hooks) {
26995
+ /**
26996
+ * `onRows`: the frames the app holds with the messages it stored (`GroupIncomingMessage.frame`), oldest first. Given
26997
+ * (empty at first), the app is where frames are kept: the saved state carries none of them, and a message received
26998
+ * no longer writes them all again. Absent: they are kept in the state, as before.
26999
+ */
27000
+ constructor(state, hooks, onRows) {
26563
27001
  this.hooks = hooks;
26564
27002
  this.state = state;
26565
27003
  this.identity = identityFromSeedB64(state.seedB64);
27004
+ if (onRows) {
27005
+ const held = new Set(onRows.map(frameKey$1));
27006
+ if (state.relay?.length) state.relay = state.relay.filter((f) => !held.has(frameKey$1(f)));
27007
+ this.onRows = state.status === "active" ? onRows.filter((f) => this.handsOn(f.s, f.e)) : [];
27008
+ this.trimRelay();
27009
+ }
26566
27010
  this.answers = new CatchUpAnswers({
26567
27011
  send: (to, frame) => hooks.send(to, frame),
26568
27012
  ...hooks.handled && { handled: (to) => hooks.handled(to) },
@@ -26974,9 +27418,13 @@ var GroupSession = class {
26974
27418
  this.hooks.changed();
26975
27419
  return { secret };
26976
27420
  }
26977
- /** Someone out of the roster is not handed on any more, whatever they sent while in it (WISP 902 § Catch-up). */
27421
+ /**
27422
+ * Someone removed is not handed on any more, whatever they sent while in the roster; one who left still is, for the
27423
+ * epochs before its leave (WISP 902 § Catch-up).
27424
+ */
26978
27425
  pruneRelay() {
26979
- if (this.state.relay?.length) this.state.relay = this.state.relay.filter((f) => rosterHas(this.roster, f.s));
27426
+ if (this.state.relay?.length) this.state.relay = this.state.relay.filter((f) => this.handsOn(f.s, f.e));
27427
+ if (this.onRows?.length) this.onRows = this.onRows.filter((f) => this.handsOn(f.s, f.e));
26980
27428
  if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s));
26981
27429
  }
26982
27430
  /** 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. */
@@ -26992,10 +27440,21 @@ var GroupSession = class {
26992
27440
  }
26993
27441
  /** A frame of another member, kept to hand on; the oldest go once the log is full. */
26994
27442
  keep(frame) {
26995
- const log = this.state.relay ??= [];
26996
- log.push(frame);
26997
- let bytes = log.reduce((sum, f) => sum + frameBytes(f), 0);
26998
- while (log.length > GROUP_LIMITS.relay || bytes > GROUP_LIMITS.relayBytes) bytes -= frameBytes(log.shift());
27443
+ if (this.onRows) {
27444
+ const key = frameKey$1(frame);
27445
+ if (this.onRows.some((f) => frameKey$1(f) === key)) return;
27446
+ this.onRows.push(frame);
27447
+ } else (this.state.relay ??= []).push(frame);
27448
+ this.trimRelay();
27449
+ }
27450
+ /** The frames kept to hand on, oldest first: the state's, then the ones the app holds with its messages. */
27451
+ kept() {
27452
+ return this.onRows ? [...this.state.relay ?? [], ...this.onRows] : this.state.relay ?? [];
27453
+ }
27454
+ trimRelay() {
27455
+ const old = this.state.relay ?? [], rows = this.onRows ?? [];
27456
+ let bytes = old.reduce((sum, f) => sum + frameBytes(f), 0) + rows.reduce((sum, f) => sum + frameBytes(f), 0);
27457
+ while (old.length + rows.length > GROUP_LIMITS.relay || bytes > GROUP_LIMITS.relayBytes) bytes -= frameBytes((old.length ? old : rows).shift());
26999
27458
  }
27000
27459
  pruneSecrets() {
27001
27460
  const epochs = Object.keys(this.state.secrets).map(Number).sort((a, b) => a - b);
@@ -27031,6 +27490,7 @@ var GroupSession = class {
27031
27490
  this.state.secrets = {};
27032
27491
  this.state.sent = [];
27033
27492
  this.state.relay = [];
27493
+ if (this.onRows) this.onRows = [];
27034
27494
  this.state.relayEdits = [];
27035
27495
  this.state.alone = [];
27036
27496
  this.waiting = [];
@@ -27519,7 +27979,8 @@ var GroupSession = class {
27519
27979
  }
27520
27980
  /**
27521
27981
  * A message, from its author's edge or handed on by another member. Handed on, it is taken only while both are in
27522
- * the roster (someone removed is neither heard from nor handed on, #300), and its boxes only with the author's `xs`.
27982
+ * the roster (someone removed is neither heard from nor handed on, #300), or from a member in it when its author left
27983
+ * after it (`handsOn`), and its boxes only with the author's `xs`.
27523
27984
  */
27524
27985
  async receiveMessage(from, raw) {
27525
27986
  if (!isMessageFrame$1(raw)) return;
@@ -27528,7 +27989,7 @@ var GroupSession = class {
27528
27989
  return;
27529
27990
  }
27530
27991
  const relayed = raw.s !== from;
27531
- if (relayed && (!rosterHas(this.roster, from) || !rosterHas(this.roster, raw.s))) return;
27992
+ if (relayed && (!rosterHas(this.roster, from) || !this.handsOn(raw.s, raw.e))) return;
27532
27993
  if (!verify(fromBase64Url(raw.sig), messageSigned$1(raw), publicKeyFromZ32(raw.s))) return;
27533
27994
  if (raw.e > this.epoch) {
27534
27995
  this.park(from, raw);
@@ -27566,10 +28027,11 @@ var GroupSession = class {
27566
28027
  n: first.n
27567
28028
  };
27568
28029
  if (firstFrame && rosterHas(this.state.chain[first.e]?.m ?? [], this.myKey) && this.isDuplicate(firstFrame)) {
28030
+ await this.hooks.kept?.(groupMessageId(raw.s, first.e, first.n), clean(raw));
27569
28031
  this.markSeen(raw);
27570
28032
  this.keep(clean(raw));
27571
28033
  this.persistSoon();
27572
- if (rosterHas(this.roster, raw.s)) this.took(clean(raw));
28034
+ if (this.handsOn(raw.s, raw.e)) this.took(clean(raw));
27573
28035
  return;
27574
28036
  }
27575
28037
  const id = first && !this.provisional.has(own) ? groupMessageId(raw.s, first.e, first.n) : own;
@@ -27606,7 +28068,7 @@ var GroupSession = class {
27606
28068
  if (firstFrame && rosterHas(this.state.chain[firstFrame.e]?.m ?? [], this.myKey)) this.markSeen(firstFrame);
27607
28069
  this.keep(clean(raw));
27608
28070
  this.persistSoon();
27609
- if (rosterHas(this.roster, raw.s)) this.took(clean(raw));
28071
+ if (this.handsOn(raw.s, raw.e)) this.took(clean(raw));
27610
28072
  }
27611
28073
  /**
27612
28074
  * An edit of a member's own message, from its author's edge or handed on by another member: believed only while its
@@ -27640,7 +28102,7 @@ var GroupSession = class {
27640
28102
  const k = validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
27641
28103
  const sc = body.sc === void 0 ? void 0 : readStatusCard(body.sc);
27642
28104
  if (!validEditNumber(raw.v) && !sc) return;
27643
- const copy = (this.state.relay ?? []).find((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n);
28105
+ const copy = this.kept().find((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n);
27644
28106
  const first = copy && readFirstPlace(copy.o, copy.e);
27645
28107
  await this.hooks.edit?.({
27646
28108
  id: first ? groupMessageId(raw.s, first.e, first.n) : groupMessageId(raw.s, raw.e, raw.n),
@@ -27801,6 +28263,16 @@ var GroupSession = class {
27801
28263
  await this.receiveCommit(from, next);
27802
28264
  }
27803
28265
  }
28266
+ /**
28267
+ * Whether a frame of `author` under `epoch` is taken from another member, kept and handed on: while its author is in
28268
+ * the roster, or when it left (its removal marked `left`, and it is not back in) and the frame is from before that.
28269
+ */
28270
+ handsOn(author, epoch) {
28271
+ if (rosterHas(this.roster, author)) return true;
28272
+ const chain = this.state.chain;
28273
+ for (let e = chain.length - 1; e > 0; e--) if (chain[e].k === "remove" && chain[e].s === author) return !!this.state.leftMarks?.[e] && epoch < e;
28274
+ return false;
28275
+ }
27804
28276
  /** Keeps the admin's mark on a commit that took out a member who left (`GroupCommitFrame.left`) when it holds; true when new. */
27805
28277
  takeLeftMark(commit, mark) {
27806
28278
  if (commit.k !== "remove" || typeof mark !== "string" || mark.length !== 86 || !B64$1.test(mark) || this.state.leftMarks?.[commit.e]) return false;
@@ -27895,7 +28367,15 @@ var GroupSession = class {
27895
28367
  });
27896
28368
  const lacks = missingIn(frame, from);
27897
28369
  const asked = new Set(Array.isArray(frame.ask) ? frame.ask.filter((k) => typeof k === "string" && k !== from && k !== this.myKey && rosterHas(this.roster, k)) : []);
27898
- const kept = asked.size ? (this.state.relay ?? []).filter((f) => asked.has(f.s) && this.state.chain[f.e] && rosterHas(this.state.chain[f.e].m, from) && lacks(f)) : [];
28370
+ const handed = this.leaversHanded.get(from) ?? /* @__PURE__ */ new Set();
28371
+ const kept = !asked.size && !this.state.leftMarks ? [] : this.kept().filter((f) => {
28372
+ if (!this.state.chain[f.e] || !rosterHas(this.state.chain[f.e].m, from) || !lacks(f)) return false;
28373
+ if (asked.has(f.s)) return true;
28374
+ if (rosterHas(this.roster, f.s) || handed.has(frameKey$1(f)) || !this.handsOn(f.s, f.e)) return false;
28375
+ handed.add(frameKey$1(f));
28376
+ return true;
28377
+ });
28378
+ if (handed.size) this.leaversHanded.set(from, handed);
27899
28379
  answer.push(...asWritten(this.ownLacked(from, frame), kept));
27900
28380
  for (const author of asked) {
27901
28381
  const edits = (this.state.relayEdits ?? []).filter((f) => f.s === author && this.state.chain[f.e] && rosterHas(this.state.chain[f.e].m, from));
@@ -28320,6 +28800,8 @@ var COMMUNITY_LIMITS = {
28320
28800
  /** Commits in one welcome or chain piece. */
28321
28801
  chainPiece: 100,
28322
28802
  pendingLeaves: 64,
28803
+ /** Leaves whose mark (`group-left`) is kept, and the epochs one names. */
28804
+ leftMarks: 64,
28323
28805
  /**
28324
28806
  * Syncs of one member answered in `syncWindowMs`: each answer may carry the chain's tail, secrets and the whole
28325
28807
  * store. A member catching up asks every five seconds at most, and every member syncs every thirty; one asking more
@@ -28436,6 +28918,14 @@ var leaveStatement = (g, s) => utf8Encode(JSON.stringify([
28436
28918
  g,
28437
28919
  s
28438
28920
  ]));
28921
+ /** What the member who committed a leave (`h`) had heard of the leaver then: `e:h16` → its highest number there. */
28922
+ var leftStatement = (g, h, hi) => utf8Encode(JSON.stringify([
28923
+ "ghostly-group/2 left",
28924
+ g,
28925
+ h,
28926
+ Object.entries(hi).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)
28927
+ ]));
28928
+ var LEFT_EPOCH = /^\d{1,15}:[a-f0-9]{16}$/;
28439
28929
  /** The secret of an epoch that adds, re-roles or re-links: from the previous one and the commit. */
28440
28930
  function derivedSecret(previous, untaggedHash) {
28441
28931
  return hkdf(sha256, previous, utf8Encode(untaggedHash), utf8Encode("ghostly-group/2 derived"), 32);
@@ -28899,13 +29389,58 @@ var CommunitySession = class {
28899
29389
  return -1;
28900
29390
  }
28901
29391
  /**
28902
- * Someone the chain removed (not one who left) and who is not back in: nothing it signs is heard any more, even for
28903
- * an epoch it was in. What one who left wrote while in the group is still taken and handed on, for the epochs it was
28904
- * in (WISP 903 § Leaving and removal): its goodbye reaches the members who were away.
29392
+ * Whether a frame of someone the chain took out is still heard. A member removed is heard no more, even for an epoch
29393
+ * it was in. What one who left wrote while in the group is taken and handed on, its goodbye included, up to what the
29394
+ * member who committed the leave had heard of it then (its `group-left` mark), never past it: the leaver still holds
29395
+ * those epochs' secrets, and anything it signs later is not heard (WISP 903 § Leaving and removal). No mark here
29396
+ * (one not come yet, or a committer's app before it) and nothing of it is heard.
28905
29397
  */
28906
- wasExpelled(key) {
29398
+ heardAfterOut(f) {
29399
+ const i = this.outIndex(f.s);
29400
+ if (i < 0) return true;
29401
+ const commit = this.state.chain[i];
29402
+ if (commit.k !== "leave") return false;
29403
+ const high = this.state.left?.[communityCommitHash(commit)]?.hi[seenKey(f.e, f.h)];
29404
+ return high !== void 0 && f.n <= high;
29405
+ }
29406
+ /** The mark of a leave on my branch, as a frame to hand on (see `heardAfterOut`). */
29407
+ leftFrame(key) {
28907
29408
  const i = this.outIndex(key);
28908
- return i >= 0 && this.state.chain[i].k === "remove";
29409
+ if (i < 0 || this.state.chain[i].k !== "leave") return void 0;
29410
+ const h = communityCommitHash(this.state.chain[i]), mark = this.state.left?.[h];
29411
+ return mark && {
29412
+ t: "group-left",
29413
+ v: 2,
29414
+ g: this.id,
29415
+ h,
29416
+ hi: mark.hi,
29417
+ sig: mark.sig
29418
+ };
29419
+ }
29420
+ keepLeft(h, mark) {
29421
+ const left = { ...this.state.left ?? {} };
29422
+ delete left[h];
29423
+ left[h] = mark;
29424
+ const keys = Object.keys(left);
29425
+ for (const old of keys.slice(0, Math.max(0, keys.length - COMMUNITY_LIMITS.leftMarks))) delete left[old];
29426
+ this.state.left = left;
29427
+ }
29428
+ /** A leave's mark, from the member who committed it: kept when it is that member's, for a leave I hold. */
29429
+ receiveLeft(frame) {
29430
+ const { h, hi, sig } = frame;
29431
+ if (typeof h !== "string" || !HASH.test(h) || typeof sig !== "string" || !SIG.test(sig) || !isObject$2(hi)) return false;
29432
+ const entries = Object.entries(hi);
29433
+ if (entries.length > COMMUNITY_LIMITS.leftMarks || entries.some(([k, n]) => !LEFT_EPOCH.test(k) || !Number.isSafeInteger(n) || n < 0)) return false;
29434
+ const commit = this.known.get(h);
29435
+ if (!commit || commit.k !== "leave" || this.state.left?.[h]?.sig === sig) return false;
29436
+ const marks = hi;
29437
+ if (!verify(fromBase64Url(sig), leftStatement(this.id, h, marks), publicKeyFromZ32(commit.by))) return false;
29438
+ this.keepLeft(h, {
29439
+ hi: marks,
29440
+ sig
29441
+ });
29442
+ this.persistSoon();
29443
+ return true;
28909
29444
  }
28910
29445
  /**
28911
29446
  * What someone the chain took out is told when it comes back (WISP 903 § Leaving and removal): the commits from where
@@ -29507,10 +30042,11 @@ var CommunitySession = class {
29507
30042
  continue;
29508
30043
  }
29509
30044
  try {
29510
- await this.commit("leave", {
30045
+ const { hash } = await this.commit("leave", {
29511
30046
  s: request.s,
29512
30047
  ls: request.ls
29513
30048
  }, now);
30049
+ this.markLeft(hash, request.s);
29514
30050
  done++;
29515
30051
  } catch {}
29516
30052
  this.state.pendingLeaves = this.state.pendingLeaves.filter((r) => r !== request);
@@ -29519,6 +30055,25 @@ var CommunitySession = class {
29519
30055
  return done;
29520
30056
  });
29521
30057
  }
30058
+ /** Signs and says how far I had heard a member whose leave I just committed (`group-left`). */
30059
+ markLeft(h, leaver) {
30060
+ const hi = {};
30061
+ const heard = Object.entries(this.state.seen[leaver] ?? {}).filter(([k]) => LEFT_EPOCH.test(k)).slice(-COMMUNITY_LIMITS.leftMarks);
30062
+ for (const [k, entry] of heard) hi[k] = entry.high;
30063
+ const sig = toBase64Url(sign(leftStatement(this.id, h, hi), this.identity.seed));
30064
+ this.keepLeft(h, {
30065
+ hi,
30066
+ sig
30067
+ });
30068
+ this.hooks.broadcast({
30069
+ t: "group-left",
30070
+ v: 2,
30071
+ g: this.id,
30072
+ h,
30073
+ hi,
30074
+ sig
30075
+ });
30076
+ }
29522
30077
  out(status, reason) {
29523
30078
  this.state.status = status;
29524
30079
  this.state.statusReason = reason;
@@ -29842,6 +30397,7 @@ var CommunitySession = class {
29842
30397
  return false;
29843
30398
  case "group-meta": return this.receiveMeta(from, raw);
29844
30399
  case "group-leave": return this.receiveLeave(frame);
30400
+ case "group-left": return this.receiveLeft(frame);
29845
30401
  case "group-entry": {
29846
30402
  if (frame.to !== this.myKey || !isSealed(frame.s) || frame.x !== this.currentEntryKey()) return false;
29847
30403
  const seed = openSecret(this.identity.seed, this.myKey, frame.s, entryAad(this.id, this.myKey));
@@ -29870,7 +30426,7 @@ var CommunitySession = class {
29870
30426
  return false;
29871
30427
  }
29872
30428
  if (!verify(fromBase64Url(raw.sig), messageSigned(raw), publicKeyFromZ32(raw.s))) return false;
29873
- if (this.wasExpelled(raw.s)) return false;
30429
+ if (!this.heardAfterOut(raw)) return false;
29874
30430
  const found = this.commitByShort(raw.e, raw.h);
29875
30431
  if (!found) {
29876
30432
  this.park(from, raw);
@@ -30110,16 +30666,22 @@ var CommunitySession = class {
30110
30666
  const have = frame.have && typeof frame.have === "object" ? frame.have : {};
30111
30667
  const handed = /* @__PURE__ */ new Set();
30112
30668
  const unheard = new Set(this.state.unheard ?? []);
30669
+ const marked = /* @__PURE__ */ new Set();
30113
30670
  for (const stored of this.state.store) {
30114
30671
  if (stored.s === from) continue;
30115
30672
  const high = have[stored.s]?.[seenKey(stored.e, stored.h)];
30116
30673
  if (Number.isSafeInteger(high) && high >= stored.n) continue;
30117
- if (this.wasExpelled(stored.s)) continue;
30674
+ if (!this.heardAfterOut(stored)) continue;
30118
30675
  const found = this.commitByShort(stored.e, stored.h);
30119
30676
  if (!found) continue;
30120
30677
  const reads = rosterHas(this.rosterAt(found.hash) ?? [], from), mine = stored.s === this.myKey && unheard.has(frameKey(stored));
30121
30678
  if (!reads && !(mine && rosterHas(this.roster, from))) continue;
30122
30679
  if (!this.mainIndex.has(found.hash)) this.handSide(from, found.hash, handed, answer);
30680
+ if (!rosterHas(this.roster, stored.s) && !marked.has(stored.s)) {
30681
+ marked.add(stored.s);
30682
+ const left = this.leftFrame(stored.s);
30683
+ if (left) answer.push(left);
30684
+ }
30123
30685
  answer.push(stored);
30124
30686
  if (mine && reads) unheard.delete(frameKey(stored));
30125
30687
  }
@@ -30782,8 +31344,63 @@ function appDigest(manifestBytes) {
30782
31344
  return toBase64Url(sha256(manifestBytes));
30783
31345
  }
30784
31346
  var u32 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
30785
- /** Reads and checks a bundle (the order of the checks is part of the format: see above). */
30786
- function readAppBundle(bytes) {
31347
+ /**
31348
+ * Lets the thread go for one turn: what waits (input, drawing, timers, port messages, IndexedDB answers) runs, then the
31349
+ * caller goes on. A message to itself, queued behind the page's other tasks. Never `scheduler.yield()`: in Chromium its
31350
+ * continuation outranks every normal task, so a paced read of 4096 revocations held the page's timers, its apps' broker
31351
+ * ports and IndexedDB for the whole 1.8 s. Never `setTimeout(0)` but as the last resort: from the fifth nested timer on
31352
+ * the browser waits at least 4 ms (HTML's clamp), which made that read take 60% longer than the work, and a hidden tab
31353
+ * runs timers once a second.
31354
+ */
31355
+ function yieldThread() {
31356
+ if (typeof MessageChannel === "function") return new Promise((resolve) => {
31357
+ const channel = new MessageChannel();
31358
+ channel.port1.onmessage = () => {
31359
+ channel.port1.close();
31360
+ resolve();
31361
+ };
31362
+ channel.port2.postMessage(null);
31363
+ });
31364
+ return new Promise((resolve) => setTimeout(resolve, 0));
31365
+ }
31366
+ /**
31367
+ * A pause for a loop of short steps: `await pause()` after each step lets the thread go once `sliceMs` of work has
31368
+ * run since the last time, and answers at once otherwise.
31369
+ */
31370
+ function pacer(sliceMs) {
31371
+ let since = performance.now();
31372
+ return () => {
31373
+ if (performance.now() - since < sliceMs) return void 0;
31374
+ return yieldThread().then(() => {
31375
+ since = performance.now();
31376
+ });
31377
+ };
31378
+ }
31379
+ /** `sha256Paced` hashes up to this much at once: under a millisecond of the thread. */
31380
+ var HASH_AT_ONCE = 65536;
31381
+ /** Without `crypto.subtle`, `sha256Paced` hashes this much (a few ms), then lets the thread go. */
31382
+ var HASH_SLICE = 262144;
31383
+ /** `readAppBundleAsync` hashes files for this long at most before it lets the thread go, however small each file. */
31384
+ var HASH_SLICE_MS = 5;
31385
+ /**
31386
+ * SHA-256 of bytes that may be a whole bundle, for a client whose engine shares its page's thread: `sha256` in
31387
+ * JavaScript takes about 12 ms per MiB on a desktop CPU, so 16 MiB in one run is a page that draws nothing and takes no
31388
+ * input for 200 ms. With `crypto.subtle` the bytes are hashed off the thread; without it (a page not served over
31389
+ * HTTPS), a slice at a time with a pause between slices. The bytes must not change until it answers.
31390
+ */
31391
+ async function sha256Paced(bytes) {
31392
+ if (bytes.length <= HASH_AT_ONCE) return sha256(bytes);
31393
+ const subtle = globalThis.crypto?.subtle;
31394
+ const away = subtle ? await subtle.digest("SHA-256", bytes).catch(() => null) : null;
31395
+ if (away) return new Uint8Array(away);
31396
+ const hash = sha256.create();
31397
+ for (let at = 0; at < bytes.length; at += HASH_SLICE) {
31398
+ if (at) await yieldThread();
31399
+ hash.update(bytes.subarray(at, at + HASH_SLICE));
31400
+ }
31401
+ return hash.digest();
31402
+ }
31403
+ function readAppBundleHead(bytes) {
30787
31404
  if (bytes.length > APP_BUNDLE_LIMITS.bundleBytes) return {
30788
31405
  ok: false,
30789
31406
  reason: "too-large"
@@ -30842,17 +31459,18 @@ function readAppBundle(bytes) {
30842
31459
  };
30843
31460
  const signed = verifyAppSignature(APP_PREFIXES.app, manifestBytes, statement.signature, manifest.publisher);
30844
31461
  if (!signed.ok) return signed;
30845
- const files = /* @__PURE__ */ new Map();
30846
- for (const f of manifest.files) {
30847
- const content = bytes.subarray(at, at + f.size);
30848
- at += f.size;
30849
- if (toBase64Url(sha256(content)) !== f.sha256) return {
30850
- ok: false,
30851
- reason: "file-hash",
30852
- detail: f.path
30853
- };
30854
- files.set(f.path, content);
30855
- }
31462
+ return {
31463
+ ok: true,
31464
+ head: {
31465
+ manifest,
31466
+ manifestBytes,
31467
+ signature: statement.signature,
31468
+ filesAt: at
31469
+ }
31470
+ };
31471
+ }
31472
+ /** The last check, once every file's hash held: the icon. */
31473
+ function closeAppBundle({ manifest, manifestBytes, signature }, files) {
30856
31474
  const icon = files.get(APP_ICON_PATH);
30857
31475
  if (icon) {
30858
31476
  const size = imageSize(icon);
@@ -30873,11 +31491,54 @@ function readAppBundle(bytes) {
30873
31491
  manifest,
30874
31492
  manifestBytes,
30875
31493
  digest: appDigest(manifestBytes),
30876
- signature: statement.signature,
31494
+ signature,
30877
31495
  files
30878
31496
  }
30879
31497
  };
30880
31498
  }
31499
+ /** Reads and checks a bundle (the order of the checks is part of the format: see above). */
31500
+ function readAppBundle(bytes) {
31501
+ const read = readAppBundleHead(bytes);
31502
+ if (!read.ok) return read;
31503
+ const files = /* @__PURE__ */ new Map();
31504
+ let at = read.head.filesAt;
31505
+ for (const f of read.head.manifest.files) {
31506
+ const content = bytes.subarray(at, at + f.size);
31507
+ at += f.size;
31508
+ if (toBase64Url(sha256(content)) !== f.sha256) return {
31509
+ ok: false,
31510
+ reason: "file-hash",
31511
+ detail: f.path
31512
+ };
31513
+ files.set(f.path, content);
31514
+ }
31515
+ return closeAppBundle(read.head, files);
31516
+ }
31517
+ /**
31518
+ * `readAppBundle` for a client whose engine shares its page's thread: the same checks in the same order, with the same
31519
+ * refusals, and each file hashed by `sha256Paced`, one after the other, with the thread let go between files every
31520
+ * `HASH_SLICE_MS` (64 files of 64 KiB, each hashed at once, held it for 50 ms). The bytes must not change until it
31521
+ * answers.
31522
+ */
31523
+ async function readAppBundleAsync(bytes) {
31524
+ const read = readAppBundleHead(bytes);
31525
+ if (!read.ok) return read;
31526
+ const files = /* @__PURE__ */ new Map();
31527
+ const pause = pacer(HASH_SLICE_MS);
31528
+ let at = read.head.filesAt;
31529
+ for (const f of read.head.manifest.files) {
31530
+ const content = bytes.subarray(at, at + f.size);
31531
+ at += f.size;
31532
+ if (toBase64Url(await sha256Paced(content)) !== f.sha256) return {
31533
+ ok: false,
31534
+ reason: "file-hash",
31535
+ detail: f.path
31536
+ };
31537
+ files.set(f.path, content);
31538
+ await pause();
31539
+ }
31540
+ return closeAppBundle(read.head, files);
31541
+ }
30881
31542
  /** Puts a bundle's parts together, checking nothing: for builders, and for tests that need a broken bundle. */
30882
31543
  function assembleAppBundle(manifestBytes, statementBytes, files) {
30883
31544
  const total = MAGIC.length + 8 + manifestBytes.length + statementBytes.length + files.reduce((s, f) => s + f.length, 0);
@@ -31291,6 +31952,6 @@ function appStoreDecision(held, read) {
31291
31952
  return read.digest === held.digest ? "same" : "equivocation";
31292
31953
  }
31293
31954
  //#endregion
31294
- export { rosterHash as $, enrollMessage as $_, GROUP_HAVE_FRAME as $a, sanitizeAvatar as $b, isHoldUrl as $c, parseEditedFrame as $d, cardEditNumber as $f, handoffFileRequestFrame as $g, emptyLinkRecords as $h, invoiceCallbackUrl as $i, emptyIdentityLedger as $l, WATCH_PEER_MS as $m, ATPROTO_FULL_SCOPE as $n, ChatFiles as $o, commitUntaggedHash as $p, DID_DHT_VERSION as $r, wakeRequest as $s, groupDisplayName as $t, DhtDelivery as $u, TURN_RAISE_READ_TIMEOUT_MS as $v, PREVIOUS_DEFAULT_RELAYS as $y, isAppLicense as A, sortParts as A_, MAX_PAIRED_MESSAGE_FRAME as Aa, measureRecords as Ab, EDIT_CAPABILITY as Ac, voiceFileName as Ad, readReaction as Af, HANDOFF_PIECE_OVERHEAD as Ag, parseRtcSignal as Ah, isSparkAddress as Ai, CapsExchange as Al, STALLED_EVIDENCE_MS as Am, BIP322_REVISION as An, wireHubPolicy as Ao, readAppRevocation as Ap, DID_METHODS as Ar, parsePinnedFrame as As, chainPieces as At, verifyPeerProof as Au, DEVICES_CAPABILITY as Av, turnInstance as Ay, COMMUNITY_PROFILE as B, DEVICE_KINDS as B_, SWITCH_RETIRE_MS as Ba, identityFromSeed as Bb, UPGRADE_CAPABILITY as Bc, EDITED_FRAME as Bd, wireReply as Bf, handoffAckFrame as Bg, decompressSdp as Bh, newPubkyProofFolder as Bi, IDENTITY_CHECK_UNAVAILABLE as Bl, EXPECT_PEER_MS as Bm, decodeAnyBitcoinAddress as Bn, mergeLobby as Bo, canonicalJsonBytes as Bp, didWebFileUrl as Br, WAKE_FRAME as Bs, parseCommunityEdit as Bt, automaticTransport as Bu, deviceLinkPairing as Bv, BACKGROUND_REQUESTS_PER_MINUTE as By, APP_VIEWS as C, readHandoffManifest as C_, EARLY_DIAL_JOIN_MS as Ca, isDiscoveryBudgetError as Cb, isAppVersion as Cc, downsamplePeaks as Cd, parseReactionFrame as Cf, HANDOFF_HELLO as Cg, DATA_CHANNEL_ID as Ch, formatPaymentAmount as Ci, validDomainRecord as Cl, CONNECT_TIMEOUT_MS as Cm, sshFingerprint as Cn, MESH_HUBS as Co, appRevocationId as Cp, verifyAtprotoSignature as Cr, PINNED_FRAME as Cs, mentionedMembers as Ct, proofHash as Cu, encodeInviteCode as Cv, openTurnValue as Cy, buildAppBundle as D, readHandoffVerified as D_, INVITE_TAKEN as Da, PacketTooLargeError as Db, APPS_CAPABILITY as Dc, parseVoiceMeta as Dd, reactionFrame as Df, HANDOFF_OFFER as Dg, buildDataSdp as Dh, walletNetworkOf as Di, CAPS_LIMITS as Dl, GATHER_STALL_MS as Dm, isLegacySignature as Dn, meshRendezvous as Do, isAppKey as Dp, DID_JWS_ALGS as Dr, mayPin as Ds, GROUP_READ_NOTE as Dt, storageProofPath as Du, inviteQrText as Dv, signTurnBody as Dy, assembleAppBundle as E, readHandoffTurnFrame as E_, INVITER_DIAL_GRACE_MS as Ea, PKARR_FUTURE_SKEW_MS as Eb, readAppFrame as Ec, isPlayableAudioType as Ed, reactionEmoji as Ef, HANDOFF_MANIFEST as Eg, RTC_SIGNAL_MAX_AGE_MS as Eh, validatePaymentTarget as Ei, CAPS_LABEL as El, GATHER_ATTEMPTS as Em, verifySshSignature as En, meshHubs as Eo, isAppHash as Ep, DID_GHOSTLY_SERVICE as Er, PIN_LIMITS as Es, GROUP_REACTED_FRAME as Et, storageProofBody as Eu, inviteQrSegments as Ev, sealTurnBody as Ey, GroupTypingBoard as F, setAckFrame as F_, RACE_DIRECT_MS as Fa, decodeDnsAnswers as Fb, SERVICES_CAPABILITY as Fc, VIDEO_LIMITS as Fd, REPLY_LIMITS as Ff, HANDOFF_VERSION as Fg, answersOffer as Fh, isBitcoinAddress as Fi, dialDescriptors as Fl, directBlocked as Fm, decodeBase64 as Fn, freshHubs as Fo, signAppRevocation as Fp, didJwsAlg as Fr, readPin as Fs, GROUP_EDIT_TEXT_BYTES as Ft, validRingKey as Fu, HANDOFF_CAPABILITY as Fv, turnReleaseMessage as Fy, communityHasFrame as G, ENROLL_HELLO as G_, publishFailure as Ga, decrypt as Gb, PairedSession as Gc, EDIT_RECEIVE_LIMIT as Gd, PR_CHECKS as Gf, handoffCancelFrame as Gg, pickCallCandidates as Gh, decodeSvcbRecords as Gi, IDENTITY_PROOF_CAPABILITY as Gl, OFFER_FAST_MS as Gm, encodeWitness as Gn, readBeaconHead as Go, GROUP_VERSION_LARGE as Gp, parseDidJws as Gr, deviceWakeRequest as Gs, mentionsMember as Gt, relayedTransports as Gu, devicePingFrame as Gv, FRESH_READ_MS as Gy, GROUP_READ_NOTE_COMMUNITY as H, ENROLL_CANCEL_REASONS as H_, WAKE_LOST_MS as Ha, publicKeyFromZ32 as Hb, parseSessionCapabilities as Hc, EDIT_BUFFER_MS as Hd, BUTTON_ID as Hf, handoffAttemptFailed as Hg, heardCallSignal as Hh, pubkyProofCapability as Hi, IDENTITY_MAX_EVIDENCE as Hl, IDLE_THRESHOLD as Hm, decodeTx as Hn, pickHubs as Ho, GROUP_ADMIN_OFF_ERROR as Hp, normalizeDid as Hr, WAKE_SUBJECT as Hs, MENTION_EVERYONE as Ht, irohDescriptor as Hu, deviceLinkRendezvousSeed as Hv, CHAT_RESERVE as Hy, groupTypingEpoch as I, setUpdateFrame as I_, RACE_RELAYED_MS as Ia, decodeTxtPacket as Ib, SESSION_CAPABILITIES_FRAME as Ic, formatVideoDuration as Id, groupReplyAuthor as If, HANDOFF_WINDOW as Ig, buildSdpFromSignal as Ih, PUBKY_PROOF_MAX_BYTES as Ii, emptyCapsState as Il, symmetricNat as Im, verifyBip322 as In, hubRank as Io, verifyAppRevocation as Ip, didSignedMessages as Ir, DEVICE_WAKE_TTL_SECONDS as Is, carryMentions as It, verifyRingAuthorization as Iu, deviceEchoFrame as Iv, turnSequence as Iy, communityUntaggedHash as J, enrollCancelReason as J_, engineError as Ja, sealedLength as Jb, HOLD_CAPABILITY as Jc, RateWindow as Jd, RUN_RESULTS as Jf, handoffDataFrame as Jg, waitForIceGathering as Jh, pubkyHomeserverOf as Ji, IDENTITY_STATEMENT_PREFIX as Jl, PRESENCE_HEARTBEAT as Jm, txHash as Jn, validHead as Jo, MAX_GROUP_MEMBERS as Jp, staticDidDocument as Jr, readWake as Js, MAX_GROUP_META_BODY as Jt, DHT_FILE_REFUSED as Ju, unsignedDeviceTransports as Jv, GROUP_OVER_PACE_MS as Jy, communityMessageId as K, ENROLL_PROOF as K_, ENGINE_ERRORS as Ka, encrypt as Kb, SESSION_FRAME_MAX as Kc, EDIT_SEND_LIMIT as Kd, PR_STATES as Kf, handoffContext as Kg, sdpHasCandidates as Kh, encodeSvcbPacket as Ki, IDENTITY_PROVIDER_ID as Kl, OFFER_LOOK_MS as Km, hash160 as Kn, readLobby as Ko, LEGACY_GROUP_MEMBERS as Kp, parseDidSignaturePaste as Kr, newWakeToken as Ks, validMentions as Kt, transportOrder as Ku, newDeviceSetSecret as Kv, GROUP_BURST_MS as Ky, openGroupTyping as L, setUpdateMessage as L_, REDESCRIBED_GRACE_MS as La, encodeTxtPacket as Lb, STATUS_CARD_CAPABILITY as Lc, isPlayableVideoType as Ld, pairedReplyAuthor as Lf, NO_ATTEMPTS as Lg, callRtcConfig as Lh, PUBKY_PROOF_ROOT as Li, encodePacketTransports as Ll, AWAITING_PEER_MS as Lm, BitcoinAddressError as Ln, lobbyKeys as Lo, verifyAppSignature as Lp, didWebDocumentUrl as Lr, WAKE_CALL_INTERVAL_MS as Ls, communityEditFrame as Lt, verifyRingEvidence as Lu, deviceEchoNonce as Lv, turnSignedMessage as Ly, isAppUrl as M, SET_UPDATE as M_, PAIRING_RETRY_MS as Ma, openRelayPayload as Mb, KNOWN_SESSION_CAPABILITIES as Mc, voiceLevelsOf as Md, wireReaction as Mf, HANDOFF_REQUEST as Mg, CALL_SIGNAL_MAX_AGE_MS as Mh, sparkInvoiceDetails as Mi, CapsRefusedError as Ml, DIRECT_OWN_ATTEMPTS as Mm, bip322MessageHash as Mn, beaconKeys as Mo, readAppRevocations as Mp, checkDidJws as Mr, pinIsNewer as Ms, groupMessageId as Mt, ringAuthorization as Mu, DEVICE_ECHO_FRAME as Mv, turnName as My, readAppBundle as N, encodeSetSlots as N_, PONG_WAIT_MS as Na, parseRelayPayload as Nb, PIN_CAPABILITY as Nc, voicePeaksOf as Nd, PAIRED_REPLY_AUTHORS as Nf, HANDOFF_TIMINGS as Ng, PAIRED_CALL_CANDIDATES as Nh, sparkNetworkOf as Ni, DHT_TEXT_CAPABILITY as Nl, DIRECT_PEERS as Nm, bip322ToSign as Nn, beaconRecords as No, readAppSignature as Np, checkDidSignature as Nr, pinNumberHolds as Ns, COMMUNITY_EDIT_FRAME as Nt, ringClaims as Nu, DEVICE_PING_FRAME as Nv, turnPacket as Ny, checkAppManifest as O, sameDigest as O_, LIVENESS_MISSED_PINGS as Oa, RELAY_PAYLOAD_MAX_BYTES as Ob, BUTTONS_CAPABILITY as Oc, recordingMime as Od, reactionIsNewer as Of, HANDOFF_PAKE as Og, extractRtcParams as Oh, SPARK_NETWORKS as Oi, CAPS_PUBLISH_SPACING_MS as Ol, OFFER_HOST_GATHER_MS as Om, legacyMessageHash as On, parseHubPolicy as Oo, isAppRef as Op, DID_JWS_MAX_LENGTH as Or, nextPinNumber as Os, GroupSession as Ot, validExternalKey as Ou, ownInviteRefusal as Ov, signTurnPacket as Oy, GROUP_TYPING_FRAME as P, readSetUpdate as P_, RACE_ANSWERED_MS as Pa, signRelayPayload as Pb, REACTIONS_CAPABILITY as Pc, PLAYABLE_VIDEO as Pd, REPLY_ID as Pf, HANDOFF_VERIFIED as Pg, RTC_CONFIG as Ph, BITCOIN_NETWORKS as Pi, capsDescriptors as Pl, DirectPathWatch as Pm, bip322ToSpend as Pn, doorHubs as Po, signAppObject as Pp, didGhostlyServiceEntry as Pr, pinnedFrame as Ps, GROUP_EDIT_FRAME as Pt, ringEvidence as Pu, ENROLL_CAPABILITY as Pv, turnPayloadSequence as Py, leaveStatement as Q, enrollHelloFrame as Q_, GROUP_FILE_LIMITS as Qa, jpegSize$1 as Qb, HoldRefusedError as Qc, parseEditFrame as Qd, buttonLabelClash as Qf, handoffFileMissingFrame as Qg, buildLinkRecords as Qh, findLightningDestination as Qi, boundVerifiedIdentity as Ql, TRANSPORTS_GONE_MS as Qm, ATPROTO_DECLARED_SCOPE as Qn, parsePairedCallFrame as Qo, commitHash as Qp, DID_DHT_TTL as Qr, wakePayload as Qs, encodeGroupMetaBody as Qt, DHT_TEXT_REFUSED as Qu, TURN_PUT_WINDOW_MS as Qv, HEDGE_MS as Qy, sealGroupTyping as R, signTombstone as R_, RESUME_WAIT_MS as Ra, readDnsName as Rb, SessionCapabilities as Rc, isVideoMime as Rd, readReply as Rf, filePartDigest as Rg, callSignalHeardAt as Rh, isPubkyKey as Ri, parsePacketTransports as Rl, DEPARTED_READ_MS as Rm, ByteReader as Rn, lobbyRecords as Ro, verifyAppStatementBytes as Rp, didWebFile as Rr, WAKE_CALL_TTL_SECONDS as Rs, communityMessageAuthor as Rt, RELAY_URL as Ru, deviceFrameCapability as Rv, turnStatedVerifier as Ry, APP_SCREENSHOTS_DIR as S, readHandoffHello as S_, DHT_PIN_GRACE_MS as Sa, heldBackError as Sb, chatAppId as Sc, baseMime as Sd, parseReactedFrame as Sf, HANDOFF_HAVE as Sg, wrapDataChannel as Sh, assertWholeSats as Si, txtValue as Sl, ANSWER_REFUSED_REDIALS as Sm, sameSshKey as Sn, GROUP_VERSION_HUBS as So, appRefPublisher as Sp, verifyAtprotoRecordProof as Sr, GROUP_PIN_FRAME as Ss, groupWakes as St, proofCapability as Su, encodeGhostlyInvite as Sv, nextTurnPosition as Sy, appViewOf as T, readHandoffRelease as T_, HANDLED_WAIT_MS as Ta, MAX_DNS_PACKET_BYTES as Tb, parseAppFrame as Tc, formatVoiceDuration as Td, reactedFrame as Tf, HANDOFF_LIST_PER_FRAME as Tg, RTC_SIGNAL_FUTURE_MS as Th, parsePaymentAmount as Ti, CAPS_ISSUED_BACK_MS as Tl, DataLink as Tm, sshSignCommand as Tn, mayBeHub as To, checkAppRevokeStatement as Tp, DID_FILE_MAX_BYTES as Tr, PIN_FRAME as Ts, GROUP_LIMITS as Tt, storageProof as Tu, inviteOwnership as Tv, readTurnPacket as Ty, communityCommitHash as U, ENROLL_DONE as U_, pairedMessageFrame as Ua, sign as Ub, sessionCapabilitiesFrame as Uc, EDIT_FRAME as Ud, BUTTON_STYLES as Uf, handoffAttemptSucceeded as Ug, isGlobalIpv4Host as Uh, pubkyProofFile as Ui, IDENTITY_MAX_FRAME as Ul, LinkSession as Um, decodeWitness as Un, rankHubs as Uo, GROUP_ID as Up, parseDid as Ur, WAKE_TTL_SECONDS as Us, MENTION_LIMITS as Ut, irohRelayUrl as Uu, deviceLinkSealKey as Uv, DEFAULT_RELAYS as Uy, CommunitySession as V, ENROLL_CANCEL as V_, UNPROVEN_AUTH_MS as Va, identityFromSeedB64 as Vb, WAKE_SESSION_CAPABILITY as Vc, EDIT_BUFFER_MAX as Vd, ACTIVE_TASK_STATUSES as Vf, handoffAttemptAllowed as Vg, extractParamsFromSdp as Vh, normalizePubkyKey as Vi, IDENTITY_CLOCK_SKEW as Vl, FIRST_PUBLISH_MAX_MS as Vm, decodeBitcoinAddress as Vn, newerHead as Vo, readCanonicalJson as Vp, didWebHost as Vr, WAKE_INTERVAL_MS as Vs, validEditText as Vt, checkedDescriptors as Vu, deviceLinkParams as Vv, BACKGROUND_WHILE_SIGNALING as Vy, communityGroupId as W, ENROLL_GRANT as W_, parsePaymentNetworks as Wa, verify as Wb, PAIRED_PROFILE as Wc, EDIT_RATE_WINDOW_MS as Wd, ITEM_STATES as Wf, handoffBusyFrame as Wg, parseCallSignal as Wh, pubkyProofPath as Wi, IDENTITY_MAX_VALIDITY as Wl, MAX_DHT_TEXT_BYTES as Wm, encodeTx as Wn, readBeacon as Wo, GROUP_MEMBER_CAP as Wp, parseDidDocument as Wr, WakeLimiter as Ws, mentionsBytes as Wt, rankTransports as Wu, deviceLinkSecret as Wv, DEPARTED_READS as Wy, derivedSecret as X, enrollDoneFrame as X_, parseEngineError as Xa, MAX_AVATAR_LENGTH as Xb, HOLD_LIMITS as Xc, editFrame as Xd, TASK_STATUSES as Xf, handoffDoneFrame as Xg, MAX_MSGS_PAYLOAD_B64 as Xh, LNURL_LIMITS as Xi, IdentityCheckUnavailable as Xl, RELAY_POLL_INTERVALS as Xm, u64 as Xn, PAIRED_CALL_FRAME as Xo, OWN_FRAME_LIMIT as Xp, DID_DHT_MAX_PAYLOAD as Xr, relayRequest as Xs, MAX_GROUP_NAME_LENGTH as Xt, DHT_MESSAGE_TTL as Xu, seedSigner as Xv, GROUP_SIGNALING_ALLOWANCE_SHARE as Xy, decodeCommunityLink as Y, enrollDigits as Y_, engineText as Ya, tryDecrypt as Yb, HOLD_DATED_BACK_MS as Yc, dhtEditId as Yd, STATUS_CARD_LIMITS as Yf, handoffDigest as Yg, LABEL$1 as Yh, LIGHTNING_DESTINATION_PATTERN as Yi, IDENTITY_SUBJECT as Yl, PRESENCE_WINDOW as Ym, u32$2 as Yn, MAX_PAIRED_CALL_SIGNAL as Yo, MEMBER_KEY as Yp, strictBase64Url as Yr, readWakePayload as Ys, MAX_GROUP_NAME_BYTES as Yt, DHT_FILE_TOO_LARGE as Yu, verifyDeviceTransports as Yv, GROUP_RATION_WINDOW_MS as Yy, encodeCommunityLink as Z, enrollGrantFrame as Z_, PairingTracker as Za, MAX_AVATAR_SIDE as Zb, HoldKeys as Zc, editedFrame as Zd, appCardId as Zf, handoffEphemeral as Zg, RECORD_TTL as Zh, fetchLnurlJson as Zi, IdentityExchange as Zl, STALLED_LOOK_MS as Zm, varBytes as Zn, PairedCalls as Zo, SAID_AGAIN as Zp, DID_DHT_PREFIX as Zr, wakeFrame as Zs, MAX_GROUP_PICTURE_LENGTH as Zt, DHT_TEXT_BYTES as Zu, webCryptoSigner as Zv, HEDGE_MISSING_MS as Zy, APP_CLIENTS as _, readHandoffCancel as __, BLOCKED_DIAL_WAIT_MS as _a, BREAKER_MAX_MS as _b, AppSessions as _c, sanitizeMime as _d, REACTED_FRAME as _f, HANDOFF_CANCEL_REASONS as _g, decodeChunk as _h, SEPOLIA_TEST_USDT_FAUCET as _i, normalizeDomain as _l, openPair as _m, SSH_KEY_TYPES as _n, SIGNAL_HOLD_MS as _o, APP_NAME as _p, parseAtprotoCar as _r, sanitizeTypingStatus as _s, GROUP_WAKE_GROUP_WINDOW_MS as _t, STORAGE_ROOT as _u, INVITE_VERSION as _v, __commonJSMin as _x, TURN_TTL as _y, checkAppBeforeRun as a, handoffReleaseFrame as a_, BOLT11_PATTERN as aa, SLOW_DEMOTE_MS as ab, generateVapidKeys as ac, dhtFileId as ad, linkEnd as af, SERVICES_VERSION as ag, parseLocalTarget as ah, didDhtRecords as ai, DOMAIN_MAX_RECORDS as al, sortRoster as am, groupName as an, isGroupMessageId as ao, readStatusCard as ap, checkAtprotoProofRecord as ar, TYPING_FRAME as as, KNOCK_TTL_MS as at, newIdentityBinding as au, DEVICE_INVITE_BYTES as av, trimEndOf as ax, TOMBSTONE_SEQUENCE as ay, APP_ICON_PATH as b, readHandoffFileFrame as b_, DEMOTE_AFTER_FAILURES as ba, DiscoveryBudgetError as bb, appDataFrame as bc, VOICE_LIMITS as bd, ReactionWindow as bf, HANDOFF_FILE_MISSING as bg, encodeControl as bh, WALLET_NETWORKS as bi, recordsFromWellKnown as bl, sealSecret as bm, parseSshPublicKey as bn, groupSignalFrame as bo, appFingerprint as bp, readAtprotoCid as br, typingKindOf as bs, GroupWakeLimiter as bt, isProofAdapter as bu, createLink as bv, __require as bx, encodeTurnFields as by, APP_STORE_LIMITS as c, handoffStreamKey as c_, ENDPOINT as ca, WATCH_SHARE as cb, vapidKeysMatch as cc, imageSize as cd, previewImageSize as cf, isValidServiceId as cg, sanitizeRequestHeaders as ch, jwkThumbprint as ci, NIP05_PATH as cl, verifyCommitSignature as cm, parseGroupMetaBody as cn, readGroupWant as co, statusCardText as cp, parseAtprotoDidDocument as cr, TYPING_RATE_WINDOW_MS as cs, encodeGroupEntryLink as ct, signIdentityPresentation as cu, createDeviceInvite as cv, fromBase64 as cx, TURN_LABEL as cy, readAppListing as d, handoffVersions as d_, findEndpoint as da, normalizeRelayUrl as db, APP_PEER_OPEN_MAX as dc, readImageMeta as dd, forwardedAgain as df, servicesToWire as dg, webLocalFetch as dh, signDidDhtPacket as di, dnsProofName as dl, confirmationTag as dm, parseGroupMetaTag as dn, CarriedTransport as do, MESSAGE_CLOCK_SKEW_MS as dp, AtprotoProofError as dr, TYPING_STATUS_MAX as ds, knockIdentity as dt, applyIdentityEvent as du, encodeDeviceInvite as dv, randomBytes as dx, TURN_NAME_BYTES as dy, handoffHaveFrames as e_, parseInvoiceCallback as ea, RELAY_REQUESTS_PER_MINUTE as eb, PUSH_SERVICE_HOSTS as ec, LIVE_POLL_MS as ed, validEditMessage as ef, isEmptyLinkPacket as eg, presenceSeenAt as eh, DidDhtError as ei, newMailbox as el, expectedRoster as em, groupMetaBody as en, GROUP_VERSION_FILES as eo, cardLine as ep, ATPROTO_PROOF_COLLECTION as er, FILE_FRAMES as es, shortHash as et, identityPresentationBytes as eu, enrollProofFrame as ev, MAX_NICK_LENGTH as ex, TURN_SETTLE_MS as ey, readAppStore as f, isHandoffPartName as f_, isFederationId as fa, readRelayBody as fb, APP_RATE_LIMIT as fc, FileTransfers as fd, forwardedMany as ff, HANDOFF_ACK as fg, CHUNK_FLAG_END as fh, ETHEREUM_USDT as fi, domainTxtRecord as fl, decryptText as fm, signGroupMeta as fn, GROUP_SIGNAL_FRAME as fo, arrivalKey as fp, atprotoCidFor as fr, TYPING_TIMEOUT_MS as fs, knockRecords as ft, lastSharedWithMe as fu, readDeviceInvite as fv, toBase64 as fx, TURN_NO_ACTIVE as fy, APP_BUNDLE_MAGIC as g, readHandoffBusy as g_, ANSWERS_REFUSED_PAUSE_MS as ga, BREAKER_BASE_MS as gb, APP_VERSION_MAX as gc, sanitizeFileName as gd, QUICK_REACTIONS as gf, HANDOFF_CANCEL as gg, PROTOCOL_VERSION as gh, SEPOLIA_TEST_USDT as gi, nip05RootKey as gl, newEpochSecret as gm, SSHSIG_NAMESPACE as gn, SIGNAL_FRESH_MS as go, shownTime as gp, findInMst as gr, parseTypingFrame as gs, GROUP_WAKE_GROUP_LIMIT as gt, STORAGE_LIFETIME as gu, INVITE_MAX_LENGTH as gv, utf8Encode as gx, TURN_SLOTS as gy, APP_BUNDLE_LIMITS as h, readHandoffAck as h_, ANSWERS_REFUSED_PAUSES as ha, BREAKER_ALL_DOWN_PROBE_MS as hb, APP_SEND_LIMIT as hc, safeBlobType as hd, GROUP_REACTION_FRAME as hf, HANDOFF_BUSY_REASONS as hg, MAX_CHUNK_PAYLOAD_BYTES as hh, PaymentPreflightError as hi, isPublicAddress as hl, epochKeys as hm, SSHSIG_MAX_ARMOR as hn, SIGNAL_CARRIERS as ho, receivedTimestamp as hp, encodeDagCbor as hr, parseTypingActivity as hs, GROUP_WAKE_FRAME as ht, PeerProofs as hu, INVITE_LINK_ORIGIN as hv, utf8Decode as hx, TURN_SIGNED_BYTES as hy, appUpdateDecision as i, handoffPakeFrame as i_, resolveLightningDestination as ia, SIGNALING_WINDOW_MS as ib, encryptPushPayload as ic, dhtFileElements as id, canonicalUrl as if, MAX_SERVICES as ig, formatLocalTarget as ih, didDhtKey as ii, DOMAIN_FILE_MAX_BYTES as il, signCommit as im, groupMetaTag as in, groupFileFallback as io, checkStatusCard as ip, atprotoProofRkey as ir, transferStalled as is, GROUP_ENTRY_PROFILE as it, isIdentityBinding as iu, verifyEnrollProof as iv, stripHidden as ix, turnPutSummary as iy, isAppPath as j, SET_ACK as j_, PAIRING_ATTEMPT_MS as ja, newerPacket as jb, FILES_CAPABILITY as jc, voiceLevel as jd, validReactionNumber as jf, HANDOFF_RELEASE as jg, CALL_SIGNAL_FUTURE_MS as jh, sparkAddressKind as ji, CapsKeys as jl, DIRECT_EVIDENCE_MS as jm, MessageRefusal as jn, COMMUNITY_TOPOLOGY as jo, readAppRevocationShape as jp, DidError as jr, pinFrame as js, frameBytes as jt, RING_LIFETIME as ju, DEVICE_CAPABILITIES as jv, turnKeys as jy, findAppForbiddenKey as k, sealHandoffPiece as k_, LIVENESS_PING_MS as ka, createRelayPayload as kb, CALLS_CAPABILITY as kc, voiceDownloadName as kd, readDhtReactions as kf, HANDOFF_PIECE_BYTES as kg, offerIsFresh as kh, SPARK_PROVIDER as ki, CAPS_REFRESH_MS as kl, REANSWERS as km, verifyBitcoinMessage as kn, pickMeshHubs as ko, isAppSignature as kp, DID_MAX_LENGTH as kr, parsePinFrame as ks, asWritten as kt, verifyNostrProof as ku, readInviteCode as kv, signTurnRelease as ky, checkAppListing as l, handoffVerifiedFrame as l_, cashuRequestPayload as la, WRITE_FIRST_MS as lb, APP_DATA_MAX_BYTES as lc, isImageMime as ld, sanitizePreviewImage as lf, serviceIdFromName as lg, sanitizeResponseHeaders as lh, openDidDhtPayload as li, WELL_KNOWN_PATH as ll, GROUP_PROFILE as lm, parseGroupMetaFrame as ln, readGroupWantNo as lo, taskProgress as lp, shortAtprotoDid as lr, TYPING_REFRESH_MS as ls, entryParams as lt, verifyIdentityPresentation as lu, deviceInviteJoinerKeyZ32 as lv, fromBase64Url as lx, TURN_LAST_SEQUENCE as ly, signAppStore as m, openHandoffPiece as m_, parseFedimintRequestPayload as ma, traceLink as mb, APP_RESUME_GRACE_MS as mc, formatFileSize as md, COMMUNITY_REACTION_FRAME as mf, HANDOFF_BUSY as mg, LIMITS as mh, ONCHAIN_PROVIDER as mi, encodeDnsQuery as ml, encryptText as mm, wrapGroupMeta as mn, SIGNALS_PER_MINUTE as mo, heardTime as mp, decodeDagCbor as mr, TypingSender as ms, readKnocks as mt, PROOF_CAPABILITY as mu, INVITE_HRP as mv, toZ32 as mx, TURN_SEALED_BYTES as my, appRevocationFor as n, handoffManifestFrames as n_, parsePayParams as na, RelayTransport as nb, checkPushEndpoint as nc, peekDhtMailbox as nd, LINK_MAX_CHARS as nf, HTTP_SERVICE_PROTO as ng, HttpClient as nh, didDhtDocument as ni, DNS_LABEL as nl, rosterAdmin as nm, groupMetaNewer as nn, GROUP_WANT_NO_FRAME as no, cardTimeUtc as np, atprotoDidMethod as nr, refusalText as ns, verifyCommunityChain as nt, identityStatement as nu, readEnrollGrant as nv, sanitizeDisplayText as nx, classifyTurnRead as ny, planAppUpdate as o, handoffRequestFrame as o_, decodeBolt11 as oa, SLOW_MS as ob, pushRequest as oc, readDhtFile as od, linksIn as of, decodeServices as og, relativizeLocation as oh, encodeDidDhtDeactivated as oi, DOMAIN_METHODS as ol, verifyChain as om, nextGroupMetaRevision as on, readGroupFileMeta as oo, sameButtonText as op, isAtprotoDid as or, TYPING_KINDS as os, MAX_KNOCKS as ot, receivedIdentityStatus as ou, DEVICE_INVITE_LIFETIME_S as ov, bytesEqual as ox, TOMBSTONE_TURN as oy, readAppStoreSteps as p, newHandoffId as p_, parseCashuRequestPayload as pa, setLinkTraceSink as pb, APP_RATE_WINDOW_MS as pc, PREVIEWABLE_IMAGE as pd, readForwarded as pf, HANDOFF_ATTEMPTS as pg, CHUNK_KIND as ph, EVM_TEST_CHAINS as pi, domainWellKnownFile as pl, edgeParams as pm, verifyGroupMetaSignature as pn, GROUP_VERSION_SIGNALS as po, claimedTime as pp, decodeAtprotoCommit as pr, TypingReceiver as ps, mergeKnocks as pt, PROOF_ADAPTERS as pu, DEVICE_INVITE_VERSION as pv, toBase64Url as px, TURN_REV_LIMIT as py, communityRoster as q, enrollCancelFrame as q_, EngineError as qa, generateEncryptionKey as qb, SESSION_RECEIVE_PENDING as qc, MAX_EDITS_PER_MESSAGE as qd, ROUTINE_STATES as qf, handoffContextProof as qg, signalHasVideo as qh, homeserverWebEndpoint as qi, IDENTITY_REVOCATION_LABEL as ql, OFFER_STEP_MAX as qm, sha256d as qn, shouldBeHub as qo, MAX_GROUP_CHAIN as qp, signingKeys as qr, parseWakeFrame as qs, wireMentions as qt, ACTIVE_DHT_POLL_MS as qu, signDeviceTransports as qv, GROUP_BURST_ONE_LINK as qy, appStoreDecision as r, handoffOfferFrame as r_, requestLnurlInvoice as ra, SIGNALING_ALLOWANCE_SHARE as rb, decryptPushPayload as rc, DHT_FILE_CAPABILITY as rd, LINK_PREVIEW_LIMITS as rf, LEGACY_SERVICES as rg, HttpHost as rh, didDhtFromPublicKey as ri, DNS_TYPE as rl, rosterHas as rm, groupMetaPicture as rn, fetchesByItself as ro, cardUrl as rp, atprotoProofRecord as rr, transferEnded as rs, verifyCommunityCommit as rt, identityStatementText as ru, readEnrollHello as rv, sanitizeNick as rx, keptAtEqualSequence as ry, APP_STORE_KINDS as s, handoffRetryAfter as s_, findBolt11 as sa, TURN_SOURCE_TIMEOUT_MS as sb, vapidAuthorization as sc, IMAGE_LIMITS as sd, parseLinkPreview as sf, encodeServices as sg, resolveTargetUrl as sh, encodeDidDhtPacket as si, DOMAIN_TXT_MAX_BYTES as sl, verifyCommit as sm, openGroupMeta as sn, readGroupHave as so, statusCardBytes as sp, normalizeAtprotoHandle as sr, TYPING_RATE_LIMIT as ss, decodeGroupEntryLink as st, revokesIdentity as su, DEVICE_INVITE_OWN_DEVICE as sv, concatBytes as sx, TURN_BODY_BYTES as sy, addedAppPermissions as t, handoffHelloFrame as t_, parseLightningDestination as ta, REQUESTS_PER_MINUTE as tb, WebPushError as tc, emptyDhtDeliveryState as td, validEditNumber as tf, parseLinkRecords as tg, GhostlyHttpError as th, decodeDidDhtPacket as ti, readManifest as tl, rememberAlone as tm, groupMetaChange as tn, GROUP_WANT_FRAME as to, cardLinkHost as tp, ATPROTO_PROOF_SCOPE as tr, FILE_LIMITS as ts, signCommunity as tt, identityRevocationValue as tu, formatEnrollDigits as tv, hasVisible as tx, TURN_VISIBLE_MS as ty, checkAppStoreIndex as u, handoffVerifiedMessage as u_, fedimintRequestPayload as ua, currentRelays as ub, APP_FRAME as uc, parseImageMeta as ud, FORWARD_LIMITS as uf, servicesFromWire as ug, viewerResponseHeaders as uh, resolveDidDht as ui, decodeDnsResponse as ul, confirmationMatches as um, parseGroupMetaStatement as un, CARRIED_DEFER_MS as uo, usageLeft as up, AtprotoCid as ur, TYPING_SEND_LIMIT as us, groupEntryUrl as ut, IDENTITY_TIMELINE_MAX as uu, deviceInviteJoinerParams as uv, fromZ32 as ux, TURN_MAX as uy, APP_CLIENT_NAME as v, readHandoffData as v_, CROSSED_FRESH_MS as va, BREAKER_THRESHOLD as vb, appCloseFrame as vc, PLAYABLE_AUDIO as vd, REACTION_FRAME as vf, HANDOFF_DATA as vg, decodeControl as vh, TEST_USDT_FAUCET_AMOUNT as vi, parseDomainTxt as vl, openSecret as vm, SSH_PUBLIC_KEY_MAX as vn, SIGNAL_PROVEN_MS as vo, APP_PREFIXES as vp, parseAtprotoDidKey as vr, typingActivity as vs, GROUP_WAKE_MEMBER_INTERVAL_MS as vt, emptyProofLedger as vu, OwnInviteError as vv, __esmMin as vx, TURN_VERSION as vy, appDigest as w, readHandoffPake as w_, GhostLink as wa, withRequestOptions as wb, isChatAppId as wc, fileMessageText as wd, queueReaction as wf, HANDOFF_LATER_BYTES as wg, DATA_CHANNEL_LABEL as wh, isWalletNetwork as wi, wellKnownUrl as wl, DATA_SETTLE_MS as wm, sshKeyDigestHex as wn, NO_HUB_POLICY as wo, appSignedBytes as wp, DID_DOCUMENT_MAX_BYTES as wr, PIN_CLOCK_SKEW_MS as ws, parseGroupWakeFrame as wt, proofStatement as wu, inviteLink as wv, readTurnBody as wy, APP_PERMISSIONS as x, readHandoffHave as x_, DEMOTE_MS as xa, budgetRetryMs as xb, appOpenFrame as xc, VOICE_METER as xd, nextReactionNumber as xf, HANDOFF_FILE_REQUEST as xg, sendBody as xh, assertTokenUnits as xi, recordsName as xl, sha256Hex as xm, parseSshSignature as xn, readGroupSignal as xo, appRef as xp, unsignedCommitBytes as xr, COMMUNITY_PIN_FRAME as xs, groupWakeFrame as xt, nostrProofTemplate as xu, decodeInviteCode as xv, __toCommonJS as xx, firstDeviceSetSecret as xy, APP_FORBIDDEN_KEYS as y, readHandoffDone as y_, CROSSED_WAIT_MS as ya, RelayBreaker as yb, appDataBytes as yc, RECORDING_TYPES as yd, REACTION_LIMITS as yf, HANDOFF_DONE as yg, encodeChunk as yh, USDT_PUBLIC_RPC as yi, recordsFromTxt as yl, sealPair as ym, SshSigError as yn, SIGNAL_REPLY_MS as yo, APP_STATEMENT_LIMITS as yp, parseAtprotoVerificationKey as yr, typingFrame as ys, GROUP_WAKE_RECEIVE_LIMIT as yt, importedProof as yu, createChatInvite as yv, __exportAll as yx, TurnRecordError as yy, COMMUNITY_LIMITS as z, verifySetUpdate as z_, RTC_UNSTARTED_MS as za, createIdentity as zb, TYPING_CAPABILITY as zc, parseVideoMeta as zd, replySnippet as zf, filePartName as zg, compressSdp as zh, isPubkyProofFolder as zi, IDENTITY_CHALLENGE_WINDOW as zl, DHT_POLL_INTERVALS as zm, compactSize as zn, mergeBeacon as zo, canonicalJson as zp, didWebFileNames as zr, WAKE_CALL_WAIT_MS as zs, meshMessageRef as zt, TRANSPORTS as zu, deviceKeyZ32 as zv, turnVerifierMark as zy };
31955
+ export { decodeCommunityLink as $, ENROLL_CANCEL as $_, EngineError as $a, readDnsName as $b, sessionCapabilitiesFrame as $c, EDIT_FRAME as $d, BUTTON_STYLES as $f, handoffAttemptAllowed as $g, extractParamsFromSdp as $h, pubkyHomeserverOf as $i, IDENTITY_MAX_FRAME as $l, LinkSession as $m, txHash as $n, shouldBeHub as $o, GROUP_ID as $p, staticDidDocument as $r, WakeLimiter as $s, MAX_GROUP_META_BODY as $t, irohRelayUrl as $u, deviceLinkParams as $v, BACKGROUND_WHILE_SIGNALING as $y, isAppLicense as A, readHandoffData as A_, GhostLink as Aa, BREAKER_BASE_MS as Ab, appOpenFrame as Ac, VOICE_LIMITS as Ad, ReactionWindow as Af, HANDOFF_DATA as Ag, decodeControl as Ah, parsePaymentAmount as Ai, recordsFromWellKnown as Al, sealSecret as Am, sshSignCommand as An, NO_HUB_POLICY as Ao, appFingerprint as Ap, DID_FILE_MAX_BYTES as Ar, COMMUNITY_PIN_FRAME as As, GROUP_LIMITS as At, isProofAdapter as Au, OwnInviteError as Av, utf8Decode as Ax, TURN_VERSION as Ay, groupTypingEpoch as B, sameDigest as B_, RACE_ANSWERED_MS as Ba, PKARR_FUTURE_SKEW_MS as Bb, FILES_BINARY_CAPABILITY as Bc, voiceFileName as Bd, readReaction as Bf, HANDOFF_PAKE as Bg, extractRtcParams as Bh, isBitcoinAddress as Bi, CapsExchange as Bl, STALLED_EVIDENCE_MS as Bm, decodeBase64 as Bn, doorHubs as Bo, readAppRevocation as Bp, didJwsAlg as Br, pinFrame as Bs, GROUP_EDIT_TEXT_BYTES as Bt, verifyPeerProof as Bu, ownInviteRefusal as Bv, signTurnPacket as By, APP_VIEWS as C, handoffVersions as C_, CROSSED_FRESH_MS as Ca, WRITE_FIRST_MS as Cb, APP_RESUME_GRACE_MS as Cc, PREVIEWABLE_IMAGE as Cd, readForwarded as Cf, servicesToWire as Cg, webLocalFetch as Ch, TEST_USDT_FAUCET_AMOUNT as Ci, domainWellKnownFile as Cl, edgeParams as Cm, SSH_PUBLIC_KEY_MAX as Cn, SIGNAL_HOLD_MS as Co, claimedTime as Cp, parseAtprotoDidKey as Cr, TypingSender as Cs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ct, PROOF_ADAPTERS as Cu, encodeDeviceInvite as Cv, fromBase64 as Cx, TURN_NAME_BYTES as Cy, buildAppBundle as D, readHandoffAck as D_, DEMOTE_MS as Da, setLinkTraceSink as Db, appCloseFrame as Dc, sanitizeMime as Dd, REACTED_FRAME as Df, HANDOFF_BUSY_REASONS as Dg, MAX_CHUNK_PAYLOAD_BYTES as Dh, assertWholeSats as Di, normalizeDomain as Dl, openPair as Dm, sameSshKey as Dn, readGroupSignal as Do, APP_NAME as Dp, verifyAtprotoRecordProof as Dr, typingActivity as Ds, groupWakes as Dt, STORAGE_ROOT as Du, INVITE_LINK_ORIGIN as Dv, toBase64 as Dx, TURN_SIGNED_BYTES as Dy, assembleAppBundle as E, openHandoffPiece as E_, DEMOTE_AFTER_FAILURES as Ea, readRelayBody as Eb, AppSessions as Ec, sanitizeFileName as Ed, QUICK_REACTIONS as Ef, HANDOFF_BUSY as Eg, LIMITS as Eh, assertTokenUnits as Ei, nip05RootKey as El, newEpochSecret as Em, parseSshSignature as En, groupSignalFrame as Eo, shownTime as Ep, unsignedCommitBytes as Er, sanitizeTypingStatus as Es, groupWakeFrame as Et, STORAGE_LIFETIME as Eu, INVITE_HRP as Ev, randomBytes as Ex, TURN_SEALED_BYTES as Ey, readAppBundleAsync as F, readHandoffManifest as F_, LIVENESS_PING_MS as Fa, budgetRetryMs as Fb, readAppFrame as Fc, formatVoiceDuration as Fd, reactedFrame as Ff, HANDOFF_HELLO as Fg, DATA_CHANNEL_ID as Fh, isSparkAddress as Fi, CAPS_ISSUED_BACK_MS as Fl, DataLink as Fm, BIP322_REVISION as Fn, pickMeshHubs as Fo, checkAppRevokeStatement as Fp, DID_METHODS as Fr, PIN_LIMITS as Fs, chainPieces as Ft, storageProof as Fu, encodeInviteCode as Fv, __require as Fx, openTurnValue as Fy, CommunitySession as G, encodeSetSlots as G_, RTC_UNSTARTED_MS as Ga, newerPacket as Gb, SERVICES_CAPABILITY as Gc, VIDEO_LIMITS as Gd, REPLY_LIMITS as Gf, HANDOFF_TIMINGS as Gg, PAIRED_CALL_CANDIDATES as Gh, newPubkyProofFolder as Gi, dialDescriptors as Gl, directBlocked as Gm, decodeAnyBitcoinAddress as Gn, mergeBeacon as Go, signAppRevocation as Gp, didWebFileUrl as Gr, DEVICE_WAKE_TTL_SECONDS as Gs, parseCommunityEdit as Gt, validRingKey as Gu, DEVICE_PING_FRAME as Gv, turnPacket as Gy, sealGroupTyping as H, sortParts as H_, RACE_RELAYED_MS as Ha, RELAY_PAYLOAD_MAX_BYTES as Hb, KNOWN_SESSION_CAPABILITIES as Hc, voiceLevelsOf as Hd, wireReaction as Hf, HANDOFF_PIECE_OVERHEAD as Hg, parseRtcSignal as Hh, PUBKY_PROOF_ROOT as Hi, CapsRefusedError as Hl, DIRECT_OWN_ATTEMPTS as Hm, BitcoinAddressError as Hn, hubRank as Ho, readAppRevocations as Hp, didWebDocumentUrl as Hr, pinNumberHolds as Hs, communityEditFrame as Ht, ringAuthorization as Hu, DEVICES_CAPABILITY as Hv, turnInstance as Hy, sha256Paced as I, readHandoffPake as I_, MAX_PAIRED_MESSAGE_FRAME as Ia, heldBackError as Ib, APPS_CAPABILITY as Ic, isPlayableAudioType as Id, reactionEmoji as If, HANDOFF_LATER_BYTES as Ig, DATA_CHANNEL_LABEL as Ih, sparkAddressKind as Ii, CAPS_LABEL as Il, GATHER_ATTEMPTS as Im, MessageRefusal as In, wireHubPolicy as Io, isAppHash as Ip, DidError as Ir, mayPin as Is, frameBytes as It, storageProofBody as Iu, inviteLink as Iv, __toCommonJS as Ix, readTurnBody as Iy, communityGroupId as J, setUpdateFrame as J_, WAKE_LOST_MS as Ja, readOwnRelayPayload as Jb, SessionCapabilities as Jc, isVideoMime as Jd, readReply as Jf, HANDOFF_WINDOW as Jg, buildSdpFromSignal as Jh, pubkyProofFile as Ji, parsePacketTransports as Jl, DEPARTED_READ_MS as Jm, decodeWitness as Jn, pickHubs as Jo, verifyAppStatementBytes as Jp, parseDid as Jr, WAKE_CALL_WAIT_MS as Js, MENTION_LIMITS as Jt, RELAY_URL as Ju, deviceEchoFrame as Jv, turnSequence as Jy, GROUP_READ_NOTE_COMMUNITY as K, readSetUpdate as K_, SWITCH_RETIRE_MS as Ka, openRelayPayload as Kb, SESSION_CAPABILITIES_FRAME as Kc, formatVideoDuration as Kd, groupReplyAuthor as Kf, HANDOFF_VERIFIED as Kg, RTC_CONFIG as Kh, normalizePubkyKey as Ki, emptyCapsState as Kl, symmetricNat as Km, decodeBitcoinAddress as Kn, mergeLobby as Ko, verifyAppRevocation as Kp, didWebHost as Kr, WAKE_CALL_INTERVAL_MS as Ks, validEditText as Kt, verifyRingAuthorization as Ku, ENROLL_CAPABILITY as Kv, turnPayloadSequence as Ky, yieldThread as L, readHandoffRelease as L_, PAIRING_ATTEMPT_MS as La, isDiscoveryBudgetError as Lb, BUTTONS_CAPABILITY as Lc, parseVoiceMeta as Ld, reactionFrame as Lf, HANDOFF_LIST_PER_FRAME as Lg, RTC_SIGNAL_FUTURE_MS as Lh, sparkInvoiceDetails as Li, CAPS_LIMITS as Ll, GATHER_STALL_MS as Lm, bip322MessageHash as Ln, COMMUNITY_TOPOLOGY as Lo, isAppKey as Lp, checkDidJws as Lr, nextPinNumber as Ls, groupMessageId as Lt, storageProofPath as Lu, inviteOwnership as Lv, readTurnPacket as Ly, isAppUrl as M, readHandoffFileFrame as M_, INVITER_DIAL_GRACE_MS as Ma, BREAKER_THRESHOLD as Mb, isAppVersion as Mc, baseMime as Md, parseReactedFrame as Mf, HANDOFF_FILE_MISSING as Mg, encodeControl as Mh, walletNetworkOf as Mi, txtValue as Ml, ANSWER_REFUSED_REDIALS as Mm, isLegacySignature as Mn, meshHubs as Mo, appRefPublisher as Mp, DID_JWS_ALGS as Mr, PINNED_FRAME as Ms, GROUP_READ_NOTE as Mt, proofCapability as Mu, createLink as Mv, __commonJSMin as Mx, encodeTurnFields as My, pacer as N, readHandoffHave as N_, INVITE_TAKEN as Na, RelayBreaker as Nb, isChatAppId as Nc, downsamplePeaks as Nd, parseReactionFrame as Nf, HANDOFF_FILE_REQUEST as Ng, sendBody as Nh, SPARK_NETWORKS as Ni, validDomainRecord as Nl, CONNECT_TIMEOUT_MS as Nm, legacyMessageHash as Nn, meshRendezvous as No, appRevocationId as Np, DID_JWS_MAX_LENGTH as Nr, PIN_CLOCK_SKEW_MS as Ns, GroupSession as Nt, proofHash as Nu, decodeInviteCode as Nv, __esmMin as Nx, firstDeviceSetSecret as Ny, checkAppManifest as O, readHandoffBusy as O_, DHT_PIN_GRACE_MS as Oa, traceLink as Ob, appDataBytes as Oc, PLAYABLE_AUDIO as Od, REACTION_FRAME as Of, HANDOFF_CANCEL as Og, PROTOCOL_VERSION as Oh, formatPaymentAmount as Oi, parseDomainTxt as Ol, openSecret as Om, sshFingerprint as On, GROUP_VERSION_HUBS as Oo, APP_PREFIXES as Op, verifyAtprotoSignature as Or, typingFrame as Os, mentionedMembers as Ot, emptyProofLedger as Ou, INVITE_MAX_LENGTH as Ov, toBase64Url as Ox, TURN_SLOTS as Oy, readAppBundle as P, readHandoffHello as P_, LIVENESS_MISSED_PINGS as Pa, DiscoveryBudgetError as Pb, parseAppFrame as Pc, fileMessageText as Pd, queueReaction as Pf, HANDOFF_HAVE as Pg, wrapDataChannel as Ph, SPARK_PROVIDER as Pi, wellKnownUrl as Pl, DATA_SETTLE_MS as Pm, verifyBitcoinMessage as Pn, parseHubPolicy as Po, appSignedBytes as Pp, DID_MAX_LENGTH as Pr, PIN_FRAME as Ps, asWritten as Pt, proofStatement as Pu, encodeGhostlyInvite as Pv, __exportAll as Px, nextTurnPosition as Py, communityUntaggedHash as Q, DEVICE_KINDS as Q_, ENGINE_ERRORS as Qa, encodeTxtPacket as Qb, parseSessionCapabilities as Qc, EDIT_BUFFER_MS as Qd, BUTTON_ID as Qf, handoffAckFrame as Qg, decompressSdp as Qh, homeserverWebEndpoint as Qi, IDENTITY_MAX_EVIDENCE as Ql, IDLE_THRESHOLD as Qm, sha256d as Qn, readLobby as Qo, GROUP_ADMIN_OFF_ERROR as Qp, signingKeys as Qr, WAKE_TTL_SECONDS as Qs, wireMentions as Qt, irohDescriptor as Qu, deviceLinkPairing as Qv, BACKGROUND_REQUESTS_PER_MINUTE as Qy, GROUP_TYPING_FRAME as R, readHandoffTurnFrame as R_, PAIRING_RETRY_MS as Ra, withRequestOptions as Rb, CALLS_CAPABILITY as Rc, recordingMime as Rd, reactionIsNewer as Rf, HANDOFF_MANIFEST as Rg, RTC_SIGNAL_MAX_AGE_MS as Rh, sparkNetworkOf as Ri, CAPS_PUBLISH_SPACING_MS as Rl, OFFER_HOST_GATHER_MS as Rm, bip322ToSign as Rn, beaconKeys as Ro, isAppRef as Rp, checkDidSignature as Rr, parsePinFrame as Rs, COMMUNITY_EDIT_FRAME as Rt, validExternalKey as Ru, inviteQrSegments as Rv, sealTurnBody as Ry, APP_SCREENSHOTS_DIR as S, handoffVerifiedMessage as S_, BLOCKED_DIAL_WAIT_MS as Sa, WATCH_SHARE as Sb, APP_RATE_WINDOW_MS as Sc, FileTransfers as Sd, forwardedMany as Sf, servicesFromWire as Sg, viewerResponseHeaders as Sh, SEPOLIA_TEST_USDT_FAUCET as Si, domainTxtRecord as Sl, decryptText as Sm, SSH_KEY_TYPES as Sn, SIGNAL_FRESH_MS as So, arrivalKey as Sp, parseAtprotoCar as Sr, TypingReceiver as Ss, GROUP_WAKE_GROUP_WINDOW_MS as St, lastSharedWithMe as Su, deviceInviteJoinerParams as Sv, concatBytes as Sx, TURN_MAX as Sy, appViewOf as T, newHandoffId as T_, CROSSED_WAIT_MS as Ta, normalizeRelayUrl as Tb, APP_VERSION_MAX as Tc, safeBlobType as Td, GROUP_REACTION_FRAME as Tf, HANDOFF_ATTEMPTS as Tg, CHUNK_KIND as Th, WALLET_NETWORKS as Ti, isPublicAddress as Tl, epochKeys as Tm, parseSshPublicKey as Tn, SIGNAL_REPLY_MS as To, receivedTimestamp as Tp, readAtprotoCid as Tr, parseTypingFrame as Ts, GroupWakeLimiter as Tt, PeerProofs as Tu, DEVICE_INVITE_VERSION as Tv, fromZ32 as Tx, TURN_REV_LIMIT as Ty, COMMUNITY_LIMITS as U, SET_ACK as U_, REDESCRIBED_GRACE_MS as Ua, createRelayPayload as Ub, PIN_CAPABILITY as Uc, voicePeaksOf as Ud, PAIRED_REPLY_AUTHORS as Uf, HANDOFF_RELEASE as Ug, CALL_SIGNAL_FUTURE_MS as Uh, isPubkyKey as Ui, DHT_TEXT_CAPABILITY as Ul, DIRECT_PEERS as Um, ByteReader as Un, lobbyKeys as Uo, readAppSignature as Up, didWebFile as Ur, pinnedFrame as Us, communityMessageAuthor as Ut, ringClaims as Uu, DEVICE_CAPABILITIES as Uv, turnKeys as Uy, openGroupTyping as V, sealHandoffPiece as V_, RACE_DIRECT_MS as Va, PacketTooLargeError as Vb, FILES_CAPABILITY as Vc, voiceLevel as Vd, validReactionNumber as Vf, HANDOFF_PIECE_BYTES as Vg, offerIsFresh as Vh, PUBKY_PROOF_MAX_BYTES as Vi, CapsKeys as Vl, DIRECT_EVIDENCE_MS as Vm, verifyBip322 as Vn, freshHubs as Vo, readAppRevocationShape as Vp, didSignedMessages as Vr, pinIsNewer as Vs, carryMentions as Vt, RING_LIFETIME as Vu, readInviteCode as Vv, signTurnRelease as Vy, COMMUNITY_PROFILE as W, SET_UPDATE as W_, RESUME_WAIT_MS as Wa, measureRecords as Wb, REACTIONS_CAPABILITY as Wc, PLAYABLE_VIDEO as Wd, REPLY_ID as Wf, HANDOFF_REQUEST as Wg, CALL_SIGNAL_MAX_AGE_MS as Wh, isPubkyProofFolder as Wi, capsDescriptors as Wl, DirectPathWatch as Wm, compactSize as Wn, lobbyRecords as Wo, signAppObject as Wp, didWebFileNames as Wr, readPin as Ws, meshMessageRef as Wt, ringEvidence as Wu, DEVICE_ECHO_FRAME as Wv, turnName as Wy, communityMessageId as X, signTombstone as X_, parsePaymentNetworks as Xa, decodeDnsAnswers as Xb, UPGRADE_CAPABILITY as Xc, EDITED_FRAME as Xd, wireReply as Xf, filePartDigest as Xg, callSignalHeardAt as Xh, decodeSvcbRecords as Xi, IDENTITY_CHECK_UNAVAILABLE as Xl, EXPECT_PEER_MS as Xm, encodeWitness as Xn, readBeacon as Xo, canonicalJsonBytes as Xp, parseDidJws as Xr, WAKE_INTERVAL_MS as Xs, mentionsMember as Xt, automaticTransport as Xu, deviceFrameCapability as Xv, turnStatedVerifier as Xy, communityHasFrame as Y, setUpdateMessage as Y_, pairedMessageFrame as Ya, signRelayPayload as Yb, TYPING_CAPABILITY as Yc, parseVideoMeta as Yd, replySnippet as Yf, NO_ATTEMPTS as Yg, callRtcConfig as Yh, pubkyProofPath as Yi, IDENTITY_CHALLENGE_WINDOW as Yl, DHT_POLL_INTERVALS as Ym, encodeTx as Yn, rankHubs as Yo, canonicalJson as Yp, parseDidDocument as Yr, WAKE_FRAME as Ys, mentionsBytes as Yt, TRANSPORTS as Yu, deviceEchoNonce as Yv, turnSignedMessage as Yy, communityRoster as Z, verifySetUpdate as Z_, publishFailure as Za, decodeTxtPacket as Zb, WAKE_SESSION_CAPABILITY as Zc, EDIT_BUFFER_MAX as Zd, ACTIVE_TASK_STATUSES as Zf, filePartName as Zg, compressSdp as Zh, encodeSvcbPacket as Zi, IDENTITY_CLOCK_SKEW as Zl, FIRST_PUBLISH_MAX_MS as Zm, hash160 as Zn, readBeaconHead as Zo, readCanonicalJson as Zp, parseDidSignaturePaste as Zr, WAKE_SUBJECT as Zs, validMentions as Zt, checkedDescriptors as Zu, deviceKeyZ32 as Zv, turnVerifierMark as Zy, APP_CLIENTS as _, handoffReleaseFrame as __, isFederationId as _a, SIGNALING_ALLOWANCE_SHARE as _b, vapidKeysMatch as _c, IMAGE_LIMITS as _d, parseLinkPreview as _f, SERVICES_VERSION as _g, parseLocalTarget as _h, ETHEREUM_USDT as _i, DOMAIN_TXT_MAX_BYTES as _l, verifyCommit as _m, signGroupMeta as _n, CarriedTransport as _o, statusCardBytes as _p, atprotoCidFor as _r, TYPING_RATE_WINDOW_MS as _s, knockRecords as _t, revokesIdentity as _u, DEVICE_INVITE_BYTES as _v, sanitizeDisplayText as _x, TOMBSTONE_SEQUENCE as _y, checkAppBeforeRun as a, handoffContextProof as a_, parseInvoiceCallback as aa, FRESH_READ_MS as ab, relayRequest as ac, DHT_FILE_TOO_LARGE as ad, dhtEditId as af, signalHasVideo as ag, PRESENCE_WINDOW as ah, DidDhtError as ai, HOLD_DATED_BACK_MS as al, MEMBER_KEY as am, groupMetaBody as an, GROUP_HAVE_FRAME as ao, STATUS_CARD_LIMITS as ap, ATPROTO_PROOF_COLLECTION as ar, ChatFiles as as, shortHash as at, IDENTITY_SUBJECT as au, enrollCancelFrame as av, verify as ax, signDeviceTransports as ay, APP_ICON_PATH as b, handoffStreamKey as b_, ANSWERS_REFUSED_PAUSES as ba, SLOW_MS as bb, APP_PEER_OPEN_MAX as bc, parseImageMeta as bd, FORWARD_LIMITS as bf, isValidServiceId as bg, sanitizeRequestHeaders as bh, PaymentPreflightError as bi, decodeDnsResponse as bl, confirmationMatches as bm, SSHSIG_MAX_ARMOR as bn, SIGNALS_PER_MINUTE as bo, usageLeft as bp, encodeDagCbor as br, TYPING_STATUS_MAX as bs, GROUP_WAKE_FRAME as bt, IDENTITY_TIMELINE_MAX as bu, createDeviceInvite as bv, trimEndOf as bx, TURN_LABEL as by, APP_STORE_LIMITS as c, handoffDoneFrame as c_, requestLnurlInvoice as ca, GROUP_OVER_PACE_MS as cb, wakeRequest as cc, DHT_TEXT_REFUSED as cd, parseEditFrame as cf, MAX_MSGS_PAYLOAD_B64 as cg, TRANSPORTS_GONE_MS as ch, didDhtFromPublicKey as ci, HoldRefusedError as cl, commitHash as cm, groupMetaPicture as cn, GROUP_WANT_NO_FRAME as co, buttonLabelClash as cp, atprotoProofRecord as cr, FILE_LIMITS as cs, verifyCommunityCommit as ct, boundVerifiedIdentity as cu, enrollDoneFrame as cv, generateEncryptionKey as cx, seedSigner as cy, readAppListing as d, handoffFileRequestFrame as d_, decodeBolt11 as da, HEDGE_MISSING_MS as db, checkPushEndpoint as dc, emptyDhtDeliveryState as dd, validEditNumber as df, emptyLinkRecords as dg, presenceSeenAt as dh, encodeDidDhtDeactivated as di, readManifest as dl, rememberAlone as dm, nextGroupMetaRevision as dn, isGroupMessageId as do, cardLinkHost as dp, isAtprotoDid as dr, refusalText as ds, MAX_KNOCKS as dt, identityRevocationValue as du, enrollMessage as dv, MAX_AVATAR_LENGTH as dx, TURN_RAISE_READ_TIMEOUT_MS as dy, handoffAttemptFailed as e_, LIGHTNING_DESTINATION_PATTERN as ea, CHAT_RESERVE as eb, deviceWakeRequest as ec, rankTransports as ed, EDIT_RATE_WINDOW_MS as ef, heardCallSignal as eg, MAX_DHT_TEXT_BYTES as eh, strictBase64Url as ei, PAIRED_PROFILE as el, GROUP_MEMBER_CAP as em, MAX_GROUP_NAME_BYTES as en, engineError as eo, ITEM_STATES as ep, u32$2 as er, validHead as es, derivedSecret as et, IDENTITY_MAX_VALIDITY as eu, ENROLL_CANCEL_REASONS as ev, createIdentity as ex, deviceLinkRendezvousSeed as ey, readAppStore as f, handoffHaveFrames as f_, findBolt11 as fa, HEDGE_MS as fb, decryptPushPayload as fc, peekDhtMailbox as fd, LINK_MAX_CHARS as ff, isEmptyLinkPacket as fg, unusedInviteWait as fh, encodeDidDhtPacket as fi, DNS_LABEL as fl, rosterAdmin as fm, openGroupMeta as fn, readGroupFileMeta as fo, cardTimeUtc as fp, normalizeAtprotoHandle as fr, transferEnded as fs, decodeGroupEntryLink as ft, identityStatement as fu, enrollProofFrame as fv, MAX_AVATAR_SIDE as fx, TURN_SETTLE_MS as fy, APP_BUNDLE_MAGIC as g, handoffPakeFrame as g_, findEndpoint as ga, RelayTransport as gb, vapidAuthorization as gc, readDhtFile as gd, linksIn as gf, MAX_SERVICES as gg, formatLocalTarget as gh, signDidDhtPacket as gi, DOMAIN_METHODS as gl, verifyChain as gm, parseGroupMetaTag as gn, CARRIED_DEFER_MS as go, sameButtonText as gp, AtprotoProofError as gr, TYPING_RATE_LIMIT as gs, knockIdentity as gt, receivedIdentityStatus as gu, verifyEnrollProof as gv, hasVisible as gx, turnPutSummary as gy, APP_BUNDLE_LIMITS as h, handoffOfferFrame as h_, fedimintRequestPayload as ha, REQUESTS_PER_MINUTE as hb, pushRequest as hc, dhtFileId as hd, linkEnd as hf, LEGACY_SERVICES as hg, HttpHost as hh, resolveDidDht as hi, DOMAIN_MAX_RECORDS as hl, sortRoster as hm, parseGroupMetaStatement as hn, readGroupWantNo as ho, readStatusCard as hp, AtprotoCid as hr, TYPING_KINDS as hs, groupEntryUrl as ht, newIdentityBinding as hu, readEnrollHello as hv, MAX_NICK_LENGTH as hx, keptAtEqualSequence as hy, appUpdateDecision as i, handoffContext as i_, invoiceCallbackUrl as ia, DEPARTED_READS as ib, readWakePayload as ic, DHT_FILE_REFUSED as id, RateWindow as if, sdpHasCandidates as ig, PRESENCE_HEARTBEAT as ih, DID_DHT_VERSION as ii, HOLD_CAPABILITY as il, MAX_GROUP_MEMBERS as im, groupDisplayName as in, GROUP_FILE_LIMITS as io, RUN_RESULTS as ip, ATPROTO_FULL_SCOPE as ir, parsePairedCallFrame as is, rosterHash as it, IDENTITY_STATEMENT_PREFIX as iu, ENROLL_PROOF as iv, sign as ix, newDeviceSetSecret as iy, isAppPath as j, readHandoffDone as j_, HANDLED_WAIT_MS as ja, BREAKER_MAX_MS as jb, chatAppId as jc, VOICE_METER as jd, nextReactionNumber as jf, HANDOFF_DONE as jg, encodeChunk as jh, validatePaymentTarget as ji, recordsName as jl, sha256Hex as jm, verifySshSignature as jn, mayBeHub as jo, appRef as jp, DID_GHOSTLY_SERVICE as jr, GROUP_PIN_FRAME as js, GROUP_REACTED_FRAME as jt, nostrProofTemplate as ju, createChatInvite as jv, utf8Encode as jx, TurnRecordError as jy, findAppForbiddenKey as k, readHandoffCancel as k_, EARLY_DIAL_JOIN_MS as ka, BREAKER_ALL_DOWN_PROBE_MS as kb, appDataFrame as kc, RECORDING_TYPES as kd, REACTION_LIMITS as kf, HANDOFF_CANCEL_REASONS as kg, decodeChunk as kh, isWalletNetwork as ki, recordsFromTxt as kl, sealPair as km, sshKeyDigestHex as kn, MESH_HUBS as ko, APP_STATEMENT_LIMITS as kp, DID_DOCUMENT_MAX_BYTES as kr, typingKindOf as ks, parseGroupWakeFrame as kt, importedProof as ku, INVITE_VERSION as kv, toZ32 as kx, TURN_TTL as ky, checkAppListing as l, handoffEphemeral as l_, resolveLightningDestination as la, GROUP_RATION_WINDOW_MS as lb, PUSH_SERVICE_HOSTS as lc, DhtDelivery as ld, parseEditedFrame as lf, RECORD_TTL as lg, UNUSED_INVITE_WAIT_MAX_MS as lh, didDhtKey as li, isHoldUrl as ll, commitUntaggedHash as lm, groupMetaTag as ln, fetchesByItself as lo, cardEditNumber as lp, atprotoProofRkey as lr, decodeFileData as ls, GROUP_ENTRY_PROFILE as lt, emptyIdentityLedger as lu, enrollGrantFrame as lv, sealedLength as lx, webCryptoSigner as ly, signAppStore as m, handoffManifestFrames as m_, cashuRequestPayload as ma, RELAY_REQUESTS_PER_MINUTE as mb, generateVapidKeys as mc, dhtFileElements as md, canonicalUrl as mf, HTTP_SERVICE_PROTO as mg, HttpClient as mh, openDidDhtPayload as mi, DOMAIN_FILE_MAX_BYTES as ml, signCommit as mm, parseGroupMetaFrame as mn, readGroupWant as mo, checkStatusCard as mp, shortAtprotoDid as mr, TYPING_FRAME as ms, entryParams as mt, isIdentityBinding as mu, readEnrollGrant as mv, sanitizeAvatar as mx, classifyTurnRead as my, appRevocationFor as n, handoffBusyFrame as n_, fetchLnurlJson as na, CHAT_RESERVE_PER_CHAT as nb, parseWakeFrame as nc, transportOrder as nd, EDIT_SEND_LIMIT as nf, parseCallSignal as ng, OFFER_LOOK_MS as nh, DID_DHT_PREFIX as ni, SESSION_FRAME_MAX as nl, LEGACY_GROUP_MEMBERS as nm, MAX_GROUP_PICTURE_LENGTH as nn, parseEngineError as no, PR_STATES as np, varBytes as nr, PAIRED_CALL_FRAME as ns, leaveStatement as nt, IDENTITY_PROVIDER_ID as nu, ENROLL_GRANT as nv, identityFromSeedB64 as nx, deviceLinkSecret as ny, planAppUpdate as o, handoffDataFrame as o_, parseLightningDestination as oa, GROUP_BURST_MS as ob, wakeFrame as oc, DHT_MESSAGE_TTL as od, editFrame as of, waitForIceGathering as og, RELAY_POLL_INTERVALS as oh, decodeDidDhtPacket as oi, HOLD_LIMITS as ol, OWN_FRAME_LIMIT as om, groupMetaChange as on, GROUP_VERSION_FILES as oo, TASK_STATUSES as op, ATPROTO_PROOF_SCOPE as or, FILE_DATA_KIND as os, signCommunity as ot, IdentityCheckUnavailable as ou, enrollCancelReason as ov, decrypt as ox, unsignedDeviceTransports as oy, readAppStoreSteps as p, handoffHelloFrame as p_, ENDPOINT as pa, PREVIOUS_DEFAULT_RELAYS as pb, encryptPushPayload as pc, DHT_FILE_CAPABILITY as pd, LINK_PREVIEW_LIMITS as pf, parseLinkRecords as pg, GhostlyHttpError as ph, jwkThumbprint as pi, DNS_TYPE as pl, rosterHas as pm, parseGroupMetaBody as pn, readGroupHave as po, cardUrl as pp, parseAtprotoDidDocument as pr, transferStalled as ps, encodeGroupEntryLink as pt, identityStatementText as pu, formatEnrollDigits as pv, jpegSize$1 as px, TURN_VISIBLE_MS as py, communityCommitHash as q, setAckFrame as q_, UNPROVEN_AUTH_MS as qa, parseRelayPayload as qb, STATUS_CARD_CAPABILITY as qc, isPlayableVideoType as qd, pairedReplyAuthor as qf, HANDOFF_VERSION as qg, answersOffer as qh, pubkyProofCapability as qi, encodePacketTransports as ql, AWAITING_PEER_MS as qm, decodeTx as qn, newerHead as qo, verifyAppSignature as qp, normalizeDid as qr, WAKE_CALL_TTL_SECONDS as qs, MENTION_EVERYONE as qt, verifyRingEvidence as qu, HANDOFF_CAPABILITY as qv, turnReleaseMessage as qy, appStoreDecision as r, handoffCancelFrame as r_, findLightningDestination as ra, DEFAULT_RELAYS as rb, readWake as rc, ACTIVE_DHT_POLL_MS as rd, MAX_EDITS_PER_MESSAGE as rf, pickCallCandidates as rg, OFFER_STEP_MAX as rh, DID_DHT_TTL as ri, SESSION_RECEIVE_PENDING as rl, MAX_GROUP_CHAIN as rm, encodeGroupMetaBody as rn, PairingTracker as ro, ROUTINE_STATES as rp, ATPROTO_DECLARED_SCOPE as rr, PairedCalls as rs, leftStatement as rt, IDENTITY_REVOCATION_LABEL as ru, ENROLL_HELLO as rv, publicKeyFromZ32 as rx, devicePingFrame as ry, APP_STORE_KINDS as s, handoffDigest as s_, parsePayParams as sa, GROUP_BURST_ONE_LINK as sb, wakePayload as sc, DHT_TEXT_BYTES as sd, editedFrame as sf, LABEL$1 as sg, STALLED_LOOK_MS as sh, didDhtDocument as si, HoldKeys as sl, SAID_AGAIN as sm, groupMetaNewer as sn, GROUP_WANT_FRAME as so, appCardId as sp, atprotoDidMethod as sr, FILE_FRAMES as ss, verifyCommunityChain as st, IdentityExchange as su, enrollDigits as sv, encrypt as sx, verifyDeviceTransports as sy, addedAppPermissions as t, handoffAttemptSucceeded as t_, LNURL_LIMITS as ta, CHAT_RESERVE_MOST_SHARE as tb, newWakeToken as tc, relayedTransports as td, EDIT_RECEIVE_LIMIT as tf, isGlobalIpv4Host as tg, OFFER_FAST_MS as th, DID_DHT_MAX_PAYLOAD as ti, PairedSession as tl, GROUP_VERSION_LARGE as tm, MAX_GROUP_NAME_LENGTH as tn, engineText as to, PR_CHECKS as tp, u64 as tr, MAX_PAIRED_CALL_SIGNAL as ts, encodeCommunityLink as tt, IDENTITY_PROOF_CAPABILITY as tu, ENROLL_DONE as tv, identityFromSeed as tx, deviceLinkSealKey as ty, checkAppStoreIndex as u, handoffFileMissingFrame as u_, BOLT11_PATTERN as ua, GROUP_SIGNALING_ALLOWANCE_SHARE as ub, WebPushError as uc, LIVE_POLL_MS as ud, validEditMessage as uf, buildLinkRecords as ug, WATCH_PEER_MS as uh, didDhtRecords as ui, newMailbox as ul, expectedRoster as um, groupName as un, groupFileFallback as uo, cardLine as up, checkAtprotoProofRecord as ur, encodeFileData as us, KNOCK_TTL_MS as ut, identityPresentationBytes as uu, enrollHelloFrame as uv, tryDecrypt as ux, TURN_PUT_WINDOW_MS as uy, APP_CLIENT_NAME as v, handoffRequestFrame as v_, parseCashuRequestPayload as va, SIGNALING_WINDOW_MS as vb, APP_DATA_MAX_BYTES as vc, imageSize as vd, previewImageSize as vf, decodeServices as vg, relativizeLocation as vh, EVM_TEST_CHAINS as vi, NIP05_PATH as vl, verifyCommitSignature as vm, verifyGroupMetaSignature as vn, GROUP_SIGNAL_FRAME as vo, statusCardText as vp, decodeAtprotoCommit as vr, TYPING_REFRESH_MS as vs, mergeKnocks as vt, signIdentityPresentation as vu, DEVICE_INVITE_LIFETIME_S as vv, sanitizeNick as vx, TOMBSTONE_TURN as vy, appDigest as w, isHandoffPartName as w_, CROSSED_PROBE_MS as wa, currentRelays as wb, APP_SEND_LIMIT as wc, formatFileSize as wd, COMMUNITY_REACTION_FRAME as wf, HANDOFF_ACK as wg, CHUNK_FLAG_END as wh, USDT_PUBLIC_RPC as wi, encodeDnsQuery as wl, encryptText as wm, SshSigError as wn, SIGNAL_PROVEN_MS as wo, heardTime as wp, parseAtprotoVerificationKey as wr, parseTypingActivity as ws, GROUP_WAKE_RECEIVE_LIMIT as wt, PROOF_CAPABILITY as wu, readDeviceInvite as wv, fromBase64Url as wx, TURN_NO_ACTIVE as wy, APP_PERMISSIONS as x, handoffVerifiedFrame as x_, ANSWERS_REFUSED_PAUSE_MS as xa, TURN_SOURCE_TIMEOUT_MS as xb, APP_RATE_LIMIT as xc, readImageMeta as xd, forwardedAgain as xf, serviceIdFromName as xg, sanitizeResponseHeaders as xh, SEPOLIA_TEST_USDT as xi, dnsProofName as xl, confirmationTag as xm, SSHSIG_NAMESPACE as xn, SIGNAL_CARRIERS as xo, MESSAGE_CLOCK_SKEW_MS as xp, findInMst as xr, TYPING_TIMEOUT_MS as xs, GROUP_WAKE_GROUP_LIMIT as xt, applyIdentityEvent as xu, deviceInviteJoinerKeyZ32 as xv, bytesEqual as xx, TURN_LAST_SEQUENCE as xy, APP_FORBIDDEN_KEYS as y, handoffRetryAfter as y_, parseFedimintRequestPayload as ya, SLOW_DEMOTE_MS as yb, APP_FRAME as yc, isImageMime as yd, sanitizePreviewImage as yf, encodeServices as yg, resolveTargetUrl as yh, ONCHAIN_PROVIDER as yi, WELL_KNOWN_PATH as yl, GROUP_PROFILE as ym, wrapGroupMeta as yn, GROUP_VERSION_SIGNALS as yo, taskProgress as yp, decodeDagCbor as yr, TYPING_SEND_LIMIT as ys, readKnocks as yt, verifyIdentityPresentation as yu, DEVICE_INVITE_OWN_DEVICE as yv, stripHidden as yx, TURN_BODY_BYTES as yy, GroupTypingBoard as z, readHandoffVerified as z_, PONG_WAIT_MS as za, MAX_DNS_PACKET_BYTES as zb, EDIT_CAPABILITY as zc, voiceDownloadName as zd, readDhtReactions as zf, HANDOFF_OFFER as zg, buildDataSdp as zh, BITCOIN_NETWORKS as zi, CAPS_REFRESH_MS as zl, REANSWERS as zm, bip322ToSpend as zn, beaconRecords as zo, isAppSignature as zp, didGhostlyServiceEntry as zr, parsePinnedFrame as zs, GROUP_EDIT_FRAME as zt, verifyNostrProof as zu, inviteQrText as zv, signTurnBody as zy };
31295
31956
 
31296
- //# sourceMappingURL=src-BqHTnRWH.js.map
31957
+ //# sourceMappingURL=src-JQitqFJD.js.map