@ghostlytools/cli 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/assets/{api-CVtg7MpI.js → api-DF36rBJK.js} +2 -2
- package/dist/assets/{api-CjOaoG-v.js → api-Dnq86JAA.js} +135 -37
- package/dist/assets/api-Dnq86JAA.js.map +1 -0
- package/dist/assets/{apiKit-BAGvlQtm.js → apiKit-nLK4jeTq.js} +3 -3
- package/dist/assets/{apiKit-BAGvlQtm.js.map → apiKit-nLK4jeTq.js.map} +1 -1
- package/dist/assets/{appFetch-BwJd-kNq.js → appFetch-wqBWi3Ry.js} +2 -2
- package/dist/assets/{appFetch-BwJd-kNq.js.map → appFetch-wqBWi3Ry.js.map} +1 -1
- package/dist/assets/{apps-Cuk45sz5.js → apps-DBVhKpfe.js} +10 -10
- package/dist/assets/apps-DBVhKpfe.js.map +1 -0
- package/dist/assets/{apps-DjY095Af.js → apps-nLtyhC2f.js} +1 -1
- package/dist/assets/{backup-DekVCDWv.js → backup-Bczllmzf.js} +4 -4
- package/dist/assets/{backup-DekVCDWv.js.map → backup-Bczllmzf.js.map} +1 -1
- package/dist/assets/{backup-B56sQqoQ.js → backup-D6s0LQdg.js} +1 -1
- package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +1 -1
- package/dist/assets/{bitcoind-B2bbVSzh.js → bitcoind-DML_-Xbv.js} +2 -2
- package/dist/assets/{bitcoind-B2bbVSzh.js.map → bitcoind-DML_-Xbv.js.map} +1 -1
- package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +1 -1
- package/dist/assets/{buttons-BGxzOtrq.js → buttons-B3C3vdhH.js} +8 -8
- package/dist/assets/buttons-B3C3vdhH.js.map +1 -0
- package/dist/assets/buttons-DaY5FYlV.js +1 -0
- package/dist/assets/{client-DcQAfc3h.js → client-B7jRrSnb.js} +3 -3
- package/dist/assets/{client-DcQAfc3h.js.map → client-B7jRrSnb.js.map} +1 -1
- package/dist/assets/{domainProofs-BDNP1dIy.js → domainProofs-b3Y1Gj9g.js} +6 -2
- package/dist/assets/{domainProofs-BDNP1dIy.js.map → domainProofs-b3Y1Gj9g.js.map} +1 -1
- package/dist/assets/{errors-DDLFO4Gf.js → errors-JVJsO8Iu.js} +18 -2
- package/dist/assets/errors-JVJsO8Iu.js.map +1 -0
- package/dist/assets/{fixedHosts-C3hBliM9.js → fixedHosts-H3i6o9Iy.js} +2 -2
- package/dist/assets/{fixedHosts-C3hBliM9.js.map → fixedHosts-H3i6o9Iy.js.map} +1 -1
- package/dist/assets/{ghostly_iroh_web-DIj5xGmR.js → ghostly_iroh_web-9VOwZcJQ.js} +30 -35
- package/dist/assets/ghostly_iroh_web-9VOwZcJQ.js.map +1 -0
- package/dist/assets/ghostly_iroh_web_bg.wasm +0 -0
- package/dist/assets/{groupMeta-goASqzOt.js → groupMeta--fxSh792.js} +72 -4
- package/dist/assets/groupMeta--fxSh792.js.map +1 -0
- package/dist/assets/{host-C2WRKj3g.js → host-CGzVFfMz.js} +169 -36
- package/dist/assets/host-CGzVFfMz.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-bjNGacf5.js → hyperdhtRelay-B4_wdCtx.js} +2 -2
- package/dist/assets/{hyperdhtRelay-bjNGacf5.js.map → hyperdhtRelay-B4_wdCtx.js.map} +1 -1
- package/dist/assets/{hyperdhtRelay-DLUiwfnt.js → hyperdhtRelay-Ce-gWsRY.js} +2 -2
- package/dist/assets/{hyperdhtRelay-DLUiwfnt.js.map → hyperdhtRelay-Ce-gWsRY.js.map} +1 -1
- package/dist/assets/{irohWeb-NfthOL98.js → irohWeb-Dp1i8v6n.js} +12 -11
- package/dist/assets/irohWeb-Dp1i8v6n.js.map +1 -0
- package/dist/assets/{main-Dh7fePd8.js → main-C8J53SwH.js} +67 -62
- package/dist/assets/main-C8J53SwH.js.map +1 -0
- package/dist/assets/{ownDid-BErplN7N.js → ownDid-oa-T2vmZ.js} +8 -4
- package/dist/assets/ownDid-oa-T2vmZ.js.map +1 -0
- package/dist/assets/{ownStatus-ClrFjd7h.js → ownStatus-Bc08eNJY.js} +6 -6
- package/dist/assets/{ownStatus-ClrFjd7h.js.map → ownStatus-Bc08eNJY.js.map} +1 -1
- package/dist/assets/{pairedTransports-BKmvlKz1.js → pairedTransports-Dppn8lUN.js} +3 -3
- package/dist/assets/pairedTransports-Dppn8lUN.js.map +1 -0
- package/dist/assets/{profiles-B8xO8-oj.js → profiles-B2uy04ph.js} +3 -3
- package/dist/assets/{profiles-B8xO8-oj.js.map → profiles-B2uy04ph.js.map} +1 -1
- package/dist/assets/{registry-CU8PevhI.js → registry-DbTLLs3y.js} +9 -5
- package/dist/assets/registry-DbTLLs3y.js.map +1 -0
- package/dist/assets/{registry--Rg2YvOH.js → registry-bLIfG619.js} +1 -1
- package/dist/assets/{resolve-B1upovPM.js → resolve-DNX-eecG.js} +9 -4
- package/dist/assets/resolve-DNX-eecG.js.map +1 -0
- package/dist/assets/secretGuard-Bh11MPdI.js +1 -0
- package/dist/assets/{secretGuard-BrATm_gl.js → secretGuard-oz_3hBfW.js} +19 -2
- package/dist/assets/{secretGuard-BrATm_gl.js.map → secretGuard-oz_3hBfW.js.map} +1 -1
- package/dist/assets/{server-Dgxx_DaN.js → server-DWJ4RzJn.js} +536 -209
- package/dist/assets/server-DWJ4RzJn.js.map +1 -0
- package/dist/assets/{translate-BcbSWkuq.js → translate-CHj_PdLg.js} +13 -8
- package/dist/assets/translate-CHj_PdLg.js.map +1 -0
- package/dist/assets/{waitNotice-ylU3XwjO.js → waitNotice-Cvz5CiKR.js} +57 -3
- package/dist/assets/waitNotice-Cvz5CiKR.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/assets/api-CjOaoG-v.js.map +0 -1
- package/dist/assets/apps-Cuk45sz5.js.map +0 -1
- package/dist/assets/buttons-BGxzOtrq.js.map +0 -1
- package/dist/assets/buttons-CsN2WJOf.js +0 -1
- package/dist/assets/errors-DDLFO4Gf.js.map +0 -1
- package/dist/assets/ghostly_iroh_web-DIj5xGmR.js.map +0 -1
- package/dist/assets/groupMeta-goASqzOt.js.map +0 -1
- package/dist/assets/host-C2WRKj3g.js.map +0 -1
- package/dist/assets/irohWeb-NfthOL98.js.map +0 -1
- package/dist/assets/main-Dh7fePd8.js.map +0 -1
- package/dist/assets/ownDid-BErplN7N.js.map +0 -1
- package/dist/assets/pairedTransports-BKmvlKz1.js.map +0 -1
- package/dist/assets/registry-CU8PevhI.js.map +0 -1
- package/dist/assets/resolve-B1upovPM.js.map +0 -1
- package/dist/assets/secretGuard-Bm6nci0I.js +0 -1
- package/dist/assets/server-Dgxx_DaN.js.map +0 -1
- package/dist/assets/translate-BcbSWkuq.js.map +0 -1
- package/dist/assets/waitNotice-ylU3XwjO.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as localFileError, n as EXIT, r as asCliError, t as CliError } from "./errors-
|
|
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-
|
|
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-B7jRrSnb.js";
|
|
3
3
|
import { n as dropSecretEnv, t as childEnv } from "./childEnv-C-99hdbL.js";
|
|
4
|
-
import {
|
|
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-
|
|
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 { B as shellWord, V as jsonOut, a as contactKeyOf, b as namedByThem, y as nameKey } from "./apiKit-
|
|
8
|
-
import {
|
|
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--fxSh792.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-B2uy04ph.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-Bc08eNJY.js";
|
|
7
|
+
import { B as shellWord, V as jsonOut, a as contactKeyOf, b as namedByThem, y as nameKey } from "./apiKit-nLK4jeTq.js";
|
|
8
|
+
import { c as waitsFor, o as longTextChat, r as dhtOnlyNotice, s as waitNotice } from "./waitNotice-Cvz5CiKR.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";
|
|
@@ -13,7 +13,7 @@ import { connect } from "node:net";
|
|
|
13
13
|
import { format } from "node:util";
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "@ghostlytools/cli",
|
|
16
|
-
version: "1.13.
|
|
16
|
+
version: "1.13.1",
|
|
17
17
|
type: "module",
|
|
18
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.",
|
|
19
19
|
license: "MIT",
|
|
@@ -92,7 +92,7 @@ var package_default = {
|
|
|
92
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.
|
|
93
93
|
*/
|
|
94
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 ${
|
|
95
|
+
var notANumber = (name, option, value) => new CliError("usage", `--${name} takes ${option.takes ?? "a number"}, not ${shownValue(value)}`);
|
|
96
96
|
/**
|
|
97
97
|
* The word right after an option that stood alone because it was no number (`--voice 2s`), by the positionals a parse
|
|
98
98
|
* returned: should the line have one too many, that word was the option's value, and `strayValue` says so.
|
|
@@ -215,7 +215,7 @@ function parseArgs(argv, spec, idSlot = () => false, parsing) {
|
|
|
215
215
|
options[name] = number;
|
|
216
216
|
} else if (option.type === "list") options[name] = [...options[name] ?? [], value];
|
|
217
217
|
else {
|
|
218
|
-
if (option.choices && !option.choices.includes(value)) throw new CliError("usage", `--${name} takes ${listed$1(option.choices)}, not ${
|
|
218
|
+
if (option.choices && !option.choices.includes(value)) throw new CliError("usage", `--${name} takes ${listed$1(option.choices)}, not ${shownValue(value)}`);
|
|
219
219
|
options[name] = value;
|
|
220
220
|
}
|
|
221
221
|
continue;
|
|
@@ -252,7 +252,7 @@ function unknownOption(arg, all, parsing, help = parsing ? `ghostly help ${parsi
|
|
|
252
252
|
*/
|
|
253
253
|
function shownOption(arg, privateKey) {
|
|
254
254
|
if (privateKey) return "(a private key)";
|
|
255
|
-
return
|
|
255
|
+
return secretValue(arg) ?? arg;
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* A first word that starts with a dash and is no global option (`ghostly --porfile bot send …`, `ghostly -x status`):
|
|
@@ -303,7 +303,7 @@ function checkSettingKey(key, kinds) {
|
|
|
303
303
|
}
|
|
304
304
|
/** A value of another kind than its key takes (`online maybe`): a usage error too, before the profile opens. */
|
|
305
305
|
function checkSettingValue(key, kind, value, typed) {
|
|
306
|
-
if (kind === "boolean" && typeof value !== "boolean") throw new CliError("usage", `${key} takes true or false, not ${
|
|
306
|
+
if (kind === "boolean" && typeof value !== "boolean") throw new CliError("usage", `${key} takes true or false, not ${shownValue(typed)}: ${SETTINGS_SET}`);
|
|
307
307
|
if (kind === "strings" && !(Array.isArray(value) && value.every((v) => typeof v === "string"))) throw new CliError("usage", `${key} takes a JSON list of strings: ${SETTINGS_SET}`);
|
|
308
308
|
if (kind === "ice" && !(Array.isArray(value) && value.every((v) => v && typeof v === "object"))) throw new CliError("usage", `${key} takes a JSON list of ICE servers: ${SETTINGS_SET}`);
|
|
309
309
|
}
|
|
@@ -463,12 +463,13 @@ function refs(values, flag, what) {
|
|
|
463
463
|
}
|
|
464
464
|
/**
|
|
465
465
|
* A whole number of sats from the command line (`<sats>`), refused in a number flag's words: `<sats> takes a whole
|
|
466
|
-
* number from 1 up, not -5`, a number as typed, other words quoted
|
|
466
|
+
* number from 1 up, not -5`, a number as typed, other words quoted, or described when long or secret-looking (a Cashu
|
|
467
|
+
* token pasted after `wallet receive`). Before: "Not an amount in sats: \"-5\"".
|
|
467
468
|
*/
|
|
468
469
|
function sats(value) {
|
|
469
470
|
const n = decimalNumber(value ?? "");
|
|
470
471
|
if (!Number.isSafeInteger(n) || n <= 0) {
|
|
471
|
-
const shown = Number.isNaN(n) ?
|
|
472
|
+
const shown = Number.isNaN(n) ? shownValue(value) : value;
|
|
472
473
|
throw new CliError("usage", `<sats> takes a whole number from 1 up, not ${shown}`);
|
|
473
474
|
}
|
|
474
475
|
return n;
|
|
@@ -546,7 +547,7 @@ var typingKind = {
|
|
|
546
547
|
function typingFor(options) {
|
|
547
548
|
const seconds = options.for;
|
|
548
549
|
if (seconds === void 0) return void 0;
|
|
549
|
-
if (typeof seconds !== "number" || !(seconds >= 1 && seconds <= 600)) throw new CliError("usage", `--for takes a number of seconds from 1 to 600, not ${
|
|
550
|
+
if (typeof seconds !== "number" || !(seconds >= 1 && seconds <= 600)) throw new CliError("usage", `--for takes a number of seconds from 1 to 600, not ${shownValue(seconds)}`);
|
|
550
551
|
if (options.stop === true) throw new CliError("usage", "--for keeps it on: not with --stop");
|
|
551
552
|
return seconds;
|
|
552
553
|
}
|
|
@@ -559,7 +560,7 @@ function typingFor(options) {
|
|
|
559
560
|
function reaction(options, emoji) {
|
|
560
561
|
if (options.remove === true) return emoji;
|
|
561
562
|
if (!emoji) throw new CliError("usage", "Give one emoji, or --remove to take yours back");
|
|
562
|
-
if (!reactionEmoji(emoji)) throw new CliError("usage", `<emoji> takes one emoji, not ${
|
|
563
|
+
if (!reactionEmoji(emoji)) throw new CliError("usage", `<emoji> takes one emoji, not ${shownValue(emoji)}`);
|
|
563
564
|
return emoji;
|
|
564
565
|
}
|
|
565
566
|
/**
|
|
@@ -578,7 +579,7 @@ var HISTORY_LIMIT = 1e4;
|
|
|
578
579
|
function inRange(options, flag, what, min, max, whole = false) {
|
|
579
580
|
const value = options[flag];
|
|
580
581
|
if (value === void 0) return void 0;
|
|
581
|
-
if (typeof value !== "number" || !(value >= min && value <= max) || whole && !Number.isInteger(value)) throw new CliError("usage", `--${flag} takes ${what} from ${min} to ${max}, not ${
|
|
582
|
+
if (typeof value !== "number" || !(value >= min && value <= max) || whole && !Number.isInteger(value)) throw new CliError("usage", `--${flag} takes ${what} from ${min} to ${max}, not ${shownValue(value)}`);
|
|
582
583
|
return value;
|
|
583
584
|
}
|
|
584
585
|
/** `--timeout` of a command that waits: seconds, up to an hour (a send, a card, a button) or a day (`chat wait`, a file). */
|
|
@@ -588,7 +589,7 @@ var pageLimit = (options) => inRange(options, "limit", "a whole number", 1, HIST
|
|
|
588
589
|
/** `--since` of `events` and `listen`: a seq, a whole number from 0 (a negative one replayed a made-up gap first). */
|
|
589
590
|
function since(options) {
|
|
590
591
|
const value = options.since;
|
|
591
|
-
if (value !== void 0 && !(Number.isSafeInteger(value) && value >= 0)) throw new CliError("usage", `--since takes a seq from 0 up, not ${
|
|
592
|
+
if (value !== void 0 && !(Number.isSafeInteger(value) && value >= 0)) throw new CliError("usage", `--since takes a seq from 0 up, not ${shownValue(value)}`);
|
|
592
593
|
return value;
|
|
593
594
|
}
|
|
594
595
|
/**
|
|
@@ -661,7 +662,7 @@ function cardLinks(values) {
|
|
|
661
662
|
label: value.slice(0, eq),
|
|
662
663
|
url: value.slice(eq + 1)
|
|
663
664
|
} : { url: value };
|
|
664
|
-
if (!cardUrl(link.url)) throw new CliError("usage", `--link takes an https link of at most ${STATUS_CARD_LIMITS.url} characters, or label=link, not ${
|
|
665
|
+
if (!cardUrl(link.url)) throw new CliError("usage", `--link takes an https link of at most ${STATUS_CARD_LIMITS.url} characters, or label=link, not ${shownValue(value)}`);
|
|
665
666
|
cardText("--link's label", link.label, STATUS_CARD_LIMITS.linkLabel, value);
|
|
666
667
|
return link;
|
|
667
668
|
});
|
|
@@ -675,13 +676,13 @@ var listed = (words) => `${words.slice(0, -1).join(", ")} or ${words.at(-1)}`;
|
|
|
675
676
|
function cardText(flag, value, max, shown = value) {
|
|
676
677
|
if (value === void 0) return;
|
|
677
678
|
const line = cardLine(String(value), Infinity);
|
|
678
|
-
if (!line) throw new CliError("usage", `${flag} takes text, not ${
|
|
679
|
+
if (!line) throw new CliError("usage", `${flag} takes text, not ${shownValue(shown)}`);
|
|
679
680
|
const length = [...line].length;
|
|
680
681
|
if (length > max) throw new CliError("usage", `${flag} takes at most ${max} characters, not ${length}`);
|
|
681
682
|
}
|
|
682
683
|
/** `--status`, `--state`, `--pr-state`, `--pr-checks`: one of their words, or a usage error that lists them. */
|
|
683
684
|
function oneWord(options, flag, words) {
|
|
684
|
-
if (options[flag] !== void 0 && !words.includes(options[flag])) throw new CliError("usage", `--${flag} takes ${listed(words)}, not ${
|
|
685
|
+
if (options[flag] !== void 0 && !words.includes(options[flag])) throw new CliError("usage", `--${flag} takes ${listed(words)}, not ${shownValue(options[flag])}`);
|
|
685
686
|
}
|
|
686
687
|
/** A flag given more times than the card holds: a usage error that says how many it takes. */
|
|
687
688
|
function given(flag, values, max) {
|
|
@@ -703,7 +704,7 @@ function itemOf(value) {
|
|
|
703
704
|
text: value
|
|
704
705
|
};
|
|
705
706
|
}
|
|
706
|
-
if (!ITEM_STATES.includes(word)) throw new CliError("usage", `--item takes state:text, and ${
|
|
707
|
+
if (!ITEM_STATES.includes(word)) throw new CliError("usage", `--item takes state:text, and ${shownValue(word)} is not a state: use ${listed(ITEM_STATES)} (pending:<text> keeps a colon in the text), not ${shownValue(value)}`);
|
|
707
708
|
const text = value.slice(colon + 1).trim();
|
|
708
709
|
cardText("--item's text", text, STATUS_CARD_LIMITS.line, value);
|
|
709
710
|
return {
|
|
@@ -731,7 +732,7 @@ function cardId(options) {
|
|
|
731
732
|
/** `--progress`, `--left`: a percent, or a usage error that names the flag. */
|
|
732
733
|
function percent(options, flag) {
|
|
733
734
|
const value = options[flag];
|
|
734
|
-
if (value !== void 0 && !(typeof value === "number" && value >= 0 && value <= 100)) throw new CliError("usage", `--${flag} takes a percent from 0 to 100, not ${
|
|
735
|
+
if (value !== void 0 && !(typeof value === "number" && value >= 0 && value <= 100)) throw new CliError("usage", `--${flag} takes a percent from 0 to 100, not ${shownValue(value)}`);
|
|
735
736
|
}
|
|
736
737
|
/**
|
|
737
738
|
* `--pr-number`, `--additions`, `--used`, `--limit`…: a count as the card takes it, a whole number from `min` up to
|
|
@@ -778,13 +779,13 @@ function taskFields(options) {
|
|
|
778
779
|
set("branch", options.branch);
|
|
779
780
|
if (options.steps !== void 0) {
|
|
780
781
|
const match = /^(\d+)\s*\/\s*(\d+)$/.exec(String(options.steps));
|
|
781
|
-
if (!match) throw new CliError("usage", `--steps takes done/total, like 2/5, not ${
|
|
782
|
+
if (!match) throw new CliError("usage", `--steps takes done/total, like 2/5, not ${shownValue(options.steps)}`);
|
|
782
783
|
fields.done = Number(match[1]);
|
|
783
784
|
fields.total = Number(match[2]);
|
|
784
|
-
if (Number(match[2]) > STATUS_CARD_LIMITS.count) throw new CliError("usage", `--steps takes done/total of at most ${STATUS_CARD_LIMITS.count} steps, like 2/5, not ${
|
|
785
|
-
if (Number(match[2]) < 1 || Number(match[1]) > Number(match[2])) throw new CliError("usage", `--steps takes done/total with done at most total, like 2/5, not ${
|
|
785
|
+
if (Number(match[2]) > STATUS_CARD_LIMITS.count) throw new CliError("usage", `--steps takes done/total of at most ${STATUS_CARD_LIMITS.count} steps, like 2/5, not ${shownValue(options.steps)}`);
|
|
786
|
+
if (Number(match[2]) < 1 || Number(match[1]) > Number(match[2])) throw new CliError("usage", `--steps takes done/total with done at most total, like 2/5, not ${shownValue(options.steps)}`);
|
|
786
787
|
}
|
|
787
|
-
if (options["pr-url"] !== void 0 && !cardUrl(options["pr-url"])) throw new CliError("usage", `--pr-url takes an https link of at most ${STATUS_CARD_LIMITS.url} characters, not ${
|
|
788
|
+
if (options["pr-url"] !== void 0 && !cardUrl(options["pr-url"])) throw new CliError("usage", `--pr-url takes an https link of at most ${STATUS_CARD_LIMITS.url} characters, not ${shownValue(options["pr-url"])}`);
|
|
788
789
|
for (const flag of [
|
|
789
790
|
"pr-number",
|
|
790
791
|
"additions",
|
|
@@ -910,17 +911,17 @@ function cardTime(value, flag, forms = `a time in milliseconds or a date: ${CARD
|
|
|
910
911
|
const text = String(value).trim();
|
|
911
912
|
const day = ISO_DAY.exec(text);
|
|
912
913
|
const ms = /^\d+$/.test(text) ? milliseconds(text, flag) : Date.parse(day ? `${text}${day[1] ? "" : "-01"}T00:00` : text);
|
|
913
|
-
if (!Number.isSafeInteger(ms) || ms <= 0) throw new CliError("usage", `--${flag} takes ${forms}, not ${
|
|
914
|
+
if (!Number.isSafeInteger(ms) || ms <= 0) throw new CliError("usage", `--${flag} takes ${forms}, not ${shownValue(value)}`);
|
|
914
915
|
const written = writtenDay(text);
|
|
915
916
|
if (written) {
|
|
916
917
|
const [year, month, date] = written, days = new Date(Date.UTC(year, month, 0)).getUTCDate();
|
|
917
|
-
if (date > days) throw new CliError("usage", `--${flag} takes a day the month has (${year}-${String(month).padStart(2, "0")} has ${days}), not ${
|
|
918
|
+
if (date > days) throw new CliError("usage", `--${flag} takes a day the month has (${year}-${String(month).padStart(2, "0")} has ${days}), not ${shownValue(value)}`);
|
|
918
919
|
}
|
|
919
920
|
const last = new Date(Date.now() + STATUS_CARD_LIMITS.nextRunMs);
|
|
920
921
|
if (ms > last.getTime()) {
|
|
921
922
|
const two = (n) => String(n).padStart(2, "0");
|
|
922
923
|
const shown = `${last.getFullYear()}-${two(last.getMonth() + 1)}-${two(last.getDate())} ${two(last.getHours())}:${two(last.getMinutes())}`;
|
|
923
|
-
throw new CliError("usage", `--${flag} takes a time within a year from now (until ${shown}), not ${
|
|
924
|
+
throw new CliError("usage", `--${flag} takes a time within a year from now (until ${shown}), not ${shownValue(value)}`);
|
|
924
925
|
}
|
|
925
926
|
return ms;
|
|
926
927
|
}
|
|
@@ -929,7 +930,7 @@ function runOf(value) {
|
|
|
929
930
|
if (value === void 0) return void 0;
|
|
930
931
|
const text = String(value), colon = text.indexOf(":");
|
|
931
932
|
const result = colon === -1 ? text : text.slice(0, colon), summary = colon === -1 ? "" : text.slice(colon + 1).trim();
|
|
932
|
-
if (!RUN_RESULTS.includes(result)) throw new CliError("usage", `--run takes ok, failed or skipped, and :a summary after it if you like, not ${
|
|
933
|
+
if (!RUN_RESULTS.includes(result)) throw new CliError("usage", `--run takes ok, failed or skipped, and :a summary after it if you like, not ${shownValue(value)}`);
|
|
933
934
|
if (summary) cardText("--run's summary", summary, STATUS_CARD_LIMITS.line);
|
|
934
935
|
return {
|
|
935
936
|
result,
|
|
@@ -943,7 +944,7 @@ function routineFields(options) {
|
|
|
943
944
|
cardText("--schedule", options.schedule, STATUS_CARD_LIMITS.schedule);
|
|
944
945
|
if (options.cron !== void 0 && !CRON_LINE.test(String(options.cron).trim())) {
|
|
945
946
|
const length = [...String(options.cron).trim()].length;
|
|
946
|
-
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 ${
|
|
947
|
+
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 ${shownValue(options.cron)}`);
|
|
947
948
|
}
|
|
948
949
|
oneWord(options, "state", ROUTINE_STATES);
|
|
949
950
|
cardId(options);
|
|
@@ -1062,7 +1063,7 @@ var taskOptions = {
|
|
|
1062
1063
|
*/
|
|
1063
1064
|
function usageWindowOf(value) {
|
|
1064
1065
|
const match = /^([^=]+)=(\d+(?:\.\d+)?)(?:@(.+))?$/.exec(value.trim());
|
|
1065
|
-
if (!match) throw new CliError("usage", `--also takes window=percent or window=percent@time, like week=80@2026-10-10T00:00:00Z, not ${
|
|
1066
|
+
if (!match) throw new CliError("usage", `--also takes window=percent or window=percent@time, like week=80@2026-10-10T00:00:00Z, not ${shownValue(value)}`);
|
|
1066
1067
|
cardText("--also's window", match[1], STATUS_CARD_LIMITS.usageWindow, value);
|
|
1067
1068
|
if (Number(match[2]) > 100) throw new CliError("usage", `--also takes a percent from 0 to 100, not ${match[2]}`);
|
|
1068
1069
|
const resetsAt = cardTime(match[3], "also");
|
|
@@ -1209,7 +1210,7 @@ var commands$8 = {
|
|
|
1209
1210
|
description: "Replace the three files when they are there"
|
|
1210
1211
|
}
|
|
1211
1212
|
},
|
|
1212
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1213
|
+
run: async ({ options }, a) => (await import("./apps-nLtyhC2f.js")).initApp(a.dir, {
|
|
1213
1214
|
name: options.name,
|
|
1214
1215
|
title: options.title,
|
|
1215
1216
|
force: options.force === true
|
|
@@ -1249,7 +1250,7 @@ var commands$8 = {
|
|
|
1249
1250
|
description: "This version's sequence, higher than the bundle at --out's (default: one more than it)"
|
|
1250
1251
|
}
|
|
1251
1252
|
},
|
|
1252
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1253
|
+
run: async ({ options }, a) => (await import("./apps-nLtyhC2f.js")).publishApp(a.dir, keyFile(options.key, "app publish <dir> --key <file> [--out <file>] [--sequence n]"), here(options.out), options.sequence)
|
|
1253
1254
|
},
|
|
1254
1255
|
"app revoke": {
|
|
1255
1256
|
method: "app.revoke",
|
|
@@ -1282,7 +1283,7 @@ var commands$8 = {
|
|
|
1282
1283
|
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"
|
|
1283
1284
|
}
|
|
1284
1285
|
},
|
|
1285
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1286
|
+
run: async ({ options }, a) => (await import("./apps-nLtyhC2f.js")).revokeApp(a.dir, keyFile(options.key, "app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>] [--force]"), {
|
|
1286
1287
|
digests: options.digest,
|
|
1287
1288
|
upTo: options["up-to"],
|
|
1288
1289
|
reason: options.reason,
|
|
@@ -1343,7 +1344,7 @@ var commands$8 = {
|
|
|
1343
1344
|
usage: "app verify <bundle|url>",
|
|
1344
1345
|
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",
|
|
1345
1346
|
args: ["bundle"],
|
|
1346
|
-
run: async (_, a) => (await import("./apps-
|
|
1347
|
+
run: async (_, a) => (await import("./apps-nLtyhC2f.js")).verifyApp(a.bundle)
|
|
1347
1348
|
},
|
|
1348
1349
|
"store sign": {
|
|
1349
1350
|
method: "store.sign",
|
|
@@ -1360,7 +1361,7 @@ var commands$8 = {
|
|
|
1360
1361
|
description: "The folder to write ghostly-store.json and ghostly-store.sig in (default: the index's)"
|
|
1361
1362
|
}
|
|
1362
1363
|
},
|
|
1363
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1364
|
+
run: async ({ options }, a) => (await import("./apps-nLtyhC2f.js")).signStore(a.index, keyFile(options.key, "store sign <index> --key <file> [--out <dir>]"), here(options.out))
|
|
1364
1365
|
}
|
|
1365
1366
|
};
|
|
1366
1367
|
// src/commands/calls.ts
|
|
@@ -1370,7 +1371,7 @@ var commands$8 = {
|
|
|
1370
1371
|
*/
|
|
1371
1372
|
function rateOf(options) {
|
|
1372
1373
|
const value = options.rate;
|
|
1373
|
-
if (value !== void 0 && !isCallRate(value)) throw new CliError("usage", `--rate takes ${CALL_RATES.slice(0, -1).join(", ")} or ${CALL_RATES.at(-1)}, not ${
|
|
1374
|
+
if (value !== void 0 && !isCallRate(value)) throw new CliError("usage", `--rate takes ${CALL_RATES.slice(0, -1).join(", ")} or ${CALL_RATES.at(-1)}, not ${shownValue(value)}`);
|
|
1374
1375
|
return value;
|
|
1375
1376
|
}
|
|
1376
1377
|
/** Voice calls: one entry per command, in alphabetical order (test/commands.test.ts checks). */
|
|
@@ -1399,7 +1400,7 @@ var commands$7 = {
|
|
|
1399
1400
|
rate
|
|
1400
1401
|
},
|
|
1401
1402
|
params: ({ options }, a) => {
|
|
1402
|
-
if (a.mode !== void 0 && a.mode !== "on" && a.mode !== "off") throw new CliError("usage", `call auto takes on or off, not ${
|
|
1403
|
+
if (a.mode !== void 0 && a.mode !== "on" && a.mode !== "off") throw new CliError("usage", `call auto takes on or off, not ${shownValue(a.mode)}: ghostly call auto [on|off] [--from <chat>]... [--rate 48000]`);
|
|
1403
1404
|
if (a.mode !== "on" && (options.from !== void 0 || options.rate !== void 0)) throw new CliError("usage", "--from and --rate go with on: ghostly call auto on --from <chat>");
|
|
1404
1405
|
refs(options.from, "from", "chat");
|
|
1405
1406
|
if (a.mode === void 0) return {};
|
|
@@ -2069,7 +2070,7 @@ function voiceOf(options) {
|
|
|
2069
2070
|
};
|
|
2070
2071
|
if (voice === void 0) throw new CliError("usage", "--peaks is a voice note's waveform: not without --voice");
|
|
2071
2072
|
const bars = peaks.split(",");
|
|
2072
|
-
if (bars.length > VOICE_LIMITS.maxBars || !bars.every((bar) => /^\d{1,3}$/.test(bar.trim()) && Number(bar) <= 255)) throw new CliError("usage", `--peaks takes up to ${VOICE_LIMITS.maxBars} numbers from 0 to 255, comma-separated, not ${
|
|
2073
|
+
if (bars.length > VOICE_LIMITS.maxBars || !bars.every((bar) => /^\d{1,3}$/.test(bar.trim()) && Number(bar) <= 255)) throw new CliError("usage", `--peaks takes up to ${VOICE_LIMITS.maxBars} numbers from 0 to 255, comma-separated, not ${shownValue(peaks)}`);
|
|
2073
2074
|
return {
|
|
2074
2075
|
voice,
|
|
2075
2076
|
peaks: bars
|
|
@@ -2085,7 +2086,7 @@ var commands$5 = {
|
|
|
2085
2086
|
"file accept": {
|
|
2086
2087
|
method: "file.action",
|
|
2087
2088
|
usage: "file accept [<chat>] <file>",
|
|
2088
|
-
summary: "Take a file the contact offers, or download a group's file that did not come by itself (<chat> may be the group)",
|
|
2089
|
+
summary: "Take a file the contact offers, or download a group's file that did not come by itself (<chat> may be the group); refused when it does not fit in the room left on this device, and it keeps waiting",
|
|
2089
2090
|
args: ["chat?", "file"],
|
|
2090
2091
|
params: (_, a) => ({
|
|
2091
2092
|
chat: a.chat,
|
|
@@ -2298,8 +2299,8 @@ function statusUntil(value) {
|
|
|
2298
2299
|
if (value === void 0) return void 0;
|
|
2299
2300
|
const text = String(value).trim(), duration = DURATION.exec(text);
|
|
2300
2301
|
const ms = duration ? Date.now() + Number(duration[1]) * UNIT_MS[duration[2]] : cardTime(text, "until", `30m, 2h or 1d from now (whole minutes, hours or days), milliseconds or a date: ${CARD_TIME_FORMS}`);
|
|
2301
|
-
if (duration && !(ms <= Date.now() + STATUS_CARD_LIMITS.nextRunMs)) throw new CliError("usage", `--until takes a time within a year from now, not ${
|
|
2302
|
-
if (ms <= Date.now()) throw new CliError("usage", `--until takes a time to come, not ${
|
|
2302
|
+
if (duration && !(ms <= Date.now() + STATUS_CARD_LIMITS.nextRunMs)) throw new CliError("usage", `--until takes a time within a year from now, not ${shownValue(value)}`);
|
|
2303
|
+
if (ms <= Date.now()) throw new CliError("usage", `--until takes a time to come, not ${shownValue(value)}: a status that ended is none`);
|
|
2303
2304
|
return ms;
|
|
2304
2305
|
}
|
|
2305
2306
|
/** The profile's status, its picture, the event journal: one entry per command, in alphabetical order (test/commands.test.ts checks). */
|
|
@@ -2425,7 +2426,7 @@ var commands$3 = {
|
|
|
2425
2426
|
description: "Invitations from this chat: its id, its contact's key or a label given here with chat rename (again for more: a new on replaces the list)"
|
|
2426
2427
|
} },
|
|
2427
2428
|
params: ({ options }, a) => {
|
|
2428
|
-
if (a.mode !== void 0 && a.mode !== "on" && a.mode !== "off") throw new CliError("usage", `group auto takes on or off, not ${
|
|
2429
|
+
if (a.mode !== void 0 && a.mode !== "on" && a.mode !== "off") throw new CliError("usage", `group auto takes on or off, not ${shownValue(a.mode)}: ghostly group auto [on|off] [--from <chat>]...`);
|
|
2429
2430
|
if (a.mode === "on" && options.from === void 0) throw new CliError("usage", "group auto on needs the chats whose invitations it accepts: ghostly group auto on --from <chat>");
|
|
2430
2431
|
if (a.mode !== "on" && options.from !== void 0) throw new CliError("usage", "--from goes with on: ghostly group auto on --from <chat>");
|
|
2431
2432
|
refs(options.from, "from", "chat");
|
|
@@ -2894,8 +2895,8 @@ var commands$2 = {
|
|
|
2894
2895
|
*/
|
|
2895
2896
|
function networkList(value) {
|
|
2896
2897
|
const networks = value.split(",").map((n) => n.trim()).filter(Boolean);
|
|
2897
|
-
if (!networks.length) throw new CliError("usage", `--networks takes mainnet, testnet or mainnet,testnet (to stop taking it: --off), not ${
|
|
2898
|
-
if (!networks.every((n) => n === "mainnet" || n === "testnet")) throw new CliError("usage", `--networks takes mainnet, testnet or mainnet,testnet, not ${
|
|
2898
|
+
if (!networks.length) throw new CliError("usage", `--networks takes mainnet, testnet or mainnet,testnet (to stop taking it: --off), not ${shownValue(value)}`);
|
|
2899
|
+
if (!networks.every((n) => n === "mainnet" || n === "testnet")) throw new CliError("usage", `--networks takes mainnet, testnet or mainnet,testnet, not ${shownValue(value)}`);
|
|
2899
2900
|
return networks;
|
|
2900
2901
|
}
|
|
2901
2902
|
/**
|
|
@@ -2904,7 +2905,7 @@ function networkList(value) {
|
|
|
2904
2905
|
*/
|
|
2905
2906
|
function requestAmount(value, method) {
|
|
2906
2907
|
if (method !== "usdt") return sats(value);
|
|
2907
|
-
if (!/^\d+(\.\d+)?$/.test(value ?? "") || !/[1-9]/.test(value)) throw new CliError("usage", `<amount> with --method usdt takes USDT above 0 (5 or 0.25), not ${
|
|
2908
|
+
if (!/^\d+(\.\d+)?$/.test(value ?? "") || !/[1-9]/.test(value)) throw new CliError("usage", `<amount> with --method usdt takes USDT above 0 (5 or 0.25), not ${shownValue(value)}`);
|
|
2908
2909
|
return value;
|
|
2909
2910
|
}
|
|
2910
2911
|
/** Wallets and payments: one entry per command, in alphabetical order (test/commands.test.ts checks). */
|
|
@@ -3551,7 +3552,7 @@ function positionals(command, values) {
|
|
|
3551
3552
|
const words = command.words?.[name];
|
|
3552
3553
|
if (words && !words.includes(values[i])) {
|
|
3553
3554
|
const placeholder = shown[i + skip] && !shown[i + skip].includes("|") ? shown[i + skip] : name;
|
|
3554
|
-
throw new CliError("usage", `<${placeholder}> takes ${listed(words)}, not ${
|
|
3555
|
+
throw new CliError("usage", `<${placeholder}> takes ${listed(words)}, not ${shownValue(values[i])}`);
|
|
3555
3556
|
}
|
|
3556
3557
|
out[name] = values[i];
|
|
3557
3558
|
}
|
|
@@ -4472,15 +4473,15 @@ var VERSION = package_default.version;
|
|
|
4472
4473
|
* command a running daemon answers loads none of them, and starts about as fast as Node does. Statically imported, they
|
|
4473
4474
|
* cost every command ~100 ms before its socket was opened.
|
|
4474
4475
|
*/
|
|
4475
|
-
var engineApi = () => import("./api-
|
|
4476
|
-
var engineHost = () => import("./host-
|
|
4476
|
+
var engineApi = () => import("./api-DF36rBJK.js");
|
|
4477
|
+
var engineHost = () => import("./host-CGzVFfMz.js");
|
|
4477
4478
|
/**
|
|
4478
4479
|
* `--translate <lang>`'s translator, or null (not asked; or the runtime is not there, said on stderr). Loaded only when
|
|
4479
4480
|
* asked: the app's message parser it reads costs every other command nothing.
|
|
4480
4481
|
*/
|
|
4481
4482
|
async function translatorFor(value, home) {
|
|
4482
4483
|
if (value === void 0) return null;
|
|
4483
|
-
const { loadDetector, openTranslator, translateTarget } = await import("./translate-
|
|
4484
|
+
const { loadDetector, openTranslator, translateTarget } = await import("./translate-CHj_PdLg.js");
|
|
4484
4485
|
return openTranslator({
|
|
4485
4486
|
home,
|
|
4486
4487
|
to: translateTarget(value),
|
|
@@ -5021,13 +5022,17 @@ function interruptible(s) {
|
|
|
5021
5022
|
});
|
|
5022
5023
|
});
|
|
5023
5024
|
const call = (method, params) => {
|
|
5025
|
+
const given = params ?? {};
|
|
5024
5026
|
const entry = {
|
|
5025
5027
|
method,
|
|
5026
|
-
notice: waitNotice(method,
|
|
5028
|
+
notice: waitNotice(method, given, s.mode)
|
|
5027
5029
|
};
|
|
5028
5030
|
pending.add(entry);
|
|
5029
|
-
const
|
|
5030
|
-
|
|
5031
|
+
const chat = entry.notice && longTextChat(method, given);
|
|
5032
|
+
if (chat) s.call("chat.get", { chat }).then((view) => {
|
|
5033
|
+
if (entry.notice) entry.notice = dhtOnlyNotice(entry.notice, given, view, s.mode);
|
|
5034
|
+
}, () => {});
|
|
5035
|
+
const timer = entry.notice && process.stderr.isTTY ? setTimeout(() => process.stderr.write(`ghostly: ${entry.notice.waiting}\n`), WAIT_NOTICE_MS) : void 0;
|
|
5031
5036
|
return held(s.call(method, params).finally(() => {
|
|
5032
5037
|
clearTimeout(timer);
|
|
5033
5038
|
pending.delete(entry);
|
|
@@ -5215,7 +5220,7 @@ var SPECIAL = [
|
|
|
5215
5220
|
field: o("list", "A field of the provider's form, name=value"),
|
|
5216
5221
|
stdin: o("boolean", "Take the fields as name=value lines on stdin (a signer's link: out of ps and the shell's history)"),
|
|
5217
5222
|
days: o("number", "How long the proof holds"),
|
|
5218
|
-
timeout: o("number", "Seconds to wait for an approval")
|
|
5223
|
+
timeout: o("number", "Seconds to wait for an approval (default 300, 5 to 3600; Pubky at most 300)")
|
|
5219
5224
|
}
|
|
5220
5225
|
],
|
|
5221
5226
|
["version", "This CLI's version (also ghostly --version)"]
|
|
@@ -5481,7 +5486,7 @@ async function profileCommand(sub, argv) {
|
|
|
5481
5486
|
noMoreThan(1, parsed.positionals, "profile create <name> [--use] [--name <shown name>] [--force]");
|
|
5482
5487
|
const shownName = parsed.options.name === void 0 ? void 0 : checkShownNameOption(parsed.options.name);
|
|
5483
5488
|
const force = parsed.options.force === true;
|
|
5484
|
-
if (shownName) (await import("./secretGuard-
|
|
5489
|
+
if (shownName) (await import("./secretGuard-Bh11MPdI.js")).guardText(shownName, force, "name", "set it");
|
|
5485
5490
|
const paths = createProfile(g.home, name);
|
|
5486
5491
|
let shown = null;
|
|
5487
5492
|
if (shownName !== void 0) try {
|
|
@@ -5581,7 +5586,7 @@ async function profileCommand(sub, argv) {
|
|
|
5581
5586
|
if (!given || !name) throw new CliError("usage", `Missing <${given ? "new profile" : "file"}>: ghostly profile restore <file> <new profile> [--passphrase-file f] [--use]`);
|
|
5582
5587
|
noMoreThan(2, parsed.positionals, "profile restore <file> <new profile> [--passphrase-file f] [--use]");
|
|
5583
5588
|
const file = here(given);
|
|
5584
|
-
const { backupFileProtection, restoreProfile } = await import("./backup-
|
|
5589
|
+
const { backupFileProtection, restoreProfile } = await import("./backup-D6s0LQdg.js");
|
|
5585
5590
|
const protection = await backupFileProtection(file);
|
|
5586
5591
|
const paths = await restoreProfile(g.home, checkProfileName(name), file, protection === "none" ? void 0 : await backupPassphrase(parsed.options["passphrase-file"], RESTORE_PASSPHRASE));
|
|
5587
5592
|
if (parsed.options.use) selectProfile(g.home, name);
|
|
@@ -6428,7 +6433,7 @@ async function textCommand(name, argv) {
|
|
|
6428
6433
|
};
|
|
6429
6434
|
if (spec.target === "group") params.mentions = parsed.options.mention ?? [];
|
|
6430
6435
|
if (parsed.options.reply !== void 0) params.reply = parsed.options.reply;
|
|
6431
|
-
if (!spec.message) Object.assign(params, (await import("./buttons-
|
|
6436
|
+
if (!spec.message) Object.assign(params, (await import("./buttons-DaY5FYlV.js")).buttonsOf(parsed.options));
|
|
6432
6437
|
print(await withSession(g, (s) => {
|
|
6433
6438
|
if (parsed.options.wait !== void 0) params.wait = parsed.options.wait;
|
|
6434
6439
|
if (parsed.options.timeout !== void 0) params.timeout = parsed.options.timeout;
|
|
@@ -6472,7 +6477,7 @@ async function identityAddCommand(argv) {
|
|
|
6472
6477
|
if (!provider) throw new CliError("usage", "Missing <provider>: ghostly identity add <provider> [subject] [--signer id] [--field name=value]... [--stdin] [--days n] [--timeout s]");
|
|
6473
6478
|
inRange(parsed.options, "timeout", "a number of seconds", 5, 3600);
|
|
6474
6479
|
const items = parsed.options.field ?? [];
|
|
6475
|
-
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry
|
|
6480
|
+
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry-bLIfG619.js")).IDENTITY_PROVIDERS.find((p) => p.id === provider) : void 0;
|
|
6476
6481
|
if (known && parsed.options.days !== void 0) inRange(parsed.options, "days", "a whole number", 1, known.validity.maxDays, true);
|
|
6477
6482
|
const { fields, warning } = await identityFields(items, parsed.options.stdin === true, identitySecretFields(known, parsed.options.signer), readStdin, process.stdin.isTTY === true);
|
|
6478
6483
|
if (warning) process.stderr.write(`ghostly: ${warning}\n`);
|
|
@@ -6582,7 +6587,7 @@ async function tableCommand(name, argv) {
|
|
|
6582
6587
|
});
|
|
6583
6588
|
if (translator) {
|
|
6584
6589
|
try {
|
|
6585
|
-
printAnswer(await (await import("./translate-
|
|
6590
|
+
printAnswer(await (await import("./translate-CHj_PdLg.js")).translateAnswer(result, translator));
|
|
6586
6591
|
} finally {
|
|
6587
6592
|
translator.close();
|
|
6588
6593
|
}
|
|
@@ -6834,4 +6839,4 @@ async function run(argv) {
|
|
|
6834
6839
|
}
|
|
6835
6840
|
export { run };
|
|
6836
6841
|
|
|
6837
|
-
//# sourceMappingURL=main-
|
|
6842
|
+
//# sourceMappingURL=main-C8J53SwH.js.map
|