@ghostlytools/cli 1.11.4 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -11
- package/dist/assets/{api-MYc6QNRs.js → api-DLzCtePC.js} +363 -125
- package/dist/assets/api-DLzCtePC.js.map +1 -0
- package/dist/assets/{api-BwyFq4lA.js → api-DYMKyb1k.js} +2 -2
- package/dist/assets/{apiKit-CfsNx9ZR.js → apiKit-CVaEzKWQ.js} +48 -11
- package/dist/assets/apiKit-CVaEzKWQ.js.map +1 -0
- package/dist/assets/appFetch-D56GsYuq.js +602 -0
- package/dist/assets/appFetch-D56GsYuq.js.map +1 -0
- package/dist/assets/apps-BPFW19Wc.js +1 -0
- package/dist/assets/{apps-h12II1us.js → apps-XnZ8VEuj.js} +20 -14
- package/dist/assets/apps-XnZ8VEuj.js.map +1 -0
- package/dist/assets/{argon2id-088uQfnH.js → argon2id-B9wFdSj6.js} +2 -3
- package/dist/assets/{argon2id-088uQfnH.js.map → argon2id-B9wFdSj6.js.map} +1 -1
- package/dist/assets/{arkade-Bw_4PZRG.js → arkade-DryM-q5n.js} +6 -7
- package/dist/assets/arkade-DryM-q5n.js.map +1 -0
- package/dist/assets/backup-COX6j1_W.js +1 -0
- package/dist/assets/{backup-Chvy79SN.js → backup-DpyvT9Z6.js} +66 -21
- package/dist/assets/backup-DpyvT9Z6.js.map +1 -0
- package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js +5 -0
- package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +1 -0
- package/dist/assets/{bark_ffi_wasm_bg-Bxru_BVW.wasm → bark_ffi_wasm_bg-VNmaJsc9.wasm} +0 -0
- package/dist/assets/{bitcoind-CdSmvy2y.js → bitcoind-DTsrd7TF.js} +4 -5
- package/dist/assets/{bitcoind-CdSmvy2y.js.map → bitcoind-DTsrd7TF.js.map} +1 -1
- package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js +5 -0
- package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +1 -0
- package/dist/assets/bitcoindevkit_bg-DXil67yS.wasm +0 -0
- package/dist/assets/{blobFiles-BmsrvZc3.js → blobFiles-DDs34n0r.js} +4 -5
- package/dist/assets/{blobFiles-BmsrvZc3.js.map → blobFiles-DDs34n0r.js.map} +1 -1
- package/dist/assets/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/dist/assets/buttons-Bq7pTXqF.js +1 -0
- package/dist/assets/{buttons-BgoExb4E.js → buttons-BvWqHJeh.js} +45 -23
- package/dist/assets/buttons-BvWqHJeh.js.map +1 -0
- package/dist/assets/bytes-C1DNGY18.js +132 -0
- package/dist/assets/bytes-C1DNGY18.js.map +1 -0
- package/dist/assets/{childEnv-K_IzUqQx.js → childEnv-C-99hdbL.js} +2 -3
- package/dist/assets/{childEnv-K_IzUqQx.js.map → childEnv-C-99hdbL.js.map} +1 -1
- package/dist/assets/{client-DY8tZZWi.js → client-kGZ3ZdUW.js} +5 -8
- package/dist/assets/{client-DY8tZZWi.js.map → client-kGZ3ZdUW.js.map} +1 -1
- package/dist/assets/{codec-BnMg-Grj.js → codec-B2rH1mfx.js} +2 -4
- package/dist/assets/{codec-BnMg-Grj.js.map → codec-B2rH1mfx.js.map} +1 -1
- package/dist/assets/domainProofs-BDNP1dIy.js +280 -0
- package/dist/assets/domainProofs-BDNP1dIy.js.map +1 -0
- package/dist/assets/{endpoint-DarqblYE.js → endpoint-B0vE5ojY.js} +421 -420
- package/dist/assets/endpoint-B0vE5ojY.js.map +1 -0
- package/dist/assets/engineErrors--9hfgKlK.js +150 -0
- package/dist/assets/engineErrors--9hfgKlK.js.map +1 -0
- package/dist/assets/{envelope-CdV7vHVZ.js → envelope-Bi2kMqbp.js} +3 -4
- package/dist/assets/{envelope-CdV7vHVZ.js.map → envelope-Bi2kMqbp.js.map} +1 -1
- package/dist/assets/{errors-CAh6GLJZ.js → errors-DDLFO4Gf.js} +5 -4
- package/dist/assets/errors-DDLFO4Gf.js.map +1 -0
- package/dist/assets/{fedimintSdk-CPFfVK-G.js → fedimintSdk-D-6H9Pe7.js} +4 -5
- package/dist/assets/{fedimintSdk-CPFfVK-G.js.map → fedimintSdk-D-6H9Pe7.js.map} +1 -1
- package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js +5 -0
- package/dist/assets/{fedimint_client_wasm_bg-BtHHlFpp.js.map → fedimint_client_wasm_bg-Cr5xGD-w.js.map} +1 -1
- package/dist/assets/fileBytes-CCKbwqG_.js +1 -0
- package/dist/assets/{fileBytes-BLPZq9YU.js → fileBytes-CfvUXdSy.js} +5 -7
- package/dist/assets/fileBytes-CfvUXdSy.js.map +1 -0
- package/dist/assets/{fileBytes-B0z9A6Le.js → fileBytes-tj6-VZcB.js} +3 -4
- package/dist/assets/{fileBytes-B0z9A6Le.js.map → fileBytes-tj6-VZcB.js.map} +1 -1
- package/dist/assets/fileBytesIdb-B0zzJ6p7.js +1 -0
- package/dist/assets/{fileBytesIdb-Bmlrl9EO.js → fileBytesIdb-BJirUAjI.js} +4 -5
- package/dist/assets/{fileBytesIdb-Bmlrl9EO.js.map → fileBytesIdb-BJirUAjI.js.map} +1 -1
- package/dist/assets/{fileBytesOpfs-DBS0kbPT.js → fileBytesOpfs-DRUYLER4.js} +4 -5
- package/dist/assets/{fileBytesOpfs-DBS0kbPT.js.map → fileBytesOpfs-DRUYLER4.js.map} +1 -1
- package/dist/assets/{fixedHosts-CbgqrIKs.js → fixedHosts-CPSsGOI2.js} +4 -5
- package/dist/assets/{fixedHosts-CbgqrIKs.js.map → fixedHosts-CPSsGOI2.js.map} +1 -1
- package/dist/assets/{ghostly_iroh_web-BzAXJUYH.js → ghostly_iroh_web-DIj5xGmR.js} +2 -3
- package/dist/assets/{ghostly_iroh_web-BzAXJUYH.js.map → ghostly_iroh_web-DIj5xGmR.js.map} +1 -1
- package/dist/assets/{src-DJe-OYxd.js → groupMeta-DTQAJG50.js} +4693 -24241
- package/dist/assets/groupMeta-DTQAJG50.js.map +1 -0
- package/dist/assets/{host-C0NMNQLl.js → host-z0FAHP9Z.js} +209 -134
- package/dist/assets/host-z0FAHP9Z.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-Dz7pvcBA.js → hyperdhtRelay-CvsAfQRQ.js} +5 -6
- package/dist/assets/hyperdhtRelay-CvsAfQRQ.js.map +1 -0
- package/dist/assets/hyperdhtRelay-bjNGacf5.js +32 -0
- package/dist/assets/hyperdhtRelay-bjNGacf5.js.map +1 -0
- package/dist/assets/{idb-CEuoNsTv.js → idb-ewvbqyDI.js} +2 -3
- package/dist/assets/{idb-CEuoNsTv.js.map → idb-ewvbqyDI.js.map} +1 -1
- package/dist/assets/identityProofs-Cksc_K7_.js +940 -0
- package/dist/assets/identityProofs-Cksc_K7_.js.map +1 -0
- package/dist/assets/{irohWeb-caAj4Dms.js → irohWeb-CLBx5MIv.js} +3061 -86
- package/dist/assets/irohWeb-CLBx5MIv.js.map +1 -0
- package/dist/assets/joinTrace-CBr1jbch.js +1 -0
- package/dist/assets/{joinTrace-CjRDFy85.js → joinTrace-xKBe73j9.js} +2 -3
- package/dist/assets/{joinTrace-CjRDFy85.js.map → joinTrace-xKBe73j9.js.map} +1 -1
- package/dist/assets/{legacy_ciphers-JJOu0JXL.js → legacy_ciphers-BnYATjxo.js} +2 -3
- package/dist/assets/{legacy_ciphers-JJOu0JXL.js.map → legacy_ciphers-BnYATjxo.js.map} +1 -1
- package/dist/assets/linkPreview-DdMf-YAc.js +252 -0
- package/dist/assets/linkPreview-DdMf-YAc.js.map +1 -0
- package/dist/assets/{main-C6t5zrD5.js → main-CVqkvuIo.js} +268 -111
- package/dist/assets/main-CVqkvuIo.js.map +1 -0
- package/dist/assets/{mainline-DCuGUSZF.js → mainline-CVrd0C1n.js} +72 -18
- package/dist/assets/mainline-CVrd0C1n.js.map +1 -0
- package/dist/assets/mints-BcBODVVW.js +1 -0
- package/dist/assets/{mints-j5XAOk4f.js → mints-CMDLbMeH.js} +8 -6
- package/dist/assets/mints-CMDLbMeH.js.map +1 -0
- package/dist/assets/{nacl-fast-CDhNCYHs.js → nacl-fast-B1ThWvuM.js} +2 -3
- package/dist/assets/{nacl-fast-CDhNCYHs.js.map → nacl-fast-B1ThWvuM.js.map} +1 -1
- package/dist/assets/{networkReason-BbQW1Xpc.js → networkReason-Be-hMghr.js} +10 -14
- package/dist/assets/{networkReason-BbQW1Xpc.js.map → networkReason-Be-hMghr.js.map} +1 -1
- package/dist/assets/{noble_curves-DDWn5AH0.js → noble_curves-DqpNlhAU.js} +3 -4
- package/dist/assets/{noble_curves-DDWn5AH0.js.map → noble_curves-DqpNlhAU.js.map} +1 -1
- package/dist/assets/{noble_hashes-B7AZyFyS.js → noble_hashes-LFe1N2xt.js} +3 -4
- package/dist/assets/{noble_hashes-B7AZyFyS.js.map → noble_hashes-LFe1N2xt.js.map} +1 -1
- package/dist/assets/{nwc-CSDRMZ0e.js → nwc-DKE2FXr6.js} +5 -6
- package/dist/assets/{nwc-CSDRMZ0e.js.map → nwc-DKE2FXr6.js.map} +1 -1
- package/dist/assets/nwcProvider-pL2XqSbW.js +208 -0
- package/dist/assets/nwcProvider-pL2XqSbW.js.map +1 -0
- package/dist/assets/{openpgp-BBFr-zHQ.js → openpgp-LkR_Zof0.js} +14 -15
- package/dist/assets/{openpgp-BBFr-zHQ.js.map → openpgp-LkR_Zof0.js.map} +1 -1
- package/dist/assets/ownDid-DY3rYqDI.js +862 -0
- package/dist/assets/ownDid-DY3rYqDI.js.map +1 -0
- package/dist/assets/{ownStatus-BoTf5WqQ.js → ownStatus-DMEhrpkd.js} +69 -20
- package/dist/assets/ownStatus-DMEhrpkd.js.map +1 -0
- package/dist/assets/pairedTransports-BKmvlKz1.js +581 -0
- package/dist/assets/pairedTransports-BKmvlKz1.js.map +1 -0
- package/dist/assets/paymentIntent-DySU3Ajm.js +349 -0
- package/dist/assets/paymentIntent-DySU3Ajm.js.map +1 -0
- package/dist/assets/pkarr-BQo4PcCg.js +367 -0
- package/dist/assets/pkarr-BQo4PcCg.js.map +1 -0
- package/dist/assets/{profiles-DszHjEJi.js → profiles-BFSGqDFC.js} +9 -10
- package/dist/assets/profiles-BFSGqDFC.js.map +1 -0
- package/dist/assets/registry-B15Yg_1C.js +1 -0
- package/dist/assets/{registry-Da-r6eC3.js → registry-rXgaZeNn.js} +1261 -53
- package/dist/assets/registry-rXgaZeNn.js.map +1 -0
- package/dist/assets/relay-Cjfmdec0.js +2219 -0
- package/dist/assets/relay-Cjfmdec0.js.map +1 -0
- package/dist/assets/resolve-CIc3KZMV.js +970 -0
- package/dist/assets/resolve-CIc3KZMV.js.map +1 -0
- package/dist/assets/{restoredRows-C3LcxmOw.js → restoredRows-D_WSHE7H.js} +3 -4
- package/dist/assets/{restoredRows-C3LcxmOw.js.map → restoredRows-D_WSHE7H.js.map} +1 -1
- package/dist/assets/{secretGuard-CsVHDdYk.js → secretGuard-B4-LlMjv.js} +11 -14
- package/dist/assets/{secretGuard-CsVHDdYk.js.map → secretGuard-B4-LlMjv.js.map} +1 -1
- package/dist/assets/secretGuard-BmmnEbYf.js +1 -0
- package/dist/assets/{server-C1jZZ61O.js → server-CQR7NLCz.js} +9565 -461
- package/dist/assets/server-CQR7NLCz.js.map +1 -0
- package/dist/assets/{sha512-BYId-G-T.js → sha512-DST9fbWH.js} +2 -3
- package/dist/assets/{sha512-BYId-G-T.js.map → sha512-DST9fbWH.js.map} +1 -1
- package/dist/assets/sshForges-BnvwmNj-.js +539 -0
- package/dist/assets/sshForges-BnvwmNj-.js.map +1 -0
- package/dist/assets/{storage-Bya5b2Xt.js → storage-BpjdxvO2.js} +243 -34
- package/dist/assets/storage-BpjdxvO2.js.map +1 -0
- package/dist/assets/text-li76pThX.js +106 -0
- package/dist/assets/text-li76pThX.js.map +1 -0
- package/dist/assets/{translate-CUuC5szR.js → translate-BcbSWkuq.js} +21 -26
- package/dist/assets/{translate-CUuC5szR.js.map → translate-BcbSWkuq.js.map} +1 -1
- package/dist/assets/{tree-store-N362nuzZ.js → tree-store-CAchkO_l.js} +22 -6
- package/dist/assets/tree-store-CAchkO_l.js.map +1 -0
- package/dist/assets/{types-Clyb52K2.js → types-CdWwgvyt.js} +2 -3
- package/dist/assets/{types-Clyb52K2.js.map → types-CdWwgvyt.js.map} +1 -1
- package/dist/assets/{unbzip2-stream-B1C-JX9L.js → unbzip2-stream-BtkYGpC5.js} +2 -3
- package/dist/assets/{unbzip2-stream-B1C-JX9L.js.map → unbzip2-stream-BtkYGpC5.js.map} +1 -1
- package/dist/assets/{usdt-DI51znt-.js → usdt-CBJ4Q5Ji.js} +7 -7
- package/dist/assets/usdt-CBJ4Q5Ji.js.map +1 -0
- package/dist/assets/{waitNotice-Cn0WJ-He.js → waitNotice-BGM0QOS2.js} +27 -4
- package/dist/assets/waitNotice-BGM0QOS2.js.map +1 -0
- package/dist/assets/{web-DwgdhfcY.js → web-68CYFCl9.js} +314 -91
- package/dist/assets/web-68CYFCl9.js.map +1 -0
- package/dist/ghostly.mjs +3 -5
- package/dist/ghostly.mjs.map +1 -1
- package/npm-shrinkwrap.json +225 -200
- package/package.json +16 -16
- package/dist/assets/api-MYc6QNRs.js.map +0 -1
- package/dist/assets/apiKit-CfsNx9ZR.js.map +0 -1
- package/dist/assets/appFetch-DVYZOZFw.js +0 -194
- package/dist/assets/appFetch-DVYZOZFw.js.map +0 -1
- package/dist/assets/apps-Dbw2Hcko.js +0 -2
- package/dist/assets/apps-h12II1us.js.map +0 -1
- package/dist/assets/arkade-Bw_4PZRG.js.map +0 -1
- package/dist/assets/backup-CdEzTq5C.js +0 -2
- package/dist/assets/backup-Chvy79SN.js.map +0 -1
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js +0 -6
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +0 -1
- package/dist/assets/bitcoindProvider-BvoRh0D5.js +0 -97
- package/dist/assets/bitcoindProvider-BvoRh0D5.js.map +0 -1
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js +0 -6
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +0 -1
- package/dist/assets/bitcoindevkit_bg-CRkZTSbO.wasm +0 -0
- package/dist/assets/buttons-BgoExb4E.js.map +0 -1
- package/dist/assets/buttons-DK2aAGat.js +0 -2
- package/dist/assets/endpoint-DarqblYE.js.map +0 -1
- package/dist/assets/errors-CAh6GLJZ.js.map +0 -1
- package/dist/assets/fedimint_client_wasm_bg-BtHHlFpp.js +0 -6
- package/dist/assets/fileBytes-BLPZq9YU.js.map +0 -1
- package/dist/assets/fileBytes-BtIyoDF2.js +0 -2
- package/dist/assets/fileBytesIdb-D8mAK4pF.js +0 -2
- package/dist/assets/host-C0NMNQLl.js.map +0 -1
- package/dist/assets/hyperdhtRelay-1wzya_0L.js +0 -25
- package/dist/assets/hyperdhtRelay-1wzya_0L.js.map +0 -1
- package/dist/assets/hyperdhtRelay-Dz7pvcBA.js.map +0 -1
- package/dist/assets/irohWeb-caAj4Dms.js.map +0 -1
- package/dist/assets/joinTrace-D-fnt2p3.js +0 -2
- package/dist/assets/jsonOut-POtMBS_V.js +0 -16
- package/dist/assets/jsonOut-POtMBS_V.js.map +0 -1
- package/dist/assets/main-C6t5zrD5.js.map +0 -1
- package/dist/assets/mainline-DCuGUSZF.js.map +0 -1
- package/dist/assets/mints-BaOmx517.js +0 -2
- package/dist/assets/mints-j5XAOk4f.js.map +0 -1
- package/dist/assets/nwcProvider-PE0wli8n.js +0 -88
- package/dist/assets/nwcProvider-PE0wli8n.js.map +0 -1
- package/dist/assets/ownDid-C1R5Kd8q.js +0 -282
- package/dist/assets/ownDid-C1R5Kd8q.js.map +0 -1
- package/dist/assets/ownStatus-BoTf5WqQ.js.map +0 -1
- package/dist/assets/profiles-DszHjEJi.js.map +0 -1
- package/dist/assets/registry-Da-r6eC3.js.map +0 -1
- package/dist/assets/registry-zUZBSHYv.js +0 -2
- package/dist/assets/resolve-tUzh4lHh.js +0 -400
- package/dist/assets/resolve-tUzh4lHh.js.map +0 -1
- package/dist/assets/secretGuard-DCb1I0_B.js +0 -2
- package/dist/assets/server-C1jZZ61O.js.map +0 -1
- package/dist/assets/src-DJe-OYxd.js.map +0 -1
- package/dist/assets/sshForges-C9zTO72R.js +0 -261
- package/dist/assets/sshForges-C9zTO72R.js.map +0 -1
- package/dist/assets/storage-Bya5b2Xt.js.map +0 -1
- package/dist/assets/tree-store-N362nuzZ.js.map +0 -1
- package/dist/assets/usdt-DI51znt-.js.map +0 -1
- package/dist/assets/waitNotice-Cn0WJ-He.js.map +0 -1
- package/dist/assets/web-DwgdhfcY.js.map +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { i as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as endedUnsent, i as endedUnanswered, o as isNotTheDaemon, p as CALL_RATES, r as connectDaemon, s as notTheDaemon, t as DaemonClient, y as isCallRate } from "./client-DY8tZZWi.js";
|
|
1
|
+
import { i as localFileError, n as EXIT, r as asCliError, t as CliError } from "./errors-DDLFO4Gf.js";
|
|
2
|
+
import { a as endedUnsent, i as endedUnanswered, o as isNotTheDaemon, p as CALL_RATES, r as connectDaemon, s as notTheDaemon, t as DaemonClient, y as isCallRate } from "./client-kGZ3ZdUW.js";
|
|
3
|
+
import { n as dropSecretEnv, t as childEnv } from "./childEnv-C-99hdbL.js";
|
|
4
|
+
import { Cr as cardUrl, D as GROUP_FILE_LIMITS, Dr as statusCardBytes, En as VOICE_LIMITS, Sr as cardLine, Zn as reactionEmoji, _r as TASK_STATUSES, bt as STATUS_AVAILABILITIES, dr as ITEM_STATES, fr as PR_CHECKS, gr as STATUS_CARD_LIMITS, hr as RUN_RESULTS, mr as ROUTINE_STATES, pr as PR_STATES, ur as CRON_LINE } from "./groupMeta-DTQAJG50.js";
|
|
5
|
+
import { S as userPath, _ as profileExists, b as startingDaemon, c as createProfile, d as daemonClaim, f as ghostlyHome, g as noProfile, i as checkProfileName, l as currentProfile, m as lockOwner, o as checkShownNameOption, p as listProfiles, s as claimForDaemon, u as currentProfileOrNone, v as profilePaths, w as ownProfile, y as selectProfile } from "./profiles-BFSGqDFC.js";
|
|
6
|
+
import { _ as hideSecretFields, a as PAY_METHODS, c as turnRef, d as ENGINE_METHODS, f as ENGINE_PARAMS, h as SECRET_RESULTS, i as CHAT_METHODS, m as READ_PARAMS, o as TRANSPORT_NAMES, p as ENGINE_READS, r as ADDRESS_TYPES, s as WALLET_TYPES, t as checkOwnStatus } from "./ownStatus-DMEhrpkd.js";
|
|
7
|
+
import { B as shellWord, V as jsonOut, a as contactKeyOf, b as namedByThem, y as nameKey } from "./apiKit-CVaEzKWQ.js";
|
|
8
|
+
import { i as waitsFor, r as waitNotice } from "./waitNotice-BGM0QOS2.js";
|
|
10
9
|
import { spawn } from "node:child_process";
|
|
11
10
|
import { accessSync, closeSync, constants, existsSync, fstatSync, openSync, readFileSync, readSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
12
11
|
import { dirname, resolve, sep } from "node:path";
|
|
@@ -14,7 +13,7 @@ import { connect } from "node:net";
|
|
|
14
13
|
import { format } from "node:util";
|
|
15
14
|
var package_default = {
|
|
16
15
|
name: "@ghostlytools/cli",
|
|
17
|
-
version: "1.
|
|
16
|
+
version: "1.12.0",
|
|
18
17
|
type: "module",
|
|
19
18
|
description: "Ghostly for bots and terminals: the app's own engine, headless on Node, behind a daemon and a `ghostly` command with JSON output.",
|
|
20
19
|
license: "MIT",
|
|
@@ -42,12 +41,12 @@ var package_default = {
|
|
|
42
41
|
"test": "vitest run"
|
|
43
42
|
},
|
|
44
43
|
dependencies: {
|
|
45
|
-
"@arkade-os/sdk": "0.4
|
|
44
|
+
"@arkade-os/sdk": "0.5.4",
|
|
46
45
|
"@atproto/jwk-webcrypto": "^0.3.4",
|
|
47
|
-
"@atproto/oauth-client": "^0.
|
|
48
|
-
"@bitcoindevkit/bdk-wallet-web": "0.
|
|
49
|
-
"@bitcoinerlab/descriptors-scure": "^3.2.
|
|
50
|
-
"@cashu/cashu-ts": "^4.
|
|
46
|
+
"@atproto/oauth-client": "^0.9.3",
|
|
47
|
+
"@bitcoindevkit/bdk-wallet-web": "0.4.0",
|
|
48
|
+
"@bitcoinerlab/descriptors-scure": "^3.2.1",
|
|
49
|
+
"@cashu/cashu-ts": "^4.13.0",
|
|
51
50
|
"@fedimint/core": "0.0.0-canary-eea6a3c98909fa8e736d6dadb1f1243fd3322b27",
|
|
52
51
|
"@fedimint/fedimint-client-wasm-bundler": "0.0.0-canary-eea6a3c98909fa8e736d6dadb1f1243fd3322b27",
|
|
53
52
|
"@fedimint/types": "0.0.0-canary-eea6a3c98909fa8e736d6dadb1f1243fd3322b27",
|
|
@@ -59,20 +58,20 @@ var package_default = {
|
|
|
59
58
|
"@scure/bip32": "^2.4.0",
|
|
60
59
|
"@scure/bip39": "2.4.0",
|
|
61
60
|
"@scure/btc-signer": "2.4.1",
|
|
62
|
-
"@secondts/bark": "0.
|
|
61
|
+
"@secondts/bark": "0.27.0",
|
|
63
62
|
"@serenity-kit/opaque": "1.1.0",
|
|
64
|
-
"@synonymdev/pubky": "0.
|
|
63
|
+
"@synonymdev/pubky": "0.18.0",
|
|
65
64
|
"@tetherto/wdk-wallet-evm": "1.0.0-beta.24",
|
|
66
65
|
"b4a": "1.9.0",
|
|
67
66
|
"bittorrent-dht": "11.0.12",
|
|
68
67
|
"ethers": "6.17.0",
|
|
69
|
-
"eventsource": "^5.1.
|
|
70
|
-
"fake-indexeddb": "6.2.
|
|
71
|
-
"hyperdht": "6.
|
|
68
|
+
"eventsource": "^5.1.4",
|
|
69
|
+
"fake-indexeddb": "6.2.8",
|
|
70
|
+
"hyperdht": "6.36.0",
|
|
72
71
|
"keet-identity-key": "3.2.0",
|
|
73
72
|
"mpg123-decoder": "1.0.3",
|
|
74
|
-
"node-datachannel": "^0.33.
|
|
75
|
-
"nostr-tools": "2.
|
|
73
|
+
"node-datachannel": "^0.33.6",
|
|
74
|
+
"nostr-tools": "2.26.0",
|
|
76
75
|
"opus-decoder": "0.7.12",
|
|
77
76
|
"opusscript": "0.1.1",
|
|
78
77
|
"ws": "8.22.1"
|
|
@@ -81,19 +80,28 @@ var package_default = {
|
|
|
81
80
|
"@ghostly/browser": "*",
|
|
82
81
|
"@ghostly/core": "*",
|
|
83
82
|
"@ghostly/iroh-web": "*",
|
|
84
|
-
"@types/node": "^26.6.
|
|
83
|
+
"@types/node": "^26.6.6",
|
|
85
84
|
"typescript": "^5.9.3",
|
|
86
|
-
"vite": "^8.3.
|
|
87
|
-
"vitest": "^5.0
|
|
85
|
+
"vite": "^8.3.6",
|
|
86
|
+
"vitest": "^5.1.0"
|
|
88
87
|
}
|
|
89
88
|
};
|
|
90
|
-
|
|
91
|
-
//#region src/args.ts
|
|
89
|
+
// src/args.ts
|
|
92
90
|
/**
|
|
93
91
|
* A number as typed on the command line, in decimal digits only (`21`, `-5`, `12.5`); NaN for any other word.
|
|
94
92
|
* `Number()` alone read `1e3` as 1,000, `0x10` as 16 and `" 21"` as 21: `chat pay bob 2e3`, a typo of 23, paid 2,000.
|
|
95
93
|
*/
|
|
96
94
|
var decimalNumber = (value) => /^-?\d+(\.\d+)?$/.test(value) ? Number(value) : NaN;
|
|
95
|
+
var notANumber = (name, option, value) => new CliError("usage", `--${name} takes ${option.takes ?? "a number"}, not ${JSON.stringify(value)}`);
|
|
96
|
+
/**
|
|
97
|
+
* The word right after an option that stood alone because it was no number (`--voice 2s`), by the positionals a parse
|
|
98
|
+
* returned: should the line have one too many, that word was the option's value, and `strayValue` says so.
|
|
99
|
+
*/
|
|
100
|
+
var lonelyValues = /* @__PURE__ */ new WeakMap();
|
|
101
|
+
/** The refusal of an option's value that was taken as a positional (`--voice 2s`), else undefined. */
|
|
102
|
+
function strayValue(values) {
|
|
103
|
+
return lonelyValues.get(values)?.find(({ index, word }) => values[index] === word)?.refusal;
|
|
104
|
+
}
|
|
97
105
|
/**
|
|
98
106
|
* Options every command takes. They may come anywhere on the line.
|
|
99
107
|
*/
|
|
@@ -143,6 +151,7 @@ function parseArgs(argv, spec, idSlot = () => false, parsing) {
|
|
|
143
151
|
return Object.hasOwn(all, name) || name.startsWith("no-") && all[name.slice(3)]?.type === "boolean";
|
|
144
152
|
};
|
|
145
153
|
const positionals = [];
|
|
154
|
+
const lonely = [];
|
|
146
155
|
const options = {};
|
|
147
156
|
const setBoolean = (name, value) => {
|
|
148
157
|
if (all[name].eitherWay && options[name] !== void 0 && options[name] !== value) throw new CliError("usage", `--${name} or --no-${name}, not both`);
|
|
@@ -186,8 +195,14 @@ function parseArgs(argv, spec, idSlot = () => false, parsing) {
|
|
|
186
195
|
continue;
|
|
187
196
|
}
|
|
188
197
|
let value = inline;
|
|
189
|
-
if (value === void 0 && option.optionalValue && !(i + 1 < argv.length &&
|
|
198
|
+
if (value === void 0 && option.optionalValue && !(i + 1 < argv.length && Number.isFinite(Number(argv[i + 1])))) {
|
|
190
199
|
options[name] = true;
|
|
200
|
+
const next = argv[i + 1];
|
|
201
|
+
if (next && !next.startsWith("-")) lonely.push({
|
|
202
|
+
index: positionals.length,
|
|
203
|
+
word: next,
|
|
204
|
+
refusal: notANumber(name, option, next)
|
|
205
|
+
});
|
|
191
206
|
continue;
|
|
192
207
|
}
|
|
193
208
|
if (value === void 0) {
|
|
@@ -196,7 +211,7 @@ function parseArgs(argv, spec, idSlot = () => false, parsing) {
|
|
|
196
211
|
}
|
|
197
212
|
if (option.type === "number") {
|
|
198
213
|
const number = decimalNumber(value);
|
|
199
|
-
if (!Number.isFinite(number)) throw
|
|
214
|
+
if (!Number.isFinite(number)) throw notANumber(name, option, value);
|
|
200
215
|
options[name] = number;
|
|
201
216
|
} else if (option.type === "list") options[name] = [...options[name] ?? [], value];
|
|
202
217
|
else {
|
|
@@ -208,6 +223,7 @@ function parseArgs(argv, spec, idSlot = () => false, parsing) {
|
|
|
208
223
|
if (arg.startsWith("-") && arg !== "-") throw unknownOption(arg, all, parsing);
|
|
209
224
|
positionals.push(arg);
|
|
210
225
|
}
|
|
226
|
+
if (lonely.length) lonelyValues.set(positionals, lonely);
|
|
211
227
|
return {
|
|
212
228
|
positionals,
|
|
213
229
|
options
|
|
@@ -323,8 +339,7 @@ function liftGlobals(argv) {
|
|
|
323
339
|
...rest.slice(dash)
|
|
324
340
|
];
|
|
325
341
|
}
|
|
326
|
-
|
|
327
|
-
//#region src/commands/shared.ts
|
|
342
|
+
// src/commands/shared.ts
|
|
328
343
|
var wait = {
|
|
329
344
|
wait: {
|
|
330
345
|
type: "string",
|
|
@@ -695,6 +710,13 @@ function cardBytes(fields, flags) {
|
|
|
695
710
|
if (bytes > STATUS_CARD_LIMITS.bytes) throw new CliError("usage", `The card takes ${bytes} bytes, and holds at most ${STATUS_CARD_LIMITS.bytes} in all (a character past Latin takes 2 to 4): give shorter or fewer ${flags}`);
|
|
696
711
|
return fields;
|
|
697
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* A card's `--id` given as "" (an unset variable in a script: `--id "$ID"`) is a usage error. Taken as not given, a new
|
|
715
|
+
* id was made, and a script meant to update its card posted a second one.
|
|
716
|
+
*/
|
|
717
|
+
function cardId(options) {
|
|
718
|
+
if (options.id === "") throw new CliError("usage", "--id needs a card id");
|
|
719
|
+
}
|
|
698
720
|
/** `--progress`, `--left`: a percent, or a usage error that names the flag. */
|
|
699
721
|
function percent(options, flag) {
|
|
700
722
|
const value = options[flag];
|
|
@@ -734,6 +756,7 @@ function taskFields(options) {
|
|
|
734
756
|
["pr-state", PR_STATES],
|
|
735
757
|
["pr-checks", PR_CHECKS]
|
|
736
758
|
]) oneWord(options, flag, words);
|
|
759
|
+
cardId(options);
|
|
737
760
|
set("id", options.id);
|
|
738
761
|
set("title", options.title);
|
|
739
762
|
set("status", options.status);
|
|
@@ -912,6 +935,7 @@ function routineFields(options) {
|
|
|
912
935
|
throw new CliError("usage", length > STATUS_CARD_LIMITS.cron ? `--cron takes at most ${STATUS_CARD_LIMITS.cron} characters, not ${length}` : `--cron takes a cron line of 0-9 A-Z a-z * , / ? # - and spaces, not ${JSON.stringify(options.cron)}`);
|
|
913
936
|
}
|
|
914
937
|
oneWord(options, "state", ROUTINE_STATES);
|
|
938
|
+
cardId(options);
|
|
915
939
|
for (const key of [
|
|
916
940
|
"id",
|
|
917
941
|
"name",
|
|
@@ -1050,6 +1074,7 @@ function usageFields(options) {
|
|
|
1050
1074
|
["window", STATUS_CARD_LIMITS.usageWindow]
|
|
1051
1075
|
]) cardText(`--${flag}`, options[flag], max);
|
|
1052
1076
|
given("also", options.also, STATUS_CARD_LIMITS.usageWindows);
|
|
1077
|
+
cardId(options);
|
|
1053
1078
|
for (const key of [
|
|
1054
1079
|
"id",
|
|
1055
1080
|
"left",
|
|
@@ -1110,8 +1135,7 @@ var usageOptions = {
|
|
|
1110
1135
|
text: cardOptions.text,
|
|
1111
1136
|
force: cardOptions.force
|
|
1112
1137
|
};
|
|
1113
|
-
|
|
1114
|
-
//#region src/commands/apps.ts
|
|
1138
|
+
// src/commands/apps.ts
|
|
1115
1139
|
/** The key file a command signs with: always named, never a default, never on the command line itself. */
|
|
1116
1140
|
function keyFile(value, usage) {
|
|
1117
1141
|
if (typeof value !== "string" || !value) throw new CliError("usage", `--key <file> is needed: ghostly ${usage}`);
|
|
@@ -1174,7 +1198,7 @@ var commands$8 = {
|
|
|
1174
1198
|
description: "Replace the three files when they are there"
|
|
1175
1199
|
}
|
|
1176
1200
|
},
|
|
1177
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1201
|
+
run: async ({ options }, a) => (await import("./apps-BPFW19Wc.js")).initApp(a.dir, {
|
|
1178
1202
|
name: options.name,
|
|
1179
1203
|
title: options.title,
|
|
1180
1204
|
force: options.force === true
|
|
@@ -1214,7 +1238,7 @@ var commands$8 = {
|
|
|
1214
1238
|
description: "This version's sequence, higher than the bundle at --out's (default: one more than it)"
|
|
1215
1239
|
}
|
|
1216
1240
|
},
|
|
1217
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1241
|
+
run: async ({ options }, a) => (await import("./apps-BPFW19Wc.js")).publishApp(a.dir, keyFile(options.key, "app publish <dir> --key <file> [--out <file>] [--sequence n]"), here(options.out), options.sequence)
|
|
1218
1242
|
},
|
|
1219
1243
|
"app revoke": {
|
|
1220
1244
|
method: "app.revoke",
|
|
@@ -1247,7 +1271,7 @@ var commands$8 = {
|
|
|
1247
1271
|
description: "Allow --up-to past the bundle's own sequence (versions published from elsewhere), and a --reason that looks like a seed, a key or ecash"
|
|
1248
1272
|
}
|
|
1249
1273
|
},
|
|
1250
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1274
|
+
run: async ({ options }, a) => (await import("./apps-BPFW19Wc.js")).revokeApp(a.dir, keyFile(options.key, "app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>] [--force]"), {
|
|
1251
1275
|
digests: options.digest,
|
|
1252
1276
|
upTo: options["up-to"],
|
|
1253
1277
|
reason: options.reason,
|
|
@@ -1308,7 +1332,7 @@ var commands$8 = {
|
|
|
1308
1332
|
usage: "app verify <bundle|url>",
|
|
1309
1333
|
summary: "Check a .ghostlyapp as a client would, from a file or an https URL: its manifest and digest, or refused (exit 1) with the reason, revoked when the ghostly-revoke.json beside it (for a URL, or beside one of its sources) revokes this version",
|
|
1310
1334
|
args: ["bundle"],
|
|
1311
|
-
run: async (_, a) => (await import("./apps-
|
|
1335
|
+
run: async (_, a) => (await import("./apps-BPFW19Wc.js")).verifyApp(a.bundle)
|
|
1312
1336
|
},
|
|
1313
1337
|
"store sign": {
|
|
1314
1338
|
method: "store.sign",
|
|
@@ -1325,11 +1349,10 @@ var commands$8 = {
|
|
|
1325
1349
|
description: "The folder to write ghostly-store.json and ghostly-store.sig in (default: the index's)"
|
|
1326
1350
|
}
|
|
1327
1351
|
},
|
|
1328
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1352
|
+
run: async ({ options }, a) => (await import("./apps-BPFW19Wc.js")).signStore(a.index, keyFile(options.key, "store sign <index> --key <file> [--out <dir>]"), here(options.out))
|
|
1329
1353
|
}
|
|
1330
1354
|
};
|
|
1331
|
-
|
|
1332
|
-
//#region src/commands/calls.ts
|
|
1355
|
+
// src/commands/calls.ts
|
|
1333
1356
|
/**
|
|
1334
1357
|
* `--rate`: one of the rates a call takes, or a usage error (exit 2) that names the flag before the profile opens.
|
|
1335
1358
|
* Before, the API's own check answered it ("rate must be …", exit 1), and `call answer` only once a call rang.
|
|
@@ -1407,8 +1430,7 @@ var commands$7 = {
|
|
|
1407
1430
|
})
|
|
1408
1431
|
}
|
|
1409
1432
|
};
|
|
1410
|
-
|
|
1411
|
-
//#region src/commands/chats.ts
|
|
1433
|
+
// src/commands/chats.ts
|
|
1412
1434
|
/** `react` and `pin` in a 1:1 chat: until the contact confirmed it, by default without a daemon (the process leaves). */
|
|
1413
1435
|
var confirmWait = {
|
|
1414
1436
|
wait: {
|
|
@@ -1747,7 +1769,7 @@ var commands$6 = {
|
|
|
1747
1769
|
},
|
|
1748
1770
|
"message delete": {
|
|
1749
1771
|
method: "chat.delete",
|
|
1750
|
-
usage: "message delete <chat|group> <message> [--everyone [--wait none|confirmed|sent] [--timeout s]]",
|
|
1772
|
+
usage: "message delete <chat|group> <message> [--everyone [--wait none|confirmed|sent] [--timeout s]] [--purge]",
|
|
1751
1773
|
summary: "Forget a message on this device (the contact keeps theirs; a waiting text of yours is cancelled, or deleted for everyone if a relay may have it); --everyone deletes one of yours, in a chat or a group, from every member's device",
|
|
1752
1774
|
args: ["chat", "message"],
|
|
1753
1775
|
options: {
|
|
@@ -1764,7 +1786,11 @@ var commands$6 = {
|
|
|
1764
1786
|
],
|
|
1765
1787
|
description: "With --everyone: in a chat none or confirmed, until the contact has it; in a group none or sent, until a member's edge took it (default: none with a daemon, confirmed or sent without)"
|
|
1766
1788
|
},
|
|
1767
|
-
timeout: wait.timeout
|
|
1789
|
+
timeout: wait.timeout,
|
|
1790
|
+
purge: {
|
|
1791
|
+
type: "boolean",
|
|
1792
|
+
description: "Take what it said out of the profile's folder now (the store folds at once), not within the hour: for a secret pasted into a chat"
|
|
1793
|
+
}
|
|
1768
1794
|
},
|
|
1769
1795
|
params: ({ options }, a) => {
|
|
1770
1796
|
for (const flag of ["wait", "timeout"]) if (options[flag] !== void 0 && options.everyone !== true) throw new CliError("usage", `--${flag} goes with --everyone`);
|
|
@@ -1773,7 +1799,8 @@ var commands$6 = {
|
|
|
1773
1799
|
message: a.message,
|
|
1774
1800
|
everyone: options.everyone === true,
|
|
1775
1801
|
wait: options.wait,
|
|
1776
|
-
timeout: timeout(options)
|
|
1802
|
+
timeout: timeout(options),
|
|
1803
|
+
...options.purge === true && { purge: true }
|
|
1777
1804
|
};
|
|
1778
1805
|
}
|
|
1779
1806
|
},
|
|
@@ -1819,7 +1846,7 @@ var commands$6 = {
|
|
|
1819
1846
|
timeout: groupWait.timeout
|
|
1820
1847
|
},
|
|
1821
1848
|
params: ({ options }, a) => {
|
|
1822
|
-
if (a.message
|
|
1849
|
+
if (!a.message && options.remove !== true) throw new CliError("usage", "Missing <message>: ghostly pin <chat|group> <message> | --remove");
|
|
1823
1850
|
if (a.message?.includes(" ")) throw new CliError("usage", "Too many arguments: ghostly pin <chat|group> <message> | --remove");
|
|
1824
1851
|
return {
|
|
1825
1852
|
chat: a.chat,
|
|
@@ -2016,8 +2043,7 @@ var commands$6 = {
|
|
|
2016
2043
|
}
|
|
2017
2044
|
}
|
|
2018
2045
|
};
|
|
2019
|
-
|
|
2020
|
-
//#region src/commands/files.ts
|
|
2046
|
+
// src/commands/files.ts
|
|
2021
2047
|
/**
|
|
2022
2048
|
* `--voice [ms]` and `--peaks`: a length and a waveform a voice note takes, or a usage error (exit 2) that names the flag
|
|
2023
2049
|
* before the profile opens. Before, the API answered them once it had opened ("voice must be a number from 1 to
|
|
@@ -2190,6 +2216,7 @@ var commands$5 = {
|
|
|
2190
2216
|
voice: {
|
|
2191
2217
|
type: "number",
|
|
2192
2218
|
optionalValue: true,
|
|
2219
|
+
takes: "a length in milliseconds",
|
|
2193
2220
|
description: "A voice note; its length in milliseconds (default: measured from the sound)"
|
|
2194
2221
|
},
|
|
2195
2222
|
peaks: {
|
|
@@ -2243,8 +2270,7 @@ var commands$5 = {
|
|
|
2243
2270
|
})
|
|
2244
2271
|
}
|
|
2245
2272
|
};
|
|
2246
|
-
|
|
2247
|
-
//#region src/commands/general.ts
|
|
2273
|
+
// src/commands/general.ts
|
|
2248
2274
|
/** `--until 30m`, `2h`, `1d`: that long from now. */
|
|
2249
2275
|
var DURATION = /^(\d+)(m|h|d)$/;
|
|
2250
2276
|
var UNIT_MS = {
|
|
@@ -2351,8 +2377,7 @@ var commands$4 = {
|
|
|
2351
2377
|
summary: "This profile's status (status set), or null when it has none"
|
|
2352
2378
|
}
|
|
2353
2379
|
};
|
|
2354
|
-
|
|
2355
|
-
//#region src/commands/groups.ts
|
|
2380
|
+
// src/commands/groups.ts
|
|
2356
2381
|
var nameForce = {
|
|
2357
2382
|
type: "boolean",
|
|
2358
2383
|
description: "Use the name even if it looks like a seed, a key or ecash"
|
|
@@ -2400,6 +2425,39 @@ var commands$3 = {
|
|
|
2400
2425
|
} : { on: false };
|
|
2401
2426
|
}
|
|
2402
2427
|
},
|
|
2428
|
+
"group call": {
|
|
2429
|
+
method: "group.call",
|
|
2430
|
+
usage: "group call <group> --sfu <https origin> [--e2ee | --no-e2ee] | --e2ee | --no-e2ee | --clear [--show-secret]",
|
|
2431
|
+
summary: "Name the node a community group's calls go through, turn sealed call media on or off, or --clear (admin)",
|
|
2432
|
+
args: ["group"],
|
|
2433
|
+
options: {
|
|
2434
|
+
...showSecret,
|
|
2435
|
+
sfu: {
|
|
2436
|
+
type: "string",
|
|
2437
|
+
description: "The node's https origin, e.g. https://call.example.com"
|
|
2438
|
+
},
|
|
2439
|
+
e2ee: {
|
|
2440
|
+
type: "boolean",
|
|
2441
|
+
eitherWay: true,
|
|
2442
|
+
description: "Seal the call media end to end (--no-e2ee: off); left out, the group keeps what it had"
|
|
2443
|
+
},
|
|
2444
|
+
clear: {
|
|
2445
|
+
type: "boolean",
|
|
2446
|
+
description: "The group has no calls"
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
params: ({ options }, a) => {
|
|
2450
|
+
if (options.sfu === void 0 && options.clear !== true && options.e2ee === void 0) throw new CliError("usage", "Missing --sfu: ghostly group call <group> --sfu <https origin> | --clear");
|
|
2451
|
+
if (options.sfu !== void 0 && options.clear === true) throw new CliError("usage", "--clear removes the call node: not with --sfu");
|
|
2452
|
+
if (options.e2ee !== void 0 && options.clear === true) throw new CliError("usage", "--clear removes the call node: not with --e2ee or --no-e2ee");
|
|
2453
|
+
return {
|
|
2454
|
+
group: a.group,
|
|
2455
|
+
...options.clear === true ? { clear: true } : options.sfu !== void 0 ? { sfu: options.sfu } : {},
|
|
2456
|
+
...options.e2ee !== void 0 && { e2ee: options.e2ee === true },
|
|
2457
|
+
...secret(options)
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
},
|
|
2403
2461
|
"group create": {
|
|
2404
2462
|
method: "group.create",
|
|
2405
2463
|
usage: "group create <name...> [--mesh] [--force]",
|
|
@@ -2691,8 +2749,7 @@ var commands$3 = {
|
|
|
2691
2749
|
})
|
|
2692
2750
|
}
|
|
2693
2751
|
};
|
|
2694
|
-
|
|
2695
|
-
//#region src/commands/identities.ts
|
|
2752
|
+
// src/commands/identities.ts
|
|
2696
2753
|
/** Identity proofs and x401 credentials: one entry per command, in alphabetical order (test/commands.test.ts checks). */
|
|
2697
2754
|
var commands$2 = {
|
|
2698
2755
|
"identity cancel": {
|
|
@@ -2710,7 +2767,7 @@ var commands$2 = {
|
|
|
2710
2767
|
options: {
|
|
2711
2768
|
"evidence-file": {
|
|
2712
2769
|
type: "string",
|
|
2713
|
-
description: "The tool's output, from this file"
|
|
2770
|
+
description: "The tool's output, from this file (- for stdin)"
|
|
2714
2771
|
},
|
|
2715
2772
|
stdin: {
|
|
2716
2773
|
type: "boolean",
|
|
@@ -2719,10 +2776,11 @@ var commands$2 = {
|
|
|
2719
2776
|
},
|
|
2720
2777
|
params: ({ options }, a) => {
|
|
2721
2778
|
if (options["evidence-file"] !== void 0 && options.stdin === true) throw new CliError("usage", "--evidence-file or --stdin, not both");
|
|
2779
|
+
const piped = options["evidence-file"] === "-";
|
|
2722
2780
|
return {
|
|
2723
2781
|
draft: a.draft,
|
|
2724
|
-
evidenceFile: here(options["evidence-file"]),
|
|
2725
|
-
stdin: options.stdin === true
|
|
2782
|
+
evidenceFile: piped ? void 0 : here(options["evidence-file"]),
|
|
2783
|
+
stdin: piped || options.stdin === true
|
|
2726
2784
|
};
|
|
2727
2785
|
}
|
|
2728
2786
|
},
|
|
@@ -2817,8 +2875,7 @@ var commands$2 = {
|
|
|
2817
2875
|
summary: "A fresh P-256 holder key: its public JWK goes to the issuer (the 8 newest wait for a credential; past them, the oldest is dropped)"
|
|
2818
2876
|
}
|
|
2819
2877
|
};
|
|
2820
|
-
|
|
2821
|
-
//#region src/commands/payments.ts
|
|
2878
|
+
// src/commands/payments.ts
|
|
2822
2879
|
/**
|
|
2823
2880
|
* `chat accept`'s --networks: mainnet and/or testnet, comma-separated; any other word, or none (an unset variable), is a
|
|
2824
2881
|
* usage error before the profile opens, as a word --network does not take is. Before, the API refused it after a
|
|
@@ -3027,7 +3084,10 @@ var commands$1 = {
|
|
|
3027
3084
|
type: "string",
|
|
3028
3085
|
description: "Only this chat's"
|
|
3029
3086
|
} },
|
|
3030
|
-
params: ({ options }) =>
|
|
3087
|
+
params: ({ options }) => {
|
|
3088
|
+
if (options.chat === "") throw new CliError("usage", "--chat needs a chat");
|
|
3089
|
+
return { chat: options.chat };
|
|
3090
|
+
}
|
|
3031
3091
|
},
|
|
3032
3092
|
"payment reclaim": {
|
|
3033
3093
|
method: "payment.reclaim",
|
|
@@ -3181,8 +3241,7 @@ var commands$1 = {
|
|
|
3181
3241
|
})
|
|
3182
3242
|
}
|
|
3183
3243
|
};
|
|
3184
|
-
|
|
3185
|
-
//#region src/commands/services.ts
|
|
3244
|
+
// src/commands/services.ts
|
|
3186
3245
|
/** Shared local services: one entry per command, in alphabetical order (test/commands.test.ts checks). */
|
|
3187
3246
|
var commands = {
|
|
3188
3247
|
"service add": {
|
|
@@ -3269,8 +3328,7 @@ var commands = {
|
|
|
3269
3328
|
})
|
|
3270
3329
|
}
|
|
3271
3330
|
};
|
|
3272
|
-
|
|
3273
|
-
//#region src/commands/index.ts
|
|
3331
|
+
// src/commands/index.ts
|
|
3274
3332
|
/**
|
|
3275
3333
|
* The commands that are one API method each, one file per area of the app, each in alphabetical order. A new
|
|
3276
3334
|
* command goes in its area's file at its place; a new area is a new file and its two lines here. The order here
|
|
@@ -3489,12 +3547,14 @@ function positionals(command, values) {
|
|
|
3489
3547
|
noMoreThan(names.length, values, command.usage);
|
|
3490
3548
|
return out;
|
|
3491
3549
|
}
|
|
3492
|
-
/**
|
|
3550
|
+
/**
|
|
3551
|
+
* Words past a usage's arguments are refused, never dropped: `profile use my bot` would select `my`. One of them right
|
|
3552
|
+
* after an option that stood alone (`file send bob v.wav --voice 2s`) is refused as that option's value.
|
|
3553
|
+
*/
|
|
3493
3554
|
function noMoreThan(count, values, usage) {
|
|
3494
|
-
if (values.length > count) throw new CliError("usage", `Too many arguments: ghostly ${usage}`);
|
|
3555
|
+
if (values.length > count) throw strayValue(values) ?? new CliError("usage", `Too many arguments: ghostly ${usage}`);
|
|
3495
3556
|
}
|
|
3496
|
-
|
|
3497
|
-
//#region src/listen.ts
|
|
3557
|
+
// src/listen.ts
|
|
3498
3558
|
/** The cursor's own write failed, not the event's handling. */
|
|
3499
3559
|
var CursorError = class extends Error {
|
|
3500
3560
|
error;
|
|
@@ -3577,7 +3637,7 @@ async function otherFlag(lookup, ref, flag) {
|
|
|
3577
3637
|
const other = flag === "--from" ? "group" : "chat";
|
|
3578
3638
|
if (!(error instanceof CliError) || error.code !== "not_found" || typeof error.details?.[other] !== "string") throw error;
|
|
3579
3639
|
const named = other === "chat" ? error.details.chat : ref;
|
|
3580
|
-
const shown =
|
|
3640
|
+
const shown = shellWord(named, error.details[other]);
|
|
3581
3641
|
throw new CliError("not_found", `${JSON.stringify(ref)} is a ${other}, not a ${flag === "--from" ? "chat" : "group"}: ghostly listen ${flag === "--from" ? "--group" : "--from"} ${shown}`, error.details);
|
|
3582
3642
|
}
|
|
3583
3643
|
}
|
|
@@ -3687,6 +3747,29 @@ function readCursor(path) {
|
|
|
3687
3747
|
throw new CliError("bad_request", `${path} holds no event number (${shown}): fix or remove it, or give --since`);
|
|
3688
3748
|
}
|
|
3689
3749
|
/**
|
|
3750
|
+
* Where listen starts: after the event number the cursor file holds, else after `since` (--since: the first start's
|
|
3751
|
+
* place). Before, --since won without a word, and a unit with `--since 0 --cursor f` ran every handled event's hook
|
|
3752
|
+
* again at each restart. A cursor file that holds no number is refused unless --since is given, which starts it.
|
|
3753
|
+
* `known`, once the journal's last event is: says on stderr where it starts. A cursor past it (a profile restored from a
|
|
3754
|
+
* backup, a journal reset, a cursor copied from another profile) starts with new events; before, stderr said "starting
|
|
3755
|
+
* after it" (or nothing, without --since) and the next event wrote a lower number over the file.
|
|
3756
|
+
*/
|
|
3757
|
+
function startAt(since, cursor, say) {
|
|
3758
|
+
let kept;
|
|
3759
|
+
if (since === void 0) kept = readCursor(cursor);
|
|
3760
|
+
else try {
|
|
3761
|
+
kept = readCursor(cursor);
|
|
3762
|
+
} catch {}
|
|
3763
|
+
return {
|
|
3764
|
+
from: kept ?? since,
|
|
3765
|
+
known: (lastSeq) => {
|
|
3766
|
+
if (kept === void 0) return;
|
|
3767
|
+
if (kept > lastSeq) say(`ghostly: ${cursor} holds event ${kept}, past this profile's last event (${lastSeq}): starting with new events`);
|
|
3768
|
+
else if (since !== void 0 && kept !== since) say(`ghostly: ${cursor} holds event ${kept}: starting after it, not after --since ${since}`);
|
|
3769
|
+
}
|
|
3770
|
+
};
|
|
3771
|
+
}
|
|
3772
|
+
/**
|
|
3690
3773
|
* Whether a cursor can be kept at `path`, asked before anything starts: its folder is there and takes a file. Before, a
|
|
3691
3774
|
* folder that was not there was found at the first event: the listener ran, said "event N failed: ENOENT" for each one
|
|
3692
3775
|
* and never wrote the cursor, so the next start began at the journal's end and skipped what came while it was down.
|
|
@@ -4123,14 +4206,17 @@ function followDaemon(address, client, handle, since, holdMs = PAUSE_HOLD_MS, pr
|
|
|
4123
4206
|
if (current) current.resume();
|
|
4124
4207
|
else reconnect(0);
|
|
4125
4208
|
});
|
|
4126
|
-
const follow = (c) =>
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4209
|
+
const follow = (c) => {
|
|
4210
|
+
const asked = feed.since;
|
|
4211
|
+
return c.subscribe(asked, feed.take, () => {
|
|
4212
|
+
if (current !== c) return;
|
|
4213
|
+
current = null;
|
|
4214
|
+
reconnect(1e3);
|
|
4215
|
+
}).then((answer) => {
|
|
4216
|
+
if (typeof answer?.lastSeq === "number" && feed.since === asked && (asked === void 0 || asked > answer.lastSeq)) feed.since = answer.lastSeq;
|
|
4217
|
+
return answer;
|
|
4218
|
+
});
|
|
4219
|
+
};
|
|
4134
4220
|
return {
|
|
4135
4221
|
subscribed: follow(client),
|
|
4136
4222
|
close: () => {
|
|
@@ -4139,8 +4225,7 @@ function followDaemon(address, client, handle, since, holdMs = PAUSE_HOLD_MS, pr
|
|
|
4139
4225
|
}
|
|
4140
4226
|
};
|
|
4141
4227
|
}
|
|
4142
|
-
|
|
4143
|
-
//#region src/secretInput.ts
|
|
4228
|
+
// src/secretInput.ts
|
|
4144
4229
|
/**
|
|
4145
4230
|
* Secrets a command takes (a Cashu token, an API key, a card's form) come on stdin: on the command line they show in
|
|
4146
4231
|
* `ps` to every user of the machine while the command runs, and stay in the shell's history. Still taken there, with
|
|
@@ -4242,6 +4327,14 @@ async function textFromStdin(read, command, asked, note) {
|
|
|
4242
4327
|
})).replace(/\n$/, "");
|
|
4243
4328
|
}
|
|
4244
4329
|
/**
|
|
4330
|
+
* `identity complete <draft> --stdin` (or `--evidence-file -`): what the tool printed, from stdin. A terminal (a read
|
|
4331
|
+
* that would wait on the keyboard without a word) is a usage error, as identity add --stdin's is.
|
|
4332
|
+
*/
|
|
4333
|
+
async function evidenceFromStdin(read, draft, tty = false) {
|
|
4334
|
+
if (tty) throw new CliError("usage", `Missing what the tool printed: stdin is a terminal; pipe it in (… | ghostly identity complete ${draft}) or give --evidence-file f`);
|
|
4335
|
+
return read();
|
|
4336
|
+
}
|
|
4337
|
+
/**
|
|
4245
4338
|
* `identity complete <draft>` with neither --evidence-file nor --stdin, stdin not a terminal: asked with nothing first,
|
|
4246
4339
|
* since a published record takes none; a draft that answers it takes a tool's output (`details.needs`) is asked again
|
|
4247
4340
|
* with what was piped, read as a send reads its text.
|
|
@@ -4355,23 +4448,22 @@ function secretValuesWarning(list, type, provider, names) {
|
|
|
4355
4448
|
if (!secret.length) return void 0;
|
|
4356
4449
|
return `${secret.map((name) => `--value ${name}`).join(", ")} on the command line shows in ps and the shell's history: give ${secret.length > 1 ? "them" : "it"} on stdin instead (--stdin, name=value lines)`;
|
|
4357
4450
|
}
|
|
4358
|
-
|
|
4359
|
-
//#region src/main.ts
|
|
4451
|
+
// src/main.ts
|
|
4360
4452
|
var VERSION = package_default.version;
|
|
4361
4453
|
/**
|
|
4362
4454
|
* The engine's modules (the API, the host, the backup, the buttons) are loaded only where a command needs them here: a
|
|
4363
4455
|
* command a running daemon answers loads none of them, and starts about as fast as Node does. Statically imported, they
|
|
4364
4456
|
* cost every command ~100 ms before its socket was opened.
|
|
4365
4457
|
*/
|
|
4366
|
-
var engineApi = () => import("./api-
|
|
4367
|
-
var engineHost = () => import("./host-
|
|
4458
|
+
var engineApi = () => import("./api-DYMKyb1k.js");
|
|
4459
|
+
var engineHost = () => import("./host-z0FAHP9Z.js");
|
|
4368
4460
|
/**
|
|
4369
4461
|
* `--translate <lang>`'s translator, or null (not asked; or the runtime is not there, said on stderr). Loaded only when
|
|
4370
4462
|
* asked: the app's message parser it reads costs every other command nothing.
|
|
4371
4463
|
*/
|
|
4372
4464
|
async function translatorFor(value, home) {
|
|
4373
4465
|
if (value === void 0) return null;
|
|
4374
|
-
const { loadDetector, openTranslator, translateTarget } = await import("./translate-
|
|
4466
|
+
const { loadDetector, openTranslator, translateTarget } = await import("./translate-BcbSWkuq.js");
|
|
4375
4467
|
return openTranslator({
|
|
4376
4468
|
home,
|
|
4377
4469
|
to: translateTarget(value),
|
|
@@ -4519,12 +4611,21 @@ function newChatOnly(method) {
|
|
|
4519
4611
|
function oneChatOnly(method, params) {
|
|
4520
4612
|
return newChatOnly(method) || (chatOnly(method, params) || chatOrGroup(method, params)) && typeof params.chat === "string";
|
|
4521
4613
|
}
|
|
4522
|
-
/**
|
|
4614
|
+
/**
|
|
4615
|
+
* What a member says in one group, over that group's own edges: no 1:1 chat carries any of it. The admin's name,
|
|
4616
|
+
* picture, call node, hubs and fresh secret too (the group's metadata or a commit). Not `group.remove` (the one removed hears it
|
|
4617
|
+
* over the chat that invited them) nor `group.admin` (the new admin takes back the invitations still out).
|
|
4618
|
+
*/
|
|
4523
4619
|
var GROUP_EDGES_ONLY = /* @__PURE__ */ new Set([
|
|
4524
4620
|
"group.send",
|
|
4525
4621
|
"group.edit",
|
|
4526
4622
|
"group.react",
|
|
4527
|
-
"group.typing"
|
|
4623
|
+
"group.typing",
|
|
4624
|
+
"group.rename",
|
|
4625
|
+
"group.picture",
|
|
4626
|
+
"group.call",
|
|
4627
|
+
"group.hub",
|
|
4628
|
+
"group.rotate"
|
|
4528
4629
|
]);
|
|
4529
4630
|
/**
|
|
4530
4631
|
* A command about one group that goes over its edges only (`GROUP_EDGES_ONLY`): a one-shot for it leaves the saved 1:1
|
|
@@ -4541,7 +4642,11 @@ function oneGroupOnly(method) {
|
|
|
4541
4642
|
* so its start reads each chat's newest row (its place in `chat list`) and no history. It read every 1:1 chat whole:
|
|
4542
4643
|
* `profile show` took 0.8 s and 243 MB instead of 0.45 s and 162 MB with 53,800 messages in the profile, and
|
|
4543
4644
|
* `group list` 0.89 s and 220 MB instead of 0.42 s and 154 MB with 50,000. A group's own reads need its history only,
|
|
4544
|
-
* which its start reads whatever this says.
|
|
4645
|
+
* which its start reads whatever this says. The wallet's reads come from its own stores (proofs, wallet history,
|
|
4646
|
+
* payments), none from a chat's history: `wallet list` took 1.3 s and 239 MB instead of 0.48 s and 146 MB with 50,000
|
|
4647
|
+
* messages; `payment list --chat` starts the chat it names. `identity providers` reads nothing of the profile, and
|
|
4648
|
+
* `call auto` and `group auto` with no on|off what it keeps: each took 1.6 s and 211 MB instead of 0.8 s and 152 MB
|
|
4649
|
+
* with 50,000.
|
|
4545
4650
|
*/
|
|
4546
4651
|
var NO_HISTORY_READS = /* @__PURE__ */ new Set([
|
|
4547
4652
|
"status",
|
|
@@ -4556,11 +4661,35 @@ var NO_HISTORY_READS = /* @__PURE__ */ new Set([
|
|
|
4556
4661
|
"service.list",
|
|
4557
4662
|
"identity.list",
|
|
4558
4663
|
"x401.credential.list",
|
|
4559
|
-
"app.served"
|
|
4664
|
+
"app.served",
|
|
4665
|
+
"wallet.list",
|
|
4666
|
+
"wallet.history",
|
|
4667
|
+
"payment.list",
|
|
4668
|
+
"identity.providers"
|
|
4560
4669
|
]);
|
|
4561
|
-
/**
|
|
4562
|
-
|
|
4563
|
-
|
|
4670
|
+
/**
|
|
4671
|
+
* Changes kept outside any chat (this profile's status, which each chat says on its next session; x401 keys and
|
|
4672
|
+
* credentials; a service; a draft; a served app), and `call answer` and `call flush`, which a one-shot refuses whatever
|
|
4673
|
+
* the chats say: a one-shot for one leaves every saved chat unstarted too. Each read every 1:1 chat whole first: with
|
|
4674
|
+
* 30,000 messages in the profile, about 0.95 s and 200 MB instead of 0.45 s and 140 MB.
|
|
4675
|
+
*/
|
|
4676
|
+
var NO_HISTORY_WRITES = /* @__PURE__ */ new Set([
|
|
4677
|
+
"status.set",
|
|
4678
|
+
"status.clear",
|
|
4679
|
+
"x401.key.new",
|
|
4680
|
+
"x401.credential.add",
|
|
4681
|
+
"x401.credential.remove",
|
|
4682
|
+
"service.add",
|
|
4683
|
+
"identity.cancel",
|
|
4684
|
+
"app.serve",
|
|
4685
|
+
"app.unserve",
|
|
4686
|
+
"call.answer",
|
|
4687
|
+
"call.flush"
|
|
4688
|
+
]);
|
|
4689
|
+
/** Whether a one-shot for this call leaves every saved chat unstarted, its history unread (`NO_HISTORY_READS`, `NO_HISTORY_WRITES`). */
|
|
4690
|
+
function readsNoHistory(method, params = {}) {
|
|
4691
|
+
if (method === "call.auto" || method === "group.auto") return params.on === void 0;
|
|
4692
|
+
return NO_HISTORY_READS.has(method) || NO_HISTORY_WRITES.has(method);
|
|
4564
4693
|
}
|
|
4565
4694
|
/**
|
|
4566
4695
|
* Calls that only read what the profile stores: a one-shot for one opens it offline (`RuntimeOptions.offline`).
|
|
@@ -4925,9 +5054,10 @@ async function oneShotJoinWait(s, result, label) {
|
|
|
4925
5054
|
stage
|
|
4926
5055
|
};
|
|
4927
5056
|
if (view.paired) return { answer };
|
|
5057
|
+
const typed = label?.trim();
|
|
4928
5058
|
return {
|
|
4929
5059
|
answer,
|
|
4930
|
-
note: `Not paired yet: the inviter's app is offline. It pairs when both are online: keep this profile running (ghostly daemon --detach), then ghostly chat wait ${
|
|
5060
|
+
note: `Not paired yet: the inviter's app is offline. It pairs when both are online: keep this profile running (ghostly daemon --detach), then ghostly chat wait ${!!typed && shellWord(typed, "") === typed && await s.call("chat.get", { chat: typed }).then((chat) => chat?.id === result.chat, () => false) ? typed : String(result.chat)} --until paired`
|
|
4931
5061
|
};
|
|
4932
5062
|
}
|
|
4933
5063
|
/**
|
|
@@ -4979,7 +5109,7 @@ var SPECIAL = [
|
|
|
4979
5109
|
"A backup of the profile, encrypted with a passphrase (from a file or GHOSTLY_BACKUP_PASSPHRASE); --no-passphrase makes one anyone can read",
|
|
4980
5110
|
{
|
|
4981
5111
|
out: o("string", "The backup file to write"),
|
|
4982
|
-
"passphrase-file": o("string", "The passphrase, from this file, or stdin for - (else GHOSTLY_BACKUP_PASSPHRASE)"),
|
|
5112
|
+
"passphrase-file": o("string", "The passphrase, from this file, or stdin for - (else GHOSTLY_BACKUP_PASSPHRASE). One line break at its end is left out; any other space or line break at an end is refused"),
|
|
4983
5113
|
passphrase: {
|
|
4984
5114
|
...o("boolean", "Do not encrypt. The file then holds the profile's keys and wallet secrets in the clear"),
|
|
4985
5115
|
negatedOnly: true
|
|
@@ -4991,7 +5121,7 @@ var SPECIAL = [
|
|
|
4991
5121
|
"profile restore <file> <new profile> [--passphrase-file f] [--use]",
|
|
4992
5122
|
"A backup into a new profile (a backup made with --no-passphrase needs none)",
|
|
4993
5123
|
{
|
|
4994
|
-
"passphrase-file": o("string", "The passphrase, from this file, or stdin for - (else GHOSTLY_BACKUP_PASSPHRASE)"),
|
|
5124
|
+
"passphrase-file": o("string", "The passphrase, from this file, or stdin for - (else GHOSTLY_BACKUP_PASSPHRASE). One line break at its end is left out"),
|
|
4995
5125
|
use: o("boolean", "Make it the current profile")
|
|
4996
5126
|
}
|
|
4997
5127
|
],
|
|
@@ -5022,8 +5152,8 @@ var SPECIAL = [
|
|
|
5022
5152
|
"listen [--since seq] [--cursor file] [--type t]... [--turns] [--from <chat|key>]... [--group <group>]... [--exec cmd] [--webhook url] [--print] [--translate lang]",
|
|
5023
5153
|
"Stream events as JSON lines (starts the profile here if no daemon runs it)",
|
|
5024
5154
|
{
|
|
5025
|
-
since: o("number", "Replay events after this seq first"),
|
|
5026
|
-
cursor: o("string", "A file that keeps the last seq handled (read at start, written after each event)"),
|
|
5155
|
+
since: o("number", "Replay events after this seq first (with --cursor: only while its file holds no seq yet)"),
|
|
5156
|
+
cursor: o("string", "A file that keeps the last seq handled (read at start, written after each event); its seq wins over --since"),
|
|
5027
5157
|
type: o("list", "Only events of this type (message.received) or family (message, or group.typing.); repeat for more"),
|
|
5028
5158
|
turns: o("boolean", "Only agent turns: each message received, and each group message that mentions you, as one agent.turn event"),
|
|
5029
5159
|
from: o("list", "Only this chat's events (id, a label given here or the contact's key; again for more)"),
|
|
@@ -5147,7 +5277,7 @@ function helpRow(label, text, at, columns) {
|
|
|
5147
5277
|
var FIRST_STEPS = [
|
|
5148
5278
|
"First steps:",
|
|
5149
5279
|
" $ ghostly invite create --label alice make an invite for a contact",
|
|
5150
|
-
" $ printf '%s' \"$INVITE\" | ghostly invite join
|
|
5280
|
+
" $ printf '%s' \"$INVITE\" | ghostly invite join join one, from stdin",
|
|
5151
5281
|
" $ ghostly daemon --detach keep the profile online",
|
|
5152
5282
|
" $ ghostly help <command> one command and its options"
|
|
5153
5283
|
];
|
|
@@ -5334,7 +5464,7 @@ async function profileCommand(sub, argv) {
|
|
|
5334
5464
|
noMoreThan(1, parsed.positionals, "profile create <name> [--use] [--name <shown name>] [--force]");
|
|
5335
5465
|
const shownName = parsed.options.name === void 0 ? void 0 : checkShownNameOption(parsed.options.name);
|
|
5336
5466
|
const force = parsed.options.force === true;
|
|
5337
|
-
if (shownName) (await import("./secretGuard-
|
|
5467
|
+
if (shownName) (await import("./secretGuard-BmmnEbYf.js")).guardText(shownName, force, "name", "set it");
|
|
5338
5468
|
const paths = createProfile(g.home, name);
|
|
5339
5469
|
let shown = null;
|
|
5340
5470
|
if (shownName !== void 0) try {
|
|
@@ -5421,7 +5551,7 @@ async function profileCommand(sub, argv) {
|
|
|
5421
5551
|
...light
|
|
5422
5552
|
} : {
|
|
5423
5553
|
path,
|
|
5424
|
-
passphrase: await backupPassphrase(parsed.options["passphrase-file"]),
|
|
5554
|
+
passphrase: cleanEnds(await backupPassphrase(parsed.options["passphrase-file"]), parsed.options["passphrase-file"]),
|
|
5425
5555
|
...light
|
|
5426
5556
|
};
|
|
5427
5557
|
const made = await withSession(g, (s) => s.call("profile.backup", params), { offline: true });
|
|
@@ -5434,7 +5564,7 @@ async function profileCommand(sub, argv) {
|
|
|
5434
5564
|
if (!given || !name) throw new CliError("usage", `Missing <${given ? "new profile" : "file"}>: ghostly profile restore <file> <new profile> [--passphrase-file f] [--use]`);
|
|
5435
5565
|
noMoreThan(2, parsed.positionals, "profile restore <file> <new profile> [--passphrase-file f] [--use]");
|
|
5436
5566
|
const file = here(given);
|
|
5437
|
-
const { backupFileProtection, restoreProfile } = await import("./backup-
|
|
5567
|
+
const { backupFileProtection, restoreProfile } = await import("./backup-COX6j1_W.js");
|
|
5438
5568
|
const protection = await backupFileProtection(file);
|
|
5439
5569
|
const paths = await restoreProfile(g.home, checkProfileName(name), file, protection === "none" ? void 0 : await backupPassphrase(parsed.options["passphrase-file"], RESTORE_PASSPHRASE));
|
|
5440
5570
|
if (parsed.options.use) selectProfile(g.home, name);
|
|
@@ -5477,10 +5607,13 @@ var BACKUP_PASSPHRASE = "The backup passphrase comes from --passphrase-file or G
|
|
|
5477
5607
|
/** Restore takes no --no-passphrase: a backup made without one says so itself. */
|
|
5478
5608
|
var RESTORE_PASSPHRASE = "This backup is encrypted: its passphrase comes from --passphrase-file or GHOSTLY_BACKUP_PASSPHRASE";
|
|
5479
5609
|
var PASSPHRASE_ON_LINE = "The passphrase comes from --passphrase-file or GHOSTLY_BACKUP_PASSPHRASE, never the command line";
|
|
5480
|
-
/**
|
|
5610
|
+
/**
|
|
5611
|
+
* `--passphrase` or `--passphrase=<value>` before any `--` (after it, words are positionals), or a typo of it
|
|
5612
|
+
* (`--pasphrase=<value>`): before, that was "did you mean --passphrase?", the one form refused here.
|
|
5613
|
+
*/
|
|
5481
5614
|
var passphraseOnLine = (argv) => {
|
|
5482
5615
|
const end = argv.indexOf("--");
|
|
5483
|
-
return (end === -1 ? argv : argv.slice(0, end)).some((arg) => arg
|
|
5616
|
+
return (end === -1 ? argv : argv.slice(0, end)).some((arg) => arg.startsWith("--") && nearest(arg.slice(2).split("=")[0], ["passphrase"]) === "passphrase");
|
|
5484
5617
|
};
|
|
5485
5618
|
/**
|
|
5486
5619
|
* The backup passphrase: from a file or the environment, never the command line (it would sit in shell history). The
|
|
@@ -5505,6 +5638,29 @@ async function backupPassphrase(file, missing = BACKUP_PASSPHRASE) {
|
|
|
5505
5638
|
if (!value) throw new CliError("bad_request", `${file === "-" ? "Stdin" : file} is empty: it holds the backup's passphrase`);
|
|
5506
5639
|
return value;
|
|
5507
5640
|
}
|
|
5641
|
+
var END_NAMES = {
|
|
5642
|
+
" ": "a space",
|
|
5643
|
+
" ": "a tab",
|
|
5644
|
+
"\r": "a carriage return",
|
|
5645
|
+
"\n": "a line break",
|
|
5646
|
+
"": "a byte order mark"
|
|
5647
|
+
};
|
|
5648
|
+
var endName = (char) => END_NAMES[char] ?? `U+${char.codePointAt(0).toString(16).toUpperCase().padStart(4, "0")} (a space)`;
|
|
5649
|
+
/**
|
|
5650
|
+
* A new backup's passphrase, refused when it starts or ends with whitespace or a byte order mark, or holds a NUL (a
|
|
5651
|
+
* file saved as UTF-16): only the one line break at a file's end is left out, so the same passphrase typed, pasted or
|
|
5652
|
+
* held by a password manager would open nothing ("Wrong passphrase"). Restore takes any passphrase: old backups open.
|
|
5653
|
+
*/
|
|
5654
|
+
function cleanEnds(passphrase, file) {
|
|
5655
|
+
const source = typeof file !== "string" ? "GHOSTLY_BACKUP_PASSPHRASE" : file === "-" ? "stdin" : file;
|
|
5656
|
+
if (passphrase.includes("\0")) throw new CliError("bad_request", `${source} holds a NUL: a file saved as UTF-16? Save the passphrase as UTF-8 text`);
|
|
5657
|
+
const trimmed = passphrase.trim();
|
|
5658
|
+
if (trimmed === passphrase) return passphrase;
|
|
5659
|
+
const at = trimmed && passphrase.startsWith(trimmed) ? "ends" : "starts";
|
|
5660
|
+
const char = at === "ends" ? passphrase.at(-1) : passphrase[0];
|
|
5661
|
+
const fileRule = typeof file === "string" ? " (one line break at its end is left out already)" : "";
|
|
5662
|
+
throw new CliError("bad_request", `The passphrase in ${source} ${at} with ${endName(char)}${fileRule}: the same passphrase typed or pasted would not open the backup. Take it out`);
|
|
5663
|
+
}
|
|
5508
5664
|
/** Set on `startDetached`'s child: its parent waits for the profile and starts it again, so the child does not wait too. */
|
|
5509
5665
|
var DETACHED_CHILD = "GHOSTLY_DAEMON_DETACHED";
|
|
5510
5666
|
/**
|
|
@@ -5981,7 +6137,7 @@ async function listenCommand(argv) {
|
|
|
5981
6137
|
const from = parsed.options.from ?? [], groups = parsed.options.group ?? [];
|
|
5982
6138
|
const cursor = here(parsed.options.cursor);
|
|
5983
6139
|
checkCursor(cursor);
|
|
5984
|
-
const
|
|
6140
|
+
const starting = startAt(since(parsed.options), cursor, (line) => process.stderr.write(line + "\n")), since$1 = starting.from;
|
|
5985
6141
|
const translator = await translatorFor(parsed.options.translate, g.home);
|
|
5986
6142
|
let quit = (code) => {
|
|
5987
6143
|
process.exit(code);
|
|
@@ -6046,8 +6202,9 @@ async function listenCommand(argv) {
|
|
|
6046
6202
|
process.exit(code);
|
|
6047
6203
|
};
|
|
6048
6204
|
onReaderGone(stop);
|
|
6049
|
-
await following.subscribed;
|
|
6050
6205
|
onStopSignals(stop);
|
|
6206
|
+
const answer = await following.subscribed;
|
|
6207
|
+
if (typeof answer?.lastSeq === "number") starting.known(answer.lastSeq);
|
|
6051
6208
|
return;
|
|
6052
6209
|
}
|
|
6053
6210
|
const [{ keepServing, serve }, { callApi }] = await Promise.all([engineHost(), engineApi()]);
|
|
@@ -6101,6 +6258,7 @@ async function listenCommand(argv) {
|
|
|
6101
6258
|
off?.();
|
|
6102
6259
|
off = null;
|
|
6103
6260
|
}, open);
|
|
6261
|
+
starting.known(host.ctx.hub.lastSeq);
|
|
6104
6262
|
open(since$1);
|
|
6105
6263
|
host.ctx.hub.emit("daemon.started", `daemon.started:${process.pid}:${Date.now()}`, {
|
|
6106
6264
|
pid: process.pid,
|
|
@@ -6253,7 +6411,7 @@ async function textCommand(name, argv) {
|
|
|
6253
6411
|
};
|
|
6254
6412
|
if (spec.target === "group") params.mentions = parsed.options.mention ?? [];
|
|
6255
6413
|
if (parsed.options.reply !== void 0) params.reply = parsed.options.reply;
|
|
6256
|
-
if (!spec.message) Object.assign(params, (await import("./buttons-
|
|
6414
|
+
if (!spec.message) Object.assign(params, (await import("./buttons-Bq7pTXqF.js")).buttonsOf(parsed.options));
|
|
6257
6415
|
print(await withSession(g, (s) => {
|
|
6258
6416
|
if (parsed.options.wait !== void 0) params.wait = parsed.options.wait;
|
|
6259
6417
|
if (parsed.options.timeout !== void 0) params.timeout = parsed.options.timeout;
|
|
@@ -6297,7 +6455,7 @@ async function identityAddCommand(argv) {
|
|
|
6297
6455
|
if (!provider) throw new CliError("usage", "Missing <provider>: ghostly identity add <provider> [subject] [--signer id] [--field name=value]... [--stdin] [--days n] [--timeout s]");
|
|
6298
6456
|
inRange(parsed.options, "timeout", "a number of seconds", 5, 3600);
|
|
6299
6457
|
const items = parsed.options.field ?? [];
|
|
6300
|
-
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry-
|
|
6458
|
+
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry-B15Yg_1C.js")).IDENTITY_PROVIDERS.find((p) => p.id === provider) : void 0;
|
|
6301
6459
|
if (known && parsed.options.days !== void 0) inRange(parsed.options, "days", "a whole number", 1, known.validity.maxDays, true);
|
|
6302
6460
|
const { fields, warning } = await identityFields(items, parsed.options.stdin === true, identitySecretFields(known, parsed.options.signer), readStdin, process.stdin.isTTY === true);
|
|
6303
6461
|
if (warning) process.stderr.write(`ghostly: ${warning}\n`);
|
|
@@ -6372,7 +6530,7 @@ async function tableCommand(name, argv) {
|
|
|
6372
6530
|
} catch (error) {
|
|
6373
6531
|
throw localFileError(error, params.evidenceFile) ?? error;
|
|
6374
6532
|
}
|
|
6375
|
-
else if (params.stdin) params.evidence = await readStdin();
|
|
6533
|
+
else if (params.stdin) params.evidence = await evidenceFromStdin(readStdin, String(params.draft), process.stdin.isTTY === true);
|
|
6376
6534
|
delete params.evidenceFile;
|
|
6377
6535
|
delete params.stdin;
|
|
6378
6536
|
}
|
|
@@ -6402,12 +6560,12 @@ async function tableCommand(name, argv) {
|
|
|
6402
6560
|
return result;
|
|
6403
6561
|
}, {
|
|
6404
6562
|
deferGroups: chatOnly(command.method, params) || newChatOnly(command.method),
|
|
6405
|
-
deferChats: oneChatOnly(command.method, params) || oneGroupOnly(command.method) || readsNoHistory(command.method),
|
|
6563
|
+
deferChats: oneChatOnly(command.method, params) || oneGroupOnly(command.method) || readsNoHistory(command.method, params),
|
|
6406
6564
|
offline: offlineCall(command.method, params)
|
|
6407
6565
|
});
|
|
6408
6566
|
if (translator) {
|
|
6409
6567
|
try {
|
|
6410
|
-
printAnswer(await (await import("./translate-
|
|
6568
|
+
printAnswer(await (await import("./translate-BcbSWkuq.js")).translateAnswer(result, translator));
|
|
6411
6569
|
} finally {
|
|
6412
6570
|
translator.close();
|
|
6413
6571
|
}
|
|
@@ -6657,7 +6815,6 @@ async function run(argv) {
|
|
|
6657
6815
|
exit(EXIT[failure.code]);
|
|
6658
6816
|
}
|
|
6659
6817
|
}
|
|
6660
|
-
//#endregion
|
|
6661
6818
|
export { run };
|
|
6662
6819
|
|
|
6663
|
-
//# sourceMappingURL=main-
|
|
6820
|
+
//# sourceMappingURL=main-CVqkvuIo.js.map
|