@ghostlytools/cli 1.11.0 → 1.11.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.
Files changed (71) hide show
  1. package/dist/assets/{api-B-52sVYp.js → api-D89ubgas.js} +2 -2
  2. package/dist/assets/{api-CTqIcdu7.js → api-DL0Uazf6.js} +23 -19
  3. package/dist/assets/api-DL0Uazf6.js.map +1 -0
  4. package/dist/assets/{apiKit-CZq4Lq4f.js → apiKit-D78MXTrk.js} +2 -2
  5. package/dist/assets/{apiKit-CZq4Lq4f.js.map → apiKit-D78MXTrk.js.map} +1 -1
  6. package/dist/assets/{apps-C_X0zgSG.js → apps--pAqmfgQ.js} +3 -3
  7. package/dist/assets/{apps-C_X0zgSG.js.map → apps--pAqmfgQ.js.map} +1 -1
  8. package/dist/assets/{apps-kRsY9S2S.js → apps-BlSl1nGn.js} +1 -1
  9. package/dist/assets/{arkade-_aaB7VbW.js → arkade-DxB-MR43.js} +2 -2
  10. package/dist/assets/{arkade-_aaB7VbW.js.map → arkade-DxB-MR43.js.map} +1 -1
  11. package/dist/assets/{backup-OTvrmk-w.js → backup-B3JJd75o.js} +6 -6
  12. package/dist/assets/{backup-OTvrmk-w.js.map → backup-B3JJd75o.js.map} +1 -1
  13. package/dist/assets/{backup-DBg388Ke.js → backup-T7gFpU80.js} +1 -1
  14. package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
  15. package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
  16. package/dist/assets/{buttons-DUu7hxxT.js → buttons-C1VbDihe.js} +3 -3
  17. package/dist/assets/{buttons-DUu7hxxT.js.map → buttons-C1VbDihe.js.map} +1 -1
  18. package/dist/assets/buttons-DwWuK_uN.js +2 -0
  19. package/dist/assets/{client-DDpZP1R1.js → client-CGLuWFRV.js} +2 -2
  20. package/dist/assets/{client-DDpZP1R1.js.map → client-CGLuWFRV.js.map} +1 -1
  21. package/dist/assets/{codec-DrryGcPT.js → codec-YGJDr7uH.js} +2 -2
  22. package/dist/assets/{codec-DrryGcPT.js.map → codec-YGJDr7uH.js.map} +1 -1
  23. package/dist/assets/{envelope-Q_rMgoE9.js → envelope-Dwq8EN8x.js} +2 -2
  24. package/dist/assets/{envelope-Q_rMgoE9.js.map → envelope-Dwq8EN8x.js.map} +1 -1
  25. package/dist/assets/{fixedHosts-BV5GDiTU.js → fixedHosts-CINXidpd.js} +3 -3
  26. package/dist/assets/{fixedHosts-BV5GDiTU.js.map → fixedHosts-CINXidpd.js.map} +1 -1
  27. package/dist/assets/{host-BlUzZgQL.js → host-CGlHkiQv.js} +10 -10
  28. package/dist/assets/{host-BlUzZgQL.js.map → host-CGlHkiQv.js.map} +1 -1
  29. package/dist/assets/{hyperdhtRelay-BvI_uNZO.js → hyperdhtRelay-Bj5jJT5w.js} +2 -2
  30. package/dist/assets/{hyperdhtRelay-BvI_uNZO.js.map → hyperdhtRelay-Bj5jJT5w.js.map} +1 -1
  31. package/dist/assets/{irohWeb-CqPN8VPY.js → irohWeb-CYn0uB_A.js} +9 -9
  32. package/dist/assets/irohWeb-CYn0uB_A.js.map +1 -0
  33. package/dist/assets/{main-vQjlgEnt.js → main-CgLW_Gyx.js} +19 -19
  34. package/dist/assets/{main-vQjlgEnt.js.map → main-CgLW_Gyx.js.map} +1 -1
  35. package/dist/assets/{mainline-p6HOW7sb.js → mainline-B0h8RchD.js} +2 -2
  36. package/dist/assets/{mainline-p6HOW7sb.js.map → mainline-B0h8RchD.js.map} +1 -1
  37. package/dist/assets/{networkReason-DMffkiJ6.js → networkReason-BBosp2KG.js} +3 -3
  38. package/dist/assets/{networkReason-DMffkiJ6.js.map → networkReason-BBosp2KG.js.map} +1 -1
  39. package/dist/assets/{nwc-2vH18oNy.js → nwc-SSNS1aJ-.js} +3 -3
  40. package/dist/assets/{nwc-2vH18oNy.js.map → nwc-SSNS1aJ-.js.map} +1 -1
  41. package/dist/assets/{nwcProvider-DpeDy0bV.js → nwcProvider-BXqJmM98.js} +2 -2
  42. package/dist/assets/{nwcProvider-DpeDy0bV.js.map → nwcProvider-BXqJmM98.js.map} +1 -1
  43. package/dist/assets/{ownDid-iKz8u_fM.js → ownDid--DtH_Jdi.js} +2 -2
  44. package/dist/assets/{ownDid-iKz8u_fM.js.map → ownDid--DtH_Jdi.js.map} +1 -1
  45. package/dist/assets/{ownStatus-BlRKnM5F.js → ownStatus-CQPGjCUR.js} +3 -3
  46. package/dist/assets/{ownStatus-BlRKnM5F.js.map → ownStatus-CQPGjCUR.js.map} +1 -1
  47. package/dist/assets/{profiles-B5e0TyvS.js → profiles-4UQ1Hsds.js} +3 -3
  48. package/dist/assets/{profiles-B5e0TyvS.js.map → profiles-4UQ1Hsds.js.map} +1 -1
  49. package/dist/assets/{registry-Cc_PQb3k.js → registry-B6BXKv6Q.js} +1 -1
  50. package/dist/assets/{registry-CnFO2Pp5.js → registry-BKCFTEYp.js} +5 -5
  51. package/dist/assets/{registry-CnFO2Pp5.js.map → registry-BKCFTEYp.js.map} +1 -1
  52. package/dist/assets/{resolve-DI8uAM_Y.js → resolve-MFeFljsN.js} +2 -2
  53. package/dist/assets/{resolve-DI8uAM_Y.js.map → resolve-MFeFljsN.js.map} +1 -1
  54. package/dist/assets/{server-DdtPxkqI.js → server-rHKhnog1.js} +55 -42
  55. package/dist/assets/server-rHKhnog1.js.map +1 -0
  56. package/dist/assets/{src-BnpEQqzk.js → src-BzsyAvPf.js} +795 -165
  57. package/dist/assets/src-BzsyAvPf.js.map +1 -0
  58. package/dist/assets/{sshForges-cdIAraDw.js → sshForges-qITn-RoV.js} +2 -2
  59. package/dist/assets/{sshForges-cdIAraDw.js.map → sshForges-qITn-RoV.js.map} +1 -1
  60. package/dist/assets/{translate-kNopA04L.js → translate-Bkr_iDgp.js} +9 -7
  61. package/dist/assets/translate-Bkr_iDgp.js.map +1 -0
  62. package/dist/assets/{usdt-CDaLhEYh.js → usdt-Bp7T2iqt.js} +3 -3
  63. package/dist/assets/{usdt-CDaLhEYh.js.map → usdt-Bp7T2iqt.js.map} +1 -1
  64. package/dist/ghostly.mjs +1 -1
  65. package/package.json +1 -1
  66. package/dist/assets/api-CTqIcdu7.js.map +0 -1
  67. package/dist/assets/buttons-4EKtQl-7.js +0 -2
  68. package/dist/assets/irohWeb-CqPN8VPY.js.map +0 -1
  69. package/dist/assets/server-DdtPxkqI.js.map +0 -1
  70. package/dist/assets/src-BnpEQqzk.js.map +0 -1
  71. package/dist/assets/translate-kNopA04L.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Ca as recordsFromTxt, Da as wellKnownUrl, Ea as txtValue, Pu as DEFAULT_RELAYS, Sa as normalizeDomain, Ta as recordsName, _t as isAtprotoDid, ba as isPublicAddress, ga as dnsProofName, ha as decodeDnsResponse, hd as toBase64Url, ma as DOMAIN_FILE_MAX_BYTES, pt as atprotoDidMethod, wa as recordsFromWellKnown, xa as nip05RootKey, ya as encodeDnsQuery, yt as parseAtprotoDidDocument, zi as IdentityCheckUnavailable } from "./src-BnpEQqzk.js";
1
+ import { Aa as wellKnownUrl, Ca as isPublicAddress, Da as recordsFromWellKnown, Ea as recordsFromTxt, Hi as IdentityCheckUnavailable, Lu as DEFAULT_RELAYS, Oa as recordsName, Sa as encodeDnsQuery, Ta as normalizeDomain, _a as DOMAIN_FILE_MAX_BYTES, _t as isAtprotoDid, ka as txtValue, pt as atprotoDidMethod, va as decodeDnsResponse, vd as toBase64Url, wa as nip05RootKey, ya as dnsProofName, yt as parseAtprotoDidDocument } from "./src-BzsyAvPf.js";
2
2
  //#region ../browser/src/proofs/pkarrRelays.ts
3
3
  /**
4
4
  * The profile's Pkarr relays (Network settings), which a did:dht proof is read from, as every other Pkarr read: a
@@ -396,4 +396,4 @@ async function verifiedAtprotoHandle(doc, options) {
396
396
  //#endregion
397
397
  export { verifiedAtprotoHandle as a, assertDomainRecord as c, chosenResolver as d, resolverById as f, resolveAtprotoHandle as i, assertNip05 as l, setPkarrRelaySource as m, plcDirectory as n, DOH_RESOLVERS as o, pkarrRelays as p, resolveAtprotoDid as r, DomainCheckError as s, assertPublicServer as t, assertPublicHost as u };
398
398
 
399
- //# sourceMappingURL=resolve-DI8uAM_Y.js.map
399
+ //# sourceMappingURL=resolve-MFeFljsN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-DI8uAM_Y.js","names":[],"sources":["../../../browser/src/proofs/pkarrRelays.ts","../../../browser/src/proofs/domain.ts","../../../browser/src/proofs/atproto/resolve.ts"],"sourcesContent":["import { DEFAULT_RELAYS } from \"@ghostly/core\";\n\n/**\n * The profile's Pkarr relays (Network settings), which a did:dht proof is read from, as every other Pkarr read: a\n * person who replaced the list is never read from the defaults. The UI and the engine each set where to read it. Here,\n * not in the provider, so setting it does not load the providers.\n */\nlet source: () => readonly string[] | undefined = () => undefined;\nexport function setPkarrRelaySource(read: () => readonly string[] | undefined): void { source = read; }\nexport function pkarrRelays(): string[] {\n const relays = source();\n return relays?.length ? [...relays] : [...DEFAULT_RELAYS];\n}\n","import {\n DOMAIN_FILE_MAX_BYTES, decodeDnsResponse, dnsProofName, encodeDnsQuery, IdentityCheckUnavailable, isPublicAddress, nip05RootKey, normalizeDomain,\n recordsFromTxt, recordsFromWellKnown, recordsName, toBase64Url, txtValue, wellKnownUrl,\n type DnsResponse, type DnsType, type DomainMethod, type DomainRecord,\n} from '@ghostly/core';\nimport type { IdentityFetch } from './contract';\n\n/**\n * Network side of domain proofs: DNS TXT through DNS over HTTPS and the\n * `/.well-known/` files, under strict limits. Nothing here trusts the prover:\n * the domain comes from the signed binding, the URLs are built here, every\n * answer is bounded and parsed strictly, and lookups are cached only briefly.\n *\n * What a check reveals, and to whom:\n * - DNS: the chosen resolver learns that this device looked up `_ghostly.<domain>`\n * (the next one in DOH_RESOLVERS too, when the chosen one gives no answer).\n * The domain's own servers see only the resolver.\n * - HTTPS / NIP-05: the resolver learns the domain (its addresses are looked up\n * first, to refuse private networks), and the domain's web server — run by\n * the person being checked — sees this device's IP address and when.\n */\n\nexport type DohResolverId = 'quad9' | 'cloudflare' | 'google';\nexport interface DohResolver { id: DohResolverId; name: string; url: string }\n/** Public resolvers that answer RFC 8484 wire-format GETs with CORS (checked 2026-09-23). */\nexport const DOH_RESOLVERS: readonly DohResolver[] = [\n { id: 'quad9', name: 'Quad9', url: 'https://dns.quad9.net/dns-query' },\n { id: 'cloudflare', name: 'Cloudflare', url: 'https://cloudflare-dns.com/dns-query' },\n { id: 'google', name: 'Google', url: 'https://dns.google/dns-query' },\n];\nexport const DEFAULT_RESOLVER: DohResolverId = 'quad9';\nexport const resolverById = (id: string | null | undefined): DohResolver =>\n DOH_RESOLVERS.find(r => r.id === id) ?? DOH_RESOLVERS.find(r => r.id === DEFAULT_RESOLVER)!;\n\n/** The person's resolver choice, per browser profile (UI and engine share the origin). */\nexport const RESOLVER_SETTING = 'ghostly-doh-resolver';\nexport function chosenResolver(): DohResolver {\n try { return resolverById(globalThis.localStorage?.getItem(RESOLVER_SETTING)); } catch { return resolverById(undefined); }\n}\nexport function chooseResolver(id: DohResolverId): void {\n try { globalThis.localStorage?.setItem(RESOLVER_SETTING, resolverById(id).id); } catch { /* not persisted: the default stays */ }\n}\n\nexport const DNS_MAX_BYTES = 16 * 1024;\n/**\n * Lookups are shared between checks for the DNS TTL, capped: never staler than the resolver itself would\n * be, so a re-check sees a removal as soon as DNS does. Files have no TTL and are only shared in flight.\n */\nconst CACHE_MAX_MS = 30_000, CACHE_FILE_MS = 0;\n\n/** The contract's `ctx.fetch`: HTTPS GET, no credentials, bounded, redirects refused unless asked, with raw bytes. */\nexport type DomainFetch = IdentityFetch;\n\nexport interface DomainLookupOptions {\n fetch: DomainFetch;\n resolver?: DohResolverId;\n signal?: AbortSignal;\n /** Milliseconds. */\n now?: () => number;\n}\n\n/** A check that did not confirm the record, with a message for people. */\nexport class DomainCheckError extends Error {}\n\n/** A resolver that gave no DNS answer at all: not reached, or it refused the request. The next one may answer. */\nclass ResolverUnavailable extends IdentityCheckUnavailable {}\n\n/*\n * What this side's resolver, or the network between it and a host, did (no answer, an error, an HTTP status other\n * than the file or its absence) is IdentityCheckUnavailable: the contact is told only that the check could not be\n * finished, never the host, port or status seen here.\n */\n\n/** One RFC 8484 GET to one resolver. The query has ID 0 and no client subnet, so it carries only the name. */\nasync function askResolver(resolver: DohResolver, name: string, type: DnsType, options: DomainLookupOptions): Promise<DnsResponse> {\n let response: Awaited<ReturnType<DomainFetch>>;\n try {\n response = await options.fetch(`${resolver.url}?dns=${toBase64Url(encodeDnsQuery(name, type))}`, {\n headers: { accept: 'application/dns-message' }, maxBytes: DNS_MAX_BYTES, signal: options.signal, redirect: 'error' });\n } catch (e) {\n throw /too large/i.test(String(e))\n ? new IdentityCheckUnavailable(`${resolver.name} sent an answer that is too large`)\n : new ResolverUnavailable(`${resolver.name} could not be reached`);\n }\n if (response.status !== 200 || !/^application\\/dns-message\\b/i.test(response.contentType))\n throw new ResolverUnavailable(`${resolver.name} refused the lookup`);\n let answer: DnsResponse;\n try { answer = decodeDnsResponse(response.bytes, name, type); } catch { throw new IdentityCheckUnavailable(`${resolver.name} sent an unusable answer`); }\n if (answer.rcode !== 0 && answer.rcode !== 3) throw new IdentityCheckUnavailable(`${resolver.name} could not resolve ${name}`);\n return answer;\n}\n\n/**\n * A lookup through the chosen resolver, and through the others in turn (in list order) only when it gives no DNS\n * answer at all. Quad9, for one, cannot be read from WebKit (the Mac desktop app, Safari): its HTTP/3 answers carry\n * no CORS header. An answer, even \"no such name\" or a failure, is never asked again elsewhere. `resolver`: who answered.\n */\nexport async function dohQuery(name: string, type: DnsType, options: DomainLookupOptions): Promise<DnsResponse & { resolver: DohResolverId }> {\n const chosen = resolverById(options.resolver);\n let first: IdentityCheckUnavailable | undefined;\n for (const resolver of [chosen, ...DOH_RESOLVERS.filter(r => r !== chosen)]) {\n try { return { ...await askResolver(resolver, name, type, options), resolver: resolver.id }; }\n catch (e) {\n if (!(e instanceof ResolverUnavailable) || options.signal?.aborted) throw e;\n first ??= e;\n }\n }\n throw first!;\n}\n\n/**\n * Refuses a domain whose addresses are not all public before its web server is\n * contacted, so a proof cannot make a contact's app probe their own network.\n * The browser resolves again when it fetches; a name that changes its answer in\n * between (rebinding) is not fully excluded by this check — see the draft.\n * No address at all (the name does not exist, or has no A or AAAA record) is the resolver's answer about the\n * domain, not something this side's network did: a DomainCheckError, so a re-check stops confirming the proof.\n */\nexport async function assertPublicHost(domain: string, options: DomainLookupOptions): Promise<void> {\n const [v4, v6] = await Promise.all([dohQuery(domain, 'A', options), dohQuery(domain, 'AAAA', options)]);\n const addresses = [...v4.answers, ...v6.answers].map(a => a.data);\n if (!addresses.length) throw new DomainCheckError(`${domain} has no address`);\n if (!addresses.every(isPublicAddress)) throw new IdentityCheckUnavailable(`${domain} points to a private network address, so it was not contacted`);\n}\n\n/** A well-known file: https only, no redirects, bounded. `undefined` when the server says it is not there. */\nexport async function fetchWellKnown(domain: string, method: 'https' | 'nip05', options: DomainLookupOptions): Promise<string | undefined> {\n await assertPublicHost(domain, options);\n const url = wellKnownUrl(domain, method);\n let response: Awaited<ReturnType<DomainFetch>>;\n try {\n response = await options.fetch(url, { headers: { accept: 'application/json' }, maxBytes: DOMAIN_FILE_MAX_BYTES, signal: options.signal, redirect: 'error' });\n } catch (e) {\n if (/too large/i.test(String(e))) throw new DomainCheckError(`${url} is too large`);\n throw new IdentityCheckUnavailable(`${domain} could not be reached. The file must be served at exactly this address, without a redirect, with the header Access-Control-Allow-Origin: *`);\n }\n if (response.status === 404 || response.status === 410) return;\n if (response.status >= 300 && response.status < 400) throw new IdentityCheckUnavailable(`${domain} answered with a redirect; the file must be served at exactly ${url}`);\n if (response.status !== 200) throw new IdentityCheckUnavailable(`${domain} answered ${response.status}`);\n try { return new TextDecoder('utf-8', { fatal: true }).decode(response.bytes); } catch { throw new DomainCheckError(`${url} is not text`); }\n}\n\nexport interface DomainLookup {\n domain: string;\n method: DomainMethod;\n /** DNS / HTTPS: the Ghostly records found. */\n records: DomainRecord[];\n /** NIP-05: the Nostr key named for the domain itself. */\n nostrKey?: string;\n /** A record or file exists at all (as opposed to nothing there). */\n found: boolean;\n /** The resolver reported DNSSEC validation of the TXT answer. */\n dnssec: boolean;\n resolver: DohResolverId;\n}\n\nasync function lookup(domain: string, method: DomainMethod, options: DomainLookupOptions): Promise<DomainLookup & { ttlMs: number }> {\n const resolver = resolverById(options.resolver).id;\n if (method === 'dns') {\n const answer = await dohQuery(dnsProofName(domain), 'TXT', options);\n const values: string[] = [];\n for (const record of answer.answers.slice(0, 32)) { try { values.push(txtValue(record.data)); } catch { /* not text: not ours */ } }\n const ttlMs = answer.answers.length ? Math.min(...answer.answers.map(a => a.ttl)) * 1000 : 0;\n return { domain, method, resolver: answer.resolver, records: recordsFromTxt(values), found: answer.answers.length > 0, dnssec: answer.authenticated, ttlMs };\n }\n const text = await fetchWellKnown(domain, method, options);\n const base = { domain, method, resolver, dnssec: false, records: [] as DomainRecord[], ttlMs: CACHE_FILE_MS };\n if (text === undefined) return { ...base, found: false };\n try {\n return method === 'nip05' ? { ...base, found: true, nostrKey: nip05RootKey(text) } : { ...base, found: true, records: recordsFromWellKnown(text) };\n } catch { throw new DomainCheckError(`${wellKnownUrl(domain, method)} is not a valid ${method === 'nip05' ? 'NIP-05' : 'Ghostly'} file`); }\n}\n\nconst cache = new Map<string, { until: number; result: Promise<DomainLookup & { ttlMs: number }> }>();\n/** Tests only. */\nexport function clearDomainCache(): void { cache.clear(); }\n\n/** What a domain publishes by one method. Concurrent and back-to-back checks share one lookup. */\nexport async function lookupDomain(domainInput: string, method: DomainMethod, options: DomainLookupOptions): Promise<DomainLookup> {\n const domain = normalizeDomain(domainInput), now = options.now ?? Date.now, resolver = resolverById(options.resolver).id;\n const id = `${resolver}|${method}|${domain}`;\n const hit = cache.get(id);\n if (hit && hit.until > now()) { const { ttlMs: _ttl, ...result } = await hit.result; return result; }\n const started = now();\n const entry = { until: started + CACHE_MAX_MS, result: lookup(domain, method, { ...options, resolver }) };\n cache.set(id, entry);\n if (cache.size > 128) cache.delete(cache.keys().next().value!);\n try {\n const { ttlMs, ...result } = await entry.result;\n entry.until = started + Math.min(CACHE_MAX_MS, ttlMs);\n return result;\n } catch (e) {\n if (cache.get(id) === entry) cache.delete(id);\n throw e;\n }\n}\n\n/** Throws unless `domain` publishes `record` by `method` (DNS or HTTPS). Returns what was found. */\nexport async function assertDomainRecord(domain: string, method: 'dns' | 'https', record: DomainRecord, options: DomainLookupOptions): Promise<DomainLookup> {\n const found = await lookupDomain(domain, method, options);\n if (recordsName(found.records, record)) return found;\n const where = method === 'dns' ? `The TXT record at ${dnsProofName(domain)}` : wellKnownUrl(domain);\n if (found.records.some(r => r.key === record.key)) throw new DomainCheckError(`${where} is for another proof of this key`);\n if (found.records.length) throw new DomainCheckError(`${where} names another Ghostly key: this proof was replaced or removed`);\n throw new DomainCheckError(method === 'dns'\n ? `No Ghostly TXT record at ${dnsProofName(domain)}${found.found ? '' : ' (DNS changes can take a few minutes)'}`\n : found.found ? `${wellKnownUrl(domain)} names no Ghostly proof` : `${wellKnownUrl(domain)} was not found`);\n}\n\n/** Throws unless the domain's NIP-05 root name is `nostrKey`. */\nexport async function assertNip05(domain: string, nostrKey: string, options: DomainLookupOptions): Promise<DomainLookup> {\n const found = await lookupDomain(domain, 'nip05', options);\n if (found.nostrKey === nostrKey) return found;\n const url = wellKnownUrl(domain, 'nip05');\n throw new DomainCheckError(!found.found ? `${url} was not found` : found.nostrKey\n ? `${url} names another Nostr key for ${domain}` : `${url} has no root name \"_\" for ${domain}`);\n}\n","import { atprotoDidMethod, IdentityCheckUnavailable, isAtprotoDid, parseAtprotoDidDocument, txtValue, type AtprotoDidDocument } from \"@ghostly/core\";\nimport type { IdentityFetch } from \"../contract\";\nimport { assertPublicHost, dohQuery, DomainCheckError, type DohResolverId } from \"../domain\";\n\n/**\n * AT Protocol identity resolution, the network half: a DID to its document (the PLC directory for\n * did:plc, the host's `/.well-known/did.json` for did:web), and a handle to a DID (DNS TXT\n * `_atproto.<handle>` through the person's DNS-over-HTTPS resolver, then\n * `https://<handle>/.well-known/atproto-did`). Every request goes through the contract's bounded\n * fetch: HTTPS only, no redirects, a size cap, a time-out. URLs are built here from the DID or the\n * handle, never taken from a proof.\n */\n\nexport const PLC_DIRECTORY = \"https://plc.directory\";\nconst TEST_HOST = /^https:\\/\\/[a-z0-9-]+(\\.[a-z0-9-]+)*\\.test$/;\n/** DID documents are small; a large answer is not one. */\nexport const DID_DOCUMENT_MAX_BYTES = 32 * 1024;\nconst HANDLE_DID_MAX_BYTES = 2048;\n\n/**\n * The PLC directory. A build made for the e2e suite with VITE_ATPROTO_TEST_PLC may point it at a\n * `.test` host (a name reserved for testing); a release build always uses plc.directory.\n */\nexport function plcDirectory(): string {\n try {\n const value = import.meta.env?.VITE_ATPROTO_TEST_PLC as string | undefined;\n return value && TEST_HOST.test(value) ? value : PLC_DIRECTORY;\n } catch { return PLC_DIRECTORY; }\n}\n\nexport interface AtprotoResolveOptions {\n fetch: IdentityFetch;\n signal?: AbortSignal;\n /** The DoH resolver for handles (the person's choice, as for domains). */\n resolver?: DohResolverId;\n /** The PLC directory; plcDirectory() by default. */\n plc?: string;\n}\n\n/** Where a DID's document lives. */\nexport function didDocumentUrl(did: string, plc = plcDirectory()): string {\n const method = atprotoDidMethod(did);\n if (method === \"plc\") return `${plc}/${did}`;\n if (method === \"web\") return `https://${did.slice(\"did:web:\".length)}/.well-known/did.json`;\n throw new Error(\"Not an AT Protocol DID\");\n}\n\n/**\n * Refuses a host the account chose (a did:web host, the PDS its document names) that points to a private\n * network address: a contact's app never knocks on its own local network for someone else's proof.\n * A host with no address is \"could not run\" too, except for a did:web host (`isDid`): that domain is the\n * identity, so the resolver's answer that it has none says the DID no longer resolves (as for did:web proofs).\n * A PDS name that is gone is its operator's, like a Pubky homeserver's: the check could not run.\n */\nexport async function assertPublicServer(host: string, options: AtprotoResolveOptions, isDid = false): Promise<void> {\n try { await assertPublicHost(host, { fetch: options.fetch, signal: options.signal, resolver: options.resolver }); }\n catch (e) {\n // eslint-disable-next-line preserve-caught-error -- A message people can act on; the library's error stays out of the UI (ES2020 has no Error.cause).\n if (isDid && e instanceof DomainCheckError) throw new Error(`The account's DID no longer resolves: ${e.message}`);\n throw new IdentityCheckUnavailable(`The account's server ${host} was not contacted: ${e instanceof Error ? e.message : String(e)}`);\n }\n}\n\n/** A DID's document, checked (parseAtprotoDidDocument). Throws a message people can read. */\nexport async function resolveAtprotoDid(did: string, options: AtprotoResolveOptions): Promise<AtprotoDidDocument> {\n const url = didDocumentUrl(did, options.plc);\n if (atprotoDidMethod(did) === \"web\") await assertPublicServer(did.slice(\"did:web:\".length), options, true);\n let response: Awaited<ReturnType<IdentityFetch>>;\n try {\n response = await options.fetch(url, { headers: { accept: \"application/did+ld+json, application/json\" }, maxBytes: DID_DOCUMENT_MAX_BYTES, signal: options.signal, redirect: \"error\" });\n } catch (e) {\n // eslint-disable-next-line preserve-caught-error -- A message people can act on; the library's error stays out of the UI (ES2020 has no Error.cause).\n if (/too large/i.test(String(e))) throw new Error(\"The account's DID document is too large\");\n throw new IdentityCheckUnavailable(\"The account's DID could not be resolved\");\n }\n if (response.status === 404 || response.status === 410) throw new Error(\"The account's DID is not registered, or was deactivated\");\n if (response.status !== 200) throw new IdentityCheckUnavailable(\"The account's DID could not be resolved\");\n let doc: unknown;\n try { doc = JSON.parse(response.text); } catch { throw new Error(\"The account's DID document is malformed\"); }\n return parseAtprotoDidDocument(doc, did);\n}\n\n/**\n * The DID a handle points to, or null when it points nowhere (or to two different DIDs). DNS first,\n * then HTTPS, as the handle spec says. The HTTPS lookup first checks the handle's addresses are public,\n * so a handle cannot make a contact's app knock on its local network.\n */\nexport async function resolveAtprotoHandle(handle: string, options: AtprotoResolveOptions): Promise<string | null> {\n return (await lookupAtprotoHandle(handle, options)).did;\n}\n\n/**\n * resolveAtprotoHandle, and whether the answer is one: `checked` is false when a lookup failed on the way (the\n * resolver or the handle's website could not be reached) so the handle may point somewhere after all. A cancel\n * throws.\n */\nasync function lookupAtprotoHandle(handle: string, options: AtprotoResolveOptions): Promise<{ did: string | null; checked: boolean }> {\n options.signal?.throwIfAborted();\n const lookup = { fetch: options.fetch, signal: options.signal, resolver: options.resolver };\n let dnsAnswered = false;\n try {\n const answer = await dohQuery(`_atproto.${handle}`, \"TXT\", lookup);\n dnsAnswered = true;\n const dids = new Set<string>();\n for (const a of answer.answers) {\n if (a.type !== 16) continue;\n let text: string;\n try { text = txtValue(a.data); } catch { continue; }\n if (text.startsWith(\"did=\")) dids.add(text.slice(4));\n }\n if (dids.size > 1) return { did: null, checked: true };\n const [did] = dids;\n if (did) return { did: isAtprotoDid(did) ? did : null, checked: true };\n } catch { options.signal?.throwIfAborted(); /* The resolver failed: try HTTPS. */ }\n // A handle with no public address points nowhere, if the resolver answered (a name it could not resolve may).\n try { await assertPublicHost(handle, lookup); }\n catch { options.signal?.throwIfAborted(); return { did: null, checked: dnsAnswered }; }\n let response: Awaited<ReturnType<IdentityFetch>>;\n try { response = await options.fetch(`https://${handle}/.well-known/atproto-did`, { headers: { accept: \"text/plain\" }, maxBytes: HANDLE_DID_MAX_BYTES, signal: options.signal, redirect: \"error\" }); }\n catch { options.signal?.throwIfAborted(); return { did: null, checked: false }; }\n const did = response.status === 200 ? response.text.trim() : \"\";\n // A DNS record the resolver could not read may still name the DID.\n return isAtprotoDid(did) ? { did, checked: true } : { did: null, checked: dnsAnswered };\n}\n\n/** Why a DID's handle is not shown: its document names none, the handle points elsewhere (or nowhere), or the lookup failed. */\nexport type AtprotoHandleCheck = { handle: string; missing?: undefined } | { handle?: undefined; missing: \"none\" | \"elsewhere\" | \"unchecked\" };\n\n/**\n * The handle to show for a DID: the one its document claims, and only if that handle resolves back to\n * the same DID. Otherwise the reason: the card shows the DID. Throws only when cancelled.\n */\nexport async function verifiedAtprotoHandle(doc: AtprotoDidDocument, options: AtprotoResolveOptions): Promise<AtprotoHandleCheck> {\n if (!doc.handle) return { missing: \"none\" };\n const found = await lookupAtprotoHandle(doc.handle, options);\n if (found.did === doc.did) return { handle: doc.handle };\n return { missing: found.did || found.checked ? \"elsewhere\" : \"unchecked\" };\n}\n"],"mappings":";;;;;;;AAOA,IAAI,eAAoD,KAAA;AACxD,SAAgB,oBAAoB,MAAiD;CAAE,SAAS;AAAM;AACtG,SAAgB,cAAwB;CACtC,MAAM,SAAS,OAAO;CACtB,OAAO,QAAQ,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,cAAc;AAC1D;;;;ACaA,IAAa,gBAAwC;CACnD;EAAE,IAAI;EAAS,MAAM;EAAS,KAAK;CAAkC;CACrE;EAAE,IAAI;EAAc,MAAM;EAAc,KAAK;CAAuC;CACpF;EAAE,IAAI;EAAU,MAAM;EAAU,KAAK;CAA+B;AACtE;AAEA,IAAa,gBAAgB,OAC3B,cAAc,MAAK,MAAK,EAAE,OAAO,EAAE,KAAK,cAAc,MAAK,MAAK,EAAE,OAAA,OAAuB;;AAG3F,IAAa,mBAAmB;AAChC,SAAgB,iBAA8B;CAC5C,IAAI;EAAE,OAAO,aAAa,WAAW,cAAc,QAAQ,gBAAgB,CAAC;CAAG,QAAQ;EAAE,OAAO,aAAa,KAAA,CAAS;CAAG;AAC3H;AAKA,IAAa,gBAAgB;;;;;AAK7B,IAAM,eAAe;AAAQ,IAAA,gBAAgB;;AAc7C,IAAa,mBAAb,cAAsC,MAAM,CAAC;;AAG7C,IAAM,sBAAN,cAAkC,yBAAyB,CAAC;;AAS5D,eAAe,YAAY,UAAuB,MAAc,MAAe,SAAoD;CACjI,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,QAAQ,MAAM,GAAG,SAAS,IAAI,OAAO,YAAY,eAAe,MAAM,IAAI,CAAC,KAAK;GAC/F,SAAS,EAAE,QAAQ,0BAA0B;GAAG,UAAU;GAAe,QAAQ,QAAQ;GAAQ,UAAU;EAAQ,CAAC;CACxH,SAAS,GAAG;EACV,MAAM,aAAa,KAAK,OAAO,CAAC,CAAC,IAC7B,IAAI,yBAAyB,G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Q,MAAM,WAAW,OAAO,2BAA2B;GAAE,SAAS,EAAE,QAAQ,aAAa;GAAG,UAAU;GAAsB,QAAQ,QAAQ;GAAQ,UAAU;EAAQ,CAAC;CAAG,QAC/L;EAAE,QAAQ,QAAQ,eAAe;EAAG,OAAO;GAAE,KAAK;GAAM,SAAS;EAAM;CAAG;CAChF,MAAM,MAAM,SAAS,WAAW,MAAM,SAAS,KAAK,KAAK,IAAI;CAE7D,OAAO,aAAa,GAAG,IAAI;EAAE;EAAK,SAAS;CAAK,IAAI;EAAE,KAAK;EAAM,SAAS;CAAY;AACxF;;;;;AASA,eAAsB,sBAAsB,KAAyB,SAA6D;CAChI,IAAI,CAAC,IAAI,QAAQ,OAAO,EAAE,SAAS,OAAO;CAC1C,MAAM,QAAQ,MAAM,oBAAoB,IAAI,QAAQ,OAAO;CAC3D,IAAI,MAAM,QAAQ,IAAI,KAAK,OAAO,EAAE,QAAQ,IAAI,OAAO;CACvD,OAAO,EAAE,SAAS,MAAM,OAAO,MAAM,UAAU,cAAc,YAAY;AAC3E"}
1
+ {"version":3,"file":"resolve-MFeFljsN.js","names":[],"sources":["../../../browser/src/proofs/pkarrRelays.ts","../../../browser/src/proofs/domain.ts","../../../browser/src/proofs/atproto/resolve.ts"],"sourcesContent":["import { DEFAULT_RELAYS } from \"@ghostly/core\";\n\n/**\n * The profile's Pkarr relays (Network settings), which a did:dht proof is read from, as every other Pkarr read: a\n * person who replaced the list is never read from the defaults. The UI and the engine each set where to read it. Here,\n * not in the provider, so setting it does not load the providers.\n */\nlet source: () => readonly string[] | undefined = () => undefined;\nexport function setPkarrRelaySource(read: () => readonly string[] | undefined): void { source = read; }\nexport function pkarrRelays(): string[] {\n const relays = source();\n return relays?.length ? [...relays] : [...DEFAULT_RELAYS];\n}\n","import {\n DOMAIN_FILE_MAX_BYTES, decodeDnsResponse, dnsProofName, encodeDnsQuery, IdentityCheckUnavailable, isPublicAddress, nip05RootKey, normalizeDomain,\n recordsFromTxt, recordsFromWellKnown, recordsName, toBase64Url, txtValue, wellKnownUrl,\n type DnsResponse, type DnsType, type DomainMethod, type DomainRecord,\n} from '@ghostly/core';\nimport type { IdentityFetch } from './contract';\n\n/**\n * Network side of domain proofs: DNS TXT through DNS over HTTPS and the\n * `/.well-known/` files, under strict limits. Nothing here trusts the prover:\n * the domain comes from the signed binding, the URLs are built here, every\n * answer is bounded and parsed strictly, and lookups are cached only briefly.\n *\n * What a check reveals, and to whom:\n * - DNS: the chosen resolver learns that this device looked up `_ghostly.<domain>`\n * (the next one in DOH_RESOLVERS too, when the chosen one gives no answer).\n * The domain's own servers see only the resolver.\n * - HTTPS / NIP-05: the resolver learns the domain (its addresses are looked up\n * first, to refuse private networks), and the domain's web server — run by\n * the person being checked — sees this device's IP address and when.\n */\n\nexport type DohResolverId = 'quad9' | 'cloudflare' | 'google';\nexport interface DohResolver { id: DohResolverId; name: string; url: string }\n/** Public resolvers that answer RFC 8484 wire-format GETs with CORS (checked 2026-09-23). */\nexport const DOH_RESOLVERS: readonly DohResolver[] = [\n { id: 'quad9', name: 'Quad9', url: 'https://dns.quad9.net/dns-query' },\n { id: 'cloudflare', name: 'Cloudflare', url: 'https://cloudflare-dns.com/dns-query' },\n { id: 'google', name: 'Google', url: 'https://dns.google/dns-query' },\n];\nexport const DEFAULT_RESOLVER: DohResolverId = 'quad9';\nexport const resolverById = (id: string | null | undefined): DohResolver =>\n DOH_RESOLVERS.find(r => r.id === id) ?? DOH_RESOLVERS.find(r => r.id === DEFAULT_RESOLVER)!;\n\n/** The person's resolver choice, per browser profile (UI and engine share the origin). */\nexport const RESOLVER_SETTING = 'ghostly-doh-resolver';\nexport function chosenResolver(): DohResolver {\n try { return resolverById(globalThis.localStorage?.getItem(RESOLVER_SETTING)); } catch { return resolverById(undefined); }\n}\nexport function chooseResolver(id: DohResolverId): void {\n try { globalThis.localStorage?.setItem(RESOLVER_SETTING, resolverById(id).id); } catch { /* not persisted: the default stays */ }\n}\n\nexport const DNS_MAX_BYTES = 16 * 1024;\n/**\n * Lookups are shared between checks for the DNS TTL, capped: never staler than the resolver itself would\n * be, so a re-check sees a removal as soon as DNS does. Files have no TTL and are only shared in flight.\n */\nconst CACHE_MAX_MS = 30_000, CACHE_FILE_MS = 0;\n\n/** The contract's `ctx.fetch`: HTTPS GET, no credentials, bounded, redirects refused unless asked, with raw bytes. */\nexport type DomainFetch = IdentityFetch;\n\nexport interface DomainLookupOptions {\n fetch: DomainFetch;\n resolver?: DohResolverId;\n signal?: AbortSignal;\n /** Milliseconds. */\n now?: () => number;\n}\n\n/** A check that did not confirm the record, with a message for people. */\nexport class DomainCheckError extends Error {}\n\n/** A resolver that gave no DNS answer at all: not reached, or it refused the request. The next one may answer. */\nclass ResolverUnavailable extends IdentityCheckUnavailable {}\n\n/*\n * What this side's resolver, or the network between it and a host, did (no answer, an error, an HTTP status other\n * than the file or its absence) is IdentityCheckUnavailable: the contact is told only that the check could not be\n * finished, never the host, port or status seen here.\n */\n\n/** One RFC 8484 GET to one resolver. The query has ID 0 and no client subnet, so it carries only the name. */\nasync function askResolver(resolver: DohResolver, name: string, type: DnsType, options: DomainLookupOptions): Promise<DnsResponse> {\n let response: Awaited<ReturnType<DomainFetch>>;\n try {\n response = await options.fetch(`${resolver.url}?dns=${toBase64Url(encodeDnsQuery(name, type))}`, {\n headers: { accept: 'application/dns-message' }, maxBytes: DNS_MAX_BYTES, signal: options.signal, redirect: 'error' });\n } catch (e) {\n throw /too large/i.test(String(e))\n ? new IdentityCheckUnavailable(`${resolver.name} sent an answer that is too large`)\n : new ResolverUnavailable(`${resolver.name} could not be reached`);\n }\n if (response.status !== 200 || !/^application\\/dns-message\\b/i.test(response.contentType))\n throw new ResolverUnavailable(`${resolver.name} refused the lookup`);\n let answer: DnsResponse;\n try { answer = decodeDnsResponse(response.bytes, name, type); } catch { throw new IdentityCheckUnavailable(`${resolver.name} sent an unusable answer`); }\n if (answer.rcode !== 0 && answer.rcode !== 3) throw new IdentityCheckUnavailable(`${resolver.name} could not resolve ${name}`);\n return answer;\n}\n\n/**\n * A lookup through the chosen resolver, and through the others in turn (in list order) only when it gives no DNS\n * answer at all. Quad9, for one, cannot be read from WebKit (the Mac desktop app, Safari): its HTTP/3 answers carry\n * no CORS header. An answer, even \"no such name\" or a failure, is never asked again elsewhere. `resolver`: who answered.\n */\nexport async function dohQuery(name: string, type: DnsType, options: DomainLookupOptions): Promise<DnsResponse & { resolver: DohResolverId }> {\n const chosen = resolverById(options.resolver);\n let first: IdentityCheckUnavailable | undefined;\n for (const resolver of [chosen, ...DOH_RESOLVERS.filter(r => r !== chosen)]) {\n try { return { ...await askResolver(resolver, name, type, options), resolver: resolver.id }; }\n catch (e) {\n if (!(e instanceof ResolverUnavailable) || options.signal?.aborted) throw e;\n first ??= e;\n }\n }\n throw first!;\n}\n\n/**\n * Refuses a domain whose addresses are not all public before its web server is\n * contacted, so a proof cannot make a contact's app probe their own network.\n * The browser resolves again when it fetches; a name that changes its answer in\n * between (rebinding) is not fully excluded by this check — see the draft.\n * No address at all (the name does not exist, or has no A or AAAA record) is the resolver's answer about the\n * domain, not something this side's network did: a DomainCheckError, so a re-check stops confirming the proof.\n */\nexport async function assertPublicHost(domain: string, options: DomainLookupOptions): Promise<void> {\n const [v4, v6] = await Promise.all([dohQuery(domain, 'A', options), dohQuery(domain, 'AAAA', options)]);\n const addresses = [...v4.answers, ...v6.answers].map(a => a.data);\n if (!addresses.length) throw new DomainCheckError(`${domain} has no address`);\n if (!addresses.every(isPublicAddress)) throw new IdentityCheckUnavailable(`${domain} points to a private network address, so it was not contacted`);\n}\n\n/** A well-known file: https only, no redirects, bounded. `undefined` when the server says it is not there. */\nexport async function fetchWellKnown(domain: string, method: 'https' | 'nip05', options: DomainLookupOptions): Promise<string | undefined> {\n await assertPublicHost(domain, options);\n const url = wellKnownUrl(domain, method);\n let response: Awaited<ReturnType<DomainFetch>>;\n try {\n response = await options.fetch(url, { headers: { accept: 'application/json' }, maxBytes: DOMAIN_FILE_MAX_BYTES, signal: options.signal, redirect: 'error' });\n } catch (e) {\n if (/too large/i.test(String(e))) throw new DomainCheckError(`${url} is too large`);\n throw new IdentityCheckUnavailable(`${domain} could not be reached. The file must be served at exactly this address, without a redirect, with the header Access-Control-Allow-Origin: *`);\n }\n if (response.status === 404 || response.status === 410) return;\n if (response.status >= 300 && response.status < 400) throw new IdentityCheckUnavailable(`${domain} answered with a redirect; the file must be served at exactly ${url}`);\n if (response.status !== 200) throw new IdentityCheckUnavailable(`${domain} answered ${response.status}`);\n try { return new TextDecoder('utf-8', { fatal: true }).decode(response.bytes); } catch { throw new DomainCheckError(`${url} is not text`); }\n}\n\nexport interface DomainLookup {\n domain: string;\n method: DomainMethod;\n /** DNS / HTTPS: the Ghostly records found. */\n records: DomainRecord[];\n /** NIP-05: the Nostr key named for the domain itself. */\n nostrKey?: string;\n /** A record or file exists at all (as opposed to nothing there). */\n found: boolean;\n /** The resolver reported DNSSEC validation of the TXT answer. */\n dnssec: boolean;\n resolver: DohResolverId;\n}\n\nasync function lookup(domain: string, method: DomainMethod, options: DomainLookupOptions): Promise<DomainLookup & { ttlMs: number }> {\n const resolver = resolverById(options.resolver).id;\n if (method === 'dns') {\n const answer = await dohQuery(dnsProofName(domain), 'TXT', options);\n const values: string[] = [];\n for (const record of answer.answers.slice(0, 32)) { try { values.push(txtValue(record.data)); } catch { /* not text: not ours */ } }\n const ttlMs = answer.answers.length ? Math.min(...answer.answers.map(a => a.ttl)) * 1000 : 0;\n return { domain, method, resolver: answer.resolver, records: recordsFromTxt(values), found: answer.answers.length > 0, dnssec: answer.authenticated, ttlMs };\n }\n const text = await fetchWellKnown(domain, method, options);\n const base = { domain, method, resolver, dnssec: false, records: [] as DomainRecord[], ttlMs: CACHE_FILE_MS };\n if (text === undefined) return { ...base, found: false };\n try {\n return method === 'nip05' ? { ...base, found: true, nostrKey: nip05RootKey(text) } : { ...base, found: true, records: recordsFromWellKnown(text) };\n } catch { throw new DomainCheckError(`${wellKnownUrl(domain, method)} is not a valid ${method === 'nip05' ? 'NIP-05' : 'Ghostly'} file`); }\n}\n\nconst cache = new Map<string, { until: number; result: Promise<DomainLookup & { ttlMs: number }> }>();\n/** Tests only. */\nexport function clearDomainCache(): void { cache.clear(); }\n\n/** What a domain publishes by one method. Concurrent and back-to-back checks share one lookup. */\nexport async function lookupDomain(domainInput: string, method: DomainMethod, options: DomainLookupOptions): Promise<DomainLookup> {\n const domain = normalizeDomain(domainInput), now = options.now ?? Date.now, resolver = resolverById(options.resolver).id;\n const id = `${resolver}|${method}|${domain}`;\n const hit = cache.get(id);\n if (hit && hit.until > now()) { const { ttlMs: _ttl, ...result } = await hit.result; return result; }\n const started = now();\n const entry = { until: started + CACHE_MAX_MS, result: lookup(domain, method, { ...options, resolver }) };\n cache.set(id, entry);\n if (cache.size > 128) cache.delete(cache.keys().next().value!);\n try {\n const { ttlMs, ...result } = await entry.result;\n entry.until = started + Math.min(CACHE_MAX_MS, ttlMs);\n return result;\n } catch (e) {\n if (cache.get(id) === entry) cache.delete(id);\n throw e;\n }\n}\n\n/** Throws unless `domain` publishes `record` by `method` (DNS or HTTPS). Returns what was found. */\nexport async function assertDomainRecord(domain: string, method: 'dns' | 'https', record: DomainRecord, options: DomainLookupOptions): Promise<DomainLookup> {\n const found = await lookupDomain(domain, method, options);\n if (recordsName(found.records, record)) return found;\n const where = method === 'dns' ? `The TXT record at ${dnsProofName(domain)}` : wellKnownUrl(domain);\n if (found.records.some(r => r.key === record.key)) throw new DomainCheckError(`${where} is for another proof of this key`);\n if (found.records.length) throw new DomainCheckError(`${where} names another Ghostly key: this proof was replaced or removed`);\n throw new DomainCheckError(method === 'dns'\n ? `No Ghostly TXT record at ${dnsProofName(domain)}${found.found ? '' : ' (DNS changes can take a few minutes)'}`\n : found.found ? `${wellKnownUrl(domain)} names no Ghostly proof` : `${wellKnownUrl(domain)} was not found`);\n}\n\n/** Throws unless the domain's NIP-05 root name is `nostrKey`. */\nexport async function assertNip05(domain: string, nostrKey: string, options: DomainLookupOptions): Promise<DomainLookup> {\n const found = await lookupDomain(domain, 'nip05', options);\n if (found.nostrKey === nostrKey) return found;\n const url = wellKnownUrl(domain, 'nip05');\n throw new DomainCheckError(!found.found ? `${url} was not found` : found.nostrKey\n ? `${url} names another Nostr key for ${domain}` : `${url} has no root name \"_\" for ${domain}`);\n}\n","import { atprotoDidMethod, IdentityCheckUnavailable, isAtprotoDid, parseAtprotoDidDocument, txtValue, type AtprotoDidDocument } from \"@ghostly/core\";\nimport type { IdentityFetch } from \"../contract\";\nimport { assertPublicHost, dohQuery, DomainCheckError, type DohResolverId } from \"../domain\";\n\n/**\n * AT Protocol identity resolution, the network half: a DID to its document (the PLC directory for\n * did:plc, the host's `/.well-known/did.json` for did:web), and a handle to a DID (DNS TXT\n * `_atproto.<handle>` through the person's DNS-over-HTTPS resolver, then\n * `https://<handle>/.well-known/atproto-did`). Every request goes through the contract's bounded\n * fetch: HTTPS only, no redirects, a size cap, a time-out. URLs are built here from the DID or the\n * handle, never taken from a proof.\n */\n\nexport const PLC_DIRECTORY = \"https://plc.directory\";\nconst TEST_HOST = /^https:\\/\\/[a-z0-9-]+(\\.[a-z0-9-]+)*\\.test$/;\n/** DID documents are small; a large answer is not one. */\nexport const DID_DOCUMENT_MAX_BYTES = 32 * 1024;\nconst HANDLE_DID_MAX_BYTES = 2048;\n\n/**\n * The PLC directory. A build made for the e2e suite with VITE_ATPROTO_TEST_PLC may point it at a\n * `.test` host (a name reserved for testing); a release build always uses plc.directory.\n */\nexport function plcDirectory(): string {\n try {\n const value = import.meta.env?.VITE_ATPROTO_TEST_PLC as string | undefined;\n return value && TEST_HOST.test(value) ? value : PLC_DIRECTORY;\n } catch { return PLC_DIRECTORY; }\n}\n\nexport interface AtprotoResolveOptions {\n fetch: IdentityFetch;\n signal?: AbortSignal;\n /** The DoH resolver for handles (the person's choice, as for domains). */\n resolver?: DohResolverId;\n /** The PLC directory; plcDirectory() by default. */\n plc?: string;\n}\n\n/** Where a DID's document lives. */\nexport function didDocumentUrl(did: string, plc = plcDirectory()): string {\n const method = atprotoDidMethod(did);\n if (method === \"plc\") return `${plc}/${did}`;\n if (method === \"web\") return `https://${did.slice(\"did:web:\".length)}/.well-known/did.json`;\n throw new Error(\"Not an AT Protocol DID\");\n}\n\n/**\n * Refuses a host the account chose (a did:web host, the PDS its document names) that points to a private\n * network address: a contact's app never knocks on its own local network for someone else's proof.\n * A host with no address is \"could not run\" too, except for a did:web host (`isDid`): that domain is the\n * identity, so the resolver's answer that it has none says the DID no longer resolves (as for did:web proofs).\n * A PDS name that is gone is its operator's, like a Pubky homeserver's: the check could not run.\n */\nexport async function assertPublicServer(host: string, options: AtprotoResolveOptions, isDid = false): Promise<void> {\n try { await assertPublicHost(host, { fetch: options.fetch, signal: options.signal, resolver: options.resolver }); }\n catch (e) {\n // eslint-disable-next-line preserve-caught-error -- A message people can act on; the library's error stays out of the UI (ES2020 has no Error.cause).\n if (isDid && e instanceof DomainCheckError) throw new Error(`The account's DID no longer resolves: ${e.message}`);\n throw new IdentityCheckUnavailable(`The account's server ${host} was not contacted: ${e instanceof Error ? e.message : String(e)}`);\n }\n}\n\n/** A DID's document, checked (parseAtprotoDidDocument). Throws a message people can read. */\nexport async function resolveAtprotoDid(did: string, options: AtprotoResolveOptions): Promise<AtprotoDidDocument> {\n const url = didDocumentUrl(did, options.plc);\n if (atprotoDidMethod(did) === \"web\") await assertPublicServer(did.slice(\"did:web:\".length), options, true);\n let response: Awaited<ReturnType<IdentityFetch>>;\n try {\n response = await options.fetch(url, { headers: { accept: \"application/did+ld+json, application/json\" }, maxBytes: DID_DOCUMENT_MAX_BYTES, signal: options.signal, redirect: \"error\" });\n } catch (e) {\n // eslint-disable-next-line preserve-caught-error -- A message people can act on; the library's error stays out of the UI (ES2020 has no Error.cause).\n if (/too large/i.test(String(e))) throw new Error(\"The account's DID document is too large\");\n throw new IdentityCheckUnavailable(\"The account's DID could not be resolved\");\n }\n if (response.status === 404 || response.status === 410) throw new Error(\"The account's DID is not registered, or was deactivated\");\n if (response.status !== 200) throw new IdentityCheckUnavailable(\"The account's DID could not be resolved\");\n let doc: unknown;\n try { doc = JSON.parse(response.text); } catch { throw new Error(\"The account's DID document is malformed\"); }\n return parseAtprotoDidDocument(doc, did);\n}\n\n/**\n * The DID a handle points to, or null when it points nowhere (or to two different DIDs). DNS first,\n * then HTTPS, as the handle spec says. The HTTPS lookup first checks the handle's addresses are public,\n * so a handle cannot make a contact's app knock on its local network.\n */\nexport async function resolveAtprotoHandle(handle: string, options: AtprotoResolveOptions): Promise<string | null> {\n return (await lookupAtprotoHandle(handle, options)).did;\n}\n\n/**\n * resolveAtprotoHandle, and whether the answer is one: `checked` is false when a lookup failed on the way (the\n * resolver or the handle's website could not be reached) so the handle may point somewhere after all. A cancel\n * throws.\n */\nasync function lookupAtprotoHandle(handle: string, options: AtprotoResolveOptions): Promise<{ did: string | null; checked: boolean }> {\n options.signal?.throwIfAborted();\n const lookup = { fetch: options.fetch, signal: options.signal, resolver: options.resolver };\n let dnsAnswered = false;\n try {\n const answer = await dohQuery(`_atproto.${handle}`, \"TXT\", lookup);\n dnsAnswered = true;\n const dids = new Set<string>();\n for (const a of answer.answers) {\n if (a.type !== 16) continue;\n let text: string;\n try { text = txtValue(a.data); } catch { continue; }\n if (text.startsWith(\"did=\")) dids.add(text.slice(4));\n }\n if (dids.size > 1) return { did: null, checked: true };\n const [did] = dids;\n if (did) return { did: isAtprotoDid(did) ? did : null, checked: true };\n } catch { options.signal?.throwIfAborted(); /* The resolver failed: try HTTPS. */ }\n // A handle with no public address points nowhere, if the resolver answered (a name it could not resolve may).\n try { await assertPublicHost(handle, lookup); }\n catch { options.signal?.throwIfAborted(); return { did: null, checked: dnsAnswered }; }\n let response: Awaited<ReturnType<IdentityFetch>>;\n try { response = await options.fetch(`https://${handle}/.well-known/atproto-did`, { headers: { accept: \"text/plain\" }, maxBytes: HANDLE_DID_MAX_BYTES, signal: options.signal, redirect: \"error\" }); }\n catch { options.signal?.throwIfAborted(); return { did: null, checked: false }; }\n const did = response.status === 200 ? response.text.trim() : \"\";\n // A DNS record the resolver could not read may still name the DID.\n return isAtprotoDid(did) ? { did, checked: true } : { did: null, checked: dnsAnswered };\n}\n\n/** Why a DID's handle is not shown: its document names none, the handle points elsewhere (or nowhere), or the lookup failed. */\nexport type AtprotoHandleCheck = { handle: string; missing?: undefined } | { handle?: undefined; missing: \"none\" | \"elsewhere\" | \"unchecked\" };\n\n/**\n * The handle to show for a DID: the one its document claims, and only if that handle resolves back to\n * the same DID. Otherwise the reason: the card shows the DID. Throws only when cancelled.\n */\nexport async function verifiedAtprotoHandle(doc: AtprotoDidDocument, options: AtprotoResolveOptions): Promise<AtprotoHandleCheck> {\n if (!doc.handle) return { missing: \"none\" };\n const found = await lookupAtprotoHandle(doc.handle, options);\n if (found.did === doc.did) return { handle: doc.handle };\n return { missing: found.did || found.checked ? \"elsewhere\" : \"unchecked\" };\n}\n"],"mappings":";;;;;;;AAOA,IAAI,eAAoD,KAAA;AACxD,SAAgB,oBAAoB,MAAiD;CAAE,SAAS;AAAM;AACtG,SAAgB,cAAwB;CACtC,MAAM,SAAS,OAAO;CACtB,OAAO,QAAQ,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,cAAc;AAC1D;;;;ACaA,IAAa,gBAAwC;CACnD;EAAE,IAAI;EAAS,MAAM;EAAS,KAAK;CAAkC;CACrE;EAAE,IAAI;EAAc,MAAM;EAAc,KAAK;CAAuC;CACpF;EAAE,IAAI;EAAU,MAAM;EAAU,KAAK;CAA+B;AACtE;AAEA,IAAa,gBAAgB,OAC3B,cAAc,MAAK,MAAK,EAAE,OAAO,EAAE,KAAK,cAAc,MAAK,MAAK,EAAE,OAAA,OAAuB;;AAG3F,IAAa,mBAAmB;AAChC,SAAgB,iBAA8B;CAC5C,IAAI;EAAE,OAAO,aAAa,WAAW,cAAc,QAAQ,gBAAgB,CAAC;CAAG,QAAQ;EAAE,OAAO,aAAa,KAAA,CAAS;CAAG;AAC3H;AAKA,IAAa,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wnInviteError, $n as engineError, $o as RATCHET_CAPABILITY, $s as handoffContext, $t as ONCHAIN_PROVIDER, A as knockIdentity, Aa as DHT_MESSAGE_TTL, Ai as STATUS_CARD_CAPABILITY, Al as appRefPublisher, An as ENDPOINT, Ar as lobbyKeys, Au as turnKeys, Bc as readEnrollGrant, Bn as NO_PICTURE_METADATA, Bo as heardTime, Br as shouldBeHub, Bs as HANDOFF_OFFER, Bu as currentRelays, C as communityHasFrame, Ci as isServeId, Cr as pickMeshHubs, Cu as TURN_MAX, D as decodeGroupEntryLink, Dc as signTombstone, Di as APPS_CAPABILITY, Dl as APP_STATEMENT_LIMITS, Dr as doorHubs, Ds as contactRtcConfig, Du as signTurnPacket, Ec as setUpdateFrame, Ei as isAppVersion, Eo as STATUS_CARD_LIMITS, Er as beaconRecords, Eu as readTurnPacket, F as GroupWakeLimiter, Fa as sanitizeFileName, Fc as enrollDigits, Fi as dialDescriptors, Fl as isAppRef, Fn as parseCashuRequestPayload, Fr as pickHubs, Fs as HANDOFF_ACK, Gc as inboxRecord, Gl as canonicalJsonBytes, Gn as GhostLink, Gr as transferEnded, Gs as HANDOFF_VERIFIED, Gt as didDhtDocument, H as GroupSession, Ha as fileMessageText, Hc as verifyEnrollProof, Hl as parseImageMeta, Hn as isStrippedPicture, Ho as shownTime, Hr as FILE_LIMITS, Hs as HANDOFF_PIECE_BYTES, I as groupWakeFrame, Ia as sanitizeMime, Ic as enrollDoneFrame, Il as readAppRevocation, In as parseFedimintRequestPayload, Io as statusCardText, Ir as rankHubs, Is as HANDOFF_CANCEL, J as meshMessageRef, Ja as EDIT_RATE_WINDOW_MS, Jc as settleRequest, Jl as encodeContactLink, Jn as PAIRED_FRAME_TOO_LARGE, Jo as parseGroupCommit, Jr as STATUS_IDLE_AFTER_MS, Js as handoffAttemptAllowed, Jt as encodeDidDhtPacket, Ju as withRequestOptions, K as GROUP_EDIT_TEXT_BYTES, Ka as parseVideoMeta, Kc as newInbox, Kl as readCanonicalJson, Kn as INVITE_TAKEN, Ko as MEMBER_KEY, Kr as transferStalled, Ks as NO_ATTEMPTS, Kt as didDhtFromPublicKey, Ku as budgetRetryMs, L as groupWakes, Lc as enrollGrantFrame, Ll as readAppRevocationShape, Lr as readBeacon, Ls as HANDOFF_DONE, Lu as RelayTransport, M as mergeKnocks, Ma as DHT_FILE_CAPABILITY, Mi as CapsExchange, Ml as isAppHash, Mn as fedimintRequestPayload, Mr as mergeBeacon, Ms as HTTP_SERVICE_PROTO, Mu as turnStatedVerifier, N as readKnocks, Na as dhtFileId, Nc as enrollCancelFrame, Ni as DHT_TEXT_CAPABILITY, Nl as isAppKey, Nn as findEndpoint, No as checkStatusCard, Nr as mergeLobby, Ns as LEGACY_SERVICES, Nu as turnVerifierMark, O as encodeGroupEntryLink, Oc as verifySetUpdate, Oi as BUTTONS_CAPABILITY, Ol as appFingerprint, Or as freshHubs, Ou as signTurnRelease, Pa as formatFileSize, Pc as enrollCancelReason, Pi as capsDescriptors, Pn as isFederationId, Po as sameButtonText, Pr as newerHead, Ps as serviceIdFromName, Pu as DEFAULT_RELAYS, Qa as dhtEditId, Qc as REQUEST_LIFETIME_MS, Qi as PeerProofs, Ql as readDeviceInvite, Qn as EngineError, Qo as edgeParams, Qs as handoffCancelFrame, Qt as EVM_TEST_CHAINS, R as parseGroupWakeFrame, Rc as enrollHelloFrame, Rn as videoMetadataPatches, Ro as arrivalKey, Rr as readBeaconHead, Rs as HANDOFF_HAVE, S as GROUP_READ_NOTE_COMMUNITY, Si as APP_RANGE_LIMITS, Sl as pacer, Sr as meshHubs, Ss as RTC_CONFIG, Su as TURN_LAST_SEQUENCE, T as encodeCommunityLink, Tc as setAckFrame, Ti as chatAppId, Tl as sha256Paced, Tr as beaconKeys, Tu as nextTurnPosition, U as frameBytes, Ua as parseVoiceMeta, Uc as clearMissed, Ui as emptyIdentityLedger, Un as stripPictureMetadata, Uo as GROUP_ADMIN_OFF_ERROR, Us as HANDOFF_REQUEST, V as GROUP_READ_NOTE, Vc as readEnrollHello, Vn as PICTURE_METADATA_LIMITS, Vo as receivedTimestamp, Vr as ChatFiles, Vs as HANDOFF_PAKE, Vu as normalizeRelayUrl, Wc as endedRequests, Wl as canonicalJson, Wo as GROUP_MEMBER_CAP, Wr as sentWhole, Ws as HANDOFF_TIMINGS, Wu as traceLink, X as mentionsMember, Xa as REMOVED_TEXT, Xc as turnOff, Xl as createDeviceInvite, Xn as pairedMessageFits, Xo as rosterHas, Xr as personStatus, Xs as handoffAttemptSucceeded, Xt as signDidDhtPacket, Y as parseCommunityEdit, Ya as MAX_REMOVAL_NUMBER, Yc as takeRequest, Yi as receivedIdentityStatus, Yl as readContactLink, Yn as pairedEditFits, Yo as rosterAdmin, Yr as liveStatus, Ys as handoffAttemptFailed, Yu as PacketTooLargeError, Z as groupName, Za as RateWindow, Zc as ContactRequestError, Zi as lastSharedWithMe, Zl as deviceInviteJoinerParams, Zn as pairedMessageFrame, Zo as verifyCommitSignature, Zs as handoffBusyFrame, Zt as ETHEREUM_USDT, Zu as createRelayPayload, _ as groupTypingEpoch, _c as readHandoffHello, _d as utf8Decode, _i as parseWakeFrame, _l as appDigest, _o as replySnippet, _s as decodeControl, _t as isAtprotoDid, a as appRevocationFor, ac as handoffManifestFrames, ad as verify, ai as mayPin, al as linkRecords, an as WALLET_NETWORKS, ao as GROUP_REACTION_FRAME, b as COMMUNITY_LIMITS, bc as readHandoffVerified, bi as checkPushEndpoint, br as MESH_HUBS, bu as classifyTurnRead, c as checkAppBeforeRun, ca as HOLD_LIMITS, cc as handoffReleaseFrame, cd as hasVisible, ci as pinNumberHolds, cl as openRequest, cn as assertWholeSats, co as nextReactionNumber, cs as PRESENCE_WINDOW, cu as HANDOFF_CAPABILITY, da as isHoldUrl, dc as handoffVersions, dd as bytesEqual, di as WAKE_ONLINE_BATCH_MS, dl as requestRecords, dn as walletNetworkOf, do as reactionIsNewer, ds as presenceSeenAt, du as deviceKeyZ32, ea as validExternalKey, ec as handoffContextProof, ei as TypingSender, el as contactAskerHolds, en as PaymentPreflightError, er as engineText, es as RatchetBox, eu as createChatInvite, fa as newMailbox, fc as newHandoffId, fd as fromBase64Url, fi as WAKE_ONLINE_DELAY_MS, fl as seenEntry, fn as SPARK_NETWORKS, fo as readReaction, fs as GhostlyHttpError, fu as deviceLinkPairing, g as GroupTypingBoard, gc as readHandoffHave, gd as toZ32, gi as newWakeToken, gn as isBitcoinAddress, go as readReply, gs as LIMITS, gu as webCryptoSigner, hc as readHandoffDone, hd as toBase64Url, hi as deviceWakeRequest, hn as sparkInvoiceDetails, ho as pairedReplyAuthor, hs as webLocalFetch, hu as seedSigner, i as addedAppPermissions, ic as handoffHelloFrame, id as publicKeyFromZ32, ii as PIN_LIMITS, il as knockSlotRecords, in as USDT_PUBLIC_RPC, io as COMMUNITY_REACTION_FRAME, iu as inviteOwnership, j as knockRecords, ja as peekDhtMailbox, ji as UPGRADE_CAPABILITY, jn as cashuRequestPayload, jr as lobbyRecords, js as emptyLinkRecords, ju as turnName, k as entryParams, ki as EDIT_CAPABILITY, kl as appRef, kn as decodeBolt11, kr as hubRank, ks as parseCallSignal, ku as turnInstance, l as planAppUpdate, la as HoldKeys, lc as handoffRetryAfter, ld as sanitizeDisplayText, li as readPin, ll as readKnockSlot, ln as formatPaymentAmount, lo as queueReaction, lr as readGroupFileMeta, ls as RELAY_POLL_INTERVALS, lu as deviceEchoFrame, mc as readHandoffCancel, md as randomBytes, mi as WakeLimiter, ml as APP_BUNDLE_MAGIC, mn as sparkAddressKind, mo as wireReaction, ms as parseLocalTarget, mu as newDeviceSetSecret, n as readX401SdJwtVc, na as automaticTransport, nc as handoffDigest, nd as identityFromSeed, ni as typingActivity, nl as knockSlotIdentity, no as forwardedAgain, nr as GROUP_FILE_LIMITS, ns as ratchetSessionOf, nu as encodeInviteCode, o as appStoreDecision, oa as HOLD_CAPABILITY, oc as handoffOfferFrame, oi as nextPinNumber, ol as makeStampPaced, on as arkAddressPrefix, oo as REACTION_LIMITS, os as DHT_POLL_INTERVALS, ou as DEVICES_CAPABILITY, p as readAppStoreSteps, pa as readManifest, pc as readHandoffAck, pl as APP_BUNDLE_LIMITS, pn as SPARK_PROVIDER, po as validReactionNumber, pr as CarriedTransport, ps as formatLocalTarget, pu as devicePingFrame, q as carryMentions, qa as EDIT_BUFFER_MS, qc as planKnocks, ql as createContactLink, qn as LIVENESS_PING_MS, qo as commitHash, qs as filePartName, qt as encodeDidDhtDeactivated, qu as isDiscoveryBudgetError, r as sameX401HolderJwk, rc as handoffEphemeral, rd as identityFromSeedB64, rl as knockSlotOf, rn as TEST_USDT_FAUCET_AMOUNT, ro as readForwarded, rr as GROUP_HAVE_FRAME, rs as DirectPathWatch, ru as inviteLink, s as appUpdateDecision, sa as HOLD_DATED_BACK_MS, sc as handoffPakeFrame, sd as sanitizeAvatar, si as pinIsNewer, sl as mergeContactKnocks, sn as assertTokenUnits, so as ReactionWindow, sr as groupFileFallback, su as ENROLL_CAPABILITY, t as newX401HolderKey, ta as TRANSPORTS, tc as handoffDataFrame, td as createIdentity, tl as contactDay, tn as SEPOLIA_TEST_USDT, to as parseLinkPreview, tr as parseEngineError, ts as emptyRatchetState, tu as decodeInviteCode, u as APP_STORE_LIMITS, ua as HoldRefusedError, uc as handoffStreamKey, ud as stripHidden, ui as WAKE_CALL_INTERVAL_MS, ul as readLinkRecord, un as validatePaymentTarget, uo as reactionEmoji, us as WATCH_PEER_MS, uu as deviceEchoNonce, v as openGroupTyping, vc as readHandoffPake, vd as utf8Encode, vi as relayRequest, vl as appViewOf, vn as isPubkyKey, vo as BUTTON_ID, vr as groupSignalFrame, vs as encodeControl, vt as normalizeAtprotoHandle, vu as TURN_RAISE_READ_TIMEOUT_MS, w as decodeCommunityLink, wc as readSetUpdate, wl as readAppBundleAsync, wr as COMMUNITY_TOPOLOGY, wu as firstDeviceSetSecret, x as CommunitySession, xc as sealHandoffPiece, xi as vapidKeysMatch, xl as isAppUrl, xr as mayBeHub, xu as turnPutSummary, y as sealGroupTyping, yc as readHandoffTurnFrame, yi as wakeRequest, yr as readGroupSignal, yu as TURN_SETTLE_MS, z as GROUP_LIMITS, zc as enrollProofFrame, zn as withoutVideoMetadata, zo as claimedTime, zr as readLobby, zs as HANDOFF_HELLO } from "./src-BnpEQqzk.js";
2
+ import { $a as REMOVED_TEXT, $c as turnOff, $l as createDeviceInvite, $n as pairedMessageFits, $o as rosterHas, $r as personStatus, $s as handoffAttemptSucceeded, $t as ONCHAIN_PROVIDER, A as knockIdentity, Ac as signTombstone, Ai as APPS_CAPABILITY, Al as APP_STATEMENT_LIMITS, An as ENDPOINT, Ar as doorHubs, As as contactRtcConfig, Au as signTurnPacket, Bc as enrollGrantFrame, Bl as readAppRevocationShape, Br as readBeacon, Bs as HANDOFF_DONE, Bu as RelayTransport, C as communityHasFrame, Cc as readHandoffVerified, Ci as checkPushEndpoint, Cr as MESH_HUBS, Cu as classifyTurnRead, D as decodeGroupEntryLink, Dc as readSetUpdate, Dl as readAppBundleAsync, Dr as COMMUNITY_TOPOLOGY, Du as firstDeviceSetSecret, Ei as isServeId, Er as pickMeshHubs, Eu as TURN_MAX, F as GroupWakeLimiter, Fa as DHT_FILE_CAPABILITY, Fi as CapsExchange, Fl as isAppHash, Fn as parseCashuRequestPayload, Fr as mergeBeacon, Fs as HTTP_SERVICE_PROTO, Fu as turnStatedVerifier, Ga as fileMessageText, Gc as verifyEnrollProof, Gl as parseImageMeta, Gn as isStrippedPicture, Go as shownTime, Gr as FILE_LIMITS, Gs as HANDOFF_PIECE_BYTES, Gt as didDhtDocument, H as GroupSession, Hc as enrollProofFrame, Hn as withoutVideoMetadata, Ho as claimedTime, Hr as readLobby, Hs as HANDOFF_HELLO, I as groupWakeFrame, Ia as dhtFileId, Ic as enrollCancelFrame, Ii as DHT_TEXT_CAPABILITY, Il as isAppKey, In as parseFedimintRequestPayload, Io as checkStatusCard, Ir as mergeLobby, Is as LEGACY_SERVICES, Iu as turnVerifierMark, J as meshMessageRef, Jc as inboxRecord, Jl as canonicalJsonBytes, Jn as GhostLink, Jr as transferEnded, Js as HANDOFF_VERIFIED, Jt as encodeDidDhtPacket, K as GROUP_EDIT_TEXT_BYTES, Ka as parseVoiceMeta, Kc as clearMissed, Ki as emptyIdentityLedger, Kn as stripPictureMetadata, Ko as GROUP_ADMIN_OFF_ERROR, Ks as HANDOFF_REQUEST, Kt as didDhtFromPublicKey, L as groupWakes, La as formatFileSize, Lc as enrollCancelReason, Li as capsDescriptors, Lo as sameButtonText, Lr as newerHead, Ls as serviceIdFromName, Lu as DEFAULT_RELAYS, M as mergeKnocks, Mi as EDIT_CAPABILITY, Ml as appRef, Mn as fedimintRequestPayload, Mr as hubRank, Ms as parseCallSignal, Mu as turnInstance, N as readKnocks, Na as DHT_MESSAGE_TTL, Ni as STATUS_CARD_CAPABILITY, Nl as appRefPublisher, Nn as findEndpoint, Nr as lobbyKeys, Nu as turnKeys, O as encodeGroupEntryLink, Oc as setAckFrame, Oi as chatAppId, Ol as sha256Paced, Or as beaconKeys, Ou as nextTurnPosition, Pa as peekDhtMailbox, Pi as UPGRADE_CAPABILITY, Pn as isFederationId, Pr as lobbyRecords, Ps as emptyLinkRecords, Pu as turnName, Qa as MAX_REMOVAL_NUMBER, Qc as takeRequest, Qi as receivedIdentityStatus, Ql as readContactLink, Qn as pairedEditFits, Qo as rosterAdmin, Qr as liveStatus, Qs as handoffAttemptFailed, Qt as EVM_TEST_CHAINS, Qu as PacketTooLargeError, R as parseGroupWakeFrame, Ra as sanitizeFileName, Rc as enrollDigits, Ri as dialDescriptors, Rl as isAppRef, Rn as audioMetadataPatches, Rr as pickHubs, Rs as HANDOFF_ACK, S as GROUP_READ_NOTE_COMMUNITY, Sc as readHandoffTurnFrame, Si as wakeRequest, Sr as readGroupSignal, Su as TURN_SETTLE_MS, T as encodeCommunityLink, Ti as APP_RANGE_LIMITS, Tl as pacer, Tr as meshHubs, Ts as RTC_CONFIG, Tu as TURN_LAST_SEQUENCE, U as frameBytes, Uc as readEnrollGrant, Un as NO_PICTURE_METADATA, Uo as heardTime, Ur as shouldBeHub, Us as HANDOFF_OFFER, Uu as currentRelays, V as GROUP_READ_NOTE, Vc as enrollHelloFrame, Vn as videoMetadataPatches, Vo as arrivalKey, Vr as readBeaconHead, Vs as HANDOFF_HAVE, Wc as readEnrollHello, Wn as PICTURE_METADATA_LIMITS, Wo as receivedTimestamp, Wr as ChatFiles, Ws as HANDOFF_PAKE, Wu as normalizeRelayUrl, X as mentionsMember, Xa as EDIT_BUFFER_MS, Xc as planKnocks, Xl as createContactLink, Xn as LIVENESS_PING_MS, Xo as commitHash, Xs as filePartName, Xt as signDidDhtPacket, Xu as isDiscoveryBudgetError, Y as parseCommunityEdit, Ya as parseVideoMeta, Yc as newInbox, Yl as readCanonicalJson, Yn as INVITE_TAKEN, Yo as MEMBER_KEY, Yr as transferStalled, Ys as NO_ATTEMPTS, Yu as budgetRetryMs, Z as groupName, Za as EDIT_RATE_WINDOW_MS, Zc as settleRequest, Zl as encodeContactLink, Zn as PAIRED_FRAME_TOO_LARGE, Zo as parseGroupCommit, Zr as STATUS_IDLE_AFTER_MS, Zs as handoffAttemptAllowed, Zt as ETHEREUM_USDT, Zu as withRequestOptions, _ as groupTypingEpoch, _c as readHandoffCancel, _d as randomBytes, _i as WakeLimiter, _l as APP_BUNDLE_MAGIC, _o as wireReaction, _s as parseLocalTarget, _t as isAtprotoDid, _u as newDeviceSetSecret, a as appRevocationFor, aa as automaticTransport, ac as handoffDigest, ad as identityFromSeed, ai as typingActivity, al as knockSlotIdentity, an as WALLET_NETWORKS, ao as forwardedAgain, ar as GROUP_FILE_LIMITS, as as ratchetSessionOf, au as encodeInviteCode, b as COMMUNITY_LIMITS, bc as readHandoffHello, bd as utf8Decode, bi as parseWakeFrame, bl as appDigest, bo as replySnippet, bs as decodeControl, c as checkAppBeforeRun, cc as handoffManifestFrames, cd as verify, ci as mayPin, cl as linkRecords, cn as assertWholeSats, co as GROUP_REACTION_FRAME, da as HOLD_LIMITS, dc as handoffReleaseFrame, dd as hasVisible, di as pinNumberHolds, dl as openRequest, dn as walletNetworkOf, do as nextReactionNumber, ds as PRESENCE_WINDOW, du as HANDOFF_CAPABILITY, ea as lastSharedWithMe, ec as handoffBusyFrame, ed as createRelayPayload, el as ContactRequestError, en as PaymentPreflightError, eo as RateWindow, er as pairedMessageFrame, es as verifyCommitSignature, eu as deviceInviteJoinerParams, fa as HoldKeys, fc as handoffRetryAfter, fd as sanitizeDisplayText, fi as readPin, fl as readKnockSlot, fn as SPARK_NETWORKS, fo as queueReaction, fr as readGroupFileMeta, fs as RELAY_POLL_INTERVALS, fu as deviceEchoFrame, g as GroupTypingBoard, ga as readManifest, gc as readHandoffAck, gl as APP_BUNDLE_LIMITS, gn as isBitcoinAddress, go as validReactionNumber, gr as CarriedTransport, gs as formatLocalTarget, gu as devicePingFrame, ha as newMailbox, hc as newHandoffId, hd as fromBase64Url, hi as WAKE_ONLINE_DELAY_MS, hl as seenEntry, hn as sparkInvoiceDetails, ho as readReaction, hs as GhostlyHttpError, hu as deviceLinkPairing, i as addedAppPermissions, ia as TRANSPORTS, ic as handoffDataFrame, id as createIdentity, il as contactDay, in as USDT_PUBLIC_RPC, io as parseLinkPreview, ir as parseEngineError, is as emptyRatchetState, iu as decodeInviteCode, j as knockRecords, jc as verifySetUpdate, ji as BUTTONS_CAPABILITY, jl as appFingerprint, jn as cashuRequestPayload, jr as freshHubs, ju as signTurnRelease, k as entryParams, kc as setUpdateFrame, ki as isAppVersion, kn as decodeBolt11, ko as STATUS_CARD_LIMITS, kr as beaconRecords, ku as readTurnPacket, l as planAppUpdate, la as HOLD_CAPABILITY, lc as handoffOfferFrame, li as nextPinNumber, ll as makeStampPaced, ln as formatPaymentAmount, lo as REACTION_LIMITS, ls as DHT_POLL_INTERVALS, lu as DEVICES_CAPABILITY, ma as isHoldUrl, mc as handoffVersions, md as bytesEqual, mi as WAKE_ONLINE_BATCH_MS, ml as requestRecords, mn as sparkAddressKind, mo as reactionIsNewer, ms as presenceSeenAt, mu as deviceKeyZ32, n as readX401SdJwtVc, na as emptyProofLedger, nc as handoffContext, nl as contactAskerFrame, nr as engineError, ns as RATCHET_CAPABILITY, nu as OwnInviteError, o as appStoreDecision, oc as handoffEphemeral, od as identityFromSeedB64, ol as knockSlotOf, on as arkAddressPrefix, oo as readForwarded, or as GROUP_HAVE_FRAME, os as DirectPathWatch, ou as inviteLink, p as readAppStoreSteps, pa as HoldRefusedError, pc as handoffStreamKey, pd as stripHidden, pi as WAKE_CALL_INTERVAL_MS, pl as readLinkRecord, pn as SPARK_PROVIDER, po as reactionEmoji, ps as WATCH_PEER_MS, pu as deviceEchoNonce, q as carryMentions, qc as endedRequests, ql as canonicalJson, qo as GROUP_MEMBER_CAP, qr as sentWhole, qs as HANDOFF_TIMINGS, qt as encodeDidDhtDeactivated, qu as traceLink, r as sameX401HolderJwk, ra as validExternalKey, rc as handoffContextProof, ri as TypingSender, rl as contactAskerHolds, rn as TEST_USDT_FAUCET_AMOUNT, rr as engineText, rs as RatchetBox, ru as createChatInvite, s as appUpdateDecision, sc as handoffHelloFrame, sd as publicKeyFromZ32, si as PIN_LIMITS, sl as knockSlotRecords, sn as assertTokenUnits, so as COMMUNITY_REACTION_FRAME, su as inviteOwnership, t as newX401HolderKey, ta as PeerProofs, tc as handoffCancelFrame, tl as REQUEST_LIFETIME_MS, tn as SEPOLIA_TEST_USDT, to as dhtEditId, tr as EngineError, ts as edgeParams, tu as readDeviceInvite, u as APP_STORE_LIMITS, ua as HOLD_DATED_BACK_MS, uc as handoffPakeFrame, ud as sanitizeAvatar, ui as pinIsNewer, ul as mergeContactKnocks, un as validatePaymentTarget, uo as ReactionWindow, ur as groupFileFallback, uu as ENROLL_CAPABILITY, v as openGroupTyping, vc as readHandoffDone, vd as toBase64Url, vi as deviceWakeRequest, vn as isPubkyKey, vo as pairedReplyAuthor, vs as webLocalFetch, vt as normalizeAtprotoHandle, vu as seedSigner, w as decodeCommunityLink, wc as sealHandoffPiece, wi as vapidKeysMatch, wl as isAppUrl, wr as mayBeHub, wu as turnPutSummary, x as CommunitySession, xc as readHandoffPake, xd as utf8Encode, xi as relayRequest, xl as appViewOf, xo as BUTTON_ID, xr as groupSignalFrame, xs as encodeControl, xu as TURN_RAISE_READ_TIMEOUT_MS, y as sealGroupTyping, yc as readHandoffHave, yd as toZ32, yi as newWakeToken, yo as readReply, ys as LIMITS, yu as webCryptoSigner, z as GROUP_LIMITS, za as sanitizeMime, zc as enrollDoneFrame, zl as readAppRevocation, zn as withoutAudioMetadata, zo as statusCardText, zr as rankHubs, zs as HANDOFF_CANCEL } from "./src-BzsyAvPf.js";
3
3
  import { i as SourceUnreachableError, n as PROVIDER_PLATFORMS, o as isNothingSpentError, r as SourceConfigError, t as NothingSpentError, u as redact } from "./types-C4_KafL_.js";
4
4
  import { t as bitcoindRpc } from "./bitcoindProvider-DGw3xBSa.js";
5
- import { t as nwc } from "./nwcProvider-DpeDy0bV.js";
5
+ import { t as nwc } from "./nwcProvider-BXqJmM98.js";
6
6
  import { _ as openDb, a as GROUP_LIGHT_RANGE, b as transact, c as clearProfileStores, d as deleteDatabase, f as errorLine, g as newestWalletTx, h as groupLiveKey, i as FILE_INDEX, l as committed, m as groupLightKey, n as APP_STORAGE_SCOPE_INDEX, o as GROUP_LIVE_RANGE, p as fileStore, r as CARD_INDEX, s as STORES$1, t as APP_STORAGE_CHAT_INDEX, u as databaseName, v as profileOpenFailure, x as wrap, y as store } from "./idb-CEuoNsTv.js";
7
- import { a as sealSeed, c as openRow, d as sealRow, f as sealedStore, g as whenDataKeyDropped, h as sealSecret, i as newDeviceKey, l as openRows, m as openSecret, o as unsealSeed, p as hasDataKey, r as intentRepository, s as RowSeals, u as proofKey } from "./networkReason-DMffkiJ6.js";
7
+ import { a as sealSeed, c as openRow, d as sealRow, f as sealedStore, g as whenDataKeyDropped, h as sealSecret, i as newDeviceKey, l as openRows, m as openSecret, o as unsealSeed, p as hasDataKey, r as intentRepository, s as RowSeals, u as proofKey } from "./networkReason-BBosp2KG.js";
8
8
  import { c as fileSpace, f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf, u as removeFileBytes } from "./fileBytes-BLPZq9YU.js";
9
- import { $ as iceServerProblem, A as storedSize, B as journaledPayment, C as paymentNetworksOf, D as FileAppender, E as WALLET_TYPES, F as CASHU_CARD, G as sourceKey, H as INVOICE_PACE, I as LightningCards, J as AskBackoff, K as CASHU_MINT_SOURCE, L as cardsKey, O as readStored$2, P as IdentityProofs, Q as dropBreezDatabase, R as isRecoveryPhrase, S as paymentNetwork, U as nextInvoiceAsk, V as lightningPaying, W as ProviderSources, X as breezDatabaseInUse, Y as breezDatabase, Z as breezDatabasesFor, _ as WALLET_NAMES, a as GroupFileDesk, at as networkLabel, b as createTiming, c as groupOfFile, ct as requireTurn, d as pairedWireReply, et as iceServerSetting, f as receivedPairedReply, g as paymentWireId, h as paymentAlias, i as onPublicIrohRelay, it as WrongNetworkError, j as streamStored, k as removeStored, l as storedGroupFiles, lt as setAwayWallets, m as replyTo, n as createIrohWebEndpoint, nt as ModeChanged, o as groupFileId, ot as awayFrom, p as replyRef, q as cashuMint, r as irohRelayProblem, rt as ModeGate, s as groupFileText, st as refuseAway, t as DEFAULT_IROH_RELAYS, tt as relayOnlyProblem, u as groupReply, ut as setSingleWriterGate, v as assertConfirmedReal, w as walletInstances, x as crossNetwork, y as createFailure, z as normalizePhrase } from "./irohWeb-CqPN8VPY.js";
9
+ import { $ as iceServerProblem, A as storedSize, B as journaledPayment, C as paymentNetworksOf, D as FileAppender, E as WALLET_TYPES, F as CASHU_CARD, G as sourceKey, H as INVOICE_PACE, I as LightningCards, J as AskBackoff, K as CASHU_MINT_SOURCE, L as cardsKey, O as readStored$2, P as IdentityProofs, Q as dropBreezDatabase, R as isRecoveryPhrase, S as paymentNetwork, U as nextInvoiceAsk, V as lightningPaying, W as ProviderSources, X as breezDatabaseInUse, Y as breezDatabase, Z as breezDatabasesFor, _ as WALLET_NAMES, a as GroupFileDesk, at as networkLabel, b as createTiming, c as groupOfFile, ct as requireTurn, d as pairedWireReply, et as iceServerSetting, f as receivedPairedReply, g as paymentWireId, h as paymentAlias, i as onPublicIrohRelay, it as WrongNetworkError, j as streamStored, k as removeStored, l as storedGroupFiles, lt as setAwayWallets, m as replyTo, n as createIrohWebEndpoint, nt as ModeChanged, o as groupFileId, ot as awayFrom, p as replyRef, q as cashuMint, r as irohRelayProblem, rt as ModeGate, s as groupFileText, st as refuseAway, t as DEFAULT_IROH_RELAYS, tt as relayOnlyProblem, u as groupReply, ut as setSingleWriterGate, v as assertConfirmedReal, w as walletInstances, x as crossNetwork, y as createFailure, z as normalizePhrase } from "./irohWeb-CYn0uB_A.js";
10
10
  import { r as loadFedimintSdk, t as fedimintDatabase } from "./fedimintSdk-CqTeMdF0.js";
11
11
  import { c as isTestMint, d as mintUrlSpelling, f as paysItsOwnInvoices, l as isWorthlessMint, n as DEFAULT_MINTS, o as fakesLightning, r as TEST_MINT, t as BITCOIN_INVOICE_ON_TESTNET, u as mintNetwork } from "./mints-j5XAOk4f.js";
12
- import { a as registeredLightningProviders, c as boundedIdentityFetch, d as testSwitch, n as setOwnDidSource, o as registeredOnchainProviders, r as onAdaptersChanged, s as reserveAdapterIds, u as testBuild } from "./ownDid-iKz8u_fM.js";
13
- import { d as chosenResolver, m as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer } from "./resolve-DI8uAM_Y.js";
14
- import { n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-Q_rMgoE9.js";
12
+ import { a as registeredLightningProviders, c as boundedIdentityFetch, d as testSwitch, n as setOwnDidSource, o as registeredOnchainProviders, r as onAdaptersChanged, s as reserveAdapterIds, u as testBuild } from "./ownDid--DtH_Jdi.js";
13
+ import { d as chosenResolver, m as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer } from "./resolve-MFeFljsN.js";
14
+ import { n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-Dwq8EN8x.js";
15
15
  import { t as hyperdhtRelayProblem } from "./hyperdhtRelay-1wzya_0L.js";
16
16
  import { sha256 } from "@noble/hashes/sha2.js";
17
17
  import { hkdf } from "@noble/hashes/hkdf.js";
@@ -745,7 +745,7 @@ function viewNews(before, after) {
745
745
  //#endregion
746
746
  //#region ../browser/src/engine/paymentAdapters/usdtWallet.ts
747
747
  /** The Ethereum libraries, a large part of the app: loaded once a USDT wallet is made, opened or restored, not with the engine. */
748
- var loadUsdt = () => import("./usdt-CDaLhEYh.js");
748
+ var loadUsdt = () => import("./usdt-Bp7T2iqt.js");
749
749
  /** Every new profile starts with this wallet: an address to receive on, nothing to set up. */
750
750
  var DEFAULT_USDT = {
751
751
  network: "ethereum",
@@ -1233,7 +1233,7 @@ async function restoreArkDatabase(walletId, snapshot) {
1233
1233
  //#endregion
1234
1234
  //#region ../browser/src/engine/paymentAdapters/arkWallet.ts
1235
1235
  /** The Ark SDK, a large part of the app: loaded once an Ark wallet is made, opened or restored, not with the engine. */
1236
- var loadArkade = () => import("./arkade-_aaB7VbW.js");
1236
+ var loadArkade = () => import("./arkade-DxB-MR43.js");
1237
1237
  /** How long a Testnet wallet about to make way for another waits for its server to say what it holds. */
1238
1238
  var RETIRE_READ_MS = 1e4;
1239
1239
  /** Every new profile starts with this wallet: nothing to set up before receiving. */
@@ -9818,7 +9818,7 @@ var HostNotContacted = class extends Error {};
9818
9818
  */
9819
9819
  function fixedHostsFetch(fetch) {
9820
9820
  return async (url, options) => {
9821
- const { fixedIdentityHosts } = await import("./fixedHosts-BV5GDiTU.js");
9821
+ const { fixedIdentityHosts } = await import("./fixedHosts-CINXidpd.js");
9822
9822
  const host = hostOf$1(url);
9823
9823
  if (!fixedIdentityHosts().has(host) && host !== hostOf$1("https://public.api.bsky.app") && host !== hostOf$1("https://nexus.pubky.app")) throw new HostNotContacted(`Hide my IP from contacts is on: ${host}, a server your contact chose, was not contacted`);
9824
9824
  return fetch(url, options);
@@ -11055,15 +11055,16 @@ function patchedRead(read, patches) {
11055
11055
  };
11056
11056
  }
11057
11057
  /**
11058
- * A received picture or video as it goes on: without its metadata (one from an app that sent it with them keeps where
11059
- * its author took it, the device, the time), as one sent from here; undefined for any other file, copied as it is. A
11060
- * picture is read whole; a video's stripped bytes are a Blob when it is kept in one, else read through the parts
11061
- * changed. Refused with `NO_PICTURE_METADATA` or `NO_VIDEO_METADATA` when its metadata cannot be removed.
11058
+ * A received picture, video, audio file or voice note as it goes on: without its metadata (one from an app that sent
11059
+ * it with them keeps where its author took it, the device, the time, an audio file's tags), as one sent from here;
11060
+ * undefined for any other file, copied as it is. A picture is read whole; a video's or an audio file's stripped bytes
11061
+ * are a Blob when it is kept in one, else read through the parts changed. Refused with `NO_PICTURE_METADATA`,
11062
+ * `NO_VIDEO_METADATA` or `NO_AUDIO_METADATA` when its metadata cannot be removed.
11062
11063
  */
11063
11064
  async function withoutMetadata(source, size, file, read) {
11064
- if (file.voice || !size) return void 0;
11065
- if (file.video || !isStrippedPicture(await read(0, Math.min(PICTURE_METADATA_LIMITS.headBytes, size)), file.mime)) {
11066
- if (source.blob) return withoutVideoMetadata(source.blob, file.mime);
11065
+ if (!size) return void 0;
11066
+ if (file.video || file.voice || !isStrippedPicture(await read(0, Math.min(PICTURE_METADATA_LIMITS.headBytes, size)), file.mime)) {
11067
+ if (source.blob) return await withoutVideoMetadata(source.blob, file.mime) ?? await withoutAudioMetadata(source.blob, file.mime);
11067
11068
  const readFully = async (offset, length) => {
11068
11069
  const whole = new Uint8Array(Math.max(0, Math.min(length, size - offset)));
11069
11070
  for (let at = 0; at < whole.length;) {
@@ -11077,6 +11078,9 @@ async function withoutMetadata(source, size, file, read) {
11077
11078
  const patches = await videoMetadataPatches({
11078
11079
  size,
11079
11080
  read: readFully
11081
+ }, file.mime) ?? await audioMetadataPatches({
11082
+ size,
11083
+ read: readFully
11080
11084
  }, file.mime);
11081
11085
  return patches && patchedRead(read, patches);
11082
11086
  }
@@ -11094,9 +11098,9 @@ async function withoutMetadata(source, size, file, read) {
11094
11098
  var FORWARD_MESSAGE_GONE = "That message is not in this chat";
11095
11099
  /**
11096
11100
  * A copy of a file on this device, for sending in another chat under `file.id`: a small one whole, a larger one a
11097
- * step at a time, never whole in memory; a picture without its metadata, read whole, and a video without its. Refused
11098
- * while it is still arriving, or when its bytes are gone. Resolves to `file` as it goes: a stripped file's size is its
11099
- * copy's.
11101
+ * step at a time, never whole in memory; a picture without its metadata, read whole, and a video or an audio file
11102
+ * without its. Refused while it is still arriving, or when its bytes are gone. Resolves to `file` as it goes: a
11103
+ * stripped file's size is its copy's.
11100
11104
  *
11101
11105
  * A copy cut off because its source went meanwhile says why, as one started after would: its message deleted (here, or
11102
11106
  * for everyone by its sender, which takes its file: `messageGone`, asked only once the copy failed) is
@@ -12308,18 +12312,27 @@ var Apps = class {
12308
12312
  if (!app && this.ran.has(ref)) fail("not-installed", "This app is not installed");
12309
12313
  if (app) await this.stillRunnable(app, digest);
12310
12314
  }
12311
- /** Writes an app's record, keeping the revocations the record holds now (one kept since the caller read it among them). */
12315
+ /**
12316
+ * Writes an app's record, keeping the revocations the record holds now (one kept since the caller read it among them).
12317
+ * Only while the app has a record: one uninstalled since the caller read it (another tab, Uninstall while Update was
12318
+ * busy) is not put back with its data gone. False: not written.
12319
+ */
12312
12320
  async putApp(app) {
12313
12321
  const tx = (await openDb()).transaction(STORES$1.apps, "readwrite");
12322
+ let put = false;
12314
12323
  const read = tx.objectStore(STORES$1.apps).get(app.ref);
12315
12324
  read.onsuccess = () => {
12316
- tx.objectStore(STORES$1.apps).put(withRevocations(app, read.result?.revocations ?? []));
12325
+ const now = read.result;
12326
+ if (!now) return;
12327
+ tx.objectStore(STORES$1.apps).put(withRevocations(app, now.revocations ?? []));
12328
+ put = true;
12317
12329
  };
12318
12330
  try {
12319
12331
  await done(tx);
12320
12332
  } finally {
12321
12333
  this.held.delete(app.ref);
12322
12334
  }
12335
+ return put;
12323
12336
  }
12324
12337
  /**
12325
12338
  * Writes an app's record back only while it is still the record `was` (`sameRecord`), read and written in one
@@ -13339,7 +13352,7 @@ var Apps = class {
13339
13352
  const read = bytes ? await readAppBundleAsync(bytes) : null;
13340
13353
  if (!read?.ok || read.bundle.digest !== pending.digest) {
13341
13354
  const { pending: _p, ...rest } = installed;
13342
- await this.putApp(rest);
13355
+ if (!await this.putApp(rest)) fail("not-installed", "This app is not installed");
13343
13356
  fail("needs-files", "The update's files are gone; it is fetched again at the next check");
13344
13357
  }
13345
13358
  const stores = await this.stores();
@@ -13354,13 +13367,13 @@ var Apps = class {
13354
13367
  if (plan.action === "refuse") fail(plan.decision, "This update can no longer be installed");
13355
13368
  const added = plan.action === "ask" ? plan.added : [];
13356
13369
  if (added.length !== pending.added.length || added.some((p) => !pending.added.includes(p))) {
13357
- await this.putApp({
13370
+ if (!await this.putApp({
13358
13371
  ...installed,
13359
13372
  pending: {
13360
13373
  ...pending,
13361
13374
  added
13362
13375
  }
13363
- });
13376
+ })) fail("not-installed", "This app is not installed");
13364
13377
  fail("permissions-changed", `This update now adds ${added.length ? added.join(", ") : "no permission"}; look at it again`);
13365
13378
  }
13366
13379
  if (shown && added.some((p) => !shown.includes(p))) fail("permissions-changed", `This update now adds ${added.join(", ")}; look at it again`);
@@ -13614,14 +13627,13 @@ var Apps = class {
13614
13627
  if (held) {
13615
13628
  const kind = await this.writeBundle(app.digest, held.bytes);
13616
13629
  const now = await this.app(app.ref);
13617
- if (!now || now.digest !== app.digest) {
13630
+ if (!now || now.digest !== app.digest || now.bytes !== kind && !await this.putApp({
13631
+ ...now,
13632
+ bytes: kind
13633
+ })) {
13618
13634
  await this.removeBundle(kind, app.digest);
13619
13635
  fail("not-installed", "This app is not installed");
13620
13636
  }
13621
- if (now.bytes !== kind) await this.putApp({
13622
- ...now,
13623
- bytes: kind
13624
- });
13625
13637
  return this.runCheckOf({
13626
13638
  ...now,
13627
13639
  bytes: kind
@@ -13649,14 +13661,13 @@ var Apps = class {
13649
13661
  if (fetched.bundle.digest !== app.digest) continue;
13650
13662
  const kind = await this.writeBundle(app.digest, fetched.bytes);
13651
13663
  const now = await this.app(app.ref);
13652
- if (!now || now.digest !== app.digest) {
13664
+ if (!now || now.digest !== app.digest || now.bytes !== kind && !await this.putApp({
13665
+ ...now,
13666
+ bytes: kind
13667
+ })) {
13653
13668
  await this.removeBundle(kind, app.digest);
13654
13669
  fail("not-installed", "This app is not installed");
13655
13670
  }
13656
- if (now.bytes !== kind) await this.putApp({
13657
- ...now,
13658
- bytes: kind
13659
- });
13660
13671
  return this.runCheckOf({
13661
13672
  ...now,
13662
13673
  bytes: kind
@@ -42484,10 +42495,7 @@ var GhostlyNode = class GhostlyNode {
42484
42495
  this.accepting = true;
42485
42496
  try {
42486
42497
  const { linkId } = await this.joinLink({ inviteCode: request.invite });
42487
- this.renameLink({
42488
- linkId,
42489
- label: request.name
42490
- });
42498
+ const peerNick = sanitizeDisplayText(request.name.trim().replace(/\s+/gu, " "), 48)?.replace(/ {2,}/g, " ");
42491
42499
  const message = `peer_contact_${request.key.slice(0, 32)}`;
42492
42500
  const contactAsker = {
42493
42501
  link: request.link,
@@ -42497,9 +42505,14 @@ var GhostlyNode = class GhostlyNode {
42497
42505
  const live = this.links.get(linkId);
42498
42506
  if (live) live.stored = {
42499
42507
  ...live.stored,
42508
+ peerNick,
42500
42509
  contactAsker
42501
42510
  };
42502
- await db.patchLink(linkId, { contactAsker });
42511
+ await db.patchLink(linkId, {
42512
+ peerNick,
42513
+ contactAsker
42514
+ });
42515
+ this.emitState();
42503
42516
  await this.storeMessage({
42504
42517
  linkId,
42505
42518
  id: message,
@@ -51580,7 +51593,7 @@ var GhostlyNode = class GhostlyNode {
51580
51593
  nativeFactoriesFor(relayOnly) {
51581
51594
  const relay = relayOnly || this.relaysHyperdhtNatively ? this.hyperdhtRelay : "";
51582
51595
  return {
51583
- ...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-BvI_uNZO.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
51596
+ ...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-Bj5jJT5w.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
51584
51597
  ...relayOnly ? {} : this.options.nativeTransports,
51585
51598
  ...this.ownIrohRelays && !relayOnly ? { "iroh/1": (seedB64) => this.options.nativeTransports["iroh/1"](seedB64, this.settings.irohRelays?.length ? { relays: [...this.settings.irohRelays] } : {}) } : {},
51586
51599
  ...this.options.irohWeb ? { "iroh/1": (seedB64) => createIrohWebEndpoint(seedB64, {
@@ -53005,4 +53018,4 @@ function signalKind(signal) {
53005
53018
  //#endregion
53006
53019
  export { EngineServer };
53007
53020
 
53008
- //# sourceMappingURL=server-DdtPxkqI.js.map
53021
+ //# sourceMappingURL=server-rHKhnog1.js.map