@ghostlytools/cli 1.7.3 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -13
- package/SKILL.md +5 -3
- package/dist/assets/{api-B42F9ytB.js → api-Chhvpwok.js} +2 -2
- package/dist/assets/{api-tf-wAAnB.js → api-D3i2hwy0.js} +142 -84
- package/dist/assets/api-D3i2hwy0.js.map +1 -0
- package/dist/assets/{apiKit-DJb9hulp.js → apiKit-BtsHrnoo.js} +30 -7
- package/dist/assets/apiKit-BtsHrnoo.js.map +1 -0
- package/dist/assets/{apps-BfoDISRg.js → apps-BFJTqvAt.js} +1 -1
- package/dist/assets/{apps-DIrWmLgL.js → apps-BHl97rHs.js} +10 -8
- package/dist/assets/apps-BHl97rHs.js.map +1 -0
- package/dist/assets/{arkade-CJAhhgPQ.js → arkade-BFE8KkEE.js} +2 -2
- package/dist/assets/{arkade-CJAhhgPQ.js.map → arkade-BFE8KkEE.js.map} +1 -1
- package/dist/assets/{backup-BkUeeduy.js → backup-Bbsr6nDi.js} +1 -1
- package/dist/assets/{backup-Bko-AAm0.js → backup-CxACdtQX.js} +7 -7
- package/dist/assets/{backup-Bko-AAm0.js.map → backup-CxACdtQX.js.map} +1 -1
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
- package/dist/assets/{blobFiles-Bckz9fjp.js → blobFiles-DOQDRdDI.js} +3 -3
- package/dist/assets/{blobFiles-Bckz9fjp.js.map → blobFiles-DOQDRdDI.js.map} +1 -1
- package/dist/assets/{buttons-DeA6Yddq.js → buttons-CieBtXEO.js} +4 -4
- package/dist/assets/{buttons-DeA6Yddq.js.map → buttons-CieBtXEO.js.map} +1 -1
- package/dist/assets/buttons-YtAj3R_E.js +2 -0
- package/dist/assets/{daemonProof-Bp9lJDxf.js → daemonProof-QmtwDj-N.js} +2 -2
- package/dist/assets/{daemonProof-Bp9lJDxf.js.map → daemonProof-QmtwDj-N.js.map} +1 -1
- package/dist/assets/{envelope-Cz5fc7BM.js → envelope-DYiGwzq_.js} +2 -2
- package/dist/assets/{envelope-Cz5fc7BM.js.map → envelope-DYiGwzq_.js.map} +1 -1
- package/dist/assets/{errors-mnjSQlbX.js → errors-QUGP-jIF.js} +2 -2
- package/dist/assets/errors-QUGP-jIF.js.map +1 -0
- package/dist/assets/{fileBytes-OolN5cSY.js → fileBytes-BPDKufla.js} +1 -1
- package/dist/assets/{fileBytes-BD0v3rRG.js → fileBytes-DNgrRL0R.js} +3 -3
- package/dist/assets/{fileBytes-BD0v3rRG.js.map → fileBytes-DNgrRL0R.js.map} +1 -1
- package/dist/assets/{fileBytes-_fd-2JRY.js → fileBytes-Q3ehcEr8.js} +2 -2
- package/dist/assets/{fileBytes-_fd-2JRY.js.map → fileBytes-Q3ehcEr8.js.map} +1 -1
- package/dist/assets/fileBytesIdb-DZcESfTt.js +2 -0
- package/dist/assets/{fileBytesIdb-NtA8r9EM.js → fileBytesIdb-Dm1EyEbT.js} +3 -3
- package/dist/assets/{fileBytesIdb-NtA8r9EM.js.map → fileBytesIdb-Dm1EyEbT.js.map} +1 -1
- package/dist/assets/{fileBytesOpfs-B8fJwkwM.js → fileBytesOpfs-ZGD21c4Q.js} +3 -3
- package/dist/assets/{fileBytesOpfs-B8fJwkwM.js.map → fileBytesOpfs-ZGD21c4Q.js.map} +1 -1
- package/dist/assets/{groupFiles-BlZRBWpt.js → groupFiles-CBJIEvCE.js} +22 -10
- package/dist/assets/groupFiles-CBJIEvCE.js.map +1 -0
- package/dist/assets/{host-BX0DmKW6.js → host-Va-r_KJz.js} +54 -16
- package/dist/assets/host-Va-r_KJz.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-DitYDnXx.js → hyperdhtRelay-B2uK9tJv.js} +2 -2
- package/dist/assets/{hyperdhtRelay-DitYDnXx.js.map → hyperdhtRelay-B2uK9tJv.js.map} +1 -1
- package/dist/assets/{idb-BlH8-O3R.js → idb-BkOJES5_.js} +5 -3
- package/dist/assets/idb-BkOJES5_.js.map +1 -0
- package/dist/assets/{irohWeb-R3bcd34h.js → irohWeb-DxeEgQ-W.js} +2 -2
- package/dist/assets/{irohWeb-R3bcd34h.js.map → irohWeb-DxeEgQ-W.js.map} +1 -1
- package/dist/assets/{main-6QOSvQ8b.js → main-BX4oPWCJ.js} +362 -110
- package/dist/assets/main-BX4oPWCJ.js.map +1 -0
- package/dist/assets/{mainline-BfwezHWi.js → mainline-IfWQOB-J.js} +39 -12
- package/dist/assets/mainline-IfWQOB-J.js.map +1 -0
- package/dist/assets/{networkReason-Ba9415nn.js → networkReason-N2vAaoth.js} +3 -3
- package/dist/assets/{networkReason-Ba9415nn.js.map → networkReason-N2vAaoth.js.map} +1 -1
- package/dist/assets/{nwc-ovXSN2M2.js → nwc-CzyCtNK2.js} +3 -3
- package/dist/assets/{nwc-ovXSN2M2.js.map → nwc-CzyCtNK2.js.map} +1 -1
- package/dist/assets/{nwcProvider-BzZbfFP3.js → nwcProvider-DjWmEn3j.js} +2 -2
- package/dist/assets/{nwcProvider-BzZbfFP3.js.map → nwcProvider-DjWmEn3j.js.map} +1 -1
- package/dist/assets/{profiles-C6XWqre5.js → profiles-DcCeOi7J.js} +104 -10
- package/dist/assets/profiles-DcCeOi7J.js.map +1 -0
- package/dist/assets/{registry-CFtlhWCI.js → registry-BmS02J5h.js} +1 -1
- package/dist/assets/{registry-B0Uv9yL6.js → registry-CeW8XEQc.js} +45 -14
- package/dist/assets/registry-CeW8XEQc.js.map +1 -0
- package/dist/assets/{resolve-BzFG4WDU.js → resolve-BvHkAhDH.js} +66 -29
- package/dist/assets/resolve-BvHkAhDH.js.map +1 -0
- package/dist/assets/{restoredRows-Fv-MuY45.js → restoredRows-mTTp3XNs.js} +2 -2
- package/dist/assets/{restoredRows-Fv-MuY45.js.map → restoredRows-mTTp3XNs.js.map} +1 -1
- package/dist/assets/{server-BGCuHbmQ.js → server-BUcJo4vz.js} +779 -239
- package/dist/assets/server-BUcJo4vz.js.map +1 -0
- package/dist/assets/{src-DWw2hUE5.js → src-BB5-5P3s.js} +540 -159
- package/dist/assets/src-BB5-5P3s.js.map +1 -0
- package/dist/assets/{translate-DObb-1tq.js → translate-2WyaRVCr.js} +11 -9
- package/dist/assets/translate-2WyaRVCr.js.map +1 -0
- package/dist/assets/{usdt-Bkva90Vo.js → usdt-BLazHiaP.js} +3 -3
- package/dist/assets/{usdt-Bkva90Vo.js.map → usdt-BLazHiaP.js.map} +1 -1
- package/dist/assets/{words-odSAoasK.js → words-BaumxjXe.js} +3 -3
- package/dist/assets/words-BaumxjXe.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-tf-wAAnB.js.map +0 -1
- package/dist/assets/apiKit-DJb9hulp.js.map +0 -1
- package/dist/assets/apps-DIrWmLgL.js.map +0 -1
- package/dist/assets/buttons-Be7u0V5g.js +0 -2
- package/dist/assets/errors-mnjSQlbX.js.map +0 -1
- package/dist/assets/fileBytesIdb-CsSQcSxD.js +0 -2
- package/dist/assets/groupFiles-BlZRBWpt.js.map +0 -1
- package/dist/assets/host-BX0DmKW6.js.map +0 -1
- package/dist/assets/idb-BlH8-O3R.js.map +0 -1
- package/dist/assets/main-6QOSvQ8b.js.map +0 -1
- package/dist/assets/mainline-BfwezHWi.js.map +0 -1
- package/dist/assets/profiles-C6XWqre5.js.map +0 -1
- package/dist/assets/registry-B0Uv9yL6.js.map +0 -1
- package/dist/assets/resolve-BzFG4WDU.js.map +0 -1
- package/dist/assets/server-BGCuHbmQ.js.map +0 -1
- package/dist/assets/src-DWw2hUE5.js.map +0 -1
- package/dist/assets/translate-DObb-1tq.js.map +0 -1
- package/dist/assets/words-odSAoasK.js.map +0 -1
|
@@ -905,6 +905,64 @@ var firstWriter = (who) => !who.write || who.background ? null : who.group ? "gr
|
|
|
905
905
|
/** A key's turn neither asked nor read in the last minute: it is dropped, and asking again starts a new one (`TURNS_PRUNE_MS`). */
|
|
906
906
|
var staleTurn = (turn, now) => now - Math.max(turn.askedAt, turn.servedAt) >= 6e4;
|
|
907
907
|
/**
|
|
908
|
+
* Keys and when each was last set, those of the last minute: how many and the latest, without walking them all (the
|
|
909
|
+
* chats that need a relay, `chatNeeds`). Each is set at the time it is set, so the sets come oldest first; a clock
|
|
910
|
+
* gone back makes the later ones as of now.
|
|
911
|
+
*/
|
|
912
|
+
var RecentKeys = class {
|
|
913
|
+
at = /* @__PURE__ */ new Map();
|
|
914
|
+
/** Every set, oldest first, from `head`; one a later set or a delete replaced is skipped. */
|
|
915
|
+
order = [];
|
|
916
|
+
head = 0;
|
|
917
|
+
set(key, now) {
|
|
918
|
+
this.prune(now);
|
|
919
|
+
this.at.set(key, now);
|
|
920
|
+
this.order.push([key, now]);
|
|
921
|
+
}
|
|
922
|
+
delete(key) {
|
|
923
|
+
this.at.delete(key);
|
|
924
|
+
}
|
|
925
|
+
size(now) {
|
|
926
|
+
this.prune(now);
|
|
927
|
+
return this.at.size;
|
|
928
|
+
}
|
|
929
|
+
/** When the key set last was, -Infinity with none in the last minute. */
|
|
930
|
+
latest(now) {
|
|
931
|
+
this.prune(now);
|
|
932
|
+
while (this.order.length > this.head) {
|
|
933
|
+
const [key, at] = this.order[this.order.length - 1];
|
|
934
|
+
if (this.at.get(key) === at) return at;
|
|
935
|
+
this.order.pop();
|
|
936
|
+
}
|
|
937
|
+
return -Infinity;
|
|
938
|
+
}
|
|
939
|
+
/** The keys set in the last minute, oldest first. */
|
|
940
|
+
*entries(now) {
|
|
941
|
+
this.prune(now);
|
|
942
|
+
for (let i = this.head; i < this.order.length; i++) if (this.at.get(this.order[i][0]) === this.order[i][1]) yield this.order[i];
|
|
943
|
+
}
|
|
944
|
+
/** Drops the keys set a minute ago or more. */
|
|
945
|
+
prune(now) {
|
|
946
|
+
if (this.order.length > this.head && now < this.order[this.order.length - 1][1]) {
|
|
947
|
+
for (const [key, at] of this.at) this.at.set(key, Math.min(at, now));
|
|
948
|
+
this.order = [...this.at].sort((a, b) => a[1] - b[1]);
|
|
949
|
+
this.head = 0;
|
|
950
|
+
}
|
|
951
|
+
while (this.head < this.order.length) {
|
|
952
|
+
const [key, at] = this.order[this.head];
|
|
953
|
+
if (this.at.get(key) === at) {
|
|
954
|
+
if (now - at < 6e4) break;
|
|
955
|
+
this.at.delete(key);
|
|
956
|
+
}
|
|
957
|
+
this.head++;
|
|
958
|
+
}
|
|
959
|
+
if (this.head > 64 && this.head * 2 > this.order.length) {
|
|
960
|
+
this.order = this.order.slice(this.head);
|
|
961
|
+
this.head = 0;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
/**
|
|
908
966
|
* Public Pkarr relays. They are generic Pkarr infrastructure (an HTTP bridge to
|
|
909
967
|
* the Mainline DHT), not a Ghostly backend: they only ever see signed,
|
|
910
968
|
* encrypted packets. Every client uses this list: the browser clients read and
|
|
@@ -1227,9 +1285,11 @@ var RelayTransport = class {
|
|
|
1227
1285
|
/**
|
|
1228
1286
|
* Per key a 1:1 chat asks for: when it last read urgently (for the next minute, groups leave it `CHAT_RESERVE` on
|
|
1229
1287
|
* every relay) and when the budget last refused it on each relay (the same, on that relay). A read of the key at a
|
|
1230
|
-
* slow pace (the chat is live, or back in the background) drops it: `CHAT_RESERVE`.
|
|
1288
|
+
* slow pace (the chat is live, or back in the background) drops it: `CHAT_RESERVE`. Per relay, the later of the two
|
|
1289
|
+
* for each key (`chatNeed`); `chatUrgentAt` keeps the urgent ones for a relay not asked yet.
|
|
1231
1290
|
*/
|
|
1232
1291
|
chatNeeds = /* @__PURE__ */ new Map();
|
|
1292
|
+
chatUrgentAt = new RecentKeys();
|
|
1233
1293
|
/** When a link (a chat's or a group's) last asked urgently: background requests yield for `SIGNALING_WINDOW_MS`. */
|
|
1234
1294
|
urgentAt = -Infinity;
|
|
1235
1295
|
/** Timestamp of the last packet sent to each relay, per key: the compare-and-swap value for the next one. */
|
|
@@ -1636,7 +1696,7 @@ var RelayTransport = class {
|
|
|
1636
1696
|
*/
|
|
1637
1697
|
async resolve(pubKeyZ32, options = {}, keptOnFailure = true) {
|
|
1638
1698
|
if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
|
|
1639
|
-
if (options.background && !options.urgent && !options.group) this.
|
|
1699
|
+
if (options.background && !options.urgent && !options.group) this.chatNeedLapsed(pubKeyZ32);
|
|
1640
1700
|
const readAt = this.readAt.get(pubKeyZ32);
|
|
1641
1701
|
if (readAt !== void 0 && Date.now() - readAt < this.freshReadMs) return this.newest.get(pubKeyZ32) ?? null;
|
|
1642
1702
|
const order = this.readOrder(pubKeyZ32);
|
|
@@ -1992,13 +2052,13 @@ var RelayTransport = class {
|
|
|
1992
2052
|
const writer = firstWriter(who);
|
|
1993
2053
|
if (who.urgent && !who.background) {
|
|
1994
2054
|
this.urgentAt = now;
|
|
1995
|
-
if (isChat(who)) this.chatNeed(key
|
|
2055
|
+
if (isChat(who)) this.chatNeed(key, now);
|
|
1996
2056
|
}
|
|
1997
2057
|
if (isGroupRead(who) || isChatWatch(who)) this.readAsked(key, who, now);
|
|
1998
2058
|
if (isTurnRead(who)) this.turnAsked(key, who, now);
|
|
1999
2059
|
if (this.heldFor(relay, who, now, key) > 0) {
|
|
2000
2060
|
if (isGroupRead(who) && (this.spent.get(relay)?.length ?? 0) >= this.limitOf(relay)) this.groupsFullAt.set(relay, now);
|
|
2001
|
-
if (isChat(who)) this.chatNeed(key
|
|
2061
|
+
if (isChat(who)) this.chatNeed(key, now, relay);
|
|
2002
2062
|
if (writer) this.writeWaiting.set(`${writer} ${relay}`, now);
|
|
2003
2063
|
return false;
|
|
2004
2064
|
}
|
|
@@ -2203,25 +2263,36 @@ var RelayTransport = class {
|
|
|
2203
2263
|
for (const [other, reads] of this.departedOver) if (now - reads[reads.length - 1] >= 6e4) this.departedOver.delete(other);
|
|
2204
2264
|
this.departedOver.set(key, [...this.departedOver.get(key) ?? [], now]);
|
|
2205
2265
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
if (
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2266
|
+
/** A chat's request of `key` asked urgently (it needs every relay), or the budget refused it on `relay` (it needs that one). */
|
|
2267
|
+
chatNeed(key, now, relay) {
|
|
2268
|
+
if (relay !== void 0) {
|
|
2269
|
+
this.chatNeedsOn(relay, now).set(key, now);
|
|
2270
|
+
return;
|
|
2271
|
+
}
|
|
2272
|
+
this.chatUrgentAt.set(key, now);
|
|
2273
|
+
for (const needs of this.chatNeeds.values()) needs.set(key, now);
|
|
2213
2274
|
}
|
|
2214
|
-
/**
|
|
2215
|
-
|
|
2216
|
-
let
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
continue;
|
|
2221
|
-
}
|
|
2222
|
-
until = Math.max(until, need.urgentAt, need.refused.get(relay) ?? -Infinity);
|
|
2275
|
+
/** The chats that need this relay: those a request of was refused there, and the urgent ones. */
|
|
2276
|
+
chatNeedsOn(relay, now) {
|
|
2277
|
+
let needs = this.chatNeeds.get(relay);
|
|
2278
|
+
if (!needs) {
|
|
2279
|
+
this.chatNeeds.set(relay, needs = new RecentKeys());
|
|
2280
|
+
for (const [key, at] of this.chatUrgentAt.entries(now)) needs.set(key, at);
|
|
2223
2281
|
}
|
|
2224
|
-
return
|
|
2282
|
+
return needs;
|
|
2283
|
+
}
|
|
2284
|
+
/** The chat reading `key` has nothing due: it needs no relay any more. */
|
|
2285
|
+
chatNeedLapsed(key) {
|
|
2286
|
+
this.chatUrgentAt.delete(key);
|
|
2287
|
+
for (const needs of this.chatNeeds.values()) needs.delete(key);
|
|
2288
|
+
}
|
|
2289
|
+
/**
|
|
2290
|
+
* How long groups still leave a chat its reserve on this relay (`CHAT_RESERVE`); a chat's need a minute old goes.
|
|
2291
|
+
* Kept up to date as needs come and go (`RecentKeys`): walking them all for each request cost a daemon with 500
|
|
2292
|
+
* contacts away 2.7 s of CPU per 10 idle minutes (bug hunt, 2026-11-01).
|
|
2293
|
+
*/
|
|
2294
|
+
chatReservedFor(relay, now) {
|
|
2295
|
+
return this.chatNeedsOn(relay, now).latest(now) + 6e4 - now;
|
|
2225
2296
|
}
|
|
2226
2297
|
/**
|
|
2227
2298
|
* How long a chat's packet another relay already took waits for this one: while chats need the relays, a copy takes
|
|
@@ -2242,8 +2313,7 @@ var RelayTransport = class {
|
|
|
2242
2313
|
}
|
|
2243
2314
|
/** What the chats that need the relays keep on this relay (`CHAT_RESERVE_PER_CHAT`), never less than `reserveOf`. */
|
|
2244
2315
|
chatReserveOf(relay, now) {
|
|
2245
|
-
|
|
2246
|
-
for (const need of this.chatNeeds.values()) if (now - Math.max(need.urgentAt, need.refused.get(relay) ?? -Infinity) < 6e4) needing++;
|
|
2316
|
+
const needing = this.chatNeedsOn(relay, now).size(now);
|
|
2247
2317
|
return Math.max(this.reserveOf(relay), Math.min(needing * 3, Math.floor(this.limitOf(relay) * CHAT_RESERVE_MOST_SHARE)));
|
|
2248
2318
|
}
|
|
2249
2319
|
/** What groups leave a chat on this relay: `CHAT_RESERVE`, or a third of a smaller budget. */
|
|
@@ -3899,14 +3969,38 @@ function webpSize(b) {
|
|
|
3899
3969
|
if (ascii(b, 12, "VP8X")) return sized(u24le(b, 24) + 1, u24le(b, 27) + 1);
|
|
3900
3970
|
}
|
|
3901
3971
|
/**
|
|
3972
|
+
* A GIF's size as it is decoded: its logical screen, or as far as its first frame reaches past it (a browser decodes
|
|
3973
|
+
* the first frame whole, at its own size, however small the screen says it is). Undefined when its first frame is not
|
|
3974
|
+
* in these bytes: what it would be drawn at is not known.
|
|
3975
|
+
*/
|
|
3976
|
+
function gifSize(b) {
|
|
3977
|
+
if (b.length < 13) return void 0;
|
|
3978
|
+
const screenWidth = u16le(b, 6), screenHeight = u16le(b, 8);
|
|
3979
|
+
let at = 13 + (b[10] & 128 ? 3 * (2 << (b[10] & 7)) : 0);
|
|
3980
|
+
while (at < b.length) {
|
|
3981
|
+
const block = b[at];
|
|
3982
|
+
if (block === 44) {
|
|
3983
|
+
if (at + 9 > b.length) return void 0;
|
|
3984
|
+
const left = u16le(b, at + 1), top = u16le(b, at + 3), width = u16le(b, at + 5), height = u16le(b, at + 7);
|
|
3985
|
+
return sized(Math.max(screenWidth, left + width), Math.max(screenHeight, top + height));
|
|
3986
|
+
}
|
|
3987
|
+
if (block === 59) return sized(screenWidth, screenHeight);
|
|
3988
|
+
if (block !== 33 || at + 2 > b.length) return void 0;
|
|
3989
|
+
at += 2;
|
|
3990
|
+
while (at < b.length && b[at] !== 0) at += 1 + b[at];
|
|
3991
|
+
at++;
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3902
3995
|
* A picture's size as it is shown, read from its first bytes (PNG, JPEG, GIF, WebP), or undefined when they do not
|
|
3903
|
-
* say. Only the header is read: a JPEG whose frame header
|
|
3996
|
+
* say. Only the header is read: a JPEG whose frame header, or a GIF whose first frame, sits past
|
|
3997
|
+
* `IMAGE_LIMITS.headBytes` goes without.
|
|
3904
3998
|
*/
|
|
3905
3999
|
function imageSize(head) {
|
|
3906
4000
|
const b = head;
|
|
3907
4001
|
try {
|
|
3908
4002
|
if (b.length >= 24 && b[0] === 137 && ascii(b, 1, "PNG\r\n\n") && ascii(b, 12, "IHDR")) return sized(u32be(b, 16), u32be(b, 20));
|
|
3909
|
-
if (b.length >= 10 && (ascii(b, 0, "GIF87a") || ascii(b, 0, "GIF89a"))) return
|
|
4003
|
+
if (b.length >= 10 && (ascii(b, 0, "GIF87a") || ascii(b, 0, "GIF89a"))) return gifSize(b);
|
|
3910
4004
|
if (b.length >= 4 && b[0] === 255 && b[1] === 216 && b[2] === 255) return jpegSize(b);
|
|
3911
4005
|
if (b.length >= 16 && ascii(b, 0, "RIFF") && ascii(b, 8, "WEBP")) return webpSize(b);
|
|
3912
4006
|
} catch {}
|
|
@@ -4368,7 +4462,7 @@ function isAppUrl(value) {
|
|
|
4368
4462
|
return false;
|
|
4369
4463
|
}
|
|
4370
4464
|
if (url.protocol !== "https:" || url.username || url.password || !url.hostname) return false;
|
|
4371
|
-
const host = url.hostname.toLowerCase();
|
|
4465
|
+
const host = url.hostname.toLowerCase().replace(/\.+$/, "");
|
|
4372
4466
|
if (host === "jsdelivr.net" || host.endsWith(".jsdelivr.net")) return host === "cdn.jsdelivr.net" && /^\/gh\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@[0-9a-f]{40}\/./.test(url.pathname);
|
|
4373
4467
|
return true;
|
|
4374
4468
|
}
|
|
@@ -10381,11 +10475,25 @@ var LINK_CLOSERS = {
|
|
|
10381
10475
|
"}": "{"
|
|
10382
10476
|
};
|
|
10383
10477
|
/**
|
|
10384
|
-
*
|
|
10385
|
-
*
|
|
10386
|
-
*
|
|
10478
|
+
* Punctuation a sentence in Chinese, Japanese or Arabic puts right after a link, with no space: the ideographic comma
|
|
10479
|
+
* and full stop, the full-width ! , : ; ? and brackets, the corner quotes, the Arabic comma, semicolon and question
|
|
10480
|
+
* mark, the Urdu full stop. No address holds one as typed, so a link stops at the first.
|
|
10481
|
+
*/
|
|
10482
|
+
var LINK_STOP = /[、。〈-】!(),:;?،؛؟۔]/;
|
|
10483
|
+
/** What a link leaves out at its end: a sentence's punctuation ("…", "»", "”" too), never a path's "/". */
|
|
10484
|
+
var LINK_TRAILING = /[.,;:!?'"*_>…»’”]/;
|
|
10485
|
+
/** A link up to the first `LINK_STOP`: "https://x.example/a。" opens /a, not /a%E3%80%82. */
|
|
10486
|
+
function linkStop(url) {
|
|
10487
|
+
const at = url.search(LINK_STOP);
|
|
10488
|
+
return at < 0 ? url : url.slice(0, at);
|
|
10489
|
+
}
|
|
10490
|
+
/**
|
|
10491
|
+
* A link ends where the sentence around it takes over: trailing punctuation ("see https://x.example/a.", in any of
|
|
10492
|
+
* the app's languages) and a closing bracket or quote the link did not open ("(https://x.example/a)") are left as
|
|
10493
|
+
* text. The same rule as the message bubble's links.
|
|
10387
10494
|
*/
|
|
10388
|
-
function linkEnd(
|
|
10495
|
+
function linkEnd(whole) {
|
|
10496
|
+
const url = linkStop(whole);
|
|
10389
10497
|
const count = {
|
|
10390
10498
|
"(": 0,
|
|
10391
10499
|
")": 0,
|
|
@@ -10399,7 +10507,7 @@ function linkEnd(url) {
|
|
|
10399
10507
|
while (end > 0) {
|
|
10400
10508
|
const last = url[end - 1];
|
|
10401
10509
|
const opener = LINK_CLOSERS[last];
|
|
10402
|
-
if (
|
|
10510
|
+
if (!LINK_TRAILING.test(last) && !(opener && count[last] > count[opener])) break;
|
|
10403
10511
|
if (opener) count[last]--;
|
|
10404
10512
|
end--;
|
|
10405
10513
|
}
|
|
@@ -10409,7 +10517,7 @@ function linkEnd(url) {
|
|
|
10409
10517
|
var LINK_MAX_CHARS = 4096;
|
|
10410
10518
|
/** The http(s) links of a text, in order, each ending as the bubble ends it. */
|
|
10411
10519
|
function linksIn(text) {
|
|
10412
|
-
return [...text.matchAll(/https?:\/\/\S+/
|
|
10520
|
+
return [...text.matchAll(/https?:\/\/\S+/gi)].filter((match) => match[0].length <= LINK_MAX_CHARS).map((match) => linkEnd(match[0])).filter((url) => url.length > 8);
|
|
10413
10521
|
}
|
|
10414
10522
|
/**
|
|
10415
10523
|
* The link as a preview names it: parsed, http(s) only, without tracking parameters (`utm_*`, `fbclid`, …). The
|
|
@@ -10836,6 +10944,17 @@ var BLANK = /[\u034F\u115F\u1160\u2800\u3164\uFFA0]/gu;
|
|
|
10836
10944
|
*/
|
|
10837
10945
|
var SPACE_RUN = /(?:\s\p{M}*)+/gu;
|
|
10838
10946
|
/**
|
|
10947
|
+
* A run of characters meant to draw nothing (variation selectors, the Khmer inherent vowels, the Mongolian free
|
|
10948
|
+
* variation selectors). WebKit draws some of them as wide blanks after a letter, so "Invoice.pdf" + 150 of one +
|
|
10949
|
+
* ".exe" reads as a PDF there. A letter keeps one variation selector (its variant form); the rest go.
|
|
10950
|
+
*/
|
|
10951
|
+
var IGNORABLE_RUN = /\p{Default_Ignorable_Code_Point}+/gu;
|
|
10952
|
+
var VARIATION_SELECTOR = /^\p{Variation_Selector}/u;
|
|
10953
|
+
function dropIgnorable(run, offset, text) {
|
|
10954
|
+
const kept = VARIATION_SELECTOR.exec(run)?.[0];
|
|
10955
|
+
return kept && offset > 0 && !/\s/u.test(text[offset - 1]) ? kept : "";
|
|
10956
|
+
}
|
|
10957
|
+
/**
|
|
10839
10958
|
* Names Windows keeps for devices, whatever the case, with any extension, and with spaces before the dot:
|
|
10840
10959
|
* "CON", "nul.txt", "COM1 .log" open a device there, not a file.
|
|
10841
10960
|
*/
|
|
@@ -10852,7 +10971,7 @@ function shorten(name) {
|
|
|
10852
10971
|
}
|
|
10853
10972
|
/** A file name is display text and a download suggestion, never a path. */
|
|
10854
10973
|
function sanitizeFileName(name) {
|
|
10855
|
-
const clean = shorten(name.replace(INVISIBLE, "").replace(BLANK, "").replace(/[/\\:]/g, "").replace(SPACE_RUN, " ").replace(/^[\s.]+/, "").trim());
|
|
10974
|
+
const clean = shorten(name.replace(INVISIBLE, "").replace(BLANK, "").replace(/[/\\:]/g, "").replace(IGNORABLE_RUN, dropIgnorable).replace(SPACE_RUN, " ").replace(/^[\s.]+/, "").trim());
|
|
10856
10975
|
if (WINDOWS_DEVICE.test(clean)) return shorten("_" + clean);
|
|
10857
10976
|
return clean || "file";
|
|
10858
10977
|
}
|
|
@@ -13048,6 +13167,14 @@ var TransportSwitch = class {
|
|
|
13048
13167
|
};
|
|
13049
13168
|
var enc = base64urlnopad.encode;
|
|
13050
13169
|
var dec = base64urlnopad.decode;
|
|
13170
|
+
/** No bytes for text that is not base64url: the checks then refuse it with their own message. */
|
|
13171
|
+
var decOrEmpty = (s) => {
|
|
13172
|
+
try {
|
|
13173
|
+
return dec(s);
|
|
13174
|
+
} catch {
|
|
13175
|
+
return /* @__PURE__ */ new Uint8Array(0);
|
|
13176
|
+
}
|
|
13177
|
+
};
|
|
13051
13178
|
var hash = (s) => enc(sha256(utf8Encode(s)));
|
|
13052
13179
|
var header = enc(utf8Encode(JSON.stringify({
|
|
13053
13180
|
alg: "EdDSA",
|
|
@@ -13067,8 +13194,14 @@ function verifyRingAuthorization(authorization, statement, issuer, issuedAt, exp
|
|
|
13067
13194
|
if (typeof authorization !== "string" || authorization.length > 2400) throw new Error("Invalid Ring authorization");
|
|
13068
13195
|
const [h, p, s, ...extra] = authorization.split(".");
|
|
13069
13196
|
if (extra.length || h !== header || !p || !s) throw new Error("Unsupported Ring authorization");
|
|
13070
|
-
|
|
13071
|
-
|
|
13197
|
+
let claims;
|
|
13198
|
+
try {
|
|
13199
|
+
claims = JSON.parse(utf8Decode(dec(p)));
|
|
13200
|
+
} catch {
|
|
13201
|
+
throw new Error("Unsupported Ring authorization");
|
|
13202
|
+
}
|
|
13203
|
+
const sig = decOrEmpty(s);
|
|
13204
|
+
if (typeof claims?.cnf !== "string" || !validRingKey(claims.cnf) || expiresAt !== issuedAt + 600 || p !== enc(utf8Encode(JSON.stringify(ringClaims(statement, issuer, claims.cnf, issuedAt, expiresAt)))) || !validRingKey(issuer) || sig.length !== 64 || enc(sig) !== s || !ed25519.verify(sig, utf8Encode(h + "." + p), fromZ32(issuer), { zip215: false })) throw new Error("Ring did not authorize this exact conversation");
|
|
13072
13205
|
return claims;
|
|
13073
13206
|
}
|
|
13074
13207
|
function validRingKey(key) {
|
|
@@ -13094,7 +13227,7 @@ function evidenceId(authorization, signature) {
|
|
|
13094
13227
|
function verifyRingEvidence(e, statement, issuer, issuedAt, expiresAt) {
|
|
13095
13228
|
if (!e || e.scheme !== "pubky-ring/1" || typeof e.signature !== "string" || e.signature.length !== 86) throw new Error("Invalid Ring proof");
|
|
13096
13229
|
const claims = verifyRingAuthorization(e.authorization, statement, issuer, issuedAt, expiresAt);
|
|
13097
|
-
const sig =
|
|
13230
|
+
const sig = decOrEmpty(e.signature);
|
|
13098
13231
|
if (enc(sig) !== e.signature || e.id !== evidenceId(e.authorization, e.signature) || !ed25519.verify(sig, possession(e.authorization, statement), fromZ32(claims.cnf), { zip215: false })) throw new Error("Invalid delegated proof of possession");
|
|
13099
13232
|
}
|
|
13100
13233
|
//#endregion
|
|
@@ -13447,10 +13580,12 @@ function applyIdentityEvent(timeline, event, at) {
|
|
|
13447
13580
|
const i = lastOf(out, event.side, event.type === "result" ? [event.proof, event.requested] : [event.proof]);
|
|
13448
13581
|
const last = i >= 0 ? out[i] : void 0;
|
|
13449
13582
|
const add = (entry) => {
|
|
13450
|
-
const
|
|
13583
|
+
const prefix = `${entry.side}:${entry.proof}:`;
|
|
13584
|
+
let n = 0;
|
|
13585
|
+
for (const e of out) if (e.id.startsWith(prefix)) n = Math.max(n, Number(e.id.slice(prefix.length)) + 1 || 0);
|
|
13451
13586
|
out.push({
|
|
13452
13587
|
...entry,
|
|
13453
|
-
id: `${
|
|
13588
|
+
id: `${prefix}${n}`,
|
|
13454
13589
|
at
|
|
13455
13590
|
});
|
|
13456
13591
|
};
|
|
@@ -13641,13 +13776,19 @@ function verifyIdentityPresentation(key, sig, proofId, scope, nonce, issuedAt) {
|
|
|
13641
13776
|
}
|
|
13642
13777
|
var clean$1 = (value, max) => {
|
|
13643
13778
|
if (typeof value !== "string") return void 0;
|
|
13644
|
-
const text = value
|
|
13645
|
-
return text ? text.slice(0, max) : void 0;
|
|
13779
|
+
const text = stripHidden(value).trim();
|
|
13780
|
+
return text && hasVisible(text) ? text.slice(0, max) : void 0;
|
|
13646
13781
|
};
|
|
13782
|
+
/**
|
|
13783
|
+
* Room for a line that names a domain (up to 253 characters) once or twice: a How line or a reason cut inside the name
|
|
13784
|
+
* names a record that does not exist, and the app no longer knows the reason to say it in the person's language.
|
|
13785
|
+
*/
|
|
13786
|
+
var SOURCE_MAX = 640;
|
|
13787
|
+
var ERROR_MAX = 512;
|
|
13647
13788
|
/** Bounds a provider's result so a buggy provider cannot store or show arbitrary data. */
|
|
13648
13789
|
function boundVerifiedIdentity(v) {
|
|
13649
13790
|
if (!v || typeof v.subject !== "string" || !IDENTITY_SUBJECT.test(v.subject)) throw new Error("Provider returned an invalid subject");
|
|
13650
|
-
const source = clean$1(v.source,
|
|
13791
|
+
const source = clean$1(v.source, SOURCE_MAX);
|
|
13651
13792
|
if (!source) throw new Error("Provider did not say how it verified");
|
|
13652
13793
|
const out = {
|
|
13653
13794
|
subject: v.subject,
|
|
@@ -13701,7 +13842,10 @@ function receivedWithRoom(received, id, replaced, now) {
|
|
|
13701
13842
|
const out = kept.filter((r) => !drop.has(r));
|
|
13702
13843
|
return out.length < 16 ? out : void 0;
|
|
13703
13844
|
}
|
|
13704
|
-
var
|
|
13845
|
+
var REVOKED = "Its owner revoked this proof";
|
|
13846
|
+
/** Revoked is final: a later lookup that fails or finds nothing (the relays forgot it) does not undo it. */
|
|
13847
|
+
var revokedHere = (received, id) => received.some((r) => r.id === id && r.status === "revoked");
|
|
13848
|
+
var shortError = (e) => clean$1(e instanceof Error ? e.message : String(e), ERROR_MAX) ?? "Invalid proof";
|
|
13705
13849
|
/**
|
|
13706
13850
|
* A check this side could not finish because of what its own network did: a host it refused to contact, a server
|
|
13707
13851
|
* that did not answer or answered an error. The message is for this side only. The contact is told the proof could
|
|
@@ -13862,54 +14006,60 @@ var IdentityExchange = class {
|
|
|
13862
14006
|
const r = this.options.storage.read().received.find((x) => x.id === id);
|
|
13863
14007
|
if (!r) throw new Error("Unknown identity");
|
|
13864
14008
|
if (r.status === "revoked") return r;
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
|
-
type: "stopped",
|
|
13879
|
-
side: "theirs",
|
|
13880
|
-
proof: id,
|
|
13881
|
-
provider: r.binding.provider,
|
|
13882
|
-
subject: r.verified.subject,
|
|
13883
|
-
reason: "revoked"
|
|
13884
|
-
}));
|
|
13885
|
-
return next;
|
|
13886
|
-
}
|
|
14009
|
+
if (await this.options.revoked?.(identityStatement(r.binding)).catch(() => false)) return await this.settleRecheck(id, (x) => x.status === "revoked" ? x : {
|
|
14010
|
+
...x,
|
|
14011
|
+
status: "revoked",
|
|
14012
|
+
checkedAt: this.now(),
|
|
14013
|
+
error: void 0
|
|
14014
|
+
}, {
|
|
14015
|
+
type: "stopped",
|
|
14016
|
+
side: "theirs",
|
|
14017
|
+
proof: id,
|
|
14018
|
+
provider: r.binding.provider,
|
|
14019
|
+
subject: r.verified.subject,
|
|
14020
|
+
reason: "revoked"
|
|
14021
|
+
}) ?? r;
|
|
13887
14022
|
if (revocationOnly) return r;
|
|
14023
|
+
let outcome;
|
|
13888
14024
|
try {
|
|
13889
14025
|
const verified = boundVerifiedIdentity(await this.options.verify(identityStatement(r.binding), r.evidence));
|
|
13890
14026
|
if (verified.subject !== r.verified.subject) throw new Error("The identity changed");
|
|
13891
|
-
|
|
13892
|
-
...
|
|
14027
|
+
outcome = (x) => ({
|
|
14028
|
+
...x,
|
|
13893
14029
|
verified: {
|
|
13894
14030
|
...verified,
|
|
13895
|
-
display: verified.display ??
|
|
14031
|
+
display: verified.display ?? x.verified.display
|
|
13896
14032
|
},
|
|
13897
14033
|
checkedAt: this.now(),
|
|
13898
|
-
status:
|
|
14034
|
+
status: "verified",
|
|
13899
14035
|
error: void 0
|
|
13900
|
-
};
|
|
14036
|
+
});
|
|
13901
14037
|
} catch (e) {
|
|
13902
|
-
|
|
13903
|
-
|
|
14038
|
+
const error = shortError(e);
|
|
14039
|
+
outcome = (x) => ({
|
|
14040
|
+
...x,
|
|
13904
14041
|
checkedAt: this.now(),
|
|
13905
|
-
status:
|
|
13906
|
-
error
|
|
13907
|
-
};
|
|
14042
|
+
status: "unconfirmed",
|
|
14043
|
+
error
|
|
14044
|
+
});
|
|
13908
14045
|
}
|
|
13909
|
-
await this.
|
|
13910
|
-
...
|
|
13911
|
-
|
|
13912
|
-
}));
|
|
14046
|
+
return await this.settleRecheck(id, (x) => x.status === "revoked" ? x : x.status === "withdrawn" ? {
|
|
14047
|
+
...outcome(x),
|
|
14048
|
+
status: "withdrawn"
|
|
14049
|
+
} : outcome(x)) ?? r;
|
|
14050
|
+
}
|
|
14051
|
+
async settleRecheck(id, outcome, event) {
|
|
14052
|
+
let next;
|
|
14053
|
+
await this.options.storage.update((l) => {
|
|
14054
|
+
const x = l.received.find((y) => y.id === id);
|
|
14055
|
+
if (!x) return l;
|
|
14056
|
+
next = outcome(x);
|
|
14057
|
+
const out = {
|
|
14058
|
+
...l,
|
|
14059
|
+
received: l.received.map((y) => y.id === id ? next : y)
|
|
14060
|
+
};
|
|
14061
|
+
return event && x.status !== "revoked" ? this.log(out, event) : out;
|
|
14062
|
+
});
|
|
13913
14063
|
return next;
|
|
13914
14064
|
}
|
|
13915
14065
|
async receive(frame) {
|
|
@@ -13926,7 +14076,7 @@ var IdentityExchange = class {
|
|
|
13926
14076
|
case "idp-result": {
|
|
13927
14077
|
const s = id ? this.shared(id) : void 0;
|
|
13928
14078
|
if (!s || s.status !== "pending") return;
|
|
13929
|
-
const error = frame.ok === true ? void 0 : clean$1(frame.error,
|
|
14079
|
+
const error = frame.ok === true ? void 0 : clean$1(frame.error, ERROR_MAX) ?? "Your contact could not verify it";
|
|
13930
14080
|
await this.setShared({
|
|
13931
14081
|
...s,
|
|
13932
14082
|
status: frame.ok === true ? "accepted" : "rejected",
|
|
@@ -13944,7 +14094,7 @@ var IdentityExchange = class {
|
|
|
13944
14094
|
case "idp-withdraw": {
|
|
13945
14095
|
if (!id) return;
|
|
13946
14096
|
const r = this.options.storage.read().received.find((x) => x.id === id);
|
|
13947
|
-
if (r && r.status !== "withdrawn") await this.options.storage.update((l) => this.log({
|
|
14097
|
+
if (r && r.status !== "withdrawn" && r.status !== "revoked") await this.options.storage.update((l) => this.log({
|
|
13948
14098
|
...l,
|
|
13949
14099
|
received: l.received.map((x) => x.id === id ? {
|
|
13950
14100
|
...x,
|
|
@@ -14072,13 +14222,14 @@ var IdentityExchange = class {
|
|
|
14072
14222
|
let reason;
|
|
14073
14223
|
try {
|
|
14074
14224
|
const mayReplace = (r) => r.binding.provider === binding.provider && (r.binding.subject === binding.subject || r.verified.subject === binding.subject);
|
|
14225
|
+
if (revokedHere(this.options.storage.read().received, id)) throw new Error(REVOKED);
|
|
14075
14226
|
if (!receivedWithRoom(this.options.storage.read().received, id, mayReplace, now)) throw new Error(TOO_MANY_RECEIVED);
|
|
14076
14227
|
if (JSON.stringify(evidence ?? null).length > 16384) throw new Error("Evidence too large");
|
|
14077
14228
|
if (!verifyIdentityPresentation(binding.key, sig, id, scope, nonce, issuedAt)) throw new Error("The proof key did not sign this conversation's challenge");
|
|
14078
14229
|
if (binding.issuedAt > now + 300) throw new Error("The proof is dated in the future");
|
|
14079
14230
|
const result = boundVerifiedIdentity(await this.options.verify(statement, evidence));
|
|
14080
14231
|
if (Math.min(binding.expiresAt, result.expiresAt ?? Infinity) <= now) throw new Error("The proof has expired");
|
|
14081
|
-
if (await this.options.revoked?.(statement).catch(() => false)) throw new Error(
|
|
14232
|
+
if (await this.options.revoked?.(statement).catch(() => false)) throw new Error(REVOKED);
|
|
14082
14233
|
verified = result;
|
|
14083
14234
|
} catch (e) {
|
|
14084
14235
|
error = peerError(e);
|
|
@@ -14089,6 +14240,10 @@ var IdentityExchange = class {
|
|
|
14089
14240
|
if (!challenge) throw new Error("Unknown or reused identity challenge");
|
|
14090
14241
|
const challenges = l.challenges.filter((c) => c.nonce !== nonce);
|
|
14091
14242
|
const subject = verified?.subject;
|
|
14243
|
+
if (verified && revokedHere(l.received, id)) {
|
|
14244
|
+
verified = void 0;
|
|
14245
|
+
error = reason = REVOKED;
|
|
14246
|
+
}
|
|
14092
14247
|
const received = verified && receivedWithRoom(l.received, id, (r) => r.binding.provider === binding.provider && r.verified.subject === subject, now);
|
|
14093
14248
|
if (verified && !received) {
|
|
14094
14249
|
verified = void 0;
|
|
@@ -15933,6 +16088,12 @@ var SessionCapabilities = class {
|
|
|
15933
16088
|
var APP_FRAME = "paired-app";
|
|
15934
16089
|
/** The largest `d`, as compact UTF-8 JSON. The session's 60 KiB cap on any frame still holds above it. */
|
|
15935
16090
|
var APP_DATA_MAX_BYTES = 32768;
|
|
16091
|
+
/**
|
|
16092
|
+
* How long the peer's open apps are held when its session ends or is replaced (a transport switch, a resume, a
|
|
16093
|
+
* re-dial), before they are taken as closed. A new session within it says `open` again for each: the app hears that
|
|
16094
|
+
* open (and catches up), never a `close` in between. Past it, each still held is closed with `offline`.
|
|
16095
|
+
*/
|
|
16096
|
+
var APP_RESUME_GRACE_MS = 1e4;
|
|
15936
16097
|
var DOMAIN = "ghostly-apps/1";
|
|
15937
16098
|
var APP_ID = /^[A-Za-z0-9_-]{22}$/;
|
|
15938
16099
|
/** Semantic versioning 2.0.0, as a manifest's `version` is. */
|
|
@@ -16082,7 +16243,10 @@ var AppSessions = class {
|
|
|
16082
16243
|
open;
|
|
16083
16244
|
now;
|
|
16084
16245
|
peer = /* @__PURE__ */ new Map();
|
|
16085
|
-
/**
|
|
16246
|
+
/**
|
|
16247
|
+
* What the peer had open on a session that ended, until it says so again: each with its version and the time its
|
|
16248
|
+
* grace ends, counted from the suspension that took it from the peer.
|
|
16249
|
+
*/
|
|
16086
16250
|
held = /* @__PURE__ */ new Map();
|
|
16087
16251
|
received = new RateWindows(50, 64);
|
|
16088
16252
|
sent = new RateWindows(48, 64);
|
|
@@ -16116,7 +16280,7 @@ var AppSessions = class {
|
|
|
16116
16280
|
app,
|
|
16117
16281
|
o: "close"
|
|
16118
16282
|
} : null;
|
|
16119
|
-
if (!this.peer.has(app) && this.peer.size >= 16) return null;
|
|
16283
|
+
if (!this.peer.has(app) && !this.held.has(app) && this.peer.size + this.held.size >= 16) return null;
|
|
16120
16284
|
this.held.delete(app);
|
|
16121
16285
|
this.peer.set(app, parsed.v);
|
|
16122
16286
|
return {
|
|
@@ -16151,10 +16315,14 @@ var AppSessions = class {
|
|
|
16151
16315
|
/**
|
|
16152
16316
|
* The session ended or was replaced, and another may follow at once: what the peer had open is held, not closed (no
|
|
16153
16317
|
* event now). Nothing is sent to a held app; an `open` on the next session takes it back, a `close` closes it, and
|
|
16154
|
-
* `heldExpired` closes the rest once `
|
|
16318
|
+
* `heldExpired` closes the rest once `graceMs` has passed since the suspension that held each.
|
|
16155
16319
|
*/
|
|
16156
|
-
sessionSuspended() {
|
|
16157
|
-
|
|
16320
|
+
sessionSuspended(graceMs = APP_RESUME_GRACE_MS) {
|
|
16321
|
+
const until = this.now() + graceMs;
|
|
16322
|
+
for (const [app, version] of this.peer) this.held.set(app, {
|
|
16323
|
+
version,
|
|
16324
|
+
until
|
|
16325
|
+
});
|
|
16158
16326
|
this.peer.clear();
|
|
16159
16327
|
this.received.clear();
|
|
16160
16328
|
this.sent.clear();
|
|
@@ -16163,14 +16331,23 @@ var AppSessions = class {
|
|
|
16163
16331
|
get holding() {
|
|
16164
16332
|
return this.held.size > 0;
|
|
16165
16333
|
}
|
|
16166
|
-
/**
|
|
16334
|
+
/** When the next held app's grace ends; undefined when none is held. */
|
|
16335
|
+
get heldUntil() {
|
|
16336
|
+
let first;
|
|
16337
|
+
for (const { until } of this.held.values()) if (first === void 0 || until < first) first = until;
|
|
16338
|
+
return first;
|
|
16339
|
+
}
|
|
16340
|
+
/** Each app held whose grace is over is closed, with `offline`; the ones held later keep theirs. */
|
|
16167
16341
|
heldExpired() {
|
|
16168
|
-
const
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16342
|
+
const now = this.now(), closed = [];
|
|
16343
|
+
for (const [app, { until }] of this.held) if (until <= now) {
|
|
16344
|
+
this.held.delete(app);
|
|
16345
|
+
closed.push({
|
|
16346
|
+
app,
|
|
16347
|
+
o: "close",
|
|
16348
|
+
offline: true
|
|
16349
|
+
});
|
|
16350
|
+
}
|
|
16174
16351
|
return closed;
|
|
16175
16352
|
}
|
|
16176
16353
|
};
|
|
@@ -17291,6 +17468,12 @@ var FILE_LIMITS = {
|
|
|
17291
17468
|
autoAcceptBytesPerPeer: 524288e3,
|
|
17292
17469
|
/** Offers from one contact waiting for an answer here. */
|
|
17293
17470
|
maxWaitingOffers: 16,
|
|
17471
|
+
/**
|
|
17472
|
+
* Files from one contact not finished here, whatever their state (asked about, taken and waiting their turn, paused,
|
|
17473
|
+
* arriving). Only bytes were counted before: offers of 0 bytes were each taken, and 2,500 of them were 2,500
|
|
17474
|
+
* messages and records waiting for good.
|
|
17475
|
+
*/
|
|
17476
|
+
maxUnfinishedIncoming: 256,
|
|
17294
17477
|
/** Files one contact sends at once; accepted ones beyond wait their turn. */
|
|
17295
17478
|
maxActiveIncoming: 3,
|
|
17296
17479
|
/** An offer nobody answered ends after this long. */
|
|
@@ -17721,6 +17904,11 @@ var ChatFiles = class {
|
|
|
17721
17904
|
if (entry.record.direction === "out") this.announce(entry);
|
|
17722
17905
|
else if (entry.record.state === "queued") this.startIncoming(entry);
|
|
17723
17906
|
else if (entry.record.state === "active") this.armNudge(entry);
|
|
17907
|
+
else if (entry.record.state === "paused" && entry.record.pausedBy === "peer") this.send({
|
|
17908
|
+
t: "pf-accept",
|
|
17909
|
+
id: entry.record.id,
|
|
17910
|
+
offset: entry.in.written
|
|
17911
|
+
});
|
|
17724
17912
|
}
|
|
17725
17913
|
}
|
|
17726
17914
|
/** The session went: nothing moves until the next one. What was received is made durable. */
|
|
@@ -17742,7 +17930,11 @@ var ChatFiles = class {
|
|
|
17742
17930
|
if (entry.in && !transferEnded(entry.record)) this.checkpoint(entry);
|
|
17743
17931
|
}
|
|
17744
17932
|
}
|
|
17745
|
-
/**
|
|
17933
|
+
/**
|
|
17934
|
+
* Offers ended by their time to live. The host calls it now and then; `attach` does too. A file taken here and waiting
|
|
17935
|
+
* its turn ends too once nothing of it arrived in that time: its sender never sent it. Offered again, it is taken
|
|
17936
|
+
* again (`retakeAgreed`).
|
|
17937
|
+
*/
|
|
17746
17938
|
sweep() {
|
|
17747
17939
|
const now = this.now();
|
|
17748
17940
|
for (const entry of this.entries.values()) {
|
|
@@ -17752,7 +17944,7 @@ var ChatFiles = class {
|
|
|
17752
17944
|
"offered",
|
|
17753
17945
|
"asking"
|
|
17754
17946
|
].includes(record.state) || record.since + FILE_LIMITS.offerTtlMs > now) continue;
|
|
17755
|
-
if (record.direction === "in" && record.state === "queued") continue;
|
|
17947
|
+
if (record.direction === "in" && record.state === "queued" && (entry.in?.starting || this.moved(entry) > 0)) continue;
|
|
17756
17948
|
this.end(entry, "failed", record.direction === "in" ? "The offer expired" : record.state === "queued" ? "Not delivered in time" : "Not accepted in time");
|
|
17757
17949
|
if (record.direction === "in") this.send({
|
|
17758
17950
|
t: "pf-refuse",
|
|
@@ -17973,6 +18165,9 @@ var ChatFiles = class {
|
|
|
17973
18165
|
waitingOffers() {
|
|
17974
18166
|
return [...this.entries.values()].filter((e) => e.record.direction === "in" && e.record.state === "asking").length;
|
|
17975
18167
|
}
|
|
18168
|
+
unfinishedIncoming() {
|
|
18169
|
+
return [...this.entries.values()].filter((e) => e.record.direction === "in" && !transferEnded(e.record)).length;
|
|
18170
|
+
}
|
|
17976
18171
|
activeIncoming(except) {
|
|
17977
18172
|
return [...this.entries.values()].filter((e) => e !== except && e.record.direction === "in" && (e.record.state === "active" || e.record.state === "verifying" || e.in?.starting)).length;
|
|
17978
18173
|
}
|
|
@@ -18161,7 +18356,7 @@ var ChatFiles = class {
|
|
|
18161
18356
|
this.startIncoming(existing);
|
|
18162
18357
|
return;
|
|
18163
18358
|
}
|
|
18164
|
-
if (this.waitingOffers() >= FILE_LIMITS.maxWaitingOffers) {
|
|
18359
|
+
if (this.waitingOffers() >= FILE_LIMITS.maxWaitingOffers || this.unfinishedIncoming() >= FILE_LIMITS.maxUnfinishedIncoming) {
|
|
18165
18360
|
this.send({
|
|
18166
18361
|
t: "pf-refuse",
|
|
18167
18362
|
id,
|
|
@@ -18220,6 +18415,14 @@ var ChatFiles = class {
|
|
|
18220
18415
|
*/
|
|
18221
18416
|
async retakeAgreed(entry) {
|
|
18222
18417
|
const { record } = entry;
|
|
18418
|
+
if (this.unfinishedIncoming() >= FILE_LIMITS.maxUnfinishedIncoming) {
|
|
18419
|
+
this.send({
|
|
18420
|
+
t: "pf-refuse",
|
|
18421
|
+
id: record.id,
|
|
18422
|
+
why: "too-many"
|
|
18423
|
+
});
|
|
18424
|
+
return false;
|
|
18425
|
+
}
|
|
18223
18426
|
if (!record.consented) {
|
|
18224
18427
|
let decision;
|
|
18225
18428
|
try {
|
|
@@ -18590,6 +18793,7 @@ var ChatFiles = class {
|
|
|
18590
18793
|
if (entry.record.state !== "asking") return;
|
|
18591
18794
|
entry.record.state = "queued";
|
|
18592
18795
|
entry.record.consented = entry.record.agreed = true;
|
|
18796
|
+
entry.record.since = this.now();
|
|
18593
18797
|
this.changed(entry);
|
|
18594
18798
|
this.startIncoming(entry);
|
|
18595
18799
|
}
|
|
@@ -18633,6 +18837,7 @@ var ChatFiles = class {
|
|
|
18633
18837
|
if (record.state !== "paused" || record.pausedBy !== "me") return;
|
|
18634
18838
|
record.pausedBy = void 0;
|
|
18635
18839
|
record.state = "queued";
|
|
18840
|
+
if (direction === "in") record.since = this.now();
|
|
18636
18841
|
this.changed(entry);
|
|
18637
18842
|
if (direction === "out") {
|
|
18638
18843
|
if (this.attached) this.announce(entry);
|
|
@@ -20149,6 +20354,13 @@ var WAKE_LOST_MS = 1e4;
|
|
|
20149
20354
|
* then did the resume dial: a chat opened on return went live 21 s after the tap (Android emulator, 2026-10-29).
|
|
20150
20355
|
*/
|
|
20151
20356
|
var WAKE_ANSWER_GRACE_MS = 3e3;
|
|
20357
|
+
function peerSaidWindow() {
|
|
20358
|
+
return {
|
|
20359
|
+
window: new RateWindow(6, 6e4),
|
|
20360
|
+
read: null,
|
|
20361
|
+
timer: null
|
|
20362
|
+
};
|
|
20363
|
+
}
|
|
20152
20364
|
/**
|
|
20153
20365
|
* What files/3 may hold on a session's channel (WISP 501, Backpressure): a quarter of its send budget (native and iroh
|
|
20154
20366
|
* channels throw past 120 KiB), or the high water mark of a WebRTC channel, which has none.
|
|
@@ -20354,6 +20566,11 @@ var GhostLink = class {
|
|
|
20354
20566
|
peerNickOverride = null;
|
|
20355
20567
|
/** Group protocol versions the peer announced on this session; null until it does. */
|
|
20356
20568
|
peerGroupVersions = null;
|
|
20569
|
+
/**
|
|
20570
|
+
* Groups were on on this session. Off again, they stay off until the next session: each "on" runs a group edge's
|
|
20571
|
+
* whole opening, and the peer says its versions once a session.
|
|
20572
|
+
*/
|
|
20573
|
+
peerGroupsWereOn = false;
|
|
20357
20574
|
/** What each side announced after the handshake (`paired-capabilities`): calls, services. */
|
|
20358
20575
|
sessionCapabilities = new SessionCapabilities(() => this.offeredCapabilities());
|
|
20359
20576
|
pairedCalls = new PairedCalls();
|
|
@@ -20378,20 +20595,16 @@ var GhostLink = class {
|
|
|
20378
20595
|
editsReceived = new RateWindow(30, EDIT_RATE_WINDOW_MS);
|
|
20379
20596
|
wakeReceived = new RateWindow(6, 6e4);
|
|
20380
20597
|
/**
|
|
20381
|
-
* The contact's name and picture,
|
|
20382
|
-
*
|
|
20598
|
+
* The contact's name and picture, its word on held items, its ways of paying and its transport descriptors, each saved
|
|
20599
|
+
* on this side when it changes: said once a session and when changed, so a handful a minute each. Past that only the
|
|
20600
|
+
* newest waits, read once the window has room again.
|
|
20383
20601
|
*/
|
|
20384
20602
|
peerSaid = {
|
|
20385
|
-
"paired-nick":
|
|
20386
|
-
|
|
20387
|
-
|
|
20388
|
-
|
|
20389
|
-
|
|
20390
|
-
"paired-avatar": {
|
|
20391
|
-
window: new RateWindow(6, 6e4),
|
|
20392
|
-
read: null,
|
|
20393
|
-
timer: null
|
|
20394
|
-
}
|
|
20603
|
+
"paired-nick": peerSaidWindow(),
|
|
20604
|
+
"paired-avatar": peerSaidWindow(),
|
|
20605
|
+
"paired-hold": peerSaidWindow(),
|
|
20606
|
+
"paired-payments": peerSaidWindow(),
|
|
20607
|
+
"paired-adapters": peerSaidWindow()
|
|
20395
20608
|
};
|
|
20396
20609
|
/** Identity-proof frames the contact may send per window; the rest are dropped before they are read. */
|
|
20397
20610
|
identityReceived = new RateWindow(40, IDENTITY_FRAME_WINDOW_MS);
|
|
@@ -23499,16 +23712,27 @@ var GhostLink = class {
|
|
|
23499
23712
|
/**
|
|
23500
23713
|
* The session ended or a new one took its place (a transport switch, a resume, a re-dial): what the contact had open
|
|
23501
23714
|
* is held for `APP_RESUME_GRACE_MS` (WISP 1200 § In a chat). The next session's `open` takes each back, and the app
|
|
23502
|
-
* hears only that open, not a close first; one not said again by then is closed with `offline`.
|
|
23715
|
+
* hears only that open, not a close first; one not said again by then is closed with `offline`. Each suspension
|
|
23716
|
+
* gives what it held its own grace: a later one's apps do not close at an earlier one's time.
|
|
23503
23717
|
*/
|
|
23504
23718
|
appsSuspended() {
|
|
23505
23719
|
this.appRanges.reset();
|
|
23506
|
-
this.apps.sessionSuspended();
|
|
23507
|
-
|
|
23720
|
+
this.apps.sessionSuspended(this.options.appResumeGraceMs ?? 1e4);
|
|
23721
|
+
this.armAppsGrace();
|
|
23722
|
+
}
|
|
23723
|
+
/** A timer for the next held app's grace, as long as any is held. */
|
|
23724
|
+
armAppsGrace() {
|
|
23725
|
+
if (this.appsGrace) {
|
|
23726
|
+
clearTimeout(this.appsGrace);
|
|
23727
|
+
this.appsGrace = null;
|
|
23728
|
+
}
|
|
23729
|
+
const until = this.apps.heldUntil;
|
|
23730
|
+
if (until === void 0) return;
|
|
23508
23731
|
this.appsGrace = setTimeout(() => {
|
|
23509
23732
|
this.appsGrace = null;
|
|
23510
23733
|
for (const event of this.apps.heldExpired()) this.options.events?.onAppFrame?.(event);
|
|
23511
|
-
|
|
23734
|
+
this.armAppsGrace();
|
|
23735
|
+
}, Math.max(0, until - Date.now()));
|
|
23512
23736
|
}
|
|
23513
23737
|
/** Whether files/3 was agreed on the session open now; kept to say when that changes. */
|
|
23514
23738
|
filesOpen = false;
|
|
@@ -24181,6 +24405,7 @@ var GhostLink = class {
|
|
|
24181
24405
|
this.peerNetworks = null;
|
|
24182
24406
|
this.peerHoldOverride = null;
|
|
24183
24407
|
this.sessionCapabilities.reset();
|
|
24408
|
+
this.peerGroupsWereOn = false;
|
|
24184
24409
|
this.leaveHangUp();
|
|
24185
24410
|
this.typingSender.reset();
|
|
24186
24411
|
this.typingReceiver.clear();
|
|
@@ -24359,7 +24584,7 @@ var GhostLink = class {
|
|
|
24359
24584
|
return;
|
|
24360
24585
|
}
|
|
24361
24586
|
if (frame?.t === "paired-avatar" || frame?.t === "paired-nick") {
|
|
24362
|
-
this.
|
|
24587
|
+
this.peerSaysOfItself(channel, frame.t, frame);
|
|
24363
24588
|
return;
|
|
24364
24589
|
}
|
|
24365
24590
|
if (frame?.t === "paired-capabilities") {
|
|
@@ -24451,15 +24676,21 @@ var GhostLink = class {
|
|
|
24451
24676
|
}
|
|
24452
24677
|
if (frame?.t === "paired-payments") {
|
|
24453
24678
|
if (!Array.isArray(frame.m) || frame.m.length > 16 || !frame.m.every((m) => typeof m === "string")) return;
|
|
24454
|
-
|
|
24455
|
-
|
|
24456
|
-
this.
|
|
24679
|
+
const methods = new Set(frame.m.filter((m) => PAYMENT_METHODS.includes(m)));
|
|
24680
|
+
const networks = frame.n === void 0 ? null : parsePaymentNetworks(frame.n);
|
|
24681
|
+
this.peerSays(channel, "paired-payments", () => {
|
|
24682
|
+
this.peerPaymentMethods = methods;
|
|
24683
|
+
this.peerNetworks = frame.n === void 0 ? null : networks ?? this.peerNetworks;
|
|
24684
|
+
this.emitPairingState();
|
|
24685
|
+
});
|
|
24457
24686
|
return;
|
|
24458
24687
|
}
|
|
24459
24688
|
if (frame?.t === "paired-groups") {
|
|
24460
24689
|
if (!Array.isArray(frame.v) || frame.v.length > 8 || !frame.v.every((v) => Number.isSafeInteger(v) && v > 0)) return;
|
|
24461
24690
|
const before = this.groupsSupport;
|
|
24691
|
+
if (!before && this.peerGroupsWereOn && frame.v.includes(1)) return;
|
|
24462
24692
|
this.peerGroupVersions = frame.v;
|
|
24693
|
+
if (this.groupsSupport) this.peerGroupsWereOn = true;
|
|
24463
24694
|
if (this.groupsSupport !== before) this.options.events?.onGroupsSupport?.(this.groupsSupport);
|
|
24464
24695
|
return;
|
|
24465
24696
|
}
|
|
@@ -24476,12 +24707,15 @@ var GhostLink = class {
|
|
|
24476
24707
|
}
|
|
24477
24708
|
if (frame?.t === "paired-hold") {
|
|
24478
24709
|
if (typeof frame.on !== "boolean" || frame.top !== void 0 && !(Number.isSafeInteger(frame.top) && frame.top >= 0)) return;
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
|
|
24483
|
-
|
|
24484
|
-
|
|
24710
|
+
const on = frame.on, top = frame.top;
|
|
24711
|
+
this.peerSays(channel, "paired-hold", () => {
|
|
24712
|
+
this.peerHoldOverride = on;
|
|
24713
|
+
Promise.resolve(this.options.events?.onHold?.({
|
|
24714
|
+
peerAllows: on,
|
|
24715
|
+
peerTop: top
|
|
24716
|
+
})).catch(() => {});
|
|
24717
|
+
this.emitPairingState();
|
|
24718
|
+
});
|
|
24485
24719
|
return;
|
|
24486
24720
|
}
|
|
24487
24721
|
if (frame?.t === "paired-reconnect") {
|
|
@@ -24496,12 +24730,14 @@ var GhostLink = class {
|
|
|
24496
24730
|
if (frame?.t === "paired-adapters") {
|
|
24497
24731
|
if (!frame.descriptors || typeof frame.descriptors !== "object" || JSON.stringify(frame.descriptors).length > 4096) return;
|
|
24498
24732
|
const descriptors = checkedDescriptors(frame.descriptors);
|
|
24499
|
-
|
|
24500
|
-
|
|
24501
|
-
|
|
24502
|
-
|
|
24503
|
-
|
|
24504
|
-
|
|
24733
|
+
await this.peerSays(channel, "paired-adapters", async () => {
|
|
24734
|
+
const transports = [...this.paired?.peerTransports ?? []];
|
|
24735
|
+
const fallback = this.paired?.peerAllowsFallback ?? false;
|
|
24736
|
+
await this.options.events?.onTransportDiscovery?.(descriptors, transports, fallback);
|
|
24737
|
+
this.peerDescriptors = descriptors;
|
|
24738
|
+
this.peerTransports = transports;
|
|
24739
|
+
this.peerFallback = fallback;
|
|
24740
|
+
});
|
|
24505
24741
|
return;
|
|
24506
24742
|
}
|
|
24507
24743
|
if (!frame || typeof frame.id !== "string" || !/^[A-Za-z0-9_-]{22}$/.test(frame.id)) return;
|
|
@@ -24860,11 +25096,8 @@ var GhostLink = class {
|
|
|
24860
25096
|
traceLink(this.myPubKeyZ32, "wake-answer-dropped", {});
|
|
24861
25097
|
this.dataLink.abandon();
|
|
24862
25098
|
}
|
|
24863
|
-
/**
|
|
24864
|
-
|
|
24865
|
-
* window the newest waits for room on this session, so the last word still counts.
|
|
24866
|
-
*/
|
|
24867
|
-
peerSays(channel, kind, frame) {
|
|
25099
|
+
/** A name or picture the contact said, once it is one (reading it costs little; saving it is what counts). */
|
|
25100
|
+
peerSaysOfItself(channel, kind, frame) {
|
|
24868
25101
|
let read;
|
|
24869
25102
|
if (kind === "paired-avatar") {
|
|
24870
25103
|
const avatar = sanitizeAvatar(frame.a);
|
|
@@ -24880,11 +25113,15 @@ var GhostLink = class {
|
|
|
24880
25113
|
}
|
|
24881
25114
|
};
|
|
24882
25115
|
}
|
|
25116
|
+
this.peerSays(channel, kind, read);
|
|
25117
|
+
}
|
|
25118
|
+
/**
|
|
25119
|
+
* Something the contact said that this side saves, read within its window: past it the newest waits for room on this
|
|
25120
|
+
* session (handed on unawaited then), so the last word still counts. What `read` returns when read at once is returned.
|
|
25121
|
+
*/
|
|
25122
|
+
peerSays(channel, kind, read) {
|
|
24883
25123
|
const held = this.peerSaid[kind];
|
|
24884
|
-
if (!held.timer && held.window.take())
|
|
24885
|
-
read();
|
|
24886
|
-
return;
|
|
24887
|
-
}
|
|
25124
|
+
if (!held.timer && held.window.take()) return read();
|
|
24888
25125
|
held.read = read;
|
|
24889
25126
|
if (held.timer) return;
|
|
24890
25127
|
const due = () => {
|
|
@@ -24899,7 +25136,7 @@ var GhostLink = class {
|
|
|
24899
25136
|
}
|
|
24900
25137
|
const next = held.read;
|
|
24901
25138
|
held.read = null;
|
|
24902
|
-
next();
|
|
25139
|
+
Promise.resolve(next()).catch(() => {});
|
|
24903
25140
|
};
|
|
24904
25141
|
held.timer = setTimeout(due, held.window.wait());
|
|
24905
25142
|
}
|
|
@@ -24960,6 +25197,7 @@ var GhostLink = class {
|
|
|
24960
25197
|
this.typingReceiver.clear();
|
|
24961
25198
|
this.appsSuspended();
|
|
24962
25199
|
this.emitFilesSession();
|
|
25200
|
+
this.peerGroupsWereOn = false;
|
|
24963
25201
|
if (this.peerGroupVersions) {
|
|
24964
25202
|
this.peerGroupVersions = null;
|
|
24965
25203
|
this.options.events?.onGroupsSupport?.(false);
|
|
@@ -26319,7 +26557,7 @@ function decodeDidDhtPacket(did, dnsPacket) {
|
|
|
26319
26557
|
const alg = props.get("a") ?? KEY_TYPES[type].alg;
|
|
26320
26558
|
if (!ALG.test(alg)) throw malformed(`the key ${alias} has an unusable algorithm`);
|
|
26321
26559
|
const k = props.get("k") ?? "";
|
|
26322
|
-
const bytes = /^[A-Za-z0-9_-]+$/.test(k) ? fromBase64Url(k) : /* @__PURE__ */ new Uint8Array();
|
|
26560
|
+
const bytes = /^[A-Za-z0-9_-]+$/.test(k) && k.length % 4 !== 1 ? fromBase64Url(k) : /* @__PURE__ */ new Uint8Array();
|
|
26323
26561
|
if (bytes.length === 0 || toBase64Url(bytes) !== k) throw malformed(`the key ${alias} is not unpadded base64url`);
|
|
26324
26562
|
const controller = props.get("c") ?? did;
|
|
26325
26563
|
if (!DID.test(controller)) throw malformed(`the key ${alias} has a controller that is not a DID`);
|
|
@@ -26592,6 +26830,11 @@ function parseWeb(id) {
|
|
|
26592
26830
|
path
|
|
26593
26831
|
};
|
|
26594
26832
|
}
|
|
26833
|
+
/**
|
|
26834
|
+
* A did:web (or one of its URLs) with the port's `%3a` written `%3A`, as `parseDid` writes it: percent-encoding is
|
|
26835
|
+
* case-insensitive (RFC 3986), so a document may write either. The fragment is left as it is.
|
|
26836
|
+
*/
|
|
26837
|
+
var webPortForm = (value) => value.startsWith("did:web:") ? value.replace(/^[^#]*/, (part) => part.replace(/%3a/g, "%3A")) : value;
|
|
26595
26838
|
var web = (did) => {
|
|
26596
26839
|
const parsed = parseDid(did);
|
|
26597
26840
|
if (parsed.method !== "web") throw new DidError("Not a did:web");
|
|
@@ -26628,7 +26871,7 @@ function didWebFileNames(text, did, statement) {
|
|
|
26628
26871
|
} catch {
|
|
26629
26872
|
return false;
|
|
26630
26873
|
}
|
|
26631
|
-
return isObject$3(body) && body.ghostly === 1 && body.did === did && body.statement === statement;
|
|
26874
|
+
return isObject$3(body) && body.ghostly === 1 && typeof body.did === "string" && webPortForm(body.did) === did && body.statement === statement;
|
|
26632
26875
|
}
|
|
26633
26876
|
/** The service entry a did.json can carry instead of the file. */
|
|
26634
26877
|
function didGhostlyServiceEntry(did, key, proofId) {
|
|
@@ -26780,7 +27023,7 @@ function staticDidDocument(did) {
|
|
|
26780
27023
|
/** An id as absolute `<did>#<fragment>`, from `#frag` or the absolute form; undefined for another DID's. */
|
|
26781
27024
|
function methodId(did, id) {
|
|
26782
27025
|
if (typeof id !== "string" || id.length > 640) return void 0;
|
|
26783
|
-
const absolute = id.startsWith("#") ? `${did}${id}` : id;
|
|
27026
|
+
const absolute = id.startsWith("#") ? `${did}${id}` : webPortForm(id);
|
|
26784
27027
|
return absolute.startsWith(`${did}#`) && absolute.length > did.length + 1 && /^[\x21-\x7e]+$/.test(absolute) ? absolute : void 0;
|
|
26785
27028
|
}
|
|
26786
27029
|
/** Key material of one verification method: `publicKeyJwk`, `publicKeyMultibase` or (Ed25519 2018) `publicKeyBase58`. */
|
|
@@ -26819,7 +27062,7 @@ var list = (value, name) => {
|
|
|
26819
27062
|
*/
|
|
26820
27063
|
function parseDidDocument(did, raw) {
|
|
26821
27064
|
if (!isObject$3(raw)) throw new DidError("The DID document is not a JSON object");
|
|
26822
|
-
if (raw.id !== did) throw new DidError(typeof raw.id === "string" ? `The DID document is for another DID (${raw.id.slice(0, 80)})` : "The DID document has no id");
|
|
27065
|
+
if (typeof raw.id !== "string" || webPortForm(raw.id) !== did) throw new DidError(typeof raw.id === "string" ? `The DID document is for another DID (${raw.id.slice(0, 80)})` : "The DID document has no id");
|
|
26823
27066
|
const keys = /* @__PURE__ */ new Map();
|
|
26824
27067
|
const unusable = /* @__PURE__ */ new Set();
|
|
26825
27068
|
let skipped = 0;
|
|
@@ -26973,14 +27216,19 @@ function checkDidJws(input, messages, doc) {
|
|
|
26973
27216
|
inputs = [];
|
|
26974
27217
|
}
|
|
26975
27218
|
if (!inputs.length) throw new DidError("The JWS carries another text: sign exactly the statement shown");
|
|
27219
|
+
let refused;
|
|
26976
27220
|
for (const key of candidates) {
|
|
26977
27221
|
if (!inputs.some((m) => verifyWith(key, jws.signature, m))) continue;
|
|
26978
|
-
if (!key.relationships.length)
|
|
27222
|
+
if (!key.relationships.length) {
|
|
27223
|
+
refused ??= key;
|
|
27224
|
+
continue;
|
|
27225
|
+
}
|
|
26979
27226
|
return {
|
|
26980
27227
|
key,
|
|
26981
27228
|
alg: jws.alg
|
|
26982
27229
|
};
|
|
26983
27230
|
}
|
|
27231
|
+
if (refused) throw refusedKey(refused);
|
|
26984
27232
|
throw new DidError("The JWS signature does not match: sign exactly the statement shown, with a key of this DID");
|
|
26985
27233
|
}
|
|
26986
27234
|
/**
|
|
@@ -26998,10 +27246,14 @@ function checkDidSignature(signature, messages, doc, vm) {
|
|
|
26998
27246
|
}
|
|
26999
27247
|
const der = signature.length !== 64 && signature[0] === 48;
|
|
27000
27248
|
if (signature.length !== 64 && !der) throw new DidError("A signature is 64 bytes (or DER, for ECDSA)");
|
|
27249
|
+
let refused;
|
|
27001
27250
|
for (const key of candidates) {
|
|
27002
27251
|
if (der && key.curve === "Ed25519") continue;
|
|
27003
27252
|
if (!messages.some((m) => verifyWith(key, signature, m, der ? "der" : "compact"))) continue;
|
|
27004
|
-
if (!key.relationships.length)
|
|
27253
|
+
if (!key.relationships.length) {
|
|
27254
|
+
refused ??= key;
|
|
27255
|
+
continue;
|
|
27256
|
+
}
|
|
27005
27257
|
const canonical = der ? (key.curve === "secp256k1" ? secp256k1 : p256).Signature.fromBytes(signature, "der").toBytes("compact") : signature;
|
|
27006
27258
|
return {
|
|
27007
27259
|
key,
|
|
@@ -27009,6 +27261,7 @@ function checkDidSignature(signature, messages, doc, vm) {
|
|
|
27009
27261
|
signature: canonical
|
|
27010
27262
|
};
|
|
27011
27263
|
}
|
|
27264
|
+
if (refused) throw refusedKey(refused);
|
|
27012
27265
|
throw new DidError("The signature does not match: sign exactly the statement shown, with a key of this DID");
|
|
27013
27266
|
}
|
|
27014
27267
|
function parseDidSignaturePaste(pasted) {
|
|
@@ -29217,6 +29470,8 @@ function readFirstPlace(o, epoch) {
|
|
|
29217
29470
|
var ownKey = (f) => `${f.e}:${f.n}`;
|
|
29218
29471
|
/** What a frame weighs in a log, roughly: its boxes plus the fixed fields around them. */
|
|
29219
29472
|
var frameKey$1 = (f) => `${f.s}:${f.e}:${f.n}`;
|
|
29473
|
+
/** One edit of a message, by its number: an edit handed already, apart from the message's own `frameKey`. */
|
|
29474
|
+
var editKey = (f) => `${f.s}:${f.e}:${f.n}:v${f.v}`;
|
|
29220
29475
|
/** What a kept frame counts for against `GROUP_LIMITS.relayBytes`. */
|
|
29221
29476
|
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) + (f.nk?.c.length ?? 0) + 400;
|
|
29222
29477
|
/** Only the fields an edit frame has, as `clean` does for a message. */
|
|
@@ -29401,9 +29656,9 @@ var GroupSession = class {
|
|
|
29401
29656
|
}
|
|
29402
29657
|
this.answers = new CatchUpAnswers({
|
|
29403
29658
|
send: (to, frame) => {
|
|
29404
|
-
if (frame.t === "group-msg" && !rosterHas(this.roster, frame.s)) {
|
|
29659
|
+
if ((frame.t === "group-msg" || frame.t === "group-edit") && !rosterHas(this.roster, frame.s)) {
|
|
29405
29660
|
const handed = this.leaversHanded.get(to) ?? /* @__PURE__ */ new Set();
|
|
29406
|
-
this.leaversHanded.set(to, handed.add(frameKey$1(frame)));
|
|
29661
|
+
this.leaversHanded.set(to, handed.add(frame.t === "group-edit" ? editKey(frame) : frameKey$1(frame)));
|
|
29407
29662
|
}
|
|
29408
29663
|
return hooks.send(to, frame);
|
|
29409
29664
|
},
|
|
@@ -29880,7 +30135,18 @@ var GroupSession = class {
|
|
|
29880
30135
|
if (this.state.relay?.length) this.state.relay = prune(this.state.relay, false);
|
|
29881
30136
|
if (this.onRows?.length) this.onRows = prune(this.onRows, true);
|
|
29882
30137
|
this.pruned.splice(0, this.pruned.length - GROUP_LIMITS.relay);
|
|
29883
|
-
if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s));
|
|
30138
|
+
if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s) || this.isRemovalEdit(f));
|
|
30139
|
+
}
|
|
30140
|
+
/** Whether a kept edit is a removal (WISP 400 § Delete for everyone): its box, under its epoch's key, says `rm`. */
|
|
30141
|
+
isRemovalEdit(frame) {
|
|
30142
|
+
const secret = this.secret(frame.e);
|
|
30143
|
+
const plain = secret && decryptText(epochKeys(secret, this.id, frame.e).message, editAad(frame), frame.nn, frame.c);
|
|
30144
|
+
if (!plain) return false;
|
|
30145
|
+
try {
|
|
30146
|
+
return JSON.parse(plain)?.rm === true;
|
|
30147
|
+
} catch {
|
|
30148
|
+
return false;
|
|
30149
|
+
}
|
|
29884
30150
|
}
|
|
29885
30151
|
/** The frames `pruneRelay` dropped that are handed on again now (a removal's `left` mark came after it), back in their logs. */
|
|
29886
30152
|
unprune() {
|
|
@@ -30567,11 +30833,14 @@ var GroupSession = class {
|
|
|
30567
30833
|
/**
|
|
30568
30834
|
* An edit of a member's own message, from its author's edge or handed on by another member: believed only while its
|
|
30569
30835
|
* author is still in the roster (someone removed edits nothing), and the member handing it on too; for an epoch the
|
|
30570
|
-
* author and I were both members of, with the author's signature over the whole frame and a box that opens.
|
|
30571
|
-
* an
|
|
30836
|
+
* author and I were both members of, with the author's signature over the whole frame and a box that opens. A removal
|
|
30837
|
+
* of an author out of the roster still stands, handed on by a member: it only takes away what the author wrote while
|
|
30838
|
+
* in, and a member away when it was said would keep the message for good. One for an epoch or a secret not here yet
|
|
30839
|
+
* waits, as a message does. Taken, it is kept to hand on in turn.
|
|
30572
30840
|
*/
|
|
30573
30841
|
async receiveEdit(from, raw) {
|
|
30574
|
-
if (!isEditFrame(raw) || raw.s === this.myKey || !rosterHas(this.roster,
|
|
30842
|
+
if (!isEditFrame(raw) || raw.s === this.myKey || !rosterHas(this.roster, from)) return;
|
|
30843
|
+
const member = rosterHas(this.roster, raw.s);
|
|
30575
30844
|
if (!verify(fromBase64Url(raw.sig), editSigned(raw), publicKeyFromZ32(raw.s))) return;
|
|
30576
30845
|
if (raw.e > this.epoch) {
|
|
30577
30846
|
this.parkEdit(from, raw);
|
|
@@ -30595,6 +30864,7 @@ var GroupSession = class {
|
|
|
30595
30864
|
if (!body || typeof body !== "object" || !validEditText(body.text)) return;
|
|
30596
30865
|
if (body.rm !== void 0 && body.rm !== true) return;
|
|
30597
30866
|
const rm = body.rm === true;
|
|
30867
|
+
if (!member && !rm) return;
|
|
30598
30868
|
if (!rm && !cardEditNumber(raw.v)) return;
|
|
30599
30869
|
const k = rm ? [] : validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
|
|
30600
30870
|
const sc = rm || body.sc === void 0 ? void 0 : readStatusCard(body.sc);
|
|
@@ -30755,7 +31025,7 @@ var GroupSession = class {
|
|
|
30755
31025
|
if (e <= this.epoch) {
|
|
30756
31026
|
const known = this.state.chain[e];
|
|
30757
31027
|
const result = verifyCommit(raw, this.state.chain[e - 1] ?? null, this.id);
|
|
30758
|
-
if ("error" in result || result.commit.by !== known.by) return;
|
|
31028
|
+
if ("error" in result || result.commit.by !== known.by || result.commit.by !== this.admin) return;
|
|
30759
31029
|
if (commitHash(result.commit) !== commitHash(known)) await this.fork(`Member ${from.slice(0, 8)} holds a different membership history for epoch ${e}`);
|
|
30760
31030
|
else if (this.takeLeftMark(known, frame.left)) {
|
|
30761
31031
|
this.unprune();
|
|
@@ -30913,10 +31183,13 @@ var GroupSession = class {
|
|
|
30913
31183
|
while (metas.length && metas[0].ts < f.ts) answer.push(metas.shift().frame);
|
|
30914
31184
|
answer.push(f);
|
|
30915
31185
|
}
|
|
31186
|
+
const readable = (f) => !!this.state.chain[f.e] && rosterHas(this.state.chain[f.e].m, from);
|
|
30916
31187
|
for (const author of asked) {
|
|
30917
|
-
const edits = (this.state.relayEdits ?? []).filter((f) => f.s === author &&
|
|
31188
|
+
const edits = (this.state.relayEdits ?? []).filter((f) => f.s === author && readable(f));
|
|
30918
31189
|
answer.push(...edits.slice(-GROUP_LIMITS.handOnEdits));
|
|
30919
31190
|
}
|
|
31191
|
+
const gone = (this.state.relayEdits ?? []).filter((f) => !rosterHas(this.roster, f.s) && readable(f) && !handed?.has(editKey(f)));
|
|
31192
|
+
answer.push(...gone.slice(-GROUP_LIMITS.handOnEdits));
|
|
30920
31193
|
answer.push(...metas.map((m) => m.frame));
|
|
30921
31194
|
this.handOut(from, answer);
|
|
30922
31195
|
}
|
|
@@ -31286,8 +31559,9 @@ function entryParams(link, mySeed, myZ32, peerZ32) {
|
|
|
31286
31559
|
* only a newcomer is sent it; `leave`, `remove` and `rotate` get a fresh secret sealed to everyone;
|
|
31287
31560
|
* - concurrent commits are a race with a deterministic winner, not a fork: the branch that keeps the
|
|
31288
31561
|
* admin's changes (remove, role, rotate, link) since the common parent, then the longest, then the
|
|
31289
|
-
* lowest hash of the first commit after the common parent. The admin signing changes on
|
|
31290
|
-
* branches (after the same commit or not) is still a fork and halts the group;
|
|
31562
|
+
* lowest hash of the first commit after the common parent. The admin of the tip signing changes on
|
|
31563
|
+
* two branches (after the same commit or not) is still a fork and halts the group; a former admin
|
|
31564
|
+
* doing so on a branch from before its hand-over is refused, as a stale branch;
|
|
31291
31565
|
* - messages name the commit of their epoch, so messages under a commit that lost stay readable;
|
|
31292
31566
|
* every member keeps recent frames from everyone and re-sends them to whoever was away.
|
|
31293
31567
|
*
|
|
@@ -31342,6 +31616,15 @@ var COMMUNITY_LIMITS = {
|
|
|
31342
31616
|
syncAnswers: 16,
|
|
31343
31617
|
syncWindowMs: 6e4,
|
|
31344
31618
|
/**
|
|
31619
|
+
* Messages of one member taken per `messageWindowMs`, and the bytes of their sealed bodies, past what one catch-up
|
|
31620
|
+
* answer holds (a whole store, and the lasting frames): anyone with the link is a member, and each message taken is a
|
|
31621
|
+
* row in every member's app and a frame each hub passes on. The rest are not taken now and come again in a catch-up
|
|
31622
|
+
* (`MessagePace`).
|
|
31623
|
+
*/
|
|
31624
|
+
messagesPerAuthor: 30,
|
|
31625
|
+
messageBytesPerAuthor: 131072,
|
|
31626
|
+
messageWindowMs: 1e4,
|
|
31627
|
+
/**
|
|
31345
31628
|
* Frames of one catch-up answer in a slice (`CommunitySessionHooks.handled`), two slices at most not handled yet by
|
|
31346
31629
|
* the member's app: a member back after the store filled was handed 258 at once, and an app holds 64 waiting at most
|
|
31347
31630
|
* before 2026-10-07 (more ends the session). As a private group's (`GROUP_LIMITS.catchUpSlice`).
|
|
@@ -31547,7 +31830,7 @@ function communityRoster(previous, c, trusted = false) {
|
|
|
31547
31830
|
/**
|
|
31548
31831
|
* One commit against its parent (null for a genesis) and the parent's roster: shape, id, link,
|
|
31549
31832
|
* authority, roster arithmetic, roster hash and signature. The confirmation tag is checked once
|
|
31550
|
-
* the secret is known. `before`: the commits before it on its branch, newest first; given, a `leave` is held to the
|
|
31833
|
+
* the secret is known (a derived kind's on arrival, by a member holding the parent's: `receiveCommit`). `before`: the commits before it on its branch, newest first; given, a `leave` is held to the
|
|
31551
31834
|
* admission it ends (`leaveStands`). A member gives it for every commit it takes in after its own admission; the chain
|
|
31552
31835
|
* of a welcome is not held to it (`verifyCommunityChain`).
|
|
31553
31836
|
*/
|
|
@@ -31649,6 +31932,56 @@ var messageSigned = (f) => utf8Encode(JSON.stringify([
|
|
|
31649
31932
|
]));
|
|
31650
31933
|
var communityMessageId = (sender, epoch, h, seq) => `${sender}:${epoch}:${h}:${seq}`;
|
|
31651
31934
|
var seenKey = (e, h) => `${e}:${h}`;
|
|
31935
|
+
/**
|
|
31936
|
+
* One member's messages taken: a whole catch-up answer at once (`MESSAGE_BURST`), then
|
|
31937
|
+
* `COMMUNITY_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`. One not taken is not marked
|
|
31938
|
+
* seen, so a catch-up hands it again; until it is taken, those after it under the same commit (`seenKey`) are not taken
|
|
31939
|
+
* either: a later one taken would say I have everything up to it (`syncFrame`'s `have`) and the one before would never
|
|
31940
|
+
* be handed again. A place that moves no more for `COMMUNITY_LIMITS.pendingMs` (no catch-up holds it any longer) is let go.
|
|
31941
|
+
*/
|
|
31942
|
+
var MESSAGE_BURST = {
|
|
31943
|
+
frames: COMMUNITY_LIMITS.store + COMMUNITY_LIMITS.lasting,
|
|
31944
|
+
bytes: COMMUNITY_LIMITS.storeBytes + COMMUNITY_LIMITS.lasting * COMMUNITY_LIMITS.textBytes * 2
|
|
31945
|
+
};
|
|
31946
|
+
var MessagePace = class {
|
|
31947
|
+
frames = MESSAGE_BURST.frames;
|
|
31948
|
+
bytes = MESSAGE_BURST.bytes;
|
|
31949
|
+
at;
|
|
31950
|
+
held = /* @__PURE__ */ new Map();
|
|
31951
|
+
take(key, n, bytes, now) {
|
|
31952
|
+
let held = this.held.get(key);
|
|
31953
|
+
if (held && now - held.at >= COMMUNITY_LIMITS.pendingMs) {
|
|
31954
|
+
this.held.delete(key);
|
|
31955
|
+
held = void 0;
|
|
31956
|
+
}
|
|
31957
|
+
if (held && n > held.low) {
|
|
31958
|
+
held.top = Math.max(held.top, n);
|
|
31959
|
+
return false;
|
|
31960
|
+
}
|
|
31961
|
+
const elapsed = Math.max(0, now - (this.at ?? now)) / COMMUNITY_LIMITS.messageWindowMs;
|
|
31962
|
+
this.at = now;
|
|
31963
|
+
this.frames = Math.min(MESSAGE_BURST.frames, this.frames + elapsed * COMMUNITY_LIMITS.messagesPerAuthor);
|
|
31964
|
+
this.bytes = Math.min(MESSAGE_BURST.bytes, this.bytes + elapsed * COMMUNITY_LIMITS.messageBytesPerAuthor);
|
|
31965
|
+
if (this.frames < 1 || this.bytes < bytes) {
|
|
31966
|
+
if (held) held.low = n;
|
|
31967
|
+
else this.held.set(key, {
|
|
31968
|
+
low: n,
|
|
31969
|
+
top: n,
|
|
31970
|
+
at: now
|
|
31971
|
+
});
|
|
31972
|
+
return false;
|
|
31973
|
+
}
|
|
31974
|
+
this.frames -= 1;
|
|
31975
|
+
this.bytes -= bytes;
|
|
31976
|
+
if (held && n === held.low) {
|
|
31977
|
+
if (held.top > n) {
|
|
31978
|
+
held.low = n + 1;
|
|
31979
|
+
held.at = now;
|
|
31980
|
+
} else this.held.delete(key);
|
|
31981
|
+
}
|
|
31982
|
+
return true;
|
|
31983
|
+
}
|
|
31984
|
+
};
|
|
31652
31985
|
/** One of a member's frames, among its own. */
|
|
31653
31986
|
var frameKey = (f) => `${f.e}:${f.h}:${f.n}`;
|
|
31654
31987
|
/** A frame among everyone's: each member counts its own `n`, so `frameKey` alone tells only one member's frames apart. */
|
|
@@ -31732,6 +32065,8 @@ var CommunitySession = class {
|
|
|
31732
32065
|
asked = /* @__PURE__ */ new Map();
|
|
31733
32066
|
/** Syncs answered per member, a few a minute (`COMMUNITY_LIMITS.syncAnswers`). In memory only. */
|
|
31734
32067
|
syncsAnswered = /* @__PURE__ */ new Map();
|
|
32068
|
+
/** Messages taken per author, a few a second (`MessagePace`). In memory only. */
|
|
32069
|
+
messagePace = /* @__PURE__ */ new Map();
|
|
31735
32070
|
/** The entry seed sealed to each member, for the seed it seals (`entryFrame`): every sync answer carries it. In memory only. */
|
|
31736
32071
|
sealedEntries = /* @__PURE__ */ new Map();
|
|
31737
32072
|
/** Catch-up answers still going out, a slice at a time (`receiveSync`). */
|
|
@@ -32245,11 +32580,17 @@ var CommunitySession = class {
|
|
|
32245
32580
|
if (!parsed || this.known.has(communityCommitHash(parsed))) return false;
|
|
32246
32581
|
const result = verifyCommunityCommit(raw, parent, parentRoster, this.id, this.ancestry(p));
|
|
32247
32582
|
if ("error" in result) return false;
|
|
32583
|
+
const previous = this.state.secrets[p];
|
|
32584
|
+
if (previous && !FRESH.has(result.commit.k)) {
|
|
32585
|
+
const untagged = communityUntaggedHash(result.commit);
|
|
32586
|
+
if (!confirmationMatches(epochKeys(derivedSecret(fromBase64Url(previous), untagged), this.id, result.commit.e).confirm, untagged, result.commit.c)) return false;
|
|
32587
|
+
}
|
|
32248
32588
|
if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
|
|
32249
32589
|
const commit = result.commit, h = communityCommitHash(commit);
|
|
32250
32590
|
const admin = rosterAdmin(parentRoster);
|
|
32251
32591
|
if (commit.by === admin) {
|
|
32252
32592
|
for (const [other, c] of this.known) if (other !== h && c.p === commit.p && c.by === admin) {
|
|
32593
|
+
if (admin !== this.admin) return false;
|
|
32253
32594
|
this.known.set(h, commit);
|
|
32254
32595
|
this.rosters.set(h, result.roster);
|
|
32255
32596
|
await this.fork(`The admin signed two different changes after epoch ${parent.e}`);
|
|
@@ -32262,6 +32603,11 @@ var CommunitySession = class {
|
|
|
32262
32603
|
if (branch && branch.path.length) {
|
|
32263
32604
|
const { admin } = this.parting(branch, this.branch(this.topHash), this.adminCounts());
|
|
32264
32605
|
if (ADMIN_ONLY.has(commit.k) && admin[1]) {
|
|
32606
|
+
if (commit.by !== this.admin) {
|
|
32607
|
+
this.known.delete(h);
|
|
32608
|
+
this.rosters.delete(h);
|
|
32609
|
+
return false;
|
|
32610
|
+
}
|
|
32265
32611
|
await this.fork(`The admin signed changes on two branches after epoch ${this.state.chain[branch.fork].e}`);
|
|
32266
32612
|
return true;
|
|
32267
32613
|
}
|
|
@@ -32353,6 +32699,7 @@ var CommunitySession = class {
|
|
|
32353
32699
|
this.state.chain.push(c);
|
|
32354
32700
|
this.takeDerived(h);
|
|
32355
32701
|
}
|
|
32702
|
+
this.holdDroppedLeaves(dropped);
|
|
32356
32703
|
if (!rosterHas(this.roster, this.myKey) && this.state.status === "active") {
|
|
32357
32704
|
const out = [...path].reverse().map((h) => this.known.get(h)).find((c) => (c.k === "remove" || c.k === "leave") && c.s === this.myKey);
|
|
32358
32705
|
if (out) this.out(out.k === "remove" ? "removed" : "left", out.k === "remove" ? "You were removed from this group" : "You left this group");
|
|
@@ -32362,6 +32709,33 @@ var CommunitySession = class {
|
|
|
32362
32709
|
}
|
|
32363
32710
|
}
|
|
32364
32711
|
}
|
|
32712
|
+
/**
|
|
32713
|
+
* A leave the branch I left behind had committed, whose member the main branch still lists (an admin-only commit
|
|
32714
|
+
* signed on a stale view won the fork): its request is held again, so the next hub commits it on top. The hub that
|
|
32715
|
+
* committed it kept no copy and the leaver's app forgot the group, so nobody would say it again (agents#2285).
|
|
32716
|
+
*/
|
|
32717
|
+
holdDroppedLeaves(dropped) {
|
|
32718
|
+
let held = this.state.pendingLeaves;
|
|
32719
|
+
for (const c of dropped) {
|
|
32720
|
+
if (c.k !== "leave" || !c.s || !c.ls || c.s === this.myKey || !rosterHas(this.roster, c.s)) continue;
|
|
32721
|
+
const request = {
|
|
32722
|
+
s: c.s,
|
|
32723
|
+
ls: c.ls,
|
|
32724
|
+
...c.ls3 ? { ls3: c.ls3 } : {}
|
|
32725
|
+
};
|
|
32726
|
+
if (!leaveStands({
|
|
32727
|
+
g: this.id,
|
|
32728
|
+
...request
|
|
32729
|
+
}, this.ancestry(this.topHash))) continue;
|
|
32730
|
+
const other = held.find((r) => r.s === c.s && leaveStands({
|
|
32731
|
+
g: this.id,
|
|
32732
|
+
...r
|
|
32733
|
+
}, this.ancestry(this.topHash)));
|
|
32734
|
+
if (other && (other.ls3 || !request.ls3)) continue;
|
|
32735
|
+
held = [...held.filter((r) => r.s !== c.s), request].slice(-COMMUNITY_LIMITS.pendingLeaves);
|
|
32736
|
+
}
|
|
32737
|
+
this.state.pendingLeaves = held;
|
|
32738
|
+
}
|
|
32365
32739
|
/** The entry key is the one the main branch names; its seed comes with a `group-entry` from whoever holds it. */
|
|
32366
32740
|
followEntry() {
|
|
32367
32741
|
const key = this.currentEntryKey();
|
|
@@ -32616,6 +32990,10 @@ var CommunitySession = class {
|
|
|
32616
32990
|
return this.serialize(async () => {
|
|
32617
32991
|
this.requireAdmin();
|
|
32618
32992
|
if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey) throw new Error("Not a member");
|
|
32993
|
+
if (this.state.pendingLeaves.some((r) => r.s === memberKey && leaveStands({
|
|
32994
|
+
g: this.id,
|
|
32995
|
+
...r
|
|
32996
|
+
}, this.ancestry(this.topHash)))) throw new Error("This member has left the group. Make someone else the admin.");
|
|
32619
32997
|
await this.commit("role", { s: memberKey }, now);
|
|
32620
32998
|
});
|
|
32621
32999
|
}
|
|
@@ -33247,6 +33625,9 @@ var CommunitySession = class {
|
|
|
33247
33625
|
}
|
|
33248
33626
|
const roster = this.rosterOf(found.hash);
|
|
33249
33627
|
if (!rosterHas(roster, raw.s)) return false;
|
|
33628
|
+
let pace = this.messagePace.get(raw.s);
|
|
33629
|
+
if (!pace) this.messagePace.set(raw.s, pace = new MessagePace());
|
|
33630
|
+
if (!pace.take(seenKey(raw.e, raw.h), raw.n, raw.c.length, this.hooks.clock?.() ?? Date.now())) return false;
|
|
33250
33631
|
if (!rosterHas(roster, this.myKey)) {
|
|
33251
33632
|
this.markSeen(raw);
|
|
33252
33633
|
this.keep(raw);
|
|
@@ -33498,8 +33879,8 @@ var CommunitySession = class {
|
|
|
33498
33879
|
const unheard = new Set(this.state.unheard ?? []);
|
|
33499
33880
|
const marked = /* @__PURE__ */ new Set();
|
|
33500
33881
|
const metas = this.metaFor(from, frame.mt);
|
|
33501
|
-
const inStore = new Set(this.state.store.map(
|
|
33502
|
-
const lasting = Object.values(this.state.lasting ?? {}).filter((f) => !inStore.has(
|
|
33882
|
+
const inStore = new Set(this.state.store.map(storeKey));
|
|
33883
|
+
const lasting = Object.values(this.state.lasting ?? {}).filter((f) => !inStore.has(storeKey(f))).sort((a, b) => a.ts - b.ts);
|
|
33503
33884
|
for (const stored of [...lasting, ...this.state.store]) {
|
|
33504
33885
|
if (stored.s === from) continue;
|
|
33505
33886
|
const high = have[stored.s]?.[seenKey(stored.e, stored.h)];
|
|
@@ -34412,6 +34793,6 @@ function readX401SdJwtVc(text) {
|
|
|
34412
34793
|
};
|
|
34413
34794
|
}
|
|
34414
34795
|
//#endregion
|
|
34415
|
-
export { parseSshPublicKey as $, appCardId as $a, readImageMeta as $c, automaticTransport as $i, traceLink as $l, readGroupWant as $n, HANDOFF_HAVE as $o, vapidKeysMatch as $r, enrollHelloFrame as $s, SEPOLIA_TEST_USDT_FAUCET as $t, knockRecords as A, GROUP_REACTION_FRAME as Aa, appDigest as Ac, txtValue as Ai, classifyTurnRead as Al, findEndpoint as An, formatLocalTarget as Ao, FileUplink as Ar, readHandoffDone as As, didWebDocumentUrl as At, GROUP_READ_NOTE as B, pairedReplyAuthor as Ba, APP_STATEMENT_LIMITS as Bc, IdentityExchange as Bi, turnKeys as Bl, EngineError as Bn, callRtcConfig as Bo, mayPin as Br, setAckFrame as Bs, staticDidDocument as Bt, decodeCommunityLink as C, REMOVED_TEXT as Ca, readLinkRecord as Cc, encodeDnsQuery as Ci, devicePingFrame as Cl, pubkyHomeserverOf as Cn, AWAITING_PEER_MS as Co, rankHubs as Cr, handoffReleaseFrame as Cs, DID_JWS_MAX_LENGTH as Ct, utf8Decode as Cu, encodeGroupEntryLink as D, forwardedAgain as Da, APP_BUNDLE_MAGIC as Dc, recordsFromTxt as Di, TURN_PUT_WINDOW_MS as Dl, ENDPOINT as Dn, WATCH_PEER_MS as Do, shouldBeHub as Dr, newHandoffId as Ds, didGhostlyServiceEntry as Dt, decodeGroupEntryLink as E, parseLinkPreview as Ea, APP_BUNDLE_LIMITS as Ec, normalizeDomain as Ei, webCryptoSigner as El, decodeBolt11 as En, RELAY_POLL_INTERVALS as Eo, readLobby as Er, handoffVersions as Es, checkDidSignature as Et, groupWakeFrame as F, reactionEmoji as Fa, pacer as Fc, dialDescriptors as Fi, nextTurnPosition as Fl, INVITE_TAKEN as Fn, encodeControl as Fo, TypingSender as Fr, readHandoffVerified as Fs, normalizeDid as Ft, GROUP_EDIT_TEXT_BYTES as G, CRON_LINE as Ga, isAppKey as Gc, newIdentityBinding as Gi, HEDGE_MISSING_MS as Gl, GROUP_HAVE_FRAME as Gn, signalHasVideo as Go, WAKE_CALL_INTERVAL_MS as Gr, ENROLL_GRANT as Gs, encodeDidDhtPacket as Gt, frameBytes as H, replySnippet as Ha, appRef as Hc, emptyIdentityLedger as Hi, turnStatedVerifier as Hl, engineText as Hn, contactRtcConfig as Ho, pinIsNewer as Hr, signTombstone as Hs, didDhtDocument as Ht, groupWakes as I, reactionIsNewer as Ia, readAppBundle as Ic, IDENTITY_MAX_EVIDENCE as Ii, readTurnPacket as Il, LIVENESS_PING_MS as In, CALL_SIGNAL_MAX_AGE_MS as Io, sanitizeTypingStatus as Ir, sealHandoffPiece as Is, parseDid as It, mentionsMember as J, PR_STATES as Ja, readAppRevocations as Jc, lastSharedWithMe as Ji, RelaysFailedError as Jl, fetchesByItself as Jn, LEGACY_SERVICES as Jo, newWakeToken as Jr, enrollCancelFrame as Js, ETHEREUM_USDT as Jt, carryMentions as K, ITEM_STATES as Ka, isAppRef as Kc, receivedIdentityStatus as Ki, HEDGE_MS as Kl, GROUP_WANT_FRAME as Kn, emptyLinkRecords as Ko, WakeLimiter as Kr, ENROLL_HELLO as Ks, resolveDidDht as Kt, parseGroupWakeFrame as L, readReaction as La, readAppBundleAsync as Lc, IDENTITY_MAX_VALIDITY as Li, signTurnPacket as Ll, PAIRED_FRAME_TOO_LARGE as Ln, RTC_CONFIG as Lo, typingActivity as Lr, SET_ACK as Ls, parseDidDocument as Lt, readKnocks as M, ReactionWindow as Ma, assembleAppBundle as Mc, CapsExchange as Mi, TURN_LAST_SEQUENCE as Ml, parseCashuRequestPayload as Mn, webLocalFetch as Mo, transferStalled as Mr, readHandoffHello as Ms, didWebFileNames as Mt, GROUP_WAKE_FRAME as N, nextReactionNumber as Na, checkAppManifest as Nc, DHT_TEXT_CAPABILITY as Ni, TURN_MAX as Nl, parseFedimintRequestPayload as Nn, LIMITS as No, TYPING_KINDS as Nr, readHandoffPake as Ns, didWebFileUrl as Nt, entryParams as O, readForwarded as Oa, APP_ICON_PATH as Oc, recordsFromWellKnown as Oi, TURN_RAISE_READ_TIMEOUT_MS as Ol, cashuRequestPayload as On, presenceSeenAt as Oo, ChatFiles as Or, readHandoffAck as Os, didJwsAlg as Ot, GroupWakeLimiter as P, queueReaction as Pa, isAppUrl as Pc, capsDescriptors as Pi, firstDeviceSetSecret as Pl, GhostLink as Pn, decodeControl as Po, TYPING_REFRESH_MS as Pr, readHandoffTurnFrame as Ps, didWebHost as Pt, SshSigError as Q, TASK_STATUSES as Qa, parseImageMeta as Qc, TRANSPORTS as Qi, setLinkTraceSink as Ql, readGroupHave as Qn, HANDOFF_DONE as Qo, checkPushEndpoint as Qr, enrollGrantFrame as Qs, SEPOLIA_TEST_USDT as Qt, GROUP_LIMITS as R, validReactionNumber as Ra, sha256Paced as Rc, IDENTITY_REVOCATION_LABEL as Ri, signTurnRelease as Rl, pairedMessageFits as Rn, answersOffer as Ro, GROUP_PIN_FRAME as Rr, SET_UPDATE as Rs, parseDidSignaturePaste as Rt, communityHasFrame as S, MAX_REMOVAL_NUMBER as Sa, readKnockSlot as Sc, domainWellKnownFile as Si, deviceLinkPairing as Sl, homeserverWebEndpoint as Sn, DirectPathWatch as So, pickHubs as Sr, handoffPakeFrame as Ss, DID_FILE_MAX_BYTES as St, toZ32 as Su, KNOCK_TTL_MS as T, dhtEditId as Ta, seenEntry as Tc, nip05RootKey as Ti, seedSigner as Tl, resolveLightningDestination as Tn, EXPECT_PEER_MS as To, readBeaconHead as Tr, handoffStreamKey as Ts, checkDidJws as Tt, COMMUNITY_EDIT_FRAME as U, BUTTON_ID as Ua, checkAppRevokeStatement as Uc, identityRevocationValue as Ui, turnVerifierMark as Ul, parseEngineError as Un, extractParamsFromSdp as Uo, pinNumberHolds as Ur, verifySetUpdate as Us, didDhtFromPublicKey as Ut, GroupSession as V, readReply as Va, appFingerprint as Vc, boundVerifiedIdentity as Vi, turnName as Vl, engineError as Vn, callSignalHeardAt as Vo, nextPinNumber as Vr, setUpdateFrame as Vs, strictBase64Url as Vt, GROUP_EDIT_FRAME as W, BUTTON_STYLES as Wa, isAppHash as Wc, identityStatement as Wi, DEFAULT_RELAYS as Wl, GROUP_FILE_LIMITS as Wn, parseCallSignal as Wo, readPin as Wr, ENROLL_DONE as Ws, encodeDidDhtDeactivated as Wt, SSHSIG_MAX_ARMOR as X, RUN_RESULTS as Xa, signAppObject as Xc, emptyProofLedger as Xi, currentRelays as Xl, isGroupMessageId as Xn, HANDOFF_ACK as Xo, relayRequest as Xr, enrollDigits as Xs, ONCHAIN_PROVIDER as Xt, groupName as Y, ROUTINE_STATES as Ya, setAppSignatureFastPath as Yc, PeerProofs as Yi, SLOW_MS as Yl, groupFileFallback as Yn, serviceIdFromName as Yo, parseWakeFrame as Yr, enrollCancelReason as Ys, EVM_TEST_CHAINS as Yt, SSHSIG_NAMESPACE as Z, STATUS_CARD_LIMITS as Za, signAppRevocation as Zc, validExternalKey as Zi, normalizeRelayUrl as Zl, readGroupFileMeta as Zn, HANDOFF_CANCEL as Zo, wakeRequest as Zr, enrollDoneFrame as Zs, PaymentPreflightError as Zt, openGroupTyping as _, voiceDownloadName as _a, knockSlotRecords as _c, readManifest as _i, ENROLL_CAPABILITY as _l, newPubkyProofFolder as _n, parseGroupCommit as _o, lobbyKeys as _r, handoffDigest as _s, parseAtprotoDidDocument as _t, bytesEqual as _u, appStoreDecision as a, DHT_FILE_CAPABILITY as aa, endedRequests as ac, APPS_CAPABILITY as ai, readContactLink as al, assertWholeSats as an, statusCardBytes as ao, SIGNAL_REPLY_MS as ar, HANDOFF_TIMINGS as as, BitcoinAddressError as at, createRelayPayload as au, CommunitySession as b, EDIT_BUFFER_MS as ba, mergeContactKnocks as bc, dnsProofName as bi, deviceEchoNonce as bl, pubkyProofFile as bn, verifyCommitSignature as bo, mergeLobby as br, handoffManifestFrames as bs, verifyAtprotoRecordProof as bt, randomBytes as bu, planAppUpdate as c, sanitizeFileName as ca, planKnocks as cc, STATUS_CARD_CAPABILITY as ci, readDeviceInvite as cl, walletNetworkOf as cn, claimedTime as co, MESH_HUBS as cr, filePartName as cs, ATPROTO_FULL_SCOPE as ct, parseRelayPayload as cu, readAppStore as d, VOICE_LIMITS as da, turnOff as dc, HOLD_DATED_BACK_MS as di, decodeInviteCode as dl, sparkAddressKind as dn, shownTime as do, pickMeshHubs as dr, handoffAttemptSucceeded as ds, atprotoDidMethod as dt, identityFromSeedB64 as du, irohDescriptor as ea, enrollProofFrame as ec, APP_RANGE_LIMITS as ei, canonicalJson as el, TEST_USDT_FAUCET_AMOUNT as en, buttonLabelClash as eo, readGroupWantNo as er, HANDOFF_HELLO as es, parseSshSignature as et, budgetRetryMs as eu, readAppStoreSteps as f, VOICE_METER as fa, ContactRequestError as fc, HOLD_LIMITS as fi, encodeInviteCode as fl, sparkInvoiceDetails as fn, GROUP_ADMIN_OFF_ERROR as fo, COMMUNITY_TOPOLOGY as fr, handoffBusyFrame as fs, atprotoProofRecord as ft, publicKeyFromZ32 as fu, groupTypingEpoch as g, parseVoiceMeta as ga, knockSlotOf as gc, newMailbox as gi, DEVICES_CAPABILITY as gl, isPubkyProofFolder as gn, commitHash as go, freshHubs as gr, handoffDataFrame as gs, normalizeAtprotoHandle as gt, sanitizeDisplayText as gu, GroupTypingBoard as h, fileMessageText as ha, knockSlotIdentity as hc, isHoldUrl as hi, ownInviteRefusal as hl, isPubkyKey as hn, MEMBER_KEY as ho, doorHubs as hr, handoffContextProof as hs, isAtprotoDid as ht, sanitizeAvatar as hu, appRevocationFor as i, peekDhtMailbox as ia, clearMissed as ic, isAppVersion as ii, encodeContactLink as il, assertTokenUnits as in, sameButtonText as io, SIGNAL_HOLD_MS as ir, HANDOFF_REQUEST as is, verifyBitcoinMessage as it, RELAY_PAYLOAD_MAX_BYTES as iu, mergeKnocks as j, REACTION_LIMITS as ja, appViewOf as jc, wellKnownUrl as ji, turnPutSummary as jl, isFederationId as jn, parseLocalTarget as jo, transferEnded as jr, readHandoffHave as js, didWebFile as jt, knockIdentity as k, COMMUNITY_REACTION_FRAME as ka, APP_PERMISSIONS as kc, recordsName as ki, TURN_SETTLE_MS as kl, fedimintRequestPayload as kn, GhostlyHttpError as ko, FILE_LIMITS as kr, readHandoffCancel as ks, didSignedMessages as kt, APP_STORE_LIMITS as l, sanitizeMime as la, settleRequest as lc, UPGRADE_CAPABILITY as li, OwnInviteError as ll, SPARK_NETWORKS as ln, heardTime as lo, mayBeHub as lr, handoffAttemptAllowed as ls, ATPROTO_PROOF_COLLECTION as lt, createIdentity as lu, GROUP_TYPING_FRAME as m, downsamplePeaks as ma, contactDay as mc, HoldRefusedError as mi, inviteOwnership as ml, PUBKY_PROOF_MAX_BYTES as mn, MAX_GROUP_CHAIN as mo, beaconRecords as mr, handoffContext as ms, checkAtprotoProofRecord as mt, MAX_AVATAR_LENGTH as mu, readX401SdJwtVc as n, DHT_FILE_TOO_LARGE as na, readEnrollHello as nc, APP_DATA_MAX_BYTES as ni, readCanonicalJson as nl, WALLET_NETWORKS as nn, cardUrl as no, GROUP_SIGNAL_FRAME as nr, HANDOFF_PAKE as ns, sshSignCommand as nt, withRequestOptions as nu, appUpdateDecision as o, dhtFileId as oa, inboxRecord as oc, BUTTONS_CAPABILITY as oi, createDeviceInvite as ol, formatPaymentAmount as on, statusCardText as oo, groupSignalFrame as or, HANDOFF_VERIFIED as os, decodeAnyBitcoinAddress as ot, newerPacket as ou, signAppStore as p, baseMime as pa, REQUEST_LIFETIME_MS as pc, HoldKeys as pi, inviteLink as pl, isBitcoinAddress as pn, GROUP_MEMBER_CAP as po, beaconKeys as pr, handoffCancelFrame as ps, atprotoProofRkey as pt, verify as pu, parseCommunityEdit as q, PR_CHECKS as qa, readAppRevocation as qc, revokesIdentity as qi, RelayTransport as ql, GROUP_WANT_NO_FRAME as qn, HTTP_SERVICE_PROTO as qo, deviceWakeRequest as qr, ENROLL_PROOF as qs, signDidDhtPacket as qt, sameX401HolderJwk as r, DHT_MESSAGE_TTL as ra, verifyEnrollProof as rc, chatAppId as ri, createContactLink as rl, arkAddressPrefix as rn, checkStatusCard as ro, SIGNAL_FRESH_MS as rr, HANDOFF_PIECE_BYTES as rs, verifySshSignature as rt, PacketTooLargeError as ru, checkAppBeforeRun as s, formatFileSize as sa, newInbox as sc, EDIT_CAPABILITY as si, deviceInviteJoinerParams as sl, validatePaymentTarget as sn, arrivalKey as so, readGroupSignal as sr, NO_ATTEMPTS as ss, ATPROTO_DECLARED_SCOPE as st, openRelayPayload as su, newX401HolderKey as t, irohRelayUrl as ta, readEnrollGrant as tc, isServeId as ti, canonicalJsonBytes as tl, USDT_PUBLIC_RPC as tn, cardLine as to, CarriedTransport as tr, HANDOFF_OFFER as ts, sameSshKey as tt, isDiscoveryBudgetError as tu, checkAppStoreIndex as u, PLAYABLE_AUDIO as ua, takeRequest as uc, HOLD_CAPABILITY as ui, createChatInvite as ul, SPARK_PROVIDER as un, receivedTimestamp as uo, meshHubs as ur, handoffAttemptFailed as us, ATPROTO_PROOF_SCOPE as ut, identityFromSeed as uu, sealGroupTyping as v, voiceLevel as va, linkRecords as vc, DOMAIN_FILE_MAX_BYTES as vi, HANDOFF_CAPABILITY as vl, normalizePubkyKey as vn, rosterAdmin as vo, lobbyRecords as vr, handoffEphemeral as vs, shortAtprotoDid as vt, fromBase64Url as vu, encodeCommunityLink as w, RateWindow as wa, requestRecords as wc, isPublicAddress as wi, newDeviceSetSecret as wl, requestLnurlInvoice as wn, DHT_POLL_INTERVALS as wo, readBeacon as wr, handoffRetryAfter as ws, DidError as wt, utf8Encode as wu, GROUP_READ_NOTE_COMMUNITY as x, EDIT_RATE_WINDOW_MS as xa, openRequest as xc, domainTxtRecord as xi, deviceKeyZ32 as xl, pubkyProofPath as xn, edgeParams as xo, newerHead as xr, handoffOfferFrame as xs, DID_DOCUMENT_MAX_BYTES as xt, toBase64Url as xu, COMMUNITY_LIMITS as y, parseVideoMeta as ya, makeStampPaced as yc, decodeDnsResponse as yi, deviceEchoFrame as yl, pubkyProofCapability as yn, rosterHas as yo, mergeBeacon as yr, handoffHelloFrame as ys, AtprotoProofError as yt, isZ32Key as yu, GROUP_REACTED_FRAME as z, wireReaction as za, APP_PREFIXES as zc, IdentityCheckUnavailable as zi, turnInstance as zl, pairedMessageFrame as zn, buildSdpFromSignal as zo, PIN_LIMITS as zr, readSetUpdate as zs, signingKeys as zt };
|
|
34796
|
+
export { SshSigError as $, RUN_RESULTS as $a, signAppObject as $c, TRANSPORTS as $i, currentRelays as $l, readGroupHave as $n, HANDOFF_ACK as $o, checkPushEndpoint as $r, enrollDigits as $s, SEPOLIA_TEST_USDT as $t, knockIdentity as A, forwardedAgain as Aa, APP_BUNDLE_MAGIC as Ac, recordsName as Ai, TURN_PUT_WINDOW_MS as Al, fedimintRequestPayload as An, WATCH_PEER_MS as Ao, FILE_LIMITS as Ar, newHandoffId as As, didSignedMessages as At, GROUP_REACTED_FRAME as B, readReaction as Ba, readAppBundleAsync as Bc, IdentityCheckUnavailable as Bi, signTurnPacket as Bl, pairedMessageFrame as Bn, RTC_CONFIG as Bo, PIN_LIMITS as Br, SET_ACK as Bs, signingKeys as Bt, communityHasFrame as C, MAX_REMOVAL_NUMBER as Ca, mergeContactKnocks as Cc, domainWellKnownFile as Ci, deviceEchoNonce as Cl, homeserverWebEndpoint as Cn, verifyCommitSignature as Co, pickHubs as Cr, handoffManifestFrames as Cs, DID_FILE_MAX_BYTES as Ct, randomBytes as Cu, decodeGroupEntryLink as D, LINK_TRAILING as Da, requestRecords as Dc, normalizeDomain as Di, newDeviceSetSecret as Dl, decodeBolt11 as Dn, DHT_POLL_INTERVALS as Do, readLobby as Dr, handoffRetryAfter as Ds, checkDidSignature as Dt, utf8Encode as Du, KNOCK_TTL_MS as E, dhtEditId as Ea, readLinkRecord as Ec, nip05RootKey as Ei, devicePingFrame as El, resolveLightningDestination as En, AWAITING_PEER_MS as Eo, readBeaconHead as Er, handoffReleaseFrame as Es, checkDidJws as Et, utf8Decode as Eu, GroupWakeLimiter as F, ReactionWindow as Fa, assembleAppBundle as Fc, capsDescriptors as Fi, TURN_LAST_SEQUENCE as Fl, GhostLink as Fn, webLocalFetch as Fo, TYPING_REFRESH_MS as Fr, readHandoffHello as Fs, didWebHost as Ft, GROUP_EDIT_FRAME as G, replySnippet as Ga, appRef as Gc, identityStatement as Gi, turnStatedVerifier as Gl, GROUP_FILE_LIMITS as Gn, contactRtcConfig as Go, readPin as Gr, signTombstone as Gs, encodeDidDhtDeactivated as Gt, GroupSession as H, wireReaction as Ha, APP_PREFIXES as Hc, boundVerifiedIdentity as Hi, turnInstance as Hl, engineError as Hn, buildSdpFromSignal as Ho, nextPinNumber as Hr, readSetUpdate as Hs, strictBase64Url as Ht, groupWakeFrame as I, nextReactionNumber as Ia, checkAppManifest as Ic, dialDescriptors as Ii, TURN_MAX as Il, INVITE_TAKEN as In, LIMITS as Io, TypingSender as Ir, readHandoffPake as Is, normalizeDid as It, parseCommunityEdit as J, CRON_LINE as Ja, isAppKey as Jc, revokesIdentity as Ji, HEDGE_MISSING_MS as Jl, GROUP_WANT_NO_FRAME as Jn, signalHasVideo as Jo, deviceWakeRequest as Jr, ENROLL_GRANT as Js, signDidDhtPacket as Jt, GROUP_EDIT_TEXT_BYTES as K, BUTTON_ID as Ka, checkAppRevokeStatement as Kc, newIdentityBinding as Ki, turnVerifierMark as Kl, GROUP_HAVE_FRAME as Kn, extractParamsFromSdp as Ko, WAKE_CALL_INTERVAL_MS as Kr, verifySetUpdate as Ks, encodeDidDhtPacket as Kt, groupWakes as L, queueReaction as La, isAppUrl as Lc, IDENTITY_MAX_EVIDENCE as Li, firstDeviceSetSecret as Ll, LIVENESS_PING_MS as Ln, decodeControl as Lo, sanitizeTypingStatus as Lr, readHandoffTurnFrame as Ls, parseDid as Lt, mergeKnocks as M, COMMUNITY_REACTION_FRAME as Ma, APP_PERMISSIONS as Mc, wellKnownUrl as Mi, TURN_SETTLE_MS as Ml, isFederationId as Mn, GhostlyHttpError as Mo, transferEnded as Mr, readHandoffCancel as Ms, didWebFile as Mt, readKnocks as N, GROUP_REACTION_FRAME as Na, appDigest as Nc, CapsExchange as Ni, classifyTurnRead as Nl, parseCashuRequestPayload as Nn, formatLocalTarget as No, transferStalled as Nr, readHandoffDone as Ns, didWebFileNames as Nt, encodeGroupEntryLink as O, linkStop as Oa, seenEntry as Oc, recordsFromTxt as Oi, seedSigner as Ol, ENDPOINT as On, EXPECT_PEER_MS as Oo, shouldBeHub as Or, handoffStreamKey as Os, didGhostlyServiceEntry as Ot, GROUP_WAKE_FRAME as P, REACTION_LIMITS as Pa, appViewOf as Pc, DHT_TEXT_CAPABILITY as Pi, turnPutSummary as Pl, parseFedimintRequestPayload as Pn, parseLocalTarget as Po, TYPING_KINDS as Pr, readHandoffHave as Ps, didWebFileUrl as Pt, SSHSIG_NAMESPACE as Q, ROUTINE_STATES as Qa, setAppSignatureFastPath as Qc, validExternalKey as Qi, SLOW_MS as Ql, readGroupFileMeta as Qn, serviceIdFromName as Qo, wakeRequest as Qr, enrollCancelReason as Qs, PaymentPreflightError as Qt, parseGroupWakeFrame as R, reactionEmoji as Ra, pacer as Rc, IDENTITY_MAX_VALIDITY as Ri, nextTurnPosition as Rl, PAIRED_FRAME_TOO_LARGE as Rn, encodeControl as Ro, typingActivity as Rr, readHandoffVerified as Rs, parseDidDocument as Rt, GROUP_READ_NOTE_COMMUNITY as S, EDIT_RATE_WINDOW_MS as Sa, makeStampPaced as Sc, domainTxtRecord as Si, deviceEchoFrame as Sl, pubkyProofPath as Sn, rosterHas as So, newerHead as Sr, handoffHelloFrame as Ss, DID_DOCUMENT_MAX_BYTES as St, isZ32Key as Su, encodeCommunityLink as T, RateWindow as Ta, readKnockSlot as Tc, isPublicAddress as Ti, deviceLinkPairing as Tl, requestLnurlInvoice as Tn, DirectPathWatch as To, readBeacon as Tr, handoffPakeFrame as Ts, DidError as Tt, toZ32 as Tu, frameBytes as U, pairedReplyAuthor as Ua, APP_STATEMENT_LIMITS as Uc, emptyIdentityLedger as Ui, turnKeys as Ul, engineText as Un, callRtcConfig as Uo, pinIsNewer as Ur, setAckFrame as Us, didDhtDocument as Ut, GROUP_READ_NOTE as V, validReactionNumber as Va, sha256Paced as Vc, IdentityExchange as Vi, signTurnRelease as Vl, EngineError as Vn, answersOffer as Vo, mayPin as Vr, SET_UPDATE as Vs, staticDidDocument as Vt, COMMUNITY_EDIT_FRAME as W, readReply as Wa, appFingerprint as Wc, identityRevocationValue as Wi, turnName as Wl, parseEngineError as Wn, callSignalHeardAt as Wo, pinNumberHolds as Wr, setUpdateFrame as Ws, didDhtFromPublicKey as Wt, groupName as X, PR_CHECKS as Xa, readAppRevocation as Xc, PeerProofs as Xi, RelayTransport as Xl, groupFileFallback as Xn, HTTP_SERVICE_PROTO as Xo, parseWakeFrame as Xr, ENROLL_PROOF as Xs, EVM_TEST_CHAINS as Xt, mentionsMember as Y, ITEM_STATES as Ya, isAppRef as Yc, lastSharedWithMe as Yi, HEDGE_MS as Yl, fetchesByItself as Yn, emptyLinkRecords as Yo, newWakeToken as Yr, ENROLL_HELLO as Ys, ETHEREUM_USDT as Yt, SSHSIG_MAX_ARMOR as Z, PR_STATES as Za, readAppRevocations as Zc, emptyProofLedger as Zi, RelaysFailedError as Zl, isGroupMessageId as Zn, LEGACY_SERVICES as Zo, relayRequest as Zr, enrollCancelFrame as Zs, ONCHAIN_PROVIDER as Zt, groupTypingEpoch as _, parseVoiceMeta as _a, contactDay as _c, newMailbox as _i, inviteOwnership as _l, isPubkyProofFolder as _n, MAX_GROUP_CHAIN as _o, freshHubs as _r, handoffContext as _s, normalizeAtprotoHandle as _t, MAX_AVATAR_LENGTH as _u, appRevocationFor as a, peekDhtMailbox as aa, readEnrollHello as ac, isAppVersion as ai, readCanonicalJson as al, assertTokenUnits as an, cardUrl as ao, SIGNAL_HOLD_MS as ar, HANDOFF_PAKE as as, verifyBitcoinMessage as at, withRequestOptions as au, COMMUNITY_LIMITS as b, parseVideoMeta as ba, knockSlotRecords as bc, decodeDnsResponse as bi, ENROLL_CAPABILITY as bl, pubkyProofCapability as bn, parseGroupCommit as bo, mergeBeacon as br, handoffDigest as bs, AtprotoProofError as bt, bytesEqual as bu, checkAppBeforeRun as c, formatFileSize as ca, endedRequests as cc, EDIT_CAPABILITY as ci, readContactLink as cl, validatePaymentTarget as cn, statusCardBytes as co, readGroupSignal as cr, HANDOFF_TIMINGS as cs, ATPROTO_DECLARED_SCOPE as ct, createRelayPayload as cu, checkAppStoreIndex as d, PLAYABLE_AUDIO as da, planKnocks as dc, HOLD_CAPABILITY as di, readDeviceInvite as dl, SPARK_PROVIDER as dn, claimedTime as do, meshHubs as dr, filePartName as ds, ATPROTO_PROOF_SCOPE as dt, parseRelayPayload as du, automaticTransport as ea, enrollDoneFrame as ec, vapidKeysMatch as ei, signAppRevocation as el, SEPOLIA_TEST_USDT_FAUCET as en, STATUS_CARD_LIMITS as eo, readGroupWant as er, HANDOFF_CANCEL as es, parseSshPublicKey as et, normalizeRelayUrl as eu, readAppStore as f, VOICE_LIMITS as fa, settleRequest as fc, HOLD_DATED_BACK_MS as fi, OwnInviteError as fl, sparkAddressKind as fn, heardTime as fo, pickMeshHubs as fr, handoffAttemptAllowed as fs, atprotoDidMethod as ft, createIdentity as fu, GroupTypingBoard as g, fileMessageText as ga, REQUEST_LIFETIME_MS as gc, isHoldUrl as gi, inviteLink as gl, isPubkyKey as gn, GROUP_MEMBER_CAP as go, doorHubs as gr, handoffCancelFrame as gs, isAtprotoDid as gt, verify as gu, GROUP_TYPING_FRAME as h, downsamplePeaks as ha, ContactRequestError as hc, HoldRefusedError as hi, encodeInviteCode as hl, PUBKY_PROOF_MAX_BYTES as hn, GROUP_ADMIN_OFF_ERROR as ho, beaconRecords as hr, handoffBusyFrame as hs, checkAtprotoProofRecord as ht, publicKeyFromZ32 as hu, addedAppPermissions as i, DHT_MESSAGE_TTL as ia, readEnrollGrant as ic, chatAppId as ii, canonicalJsonBytes as il, arkAddressPrefix as in, cardLine as io, SIGNAL_FRESH_MS as ir, HANDOFF_OFFER as is, verifySshSignature as it, isDiscoveryBudgetError as iu, knockRecords as j, readForwarded as ja, APP_ICON_PATH as jc, txtValue as ji, TURN_RAISE_READ_TIMEOUT_MS as jl, findEndpoint as jn, presenceSeenAt as jo, FileUplink as jr, readHandoffAck as js, didWebDocumentUrl as jt, entryParams as k, parseLinkPreview as ka, APP_BUNDLE_LIMITS as kc, recordsFromWellKnown as ki, webCryptoSigner as kl, cashuRequestPayload as kn, RELAY_POLL_INTERVALS as ko, ChatFiles as kr, handoffVersions as ks, didJwsAlg as kt, planAppUpdate as l, sanitizeFileName as la, inboxRecord as lc, STATUS_CARD_CAPABILITY as li, createDeviceInvite as ll, walletNetworkOf as ln, statusCardText as lo, MESH_HUBS as lr, HANDOFF_VERIFIED as ls, ATPROTO_FULL_SCOPE as lt, newerPacket as lu, signAppStore as m, baseMime as ma, turnOff as mc, HoldKeys as mi, decodeInviteCode as ml, isBitcoinAddress as mn, shownTime as mo, beaconKeys as mr, handoffAttemptSucceeded as ms, atprotoProofRkey as mt, identityFromSeedB64 as mu, readX401SdJwtVc as n, irohRelayUrl as na, enrollHelloFrame as nc, isServeId as ni, readImageMeta as nl, USDT_PUBLIC_RPC as nn, appCardId as no, CarriedTransport as nr, HANDOFF_HAVE as ns, sameSshKey as nt, traceLink as nu, appStoreDecision as o, DHT_FILE_CAPABILITY as oa, verifyEnrollProof as oc, APPS_CAPABILITY as oi, createContactLink as ol, assertWholeSats as on, checkStatusCard as oo, SIGNAL_REPLY_MS as or, HANDOFF_PIECE_BYTES as os, BitcoinAddressError as ot, PacketTooLargeError as ou, readAppStoreSteps as p, VOICE_METER as pa, takeRequest as pc, HOLD_LIMITS as pi, createChatInvite as pl, sparkInvoiceDetails as pn, receivedTimestamp as po, COMMUNITY_TOPOLOGY as pr, handoffAttemptFailed as ps, atprotoProofRecord as pt, identityFromSeed as pu, carryMentions as q, BUTTON_STYLES as qa, isAppHash as qc, receivedIdentityStatus as qi, DEFAULT_RELAYS as ql, GROUP_WANT_FRAME as qn, parseCallSignal as qo, WakeLimiter as qr, ENROLL_DONE as qs, resolveDidDht as qt, sameX401HolderJwk as r, DHT_FILE_TOO_LARGE as ra, enrollProofFrame as rc, APP_DATA_MAX_BYTES as ri, canonicalJson as rl, WALLET_NETWORKS as rn, buttonLabelClash as ro, GROUP_SIGNAL_FRAME as rr, HANDOFF_HELLO as rs, sshSignCommand as rt, budgetRetryMs as ru, appUpdateDecision as s, dhtFileId as sa, clearMissed as sc, BUTTONS_CAPABILITY as si, encodeContactLink as sl, formatPaymentAmount as sn, sameButtonText as so, groupSignalFrame as sr, HANDOFF_REQUEST as ss, decodeAnyBitcoinAddress as st, RELAY_PAYLOAD_MAX_BYTES as su, newX401HolderKey as t, irohDescriptor as ta, enrollGrantFrame as tc, APP_RANGE_LIMITS as ti, parseImageMeta as tl, TEST_USDT_FAUCET_AMOUNT as tn, TASK_STATUSES as to, readGroupWantNo as tr, HANDOFF_DONE as ts, parseSshSignature as tt, setLinkTraceSink as tu, APP_STORE_LIMITS as u, sanitizeMime as ua, newInbox as uc, UPGRADE_CAPABILITY as ui, deviceInviteJoinerParams as ul, SPARK_NETWORKS as un, arrivalKey as uo, mayBeHub as ur, NO_ATTEMPTS as us, ATPROTO_PROOF_COLLECTION as ut, openRelayPayload as uu, openGroupTyping as v, voiceDownloadName as va, knockSlotIdentity as vc, readManifest as vi, ownInviteRefusal as vl, newPubkyProofFolder as vn, MEMBER_KEY as vo, lobbyKeys as vr, handoffContextProof as vs, parseAtprotoDidDocument as vt, sanitizeAvatar as vu, decodeCommunityLink as w, REMOVED_TEXT as wa, openRequest as wc, encodeDnsQuery as wi, deviceKeyZ32 as wl, pubkyHomeserverOf as wn, edgeParams as wo, rankHubs as wr, handoffOfferFrame as ws, DID_JWS_MAX_LENGTH as wt, toBase64Url as wu, CommunitySession as x, EDIT_BUFFER_MS as xa, linkRecords as xc, dnsProofName as xi, HANDOFF_CAPABILITY as xl, pubkyProofFile as xn, rosterAdmin as xo, mergeLobby as xr, handoffEphemeral as xs, verifyAtprotoRecordProof as xt, fromBase64Url as xu, sealGroupTyping as y, voiceLevel as ya, knockSlotOf as yc, DOMAIN_FILE_MAX_BYTES as yi, DEVICES_CAPABILITY as yl, normalizePubkyKey as yn, commitHash as yo, lobbyRecords as yr, handoffDataFrame as ys, shortAtprotoDid as yt, sanitizeDisplayText as yu, GROUP_LIMITS as z, reactionIsNewer as za, readAppBundle as zc, IDENTITY_REVOCATION_LABEL as zi, readTurnPacket as zl, pairedMessageFits as zn, CALL_SIGNAL_MAX_AGE_MS as zo, GROUP_PIN_FRAME as zr, sealHandoffPiece as zs, parseDidSignaturePaste as zt };
|
|
34416
34797
|
|
|
34417
|
-
//# sourceMappingURL=src-
|
|
34798
|
+
//# sourceMappingURL=src-BB5-5P3s.js.map
|