@ghostlytools/cli 1.11.2 → 1.11.3
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 +11 -10
- package/dist/assets/{api-BM3PsXbB.js → api-DBlaoz8i.js} +129 -37
- package/dist/assets/api-DBlaoz8i.js.map +1 -0
- package/dist/assets/{api-CtXgscmK.js → api-DgU4MZPD.js} +2 -2
- package/dist/assets/{apiKit-lCTQ0EBG.js → apiKit-DesObIDf.js} +4 -4
- package/dist/assets/{apiKit-lCTQ0EBG.js.map → apiKit-DesObIDf.js.map} +1 -1
- package/dist/assets/{appFetch-BKHy5H8J.js → appFetch-C8yZIq1e.js} +3 -3
- package/dist/assets/{appFetch-BKHy5H8J.js.map → appFetch-C8yZIq1e.js.map} +1 -1
- package/dist/assets/{apps-Do26w3c7.js → apps-DkMjDHML.js} +104 -33
- package/dist/assets/apps-DkMjDHML.js.map +1 -0
- package/dist/assets/{apps-DO_gAZgm.js → apps-rzxsjfBV.js} +1 -1
- package/dist/assets/{arkade-CZrLbz-M.js → arkade-CarKONmH.js} +2 -2
- package/dist/assets/{arkade-CZrLbz-M.js.map → arkade-CarKONmH.js.map} +1 -1
- package/dist/assets/{backup-j47AzDvG.js → backup-C0OJCJlM.js} +17 -25
- package/dist/assets/backup-C0OJCJlM.js.map +1 -0
- package/dist/assets/{backup-D21x1f5P.js → backup-CgWU7x0T.js} +1 -1
- package/dist/assets/buttons-Cco0Agfa.js +2 -0
- package/dist/assets/{buttons-CiGlBVBT.js → buttons-fZTEa_2i.js} +34 -5
- package/dist/assets/buttons-fZTEa_2i.js.map +1 -0
- package/dist/assets/{client-raIncVtF.js → client-Ibk3-e60.js} +2 -2
- package/dist/assets/{client-raIncVtF.js.map → client-Ibk3-e60.js.map} +1 -1
- package/dist/assets/{codec-DcG2AeyE.js → codec-DMpQqVSt.js} +2 -2
- package/dist/assets/{codec-DcG2AeyE.js.map → codec-DMpQqVSt.js.map} +1 -1
- package/dist/assets/{envelope-Dud6lntA.js → envelope-CvQVCGdf.js} +2 -2
- package/dist/assets/{envelope-Dud6lntA.js.map → envelope-CvQVCGdf.js.map} +1 -1
- package/dist/assets/{fedimintSdk-DRKRSw14.js → fedimintSdk-zV_5Qdqz.js} +2 -2
- package/dist/assets/{fedimintSdk-DRKRSw14.js.map → fedimintSdk-zV_5Qdqz.js.map} +1 -1
- package/dist/assets/{fixedHosts-CNX7QiUD.js → fixedHosts-6gKn8dp2.js} +3 -3
- package/dist/assets/{fixedHosts-CNX7QiUD.js.map → fixedHosts-6gKn8dp2.js.map} +1 -1
- package/dist/assets/{host-8RskzQgB.js → host-CYlIiY3r.js} +161 -32
- package/dist/assets/host-CYlIiY3r.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-uAThbFub.js → hyperdhtRelay-CdsLcAhY.js} +2 -2
- package/dist/assets/{hyperdhtRelay-uAThbFub.js.map → hyperdhtRelay-CdsLcAhY.js.map} +1 -1
- package/dist/assets/{irohWeb-DGelfgDJ.js → irohWeb-D2IuloLL.js} +19 -12
- package/dist/assets/irohWeb-D2IuloLL.js.map +1 -0
- package/dist/assets/{main-BC33ooYg.js → main-C0PfjKTe.js} +109 -42
- package/dist/assets/main-C0PfjKTe.js.map +1 -0
- package/dist/assets/{mainline-DYrjsS1t.js → mainline-Cu61qcPS.js} +35 -18
- package/dist/assets/mainline-Cu61qcPS.js.map +1 -0
- package/dist/assets/{networkReason-n2oBs4by.js → networkReason-Dt7Yx_n4.js} +3 -3
- package/dist/assets/{networkReason-n2oBs4by.js.map → networkReason-Dt7Yx_n4.js.map} +1 -1
- package/dist/assets/{nwc-Do3VSlIS.js → nwc-CtZypDcv.js} +3 -3
- package/dist/assets/{nwc-Do3VSlIS.js.map → nwc-CtZypDcv.js.map} +1 -1
- package/dist/assets/{nwcProvider-Du5aWNIn.js → nwcProvider-DYHkd0iu.js} +2 -2
- package/dist/assets/{nwcProvider-Du5aWNIn.js.map → nwcProvider-DYHkd0iu.js.map} +1 -1
- package/dist/assets/{ownDid-CwwYu8s2.js → ownDid-CJ0ta8CL.js} +2 -2
- package/dist/assets/{ownDid-CwwYu8s2.js.map → ownDid-CJ0ta8CL.js.map} +1 -1
- package/dist/assets/{ownStatus-D7dB4zJB.js → ownStatus-D4HC6tNR.js} +11 -6
- package/dist/assets/{ownStatus-D7dB4zJB.js.map → ownStatus-D4HC6tNR.js.map} +1 -1
- package/dist/assets/{profiles-NyF5FnYF.js → profiles-Ccdq6Xf6.js} +3 -3
- package/dist/assets/{profiles-NyF5FnYF.js.map → profiles-Ccdq6Xf6.js.map} +1 -1
- package/dist/assets/{registry-C734VrO9.js → registry-CE0PpQAE.js} +1 -1
- package/dist/assets/{registry-DKDInr0A.js → registry-LvxsLJ5S.js} +18 -7
- package/dist/assets/registry-LvxsLJ5S.js.map +1 -0
- package/dist/assets/{resolve-3Tqh9AWQ.js → resolve-6kVu2DE5.js} +2 -2
- package/dist/assets/{resolve-3Tqh9AWQ.js.map → resolve-6kVu2DE5.js.map} +1 -1
- package/dist/assets/{server-B6PQ6iae.js → server-Q3VcNqGt.js} +245 -97
- package/dist/assets/server-Q3VcNqGt.js.map +1 -0
- package/dist/assets/{src-ChJijTlM.js → src-DjVj2ynY.js} +188 -42
- package/dist/assets/src-DjVj2ynY.js.map +1 -0
- package/dist/assets/{sshForges-Brf0fslM.js → sshForges-DeZ9cN9Q.js} +4 -3
- package/dist/assets/sshForges-DeZ9cN9Q.js.map +1 -0
- package/dist/assets/{translate-xLme9Rdh.js → translate-iQZq4TnY.js} +35 -14
- package/dist/assets/translate-iQZq4TnY.js.map +1 -0
- package/dist/assets/{usdt-CSU5KzTV.js → usdt-DnyTGdTX.js} +3 -3
- package/dist/assets/{usdt-CSU5KzTV.js.map → usdt-DnyTGdTX.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-BM3PsXbB.js.map +0 -1
- package/dist/assets/apps-Do26w3c7.js.map +0 -1
- package/dist/assets/backup-j47AzDvG.js.map +0 -1
- package/dist/assets/buttons-CiGlBVBT.js.map +0 -1
- package/dist/assets/buttons-D2l2bVCG.js +0 -2
- package/dist/assets/host-8RskzQgB.js.map +0 -1
- package/dist/assets/irohWeb-DGelfgDJ.js.map +0 -1
- package/dist/assets/main-BC33ooYg.js.map +0 -1
- package/dist/assets/mainline-DYrjsS1t.js.map +0 -1
- package/dist/assets/registry-DKDInr0A.js.map +0 -1
- package/dist/assets/server-B6PQ6iae.js.map +0 -1
- package/dist/assets/src-ChJijTlM.js.map +0 -1
- package/dist/assets/sshForges-Brf0fslM.js.map +0 -1
- package/dist/assets/translate-xLme9Rdh.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { n as traceJoin } from "./joinTrace-CjRDFy85.js";
|
|
2
|
-
import { $
|
|
2
|
+
import { $ as groupName, $a as EDIT_RATE_WINDOW_MS, $c as planKnocks, $l as createContactLink, $n as PAIRED_FRAME_TOO_LARGE, $o as commitHash, $r as STATUS_IDLE_AFTER_MS, $s as filePartName, $t as ETHEREUM_USDT, $u as isDiscoveryBudgetError, A as entryParams, Ac as readSetUpdate, Ai as chatAppId, Al as readAppBundleAsync, Ar as beaconKeys, Au as firstDeviceSetSecret, B as GROUP_LIMITS, Ba as sanitizeFileName, Bc as enrollCancelReason, Bi as dialDescriptors, Bo as sameButtonText, Br as pickHubs, Bs as serviceIdFromName, Bu as DEFAULT_RELAYS, C as GROUP_READ_NOTE_COMMUNITY, Cc as readHandoffHello, Cd as toBase64Url, Ci as relayRequest, Cl as appDigest, Co as replySnippet, Cr as groupSignalFrame, Cs as decodeControl, Dc as sealHandoffPiece, Di as APP_RANGE_LIMITS, Dr as meshHubs, Du as turnPutSummary, E as encodeCommunityLink, Ec as readHandoffVerified, Ed as utf8Encode, Ei as vapidKeysMatch, Er as mayBeHub, Eu as classifyTurnRead, Fa as DHT_MESSAGE_TTL, Fi as STATUS_CARD_CAPABILITY, Fl as appRef, Fn as findEndpoint, Fr as lobbyKeys, Fs as parseCallSignal, Fu as turnInstance, G as CatchUpAnswers, Gc as enrollProofFrame, Go as claimedTime, Gr as shouldBeHub, Gs as HANDOFF_HELLO, H as GROUP_READ_NOTE, Hc as enrollDoneFrame, Hl as readAppRevocation, Ho as statusCardText, Hr as readBeacon, Hs as HANDOFF_CANCEL, I as GroupWakeLimiter, Ia as peekDhtMailbox, Ii as UPGRADE_CAPABILITY, Il as appRefPublisher, In as isFederationId, Ir as lobbyRecords, Iu as turnKeys, J as GROUP_EDIT_TEXT_BYTES, Ja as parseVoiceMeta, Jc as verifyEnrollProof, Ji as emptyIdentityLedger, Jl as parseImageMeta, Jo as shownTime, Js as HANDOFF_PIECE_BYTES, Jt as didDhtFromPublicKey, Kc as readEnrollGrant, Ko as heardTime, Kr as ChatFiles, Ks as HANDOFF_OFFER, Ku as currentRelays, L as groupWakeFrame, La as DHT_FILE_CAPABILITY, Li as CapsExchange, Ln as parseCashuRequestPayload, Lr as mergeBeacon, Ls as emptyLinkRecords, Lu as turnName, M as knockRecords, Mc as setUpdateFrame, Mi as APPS_CAPABILITY, Mn as ENDPOINT, Mo as STATUS_CARD_LIMITS, Mr as doorHubs, Mu as readTurnPacket, N as mergeKnocks, Nc as signTombstone, Ni as BUTTONS_CAPABILITY, Nl as APP_STATEMENT_LIMITS, Nn as cashuRequestPayload, Nr as freshHubs, Ns as contactRtcConfig, Nu as signTurnPacket, O as decodeGroupEntryLink, Oi as isServeId, Ol as pacer, Or as pickMeshHubs, Os as RTC_CONFIG, Ou as TURN_LAST_SEQUENCE, P as readKnocks, Pc as verifySetUpdate, Pi as EDIT_CAPABILITY, Pl as appFingerprint, Pn as fedimintRequestPayload, Pr as hubRank, Pu as signTurnRelease, Q as mentionsMember, Qa as EDIT_BUFFER_MS, Qc as newInbox, Ql as readCanonicalJson, Qn as LIVENESS_PING_MS, Qo as MEMBER_KEY, Qs as NO_ATTEMPTS, Qt as signDidDhtPacket, Qu as budgetRetryMs, R as groupWakes, Ra as dhtFileId, Ri as DHT_TEXT_CAPABILITY, Rl as isAppHash, Rn as parseFedimintRequestPayload, Rr as mergeLobby, Rs as HTTP_SERVICE_PROTO, Ru as turnStatedVerifier, S as CommunitySession, Sc as readHandoffHave, Sd as randomBytes, Si as parseWakeFrame, So as readReply, Ss as LIMITS, Su as webCryptoSigner, T as decodeCommunityLink, Tc as readHandoffTurnFrame, Td as utf8Decode, Ti as checkPushEndpoint, Tr as MESH_HUBS, Tu as TURN_SETTLE_MS, U as GroupSession, Uc as enrollGrantFrame, Ul as readAppRevocationShape, Ur as readBeaconHead, Us as HANDOFF_DONE, Uu as RelayTransport, Va as sanitizeMime, Vc as enrollDigits, Vl as isAppRef, Vr as rankHubs, Vs as HANDOFF_ACK, W as frameBytes, Wc as enrollHelloFrame, Wo as arrivalKey, Wr as readLobby, Ws as HANDOFF_HAVE, X as meshMessageRef, Xc as endedRequests, Xl as canonicalJson, Xn as GhostLink, Xo as GROUP_MEMBER_CAP, Xr as transferEnded, Xs as HANDOFF_TIMINGS, Xt as encodeDidDhtPacket, Xu as traceLink, Y as carryMentions, Yc as clearMissed, Yo as GROUP_ADMIN_OFF_ERROR, Yr as sentWhole, Ys as HANDOFF_REQUEST, Yt as encodeDidDhtDeactivated, Z as parseCommunityEdit, Za as parseVideoMeta, Zc as inboxRecord, Zl as canonicalJsonBytes, Zn as INVITE_TAKEN, Zr as transferStalled, Zs as HANDOFF_VERIFIED, _ as GroupTypingBoard, _a as newMailbox, _c as handoffVersions, _d as sanitizeDisplayText, _i as WAKE_ONLINE_DELAY_MS, _l as requestRecords, _n as sparkInvoiceDetails, _o as reactionIsNewer, _s as presenceSeenAt, _u as deviceKeyZ32, a as appRevocationFor, aa as validExternalKey, ac as handoffContext, ai as TypingSender, al as contactAskerFrame, an as TEST_USDT_FAUCET_AMOUNT, ar as engineText, as as RATCHET_CAPABILITY, au as OwnInviteError, b as sealGroupTyping, bc as readHandoffCancel, bd as fromBase64Url, bi as deviceWakeRequest, bl as APP_BUNDLE_MAGIC, bn as isPubkyKey, bo as wireReaction, bs as parseLocalTarget, bt as normalizeAtprotoHandle, bu as newDeviceSetSecret, c as checkAppBeforeRun, cc as handoffDigest, cd as identityFromSeed, cl as knockSlotIdentity, cn as arkAddressPrefix, co as forwardedAgain, cr as GROUP_HAVE_FRAME, cs as ratchetSessionOf, cu as encodeInviteCode, da as HOLD_CAPABILITY, dc as handoffManifestFrames, di as nextPinNumber, dl as linkRecords, dn as formatPaymentAmount, do as GROUP_REACTION_FRAME, ea as receivedIdentityStatus, ec as handoffAttemptAllowed, ed as withRequestOptions, ei as liveStatus, el as settleRequest, en as EVM_TEST_CHAINS, eo as MAX_REMOVAL_NUMBER, er as pairedEditFits, es as parseGroupCommit, eu as encodeContactLink, fa as HOLD_DATED_BACK_MS, fc as handoffOfferFrame, fd as verify, fi as pinIsNewer, fl as makeStampPaced, fn as validatePaymentTarget, fo as REACTION_LIMITS, fr as groupFileFallback, fs as DHT_POLL_INTERVALS, fu as DEVICES_CAPABILITY, ga as isHoldUrl, gc as handoffStreamKey, gd as hasVisible, gi as WAKE_ONLINE_BATCH_MS, gl as readLinkRecord, gn as sparkAddressKind, go as reactionEmoji, gs as WATCH_PEER_MS, gu as deviceEchoNonce, ha as HoldRefusedError, hc as handoffRetryAfter, hi as WAKE_CALL_INTERVAL_MS, hl as readKnockSlot, hn as SPARK_PROVIDER, ho as queueReaction, hs as RELAY_POLL_INTERVALS, hu as deviceEchoFrame, i as addedAppPermissions, ia as emptyProofLedger, ic as handoffCancelFrame, il as REQUEST_LIFETIME_MS, ir as engineError, is as edgeParams, iu as readDeviceInvite, j as knockIdentity, jc as setAckFrame, ji as isAppVersion, jl as sha256Paced, jn as decodeBolt11, jr as beaconRecords, ju as nextTurnPosition, k as encodeGroupEntryLink, kr as COMMUNITY_TOPOLOGY, ku as TURN_MAX, l as planAppUpdate, lc as handoffEphemeral, ld as identityFromSeedB64, li as PIN_LIMITS, ll as knockSlotOf, ln as assertTokenUnits, lo as readForwarded, ls as DirectPathWatch, lu as inviteLink, ma as HoldKeys, mc as handoffReleaseFrame, md as sanitizeAvatar, mi as readPin, ml as openRequest, mn as SPARK_NETWORKS, mo as nextReactionNumber, mr as readGroupFileMeta, ms as PRESENCE_WINDOW, mu as HANDOFF_CAPABILITY, n as readX401SdJwtVc, na as lastSharedWithMe, nc as handoffAttemptSucceeded, nl as turnOff, nn as PaymentPreflightError, no as RateWindow, nr as pairedMessageFrame, ns as rosterHas, nu as createDeviceInvite, o as appStoreDecision, oa as TRANSPORTS, oc as handoffContextProof, ol as contactAskerHolds, on as USDT_PUBLIC_RPC, or as parseEngineError, os as RatchetBox, ou as createChatInvite, p as readAppStoreSteps, pa as HOLD_LIMITS, pc as handoffPakeFrame, pi as pinNumberHolds, pl as mergeContactKnocks, pn as walletNetworkOf, po as ReactionWindow, pu as ENROLL_CAPABILITY, qa as fileMessageText, qc as readEnrollHello, qo as receivedTimestamp, qr as FILE_LIMITS, qs as HANDOFF_PAKE, qt as didDhtDocument, qu as normalizeRelayUrl, r as sameX401HolderJwk, ra as PeerProofs, rc as handoffBusyFrame, rd as createRelayPayload, rl as ContactRequestError, rn as SEPOLIA_TEST_USDT, ro as dhtEditId, rr as EngineError, rs as verifyCommitSignature, ru as deviceInviteJoinerParams, s as appUpdateDecision, sa as automaticTransport, sc as handoffDataFrame, sd as createIdentity, si as typingActivity, sl as contactDay, sn as WALLET_NETWORKS, so as parseLinkPreview, sr as GROUP_FILE_LIMITS, ss as emptyRatchetState, su as decodeInviteCode, t as newX401HolderKey, tc as handoffAttemptFailed, td as PacketTooLargeError, ti as personStatus, tl as takeRequest, tn as ONCHAIN_PROVIDER, to as REMOVED_TEXT, tr as pairedMessageFits, ts as rosterAdmin, tu as readContactLink, u as APP_STORE_LIMITS, uc as handoffHelloFrame, ud as publicKeyFromZ32, ui as mayPin, ul as knockSlotRecords, un as assertWholeSats, uo as COMMUNITY_REACTION_FRAME, uu as inviteOwnership, v as groupTypingEpoch, va as readManifest, vc as newHandoffId, vd as stripHidden, vl as seenEntry, vn as isBitcoinAddress, vo as readReaction, vr as CarriedTransport, vs as GhostlyHttpError, vu as deviceLinkPairing, w as communityHasFrame, wc as readHandoffPake, wd as toZ32, wi as wakeRequest, wl as appViewOf, wo as BUTTON_ID, wr as readGroupSignal, ws as encodeControl, wu as TURN_RAISE_READ_TIMEOUT_MS, x as COMMUNITY_LIMITS, xc as readHandoffDone, xi as newWakeToken, xo as pairedReplyAuthor, xs as webLocalFetch, xu as seedSigner, y as openGroupTyping, yc as readHandoffAck, yd as bytesEqual, yi as WakeLimiter, yl as APP_BUNDLE_LIMITS, yo as validReactionNumber, ys as formatLocalTarget, yt as isAtprotoDid, yu as devicePingFrame, z as parseGroupWakeFrame, za as formatFileSize, zc as enrollCancelFrame, zi as capsDescriptors, zl as isAppKey, zo as checkStatusCard, zr as newerHead, zs as LEGACY_SERVICES, zu as turnVerifierMark } from "./src-DjVj2ynY.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-Clyb52K2.js";
|
|
4
4
|
import { t as bitcoindRpc } from "./bitcoindProvider-BvoRh0D5.js";
|
|
5
|
-
import { t as nwc } from "./nwcProvider-
|
|
5
|
+
import { t as nwc } from "./nwcProvider-DYHkd0iu.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-
|
|
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-Dt7Yx_n4.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 lightningPaying, A as paymentNetworksOf, B as removeStored, C as paymentWireId, Ct as setSingleWriterGate, D as createTiming, E as createFailure, F as copyForForward, G as IdentityProofs, H as streamStored, I as forwardError, J as cardsKey, K as CASHU_CARD, L as forwardKind, N as WALLET_TYPES, O as crossNetwork, P as FORWARD_MESSAGE_GONE, Q as journaledPayment, R as FileAppender, S as paymentAlias, St as setAwayWallets, T as assertConfirmedReal, V as storedSize, 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, k as paymentNetwork, 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 } from "./irohWeb-
|
|
10
|
-
import { r as loadFedimintSdk, t as fedimintDatabase } from "./fedimintSdk-
|
|
9
|
+
import { $ as lightningPaying, A as paymentNetworksOf, B as removeStored, C as paymentWireId, Ct as setSingleWriterGate, D as createTiming, E as createFailure, F as copyForForward, G as IdentityProofs, H as streamStored, I as forwardError, J as cardsKey, K as CASHU_CARD, L as forwardKind, N as WALLET_TYPES, O as crossNetwork, P as FORWARD_MESSAGE_GONE, Q as journaledPayment, R as FileAppender, S as paymentAlias, St as setAwayWallets, T as assertConfirmedReal, V as storedSize, 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, k as paymentNetwork, 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 } from "./irohWeb-D2IuloLL.js";
|
|
10
|
+
import { r as loadFedimintSdk, t as fedimintDatabase } from "./fedimintSdk-zV_5Qdqz.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-
|
|
13
|
-
import { d as chosenResolver, m as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer } from "./resolve-
|
|
14
|
-
import { a as
|
|
15
|
-
import { n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-
|
|
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-CJ0ta8CL.js";
|
|
13
|
+
import { d as chosenResolver, m as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer } from "./resolve-6kVu2DE5.js";
|
|
14
|
+
import { a as besideUrl, c as isGitHubPage, i as appPasteUrl, n as APP_FETCH_LIMITS, o as boundedAppFetch, r as AppFetchError, s as isAppFetchUrl } from "./appFetch-C8yZIq1e.js";
|
|
15
|
+
import { n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-CvQVCGdf.js";
|
|
16
16
|
import { t as hyperdhtRelayProblem } from "./hyperdhtRelay-1wzya_0L.js";
|
|
17
17
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
18
18
|
import { hkdf } from "@noble/hashes/hkdf.js";
|
|
@@ -746,7 +746,7 @@ function viewNews(before, after) {
|
|
|
746
746
|
//#endregion
|
|
747
747
|
//#region ../browser/src/engine/paymentAdapters/usdtWallet.ts
|
|
748
748
|
/** The Ethereum libraries, a large part of the app: loaded once a USDT wallet is made, opened or restored, not with the engine. */
|
|
749
|
-
var loadUsdt = () => import("./usdt-
|
|
749
|
+
var loadUsdt = () => import("./usdt-DnyTGdTX.js");
|
|
750
750
|
/** Every new profile starts with this wallet: an address to receive on, nothing to set up. */
|
|
751
751
|
var DEFAULT_USDT = {
|
|
752
752
|
network: "ethereum",
|
|
@@ -1235,7 +1235,7 @@ async function restoreArkDatabase(walletId, snapshot) {
|
|
|
1235
1235
|
//#endregion
|
|
1236
1236
|
//#region ../browser/src/engine/paymentAdapters/arkWallet.ts
|
|
1237
1237
|
/** The Ark SDK, a large part of the app: loaded once an Ark wallet is made, opened or restored, not with the engine. */
|
|
1238
|
-
var loadArkade = () => import("./arkade-
|
|
1238
|
+
var loadArkade = () => import("./arkade-CarKONmH.js");
|
|
1239
1239
|
/** How long a Testnet wallet about to make way for another waits for its server to say what it holds. */
|
|
1240
1240
|
var RETIRE_READ_MS = 1e4;
|
|
1241
1241
|
/** Every new profile starts with this wallet: nothing to set up before receiving. */
|
|
@@ -3973,7 +3973,28 @@ var PaymentCoordinator = class {
|
|
|
3973
3973
|
return saved.review;
|
|
3974
3974
|
});
|
|
3975
3975
|
}
|
|
3976
|
+
/**
|
|
3977
|
+
* A reconcile asked for while another call on the same payment is under way (the approval, or a status check) may
|
|
3978
|
+
* bring news it started too early to see: the contact saying they took the ecash just after the mint was asked. It
|
|
3979
|
+
* runs once more after that call, shared by every caller meanwhile, instead of taking that call's older answer: the
|
|
3980
|
+
* payer's card waited for the next poll, up to 10 s after the contact had it.
|
|
3981
|
+
*/
|
|
3976
3982
|
reconcile(id) {
|
|
3983
|
+
const running = this.active.get(id);
|
|
3984
|
+
if (!running) return this.reconcileNow(id);
|
|
3985
|
+
let next = this.again.get(id);
|
|
3986
|
+
if (!next) {
|
|
3987
|
+
next = running.catch(() => {}).then(() => {
|
|
3988
|
+
this.again.delete(id);
|
|
3989
|
+
return this.reconcile(id);
|
|
3990
|
+
});
|
|
3991
|
+
this.again.set(id, next);
|
|
3992
|
+
}
|
|
3993
|
+
return next;
|
|
3994
|
+
}
|
|
3995
|
+
/** The reconcile after the one under way, by payment (`reconcile`). */
|
|
3996
|
+
again = /* @__PURE__ */ new Map();
|
|
3997
|
+
reconcileNow(id) {
|
|
3977
3998
|
return this.once(id, async () => {
|
|
3978
3999
|
const saved = await this.require(id);
|
|
3979
4000
|
if (!["submitted", "unknown"].includes(saved.review.state)) return saved.review;
|
|
@@ -9462,7 +9483,7 @@ var HostNotContacted = class extends Error {};
|
|
|
9462
9483
|
*/
|
|
9463
9484
|
function fixedHostsFetch(fetch) {
|
|
9464
9485
|
return async (url, options) => {
|
|
9465
|
-
const { fixedIdentityHosts } = await import("./fixedHosts-
|
|
9486
|
+
const { fixedIdentityHosts } = await import("./fixedHosts-6gKn8dp2.js");
|
|
9466
9487
|
const host = hostOf$1(url);
|
|
9467
9488
|
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`);
|
|
9468
9489
|
return fetch(url, options);
|
|
@@ -10911,8 +10932,8 @@ var STORE_READ_PARALLEL = 4;
|
|
|
10911
10932
|
/** Revocations are checked this long at a time before the page's thread is let go. */
|
|
10912
10933
|
var REVOCATIONS_SLICE_MS = 10;
|
|
10913
10934
|
/**
|
|
10914
|
-
* `ghostly-revoke.json` files whose result is kept, so an unchanged one is not
|
|
10915
|
-
* at most this many, and of the
|
|
10935
|
+
* `ghostly-revoke.json` files whose result for one app is kept, so an unchanged one is not read again (the oldest dropped
|
|
10936
|
+
* first): at most this many, and of the lists held at most one file's limit of bytes in all. A publisher's file is
|
|
10916
10937
|
* small; nine large ones beside one app's URLs, or one that changes at every check, would stay for the engine's life.
|
|
10917
10938
|
*/
|
|
10918
10939
|
var REVOCATION_FILES_KEPT = {
|
|
@@ -10920,6 +10941,12 @@ var REVOCATION_FILES_KEPT = {
|
|
|
10920
10941
|
bytes: APP_FETCH_LIMITS.revocationsBytes
|
|
10921
10942
|
};
|
|
10922
10943
|
/**
|
|
10944
|
+
* Verdicts of `ghostly-revoke.json` files (every entry verified, or the file refused), by the SHA-256 of their bytes:
|
|
10945
|
+
* a file whose list was dropped from `REVOCATION_FILES_KEPT` is read again with no signature checked. About 64 bytes
|
|
10946
|
+
* each; the oldest dropped first.
|
|
10947
|
+
*/
|
|
10948
|
+
var REVOCATION_VERDICTS_KEPT = 1024;
|
|
10949
|
+
/**
|
|
10923
10950
|
* Revocations of store indexes whose signature was checked, kept by `appRevocationId` so an index that changes around
|
|
10924
10951
|
* them does not have each checked again (the one read longest ago dropped first): four indexes' worth, about 1 MiB.
|
|
10925
10952
|
*/
|
|
@@ -11093,8 +11120,8 @@ async function noteBundles(change) {
|
|
|
11093
11120
|
*/
|
|
11094
11121
|
var APP_REVOCATIONS_KEY = "appRevocations";
|
|
11095
11122
|
/**
|
|
11096
|
-
* Revocations kept there: at most `each` of one app and `all` in all,
|
|
11097
|
-
* revocation is at most about 3.5 KiB (64 digests and a reason).
|
|
11123
|
+
* Revocations kept there: at most `each` of one app and `all` in all, dropped from the publisher holding the most (see
|
|
11124
|
+
* `keepRevocations`). A revocation is at most about 3.5 KiB (64 digests and a reason).
|
|
11098
11125
|
*/
|
|
11099
11126
|
var REVOCATIONS_KEPT = {
|
|
11100
11127
|
each: 64,
|
|
@@ -11130,12 +11157,19 @@ function keepRevocations(settings, ref, add) {
|
|
|
11130
11157
|
if (merged.size === before.length) return;
|
|
11131
11158
|
kept.delete(ref);
|
|
11132
11159
|
kept.set(ref, [...merged.values()].slice(-REVOCATIONS_KEPT.each));
|
|
11160
|
+
const held = /* @__PURE__ */ new Map();
|
|
11133
11161
|
let all = 0;
|
|
11134
|
-
for (const list of kept
|
|
11135
|
-
|
|
11136
|
-
|
|
11162
|
+
for (const [r, list] of kept) {
|
|
11163
|
+
held.set(appRefPublisher(r), (held.get(appRefPublisher(r)) ?? 0) + list.length);
|
|
11164
|
+
all += list.length;
|
|
11165
|
+
}
|
|
11166
|
+
while (all > REVOCATIONS_KEPT.all) {
|
|
11167
|
+
let most = "";
|
|
11168
|
+
for (const [publisher, n] of held) if (n > (held.get(most) ?? 0)) most = publisher;
|
|
11169
|
+
const [other, list] = [...kept].find(([r]) => appRefPublisher(r) === most);
|
|
11137
11170
|
const drop = Math.min(list.length, all - REVOCATIONS_KEPT.all);
|
|
11138
11171
|
all -= drop;
|
|
11172
|
+
held.set(most, held.get(most) - drop);
|
|
11139
11173
|
if (drop === list.length) kept.delete(other);
|
|
11140
11174
|
else kept.set(other, list.slice(drop));
|
|
11141
11175
|
}
|
|
@@ -11358,8 +11392,9 @@ var Apps = class {
|
|
|
11358
11392
|
held = /* @__PURE__ */ new Map();
|
|
11359
11393
|
heldStores = null;
|
|
11360
11394
|
/**
|
|
11361
|
-
* Listing URLs whose peek showed nothing to take (`<store> <ref> <url>` → `<index digest> <listed digest
|
|
11362
|
-
* index listing the same is not peeked again at
|
|
11395
|
+
* Listing URLs whose peek showed nothing to take (`<store> <ref> <url>` → `<index digest> <listed digest> <pin>
|
|
11396
|
+
* <installed digest> <waiting digest>`): the same index listing the same, for the same app, is not peeked again at
|
|
11397
|
+
* every check.
|
|
11363
11398
|
*/
|
|
11364
11399
|
listingMisses = /* @__PURE__ */ new Map();
|
|
11365
11400
|
/**
|
|
@@ -11373,8 +11408,10 @@ var Apps = class {
|
|
|
11373
11408
|
* commit): by store key, with that URL. The same bytes there again are not checked whole at every refresh.
|
|
11374
11409
|
*/
|
|
11375
11410
|
behindReads = /* @__PURE__ */ new Map();
|
|
11376
|
-
/** `ghostly-revoke.json` files checked, by the SHA-256 of their bytes:
|
|
11411
|
+
/** `ghostly-revoke.json` files checked, by the SHA-256 of their bytes and the app read (`<digest> <ref>`): that app's revocations in it, and the bytes the list counts for. */
|
|
11377
11412
|
revocationFiles = /* @__PURE__ */ new Map();
|
|
11413
|
+
/** Whether every entry of a `ghostly-revoke.json` verified, by the SHA-256 of its bytes: at most `REVOCATION_VERDICTS_KEPT`. */
|
|
11414
|
+
revocationVerdicts = /* @__PURE__ */ new Map();
|
|
11378
11415
|
/** Revocations read in a store's index and verified, by `appRevocationId`: at most `STORE_REVOCATIONS_KEPT`. */
|
|
11379
11416
|
storeRevocations = /* @__PURE__ */ new Set();
|
|
11380
11417
|
checkedRevocations = {
|
|
@@ -12038,23 +12075,32 @@ var Apps = class {
|
|
|
12038
12075
|
if (read.has(url)) continue;
|
|
12039
12076
|
read.add(url);
|
|
12040
12077
|
try {
|
|
12041
|
-
const file = await this.readRevocationsFile(await this.host.fetch(url, {
|
|
12078
|
+
const file = await this.readRevocationsFile(ref, await this.host.fetch(url, {
|
|
12042
12079
|
maxBytes: APP_FETCH_LIMITS.revocationsBytes,
|
|
12043
12080
|
revalidate: true
|
|
12044
12081
|
}));
|
|
12045
|
-
if (file) (out ??= []).push(...file
|
|
12082
|
+
if (file) (out ??= []).push(...file);
|
|
12046
12083
|
} catch {}
|
|
12047
12084
|
}
|
|
12048
12085
|
return out;
|
|
12049
12086
|
}
|
|
12050
12087
|
/**
|
|
12051
12088
|
* `readAppRevocations` (one entry that does not verify refuses the file, null here), with a pause every few ms: the
|
|
12052
|
-
* engine shares the page's thread, and each entry is a signature check.
|
|
12089
|
+
* engine shares the page's thread, and each entry is a signature check. Of the file, the revocations of `ref`. The
|
|
12090
|
+
* same bytes are not checked again: their list for `ref` is kept while it fits, and their verdict longer, so a file
|
|
12091
|
+
* read again is only parsed, with no signature checked.
|
|
12053
12092
|
*/
|
|
12054
|
-
async readRevocationsFile(bytes) {
|
|
12093
|
+
async readRevocationsFile(ref, bytes) {
|
|
12055
12094
|
const id = toBase64Url(await sha256Paced(bytes));
|
|
12056
|
-
const
|
|
12057
|
-
if (
|
|
12095
|
+
const verdict = this.revocationVerdicts.get(id);
|
|
12096
|
+
if (verdict === false) return null;
|
|
12097
|
+
const key = `${id} ${ref}`;
|
|
12098
|
+
const known = this.revocationFiles.get(key);
|
|
12099
|
+
if (known !== void 0) {
|
|
12100
|
+
this.revocationFiles.delete(key);
|
|
12101
|
+
this.revocationFiles.set(key, known);
|
|
12102
|
+
return known.revocations;
|
|
12103
|
+
}
|
|
12058
12104
|
const read = readCanonicalJson(bytes);
|
|
12059
12105
|
let out = null;
|
|
12060
12106
|
if (read.ok && Array.isArray(read.value) && read.value.length <= APP_STATEMENT_LIMITS.revocations) {
|
|
@@ -12062,18 +12108,21 @@ var Apps = class {
|
|
|
12062
12108
|
const pause = pacer(REVOCATIONS_SLICE_MS);
|
|
12063
12109
|
for (const entry of read.value) {
|
|
12064
12110
|
await pause();
|
|
12065
|
-
const one = readAppRevocation(entry);
|
|
12111
|
+
const one = verdict ? readAppRevocationShape(entry) : readAppRevocation(entry);
|
|
12066
12112
|
if (!one.ok) {
|
|
12067
12113
|
out = null;
|
|
12068
12114
|
break;
|
|
12069
12115
|
}
|
|
12070
|
-
out.push(one.revocation);
|
|
12116
|
+
if (one.revocation.statement.app === ref) out.push(one.revocation);
|
|
12071
12117
|
}
|
|
12072
12118
|
}
|
|
12073
|
-
this.
|
|
12074
|
-
this.
|
|
12119
|
+
this.revocationVerdicts.delete(id);
|
|
12120
|
+
this.revocationVerdicts.set(id, out !== null);
|
|
12121
|
+
if (this.revocationVerdicts.size > REVOCATION_VERDICTS_KEPT) this.revocationVerdicts.delete(this.revocationVerdicts.keys().next().value);
|
|
12122
|
+
if (!out) return null;
|
|
12123
|
+
this.revocationFiles.set(key, {
|
|
12075
12124
|
revocations: out,
|
|
12076
|
-
bytes: out ?
|
|
12125
|
+
bytes: out.length ? canonicalJsonBytes(out).length : 0
|
|
12077
12126
|
});
|
|
12078
12127
|
let held = 0;
|
|
12079
12128
|
for (const file of this.revocationFiles.values()) held += file.bytes;
|
|
@@ -12637,17 +12686,24 @@ var Apps = class {
|
|
|
12637
12686
|
async acceptUpdate({ ref, sequence, added: shown }) {
|
|
12638
12687
|
if (shown !== void 0 && !Array.isArray(shown)) fail("permissions", "The permissions shown must be a list");
|
|
12639
12688
|
const installed = await this.installedOrFail(ref);
|
|
12689
|
+
if (!installed.pending && sequence !== void 0 && installed.sequence === sequence) return this.view(installed, await this.stores());
|
|
12640
12690
|
const pending = installed.pending ?? fail("no-update", "No update waits for this app");
|
|
12641
12691
|
if (sequence !== void 0 && pending.sequence !== sequence) fail("permissions-changed", `Another update waits now, which adds ${pending.added.length ? pending.added.join(", ") : "no permission"}; look at it again`);
|
|
12642
12692
|
const bytes = await this.readBundleBytes(pending.bytes, pending.digest);
|
|
12643
12693
|
const read = bytes ? await readAppBundleAsync(bytes) : null;
|
|
12644
12694
|
if (!read?.ok || read.bundle.digest !== pending.digest) {
|
|
12645
12695
|
const { pending: _p, ...rest } = installed;
|
|
12646
|
-
if (!await this.
|
|
12696
|
+
if (!await this.putAppIfUnchanged(rest, installed)) return this.acceptedOver(ref, pending.digest);
|
|
12647
12697
|
fail("needs-files", "The update's files are gone; it is fetched again at the next check");
|
|
12648
12698
|
}
|
|
12649
12699
|
const stores = await this.stores();
|
|
12650
|
-
if (installed.store !== void 0 && this.pinnedListing(installed, stores)?.digest !== pending.digest)
|
|
12700
|
+
if (installed.store !== void 0 && this.pinnedListing(installed, stores)?.digest !== pending.digest) {
|
|
12701
|
+
if (stores.find((s) => s.key === installed.store)?.index) {
|
|
12702
|
+
const { pending: _p, ...rest } = installed;
|
|
12703
|
+
if (await this.putAppIfUnchanged(rest, installed)) await this.removeBundle(pending.bytes, pending.digest);
|
|
12704
|
+
}
|
|
12705
|
+
fail("unlisted", "The store no longer lists this update");
|
|
12706
|
+
}
|
|
12651
12707
|
const run = this.runStatus(versionOf(read.bundle.manifest, pending.digest), this.storeViews(stores), installed.revocations);
|
|
12652
12708
|
if (run.status === "revoked") fail("revoked", "Its publisher revoked this version");
|
|
12653
12709
|
if (run.status === "removed") fail("removed", `Removed by ${run.by[0].name}: ${run.by[0].reason}`);
|
|
@@ -12658,27 +12714,29 @@ var Apps = class {
|
|
|
12658
12714
|
if (plan.action === "refuse") fail(plan.decision, "This update can no longer be installed");
|
|
12659
12715
|
const added = plan.action === "ask" ? plan.added : [];
|
|
12660
12716
|
if (added.length !== pending.added.length || added.some((p) => !pending.added.includes(p))) {
|
|
12661
|
-
if (!await this.
|
|
12717
|
+
if (!await this.putAppIfUnchanged({
|
|
12662
12718
|
...installed,
|
|
12663
12719
|
pending: {
|
|
12664
12720
|
...pending,
|
|
12665
12721
|
added
|
|
12666
12722
|
}
|
|
12667
|
-
}))
|
|
12723
|
+
}, installed)) return this.acceptedOver(ref, pending.digest);
|
|
12668
12724
|
fail("permissions-changed", `This update now adds ${added.length ? added.join(", ") : "no permission"}; look at it again`);
|
|
12669
12725
|
}
|
|
12670
12726
|
if (shown && added.some((p) => !shown.includes(p))) fail("permissions-changed", `This update now adds ${added.join(", ")}; look at it again`);
|
|
12671
12727
|
const { pending: _p, ...without } = installed;
|
|
12672
12728
|
const next = this.versionRecord(without, read.bundle, pending.bytes, pending.from, installed.store);
|
|
12673
|
-
if (!await this.putAppIfUnchanged(next, installed))
|
|
12674
|
-
const now = await this.app(ref);
|
|
12675
|
-
if (!now) fail("not-installed", "This app is not installed");
|
|
12676
|
-
if (now.digest === pending.digest) return this.view(now, await this.stores());
|
|
12677
|
-
fail("no-update", "This update can no longer be installed");
|
|
12678
|
-
}
|
|
12729
|
+
if (!await this.putAppIfUnchanged(next, installed)) return this.acceptedOver(ref, pending.digest);
|
|
12679
12730
|
await this.removeBundle(installed.bytes, installed.digest);
|
|
12680
12731
|
return this.view(next, stores);
|
|
12681
12732
|
}
|
|
12733
|
+
/** Accept's answer when the app's record changed while it read: uninstalled, this update installed, or another version. */
|
|
12734
|
+
async acceptedOver(ref, digest) {
|
|
12735
|
+
const now = await this.app(ref);
|
|
12736
|
+
if (!now) fail("not-installed", "This app is not installed");
|
|
12737
|
+
if (now.digest === digest) return this.view(now, await this.stores());
|
|
12738
|
+
fail("no-update", "This update can no longer be installed");
|
|
12739
|
+
}
|
|
12682
12740
|
/** An app's listing in the store its updates come from (`InstalledApp.store`), while that store is the person's. */
|
|
12683
12741
|
pinnedListing(app, stores) {
|
|
12684
12742
|
return app.store === void 0 ? void 0 : stores.find((s) => s.key === app.store)?.index?.apps.find((a) => a.ref === app.ref);
|
|
@@ -12736,7 +12794,7 @@ var Apps = class {
|
|
|
12736
12794
|
if (pinned !== void 0 && s.key !== pinned) continue;
|
|
12737
12795
|
const listing = s.index?.apps.find((a) => a.ref === app.ref);
|
|
12738
12796
|
if (!listing || !newer(listing)) continue;
|
|
12739
|
-
const seen = `${s.digest} ${listing.digest}`;
|
|
12797
|
+
const seen = `${s.digest} ${listing.digest} ${pinned ?? ""} ${app.digest} ${app.pending?.digest ?? ""}`;
|
|
12740
12798
|
for (const url of listingUrls(listing.urls)) {
|
|
12741
12799
|
const missed = `${s.key} ${app.ref} ${url}`;
|
|
12742
12800
|
if (candidates.has(url) || s.digest !== void 0 && this.listingMisses.get(missed) === seen) continue;
|
|
@@ -12791,12 +12849,13 @@ var Apps = class {
|
|
|
12791
12849
|
}
|
|
12792
12850
|
const twin = holds && (holds.sequence === app.sequence || holds.sequence === app.pending?.sequence);
|
|
12793
12851
|
if (holds && !twin && judge(holds).status !== "ok") continue;
|
|
12852
|
+
if (holds && !twin && app.pending && holds.sequence < app.pending.sequence) continue;
|
|
12794
12853
|
if (holds && twin && app.equivocation?.sequence === holds.sequence && app.equivocation.digest === holds.digest) {
|
|
12795
12854
|
outcome = "equivocation";
|
|
12796
12855
|
continue;
|
|
12797
12856
|
}
|
|
12798
12857
|
const refused = this.refusedReads.get(url);
|
|
12799
|
-
if (holds && refused?.digest === holds.digest && this.
|
|
12858
|
+
if (holds && refused?.digest === holds.digest && this.checkedWithin(refused.at, APP_CHECK_TIMINGS.freshMs)) continue;
|
|
12800
12859
|
let fetched;
|
|
12801
12860
|
try {
|
|
12802
12861
|
fetched = await this.fetchBundle(url);
|
|
@@ -20817,7 +20876,7 @@ var FileDesk = class {
|
|
|
20817
20876
|
deps;
|
|
20818
20877
|
chats = /* @__PURE__ */ new Map();
|
|
20819
20878
|
speeds = /* @__PURE__ */ new Map();
|
|
20820
|
-
/** By local id: when its bytes last moved (for the stall rule). */
|
|
20879
|
+
/** By local id: when its bytes last moved (for the stall rule), and whether it then waited on a person. */
|
|
20821
20880
|
moved = /* @__PURE__ */ new Map();
|
|
20822
20881
|
/** Unfinished when the app started, and not moved since. */
|
|
20823
20882
|
restored = /* @__PURE__ */ new Set();
|
|
@@ -21440,6 +21499,10 @@ var FileDesk = class {
|
|
|
21440
21499
|
* Whether a transfer is stuck (`transferStalled`): not moved for `FILE_LIMITS.stallMs`, or not since the app started.
|
|
21441
21500
|
* Only bytes moving count (`progress`: confirmed by the receiver, stored here), not a session saying again where it
|
|
21442
21501
|
* stands. A stall is nothing happening, so a timer looks again when it would be one.
|
|
21502
|
+
*
|
|
21503
|
+
* Time it waits on a person (an offer not answered yet, a pause) is not time stuck: its quiet spell starts when it goes
|
|
21504
|
+
* on. Before, a file accepted after its offer waited a minute read as stuck at once, "Ask again" beside it, for as
|
|
21505
|
+
* long as it waited its turn behind other files.
|
|
21443
21506
|
*/
|
|
21444
21507
|
stalled(linkId, id, record, progress) {
|
|
21445
21508
|
if (transferEnded(record)) {
|
|
@@ -21447,8 +21510,12 @@ var FileDesk = class {
|
|
|
21447
21510
|
return false;
|
|
21448
21511
|
}
|
|
21449
21512
|
const now = elapsed();
|
|
21450
|
-
|
|
21451
|
-
if (progress) this.
|
|
21513
|
+
const waiting = record.state === "asking" || record.state === "paused";
|
|
21514
|
+
if (progress || waiting || !this.moved.has(id) || this.moved.get(id).waiting) this.moved.set(id, {
|
|
21515
|
+
at: now,
|
|
21516
|
+
...waiting && { waiting }
|
|
21517
|
+
});
|
|
21518
|
+
if (progress || waiting) this.restored.delete(id);
|
|
21452
21519
|
const movedAt = this.moved.get(id).at;
|
|
21453
21520
|
const stalled = transferStalled(record, movedAt, this.restored.has(id), now);
|
|
21454
21521
|
if (!stalled && !this.stallChecks.has(id) && transferStalled(record, 0, true, now)) {
|
|
@@ -24836,7 +24903,9 @@ var FULL_SAID_MS$1 = 66e4;
|
|
|
24836
24903
|
* the accept refused, every turn of the door for as long as the admin was away.
|
|
24837
24904
|
*/
|
|
24838
24905
|
function admissionsHeld(s) {
|
|
24839
|
-
|
|
24906
|
+
return !s.isAdmin && membersAtBound(s);
|
|
24907
|
+
}
|
|
24908
|
+
function membersAtBound(s) {
|
|
24840
24909
|
const admin = s.admin, chain = s.state.chain;
|
|
24841
24910
|
let n = 0;
|
|
24842
24911
|
for (let i = chain.length - 1; i >= 0; i--) {
|
|
@@ -24846,6 +24915,16 @@ function admissionsHeld(s) {
|
|
|
24846
24915
|
}
|
|
24847
24916
|
return n >= COMMUNITY_LIMITS.memberAdmissions;
|
|
24848
24917
|
}
|
|
24918
|
+
/**
|
|
24919
|
+
* Whether the admin's app is wanted at the door: the members signed all the admissions in a row they may, and only the
|
|
24920
|
+
* admin lets the next person in. Only hubs answer knocks, and an admin's app that is no hub (the role was handed to
|
|
24921
|
+
* it, or it stepped down when idle) let nobody in while it was open: whoever opened the link waited for good, nobody
|
|
24922
|
+
* told (bug hunt, 2026-11-12: the role handed to a member at 40 members, then 50 opening the link: 32 let in, 18
|
|
24923
|
+
* knocking 20 minutes later). It is one more hub until it lets someone in, which opens the members' door again.
|
|
24924
|
+
*/
|
|
24925
|
+
function adminAtDoor(s) {
|
|
24926
|
+
return s.isAdmin && s.adminWork && !!s.entryKey && !!s.state.entry.seedB64 && membersAtBound(s);
|
|
24927
|
+
}
|
|
24849
24928
|
var RELAYED_KEPT = 4096;
|
|
24850
24929
|
/**
|
|
24851
24930
|
* Someone the chain took out while its app was closed comes back believing it is a member: it asks in a hub's lobby,
|
|
@@ -25713,7 +25792,7 @@ var Communities = class {
|
|
|
25713
25792
|
live.cutOffSince ??= now;
|
|
25714
25793
|
return now - live.cutOffSince < CUT_OFF_STEP_UP_MS;
|
|
25715
25794
|
};
|
|
25716
|
-
const want = () => settled() && !cutOff() && (shouldBeHub(me, this.hubs(live), now) || !!live.forceHub && freshHubs(this.hubs(live), now).length < COMMUNITY_TOPOLOGY.maxHubs) && this.capacity(groupId, live, now) > 0;
|
|
25795
|
+
const want = () => settled() && !cutOff() && (shouldBeHub(me, this.hubs(live), now) || (!!live.forceHub || adminAtDoor(s)) && freshHubs(this.hubs(live), now).length < COMMUNITY_TOPOLOGY.maxHubs) && this.capacity(groupId, live, now) > 0;
|
|
25717
25796
|
if (want()) {
|
|
25718
25797
|
if (!live.hubCandidateAt) live.hubCandidateAt = now + (freshHubs(this.hubs(live), now).length ? Math.floor(this.random() * this.timings.hubJitterMs) : 0);
|
|
25719
25798
|
if (now >= live.hubCandidateAt) {
|
|
@@ -25735,7 +25814,7 @@ var Communities = class {
|
|
|
25735
25814
|
if (live.hub) {
|
|
25736
25815
|
const load = this.hubLoad(groupId, live, now);
|
|
25737
25816
|
if (load > 0) live.emptySince = now;
|
|
25738
|
-
const idle = now - live.emptySince > this.timings.idleHubMs && now - live.hubSince > this.timings.idleHubMs;
|
|
25817
|
+
const idle = now - live.emptySince > this.timings.idleHubMs && now - live.hubSince > this.timings.idleHubMs && !adminAtDoor(s);
|
|
25739
25818
|
if (live.leaving) {
|
|
25740
25819
|
const read = live.beaconAt > live.leaving, listed = live.beacon.some((h) => h.key === me);
|
|
25741
25820
|
if (read && idle && !listed && this.canStepDown(groupId, live, now)) {
|
|
@@ -25984,7 +26063,7 @@ var Communities = class {
|
|
|
25984
26063
|
}
|
|
25985
26064
|
for (const [key, since] of live.members) {
|
|
25986
26065
|
const id = edges.get(key);
|
|
25987
|
-
if (this.gone(live, key)) live.members.delete(key);
|
|
26066
|
+
if (this.gone(live, key) || !rosterHas(live.session.roster, key)) live.members.delete(key);
|
|
25988
26067
|
else if (id && this.host.linkReady(id, 2)) live.members.set(key, now);
|
|
25989
26068
|
else if (live.session.wasRemoved(key)) live.members.delete(key);
|
|
25990
26069
|
else if (now - since > this.timings.memberGoneMs) {
|
|
@@ -26482,7 +26561,7 @@ var Communities = class {
|
|
|
26482
26561
|
const turn = Math.floor(waited / KNOCK_SLOT_MS) % order.length, early = order.length === 1 || waited % KNOCK_SLOT_MS < KNOCK_SLOT_OPEN_MS;
|
|
26483
26562
|
if (order[turn] !== s.myKey || !early || waited >= KNOCK_SLOT_MS && !stillKnocking) continue;
|
|
26484
26563
|
if (live.pendingEntries.size >= MAX_PENDING_ENTRIES$1) break;
|
|
26485
|
-
if (
|
|
26564
|
+
if (this.room(groupId, live, now) <= live.members.size) break;
|
|
26486
26565
|
if (this.host.adminTurn && !await this.host.adminTurn(groupId, { wait: false })) break;
|
|
26487
26566
|
live.pendingEntries.set(key, now);
|
|
26488
26567
|
live.doorKey = link.host;
|
|
@@ -28777,7 +28856,7 @@ var Groups = class {
|
|
|
28777
28856
|
membership: (groupId) => this.fileMembership(groupId),
|
|
28778
28857
|
out: (groupId) => this.fileOut(groupId),
|
|
28779
28858
|
sendApp: (groupId, frame) => this.communities.sendApp(groupId, frame),
|
|
28780
|
-
changed: () => host.emit(),
|
|
28859
|
+
changed: (delayMs) => host.emit(delayMs),
|
|
28781
28860
|
now: () => this.now()
|
|
28782
28861
|
});
|
|
28783
28862
|
this.communities.files = this.files;
|
|
@@ -32353,6 +32432,11 @@ var said = (m) => m.removed ? {
|
|
|
32353
32432
|
...m.card && { sc: m.card }
|
|
32354
32433
|
};
|
|
32355
32434
|
var resendKey = (groupId, member) => `${groupId}\n${member}`;
|
|
32435
|
+
/**
|
|
32436
|
+
* A row of mine in a private group written under a member key I no longer hold: removed, then invited back, I came in
|
|
32437
|
+
* with a new key, and the group knows my lines from before by the old one. Its session refuses their edits.
|
|
32438
|
+
*/
|
|
32439
|
+
var underOldKey = (message, membership) => !membership.community && !message.id.startsWith(`${membership.me}:`);
|
|
32356
32440
|
var GroupEdits = class {
|
|
32357
32441
|
host;
|
|
32358
32442
|
now;
|
|
@@ -32408,7 +32492,7 @@ var GroupEdits = class {
|
|
|
32408
32492
|
if (typeof messageId !== "string" || typeof raw !== "string") return refuse("No message to edit");
|
|
32409
32493
|
const chat = chatOf(groupId);
|
|
32410
32494
|
const message = await this.find(chat, messageId);
|
|
32411
|
-
if (!message || !canEditInGroup(message)) return refuse("Only your own text messages can be edited");
|
|
32495
|
+
if (!message || !canEditInGroup(message) || underOldKey(message, membership)) return refuse("Only your own text messages can be edited");
|
|
32412
32496
|
const text = raw.trim();
|
|
32413
32497
|
if (!text) return refuse("An edit cannot be empty. Delete the message instead.");
|
|
32414
32498
|
if (isJoinNotice(text)) return refuse("An edit cannot read as a join notice.");
|
|
@@ -32454,10 +32538,11 @@ var GroupEdits = class {
|
|
|
32454
32538
|
error,
|
|
32455
32539
|
refused: true
|
|
32456
32540
|
});
|
|
32457
|
-
|
|
32541
|
+
const membership = this.host.membership(groupId);
|
|
32542
|
+
if (!membership) return refuse(this.notMember(groupId));
|
|
32458
32543
|
const chat = chatOf(groupId);
|
|
32459
32544
|
const message = typeof messageId === "string" ? await this.find(chat, messageId) : void 0;
|
|
32460
|
-
if (!message || message.removed || message.sender !== "me" || !GROUP_MESSAGE_ID.test(message.id)) return refuse("Only your own messages can be deleted for everyone");
|
|
32545
|
+
if (!message || message.removed || message.sender !== "me" || !GROUP_MESSAGE_ID.test(message.id) || underOldKey(message, membership)) return refuse("Only your own messages can be deleted for everyone");
|
|
32461
32546
|
if (!canRemove(message)) return refuse("A payment, a request or a notice cannot be deleted for everyone");
|
|
32462
32547
|
const e = removalNumber(message.edit?.seq);
|
|
32463
32548
|
await this.host.removeMine(chat, message, {
|
|
@@ -41024,6 +41109,8 @@ var STARTUP_QUIET_MS = 15e3;
|
|
|
41024
41109
|
var START_SLICE_MS = 10;
|
|
41025
41110
|
/** How long the wallets' changes gather into one view of them (`walletChanged`). */
|
|
41026
41111
|
var WALLET_CHANGE_MS = 50;
|
|
41112
|
+
/** How often the shared services' request counts may send a state while contacts use them (`hostedService`). */
|
|
41113
|
+
var REQUEST_COUNTS_MS = 1e3;
|
|
41027
41114
|
var SPARE_INVITE_MAX_AGE_MS = 9e5;
|
|
41028
41115
|
/** How far before this clock a warm packet is dated (`warmKey`): further than a contact's clock is ever behind. */
|
|
41029
41116
|
var WARM_DATED_BACK_MS = 864e5;
|
|
@@ -41369,6 +41456,8 @@ var GhostlyNode = class GhostlyNode {
|
|
|
41369
41456
|
/** `group-wake` frames read per edge, a handful a minute. */
|
|
41370
41457
|
groupWakeReceived = /* @__PURE__ */ new Map();
|
|
41371
41458
|
requestCounts = /* @__PURE__ */ new Map();
|
|
41459
|
+
/** A request only moves a counter: the counts go out with the next state, at most once a `REQUEST_COUNTS_MS`. */
|
|
41460
|
+
requestCountsTimer;
|
|
41372
41461
|
transfers = /* @__PURE__ */ new Map();
|
|
41373
41462
|
/**
|
|
41374
41463
|
* Views that go in the next state sent, and then away (`GroupFilesHost.brief`): dropped once a state carried them,
|
|
@@ -41405,6 +41494,8 @@ var GhostlyNode = class GhostlyNode {
|
|
|
41405
41494
|
}
|
|
41406
41495
|
});
|
|
41407
41496
|
stateTimer = null;
|
|
41497
|
+
/** When the snapshot `stateTimer` waits for is due (`emitState`). */
|
|
41498
|
+
stateDue = 0;
|
|
41408
41499
|
paymentTimer = null;
|
|
41409
41500
|
/**
|
|
41410
41501
|
* The reviews whose outcome is still open (submitted, unknown), by id: what the payment poll asks about, so that it
|
|
@@ -42397,7 +42488,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
42397
42488
|
placeAbove: (linkId, id) => this.placeAbove(linkId, id),
|
|
42398
42489
|
membersChanged: (groupId) => this.groupMembersChanged(groupId),
|
|
42399
42490
|
historyGone: (groupId) => this.groupHistoryGone(groupId),
|
|
42400
|
-
emit: () => this.emitState(),
|
|
42491
|
+
emit: (delayMs) => this.emitState(delayMs),
|
|
42401
42492
|
communityApp: (groupId, sender, frame) => frame.t === "reaction" ? this.receiveGroupReaction(groupId, sender, frame) : frame.t === "edit" ? this.receiveCommunityEdit(groupId, sender, frame) : frame.t === "pin" ? this.receiveGroupPin(groupId, sender, readPin(frame)) : this.communityPay.receiveApp(groupId, sender, frame),
|
|
42402
42493
|
groupEdit: async (groupId, { sender, ...edit }) => {
|
|
42403
42494
|
await this.groupEdits.receive(groupId, sender, edit);
|
|
@@ -42963,31 +43054,15 @@ var GhostlyNode = class GhostlyNode {
|
|
|
42963
43054
|
this.groupsLoaded = true;
|
|
42964
43055
|
this.groupsLoadedNow();
|
|
42965
43056
|
this.emitState();
|
|
42966
|
-
for (
|
|
43057
|
+
for (const stored of links) {
|
|
42967
43058
|
if (stored.group) continue;
|
|
42968
43059
|
await this.settleHistory(stored.id);
|
|
42969
|
-
|
|
42970
|
-
|
|
42971
|
-
|
|
42972
|
-
|
|
42973
|
-
|
|
42974
|
-
|
|
42975
|
-
state: "failed",
|
|
42976
|
-
error: "Transfer interrupted. Retry when connected."
|
|
42977
|
-
} : file.transfer);
|
|
42978
|
-
const unreceipted = new Set(messages.flatMap((m) => m.sender === "me" && m.file && m.delivery !== "delivered" ? [m.file.id] : []));
|
|
42979
|
-
this.fileDesk.restore(stored.id, storedFiles, unreceipted);
|
|
42980
|
-
const files = linkFilesFrom(stored.id, storedFiles, messages);
|
|
42981
|
-
this.links.set(stored.id, newLiveLink(stored, messages[messages.length - 1]?.timestamp ?? 0, files));
|
|
42982
|
-
this.links.get(stored.id).waitingSends = Promise.resolve(new Set(messages.filter(waitsForLive).map((m) => m.id)));
|
|
42983
|
-
this.links.get(stored.id).cardsDue = Promise.resolve(new Set(messages.filter(cardDue).map((m) => m.id)));
|
|
42984
|
-
this.editsFor(stored.id).learn([...messages, ...(stored.removals ?? []).map((r) => removalRow(stored.id, r))]);
|
|
42985
|
-
this.links.get(stored.id).pkarrSeenAt = pkarrSeenAt(messages);
|
|
42986
|
-
for (const message of messages.slice(-20)) this.clockSample(message);
|
|
42987
|
-
const note = this.noteFromHistory(stored.id, messages);
|
|
42988
|
-
if (note) this.reactionNotes.set(stored.id, note);
|
|
42989
|
-
if (stored.reactionsWaiting?.length) await this.reactions.restore(stored.id, stored.reactionsWaiting, messages);
|
|
42990
|
-
if (stored.profile) await this.outboxFor(stored.id).recover(messages);
|
|
43060
|
+
if (this.deferredChats.has(stored.id)) {
|
|
43061
|
+
this.links.set(stored.id, newLiveLink(stored, (await db.getMessagePage(stored.id, { limit: 1 })).messages[0]?.timestamp ?? 0));
|
|
43062
|
+
this.chatRestores.set(stored.id, null);
|
|
43063
|
+
continue;
|
|
43064
|
+
}
|
|
43065
|
+
await this.restoreChat(stored);
|
|
42991
43066
|
}
|
|
42992
43067
|
this.transfersRestored = true;
|
|
42993
43068
|
this.awaitingSoon();
|
|
@@ -43010,6 +43085,56 @@ var GhostlyNode = class GhostlyNode {
|
|
|
43010
43085
|
else if (!this.options.singleDevice && this.limitedMode && knownDeviceGate()?.state === "active") this.readTurnWhileLimited();
|
|
43011
43086
|
if (this.restoreCheck === "checking" && this.limitedMode) this.checkRestoredTurn(0);
|
|
43012
43087
|
}
|
|
43088
|
+
/**
|
|
43089
|
+
* The chats left unstarted at start (`deferChats`) whose history is not read yet: `null` until the command names one
|
|
43090
|
+
* (`restoreDeferred`), then that read.
|
|
43091
|
+
*/
|
|
43092
|
+
chatRestores = /* @__PURE__ */ new Map();
|
|
43093
|
+
/** A deferred chat's restore (`restoreChat`), read once, before it starts or a command reads it. */
|
|
43094
|
+
restoreDeferred(linkId) {
|
|
43095
|
+
const restore = this.chatRestores.get(linkId);
|
|
43096
|
+
if (restore !== null) return restore ?? Promise.resolve();
|
|
43097
|
+
const live = this.links.get(linkId);
|
|
43098
|
+
const restoring = live ? this.restoreChat(live.stored) : Promise.resolve();
|
|
43099
|
+
this.chatRestores.set(linkId, restoring);
|
|
43100
|
+
return restoring;
|
|
43101
|
+
}
|
|
43102
|
+
/**
|
|
43103
|
+
* What a saved 1:1 chat knows from its history, read whole once: its newest message, its files and their transfers, what
|
|
43104
|
+
* waits for it to be live, my edits on their way, when the contact was last heard, its latest reaction, and the
|
|
43105
|
+
* outbox's rows.
|
|
43106
|
+
*/
|
|
43107
|
+
async restoreChat(stored) {
|
|
43108
|
+
const messages = await db.getMessages(stored.id);
|
|
43109
|
+
stored = await this.settleJoinLine(stored, messages);
|
|
43110
|
+
const storedFiles = await fileStore.listForLink(stored.id);
|
|
43111
|
+
const notInterrupted = new Set(messages.flatMap((m) => m.sender === "me" && m.file && (m.delivery === "waiting" || m.via === "hold" && (m.delivery === "held" || m.delivery === "delivered")) ? [m.file.id] : []));
|
|
43112
|
+
for (const file of storedFiles) if (file.transfer && file.transfer.state !== "done" && !file.wire3 && !notInterrupted.has(file.id)) this.transfers.set(file.id, file.transfer.state === "transferring" ? {
|
|
43113
|
+
...file.transfer,
|
|
43114
|
+
state: "failed",
|
|
43115
|
+
error: "Transfer interrupted. Retry when connected."
|
|
43116
|
+
} : file.transfer);
|
|
43117
|
+
const unreceipted = new Set(messages.flatMap((m) => m.sender === "me" && m.file && m.delivery !== "delivered" ? [m.file.id] : []));
|
|
43118
|
+
this.fileDesk.restore(stored.id, storedFiles, unreceipted);
|
|
43119
|
+
const files = linkFilesFrom(stored.id, storedFiles, messages);
|
|
43120
|
+
const newest = messages[messages.length - 1]?.timestamp ?? 0;
|
|
43121
|
+
const left = this.links.get(stored.id);
|
|
43122
|
+
if (left) Object.assign(left, {
|
|
43123
|
+
stored,
|
|
43124
|
+
lastMessageAt: Math.max(left.lastMessageAt, newest),
|
|
43125
|
+
files
|
|
43126
|
+
});
|
|
43127
|
+
else this.links.set(stored.id, newLiveLink(stored, newest, files));
|
|
43128
|
+
this.links.get(stored.id).waitingSends = Promise.resolve(new Set(messages.filter(waitsForLive).map((m) => m.id)));
|
|
43129
|
+
this.links.get(stored.id).cardsDue = Promise.resolve(new Set(messages.filter(cardDue).map((m) => m.id)));
|
|
43130
|
+
this.editsFor(stored.id).learn([...messages, ...(stored.removals ?? []).map((r) => removalRow(stored.id, r))]);
|
|
43131
|
+
this.links.get(stored.id).pkarrSeenAt = pkarrSeenAt(messages);
|
|
43132
|
+
for (const message of messages.slice(-20)) this.clockSample(message);
|
|
43133
|
+
const note = this.noteFromHistory(stored.id, messages);
|
|
43134
|
+
if (note) this.reactionNotes.set(stored.id, note);
|
|
43135
|
+
if (stored.reactionsWaiting?.length) await this.reactions.restore(stored.id, stored.reactionsWaiting, messages);
|
|
43136
|
+
if (stored.profile) await this.outboxFor(stored.id).recover(messages);
|
|
43137
|
+
}
|
|
43013
43138
|
/** Where the check of a restored copy stands: reading every 30 seconds, or a tombstone found (the person decides). */
|
|
43014
43139
|
restoreCheck = null;
|
|
43015
43140
|
restoreTimer = null;
|
|
@@ -43444,6 +43569,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
43444
43569
|
if (this.paymentTimer) clearTimeout(this.paymentTimer);
|
|
43445
43570
|
clearTimeout(this.awaitingTimer);
|
|
43446
43571
|
clearTimeout(this.walletChangeTimer);
|
|
43572
|
+
clearTimeout(this.requestCountsTimer);
|
|
43447
43573
|
clearInterval(this.staleReviewTimer);
|
|
43448
43574
|
if (this.spareTimer) clearTimeout(this.spareTimer);
|
|
43449
43575
|
for (const timer of this.reactionTimers.values()) clearTimeout(timer);
|
|
@@ -43562,8 +43688,11 @@ var GhostlyNode = class GhostlyNode {
|
|
|
43562
43688
|
appInstall(params) {
|
|
43563
43689
|
return this.appStore.install(params);
|
|
43564
43690
|
}
|
|
43565
|
-
|
|
43566
|
-
|
|
43691
|
+
/** Installs a waiting update; the pages are told, so another tab's screen drops its Update. */
|
|
43692
|
+
async appUpdateAccept(params) {
|
|
43693
|
+
const view = await this.appStore.acceptUpdate(params);
|
|
43694
|
+
this.events.onAppsChecked?.();
|
|
43695
|
+
return view;
|
|
43567
43696
|
}
|
|
43568
43697
|
appCheckUpdates() {
|
|
43569
43698
|
return this.appStore.checkUpdates();
|
|
@@ -43896,7 +44025,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
43896
44025
|
const existing = [...this.links.values()].find((l) => l.stored.seedB64 === params.seedB64);
|
|
43897
44026
|
if (existing) {
|
|
43898
44027
|
if (existing.stored.profile !== params.profile) throw new Error("Invitation profile does not match the stored link");
|
|
43899
|
-
|
|
44028
|
+
await this.startDeferredChat(existing.stored.id);
|
|
43900
44029
|
return { linkId: await this.existingLink(existing.stored.id) };
|
|
43901
44030
|
}
|
|
43902
44031
|
this.refuseOwnInvite(params);
|
|
@@ -44416,10 +44545,10 @@ var GhostlyNode = class GhostlyNode {
|
|
|
44416
44545
|
* what says it. Apart from the message wake-ups' limit, so it never holds one back. A muted chat's contact shared no
|
|
44417
44546
|
* target; a group's edge is never told. `WAKE_ONLINE_BATCH` at a time, the rest a `WAKE_ONLINE_BATCH_MS` later (those
|
|
44418
44547
|
* still away then), so a push relay's minute keeps room for the message and call wake-ups. None while this profile does
|
|
44419
|
-
* not share when it is online (`sharePresence`).
|
|
44548
|
+
* not share when it is online (`sharePresence`), nor while the host says this run is not online to them (`onlineNotices`).
|
|
44420
44549
|
*/
|
|
44421
44550
|
sayOnline(now = Date.now()) {
|
|
44422
|
-
if (!this.networkOn || this.shuttingDown || this.settings.sharePresence === false) return;
|
|
44551
|
+
if (!this.networkOn || this.shuttingDown || this.settings.sharePresence === false || this.options.onlineNotices?.() === false) return;
|
|
44423
44552
|
let sent = 0;
|
|
44424
44553
|
for (const live of this.links.values()) {
|
|
44425
44554
|
const { id, peerWake: target, profile, group, onlineWokeAt } = live.stored;
|
|
@@ -45896,6 +46025,10 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45896
46025
|
removalPending({ linkId, messageId }) {
|
|
45897
46026
|
return !!this.links.get(linkId)?.stored.removals?.some((r) => r.id === messageId);
|
|
45898
46027
|
}
|
|
46028
|
+
/** The messages of a 1:1 chat whose removal of mine is still on its way to the contact, by id (`removeMessage`). */
|
|
46029
|
+
removalsPending({ linkId }) {
|
|
46030
|
+
return (this.links.get(linkId)?.stored.removals ?? []).map((r) => r.id);
|
|
46031
|
+
}
|
|
45899
46032
|
/** A chat's row write of its removals and deleted ids waiting to go, by chat (`writeDeletions`). */
|
|
45900
46033
|
deletionWrites = /* @__PURE__ */ new Map();
|
|
45901
46034
|
/** The last such write of each chat, which the next one follows. */
|
|
@@ -50070,7 +50203,10 @@ var GhostlyNode = class GhostlyNode {
|
|
|
50070
50203
|
try {
|
|
50071
50204
|
const target = parseLocalTarget(service.target);
|
|
50072
50205
|
this.requestCounts.set(id, (this.requestCounts.get(id) ?? 0) + 1);
|
|
50073
|
-
this.
|
|
50206
|
+
this.requestCountsTimer ??= setTimeout(() => {
|
|
50207
|
+
this.requestCountsTimer = void 0;
|
|
50208
|
+
this.emitState();
|
|
50209
|
+
}, REQUEST_COUNTS_MS);
|
|
50074
50210
|
return {
|
|
50075
50211
|
id,
|
|
50076
50212
|
target
|
|
@@ -50542,9 +50678,12 @@ var GhostlyNode = class GhostlyNode {
|
|
|
50542
50678
|
}
|
|
50543
50679
|
/**
|
|
50544
50680
|
* Starts a chat this run left unstarted (`NodeOptions.deferChats`): the one a one-shot names, once the command has
|
|
50545
|
-
* found it.
|
|
50681
|
+
* found it. Its history is read first (`restoreDeferred`), offline too: the command reads what it knows. Any other
|
|
50682
|
+
* chat, or one already started, is left as it is.
|
|
50546
50683
|
*/
|
|
50547
|
-
startDeferredChat(linkId) {
|
|
50684
|
+
async startDeferredChat(linkId) {
|
|
50685
|
+
if (!this.deferredChats.has(linkId)) return;
|
|
50686
|
+
await this.restoreDeferred(linkId);
|
|
50548
50687
|
if (!this.deferredChats.delete(linkId)) return;
|
|
50549
50688
|
if (this.networkOn && !this.shuttingDown) this.startLink(linkId);
|
|
50550
50689
|
}
|
|
@@ -51125,7 +51264,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
51125
51264
|
nativeFactoriesFor(relayOnly) {
|
|
51126
51265
|
const relay = relayOnly || this.relaysHyperdhtNatively ? this.hyperdhtRelay : "";
|
|
51127
51266
|
return {
|
|
51128
|
-
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-
|
|
51267
|
+
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-CdsLcAhY.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
|
|
51129
51268
|
...relayOnly ? {} : this.options.nativeTransports,
|
|
51130
51269
|
...this.ownIrohRelays && !relayOnly ? { "iroh/1": (seedB64) => this.options.nativeTransports["iroh/1"](seedB64, this.settings.irohRelays?.length ? { relays: [...this.settings.irohRelays] } : {}) } : {},
|
|
51131
51270
|
...this.options.irohWeb ? { "iroh/1": (seedB64) => createIrohWebEndpoint(seedB64, {
|
|
@@ -51247,6 +51386,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
51247
51386
|
for (const [linkId, live] of this.links) {
|
|
51248
51387
|
const link = live.link;
|
|
51249
51388
|
if (!link?.availableTransports.includes("hyperdht/1")) {
|
|
51389
|
+
if (live.transportErrors) delete live.transportErrors["hyperdht/1"];
|
|
51250
51390
|
if (this.hyperdhtRelay && link && this.keepsNativeEndpoints(linkId, live.stored)) this.ensureNativeEndpoints(linkId);
|
|
51251
51391
|
continue;
|
|
51252
51392
|
}
|
|
@@ -52007,10 +52147,10 @@ var GhostlyNode = class GhostlyNode {
|
|
|
52007
52147
|
const live = this.links.get(message.linkId);
|
|
52008
52148
|
const deletes = this.removedChats.get(message.linkId);
|
|
52009
52149
|
if (!live && deletes !== void 0) return false;
|
|
52010
|
-
const chat = message.linkId;
|
|
52011
|
-
const
|
|
52012
|
-
|
|
52013
|
-
if (
|
|
52150
|
+
const chat = message.linkId, id = message.id;
|
|
52151
|
+
const group = chat.startsWith("group:") ? chat.slice(6) : void 0;
|
|
52152
|
+
const kept = () => this.removedChats.get(chat) === deletes && !live?.stored.deletedIds?.includes(id) && !(group && this.groups.isRemoved(group, id));
|
|
52153
|
+
if (!kept()) return false;
|
|
52014
52154
|
const first = live ? this.firstContactRow(live, message) : false;
|
|
52015
52155
|
const mine = live?.stored.profile && !live.stored.group && message.sender === "peer" && !message.file && message.id.startsWith("peer_") ? this.namesMine(chat, message.id.slice(5)).catch(() => false) : false;
|
|
52016
52156
|
message = await this.resolveReply(message);
|
|
@@ -52190,10 +52330,18 @@ var GhostlyNode = class GhostlyNode {
|
|
|
52190
52330
|
services: false
|
|
52191
52331
|
};
|
|
52192
52332
|
}
|
|
52193
|
-
/**
|
|
52333
|
+
/**
|
|
52334
|
+
* State changes arrive in bursts; the UI gets one snapshot per tick. `delayMs`: how long this change may wait. One
|
|
52335
|
+
* that may not wait as long as the snapshot already due (a new file behind another's progress) brings it forward.
|
|
52336
|
+
*/
|
|
52194
52337
|
emitState(delayMs = 50) {
|
|
52195
52338
|
if (this.gatedOut) return;
|
|
52196
|
-
|
|
52339
|
+
const due = Date.now() + delayMs;
|
|
52340
|
+
if (this.stateTimer) {
|
|
52341
|
+
if (due >= this.stateDue) return;
|
|
52342
|
+
clearTimeout(this.stateTimer);
|
|
52343
|
+
}
|
|
52344
|
+
this.stateDue = due;
|
|
52197
52345
|
this.stateTimer = setTimeout(() => {
|
|
52198
52346
|
this.stateTimer = null;
|
|
52199
52347
|
if (this.gatedOut) return;
|
|
@@ -52567,4 +52715,4 @@ function signalKind(signal) {
|
|
|
52567
52715
|
//#endregion
|
|
52568
52716
|
export { EngineServer };
|
|
52569
52717
|
|
|
52570
|
-
//# sourceMappingURL=server-
|
|
52718
|
+
//# sourceMappingURL=server-Q3VcNqGt.js.map
|