@ghostlytools/cli 1.7.2 → 1.7.3
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 +22 -14
- package/SKILL.md +5 -1
- package/dist/assets/{api-CcuCtc1H.js → api-B42F9ytB.js} +2 -2
- package/dist/assets/{api-tSZELCPQ.js → api-tf-wAAnB.js} +214 -87
- package/dist/assets/api-tf-wAAnB.js.map +1 -0
- package/dist/assets/{apiKit-BFk7GAk9.js → apiKit-DJb9hulp.js} +33 -4
- package/dist/assets/{apiKit-BFk7GAk9.js.map → apiKit-DJb9hulp.js.map} +1 -1
- package/dist/assets/{apps-D6THreq_.js → apps-BfoDISRg.js} +1 -1
- package/dist/assets/{apps-C5Mi6x9Q.js → apps-DIrWmLgL.js} +3 -3
- package/dist/assets/{apps-C5Mi6x9Q.js.map → apps-DIrWmLgL.js.map} +1 -1
- package/dist/assets/{arkade-Cz0B9bJ0.js → arkade-CJAhhgPQ.js} +2 -2
- package/dist/assets/{arkade-Cz0B9bJ0.js.map → arkade-CJAhhgPQ.js.map} +1 -1
- package/dist/assets/{backup-A0hIa9GE.js → backup-BkUeeduy.js} +1 -1
- package/dist/assets/{backup-Wb2sm2dd.js → backup-Bko-AAm0.js} +4 -4
- package/dist/assets/{backup-Wb2sm2dd.js.map → backup-Bko-AAm0.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/buttons-Be7u0V5g.js +2 -0
- package/dist/assets/{buttons-Cf70NVYq.js → buttons-DeA6Yddq.js} +34 -8
- package/dist/assets/buttons-DeA6Yddq.js.map +1 -0
- package/dist/assets/{envelope-kQ5kYjVE.js → envelope-Cz5fc7BM.js} +2 -2
- package/dist/assets/{envelope-kQ5kYjVE.js.map → envelope-Cz5fc7BM.js.map} +1 -1
- package/dist/assets/{groupFiles-D9Ttlm3M.js → groupFiles-BlZRBWpt.js} +558 -4
- package/dist/assets/groupFiles-BlZRBWpt.js.map +1 -0
- package/dist/assets/{host-DpypH-fR.js → host-BX0DmKW6.js} +38 -15
- package/dist/assets/host-BX0DmKW6.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-D1rj84v2.js → hyperdhtRelay-DitYDnXx.js} +2 -2
- package/dist/assets/{hyperdhtRelay-D1rj84v2.js.map → hyperdhtRelay-DitYDnXx.js.map} +1 -1
- package/dist/assets/{irohWeb-BTSlWgEX.js → irohWeb-R3bcd34h.js} +2 -2
- package/dist/assets/{irohWeb-BTSlWgEX.js.map → irohWeb-R3bcd34h.js.map} +1 -1
- package/dist/assets/{main-BwgoQZVu.js → main-6QOSvQ8b.js} +247 -102
- package/dist/assets/main-6QOSvQ8b.js.map +1 -0
- package/dist/assets/{mainline-B1urhbEZ.js → mainline-BfwezHWi.js} +2 -2
- package/dist/assets/{mainline-B1urhbEZ.js.map → mainline-BfwezHWi.js.map} +1 -1
- package/dist/assets/{networkReason-D2Z0BdIj.js → networkReason-Ba9415nn.js} +2 -2
- package/dist/assets/{networkReason-D2Z0BdIj.js.map → networkReason-Ba9415nn.js.map} +1 -1
- package/dist/assets/{nwc-T2aUK6bi.js → nwc-ovXSN2M2.js} +3 -3
- package/dist/assets/{nwc-T2aUK6bi.js.map → nwc-ovXSN2M2.js.map} +1 -1
- package/dist/assets/{nwcProvider-Dz-ty_DE.js → nwcProvider-BzZbfFP3.js} +2 -2
- package/dist/assets/{nwcProvider-Dz-ty_DE.js.map → nwcProvider-BzZbfFP3.js.map} +1 -1
- package/dist/assets/{registry-Bazitl0a.js → registry-B0Uv9yL6.js} +3 -3
- package/dist/assets/{registry-Bazitl0a.js.map → registry-B0Uv9yL6.js.map} +1 -1
- package/dist/assets/{registry-BlSTJlbv.js → registry-CFtlhWCI.js} +1 -1
- package/dist/assets/{resolve-Bx1Eeg-w.js → resolve-BzFG4WDU.js} +2 -2
- package/dist/assets/{resolve-Bx1Eeg-w.js.map → resolve-BzFG4WDU.js.map} +1 -1
- package/dist/assets/{server-CnPj9wWh.js → server-BGCuHbmQ.js} +266 -594
- package/dist/assets/server-BGCuHbmQ.js.map +1 -0
- package/dist/assets/{src-BsznF3XG.js → src-DWw2hUE5.js} +106 -38
- package/dist/assets/src-DWw2hUE5.js.map +1 -0
- package/dist/assets/{translate-cDBotA-b.js → translate-DObb-1tq.js} +2 -2
- package/dist/assets/{translate-cDBotA-b.js.map → translate-DObb-1tq.js.map} +1 -1
- package/dist/assets/{usdt-DxxLdG60.js → usdt-Bkva90Vo.js} +3 -3
- package/dist/assets/{usdt-DxxLdG60.js.map → usdt-Bkva90Vo.js.map} +1 -1
- package/dist/assets/{words-qH8gGtmc.js → words-odSAoasK.js} +4 -2
- package/dist/assets/words-odSAoasK.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-tSZELCPQ.js.map +0 -1
- package/dist/assets/buttons-Bxxu3lSk.js +0 -2
- package/dist/assets/buttons-Cf70NVYq.js.map +0 -1
- package/dist/assets/groupFiles-D9Ttlm3M.js.map +0 -1
- package/dist/assets/host-DpypH-fR.js.map +0 -1
- package/dist/assets/main-BwgoQZVu.js.map +0 -1
- package/dist/assets/server-CnPj9wWh.js.map +0 -1
- package/dist/assets/src-BsznF3XG.js.map +0 -1
- package/dist/assets/words-qH8gGtmc.js.map +0 -1
|
@@ -328,9 +328,13 @@ function publicKeyFromZ32(z32) {
|
|
|
328
328
|
function sign(message, seed) {
|
|
329
329
|
return ed25519.sign(message, seed);
|
|
330
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Ed25519 verification as RFC 8032 writes it (`zip215: false`): canonical encodings only, and no key of small order,
|
|
333
|
+
* which no secret key goes with and which "verifies" a constant signature of any message.
|
|
334
|
+
*/
|
|
331
335
|
function verify(signature, message, publicKey) {
|
|
332
336
|
try {
|
|
333
|
-
return ed25519.verify(signature, message, publicKey);
|
|
337
|
+
return ed25519.verify(signature, message, publicKey, { zip215: false });
|
|
334
338
|
} catch {
|
|
335
339
|
return false;
|
|
336
340
|
}
|
|
@@ -1939,7 +1943,7 @@ var RelayTransport = class {
|
|
|
1939
1943
|
}
|
|
1940
1944
|
/** `sent`: told, once the budget took the request, whether the relay takes the packet (a 2xx). */
|
|
1941
1945
|
async put(relay, pubKeyZ32, payload, replaces, who, probe = false, sent) {
|
|
1942
|
-
if (!probe && this.networkCoolingDown(relay, "PUT")) throw new Error(
|
|
1946
|
+
if (!probe && this.networkCoolingDown(relay, "PUT")) throw new Error(`${relay} did not answer a moment ago; retry shortly`);
|
|
1943
1947
|
const limited = this.rateLimitedFor(relay);
|
|
1944
1948
|
if (limited > 0) throw new DiscoveryBudgetError(limited, "Discovery relay is cooling down after a 429; retry shortly");
|
|
1945
1949
|
const blocked = probe ? 0 : this.breaker.blockedFor(relay);
|
|
@@ -18093,10 +18097,7 @@ var ChatFiles = class {
|
|
|
18093
18097
|
}
|
|
18094
18098
|
switch (record.state) {
|
|
18095
18099
|
case "done":
|
|
18096
|
-
this.
|
|
18097
|
-
t: "pf-done",
|
|
18098
|
-
id
|
|
18099
|
-
});
|
|
18100
|
+
this.sayDone(id);
|
|
18100
18101
|
return;
|
|
18101
18102
|
case "declined":
|
|
18102
18103
|
this.send({
|
|
@@ -18391,10 +18392,7 @@ var ChatFiles = class {
|
|
|
18391
18392
|
async onSum(entry, frame) {
|
|
18392
18393
|
const { record } = entry, incoming = entry.in;
|
|
18393
18394
|
if (record.state === "done") {
|
|
18394
|
-
this.
|
|
18395
|
-
t: "pf-done",
|
|
18396
|
-
id: record.id
|
|
18397
|
-
});
|
|
18395
|
+
this.sayDone(record.id);
|
|
18398
18396
|
return;
|
|
18399
18397
|
}
|
|
18400
18398
|
if (record.state !== "active" || incoming.verifying || !incoming.target) return;
|
|
@@ -18427,10 +18425,7 @@ var ChatFiles = class {
|
|
|
18427
18425
|
record.digest = digest;
|
|
18428
18426
|
record.confirmed = record.file.size;
|
|
18429
18427
|
this.end(entry, "done");
|
|
18430
|
-
this.
|
|
18431
|
-
t: "pf-done",
|
|
18432
|
-
id: record.id
|
|
18433
|
-
});
|
|
18428
|
+
this.sayDone(record.id);
|
|
18434
18429
|
} else {
|
|
18435
18430
|
await incoming.target.then((t) => t.discard()).catch(() => {});
|
|
18436
18431
|
this.end(entry, "failed", "The file arrived damaged and was deleted. Ask for it again.");
|
|
@@ -18442,6 +18437,24 @@ var ChatFiles = class {
|
|
|
18442
18437
|
}
|
|
18443
18438
|
this.startNext();
|
|
18444
18439
|
}
|
|
18440
|
+
/**
|
|
18441
|
+
* `pf-done` once the host kept the file's done record (`kept`). Not kept (the app gone first), the sender still
|
|
18442
|
+
* waits, offers it again on the next session, and the receiver answers from what it kept.
|
|
18443
|
+
*/
|
|
18444
|
+
sayDone(id) {
|
|
18445
|
+
const kept = this.host.kept?.().catch(() => {});
|
|
18446
|
+
if (!kept) {
|
|
18447
|
+
this.send({
|
|
18448
|
+
t: "pf-done",
|
|
18449
|
+
id
|
|
18450
|
+
});
|
|
18451
|
+
return;
|
|
18452
|
+
}
|
|
18453
|
+
kept.then(() => this.send({
|
|
18454
|
+
t: "pf-done",
|
|
18455
|
+
id
|
|
18456
|
+
}));
|
|
18457
|
+
}
|
|
18445
18458
|
/** A frame from the contact (one of `FILE_FRAMES`). Returns quickly: writing goes on in the background. */
|
|
18446
18459
|
async handle(frame) {
|
|
18447
18460
|
if (!this.attached) return;
|
|
@@ -20446,6 +20459,8 @@ var GhostLink = class {
|
|
|
20446
20459
|
offerReplaced;
|
|
20447
20460
|
lastAutoConnectAt = 0;
|
|
20448
20461
|
autoConnectFailures = 0;
|
|
20462
|
+
/** The wait (dial and count of failures) whose `dial-backoff` line is written: the looks during it write none. */
|
|
20463
|
+
backoffTraced = "";
|
|
20449
20464
|
/** The look due when a failed dial's backoff ends (`lookAtRetry`). */
|
|
20450
20465
|
retryLook = null;
|
|
20451
20466
|
/** This side's offer is out to the data link and has not reached the relays yet. */
|
|
@@ -22760,10 +22775,14 @@ var GhostLink = class {
|
|
|
22760
22775
|
}
|
|
22761
22776
|
const wait = this.dialWait();
|
|
22762
22777
|
if (Date.now() - this.lastAutoConnectAt < wait) {
|
|
22763
|
-
|
|
22764
|
-
|
|
22765
|
-
|
|
22766
|
-
|
|
22778
|
+
const backoff = `${this.lastAutoConnectAt}:${this.autoConnectFailures}`;
|
|
22779
|
+
if (backoff !== this.backoffTraced) {
|
|
22780
|
+
this.backoffTraced = backoff;
|
|
22781
|
+
traceLink(this.myPubKeyZ32, "dial-backoff", {
|
|
22782
|
+
failures: this.autoConnectFailures,
|
|
22783
|
+
left: wait - (Date.now() - this.lastAutoConnectAt)
|
|
22784
|
+
});
|
|
22785
|
+
}
|
|
22767
22786
|
if (!pairing && !this.options.packetTransports && this.myPubKeyZ32 < this.options.params.peerPubKeyZ32 && Date.now() >= this.lostUntil) this.session.calm();
|
|
22768
22787
|
this.lookAtRetry();
|
|
22769
22788
|
return;
|
|
@@ -25952,11 +25971,13 @@ function didDhtKey(did) {
|
|
|
25952
25971
|
if (!/^[ybndrfg8ejkmcpqxot1uwisza345h769]{52}$/.test(z32)) throw invalid();
|
|
25953
25972
|
const publicKey = fromZ32(z32);
|
|
25954
25973
|
if (toZ32(publicKey) !== z32) throw invalid();
|
|
25974
|
+
let fit;
|
|
25955
25975
|
try {
|
|
25956
|
-
ed25519.Point.fromBytes(publicKey);
|
|
25976
|
+
fit = !ed25519.Point.fromBytes(publicKey).isSmallOrder();
|
|
25957
25977
|
} catch {
|
|
25958
|
-
|
|
25978
|
+
fit = false;
|
|
25959
25979
|
}
|
|
25980
|
+
if (!fit) throw invalid();
|
|
25960
25981
|
return {
|
|
25961
25982
|
z32,
|
|
25962
25983
|
publicKey
|
|
@@ -26051,11 +26072,13 @@ function jwkOf(type, bytes, alg, kid) {
|
|
|
26051
26072
|
const kind = KEY_TYPES[type];
|
|
26052
26073
|
if (type === 0) {
|
|
26053
26074
|
if (bytes.length !== 32) throw malformed("an Ed25519 key is not 32 bytes");
|
|
26075
|
+
let smallOrder;
|
|
26054
26076
|
try {
|
|
26055
|
-
ed25519.Point.fromBytes(bytes);
|
|
26077
|
+
smallOrder = ed25519.Point.fromBytes(bytes).isSmallOrder();
|
|
26056
26078
|
} catch {
|
|
26057
26079
|
throw malformed("an Ed25519 key is not a point of the curve");
|
|
26058
26080
|
}
|
|
26081
|
+
if (smallOrder) throw malformed("an Ed25519 key is a point of small order, which no secret key goes with");
|
|
26059
26082
|
return {
|
|
26060
26083
|
kty: "OKP",
|
|
26061
26084
|
crv: "Ed25519",
|
|
@@ -26643,16 +26666,16 @@ var MULTICODEC = [
|
|
|
26643
26666
|
];
|
|
26644
26667
|
/** A public key on its curve, validated; ECDSA keys compressed. */
|
|
26645
26668
|
function curveKey(curve, bytes) {
|
|
26669
|
+
let smallOrder;
|
|
26646
26670
|
try {
|
|
26647
|
-
if (curve
|
|
26648
|
-
|
|
26649
|
-
|
|
26650
|
-
return bytes;
|
|
26651
|
-
}
|
|
26652
|
-
return (curve === "secp256k1" ? secp256k1 : p256).Point.fromBytes(bytes).toBytes(true);
|
|
26671
|
+
if (curve !== "Ed25519") return (curve === "secp256k1" ? secp256k1 : p256).Point.fromBytes(bytes).toBytes(true);
|
|
26672
|
+
if (bytes.length !== 32) throw new Error();
|
|
26673
|
+
smallOrder = ed25519.Point.fromBytes(bytes).isSmallOrder();
|
|
26653
26674
|
} catch {
|
|
26654
26675
|
throw new DidError(`That ${curve} key is not a valid point`);
|
|
26655
26676
|
}
|
|
26677
|
+
if (smallOrder) throw new DidError("That Ed25519 key is a point of small order, which no secret key goes with");
|
|
26678
|
+
return bytes;
|
|
26656
26679
|
}
|
|
26657
26680
|
/** A `z…` multibase (base58btc) multicodec key. X25519 and unknown codecs are `undefined`. */
|
|
26658
26681
|
function multikey(value) {
|
|
@@ -26917,7 +26940,7 @@ function signingInput(jws, message) {
|
|
|
26917
26940
|
}
|
|
26918
26941
|
function verifyWith(key, signature, message, format = "compact") {
|
|
26919
26942
|
try {
|
|
26920
|
-
if (key.curve === "Ed25519") return format === "compact" && ed25519.verify(signature, message, key.publicKey);
|
|
26943
|
+
if (key.curve === "Ed25519") return format === "compact" && ed25519.verify(signature, message, key.publicKey, { zip215: false });
|
|
26921
26944
|
return (key.curve === "secp256k1" ? secp256k1 : p256).verify(signature, message, key.publicKey, {
|
|
26922
26945
|
prehash: true,
|
|
26923
26946
|
lowS: false,
|
|
@@ -31628,6 +31651,8 @@ var communityMessageId = (sender, epoch, h, seq) => `${sender}:${epoch}:${h}:${s
|
|
|
31628
31651
|
var seenKey = (e, h) => `${e}:${h}`;
|
|
31629
31652
|
/** One of a member's frames, among its own. */
|
|
31630
31653
|
var frameKey = (f) => `${f.e}:${f.h}:${f.n}`;
|
|
31654
|
+
/** A frame among everyone's: each member counts its own `n`, so `frameKey` alone tells only one member's frames apart. */
|
|
31655
|
+
var storeKey = (f) => `${f.s}:${frameKey(f)}`;
|
|
31631
31656
|
/**
|
|
31632
31657
|
* Where a frame said again under a newer commit was first said (`o`, WISP 903 § Messages and catch-up): its commit's
|
|
31633
31658
|
* epoch and short hash and its number there. Never the frame's own place, nor a later epoch than its own.
|
|
@@ -31719,10 +31744,15 @@ var CommunitySession = class {
|
|
|
31719
31744
|
saveTimer;
|
|
31720
31745
|
/** One metadata frame naming a commit or a secret I do not have yet: tried again when the chain or my secrets move. */
|
|
31721
31746
|
pendingMeta;
|
|
31722
|
-
|
|
31747
|
+
/** The store's frames the app holds with their messages (`storeKey` → message id): in memory here, not in what is saved. */
|
|
31748
|
+
onRows = /* @__PURE__ */ new Map();
|
|
31749
|
+
/** `rows`: the frames the app holds with the messages it stored (`CommunityIncomingMessage.frame`). They join the store. */
|
|
31750
|
+
constructor(state, hooks, rows = []) {
|
|
31723
31751
|
this.hooks = hooks;
|
|
31724
31752
|
this.state = state;
|
|
31725
31753
|
this.identity = identityFromSeedB64(state.seedB64);
|
|
31754
|
+
if (state.status === "left" || state.status === "removed") for (const row of rows) hooks.forgetFrame?.(row.id);
|
|
31755
|
+
else this.takeRows(rows);
|
|
31726
31756
|
this.answers = new CatchUpAnswers({
|
|
31727
31757
|
send: (to, frame) => hooks.direct(to, frame),
|
|
31728
31758
|
...hooks.handled && { handled: (to) => hooks.handled(to) },
|
|
@@ -32405,7 +32435,15 @@ var CommunitySession = class {
|
|
|
32405
32435
|
clearTimeout(this.saveTimer);
|
|
32406
32436
|
this.saveTimer = void 0;
|
|
32407
32437
|
}
|
|
32408
|
-
return this.hooks.save(
|
|
32438
|
+
return this.hooks.save(this.toSave());
|
|
32439
|
+
}
|
|
32440
|
+
/** The state as it is saved: a copy, without the frames the app holds with their messages (`onRows`). */
|
|
32441
|
+
toSave() {
|
|
32442
|
+
const { store, ...rest } = this.state;
|
|
32443
|
+
return structuredClone({
|
|
32444
|
+
...rest,
|
|
32445
|
+
store: store.filter((f) => !this.onRows.has(storeKey(f)))
|
|
32446
|
+
});
|
|
32409
32447
|
}
|
|
32410
32448
|
/**
|
|
32411
32449
|
* A save within a second, for what may happen many times a second (every message received, in a
|
|
@@ -32415,7 +32453,7 @@ var CommunitySession = class {
|
|
|
32415
32453
|
if (this.saveTimer) return;
|
|
32416
32454
|
this.saveTimer = setTimeout(() => {
|
|
32417
32455
|
this.saveTimer = void 0;
|
|
32418
|
-
this.hooks.save(
|
|
32456
|
+
this.hooks.save(this.toSave());
|
|
32419
32457
|
}, 1e3);
|
|
32420
32458
|
}
|
|
32421
32459
|
/** Writes what is waiting to be saved now (before a restart, in tests). */
|
|
@@ -32682,6 +32720,8 @@ var CommunitySession = class {
|
|
|
32682
32720
|
this.state.statusReason = reason;
|
|
32683
32721
|
this.state.secrets = {};
|
|
32684
32722
|
this.state.store = [];
|
|
32723
|
+
for (const id of this.onRows.values()) this.hooks.forgetFrame?.(id);
|
|
32724
|
+
this.onRows.clear();
|
|
32685
32725
|
delete this.state.lasting;
|
|
32686
32726
|
this.state.entry = {
|
|
32687
32727
|
key: this.state.entry.key,
|
|
@@ -32722,7 +32762,7 @@ var CommunitySession = class {
|
|
|
32722
32762
|
...described ? { fl: described } : {}
|
|
32723
32763
|
}), nick, now);
|
|
32724
32764
|
if ("error" in sent) return sent;
|
|
32725
|
-
await this.hooks.message({
|
|
32765
|
+
if (await this.hooks.message({
|
|
32726
32766
|
id: sent.id,
|
|
32727
32767
|
sender: this.myKey,
|
|
32728
32768
|
epoch: sent.frame.e,
|
|
@@ -32733,8 +32773,9 @@ var CommunitySession = class {
|
|
|
32733
32773
|
...answers ? { reply: answers } : {},
|
|
32734
32774
|
...hops ? { forwarded: hops } : {},
|
|
32735
32775
|
...card ? { card } : {},
|
|
32736
|
-
...described ? { file: described } : {}
|
|
32737
|
-
|
|
32776
|
+
...described ? { file: described } : {},
|
|
32777
|
+
frame: sent.frame
|
|
32778
|
+
}) === true) this.onRows.set(storeKey(sent.frame), sent.id);
|
|
32738
32779
|
await this.say(sent.frame);
|
|
32739
32780
|
return { id: sent.id };
|
|
32740
32781
|
});
|
|
@@ -32900,6 +32941,8 @@ var CommunitySession = class {
|
|
|
32900
32941
|
const author = id.slice(0, id.indexOf(":"));
|
|
32901
32942
|
const kept = this.state.store.filter((f) => f.s !== author || this.storedId(f) !== id);
|
|
32902
32943
|
if (kept.length === this.state.store.length) return;
|
|
32944
|
+
const left = new Set(kept.map(storeKey));
|
|
32945
|
+
for (const f of this.state.store) if (!left.has(storeKey(f))) this.onRows.delete(storeKey(f));
|
|
32903
32946
|
this.state.store = kept;
|
|
32904
32947
|
this.persistSoon();
|
|
32905
32948
|
}
|
|
@@ -32915,9 +32958,31 @@ var CommunitySession = class {
|
|
|
32915
32958
|
return original ? communityMessageId(f.s, original.e, original.h, original.n) : communityMessageId(f.s, f.e, f.h, f.n);
|
|
32916
32959
|
}
|
|
32917
32960
|
keep(frame) {
|
|
32961
|
+
if (this.onRows.has(storeKey(frame))) return;
|
|
32918
32962
|
this.state.store.push(frame);
|
|
32963
|
+
this.trimStore();
|
|
32964
|
+
}
|
|
32965
|
+
trimStore() {
|
|
32919
32966
|
let bytes = this.state.store.reduce((sum, f) => sum + f.c.length, 0);
|
|
32920
|
-
while (this.state.store.length > COMMUNITY_LIMITS.store || bytes > COMMUNITY_LIMITS.storeBytes)
|
|
32967
|
+
while (this.state.store.length > COMMUNITY_LIMITS.store || bytes > COMMUNITY_LIMITS.storeBytes) {
|
|
32968
|
+
const oldest = this.state.store.shift();
|
|
32969
|
+
bytes -= oldest.c.length;
|
|
32970
|
+
const row = this.onRows.get(storeKey(oldest));
|
|
32971
|
+
if (row === void 0) continue;
|
|
32972
|
+
this.onRows.delete(storeKey(oldest));
|
|
32973
|
+
this.hooks.forgetFrame?.(row);
|
|
32974
|
+
}
|
|
32975
|
+
}
|
|
32976
|
+
/** The frames the app's rows hold, into the store: oldest first by when they were written, with what the record kept from before. */
|
|
32977
|
+
takeRows(rows) {
|
|
32978
|
+
if (!rows.length) return;
|
|
32979
|
+
const inRecord = new Set(this.state.store.map(storeKey));
|
|
32980
|
+
for (const { id, frame } of rows) {
|
|
32981
|
+
this.onRows.set(storeKey(frame), id);
|
|
32982
|
+
if (!inRecord.has(storeKey(frame))) this.state.store.push(frame);
|
|
32983
|
+
}
|
|
32984
|
+
this.state.store.sort((a, b) => a.ts - b.ts);
|
|
32985
|
+
this.trimStore();
|
|
32921
32986
|
}
|
|
32922
32987
|
/**
|
|
32923
32988
|
* My frames sealed under a commit I took for the newest while I was behind (no edge was up, and others were let in
|
|
@@ -33240,13 +33305,14 @@ var CommunitySession = class {
|
|
|
33240
33305
|
this.state.nicks[raw.s] = nick;
|
|
33241
33306
|
this.hooks.changed();
|
|
33242
33307
|
}
|
|
33308
|
+
let onRow = false;
|
|
33243
33309
|
if (text !== void 0) {
|
|
33244
33310
|
const mentions = validMentions(parsed.m, text, false);
|
|
33245
33311
|
const reply = parsed.r === void 0 ? void 0 : readReply(parsed.r, groupReplyAuthor);
|
|
33246
33312
|
const forwarded = readForwarded(parsed.fw);
|
|
33247
33313
|
const card = parsed.sc === void 0 ? void 0 : readStatusCard(parsed.sc);
|
|
33248
33314
|
const file = parsed.fl === void 0 ? void 0 : readGroupFileMeta(parsed.fl) ?? void 0;
|
|
33249
|
-
await this.hooks.message({
|
|
33315
|
+
onRow = await this.hooks.message({
|
|
33250
33316
|
id,
|
|
33251
33317
|
sender: raw.s,
|
|
33252
33318
|
epoch: raw.e,
|
|
@@ -33257,7 +33323,8 @@ var CommunitySession = class {
|
|
|
33257
33323
|
...reply ? { reply } : {},
|
|
33258
33324
|
...forwarded ? { forwarded } : {},
|
|
33259
33325
|
...card ? { card } : {},
|
|
33260
|
-
...file ? { file } : {}
|
|
33326
|
+
...file ? { file } : {},
|
|
33327
|
+
frame: raw
|
|
33261
33328
|
});
|
|
33262
33329
|
} else if (isObject$2(parsed.x)) {
|
|
33263
33330
|
const app = {
|
|
@@ -33293,6 +33360,7 @@ var CommunitySession = class {
|
|
|
33293
33360
|
...original
|
|
33294
33361
|
});
|
|
33295
33362
|
this.keep(raw);
|
|
33363
|
+
if (onRow === true) this.onRows.set(storeKey(raw), id);
|
|
33296
33364
|
this.persistSoon();
|
|
33297
33365
|
return true;
|
|
33298
33366
|
}
|
|
@@ -34346,4 +34414,4 @@ function readX401SdJwtVc(text) {
|
|
|
34346
34414
|
//#endregion
|
|
34347
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 };
|
|
34348
34416
|
|
|
34349
|
-
//# sourceMappingURL=src-
|
|
34417
|
+
//# sourceMappingURL=src-DWw2hUE5.js.map
|