@ghostlytools/cli 1.13.2 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/assets/{api-DV52o7A8.js → api-B5qxNMgg.js} +2 -2
- package/dist/assets/{api-O57SNJcb.js → api-iiij_pP5.js} +213 -59
- package/dist/assets/api-iiij_pP5.js.map +1 -0
- package/dist/assets/{apiKit-CPTFJHA7.js → apiKit-BPuHOoXF.js} +17 -3
- package/dist/assets/apiKit-BPuHOoXF.js.map +1 -0
- package/dist/assets/{appFetch-Ca9DNQQ2.js → appFetch-D89FnCxr.js} +2 -2
- package/dist/assets/{appFetch-Ca9DNQQ2.js.map → appFetch-D89FnCxr.js.map} +1 -1
- package/dist/assets/{apps-uZTu5FlR.js → apps-BpZcd86Y.js} +1 -1
- package/dist/assets/{apps-gXpGFPiv.js → apps-D2YGSPJe.js} +45 -19
- package/dist/assets/apps-D2YGSPJe.js.map +1 -0
- package/dist/assets/{backup-CxH3auHB.js → backup-BrMe9VPY.js} +11 -6
- package/dist/assets/backup-BrMe9VPY.js.map +1 -0
- package/dist/assets/{backup-Di2U6QVH.js → backup-COkkM8Yy.js} +1 -1
- package/dist/assets/bark_ffi_wasm_bg-CjjCN3FD.js +5 -0
- package/dist/assets/{bitcoind-BpZn3bRN.js → bitcoind-CK1QEUHn.js} +2 -2
- package/dist/assets/{bitcoind-BpZn3bRN.js.map → bitcoind-CK1QEUHn.js.map} +1 -1
- package/dist/assets/bitcoindevkit_bg-D6IFIaJi.js +5 -0
- package/dist/assets/{blobFiles-DDs34n0r.js → blobFiles-DA3UEn37.js} +3 -3
- package/dist/assets/{blobFiles-DDs34n0r.js.map → blobFiles-DA3UEn37.js.map} +1 -1
- package/dist/assets/buttons-BWEdoxgK.js +1 -0
- package/dist/assets/{buttons-D4udKEvT.js → buttons-UsDPQJsQ.js} +4 -4
- package/dist/assets/{buttons-D4udKEvT.js.map → buttons-UsDPQJsQ.js.map} +1 -1
- package/dist/assets/{client-DGx7E8b3.js → client-Cj-VLeTs.js} +2 -2
- package/dist/assets/{client-DGx7E8b3.js.map → client-Cj-VLeTs.js.map} +1 -1
- package/dist/assets/{fedimintSdk-D-6H9Pe7.js → fedimintSdk-eLXBrj9i.js} +2 -2
- package/dist/assets/{fedimintSdk-D-6H9Pe7.js.map → fedimintSdk-eLXBrj9i.js.map} +1 -1
- package/dist/assets/fedimint_client_wasm_bg-CRQlnJdu.js +5 -0
- package/dist/assets/{fileBytes-CfvUXdSy.js → fileBytes-B2jXQI8e.js} +3 -3
- package/dist/assets/{fileBytes-CfvUXdSy.js.map → fileBytes-B2jXQI8e.js.map} +1 -1
- package/dist/assets/{fileBytes-tj6-VZcB.js → fileBytes-BQrW3m-d.js} +2 -2
- package/dist/assets/{fileBytes-tj6-VZcB.js.map → fileBytes-BQrW3m-d.js.map} +1 -1
- package/dist/assets/{fileBytes-CCKbwqG_.js → fileBytes-CtjxJ6AL.js} +1 -1
- package/dist/assets/{fileBytesIdb-BJirUAjI.js → fileBytesIdb-B7Wjw0S8.js} +3 -3
- package/dist/assets/{fileBytesIdb-BJirUAjI.js.map → fileBytesIdb-B7Wjw0S8.js.map} +1 -1
- package/dist/assets/fileBytesIdb-Fcj2mwj6.js +1 -0
- package/dist/assets/{fileBytesOpfs-DRUYLER4.js → fileBytesOpfs-BW0u-_f_.js} +3 -3
- package/dist/assets/{fileBytesOpfs-DRUYLER4.js.map → fileBytesOpfs-BW0u-_f_.js.map} +1 -1
- package/dist/assets/{fixedHosts-CODN2pTL.js → fixedHosts-CrO01M_y.js} +3 -3
- package/dist/assets/{fixedHosts-CODN2pTL.js.map → fixedHosts-CrO01M_y.js.map} +1 -1
- package/dist/assets/{groupMeta-CeZpqVVC.js → groupMeta-DHJxOu0K.js} +99 -10
- package/dist/assets/groupMeta-DHJxOu0K.js.map +1 -0
- package/dist/assets/{host-CRA7h5A2.js → host-C4J4y-Zq.js} +187 -29
- package/dist/assets/host-C4J4y-Zq.js.map +1 -0
- package/dist/assets/{idb-ewvbqyDI.js → idb-CmIR_bxg.js} +2 -1
- package/dist/assets/idb-CmIR_bxg.js.map +1 -0
- package/dist/assets/{identityProofs-B8zCp5_0.js → identityProofs-C0rIGT6y.js} +20 -3
- package/dist/assets/identityProofs-C0rIGT6y.js.map +1 -0
- package/dist/assets/{irohWeb-mnOi2Jp7.js → irohWeb-BXgunUhu.js} +113 -33
- package/dist/assets/irohWeb-BXgunUhu.js.map +1 -0
- package/dist/assets/{main-Chc871HV.js → main-BLs-zUTt.js} +68 -28
- package/dist/assets/main-BLs-zUTt.js.map +1 -0
- package/dist/assets/{mainline-CDUXtV-I.js → mainline-CYek1H10.js} +2 -2
- package/dist/assets/{mainline-CDUXtV-I.js.map → mainline-CYek1H10.js.map} +1 -1
- package/dist/assets/{networkReason-DYlPZS5M.js → networkReason-C6LYbjF2.js} +2 -2
- package/dist/assets/{networkReason-DYlPZS5M.js.map → networkReason-C6LYbjF2.js.map} +1 -1
- package/dist/assets/{ownDid-BOuSlDv-.js → ownDid-Dg-8e_hs.js} +6 -5
- package/dist/assets/ownDid-Dg-8e_hs.js.map +1 -0
- package/dist/assets/{ownStatus-CLA1VPkL.js → ownStatus-BOx4vLi6.js} +34 -11
- package/dist/assets/ownStatus-BOx4vLi6.js.map +1 -0
- package/dist/assets/{profiles-BH1bH9aE.js → profiles-BA0ePikY.js} +33 -8
- package/dist/assets/profiles-BA0ePikY.js.map +1 -0
- package/dist/assets/{registry-DAq16T-V.js → registry-DuSwXntJ.js} +1 -1
- package/dist/assets/{registry-DP_-RA-v.js → registry-OoIgxDrO.js} +25 -13
- package/dist/assets/registry-OoIgxDrO.js.map +1 -0
- package/dist/assets/{relay-gJTOYQJZ.js → relay-NT5bf1WA.js} +9 -6
- package/dist/assets/relay-NT5bf1WA.js.map +1 -0
- package/dist/assets/{resolve-B1eQ4dVQ.js → resolve-DUmE70Eo.js} +3 -3
- package/dist/assets/{resolve-B1eQ4dVQ.js.map → resolve-DUmE70Eo.js.map} +1 -1
- package/dist/assets/{restoredRows-D_WSHE7H.js → restoredRows-Cgaxx1xW.js} +2 -2
- package/dist/assets/{restoredRows-D_WSHE7H.js.map → restoredRows-Cgaxx1xW.js.map} +1 -1
- package/dist/assets/{server-Bd2ofxc1.js → server-WWlXICVB.js} +555 -110
- package/dist/assets/server-WWlXICVB.js.map +1 -0
- package/dist/assets/{sshForges-As7dbGXM.js → sshForges-Cfu-dSwc.js} +2 -2
- package/dist/assets/{sshForges-As7dbGXM.js.map → sshForges-Cfu-dSwc.js.map} +1 -1
- package/dist/assets/translate-DnuQMfj0.js.map +1 -1
- package/dist/assets/{usdt-DLmtf8F9.js → usdt-BkO4SY07.js} +2 -2
- package/dist/assets/{usdt-DLmtf8F9.js.map → usdt-BkO4SY07.js.map} +1 -1
- package/dist/assets/{waitNotice-BHuMofaH.js → waitNotice-DSECf6II.js} +2 -2
- package/dist/assets/{waitNotice-BHuMofaH.js.map → waitNotice-DSECf6II.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/assets/api-O57SNJcb.js.map +0 -1
- package/dist/assets/apiKit-CPTFJHA7.js.map +0 -1
- package/dist/assets/apps-gXpGFPiv.js.map +0 -1
- package/dist/assets/backup-CxH3auHB.js.map +0 -1
- package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js +0 -5
- package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +0 -1
- package/dist/assets/bark_ffi_wasm_bg-VNmaJsc9.wasm +0 -0
- package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js +0 -5
- package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +0 -1
- package/dist/assets/bitcoindevkit_bg-DXil67yS.wasm +0 -0
- package/dist/assets/buttons-YTYEqvGC.js +0 -1
- package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js +0 -5
- package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js.map +0 -1
- package/dist/assets/fedimint_client_wasm_bg-DeFtkIv6.wasm +0 -0
- package/dist/assets/fileBytesIdb-B0zzJ6p7.js +0 -1
- package/dist/assets/groupMeta-CeZpqVVC.js.map +0 -1
- package/dist/assets/host-CRA7h5A2.js.map +0 -1
- package/dist/assets/idb-ewvbqyDI.js.map +0 -1
- package/dist/assets/identityProofs-B8zCp5_0.js.map +0 -1
- package/dist/assets/irohWeb-mnOi2Jp7.js.map +0 -1
- package/dist/assets/main-Chc871HV.js.map +0 -1
- package/dist/assets/ownDid-BOuSlDv-.js.map +0 -1
- package/dist/assets/ownStatus-CLA1VPkL.js.map +0 -1
- package/dist/assets/profiles-BH1bH9aE.js.map +0 -1
- package/dist/assets/registry-DP_-RA-v.js.map +0 -1
- package/dist/assets/relay-gJTOYQJZ.js.map +0 -1
- package/dist/assets/server-Bd2ofxc1.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as secretValue, i as localFileError, n as EXIT, o as shownValue, r as asCliError, t as CliError } from "./errors-JVJsO8Iu.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-
|
|
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-Cj-VLeTs.js";
|
|
3
3
|
import { n as dropSecretEnv, t as childEnv } from "./childEnv-C-99hdbL.js";
|
|
4
|
-
import { $n as reactionEmoji, O as GROUP_FILE_LIMITS, On as VOICE_LIMITS, Tr as cardUrl, _r as RUN_RESULTS, fr as CRON_LINE, gr as ROUTINE_STATES, hr as PR_STATES, kr as statusCardBytes, mr as PR_CHECKS, pr as ITEM_STATES, vr as STATUS_CARD_LIMITS, wr as cardLine, xt as STATUS_AVAILABILITIES, yr as TASK_STATUSES } from "./groupMeta-
|
|
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,
|
|
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-
|
|
7
|
-
import {
|
|
8
|
-
import { c as waitsFor, o as longTextChat, r as dhtOnlyNotice, s as waitNotice } from "./waitNotice-
|
|
4
|
+
import { $n as reactionEmoji, O as GROUP_FILE_LIMITS, On as VOICE_LIMITS, Tr as cardUrl, _r as RUN_RESULTS, fr as CRON_LINE, gr as ROUTINE_STATES, hr as PR_STATES, kr as statusCardBytes, mr as PR_CHECKS, pr as ITEM_STATES, vr as STATUS_CARD_LIMITS, wr as cardLine, xt as STATUS_AVAILABILITIES, yr as TASK_STATUSES } from "./groupMeta-DHJxOu0K.js";
|
|
5
|
+
import { S as userPath, T as ownProfile, _ 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, y as selectProfile } from "./profiles-BA0ePikY.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-BOx4vLi6.js";
|
|
7
|
+
import { G as jsonOut, W as shellWord, a as contactKeyOf, b as nameKey, x as namedByThem } from "./apiKit-BPuHOoXF.js";
|
|
8
|
+
import { c as waitsFor, o as longTextChat, r as dhtOnlyNotice, s as waitNotice } from "./waitNotice-DSECf6II.js";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
10
|
import { accessSync, closeSync, constants, existsSync, fstatSync, openSync, readFileSync, readSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { dirname, resolve, sep } from "node:path";
|
|
@@ -14,7 +14,7 @@ import { connect } from "node:net";
|
|
|
14
14
|
import { format } from "node:util";
|
|
15
15
|
var package_default = {
|
|
16
16
|
name: "@ghostlytools/cli",
|
|
17
|
-
version: "1.13.
|
|
17
|
+
version: "1.13.4",
|
|
18
18
|
type: "module",
|
|
19
19
|
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
20
|
license: "MIT",
|
|
@@ -1211,7 +1211,7 @@ var commands$8 = {
|
|
|
1211
1211
|
description: "Replace the three files when they are there"
|
|
1212
1212
|
}
|
|
1213
1213
|
},
|
|
1214
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1214
|
+
run: async ({ options }, a) => (await import("./apps-BpZcd86Y.js")).initApp(a.dir, {
|
|
1215
1215
|
name: options.name,
|
|
1216
1216
|
title: options.title,
|
|
1217
1217
|
force: options.force === true
|
|
@@ -1251,7 +1251,7 @@ var commands$8 = {
|
|
|
1251
1251
|
description: "This version's sequence, higher than the bundle at --out's (default: one more than it)"
|
|
1252
1252
|
}
|
|
1253
1253
|
},
|
|
1254
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1254
|
+
run: async ({ options }, a) => (await import("./apps-BpZcd86Y.js")).publishApp(a.dir, keyFile(options.key, "app publish <dir> --key <file> [--out <file>] [--sequence n]"), here(options.out), options.sequence)
|
|
1255
1255
|
},
|
|
1256
1256
|
"app revoke": {
|
|
1257
1257
|
method: "app.revoke",
|
|
@@ -1284,7 +1284,7 @@ var commands$8 = {
|
|
|
1284
1284
|
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"
|
|
1285
1285
|
}
|
|
1286
1286
|
},
|
|
1287
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1287
|
+
run: async ({ options }, a) => (await import("./apps-BpZcd86Y.js")).revokeApp(a.dir, keyFile(options.key, "app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>] [--force]"), {
|
|
1288
1288
|
digests: options.digest,
|
|
1289
1289
|
upTo: options["up-to"],
|
|
1290
1290
|
reason: options.reason,
|
|
@@ -1345,7 +1345,7 @@ var commands$8 = {
|
|
|
1345
1345
|
usage: "app verify <bundle|url>",
|
|
1346
1346
|
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",
|
|
1347
1347
|
args: ["bundle"],
|
|
1348
|
-
run: async (_, a) => (await import("./apps-
|
|
1348
|
+
run: async (_, a) => (await import("./apps-BpZcd86Y.js")).verifyApp(a.bundle)
|
|
1349
1349
|
},
|
|
1350
1350
|
"store sign": {
|
|
1351
1351
|
method: "store.sign",
|
|
@@ -1362,7 +1362,7 @@ var commands$8 = {
|
|
|
1362
1362
|
description: "The folder to write ghostly-store.json and ghostly-store.sig in (default: the index's)"
|
|
1363
1363
|
}
|
|
1364
1364
|
},
|
|
1365
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1365
|
+
run: async ({ options }, a) => (await import("./apps-BpZcd86Y.js")).signStore(a.index, keyFile(options.key, "store sign <index> --key <file> [--out <dir>]"), here(options.out))
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
1368
|
// src/commands/calls.ts
|
|
@@ -2149,7 +2149,7 @@ var commands$5 = {
|
|
|
2149
2149
|
"file resend": {
|
|
2150
2150
|
method: "file.action",
|
|
2151
2151
|
usage: "file resend [<chat>] <file>",
|
|
2152
|
-
summary: "Send again a file that stopped moving or failed: it goes on from what the contact holds",
|
|
2152
|
+
summary: "Send again a file that stopped moving or failed: it goes on from what the contact holds (not one cancelled or declined: file send it again)",
|
|
2153
2153
|
args: ["chat?", "file"],
|
|
2154
2154
|
params: (_, a) => ({
|
|
2155
2155
|
chat: a.chat,
|
|
@@ -2474,7 +2474,7 @@ var commands$3 = {
|
|
|
2474
2474
|
"group create": {
|
|
2475
2475
|
method: "group.create",
|
|
2476
2476
|
usage: "group create <name...> [--mesh] [--force]",
|
|
2477
|
-
summary: "A community (
|
|
2477
|
+
summary: "A community (anyone who has its link can join) or, with --mesh, a private group of up to 32",
|
|
2478
2478
|
args: ["name..."],
|
|
2479
2479
|
options: {
|
|
2480
2480
|
mesh: {
|
|
@@ -2607,7 +2607,7 @@ var commands$3 = {
|
|
|
2607
2607
|
"group link": {
|
|
2608
2608
|
method: "group.link",
|
|
2609
2609
|
usage: "group link <group> [--off] [--reset]",
|
|
2610
|
-
summary: "
|
|
2610
|
+
summary: "Print the group's link (anyone who has it can join); --reset: a new one, the old one stops working; --off",
|
|
2611
2611
|
args: ["group"],
|
|
2612
2612
|
options: {
|
|
2613
2613
|
off: {
|
|
@@ -4004,6 +4004,14 @@ function runExec(command, event, toStderr, profile) {
|
|
|
4004
4004
|
/** The longest wait between two tries of a webhook that is not answering. */
|
|
4005
4005
|
var RETRY_MAX_MS = 6e4;
|
|
4006
4006
|
/**
|
|
4007
|
+
* The TLS error a failed post met, as Node names it (`DEPTH_ZERO_SELF_SIGNED_CERT`, `ERR_SSL_WRONG_VERSION_NUMBER` for
|
|
4008
|
+
* https:// to a plain http server), or null for any other failure.
|
|
4009
|
+
*/
|
|
4010
|
+
function tlsFailure(error) {
|
|
4011
|
+
const code = error?.cause?.code;
|
|
4012
|
+
return typeof code === "string" && /^ERR_(SSL|TLS)_|CERT|SELF_SIGNED|UNABLE_TO_/.test(code) ? code : null;
|
|
4013
|
+
}
|
|
4014
|
+
/**
|
|
4007
4015
|
* Posts one event; resolves true once the bridge took it, or the status it refused it with (a 4xx or a redirect, posted
|
|
4008
4016
|
* once: before, three times with backoff, three refusals in the bridge's log for an event stderr said was not tried again).
|
|
4009
4017
|
* A bridge that is not there (refused connection, timeout, 5xx, 408, 429) has not handled the event: it is tried again,
|
|
@@ -4013,7 +4021,7 @@ var RETRY_MAX_MS = 6e4;
|
|
|
4013
4021
|
async function post(url, event, retryMs) {
|
|
4014
4022
|
let wait = retryMs, holding = false;
|
|
4015
4023
|
for (let attempt = 0;; attempt++) {
|
|
4016
|
-
let down = true, status = 0;
|
|
4024
|
+
let down = true, status = 0, tls = null;
|
|
4017
4025
|
try {
|
|
4018
4026
|
const response = await fetch(url, {
|
|
4019
4027
|
method: "POST",
|
|
@@ -4033,11 +4041,13 @@ async function post(url, event, retryMs) {
|
|
|
4033
4041
|
}
|
|
4034
4042
|
status = response.status;
|
|
4035
4043
|
down = status >= 500 || status === 408 || status === 429;
|
|
4036
|
-
} catch {
|
|
4044
|
+
} catch (error) {
|
|
4045
|
+
tls = tlsFailure(error);
|
|
4046
|
+
}
|
|
4037
4047
|
if (!down) return status;
|
|
4038
4048
|
if (down && attempt >= 2 && !holding) {
|
|
4039
4049
|
holding = true;
|
|
4040
|
-
process.stderr.write(`ghostly: the webhook at ${url.origin} is not answering: holding event ${event.seq} (${event.type}) until it does\n`);
|
|
4050
|
+
process.stderr.write(tls ? `ghostly: the webhook at ${url.origin} failed TLS (${tls}): holding event ${event.seq} (${event.type}) until it passes; on this machine give it as http://, or restart listen with NODE_EXTRA_CA_CERTS set to the file of the certificate that signed the bridge's\n` : `ghostly: the webhook at ${url.origin} is not answering: holding event ${event.seq} (${event.type}) until it does\n`);
|
|
4041
4051
|
}
|
|
4042
4052
|
await new Promise((resolve) => setTimeout(resolve, wait));
|
|
4043
4053
|
wait = Math.min(wait * 2, RETRY_MAX_MS);
|
|
@@ -4136,7 +4146,8 @@ function eventHandler(options) {
|
|
|
4136
4146
|
return;
|
|
4137
4147
|
}
|
|
4138
4148
|
hook.stopped = true;
|
|
4139
|
-
|
|
4149
|
+
const { seq, type } = hook.event;
|
|
4150
|
+
process.stderr.write(options.cursor ? `ghostly: stopped while --exec ran on event ${seq} (${type}): ended it, and the event is handed again at the next start\n` : `ghostly: stopped while --exec ran on event ${seq} (${type}): ended it; with no --cursor it is not handed again (start with --since ${seq - 1} to run it again)\n`);
|
|
4140
4151
|
hook.signal("SIGTERM");
|
|
4141
4152
|
if (!await within(hook.ended, stopMs)) {
|
|
4142
4153
|
hook.signal("SIGKILL");
|
|
@@ -4491,8 +4502,8 @@ var VERSION = package_default.version;
|
|
|
4491
4502
|
* command a running daemon answers loads none of them, and starts about as fast as Node does. Statically imported, they
|
|
4492
4503
|
* cost every command ~100 ms before its socket was opened.
|
|
4493
4504
|
*/
|
|
4494
|
-
var engineApi = () => import("./api-
|
|
4495
|
-
var engineHost = () => import("./host-
|
|
4505
|
+
var engineApi = () => import("./api-B5qxNMgg.js");
|
|
4506
|
+
var engineHost = () => import("./host-C4J4y-Zq.js");
|
|
4496
4507
|
/**
|
|
4497
4508
|
* `--translate <lang>`'s translator, or null (not asked; or the runtime is not there, said on stderr). Loaded only when
|
|
4498
4509
|
* asked: the app's message parser it reads costs every other command nothing.
|
|
@@ -4709,7 +4720,10 @@ var NO_HISTORY_READS = /* @__PURE__ */ new Set([
|
|
|
4709
4720
|
* Changes kept outside any chat (this profile's status, which each chat says on its next session; x401 keys and
|
|
4710
4721
|
* credentials; a service; a draft; a served app), and `call answer` and `call flush`, which a one-shot refuses whatever
|
|
4711
4722
|
* the chats say: a one-shot for one leaves every saved chat unstarted too. Each read every 1:1 chat whole first: with
|
|
4712
|
-
* 30,000 messages in the profile, about 0.95 s and 200 MB instead of 0.45 s and 140 MB.
|
|
4723
|
+
* 30,000 messages in the profile, about 0.95 s and 200 MB instead of 0.45 s and 140 MB. The wallet's own stores too (an
|
|
4724
|
+
* address, a Lightning card's name or default, a wallet removed): each started every chat, 20 relay requests and 0.35 s
|
|
4725
|
+
* more with 10 chats and 30,000 messages, a refusal too. A removal tells a contact of a request it closes only on a chat
|
|
4726
|
+
* that is open; one away hears when their chat opens.
|
|
4713
4727
|
*/
|
|
4714
4728
|
var NO_HISTORY_WRITES = /* @__PURE__ */ new Set([
|
|
4715
4729
|
"status.set",
|
|
@@ -4722,7 +4736,11 @@ var NO_HISTORY_WRITES = /* @__PURE__ */ new Set([
|
|
|
4722
4736
|
"app.serve",
|
|
4723
4737
|
"app.unserve",
|
|
4724
4738
|
"call.answer",
|
|
4725
|
-
"call.flush"
|
|
4739
|
+
"call.flush",
|
|
4740
|
+
"wallet.address",
|
|
4741
|
+
"lightning.rename",
|
|
4742
|
+
"lightning.default",
|
|
4743
|
+
"wallet.remove"
|
|
4726
4744
|
]);
|
|
4727
4745
|
/** Whether a one-shot for this call leaves every saved chat unstarted, its history unread (`NO_HISTORY_READS`, `NO_HISTORY_WRITES`). */
|
|
4728
4746
|
function readsNoHistory(method, params = {}) {
|
|
@@ -4791,6 +4809,8 @@ var LOCAL_WRITES = /* @__PURE__ */ new Set([
|
|
|
4791
4809
|
"saved.remove",
|
|
4792
4810
|
"app.serve",
|
|
4793
4811
|
"app.unserve",
|
|
4812
|
+
"lightning.rename",
|
|
4813
|
+
"lightning.default",
|
|
4794
4814
|
"status.set",
|
|
4795
4815
|
"status.clear"
|
|
4796
4816
|
]);
|
|
@@ -5218,7 +5238,7 @@ var SPECIAL = [
|
|
|
5218
5238
|
],
|
|
5219
5239
|
[
|
|
5220
5240
|
"settings set <key> <json-value> [--force]",
|
|
5221
|
-
"Change one: relays, irohRelays, hyperdhtRelay, iceServers, publicProfiles, online, shareProfile, sendTyping, autoDownloads, serveFiles, daemonPresence, nick. daemonPresence true: contacts see this profile online while a daemon runs it (off by default). <json-value> - (or none, piped) reads it from stdin: a TURN password stays out of ps",
|
|
5241
|
+
"Change one: relays, irohRelays, hyperdhtRelay, iceServers, publicProfiles, online, shareProfile, sendTyping, autoDownloads, serveFiles, daemonPresence, nick. daemonPresence true: contacts see this profile online while a daemon runs it (off by default). hyperdhtRelay is kept for the apps: this CLI's own HyperDHT does not dial through it. <json-value> - (or none, piped) reads it from stdin: a TURN password stays out of ps",
|
|
5222
5242
|
{ force: o("boolean", "Set a nick even if it looks like a seed, a key or ecash") }
|
|
5223
5243
|
],
|
|
5224
5244
|
[
|
|
@@ -5611,7 +5631,7 @@ async function profileCommand(sub, argv) {
|
|
|
5611
5631
|
if (!given || !name) throw new CliError("usage", `Missing <${given ? "new profile" : "file"}>: ghostly profile restore <file> <new profile> [--passphrase-file f] [--use]`);
|
|
5612
5632
|
noMoreThan(2, parsed.positionals, "profile restore <file> <new profile> [--passphrase-file f] [--use]");
|
|
5613
5633
|
const file = here(given);
|
|
5614
|
-
const { backupFileProtection, restoreProfile } = await import("./backup-
|
|
5634
|
+
const { backupFileProtection, restoreProfile } = await import("./backup-COkkM8Yy.js");
|
|
5615
5635
|
const protection = await backupFileProtection(file);
|
|
5616
5636
|
const paths = await restoreProfile(g.home, checkProfileName(name), file, protection === "none" ? void 0 : await backupPassphrase(parsed.options["passphrase-file"], RESTORE_PASSPHRASE));
|
|
5617
5637
|
if (parsed.options.use) selectProfile(g.home, name);
|
|
@@ -6459,7 +6479,7 @@ async function textCommand(name, argv) {
|
|
|
6459
6479
|
};
|
|
6460
6480
|
if (spec.target === "group") params.mentions = parsed.options.mention ?? [];
|
|
6461
6481
|
if (parsed.options.reply !== void 0) params.reply = parsed.options.reply;
|
|
6462
|
-
if (!spec.message) Object.assign(params, (await import("./buttons-
|
|
6482
|
+
if (!spec.message) Object.assign(params, (await import("./buttons-BWEdoxgK.js")).buttonsOf(parsed.options));
|
|
6463
6483
|
print(await withSession(g, (s) => {
|
|
6464
6484
|
if (parsed.options.wait !== void 0) params.wait = parsed.options.wait;
|
|
6465
6485
|
if (parsed.options.timeout !== void 0) params.timeout = parsed.options.timeout;
|
|
@@ -6503,7 +6523,7 @@ async function identityAddCommand(argv) {
|
|
|
6503
6523
|
if (!provider) throw new CliError("usage", "Missing <provider>: ghostly identity add <provider> [subject] [--signer id] [--field name=value]... [--stdin] [--days n] [--timeout s]");
|
|
6504
6524
|
inRange(parsed.options, "timeout", "a number of seconds", 5, 3600);
|
|
6505
6525
|
const items = parsed.options.field ?? [];
|
|
6506
|
-
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry-
|
|
6526
|
+
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry-DuSwXntJ.js")).IDENTITY_PROVIDERS.find((p) => p.id === provider) : void 0;
|
|
6507
6527
|
if (known && parsed.options.days !== void 0) inRange(parsed.options, "days", "a whole number", 1, known.validity.maxDays, true);
|
|
6508
6528
|
const { fields, warning } = await identityFields(items, parsed.options.stdin === true, identitySecretFields(known, parsed.options.signer), readStdin, process.stdin.isTTY === true);
|
|
6509
6529
|
if (warning) process.stderr.write(`ghostly: ${warning}\n`);
|
|
@@ -6808,6 +6828,23 @@ async function main(input) {
|
|
|
6808
6828
|
throw unknownCommand(first, two ? second : void 0, three ? third : void 0);
|
|
6809
6829
|
}
|
|
6810
6830
|
/**
|
|
6831
|
+
* The app's words for a message action, and the command that does it here: someone coming from the app types `reply`
|
|
6832
|
+
* or `unpin` first, and "did you mean react?" for `unreact` added a reaction instead of taking one back.
|
|
6833
|
+
*/
|
|
6834
|
+
var APP_WORDS = {
|
|
6835
|
+
"reply": "send <chat> --reply <message>",
|
|
6836
|
+
"unpin": "pin <chat> --remove",
|
|
6837
|
+
"unreact": "react <chat> <message> --remove",
|
|
6838
|
+
"delete": "message delete <chat> <message>",
|
|
6839
|
+
"history": "chat history <chat>",
|
|
6840
|
+
"message edit": "edit <chat> <message>",
|
|
6841
|
+
"message react": "react <chat> <message> <emoji>",
|
|
6842
|
+
"message pin": "pin <chat> <message>",
|
|
6843
|
+
"message forward": "forward <chat> <message> --to <chat>"
|
|
6844
|
+
};
|
|
6845
|
+
/** The app's search (in a chat and in the chat list), which the CLI does not have: `chat history` and jq do it. */
|
|
6846
|
+
var SEARCH = ["search", "chat search"];
|
|
6847
|
+
/**
|
|
6811
6848
|
* A command line that names no command. The words of a group (`ghostly chat`, `ghostly wallet frob`, `ghostly x401
|
|
6812
6849
|
* credential`) are answered with the group's commands, as `ghostly help chat` lists them; before, it was only "Unknown
|
|
6813
6850
|
* command: chat". The longest group the words name answers: `x401 credential frob` lists add, list and remove.
|
|
@@ -6819,6 +6856,9 @@ function unknownCommand(first, second, third) {
|
|
|
6819
6856
|
second,
|
|
6820
6857
|
third
|
|
6821
6858
|
].filter((word) => !!word);
|
|
6859
|
+
const said = [asked.slice(0, 2).join(" "), asked[0]].find((words) => words !== void 0 && (Object.hasOwn(APP_WORDS, words) || SEARCH.includes(words)));
|
|
6860
|
+
if (said && SEARCH.includes(said)) return new CliError("usage", `Unknown command: ${said} (the CLI has no search yet: ghostly chat history <chat> --limit n | jq …; ghostly help chat history)`);
|
|
6861
|
+
if (said) return new CliError("usage", `Unknown command: ${said} (ghostly ${APP_WORDS[said]}; ghostly help ${commandWords(APP_WORDS[said]).join(" ")})`);
|
|
6822
6862
|
const all = helpRows().map((row) => commandWords(row.usage));
|
|
6823
6863
|
const takes = (group) => [...new Set(all.filter((words) => words.length > group.length && group.every((word, i) => words[i] === word)).map((words) => words[group.length]))];
|
|
6824
6864
|
const meant = (typed, words) => new CliError("usage", `Unknown command: ${typed.join(" ")} (did you mean ${words.join(" ")}? ghostly help ${words.join(" ")})`);
|
|
@@ -6872,4 +6912,4 @@ async function run(argv) {
|
|
|
6872
6912
|
}
|
|
6873
6913
|
export { run };
|
|
6874
6914
|
|
|
6875
|
-
//# sourceMappingURL=main-
|
|
6915
|
+
//# sourceMappingURL=main-BLs-zUTt.js.map
|