@ghostlytools/sdk 1.2.4 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +10 -4
- package/dist/app.js.map +1 -1
- package/dist/core.js +2 -2
- package/dist/{fakes-JOzOFxn3.js → fakes-Bpy2WRVB.js} +2 -2
- package/dist/{fakes-JOzOFxn3.js.map → fakes-Bpy2WRVB.js.map} +1 -1
- package/dist/fakes.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{keet-identity-key-BLli1rE4.js → keet-identity-key-DypfAhWn.js} +2 -2
- package/dist/{keet-identity-key-BLli1rE4.js.map → keet-identity-key-DypfAhWn.js.map} +1 -1
- package/dist/{src-BqHTnRWH.js → src-CXmIA8pL.js} +889 -119
- package/dist/src-CXmIA8pL.js.map +1 -0
- package/dist/testing.js +3 -3
- package/dist/types/core/src/appBundle.d.ts +28 -0
- package/dist/types/core/src/chatFiles.d.ts +41 -1
- package/dist/types/core/src/datalink.d.ts +13 -7
- package/dist/types/core/src/dhtDelivery.d.ts +22 -0
- package/dist/types/core/src/frames.d.ts +5 -0
- package/dist/types/core/src/ghostlink.d.ts +76 -3
- package/dist/types/core/src/groupCommunity.d.ts +41 -7
- package/dist/types/core/src/groupFiles.d.ts +6 -2
- package/dist/types/core/src/groupSession.d.ts +38 -5
- package/dist/types/core/src/groupSignals.d.ts +2 -0
- package/dist/types/core/src/link.d.ts +18 -0
- package/dist/types/core/src/miniApp.d.ts +10 -4
- package/dist/types/core/src/pairedCapabilities.d.ts +6 -1
- package/dist/types/core/src/pkarr.d.ts +6 -0
- package/dist/types/core/src/relay.d.ts +38 -4
- package/dist/types/core/src/relayBreaker.d.ts +4 -1
- package/dist/types/core/src/transport.d.ts +5 -0
- package/dist/{verify-RjMx7eW6.js → verify-Bxi3-0i6.js} +2 -2
- package/dist/{verify-RjMx7eW6.js.map → verify-Bxi3-0i6.js.map} +1 -1
- package/package.json +1 -1
- 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
|
-
/**
|
|
575
|
-
function
|
|
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
|
-
|
|
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
|
/**
|
|
@@ -789,9 +807,13 @@ var RelayBreaker = class {
|
|
|
789
807
|
this.circuits.delete(relay);
|
|
790
808
|
if (recovered) this.options.onRecover?.(relay);
|
|
791
809
|
}
|
|
792
|
-
/**
|
|
810
|
+
/**
|
|
811
|
+
* The relay failed a request; a probe that fails trips it again at once. While it is left alone and no probe is out,
|
|
812
|
+
* a failure is a request sent before it tripped (a start burst): already counted in, it trips nothing again.
|
|
813
|
+
*/
|
|
793
814
|
failure(relay, kind, reason) {
|
|
794
815
|
const circuit = this.circuit(relay);
|
|
816
|
+
if (!circuit.probing && circuit.openUntil > this.now()) return;
|
|
795
817
|
circuit.failures++;
|
|
796
818
|
circuit.kind = kind;
|
|
797
819
|
circuit.reason = reason;
|
|
@@ -935,8 +957,8 @@ var BACKGROUND_REQUESTS_PER_MINUTE = 20;
|
|
|
935
957
|
var WRITE_FIRST_MS = 5e3;
|
|
936
958
|
/**
|
|
937
959
|
* 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
|
|
939
|
-
* that spend the whole budget spend it over the minute, so the chat then takes the next request that frees, within
|
|
960
|
+
* fast for a signal due any moment), group requests and background ones leave it the last this many of each minute (more
|
|
961
|
+
* 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
962
|
* seconds, and has room for what follows (the receipt). Waiting for a refusal was too late when a contact went away
|
|
941
963
|
* from a chat and from groups at once: the chat and the groups' edges all watched fast for it, the edges spent both
|
|
942
964
|
* 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 +969,18 @@ var WRITE_FIRST_MS = 5e3;
|
|
|
947
969
|
*/
|
|
948
970
|
var CHAT_RESERVE = 10;
|
|
949
971
|
/**
|
|
972
|
+
* …and more while several chats need the relays at once: this many requests each (a read, an offer or answer, the read
|
|
973
|
+
* for the answer to it), up to `CHAT_RESERVE_MOST_SHARE` of the minute. Background requests leave it too, not the
|
|
974
|
+
* groups' alone: the looks of chats whose contacts are not there, and their presence (upkeep, `LinkSession`). An app
|
|
975
|
+
* opened while 30 of its 50 chats' contacts were online spent both relays' minute in its first second, on the presence
|
|
976
|
+
* of the chats whose contacts were long gone, its groups' records and every chat's first read: 12 of the 30 offers and
|
|
977
|
+
* answers went out, no read for an answer could, and 0 of the 30 chats were live 60 s after the start (bug hunt,
|
|
978
|
+
* 2026-10-13).
|
|
979
|
+
*/
|
|
980
|
+
var CHAT_RESERVE_PER_CHAT = 3;
|
|
981
|
+
/** The most of a relay's minute the chats' reserve takes, however many chats need it: the rest stays for everything else. */
|
|
982
|
+
var CHAT_RESERVE_MOST_SHARE = 5 / 6;
|
|
983
|
+
/**
|
|
950
984
|
* 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
985
|
* 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
986
|
* 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 +1355,22 @@ var RelayTransport = class {
|
|
|
1321
1355
|
}
|
|
1322
1356
|
/**
|
|
1323
1357
|
* Signs the records, dated by `nextTimestamp`, and hands the payload to `put` (the relays; the CLI adds the DHT).
|
|
1358
|
+
* When every relay's budget (or rate limit) holds this asker back, it throws that wait before signing anything
|
|
1359
|
+
* (`publishWait`): a daemon at its budget signed about 500 packets a minute that never went out. `elsewhere`: `put`
|
|
1360
|
+
* also takes the packet where no budget holds it back (the CLI's DHT), so it is signed whatever the relays say.
|
|
1324
1361
|
* `put` calls `conflict` for a relay that answered 409: it holds a packet under this key dated at or after this one,
|
|
1325
1362
|
* which this client has not read (an inviter's warm packet under the key it gave its contact, from a clock ahead of
|
|
1326
1363
|
* this one). That packet is read from that relay, and the records go again dated just past it, once. Without this
|
|
1327
1364
|
* the packet was refused until this device's clock passed the other one's, however long that took, and on a relay
|
|
1328
1365
|
* that did take it, readers still preferred the later-dated empty packet of another relay.
|
|
1329
1366
|
*/
|
|
1330
|
-
async publishDated(identity, records, put, options = {}, again = false) {
|
|
1331
|
-
const key = identity.pubKeyZ32
|
|
1367
|
+
async publishDated(identity, records, put, options = {}, again = false, elsewhere = false) {
|
|
1368
|
+
const key = identity.pubKeyZ32;
|
|
1369
|
+
if (!again && !elsewhere) {
|
|
1370
|
+
const held = this.publishWait(key, asker(options, true));
|
|
1371
|
+
if (held) throw new DiscoveryBudgetError(held.wait, `Publish held back on every relay: ${held.reasons.join("; ")}`);
|
|
1372
|
+
}
|
|
1373
|
+
const timestamp = this.nextTimestamp(key);
|
|
1332
1374
|
let redated;
|
|
1333
1375
|
const conflict = (relay) => {
|
|
1334
1376
|
if (again || redated) return;
|
|
@@ -1340,7 +1382,7 @@ var RelayTransport = class {
|
|
|
1340
1382
|
relay
|
|
1341
1383
|
});
|
|
1342
1384
|
if (this.lastTimestamp.get(key) !== timestamp) return true;
|
|
1343
|
-
await this.publishDated(identity, records, put, options, true);
|
|
1385
|
+
await this.publishDated(identity, records, put, options, true, elsewhere);
|
|
1344
1386
|
return true;
|
|
1345
1387
|
})();
|
|
1346
1388
|
redated.catch(() => {});
|
|
@@ -1352,6 +1394,46 @@ var RelayTransport = class {
|
|
|
1352
1394
|
if (!pending || !await pending) throw error;
|
|
1353
1395
|
}
|
|
1354
1396
|
}
|
|
1397
|
+
/**
|
|
1398
|
+
* 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,
|
|
1399
|
+
* without asking any: a relay the budget holds back gets its refused `take` (the asker's write then waits first in
|
|
1400
|
+
* line, as when `put` is refused), one rate limiting or throttling this address is a wait, one left alone for failing
|
|
1401
|
+
* is none. Null too when a relay fails another way (its network cooling down): the publish then goes, and fails, as
|
|
1402
|
+
* before, and when no relay is held back at all.
|
|
1403
|
+
*/
|
|
1404
|
+
publishWait(pubKeyZ32, who) {
|
|
1405
|
+
const probe = this.breaker.allDownProbe(this.relays);
|
|
1406
|
+
let wait = Infinity;
|
|
1407
|
+
const held = [], reasons = [];
|
|
1408
|
+
for (const relay of this.relays) {
|
|
1409
|
+
if (relay !== probe && this.networkCoolingDown(relay, "PUT")) return null;
|
|
1410
|
+
const limited = this.rateLimitedFor(relay);
|
|
1411
|
+
if (limited > 0) {
|
|
1412
|
+
wait = Math.min(wait, limited);
|
|
1413
|
+
reasons.push(`${relay}: Discovery relay is cooling down after a 429; retry shortly`);
|
|
1414
|
+
continue;
|
|
1415
|
+
}
|
|
1416
|
+
const blocked = relay === probe ? 0 : this.breaker.blockedFor(relay);
|
|
1417
|
+
if (blocked > 0) {
|
|
1418
|
+
if (this.breaker.blockedKind(relay) === "throttled") {
|
|
1419
|
+
wait = Math.min(wait, blocked);
|
|
1420
|
+
reasons.push(`${relay}: Discovery relay is throttling this address; retry shortly`);
|
|
1421
|
+
} else reasons.push(`${relay} is left alone after failing`);
|
|
1422
|
+
continue;
|
|
1423
|
+
}
|
|
1424
|
+
if (this.heldFor(relay, who, Date.now(), pubKeyZ32) <= 0) return null;
|
|
1425
|
+
held.push(relay);
|
|
1426
|
+
const left = this.heldFor(relay, who);
|
|
1427
|
+
wait = Math.min(wait, left);
|
|
1428
|
+
reasons.push(`${relay}: discovery budget reached; retry in ${Math.ceil(left / 1e3)} s`);
|
|
1429
|
+
}
|
|
1430
|
+
if (wait === Infinity) return null;
|
|
1431
|
+
for (const relay of held) this.take(relay, who, pubKeyZ32);
|
|
1432
|
+
return {
|
|
1433
|
+
wait,
|
|
1434
|
+
reasons
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1355
1437
|
/** One relay's packet for a key, read now: its time, kept for `nextTimestamp`. Null when it has none or does not answer. */
|
|
1356
1438
|
async heldAt(relay, pubKeyZ32, who) {
|
|
1357
1439
|
if (!this.take(relay, who, pubKeyZ32)) return null;
|
|
@@ -1371,10 +1453,22 @@ var RelayTransport = class {
|
|
|
1371
1453
|
sawTimestamp(pubKeyZ32, timestamp) {
|
|
1372
1454
|
if (timestamp > (this.seenTimestamp.get(pubKeyZ32) ?? 0n)) this.seenTimestamp.set(pubKeyZ32, timestamp);
|
|
1373
1455
|
}
|
|
1374
|
-
/**
|
|
1456
|
+
/**
|
|
1457
|
+
* Puts a payload `publishDated` just signed, dated `timestamp`, on every relay. Its signature is not checked: it was
|
|
1458
|
+
* made here (`publishPayload` checks one signed elsewhere, to read its sequence number). `conflict`: as `publishDated`
|
|
1459
|
+
* gives it.
|
|
1460
|
+
*/
|
|
1461
|
+
async putSigned(pubKeyZ32, payload, timestamp, options = {}, conflict) {
|
|
1462
|
+
if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
|
|
1463
|
+
await this.putEverywhere(pubKeyZ32, payload, timestamp, options, conflict);
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Puts a payload signed elsewhere (a did:dht document), byte for byte, on every relay; one signed here says its date
|
|
1467
|
+
* (`signedAt`) and is not checked again. `conflict`: as `publishDated` gives it.
|
|
1468
|
+
*/
|
|
1375
1469
|
async publishPayload(pubKeyZ32, payload, options = {}, conflict) {
|
|
1376
1470
|
if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
|
|
1377
|
-
const
|
|
1471
|
+
const seq = options.signedAt ?? openRelayPayload(pubKeyZ32, payload).seq;
|
|
1378
1472
|
await this.putEverywhere(pubKeyZ32, payload, seq, options, conflict);
|
|
1379
1473
|
}
|
|
1380
1474
|
/**
|
|
@@ -1415,7 +1509,7 @@ var RelayTransport = class {
|
|
|
1415
1509
|
accepted = true;
|
|
1416
1510
|
noWriteWaits();
|
|
1417
1511
|
try {
|
|
1418
|
-
this.written.set(pubKeyZ32,
|
|
1512
|
+
this.written.set(pubKeyZ32, readOwnRelayPayload(pubKeyZ32, payload));
|
|
1419
1513
|
} catch {}
|
|
1420
1514
|
resolve();
|
|
1421
1515
|
}, () => {});
|
|
@@ -1877,9 +1971,9 @@ var RelayTransport = class {
|
|
|
1877
1971
|
if (rationed.length >= most) wait = Math.max(wait, rationed[rationed.length - most] + GROUP_RATION_WINDOW_MS - now);
|
|
1878
1972
|
if (this.readsAhead(key, now) > 0) wait = Math.max(wait, TURN_WAIT_MS);
|
|
1879
1973
|
}
|
|
1880
|
-
if (who.group) {
|
|
1974
|
+
if (who.group || who.background) {
|
|
1881
1975
|
const reserved = this.chatReservedFor(relay, now);
|
|
1882
|
-
if (reserved > 0) wait = Math.max(wait, Math.min(reserved, over(recent, limit - this.
|
|
1976
|
+
if (reserved > 0) wait = Math.max(wait, Math.min(reserved, over(recent, limit - this.chatReserveOf(relay, now))));
|
|
1883
1977
|
}
|
|
1884
1978
|
const writer = firstWriter(who);
|
|
1885
1979
|
const waiting = (lane) => {
|
|
@@ -1989,6 +2083,12 @@ var RelayTransport = class {
|
|
|
1989
2083
|
if (share === void 0) return this.perMinute;
|
|
1990
2084
|
return this.perMinuteGiven ? Math.min(this.perMinute, share) : share;
|
|
1991
2085
|
}
|
|
2086
|
+
/** What the chats that need the relays keep on this relay (`CHAT_RESERVE_PER_CHAT`), never less than `reserveOf`. */
|
|
2087
|
+
chatReserveOf(relay, now) {
|
|
2088
|
+
let needing = 0;
|
|
2089
|
+
for (const need of this.chatNeeds.values()) if (now - Math.max(need.urgentAt, need.refused.get(relay) ?? -Infinity) < 6e4) needing++;
|
|
2090
|
+
return Math.max(this.reserveOf(relay), Math.min(needing * 3, Math.floor(this.limitOf(relay) * CHAT_RESERVE_MOST_SHARE)));
|
|
2091
|
+
}
|
|
1992
2092
|
/** What groups leave a chat on this relay: `CHAT_RESERVE`, or a third of a smaller budget. */
|
|
1993
2093
|
reserveOf(relay) {
|
|
1994
2094
|
return Math.min(10, Math.floor(this.limitOf(relay) / 3));
|
|
@@ -5505,6 +5605,7 @@ function wrapDataChannel(dc) {
|
|
|
5505
5605
|
close() {
|
|
5506
5606
|
dc.close();
|
|
5507
5607
|
},
|
|
5608
|
+
binary: true,
|
|
5508
5609
|
onMessage: null,
|
|
5509
5610
|
onClose: null
|
|
5510
5611
|
};
|
|
@@ -5516,11 +5617,31 @@ function wrapDataChannel(dc) {
|
|
|
5516
5617
|
dc.addEventListener("close", () => channel.onClose?.());
|
|
5517
5618
|
return channel;
|
|
5518
5619
|
}
|
|
5620
|
+
/**
|
|
5621
|
+
* Resolves once the channel has room for a body's next chunk; undefined when it has now. A channel with a send budget
|
|
5622
|
+
* (native and iroh ones throw past 120 KiB) gives a body a quarter of it, as files/3 keeps to, so a ping or a message
|
|
5623
|
+
* still fits beside it; others keep under the high water mark.
|
|
5624
|
+
*/
|
|
5625
|
+
function bodyRoom(channel, isCancelled) {
|
|
5626
|
+
if (!channel.sendBudget) return channel.bufferedAmount > LIMITS.sendHighWaterMark ? channel.drained() : void 0;
|
|
5627
|
+
const line = channel.sendBudget / 4;
|
|
5628
|
+
if (channel.bufferedAmount < line) return;
|
|
5629
|
+
return (async () => {
|
|
5630
|
+
while (!isCancelled() && channel.bufferedAmount >= line) {
|
|
5631
|
+
await channel.drained().catch(() => {});
|
|
5632
|
+
if (!isCancelled() && channel.bufferedAmount >= line) await new Promise((resolve) => setTimeout(resolve, 20));
|
|
5633
|
+
}
|
|
5634
|
+
})();
|
|
5635
|
+
}
|
|
5519
5636
|
/** Writes a body as chunks, honouring backpressure. Always ends with an END chunk. */
|
|
5520
5637
|
async function sendBody(channel, kind, id, body, isCancelled = () => false) {
|
|
5521
5638
|
for await (const part of body) for (let offset = 0; offset < part.length; offset += MAX_CHUNK_PAYLOAD_BYTES) {
|
|
5522
5639
|
if (isCancelled()) return;
|
|
5523
|
-
|
|
5640
|
+
const room = bodyRoom(channel, isCancelled);
|
|
5641
|
+
if (room) {
|
|
5642
|
+
await room;
|
|
5643
|
+
if (isCancelled()) return;
|
|
5644
|
+
}
|
|
5524
5645
|
const payload = part.subarray(offset, offset + MAX_CHUNK_PAYLOAD_BYTES);
|
|
5525
5646
|
channel.send(encodeChunk({
|
|
5526
5647
|
kind,
|
|
@@ -6141,6 +6262,17 @@ var DEPARTED_READ_MS = EXPECT_PEER_MS;
|
|
|
6141
6262
|
/** A chat whose contact was never seen (an invite just sent) keeps looking at the active pace this long. */
|
|
6142
6263
|
var AWAITING_PEER_MS = 6e5;
|
|
6143
6264
|
/**
|
|
6265
|
+
* An invite this side made that nobody used, once no longer awaited (`AWAITING_PEER_MS`), is read less often the older
|
|
6266
|
+
* it is: a fifth of its age between reads, up to this. Read at the background pace instead, 15 unused invites (their
|
|
6267
|
+
* keys and their mailboxes) asked the relays for 60 reads a minute for as long as the app ran: the relays' minute went
|
|
6268
|
+
* to invites nobody may ever open, and a join on one was noticed 90 s later (bug hunt 1013-1642, 2026-10-13).
|
|
6269
|
+
*/
|
|
6270
|
+
var UNUSED_INVITE_WAIT_MAX_MS = 18e4;
|
|
6271
|
+
/** The wait between reads of an unused invite of age `age` (`UNUSED_INVITE_WAIT_MAX_MS`), never shorter than the pace's `interval`. */
|
|
6272
|
+
function unusedInviteWait(age, interval) {
|
|
6273
|
+
return Math.max(interval, Math.min(UNUSED_INVITE_WAIT_MAX_MS, Math.round(age / 5)));
|
|
6274
|
+
}
|
|
6275
|
+
/**
|
|
6144
6276
|
* A group link's peer whose packet advertises and carries no `_tr` on every read for this long publishes none: what it
|
|
6145
6277
|
* said before is forgotten (WISP 902 § Transports). Not at the first such packet: an app with no WebRTC (a Linux
|
|
6146
6278
|
* Desktop) publishes its `_tr` only once a native endpoint is up, seconds after its first packet of a run, and what it
|
|
@@ -6206,6 +6338,8 @@ var LinkSession = class {
|
|
|
6206
6338
|
startedAt = Date.now();
|
|
6207
6339
|
/** 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
6340
|
awaitingSince;
|
|
6341
|
+
/** This side's invite, nobody used yet (`LinkSessionOptions.invite`). */
|
|
6342
|
+
invite;
|
|
6209
6343
|
intervals;
|
|
6210
6344
|
fastPollUntil = 0;
|
|
6211
6345
|
/** 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 +6395,7 @@ var LinkSession = class {
|
|
|
6261
6395
|
this.events = options.events ?? {};
|
|
6262
6396
|
this.firstPublish = options.firstPublish ?? "at-start";
|
|
6263
6397
|
this.awaitingSince = Math.min(options.awaitingSince ?? this.startedAt, this.startedAt);
|
|
6398
|
+
this.invite = options.invite ?? (() => false);
|
|
6264
6399
|
}
|
|
6265
6400
|
get peerPresence() {
|
|
6266
6401
|
return this.presence;
|
|
@@ -6434,8 +6569,8 @@ var LinkSession = class {
|
|
|
6434
6569
|
async setRtcSignal(signal, reportFailure = false) {
|
|
6435
6570
|
if (this.rtcSignal === signal) return;
|
|
6436
6571
|
this.rtcSignal = signal;
|
|
6437
|
-
if (reportFailure) await this.publish();
|
|
6438
|
-
else await this.publish().catch(() => {});
|
|
6572
|
+
if (reportFailure) await this.publish(signal === null);
|
|
6573
|
+
else await this.publish(signal === null).catch(() => {});
|
|
6439
6574
|
if (signal) this.pollNow();
|
|
6440
6575
|
}
|
|
6441
6576
|
/**
|
|
@@ -6508,6 +6643,7 @@ var LinkSession = class {
|
|
|
6508
6643
|
const stepping = this.fastStepsAfter ? Date.now() - this.fastStepsAfter : -1;
|
|
6509
6644
|
if (pace === "fast" && stepping >= 0) return Math.min(4 * interval, Math.max(2 * interval, stepping));
|
|
6510
6645
|
if (pace === "fast" || pace === "connected" || since < 0) return interval;
|
|
6646
|
+
if (pace === "background" && !this.presence.online && this.invite()) return unusedInviteWait(Date.now() - this.awaitingSince, interval);
|
|
6511
6647
|
return Math.min(interval, Math.max(2 * this.intervals.fast, since));
|
|
6512
6648
|
}
|
|
6513
6649
|
/**
|
|
@@ -6519,13 +6655,17 @@ var LinkSession = class {
|
|
|
6519
6655
|
watching() {
|
|
6520
6656
|
return Date.now() < this.watchUntil && this.rtcSignal === null && !(this.presence.online && this.presence.lastPacketAt > this.watchFrom);
|
|
6521
6657
|
}
|
|
6658
|
+
/** A contact never seen, whose invite was sent lately (`AWAITING_PEER_MS`): its join is due. */
|
|
6659
|
+
awaitingPeer() {
|
|
6660
|
+
return this.presence.lastPacketAt === 0 && Date.now() - this.awaitingSince < 6e5;
|
|
6661
|
+
}
|
|
6522
6662
|
/** How urgently this link looks right now. */
|
|
6523
6663
|
pace() {
|
|
6524
6664
|
if (Date.now() < this.stalledUntil) return "fast";
|
|
6525
6665
|
if (this.connected) return "connected";
|
|
6526
6666
|
if (Date.now() < this.fastPollUntil) return "fast";
|
|
6527
6667
|
if (Date.now() < this.watchUntil) return "active";
|
|
6528
|
-
if (!this.active && this.
|
|
6668
|
+
if (!this.active && this.awaitingPeer()) return "active";
|
|
6529
6669
|
if (!this.active) return "background";
|
|
6530
6670
|
return Date.now() - this.lastActivity > 6e4 ? "idle" : "active";
|
|
6531
6671
|
}
|
|
@@ -6582,7 +6722,9 @@ var LinkSession = class {
|
|
|
6582
6722
|
}, this.encKey);
|
|
6583
6723
|
const started = Date.now();
|
|
6584
6724
|
try {
|
|
6585
|
-
const
|
|
6725
|
+
const awaited = this.connected || this.presence.online || this.sentBuffer.length > 0 || this.callSignal !== null || this.awaitingPeer();
|
|
6726
|
+
const takesBack = !rtcSignal && this.rtcSignalOut !== null;
|
|
6727
|
+
const options = rtcSignal && rtcSignal !== this.rtcSignalOut ? { signal: true } : this.watching() ? { watch: true } : upkeep && (this.connected || takesBack) || !rtcSignal && !awaited ? { background: true } : void 0;
|
|
6586
6728
|
await this.transport.publish(this.identity, built.records, options);
|
|
6587
6729
|
} catch (error) {
|
|
6588
6730
|
const ms = Date.now() - started, waiting = isDiscoveryBudgetError(error);
|
|
@@ -6891,7 +7033,9 @@ var ICE_GATHERING_TIMEOUT_MS = 5e3;
|
|
|
6891
7033
|
* settle); where they do not, every offer of a first pairing waited the full 5 s, twice when the inviter offered too
|
|
6892
7034
|
* (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
7035
|
* 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`).
|
|
7036
|
+
* not, and the next offer of the chat then waits as long as it takes (`fullGather`). An answer is bounded the same way:
|
|
7037
|
+
* it waited the full 5 s, and two CLI daemons whose STUN server swallowed every request went live 10 s after the offer
|
|
7038
|
+
* rather than 2 s (calls bug hunt, 2026-10-12).
|
|
6895
7039
|
*/
|
|
6896
7040
|
var OFFER_HOST_GATHER_MS = 2e3;
|
|
6897
7041
|
/** The data link keeps collecting this long after the candidate it waited for came (a call keeps 400 ms). */
|
|
@@ -6922,6 +7066,14 @@ var REANSWERS = 2;
|
|
|
6922
7066
|
* backoff (meshSignals, PR #1363). Offers through members cost no relay request; over the relays four is still a few.
|
|
6923
7067
|
*/
|
|
6924
7068
|
var ANSWER_REFUSED_REDIALS = 4;
|
|
7069
|
+
/**
|
|
7070
|
+
* The same race a moment later: setRemoteDescription resolves, and the connection closes right after it (8 ms on a
|
|
7071
|
+
* loaded core). A connection that ends within this long of its answer going in was refused too: no network fails one
|
|
7072
|
+
* that soon (ICE gives up after tens of seconds), so it says nothing about direct connections (`DirectEvidence`).
|
|
7073
|
+
* Taken for a network that lets none through, an edge between two CLIs left WebRTC for the run, and a member whose
|
|
7074
|
+
* app has WebRTC alone (one from before native group links) was never reached again (groupCompat, 2026-10-12).
|
|
7075
|
+
*/
|
|
7076
|
+
var ANSWER_REFUSED_AFTER_MS = 1e3;
|
|
6925
7077
|
/** An offer this close to the end of the offerer's attempt is not answered again: the new answer would come too late. */
|
|
6926
7078
|
var REANSWER_MARGIN_MS = 15e3;
|
|
6927
7079
|
/**
|
|
@@ -6953,12 +7105,13 @@ var DataLink = class {
|
|
|
6953
7105
|
pc = null;
|
|
6954
7106
|
myOfferTs = 0;
|
|
6955
7107
|
/**
|
|
6956
|
-
* An offer of this side's that went without a public candidate came to nothing (
|
|
6957
|
-
* connected): the next one waits for its STUN servers as long as it takes
|
|
7108
|
+
* An offer or answer of this side's that went without a public candidate came to nothing (both descriptions were
|
|
7109
|
+
* exchanged, and no path connected): the next one waits for its STUN servers as long as it takes
|
|
7110
|
+
* (`ICE_GATHERING_TIMEOUT_MS`).
|
|
6958
7111
|
*/
|
|
6959
7112
|
fullGather = false;
|
|
6960
|
-
/** The offer out has no public candidate (as it went: the connection's description gains any that come later). */
|
|
6961
|
-
|
|
7113
|
+
/** The offer or answer out has no public candidate (as it went: the connection's description gains any that come later). */
|
|
7114
|
+
sentLacksPublic = false;
|
|
6962
7115
|
lastSignalTs = 0;
|
|
6963
7116
|
/** The peer's description as this connection was given it: Chrome shows it as `remoteDescription` only once applied. */
|
|
6964
7117
|
remoteSdp = null;
|
|
@@ -7004,7 +7157,7 @@ var DataLink = class {
|
|
|
7004
7157
|
this.options.setFastPoll(true, true);
|
|
7005
7158
|
}
|
|
7006
7159
|
this.myOfferTs = Date.now();
|
|
7007
|
-
this.
|
|
7160
|
+
this.sentLacksPublic = !PUBLIC_CANDIDATE.test(pc.localDescription?.sdp ?? "");
|
|
7008
7161
|
const signal = {
|
|
7009
7162
|
t: "o",
|
|
7010
7163
|
ts: this.myOfferTs,
|
|
@@ -7110,9 +7263,12 @@ var DataLink = class {
|
|
|
7110
7263
|
this.reset();
|
|
7111
7264
|
if (evidence) this.options.onDirect?.(evidence);
|
|
7112
7265
|
}
|
|
7113
|
-
/**
|
|
7266
|
+
/**
|
|
7267
|
+
* This side's offer went with no public candidate and was answered, or its answer went with none, and it came to
|
|
7268
|
+
* nothing: the next offer or answer gathers for as long as it takes.
|
|
7269
|
+
*/
|
|
7114
7270
|
noteNoPublic(ended) {
|
|
7115
|
-
if (ended && this.myOfferTs && this.
|
|
7271
|
+
if (ended && (this.myOfferTs || this.answered) && this.sentLacksPublic && this.state === "connecting") this.fullGather = true;
|
|
7116
7272
|
}
|
|
7117
7273
|
/**
|
|
7118
7274
|
* What this attempt says about direct connections if it ends now without opening: nothing unless both descriptions
|
|
@@ -7127,17 +7283,22 @@ var DataLink = class {
|
|
|
7127
7283
|
/**
|
|
7128
7284
|
* The attempt on this connection failed (it timed out, ICE failed or closed, its channel closed). An answer the
|
|
7129
7285
|
* 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.
|
|
7286
|
+
* else goes back to idle. `byConnection`: the connection said so itself, rather than a timer of this link's.
|
|
7131
7287
|
*/
|
|
7132
|
-
failed() {
|
|
7288
|
+
failed(byConnection = false) {
|
|
7133
7289
|
if (this.state === "offering" && this.remoteSdp) {
|
|
7134
7290
|
this.answerRefused("failed");
|
|
7135
7291
|
return;
|
|
7136
7292
|
}
|
|
7293
|
+
if (byConnection && this.state === "connecting" && this.myOfferTs && Date.now() - this.connectingSince < ANSWER_REFUSED_AFTER_MS) {
|
|
7294
|
+
this.answerRefused("failed");
|
|
7295
|
+
return;
|
|
7296
|
+
}
|
|
7137
7297
|
const answered = this.state === "connecting" ? this.answered : null;
|
|
7138
7298
|
const left = answered ? CONNECT_TIMEOUT_MS - (Date.now() - answered.at) : 0;
|
|
7139
|
-
const
|
|
7140
|
-
this.
|
|
7299
|
+
const givenUp = !!answered && this.options.offerStanding?.(answered.offer.ts) === false;
|
|
7300
|
+
const evidence = givenUp ? null : this.directEvidence();
|
|
7301
|
+
this.noteNoPublic(!givenUp);
|
|
7141
7302
|
if (answered && answered.again < 2 && left > REANSWER_MARGIN_MS && this.options.offerStanding?.(answered.offer.ts)) {
|
|
7142
7303
|
answered.again++;
|
|
7143
7304
|
traceLink(this.options.myPubKeyZ32, "reanswer", {
|
|
@@ -7178,6 +7339,7 @@ var DataLink = class {
|
|
|
7178
7339
|
await pc.setLocalDescription(await pc.createAnswer());
|
|
7179
7340
|
});
|
|
7180
7341
|
if (!pc) return;
|
|
7342
|
+
this.sentLacksPublic = !PUBLIC_CANDIDATE.test(pc.localDescription?.sdp ?? "");
|
|
7181
7343
|
const signal = {
|
|
7182
7344
|
t: "a",
|
|
7183
7345
|
ts: Date.now(),
|
|
@@ -7207,7 +7369,7 @@ var DataLink = class {
|
|
|
7207
7369
|
await waitForIceGathering(pc, ICE_GATHERING_TIMEOUT_MS, {
|
|
7208
7370
|
stallMs: GATHER_STALL_MS,
|
|
7209
7371
|
settleMs: 150,
|
|
7210
|
-
|
|
7372
|
+
...!this.fullGather ? { hostBoundMs: OFFER_HOST_GATHER_MS } : {}
|
|
7211
7373
|
});
|
|
7212
7374
|
if (this.pc !== pc) return null;
|
|
7213
7375
|
const ms = Date.now() - gathering;
|
|
@@ -7254,7 +7416,7 @@ var DataLink = class {
|
|
|
7254
7416
|
tracePair(this.options.myPubKeyZ32, pc);
|
|
7255
7417
|
});
|
|
7256
7418
|
dc.addEventListener("close", () => {
|
|
7257
|
-
if (this.pc === pc) this.failed();
|
|
7419
|
+
if (this.pc === pc) this.failed(true);
|
|
7258
7420
|
});
|
|
7259
7421
|
pc.addEventListener("connectionstatechange", () => {
|
|
7260
7422
|
if (this.pc !== pc) return;
|
|
@@ -7263,7 +7425,7 @@ var DataLink = class {
|
|
|
7263
7425
|
if (pc.connectionState === "connected") this.options.onDisconnected?.(false);
|
|
7264
7426
|
}
|
|
7265
7427
|
this.disconnectTimer = null;
|
|
7266
|
-
if (pc.connectionState === "failed" || pc.connectionState === "closed") this.failed();
|
|
7428
|
+
if (pc.connectionState === "failed" || pc.connectionState === "closed") this.failed(true);
|
|
7267
7429
|
else if (pc.connectionState === "disconnected") {
|
|
7268
7430
|
if (this.state === "open") this.options.onDisconnected?.(true);
|
|
7269
7431
|
this.disconnectTimer = setTimeout(() => {
|
|
@@ -9946,6 +10108,7 @@ var DhtDelivery = class DhtDelivery {
|
|
|
9946
10108
|
fastUntil = 0;
|
|
9947
10109
|
live = false;
|
|
9948
10110
|
active = false;
|
|
10111
|
+
startedAt = Date.now();
|
|
9949
10112
|
/** The next read was asked for (a refresh, a fresh packet of the contact): it is not a background one. */
|
|
9950
10113
|
urgent = false;
|
|
9951
10114
|
/** Reads left that are signaling: the contact is leaving DHT only, and the live link waits on them (`expect`). */
|
|
@@ -10017,6 +10180,14 @@ var DhtDelivery = class DhtDelivery {
|
|
|
10017
10180
|
};
|
|
10018
10181
|
}
|
|
10019
10182
|
/**
|
|
10183
|
+
* This side joined, and its inviter never answered (`DhtDeliveryState.unanswered`): no envelope of its newer than the
|
|
10184
|
+
* one that pinned it, none sealed to this side, no text confirmed, never live (as `sealedToAnother` asks too).
|
|
10185
|
+
*/
|
|
10186
|
+
get unanswered() {
|
|
10187
|
+
const pinnedAt = this.state.unanswered;
|
|
10188
|
+
return pinnedAt !== void 0 && this.state.peerSequence <= pinnedAt && !this.state.peerPinned && !this.state.confirmed && !this.state.wasLive && !this.live;
|
|
10189
|
+
}
|
|
10190
|
+
/**
|
|
10020
10191
|
* Something signed by a participation key other than the pinned one came in over the chat's invite-derived keys (this
|
|
10021
10192
|
* mailbox, the link's signals, a connection to an endpoint whose address a copy of the invite could read): ignored,
|
|
10022
10193
|
* and said in the view as a passive warning.
|
|
@@ -10725,6 +10896,7 @@ var DhtDelivery = class DhtDelivery {
|
|
|
10725
10896
|
}
|
|
10726
10897
|
if (message !== null && (!Array.isArray(message) || message.length !== 3 || typeof message[0] !== "string" || !ID$2.test(message[0]) || !Number.isSafeInteger(message[1]) || message[1] <= 0 || message[1] > issued + 3e4 || typeof message[2] !== "string" || utf8Encode(message[2]).length > 256 || expires - issued > 3e5)) return "none";
|
|
10727
10898
|
if (receipt !== null && (typeof receipt !== "string" || !ID$2.test(receipt))) return "none";
|
|
10899
|
+
const unanswered = !this.options.credentials.peerKey && !!this.options.credentials.expectedPeerKey && !sender && !this.live;
|
|
10728
10900
|
await this.options.pin(author);
|
|
10729
10901
|
this.options.credentials.peerKey = author;
|
|
10730
10902
|
this.options.credentials.requireSignedSignals = true;
|
|
@@ -10775,6 +10947,7 @@ var DhtDelivery = class DhtDelivery {
|
|
|
10775
10947
|
receipt: nextReceipt,
|
|
10776
10948
|
confirmed,
|
|
10777
10949
|
...peerPinned && { peerPinned },
|
|
10950
|
+
...unanswered && { unanswered: sequence },
|
|
10778
10951
|
pending: confirmed && this.state.pending?.message[0] === confirmed ? void 0 : this.state.pending,
|
|
10779
10952
|
...newest > (this.state.reactionsTaken ?? 0) && { reactionsTaken: newest }
|
|
10780
10953
|
});
|
|
@@ -10889,11 +11062,23 @@ var DhtDelivery = class DhtDelivery {
|
|
|
10889
11062
|
get pollMs() {
|
|
10890
11063
|
if (this.options.pollMs) return this.options.pollMs;
|
|
10891
11064
|
const now = Date.now();
|
|
11065
|
+
const unused = this.unusedInviteAge(now);
|
|
11066
|
+
if (unused !== void 0 && !this.active && now >= this.fastUntil) return unusedInviteWait(unused, this.mode === "dht" ? DHT_POLL_MS : STREAM_POLL_MS);
|
|
10892
11067
|
if (this.mode === "dht" || this.state.peerMode === "dht" && now < this.leavingUntil || now < this.fastUntil) return DHT_POLL_MS;
|
|
10893
11068
|
if (this.live) return LIVE_POLL_MS;
|
|
10894
11069
|
if (this.state.pending && this.state.pending.expires > now) return DHT_POLL_MS;
|
|
10895
11070
|
return this.active ? ACTIVE_DHT_POLL_MS : STREAM_POLL_MS;
|
|
10896
11071
|
}
|
|
11072
|
+
/**
|
|
11073
|
+
* How long ago this side's invite was made (or joined), while nobody used it (or its inviter never answered,
|
|
11074
|
+
* `unanswered`) and it is no longer awaited (`AWAITING_PEER_MS`).
|
|
11075
|
+
*/
|
|
11076
|
+
unusedInviteAge(now) {
|
|
11077
|
+
const madeAt = this.options.inviteMadeAt;
|
|
11078
|
+
if (madeAt === void 0 || (this.options.credentials.peerKey || this.state.peerSequence) && !this.unanswered) return void 0;
|
|
11079
|
+
const age = now - Math.min(madeAt, this.startedAt);
|
|
11080
|
+
return age >= 6e5 ? age : void 0;
|
|
11081
|
+
}
|
|
10897
11082
|
schedule() {
|
|
10898
11083
|
if (!this.running || this.ticking) return;
|
|
10899
11084
|
if (this.timer) clearTimeout(this.timer);
|
|
@@ -11932,7 +12117,7 @@ async function verifyPeerProof(event, c, readStorage) {
|
|
|
11932
12117
|
if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
|
|
11933
12118
|
} else if (c.adapter === "keet-import") {
|
|
11934
12119
|
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-
|
|
12120
|
+
const { default: IdentityKey } = await import("./keet-identity-key-DypfAhWn.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
11936
12121
|
if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
|
|
11937
12122
|
} else throw new Error("Unsupported proof adapter");
|
|
11938
12123
|
}
|
|
@@ -14431,6 +14616,9 @@ var PairedHttp = class {
|
|
|
14431
14616
|
return channel.bufferedAmount;
|
|
14432
14617
|
},
|
|
14433
14618
|
drained: () => channel.drained(),
|
|
14619
|
+
get sendBudget() {
|
|
14620
|
+
return channel.sendBudget;
|
|
14621
|
+
},
|
|
14434
14622
|
close: () => {},
|
|
14435
14623
|
onMessage: null,
|
|
14436
14624
|
onClose: null
|
|
@@ -14475,6 +14663,11 @@ var SERVICES_CAPABILITY = "services/1";
|
|
|
14475
14663
|
* confirmed byte, checked by digest (`pf-offer` … frames, `chatFiles.ts`). Without it, files/2 and 100 MiB.
|
|
14476
14664
|
*/
|
|
14477
14665
|
var FILES_CAPABILITY = "files/3";
|
|
14666
|
+
/**
|
|
14667
|
+
* A file's bytes as binary messages (WISP 501 § files/4): beside `files/3`, on a session whose channel carries binary
|
|
14668
|
+
* messages, a chunk travels as it is (`encodeFileData`, `chatFiles.ts`) and not as base64url text in a `pf-data` frame.
|
|
14669
|
+
*/
|
|
14670
|
+
var FILES_BINARY_CAPABILITY = "files/4";
|
|
14478
14671
|
/** The typing indicator: `paired-typing` frames on this session, 1:1 chats only (WISP 401 § Typing, `pairedTyping.ts`). */
|
|
14479
14672
|
var TYPING_CAPABILITY = "typing/1";
|
|
14480
14673
|
/** Reactions to messages: `paired-reaction` frames on this session, 1:1 chats only (WISP 401 § Reactions, `reactions.ts`). */
|
|
@@ -14514,6 +14707,7 @@ var KNOWN_SESSION_CAPABILITIES = [
|
|
|
14514
14707
|
CALLS_CAPABILITY,
|
|
14515
14708
|
SERVICES_CAPABILITY,
|
|
14516
14709
|
FILES_CAPABILITY,
|
|
14710
|
+
FILES_BINARY_CAPABILITY,
|
|
14517
14711
|
TYPING_CAPABILITY,
|
|
14518
14712
|
REACTIONS_CAPABILITY,
|
|
14519
14713
|
EDIT_CAPABILITY,
|
|
@@ -15539,6 +15733,11 @@ var FILE_LIMITS = {
|
|
|
15539
15733
|
chunkBytes: 16384,
|
|
15540
15734
|
/** Bytes a sender has sent and not seen confirmed: throughput is this per round trip. */
|
|
15541
15735
|
windowBytes: 1048576,
|
|
15736
|
+
/**
|
|
15737
|
+
* Bytes all of a chat's files have sent and not seen confirmed, together. Three files' windows at once were 3 MiB, and
|
|
15738
|
+
* as base64 text past what a session's receive queue holds (`SESSION_RECEIVE_PENDING`, 3.75 MiB).
|
|
15739
|
+
*/
|
|
15740
|
+
chatWindowBytes: 2097152,
|
|
15542
15741
|
/** A receiver asks its person before taking a file larger than this. */
|
|
15543
15742
|
askAboveBytes: 26214400,
|
|
15544
15743
|
/** Files taken without asking, per contact, while stored. Past it, every file is asked about. */
|
|
@@ -15607,6 +15806,44 @@ function transferStalled(record, movedAt, restored, now) {
|
|
|
15607
15806
|
}
|
|
15608
15807
|
var key = (direction, id) => `${direction}:${id}`;
|
|
15609
15808
|
var isInt$1 = (value, max = Number.MAX_SAFE_INTEGER) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 && value <= max;
|
|
15809
|
+
/**
|
|
15810
|
+
* files/4 (WISP 501 § files/4): a chunk as one binary message of the session, in place of the base64url text of a
|
|
15811
|
+
* `pf-data` frame, which is a third more than the bytes it carries:
|
|
15812
|
+
*
|
|
15813
|
+
* kind 0x04 (1) | id length (1) | id (ASCII) | offset (8, big endian) | data (1 to `FILE_LIMITS.chunkBytes`)
|
|
15814
|
+
*/
|
|
15815
|
+
var FILE_DATA_KIND = 4;
|
|
15816
|
+
var FILE_DATA_OFFSET_BYTES = 8;
|
|
15817
|
+
/** The binary message for the bytes of file `id` at `offset`. Throws on what no receiver would take. */
|
|
15818
|
+
function encodeFileData(id, offset, data) {
|
|
15819
|
+
if (!ID.test(id) || !isInt$1(offset) || !data.length || data.length > FILE_LIMITS.chunkBytes) throw new Error("Invalid file data");
|
|
15820
|
+
const head = 2 + id.length;
|
|
15821
|
+
const out = new Uint8Array(head + FILE_DATA_OFFSET_BYTES + data.length);
|
|
15822
|
+
out[0] = 4;
|
|
15823
|
+
out[1] = id.length;
|
|
15824
|
+
for (let i = 0; i < id.length; i++) out[2 + i] = id.charCodeAt(i);
|
|
15825
|
+
const view = new DataView(out.buffer);
|
|
15826
|
+
view.setUint32(head, Math.floor(offset / 2 ** 32));
|
|
15827
|
+
view.setUint32(head + 4, offset % 2 ** 32);
|
|
15828
|
+
out.set(data, head + FILE_DATA_OFFSET_BYTES);
|
|
15829
|
+
return out;
|
|
15830
|
+
}
|
|
15831
|
+
/** 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`. */
|
|
15832
|
+
function decodeFileData(message) {
|
|
15833
|
+
if (message.length < 2 || message[0] !== 4) return null;
|
|
15834
|
+
const head = 2 + message[1], body = head + FILE_DATA_OFFSET_BYTES;
|
|
15835
|
+
if (message.length <= body || message.length - body > FILE_LIMITS.chunkBytes) return null;
|
|
15836
|
+
const id = String.fromCharCode(...message.subarray(2, head));
|
|
15837
|
+
if (!ID.test(id)) return null;
|
|
15838
|
+
const view = new DataView(message.buffer, message.byteOffset, message.byteLength);
|
|
15839
|
+
const high = view.getUint32(head);
|
|
15840
|
+
if (high > 2097151) return null;
|
|
15841
|
+
return {
|
|
15842
|
+
id,
|
|
15843
|
+
offset: high * 2 ** 32 + view.getUint32(head + 4),
|
|
15844
|
+
data: message.subarray(body)
|
|
15845
|
+
};
|
|
15846
|
+
}
|
|
15610
15847
|
/** What a refusal means to the sender's person. */
|
|
15611
15848
|
function refusalText(why, room) {
|
|
15612
15849
|
switch (why) {
|
|
@@ -15643,6 +15880,10 @@ function refusalText(why, room) {
|
|
|
15643
15880
|
var ChatFiles = class {
|
|
15644
15881
|
host;
|
|
15645
15882
|
entries = /* @__PURE__ */ new Map();
|
|
15883
|
+
/** Files sending that may have bytes not confirmed yet: what `inFlight` adds up (the rest are left out as it goes). */
|
|
15884
|
+
moving = /* @__PURE__ */ new Set();
|
|
15885
|
+
/** Files that stopped sending for the chat's window alone: they go on once another's bytes are confirmed. */
|
|
15886
|
+
held = /* @__PURE__ */ new Set();
|
|
15646
15887
|
attached = false;
|
|
15647
15888
|
peerRoomValue = null;
|
|
15648
15889
|
constructor(host) {
|
|
@@ -15702,6 +15943,15 @@ var ChatFiles = class {
|
|
|
15702
15943
|
send(frame) {
|
|
15703
15944
|
return this.attached && this.host.send(frame);
|
|
15704
15945
|
}
|
|
15946
|
+
sendData(id, offset, data) {
|
|
15947
|
+
if (!this.host.sendData) return this.send({
|
|
15948
|
+
t: "pf-data",
|
|
15949
|
+
id,
|
|
15950
|
+
offset,
|
|
15951
|
+
data: toBase64Url(data)
|
|
15952
|
+
});
|
|
15953
|
+
return this.attached && this.host.sendData(id, offset, data);
|
|
15954
|
+
}
|
|
15705
15955
|
/** A session that agreed files/3 is open: say what fits here, then offer again what is not finished. */
|
|
15706
15956
|
attach() {
|
|
15707
15957
|
this.attached = true;
|
|
@@ -15720,6 +15970,8 @@ var ChatFiles = class {
|
|
|
15720
15970
|
if (!this.attached) return;
|
|
15721
15971
|
this.attached = false;
|
|
15722
15972
|
this.peerRoomValue = null;
|
|
15973
|
+
this.moving.clear();
|
|
15974
|
+
this.held.clear();
|
|
15723
15975
|
for (const entry of this.entries.values()) {
|
|
15724
15976
|
if (entry.out) {
|
|
15725
15977
|
entry.out.generation++;
|
|
@@ -15843,10 +16095,34 @@ var ChatFiles = class {
|
|
|
15843
16095
|
const at = offset - out.block.start;
|
|
15844
16096
|
return out.block.bytes.subarray(at, at + length);
|
|
15845
16097
|
}
|
|
15846
|
-
|
|
16098
|
+
/** Whether this file's own window lets it send more. */
|
|
16099
|
+
fileMayPump(entry) {
|
|
15847
16100
|
const { record } = entry, out = entry.out;
|
|
15848
16101
|
return this.attached && record.state === "active" && out.next < record.file.size && out.next - record.confirmed < FILE_LIMITS.windowBytes;
|
|
15849
16102
|
}
|
|
16103
|
+
shouldPump(entry) {
|
|
16104
|
+
return this.fileMayPump(entry) && this.inFlight() < FILE_LIMITS.chatWindowBytes;
|
|
16105
|
+
}
|
|
16106
|
+
/** Bytes this chat's files sent and have not seen confirmed. */
|
|
16107
|
+
inFlight() {
|
|
16108
|
+
let bytes = 0;
|
|
16109
|
+
for (const entry of this.moving) {
|
|
16110
|
+
const out = entry.out, { record } = entry;
|
|
16111
|
+
if (!out || record.state !== "active" || out.next <= record.confirmed) {
|
|
16112
|
+
this.moving.delete(entry);
|
|
16113
|
+
continue;
|
|
16114
|
+
}
|
|
16115
|
+
bytes += out.next - record.confirmed;
|
|
16116
|
+
}
|
|
16117
|
+
return bytes;
|
|
16118
|
+
}
|
|
16119
|
+
/** Bytes were confirmed, or a file stopped sending: the files the chat's window held go on, before the one that freed it. */
|
|
16120
|
+
wakeHeld() {
|
|
16121
|
+
for (const entry of [...this.held]) {
|
|
16122
|
+
this.held.delete(entry);
|
|
16123
|
+
this.pump(entry);
|
|
16124
|
+
}
|
|
16125
|
+
}
|
|
15850
16126
|
/**
|
|
15851
16127
|
* Whether the next `length` bytes go. Within the file's size they always do; past it the receiver is having parts
|
|
15852
16128
|
* sent again, which nothing it says bounds, so this side does.
|
|
@@ -15877,17 +16153,13 @@ var ChatFiles = class {
|
|
|
15877
16153
|
this.end(entry, "failed", "Your contact asked for the same part of this file too many times");
|
|
15878
16154
|
break;
|
|
15879
16155
|
}
|
|
15880
|
-
if (!this.
|
|
15881
|
-
t: "pf-data",
|
|
15882
|
-
id: entry.record.id,
|
|
15883
|
-
offset,
|
|
15884
|
-
data: toBase64Url(chunk)
|
|
15885
|
-
})) {
|
|
16156
|
+
if (!this.sendData(entry.record.id, offset, chunk)) {
|
|
15886
16157
|
refused = true;
|
|
15887
16158
|
break;
|
|
15888
16159
|
}
|
|
15889
16160
|
out.next = offset + chunk.length;
|
|
15890
16161
|
out.sent += chunk.length;
|
|
16162
|
+
this.moving.add(entry);
|
|
15891
16163
|
}
|
|
15892
16164
|
} catch (error) {
|
|
15893
16165
|
if (generation === out.generation) {
|
|
@@ -15902,7 +16174,7 @@ var ChatFiles = class {
|
|
|
15902
16174
|
if (generation === out.generation && this.shouldPump(entry)) {
|
|
15903
16175
|
if (refused) out.wake = setTimeout(() => void this.pump(entry), FILE_LIMITS.sendRetryMs);
|
|
15904
16176
|
else this.pump(entry);
|
|
15905
|
-
}
|
|
16177
|
+
} else if (generation === out.generation && this.fileMayPump(entry)) this.held.add(entry);
|
|
15906
16178
|
}
|
|
15907
16179
|
}
|
|
15908
16180
|
async sendSum(entry) {
|
|
@@ -15934,7 +16206,7 @@ var ChatFiles = class {
|
|
|
15934
16206
|
return [...this.entries.values()].filter((e) => e.record.direction === "in" && e.record.state === "asking").length;
|
|
15935
16207
|
}
|
|
15936
16208
|
activeIncoming(except) {
|
|
15937
|
-
return [...this.entries.values()].filter((e) => e !== except && e.record.direction === "in" && (e.record.state === "active" || e.record.state === "verifying")).length;
|
|
16209
|
+
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
16210
|
}
|
|
15939
16211
|
/**
|
|
15940
16212
|
* Removes what this side stored of an incoming file that ends here. Through its target, opened now if need be: after
|
|
@@ -15961,9 +16233,15 @@ var ChatFiles = class {
|
|
|
15961
16233
|
}
|
|
15962
16234
|
return incoming.target;
|
|
15963
16235
|
}
|
|
15964
|
-
/**
|
|
16236
|
+
/**
|
|
16237
|
+
* An accepted file goes when a session is open and fewer than three others arrive at once. One whose target is still
|
|
16238
|
+
* being opened counts among the three: counted only once active, every file offered or queued meanwhile went too, and
|
|
16239
|
+
* the windows of ten files and more at once overflowed the session's receive queue.
|
|
16240
|
+
*/
|
|
15965
16241
|
startIncoming(entry) {
|
|
15966
16242
|
if (!this.attached || transferEnded(entry.record) || entry.record.state === "asking" || entry.record.state === "paused" && entry.record.pausedBy === "me") return;
|
|
16243
|
+
const incoming = entry.in;
|
|
16244
|
+
if (incoming.starting) return;
|
|
15967
16245
|
if (this.activeIncoming(entry) >= FILE_LIMITS.maxActiveIncoming) {
|
|
15968
16246
|
if (entry.record.state !== "queued") {
|
|
15969
16247
|
entry.record.state = "queued";
|
|
@@ -15976,9 +16254,13 @@ var ChatFiles = class {
|
|
|
15976
16254
|
});
|
|
15977
16255
|
return;
|
|
15978
16256
|
}
|
|
16257
|
+
incoming.starting = true;
|
|
15979
16258
|
this.target(entry).then(() => {
|
|
15980
|
-
|
|
15981
|
-
if (entry.record.state === "paused" && entry.record.pausedBy === "me")
|
|
16259
|
+
incoming.starting = false;
|
|
16260
|
+
if (transferEnded(entry.record) || !this.attached || entry.record.state === "paused" && entry.record.pausedBy === "me") {
|
|
16261
|
+
this.startNext();
|
|
16262
|
+
return;
|
|
16263
|
+
}
|
|
15982
16264
|
entry.record.state = "active";
|
|
15983
16265
|
entry.record.pausedBy = void 0;
|
|
15984
16266
|
entry.in.gapAt = void 0;
|
|
@@ -15991,12 +16273,14 @@ var ChatFiles = class {
|
|
|
15991
16273
|
entry.in.heardAt = this.now();
|
|
15992
16274
|
this.armNudge(entry);
|
|
15993
16275
|
}, (error) => {
|
|
16276
|
+
incoming.starting = false;
|
|
15994
16277
|
this.end(entry, "failed", `Could not store the file: ${error instanceof Error ? error.message : String(error)}`);
|
|
15995
16278
|
this.send({
|
|
15996
16279
|
t: "pf-refuse",
|
|
15997
16280
|
id: entry.record.id,
|
|
15998
16281
|
why: "no-room"
|
|
15999
16282
|
});
|
|
16283
|
+
this.startNext();
|
|
16000
16284
|
});
|
|
16001
16285
|
}
|
|
16002
16286
|
/** The next file waiting its turn, once one ends. */
|
|
@@ -16235,7 +16519,9 @@ var ChatFiles = class {
|
|
|
16235
16519
|
if (record.state !== "active" || !incoming.target) return;
|
|
16236
16520
|
incoming.heardAt = this.now();
|
|
16237
16521
|
const { offset, data } = frame;
|
|
16238
|
-
|
|
16522
|
+
const binary = data instanceof Uint8Array;
|
|
16523
|
+
if (!isInt$1(offset) || !(binary || typeof data === "string") || !data.length) return;
|
|
16524
|
+
if (!binary && (data.length > Math.ceil(FILE_LIMITS.chunkBytes * 4 / 3) || !DATA.test(data))) return;
|
|
16239
16525
|
if (offset < incoming.written) {
|
|
16240
16526
|
if (incoming.stored === incoming.written) this.send({
|
|
16241
16527
|
t: "pf-got",
|
|
@@ -16255,7 +16541,7 @@ var ChatFiles = class {
|
|
|
16255
16541
|
}
|
|
16256
16542
|
return;
|
|
16257
16543
|
}
|
|
16258
|
-
const bytes = fromBase64Url(data);
|
|
16544
|
+
const bytes = binary ? data : fromBase64Url(data);
|
|
16259
16545
|
if (!bytes.length || bytes.length > FILE_LIMITS.chunkBytes || offset + bytes.length > record.file.size) return;
|
|
16260
16546
|
incoming.written += bytes.length;
|
|
16261
16547
|
const target = incoming.target;
|
|
@@ -16440,6 +16726,7 @@ var ChatFiles = class {
|
|
|
16440
16726
|
record.state = "active";
|
|
16441
16727
|
record.pausedBy = record.waitingFor = void 0;
|
|
16442
16728
|
this.changed(outgoing);
|
|
16729
|
+
this.wakeHeld();
|
|
16443
16730
|
if (record.confirmed === record.file.size) this.sendSum(outgoing);
|
|
16444
16731
|
else {
|
|
16445
16732
|
this.armStall(outgoing);
|
|
@@ -16459,11 +16746,13 @@ var ChatFiles = class {
|
|
|
16459
16746
|
record.waitingFor = frame.why === "busy" ? "busy" : "consent";
|
|
16460
16747
|
}
|
|
16461
16748
|
this.changed(outgoing);
|
|
16749
|
+
this.wakeHeld();
|
|
16462
16750
|
return;
|
|
16463
16751
|
case "pf-got":
|
|
16464
16752
|
if (!isInt$1(frame.offset) || frame.offset <= record.confirmed || frame.offset > out.next) return;
|
|
16465
16753
|
record.confirmed = frame.offset;
|
|
16466
16754
|
this.changed(outgoing, true);
|
|
16755
|
+
this.wakeHeld();
|
|
16467
16756
|
if (record.confirmed === record.file.size) this.sendSum(outgoing);
|
|
16468
16757
|
else {
|
|
16469
16758
|
this.armStall(outgoing);
|
|
@@ -16493,6 +16782,8 @@ var ChatFiles = class {
|
|
|
16493
16782
|
clearTimeout(entry.out.wake);
|
|
16494
16783
|
entry.out.block = void 0;
|
|
16495
16784
|
entry.out.source = void 0;
|
|
16785
|
+
this.moving.delete(entry);
|
|
16786
|
+
this.held.delete(entry);
|
|
16496
16787
|
}
|
|
16497
16788
|
if (entry.in) {
|
|
16498
16789
|
const incoming = entry.in;
|
|
@@ -16502,6 +16793,7 @@ var ChatFiles = class {
|
|
|
16502
16793
|
});
|
|
16503
16794
|
}
|
|
16504
16795
|
this.changed(entry);
|
|
16796
|
+
if (entry.out) this.wakeHeld();
|
|
16505
16797
|
}
|
|
16506
16798
|
entry(direction, id) {
|
|
16507
16799
|
const entry = this.entries.get(key(direction, id));
|
|
@@ -16550,6 +16842,7 @@ var ChatFiles = class {
|
|
|
16550
16842
|
this.startNext();
|
|
16551
16843
|
}
|
|
16552
16844
|
this.changed(entry);
|
|
16845
|
+
if (entry.out) this.wakeHeld();
|
|
16553
16846
|
}
|
|
16554
16847
|
resume(direction, id) {
|
|
16555
16848
|
const entry = this.entry(direction, id), { record } = entry;
|
|
@@ -17198,6 +17491,8 @@ var CarriedTransport = class {
|
|
|
17198
17491
|
/** My last packet while the edge is down: what a member that just became reachable is handed. */
|
|
17199
17492
|
mine = null;
|
|
17200
17493
|
lastTimestamp = 0n;
|
|
17494
|
+
/** The date each packet `stamp` signed carries: the relays' transport takes it rather than check the signature again. */
|
|
17495
|
+
dated = /* @__PURE__ */ new WeakMap();
|
|
17201
17496
|
/** My newest packet, wherever it went: what the edge hands the member over itself once it is ready (`linkReady`). */
|
|
17202
17497
|
newest = null;
|
|
17203
17498
|
/** The newest packet of the member's that came through a carrier, and the timestamp of the one a read last returned. */
|
|
@@ -17277,7 +17572,9 @@ var CarriedTransport = class {
|
|
|
17277
17572
|
stamp(identity, records) {
|
|
17278
17573
|
const now = BigInt(Date.now()) * 1000n;
|
|
17279
17574
|
this.lastTimestamp = now > this.lastTimestamp ? now : this.lastTimestamp + 1n;
|
|
17280
|
-
|
|
17575
|
+
const payload = createRelayPayload(identity, records, this.lastTimestamp);
|
|
17576
|
+
this.dated.set(payload, this.lastTimestamp);
|
|
17577
|
+
return payload;
|
|
17281
17578
|
}
|
|
17282
17579
|
/**
|
|
17283
17580
|
* The relays get the very packet members carried or the edge itself handed over, byte for byte, where the transport
|
|
@@ -17287,7 +17584,11 @@ var CarriedTransport = class {
|
|
|
17287
17584
|
* 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
17585
|
*/
|
|
17289
17586
|
toRelays(identity, records, payload, options) {
|
|
17290
|
-
|
|
17587
|
+
const signedAt = this.dated.get(payload);
|
|
17588
|
+
return this.inner.publishPayload ? this.inner.publishPayload(identity.pubKeyZ32, payload, signedAt === void 0 ? options : {
|
|
17589
|
+
...options,
|
|
17590
|
+
signedAt
|
|
17591
|
+
}) : this.inner.publish(identity, records, options);
|
|
17291
17592
|
}
|
|
17292
17593
|
/**
|
|
17293
17594
|
* 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 +17733,12 @@ var GROUP_FILE_LIMITS = {
|
|
|
17432
17733
|
heardAhead: 256,
|
|
17433
17734
|
/** Message ids in one `group-have`. */
|
|
17434
17735
|
haveIds: 32,
|
|
17435
|
-
/**
|
|
17436
|
-
|
|
17736
|
+
/**
|
|
17737
|
+
* `group-have` frames a private group's edge takes in `haveWindowMs`: what is to say is gathered for a second, then
|
|
17738
|
+
* goes. A community's, from a member, goes every `communityHaveEveryMs`.
|
|
17739
|
+
*/
|
|
17740
|
+
haveFrames: 10,
|
|
17741
|
+
haveWindowMs: 1e4,
|
|
17437
17742
|
communityHaveEveryMs: 6e4,
|
|
17438
17743
|
/**
|
|
17439
17744
|
* 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 +18171,14 @@ var CROSSED_WAIT_MS = 500;
|
|
|
17866
18171
|
* takes over.
|
|
17867
18172
|
*/
|
|
17868
18173
|
var CROSSED_FRESH_MS = 1e4;
|
|
18174
|
+
/**
|
|
18175
|
+
* A dial of the contact's that meets such a session waits this long for that session to answer a ping. It answers when
|
|
18176
|
+
* the dials crossed (the contact holds this side's dial too); it does not when the contact's app ended since and is
|
|
18177
|
+
* back: its dial then takes over. Refused outright, that dial left the contact waiting for the dead session's end, 16.6
|
|
18178
|
+
* 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
|
|
18179
|
+
* 7 ms on loopback and under 0.5 s over a relayed Iroh.
|
|
18180
|
+
*/
|
|
18181
|
+
var CROSSED_PROBE_MS = 1500;
|
|
17869
18182
|
/** A WebRTC attempt under way, not yet open: what a member's packet saying it has no WebRTC ends (`peerPacketTransports`). */
|
|
17870
18183
|
var WEBRTC_ATTEMPT = /* @__PURE__ */ new Set([
|
|
17871
18184
|
"offering",
|
|
@@ -18007,6 +18320,24 @@ var HANDLED_WAIT_MS = 1e4;
|
|
|
18007
18320
|
* away (a phone that put it to sleep): the chat resumes as after a restart, not as a session the contact closed.
|
|
18008
18321
|
*/
|
|
18009
18322
|
var WAKE_LOST_MS = 1e4;
|
|
18323
|
+
/**
|
|
18324
|
+
* What files/3 may hold on a session's channel (WISP 501, Backpressure): a quarter of its send budget (native and iroh
|
|
18325
|
+
* channels throw past 120 KiB), or the high water mark of a WebRTC channel, which has none.
|
|
18326
|
+
*/
|
|
18327
|
+
function filesCap(channel) {
|
|
18328
|
+
return channel.sendBudget ? channel.sendBudget / 4 : LIMITS.sendHighWaterMark;
|
|
18329
|
+
}
|
|
18330
|
+
/**
|
|
18331
|
+
* 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
|
|
18332
|
+
* their line (WISP 1200 § In a chat): a file waiting for `pf-got` holds its share meanwhile.
|
|
18333
|
+
*/
|
|
18334
|
+
var FILES_IN_USE_MS = 2e3;
|
|
18335
|
+
/**
|
|
18336
|
+
* How far an app's data may get ahead of a file's bytes while the file waits for room on the channel (WISP 1200 § In a
|
|
18337
|
+
* chat): a frame goes only while the app has sent less than this more than the file since. A small frame (a Chess move)
|
|
18338
|
+
* still goes at once; one streaming at its limit gets about half the link, and the file the other half.
|
|
18339
|
+
*/
|
|
18340
|
+
var APP_AHEAD_OF_FILES = 16384;
|
|
18010
18341
|
/** Largest `paired-message` frame sent with a preview: a session fails on a frame over 60 KiB (`PairedSession`). */
|
|
18011
18342
|
var MAX_PAIRED_MESSAGE_FRAME = 57344;
|
|
18012
18343
|
/**
|
|
@@ -18039,6 +18370,16 @@ function pairedMessageFrame(id, ts, m, preview, reply, forwarded, card) {
|
|
|
18039
18370
|
});
|
|
18040
18371
|
return withPreview.length <= 57344 ? withPreview : plain;
|
|
18041
18372
|
}
|
|
18373
|
+
/** A text whose `paired-message` frame would pass what a session takes: it never arrives, and is refused at send. */
|
|
18374
|
+
var PAIRED_FRAME_TOO_LARGE = "Message too long once encoded. Shorten it or send it as a file.";
|
|
18375
|
+
/**
|
|
18376
|
+
* The `paired-message` frame of this text fits a session (`SESSION_FRAME_MAX`, UTF-16 units of the JSON). Within 16 KiB
|
|
18377
|
+
* of UTF-8 a text can still pass it: JSON writes each control character as six (`\u0001`). The preview is left out,
|
|
18378
|
+
* as the frame drops one that does not fit.
|
|
18379
|
+
*/
|
|
18380
|
+
function pairedMessageFits(ts, m, reply, forwarded, card) {
|
|
18381
|
+
return pairedMessageFrame("A".repeat(22), ts, m, void 0, reply, forwarded, card).length <= SESSION_FRAME_MAX;
|
|
18382
|
+
}
|
|
18042
18383
|
/**
|
|
18043
18384
|
* A native descriptor from the contact's capability record against the one known (a session's, or an older record's).
|
|
18044
18385
|
* The record carries only how to dial, never an address: the Iroh endpoint id and the relay it is homed on, the
|
|
@@ -18357,6 +18698,9 @@ var GhostLink = class {
|
|
|
18357
18698
|
});
|
|
18358
18699
|
options.events?.onPairingProgress?.(progress);
|
|
18359
18700
|
}) : null;
|
|
18701
|
+
const invite = !!options.pairingProgress && !!options.pairing && !options.pairing.credentials.peerKey;
|
|
18702
|
+
let unanswered = options.dht?.state?.unanswered !== void 0;
|
|
18703
|
+
const backsOff = invite || unanswered;
|
|
18360
18704
|
this.dht = options.params.profile && options.pairing && options.dht ? new DhtDelivery({
|
|
18361
18705
|
params: options.params,
|
|
18362
18706
|
mode: this.deliveryMode,
|
|
@@ -18366,6 +18710,7 @@ var GhostLink = class {
|
|
|
18366
18710
|
save: options.dht.save,
|
|
18367
18711
|
pollMs: options.dht.pollMs,
|
|
18368
18712
|
firstControlAfterMs: options.dht.firstControlAfterMs,
|
|
18713
|
+
...backsOff && { inviteMadeAt: options.madeAt ?? Date.now() },
|
|
18369
18714
|
capsRev: options.dht.capsRev,
|
|
18370
18715
|
peerCapsRev: options.dht.peerCapsRev,
|
|
18371
18716
|
peerAcceptsText: options.dht.peerAcceptsText,
|
|
@@ -18381,6 +18726,7 @@ var GhostLink = class {
|
|
|
18381
18726
|
},
|
|
18382
18727
|
pin: async (key) => {
|
|
18383
18728
|
await options.pairing.pinPeer(key, true);
|
|
18729
|
+
if (invite) this.session.lookNow();
|
|
18384
18730
|
if (this.isDataLinkOpen || !this.tracker || this.tracker.done) return;
|
|
18385
18731
|
if (this.deliveryMode === "dht") {
|
|
18386
18732
|
this.tracker.onDht("chosen");
|
|
@@ -18423,6 +18769,9 @@ var GhostLink = class {
|
|
|
18423
18769
|
},
|
|
18424
18770
|
changed: (view) => {
|
|
18425
18771
|
options.events?.onDhtDelivery?.(view);
|
|
18772
|
+
const stillUnanswered = this.dht.unanswered;
|
|
18773
|
+
if (unanswered && !stillUnanswered) this.session.lookNow();
|
|
18774
|
+
unanswered = stillUnanswered;
|
|
18426
18775
|
if (view.inviteTaken) this.tracker?.failed("taken", false, INVITE_TAKEN);
|
|
18427
18776
|
else this.tracker?.untaken();
|
|
18428
18777
|
this.streamBlockChanged();
|
|
@@ -18451,6 +18800,7 @@ var GhostLink = class {
|
|
|
18451
18800
|
lastSeenTimestamp: options.lastSeenTimestamp,
|
|
18452
18801
|
pollIntervals: options.pollIntervals,
|
|
18453
18802
|
awaitingSince: options.madeAt,
|
|
18803
|
+
...backsOff && { invite: () => !options.pairing.credentials.peerKey || !!this.dht?.unanswered },
|
|
18454
18804
|
getServices: options.getServices,
|
|
18455
18805
|
firstPublish: options.firstPublish ?? (this.tracker && options.pairingProgress?.role === "joiner" && options.rtcAvailable !== false || this.resuming ? "after-first-poll" : "at-start"),
|
|
18456
18806
|
events: {
|
|
@@ -18963,11 +19313,11 @@ var GhostLink = class {
|
|
|
18963
19313
|
}
|
|
18964
19314
|
start() {
|
|
18965
19315
|
if (this.saidTransports) this.publishPacketTransports();
|
|
18966
|
-
if (this.deliveryMode !== "dht") this.session.start();
|
|
18967
19316
|
if (this.resuming && this.deliveryMode !== "dht") {
|
|
18968
19317
|
this.session.expectPeer();
|
|
18969
19318
|
this.resumeWaitUntil = Date.now() + RESUME_WAIT_MS;
|
|
18970
19319
|
}
|
|
19320
|
+
if (this.deliveryMode !== "dht") this.session.start();
|
|
18971
19321
|
if (this.tracker && !this.tracker.done && this.options.pairingProgress?.role === "joiner") {
|
|
18972
19322
|
this.dht?.expect();
|
|
18973
19323
|
this.dialEarly();
|
|
@@ -19089,6 +19439,7 @@ var GhostLink = class {
|
|
|
19089
19439
|
disconnect() {
|
|
19090
19440
|
this.closeRetired();
|
|
19091
19441
|
this.dropCrossed();
|
|
19442
|
+
this.dropCrossedProbe();
|
|
19092
19443
|
this.dropBlockedDial();
|
|
19093
19444
|
this.switcher.stop();
|
|
19094
19445
|
this.cancelCandidate();
|
|
@@ -19984,9 +20335,30 @@ var GhostLink = class {
|
|
|
19984
20335
|
epoch,
|
|
19985
20336
|
rest
|
|
19986
20337
|
};
|
|
20338
|
+
if (!this.peerTransports.includes("webrtc/1")) {
|
|
20339
|
+
traceLink(this.myPubKeyZ32, "offer-unanswerable", { transports: rest });
|
|
20340
|
+
this.clearRace();
|
|
20341
|
+
this.raceTimer = setTimeout(() => {
|
|
20342
|
+
this.raceTimer = null;
|
|
20343
|
+
this.endUnanswerableOffer(epoch);
|
|
20344
|
+
}, 0);
|
|
20345
|
+
return;
|
|
20346
|
+
}
|
|
19987
20347
|
traceLink(this.myPubKeyZ32, "race-standing", { transports: rest });
|
|
19988
20348
|
this.scheduleRace(epoch, made.at);
|
|
19989
20349
|
}
|
|
20350
|
+
/** The offer ends (`raceStandingOffer`), and with it going idle what is ranked after WebRTC is dialled (`dialAfterRtc`). */
|
|
20351
|
+
endUnanswerableOffer(epoch) {
|
|
20352
|
+
if (epoch !== this.connectionEpoch || this.channel || this.stopped || !this.offerOut || this.afterRtc?.epoch !== epoch) return;
|
|
20353
|
+
if (this.dialing) {
|
|
20354
|
+
this.raceTimer = setTimeout(() => {
|
|
20355
|
+
this.raceTimer = null;
|
|
20356
|
+
this.endUnanswerableOffer(epoch);
|
|
20357
|
+
}, RACE_RETRY_MS);
|
|
20358
|
+
return;
|
|
20359
|
+
}
|
|
20360
|
+
this.dataLink.close();
|
|
20361
|
+
}
|
|
19990
20362
|
/**
|
|
19991
20363
|
* Back after an absence, this side answers an offer the contact made while it was away (it dials whatever its key):
|
|
19992
20364
|
* the contact looks for that answer at the pace of an offer out a while (every 8 s on the relays), and its attempt may
|
|
@@ -20095,6 +20467,18 @@ var GhostLink = class {
|
|
|
20095
20467
|
if (!this.options.params.profile || this.options.packetTransports) return true;
|
|
20096
20468
|
return this.transportOffer().some((t) => t === "webrtc/1" ? !this.peerTransports || this.peerTransports.includes(t) : this.canDial(t) && !!this.peerTransports?.includes(t));
|
|
20097
20469
|
}
|
|
20470
|
+
/**
|
|
20471
|
+
* Neither side can dial the other until something changes, past a first pairing: what the contact runs is known, and
|
|
20472
|
+
* no transport both run has WebRTC on both sides or an endpoint up on both (this side's, and the one its record
|
|
20473
|
+
* describes). A chat that gave its listener up to another (`yieldEndpoint`), or whose contact did, is so. It dials
|
|
20474
|
+
* again when that changes (a listener taken back, `registerEndpoint`; the record describing one, `learnPeerTransports`),
|
|
20475
|
+
* and reads at its own pace meanwhile: looks every 20 s for a dial with nothing to try, and the contact's fast looks
|
|
20476
|
+
* for an offer that could not come, read its key 2.5x to 4x as often as the background pace, for good (bug hunt,
|
|
20477
|
+
* 2026-10-12). A first pairing keeps both: the records are what it is reading for.
|
|
20478
|
+
*/
|
|
20479
|
+
nothingToDialEitherWay() {
|
|
20480
|
+
return !(!!this.tracker && !this.tracker.done && this.tracker.progress.stage !== "on-dht") && !!this.peerTransports && !this.anythingToDial();
|
|
20481
|
+
}
|
|
20098
20482
|
clearRace() {
|
|
20099
20483
|
if (this.raceTimer) clearTimeout(this.raceTimer);
|
|
20100
20484
|
this.raceTimer = null;
|
|
@@ -20157,6 +20541,13 @@ var GhostLink = class {
|
|
|
20157
20541
|
this.attemptEnded();
|
|
20158
20542
|
this.rejectWaiters(new GhostlyHttpError("unreachable", "Could not connect to the peer"));
|
|
20159
20543
|
}
|
|
20544
|
+
/**
|
|
20545
|
+
* This side does not dial on its own: the contact's app does (the lower key), and none of what makes this side dial
|
|
20546
|
+
* anyway holds (a first pairing's role, a restart, WebRTC set aside). Its own dial, chosen by hand, is not retried.
|
|
20547
|
+
*/
|
|
20548
|
+
awaitsContactDial() {
|
|
20549
|
+
return !(!!this.tracker && !this.tracker.done && this.tracker.progress.stage !== "on-dht" ? this.options.pairingProgress?.role : void 0) && this.myPubKeyZ32 > this.options.params.peerPubKeyZ32 && !this.resuming && !this.dialsPastRtc();
|
|
20550
|
+
}
|
|
20160
20551
|
/** A transport of the attempt under way did not connect. */
|
|
20161
20552
|
attemptFailed(transport, error) {
|
|
20162
20553
|
if (this.isDataLinkOpen) return;
|
|
@@ -20179,7 +20570,7 @@ var GhostLink = class {
|
|
|
20179
20570
|
side: attempt.side,
|
|
20180
20571
|
failed: attempt.failed,
|
|
20181
20572
|
...!attempt.failed.length && reason ? { reason } : {},
|
|
20182
|
-
...attempt.side === "dialled" ? { retryAt: Math.max(Date.now(), this.lastAutoConnectAt + this.dialWait()) } : {}
|
|
20573
|
+
...attempt.side === "dialled" && !this.awaitsContactDial() ? { retryAt: Math.max(Date.now(), this.lastAutoConnectAt + this.dialWait()) } : {}
|
|
20183
20574
|
};
|
|
20184
20575
|
traceLink(this.myPubKeyZ32, "attempt-ended", {
|
|
20185
20576
|
side: attempt.side,
|
|
@@ -20218,9 +20609,11 @@ var GhostLink = class {
|
|
|
20218
20609
|
if (this.pairedPending.size >= 128) this.pairedPending.delete(this.pairedPending.keys().next().value);
|
|
20219
20610
|
const id = stableId ?? toBase64Url(randomBytes(16));
|
|
20220
20611
|
if (!/^[A-Za-z0-9_-]{22}$/.test(id)) return "Invalid message ID";
|
|
20612
|
+
const frame = pairedMessageFrame(id, timestamp, trimmed, preview, reply, forwarded, card);
|
|
20613
|
+
if (frame.length > 61440) return PAIRED_FRAME_TOO_LARGE;
|
|
20221
20614
|
this.pairedPending.set(id, timestamp);
|
|
20222
20615
|
try {
|
|
20223
|
-
this.channel.send(
|
|
20616
|
+
this.channel.send(frame);
|
|
20224
20617
|
return null;
|
|
20225
20618
|
} catch {
|
|
20226
20619
|
this.pairedPending.delete(id);
|
|
@@ -20386,15 +20779,14 @@ var GhostLink = class {
|
|
|
20386
20779
|
if (presence.lastPacketAt === this.departed.packet && Date.now() < this.departed.until) return;
|
|
20387
20780
|
this.departed = null;
|
|
20388
20781
|
}
|
|
20389
|
-
|
|
20390
|
-
if (role === "inviter") {
|
|
20782
|
+
if ((!!this.tracker && !this.tracker.done && this.tracker.progress.stage !== "on-dht" ? this.options.pairingProgress?.role : void 0) === "inviter") {
|
|
20391
20783
|
this.peerSeenAt ||= Date.now();
|
|
20392
20784
|
if (Date.now() - this.peerSeenAt < 2500 && !this.nothingToAwait()) {
|
|
20393
20785
|
this.session.expectPeer();
|
|
20394
20786
|
return;
|
|
20395
20787
|
}
|
|
20396
|
-
} else if (
|
|
20397
|
-
if (Date.now() - presenceSeenAt(presence) < 3e4 && presence.lastPacketAt !== this.offerAwaitedFor) {
|
|
20788
|
+
} else if (this.awaitsContactDial()) {
|
|
20789
|
+
if (Date.now() - presenceSeenAt(presence) < 3e4 && presence.lastPacketAt !== this.offerAwaitedFor && !this.nothingToDialEitherWay()) {
|
|
20398
20790
|
this.offerAwaitedFor = presence.lastPacketAt;
|
|
20399
20791
|
this.session.expectPeer();
|
|
20400
20792
|
}
|
|
@@ -20472,6 +20864,7 @@ var GhostLink = class {
|
|
|
20472
20864
|
this.retryLook = null;
|
|
20473
20865
|
const from = this.lastAutoConnectAt;
|
|
20474
20866
|
if (!from || this.stopped || this.leaving || this.streamBlocked || this.keyStopped || !this.options.autoConnect) return;
|
|
20867
|
+
if (this.nothingToDialEitherWay()) return;
|
|
20475
20868
|
this.retryLook = setTimeout(() => {
|
|
20476
20869
|
this.retryLook = null;
|
|
20477
20870
|
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 +21124,7 @@ var GhostLink = class {
|
|
|
20731
21124
|
if (this.options.callsSupport) offered.push(CALLS_CAPABILITY);
|
|
20732
21125
|
if (this.options.servicesSupport) offered.push(SERVICES_CAPABILITY);
|
|
20733
21126
|
if (this.options.largeFilesSupport) offered.push(FILES_CAPABILITY);
|
|
21127
|
+
if (this.options.largeFilesSupport && this.options.binaryFilesSupport && this.channel?.binary) offered.push(FILES_BINARY_CAPABILITY);
|
|
20734
21128
|
if (this.options.typingSupport) offered.push(TYPING_CAPABILITY);
|
|
20735
21129
|
if (this.options.reactionsSupport) offered.push(REACTIONS_CAPABILITY);
|
|
20736
21130
|
if (this.options.editSupport) offered.push(EDIT_CAPABILITY);
|
|
@@ -20767,6 +21161,10 @@ var GhostLink = class {
|
|
|
20767
21161
|
get supportsLargeFiles() {
|
|
20768
21162
|
return this.isDataLinkOpen && this.sessionCapabilities.agreed("files/3");
|
|
20769
21163
|
}
|
|
21164
|
+
/** Both sides offer `files/4` beside `files/3` on the open session: a file's bytes go as binary messages. */
|
|
21165
|
+
get supportsBinaryFiles() {
|
|
21166
|
+
return this.supportsLargeFiles && this.sessionCapabilities.agreed("files/4");
|
|
21167
|
+
}
|
|
20770
21168
|
/** Both sides offer `typing/1` on the open session: typing can be said and shown. */
|
|
20771
21169
|
get supportsTyping() {
|
|
20772
21170
|
return this.isDataLinkOpen && this.sessionCapabilities.agreed("typing/1");
|
|
@@ -20930,21 +21328,33 @@ var GhostLink = class {
|
|
|
20930
21328
|
}
|
|
20931
21329
|
/**
|
|
20932
21330
|
* 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.
|
|
21331
|
+
* kept to send later. While the channel already holds a quarter of what it may queue (its send budget, or the high
|
|
21332
|
+
* water mark of a WebRTC channel), the frame is refused with `too-fast`, so the chat's messages and pings never wait
|
|
21333
|
+
* behind an app's data on a link slower than it sends (WISP 1200 § In a chat). While a file goes, that quarter sits
|
|
21334
|
+
* above what files may hold (`filesWritable`): files keep the channel at their own line for the whole transfer. While
|
|
21335
|
+
* the file waits for room, the app gets no further than `APP_AHEAD_OF_FILES` ahead of it, so it cannot refill the
|
|
21336
|
+
* channel each time it drains to files' line and keep the file from moving.
|
|
20934
21337
|
*/
|
|
20935
21338
|
sendAppData(app, data) {
|
|
20936
21339
|
if (!this.apps.open.has(app)) return "not-open";
|
|
20937
21340
|
if (appDataBytes(data) > 32768) return "too-large";
|
|
20938
21341
|
if (!this.channel || !this.isDataLinkOpen) return "offline";
|
|
20939
21342
|
if (!this.supportsApps) return "peer-closed";
|
|
21343
|
+
const use = this.filesUse?.channel === this.channel ? this.filesUse : null;
|
|
21344
|
+
const files = use && (use.waiting > 0 || Date.now() - use.at < FILES_IN_USE_MS) ? use : null;
|
|
21345
|
+
if (use && !files) use.appAhead = 0;
|
|
21346
|
+
if (this.channel.bufferedAmount >= (files ? filesCap(this.channel) : 0) + (this.channel.sendBudget ?? LIMITS.sendHighWaterMark) / 4) return "too-fast";
|
|
21347
|
+
if (files && files.waiting > 0 && files.appAhead >= APP_AHEAD_OF_FILES) return "too-fast";
|
|
20940
21348
|
const refused = this.apps.canSend(app, data);
|
|
20941
21349
|
if (refused) return refused;
|
|
21350
|
+
const frame = JSON.stringify(appDataFrame(app, data));
|
|
20942
21351
|
try {
|
|
20943
|
-
this.channel.send(
|
|
20944
|
-
return null;
|
|
21352
|
+
this.channel.send(frame);
|
|
20945
21353
|
} catch {
|
|
20946
21354
|
return "offline";
|
|
20947
21355
|
}
|
|
21356
|
+
if (files) files.appAhead = Math.min(files.appAhead + frame.length, APP_AHEAD_OF_FILES + APP_DATA_MAX_BYTES);
|
|
21357
|
+
return null;
|
|
20948
21358
|
}
|
|
20949
21359
|
/** What the contact had open is gone (`apps/1` is no longer agreed, or this link stopped): each app hears it now. */
|
|
20950
21360
|
appsEnded() {
|
|
@@ -20987,19 +21397,64 @@ var GhostLink = class {
|
|
|
20987
21397
|
}
|
|
20988
21398
|
}
|
|
20989
21399
|
/**
|
|
21400
|
+
* A file's bytes to the contact, on the open session: one binary message while both sides agreed `files/4` on it,
|
|
21401
|
+
* the `pf-data` frame with them as base64url text otherwise (WISP 501 § files/4). The form is chosen for each chunk,
|
|
21402
|
+
* so a transfer follows the session it is on. False when files/3 cannot flow now, or the channel has no room.
|
|
21403
|
+
*/
|
|
21404
|
+
sendFileData(id, offset, data) {
|
|
21405
|
+
if (!this.supportsLargeFiles || !this.channel) return false;
|
|
21406
|
+
try {
|
|
21407
|
+
const frame = this.supportsBinaryFiles ? encodeFileData(id, offset, data) : JSON.stringify({
|
|
21408
|
+
t: "pf-data",
|
|
21409
|
+
id,
|
|
21410
|
+
offset,
|
|
21411
|
+
data: toBase64Url(data)
|
|
21412
|
+
});
|
|
21413
|
+
this.channel.send(frame);
|
|
21414
|
+
const use = this.filesUsing(this.channel);
|
|
21415
|
+
use.at = Date.now();
|
|
21416
|
+
use.appAhead = Math.max(0, use.appAhead - (typeof frame === "string" ? frame.length : frame.byteLength));
|
|
21417
|
+
return true;
|
|
21418
|
+
} catch {
|
|
21419
|
+
return false;
|
|
21420
|
+
}
|
|
21421
|
+
}
|
|
21422
|
+
/**
|
|
21423
|
+
* Files on a channel: when they last wrote on it, how many wait for room, and how many bytes an app's data has sent
|
|
21424
|
+
* on it beyond theirs since. An app's data gets room above theirs.
|
|
21425
|
+
*/
|
|
21426
|
+
filesUse = null;
|
|
21427
|
+
filesUsing(channel) {
|
|
21428
|
+
if (this.filesUse?.channel !== channel) this.filesUse = {
|
|
21429
|
+
channel,
|
|
21430
|
+
at: 0,
|
|
21431
|
+
waiting: 0,
|
|
21432
|
+
appAhead: 0
|
|
21433
|
+
};
|
|
21434
|
+
return this.filesUse;
|
|
21435
|
+
}
|
|
21436
|
+
/**
|
|
20990
21437
|
* 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
21438
|
* 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.
|
|
21439
|
+
* while a file goes; others keep under the high water mark, as files/2 does. An app's data gets a quarter above that
|
|
21440
|
+
* line meanwhile (`sendAppData`).
|
|
20993
21441
|
*/
|
|
20994
21442
|
filesWritable() {
|
|
20995
21443
|
const channel = this.channel;
|
|
20996
21444
|
if (!channel) return;
|
|
20997
|
-
const cap = channel
|
|
21445
|
+
const cap = filesCap(channel);
|
|
20998
21446
|
if (channel.bufferedAmount < cap) return;
|
|
21447
|
+
const use = this.filesUsing(channel);
|
|
21448
|
+
use.waiting++;
|
|
20999
21449
|
return (async () => {
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21450
|
+
try {
|
|
21451
|
+
while (this.channel === channel && channel.bufferedAmount >= cap) {
|
|
21452
|
+
await channel.drained().catch(() => {});
|
|
21453
|
+
if (this.channel === channel && channel.bufferedAmount >= cap) await new Promise((resolve) => setTimeout(resolve, 20));
|
|
21454
|
+
}
|
|
21455
|
+
} finally {
|
|
21456
|
+
use.waiting--;
|
|
21457
|
+
use.at = Date.now();
|
|
21003
21458
|
}
|
|
21004
21459
|
})();
|
|
21005
21460
|
}
|
|
@@ -21297,13 +21752,20 @@ var GhostLink = class {
|
|
|
21297
21752
|
}
|
|
21298
21753
|
const held = this.channel;
|
|
21299
21754
|
if (held && this.activeBinding && !this.dialedIn.has(held) && Date.now() - this.channelSince < 1e4 && this.myPubKeyZ32 < this.options.params.peerPubKeyZ32) {
|
|
21300
|
-
|
|
21301
|
-
|
|
21302
|
-
|
|
21303
|
-
|
|
21304
|
-
|
|
21755
|
+
if (this.paired?.state.status !== "ready") {
|
|
21756
|
+
traceLink(this.myPubKeyZ32, "dial-crossed", {
|
|
21757
|
+
transport: binding.transport,
|
|
21758
|
+
held: true
|
|
21759
|
+
});
|
|
21760
|
+
channel.close();
|
|
21761
|
+
return;
|
|
21762
|
+
}
|
|
21763
|
+
this.probeCrossed(held, channel, binding);
|
|
21305
21764
|
return;
|
|
21306
21765
|
}
|
|
21766
|
+
this.replaceWith(channel, binding);
|
|
21767
|
+
}
|
|
21768
|
+
replaceWith(channel, binding) {
|
|
21307
21769
|
traceLink(this.myPubKeyZ32, "replacing", {
|
|
21308
21770
|
transport: binding.transport,
|
|
21309
21771
|
held: this.paired?.state.transport
|
|
@@ -21314,6 +21776,62 @@ var GhostLink = class {
|
|
|
21314
21776
|
});
|
|
21315
21777
|
}
|
|
21316
21778
|
/**
|
|
21779
|
+
* The contact dialled in while this side's own fresh dial holds the chat (`CROSSED_FRESH_MS`): the dials crossed, or
|
|
21780
|
+
* the contact's app ended since that dial and is back. The held session is pinged; heard from within
|
|
21781
|
+
* `CROSSED_PROBE_MS`, the contact holds this side's dial too and its own closes. Not heard from, the contact's dial
|
|
21782
|
+
* takes over.
|
|
21783
|
+
*/
|
|
21784
|
+
crossedProbe = null;
|
|
21785
|
+
/** Frames heard on the open session, counted from its start: whether the contact answered `probeCrossed`. */
|
|
21786
|
+
framesHeard = 0;
|
|
21787
|
+
probeCrossed(held, channel, binding) {
|
|
21788
|
+
this.dropCrossedProbe();
|
|
21789
|
+
traceLink(this.myPubKeyZ32, "dial-crossed", {
|
|
21790
|
+
transport: binding.transport,
|
|
21791
|
+
held: true,
|
|
21792
|
+
probe: true
|
|
21793
|
+
});
|
|
21794
|
+
const heard = this.framesHeard;
|
|
21795
|
+
try {
|
|
21796
|
+
this.sendPing(held, false);
|
|
21797
|
+
} catch {}
|
|
21798
|
+
const timer = setTimeout(() => {
|
|
21799
|
+
if (this.crossedProbe?.channel !== channel) return;
|
|
21800
|
+
this.crossedProbe = null;
|
|
21801
|
+
if (this.stopped || this.leaving || this.candidate) {
|
|
21802
|
+
channel.close();
|
|
21803
|
+
return;
|
|
21804
|
+
}
|
|
21805
|
+
if (!this.channel) {
|
|
21806
|
+
this.attach(channel, binding);
|
|
21807
|
+
return;
|
|
21808
|
+
}
|
|
21809
|
+
if (this.channel === held && this.framesHeard !== heard) {
|
|
21810
|
+
channel.close();
|
|
21811
|
+
return;
|
|
21812
|
+
}
|
|
21813
|
+
traceLink(this.myPubKeyZ32, "crossed-held-silent", { transport: binding.transport });
|
|
21814
|
+
this.replaceWith(channel, binding);
|
|
21815
|
+
}, CROSSED_PROBE_MS);
|
|
21816
|
+
channel.onClose = () => {
|
|
21817
|
+
if (this.crossedProbe?.channel === channel) {
|
|
21818
|
+
clearTimeout(timer);
|
|
21819
|
+
this.crossedProbe = null;
|
|
21820
|
+
}
|
|
21821
|
+
};
|
|
21822
|
+
this.crossedProbe = {
|
|
21823
|
+
channel,
|
|
21824
|
+
timer
|
|
21825
|
+
};
|
|
21826
|
+
}
|
|
21827
|
+
dropCrossedProbe() {
|
|
21828
|
+
const probe = this.crossedProbe;
|
|
21829
|
+
if (!probe) return;
|
|
21830
|
+
this.crossedProbe = null;
|
|
21831
|
+
clearTimeout(probe.timer);
|
|
21832
|
+
probe.channel.close();
|
|
21833
|
+
}
|
|
21834
|
+
/**
|
|
21317
21835
|
* Connections that came in on this side's native endpoints. Their address was in the capability record, which before
|
|
21318
21836
|
* the pin anyone holding a copy of the invite could read: a key other than the pinned one on such a connection proves
|
|
21319
21837
|
* no more than on the DHT, so it closes that connection and nothing else.
|
|
@@ -21508,7 +22026,18 @@ var GhostLink = class {
|
|
|
21508
22026
|
if (this.channel !== channel) return;
|
|
21509
22027
|
this.unansweredPings = 0;
|
|
21510
22028
|
this.heardFromPeer();
|
|
21511
|
-
|
|
22029
|
+
this.framesHeard++;
|
|
22030
|
+
if (typeof data !== "string") {
|
|
22031
|
+
const chunk = this.supportsBinaryFiles ? decodeFileData(data) : null;
|
|
22032
|
+
if (!chunk) return;
|
|
22033
|
+
this.activityAt = Date.now();
|
|
22034
|
+
await this.options.events?.onFilesFrame?.({
|
|
22035
|
+
t: "pf-data",
|
|
22036
|
+
...chunk
|
|
22037
|
+
});
|
|
22038
|
+
return;
|
|
22039
|
+
}
|
|
22040
|
+
if (data.length > 61440) return;
|
|
21512
22041
|
let frame;
|
|
21513
22042
|
try {
|
|
21514
22043
|
frame = JSON.parse(data);
|
|
@@ -26425,6 +26954,7 @@ function readFirstPlace(o, epoch) {
|
|
|
26425
26954
|
/** One of my own frames, among mine: `e:n`. */
|
|
26426
26955
|
var ownKey = (f) => `${f.e}:${f.n}`;
|
|
26427
26956
|
/** What a frame weighs in a log, roughly: its boxes plus the fixed fields around them. */
|
|
26957
|
+
var frameKey$1 = (f) => `${f.s}:${f.e}:${f.n}`;
|
|
26428
26958
|
/** What a kept frame counts for against `GROUP_LIMITS.relayBytes`. */
|
|
26429
26959
|
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
26960
|
/** Only the fields an edit frame has, as `clean` does for a message. */
|
|
@@ -26545,8 +27075,15 @@ var GroupSession = class {
|
|
|
26545
27075
|
pendingMeta;
|
|
26546
27076
|
/** While `handle` runs: the frames it took that a hub passes on (`handle`'s result). */
|
|
26547
27077
|
passOn = null;
|
|
27078
|
+
/** The frames kept to hand on that the app holds with its messages, oldest first; undefined when the state holds them all. */
|
|
27079
|
+
onRows;
|
|
26548
27080
|
/** Set while a save of what received messages changed is due (`persistSoon`). */
|
|
26549
27081
|
saveTimer;
|
|
27082
|
+
/**
|
|
27083
|
+
* The frames of members who left that each member was handed (`frameKey`), so an app that does not take them (from
|
|
27084
|
+
* before revision 2026-10-13, and never marks them seen) is not handed them again at every sync. In memory only.
|
|
27085
|
+
*/
|
|
27086
|
+
leaversHanded = /* @__PURE__ */ new Map();
|
|
26550
27087
|
/** Syncs answered per member, a few a minute (`GROUP_LIMITS.syncAnswers`). In memory only. */
|
|
26551
27088
|
syncsAnswered = /* @__PURE__ */ new Map();
|
|
26552
27089
|
/** Catch-up answers still going out, a slice at a time (`handOut`). */
|
|
@@ -26559,10 +27096,21 @@ var GroupSession = class {
|
|
|
26559
27096
|
provisional;
|
|
26560
27097
|
/** When my chain last moved (a commit made or applied), by `hooks.clock`: frames are said again once it has settled. */
|
|
26561
27098
|
chainMovedAt;
|
|
26562
|
-
|
|
27099
|
+
/**
|
|
27100
|
+
* `onRows`: the frames the app holds with the messages it stored (`GroupIncomingMessage.frame`), oldest first. Given
|
|
27101
|
+
* (empty at first), the app is where frames are kept: the saved state carries none of them, and a message received
|
|
27102
|
+
* no longer writes them all again. Absent: they are kept in the state, as before.
|
|
27103
|
+
*/
|
|
27104
|
+
constructor(state, hooks, onRows) {
|
|
26563
27105
|
this.hooks = hooks;
|
|
26564
27106
|
this.state = state;
|
|
26565
27107
|
this.identity = identityFromSeedB64(state.seedB64);
|
|
27108
|
+
if (onRows) {
|
|
27109
|
+
const held = new Set(onRows.map(frameKey$1));
|
|
27110
|
+
if (state.relay?.length) state.relay = state.relay.filter((f) => !held.has(frameKey$1(f)));
|
|
27111
|
+
this.onRows = state.status === "active" ? onRows.filter((f) => this.handsOn(f.s, f.e)) : [];
|
|
27112
|
+
this.trimRelay();
|
|
27113
|
+
}
|
|
26566
27114
|
this.answers = new CatchUpAnswers({
|
|
26567
27115
|
send: (to, frame) => hooks.send(to, frame),
|
|
26568
27116
|
...hooks.handled && { handled: (to) => hooks.handled(to) },
|
|
@@ -26974,9 +27522,13 @@ var GroupSession = class {
|
|
|
26974
27522
|
this.hooks.changed();
|
|
26975
27523
|
return { secret };
|
|
26976
27524
|
}
|
|
26977
|
-
/**
|
|
27525
|
+
/**
|
|
27526
|
+
* Someone removed is not handed on any more, whatever they sent while in the roster; one who left still is, for the
|
|
27527
|
+
* epochs before its leave (WISP 902 § Catch-up).
|
|
27528
|
+
*/
|
|
26978
27529
|
pruneRelay() {
|
|
26979
|
-
if (this.state.relay?.length) this.state.relay = this.state.relay.filter((f) =>
|
|
27530
|
+
if (this.state.relay?.length) this.state.relay = this.state.relay.filter((f) => this.handsOn(f.s, f.e));
|
|
27531
|
+
if (this.onRows?.length) this.onRows = this.onRows.filter((f) => this.handsOn(f.s, f.e));
|
|
26980
27532
|
if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s));
|
|
26981
27533
|
}
|
|
26982
27534
|
/** 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 +27544,21 @@ var GroupSession = class {
|
|
|
26992
27544
|
}
|
|
26993
27545
|
/** A frame of another member, kept to hand on; the oldest go once the log is full. */
|
|
26994
27546
|
keep(frame) {
|
|
26995
|
-
|
|
26996
|
-
|
|
26997
|
-
|
|
26998
|
-
|
|
27547
|
+
if (this.onRows) {
|
|
27548
|
+
const key = frameKey$1(frame);
|
|
27549
|
+
if (this.onRows.some((f) => frameKey$1(f) === key)) return;
|
|
27550
|
+
this.onRows.push(frame);
|
|
27551
|
+
} else (this.state.relay ??= []).push(frame);
|
|
27552
|
+
this.trimRelay();
|
|
27553
|
+
}
|
|
27554
|
+
/** The frames kept to hand on, oldest first: the state's, then the ones the app holds with its messages. */
|
|
27555
|
+
kept() {
|
|
27556
|
+
return this.onRows ? [...this.state.relay ?? [], ...this.onRows] : this.state.relay ?? [];
|
|
27557
|
+
}
|
|
27558
|
+
trimRelay() {
|
|
27559
|
+
const old = this.state.relay ?? [], rows = this.onRows ?? [];
|
|
27560
|
+
let bytes = old.reduce((sum, f) => sum + frameBytes(f), 0) + rows.reduce((sum, f) => sum + frameBytes(f), 0);
|
|
27561
|
+
while (old.length + rows.length > GROUP_LIMITS.relay || bytes > GROUP_LIMITS.relayBytes) bytes -= frameBytes((old.length ? old : rows).shift());
|
|
26999
27562
|
}
|
|
27000
27563
|
pruneSecrets() {
|
|
27001
27564
|
const epochs = Object.keys(this.state.secrets).map(Number).sort((a, b) => a - b);
|
|
@@ -27031,6 +27594,7 @@ var GroupSession = class {
|
|
|
27031
27594
|
this.state.secrets = {};
|
|
27032
27595
|
this.state.sent = [];
|
|
27033
27596
|
this.state.relay = [];
|
|
27597
|
+
if (this.onRows) this.onRows = [];
|
|
27034
27598
|
this.state.relayEdits = [];
|
|
27035
27599
|
this.state.alone = [];
|
|
27036
27600
|
this.waiting = [];
|
|
@@ -27519,7 +28083,8 @@ var GroupSession = class {
|
|
|
27519
28083
|
}
|
|
27520
28084
|
/**
|
|
27521
28085
|
* 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),
|
|
28086
|
+
* the roster (someone removed is neither heard from nor handed on, #300), or from a member in it when its author left
|
|
28087
|
+
* after it (`handsOn`), and its boxes only with the author's `xs`.
|
|
27523
28088
|
*/
|
|
27524
28089
|
async receiveMessage(from, raw) {
|
|
27525
28090
|
if (!isMessageFrame$1(raw)) return;
|
|
@@ -27528,7 +28093,7 @@ var GroupSession = class {
|
|
|
27528
28093
|
return;
|
|
27529
28094
|
}
|
|
27530
28095
|
const relayed = raw.s !== from;
|
|
27531
|
-
if (relayed && (!rosterHas(this.roster, from) || !
|
|
28096
|
+
if (relayed && (!rosterHas(this.roster, from) || !this.handsOn(raw.s, raw.e))) return;
|
|
27532
28097
|
if (!verify(fromBase64Url(raw.sig), messageSigned$1(raw), publicKeyFromZ32(raw.s))) return;
|
|
27533
28098
|
if (raw.e > this.epoch) {
|
|
27534
28099
|
this.park(from, raw);
|
|
@@ -27566,10 +28131,11 @@ var GroupSession = class {
|
|
|
27566
28131
|
n: first.n
|
|
27567
28132
|
};
|
|
27568
28133
|
if (firstFrame && rosterHas(this.state.chain[first.e]?.m ?? [], this.myKey) && this.isDuplicate(firstFrame)) {
|
|
28134
|
+
await this.hooks.kept?.(groupMessageId(raw.s, first.e, first.n), clean(raw));
|
|
27569
28135
|
this.markSeen(raw);
|
|
27570
28136
|
this.keep(clean(raw));
|
|
27571
28137
|
this.persistSoon();
|
|
27572
|
-
if (
|
|
28138
|
+
if (this.handsOn(raw.s, raw.e)) this.took(clean(raw));
|
|
27573
28139
|
return;
|
|
27574
28140
|
}
|
|
27575
28141
|
const id = first && !this.provisional.has(own) ? groupMessageId(raw.s, first.e, first.n) : own;
|
|
@@ -27606,7 +28172,7 @@ var GroupSession = class {
|
|
|
27606
28172
|
if (firstFrame && rosterHas(this.state.chain[firstFrame.e]?.m ?? [], this.myKey)) this.markSeen(firstFrame);
|
|
27607
28173
|
this.keep(clean(raw));
|
|
27608
28174
|
this.persistSoon();
|
|
27609
|
-
if (
|
|
28175
|
+
if (this.handsOn(raw.s, raw.e)) this.took(clean(raw));
|
|
27610
28176
|
}
|
|
27611
28177
|
/**
|
|
27612
28178
|
* 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 +28206,7 @@ var GroupSession = class {
|
|
|
27640
28206
|
const k = validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
|
|
27641
28207
|
const sc = body.sc === void 0 ? void 0 : readStatusCard(body.sc);
|
|
27642
28208
|
if (!validEditNumber(raw.v) && !sc) return;
|
|
27643
|
-
const copy =
|
|
28209
|
+
const copy = this.kept().find((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n);
|
|
27644
28210
|
const first = copy && readFirstPlace(copy.o, copy.e);
|
|
27645
28211
|
await this.hooks.edit?.({
|
|
27646
28212
|
id: first ? groupMessageId(raw.s, first.e, first.n) : groupMessageId(raw.s, raw.e, raw.n),
|
|
@@ -27801,6 +28367,16 @@ var GroupSession = class {
|
|
|
27801
28367
|
await this.receiveCommit(from, next);
|
|
27802
28368
|
}
|
|
27803
28369
|
}
|
|
28370
|
+
/**
|
|
28371
|
+
* Whether a frame of `author` under `epoch` is taken from another member, kept and handed on: while its author is in
|
|
28372
|
+
* the roster, or when it left (its removal marked `left`, and it is not back in) and the frame is from before that.
|
|
28373
|
+
*/
|
|
28374
|
+
handsOn(author, epoch) {
|
|
28375
|
+
if (rosterHas(this.roster, author)) return true;
|
|
28376
|
+
const chain = this.state.chain;
|
|
28377
|
+
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;
|
|
28378
|
+
return false;
|
|
28379
|
+
}
|
|
27804
28380
|
/** Keeps the admin's mark on a commit that took out a member who left (`GroupCommitFrame.left`) when it holds; true when new. */
|
|
27805
28381
|
takeLeftMark(commit, mark) {
|
|
27806
28382
|
if (commit.k !== "remove" || typeof mark !== "string" || mark.length !== 86 || !B64$1.test(mark) || this.state.leftMarks?.[commit.e]) return false;
|
|
@@ -27895,7 +28471,15 @@ var GroupSession = class {
|
|
|
27895
28471
|
});
|
|
27896
28472
|
const lacks = missingIn(frame, from);
|
|
27897
28473
|
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
|
|
28474
|
+
const handed = this.leaversHanded.get(from) ?? /* @__PURE__ */ new Set();
|
|
28475
|
+
const kept = !asked.size && !this.state.leftMarks ? [] : this.kept().filter((f) => {
|
|
28476
|
+
if (!this.state.chain[f.e] || !rosterHas(this.state.chain[f.e].m, from) || !lacks(f)) return false;
|
|
28477
|
+
if (asked.has(f.s)) return true;
|
|
28478
|
+
if (rosterHas(this.roster, f.s) || handed.has(frameKey$1(f)) || !this.handsOn(f.s, f.e)) return false;
|
|
28479
|
+
handed.add(frameKey$1(f));
|
|
28480
|
+
return true;
|
|
28481
|
+
});
|
|
28482
|
+
if (handed.size) this.leaversHanded.set(from, handed);
|
|
27899
28483
|
answer.push(...asWritten(this.ownLacked(from, frame), kept));
|
|
27900
28484
|
for (const author of asked) {
|
|
27901
28485
|
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 +28904,8 @@ var COMMUNITY_LIMITS = {
|
|
|
28320
28904
|
/** Commits in one welcome or chain piece. */
|
|
28321
28905
|
chainPiece: 100,
|
|
28322
28906
|
pendingLeaves: 64,
|
|
28907
|
+
/** Leaves whose mark (`group-left`) is kept, and the epochs one names. */
|
|
28908
|
+
leftMarks: 64,
|
|
28323
28909
|
/**
|
|
28324
28910
|
* Syncs of one member answered in `syncWindowMs`: each answer may carry the chain's tail, secrets and the whole
|
|
28325
28911
|
* store. A member catching up asks every five seconds at most, and every member syncs every thirty; one asking more
|
|
@@ -28436,6 +29022,14 @@ var leaveStatement = (g, s) => utf8Encode(JSON.stringify([
|
|
|
28436
29022
|
g,
|
|
28437
29023
|
s
|
|
28438
29024
|
]));
|
|
29025
|
+
/** What the member who committed a leave (`h`) had heard of the leaver then: `e:h16` → its highest number there. */
|
|
29026
|
+
var leftStatement = (g, h, hi) => utf8Encode(JSON.stringify([
|
|
29027
|
+
"ghostly-group/2 left",
|
|
29028
|
+
g,
|
|
29029
|
+
h,
|
|
29030
|
+
Object.entries(hi).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)
|
|
29031
|
+
]));
|
|
29032
|
+
var LEFT_EPOCH = /^\d{1,15}:[a-f0-9]{16}$/;
|
|
28439
29033
|
/** The secret of an epoch that adds, re-roles or re-links: from the previous one and the commit. */
|
|
28440
29034
|
function derivedSecret(previous, untaggedHash) {
|
|
28441
29035
|
return hkdf(sha256, previous, utf8Encode(untaggedHash), utf8Encode("ghostly-group/2 derived"), 32);
|
|
@@ -28899,13 +29493,58 @@ var CommunitySession = class {
|
|
|
28899
29493
|
return -1;
|
|
28900
29494
|
}
|
|
28901
29495
|
/**
|
|
28902
|
-
*
|
|
28903
|
-
*
|
|
28904
|
-
*
|
|
29496
|
+
* Whether a frame of someone the chain took out is still heard. A member removed is heard no more, even for an epoch
|
|
29497
|
+
* it was in. What one who left wrote while in the group is taken and handed on, its goodbye included, up to what the
|
|
29498
|
+
* member who committed the leave had heard of it then (its `group-left` mark), never past it: the leaver still holds
|
|
29499
|
+
* those epochs' secrets, and anything it signs later is not heard (WISP 903 § Leaving and removal). No mark here
|
|
29500
|
+
* (one not come yet, or a committer's app before it) and nothing of it is heard.
|
|
28905
29501
|
*/
|
|
28906
|
-
|
|
29502
|
+
heardAfterOut(f) {
|
|
29503
|
+
const i = this.outIndex(f.s);
|
|
29504
|
+
if (i < 0) return true;
|
|
29505
|
+
const commit = this.state.chain[i];
|
|
29506
|
+
if (commit.k !== "leave") return false;
|
|
29507
|
+
const high = this.state.left?.[communityCommitHash(commit)]?.hi[seenKey(f.e, f.h)];
|
|
29508
|
+
return high !== void 0 && f.n <= high;
|
|
29509
|
+
}
|
|
29510
|
+
/** The mark of a leave on my branch, as a frame to hand on (see `heardAfterOut`). */
|
|
29511
|
+
leftFrame(key) {
|
|
28907
29512
|
const i = this.outIndex(key);
|
|
28908
|
-
|
|
29513
|
+
if (i < 0 || this.state.chain[i].k !== "leave") return void 0;
|
|
29514
|
+
const h = communityCommitHash(this.state.chain[i]), mark = this.state.left?.[h];
|
|
29515
|
+
return mark && {
|
|
29516
|
+
t: "group-left",
|
|
29517
|
+
v: 2,
|
|
29518
|
+
g: this.id,
|
|
29519
|
+
h,
|
|
29520
|
+
hi: mark.hi,
|
|
29521
|
+
sig: mark.sig
|
|
29522
|
+
};
|
|
29523
|
+
}
|
|
29524
|
+
keepLeft(h, mark) {
|
|
29525
|
+
const left = { ...this.state.left ?? {} };
|
|
29526
|
+
delete left[h];
|
|
29527
|
+
left[h] = mark;
|
|
29528
|
+
const keys = Object.keys(left);
|
|
29529
|
+
for (const old of keys.slice(0, Math.max(0, keys.length - COMMUNITY_LIMITS.leftMarks))) delete left[old];
|
|
29530
|
+
this.state.left = left;
|
|
29531
|
+
}
|
|
29532
|
+
/** A leave's mark, from the member who committed it: kept when it is that member's, for a leave I hold. */
|
|
29533
|
+
receiveLeft(frame) {
|
|
29534
|
+
const { h, hi, sig } = frame;
|
|
29535
|
+
if (typeof h !== "string" || !HASH.test(h) || typeof sig !== "string" || !SIG.test(sig) || !isObject$2(hi)) return false;
|
|
29536
|
+
const entries = Object.entries(hi);
|
|
29537
|
+
if (entries.length > COMMUNITY_LIMITS.leftMarks || entries.some(([k, n]) => !LEFT_EPOCH.test(k) || !Number.isSafeInteger(n) || n < 0)) return false;
|
|
29538
|
+
const commit = this.known.get(h);
|
|
29539
|
+
if (!commit || commit.k !== "leave" || this.state.left?.[h]?.sig === sig) return false;
|
|
29540
|
+
const marks = hi;
|
|
29541
|
+
if (!verify(fromBase64Url(sig), leftStatement(this.id, h, marks), publicKeyFromZ32(commit.by))) return false;
|
|
29542
|
+
this.keepLeft(h, {
|
|
29543
|
+
hi: marks,
|
|
29544
|
+
sig
|
|
29545
|
+
});
|
|
29546
|
+
this.persistSoon();
|
|
29547
|
+
return true;
|
|
28909
29548
|
}
|
|
28910
29549
|
/**
|
|
28911
29550
|
* What someone the chain took out is told when it comes back (WISP 903 § Leaving and removal): the commits from where
|
|
@@ -29507,10 +30146,11 @@ var CommunitySession = class {
|
|
|
29507
30146
|
continue;
|
|
29508
30147
|
}
|
|
29509
30148
|
try {
|
|
29510
|
-
await this.commit("leave", {
|
|
30149
|
+
const { hash } = await this.commit("leave", {
|
|
29511
30150
|
s: request.s,
|
|
29512
30151
|
ls: request.ls
|
|
29513
30152
|
}, now);
|
|
30153
|
+
this.markLeft(hash, request.s);
|
|
29514
30154
|
done++;
|
|
29515
30155
|
} catch {}
|
|
29516
30156
|
this.state.pendingLeaves = this.state.pendingLeaves.filter((r) => r !== request);
|
|
@@ -29519,6 +30159,25 @@ var CommunitySession = class {
|
|
|
29519
30159
|
return done;
|
|
29520
30160
|
});
|
|
29521
30161
|
}
|
|
30162
|
+
/** Signs and says how far I had heard a member whose leave I just committed (`group-left`). */
|
|
30163
|
+
markLeft(h, leaver) {
|
|
30164
|
+
const hi = {};
|
|
30165
|
+
const heard = Object.entries(this.state.seen[leaver] ?? {}).filter(([k]) => LEFT_EPOCH.test(k)).slice(-COMMUNITY_LIMITS.leftMarks);
|
|
30166
|
+
for (const [k, entry] of heard) hi[k] = entry.high;
|
|
30167
|
+
const sig = toBase64Url(sign(leftStatement(this.id, h, hi), this.identity.seed));
|
|
30168
|
+
this.keepLeft(h, {
|
|
30169
|
+
hi,
|
|
30170
|
+
sig
|
|
30171
|
+
});
|
|
30172
|
+
this.hooks.broadcast({
|
|
30173
|
+
t: "group-left",
|
|
30174
|
+
v: 2,
|
|
30175
|
+
g: this.id,
|
|
30176
|
+
h,
|
|
30177
|
+
hi,
|
|
30178
|
+
sig
|
|
30179
|
+
});
|
|
30180
|
+
}
|
|
29522
30181
|
out(status, reason) {
|
|
29523
30182
|
this.state.status = status;
|
|
29524
30183
|
this.state.statusReason = reason;
|
|
@@ -29780,8 +30439,13 @@ var CommunitySession = class {
|
|
|
29780
30439
|
messageIdOf(f) {
|
|
29781
30440
|
return f.s === this.myKey && this.resealedFrom.get(frameKey(f)) || communityMessageId(f.s, f.e, f.h, f.n);
|
|
29782
30441
|
}
|
|
29783
|
-
/**
|
|
29784
|
-
|
|
30442
|
+
/**
|
|
30443
|
+
* Where I am and what I have, for the member at the other end of an edge that just opened. `to`: that member, now
|
|
30444
|
+
* asked: my answer to its own sync asks nothing more for a while. A second sync went, and its answer took the place of
|
|
30445
|
+
* what was left of the first from its start: a member back after 256 messages was handed 288 (2026-10-14).
|
|
30446
|
+
*/
|
|
30447
|
+
syncFrame(to) {
|
|
30448
|
+
if (to) this.asked.set(to, this.hooks.clock?.() ?? Date.now());
|
|
29785
30449
|
const have = {};
|
|
29786
30450
|
const recent = new Set(this.state.store.map((f) => seenKey(f.e, f.h)));
|
|
29787
30451
|
for (const [sender, byKey] of Object.entries(this.state.seen)) for (const [key, entry] of Object.entries(byKey)) {
|
|
@@ -29842,6 +30506,7 @@ var CommunitySession = class {
|
|
|
29842
30506
|
return false;
|
|
29843
30507
|
case "group-meta": return this.receiveMeta(from, raw);
|
|
29844
30508
|
case "group-leave": return this.receiveLeave(frame);
|
|
30509
|
+
case "group-left": return this.receiveLeft(frame);
|
|
29845
30510
|
case "group-entry": {
|
|
29846
30511
|
if (frame.to !== this.myKey || !isSealed(frame.s) || frame.x !== this.currentEntryKey()) return false;
|
|
29847
30512
|
const seed = openSecret(this.identity.seed, this.myKey, frame.s, entryAad(this.id, this.myKey));
|
|
@@ -29870,7 +30535,7 @@ var CommunitySession = class {
|
|
|
29870
30535
|
return false;
|
|
29871
30536
|
}
|
|
29872
30537
|
if (!verify(fromBase64Url(raw.sig), messageSigned(raw), publicKeyFromZ32(raw.s))) return false;
|
|
29873
|
-
if (this.
|
|
30538
|
+
if (!this.heardAfterOut(raw)) return false;
|
|
29874
30539
|
const found = this.commitByShort(raw.e, raw.h);
|
|
29875
30540
|
if (!found) {
|
|
29876
30541
|
this.park(from, raw);
|
|
@@ -30110,16 +30775,22 @@ var CommunitySession = class {
|
|
|
30110
30775
|
const have = frame.have && typeof frame.have === "object" ? frame.have : {};
|
|
30111
30776
|
const handed = /* @__PURE__ */ new Set();
|
|
30112
30777
|
const unheard = new Set(this.state.unheard ?? []);
|
|
30778
|
+
const marked = /* @__PURE__ */ new Set();
|
|
30113
30779
|
for (const stored of this.state.store) {
|
|
30114
30780
|
if (stored.s === from) continue;
|
|
30115
30781
|
const high = have[stored.s]?.[seenKey(stored.e, stored.h)];
|
|
30116
30782
|
if (Number.isSafeInteger(high) && high >= stored.n) continue;
|
|
30117
|
-
if (this.
|
|
30783
|
+
if (!this.heardAfterOut(stored)) continue;
|
|
30118
30784
|
const found = this.commitByShort(stored.e, stored.h);
|
|
30119
30785
|
if (!found) continue;
|
|
30120
30786
|
const reads = rosterHas(this.rosterAt(found.hash) ?? [], from), mine = stored.s === this.myKey && unheard.has(frameKey(stored));
|
|
30121
30787
|
if (!reads && !(mine && rosterHas(this.roster, from))) continue;
|
|
30122
30788
|
if (!this.mainIndex.has(found.hash)) this.handSide(from, found.hash, handed, answer);
|
|
30789
|
+
if (!rosterHas(this.roster, stored.s) && !marked.has(stored.s)) {
|
|
30790
|
+
marked.add(stored.s);
|
|
30791
|
+
const left = this.leftFrame(stored.s);
|
|
30792
|
+
if (left) answer.push(left);
|
|
30793
|
+
}
|
|
30123
30794
|
answer.push(stored);
|
|
30124
30795
|
if (mine && reads) unheard.delete(frameKey(stored));
|
|
30125
30796
|
}
|
|
@@ -30782,8 +31453,63 @@ function appDigest(manifestBytes) {
|
|
|
30782
31453
|
return toBase64Url(sha256(manifestBytes));
|
|
30783
31454
|
}
|
|
30784
31455
|
var u32 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
30785
|
-
/**
|
|
30786
|
-
|
|
31456
|
+
/**
|
|
31457
|
+
* Lets the thread go for one turn: what waits (input, drawing, timers, port messages, IndexedDB answers) runs, then the
|
|
31458
|
+
* caller goes on. A message to itself, queued behind the page's other tasks. Never `scheduler.yield()`: in Chromium its
|
|
31459
|
+
* continuation outranks every normal task, so a paced read of 4096 revocations held the page's timers, its apps' broker
|
|
31460
|
+
* ports and IndexedDB for the whole 1.8 s. Never `setTimeout(0)` but as the last resort: from the fifth nested timer on
|
|
31461
|
+
* the browser waits at least 4 ms (HTML's clamp), which made that read take 60% longer than the work, and a hidden tab
|
|
31462
|
+
* runs timers once a second.
|
|
31463
|
+
*/
|
|
31464
|
+
function yieldThread() {
|
|
31465
|
+
if (typeof MessageChannel === "function") return new Promise((resolve) => {
|
|
31466
|
+
const channel = new MessageChannel();
|
|
31467
|
+
channel.port1.onmessage = () => {
|
|
31468
|
+
channel.port1.close();
|
|
31469
|
+
resolve();
|
|
31470
|
+
};
|
|
31471
|
+
channel.port2.postMessage(null);
|
|
31472
|
+
});
|
|
31473
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
31474
|
+
}
|
|
31475
|
+
/**
|
|
31476
|
+
* A pause for a loop of short steps: `await pause()` after each step lets the thread go once `sliceMs` of work has
|
|
31477
|
+
* run since the last time, and answers at once otherwise.
|
|
31478
|
+
*/
|
|
31479
|
+
function pacer(sliceMs) {
|
|
31480
|
+
let since = performance.now();
|
|
31481
|
+
return () => {
|
|
31482
|
+
if (performance.now() - since < sliceMs) return void 0;
|
|
31483
|
+
return yieldThread().then(() => {
|
|
31484
|
+
since = performance.now();
|
|
31485
|
+
});
|
|
31486
|
+
};
|
|
31487
|
+
}
|
|
31488
|
+
/** `sha256Paced` hashes up to this much at once: under a millisecond of the thread. */
|
|
31489
|
+
var HASH_AT_ONCE = 65536;
|
|
31490
|
+
/** Without `crypto.subtle`, `sha256Paced` hashes this much (a few ms), then lets the thread go. */
|
|
31491
|
+
var HASH_SLICE = 262144;
|
|
31492
|
+
/** `readAppBundleAsync` hashes files for this long at most before it lets the thread go, however small each file. */
|
|
31493
|
+
var HASH_SLICE_MS = 5;
|
|
31494
|
+
/**
|
|
31495
|
+
* SHA-256 of bytes that may be a whole bundle, for a client whose engine shares its page's thread: `sha256` in
|
|
31496
|
+
* 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
|
|
31497
|
+
* input for 200 ms. With `crypto.subtle` the bytes are hashed off the thread; without it (a page not served over
|
|
31498
|
+
* HTTPS), a slice at a time with a pause between slices. The bytes must not change until it answers.
|
|
31499
|
+
*/
|
|
31500
|
+
async function sha256Paced(bytes) {
|
|
31501
|
+
if (bytes.length <= HASH_AT_ONCE) return sha256(bytes);
|
|
31502
|
+
const subtle = globalThis.crypto?.subtle;
|
|
31503
|
+
const away = subtle ? await subtle.digest("SHA-256", bytes).catch(() => null) : null;
|
|
31504
|
+
if (away) return new Uint8Array(away);
|
|
31505
|
+
const hash = sha256.create();
|
|
31506
|
+
for (let at = 0; at < bytes.length; at += HASH_SLICE) {
|
|
31507
|
+
if (at) await yieldThread();
|
|
31508
|
+
hash.update(bytes.subarray(at, at + HASH_SLICE));
|
|
31509
|
+
}
|
|
31510
|
+
return hash.digest();
|
|
31511
|
+
}
|
|
31512
|
+
function readAppBundleHead(bytes) {
|
|
30787
31513
|
if (bytes.length > APP_BUNDLE_LIMITS.bundleBytes) return {
|
|
30788
31514
|
ok: false,
|
|
30789
31515
|
reason: "too-large"
|
|
@@ -30842,17 +31568,18 @@ function readAppBundle(bytes) {
|
|
|
30842
31568
|
};
|
|
30843
31569
|
const signed = verifyAppSignature(APP_PREFIXES.app, manifestBytes, statement.signature, manifest.publisher);
|
|
30844
31570
|
if (!signed.ok) return signed;
|
|
30845
|
-
|
|
30846
|
-
|
|
30847
|
-
|
|
30848
|
-
|
|
30849
|
-
|
|
30850
|
-
|
|
30851
|
-
|
|
30852
|
-
|
|
30853
|
-
|
|
30854
|
-
|
|
30855
|
-
|
|
31571
|
+
return {
|
|
31572
|
+
ok: true,
|
|
31573
|
+
head: {
|
|
31574
|
+
manifest,
|
|
31575
|
+
manifestBytes,
|
|
31576
|
+
signature: statement.signature,
|
|
31577
|
+
filesAt: at
|
|
31578
|
+
}
|
|
31579
|
+
};
|
|
31580
|
+
}
|
|
31581
|
+
/** The last check, once every file's hash held: the icon. */
|
|
31582
|
+
function closeAppBundle({ manifest, manifestBytes, signature }, files) {
|
|
30856
31583
|
const icon = files.get(APP_ICON_PATH);
|
|
30857
31584
|
if (icon) {
|
|
30858
31585
|
const size = imageSize(icon);
|
|
@@ -30873,11 +31600,54 @@ function readAppBundle(bytes) {
|
|
|
30873
31600
|
manifest,
|
|
30874
31601
|
manifestBytes,
|
|
30875
31602
|
digest: appDigest(manifestBytes),
|
|
30876
|
-
signature
|
|
31603
|
+
signature,
|
|
30877
31604
|
files
|
|
30878
31605
|
}
|
|
30879
31606
|
};
|
|
30880
31607
|
}
|
|
31608
|
+
/** Reads and checks a bundle (the order of the checks is part of the format: see above). */
|
|
31609
|
+
function readAppBundle(bytes) {
|
|
31610
|
+
const read = readAppBundleHead(bytes);
|
|
31611
|
+
if (!read.ok) return read;
|
|
31612
|
+
const files = /* @__PURE__ */ new Map();
|
|
31613
|
+
let at = read.head.filesAt;
|
|
31614
|
+
for (const f of read.head.manifest.files) {
|
|
31615
|
+
const content = bytes.subarray(at, at + f.size);
|
|
31616
|
+
at += f.size;
|
|
31617
|
+
if (toBase64Url(sha256(content)) !== f.sha256) return {
|
|
31618
|
+
ok: false,
|
|
31619
|
+
reason: "file-hash",
|
|
31620
|
+
detail: f.path
|
|
31621
|
+
};
|
|
31622
|
+
files.set(f.path, content);
|
|
31623
|
+
}
|
|
31624
|
+
return closeAppBundle(read.head, files);
|
|
31625
|
+
}
|
|
31626
|
+
/**
|
|
31627
|
+
* `readAppBundle` for a client whose engine shares its page's thread: the same checks in the same order, with the same
|
|
31628
|
+
* refusals, and each file hashed by `sha256Paced`, one after the other, with the thread let go between files every
|
|
31629
|
+
* `HASH_SLICE_MS` (64 files of 64 KiB, each hashed at once, held it for 50 ms). The bytes must not change until it
|
|
31630
|
+
* answers.
|
|
31631
|
+
*/
|
|
31632
|
+
async function readAppBundleAsync(bytes) {
|
|
31633
|
+
const read = readAppBundleHead(bytes);
|
|
31634
|
+
if (!read.ok) return read;
|
|
31635
|
+
const files = /* @__PURE__ */ new Map();
|
|
31636
|
+
const pause = pacer(HASH_SLICE_MS);
|
|
31637
|
+
let at = read.head.filesAt;
|
|
31638
|
+
for (const f of read.head.manifest.files) {
|
|
31639
|
+
const content = bytes.subarray(at, at + f.size);
|
|
31640
|
+
at += f.size;
|
|
31641
|
+
if (toBase64Url(await sha256Paced(content)) !== f.sha256) return {
|
|
31642
|
+
ok: false,
|
|
31643
|
+
reason: "file-hash",
|
|
31644
|
+
detail: f.path
|
|
31645
|
+
};
|
|
31646
|
+
files.set(f.path, content);
|
|
31647
|
+
await pause();
|
|
31648
|
+
}
|
|
31649
|
+
return closeAppBundle(read.head, files);
|
|
31650
|
+
}
|
|
30881
31651
|
/** Puts a bundle's parts together, checking nothing: for builders, and for tests that need a broken bundle. */
|
|
30882
31652
|
function assembleAppBundle(manifestBytes, statementBytes, files) {
|
|
30883
31653
|
const total = MAGIC.length + 8 + manifestBytes.length + statementBytes.length + files.reduce((s, f) => s + f.length, 0);
|
|
@@ -31291,6 +32061,6 @@ function appStoreDecision(held, read) {
|
|
|
31291
32061
|
return read.digest === held.digest ? "same" : "equivocation";
|
|
31292
32062
|
}
|
|
31293
32063
|
//#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 };
|
|
32064
|
+
export { decodeCommunityLink as $, verifySetUpdate as $_, publishFailure as $a, decodeTxtPacket as $b, WAKE_SESSION_CAPABILITY as $c, EDIT_BUFFER_MAX as $d, ACTIVE_TASK_STATUSES as $f, filePartName as $g, compressSdp as $h, pubkyHomeserverOf as $i, IDENTITY_CLOCK_SKEW as $l, FIRST_PUBLISH_MAX_MS as $m, txHash as $n, readBeaconHead as $o, readCanonicalJson as $p, staticDidDocument as $r, WAKE_SUBJECT as $s, MAX_GROUP_META_BODY as $t, checkedDescriptors as $u, deviceKeyZ32 as $v, turnVerifierMark as $y, isAppLicense as A, readHandoffBusy as A_, GhostLink as Aa, traceLink as Ab, appDataBytes as Ac, PLAYABLE_AUDIO as Ad, REACTION_FRAME as Af, HANDOFF_CANCEL as Ag, PROTOCOL_VERSION as Ah, parsePaymentAmount as Ai, parseDomainTxt as Al, openSecret as Am, sshSignCommand as An, GROUP_VERSION_HUBS as Ao, APP_PREFIXES as Ap, DID_FILE_MAX_BYTES as Ar, typingFrame as As, GROUP_LIMITS as At, emptyProofLedger as Au, INVITE_MAX_LENGTH as Av, toBase64Url as Ax, TURN_SLOTS as Ay, groupTypingEpoch as B, readHandoffTurnFrame as B_, PONG_WAIT_MS as Ba, withRequestOptions as Bb, CALLS_CAPABILITY as Bc, recordingMime as Bd, reactionIsNewer as Bf, HANDOFF_MANIFEST as Bg, RTC_SIGNAL_MAX_AGE_MS as Bh, isBitcoinAddress as Bi, CAPS_PUBLISH_SPACING_MS as Bl, OFFER_HOST_GATHER_MS as Bm, decodeBase64 as Bn, beaconKeys as Bo, isAppRef as Bp, didJwsAlg as Br, parsePinFrame as Bs, GROUP_EDIT_TEXT_BYTES as Bt, validExternalKey as Bu, inviteQrSegments as Bv, sealTurnBody as By, APP_VIEWS as C, handoffVerifiedFrame as C_, CROSSED_FRESH_MS as Ca, TURN_SOURCE_TIMEOUT_MS as Cb, APP_RATE_LIMIT as Cc, readImageMeta as Cd, forwardedAgain as Cf, serviceIdFromName as Cg, sanitizeResponseHeaders as Ch, TEST_USDT_FAUCET_AMOUNT as Ci, dnsProofName as Cl, confirmationTag as Cm, SSH_PUBLIC_KEY_MAX as Cn, SIGNAL_CARRIERS as Co, MESSAGE_CLOCK_SKEW_MS as Cp, parseAtprotoDidKey as Cr, TYPING_TIMEOUT_MS as Cs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ct, applyIdentityEvent as Cu, deviceInviteJoinerKeyZ32 as Cv, bytesEqual as Cx, TURN_LAST_SEQUENCE as Cy, buildAppBundle as D, newHandoffId as D_, DEMOTE_MS as Da, normalizeRelayUrl as Db, APP_VERSION_MAX as Dc, safeBlobType as Dd, GROUP_REACTION_FRAME as Df, HANDOFF_ATTEMPTS as Dg, CHUNK_KIND as Dh, assertWholeSats as Di, isPublicAddress as Dl, epochKeys as Dm, sameSshKey as Dn, SIGNAL_REPLY_MS as Do, receivedTimestamp as Dp, verifyAtprotoRecordProof as Dr, parseTypingFrame as Ds, groupWakes as Dt, PeerProofs as Du, DEVICE_INVITE_VERSION as Dv, fromZ32 as Dx, TURN_REV_LIMIT as Dy, assembleAppBundle as E, isHandoffPartName as E_, DEMOTE_AFTER_FAILURES as Ea, currentRelays as Eb, APP_SEND_LIMIT as Ec, formatFileSize as Ed, COMMUNITY_REACTION_FRAME as Ef, HANDOFF_ACK as Eg, CHUNK_FLAG_END as Eh, assertTokenUnits as Ei, encodeDnsQuery as El, encryptText as Em, parseSshSignature as En, SIGNAL_PROVEN_MS as Eo, heardTime as Ep, unsignedCommitBytes as Er, parseTypingActivity as Es, groupWakeFrame as Et, PROOF_CAPABILITY as Eu, readDeviceInvite as Ev, fromBase64Url as Ex, TURN_NO_ACTIVE as Ey, readAppBundleAsync as F, readHandoffHave as F_, LIVENESS_PING_MS as Fa, RelayBreaker as Fb, isChatAppId as Fc, downsamplePeaks as Fd, parseReactionFrame as Ff, HANDOFF_FILE_REQUEST as Fg, sendBody as Fh, isSparkAddress as Fi, validDomainRecord as Fl, CONNECT_TIMEOUT_MS as Fm, BIP322_REVISION as Fn, meshRendezvous as Fo, appRevocationId as Fp, DID_METHODS as Fr, PIN_CLOCK_SKEW_MS as Fs, chainPieces as Ft, proofHash as Fu, decodeInviteCode as Fv, __esmMin as Fx, firstDeviceSetSecret as Fy, CommunitySession as G, SET_ACK as G_, RESUME_WAIT_MS as Ga, createRelayPayload as Gb, PIN_CAPABILITY as Gc, voicePeaksOf as Gd, PAIRED_REPLY_AUTHORS as Gf, HANDOFF_RELEASE as Gg, CALL_SIGNAL_FUTURE_MS as Gh, newPubkyProofFolder as Gi, DHT_TEXT_CAPABILITY as Gl, DIRECT_PEERS as Gm, decodeAnyBitcoinAddress as Gn, lobbyKeys as Go, readAppSignature as Gp, didWebFileUrl as Gr, pinnedFrame as Gs, parseCommunityEdit as Gt, ringClaims as Gu, DEVICE_CAPABILITIES as Gv, turnKeys as Gy, sealGroupTyping as H, sameDigest as H_, RACE_DIRECT_MS as Ha, PKARR_FUTURE_SKEW_MS as Hb, FILES_BINARY_CAPABILITY as Hc, voiceFileName as Hd, readReaction as Hf, HANDOFF_PAKE as Hg, extractRtcParams as Hh, PUBKY_PROOF_ROOT as Hi, CapsExchange as Hl, STALLED_EVIDENCE_MS as Hm, BitcoinAddressError as Hn, doorHubs as Ho, readAppRevocation as Hp, didWebDocumentUrl as Hr, pinFrame as Hs, communityEditFrame as Ht, verifyPeerProof as Hu, ownInviteRefusal as Hv, signTurnPacket as Hy, sha256Paced as I, readHandoffHello as I_, MAX_PAIRED_MESSAGE_FRAME as Ia, DiscoveryBudgetError as Ib, parseAppFrame as Ic, fileMessageText as Id, queueReaction as If, HANDOFF_HAVE as Ig, wrapDataChannel as Ih, sparkAddressKind as Ii, wellKnownUrl as Il, DATA_SETTLE_MS as Im, MessageRefusal as In, parseHubPolicy as Io, appSignedBytes as Ip, DidError as Ir, PIN_FRAME as Is, frameBytes as It, proofStatement as Iu, encodeGhostlyInvite as Iv, __exportAll as Ix, nextTurnPosition as Iy, communityGroupId as J, readSetUpdate as J_, UNPROVEN_AUTH_MS as Ja, openRelayPayload as Jb, SESSION_CAPABILITIES_FRAME as Jc, formatVideoDuration as Jd, groupReplyAuthor as Jf, HANDOFF_VERIFIED as Jg, RTC_CONFIG as Jh, pubkyProofFile as Ji, emptyCapsState as Jl, symmetricNat as Jm, decodeWitness as Jn, mergeLobby as Jo, verifyAppRevocation as Jp, parseDid as Jr, WAKE_CALL_INTERVAL_MS as Js, MENTION_LIMITS as Jt, verifyRingAuthorization as Ju, ENROLL_CAPABILITY as Jv, turnPayloadSequence as Jy, GROUP_READ_NOTE_COMMUNITY as K, SET_UPDATE as K_, RTC_UNSTARTED_MS as Ka, measureRecords as Kb, REACTIONS_CAPABILITY as Kc, PLAYABLE_VIDEO as Kd, REPLY_ID as Kf, HANDOFF_REQUEST as Kg, CALL_SIGNAL_MAX_AGE_MS as Kh, normalizePubkyKey as Ki, capsDescriptors as Kl, DirectPathWatch as Km, decodeBitcoinAddress as Kn, lobbyRecords as Ko, signAppObject as Kp, didWebHost as Kr, readPin as Ks, validEditText as Kt, ringEvidence as Ku, DEVICE_ECHO_FRAME as Kv, turnName as Ky, yieldThread as L, readHandoffManifest as L_, PAIRED_FRAME_TOO_LARGE as La, budgetRetryMs as Lb, readAppFrame as Lc, formatVoiceDuration as Ld, reactedFrame as Lf, HANDOFF_HELLO as Lg, DATA_CHANNEL_ID as Lh, sparkInvoiceDetails as Li, CAPS_ISSUED_BACK_MS as Ll, DataLink as Lm, bip322MessageHash as Ln, pickMeshHubs as Lo, checkAppRevokeStatement as Lp, checkDidJws as Lr, PIN_LIMITS as Ls, groupMessageId as Lt, storageProof as Lu, encodeInviteCode as Lv, __require as Lx, openTurnValue as Ly, isAppUrl as M, readHandoffData as M_, INVITER_DIAL_GRACE_MS as Ma, BREAKER_BASE_MS as Mb, appOpenFrame as Mc, VOICE_LIMITS as Md, ReactionWindow as Mf, HANDOFF_DATA as Mg, decodeControl as Mh, walletNetworkOf as Mi, recordsFromWellKnown as Ml, sealSecret as Mm, isLegacySignature as Mn, NO_HUB_POLICY as Mo, appFingerprint as Mp, DID_JWS_ALGS as Mr, COMMUNITY_PIN_FRAME as Ms, GROUP_READ_NOTE as Mt, isProofAdapter as Mu, OwnInviteError as Mv, utf8Decode as Mx, TURN_VERSION as My, pacer as N, readHandoffDone as N_, INVITE_TAKEN as Na, BREAKER_MAX_MS as Nb, chatAppId as Nc, VOICE_METER as Nd, nextReactionNumber as Nf, HANDOFF_DONE as Ng, encodeChunk as Nh, SPARK_NETWORKS as Ni, recordsName as Nl, sha256Hex as Nm, legacyMessageHash as Nn, mayBeHub as No, appRef as Np, DID_JWS_MAX_LENGTH as Nr, GROUP_PIN_FRAME as Ns, GroupSession as Nt, nostrProofTemplate as Nu, createChatInvite as Nv, utf8Encode as Nx, TurnRecordError as Ny, checkAppManifest as O, openHandoffPiece as O_, DHT_PIN_GRACE_MS as Oa, readRelayBody as Ob, AppSessions as Oc, sanitizeFileName as Od, QUICK_REACTIONS as Of, HANDOFF_BUSY as Og, LIMITS as Oh, formatPaymentAmount as Oi, nip05RootKey as Ol, newEpochSecret as Om, sshFingerprint as On, groupSignalFrame as Oo, shownTime as Op, verifyAtprotoSignature as Or, sanitizeTypingStatus as Os, mentionedMembers as Ot, STORAGE_LIFETIME as Ou, INVITE_HRP as Ov, randomBytes as Ox, TURN_SEALED_BYTES as Oy, readAppBundle as P, readHandoffFileFrame as P_, LIVENESS_MISSED_PINGS as Pa, BREAKER_THRESHOLD as Pb, isAppVersion as Pc, baseMime as Pd, parseReactedFrame as Pf, HANDOFF_FILE_MISSING as Pg, encodeControl as Ph, SPARK_PROVIDER as Pi, txtValue as Pl, ANSWER_REFUSED_REDIALS as Pm, verifyBitcoinMessage as Pn, meshHubs as Po, appRefPublisher as Pp, DID_MAX_LENGTH as Pr, PINNED_FRAME as Ps, asWritten as Pt, proofCapability as Pu, createLink as Pv, __commonJSMin as Px, encodeTurnFields as Py, communityUntaggedHash as Q, signTombstone as Q_, parsePaymentNetworks as Qa, decodeDnsAnswers as Qb, UPGRADE_CAPABILITY as Qc, EDITED_FRAME as Qd, wireReply as Qf, filePartDigest as Qg, callSignalHeardAt as Qh, homeserverWebEndpoint as Qi, IDENTITY_CHECK_UNAVAILABLE as Ql, EXPECT_PEER_MS as Qm, sha256d as Qn, readBeacon as Qo, canonicalJsonBytes as Qp, signingKeys as Qr, WAKE_INTERVAL_MS as Qs, wireMentions as Qt, automaticTransport as Qu, deviceFrameCapability as Qv, turnStatedVerifier as Qy, GROUP_TYPING_FRAME as R, readHandoffPake as R_, PAIRING_ATTEMPT_MS as Ra, heldBackError as Rb, APPS_CAPABILITY as Rc, isPlayableAudioType as Rd, reactionEmoji as Rf, HANDOFF_LATER_BYTES as Rg, DATA_CHANNEL_LABEL as Rh, sparkNetworkOf as Ri, CAPS_LABEL as Rl, GATHER_ATTEMPTS as Rm, bip322ToSign as Rn, wireHubPolicy as Ro, isAppHash as Rp, checkDidSignature as Rr, mayPin as Rs, COMMUNITY_EDIT_FRAME as Rt, storageProofBody as Ru, inviteLink as Rv, __toCommonJS as Rx, readTurnBody as Ry, APP_SCREENSHOTS_DIR as S, handoffStreamKey as S_, BLOCKED_DIAL_WAIT_MS as Sa, SLOW_MS as Sb, APP_PEER_OPEN_MAX as Sc, parseImageMeta as Sd, FORWARD_LIMITS as Sf, isValidServiceId as Sg, sanitizeRequestHeaders as Sh, SEPOLIA_TEST_USDT_FAUCET as Si, decodeDnsResponse as Sl, confirmationMatches as Sm, SSH_KEY_TYPES as Sn, SIGNALS_PER_MINUTE as So, usageLeft as Sp, parseAtprotoCar as Sr, TYPING_STATUS_MAX as Ss, GROUP_WAKE_GROUP_WINDOW_MS as St, IDENTITY_TIMELINE_MAX as Su, createDeviceInvite as Sv, trimEndOf as Sx, TURN_LABEL as Sy, appViewOf as T, handoffVersions as T_, CROSSED_WAIT_MS as Ta, WRITE_FIRST_MS as Tb, APP_RESUME_GRACE_MS as Tc, PREVIEWABLE_IMAGE as Td, readForwarded as Tf, servicesToWire as Tg, webLocalFetch as Th, WALLET_NETWORKS as Ti, domainWellKnownFile as Tl, edgeParams as Tm, parseSshPublicKey as Tn, SIGNAL_HOLD_MS as To, claimedTime as Tp, readAtprotoCid as Tr, TypingSender as Ts, GroupWakeLimiter as Tt, PROOF_ADAPTERS as Tu, encodeDeviceInvite as Tv, fromBase64 as Tx, TURN_NAME_BYTES as Ty, COMMUNITY_LIMITS as U, sealHandoffPiece as U_, RACE_RELAYED_MS as Ua, PacketTooLargeError as Ub, FILES_CAPABILITY as Uc, voiceLevel as Ud, validReactionNumber as Uf, HANDOFF_PIECE_BYTES as Ug, offerIsFresh as Uh, isPubkyKey as Ui, CapsKeys as Ul, DIRECT_EVIDENCE_MS as Um, ByteReader as Un, freshHubs as Uo, readAppRevocationShape as Up, didWebFile as Ur, pinIsNewer as Us, communityMessageAuthor as Ut, RING_LIFETIME as Uu, readInviteCode as Uv, signTurnRelease as Uy, openGroupTyping as V, readHandoffVerified as V_, RACE_ANSWERED_MS as Va, MAX_DNS_PACKET_BYTES as Vb, EDIT_CAPABILITY as Vc, voiceDownloadName as Vd, readDhtReactions as Vf, HANDOFF_OFFER as Vg, buildDataSdp as Vh, PUBKY_PROOF_MAX_BYTES as Vi, CAPS_REFRESH_MS as Vl, REANSWERS as Vm, verifyBip322 as Vn, beaconRecords as Vo, isAppSignature as Vp, didSignedMessages as Vr, parsePinnedFrame as Vs, carryMentions as Vt, verifyNostrProof as Vu, inviteQrText as Vv, signTurnBody as Vy, COMMUNITY_PROFILE as W, sortParts as W_, REDESCRIBED_GRACE_MS as Wa, RELAY_PAYLOAD_MAX_BYTES as Wb, KNOWN_SESSION_CAPABILITIES as Wc, voiceLevelsOf as Wd, wireReaction as Wf, HANDOFF_PIECE_OVERHEAD as Wg, parseRtcSignal as Wh, isPubkyProofFolder as Wi, CapsRefusedError as Wl, DIRECT_OWN_ATTEMPTS as Wm, compactSize as Wn, hubRank as Wo, readAppRevocations as Wp, didWebFileNames as Wr, pinNumberHolds as Ws, meshMessageRef as Wt, ringAuthorization as Wu, DEVICES_CAPABILITY as Wv, turnInstance as Wy, communityMessageId as X, setUpdateFrame as X_, pairedMessageFits as Xa, readOwnRelayPayload as Xb, SessionCapabilities as Xc, isVideoMime as Xd, readReply as Xf, HANDOFF_WINDOW as Xg, buildSdpFromSignal as Xh, decodeSvcbRecords as Xi, parsePacketTransports as Xl, DEPARTED_READ_MS as Xm, encodeWitness as Xn, pickHubs as Xo, verifyAppStatementBytes as Xp, parseDidJws as Xr, WAKE_CALL_WAIT_MS as Xs, mentionsMember as Xt, RELAY_URL as Xu, deviceEchoFrame as Xv, turnSequence as Xy, communityHasFrame as Y, setAckFrame as Y_, WAKE_LOST_MS as Ya, parseRelayPayload as Yb, STATUS_CARD_CAPABILITY as Yc, isPlayableVideoType as Yd, pairedReplyAuthor as Yf, HANDOFF_VERSION as Yg, answersOffer as Yh, pubkyProofPath as Yi, encodePacketTransports as Yl, AWAITING_PEER_MS as Ym, encodeTx as Yn, newerHead as Yo, verifyAppSignature as Yp, parseDidDocument as Yr, WAKE_CALL_TTL_SECONDS as Ys, mentionsBytes as Yt, verifyRingEvidence as Yu, HANDOFF_CAPABILITY as Yv, turnReleaseMessage as Yy, communityRoster as Z, setUpdateMessage as Z_, pairedMessageFrame as Za, signRelayPayload as Zb, TYPING_CAPABILITY as Zc, parseVideoMeta as Zd, replySnippet as Zf, NO_ATTEMPTS as Zg, callRtcConfig as Zh, encodeSvcbPacket as Zi, IDENTITY_CHALLENGE_WINDOW as Zl, DHT_POLL_INTERVALS as Zm, hash160 as Zn, rankHubs as Zo, canonicalJson as Zp, parseDidSignaturePaste as Zr, WAKE_FRAME as Zs, validMentions as Zt, TRANSPORTS as Zu, deviceEchoNonce as Zv, turnSignedMessage as Zy, APP_CLIENTS as _, handoffOfferFrame as __, isFederationId as _a, REQUESTS_PER_MINUTE as _b, pushRequest as _c, dhtFileId as _d, linkEnd as _f, LEGACY_SERVICES as _g, HttpHost as _h, ETHEREUM_USDT as _i, DOMAIN_MAX_RECORDS as _l, sortRoster as _m, signGroupMeta as _n, readGroupWantNo as _o, readStatusCard as _p, atprotoCidFor as _r, TYPING_KINDS as _s, knockRecords as _t, newIdentityBinding as _u, readEnrollHello as _v, MAX_NICK_LENGTH as _x, keptAtEqualSequence as _y, checkAppBeforeRun as a, handoffCancelFrame as a_, parseInvoiceCallback as aa, DEFAULT_RELAYS as ab, readWake as ac, ACTIVE_DHT_POLL_MS as ad, MAX_EDITS_PER_MESSAGE as af, pickCallCandidates as ag, OFFER_STEP_MAX as ah, DidDhtError as ai, SESSION_RECEIVE_PENDING as al, MAX_GROUP_CHAIN as am, groupMetaBody as an, PairingTracker as ao, ROUTINE_STATES as ap, ATPROTO_PROOF_COLLECTION as ar, PairedCalls as as, shortHash as at, IDENTITY_REVOCATION_LABEL as au, ENROLL_HELLO as av, publicKeyFromZ32 as ax, devicePingFrame as ay, APP_ICON_PATH as b, handoffRequestFrame as b_, ANSWERS_REFUSED_PAUSES as ba, SIGNALING_WINDOW_MS as bb, APP_DATA_MAX_BYTES as bc, imageSize as bd, previewImageSize as bf, decodeServices as bg, relativizeLocation as bh, PaymentPreflightError as bi, NIP05_PATH as bl, verifyCommitSignature as bm, SSHSIG_MAX_ARMOR as bn, GROUP_SIGNAL_FRAME as bo, statusCardText as bp, encodeDagCbor as br, TYPING_REFRESH_MS as bs, GROUP_WAKE_FRAME as bt, signIdentityPresentation as bu, DEVICE_INVITE_LIFETIME_S as bv, sanitizeNick as bx, TOMBSTONE_TURN as by, APP_STORE_LIMITS as c, handoffDataFrame as c_, requestLnurlInvoice as ca, GROUP_BURST_MS as cb, wakeFrame as cc, DHT_MESSAGE_TTL as cd, editFrame as cf, waitForIceGathering as cg, RELAY_POLL_INTERVALS as ch, didDhtFromPublicKey as ci, HOLD_LIMITS as cl, OWN_FRAME_LIMIT as cm, groupMetaPicture as cn, GROUP_VERSION_FILES as co, TASK_STATUSES as cp, atprotoProofRecord as cr, FILE_DATA_KIND as cs, verifyCommunityCommit as ct, IdentityCheckUnavailable as cu, enrollCancelReason as cv, decrypt as cx, unsignedDeviceTransports as cy, readAppListing as d, handoffEphemeral as d_, decodeBolt11 as da, GROUP_RATION_WINDOW_MS as db, PUSH_SERVICE_HOSTS as dc, DhtDelivery as dd, parseEditedFrame as df, RECORD_TTL as dg, UNUSED_INVITE_WAIT_MAX_MS as dh, encodeDidDhtDeactivated as di, isHoldUrl as dl, commitUntaggedHash as dm, nextGroupMetaRevision as dn, fetchesByItself as do, cardEditNumber as dp, isAtprotoDid as dr, decodeFileData as ds, MAX_KNOCKS as dt, emptyIdentityLedger as du, enrollGrantFrame as dv, sealedLength as dx, webCryptoSigner as dy, handoffAckFrame as e_, LIGHTNING_DESTINATION_PATTERN as ea, BACKGROUND_REQUESTS_PER_MINUTE as eb, WAKE_TTL_SECONDS as ec, irohDescriptor as ed, EDIT_BUFFER_MS as ef, decompressSdp as eg, IDLE_THRESHOLD as eh, strictBase64Url as ei, parseSessionCapabilities as el, GROUP_ADMIN_OFF_ERROR as em, MAX_GROUP_NAME_BYTES as en, ENGINE_ERRORS as eo, BUTTON_ID as ep, u32$2 as er, readLobby as es, derivedSecret as et, IDENTITY_MAX_EVIDENCE as eu, DEVICE_KINDS as ev, encodeTxtPacket as ex, deviceLinkPairing as ey, readAppStore as f, handoffFileMissingFrame as f_, findBolt11 as fa, GROUP_SIGNALING_ALLOWANCE_SHARE as fb, WebPushError as fc, LIVE_POLL_MS as fd, validEditMessage as ff, buildLinkRecords as fg, WATCH_PEER_MS as fh, encodeDidDhtPacket as fi, newMailbox as fl, expectedRoster as fm, openGroupMeta as fn, groupFileFallback as fo, cardLine as fp, normalizeAtprotoHandle as fr, encodeFileData as fs, decodeGroupEntryLink as ft, identityPresentationBytes as fu, enrollHelloFrame as fv, tryDecrypt as fx, TURN_PUT_WINDOW_MS as fy, APP_BUNDLE_MAGIC as g, handoffManifestFrames as g_, findEndpoint as ga, RELAY_REQUESTS_PER_MINUTE as gb, generateVapidKeys as gc, dhtFileElements as gd, canonicalUrl as gf, HTTP_SERVICE_PROTO as gg, HttpClient as gh, signDidDhtPacket as gi, DOMAIN_FILE_MAX_BYTES as gl, signCommit as gm, parseGroupMetaTag as gn, readGroupWant as go, checkStatusCard as gp, AtprotoProofError as gr, TYPING_FRAME as gs, knockIdentity as gt, isIdentityBinding as gu, readEnrollGrant as gv, sanitizeAvatar as gx, classifyTurnRead as gy, APP_BUNDLE_LIMITS as h, handoffHelloFrame as h_, fedimintRequestPayload as ha, PREVIOUS_DEFAULT_RELAYS as hb, encryptPushPayload as hc, DHT_FILE_CAPABILITY as hd, LINK_PREVIEW_LIMITS as hf, parseLinkRecords as hg, GhostlyHttpError as hh, resolveDidDht as hi, DNS_TYPE as hl, rosterHas as hm, parseGroupMetaStatement as hn, readGroupHave as ho, cardUrl as hp, AtprotoCid as hr, transferStalled as hs, groupEntryUrl as ht, identityStatementText as hu, formatEnrollDigits as hv, jpegSize$1 as hx, TURN_VISIBLE_MS as hy, appUpdateDecision as i, handoffBusyFrame as i_, invoiceCallbackUrl as ia, CHAT_RESERVE_PER_CHAT as ib, parseWakeFrame as ic, transportOrder as id, EDIT_SEND_LIMIT as if, parseCallSignal as ig, OFFER_LOOK_MS as ih, DID_DHT_VERSION as ii, SESSION_FRAME_MAX as il, LEGACY_GROUP_MEMBERS as im, groupDisplayName as in, parseEngineError as io, PR_STATES as ip, ATPROTO_FULL_SCOPE as ir, PAIRED_CALL_FRAME as is, rosterHash as it, IDENTITY_PROVIDER_ID as iu, ENROLL_GRANT as iv, identityFromSeedB64 as ix, deviceLinkSecret as iy, isAppPath as j, readHandoffCancel as j_, HANDLED_WAIT_MS as ja, BREAKER_ALL_DOWN_PROBE_MS as jb, appDataFrame as jc, RECORDING_TYPES as jd, REACTION_LIMITS as jf, HANDOFF_CANCEL_REASONS as jg, decodeChunk as jh, validatePaymentTarget as ji, recordsFromTxt as jl, sealPair as jm, verifySshSignature as jn, MESH_HUBS as jo, APP_STATEMENT_LIMITS as jp, DID_GHOSTLY_SERVICE as jr, typingKindOf as js, GROUP_REACTED_FRAME as jt, importedProof as ju, INVITE_VERSION as jv, toZ32 as jx, TURN_TTL as jy, findAppForbiddenKey as k, readHandoffAck as k_, EARLY_DIAL_JOIN_MS as ka, setLinkTraceSink as kb, appCloseFrame as kc, sanitizeMime as kd, REACTED_FRAME as kf, HANDOFF_BUSY_REASONS as kg, MAX_CHUNK_PAYLOAD_BYTES as kh, isWalletNetwork as ki, normalizeDomain as kl, openPair as km, sshKeyDigestHex as kn, readGroupSignal as ko, APP_NAME as kp, DID_DOCUMENT_MAX_BYTES as kr, typingActivity as ks, parseGroupWakeFrame as kt, STORAGE_ROOT as ku, INVITE_LINK_ORIGIN as kv, toBase64 as kx, TURN_SIGNED_BYTES as ky, checkAppListing as l, handoffDigest as l_, resolveLightningDestination as la, GROUP_BURST_ONE_LINK as lb, wakePayload as lc, DHT_TEXT_BYTES as ld, editedFrame as lf, LABEL$1 as lg, STALLED_LOOK_MS as lh, didDhtKey as li, HoldKeys as ll, SAID_AGAIN as lm, groupMetaTag as ln, GROUP_WANT_FRAME as lo, appCardId as lp, atprotoProofRkey as lr, FILE_FRAMES as ls, GROUP_ENTRY_PROFILE as lt, IdentityExchange as lu, enrollDigits as lv, encrypt as lx, verifyDeviceTransports as ly, signAppStore as m, handoffHaveFrames as m_, cashuRequestPayload as ma, HEDGE_MS as mb, decryptPushPayload as mc, peekDhtMailbox as md, LINK_MAX_CHARS as mf, isEmptyLinkPacket as mg, unusedInviteWait as mh, openDidDhtPayload as mi, DNS_LABEL as ml, rosterAdmin as mm, parseGroupMetaFrame as mn, readGroupFileMeta as mo, cardTimeUtc as mp, shortAtprotoDid as mr, transferEnded as ms, entryParams as mt, identityStatement as mu, enrollProofFrame as mv, MAX_AVATAR_SIDE as mx, TURN_SETTLE_MS as my, appRevocationFor as n, handoffAttemptFailed as n_, fetchLnurlJson as na, CHAT_RESERVE as nb, deviceWakeRequest as nc, rankTransports as nd, EDIT_RATE_WINDOW_MS as nf, heardCallSignal as ng, MAX_DHT_TEXT_BYTES as nh, DID_DHT_PREFIX as ni, PAIRED_PROFILE as nl, GROUP_MEMBER_CAP as nm, MAX_GROUP_PICTURE_LENGTH as nn, engineError as no, ITEM_STATES as np, varBytes as nr, validHead as ns, leaveStatement as nt, IDENTITY_MAX_VALIDITY as nu, ENROLL_CANCEL_REASONS as nv, createIdentity as nx, deviceLinkRendezvousSeed as ny, planAppUpdate as o, handoffContext as o_, parseLightningDestination as oa, DEPARTED_READS as ob, readWakePayload as oc, DHT_FILE_REFUSED as od, RateWindow as of, sdpHasCandidates as og, PRESENCE_HEARTBEAT as oh, decodeDidDhtPacket as oi, HOLD_CAPABILITY as ol, MAX_GROUP_MEMBERS as om, groupMetaChange as on, GROUP_FILE_LIMITS as oo, RUN_RESULTS as op, ATPROTO_PROOF_SCOPE as or, parsePairedCallFrame as os, signCommunity as ot, IDENTITY_STATEMENT_PREFIX as ou, ENROLL_PROOF as ov, sign as ox, newDeviceSetSecret as oy, readAppStoreSteps as p, handoffFileRequestFrame as p_, ENDPOINT as pa, HEDGE_MISSING_MS as pb, checkPushEndpoint as pc, emptyDhtDeliveryState as pd, validEditNumber as pf, emptyLinkRecords as pg, presenceSeenAt as ph, jwkThumbprint as pi, readManifest as pl, rememberAlone as pm, parseGroupMetaBody as pn, isGroupMessageId as po, cardLinkHost as pp, parseAtprotoDidDocument as pr, refusalText as ps, encodeGroupEntryLink as pt, identityRevocationValue as pu, enrollMessage as pv, MAX_AVATAR_LENGTH as px, TURN_RAISE_READ_TIMEOUT_MS as py, communityCommitHash as q, encodeSetSlots as q_, SWITCH_RETIRE_MS as qa, newerPacket as qb, SERVICES_CAPABILITY as qc, VIDEO_LIMITS as qd, REPLY_LIMITS as qf, HANDOFF_TIMINGS as qg, PAIRED_CALL_CANDIDATES as qh, pubkyProofCapability as qi, dialDescriptors as ql, directBlocked as qm, decodeTx as qn, mergeBeacon as qo, signAppRevocation as qp, normalizeDid as qr, DEVICE_WAKE_TTL_SECONDS as qs, MENTION_EVERYONE as qt, validRingKey as qu, DEVICE_PING_FRAME as qv, turnPacket as qy, appStoreDecision as r, handoffAttemptSucceeded as r_, findLightningDestination as ra, CHAT_RESERVE_MOST_SHARE as rb, newWakeToken as rc, relayedTransports as rd, EDIT_RECEIVE_LIMIT as rf, isGlobalIpv4Host as rg, OFFER_FAST_MS as rh, DID_DHT_TTL as ri, PairedSession as rl, GROUP_VERSION_LARGE as rm, encodeGroupMetaBody as rn, engineText as ro, PR_CHECKS as rp, ATPROTO_DECLARED_SCOPE as rr, MAX_PAIRED_CALL_SIGNAL as rs, leftStatement as rt, IDENTITY_PROOF_CAPABILITY as ru, ENROLL_DONE as rv, identityFromSeed as rx, deviceLinkSealKey as ry, APP_STORE_KINDS as s, handoffContextProof as s_, parsePayParams as sa, FRESH_READ_MS as sb, relayRequest as sc, DHT_FILE_TOO_LARGE as sd, dhtEditId as sf, signalHasVideo as sg, PRESENCE_WINDOW as sh, didDhtDocument as si, HOLD_DATED_BACK_MS as sl, MEMBER_KEY as sm, groupMetaNewer as sn, GROUP_HAVE_FRAME as so, STATUS_CARD_LIMITS as sp, atprotoDidMethod as sr, ChatFiles as ss, verifyCommunityChain as st, IDENTITY_SUBJECT as su, enrollCancelFrame as sv, verify as sx, signDeviceTransports as sy, addedAppPermissions as t, handoffAttemptAllowed as t_, LNURL_LIMITS as ta, BACKGROUND_WHILE_SIGNALING as tb, WakeLimiter as tc, irohRelayUrl as td, EDIT_FRAME as tf, extractParamsFromSdp as tg, LinkSession as th, DID_DHT_MAX_PAYLOAD as ti, sessionCapabilitiesFrame as tl, GROUP_ID as tm, MAX_GROUP_NAME_LENGTH as tn, EngineError as to, BUTTON_STYLES as tp, u64 as tr, shouldBeHub as ts, encodeCommunityLink as tt, IDENTITY_MAX_FRAME as tu, ENROLL_CANCEL as tv, readDnsName as tx, deviceLinkParams as ty, checkAppStoreIndex as u, handoffDoneFrame as u_, BOLT11_PATTERN as ua, GROUP_OVER_PACE_MS as ub, wakeRequest as uc, DHT_TEXT_REFUSED as ud, parseEditFrame as uf, MAX_MSGS_PAYLOAD_B64 as ug, TRANSPORTS_GONE_MS as uh, didDhtRecords as ui, HoldRefusedError as ul, commitHash as um, groupName as un, GROUP_WANT_NO_FRAME as uo, buttonLabelClash as up, checkAtprotoProofRecord as ur, FILE_LIMITS as us, KNOCK_TTL_MS as ut, boundVerifiedIdentity as uu, enrollDoneFrame as uv, generateEncryptionKey as ux, seedSigner as uy, APP_CLIENT_NAME as v, handoffPakeFrame as v_, parseCashuRequestPayload as va, RelayTransport as vb, vapidAuthorization as vc, readDhtFile as vd, linksIn as vf, MAX_SERVICES as vg, formatLocalTarget as vh, EVM_TEST_CHAINS as vi, DOMAIN_METHODS as vl, verifyChain as vm, verifyGroupMetaSignature as vn, CARRIED_DEFER_MS as vo, sameButtonText as vp, decodeAtprotoCommit as vr, TYPING_RATE_LIMIT as vs, mergeKnocks as vt, receivedIdentityStatus as vu, verifyEnrollProof as vv, hasVisible as vx, turnPutSummary as vy, appDigest as w, handoffVerifiedMessage as w_, CROSSED_PROBE_MS as wa, WATCH_SHARE as wb, APP_RATE_WINDOW_MS as wc, FileTransfers as wd, forwardedMany as wf, servicesFromWire as wg, viewerResponseHeaders as wh, USDT_PUBLIC_RPC as wi, domainTxtRecord as wl, decryptText as wm, SshSigError as wn, SIGNAL_FRESH_MS as wo, arrivalKey as wp, parseAtprotoVerificationKey as wr, TypingReceiver as ws, GROUP_WAKE_RECEIVE_LIMIT as wt, lastSharedWithMe as wu, deviceInviteJoinerParams as wv, concatBytes as wx, TURN_MAX as wy, APP_PERMISSIONS as x, handoffRetryAfter as x_, ANSWERS_REFUSED_PAUSE_MS as xa, SLOW_DEMOTE_MS as xb, APP_FRAME as xc, isImageMime as xd, sanitizePreviewImage as xf, encodeServices as xg, resolveTargetUrl as xh, SEPOLIA_TEST_USDT as xi, WELL_KNOWN_PATH as xl, GROUP_PROFILE as xm, SSHSIG_NAMESPACE as xn, GROUP_VERSION_SIGNALS as xo, taskProgress as xp, findInMst as xr, TYPING_SEND_LIMIT as xs, GROUP_WAKE_GROUP_LIMIT as xt, verifyIdentityPresentation as xu, DEVICE_INVITE_OWN_DEVICE as xv, stripHidden as xx, TURN_BODY_BYTES as xy, APP_FORBIDDEN_KEYS as y, handoffReleaseFrame as y_, parseFedimintRequestPayload as ya, SIGNALING_ALLOWANCE_SHARE as yb, vapidKeysMatch as yc, IMAGE_LIMITS as yd, parseLinkPreview as yf, SERVICES_VERSION as yg, parseLocalTarget as yh, ONCHAIN_PROVIDER as yi, DOMAIN_TXT_MAX_BYTES as yl, verifyCommit as ym, wrapGroupMeta as yn, CarriedTransport as yo, statusCardBytes as yp, decodeDagCbor as yr, TYPING_RATE_WINDOW_MS as ys, readKnocks as yt, revokesIdentity as yu, DEVICE_INVITE_BYTES as yv, sanitizeDisplayText as yx, TOMBSTONE_SEQUENCE as yy, GroupTypingBoard as z, readHandoffRelease as z_, PAIRING_RETRY_MS as za, isDiscoveryBudgetError as zb, BUTTONS_CAPABILITY as zc, parseVoiceMeta as zd, reactionFrame as zf, HANDOFF_LIST_PER_FRAME as zg, RTC_SIGNAL_FUTURE_MS as zh, BITCOIN_NETWORKS as zi, CAPS_LIMITS as zl, GATHER_STALL_MS as zm, bip322ToSpend as zn, COMMUNITY_TOPOLOGY as zo, isAppKey as zp, didGhostlyServiceEntry as zr, nextPinNumber as zs, GROUP_EDIT_FRAME as zt, storageProofPath as zu, inviteOwnership as zv, readTurnPacket as zy };
|
|
31295
32065
|
|
|
31296
|
-
//# sourceMappingURL=src-
|
|
32066
|
+
//# sourceMappingURL=src-CXmIA8pL.js.map
|