@ghostlytools/cli 1.4.5 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -7
- package/dist/assets/{api-D70he3-A.js → api-Dy_05gaq.js} +93 -62
- package/dist/assets/api-Dy_05gaq.js.map +1 -0
- package/dist/assets/{api-XX7bbtTZ.js → api-oUpBfryK.js} +2 -2
- package/dist/assets/{apiKit-CpsEqF-1.js → apiKit-B-PUYkXH.js} +2 -2
- package/dist/assets/{apiKit-CpsEqF-1.js.map → apiKit-B-PUYkXH.js.map} +1 -1
- package/dist/assets/{apps-DVMnlwGF.js → apps-C6MBfO-I.js} +1 -1
- package/dist/assets/{apps-VA8W_YCQ.js → apps-ejb6H1lT.js} +2 -2
- package/dist/assets/{apps-VA8W_YCQ.js.map → apps-ejb6H1lT.js.map} +1 -1
- package/dist/assets/{arkade-DxgW4-dK.js → arkade-DXyOeKEI.js} +2 -2
- package/dist/assets/{arkade-DxgW4-dK.js.map → arkade-DXyOeKEI.js.map} +1 -1
- package/dist/assets/{backup-BRTH1y3-.js → backup-Bt6UjCiM.js} +1 -1
- package/dist/assets/{backup-c9xvXgCS.js → backup-DRIIguzE.js} +6 -6
- package/dist/assets/{backup-c9xvXgCS.js.map → backup-DRIIguzE.js.map} +1 -1
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/{blobFiles-B0rNnHlO.js → blobFiles-1wUBd8ZD.js} +3 -3
- package/dist/assets/{blobFiles-B0rNnHlO.js.map → blobFiles-1wUBd8ZD.js.map} +1 -1
- package/dist/assets/buttons-B3bi6p_d.js +2 -0
- package/dist/assets/{buttons-D31LBftz.js → buttons-DoccJ_cK.js} +3 -3
- package/dist/assets/{buttons-D31LBftz.js.map → buttons-DoccJ_cK.js.map} +1 -1
- package/dist/assets/daemonProof-CWTVNUmr.js +254 -0
- package/dist/assets/daemonProof-CWTVNUmr.js.map +1 -0
- package/dist/assets/{envelope-hAl4pblf.js → envelope-hJ0SfbAh.js} +2 -2
- package/dist/assets/{envelope-hAl4pblf.js.map → envelope-hJ0SfbAh.js.map} +1 -1
- package/dist/assets/fedimint_client_wasm_bg-BtHHlFpp.js.map +1 -1
- package/dist/assets/{fileBytes-B-fqGdEd.js → fileBytes-B8eTZfAT.js} +3 -3
- package/dist/assets/{fileBytes-B-fqGdEd.js.map → fileBytes-B8eTZfAT.js.map} +1 -1
- package/dist/assets/{fileBytes-C2jycN_7.js → fileBytes-gTd_8l-P.js} +1 -1
- package/dist/assets/{fileBytes-D6fqFQEX.js → fileBytes-uRqLyxa0.js} +2 -2
- package/dist/assets/{fileBytes-D6fqFQEX.js.map → fileBytes-uRqLyxa0.js.map} +1 -1
- package/dist/assets/{fileBytesIdb-_HnxdacI.js → fileBytesIdb-BIFKtgln.js} +3 -3
- package/dist/assets/{fileBytesIdb-_HnxdacI.js.map → fileBytesIdb-BIFKtgln.js.map} +1 -1
- package/dist/assets/fileBytesIdb-BVVr_rWX.js +2 -0
- package/dist/assets/{fileBytesOpfs-p_CANncD.js → fileBytesOpfs-ChrHcCVV.js} +3 -3
- package/dist/assets/{fileBytesOpfs-p_CANncD.js.map → fileBytesOpfs-ChrHcCVV.js.map} +1 -1
- package/dist/assets/{groupFiles-gQ8_792r.js → groupFiles-BXPINkVJ.js} +60 -14
- package/dist/assets/groupFiles-BXPINkVJ.js.map +1 -0
- package/dist/assets/{host-Dmo6m7So.js → host-CzgYwupN.js} +15 -122
- package/dist/assets/host-CzgYwupN.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-DwkZ8vpt.js → hyperdhtRelay-CJBqsS_e.js} +2 -2
- package/dist/assets/{hyperdhtRelay-DwkZ8vpt.js.map → hyperdhtRelay-CJBqsS_e.js.map} +1 -1
- package/dist/assets/{idb-CMVgtn2k.js → idb-BJARz3Qi.js} +5 -3
- package/dist/assets/idb-BJARz3Qi.js.map +1 -0
- package/dist/assets/{irohWeb-DKJhESuV.js → irohWeb-CrGOD-OD.js} +2 -2
- package/dist/assets/{irohWeb-DKJhESuV.js.map → irohWeb-CrGOD-OD.js.map} +1 -1
- package/dist/assets/{main-DgXvK9Cr.js → main-BDOIJ_ls.js} +240 -53
- package/dist/assets/main-BDOIJ_ls.js.map +1 -0
- package/dist/assets/{mainline-9j_FqcJe.js → mainline-Cw7rnEWM.js} +2 -2
- package/dist/assets/{mainline-9j_FqcJe.js.map → mainline-Cw7rnEWM.js.map} +1 -1
- package/dist/assets/{networkReason-Bp8Huk9Z.js → networkReason-C0VY94cG.js} +3 -3
- package/dist/assets/{networkReason-Bp8Huk9Z.js.map → networkReason-C0VY94cG.js.map} +1 -1
- package/dist/assets/{nwc-DxIjNmYz.js → nwc-lpGWvzYU.js} +3 -3
- package/dist/assets/{nwc-DxIjNmYz.js.map → nwc-lpGWvzYU.js.map} +1 -1
- package/dist/assets/{nwcProvider-CyGVe35t.js → nwcProvider-CAGRn2ly.js} +2 -2
- package/dist/assets/{nwcProvider-CyGVe35t.js.map → nwcProvider-CAGRn2ly.js.map} +1 -1
- package/dist/assets/{profiles-ClRPr6y8.js → profiles-BehWURA9.js} +7 -3
- package/dist/assets/profiles-BehWURA9.js.map +1 -0
- package/dist/assets/{registry-siqMiD8L.js → registry-D2bK-k1T.js} +1 -1
- package/dist/assets/{registry-BTIRr7gH.js → registry-DWkkBN57.js} +3 -3
- package/dist/assets/registry-DWkkBN57.js.map +1 -0
- package/dist/assets/{resolve-CZ4yb7wp.js → resolve-CvYK0Lbt.js} +2 -2
- package/dist/assets/{resolve-CZ4yb7wp.js.map → resolve-CvYK0Lbt.js.map} +1 -1
- package/dist/assets/{restoredRows-DeBImGRd.js → restoredRows-DGuKtIBz.js} +2 -2
- package/dist/assets/{restoredRows-DeBImGRd.js.map → restoredRows-DGuKtIBz.js.map} +1 -1
- package/dist/assets/{server-ZrkwMbFo.js → server-BktMmp7L.js} +1141 -310
- package/dist/assets/server-BktMmp7L.js.map +1 -0
- package/dist/assets/{src-CxEO33Hb.js → src-Bpy99Z2K.js} +828 -57
- package/dist/assets/src-Bpy99Z2K.js.map +1 -0
- package/dist/assets/{usdt-exH8dIZK.js → usdt-DFusiw8x.js} +3 -3
- package/dist/assets/{usdt-exH8dIZK.js.map → usdt-DFusiw8x.js.map} +1 -1
- package/dist/assets/{turnRefs-Dndxqyxk.js → words-Z-izzDBN.js} +61 -3
- package/dist/assets/words-Z-izzDBN.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/skills/ghostly/scripts/status +3 -2
- package/dist/assets/api-D70he3-A.js.map +0 -1
- package/dist/assets/buttons-CtGCix-8.js +0 -2
- package/dist/assets/daemonProof-B53VnZ1Z.js +0 -100
- package/dist/assets/daemonProof-B53VnZ1Z.js.map +0 -1
- package/dist/assets/fileBytesIdb-DOxm_BKt.js +0 -2
- package/dist/assets/groupFiles-gQ8_792r.js.map +0 -1
- package/dist/assets/host-Dmo6m7So.js.map +0 -1
- package/dist/assets/idb-CMVgtn2k.js.map +0 -1
- package/dist/assets/main-DgXvK9Cr.js.map +0 -1
- package/dist/assets/profiles-ClRPr6y8.js.map +0 -1
- package/dist/assets/registry-BTIRr7gH.js.map +0 -1
- package/dist/assets/server-ZrkwMbFo.js.map +0 -1
- package/dist/assets/src-CxEO33Hb.js.map +0 -1
- package/dist/assets/turnRefs-Dndxqyxk.js.map +0 -1
|
@@ -6039,11 +6039,15 @@ var RTC_CONFIG = {
|
|
|
6039
6039
|
* A call's WebRTC configuration: the apps' STUN servers, then the profile's own (Settings → Network → ICE
|
|
6040
6040
|
* servers: a TURN relay, typically). A relay is what connects a call when no direct path works: a VPN that takes
|
|
6041
6041
|
* every packet through its tunnel, or a NAT that maps each destination apart.
|
|
6042
|
+
*
|
|
6043
|
+
* `relayOnly` ("Hide my IP from contacts", WISP 100 § Relay only): the profile's TURN servers alone, no STUN server
|
|
6044
|
+
* (the apps' or the profile's), and the relay policy, so the connection gathers and uses relay candidates only. With
|
|
6045
|
+
* no usable TURN server it has no server at all, and finds no candidate: it fails, it never goes direct.
|
|
6042
6046
|
*/
|
|
6043
|
-
function callRtcConfig(extra = []) {
|
|
6047
|
+
function callRtcConfig(extra = [], { relayOnly = false } = {}) {
|
|
6044
6048
|
const servers = [];
|
|
6045
6049
|
for (const server of extra) {
|
|
6046
|
-
const urls = (Array.isArray(server.urls) ? server.urls : server.urls.split(/[\s,]+/)).filter(Boolean);
|
|
6050
|
+
const urls = (Array.isArray(server.urls) ? server.urls : server.urls.split(/[\s,]+/)).filter(Boolean).filter((url) => !relayOnly || /^turns?:/i.test(url));
|
|
6047
6051
|
if (!urls.length) continue;
|
|
6048
6052
|
if (urls.some((url) => /^turns?:/i.test(url)) && (!server.username?.trim() || !server.credential?.trim())) continue;
|
|
6049
6053
|
servers.push({
|
|
@@ -6052,12 +6056,30 @@ function callRtcConfig(extra = []) {
|
|
|
6052
6056
|
...server.credential ? { credential: server.credential } : {}
|
|
6053
6057
|
});
|
|
6054
6058
|
}
|
|
6059
|
+
if (relayOnly) return {
|
|
6060
|
+
...RTC_CONFIG,
|
|
6061
|
+
iceServers: servers,
|
|
6062
|
+
iceTransportPolicy: "relay"
|
|
6063
|
+
};
|
|
6055
6064
|
return {
|
|
6056
6065
|
...RTC_CONFIG,
|
|
6057
6066
|
iceServers: [...RTC_CONFIG.iceServers ?? [], ...servers]
|
|
6058
6067
|
};
|
|
6059
6068
|
}
|
|
6060
6069
|
/**
|
|
6070
|
+
* The WebRTC configuration of a chat's data link or a group's edge, from the profile's settings: its ICE servers,
|
|
6071
|
+
* and "Hide my IP from contacts" (`relayOnly`), as a call's (`callRtcConfig`). No candidate pool: an app holds one
|
|
6072
|
+
* such connection per chat and per group member, and a call only one.
|
|
6073
|
+
*/
|
|
6074
|
+
function contactRtcConfig(settings) {
|
|
6075
|
+
const { iceCandidatePoolSize: _pool, ...config } = callRtcConfig(settings.iceServers ?? [], { relayOnly: settings.relayOnly === true });
|
|
6076
|
+
return config;
|
|
6077
|
+
}
|
|
6078
|
+
/** Whether a connection keeps to relays (`iceTransportPolicy: "relay"`): what it sends a contact is then relay candidates only. */
|
|
6079
|
+
function keepsToRelays(pc) {
|
|
6080
|
+
return pc?.getConfiguration?.().iceTransportPolicy === "relay";
|
|
6081
|
+
}
|
|
6082
|
+
/**
|
|
6061
6083
|
* The candidates a signal carries, from the `a=candidate:` values of an SDP, when it may carry up to `max`.
|
|
6062
6084
|
*
|
|
6063
6085
|
* A computer often has several interfaces (Wi-Fi, Ethernet, VM bridges, Tailscale, a VPN) and the one listed first is
|
|
@@ -6072,11 +6094,14 @@ function callRtcConfig(extra = []) {
|
|
|
6072
6094
|
*
|
|
6073
6095
|
* UDP only, loopback, link-local and unspecified addresses left out (loopback kept with `loopback`), the related
|
|
6074
6096
|
* address dropped (it is informational, and an IPv6 one broke apps before 0.5).
|
|
6097
|
+
*
|
|
6098
|
+
* `relayOnly` ("Hide my IP from contacts"): relay candidates alone, whatever else the connection gathered. A relay
|
|
6099
|
+
* candidate's address is the TURN server's; its related address, dropped as every one is, would be this device's.
|
|
6075
6100
|
*/
|
|
6076
|
-
function pickCallCandidates(candidates, max = 8, { loopback = false } = {}) {
|
|
6077
|
-
const udp = candidates.map((c) => c.trim()).filter((c) => / udp /i.test(c));
|
|
6078
|
-
const address = (c) => c.split(" ")[4] ?? "";
|
|
6101
|
+
function pickCallCandidates(candidates, max = 8, { loopback = false, relayOnly = false } = {}) {
|
|
6079
6102
|
const type = (c) => / typ (\S+)/.exec(c)?.[1];
|
|
6103
|
+
const udp = candidates.map((c) => c.trim()).filter((c) => / udp /i.test(c) && (!relayOnly || type(c) === "relay"));
|
|
6104
|
+
const address = (c) => c.split(" ")[4] ?? "";
|
|
6080
6105
|
const cost = (c) => Number(/ network-cost (\d+)/.exec(c)?.[1] ?? 0);
|
|
6081
6106
|
const ipv6 = (c) => address(c).includes(":");
|
|
6082
6107
|
const usable = (c) => {
|
|
@@ -6101,9 +6126,10 @@ function pickCallCandidates(candidates, max = 8, { loopback = false } = {}) {
|
|
|
6101
6126
|
/**
|
|
6102
6127
|
* The parameters of a call signal, from an SDP. `maxCandidates` above two (a signal on the chat session) carries
|
|
6103
6128
|
* the candidates `pickCallCandidates` chooses; the default keeps a compatibility chat's one host and one server
|
|
6104
|
-
* reflexive candidate.
|
|
6129
|
+
* reflexive candidate. `relayOnly` ("Hide my IP from contacts"): relay candidates only, in either; a compatibility
|
|
6130
|
+
* chat's two then go to the first two relay ones.
|
|
6105
6131
|
*/
|
|
6106
|
-
function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false } = {}) {
|
|
6132
|
+
function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false, relayOnly = false } = {}) {
|
|
6107
6133
|
const lines = sdp.split("\r\n");
|
|
6108
6134
|
let ufrag = "";
|
|
6109
6135
|
let pwd = "";
|
|
@@ -6147,7 +6173,10 @@ function extractParamsFromSdp(sdp, { maxCandidates = 2, loopback = false } = {})
|
|
|
6147
6173
|
}
|
|
6148
6174
|
const srflxCandidates = candidates.filter((c) => / typ srflx( |$)/.test(c));
|
|
6149
6175
|
const hostCandidates = candidates.filter((c) => / typ host( |$)/.test(c) && / udp /i.test(c));
|
|
6150
|
-
const selectedCandidates = maxCandidates > 2 ? pickCallCandidates(candidates, maxCandidates, {
|
|
6176
|
+
const selectedCandidates = maxCandidates > 2 || relayOnly ? pickCallCandidates(candidates, maxCandidates, {
|
|
6177
|
+
loopback,
|
|
6178
|
+
relayOnly
|
|
6179
|
+
}) : [...hostCandidates.slice(0, 1), ...srflxCandidates.slice(0, 1)].map((c) => c.replace(/ raddr \S+ rport \d+/, ""));
|
|
6151
6180
|
const ssrcs = [];
|
|
6152
6181
|
if (audioSsrc !== null) ssrcs.push(audioSsrc);
|
|
6153
6182
|
if (videoSsrc !== null) ssrcs.push(videoSsrc);
|
|
@@ -6582,7 +6611,8 @@ function hostRank(parts, reflexiveBases) {
|
|
|
6582
6611
|
const wayOut = reflexiveBases.has(parts[4]) || isGlobalIpv4Host(parts.join(" "));
|
|
6583
6612
|
return (costly ? 2 : 0) + (wayOut ? 0 : 1);
|
|
6584
6613
|
}
|
|
6585
|
-
|
|
6614
|
+
/** `relayOnly` ("Hide my IP from contacts", the connection keeps to relays): relay candidates only, whatever else is in the SDP. */
|
|
6615
|
+
function extractRtcParams(sdp, { relayOnly = false } = {}) {
|
|
6586
6616
|
let u = "";
|
|
6587
6617
|
let p = "";
|
|
6588
6618
|
let f = "";
|
|
@@ -6598,7 +6628,7 @@ function extractRtcParams(sdp) {
|
|
|
6598
6628
|
const parts = line.slice(12).split(" ");
|
|
6599
6629
|
if (parts.length < 8 || parts[1] !== "1" || parts[2].toLowerCase() !== "udp") continue;
|
|
6600
6630
|
const type = CANDIDATE_TYPES[parts[7]];
|
|
6601
|
-
if (!type) continue;
|
|
6631
|
+
if (!type || relayOnly && type !== "r") continue;
|
|
6602
6632
|
const compact = `${type},${parts[4]},${parts[5]}`;
|
|
6603
6633
|
if (found.some((c) => c.compact === compact)) continue;
|
|
6604
6634
|
found.push({
|
|
@@ -7645,6 +7675,13 @@ var PUBLISH_RETRY_MS = 4e3;
|
|
|
7645
7675
|
* meanwhile: each refusal keeps it first in line for that request (`WRITE_FIRST_MS`), and costs no request itself.
|
|
7646
7676
|
*/
|
|
7647
7677
|
var BUDGET_RETRY_MIN_MS = 250;
|
|
7678
|
+
/**
|
|
7679
|
+
* A background write the budget held back (`{ background: true }`) is not first in line for anything (`WRITE_FIRST_MS`
|
|
7680
|
+
* is a chat's or a group's write): it goes again when the budget frees one of its share, up to this long. Tried every
|
|
7681
|
+
* 4 s, an idle admin's daemon built and signed 1,041 packets in 9 minutes that the budget refused again (bug hunt,
|
|
7682
|
+
* 2026-10-19). Anything new to say goes at once all the same (`publish`).
|
|
7683
|
+
*/
|
|
7684
|
+
var BACKGROUND_RETRY_MAX_MS = 6e4;
|
|
7648
7685
|
/** Two reads are never closer than this, however long the last one took. */
|
|
7649
7686
|
var MIN_POLL_GAP_MS = 250;
|
|
7650
7687
|
/** Presence is a fresh packet: advertising peers republish this often… */
|
|
@@ -7688,6 +7725,8 @@ var LinkSession = class {
|
|
|
7688
7725
|
publishAgain = false;
|
|
7689
7726
|
/** What waits to go out is the presence heartbeat alone (`PRESENCE_HEARTBEAT`): nothing in the packet changed. */
|
|
7690
7727
|
upkeepOnly = false;
|
|
7728
|
+
/** The last write this link asked for was a background one (`retryDelay`). */
|
|
7729
|
+
wroteInBackground = false;
|
|
7691
7730
|
pollTimer = null;
|
|
7692
7731
|
heartbeatTimer = null;
|
|
7693
7732
|
lastActivity = Date.now();
|
|
@@ -8095,6 +8134,7 @@ var LinkSession = class {
|
|
|
8095
8134
|
const awaited = this.connected || this.presence.online || this.sentBuffer.length > 0 || this.callSignal !== null || this.awaitingPeer();
|
|
8096
8135
|
const takesBack = !rtcSignal && this.rtcSignalOut !== null;
|
|
8097
8136
|
const options = rtcSignal && rtcSignal !== this.rtcSignalOut ? { signal: true } : this.watching() ? { watch: true } : upkeep && (this.connected || takesBack) || !rtcSignal && !awaited ? { background: true } : void 0;
|
|
8137
|
+
this.wroteInBackground = options?.background === true;
|
|
8098
8138
|
await this.transport.publish(this.identity, built.records, options);
|
|
8099
8139
|
} catch (error) {
|
|
8100
8140
|
const ms = Date.now() - started, waiting = isDiscoveryBudgetError(error);
|
|
@@ -8141,9 +8181,13 @@ var LinkSession = class {
|
|
|
8141
8181
|
this.discoveryResult("publish");
|
|
8142
8182
|
return built.keptMessages;
|
|
8143
8183
|
}
|
|
8144
|
-
/**
|
|
8184
|
+
/**
|
|
8185
|
+
* When a publish that failed goes again: when the relays' budget frees a request, if that held it back; a chat's or a
|
|
8186
|
+
* group's write within `PUBLISH_RETRY_MS` meanwhile, which keeps it first in line, a background one when its share frees.
|
|
8187
|
+
*/
|
|
8145
8188
|
retryDelay(error) {
|
|
8146
|
-
|
|
8189
|
+
if (!isDiscoveryBudgetError(error)) return PUBLISH_RETRY_MS;
|
|
8190
|
+
return budgetRetryMs(error, BUDGET_RETRY_MIN_MS, this.wroteInBackground ? BACKGROUND_RETRY_MAX_MS : PUBLISH_RETRY_MS);
|
|
8147
8191
|
}
|
|
8148
8192
|
discoveryResult(operation, error) {
|
|
8149
8193
|
if (error !== void 0) this.discoveryErrors[operation] = `Could not ${operation} discovery: ${error instanceof Error ? error.message : String(error)}`;
|
|
@@ -8509,7 +8553,7 @@ var DataLink = class {
|
|
|
8509
8553
|
const signal = {
|
|
8510
8554
|
t: "o",
|
|
8511
8555
|
ts: this.myOfferTs,
|
|
8512
|
-
...extractRtcParams(pc.localDescription.sdp)
|
|
8556
|
+
...extractRtcParams(pc.localDescription.sdp, { relayOnly: keepsToRelays(pc) })
|
|
8513
8557
|
};
|
|
8514
8558
|
this.options.publishSignal(JSON.stringify(signal));
|
|
8515
8559
|
} catch {
|
|
@@ -8696,7 +8740,7 @@ var DataLink = class {
|
|
|
8696
8740
|
t: "a",
|
|
8697
8741
|
ts: Date.now(),
|
|
8698
8742
|
o: offer.ts,
|
|
8699
|
-
...extractRtcParams(pc.localDescription.sdp)
|
|
8743
|
+
...extractRtcParams(pc.localDescription.sdp, { relayOnly: keepsToRelays(pc) })
|
|
8700
8744
|
};
|
|
8701
8745
|
this.options.publishSignal(JSON.stringify(signal));
|
|
8702
8746
|
this.setState("connecting");
|
|
@@ -9270,10 +9314,13 @@ var PR_CHECKS = [
|
|
|
9270
9314
|
"failing",
|
|
9271
9315
|
"pending"
|
|
9272
9316
|
];
|
|
9317
|
+
/** The kinds a sender may take back (WISP 405 § Removing a card). */
|
|
9318
|
+
var REMOVABLE_KINDS = ["task", "routine"];
|
|
9273
9319
|
var ID$4 = /^[A-Za-z0-9_.:][A-Za-z0-9_.:-]{0,63}$/;
|
|
9274
9320
|
/** A button's id: 1 to 32 of `A-Z a-z 0-9 _ . : -`, not starting with `-`. */
|
|
9275
9321
|
var BUTTON_ID = /^[A-Za-z0-9_.:][A-Za-z0-9_.:-]{0,31}$/;
|
|
9276
|
-
|
|
9322
|
+
/** A routine's cron line, trimmed: 1 to 64 of `0-9 A-Z a-z * , / ? # -` and spaces (shown, never run). */
|
|
9323
|
+
var CRON_LINE = /^[0-9A-Za-z*,/?#\- ]{1,64}$/;
|
|
9277
9324
|
/**
|
|
9278
9325
|
* Whether a typed answer is a button's label or id (WISP 406 · Message Buttons): ignoring case and spaces at the ends.
|
|
9279
9326
|
* Not the device's locale's case: the presser's and the author's apps must agree ("I" is not "ı" anywhere).
|
|
@@ -9452,6 +9499,14 @@ function readStatusCard(raw, now = Date.now()) {
|
|
|
9452
9499
|
...raw.opened === true && { opened: true }
|
|
9453
9500
|
};
|
|
9454
9501
|
}
|
|
9502
|
+
if (raw.kind === "removed") {
|
|
9503
|
+
const of = oneOf(REMOVABLE_KINDS, raw.of);
|
|
9504
|
+
return of && {
|
|
9505
|
+
kind: "removed",
|
|
9506
|
+
id,
|
|
9507
|
+
of
|
|
9508
|
+
};
|
|
9509
|
+
}
|
|
9455
9510
|
const latest = now + MESSAGE_CLOCK_SKEW_MS;
|
|
9456
9511
|
if (raw.kind === "usage") return readUsage(raw, id, now);
|
|
9457
9512
|
const links = readLinks(raw.links);
|
|
@@ -9515,7 +9570,7 @@ function readStatusCard(raw, now = Date.now()) {
|
|
|
9515
9570
|
if (raw.kind === "routine") {
|
|
9516
9571
|
const name = cardLine(raw.name, STATUS_CARD_LIMITS.title), schedule = cardLine(raw.schedule, STATUS_CARD_LIMITS.schedule), state = oneOf(ROUTINE_STATES, raw.state);
|
|
9517
9572
|
if (!name || !schedule || !state) return void 0;
|
|
9518
|
-
const cron = typeof raw.cron === "string" &&
|
|
9573
|
+
const cron = typeof raw.cron === "string" && CRON_LINE.test(raw.cron.trim()) ? raw.cron.trim() : void 0;
|
|
9519
9574
|
const lastRun = readRun(raw.lastRun, now);
|
|
9520
9575
|
const nextRunAt = typeof raw.nextRunAt === "number" && Number.isSafeInteger(raw.nextRunAt) && raw.nextRunAt > 0 && raw.nextRunAt <= now + STATUS_CARD_LIMITS.nextRunMs ? raw.nextRunAt : void 0;
|
|
9521
9576
|
const runs = [];
|
|
@@ -9572,7 +9627,7 @@ function checkStatusCard(raw, now = Date.now()) {
|
|
|
9572
9627
|
if (!isObject$4(raw)) return { error: "A card is an object" };
|
|
9573
9628
|
const bytes = statusCardBytes(raw);
|
|
9574
9629
|
if (bytes > STATUS_CARD_LIMITS.bytes) return { error: `The card takes ${bytes} bytes; at most ${STATUS_CARD_LIMITS.bytes}` };
|
|
9575
|
-
if (raw.kind !== "task" && raw.kind !== "routine" && raw.kind !== "buttons" && raw.kind !== "app" && raw.kind !== "usage") return { error: "kind is task, routine, buttons, app or
|
|
9630
|
+
if (raw.kind !== "task" && raw.kind !== "routine" && raw.kind !== "buttons" && raw.kind !== "app" && raw.kind !== "usage" && raw.kind !== "removed") return { error: "kind is task, routine, buttons, app, usage or removed" };
|
|
9576
9631
|
if (typeof raw.id !== "string" || !ID$4.test(raw.id)) return { error: `id is 1 to ${STATUS_CARD_LIMITS.id} of A-Z a-z 0-9 _ . : - and does not start with -` };
|
|
9577
9632
|
const line = (field, value, max, required = false) => {
|
|
9578
9633
|
if (value === void 0 && !required) return null;
|
|
@@ -9595,7 +9650,11 @@ function checkStatusCard(raw, now = Date.now()) {
|
|
|
9595
9650
|
}
|
|
9596
9651
|
const share = (field, value) => value === void 0 || typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100 ? null : `${field} is a number from 0 to 100`;
|
|
9597
9652
|
const reset = (field, value) => value === void 0 || ahead(value, now) !== void 0 ? null : `${field} is a time in milliseconds, within a year`;
|
|
9598
|
-
if (raw.kind === "
|
|
9653
|
+
if (raw.kind === "removed") {
|
|
9654
|
+
if (!oneOf(REMOVABLE_KINDS, raw.of)) errors.push(`of is one of ${REMOVABLE_KINDS.join(", ")}`);
|
|
9655
|
+
const extra = Object.keys(raw).find((key) => key !== "kind" && key !== "id" && key !== "of");
|
|
9656
|
+
if (extra) errors.push(`a removed card takes only kind, id and of, not ${extra}`);
|
|
9657
|
+
} else if (raw.kind === "usage") {
|
|
9599
9658
|
if (raw.links !== void 0) errors.push("a usage card takes no links");
|
|
9600
9659
|
if (raw.left === void 0 && raw.used === void 0) errors.push("left (a percent) or used and limit");
|
|
9601
9660
|
errors.push(share("left", raw.left));
|
|
@@ -9702,7 +9761,7 @@ function checkStatusCard(raw, now = Date.now()) {
|
|
|
9702
9761
|
} else {
|
|
9703
9762
|
errors.push(line("name", raw.name, STATUS_CARD_LIMITS.title, true), line("schedule", raw.schedule, STATUS_CARD_LIMITS.schedule, true));
|
|
9704
9763
|
if (!oneOf(ROUTINE_STATES, raw.state)) errors.push(`state is one of ${ROUTINE_STATES.join(", ")}`);
|
|
9705
|
-
if (raw.cron !== void 0 && !(typeof raw.cron === "string" &&
|
|
9764
|
+
if (raw.cron !== void 0 && !(typeof raw.cron === "string" && CRON_LINE.test(raw.cron.trim()))) errors.push(`cron is a cron line of at most ${STATUS_CARD_LIMITS.cron} characters`);
|
|
9706
9765
|
if (raw.nextRunAt !== void 0 && !(typeof raw.nextRunAt === "number" && Number.isSafeInteger(raw.nextRunAt) && raw.nextRunAt > 0 && raw.nextRunAt <= now + STATUS_CARD_LIMITS.nextRunMs)) errors.push("nextRunAt is a time in milliseconds, within a year");
|
|
9707
9766
|
const run = (field, value) => {
|
|
9708
9767
|
if (!isObject$4(value)) return errors.push(`${field} is an object`);
|
|
@@ -9752,10 +9811,18 @@ function cardTimeUtc(ms) {
|
|
|
9752
9811
|
return `${new Date(ms).toISOString().slice(0, 16).replace("T", " ")} UTC`;
|
|
9753
9812
|
}
|
|
9754
9813
|
/**
|
|
9814
|
+
* The text a removed card's message carries (WISP 405 § Removing a card): "🗑 Task removed", with the card's title or
|
|
9815
|
+
* name when the sender knows it ("🗑 Task removed: Fix relay rotation"). An app without the `removed` kind shows it.
|
|
9816
|
+
*/
|
|
9817
|
+
function removedCardText(of, title) {
|
|
9818
|
+
return `🗑 ${of === "task" ? "Task" : "Routine"} removed${title ? `: ${title}` : ""}`;
|
|
9819
|
+
}
|
|
9820
|
+
/**
|
|
9755
9821
|
* The text a card's message carries: what an app without cards shows, the DHT floor carries, the chat list previews
|
|
9756
9822
|
* and search finds. Plain lines, the first naming the card, no bars or layout that would read badly elsewhere.
|
|
9757
9823
|
*/
|
|
9758
9824
|
function statusCardText(card) {
|
|
9825
|
+
if (card.kind === "removed") return removedCardText(card.of);
|
|
9759
9826
|
if (card.kind === "app") {
|
|
9760
9827
|
const named = `${card.title}${card.version ? ` ${card.version}` : ""}`;
|
|
9761
9828
|
return [card.opened ? `🧩 Opened ${named} in this chat (Ghostly app)` : `🧩 ${named} (Ghostly app)`, ...card.url ? [card.url] : []].join("\n");
|
|
@@ -10253,13 +10320,24 @@ function parseLinkPreview(raw, text) {
|
|
|
10253
10320
|
* message. A status card (`sc`, WISP 405 · Status Cards) may come with it too; a card message takes up to
|
|
10254
10321
|
* `STATUS_CARD_LIMITS.edits` edits, a number past `MAX_EDITS_PER_MESSAGE` holding only with a card. Older apps drop
|
|
10255
10322
|
* both frames: they have an id, but a `t` they do not know.
|
|
10323
|
+
*
|
|
10324
|
+
* A removal (WISP 400 § Delete for everyone) is the message's last edit, flagged `rm`, with a fallback text and
|
|
10325
|
+
* nothing else beside it; an app from before removals shows that text as the edit:
|
|
10326
|
+
*
|
|
10327
|
+
* {"t":"paired-edit","id":"<the message's wire id>","e":4,"ts":1790000000000,"m":"🗑 Message removed","rm":true}
|
|
10256
10328
|
*/
|
|
10257
10329
|
var EDIT_FRAME = "paired-edit";
|
|
10258
10330
|
var EDITED_FRAME = "paired-edited";
|
|
10331
|
+
/** A removal is numbered one past the message's last edit, so it may pass a card message's bound by one. */
|
|
10332
|
+
var MAX_REMOVAL_NUMBER = STATUS_CARD_LIMITS.edits + 1;
|
|
10333
|
+
/** The text a removal carries: only what an app from before removals shows in the message's place. */
|
|
10334
|
+
var REMOVED_TEXT = "🗑 Message removed";
|
|
10259
10335
|
var EDIT_RATE_WINDOW_MS = 1e4;
|
|
10260
10336
|
/** An edit of a message not here yet waits this long for it, at most `EDIT_BUFFER_MAX` of them per chat. */
|
|
10261
10337
|
var EDIT_BUFFER_MS = 6e4;
|
|
10262
10338
|
var ID$3 = /^[A-Za-z0-9_-]{22}$/;
|
|
10339
|
+
/** A removal may name a file too (WISP 401 § Edits): its offer's id, as a file's id holds (`files.ts`). */
|
|
10340
|
+
var REMOVAL_ID = /^[A-Za-z0-9_-]{8,64}$/;
|
|
10263
10341
|
/** Largest edit frame sent with a preview: the preview is left out past it, as with a message. */
|
|
10264
10342
|
var MAX_EDIT_FRAME = 57344;
|
|
10265
10343
|
/**
|
|
@@ -10267,6 +10345,14 @@ var MAX_EDIT_FRAME = 57344;
|
|
|
10267
10345
|
* goes: it is bounded well under what the frame has room for, and it is what a card message is.
|
|
10268
10346
|
*/
|
|
10269
10347
|
function editFrame(edit) {
|
|
10348
|
+
if (edit.rm) return JSON.stringify({
|
|
10349
|
+
t: EDIT_FRAME,
|
|
10350
|
+
id: edit.id,
|
|
10351
|
+
e: edit.e,
|
|
10352
|
+
ts: edit.ts,
|
|
10353
|
+
m: edit.m,
|
|
10354
|
+
rm: true
|
|
10355
|
+
});
|
|
10270
10356
|
const base = {
|
|
10271
10357
|
t: EDIT_FRAME,
|
|
10272
10358
|
id: edit.id,
|
|
@@ -10295,6 +10381,10 @@ function editedFrame(id, e) {
|
|
|
10295
10381
|
function validEditNumber(e) {
|
|
10296
10382
|
return Number.isSafeInteger(e) && e >= 1 && e <= 100;
|
|
10297
10383
|
}
|
|
10384
|
+
/** A removal's number: any up to one past a card message's bound, card or not. */
|
|
10385
|
+
function validRemovalNumber(e) {
|
|
10386
|
+
return Number.isSafeInteger(e) && e >= 1 && e <= MAX_REMOVAL_NUMBER;
|
|
10387
|
+
}
|
|
10298
10388
|
/** A message's new text: not empty, no space around it, within a chat message's bytes. The same on a session and on the DHT. */
|
|
10299
10389
|
function validEditMessage(m) {
|
|
10300
10390
|
return typeof m === "string" && !!m.trim() && m === m.trim() && utf8Encode(m).length <= LIMITS.maxChatMessageBytes;
|
|
@@ -10302,14 +10392,22 @@ function validEditMessage(m) {
|
|
|
10302
10392
|
/**
|
|
10303
10393
|
* The edit a `paired-edit` frame says, or null when it is malformed (then it says nothing and is not confirmed). A
|
|
10304
10394
|
* preview or a card that does not hold is dropped, never the edit; an edit numbered past `MAX_EDITS_PER_MESSAGE`
|
|
10305
|
-
* holds only with a card.
|
|
10395
|
+
* holds only with a card. A removal carries its fallback text alone, and a `rm` other than `true` is no edit.
|
|
10306
10396
|
*/
|
|
10307
10397
|
function parseEditFrame(frame, now = Date.now()) {
|
|
10308
10398
|
if (frame?.t !== "paired-edit") return null;
|
|
10309
|
-
const { id, e, ts, m } = frame;
|
|
10310
|
-
if (
|
|
10399
|
+
const { id, e, ts, m, rm } = frame;
|
|
10400
|
+
if (rm !== void 0 && rm !== true) return null;
|
|
10401
|
+
if (typeof id !== "string" || !(rm ? REMOVAL_ID : ID$3).test(id) || typeof e !== "number" || !(rm ? validRemovalNumber(e) : cardEditNumber(e))) return null;
|
|
10311
10402
|
if (typeof ts !== "number" || !Number.isSafeInteger(ts) || ts <= 0) return null;
|
|
10312
10403
|
if (!validEditMessage(m)) return null;
|
|
10404
|
+
if (rm) return {
|
|
10405
|
+
id,
|
|
10406
|
+
e,
|
|
10407
|
+
ts,
|
|
10408
|
+
m,
|
|
10409
|
+
rm
|
|
10410
|
+
};
|
|
10313
10411
|
const sc = frame.sc === void 0 ? void 0 : readStatusCard(frame.sc, now);
|
|
10314
10412
|
if (!validEditNumber(e) && !sc) return null;
|
|
10315
10413
|
const pv = frame.pv === void 0 ? void 0 : parseLinkPreview(frame.pv, m);
|
|
@@ -10325,7 +10423,7 @@ function parseEditFrame(frame, now = Date.now()) {
|
|
|
10325
10423
|
/** The confirmation a `paired-edited` frame says, or null when it is malformed. */
|
|
10326
10424
|
function parseEditedFrame(frame) {
|
|
10327
10425
|
if (frame?.t !== "paired-edited") return null;
|
|
10328
|
-
return typeof frame.id === "string" &&
|
|
10426
|
+
return typeof frame.id === "string" && REMOVAL_ID.test(frame.id) && validRemovalNumber(frame.e) ? {
|
|
10329
10427
|
id: frame.id,
|
|
10330
10428
|
e: frame.e
|
|
10331
10429
|
} : null;
|
|
@@ -10382,7 +10480,7 @@ var VIDEO_LIMITS = {
|
|
|
10382
10480
|
function isVideoMime(mime) {
|
|
10383
10481
|
return mime.split(";")[0].trim().toLowerCase().startsWith("video/");
|
|
10384
10482
|
}
|
|
10385
|
-
var BASE64URL = /^[A-Za-z0-9_-]+$/;
|
|
10483
|
+
var BASE64URL$1 = /^[A-Za-z0-9_-]+$/;
|
|
10386
10484
|
var JPEG_START = [
|
|
10387
10485
|
255,
|
|
10388
10486
|
216,
|
|
@@ -10405,7 +10503,7 @@ function parseVideoMeta(value, mime) {
|
|
|
10405
10503
|
width,
|
|
10406
10504
|
height
|
|
10407
10505
|
};
|
|
10408
|
-
if (typeof poster === "string" && poster.length <= Math.ceil(VIDEO_LIMITS.maxPosterBytes * 4 / 3) && BASE64URL.test(poster)) try {
|
|
10506
|
+
if (typeof poster === "string" && poster.length <= Math.ceil(VIDEO_LIMITS.maxPosterBytes * 4 / 3) && BASE64URL$1.test(poster)) try {
|
|
10409
10507
|
const bytes = fromBase64Url(poster);
|
|
10410
10508
|
const size = bytes.length <= VIDEO_LIMITS.maxPosterBytes && JPEG_START.every((b, i) => bytes[i] === b) ? imageSize(bytes) : void 0;
|
|
10411
10509
|
if (size && Math.max(size.width, size.height) <= VIDEO_LIMITS.posterEdge) meta.poster = poster;
|
|
@@ -10511,6 +10609,27 @@ function downsamplePeaks(levels, bars = VOICE_LIMITS.bars) {
|
|
|
10511
10609
|
}
|
|
10512
10610
|
return out;
|
|
10513
10611
|
}
|
|
10612
|
+
var EXTENSIONS = {
|
|
10613
|
+
"audio/webm": "webm",
|
|
10614
|
+
"audio/ogg": "ogg",
|
|
10615
|
+
"audio/mp4": "m4a",
|
|
10616
|
+
"audio/x-m4a": "m4a",
|
|
10617
|
+
"audio/mpeg": "mp3",
|
|
10618
|
+
"audio/aac": "aac",
|
|
10619
|
+
"audio/wav": "wav"
|
|
10620
|
+
};
|
|
10621
|
+
function voiceName(prefix, mime, timestamp) {
|
|
10622
|
+
const date = new Date(timestamp);
|
|
10623
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
10624
|
+
return `${prefix} ${`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}.${pad(date.getMinutes())}.${pad(date.getSeconds())}`}.${EXTENSIONS[baseMime(mime)] ?? "audio"}`;
|
|
10625
|
+
}
|
|
10626
|
+
/**
|
|
10627
|
+
* The name a downloaded voice message is saved under, made here from the message's time and its
|
|
10628
|
+
* type (the sender's own name for it is not used): "Ghostly voice 2026-09-27 14.01.30.webm".
|
|
10629
|
+
*/
|
|
10630
|
+
function voiceDownloadName(mime, timestamp) {
|
|
10631
|
+
return voiceName("Ghostly voice", mime, timestamp);
|
|
10632
|
+
}
|
|
10514
10633
|
/** `0:07`, `12:45`: minutes and seconds, as a player shows them. */
|
|
10515
10634
|
function formatVoiceDuration(ms) {
|
|
10516
10635
|
const total = Math.max(0, Math.floor((Number.isFinite(ms) ? ms : 0) / 1e3));
|
|
@@ -10534,6 +10653,12 @@ var MAX_NAME_LENGTH = 200;
|
|
|
10534
10653
|
*/
|
|
10535
10654
|
var INVISIBLE = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu;
|
|
10536
10655
|
/**
|
|
10656
|
+
* Characters that draw as blank but are not spaces: the Hangul fillers, the braille blank, the combining grapheme
|
|
10657
|
+
* joiner. A run of them, or of spaces (em space and the like), would push the real extension out of view:
|
|
10658
|
+
* "Invoice.pdf" + 120 blanks + ".exe" reads as a PDF in a truncated bubble.
|
|
10659
|
+
*/
|
|
10660
|
+
var BLANK = /[\u034F\u115F\u1160\u2800\u3164\uFFA0]/gu;
|
|
10661
|
+
/**
|
|
10537
10662
|
* Names Windows keeps for devices, whatever the case, with any extension, and with spaces before the dot:
|
|
10538
10663
|
* "CON", "nul.txt", "COM1 .log" open a device there, not a file.
|
|
10539
10664
|
*/
|
|
@@ -10550,7 +10675,7 @@ function shorten(name) {
|
|
|
10550
10675
|
}
|
|
10551
10676
|
/** A file name is display text and a download suggestion, never a path. */
|
|
10552
10677
|
function sanitizeFileName(name) {
|
|
10553
|
-
const clean = shorten(name.replace(INVISIBLE, "").replace(/[/\\:]/g, "").replace(/^[\s.]+/, "").trim());
|
|
10678
|
+
const clean = shorten(name.replace(INVISIBLE, "").replace(BLANK, "").replace(/[/\\:]/g, "").replace(/\s+/gu, " ").replace(/^[\s.]+/, "").trim());
|
|
10554
10679
|
if (WINDOWS_DEVICE.test(clean)) return shorten("_" + clean);
|
|
10555
10680
|
return clean || "file";
|
|
10556
10681
|
}
|
|
@@ -15480,6 +15605,11 @@ var UPGRADE_CAPABILITY = "upgrade/1";
|
|
|
15480
15605
|
* `pairedApps.ts`). Offered only while the apps feature is on.
|
|
15481
15606
|
*/
|
|
15482
15607
|
var APPS_CAPABILITY = "apps/1";
|
|
15608
|
+
/**
|
|
15609
|
+
* The read lane of mini-apps (WISP 1200 § A read lane to the contact, `pairedAppRanges.ts`): the contact's app reads a
|
|
15610
|
+
* file this side's app serves, in ranges, outside `apps/1`. Offered beside `apps/1` only.
|
|
15611
|
+
*/
|
|
15612
|
+
var APP_RANGES_CAPABILITY = "app-ranges/1";
|
|
15483
15613
|
/** Every capability this app knows on a session: what `receive` reports changes of. */
|
|
15484
15614
|
var KNOWN_SESSION_CAPABILITIES = [
|
|
15485
15615
|
CALLS_CAPABILITY,
|
|
@@ -15494,7 +15624,8 @@ var KNOWN_SESSION_CAPABILITIES = [
|
|
|
15494
15624
|
STATUS_CARD_CAPABILITY,
|
|
15495
15625
|
BUTTONS_CAPABILITY,
|
|
15496
15626
|
UPGRADE_CAPABILITY,
|
|
15497
|
-
APPS_CAPABILITY
|
|
15627
|
+
APPS_CAPABILITY,
|
|
15628
|
+
APP_RANGES_CAPABILITY
|
|
15498
15629
|
];
|
|
15499
15630
|
var SESSION_CAPABILITIES_FRAME = "paired-capabilities";
|
|
15500
15631
|
var MAX_ENTRIES$1 = 32;
|
|
@@ -15826,6 +15957,433 @@ var AppSessions = class {
|
|
|
15826
15957
|
}
|
|
15827
15958
|
};
|
|
15828
15959
|
//#endregion
|
|
15960
|
+
//#region ../core/src/pairedAppRanges.ts
|
|
15961
|
+
/**
|
|
15962
|
+
* The read lane of mini-apps in a 1:1 chat (WISP 1200 § A read lane to the contact: `app-ranges/1`): the contact's app
|
|
15963
|
+
* reads, in ranges, a file this side's app serves, over the chat's session but not through `apps/1`.
|
|
15964
|
+
*
|
|
15965
|
+
* {"t":"ar-get","a":"<chat app id>","s":"<serve id>","r":7,"o":0,"n":1048576}
|
|
15966
|
+
* {"t":"ar-data","a":"<chat app id>","r":7,"o":0,"d":"<base64url>"}
|
|
15967
|
+
* {"t":"ar-end","a":"<chat app id>","r":7,"z":734003200}
|
|
15968
|
+
* {"t":"ar-err","a":"<chat app id>","r":7,"e":"not-served"}
|
|
15969
|
+
* {"t":"ar-cancel","a":"<chat app id>","r":7}
|
|
15970
|
+
*
|
|
15971
|
+
* The asker sends `ar-get` (request `r`, a number of its own, for `n` bytes at offset `o` of serve `s`) and may send
|
|
15972
|
+
* `ar-cancel`; the server answers with the bytes in chunks of at most `APP_RANGE_LIMITS.chunkBytes`, then `ar-end`
|
|
15973
|
+
* once every byte asked was sent (fewer at the end of the file), with `z` the served file's size, or `ar-err` instead of
|
|
15974
|
+
* any. A read of one byte at 0 is how the asker learns the size. Where `files/4` is on,
|
|
15975
|
+
* a chunk is a binary message of kind `APP_RANGE_DATA_KIND` (`encodeAppRangeData`) in place of `ar-data`. It needs
|
|
15976
|
+
* `app-ranges/1` in `paired-capabilities` on both sides. A reader ignores keys it does not know, so a later version
|
|
15977
|
+
* can add some.
|
|
15978
|
+
*/
|
|
15979
|
+
var APP_RANGE_FRAMES = /* @__PURE__ */ new Set([
|
|
15980
|
+
"ar-get",
|
|
15981
|
+
"ar-data",
|
|
15982
|
+
"ar-end",
|
|
15983
|
+
"ar-err",
|
|
15984
|
+
"ar-cancel"
|
|
15985
|
+
]);
|
|
15986
|
+
var APP_RANGE_LIMITS = {
|
|
15987
|
+
/** One `ar-get`, at most: as one `remote.read` of the app. */
|
|
15988
|
+
requestBytes: 1048576,
|
|
15989
|
+
/** One chunk, `ar-data` or binary: as a chat file's. */
|
|
15990
|
+
chunkBytes: 16384,
|
|
15991
|
+
/** The largest request number: it is 4 bytes in a binary chunk. */
|
|
15992
|
+
maxRequest: 4294967295,
|
|
15993
|
+
/** Requests a server takes in flight per app; one more is answered `busy`. An asker keeps the rest waiting. */
|
|
15994
|
+
inFlight: 4,
|
|
15995
|
+
/**
|
|
15996
|
+
* The bytes a server takes asks for in one second, its apps together: one more is answered `busy`. Counted as they
|
|
15997
|
+
* are asked, so a cancelled one counts as the read it started. Twice the asking app's own budget (16 MiB a second).
|
|
15998
|
+
*/
|
|
15999
|
+
bytesPerSecond: 33554432
|
|
16000
|
+
};
|
|
16001
|
+
/**
|
|
16002
|
+
* What an `ar-err` says. `not-served`: no serve of that id on this session (never given, or ended); `changed` and
|
|
16003
|
+
* `gone`: the file under it, as `files.read` says them; `busy`: past the requests the server takes in flight. A
|
|
16004
|
+
* later version may add one: an asker reads a code it does not know as a failure.
|
|
16005
|
+
*/
|
|
16006
|
+
var APP_RANGE_ERRORS = [
|
|
16007
|
+
"not-served",
|
|
16008
|
+
"changed",
|
|
16009
|
+
"gone",
|
|
16010
|
+
"busy"
|
|
16011
|
+
];
|
|
16012
|
+
/** A serve id as it is on the wire: 22 base64url characters (16 random bytes, no padding), as a chat app id. */
|
|
16013
|
+
var isServeId = isChatAppId;
|
|
16014
|
+
var isRequest = (value) => typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= APP_RANGE_LIMITS.maxRequest;
|
|
16015
|
+
var isOffset = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
16016
|
+
var ERROR_CODE = /^[a-z][a-z-]{0,31}$/;
|
|
16017
|
+
var BASE64URL = /^[A-Za-z0-9_-]*$/;
|
|
16018
|
+
/** The bytes of `d`, or null when it is not 1 to `chunkBytes` bytes of canonical base64url without padding. */
|
|
16019
|
+
function appRangeChunk(d) {
|
|
16020
|
+
if (typeof d !== "string" || !d.length || d.length % 4 === 1 || d.length > Math.ceil(APP_RANGE_LIMITS.chunkBytes * 4 / 3) || !BASE64URL.test(d)) return null;
|
|
16021
|
+
let bytes;
|
|
16022
|
+
try {
|
|
16023
|
+
bytes = fromBase64Url(d);
|
|
16024
|
+
} catch {
|
|
16025
|
+
return null;
|
|
16026
|
+
}
|
|
16027
|
+
return bytes.length && bytes.length <= APP_RANGE_LIMITS.chunkBytes && toBase64Url(bytes) === d ? bytes : null;
|
|
16028
|
+
}
|
|
16029
|
+
function appRangeGetFrame(app, serve, request, offset, length) {
|
|
16030
|
+
const frame = {
|
|
16031
|
+
t: "ar-get",
|
|
16032
|
+
a: app,
|
|
16033
|
+
s: serve,
|
|
16034
|
+
r: request,
|
|
16035
|
+
o: offset,
|
|
16036
|
+
n: length
|
|
16037
|
+
};
|
|
16038
|
+
if (!readAppRangeFrame(frame).ok) throw new Error("Not an app range request");
|
|
16039
|
+
return frame;
|
|
16040
|
+
}
|
|
16041
|
+
function appRangeDataFrame(app, request, offset, data) {
|
|
16042
|
+
const frame = {
|
|
16043
|
+
t: "ar-data",
|
|
16044
|
+
a: app,
|
|
16045
|
+
r: request,
|
|
16046
|
+
o: offset,
|
|
16047
|
+
d: toBase64Url(data)
|
|
16048
|
+
};
|
|
16049
|
+
if (!readAppRangeFrame(frame).ok) throw new Error("Not app range data");
|
|
16050
|
+
return frame;
|
|
16051
|
+
}
|
|
16052
|
+
function appRangeEndFrame(app, request, size) {
|
|
16053
|
+
if (!isChatAppId(app) || !isRequest(request) || !isOffset(size)) throw new Error("Not an app range end");
|
|
16054
|
+
return {
|
|
16055
|
+
t: "ar-end",
|
|
16056
|
+
a: app,
|
|
16057
|
+
r: request,
|
|
16058
|
+
z: size
|
|
16059
|
+
};
|
|
16060
|
+
}
|
|
16061
|
+
function appRangeErrorFrame(app, request, error) {
|
|
16062
|
+
if (!isChatAppId(app) || !isRequest(request) || !APP_RANGE_ERRORS.includes(error)) throw new Error("Not an app range error");
|
|
16063
|
+
return {
|
|
16064
|
+
t: "ar-err",
|
|
16065
|
+
a: app,
|
|
16066
|
+
r: request,
|
|
16067
|
+
e: error
|
|
16068
|
+
};
|
|
16069
|
+
}
|
|
16070
|
+
function appRangeCancelFrame(app, request) {
|
|
16071
|
+
if (!isChatAppId(app) || !isRequest(request)) throw new Error("Not an app range cancel");
|
|
16072
|
+
return {
|
|
16073
|
+
t: "ar-cancel",
|
|
16074
|
+
a: app,
|
|
16075
|
+
r: request
|
|
16076
|
+
};
|
|
16077
|
+
}
|
|
16078
|
+
/**
|
|
16079
|
+
* An `ar-*` frame as the peer sent it, or why a reader must refuse it: an unknown `t`, no valid `a`, an `ar-get`
|
|
16080
|
+
* without a valid `s`, a request number that is not 0 to 2^32 - 1, an offset that is not a safe whole number at or
|
|
16081
|
+
* above 0, an `n` that is not 1 to `requestBytes` (or runs past 2^53 - 1), a `d` that is not 1 to `chunkBytes` bytes of
|
|
16082
|
+
* canonical base64url, an `e` that is not a code (lower case letters and `-`, at most 32), an `ar-end` whose `z` is not
|
|
16083
|
+
* a size (a safe whole number at or above 0). Other keys are ignored.
|
|
16084
|
+
*/
|
|
16085
|
+
function readAppRangeFrame(frame) {
|
|
16086
|
+
const refuse = (refusal) => ({
|
|
16087
|
+
ok: false,
|
|
16088
|
+
refusal
|
|
16089
|
+
});
|
|
16090
|
+
const t = frame?.t;
|
|
16091
|
+
if (typeof t !== "string" || !APP_RANGE_FRAMES.has(t)) return refuse("not-ranges");
|
|
16092
|
+
if (!isChatAppId(frame.a)) return refuse("bad-a");
|
|
16093
|
+
const a = frame.a;
|
|
16094
|
+
if (t === "ar-get" && !isServeId(frame.s)) return refuse("bad-s");
|
|
16095
|
+
if (!isRequest(frame.r)) return refuse("bad-r");
|
|
16096
|
+
const r = frame.r;
|
|
16097
|
+
switch (t) {
|
|
16098
|
+
case "ar-get": {
|
|
16099
|
+
if (!isOffset(frame.o)) return refuse("bad-o");
|
|
16100
|
+
const n = frame.n;
|
|
16101
|
+
if (typeof n !== "number" || !Number.isInteger(n) || n < 1 || n > APP_RANGE_LIMITS.requestBytes || !Number.isSafeInteger(frame.o + n)) return refuse("bad-n");
|
|
16102
|
+
return {
|
|
16103
|
+
ok: true,
|
|
16104
|
+
frame: {
|
|
16105
|
+
t,
|
|
16106
|
+
a,
|
|
16107
|
+
s: frame.s,
|
|
16108
|
+
r,
|
|
16109
|
+
o: frame.o,
|
|
16110
|
+
n
|
|
16111
|
+
}
|
|
16112
|
+
};
|
|
16113
|
+
}
|
|
16114
|
+
case "ar-data":
|
|
16115
|
+
if (!isOffset(frame.o)) return refuse("bad-o");
|
|
16116
|
+
if (!appRangeChunk(frame.d)) return refuse("bad-d");
|
|
16117
|
+
return {
|
|
16118
|
+
ok: true,
|
|
16119
|
+
frame: {
|
|
16120
|
+
t,
|
|
16121
|
+
a,
|
|
16122
|
+
r,
|
|
16123
|
+
o: frame.o,
|
|
16124
|
+
d: frame.d
|
|
16125
|
+
}
|
|
16126
|
+
};
|
|
16127
|
+
case "ar-err": return typeof frame.e === "string" && ERROR_CODE.test(frame.e) ? {
|
|
16128
|
+
ok: true,
|
|
16129
|
+
frame: {
|
|
16130
|
+
t,
|
|
16131
|
+
a,
|
|
16132
|
+
r,
|
|
16133
|
+
e: frame.e
|
|
16134
|
+
}
|
|
16135
|
+
} : refuse("bad-e");
|
|
16136
|
+
case "ar-end": return isOffset(frame.z) ? {
|
|
16137
|
+
ok: true,
|
|
16138
|
+
frame: {
|
|
16139
|
+
t,
|
|
16140
|
+
a,
|
|
16141
|
+
r,
|
|
16142
|
+
z: frame.z
|
|
16143
|
+
}
|
|
16144
|
+
} : refuse("bad-z");
|
|
16145
|
+
default: return {
|
|
16146
|
+
ok: true,
|
|
16147
|
+
frame: {
|
|
16148
|
+
t: "ar-cancel",
|
|
16149
|
+
a,
|
|
16150
|
+
r
|
|
16151
|
+
}
|
|
16152
|
+
};
|
|
16153
|
+
}
|
|
16154
|
+
}
|
|
16155
|
+
var HEAD = 29;
|
|
16156
|
+
/** The binary message for the bytes of request `request` of app `app` at `offset`. Throws on what no receiver would take. */
|
|
16157
|
+
function encodeAppRangeData(app, request, offset, data) {
|
|
16158
|
+
if (!isChatAppId(app) || !isRequest(request) || !isOffset(offset) || !data.length || data.length > APP_RANGE_LIMITS.chunkBytes) throw new Error("Invalid app range data");
|
|
16159
|
+
const id = fromBase64Url(app);
|
|
16160
|
+
if (id.length !== 16) throw new Error("Invalid app range data");
|
|
16161
|
+
const out = new Uint8Array(HEAD + data.length);
|
|
16162
|
+
out[0] = 5;
|
|
16163
|
+
out.set(id, 1);
|
|
16164
|
+
const view = new DataView(out.buffer);
|
|
16165
|
+
view.setUint32(17, request);
|
|
16166
|
+
view.setUint32(21, Math.floor(offset / 2 ** 32));
|
|
16167
|
+
view.setUint32(25, offset % 2 ** 32);
|
|
16168
|
+
out.set(data, HEAD);
|
|
16169
|
+
return out;
|
|
16170
|
+
}
|
|
16171
|
+
/** What a binary message from the contact says, or null when it is not well-formed app range data. `data` is a view of `message`. */
|
|
16172
|
+
function decodeAppRangeData(message) {
|
|
16173
|
+
if (message.length <= HEAD || message[0] !== 5 || message.length - HEAD > APP_RANGE_LIMITS.chunkBytes) return null;
|
|
16174
|
+
const view = new DataView(message.buffer, message.byteOffset, message.byteLength);
|
|
16175
|
+
const high = view.getUint32(21);
|
|
16176
|
+
if (high > 2097151) return null;
|
|
16177
|
+
return {
|
|
16178
|
+
a: toBase64Url(message.slice(1, 17)),
|
|
16179
|
+
r: view.getUint32(17),
|
|
16180
|
+
o: high * 2 ** 32 + view.getUint32(25),
|
|
16181
|
+
data: message.subarray(HEAD)
|
|
16182
|
+
};
|
|
16183
|
+
}
|
|
16184
|
+
var slot = (app, request) => `${app}:${request}`;
|
|
16185
|
+
/**
|
|
16186
|
+
* The read lane of one chat, both ways (WISP 1200 § A read lane to the contact). As the side that serves it keeps the
|
|
16187
|
+
* serve ids it gave out on this session and answers the contact's `ar-get` for those only, at most
|
|
16188
|
+
* `APP_RANGE_LIMITS.inFlight` per app and `bytesPerSecond` asked in all (`busy` past either); the bytes themselves
|
|
16189
|
+
* are read and sent by the session, which calls `finish` or `fail` for each task. As the side that asks it sends at
|
|
16190
|
+
* most `inFlight` requests per app, keeps
|
|
16191
|
+
* the rest waiting, and puts each answer back together, in order, from the offset asked. Serves and requests last one
|
|
16192
|
+
* session: `reset` ends them all, `closeApp` those of one app.
|
|
16193
|
+
*/
|
|
16194
|
+
var AppRanges = class {
|
|
16195
|
+
send;
|
|
16196
|
+
newServeId;
|
|
16197
|
+
now;
|
|
16198
|
+
serves = /* @__PURE__ */ new Map();
|
|
16199
|
+
serving = /* @__PURE__ */ new Map();
|
|
16200
|
+
/** Tasks cancelled or unserved that the session is still reading or sending: each counts in its app's `inFlight` until settled. */
|
|
16201
|
+
draining = /* @__PURE__ */ new Set();
|
|
16202
|
+
asking = /* @__PURE__ */ new Map();
|
|
16203
|
+
waiting = /* @__PURE__ */ new Map();
|
|
16204
|
+
nextRequest = 0;
|
|
16205
|
+
/** The asks taken in the last second (when, how many bytes) and their sum: what `bytesPerSecond` counts. Kept across sessions. */
|
|
16206
|
+
taken = [];
|
|
16207
|
+
takenBytes = 0;
|
|
16208
|
+
constructor(send, newServeId = () => toBase64Url(randomBytes(16)), now = Date.now) {
|
|
16209
|
+
this.send = send;
|
|
16210
|
+
this.newServeId = newServeId;
|
|
16211
|
+
this.now = now;
|
|
16212
|
+
}
|
|
16213
|
+
/** Lets the contact's `app` read `file` on this session: the serve id to tell it. */
|
|
16214
|
+
serve(app, file) {
|
|
16215
|
+
if (!isChatAppId(app)) throw new Error("Not a chat app id");
|
|
16216
|
+
let id = this.newServeId();
|
|
16217
|
+
while (this.serves.has(id)) id = this.newServeId();
|
|
16218
|
+
this.serves.set(id, {
|
|
16219
|
+
app,
|
|
16220
|
+
file
|
|
16221
|
+
});
|
|
16222
|
+
return id;
|
|
16223
|
+
}
|
|
16224
|
+
/** Ends one serve: requests under it still being sent stop. False when it was not served. */
|
|
16225
|
+
unserve(serveId) {
|
|
16226
|
+
if (!this.serves.get(serveId)) return false;
|
|
16227
|
+
this.serves.delete(serveId);
|
|
16228
|
+
for (const task of this.serving.values()) if (task.serve === serveId) this.drop(task, true);
|
|
16229
|
+
return true;
|
|
16230
|
+
}
|
|
16231
|
+
/** The serve ids `app` has given out on this session (what the panel's "Sharing with" line shows). */
|
|
16232
|
+
servesOf(app) {
|
|
16233
|
+
return [...this.serves].filter(([, serve]) => serve.app === app).map(([id]) => id);
|
|
16234
|
+
}
|
|
16235
|
+
/** An `ar-get` from the contact: the task to read and send, or null when it was refused (the refusal is sent) or dropped. */
|
|
16236
|
+
receiveGet(frame) {
|
|
16237
|
+
const { a: app, r: request } = frame;
|
|
16238
|
+
if (this.serving.has(slot(app, request))) return null;
|
|
16239
|
+
const serve = this.serves.get(frame.s);
|
|
16240
|
+
if (!serve || serve.app !== app) {
|
|
16241
|
+
this.send(appRangeErrorFrame(app, request, "not-served"));
|
|
16242
|
+
return null;
|
|
16243
|
+
}
|
|
16244
|
+
if ([...this.serving.values(), ...this.draining].filter((task) => task.app === app).length >= APP_RANGE_LIMITS.inFlight) {
|
|
16245
|
+
this.send(appRangeErrorFrame(app, request, "busy"));
|
|
16246
|
+
return null;
|
|
16247
|
+
}
|
|
16248
|
+
const at = this.now();
|
|
16249
|
+
while (this.taken.length && this.taken[0].at <= at - 1e3) this.takenBytes -= this.taken.shift().bytes;
|
|
16250
|
+
if (this.takenBytes + frame.n > APP_RANGE_LIMITS.bytesPerSecond) {
|
|
16251
|
+
this.send(appRangeErrorFrame(app, request, "busy"));
|
|
16252
|
+
return null;
|
|
16253
|
+
}
|
|
16254
|
+
this.taken.push({
|
|
16255
|
+
at,
|
|
16256
|
+
bytes: frame.n
|
|
16257
|
+
});
|
|
16258
|
+
this.takenBytes += frame.n;
|
|
16259
|
+
const task = {
|
|
16260
|
+
app,
|
|
16261
|
+
request,
|
|
16262
|
+
serve: frame.s,
|
|
16263
|
+
file: serve.file,
|
|
16264
|
+
offset: frame.o,
|
|
16265
|
+
length: frame.n,
|
|
16266
|
+
live: true
|
|
16267
|
+
};
|
|
16268
|
+
this.serving.set(slot(app, request), task);
|
|
16269
|
+
return task;
|
|
16270
|
+
}
|
|
16271
|
+
/** An `ar-cancel` from the contact: that request sends nothing more, and its number frees; its place frees once it is settled. */
|
|
16272
|
+
receiveCancel(frame) {
|
|
16273
|
+
const task = this.serving.get(slot(frame.a, frame.r));
|
|
16274
|
+
if (task) this.drop(task, true);
|
|
16275
|
+
}
|
|
16276
|
+
/** Every byte of `task` was sent: `ar-end` goes with the file's size, unless the task was dropped meanwhile. */
|
|
16277
|
+
finish(task, size) {
|
|
16278
|
+
if (this.take(task)) this.send(appRangeEndFrame(task.app, task.request, size));
|
|
16279
|
+
}
|
|
16280
|
+
/** The file under `task` could not be read: `ar-err` goes in place of the rest, unless the task was dropped meanwhile. */
|
|
16281
|
+
fail(task, error) {
|
|
16282
|
+
if (this.take(task)) this.send(appRangeErrorFrame(task.app, task.request, error));
|
|
16283
|
+
}
|
|
16284
|
+
/** The session stopped working on `task` without an answer (it is no longer live, or the channel went): its place frees, nothing is sent. */
|
|
16285
|
+
release(task) {
|
|
16286
|
+
this.take(task);
|
|
16287
|
+
}
|
|
16288
|
+
/** Reads `length` bytes at `offset` of what the contact's `app` serves as `serve`: the bytes (fewer at the end) and the file's size. */
|
|
16289
|
+
read(app, serve, offset, length) {
|
|
16290
|
+
appRangeGetFrame(app, serve, 0, offset, length);
|
|
16291
|
+
return new Promise((resolve, reject) => {
|
|
16292
|
+
const ask = {
|
|
16293
|
+
app,
|
|
16294
|
+
serve,
|
|
16295
|
+
offset,
|
|
16296
|
+
length,
|
|
16297
|
+
chunks: [],
|
|
16298
|
+
got: 0,
|
|
16299
|
+
resolve,
|
|
16300
|
+
reject
|
|
16301
|
+
};
|
|
16302
|
+
const queue = this.waiting.get(app) ?? [];
|
|
16303
|
+
queue.push(ask);
|
|
16304
|
+
this.waiting.set(app, queue);
|
|
16305
|
+
this.pump(app);
|
|
16306
|
+
});
|
|
16307
|
+
}
|
|
16308
|
+
/** Bytes of a request of ours, from `ar-data` or a binary chunk. Out of order or past what was asked fails the request. */
|
|
16309
|
+
receiveData(app, request, offset, data) {
|
|
16310
|
+
const ask = this.asking.get(slot(app, request));
|
|
16311
|
+
if (!ask) return;
|
|
16312
|
+
if (offset !== ask.offset + ask.got || ask.got + data.length > ask.length) {
|
|
16313
|
+
this.send(appRangeCancelFrame(app, request));
|
|
16314
|
+
return this.settle(ask, "failed");
|
|
16315
|
+
}
|
|
16316
|
+
ask.chunks.push(data.slice());
|
|
16317
|
+
ask.got += data.length;
|
|
16318
|
+
}
|
|
16319
|
+
/** The contact's `ar-end` or `ar-err` for a request of ours. */
|
|
16320
|
+
receiveAnswer(frame) {
|
|
16321
|
+
const ask = this.asking.get(slot(frame.a, frame.r));
|
|
16322
|
+
if (!ask) return;
|
|
16323
|
+
if (frame.t === "ar-err") return this.settle(ask, [
|
|
16324
|
+
"not-served",
|
|
16325
|
+
"changed",
|
|
16326
|
+
"gone"
|
|
16327
|
+
].find((code) => code === frame.e) ?? "failed");
|
|
16328
|
+
if (ask.got !== Math.max(0, Math.min(ask.length, frame.z - ask.offset))) return this.settle(ask, "failed");
|
|
16329
|
+
this.settle(ask);
|
|
16330
|
+
ask.resolve({
|
|
16331
|
+
bytes: concatBytes$1(...ask.chunks),
|
|
16332
|
+
size: frame.z
|
|
16333
|
+
});
|
|
16334
|
+
}
|
|
16335
|
+
/** `app` closed on either side: its serves end, what it was sending stops and what it asked fails with `error`. */
|
|
16336
|
+
closeApp(app, error = "peer-closed") {
|
|
16337
|
+
for (const [id, serve] of this.serves) if (serve.app === app) this.serves.delete(id);
|
|
16338
|
+
for (const task of this.serving.values()) if (task.app === app) this.drop(task);
|
|
16339
|
+
for (const task of this.draining) if (task.app === app) this.draining.delete(task);
|
|
16340
|
+
for (const ask of this.waiting.get(app) ?? []) ask.reject(new Error(error));
|
|
16341
|
+
this.waiting.delete(app);
|
|
16342
|
+
for (const ask of this.asking.values()) if (ask.app === app) this.settle(ask, error);
|
|
16343
|
+
}
|
|
16344
|
+
/** The session ended: no serve id lasts into the next, and every request fails with `offline`. */
|
|
16345
|
+
reset() {
|
|
16346
|
+
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)));
|
|
16347
|
+
for (const app of apps) this.closeApp(app, "offline");
|
|
16348
|
+
}
|
|
16349
|
+
/** Stops `task` and frees its request number; `draining` keeps it counted until it is settled. */
|
|
16350
|
+
drop(task, draining = false) {
|
|
16351
|
+
task.live = false;
|
|
16352
|
+
this.serving.delete(slot(task.app, task.request));
|
|
16353
|
+
if (draining) this.draining.add(task);
|
|
16354
|
+
}
|
|
16355
|
+
/** Frees `task`'s place; false when it was no longer live (nothing to send for it). */
|
|
16356
|
+
take(task) {
|
|
16357
|
+
if (this.draining.delete(task)) return false;
|
|
16358
|
+
const held = this.serving.get(slot(task.app, task.request));
|
|
16359
|
+
if (held !== task || !held.live) return false;
|
|
16360
|
+
this.drop(held);
|
|
16361
|
+
return true;
|
|
16362
|
+
}
|
|
16363
|
+
/** Ends `ask` (failing it with `error` when given) and sends the next one waiting for its app. */
|
|
16364
|
+
settle(ask, error) {
|
|
16365
|
+
if (ask.request === void 0 || this.asking.get(slot(ask.app, ask.request)) !== ask) return;
|
|
16366
|
+
this.asking.delete(slot(ask.app, ask.request));
|
|
16367
|
+
if (error) ask.reject(new Error(error));
|
|
16368
|
+
this.pump(ask.app);
|
|
16369
|
+
}
|
|
16370
|
+
pump(app) {
|
|
16371
|
+
const queue = this.waiting.get(app);
|
|
16372
|
+
let inFlight = [...this.asking.values()].filter((ask) => ask.app === app).length;
|
|
16373
|
+
while (queue?.length && inFlight < APP_RANGE_LIMITS.inFlight) {
|
|
16374
|
+
const ask = queue.shift();
|
|
16375
|
+
let request = this.nextRequest;
|
|
16376
|
+
while (this.asking.has(slot(app, request))) request = request === APP_RANGE_LIMITS.maxRequest ? 0 : request + 1;
|
|
16377
|
+
this.nextRequest = request === APP_RANGE_LIMITS.maxRequest ? 0 : request + 1;
|
|
16378
|
+
ask.request = request;
|
|
16379
|
+
this.asking.set(slot(app, request), ask);
|
|
16380
|
+
inFlight++;
|
|
16381
|
+
this.send(appRangeGetFrame(app, ask.serve, request, ask.offset, ask.length));
|
|
16382
|
+
}
|
|
16383
|
+
if (queue && !queue.length) this.waiting.delete(app);
|
|
16384
|
+
}
|
|
16385
|
+
};
|
|
16386
|
+
//#endregion
|
|
15829
16387
|
//#region ../core/src/webPush.ts
|
|
15830
16388
|
var WebPushError = class extends Error {};
|
|
15831
16389
|
var RECORD_SIZE = 4096;
|
|
@@ -19281,6 +19839,12 @@ var GhostLink = class {
|
|
|
19281
19839
|
typingReceiver = new TypingReceiver((typing, activity) => this.options.events?.onPeerTyping?.(typing, activity));
|
|
19282
19840
|
/** Mini-apps on this session (`apps/1`): this side's open apps (kept across sessions), the peer's, the limits. */
|
|
19283
19841
|
apps;
|
|
19842
|
+
/** The read lane on this session (`app-ranges/1`): what this side serves and what it asked; none of it outlives the session. */
|
|
19843
|
+
appRanges = new AppRanges((frame) => {
|
|
19844
|
+
if (this.supportsAppRanges && this.channel) try {
|
|
19845
|
+
this.channel.send(JSON.stringify(frame));
|
|
19846
|
+
} catch {}
|
|
19847
|
+
});
|
|
19284
19848
|
/** Reaction frames the contact may send per window; the rest go unconfirmed and come again. */
|
|
19285
19849
|
reactionsReceived = new ReactionWindow(REACTION_LIMITS.receive);
|
|
19286
19850
|
/** Pin frames the contact may send per window; the rest go unconfirmed and come again. */
|
|
@@ -22011,6 +22575,7 @@ var GhostLink = class {
|
|
|
22011
22575
|
if (this.options.buttonsSupport) offered.push(BUTTONS_CAPABILITY);
|
|
22012
22576
|
if (this.options.upgradeSupport) offered.push(UPGRADE_CAPABILITY);
|
|
22013
22577
|
if (this.options.appsSupport) offered.push(APPS_CAPABILITY);
|
|
22578
|
+
if (this.options.appsSupport && this.options.appRangesSupport) offered.push(APP_RANGES_CAPABILITY);
|
|
22014
22579
|
if (this.options.deviceCapabilities) offered.push(...this.options.deviceCapabilities);
|
|
22015
22580
|
return offered;
|
|
22016
22581
|
}
|
|
@@ -22133,7 +22698,7 @@ var GhostLink = class {
|
|
|
22133
22698
|
if (!this.options.params.profile) return "Edits need a current chat";
|
|
22134
22699
|
if (this.channel && this.isDataLinkOpen) {
|
|
22135
22700
|
if (!this.supportsEdits) return "Your contact's app does not show edits yet";
|
|
22136
|
-
if (!validEditNumber(edit.e) && !(edit.sc && this.supportsStatusCards)) return "Your contact's app takes no more edits of this message";
|
|
22701
|
+
if (!edit.rm && !validEditNumber(edit.e) && !(edit.sc && this.supportsStatusCards)) return "Your contact's app takes no more edits of this message";
|
|
22137
22702
|
try {
|
|
22138
22703
|
this.channel.send(editFrame(edit));
|
|
22139
22704
|
return null;
|
|
@@ -22142,6 +22707,7 @@ var GhostLink = class {
|
|
|
22142
22707
|
}
|
|
22143
22708
|
}
|
|
22144
22709
|
if (edit.sc) return "A card's update goes when you are live";
|
|
22710
|
+
if (edit.rm) return "A removal goes when you are live";
|
|
22145
22711
|
if (dht && this.dht && this.textDelivery === "dht") return this.dht.send(edit.m, edit.ts, dhtEditId(edit.id, edit.e), void 0, [edit.id, edit.e]);
|
|
22146
22712
|
return "Edits go when you are live";
|
|
22147
22713
|
}
|
|
@@ -22199,6 +22765,7 @@ var GhostLink = class {
|
|
|
22199
22765
|
closeApp(app) {
|
|
22200
22766
|
const frame = JSON.stringify(appCloseFrame(app));
|
|
22201
22767
|
if (!this.apps.open.delete(app)) return;
|
|
22768
|
+
this.appRanges.closeApp(app, "offline");
|
|
22202
22769
|
if (this.supportsApps && this.channel) try {
|
|
22203
22770
|
this.channel.send(frame);
|
|
22204
22771
|
} catch {}
|
|
@@ -22233,8 +22800,98 @@ var GhostLink = class {
|
|
|
22233
22800
|
if (files) files.appAhead = Math.min(files.appAhead + frame.length, APP_AHEAD_OF_FILES + APP_DATA_MAX_BYTES);
|
|
22234
22801
|
return null;
|
|
22235
22802
|
}
|
|
22803
|
+
/** Both sides offer `app-ranges/1` (and `apps/1`) on the open session: an app's files can be read from the other side. */
|
|
22804
|
+
get supportsAppRanges() {
|
|
22805
|
+
return this.supportsApps && this.sessionCapabilities.agreed("app-ranges/1");
|
|
22806
|
+
}
|
|
22807
|
+
/** Why the read lane cannot be used for `app` now, or null when it can: open on both sides, on a live session that has it. */
|
|
22808
|
+
appRangesRefusal(app) {
|
|
22809
|
+
if (!this.apps.open.has(app)) return "not-open";
|
|
22810
|
+
if (!this.channel || !this.isDataLinkOpen) return "offline";
|
|
22811
|
+
return this.supportsAppRanges && this.apps.peerOpen.has(app) ? null : "peer-closed";
|
|
22812
|
+
}
|
|
22813
|
+
/**
|
|
22814
|
+
* Lets the contact's `app` read `file` (what this side's app calls it) for as long as both have the app open on this
|
|
22815
|
+
* session: the serve id to tell it, or why not.
|
|
22816
|
+
*/
|
|
22817
|
+
serveAppFile(app, file) {
|
|
22818
|
+
const error = this.appRangesRefusal(app);
|
|
22819
|
+
return error ? { error } : { serve: this.appRanges.serve(app, file) };
|
|
22820
|
+
}
|
|
22821
|
+
/** Ends a serve; false when it was not served (any more). */
|
|
22822
|
+
unserveAppFile(serve) {
|
|
22823
|
+
return this.appRanges.unserve(serve);
|
|
22824
|
+
}
|
|
22825
|
+
/** The serve ids `app` has given out on this session. */
|
|
22826
|
+
appServes(app) {
|
|
22827
|
+
return this.appRanges.servesOf(app);
|
|
22828
|
+
}
|
|
22829
|
+
/**
|
|
22830
|
+
* Reads `length` bytes at `offset` of what the contact's `app` serves as `serve`: the bytes (fewer at the end of the
|
|
22831
|
+
* file) and the file's size. Rejects with an `Error` whose message is an `AppRangeReadError` or `not-open`.
|
|
22832
|
+
*/
|
|
22833
|
+
readAppRange(app, serve, offset, length) {
|
|
22834
|
+
const error = this.appRangesRefusal(app);
|
|
22835
|
+
return error ? Promise.reject(new Error(error)) : this.appRanges.read(app, serve, offset, length);
|
|
22836
|
+
}
|
|
22837
|
+
/**
|
|
22838
|
+
* The bytes `task` asked for (fewer at the end of the file, none past it) and the file's size: sent in chunks as the
|
|
22839
|
+
* channel has room, sharing files' line (`filesWritable`), as binary messages where `files/4` is agreed, then
|
|
22840
|
+
* `ar-end`. Stops when the task is no longer live or the session changes.
|
|
22841
|
+
*/
|
|
22842
|
+
async sendAppRange(task, bytes, size) {
|
|
22843
|
+
bytes = bytes.subarray(0, task.length);
|
|
22844
|
+
const channel = this.channel;
|
|
22845
|
+
try {
|
|
22846
|
+
if (!channel) return;
|
|
22847
|
+
for (let at = 0; at < bytes.length; at += APP_RANGE_LIMITS.chunkBytes) {
|
|
22848
|
+
for (let room = this.filesWritable(); room; room = this.channel === channel ? this.filesWritable() : void 0) await room;
|
|
22849
|
+
if (!task.live || this.channel !== channel || !this.supportsAppRanges) return;
|
|
22850
|
+
const chunk = bytes.subarray(at, at + APP_RANGE_LIMITS.chunkBytes);
|
|
22851
|
+
const message = this.supportsBinaryFiles ? encodeAppRangeData(task.app, task.request, task.offset + at, chunk) : JSON.stringify(appRangeDataFrame(task.app, task.request, task.offset + at, chunk));
|
|
22852
|
+
try {
|
|
22853
|
+
channel.send(message);
|
|
22854
|
+
} catch {
|
|
22855
|
+
await new Promise((resolve) => setTimeout(resolve, FILE_LIMITS.sendRetryMs));
|
|
22856
|
+
at -= APP_RANGE_LIMITS.chunkBytes;
|
|
22857
|
+
continue;
|
|
22858
|
+
}
|
|
22859
|
+
this.filesWrote(channel, typeof message === "string" ? message.length : message.byteLength);
|
|
22860
|
+
}
|
|
22861
|
+
this.appRanges.finish(task, size);
|
|
22862
|
+
} finally {
|
|
22863
|
+
this.appRanges.release(task);
|
|
22864
|
+
}
|
|
22865
|
+
}
|
|
22866
|
+
/** `task`'s file cannot be read: `changed` or `gone` goes in place of its bytes (nothing once it is no longer live, but its place frees). */
|
|
22867
|
+
failAppRange(task, error) {
|
|
22868
|
+
this.appRanges.fail(task, error);
|
|
22869
|
+
}
|
|
22870
|
+
/** An `ar-*` frame from the contact, on a session that agreed `app-ranges/1`. */
|
|
22871
|
+
receiveAppRange(frame) {
|
|
22872
|
+
const read = readAppRangeFrame(frame);
|
|
22873
|
+
if (!read.ok) return;
|
|
22874
|
+
const ranges = read.frame;
|
|
22875
|
+
switch (ranges.t) {
|
|
22876
|
+
case "ar-get": {
|
|
22877
|
+
if (this.appRangesRefusal(ranges.a)) {
|
|
22878
|
+
try {
|
|
22879
|
+
this.channel?.send(JSON.stringify(appRangeErrorFrame(ranges.a, ranges.r, "not-served")));
|
|
22880
|
+
} catch {}
|
|
22881
|
+
return;
|
|
22882
|
+
}
|
|
22883
|
+
const task = this.appRanges.receiveGet(ranges);
|
|
22884
|
+
if (task) this.options.events?.onAppRangeTask?.(task);
|
|
22885
|
+
return;
|
|
22886
|
+
}
|
|
22887
|
+
case "ar-cancel": return this.appRanges.receiveCancel(ranges);
|
|
22888
|
+
case "ar-data": return this.appRanges.receiveData(ranges.a, ranges.r, ranges.o, appRangeChunk(ranges.d));
|
|
22889
|
+
default: return this.appRanges.receiveAnswer(ranges);
|
|
22890
|
+
}
|
|
22891
|
+
}
|
|
22236
22892
|
/** What the contact had open is gone (`apps/1` is no longer agreed, or this link stopped): each app hears it now. */
|
|
22237
22893
|
appsEnded() {
|
|
22894
|
+
this.appRanges.reset();
|
|
22238
22895
|
if (this.appsGrace) {
|
|
22239
22896
|
clearTimeout(this.appsGrace);
|
|
22240
22897
|
this.appsGrace = null;
|
|
@@ -22248,6 +22905,7 @@ var GhostLink = class {
|
|
|
22248
22905
|
* hears only that open, not a close first; one not said again by then is closed with `offline`.
|
|
22249
22906
|
*/
|
|
22250
22907
|
appsSuspended() {
|
|
22908
|
+
this.appRanges.reset();
|
|
22251
22909
|
this.apps.sessionSuspended();
|
|
22252
22910
|
if (!this.apps.holding || this.appsGrace) return;
|
|
22253
22911
|
this.appsGrace = setTimeout(() => {
|
|
@@ -22413,6 +23071,7 @@ var GhostLink = class {
|
|
|
22413
23071
|
if (!this.supportsApps) this.appsEnded();
|
|
22414
23072
|
this.options.events?.onAppsSupport?.(this.supportsApps);
|
|
22415
23073
|
}
|
|
23074
|
+
if (changed.includes("app-ranges/1") && !this.supportsAppRanges) this.appRanges.reset();
|
|
22416
23075
|
const devices = this.options.deviceCapabilities;
|
|
22417
23076
|
if (devices && changed.some((capability) => devices.includes(capability))) this.options.events?.onDeviceCapabilities?.(devices.filter((capability) => this.supportsDevice(capability)));
|
|
22418
23077
|
this.emitPairingState();
|
|
@@ -22957,6 +23616,11 @@ var GhostLink = class {
|
|
|
22957
23616
|
this.heardFromPeer();
|
|
22958
23617
|
this.framesHeard++;
|
|
22959
23618
|
if (typeof data !== "string") {
|
|
23619
|
+
if (data[0] === 5) {
|
|
23620
|
+
const range = this.supportsAppRanges && this.supportsBinaryFiles ? decodeAppRangeData(data) : null;
|
|
23621
|
+
if (range) this.appRanges.receiveData(range.a, range.r, range.o, range.data);
|
|
23622
|
+
return;
|
|
23623
|
+
}
|
|
22960
23624
|
const chunk = this.supportsBinaryFiles ? decodeFileData(data) : null;
|
|
22961
23625
|
if (!chunk) return;
|
|
22962
23626
|
this.activityAt = Date.now();
|
|
@@ -23104,9 +23768,14 @@ var GhostLink = class {
|
|
|
23104
23768
|
if (frame?.t === "paired-app") {
|
|
23105
23769
|
if (!this.supportsApps) return;
|
|
23106
23770
|
const event = this.apps.receive(frame);
|
|
23771
|
+
if (event && "o" in event && event.o === "close") this.appRanges.closeApp(event.app);
|
|
23107
23772
|
if (event) this.options.events?.onAppFrame?.(event);
|
|
23108
23773
|
return;
|
|
23109
23774
|
}
|
|
23775
|
+
if (APP_RANGE_FRAMES.has(String(frame?.t))) {
|
|
23776
|
+
if (this.supportsAppRanges) this.receiveAppRange(frame);
|
|
23777
|
+
return;
|
|
23778
|
+
}
|
|
23110
23779
|
if (frame?.t === "paired-reaction") {
|
|
23111
23780
|
if (!this.supportsReactions || !this.reactionsReceived.take()) return;
|
|
23112
23781
|
const reaction = parseReactionFrame(frame);
|
|
@@ -27411,6 +28080,10 @@ var wireMentions = (mentions) => mentions.map(({ k, o, l }) => ({
|
|
|
27411
28080
|
* `sc` is the status card of this version (WISP 405 · Status Cards); an edit with one may be numbered up to
|
|
27412
28081
|
* `STATUS_CARD_LIMITS.edits`, one without only up to `MAX_EDITS_PER_MESSAGE`.
|
|
27413
28082
|
*
|
|
28083
|
+
* A removal (WISP 400 § Delete for everyone) is an edit with `rm: true` and a fallback text, nothing else beside it,
|
|
28084
|
+
* numbered up to `MAX_REMOVAL_NUMBER`: in a mesh group's box as `{ "text", "rm": true }`, in a community's frame beside
|
|
28085
|
+
* `text`. A `rm` other than `true` is no edit.
|
|
28086
|
+
*
|
|
27414
28087
|
* Older apps drop both: a mesh session ignores a `t` it does not know, a community app the `x` frames it does not know.
|
|
27415
28088
|
*/
|
|
27416
28089
|
var GROUP_EDIT_FRAME = "group-edit";
|
|
@@ -27440,6 +28113,14 @@ function validEditText(text) {
|
|
|
27440
28113
|
}
|
|
27441
28114
|
/** The `x` frame a community edit travels as. */
|
|
27442
28115
|
function communityEditFrame(edit) {
|
|
28116
|
+
if (edit.rm) return {
|
|
28117
|
+
t: COMMUNITY_EDIT_FRAME,
|
|
28118
|
+
id: edit.id,
|
|
28119
|
+
v: edit.e,
|
|
28120
|
+
ts: edit.ts,
|
|
28121
|
+
text: edit.m,
|
|
28122
|
+
rm: true
|
|
28123
|
+
};
|
|
27443
28124
|
return {
|
|
27444
28125
|
t: COMMUNITY_EDIT_FRAME,
|
|
27445
28126
|
id: edit.id,
|
|
@@ -27457,9 +28138,17 @@ function communityEditFrame(edit) {
|
|
|
27457
28138
|
*/
|
|
27458
28139
|
function parseCommunityEdit(frame, sender) {
|
|
27459
28140
|
if (frame?.t !== "edit") return null;
|
|
27460
|
-
const { id, v, ts, text } = frame;
|
|
27461
|
-
if (
|
|
28141
|
+
const { id, v, ts, text, rm } = frame;
|
|
28142
|
+
if (rm !== void 0 && rm !== true) return null;
|
|
28143
|
+
if (typeof id !== "string" || communityMessageAuthor(id) !== sender || typeof v !== "number" || !(rm ? validRemovalNumber(v) : cardEditNumber(v))) return null;
|
|
27462
28144
|
if (typeof ts !== "number" || !Number.isSafeInteger(ts) || ts <= 0 || !validEditText(text)) return null;
|
|
28145
|
+
if (rm) return {
|
|
28146
|
+
id,
|
|
28147
|
+
e: v,
|
|
28148
|
+
ts,
|
|
28149
|
+
m: text,
|
|
28150
|
+
rm
|
|
28151
|
+
};
|
|
27463
28152
|
const sc = frame.sc === void 0 ? void 0 : readStatusCard(frame.sc);
|
|
27464
28153
|
if (!validEditNumber(v) && !sc) return null;
|
|
27465
28154
|
const k = validMentions(frame.m, text, false);
|
|
@@ -27859,7 +28548,7 @@ var editSigned = (f) => utf8Encode(JSON.stringify([
|
|
|
27859
28548
|
function isEditFrame(v) {
|
|
27860
28549
|
if (!v || typeof v !== "object") return false;
|
|
27861
28550
|
const f = v;
|
|
27862
|
-
return f.t === "group-edit" && typeof f.g === "string" && GROUP_ID.test(f.g) && Number.isSafeInteger(f.e) && f.e >= 0 && typeof f.s === "string" && MEMBER_KEY.test(f.s) && Number.isSafeInteger(f.n) && f.n >= 0 &&
|
|
28551
|
+
return f.t === "group-edit" && typeof f.g === "string" && GROUP_ID.test(f.g) && Number.isSafeInteger(f.e) && f.e >= 0 && typeof f.s === "string" && MEMBER_KEY.test(f.s) && Number.isSafeInteger(f.n) && f.n >= 0 && validRemovalNumber(f.v) && Number.isSafeInteger(f.ts) && f.ts > 0 && typeof f.nn === "string" && f.nn.length === 32 && B64$1.test(f.nn) && typeof f.c === "string" && f.c.length <= MAX_EDIT_BOX && B64$1.test(f.c) && typeof f.sig === "string" && f.sig.length === 86 && B64$1.test(f.sig);
|
|
27863
28552
|
}
|
|
27864
28553
|
/**
|
|
27865
28554
|
* Where a frame said again was first said (`o`): an earlier epoch than the frame's own and a sequence number there, or
|
|
@@ -28197,13 +28886,24 @@ var GroupSession = class {
|
|
|
28197
28886
|
return this.roster.map(([k]) => k).filter((k) => k !== this.myKey);
|
|
28198
28887
|
}
|
|
28199
28888
|
/**
|
|
28200
|
-
* Whether `key` could read message `messageId` (`<s>:<e>:<n>`) and still can: in the roster
|
|
28201
|
-
*
|
|
28889
|
+
* Whether `key` could read message `messageId` (`<s>:<e>:<n>`) and still can: in the roster now, and in the roster of
|
|
28890
|
+
* its epoch or, given the message's time `ts`, in the roster of the epoch its author, behind on the chain, said it
|
|
28891
|
+
* again under (`saidAgainEpoch`): the newest after its own that comes before any `add` dated later than it. That
|
|
28892
|
+
* member read it under its first id. A holder serves a group file only to such a member (WISP 503 § Asking).
|
|
28202
28893
|
*/
|
|
28203
|
-
couldRead(key, messageId) {
|
|
28894
|
+
couldRead(key, messageId, ts) {
|
|
28204
28895
|
const e = Number(messageId.split(":")[1]);
|
|
28205
28896
|
const then = this.state.chain.find((c) => c.e === e);
|
|
28206
|
-
|
|
28897
|
+
if (!then || !rosterHas(this.roster, key)) return false;
|
|
28898
|
+
if (rosterHas(then.m, key)) return true;
|
|
28899
|
+
if (ts === void 0) return false;
|
|
28900
|
+
let again;
|
|
28901
|
+
for (let later = e + 1; later <= this.epoch; later++) {
|
|
28902
|
+
const c = this.state.chain[later];
|
|
28903
|
+
if (!c || c.k === "add" && c.ts > ts) break;
|
|
28904
|
+
again = c;
|
|
28905
|
+
}
|
|
28906
|
+
return !!again && rosterHas(again.m, key);
|
|
28207
28907
|
}
|
|
28208
28908
|
role(key) {
|
|
28209
28909
|
return this.roster.find(([k]) => k === key)?.[1];
|
|
@@ -28828,12 +29528,15 @@ var GroupSession = class {
|
|
|
28828
29528
|
const ref = meshMessageRef(messageId);
|
|
28829
29529
|
const commit = ref && this.state.chain[ref.e];
|
|
28830
29530
|
if (!ref || ref.s !== this.myKey || !commit || !rosterHas(commit.m, this.myKey)) return { error: "Only your own messages can be edited" };
|
|
28831
|
-
if (!(edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
|
|
29531
|
+
if (!(edit.remove ? validRemovalNumber(edit.v) : edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
|
|
28832
29532
|
const text = edit.text.trim();
|
|
28833
29533
|
if (!validEditText(text)) return { error: text ? "Message exceeds 16 KiB" : "An edit cannot be empty" };
|
|
28834
29534
|
if (!this.secret(ref.e)) return { error: "This message is too old to edit: its epoch's key is gone" };
|
|
28835
29535
|
const named = validMentions(wireMentions(edit.mentions ?? []), text, rosterAdmin(commit.m) === this.myKey && this.isAdmin);
|
|
28836
|
-
const plain = JSON.stringify({
|
|
29536
|
+
const plain = JSON.stringify(edit.remove ? {
|
|
29537
|
+
text,
|
|
29538
|
+
rm: true
|
|
29539
|
+
} : {
|
|
28837
29540
|
text,
|
|
28838
29541
|
...named.length ? { m: named } : {},
|
|
28839
29542
|
...edit.card ? { sc: edit.card } : {}
|
|
@@ -29230,9 +29933,12 @@ var GroupSession = class {
|
|
|
29230
29933
|
return;
|
|
29231
29934
|
}
|
|
29232
29935
|
if (!body || typeof body !== "object" || !validEditText(body.text)) return;
|
|
29233
|
-
|
|
29234
|
-
const
|
|
29235
|
-
if (!
|
|
29936
|
+
if (body.rm !== void 0 && body.rm !== true) return;
|
|
29937
|
+
const rm = body.rm === true;
|
|
29938
|
+
if (!rm && !cardEditNumber(raw.v)) return;
|
|
29939
|
+
const k = rm ? [] : validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
|
|
29940
|
+
const sc = rm || body.sc === void 0 ? void 0 : readStatusCard(body.sc);
|
|
29941
|
+
if (!rm && !validEditNumber(raw.v) && !sc) return;
|
|
29236
29942
|
const copy = this.kept().find((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n);
|
|
29237
29943
|
const first = copy && readFirstPlace(copy.o, copy.e);
|
|
29238
29944
|
await this.hooks.edit?.({
|
|
@@ -29242,7 +29948,8 @@ var GroupSession = class {
|
|
|
29242
29948
|
ts: raw.ts,
|
|
29243
29949
|
m: body.text,
|
|
29244
29950
|
...k.length ? { k } : {},
|
|
29245
|
-
...sc ? { sc } : {}
|
|
29951
|
+
...sc ? { sc } : {},
|
|
29952
|
+
...rm ? { rm: true } : {}
|
|
29246
29953
|
});
|
|
29247
29954
|
if (this.keepEdit(raw)) {
|
|
29248
29955
|
await this.persist();
|
|
@@ -30009,12 +30716,16 @@ var FRESH = /* @__PURE__ */ new Set([
|
|
|
30009
30716
|
* history keeps room for everyone else to get out after it: two commits a member (a leave or a remove is one, and a
|
|
30010
30717
|
* leaving admin hands the role over first). The history is never compacted, and one that filled with people in it
|
|
30011
30718
|
* took no leave, remove or handover any more. Its own rule: a history up to `COMMUNITY_LIMITS.chain` verifies as before.
|
|
30719
|
+
* A member takes in such a commit from someone else only when it keeps that room too (`receiveCommit`): an app that
|
|
30720
|
+
* does not keep it could otherwise fill the history for everyone.
|
|
30012
30721
|
*/
|
|
30013
30722
|
var GROWS = /* @__PURE__ */ new Set([
|
|
30014
30723
|
"add",
|
|
30015
30724
|
"rotate",
|
|
30016
30725
|
"link"
|
|
30017
30726
|
]);
|
|
30727
|
+
/** Whether a history whose last commit is at `epoch`, with `roster` in it, still has room for everyone else to get out. */
|
|
30728
|
+
var keepsRoom = (epoch, roster) => epoch + 1 + 2 * (roster.length - 1) <= COMMUNITY_LIMITS.chain;
|
|
30018
30729
|
/**
|
|
30019
30730
|
* Kinds only the admin commits. They are final: a branch that drops one never replaces the branch
|
|
30020
30731
|
* that has it, however long, so no member can undo a removal, a hand-over, a rotation or a link change
|
|
@@ -30076,6 +30787,30 @@ var leftStatement = (g, h, hi) => utf8Encode(JSON.stringify([
|
|
|
30076
30787
|
Object.entries(hi).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)
|
|
30077
30788
|
]));
|
|
30078
30789
|
var LEFT_EPOCH = /^\d{1,15}:[a-f0-9]{16}$/;
|
|
30790
|
+
/** A leave of one admission: `h` is the hash of the commit that last put `s` in the roster (its `add`, or the `create` it signed). */
|
|
30791
|
+
var leaveStatement3 = (g, s, h) => utf8Encode(JSON.stringify([
|
|
30792
|
+
"ghostly-group/3 leave",
|
|
30793
|
+
g,
|
|
30794
|
+
s,
|
|
30795
|
+
h
|
|
30796
|
+
]));
|
|
30797
|
+
/**
|
|
30798
|
+
* Whether a leave holds after `before` (the commits before it, newest first): its `ls3` names the commit that last
|
|
30799
|
+
* admitted the leaver, or, from an app that signs no such statement, no earlier leave carries its `ls`. `ls` says the
|
|
30800
|
+
* same for every admission of a member, so by itself it ends one admission only.
|
|
30801
|
+
*/
|
|
30802
|
+
function leaveStands(leave, before) {
|
|
30803
|
+
if (!leave.s || !leave.ls) return false;
|
|
30804
|
+
let admitted = false;
|
|
30805
|
+
for (const c of before) {
|
|
30806
|
+
if (!admitted && (c.k === "add" && c.s === leave.s || c.k === "create" && c.by === leave.s)) {
|
|
30807
|
+
admitted = true;
|
|
30808
|
+
if (leave.ls3 && SIG.test(leave.ls3) && verify(fromBase64Url(leave.ls3), leaveStatement3(leave.g, leave.s, communityCommitHash(c)), publicKeyFromZ32(leave.s))) return true;
|
|
30809
|
+
}
|
|
30810
|
+
if (c.k === "leave" && c.ls === leave.ls) return false;
|
|
30811
|
+
}
|
|
30812
|
+
return true;
|
|
30813
|
+
}
|
|
30079
30814
|
/** The secret of an epoch that adds, re-roles or re-links: from the previous one and the commit. */
|
|
30080
30815
|
function derivedSecret(previous, untaggedHash) {
|
|
30081
30816
|
return hkdf(sha256, previous, utf8Encode(untaggedHash), utf8Encode("ghostly-group/2 derived"), 32);
|
|
@@ -30101,6 +30836,7 @@ function parseCommit(raw) {
|
|
|
30101
30836
|
if (c.x !== void 0) out.x = c.x;
|
|
30102
30837
|
if (c.n !== void 0) out.n = c.n;
|
|
30103
30838
|
if (c.ls !== void 0) out.ls = c.ls;
|
|
30839
|
+
if (out.k === "leave" && typeof c.ls3 === "string" && SIG.test(c.ls3)) out.ls3 = c.ls3;
|
|
30104
30840
|
return out;
|
|
30105
30841
|
}
|
|
30106
30842
|
/**
|
|
@@ -30133,15 +30869,18 @@ function communityRoster(previous, c, trusted = false) {
|
|
|
30133
30869
|
/**
|
|
30134
30870
|
* One commit against its parent (null for a genesis) and the parent's roster: shape, id, link,
|
|
30135
30871
|
* authority, roster arithmetic, roster hash and signature. The confirmation tag is checked once
|
|
30136
|
-
* the secret is known.
|
|
30872
|
+
* the secret is known. `before`: the commits before it on its branch, newest first; given, a `leave` is held to the
|
|
30873
|
+
* admission it ends (`leaveStands`). A member gives it for every commit it takes in after its own admission; the chain
|
|
30874
|
+
* of a welcome is not held to it (`verifyCommunityChain`).
|
|
30137
30875
|
*/
|
|
30138
|
-
function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
|
|
30876
|
+
function verifyCommunityCommit(raw, parent, parentRoster, groupId, before) {
|
|
30139
30877
|
const commit = parseCommit(raw);
|
|
30140
30878
|
if (!commit) return { error: "Malformed membership commit" };
|
|
30141
30879
|
if (groupId && commit.g !== groupId) return { error: "Commit for another group" };
|
|
30142
30880
|
if (parent) {
|
|
30143
30881
|
if (commit.g !== parent.g) return { error: "Commit for another group" };
|
|
30144
30882
|
if (commit.e !== parent.e + 1) return { error: "Commit out of sequence" };
|
|
30883
|
+
if (commit.e >= COMMUNITY_LIMITS.chain) return { error: "Membership chain too long" };
|
|
30145
30884
|
if (commit.p !== communityCommitHash(parent)) return { error: "Commit does not follow its parent" };
|
|
30146
30885
|
} else {
|
|
30147
30886
|
if (commit.e !== 0 || commit.p !== "" || commit.k !== "create") return { error: "The chain does not start with the creation of the group" };
|
|
@@ -30151,6 +30890,7 @@ function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
|
|
|
30151
30890
|
if (commit.k !== "leave" && commit.ls !== void 0) return { error: "Malformed membership commit" };
|
|
30152
30891
|
const roster = communityRoster(parent ? parentRoster : null, commit);
|
|
30153
30892
|
if (!roster) return { error: "Unauthorized or inconsistent membership change" };
|
|
30893
|
+
if (commit.k === "leave" && before && !leaveStands(commit, before)) return { error: "This leave is not for the member's current admission" };
|
|
30154
30894
|
if (rosterHash(roster) !== commit.m) return { error: "The roster hash does not match the change" };
|
|
30155
30895
|
if (!verify(fromBase64Url(commit.sig), utf8Encode(tuple(commit)), publicKeyFromZ32(commit.by))) return { error: "Membership commit signature is invalid" };
|
|
30156
30896
|
return {
|
|
@@ -30158,7 +30898,11 @@ function verifyCommunityCommit(raw, parent, parentRoster, groupId) {
|
|
|
30158
30898
|
roster
|
|
30159
30899
|
};
|
|
30160
30900
|
}
|
|
30161
|
-
/**
|
|
30901
|
+
/**
|
|
30902
|
+
* A whole chain from its genesis; the rosters after each commit and the entry key at the end. What a newcomer is
|
|
30903
|
+
* handed: a `leave` in it is not held to the admission it ends, since a chain from before 2026-10-10 may hold a
|
|
30904
|
+
* member's second leave under the one statement there was, and no newcomer could enter that group again.
|
|
30905
|
+
*/
|
|
30162
30906
|
function verifyCommunityChain(raw, groupId) {
|
|
30163
30907
|
if (!Array.isArray(raw) || raw.length === 0 || raw.length > COMMUNITY_LIMITS.chain) return { error: "Malformed membership chain" };
|
|
30164
30908
|
const chain = [], rosters = [];
|
|
@@ -30649,13 +31393,17 @@ var CommunitySession = class {
|
|
|
30649
31393
|
placeSide(commit) {
|
|
30650
31394
|
const parent = this.known.get(commit.p), parentRoster = parent ? this.rosterAt(commit.p) : void 0;
|
|
30651
31395
|
if (!parentRoster || !parent) return false;
|
|
30652
|
-
const result = verifyCommunityCommit(commit, parent, parentRoster, this.id);
|
|
31396
|
+
const result = verifyCommunityCommit(commit, parent, parentRoster, this.id, this.ancestry(commit.p));
|
|
30653
31397
|
if ("error" in result) return false;
|
|
30654
31398
|
const h = communityCommitHash(result.commit);
|
|
30655
31399
|
this.known.set(h, result.commit);
|
|
30656
31400
|
this.rosters.set(h, result.roster);
|
|
30657
31401
|
return true;
|
|
30658
31402
|
}
|
|
31403
|
+
/** The commit `h` and those before it on its branch, newest first. */
|
|
31404
|
+
*ancestry(h) {
|
|
31405
|
+
for (let c = this.known.get(h); c; c = this.known.get(c.p)) yield c;
|
|
31406
|
+
}
|
|
30659
31407
|
rosterOf(h) {
|
|
30660
31408
|
return this.rosterAt(h);
|
|
30661
31409
|
}
|
|
@@ -30778,8 +31526,9 @@ var CommunitySession = class {
|
|
|
30778
31526
|
}
|
|
30779
31527
|
const parsed = parseCommit(raw);
|
|
30780
31528
|
if (!parsed || this.known.has(communityCommitHash(parsed))) return false;
|
|
30781
|
-
const result = verifyCommunityCommit(raw, parent, parentRoster, this.id);
|
|
31529
|
+
const result = verifyCommunityCommit(raw, parent, parentRoster, this.id, this.ancestry(p));
|
|
30782
31530
|
if ("error" in result) return false;
|
|
31531
|
+
if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
|
|
30783
31532
|
const commit = result.commit, h = communityCommitHash(commit);
|
|
30784
31533
|
const admin = rosterAdmin(parentRoster);
|
|
30785
31534
|
if (commit.by === admin) {
|
|
@@ -31010,8 +31759,8 @@ var CommunitySession = class {
|
|
|
31010
31759
|
ts: now
|
|
31011
31760
|
};
|
|
31012
31761
|
const roster = communityRoster(this.roster, draftBase);
|
|
31013
|
-
if (!roster) throw new Error("This change is not allowed");
|
|
31014
|
-
if (GROWS.has(kind) &&
|
|
31762
|
+
if (!roster || kind === "leave" && !leaveStands(draftBase, this.ancestry(parentHash))) throw new Error("This change is not allowed");
|
|
31763
|
+
if (GROWS.has(kind) && !keepsRoom(draftBase.e, roster)) throw new Error("This group has reached its membership history limit. Create a new group.");
|
|
31015
31764
|
const draft = {
|
|
31016
31765
|
...draftBase,
|
|
31017
31766
|
m: rosterHash(roster)
|
|
@@ -31181,6 +31930,10 @@ var CommunitySession = class {
|
|
|
31181
31930
|
s: this.myKey,
|
|
31182
31931
|
ls: toBase64Url(sign(leaveStatement(this.id, this.myKey), this.identity.seed))
|
|
31183
31932
|
};
|
|
31933
|
+
for (const c of this.ancestry(this.topHash)) if (c.k === "add" && c.s === this.myKey || c.k === "create" && c.by === this.myKey) {
|
|
31934
|
+
frame.ls3 = toBase64Url(sign(leaveStatement3(this.id, this.myKey, communityCommitHash(c)), this.identity.seed));
|
|
31935
|
+
break;
|
|
31936
|
+
}
|
|
31184
31937
|
this.hooks.broadcast(frame);
|
|
31185
31938
|
this.out("left", "You left this group");
|
|
31186
31939
|
await this.persist();
|
|
@@ -31202,7 +31955,8 @@ var CommunitySession = class {
|
|
|
31202
31955
|
try {
|
|
31203
31956
|
const { hash } = await this.commit("leave", {
|
|
31204
31957
|
s: request.s,
|
|
31205
|
-
ls: request.ls
|
|
31958
|
+
ls: request.ls,
|
|
31959
|
+
...request.ls3 ? { ls3: request.ls3 } : {}
|
|
31206
31960
|
}, now);
|
|
31207
31961
|
this.markLeft(hash, request.s);
|
|
31208
31962
|
done++;
|
|
@@ -31340,17 +32094,18 @@ var CommunitySession = class {
|
|
|
31340
32094
|
return this.serialize(async () => {
|
|
31341
32095
|
if (!this.isMember) return { error: this.state.statusReason ?? "You are not in this group" };
|
|
31342
32096
|
if (communityMessageAuthor(edit.id) !== this.myKey) return { error: "Only your own messages can be edited" };
|
|
31343
|
-
if (!(edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
|
|
32097
|
+
if (!(edit.remove ? validRemovalNumber(edit.v) : edit.card ? cardEditNumber(edit.v) : validEditNumber(edit.v))) return { error: "This message was edited too many times" };
|
|
31344
32098
|
const text = edit.text.trim();
|
|
31345
32099
|
if (!validEditText(text)) return { error: text ? "Message exceeds 16 KiB" : "An edit cannot be empty" };
|
|
31346
|
-
const named = validMentions(wireMentions(edit.mentions ?? []), text, false);
|
|
32100
|
+
const named = edit.remove ? [] : validMentions(wireMentions(edit.mentions ?? []), text, false);
|
|
31347
32101
|
const frame = communityEditFrame({
|
|
31348
32102
|
id: edit.id,
|
|
31349
32103
|
e: edit.v,
|
|
31350
32104
|
ts: edit.ts,
|
|
31351
32105
|
m: text,
|
|
31352
32106
|
k: named,
|
|
31353
|
-
...edit.card && { sc: edit.card }
|
|
32107
|
+
...edit.card && !edit.remove && { sc: edit.card },
|
|
32108
|
+
...edit.remove && { rm: true }
|
|
31354
32109
|
});
|
|
31355
32110
|
const room = COMMUNITY_LIMITS.textBytes + 256, clean = sanitizeNick(nick);
|
|
31356
32111
|
const size = (withNick) => utf8Encode(JSON.stringify(withNick && clean ? {
|
|
@@ -31600,11 +32355,27 @@ var CommunitySession = class {
|
|
|
31600
32355
|
receiveLeave(frame) {
|
|
31601
32356
|
const s = frame.s, ls = frame.ls;
|
|
31602
32357
|
if (typeof s !== "string" || !MEMBER_KEY.test(s) || typeof ls !== "string" || !SIG.test(ls) || !rosterHas(this.roster, s)) return false;
|
|
31603
|
-
|
|
32358
|
+
const ls3 = typeof frame.ls3 === "string" && SIG.test(frame.ls3) ? frame.ls3 : void 0;
|
|
32359
|
+
let held = this.state.pendingLeaves.find((r) => r.s === s);
|
|
32360
|
+
if (held && !leaveStands({
|
|
32361
|
+
g: this.id,
|
|
32362
|
+
...held
|
|
32363
|
+
}, this.ancestry(this.topHash))) {
|
|
32364
|
+
this.state.pendingLeaves = this.state.pendingLeaves.filter((r) => r !== held);
|
|
32365
|
+
held = void 0;
|
|
32366
|
+
}
|
|
32367
|
+
if (held && (held.ls3 || !ls3)) return false;
|
|
31604
32368
|
if (!verify(fromBase64Url(ls), leaveStatement(this.id, s), publicKeyFromZ32(s))) return false;
|
|
31605
|
-
|
|
32369
|
+
if (!leaveStands({
|
|
32370
|
+
g: this.id,
|
|
32371
|
+
s,
|
|
32372
|
+
ls,
|
|
32373
|
+
ls3
|
|
32374
|
+
}, this.ancestry(this.topHash))) return false;
|
|
32375
|
+
this.state.pendingLeaves = [...this.state.pendingLeaves.filter((r) => r !== held), {
|
|
31606
32376
|
s,
|
|
31607
|
-
ls
|
|
32377
|
+
ls,
|
|
32378
|
+
...ls3 ? { ls3 } : {}
|
|
31608
32379
|
}].slice(-COMMUNITY_LIMITS.pendingLeaves);
|
|
31609
32380
|
this.persistSoon();
|
|
31610
32381
|
return true;
|
|
@@ -32765,6 +33536,6 @@ function readX401SdJwtVc(text) {
|
|
|
32765
33536
|
};
|
|
32766
33537
|
}
|
|
32767
33538
|
//#endregion
|
|
32768
|
-
export { parseSshPublicKey as $, GROUP_MEMBER_CAP as $a, DEVICES_CAPABILITY as $c, DHT_MESSAGE_TTL as $i, bytesEqual as $l, readGroupWantNo as $n, handoffContextProof as $o, chatAppId as $r, knockSlotIdentity as $s, SEPOLIA_TEST_USDT_FAUCET as $t, knockRecords as A, wireReaction as Aa, isAppRef as Ac, capsDescriptors as Ai, RelaysFailedError as Al, findEndpoint as An, signalHasVideo as Ao, transferStalled as Ar, ENROLL_HELLO as As, didWebDocumentUrl as At, GROUP_READ_NOTE as B, appCardId as Ba, createContactLink as Bc, identityStatement as Bi, RELAY_PAYLOAD_MAX_BYTES as Bl, engineError as Bn, HANDOFF_OFFER as Bo, pinIsNewer as Br, readEnrollHello as Bs, staticDidDocument as Bt, decodeCommunityLink as C, ReactionWindow as Ca, APP_PREFIXES as Cc, recordsFromTxt as Ci, turnKeys as Cl, pubkyHomeserverOf as Cn, RTC_CONFIG as Co, readBeacon as Cr, readSetUpdate as Cs, DID_JWS_MAX_LENGTH as Ct, encodeGroupEntryLink as D, reactionIsNewer as Da, checkAppRevokeStatement as Dc, wellKnownUrl as Di, DEFAULT_RELAYS as Dl, ENDPOINT as Dn, callSignalHeardAt as Do, ChatFiles as Dr, verifySetUpdate as Ds, didGhostlyServiceEntry as Dt, decodeGroupEntryLink as E, reactionEmoji as Ea, appRef as Ec, txtValue as Ei, turnVerifierMark as El, decodeBolt11 as En, callRtcConfig as Eo, shouldBeHub as Er, signTombstone as Es, checkDidSignature as Et, groupWakeFrame as F, ITEM_STATES as Fa, parseImageMeta as Fc, IdentityCheckUnavailable as Fi, traceLink as Fl, INVITE_TAKEN as Fn, HANDOFF_ACK as Fo, typingActivity as Fr, enrollDoneFrame as Fs, normalizeDid as Ft, GROUP_EDIT_TEXT_BYTES as G, sameButtonText as Ga, readDeviceInvite as Gc, PeerProofs as Gi, createIdentity as Gl, GROUP_WANT_FRAME as Gn, HANDOFF_VERIFIED as Go, deviceWakeRequest as Gr, newInbox as Gs, encodeDidDhtPacket as Gt, frameBytes as H, cardLine as Ha, readContactLink as Hc, receivedIdentityStatus as Hi, newerPacket as Hl, parseEngineError as Hn, HANDOFF_PIECE_BYTES as Ho, readPin as Hr, clearMissed as Hs, didDhtDocument as Ht, groupWakes as I, PR_CHECKS as Ia, readImageMeta as Ic, IdentityExchange as Ii, budgetRetryMs as Il, LIVENESS_PING_MS as In, HANDOFF_CANCEL as Io, GROUP_PIN_FRAME as Ir, enrollGrantFrame as Is, parseDid as It, mentionsMember as J, claimedTime as Ja, decodeInviteCode as Jc, TRANSPORTS as Ji, publicKeyFromZ32 as Jl, groupFileFallback as Jn, handoffAttemptFailed as Jo, relayRequest as Jr, takeRequest as Js, ETHEREUM_USDT as Jt, carryMentions as K, statusCardText as Ka, OwnInviteError as Kc, emptyProofLedger as Ki, identityFromSeed as Kl, GROUP_WANT_NO_FRAME as Kn, filePartName as Ko, newWakeToken as Kr, planKnocks as Ks, resolveDidDht as Kt, parseGroupWakeFrame as L, PR_STATES as La, canonicalJson as Lc, boundVerifiedIdentity as Li, isDiscoveryBudgetError as Ll, PAIRED_FRAME_TOO_LARGE as Ln, HANDOFF_DONE as Lo, PIN_LIMITS as Lr, enrollHelloFrame as Ls, parseDidDocument as Lt, readKnocks as M, readReply as Ma, readAppRevocations as Mc, IDENTITY_MAX_EVIDENCE as Mi, currentRelays as Ml, parseCashuRequestPayload as Mn, HTTP_SERVICE_PROTO as Mo, TYPING_REFRESH_MS as Mr, enrollCancelFrame as Ms, didWebFileNames as Mt, GROUP_WAKE_FRAME as N, replySnippet as Na, signAppObject as Nc, IDENTITY_MAX_VALIDITY as Ni, normalizeRelayUrl as Nl, parseFedimintRequestPayload as Nn, LEGACY_SERVICES as No, TypingSender as Nr, enrollCancelReason as Ns, didWebFileUrl as Nt, entryParams as O, readReaction as Oa, isAppHash as Oc, CapsExchange as Oi, HEDGE_MS as Ol, cashuRequestPayload as On, extractParamsFromSdp as Oo, FILE_LIMITS as Or, ENROLL_DONE as Os, didJwsAlg as Ot, GroupWakeLimiter as P, BUTTON_ID as Pa, signAppRevocation as Pc, IDENTITY_REVOCATION_LABEL as Pi, setLinkTraceSink as Pl, GhostLink as Pn, serviceIdFromName as Po, sanitizeTypingStatus as Pr, enrollDigits as Ps, didWebHost as Pt, SshSigError as Q, GROUP_ADMIN_OFF_ERROR as Qa, ownInviteRefusal as Qc, DHT_FILE_TOO_LARGE as Qi, sanitizeDisplayText as Ql, readGroupWant as Qn, handoffContext as Qo, APP_DATA_MAX_BYTES as Qr, contactDay as Qs, SEPOLIA_TEST_USDT as Qt, GROUP_LIMITS as R, RUN_RESULTS as Ra, canonicalJsonBytes as Rc, emptyIdentityLedger as Ri, withRequestOptions as Rl, pairedMessageFits as Rn, HANDOFF_HAVE as Ro, mayPin as Rr, enrollProofFrame as Rs, parseDidSignaturePaste as Rt, communityHasFrame as S, REACTION_LIMITS as Sa, sha256Paced as Sc, normalizeDomain as Si, turnInstance as Sl, homeserverWebEndpoint as Sn, CALL_SIGNAL_MAX_AGE_MS as So, rankHubs as Sr, SET_UPDATE as Ss, DID_FILE_MAX_BYTES as St, KNOCK_TTL_MS as T, queueReaction as Ta, appFingerprint as Tc, recordsName as Ti, turnStatedVerifier as Tl, resolveLightningDestination as Tn, buildSdpFromSignal as To, readLobby as Tr, setUpdateFrame as Ts, checkDidJws as Tt, COMMUNITY_EDIT_FRAME as U, cardUrl as Ua, createDeviceInvite as Uc, revokesIdentity as Ui, openRelayPayload as Ul, GROUP_FILE_LIMITS as Un, HANDOFF_REQUEST as Uo, WAKE_CALL_INTERVAL_MS as Ur, endedRequests as Us, didDhtFromPublicKey as Ut, GroupSession as V, buttonLabelClash as Va, encodeContactLink as Vc, newIdentityBinding as Vi, createRelayPayload as Vl, engineText as Vn, HANDOFF_PAKE as Vo, pinNumberHolds as Vr, verifyEnrollProof as Vs, strictBase64Url as Vt, GROUP_EDIT_FRAME as W, checkStatusCard as Wa, deviceInviteJoinerParams as Wc, lastSharedWithMe as Wi, parseRelayPayload as Wl, GROUP_HAVE_FRAME as Wn, HANDOFF_TIMINGS as Wo, WakeLimiter as Wr, inboxRecord as Ws, encodeDidDhtDeactivated as Wt, SSHSIG_MAX_ARMOR as X, receivedTimestamp as Xa, inviteLink as Xc, irohDescriptor as Xi, MAX_AVATAR_LENGTH as Xl, readGroupFileMeta as Xn, handoffBusyFrame as Xo, checkPushEndpoint as Xr, ContactRequestError as Xs, ONCHAIN_PROVIDER as Xt, groupName as Y, heardTime as Ya, encodeInviteCode as Yc, automaticTransport as Yi, verify as Yl, isGroupMessageId as Yn, handoffAttemptSucceeded as Yo, wakeRequest as Yr, turnOff as Ys, EVM_TEST_CHAINS as Yt, SSHSIG_NAMESPACE as Z, shownTime as Za, inviteOwnership as Zc, irohRelayUrl as Zi, sanitizeAvatar as Zl, readGroupHave as Zn, handoffCancelFrame as Zo, vapidKeysMatch as Zr, REQUEST_LIFETIME_MS as Zs, PaymentPreflightError as Zt, openGroupTyping as _, parseLinkPreview as _a, checkAppManifest as _c, domainTxtRecord as _i, firstDeviceSetSecret as _l, newPubkyProofFolder as _n, parseLocalTarget as _o, lobbyRecords as _r, readHandoffPake as _s, parseAtprotoDidDocument as _t, appStoreDecision as a, sanitizeMime as aa, openRequest as ac, UPGRADE_CAPABILITY as ai, deviceLinkPairing as al, assertWholeSats as an, rosterHas as ao, groupSignalFrame as ar, handoffOfferFrame as as, BitcoinAddressError as at, utf8Decode as au, CommunitySession as b, COMMUNITY_REACTION_FRAME as ba, readAppBundle as bc, isPublicAddress as bi, signTurnPacket as bl, pubkyProofFile as bn, decodeControl as bo, newerHead as br, sealHandoffPiece as bs, verifyAtprotoRecordProof as bt, planAppUpdate as c, baseMime as ca, requestRecords as cc, HOLD_LIMITS as ci, seedSigner as cl, walletNetworkOf as cn, DirectPathWatch as co, mayBeHub as cr, handoffRetryAfter as cs, ATPROTO_FULL_SCOPE as ct, readAppStore as d, voicePeaksOf as da, APP_BUNDLE_MAGIC as dc, isHoldUrl as di, TURN_RAISE_READ_TIMEOUT_MS as dl, sparkAddressKind as dn, EXPECT_PEER_MS as do, COMMUNITY_TOPOLOGY as dr, newHandoffId as ds, atprotoDidMethod as dt, peekDhtMailbox as ea, knockSlotOf as ec, isAppVersion as ei, ENROLL_CAPABILITY as el, TEST_USDT_FAUCET_AMOUNT as en, MAX_GROUP_CHAIN as eo, CarriedTransport as er, handoffDataFrame as es, parseSshSignature as et, fromBase64Url as eu, readAppStoreSteps as f, parseVideoMeta as fa, APP_ICON_PATH as fc, newMailbox as fi, TURN_SETTLE_MS as fl, sparkInvoiceDetails as fn, RELAY_POLL_INTERVALS as fo, beaconKeys as fr, readHandoffAck as fs, atprotoProofRecord as ft, groupTypingEpoch as g, dhtEditId as ga, assembleAppBundle as gc, dnsProofName as gi, TURN_MAX as gl, isPubkyProofFolder as gn, formatLocalTarget as go, lobbyKeys as gr, readHandoffHello as gs, normalizeAtprotoHandle as gt, GroupTypingBoard as h, RateWindow as ha, appViewOf as hc, decodeDnsResponse as hi, TURN_LAST_SEQUENCE as hl, isPubkyKey as hn, GhostlyHttpError as ho, freshHubs as hr, readHandoffHave as hs, isAtprotoDid as ht, appRevocationFor as i, sanitizeFileName as ia, mergeContactKnocks as ic, STATUS_CARD_CAPABILITY as ii, deviceKeyZ32 as il, assertTokenUnits as in, rosterAdmin as io, SIGNAL_REPLY_MS as ir, handoffManifestFrames as is, verifyBitcoinMessage as it, toZ32 as iu, mergeKnocks as j, pairedReplyAuthor as ja, readAppRevocation as jc, dialDescriptors as ji, SLOW_MS as jl, isFederationId as jn, emptyLinkRecords as jo, TYPING_KINDS as jr, ENROLL_PROOF as js, didWebFile as jt, knockIdentity as k, validReactionNumber as ka, isAppKey as kc, DHT_TEXT_CAPABILITY as ki, RelayTransport as kl, fedimintRequestPayload as kn, parseCallSignal as ko, transferEnded as kr, ENROLL_GRANT as ks, didSignedMessages as kt, APP_STORE_LIMITS as l, fileMessageText as la, seenEntry as lc, HoldKeys as li, webCryptoSigner as ll, SPARK_NETWORKS as ln, AWAITING_PEER_MS as lo, meshHubs as lr, handoffStreamKey as ls, ATPROTO_PROOF_COLLECTION as lt, GROUP_TYPING_FRAME as m, EDIT_RATE_WINDOW_MS as ma, appDigest as mc, DOMAIN_FILE_MAX_BYTES as mi, turnPutSummary as ml, PUBKY_PROOF_MAX_BYTES as mn, presenceSeenAt as mo, doorHubs as mr, readHandoffDone as ms, checkAtprotoProofRecord as mt, readX401SdJwtVc as n, dhtFileId as na, linkRecords as nc, BUTTONS_CAPABILITY as ni, deviceEchoFrame as nl, WALLET_NETWORKS as nn, commitHash as no, SIGNAL_FRESH_MS as nr, handoffEphemeral as ns, sshSignCommand as nt, randomBytes as nu, appUpdateDecision as o, PLAYABLE_AUDIO as oa, readKnockSlot as oc, HOLD_CAPABILITY as oi, devicePingFrame as ol, formatPaymentAmount as on, verifyCommitSignature as oo, readGroupSignal as or, handoffPakeFrame as os, decodeAnyBitcoinAddress as ot, utf8Encode as ou, signAppStore as p, EDIT_BUFFER_MS as pa, APP_PERMISSIONS as pc, readManifest as pi, classifyTurnRead as pl, isBitcoinAddress as pn, WATCH_PEER_MS as po, beaconRecords as pr, readHandoffCancel as ps, atprotoProofRkey as pt, parseCommunityEdit as q, arrivalKey as qa, createChatInvite as qc, validExternalKey as qi, identityFromSeedB64 as ql, fetchesByItself as qn, handoffAttemptAllowed as qo, parseWakeFrame as qr, settleRequest as qs, signDidDhtPacket as qt, sameX401HolderJwk as r, formatFileSize as ra, makeStampPaced as rc, EDIT_CAPABILITY as ri, deviceEchoNonce as rl, arkAddressPrefix as rn, parseGroupCommit as ro, SIGNAL_HOLD_MS as rr, handoffHelloFrame as rs, verifySshSignature as rt, toBase64Url as ru, checkAppBeforeRun as s, VOICE_LIMITS as sa, readLinkRecord as sc, HOLD_DATED_BACK_MS as si, newDeviceSetSecret as sl, validatePaymentTarget as sn, edgeParams as so, MESH_HUBS as sr, handoffReleaseFrame as ss, ATPROTO_DECLARED_SCOPE as st, newX401HolderKey as t, DHT_FILE_CAPABILITY as ta, knockSlotRecords as tc, APPS_CAPABILITY as ti, HANDOFF_CAPABILITY as tl, USDT_PUBLIC_RPC as tn, MEMBER_KEY as to, GROUP_SIGNAL_FRAME as tr, handoffDigest as ts, sameSshKey as tt, isZ32Key as tu, checkAppStoreIndex as u, parseVoiceMeta as ua, APP_BUNDLE_LIMITS as uc, HoldRefusedError as ui, TURN_PUT_WINDOW_MS as ul, SPARK_PROVIDER as un, DHT_POLL_INTERVALS as uo, pickMeshHubs as ur, handoffVersions as us, ATPROTO_PROOF_SCOPE as ut, sealGroupTyping as v, forwardedAgain as va, isAppUrl as vc, domainWellKnownFile as vi, nextTurnPosition as vl, normalizePubkyKey as vn, webLocalFetch as vo, mergeBeacon as vr, readHandoffTurnFrame as vs, shortAtprotoDid as vt, encodeCommunityLink as w, nextReactionNumber as wa, APP_STATEMENT_LIMITS as wc, recordsFromWellKnown as wi, turnName as wl, requestLnurlInvoice as wn, answersOffer as wo, readBeaconHead as wr, setAckFrame as ws, DidError as wt, GROUP_READ_NOTE_COMMUNITY as x, GROUP_REACTION_FRAME as xa, readAppBundleAsync as xc, nip05RootKey as xi, signTurnRelease as xl, pubkyProofPath as xn, encodeControl as xo, pickHubs as xr, SET_ACK as xs, DID_DOCUMENT_MAX_BYTES as xt, COMMUNITY_LIMITS as y, readForwarded as ya, pacer as yc, encodeDnsQuery as yi, readTurnPacket as yl, pubkyProofCapability as yn, LIMITS as yo, mergeLobby as yr, readHandoffVerified as ys, AtprotoProofError as yt, GROUP_REACTED_FRAME as z, STATUS_CARD_LIMITS as za, readCanonicalJson as zc, identityRevocationValue as zi, PacketTooLargeError as zl, pairedMessageFrame as zn, HANDOFF_HELLO as zo, nextPinNumber as zr, readEnrollGrant as zs, signingKeys as zt };
|
|
33539
|
+
export { parseSshPublicKey as $, sameButtonText as $a, deviceInviteJoinerParams as $c, irohRelayUrl as $i, parseRelayPayload as $l, readGroupWantNo as $n, HANDOFF_TIMINGS as $o, isServeId as $r, inboxRecord as $s, SEPOLIA_TEST_USDT_FAUCET as $t, knockRecords as A, queueReaction as Aa, readAppBundleAsync as Ac, CapsExchange as Ai, signTurnRelease as Al, findEndpoint as An, CALL_SIGNAL_MAX_AGE_MS as Ao, transferStalled as Ar, SET_ACK as As, didWebDocumentUrl as At, GROUP_READ_NOTE as B, CRON_LINE as Ba, readAppRevocation as Bc, emptyIdentityLedger as Bi, SLOW_MS as Bl, engineError as Bn, emptyLinkRecords as Bo, pinIsNewer as Br, ENROLL_PROOF as Bs, staticDidDocument as Bt, decodeCommunityLink as C, forwardedAgain as Ca, appDigest as Cc, nip05RootKey as Ci, turnPutSummary as Cl, pubkyHomeserverOf as Cn, GhostlyHttpError as Co, readBeacon as Cr, readHandoffDone as Cs, DID_JWS_MAX_LENGTH as Ct, encodeGroupEntryLink as D, REACTION_LIMITS as Da, isAppUrl as Dc, recordsName as Di, nextTurnPosition as Dl, ENDPOINT as Dn, LIMITS as Do, ChatFiles as Dr, readHandoffTurnFrame as Ds, didGhostlyServiceEntry as Dt, decodeGroupEntryLink as E, GROUP_REACTION_FRAME as Ea, checkAppManifest as Ec, recordsFromWellKnown as Ei, firstDeviceSetSecret as El, decodeBolt11 as En, webLocalFetch as Eo, shouldBeHub as Er, readHandoffPake as Es, checkDidSignature as Et, groupWakeFrame as F, wireReaction as Fa, appRef as Fc, IDENTITY_MAX_VALIDITY as Fi, turnVerifierMark as Fl, INVITE_TAKEN as Fn, callSignalHeardAt as Fo, typingActivity as Fr, signTombstone as Fs, normalizeDid as Ft, GROUP_EDIT_TEXT_BYTES as G, RUN_RESULTS as Ga, readImageMeta as Gc, revokesIdentity as Gi, budgetRetryMs as Gl, GROUP_WANT_FRAME as Gn, HANDOFF_CANCEL as Go, deviceWakeRequest as Gr, enrollGrantFrame as Gs, encodeDidDhtPacket as Gt, frameBytes as H, PR_CHECKS as Ha, signAppObject as Hc, identityStatement as Hi, normalizeRelayUrl as Hl, parseEngineError as Hn, LEGACY_SERVICES as Ho, readPin as Hr, enrollCancelReason as Hs, didDhtDocument as Ht, groupWakes as I, pairedReplyAuthor as Ia, checkAppRevokeStatement as Ic, IDENTITY_REVOCATION_LABEL as Ii, DEFAULT_RELAYS as Il, LIVENESS_PING_MS as In, contactRtcConfig as Io, GROUP_PIN_FRAME as Ir, verifySetUpdate as Is, parseDid as It, mentionsMember as J, appCardId as Ja, readCanonicalJson as Jc, emptyProofLedger as Ji, PacketTooLargeError as Jl, groupFileFallback as Jn, HANDOFF_HELLO as Jo, relayRequest as Jr, readEnrollGrant as Js, ETHEREUM_USDT as Jt, carryMentions as K, STATUS_CARD_LIMITS as Ka, canonicalJson as Kc, lastSharedWithMe as Ki, isDiscoveryBudgetError as Kl, GROUP_WANT_NO_FRAME as Kn, HANDOFF_DONE as Ko, newWakeToken as Kr, enrollHelloFrame as Ks, resolveDidDht as Kt, parseGroupWakeFrame as L, readReply as La, isAppHash as Lc, IdentityCheckUnavailable as Li, HEDGE_MS as Ll, PAIRED_FRAME_TOO_LARGE as Ln, extractParamsFromSdp as Lo, PIN_LIMITS as Lr, ENROLL_DONE as Ls, parseDidDocument as Lt, readKnocks as M, reactionIsNewer as Ma, APP_PREFIXES as Mc, capsDescriptors as Mi, turnKeys as Ml, parseCashuRequestPayload as Mn, answersOffer as Mo, TYPING_REFRESH_MS as Mr, readSetUpdate as Ms, didWebFileNames as Mt, GROUP_WAKE_FRAME as N, readReaction as Na, APP_STATEMENT_LIMITS as Nc, dialDescriptors as Ni, turnName as Nl, parseFedimintRequestPayload as Nn, buildSdpFromSignal as No, TypingSender as Nr, setAckFrame as Ns, didWebFileUrl as Nt, entryParams as O, ReactionWindow as Oa, pacer as Oc, txtValue as Oi, readTurnPacket as Ol, cashuRequestPayload as On, decodeControl as Oo, FILE_LIMITS as Or, readHandoffVerified as Os, didJwsAlg as Ot, GroupWakeLimiter as P, validReactionNumber as Pa, appFingerprint as Pc, IDENTITY_MAX_EVIDENCE as Pi, turnStatedVerifier as Pl, GhostLink as Pn, callRtcConfig as Po, sanitizeTypingStatus as Pr, setUpdateFrame as Ps, didWebHost as Pt, SshSigError as Q, checkStatusCard as Qa, createDeviceInvite as Qc, irohDescriptor as Qi, openRelayPayload as Ql, readGroupWant as Qn, HANDOFF_REQUEST as Qo, APP_RANGE_LIMITS as Qr, endedRequests as Qs, SEPOLIA_TEST_USDT as Qt, GROUP_LIMITS as R, replySnippet as Ra, isAppKey as Rc, IdentityExchange as Ri, RelayTransport as Rl, pairedMessageFits as Rn, parseCallSignal as Ro, mayPin as Rr, ENROLL_GRANT as Rs, parseDidSignaturePaste as Rt, communityHasFrame as S, parseLinkPreview as Sa, APP_PERMISSIONS as Sc, isPublicAddress as Si, classifyTurnRead as Sl, homeserverWebEndpoint as Sn, presenceSeenAt as So, rankHubs as Sr, readHandoffCancel as Ss, DID_FILE_MAX_BYTES as St, KNOCK_TTL_MS as T, COMMUNITY_REACTION_FRAME as Ta, assembleAppBundle as Tc, recordsFromTxt as Ti, TURN_MAX as Tl, resolveLightningDestination as Tn, parseLocalTarget as To, readLobby as Tr, readHandoffHello as Ts, checkDidJws as Tt, COMMUNITY_EDIT_FRAME as U, PR_STATES as Ua, signAppRevocation as Uc, newIdentityBinding as Ui, setLinkTraceSink as Ul, GROUP_FILE_LIMITS as Un, serviceIdFromName as Uo, WAKE_CALL_INTERVAL_MS as Ur, enrollDigits as Us, didDhtFromPublicKey as Ut, GroupSession as V, ITEM_STATES as Va, readAppRevocations as Vc, identityRevocationValue as Vi, currentRelays as Vl, engineText as Vn, HTTP_SERVICE_PROTO as Vo, pinNumberHolds as Vr, enrollCancelFrame as Vs, strictBase64Url as Vt, GROUP_EDIT_FRAME as W, ROUTINE_STATES as Wa, parseImageMeta as Wc, receivedIdentityStatus as Wi, traceLink as Wl, GROUP_HAVE_FRAME as Wn, HANDOFF_ACK as Wo, WakeLimiter as Wr, enrollDoneFrame as Ws, encodeDidDhtDeactivated as Wt, SSHSIG_MAX_ARMOR as X, cardLine as Xa, encodeContactLink as Xc, TRANSPORTS as Xi, createRelayPayload as Xl, readGroupFileMeta as Xn, HANDOFF_PAKE as Xo, checkPushEndpoint as Xr, verifyEnrollProof as Xs, ONCHAIN_PROVIDER as Xt, groupName as Y, buttonLabelClash as Ya, createContactLink as Yc, validExternalKey as Yi, RELAY_PAYLOAD_MAX_BYTES as Yl, isGroupMessageId as Yn, HANDOFF_OFFER as Yo, wakeRequest as Yr, readEnrollHello as Ys, EVM_TEST_CHAINS as Yt, SSHSIG_NAMESPACE as Z, cardUrl as Za, readContactLink as Zc, automaticTransport as Zi, newerPacket as Zl, readGroupHave as Zn, HANDOFF_PIECE_BYTES as Zo, vapidKeysMatch as Zr, clearMissed as Zs, PaymentPreflightError as Zt, openGroupTyping as _, EDIT_RATE_WINDOW_MS as _a, requestRecords as _c, decodeDnsResponse as _i, seedSigner as _l, newPubkyProofFolder as _n, AWAITING_PEER_MS as _o, lobbyRecords as _r, handoffRetryAfter as _s, parseAtprotoDidDocument as _t, appStoreDecision as a, formatFileSize as aa, ContactRequestError as ac, EDIT_CAPABILITY as ai, inviteLink as al, assertWholeSats as an, shownTime as ao, groupSignalFrame as ar, handoffBusyFrame as as, BitcoinAddressError as at, MAX_AVATAR_LENGTH as au, CommunitySession as b, RateWindow as ba, APP_BUNDLE_MAGIC as bc, domainWellKnownFile as bi, TURN_RAISE_READ_TIMEOUT_MS as bl, pubkyProofFile as bn, RELAY_POLL_INTERVALS as bo, newerHead as br, newHandoffId as bs, verifyAtprotoRecordProof as bt, planAppUpdate as c, PLAYABLE_AUDIO as ca, knockSlotIdentity as cc, HOLD_CAPABILITY as ci, DEVICES_CAPABILITY as cl, walletNetworkOf as cn, MAX_GROUP_CHAIN as co, mayBeHub as cr, handoffContextProof as cs, ATPROTO_FULL_SCOPE as ct, bytesEqual as cu, readAppStore as d, fileMessageText as da, linkRecords as dc, HoldKeys as di, deviceEchoFrame as dl, sparkAddressKind as dn, parseGroupCommit as do, COMMUNITY_TOPOLOGY as dr, handoffEphemeral as ds, atprotoDidMethod as dt, randomBytes as du, DHT_FILE_TOO_LARGE as ea, newInbox as ec, APP_DATA_MAX_BYTES as ei, readDeviceInvite as el, TEST_USDT_FAUCET_AMOUNT as en, statusCardText as eo, CarriedTransport as er, HANDOFF_VERIFIED as es, parseSshSignature as et, createIdentity as eu, readAppStoreSteps as f, parseVoiceMeta as fa, makeStampPaced as fc, HoldRefusedError as fi, deviceEchoNonce as fl, sparkInvoiceDetails as fn, rosterAdmin as fo, beaconKeys as fr, handoffHelloFrame as fs, atprotoProofRecord as ft, toBase64Url as fu, groupTypingEpoch as g, EDIT_BUFFER_MS as ga, readLinkRecord as gc, DOMAIN_FILE_MAX_BYTES as gi, newDeviceSetSecret as gl, isPubkyProofFolder as gn, DirectPathWatch as go, lobbyKeys as gr, handoffReleaseFrame as gs, normalizeAtprotoHandle as gt, GroupTypingBoard as h, parseVideoMeta as ha, readKnockSlot as hc, readManifest as hi, devicePingFrame as hl, isPubkyKey as hn, edgeParams as ho, freshHubs as hr, handoffPakeFrame as hs, isAtprotoDid as ht, utf8Encode as hu, appRevocationFor as i, dhtFileId as ia, turnOff as ic, BUTTONS_CAPABILITY as ii, encodeInviteCode as il, assertTokenUnits as in, receivedTimestamp as io, SIGNAL_REPLY_MS as ir, handoffAttemptSucceeded as is, verifyBitcoinMessage as it, verify as iu, mergeKnocks as j, reactionEmoji as ja, sha256Paced as jc, DHT_TEXT_CAPABILITY as ji, turnInstance as jl, isFederationId as jn, RTC_CONFIG as jo, TYPING_KINDS as jr, SET_UPDATE as js, didWebFile as jt, knockIdentity as k, nextReactionNumber as ka, readAppBundle as kc, wellKnownUrl as ki, signTurnPacket as kl, fedimintRequestPayload as kn, encodeControl as ko, transferEnded as kr, sealHandoffPiece as ks, didSignedMessages as kt, APP_STORE_LIMITS as l, VOICE_LIMITS as la, knockSlotOf as lc, HOLD_DATED_BACK_MS as li, ENROLL_CAPABILITY as ll, SPARK_NETWORKS as ln, MEMBER_KEY as lo, meshHubs as lr, handoffDataFrame as ls, ATPROTO_PROOF_COLLECTION as lt, fromBase64Url as lu, GROUP_TYPING_FRAME as m, voicePeaksOf as ma, openRequest as mc, newMailbox as mi, deviceLinkPairing as ml, PUBKY_PROOF_MAX_BYTES as mn, verifyCommitSignature as mo, doorHubs as mr, handoffOfferFrame as ms, checkAtprotoProofRecord as mt, utf8Decode as mu, readX401SdJwtVc as n, peekDhtMailbox as na, settleRequest as nc, isAppVersion as ni, createChatInvite as nl, WALLET_NETWORKS as nn, claimedTime as no, SIGNAL_FRESH_MS as nr, handoffAttemptAllowed as ns, sshSignCommand as nt, identityFromSeedB64 as nu, appUpdateDecision as o, sanitizeFileName as oa, REQUEST_LIFETIME_MS as oc, STATUS_CARD_CAPABILITY as oi, inviteOwnership as ol, formatPaymentAmount as on, GROUP_ADMIN_OFF_ERROR as oo, readGroupSignal as or, handoffCancelFrame as os, decodeAnyBitcoinAddress as ot, sanitizeAvatar as ou, signAppStore as p, voiceDownloadName as pa, mergeContactKnocks as pc, isHoldUrl as pi, deviceKeyZ32 as pl, isBitcoinAddress as pn, rosterHas as po, beaconRecords as pr, handoffManifestFrames as ps, atprotoProofRkey as pt, toZ32 as pu, parseCommunityEdit as q, TASK_STATUSES as qa, canonicalJsonBytes as qc, PeerProofs as qi, withRequestOptions as ql, fetchesByItself as qn, HANDOFF_HAVE as qo, parseWakeFrame as qr, enrollProofFrame as qs, signDidDhtPacket as qt, sameX401HolderJwk as r, DHT_FILE_CAPABILITY as ra, takeRequest as rc, APPS_CAPABILITY as ri, decodeInviteCode as rl, arkAddressPrefix as rn, heardTime as ro, SIGNAL_HOLD_MS as rr, handoffAttemptFailed as rs, verifySshSignature as rt, publicKeyFromZ32 as ru, checkAppBeforeRun as s, sanitizeMime as sa, contactDay as sc, UPGRADE_CAPABILITY as si, ownInviteRefusal as sl, validatePaymentTarget as sn, GROUP_MEMBER_CAP as so, MESH_HUBS as sr, handoffContext as ss, ATPROTO_DECLARED_SCOPE as st, sanitizeDisplayText as su, newX401HolderKey as t, DHT_MESSAGE_TTL as ta, planKnocks as tc, chatAppId as ti, OwnInviteError as tl, USDT_PUBLIC_RPC as tn, arrivalKey as to, GROUP_SIGNAL_FRAME as tr, filePartName as ts, sameSshKey as tt, identityFromSeed as tu, checkAppStoreIndex as u, baseMime as ua, knockSlotRecords as uc, HOLD_LIMITS as ui, HANDOFF_CAPABILITY as ul, SPARK_PROVIDER as un, commitHash as uo, pickMeshHubs as ur, handoffDigest as us, ATPROTO_PROOF_SCOPE as ut, isZ32Key as uu, sealGroupTyping as v, MAX_REMOVAL_NUMBER as va, seenEntry as vc, dnsProofName as vi, webCryptoSigner as vl, normalizePubkyKey as vn, DHT_POLL_INTERVALS as vo, mergeBeacon as vr, handoffStreamKey as vs, shortAtprotoDid as vt, encodeCommunityLink as w, readForwarded as wa, appViewOf as wc, normalizeDomain as wi, TURN_LAST_SEQUENCE as wl, requestLnurlInvoice as wn, formatLocalTarget as wo, readBeaconHead as wr, readHandoffHave as ws, DidError as wt, GROUP_READ_NOTE_COMMUNITY as x, dhtEditId as xa, APP_ICON_PATH as xc, encodeDnsQuery as xi, TURN_SETTLE_MS as xl, pubkyProofPath as xn, WATCH_PEER_MS as xo, pickHubs as xr, readHandoffAck as xs, DID_DOCUMENT_MAX_BYTES as xt, COMMUNITY_LIMITS as y, REMOVED_TEXT as ya, APP_BUNDLE_LIMITS as yc, domainTxtRecord as yi, TURN_PUT_WINDOW_MS as yl, pubkyProofCapability as yn, EXPECT_PEER_MS as yo, mergeLobby as yr, handoffVersions as ys, AtprotoProofError as yt, GROUP_REACTED_FRAME as z, BUTTON_ID as za, isAppRef as zc, boundVerifiedIdentity as zi, RelaysFailedError as zl, pairedMessageFrame as zn, signalHasVideo as zo, nextPinNumber as zr, ENROLL_HELLO as zs, signingKeys as zt };
|
|
32769
33540
|
|
|
32770
|
-
//# sourceMappingURL=src-
|
|
33541
|
+
//# sourceMappingURL=src-Bpy99Z2K.js.map
|