@ghostlytools/sdk 1.13.3 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bitcoinAddress-DifDz48H.js → bitcoinAddress-CDYL3yPz.js} +14 -8
- package/dist/bitcoinAddress-CDYL3yPz.js.map +1 -0
- package/dist/core.js +23 -8
- package/dist/core.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/{pairedTransports-D8ZSZJBi.js → pairedTransports-CQGJfihi.js} +2 -2
- package/dist/{pairedTransports-D8ZSZJBi.js.map → pairedTransports-CQGJfihi.js.map} +1 -1
- package/dist/testing.js +2 -2
- package/dist/types/core/src/http.d.ts +3 -2
- package/dist/types/core/src/identityProofs.d.ts +5 -0
- package/dist/types/core/src/viewerGuard.d.ts +7 -4
- package/dist/{verify-DpuVYnNs.js → verify-CmN2lXY3.js} +2 -2
- package/dist/{verify-DpuVYnNs.js.map → verify-CmN2lXY3.js.map} +1 -1
- package/package.json +1 -1
- package/dist/bitcoinAddress-DifDz48H.js.map +0 -1
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as __toESM } from "./rolldown-runtime-DpEnGzO4.js";
|
|
2
2
|
import { a as concatBytes, c as fromZ32, d as toBase64, f as toBase64Url, h as utf8Encode, i as bytesEqual, l as isZ32Key, m as utf8Decode, n as decodeBolt11, o as fromBase64, p as toZ32, r as findBolt11, s as fromBase64Url, t as BOLT11_PATTERN, u as randomBytes } from "./bolt11-CRiQrma3.js";
|
|
3
|
-
import { $ as DEFAULT_RELAYS, $t as decodeTxtPacket, A as identityRevocationValue, At as BREAKER_BASE_MS, B as applyIdentityEvent, Bt as withRequestOptions, C as IdentityCheckUnavailable, Ct as currentRelays, D as emptyIdentityLedger, Dt as setLinkTraceSink, E as boundVerifiedIdentity, Et as relayUrlProblem, F as receivedIdentityStatus, Ft as PublishFailedError, G as AWAITED_READS, Gt as createRelayPayload, H as ANSWER_READ_ALLOWANCE, Ht as PKARR_FUTURE_SKEW_MS, I as revokesIdentity, It as budgetRetryMs, J as BACKGROUND_WRITES_SHARE, Jt as openRelayPayload, K as BACKGROUND_REQUESTS_PER_MINUTE, Kt as measureRecords, L as signIdentityPresentation, Lt as heldBackError, M as identityStatementText, Mt as BREAKER_THRESHOLD, N as isIdentityBinding, Nt as RelayBreaker, O as identityPresentationBytes, Ot as traceLink, P as newIdentityBinding, Pt as DiscoveryBudgetError, Q as CHAT_WATCH_SHARE, Qt as decodeDnsAnswers, R as verifyIdentityPresentation, Rt as isDiscoveryBudgetError, S as IDENTITY_SUBJECT, St as WRITE_FIRST_MS, T as boundIdentityDisplay, Tt as readRelayBody, U as ANSWER_READ_FIRST_MS, Ut as PacketTooLargeError, V as lastSharedWithMe, Vt as MAX_DNS_PACKET_BYTES, W as ANSWER_READ_SPACING_MS, Wt as RELAY_PAYLOAD_MAX_BYTES, X as CHAT_RESERVE_MOST_SHARE, Xt as readOwnRelayPayload, Y as CHAT_RESERVE, Yt as parseRelayPayload, Z as CHAT_RESERVE_PER_CHAT, Zt as signRelayPayload, _ as IDENTITY_REUSE_CHECK_S, _n as stripHidden, _t as SLOW_DEMOTE_MS, a as IDENTITY_CLOCK_SKEW, an as createIdentity, at as GROUP_OVER_PACE_MS, b as IDENTITY_SEND_WINDOW_MS, bt as WATCH_SHARE, c as IDENTITY_MAX_CHECKS_PER_HOUR, cn as publicKeyFromZ32, ct as HEDGE_MISSING_MS, d as IDENTITY_MAX_RECEIVED, dn as verify, dt as RELAY_REQUESTS_PER_MINUTE, en as encodeTxtPacket, et as DEPARTED_READS, f as IDENTITY_MAX_VALIDITY, fn as MAX_NICK_LENGTH, ft as REQUESTS_PER_MINUTE, g as IDENTITY_RESEND_MS, gn as sanitizeNick, gt as SIGNALING_WINDOW_MS, h as IDENTITY_RESENDS, hn as sanitizeDisplayText, ht as SIGNALING_ALLOWANCE_SHARE, i as IDENTITY_CHECK_UNAVAILABLE, in as IDENTITY_MEMO_SIZE, it as GROUP_BURST_ONE_LINK, j as identityStatement, jt as BREAKER_MAX_MS, k as identityRefusal, kt as BREAKER_ALL_DOWN_PROBE_MS, l as IDENTITY_MAX_EVIDENCE, ln as setPublicKeyFastPath, lt as HEDGE_MS, m as IDENTITY_PROVIDER_ID, mn as hasVisible, mt as RelaysFailedError, n as isBitcoinAddress, nn as IDENTITY_MEMO_IDLE_MS, nt as FRESH_READ_MS, o as IDENTITY_FRAME_LIMIT, on as identityFromSeed, ot as GROUP_RATION_WINDOW_MS, p as IDENTITY_PROOF_CAPABILITY, pn as dropLoneJoiners, pt as RelayTransport, q as BACKGROUND_WHILE_SIGNALING, qt as newerPacket, r as IDENTITY_CHALLENGE_WINDOW, rn as IDENTITY_MEMO_MAX, rt as GROUP_BURST_MS, s as IDENTITY_FRAME_WINDOW_MS, sn as identityFromSeedB64, st as GROUP_SIGNALING_ALLOWANCE_SHARE, t as BITCOIN_NETWORKS, tn as readDnsName, tt as DOOR_FIRST_MS, u as IDENTITY_MAX_FRAME, un as sign, ut as PREVIOUS_DEFAULT_RELAYS, v as IDENTITY_REVOCATION_LABEL, vn as trimEndOf, vt as SLOW_MS, w as IdentityExchange, wt as normalizeRelayUrl, x as IDENTITY_STATEMENT_PREFIX, xt as WAY_BACK_SHARE, y as IDENTITY_SEND_LIMIT, yn as unwrapPasted, yt as TURN_SOURCE_TIMEOUT_MS, z as IDENTITY_TIMELINE_MAX, zt as publishedNowhere } from "./bitcoinAddress-
|
|
4
|
-
import { A as NIP05_PATH, B as parseDomainTxt, C as underLocalSuffix, D as DOMAIN_MAX_RECORDS, E as DOMAIN_FILE_MAX_BYTES, F as domainWellKnownFile, G as validDomainRecord, H as recordsFromWellKnown, I as encodeDnsQuery, J as encrypt, K as wellKnownUrl, L as isPublicAddress, M as decodeDnsResponse, N as dnsProofName, O as DOMAIN_METHODS, P as domainTxtRecord, R as nip05RootKey, S as readManifest, T as DNS_TYPE, U as recordsName, V as recordsFromTxt, W as txtValue, X as sealedLength, Y as generateEncryptionKey, Z as tryDecrypt, _ as HOLD_LIMITS, a as automaticTransport, b as isHoldUrl, c as irohDescriptor, d as relayUrl, f as relayUrlTooLong, g as HOLD_DATED_BACK_MS, h as HOLD_CAPABILITY, i as TRANSPORTS, j as WELL_KNOWN_PATH, k as DOMAIN_TXT_MAX_BYTES, l as irohRelayUrl, m as transportOrder, n as RELAY_URL, o as checkedDescriptors, p as relayedTransports, q as decrypt, r as RELAY_WITH_SECRETS, s as dialableIrohRelay, t as AUTOMATIC_ORDER, u as rankTransports, v as HoldKeys, w as DNS_LABEL, x as newMailbox, y as HoldRefusedError, z as normalizeDomain } from "./pairedTransports-
|
|
3
|
+
import { $ as DEFAULT_RELAYS, $t as decodeTxtPacket, A as identityRevocationValue, At as BREAKER_BASE_MS, B as applyIdentityEvent, Bt as withRequestOptions, C as IdentityCheckUnavailable, Ct as currentRelays, D as emptyIdentityLedger, Dt as setLinkTraceSink, E as boundVerifiedIdentity, Et as relayUrlProblem, F as receivedIdentityStatus, Ft as PublishFailedError, G as AWAITED_READS, Gt as createRelayPayload, H as ANSWER_READ_ALLOWANCE, Ht as PKARR_FUTURE_SKEW_MS, I as revokesIdentity, It as budgetRetryMs, J as BACKGROUND_WRITES_SHARE, Jt as openRelayPayload, K as BACKGROUND_REQUESTS_PER_MINUTE, Kt as measureRecords, L as signIdentityPresentation, Lt as heldBackError, M as identityStatementText, Mt as BREAKER_THRESHOLD, N as isIdentityBinding, Nt as RelayBreaker, O as identityPresentationBytes, Ot as traceLink, P as newIdentityBinding, Pt as DiscoveryBudgetError, Q as CHAT_WATCH_SHARE, Qt as decodeDnsAnswers, R as verifyIdentityPresentation, Rt as isDiscoveryBudgetError, S as IDENTITY_SUBJECT, St as WRITE_FIRST_MS, T as boundIdentityDisplay, Tt as readRelayBody, U as ANSWER_READ_FIRST_MS, Ut as PacketTooLargeError, V as lastSharedWithMe, Vt as MAX_DNS_PACKET_BYTES, W as ANSWER_READ_SPACING_MS, Wt as RELAY_PAYLOAD_MAX_BYTES, X as CHAT_RESERVE_MOST_SHARE, Xt as readOwnRelayPayload, Y as CHAT_RESERVE, Yt as parseRelayPayload, Z as CHAT_RESERVE_PER_CHAT, Zt as signRelayPayload, _ as IDENTITY_REUSE_CHECK_S, _n as stripHidden, _t as SLOW_DEMOTE_MS, a as IDENTITY_CLOCK_SKEW, an as createIdentity, at as GROUP_OVER_PACE_MS, b as IDENTITY_SEND_WINDOW_MS, bt as WATCH_SHARE, c as IDENTITY_MAX_CHECKS_PER_HOUR, cn as publicKeyFromZ32, ct as HEDGE_MISSING_MS, d as IDENTITY_MAX_RECEIVED, dn as verify, dt as RELAY_REQUESTS_PER_MINUTE, en as encodeTxtPacket, et as DEPARTED_READS, f as IDENTITY_MAX_VALIDITY, fn as MAX_NICK_LENGTH, ft as REQUESTS_PER_MINUTE, g as IDENTITY_RESEND_MS, gn as sanitizeNick, gt as SIGNALING_WINDOW_MS, h as IDENTITY_RESENDS, hn as sanitizeDisplayText, ht as SIGNALING_ALLOWANCE_SHARE, i as IDENTITY_CHECK_UNAVAILABLE, in as IDENTITY_MEMO_SIZE, it as GROUP_BURST_ONE_LINK, j as identityStatement, jt as BREAKER_MAX_MS, k as identityRefusal, kt as BREAKER_ALL_DOWN_PROBE_MS, l as IDENTITY_MAX_EVIDENCE, ln as setPublicKeyFastPath, lt as HEDGE_MS, m as IDENTITY_PROVIDER_ID, mn as hasVisible, mt as RelaysFailedError, n as isBitcoinAddress, nn as IDENTITY_MEMO_IDLE_MS, nt as FRESH_READ_MS, o as IDENTITY_FRAME_LIMIT, on as identityFromSeed, ot as GROUP_RATION_WINDOW_MS, p as IDENTITY_PROOF_CAPABILITY, pn as dropLoneJoiners, pt as RelayTransport, q as BACKGROUND_WHILE_SIGNALING, qt as newerPacket, r as IDENTITY_CHALLENGE_WINDOW, rn as IDENTITY_MEMO_MAX, rt as GROUP_BURST_MS, s as IDENTITY_FRAME_WINDOW_MS, sn as identityFromSeedB64, st as GROUP_SIGNALING_ALLOWANCE_SHARE, t as BITCOIN_NETWORKS, tn as readDnsName, tt as DOOR_FIRST_MS, u as IDENTITY_MAX_FRAME, un as sign, ut as PREVIOUS_DEFAULT_RELAYS, v as IDENTITY_REVOCATION_LABEL, vn as trimEndOf, vt as SLOW_MS, w as IdentityExchange, wt as normalizeRelayUrl, x as IDENTITY_STATEMENT_PREFIX, xt as WAY_BACK_SHARE, y as IDENTITY_SEND_LIMIT, yn as unwrapPasted, yt as TURN_SOURCE_TIMEOUT_MS, z as IDENTITY_TIMELINE_MAX, zt as publishedNowhere } from "./bitcoinAddress-CDYL3yPz.js";
|
|
4
|
+
import { A as NIP05_PATH, B as parseDomainTxt, C as underLocalSuffix, D as DOMAIN_MAX_RECORDS, E as DOMAIN_FILE_MAX_BYTES, F as domainWellKnownFile, G as validDomainRecord, H as recordsFromWellKnown, I as encodeDnsQuery, J as encrypt, K as wellKnownUrl, L as isPublicAddress, M as decodeDnsResponse, N as dnsProofName, O as DOMAIN_METHODS, P as domainTxtRecord, R as nip05RootKey, S as readManifest, T as DNS_TYPE, U as recordsName, V as recordsFromTxt, W as txtValue, X as sealedLength, Y as generateEncryptionKey, Z as tryDecrypt, _ as HOLD_LIMITS, a as automaticTransport, b as isHoldUrl, c as irohDescriptor, d as relayUrl, f as relayUrlTooLong, g as HOLD_DATED_BACK_MS, h as HOLD_CAPABILITY, i as TRANSPORTS, j as WELL_KNOWN_PATH, k as DOMAIN_TXT_MAX_BYTES, l as irohRelayUrl, m as transportOrder, n as RELAY_URL, o as checkedDescriptors, p as relayedTransports, q as decrypt, r as RELAY_WITH_SECRETS, s as dialableIrohRelay, t as AUTOMATIC_ORDER, u as rankTransports, v as HoldKeys, w as DNS_LABEL, x as newMailbox, y as HoldRefusedError, z as normalizeDomain } from "./pairedTransports-CQGJfihi.js";
|
|
5
5
|
import { xsalsa20poly1305 } from "@noble/ciphers/salsa.js";
|
|
6
6
|
import { ed25519, x25519 } from "@noble/curves/ed25519.js";
|
|
7
7
|
import { sha256, sha512 } from "@noble/hashes/sha2.js";
|
|
@@ -5514,15 +5514,17 @@ function sanitizeResponseHeaders(headers, target, from) {
|
|
|
5514
5514
|
/**
|
|
5515
5515
|
* The contact's headers a viewer does not pass on: each makes the browser send something to a place it names, outside
|
|
5516
5516
|
* `connect-src` (violation and network-error reports, and the endpoints they go to; `Link` preloads, prefetches and
|
|
5517
|
-
* early connections). With Hide my IP from contacts on, that place would
|
|
5518
|
-
* as the CLI's `OPENED_SERVICE_DROPPED_HEADERS` and Desktop's
|
|
5517
|
+
* early connections; `Speculation-Rules` prefetches and prerenders). With Hide my IP from contacts on, that place would
|
|
5518
|
+
* learn this device's address. The same list as the CLI's `OPENED_SERVICE_DROPPED_HEADERS` and Desktop's
|
|
5519
|
+
* `DROPPED_HEADERS`.
|
|
5519
5520
|
*/
|
|
5520
5521
|
var VIEWER_DROPPED_HEADERS = [
|
|
5521
5522
|
"content-security-policy-report-only",
|
|
5522
5523
|
"reporting-endpoints",
|
|
5523
5524
|
"report-to",
|
|
5524
5525
|
"nel",
|
|
5525
|
-
"link"
|
|
5526
|
+
"link",
|
|
5527
|
+
"speculation-rules"
|
|
5526
5528
|
];
|
|
5527
5529
|
/** The directives of a contact's policy that send reports to a URL it names, dropped from it (`OPENED_SERVICE_DROPPED_DIRECTIVES`). */
|
|
5528
5530
|
var VIEWER_DROPPED_DIRECTIVES = ["report-uri", "report-to"];
|
|
@@ -6161,12 +6163,15 @@ var HttpClient = class {
|
|
|
6161
6163
|
* the same script, so it is the same worker; the page's revoke of the blob's URL drops the guard's own a minute later.
|
|
6162
6164
|
* A `data:` worker, and a blob made in another window, in a worker or already revoked, run as they were. Once per
|
|
6163
6165
|
* window, whichever guard runs first (`ghostlyWorkerGuard`, `CLIPBOARD_GUARD_SCRIPT` does the same).
|
|
6166
|
+
* - takes out each `<script type="speculationrules">` as it is put in the page, a shadow tree the page makes included:
|
|
6167
|
+
* Chromium would prefetch or prerender the pages it lists on a server the contact names, which no policy covers
|
|
6168
|
+
* (`'unsafe-inline'` lets inline rules in); the `Speculation-Rules` header is not passed on (`VIEWER_DROPPED_HEADERS`).
|
|
6164
6169
|
* It uses nothing the page can change after it ran (the page's own code runs later, in the same realm).
|
|
6165
6170
|
*
|
|
6166
6171
|
* What a script put in the page cannot do, so where the viewer does not run it per document this is not a guarantee:
|
|
6167
6172
|
* a frame's window read by its index (`window[0]`, never through the frame element) while the frame's page is still
|
|
6168
|
-
* on its way, and a `srcdoc` frame inside a shadow tree written in the HTML the page itself sends,
|
|
6169
|
-
* guard is there.
|
|
6173
|
+
* on its way, and a `srcdoc` frame or speculation rules inside a shadow tree written in the HTML the page itself sends,
|
|
6174
|
+
* run before the guard is there.
|
|
6170
6175
|
* No backslash, `${` or backtick in it: Desktop's copy (`SERVICE_GUARD`, apps/desktop/src/viewer.rs) is the same text.
|
|
6171
6176
|
*/
|
|
6172
6177
|
var VIEWER_GUARD_SCRIPT = `(function noWebRtc(w) {
|
|
@@ -6261,6 +6266,12 @@ var VIEWER_GUARD_SCRIPT = `(function noWebRtc(w) {
|
|
|
6261
6266
|
if (doc === null || apply(slice, doc, [0, own.length]) === own) return;
|
|
6262
6267
|
try { apply(setAttribute, frame, ["srcdoc", own + doc]); } catch (e) { apply(removeAttribute, frame, ["srcdoc"]); }
|
|
6263
6268
|
};
|
|
6269
|
+
const trim = String.prototype.trim;
|
|
6270
|
+
const drop = w.Element.prototype.remove;
|
|
6271
|
+
const unruled = (script) => {
|
|
6272
|
+
const type = apply(getAttribute, script, ["type"]);
|
|
6273
|
+
if (type !== null && apply(lower, apply(trim, type, []), []) === "speculationrules") apply(drop, script, []);
|
|
6274
|
+
};
|
|
6264
6275
|
const Observer = w.MutationObserver;
|
|
6265
6276
|
const observe = Observer.prototype.observe;
|
|
6266
6277
|
const watch = (root, all) => {
|
|
@@ -6269,6 +6280,10 @@ var VIEWER_GUARD_SCRIPT = `(function noWebRtc(w) {
|
|
|
6269
6280
|
const frames = apply(all, root, ["iframe[srcdoc]"]);
|
|
6270
6281
|
for (let i = apply(size, frames, []); i-- > 0;) first(frames[i]);
|
|
6271
6282
|
} catch (e) {}
|
|
6283
|
+
try {
|
|
6284
|
+
const scripts = apply(all, root, ["script"]);
|
|
6285
|
+
for (let i = apply(size, scripts, []); i-- > 0;) unruled(scripts[i]);
|
|
6286
|
+
} catch (e) {}
|
|
6272
6287
|
sweep();
|
|
6273
6288
|
};
|
|
6274
6289
|
apply(observe, new Observer(scan), [root, { subtree: true, childList: true, attributes: true, attributeFilter: ["srcdoc"] }]);
|
|
@@ -6347,7 +6362,7 @@ var VIEWER_GUARD_SCRIPT = `(function noWebRtc(w) {
|
|
|
6347
6362
|
} catch (e) {}
|
|
6348
6363
|
})(window)`;
|
|
6349
6364
|
/** `VIEWER_GUARD_SCRIPT`'s hash, as a CSP source: a contact's own policy that would refuse it is given it (`allowingViewerGuard`). */
|
|
6350
|
-
var VIEWER_GUARD_HASH = "'sha256-
|
|
6365
|
+
var VIEWER_GUARD_HASH = "'sha256-G1zc09L4CUQu4pukd7RlHvzFZthzzsUsbF0WwoT+KBo='";
|
|
6351
6366
|
/**
|
|
6352
6367
|
* With the guard, where it is put in the page and not run by the viewer in every frame: frames only from the app's own
|
|
6353
6368
|
* origin (a `data:` or `blob:` frame would run before the guard could), and Trusted Types, which hands each
|