@ghostlytools/cli 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/assets/{api-BIg0Msax.js → api-ButrHieZ.js} +2 -2
- package/dist/assets/{api-d2aXkbM5.js → api-DDmune9b.js} +24 -19
- package/dist/assets/api-DDmune9b.js.map +1 -0
- package/dist/assets/{apiKit-Ba_t7MZO.js → apiKit-DfFlJhXO.js} +3 -3
- package/dist/assets/{apiKit-Ba_t7MZO.js.map → apiKit-DfFlJhXO.js.map} +1 -1
- package/dist/assets/{apps-B_F3gEI4.js → apps-BVnNpB2f.js} +1 -1
- package/dist/assets/{apps-CJo1MmSY.js → apps-CpQVuYqT.js} +4 -4
- package/dist/assets/{apps-CJo1MmSY.js.map → apps-CpQVuYqT.js.map} +1 -1
- package/dist/assets/{arkade-DTne0O3Q.js → arkade-C9Ne-zJb.js} +2 -2
- package/dist/assets/{arkade-DTne0O3Q.js.map → arkade-C9Ne-zJb.js.map} +1 -1
- package/dist/assets/{backup-CqpDAZZG.js → backup-DavZrUf6.js} +1 -1
- package/dist/assets/{backup-BY88aZr5.js → backup-MN2sZQeW.js} +7 -7
- package/dist/assets/{backup-BY88aZr5.js.map → backup-MN2sZQeW.js.map} +1 -1
- package/dist/assets/{blobFiles-B1lX6iGy.js → blobFiles-B6nf0gCG.js} +3 -3
- package/dist/assets/{blobFiles-B1lX6iGy.js.map → blobFiles-B6nf0gCG.js.map} +1 -1
- package/dist/assets/buttons-DC20Q2no.js +2 -0
- package/dist/assets/{buttons-B5EnA2nh.js → buttons-DIWDW2n5.js} +4 -4
- package/dist/assets/{buttons-B5EnA2nh.js.map → buttons-DIWDW2n5.js.map} +1 -1
- package/dist/assets/{daemonProof-Dx3N_DLC.js → daemonProof-ui8jtIw0.js} +2 -2
- package/dist/assets/{daemonProof-Dx3N_DLC.js.map → daemonProof-ui8jtIw0.js.map} +1 -1
- package/dist/assets/{envelope-BU-BB1wR.js → envelope-ByeUit1N.js} +2 -2
- package/dist/assets/{envelope-BU-BB1wR.js.map → envelope-ByeUit1N.js.map} +1 -1
- package/dist/assets/{errors-DI6Z3jTH.js → errors-CzXgR8Cc.js} +14 -4
- package/dist/assets/errors-CzXgR8Cc.js.map +1 -0
- package/dist/assets/{fileBytes-D85lBh-Q.js → fileBytes-BMEBas7S.js} +3 -3
- package/dist/assets/{fileBytes-D85lBh-Q.js.map → fileBytes-BMEBas7S.js.map} +1 -1
- package/dist/assets/{fileBytes-D0CYuRwZ.js → fileBytes-CFNrRfcl.js} +2 -2
- package/dist/assets/{fileBytes-D0CYuRwZ.js.map → fileBytes-CFNrRfcl.js.map} +1 -1
- package/dist/assets/{fileBytes-BMlLVdfg.js → fileBytes-CtwagJ8h.js} +1 -1
- package/dist/assets/{fileBytesIdb-LAhH7kY2.js → fileBytesIdb-BXAN7i-N.js} +3 -3
- package/dist/assets/{fileBytesIdb-LAhH7kY2.js.map → fileBytesIdb-BXAN7i-N.js.map} +1 -1
- package/dist/assets/fileBytesIdb-C20oXDdr.js +2 -0
- package/dist/assets/{fileBytesOpfs-DjBBghvq.js → fileBytesOpfs-Do1Vpkis.js} +3 -3
- package/dist/assets/{fileBytesOpfs-DjBBghvq.js.map → fileBytesOpfs-Do1Vpkis.js.map} +1 -1
- package/dist/assets/{groupFiles-D9k6fyhf.js → groupFiles-DVxX0O1g.js} +5 -5
- package/dist/assets/groupFiles-DVxX0O1g.js.map +1 -0
- package/dist/assets/{host-DrL7FPG4.js → host-AB2Cr46b.js} +16 -15
- package/dist/assets/host-AB2Cr46b.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-C-BsT6_V.js → hyperdhtRelay-BcrwJRtb.js} +2 -2
- package/dist/assets/{hyperdhtRelay-C-BsT6_V.js.map → hyperdhtRelay-BcrwJRtb.js.map} +1 -1
- package/dist/assets/{idb-CWvq4HKc.js → idb-BlH8-O3R.js} +11 -3
- package/dist/assets/{idb-CWvq4HKc.js.map → idb-BlH8-O3R.js.map} +1 -1
- package/dist/assets/{irohWeb-DdHXEwgj.js → irohWeb-B5j2rgWj.js} +2 -2
- package/dist/assets/{irohWeb-DdHXEwgj.js.map → irohWeb-B5j2rgWj.js.map} +1 -1
- package/dist/assets/{main-xeoX7yLM.js → main-AHz1dbsm.js} +84 -29
- package/dist/assets/main-AHz1dbsm.js.map +1 -0
- package/dist/assets/{mainline-CEqGvRYJ.js → mainline-afyQ77bv.js} +2 -2
- package/dist/assets/{mainline-CEqGvRYJ.js.map → mainline-afyQ77bv.js.map} +1 -1
- package/dist/assets/{networkReason-RGRU5xoa.js → networkReason-DWzsMN8E.js} +3 -3
- package/dist/assets/{networkReason-RGRU5xoa.js.map → networkReason-DWzsMN8E.js.map} +1 -1
- package/dist/assets/{nwc-s5xHLqNf.js → nwc-DYXTp8UX.js} +3 -3
- package/dist/assets/{nwc-s5xHLqNf.js.map → nwc-DYXTp8UX.js.map} +1 -1
- package/dist/assets/{nwcProvider-CfAFO5Fr.js → nwcProvider-B4k6mYJl.js} +2 -2
- package/dist/assets/{nwcProvider-CfAFO5Fr.js.map → nwcProvider-B4k6mYJl.js.map} +1 -1
- package/dist/assets/{profiles-gZdQPyaz.js → profiles-CEnZfN78.js} +2 -2
- package/dist/assets/{profiles-gZdQPyaz.js.map → profiles-CEnZfN78.js.map} +1 -1
- package/dist/assets/{registry-BUhSjM-J.js → registry-Ccru6KBP.js} +1 -1
- package/dist/assets/{registry-CVUdD4bJ.js → registry-wSZHgbsv.js} +3 -3
- package/dist/assets/{registry-CVUdD4bJ.js.map → registry-wSZHgbsv.js.map} +1 -1
- package/dist/assets/{resolve-uZECJ3f7.js → resolve-BPJnMtLC.js} +2 -2
- package/dist/assets/{resolve-uZECJ3f7.js.map → resolve-BPJnMtLC.js.map} +1 -1
- package/dist/assets/{restoredRows-D6WZUA2U.js → restoredRows-Fv-MuY45.js} +2 -2
- package/dist/assets/{restoredRows-D6WZUA2U.js.map → restoredRows-Fv-MuY45.js.map} +1 -1
- package/dist/assets/{server-DOtUKoYR.js → server-DPzt5V2x.js} +236 -54
- package/dist/assets/server-DPzt5V2x.js.map +1 -0
- package/dist/assets/{src-Dd_7Ew1X.js → src-CFeRBeHz.js} +60 -6
- package/dist/assets/{src-Dd_7Ew1X.js.map → src-CFeRBeHz.js.map} +1 -1
- package/dist/assets/{usdt-C2Anx8p7.js → usdt-CBh78JVF.js} +3 -3
- package/dist/assets/{usdt-C2Anx8p7.js.map → usdt-CBh78JVF.js.map} +1 -1
- package/dist/assets/{words-DoLU6p8H.js → words-DC8BQvPO.js} +2 -2
- package/dist/assets/{words-DoLU6p8H.js.map → words-DC8BQvPO.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/examples/payment-bot.mjs +5 -2
- package/package.json +1 -1
- package/dist/assets/api-d2aXkbM5.js.map +0 -1
- package/dist/assets/buttons-azvbN6xn.js +0 -2
- package/dist/assets/errors-DI6Z3jTH.js.map +0 -1
- package/dist/assets/fileBytesIdb-Dn9levD1.js +0 -2
- package/dist/assets/groupFiles-D9k6fyhf.js.map +0 -1
- package/dist/assets/host-DrL7FPG4.js.map +0 -1
- package/dist/assets/main-xeoX7yLM.js.map +0 -1
- package/dist/assets/server-DOtUKoYR.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { n as traceJoin } from "./joinTrace-CjRDFy85.js";
|
|
2
|
-
import { $c as createContactLink, $i as automaticTransport, $l as PacketTooLargeError, $o as HANDOFF_OFFER, $r as vapidKeysMatch, $s as readEnrollHello, A as knockRecords, Aa as GROUP_REACTION_FRAME, Al as firstDeviceSetSecret, An as findEndpoint, Ao as webLocalFetch, As as readHandoffPake, B as GROUP_READ_NOTE, Ba as pairedReplyAuthor, Bi as IdentityExchange, Bl as DEFAULT_RELAYS, Bn as EngineError, Bo as contactRtcConfig, Br as mayPin, Bs as verifySetUpdate, C as decodeCommunityLink, Ca as REMOVED_TEXT, Cc as APP_BUNDLE_LIMITS, Cr as rankHubs, Cs as handoffVersions, D as encodeGroupEntryLink, Da as forwardedAgain, Dc as appDigest, Dl as turnPutSummary, Dn as ENDPOINT, Do as GhostlyHttpError, Dr as shouldBeHub, Ds as readHandoffDone, E as decodeGroupEntryLink, Ea as parseLinkPreview, El as classifyTurnRead, En as decodeBolt11, Eo as presenceSeenAt, Er as readLobby, Es as readHandoffCancel, F as groupWakeFrame, Fa as reactionEmoji, Fc as sha256Paced, Fi as dialDescriptors, Fl as turnInstance, Fn as INVITE_TAKEN, Fo as RTC_CONFIG, Fr as TypingSender, G as GROUP_EDIT_TEXT_BYTES, Gi as newIdentityBinding, Go as HTTP_SERVICE_PROTO, Gr as WAKE_CALL_INTERVAL_MS, Gs as enrollCancelFrame, Gt as encodeDidDhtPacket, H as frameBytes, Ha as replySnippet, Hc as isAppKey, Hi as emptyIdentityLedger, Hn as engineText, Ho as parseCallSignal, Hr as pinIsNewer, Ht as didDhtDocument, I as groupWakes, Ia as reactionIsNewer, Il as turnKeys, In as LIVENESS_PING_MS, Is as readSetUpdate, J as mentionsMember, Jc as parseImageMeta, Ji as lastSharedWithMe, Jo as HANDOFF_ACK, Jr as newWakeToken, Js as enrollDoneFrame, Jt as ETHEREUM_USDT, K as carryMentions, Ki as receivedIdentityStatus, Kl as currentRelays, Ko as LEGACY_SERVICES, Kr as WakeLimiter, Ks as enrollCancelReason, L as parseGroupWakeFrame, La as readReaction, Lc as APP_STATEMENT_LIMITS, Ll as turnName, Ln as PAIRED_FRAME_TOO_LARGE, Lr as typingActivity, Ls as setAckFrame, M as readKnocks, Ma as ReactionWindow, Mc as pacer, Mi as CapsExchange, Ml as readTurnPacket, Mn as parseCashuRequestPayload, Mo as decodeControl, Mr as transferStalled, Ms as readHandoffVerified, Na as nextReactionNumber, Ni as DHT_TEXT_CAPABILITY, Nl as signTurnPacket, Nn as parseFedimintRequestPayload, No as encodeControl, Ns as sealHandoffPiece, O as entryParams, Oa as readForwarded, Oc as appViewOf, Ol as TURN_LAST_SEQUENCE, On as cashuRequestPayload, Oo as formatLocalTarget, Or as ChatFiles, Os as readHandoffHave, P as GroupWakeLimiter, Pa as queueReaction, Pc as readAppBundleAsync, Pi as capsDescriptors, Pl as signTurnRelease, Pn as GhostLink, Qc as readCanonicalJson, Qi as TRANSPORTS, Ql as withRequestOptions, Qo as HANDOFF_HELLO, Qr as checkPushEndpoint, Qs as readEnrollGrant, Qt as SEPOLIA_TEST_USDT, R as GROUP_LIMITS, Ra as validReactionNumber, Rc as appFingerprint, Ri as IDENTITY_REVOCATION_LABEL, Rl as turnStatedVerifier, Rn as pairedMessageFits, Rs as setUpdateFrame, S as communityHasFrame, Sa as MAX_REMOVAL_NUMBER, Sc as seenEntry, Sl as webCryptoSigner, So as DHT_POLL_INTERVALS, Sr as pickHubs, Ss as handoffStreamKey, Ta as dhtEditId, Tc as APP_ICON_PATH, Tl as TURN_SETTLE_MS, To as WATCH_PEER_MS, Tr as readBeaconHead, Ts as readHandoffAck, Ua as BUTTON_ID, Uc as isAppRef, Ui as identityRevocationValue, Ul as RelayTransport, Un as parseEngineError, Ur as pinNumberHolds, Ut as didDhtFromPublicKey, V as GroupSession, Va as readReply, Vc as isAppHash, Vn as engineError, Vr as nextPinNumber, Wc as readAppRevocation, Wi as identityStatement, Wn as GROUP_FILE_LIMITS, Wo as emptyLinkRecords, Wr as readPin, Wt as encodeDidDhtDeactivated, Xa as STATUS_CARD_LIMITS, Xc as canonicalJson, Xi as emptyProofLedger, Xl as budgetRetryMs, Xo as HANDOFF_DONE, Xr as relayRequest, Xs as enrollHelloFrame, Xt as ONCHAIN_PROVIDER, Y as groupName, Yi as PeerProofs, Yl as traceLink, Yn as groupFileFallback, Yo as HANDOFF_CANCEL, Yr as parseWakeFrame, Ys as enrollGrantFrame, Yt as EVM_TEST_CHAINS, Zi as validExternalKey, Zl as isDiscoveryBudgetError, Zn as readGroupFileMeta, Zo as HANDOFF_HAVE, Zr as wakeRequest, Zs as enrollProofFrame, Zt as PaymentPreflightError, _ as openGroupTyping, _c as mergeContactKnocks, _i as readManifest, _l as deviceKeyZ32, _o as rosterHas, _r as lobbyKeys, _s as handoffManifestFrames, _u as toBase64Url, a as appStoreDecision, aa as DHT_FILE_CAPABILITY, ac as planKnocks, ai as APPS_CAPABILITY, al as OwnInviteError, an as assertWholeSats, ao as arrivalKey, as as filePartName, au as createIdentity, b as CommunitySession, ba as EDIT_BUFFER_MS, bc as readLinkRecord, bl as newDeviceSetSecret, bo as DirectPathWatch, br as mergeLobby, bs as handoffReleaseFrame, bu as utf8Encode, c as planAppUpdate, ca as sanitizeFileName, cc as turnOff, ci as STATUS_CARD_CAPABILITY, cl as encodeInviteCode, cn as walletNetworkOf, co as receivedTimestamp, cr as MESH_HUBS, cs as handoffAttemptSucceeded, cu as publicKeyFromZ32, dc as contactDay, di as HOLD_DATED_BACK_MS, dn as sparkAddressKind, do as GROUP_MEMBER_CAP, dr as pickMeshHubs, ds as handoffContext, du as sanitizeAvatar, ec as verifyEnrollProof, ei as APP_RANGE_LIMITS, el as encodeContactLink, en as TEST_USDT_FAUCET_AMOUNT, es as HANDOFF_PAKE, f as readAppStoreSteps, fc as knockSlotIdentity, fi as HOLD_LIMITS, fl as DEVICES_CAPABILITY, fn as sparkInvoiceDetails, fr as COMMUNITY_TOPOLOGY, fs as handoffContextProof, fu as sanitizeDisplayText, g as groupTypingEpoch, ga as parseVoiceMeta, gc as makeStampPaced, gi as newMailbox, gl as deviceEchoNonce, go as rosterAdmin, gr as freshHubs, gs as handoffHelloFrame, gt as normalizeAtprotoHandle, gu as randomBytes, h as GroupTypingBoard, ha as fileMessageText, hc as linkRecords, hi as isHoldUrl, hl as deviceEchoFrame, hn as isPubkyKey, ho as parseGroupCommit, hr as doorHubs, hs as handoffEphemeral, ht as isAtprotoDid, i as appRevocationFor, ia as peekDhtMailbox, ic as newInbox, ii as isAppVersion, il as readDeviceInvite, in as assertTokenUnits, io as statusCardText, is as HANDOFF_VERIFIED, j as mergeKnocks, ja as REACTION_LIMITS, jc as isAppUrl, jl as nextTurnPosition, jn as isFederationId, jo as LIMITS, jr as transferEnded, js as readHandoffTurnFrame, k as knockIdentity, ka as COMMUNITY_REACTION_FRAME, kl as TURN_MAX, kn as fedimintRequestPayload, ko as parseLocalTarget, kr as FILE_LIMITS, ks as readHandoffHello, l as APP_STORE_LIMITS, la as sanitizeMime, lc as ContactRequestError, li as UPGRADE_CAPABILITY, ll as inviteLink, ln as SPARK_NETWORKS, lo as shownTime, lr as mayBeHub, ls as handoffBusyFrame, lu as verify, mc as knockSlotRecords, mi as HoldRefusedError, ml as HANDOFF_CAPABILITY, mo as commitHash, mr as beaconRecords, ms as handoffDigest, mu as fromBase64Url, n as readX401SdJwtVc, nc as endedRequests, nl as createDeviceInvite, nn as WALLET_NETWORKS, no as checkStatusCard, ns as HANDOFF_REQUEST, o as appUpdateDecision, oa as dhtFileId, oc as settleRequest, oi as BUTTONS_CAPABILITY, ol as createChatInvite, on as formatPaymentAmount, oo as claimedTime, or as groupSignalFrame, os as handoffAttemptAllowed, ou as identityFromSeed, pc as knockSlotOf, pi as HoldKeys, pl as ENROLL_CAPABILITY, pn as isBitcoinAddress, po as MEMBER_KEY, pr as beaconKeys, ps as handoffDataFrame, pu as bytesEqual, q as parseCommunityEdit, qi as revokesIdentity, ql as normalizeRelayUrl, qo as serviceIdFromName, qr as deviceWakeRequest, qs as enrollDigits, qt as signDidDhtPacket, r as sameX401HolderJwk, ra as DHT_MESSAGE_TTL, rc as inboxRecord, ri as chatAppId, rl as deviceInviteJoinerParams, rn as arkAddressPrefix, ro as sameButtonText, rs as HANDOFF_TIMINGS, s as checkAppBeforeRun, sa as formatFileSize, sc as takeRequest, si as EDIT_CAPABILITY, sl as decodeInviteCode, sn as validatePaymentTarget, so as heardTime, sr as readGroupSignal, ss as handoffAttemptFailed, su as identityFromSeedB64, t as newX401HolderKey, tc as clearMissed, ti as isServeId, tl as readContactLink, tn as USDT_PUBLIC_RPC, tr as CarriedTransport, ts as HANDOFF_PIECE_BYTES, tu as createRelayPayload, uc as REQUEST_LIFETIME_MS, ui as HOLD_CAPABILITY, ul as inviteOwnership, un as SPARK_PROVIDER, uo as GROUP_ADMIN_OFF_ERROR, ur as meshHubs, us as handoffCancelFrame, v as sealGroupTyping, vc as openRequest, vl as deviceLinkPairing, vo as verifyCommitSignature, vr as lobbyRecords, vs as handoffOfferFrame, vu as toZ32, w as encodeCommunityLink, wa as RateWindow, wc as APP_BUNDLE_MAGIC, wl as TURN_RAISE_READ_TIMEOUT_MS, wo as RELAY_POLL_INTERVALS, wr as readBeacon, ws as newHandoffId, x as GROUP_READ_NOTE_COMMUNITY, xa as EDIT_RATE_WINDOW_MS, xc as requestRecords, xl as seedSigner, xr as newerHead, xs as handoffRetryAfter, y as COMMUNITY_LIMITS, ya as parseVideoMeta, yc as readKnockSlot, yl as devicePingFrame, yo as edgeParams, yr as mergeBeacon, ys as handoffPakeFrame, yu as utf8Decode, za as wireReaction, zc as appRef, zl as turnVerifierMark, zn as pairedMessageFrame, zr as PIN_LIMITS, zs as signTombstone } from "./src-
|
|
2
|
+
import { $c as createContactLink, $i as automaticTransport, $l as PacketTooLargeError, $o as HANDOFF_OFFER, $r as vapidKeysMatch, $s as readEnrollHello, A as knockRecords, Aa as GROUP_REACTION_FRAME, Al as firstDeviceSetSecret, An as findEndpoint, Ao as webLocalFetch, As as readHandoffPake, B as GROUP_READ_NOTE, Ba as pairedReplyAuthor, Bi as IdentityExchange, Bl as DEFAULT_RELAYS, Bn as EngineError, Bo as contactRtcConfig, Br as mayPin, Bs as verifySetUpdate, C as decodeCommunityLink, Ca as REMOVED_TEXT, Cc as APP_BUNDLE_LIMITS, Cr as rankHubs, Cs as handoffVersions, D as encodeGroupEntryLink, Da as forwardedAgain, Dc as appDigest, Dl as turnPutSummary, Dn as ENDPOINT, Do as GhostlyHttpError, Dr as shouldBeHub, Ds as readHandoffDone, E as decodeGroupEntryLink, Ea as parseLinkPreview, El as classifyTurnRead, En as decodeBolt11, Eo as presenceSeenAt, Er as readLobby, Es as readHandoffCancel, F as groupWakeFrame, Fa as reactionEmoji, Fc as sha256Paced, Fi as dialDescriptors, Fl as turnInstance, Fn as INVITE_TAKEN, Fo as RTC_CONFIG, Fr as TypingSender, G as GROUP_EDIT_TEXT_BYTES, Gi as newIdentityBinding, Go as HTTP_SERVICE_PROTO, Gr as WAKE_CALL_INTERVAL_MS, Gs as enrollCancelFrame, Gt as encodeDidDhtPacket, H as frameBytes, Ha as replySnippet, Hc as isAppKey, Hi as emptyIdentityLedger, Hn as engineText, Ho as parseCallSignal, Hr as pinIsNewer, Ht as didDhtDocument, I as groupWakes, Ia as reactionIsNewer, Il as turnKeys, In as LIVENESS_PING_MS, Is as readSetUpdate, J as mentionsMember, Jc as parseImageMeta, Ji as lastSharedWithMe, Jo as HANDOFF_ACK, Jr as newWakeToken, Js as enrollDoneFrame, Jt as ETHEREUM_USDT, K as carryMentions, Ki as receivedIdentityStatus, Kl as currentRelays, Ko as LEGACY_SERVICES, Kr as WakeLimiter, Ks as enrollCancelReason, L as parseGroupWakeFrame, La as readReaction, Lc as APP_STATEMENT_LIMITS, Ll as turnName, Ln as PAIRED_FRAME_TOO_LARGE, Lr as typingActivity, Ls as setAckFrame, M as readKnocks, Ma as ReactionWindow, Mc as pacer, Mi as CapsExchange, Ml as readTurnPacket, Mn as parseCashuRequestPayload, Mo as decodeControl, Mr as transferStalled, Ms as readHandoffVerified, Na as nextReactionNumber, Ni as DHT_TEXT_CAPABILITY, Nl as signTurnPacket, Nn as parseFedimintRequestPayload, No as encodeControl, Ns as sealHandoffPiece, O as entryParams, Oa as readForwarded, Oc as appViewOf, Ol as TURN_LAST_SEQUENCE, On as cashuRequestPayload, Oo as formatLocalTarget, Or as ChatFiles, Os as readHandoffHave, P as GroupWakeLimiter, Pa as queueReaction, Pc as readAppBundleAsync, Pi as capsDescriptors, Pl as signTurnRelease, Pn as GhostLink, Qc as readCanonicalJson, Qi as TRANSPORTS, Ql as withRequestOptions, Qo as HANDOFF_HELLO, Qr as checkPushEndpoint, Qs as readEnrollGrant, Qt as SEPOLIA_TEST_USDT, R as GROUP_LIMITS, Ra as validReactionNumber, Rc as appFingerprint, Ri as IDENTITY_REVOCATION_LABEL, Rl as turnStatedVerifier, Rn as pairedMessageFits, Rs as setUpdateFrame, S as communityHasFrame, Sa as MAX_REMOVAL_NUMBER, Sc as seenEntry, Sl as webCryptoSigner, So as DHT_POLL_INTERVALS, Sr as pickHubs, Ss as handoffStreamKey, Ta as dhtEditId, Tc as APP_ICON_PATH, Tl as TURN_SETTLE_MS, To as WATCH_PEER_MS, Tr as readBeaconHead, Ts as readHandoffAck, Ua as BUTTON_ID, Uc as isAppRef, Ui as identityRevocationValue, Ul as RelayTransport, Un as parseEngineError, Ur as pinNumberHolds, Ut as didDhtFromPublicKey, V as GroupSession, Va as readReply, Vc as isAppHash, Vn as engineError, Vr as nextPinNumber, Wc as readAppRevocation, Wi as identityStatement, Wn as GROUP_FILE_LIMITS, Wo as emptyLinkRecords, Wr as readPin, Wt as encodeDidDhtDeactivated, Xa as STATUS_CARD_LIMITS, Xc as canonicalJson, Xi as emptyProofLedger, Xl as budgetRetryMs, Xo as HANDOFF_DONE, Xr as relayRequest, Xs as enrollHelloFrame, Xt as ONCHAIN_PROVIDER, Y as groupName, Yi as PeerProofs, Yl as traceLink, Yn as groupFileFallback, Yo as HANDOFF_CANCEL, Yr as parseWakeFrame, Ys as enrollGrantFrame, Yt as EVM_TEST_CHAINS, Zi as validExternalKey, Zl as isDiscoveryBudgetError, Zn as readGroupFileMeta, Zo as HANDOFF_HAVE, Zr as wakeRequest, Zs as enrollProofFrame, Zt as PaymentPreflightError, _ as openGroupTyping, _c as mergeContactKnocks, _i as readManifest, _l as deviceKeyZ32, _o as rosterHas, _r as lobbyKeys, _s as handoffManifestFrames, _u as toBase64Url, a as appStoreDecision, aa as DHT_FILE_CAPABILITY, ac as planKnocks, ai as APPS_CAPABILITY, al as OwnInviteError, an as assertWholeSats, ao as arrivalKey, as as filePartName, au as createIdentity, b as CommunitySession, ba as EDIT_BUFFER_MS, bc as readLinkRecord, bl as newDeviceSetSecret, bo as DirectPathWatch, br as mergeLobby, bs as handoffReleaseFrame, bu as utf8Encode, c as planAppUpdate, ca as sanitizeFileName, cc as turnOff, ci as STATUS_CARD_CAPABILITY, cl as encodeInviteCode, cn as walletNetworkOf, co as receivedTimestamp, cr as MESH_HUBS, cs as handoffAttemptSucceeded, cu as publicKeyFromZ32, dc as contactDay, di as HOLD_DATED_BACK_MS, dn as sparkAddressKind, do as GROUP_MEMBER_CAP, dr as pickMeshHubs, ds as handoffContext, du as sanitizeAvatar, ec as verifyEnrollProof, ei as APP_RANGE_LIMITS, el as encodeContactLink, en as TEST_USDT_FAUCET_AMOUNT, es as HANDOFF_PAKE, f as readAppStoreSteps, fc as knockSlotIdentity, fi as HOLD_LIMITS, fl as DEVICES_CAPABILITY, fn as sparkInvoiceDetails, fr as COMMUNITY_TOPOLOGY, fs as handoffContextProof, fu as sanitizeDisplayText, g as groupTypingEpoch, ga as parseVoiceMeta, gc as makeStampPaced, gi as newMailbox, gl as deviceEchoNonce, go as rosterAdmin, gr as freshHubs, gs as handoffHelloFrame, gt as normalizeAtprotoHandle, gu as randomBytes, h as GroupTypingBoard, ha as fileMessageText, hc as linkRecords, hi as isHoldUrl, hl as deviceEchoFrame, hn as isPubkyKey, ho as parseGroupCommit, hr as doorHubs, hs as handoffEphemeral, ht as isAtprotoDid, i as appRevocationFor, ia as peekDhtMailbox, ic as newInbox, ii as isAppVersion, il as readDeviceInvite, in as assertTokenUnits, io as statusCardText, is as HANDOFF_VERIFIED, j as mergeKnocks, ja as REACTION_LIMITS, jc as isAppUrl, jl as nextTurnPosition, jn as isFederationId, jo as LIMITS, jr as transferEnded, js as readHandoffTurnFrame, k as knockIdentity, ka as COMMUNITY_REACTION_FRAME, kl as TURN_MAX, kn as fedimintRequestPayload, ko as parseLocalTarget, kr as FILE_LIMITS, ks as readHandoffHello, l as APP_STORE_LIMITS, la as sanitizeMime, lc as ContactRequestError, li as UPGRADE_CAPABILITY, ll as inviteLink, ln as SPARK_NETWORKS, lo as shownTime, lr as mayBeHub, ls as handoffBusyFrame, lu as verify, mc as knockSlotRecords, mi as HoldRefusedError, ml as HANDOFF_CAPABILITY, mo as commitHash, mr as beaconRecords, ms as handoffDigest, mu as fromBase64Url, n as readX401SdJwtVc, nc as endedRequests, nl as createDeviceInvite, nn as WALLET_NETWORKS, no as checkStatusCard, ns as HANDOFF_REQUEST, o as appUpdateDecision, oa as dhtFileId, oc as settleRequest, oi as BUTTONS_CAPABILITY, ol as createChatInvite, on as formatPaymentAmount, oo as claimedTime, or as groupSignalFrame, os as handoffAttemptAllowed, ou as identityFromSeed, pc as knockSlotOf, pi as HoldKeys, pl as ENROLL_CAPABILITY, pn as isBitcoinAddress, po as MEMBER_KEY, pr as beaconKeys, ps as handoffDataFrame, pu as bytesEqual, q as parseCommunityEdit, qi as revokesIdentity, ql as normalizeRelayUrl, qo as serviceIdFromName, qr as deviceWakeRequest, qs as enrollDigits, qt as signDidDhtPacket, r as sameX401HolderJwk, ra as DHT_MESSAGE_TTL, rc as inboxRecord, ri as chatAppId, rl as deviceInviteJoinerParams, rn as arkAddressPrefix, ro as sameButtonText, rs as HANDOFF_TIMINGS, s as checkAppBeforeRun, sa as formatFileSize, sc as takeRequest, si as EDIT_CAPABILITY, sl as decodeInviteCode, sn as validatePaymentTarget, so as heardTime, sr as readGroupSignal, ss as handoffAttemptFailed, su as identityFromSeedB64, t as newX401HolderKey, tc as clearMissed, ti as isServeId, tl as readContactLink, tn as USDT_PUBLIC_RPC, tr as CarriedTransport, ts as HANDOFF_PIECE_BYTES, tu as createRelayPayload, uc as REQUEST_LIFETIME_MS, ui as HOLD_CAPABILITY, ul as inviteOwnership, un as SPARK_PROVIDER, uo as GROUP_ADMIN_OFF_ERROR, ur as meshHubs, us as handoffCancelFrame, v as sealGroupTyping, vc as openRequest, vl as deviceLinkPairing, vo as verifyCommitSignature, vr as lobbyRecords, vs as handoffOfferFrame, vu as toZ32, w as encodeCommunityLink, wa as RateWindow, wc as APP_BUNDLE_MAGIC, wl as TURN_RAISE_READ_TIMEOUT_MS, wo as RELAY_POLL_INTERVALS, wr as readBeacon, ws as newHandoffId, x as GROUP_READ_NOTE_COMMUNITY, xa as EDIT_RATE_WINDOW_MS, xc as requestRecords, xl as seedSigner, xr as newerHead, xs as handoffRetryAfter, y as COMMUNITY_LIMITS, ya as parseVideoMeta, yc as readKnockSlot, yl as devicePingFrame, yo as edgeParams, yr as mergeBeacon, ys as handoffPakeFrame, yu as utf8Decode, za as wireReaction, zc as appRef, zl as turnVerifierMark, zn as pairedMessageFrame, zr as PIN_LIMITS, zs as signTombstone } from "./src-CFeRBeHz.js";
|
|
3
3
|
import { i as SourceUnreachableError, n as PROVIDER_PLATFORMS, o as isNothingSpentError, r as SourceConfigError, t as NothingSpentError, u as redact } from "./types-C4_KafL_.js";
|
|
4
4
|
import { t as bitcoindRpc } from "./bitcoindProvider-DGw3xBSa.js";
|
|
5
|
-
import { t as nwc } from "./nwcProvider-
|
|
6
|
-
import { a as clearProfileStores, c as deleteDatabase, d as newestWalletTx, f as openDb, g as wrap, h as transact, i as STORES$1, l as errorLine, m as store, n as APP_STORAGE_SCOPE_INDEX, o as committed, p as profileOpenFailure, r as CARD_INDEX, s as databaseName, t as APP_STORAGE_CHAT_INDEX, u as fileStore } from "./idb-
|
|
7
|
-
import { a as sealSeed, i as newDeviceKey, o as unsealSeed, r as intentRepository } from "./networkReason-
|
|
8
|
-
import { $ as setAwayWallets, A as LightningCards, B as breezDatabaseInUse, C as FileAppender, D as streamStored, E as storedSize, F as ProviderSources, G as relayOnlyProblem, H as dropBreezDatabase, I as sourceKey, J as WrongNetworkError, K as ModeChanged, L as CASHU_MINT_SOURCE, M as isRecoveryPhrase, N as normalizePhrase, P as lightningPaying, Q as requireTurn, R as cashuMint, S as WALLET_TYPES, T as removeStored, U as iceServerProblem, V as breezDatabasesFor, W as iceServerSetting, X as awayFrom, Y as networkLabel, Z as refuseAway, _ as crossNetwork, a as storedGroupFiles, b as walletInstances, c as receivedPairedReply, d as paymentAlias, et as setSingleWriterGate, f as paymentWireId, g as createTiming, h as createFailure, i as groupOfFile, j as cardsKey, k as CASHU_CARD, l as replyRef, m as assertConfirmedReal, n as groupFileId, o as groupReply, p as WALLET_NAMES, q as ModeGate, r as groupFileText, s as pairedWireReply, t as GroupFileDesk, u as replyTo, v as paymentNetwork, w as readStored$1, y as paymentNetworksOf, z as breezDatabase } from "./groupFiles-
|
|
9
|
-
import { i as fedimintDatabase, n as createIrohWebEndpoint, o as loadFedimintSdk, r as irohRelayProblem, t as DEFAULT_IROH_RELAYS } from "./irohWeb-
|
|
5
|
+
import { t as nwc } from "./nwcProvider-B4k6mYJl.js";
|
|
6
|
+
import { a as clearProfileStores, c as deleteDatabase, d as newestWalletTx, f as openDb, g as wrap, h as transact, i as STORES$1, l as errorLine, m as store, n as APP_STORAGE_SCOPE_INDEX, o as committed, p as profileOpenFailure, r as CARD_INDEX, s as databaseName, t as APP_STORAGE_CHAT_INDEX, u as fileStore } from "./idb-BlH8-O3R.js";
|
|
7
|
+
import { a as sealSeed, i as newDeviceKey, o as unsealSeed, r as intentRepository } from "./networkReason-DWzsMN8E.js";
|
|
8
|
+
import { $ as setAwayWallets, A as LightningCards, B as breezDatabaseInUse, C as FileAppender, D as streamStored, E as storedSize, F as ProviderSources, G as relayOnlyProblem, H as dropBreezDatabase, I as sourceKey, J as WrongNetworkError, K as ModeChanged, L as CASHU_MINT_SOURCE, M as isRecoveryPhrase, N as normalizePhrase, P as lightningPaying, Q as requireTurn, R as cashuMint, S as WALLET_TYPES, T as removeStored, U as iceServerProblem, V as breezDatabasesFor, W as iceServerSetting, X as awayFrom, Y as networkLabel, Z as refuseAway, _ as crossNetwork, a as storedGroupFiles, b as walletInstances, c as receivedPairedReply, d as paymentAlias, et as setSingleWriterGate, f as paymentWireId, g as createTiming, h as createFailure, i as groupOfFile, j as cardsKey, k as CASHU_CARD, l as replyRef, m as assertConfirmedReal, n as groupFileId, o as groupReply, p as WALLET_NAMES, q as ModeGate, r as groupFileText, s as pairedWireReply, t as GroupFileDesk, u as replyTo, v as paymentNetwork, w as readStored$1, y as paymentNetworksOf, z as breezDatabase } from "./groupFiles-DVxX0O1g.js";
|
|
9
|
+
import { i as fedimintDatabase, n as createIrohWebEndpoint, o as loadFedimintSdk, r as irohRelayProblem, t as DEFAULT_IROH_RELAYS } from "./irohWeb-B5j2rgWj.js";
|
|
10
10
|
import { c as isTestMint, d 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-BrlY773j.js";
|
|
11
|
-
import { _ as reserveAdapterIds, b as testBuild, f as setOwnDidSource, g as registeredOnchainProviders, h as registeredLightningProviders, l as chosenResolver, n as resolveAtprotoDid, p as onAdaptersChanged, t as assertPublicServer, v as boundedIdentityFetch, y as verifyIdentity } from "./resolve-
|
|
12
|
-
import { i as fromBase64Url$1, n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-
|
|
13
|
-
import { c as fileSpace, f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf, u as removeFileBytes } from "./fileBytes-
|
|
11
|
+
import { _ as reserveAdapterIds, b as testBuild, f as setOwnDidSource, g as registeredOnchainProviders, h as registeredLightningProviders, l as chosenResolver, n as resolveAtprotoDid, p as onAdaptersChanged, t as assertPublicServer, v as boundedIdentityFetch, y as verifyIdentity } from "./resolve-BPJnMtLC.js";
|
|
12
|
+
import { i as fromBase64Url$1, n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-ByeUit1N.js";
|
|
13
|
+
import { c as fileSpace, f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf, u as removeFileBytes } from "./fileBytes-BMEBas7S.js";
|
|
14
14
|
import { t as hyperdhtRelayProblem } from "./hyperdhtRelay-BT_wRxab.js";
|
|
15
15
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
16
16
|
import { hkdf } from "@noble/hashes/hkdf.js";
|
|
@@ -198,7 +198,7 @@ function viewNews(before, after) {
|
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region ../browser/src/engine/paymentAdapters/usdtWallet.ts
|
|
200
200
|
/** The Ethereum libraries, a large part of the app: loaded once a USDT wallet is made, opened or restored, not with the engine. */
|
|
201
|
-
var loadUsdt = () => import("./usdt-
|
|
201
|
+
var loadUsdt = () => import("./usdt-CBh78JVF.js");
|
|
202
202
|
/** Every new profile starts with this wallet: an address to receive on, nothing to set up. */
|
|
203
203
|
var DEFAULT_USDT = {
|
|
204
204
|
network: "ethereum",
|
|
@@ -647,7 +647,7 @@ async function restoreArkDatabase(walletId, snapshot) {
|
|
|
647
647
|
//#endregion
|
|
648
648
|
//#region ../browser/src/engine/paymentAdapters/arkWallet.ts
|
|
649
649
|
/** The Ark SDK, a large part of the app: loaded once an Ark wallet is made, opened or restored, not with the engine. */
|
|
650
|
-
var loadArkade = () => import("./arkade-
|
|
650
|
+
var loadArkade = () => import("./arkade-C9Ne-zJb.js");
|
|
651
651
|
/** How long a Testnet wallet about to make way for another waits for its server to say what it holds. */
|
|
652
652
|
var RETIRE_READ_MS = 1e4;
|
|
653
653
|
/** Every new profile starts with this wallet: nothing to set up before receiving. */
|
|
@@ -4364,7 +4364,11 @@ var BdkOnchain = class BdkOnchain {
|
|
|
4364
4364
|
this.changeset = stored ? bdk.ChangeSet.from_json(stored.changeset) : void 0;
|
|
4365
4365
|
this.reserved = (stored?.reserved ?? []).filter((r) => Date.now() - r.at < RESERVATION_MS);
|
|
4366
4366
|
this.scanned = stored?.scanned ?? false;
|
|
4367
|
+
this.shown = new Map(Object.entries(stored?.shown ?? {}).map(([index, at]) => [Number(index), at]));
|
|
4368
|
+
this.openedAt = Date.now();
|
|
4367
4369
|
}
|
|
4370
|
+
shown;
|
|
4371
|
+
openedAt;
|
|
4368
4372
|
scanned;
|
|
4369
4373
|
/**
|
|
4370
4374
|
* Checks the settings, finds an Esplora server on the wallet's chain, and loads the wallet. What fails
|
|
@@ -4447,10 +4451,26 @@ var BdkOnchain = class BdkOnchain {
|
|
|
4447
4451
|
this.syncing = void 0;
|
|
4448
4452
|
});
|
|
4449
4453
|
}
|
|
4454
|
+
/**
|
|
4455
|
+
* Where to be paid: a new address, unless STOP_GAP - 1 handed out already wait unpaid. Then the unpaid one shown
|
|
4456
|
+
* longest ago, once that is ADDRESS_HOLD_MS: a restore's full scan stops after STOP_GAP unused addresses in a row, so
|
|
4457
|
+
* a payment past more unpaid requests than that was never found from the phrase (agents#1634), and every address
|
|
4458
|
+
* revealed is read at every sync. Only where each of those is still held for someone is a new one revealed anyway.
|
|
4459
|
+
*/
|
|
4450
4460
|
async receiveAddress() {
|
|
4451
|
-
|
|
4461
|
+
let unused = this.wallet.list_unused_addresses("external");
|
|
4462
|
+
if (unused.length >= 19) try {
|
|
4463
|
+
await this.sync();
|
|
4464
|
+
unused = this.wallet.list_unused_addresses("external");
|
|
4465
|
+
} catch {}
|
|
4466
|
+
const now = Date.now();
|
|
4467
|
+
const shownAt = (index) => this.shown.get(index) ?? this.openedAt;
|
|
4468
|
+
const info = (unused.length < 19 ? void 0 : unused.filter((info) => now - shownAt(info.index) >= 36e5).sort((a, b) => shownAt(a.index) - shownAt(b.index) || a.index - b.index)[0]) ?? this.wallet.reveal_next_address("external");
|
|
4469
|
+
this.shown.set(info.index, now);
|
|
4470
|
+
const open = new Set(unused.map((u) => u.index));
|
|
4471
|
+
for (const index of this.shown.keys()) if (index !== info.index && !open.has(index)) this.shown.delete(index);
|
|
4452
4472
|
this.persist();
|
|
4453
|
-
return address;
|
|
4473
|
+
return info.address.toString();
|
|
4454
4474
|
}
|
|
4455
4475
|
async balance() {
|
|
4456
4476
|
await this.sync();
|
|
@@ -4655,7 +4675,8 @@ var BdkOnchain = class BdkOnchain {
|
|
|
4655
4675
|
const value = {
|
|
4656
4676
|
changeset: this.changeset.to_json(),
|
|
4657
4677
|
reserved: this.reserved,
|
|
4658
|
-
scanned: this.scanned
|
|
4678
|
+
scanned: this.scanned,
|
|
4679
|
+
shown: Object.fromEntries(this.shown)
|
|
4659
4680
|
};
|
|
4660
4681
|
this.writes = this.writes.then(() => this.store.save(this.key, value)).catch(() => {});
|
|
4661
4682
|
}
|
|
@@ -6815,7 +6836,7 @@ var registry;
|
|
|
6815
6836
|
var loading$1;
|
|
6816
6837
|
var listeners = /* @__PURE__ */ new Set();
|
|
6817
6838
|
function loadIdentityProviders() {
|
|
6818
|
-
return loading$1 ??= import("./registry-
|
|
6839
|
+
return loading$1 ??= import("./registry-Ccru6KBP.js").then((m) => {
|
|
6819
6840
|
registry = m;
|
|
6820
6841
|
for (const listener of listeners) listener();
|
|
6821
6842
|
return m;
|
|
@@ -22839,12 +22860,19 @@ function pinOfFormerMember(pin, inRoster) {
|
|
|
22839
22860
|
function mayPinIn(group) {
|
|
22840
22861
|
return !!group?.myKey && group.status === "active" && mayPin(group.profile, group.myKey, group.members.find((m) => m.role === "admin")?.key);
|
|
22841
22862
|
}
|
|
22842
|
-
/**
|
|
22863
|
+
/**
|
|
22864
|
+
* The row a pin names, when it is here: the row of that id (a group's), or of `peer_`/`me_` and that id, or one the host
|
|
22865
|
+
* knows that id names (a file of mine, a payment), each read alone; else any other of a chat's.
|
|
22866
|
+
*/
|
|
22843
22867
|
async function pinnedRow(host, chat, id) {
|
|
22844
22868
|
if (!id) return void 0;
|
|
22845
22869
|
const group = isGroup(chat);
|
|
22846
22870
|
if (host.message) {
|
|
22847
|
-
for (const rowId of group ? [id] : [
|
|
22871
|
+
for (const rowId of group ? [id] : [
|
|
22872
|
+
`peer_${id}`,
|
|
22873
|
+
`me_${id}`,
|
|
22874
|
+
...await host.rows?.(chat, id) ?? []
|
|
22875
|
+
]) {
|
|
22848
22876
|
const row = await host.message(chat, rowId);
|
|
22849
22877
|
if (row && replyRef(row, group) === id) return row;
|
|
22850
22878
|
}
|
|
@@ -22866,7 +22894,7 @@ async function myPin(host, chat, messageId, remove, current, now = Date.now()) {
|
|
|
22866
22894
|
} : { error: "Nothing is pinned in this chat" };
|
|
22867
22895
|
if (typeof messageId !== "string" || !messageId) return { error: "No message to pin" };
|
|
22868
22896
|
const group = isGroup(chat);
|
|
22869
|
-
const target = await host.message
|
|
22897
|
+
const target = host.message ? await host.message(chat, messageId) ?? await pinnedRow(host, chat, messageId) : (await host.messages(chat)).find((m) => m.id === messageId) ?? await pinnedRow(host, chat, messageId);
|
|
22870
22898
|
const id = target && replyRef(target, group);
|
|
22871
22899
|
if (!target || !id) return { error: "That message is not in this chat, or cannot be pinned" };
|
|
22872
22900
|
return {
|
|
@@ -23403,6 +23431,9 @@ var Communities = class {
|
|
|
23403
23431
|
knockAt = /* @__PURE__ */ new Map();
|
|
23404
23432
|
/** Joiners: how many others had a knock still being refreshed in the record I last read (they wait with me). */
|
|
23405
23433
|
knockingWith = /* @__PURE__ */ new Map();
|
|
23434
|
+
/** Since when this run knocks with nobody answering (`JOIN_GIVE_UP_MS`), and the joins it gave up (`Groups.giveUpJoin`). */
|
|
23435
|
+
knockingSince = /* @__PURE__ */ new Map();
|
|
23436
|
+
gaveUp = /* @__PURE__ */ new Set();
|
|
23406
23437
|
/** Joiners: the knock record a knock read whose write the relays refused, and when it was read (`knock`). */
|
|
23407
23438
|
knockRead = /* @__PURE__ */ new Map();
|
|
23408
23439
|
/** My frames an edge took, and which of them carry an edit (`frame id → editKey`). */
|
|
@@ -23526,7 +23557,8 @@ var Communities = class {
|
|
|
23526
23557
|
viaLink: true,
|
|
23527
23558
|
stage: this.joinStage(group),
|
|
23528
23559
|
since: group.joining.since,
|
|
23529
|
-
...this.knockingWith.get(group.id) ? { waiting: this.knockingWith.get(group.id) } : {}
|
|
23560
|
+
...this.knockingWith.get(group.id) ? { waiting: this.knockingWith.get(group.id) } : {},
|
|
23561
|
+
...this.gaveUp.has(group.id) && { unanswered: true }
|
|
23530
23562
|
} : void 0;
|
|
23531
23563
|
if (invitation && !this.keptWhileKnocking(live)) return [{
|
|
23532
23564
|
...base,
|
|
@@ -23606,7 +23638,10 @@ var Communities = class {
|
|
|
23606
23638
|
if (!link) throw new Error("This is not a link to a group");
|
|
23607
23639
|
const existing = this.stored.get(link.g);
|
|
23608
23640
|
const live = this.live.get(link.g);
|
|
23609
|
-
if (existing?.joining && existing.joining.host === link.host)
|
|
23641
|
+
if (existing?.joining && existing.joining.host === link.host) {
|
|
23642
|
+
await this.knockAgain(link.g);
|
|
23643
|
+
return link.g;
|
|
23644
|
+
}
|
|
23610
23645
|
if (live) {
|
|
23611
23646
|
const s = live.session;
|
|
23612
23647
|
const door = s.entryKey === link.host;
|
|
@@ -23645,6 +23680,8 @@ var Communities = class {
|
|
|
23645
23680
|
this.knockAt.delete(link.g);
|
|
23646
23681
|
this.knockingWith.delete(link.g);
|
|
23647
23682
|
this.knockRead.delete(link.g);
|
|
23683
|
+
this.knockingSince.delete(link.g);
|
|
23684
|
+
this.gaveUp.delete(link.g);
|
|
23648
23685
|
const before = this.stored.get(link.g)?.joining;
|
|
23649
23686
|
const linkId = await this.host.openEntry(link, "guest", seedB64, link.host);
|
|
23650
23687
|
if (before && before.linkId !== linkId) await this.host.closeEdge(before.linkId);
|
|
@@ -23669,6 +23706,26 @@ var Communities = class {
|
|
|
23669
23706
|
traceJoin(link.g, "join.start");
|
|
23670
23707
|
this.knock(group, since).catch(() => {});
|
|
23671
23708
|
}
|
|
23709
|
+
/** A link join nobody answered (`JOIN_GIVE_UP_MS`) knocks again, as when the link was opened: Try again. */
|
|
23710
|
+
async knockAgain(groupId, now = this.now()) {
|
|
23711
|
+
const group = this.stored.get(groupId);
|
|
23712
|
+
if (!group?.joining || !this.gaveUp.delete(groupId)) return;
|
|
23713
|
+
this.knockingSince.set(groupId, now);
|
|
23714
|
+
this.lastKnock.delete(groupId);
|
|
23715
|
+
this.knocked.delete(groupId);
|
|
23716
|
+
this.knockRead.delete(groupId);
|
|
23717
|
+
await this.reopenEntry(group.joining);
|
|
23718
|
+
this.host.emit();
|
|
23719
|
+
this.knock(group, now).catch(() => {});
|
|
23720
|
+
}
|
|
23721
|
+
/** The joiner's side of the link's entry session, opened again where it is gone (the same key, so the same session). */
|
|
23722
|
+
async reopenEntry(joining) {
|
|
23723
|
+
if ([...this.host.entries(joining.g).values()].includes(joining.linkId)) return;
|
|
23724
|
+
await this.host.openEntry({
|
|
23725
|
+
g: joining.g,
|
|
23726
|
+
host: joining.host
|
|
23727
|
+
}, "guest", joining.seedB64, joining.host);
|
|
23728
|
+
}
|
|
23672
23729
|
/** The check is over (answered, or nobody was at the door): the group stays as it is here. */
|
|
23673
23730
|
async endCheck(group) {
|
|
23674
23731
|
const joining = group.joining;
|
|
@@ -23853,6 +23910,8 @@ var Communities = class {
|
|
|
23853
23910
|
dropMarks(this.marks, groupId);
|
|
23854
23911
|
this.knockingWith.delete(groupId);
|
|
23855
23912
|
this.knockRead.delete(groupId);
|
|
23913
|
+
this.knockingSince.delete(groupId);
|
|
23914
|
+
this.gaveUp.delete(groupId);
|
|
23856
23915
|
this.lineOrder.forget(MESSAGE_LINK$1(groupId));
|
|
23857
23916
|
for (const linkId of [...this.host.edges(groupId).values(), ...this.host.entries(groupId).values()]) await this.host.closeEdge(linkId);
|
|
23858
23917
|
await this.store.deleteGroup(groupId);
|
|
@@ -23876,9 +23935,20 @@ var Communities = class {
|
|
|
23876
23935
|
};
|
|
23877
23936
|
for (const group of [...this.stored.values()]) {
|
|
23878
23937
|
const live = this.live.get(group.id);
|
|
23879
|
-
if (group.joining && (this.knocking(group, live) || group.joining.check)) {
|
|
23938
|
+
if (group.joining && (this.knocking(group, live) || group.joining.check) && !this.gaveUp.has(group.id)) {
|
|
23880
23939
|
const knocking = this.knocking(group, live), waited = now - group.joining.since;
|
|
23881
23940
|
const answered = this.host.linkReady(group.joining.linkId, 2) || !!this.host.linkSeen?.(group.joining.linkId);
|
|
23941
|
+
const since = this.knockingSince.get(group.id);
|
|
23942
|
+
if (since === void 0 || answered) this.knockingSince.set(group.id, now);
|
|
23943
|
+
if (since === void 0) await this.reopenEntry(group.joining).catch(() => {});
|
|
23944
|
+
else if (knocking && !answered && now - since > 36e5) {
|
|
23945
|
+
this.gaveUp.add(group.id);
|
|
23946
|
+
countWaitingJoin(this.host, group.id, now, false);
|
|
23947
|
+
traceJoin(group.id, "join.unanswered");
|
|
23948
|
+
await this.host.closeEdge(group.joining.linkId).catch(() => {});
|
|
23949
|
+
this.host.emit();
|
|
23950
|
+
continue;
|
|
23951
|
+
}
|
|
23882
23952
|
const every = joinKnockWait(waited, this.timings, countWaitingJoin(this.host, group.id, now, knocking && !answered && waited > this.timings.patienceMs));
|
|
23883
23953
|
if (!knocking && waited > CHECK_MS) await this.endCheck(group);
|
|
23884
23954
|
else if (!answered && now - (this.lastKnock.get(group.id) ?? 0) >= (this.knocked.has(group.id) ? every : Math.min(every, 3e3))) await this.knock(group, now).catch(() => {});
|
|
@@ -24005,7 +24075,7 @@ var Communities = class {
|
|
|
24005
24075
|
if (s.state.pendingLeaves.some((r) => r.s !== me && this.recentHub(live, r.s))) live.lobbyBusyUntil = Math.max(live.lobbyBusyUntil, now + this.timings.lobbyBusyMs);
|
|
24006
24076
|
if (this.hubDropped(groupId, live, others, now)) live.lobbyBusyUntil = Math.max(live.lobbyBusyUntil, now + this.timings.lobbyBusyMs);
|
|
24007
24077
|
const lobbyEvery = (now < live.lobbyBusyUntil || now < (live.memberBackUntil ?? 0)) && !busy ? this.timings.lobbyPollMs : this.timings.lobbyIdlePollMs;
|
|
24008
|
-
if (now - live.lastLobbyPoll >= lobbyEvery) {
|
|
24078
|
+
if (now - live.lastLobbyPoll >= lobbyEvery || !busy && now >= (live.lobbyHeldUntil ?? Infinity)) {
|
|
24009
24079
|
live.lastLobbyPoll = now;
|
|
24010
24080
|
await this.pollLobby(groupId, live, now);
|
|
24011
24081
|
}
|
|
@@ -24069,7 +24139,9 @@ var Communities = class {
|
|
|
24069
24139
|
const check = live.lobbyChecks?.get(hub);
|
|
24070
24140
|
if (check && now >= check.at) {
|
|
24071
24141
|
live.lobbyChecks.delete(hub);
|
|
24072
|
-
|
|
24142
|
+
const lost = await this.lobbyLost(groupId, live, hub, check.ts);
|
|
24143
|
+
if (lost === "room") live.lobbyWrites.delete(hub);
|
|
24144
|
+
else if (lost === "full") live.lobbyWrites.set(hub, now - this.timings.lobbyWriteMs + this.timings.lobbyPollMs + Math.floor(this.random() * LOBBY_CHECK_JITTER_MS));
|
|
24073
24145
|
}
|
|
24074
24146
|
if (now - (live.lobbyWrites.get(hub) ?? 0) >= this.timings.lobbyWriteMs) {
|
|
24075
24147
|
live.lobbyWrites.set(hub, now);
|
|
@@ -24402,23 +24474,28 @@ var Communities = class {
|
|
|
24402
24474
|
traceJoin(groupId, "lobby.written");
|
|
24403
24475
|
}
|
|
24404
24476
|
/**
|
|
24405
|
-
* My request is not in the hub's lobby any more
|
|
24406
|
-
* reading from before mine, dropped it (
|
|
24407
|
-
*
|
|
24477
|
+
* My request is not in the hub's lobby any more (`LOBBY_CHECK_MS`). With room for it ("room"): another member's write,
|
|
24478
|
+
* made from a reading from before mine, dropped it. Full ("full"): the newer requests pushed it out, and asking again
|
|
24479
|
+
* at once would push out one of them before the hub read it, so it waits for the hub's next reading. Many members a
|
|
24480
|
+
* closed hub carried ask the hub left in the same second; with 6 places, the rest waited for the 20 s refresh while the
|
|
24481
|
+
* lobby held requests the hub had already taken, and were cut off for up to 115 s (CLI daemons, 2026-10-19). A read
|
|
24482
|
+
* that fails says nothing, and the usual refresh asks again.
|
|
24408
24483
|
*/
|
|
24409
24484
|
async lobbyLost(groupId, live, hub, ts) {
|
|
24410
24485
|
const keys = lobbyKeys(live.session.state.rv, groupId, hub);
|
|
24411
24486
|
const records = await this.host.resolve(keys.identity.pubKeyZ32, true, true).catch(() => void 0);
|
|
24412
24487
|
if (records === void 0) return false;
|
|
24413
24488
|
const entries = readLobby(keys, records ?? []);
|
|
24414
|
-
|
|
24415
|
-
|
|
24416
|
-
return
|
|
24489
|
+
if (entries.some((e) => e.key === live.session.myKey && e.ts >= ts)) return false;
|
|
24490
|
+
traceJoin(groupId, "lobby.lost");
|
|
24491
|
+
return entries.length < COMMUNITY_TOPOLOGY.lobbyEntries ? "room" : "full";
|
|
24417
24492
|
}
|
|
24418
24493
|
async pollLobby(groupId, live, now) {
|
|
24419
24494
|
const keys = lobbyKeys(live.session.state.rv, groupId, live.session.myKey);
|
|
24420
24495
|
const back = this.wayBack(groupId, live);
|
|
24421
24496
|
const entries = readLobby(keys, await this.host.resolve(keys.identity.pubKeyZ32, !back, !back && this.doorBusy(groupId, live, now), back).catch(() => null) ?? []);
|
|
24497
|
+
const held = this.host.readHeldBackFor?.(keys.identity.pubKeyZ32);
|
|
24498
|
+
live.lobbyHeldUntil = held !== void 0 && held > 0 ? now + held : void 0;
|
|
24422
24499
|
for (const { key, ts } of entries) {
|
|
24423
24500
|
if (now - ts > COMMUNITY_TOPOLOGY.lobbyFreshMs || key === live.session.myKey) continue;
|
|
24424
24501
|
if (live.session.wasRemoved(key)) {
|
|
@@ -24868,6 +24945,7 @@ var Communities = class {
|
|
|
24868
24945
|
this.knocked.delete(g);
|
|
24869
24946
|
this.knockAt.delete(g);
|
|
24870
24947
|
this.knockingWith.delete(g);
|
|
24948
|
+
this.knockingSince.delete(g);
|
|
24871
24949
|
this.knockRead.delete(g);
|
|
24872
24950
|
await this.host.closeEdge(linkId);
|
|
24873
24951
|
await this.reconcile(g, live, now);
|
|
@@ -26479,6 +26557,9 @@ var Groups = class {
|
|
|
26479
26557
|
/** Joiner side: when a knock just written is read back (`KNOCK_VERIFY_MS`); none once it was found there. */
|
|
26480
26558
|
knockCheckAt = /* @__PURE__ */ new Map();
|
|
26481
26559
|
/** Joiner side: knocks written in a row without one found in the record since (`KNOCK_VERIFIES`). */
|
|
26560
|
+
/** Joiner side: since when this run knocks with nobody answering (`JOIN_GIVE_UP_MS`), and the joins it gave up. */
|
|
26561
|
+
knockingSince = /* @__PURE__ */ new Map();
|
|
26562
|
+
gaveUp = /* @__PURE__ */ new Set();
|
|
26482
26563
|
knockRewrites = /* @__PURE__ */ new Map();
|
|
26483
26564
|
/** Per group, members met over their admission a moment ago: their edge is opened expecting them. */
|
|
26484
26565
|
justMet = /* @__PURE__ */ new Map();
|
|
@@ -26720,7 +26801,8 @@ var Groups = class {
|
|
|
26720
26801
|
...invitation.takenBack ? { takenBack: true } : {},
|
|
26721
26802
|
...invitation.entry ? {
|
|
26722
26803
|
viaLink: true,
|
|
26723
|
-
stage: this.joinStage(group)
|
|
26804
|
+
stage: this.joinStage(group),
|
|
26805
|
+
...this.gaveUp.has(group.id) && { unanswered: true }
|
|
26724
26806
|
} : {}
|
|
26725
26807
|
}
|
|
26726
26808
|
};
|
|
@@ -26898,8 +26980,10 @@ var Groups = class {
|
|
|
26898
26980
|
this.host.emit();
|
|
26899
26981
|
}
|
|
26900
26982
|
async accept(groupId) {
|
|
26983
|
+
if (this.isCommunity(groupId)) return this.communities.knockAgain(groupId);
|
|
26901
26984
|
const group = this.stored.get(groupId);
|
|
26902
26985
|
if (!group?.invitation) throw new Error("No invitation to accept");
|
|
26986
|
+
if (group.invitation.entry && !group.state) return this.knockAgain(group);
|
|
26903
26987
|
if (group.invitation.takenBack) throw new Error("This invitation was taken back");
|
|
26904
26988
|
if (!this.host.linkReady(group.invitation.linkId)) throw new Error("The contact who invited you is not connected. Try again when they are.");
|
|
26905
26989
|
const seedB64 = group.invitation.seedB64 ?? createIdentity().seedB64;
|
|
@@ -27413,6 +27497,8 @@ var Groups = class {
|
|
|
27413
27497
|
this.knocked.delete(groupId);
|
|
27414
27498
|
this.knockCheckAt.delete(groupId);
|
|
27415
27499
|
this.knockRewrites.delete(groupId);
|
|
27500
|
+
this.knockingSince.delete(groupId);
|
|
27501
|
+
this.gaveUp.delete(groupId);
|
|
27416
27502
|
this.justMet.delete(groupId);
|
|
27417
27503
|
this.welcomed.delete(groupId);
|
|
27418
27504
|
this.lingering.delete(groupId);
|
|
@@ -27500,7 +27586,11 @@ var Groups = class {
|
|
|
27500
27586
|
if (!link) throw new Error("This is not a link to a group");
|
|
27501
27587
|
if (this.isCommunity(link.g)) throw new Error("This group is joined with its current link");
|
|
27502
27588
|
const existing = this.stored.get(link.g);
|
|
27503
|
-
if (existing?.state?.status === "active"
|
|
27589
|
+
if (existing?.state?.status === "active") return link.g;
|
|
27590
|
+
if (existing?.invitation?.entry === link.host) {
|
|
27591
|
+
if (!existing.state) await this.knockAgain(existing);
|
|
27592
|
+
return link.g;
|
|
27593
|
+
}
|
|
27504
27594
|
if (existing?.invitation?.seedB64 && !existing.invitation.entry) throw new Error("You are already joining this group");
|
|
27505
27595
|
if (existing?.invitation && !existing.invitation.entry) throw new Error("You have an invitation to this group. Answer it first.");
|
|
27506
27596
|
if (existing?.state && !existing.left) throw new Error("You are out of this group and its history is still here. Delete it from this device to join with a link.");
|
|
@@ -27550,7 +27640,15 @@ var Groups = class {
|
|
|
27550
27640
|
continue;
|
|
27551
27641
|
}
|
|
27552
27642
|
if (group.invitation?.entry && !group.state) {
|
|
27643
|
+
if (this.gaveUp.has(group.id)) continue;
|
|
27553
27644
|
const answered = this.host.linkReady(group.invitation.linkId) || !!this.host.linkSeen?.(group.invitation.linkId);
|
|
27645
|
+
const since = this.knockingSince.get(group.id);
|
|
27646
|
+
if (since === void 0 || answered) this.knockingSince.set(group.id, now);
|
|
27647
|
+
if (since === void 0) await this.reopenEntry(group).catch(() => {});
|
|
27648
|
+
else if (!answered && now - since > 36e5) {
|
|
27649
|
+
await this.giveUpJoin(group, now);
|
|
27650
|
+
continue;
|
|
27651
|
+
}
|
|
27554
27652
|
const waited = now - group.createdAt, joins = countWaitingJoin(this.host, group.id, now, !answered && waited > this.timings.patienceMs);
|
|
27555
27653
|
const every = joinKnockWait(waited, this.timings, joins);
|
|
27556
27654
|
if (!answered && (now - (this.lastKnock.get(group.id) ?? 0) >= every || now >= (this.knockCheckAt.get(group.id) ?? Infinity))) await this.knock(group, now).catch(() => {});
|
|
@@ -27771,6 +27869,34 @@ var Groups = class {
|
|
|
27771
27869
|
await this.host.closeEdge(linkId);
|
|
27772
27870
|
}
|
|
27773
27871
|
}
|
|
27872
|
+
/** Nobody answered the link for `JOIN_GIVE_UP_MS`: the knocks stop, and the entry session with them, until Try again. */
|
|
27873
|
+
async giveUpJoin(group, now) {
|
|
27874
|
+
this.gaveUp.add(group.id);
|
|
27875
|
+
countWaitingJoin(this.host, group.id, now, false);
|
|
27876
|
+
traceJoin(group.id, "join.unanswered");
|
|
27877
|
+
await this.host.closeEdge(group.invitation.linkId).catch(() => {});
|
|
27878
|
+
this.host.emit();
|
|
27879
|
+
}
|
|
27880
|
+
/** A link join given up (`giveUpJoin`) knocks again, as when the link was opened: Try again. */
|
|
27881
|
+
async knockAgain(group, now = this.now()) {
|
|
27882
|
+
if (!this.gaveUp.delete(group.id)) return;
|
|
27883
|
+
this.knockingSince.set(group.id, now);
|
|
27884
|
+
this.lastKnock.delete(group.id);
|
|
27885
|
+
this.knocked.delete(group.id);
|
|
27886
|
+
this.knockRewrites.delete(group.id);
|
|
27887
|
+
await this.reopenEntry(group);
|
|
27888
|
+
this.host.emit();
|
|
27889
|
+
this.knock(group, now).catch(() => {});
|
|
27890
|
+
}
|
|
27891
|
+
/** The joiner's side of the link's entry session, opened again where it is gone (the same key, so the same session). */
|
|
27892
|
+
async reopenEntry(group) {
|
|
27893
|
+
const invitation = group.invitation;
|
|
27894
|
+
if ([...this.host.entries(group.id).values()].includes(invitation.linkId)) return;
|
|
27895
|
+
await this.host.openEntry({
|
|
27896
|
+
g: group.id,
|
|
27897
|
+
host: invitation.entry
|
|
27898
|
+
}, "guest", invitation.seedB64, invitation.entry);
|
|
27899
|
+
}
|
|
27774
27900
|
async knock(group, now = Date.now()) {
|
|
27775
27901
|
const invitation = group.invitation;
|
|
27776
27902
|
this.lastKnock.set(group.id, now);
|
|
@@ -28079,6 +28205,7 @@ var Groups = class {
|
|
|
28079
28205
|
if (viaLink) {
|
|
28080
28206
|
this.lastKnock.delete(g);
|
|
28081
28207
|
this.knocked.delete(g);
|
|
28208
|
+
this.knockingSince.delete(g);
|
|
28082
28209
|
if (this.host.linkReady(linkId, 5)) this.signals.keep(g, linkId);
|
|
28083
28210
|
}
|
|
28084
28211
|
this.reconcileEdges(g);
|
|
@@ -34629,6 +34756,7 @@ var PaymentDesk = class {
|
|
|
34629
34756
|
if (now - (this.lastAskFrom.get(linkId) ?? 0) < 3e3) return;
|
|
34630
34757
|
this.lastAskFrom.set(linkId, now);
|
|
34631
34758
|
if ([...this.payments.values()].filter((p) => p.linkId === linkId && p.kind === "request" && p.direction === "out" && p.state === "pending" && p.ask).length >= 5 || !/^[1-9]\d{0,15}$/.test(ask.amount.value)) return;
|
|
34759
|
+
if (ask.method === "bitcoin" && [...this.payments.values()].filter((p) => p.kind === "request" && p.direction === "out" && p.ask && p.target?.method === "bitcoin" && now - p.createdAt < 36e5).length >= 10) return;
|
|
34632
34760
|
if (ask.amount.asset !== (ask.method === "usdt" ? "usdtbase" : UNIT)) return;
|
|
34633
34761
|
if (!allows(link, ask.method)) return;
|
|
34634
34762
|
if (!this.accepts(linkId, ask.method, ask.network ?? this.defaultNetwork())) return;
|
|
@@ -37222,6 +37350,13 @@ var GhostlyNode = class GhostlyNode {
|
|
|
37222
37350
|
cardEdits = new CardEditPacer();
|
|
37223
37351
|
/** When each message's buttons were last pressed here (`pressButton`). */
|
|
37224
37352
|
pressedAt = /* @__PURE__ */ new Map();
|
|
37353
|
+
/**
|
|
37354
|
+
* The presses taken on each message of mine with a `once` button (`resolveReply`), by chat and message id: each
|
|
37355
|
+
* member's replies that pressed it and the button. Read from the history once, at the message's first press here,
|
|
37356
|
+
* then added to as presses are taken (only `resolveReply` gives a row its press). Rows it names are read again
|
|
37357
|
+
* before they refuse a press: one deleted since answers nothing.
|
|
37358
|
+
*/
|
|
37359
|
+
cardPresses = /* @__PURE__ */ new Map();
|
|
37225
37360
|
/** At most one wake-up per contact per `WAKE_INTERVAL_MS` (WISP 401 § Wake-up push). */
|
|
37226
37361
|
wakeLimiter = new WakeLimiter();
|
|
37227
37362
|
/** Call wake-ups have their own, shorter limit: a call is rarer than a message and cannot wait five minutes. */
|
|
@@ -37971,14 +38106,25 @@ var GhostlyNode = class GhostlyNode {
|
|
|
37971
38106
|
for (const pc of this.chatPeers) if (pc.connectionState === "closed") this.chatPeers.delete(pc);
|
|
37972
38107
|
return this.chatPeers.size;
|
|
37973
38108
|
}
|
|
38109
|
+
/**
|
|
38110
|
+
* The rows of a 1:1 chat a wire id may name besides `peer_`/`me_` and that id: a file of mine is `me_<its time>` and a
|
|
38111
|
+
* payment `me_` or `peer_` and its time, as `fileMessage` and `paymentMessage` read them. What a reaction, a reply or a
|
|
38112
|
+
* pin names is read so, alone, before a chat is read whole.
|
|
38113
|
+
*/
|
|
38114
|
+
async rowsNamed(chat, id) {
|
|
38115
|
+
const file = await fileStore.get(GhostlyNode.outgoingFileId(chat, id)).catch(() => void 0);
|
|
38116
|
+
const payment = this.desk.payment(paymentAlias(id, chat)) ?? this.desk.payment(id);
|
|
38117
|
+
return [...file?.linkId === chat && file.metadata ? [`me_${file.metadata.timestamp}`] : [], ...payment?.linkId === chat ? [`me_${payment.createdAt}`, `peer_${payment.createdAt}`] : []];
|
|
38118
|
+
}
|
|
38119
|
+
pinsHost = {
|
|
38120
|
+
messages: (chat) => db.getMessages(chat),
|
|
38121
|
+
message: (chat, id) => db.getMessage(chat, id),
|
|
38122
|
+
rows: (chat, id) => this.rowsNamed(chat, id)
|
|
38123
|
+
};
|
|
37974
38124
|
reactions = new Reactions({
|
|
37975
38125
|
messages: (chat) => db.getMessages(chat),
|
|
37976
38126
|
message: (chat, id) => db.getMessage(chat, id),
|
|
37977
|
-
rows:
|
|
37978
|
-
const file = await fileStore.get(GhostlyNode.outgoingFileId(chat, id)).catch(() => void 0);
|
|
37979
|
-
const payment = this.desk.payment(paymentAlias(id, chat)) ?? this.desk.payment(id);
|
|
37980
|
-
return [...file?.linkId === chat && file.metadata ? [`me_${file.metadata.timestamp}`] : [], ...payment?.linkId === chat ? [`me_${payment.createdAt}`, `peer_${payment.createdAt}`] : []];
|
|
37981
|
-
},
|
|
38127
|
+
rows: (chat, id) => this.rowsNamed(chat, id),
|
|
37982
38128
|
patch: (chat, id, change) => db.patchMessage(chat, id, change),
|
|
37983
38129
|
changed: async (chat, id, note) => {
|
|
37984
38130
|
const shown = this.reactionNotes.get(chat);
|
|
@@ -40371,14 +40517,18 @@ var GhostlyNode = class GhostlyNode {
|
|
|
40371
40517
|
* The message of a chat a reply answers, by its id here or the id both sides know it by (`replyRef`): what the
|
|
40372
40518
|
* reply keeps of it, or why there is nothing to reply to. A group's reply needs the author's member key too.
|
|
40373
40519
|
* Read alone by its id, or a chat's `peer_`/`me_` row for a wire id, as `resolveReply` does: a group's message goes
|
|
40374
|
-
* by its row's id, so a miss there is not here; a chat's
|
|
40375
|
-
* whole chat.
|
|
40520
|
+
* by its row's id, so a miss there is not here; a chat's file of mine or payment is read alone by its time
|
|
40521
|
+
* (`rowsNamed`), and any other row is looked for in the whole chat.
|
|
40376
40522
|
*/
|
|
40377
40523
|
async replyFor(linkId, messageId) {
|
|
40378
40524
|
if (typeof messageId !== "string" || !messageId) return "No message to reply to";
|
|
40379
40525
|
const group = linkId.startsWith("group:");
|
|
40380
40526
|
let original = await db.getMessage(linkId, messageId);
|
|
40381
|
-
for (const rowId of group ? [] : [
|
|
40527
|
+
for (const rowId of group || original ? [] : [
|
|
40528
|
+
`peer_${messageId}`,
|
|
40529
|
+
`me_${messageId}`,
|
|
40530
|
+
...await this.rowsNamed(linkId, messageId)
|
|
40531
|
+
]) {
|
|
40382
40532
|
if (original) break;
|
|
40383
40533
|
const row = await db.getMessage(linkId, rowId);
|
|
40384
40534
|
if (row && replyRef(row) === messageId) original = row;
|
|
@@ -40394,14 +40544,19 @@ var GhostlyNode = class GhostlyNode {
|
|
|
40394
40544
|
* here gives the line and the author (and it is then checked); one not found keeps what the wire said, unchecked.
|
|
40395
40545
|
* The original is read alone where its id says its row (a group's message id, a chat's `peer_`/`me_` text): a reply
|
|
40396
40546
|
* costs what a plain message does, however long the chat. A group's row goes by its own id only, so a miss there is
|
|
40397
|
-
* not here; a chat's
|
|
40547
|
+
* not here; a chat's file of mine or payment is read alone by its time (`rowsNamed`), and any other row is looked
|
|
40548
|
+
* for in the whole chat.
|
|
40398
40549
|
*/
|
|
40399
40550
|
async resolveReply(message) {
|
|
40400
40551
|
const reply = message.replyTo;
|
|
40401
40552
|
if (!reply || reply.messageId) return message;
|
|
40402
40553
|
const group = message.linkId.startsWith("group:");
|
|
40403
40554
|
let original, history;
|
|
40404
|
-
for (const rowId of group ? [reply.id] : [
|
|
40555
|
+
for (const rowId of group ? [reply.id] : [
|
|
40556
|
+
`peer_${reply.id}`,
|
|
40557
|
+
`me_${reply.id}`,
|
|
40558
|
+
...await this.rowsNamed(message.linkId, reply.id)
|
|
40559
|
+
]) {
|
|
40405
40560
|
const row = rowId === message.id ? void 0 : await db.getMessage(message.linkId, rowId);
|
|
40406
40561
|
if (row && replyRef(row, group) === reply.id) {
|
|
40407
40562
|
original = row;
|
|
@@ -40422,12 +40577,42 @@ var GhostlyNode = class GhostlyNode {
|
|
|
40422
40577
|
}
|
|
40423
40578
|
};
|
|
40424
40579
|
const pressed = buttonPress(resolved, original, []);
|
|
40425
|
-
const press = pressed && messageButtons(original)?.buttons.some((b) => b.once) ?
|
|
40580
|
+
const press = pressed && messageButtons(original)?.buttons.some((b) => b.once) ? await this.oncePress(resolved, original, history) : pressed;
|
|
40426
40581
|
return press ? {
|
|
40427
40582
|
...resolved,
|
|
40428
40583
|
press
|
|
40429
40584
|
} : resolved;
|
|
40430
40585
|
}
|
|
40586
|
+
/**
|
|
40587
|
+
* A press on a message of mine with a `once` button: refused when this member's earlier press of it with a `once`
|
|
40588
|
+
* button is still here. The history is read at the message's first press only (`cardPresses`); after that, a press
|
|
40589
|
+
* reads that member's earlier presses of it alone, and none when there are none. 255 presses handed back at once
|
|
40590
|
+
* in a 10k-message group read the history 255 times, 15.7 s on the CLI's store, before.
|
|
40591
|
+
*/
|
|
40592
|
+
async oncePress(reply, original, history) {
|
|
40593
|
+
const key = `${reply.linkId}\n${original.id}`;
|
|
40594
|
+
let presses = this.cardPresses.get(key);
|
|
40595
|
+
if (!presses) {
|
|
40596
|
+
const read = /* @__PURE__ */ new Map();
|
|
40597
|
+
for (const row of history ?? await db.getMessages(reply.linkId)) {
|
|
40598
|
+
if (row.sender !== "peer" || row.press?.messageId !== original.id) continue;
|
|
40599
|
+
read.set(row.member ?? "", [...read.get(row.member ?? "") ?? [], {
|
|
40600
|
+
id: row.id,
|
|
40601
|
+
button: row.press.button
|
|
40602
|
+
}]);
|
|
40603
|
+
}
|
|
40604
|
+
presses = this.cardPresses.get(key) ?? read;
|
|
40605
|
+
this.cardPresses.set(key, presses);
|
|
40606
|
+
}
|
|
40607
|
+
const member = reply.member ?? "", card = messageButtons(original);
|
|
40608
|
+
const earlier = (presses.get(member) ?? []).filter((p) => p.id !== reply.id && card?.buttons.find((b) => b.id === p.button)?.once).map((p) => p.id);
|
|
40609
|
+
const press = buttonPress(reply, original, (await db.getMessagesById(reply.linkId, earlier)).filter((row) => !!row));
|
|
40610
|
+
if (press) presses.set(member, [...(presses.get(member) ?? []).filter((p) => p.id !== reply.id), {
|
|
40611
|
+
id: reply.id,
|
|
40612
|
+
button: press.button
|
|
40613
|
+
}]);
|
|
40614
|
+
return press;
|
|
40615
|
+
}
|
|
40431
40616
|
/** A paired row's reply as it goes on the wire again (a resend, a hold). */
|
|
40432
40617
|
/** `localStorage["ghostly-test-no-edit"]`: this app offers no edit/1, as an older one (the e2e's old contact). Nothing else reads it. */
|
|
40433
40618
|
static testNoEdit() {
|
|
@@ -42542,10 +42727,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
42542
42727
|
*/
|
|
42543
42728
|
async pinMessage({ linkId, messageId, remove }) {
|
|
42544
42729
|
if (typeof linkId !== "string" || !linkId) return { error: "No chat to pin in" };
|
|
42545
|
-
const host =
|
|
42546
|
-
messages: (chat) => db.getMessages(chat),
|
|
42547
|
-
message: (chat, id) => db.getMessage(chat, id)
|
|
42548
|
-
};
|
|
42730
|
+
const host = this.pinsHost;
|
|
42549
42731
|
if (linkId.startsWith("group:")) {
|
|
42550
42732
|
const groupId = linkId.slice(6), view = this.groups.view(groupId);
|
|
42551
42733
|
if (!view || view.status !== "active") return { error: "You are not in this group" };
|
|
@@ -42781,10 +42963,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
42781
42963
|
}
|
|
42782
42964
|
/** A pin that came, as it is kept: who pinned, and its row when it is here. */
|
|
42783
42965
|
async pinCame(chat, by, pin) {
|
|
42784
|
-
const row = await pinnedRow(
|
|
42785
|
-
messages: (c) => db.getMessages(c),
|
|
42786
|
-
message: (c, id) => db.getMessage(c, id)
|
|
42787
|
-
}, chat, pin.id);
|
|
42966
|
+
const row = await pinnedRow(this.pinsHost, chat, pin.id);
|
|
42788
42967
|
return {
|
|
42789
42968
|
id: pin.id,
|
|
42790
42969
|
n: pin.n,
|
|
@@ -45407,6 +45586,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45407
45586
|
throw error;
|
|
45408
45587
|
}
|
|
45409
45588
|
if (!previous.pairedPeerKey) {
|
|
45589
|
+
if (!live.stored.group) live.pairedAt = Date.now();
|
|
45410
45590
|
if (!live.stored.group && live.stored.deliveryMode !== "dht") this.ensureNativeEndpoints(stored.id);
|
|
45411
45591
|
live.caps?.update().catch(() => {});
|
|
45412
45592
|
live.caps?.refresh(true);
|
|
@@ -45578,6 +45758,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45578
45758
|
const was = live.dataLink;
|
|
45579
45759
|
live.dataLink = state;
|
|
45580
45760
|
if (state === "open") {
|
|
45761
|
+
live.pairedAt = void 0;
|
|
45581
45762
|
this.wakeLimiter.reset(linkId);
|
|
45582
45763
|
this.desk.replay(linkId).catch(() => {}).then(() => this.sendWaiting(linkId)).catch(() => {});
|
|
45583
45764
|
this.identities.ready(linkId);
|
|
@@ -45824,7 +46005,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45824
46005
|
get nativeFactories() {
|
|
45825
46006
|
const relay = this.relaysHyperdht ? this.hyperdhtRelay : "";
|
|
45826
46007
|
return {
|
|
45827
|
-
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-
|
|
46008
|
+
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-BcrwJRtb.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
|
|
45828
46009
|
...this.options.nativeTransports,
|
|
45829
46010
|
...this.ownIrohRelays ? { "iroh/1": (seedB64) => this.options.nativeTransports["iroh/1"](seedB64, this.settings.irohRelays?.length ? { relays: [...this.settings.irohRelays] } : {}) } : {},
|
|
45830
46011
|
...this.options.irohWeb ? { "iroh/1": (seedB64) => createIrohWebEndpoint(seedB64, { relays: this.irohRelays }) } : {}
|
|
@@ -46114,8 +46295,9 @@ var GhostlyNode = class GhostlyNode {
|
|
|
46114
46295
|
const full = owners.length >= slots, entry = !!live.stored.groupEntry;
|
|
46115
46296
|
if (group && (entry || extra(live)) && (full || groups >= this.groupNativeSlots(key) || !entry && !anchorOf(live.stored.group)?.link?.availableTransports.includes(key))) return "no-slot";
|
|
46116
46297
|
if (full || !group && owners.length - groups >= NATIVE_SLOTS) {
|
|
46117
|
-
const
|
|
46118
|
-
const
|
|
46298
|
+
const paired = !group && live.pairedAt !== void 0 && now - live.pairedAt < 6e5 ? live.pairedAt : void 0;
|
|
46299
|
+
const taking = group || this.activeLinkId === linkId || inUse || paired !== void 0;
|
|
46300
|
+
const mine = taking && (inUse || onScreen(live)) ? now : Math.max(paired ?? 0, used(live));
|
|
46119
46301
|
const groupVictim = !full ? void 0 : owners.filter((other) => other !== live && extra(other) && other.link?.canReleaseEndpoint(key)).sort((a, b) => (a.link?.isDataLinkOpen ? 1 : 0) - (b.link?.isDataLinkOpen ? 1 : 0) || used(a) - used(b))[0];
|
|
46120
46302
|
const quiet = (other) => other !== live && (full || !other.stored.group) && !other.stored.groupEntry && !onScreen(other) && now - (other.nativeTakenAt?.[key] ?? 0) >= 12e4 && used(other) <= now - 12e4 && used(other) < mine;
|
|
46121
46303
|
const victim = groupVictim ?? (taking ? owners.filter((other) => quiet(other) && other.link?.canReleaseEndpoint(key)).sort((a, b) => used(a) - used(b))[0] : void 0);
|
|
@@ -46905,4 +47087,4 @@ function signalKind(signal) {
|
|
|
46905
47087
|
//#endregion
|
|
46906
47088
|
export { EngineServer };
|
|
46907
47089
|
|
|
46908
|
-
//# sourceMappingURL=server-
|
|
47090
|
+
//# sourceMappingURL=server-DPzt5V2x.js.map
|