@ghostlytools/cli 1.7.1 → 1.7.2
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 +8 -5
- package/dist/assets/{api-CJM3R93b.js → api-CcuCtc1H.js} +2 -2
- package/dist/assets/{api-CD9JbPuA.js → api-tSZELCPQ.js} +44 -22
- package/dist/assets/api-tSZELCPQ.js.map +1 -0
- package/dist/assets/{apiKit-BmnROpCN.js → apiKit-BFk7GAk9.js} +3 -3
- package/dist/assets/{apiKit-BmnROpCN.js.map → apiKit-BFk7GAk9.js.map} +1 -1
- package/dist/assets/{apps-DVA60Tg6.js → apps-C5Mi6x9Q.js} +5 -5
- package/dist/assets/{apps-DVA60Tg6.js.map → apps-C5Mi6x9Q.js.map} +1 -1
- package/dist/assets/{apps-CJ2dvKSz.js → apps-D6THreq_.js} +1 -1
- package/dist/assets/{arkade-CHqwEHFd.js → arkade-Cz0B9bJ0.js} +2 -2
- package/dist/assets/{arkade-CHqwEHFd.js.map → arkade-Cz0B9bJ0.js.map} +1 -1
- package/dist/assets/{backup-C4CbTEcj.js → backup-A0hIa9GE.js} +1 -1
- package/dist/assets/{backup-B4dSNvzb.js → backup-Wb2sm2dd.js} +6 -6
- package/dist/assets/{backup-B4dSNvzb.js.map → backup-Wb2sm2dd.js.map} +1 -1
- package/dist/assets/buttons-Bxxu3lSk.js +2 -0
- package/dist/assets/{buttons-C13rK2mH.js → buttons-Cf70NVYq.js} +12 -7
- package/dist/assets/buttons-Cf70NVYq.js.map +1 -0
- package/dist/assets/{daemonProof-B41oSfon.js → daemonProof-Bp9lJDxf.js} +2 -2
- package/dist/assets/{daemonProof-B41oSfon.js.map → daemonProof-Bp9lJDxf.js.map} +1 -1
- package/dist/assets/{envelope-4TXDx3vD.js → envelope-kQ5kYjVE.js} +2 -2
- package/dist/assets/{envelope-4TXDx3vD.js.map → envelope-kQ5kYjVE.js.map} +1 -1
- package/dist/assets/{errors-CzXgR8Cc.js → errors-mnjSQlbX.js} +2 -1
- package/dist/assets/errors-mnjSQlbX.js.map +1 -0
- package/dist/assets/{groupFiles-ajZgZ6P8.js → groupFiles-D9Ttlm3M.js} +3 -3
- package/dist/assets/groupFiles-D9Ttlm3M.js.map +1 -0
- package/dist/assets/{host-CVeNtA2_.js → host-DpypH-fR.js} +11 -11
- package/dist/assets/{host-CVeNtA2_.js.map → host-DpypH-fR.js.map} +1 -1
- package/dist/assets/{hyperdhtRelay-CI2ISE-g.js → hyperdhtRelay-D1rj84v2.js} +2 -2
- package/dist/assets/{hyperdhtRelay-CI2ISE-g.js.map → hyperdhtRelay-D1rj84v2.js.map} +1 -1
- package/dist/assets/{irohWeb-DcRJdhce.js → irohWeb-BTSlWgEX.js} +2 -2
- package/dist/assets/{irohWeb-DcRJdhce.js.map → irohWeb-BTSlWgEX.js.map} +1 -1
- package/dist/assets/{main-CjO0KGiF.js → main-BwgoQZVu.js} +70 -45
- package/dist/assets/main-BwgoQZVu.js.map +1 -0
- package/dist/assets/{mainline-WM-WItCV.js → mainline-B1urhbEZ.js} +2 -2
- package/dist/assets/{mainline-WM-WItCV.js.map → mainline-B1urhbEZ.js.map} +1 -1
- package/dist/assets/{networkReason-380j5yMs.js → networkReason-D2Z0BdIj.js} +2 -2
- package/dist/assets/{networkReason-380j5yMs.js.map → networkReason-D2Z0BdIj.js.map} +1 -1
- package/dist/assets/{nwc-D5dkC1xg.js → nwc-T2aUK6bi.js} +3 -3
- package/dist/assets/{nwc-D5dkC1xg.js.map → nwc-T2aUK6bi.js.map} +1 -1
- package/dist/assets/{nwcProvider-p_rMwtDv.js → nwcProvider-Dz-ty_DE.js} +2 -2
- package/dist/assets/{nwcProvider-p_rMwtDv.js.map → nwcProvider-Dz-ty_DE.js.map} +1 -1
- package/dist/assets/{profiles-BFd0tpCZ.js → profiles-C6XWqre5.js} +2 -2
- package/dist/assets/{profiles-BFd0tpCZ.js.map → profiles-C6XWqre5.js.map} +1 -1
- package/dist/assets/{registry-BfNcA6kF.js → registry-Bazitl0a.js} +3 -3
- package/dist/assets/{registry-BfNcA6kF.js.map → registry-Bazitl0a.js.map} +1 -1
- package/dist/assets/{registry-BKffx4ZU.js → registry-BlSTJlbv.js} +1 -1
- package/dist/assets/{resolve-hUsgRkmm.js → resolve-Bx1Eeg-w.js} +2 -2
- package/dist/assets/{resolve-hUsgRkmm.js.map → resolve-Bx1Eeg-w.js.map} +1 -1
- package/dist/assets/{server-C3tJZFnv.js → server-CnPj9wWh.js} +252 -93
- package/dist/assets/server-CnPj9wWh.js.map +1 -0
- package/dist/assets/{src-BMHgbkli.js → src-BsznF3XG.js} +88 -23
- package/dist/assets/src-BsznF3XG.js.map +1 -0
- package/dist/assets/{translate-DJUutSis.js → translate-cDBotA-b.js} +11 -11
- package/dist/assets/{translate-DJUutSis.js.map → translate-cDBotA-b.js.map} +1 -1
- package/dist/assets/{usdt-glkUxsDe.js → usdt-DxxLdG60.js} +3 -3
- package/dist/assets/{usdt-glkUxsDe.js.map → usdt-DxxLdG60.js.map} +1 -1
- package/dist/assets/{words-DyW9b27T.js → words-qH8gGtmc.js} +2 -2
- package/dist/assets/{words-DyW9b27T.js.map → words-qH8gGtmc.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-CD9JbPuA.js.map +0 -1
- package/dist/assets/buttons-BMVGYXpR.js +0 -2
- package/dist/assets/buttons-C13rK2mH.js.map +0 -1
- package/dist/assets/errors-CzXgR8Cc.js.map +0 -1
- package/dist/assets/groupFiles-ajZgZ6P8.js.map +0 -1
- package/dist/assets/main-CjO0KGiF.js.map +0 -1
- package/dist/assets/server-C3tJZFnv.js.map +0 -1
- package/dist/assets/src-BMHgbkli.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as traceJoin } from "./joinTrace-CjRDFy85.js";
|
|
2
|
-
import { $
|
|
2
|
+
import { $i as automaticTransport, $l as traceLink, $o as HANDOFF_HAVE, $r as vapidKeysMatch, $s as enrollHelloFrame, A as knockRecords, Aa as GROUP_REACTION_FRAME, Ac as appDigest, Al as classifyTurnRead, An as findEndpoint, Ao as formatLocalTarget, As as readHandoffDone, B as GROUP_READ_NOTE, Ba as pairedReplyAuthor, Bc as APP_STATEMENT_LIMITS, Bi as IdentityExchange, Bl as turnKeys, Bn as EngineError, Br as mayPin, Bs as setAckFrame, C as decodeCommunityLink, Ca as REMOVED_TEXT, Cc as readLinkRecord, Cl as devicePingFrame, Cr as rankHubs, Cs as handoffReleaseFrame, Cu as utf8Decode, D as encodeGroupEntryLink, Da as forwardedAgain, Dc as APP_BUNDLE_MAGIC, Dn as ENDPOINT, Do as WATCH_PEER_MS, Dr as shouldBeHub, Ds as newHandoffId, E as decodeGroupEntryLink, Ea as parseLinkPreview, Ec as APP_BUNDLE_LIMITS, El as webCryptoSigner, En as decodeBolt11, Eo as RELAY_POLL_INTERVALS, Er as readLobby, Es as handoffVersions, F as groupWakeFrame, Fa as reactionEmoji, Fc as pacer, Fi as dialDescriptors, Fl as nextTurnPosition, Fn as INVITE_TAKEN, Fo as encodeControl, Fr as TypingSender, Fs as readHandoffVerified, G as GROUP_EDIT_TEXT_BYTES, Gc as isAppKey, Gi as newIdentityBinding, Gr as WAKE_CALL_INTERVAL_MS, Gt as encodeDidDhtPacket, H as frameBytes, Ha as replySnippet, Hc as appRef, Hi as emptyIdentityLedger, Hl as turnStatedVerifier, Hn as engineText, Ho as contactRtcConfig, Hr as pinIsNewer, Hs as signTombstone, Ht as didDhtDocument, I as groupWakes, Ia as reactionIsNewer, Il as readTurnPacket, In as LIVENESS_PING_MS, Is as sealHandoffPiece, J as mentionsMember, Ji as lastSharedWithMe, Jo as LEGACY_SERVICES, Jr as newWakeToken, Js as enrollCancelFrame, Jt as ETHEREUM_USDT, K as carryMentions, Kc as isAppRef, Ki as receivedIdentityStatus, Ko as emptyLinkRecords, Kr as WakeLimiter, L as parseGroupWakeFrame, La as readReaction, Lc as readAppBundleAsync, Ll as signTurnPacket, Ln as PAIRED_FRAME_TOO_LARGE, Lo as RTC_CONFIG, Lr as typingActivity, M as readKnocks, Ma as ReactionWindow, Mi as CapsExchange, Ml as TURN_LAST_SEQUENCE, Mn as parseCashuRequestPayload, Mo as webLocalFetch, Mr as transferStalled, Ms as readHandoffHello, Na as nextReactionNumber, Ni as DHT_TEXT_CAPABILITY, Nl as TURN_MAX, Nn as parseFedimintRequestPayload, No as LIMITS, Ns as readHandoffPake, O as entryParams, Oa as readForwarded, Oc as APP_ICON_PATH, Ol as TURN_RAISE_READ_TIMEOUT_MS, On as cashuRequestPayload, Oo as presenceSeenAt, Or as ChatFiles, Os as readHandoffAck, P as GroupWakeLimiter, Pa as queueReaction, Pc as isAppUrl, Pi as capsDescriptors, Pl as firstDeviceSetSecret, Pn as GhostLink, Po as decodeControl, Ps as readHandoffTurnFrame, Qc as parseImageMeta, Qi as TRANSPORTS, Qo as HANDOFF_DONE, Qr as checkPushEndpoint, Qs as enrollGrantFrame, Qt as SEPOLIA_TEST_USDT, R as GROUP_LIMITS, Ra as validReactionNumber, Rc as sha256Paced, Ri as IDENTITY_REVOCATION_LABEL, Rl as signTurnRelease, Rn as pairedMessageFits, S as communityHasFrame, Sa as MAX_REMOVAL_NUMBER, Sc as readKnockSlot, Sl as deviceLinkPairing, So as DirectPathWatch, Sr as pickHubs, Ss as handoffPakeFrame, Su as toZ32, Ta as dhtEditId, Tc as seenEntry, Tl as seedSigner, Tr as readBeaconHead, Ts as handoffStreamKey, Ua as BUTTON_ID, Ui as identityRevocationValue, Ul as turnVerifierMark, Un as parseEngineError, Ur as pinNumberHolds, Us as verifySetUpdate, Ut as didDhtFromPublicKey, V as GroupSession, Va as readReply, Vc as appFingerprint, Vl as turnName, Vn as engineError, Vr as nextPinNumber, Vs as setUpdateFrame, Wc as isAppHash, Wi as identityStatement, Wl as DEFAULT_RELAYS, Wn as GROUP_FILE_LIMITS, Wo as parseCallSignal, Wr as readPin, Wt as encodeDidDhtDeactivated, Xi as emptyProofLedger, Xl as currentRelays, Xo as HANDOFF_ACK, Xr as relayRequest, Xs as enrollDigits, Xt as ONCHAIN_PROVIDER, Y as groupName, Yi as PeerProofs, Yn as groupFileFallback, Yo as serviceIdFromName, Yr as parseWakeFrame, Ys as enrollCancelReason, Yt as EVM_TEST_CHAINS, Za as STATUS_CARD_LIMITS, Zi as validExternalKey, Zl as normalizeRelayUrl, Zn as readGroupFileMeta, Zo as HANDOFF_CANCEL, Zr as wakeRequest, Zs as enrollDoneFrame, Zt as PaymentPreflightError, _ as openGroupTyping, _c as knockSlotRecords, _i as readManifest, _l as ENROLL_CAPABILITY, _o as parseGroupCommit, _r as lobbyKeys, _s as handoffDigest, _u as bytesEqual, a as appStoreDecision, aa as DHT_FILE_CAPABILITY, ac as endedRequests, ai as APPS_CAPABILITY, al as readContactLink, an as assertWholeSats, as as HANDOFF_TIMINGS, au as createRelayPayload, b as CommunitySession, ba as EDIT_BUFFER_MS, bc as mergeContactKnocks, bl as deviceEchoNonce, bo as verifyCommitSignature, br as mergeLobby, bs as handoffManifestFrames, bu as randomBytes, c as planAppUpdate, ca as sanitizeFileName, cc as planKnocks, ci as STATUS_CARD_CAPABILITY, cl as readDeviceInvite, cn as walletNetworkOf, co as claimedTime, cr as MESH_HUBS, cs as filePartName, dc as turnOff, di as HOLD_DATED_BACK_MS, dl as decodeInviteCode, dn as sparkAddressKind, do as shownTime, dr as pickMeshHubs, ds as handoffAttemptSucceeded, du as identityFromSeedB64, ec as enrollProofFrame, ei as APP_RANGE_LIMITS, el as canonicalJson, en as TEST_USDT_FAUCET_AMOUNT, es as HANDOFF_HELLO, eu as budgetRetryMs, f as readAppStoreSteps, fc as ContactRequestError, fi as HOLD_LIMITS, fl as encodeInviteCode, fn as sparkInvoiceDetails, fo as GROUP_ADMIN_OFF_ERROR, fr as COMMUNITY_TOPOLOGY, fs as handoffBusyFrame, fu as publicKeyFromZ32, g as groupTypingEpoch, ga as parseVoiceMeta, gc as knockSlotOf, gi as newMailbox, gl as DEVICES_CAPABILITY, go as commitHash, gr as freshHubs, gs as handoffDataFrame, gt as normalizeAtprotoHandle, gu as sanitizeDisplayText, h as GroupTypingBoard, ha as fileMessageText, hc as knockSlotIdentity, hi as isHoldUrl, hn as isPubkyKey, ho as MEMBER_KEY, hr as doorHubs, hs as handoffContextProof, ht as isAtprotoDid, hu as sanitizeAvatar, i as appRevocationFor, ia as peekDhtMailbox, ic as clearMissed, ii as isAppVersion, il as encodeContactLink, in as assertTokenUnits, io as sameButtonText, is as HANDOFF_REQUEST, j as mergeKnocks, ja as REACTION_LIMITS, jc as appViewOf, jl as turnPutSummary, jn as isFederationId, jo as parseLocalTarget, jr as transferEnded, js as readHandoffHave, k as knockIdentity, ka as COMMUNITY_REACTION_FRAME, kl as TURN_SETTLE_MS, kn as fedimintRequestPayload, ko as GhostlyHttpError, kr as FILE_LIMITS, ks as readHandoffCancel, l as APP_STORE_LIMITS, la as sanitizeMime, lc as settleRequest, li as UPGRADE_CAPABILITY, ll as OwnInviteError, ln as SPARK_NETWORKS, lo as heardTime, lr as mayBeHub, ls as handoffAttemptAllowed, lu as createIdentity, mc as contactDay, mi as HoldRefusedError, ml as inviteOwnership, mr as beaconRecords, ms as handoffContext, n as readX401SdJwtVc, nc as readEnrollHello, nl as readCanonicalJson, nn as WALLET_NETWORKS, ns as HANDOFF_PAKE, nu as withRequestOptions, o as appUpdateDecision, oa as dhtFileId, oc as inboxRecord, oi as BUTTONS_CAPABILITY, ol as createDeviceInvite, on as formatPaymentAmount, oo as statusCardText, or as groupSignalFrame, os as HANDOFF_VERIFIED, pc as REQUEST_LIFETIME_MS, pi as HoldKeys, pl as inviteLink, pn as isBitcoinAddress, po as GROUP_MEMBER_CAP, pr as beaconKeys, ps as handoffCancelFrame, pu as verify, q as parseCommunityEdit, qc as readAppRevocation, qi as revokesIdentity, ql as RelayTransport, qo as HTTP_SERVICE_PROTO, qr as deviceWakeRequest, qt as signDidDhtPacket, r as sameX401HolderJwk, ra as DHT_MESSAGE_TTL, rc as verifyEnrollProof, ri as chatAppId, rl as createContactLink, rn as arkAddressPrefix, ro as checkStatusCard, rs as HANDOFF_PIECE_BYTES, ru as PacketTooLargeError, s as checkAppBeforeRun, sa as formatFileSize, sc as newInbox, si as EDIT_CAPABILITY, sl as deviceInviteJoinerParams, sn as validatePaymentTarget, so as arrivalKey, sr as readGroupSignal, ss as NO_ATTEMPTS, t as newX401HolderKey, tc as readEnrollGrant, ti as isServeId, tn as USDT_PUBLIC_RPC, tr as CarriedTransport, ts as HANDOFF_OFFER, tu as isDiscoveryBudgetError, uc as takeRequest, ui as HOLD_CAPABILITY, ul as createChatInvite, un as SPARK_PROVIDER, uo as receivedTimestamp, ur as meshHubs, us as handoffAttemptFailed, uu as identityFromSeed, v as sealGroupTyping, vc as linkRecords, vl as HANDOFF_CAPABILITY, vo as rosterAdmin, vr as lobbyRecords, vs as handoffEphemeral, vu as fromBase64Url, w as encodeCommunityLink, wa as RateWindow, wc as requestRecords, wl as newDeviceSetSecret, wo as DHT_POLL_INTERVALS, wr as readBeacon, ws as handoffRetryAfter, wu as utf8Encode, x as GROUP_READ_NOTE_COMMUNITY, xa as EDIT_RATE_WINDOW_MS, xc as openRequest, xl as deviceKeyZ32, xo as edgeParams, xr as newerHead, xs as handoffOfferFrame, xu as toBase64Url, y as COMMUNITY_LIMITS, ya as parseVideoMeta, yc as makeStampPaced, yl as deviceEchoFrame, yo as rosterHas, yr as mergeBeacon, ys as handoffHelloFrame, za as wireReaction, zl as turnInstance, zn as pairedMessageFrame, zr as PIN_LIMITS, zs as readSetUpdate } from "./src-BsznF3XG.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-Dz-ty_DE.js";
|
|
6
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-
|
|
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-D2Z0BdIj.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-D9Ttlm3M.js";
|
|
9
|
+
import { i as fedimintDatabase, n as createIrohWebEndpoint, o as loadFedimintSdk, r as irohRelayProblem, t as DEFAULT_IROH_RELAYS } from "./irohWeb-BTSlWgEX.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-Bx1Eeg-w.js";
|
|
12
|
+
import { i as fromBase64Url$1, n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-kQ5kYjVE.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-BD0v3rRG.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-DxxLdG60.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-Cz0B9bJ0.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. */
|
|
@@ -6854,7 +6854,7 @@ var registry;
|
|
|
6854
6854
|
var loading$1;
|
|
6855
6855
|
var listeners = /* @__PURE__ */ new Set();
|
|
6856
6856
|
function loadIdentityProviders() {
|
|
6857
|
-
return loading$1 ??= import("./registry-
|
|
6857
|
+
return loading$1 ??= import("./registry-BlSTJlbv.js").then((m) => {
|
|
6858
6858
|
registry = m;
|
|
6859
6859
|
for (const listener of listeners) listener();
|
|
6860
6860
|
return m;
|
|
@@ -15189,6 +15189,12 @@ async function openTurnKeeper(profile, network, options = {}) {
|
|
|
15189
15189
|
}
|
|
15190
15190
|
/** A joiner with no session yet puts its packet out again this often: another device on the same code may have replaced it. */
|
|
15191
15191
|
var ENROLL_REPUT_MS = 5e3;
|
|
15192
|
+
/**
|
|
15193
|
+
* Both devices are on the link and no session opened over WebRTC in this long: the link goes on without it, over the
|
|
15194
|
+
* native transports (Iroh's browser build, HyperDHT through the person's relay), well inside the joiner's
|
|
15195
|
+
* `ENROLL_PROOF_TIMEOUT_MS`. Over WebRTC that works, a session opens in a few seconds.
|
|
15196
|
+
*/
|
|
15197
|
+
var ENROLL_RTC_MS = 2e4;
|
|
15192
15198
|
/** How long, and how often, the joiner reads the turn record for the record that lists it. */
|
|
15193
15199
|
var ENROLL_FINISH = {
|
|
15194
15200
|
rounds: 20,
|
|
@@ -15901,9 +15907,11 @@ function ghostLinkEnrollChannel(options) {
|
|
|
15901
15907
|
signer
|
|
15902
15908
|
};
|
|
15903
15909
|
let link = null;
|
|
15904
|
-
|
|
15910
|
+
/** WebRTC on this link: this page has it, and it did not fail to connect the two (`withoutRtc`). */
|
|
15911
|
+
let rtc = !!options.createPeerConnection;
|
|
15905
15912
|
const intervals = options.pollIntervals ?? DHT_POLL_INTERVALS;
|
|
15906
15913
|
let offered = false;
|
|
15914
|
+
let rtcTimer = null;
|
|
15907
15915
|
const reput = pinned && rtc ? setInterval(() => {
|
|
15908
15916
|
if (!opened) link?.republish();
|
|
15909
15917
|
}, ENROLL_REPUT_MS) : null;
|
|
@@ -15914,85 +15922,117 @@ function ghostLinkEnrollChannel(options) {
|
|
|
15914
15922
|
opened = true;
|
|
15915
15923
|
events.onOpen(publicKeyFromZ32(key), hash);
|
|
15916
15924
|
};
|
|
15917
|
-
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15925
|
+
const make = () => {
|
|
15926
|
+
const made = new GhostLink({
|
|
15927
|
+
params,
|
|
15928
|
+
pairing: {
|
|
15929
|
+
credentials,
|
|
15930
|
+
pinPeer: async (key) => {
|
|
15931
|
+
if (taken && key !== taken) throw new Error("Not the device this code is for");
|
|
15932
|
+
taken = key;
|
|
15933
|
+
},
|
|
15934
|
+
trustOnFirstUse: !pinned
|
|
15924
15935
|
},
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
...intervals,
|
|
15934
|
-
connected: intervals.active
|
|
15935
|
-
},
|
|
15936
|
-
autoConnect: true,
|
|
15937
|
-
createPeerConnection: () => {
|
|
15938
|
-
if (!options.createPeerConnection) throw new ReferenceError("RTCPeerConnection is not defined");
|
|
15939
|
-
return options.createPeerConnection();
|
|
15940
|
-
},
|
|
15941
|
-
localFetch: async () => {
|
|
15942
|
-
throw new Error("An enrollment link serves no local web app");
|
|
15943
|
-
},
|
|
15944
|
-
getServices: () => [{
|
|
15945
|
-
id: "chat",
|
|
15946
|
-
type: "chat"
|
|
15947
|
-
}],
|
|
15948
|
-
getHostedHttpService: () => void 0,
|
|
15949
|
-
events: {
|
|
15950
|
-
onDeviceCapabilities: () => tryOpen(),
|
|
15951
|
-
onPairingState: () => tryOpen(),
|
|
15952
|
-
onDataLinkState: (state) => {
|
|
15953
|
-
if (state === "open") {
|
|
15954
|
-
tryOpen();
|
|
15955
|
-
return;
|
|
15956
|
-
}
|
|
15957
|
-
if (opened) {
|
|
15958
|
-
opened = false;
|
|
15959
|
-
events.onClose();
|
|
15960
|
-
}
|
|
15936
|
+
deviceCapabilities: [ENROLL_CAPABILITY],
|
|
15937
|
+
rtcAvailable: rtc,
|
|
15938
|
+
native: { automatic: true },
|
|
15939
|
+
packetTransports: true,
|
|
15940
|
+
transport: options.transport,
|
|
15941
|
+
pollIntervals: {
|
|
15942
|
+
...intervals,
|
|
15943
|
+
connected: intervals.active
|
|
15961
15944
|
},
|
|
15962
|
-
|
|
15963
|
-
|
|
15945
|
+
autoConnect: true,
|
|
15946
|
+
createPeerConnection: () => {
|
|
15947
|
+
if (!options.createPeerConnection) throw new ReferenceError("RTCPeerConnection is not defined");
|
|
15948
|
+
return options.createPeerConnection();
|
|
15964
15949
|
},
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
if (!presence.online) return;
|
|
15968
|
-
events.onPeerSeen?.();
|
|
15969
|
-
if (!pinned || !rtc || offered || opened) return;
|
|
15970
|
-
offered = true;
|
|
15971
|
-
link?.connect().catch(() => {});
|
|
15950
|
+
localFetch: async () => {
|
|
15951
|
+
throw new Error("An enrollment link serves no local web app");
|
|
15972
15952
|
},
|
|
15973
|
-
|
|
15974
|
-
|
|
15953
|
+
getServices: () => [{
|
|
15954
|
+
id: "chat",
|
|
15955
|
+
type: "chat"
|
|
15956
|
+
}],
|
|
15957
|
+
getHostedHttpService: () => void 0,
|
|
15958
|
+
events: {
|
|
15959
|
+
onDeviceCapabilities: () => {
|
|
15960
|
+
if (link === made) tryOpen();
|
|
15961
|
+
},
|
|
15962
|
+
onPairingState: () => {
|
|
15963
|
+
if (link === made) tryOpen();
|
|
15964
|
+
},
|
|
15965
|
+
onDataLinkState: (state) => {
|
|
15966
|
+
if (link !== made) return;
|
|
15967
|
+
if (state === "open") {
|
|
15968
|
+
tryOpen();
|
|
15969
|
+
return;
|
|
15970
|
+
}
|
|
15971
|
+
if (opened) {
|
|
15972
|
+
opened = false;
|
|
15973
|
+
events.onClose();
|
|
15974
|
+
}
|
|
15975
|
+
},
|
|
15976
|
+
onDeviceFrame: (frame) => {
|
|
15977
|
+
if (opened && link === made) events.onFrame(frame);
|
|
15978
|
+
},
|
|
15979
|
+
onPeerKeyRefused: () => {
|
|
15980
|
+
if (link === made) events.onPeerRefused();
|
|
15981
|
+
},
|
|
15982
|
+
onRtcStalled: () => withoutRtc(made),
|
|
15983
|
+
onDirectEvidence: (evidence) => {
|
|
15984
|
+
if (evidence !== "open" && evidence !== "closed") withoutRtc(made);
|
|
15985
|
+
},
|
|
15986
|
+
onAnswersRefused: () => withoutRtc(made),
|
|
15987
|
+
onPresence: (presence) => {
|
|
15988
|
+
if (!presence.online || link !== made) return;
|
|
15989
|
+
events.onPeerSeen?.();
|
|
15990
|
+
if (rtc && !rtcTimer && !opened) rtcTimer = setTimeout(() => {
|
|
15991
|
+
if (link) withoutRtc(link);
|
|
15992
|
+
}, ENROLL_RTC_MS);
|
|
15993
|
+
if (!pinned || !rtc || offered || opened) return;
|
|
15994
|
+
offered = true;
|
|
15995
|
+
made.connect().catch(() => {});
|
|
15996
|
+
},
|
|
15997
|
+
onPacketTransports: (transports) => {
|
|
15998
|
+
if (link === made && !transports.includes("webrtc/1")) startNative();
|
|
15999
|
+
}
|
|
15975
16000
|
}
|
|
16001
|
+
});
|
|
16002
|
+
return made;
|
|
16003
|
+
};
|
|
16004
|
+
const withoutRtc = (from) => {
|
|
16005
|
+
if (link !== from || !rtc || opened || started.has(from) || !Object.values(options.nativeTransports ?? {}).some(Boolean)) return;
|
|
16006
|
+
rtc = false;
|
|
16007
|
+
if (rtcTimer) {
|
|
16008
|
+
clearTimeout(rtcTimer);
|
|
16009
|
+
rtcTimer = null;
|
|
15976
16010
|
}
|
|
15977
|
-
|
|
15978
|
-
|
|
16011
|
+
link = make();
|
|
16012
|
+
link.start();
|
|
16013
|
+
startNative();
|
|
16014
|
+
from.stop(false).catch(() => {});
|
|
16015
|
+
};
|
|
15979
16016
|
const startNative = () => {
|
|
15980
|
-
|
|
15981
|
-
|
|
16017
|
+
const target = link;
|
|
16018
|
+
if (!target || started.has(target)) return;
|
|
16019
|
+
started.add(target);
|
|
15982
16020
|
(async () => {
|
|
15983
16021
|
for (const [transport, factory] of Object.entries(options.nativeTransports ?? {})) {
|
|
15984
|
-
if (!factory ||
|
|
16022
|
+
if (!factory || link !== target || target.availableTransports.includes(transport)) continue;
|
|
15985
16023
|
try {
|
|
15986
16024
|
const endpoint = await factory(randomSeed());
|
|
15987
|
-
if (
|
|
16025
|
+
if (link !== target) {
|
|
15988
16026
|
await endpoint.close();
|
|
15989
16027
|
return;
|
|
15990
16028
|
}
|
|
15991
|
-
|
|
16029
|
+
target.registerEndpoint(endpoint);
|
|
15992
16030
|
} catch {}
|
|
15993
16031
|
}
|
|
15994
16032
|
})();
|
|
15995
16033
|
};
|
|
16034
|
+
const started = /* @__PURE__ */ new WeakSet();
|
|
16035
|
+
link = make();
|
|
15996
16036
|
link.start();
|
|
15997
16037
|
if (!rtc) startNative();
|
|
15998
16038
|
return {
|
|
@@ -16001,6 +16041,7 @@ function ghostLinkEnrollChannel(options) {
|
|
|
16001
16041
|
const running = link;
|
|
16002
16042
|
link = null;
|
|
16003
16043
|
if (reput) clearInterval(reput);
|
|
16044
|
+
if (rtcTimer) clearTimeout(rtcTimer);
|
|
16004
16045
|
await running?.stop().catch(() => {});
|
|
16005
16046
|
}
|
|
16006
16047
|
};
|
|
@@ -17158,6 +17199,8 @@ function handoffNotices(was, handoff, session) {
|
|
|
17158
17199
|
*/
|
|
17159
17200
|
var NATIVE_RETRY_MS$1 = 1e4;
|
|
17160
17201
|
var NATIVE_RETRY_MAX_MS = 12e4;
|
|
17202
|
+
/** The other device is there and no session opened over WebRTC in this long: the link goes on without it (`withoutRtc`). */
|
|
17203
|
+
var DEVICE_RTC_MS = 2e4;
|
|
17161
17204
|
/** How often a standby reads the turn while its screen shows (WISP 06 § When a device checks), and the jitter on it. */
|
|
17162
17205
|
var STANDBY_TURN_EVERY_MS = 6e5;
|
|
17163
17206
|
var STANDBY_TURN_JITTER_MS = 6e4;
|
|
@@ -17353,9 +17396,9 @@ var DeviceLinks = class {
|
|
|
17353
17396
|
}
|
|
17354
17397
|
return wanted;
|
|
17355
17398
|
}
|
|
17356
|
-
open(want) {
|
|
17399
|
+
open(want, rtcOff = false) {
|
|
17357
17400
|
const signer = this.key;
|
|
17358
|
-
const rtc = !!this.createPeerConnection;
|
|
17401
|
+
const rtc = !!this.createPeerConnection && !rtcOff;
|
|
17359
17402
|
const running = {
|
|
17360
17403
|
id: want.id,
|
|
17361
17404
|
d: want.id.slice(0, want.id.indexOf("|")),
|
|
@@ -17369,6 +17412,7 @@ var DeviceLinks = class {
|
|
|
17369
17412
|
starting: /* @__PURE__ */ new Set(),
|
|
17370
17413
|
moved: /* @__PURE__ */ new Set(),
|
|
17371
17414
|
nativeMisses: 0,
|
|
17415
|
+
rtcOff,
|
|
17372
17416
|
waiting: /* @__PURE__ */ new Map()
|
|
17373
17417
|
};
|
|
17374
17418
|
running.link = new GhostLink({
|
|
@@ -17410,6 +17454,10 @@ var DeviceLinks = class {
|
|
|
17410
17454
|
this.changed();
|
|
17411
17455
|
},
|
|
17412
17456
|
onDataLinkState: (state) => {
|
|
17457
|
+
if (state === "open" && running.rtcWait) {
|
|
17458
|
+
clearTimeout(running.rtcWait);
|
|
17459
|
+
running.rtcWait = void 0;
|
|
17460
|
+
}
|
|
17413
17461
|
if (state !== "open") {
|
|
17414
17462
|
running.agreed = false;
|
|
17415
17463
|
this.failPings(running, "The device link closed");
|
|
@@ -17422,6 +17470,18 @@ var DeviceLinks = class {
|
|
|
17422
17470
|
this.changed();
|
|
17423
17471
|
},
|
|
17424
17472
|
onDeviceFrame: (frame) => this.receive(running, frame),
|
|
17473
|
+
onRtcStalled: () => this.withoutRtc(running),
|
|
17474
|
+
onDirectEvidence: (evidence) => {
|
|
17475
|
+
if (evidence !== "open" && evidence !== "closed") this.withoutRtc(running);
|
|
17476
|
+
},
|
|
17477
|
+
onAnswersRefused: () => this.withoutRtc(running),
|
|
17478
|
+
onPresence: (presence) => {
|
|
17479
|
+
if (!presence.online || running.rtcOff || running.rtcWait || running.link.isDataLinkOpen) return;
|
|
17480
|
+
running.rtcWait = setTimeout(() => {
|
|
17481
|
+
running.rtcWait = void 0;
|
|
17482
|
+
if (!running.link.isDataLinkOpen) this.withoutRtc(running);
|
|
17483
|
+
}, DEVICE_RTC_MS);
|
|
17484
|
+
},
|
|
17425
17485
|
onPacketTransports: (transports) => {
|
|
17426
17486
|
if (!running.native && !transports.includes("webrtc/1")) this.startNative(running);
|
|
17427
17487
|
},
|
|
@@ -17789,14 +17849,47 @@ var DeviceLinks = class {
|
|
|
17789
17849
|
waiter.reject(new Error(why));
|
|
17790
17850
|
}
|
|
17791
17851
|
}
|
|
17792
|
-
|
|
17852
|
+
/** `announce`: the link says goodbye (false where another link on the same keys takes its place at once). */
|
|
17853
|
+
async close(running, announce = true) {
|
|
17793
17854
|
if (running.nativeRetry) {
|
|
17794
17855
|
clearTimeout(running.nativeRetry);
|
|
17795
17856
|
running.nativeRetry = void 0;
|
|
17796
17857
|
}
|
|
17858
|
+
if (running.rtcWait) {
|
|
17859
|
+
clearTimeout(running.rtcWait);
|
|
17860
|
+
running.rtcWait = void 0;
|
|
17861
|
+
}
|
|
17797
17862
|
this.failPings(running, "The device link closed");
|
|
17798
17863
|
running.agreed = false;
|
|
17799
|
-
await running.link.stop().catch(() => {});
|
|
17864
|
+
await running.link.stop(announce).catch(() => {});
|
|
17865
|
+
}
|
|
17866
|
+
/**
|
|
17867
|
+
* WebRTC on both devices that connects nothing (two browsers whose host candidates the other does not resolve, a
|
|
17868
|
+
* router that does not hairpin, no TURN): neither packet says it has no WebRTC, so neither device starts a native
|
|
17869
|
+
* endpoint, and the link never went live. It starts again as on an app with no WebRTC, for this run, as a group's edge
|
|
17870
|
+
* does (node.ts `edgeWithoutRtc`): its native endpoints run and its packet lists no `webrtc/1`, the other device starts
|
|
17871
|
+
* its own for it as for a Linux Desktop, and the two meet over Iroh's relay. Only with no session open, and only
|
|
17872
|
+
* where this app has a native transport to go on with.
|
|
17873
|
+
*/
|
|
17874
|
+
withoutRtc(running) {
|
|
17875
|
+
if (this.stopped || running.rtcOff || running.native || !this.createPeerConnection || running.link.isDataLinkOpen) return;
|
|
17876
|
+
if (!Object.values(this.nativeFactories()).some(Boolean)) return;
|
|
17877
|
+
const run = this.queue.catch(() => {}).then(async () => {
|
|
17878
|
+
if (this.stopped || this.running.get(running.id) !== running || running.link.isDataLinkOpen) return;
|
|
17879
|
+
this.running.delete(running.id);
|
|
17880
|
+
await this.close(running, false);
|
|
17881
|
+
if (this.stopped) return;
|
|
17882
|
+
this.open({
|
|
17883
|
+
id: running.id,
|
|
17884
|
+
d: fromBase64Url(running.d),
|
|
17885
|
+
key: running.key,
|
|
17886
|
+
name: running.name,
|
|
17887
|
+
slot: running.slot,
|
|
17888
|
+
earlier: running.earlier
|
|
17889
|
+
}, true);
|
|
17890
|
+
this.changed();
|
|
17891
|
+
});
|
|
17892
|
+
this.queue = run;
|
|
17800
17893
|
}
|
|
17801
17894
|
find(key) {
|
|
17802
17895
|
const all = [...this.running.values()].filter((r) => r.key === key);
|
|
@@ -18722,8 +18815,15 @@ var HandoffGiver = class {
|
|
|
18722
18815
|
});
|
|
18723
18816
|
const parts = [...send];
|
|
18724
18817
|
if (pass === 2) {
|
|
18725
|
-
|
|
18726
|
-
|
|
18818
|
+
this.bundleMade ??= this.ports.source.bundle().then((bytes) => ({
|
|
18819
|
+
bytes,
|
|
18820
|
+
digest: toBase64Url(sha256(bytes))
|
|
18821
|
+
}));
|
|
18822
|
+
const made = this.bundleMade;
|
|
18823
|
+
const { bytes: bundle, digest } = await made.catch((error) => {
|
|
18824
|
+
if (this.bundleMade === made) this.bundleMade = null;
|
|
18825
|
+
throw error;
|
|
18826
|
+
});
|
|
18727
18827
|
parts.push([
|
|
18728
18828
|
"db/peer",
|
|
18729
18829
|
bundle.length,
|
|
@@ -18771,6 +18871,7 @@ var HandoffGiver = class {
|
|
|
18771
18871
|
else this.arm(HANDOFF_TIMINGS.verifiedMs, () => this.backToActive());
|
|
18772
18872
|
}
|
|
18773
18873
|
bundlePart = null;
|
|
18874
|
+
bundleMade = null;
|
|
18774
18875
|
paused = false;
|
|
18775
18876
|
stallTimer;
|
|
18776
18877
|
laterParts = [];
|
|
@@ -18855,6 +18956,7 @@ var HandoffGiver = class {
|
|
|
18855
18956
|
}
|
|
18856
18957
|
});
|
|
18857
18958
|
if (this.timer) clearTimeout(this.timer);
|
|
18959
|
+
this.bundleMade = null;
|
|
18858
18960
|
this.phase = "released";
|
|
18859
18961
|
this.out({
|
|
18860
18962
|
...handoffReleaseFrame(release),
|
|
@@ -18867,6 +18969,7 @@ var HandoffGiver = class {
|
|
|
18867
18969
|
async backToActive() {
|
|
18868
18970
|
if (this.phase === "released" || this.phase === "failed") return;
|
|
18869
18971
|
this.sender.stop();
|
|
18972
|
+
this.bundleMade = null;
|
|
18870
18973
|
clearInterval(this.stuckTimer);
|
|
18871
18974
|
if (this.timer) {
|
|
18872
18975
|
clearTimeout(this.timer);
|
|
@@ -18893,6 +18996,7 @@ var HandoffGiver = class {
|
|
|
18893
18996
|
this.planned = null;
|
|
18894
18997
|
this.pake = null;
|
|
18895
18998
|
this.secret = null;
|
|
18999
|
+
this.bundleMade = null;
|
|
18896
19000
|
this.offerHellos.clear();
|
|
18897
19001
|
this.sender = new PartSender(this.now);
|
|
18898
19002
|
}
|
|
@@ -18908,6 +19012,7 @@ var HandoffGiver = class {
|
|
|
18908
19012
|
this.have = null;
|
|
18909
19013
|
this.planned = null;
|
|
18910
19014
|
this.secret = null;
|
|
19015
|
+
this.bundleMade = null;
|
|
18911
19016
|
this.changed();
|
|
18912
19017
|
}
|
|
18913
19018
|
fail(failure, why) {
|
|
@@ -22706,7 +22811,7 @@ var Reactions = class {
|
|
|
22706
22811
|
take(chat, by, reaction) {
|
|
22707
22812
|
return this.run(async () => {
|
|
22708
22813
|
const target = await this.find(chat, reaction.id, true);
|
|
22709
|
-
if (!target) return this.wait(chat, by, reaction);
|
|
22814
|
+
if (!target) return await this.wait(chat, by, reaction);
|
|
22710
22815
|
if (!reactionIsNewer(target.reactions?.[by], reaction.n)) return "stale";
|
|
22711
22816
|
await this.write(chat, target, by, reaction);
|
|
22712
22817
|
return "applied";
|
|
@@ -22792,8 +22897,10 @@ var Reactions = class {
|
|
|
22792
22897
|
return this.run(async () => {
|
|
22793
22898
|
const now = this.now(), all = (this.waiting.get(message.linkId) ?? []).filter((w) => w.until > now);
|
|
22794
22899
|
const mine = all.filter((w) => w.reaction.id === id).sort((a, b) => a.reaction.n - b.reaction.n);
|
|
22795
|
-
|
|
22900
|
+
const rest = all.filter((w) => w.reaction.id !== id);
|
|
22901
|
+
this.waiting.set(message.linkId, rest);
|
|
22796
22902
|
for (const { by, reaction } of mine) await this.write(message.linkId, message, by, reaction);
|
|
22903
|
+
await this.keep(message.linkId, rest).catch(() => {});
|
|
22797
22904
|
});
|
|
22798
22905
|
}
|
|
22799
22906
|
/** The row I react to: by its id here, as the pages name it, read alone; else by the id both sides know it by. */
|
|
@@ -22859,10 +22966,36 @@ var Reactions = class {
|
|
|
22859
22966
|
}] : [];
|
|
22860
22967
|
});
|
|
22861
22968
|
if (!found.length) return;
|
|
22862
|
-
|
|
22969
|
+
const rest = list.filter((w) => !found.some((f) => f.by === w.by && f.reaction === w.reaction));
|
|
22970
|
+
this.waiting.set(chat, rest);
|
|
22971
|
+
for (const { target, by, reaction } of found.sort((a, b) => a.reaction.n - b.reaction.n)) await this.write(chat, target, by, reaction);
|
|
22972
|
+
await this.keep(chat, rest).catch(() => {});
|
|
22973
|
+
});
|
|
22974
|
+
}
|
|
22975
|
+
/**
|
|
22976
|
+
* At start, what waited in a 1:1 chat when the engine stopped (`ReactionsHost.keep`): it waits again until its time,
|
|
22977
|
+
* and one whose message landed before the stop wrote it is written now. `messages`: the chat's history.
|
|
22978
|
+
*/
|
|
22979
|
+
restore(chat, waiting, messages) {
|
|
22980
|
+
return this.run(async () => {
|
|
22981
|
+
const now = this.now(), list = waiting.filter((w) => w.until > now);
|
|
22982
|
+
const found = list.flatMap((w) => {
|
|
22983
|
+
const target = reactionTarget(messages, w.reaction.id, false);
|
|
22984
|
+
return target ? [{
|
|
22985
|
+
...w,
|
|
22986
|
+
target
|
|
22987
|
+
}] : [];
|
|
22988
|
+
});
|
|
22989
|
+
const rest = list.filter((w) => !found.some((f) => f.by === w.by && f.reaction === w.reaction));
|
|
22990
|
+
this.waiting.set(chat, [...this.waiting.get(chat) ?? [], ...rest]);
|
|
22863
22991
|
for (const { target, by, reaction } of found.sort((a, b) => a.reaction.n - b.reaction.n)) await this.write(chat, target, by, reaction);
|
|
22992
|
+
if (rest.length < waiting.length) await this.keep(chat, this.waiting.get(chat)).catch(() => {});
|
|
22864
22993
|
});
|
|
22865
22994
|
}
|
|
22995
|
+
/** What waits in a 1:1 chat, on disk (`ReactionsHost.keep`); a group's stays in memory. */
|
|
22996
|
+
keep(chat, waiting) {
|
|
22997
|
+
return isGroup$1(chat) || !this.host.keep ? Promise.resolve() : this.host.keep(chat, [...waiting]);
|
|
22998
|
+
}
|
|
22866
22999
|
/** A chat is gone: nothing waits for it any more, and my highest number in it is read again if it comes back. */
|
|
22867
23000
|
forget(chat) {
|
|
22868
23001
|
this.dropHeld(chat);
|
|
@@ -22871,7 +23004,8 @@ var Reactions = class {
|
|
|
22871
23004
|
clearTimeout(this.lookups.get(chat)?.timer);
|
|
22872
23005
|
this.lookups.delete(chat);
|
|
22873
23006
|
}
|
|
22874
|
-
|
|
23007
|
+
/** A reaction to a message not here yet waits for it: in a 1:1 chat, on disk before it is confirmed (`keep`). */
|
|
23008
|
+
async wait(chat, by, reaction) {
|
|
22875
23009
|
const now = this.now();
|
|
22876
23010
|
const list = (this.waiting.get(chat) ?? []).filter((w) => w.until > now);
|
|
22877
23011
|
const same = list.find((w) => w.by === by && w.reaction.id === reaction.id);
|
|
@@ -22879,11 +23013,18 @@ var Reactions = class {
|
|
|
22879
23013
|
const kept = list.filter((w) => w !== same);
|
|
22880
23014
|
this.waiting.set(chat, kept);
|
|
22881
23015
|
if (kept.filter((w) => w.by === by).length >= REACTION_LIMITS.buffer) return "dropped";
|
|
22882
|
-
|
|
23016
|
+
const entry = {
|
|
22883
23017
|
by,
|
|
22884
23018
|
reaction,
|
|
22885
23019
|
until: now + REACTION_LIMITS.bufferMs
|
|
22886
|
-
}
|
|
23020
|
+
};
|
|
23021
|
+
kept.push(entry);
|
|
23022
|
+
try {
|
|
23023
|
+
await this.keep(chat, kept);
|
|
23024
|
+
} catch {
|
|
23025
|
+
kept.splice(kept.indexOf(entry), 1);
|
|
23026
|
+
return "dropped";
|
|
23027
|
+
}
|
|
22887
23028
|
return "waiting";
|
|
22888
23029
|
}
|
|
22889
23030
|
async write(chat, target, by, reaction) {
|
|
@@ -33639,6 +33780,8 @@ var CashuWallet = class CashuWallet {
|
|
|
33639
33780
|
async quoteInvoice(invoice, network) {
|
|
33640
33781
|
let lastError = /* @__PURE__ */ new Error("Add a mint in Settings first");
|
|
33641
33782
|
let mints = this.getMints(network);
|
|
33783
|
+
/** The most any mint asked could pay with its fee on top: a Max comes down to it. */
|
|
33784
|
+
let room = 0;
|
|
33642
33785
|
const decoded = decodeBolt11(invoice);
|
|
33643
33786
|
if (!decoded) throw new Error("That is not an invoice this wallet can pay");
|
|
33644
33787
|
if (decoded.amountSat === null) throw new Error("Invoices without an amount are not supported");
|
|
@@ -33651,8 +33794,10 @@ var CashuWallet = class CashuWallet {
|
|
|
33651
33794
|
const amount = quote.amount.toNumber();
|
|
33652
33795
|
const feeReserve = quote.fee_reserve.toNumber();
|
|
33653
33796
|
if (quoteMismatch(quote, decoded.invoice, decoded.amountSat)) throw new Error(MINT_QUOTE_MISMATCH);
|
|
33654
|
-
|
|
33655
|
-
|
|
33797
|
+
const balance = await this.balanceAt(mint);
|
|
33798
|
+
if (balance < amount + feeReserve) {
|
|
33799
|
+
room = Math.max(room, balance - feeReserve);
|
|
33800
|
+
lastError = room > 0 ? engineError("notEnoughForFee", { amount: room }) : engineError("notEnoughSats");
|
|
33656
33801
|
continue;
|
|
33657
33802
|
}
|
|
33658
33803
|
this.shownQuotes.set(quote.quote, {
|
|
@@ -37921,8 +38066,9 @@ var GhostlyNode = class GhostlyNode {
|
|
|
37921
38066
|
transferred: message.file.size,
|
|
37922
38067
|
size: message.file.size
|
|
37923
38068
|
};
|
|
37924
|
-
this.transfers.set(message.file.id, transfer);
|
|
37925
38069
|
await fileStore.updateTransfer(message.file.id, transfer).catch(() => {});
|
|
38070
|
+
this.transfers.set(message.file.id, transfer);
|
|
38071
|
+
if (transfer.state === "done") this.brief(message.file.id);
|
|
37926
38072
|
}
|
|
37927
38073
|
if (message && state !== "failed") this.messageFeedback("sent", message);
|
|
37928
38074
|
await this.messagesChanged(linkId, [messageId]);
|
|
@@ -38021,6 +38167,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
38021
38167
|
transferred: wire.size,
|
|
38022
38168
|
size: wire.size
|
|
38023
38169
|
});
|
|
38170
|
+
this.brief(file.id);
|
|
38024
38171
|
await this.storeMessage({
|
|
38025
38172
|
linkId,
|
|
38026
38173
|
id: `peer_${wire.wireId}`,
|
|
@@ -38325,6 +38472,14 @@ var GhostlyNode = class GhostlyNode {
|
|
|
38325
38472
|
this.emitState();
|
|
38326
38473
|
},
|
|
38327
38474
|
notify: (chat, key) => this.feedback("reaction", `${chat}:${key}`, chat),
|
|
38475
|
+
keep: async (chat, reactionsWaiting) => {
|
|
38476
|
+
const live = this.links.get(chat);
|
|
38477
|
+
if (live) live.stored = {
|
|
38478
|
+
...live.stored,
|
|
38479
|
+
reactionsWaiting
|
|
38480
|
+
};
|
|
38481
|
+
await db.patchLink(chat, { reactionsWaiting });
|
|
38482
|
+
},
|
|
38328
38483
|
believed: (chat, by) => {
|
|
38329
38484
|
const membership = this.membership(chat.slice(6));
|
|
38330
38485
|
return !!membership?.members.has(by) && by !== membership.me;
|
|
@@ -38450,10 +38605,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
38450
38605
|
groupFiles: {
|
|
38451
38606
|
store: storedGroupFiles,
|
|
38452
38607
|
transfers: this.transfers,
|
|
38453
|
-
brief: (id) =>
|
|
38454
|
-
const view = this.transfers.get(id);
|
|
38455
|
-
if (view) this.briefViews.set(id, view);
|
|
38456
|
-
},
|
|
38608
|
+
brief: (id) => this.brief(id),
|
|
38457
38609
|
settings: () => ({
|
|
38458
38610
|
autoDownloads: this.settings.autoDownloads !== false,
|
|
38459
38611
|
serveFiles: this.settings.serveFiles !== false
|
|
@@ -38949,6 +39101,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
38949
39101
|
for (const message of messages.slice(-20)) this.clockSample(message);
|
|
38950
39102
|
const note = latestReaction(messages);
|
|
38951
39103
|
if (note) this.reactionNotes.set(stored.id, note);
|
|
39104
|
+
if (stored.reactionsWaiting?.length) await this.reactions.restore(stored.id, stored.reactionsWaiting, messages);
|
|
38952
39105
|
if (stored.profile) await this.outboxFor(stored.id).recover(messages);
|
|
38953
39106
|
}
|
|
38954
39107
|
this.transfersRestored = true;
|
|
@@ -42299,6 +42452,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
42299
42452
|
});
|
|
42300
42453
|
const state = this.transfers.get(fileId);
|
|
42301
42454
|
fileStore.updateTransfer(fileId, state).catch(() => {});
|
|
42455
|
+
if (!error) this.brief(fileId);
|
|
42302
42456
|
this.emitState();
|
|
42303
42457
|
}
|
|
42304
42458
|
async setDeliveryMode({ linkId, mode }) {
|
|
@@ -46287,7 +46441,7 @@ var GhostlyNode = class GhostlyNode {
|
|
|
46287
46441
|
nativeFactoriesFor(relayOnly) {
|
|
46288
46442
|
const relay = relayOnly || this.relaysHyperdhtNatively ? this.hyperdhtRelay : "";
|
|
46289
46443
|
return {
|
|
46290
|
-
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-
|
|
46444
|
+
...relay ? { "hyperdht/1": async (seedB64) => (await import("./hyperdhtRelay-D1rj84v2.js")).createRelayedHyperEndpoint(seedB64, relay) } : {},
|
|
46291
46445
|
...relayOnly ? {} : this.options.nativeTransports,
|
|
46292
46446
|
...this.ownIrohRelays && !relayOnly ? { "iroh/1": (seedB64) => this.options.nativeTransports["iroh/1"](seedB64, this.settings.irohRelays?.length ? { relays: [...this.settings.irohRelays] } : {}) } : {},
|
|
46293
46447
|
...this.options.irohWeb ? { "iroh/1": (seedB64) => createIrohWebEndpoint(seedB64, { relays: this.irohRelays }) } : {}
|
|
@@ -47090,6 +47244,11 @@ var GhostlyNode = class GhostlyNode {
|
|
|
47090
47244
|
this.events.onState(this.getState());
|
|
47091
47245
|
this.dropBriefViews();
|
|
47092
47246
|
}
|
|
47247
|
+
/** `id`'s view goes in the next state sent, and then away (`briefViews`). */
|
|
47248
|
+
brief(id) {
|
|
47249
|
+
const view = this.transfers.get(id);
|
|
47250
|
+
if (view) this.briefViews.set(id, view);
|
|
47251
|
+
}
|
|
47093
47252
|
/** A state went with the brief views: they go, so the next states do not carry them (`briefViews`). */
|
|
47094
47253
|
dropBriefViews() {
|
|
47095
47254
|
for (const [id, view] of this.briefViews) if (this.transfers.get(id) === view) this.transfers.delete(id);
|
|
@@ -47376,4 +47535,4 @@ function signalKind(signal) {
|
|
|
47376
47535
|
//#endregion
|
|
47377
47536
|
export { EngineServer };
|
|
47378
47537
|
|
|
47379
|
-
//# sourceMappingURL=server-
|
|
47538
|
+
//# sourceMappingURL=server-CnPj9wWh.js.map
|