@ghostlytools/sdk 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +2 -2
- package/dist/{fakes-Bx53XiDM.js → fakes-BTB2ugB3.js} +2 -2
- package/dist/{fakes-Bx53XiDM.js.map → fakes-BTB2ugB3.js.map} +1 -1
- package/dist/fakes.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{keet-identity-key-D8ioYMkd.js → keet-identity-key-a4pR0QSm.js} +2 -2
- package/dist/{keet-identity-key-D8ioYMkd.js.map → keet-identity-key-a4pR0QSm.js.map} +1 -1
- package/dist/{src-Ch4NWeBg.js → src-BZy4lDju.js} +1064 -198
- package/dist/src-BZy4lDju.js.map +1 -0
- package/dist/testing.js +3 -3
- package/dist/types/core/src/appStatements.d.ts +7 -0
- package/dist/types/core/src/communityRendezvous.d.ts +5 -1
- package/dist/types/core/src/contactRecords.d.ts +31 -0
- package/dist/types/core/src/ghostlink.d.ts +38 -2
- package/dist/types/core/src/groupCommunity.d.ts +84 -9
- package/dist/types/core/src/groupFiles.d.ts +15 -0
- package/dist/types/core/src/groupMeta.d.ts +3 -2
- package/dist/types/core/src/groupSession.d.ts +96 -11
- package/dist/types/core/src/http.d.ts +13 -0
- package/dist/types/core/src/identityProofs.d.ts +7 -3
- package/dist/types/core/src/pairedAppRanges.d.ts +17 -9
- package/dist/types/core/src/pairedEdits.d.ts +4 -1
- package/dist/types/core/src/storeForward.d.ts +2 -1
- package/dist/types/core/src/text.d.ts +9 -0
- package/dist/types/core/src/turnRecord.d.ts +2 -2
- package/dist/types/core/src/videoMetadata.d.ts +17 -0
- package/dist/{verify-Bi_Y5oat.js → verify-Bcd7K4q-.js} +3 -3
- package/dist/verify-Bcd7K4q-.js.map +1 -0
- package/package.json +1 -1
- package/dist/src-Ch4NWeBg.js.map +0 -1
- package/dist/verify-Bi_Y5oat.js.map +0 -1
|
@@ -209,6 +209,45 @@ var KEEP = /[\u200c\u200d]/;
|
|
|
209
209
|
function stripHidden(text) {
|
|
210
210
|
return text.replace(HIDDEN, (char) => KEEP.test(char) ? char : "");
|
|
211
211
|
}
|
|
212
|
+
/** The variation selectors other than VS15 and VS16: a symbol's, an ideograph's, a Mongolian letter's. */
|
|
213
|
+
var SELECTOR = /[︀-︍᠋-᠍᠏\u{e0100}-\u{e01ef}]/u;
|
|
214
|
+
/** Letters of the alphabets that neither join their letters nor make conjuncts: a joiner beside one changes nothing. */
|
|
215
|
+
var NO_JOINING = /[\p{sc=Latin}\p{sc=Greek}\p{sc=Cyrillic}\p{sc=Armenian}\p{sc=Georgian}\p{sc=Hebrew}\p{sc=Han}\p{sc=Hiragana}\p{sc=Katakana}\p{sc=Hangul}\p{sc=Thai}\p{sc=Lao}\p{sc=Ethiopic}]/u;
|
|
216
|
+
var EUROPEAN = /[\p{sc=Latin}\p{sc=Greek}\p{sc=Cyrillic}]/u;
|
|
217
|
+
var LETTER = /\p{L}/u;
|
|
218
|
+
var MARK = /\p{M}/u;
|
|
219
|
+
var SYMBOL = /\p{S}/u;
|
|
220
|
+
var PICTOGRAPH$1 = /\p{Extended_Pictographic}/u;
|
|
221
|
+
/** What an emoji sequence's joiner follows: a pictograph, a skin tone, or VS16 after a pictograph. */
|
|
222
|
+
var BEFORE_EMOJI_JOINER = /[\p{Extended_Pictographic}\p{Emoji_Modifier}️]/u;
|
|
223
|
+
var EMOJI = /\p{Emoji}/u;
|
|
224
|
+
var ASCII = /^[\0-\x7f]$/;
|
|
225
|
+
var KEYCAP_BASE = /^[#*0-9]$/;
|
|
226
|
+
var joining = (char) => LETTER.test(char) && !NO_JOINING.test(char);
|
|
227
|
+
/**
|
|
228
|
+
* `text` without the joiners and variation selectors that join or select nothing, which draw nothing and could only
|
|
229
|
+
* make a name look like another one, or one nobody can type. A zero-width joiner stays between two emoji (a skin tone
|
|
230
|
+
* or VS16 before it) and either joiner between two letters of a script that joins its letters or makes conjuncts
|
|
231
|
+
* (Persian, the Indic scripts; the marks after the first letter, a virama, don't count); VS15 and VS16 stay after an
|
|
232
|
+
* emoji (an ASCII one only in a keycap), and the other selectors after a symbol or a letter that is not Latin, Greek or
|
|
233
|
+
* Cyrillic.
|
|
234
|
+
*/
|
|
235
|
+
function dropLoneJoiners(text) {
|
|
236
|
+
const chars = Array.from(text);
|
|
237
|
+
let out = "", last = "", base = "";
|
|
238
|
+
for (let i = 0; i < chars.length; i++) {
|
|
239
|
+
const char = chars[i], next = chars[i + 1] ?? "";
|
|
240
|
+
let keep = true;
|
|
241
|
+
if (char === "" || char === "") keep = char === "" && BEFORE_EMOJI_JOINER.test(last) && PICTOGRAPH$1.test(next) || joining(base) && joining(next);
|
|
242
|
+
else if (char === "︎" || char === "️") keep = EMOJI.test(last) && !ASCII.test(last) || KEYCAP_BASE.test(last) && next === "⃣";
|
|
243
|
+
else if (SELECTOR.test(char)) keep = SYMBOL.test(last) || LETTER.test(last) && !EUROPEAN.test(last);
|
|
244
|
+
if (!keep) continue;
|
|
245
|
+
out += char;
|
|
246
|
+
last = char;
|
|
247
|
+
if (!MARK.test(char)) base = char;
|
|
248
|
+
}
|
|
249
|
+
return out;
|
|
250
|
+
}
|
|
212
251
|
/**
|
|
213
252
|
* What draws nothing when it stands alone and `HIDDEN` leaves in, since text needs it beside something else: the
|
|
214
253
|
* joiners, the fillers, the variation selectors and the other default-ignorable code points, combining marks, white
|
|
@@ -2830,11 +2869,11 @@ var isZero = (bytes) => bytes.every((b) => b === 0);
|
|
|
2830
2869
|
* A device's name as its slot holds it: UTF-8, cut at a character boundary to 16 bytes, and with no NUL (the padding).
|
|
2831
2870
|
* A character is what a person sees as one (a grapheme), so a cut never leaves half an emoji or a lone joiner.
|
|
2832
2871
|
* A name is display text a device chooses for itself and every device of the set shows: it is cleaned as a nickname is
|
|
2833
|
-
* (`sanitizeDisplayText`: no control, invisible or direction-changing character, and empty when nothing of it shows)
|
|
2834
|
-
* and trimmed, made and read alike.
|
|
2872
|
+
* (`sanitizeDisplayText`: no control, invisible or direction-changing character, and empty when nothing of it shows),
|
|
2873
|
+
* without a joiner or variation selector that joins nothing (`dropLoneJoiners`), and trimmed, made and read alike.
|
|
2835
2874
|
*/
|
|
2836
2875
|
function turnName(name) {
|
|
2837
|
-
const clean = stripHidden(name).trim();
|
|
2876
|
+
const clean = dropLoneJoiners(stripHidden(name)).trim();
|
|
2838
2877
|
const Segmenter = typeof Intl === "undefined" ? void 0 : Intl.Segmenter;
|
|
2839
2878
|
const characters = Segmenter ? Array.from(new Segmenter(void 0, { granularity: "grapheme" }).segment(clean), (s) => s.segment) : Array.from(clean);
|
|
2840
2879
|
let out = "", length = 0;
|
|
@@ -2844,7 +2883,7 @@ function turnName(name) {
|
|
|
2844
2883
|
out += character;
|
|
2845
2884
|
length += size;
|
|
2846
2885
|
}
|
|
2847
|
-
return hasVisible(out) ? out.trimEnd() : "";
|
|
2886
|
+
return hasVisible(out) ? dropLoneJoiners(out).trimEnd() : "";
|
|
2848
2887
|
}
|
|
2849
2888
|
function u32$4(value) {
|
|
2850
2889
|
return Uint8Array.of(value >>> 24 & 255, value >>> 16 & 255, value >>> 8 & 255, value & 255);
|
|
@@ -4500,7 +4539,17 @@ function verifyAppStatementBytes(prefix, bytes, signature, key) {
|
|
|
4500
4539
|
} : checked;
|
|
4501
4540
|
}
|
|
4502
4541
|
var isSequence = (v) => typeof v === "number" && Number.isSafeInteger(v) && v >= 1;
|
|
4503
|
-
|
|
4542
|
+
/**
|
|
4543
|
+
* One line of an app's text, from `min` to `max` code points: a title, a tagline, a store's name, a removal's or a
|
|
4544
|
+
* revocation's reason. It is shown alone (a heading, a window title), so it holds no control character and none of
|
|
4545
|
+
* what `stripHidden` takes from a nickname (invisible and direction-changing characters, line and paragraph
|
|
4546
|
+
* separators), and when it is not empty it shows something (`hasVisible`). The joiners an emoji or a script needs stay.
|
|
4547
|
+
*/
|
|
4548
|
+
var isAppLine = (v, max, min = 0) => {
|
|
4549
|
+
if (typeof v !== "string") return false;
|
|
4550
|
+
const length = [...v].length;
|
|
4551
|
+
return length >= min && length <= max && stripHidden(v) === v && (v === "" || hasVisible(v));
|
|
4552
|
+
};
|
|
4504
4553
|
/** Checks a revocation statement's shape; the reason it is refused, or null. */
|
|
4505
4554
|
function checkAppRevokeStatement(value) {
|
|
4506
4555
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return "Not an object";
|
|
@@ -4518,7 +4567,7 @@ function checkAppRevokeStatement(value) {
|
|
|
4518
4567
|
if (!Array.isArray(d) || d.length < 1 || d.length > APP_STATEMENT_LIMITS.revokeDigests) return "digests is not 1 to 64 digests";
|
|
4519
4568
|
if (!d.every(isAppHash) || new Set(d).size !== d.length) return "digests holds a bad or repeated digest";
|
|
4520
4569
|
} else if (!isSequence(v.upTo)) return "upTo is not a sequence";
|
|
4521
|
-
if (v.reason !== void 0 && !
|
|
4570
|
+
if (v.reason !== void 0 && !isAppLine(v.reason, APP_STATEMENT_LIMITS.reason)) return "reason is not one line of 200 characters";
|
|
4522
4571
|
return null;
|
|
4523
4572
|
}
|
|
4524
4573
|
/** Signs a revocation with the publisher's key. */
|
|
@@ -4723,8 +4772,6 @@ var SEMVER$1 = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[
|
|
|
4723
4772
|
var HOST = /^>=(0|[1-9]\d*)\.(0|[1-9]\d*)(\.(0|[1-9]\d*))?$/;
|
|
4724
4773
|
var SEGMENT$1 = /^[A-Za-z0-9._-]+$/;
|
|
4725
4774
|
var codePoints = (s) => [...s].length;
|
|
4726
|
-
/** One line: no control character. */
|
|
4727
|
-
var isLine$1 = (v, max, min = 0) => typeof v === "string" && codePoints(v) >= min && codePoints(v) <= max && !/\p{Cc}/u.test(v);
|
|
4728
4775
|
/** Text of several lines: no control character but the line feed. */
|
|
4729
4776
|
var isText$3 = (v, max) => typeof v === "string" && codePoints(v) <= max && !/[^\P{Cc}\n]/u.test(v);
|
|
4730
4777
|
var isSafeCount = (v, min) => typeof v === "number" && Number.isSafeInteger(v) && v >= min;
|
|
@@ -4842,10 +4889,10 @@ function checkAppManifest(value, options = {}) {
|
|
|
4842
4889
|
if (typeof m.version !== "string" || m.version.length > APP_BUNDLE_LIMITS.version || !SEMVER$1.test(m.version)) return bad("version");
|
|
4843
4890
|
if (!isSafeCount(m.sequence, 1)) return bad("sequence");
|
|
4844
4891
|
if (m.kind !== "mini-app") return bad("kind");
|
|
4845
|
-
if (!
|
|
4846
|
-
if (!
|
|
4892
|
+
if (!isAppLine(m.title, APP_BUNDLE_LIMITS.title, 1)) return bad("title");
|
|
4893
|
+
if (!isAppLine(m.tagline, APP_BUNDLE_LIMITS.tagline, 1)) return bad("tagline");
|
|
4847
4894
|
if (m.description !== void 0 && !isText$3(m.description, APP_BUNDLE_LIMITS.description)) return bad("description");
|
|
4848
|
-
if (m.releaseNotes !== void 0 && !
|
|
4895
|
+
if (m.releaseNotes !== void 0 && !isAppLine(m.releaseNotes, APP_BUNDLE_LIMITS.releaseNotes)) return bad("releaseNotes");
|
|
4849
4896
|
const permissions = m.permissions;
|
|
4850
4897
|
if (!Array.isArray(permissions) || new Set(permissions).size !== permissions.length || !permissions.every((p) => APP_PERMISSIONS.includes(p))) return bad("permissions");
|
|
4851
4898
|
if (m.view !== void 0 && !APP_VIEWS.includes(m.view)) return bad("view", `view is "chat" or "full"`);
|
|
@@ -5450,6 +5497,42 @@ function openRequest(linkSeedB64, askerZ32, records, now) {
|
|
|
5450
5497
|
return null;
|
|
5451
5498
|
}
|
|
5452
5499
|
}
|
|
5500
|
+
/**
|
|
5501
|
+
* The asker's proof (WISP 8xx § Accept): in the chat a request started, the requester's app says on the live session
|
|
5502
|
+
* that it holds the asker key the request came under. The invite a request carries is a bearer code, so whoever made
|
|
5503
|
+
* the chat the owner joined may be someone other than the asker; until this proof comes, the request's text shows as
|
|
5504
|
+
* not confirmed. Signed by *K* over the link key, *K*, and both sides' participation keys in that chat: the joiner's is
|
|
5505
|
+
* new with the join, so a proof is made in the chat and for it, never before.
|
|
5506
|
+
*/
|
|
5507
|
+
var CONTACT_ASKER_FRAME = "contact-asker";
|
|
5508
|
+
function askerProofBytes(linkKeyZ32, askerZ32, chat) {
|
|
5509
|
+
return concatBytes(label$1("ghostly-contact/1 asker"), publicKeyFromZ32(linkKeyZ32), publicKeyFromZ32(askerZ32), publicKeyFromZ32(chat.inviter), publicKeyFromZ32(chat.joiner));
|
|
5510
|
+
}
|
|
5511
|
+
/** The requester's proof for the chat its request started. */
|
|
5512
|
+
function contactAskerFrame(askerSeedB64, linkKeyZ32, chat) {
|
|
5513
|
+
const asker = identityFromSeedB64(askerSeedB64);
|
|
5514
|
+
return {
|
|
5515
|
+
t: CONTACT_ASKER_FRAME,
|
|
5516
|
+
l: linkKeyZ32,
|
|
5517
|
+
k: asker.pubKeyZ32,
|
|
5518
|
+
s: toBase64Url(ed25519.sign(askerProofBytes(linkKeyZ32, asker.pubKeyZ32, chat), asker.seed))
|
|
5519
|
+
};
|
|
5520
|
+
}
|
|
5521
|
+
/**
|
|
5522
|
+
* Whether a proof heard in a chat is the one the owner waits for there: the link and asker keys of the request it
|
|
5523
|
+
* accepted, signed by that asker key for this chat's two participation keys. Anything else proves nothing.
|
|
5524
|
+
*/
|
|
5525
|
+
function contactAskerHolds(frame, expected, chat) {
|
|
5526
|
+
const f = frame;
|
|
5527
|
+
if (!f || typeof f !== "object" || f.t !== "contact-asker" || f.l !== expected.link || f.k !== expected.key) return false;
|
|
5528
|
+
if (typeof f.s !== "string" || !/^[A-Za-z0-9_-]{86}$/.test(f.s)) return false;
|
|
5529
|
+
if (![chat.inviter, chat.joiner].every((key) => Z32_KEY$1.test(key))) return false;
|
|
5530
|
+
try {
|
|
5531
|
+
return ed25519.verify(fromBase64Url(f.s), askerProofBytes(f.l, f.k, chat), publicKeyFromZ32(f.k));
|
|
5532
|
+
} catch {
|
|
5533
|
+
return false;
|
|
5534
|
+
}
|
|
5535
|
+
}
|
|
5453
5536
|
//#endregion
|
|
5454
5537
|
//#region ../core/src/contactInbox.ts
|
|
5455
5538
|
var MAX_WAITING = 32;
|
|
@@ -7992,6 +8075,26 @@ function viewerResponseHeaders(headers) {
|
|
|
7992
8075
|
return out;
|
|
7993
8076
|
}
|
|
7994
8077
|
/**
|
|
8078
|
+
* Ghostly's connection policy for a contact's app in a viewer: its requests and forms reach only its own origin, the
|
|
8079
|
+
* contact's service; its scripts, pictures, frames and the rest its own origin and public https sites (and inline,
|
|
8080
|
+
* data: and blob: content), never plain http, so not a service on this machine or the local network. The same value as
|
|
8081
|
+
* Desktop's `SERVICE_CSP` (apps/desktop/src/viewer.rs) and `OPENED_SERVICE_CSP` (`service open`,
|
|
8082
|
+
* packages/cli/src/services.ts).
|
|
8083
|
+
*/
|
|
8084
|
+
var VIEWER_SERVICE_CSP = "default-src 'self' https: data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; form-action 'self'";
|
|
8085
|
+
/**
|
|
8086
|
+
* `headers` with Ghostly's policy after the contact's own, all in one `content-security-policy` joined by commas: a
|
|
8087
|
+
* browser enforces every policy of the list, so the contact's can narrow Ghostly's but never widen it.
|
|
8088
|
+
*/
|
|
8089
|
+
function withViewerPolicy(headers) {
|
|
8090
|
+
const policies = [];
|
|
8091
|
+
const out = [];
|
|
8092
|
+
for (const [name, value] of headers) if (name.toLowerCase() === "content-security-policy") policies.push(value);
|
|
8093
|
+
else out.push([name, value]);
|
|
8094
|
+
out.push(["content-security-policy", [...policies, VIEWER_SERVICE_CSP].join(", ")]);
|
|
8095
|
+
return out;
|
|
8096
|
+
}
|
|
8097
|
+
/**
|
|
7995
8098
|
* Turns `http://localhost:3400/base/x` into `/x` so the client never learns or
|
|
7996
8099
|
* follows the local address. Null when the location is not on the target origin
|
|
7997
8100
|
* and under its base path.
|
|
@@ -11879,7 +11982,10 @@ function parseEditedFrame(frame) {
|
|
|
11879
11982
|
function dhtEditId(id, e) {
|
|
11880
11983
|
return toBase64Url(sha256(utf8Encode(`ghostly-edit/1:${id}:${e}`)).slice(0, 16));
|
|
11881
11984
|
}
|
|
11882
|
-
/**
|
|
11985
|
+
/**
|
|
11986
|
+
* A sliding window of `limit` events per `windowMs`: the sender's pace and the receiver's limit. A time later than now
|
|
11987
|
+
* (the device clock went back) is long gone, or the window would stay full for as long as the clock went back.
|
|
11988
|
+
*/
|
|
11883
11989
|
var RateWindow = class {
|
|
11884
11990
|
limit;
|
|
11885
11991
|
windowMs;
|
|
@@ -11893,7 +11999,7 @@ var RateWindow = class {
|
|
|
11893
11999
|
/** Counts one now; false (and not counted) when the window is full. */
|
|
11894
12000
|
take() {
|
|
11895
12001
|
const now = this.now();
|
|
11896
|
-
this.recent = this.recent.filter((at) => now - at < this.windowMs);
|
|
12002
|
+
this.recent = this.recent.filter((at) => at <= now && now - at < this.windowMs);
|
|
11897
12003
|
if (this.recent.length >= this.limit) return false;
|
|
11898
12004
|
this.recent.push(now);
|
|
11899
12005
|
return true;
|
|
@@ -11901,7 +12007,7 @@ var RateWindow = class {
|
|
|
11901
12007
|
/** Milliseconds until the window has room again; 0 when it has room now. */
|
|
11902
12008
|
wait() {
|
|
11903
12009
|
const now = this.now();
|
|
11904
|
-
this.recent = this.recent.filter((at) => now - at < this.windowMs);
|
|
12010
|
+
this.recent = this.recent.filter((at) => at <= now && now - at < this.windowMs);
|
|
11905
12011
|
return this.recent.length < this.limit ? 0 : this.recent[0] + this.windowMs - now;
|
|
11906
12012
|
}
|
|
11907
12013
|
reset() {
|
|
@@ -14778,7 +14884,7 @@ async function verifyPeerProof(event, c, readStorage) {
|
|
|
14778
14884
|
if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
|
|
14779
14885
|
} else if (c.adapter === "keet-import") {
|
|
14780
14886
|
if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
|
|
14781
|
-
const { default: IdentityKey } = await import("./keet-identity-key-
|
|
14887
|
+
const { default: IdentityKey } = await import("./keet-identity-key-a4pR0QSm.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
|
|
14782
14888
|
if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
|
|
14783
14889
|
} else throw new Error("Unsupported proof adapter");
|
|
14784
14890
|
}
|
|
@@ -15429,16 +15535,19 @@ var IdentityExchange = class {
|
|
|
15429
15535
|
subject: s.subject,
|
|
15430
15536
|
reason: "withdrawn"
|
|
15431
15537
|
});
|
|
15432
|
-
if (connected)
|
|
15433
|
-
|
|
15434
|
-
|
|
15435
|
-
|
|
15538
|
+
if (connected) try {
|
|
15539
|
+
this.send({
|
|
15540
|
+
t: "idp-withdraw",
|
|
15541
|
+
id
|
|
15542
|
+
});
|
|
15543
|
+
} catch {}
|
|
15436
15544
|
}
|
|
15437
15545
|
/**
|
|
15438
15546
|
* Run the checks again on a received proof: its revocation record, then (unless `revocationOnly`) the
|
|
15439
|
-
* provider's check (a domain record may be gone).
|
|
15547
|
+
* provider's check (a domain record may be gone). `keepUnavailable`: a check that could not run (IdentityCheckUnavailable)
|
|
15548
|
+
* is thrown, and the proof is left as it was, for a check this side started on its own.
|
|
15440
15549
|
*/
|
|
15441
|
-
async recheck(id, { revocationOnly = false } = {}) {
|
|
15550
|
+
async recheck(id, { revocationOnly = false, keepUnavailable = false } = {}) {
|
|
15442
15551
|
const r = this.options.storage.read().received.find((x) => x.id === id);
|
|
15443
15552
|
if (!r) throw new Error("Unknown identity");
|
|
15444
15553
|
if (r.status === "revoked") return r;
|
|
@@ -15471,6 +15580,7 @@ var IdentityExchange = class {
|
|
|
15471
15580
|
error: void 0
|
|
15472
15581
|
});
|
|
15473
15582
|
} catch (e) {
|
|
15583
|
+
if (keepUnavailable && e instanceof IdentityCheckUnavailable) throw e;
|
|
15474
15584
|
const error = shortError(e);
|
|
15475
15585
|
outcome = (x) => ({
|
|
15476
15586
|
...x,
|
|
@@ -15512,19 +15622,29 @@ var IdentityExchange = class {
|
|
|
15512
15622
|
case "idp-result": {
|
|
15513
15623
|
const s = id ? this.shared(id) : void 0;
|
|
15514
15624
|
if (!s || s.status !== "pending") return;
|
|
15515
|
-
const
|
|
15516
|
-
|
|
15625
|
+
const ok = frame.ok === true;
|
|
15626
|
+
const error = ok ? void 0 : clean$1(frame.error, ERROR_MAX) ?? "Your contact could not verify it";
|
|
15627
|
+
const entry = {
|
|
15517
15628
|
...s,
|
|
15518
|
-
status:
|
|
15629
|
+
status: ok ? "accepted" : "rejected",
|
|
15519
15630
|
at: this.now(),
|
|
15520
15631
|
error
|
|
15632
|
+
};
|
|
15633
|
+
const replaced = (x) => ok && x.status === "accepted" && x.provider === s.provider && x.subject === s.subject;
|
|
15634
|
+
await this.options.storage.update((l) => this.log({
|
|
15635
|
+
...l,
|
|
15636
|
+
shared: [...l.shared.filter((x) => x.id !== s.id).map((x) => replaced(x) ? {
|
|
15637
|
+
...x,
|
|
15638
|
+
status: "withdrawn",
|
|
15639
|
+
at: entry.at
|
|
15640
|
+
} : x), entry]
|
|
15521
15641
|
}, {
|
|
15522
15642
|
type: "result",
|
|
15523
15643
|
side: "mine",
|
|
15524
15644
|
proof: s.id,
|
|
15525
|
-
ok
|
|
15645
|
+
ok,
|
|
15526
15646
|
error
|
|
15527
|
-
});
|
|
15647
|
+
}));
|
|
15528
15648
|
return;
|
|
15529
15649
|
}
|
|
15530
15650
|
case "idp-withdraw": {
|
|
@@ -15544,6 +15664,13 @@ var IdentityExchange = class {
|
|
|
15544
15664
|
subject: r.verified.subject,
|
|
15545
15665
|
reason: "withdrawn"
|
|
15546
15666
|
}));
|
|
15667
|
+
if (this.options.storage.read().challenges.some((c) => c.id === id && !c.withdrawn)) await this.options.storage.update((l) => ({
|
|
15668
|
+
...l,
|
|
15669
|
+
challenges: l.challenges.map((c) => c.id === id ? {
|
|
15670
|
+
...c,
|
|
15671
|
+
withdrawn: true
|
|
15672
|
+
} : c)
|
|
15673
|
+
}));
|
|
15547
15674
|
this.send({
|
|
15548
15675
|
t: "idp-withdrawn",
|
|
15549
15676
|
id
|
|
@@ -15656,6 +15783,7 @@ var IdentityExchange = class {
|
|
|
15656
15783
|
let error;
|
|
15657
15784
|
/** The same, as this side's own timeline says it. */
|
|
15658
15785
|
let reason;
|
|
15786
|
+
let withdrawn = false;
|
|
15659
15787
|
try {
|
|
15660
15788
|
const mayReplace = (r) => r.binding.provider === binding.provider && (r.binding.subject === binding.subject || r.verified.subject === binding.subject);
|
|
15661
15789
|
if (revokedHere(this.options.storage.read().received, id)) throw new Error(REVOKED);
|
|
@@ -15699,6 +15827,7 @@ var IdentityExchange = class {
|
|
|
15699
15827
|
...logged,
|
|
15700
15828
|
challenges
|
|
15701
15829
|
};
|
|
15830
|
+
withdrawn = !!challenge.withdrawn;
|
|
15702
15831
|
const record = {
|
|
15703
15832
|
id,
|
|
15704
15833
|
binding,
|
|
@@ -15709,15 +15838,23 @@ var IdentityExchange = class {
|
|
|
15709
15838
|
context: scope.context,
|
|
15710
15839
|
verifiedAt: now,
|
|
15711
15840
|
checkedAt: now,
|
|
15712
|
-
status: "verified"
|
|
15841
|
+
status: withdrawn ? "withdrawn" : "verified"
|
|
15713
15842
|
};
|
|
15714
|
-
|
|
15843
|
+
const kept = {
|
|
15715
15844
|
...logged,
|
|
15716
15845
|
challenges,
|
|
15717
15846
|
received: [...received, record]
|
|
15718
15847
|
};
|
|
15848
|
+
return withdrawn ? this.log(kept, {
|
|
15849
|
+
type: "stopped",
|
|
15850
|
+
side: "theirs",
|
|
15851
|
+
proof: id,
|
|
15852
|
+
provider: binding.provider,
|
|
15853
|
+
subject: verified.subject,
|
|
15854
|
+
reason: "withdrawn"
|
|
15855
|
+
}) : kept;
|
|
15719
15856
|
});
|
|
15720
|
-
this.send(verified ? {
|
|
15857
|
+
if (!withdrawn) this.send(verified ? {
|
|
15721
15858
|
t: "idp-result",
|
|
15722
15859
|
id,
|
|
15723
15860
|
ok: true
|
|
@@ -16936,7 +17073,8 @@ var LOCAL_SUFFIXES = [
|
|
|
16936
17073
|
* A URL a bundle or manifest may be fetched from. The contact chose it and this device fetches it on its own, so it
|
|
16937
17074
|
* is HTTPS, without a user or password, at a public name or a public IPv4 address: never this machine or its network.
|
|
16938
17075
|
* A name with no dot or under a local suffix is a local one. A public name may still resolve to a local address:
|
|
16939
|
-
* where the host can resolve, its `fetch` refuses that too (the CLI's, packages/cli/src/runtime/holdFetch.ts
|
|
17076
|
+
* where the host can resolve, its `fetch` refuses that too (the CLI's, packages/cli/src/runtime/holdFetch.ts, and
|
|
17077
|
+
* Desktop's, apps/desktop/src/hold_fetch.rs).
|
|
16940
17078
|
* `loopback` adds plain HTTP to this machine, for a test against a local server; no shipped app passes it.
|
|
16941
17079
|
*/
|
|
16942
17080
|
function isHoldUrl(value, loopback = false) {
|
|
@@ -18105,7 +18243,7 @@ var slot = (app, request) => `${app}:${request}`;
|
|
|
18105
18243
|
* are read and sent by the session, which calls `finish` or `fail` for each task. As the side that asks it sends at
|
|
18106
18244
|
* most `inFlight` requests per app, keeps
|
|
18107
18245
|
* the rest waiting, and puts each answer back together, in order, from the offset asked. Serves and requests last one
|
|
18108
|
-
* session: `reset` ends them all, `closeApp` those of one app.
|
|
18246
|
+
* session: `reset` ends them all, `closeApp` those of one app; a task still being read counts until it is settled.
|
|
18109
18247
|
*/
|
|
18110
18248
|
var AppRanges = class {
|
|
18111
18249
|
send;
|
|
@@ -18113,7 +18251,10 @@ var AppRanges = class {
|
|
|
18113
18251
|
now;
|
|
18114
18252
|
serves = /* @__PURE__ */ new Map();
|
|
18115
18253
|
serving = /* @__PURE__ */ new Map();
|
|
18116
|
-
/**
|
|
18254
|
+
/**
|
|
18255
|
+
* Tasks cancelled, unserved, or stopped by the contact's close or a session's end, that this side is still reading or
|
|
18256
|
+
* sending: each counts in its app's `inFlight` until settled, across sessions.
|
|
18257
|
+
*/
|
|
18117
18258
|
draining = /* @__PURE__ */ new Set();
|
|
18118
18259
|
asking = /* @__PURE__ */ new Map();
|
|
18119
18260
|
waiting = /* @__PURE__ */ new Map();
|
|
@@ -18224,8 +18365,8 @@ var AppRanges = class {
|
|
|
18224
18365
|
this.take(task);
|
|
18225
18366
|
}
|
|
18226
18367
|
/**
|
|
18227
|
-
* Whether `task`
|
|
18228
|
-
* settled, or
|
|
18368
|
+
* Whether `task` still holds a place: serving, or no longer live and draining until it is settled. False once it was
|
|
18369
|
+
* settled, or this side's app closed, which frees its place: an answer to it sends and frees nothing.
|
|
18229
18370
|
*/
|
|
18230
18371
|
holds(task) {
|
|
18231
18372
|
return this.draining.has(task) || this.serving.get(slot(task.app, task.request)) === task;
|
|
@@ -18281,17 +18422,24 @@ var AppRanges = class {
|
|
|
18281
18422
|
size: frame.z
|
|
18282
18423
|
});
|
|
18283
18424
|
}
|
|
18284
|
-
/**
|
|
18285
|
-
|
|
18425
|
+
/**
|
|
18426
|
+
* `app` closed on either side: its serves end, what it was sending stops and what it asked fails with `error`. A task
|
|
18427
|
+
* this side is still reading keeps its place until it is settled, as a cancelled one does, so a contact that closes
|
|
18428
|
+
* and opens its app again meets `busy`; only `stopped` (this side's app closed: nothing reads for it any more) frees
|
|
18429
|
+
* them now.
|
|
18430
|
+
*/
|
|
18431
|
+
closeApp(app, error = "peer-closed", stopped = false) {
|
|
18286
18432
|
for (const [id, serve] of this.serves) if (serve.app === app) this.serves.delete(id);
|
|
18287
|
-
for (const task of this.serving.values()) if (task.app === app) this.drop(task);
|
|
18288
|
-
|
|
18433
|
+
for (const task of this.serving.values()) if (task.app === app) this.drop(task, !stopped);
|
|
18434
|
+
if (stopped) {
|
|
18435
|
+
for (const task of this.draining) if (task.app === app) this.draining.delete(task);
|
|
18436
|
+
}
|
|
18289
18437
|
for (const ask of this.waiting.get(app) ?? []) ask.reject(new Error(error));
|
|
18290
18438
|
this.waiting.delete(app);
|
|
18291
18439
|
for (const ask of this.asking.values()) if (ask.app === app) this.settle(ask, error);
|
|
18292
18440
|
for (const key of [...this.sizes.keys()]) if (key.startsWith(`${app} `)) this.sizes.delete(key);
|
|
18293
18441
|
}
|
|
18294
|
-
/** The session ended: no serve id lasts into the next, and every request fails with `offline`. */
|
|
18442
|
+
/** The session ended: no serve id lasts into the next, and every request fails with `offline`. Tasks still being read keep their places into the next. */
|
|
18295
18443
|
reset() {
|
|
18296
18444
|
this.sizes.clear();
|
|
18297
18445
|
const apps = new Set([...this.serves.values()].map((serve) => serve.app).concat([...this.serving.values(), ...this.draining].map((task) => task.app), [...this.waiting.keys()], [...this.asking.values()].map((ask) => ask.app)));
|
|
@@ -20954,10 +21102,16 @@ function readLobby(keys, records) {
|
|
|
20954
21102
|
/**
|
|
20955
21103
|
* The beacon to publish: my entry (or none, `mine` null, when I step down) with the other fresh
|
|
20956
21104
|
* hubs, newest first, at most `maxHubs`. A hub not in the roster any more is dropped.
|
|
21105
|
+
*
|
|
21106
|
+
* Anyone holding the rendezvous secret writes this record, so what is in it does not decide what stays: my entry always
|
|
21107
|
+
* does, then the keys I know as members (`known`) before keys I do not, and an entry dated ahead of now ranks as one of
|
|
21108
|
+
* now. Entries stay as their hubs dated them.
|
|
20957
21109
|
*/
|
|
20958
|
-
function mergeBeacon(existing, me, mine, now = Date.now(), isMember = () => true) {
|
|
21110
|
+
function mergeBeacon(existing, me, mine, now = Date.now(), isMember = () => true, known = () => true) {
|
|
20959
21111
|
const fresh = existing.filter((h) => h.key !== me && now - h.ts < COMMUNITY_TOPOLOGY.beaconFreshMs && h.ts <= now + 6e4 && isMember(h.key));
|
|
20960
|
-
|
|
21112
|
+
const rank = (h) => known(h.key) ? 0 : 1;
|
|
21113
|
+
const others = fresh.sort((a, b) => rank(a) - rank(b) || Math.min(b.ts, now) - Math.min(a.ts, now));
|
|
21114
|
+
return (mine ? [mine, ...others] : others).slice(0, COMMUNITY_TOPOLOGY.maxHubs);
|
|
20961
21115
|
}
|
|
20962
21116
|
/** The lobby to publish: my request refreshed, others' still fresh, newest last. */
|
|
20963
21117
|
function mergeLobby(existing, mine, now = Date.now()) {
|
|
@@ -21458,6 +21612,13 @@ var GROUP_FILE_LIMITS = {
|
|
|
21458
21612
|
serveMoveBytes: 16384,
|
|
21459
21613
|
/** How long a served transfer keeps its place while all are taken and another member asks: past it, the place is theirs. */
|
|
21460
21614
|
servePlaceMs: 3e5,
|
|
21615
|
+
/**
|
|
21616
|
+
* A served transfer's pace is what it confirmed in the last `servePaceMs` (at most twice that), counted from its offer.
|
|
21617
|
+
* While all places are taken and a member holding none asks or waits, the slowest served that long gives it its place,
|
|
21618
|
+
* if at its pace more is left to go than it has been served and than `servePaceMs`: members on fast links do not wait
|
|
21619
|
+
* for slow ones that asked first. Each member's transfer of a file loses its place so once per holder.
|
|
21620
|
+
*/
|
|
21621
|
+
servePaceMs: 1e4,
|
|
21461
21622
|
/** File announcements a member sends to one group in a minute. */
|
|
21462
21623
|
announcePerMinute: 8,
|
|
21463
21624
|
/** File announcements of one member of a group fetched by themselves in `announceWindowMs`; past it, kept for a Download. */
|
|
@@ -21485,6 +21646,14 @@ var GROUP_FILE_LIMITS = {
|
|
|
21485
21646
|
haveFramesTaken: 20,
|
|
21486
21647
|
communityHaveEveryMs: 6e4,
|
|
21487
21648
|
/**
|
|
21649
|
+
* `group-want` frames an edge sends in `wantWindowMs`, and takes from its member, the rest dropped before anything is
|
|
21650
|
+
* looked up: twice what it may send, as for `group-have`. A member back from away in a group of 16 asked one member
|
|
21651
|
+
* for at most 47 in 10 seconds, its files coming as fast as the network lets them.
|
|
21652
|
+
*/
|
|
21653
|
+
wantFrames: 50,
|
|
21654
|
+
wantFramesTaken: 100,
|
|
21655
|
+
wantWindowMs: 1e4,
|
|
21656
|
+
/**
|
|
21488
21657
|
* How long a want waits for an offer before the next holder is asked; a transfer that does not move for as long is
|
|
21489
21658
|
* left for the next holder too.
|
|
21490
21659
|
*/
|
|
@@ -22091,7 +22260,8 @@ var QUIET_FRAMES = /* @__PURE__ */ new Set([
|
|
|
22091
22260
|
"paired-groups",
|
|
22092
22261
|
"paired-services",
|
|
22093
22262
|
"paired-reconnect",
|
|
22094
|
-
"paired-reconnect-ack"
|
|
22263
|
+
"paired-reconnect-ack",
|
|
22264
|
+
CONTACT_ASKER_FRAME
|
|
22095
22265
|
]);
|
|
22096
22266
|
/**
|
|
22097
22267
|
* A ping with nothing at all back this long after it went: the contact may have crashed and started again, with its new
|
|
@@ -22357,6 +22527,8 @@ var GhostLink = class {
|
|
|
22357
22527
|
/** Edit frames the contact may send per window; the rest go unconfirmed and come again. */
|
|
22358
22528
|
editsReceived = new RateWindow(30, EDIT_RATE_WINDOW_MS);
|
|
22359
22529
|
wakeReceived = new RateWindow(6, 6e4);
|
|
22530
|
+
/** Said once a session by the requester's app: a few a minute at most. */
|
|
22531
|
+
askerReceived = new RateWindow(4, 6e4);
|
|
22360
22532
|
/**
|
|
22361
22533
|
* The contact's name and picture, its word on held items, its ways of paying and its transport descriptors, each saved
|
|
22362
22534
|
* on this side when it changes: said once a session and when changed, so a handful a minute each. Past that only the
|
|
@@ -23316,6 +23488,14 @@ var GhostLink = class {
|
|
|
23316
23488
|
});
|
|
23317
23489
|
});
|
|
23318
23490
|
}
|
|
23491
|
+
/**
|
|
23492
|
+
* `connect` for what only needs the link (a request, a file, a payment step): on a live session it does nothing, where
|
|
23493
|
+
* `connect` is a retry that says this side's transport policy again, and the contact reads 10 a minute
|
|
23494
|
+
* (POLICY_RECEIVE_LIMIT). A shared app's every file, each file sent and each payment step used to spend one.
|
|
23495
|
+
*/
|
|
23496
|
+
open() {
|
|
23497
|
+
return this.paired?.state.status === "ready" && !this.streamBlocked ? Promise.resolve() : this.connect();
|
|
23498
|
+
}
|
|
23319
23499
|
/** Closes what a switch replaced once the contact has had time to move too. */
|
|
23320
23500
|
retire(old, also, rtc = false) {
|
|
23321
23501
|
if (this.retiring.has(old)) return;
|
|
@@ -23893,6 +24073,14 @@ var GhostLink = class {
|
|
|
23893
24073
|
}
|
|
23894
24074
|
if (!this.channel) this.maybeAutoConnect(this.presence);
|
|
23895
24075
|
}
|
|
24076
|
+
/**
|
|
24077
|
+
* This side's listener on `transport` is up again after it was let go while the contact was away (the engine's
|
|
24078
|
+
* `releaseGoneListeners`), and the contact is back: it is dialled once now, whichever side's turn it is, as after a
|
|
24079
|
+
* restart. The contact's own dials found no listener here meanwhile, and wait out their backoff (half a minute).
|
|
24080
|
+
*/
|
|
24081
|
+
knockOnReturn(transport) {
|
|
24082
|
+
this.knock(transport);
|
|
24083
|
+
}
|
|
23896
24084
|
/** The knock under way (`knock`): its transport, its attempt, and whether it was knocked again (`knockAgain`). */
|
|
23897
24085
|
knocking = null;
|
|
23898
24086
|
/**
|
|
@@ -24665,7 +24853,7 @@ var GhostLink = class {
|
|
|
24665
24853
|
/** Issues an HTTP request to a service the peer advertises. */
|
|
24666
24854
|
async request(serviceId, request) {
|
|
24667
24855
|
if (this.options.params.profile) {
|
|
24668
|
-
await this.
|
|
24856
|
+
await this.open();
|
|
24669
24857
|
if (!this.supportsServices) throw new GhostlyHttpError("unavailable", this.isDataLinkOpen ? "Your contact's app cannot share services in this chat, or needs an updated Ghostly" : "Shared services need a live connection");
|
|
24670
24858
|
if (!this.pairedHttp) throw new GhostlyHttpError("closed", "Data link is closed");
|
|
24671
24859
|
return this.pairedHttp.client.request(serviceId, request);
|
|
@@ -24736,7 +24924,7 @@ var GhostLink = class {
|
|
|
24736
24924
|
}
|
|
24737
24925
|
/** Sends a file over the data link, opening it first if needed. Files never travel through Pkarr. */
|
|
24738
24926
|
async sendFile(file, source) {
|
|
24739
|
-
await this.
|
|
24927
|
+
await this.open();
|
|
24740
24928
|
if (this.options.params.profile) {
|
|
24741
24929
|
if (!this.supportsFiles || !this.pairedFiles) throw new Error("This contact does not support files. Both peers need an updated Ghostly.");
|
|
24742
24930
|
return this.pairedFiles.send(file, source);
|
|
@@ -25252,6 +25440,31 @@ var GhostLink = class {
|
|
|
25252
25440
|
return false;
|
|
25253
25441
|
}
|
|
25254
25442
|
}
|
|
25443
|
+
/**
|
|
25444
|
+
* This side's participation key and the pinned contact's, on a paired session that is open and ready: what the asker's
|
|
25445
|
+
* proof of a contact request is made for (WISP 8xx § Accept). Undefined otherwise.
|
|
25446
|
+
*/
|
|
25447
|
+
get participationKeys() {
|
|
25448
|
+
const credentials = this.options.pairing?.credentials;
|
|
25449
|
+
if (!this.options.params.profile || !credentials?.peerKey || !this.channel || !this.isDataLinkOpen || this.paired?.state.status !== "ready") return void 0;
|
|
25450
|
+
return {
|
|
25451
|
+
mine: credentials.signer ? toZ32(credentials.signer.publicKey) : identityFromSeedB64(credentials.seedB64).pubKeyZ32,
|
|
25452
|
+
peer: credentials.peerKey
|
|
25453
|
+
};
|
|
25454
|
+
}
|
|
25455
|
+
/**
|
|
25456
|
+
* Says on the live session that this side asked through the contact's link (WISP 8xx § Accept). No capability: an app
|
|
25457
|
+
* that does not know the frame drops it. False when it could not go now: the caller says it again on the next session.
|
|
25458
|
+
*/
|
|
25459
|
+
sendContactAsker(frame) {
|
|
25460
|
+
if (!this.channel || !this.participationKeys) return false;
|
|
25461
|
+
try {
|
|
25462
|
+
this.channel.send(JSON.stringify(frame));
|
|
25463
|
+
return true;
|
|
25464
|
+
} catch {
|
|
25465
|
+
return false;
|
|
25466
|
+
}
|
|
25467
|
+
}
|
|
25255
25468
|
/** Both sides offer `pin/1` on the open session: a pin can be said and confirmed. */
|
|
25256
25469
|
get supportsPins() {
|
|
25257
25470
|
return this.isDataLinkOpen && this.sessionCapabilities.agreed("pin/1");
|
|
@@ -25355,7 +25568,7 @@ var GhostLink = class {
|
|
|
25355
25568
|
closeApp(app) {
|
|
25356
25569
|
const frame = JSON.stringify(appCloseFrame(app));
|
|
25357
25570
|
if (!this.apps.open.delete(app)) return;
|
|
25358
|
-
this.appRanges.closeApp(app, "offline");
|
|
25571
|
+
this.appRanges.closeApp(app, "offline", true);
|
|
25359
25572
|
if (this.supportsApps && this.channel) try {
|
|
25360
25573
|
this.channel.send(frame);
|
|
25361
25574
|
} catch {}
|
|
@@ -25481,7 +25694,7 @@ var GhostLink = class {
|
|
|
25481
25694
|
failAppRange(task, error) {
|
|
25482
25695
|
this.appRanges.fail(task, error);
|
|
25483
25696
|
}
|
|
25484
|
-
/** Whether `task` still
|
|
25697
|
+
/** Whether `task` still holds a place until it is answered (`AppRanges.holds`): one that does not needs no answer. */
|
|
25485
25698
|
holdsAppRange(task) {
|
|
25486
25699
|
return this.appRanges.holds(task);
|
|
25487
25700
|
}
|
|
@@ -25762,7 +25975,7 @@ var GhostLink = class {
|
|
|
25762
25975
|
async requirePaymentSupport() {
|
|
25763
25976
|
if (!PAYMENT_METHODS.some((m) => this.paymentEnabled(m))) throw new Error("Payments are turned off in this chat.");
|
|
25764
25977
|
if (this.contactAway) throw engineError("contactAway");
|
|
25765
|
-
await this.
|
|
25978
|
+
await this.open();
|
|
25766
25979
|
if (this.supportsPayments) return;
|
|
25767
25980
|
const networks = this.peerNetworks;
|
|
25768
25981
|
throw engineError(networks && !Object.keys(networks).length ? "contactNoWallet" : "contactNoPayments");
|
|
@@ -26408,6 +26621,11 @@ var GhostLink = class {
|
|
|
26408
26621
|
if (target !== void 0) this.options.events?.onPeerWake?.(target);
|
|
26409
26622
|
return;
|
|
26410
26623
|
}
|
|
26624
|
+
if (frame?.t === "contact-asker") {
|
|
26625
|
+
const keys = this.participationKeys;
|
|
26626
|
+
if (keys && this.askerReceived.take()) this.options.events?.onContactAsker?.(frame, keys);
|
|
26627
|
+
return;
|
|
26628
|
+
}
|
|
26411
26629
|
if (frame?.t === "paired-typing") {
|
|
26412
26630
|
if (this.supportsTyping) this.typingReceiver.receive(frame);
|
|
26413
26631
|
return;
|
|
@@ -27201,8 +27419,10 @@ function jpegKeeps(marker, b, payload) {
|
|
|
27201
27419
|
if (marker === 238) return starts(b, payload, "Adobe");
|
|
27202
27420
|
return false;
|
|
27203
27421
|
}
|
|
27204
|
-
/** An
|
|
27205
|
-
var
|
|
27422
|
+
/** An Exif (its TIFF), big-endian, whose IFD0 holds `orientation` alone: all a picture keeps of its Exif. */
|
|
27423
|
+
var orientationTiff = (orientation) => Uint8Array.of(77, 77, 0, 42, 0, 0, 0, 8, 0, 1, 1, 18, 0, 3, 0, 0, 0, 1, 0, orientation, 0, 0, 0, 0, 0, 0);
|
|
27424
|
+
/** An APP1 Exif whose IFD0 holds `orientation` alone. */
|
|
27425
|
+
var orientationOnly = (orientation) => Uint8Array.of(255, 225, 0, 34, 69, 120, 105, 102, 0, 0, ...orientationTiff(orientation));
|
|
27206
27426
|
function stripJpeg(b) {
|
|
27207
27427
|
const parts = [b.subarray(0, 2)];
|
|
27208
27428
|
let at = 2, framed = false, scanned = false, exif = false;
|
|
@@ -27223,7 +27443,8 @@ function stripJpeg(b) {
|
|
|
27223
27443
|
check$1(marker !== 0 && marker !== 216 && at + 2 <= b.length);
|
|
27224
27444
|
const length = u16be(b, at);
|
|
27225
27445
|
check$1(length >= 2 && at + length <= b.length);
|
|
27226
|
-
if (
|
|
27446
|
+
if (marker === 224 && length > 16 && starts(b, at + 2, "JFIF\0")) parts.push(Uint8Array.of(255, 224, 0, 16, ...b.subarray(at + 2, at + 14), 0, 0));
|
|
27447
|
+
else if (jpegKeeps(marker, b, at + 2)) {
|
|
27227
27448
|
parts.push(Uint8Array.of(255, marker), b.subarray(at, at + length));
|
|
27228
27449
|
if (JPEG_FRAME.has(marker)) framed = true;
|
|
27229
27450
|
} else if (marker === 225 && !scanned && !exif && starts(b, at + 2, "Exif\0\0")) {
|
|
@@ -27271,9 +27492,24 @@ var PNG_DRAWS = /* @__PURE__ */ new Set([
|
|
|
27271
27492
|
"fcTL",
|
|
27272
27493
|
"fdAT"
|
|
27273
27494
|
]);
|
|
27495
|
+
var CRC_TABLE = Array.from({ length: 256 }, (_, n) => {
|
|
27496
|
+
for (let k = 0; k < 8; k++) n = n & 1 ? 3988292384 ^ n >>> 1 : n >>> 1;
|
|
27497
|
+
return n >>> 0;
|
|
27498
|
+
});
|
|
27499
|
+
/** A PNG chunk: its length, type, data and the CRC of its type and data. */
|
|
27500
|
+
function pngChunk(type, data) {
|
|
27501
|
+
const out = new Uint8Array(12 + data.length), view = new DataView(out.buffer);
|
|
27502
|
+
view.setUint32(0, data.length);
|
|
27503
|
+
for (let i = 0; i < 4; i++) out[4 + i] = type.charCodeAt(i);
|
|
27504
|
+
out.set(data, 8);
|
|
27505
|
+
let crc = -1;
|
|
27506
|
+
for (const byte of out.subarray(4, 8 + data.length)) crc = CRC_TABLE[(crc ^ byte) & 255] ^ crc >>> 8;
|
|
27507
|
+
view.setUint32(8 + data.length, ~crc >>> 0);
|
|
27508
|
+
return out;
|
|
27509
|
+
}
|
|
27274
27510
|
function stripPng(b) {
|
|
27275
27511
|
const parts = [b.subarray(0, 8)];
|
|
27276
|
-
let at = 8;
|
|
27512
|
+
let at = 8, exif = false, imaged = false;
|
|
27277
27513
|
for (;;) {
|
|
27278
27514
|
check$1(at + 12 <= b.length);
|
|
27279
27515
|
const length = u32be$1(b, at), type = text$1(b, at + 4, 4);
|
|
@@ -27281,6 +27517,12 @@ function stripPng(b) {
|
|
|
27281
27517
|
const critical = (b[at + 4] & 32) === 0;
|
|
27282
27518
|
check$1(!critical || PNG_CRITICAL.has(type));
|
|
27283
27519
|
if (critical || PNG_DRAWS.has(type)) parts.push(b.subarray(at, at + 12 + length));
|
|
27520
|
+
else if (type === "eXIf" && !exif && !imaged) {
|
|
27521
|
+
exif = true;
|
|
27522
|
+
const orientation = exifOrientation(b, at + 8, at + 8 + length);
|
|
27523
|
+
if (orientation >= 2) parts.push(pngChunk("eXIf", orientationTiff(orientation)));
|
|
27524
|
+
}
|
|
27525
|
+
if (type === "IDAT") imaged = true;
|
|
27284
27526
|
at += 12 + length;
|
|
27285
27527
|
if (type === "IEND") return parts;
|
|
27286
27528
|
}
|
|
@@ -27299,19 +27541,38 @@ function stripWebp(b) {
|
|
|
27299
27541
|
const riffEnd = 8 + u32le(b, 4);
|
|
27300
27542
|
check$1(riffEnd <= b.length && riffEnd % 2 === 0);
|
|
27301
27543
|
const parts = [];
|
|
27302
|
-
let at = 12, size = 4, drawn = false;
|
|
27544
|
+
let at = 12, size = 4, drawn = false, exif = false, vp8x;
|
|
27303
27545
|
while (at < riffEnd) {
|
|
27304
27546
|
check$1(at + 8 <= riffEnd);
|
|
27305
27547
|
const type = text$1(b, at, 4), length = u32le(b, at + 4), end = at + 8 + length + (length & 1);
|
|
27306
27548
|
check$1(end <= riffEnd && (at > 12 || type === "VP8 " || type === "VP8L" || type === "VP8X"));
|
|
27549
|
+
let chunk;
|
|
27307
27550
|
if (WEBP_KEEPS.has(type)) {
|
|
27308
|
-
|
|
27551
|
+
chunk = b.subarray(at, end);
|
|
27309
27552
|
if (type === "VP8X") {
|
|
27310
27553
|
check$1(length >= 10);
|
|
27311
|
-
chunk = chunk.slice();
|
|
27554
|
+
chunk = vp8x = chunk.slice();
|
|
27312
27555
|
chunk[8] = chunk[8] & -13;
|
|
27313
27556
|
}
|
|
27314
27557
|
if (type === "VP8 " || type === "VP8L" || type === "ANMF") drawn = true;
|
|
27558
|
+
} else if (type === "EXIF" && !exif && vp8x) {
|
|
27559
|
+
exif = true;
|
|
27560
|
+
const orientation = exifOrientation(b, starts(b, at + 8, "Exif\0\0") ? at + 14 : at + 8, at + 8 + length);
|
|
27561
|
+
if (orientation >= 2) {
|
|
27562
|
+
const data = orientationTiff(orientation);
|
|
27563
|
+
chunk = new Uint8Array(8 + data.length);
|
|
27564
|
+
chunk.set([
|
|
27565
|
+
69,
|
|
27566
|
+
88,
|
|
27567
|
+
73,
|
|
27568
|
+
70,
|
|
27569
|
+
data.length
|
|
27570
|
+
]);
|
|
27571
|
+
chunk.set(data, 8);
|
|
27572
|
+
vp8x[8] = vp8x[8] | 8;
|
|
27573
|
+
}
|
|
27574
|
+
}
|
|
27575
|
+
if (chunk) {
|
|
27315
27576
|
parts.push(chunk);
|
|
27316
27577
|
size += chunk.length;
|
|
27317
27578
|
}
|
|
@@ -27400,6 +27661,8 @@ function stripHeif(b) {
|
|
|
27400
27661
|
check$1(at + 6 <= infe.end);
|
|
27401
27662
|
if (HEIF_METADATA_ITEMS.has(text$1(b, at + 2, 4))) metadata.add(id);
|
|
27402
27663
|
}
|
|
27664
|
+
/** `free` and `skip` boxes, at the top and in `meta`: their bodies go as zeros. */
|
|
27665
|
+
const space = [...top, ...children].filter((box) => box.type === "free" || box.type === "skip");
|
|
27403
27666
|
const out = b.slice();
|
|
27404
27667
|
const version = b[iloc.body];
|
|
27405
27668
|
check$1(version <= 2);
|
|
@@ -27432,13 +27695,18 @@ function stripHeif(b) {
|
|
|
27432
27695
|
for (let e = 0; e < extents; e++) {
|
|
27433
27696
|
if (indexSize) read(indexSize);
|
|
27434
27697
|
const offset = read(offsetSize), length = read(lengthSize);
|
|
27435
|
-
if (!metadata.has(id))
|
|
27698
|
+
if (!metadata.has(id)) {
|
|
27699
|
+
const start = base + offset, end = length ? start + length : b.length;
|
|
27700
|
+
check$1(reference !== 0 || method !== 0 || !space.some((box) => start < box.end && end > box.body));
|
|
27701
|
+
continue;
|
|
27702
|
+
}
|
|
27436
27703
|
check$1(reference === 0 && length > 0 && (method === 0 || method === 1 && !!idat));
|
|
27437
27704
|
const start = (method === 1 ? idat.body : 0) + base + offset, limit = method === 1 ? idat.end : b.length;
|
|
27438
27705
|
check$1(start + length <= limit);
|
|
27439
27706
|
out.fill(0, start, start + length);
|
|
27440
27707
|
}
|
|
27441
27708
|
}
|
|
27709
|
+
for (const box of space) out.fill(0, box.body, box.end);
|
|
27442
27710
|
return [out];
|
|
27443
27711
|
}
|
|
27444
27712
|
var GIF_APPS_KEPT = /* @__PURE__ */ new Set([
|
|
@@ -27712,13 +27980,18 @@ async function withoutPictureMetadata(source, mime) {
|
|
|
27712
27980
|
/**
|
|
27713
27981
|
* What a video leaves with. An MP4 or QuickTime file says more than its frames: its `udta` and `meta` boxes hold where
|
|
27714
27982
|
* it was recorded (`©xyz`, `com.apple.quicktime.location.ISO6709`), the device, often its software; a timed metadata
|
|
27715
|
-
* track (an iPhone's location and motion, a GoPro's GPS) holds them sample by sample
|
|
27716
|
-
*
|
|
27717
|
-
*
|
|
27718
|
-
*
|
|
27983
|
+
* track (an iPhone's location and motion, a GoPro's GPS) holds them sample by sample; the movie's, each track's and
|
|
27984
|
+
* each track's media header (`mvhd`, `tkhd`, `mdhd`) say when it was recorded, to the second, and a camera's timecode
|
|
27985
|
+
* track the time of day. The sender removes them before the file is stored and its digest computed, without decoding
|
|
27986
|
+
* or re-encoding a frame: each such box becomes a `free` box of the same size, zeroed, the headers' creation and
|
|
27987
|
+
* modification times are zeroed (0 is "unknown"), the space already left in it (`free`, `skip`, `wide`: what an edit in
|
|
27988
|
+
* place left behind, a recorder's GPS log) is zeroed after its header, so are the names of its handlers and of the
|
|
27989
|
+
* compressor that made its frames, and each metadata and timecode track's samples are zeroed where they are, so no
|
|
27990
|
+
* offset in the file moves and it plays as it did. Only the boxes' headers, `moov` and `moof` are read; the
|
|
27991
|
+
* media goes untouched.
|
|
27719
27992
|
*
|
|
27720
27993
|
* Fail-closed: a file that is an MP4 or QuickTime video, by its bytes or by its type, and whose metadata cannot be
|
|
27721
|
-
* removed (truncated, malformed, a part this does not know) is refused with `NO_VIDEO_METADATA`, never sent as it was.
|
|
27994
|
+
* removed (truncated, malformed, a part of its movie this does not know) is refused with `NO_VIDEO_METADATA`, never sent as it was.
|
|
27722
27995
|
* A picture (HEIF is pictureMetadata.ts's), a file without a video track (an M4A) and any other file go as they are.
|
|
27723
27996
|
*/
|
|
27724
27997
|
var VIDEO_METADATA_LIMITS = {
|
|
@@ -27739,14 +28012,20 @@ var STRIPPED_TYPES = /* @__PURE__ */ new Set([
|
|
|
27739
28012
|
"video/3gpp",
|
|
27740
28013
|
"video/3gpp2"
|
|
27741
28014
|
]);
|
|
27742
|
-
/**
|
|
28015
|
+
/**
|
|
28016
|
+
* The first box of an MP4 (`ftyp`), of a QuickTime file written without one, or of one a tool or a preview was put
|
|
28017
|
+
* before (`uuid`, `pnot`): a file that starts with one is a movie, refused when it is not one.
|
|
28018
|
+
*/
|
|
27743
28019
|
var FIRST_BOXES = /* @__PURE__ */ new Set([
|
|
27744
28020
|
"ftyp",
|
|
27745
28021
|
"moov",
|
|
27746
28022
|
"mdat",
|
|
27747
28023
|
"wide",
|
|
27748
28024
|
"free",
|
|
27749
|
-
"skip"
|
|
28025
|
+
"skip",
|
|
28026
|
+
"uuid",
|
|
28027
|
+
"pnot",
|
|
28028
|
+
"PICT"
|
|
27750
28029
|
]);
|
|
27751
28030
|
/** Boxes that hold metadata wherever they are: emptied into `free`. */
|
|
27752
28031
|
var METADATA = /* @__PURE__ */ new Set([
|
|
@@ -27754,7 +28033,20 @@ var METADATA = /* @__PURE__ */ new Set([
|
|
|
27754
28033
|
"meta",
|
|
27755
28034
|
"uuid"
|
|
27756
28035
|
]);
|
|
27757
|
-
/**
|
|
28036
|
+
/**
|
|
28037
|
+
* Space left in a file (padding, or an old `moov` or `udta` an edit in place left behind), and what a recorder puts
|
|
28038
|
+
* there (a dashcam's GPS log, a thumbnail): kept where it is, its body zeroed.
|
|
28039
|
+
*/
|
|
28040
|
+
var SPACE = /* @__PURE__ */ new Set([
|
|
28041
|
+
"free",
|
|
28042
|
+
"skip",
|
|
28043
|
+
"wide"
|
|
28044
|
+
]);
|
|
28045
|
+
/**
|
|
28046
|
+
* At the top: what makes the movie, kept (`moov` and `moof` looked into). Any other box is emptied, unless the movie's
|
|
28047
|
+
* samples are in it: the ones known at a movie's top (a preview picture, an event message, the wall-clock time a
|
|
28048
|
+
* fragment was made, `prft`) and a device's own (Samsung's `sefd`, a GPS track's `gps0`) alike.
|
|
28049
|
+
*/
|
|
27758
28050
|
var TOP_KEEPS = /* @__PURE__ */ new Set([
|
|
27759
28051
|
"ftyp",
|
|
27760
28052
|
"styp",
|
|
@@ -27764,18 +28056,17 @@ var TOP_KEEPS = /* @__PURE__ */ new Set([
|
|
|
27764
28056
|
"mfra",
|
|
27765
28057
|
"sidx",
|
|
27766
28058
|
"ssix",
|
|
27767
|
-
"prft",
|
|
27768
28059
|
"pdin",
|
|
27769
|
-
|
|
27770
|
-
"skip",
|
|
27771
|
-
"wide"
|
|
28060
|
+
...SPACE
|
|
27772
28061
|
]);
|
|
28062
|
+
/** The boxes emptied that are known at a movie's top: a file that starts with one is read as boxes. */
|
|
27773
28063
|
var TOP_EMPTIED = /* @__PURE__ */ new Set([
|
|
27774
28064
|
...METADATA,
|
|
27775
28065
|
"pnot",
|
|
27776
28066
|
"PICT",
|
|
27777
28067
|
"emsg",
|
|
27778
|
-
"Xtra"
|
|
28068
|
+
"Xtra",
|
|
28069
|
+
"prft"
|
|
27779
28070
|
]);
|
|
27780
28071
|
var MOOV_KEEPS = /* @__PURE__ */ new Set([
|
|
27781
28072
|
"mvhd",
|
|
@@ -27783,9 +28074,7 @@ var MOOV_KEEPS = /* @__PURE__ */ new Set([
|
|
|
27783
28074
|
"mvex",
|
|
27784
28075
|
"iods",
|
|
27785
28076
|
"ctab",
|
|
27786
|
-
|
|
27787
|
-
"skip",
|
|
27788
|
-
"wide"
|
|
28077
|
+
...SPACE
|
|
27789
28078
|
]);
|
|
27790
28079
|
var TRAK_KEEPS = /* @__PURE__ */ new Set([
|
|
27791
28080
|
"tkhd",
|
|
@@ -27796,9 +28085,7 @@ var TRAK_KEEPS = /* @__PURE__ */ new Set([
|
|
|
27796
28085
|
"load",
|
|
27797
28086
|
"txas",
|
|
27798
28087
|
"matt",
|
|
27799
|
-
|
|
27800
|
-
"skip",
|
|
27801
|
-
"wide"
|
|
28088
|
+
...SPACE
|
|
27802
28089
|
]);
|
|
27803
28090
|
/** Boxes looked into below a track (and in a fragment) for the metadata boxes in them. */
|
|
27804
28091
|
var CONTAINERS = /* @__PURE__ */ new Set([
|
|
@@ -27810,7 +28097,7 @@ var CONTAINERS = /* @__PURE__ */ new Set([
|
|
|
27810
28097
|
"mvex",
|
|
27811
28098
|
"traf"
|
|
27812
28099
|
]);
|
|
27813
|
-
/** Track handlers kept as they are: picture, sound, text and subtitles, timecode, hints. `meta` tracks have their samples zeroed. */
|
|
28100
|
+
/** Track handlers kept as they are: picture, sound, text and subtitles, timecode, hints. `meta` tracks have their samples zeroed, `tmcd` ones too. */
|
|
27814
28101
|
var HANDLERS = /* @__PURE__ */ new Set([
|
|
27815
28102
|
"vide",
|
|
27816
28103
|
"soun",
|
|
@@ -27826,6 +28113,12 @@ var HANDLERS = /* @__PURE__ */ new Set([
|
|
|
27826
28113
|
"odsm",
|
|
27827
28114
|
"subp"
|
|
27828
28115
|
]);
|
|
28116
|
+
/** The handlers whose sample descriptions are a visual one's, a compressor's name in each. */
|
|
28117
|
+
var VISUAL = /* @__PURE__ */ new Set([
|
|
28118
|
+
"vide",
|
|
28119
|
+
"auxv",
|
|
28120
|
+
"pict"
|
|
28121
|
+
]);
|
|
27829
28122
|
/** Zeros put in a Blob a part at a time. */
|
|
27830
28123
|
var ZEROS = /* @__PURE__ */ new Uint8Array(1048576);
|
|
27831
28124
|
var u32be = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
|
|
@@ -27873,22 +28166,59 @@ function empty(b, box) {
|
|
|
27873
28166
|
], box.start + 4);
|
|
27874
28167
|
b.fill(0, box.start + (u32be(b, box.start) === 1 ? 16 : 8), box.end);
|
|
27875
28168
|
}
|
|
27876
|
-
/**
|
|
28169
|
+
/**
|
|
28170
|
+
* Every metadata box in a container's children (and in theirs, for the containers below a track) emptied, every
|
|
28171
|
+
* free space's body zeroed, and every handler's name (an `hdlr`'s after its 24 bytes of fields: "Core Media Video",
|
|
28172
|
+
* an encoder's or an app's) zeroed in place, its type kept.
|
|
28173
|
+
*/
|
|
27877
28174
|
function emptyWithin(b, start, end) {
|
|
27878
28175
|
for (const box of boxes(b, start, end)) if (METADATA.has(box.type)) empty(b, box);
|
|
28176
|
+
else if (SPACE.has(box.type)) b.fill(0, box.body, box.end);
|
|
28177
|
+
else if (box.type === "hdlr") b.fill(0, Math.min(box.body + 24, box.end), box.end);
|
|
27879
28178
|
else if (CONTAINERS.has(box.type)) emptyWithin(b, box.body, box.end);
|
|
27880
28179
|
}
|
|
28180
|
+
/**
|
|
28181
|
+
* A visual track's sample descriptions with the name of the compressor that made them zeroed (32 bytes at 42 of each
|
|
28182
|
+
* entry's body, MP4's `compressorname` and QuickTime's alike: an encoder's version, a camera's).
|
|
28183
|
+
*/
|
|
28184
|
+
function zeroCompressorNames(b, stbl) {
|
|
28185
|
+
const stsd = child(b, stbl, "stsd");
|
|
28186
|
+
check(!!stsd && stsd.body + 8 <= stsd.end);
|
|
28187
|
+
for (const entry of boxes(b, stsd.body + 8, stsd.end)) {
|
|
28188
|
+
check(entry.body + 74 <= entry.end);
|
|
28189
|
+
b.fill(0, entry.body + 42, entry.body + 74);
|
|
28190
|
+
}
|
|
28191
|
+
}
|
|
28192
|
+
/** A `mvhd`, `tkhd` or `mdhd` with its creation and modification times zeroed: 32 bits each in version 0, 64 in 1. */
|
|
28193
|
+
function zeroTimes(b, box) {
|
|
28194
|
+
const version = b[box.body], bytes = version === 1 ? 16 : 8;
|
|
28195
|
+
check(version <= 1 && box.body + 4 + bytes <= box.end);
|
|
28196
|
+
b.fill(0, box.body + 4, box.body + 4 + bytes);
|
|
28197
|
+
}
|
|
27881
28198
|
var child = (b, parent, type) => {
|
|
27882
28199
|
if (!parent) return void 0;
|
|
27883
28200
|
const of = boxes(b, parent.body, parent.end).filter((box) => box.type === type);
|
|
27884
28201
|
check(of.length <= 1);
|
|
27885
28202
|
return of[0];
|
|
27886
28203
|
};
|
|
28204
|
+
/** A sample table's chunks, from its `stco` or `co64`: how many, and where each starts in the file. */
|
|
28205
|
+
function chunkOffsets(b, stbl) {
|
|
28206
|
+
const stco = child(b, stbl, "stco"), co64 = child(b, stbl, "co64");
|
|
28207
|
+
check(!!stco !== !!co64);
|
|
28208
|
+
const offsets = stco ?? co64;
|
|
28209
|
+
check(offsets.body + 8 <= offsets.end);
|
|
28210
|
+
const chunks = u32be(b, offsets.body + 4);
|
|
28211
|
+
check(offsets.body + 8 + chunks * (co64 ? 8 : 4) <= offsets.end);
|
|
28212
|
+
const offsetOf = (i) => co64 ? u32be(b, co64.body + 8 + i * 8) * 2 ** 32 + u32be(b, co64.body + 12 + i * 8) : u32be(b, stco.body + 8 + i * 4);
|
|
28213
|
+
return {
|
|
28214
|
+
chunks,
|
|
28215
|
+
offsetOf
|
|
28216
|
+
};
|
|
28217
|
+
}
|
|
27887
28218
|
/** The byte ranges of a track's samples in the file, one per chunk, from its sample table. */
|
|
27888
28219
|
function sampleRanges(b, stbl) {
|
|
27889
28220
|
const stsz = child(b, stbl, "stsz"), stz2 = child(b, stbl, "stz2"), stsc = child(b, stbl, "stsc");
|
|
27890
|
-
|
|
27891
|
-
check(!!stsc && !!stsz !== !!stz2 && !!stco !== !!co64);
|
|
28221
|
+
check(!!stsc && !!stsz !== !!stz2);
|
|
27892
28222
|
const need = (box, at, bytes) => check(at + bytes <= box.end);
|
|
27893
28223
|
const sizeTable = stsz ?? stz2;
|
|
27894
28224
|
need(sizeTable, sizeTable.body, 12);
|
|
@@ -27907,11 +28237,7 @@ function sampleRanges(b, stbl) {
|
|
|
27907
28237
|
const at = stz2.body + 12;
|
|
27908
28238
|
sizeOf = field === 16 ? (i) => b[at + i * 2] << 8 | b[at + i * 2 + 1] : field === 8 ? (i) => b[at + i] : (i) => i & 1 ? b[at + (i >> 1)] & 15 : b[at + (i >> 1)] >> 4;
|
|
27909
28239
|
}
|
|
27910
|
-
const
|
|
27911
|
-
need(offsets, offsets.body, 8);
|
|
27912
|
-
const chunks = u32be(b, offsets.body + 4);
|
|
27913
|
-
need(offsets, offsets.body + 8, chunks * (co64 ? 8 : 4));
|
|
27914
|
-
const offsetOf = (i) => co64 ? u32be(b, co64.body + 8 + i * 8) * 2 ** 32 + u32be(b, co64.body + 12 + i * 8) : u32be(b, stco.body + 8 + i * 4);
|
|
28240
|
+
const { chunks, offsetOf } = chunkOffsets(b, stbl);
|
|
27915
28241
|
need(stsc, stsc.body, 8);
|
|
27916
28242
|
const runs = u32be(b, stsc.body + 4);
|
|
27917
28243
|
need(stsc, stsc.body + 8, runs * 12);
|
|
@@ -27934,6 +28260,79 @@ function sampleRanges(b, stbl) {
|
|
|
27934
28260
|
check(sample === count);
|
|
27935
28261
|
return ranges;
|
|
27936
28262
|
}
|
|
28263
|
+
/** Each track's default sample size in fragments, from `moov`'s `mvex/trex` boxes, by track ID. */
|
|
28264
|
+
function defaultSampleSizes(moov) {
|
|
28265
|
+
const sizes = /* @__PURE__ */ new Map();
|
|
28266
|
+
const mvex = child(moov, header(moov, 0, moov.length), "mvex");
|
|
28267
|
+
for (const trex of mvex ? boxes(moov, mvex.body, mvex.end) : []) {
|
|
28268
|
+
if (trex.type !== "trex") continue;
|
|
28269
|
+
check(trex.body + 24 <= trex.end);
|
|
28270
|
+
sizes.set(u32be(moov, trex.body + 4), u32be(moov, trex.body + 16));
|
|
28271
|
+
}
|
|
28272
|
+
return sizes;
|
|
28273
|
+
}
|
|
28274
|
+
/**
|
|
28275
|
+
* The byte ranges of a fragment's samples in the file, one per track run (`trun`), from its `moof` read whole (`at` its
|
|
28276
|
+
* offset in the file): each run starts at its data offset from its track fragment's base (`tfhd`'s base data offset,
|
|
28277
|
+
* else the `moof`'s start for the first track fragment or one that says so, else where the previous one's data ended),
|
|
28278
|
+
* or where the previous run ended; its length is its samples' sizes, its own or `tfhd`'s or `trex`'s default.
|
|
28279
|
+
*/
|
|
28280
|
+
function fragmentRanges(b, at, sizes) {
|
|
28281
|
+
const ranges = [];
|
|
28282
|
+
let previous = at;
|
|
28283
|
+
for (const traf of boxes(b, header(b, 0, b.length).body, b.length)) {
|
|
28284
|
+
if (traf.type !== "traf") continue;
|
|
28285
|
+
const tfhd = child(b, traf, "tfhd");
|
|
28286
|
+
check(!!tfhd && tfhd.body + 8 <= tfhd.end);
|
|
28287
|
+
const flags = u32be(b, tfhd.body) & 16777215;
|
|
28288
|
+
let field = tfhd.body + 8, base = flags & 131072 ? at : previous;
|
|
28289
|
+
if (flags & 1) {
|
|
28290
|
+
check(field + 8 <= tfhd.end);
|
|
28291
|
+
base = u32be(b, field) * 2 ** 32 + u32be(b, field + 4);
|
|
28292
|
+
field += 8;
|
|
28293
|
+
}
|
|
28294
|
+
if (flags & 2) field += 4;
|
|
28295
|
+
if (flags & 8) field += 4;
|
|
28296
|
+
let size = sizes.get(u32be(b, tfhd.body + 4));
|
|
28297
|
+
if (flags & 16) {
|
|
28298
|
+
check(field + 4 <= tfhd.end);
|
|
28299
|
+
size = u32be(b, field);
|
|
28300
|
+
}
|
|
28301
|
+
let next = base;
|
|
28302
|
+
for (const trun of boxes(b, traf.body, traf.end)) {
|
|
28303
|
+
if (trun.type !== "trun") continue;
|
|
28304
|
+
check(trun.body + 8 <= trun.end);
|
|
28305
|
+
const runFlags = u32be(b, trun.body) & 16777215, count = u32be(b, trun.body + 4);
|
|
28306
|
+
let field = trun.body + 8;
|
|
28307
|
+
if (runFlags & 1) {
|
|
28308
|
+
check(field + 4 <= trun.end);
|
|
28309
|
+
next = base + (u32be(b, field) | 0);
|
|
28310
|
+
field += 4;
|
|
28311
|
+
}
|
|
28312
|
+
if (runFlags & 4) field += 4;
|
|
28313
|
+
const stride = [
|
|
28314
|
+
256,
|
|
28315
|
+
512,
|
|
28316
|
+
1024,
|
|
28317
|
+
2048
|
|
28318
|
+
].filter((flag) => runFlags & flag).length * 4;
|
|
28319
|
+
check(field + count * stride <= trun.end);
|
|
28320
|
+
let length = 0;
|
|
28321
|
+
if (runFlags & 512) {
|
|
28322
|
+
const sizeAt = field + (runFlags & 256 ? 4 : 0);
|
|
28323
|
+
for (let i = 0; i < count; i++) length += u32be(b, sizeAt + i * stride);
|
|
28324
|
+
} else if (count) {
|
|
28325
|
+
check(size !== void 0);
|
|
28326
|
+
length = count * size;
|
|
28327
|
+
}
|
|
28328
|
+
check(Number.isSafeInteger(next) && Number.isSafeInteger(next + length));
|
|
28329
|
+
if (length) ranges.push([next, next + length]);
|
|
28330
|
+
next += length;
|
|
28331
|
+
}
|
|
28332
|
+
previous = next;
|
|
28333
|
+
}
|
|
28334
|
+
return ranges;
|
|
28335
|
+
}
|
|
27937
28336
|
/** Whether every data reference of a track is this file (a self-contained `url ` or `alis`). */
|
|
27938
28337
|
function selfContained(b, minf) {
|
|
27939
28338
|
const dref = child(b, child(b, minf, "dinf"), "dref");
|
|
@@ -27941,18 +28340,21 @@ function selfContained(b, minf) {
|
|
|
27941
28340
|
return boxes(b, dref.body + 8, dref.end).every((entry) => entry.body + 4 <= entry.end && (b[entry.body + 3] & 1) === 1);
|
|
27942
28341
|
}
|
|
27943
28342
|
/**
|
|
27944
|
-
* `moov` with its metadata boxes emptied, read whole: whether it has a video track,
|
|
27945
|
-
* metadata tracks' samples (zeroed by the caller where they are)
|
|
28343
|
+
* `moov` with its metadata boxes emptied and its headers' times zeroed, read whole: whether it has a video track, the
|
|
28344
|
+
* byte ranges of its metadata and timecode tracks' samples (zeroed by the caller where they are), whether a metadata
|
|
28345
|
+
* track has any, and every track's sample table.
|
|
27946
28346
|
*/
|
|
27947
28347
|
function stripMoov(b) {
|
|
27948
|
-
let video = false, fragmented = false;
|
|
27949
|
-
const zeroed = [];
|
|
28348
|
+
let video = false, fragmented = false, metadata = false;
|
|
28349
|
+
const zeroed = [], tables = [];
|
|
27950
28350
|
for (const box of boxes(b, header(b, 0, b.length).body, b.length)) {
|
|
27951
28351
|
if (METADATA.has(box.type)) {
|
|
27952
28352
|
empty(b, box);
|
|
27953
28353
|
continue;
|
|
27954
28354
|
}
|
|
27955
28355
|
check(MOOV_KEEPS.has(box.type));
|
|
28356
|
+
if (SPACE.has(box.type)) b.fill(0, box.body, box.end);
|
|
28357
|
+
if (box.type === "mvhd") zeroTimes(b, box);
|
|
27956
28358
|
if (box.type === "mvex") {
|
|
27957
28359
|
fragmented = true;
|
|
27958
28360
|
emptyWithin(b, box.body, box.end);
|
|
@@ -27965,44 +28367,65 @@ function stripMoov(b) {
|
|
|
27965
28367
|
continue;
|
|
27966
28368
|
}
|
|
27967
28369
|
check(TRAK_KEEPS.has(part.type));
|
|
28370
|
+
if (part.type === "tkhd") zeroTimes(b, part);
|
|
27968
28371
|
if (part.type === "mdia") {
|
|
27969
28372
|
check(!mdia);
|
|
27970
28373
|
mdia = part;
|
|
27971
28374
|
}
|
|
27972
28375
|
}
|
|
27973
28376
|
check(!!mdia);
|
|
27974
|
-
const hdlr = child(b, mdia, "hdlr"), minf = child(b, mdia, "minf");
|
|
28377
|
+
const hdlr = child(b, mdia, "hdlr"), minf = child(b, mdia, "minf"), mdhd = child(b, mdia, "mdhd");
|
|
27975
28378
|
check(!!hdlr && !!minf && hdlr.body + 12 <= hdlr.end);
|
|
28379
|
+
if (mdhd) zeroTimes(b, mdhd);
|
|
27976
28380
|
const handler = text(b, hdlr.body + 8, 4);
|
|
27977
28381
|
const stbl = child(b, minf, "stbl");
|
|
27978
28382
|
check(!!stbl);
|
|
28383
|
+
tables.push(stbl);
|
|
27979
28384
|
if (handler === "meta") {
|
|
27980
28385
|
check(selfContained(b, minf));
|
|
27981
|
-
|
|
27982
|
-
|
|
28386
|
+
const ranges = sampleRanges(b, stbl);
|
|
28387
|
+
metadata ||= ranges.length > 0;
|
|
28388
|
+
for (const range of ranges) zeroed.push(range);
|
|
28389
|
+
} else if (handler === "tmcd" && selfContained(b, minf)) for (const range of sampleRanges(b, stbl)) zeroed.push(range);
|
|
28390
|
+
else check(HANDLERS.has(handler));
|
|
27983
28391
|
if (handler === "vide") video = true;
|
|
28392
|
+
if (VISUAL.has(handler)) zeroCompressorNames(b, stbl);
|
|
27984
28393
|
emptyWithin(b, box.body, box.end);
|
|
27985
28394
|
}
|
|
27986
28395
|
return {
|
|
27987
28396
|
video,
|
|
27988
28397
|
fragmented,
|
|
27989
|
-
|
|
28398
|
+
metadata,
|
|
28399
|
+
zeroed,
|
|
28400
|
+
tables
|
|
27990
28401
|
};
|
|
27991
28402
|
}
|
|
27992
|
-
/** A box's header in the file at `at`, read from it. */
|
|
28403
|
+
/** A whole box's header in the file at `at`, read from it; undefined where none fits (bytes after the last box). */
|
|
27993
28404
|
async function headerAt(source, at) {
|
|
27994
|
-
|
|
28405
|
+
const head = await source.read(at, 16);
|
|
28406
|
+
try {
|
|
28407
|
+
return header(head, 0, source.size, at);
|
|
28408
|
+
} catch {
|
|
28409
|
+
return;
|
|
28410
|
+
}
|
|
27995
28411
|
}
|
|
27996
28412
|
/** A box read whole, within the limit. */
|
|
27997
28413
|
async function whole(source, box) {
|
|
27998
28414
|
check(box.end - box.start <= VIDEO_METADATA_LIMITS.maxBoxBytes);
|
|
27999
|
-
const bytes =
|
|
28415
|
+
const bytes = await source.read(box.start, box.end - box.start);
|
|
28000
28416
|
check(bytes.length === box.end - box.start);
|
|
28001
28417
|
return bytes;
|
|
28002
28418
|
}
|
|
28003
|
-
/**
|
|
28004
|
-
|
|
28005
|
-
|
|
28419
|
+
/**
|
|
28420
|
+
* What a file is by its first box: a movie (`FIRST_BOXES`), a file of boxes that is one when it holds a `moov` (any
|
|
28421
|
+
* other box found at the top of a movie: a stream's segment holds none), or another file. An HEIF picture is
|
|
28422
|
+
* pictureMetadata.ts's.
|
|
28423
|
+
*/
|
|
28424
|
+
function containerOf(head, mime) {
|
|
28425
|
+
const first = head.length >= 8 ? text(head, 4, 4) : "";
|
|
28426
|
+
if (isStrippedPicture(head, mime)) return void 0;
|
|
28427
|
+
if (FIRST_BOXES.has(first)) return "movie";
|
|
28428
|
+
return TOP_KEEPS.has(first) || TOP_EMPTIED.has(first) ? "boxes" : void 0;
|
|
28006
28429
|
}
|
|
28007
28430
|
/**
|
|
28008
28431
|
* `source` as it is sent: an MP4 or QuickTime video without its metadata, made of `source`'s own bytes but for the
|
|
@@ -28010,50 +28433,97 @@ function isVideoContainer(head, mime) {
|
|
|
28010
28433
|
* Throws `NO_VIDEO_METADATA` for a video whose metadata cannot be removed; an error reading `source` as it is.
|
|
28011
28434
|
*/
|
|
28012
28435
|
async function withoutVideoMetadata(source, mime) {
|
|
28013
|
-
const
|
|
28436
|
+
const patches = await videoMetadataPatches({
|
|
28437
|
+
size: source.size,
|
|
28438
|
+
read: async (offset, length) => new Uint8Array(await source.slice(offset, offset + length).arrayBuffer())
|
|
28439
|
+
}, mime);
|
|
28440
|
+
if (!patches) return void 0;
|
|
28441
|
+
const parts = [];
|
|
28442
|
+
let at = 0;
|
|
28443
|
+
for (const patch of patches) {
|
|
28444
|
+
if (patch.start > at) parts.push(source.slice(at, patch.start));
|
|
28445
|
+
if (patch.bytes) parts.push(patch.bytes);
|
|
28446
|
+
else for (let left = patch.end - patch.start; left > 0; left -= ZEROS.length) parts.push(ZEROS.subarray(0, Math.min(left, ZEROS.length)));
|
|
28447
|
+
at = patch.end;
|
|
28448
|
+
}
|
|
28449
|
+
if (at < source.size) parts.push(source.slice(at));
|
|
28450
|
+
return new Blob(parts, { type: mime });
|
|
28451
|
+
}
|
|
28452
|
+
/**
|
|
28453
|
+
* What `withoutVideoMetadata` changes in a video read from `source` (one not held in a Blob: a file kept in storage):
|
|
28454
|
+
* the parts replaced, in order and apart, the rest of its bytes going as they are; undefined when it goes as it is.
|
|
28455
|
+
* Throws `NO_VIDEO_METADATA` as it does.
|
|
28456
|
+
*/
|
|
28457
|
+
async function videoMetadataPatches(source, mime) {
|
|
28458
|
+
const head = await source.read(0, VIDEO_METADATA_LIMITS.headBytes);
|
|
28014
28459
|
const typed = STRIPPED_TYPES.has(mime.split(";")[0].trim().toLowerCase());
|
|
28015
|
-
|
|
28460
|
+
const container = containerOf(head, mime);
|
|
28461
|
+
if (!container) {
|
|
28016
28462
|
if (typed && !isStrippedPicture(head, mime)) throw new Error(NO_VIDEO_METADATA);
|
|
28017
28463
|
return;
|
|
28018
28464
|
}
|
|
28019
28465
|
/** What replaces the file's bytes, by where it starts: a box rewritten, or zeros (no `bytes`). */
|
|
28020
28466
|
const patches = [];
|
|
28021
28467
|
const top = [];
|
|
28468
|
+
/** What goes as zeros at the top: the boxes emptied, the space's bodies, and the bytes after the last box. */
|
|
28469
|
+
const dropped = [];
|
|
28470
|
+
let trailer = false;
|
|
28022
28471
|
for (let at = 0; at < source.size;) {
|
|
28023
28472
|
check(top.length < VIDEO_METADATA_LIMITS.maxBoxes);
|
|
28024
28473
|
const box = await headerAt(source, at);
|
|
28025
|
-
if (top.length && box.type === "\0\0\0\0"
|
|
28474
|
+
if (!box || top.length && box.type === "\0\0\0\0") {
|
|
28026
28475
|
patches.push({
|
|
28027
28476
|
start: at,
|
|
28028
28477
|
end: source.size
|
|
28029
28478
|
});
|
|
28479
|
+
dropped.push([at, source.size]);
|
|
28480
|
+
trailer = !box || box.end !== source.size;
|
|
28030
28481
|
break;
|
|
28031
28482
|
}
|
|
28032
|
-
check(TOP_KEEPS.has(box.type) || TOP_EMPTIED.has(box.type));
|
|
28033
28483
|
top.push(box);
|
|
28484
|
+
if (SPACE.has(box.type)) dropped.push([box.body, box.end]);
|
|
28485
|
+
else if (!TOP_KEEPS.has(box.type)) dropped.push([box.start, box.end]);
|
|
28034
28486
|
at = box.end;
|
|
28035
28487
|
}
|
|
28036
28488
|
const moovs = top.filter((box) => box.type === "moov");
|
|
28489
|
+
if (!moovs.length && container === "boxes" && !typed) {
|
|
28490
|
+
check(!trailer && top.every((box) => TOP_KEEPS.has(box.type) || TOP_EMPTIED.has(box.type)));
|
|
28491
|
+
return;
|
|
28492
|
+
}
|
|
28037
28493
|
check(moovs.length === 1);
|
|
28038
28494
|
const moov = await whole(source, moovs[0]);
|
|
28039
|
-
const { video, fragmented, zeroed } = stripMoov(moov);
|
|
28495
|
+
const { video, fragmented, metadata, zeroed, tables } = stripMoov(moov);
|
|
28040
28496
|
if (!video && !typed) return void 0;
|
|
28041
28497
|
patches.push({
|
|
28042
28498
|
start: moovs[0].start,
|
|
28043
28499
|
end: moovs[0].end,
|
|
28044
28500
|
bytes: moov
|
|
28045
28501
|
});
|
|
28046
|
-
|
|
28502
|
+
if (dropped.length) for (const stbl of tables) {
|
|
28503
|
+
const { chunks, offsetOf } = chunkOffsets(moov, stbl);
|
|
28504
|
+
for (let i = 0; i < chunks; i++) {
|
|
28505
|
+
const offset = offsetOf(i);
|
|
28506
|
+
check(!dropped.some(([start, end]) => offset >= start && offset < end));
|
|
28507
|
+
}
|
|
28508
|
+
}
|
|
28509
|
+
check(!fragmented || !metadata);
|
|
28510
|
+
const sizes = dropped.length && fragmented ? defaultSampleSizes(moov) : void 0;
|
|
28047
28511
|
for (const box of top) if (box.type === "moof") {
|
|
28048
28512
|
const moof = await whole(source, box);
|
|
28513
|
+
if (dropped.length) for (const [start, end] of fragmentRanges(moof, box.start, sizes ?? /* @__PURE__ */ new Map())) check(!dropped.some(([from, to]) => start < to && end > from));
|
|
28049
28514
|
emptyWithin(moof, box.body - box.start, moof.length);
|
|
28050
28515
|
patches.push({
|
|
28051
28516
|
start: box.start,
|
|
28052
28517
|
end: box.end,
|
|
28053
28518
|
bytes: moof
|
|
28054
28519
|
});
|
|
28055
|
-
} else if (
|
|
28056
|
-
|
|
28520
|
+
} else if (SPACE.has(box.type)) {
|
|
28521
|
+
if (box.body < box.end) patches.push({
|
|
28522
|
+
start: box.body,
|
|
28523
|
+
end: box.end
|
|
28524
|
+
});
|
|
28525
|
+
} else if (!TOP_KEEPS.has(box.type)) {
|
|
28526
|
+
const head = await source.read(box.start, box.body - box.start);
|
|
28057
28527
|
empty(head, {
|
|
28058
28528
|
type: box.type,
|
|
28059
28529
|
start: 0,
|
|
@@ -28081,17 +28551,12 @@ async function withoutVideoMetadata(source, mime) {
|
|
|
28081
28551
|
start,
|
|
28082
28552
|
end
|
|
28083
28553
|
});
|
|
28084
|
-
const parts = [];
|
|
28085
28554
|
let at = 0;
|
|
28086
28555
|
for (const patch of patches.sort((a, b) => a.start - b.start)) {
|
|
28087
28556
|
check(patch.start >= at);
|
|
28088
|
-
if (patch.start > at) parts.push(source.slice(at, patch.start));
|
|
28089
|
-
if (patch.bytes) parts.push(patch.bytes);
|
|
28090
|
-
else for (let left = patch.end - patch.start; left > 0; left -= ZEROS.length) parts.push(ZEROS.subarray(0, Math.min(left, ZEROS.length)));
|
|
28091
28557
|
at = patch.end;
|
|
28092
28558
|
}
|
|
28093
|
-
|
|
28094
|
-
return new Blob(parts, { type: mime });
|
|
28559
|
+
return patches;
|
|
28095
28560
|
}
|
|
28096
28561
|
//#endregion
|
|
28097
28562
|
//#region ../core/src/payments.ts
|
|
@@ -31806,10 +32271,11 @@ function groupMetaNewer(a, b) {
|
|
|
31806
32271
|
/**
|
|
31807
32272
|
* The revision of the next statement signed under `epoch`: one past the held statement's under the same epoch, else 1.
|
|
31808
32273
|
* Counting on from a statement of an earlier epoch would let a former admin who signed the highest safe revision leave
|
|
31809
|
-
* every later admin with a revision no member accepts.
|
|
32274
|
+
* every later admin with a revision no member accepts. Never under `floor` (WISP 06 § Raised counters): a copy started
|
|
32275
|
+
* from older state signs above every revision the device it replaced may have signed under the same commit.
|
|
31810
32276
|
*/
|
|
31811
|
-
function nextGroupMetaRevision(before, epoch) {
|
|
31812
|
-
return before && before.e === epoch ? before.r + 1 : 1;
|
|
32277
|
+
function nextGroupMetaRevision(before, epoch, floor = 0) {
|
|
32278
|
+
return Math.max(before && before.e === epoch ? before.r + 1 : 1, Number.isSafeInteger(floor) ? floor : 0);
|
|
31813
32279
|
}
|
|
31814
32280
|
/**
|
|
31815
32281
|
* Statements a member keeps from before the one it holds, oldest first, so it can hand a member back from away each
|
|
@@ -32183,10 +32649,11 @@ var GROUP_LIMITS = {
|
|
|
32183
32649
|
secretsPerFrame: 16,
|
|
32184
32650
|
/**
|
|
32185
32651
|
* Other members' messages kept to hand on to a member who missed them (any member catches up the others): count
|
|
32186
|
-
* and total
|
|
32652
|
+
* and total bytes as `frameBytes` counts them. The oldest go first. The bytes hold 256 texts of `textBytes` (about
|
|
32653
|
+
* 22 KB each as a frame), so only messages carrying boxes beside a long text give way before their count.
|
|
32187
32654
|
*/
|
|
32188
32655
|
relay: 256,
|
|
32189
|
-
relayBytes:
|
|
32656
|
+
relayBytes: 6291456,
|
|
32190
32657
|
/** Other members' edits kept to hand on, the latest per message (WISP 902 § Edits): count and ciphertext bytes. */
|
|
32191
32658
|
relayEdits: 64,
|
|
32192
32659
|
relayEditBytes: 524288,
|
|
@@ -32218,7 +32685,9 @@ var GROUP_LIMITS = {
|
|
|
32218
32685
|
/** Between two slices, when the member's app cannot say it handled one (`handled` resolves `false`). */
|
|
32219
32686
|
catchUpPauseMs: 500,
|
|
32220
32687
|
/** A received message is in the saved state within this long (`persistSoon`): a burst of them is one save, not one each. */
|
|
32221
|
-
saveWithinMs: 1e3
|
|
32688
|
+
saveWithinMs: 1e3,
|
|
32689
|
+
/** New name records of one member taken in `syncWindowMs` (WISP 902 § Messages, "The name record"): one a rename. */
|
|
32690
|
+
namesPerMember: 4
|
|
32222
32691
|
};
|
|
32223
32692
|
/** What every member should know about who can read what, in the words the apps show. */
|
|
32224
32693
|
var GROUP_READ_NOTE = `Everyone in the group can read everything sent while they are a member. Someone removed keeps what they already received and cannot read what comes after; someone who joins later cannot read what came before. Messages go to each member; whoever was away gets what they missed from any member who has it (the group's last ${GROUP_LIMITS.relay} messages) when they meet again.`;
|
|
@@ -32226,7 +32695,7 @@ var GROUP_READ_NOTE = `Everyone in the group can read everything sent while they
|
|
|
32226
32695
|
* After my sync to a member, how long what comes from it may be its answer (a catch-up), and after each frame of the
|
|
32227
32696
|
* answer: slices go one after another, each once my app handled the last (`CATCH_UP_PAUSE_MS` at most between them).
|
|
32228
32697
|
*/
|
|
32229
|
-
var ANSWER_WINDOW_MS = 5e3;
|
|
32698
|
+
var ANSWER_WINDOW_MS$1 = 5e3;
|
|
32230
32699
|
var MAX_TEXT_BOX$1 = Math.ceil((GROUP_LIMITS.textBytes + 16) * 4 / 3) + 4;
|
|
32231
32700
|
/** Sixteen mentions as JSON, each a key and two offsets, with room to spare, sealed. */
|
|
32232
32701
|
var MAX_MENTIONS_BOX = Math.ceil((MENTION_LIMITS.count * 96 + 16) * 4 / 3) + 4;
|
|
@@ -32294,6 +32763,37 @@ var nickSigned = (f, nk) => utf8Encode(JSON.stringify([
|
|
|
32294
32763
|
nk.c
|
|
32295
32764
|
]));
|
|
32296
32765
|
var isNickBox = isSealedBox(MAX_NICK_BOX);
|
|
32766
|
+
/** A name record's box: the name as JSON (each character escaped at worst) and the signature. */
|
|
32767
|
+
var MAX_NAME_BOX = Math.ceil(1216) + 4;
|
|
32768
|
+
var nameSigned = (g, k, v, nm) => utf8Encode(JSON.stringify([
|
|
32769
|
+
"ghostly-group/1 name",
|
|
32770
|
+
g,
|
|
32771
|
+
k,
|
|
32772
|
+
v,
|
|
32773
|
+
nm
|
|
32774
|
+
]));
|
|
32775
|
+
var nameAad = (f) => JSON.stringify([
|
|
32776
|
+
"ghostly-group/1 name",
|
|
32777
|
+
f.g,
|
|
32778
|
+
f.e,
|
|
32779
|
+
f.k,
|
|
32780
|
+
f.v
|
|
32781
|
+
]);
|
|
32782
|
+
/** A name record's frame as it came, its fields checked, or null. */
|
|
32783
|
+
function readNameFrame(v) {
|
|
32784
|
+
if (!v || typeof v !== "object") return null;
|
|
32785
|
+
const f = v;
|
|
32786
|
+
if (f.t !== "group-name" || typeof f.g !== "string" || !GROUP_ID.test(f.g) || !Number.isSafeInteger(f.e) || f.e < 0 || typeof f.k !== "string" || !MEMBER_KEY.test(f.k) || !Number.isSafeInteger(f.v) || f.v <= 0 || typeof f.nn !== "string" || f.nn.length !== 32 || !B64$1.test(f.nn) || typeof f.c !== "string" || f.c.length > MAX_NAME_BOX || !B64$1.test(f.c)) return null;
|
|
32787
|
+
return {
|
|
32788
|
+
t: "group-name",
|
|
32789
|
+
g: f.g,
|
|
32790
|
+
e: f.e,
|
|
32791
|
+
k: f.k,
|
|
32792
|
+
v: f.v,
|
|
32793
|
+
nn: f.nn,
|
|
32794
|
+
c: f.c
|
|
32795
|
+
};
|
|
32796
|
+
}
|
|
32297
32797
|
var isSignature = (v) => typeof v === "string" && v.length === 86 && B64$1.test(v);
|
|
32298
32798
|
var B64$1 = /^[A-Za-z0-9_-]*$/;
|
|
32299
32799
|
var secretAad$1 = (g, e, member) => JSON.stringify([
|
|
@@ -32557,8 +33057,15 @@ var GroupSession = class {
|
|
|
32557
33057
|
asked = /* @__PURE__ */ new Map();
|
|
32558
33058
|
/** The signed leave of each member I last passed on, kept for an admin that was away (`byesHeld`). In memory only. */
|
|
32559
33059
|
byesPassed = /* @__PURE__ */ new Map();
|
|
32560
|
-
/**
|
|
33060
|
+
/**
|
|
33061
|
+
* Member → when the name I hold for it was said: its message's time, its name record's version, or the moment an edge
|
|
33062
|
+
* said it (`heardName`). In memory only; the records held start it.
|
|
33063
|
+
*/
|
|
32561
33064
|
nickAt = /* @__PURE__ */ new Map();
|
|
33065
|
+
/** The version of my name record last said to every member (`sayName`). In memory only: said again once per start. */
|
|
33066
|
+
nameSaid;
|
|
33067
|
+
/** New name records taken per member, a few a minute (`GROUP_LIMITS.namesPerMember`). In memory only. */
|
|
33068
|
+
namesTaken = /* @__PURE__ */ new Map();
|
|
32562
33069
|
queue = Promise.resolve();
|
|
32563
33070
|
/** One metadata frame that names a commit or an epoch I do not have yet: tried again when the chain moves. */
|
|
32564
33071
|
pendingMeta;
|
|
@@ -32626,6 +33133,7 @@ var GroupSession = class {
|
|
|
32626
33133
|
key: (frame) => frame.t === "group-msg" ? frameKey$1(frame) : frame.t === "group-commit" ? `commit:${frame.commit.e}` : void 0
|
|
32627
33134
|
});
|
|
32628
33135
|
this.provisional = new Set((state.provisional ?? []).slice(-GROUP_LIMITS.provisional));
|
|
33136
|
+
for (const [key, record] of Object.entries(state.names ?? {})) this.nickAt.set(key, record.v);
|
|
32629
33137
|
this.chainMovedAt = this.clock();
|
|
32630
33138
|
}
|
|
32631
33139
|
clock() {
|
|
@@ -32751,23 +33259,19 @@ var GroupSession = class {
|
|
|
32751
33259
|
}
|
|
32752
33260
|
/**
|
|
32753
33261
|
* Whether `key` could read message `messageId` (`<s>:<e>:<n>`) and still can: in the roster now, and in the roster of
|
|
32754
|
-
* its epoch or
|
|
32755
|
-
*
|
|
32756
|
-
*
|
|
32757
|
-
|
|
32758
|
-
|
|
32759
|
-
|
|
32760
|
-
const
|
|
32761
|
-
|
|
33262
|
+
* its epoch, or of an epoch it was said again under (its author was behind, `resealBehind`): `arrived`, the one its
|
|
33263
|
+
* copy reached this device under, or, for a message of mine, one I said it again under. That member read it under its
|
|
33264
|
+
* first id. Decided by the epochs a frame was sealed under, never by comparing two devices' clocks. A holder serves a
|
|
33265
|
+
* group file only to such a member (WISP 503 § Asking).
|
|
33266
|
+
*/
|
|
33267
|
+
couldRead(key, messageId, arrived) {
|
|
33268
|
+
const ref = meshMessageRef(messageId);
|
|
33269
|
+
const then = ref && this.state.chain[ref.e];
|
|
33270
|
+
if (!ref || !then || !rosterHas(this.roster, key)) return false;
|
|
32762
33271
|
if (rosterHas(then.m, key)) return true;
|
|
32763
|
-
|
|
32764
|
-
|
|
32765
|
-
|
|
32766
|
-
const c = this.state.chain[later];
|
|
32767
|
-
if (!c || c.k === "add" && c.ts > ts) break;
|
|
32768
|
-
again = c;
|
|
32769
|
-
}
|
|
32770
|
-
return !!again && rosterHas(again.m, key);
|
|
33272
|
+
const again = ref.s === this.myKey ? this.state.sent.filter((f) => f.o?.e === ref.e && f.o.n === ref.n).map((f) => f.e) : [];
|
|
33273
|
+
if (arrived !== void 0 && arrived > ref.e) again.push(arrived);
|
|
33274
|
+
return again.some((e) => rosterHas(this.state.chain[e]?.m ?? [], key));
|
|
32771
33275
|
}
|
|
32772
33276
|
role(key) {
|
|
32773
33277
|
return this.roster.find(([k]) => k === key)?.[1];
|
|
@@ -33133,11 +33637,19 @@ var GroupSession = class {
|
|
|
33133
33637
|
const epochs = Object.keys(this.state.secrets).map(Number).sort((a, b) => a - b);
|
|
33134
33638
|
for (const e of epochs.slice(0, Math.max(0, epochs.length - GROUP_LIMITS.secrets))) delete this.state.secrets[e];
|
|
33135
33639
|
}
|
|
33136
|
-
/**
|
|
33137
|
-
|
|
33640
|
+
/**
|
|
33641
|
+
* Leaves: my secrets go now; the admin removes me from the roster when it hears. `pick`: whom an admin with other
|
|
33642
|
+
* members hands the role to first, in the same turn. The role can reach me while my leave is under way (a hand-over
|
|
33643
|
+
* said at the same moment, agents#2890): without it the leave is refused, and the role would end with me.
|
|
33644
|
+
*/
|
|
33645
|
+
leave(pick) {
|
|
33138
33646
|
return this.serialize(async () => {
|
|
33139
33647
|
if (this.state.status !== "active") return;
|
|
33140
|
-
if (this.isAdmin && this.others.length)
|
|
33648
|
+
if (this.isAdmin && this.others.length) {
|
|
33649
|
+
const next = pick?.();
|
|
33650
|
+
if (!next || next === this.myKey || !rosterHas(this.roster, next)) throw new Error("Make someone else the admin before leaving");
|
|
33651
|
+
await this.commit("role", next, Date.now());
|
|
33652
|
+
}
|
|
33141
33653
|
const admin = this.admin;
|
|
33142
33654
|
this.out("left", "You left this group");
|
|
33143
33655
|
await this.persist();
|
|
@@ -33148,6 +33660,45 @@ var GroupSession = class {
|
|
|
33148
33660
|
this.hooks.changed();
|
|
33149
33661
|
});
|
|
33150
33662
|
}
|
|
33663
|
+
/**
|
|
33664
|
+
* After I left (WISP 902 § Admission and departure, "A role that reaches a leave"): the next commit of my chain, by the
|
|
33665
|
+
* admin of its tip, that keeps me in the roster. Kept, without its secret, so that my leave follows the role to whoever
|
|
33666
|
+
* holds it now, and a role that names me goes on (`handOnAfterLeave`). True when taken. The commit that takes me out
|
|
33667
|
+
* is the end of the leave, which the engine reads itself.
|
|
33668
|
+
*/
|
|
33669
|
+
followAfterLeave(raw) {
|
|
33670
|
+
return this.serialize(async () => {
|
|
33671
|
+
if (this.state.status !== "left" || !raw || typeof raw !== "object") return false;
|
|
33672
|
+
const frame = raw;
|
|
33673
|
+
if (frame.t !== "group-commit" || frame.g !== this.id) return false;
|
|
33674
|
+
const result = verifyCommit(frame.commit, this.top, this.id);
|
|
33675
|
+
if ("error" in result || !rosterHas(result.commit.m, this.myKey)) return false;
|
|
33676
|
+
this.state.chain.push(result.commit);
|
|
33677
|
+
this.chainMovedAt = this.clock();
|
|
33678
|
+
this.takeLeftMark(result.commit, frame.left);
|
|
33679
|
+
await this.persist();
|
|
33680
|
+
return true;
|
|
33681
|
+
});
|
|
33682
|
+
}
|
|
33683
|
+
/**
|
|
33684
|
+
* After I left, a chain that names me the admin (a hand-over that crossed my leave): the role goes on to
|
|
33685
|
+
* `pick(<the member who handed it to me>)` with a `role` commit of mine, as an admin's leave hands it. Its secret is
|
|
33686
|
+
* sealed to the members as any commit's, and not kept: I am gone. True when it went.
|
|
33687
|
+
*/
|
|
33688
|
+
handOnAfterLeave(pick, now = Date.now()) {
|
|
33689
|
+
return this.serialize(async () => {
|
|
33690
|
+
if (this.state.status !== "left" || this.admin !== this.myKey) return false;
|
|
33691
|
+
const next = pick(this.top.by);
|
|
33692
|
+
if (!next || next === this.myKey || !rosterHas(this.roster, next)) return false;
|
|
33693
|
+
try {
|
|
33694
|
+
await this.commit("role", next, now);
|
|
33695
|
+
} finally {
|
|
33696
|
+
this.state.secrets = {};
|
|
33697
|
+
}
|
|
33698
|
+
await this.persist();
|
|
33699
|
+
return true;
|
|
33700
|
+
});
|
|
33701
|
+
}
|
|
33151
33702
|
/** Told out of band (the admin's contact chat) that I was removed, before or instead of the commit. */
|
|
33152
33703
|
markRemoved() {
|
|
33153
33704
|
return this.serialize(async () => {
|
|
@@ -33438,7 +33989,7 @@ var GroupSession = class {
|
|
|
33438
33989
|
* member it goes to, whose frames for a while may be its answer, a catch-up (never `live`).
|
|
33439
33990
|
*/
|
|
33440
33991
|
syncFrame(ask = [], to) {
|
|
33441
|
-
if (to) this.answering.set(to, this.now() + ANSWER_WINDOW_MS);
|
|
33992
|
+
if (to) this.answering.set(to, this.now() + ANSWER_WINDOW_MS$1);
|
|
33442
33993
|
const have = {};
|
|
33443
33994
|
const miss = {};
|
|
33444
33995
|
for (const [sender, epochs] of Object.entries(this.state.seen)) {
|
|
@@ -33450,6 +34001,7 @@ var GroupSession = class {
|
|
|
33450
34001
|
}
|
|
33451
34002
|
}
|
|
33452
34003
|
const wanted = ask.filter((k) => k !== this.myKey && rosterHas(this.roster, k));
|
|
34004
|
+
this.ownName();
|
|
33453
34005
|
return {
|
|
33454
34006
|
t: "group-sync",
|
|
33455
34007
|
g: this.id,
|
|
@@ -33459,8 +34011,124 @@ var GroupSession = class {
|
|
|
33459
34011
|
secrets: this.readableEpochs,
|
|
33460
34012
|
mt: groupMetaTag(this.state.meta),
|
|
33461
34013
|
...Object.keys(miss).length ? { miss } : {},
|
|
33462
|
-
...wanted.length ? { ask: wanted } : {}
|
|
34014
|
+
...wanted.length ? { ask: wanted } : {},
|
|
34015
|
+
nt: this.namesTag()
|
|
34016
|
+
};
|
|
34017
|
+
}
|
|
34018
|
+
/** Which name records I hold, of members in the roster: a sync whose tag differs is answered with them all. */
|
|
34019
|
+
namesTag() {
|
|
34020
|
+
return sha256Hex(utf8Encode(Object.entries(this.state.names ?? {}).filter(([key]) => rosterHas(this.roster, key)).map(([key, r]) => `${key}.${r.v}`).sort().join(","))).slice(0, 16);
|
|
34021
|
+
}
|
|
34022
|
+
/**
|
|
34023
|
+
* My name record, signed again when the name my app shares changed since, and once after my counters were raised (WISP
|
|
34024
|
+
* 06 § Raised counters): a copy from older state holds the record from before any rename the device it replaces made
|
|
34025
|
+
* since, which every other member holds newer. None while my app shares no name.
|
|
34026
|
+
*/
|
|
34027
|
+
ownName() {
|
|
34028
|
+
const nm = sanitizeNick(this.hooks.nick?.());
|
|
34029
|
+
if (this.state.status !== "active" || nm === void 0) return void 0;
|
|
34030
|
+
const held = this.state.names?.[this.myKey], floor = this.seqFloor();
|
|
34031
|
+
if (held?.nm === nm && (held.nf ?? 0) >= floor) return held;
|
|
34032
|
+
const v = Math.max(this.clock(), (held?.v ?? 0) + 1);
|
|
34033
|
+
const record = {
|
|
34034
|
+
v,
|
|
34035
|
+
nm,
|
|
34036
|
+
sig: toBase64Url(sign(nameSigned(this.id, this.myKey, v, nm), this.identity.seed)),
|
|
34037
|
+
...floor ? { nf: floor } : {}
|
|
34038
|
+
};
|
|
34039
|
+
(this.state.names ??= {})[this.myKey] = record;
|
|
34040
|
+
this.persistSoon();
|
|
34041
|
+
return record;
|
|
34042
|
+
}
|
|
34043
|
+
/** `key`'s record sealed under my current epoch, or none. */
|
|
34044
|
+
nameFrameOf(key, record) {
|
|
34045
|
+
const secret = this.secret(this.epoch);
|
|
34046
|
+
if (!secret) return void 0;
|
|
34047
|
+
const header = {
|
|
34048
|
+
g: this.id,
|
|
34049
|
+
e: this.epoch,
|
|
34050
|
+
k: key,
|
|
34051
|
+
v: record.v
|
|
34052
|
+
};
|
|
34053
|
+
const { n: nn, c } = encryptText(epochKeys(secret, this.id, this.epoch).message, nameAad(header), JSON.stringify({
|
|
34054
|
+
nm: record.nm,
|
|
34055
|
+
sig: record.sig
|
|
34056
|
+
}));
|
|
34057
|
+
return {
|
|
34058
|
+
t: "group-name",
|
|
34059
|
+
...header,
|
|
34060
|
+
nn,
|
|
34061
|
+
c
|
|
34062
|
+
};
|
|
34063
|
+
}
|
|
34064
|
+
/** My name record, for an edge that just opened; none while my app shares no name. */
|
|
34065
|
+
nameFrame() {
|
|
34066
|
+
const record = this.ownName();
|
|
34067
|
+
return record && this.nameFrameOf(this.myKey, record);
|
|
34068
|
+
}
|
|
34069
|
+
/**
|
|
34070
|
+
* On each tick: my name record to every member, once per start and again when the name my app shares changes. Past
|
|
34071
|
+
* 16 members most have no edge with me: hubs pass it on, and whoever holds it hands it over at sync.
|
|
34072
|
+
*/
|
|
34073
|
+
sayName() {
|
|
34074
|
+
return this.serialize(async () => {
|
|
34075
|
+
const record = this.ownName();
|
|
34076
|
+
if (!record || record.v === this.nameSaid) return;
|
|
34077
|
+
const frame = this.nameFrameOf(this.myKey, record);
|
|
34078
|
+
if (!frame) return;
|
|
34079
|
+
this.nameSaid = record.v;
|
|
34080
|
+
for (const key of this.others) this.hooks.send(key, frame);
|
|
34081
|
+
});
|
|
34082
|
+
}
|
|
34083
|
+
/** Every record I hold of members in the roster but `to`, sealed under my current epoch, for a sync whose tag differs from mine. */
|
|
34084
|
+
namesFor(to, theirTag) {
|
|
34085
|
+
if (typeof theirTag !== "string") return [];
|
|
34086
|
+
this.ownName();
|
|
34087
|
+
if (theirTag === this.namesTag()) return [];
|
|
34088
|
+
return Object.entries(this.state.names ?? {}).filter(([key]) => key !== to && rosterHas(this.roster, key)).map(([key, record]) => this.nameFrameOf(key, record)).filter((f) => !!f);
|
|
34089
|
+
}
|
|
34090
|
+
/**
|
|
34091
|
+
* A member's name record, from its edge or handed on: taken when it is newer than the one I hold, both the member and
|
|
34092
|
+
* whoever handed it are in the roster, its box opens and the member's signature holds. Its name shows when it is newer
|
|
34093
|
+
* than the last one a message or an edge said. A few new ones a minute per member; passed on the first time only.
|
|
34094
|
+
*/
|
|
34095
|
+
async receiveName(from, raw) {
|
|
34096
|
+
const frame = readNameFrame(raw);
|
|
34097
|
+
if (!frame || frame.k === this.myKey || !rosterHas(this.roster, from) || !rosterHas(this.roster, frame.k) || frame.e > this.epoch) return;
|
|
34098
|
+
if (frame.v <= (this.state.names?.[frame.k]?.v ?? 0)) return;
|
|
34099
|
+
const secret = this.secret(frame.e);
|
|
34100
|
+
if (!secret) return;
|
|
34101
|
+
const plain = decryptText(epochKeys(secret, this.id, frame.e).message, nameAad(frame), frame.nn, frame.c);
|
|
34102
|
+
if (plain === null) return;
|
|
34103
|
+
let body;
|
|
34104
|
+
try {
|
|
34105
|
+
body = JSON.parse(plain);
|
|
34106
|
+
} catch {
|
|
34107
|
+
return;
|
|
34108
|
+
}
|
|
34109
|
+
if (!body || typeof body !== "object" || typeof body.nm !== "string" || sanitizeNick(body.nm) !== body.nm || !isSignature(body.sig)) return;
|
|
34110
|
+
try {
|
|
34111
|
+
if (!verify(fromBase64Url(body.sig), nameSigned(this.id, frame.k, frame.v, body.nm), publicKeyFromZ32(frame.k))) return;
|
|
34112
|
+
} catch {
|
|
34113
|
+
return;
|
|
34114
|
+
}
|
|
34115
|
+
let taken = this.namesTaken.get(frame.k);
|
|
34116
|
+
if (!taken) this.namesTaken.set(frame.k, taken = new RateWindow(GROUP_LIMITS.namesPerMember, GROUP_LIMITS.syncWindowMs, () => this.clock()));
|
|
34117
|
+
if (!taken.take()) return;
|
|
34118
|
+
(this.state.names ??= {})[frame.k] = {
|
|
34119
|
+
v: frame.v,
|
|
34120
|
+
nm: body.nm,
|
|
34121
|
+
sig: body.sig
|
|
33463
34122
|
};
|
|
34123
|
+
if (frame.v > (this.nickAt.get(frame.k) ?? 0)) {
|
|
34124
|
+
this.nickAt.set(frame.k, frame.v);
|
|
34125
|
+
if (this.state.nicks[frame.k] !== body.nm) {
|
|
34126
|
+
this.state.nicks[frame.k] = body.nm;
|
|
34127
|
+
this.hooks.changed();
|
|
34128
|
+
}
|
|
34129
|
+
}
|
|
34130
|
+
this.persistSoon();
|
|
34131
|
+
this.took(frame);
|
|
33464
34132
|
}
|
|
33465
34133
|
/** Sequence numbers below the highest seen that never arrived, the newest `miss` of them. */
|
|
33466
34134
|
gaps(entry) {
|
|
@@ -33515,6 +34183,9 @@ var GroupSession = class {
|
|
|
33515
34183
|
case "group-bye":
|
|
33516
34184
|
await this.receiveBye(from, raw);
|
|
33517
34185
|
break;
|
|
34186
|
+
case "group-name":
|
|
34187
|
+
await this.receiveName(from, raw);
|
|
34188
|
+
break;
|
|
33518
34189
|
case "group-leave": if (this.isAdmin && this.hooks.adminWork?.() !== false && rosterHas(this.roster, from) && from !== this.myKey) await this.commitUnlessTurnUnconfirmed("remove", from, true);
|
|
33519
34190
|
}
|
|
33520
34191
|
return this.state.status === "active" ? this.passOn : this.state.status === "removed" ? this.passOn.filter((f) => f.t === "group-commit") : [];
|
|
@@ -33677,7 +34348,7 @@ var GroupSession = class {
|
|
|
33677
34348
|
}
|
|
33678
34349
|
const relayed = raw.s !== from;
|
|
33679
34350
|
const now = this.now(), answer = (this.answering.get(from) ?? 0) > now;
|
|
33680
|
-
if (answer) this.answering.set(from, now + ANSWER_WINDOW_MS);
|
|
34351
|
+
if (answer) this.answering.set(from, now + ANSWER_WINDOW_MS$1);
|
|
33681
34352
|
if (relayed && (!rosterHas(this.roster, from) || !this.handsOn(raw.s))) return;
|
|
33682
34353
|
if (this.isDuplicate(raw)) return;
|
|
33683
34354
|
const signedWhole = relayed && this.wholeSigned(raw);
|
|
@@ -33969,7 +34640,7 @@ var GroupSession = class {
|
|
|
33969
34640
|
const raw = frame.commit;
|
|
33970
34641
|
if (!raw || typeof raw !== "object" || !Number.isSafeInteger(raw.e)) return;
|
|
33971
34642
|
const e = raw.e;
|
|
33972
|
-
if (this.awaitsAnswer(from)) this.answering.set(from, this.now() + ANSWER_WINDOW_MS);
|
|
34643
|
+
if (this.awaitsAnswer(from)) this.answering.set(from, this.now() + ANSWER_WINDOW_MS$1);
|
|
33973
34644
|
if (e <= this.epoch) {
|
|
33974
34645
|
const known = this.state.chain[e];
|
|
33975
34646
|
const result = verifyCommit(raw, this.state.chain[e - 1] ?? null, this.id);
|
|
@@ -34037,6 +34708,7 @@ var GroupSession = class {
|
|
|
34037
34708
|
if (sealed) this.takeSecret(commit.e, sealed);
|
|
34038
34709
|
this.pruneSecrets();
|
|
34039
34710
|
this.pruneRelay();
|
|
34711
|
+
for (const key of Object.keys(this.state.names ?? {})) if (!rosterHas(commit.m, key)) delete this.state.names[key];
|
|
34040
34712
|
this.persistSoon();
|
|
34041
34713
|
this.hooks.changed();
|
|
34042
34714
|
await this.replayWaiting();
|
|
@@ -34124,6 +34796,7 @@ var GroupSession = class {
|
|
|
34124
34796
|
const gone = (this.state.relayEdits ?? []).filter((f) => !rosterHas(this.roster, f.s) && readable(f) && !handed?.has(editKey(f)));
|
|
34125
34797
|
answer.push(...gone.slice(-GROUP_LIMITS.handOnEdits));
|
|
34126
34798
|
answer.push(...metas.map((m) => m.frame));
|
|
34799
|
+
answer.push(...this.namesFor(from, frame.nt));
|
|
34127
34800
|
this.handOut(from, answer);
|
|
34128
34801
|
}
|
|
34129
34802
|
/**
|
|
@@ -34195,14 +34868,22 @@ var GroupSession = class {
|
|
|
34195
34868
|
}), now);
|
|
34196
34869
|
});
|
|
34197
34870
|
}
|
|
34198
|
-
/**
|
|
34199
|
-
|
|
34871
|
+
/**
|
|
34872
|
+
* Signs a body under my current commit, keeps it and sends it to every member. Inside `serialize`. Like a commit, only
|
|
34873
|
+
* with admin work on and a good turn read (WISP 06 § Forced takeover): refused otherwise, or, `quiet`, not made.
|
|
34874
|
+
*/
|
|
34875
|
+
async publishMeta(body, now, quiet = false) {
|
|
34876
|
+
const refused = this.hooks.adminWork?.() === false ? new Error(GROUP_ADMIN_OFF_ERROR) : this.hooks.adminTurn && !await this.hooks.adminTurn() ? engineError("groupTurnUnconfirmed") : void 0;
|
|
34877
|
+
if (refused) {
|
|
34878
|
+
if (quiet) return;
|
|
34879
|
+
throw refused;
|
|
34880
|
+
}
|
|
34200
34881
|
const before = this.state.meta;
|
|
34201
34882
|
const meta = signGroupMeta({
|
|
34202
34883
|
g: this.id,
|
|
34203
34884
|
e: this.epoch,
|
|
34204
34885
|
h: commitHash(this.top),
|
|
34205
|
-
r: nextGroupMetaRevision(before, this.epoch),
|
|
34886
|
+
r: nextGroupMetaRevision(before, this.epoch, this.seqFloor()),
|
|
34206
34887
|
ts: now
|
|
34207
34888
|
}, body, this.identity.seed, this.myKey);
|
|
34208
34889
|
this.state.meta = meta;
|
|
@@ -34297,7 +34978,7 @@ var GroupSession = class {
|
|
|
34297
34978
|
const pending = this.pendingMeta;
|
|
34298
34979
|
this.pendingMeta = void 0;
|
|
34299
34980
|
if (pending) await this.receiveMeta(pending.from, pending.frame);
|
|
34300
|
-
if (this.isAdmin && this.state.meta && this.state.meta.by !== this.myKey) await this.publishMeta(this.state.meta.body, this.state.meta.ts);
|
|
34981
|
+
if (this.isAdmin && this.state.meta && this.state.meta.by !== this.myKey) await this.publishMeta(this.state.meta.body, this.state.meta.ts, true);
|
|
34301
34982
|
}
|
|
34302
34983
|
async fork(reason) {
|
|
34303
34984
|
if (this.state.status !== "active") return;
|
|
@@ -34567,6 +35248,8 @@ var COMMUNITY_LIMITS = {
|
|
|
34567
35248
|
replay: 256,
|
|
34568
35249
|
/** Commits in one welcome or chain piece. */
|
|
34569
35250
|
chainPiece: 100,
|
|
35251
|
+
/** Admissions members other than the admin may commit in a row while the admin is away (`memberAdmissions`). */
|
|
35252
|
+
memberAdmissions: 32,
|
|
34570
35253
|
pendingLeaves: 64,
|
|
34571
35254
|
/** Leaves whose mark (`group-left`) is kept, and the epochs one names. */
|
|
34572
35255
|
leftMarks: 64,
|
|
@@ -34593,8 +35276,18 @@ var COMMUNITY_LIMITS = {
|
|
|
34593
35276
|
*/
|
|
34594
35277
|
catchUpSlice: 16,
|
|
34595
35278
|
/** Between two slices, when the member's app cannot say it handled one (`handled` resolves `false`). */
|
|
34596
|
-
catchUpPauseMs: 500
|
|
35279
|
+
catchUpPauseMs: 500,
|
|
35280
|
+
/**
|
|
35281
|
+
* A message a member handed on with its live mark (`lv`, WISP 903 § Relaying) is live here only when the time it says
|
|
35282
|
+
* is at most this long before my clock: the mark is that member's word, and past this it would make a catch-up ring.
|
|
35283
|
+
*/
|
|
35284
|
+
liveMarkMs: 6e5
|
|
34597
35285
|
};
|
|
35286
|
+
/**
|
|
35287
|
+
* After I send a member my sync: how long what comes over its edge may be its answer (a catch-up, never `live`). Each
|
|
35288
|
+
* frame of the answer keeps it open, since it goes a slice at a time. As a private group's.
|
|
35289
|
+
*/
|
|
35290
|
+
var ANSWER_WINDOW_MS = 5e3;
|
|
34598
35291
|
/** What every member should know about who can read what, and what the link does, in the words the apps show. */
|
|
34599
35292
|
var GROUP_READ_NOTE_COMMUNITY = `Anyone with the group's link can join, and any member can let people in. Everyone in the group can read everything sent while they are a member; someone removed cannot read what comes after, someone who joins later cannot read what came before. Members who were away get the last ${COMMUNITY_LIMITS.store} messages from whoever is there when they return.`;
|
|
34600
35293
|
/** A community group's link: `group2/<group id>/<entry key>` (web: `#/join/group2/…`). */
|
|
@@ -34660,6 +35353,23 @@ var ADMIN_ONLY = /* @__PURE__ */ new Set([
|
|
|
34660
35353
|
"rotate",
|
|
34661
35354
|
"link"
|
|
34662
35355
|
]);
|
|
35356
|
+
/**
|
|
35357
|
+
* The admissions signed by members other than `admin` on a branch (`before`: its commits, newest first) since the admin
|
|
35358
|
+
* last let someone in, rotated, changed the link or handed the role on, or since the group began. A removal or a leave
|
|
35359
|
+
* the admin commits does not count as the admin being there: its app commits leaves by itself, and a removal while
|
|
35360
|
+
* the admin clears keys let in would otherwise make room for as many more each time. An admission is a member's
|
|
35361
|
+
* right, and costs nothing: a key nobody holds is as good as anyone's, so without a bound one member could fill the
|
|
35362
|
+
* group to its cap in seconds. `COMMUNITY_LIMITS.memberAdmissions` in a row, then the admin's turn.
|
|
35363
|
+
*/
|
|
35364
|
+
function memberAdmissions(admin, before) {
|
|
35365
|
+
let n = 0;
|
|
35366
|
+
for (const c of before) {
|
|
35367
|
+
if (c.k === "create" || c.k === "role" || c.by === admin && c.k !== "remove" && c.k !== "leave") break;
|
|
35368
|
+
if (c.k === "add") n++;
|
|
35369
|
+
}
|
|
35370
|
+
return n;
|
|
35371
|
+
}
|
|
35372
|
+
var MEMBER_ADMISSIONS_ERROR = "Members can let no one else in until the admin does";
|
|
34663
35373
|
var HASH = /^[a-f0-9]{64}$/;
|
|
34664
35374
|
var TAG = /^[A-Za-z0-9_-]{43}$/;
|
|
34665
35375
|
var SIG = /^[A-Za-z0-9_-]{86}$/;
|
|
@@ -35065,6 +35775,10 @@ var CommunitySession = class CommunitySession {
|
|
|
35065
35775
|
waiting = [];
|
|
35066
35776
|
waitingBytes = 0;
|
|
35067
35777
|
asked = /* @__PURE__ */ new Map();
|
|
35778
|
+
/** Per member: until when what comes over its edge may be its answer to my sync (`ANSWER_WINDOW_MS`). In memory only. */
|
|
35779
|
+
answering = /* @__PURE__ */ new Map();
|
|
35780
|
+
/** The message frames given to `handle` that came live here (`CommunityIncomingMessage.live`): `passOn` marks them. */
|
|
35781
|
+
cameLive = /* @__PURE__ */ new WeakSet();
|
|
35068
35782
|
/** Syncs answered per member, a few a minute (`COMMUNITY_LIMITS.syncAnswers`). In memory only. */
|
|
35069
35783
|
syncsAnswered = /* @__PURE__ */ new Map();
|
|
35070
35784
|
/** Messages taken per author, a few a second (`MessagePace`). In memory only. */
|
|
@@ -35083,6 +35797,8 @@ var CommunitySession = class CommunitySession {
|
|
|
35083
35797
|
pendingMeta;
|
|
35084
35798
|
/** The store's frames the app holds with their messages (`storeKey` → message id): in memory here, not in what is saved. */
|
|
35085
35799
|
onRows = /* @__PURE__ */ new Map();
|
|
35800
|
+
/** The oldest epoch whose seen marks are kept, as of the last `pruneSeen`. In memory only. */
|
|
35801
|
+
seenFrom = -1;
|
|
35086
35802
|
/** `rows`: the frames the app holds with the messages it stored (`CommunityIncomingMessage.frame`). They join the store. */
|
|
35087
35803
|
constructor(state, hooks, rows = []) {
|
|
35088
35804
|
this.hooks = hooks;
|
|
@@ -35097,6 +35813,7 @@ var CommunitySession = class CommunitySession {
|
|
|
35097
35813
|
key: (frame) => frame.t === "group-msg" ? communityMessageId(frame.s, frame.e, frame.h, frame.n) : frame.t === "group-commit" ? `commit:${communityCommitHash(frame.commit)}` : frame.t === "group-secret" ? `secret:${frame.h}` : void 0
|
|
35098
35814
|
});
|
|
35099
35815
|
this.rebuild();
|
|
35816
|
+
this.pruneSeen();
|
|
35100
35817
|
if ((state.status === "active" || state.status === "lost") && this.bestBranch().tip !== this.topHash) this.serialize(() => this.chooseBranch());
|
|
35101
35818
|
}
|
|
35102
35819
|
static create(name, now = Date.now()) {
|
|
@@ -35584,7 +36301,7 @@ var CommunitySession = class CommunitySession {
|
|
|
35584
36301
|
this.state.chain.forEach((c, i) => counts.push((i ? counts[i - 1] : 0) + (ADMIN_ONLY.has(c.k) ? 1 : 0)));
|
|
35585
36302
|
return counts;
|
|
35586
36303
|
}
|
|
35587
|
-
/** What each of two branches holds after their common parent: whether it has an admin change,
|
|
36304
|
+
/** What each of two branches holds after their common parent: whether it has an admin change, its first commit, and its hand-overs. */
|
|
35588
36305
|
parting(a, b, counts) {
|
|
35589
36306
|
const m = Math.min(a.fork, b.fork);
|
|
35590
36307
|
let shared = 0;
|
|
@@ -35592,34 +36309,73 @@ var CommunitySession = class CommunitySession {
|
|
|
35592
36309
|
const parent = shared ? this.known.get(a.path[shared - 1]).e : this.state.chain[m].e;
|
|
35593
36310
|
const side = (x) => {
|
|
35594
36311
|
const path = x.path.slice(shared);
|
|
36312
|
+
const admin = counts[x.fork] - counts[m] > 0 || path.some((h) => ADMIN_ONLY.has(this.known.get(h).k));
|
|
35595
36313
|
return {
|
|
35596
|
-
admin
|
|
35597
|
-
first: x.fork > m ? communityCommitHash(this.state.chain[m + 1]) : path[0] ?? ""
|
|
36314
|
+
admin,
|
|
36315
|
+
first: x.fork > m ? communityCommitHash(this.state.chain[m + 1]) : path[0] ?? "",
|
|
36316
|
+
roles: !admin ? [] : [...this.state.chain.slice(m + 1, x.fork + 1).filter((c) => c.k === "role").map((c) => communityCommitHash(c)), ...path.filter((h) => this.known.get(h).k === "role")]
|
|
35598
36317
|
};
|
|
35599
36318
|
};
|
|
35600
36319
|
const sa = side(a), sb = side(b);
|
|
35601
36320
|
return {
|
|
35602
36321
|
parent,
|
|
35603
36322
|
admin: [sa.admin, sb.admin],
|
|
35604
|
-
first: [sa.first, sb.first]
|
|
36323
|
+
first: [sa.first, sb.first],
|
|
36324
|
+
roles: [sa.roles, sb.roles]
|
|
35605
36325
|
};
|
|
35606
36326
|
}
|
|
35607
36327
|
/**
|
|
35608
|
-
*
|
|
35609
|
-
*
|
|
35610
|
-
*
|
|
35611
|
-
*
|
|
36328
|
+
* Whether a hand-over (`h`, a `role`) went to a member whose leave of that admission I know on a branch that does not
|
|
36329
|
+
* hold the hand-over: signed on a view from before the leave, it would leave the role with someone gone for good (a
|
|
36330
|
+
* leave never names the admin). Not when that member signed a commit after the hand-over: it took the role while still
|
|
36331
|
+
* in, so its leave came later, and a branch from before the hand-over must not undo what it and later admins did.
|
|
36332
|
+
*/
|
|
36333
|
+
handedToLeaver(h) {
|
|
36334
|
+
const role = this.known.get(h), at = this.mainIndex.get(h), fork = this.branch(h)?.fork;
|
|
36335
|
+
if (fork === void 0 || this.signedAfter(h, role.s)) return false;
|
|
36336
|
+
return [...at === void 0 ? this.state.chain.slice(fork + 1) : [], ...this.state.side].some((c) => {
|
|
36337
|
+
if (c.k !== "leave" || c.s !== role.s) return false;
|
|
36338
|
+
const b = this.branch(communityCommitHash(c));
|
|
36339
|
+
if (!b || (at !== void 0 ? b.fork >= at : b.path.includes(h))) return false;
|
|
36340
|
+
return leaveStands(c, this.ancestry(role.p));
|
|
36341
|
+
});
|
|
36342
|
+
}
|
|
36343
|
+
/** Whether `key` signed a commit I know that comes after `h` (on the main branch past it, or on a side branch through it). */
|
|
36344
|
+
signedAfter(h, key) {
|
|
36345
|
+
const at = this.mainIndex.get(h);
|
|
36346
|
+
if (!key) return false;
|
|
36347
|
+
if (at !== void 0 && this.state.chain.slice(at + 1).some((c) => c.by === key)) return true;
|
|
36348
|
+
return this.state.side.some((c) => {
|
|
36349
|
+
if (c.by !== key) return false;
|
|
36350
|
+
const b = this.branch(communityCommitHash(c));
|
|
36351
|
+
return !!b && (at !== void 0 ? b.fork >= at : b.path.includes(h));
|
|
36352
|
+
});
|
|
36353
|
+
}
|
|
36354
|
+
/**
|
|
36355
|
+
* Is branch `a` better than branch `b`? After their common parent: first, the one that does not hand the
|
|
36356
|
+
* role to a member who left (`handedToLeaver`); then the one that keeps an admin change, however short
|
|
36357
|
+
* and however far back it parts; then one I can read over one whose tip lists me and whose secret I lack;
|
|
36358
|
+
* then the longer; then, parting within the window, the lower hash of the first commit. Both holding admin changes means the admin signed two histories: `b` stays (a fresh one
|
|
36359
|
+
* halts the group, see `receiveCommit`).
|
|
35612
36360
|
*/
|
|
35613
36361
|
better(a, b, counts) {
|
|
35614
36362
|
if (a.tip === b.tip) return false;
|
|
35615
|
-
const { parent, admin, first } = this.parting(a, b, counts);
|
|
36363
|
+
const { parent, admin, first, roles } = this.parting(a, b, counts);
|
|
36364
|
+
const toLeaver = roles.map((r) => r.some((h) => this.handedToLeaver(h)));
|
|
36365
|
+
if (toLeaver[0] !== toLeaver[1]) return toLeaver[1];
|
|
35616
36366
|
if (admin[0] !== admin[1]) return admin[0];
|
|
35617
36367
|
if (admin[0]) return false;
|
|
36368
|
+
const wa = this.awaitsSecret(a.tip), wb = this.awaitsSecret(b.tip);
|
|
36369
|
+
if (wa !== wb) return wb;
|
|
35618
36370
|
const ea = this.known.get(a.tip).e, eb = this.known.get(b.tip).e;
|
|
35619
36371
|
if (ea !== eb) return ea > eb;
|
|
35620
36372
|
if (parent < this.epoch - COMMUNITY_LIMITS.window) return false;
|
|
35621
36373
|
return first[0] < first[1];
|
|
35622
36374
|
}
|
|
36375
|
+
/** A commit whose roster lists me and whose secret I do not hold (yet). */
|
|
36376
|
+
awaitsSecret(h) {
|
|
36377
|
+
return !this.state.secrets[h] && rosterHas(this.rosterAt(h) ?? [], this.myKey);
|
|
36378
|
+
}
|
|
35623
36379
|
/**
|
|
35624
36380
|
* Takes in a commit (from a frame or from me): placed in the tree if it verifies against its
|
|
35625
36381
|
* parent, a fork if the admin signed another commit after the same parent, and then the best
|
|
@@ -35657,6 +36413,8 @@ var CommunitySession = class CommunitySession {
|
|
|
35657
36413
|
if (!confirmationMatches(epochKeys(derivedSecret(fromBase64Url(previous), untagged), this.id, result.commit.e).confirm, untagged, result.commit.c)) return false;
|
|
35658
36414
|
}
|
|
35659
36415
|
if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
|
|
36416
|
+
const parentAdmin = rosterAdmin(parentRoster);
|
|
36417
|
+
if (result.commit.k === "add" && result.commit.by !== parentAdmin && memberAdmissions(parentAdmin, this.ancestry(p)) >= COMMUNITY_LIMITS.memberAdmissions) return false;
|
|
35660
36418
|
const commit = result.commit, h = communityCommitHash(commit);
|
|
35661
36419
|
const admin = rosterAdmin(parentRoster);
|
|
35662
36420
|
if (commit.by === admin) {
|
|
@@ -35674,7 +36432,7 @@ var CommunitySession = class CommunitySession {
|
|
|
35674
36432
|
if (branch && branch.path.length) {
|
|
35675
36433
|
const { admin } = this.parting(branch, this.branch(this.topHash), this.adminCounts());
|
|
35676
36434
|
if (ADMIN_ONLY.has(commit.k) && admin[1]) {
|
|
35677
|
-
if (commit.by !== this.admin) {
|
|
36435
|
+
if (commit.by !== this.admin || commit.k === "role" && this.handedToLeaver(h)) {
|
|
35678
36436
|
this.known.delete(h);
|
|
35679
36437
|
this.rosters.delete(h);
|
|
35680
36438
|
return false;
|
|
@@ -35830,6 +36588,22 @@ var CommunitySession = class CommunitySession {
|
|
|
35830
36588
|
}
|
|
35831
36589
|
}
|
|
35832
36590
|
this.pruneSecrets();
|
|
36591
|
+
this.pruneSeen();
|
|
36592
|
+
}
|
|
36593
|
+
/**
|
|
36594
|
+
* Seen marks of epochs older than the window go, every sender's, once the branch I follow moves past them: as
|
|
36595
|
+
* `markSeen` drops the sender's it marks. Before, only that sender's went, so a member who left or went quiet kept
|
|
36596
|
+
* an entry for every epoch it wrote in, and its window of numbers, for the life of the group (agents#2904). Those
|
|
36597
|
+
* within the window stay, a leaver's too: what it wrote before its leave is still taken up to its mark there.
|
|
36598
|
+
*/
|
|
36599
|
+
pruneSeen() {
|
|
36600
|
+
const from = this.epoch - COMMUNITY_LIMITS.window;
|
|
36601
|
+
if (from === this.seenFrom) return;
|
|
36602
|
+
this.seenFrom = from;
|
|
36603
|
+
for (const [sender, bySender] of Object.entries(this.state.seen)) {
|
|
36604
|
+
for (const key of Object.keys(bySender)) if (Number(key.split(":")[0]) < from) delete bySender[key];
|
|
36605
|
+
if (!Object.keys(bySender).length) delete this.state.seen[sender];
|
|
36606
|
+
}
|
|
35833
36607
|
}
|
|
35834
36608
|
pruneSecrets() {
|
|
35835
36609
|
const order = [...this.state.chain.slice(-COMMUNITY_LIMITS.window - 1), ...this.state.side].map((c) => communityCommitHash(c));
|
|
@@ -35934,6 +36708,7 @@ var CommunitySession = class CommunitySession {
|
|
|
35934
36708
|
const roster = communityRoster(this.roster, draftBase);
|
|
35935
36709
|
if (!roster || kind === "leave" && !leaveStands(draftBase, this.ancestry(parentHash))) throw new Error("This change is not allowed");
|
|
35936
36710
|
if (GROWS.has(kind) && !keepsRoom(draftBase.e, roster)) throw new Error("This group has reached its membership history limit. Create a new group.");
|
|
36711
|
+
if (kind === "add" && !this.isAdmin && memberAdmissions(this.admin, this.ancestry(parentHash)) >= COMMUNITY_LIMITS.memberAdmissions) throw new Error(MEMBER_ADMISSIONS_ERROR);
|
|
35937
36712
|
const draft = {
|
|
35938
36713
|
...draftBase,
|
|
35939
36714
|
m: rosterHash(roster)
|
|
@@ -36054,12 +36829,49 @@ var CommunitySession = class CommunitySession {
|
|
|
36054
36829
|
});
|
|
36055
36830
|
return frames;
|
|
36056
36831
|
}
|
|
36057
|
-
|
|
36058
|
-
|
|
36832
|
+
/**
|
|
36833
|
+
* Takes a member out, and with it everyone it let in who is still in, and whom those let in in turn
|
|
36834
|
+
* (`admittedThrough`): keys a member let in cost it nothing, and one by one they were the admin's to clear. A
|
|
36835
|
+
* `remove` commit each, as before (an app from before follows them), one at a time, so what arrives meanwhile is
|
|
36836
|
+
* heard, and an admission signed meanwhile by one of them is taken out too (`memberAdmissions` bounds them, as a
|
|
36837
|
+
* removal is not the admin letting anyone in). A member already out still has those it let in cleared.
|
|
36838
|
+
*/
|
|
36839
|
+
async remove(memberKey, now = Date.now()) {
|
|
36840
|
+
for (let first = true;; first = false) if (await this.serialize(async () => {
|
|
36059
36841
|
this.requireAdmin();
|
|
36060
|
-
if (
|
|
36061
|
-
|
|
36062
|
-
|
|
36842
|
+
if (memberKey === this.myKey) throw new Error("Not a member");
|
|
36843
|
+
const next = rosterHas(this.roster, memberKey) ? memberKey : this.admittedThrough(memberKey)[0];
|
|
36844
|
+
if (next === void 0) {
|
|
36845
|
+
if (first) throw new Error("Not a member");
|
|
36846
|
+
return true;
|
|
36847
|
+
}
|
|
36848
|
+
await this.commit("remove", { s: next }, now);
|
|
36849
|
+
return false;
|
|
36850
|
+
})) return;
|
|
36851
|
+
}
|
|
36852
|
+
/**
|
|
36853
|
+
* The members still in whose admission, on the main branch, `root` signed, or one of them did, and so on: in the
|
|
36854
|
+
* order they were let in. An admission signed by whoever was the admin then is the admin's, not counted: removing
|
|
36855
|
+
* a former admin does not take out everyone it let in. Never the admin nor me.
|
|
36856
|
+
*/
|
|
36857
|
+
admittedThrough(root) {
|
|
36858
|
+
const by = /* @__PURE__ */ new Map();
|
|
36859
|
+
let admin = "";
|
|
36860
|
+
for (const c of this.state.chain) if (c.k === "create") admin = c.by;
|
|
36861
|
+
else if (c.k === "role" && c.s) admin = c.s;
|
|
36862
|
+
else if (c.k === "add" && c.s) {
|
|
36863
|
+
by.delete(c.s);
|
|
36864
|
+
if (c.by !== admin) by.set(c.s, c.by);
|
|
36865
|
+
}
|
|
36866
|
+
const through = /* @__PURE__ */ new Set([root]);
|
|
36867
|
+
for (let grew = true; grew;) {
|
|
36868
|
+
grew = false;
|
|
36869
|
+
for (const [key, signer] of by) if (!through.has(key) && through.has(signer)) {
|
|
36870
|
+
through.add(key);
|
|
36871
|
+
grew = true;
|
|
36872
|
+
}
|
|
36873
|
+
}
|
|
36874
|
+
return [...by.keys()].filter((key) => key !== root && through.has(key) && key !== this.myKey && key !== this.admin && rosterHas(this.roster, key));
|
|
36063
36875
|
}
|
|
36064
36876
|
transferAdmin(memberKey, now = Date.now()) {
|
|
36065
36877
|
return this.serialize(async () => {
|
|
@@ -36153,11 +36965,21 @@ var CommunitySession = class CommunitySession {
|
|
|
36153
36965
|
return done;
|
|
36154
36966
|
});
|
|
36155
36967
|
}
|
|
36156
|
-
/**
|
|
36968
|
+
/**
|
|
36969
|
+
* Signs and says how far I had heard a member whose leave I just committed (`group-left`): per epoch, up to the first
|
|
36970
|
+
* number of my window of it I never heard, so a copy of the leaver's state cannot sign one later into the gap. A gap
|
|
36971
|
+
* at the window's bottom (a jump past it, or a counter raised by a restore) leaves the epoch out: nothing of it then.
|
|
36972
|
+
*/
|
|
36157
36973
|
markLeft(h, leaver) {
|
|
36158
36974
|
const hi = {};
|
|
36159
36975
|
const heard = Object.entries(this.state.seen[leaver] ?? {}).filter(([k]) => LEFT_EPOCH.test(k)).slice(-COMMUNITY_LIMITS.leftMarks);
|
|
36160
|
-
for (const [k, entry] of heard)
|
|
36976
|
+
for (const [k, entry] of heard) {
|
|
36977
|
+
const bottom = Math.max(0, entry.high - COMMUNITY_LIMITS.replay + 1);
|
|
36978
|
+
let n = bottom;
|
|
36979
|
+
while (n < entry.high && entry.window.includes(n)) n++;
|
|
36980
|
+
const top = n === entry.high ? n : n - 1;
|
|
36981
|
+
if (top >= bottom) hi[k] = top;
|
|
36982
|
+
}
|
|
36161
36983
|
const sig = toBase64Url(sign(leftStatement(this.id, h, hi), this.identity.seed));
|
|
36162
36984
|
this.keepLeft(h, {
|
|
36163
36985
|
hi,
|
|
@@ -36240,14 +37062,20 @@ var CommunitySession = class CommunitySession {
|
|
|
36240
37062
|
/**
|
|
36241
37063
|
* An application frame to everyone in the group (a note about a payment, a request anyone may pay): sealed to
|
|
36242
37064
|
* the epoch like text, signed, kept and caught up like text, and handed to the other members' `app` hook
|
|
36243
|
-
* instead of their history.
|
|
37065
|
+
* instead of their history. A fleeting one (`CommunitySessionHooks.fleeting`) is only said to those up now.
|
|
36244
37066
|
*/
|
|
36245
37067
|
sendApp(frame, nick, now = Date.now()) {
|
|
36246
37068
|
return this.serialize(async () => {
|
|
36247
37069
|
if (!this.isMember) return { error: this.state.statusReason ?? "You are not in this group" };
|
|
36248
37070
|
if (!isObject$5(frame) || utf8Encode(JSON.stringify(frame)).length > COMMUNITY_LIMITS.appBytes) return { error: "Too large for the group" };
|
|
36249
|
-
const
|
|
37071
|
+
const fleeting = this.hooks.fleeting?.(frame) === true;
|
|
37072
|
+
const sent = await this.sendPayload(() => ({ x: frame }), nick, now, !fleeting);
|
|
36250
37073
|
if ("error" in sent) return sent;
|
|
37074
|
+
if (fleeting) {
|
|
37075
|
+
await this.persist();
|
|
37076
|
+
this.hooks.broadcast(sent.frame);
|
|
37077
|
+
return { id: sent.id };
|
|
37078
|
+
}
|
|
36251
37079
|
this.keepLasting({
|
|
36252
37080
|
id: sent.id,
|
|
36253
37081
|
sender: this.myKey,
|
|
@@ -36330,7 +37158,7 @@ var CommunitySession = class CommunitySession {
|
|
|
36330
37158
|
});
|
|
36331
37159
|
}
|
|
36332
37160
|
/** Seals, signs and keeps a frame under the current epoch (the caller holds the queue, persists and broadcasts). */
|
|
36333
|
-
async sendPayload(body, nick, now) {
|
|
37161
|
+
async sendPayload(body, nick, now, kept = true) {
|
|
36334
37162
|
const h = this.topHash, secret = this.state.secrets[h];
|
|
36335
37163
|
if (!secret) return { error: "This epoch's key has not arrived yet. Wait for a member to catch you up." };
|
|
36336
37164
|
if (this.state.seqH !== h) {
|
|
@@ -36366,7 +37194,7 @@ var CommunitySession = class CommunitySession {
|
|
|
36366
37194
|
sig: toBase64Url(sign(messageSigned(unsigned), this.identity.seed))
|
|
36367
37195
|
};
|
|
36368
37196
|
this.markSeen(frame);
|
|
36369
|
-
this.keep(frame);
|
|
37197
|
+
if (kept) this.keep(frame);
|
|
36370
37198
|
return {
|
|
36371
37199
|
id: communityMessageId(this.myKey, header.e, header.h, n),
|
|
36372
37200
|
frame
|
|
@@ -36585,7 +37413,11 @@ var CommunitySession = class CommunitySession {
|
|
|
36585
37413
|
* what was left of the first from its start: a member back after 256 messages was handed 288 (2026-10-14).
|
|
36586
37414
|
*/
|
|
36587
37415
|
syncFrame(to) {
|
|
36588
|
-
if (to)
|
|
37416
|
+
if (to) {
|
|
37417
|
+
const now = this.hooks.clock?.() ?? Date.now();
|
|
37418
|
+
this.asked.set(to, now);
|
|
37419
|
+
this.answering.set(to, now + ANSWER_WINDOW_MS);
|
|
37420
|
+
}
|
|
36589
37421
|
const have = {};
|
|
36590
37422
|
const recent = new Set(this.state.store.map((f) => seenKey(f.e, f.h)));
|
|
36591
37423
|
for (const [sender, byKey] of Object.entries(this.state.seen)) for (const [key, entry] of Object.entries(byKey)) {
|
|
@@ -36620,6 +37452,8 @@ var CommunitySession = class CommunitySession {
|
|
|
36620
37452
|
if (!raw || typeof raw !== "object") return false;
|
|
36621
37453
|
const frame = raw;
|
|
36622
37454
|
if (frame.g !== this.id || frame.v !== 2) return false;
|
|
37455
|
+
const now = this.hooks.clock?.() ?? Date.now();
|
|
37456
|
+
if ((this.answering.get(from) ?? 0) > now) this.answering.set(from, now + ANSWER_WINDOW_MS);
|
|
36623
37457
|
if (this.state.status !== "active" && !(this.state.status === "lost" && (frame.t === "group-commit" || frame.t === "group-secret" || frame.t === "group-secrets"))) return false;
|
|
36624
37458
|
switch (frame.t) {
|
|
36625
37459
|
case "group-msg": return this.receiveMessage(from, raw);
|
|
@@ -36627,22 +37461,14 @@ var CommunitySession = class CommunitySession {
|
|
|
36627
37461
|
case "group-secret": {
|
|
36628
37462
|
if (frame.to !== this.myKey || typeof frame.h !== "string") return false;
|
|
36629
37463
|
const took = this.takeSecret(frame.h, frame.s);
|
|
36630
|
-
if (took)
|
|
36631
|
-
this.persistSoon();
|
|
36632
|
-
this.hooks.changed();
|
|
36633
|
-
await this.replayWaiting();
|
|
36634
|
-
}
|
|
37464
|
+
if (took) await this.tookSecrets();
|
|
36635
37465
|
return took;
|
|
36636
37466
|
}
|
|
36637
37467
|
case "group-secrets": {
|
|
36638
37468
|
if (!Array.isArray(frame.secrets) || frame.secrets.length > COMMUNITY_LIMITS.secrets) return false;
|
|
36639
37469
|
let took = false;
|
|
36640
37470
|
for (const entry of frame.secrets) if (entry && typeof entry.h === "string") took = this.takeSecret(entry.h, entry.s) || took;
|
|
36641
|
-
if (took)
|
|
36642
|
-
this.persistSoon();
|
|
36643
|
-
this.hooks.changed();
|
|
36644
|
-
await this.replayWaiting();
|
|
36645
|
-
}
|
|
37471
|
+
if (took) await this.tookSecrets();
|
|
36646
37472
|
return false;
|
|
36647
37473
|
}
|
|
36648
37474
|
case "group-sync":
|
|
@@ -36661,6 +37487,16 @@ var CommunitySession = class CommunitySession {
|
|
|
36661
37487
|
}
|
|
36662
37488
|
});
|
|
36663
37489
|
}
|
|
37490
|
+
/** After a secret came that confirms: a branch that waited for it may be the one to follow now (see `better`). */
|
|
37491
|
+
async tookSecrets() {
|
|
37492
|
+
if (this.bestBranch().tip !== this.topHash) {
|
|
37493
|
+
await this.chooseBranch();
|
|
37494
|
+
return;
|
|
37495
|
+
}
|
|
37496
|
+
this.persistSoon();
|
|
37497
|
+
this.hooks.changed();
|
|
37498
|
+
await this.replayWaiting();
|
|
37499
|
+
}
|
|
36664
37500
|
receiveLeave(frame) {
|
|
36665
37501
|
const s = frame.s, ls = frame.ls;
|
|
36666
37502
|
if (typeof s !== "string" || !MEMBER_KEY.test(s) || typeof ls !== "string" || !SIG.test(ls) || !rosterHas(this.roster, s)) return false;
|
|
@@ -36689,12 +37525,31 @@ var CommunitySession = class CommunitySession {
|
|
|
36689
37525
|
this.persistSoon();
|
|
36690
37526
|
return true;
|
|
36691
37527
|
}
|
|
36692
|
-
|
|
36693
|
-
|
|
37528
|
+
/**
|
|
37529
|
+
* What a hub hands on of a frame it took (`handle` said it was new): as it came, without the live mark of whoever
|
|
37530
|
+
* handed it to me, and with mine when it came live here (WISP 903 § Relaying, revision 2026-11-03). Hand it on at
|
|
37531
|
+
* once: the mark says it is passed on as it came.
|
|
37532
|
+
*/
|
|
37533
|
+
passOn(frame) {
|
|
37534
|
+
if (frame.t !== "group-msg") return frame;
|
|
37535
|
+
const { lv: _mark, ...rest } = frame;
|
|
37536
|
+
return this.cameLive.has(frame) ? {
|
|
37537
|
+
...rest,
|
|
37538
|
+
lv: this.myKey
|
|
37539
|
+
} : rest;
|
|
37540
|
+
}
|
|
37541
|
+
/** `waited`: it waited for a commit or a secret (`replayWaiting`), so it is not live. */
|
|
37542
|
+
async receiveMessage(from, input, waited = false) {
|
|
37543
|
+
if (!isMessageFrame(input)) return false;
|
|
37544
|
+
const { lv: mark, ...unmarked } = input;
|
|
37545
|
+
const raw = unmarked;
|
|
36694
37546
|
if (raw.s === this.myKey) {
|
|
36695
37547
|
this.ownFrame(raw);
|
|
36696
37548
|
return false;
|
|
36697
37549
|
}
|
|
37550
|
+
const now = this.hooks.clock?.() ?? Date.now();
|
|
37551
|
+
const live = !waited && (raw.s === from ? (this.answering.get(from) ?? 0) <= now : mark === from && rosterHas(this.roster, from) && now - raw.ts <= COMMUNITY_LIMITS.liveMarkMs);
|
|
37552
|
+
if (live) this.cameLive.add(input);
|
|
36698
37553
|
if (this.isDuplicate(raw)) return false;
|
|
36699
37554
|
if (!verify(fromBase64Url(raw.sig), messageSigned(raw), publicKeyFromZ32(raw.s))) return false;
|
|
36700
37555
|
if (!this.heardAfterOut(raw)) return false;
|
|
@@ -36766,7 +37621,7 @@ var CommunitySession = class CommunitySession {
|
|
|
36766
37621
|
this.state.nicks[raw.s] = nick;
|
|
36767
37622
|
this.hooks.changed();
|
|
36768
37623
|
}
|
|
36769
|
-
let onRow = false;
|
|
37624
|
+
let onRow = false, fleeting = false;
|
|
36770
37625
|
if (text !== void 0) {
|
|
36771
37626
|
const mentions = validMentions(parsed.m, text, false);
|
|
36772
37627
|
const reply = parsed.r === void 0 ? void 0 : readReply(parsed.r, groupReplyAuthor);
|
|
@@ -36785,7 +37640,8 @@ var CommunitySession = class CommunitySession {
|
|
|
36785
37640
|
...forwarded ? { forwarded } : {},
|
|
36786
37641
|
...card ? { card } : {},
|
|
36787
37642
|
...file ? { file } : {},
|
|
36788
|
-
frame: raw
|
|
37643
|
+
frame: raw,
|
|
37644
|
+
...live ? { live: true } : {}
|
|
36789
37645
|
});
|
|
36790
37646
|
} else if (isObject$5(parsed.x)) {
|
|
36791
37647
|
const app = {
|
|
@@ -36795,7 +37651,8 @@ var CommunitySession = class CommunitySession {
|
|
|
36795
37651
|
timestamp: raw.ts,
|
|
36796
37652
|
frame: parsed.x
|
|
36797
37653
|
};
|
|
36798
|
-
this.
|
|
37654
|
+
fleeting = this.hooks.fleeting?.(parsed.x) === true;
|
|
37655
|
+
if (!fleeting) this.keepLasting(app, raw);
|
|
36799
37656
|
await this.hooks.app?.(app);
|
|
36800
37657
|
} else {
|
|
36801
37658
|
const box = parsed.p;
|
|
@@ -36820,7 +37677,7 @@ var CommunitySession = class CommunitySession {
|
|
|
36820
37677
|
...raw,
|
|
36821
37678
|
...original
|
|
36822
37679
|
});
|
|
36823
|
-
this.keep(raw);
|
|
37680
|
+
if (!fleeting) this.keep(raw);
|
|
36824
37681
|
if (onRow === true) this.onRows.set(storeKey(raw), id);
|
|
36825
37682
|
this.persistSoon();
|
|
36826
37683
|
return true;
|
|
@@ -36891,6 +37748,7 @@ var CommunitySession = class CommunitySession {
|
|
|
36891
37748
|
const now = this.hooks.clock?.() ?? Date.now();
|
|
36892
37749
|
if (now - (this.asked.get(from) ?? 0) < 5e3) return null;
|
|
36893
37750
|
this.asked.set(from, now);
|
|
37751
|
+
this.answering.set(from, now + ANSWER_WINDOW_MS);
|
|
36894
37752
|
return this.syncFrame();
|
|
36895
37753
|
}
|
|
36896
37754
|
async replayWaiting() {
|
|
@@ -36902,7 +37760,7 @@ var CommunitySession = class CommunitySession {
|
|
|
36902
37760
|
if (!ready.length) return;
|
|
36903
37761
|
this.waiting = this.waiting.filter((w) => !ready.includes(w));
|
|
36904
37762
|
this.waitingBytes = this.waiting.reduce((sum, w) => sum + w.frame.c.length, 0);
|
|
36905
|
-
for (const { from, frame } of ready) await this.receiveMessage(from, frame);
|
|
37763
|
+
for (const { from, frame } of ready) await this.receiveMessage(from, frame, true);
|
|
36906
37764
|
}
|
|
36907
37765
|
async receiveSync(from, frame) {
|
|
36908
37766
|
if (!isZ32Key(from) || !Number.isSafeInteger(frame.e) || typeof frame.h !== "string") return;
|
|
@@ -37107,14 +37965,23 @@ var CommunitySession = class CommunitySession {
|
|
|
37107
37965
|
if (body !== this.state.meta?.body) await this.publishMeta(body, now);
|
|
37108
37966
|
});
|
|
37109
37967
|
}
|
|
37110
|
-
/**
|
|
37111
|
-
|
|
37968
|
+
/**
|
|
37969
|
+
* Signs a body under my current commit, keeps it and sends it to everyone (hubs relay it). Inside `serialize`. Like a
|
|
37970
|
+
* commit, only with admin work on and a good turn read (WISP 06 § Forced takeover): refused otherwise, or, `quiet`,
|
|
37971
|
+
* not made. Its revision is never under the floor (WISP 06 § Raised counters).
|
|
37972
|
+
*/
|
|
37973
|
+
async publishMeta(body, now, quiet = false) {
|
|
37974
|
+
const refused = !this.adminWork ? new Error(GROUP_ADMIN_OFF_ERROR) : this.hooks.adminTurn && !await this.hooks.adminTurn() ? engineError("groupTurnUnconfirmed") : void 0;
|
|
37975
|
+
if (refused) {
|
|
37976
|
+
if (quiet) return;
|
|
37977
|
+
throw refused;
|
|
37978
|
+
}
|
|
37112
37979
|
const before = this.state.meta;
|
|
37113
37980
|
const meta = signGroupMeta({
|
|
37114
37981
|
g: this.id,
|
|
37115
37982
|
e: this.epoch,
|
|
37116
37983
|
h: this.topHash,
|
|
37117
|
-
r: nextGroupMetaRevision(before, this.epoch),
|
|
37984
|
+
r: nextGroupMetaRevision(before, this.epoch, this.hooks.seqFloor?.()),
|
|
37118
37985
|
ts: now
|
|
37119
37986
|
}, body, this.identity.seed, this.myKey);
|
|
37120
37987
|
this.state.meta = meta;
|
|
@@ -37215,7 +38082,7 @@ var CommunitySession = class CommunitySession {
|
|
|
37215
38082
|
this.pendingMeta = void 0;
|
|
37216
38083
|
if (pending && await this.receiveMeta(pending.from, pending.frame)) this.hooks.relay?.(pending.frame);
|
|
37217
38084
|
const meta = this.state.meta;
|
|
37218
|
-
if (this.isAdmin && meta && (meta.by !== this.myKey || !this.mainIndex.has(meta.h))) await this.publishMeta(meta.body, meta.ts);
|
|
38085
|
+
if (this.isAdmin && meta && (meta.by !== this.myKey || !this.mainIndex.has(meta.h))) await this.publishMeta(meta.body, meta.ts, true);
|
|
37219
38086
|
}
|
|
37220
38087
|
async fork(reason) {
|
|
37221
38088
|
if (this.state.status !== "active") return;
|
|
@@ -37358,7 +38225,6 @@ var APP_STORE_LIMITS = {
|
|
|
37358
38225
|
};
|
|
37359
38226
|
var APP_STORE_KINDS = ["curated", "indexed"];
|
|
37360
38227
|
var isObject$4 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
37361
|
-
var isLine = (v, max, min = 0) => typeof v === "string" && [...v].length >= min && [...v].length <= max && !/\p{Cc}/u.test(v);
|
|
37362
38228
|
var isText$1 = (v, max) => typeof v === "string" && [...v].length <= max && !/[^\P{Cc}\n]/u.test(v);
|
|
37363
38229
|
var isCount = (v, min) => typeof v === "number" && Number.isSafeInteger(v) && v >= min;
|
|
37364
38230
|
var fine = { ok: true };
|
|
@@ -37415,13 +38281,13 @@ function checkAppListing(value, options = {}) {
|
|
|
37415
38281
|
if (!isAppHash(value.digest)) return bad("digest");
|
|
37416
38282
|
const urls = value.urls;
|
|
37417
38283
|
if (!Array.isArray(urls) || urls.length < 1 || urls.length > APP_STORE_LIMITS.urls || !urls.every(isAppUrl)) return bad("urls");
|
|
37418
|
-
if (!
|
|
37419
|
-
if (!
|
|
38284
|
+
if (!isAppLine(value.title, APP_STORE_LIMITS.title, 1)) return bad("title");
|
|
38285
|
+
if (!isAppLine(value.tagline, APP_STORE_LIMITS.tagline, 1)) return bad("tagline");
|
|
37420
38286
|
for (const k of [
|
|
37421
38287
|
"category",
|
|
37422
38288
|
"developer",
|
|
37423
38289
|
"submitter"
|
|
37424
|
-
]) if (value[k] !== void 0 && !
|
|
38290
|
+
]) if (value[k] !== void 0 && !isAppLine(value[k], APP_STORE_LIMITS.label, 1)) return bad(k);
|
|
37425
38291
|
for (const k of ["repo", "support"]) if (value[k] !== void 0 && !isAppUrl(value[k])) return bad(k);
|
|
37426
38292
|
return fine;
|
|
37427
38293
|
}
|
|
@@ -37497,7 +38363,7 @@ function checkRemoval(value, options) {
|
|
|
37497
38363
|
"at"
|
|
37498
38364
|
], [], options);
|
|
37499
38365
|
if (!keys.ok) return keys;
|
|
37500
|
-
if (!isAppRef(value.ref) || !isAppHash(value.digest) || !
|
|
38366
|
+
if (!isAppRef(value.ref) || !isAppHash(value.digest) || !isAppLine(value.reason, APP_STORE_LIMITS.reason, 1) || !isCount(value.at, 0)) return {
|
|
37501
38367
|
ok: false,
|
|
37502
38368
|
reason: "bad-field",
|
|
37503
38369
|
detail: "removed: not {ref, digest, reason, at}"
|
|
@@ -37555,7 +38421,7 @@ function* checkAppStoreFieldsSteps(value, options = {}) {
|
|
|
37555
38421
|
detail: field
|
|
37556
38422
|
});
|
|
37557
38423
|
if (!isAppKey(value.key)) return bad("key");
|
|
37558
|
-
if (!
|
|
38424
|
+
if (!isAppLine(value.name, APP_STORE_LIMITS.name, 1)) return bad("name");
|
|
37559
38425
|
if (value.description !== void 0 && !isText$1(value.description, APP_STORE_LIMITS.description)) return bad("description");
|
|
37560
38426
|
if (!APP_STORE_KINDS.includes(value.kind)) return bad("kind");
|
|
37561
38427
|
if (!isCount(value.sequence, 1)) return bad("sequence");
|
|
@@ -38510,6 +39376,6 @@ function x401ApprovalDigest(subject) {
|
|
|
38510
39376
|
return toBase64Url(sha256(utf8Encode(canonical)));
|
|
38511
39377
|
}
|
|
38512
39378
|
//#endregion
|
|
38513
|
-
export { COMMUNITY_LIMITS as $, createRelayPayload as $C, turnSequence as $S, HANDOFF_WINDOW as $_, DEMOTE_MS as $a, readAppSignature as $b, APP_RANGE_LIMITS as $c, rankTransports as $d, MAX_REMOVAL_NUMBER as $f, contactRtcConfig as $g, OFFER_LOOK_MS as $h, isSparkAddress as $i, HOLD_CAPABILITY as $l, GROUP_PROFILE as $m, MessageRefusal as $n, SIGNAL_HOLD_MS as $o, BUTTON_STYLES as $p, DidError as $r, TYPING_TIMEOUT_MS as $s, GROUP_EDIT_TEXT_BYTES as $t, IDENTITY_PROOF_CAPABILITY as $u, setUpdateFrame as $v, deviceEchoFrame as $x, knockHolds as $y, readX401ProofResponseHeader as A, WATCH_SHARE as AC, TURN_REV_LIMIT as AS, HANDOFF_ATTEMPTS as A_, findBolt11 as Aa, isAppPath as Ab, WAKE_TTL_SECONDS as Ac, proofCapability as Ad, formatVoiceDuration as Af, decodeChunk as Ag, CONNECT_TIMEOUT_MS as Ah, jwkThumbprint as Ai, APPS_CAPABILITY as Al, shownTime as Am, parseGroupMetaBody as An, engineError as Ao, ReactionWindow as Ap, parseAtprotoDidDocument as Ar, validHead as As, knockRecords as At, CAPS_ISSUED_BACK_MS as Au, newHandoffId as Av, stripHidden as Aw, INVITE_HRP as Ax, inboxRecord as Ay, APP_STORE_KINDS as B, BREAKER_BASE_MS as BC, openTurnValue as BS, HANDOFF_HELLO as B_, withoutVideoMetadata as Ba, appFingerprint as Bb, wakeRequest as Bc, ringAuthorization as Bd, VIDEO_LIMITS as Bf, buildDataSdp as Bg, DIRECT_PEERS as Bh, TEST_USDT_FAUCET_AMOUNT as Bi, SERVICES_CAPABILITY as Bl, SAID_AGAIN as Bm, SSH_PUBLIC_KEY_MAX as Bn, groupFileFallback as Bo, readReaction as Bp, parseAtprotoDidKey as Br, decodeFileData as Bs, groupWakes as Bt, dialDescriptors as Bu, readHandoffManifest as Bv, toBase64 as Bw, inviteLink as Bx, LINK_RECORD_LABEL as By, buildX401TokenObject as C, RelayTransport as CC, TOMBSTONE_TURN as CS, isValidServiceId as C_, parseInvoiceCallback as Ca, appDigest as Cb, DEVICE_WAKE_TTL_SECONDS as Cc, PeerProofs as Cd, PLAYABLE_AUDIO as Cf, viewerResponseHeaders as Cg, ratchetOn as Ch, decodeDidDhtPacket as Ci, appDataFrame as Cl, taskProgress as Cm, groupMetaPicture as Cn, WAKE_LOST_MS as Co, readForwarded as Cp, ATPROTO_PROOF_SCOPE as Cr, newerHead as Cs, KNOCK_TTL_MS as Ct, parseDomainTxt as Cu, handoffRequestFrame as Cv, MAX_AVATAR_SIDE as Cw, DEVICE_INVITE_OWN_DEVICE as Cx, MAX_DONE as Cy, readX401ProofRequest as D, SLOW_DEMOTE_MS as DC, TURN_MAX as DS, servicesToWire as D_, resolveLightningDestination as Da, checkAppManifest as Db, WAKE_FRAME as Dc, importedProof as Dd, baseMime as Df, LIMITS as Dg, ratchetSessionOf as Dh, didDhtRecords as Di, isChatAppId as Dl, claimedTime as Dm, keepPastGroupMeta as Dn, publishFailure as Do, REACTED_FRAME as Dp, checkAtprotoProofRecord as Dr, readBeaconHead as Ds, entryParams as Dt, txtValue as Du, handoffVerifiedMessage as Dv, hasVisible as Dw, encodeDeviceInvite as Dx, REOPEN_BELOW as Dy, isX401Protocol as E, SIGNALING_WINDOW_MS as EC, TURN_LAST_SEQUENCE as ES, servicesFromWire as E_, requestLnurlInvoice as Ea, buildAppBundle as Eb, WAKE_CALL_WAIT_MS as Ec, emptyProofLedger as Ed, VOICE_METER as Ef, CHUNK_KIND as Eg, ratchetSeal as Eh, didDhtKey as Ei, isAppVersion as El, arrivalKey as Em, groupName as En, parsePaymentNetworks as Eo, QUICK_REACTIONS as Ep, atprotoProofRkey as Er, readBeacon as Es, encodeGroupEntryLink as Et, recordsName as Eu, handoffVerifiedFrame as Ev, MAX_NICK_LENGTH as Ew, deviceInviteJoinerParams as Ex, NEW_PER_HOUR as Ey, appRevocationFor as F, readRelayBody as FC, TURN_VERSION as FS, HANDOFF_DATA as F_, isFederationId as Fa, sha256Paced as Fb, readWake as Fc, storageProofPath as Fd, voiceFileName as Ff, wrapDataChannel as Fg, OFFER_HOST_GATHER_MS as Fh, EVM_TEST_CHAINS as Fi, FILES_BINARY_CAPABILITY as Fl, LEGACY_GROUP_MEMBERS as Fm, verifyGroupMetaSignature as Fn, GROUP_HAVE_FRAME as Fo, reactedFrame as Fp, decodeAtprotoCommit as Fr, ChatFiles as Fs, GROUP_WAKE_GROUP_WINDOW_MS as Ft, CapsExchange as Fu, readHandoffData as Fv, fromBase64 as Fw, createChatInvite as Fx, turnOff as Fy, readAppStore as G, budgetRetryMs as GC, signTurnPacket as GS, HANDOFF_PAKE as G_, withoutPictureMetadata as Ga, checkAppRevokeStatement as Gb, encryptPushPayload as Gc, verifyRingEvidence as Gd, EDITED_FRAME as Gf, CALL_SIGNAL_MAX_AGE_MS as Gg, DEPARTED_READ_MS as Gh, assertWholeSats as Gi, UPGRADE_CAPABILITY as Gl, rememberAlone as Gm, sshFingerprint as Gn, readGroupWantNo as Go, REPLY_LIMITS as Gp, verifyAtprotoSignature as Gr, transferStalled as Gs, GROUP_READ_NOTE as Gt, IDENTITY_CHECK_UNAVAILABLE as Gu, sameDigest as Gv, __commonJSMin as Gw, pastedAgain as Gx, REQUEST_LIFETIME_MS as Gy, checkAppListing as H, BREAKER_THRESHOLD as HC, readTurnPacket as HS, HANDOFF_LIST_PER_FRAME as H_, PICTURE_METADATA_LIMITS as Ha, appRefPublisher as Hb, WebPushError as Hc, ringEvidence as Hd, isPlayableVideoType as Hf, offerIsFresh as Hg, directBlocked as Hh, WALLET_NETWORKS as Hi, STATUS_CARD_CAPABILITY as Hl, commitUntaggedHash as Hm, parseSshPublicKey as Hn, readGroupFileMeta as Ho, wireReaction as Hp, readAtprotoCid as Hr, refusalText as Hs, parseGroupWakeFrame as Ht, encodePacketTransports as Hu, readHandoffRelease as Hv, toZ32 as Hw, inviteQrSegments as Hx, MAX_SLOT_KNOCKS as Hy, appStoreDecision as I, relayUrlProblem as IC, TurnRecordError as IS, HANDOFF_DONE as I_, parseCashuRequestPayload as Ia, yieldThread as Ib, readWakePayload as Ic, validExternalKey as Id, voiceLevel as If, DATA_CHANNEL_ID as Ig, REANSWERS as Ih, ONCHAIN_PROVIDER as Ii, FILES_CAPABILITY as Il, MAX_GROUP_CHAIN as Im, wrapGroupMeta as In, GROUP_VERSION_FILES as Io, reactionEmoji as Ip, decodeDagCbor as Ir, FILE_DATA_KIND as Is, GROUP_WAKE_MEMBER_INTERVAL_MS as It, CapsKeys as Iu, readHandoffDone as Iv, fromBase64Url as Iw, createLink as Ix, CONTACT_RECORD_TTL as Iy, GROUP_TYPING_FRAME as J, withRequestOptions as JC, turnKeys as JS, HANDOFF_RELEASE as J_, BLOCKED_DIAL_WAIT_MS as Ja, isAppRef as Jb, vapidAuthorization as Jc, TRANSPORTS as Jd, EDIT_FRAME as Jf, answersOffer as Jg, FIRST_PUBLISH_MAX_MS as Jh, parsePaymentAmount as Ji, sessionCapabilitiesFrame as Jl, signCommit as Jm, verifySshSignature as Jn, GROUP_SIGNAL_FRAME as Jo, readReply as Jp, DID_GHOSTLY_SERVICE as Jr, TYPING_RATE_LIMIT as Js, chainPieces as Jt, IDENTITY_FRAME_WINDOW_MS as Ju, SET_ACK as Jv, __require as Jw, DEVICE_CAPABILITIES as Jx, REQUEST_TEXT_BYTES as Jy, readAppStoreSteps as K, heldBackError as KC, signTurnRelease as KS, HANDOFF_PIECE_BYTES as K_, ANSWERS_REFUSED_PAUSES as Ka, isAppHash as Kb, generateVapidKeys as Kc, RELAY_URL as Kd, EDIT_BUFFER_MAX as Kf, PAIRED_CALL_CANDIDATES as Kg, DHT_POLL_INTERVALS as Kh, formatPaymentAmount as Ki, WAKE_SESSION_CAPABILITY as Kl, rosterAdmin as Km, sshKeyDigestHex as Kn, CARRIED_DEFER_MS as Ko, groupReplyAuthor as Kp, DID_DOCUMENT_MAX_BYTES as Kr, TYPING_FRAME as Ks, GroupSession as Kt, IDENTITY_CLOCK_SKEW as Ku, sealHandoffPiece as Kv, __esmMin as Kw, readInviteCode as Kx, REQUEST_NAME_UNITS as Ky, appUpdateDecision as L, setLinkTraceSink as LC, encodeTurnFields as LS, HANDOFF_FILE_MISSING as L_, parseFedimintRequestPayload as La, APP_NAME as Lb, relayRequest as Lc, verifyNostrProof as Ld, voiceLevelsOf as Lf, DATA_CHANNEL_LABEL as Lg, STALLED_EVIDENCE_MS as Lh, PaymentPreflightError as Li, KNOWN_SESSION_CAPABILITIES as Ll, MAX_GROUP_MEMBERS as Lm, SSHSIG_MAX_ARMOR as Ln, GROUP_WANT_FRAME as Lo, reactionFrame as Lp, encodeDagCbor as Lr, FILE_FRAMES as Ls, GROUP_WAKE_RECEIVE_LIMIT as Lt, CapsRefusedError as Lu, readHandoffFileFrame as Lv, fromZ32 as Lw, decodeInviteCode as Lx, ContactRequestError as Ly, readX401ProofResultHeader as M, WRITE_FIRST_MS as MC, TURN_SIGNED_BYTES as MS, HANDOFF_BUSY_REASONS as M_, cashuRequestPayload as Ma, pacer as Mb, deviceWakeRequest as Mc, proofStatement as Md, parseVoiceMeta as Mf, encodeChunk as Mg, DataLink as Mh, resolveDidDht as Mi, BUTTONS_CAPABILITY as Ml, GROUP_ID as Mm, parseGroupMetaStatement as Mn, parseEngineError as Mo, parseReactedFrame as Mp, AtprotoCid as Mr, PAIRED_CALL_FRAME as Ms, readKnocks as Mt, CAPS_LIMITS as Mu, readHandoffAck as Mv, unwrapPasted as Mw, INVITE_MAX_LENGTH as Mx, planKnocks as My, x401AnswerableRequests as N, currentRelays as NC, TURN_SLOTS as NS, HANDOFF_CANCEL as N_, fedimintRequestPayload as Na, readAppBundle as Nb, newWakeToken as Nc, storageProof as Nd, recordingMime as Nf, encodeControl as Ng, GATHER_ATTEMPTS as Nh, signDidDhtPacket as Ni, CALLS_CAPABILITY as Nl, GROUP_MEMBER_CAP as Nm, parseGroupMetaTag as Nn, PairingTracker as No, parseReactionFrame as Np, AtprotoProofError as Nr, PairedCalls as Ns, GROUP_WAKE_FRAME as Nt, CAPS_PUBLISH_SPACING_MS as Nu, readHandoffBusy as Nv, bytesEqual as Nw, INVITE_VERSION as Nx, settleRequest as Ny, readX401ProofRequestHeader as O, SLOW_MS as OC, TURN_NAME_BYTES as OS, viewerTag as O_, BOLT11_PATTERN as Oa, findAppForbiddenKey as Ob, WAKE_INTERVAL_MS as Oc, isProofAdapter as Od, downsamplePeaks as Of, MAX_CHUNK_PAYLOAD_BYTES as Og, ratchetUnknownSession as Oh, encodeDidDhtDeactivated as Oi, parseAppFrame as Ol, heardTime as Om, nextGroupMetaRevision as On, ENGINE_ERRORS as Oo, REACTION_FRAME as Op, isAtprotoDid as Or, readLobby as Os, groupEntryUrl as Ot, validDomainRecord as Ou, handoffVersions as Ov, sanitizeDisplayText as Ow, readDeviceInvite as Ox, clearMissed as Oy, addedAppPermissions as P, normalizeRelayUrl as PC, TURN_TTL as PS, HANDOFF_CANCEL_REASONS as P_, findEndpoint as Pa, readAppBundleAsync as Pb, parseWakeFrame as Pc, storageProofBody as Pd, voiceDownloadName as Pf, sendBody as Pg, GATHER_STALL_MS as Ph, ETHEREUM_USDT as Pi, EDIT_CAPABILITY as Pl, GROUP_VERSION_LARGE as Pm, signGroupMeta as Pn, GROUP_FILE_LIMITS as Po, queueReaction as Pp, atprotoCidFor as Pr, parsePairedCallFrame as Ps, GROUP_WAKE_GROUP_LIMIT as Pt, CAPS_REFRESH_MS as Pu, readHandoffCancel as Pv, concatBytes as Pw, OwnInviteError as Px, takeRequest as Py, sealGroupTyping as Q, RELAY_PAYLOAD_MAX_BYTES as QC, turnReleaseMessage as QS, HANDOFF_VERSION as Q_, DEMOTE_AFTER_FAILURES as Qa, readAppRevocations as Qb, APP_RANGE_FRAMES as Qc, irohRelayUrl as Qd, MAX_EDITS_PER_MESSAGE as Qf, compressSdp as Qg, OFFER_FAST_MS as Qh, SPARK_PROVIDER as Qi, SESSION_RECEIVE_PENDING as Ql, verifyCommitSignature as Qm, BIP322_REVISION as Qn, SIGNAL_FRESH_MS as Qo, BUTTON_ID as Qp, DID_METHODS as Qr, TYPING_STATUS_MAX as Qs, GROUP_EDIT_FRAME as Qt, IDENTITY_MAX_VALIDITY as Qu, setAckFrame as Qv, HANDOFF_CAPABILITY as Qx, contactDay as Qy, checkAppBeforeRun as R, traceLink as RC, firstDeviceSetSecret as RS, HANDOFF_FILE_REQUEST as R_, NO_VIDEO_METADATA as Ra, APP_PREFIXES as Rb, wakeFrame as Rc, verifyPeerProof as Rd, voicePeaksOf as Rf, RTC_SIGNAL_FUTURE_MS as Rg, DIRECT_EVIDENCE_MS as Rh, SEPOLIA_TEST_USDT as Ri, PIN_CAPABILITY as Rl, MEMBER_KEY as Rm, SSHSIG_NAMESPACE as Rn, GROUP_WANT_NO_FRAME as Ro, reactionIsNewer as Rp, findInMst as Rr, FILE_LIMITS as Rs, GroupWakeLimiter as Rt, DHT_TEXT_CAPABILITY as Ru, readHandoffHave as Rv, isZ32Key as Rw, encodeGhostlyInvite as Rx, KNOCK_SLOTS as Ry, buildX401ResultArtifact as S, REQUESTS_PER_MINUTE as SC, TOMBSTONE_SEQUENCE as SS, encodeServices as S_, invoiceCallbackUrl as Sa, APP_VIEWS as Sb, readPin as Sc, PROOF_CAPABILITY as Sd, sanitizeMime as Sf, sanitizeResponseHeaders as Sg, ratchetHeard as Sh, DidDhtError as Si, appDataBytes as Sl, statusCardText as Sm, groupMetaNewer as Sn, WAKE_ANSWER_GRACE_MS as So, forwardedMany as Sp, ATPROTO_PROOF_COLLECTION as Sr, mergeLobby as Ss, GROUP_ENTRY_PROFILE as St, normalizeDomain as Su, handoffReleaseFrame as Sv, MAX_AVATAR_LENGTH as Sw, DEVICE_INVITE_LIFETIME_S as Sx, FLOOD_PER_DAY as Sy, encodeX401Header as T, SIGNALING_ALLOWANCE_SHARE as TC, TURN_LABEL as TS, serviceIdFromName as T_, parsePayParams as Ta, assembleAppBundle as Tb, WAKE_CALL_TTL_SECONDS as Tc, STORAGE_ROOT as Td, VOICE_LIMITS as Tf, CHUNK_FLAG_END as Tg, ratchetRoot as Th, didDhtFromPublicKey as Ti, chatAppId as Tl, MESSAGE_CLOCK_SKEW_MS as Tm, groupMetaToHand as Tn, pairedMessageFrame as To, GROUP_REACTION_FRAME as Tp, atprotoProofRecord as Tr, rankHubs as Ts, decodeGroupEntryLink as Tt, recordsFromWellKnown as Tu, handoffStreamKey as Tv, sanitizeAvatar as Tw, deviceInviteJoinerKeyZ32 as Tx, MAX_WAITING as Ty, checkAppStoreIndex as U, RelayBreaker as UC, sealTurnBody as US, HANDOFF_MANIFEST as U_, isStrippedPicture as Ua, appRevocationId as Ub, checkPushEndpoint as Uc, validRingKey as Ud, isVideoMime as Uf, parseRtcSignal as Ug, symmetricNat as Uh, arkAddressPrefix as Ui, SessionCapabilities as Ul, expectedRoster as Um, parseSshSignature as Un, readGroupHave as Uo, PAIRED_REPLY_AUTHORS as Up, unsignedCommitBytes as Ur, sentWhole as Us, GROUP_LIMITS as Ut, parsePacketTransports as Uu, readHandoffTurnFrame as Uv, utf8Decode as Uw, inviteQrText as Ux, REQUEST_CLOCK_SKEW_MS as Uy, APP_STORE_LIMITS as V, BREAKER_MAX_MS as VC, readTurnBody as VS, HANDOFF_LATER_BYTES as V_, NO_PICTURE_METADATA as Va, appRef as Vb, PUSH_SERVICE_HOSTS as Vc, ringClaims as Vd, formatVideoDuration as Vf, extractRtcParams as Vg, DirectPathWatch as Vh, USDT_PUBLIC_RPC as Vi, SESSION_CAPABILITIES_FRAME as Vl, commitHash as Vm, SshSigError as Vn, isGroupMessageId as Vo, validReactionNumber as Vp, parseAtprotoVerificationKey as Vr, encodeFileData as Vs, mentionedMembers as Vt, emptyCapsState as Vu, readHandoffPake as Vv, toBase64Url as Vw, inviteOwnership as Vx, MAX_SEEN as Vy, readAppListing as W, DiscoveryBudgetError as WC, signTurnBody as WS, HANDOFF_OFFER as W_, stripPictureMetadata as Wa, appSignedBytes as Wb, decryptPushPayload as Wc, verifyRingAuthorization as Wd, parseVideoMeta as Wf, CALL_SIGNAL_FUTURE_MS as Wg, AWAITING_PEER_MS as Wh, assertTokenUnits as Wi, TYPING_CAPABILITY as Wl, parseGroupCommit as Wm, sameSshKey as Wn, readGroupWant as Wo, REPLY_ID as Wp, verifyAtprotoRecordProof as Wr, transferEnded as Ws, GROUP_REACTED_FRAME as Wt, IDENTITY_CHALLENGE_WINDOW as Wu, readHandoffVerified as Wv, utf8Encode as Ww, ownInviteRefusal as Wx, REQUEST_LABEL as Wy, groupTypingEpoch as X, PKARR_FUTURE_SKEW_MS as XC, turnPacket as XS, HANDOFF_TIMINGS as X_, CROSSED_PROBE_MS as Xa, readAppRevocation as Xb, APP_RANGE_DATA_KIND as Xc, checkedDescriptors as Xd, EDIT_RECEIVE_LIMIT as Xf, callRtcConfig as Xg, LinkSession as Xh, walletNetworkOf as Xi, PairedSession as Xl, verifyChain as Xm, legacyMessageHash as Xn, SIGNALS_PER_MINUTE as Xo, wireReply as Xp, DID_JWS_MAX_LENGTH as Xr, TYPING_REFRESH_MS as Xs, groupMessageId as Xt, IDENTITY_MAX_FRAME as Xu, encodeSetSlots as Xv, DEVICE_PING_FRAME as Xx, STAMP_BITS_MAX as Xy, GroupTypingBoard as Y, MAX_DNS_PACKET_BYTES as YC, turnName as YS, HANDOFF_REQUEST as Y_, CROSSED_FRESH_MS as Ya, isAppSignature as Yb, vapidKeysMatch as Yc, automaticTransport as Yd, EDIT_RATE_WINDOW_MS as Yf, buildSdpFromSignal as Yg, IDLE_THRESHOLD as Yh, validatePaymentTarget as Yi, PAIRED_PROFILE as Yl, sortRoster as Ym, isLegacySignature as Yn, GROUP_VERSION_SIGNALS as Yo, replySnippet as Yp, DID_JWS_ALGS as Yr, TYPING_RATE_WINDOW_MS as Ys, frameBytes as Yt, IDENTITY_MAX_EVIDENCE as Yu, SET_UPDATE as Yv, __toCommonJS as Yw, DEVICE_ECHO_FRAME as Yx, STAMP_BITS_DEFAULT as Yy, openGroupTyping as Z, PacketTooLargeError as ZC, turnPayloadSequence as ZS, HANDOFF_VERIFIED as Z_, CROSSED_WAIT_MS as Za, readAppRevocationShape as Zb, APP_RANGE_ERRORS as Zc, irohDescriptor as Zd, EDIT_SEND_LIMIT as Zf, callSignalHeardAt as Zg, MAX_DHT_TEXT_BYTES as Zh, SPARK_NETWORKS as Zi, SESSION_FRAME_MAX as Zl, verifyCommit as Zm, verifyBitcoinMessage as Zn, SIGNAL_CARRIERS as Zo, ACTIVE_TASK_STATUSES as Zp, DID_MAX_LENGTH as Zr, TYPING_SEND_LIMIT as Zs, COMMUNITY_EDIT_FRAME as Zt, IDENTITY_MAX_RECEIVED as Zu, readSetUpdate as Zv, ENROLL_CAPABILITY as Zx, STAMP_BITS_MIN as Zy, X401_PROTOCOLS as _, GROUP_SIGNALING_ALLOWANCE_SHARE as _C, TURN_SETTLE_MS as _S, HTTP_SERVICE_PROTO as __, pubkyHomeserverOf as _a, APP_CLIENT_NAME as _b, parsePinnedFrame as _c, verifyIdentityPresentation as _d, FileTransfers as _f, formatLocalTarget as _g, RATCHET_KEEP_MS as _h, strictBase64Url as _i, APP_RESUME_GRACE_MS as _l, checkStatusCard as _m, MAX_GROUP_PICTURE_LENGTH as _n, REDESCRIBED_GRACE_MS as _o, parseLinkPreview as _p, u32$1 as _r, freshHubs as _s, shortHash as _t, domainTxtRecord as _u, handoffHaveFrames as _v, decrypt as _w, CONTACT_LINK_VERSION as _x, enrollProofFrame as _y, X401_DCQL_LIMITS as a, BACKGROUND_WRITES_SHARE as aC, deviceLinkRendezvousSeed as aS, parseCallSignal as a_, PUBKY_PROOF_MAX_BYTES as aa, makeStampPaced as ab, typingActivity as ac, IdentityExchange as ad, DHT_FILE_TOO_LARGE as af, STALLED_LOOK_MS as ag, epochKeys as ah, didWebDocumentUrl as ai, appRangeErrorFrame as al, ROUTINE_STATES as am, validEditText as an, INVITER_DIAL_GRACE_MS as ao, parseEditFrame as ap, BitcoinAddressError as ar, MESH_HUBS as as, communityHasFrame as at, newMailbox as au, handoffAttemptFailed as av, signRelayPayload as aw, verifyAppStatementBytes as ax, ENROLL_CANCEL_REASONS as ay, buildX401ProofRequest as b, PREVIOUS_DEFAULT_RELAYS as bC, keptAtEqualSequence as bS, SERVICES_VERSION as b_, fetchLnurlJson as ba, APP_PERMISSIONS as bb, pinNumberHolds as bc, lastSharedWithMe as bd, safeBlobType as bf, resolveTargetUrl as bg, emptyRatchetState as bh, DID_DHT_TTL as bi, AppSessions as bl, sameButtonText as bm, groupMetaBody as bn, SWITCH_RETIRE_MS as bo, FORWARD_LIMITS as bp, ATPROTO_DECLARED_SCOPE as br, lobbyRecords as bs, verifyCommunityChainPaced as bt, isPublicAddress as bu, handoffOfferFrame as bv, sealedLength as bw, readContactLink as bx, readEnrollHello as by, readX401DcqlQuery as c, CHAT_RESERVE_PER_CHAT as cC, devicePingFrame as cS, signalHasVideo as c_, isPubkyProofFolder as ca, readKnockSlot as cb, COMMUNITY_PIN_FRAME as cc, identityPresentationBytes as cd, DHT_TEXT_REFUSED as cf, UNUSED_INVITE_UPKEEP_MS as cg, openSecret as ch, didWebFileUrl as ci, encodeAppRangeData as cl, TASK_STATUSES as cm, mentionsBytes as cn, LIVENESS_PING_MS as co, validEditNumber as cp, decodeAnyBitcoinAddress as cr, meshHubs as cs, communityUntaggedHash as ct, DNS_TYPE as cu, handoffCancelFrame as cv, encodeTxtPacket as cw, imageSize as cx, ENROLL_HELLO as cy, newX401HolderKey as d, DEPARTED_READS as dC, unsignedDeviceTransports as dS, MAX_MSGS_PAYLOAD_B64 as d_, pubkyProofCapability as da, requestRecords as db, PIN_CLOCK_SKEW_MS as dc, identityStatementText as dd, emptyDhtDeliveryState as df, countUnusedInvite as dg, sha256Hex as dh, parseDid as di, readAppRangeFrame as dl, buttonLabelClash as dm, wireMentions as dn, PAIRING_ATTEMPT_MS as do, LINK_PREVIEW_LIMITS as dp, decodeWitness as dr, pickMeshHubs as ds, encodeCommunityLink as dt, DOMAIN_METHODS as du, handoffDataFrame as dv, createIdentity as dw, previewable as dx, enrollCancelReason as dy, turnSignedMessage as eC, deviceEchoNonce as eS, decompressSdp as e_, sparkAddressKind as ea, knockSlotIdentity as eb, TypingReceiver as ec, IDENTITY_PROVIDER_ID as ed, relayUrl as ef, OFFER_STEP_MAX as eg, confirmationMatches as eh, checkDidJws as ei, AppRanges as el, CRON_LINE as em, carryMentions as en, DHT_PIN_GRACE_MS as eo, REMOVED_TEXT as ep, bip322MessageHash as er, SIGNAL_PROVEN_MS as es, COMMUNITY_PROFILE as et, HOLD_DATED_BACK_MS as eu, NO_ATTEMPTS as ev, measureRecords as ew, setAppSignatureFastPath as ex, setUpdateMessage as ey, readX401SdJwtVc as f, FRESH_READ_MS as fC, verifyDeviceTransports as fS, RECORD_TTL as f_, pubkyProofFile as fa, seenEntry as fb, PIN_FRAME as fc, isIdentityBinding as fd, peekDhtMailbox as ff, presenceSeenAt as fg, FOLLOW_MS as fh, parseDidDocument as fi, APP_DATA_MAX_BYTES as fl, cardEditNumber as fm, GROUP_META_PAST as fn, PAIRING_RETRY_MS as fo, LINK_TRAILING as fp, encodeTx as fr, wireHubPolicy as fs, leaveStands as ft, DOMAIN_TXT_MAX_BYTES as fu, handoffDigest as fv, identityFromSeed as fw, readImageMeta as fx, enrollDigits as fy, X401_LIMITS as g, GROUP_RATION_WINDOW_MS as gC, TURN_RAISE_READ_TIMEOUT_MS as gS, parseLinkRecords as g_, homeserverWebEndpoint as ga, APP_CLIENTS as gb, parsePinFrame as gc, signIdentityPresentation as gd, readDhtFile as gf, HttpHost as gg, RATCHET_HEADER_BYTES as gh, staticDidDocument as gi, APP_RATE_WINDOW_MS as gl, cardUrl as gm, MAX_GROUP_NAME_LENGTH as gn, RACE_RELAYED_MS as go, linksIn as gp, txHash as gr, doorHubs as gs, rosterHash as gt, dnsProofName as gu, handoffFileRequestFrame as gv, verify as gw, CONTACT_LINK_BYTES as gx, enrollMessage as gy, X401_HEADERS as h, GROUP_OVER_PACE_MS as hC, TURN_PUT_WINDOW_MS as hS, isEmptyLinkPacket as h_, encodeSvcbPacket as ha, APP_BUNDLE_MAGIC as hb, nextPinNumber as hc, revokesIdentity as hd, dhtFileId as hf, HttpClient as hg, RATCHET_CAPABILITY as hh, signingKeys as hi, APP_RATE_LIMIT as hl, cardTimeUtc as hm, MAX_GROUP_NAME_BYTES as hn, RACE_DIRECT_MS as ho, linkStop as hp, sha256d as hr, beaconRecords as hs, leftStatement as ht, decodeDnsResponse as hu, handoffFileMissingFrame as hv, sign as hw, readCanonicalJson as hx, enrollHelloFrame as hy, x401ApprovalDigest as i, BACKGROUND_WHILE_SIGNALING as iC, deviceLinkParams as iS, keepsToRelays as i_, isBitcoinAddress as ia, makeStamp as ib, sanitizeTypingStatus as ic, IdentityCheckUnavailable as id, DHT_FILE_REFUSED as if, SIGNAL_OUT_READS as ig, encryptText as ih, didSignedMessages as ii, appRangeEndFrame as il, REMOVABLE_KINDS as im, parseCommunityEdit as in, HANDLED_WAIT_MS as io, editedFrame as ip, verifyBip322 as ir, GROUP_VERSION_HUBS as is, communityGroupId as it, isHoldUrl as iu, handoffAttemptAllowed as iv, readOwnRelayPayload as iw, verifyAppSignature as ix, ENROLL_CANCEL as iy, readX401ProofResult as j, WAY_BACK_SHARE as jC, TURN_SEALED_BYTES as jS, HANDOFF_BUSY as j_, ENDPOINT as ja, isAppUrl as jb, WakeLimiter as jc, proofHash as jd, isPlayableAudioType as jf, decodeControl as jg, DATA_SETTLE_MS as jh, openDidDhtPayload as ji, APP_RANGES_CAPABILITY as jl, GROUP_ADMIN_OFF_ERROR as jm, parseGroupMetaFrame as jn, engineText as jo, nextReactionNumber as jp, shortAtprotoDid as jr, MAX_PAIRED_CALL_SIGNAL as js, mergeKnocks as jt, CAPS_LABEL as ju, openHandoffPiece as jv, trimEndOf as jw, INVITE_LINK_ORIGIN as jx, newInbox as jy, readX401ProofResponse as k, TURN_SOURCE_TIMEOUT_MS as kC, TURN_NO_ACTIVE as kS, HANDOFF_ACK as k_, decodeBolt11 as ka, isAppLicense as kb, WAKE_SUBJECT as kc, nostrProofTemplate as kd, fileMessageText as kf, PROTOCOL_VERSION as kg, ANSWER_REFUSED_REDIALS as kh, encodeDidDhtPacket as ki, readAppFrame as kl, receivedTimestamp as km, openGroupMeta as kn, EngineError as ko, REACTION_LIMITS as kp, normalizeAtprotoHandle as kr, shouldBeHub as ks, knockIdentity as kt, wellKnownUrl as ku, isHandoffPartName as kv, sanitizeNick as kw, DEVICE_INVITE_VERSION as kx, endedRequests as ky, x401VpToken as l, CHAT_WATCH_SHARE as lC, newDeviceSetSecret as lS, waitForIceGathering as l_, newPubkyProofFolder as la, readLinkRecord as lb, GROUP_PIN_FRAME as lc, identityRevocationValue as ld, DhtDelivery as lf, UNUSED_INVITE_WAIT_MAX_MS as lg, sealPair as lh, didWebHost as li, isServeId as ll, appCardId as lm, mentionsMember as ln, MAX_PAIRED_MESSAGE_FRAME as lo, validRemovalNumber as lp, decodeBitcoinAddress as lr, meshRendezvous as ls, decodeCommunityLink as lt, DOMAIN_FILE_MAX_BYTES as lu, handoffContext as lv, readDnsName as lw, isImageMime as lx, ENROLL_PROOF as ly, x401HolderJwk as m, GROUP_BURST_ONE_LINK as mC, webCryptoSigner as mS, emptyLinkRecords as m_, decodeSvcbRecords as ma, APP_BUNDLE_LIMITS as mb, mayPin as mc, receivedIdentityStatus as md, dhtFileElements as mf, GhostlyHttpError as mg, MAX_SKIPPED_KEYS as mh, parseDidSignaturePaste as mi, APP_PEER_OPEN_MAX as ml, cardLinkHost as mm, MAX_GROUP_META_BODY as mn, RACE_ANSWERED_MS as mo, linkEnd as mp, hash160 as mr, beaconKeys as ms, leaveStatement3 as mt, WELL_KNOWN_PATH as mu, handoffEphemeral as mv, publicKeyFromZ32 as mw, canonicalJsonBytes as mx, enrollGrantFrame as my, X401_RESPONSE_MODES as n, turnVerifierMark as nC, deviceKeyZ32 as nS, heardCallSignal as n_, sparkNetworkOf as na, knockSlotRecords as nb, parseTypingActivity as nc, IDENTITY_STATEMENT_PREFIX as nd, transportOrder as nf, PRESENCE_WINDOW as ng, decryptText as nh, didGhostlyServiceEntry as ni, appRangeChunk as nl, PR_CHECKS as nm, communityMessageAuthor as nn, FIRST_PAIRING_PACE_MS as no, dhtEditId as np, bip322ToSpend as nr, groupSignalFrame as ns, GROUP_READ_NOTE_COMMUNITY as nt, HoldKeys as nu, filePartName as nv, openRelayPayload as nw, signAppRevocation as nx, verifySetUpdate as ny, matchX401Dcql as o, CHAT_RESERVE as oC, deviceLinkSealKey as oS, pickCallCandidates as o_, PUBKY_PROOF_ROOT as oa, mergeContactKnocks as ob, typingFrame as oc, boundVerifiedIdentity as od, DHT_MESSAGE_TTL as of, TRANSPORTS_GONE_MS as og, newEpochSecret as oh, didWebFile as oi, appRangeGetFrame as ol, RUN_RESULTS as om, MENTION_EVERYONE as on, INVITE_TAKEN as oo, parseEditedFrame as op, ByteReader as or, NO_HUB_POLICY as os, communityMessageId as ot, readManifest as ou, handoffAttemptSucceeded as ov, decodeDnsAnswers as ow, IMAGE_LIMITS as ox, ENROLL_DONE as oy, sameX401HolderJwk as p, GROUP_BURST_MS as pC, seedSigner as pS, buildLinkRecords as p_, pubkyProofPath as pa, stampHolds as pb, PIN_LIMITS as pc, newIdentityBinding as pd, DHT_FILE_CAPABILITY as pf, unusedInviteWait as pg, MAX_SKIP as ph, parseDidJws as pi, APP_FRAME as pl, cardLine as pm, GROUP_META_PAST_CHARS as pn, PONG_WAIT_MS as po, canonicalUrl as pp, encodeWitness as pr, COMMUNITY_TOPOLOGY as ps, leaveStatement as pt, NIP05_PATH as pu, handoffDoneFrame as pv, identityFromSeedB64 as pw, canonicalJson as px, enrollDoneFrame as py, signAppStore as q, isDiscoveryBudgetError as qC, turnInstance as qS, HANDOFF_PIECE_OVERHEAD as q_, ANSWERS_REFUSED_PAUSE_MS as qa, isAppKey as qb, pushRequest as qc, RELAY_WITH_SECRETS as qd, EDIT_BUFFER_MS as qf, RTC_CONFIG as qg, EXPECT_PEER_MS as qh, isWalletNetwork as qi, parseSessionCapabilities as ql, rosterHas as qm, sshSignCommand as qn, CarriedTransport as qo, pairedReplyAuthor as qp, DID_FILE_MAX_BYTES as qr, TYPING_KINDS as qs, asWritten as qt, IDENTITY_FRAME_LIMIT as qu, sortParts as qv, __exportAll as qw, DEVICES_CAPABILITY as qx, REQUEST_PACKET_BYTES as qy, readX401OpenId4VpRequest as r, BACKGROUND_REQUESTS_PER_MINUTE as rC, deviceLinkPairing as rS, isGlobalIpv4Host as r_, BITCOIN_NETWORKS as ra, linkRecords as rb, parseTypingFrame as rc, IDENTITY_SUBJECT as rd, ACTIVE_DHT_POLL_MS as rf, RELAY_POLL_INTERVALS as rg, edgeParams as rh, didJwsAlg as ri, appRangeDataFrame as rl, PR_STATES as rm, meshMessageRef as rn, GhostLink as ro, editFrame as rp, decodeBase64 as rr, readGroupSignal as rs, communityCommitHash as rt, HoldRefusedError as ru, handoffAckFrame as rv, parseRelayPayload as rw, verifyAppRevocation as rx, DEVICE_KINDS as ry, presentX401SdJwtVc as s, CHAT_RESERVE_MOST_SHARE as sC, deviceLinkSecret as sS, sdpHasCandidates as s_, isPubkyKey as sa, openRequest as sb, typingKindOf as sc, emptyIdentityLedger as sd, DHT_TEXT_BYTES as sf, UNUSED_INVITE_READS_PER_MINUTE as sg, openPair as sh, didWebFileNames as si, decodeAppRangeData as sl, STATUS_CARD_LIMITS as sm, MENTION_LIMITS as sn, LIVENESS_MISSED_PINGS as so, validEditMessage as sp, compactSize as sr, mayBeHub as ss, communityRoster as st, DNS_LABEL as su, handoffBusyFrame as sv, decodeTxtPacket as sw, exifOrientation as sx, ENROLL_GRANT as sy, X401_REQUEST_LIMITS as t, turnStatedVerifier as tC, deviceFrameCapability as tS, extractParamsFromSdp as t_, sparkInvoiceDetails as ta, knockSlotOf as tb, TypingSender as tc, IDENTITY_REVOCATION_LABEL as td, relayedTransports as tf, PRESENCE_HEARTBEAT as tg, confirmationTag as th, checkDidSignature as ti, appRangeCancelFrame as tl, ITEM_STATES as tm, communityEditFrame as tn, EARLY_DIAL_JOIN_MS as to, RateWindow as tp, bip322ToSign as tr, SIGNAL_REPLY_MS as ts, CommunitySession as tt, HOLD_LIMITS as tu, filePartDigest as tv, newerPacket as tw, signAppObject as tx, signTombstone as ty, X401_CREDENTIAL_LIMITS as u, DEFAULT_RELAYS as uC, signDeviceTransports as uS, LABEL$1 as u_, normalizePubkyKey as ua, requestPlaintextBytes as ub, PINNED_FRAME as uc, identityStatement as ud, LIVE_POLL_MS as uf, WATCH_PEER_MS as ug, sealSecret as uh, normalizeDid as ui, parseAppRangeFrame as ul, appCardUrl as um, validMentions as un, PAIRED_FRAME_TOO_LARGE as uo, LINK_MAX_CHARS as up, decodeTx as ur, parseHubPolicy as us, derivedSecret as ut, DOMAIN_MAX_RECORDS as uu, handoffContextProof as uv, IDENTITY_MEMO_SIZE as uw, parseImageMeta as ux, enrollCancelFrame as uy, X401_SCHEME as v, HEDGE_MISSING_MS as vC, TURN_VISIBLE_MS as vS, LEGACY_SERVICES as v_, LIGHTNING_DESTINATION_PATTERN as va, APP_FORBIDDEN_KEYS as vb, pinFrame as vc, IDENTITY_TIMELINE_MAX as vd, PREVIEWABLE_IMAGE as vf, parseLocalTarget as vg, RATCHET_OVERHEAD as vh, DID_DHT_MAX_PAYLOAD as vi, APP_SEND_LIMIT as vl, readStatusCard as vm, encodeGroupMetaBody as vn, RESUME_WAIT_MS as vo, previewImageSize as vp, u64 as vr, hubRank as vs, signCommunity as vt, domainWellKnownFile as vu, handoffHelloFrame as vv, encrypt as vw, createContactLink as vx, formatEnrollDigits as vy, decodeX401Header as w, RelaysFailedError as wC, TURN_BODY_BYTES as wS, isViewerTag as w_, parseLightningDestination as wa, appViewOf as wb, WAKE_CALL_INTERVAL_MS as wc, STORAGE_LIFETIME as wd, RECORDING_TYPES as wf, webLocalFetch as wg, ratchetOpen as wh, didDhtDocument as wi, appOpenFrame as wl, usageLeft as wm, groupMetaTag as wn, pairedMessageFits as wo, COMMUNITY_REACTION_FRAME as wp, atprotoDidMethod as wr, pickHubs as ws, MAX_KNOCKS as wt, recordsFromTxt as wu, handoffRetryAfter as wv, jpegSize$1 as ww, createDeviceInvite as wx, MAX_MISSED as wy, buildX401ProofResult as x, RELAY_REQUESTS_PER_MINUTE as xC, turnPutSummary as xS, decodeServices as x_, findLightningDestination as xa, APP_SCREENSHOTS_DIR as xb, pinnedFrame as xc, PROOF_ADAPTERS as xd, sanitizeFileName as xf, sanitizeRequestHeaders as xg, isRatcheted as xh, DID_DHT_VERSION as xi, appCloseFrame as xl, statusCardBytes as xm, groupMetaChange as xn, UNPROVEN_AUTH_MS as xo, forwardedAgain as xp, ATPROTO_FULL_SCOPE as xr, mergeBeacon as xs, verifyCommunityCommit as xt, nip05RootKey as xu, handoffPakeFrame as xv, tryDecrypt as xw, DEVICE_INVITE_BYTES as xx, verifyEnrollProof as xy, X401_VERSION as y, HEDGE_MS as yC, classifyTurnRead as yS, MAX_SERVICES as y_, LNURL_LIMITS as ya, APP_ICON_PATH as yb, pinIsNewer as yc, applyIdentityEvent as yd, formatFileSize as yf, relativizeLocation as yg, RatchetBox as yh, DID_DHT_PREFIX as yi, APP_VERSION_MAX as yl, removedCardText as ym, groupDisplayName as yn, RTC_UNSTARTED_MS as yo, sanitizePreviewImage as yp, varBytes as yr, lobbyKeys as ys, verifyCommunityChain as yt, encodeDnsQuery as yu, handoffManifestFrames as yv, generateEncryptionKey as yw, encodeContactLink as yx, readEnrollGrant as yy, planAppUpdate as z, BREAKER_ALL_DOWN_PROBE_MS as zC, nextTurnPosition as zS, HANDOFF_HAVE as z_, VIDEO_METADATA_LIMITS as za, APP_STATEMENT_LIMITS as zb, wakePayload as zc, RING_LIFETIME as zd, PLAYABLE_VIDEO as zf, RTC_SIGNAL_MAX_AGE_MS as zg, DIRECT_OWN_ATTEMPTS as zh, SEPOLIA_TEST_USDT_FAUCET as zi, REACTIONS_CAPABILITY as zl, OWN_FRAME_LIMIT as zm, SSH_KEY_TYPES as zn, fetchesByItself as zo, readDhtReactions as zp, parseAtprotoCar as zr, FileUplink as zs, groupWakeFrame as zt, capsDescriptors as zu, readHandoffHello as zv, randomBytes as zw, encodeInviteCode as zx, KNOCK_SLOT_LABEL as zy };
|
|
39379
|
+
export { COMMUNITY_LIMITS as $, heldBackError as $C, signTurnRelease as $S, HANDOFF_TIMINGS as $_, DEMOTE_AFTER_FAILURES as $a, isAppKey as $b, APP_RANGE_FRAMES as $c, irohRelayUrl as $d, MAX_EDITS_PER_MESSAGE as $f, callRtcConfig as $g, OFFER_FAST_MS as $h, isSparkAddress as $i, SESSION_RECEIVE_PENDING as $l, verifyCommitSignature as $m, MessageRefusal as $n, SIGNAL_FRESH_MS as $o, BUTTON_ID as $p, DidError as $r, TYPING_STATUS_MAX as $s, GROUP_EDIT_TEXT_BYTES as $t, IDENTITY_MAX_VALIDITY as $u, encodeSetSlots as $v, __commonJSMin as $w, readInviteCode as $x, STAMP_BITS_DEFAULT as $y, readX401ProofResponseHeader as A, RelayTransport as AC, TOMBSTONE_TURN as AS, servicesToWire as A_, findBolt11 as Aa, appViewOf as Ab, WAKE_SUBJECT as Ac, nostrProofTemplate as Ad, fileMessageText as Af, LIMITS as Ag, ANSWER_REFUSED_REDIALS as Ah, jwkThumbprint as Ai, readAppFrame as Al, receivedTimestamp as Am, parseGroupMetaBody as An, EngineError as Ao, REACTION_LIMITS as Ap, parseAtprotoDidDocument as Ar, shouldBeHub as As, knockRecords as At, wellKnownUrl as Au, handoffVerifiedMessage as Av, MAX_AVATAR_SIDE as Aw, DEVICE_INVITE_OWN_DEVICE as Ax, REOPEN_BELOW as Ay, APP_STORE_KINDS as B, currentRelays as BC, TURN_SLOTS as BS, HANDOFF_FILE_MISSING as B_, videoMetadataPatches as Ba, readAppBundleAsync as Bb, wakePayload as Bc, RING_LIFETIME as Bd, PLAYABLE_VIDEO as Bf, DATA_CHANNEL_LABEL as Bg, DIRECT_OWN_ATTEMPTS as Bh, TEST_USDT_FAUCET_AMOUNT as Bi, REACTIONS_CAPABILITY as Bl, OWN_FRAME_LIMIT as Bm, SSH_PUBLIC_KEY_MAX as Bn, fetchesByItself as Bo, readDhtReactions as Bp, parseAtprotoDidKey as Br, FileUplink as Bs, groupWakes as Bt, capsDescriptors as Bu, readHandoffFileFrame as Bv, unwrapPasted as Bw, INVITE_VERSION as Bx, CONTACT_RECORD_TTL as By, buildX401TokenObject as C, GROUP_RATION_WINDOW_MS as CC, TURN_RAISE_READ_TIMEOUT_MS as CS, SERVICES_VERSION as C_, parseInvoiceCallback as Ca, APP_CLIENT_NAME as Cb, readPin as Cc, PROOF_CAPABILITY as Cd, sanitizeMime as Cf, sanitizeRequestHeaders as Cg, ratchetHeard as Ch, decodeDidDhtPacket as Ci, appDataBytes as Cl, statusCardText as Cm, groupMetaPicture as Cn, WAKE_ANSWER_GRACE_MS as Co, forwardedMany as Cp, ATPROTO_PROOF_SCOPE as Cr, mergeLobby as Cs, KNOCK_TTL_MS as Ct, normalizeDomain as Cu, handoffOfferFrame as Cv, verify as Cw, CONTACT_LINK_BYTES as Cx, readEnrollHello as Cy, readX401ProofRequest as D, PREVIOUS_DEFAULT_RELAYS as DC, keptAtEqualSequence as DS, isViewerTag as D_, resolveLightningDestination as Da, APP_SCREENSHOTS_DIR as Db, WAKE_CALL_WAIT_MS as Dc, emptyProofLedger as Dd, VOICE_METER as Df, withViewerPolicy as Dg, ratchetSeal as Dh, didDhtRecords as Di, isAppVersion as Dl, arrivalKey as Dm, keepPastGroupMeta as Dn, parsePaymentNetworks as Do, QUICK_REACTIONS as Dp, checkAtprotoProofRecord as Dr, readBeacon as Ds, entryParams as Dt, recordsName as Du, handoffRetryAfter as Dv, sealedLength as Dw, readContactLink as Dx, MAX_MISSED as Dy, isX401Protocol as E, HEDGE_MS as EC, classifyTurnRead as ES, isValidServiceId as E_, requestLnurlInvoice as Ea, APP_PERMISSIONS as Eb, WAKE_CALL_TTL_SECONDS as Ec, STORAGE_ROOT as Ed, VOICE_LIMITS as Ef, webLocalFetch as Eg, ratchetRoot as Eh, didDhtKey as Ei, chatAppId as El, MESSAGE_CLOCK_SKEW_MS as Em, groupName as En, pairedMessageFrame as Eo, GROUP_REACTION_FRAME as Ep, atprotoProofRkey as Er, rankHubs as Es, encodeGroupEntryLink as Et, recordsFromWellKnown as Eu, handoffRequestFrame as Ev, generateEncryptionKey as Ew, encodeContactLink as Ex, MAX_DONE as Ey, appRevocationFor as F, SLOW_MS as FC, TURN_NAME_BYTES as FS, HANDOFF_BUSY_REASONS as F_, isFederationId as Fa, isAppLicense as Fb, parseWakeFrame as Fc, storageProofBody as Fd, voiceDownloadName as Ff, encodeChunk as Fg, GATHER_STALL_MS as Fh, EVM_TEST_CHAINS as Fi, EDIT_CAPABILITY as Fl, GROUP_VERSION_LARGE as Fm, verifyGroupMetaSignature as Fn, GROUP_FILE_LIMITS as Fo, queueReaction as Fp, decodeAtprotoCommit as Fr, parsePairedCallFrame as Fs, GROUP_WAKE_GROUP_WINDOW_MS as Ft, CAPS_REFRESH_MS as Fu, readHandoffAck as Fv, hasVisible as Fw, readDeviceInvite as Fx, planKnocks as Fy, readAppStore as G, traceLink as GC, firstDeviceSetSecret as GS, HANDOFF_LIST_PER_FRAME as G_, stripPictureMetadata as Ga, APP_STATEMENT_LIMITS as Gb, decryptPushPayload as Gc, verifyRingAuthorization as Gd, parseVideoMeta as Gf, offerIsFresh as Gg, AWAITING_PEER_MS as Gh, assertWholeSats as Gi, TYPING_CAPABILITY as Gl, parseGroupCommit as Gm, sshFingerprint as Gn, readGroupWant as Go, REPLY_ID as Gp, verifyAtprotoSignature as Gr, transferEnded as Gs, GROUP_READ_NOTE as Gt, IDENTITY_CHALLENGE_WINDOW as Gu, readHandoffRelease as Gv, fromZ32 as Gw, encodeGhostlyInvite as Gx, MAX_SEEN as Gy, checkAppListing as H, readRelayBody as HC, TURN_VERSION as HS, HANDOFF_HAVE as H_, NO_PICTURE_METADATA as Ha, yieldThread as Hb, PUSH_SERVICE_HOSTS as Hc, ringClaims as Hd, formatVideoDuration as Hf, RTC_SIGNAL_MAX_AGE_MS as Hg, DirectPathWatch as Hh, WALLET_NETWORKS as Hi, SESSION_CAPABILITIES_FRAME as Hl, commitHash as Hm, parseSshPublicKey as Hn, isGroupMessageId as Ho, validReactionNumber as Hp, readAtprotoCid as Hr, encodeFileData as Hs, parseGroupWakeFrame as Ht, emptyCapsState as Hu, readHandoffHello as Hv, concatBytes as Hw, createChatInvite as Hx, KNOCK_SLOTS as Hy, appStoreDecision as I, TURN_SOURCE_TIMEOUT_MS as IC, TURN_NO_ACTIVE as IS, HANDOFF_CANCEL as I_, parseCashuRequestPayload as Ia, isAppPath as Ib, readWake as Ic, storageProofPath as Id, voiceFileName as If, encodeControl as Ig, OFFER_HOST_GATHER_MS as Ih, ONCHAIN_PROVIDER as Ii, FILES_BINARY_CAPABILITY as Il, LEGACY_GROUP_MEMBERS as Im, wrapGroupMeta as In, GROUP_HAVE_FRAME as Io, reactedFrame as Ip, decodeDagCbor as Ir, ChatFiles as Is, GROUP_WAKE_MEMBER_INTERVAL_MS as It, CapsExchange as Iu, readHandoffBusy as Iv, sanitizeDisplayText as Iw, DEVICE_INVITE_VERSION as Ix, settleRequest as Iy, GROUP_TYPING_FRAME as J, BREAKER_MAX_MS as JC, readTurnBody as JS, HANDOFF_PAKE as J_, ANSWERS_REFUSED_PAUSE_MS as Ja, appRefPublisher as Jb, pushRequest as Jc, RELAY_WITH_SECRETS as Jd, EDIT_BUFFER_MS as Jf, CALL_SIGNAL_MAX_AGE_MS as Jg, EXPECT_PEER_MS as Jh, parsePaymentAmount as Ji, parseSessionCapabilities as Jl, rosterHas as Jm, verifySshSignature as Jn, CarriedTransport as Jo, pairedReplyAuthor as Jp, DID_GHOSTLY_SERVICE as Jr, TYPING_KINDS as Js, chainPieces as Jt, IDENTITY_FRAME_LIMIT as Ju, sameDigest as Jv, toBase64 as Jw, inviteOwnership as Jx, REQUEST_LABEL as Jy, readAppStoreSteps as K, BREAKER_ALL_DOWN_PROBE_MS as KC, nextTurnPosition as KS, HANDOFF_MANIFEST as K_, withoutPictureMetadata as Ka, appFingerprint as Kb, encryptPushPayload as Kc, verifyRingEvidence as Kd, EDITED_FRAME as Kf, parseRtcSignal as Kg, DEPARTED_READ_MS as Kh, formatPaymentAmount as Ki, UPGRADE_CAPABILITY as Kl, rememberAlone as Km, sshKeyDigestHex as Kn, readGroupWantNo as Ko, REPLY_LIMITS as Kp, DID_DOCUMENT_MAX_BYTES as Kr, transferStalled as Ks, GroupSession as Kt, IDENTITY_CHECK_UNAVAILABLE as Ku, readHandoffTurnFrame as Kv, isZ32Key as Kw, encodeInviteCode as Kx, MAX_SLOT_KNOCKS as Ky, appUpdateDecision as L, WATCH_SHARE as LC, TURN_REV_LIMIT as LS, HANDOFF_CANCEL_REASONS as L_, parseFedimintRequestPayload as La, isAppUrl as Lb, readWakePayload as Lc, validExternalKey as Ld, voiceLevel as Lf, sendBody as Lg, REANSWERS as Lh, PaymentPreflightError as Li, FILES_CAPABILITY as Ll, MAX_GROUP_CHAIN as Lm, SSHSIG_MAX_ARMOR as Ln, GROUP_VERSION_FILES as Lo, reactionEmoji as Lp, encodeDagCbor as Lr, FILE_DATA_KIND as Ls, GROUP_WAKE_RECEIVE_LIMIT as Lt, CapsKeys as Lu, readHandoffCancel as Lv, sanitizeNick as Lw, INVITE_HRP as Lx, takeRequest as Ly, readX401ProofResultHeader as M, SIGNALING_ALLOWANCE_SHARE as MC, TURN_LABEL as MS, HANDOFF_ACK as M_, cashuRequestPayload as Ma, buildAppBundle as Mb, WakeLimiter as Mc, proofHash as Md, isPlayableAudioType as Mf, PROTOCOL_VERSION as Mg, DATA_SETTLE_MS as Mh, resolveDidDht as Mi, APP_RANGES_CAPABILITY as Ml, GROUP_ADMIN_OFF_ERROR as Mm, parseGroupMetaStatement as Mn, engineText as Mo, nextReactionNumber as Mp, AtprotoCid as Mr, MAX_PAIRED_CALL_SIGNAL as Ms, readKnocks as Mt, CAPS_LABEL as Mu, isHandoffPartName as Mv, sanitizeAvatar as Mw, deviceInviteJoinerKeyZ32 as Mx, endedRequests as My, x401AnswerableRequests as N, SIGNALING_WINDOW_MS as NC, TURN_LAST_SEQUENCE as NS, HANDOFF_ATTEMPTS as N_, fedimintRequestPayload as Na, checkAppManifest as Nb, deviceWakeRequest as Nc, proofStatement as Nd, parseVoiceMeta as Nf, decodeChunk as Ng, DataLink as Nh, signDidDhtPacket as Ni, BUTTONS_CAPABILITY as Nl, GROUP_ID as Nm, parseGroupMetaTag as Nn, parseEngineError as No, parseReactedFrame as Np, AtprotoProofError as Nr, PAIRED_CALL_FRAME as Ns, GROUP_WAKE_FRAME as Nt, CAPS_LIMITS as Nu, newHandoffId as Nv, MAX_NICK_LENGTH as Nw, deviceInviteJoinerParams as Nx, inboxRecord as Ny, readX401ProofRequestHeader as O, RELAY_REQUESTS_PER_MINUTE as OC, turnPutSummary as OS, serviceIdFromName as O_, BOLT11_PATTERN as Oa, APP_VIEWS as Ob, WAKE_FRAME as Oc, importedProof as Od, baseMime as Of, CHUNK_FLAG_END as Og, ratchetSessionOf as Oh, encodeDidDhtDeactivated as Oi, isChatAppId as Ol, claimedTime as Om, nextGroupMetaRevision as On, publishFailure as Oo, REACTED_FRAME as Op, isAtprotoDid as Or, readBeaconHead as Os, groupEntryUrl as Ot, txtValue as Ou, handoffStreamKey as Ov, tryDecrypt as Ow, DEVICE_INVITE_BYTES as Ox, MAX_WAITING as Oy, addedAppPermissions as P, SLOW_DEMOTE_MS as PC, TURN_MAX as PS, HANDOFF_BUSY as P_, findEndpoint as Pa, findAppForbiddenKey as Pb, newWakeToken as Pc, storageProof as Pd, recordingMime as Pf, decodeControl as Pg, GATHER_ATTEMPTS as Ph, ETHEREUM_USDT as Pi, CALLS_CAPABILITY as Pl, GROUP_MEMBER_CAP as Pm, signGroupMeta as Pn, PairingTracker as Po, parseReactionFrame as Pp, atprotoCidFor as Pr, PairedCalls as Ps, GROUP_WAKE_GROUP_LIMIT as Pt, CAPS_PUBLISH_SPACING_MS as Pu, openHandoffPiece as Pv, dropLoneJoiners as Pw, encodeDeviceInvite as Px, newInbox as Py, sealGroupTyping as Q, budgetRetryMs as QC, signTurnPacket as QS, HANDOFF_REQUEST as Q_, CROSSED_WAIT_MS as Qa, isAppHash as Qb, APP_RANGE_ERRORS as Qc, irohDescriptor as Qd, EDIT_SEND_LIMIT as Qf, buildSdpFromSignal as Qg, MAX_DHT_TEXT_BYTES as Qh, SPARK_PROVIDER as Qi, SESSION_FRAME_MAX as Ql, verifyCommit as Qm, BIP322_REVISION as Qn, SIGNAL_CARRIERS as Qo, ACTIVE_TASK_STATUSES as Qp, DID_METHODS as Qr, TYPING_SEND_LIMIT as Qs, GROUP_EDIT_FRAME as Qt, IDENTITY_MAX_RECEIVED as Qu, SET_UPDATE as Qv, utf8Encode as Qw, pastedAgain as Qx, REQUEST_TEXT_BYTES as Qy, checkAppBeforeRun as R, WAY_BACK_SHARE as RC, TURN_SEALED_BYTES as RS, HANDOFF_DATA as R_, NO_VIDEO_METADATA as Ra, pacer as Rb, relayRequest as Rc, verifyNostrProof as Rd, voiceLevelsOf as Rf, wrapDataChannel as Rg, STALLED_EVIDENCE_MS as Rh, SEPOLIA_TEST_USDT as Ri, KNOWN_SESSION_CAPABILITIES as Rl, MAX_GROUP_MEMBERS as Rm, SSHSIG_NAMESPACE as Rn, GROUP_WANT_FRAME as Ro, reactionFrame as Rp, findInMst as Rr, FILE_FRAMES as Rs, GroupWakeLimiter as Rt, CapsRefusedError as Ru, readHandoffData as Rv, stripHidden as Rw, INVITE_LINK_ORIGIN as Rx, turnOff as Ry, buildX401ResultArtifact as S, GROUP_OVER_PACE_MS as SC, TURN_PUT_WINDOW_MS as SS, MAX_SERVICES as S_, invoiceCallbackUrl as Sa, APP_CLIENTS as Sb, pinnedFrame as Sc, PROOF_ADAPTERS as Sd, sanitizeFileName as Sf, resolveTargetUrl as Sg, isRatcheted as Sh, DidDhtError as Si, appCloseFrame as Sl, statusCardBytes as Sm, groupMetaNewer as Sn, UNPROVEN_AUTH_MS as So, forwardedAgain as Sp, ATPROTO_PROOF_COLLECTION as Sr, mergeBeacon as Ss, GROUP_ENTRY_PROFILE as St, nip05RootKey as Su, handoffManifestFrames as Sv, sign as Sw, readCanonicalJson as Sx, readEnrollGrant as Sy, encodeX401Header as T, HEDGE_MISSING_MS as TC, TURN_VISIBLE_MS as TS, encodeServices as T_, parsePayParams as Ta, APP_ICON_PATH as Tb, WAKE_CALL_INTERVAL_MS as Tc, STORAGE_LIFETIME as Td, RECORDING_TYPES as Tf, viewerResponseHeaders as Tg, ratchetOpen as Th, didDhtFromPublicKey as Ti, appOpenFrame as Tl, usageLeft as Tm, groupMetaToHand as Tn, pairedMessageFits as To, COMMUNITY_REACTION_FRAME as Tp, atprotoProofRecord as Tr, pickHubs as Ts, decodeGroupEntryLink as Tt, recordsFromTxt as Tu, handoffReleaseFrame as Tv, encrypt as Tw, createContactLink as Tx, FLOOD_PER_DAY as Ty, checkAppStoreIndex as U, relayUrlProblem as UC, TurnRecordError as US, HANDOFF_HELLO as U_, PICTURE_METADATA_LIMITS as Ua, APP_NAME as Ub, WebPushError as Uc, ringEvidence as Ud, isPlayableVideoType as Uf, buildDataSdp as Ug, directBlocked as Uh, arkAddressPrefix as Ui, STATUS_CARD_CAPABILITY as Ul, commitUntaggedHash as Um, parseSshSignature as Un, readGroupFileMeta as Uo, wireReaction as Up, unsignedCommitBytes as Ur, refusalText as Us, GROUP_LIMITS as Ut, encodePacketTransports as Uu, readHandoffManifest as Uv, fromBase64 as Uw, createLink as Ux, KNOCK_SLOT_LABEL as Uy, APP_STORE_LIMITS as V, normalizeRelayUrl as VC, TURN_TTL as VS, HANDOFF_FILE_REQUEST as V_, withoutVideoMetadata as Va, sha256Paced as Vb, wakeRequest as Vc, ringAuthorization as Vd, VIDEO_LIMITS as Vf, RTC_SIGNAL_FUTURE_MS as Vg, DIRECT_PEERS as Vh, USDT_PUBLIC_RPC as Vi, SERVICES_CAPABILITY as Vl, SAID_AGAIN as Vm, SshSigError as Vn, groupFileFallback as Vo, readReaction as Vp, parseAtprotoVerificationKey as Vr, decodeFileData as Vs, mentionedMembers as Vt, dialDescriptors as Vu, readHandoffHave as Vv, bytesEqual as Vw, OwnInviteError as Vx, ContactRequestError as Vy, readAppListing as W, setLinkTraceSink as WC, encodeTurnFields as WS, HANDOFF_LATER_BYTES as W_, isStrippedPicture as Wa, APP_PREFIXES as Wb, checkPushEndpoint as Wc, validRingKey as Wd, isVideoMime as Wf, extractRtcParams as Wg, symmetricNat as Wh, assertTokenUnits as Wi, SessionCapabilities as Wl, expectedRoster as Wm, sameSshKey as Wn, readGroupHave as Wo, PAIRED_REPLY_AUTHORS as Wp, verifyAtprotoRecordProof as Wr, sentWhole as Ws, GROUP_REACTED_FRAME as Wt, parsePacketTransports as Wu, readHandoffPake as Wv, fromBase64Url as Ww, decodeInviteCode as Wx, LINK_RECORD_LABEL as Wy, groupTypingEpoch as X, RelayBreaker as XC, sealTurnBody as XS, HANDOFF_PIECE_OVERHEAD as X_, CROSSED_FRESH_MS as Xa, appSignedBytes as Xb, vapidKeysMatch as Xc, automaticTransport as Xd, EDIT_RATE_WINDOW_MS as Xf, RTC_CONFIG as Xg, IDLE_THRESHOLD as Xh, walletNetworkOf as Xi, PAIRED_PROFILE as Xl, sortRoster as Xm, legacyMessageHash as Xn, GROUP_VERSION_SIGNALS as Xo, replySnippet as Xp, DID_JWS_MAX_LENGTH as Xr, TYPING_RATE_WINDOW_MS as Xs, groupMessageId as Xt, IDENTITY_MAX_EVIDENCE as Xu, sortParts as Xv, toZ32 as Xw, inviteQrText as Xx, REQUEST_NAME_UNITS as Xy, GroupTypingBoard as Y, BREAKER_THRESHOLD as YC, readTurnPacket as YS, HANDOFF_PIECE_BYTES as Y_, BLOCKED_DIAL_WAIT_MS as Ya, appRevocationId as Yb, vapidAuthorization as Yc, TRANSPORTS as Yd, EDIT_FRAME as Yf, PAIRED_CALL_CANDIDATES as Yg, FIRST_PUBLISH_MAX_MS as Yh, validatePaymentTarget as Yi, sessionCapabilitiesFrame as Yl, signCommit as Ym, isLegacySignature as Yn, GROUP_SIGNAL_FRAME as Yo, readReply as Yp, DID_JWS_ALGS as Yr, TYPING_RATE_LIMIT as Ys, frameBytes as Yt, IDENTITY_FRAME_WINDOW_MS as Yu, sealHandoffPiece as Yv, toBase64Url as Yw, inviteQrSegments as Yx, REQUEST_LIFETIME_MS as Yy, openGroupTyping as Z, DiscoveryBudgetError as ZC, signTurnBody as ZS, HANDOFF_RELEASE as Z_, CROSSED_PROBE_MS as Za, checkAppRevokeStatement as Zb, APP_RANGE_DATA_KIND as Zc, checkedDescriptors as Zd, EDIT_RECEIVE_LIMIT as Zf, answersOffer as Zg, LinkSession as Zh, SPARK_NETWORKS as Zi, PairedSession as Zl, verifyChain as Zm, verifyBitcoinMessage as Zn, SIGNALS_PER_MINUTE as Zo, wireReply as Zp, DID_MAX_LENGTH as Zr, TYPING_REFRESH_MS as Zs, COMMUNITY_EDIT_FRAME as Zt, IDENTITY_MAX_FRAME as Zu, SET_ACK as Zv, utf8Decode as Zw, ownInviteRefusal as Zx, REQUEST_PACKET_BYTES as Zy, X401_PROTOCOLS as _, DEFAULT_RELAYS as _C, signDeviceTransports as _S, emptyLinkRecords as __, pubkyHomeserverOf as _a, requestRecords as _b, parsePinFrame as _c, signIdentityPresentation as _d, readDhtFile as _f, HttpHost as _g, RATCHET_HEADER_BYTES as _h, strictBase64Url as _i, APP_RATE_WINDOW_MS as _l, cardUrl as _m, MAX_GROUP_PICTURE_LENGTH as _n, RACE_RELAYED_MS as _o, linksIn as _p, u32$1 as _r, doorHubs as _s, shortHash as _t, dnsProofName as _u, handoffEphemeral as _v, IDENTITY_MEMO_SIZE as _w, parseImageMeta as _x, enrollGrantFrame as _y, X401_DCQL_LIMITS as a, turnReleaseMessage as aC, HANDOFF_CAPABILITY as aS, heardCallSignal as a_, PUBKY_PROOF_MAX_BYTES as aa, knockHolds as ab, sanitizeTypingStatus as ac, IdentityCheckUnavailable as ad, DHT_FILE_REFUSED as af, SIGNAL_OUT_READS as ag, encryptText as ah, didWebDocumentUrl as ai, appRangeEndFrame as al, REMOVABLE_KINDS as am, validEditText as an, HANDLED_WAIT_MS as ao, editedFrame as ap, BitcoinAddressError as ar, GROUP_VERSION_HUBS as as, communityHasFrame as at, isHoldUrl as au, filePartName as av, RELAY_PAYLOAD_MAX_BYTES as aw, readAppRevocations as ax, verifySetUpdate as ay, buildX401ProofRequest as b, GROUP_BURST_MS as bC, seedSigner as bS, HTTP_SERVICE_PROTO as b_, fetchLnurlJson as ba, APP_BUNDLE_LIMITS as bb, pinIsNewer as bc, applyIdentityEvent as bd, formatFileSize as bf, parseLocalTarget as bg, RatchetBox as bh, DID_DHT_TTL as bi, APP_VERSION_MAX as bl, removedCardText as bm, groupMetaBody as bn, RTC_UNSTARTED_MS as bo, sanitizePreviewImage as bp, ATPROTO_DECLARED_SCOPE as br, lobbyKeys as bs, verifyCommunityChainPaced as bt, encodeDnsQuery as bu, handoffHaveFrames as bv, identityFromSeedB64 as bw, canonicalJson as bx, enrollProofFrame as by, readX401DcqlQuery as c, turnStatedVerifier as cC, deviceFrameCapability as cS, parseCallSignal as c_, isPubkyProofFolder as ca, knockSlotRecords as cb, typingKindOf as cc, emptyIdentityLedger as cd, DHT_TEXT_BYTES as cf, UNUSED_INVITE_READS_PER_MINUTE as cg, openPair as ch, didWebFileUrl as ci, decodeAppRangeData as cl, STATUS_CARD_LIMITS as cm, mentionsBytes as cn, LIVENESS_MISSED_PINGS as co, validEditMessage as cp, decodeAnyBitcoinAddress as cr, mayBeHub as cs, communityUntaggedHash as ct, DNS_LABEL as cu, handoffAttemptFailed as cv, newerPacket as cw, signAppObject as cx, ENROLL_CANCEL_REASONS as cy, newX401HolderKey as d, BACKGROUND_WHILE_SIGNALING as dC, deviceLinkParams as dS, signalHasVideo as d_, pubkyProofCapability as da, makeStampPaced as db, PINNED_FRAME as dc, identityStatement as dd, LIVE_POLL_MS as df, WATCH_PEER_MS as dg, sealSecret as dh, parseDid as di, parseAppRangeFrame as dl, appCardUrl as dm, wireMentions as dn, PAIRED_FRAME_TOO_LARGE as do, LINK_MAX_CHARS as dp, decodeWitness as dr, parseHubPolicy as ds, encodeCommunityLink as dt, DOMAIN_MAX_RECORDS as du, handoffCancelFrame as dv, readOwnRelayPayload as dw, verifyAppSignature as dx, ENROLL_HELLO as dy, turnInstance as eC, DEVICES_CAPABILITY as eS, __esmMin as eT, callSignalHeardAt as e_, sparkAddressKind as ea, STAMP_BITS_MAX as eb, TYPING_TIMEOUT_MS as ec, IDENTITY_PROOF_CAPABILITY as ed, rankTransports as ef, OFFER_LOOK_MS as eg, GROUP_PROFILE as eh, checkDidJws as ei, APP_RANGE_LIMITS as el, BUTTON_STYLES as em, carryMentions as en, DEMOTE_MS as eo, MAX_REMOVAL_NUMBER as ep, bip322MessageHash as er, SIGNAL_HOLD_MS as es, COMMUNITY_PROFILE as et, HOLD_CAPABILITY as eu, HANDOFF_VERIFIED as ev, isDiscoveryBudgetError as ew, isAppLine as ex, readSetUpdate as ey, readX401SdJwtVc as f, BACKGROUND_WRITES_SHARE as fC, deviceLinkRendezvousSeed as fS, waitForIceGathering as f_, pubkyProofFile as fa, mergeContactKnocks as fb, PIN_CLOCK_SKEW_MS as fc, identityStatementText as fd, emptyDhtDeliveryState as ff, countUnusedInvite as fg, sha256Hex as fh, parseDidDocument as fi, readAppRangeFrame as fl, buttonLabelClash as fm, GROUP_META_PAST as fn, PAIRING_ATTEMPT_MS as fo, LINK_PREVIEW_LIMITS as fp, encodeTx as fr, pickMeshHubs as fs, leaveStands as ft, DOMAIN_METHODS as fu, handoffContext as fv, signRelayPayload as fw, verifyAppStatementBytes as fx, ENROLL_PROOF as fy, X401_LIMITS as g, CHAT_WATCH_SHARE as gC, newDeviceSetSecret as gS, buildLinkRecords as g_, homeserverWebEndpoint as ga, requestPlaintextBytes as gb, nextPinNumber as gc, revokesIdentity as gd, dhtFileId as gf, HttpClient as gg, RATCHET_CAPABILITY as gh, staticDidDocument as gi, APP_RATE_LIMIT as gl, cardTimeUtc as gm, MAX_GROUP_NAME_LENGTH as gn, RACE_DIRECT_MS as go, linkStop as gp, txHash as gr, beaconRecords as gs, rosterHash as gt, decodeDnsResponse as gu, handoffDoneFrame as gv, readDnsName as gw, isImageMime as gx, enrollDoneFrame as gy, X401_HEADERS as h, CHAT_RESERVE_PER_CHAT as hC, devicePingFrame as hS, RECORD_TTL as h_, encodeSvcbPacket as ha, readLinkRecord as hb, mayPin as hc, receivedIdentityStatus as hd, dhtFileElements as hf, GhostlyHttpError as hg, MAX_SKIPPED_KEYS as hh, signingKeys as hi, APP_PEER_OPEN_MAX as hl, cardLinkHost as hm, MAX_GROUP_NAME_BYTES as hn, RACE_ANSWERED_MS as ho, linkEnd as hp, sha256d as hr, beaconKeys as hs, leftStatement as ht, WELL_KNOWN_PATH as hu, handoffDigest as hv, encodeTxtPacket as hw, imageSize as hx, enrollDigits as hy, x401ApprovalDigest as i, turnPayloadSequence as iC, ENROLL_CAPABILITY as iS, extractParamsFromSdp as i_, isBitcoinAddress as ia, contactDay as ib, parseTypingFrame as ic, IDENTITY_SUBJECT as id, ACTIVE_DHT_POLL_MS as if, RELAY_POLL_INTERVALS as ig, edgeParams as ih, didSignedMessages as ii, appRangeDataFrame as il, PR_STATES as im, parseCommunityEdit as in, GhostLink as io, editFrame as ip, verifyBip322 as ir, readGroupSignal as is, communityGroupId as it, HoldRefusedError as iu, filePartDigest as iv, PacketTooLargeError as iw, readAppRevocationShape as ix, signTombstone as iy, readX401ProofResult as j, RelaysFailedError as jC, TURN_BODY_BYTES as jS, viewerTag as j_, ENDPOINT as ja, assembleAppBundle as jb, WAKE_TTL_SECONDS as jc, proofCapability as jd, formatVoiceDuration as jf, MAX_CHUNK_PAYLOAD_BYTES as jg, CONNECT_TIMEOUT_MS as jh, openDidDhtPayload as ji, APPS_CAPABILITY as jl, shownTime as jm, parseGroupMetaFrame as jn, engineError as jo, ReactionWindow as jp, shortAtprotoDid as jr, validHead as js, mergeKnocks as jt, CAPS_ISSUED_BACK_MS as ju, handoffVersions as jv, jpegSize$1 as jw, createDeviceInvite as jx, clearMissed as jy, readX401ProofResponse as k, REQUESTS_PER_MINUTE as kC, TOMBSTONE_SEQUENCE as kS, servicesFromWire as k_, decodeBolt11 as ka, appDigest as kb, WAKE_INTERVAL_MS as kc, isProofAdapter as kd, downsamplePeaks as kf, CHUNK_KIND as kg, ratchetUnknownSession as kh, encodeDidDhtPacket as ki, parseAppFrame as kl, heardTime as km, openGroupMeta as kn, ENGINE_ERRORS as ko, REACTION_FRAME as kp, normalizeAtprotoHandle as kr, readLobby as ks, knockIdentity as kt, validDomainRecord as ku, handoffVerifiedFrame as kv, MAX_AVATAR_LENGTH as kw, DEVICE_INVITE_LIFETIME_S as kx, NEW_PER_HOUR as ky, x401VpToken as l, turnVerifierMark as lC, deviceKeyZ32 as lS, pickCallCandidates as l_, newPubkyProofFolder as la, linkRecords as lb, COMMUNITY_PIN_FRAME as lc, identityPresentationBytes as ld, DHT_TEXT_REFUSED as lf, UNUSED_INVITE_UPKEEP_MS as lg, openSecret as lh, didWebHost as li, encodeAppRangeData as ll, TASK_STATUSES as lm, mentionsMember as ln, LIVENESS_PING_MS as lo, validEditNumber as lp, decodeBitcoinAddress as lr, meshHubs as ls, decodeCommunityLink as lt, DNS_TYPE as lu, handoffAttemptSucceeded as lv, openRelayPayload as lw, signAppRevocation as lx, ENROLL_DONE as ly, x401HolderJwk as m, CHAT_RESERVE_MOST_SHARE as mC, deviceLinkSecret as mS, MAX_MSGS_PAYLOAD_B64 as m_, decodeSvcbRecords as ma, readKnockSlot as mb, PIN_LIMITS as mc, newIdentityBinding as md, DHT_FILE_CAPABILITY as mf, unusedInviteWait as mg, MAX_SKIP as mh, parseDidSignaturePaste as mi, APP_FRAME as ml, cardLine as mm, MAX_GROUP_META_BODY as mn, PONG_WAIT_MS as mo, canonicalUrl as mp, hash160 as mr, COMMUNITY_TOPOLOGY as ms, leaveStatement3 as mt, NIP05_PATH as mu, handoffDataFrame as mv, decodeTxtPacket as mw, exifOrientation as mx, enrollCancelReason as my, X401_RESPONSE_MODES as n, turnName as nC, DEVICE_ECHO_FRAME as nS, __require as nT, contactRtcConfig as n_, sparkNetworkOf as na, contactAskerFrame as nb, TypingSender as nc, IDENTITY_REVOCATION_LABEL as nd, relayedTransports as nf, PRESENCE_HEARTBEAT as ng, confirmationTag as nh, didGhostlyServiceEntry as ni, appRangeCancelFrame as nl, ITEM_STATES as nm, communityMessageAuthor as nn, EARLY_DIAL_JOIN_MS as no, RateWindow as np, bip322ToSpend as nr, SIGNAL_REPLY_MS as ns, GROUP_READ_NOTE_COMMUNITY as nt, HOLD_LIMITS as nu, HANDOFF_WINDOW as nv, MAX_DNS_PACKET_BYTES as nw, isAppSignature as nx, setUpdateFrame as ny, matchX401Dcql as o, turnSequence as oC, deviceEchoFrame as oS, isGlobalIpv4Host as o_, PUBKY_PROOF_ROOT as oa, knockSlotIdentity as ob, typingActivity as oc, IdentityExchange as od, DHT_FILE_TOO_LARGE as of, STALLED_LOOK_MS as og, epochKeys as oh, didWebFile as oi, appRangeErrorFrame as ol, ROUTINE_STATES as om, MENTION_EVERYONE as on, INVITER_DIAL_GRACE_MS as oo, parseEditFrame as op, ByteReader as or, MESH_HUBS as os, communityMessageId as ot, newMailbox as ou, handoffAckFrame as ov, createRelayPayload as ow, readAppSignature as ox, DEVICE_KINDS as oy, sameX401HolderJwk as p, CHAT_RESERVE as pC, deviceLinkSealKey as pS, LABEL$1 as p_, pubkyProofPath as pa, openRequest as pb, PIN_FRAME as pc, isIdentityBinding as pd, peekDhtMailbox as pf, presenceSeenAt as pg, FOLLOW_MS as ph, parseDidJws as pi, APP_DATA_MAX_BYTES as pl, cardEditNumber as pm, GROUP_META_PAST_CHARS as pn, PAIRING_RETRY_MS as po, LINK_TRAILING as pp, encodeWitness as pr, wireHubPolicy as ps, leaveStatement as pt, DOMAIN_TXT_MAX_BYTES as pu, handoffContextProof as pv, decodeDnsAnswers as pw, IMAGE_LIMITS as px, enrollCancelFrame as py, signAppStore as q, BREAKER_BASE_MS as qC, openTurnValue as qS, HANDOFF_OFFER as q_, ANSWERS_REFUSED_PAUSES as qa, appRef as qb, generateVapidKeys as qc, RELAY_URL as qd, EDIT_BUFFER_MAX as qf, CALL_SIGNAL_FUTURE_MS as qg, DHT_POLL_INTERVALS as qh, isWalletNetwork as qi, WAKE_SESSION_CAPABILITY as ql, rosterAdmin as qm, sshSignCommand as qn, CARRIED_DEFER_MS as qo, groupReplyAuthor as qp, DID_FILE_MAX_BYTES as qr, TYPING_FRAME as qs, asWritten as qt, IDENTITY_CLOCK_SKEW as qu, readHandoffVerified as qv, randomBytes as qw, inviteLink as qx, REQUEST_CLOCK_SKEW_MS as qy, readX401OpenId4VpRequest as r, turnPacket as rC, DEVICE_PING_FRAME as rS, __toCommonJS as rT, decompressSdp as r_, BITCOIN_NETWORKS as ra, contactAskerHolds as rb, parseTypingActivity as rc, IDENTITY_STATEMENT_PREFIX as rd, transportOrder as rf, PRESENCE_WINDOW as rg, decryptText as rh, didJwsAlg as ri, appRangeChunk as rl, PR_CHECKS as rm, meshMessageRef as rn, FIRST_PAIRING_PACE_MS as ro, dhtEditId as rp, decodeBase64 as rr, groupSignalFrame as rs, communityCommitHash as rt, HoldKeys as ru, NO_ATTEMPTS as rv, PKARR_FUTURE_SKEW_MS as rw, readAppRevocation as rx, setUpdateMessage as ry, presentX401SdJwtVc as s, turnSignedMessage as sC, deviceEchoNonce as sS, keepsToRelays as s_, isPubkyKey as sa, knockSlotOf as sb, typingFrame as sc, boundVerifiedIdentity as sd, DHT_MESSAGE_TTL as sf, TRANSPORTS_GONE_MS as sg, newEpochSecret as sh, didWebFileNames as si, appRangeGetFrame as sl, RUN_RESULTS as sm, MENTION_LIMITS as sn, INVITE_TAKEN as so, parseEditedFrame as sp, compactSize as sr, NO_HUB_POLICY as ss, communityRoster as st, readManifest as su, handoffAttemptAllowed as sv, measureRecords as sw, setAppSignatureFastPath as sx, ENROLL_CANCEL as sy, X401_REQUEST_LIMITS as t, turnKeys as tC, DEVICE_CAPABILITIES as tS, __exportAll as tT, compressSdp as t_, sparkInvoiceDetails as ta, STAMP_BITS_MIN as tb, TypingReceiver as tc, IDENTITY_PROVIDER_ID as td, relayUrl as tf, OFFER_STEP_MAX as tg, confirmationMatches as th, checkDidSignature as ti, AppRanges as tl, CRON_LINE as tm, communityEditFrame as tn, DHT_PIN_GRACE_MS as to, REMOVED_TEXT as tp, bip322ToSign as tr, SIGNAL_PROVEN_MS as ts, CommunitySession as tt, HOLD_DATED_BACK_MS as tu, HANDOFF_VERSION as tv, withRequestOptions as tw, isAppRef as tx, setAckFrame as ty, X401_CREDENTIAL_LIMITS as u, BACKGROUND_REQUESTS_PER_MINUTE as uC, deviceLinkPairing as uS, sdpHasCandidates as u_, normalizePubkyKey as ua, makeStamp as ub, GROUP_PIN_FRAME as uc, identityRevocationValue as ud, DhtDelivery as uf, UNUSED_INVITE_WAIT_MAX_MS as ug, sealPair as uh, normalizeDid as ui, isServeId as ul, appCardId as um, validMentions as un, MAX_PAIRED_MESSAGE_FRAME as uo, validRemovalNumber as up, decodeTx as ur, meshRendezvous as us, derivedSecret as ut, DOMAIN_FILE_MAX_BYTES as uu, handoffBusyFrame as uv, parseRelayPayload as uw, verifyAppRevocation as ux, ENROLL_GRANT as uy, X401_SCHEME as v, DEPARTED_READS as vC, unsignedDeviceTransports as vS, isEmptyLinkPacket as v_, LIGHTNING_DESTINATION_PATTERN as va, seenEntry as vb, parsePinnedFrame as vc, verifyIdentityPresentation as vd, FileTransfers as vf, VIEWER_SERVICE_CSP as vg, RATCHET_KEEP_MS as vh, DID_DHT_MAX_PAYLOAD as vi, APP_RESUME_GRACE_MS as vl, checkStatusCard as vm, encodeGroupMetaBody as vn, REDESCRIBED_GRACE_MS as vo, parseLinkPreview as vp, u64 as vr, freshHubs as vs, signCommunity as vt, domainTxtRecord as vu, handoffFileMissingFrame as vv, createIdentity as vw, previewable as vx, enrollHelloFrame as vy, decodeX401Header as w, GROUP_SIGNALING_ALLOWANCE_SHARE as wC, TURN_SETTLE_MS as wS, decodeServices as w_, parseLightningDestination as wa, APP_FORBIDDEN_KEYS as wb, DEVICE_WAKE_TTL_SECONDS as wc, PeerProofs as wd, PLAYABLE_AUDIO as wf, sanitizeResponseHeaders as wg, ratchetOn as wh, didDhtDocument as wi, appDataFrame as wl, taskProgress as wm, groupMetaTag as wn, WAKE_LOST_MS as wo, readForwarded as wp, atprotoDidMethod as wr, newerHead as ws, MAX_KNOCKS as wt, parseDomainTxt as wu, handoffPakeFrame as wv, decrypt as ww, CONTACT_LINK_VERSION as wx, verifyEnrollProof as wy, buildX401ProofResult as x, GROUP_BURST_ONE_LINK as xC, webCryptoSigner as xS, LEGACY_SERVICES as x_, findLightningDestination as xa, APP_BUNDLE_MAGIC as xb, pinNumberHolds as xc, lastSharedWithMe as xd, safeBlobType as xf, relativizeLocation as xg, emptyRatchetState as xh, DID_DHT_VERSION as xi, AppSessions as xl, sameButtonText as xm, groupMetaChange as xn, SWITCH_RETIRE_MS as xo, FORWARD_LIMITS as xp, ATPROTO_FULL_SCOPE as xr, lobbyRecords as xs, verifyCommunityCommit as xt, isPublicAddress as xu, handoffHelloFrame as xv, publicKeyFromZ32 as xw, canonicalJsonBytes as xx, formatEnrollDigits as xy, X401_VERSION as y, FRESH_READ_MS as yC, verifyDeviceTransports as yS, parseLinkRecords as y_, LNURL_LIMITS as ya, stampHolds as yb, pinFrame as yc, IDENTITY_TIMELINE_MAX as yd, PREVIEWABLE_IMAGE as yf, formatLocalTarget as yg, RATCHET_OVERHEAD as yh, DID_DHT_PREFIX as yi, APP_SEND_LIMIT as yl, readStatusCard as ym, groupDisplayName as yn, RESUME_WAIT_MS as yo, previewImageSize as yp, varBytes as yr, hubRank as ys, verifyCommunityChain as yt, domainWellKnownFile as yu, handoffFileRequestFrame as yv, identityFromSeed as yw, readImageMeta as yx, enrollMessage as yy, planAppUpdate as z, WRITE_FIRST_MS as zC, TURN_SIGNED_BYTES as zS, HANDOFF_DONE as z_, VIDEO_METADATA_LIMITS as za, readAppBundle as zb, wakeFrame as zc, verifyPeerProof as zd, voicePeaksOf as zf, DATA_CHANNEL_ID as zg, DIRECT_EVIDENCE_MS as zh, SEPOLIA_TEST_USDT_FAUCET as zi, PIN_CAPABILITY as zl, MEMBER_KEY as zm, SSH_KEY_TYPES as zn, GROUP_WANT_NO_FRAME as zo, reactionIsNewer as zp, parseAtprotoCar as zr, FILE_LIMITS as zs, groupWakeFrame as zt, DHT_TEXT_CAPABILITY as zu, readHandoffDone as zv, trimEndOf as zw, INVITE_MAX_LENGTH as zx, CONTACT_ASKER_FRAME as zy };
|
|
38514
39380
|
|
|
38515
|
-
//# sourceMappingURL=src-
|
|
39381
|
+
//# sourceMappingURL=src-BZy4lDju.js.map
|