@ghostlytools/cli 1.12.0 → 1.13.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 +5 -5
- package/dist/assets/{api-DYMKyb1k.js → api-CVtg7MpI.js} +2 -2
- package/dist/assets/{api-DLzCtePC.js → api-CjOaoG-v.js} +53 -27
- package/dist/assets/api-CjOaoG-v.js.map +1 -0
- package/dist/assets/{apiKit-CVaEzKWQ.js → apiKit-BAGvlQtm.js} +2 -2
- package/dist/assets/{apiKit-CVaEzKWQ.js.map → apiKit-BAGvlQtm.js.map} +1 -1
- package/dist/assets/{appFetch-D56GsYuq.js → appFetch-BwJd-kNq.js} +2 -2
- package/dist/assets/{appFetch-D56GsYuq.js.map → appFetch-BwJd-kNq.js.map} +1 -1
- package/dist/assets/{apps-XnZ8VEuj.js → apps-Cuk45sz5.js} +6 -6
- package/dist/assets/{apps-XnZ8VEuj.js.map → apps-Cuk45sz5.js.map} +1 -1
- package/dist/assets/{apps-BPFW19Wc.js → apps-DjY095Af.js} +1 -1
- package/dist/assets/{backup-COX6j1_W.js → backup-B56sQqoQ.js} +1 -1
- package/dist/assets/{backup-DpyvT9Z6.js → backup-DekVCDWv.js} +47 -8
- package/dist/assets/backup-DekVCDWv.js.map +1 -0
- package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +1 -1
- package/dist/assets/{bitcoind-DTsrd7TF.js → bitcoind-B2bbVSzh.js} +2 -2
- package/dist/assets/{bitcoind-DTsrd7TF.js.map → bitcoind-B2bbVSzh.js.map} +1 -1
- package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +1 -1
- package/dist/assets/{buttons-BvWqHJeh.js → buttons-BGxzOtrq.js} +27 -6
- package/dist/assets/buttons-BGxzOtrq.js.map +1 -0
- package/dist/assets/buttons-CsN2WJOf.js +1 -0
- package/dist/assets/{client-kGZ3ZdUW.js → client-DcQAfc3h.js} +2 -2
- package/dist/assets/{client-kGZ3ZdUW.js.map → client-DcQAfc3h.js.map} +1 -1
- package/dist/assets/{endpoint-B0vE5ojY.js → endpoint-Cvu-taMs.js} +42 -5
- package/dist/assets/{endpoint-B0vE5ojY.js.map → endpoint-Cvu-taMs.js.map} +1 -1
- package/dist/assets/{fixedHosts-CPSsGOI2.js → fixedHosts-C3hBliM9.js} +2 -2
- package/dist/assets/{fixedHosts-CPSsGOI2.js.map → fixedHosts-C3hBliM9.js.map} +1 -1
- package/dist/assets/{groupMeta-DTQAJG50.js → groupMeta-goASqzOt.js} +135 -37
- package/dist/assets/groupMeta-goASqzOt.js.map +1 -0
- package/dist/assets/{host-z0FAHP9Z.js → host-C2WRKj3g.js} +105 -32
- package/dist/assets/host-C2WRKj3g.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-CvsAfQRQ.js → hyperdhtRelay-DLUiwfnt.js} +32 -4
- package/dist/assets/hyperdhtRelay-DLUiwfnt.js.map +1 -0
- package/dist/assets/{irohWeb-CLBx5MIv.js → irohWeb-NfthOL98.js} +178 -9
- package/dist/assets/irohWeb-NfthOL98.js.map +1 -0
- package/dist/assets/{main-CVqkvuIo.js → main-Dh7fePd8.js} +49 -32
- package/dist/assets/main-Dh7fePd8.js.map +1 -0
- package/dist/assets/{mainline-CVrd0C1n.js → mainline-DY95WbuK.js} +2 -2
- package/dist/assets/{mainline-CVrd0C1n.js.map → mainline-DY95WbuK.js.map} +1 -1
- package/dist/assets/{ownDid-DY3rYqDI.js → ownDid-BErplN7N.js} +2 -2
- package/dist/assets/{ownDid-DY3rYqDI.js.map → ownDid-BErplN7N.js.map} +1 -1
- package/dist/assets/{ownStatus-DMEhrpkd.js → ownStatus-ClrFjd7h.js} +5 -3
- package/dist/assets/ownStatus-ClrFjd7h.js.map +1 -0
- package/dist/assets/{profiles-BFSGqDFC.js → profiles-B8xO8-oj.js} +2 -2
- package/dist/assets/{profiles-BFSGqDFC.js.map → profiles-B8xO8-oj.js.map} +1 -1
- package/dist/assets/{registry-B15Yg_1C.js → registry--Rg2YvOH.js} +1 -1
- package/dist/assets/{registry-rXgaZeNn.js → registry-CU8PevhI.js} +38 -30
- package/dist/assets/registry-CU8PevhI.js.map +1 -0
- package/dist/assets/{relay-Cjfmdec0.js → relay-CHWg5hpZ.js} +73 -11
- package/dist/assets/relay-CHWg5hpZ.js.map +1 -0
- package/dist/assets/{resolve-CIc3KZMV.js → resolve-B1upovPM.js} +2 -2
- package/dist/assets/{resolve-CIc3KZMV.js.map → resolve-B1upovPM.js.map} +1 -1
- package/dist/assets/secretGuard-Bm6nci0I.js +1 -0
- package/dist/assets/{secretGuard-B4-LlMjv.js → secretGuard-BrATm_gl.js} +33 -9
- package/dist/assets/{secretGuard-B4-LlMjv.js.map → secretGuard-BrATm_gl.js.map} +1 -1
- package/dist/assets/{server-CQR7NLCz.js → server-Dgxx_DaN.js} +473 -60
- package/dist/assets/server-Dgxx_DaN.js.map +1 -0
- package/dist/assets/{waitNotice-BGM0QOS2.js → waitNotice-ylU3XwjO.js} +2 -2
- package/dist/assets/{waitNotice-BGM0QOS2.js.map → waitNotice-ylU3XwjO.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-DLzCtePC.js.map +0 -1
- package/dist/assets/backup-DpyvT9Z6.js.map +0 -1
- package/dist/assets/buttons-Bq7pTXqF.js +0 -1
- package/dist/assets/buttons-BvWqHJeh.js.map +0 -1
- package/dist/assets/groupMeta-DTQAJG50.js.map +0 -1
- package/dist/assets/host-z0FAHP9Z.js.map +0 -1
- package/dist/assets/hyperdhtRelay-CvsAfQRQ.js.map +0 -1
- package/dist/assets/irohWeb-CLBx5MIv.js.map +0 -1
- package/dist/assets/main-CVqkvuIo.js.map +0 -1
- package/dist/assets/ownStatus-DMEhrpkd.js.map +0 -1
- package/dist/assets/registry-rXgaZeNn.js.map +0 -1
- package/dist/assets/relay-Cjfmdec0.js.map +0 -1
- package/dist/assets/secretGuard-BmmnEbYf.js +0 -1
- package/dist/assets/server-CQR7NLCz.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
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-
|
|
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-DcQAfc3h.js";
|
|
3
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-
|
|
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 { i as waitsFor, r as waitNotice } from "./waitNotice-
|
|
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-goASqzOt.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-B8xO8-oj.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-ClrFjd7h.js";
|
|
7
|
+
import { B as shellWord, V as jsonOut, a as contactKeyOf, b as namedByThem, y as nameKey } from "./apiKit-BAGvlQtm.js";
|
|
8
|
+
import { i as waitsFor, r as waitNotice } from "./waitNotice-ylU3XwjO.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.
|
|
16
|
+
version: "1.13.0",
|
|
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",
|
|
@@ -236,12 +236,23 @@ function parseArgs(argv, spec, idSlot = () => false, parsing) {
|
|
|
236
236
|
function unknownOption(arg, all, parsing, help = parsing ? `ghostly help ${parsing.command}` : void 0) {
|
|
237
237
|
const names = Object.entries(all).flatMap(([name, o]) => o.type === "boolean" ? [name, `no-${name}`] : [name]);
|
|
238
238
|
const near = nearest(arg.replace(/^--?/, ""), names);
|
|
239
|
+
const privateKey = /PRIVATE KEY/.test(arg);
|
|
239
240
|
const hints = [
|
|
240
241
|
...near ? [`did you mean --${near}?`] : [],
|
|
242
|
+
...privateKey ? ["never paste a private key anywhere: Ghostly only needs the public key;"] : [],
|
|
241
243
|
...parsing?.text && /^-[^-]/.test(arg) ? ["put -- before text that starts with a dash;"] : [],
|
|
242
244
|
...help ? [help] : []
|
|
243
245
|
];
|
|
244
|
-
return new CliError("usage", `Unknown option ${arg}${parsing ? ` for ghostly ${parsing.command}` : ""}${hints.length ? ` (${hints.join(" ")})` : ""}`);
|
|
246
|
+
return new CliError("usage", `Unknown option ${shownOption(arg, privateKey)}${parsing ? ` for ghostly ${parsing.command}` : ""}${hints.length ? ` (${hints.join(" ")})` : ""}`);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* An unknown option as its refusal names it: a pasted private key (a PEM or OpenPGP block starts with dashes), a word
|
|
250
|
+
* with a line break or one longer than any option's name is described, not printed (docs/CLI.md "Secrets stay hidden").
|
|
251
|
+
* A seed, an nsec, a hex key or a Cashu token is longer than 40 characters too.
|
|
252
|
+
*/
|
|
253
|
+
function shownOption(arg, privateKey) {
|
|
254
|
+
if (privateKey) return "(a private key)";
|
|
255
|
+
return arg.length > 40 || /[\r\n]/.test(arg) ? `(a ${arg.length}-character word)` : arg;
|
|
245
256
|
}
|
|
246
257
|
/**
|
|
247
258
|
* A first word that starts with a dash and is no global option (`ghostly --porfile bot send …`, `ghostly -x status`):
|
|
@@ -1198,7 +1209,7 @@ var commands$8 = {
|
|
|
1198
1209
|
description: "Replace the three files when they are there"
|
|
1199
1210
|
}
|
|
1200
1211
|
},
|
|
1201
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1212
|
+
run: async ({ options }, a) => (await import("./apps-DjY095Af.js")).initApp(a.dir, {
|
|
1202
1213
|
name: options.name,
|
|
1203
1214
|
title: options.title,
|
|
1204
1215
|
force: options.force === true
|
|
@@ -1238,7 +1249,7 @@ var commands$8 = {
|
|
|
1238
1249
|
description: "This version's sequence, higher than the bundle at --out's (default: one more than it)"
|
|
1239
1250
|
}
|
|
1240
1251
|
},
|
|
1241
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1252
|
+
run: async ({ options }, a) => (await import("./apps-DjY095Af.js")).publishApp(a.dir, keyFile(options.key, "app publish <dir> --key <file> [--out <file>] [--sequence n]"), here(options.out), options.sequence)
|
|
1242
1253
|
},
|
|
1243
1254
|
"app revoke": {
|
|
1244
1255
|
method: "app.revoke",
|
|
@@ -1271,7 +1282,7 @@ var commands$8 = {
|
|
|
1271
1282
|
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"
|
|
1272
1283
|
}
|
|
1273
1284
|
},
|
|
1274
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1285
|
+
run: async ({ options }, a) => (await import("./apps-DjY095Af.js")).revokeApp(a.dir, keyFile(options.key, "app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>] [--force]"), {
|
|
1275
1286
|
digests: options.digest,
|
|
1276
1287
|
upTo: options["up-to"],
|
|
1277
1288
|
reason: options.reason,
|
|
@@ -1332,7 +1343,7 @@ var commands$8 = {
|
|
|
1332
1343
|
usage: "app verify <bundle|url>",
|
|
1333
1344
|
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",
|
|
1334
1345
|
args: ["bundle"],
|
|
1335
|
-
run: async (_, a) => (await import("./apps-
|
|
1346
|
+
run: async (_, a) => (await import("./apps-DjY095Af.js")).verifyApp(a.bundle)
|
|
1336
1347
|
},
|
|
1337
1348
|
"store sign": {
|
|
1338
1349
|
method: "store.sign",
|
|
@@ -1349,7 +1360,7 @@ var commands$8 = {
|
|
|
1349
1360
|
description: "The folder to write ghostly-store.json and ghostly-store.sig in (default: the index's)"
|
|
1350
1361
|
}
|
|
1351
1362
|
},
|
|
1352
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1363
|
+
run: async ({ options }, a) => (await import("./apps-DjY095Af.js")).signStore(a.index, keyFile(options.key, "store sign <index> --key <file> [--out <dir>]"), here(options.out))
|
|
1353
1364
|
}
|
|
1354
1365
|
};
|
|
1355
1366
|
// src/commands/calls.ts
|
|
@@ -2447,7 +2458,7 @@ var commands$3 = {
|
|
|
2447
2458
|
}
|
|
2448
2459
|
},
|
|
2449
2460
|
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");
|
|
2461
|
+
if (options.sfu === void 0 && options.clear !== true && options.e2ee === void 0) throw new CliError("usage", "Missing --sfu, --e2ee, --no-e2ee or --clear: ghostly group call <group> --sfu <https origin> [--e2ee | --no-e2ee] | --e2ee | --no-e2ee | --clear");
|
|
2451
2462
|
if (options.sfu !== void 0 && options.clear === true) throw new CliError("usage", "--clear removes the call node: not with --sfu");
|
|
2452
2463
|
if (options.e2ee !== void 0 && options.clear === true) throw new CliError("usage", "--clear removes the call node: not with --e2ee or --no-e2ee");
|
|
2453
2464
|
return {
|
|
@@ -2573,7 +2584,7 @@ var commands$3 = {
|
|
|
2573
2584
|
"group join": {
|
|
2574
2585
|
method: "group.join",
|
|
2575
2586
|
usage: "group join [<link> | -]",
|
|
2576
|
-
summary: "Join a group by its link; the link on stdin keeps it out of ps",
|
|
2587
|
+
summary: "Join a group by its link; the link on stdin keeps it out of ps (without a daemon it waits up to 60 s to be let in)",
|
|
2577
2588
|
args: ["link?"],
|
|
2578
2589
|
params: (_, { link }) => ({ link })
|
|
2579
2590
|
},
|
|
@@ -3614,28 +3625,34 @@ async function allowlist(from, groups, call, peerOf) {
|
|
|
3614
3625
|
keys.add(key);
|
|
3615
3626
|
continue;
|
|
3616
3627
|
}
|
|
3617
|
-
|
|
3618
|
-
if (chat.id !== ref && (!nameKey(ref) || nameKey(chat.label) !== nameKey(ref))) throw namedByThem(ref, {
|
|
3619
|
-
chat: chat.id,
|
|
3620
|
-
name: chat.peerName ?? null,
|
|
3621
|
-
contact: chat.peer
|
|
3622
|
-
});
|
|
3623
|
-
chats.add(chat.id);
|
|
3628
|
+
chats.add(await fromChat(ref, call));
|
|
3624
3629
|
}
|
|
3625
|
-
for (const ref of groups) groupIds.add((await otherFlag(call("group.get", { group: ref }), ref, "--group")).id);
|
|
3630
|
+
for (const ref of groups) groupIds.add((await otherFlag(call("group.get", { group: ref }), ref, "--group", call)).id);
|
|
3626
3631
|
return new Allowlist(chats, keys, groupIds, peerOf);
|
|
3627
3632
|
}
|
|
3633
|
+
/** The chat `--from <ref>` names (not a contact key): its id, or `namedByThem` when only its contact chose `ref`. */
|
|
3634
|
+
async function fromChat(ref, call) {
|
|
3635
|
+
const chat = await otherFlag(call("chat.get", { chat: ref }), ref, "--from", call);
|
|
3636
|
+
if (chat.id !== ref && (!nameKey(ref) || nameKey(chat.label) !== nameKey(ref))) throw namedByThem(ref, {
|
|
3637
|
+
chat: chat.id,
|
|
3638
|
+
name: chat.peerName ?? null,
|
|
3639
|
+
contact: chat.peer
|
|
3640
|
+
});
|
|
3641
|
+
return chat.id;
|
|
3642
|
+
}
|
|
3628
3643
|
/**
|
|
3629
3644
|
* A `--from` that names a group, or a `--group` a chat: said with the flag that takes it. The lookup's own hint named
|
|
3630
3645
|
* `ghostly group show` (or `chat show`), which lists nothing. A chat is named by its id: `--from` refuses a prefix of it
|
|
3631
|
-
* or the name its contact chose, which `--group`'s lookup took
|
|
3646
|
+
* or the name its contact chose, which `--group`'s lookup took, so a `--group` that found its chat only so is refused
|
|
3647
|
+
* as `--from` refuses it, with no `--from` to paste.
|
|
3632
3648
|
*/
|
|
3633
|
-
async function otherFlag(lookup, ref, flag) {
|
|
3649
|
+
async function otherFlag(lookup, ref, flag, call) {
|
|
3634
3650
|
try {
|
|
3635
3651
|
return await lookup;
|
|
3636
3652
|
} catch (error) {
|
|
3637
3653
|
const other = flag === "--from" ? "group" : "chat";
|
|
3638
3654
|
if (!(error instanceof CliError) || error.code !== "not_found" || typeof error.details?.[other] !== "string") throw error;
|
|
3655
|
+
if (other === "chat" && contactKeyOf(ref) === void 0) await fromChat(ref, call);
|
|
3639
3656
|
const named = other === "chat" ? error.details.chat : ref;
|
|
3640
3657
|
const shown = shellWord(named, error.details[other]);
|
|
3641
3658
|
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);
|
|
@@ -4455,8 +4472,8 @@ var VERSION = package_default.version;
|
|
|
4455
4472
|
* command a running daemon answers loads none of them, and starts about as fast as Node does. Statically imported, they
|
|
4456
4473
|
* cost every command ~100 ms before its socket was opened.
|
|
4457
4474
|
*/
|
|
4458
|
-
var engineApi = () => import("./api-
|
|
4459
|
-
var engineHost = () => import("./host-
|
|
4475
|
+
var engineApi = () => import("./api-CVtg7MpI.js");
|
|
4476
|
+
var engineHost = () => import("./host-C2WRKj3g.js");
|
|
4460
4477
|
/**
|
|
4461
4478
|
* `--translate <lang>`'s translator, or null (not asked; or the runtime is not there, said on stderr). Loaded only when
|
|
4462
4479
|
* asked: the app's message parser it reads costs every other command nothing.
|
|
@@ -5464,7 +5481,7 @@ async function profileCommand(sub, argv) {
|
|
|
5464
5481
|
noMoreThan(1, parsed.positionals, "profile create <name> [--use] [--name <shown name>] [--force]");
|
|
5465
5482
|
const shownName = parsed.options.name === void 0 ? void 0 : checkShownNameOption(parsed.options.name);
|
|
5466
5483
|
const force = parsed.options.force === true;
|
|
5467
|
-
if (shownName) (await import("./secretGuard-
|
|
5484
|
+
if (shownName) (await import("./secretGuard-Bm6nci0I.js")).guardText(shownName, force, "name", "set it");
|
|
5468
5485
|
const paths = createProfile(g.home, name);
|
|
5469
5486
|
let shown = null;
|
|
5470
5487
|
if (shownName !== void 0) try {
|
|
@@ -5564,7 +5581,7 @@ async function profileCommand(sub, argv) {
|
|
|
5564
5581
|
if (!given || !name) throw new CliError("usage", `Missing <${given ? "new profile" : "file"}>: ghostly profile restore <file> <new profile> [--passphrase-file f] [--use]`);
|
|
5565
5582
|
noMoreThan(2, parsed.positionals, "profile restore <file> <new profile> [--passphrase-file f] [--use]");
|
|
5566
5583
|
const file = here(given);
|
|
5567
|
-
const { backupFileProtection, restoreProfile } = await import("./backup-
|
|
5584
|
+
const { backupFileProtection, restoreProfile } = await import("./backup-B56sQqoQ.js");
|
|
5568
5585
|
const protection = await backupFileProtection(file);
|
|
5569
5586
|
const paths = await restoreProfile(g.home, checkProfileName(name), file, protection === "none" ? void 0 : await backupPassphrase(parsed.options["passphrase-file"], RESTORE_PASSPHRASE));
|
|
5570
5587
|
if (parsed.options.use) selectProfile(g.home, name);
|
|
@@ -6411,7 +6428,7 @@ async function textCommand(name, argv) {
|
|
|
6411
6428
|
};
|
|
6412
6429
|
if (spec.target === "group") params.mentions = parsed.options.mention ?? [];
|
|
6413
6430
|
if (parsed.options.reply !== void 0) params.reply = parsed.options.reply;
|
|
6414
|
-
if (!spec.message) Object.assign(params, (await import("./buttons-
|
|
6431
|
+
if (!spec.message) Object.assign(params, (await import("./buttons-CsN2WJOf.js")).buttonsOf(parsed.options));
|
|
6415
6432
|
print(await withSession(g, (s) => {
|
|
6416
6433
|
if (parsed.options.wait !== void 0) params.wait = parsed.options.wait;
|
|
6417
6434
|
if (parsed.options.timeout !== void 0) params.timeout = parsed.options.timeout;
|
|
@@ -6455,7 +6472,7 @@ async function identityAddCommand(argv) {
|
|
|
6455
6472
|
if (!provider) throw new CliError("usage", "Missing <provider>: ghostly identity add <provider> [subject] [--signer id] [--field name=value]... [--stdin] [--days n] [--timeout s]");
|
|
6456
6473
|
inRange(parsed.options, "timeout", "a number of seconds", 5, 3600);
|
|
6457
6474
|
const items = parsed.options.field ?? [];
|
|
6458
|
-
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry
|
|
6475
|
+
const known = parsed.options.days !== void 0 || items.length ? (await import("./registry--Rg2YvOH.js")).IDENTITY_PROVIDERS.find((p) => p.id === provider) : void 0;
|
|
6459
6476
|
if (known && parsed.options.days !== void 0) inRange(parsed.options, "days", "a whole number", 1, known.validity.maxDays, true);
|
|
6460
6477
|
const { fields, warning } = await identityFields(items, parsed.options.stdin === true, identitySecretFields(known, parsed.options.signer), readStdin, process.stdin.isTTY === true);
|
|
6461
6478
|
if (warning) process.stderr.write(`ghostly: ${warning}\n`);
|
|
@@ -6817,4 +6834,4 @@ async function run(argv) {
|
|
|
6817
6834
|
}
|
|
6818
6835
|
export { run };
|
|
6819
6836
|
|
|
6820
|
-
//# sourceMappingURL=main-
|
|
6837
|
+
//# sourceMappingURL=main-Dh7fePd8.js.map
|