@ghostlytools/cli 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/assets/{api-DYMKyb1k.js → api-CVtg7MpI.js} +2 -2
- package/dist/assets/{api-DLzCtePC.js → api-CjOaoG-v.js} +53 -27
- package/dist/assets/api-CjOaoG-v.js.map +1 -0
- package/dist/assets/{apiKit-CVaEzKWQ.js → apiKit-BAGvlQtm.js} +2 -2
- package/dist/assets/{apiKit-CVaEzKWQ.js.map → apiKit-BAGvlQtm.js.map} +1 -1
- package/dist/assets/{appFetch-D56GsYuq.js → appFetch-BwJd-kNq.js} +2 -2
- package/dist/assets/{appFetch-D56GsYuq.js.map → appFetch-BwJd-kNq.js.map} +1 -1
- package/dist/assets/{apps-XnZ8VEuj.js → apps-Cuk45sz5.js} +6 -6
- package/dist/assets/{apps-XnZ8VEuj.js.map → apps-Cuk45sz5.js.map} +1 -1
- package/dist/assets/{apps-BPFW19Wc.js → apps-DjY095Af.js} +1 -1
- package/dist/assets/{backup-COX6j1_W.js → backup-B56sQqoQ.js} +1 -1
- package/dist/assets/{backup-DpyvT9Z6.js → backup-DekVCDWv.js} +47 -8
- package/dist/assets/backup-DekVCDWv.js.map +1 -0
- package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +1 -1
- package/dist/assets/{bitcoind-DTsrd7TF.js → bitcoind-B2bbVSzh.js} +2 -2
- package/dist/assets/{bitcoind-DTsrd7TF.js.map → bitcoind-B2bbVSzh.js.map} +1 -1
- package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +1 -1
- package/dist/assets/{buttons-BvWqHJeh.js → buttons-BGxzOtrq.js} +27 -6
- package/dist/assets/buttons-BGxzOtrq.js.map +1 -0
- package/dist/assets/buttons-CsN2WJOf.js +1 -0
- package/dist/assets/{client-kGZ3ZdUW.js → client-DcQAfc3h.js} +2 -2
- package/dist/assets/{client-kGZ3ZdUW.js.map → client-DcQAfc3h.js.map} +1 -1
- package/dist/assets/{endpoint-B0vE5ojY.js → endpoint-Cvu-taMs.js} +42 -5
- package/dist/assets/{endpoint-B0vE5ojY.js.map → endpoint-Cvu-taMs.js.map} +1 -1
- package/dist/assets/{fixedHosts-CPSsGOI2.js → fixedHosts-C3hBliM9.js} +2 -2
- package/dist/assets/{fixedHosts-CPSsGOI2.js.map → fixedHosts-C3hBliM9.js.map} +1 -1
- package/dist/assets/{groupMeta-DTQAJG50.js → groupMeta-goASqzOt.js} +135 -37
- package/dist/assets/groupMeta-goASqzOt.js.map +1 -0
- package/dist/assets/{host-z0FAHP9Z.js → host-C2WRKj3g.js} +105 -32
- package/dist/assets/host-C2WRKj3g.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-CvsAfQRQ.js → hyperdhtRelay-DLUiwfnt.js} +32 -4
- package/dist/assets/hyperdhtRelay-DLUiwfnt.js.map +1 -0
- package/dist/assets/{irohWeb-CLBx5MIv.js → irohWeb-NfthOL98.js} +178 -9
- package/dist/assets/irohWeb-NfthOL98.js.map +1 -0
- package/dist/assets/{main-CVqkvuIo.js → main-Dh7fePd8.js} +49 -32
- package/dist/assets/main-Dh7fePd8.js.map +1 -0
- package/dist/assets/{mainline-CVrd0C1n.js → mainline-DY95WbuK.js} +2 -2
- package/dist/assets/{mainline-CVrd0C1n.js.map → mainline-DY95WbuK.js.map} +1 -1
- package/dist/assets/{ownDid-DY3rYqDI.js → ownDid-BErplN7N.js} +2 -2
- package/dist/assets/{ownDid-DY3rYqDI.js.map → ownDid-BErplN7N.js.map} +1 -1
- package/dist/assets/{ownStatus-DMEhrpkd.js → ownStatus-ClrFjd7h.js} +5 -3
- package/dist/assets/ownStatus-ClrFjd7h.js.map +1 -0
- package/dist/assets/{profiles-BFSGqDFC.js → profiles-B8xO8-oj.js} +2 -2
- package/dist/assets/{profiles-BFSGqDFC.js.map → profiles-B8xO8-oj.js.map} +1 -1
- package/dist/assets/{registry-B15Yg_1C.js → registry--Rg2YvOH.js} +1 -1
- package/dist/assets/{registry-rXgaZeNn.js → registry-CU8PevhI.js} +38 -30
- package/dist/assets/registry-CU8PevhI.js.map +1 -0
- package/dist/assets/{relay-Cjfmdec0.js → relay-CHWg5hpZ.js} +73 -11
- package/dist/assets/relay-CHWg5hpZ.js.map +1 -0
- package/dist/assets/{resolve-CIc3KZMV.js → resolve-B1upovPM.js} +2 -2
- package/dist/assets/{resolve-CIc3KZMV.js.map → resolve-B1upovPM.js.map} +1 -1
- package/dist/assets/secretGuard-Bm6nci0I.js +1 -0
- package/dist/assets/{secretGuard-B4-LlMjv.js → secretGuard-BrATm_gl.js} +33 -9
- package/dist/assets/{secretGuard-B4-LlMjv.js.map → secretGuard-BrATm_gl.js.map} +1 -1
- package/dist/assets/{server-CQR7NLCz.js → server-Dgxx_DaN.js} +473 -60
- package/dist/assets/server-Dgxx_DaN.js.map +1 -0
- package/dist/assets/{waitNotice-BGM0QOS2.js → waitNotice-ylU3XwjO.js} +2 -2
- package/dist/assets/{waitNotice-BGM0QOS2.js.map → waitNotice-ylU3XwjO.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/assets/api-DLzCtePC.js.map +0 -1
- package/dist/assets/backup-DpyvT9Z6.js.map +0 -1
- package/dist/assets/buttons-Bq7pTXqF.js +0 -1
- package/dist/assets/buttons-BvWqHJeh.js.map +0 -1
- package/dist/assets/groupMeta-DTQAJG50.js.map +0 -1
- package/dist/assets/host-z0FAHP9Z.js.map +0 -1
- package/dist/assets/hyperdhtRelay-CvsAfQRQ.js.map +0 -1
- package/dist/assets/irohWeb-CLBx5MIv.js.map +0 -1
- package/dist/assets/main-CVqkvuIo.js.map +0 -1
- package/dist/assets/ownStatus-DMEhrpkd.js.map +0 -1
- package/dist/assets/registry-rXgaZeNn.js.map +0 -1
- package/dist/assets/relay-Cjfmdec0.js.map +0 -1
- package/dist/assets/secretGuard-BmmnEbYf.js +0 -1
- package/dist/assets/server-CQR7NLCz.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { $ as beaconRecords, $a as
|
|
1
|
+
import { $ as beaconRecords, $a as INVITE_HRP, $i as REQUEST_LIFETIME_MS, $n as readReaction, $r as verifyCommitSignature, $t as APP_RANGE_LIMITS, Aa as appFingerprint, Ai as parseLocalTarget, An as fileMessageText, Ar as arrivalKey, Bn as dhtEditId, Br as OWN_FRAME_LIMIT, Bt as WAKE_INTERVAL_MS, C as PAIRED_FRAME_TOO_LARGE, Ci as PRESENCE_WINDOW, Cn as sanitizeFileName, Ct as personStatus, D as GROUP_FILE_LIMITS, Da as sha256Paced, Di as GhostlyHttpError, Dr as statusCardBytes, E as pairedMessageFrame, Ea as readAppBundleAsync, Ei as presenceSeenAt, Er as sameButtonText, Fa as isAppKey, Fn as EDIT_BUFFER_MS, Fr as GROUP_ADMIN_OFF_ERROR, Ft as nextPinNumber, G as MESH_HUBS, Gi as parseCallSignal, Gn as COMMUNITY_REACTION_FRAME, Gr as parseGroupCommit, Gt as deviceWakeRequest, Hn as validRemovalNumber, Hr as commitHash, Ht as WAKE_ONLINE_DELAY_MS, In as EDIT_RATE_WINDOW_MS, Ir as GROUP_ID, It as pinIsNewer, J as meshHubs, Ja as parseImageMeta, Ji as HTTP_SERVICE_PROTO, Jn as ReactionWindow, Jr as rosterHas, Jt as relayRequest, K as NO_HUB_POLICY, Kn as GROUP_REACTION_FRAME, Kr as rememberAlone, Kt as newWakeToken, La as isAppRef, Ln as MAX_REMOVAL_NUMBER, Lr as GROUP_MEMBER_CAP, Lt as pinNumberHolds, M as groupFileFallback, Ma as appRefPublisher, Mi as LIMITS, Mr as heardTime, Mt as GROUP_PIN_FRAME, Ni as decodeControl, Nr as receivedTimestamp, Nt as PIN_LIMITS, O as GROUP_HAVE_FRAME, Or as statusCardText, Ot as TypingReceiver, P as readGroupFileMeta, Pa as isAppHash, Pi as encodeControl, Pn as parseVideoMeta, Pr as shownTime, Pt as mayPin, Q as beaconKeys, Qa as readCanonicalJson, Qi as ContactRequestError, Qn as reactionIsNewer, Qr as verifyCommit, Qt as vapidKeysMatch, R as CarriedTransport, Ra as readAppRevocation, Ri as RTC_CONFIG, Rn as REMOVED_TEXT, Rt as readPin, S as LIVENESS_PING_MS, Sn as formatFileSize, St as liveStatus, T as pairedMessageFits, Ti as WATCH_PEER_MS, Tr as readStatusCard, Tt as TYPING_FRAME, U as groupSignalFrame, Ui as contactRtcConfig, Un as forwardedAgain, Ur as commitUntaggedHash, Vn as validEditNumber, Vr as SAID_AGAIN, Vt as WAKE_ONLINE_BATCH_MS, W as readGroupSignal, Wn as readForwarded, Wr as expectedRoster, Wt as WakeLimiter, X as pickMeshHubs, Xa as canonicalJson, Xi as MAX_SHARED_APPS, Xn as queueReaction, Xr as sortRoster, Xt as wakeRequest, Y as meshRendezvous, Yi as LEGACY_SERVICES, Yn as nextReactionNumber, Yr as signCommit, Yt as wakeFrame, Z as COMMUNITY_TOPOLOGY, Za as canonicalJsonBytes, Zi as serviceIdFromName, Zn as reactionEmoji, Zr as verifyChain, Zt as checkPushEndpoint, _ as signGroupMeta, _i as ratchetSessionOf, _o as newDeviceSetSecret, _t as sentWhole, a as groupMetaChange, aa as knockSlotOf, ai as encryptText, an as BUTTONS_CAPABILITY, ao as inviteLink, ar as readReply, at as mergeBeacon, b as GhostLink, bn as DHT_FILE_CAPABILITY, c as groupMetaTag, ca as makeStampPaced, ci as newEpochSecret, cn as UPGRADE_CAPABILITY, co as pastedAgain, cr as BUTTON_ID, ct as pickHubs, d as keepPastGroupMeta, da as readKnockSlot, di as sealPair, dn as capsDescriptors, do as HANDOFF_CAPABILITY, dt as readBeaconHead, ea as contactAskerFrame, ei as GROUP_PROFILE, en as isServeId, eo as INVITE_MAX_LENGTH, er as validReactionNumber, et as doorHubs, f as nextGroupMetaRevision, fa as readLinkRecord, fi as sealSecret, fn as dialDescriptors, fo as deviceEchoFrame, ft as readLobby, g as parseGroupMetaTag, ga as APP_BUNDLE_MAGIC, gi as emptyRatchetState, go as devicePingFrame, gr as STATUS_CARD_LIMITS, h as parseGroupMetaFrame, ha as APP_BUNDLE_LIMITS, hi as RatchetBox, hn as validExternalKey, ho as deviceLinkPairing, ht as FILE_LIMITS, i as groupMetaBody, ia as knockSlotIdentity, ii as edgeParams, in as APPS_CAPABILITY, io as encodeInviteCode, ir as pairedReplyAuthor, it as lobbyRecords, ja as appRef, ji as webLocalFetch, jn as parseVoiceMeta, jr as claimedTime, jt as typingActivity, ka as APP_STATEMENT_LIMITS, ki as formatLocalTarget, kt as TypingSender, l as groupMetaToHand, la as mergeContactKnocks, li as openPair, ln as CapsExchange, lo as DEVICES_CAPABILITY, lt as rankHubs, m as parseGroupMetaBody, ma as seenEntry, mi as RATCHET_CAPABILITY, mn as emptyProofLedger, mo as deviceKeyZ32, mt as ChatFiles, na as contactDay, ni as confirmationTag, nn as chatAppId, no as createChatInvite, nr as REPLY_LIMITS, nt as hubRank, o as groupMetaNewer, oa as knockSlotRecords, oi as epochKeys, on as EDIT_CAPABILITY, oo as inviteOwnership, or as replySnippet, ot as mergeLobby, p as openGroupMeta, pa as requestRecords, pi as sha256Hex, pn as PeerProofs, po as deviceEchoNonce, pt as shouldBeHub, q as mayBeHub, qi as emptyLinkRecords, qn as REACTION_LIMITS, qr as rosterAdmin, qt as parseWakeFrame, r as groupDisplayName, ra as knockHolds, ri as decryptText, rn as isAppVersion, ro as decodeInviteCode, rr as groupReplyAuthor, rt as lobbyKeys, s as groupMetaPicture, sa as linkRecords, si as groupCallKey, sn as STATUS_CARD_CAPABILITY, sr as wireReply, st as newerHead, t as encodeGroupMetaBody, ta as contactAskerHolds, ti as confirmationMatches, to as OwnInviteError, tr as wireReaction, tt as freshHubs, u as groupName, ua as openRequest, ui as openSecret, un as DHT_TEXT_CAPABILITY, uo as ENROLL_CAPABILITY, ut as readBeacon, v as verifyGroupMetaSignature, va as appDigest, vi as DirectPathWatch, vn as DHT_MESSAGE_TTL, vt as transferEnded, w as pairedEditFits, wa as pacer, wi as RELAY_POLL_INTERVALS, wn as sanitizeMime, wr as checkStatusCard, x as INVITE_TAKEN, xi as DHT_POLL_INTERVALS, xn as dhtFileId, xr as cardEditNumber, xt as STATUS_IDLE_AFTER_MS, y as wrapGroupMeta, ya as appViewOf, yn as peekDhtMailbox, yt as transferStalled, za as readAppRevocationShape, zn as RateWindow, zr as MEMBER_KEY, zt as WAKE_CALL_INTERVAL_MS } from "./groupMeta-goASqzOt.js";
|
|
2
2
|
import { _ as receivedIdentityStatus, d as emptyIdentityLedger, y as lastSharedWithMe } from "./identityProofs-Cksc_K7_.js";
|
|
3
3
|
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-ewvbqyDI.js";
|
|
4
4
|
import { c as fileSpace, f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf, u as removeFileBytes } from "./fileBytes-CfvUXdSy.js";
|
|
5
5
|
import { a as sealSeed, c as openRow, d as sealRow, f as sealedStore, g as whenDataKeyDropped, h as sealSecret$1, i as newDeviceKey, l as openRows, m as openSecret$1, o as unsealSeed, p as hasDataKey, r as intentRepository, s as RowSeals, u as proofKey } from "./networkReason-Be-hMghr.js";
|
|
6
|
-
import { $ as lightningPaying, A as paymentNetworksOf, At as mergeKnocks, B as removeStored, Bt as validEditText, C as paymentWireId, Ct as setSingleWriterGate, D as createTiming, Dt as entryParams, E as createFailure, Et as encodeGroupEntryLink, F as copyForForward, Ft as carryMentions, G as IdentityProofs, Gt as wireMentions, H as streamStored, Ht as mentionsBytes, I as forwardError, It as communityEditFrame, J as cardsKey, K as CASHU_CARD, L as forwardKind, Lt as communityMessageAuthor, N as WALLET_TYPES, Nt as GROUP_EDIT_FRAME, O as crossNetwork, Ot as knockIdentity, P as FORWARD_MESSAGE_GONE, Pt as GROUP_EDIT_TEXT_BYTES, Q as journaledPayment, R as FileAppender, Rt as meshMessageRef, S as paymentAlias, St as setAwayWallets, T as assertConfirmedReal, Tt as decodeGroupEntryLink, Ut as mentionsMember, V as storedSize, Vt as MENTION_LIMITS, Wt as validMentions, X as breez, Y as BREEZ_SOURCE, Z as normalizePhrase, _ as groupReply, _t as WrongNetworkError, at as cashuMint, b as replyRef, bt as refuseAway, ct as loadBreezSdk, d as parsePayLink, dt as breezDatabasesFor, et as INVOICE_PACE, f as GroupFileDesk, ft as iceServerProblem, g as storedGroupFiles, gt as ModeGate, h as groupOfFile, ht as ModeChanged, i as onPublicIrohRelay, it as CASHU_MINT_SOURCE, j as walletInstances, jt as readKnocks, k as paymentNetwork, kt as knockRecords, l as groupLinkId, lt as openBreez, m as groupFileText, mt as relayOnlyProblem, n as createIrohWebEndpoint, nt as ProviderSources, o as groupPayLineId, ot as AskBackoff, p as groupFileId, pt as iceServerSetting, q as LightningCards, r as irohRelayProblem, rt as sourceKey, st as forgetBreez, t as DEFAULT_IROH_RELAYS, tt as nextInvoiceAsk, u as pairLinkId, ut as breezDatabaseInUse, v as pairedWireReply, vt as networkLabel, w as WALLET_NAMES, x as replyTo, xt as requireTurn, y as receivedPairedReply, yt as awayFrom, z as readStored$2, zt as parseCommunityEdit } from "./irohWeb-
|
|
6
|
+
import { $ as lightningPaying, A as paymentNetworksOf, At as mergeKnocks, B as removeStored, Bt as validEditText, C as paymentWireId, Ct as setSingleWriterGate, D as createTiming, Dt as entryParams, E as createFailure, Et as encodeGroupEntryLink, F as copyForForward, Ft as carryMentions, G as IdentityProofs, Gt as wireMentions, H as streamStored, Ht as mentionsBytes, I as forwardError, It as communityEditFrame, J as cardsKey, K as CASHU_CARD, L as forwardKind, Lt as communityMessageAuthor, N as WALLET_TYPES, Nt as GROUP_EDIT_FRAME, O as crossNetwork, Ot as knockIdentity, P as FORWARD_MESSAGE_GONE, Pt as GROUP_EDIT_TEXT_BYTES, Q as journaledPayment, R as FileAppender, Rt as meshMessageRef, S as paymentAlias, St as setAwayWallets, T as assertConfirmedReal, Tt as decodeGroupEntryLink, Ut as mentionsMember, V as storedSize, Vt as MENTION_LIMITS, Wt as validMentions, X as breez, Y as BREEZ_SOURCE, Z as normalizePhrase, _ as groupReply, _t as WrongNetworkError, at as cashuMint, b as replyRef, bt as refuseAway, ct as loadBreezSdk, d as parsePayLink, dt as breezDatabasesFor, et as INVOICE_PACE, f as GroupFileDesk, ft as iceServerProblem, g as storedGroupFiles, gt as ModeGate, h as groupOfFile, ht as ModeChanged, i as onPublicIrohRelay, it as CASHU_MINT_SOURCE, j as walletInstances, jt as readKnocks, k as paymentNetwork, kt as knockRecords, l as groupLinkId, lt as openBreez, m as groupFileText, mt as relayOnlyProblem, n as createIrohWebEndpoint, nt as ProviderSources, o as groupPayLineId, ot as AskBackoff, p as groupFileId, pt as iceServerSetting, q as LightningCards, r as irohRelayProblem, rt as sourceKey, st as forgetBreez, t as DEFAULT_IROH_RELAYS, tt as nextInvoiceAsk, u as pairLinkId, ut as breezDatabaseInUse, v as pairedWireReply, vt as networkLabel, w as WALLET_NAMES, x as replyTo, xt as requireTurn, y as receivedPairedReply, yt as awayFrom, z as readStored$2, zt as parseCommunityEdit } from "./irohWeb-NfthOL98.js";
|
|
7
7
|
import { C as cashuRequestPayload, D as parseCashuRequestPayload, E as isFederationId, O as parseFedimintRequestPayload, S as ENDPOINT, T as findEndpoint, _ as SPARK_NETWORKS, a as SEPOLIA_TEST_USDT, b as sparkInvoiceDetails, c as USDT_PUBLIC_RPC, d as assertTokenUnits, f as assertWholeSats, g as walletNetworkOf, h as validatePaymentTarget, i as PaymentPreflightError, l as WALLET_NETWORKS, n as EVM_TEST_CHAINS, p as formatPaymentAmount, r as ONCHAIN_PROVIDER, s as TEST_USDT_FAUCET_AMOUNT, t as ETHEREUM_USDT, u as arkAddressPrefix, v as SPARK_PROVIDER, w as fedimintRequestPayload, x as isBitcoinAddress, y as sparkAddressKind } from "./paymentIntent-DySU3Ajm.js";
|
|
8
8
|
import { a as decodeBolt11, t as nwc } from "./nwcProvider-pL2XqSbW.js";
|
|
9
9
|
import { i as parseEngineError, n as engineError, r as engineText, t as EngineError } from "./engineErrors--9hfgKlK.js";
|
|
10
10
|
import { r as loadFedimintSdk, t as fedimintDatabase } from "./fedimintSdk-D-6H9Pe7.js";
|
|
11
11
|
import { i as SourceUnreachableError, n as PROVIDER_PLATFORMS, o as isNothingSpentError, r as SourceConfigError, t as NothingSpentError, u as redact } from "./types-CdWwgvyt.js";
|
|
12
12
|
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-CMDLbMeH.js";
|
|
13
|
-
import { a as registeredLightningProviders, b as isPubkyKey, c as boundedIdentityFetch, d as testSwitch, g as encodeDidDhtPacket, h as encodeDidDhtDeactivated, m as didDhtFromPublicKey, n as setOwnDidSource, o as registeredOnchainProviders, p as didDhtDocument, r as onAdaptersChanged, s as reserveAdapterIds, u as testBuild, v as signDidDhtPacket } from "./ownDid-
|
|
13
|
+
import { a as registeredLightningProviders, b as isPubkyKey, c as boundedIdentityFetch, d as testSwitch, g as encodeDidDhtPacket, h as encodeDidDhtDeactivated, m as didDhtFromPublicKey, n as setOwnDidSource, o as registeredOnchainProviders, p as didDhtDocument, r as onAdaptersChanged, s as reserveAdapterIds, u as testBuild, v as signDidDhtPacket } from "./ownDid-BErplN7N.js";
|
|
14
14
|
import { S as verify, _ as identityFromSeed, a as createRelayPayload, c as openRelayPayload, d as signRelayPayload, f as decodeDnsAnswers, g as createIdentity, m as encodeTxtPacket, p as decodeTxtPacket, r as PacketTooLargeError, v as identityFromSeedB64, x as sign, y as publicKeyFromZ32 } from "./pkarr-BQo4PcCg.js";
|
|
15
|
-
import { c as normalizeRelayUrl, d as traceLink, g as withRequestOptions, i as RelayTransport, m as isDiscoveryBudgetError, p as budgetRetryMs, s as currentRelays, t as DEFAULT_RELAYS } from "./relay-
|
|
15
|
+
import { c as normalizeRelayUrl, d as traceLink, g as withRequestOptions, i as RelayTransport, m as isDiscoveryBudgetError, p as budgetRetryMs, s as currentRelays, t as DEFAULT_RELAYS } from "./relay-CHWg5hpZ.js";
|
|
16
16
|
import { a as stripHidden, i as sanitizeNick, n as hasVisible, r as sanitizeDisplayText, s as unwrapPasted, t as dropLoneJoiners } from "./text-li76pThX.js";
|
|
17
17
|
import { a as fromZ32, d as utf8Decode, f as utf8Encode, i as fromBase64Url, l as toBase64Url, n as concatBytes$1, o as isZ32Key, s as randomBytes, t as bytesEqual, u as toZ32 } from "./bytes-C1DNGY18.js";
|
|
18
18
|
import { C as generateEncryptionKey, _ as HoldKeys, b as newMailbox, g as HOLD_LIMITS, h as HOLD_DATED_BACK_MS, i as automaticTransport, m as HOLD_CAPABILITY, r as TRANSPORTS, v as HoldRefusedError, x as readManifest, y as isHoldUrl } from "./pairedTransports-BKmvlKz1.js";
|
|
19
19
|
import { i as parseLinkPreview, o as sanitizeAvatar } from "./linkPreview-DdMf-YAc.js";
|
|
20
|
-
import { C as normalizeAtprotoHandle, S as isAtprotoDid, d as chosenResolver, m as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer } from "./resolve-
|
|
21
|
-
import { S as webCryptoSigner, a as besideUrl, c as isGitHubPage, d as appStoreDecision, f as appUpdateDecision, h as APP_STORE_LIMITS, i as appPasteUrl, l as addedAppPermissions, m as planAppUpdate, n as APP_FETCH_LIMITS, o as boundedAppFetch, p as checkAppBeforeRun, r as AppFetchError, s as isAppFetchUrl, u as appRevocationFor, v as readAppStoreSteps, x as seedSigner } from "./appFetch-
|
|
20
|
+
import { C as normalizeAtprotoHandle, S as isAtprotoDid, d as chosenResolver, m as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer } from "./resolve-B1upovPM.js";
|
|
21
|
+
import { S as webCryptoSigner, a as besideUrl, c as isGitHubPage, d as appStoreDecision, f as appUpdateDecision, h as APP_STORE_LIMITS, i as appPasteUrl, l as addedAppPermissions, m as planAppUpdate, n as APP_FETCH_LIMITS, o as boundedAppFetch, p as checkAppBeforeRun, r as AppFetchError, s as isAppFetchUrl, u as appRevocationFor, v as readAppStoreSteps, x as seedSigner } from "./appFetch-BwJd-kNq.js";
|
|
22
22
|
import { n as traceJoin } from "./joinTrace-xKBe73j9.js";
|
|
23
23
|
import { n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-Bi2kMqbp.js";
|
|
24
24
|
import { t as hyperdhtRelayProblem } from "./hyperdhtRelay-bjNGacf5.js";
|
|
@@ -1914,6 +1914,11 @@ var ANSWER_WINDOW_MS$1 = 5e3;
|
|
|
1914
1914
|
*/
|
|
1915
1915
|
var UNNAMED_KEPT_MS = 6e4;
|
|
1916
1916
|
/**
|
|
1917
|
+
* After the admin role moved to me: how long I still take the statement of the admin I took it from (WISP 902
|
|
1918
|
+
* § Metadata), one that was on its way while the commit reached me first. Past it, only the admin's is taken, as for anyone.
|
|
1919
|
+
*/
|
|
1920
|
+
var GROUP_TAKEOVER_META_MS = 6e5;
|
|
1921
|
+
/**
|
|
1917
1922
|
* One member's messages (or edits) taken: its whole log handed back at once twice over (`AUTHOR_BURST`: an edge opening
|
|
1918
1923
|
* hears it, with what the member says live beside it, and the edits its app says again), then
|
|
1919
1924
|
* `GROUP_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`, as a community's `MessagePace`.
|
|
@@ -2363,6 +2368,13 @@ var GroupSession = class {
|
|
|
2363
2368
|
queue = Promise.resolve();
|
|
2364
2369
|
/** Metadata frames that name a commit or an epoch I do not have yet, one signed by the admin and one by anyone else (`waitMeta`): tried again when the chain moves. */
|
|
2365
2370
|
pendingMeta = {};
|
|
2371
|
+
/** The admin as of the last `metaFollowsChain`. In memory only. */
|
|
2372
|
+
adminSeen;
|
|
2373
|
+
/**
|
|
2374
|
+
* After the admin role moved to me (`metaFollowsChain`): whom from, until when I take their statement, and the last
|
|
2375
|
+
* one of theirs I signed again (what I held then, until one of theirs comes). In memory only.
|
|
2376
|
+
*/
|
|
2377
|
+
takeover;
|
|
2366
2378
|
/** While `handle` runs: the frames it took that a hub passes on (`handle`'s result). */
|
|
2367
2379
|
passOn = null;
|
|
2368
2380
|
/** The frames kept to hand on that the app holds with its messages, oldest first; undefined when the state holds them all. */
|
|
@@ -2440,6 +2452,7 @@ var GroupSession = class {
|
|
|
2440
2452
|
this.provisional = new Set((state.provisional ?? []).slice(-GROUP_LIMITS.provisional));
|
|
2441
2453
|
for (const [key, record] of Object.entries(state.names ?? {})) this.nickAt.set(key, record.v);
|
|
2442
2454
|
this.chainMovedAt = this.clock();
|
|
2455
|
+
this.adminSeen = this.admin;
|
|
2443
2456
|
}
|
|
2444
2457
|
clock() {
|
|
2445
2458
|
return this.hooks.clock?.() ?? Date.now();
|
|
@@ -2857,6 +2870,7 @@ var GroupSession = class {
|
|
|
2857
2870
|
this.requireAdmin();
|
|
2858
2871
|
if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey) throw new Error("Not a member");
|
|
2859
2872
|
await this.commit("remove", memberKey, now, left);
|
|
2873
|
+
if (!left && memberKey === this.takeover?.from) this.takeover = void 0;
|
|
2860
2874
|
});
|
|
2861
2875
|
}
|
|
2862
2876
|
transferAdmin(memberKey, now = Date.now()) {
|
|
@@ -4451,8 +4465,10 @@ var GroupSession = class {
|
|
|
4451
4465
|
/**
|
|
4452
4466
|
* Signs a body under my current commit, keeps it and sends it to every member. Inside `serialize`. Like a commit, only
|
|
4453
4467
|
* with admin work on and a good turn read (WISP 06 § Forced takeover): refused otherwise, or, `quiet`, not made.
|
|
4468
|
+
* `taken`: a former admin's statement signed again (`signAgainTaken`): the line credits them, and the one held is not
|
|
4469
|
+
* kept to hand on when it was no change (an older statement signed again).
|
|
4454
4470
|
*/
|
|
4455
|
-
async publishMeta(body, now, quiet = false) {
|
|
4471
|
+
async publishMeta(body, now, quiet = false, taken) {
|
|
4456
4472
|
const refused = this.hooks.adminWork?.() === false ? new Error(GROUP_ADMIN_OFF_ERROR) : this.hooks.adminTurn && !await this.hooks.adminTurn() ? engineError("groupTurnUnconfirmed") : void 0;
|
|
4457
4473
|
if (refused) {
|
|
4458
4474
|
if (quiet) return;
|
|
@@ -4467,7 +4483,7 @@ var GroupSession = class {
|
|
|
4467
4483
|
ts: now
|
|
4468
4484
|
}, body, this.identity.seed, this.myKey);
|
|
4469
4485
|
this.state.meta = meta;
|
|
4470
|
-
this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
|
|
4486
|
+
if (!taken?.replaces) this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
|
|
4471
4487
|
await this.persist();
|
|
4472
4488
|
const secret = this.secret(this.epoch);
|
|
4473
4489
|
if (secret) {
|
|
@@ -4475,7 +4491,7 @@ var GroupSession = class {
|
|
|
4475
4491
|
for (const key of this.others) this.hooks.send(key, frame);
|
|
4476
4492
|
}
|
|
4477
4493
|
const change = groupMetaChange(before, meta, this.state.name);
|
|
4478
|
-
if (change) this.hooks.metaChanged?.(this.myKey, change, meta.ts);
|
|
4494
|
+
if (change) this.hooks.metaChanged?.(taken?.by ?? this.myKey, change, meta.ts);
|
|
4479
4495
|
this.hooks.changed();
|
|
4480
4496
|
}
|
|
4481
4497
|
/** My statement, to a member whose sync says it holds an older one (or none); nothing to an app that says nothing. */
|
|
@@ -4495,19 +4511,20 @@ var GroupSession = class {
|
|
|
4495
4511
|
/**
|
|
4496
4512
|
* A metadata statement: kept when it is newer than mine, its commit is on my chain, its signer was
|
|
4497
4513
|
* the admin of that commit and is the admin now, its signature holds, and it opens under the epoch
|
|
4498
|
-
* it names into metadata Ghostly shows. One naming what I do not have yet waits for the chain.
|
|
4514
|
+
* it names into metadata Ghostly shows. One naming what I do not have yet waits for the chain. Just after the admin
|
|
4515
|
+
* role moved to me, the former admin's is signed again as mine (`takesOver`).
|
|
4499
4516
|
*/
|
|
4500
4517
|
async receiveMeta(from, raw) {
|
|
4501
4518
|
const frame = parseGroupMetaFrame(raw);
|
|
4502
4519
|
if (!frame || frame.statement.g !== this.id || typeof frame.k !== "number" || !rosterHas(this.roster, from)) return;
|
|
4503
|
-
const s = frame.statement;
|
|
4504
|
-
if (!groupMetaNewer(s, this.state.meta)) return;
|
|
4520
|
+
const s = frame.statement, taking = this.takesOver(s);
|
|
4521
|
+
if (!taking && !groupMetaNewer(s, this.state.meta)) return;
|
|
4505
4522
|
if (s.e > this.epoch || frame.k > this.epoch) {
|
|
4506
4523
|
this.waitMeta(from, raw, s);
|
|
4507
4524
|
return;
|
|
4508
4525
|
}
|
|
4509
4526
|
const commit = this.state.chain[s.e];
|
|
4510
|
-
if (commitHash(commit) !== s.h || rosterAdmin(commit.m) !== s.by || this.admin !== s.by || !verifyGroupMetaSignature(s)) return;
|
|
4527
|
+
if (commitHash(commit) !== s.h || rosterAdmin(commit.m) !== s.by || !taking && this.admin !== s.by || !verifyGroupMetaSignature(s)) return;
|
|
4511
4528
|
const secret = this.secret(frame.k);
|
|
4512
4529
|
if (!secret) {
|
|
4513
4530
|
this.waitMeta(from, raw, s);
|
|
@@ -4515,6 +4532,10 @@ var GroupSession = class {
|
|
|
4515
4532
|
}
|
|
4516
4533
|
const opened = openGroupMeta(frame, epochKeys(secret, this.id, frame.k).message);
|
|
4517
4534
|
if (!opened) return;
|
|
4535
|
+
if (taking) {
|
|
4536
|
+
await this.signAgainTaken(opened.meta, opened.body);
|
|
4537
|
+
return;
|
|
4538
|
+
}
|
|
4518
4539
|
const before = this.state.meta;
|
|
4519
4540
|
this.state.meta = opened.meta;
|
|
4520
4541
|
this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, opened.meta);
|
|
@@ -4531,6 +4552,37 @@ var GroupSession = class {
|
|
|
4531
4552
|
});
|
|
4532
4553
|
}
|
|
4533
4554
|
/**
|
|
4555
|
+
* Whether I take a statement though its signer is no longer the admin (WISP 902 § Metadata): I am the admin since
|
|
4556
|
+
* moments ago, they were the admin before me, and it is later than the one of theirs I signed again. A member who had
|
|
4557
|
+
* not synced when the role moved to them signed again what they held (or nothing), and the statement on its way would
|
|
4558
|
+
* be refused for good: their next rename, picture or hubs change would then be built on the older body.
|
|
4559
|
+
*/
|
|
4560
|
+
takesOver(s) {
|
|
4561
|
+
const t = this.takeover;
|
|
4562
|
+
return !!t && this.isAdmin && s.by === t.from && this.clock() <= t.until && groupMetaNewer(s, t.base);
|
|
4563
|
+
}
|
|
4564
|
+
/**
|
|
4565
|
+
* The former admin's statement, taken (`takesOver`): signed again as mine, each field I changed since keeping my
|
|
4566
|
+
* value. Dated as theirs, and credited to them, when I changed nothing; what I held was then no change to hand on.
|
|
4567
|
+
*/
|
|
4568
|
+
async signAgainTaken(meta, theirs) {
|
|
4569
|
+
const t = this.takeover, base = groupMetaBody(t.base), mine = groupMetaBody(this.state.meta);
|
|
4570
|
+
t.base = meta;
|
|
4571
|
+
const pick = (k) => JSON.stringify(mine[k]) === JSON.stringify(base[k]) ? theirs[k] : mine[k];
|
|
4572
|
+
const body = encodeGroupMetaBody({
|
|
4573
|
+
name: pick("name"),
|
|
4574
|
+
pic: pick("pic"),
|
|
4575
|
+
hubs: pick("hubs"),
|
|
4576
|
+
call: pick("call")
|
|
4577
|
+
});
|
|
4578
|
+
if (body === this.state.meta?.body) return;
|
|
4579
|
+
const changed = encodeGroupMetaBody(mine) !== encodeGroupMetaBody(base);
|
|
4580
|
+
await this.publishMeta(body, changed ? this.clock() : meta.ts, true, {
|
|
4581
|
+
by: meta.by,
|
|
4582
|
+
replaces: !changed
|
|
4583
|
+
});
|
|
4584
|
+
}
|
|
4585
|
+
/**
|
|
4534
4586
|
* A statement that waits for the chain: only one its signer signed, so an altered copy cannot push out the one
|
|
4535
4587
|
* waiting. The admin I know has a place of their own, which another member's statement cannot take, and in each
|
|
4536
4588
|
* place only a later statement takes the one waiting.
|
|
@@ -4562,6 +4614,15 @@ var GroupSession = class {
|
|
|
4562
4614
|
}
|
|
4563
4615
|
/** After the chain or my secrets moved: the waiting statement, and, if I became the admin, the name and picture signed again as mine. */
|
|
4564
4616
|
async metaFollowsChain() {
|
|
4617
|
+
if (this.admin !== this.adminSeen) {
|
|
4618
|
+
const from = this.adminSeen;
|
|
4619
|
+
this.takeover = this.isAdmin && from && from !== this.myKey ? {
|
|
4620
|
+
from,
|
|
4621
|
+
until: this.clock() + GROUP_TAKEOVER_META_MS,
|
|
4622
|
+
base: this.state.meta
|
|
4623
|
+
} : void 0;
|
|
4624
|
+
this.adminSeen = this.admin;
|
|
4625
|
+
}
|
|
4565
4626
|
const { admin, other } = this.pendingMeta;
|
|
4566
4627
|
this.pendingMeta = {};
|
|
4567
4628
|
for (const pending of [admin, other]) if (pending) await this.receiveMeta(pending.from, pending.frame);
|
|
@@ -4735,6 +4796,8 @@ var COMMUNITY_LIMITS = {
|
|
|
4735
4796
|
chainPiece: 100,
|
|
4736
4797
|
/** Admissions members other than the admin may commit in a row while the admin is away (`memberAdmissions`). */
|
|
4737
4798
|
memberAdmissions: 32,
|
|
4799
|
+
/** Commits back in which a leave of a key a member let in counts against `memberAdmissions`, the admin there or not. */
|
|
4800
|
+
memberLeaves: 256,
|
|
4738
4801
|
pendingLeaves: 64,
|
|
4739
4802
|
/** Leaves whose mark (`group-left`) is kept, and the epochs one names. */
|
|
4740
4803
|
leftMarks: 64,
|
|
@@ -4773,6 +4836,11 @@ var COMMUNITY_LIMITS = {
|
|
|
4773
4836
|
* frame of the answer keeps it open, since it goes a slice at a time. As a private group's.
|
|
4774
4837
|
*/
|
|
4775
4838
|
var ANSWER_WINDOW_MS = 5e3;
|
|
4839
|
+
/**
|
|
4840
|
+
* After the admin role moved to me: how long I still take the statement of the admin I took it from (WISP 903
|
|
4841
|
+
* § Metadata), one that was on its way while the commit reached me first. Past it, condition 4 holds as for anyone.
|
|
4842
|
+
*/
|
|
4843
|
+
var COMMUNITY_TAKEOVER_META_MS = 6e5;
|
|
4776
4844
|
/** What every member should know about who can read what, and what the link does, in the words the apps show. */
|
|
4777
4845
|
var GROUP_READ_NOTE_COMMUNITY = `Anyone with the group's link can join, and any member can let people in. Everyone in the group can read everything sent while they are a member; someone removed cannot read what comes after, someone who joins later cannot read what came before. Members who were away get the last ${COMMUNITY_LIMITS.store} messages from whoever is there when they return.`;
|
|
4778
4846
|
/** A community group's link: `group2/<group id>/<entry key>` (web: `#/join/group2/…`). */
|
|
@@ -4845,12 +4913,21 @@ var ADMIN_ONLY = /* @__PURE__ */ new Set([
|
|
|
4845
4913
|
* the admin clears keys let in would otherwise make room for as many more each time. An admission is a member's
|
|
4846
4914
|
* right, and costs nothing: a key nobody holds is as good as anyone's, so without a bound one member could fill the
|
|
4847
4915
|
* group to its cap in seconds. `COMMUNITY_LIMITS.memberAdmissions` in a row, then the admin's turn.
|
|
4916
|
+
* A leave among the last `COMMUNITY_LIMITS.memberLeaves` commits that ends an admission a member other than the admin
|
|
4917
|
+
* signed counts as one more, whether or not the admin was there since: the key leaves the roster as it was, and a
|
|
4918
|
+
* member that lets in keys it made up and commits their own leaves would otherwise fill the history with two commits
|
|
4919
|
+
* for each one the admin lets in at the door.
|
|
4848
4920
|
*/
|
|
4849
4921
|
function memberAdmissions(admin, before) {
|
|
4850
|
-
let n = 0;
|
|
4922
|
+
let n = 0, run = true, seen = 0;
|
|
4923
|
+
const leavers = /* @__PURE__ */ new Set();
|
|
4851
4924
|
for (const c of before) {
|
|
4852
|
-
if (c.k === "create" || c.k === "role" || c.by === admin && c.k !== "remove" && c.k !== "leave")
|
|
4853
|
-
if (c.k === "add") n++;
|
|
4925
|
+
if (run && (c.k === "create" || c.k === "role" || c.by === admin && c.k !== "remove" && c.k !== "leave")) run = false;
|
|
4926
|
+
if (run && c.k === "add") n++;
|
|
4927
|
+
const recent = ++seen <= COMMUNITY_LIMITS.memberLeaves;
|
|
4928
|
+
if (c.k === "add" && c.s && leavers.delete(c.s) && c.by !== admin) n++;
|
|
4929
|
+
if (recent && c.k === "leave" && c.s) leavers.add(c.s);
|
|
4930
|
+
if (!run && !recent && !leavers.size) break;
|
|
4854
4931
|
}
|
|
4855
4932
|
return n;
|
|
4856
4933
|
}
|
|
@@ -5322,6 +5399,13 @@ var CommunitySession = class CommunitySession {
|
|
|
5322
5399
|
saveTimer;
|
|
5323
5400
|
/** Metadata frames naming a commit or a secret I do not have yet, one signed by the admin and one by anyone else (`waitMeta`): tried again when the chain or my secrets move. */
|
|
5324
5401
|
pendingMeta = {};
|
|
5402
|
+
/** The admin as of the last `metaFollowsChain`. In memory only. */
|
|
5403
|
+
adminSeen;
|
|
5404
|
+
/**
|
|
5405
|
+
* After the admin role moved to me (`metaFollowsChain`): whom from, until when I take their statement, and the last
|
|
5406
|
+
* one of theirs I signed again (what I held then, until one of theirs comes). In memory only.
|
|
5407
|
+
*/
|
|
5408
|
+
takeover;
|
|
5325
5409
|
/** The store's frames the app holds with their messages (`storeKey` → message id): in memory here, not in what is saved. */
|
|
5326
5410
|
onRows = /* @__PURE__ */ new Map();
|
|
5327
5411
|
/** The oldest epoch whose seen marks are kept, as of the last `pruneSeen`. In memory only. */
|
|
@@ -5345,6 +5429,7 @@ var CommunitySession = class CommunitySession {
|
|
|
5345
5429
|
});
|
|
5346
5430
|
this.rebuild();
|
|
5347
5431
|
this.pruneSeen();
|
|
5432
|
+
this.adminSeen = this.admin;
|
|
5348
5433
|
if ((state.status === "active" || state.status === "lost") && this.bestBranch().tip !== this.topHash) this.serialize(() => this.chooseBranch());
|
|
5349
5434
|
}
|
|
5350
5435
|
static create(name, now = Date.now()) {
|
|
@@ -6489,6 +6574,7 @@ var CommunitySession = class CommunitySession {
|
|
|
6489
6574
|
return true;
|
|
6490
6575
|
}
|
|
6491
6576
|
await this.commit("remove", { s: next }, now);
|
|
6577
|
+
if (next === this.takeover?.from) this.takeover = void 0;
|
|
6492
6578
|
return false;
|
|
6493
6579
|
})) return;
|
|
6494
6580
|
}
|
|
@@ -7857,8 +7943,10 @@ var CommunitySession = class CommunitySession {
|
|
|
7857
7943
|
* Signs a body under my current commit, keeps it and sends it to everyone (hubs relay it). Inside `serialize`. Like a
|
|
7858
7944
|
* commit, only with admin work on and a good turn read (WISP 06 § Forced takeover): refused otherwise, or, `quiet`,
|
|
7859
7945
|
* not made. Its revision is never under the floor (WISP 06 § Raised counters).
|
|
7946
|
+
* `taken`: a former admin's statement signed again (`signAgainTaken`): the line credits them, and the one held is not
|
|
7947
|
+
* kept to hand on when it was no change (an older statement signed again).
|
|
7860
7948
|
*/
|
|
7861
|
-
async publishMeta(body, now, quiet = false) {
|
|
7949
|
+
async publishMeta(body, now, quiet = false, taken) {
|
|
7862
7950
|
const refused = !this.adminWork ? new Error(GROUP_ADMIN_OFF_ERROR) : this.hooks.adminTurn && !await this.hooks.adminTurn() ? engineError("groupTurnUnconfirmed") : void 0;
|
|
7863
7951
|
if (refused) {
|
|
7864
7952
|
if (quiet) return;
|
|
@@ -7873,12 +7961,12 @@ var CommunitySession = class CommunitySession {
|
|
|
7873
7961
|
ts: now
|
|
7874
7962
|
}, body, this.identity.seed, this.myKey);
|
|
7875
7963
|
this.state.meta = meta;
|
|
7876
|
-
this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
|
|
7964
|
+
if (!taken?.replaces) this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, meta);
|
|
7877
7965
|
await this.persist();
|
|
7878
7966
|
const frame = this.metaFrame(meta);
|
|
7879
7967
|
if (frame) this.hooks.broadcast(frame);
|
|
7880
7968
|
const change = groupMetaChange(before, meta, this.state.name);
|
|
7881
|
-
if (change) this.hooks.metaChanged?.(this.myKey, change, meta.ts);
|
|
7969
|
+
if (change) this.hooks.metaChanged?.(taken?.by ?? this.myKey, change, meta.ts);
|
|
7882
7970
|
this.hooks.changed();
|
|
7883
7971
|
}
|
|
7884
7972
|
/** A statement sealed under my current epoch, when I hold its secret. */
|
|
@@ -7902,19 +7990,20 @@ var CommunitySession = class CommunitySession {
|
|
|
7902
7990
|
* A metadata statement (from its author's edge or a hub's): kept when it is newer than mine, its
|
|
7903
7991
|
* commit is on my main branch, its signer was the admin after that commit and is the admin now,
|
|
7904
7992
|
* its signature holds, and it opens under the epoch it names into metadata Ghostly shows. Returns
|
|
7905
|
-
* whether it was new, so a hub relays it. One naming what I do not have yet waits for the chain.
|
|
7993
|
+
* whether it was new, so a hub relays it. One naming what I do not have yet waits for the chain. Just after the admin
|
|
7994
|
+
* role moved to me, the former admin's is signed again as mine (`takesOver`).
|
|
7906
7995
|
*/
|
|
7907
7996
|
async receiveMeta(from, raw) {
|
|
7908
7997
|
const frame = parseGroupMetaFrame(raw);
|
|
7909
7998
|
if (!frame || frame.statement.g !== this.id || typeof frame.k !== "string" || !this.isRecentMember(from)) return false;
|
|
7910
|
-
const s = frame.statement;
|
|
7911
|
-
if (!groupMetaNewer(s, this.state.meta)) return false;
|
|
7999
|
+
const s = frame.statement, taking = this.takesOver(s);
|
|
8000
|
+
if (!taking && !groupMetaNewer(s, this.state.meta)) return false;
|
|
7912
8001
|
const at = this.mainIndex.get(s.h);
|
|
7913
8002
|
if (at === void 0) {
|
|
7914
8003
|
if (s.e >= this.epoch - COMMUNITY_LIMITS.window) this.waitMeta(from, raw, s);
|
|
7915
8004
|
return false;
|
|
7916
8005
|
}
|
|
7917
|
-
if (at !== s.e || rosterAdmin(this.rosterAt(s.h) ?? []) !== s.by || this.admin !== s.by || !verifyGroupMetaSignature(s)) return false;
|
|
8006
|
+
if (at !== s.e || rosterAdmin(this.rosterAt(s.h) ?? []) !== s.by || !taking && this.admin !== s.by || !verifyGroupMetaSignature(s)) return false;
|
|
7918
8007
|
const secret = this.state.secrets[frame.k], sealedUnder = this.known.get(frame.k);
|
|
7919
8008
|
if (!secret || !sealedUnder) {
|
|
7920
8009
|
this.waitMeta(from, raw, s);
|
|
@@ -7922,6 +8011,10 @@ var CommunitySession = class CommunitySession {
|
|
|
7922
8011
|
}
|
|
7923
8012
|
const opened = openGroupMeta(frame, epochKeys(fromBase64Url(secret), this.id, sealedUnder.e).message);
|
|
7924
8013
|
if (!opened) return false;
|
|
8014
|
+
if (taking) {
|
|
8015
|
+
await this.signAgainTaken(opened.meta, opened.body);
|
|
8016
|
+
return false;
|
|
8017
|
+
}
|
|
7925
8018
|
const before = this.state.meta;
|
|
7926
8019
|
this.state.meta = opened.meta;
|
|
7927
8020
|
this.state.metaPast = keepPastGroupMeta(this.state.metaPast, before, opened.meta);
|
|
@@ -7932,6 +8025,37 @@ var CommunitySession = class CommunitySession {
|
|
|
7932
8025
|
return true;
|
|
7933
8026
|
}
|
|
7934
8027
|
/**
|
|
8028
|
+
* Whether I take a statement though its signer is no longer the admin (WISP 903 § Metadata): I am the admin since
|
|
8029
|
+
* moments ago, they were the admin before me, and it is later than the one of theirs I signed again. A member who had
|
|
8030
|
+
* not synced when the role moved to them signed again what they held (or nothing), and the statement on its way would
|
|
8031
|
+
* be refused for good: a rename of theirs, or a member back from away, would then lose the group's call node.
|
|
8032
|
+
*/
|
|
8033
|
+
takesOver(s) {
|
|
8034
|
+
const t = this.takeover;
|
|
8035
|
+
return !!t && this.isAdmin && s.by === t.from && (this.hooks.clock?.() ?? Date.now()) <= t.until && groupMetaNewer(s, t.base);
|
|
8036
|
+
}
|
|
8037
|
+
/**
|
|
8038
|
+
* The former admin's statement, taken (`takesOver`): signed again as mine, each field I changed since keeping my
|
|
8039
|
+
* value. Dated as theirs, and credited to them, when I changed nothing; what I held was then no change to hand on.
|
|
8040
|
+
*/
|
|
8041
|
+
async signAgainTaken(meta, theirs) {
|
|
8042
|
+
const t = this.takeover, base = groupMetaBody(t.base), mine = groupMetaBody(this.state.meta);
|
|
8043
|
+
t.base = meta;
|
|
8044
|
+
const pick = (k) => JSON.stringify(mine[k]) === JSON.stringify(base[k]) ? theirs[k] : mine[k];
|
|
8045
|
+
const body = encodeGroupMetaBody({
|
|
8046
|
+
name: pick("name"),
|
|
8047
|
+
pic: pick("pic"),
|
|
8048
|
+
hubs: pick("hubs"),
|
|
8049
|
+
call: pick("call")
|
|
8050
|
+
});
|
|
8051
|
+
if (body === this.state.meta?.body) return;
|
|
8052
|
+
const changed = encodeGroupMetaBody(mine) !== encodeGroupMetaBody(base);
|
|
8053
|
+
await this.publishMeta(body, changed ? this.hooks.clock?.() ?? Date.now() : meta.ts, true, {
|
|
8054
|
+
by: meta.by,
|
|
8055
|
+
replaces: !changed
|
|
8056
|
+
});
|
|
8057
|
+
}
|
|
8058
|
+
/**
|
|
7935
8059
|
* A statement that waits for the chain: only one its signer signed, so an altered copy cannot push out the one
|
|
7936
8060
|
* waiting. The admin I know has a place of their own, which another member's statement cannot take, and in each
|
|
7937
8061
|
* place only a later statement takes the one waiting.
|
|
@@ -7971,6 +8095,15 @@ var CommunitySession = class CommunitySession {
|
|
|
7971
8095
|
* went with a branch that lost a fork, the name and picture signed again as mine under the main branch.
|
|
7972
8096
|
*/
|
|
7973
8097
|
async metaFollowsChain() {
|
|
8098
|
+
if (this.admin !== this.adminSeen) {
|
|
8099
|
+
const from = this.adminSeen;
|
|
8100
|
+
this.takeover = this.isAdmin && from && from !== this.myKey ? {
|
|
8101
|
+
from,
|
|
8102
|
+
until: (this.hooks.clock?.() ?? Date.now()) + COMMUNITY_TAKEOVER_META_MS,
|
|
8103
|
+
base: this.state.meta
|
|
8104
|
+
} : void 0;
|
|
8105
|
+
this.adminSeen = this.admin;
|
|
8106
|
+
}
|
|
7974
8107
|
const { admin, other } = this.pendingMeta;
|
|
7975
8108
|
this.pendingMeta = {};
|
|
7976
8109
|
for (const pending of [admin, other]) if (pending && await this.receiveMeta(pending.from, pending.frame)) this.hooks.relay?.(pending.frame);
|
|
@@ -7991,6 +8124,69 @@ function signCommunity(commit, seed) {
|
|
|
7991
8124
|
sig: toBase64Url(sign(utf8Encode(tuple(commit)), seed))
|
|
7992
8125
|
};
|
|
7993
8126
|
}
|
|
8127
|
+
/** A group's call room: `g_` and the group id, a namespace no guest pass may enter. */
|
|
8128
|
+
var groupCallRoom = (g) => `g_${g}`;
|
|
8129
|
+
/**
|
|
8130
|
+
* An admin's request to act on a member in its group's call (WISP 602 · Group Calls § Moderation): what it sends to
|
|
8131
|
+
* `POST <sfu>/sfu/group-moderate`, signed by its group key over the node's origin as a token request is, under its own
|
|
8132
|
+
* tag, so neither request can stand for the other.
|
|
8133
|
+
*
|
|
8134
|
+
* {"v":1,"g":"<group>","k":"<admin key>","room":"g_<group>","act":"mute","target":"<member key>","src":["microphone"],
|
|
8135
|
+
* "ts":1794700800,"n":"<nonce>","sig":"…"}
|
|
8136
|
+
*
|
|
8137
|
+
* `mute` takes `src` away from `target`, `allow` gives it back, `remove` takes `target` out of the call and keeps it
|
|
8138
|
+
* out, `unban` lets it back in, and `state` changes nothing (the reply says who is muted and banned). Whether `k` is
|
|
8139
|
+
* the group's admin is the node's to say, from its roster.
|
|
8140
|
+
*/
|
|
8141
|
+
/** What an admin can take from a member, in the sorted order a request lists them in. */
|
|
8142
|
+
var GROUP_CALL_SOURCES = [
|
|
8143
|
+
"camera",
|
|
8144
|
+
"microphone",
|
|
8145
|
+
"screen_share"
|
|
8146
|
+
];
|
|
8147
|
+
var GROUP_CALL_MODERATION_ACTS = [
|
|
8148
|
+
"mute",
|
|
8149
|
+
"allow",
|
|
8150
|
+
"remove",
|
|
8151
|
+
"unban",
|
|
8152
|
+
"state"
|
|
8153
|
+
];
|
|
8154
|
+
var takesSources = (act) => act === "mute" || act === "allow";
|
|
8155
|
+
/** Exactly the bytes an admin signs: the array form, as the token request's. */
|
|
8156
|
+
var groupCallModerationBytes = (sfu, g, room, k, act, target, src, ts, n) => utf8Encode(JSON.stringify([
|
|
8157
|
+
"ghostly-sfu/1 moderate",
|
|
8158
|
+
sfu,
|
|
8159
|
+
g,
|
|
8160
|
+
room,
|
|
8161
|
+
k,
|
|
8162
|
+
act,
|
|
8163
|
+
target,
|
|
8164
|
+
src,
|
|
8165
|
+
ts,
|
|
8166
|
+
n
|
|
8167
|
+
]));
|
|
8168
|
+
/** A moderation request for `sfu`, signed by the admin's group key `seed`; `src` is listed unique and sorted. */
|
|
8169
|
+
function signGroupCallModeration(input, seed) {
|
|
8170
|
+
const k = identityFromSeed(seed).pubKeyZ32;
|
|
8171
|
+
const room = groupCallRoom(input.g);
|
|
8172
|
+
const target = input.act === "state" ? "" : input.target ?? "";
|
|
8173
|
+
const src = takesSources(input.act) ? [...new Set(input.src ?? [])].sort() : [];
|
|
8174
|
+
const ts = input.ts ?? Math.floor(Date.now() / 1e3);
|
|
8175
|
+
const n = input.n ?? toBase64Url(randomBytes(16));
|
|
8176
|
+
const sig = toBase64Url(sign(groupCallModerationBytes(input.sfu, input.g, room, k, input.act, target, src, ts, n), seed));
|
|
8177
|
+
return {
|
|
8178
|
+
v: 1,
|
|
8179
|
+
g: input.g,
|
|
8180
|
+
k,
|
|
8181
|
+
room,
|
|
8182
|
+
act: input.act,
|
|
8183
|
+
target,
|
|
8184
|
+
src,
|
|
8185
|
+
ts,
|
|
8186
|
+
n,
|
|
8187
|
+
sig
|
|
8188
|
+
};
|
|
8189
|
+
}
|
|
7994
8190
|
// ../core/src/groupTyping.ts
|
|
7995
8191
|
/**
|
|
7996
8192
|
* The typing indicator of a private group (WISP 902 · Group Mesh § Typing): "Ana is typing", said on the group's
|
|
@@ -8485,7 +8681,7 @@ var bitcoindRpc = {
|
|
|
8485
8681
|
if (!user || !password) throw new Error("Enter the RPC user and password, or paste the .cookie file");
|
|
8486
8682
|
},
|
|
8487
8683
|
async create(settings, host) {
|
|
8488
|
-
const { BitcoindOnchain, tauriTransport } = await import("./bitcoind-
|
|
8684
|
+
const { BitcoindOnchain, tauriTransport } = await import("./bitcoind-B2bbVSzh.js");
|
|
8489
8685
|
return BitcoindOnchain.connect({
|
|
8490
8686
|
url: settings.config.url.trim(),
|
|
8491
8687
|
wallet: settings.config.wallet?.trim() ?? "",
|
|
@@ -17844,7 +18040,7 @@ var HostNotContacted = class extends Error {};
|
|
|
17844
18040
|
*/
|
|
17845
18041
|
function fixedHostsFetch(fetch) {
|
|
17846
18042
|
return async (url, options) => {
|
|
17847
|
-
const { fixedIdentityHosts } = await import("./fixedHosts-
|
|
18043
|
+
const { fixedIdentityHosts } = await import("./fixedHosts-C3hBliM9.js");
|
|
17848
18044
|
const host = hostOf$1(url);
|
|
17849
18045
|
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`);
|
|
17850
18046
|
return fetch(url, options);
|
|
@@ -21001,7 +21197,12 @@ var Apps = class {
|
|
|
21001
21197
|
*/
|
|
21002
21198
|
async readStopping(version, urls) {
|
|
21003
21199
|
const read = await this.readRevocations(version.ref, urls) ?? [];
|
|
21004
|
-
|
|
21200
|
+
await this.keepStopping(version, read);
|
|
21201
|
+
return read;
|
|
21202
|
+
}
|
|
21203
|
+
/** Keeps those of these verified revocations that stop `version`, with the profile's and on the installed app. */
|
|
21204
|
+
async keepStopping(version, revocations) {
|
|
21205
|
+
const stops = stopping([version], revocations);
|
|
21005
21206
|
if (stops.length) {
|
|
21006
21207
|
const tx = (await openDb()).transaction(STORES$1.settings, "readwrite");
|
|
21007
21208
|
keepRevocations(tx.objectStore(STORES$1.settings), version.ref, stops);
|
|
@@ -21009,7 +21210,6 @@ var Apps = class {
|
|
|
21009
21210
|
const installed = await this.app(version.ref);
|
|
21010
21211
|
if (installed) await this.keepOnRecord(installed, stops);
|
|
21011
21212
|
}
|
|
21012
|
-
return read;
|
|
21013
21213
|
}
|
|
21014
21214
|
async stage(bundle, bytes, from, fromStore, carried = false) {
|
|
21015
21215
|
const { manifest, digest } = bundle;
|
|
@@ -21017,6 +21217,7 @@ var Apps = class {
|
|
|
21017
21217
|
const read = carried ? [] : await this.readStopping(version, [from, ...manifest.sources ?? []]);
|
|
21018
21218
|
const revocations = [...await this.keptRevocationsOf(version.ref), ...read];
|
|
21019
21219
|
const [installed, stores] = await Promise.all([this.app(version.ref), this.stores()]);
|
|
21220
|
+
await this.keepStopping(version, stores.flatMap((s) => s.index?.revoked ?? []));
|
|
21020
21221
|
const decision = installDecision(installed, version);
|
|
21021
21222
|
const install = decision === "other-app" ? "new" : decision;
|
|
21022
21223
|
const asks = install === "new" ? [...manifest.permissions] : install === "update" ? manifest.permissions.filter((p) => !installed.permissions.includes(p)) : [];
|
|
@@ -23627,6 +23828,27 @@ function deviceSetOf(record) {
|
|
|
23627
23828
|
});
|
|
23628
23829
|
}
|
|
23629
23830
|
/**
|
|
23831
|
+
* The set a device keeps from a record of its set that it read, against the set it holds (`held`) and the record it
|
|
23832
|
+
* stored (`stored`). A record written by the device the stored record names active, or under a release that device
|
|
23833
|
+
* signed, is that device's to write: its slots are taken as they are. Any other is a takeover by a holder of `D`, who
|
|
23834
|
+
* signs with the key of the slot it writes from: that slot is taken (the device that took the turn, a restored copy
|
|
23835
|
+
* with a key of its own), so it is named and can be removed; every other slot stays as held, its name aside. A key it
|
|
23836
|
+
* added or swapped in elsewhere is never listed here, so a new device secret never goes to it.
|
|
23837
|
+
*/
|
|
23838
|
+
function adoptedSet(held, stored, record) {
|
|
23839
|
+
const set = deviceSetOf(record);
|
|
23840
|
+
const believed = stored && !stored.tombstone ? stored.slots[stored.active]?.key : void 0;
|
|
23841
|
+
const from = (slot) => slot !== void 0 && !!believed && !!record.slots[slot] && bytesEqual(record.slots[slot].key, believed);
|
|
23842
|
+
if (!stored || from(record.author) || from(record.release?.from)) return set;
|
|
23843
|
+
const author = set[record.author];
|
|
23844
|
+
return Array.from({ length: Math.max(set.length, held.length) }, (_, i) => {
|
|
23845
|
+
if (i === record.author) return author;
|
|
23846
|
+
const was = held[i] ?? null;
|
|
23847
|
+
if (!was || was.key === author.key) return null;
|
|
23848
|
+
return set[i]?.key === was.key ? set[i] : was;
|
|
23849
|
+
});
|
|
23850
|
+
}
|
|
23851
|
+
/**
|
|
23630
23852
|
* The slots of the first record of a turn this device raises (WISP 06 § Who may raise the turn): those of the newest
|
|
23631
23853
|
* record of the set it knows. The read the raise acts on may return a record above the one it stored (a device added or
|
|
23632
23854
|
* renamed since its last read); when that record still lists this device in its own slot, its slots are written, with
|
|
@@ -23640,7 +23862,7 @@ function newestSlots(held, read) {
|
|
|
23640
23862
|
if (held.storedRecord && news.sequence <= held.storedRecord.sequence) return void 0;
|
|
23641
23863
|
const listed = news.slots[held.ownSlot];
|
|
23642
23864
|
if (!listed || !bytesEqual(listed.key, held.ownKey)) return void 0;
|
|
23643
|
-
const set =
|
|
23865
|
+
const set = adoptedSet(held.record.deviceSet, held.storedRecord, news);
|
|
23644
23866
|
return set.map((slot, i) => slot ?? (held.record.deviceSet[i] && !set.some((s) => s?.key === held.record.deviceSet[i].key) ? held.record.deviceSet[i] : null));
|
|
23645
23867
|
}
|
|
23646
23868
|
var TurnKeeper = class {
|
|
@@ -24117,7 +24339,7 @@ var TurnKeeper = class {
|
|
|
24117
24339
|
const listed = read.record?.slots[held.ownSlot];
|
|
24118
24340
|
const replacedBy = state === "superseded" && read.result === "other" && read.record && !!listed && toBase64Url(listed.key) === toBase64Url(held.ownKey) ? {
|
|
24119
24341
|
activeSlot: read.record.active,
|
|
24120
|
-
deviceSet:
|
|
24342
|
+
deviceSet: adoptedSet(held.record.deviceSet, held.storedRecord, read.record)
|
|
24121
24343
|
} : {};
|
|
24122
24344
|
const tombstoned = state === "moving" && read.result === "tombstone" && read.record && read.payload ? {
|
|
24123
24345
|
tombstone: toBase64Url(read.payload),
|
|
@@ -24172,7 +24394,7 @@ var TurnKeeper = class {
|
|
|
24172
24394
|
rev: read.record.rev,
|
|
24173
24395
|
turnPacket: toBase64Url(read.payload),
|
|
24174
24396
|
activeSlot: read.record.active,
|
|
24175
|
-
deviceSet:
|
|
24397
|
+
deviceSet: adoptedSet(held.record.deviceSet, held.storedRecord, read.record)
|
|
24176
24398
|
});
|
|
24177
24399
|
const active = held.record.activeSlot === void 0 ? void 0 : held.record.deviceSet[held.record.activeSlot]?.name;
|
|
24178
24400
|
const taker = held.record.handoff?.release?.to;
|
|
@@ -29639,7 +29861,7 @@ var FileDesk = class {
|
|
|
29639
29861
|
/** A files/3 transfer of this chat's under way on its session: offered, moving, or being checked. */
|
|
29640
29862
|
moving(linkId) {
|
|
29641
29863
|
const files = this.chats.get(linkId)?.files;
|
|
29642
|
-
return !!files?.live && files.
|
|
29864
|
+
return !!files?.live && files.underWay();
|
|
29643
29865
|
}
|
|
29644
29866
|
/**
|
|
29645
29867
|
* Offers a file whose record and bytes are stored under its local id (`outgoingFileId`). Offered before (Retry, a
|
|
@@ -29812,21 +30034,20 @@ var FileDesk = class {
|
|
|
29812
30034
|
const taken = this.deps.receivedBytes(linkId) + this.autoTaken(linkId);
|
|
29813
30035
|
return file.size <= FILE_LIMITS.askAboveBytes && taken + file.size <= FILE_LIMITS.autoAcceptBytesPerPeer ? "accept" : "ask";
|
|
29814
30036
|
}
|
|
29815
|
-
/**
|
|
30037
|
+
/**
|
|
30038
|
+
* Bytes still to come of the files taken here (every chat's, not ended): the room they will take. Read from each
|
|
30039
|
+
* chat's unfinished files only: copying every record each chat ever had cost every offer ~10 ms at 100,000 files.
|
|
30040
|
+
*/
|
|
29816
30041
|
stillComing() {
|
|
29817
30042
|
let due = 0;
|
|
29818
|
-
for (const chat of this.chats.values())
|
|
30043
|
+
for (const chat of this.chats.values()) due += chat.files.stillToCome();
|
|
29819
30044
|
return due;
|
|
29820
30045
|
}
|
|
29821
30046
|
/** files/3 files this contact sent that were taken without asking and are kept (or on their way). */
|
|
29822
30047
|
autoTaken(linkId) {
|
|
29823
30048
|
const chat = this.chats.get(linkId);
|
|
29824
30049
|
if (!chat) return 0;
|
|
29825
|
-
return chat.files.
|
|
29826
|
-
"failed",
|
|
29827
|
-
"declined",
|
|
29828
|
-
"cancelled"
|
|
29829
|
-
].includes(r.state)).reduce((sum, r) => sum + r.file.size, 0);
|
|
30050
|
+
return chat.files.takenUnasked();
|
|
29830
30051
|
}
|
|
29831
30052
|
/** Where a received file is written: from what is durably there, cut back to that if more was written after. */
|
|
29832
30053
|
async openTarget(linkId, record) {
|
|
@@ -30385,6 +30606,97 @@ async function fetchGroupCallToken(ask) {
|
|
|
30385
30606
|
return pass;
|
|
30386
30607
|
}
|
|
30387
30608
|
}
|
|
30609
|
+
/** A 429 that says no time (or says it badly) is asked again after the node's window, a minute; one that says more, an hour at most. */
|
|
30610
|
+
var DEFAULT_RETRY_AFTER_S = 60;
|
|
30611
|
+
var MAX_RETRY_AFTER_S = 3600;
|
|
30612
|
+
/**
|
|
30613
|
+
* Sends the admin's signed request to `<sfu>/sfu/group-moderate` (WISP 602 § Moderation) once, as a token request goes
|
|
30614
|
+
* (no redirect, no cookie, the same timeout and capped read), and says what came back as a code, never as a throw.
|
|
30615
|
+
*/
|
|
30616
|
+
async function sendGroupCallModeration(ask) {
|
|
30617
|
+
const doFetch = ask.fetch ?? ((...args) => fetch(...args));
|
|
30618
|
+
const now = ask.now ?? Date.now;
|
|
30619
|
+
const request = signGroupCallModeration({
|
|
30620
|
+
sfu: ask.sfu,
|
|
30621
|
+
g: ask.g,
|
|
30622
|
+
act: ask.act,
|
|
30623
|
+
target: ask.target,
|
|
30624
|
+
src: ask.src,
|
|
30625
|
+
ts: Math.floor(now() / 1e3)
|
|
30626
|
+
}, ask.seed);
|
|
30627
|
+
let response;
|
|
30628
|
+
try {
|
|
30629
|
+
response = await doFetch(`${ask.sfu}/sfu/group-moderate`, {
|
|
30630
|
+
method: "POST",
|
|
30631
|
+
headers: { "Content-Type": "application/json" },
|
|
30632
|
+
body: JSON.stringify(request),
|
|
30633
|
+
signal: AbortSignal.timeout(GROUP_CALL_TIMEOUT_MS),
|
|
30634
|
+
redirect: "error",
|
|
30635
|
+
credentials: "omit",
|
|
30636
|
+
referrerPolicy: "no-referrer",
|
|
30637
|
+
cache: "no-store"
|
|
30638
|
+
});
|
|
30639
|
+
} catch {
|
|
30640
|
+
return {
|
|
30641
|
+
ok: false,
|
|
30642
|
+
code: "unreachable"
|
|
30643
|
+
};
|
|
30644
|
+
}
|
|
30645
|
+
if (response.status === 403) return {
|
|
30646
|
+
ok: false,
|
|
30647
|
+
code: "refused"
|
|
30648
|
+
};
|
|
30649
|
+
if (response.status === 429) return {
|
|
30650
|
+
ok: false,
|
|
30651
|
+
code: "rate_limited",
|
|
30652
|
+
retryAfter: retryAfterS(response.headers.get("Retry-After"), now())
|
|
30653
|
+
};
|
|
30654
|
+
if (response.status === 404 || response.status === 405) return {
|
|
30655
|
+
ok: false,
|
|
30656
|
+
code: "unsupported"
|
|
30657
|
+
};
|
|
30658
|
+
let raw = null;
|
|
30659
|
+
if (response.ok) try {
|
|
30660
|
+
const text = await readCapped(response, MAX_REPLY_BYTES);
|
|
30661
|
+
raw = text === null ? null : JSON.parse(text);
|
|
30662
|
+
} catch {
|
|
30663
|
+
raw = null;
|
|
30664
|
+
}
|
|
30665
|
+
const state = parseGroupCallRoomState(raw);
|
|
30666
|
+
return state ? {
|
|
30667
|
+
ok: true,
|
|
30668
|
+
state
|
|
30669
|
+
} : {
|
|
30670
|
+
ok: false,
|
|
30671
|
+
code: "unreachable"
|
|
30672
|
+
};
|
|
30673
|
+
}
|
|
30674
|
+
/** `Retry-After` in seconds, given as seconds or as an HTTP date. */
|
|
30675
|
+
function retryAfterS(header, now) {
|
|
30676
|
+
const value = header?.trim() ?? "";
|
|
30677
|
+
if (/^\d{1,10}$/.test(value)) return Math.min(Number(value), MAX_RETRY_AFTER_S);
|
|
30678
|
+
const at = value ? Date.parse(value) : NaN;
|
|
30679
|
+
return Number.isFinite(at) ? Math.min(Math.max(0, Math.ceil((at - now) / 1e3)), MAX_RETRY_AFTER_S) : DEFAULT_RETRY_AFTER_S;
|
|
30680
|
+
}
|
|
30681
|
+
/**
|
|
30682
|
+
* The reply's room state, or null when it is none: its keys are member keys and its sources known ones, listed once and
|
|
30683
|
+
* sorted, as the WISP has the node write them. A key with no source left is not muted.
|
|
30684
|
+
*/
|
|
30685
|
+
function parseGroupCallRoomState(raw) {
|
|
30686
|
+
const state = raw?.state;
|
|
30687
|
+
if (!state || typeof state !== "object" || !state.muted || typeof state.muted !== "object" || Array.isArray(state.muted) || !Array.isArray(state.banned)) return null;
|
|
30688
|
+
const muted = {};
|
|
30689
|
+
for (const [key, src] of Object.entries(state.muted)) {
|
|
30690
|
+
if (!isZ32Key(key) || !Array.isArray(src)) return null;
|
|
30691
|
+
const known = GROUP_CALL_SOURCES.filter((s) => src.includes(s));
|
|
30692
|
+
if (known.length) muted[key] = known;
|
|
30693
|
+
}
|
|
30694
|
+
if (!state.banned.every(isZ32Key)) return null;
|
|
30695
|
+
return {
|
|
30696
|
+
muted,
|
|
30697
|
+
banned: [...new Set(state.banned)].sort()
|
|
30698
|
+
};
|
|
30699
|
+
}
|
|
30388
30700
|
/**
|
|
30389
30701
|
* The reply's text, or null past `max` bytes: read as it comes and stopped there, so a node's endless (or gzip-bombed)
|
|
30390
30702
|
* reply never sits whole in the engine's memory.
|
|
@@ -33792,14 +34104,10 @@ function admissionsHeld(s) {
|
|
|
33792
34104
|
return !s.isAdmin && membersAtBound(s);
|
|
33793
34105
|
}
|
|
33794
34106
|
function membersAtBound(s) {
|
|
33795
|
-
const
|
|
33796
|
-
|
|
33797
|
-
|
|
33798
|
-
|
|
33799
|
-
if (c.k === "create" || c.k === "role" || c.by === admin && c.k !== "remove" && c.k !== "leave") break;
|
|
33800
|
-
if (c.k === "add") n++;
|
|
33801
|
-
}
|
|
33802
|
-
return n >= COMMUNITY_LIMITS.memberAdmissions;
|
|
34107
|
+
const chain = s.state.chain;
|
|
34108
|
+
return memberAdmissions(s.admin, (function* () {
|
|
34109
|
+
for (let i = chain.length - 1; i >= 0; i--) yield chain[i];
|
|
34110
|
+
})()) >= COMMUNITY_LIMITS.memberAdmissions;
|
|
33803
34111
|
}
|
|
33804
34112
|
/**
|
|
33805
34113
|
* Whether the admin's app is wanted at the door: the members signed all the admissions in a row they may, and only the
|
|
@@ -33985,13 +34293,14 @@ var Communities = class {
|
|
|
33985
34293
|
couldRead: (key, messageId) => session.couldRead(key, messageId)
|
|
33986
34294
|
};
|
|
33987
34295
|
}
|
|
33988
|
-
/** Me in a community I am a member of, for its call (WISP 602): my member key, its seed,
|
|
34296
|
+
/** Me in a community I am a member of, for its call (WISP 602): my member key, its seed, the admin's metadata, and whether I am the admin. */
|
|
33989
34297
|
callMember(groupId) {
|
|
33990
34298
|
const session = this.live.get(groupId)?.session;
|
|
33991
34299
|
return session?.isMember ? {
|
|
33992
34300
|
key: session.myKey,
|
|
33993
34301
|
seedB64: session.state.seedB64,
|
|
33994
|
-
meta: session.state.meta
|
|
34302
|
+
meta: session.state.meta,
|
|
34303
|
+
isAdmin: session.isAdmin
|
|
33995
34304
|
} : void 0;
|
|
33996
34305
|
}
|
|
33997
34306
|
/** Is this device a hub of the group? (tests and the load harness) */
|
|
@@ -38556,14 +38865,15 @@ var Groups = class {
|
|
|
38556
38865
|
couldRead: (key, messageId, ts) => session.couldRead(key, messageId, ts)
|
|
38557
38866
|
};
|
|
38558
38867
|
}
|
|
38559
|
-
/** Me in a group I am active in, private or community alike, for its call (WISP 602): my member key, its seed,
|
|
38868
|
+
/** Me in a group I am active in, private or community alike, for its call (WISP 602): my member key, its seed, the admin's metadata, and whether I am the admin. */
|
|
38560
38869
|
callMember(groupId) {
|
|
38561
38870
|
if (this.isCommunity(groupId)) return this.communities.callMember(groupId);
|
|
38562
38871
|
const session = this.sessions.get(groupId);
|
|
38563
38872
|
return session?.status === "active" ? {
|
|
38564
38873
|
key: session.myKey,
|
|
38565
38874
|
seedB64: session.state.seedB64,
|
|
38566
|
-
meta: session.state.meta
|
|
38875
|
+
meta: session.state.meta,
|
|
38876
|
+
isAdmin: session.isAdmin
|
|
38567
38877
|
} : void 0;
|
|
38568
38878
|
}
|
|
38569
38879
|
/**
|
|
@@ -41200,8 +41510,13 @@ var fieldsOf = (frame) => ({
|
|
|
41200
41510
|
...frame.a ? { ask: true } : {},
|
|
41201
41511
|
createdAt: frame.ts
|
|
41202
41512
|
});
|
|
41203
|
-
/**
|
|
41204
|
-
|
|
41513
|
+
/**
|
|
41514
|
+
* Whether `author`'s `frame` may count for the note kept so far: one about another payment under the same id never
|
|
41515
|
+
* does. Who pays is the note's too: a request made to one member is claimed by that member alone, and a member who did
|
|
41516
|
+
* not know a request was made to the group claims it as itself. A request nobody described yet takes any claim: the
|
|
41517
|
+
* payee's description keeps only those that fit (mergeGroupPay).
|
|
41518
|
+
*/
|
|
41519
|
+
var believed = (current, frame, author, members) => mayAuthor(frame, author, members, current) && (!current || current.kind === (frame.k === "req" ? "request" : "payment") && current.to === frame.to && (current.from === frame.f || frame.k === "req" && (!!current.undescribed || current.from === "*" && author !== frame.to)));
|
|
41205
41520
|
/**
|
|
41206
41521
|
* The note after `author` said `frame`, or undefined when that changes nothing (or may not be believed). What a
|
|
41207
41522
|
* payment is (who, how much, over what) is its initiator's to say: the payee's for a request, the payer's for a
|
|
@@ -41220,6 +41535,13 @@ function mergeGroupPay(current, frame, author, members) {
|
|
|
41220
41535
|
...next,
|
|
41221
41536
|
...fields
|
|
41222
41537
|
});
|
|
41538
|
+
if (author === initiator && next.from !== "*" && next.claims?.some((k) => k !== next.from)) {
|
|
41539
|
+
const claims = next.claims.filter((k) => k === next.from);
|
|
41540
|
+
next = claims.length ? {
|
|
41541
|
+
...next,
|
|
41542
|
+
claims
|
|
41543
|
+
} : (({ claims: _, ...rest }) => rest)(next);
|
|
41544
|
+
}
|
|
41223
41545
|
if (frame.k === "req" && author !== frame.to) {
|
|
41224
41546
|
const claims = frame.st === "sent" ? [.../* @__PURE__ */ new Set([...next.claims ?? [], author])].sort() : (next.claims ?? []).filter((k) => k !== author);
|
|
41225
41547
|
next = claims.length ? {
|
|
@@ -41277,7 +41599,7 @@ function authoredNote(p, at, all, current, memberOf = () => void 0, federationNe
|
|
|
41277
41599
|
if (p.kind === "request" && p.direction === "out") {
|
|
41278
41600
|
const from = p.group ? "*" : at.peer;
|
|
41279
41601
|
if (!from) return null;
|
|
41280
|
-
const payment = all.find((x) => x.kind === "payment" && x.direction === "in" && x.requestId === p.id && x.state === "settled");
|
|
41602
|
+
const payment = all.find((x) => x.kind === "payment" && x.direction === "in" && x.requestId === p.id && x.state === "settled" && !x.federation && x.amount >= p.amount && (!p.mint || x.mint === p.mint));
|
|
41281
41603
|
const by = !p.group ? from : payment ? memberOf(payment.linkId) : void 0;
|
|
41282
41604
|
const st = p.state === "settled" ? "paid" : p.state === "failed" || p.state === "reclaimed" ? "closed" : "open";
|
|
41283
41605
|
return {
|
|
@@ -44652,14 +44974,22 @@ var MELT_REQUEST = "/v1/melt/bolt11";
|
|
|
44652
44974
|
*/
|
|
44653
44975
|
var MINT_REQUEST = "/v1/mint/bolt11";
|
|
44654
44976
|
var MINT_QUOTE_STATE = /\/v1\/mint\/quote\/bolt11\/[^/]+$/;
|
|
44977
|
+
/**
|
|
44978
|
+
* What `melt` and `settleMelt` ask under the mint's lock: where a Lightning payment's quote stands, and the keysets its
|
|
44979
|
+
* change may be on. Nothing is paid on a read: one cut short is asked again (`melt` before it pays, `pollMelts` after).
|
|
44980
|
+
*/
|
|
44981
|
+
var MELT_QUOTE_STATE = /\/v1\/melt\/quote\/bolt11\/[^/]+$/;
|
|
44982
|
+
var KEYSET_REQUESTS = /\/v1\/(keysets|keys(\/[^/]+)?)$/;
|
|
44655
44983
|
/** How long a request to this path may last, its retries included; undefined: cashu-ts' defaults. */
|
|
44656
44984
|
function requestLimit(pathname) {
|
|
44657
44985
|
if (SWAP_REQUESTS.some((path) => pathname.endsWith(path))) return CASHU_REQUEST_TIMEOUT_MS;
|
|
44658
44986
|
if (pathname.endsWith(MINT_REQUEST) || MINT_QUOTE_STATE.test(pathname)) return CASHU_REQUEST_TIMEOUT_MS;
|
|
44987
|
+
if (MELT_QUOTE_STATE.test(pathname) || KEYSET_REQUESTS.test(pathname)) return CASHU_REQUEST_TIMEOUT_MS;
|
|
44659
44988
|
if (pathname.endsWith(MELT_REQUEST)) return MELT_REQUEST_TIMEOUT_MS;
|
|
44660
44989
|
}
|
|
44661
44990
|
/**
|
|
44662
|
-
* Each of `SWAP_REQUESTS
|
|
44991
|
+
* Each of `SWAP_REQUESTS`, a paid invoice's (`MINT_REQUEST`, `MINT_QUOTE_STATE`) and a melt's reads (`MELT_QUOTE_STATE`,
|
|
44992
|
+
* `KEYSET_REQUESTS`) ends within
|
|
44663
44993
|
* `CASHU_REQUEST_TIMEOUT_MS`, and a melt's within `MELT_REQUEST_TIMEOUT_MS`, retries
|
|
44664
44994
|
* included. cashu-ts' `requestTimeout` is per try, and NUT-19 tries a cached endpoint again after a timeout, each try
|
|
44665
44995
|
* with a timeout of its own, for as long as the mint's `ttl` (endless when it gives none): one deadline for the whole
|
|
@@ -49222,6 +49552,8 @@ var PaymentDesk = class {
|
|
|
49222
49552
|
});
|
|
49223
49553
|
return;
|
|
49224
49554
|
}
|
|
49555
|
+
const requestId = this.paysRequest(payment.requestId, linkId);
|
|
49556
|
+
const paysGroup = !!requestId && !!this.payments.get(requestId)?.group;
|
|
49225
49557
|
await this.save({
|
|
49226
49558
|
id: payment.id,
|
|
49227
49559
|
linkId,
|
|
@@ -49232,7 +49564,7 @@ var PaymentDesk = class {
|
|
|
49232
49564
|
memo: payment.memo,
|
|
49233
49565
|
state: "pending",
|
|
49234
49566
|
createdAt: payment.timestamp,
|
|
49235
|
-
requestId:
|
|
49567
|
+
requestId: paysGroup ? void 0 : requestId,
|
|
49236
49568
|
federation: found.federation,
|
|
49237
49569
|
token: notes,
|
|
49238
49570
|
notesDigest: digest,
|
|
@@ -51271,6 +51603,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
51271
51603
|
},
|
|
51272
51604
|
linkIds: () => [...this.links.keys()],
|
|
51273
51605
|
online: () => this.networkOn,
|
|
51606
|
+
fetcher: (...request) => (this.options.identityFetch ?? globalThis.fetch)(...request),
|
|
51274
51607
|
relayOnly: () => this.settings.relayOnly === true,
|
|
51275
51608
|
emit: () => {
|
|
51276
51609
|
this.emitState();
|
|
@@ -51463,6 +51796,10 @@ var GhostlyNode = class GhostlyNode {
|
|
|
51463
51796
|
publicProfiles = new PublicProfiles({
|
|
51464
51797
|
enabled: () => this.settings.publicProfiles !== false,
|
|
51465
51798
|
online: () => this.networkOn,
|
|
51799
|
+
fetch: boundedIdentityFetch({
|
|
51800
|
+
online: () => this.networkOn,
|
|
51801
|
+
fetcher: (...request) => (this.options.identityFetch ?? globalThis.fetch)(...request)
|
|
51802
|
+
}),
|
|
51466
51803
|
emit: () => this.emitState(),
|
|
51467
51804
|
eligible: () => this.profileSubjects(),
|
|
51468
51805
|
nostrRelays: () => effectiveNostrSettings(this.settings.nostr).relays,
|
|
@@ -51473,6 +51810,10 @@ var GhostlyNode = class GhostlyNode {
|
|
|
51473
51810
|
publicActivity = new PublicActivity({
|
|
51474
51811
|
enabled: () => this.settings.publicProfiles !== false,
|
|
51475
51812
|
online: () => this.networkOn,
|
|
51813
|
+
fetch: boundedIdentityFetch({
|
|
51814
|
+
online: () => this.networkOn,
|
|
51815
|
+
fetcher: (...request) => (this.options.identityFetch ?? globalThis.fetch)(...request)
|
|
51816
|
+
}),
|
|
51476
51817
|
eligible: () => this.profileSubjects(),
|
|
51477
51818
|
nostrRelays: () => effectiveNostrSettings(this.settings.nostr).relays,
|
|
51478
51819
|
own: () => this.ownProfileSubjects(),
|
|
@@ -54149,6 +54490,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
54149
54490
|
if (filesEnded) setTimeout(() => void live.link?.stop(true), FILES_END_MS);
|
|
54150
54491
|
else live.link?.stop(true);
|
|
54151
54492
|
live.caps?.stop();
|
|
54493
|
+
this.unshareServicesOf(live.stored.peerPubKeyZ32);
|
|
54152
54494
|
this.identities.forget(linkId);
|
|
54153
54495
|
this.nostrSocial.forgetLink(linkId);
|
|
54154
54496
|
this.hold.forgetLink(linkId);
|
|
@@ -54376,6 +54718,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
54376
54718
|
const wireId = toBase64Url(randomBytes(16)), id = `me_${wireId}`;
|
|
54377
54719
|
const delivery = link.isDataLinkOpen ? "stream" : link.textDelivery === "dht" ? "dht" : "unavailable";
|
|
54378
54720
|
if (delivery !== "stream") this.wakePeer(live);
|
|
54721
|
+
let tooBig;
|
|
54379
54722
|
if (delivery === "stream" || delivery === "dht" && bytes <= 256) {
|
|
54380
54723
|
const validationError = link.validateText(trimmed, timestamp, wireId, reply && pairedWireReply(reply));
|
|
54381
54724
|
if (!validationError) {
|
|
@@ -54400,6 +54743,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
54400
54743
|
error: validationError,
|
|
54401
54744
|
refused: true
|
|
54402
54745
|
};
|
|
54746
|
+
if (/packet budget/.test(validationError)) tooBig = validationError;
|
|
54403
54747
|
}
|
|
54404
54748
|
if (this.holdingFor(live) && bytes <= HOLD_LIMITS.maxTextBytes) {
|
|
54405
54749
|
await this.storeMessage({
|
|
@@ -54427,6 +54771,10 @@ var GhostlyNode = class GhostlyNode {
|
|
|
54427
54771
|
messageId: id
|
|
54428
54772
|
};
|
|
54429
54773
|
}
|
|
54774
|
+
if (tooBig) return {
|
|
54775
|
+
error: tooBig,
|
|
54776
|
+
refused: true
|
|
54777
|
+
};
|
|
54430
54778
|
const reason = delivery === "dht" && bytes <= 256 ? "Waits for the text before it to be confirmed." : delivery === "dht" ? `Longer than the 256 bytes the DHT carries: it is sent when you are live.` : "Sent when your contact is reachable.";
|
|
54431
54779
|
await this.storeMessage({
|
|
54432
54780
|
linkId,
|
|
@@ -55461,7 +55809,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
55461
55809
|
}).catch(() => {});
|
|
55462
55810
|
this.hold.forget(linkId, messageId).catch(() => {});
|
|
55463
55811
|
const message = await db.getMessage(linkId, messageId);
|
|
55464
|
-
const withdrawn = message?.sender === "me" && message.wireId && live.link
|
|
55812
|
+
const withdrawn = message?.sender === "me" && message.wireId && (!live.link || live.link.dhtHolds(message.wireId)) ? this.withdrawFromFloor(live, message.wireId) : void 0;
|
|
55465
55813
|
if (message && contactJoinRow(message) && !live.stored.group && !live.stored.peerSpoke) {
|
|
55466
55814
|
this.contactSpoke.add(live);
|
|
55467
55815
|
live.stored = {
|
|
@@ -55825,13 +56173,34 @@ var GhostlyNode = class GhostlyNode {
|
|
|
55825
56173
|
/** The waiting files whose offer is being said on the DHT floor right now (`sayFileOnFloor`), by file id. */
|
|
55826
56174
|
floorSaying = /* @__PURE__ */ new Set();
|
|
55827
56175
|
/**
|
|
56176
|
+
* A text of mine, or a file's offer, deleted here leaves the DHT floor (`withdrawDht`). With no link running (the
|
|
56177
|
+
* profile offline, the chat not started yet), the floor's saved state lets go of it instead: kept there, the next
|
|
56178
|
+
* start published it again to the away contact, and `--purge` left its words in the chat's row (agents#6005). Its
|
|
56179
|
+
* envelope may still be on the relays: the chat's next link puts its first one out at once (`floorReplace`).
|
|
56180
|
+
*/
|
|
56181
|
+
async withdrawFromFloor(live, floorId) {
|
|
56182
|
+
if (live.link) {
|
|
56183
|
+
await live.link.withdrawDht(floorId).catch(() => {});
|
|
56184
|
+
return;
|
|
56185
|
+
}
|
|
56186
|
+
const state = live.stored.dhtDeliveryState, pending = state?.pending;
|
|
56187
|
+
if (!state || !pending || pending.message[0] !== floorId && pending.edit?.[0] !== floorId) return;
|
|
56188
|
+
const { pending: _withdrawn, ...kept } = state;
|
|
56189
|
+
live.stored = {
|
|
56190
|
+
...live.stored,
|
|
56191
|
+
dhtDeliveryState: kept
|
|
56192
|
+
};
|
|
56193
|
+
if (pending.attempts > 0 && pending.expires > Date.now()) live.floorReplace = true;
|
|
56194
|
+
await db.patchLink(live.stored.id, { dhtDeliveryState: kept }).catch(() => {});
|
|
56195
|
+
}
|
|
56196
|
+
/**
|
|
55828
56197
|
* A file of mine said on the floor and deleted here before it went live: the floor stops saying it (`withdrawDht`: a
|
|
55829
56198
|
* new envelope without it takes its place, as for a text; only settled, the relays kept its offer for minutes and a
|
|
55830
56199
|
* contact who read them then got its bubble), and the next session that carries files/3 tells a bubble the contact
|
|
55831
56200
|
* already has that it was cancelled (`sayWithdrawnFiles`).
|
|
55832
56201
|
*/
|
|
55833
56202
|
async withdrawFloorFile(live, wireId) {
|
|
55834
|
-
await
|
|
56203
|
+
await this.withdrawFromFloor(live, dhtFileId(wireId));
|
|
55835
56204
|
live.stored = {
|
|
55836
56205
|
...live.stored,
|
|
55837
56206
|
withdrawnFiles: [...(live.stored.withdrawnFiles ?? []).filter((id) => id !== wireId), wireId].slice(-64)
|
|
@@ -57372,6 +57741,36 @@ var GhostlyNode = class GhostlyNode {
|
|
|
57372
57741
|
});
|
|
57373
57742
|
}
|
|
57374
57743
|
/**
|
|
57744
|
+
* The group's admin acts on a member in its call (WISP 602 § Moderation): `mute` or `allow` the sources `src` of
|
|
57745
|
+
* `target`, `remove` `target` from the call (and ban it), `unban` it, or read the room's `state`. Signed with my
|
|
57746
|
+
* member key for the node the group's `call` names. Answers the room's state after the act, or a code: `not_admin`
|
|
57747
|
+
* and `unsupported` (no node named) before anything is sent. A request that is not one of these throws.
|
|
57748
|
+
*/
|
|
57749
|
+
async groupCallModerate({ groupId, act, target, src }) {
|
|
57750
|
+
if (!GROUP_CALL_MODERATION_ACTS.includes(act)) throw new Error(`act must be one of ${GROUP_CALL_MODERATION_ACTS.join(", ")}`);
|
|
57751
|
+
const me = typeof groupId === "string" ? this.groups.callMember(groupId) : void 0;
|
|
57752
|
+
if (act !== "state" && (!isZ32Key(target) || target === me?.key)) throw new Error("target must be the key of another member");
|
|
57753
|
+
const takesSources = act === "mute" || act === "allow";
|
|
57754
|
+
if (takesSources && (!Array.isArray(src) || !src.length || !src.every((s) => GROUP_CALL_SOURCES.includes(s)))) throw new Error(`src must list one or more of ${GROUP_CALL_SOURCES.join(", ")}`);
|
|
57755
|
+
if (!me?.isAdmin) return {
|
|
57756
|
+
ok: false,
|
|
57757
|
+
code: "not_admin"
|
|
57758
|
+
};
|
|
57759
|
+
const sfu = groupCallSfu(me.meta);
|
|
57760
|
+
if (!sfu) return {
|
|
57761
|
+
ok: false,
|
|
57762
|
+
code: "unsupported"
|
|
57763
|
+
};
|
|
57764
|
+
return sendGroupCallModeration({
|
|
57765
|
+
sfu,
|
|
57766
|
+
g: groupId,
|
|
57767
|
+
seed: identityFromSeedB64(me.seedB64).seed,
|
|
57768
|
+
act,
|
|
57769
|
+
target: act === "state" ? "" : target,
|
|
57770
|
+
src: takesSources ? src : []
|
|
57771
|
+
});
|
|
57772
|
+
}
|
|
57773
|
+
/**
|
|
57375
57774
|
* The key that seals the group's call media end to end for its newest epoch (WISP 602 § End-to-end encryption), as
|
|
57376
57775
|
* base64url of its 32 bytes, with that epoch. Null until the epoch's secret arrives, once I am out of the group, and
|
|
57377
57776
|
* in a group that is not a community (only a community's epochs give one). A page asks again when the group's
|
|
@@ -58522,6 +58921,19 @@ var GhostlyNode = class GhostlyNode {
|
|
|
58522
58921
|
db.putService(service);
|
|
58523
58922
|
this.servicesChanged();
|
|
58524
58923
|
}
|
|
58924
|
+
/**
|
|
58925
|
+
* A deleted chat's contact loses the services shared with it, unless another chat with the same key is left. Kept,
|
|
58926
|
+
* the grant had no chat to be turned off from, and the same invite joined again (the same key) was served again.
|
|
58927
|
+
*/
|
|
58928
|
+
unshareServicesOf(peerPubKeyZ32) {
|
|
58929
|
+
if (!peerPubKeyZ32 || [...this.links.values()].some(({ stored }) => !stored.group && stored.peerPubKeyZ32 === peerPubKeyZ32)) return;
|
|
58930
|
+
const granted = this.services.filter((s) => s.sharedWith?.includes(peerPubKeyZ32));
|
|
58931
|
+
for (const service of granted) {
|
|
58932
|
+
service.sharedWith = service.sharedWith.filter((k) => k !== peerPubKeyZ32);
|
|
58933
|
+
db.putService(service);
|
|
58934
|
+
}
|
|
58935
|
+
if (granted.length) this.servicesChanged();
|
|
58936
|
+
}
|
|
58525
58937
|
setServiceEnabled({ serviceId, enabled }) {
|
|
58526
58938
|
const service = this.services.find((s) => s.id === serviceId);
|
|
58527
58939
|
if (!service || service.enabled === enabled) return;
|
|
@@ -60217,7 +60629,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
60217
60629
|
dhtDeliveryState: state
|
|
60218
60630
|
};
|
|
60219
60631
|
},
|
|
60220
|
-
firstControlAfterMs: STARTUP_QUIET_MS,
|
|
60632
|
+
firstControlAfterMs: live.floorReplace ? 0 : STARTUP_QUIET_MS,
|
|
60221
60633
|
...this.options.peerDhtPollMs ? { peerDhtPollMs: this.options.peerDhtPollMs } : {},
|
|
60222
60634
|
capsRev: () => live.caps?.rev,
|
|
60223
60635
|
peerCapsRev: (rev) => live.caps?.peerRev(rev),
|
|
@@ -60590,6 +61002,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
60590
61002
|
}, () => this.links.get(linkId) === live)
|
|
60591
61003
|
});
|
|
60592
61004
|
const link = live.link;
|
|
61005
|
+
live.floorReplace = void 0;
|
|
60593
61006
|
const said = stored.profile && !stored.group ? this.statusToSay() : {};
|
|
60594
61007
|
if (said.presence || said.status) link.setStatus(said);
|
|
60595
61008
|
if (linkId === this.activeLinkId) link.setChatActive(true);
|
|
@@ -60744,7 +61157,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
60744
61157
|
nativeFactoriesFor(relayOnly) {
|
|
60745
61158
|
const relay = relayOnly || this.relaysHyperdhtNatively ? this.hyperdhtRelay : "";
|
|
60746
61159
|
return {
|
|
60747
|
-
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-
|
|
61160
|
+
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-DLUiwfnt.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
|
|
60748
61161
|
...relayOnly ? {} : this.options.nativeTransports,
|
|
60749
61162
|
...this.ownIrohRelays && !relayOnly ? { "iroh/1": (seedB64) => this.options.nativeTransports["iroh/1"](seedB64, this.settings.irohRelays?.length ? { relays: [...this.settings.irohRelays] } : {}) } : {},
|
|
60750
61163
|
...this.options.irohWeb ? { "iroh/1": (seedB64) => createIrohWebEndpoint(seedB64, {
|
|
@@ -62290,4 +62703,4 @@ function signalKind(signal) {
|
|
|
62290
62703
|
}
|
|
62291
62704
|
export { EngineServer, credentials as n, bitcoindRpc as t };
|
|
62292
62705
|
|
|
62293
|
-
//# sourceMappingURL=server-
|
|
62706
|
+
//# sourceMappingURL=server-Dgxx_DaN.js.map
|