@ghostlytools/cli 1.11.1 → 1.11.2
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 +24 -16
- package/dist/assets/{api-DL0Uazf6.js → api-BM3PsXbB.js} +359 -114
- package/dist/assets/api-BM3PsXbB.js.map +1 -0
- package/dist/assets/{api-D89ubgas.js → api-CtXgscmK.js} +2 -2
- package/dist/assets/{apiKit-D78MXTrk.js → apiKit-lCTQ0EBG.js} +17 -7
- package/dist/assets/apiKit-lCTQ0EBG.js.map +1 -0
- package/dist/assets/appFetch-BKHy5H8J.js +194 -0
- package/dist/assets/appFetch-BKHy5H8J.js.map +1 -0
- package/dist/assets/{apps-BlSl1nGn.js → apps-DO_gAZgm.js} +1 -1
- package/dist/assets/{apps--pAqmfgQ.js → apps-Do26w3c7.js} +44 -40
- package/dist/assets/apps-Do26w3c7.js.map +1 -0
- package/dist/assets/{arkade-DxB-MR43.js → arkade-CZrLbz-M.js} +2 -2
- package/dist/assets/{arkade-DxB-MR43.js.map → arkade-CZrLbz-M.js.map} +1 -1
- package/dist/assets/{backup-T7gFpU80.js → backup-D21x1f5P.js} +1 -1
- package/dist/assets/{backup-B3JJd75o.js → backup-j47AzDvG.js} +84 -33
- package/dist/assets/backup-j47AzDvG.js.map +1 -0
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/{bitcoind-CZchoh43.js → bitcoind-CdSmvy2y.js} +3 -3
- package/dist/assets/{bitcoind-CZchoh43.js.map → bitcoind-CdSmvy2y.js.map} +1 -1
- package/dist/assets/{bitcoindProvider-DGw3xBSa.js → bitcoindProvider-BvoRh0D5.js} +2 -2
- package/dist/assets/{bitcoindProvider-DGw3xBSa.js.map → bitcoindProvider-BvoRh0D5.js.map} +1 -1
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
- package/dist/assets/{buttons-C1VbDihe.js → buttons-CiGlBVBT.js} +18 -7
- package/dist/assets/buttons-CiGlBVBT.js.map +1 -0
- package/dist/assets/buttons-D2l2bVCG.js +2 -0
- package/dist/assets/{childEnv-BVOQK9EA.js → childEnv-K_IzUqQx.js} +4 -3
- package/dist/assets/childEnv-K_IzUqQx.js.map +1 -0
- package/dist/assets/{client-CGLuWFRV.js → client-raIncVtF.js} +31 -3
- package/dist/assets/client-raIncVtF.js.map +1 -0
- package/dist/assets/{codec-YGJDr7uH.js → codec-DcG2AeyE.js} +2 -2
- package/dist/assets/{codec-YGJDr7uH.js.map → codec-DcG2AeyE.js.map} +1 -1
- package/dist/assets/endpoint-DarqblYE.js +5052 -0
- package/dist/assets/endpoint-DarqblYE.js.map +1 -0
- package/dist/assets/{envelope-Dwq8EN8x.js → envelope-Dud6lntA.js} +2 -2
- package/dist/assets/{envelope-Dwq8EN8x.js.map → envelope-Dud6lntA.js.map} +1 -1
- package/dist/assets/{fedimintSdk-CqTeMdF0.js → fedimintSdk-DRKRSw14.js} +6 -3
- package/dist/assets/fedimintSdk-DRKRSw14.js.map +1 -0
- package/dist/assets/{fixedHosts-CINXidpd.js → fixedHosts-CNX7QiUD.js} +3 -3
- package/dist/assets/{fixedHosts-CINXidpd.js.map → fixedHosts-CNX7QiUD.js.map} +1 -1
- package/dist/assets/{host-CGlHkiQv.js → host-8RskzQgB.js} +306 -84
- package/dist/assets/host-8RskzQgB.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-Bj5jJT5w.js → hyperdhtRelay-uAThbFub.js} +2 -2
- package/dist/assets/{hyperdhtRelay-Bj5jJT5w.js.map → hyperdhtRelay-uAThbFub.js.map} +1 -1
- package/dist/assets/{irohWeb-CYn0uB_A.js → irohWeb-DGelfgDJ.js} +693 -38
- package/dist/assets/irohWeb-DGelfgDJ.js.map +1 -0
- package/dist/assets/jsonOut-POtMBS_V.js +16 -0
- package/dist/assets/jsonOut-POtMBS_V.js.map +1 -0
- package/dist/assets/{main-CgLW_Gyx.js → main-BC33ooYg.js} +175 -107
- package/dist/assets/main-BC33ooYg.js.map +1 -0
- package/dist/assets/{mainline-B0h8RchD.js → mainline-DYrjsS1t.js} +27 -8
- package/dist/assets/mainline-DYrjsS1t.js.map +1 -0
- package/dist/assets/{networkReason-BBosp2KG.js → networkReason-n2oBs4by.js} +3 -3
- package/dist/assets/{networkReason-BBosp2KG.js.map → networkReason-n2oBs4by.js.map} +1 -1
- package/dist/assets/{nwc-SSNS1aJ-.js → nwc-Do3VSlIS.js} +6 -5
- package/dist/assets/nwc-Do3VSlIS.js.map +1 -0
- package/dist/assets/{nwcProvider-BXqJmM98.js → nwcProvider-Du5aWNIn.js} +6 -3
- package/dist/assets/{nwcProvider-BXqJmM98.js.map → nwcProvider-Du5aWNIn.js.map} +1 -1
- package/dist/assets/{ownDid--DtH_Jdi.js → ownDid-CwwYu8s2.js} +3 -3
- package/dist/assets/{ownDid--DtH_Jdi.js.map → ownDid-CwwYu8s2.js.map} +1 -1
- package/dist/assets/{ownStatus-CQPGjCUR.js → ownStatus-D7dB4zJB.js} +4 -3
- package/dist/assets/{ownStatus-CQPGjCUR.js.map → ownStatus-D7dB4zJB.js.map} +1 -1
- package/dist/assets/{profiles-4UQ1Hsds.js → profiles-NyF5FnYF.js} +82 -6
- package/dist/assets/profiles-NyF5FnYF.js.map +1 -0
- package/dist/assets/{registry-B6BXKv6Q.js → registry-C734VrO9.js} +1 -1
- package/dist/assets/{registry-BKCFTEYp.js → registry-DKDInr0A.js} +75 -23
- package/dist/assets/registry-DKDInr0A.js.map +1 -0
- package/dist/assets/{resolve-MFeFljsN.js → resolve-3Tqh9AWQ.js} +4 -3
- package/dist/assets/resolve-3Tqh9AWQ.js.map +1 -0
- package/dist/assets/{server-rHKhnog1.js → server-B6PQ6iae.js} +401 -852
- package/dist/assets/server-B6PQ6iae.js.map +1 -0
- package/dist/assets/{src-BzsyAvPf.js → src-ChJijTlM.js} +395 -129
- package/dist/assets/src-ChJijTlM.js.map +1 -0
- package/dist/assets/{sshForges-qITn-RoV.js → sshForges-Brf0fslM.js} +2 -2
- package/dist/assets/{sshForges-qITn-RoV.js.map → sshForges-Brf0fslM.js.map} +1 -1
- package/dist/assets/{translate-Bkr_iDgp.js → translate-xLme9Rdh.js} +3 -3
- package/dist/assets/{translate-Bkr_iDgp.js.map → translate-xLme9Rdh.js.map} +1 -1
- package/dist/assets/{types-C4_KafL_.js → types-Clyb52K2.js} +2 -1
- package/dist/assets/types-Clyb52K2.js.map +1 -0
- package/dist/assets/{usdt-Bp7T2iqt.js → usdt-CSU5KzTV.js} +3 -3
- package/dist/assets/{usdt-Bp7T2iqt.js.map → usdt-CSU5KzTV.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/npm-shrinkwrap.json +3592 -0
- package/package.json +5 -3
- package/dist/assets/api-DL0Uazf6.js.map +0 -1
- package/dist/assets/apiKit-D78MXTrk.js.map +0 -1
- package/dist/assets/apps--pAqmfgQ.js.map +0 -1
- package/dist/assets/backup-B3JJd75o.js.map +0 -1
- package/dist/assets/buttons-C1VbDihe.js.map +0 -1
- package/dist/assets/buttons-DwWuK_uN.js +0 -2
- package/dist/assets/childEnv-BVOQK9EA.js.map +0 -1
- package/dist/assets/client-CGLuWFRV.js.map +0 -1
- package/dist/assets/endpoint-DWHkXWVM.js +0 -419
- package/dist/assets/endpoint-DWHkXWVM.js.map +0 -1
- package/dist/assets/fedimintSdk-CqTeMdF0.js.map +0 -1
- package/dist/assets/host-CGlHkiQv.js.map +0 -1
- package/dist/assets/irohWeb-CYn0uB_A.js.map +0 -1
- package/dist/assets/main-CgLW_Gyx.js.map +0 -1
- package/dist/assets/mainline-B0h8RchD.js.map +0 -1
- package/dist/assets/nwc-SSNS1aJ-.js.map +0 -1
- package/dist/assets/profiles-4UQ1Hsds.js.map +0 -1
- package/dist/assets/registry-BKCFTEYp.js.map +0 -1
- package/dist/assets/resolve-MFeFljsN.js.map +0 -1
- package/dist/assets/server-rHKhnog1.js.map +0 -1
- package/dist/assets/src-BzsyAvPf.js.map +0 -1
- package/dist/assets/types-C4_KafL_.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import b4a from "b4a";
|
|
1
2
|
import { xsalsa20poly1305 } from "@noble/ciphers/salsa.js";
|
|
2
3
|
import { ed25519, x25519 } from "@noble/curves/ed25519.js";
|
|
3
4
|
import { sha256, sha512 } from "@noble/hashes/sha2.js";
|
|
@@ -6,7 +7,6 @@ import { base58, base64, base64urlnopad, bech32, bech32m, createBase58check } fr
|
|
|
6
7
|
import { xchacha20poly1305 } from "@noble/ciphers/chacha.js";
|
|
7
8
|
import { hmac } from "@noble/hashes/hmac.js";
|
|
8
9
|
import { hexToBytes } from "@noble/hashes/utils.js";
|
|
9
|
-
import b4a from "b4a";
|
|
10
10
|
import { schnorr, secp256k1 } from "@noble/curves/secp256k1.js";
|
|
11
11
|
import { p256, p384, p521 } from "@noble/curves/nist.js";
|
|
12
12
|
import { gcm } from "@noble/ciphers/aes.js";
|
|
@@ -333,14 +333,24 @@ function tryDecrypt(encoded, key) {
|
|
|
333
333
|
var publicKeys = /* @__PURE__ */ new Map();
|
|
334
334
|
function publicKeyOf(seed) {
|
|
335
335
|
const id = toBase64Url(sha256(seed));
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
336
|
+
const now = Date.now();
|
|
337
|
+
let entry = publicKeys.get(id);
|
|
338
|
+
if (entry) {
|
|
339
|
+
publicKeys.delete(id);
|
|
340
|
+
entry.at = now;
|
|
341
|
+
} else {
|
|
342
|
+
entry = {
|
|
343
|
+
key: ed25519.getPublicKey(seed),
|
|
344
|
+
at: now
|
|
345
|
+
};
|
|
346
|
+
for (const [oldest, { at }] of publicKeys) {
|
|
347
|
+
if (publicKeys.size < 1024) break;
|
|
348
|
+
if (publicKeys.size < 16384 && now - at < 6e5) break;
|
|
349
|
+
publicKeys.delete(oldest);
|
|
350
|
+
}
|
|
341
351
|
}
|
|
342
|
-
publicKeys.set(id,
|
|
343
|
-
return key.slice();
|
|
352
|
+
publicKeys.set(id, entry);
|
|
353
|
+
return entry.key.slice();
|
|
344
354
|
}
|
|
345
355
|
function identityFromSeed(seed) {
|
|
346
356
|
if (seed.length !== 32) throw new Error("Seed must be exactly 32 bytes");
|
|
@@ -1431,8 +1441,8 @@ var RelayTransport = class {
|
|
|
1431
1441
|
spentAnswerAllowance = /* @__PURE__ */ new Map();
|
|
1432
1442
|
/** Per contact, its departed reads past the limit in the last minute, every relay together (`DEPARTED_READS`). */
|
|
1433
1443
|
departedOver = /* @__PURE__ */ new Map();
|
|
1434
|
-
/**
|
|
1435
|
-
awaitedOver =
|
|
1444
|
+
/** The awaited reads past the limit in the last minute, every invite and every relay together (`AWAITED_READS`). */
|
|
1445
|
+
awaitedOver = [];
|
|
1436
1446
|
/** When an awaited invite's read last asked: the departed reads leave it room for a minute (`AWAITED_READS`). */
|
|
1437
1447
|
awaitedAt = -Infinity;
|
|
1438
1448
|
/**
|
|
@@ -2314,7 +2324,7 @@ var RelayTransport = class {
|
|
|
2314
2324
|
if (isGroupSignal(who)) this.spentGroupSignal.get(relay).push(now);
|
|
2315
2325
|
const departedOver = isDepartedRead(who) && this.spent.get(relay).length >= this.limitOf(relay);
|
|
2316
2326
|
if (departedOver) this.overAdd(this.departedOver, key, now);
|
|
2317
|
-
if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.
|
|
2327
|
+
if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.awaitedOver = [...within(this.awaitedOver, now, 6e4), now];
|
|
2318
2328
|
this.spent.get(relay).push(now);
|
|
2319
2329
|
if (who.background) this.spentBackground.get(relay).push(now);
|
|
2320
2330
|
if (who.background && who.write) this.spentBackgroundWrites.get(relay).push(now);
|
|
@@ -2358,7 +2368,8 @@ var RelayTransport = class {
|
|
|
2358
2368
|
const over = (list, limit) => list.length >= limit ? list[list.length - limit] + 6e4 - now : 0;
|
|
2359
2369
|
const limit = this.limitOf(relay);
|
|
2360
2370
|
const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.overReads(this.departedOver, key, now) < 6;
|
|
2361
|
-
|
|
2371
|
+
if (isAwaitedRead(who)) this.awaitedOver = within(this.awaitedOver, now, 6e4);
|
|
2372
|
+
const awaited = isAwaitedRead(who) && key !== void 0 && recent.length >= limit && this.awaitedOver.length < 4;
|
|
2362
2373
|
const share = isChatSignal(who) || departed || awaited ? SIGNALING_ALLOWANCE_SHARE : isGroupSignal(who) ? GROUP_SIGNALING_ALLOWANCE_SHARE : 0;
|
|
2363
2374
|
let allowance = share ? Math.max(0, Math.floor(limit * share) - (who.write ? 0 : 1)) : 0;
|
|
2364
2375
|
if (departed && now - this.awaitedAt < 6e4) allowance = Math.max(0, allowance - 2);
|
|
@@ -2542,7 +2553,7 @@ var RelayTransport = class {
|
|
|
2542
2553
|
const since = this.heldBack.get(key)?.since;
|
|
2543
2554
|
return !who.group && !who.write && !who.door && since !== void 0 && now - since >= READ_STARVED_MS;
|
|
2544
2555
|
}
|
|
2545
|
-
/** This key's departed
|
|
2556
|
+
/** This key's departed reads past the limit in the last minute (`DEPARTED_READS`). */
|
|
2546
2557
|
overReads(over, key, now) {
|
|
2547
2558
|
const reads = within(over.get(key) ?? [], now, 6e4);
|
|
2548
2559
|
if (reads.length) over.set(key, reads);
|
|
@@ -7357,6 +7368,12 @@ var LIMITS = {
|
|
|
7357
7368
|
maxPathBytes: 8192,
|
|
7358
7369
|
/** Requests a host serves at once for one peer. */
|
|
7359
7370
|
maxConcurrentRequestsPerPeer: 32,
|
|
7371
|
+
/**
|
|
7372
|
+
* Request-body bytes a host holds for one peer at once, from a body's first chunk until its local fetch settles.
|
|
7373
|
+
* Past it a request is refused (`busy`). As much as a client's in-flight requests can carry, so only a peer that
|
|
7374
|
+
* ignores that limit reaches it.
|
|
7375
|
+
*/
|
|
7376
|
+
maxHostBodyBytesPerPeer: 134217728,
|
|
7360
7377
|
/** Requests a client keeps in flight; the rest wait in a queue. */
|
|
7361
7378
|
maxClientInFlight: 16,
|
|
7362
7379
|
/**
|
|
@@ -7373,6 +7390,11 @@ var LIMITS = {
|
|
|
7373
7390
|
maxStoredIncomingBytesPerPeer: 524288e3,
|
|
7374
7391
|
requestTimeoutMs: 6e4,
|
|
7375
7392
|
bodyIdleTimeoutMs: 3e4,
|
|
7393
|
+
/**
|
|
7394
|
+
* What a request body must bring in each `bodyIdleTimeoutMs` (unless it ends) to count as moving: a peer that sends a
|
|
7395
|
+
* few bytes at a time is let go like one that stalls.
|
|
7396
|
+
*/
|
|
7397
|
+
minRequestBodyBytesPerIdle: 16384,
|
|
7376
7398
|
/** Stop writing to the channel above this many buffered bytes. */
|
|
7377
7399
|
sendHighWaterMark: 1048576,
|
|
7378
7400
|
sendLowWaterMark: 262144
|
|
@@ -7825,6 +7847,22 @@ function sanitizeResponseHeaders(headers, target) {
|
|
|
7825
7847
|
}
|
|
7826
7848
|
return out;
|
|
7827
7849
|
}
|
|
7850
|
+
[
|
|
7851
|
+
"camera",
|
|
7852
|
+
"microphone",
|
|
7853
|
+
"display-capture",
|
|
7854
|
+
"geolocation",
|
|
7855
|
+
"midi",
|
|
7856
|
+
"usb",
|
|
7857
|
+
"serial",
|
|
7858
|
+
"hid",
|
|
7859
|
+
"clipboard-read",
|
|
7860
|
+
"idle-detection",
|
|
7861
|
+
"local-fonts",
|
|
7862
|
+
"window-management",
|
|
7863
|
+
"storage-access",
|
|
7864
|
+
"publickey-credentials-create"
|
|
7865
|
+
].map((feature) => `${feature}=()`).join(", ");
|
|
7828
7866
|
/**
|
|
7829
7867
|
* Turns `http://localhost:3400/base/x` into `/x` so the client never learns or
|
|
7830
7868
|
* follows the local address. Null when the location is not on the target origin
|
|
@@ -7872,6 +7910,8 @@ var HttpHost = class {
|
|
|
7872
7910
|
* so a stream counts toward the limit until its fetch has settled.
|
|
7873
7911
|
*/
|
|
7874
7912
|
live = /* @__PURE__ */ new Set();
|
|
7913
|
+
/** Body bytes of the streams in `live`: a peer cannot make the host hold more than `maxHostBodyBytesPerPeer`. */
|
|
7914
|
+
heldBodyBytes = 0;
|
|
7875
7915
|
constructor(channel, getService, localFetch) {
|
|
7876
7916
|
this.channel = channel;
|
|
7877
7917
|
this.getService = getService;
|
|
@@ -7898,25 +7938,32 @@ var HttpHost = class {
|
|
|
7898
7938
|
url,
|
|
7899
7939
|
body: [],
|
|
7900
7940
|
bodyBytes: 0,
|
|
7941
|
+
movedBytes: 0,
|
|
7901
7942
|
abort: new AbortController(),
|
|
7902
7943
|
started: false
|
|
7903
7944
|
};
|
|
7904
7945
|
this.streams.set(frame.id, stream);
|
|
7905
7946
|
this.live.add(stream);
|
|
7906
|
-
if (frame.b && !BODYLESS_METHODS.has(method)) this.
|
|
7947
|
+
if (frame.b && !BODYLESS_METHODS.has(method)) this.watchPace(stream);
|
|
7907
7948
|
else this.run(stream);
|
|
7908
7949
|
}
|
|
7909
7950
|
handleChunk(chunk) {
|
|
7910
7951
|
const stream = this.streams.get(chunk.id);
|
|
7911
7952
|
if (!stream || stream.started) return;
|
|
7912
|
-
|
|
7913
|
-
if (stream.bodyBytes > LIMITS.maxRequestBodyBytes) {
|
|
7953
|
+
const bytes = chunk.payload.length;
|
|
7954
|
+
if (stream.bodyBytes + bytes > LIMITS.maxRequestBodyBytes) {
|
|
7914
7955
|
this.end(stream);
|
|
7915
7956
|
return this.fail(chunk.id, 413, "request-too-large", "Request body too large.");
|
|
7916
7957
|
}
|
|
7958
|
+
if (this.heldBodyBytes + bytes > LIMITS.maxHostBodyBytesPerPeer) {
|
|
7959
|
+
this.end(stream);
|
|
7960
|
+
return this.fail(chunk.id, 503, "busy", "Too many request bodies at once.");
|
|
7961
|
+
}
|
|
7962
|
+
stream.bodyBytes += bytes;
|
|
7963
|
+
this.heldBodyBytes += bytes;
|
|
7964
|
+
stream.movedBytes += bytes;
|
|
7917
7965
|
if (chunk.payload.length > 0) stream.body.push(chunk.payload.slice());
|
|
7918
7966
|
if (chunk.end) this.run(stream);
|
|
7919
|
-
else this.armIdleTimer(stream);
|
|
7920
7967
|
}
|
|
7921
7968
|
handleReset(frame) {
|
|
7922
7969
|
const stream = this.streams.get(frame.id);
|
|
@@ -7925,9 +7972,13 @@ var HttpHost = class {
|
|
|
7925
7972
|
closeAll() {
|
|
7926
7973
|
for (const stream of [...this.streams.values()]) this.end(stream);
|
|
7927
7974
|
}
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
stream.
|
|
7975
|
+
/** A body that brings less than `minRequestBodyBytesPerIdle` in a `bodyIdleTimeoutMs` is let go, even if it trickles. */
|
|
7976
|
+
watchPace(stream) {
|
|
7977
|
+
stream.paceTimer = setTimeout(() => {
|
|
7978
|
+
if (stream.movedBytes >= LIMITS.minRequestBodyBytesPerIdle) {
|
|
7979
|
+
stream.movedBytes = 0;
|
|
7980
|
+
return this.watchPace(stream);
|
|
7981
|
+
}
|
|
7931
7982
|
this.end(stream);
|
|
7932
7983
|
this.fail(stream.frame.id, 408, "request-timeout", "Request body timed out.");
|
|
7933
7984
|
}, LIMITS.bodyIdleTimeoutMs);
|
|
@@ -7937,10 +7988,16 @@ var HttpHost = class {
|
|
|
7937
7988
|
return this.streams.get(stream.frame.id) === stream;
|
|
7938
7989
|
}
|
|
7939
7990
|
end(stream) {
|
|
7940
|
-
clearTimeout(stream.
|
|
7991
|
+
clearTimeout(stream.paceTimer);
|
|
7941
7992
|
stream.abort.abort();
|
|
7942
7993
|
if (this.isCurrent(stream)) this.streams.delete(stream.frame.id);
|
|
7943
|
-
if (!stream.started) this.
|
|
7994
|
+
if (!stream.started) this.release(stream);
|
|
7995
|
+
}
|
|
7996
|
+
/** The stream no longer counts toward the limits: its body is dropped, or its local fetch has settled. */
|
|
7997
|
+
release(stream) {
|
|
7998
|
+
this.live.delete(stream);
|
|
7999
|
+
this.heldBodyBytes -= stream.bodyBytes;
|
|
8000
|
+
stream.bodyBytes = 0;
|
|
7944
8001
|
}
|
|
7945
8002
|
fail(id, status, code, message) {
|
|
7946
8003
|
const body = utf8Encode(`${message}\n`);
|
|
@@ -7957,19 +8014,20 @@ var HttpHost = class {
|
|
|
7957
8014
|
}
|
|
7958
8015
|
async run(stream) {
|
|
7959
8016
|
stream.started = true;
|
|
7960
|
-
clearTimeout(stream.
|
|
8017
|
+
clearTimeout(stream.paceTimer);
|
|
7961
8018
|
const { frame, service } = stream;
|
|
7962
8019
|
const timeout = setTimeout(() => stream.abort.abort(), LIMITS.requestTimeoutMs);
|
|
7963
8020
|
let headersSent = false;
|
|
8021
|
+
const body = stream.body.length > 0 ? concatBytes$1(...stream.body) : null;
|
|
8022
|
+
stream.body = [];
|
|
7964
8023
|
try {
|
|
7965
8024
|
const response = await this.localFetch({
|
|
7966
8025
|
url: stream.url,
|
|
7967
8026
|
method: frame.m,
|
|
7968
8027
|
headers: sanitizeRequestHeaders(frame.h),
|
|
7969
|
-
body
|
|
8028
|
+
body,
|
|
7970
8029
|
signal: stream.abort.signal
|
|
7971
8030
|
});
|
|
7972
|
-
stream.body = [];
|
|
7973
8031
|
clearTimeout(timeout);
|
|
7974
8032
|
if (!this.isCurrent(stream)) return;
|
|
7975
8033
|
if (response.finalUrl && response.finalUrl !== stream.url) {
|
|
@@ -8017,7 +8075,7 @@ var HttpHost = class {
|
|
|
8017
8075
|
else if (timedOut && error?.name === "AbortError") this.fail(frame.id, 504, "timeout", "The local service did not answer in time.");
|
|
8018
8076
|
else this.fail(frame.id, 502, "unreachable", "The local service is not reachable.");
|
|
8019
8077
|
} finally {
|
|
8020
|
-
this.
|
|
8078
|
+
this.release(stream);
|
|
8021
8079
|
}
|
|
8022
8080
|
}
|
|
8023
8081
|
};
|
|
@@ -13488,7 +13546,8 @@ var DhtDelivery = class DhtDelivery {
|
|
|
13488
13546
|
* envelope was seen in the pinned mailbox, the invite's is not read any more.
|
|
13489
13547
|
*/
|
|
13490
13548
|
async read(background, signal = false) {
|
|
13491
|
-
const
|
|
13549
|
+
const departed = !signal && !background && this.departedRead();
|
|
13550
|
+
const pinned = this.pinned(), options = signal ? { signal } : background ? { background } : departed ? { departed } : void 0;
|
|
13492
13551
|
const before = this.state.peerPinned;
|
|
13493
13552
|
const boxes = !pinned ? ["invite"] : before === "seen" ? ["pinned"] : before ? ["pinned", "invite"] : ["invite", "pinned"];
|
|
13494
13553
|
let found = null;
|
|
@@ -13623,6 +13682,21 @@ var DhtDelivery = class DhtDelivery {
|
|
|
13623
13682
|
return this.state.peerMode === "dht" && this.options.peerDhtPollMs && there ? Math.min(this.options.peerDhtPollMs, STREAM_POLL_MS) : STREAM_POLL_MS;
|
|
13624
13683
|
}
|
|
13625
13684
|
/**
|
|
13685
|
+
* The contact is on DHT only and this side is not: a live link waits on the contact's envelope saying it left, and
|
|
13686
|
+
* nothing else of the contact's shows before it (no offer is read, no dial taken, while its mailbox says DHT only). Its
|
|
13687
|
+
* reads that are not background ones (the chat open, a text awaiting its receipt) then say `departed`: a few may go over
|
|
13688
|
+
* the relays' minute (`DEPARTED_READS` in relay.ts, per mailbox, every relay together, 6 at the open chat's 10 s pace).
|
|
13689
|
+
* As plain reads, an extension that stayed on Automatic, its minute spent by what it did before, read nothing of its
|
|
13690
|
+
* contact for 40 s after the contact left DHT only, and the matrix's chat stayed "On DHT · retrying live" (E2E full,
|
|
13691
|
+
* 2026-11-07 and 11-08). No more reads than before: those it made anyway, the minute spent, go within the allowance.
|
|
13692
|
+
* Not while this side is leaving DHT only itself (`signalReads` left, `leavingRead`): its read at the switch stays a
|
|
13693
|
+
* plain one, the rest are signaling, so the few requests past a spent minute stay for the dialling side's read of the
|
|
13694
|
+
* answer. As a departed read, the switch's took one, and both sides leaving went live in 34 s, against 10.
|
|
13695
|
+
*/
|
|
13696
|
+
departedRead() {
|
|
13697
|
+
return this.mode !== "dht" && this.state.peerMode === "dht" && this.signalReads === 0 && !!this.options.credentials.peerKey;
|
|
13698
|
+
}
|
|
13699
|
+
/**
|
|
13626
13700
|
* This side is DHT only, and nothing waits on the contact's mailbox: the contact, pinned, is away (nothing new of its
|
|
13627
13701
|
* own in `PRESENCE_WINDOW`; it puts a keep-alive every four minutes while there), no text of ours awaits its receipt,
|
|
13628
13702
|
* and the chat is not on screen. Its mailbox is then read at the background pace, as background reads, not every 4 s:
|
|
@@ -14132,18 +14206,23 @@ var DNS_TYPE = {
|
|
|
14132
14206
|
TXT: 16,
|
|
14133
14207
|
AAAA: 28
|
|
14134
14208
|
};
|
|
14209
|
+
/**
|
|
14210
|
+
* EDNS0 OPT record (RFC 6891) with one Client Subnet option of source prefix 0 (RFC 7871 §7.1.2): a resolver must
|
|
14211
|
+
* not add this device's subnet to its queries to the name's servers, as Google Public DNS otherwise does.
|
|
14212
|
+
*/
|
|
14213
|
+
var NO_CLIENT_SUBNET = Uint8Array.of(0, 0, 41, 4, 208, 0, 0, 0, 0, 0, 8, 0, 8, 0, 4, 0, 1, 0, 0);
|
|
14135
14214
|
/** A recursive query for one name and type. ID 0, as RFC 8484 recommends for caching;
|
|
14136
14215
|
* the AD bit asks the resolver to report DNSSEC validation (RFC 6840 §5.7). */
|
|
14137
14216
|
function encodeDnsQuery(name, type) {
|
|
14138
14217
|
const labels = name.replace(/\.$/, "").split(".");
|
|
14139
|
-
const parts = [Uint8Array.of(0, 0, 1, 32, 0, 1, 0, 0, 0, 0, 0,
|
|
14218
|
+
const parts = [Uint8Array.of(0, 0, 1, 32, 0, 1, 0, 0, 0, 0, 0, 1)];
|
|
14140
14219
|
for (const label of labels) {
|
|
14141
14220
|
const bytes = utf8Encode(label);
|
|
14142
14221
|
if (!bytes.length || bytes.length > 63) throw new Error("Invalid DNS name");
|
|
14143
14222
|
parts.push(Uint8Array.of(bytes.length), bytes);
|
|
14144
14223
|
}
|
|
14145
14224
|
const code = DNS_TYPE[type];
|
|
14146
|
-
parts.push(Uint8Array.of(0, code >> 8, code & 255, 0, 1));
|
|
14225
|
+
parts.push(Uint8Array.of(0, code >> 8, code & 255, 0, 1), NO_CLIENT_SUBNET);
|
|
14147
14226
|
return concatBytes$1(...parts);
|
|
14148
14227
|
}
|
|
14149
14228
|
function readName(data, start) {
|
|
@@ -16102,6 +16181,7 @@ var IdentityExchange = class {
|
|
|
16102
16181
|
id,
|
|
16103
16182
|
provider,
|
|
16104
16183
|
subject,
|
|
16184
|
+
account: local.account ?? subject,
|
|
16105
16185
|
status: "queued",
|
|
16106
16186
|
at: this.now()
|
|
16107
16187
|
};
|
|
@@ -16260,7 +16340,7 @@ var IdentityExchange = class {
|
|
|
16260
16340
|
at: this.now(),
|
|
16261
16341
|
error
|
|
16262
16342
|
};
|
|
16263
|
-
const replaced = (x) => ok && x.status === "accepted" && x.provider === s.provider && x.
|
|
16343
|
+
const replaced = (x) => ok && x.status === "accepted" && x.provider === s.provider && x.account !== void 0 && x.account === s.account;
|
|
16264
16344
|
await this.options.storage.update((l) => l.shared.filter((x) => x.id !== s.id && replaced(x)).reduce((out, x) => this.log(out, {
|
|
16265
16345
|
type: "stopped",
|
|
16266
16346
|
side: "mine",
|
|
@@ -18079,7 +18159,12 @@ var APP_RANGE_LIMITS = {
|
|
|
18079
18159
|
* The bytes a server takes asks for in one second, its apps together: one more is answered `busy`. Counted as they
|
|
18080
18160
|
* are asked, so a cancelled one counts as the read it started. Twice the asking app's own budget (16 MiB a second).
|
|
18081
18161
|
*/
|
|
18082
|
-
bytesPerSecond: 33554432
|
|
18162
|
+
bytesPerSecond: 33554432,
|
|
18163
|
+
/**
|
|
18164
|
+
* The least one ask counts in `bytesPerSecond`, however few bytes it asked or the file held from its offset: each is
|
|
18165
|
+
* a read on this device, so a contact gets at most 512 a second.
|
|
18166
|
+
*/
|
|
18167
|
+
askFloorBytes: 65536
|
|
18083
18168
|
};
|
|
18084
18169
|
/**
|
|
18085
18170
|
* What an `ar-err` says. `not-served`: no serve of that id (never given, or ended); `changed` and
|
|
@@ -18348,16 +18433,17 @@ var AppRanges = class {
|
|
|
18348
18433
|
old.out = true;
|
|
18349
18434
|
this.takenBytes -= old.bytes;
|
|
18350
18435
|
}
|
|
18351
|
-
|
|
18436
|
+
const bytes = Math.max(frame.n, APP_RANGE_LIMITS.askFloorBytes);
|
|
18437
|
+
if (this.takenBytes + bytes > APP_RANGE_LIMITS.bytesPerSecond) {
|
|
18352
18438
|
this.send(appRangeErrorFrame(app, request, "busy"));
|
|
18353
18439
|
return null;
|
|
18354
18440
|
}
|
|
18355
18441
|
const charge = {
|
|
18356
18442
|
at,
|
|
18357
|
-
bytes
|
|
18443
|
+
bytes
|
|
18358
18444
|
};
|
|
18359
18445
|
this.taken.push(charge);
|
|
18360
|
-
this.takenBytes +=
|
|
18446
|
+
this.takenBytes += bytes;
|
|
18361
18447
|
const task = {
|
|
18362
18448
|
app,
|
|
18363
18449
|
request,
|
|
@@ -18379,7 +18465,7 @@ var AppRanges = class {
|
|
|
18379
18465
|
/** Every byte of `task` was sent: `ar-end` goes with the file's size, unless the task was dropped meanwhile. */
|
|
18380
18466
|
finish(task, size) {
|
|
18381
18467
|
if (!this.take(task)) return;
|
|
18382
|
-
const charge = task.charge, sent = Math.max(
|
|
18468
|
+
const charge = task.charge, sent = Math.max(APP_RANGE_LIMITS.askFloorBytes, Math.min(task.length, size - task.offset));
|
|
18383
18469
|
if (charge && !charge.out && charge.bytes > sent) {
|
|
18384
18470
|
this.takenBytes -= charge.bytes - sent;
|
|
18385
18471
|
charge.bytes = sent;
|
|
@@ -19761,6 +19847,12 @@ var ChatFiles = class {
|
|
|
19761
19847
|
moving = /* @__PURE__ */ new Set();
|
|
19762
19848
|
/** Files that stopped sending for the chat's window alone: they go on once another's bytes are confirmed. */
|
|
19763
19849
|
held = /* @__PURE__ */ new Set();
|
|
19850
|
+
/**
|
|
19851
|
+
* Files this side cancelled while no session carried the cancel (`pf-abort`), said on the next one. The session also
|
|
19852
|
+
* goes for a moment when a move swaps it (its capabilities are agreed again): unsaid, the receiver showed the file
|
|
19853
|
+
* moving, its bytes kept, until its idle nudge asked 30 s later.
|
|
19854
|
+
*/
|
|
19855
|
+
unsaid = /* @__PURE__ */ new Set();
|
|
19764
19856
|
attached = false;
|
|
19765
19857
|
peerRoomValue = null;
|
|
19766
19858
|
/** What the chat's files may have in flight, sized by the path. */
|
|
@@ -19859,6 +19951,10 @@ var ChatFiles = class {
|
|
|
19859
19951
|
this.refill = 0;
|
|
19860
19952
|
this.host.uplink?.join(this);
|
|
19861
19953
|
this.sayRoom();
|
|
19954
|
+
for (const id of this.unsaid) if (this.send({
|
|
19955
|
+
t: "pf-abort",
|
|
19956
|
+
id
|
|
19957
|
+
})) this.unsaid.delete(id);
|
|
19862
19958
|
this.sweep();
|
|
19863
19959
|
for (const entry of this.entries.values()) {
|
|
19864
19960
|
if (transferEnded(entry.record)) continue;
|
|
@@ -20864,10 +20960,10 @@ var ChatFiles = class {
|
|
|
20864
20960
|
const entry = this.entry(direction, id);
|
|
20865
20961
|
if (transferEnded(entry.record)) return;
|
|
20866
20962
|
if (direction === "out") {
|
|
20867
|
-
this.send({
|
|
20963
|
+
if (!this.send({
|
|
20868
20964
|
t: "pf-abort",
|
|
20869
20965
|
id
|
|
20870
|
-
});
|
|
20966
|
+
})) this.unsaid.add(id);
|
|
20871
20967
|
this.end(entry, "cancelled", "You cancelled it");
|
|
20872
20968
|
} else {
|
|
20873
20969
|
this.discardStored(entry);
|
|
@@ -22418,6 +22514,22 @@ var QUIET_FRAMES = /* @__PURE__ */ new Set([
|
|
|
22418
22514
|
CONTACT_ASKER_FRAME
|
|
22419
22515
|
]);
|
|
22420
22516
|
/**
|
|
22517
|
+
* What a session a move replaced still reads while its channel retires (`SWITCH_RETIRE_MS`): the contact's texts,
|
|
22518
|
+
* reactions, pins and edits, and its receipts of this side's, which it sends on that session until its own side moves.
|
|
22519
|
+
* Its files/3 frames too (a cancel, a pause, a file's check): `ChatFiles` answers them on the session now.
|
|
22520
|
+
*/
|
|
22521
|
+
var RETIRING_FRAMES = /* @__PURE__ */ new Set([
|
|
22522
|
+
"paired-message",
|
|
22523
|
+
"paired-received",
|
|
22524
|
+
REACTION_FRAME,
|
|
22525
|
+
REACTED_FRAME,
|
|
22526
|
+
PIN_FRAME,
|
|
22527
|
+
PINNED_FRAME,
|
|
22528
|
+
EDIT_FRAME,
|
|
22529
|
+
EDITED_FRAME,
|
|
22530
|
+
...FILE_FRAMES
|
|
22531
|
+
]);
|
|
22532
|
+
/**
|
|
22421
22533
|
* A ping with nothing at all back this long after it went: the contact may have crashed and started again, with its new
|
|
22422
22534
|
* offer waiting on the relays, while this side still holds the old session and reads them at a live chat's pace (30 s).
|
|
22423
22535
|
* They are read now. Nothing more: the session is let go only by `LIVENESS_MISSED_PINGS`, or by the contact's offer
|
|
@@ -22473,6 +22585,17 @@ var APP_AHEAD_OF_FILES = 16384;
|
|
|
22473
22585
|
*/
|
|
22474
22586
|
var APP_IN_FLIGHT = 65536;
|
|
22475
22587
|
/**
|
|
22588
|
+
* Texts a contact's link takes: a burst per short window (a reconnect flushes every queued text at once) and a total
|
|
22589
|
+
* per hour, both well above what a person or a bot sends. The rest go unconfirmed and come again (the sender's outbox
|
|
22590
|
+
* resends with backoff), so a catch-up only slows.
|
|
22591
|
+
*/
|
|
22592
|
+
var MESSAGE_RECEIVE_LIMITS = {
|
|
22593
|
+
burst: 200,
|
|
22594
|
+
burstWindowMs: 1e4,
|
|
22595
|
+
hourly: 1800,
|
|
22596
|
+
hourWindowMs: 36e5
|
|
22597
|
+
};
|
|
22598
|
+
/**
|
|
22476
22599
|
* A `paired-message` frame. The preview (`pv`) is left out when the frame would pass `MAX_PAIRED_MESSAGE_FRAME`
|
|
22477
22600
|
* with it: the text matters, the card does not. A reply (`r`, WISP 401 § Replies) is a few hundred bytes at most
|
|
22478
22601
|
* and always goes, and so does a forwarded message's hop count (`fw`, WISP 401 § Forwards) and a status card (`sc`,
|
|
@@ -22690,6 +22813,8 @@ var GhostLink = class {
|
|
|
22690
22813
|
pinsReceived = new ReactionWindow(PIN_LIMITS.receive, PIN_LIMITS.windowMs);
|
|
22691
22814
|
/** Edit frames the contact may send per window; the rest go unconfirmed and come again. */
|
|
22692
22815
|
editsReceived = new RateWindow(30, EDIT_RATE_WINDOW_MS);
|
|
22816
|
+
/** Text frames the contact may send per window (`MESSAGE_RECEIVE_LIMITS`); the rest go unconfirmed and come again. */
|
|
22817
|
+
messagesReceived = [new RateWindow(MESSAGE_RECEIVE_LIMITS.burst, MESSAGE_RECEIVE_LIMITS.burstWindowMs), new RateWindow(MESSAGE_RECEIVE_LIMITS.hourly, MESSAGE_RECEIVE_LIMITS.hourWindowMs)];
|
|
22693
22818
|
/** Call signals the contact may send per window; the rest are dropped. */
|
|
22694
22819
|
callsReceived = new RateWindow(150, CALL_RATE_WINDOW_MS);
|
|
22695
22820
|
/** WebRTC signals the contact may send on the session (`paired-rtc`) per window; the rest are dropped. */
|
|
@@ -23718,6 +23843,18 @@ var GhostLink = class {
|
|
|
23718
23843
|
});
|
|
23719
23844
|
}
|
|
23720
23845
|
/**
|
|
23846
|
+
* Where the receipt of a frame read on `channel` goes: that session while it carries the chat, the one now when a move
|
|
23847
|
+
* replaced it (or moved while the frame was shown), or nowhere.
|
|
23848
|
+
*/
|
|
23849
|
+
answerOn(channel) {
|
|
23850
|
+
const live = this.channel;
|
|
23851
|
+
return live && (live === channel || this.retiring.has(channel)) && this.isDataLinkOpen ? live : null;
|
|
23852
|
+
}
|
|
23853
|
+
/** Counts one text the contact sent; false (and not counted) when either of `messagesReceived` is full. */
|
|
23854
|
+
takeMessage() {
|
|
23855
|
+
return this.messagesReceived.every((window) => window.wait() === 0) && this.messagesReceived.every((window) => window.take());
|
|
23856
|
+
}
|
|
23857
|
+
/**
|
|
23721
23858
|
* The WebRTC session a switch moved off is still retiring (`SWITCH_RETIRE_MS`): its data link is open, and a new offer
|
|
23722
23859
|
* cannot go until it closes. Resolves once it has (at once when none is).
|
|
23723
23860
|
*/
|
|
@@ -26613,6 +26750,12 @@ var GhostLink = class {
|
|
|
26613
26750
|
if (this.channel === channel && (!this.unproven(channel) && !this.pinnedSince(channel, paired) || paired.state.status === "ready")) this.emitPairingState();
|
|
26614
26751
|
},
|
|
26615
26752
|
onFailure: () => {
|
|
26753
|
+
const retiring = this.channel !== channel ? this.retiring.get(channel) : void 0;
|
|
26754
|
+
if (retiring) {
|
|
26755
|
+
clearTimeout(retiring.timer);
|
|
26756
|
+
retiring.close();
|
|
26757
|
+
return;
|
|
26758
|
+
}
|
|
26616
26759
|
if (paired.state.keyMismatch) this.options.events?.onPeerKeyRefused?.();
|
|
26617
26760
|
if (this.unproven(channel) || this.pinnedSince(channel, paired) || paired.authTimedOut || paired.overloaded) {
|
|
26618
26761
|
if (paired.state.keyMismatch) this.dht?.foreignKeySeen("stream");
|
|
@@ -26660,11 +26803,12 @@ var GhostLink = class {
|
|
|
26660
26803
|
this.paired = paired;
|
|
26661
26804
|
this.activeBinding = binding;
|
|
26662
26805
|
this.channelSince = Date.now();
|
|
26663
|
-
oldPaired?.stop();
|
|
26664
26806
|
const oldRtc = oldBinding ? null : this.dataLink.connection;
|
|
26665
26807
|
if (oldChannel) this.retire(oldChannel, () => {
|
|
26808
|
+
oldPaired?.stop();
|
|
26666
26809
|
if (oldRtc && this.activeBinding && this.dataLink.connection === oldRtc) this.dataLink.close();
|
|
26667
26810
|
}, !oldBinding);
|
|
26811
|
+
else oldPaired?.stop();
|
|
26668
26812
|
if (migration.plan && binding && oldBinding && WEBRTC_ATTEMPT.has(this.dataLink.state)) this.dataLink.close();
|
|
26669
26813
|
this.session.setDataLinkOpen(true);
|
|
26670
26814
|
if (migration.plan) switched = {
|
|
@@ -26743,10 +26887,13 @@ var GhostLink = class {
|
|
|
26743
26887
|
}
|
|
26744
26888
|
},
|
|
26745
26889
|
onApplication: async (data) => {
|
|
26746
|
-
|
|
26747
|
-
this.
|
|
26748
|
-
|
|
26749
|
-
|
|
26890
|
+
const retired = this.channel !== channel;
|
|
26891
|
+
if (retired && !this.retiring.has(channel)) return;
|
|
26892
|
+
if (!retired) {
|
|
26893
|
+
this.unansweredPings = 0;
|
|
26894
|
+
this.heardFromPeer();
|
|
26895
|
+
this.framesHeard++;
|
|
26896
|
+
} else if (typeof data !== "string") return;
|
|
26750
26897
|
if (typeof data !== "string") {
|
|
26751
26898
|
if (data[0] === 5) {
|
|
26752
26899
|
const range = this.supportsAppRanges && this.supportsBinaryFiles ? decodeAppRangeData(data) : null;
|
|
@@ -26769,6 +26916,7 @@ var GhostLink = class {
|
|
|
26769
26916
|
} catch {
|
|
26770
26917
|
return;
|
|
26771
26918
|
}
|
|
26919
|
+
if (retired && !RETIRING_FRAMES.has(String(frame?.t))) return;
|
|
26772
26920
|
if (frame && typeof frame === "object" && !QUIET_FRAMES.has(String(frame.t))) this.activityAt = Date.now();
|
|
26773
26921
|
if (frame?.t === "paired-ping") {
|
|
26774
26922
|
try {
|
|
@@ -26924,8 +27072,9 @@ var GhostLink = class {
|
|
|
26924
27072
|
if (!this.supportsReactions || !this.reactionsReceived.take()) return;
|
|
26925
27073
|
const reaction = parseReactionFrame(frame);
|
|
26926
27074
|
if (!reaction) return;
|
|
26927
|
-
|
|
26928
|
-
|
|
27075
|
+
const reacted = await this.options.events?.onReaction?.(reaction), live = this.answerOn(channel);
|
|
27076
|
+
if (reacted && live) try {
|
|
27077
|
+
live.send(reactedFrame(reaction.n));
|
|
26929
27078
|
} catch {}
|
|
26930
27079
|
return;
|
|
26931
27080
|
}
|
|
@@ -26938,8 +27087,9 @@ var GhostLink = class {
|
|
|
26938
27087
|
if (!this.supportsPins || !this.pinsReceived.take()) return;
|
|
26939
27088
|
const pin = parsePinFrame(frame);
|
|
26940
27089
|
if (!pin) return;
|
|
26941
|
-
|
|
26942
|
-
|
|
27090
|
+
const pinned = await this.options.events?.onPin?.(pin), live = this.answerOn(channel);
|
|
27091
|
+
if (pinned && live) try {
|
|
27092
|
+
live.send(pinnedFrame(pin.n));
|
|
26943
27093
|
} catch {}
|
|
26944
27094
|
return;
|
|
26945
27095
|
}
|
|
@@ -26952,7 +27102,8 @@ var GhostLink = class {
|
|
|
26952
27102
|
if (!this.supportsEdits || !this.editsReceived.take()) return;
|
|
26953
27103
|
const edit = parseEditFrame(frame);
|
|
26954
27104
|
if (!edit) return;
|
|
26955
|
-
|
|
27105
|
+
const edited = await this.options.events?.onMessageEdit?.(edit), live = this.answerOn(channel);
|
|
27106
|
+
if (edited && live) live.send(editedFrame(edit.id, edit.e));
|
|
26956
27107
|
return;
|
|
26957
27108
|
}
|
|
26958
27109
|
if (frame?.t === "paired-edited") {
|
|
@@ -27048,6 +27199,7 @@ var GhostLink = class {
|
|
|
27048
27199
|
return;
|
|
27049
27200
|
}
|
|
27050
27201
|
if (!frame || typeof frame.id !== "string" || !/^[A-Za-z0-9_-]{22}$/.test(frame.id)) return;
|
|
27202
|
+
if (frame.t === "paired-message" && !this.takeMessage()) return;
|
|
27051
27203
|
if (frame.t === "paired-message" && typeof frame.m === "string" && utf8Encode(frame.m).length <= LIMITS.maxChatMessageBytes && typeof frame.ts === "number" && Number.isSafeInteger(frame.ts) && frame.ts > 0) {
|
|
27052
27204
|
const preview = frame.pv === void 0 ? void 0 : parseLinkPreview(frame.pv, frame.m);
|
|
27053
27205
|
this.typingReceiver.clear();
|
|
@@ -27064,7 +27216,8 @@ var GhostLink = class {
|
|
|
27064
27216
|
...forwarded && { forwarded },
|
|
27065
27217
|
...card && { card }
|
|
27066
27218
|
});
|
|
27067
|
-
|
|
27219
|
+
const live = this.answerOn(channel);
|
|
27220
|
+
if (live) live.send(JSON.stringify({
|
|
27068
27221
|
t: "paired-received",
|
|
27069
27222
|
id: frame.id
|
|
27070
27223
|
}));
|
|
@@ -27541,6 +27694,7 @@ var GhostLink = class {
|
|
|
27541
27694
|
break;
|
|
27542
27695
|
}
|
|
27543
27696
|
case "m":
|
|
27697
|
+
if (!this.takeMessage()) break;
|
|
27544
27698
|
this.options.events?.onMessage?.({
|
|
27545
27699
|
text: frame.m,
|
|
27546
27700
|
timestamp: frame.ts,
|
|
@@ -28974,16 +29128,19 @@ async function videoMetadataPatches(file, mime, audio = false) {
|
|
|
28974
29128
|
*
|
|
28975
29129
|
* - MP4 audio (M4A, a voice note recorded in MP4): videoMetadata.ts's box walk, its `udta` and `meta` emptied.
|
|
28976
29130
|
* - MP3 and AAC: an ID3v2 tag at the start becomes an empty one (its frames zeros: padding), one at the end (with its
|
|
28977
|
-
* footer), an APEv2 tag's items, a Lyrics3v2 tag and an ID3v1 tag's fields become zeros.
|
|
29131
|
+
* footer), an APEv2 tag's items, a Lyrics3v2 tag and an ID3v1 tag's fields become zeros. One typed as MP3 or AAC
|
|
29132
|
+
* whose first bytes are neither (junk before its first frame) still has the tags at its end emptied.
|
|
28978
29133
|
* - FLAC: every metadata block but its stream info and seek table (a Vorbis comment, a picture, a cue sheet, an
|
|
28979
29134
|
* application's) becomes padding, zeroed.
|
|
28980
|
-
* - Ogg Opus, Vorbis and
|
|
28981
|
-
* after it zeros
|
|
28982
|
-
* - WAV: every chunk but its format, data and the ones of the sound itself (`fact`, `cue `,
|
|
28983
|
-
* `JUNK`, zeroed (an INFO list, an `id3 ` chunk, a broadcast `bext` with
|
|
29135
|
+
* - Ogg Opus, Vorbis, Speex and Theora: the comment header keeps its vendor (the encoder's name) and has no comment,
|
|
29136
|
+
* the bytes after it zeros. FLAC in Ogg: its metadata blocks as a FLAC's. Each page changed has its checksum made again.
|
|
29137
|
+
* - WAV (RIFF, RF64 or BW64): every chunk but its format, data and the ones of the sound itself (`fact`, `cue `,
|
|
29138
|
+
* `smpl`, `inst`, an RF64's `ds64`) becomes `JUNK`, zeroed (an INFO list, an `id3 ` chunk, a broadcast `bext` with
|
|
29139
|
+
* its date and originator, iXML, XMP).
|
|
28984
29140
|
* - WebM and Matroska, audio or video: `Tags`, `Attachments`, `Chapters`, the title, the date, the file names and each
|
|
28985
29141
|
* track's name become `Void` elements (and the SeekHead's entries for them); the muxer's and the writing app's names
|
|
28986
|
-
* are zeroed.
|
|
29142
|
+
* are zeroed. A Vorbis, Theora or FLAC track's CodecPrivate (its Ogg headers or its FLAC metadata blocks) has its
|
|
29143
|
+
* comments emptied as an Ogg's or a FLAC's. Clusters, cues and other track settings are kept as they are.
|
|
28987
29144
|
*
|
|
28988
29145
|
* Fail-closed: a file that is one of these by its bytes and whose tags cannot be removed (truncated, malformed) is
|
|
28989
29146
|
* refused with `NO_AUDIO_METADATA`, never sent as it was. Any other file goes as it is (other audio formats too).
|
|
@@ -29140,6 +29297,17 @@ async function trailingTags(read, size, start, patches) {
|
|
|
29140
29297
|
return;
|
|
29141
29298
|
}
|
|
29142
29299
|
}
|
|
29300
|
+
/** The types an MP3 or AAC file is sent as: one whose first bytes are no frame still has its tags at the end read. */
|
|
29301
|
+
var MPEG_AUDIO = /* @__PURE__ */ new Set([
|
|
29302
|
+
"audio/mpeg",
|
|
29303
|
+
"audio/mp3",
|
|
29304
|
+
"audio/mpeg3",
|
|
29305
|
+
"audio/x-mpeg",
|
|
29306
|
+
"audio/x-mp3",
|
|
29307
|
+
"audio/aac",
|
|
29308
|
+
"audio/x-aac",
|
|
29309
|
+
"audio/aacp"
|
|
29310
|
+
]);
|
|
29143
29311
|
/** An MPEG audio frame's or an ADTS header's first bytes: 11 bits set, a version and a layer that are some. */
|
|
29144
29312
|
var isFrame = (b, at) => b.length >= at + 2 && b[at] === 255 && (b[at + 1] & 224) === 224 && (b[at + 1] & 24) !== 8;
|
|
29145
29313
|
var FLAC_KEEPS = /* @__PURE__ */ new Set([0, 3]);
|
|
@@ -29182,40 +29350,49 @@ function oggCrc(page) {
|
|
|
29182
29350
|
return crc;
|
|
29183
29351
|
}
|
|
29184
29352
|
/**
|
|
29185
|
-
* How a codec's comment header (its second packet) is laid out: its magic's length, and whether a framing bit
|
|
29186
|
-
* follows its comments (Vorbis). Known by the first bytes of its first packet.
|
|
29187
|
-
*/
|
|
29188
|
-
var OGG_CODECS = [
|
|
29189
|
-
{
|
|
29190
|
-
head: "OpusHead",
|
|
29191
|
-
comments: "OpusTags",
|
|
29192
|
-
framing: false
|
|
29193
|
-
},
|
|
29194
|
-
{
|
|
29195
|
-
head: "vorbis",
|
|
29196
|
-
comments: "vorbis",
|
|
29197
|
-
framing: true
|
|
29198
|
-
},
|
|
29199
|
-
{
|
|
29200
|
-
head: "Speex ",
|
|
29201
|
-
comments: "",
|
|
29202
|
-
framing: false
|
|
29203
|
-
}
|
|
29204
|
-
];
|
|
29205
|
-
/**
|
|
29206
29353
|
* A comment header with no comment: its magic and vendor kept, its count 0 (and Vorbis's framing bit set), the rest
|
|
29207
|
-
* zeros: padding after the comments, which Opus says may be there and Vorbis's and
|
|
29354
|
+
* zeros: padding after the comments, which Opus says may be there and Vorbis's, Speex's and Theora's readers do not read.
|
|
29208
29355
|
*/
|
|
29209
|
-
function noComments(packet,
|
|
29210
|
-
const magic =
|
|
29211
|
-
check(text(packet, 0, magic) ===
|
|
29356
|
+
function noComments(packet, comments, framing) {
|
|
29357
|
+
const magic = comments.length;
|
|
29358
|
+
check(text(packet, 0, magic) === comments && packet.length >= magic + 4);
|
|
29212
29359
|
const count = magic + 4 + u32le(packet, magic);
|
|
29213
|
-
check(count + 4 + (
|
|
29360
|
+
check(count + 4 + (framing ? 1 : 0) <= packet.length);
|
|
29214
29361
|
const out = new Uint8Array(packet.length);
|
|
29215
29362
|
out.set(packet.subarray(0, count));
|
|
29216
|
-
if (
|
|
29363
|
+
if (framing) out[count + 4] = 1;
|
|
29364
|
+
return out;
|
|
29365
|
+
}
|
|
29366
|
+
/** A FLAC metadata block that is a whole packet (FLAC in Ogg): kept, or made padding as `flac` makes it. */
|
|
29367
|
+
function noFlacBlock(packet) {
|
|
29368
|
+
check(packet.length >= 4 && packet.length === 4 + (packet[1] << 16 | packet[2] << 8 | packet[3]) && (packet[0] & 127) !== 127);
|
|
29369
|
+
const type = packet[0] & 127;
|
|
29370
|
+
if (FLAC_KEEPS.has(type)) return packet;
|
|
29371
|
+
const out = new Uint8Array(packet.length);
|
|
29372
|
+
out[0] = type === 1 ? packet[0] : packet[0] & 128 | 1;
|
|
29217
29373
|
return out;
|
|
29218
29374
|
}
|
|
29375
|
+
/** A codec whose second packet is its comment header: its magic, and whether a framing bit follows its comments (Vorbis). */
|
|
29376
|
+
var commentHeader = (head, comments, framing) => ({
|
|
29377
|
+
head,
|
|
29378
|
+
tagged: (_, index) => index === 0,
|
|
29379
|
+
empty: (packet) => noComments(packet, comments, framing)
|
|
29380
|
+
});
|
|
29381
|
+
var OGG_CODECS = [
|
|
29382
|
+
commentHeader("OpusHead", "OpusTags", false),
|
|
29383
|
+
commentHeader("vorbis", "vorbis", true),
|
|
29384
|
+
commentHeader("Speex ", "", false),
|
|
29385
|
+
commentHeader("theora", "theora", false),
|
|
29386
|
+
{
|
|
29387
|
+
head: "FLAC",
|
|
29388
|
+
tagged: (packet, index) => {
|
|
29389
|
+
if (index) return !(packet[0] & 128);
|
|
29390
|
+
check(packet.length >= 17 && text(packet, 9, 4) === "fLaC");
|
|
29391
|
+
return !(packet[13] & 128);
|
|
29392
|
+
},
|
|
29393
|
+
empty: noFlacBlock
|
|
29394
|
+
}
|
|
29395
|
+
];
|
|
29219
29396
|
/**
|
|
29220
29397
|
* An Ogg file's pages walked: each logical stream's comment header (a chained file has one per link) made one with no
|
|
29221
29398
|
* comment where it is, across the pages it spans, and those pages' checksums made again.
|
|
@@ -29246,13 +29423,14 @@ async function ogg(read, size, patches) {
|
|
|
29246
29423
|
const serial = u32le(head, 14);
|
|
29247
29424
|
if (head[5] & 2) streams.set(serial, {
|
|
29248
29425
|
packet: 0,
|
|
29249
|
-
ranges: []
|
|
29426
|
+
ranges: [],
|
|
29427
|
+
tagged: true
|
|
29250
29428
|
});
|
|
29251
29429
|
const stream = streams.get(serial);
|
|
29252
29430
|
check(!!stream);
|
|
29253
29431
|
let offset = at + 27 + lacing.length;
|
|
29254
29432
|
for (const length of lacing) {
|
|
29255
|
-
if (stream.
|
|
29433
|
+
if (stream.tagged) stream.ranges.push([
|
|
29256
29434
|
offset,
|
|
29257
29435
|
offset + length,
|
|
29258
29436
|
at
|
|
@@ -29262,8 +29440,10 @@ async function ogg(read, size, patches) {
|
|
|
29262
29440
|
if (stream.packet === 0) {
|
|
29263
29441
|
const first = await packetOf(stream.ranges);
|
|
29264
29442
|
stream.codec = OGG_CODECS.find((codec) => text(first, 0, codec.head.length) === codec.head) ?? null;
|
|
29265
|
-
|
|
29266
|
-
|
|
29443
|
+
stream.tagged = !!stream.codec?.tagged(first, 0);
|
|
29444
|
+
} else if (stream.tagged && stream.codec) {
|
|
29445
|
+
const packet = await packetOf(stream.ranges), emptied = stream.codec.empty(packet);
|
|
29446
|
+
stream.tagged = stream.codec.tagged(packet, stream.packet);
|
|
29267
29447
|
let from = 0;
|
|
29268
29448
|
for (const [start, until, page] of stream.ranges) {
|
|
29269
29449
|
if (!pages.has(page)) pages.set(page, []);
|
|
@@ -29276,7 +29456,7 @@ async function ogg(read, size, patches) {
|
|
|
29276
29456
|
}
|
|
29277
29457
|
at = end;
|
|
29278
29458
|
}
|
|
29279
|
-
for (const stream of streams.values()) check(stream.
|
|
29459
|
+
for (const stream of streams.values()) check(!stream.tagged);
|
|
29280
29460
|
for (const [start, changes] of pages) {
|
|
29281
29461
|
const head = await read(start, 27), lacing = await read(start + 27, head[26]);
|
|
29282
29462
|
const end = start + 27 + lacing.length + lacing.reduce((sum, l) => sum + l, 0);
|
|
@@ -29311,16 +29491,23 @@ var WAV_SPACE = /* @__PURE__ */ new Set([
|
|
|
29311
29491
|
"PAD ",
|
|
29312
29492
|
"FLLR"
|
|
29313
29493
|
]);
|
|
29314
|
-
|
|
29494
|
+
/** A WAV's chunks from its `WAVE`; an RF64 or BW64 one (`rf64`) has its `ds64` first, which says `data`'s size when its own is all ones. */
|
|
29495
|
+
async function wav(read, size, rf64, patches) {
|
|
29496
|
+
let dataSize;
|
|
29497
|
+
if (rf64) {
|
|
29498
|
+
const ds64 = await read(12, 24);
|
|
29499
|
+
check(text(ds64, 0, 4) === "ds64" && u32le(ds64, 4) >= 28);
|
|
29500
|
+
dataSize = u32le(ds64, 16) + u32le(ds64, 20) * 2 ** 32;
|
|
29501
|
+
}
|
|
29315
29502
|
const count = counter();
|
|
29316
29503
|
for (let at = 12; at + 8 <= size;) {
|
|
29317
29504
|
count();
|
|
29318
29505
|
const head = await read(at, 8);
|
|
29319
|
-
const id = text(head, 0, 4), length = u32le(head, 4);
|
|
29320
|
-
let end = at + 8 + length +
|
|
29506
|
+
const id = text(head, 0, 4), length = id === "data" && dataSize !== void 0 && u32le(head, 4) === 4294967295 ? dataSize : u32le(head, 4);
|
|
29507
|
+
let end = at + 8 + length + length % 2;
|
|
29321
29508
|
if (id === "data") end = length ? Math.min(end, size) : size;
|
|
29322
29509
|
else check(at + 8 + length <= size);
|
|
29323
|
-
if (!WAV_KEEPS.has(id)) {
|
|
29510
|
+
if (!WAV_KEEPS.has(id) && !(rf64 && at === 12)) {
|
|
29324
29511
|
if (!WAV_SPACE.has(id)) patches.push({
|
|
29325
29512
|
start: at,
|
|
29326
29513
|
end: at + 4,
|
|
@@ -29375,8 +29562,12 @@ var INFO_KEEPS = /* @__PURE__ */ new Set([
|
|
|
29375
29562
|
var INFO_ZEROED = /* @__PURE__ */ new Set([19840, 22337]);
|
|
29376
29563
|
var TRACK_ENTRY = 174;
|
|
29377
29564
|
var TRACK_NAME = 21358;
|
|
29565
|
+
var CODEC_ID = 134;
|
|
29566
|
+
var CODEC_PRIVATE = 25506;
|
|
29378
29567
|
var SEEK = 19899;
|
|
29379
29568
|
var SEEK_ID = 21419;
|
|
29569
|
+
/** The codecs whose CodecPrivate is their Ogg headers Xiph-laced: the second a comment header, its magic, and whether a framing bit follows its comments. */
|
|
29570
|
+
var XIPH_PRIVATE = /* @__PURE__ */ new Map([["A_VORBIS", ["vorbis", true]], ["V_THEORA", ["theora", false]]]);
|
|
29380
29571
|
/** The element whose header is at `at` of `b` (`base` its offset in the file); one of unknown size ends at `limit`. */
|
|
29381
29572
|
function element(b, at, limit, base = 0) {
|
|
29382
29573
|
check(at < b.length);
|
|
@@ -29435,11 +29626,45 @@ function childrenOf(b, parent) {
|
|
|
29435
29626
|
return found;
|
|
29436
29627
|
}
|
|
29437
29628
|
/**
|
|
29629
|
+
* A track's CodecPrivate (`b`, changed in it) by its codec: a Vorbis or Theora track's headers (their count less one,
|
|
29630
|
+
* each size but the last's in Xiph lacing, them) with a comment header that has no comment, its sizes kept; a FLAC
|
|
29631
|
+
* track's `fLaC` and metadata blocks as a FLAC's, any byte after the last zeroed. Another codec's is kept as it is.
|
|
29632
|
+
*/
|
|
29633
|
+
async function noPrivateTags(b, codec) {
|
|
29634
|
+
const xiph = XIPH_PRIVATE.get(codec);
|
|
29635
|
+
if (xiph) {
|
|
29636
|
+
check(b.length >= 1 && b[0] === 2);
|
|
29637
|
+
let at = 1;
|
|
29638
|
+
const sizes = [];
|
|
29639
|
+
while (sizes.length < 2) {
|
|
29640
|
+
let size = 0;
|
|
29641
|
+
for (let byte = 255; byte === 255; size += byte) {
|
|
29642
|
+
check(at < b.length);
|
|
29643
|
+
byte = b[at++];
|
|
29644
|
+
}
|
|
29645
|
+
sizes.push(size);
|
|
29646
|
+
}
|
|
29647
|
+
const start = at + sizes[0], end = start + sizes[1];
|
|
29648
|
+
check(end <= b.length);
|
|
29649
|
+
b.set(noComments(b.subarray(start, end), ...xiph), start);
|
|
29650
|
+
} else if (codec === "A_FLAC") {
|
|
29651
|
+
check(b.length >= 4 && text(b, 0, 4) === "fLaC");
|
|
29652
|
+
const patches = [];
|
|
29653
|
+
const end = await flac(async (offset, length) => {
|
|
29654
|
+
check(offset >= 0 && length >= 0 && offset + length <= b.length);
|
|
29655
|
+
return b.subarray(offset, offset + length);
|
|
29656
|
+
}, b.length, 0, patches);
|
|
29657
|
+
for (const patch of patches) if (patch.bytes) b.set(patch.bytes, patch.start);
|
|
29658
|
+
else b.fill(0, patch.start, patch.end);
|
|
29659
|
+
b.fill(0, end);
|
|
29660
|
+
}
|
|
29661
|
+
}
|
|
29662
|
+
/**
|
|
29438
29663
|
* A top-level element of a segment read whole and changed in it: Info without its title, date and file names (its
|
|
29439
|
-
* muxer's and writing app's names zeroed), Tracks without their names
|
|
29440
|
-
* became Void. A CRC-32 in them, wrong once they changed, becomes Void too.
|
|
29664
|
+
* muxer's and writing app's names zeroed), Tracks without their names and the comments in their CodecPrivate, a
|
|
29665
|
+
* SeekHead without the entries for what became Void. A CRC-32 in them, wrong once they changed, becomes Void too.
|
|
29441
29666
|
*/
|
|
29442
|
-
function stripTopLevel(b) {
|
|
29667
|
+
async function stripTopLevel(b) {
|
|
29443
29668
|
const top = element(b, 0, b.length);
|
|
29444
29669
|
check(!top.unknown && top.end === b.length);
|
|
29445
29670
|
for (const child of childrenOf(b, top)) {
|
|
@@ -29448,7 +29673,11 @@ function stripTopLevel(b) {
|
|
|
29448
29673
|
if (INFO_ZEROED.has(child.id)) b.fill(0, child.body, child.end);
|
|
29449
29674
|
else if (!INFO_KEEPS.has(child.id) && child.id !== VOID) voidIn(b, child);
|
|
29450
29675
|
} else if (top.id === TRACKS && child.id === TRACK_ENTRY) {
|
|
29451
|
-
|
|
29676
|
+
const parts = childrenOf(b, child), ids = parts.filter((part) => part.id === CODEC_ID);
|
|
29677
|
+
check(ids.length <= 1);
|
|
29678
|
+
const codec = ids[0] ? text(b, ids[0].body, ids[0].end - ids[0].body).replace(/\0+$/, "") : "";
|
|
29679
|
+
for (const part of parts) if (part.id === TRACK_NAME || part.id === CRC32) voidIn(b, part);
|
|
29680
|
+
else if (part.id === CODEC_PRIVATE) await noPrivateTags(b.subarray(part.body, part.end), codec);
|
|
29452
29681
|
} else if (top.id === SEEK_HEAD && child.id === SEEK) {
|
|
29453
29682
|
const target = childrenOf(b, child).find((part) => part.id === SEEK_ID);
|
|
29454
29683
|
let id = 0;
|
|
@@ -29507,7 +29736,7 @@ async function matroska(source, read, patches) {
|
|
|
29507
29736
|
check(!el.unknown && el.end <= top.end);
|
|
29508
29737
|
if (el.id === INFO || el.id === TRACKS || el.id === SEEK_HEAD) {
|
|
29509
29738
|
const bytes = (await read(el.start, el.end - el.start)).slice();
|
|
29510
|
-
stripTopLevel(bytes);
|
|
29739
|
+
await stripTopLevel(bytes);
|
|
29511
29740
|
patches.push({
|
|
29512
29741
|
start: el.start,
|
|
29513
29742
|
end: el.end,
|
|
@@ -29540,7 +29769,11 @@ async function audioMetadataPatches(file, mime) {
|
|
|
29540
29769
|
throw error;
|
|
29541
29770
|
}
|
|
29542
29771
|
else if (text(head, 0, 4) === "OggS") await ogg(read, size, patches);
|
|
29543
|
-
else if (head.length >= 12 &&
|
|
29772
|
+
else if (head.length >= 12 && [
|
|
29773
|
+
"RIFF",
|
|
29774
|
+
"RF64",
|
|
29775
|
+
"BW64"
|
|
29776
|
+
].includes(text(head, 0, 4)) && text(head, 8, 4) === "WAVE") await wav(read, size, text(head, 0, 4) !== "RIFF", patches);
|
|
29544
29777
|
else if (text(head, 0, 4) === "Eߣ") await matroska(source, read, patches);
|
|
29545
29778
|
else if (text(head, 0, 4) === "fLaC") await trailingTags(read, size, await flac(read, size, 0, patches), patches);
|
|
29546
29779
|
else if (isId3(head) || isFrame(head, 0)) {
|
|
@@ -29552,7 +29785,8 @@ async function audioMetadataPatches(file, mime) {
|
|
|
29552
29785
|
}
|
|
29553
29786
|
if (at + 4 <= size && text(await read(at, 4), 0, 4) === "fLaC") at = await flac(read, size, at, patches);
|
|
29554
29787
|
await trailingTags(read, size, at, patches);
|
|
29555
|
-
} else
|
|
29788
|
+
} else if (MPEG_AUDIO.has(baseMime(mime))) await trailingTags(read, size, 0, patches);
|
|
29789
|
+
else return void 0;
|
|
29556
29790
|
if (!patches.length) return void 0;
|
|
29557
29791
|
patches.sort((a, b) => a.start - b.start);
|
|
29558
29792
|
for (let i = 1; i < patches.length; i++) check(patches[i].start >= patches[i - 1].end);
|
|
@@ -30950,45 +31184,35 @@ function seqDate(seq) {
|
|
|
30950
31184
|
return Number.isNaN(date.getTime()) ? (/* @__PURE__ */ new Date(0)).toISOString() : date.toISOString();
|
|
30951
31185
|
}
|
|
30952
31186
|
/**
|
|
30953
|
-
* Resolves a did:dht through Pkarr relays: one GET
|
|
30954
|
-
*
|
|
30955
|
-
*
|
|
31187
|
+
* Resolves a did:dht through Pkarr relays: one GET to each, all at once, and the newest packet that
|
|
31188
|
+
* checks out wins (the highest sequence number; on a tie, the relay listed first), so a relay holding
|
|
31189
|
+
* an older version cannot bring back a removed key or undo a deactivation. Each answer is bounded to
|
|
31190
|
+
* a BEP44 item, its signature checked against the DID's key and its records parsed strictly; a relay
|
|
31191
|
+
* that has nothing, fails or serves a packet that does not check out does not count. A deactivated DID
|
|
30956
31192
|
* resolves (`metadata.deactivated`); everything else that goes wrong throws a `DidDhtError`.
|
|
30957
31193
|
*/
|
|
30958
31194
|
async function resolveDidDht(did, options) {
|
|
30959
31195
|
const { z32 } = didDhtKey(did);
|
|
30960
31196
|
const relays = [...new Set((options.relays ?? DEFAULT_RELAYS).map(normalizeRelayUrl).filter((r) => r !== null))];
|
|
30961
31197
|
if (relays.length === 0) throw new DidDhtError("No Pkarr relay to ask", "unreachable");
|
|
31198
|
+
options.signal?.throwIfAborted();
|
|
31199
|
+
const responses = await Promise.all(relays.map((relay) => options.fetch(`${relay}/${z32}`, {
|
|
31200
|
+
maxBytes: DID_DHT_MAX_PAYLOAD,
|
|
31201
|
+
signal: options.signal,
|
|
31202
|
+
redirect: "error"
|
|
31203
|
+
}).catch(() => void 0)));
|
|
31204
|
+
options.signal?.throwIfAborted();
|
|
30962
31205
|
let notFound = false;
|
|
30963
31206
|
let refused;
|
|
30964
|
-
|
|
30965
|
-
|
|
30966
|
-
|
|
30967
|
-
|
|
30968
|
-
|
|
30969
|
-
maxBytes: DID_DHT_MAX_PAYLOAD,
|
|
30970
|
-
signal: options.signal,
|
|
30971
|
-
redirect: "error"
|
|
30972
|
-
});
|
|
30973
|
-
} catch (error) {
|
|
30974
|
-
if (options.signal?.aborted) throw error;
|
|
30975
|
-
continue;
|
|
30976
|
-
}
|
|
30977
|
-
if (response.status === 404) {
|
|
30978
|
-
notFound = true;
|
|
30979
|
-
continue;
|
|
30980
|
-
}
|
|
30981
|
-
if (response.status !== 200) continue;
|
|
31207
|
+
let newest;
|
|
31208
|
+
for (const [i, relay] of relays.entries()) {
|
|
31209
|
+
const response = responses[i];
|
|
31210
|
+
if (response?.status === 404) notFound = true;
|
|
31211
|
+
if (response?.status !== 200) continue;
|
|
30982
31212
|
try {
|
|
30983
31213
|
const opened = openDidDhtPayload(did, response.bytes);
|
|
30984
|
-
|
|
30985
|
-
|
|
30986
|
-
metadata: {
|
|
30987
|
-
versionId: opened.seq.toString(),
|
|
30988
|
-
updated: seqDate(opened.seq),
|
|
30989
|
-
...opened.deactivated ? { deactivated: true } : {},
|
|
30990
|
-
...opened.types ? { types: opened.types } : {}
|
|
30991
|
-
},
|
|
31214
|
+
if (!newest || opened.seq > newest.seq) newest = {
|
|
31215
|
+
...opened,
|
|
30992
31216
|
relay
|
|
30993
31217
|
};
|
|
30994
31218
|
} catch (error) {
|
|
@@ -30996,6 +31220,16 @@ async function resolveDidDht(did, options) {
|
|
|
30996
31220
|
refused = error;
|
|
30997
31221
|
}
|
|
30998
31222
|
}
|
|
31223
|
+
if (newest) return {
|
|
31224
|
+
document: newest.document,
|
|
31225
|
+
metadata: {
|
|
31226
|
+
versionId: newest.seq.toString(),
|
|
31227
|
+
updated: seqDate(newest.seq),
|
|
31228
|
+
...newest.deactivated ? { deactivated: true } : {},
|
|
31229
|
+
...newest.types ? { types: newest.types } : {}
|
|
31230
|
+
},
|
|
31231
|
+
relay: newest.relay
|
|
31232
|
+
};
|
|
30999
31233
|
if (refused) throw refused;
|
|
31000
31234
|
if (notFound) throw new DidDhtError("No document is published for this did:dht", "not-found");
|
|
31001
31235
|
throw new DidDhtError("No Pkarr relay answered for this did:dht", "unreachable");
|
|
@@ -33502,6 +33736,10 @@ var CatchUpAnswers = class {
|
|
|
33502
33736
|
}
|
|
33503
33737
|
})();
|
|
33504
33738
|
}
|
|
33739
|
+
/** Whether an answer to `to` still has frames to send, or sent ones its app has not said it handled yet (`hooks.handled`). */
|
|
33740
|
+
busy(to) {
|
|
33741
|
+
return this.going.has(to) || !!this.onTheirWay.get(to)?.size;
|
|
33742
|
+
}
|
|
33505
33743
|
/** The next slice of `rest` to `to`, as sent: undefined, and nothing left, when the edge did not take one. */
|
|
33506
33744
|
sendSlice(to, rest) {
|
|
33507
33745
|
const slice = rest.splice(0, 16);
|
|
@@ -33612,6 +33850,11 @@ var GROUP_READ_NOTE = `Everyone in the group can read everything sent while they
|
|
|
33612
33850
|
*/
|
|
33613
33851
|
var ANSWER_WINDOW_MS$1 = 5e3;
|
|
33614
33852
|
/**
|
|
33853
|
+
* How long a name an edge took away can still come back when I am taken out of the group (`nameKept`): the commit
|
|
33854
|
+
* that removed me comes over the admin's kept edge right after it opens, within the minute that edge stays open.
|
|
33855
|
+
*/
|
|
33856
|
+
var UNNAMED_KEPT_MS = 6e4;
|
|
33857
|
+
/**
|
|
33615
33858
|
* One member's messages (or edits) taken: its whole log handed back at once twice over (`AUTHOR_BURST`: an edge opening
|
|
33616
33859
|
* hears it, with what the member says live beside it, and the edits its app says again), then
|
|
33617
33860
|
* `GROUP_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`, as a community's `MessagePace`.
|
|
@@ -34045,6 +34288,12 @@ var GroupSession = class {
|
|
|
34045
34288
|
* said it (`heardName`). In memory only; the records held start it.
|
|
34046
34289
|
*/
|
|
34047
34290
|
nickAt = /* @__PURE__ */ new Map();
|
|
34291
|
+
/**
|
|
34292
|
+
* Member → the name an edge's empty one took away a moment ago (`setNick`), and when. The admin that removed me while
|
|
34293
|
+
* I was away says no name on the edge it kept to tell me, as its app opens it, and the commit that removes me comes
|
|
34294
|
+
* right after on that edge: that name comes back for the history I keep (`nameKept`). In memory only.
|
|
34295
|
+
*/
|
|
34296
|
+
unnamed = /* @__PURE__ */ new Map();
|
|
34048
34297
|
/** The version of my name record last said to every member (`sayName`). In memory only: said again once per start. */
|
|
34049
34298
|
nameSaid;
|
|
34050
34299
|
/** New name records taken per member, a few a minute (`GROUP_LIMITS.namesPerMember`). In memory only. */
|
|
@@ -34755,6 +35004,16 @@ var GroupSession = class {
|
|
|
34755
35004
|
this.waiting = [];
|
|
34756
35005
|
this.waitingBytes = 0;
|
|
34757
35006
|
this.pendingCommits.clear();
|
|
35007
|
+
this.nameKept();
|
|
35008
|
+
}
|
|
35009
|
+
/**
|
|
35010
|
+
* Out of the group: a name an edge took away a moment before comes back, as the history I keep still shows it. The
|
|
35011
|
+
* edge the admin kept to tell me I was removed says no name as it opens, just before the commit that removed me.
|
|
35012
|
+
*/
|
|
35013
|
+
nameKept() {
|
|
35014
|
+
const now = this.now();
|
|
35015
|
+
for (const [key, { nick, at }] of this.unnamed) if (now - at <= UNNAMED_KEPT_MS && !this.state.nicks[key]) this.state.nicks[key] = nick;
|
|
35016
|
+
this.unnamed.clear();
|
|
34758
35017
|
}
|
|
34759
35018
|
/**
|
|
34760
35019
|
* Encrypts and signs a text, keeps it for catch-up and sends it to every other member. `mentions`: places of the
|
|
@@ -35261,10 +35520,17 @@ var GroupSession = class {
|
|
|
35261
35520
|
setNick(key, nick) {
|
|
35262
35521
|
return this.serialize(async () => {
|
|
35263
35522
|
const clean = sanitizeNick(nick);
|
|
35523
|
+
if (!clean && this.state.status !== "active") return;
|
|
35264
35524
|
this.nickAt.set(key, this.now());
|
|
35265
|
-
|
|
35525
|
+
const was = this.state.nicks[key];
|
|
35526
|
+
if ((was ?? void 0) === clean) return;
|
|
35266
35527
|
if (clean) this.state.nicks[key] = clean;
|
|
35267
35528
|
else delete this.state.nicks[key];
|
|
35529
|
+
if (!clean && was) this.unnamed.set(key, {
|
|
35530
|
+
nick: was,
|
|
35531
|
+
at: this.now()
|
|
35532
|
+
});
|
|
35533
|
+
else this.unnamed.delete(key);
|
|
35268
35534
|
if (key === this.myKey) await this.persist();
|
|
35269
35535
|
else this.persistSoon();
|
|
35270
35536
|
this.hooks.changed();
|
|
@@ -40301,6 +40567,6 @@ function readX401SdJwtVc(text) {
|
|
|
40301
40567
|
};
|
|
40302
40568
|
}
|
|
40303
40569
|
//#endregion
|
|
40304
|
-
export { SSHSIG_NAMESPACE as $, REMOVED_TEXT as $a, turnOff as $c, revokesIdentity as $i, createDeviceInvite as $l, pairedMessageFits as $n, rosterHas as $o, personStatus as $r, handoffAttemptSucceeded as $s, ONCHAIN_PROVIDER as $t, RELAY_PAYLOAD_MAX_BYTES as $u, knockIdentity as A, wellKnownUrl as Aa, signTombstone as Ac, APPS_CAPABILITY as Ai, APP_STATEMENT_LIMITS as Al, ENDPOINT as An, TASK_STATUSES as Ao, doorHubs as Ar, contactRtcConfig as As, didJwsAlg as At, signTurnPacket as Au, GROUP_REACTED_FRAME as B, PLAYABLE_AUDIO as Ba, enrollGrantFrame as Bc, IDENTITY_MAX_VALIDITY as Bi, readAppRevocationShape as Bl, NO_VIDEO_METADATA as Bn, MESSAGE_CLOCK_SKEW_MS as Bo, readBeacon as Br, HANDOFF_DONE as Bs, parseDidSignaturePaste as Bt, RelayTransport as Bu, communityHasFrame as C, isPublicAddress as Ca, readHandoffVerified as Cc, checkPushEndpoint as Ci, checkAppManifest as Cl, pubkyProofFile as Cn, CRON_LINE as Co, MESH_HUBS as Cr, CALL_SIGNAL_MAX_AGE_MS as Cs, DID_DOCUMENT_MAX_BYTES as Ct, classifyTurnRead as Cu, decodeGroupEntryLink as D, recordsFromWellKnown as Da, readSetUpdate as Dc, APP_DATA_MAX_BYTES as Di, readAppBundleAsync as Dl, requestLnurlInvoice as Dn, ROUTINE_STATES as Do, COMMUNITY_TOPOLOGY as Dr, buildSdpFromSignal as Ds, checkDidJws as Dt, firstDeviceSetSecret as Du, KNOCK_TTL_MS as E, recordsFromTxt as Ea, SET_UPDATE as Ec, isServeId as Ei, readAppBundle as El, pubkyHomeserverOf as En, PR_STATES as Eo, pickMeshHubs as Er, answersOffer as Es, DidError as Et, TURN_MAX as Eu, GroupWakeLimiter as F, DHT_FILE_CAPABILITY as Fa, ENROLL_PROOF as Fc, CapsExchange as Fi, isAppHash as Fl, parseCashuRequestPayload as Fn, cardUrl as Fo, mergeBeacon as Fr, HTTP_SERVICE_PROTO as Fs, didWebFileUrl as Ft, turnStatedVerifier as Fu, GROUP_EDIT_FRAME as G, fileMessageText as Ga, verifyEnrollProof as Gc, boundVerifiedIdentity as Gi, parseImageMeta as Gl, isStrippedPicture as Gn, shownTime as Go, FILE_LIMITS as Gr, HANDOFF_PIECE_BYTES as Gs, didDhtDocument as Gt, relayUrlProblem as Gu, GroupSession as H, VOICE_METER as Ha, enrollProofFrame as Hc, IdentityCheckUnavailable as Hi, setAppSignatureFastPath as Hl, withoutVideoMetadata as Hn, claimedTime as Ho, readLobby as Hr, HANDOFF_HELLO as Hs, staticDidDocument as Ht, SLOW_MS as Hu, groupWakeFrame as I, dhtFileId as Ia, enrollCancelFrame as Ic, DHT_TEXT_CAPABILITY as Ii, isAppKey as Il, parseFedimintRequestPayload as In, checkStatusCard as Io, mergeLobby as Ir, LEGACY_SERVICES as Is, didWebHost as It, turnVerifierMark as Iu, meshMessageRef as J, voiceLevel as Ja, inboxRecord as Jc, identityRevocationValue as Ji, canonicalJsonBytes as Jl, GhostLink as Jn, MAX_GROUP_CHAIN as Jo, transferEnded as Jr, HANDOFF_VERIFIED as Js, encodeDidDhtPacket as Jt, DiscoveryBudgetError as Ju, GROUP_EDIT_TEXT_BYTES as K, parseVoiceMeta as Ka, clearMissed as Kc, emptyIdentityLedger as Ki, readImageMeta as Kl, stripPictureMetadata as Kn, GROUP_ADMIN_OFF_ERROR as Ko, FileUplink as Kr, HANDOFF_REQUEST as Ks, didDhtFromPublicKey as Kt, setLinkTraceSink as Ku, groupWakes as L, formatFileSize as La, enrollCancelReason as Lc, capsDescriptors as Li, isAppLine as Ll, NO_AUDIO_METADATA as Ln, sameButtonText as Lo, newerHead as Lr, serviceIdFromName as Ls, normalizeDid as Lt, DEFAULT_RELAYS as Lu, mergeKnocks as M, DHT_FILE_TOO_LARGE as Ma, ENROLL_DONE as Mc, EDIT_CAPABILITY as Mi, appRef as Ml, fedimintRequestPayload as Mn, appCardUrl as Mo, hubRank as Mr, parseCallSignal as Ms, didWebDocumentUrl as Mt, turnInstance as Mu, readKnocks as N, DHT_MESSAGE_TTL as Na, ENROLL_GRANT as Nc, STATUS_CARD_CAPABILITY as Ni, appRefPublisher as Nl, findEndpoint as Nn, buttonLabelClash as No, lobbyKeys as Nr, signalHasVideo as Ns, didWebFile as Nt, turnKeys as Nu, encodeGroupEntryLink as O, recordsName as Oa, setAckFrame as Oc, chatAppId as Oi, sha256Paced as Ol, resolveLightningDestination as On, RUN_RESULTS as Oo, beaconKeys as Or, callRtcConfig as Os, checkDidSignature as Ot, nextTurnPosition as Ou, GROUP_WAKE_FRAME as P, peekDhtMailbox as Pa, ENROLL_HELLO as Pc, UPGRADE_CAPABILITY as Pi, checkAppRevokeStatement as Pl, isFederationId as Pn, cardLine as Po, lobbyRecords as Pr, emptyLinkRecords as Ps, didWebFileNames as Pt, turnName as Pu, SSHSIG_MAX_ARMOR as Q, MAX_REMOVAL_NUMBER as Qa, takeRequest as Qc, receivedIdentityStatus as Qi, readContactLink as Ql, pairedEditFits as Qn, rosterAdmin as Qo, liveStatus as Qr, handoffAttemptFailed as Qs, EVM_TEST_CHAINS as Qt, PacketTooLargeError as Qu, parseGroupWakeFrame as R, sanitizeFileName as Ra, enrollDigits as Rc, dialDescriptors as Ri, isAppRef as Rl, audioMetadataPatches as Rn, statusCardBytes as Ro, pickHubs as Rr, HANDOFF_ACK as Rs, parseDid as Rt, HEDGE_MISSING_MS as Ru, GROUP_READ_NOTE_COMMUNITY as S, encodeDnsQuery as Sa, readHandoffTurnFrame as Sc, wakeRequest as Si, assembleAppBundle as Sl, pubkyProofCapability as Sn, BUTTON_STYLES as So, readGroupSignal as Sr, BURST_RING_MS as Ss, verifyAtprotoRecordProof as St, TURN_SETTLE_MS as Su, encodeCommunityLink as T, normalizeDomain as Ta, SET_ACK as Tc, APP_RANGE_LIMITS as Ti, pacer as Tl, homeserverWebEndpoint as Tn, PR_CHECKS as To, meshHubs as Tr, RTC_CONFIG as Ts, DID_JWS_MAX_LENGTH as Tt, TURN_LAST_SEQUENCE as Tu, frameBytes as U, baseMime as Ua, readEnrollGrant as Uc, IdentityExchange as Ui, signAppObject as Ul, NO_PICTURE_METADATA as Un, heardTime as Uo, shouldBeHub as Ur, HANDOFF_OFFER as Us, strictBase64Url as Ut, currentRelays as Uu, GROUP_READ_NOTE as V, VOICE_LIMITS as Va, enrollHelloFrame as Vc, IDENTITY_REVOCATION_LABEL as Vi, readAppRevocations as Vl, videoMetadataPatches as Vn, arrivalKey as Vo, readBeaconHead as Vr, HANDOFF_HAVE as Vs, signingKeys as Vt, RelaysFailedError as Vu, COMMUNITY_EDIT_FRAME as W, downsamplePeaks as Wa, readEnrollHello as Wc, boundIdentityDisplay as Wi, signAppRevocation as Wl, PICTURE_METADATA_LIMITS as Wn, receivedTimestamp as Wo, ChatFiles as Wr, HANDOFF_PAKE as Ws, DidDhtError as Wt, normalizeRelayUrl as Wu, mentionsMember as X, EDIT_BUFFER_MS as Xa, planKnocks as Xc, isIdentityBinding as Xi, createContactLink as Xl, LIVENESS_PING_MS as Xn, commitHash as Xo, STATUS_AVAILABILITIES as Xr, filePartName as Xs, signDidDhtPacket as Xt, isDiscoveryBudgetError as Xu, parseCommunityEdit as Y, parseVideoMeta as Ya, newInbox as Yc, identityStatement as Yi, readCanonicalJson as Yl, INVITE_TAKEN as Yn, MEMBER_KEY as Yo, transferStalled as Yr, NO_ATTEMPTS as Ys, resolveDidDht as Yt, budgetRetryMs as Yu, groupName as Z, EDIT_RATE_WINDOW_MS as Za, settleRequest as Zc, newIdentityBinding as Zi, encodeContactLink as Zl, PAIRED_FRAME_TOO_LARGE as Zn, parseGroupCommit as Zo, STATUS_IDLE_AFTER_MS as Zr, handoffAttemptAllowed as Zs, ETHEREUM_USDT as Zt, withRequestOptions as Zu, groupTypingEpoch as _, DOMAIN_FILE_MAX_BYTES as _a, readHandoffCancel as _c, randomBytes as _d, WakeLimiter as _i, APP_BUNDLE_MAGIC as _l, PUBKY_PROOF_MAX_BYTES as _n, wireReaction as _o, GROUP_SIGNAL_FRAME as _r, parseLocalTarget as _s, isAtprotoDid as _t, newDeviceSetSecret as _u, appRevocationFor as a, automaticTransport as aa, handoffDigest as ac, identityFromSeed as ad, typingActivity as ai, knockSlotIdentity as al, WALLET_NETWORKS as an, forwardedAgain as ao, GROUP_FILE_LIMITS as ar, ratchetSessionOf as as, verifySshSignature as at, encodeInviteCode as au, COMMUNITY_LIMITS as b, domainTxtRecord as ba, readHandoffHello as bc, utf8Decode as bd, parseWakeFrame as bi, appDigest as bl, newPubkyProofFolder as bn, replySnippet as bo, SIGNAL_REPLY_MS as br, decodeControl as bs, shortAtprotoDid as bt, TURN_PUT_WINDOW_MS as bu, checkAppBeforeRun as c, irohRelayUrl as ca, handoffManifestFrames as cc, verify as cd, mayPin as ci, linkRecords as cl, assertWholeSats as cn, GROUP_REACTION_FRAME as co, GROUP_WANT_NO_FRAME as cr, DAEMON_WATCH_PEER_IDLE_MS as cs, decodeAnyBitcoinAddress as ct, ownInviteRefusal as cu, checkAppStoreIndex as d, HOLD_LIMITS as da, handoffReleaseFrame as dc, hasVisible as dd, pinNumberHolds as di, openRequest as dl, walletNetworkOf as dn, nextReactionNumber as do, isGroupMessageId as dr, PRESENCE_WINDOW as ds, ATPROTO_PROOF_COLLECTION as dt, HANDOFF_CAPABILITY as du, lastSharedWithMe as ea, handoffBusyFrame as ec, createRelayPayload as ed, sanitizeStatusText as ei, ContactRequestError as el, PaymentPreflightError as en, RateWindow as eo, pairedMessageFrame as er, verifyCommitSignature as es, SshSigError as et, deviceInviteJoinerParams as eu, readAppStore as f, HoldKeys as fa, handoffRetryAfter as fc, sanitizeDisplayText as fd, readPin as fi, readKnockSlot as fl, SPARK_NETWORKS as fn, queueReaction as fo, readGroupFileMeta as fr, RELAY_POLL_INTERVALS as fs, ATPROTO_PROOF_SCOPE as ft, deviceEchoFrame as fu, GroupTypingBoard as g, readManifest as ga, readHandoffAck as gc, isZ32Key as gd, WAKE_ONLINE_INTERVAL_MS as gi, APP_BUNDLE_LIMITS as gl, isBitcoinAddress as gn, validReactionNumber as go, CarriedTransport as gr, formatLocalTarget as gs, checkAtprotoProofRecord as gt, devicePingFrame as gu, GROUP_TYPING_FRAME as h, newMailbox as ha, newHandoffId as hc, fromBase64Url as hd, WAKE_ONLINE_DELAY_MS as hi, seenEntry as hl, sparkInvoiceDetails as hn, readReaction as ho, readGroupWantNo as hr, GhostlyHttpError as hs, atprotoProofRkey as ht, deviceLinkPairing as hu, addedAppPermissions as i, TRANSPORTS as ia, handoffDataFrame as ic, createIdentity as id, sanitizeTypingStatus as ii, contactDay as il, USDT_PUBLIC_RPC as in, parseLinkPreview as io, parseEngineError as ir, emptyRatchetState as is, sshSignCommand as it, decodeInviteCode as iu, knockRecords as j, ACTIVE_DHT_POLL_MS as ja, verifySetUpdate as jc, BUTTONS_CAPABILITY as ji, appFingerprint as jl, cashuRequestPayload as jn, appCardId as jo, freshHubs as jr, extractParamsFromSdp as js, didSignedMessages as jt, signTurnRelease as ju, entryParams as k, txtValue as ka, setUpdateFrame as kc, isAppVersion as ki, APP_PREFIXES as kl, decodeBolt11 as kn, STATUS_CARD_LIMITS as ko, beaconRecords as kr, callSignalHeardAt as ks, didGhostlyServiceEntry as kt, readTurnPacket as ku, planAppUpdate as l, HOLD_CAPABILITY as la, handoffOfferFrame as lc, MAX_AVATAR_LENGTH as ld, nextPinNumber as li, makeStampPaced as ll, formatPaymentAmount as ln, REACTION_LIMITS as lo, fetchesByItself as lr, DHT_POLL_INTERVALS as ls, ATPROTO_DECLARED_SCOPE as lt, DEVICES_CAPABILITY as lu, signAppStore as m, isHoldUrl as ma, handoffVersions as mc, bytesEqual as md, WAKE_ONLINE_BATCH_MS as mi, requestRecords as ml, sparkAddressKind as mn, reactionIsNewer as mo, readGroupWant as mr, presenceSeenAt as ms, atprotoProofRecord as mt, deviceKeyZ32 as mu, readX401SdJwtVc as n, emptyProofLedger as na, handoffContext as nc, openRelayPayload as nd, TYPING_REFRESH_MS as ni, contactAskerFrame as nl, SEPOLIA_TEST_USDT_FAUCET as nn, LINK_TRAILING as no, engineError as nr, RATCHET_CAPABILITY as ns, parseSshSignature as nt, OwnInviteError as nu, appStoreDecision as o, dialableIrohRelay as oa, handoffEphemeral as oc, identityFromSeedB64 as od, GROUP_PIN_FRAME as oi, knockSlotOf as ol, arkAddressPrefix as on, readForwarded as oo, GROUP_HAVE_FRAME as or, DirectPathWatch as os, verifyBitcoinMessage as ot, inviteLink as ou, readAppStoreSteps as p, HoldRefusedError as pa, handoffStreamKey as pc, stripHidden as pd, WAKE_CALL_INTERVAL_MS as pi, readLinkRecord as pl, SPARK_PROVIDER as pn, reactionEmoji as po, readGroupHave as pr, WATCH_PEER_MS as ps, atprotoDidMethod as pt, deviceEchoNonce as pu, carryMentions as q, voiceDownloadName as qa, endedRequests as qc, identityRefusal as qi, canonicalJson as ql, withoutPictureMetadata as qn, GROUP_MEMBER_CAP as qo, sentWhole as qr, HANDOFF_TIMINGS as qs, encodeDidDhtDeactivated as qt, traceLink as qu, sameX401HolderJwk as r, validExternalKey as ra, handoffContextProof as rc, parseRelayPayload as rd, TypingSender as ri, contactAskerHolds as rl, TEST_USDT_FAUCET_AMOUNT as rn, linkStop as ro, engineText as rr, RatchetBox as rs, sameSshKey as rt, createChatInvite as ru, appUpdateDecision as s, irohDescriptor as sa, handoffHelloFrame as sc, publicKeyFromZ32 as sd, PIN_LIMITS as si, knockSlotRecords as sl, assertTokenUnits as sn, COMMUNITY_REACTION_FRAME as so, GROUP_WANT_FRAME as sr, AWAITING_PEER_MS as ss, BitcoinAddressError as st, inviteOwnership as su, newX401HolderKey as t, PeerProofs as ta, handoffCancelFrame as tc, newerPacket as td, TYPING_KINDS as ti, REQUEST_LIFETIME_MS as tl, SEPOLIA_TEST_USDT as tn, dhtEditId as to, EngineError as tr, edgeParams as ts, parseSshPublicKey as tt, readDeviceInvite as tu, APP_STORE_LIMITS as u, HOLD_DATED_BACK_MS as ua, handoffPakeFrame as uc, sanitizeAvatar as ud, pinIsNewer as ui, mergeContactKnocks as ul, validatePaymentTarget as un, ReactionWindow as uo, groupFileFallback as ur, EXPECT_PEER_MS as us, ATPROTO_FULL_SCOPE as ut, ENROLL_CAPABILITY as uu, openGroupTyping as v, decodeDnsResponse as va, readHandoffDone as vc, toBase64Url as vd, deviceWakeRequest as vi, APP_ICON_PATH as vl, isPubkyKey as vn, pairedReplyAuthor as vo, SIGNAL_FRESH_MS as vr, webLocalFetch as vs, normalizeAtprotoHandle as vt, seedSigner as vu, decodeCommunityLink as w, nip05RootKey as wa, sealHandoffPiece as wc, vapidKeysMatch as wi, isAppUrl as wl, pubkyProofPath as wn, ITEM_STATES as wo, mayBeHub as wr, QUICK_REDIAL_MS as ws, DID_FILE_MAX_BYTES as wt, turnPutSummary as wu, CommunitySession as x, domainWellKnownFile as xa, readHandoffPake as xc, utf8Encode as xd, relayRequest as xi, appViewOf as xl, normalizePubkyKey as xn, BUTTON_ID as xo, groupSignalFrame as xr, encodeControl as xs, AtprotoProofError as xt, TURN_RAISE_READ_TIMEOUT_MS as xu, sealGroupTyping as y, dnsProofName as ya, readHandoffHave as yc, toZ32 as yd, newWakeToken as yi, APP_PERMISSIONS as yl, isPubkyProofFolder as yn, readReply as yo, SIGNAL_HOLD_MS as yr, LIMITS as ys, parseAtprotoDidDocument as yt, webCryptoSigner as yu, GROUP_LIMITS as z, sanitizeMime as za, enrollDoneFrame as zc, IDENTITY_MAX_EVIDENCE as zi, readAppRevocation as zl, withoutAudioMetadata as zn, statusCardText as zo, rankHubs as zr, HANDOFF_CANCEL as zs, parseDidDocument as zt, HEDGE_MS as zu };
|
|
40570
|
+
export { SSHSIG_MAX_ARMOR as $, MAX_REMOVAL_NUMBER as $a, takeRequest as $c, receivedIdentityStatus as $i, readContactLink as $l, pairedEditFits as $n, rosterAdmin as $o, liveStatus as $r, handoffAttemptFailed as $s, EVM_TEST_CHAINS as $t, PacketTooLargeError as $u, knockIdentity as A, txtValue as Aa, setUpdateFrame as Ac, isAppVersion as Ai, APP_PREFIXES as Al, decodeBolt11 as An, STATUS_CARD_LIMITS as Ao, beaconRecords as Ar, callSignalHeardAt as As, didGhostlyServiceEntry as At, readTurnPacket as Au, GROUP_REACTED_FRAME as B, sanitizeMime as Ba, enrollDoneFrame as Bc, IDENTITY_MAX_EVIDENCE as Bi, readAppRevocation as Bl, withoutAudioMetadata as Bn, statusCardText as Bo, rankHubs as Br, HANDOFF_CANCEL as Bs, parseDidDocument as Bt, HEDGE_MS as Bu, communityHasFrame as C, encodeDnsQuery as Ca, readHandoffTurnFrame as Cc, utf8Encode as Cd, wakeRequest as Ci, assembleAppBundle as Cl, pubkyProofCapability as Cn, BUTTON_STYLES as Co, readGroupSignal as Cr, BURST_RING_MS as Cs, verifyAtprotoRecordProof as Ct, TURN_SETTLE_MS as Cu, decodeGroupEntryLink as D, recordsFromTxt as Da, SET_UPDATE as Dc, isServeId as Di, readAppBundle as Dl, pubkyHomeserverOf as Dn, PR_STATES as Do, pickMeshHubs as Dr, answersOffer as Ds, DidError as Dt, TURN_MAX as Du, KNOCK_TTL_MS as E, normalizeDomain as Ea, SET_ACK as Ec, APP_RANGE_LIMITS as Ei, pacer as El, homeserverWebEndpoint as En, PR_CHECKS as Eo, meshHubs as Er, RTC_CONFIG as Es, DID_JWS_MAX_LENGTH as Et, TURN_LAST_SEQUENCE as Eu, GroupWakeLimiter as F, peekDhtMailbox as Fa, ENROLL_HELLO as Fc, UPGRADE_CAPABILITY as Fi, checkAppRevokeStatement as Fl, isFederationId as Fn, cardLine as Fo, lobbyRecords as Fr, emptyLinkRecords as Fs, didWebFileNames as Ft, turnName as Fu, COMMUNITY_EDIT_FRAME as G, downsamplePeaks as Ga, readEnrollHello as Gc, boundIdentityDisplay as Gi, signAppRevocation as Gl, PICTURE_METADATA_LIMITS as Gn, receivedTimestamp as Go, ChatFiles as Gr, HANDOFF_PAKE as Gs, DidDhtError as Gt, normalizeRelayUrl as Gu, GroupSession as H, VOICE_LIMITS as Ha, enrollHelloFrame as Hc, IDENTITY_REVOCATION_LABEL as Hi, readAppRevocations as Hl, videoMetadataPatches as Hn, arrivalKey as Ho, readBeaconHead as Hr, HANDOFF_HAVE as Hs, signingKeys as Ht, RelaysFailedError as Hu, groupWakeFrame as I, DHT_FILE_CAPABILITY as Ia, ENROLL_PROOF as Ic, CapsExchange as Ii, isAppHash as Il, parseCashuRequestPayload as In, cardUrl as Io, mergeBeacon as Ir, HTTP_SERVICE_PROTO as Is, didWebFileUrl as It, turnStatedVerifier as Iu, carryMentions as J, voiceDownloadName as Ja, endedRequests as Jc, identityRefusal as Ji, canonicalJson as Jl, withoutPictureMetadata as Jn, GROUP_MEMBER_CAP as Jo, sentWhole as Jr, HANDOFF_TIMINGS as Js, encodeDidDhtDeactivated as Jt, traceLink as Ju, GROUP_EDIT_FRAME as K, fileMessageText as Ka, verifyEnrollProof as Kc, boundVerifiedIdentity as Ki, parseImageMeta as Kl, isStrippedPicture as Kn, shownTime as Ko, FILE_LIMITS as Kr, HANDOFF_PIECE_BYTES as Ks, didDhtDocument as Kt, relayUrlProblem as Ku, groupWakes as L, dhtFileId as La, enrollCancelFrame as Lc, DHT_TEXT_CAPABILITY as Li, isAppKey as Ll, parseFedimintRequestPayload as Ln, checkStatusCard as Lo, mergeLobby as Lr, LEGACY_SERVICES as Ls, didWebHost as Lt, turnVerifierMark as Lu, mergeKnocks as M, ACTIVE_DHT_POLL_MS as Ma, verifySetUpdate as Mc, BUTTONS_CAPABILITY as Mi, appFingerprint as Ml, cashuRequestPayload as Mn, appCardId as Mo, freshHubs as Mr, extractParamsFromSdp as Ms, didSignedMessages as Mt, signTurnRelease as Mu, readKnocks as N, DHT_FILE_TOO_LARGE as Na, ENROLL_DONE as Nc, EDIT_CAPABILITY as Ni, appRef as Nl, fedimintRequestPayload as Nn, appCardUrl as No, hubRank as Nr, parseCallSignal as Ns, didWebDocumentUrl as Nt, turnInstance as Nu, encodeGroupEntryLink as O, recordsFromWellKnown as Oa, readSetUpdate as Oc, APP_DATA_MAX_BYTES as Oi, readAppBundleAsync as Ol, requestLnurlInvoice as On, ROUTINE_STATES as Oo, COMMUNITY_TOPOLOGY as Or, buildSdpFromSignal as Os, checkDidJws as Ot, firstDeviceSetSecret as Ou, GROUP_WAKE_FRAME as P, DHT_MESSAGE_TTL as Pa, ENROLL_GRANT as Pc, STATUS_CARD_CAPABILITY as Pi, appRefPublisher as Pl, findEndpoint as Pn, buttonLabelClash as Po, lobbyKeys as Pr, signalHasVideo as Ps, didWebFile as Pt, turnKeys as Pu, groupName as Q, EDIT_RATE_WINDOW_MS as Qa, settleRequest as Qc, newIdentityBinding as Qi, encodeContactLink as Ql, PAIRED_FRAME_TOO_LARGE as Qn, parseGroupCommit as Qo, STATUS_IDLE_AFTER_MS as Qr, handoffAttemptAllowed as Qs, ETHEREUM_USDT as Qt, withRequestOptions as Qu, parseGroupWakeFrame as R, formatFileSize as Ra, enrollCancelReason as Rc, capsDescriptors as Ri, isAppLine as Rl, NO_AUDIO_METADATA as Rn, sameButtonText as Ro, newerHead as Rr, serviceIdFromName as Rs, normalizeDid as Rt, DEFAULT_RELAYS as Ru, GROUP_READ_NOTE_COMMUNITY as S, domainWellKnownFile as Sa, readHandoffPake as Sc, utf8Decode as Sd, relayRequest as Si, appViewOf as Sl, normalizePubkyKey as Sn, BUTTON_ID as So, groupSignalFrame as Sr, encodeControl as Ss, AtprotoProofError as St, TURN_RAISE_READ_TIMEOUT_MS as Su, encodeCommunityLink as T, nip05RootKey as Ta, sealHandoffPiece as Tc, vapidKeysMatch as Ti, isAppUrl as Tl, pubkyProofPath as Tn, ITEM_STATES as To, mayBeHub as Tr, QUICK_REDIAL_MS as Ts, DID_FILE_MAX_BYTES as Tt, turnPutSummary as Tu, frameBytes as U, VOICE_METER as Ua, enrollProofFrame as Uc, IdentityCheckUnavailable as Ui, setAppSignatureFastPath as Ul, withoutVideoMetadata as Un, claimedTime as Uo, readLobby as Ur, HANDOFF_HELLO as Us, staticDidDocument as Ut, SLOW_MS as Uu, GROUP_READ_NOTE as V, PLAYABLE_AUDIO as Va, enrollGrantFrame as Vc, IDENTITY_MAX_VALIDITY as Vi, readAppRevocationShape as Vl, NO_VIDEO_METADATA as Vn, MESSAGE_CLOCK_SKEW_MS as Vo, readBeacon as Vr, HANDOFF_DONE as Vs, parseDidSignaturePaste as Vt, RelayTransport as Vu, CatchUpAnswers as W, baseMime as Wa, readEnrollGrant as Wc, IdentityExchange as Wi, signAppObject as Wl, NO_PICTURE_METADATA as Wn, heardTime as Wo, shouldBeHub as Wr, HANDOFF_OFFER as Ws, strictBase64Url as Wt, currentRelays as Wu, parseCommunityEdit as X, parseVideoMeta as Xa, newInbox as Xc, identityStatement as Xi, readCanonicalJson as Xl, INVITE_TAKEN as Xn, MEMBER_KEY as Xo, transferStalled as Xr, NO_ATTEMPTS as Xs, resolveDidDht as Xt, budgetRetryMs as Xu, meshMessageRef as Y, voiceLevel as Ya, inboxRecord as Yc, identityRevocationValue as Yi, canonicalJsonBytes as Yl, GhostLink as Yn, MAX_GROUP_CHAIN as Yo, transferEnded as Yr, HANDOFF_VERIFIED as Ys, encodeDidDhtPacket as Yt, DiscoveryBudgetError as Yu, mentionsMember as Z, EDIT_BUFFER_MS as Za, planKnocks as Zc, isIdentityBinding as Zi, createContactLink as Zl, LIVENESS_PING_MS as Zn, commitHash as Zo, STATUS_AVAILABILITIES as Zr, filePartName as Zs, signDidDhtPacket as Zt, isDiscoveryBudgetError as Zu, groupTypingEpoch as _, readManifest as _a, readHandoffAck as _c, fromBase64Url as _d, WAKE_ONLINE_INTERVAL_MS as _i, APP_BUNDLE_LIMITS as _l, isBitcoinAddress as _n, validReactionNumber as _o, CarriedTransport as _r, formatLocalTarget as _s, checkAtprotoProofRecord as _t, devicePingFrame as _u, appRevocationFor as a, TRANSPORTS as aa, handoffDataFrame as ac, createIdentity as ad, sanitizeTypingStatus as ai, contactDay as al, USDT_PUBLIC_RPC as an, parseLinkPreview as ao, parseEngineError as ar, emptyRatchetState as as, sshSignCommand as at, decodeInviteCode as au, COMMUNITY_LIMITS as b, dnsProofName as ba, readHandoffHave as bc, toBase64Url as bd, newWakeToken as bi, APP_PERMISSIONS as bl, isPubkyProofFolder as bn, readReply as bo, SIGNAL_HOLD_MS as br, LIMITS as bs, parseAtprotoDidDocument as bt, webCryptoSigner as bu, checkAppBeforeRun as c, irohDescriptor as ca, handoffHelloFrame as cc, publicKeyFromZ32 as cd, PIN_LIMITS as ci, knockSlotRecords as cl, assertTokenUnits as cn, COMMUNITY_REACTION_FRAME as co, GROUP_WANT_FRAME as cr, AWAITING_PEER_MS as cs, BitcoinAddressError as ct, inviteOwnership as cu, checkAppStoreIndex as d, HOLD_DATED_BACK_MS as da, handoffPakeFrame as dc, sanitizeAvatar as dd, pinIsNewer as di, mergeContactKnocks as dl, validatePaymentTarget as dn, ReactionWindow as do, groupFileFallback as dr, EXPECT_PEER_MS as ds, ATPROTO_FULL_SCOPE as dt, ENROLL_CAPABILITY as du, revokesIdentity as ea, handoffAttemptSucceeded as ec, RELAY_PAYLOAD_MAX_BYTES as ed, personStatus as ei, turnOff as el, ONCHAIN_PROVIDER as en, REMOVED_TEXT as eo, pairedMessageFits as er, rosterHas as es, SSHSIG_NAMESPACE as et, createDeviceInvite as eu, readAppStore as f, HOLD_LIMITS as fa, handoffReleaseFrame as fc, dropLoneJoiners as fd, pinNumberHolds as fi, openRequest as fl, walletNetworkOf as fn, nextReactionNumber as fo, isGroupMessageId as fr, PRESENCE_WINDOW as fs, ATPROTO_PROOF_COLLECTION as ft, HANDOFF_CAPABILITY as fu, GroupTypingBoard as g, newMailbox as ga, newHandoffId as gc, bytesEqual as gd, WAKE_ONLINE_DELAY_MS as gi, seenEntry as gl, sparkInvoiceDetails as gn, readReaction as go, readGroupWantNo as gr, GhostlyHttpError as gs, atprotoProofRkey as gt, deviceLinkPairing as gu, GROUP_TYPING_FRAME as h, isHoldUrl as ha, handoffVersions as hc, stripHidden as hd, WAKE_ONLINE_BATCH_MS as hi, requestRecords as hl, sparkAddressKind as hn, reactionIsNewer as ho, readGroupWant as hr, presenceSeenAt as hs, atprotoProofRecord as ht, deviceKeyZ32 as hu, addedAppPermissions as i, validExternalKey as ia, handoffContextProof as ic, parseRelayPayload as id, TypingSender as ii, contactAskerHolds as il, TEST_USDT_FAUCET_AMOUNT as in, linkStop as io, engineText as ir, RatchetBox as is, sameSshKey as it, createChatInvite as iu, knockRecords as j, wellKnownUrl as ja, signTombstone as jc, APPS_CAPABILITY as ji, APP_STATEMENT_LIMITS as jl, ENDPOINT as jn, TASK_STATUSES as jo, doorHubs as jr, contactRtcConfig as js, didJwsAlg as jt, signTurnPacket as ju, entryParams as k, recordsName as ka, setAckFrame as kc, chatAppId as ki, sha256Paced as kl, resolveLightningDestination as kn, RUN_RESULTS as ko, beaconKeys as kr, callRtcConfig as ks, checkDidSignature as kt, nextTurnPosition as ku, planAppUpdate as l, irohRelayUrl as la, handoffManifestFrames as lc, verify as ld, mayPin as li, linkRecords as ll, assertWholeSats as ln, GROUP_REACTION_FRAME as lo, GROUP_WANT_NO_FRAME as lr, DAEMON_WATCH_PEER_IDLE_MS as ls, decodeAnyBitcoinAddress as lt, ownInviteRefusal as lu, signAppStore as m, HoldRefusedError as ma, handoffStreamKey as mc, sanitizeDisplayText as md, WAKE_CALL_INTERVAL_MS as mi, readLinkRecord as ml, SPARK_PROVIDER as mn, reactionEmoji as mo, readGroupHave as mr, WATCH_PEER_MS as ms, atprotoDidMethod as mt, deviceEchoNonce as mu, readX401SdJwtVc as n, PeerProofs as na, handoffCancelFrame as nc, newerPacket as nd, TYPING_KINDS as ni, REQUEST_LIFETIME_MS as nl, SEPOLIA_TEST_USDT as nn, dhtEditId as no, EngineError as nr, edgeParams as ns, parseSshPublicKey as nt, readDeviceInvite as nu, appStoreDecision as o, automaticTransport as oa, handoffDigest as oc, identityFromSeed as od, typingActivity as oi, knockSlotIdentity as ol, WALLET_NETWORKS as on, forwardedAgain as oo, GROUP_FILE_LIMITS as or, ratchetSessionOf as os, verifySshSignature as ot, encodeInviteCode as ou, readAppStoreSteps as p, HoldKeys as pa, handoffRetryAfter as pc, hasVisible as pd, readPin as pi, readKnockSlot as pl, SPARK_NETWORKS as pn, queueReaction as po, readGroupFileMeta as pr, RELAY_POLL_INTERVALS as ps, ATPROTO_PROOF_SCOPE as pt, deviceEchoFrame as pu, GROUP_EDIT_TEXT_BYTES as q, parseVoiceMeta as qa, clearMissed as qc, emptyIdentityLedger as qi, readImageMeta as ql, stripPictureMetadata as qn, GROUP_ADMIN_OFF_ERROR as qo, FileUplink as qr, HANDOFF_REQUEST as qs, didDhtFromPublicKey as qt, setLinkTraceSink as qu, sameX401HolderJwk as r, emptyProofLedger as ra, handoffContext as rc, openRelayPayload as rd, TYPING_REFRESH_MS as ri, contactAskerFrame as rl, SEPOLIA_TEST_USDT_FAUCET as rn, LINK_TRAILING as ro, engineError as rr, RATCHET_CAPABILITY as rs, parseSshSignature as rt, OwnInviteError as ru, appUpdateDecision as s, dialableIrohRelay as sa, handoffEphemeral as sc, identityFromSeedB64 as sd, GROUP_PIN_FRAME as si, knockSlotOf as sl, arkAddressPrefix as sn, readForwarded as so, GROUP_HAVE_FRAME as sr, DirectPathWatch as ss, verifyBitcoinMessage as st, inviteLink as su, newX401HolderKey as t, lastSharedWithMe as ta, handoffBusyFrame as tc, createRelayPayload as td, sanitizeStatusText as ti, ContactRequestError as tl, PaymentPreflightError as tn, RateWindow as to, pairedMessageFrame as tr, verifyCommitSignature as ts, SshSigError as tt, deviceInviteJoinerParams as tu, APP_STORE_LIMITS as u, HOLD_CAPABILITY as ua, handoffOfferFrame as uc, MAX_AVATAR_LENGTH as ud, nextPinNumber as ui, makeStampPaced as ul, formatPaymentAmount as un, REACTION_LIMITS as uo, fetchesByItself as ur, DHT_POLL_INTERVALS as us, ATPROTO_DECLARED_SCOPE as ut, DEVICES_CAPABILITY as uu, openGroupTyping as v, DOMAIN_FILE_MAX_BYTES as va, readHandoffCancel as vc, isZ32Key as vd, WakeLimiter as vi, APP_BUNDLE_MAGIC as vl, PUBKY_PROOF_MAX_BYTES as vn, wireReaction as vo, GROUP_SIGNAL_FRAME as vr, parseLocalTarget as vs, isAtprotoDid as vt, newDeviceSetSecret as vu, decodeCommunityLink as w, isPublicAddress as wa, readHandoffVerified as wc, checkPushEndpoint as wi, checkAppManifest as wl, pubkyProofFile as wn, CRON_LINE as wo, MESH_HUBS as wr, CALL_SIGNAL_MAX_AGE_MS as ws, DID_DOCUMENT_MAX_BYTES as wt, classifyTurnRead as wu, CommunitySession as x, domainTxtRecord as xa, readHandoffHello as xc, toZ32 as xd, parseWakeFrame as xi, appDigest as xl, newPubkyProofFolder as xn, replySnippet as xo, SIGNAL_REPLY_MS as xr, decodeControl as xs, shortAtprotoDid as xt, TURN_PUT_WINDOW_MS as xu, sealGroupTyping as y, decodeDnsResponse as ya, readHandoffDone as yc, randomBytes as yd, deviceWakeRequest as yi, APP_ICON_PATH as yl, isPubkyKey as yn, pairedReplyAuthor as yo, SIGNAL_FRESH_MS as yr, webLocalFetch as ys, normalizeAtprotoHandle as yt, seedSigner as yu, GROUP_LIMITS as z, sanitizeFileName as za, enrollDigits as zc, dialDescriptors as zi, isAppRef as zl, audioMetadataPatches as zn, statusCardBytes as zo, pickHubs as zr, HANDOFF_ACK as zs, parseDid as zt, HEDGE_MISSING_MS as zu };
|
|
40305
40571
|
|
|
40306
|
-
//# sourceMappingURL=src-
|
|
40572
|
+
//# sourceMappingURL=src-ChJijTlM.js.map
|