@ghostlytools/cli 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{api-ClHM_G5A.js → api-Dy_05gaq.js} +15 -11
- package/dist/assets/api-Dy_05gaq.js.map +1 -0
- package/dist/assets/{api-C_IHKsrl.js → api-oUpBfryK.js} +2 -2
- package/dist/assets/{apiKit-gS-yfb25.js → apiKit-B-PUYkXH.js} +2 -2
- package/dist/assets/{apiKit-gS-yfb25.js.map → apiKit-B-PUYkXH.js.map} +1 -1
- package/dist/assets/{apps-DyihkNO-.js → apps-C6MBfO-I.js} +1 -1
- package/dist/assets/{apps-DP8pElH-.js → apps-ejb6H1lT.js} +2 -2
- package/dist/assets/{apps-DP8pElH-.js.map → apps-ejb6H1lT.js.map} +1 -1
- package/dist/assets/{arkade-GzJoov-w.js → arkade-DXyOeKEI.js} +2 -2
- package/dist/assets/{arkade-GzJoov-w.js.map → arkade-DXyOeKEI.js.map} +1 -1
- package/dist/assets/{backup-A_C4hYNO.js → backup-Bt6UjCiM.js} +1 -1
- package/dist/assets/{backup-DKDXkaS1.js → backup-DRIIguzE.js} +4 -4
- package/dist/assets/{backup-DKDXkaS1.js.map → backup-DRIIguzE.js.map} +1 -1
- package/dist/assets/buttons-B3bi6p_d.js +2 -0
- package/dist/assets/{buttons-BDw8cqDq.js → buttons-DoccJ_cK.js} +3 -3
- package/dist/assets/{buttons-BDw8cqDq.js.map → buttons-DoccJ_cK.js.map} +1 -1
- package/dist/assets/{envelope-DEvU5FA9.js → envelope-hJ0SfbAh.js} +2 -2
- package/dist/assets/{envelope-DEvU5FA9.js.map → envelope-hJ0SfbAh.js.map} +1 -1
- package/dist/assets/{groupFiles-Cr4Gj9-R.js → groupFiles-BXPINkVJ.js} +18 -4
- package/dist/assets/{groupFiles-Cr4Gj9-R.js.map → groupFiles-BXPINkVJ.js.map} +1 -1
- package/dist/assets/{host-D0MIWyOe.js → host-CzgYwupN.js} +8 -8
- package/dist/assets/{host-D0MIWyOe.js.map → host-CzgYwupN.js.map} +1 -1
- package/dist/assets/{hyperdhtRelay-SBo4aoMk.js → hyperdhtRelay-CJBqsS_e.js} +2 -2
- package/dist/assets/{hyperdhtRelay-SBo4aoMk.js.map → hyperdhtRelay-CJBqsS_e.js.map} +1 -1
- package/dist/assets/{irohWeb-D2WaYPdN.js → irohWeb-CrGOD-OD.js} +2 -2
- package/dist/assets/{irohWeb-D2WaYPdN.js.map → irohWeb-CrGOD-OD.js.map} +1 -1
- package/dist/assets/{main-DUG0nGLw.js → main-BDOIJ_ls.js} +14 -14
- package/dist/assets/{main-DUG0nGLw.js.map → main-BDOIJ_ls.js.map} +1 -1
- package/dist/assets/{mainline-B8NGRodL.js → mainline-Cw7rnEWM.js} +2 -2
- package/dist/assets/{mainline-B8NGRodL.js.map → mainline-Cw7rnEWM.js.map} +1 -1
- package/dist/assets/{networkReason-BAnNO1Ji.js → networkReason-C0VY94cG.js} +2 -2
- package/dist/assets/{networkReason-BAnNO1Ji.js.map → networkReason-C0VY94cG.js.map} +1 -1
- package/dist/assets/{nwc-DQT3rx-s.js → nwc-lpGWvzYU.js} +3 -3
- package/dist/assets/{nwc-DQT3rx-s.js.map → nwc-lpGWvzYU.js.map} +1 -1
- package/dist/assets/{nwcProvider-Dq647EAl.js → nwcProvider-CAGRn2ly.js} +2 -2
- package/dist/assets/{nwcProvider-Dq647EAl.js.map → nwcProvider-CAGRn2ly.js.map} +1 -1
- package/dist/assets/{registry-DFiOxH5q.js → registry-D2bK-k1T.js} +1 -1
- package/dist/assets/{registry-ieI8INKT.js → registry-DWkkBN57.js} +3 -3
- package/dist/assets/{registry-ieI8INKT.js.map → registry-DWkkBN57.js.map} +1 -1
- package/dist/assets/{resolve-C39pc4Kf.js → resolve-CvYK0Lbt.js} +2 -2
- package/dist/assets/{resolve-C39pc4Kf.js.map → resolve-CvYK0Lbt.js.map} +1 -1
- package/dist/assets/{server-DIICuvgy.js → server-BktMmp7L.js} +344 -196
- package/dist/assets/{server-DIICuvgy.js.map → server-BktMmp7L.js.map} +1 -1
- package/dist/assets/{src-CwMTZ5Hj.js → src-Bpy99Z2K.js} +72 -9
- package/dist/assets/src-Bpy99Z2K.js.map +1 -0
- package/dist/assets/{usdt-CxSyuXq4.js → usdt-DFusiw8x.js} +3 -3
- package/dist/assets/{usdt-CxSyuXq4.js.map → usdt-DFusiw8x.js.map} +1 -1
- package/dist/assets/{words-31VaDW5h.js → words-Z-izzDBN.js} +2 -2
- package/dist/assets/{words-31VaDW5h.js.map → words-Z-izzDBN.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-ClHM_G5A.js.map +0 -1
- package/dist/assets/buttons-CNkxiN2c.js +0 -2
- package/dist/assets/src-CwMTZ5Hj.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as traceJoin } from "./joinTrace-CjRDFy85.js";
|
|
2
|
-
import { $a as
|
|
2
|
+
import { $a as sameButtonText, $c as deviceInviteJoinerParams, $o as HANDOFF_TIMINGS, $r as isServeId, $s as inboxRecord, A as knockRecords, Aa as queueReaction, Ac as readAppBundleAsync, Ai as CapsExchange, Al as signTurnRelease, An as findEndpoint, Ar as transferStalled, B as GROUP_READ_NOTE, Bc as readAppRevocation, Bi as emptyIdentityLedger, Bn as engineError, Bo as emptyLinkRecords, Br as pinIsNewer, C as decodeCommunityLink, Ca as forwardedAgain, Cc as appDigest, Cl as turnPutSummary, Co as GhostlyHttpError, Cr as readBeacon, Cs as readHandoffDone, D as encodeGroupEntryLink, Da as REACTION_LIMITS, Dc as isAppUrl, Dl as nextTurnPosition, Dn as ENDPOINT, Do as LIMITS, Dr as ChatFiles, Ds as readHandoffTurnFrame, E as decodeGroupEntryLink, Ea as GROUP_REACTION_FRAME, El as firstDeviceSetSecret, En as decodeBolt11, Eo as webLocalFetch, Er as shouldBeHub, Es as readHandoffPake, F as groupWakeFrame, Fa as wireReaction, Fc as appRef, Fl as turnVerifierMark, Fn as INVITE_TAKEN, Fr as typingActivity, Fs as signTombstone, G as GROUP_EDIT_TEXT_BYTES, Gi as revokesIdentity, Gl as budgetRetryMs, Go as HANDOFF_CANCEL, Gr as deviceWakeRequest, Gs as enrollGrantFrame, Gt as encodeDidDhtPacket, H as frameBytes, Hi as identityStatement, Hl as normalizeRelayUrl, Hn as parseEngineError, Ho as LEGACY_SERVICES, Hr as readPin, Hs as enrollCancelReason, Ht as didDhtDocument, I as groupWakes, Ia as pairedReplyAuthor, Ii as IDENTITY_REVOCATION_LABEL, Il as DEFAULT_RELAYS, In as LIVENESS_PING_MS, Io as contactRtcConfig, Is as verifySetUpdate, J as mentionsMember, Jc as readCanonicalJson, Ji as emptyProofLedger, Jl as PacketTooLargeError, Jn as groupFileFallback, Jo as HANDOFF_HELLO, Jr as relayRequest, Js as readEnrollGrant, Jt as ETHEREUM_USDT, K as carryMentions, Ka as STATUS_CARD_LIMITS, Kc as canonicalJson, Ki as lastSharedWithMe, Kl as isDiscoveryBudgetError, Ko as HANDOFF_DONE, Kr as newWakeToken, Ks as enrollHelloFrame, L as parseGroupWakeFrame, La as readReply, Lc as isAppHash, Ln as PAIRED_FRAME_TOO_LARGE, Lr as PIN_LIMITS, M as readKnocks, Ma as reactionIsNewer, Mi as capsDescriptors, Ml as turnKeys, Mn as parseCashuRequestPayload, Ms as readSetUpdate, Na as readReaction, Nc as APP_STATEMENT_LIMITS, Ni as dialDescriptors, Nl as turnName, Nn as parseFedimintRequestPayload, Nr as TypingSender, Ns as setAckFrame, O as entryParams, Oa as ReactionWindow, Oc as pacer, Ol as readTurnPacket, On as cashuRequestPayload, Oo as decodeControl, Or as FILE_LIMITS, Os as readHandoffVerified, P as GroupWakeLimiter, Pa as validReactionNumber, Pc as appFingerprint, Pl as turnStatedVerifier, Pn as GhostLink, Ps as setUpdateFrame, Qa as checkStatusCard, Qc as createDeviceInvite, Qo as HANDOFF_REQUEST, Qr as APP_RANGE_LIMITS, Qs as endedRequests, Qt as SEPOLIA_TEST_USDT, R as GROUP_LIMITS, Ra as replySnippet, Rc as isAppKey, Ri as IdentityExchange, Rl as RelayTransport, Rn as pairedMessageFits, Ro as parseCallSignal, Rr as mayPin, S as communityHasFrame, Sa as parseLinkPreview, Sl as classifyTurnRead, So as presenceSeenAt, Sr as rankHubs, Ss as readHandoffCancel, Ta as COMMUNITY_REACTION_FRAME, Tl as TURN_MAX, To as parseLocalTarget, Tr as readLobby, Ts as readHandoffHello, Ui as newIdentityBinding, Un as GROUP_FILE_LIMITS, Uo as serviceIdFromName, Ur as WAKE_CALL_INTERVAL_MS, Us as enrollDigits, Ut as didDhtFromPublicKey, V as GroupSession, Vi as identityRevocationValue, Vl as currentRelays, Vn as engineText, Vo as HTTP_SERVICE_PROTO, Vr as pinNumberHolds, Vs as enrollCancelFrame, Wc as parseImageMeta, Wi as receivedIdentityStatus, Wl as traceLink, Wo as HANDOFF_ACK, Wr as WakeLimiter, Ws as enrollDoneFrame, Wt as encodeDidDhtDeactivated, Xc as encodeContactLink, Xi as TRANSPORTS, Xl as createRelayPayload, Xn as readGroupFileMeta, Xo as HANDOFF_PAKE, Xr as checkPushEndpoint, Xs as verifyEnrollProof, Xt as ONCHAIN_PROVIDER, Y as groupName, Yc as createContactLink, Yi as validExternalKey, Yo as HANDOFF_OFFER, Yr as wakeRequest, Ys as readEnrollHello, Yt as EVM_TEST_CHAINS, Zc as readContactLink, Zi as automaticTransport, Zo as HANDOFF_PIECE_BYTES, Zr as vapidKeysMatch, Zs as clearMissed, Zt as PaymentPreflightError, _ as openGroupTyping, _a as EDIT_RATE_WINDOW_MS, _c as requestRecords, _l as seedSigner, _r as lobbyRecords, _s as handoffRetryAfter, a as appStoreDecision, aa as formatFileSize, ac as ContactRequestError, ai as EDIT_CAPABILITY, al as inviteLink, an as assertWholeSats, ao as shownTime, ar as groupSignalFrame, as as handoffBusyFrame, b as CommunitySession, ba as RateWindow, bc as APP_BUNDLE_MAGIC, bl as TURN_RAISE_READ_TIMEOUT_MS, bo as RELAY_POLL_INTERVALS, br as newerHead, bs as newHandoffId, c as planAppUpdate, cc as knockSlotIdentity, ci as HOLD_CAPABILITY, cl as DEVICES_CAPABILITY, cn as walletNetworkOf, cr as mayBeHub, cs as handoffContextProof, cu as bytesEqual, da as fileMessageText, dc as linkRecords, di as HoldKeys, dl as deviceEchoFrame, dn as sparkAddressKind, do as parseGroupCommit, dr as COMMUNITY_TOPOLOGY, ds as handoffEphemeral, du as randomBytes, ec as newInbox, el as readDeviceInvite, en as TEST_USDT_FAUCET_AMOUNT, eo as statusCardText, er as CarriedTransport, es as HANDOFF_VERIFIED, eu as createIdentity, f as readAppStoreSteps, fa as parseVoiceMeta, fc as makeStampPaced, fi as HoldRefusedError, fl as deviceEchoNonce, fn as sparkInvoiceDetails, fo as rosterAdmin, fr as beaconKeys, fs as handoffHelloFrame, fu as toBase64Url, g as groupTypingEpoch, ga as EDIT_BUFFER_MS, gc as readLinkRecord, gl as newDeviceSetSecret, go as DirectPathWatch, gr as lobbyKeys, gs as handoffReleaseFrame, gt as normalizeAtprotoHandle, h as GroupTypingBoard, ha as parseVideoMeta, hc as readKnockSlot, hi as readManifest, hl as devicePingFrame, hn as isPubkyKey, ho as edgeParams, hr as freshHubs, hs as handoffPakeFrame, ht as isAtprotoDid, hu as utf8Encode, i as appRevocationFor, ia as dhtFileId, ic as turnOff, ii as BUTTONS_CAPABILITY, il as encodeInviteCode, in as assertTokenUnits, io as receivedTimestamp, is as handoffAttemptSucceeded, iu as verify, j as mergeKnocks, ja as reactionEmoji, jc as sha256Paced, ji as DHT_TEXT_CAPABILITY, jl as turnInstance, jn as isFederationId, jo as RTC_CONFIG, k as knockIdentity, ka as nextReactionNumber, kl as signTurnPacket, kn as fedimintRequestPayload, ko as encodeControl, kr as transferEnded, ks as sealHandoffPiece, l as APP_STORE_LIMITS, lc as knockSlotOf, li as HOLD_DATED_BACK_MS, ll as ENROLL_CAPABILITY, ln as SPARK_NETWORKS, lo as MEMBER_KEY, lr as meshHubs, ls as handoffDataFrame, lu as fromBase64Url, mc as openRequest, mi as newMailbox, ml as deviceLinkPairing, mo as verifyCommitSignature, mr as doorHubs, ms as handoffOfferFrame, mu as utf8Decode, n as readX401SdJwtVc, na as peekDhtMailbox, nc as settleRequest, ni as isAppVersion, nl as createChatInvite, nn as WALLET_NETWORKS, no as claimedTime, ns as handoffAttemptAllowed, nu as identityFromSeedB64, o as appUpdateDecision, oa as sanitizeFileName, oc as REQUEST_LIFETIME_MS, oi as STATUS_CARD_CAPABILITY, ol as inviteOwnership, on as formatPaymentAmount, oo as GROUP_ADMIN_OFF_ERROR, or as readGroupSignal, os as handoffCancelFrame, ou as sanitizeAvatar, pc as mergeContactKnocks, pi as isHoldUrl, pl as deviceKeyZ32, pn as isBitcoinAddress, po as rosterHas, pr as beaconRecords, ps as handoffManifestFrames, pu as toZ32, q as parseCommunityEdit, qi as PeerProofs, ql as withRequestOptions, qo as HANDOFF_HAVE, qr as parseWakeFrame, qs as enrollProofFrame, qt as signDidDhtPacket, r as sameX401HolderJwk, ra as DHT_FILE_CAPABILITY, rc as takeRequest, ri as APPS_CAPABILITY, rl as decodeInviteCode, rn as arkAddressPrefix, ro as heardTime, rs as handoffAttemptFailed, ru as publicKeyFromZ32, s as checkAppBeforeRun, sa as sanitizeMime, sc as contactDay, si as UPGRADE_CAPABILITY, sn as validatePaymentTarget, so as GROUP_MEMBER_CAP, sr as MESH_HUBS, ss as handoffContext, su as sanitizeDisplayText, t as newX401HolderKey, ta as DHT_MESSAGE_TTL, tc as planKnocks, ti as chatAppId, tl as OwnInviteError, tn as USDT_PUBLIC_RPC, to as arrivalKey, ts as filePartName, tu as identityFromSeed, uc as knockSlotRecords, ui as HOLD_LIMITS, ul as HANDOFF_CAPABILITY, un as SPARK_PROVIDER, uo as commitHash, ur as pickMeshHubs, us as handoffDigest, v as sealGroupTyping, va as MAX_REMOVAL_NUMBER, vc as seenEntry, vl as webCryptoSigner, vo as DHT_POLL_INTERVALS, vr as mergeBeacon, vs as handoffStreamKey, w as encodeCommunityLink, wa as readForwarded, wc as appViewOf, wl as TURN_LAST_SEQUENCE, wo as formatLocalTarget, wr as readBeaconHead, ws as readHandoffHave, x as GROUP_READ_NOTE_COMMUNITY, xa as dhtEditId, xc as APP_ICON_PATH, xl as TURN_SETTLE_MS, xo as WATCH_PEER_MS, xr as pickHubs, xs as readHandoffAck, y as COMMUNITY_LIMITS, ya as REMOVED_TEXT, yc as APP_BUNDLE_LIMITS, yr as mergeLobby, ys as handoffVersions, za as BUTTON_ID, zc as isAppRef, zn as pairedMessageFrame, zr as nextPinNumber } from "./src-Bpy99Z2K.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-
|
|
5
|
+
import { t as nwc } from "./nwcProvider-CAGRn2ly.js";
|
|
6
6
|
import { a as clearProfileStores, c as errorLine, d as openDb, f as profileOpenFailure, h as wrap, i as STORES$1, l as fileStore, m as transact, n as APP_STORAGE_SCOPE_INDEX, o as databaseName, p as store, r as CARD_INDEX, s as deleteDatabase, t as APP_STORAGE_CHAT_INDEX, u as newestWalletTx } from "./idb-BJARz3Qi.js";
|
|
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-
|
|
7
|
+
import { a as sealSeed, i as newDeviceKey, o as unsealSeed, r as intentRepository } from "./networkReason-C0VY94cG.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-BXPINkVJ.js";
|
|
9
|
+
import { i as fedimintDatabase, n as createIrohWebEndpoint, o as loadFedimintSdk, r as irohRelayProblem, t as DEFAULT_IROH_RELAYS } from "./irohWeb-CrGOD-OD.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-
|
|
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-CvYK0Lbt.js";
|
|
12
|
+
import { i as fromBase64Url$1, n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-hJ0SfbAh.js";
|
|
13
13
|
import { c as fileSpace, f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf, u as removeFileBytes } from "./fileBytes-B8eTZfAT.js";
|
|
14
14
|
import { t as hyperdhtRelayProblem } from "./hyperdhtRelay-BT_wRxab.js";
|
|
15
15
|
import { sha256 } from "@noble/hashes/sha2.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-DFusiw8x.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-DXyOeKEI.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. */
|
|
@@ -6813,7 +6813,7 @@ var registry;
|
|
|
6813
6813
|
var loading$1;
|
|
6814
6814
|
var listeners = /* @__PURE__ */ new Set();
|
|
6815
6815
|
function loadIdentityProviders() {
|
|
6816
|
-
return loading$1 ??= import("./registry-
|
|
6816
|
+
return loading$1 ??= import("./registry-D2bK-k1T.js").then((m) => {
|
|
6817
6817
|
registry = m;
|
|
6818
6818
|
for (const listener of listeners) listener();
|
|
6819
6819
|
return m;
|
|
@@ -21605,6 +21605,62 @@ var EditBuffer = class {
|
|
|
21605
21605
|
//#region ../browser/src/engine/removals.ts
|
|
21606
21606
|
/** The removal of a message after its last edit `seq`: one past it, at most `MAX_REMOVAL_NUMBER`. */
|
|
21607
21607
|
var removalNumber = (seq) => Math.min((seq ?? 0) + 1, MAX_REMOVAL_NUMBER);
|
|
21608
|
+
/** How often a chat is read whole for the quotes of removed messages (`QuoteSweeps`). */
|
|
21609
|
+
var QUOTE_SWEEP_MS = 1e4;
|
|
21610
|
+
/**
|
|
21611
|
+
* The quotes of removed messages, here or not (never came, or deleted here first). The replies that quote one are found
|
|
21612
|
+
* by reading the chat whole, and a contact or a member can send and remove, or remove ids that never were, at its edit
|
|
21613
|
+
* pace. So a chat is read for them at most once a `QUOTE_SWEEP_MS`: the first at once, the ones that come meanwhile
|
|
21614
|
+
* together when the time is up.
|
|
21615
|
+
*/
|
|
21616
|
+
var QuoteSweeps = class {
|
|
21617
|
+
sweep;
|
|
21618
|
+
now;
|
|
21619
|
+
chats = /* @__PURE__ */ new Map();
|
|
21620
|
+
constructor(sweep, now = Date.now) {
|
|
21621
|
+
this.sweep = sweep;
|
|
21622
|
+
this.now = now;
|
|
21623
|
+
}
|
|
21624
|
+
add(chat, id, ref) {
|
|
21625
|
+
let state = this.chats.get(chat);
|
|
21626
|
+
if (!state) this.chats.set(chat, state = {
|
|
21627
|
+
due: /* @__PURE__ */ new Map(),
|
|
21628
|
+
at: -Infinity,
|
|
21629
|
+
busy: false
|
|
21630
|
+
});
|
|
21631
|
+
state.due.set(id, ref);
|
|
21632
|
+
this.next(chat);
|
|
21633
|
+
}
|
|
21634
|
+
/** The chat is gone: what waits for it is dropped. */
|
|
21635
|
+
forget(chat) {
|
|
21636
|
+
clearTimeout(this.chats.get(chat)?.timer);
|
|
21637
|
+
this.chats.delete(chat);
|
|
21638
|
+
}
|
|
21639
|
+
stop() {
|
|
21640
|
+
for (const state of this.chats.values()) clearTimeout(state.timer);
|
|
21641
|
+
this.chats.clear();
|
|
21642
|
+
}
|
|
21643
|
+
next(chat) {
|
|
21644
|
+
const state = this.chats.get(chat);
|
|
21645
|
+
if (!state?.due.size || state.busy || state.timer) return;
|
|
21646
|
+
const wait = state.at + QUOTE_SWEEP_MS - this.now();
|
|
21647
|
+
if (wait > 0) {
|
|
21648
|
+
state.timer = setTimeout(() => {
|
|
21649
|
+
state.timer = void 0;
|
|
21650
|
+
this.next(chat);
|
|
21651
|
+
}, wait);
|
|
21652
|
+
return;
|
|
21653
|
+
}
|
|
21654
|
+
const removed = state.due;
|
|
21655
|
+
state.due = /* @__PURE__ */ new Map();
|
|
21656
|
+
state.busy = true;
|
|
21657
|
+
state.at = this.now();
|
|
21658
|
+
this.sweep(chat, removed).catch(() => {}).finally(() => {
|
|
21659
|
+
state.busy = false;
|
|
21660
|
+
if (this.chats.get(chat) === state) this.next(chat);
|
|
21661
|
+
});
|
|
21662
|
+
}
|
|
21663
|
+
};
|
|
21608
21664
|
/** The row a removal reads as to the edit queues: mine, its fallback text, its edit pending until said. */
|
|
21609
21665
|
function removalRow(linkId, removal) {
|
|
21610
21666
|
return {
|
|
@@ -22394,6 +22450,8 @@ function settleAhead(history, now) {
|
|
|
22394
22450
|
//#endregion
|
|
22395
22451
|
//#region ../browser/src/engine/reactions.ts
|
|
22396
22452
|
var isGroup$1 = (chat) => chat.startsWith("group:");
|
|
22453
|
+
/** How often a 1:1 chat is read whole for received reactions its rows' ids did not find (`Reactions.find`). */
|
|
22454
|
+
var REACTION_LOOKUP_MS = 1e4;
|
|
22397
22455
|
/** The row a reaction names in a chat: the id both sides know it by (`replyRef`). */
|
|
22398
22456
|
function reactionTarget(messages, id, group) {
|
|
22399
22457
|
return messages.find((m) => replyRef(m, group) === id);
|
|
@@ -22468,6 +22526,8 @@ var Reactions = class {
|
|
|
22468
22526
|
* out. It only has to grow, so a row deleted since leaves it too high and nothing is wrong.
|
|
22469
22527
|
*/
|
|
22470
22528
|
last = /* @__PURE__ */ new Map();
|
|
22529
|
+
/** Per 1:1 chat: when it was last read whole for a received reaction, and the read of those that waited meanwhile. */
|
|
22530
|
+
lookups = /* @__PURE__ */ new Map();
|
|
22471
22531
|
constructor(host) {
|
|
22472
22532
|
this.host = host;
|
|
22473
22533
|
}
|
|
@@ -22525,7 +22585,7 @@ var Reactions = class {
|
|
|
22525
22585
|
}
|
|
22526
22586
|
take(chat, by, reaction) {
|
|
22527
22587
|
return this.run(async () => {
|
|
22528
|
-
const target = await this.find(chat, reaction.id);
|
|
22588
|
+
const target = await this.find(chat, reaction.id, true);
|
|
22529
22589
|
if (!target) return this.wait(chat, by, reaction);
|
|
22530
22590
|
if (!reactionIsNewer(target.reactions?.[by], reaction.n)) return "stale";
|
|
22531
22591
|
await this.write(chat, target, by, reaction);
|
|
@@ -22592,6 +22652,8 @@ var Reactions = class {
|
|
|
22592
22652
|
stop() {
|
|
22593
22653
|
this.stopped = true;
|
|
22594
22654
|
this.dropHeld();
|
|
22655
|
+
for (const state of this.lookups.values()) clearTimeout(state.timer);
|
|
22656
|
+
this.lookups.clear();
|
|
22595
22657
|
}
|
|
22596
22658
|
dropHeld(chat) {
|
|
22597
22659
|
for (const [key, timer] of this.heldTimers) if (chat === void 0 || key.startsWith(`${chat}\n`)) {
|
|
@@ -22623,9 +22685,11 @@ var Reactions = class {
|
|
|
22623
22685
|
/**
|
|
22624
22686
|
* The row a received reaction names. Most often the row of that id (a group's), or of `peer_` or `me_` and that id (a
|
|
22625
22687
|
* chat's): those are read alone. Any other (a file's, a payment's, one not here yet) is looked for in the whole chat;
|
|
22626
|
-
* in a group there is no other, since a row that takes a reaction goes by its own id there.
|
|
22688
|
+
* in a group there is no other, since a row that takes a reaction goes by its own id there. A `received` one is looked
|
|
22689
|
+
* for so at most once a `REACTION_LOOKUP_MS` per chat, since the contact can name ids that never were: one that comes
|
|
22690
|
+
* meanwhile waits, and the next read finds what waited (`lookUpWaiting`).
|
|
22627
22691
|
*/
|
|
22628
|
-
async find(chat, id) {
|
|
22692
|
+
async find(chat, id, received = false) {
|
|
22629
22693
|
const group = isGroup$1(chat);
|
|
22630
22694
|
if (this.host.message) {
|
|
22631
22695
|
for (const rowId of group ? [id] : [`peer_${id}`, `me_${id}`]) {
|
|
@@ -22633,14 +22697,54 @@ var Reactions = class {
|
|
|
22633
22697
|
if (row && replyRef(row, group) === id) return row;
|
|
22634
22698
|
}
|
|
22635
22699
|
if (group) return void 0;
|
|
22700
|
+
if (received && !this.lookupDue(chat)) return void 0;
|
|
22636
22701
|
}
|
|
22637
22702
|
return reactionTarget(await this.host.messages(chat), id, group);
|
|
22638
22703
|
}
|
|
22704
|
+
/** Whether a received reaction may read the chat whole now; if not, a read of those that wait is due when it may. */
|
|
22705
|
+
lookupDue(chat) {
|
|
22706
|
+
const now = this.now();
|
|
22707
|
+
let state = this.lookups.get(chat);
|
|
22708
|
+
if (!state) this.lookups.set(chat, state = { at: -Infinity });
|
|
22709
|
+
if (now - state.at >= 1e4) {
|
|
22710
|
+
state.at = now;
|
|
22711
|
+
return true;
|
|
22712
|
+
}
|
|
22713
|
+
if (!state.timer && !this.stopped) {
|
|
22714
|
+
const due = state;
|
|
22715
|
+
due.timer = setTimeout(() => {
|
|
22716
|
+
due.timer = void 0;
|
|
22717
|
+
this.lookUpWaiting(chat, due).catch(() => {});
|
|
22718
|
+
}, due.at + REACTION_LOOKUP_MS - now);
|
|
22719
|
+
}
|
|
22720
|
+
return false;
|
|
22721
|
+
}
|
|
22722
|
+
/** The chat read whole once for the reactions that wait in it: those whose row it has land, newest last. */
|
|
22723
|
+
lookUpWaiting(chat, due) {
|
|
22724
|
+
return this.run(async () => {
|
|
22725
|
+
const now = this.now(), list = (this.waiting.get(chat) ?? []).filter((w) => w.until > now);
|
|
22726
|
+
if (this.stopped || this.lookups.get(chat) !== due || !list.length) return;
|
|
22727
|
+
due.at = now;
|
|
22728
|
+
const messages = await this.host.messages(chat);
|
|
22729
|
+
const found = list.flatMap((w) => {
|
|
22730
|
+
const target = reactionTarget(messages, w.reaction.id, false);
|
|
22731
|
+
return target ? [{
|
|
22732
|
+
...w,
|
|
22733
|
+
target
|
|
22734
|
+
}] : [];
|
|
22735
|
+
});
|
|
22736
|
+
if (!found.length) return;
|
|
22737
|
+
this.waiting.set(chat, list.filter((w) => !found.some((f) => f.by === w.by && f.reaction === w.reaction)));
|
|
22738
|
+
for (const { target, by, reaction } of found.sort((a, b) => a.reaction.n - b.reaction.n)) await this.write(chat, target, by, reaction);
|
|
22739
|
+
});
|
|
22740
|
+
}
|
|
22639
22741
|
/** A chat is gone: nothing waits for it any more, and my highest number in it is read again if it comes back. */
|
|
22640
22742
|
forget(chat) {
|
|
22641
22743
|
this.dropHeld(chat);
|
|
22642
22744
|
this.waiting.delete(chat);
|
|
22643
22745
|
this.last.delete(chat);
|
|
22746
|
+
clearTimeout(this.lookups.get(chat)?.timer);
|
|
22747
|
+
this.lookups.delete(chat);
|
|
22644
22748
|
}
|
|
22645
22749
|
wait(chat, by, reaction) {
|
|
22646
22750
|
const now = this.now();
|
|
@@ -23345,76 +23449,82 @@ var Communities = class {
|
|
|
23345
23449
|
return this.stored.get(groupId);
|
|
23346
23450
|
}
|
|
23347
23451
|
views() {
|
|
23348
|
-
return [...this.stored.values()].flatMap((group) =>
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23352
|
-
|
|
23353
|
-
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23357
|
-
|
|
23358
|
-
|
|
23359
|
-
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23387
|
-
|
|
23388
|
-
|
|
23389
|
-
|
|
23390
|
-
|
|
23391
|
-
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
|
|
23395
|
-
|
|
23396
|
-
|
|
23397
|
-
|
|
23398
|
-
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
|
|
23402
|
-
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
|
|
23408
|
-
|
|
23409
|
-
|
|
23410
|
-
|
|
23411
|
-
|
|
23412
|
-
|
|
23413
|
-
|
|
23414
|
-
|
|
23415
|
-
|
|
23416
|
-
|
|
23417
|
-
|
|
23452
|
+
return [...this.stored.values()].flatMap((group) => this.viewOf(group));
|
|
23453
|
+
}
|
|
23454
|
+
/** One community's view, as `views()` makes it, without building the others' (`Groups.view`). */
|
|
23455
|
+
view(groupId) {
|
|
23456
|
+
const group = this.stored.get(groupId);
|
|
23457
|
+
return group && this.viewOf(group)[0];
|
|
23458
|
+
}
|
|
23459
|
+
viewOf(group) {
|
|
23460
|
+
const live = this.live.get(group.id);
|
|
23461
|
+
const base = {
|
|
23462
|
+
id: group.id,
|
|
23463
|
+
profile: "community",
|
|
23464
|
+
createdAt: group.createdAt,
|
|
23465
|
+
lastMessageAt: this.lastMessageAt.get(group.id) ?? 0,
|
|
23466
|
+
...peerMessageAt(this.lastPeerMessageAt, group.id),
|
|
23467
|
+
...mentionAt(this.lastMentionAt, group.id),
|
|
23468
|
+
invited: [],
|
|
23469
|
+
memberLinks: {}
|
|
23470
|
+
};
|
|
23471
|
+
const invitation = this.knocking(group, live) ? {
|
|
23472
|
+
linkId: group.joining.linkId,
|
|
23473
|
+
contact: "",
|
|
23474
|
+
admin: group.joining.inviter,
|
|
23475
|
+
members: 0,
|
|
23476
|
+
accepted: true,
|
|
23477
|
+
viaLink: true,
|
|
23478
|
+
stage: this.joinStage(group),
|
|
23479
|
+
since: group.joining.since,
|
|
23480
|
+
...this.knockingWith.get(group.id) ? { waiting: this.knockingWith.get(group.id) } : {}
|
|
23481
|
+
} : void 0;
|
|
23482
|
+
if (invitation && !this.keptWhileKnocking(live)) return [{
|
|
23483
|
+
...base,
|
|
23484
|
+
name: groupName(group.joining.name) ?? live?.session.name ?? "",
|
|
23485
|
+
isAdmin: false,
|
|
23486
|
+
members: [],
|
|
23487
|
+
canSend: false,
|
|
23488
|
+
invitation
|
|
23489
|
+
}];
|
|
23490
|
+
if (!live) return [];
|
|
23491
|
+
const s = live.session, edges = this.host.edges(group.id);
|
|
23492
|
+
const ready = (key) => {
|
|
23493
|
+
const id = edges.get(key);
|
|
23494
|
+
return !!id && this.host.linkReady(id, 2);
|
|
23495
|
+
};
|
|
23496
|
+
const hubs = freshHubs(this.hubs(live), this.now()).map((h) => h.key);
|
|
23497
|
+
const former = Object.entries(s.state.nicks).filter(([key]) => !rosterHas(s.roster, key));
|
|
23498
|
+
return [{
|
|
23499
|
+
...base,
|
|
23500
|
+
name: s.name,
|
|
23501
|
+
...former.length ? { formerNames: Object.fromEntries(former) } : {},
|
|
23502
|
+
status: s.status,
|
|
23503
|
+
statusReason: s.state.statusReason,
|
|
23504
|
+
epoch: s.epoch,
|
|
23505
|
+
myKey: s.myKey,
|
|
23506
|
+
isAdmin: s.isAdmin,
|
|
23507
|
+
...s.isMember && s.entryKey ? { entryLink: encodeCommunityLink({
|
|
23508
|
+
g: s.id,
|
|
23509
|
+
host: s.entryKey
|
|
23510
|
+
}) } : {},
|
|
23511
|
+
canSend: s.canSend,
|
|
23512
|
+
...s.picture ? { picture: s.picture } : {},
|
|
23513
|
+
...invitation ? { invitation } : {},
|
|
23514
|
+
community: {
|
|
23515
|
+
hub: live.hub,
|
|
23516
|
+
hubs: hubs.length,
|
|
23517
|
+
connected: [...edges.keys()].filter(ready).length
|
|
23518
|
+
},
|
|
23519
|
+
members: s.roster.map(([key, role]) => ({
|
|
23520
|
+
key,
|
|
23521
|
+
role,
|
|
23522
|
+
me: key === s.myKey,
|
|
23523
|
+
nick: key === s.myKey ? void 0 : edges.get(key) && this.host.edgeNick(edges.get(key)) || s.state.nicks[key],
|
|
23524
|
+
online: key === s.myKey || ready(key),
|
|
23525
|
+
missing: s.missing(key)
|
|
23526
|
+
}))
|
|
23527
|
+
}];
|
|
23418
23528
|
}
|
|
23419
23529
|
messages(groupId) {
|
|
23420
23530
|
return this.store.getMessages(MESSAGE_LINK$1(groupId));
|
|
@@ -26312,92 +26422,103 @@ var Groups = class {
|
|
|
26312
26422
|
return this.isCommunity(groupId) ? this.communities.record(groupId) : this.stored.get(groupId);
|
|
26313
26423
|
}
|
|
26314
26424
|
views() {
|
|
26315
|
-
return [...this.meshViews(), ...this.communities.views()].map((view) =>
|
|
26316
|
-
|
|
26317
|
-
|
|
26318
|
-
|
|
26319
|
-
|
|
26320
|
-
|
|
26321
|
-
|
|
26425
|
+
return [...this.meshViews(), ...this.communities.views()].map((view) => this.pinned(view)).sort((a, b) => Math.max(b.lastMessageAt, b.createdAt) - Math.max(a.lastMessageAt, a.createdAt));
|
|
26426
|
+
}
|
|
26427
|
+
/**
|
|
26428
|
+
* One group's view, as `views()` makes it, without building every other group's: the engine's native-listener
|
|
26429
|
+
* decisions read it per edge, and all groups' views per edge grew with groups × members squared.
|
|
26430
|
+
*/
|
|
26431
|
+
view(groupId) {
|
|
26432
|
+
const view = this.isCommunity(groupId) ? this.communities.view(groupId) : this.meshView(this.stored.get(groupId));
|
|
26433
|
+
return view && this.pinned(view);
|
|
26434
|
+
}
|
|
26435
|
+
pinned(view) {
|
|
26436
|
+
const pin = pinView(this.record(view.id)?.pin);
|
|
26437
|
+
return pin ? {
|
|
26438
|
+
...view,
|
|
26439
|
+
pin
|
|
26440
|
+
} : view;
|
|
26322
26441
|
}
|
|
26323
26442
|
meshViews() {
|
|
26324
|
-
return [...this.stored.values()].
|
|
26325
|
-
|
|
26326
|
-
|
|
26327
|
-
|
|
26328
|
-
|
|
26329
|
-
|
|
26330
|
-
|
|
26331
|
-
|
|
26332
|
-
|
|
26333
|
-
|
|
26334
|
-
|
|
26335
|
-
|
|
26336
|
-
|
|
26337
|
-
|
|
26338
|
-
|
|
26339
|
-
|
|
26340
|
-
|
|
26341
|
-
|
|
26342
|
-
|
|
26343
|
-
isAdmin: false,
|
|
26344
|
-
members: [],
|
|
26345
|
-
canSend: false,
|
|
26346
|
-
...group.formerNames ? { formerNames: group.formerNames } : {},
|
|
26347
|
-
invitation: {
|
|
26348
|
-
linkId: invitation.linkId,
|
|
26349
|
-
contact: this.host.contactName(invitation.linkId) ?? "",
|
|
26350
|
-
admin: invitation.admin,
|
|
26351
|
-
members: Math.min(Math.max(invitation.n, 0), GROUP_MEMBER_CAP.max),
|
|
26352
|
-
accepted: !!invitation.seedB64,
|
|
26353
|
-
...this.acceptSaid.get(group.id)?.unanswered ? { unanswered: true } : {},
|
|
26354
|
-
...invitation.takenBack ? { takenBack: true } : {},
|
|
26355
|
-
...invitation.entry ? {
|
|
26356
|
-
viaLink: true,
|
|
26357
|
-
stage: this.joinStage(group)
|
|
26358
|
-
} : {}
|
|
26359
|
-
}
|
|
26360
|
-
};
|
|
26361
|
-
}
|
|
26362
|
-
const nicks = session.state.nicks;
|
|
26363
|
-
const entry = session.isAdmin ? this.entryOf(group) : void 0;
|
|
26364
|
-
const now = this.now(), onHubs = this.hubs.active(group.id, session, now);
|
|
26365
|
-
const hubKeys = new Set(onHubs ? this.hubs.hubs(group.id, session, now) : []), policy = session.hubPolicy;
|
|
26366
|
-
if (onHubs && this.hubs.isHub(group.id)) hubKeys.add(session.myKey);
|
|
26367
|
-
const typing = this.typings.view(session);
|
|
26368
|
-
const former = Object.entries(nicks).filter(([key]) => !rosterHas(session.roster, key));
|
|
26443
|
+
return [...this.stored.values()].flatMap((group) => this.meshView(group) ?? []);
|
|
26444
|
+
}
|
|
26445
|
+
meshView(group) {
|
|
26446
|
+
if (!group || group.left || !(group.invitation || this.sessions.has(group.id))) return void 0;
|
|
26447
|
+
const session = this.sessions.get(group.id);
|
|
26448
|
+
const edges = this.host.edges(group.id);
|
|
26449
|
+
const contacts = Object.entries(group.contacts ?? {}).filter(([key]) => !session || rosterHas(session.roster, key));
|
|
26450
|
+
const base = {
|
|
26451
|
+
id: group.id,
|
|
26452
|
+
profile: "mesh",
|
|
26453
|
+
createdAt: group.createdAt,
|
|
26454
|
+
lastMessageAt: this.lastMessageAt.get(group.id) ?? 0,
|
|
26455
|
+
...peerMessageAt(this.lastPeerMessageAt, group.id),
|
|
26456
|
+
...mentionAt(this.lastMentionAt, group.id),
|
|
26457
|
+
invited: [...this.invited.get(group.id) ?? []],
|
|
26458
|
+
memberLinks: Object.fromEntries(contacts.map(([key, linkId]) => [linkId, key]))
|
|
26459
|
+
};
|
|
26460
|
+
if (!session) {
|
|
26461
|
+
const invitation = group.invitation;
|
|
26369
26462
|
return {
|
|
26370
26463
|
...base,
|
|
26371
|
-
name:
|
|
26372
|
-
|
|
26373
|
-
|
|
26374
|
-
|
|
26375
|
-
|
|
26376
|
-
|
|
26377
|
-
|
|
26378
|
-
|
|
26379
|
-
|
|
26380
|
-
|
|
26381
|
-
|
|
26382
|
-
|
|
26383
|
-
|
|
26384
|
-
|
|
26385
|
-
|
|
26386
|
-
|
|
26387
|
-
|
|
26388
|
-
|
|
26389
|
-
role,
|
|
26390
|
-
me: key === session.myKey,
|
|
26391
|
-
nick: key === session.myKey ? void 0 : edge && this.host.edgeNick(edge) || nicks[key],
|
|
26392
|
-
online: direct || viaHub,
|
|
26393
|
-
...viaHub ? { viaHub } : {},
|
|
26394
|
-
...hubKeys.has(key) ? { hub: true } : {},
|
|
26395
|
-
...hubRole ? { hubRole } : {},
|
|
26396
|
-
missing: session.missing(key, this.gapsGone.get(group.id)?.get(key)?.[session.epoch])
|
|
26397
|
-
};
|
|
26398
|
-
})
|
|
26464
|
+
name: groupName(invitation.name) ?? "",
|
|
26465
|
+
isAdmin: false,
|
|
26466
|
+
members: [],
|
|
26467
|
+
canSend: false,
|
|
26468
|
+
...group.formerNames ? { formerNames: group.formerNames } : {},
|
|
26469
|
+
invitation: {
|
|
26470
|
+
linkId: invitation.linkId,
|
|
26471
|
+
contact: this.host.contactName(invitation.linkId) ?? "",
|
|
26472
|
+
admin: invitation.admin,
|
|
26473
|
+
members: Math.min(Math.max(invitation.n, 0), GROUP_MEMBER_CAP.max),
|
|
26474
|
+
accepted: !!invitation.seedB64,
|
|
26475
|
+
...this.acceptSaid.get(group.id)?.unanswered ? { unanswered: true } : {},
|
|
26476
|
+
...invitation.takenBack ? { takenBack: true } : {},
|
|
26477
|
+
...invitation.entry ? {
|
|
26478
|
+
viaLink: true,
|
|
26479
|
+
stage: this.joinStage(group)
|
|
26480
|
+
} : {}
|
|
26481
|
+
}
|
|
26399
26482
|
};
|
|
26400
|
-
}
|
|
26483
|
+
}
|
|
26484
|
+
const nicks = session.state.nicks;
|
|
26485
|
+
const entry = session.isAdmin ? this.entryOf(group) : void 0;
|
|
26486
|
+
const now = this.now(), onHubs = this.hubs.active(group.id, session, now);
|
|
26487
|
+
const hubKeys = new Set(onHubs ? this.hubs.hubs(group.id, session, now) : []), policy = session.hubPolicy;
|
|
26488
|
+
if (onHubs && this.hubs.isHub(group.id)) hubKeys.add(session.myKey);
|
|
26489
|
+
const typing = this.typings.view(session);
|
|
26490
|
+
const former = Object.entries(nicks).filter(([key]) => !rosterHas(session.roster, key));
|
|
26491
|
+
return {
|
|
26492
|
+
...base,
|
|
26493
|
+
name: session.name,
|
|
26494
|
+
...former.length ? { formerNames: Object.fromEntries(former) } : {},
|
|
26495
|
+
status: session.status,
|
|
26496
|
+
statusReason: session.state.statusReason,
|
|
26497
|
+
epoch: session.epoch,
|
|
26498
|
+
myKey: session.myKey,
|
|
26499
|
+
isAdmin: session.isAdmin,
|
|
26500
|
+
...entry ? { entryLink: encodeGroupEntryLink(entry.link) } : {},
|
|
26501
|
+
...session.picture ? { picture: session.picture } : {},
|
|
26502
|
+
canSend: session.status === "active" && session.readableEpochs.includes(session.epoch),
|
|
26503
|
+
...onHubs ? { hubs: { hub: this.hubs.isHub(group.id) } } : {},
|
|
26504
|
+
...typing ? { typing } : {},
|
|
26505
|
+
members: session.roster.map(([key, role]) => {
|
|
26506
|
+
const edge = edges.get(key);
|
|
26507
|
+
const direct = key === session.myKey || !!edge && this.host.linkReady(edge), viaHub = !direct && onHubs && this.hubs.viaHub(group.id, session, key, now);
|
|
26508
|
+
const hubRole = policy.pin.includes(key) ? "pin" : policy.no.includes(key) ? "exclude" : void 0;
|
|
26509
|
+
return {
|
|
26510
|
+
key,
|
|
26511
|
+
role,
|
|
26512
|
+
me: key === session.myKey,
|
|
26513
|
+
nick: key === session.myKey ? void 0 : edge && this.host.edgeNick(edge) || nicks[key],
|
|
26514
|
+
online: direct || viaHub,
|
|
26515
|
+
...viaHub ? { viaHub } : {},
|
|
26516
|
+
...hubKeys.has(key) ? { hub: true } : {},
|
|
26517
|
+
...hubRole ? { hubRole } : {},
|
|
26518
|
+
missing: session.missing(key, this.gapsGone.get(group.id)?.get(key)?.[session.epoch])
|
|
26519
|
+
};
|
|
26520
|
+
})
|
|
26521
|
+
};
|
|
26401
26522
|
}
|
|
26402
26523
|
messages(groupId) {
|
|
26403
26524
|
return this.store.getMessages(MESSAGE_LINK(groupId));
|
|
@@ -26904,26 +27025,26 @@ var Groups = class {
|
|
|
26904
27025
|
const commit = frame && typeof frame === "object" && frame.t === "group-commit" ? frame.commit : void 0;
|
|
26905
27026
|
return typeof commit?.e === "number" && commit.e <= removalEpoch(session.state.chain, key);
|
|
26906
27027
|
}
|
|
26907
|
-
/** My removals on their way in a group (`engine/removals.ts`). */
|
|
27028
|
+
/** My removals on their way in a group (`engine/removals.ts`), a private group's or a community's. */
|
|
26908
27029
|
removals(groupId) {
|
|
26909
|
-
return this.
|
|
27030
|
+
return this.record(groupId)?.removals ?? [];
|
|
26910
27031
|
}
|
|
26911
27032
|
async setRemovals(groupId, removals) {
|
|
26912
|
-
const group = this.
|
|
27033
|
+
const group = this.record(groupId);
|
|
26913
27034
|
if (!group) return;
|
|
26914
27035
|
group.removals = removals;
|
|
26915
27036
|
await this.store.putGroup(group);
|
|
26916
27037
|
}
|
|
26917
27038
|
/** A member's message its author deleted for everyone (WISP 400 § Delete for everyone): a copy that comes again is not kept. */
|
|
26918
27039
|
isRemoved(groupId, messageId) {
|
|
26919
|
-
return !!this.
|
|
27040
|
+
return !!this.record(groupId)?.removedIds?.includes(messageId);
|
|
26920
27041
|
}
|
|
26921
27042
|
/**
|
|
26922
27043
|
* Its author deleted a message for everyone: noted so (the newest `MAX_REMOVED_IDS`, also when the message is not here
|
|
26923
27044
|
* yet, so it is taken as gone when it comes), and its file goes from this device.
|
|
26924
27045
|
*/
|
|
26925
27046
|
async removed(groupId, messageId) {
|
|
26926
|
-
const group = this.
|
|
27047
|
+
const group = this.record(groupId);
|
|
26927
27048
|
if (!group) return;
|
|
26928
27049
|
if (!group.removedIds?.includes(messageId)) {
|
|
26929
27050
|
group.removedIds = [...group.removedIds ?? [], messageId].slice(-500);
|
|
@@ -36660,6 +36781,11 @@ var GhostlyNode = class GhostlyNode {
|
|
|
36660
36781
|
cardRestores = /* @__PURE__ */ new Map();
|
|
36661
36782
|
/** The contacts' edits of messages not here yet. */
|
|
36662
36783
|
editBuffer = new EditBuffer();
|
|
36784
|
+
/** Removals of messages, whose quotes are looked for at most once a while per chat (`forgetQuotes`). */
|
|
36785
|
+
quoteSweeps = new QuoteSweeps(async (chat, removed) => {
|
|
36786
|
+
const ids = await this.forgetQuotes(chat, removed);
|
|
36787
|
+
if (ids.length) await this.messagesChanged(chat, ids);
|
|
36788
|
+
});
|
|
36663
36789
|
/** Received status card updates, applied at most once a second per message (WISP 405 · Status Cards). */
|
|
36664
36790
|
cardEdits = new CardEditPacer();
|
|
36665
36791
|
/** When each message's buttons were last pressed here (`pressButton`). */
|
|
@@ -37620,7 +37746,8 @@ var GhostlyNode = class GhostlyNode {
|
|
|
37620
37746
|
async forgetGroupMessage(chat, id) {
|
|
37621
37747
|
await this.groups.removed(chat.slice(6), id);
|
|
37622
37748
|
await db.deleteMessage(chat, id);
|
|
37623
|
-
|
|
37749
|
+
this.quoteSweeps.add(chat, id, id);
|
|
37750
|
+
await this.messagesChanged(chat, [id]);
|
|
37624
37751
|
this.emitState();
|
|
37625
37752
|
}
|
|
37626
37753
|
groupRemovalRows(chat) {
|
|
@@ -38485,6 +38612,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
38485
38612
|
for (const queue of this.editQueues.values()) queue.stop();
|
|
38486
38613
|
for (const restore of this.cardRestores.values()) clearTimeout(restore.timer);
|
|
38487
38614
|
this.cardRestores.clear();
|
|
38615
|
+
this.quoteSweeps.stop();
|
|
38488
38616
|
this.groupEdits.stop();
|
|
38489
38617
|
this.reactions.stop();
|
|
38490
38618
|
this.cardEdits.stop();
|
|
@@ -39493,6 +39621,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
39493
39621
|
this.editQueues.delete(linkId);
|
|
39494
39622
|
clearTimeout(this.cardRestores.get(linkId)?.timer);
|
|
39495
39623
|
this.cardRestores.delete(linkId);
|
|
39624
|
+
this.quoteSweeps.forget(linkId);
|
|
39496
39625
|
this.editBuffer.forget(linkId);
|
|
39497
39626
|
live.carried?.stop();
|
|
39498
39627
|
this.links.delete(linkId);
|
|
@@ -39946,7 +40075,13 @@ var GhostlyNode = class GhostlyNode {
|
|
|
39946
40075
|
const live = this.links.get(linkId);
|
|
39947
40076
|
if (!live?.stored.profile || live.stored.group) return false;
|
|
39948
40077
|
const id = `peer_${edit.id}`;
|
|
39949
|
-
if (live.stored.deletedIds?.includes(id))
|
|
40078
|
+
if (live.stored.deletedIds?.includes(id)) {
|
|
40079
|
+
if (edit.rm) this.quoteSweeps.add(linkId, id, replyRef({
|
|
40080
|
+
id,
|
|
40081
|
+
linkId
|
|
40082
|
+
}));
|
|
40083
|
+
return true;
|
|
40084
|
+
}
|
|
39950
40085
|
if (edit.rm) {
|
|
39951
40086
|
const message = await db.getMessage(linkId, id);
|
|
39952
40087
|
if (!message || canRemove(message)) await this.forgetMessage(linkId, id, true);
|
|
@@ -40587,27 +40722,35 @@ var GhostlyNode = class GhostlyNode {
|
|
|
40587
40722
|
}
|
|
40588
40723
|
await db.deleteMessage(linkId, messageId);
|
|
40589
40724
|
live.lastMessageAt = (await db.getMessagePage(linkId, { limit: 1 })).messages[0]?.timestamp ?? 0;
|
|
40590
|
-
|
|
40725
|
+
if (removed) this.quoteSweeps.add(linkId, messageId, replyRef(message ?? {
|
|
40591
40726
|
id: messageId,
|
|
40592
40727
|
linkId
|
|
40593
|
-
}))
|
|
40594
|
-
await this.messagesChanged(linkId, [messageId
|
|
40728
|
+
}));
|
|
40729
|
+
await this.messagesChanged(linkId, [messageId]);
|
|
40595
40730
|
this.emitState();
|
|
40596
40731
|
}
|
|
40597
40732
|
/**
|
|
40598
|
-
*
|
|
40599
|
-
* that quote
|
|
40600
|
-
* read whole
|
|
40733
|
+
* Messages deleted for everyone leave no line of them here (WISP 400 § Delete for everyone): the replies of the chat
|
|
40734
|
+
* that quote one keep the quote's id and who wrote it, which say it was deleted, and lose its snippet. The chat is
|
|
40735
|
+
* read whole, so removals are gathered (`QuoteSweeps`). The ids of the replies changed.
|
|
40601
40736
|
*/
|
|
40602
|
-
async forgetQuotes(linkId,
|
|
40603
|
-
const
|
|
40604
|
-
const
|
|
40737
|
+
async forgetQuotes(linkId, removed) {
|
|
40738
|
+
const byRef = /* @__PURE__ */ new Map();
|
|
40739
|
+
for (const [id, ref] of removed) if (ref !== void 0) byRef.set(ref, id);
|
|
40740
|
+
const quoted = (reply) => !reply ? void 0 : reply.messageId !== void 0 && removed.has(reply.messageId) ? reply.messageId : byRef.get(reply.id);
|
|
40741
|
+
const ids = (await db.getMessages(linkId)).filter((m) => {
|
|
40742
|
+
const id = quoted(m.replyTo);
|
|
40743
|
+
return id !== void 0 && (m.replyTo.snippet || m.replyTo.messageId !== id);
|
|
40744
|
+
}).map((m) => m.id);
|
|
40605
40745
|
if (!ids.length) return [];
|
|
40606
|
-
await db.patchMessages(linkId, ids, (m) =>
|
|
40607
|
-
|
|
40608
|
-
|
|
40609
|
-
|
|
40610
|
-
|
|
40746
|
+
await db.patchMessages(linkId, ids, (m) => {
|
|
40747
|
+
const id = quoted(m.replyTo);
|
|
40748
|
+
return id === void 0 ? null : { replyTo: {
|
|
40749
|
+
...m.replyTo,
|
|
40750
|
+
snippet: "",
|
|
40751
|
+
messageId: id
|
|
40752
|
+
} };
|
|
40753
|
+
});
|
|
40611
40754
|
return ids;
|
|
40612
40755
|
}
|
|
40613
40756
|
/** Local id of a file we send: the id on the wire is ours too, but lives in its own key space. */
|
|
@@ -41999,15 +42142,19 @@ var GhostlyNode = class GhostlyNode {
|
|
|
41999
42142
|
await this.appChatRunnable(ref, digest);
|
|
42000
42143
|
return { error: live.link ? live.link.sendAppData(app, data) : "offline" };
|
|
42001
42144
|
}
|
|
42002
|
-
/** Ranges the contact's apps asked, by chat, app and
|
|
42145
|
+
/** Ranges the contact's apps asked, by chat, app and this engine's number for the ask, until a page answers them. */
|
|
42003
42146
|
appRanges = /* @__PURE__ */ new Map();
|
|
42147
|
+
nextAppRangeAsk = 0;
|
|
42004
42148
|
/**
|
|
42005
42149
|
* Every task stays until a page answers it, live or not: until the link settles it, it holds one of its app's places
|
|
42006
42150
|
* (WISP 1200: at most 4 in flight), so the contact gets `busy` rather than more reads while a page is still reading.
|
|
42151
|
+
* The page answers under a number of the engine's, not the contact's: a number the contact cancelled is free for it to
|
|
42152
|
+
* ask again while the page still reads the first ask, whose answer must not go out as the second's.
|
|
42007
42153
|
*/
|
|
42008
42154
|
appRangeAsked(linkId, task) {
|
|
42009
|
-
|
|
42010
|
-
|
|
42155
|
+
const request = ++this.nextAppRangeAsk;
|
|
42156
|
+
this.appRanges.set(`${linkId} ${task.app} ${request}`, task);
|
|
42157
|
+
const { app, serve, file, offset, length } = task;
|
|
42011
42158
|
this.events.onAppRange?.(linkId, {
|
|
42012
42159
|
app,
|
|
42013
42160
|
request,
|
|
@@ -45139,7 +45286,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45139
45286
|
get nativeFactories() {
|
|
45140
45287
|
const relay = this.relaysHyperdht ? this.hyperdhtRelay : "";
|
|
45141
45288
|
return {
|
|
45142
|
-
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-
|
|
45289
|
+
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-CJBqsS_e.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
|
|
45143
45290
|
...this.options.nativeTransports,
|
|
45144
45291
|
...this.ownIrohRelays ? { "iroh/1": (seedB64) => this.options.nativeTransports["iroh/1"](seedB64, this.settings.irohRelays?.length ? { relays: [...this.settings.irohRelays] } : {}) } : {},
|
|
45145
45292
|
...this.options.irohWeb ? { "iroh/1": (seedB64) => createIrohWebEndpoint(seedB64, { relays: this.irohRelays }) } : {}
|
|
@@ -45315,9 +45462,8 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45315
45462
|
if (group && !live.stored.groupEntry && live.link && `group:${group}` !== this.activeLinkId && this.keepsGroupNative(live.stored)) groups.add(group);
|
|
45316
45463
|
}
|
|
45317
45464
|
if (!groups.size) return;
|
|
45318
|
-
const views = new Map(this.groups.views().map((view) => [view.id, view]));
|
|
45319
45465
|
for (const groupId of groups) {
|
|
45320
|
-
const edges = this.groupEdgesByRank(groupId,
|
|
45466
|
+
const edges = this.groupEdgesByRank(groupId, this.groups.view(groupId));
|
|
45321
45467
|
if (!edges.length || edges.some((live) => live.link.isDataLinkOpen)) continue;
|
|
45322
45468
|
const [anchor, next] = edges;
|
|
45323
45469
|
if (next && !this.anchorPassed(next, now) && this.unanswered(anchor, now)) {
|
|
@@ -45345,8 +45491,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45345
45491
|
/** A group opened on screen: its edges with no native listener take one as a chat on screen does, the one it keeps first. */
|
|
45346
45492
|
groupOnScreen(groupId) {
|
|
45347
45493
|
const native = Object.keys(this.nativeFactories);
|
|
45348
|
-
const
|
|
45349
|
-
for (const live of this.groupEdgesByRank(groupId, view)) {
|
|
45494
|
+
for (const live of this.groupEdgesByRank(groupId, this.groups.view(groupId))) {
|
|
45350
45495
|
if (native.every((t) => live.link.availableTransports.includes(t))) continue;
|
|
45351
45496
|
this.ensureNativeEndpoints(live.stored.id);
|
|
45352
45497
|
}
|
|
@@ -45401,8 +45546,11 @@ var GhostlyNode = class GhostlyNode {
|
|
|
45401
45546
|
const owners = [...this.links.values()].filter((other) => other.link?.availableTransports.includes(key));
|
|
45402
45547
|
const slots = this.nativeSlots(key), groups = owners.filter((other) => other.stored.group).length;
|
|
45403
45548
|
const now = Date.now();
|
|
45404
|
-
|
|
45405
|
-
const viewOf = (groupId) =>
|
|
45549
|
+
const views = /* @__PURE__ */ new Map();
|
|
45550
|
+
const viewOf = (groupId) => {
|
|
45551
|
+
if (!views.has(groupId)) views.set(groupId, this.groups.view(groupId));
|
|
45552
|
+
return views.get(groupId);
|
|
45553
|
+
};
|
|
45406
45554
|
const anchors = /* @__PURE__ */ new Map();
|
|
45407
45555
|
const anchorOf = (groupId) => {
|
|
45408
45556
|
if (!anchors.has(groupId)) anchors.set(groupId, this.groupEdgesByRank(groupId, viewOf(groupId))[0]);
|
|
@@ -46211,4 +46359,4 @@ function signalKind(signal) {
|
|
|
46211
46359
|
//#endregion
|
|
46212
46360
|
export { EngineServer };
|
|
46213
46361
|
|
|
46214
|
-
//# sourceMappingURL=server-
|
|
46362
|
+
//# sourceMappingURL=server-BktMmp7L.js.map
|