@ghostlytools/cli 1.3.0 → 1.3.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 +9 -3
- package/dist/assets/{api-CrxVxtY1.js → api-Dq2QXQDk.js} +141 -40
- package/dist/assets/api-Dq2QXQDk.js.map +1 -0
- package/dist/assets/{api-BiaX6l6f.js → api-TiB5QSG9.js} +2 -2
- package/dist/assets/{apiKit-CajiDxdK.js → apiKit-CA2x5GJF.js} +7 -3
- package/dist/assets/apiKit-CA2x5GJF.js.map +1 -0
- package/dist/assets/{apps-CbfiCSIw.js → apps-BxV9i_Y4.js} +3 -4
- package/dist/assets/{apps-CbfiCSIw.js.map → apps-BxV9i_Y4.js.map} +1 -1
- package/dist/assets/{apps-t23gkc28.js → apps-C-T8jeji.js} +1 -1
- package/dist/assets/{arkade-D4BVJFEQ.js → arkade-C_qDmHnm.js} +2 -2
- package/dist/assets/{arkade-D4BVJFEQ.js.map → arkade-C_qDmHnm.js.map} +1 -1
- package/dist/assets/{backup-Cg52WeQi.js → backup-Bugnn3Ue.js} +1 -1
- package/dist/assets/{backup-BAMi2lAq.js → backup-CnMN2oUK.js} +8 -8
- package/dist/assets/backup-CnMN2oUK.js.map +1 -0
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/bitcoind-CZchoh43.js +349 -0
- package/dist/assets/bitcoind-CZchoh43.js.map +1 -0
- package/dist/assets/bitcoindProvider-DGw3xBSa.js +97 -0
- package/dist/assets/bitcoindProvider-DGw3xBSa.js.map +1 -0
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
- package/dist/assets/buttons-Bj7Vf7Pn.js +2 -0
- package/dist/assets/{buttons-CX1pKB0j.js → buttons-CvNBzh2S.js} +4 -5
- package/dist/assets/{buttons-CX1pKB0j.js.map → buttons-CvNBzh2S.js.map} +1 -1
- package/dist/assets/{endpoint-Dn7H8qE1.js → endpoint-BOTFMpfS.js} +44 -12
- package/dist/assets/endpoint-BOTFMpfS.js.map +1 -0
- package/dist/assets/{envelope-BvU0fLEt.js → envelope-WjingYSc.js} +2 -2
- package/dist/assets/{envelope-BvU0fLEt.js.map → envelope-WjingYSc.js.map} +1 -1
- package/dist/assets/{errors-my6VJR_0.js → errors-DO5z6h_l.js} +29 -1
- package/dist/assets/errors-DO5z6h_l.js.map +1 -0
- package/dist/assets/groupFiles-IEUW3DQz.js +3202 -0
- package/dist/assets/groupFiles-IEUW3DQz.js.map +1 -0
- package/dist/assets/{host-Cmd205Dc.js → host-CWt-jtqz.js} +41 -16
- package/dist/assets/host-CWt-jtqz.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-CEmBpT0Q.js → hyperdhtRelay-CPYwSLLS.js} +2 -3
- package/dist/assets/{hyperdhtRelay-CEmBpT0Q.js.map → hyperdhtRelay-CPYwSLLS.js.map} +1 -1
- package/dist/assets/{irohWeb--YyEA-hX.js → irohWeb-4oChIOIp.js} +2 -3
- package/dist/assets/{irohWeb--YyEA-hX.js.map → irohWeb-4oChIOIp.js.map} +1 -1
- package/dist/assets/{main-BzNN6bkx.js → main-DbqcdShN.js} +142 -35
- package/dist/assets/main-DbqcdShN.js.map +1 -0
- package/dist/assets/{mainline-D5D5C-jT.js → mainline-ZkiOnevs.js} +2 -2
- package/dist/assets/{mainline-D5D5C-jT.js.map → mainline-ZkiOnevs.js.map} +1 -1
- package/dist/assets/{networkReason-DxZWHw6v.js → networkReason-CetKkTPo.js} +2 -2
- package/dist/assets/{networkReason-DxZWHw6v.js.map → networkReason-CetKkTPo.js.map} +1 -1
- package/dist/assets/nwc-CgkqyvsE.js +612 -0
- package/dist/assets/nwc-CgkqyvsE.js.map +1 -0
- package/dist/assets/nwcProvider-4eVz_8HP.js +77 -0
- package/dist/assets/nwcProvider-4eVz_8HP.js.map +1 -0
- package/dist/assets/{profiles-B6F4oa9K.js → profiles-BHc9pEYg.js} +2 -2
- package/dist/assets/{profiles-B6F4oa9K.js.map → profiles-BHc9pEYg.js.map} +1 -1
- package/dist/assets/registry-DlAKO0Fy.js +3793 -0
- package/dist/assets/registry-DlAKO0Fy.js.map +1 -0
- package/dist/assets/registry-OBJBnHVQ.js +2 -0
- package/dist/assets/resolve-CouHhCpJ.js +591 -0
- package/dist/assets/resolve-CouHhCpJ.js.map +1 -0
- package/dist/assets/{server-CBCEYKMN.js → server-Ss0gJ-nw.js} +184 -1181
- package/dist/assets/server-Ss0gJ-nw.js.map +1 -0
- package/dist/assets/{src-DhfGgAUu.js → src-DDzSERyc.js} +2249 -72
- package/dist/assets/src-DDzSERyc.js.map +1 -0
- package/dist/assets/{turnRefs-ChEfgbSX.js → turnRefs-B87dtrHM.js} +2 -2
- package/dist/assets/{turnRefs-ChEfgbSX.js.map → turnRefs-B87dtrHM.js.map} +1 -1
- package/dist/assets/types-C4_KafL_.js +122 -0
- package/dist/assets/types-C4_KafL_.js.map +1 -0
- package/dist/assets/{usdt-C1Xao2xH.js → usdt-Fj8CQO2z.js} +3 -3
- package/dist/assets/{usdt-C1Xao2xH.js.map → usdt-Fj8CQO2z.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-CrxVxtY1.js.map +0 -1
- package/dist/assets/apiKit-CajiDxdK.js.map +0 -1
- package/dist/assets/backup-BAMi2lAq.js.map +0 -1
- package/dist/assets/buttons-CWl2yNJu.js +0 -2
- package/dist/assets/endpoint-Dn7H8qE1.js.map +0 -1
- package/dist/assets/errors-my6VJR_0.js.map +0 -1
- package/dist/assets/groupFiles-BNTSDaoq.js +0 -7685
- package/dist/assets/groupFiles-BNTSDaoq.js.map +0 -1
- package/dist/assets/groupFiles-DBbjOLuD.js +0 -2088
- package/dist/assets/groupFiles-DBbjOLuD.js.map +0 -1
- package/dist/assets/host-Cmd205Dc.js.map +0 -1
- package/dist/assets/main-BzNN6bkx.js.map +0 -1
- package/dist/assets/server-CBCEYKMN.js.map +0 -1
- package/dist/assets/src-DhfGgAUu.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as SECRET_RESULTS, i as ENGINE_READS, r as ENGINE_METHODS, t as turnRef } from "./turnRefs-
|
|
3
|
-
import { n as EXIT, r as asCliError, t as CliError } from "./errors-
|
|
4
|
-
import { t as CONTACT_KEY } from "./apiKit-
|
|
5
|
-
import { a as createProfile, c as listProfiles, d as profilePaths, f as selectProfile, i as checkProfileName, l as lockOwner, o as currentProfile, s as ghostlyHome, u as profileExists } from "./profiles-
|
|
1
|
+
import { $a as cardUrl, Ga as ITEM_STATES, Ja as RUN_RESULTS, Ka as PR_CHECKS, Ya as STATUS_CARD_LIMITS, Zn as GROUP_FILE_LIMITS, qa as PR_STATES } from "./src-DDzSERyc.js";
|
|
2
|
+
import { a as SECRET_RESULTS, i as ENGINE_READS, r as ENGINE_METHODS, t as turnRef } from "./turnRefs-B87dtrHM.js";
|
|
3
|
+
import { n as EXIT, r as asCliError, t as CliError } from "./errors-DO5z6h_l.js";
|
|
4
|
+
import { t as CONTACT_KEY } from "./apiKit-CA2x5GJF.js";
|
|
5
|
+
import { a as createProfile, c as listProfiles, d as profilePaths, f as selectProfile, i as checkProfileName, l as lockOwner, o as currentProfile, s as ghostlyHome, u as profileExists } from "./profiles-BHc9pEYg.js";
|
|
6
6
|
import { n as ownSocket } from "./privateFolder-Bk9C9oFv.js";
|
|
7
7
|
import { accessSync, constants, existsSync, openSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { dirname, resolve } from "node:path";
|
|
@@ -12,7 +12,7 @@ import { createInterface } from "node:readline";
|
|
|
12
12
|
import { format } from "node:util";
|
|
13
13
|
var package_default = {
|
|
14
14
|
name: "@ghostlytools/cli",
|
|
15
|
-
version: "1.3.
|
|
15
|
+
version: "1.3.1",
|
|
16
16
|
type: "module",
|
|
17
17
|
description: "Ghostly for bots and terminals: the app's own engine, headless on Node, behind a daemon and a `ghostly` command with JSON output.",
|
|
18
18
|
license: "MIT",
|
|
@@ -869,7 +869,7 @@ var commands$8 = {
|
|
|
869
869
|
description: "Replace the three files when they are there"
|
|
870
870
|
}
|
|
871
871
|
},
|
|
872
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
872
|
+
run: async ({ options }, a) => (await import("./apps-C-T8jeji.js")).initApp(a.dir, {
|
|
873
873
|
name: options.name,
|
|
874
874
|
title: options.title,
|
|
875
875
|
force: options.force === true
|
|
@@ -909,7 +909,7 @@ var commands$8 = {
|
|
|
909
909
|
description: "This version's sequence, higher than the bundle at --out's (default: one more than it)"
|
|
910
910
|
}
|
|
911
911
|
},
|
|
912
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
912
|
+
run: async ({ options }, a) => (await import("./apps-C-T8jeji.js")).publishApp(a.dir, keyFile(options.key, "app publish <dir> --key <file> [--out <file>] [--sequence n]"), options.out, options.sequence)
|
|
913
913
|
},
|
|
914
914
|
"app revoke": {
|
|
915
915
|
method: "app.revoke",
|
|
@@ -938,7 +938,7 @@ var commands$8 = {
|
|
|
938
938
|
description: "The bundle naming the app (default <dir>/app.ghostlyapp)"
|
|
939
939
|
}
|
|
940
940
|
},
|
|
941
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
941
|
+
run: async ({ options }, a) => (await import("./apps-C-T8jeji.js")).revokeApp(a.dir, keyFile(options.key, "app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>]"), {
|
|
942
942
|
digests: options.digest,
|
|
943
943
|
upTo: options["up-to"],
|
|
944
944
|
reason: options.reason,
|
|
@@ -998,7 +998,7 @@ var commands$8 = {
|
|
|
998
998
|
usage: "app verify <bundle|url>",
|
|
999
999
|
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",
|
|
1000
1000
|
args: ["bundle"],
|
|
1001
|
-
run: async (_, a) => (await import("./apps-
|
|
1001
|
+
run: async (_, a) => (await import("./apps-C-T8jeji.js")).verifyApp(a.bundle)
|
|
1002
1002
|
},
|
|
1003
1003
|
"store sign": {
|
|
1004
1004
|
method: "store.sign",
|
|
@@ -1015,7 +1015,7 @@ var commands$8 = {
|
|
|
1015
1015
|
description: "The folder to write ghostly-store.json and ghostly-store.sig in (default: the index's)"
|
|
1016
1016
|
}
|
|
1017
1017
|
},
|
|
1018
|
-
run: async ({ options }, a) => (await import("./apps-
|
|
1018
|
+
run: async ({ options }, a) => (await import("./apps-C-T8jeji.js")).signStore(a.index, keyFile(options.key, "store sign <index> --key <file> [--out <dir>]"), options.out)
|
|
1019
1019
|
}
|
|
1020
1020
|
};
|
|
1021
1021
|
//#endregion
|
|
@@ -1680,15 +1680,21 @@ var commands$5 = {
|
|
|
1680
1680
|
description: "Seconds --wait waits (default 300)"
|
|
1681
1681
|
}
|
|
1682
1682
|
},
|
|
1683
|
-
params: ({ options }, a) =>
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1683
|
+
params: ({ options }, a) => {
|
|
1684
|
+
if (options.path === "") throw new CliError("usage", "--path needs a file");
|
|
1685
|
+
if (options.dir === "") throw new CliError("usage", "--dir needs a folder");
|
|
1686
|
+
if (options.dir !== void 0 && options.path !== void 0) throw new CliError("usage", "--path names the file: not with --dir");
|
|
1687
|
+
if (options.timeout !== void 0 && options.wait !== true) throw new CliError("usage", "--timeout is how long --wait waits: not without --wait");
|
|
1688
|
+
return {
|
|
1689
|
+
chat: a.chat,
|
|
1690
|
+
file: a.file,
|
|
1691
|
+
dir: options.path === void 0 ? here(options.dir ?? ".") : void 0,
|
|
1692
|
+
path: here(options.path),
|
|
1693
|
+
force: options.force === true,
|
|
1694
|
+
wait: options.wait === true ? true : void 0,
|
|
1695
|
+
timeout: options.timeout
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1692
1698
|
},
|
|
1693
1699
|
"file send": {
|
|
1694
1700
|
method: "file.send",
|
|
@@ -1919,10 +1925,17 @@ var commands$3 = {
|
|
|
1919
1925
|
},
|
|
1920
1926
|
"group leave": {
|
|
1921
1927
|
method: "group.leave",
|
|
1922
|
-
usage: "group leave <group>",
|
|
1923
|
-
summary: "Leave a group",
|
|
1928
|
+
usage: "group leave <group> --yes",
|
|
1929
|
+
summary: "Leave a group; its history and files go from this device",
|
|
1924
1930
|
args: ["group"],
|
|
1925
|
-
|
|
1931
|
+
options: { yes: {
|
|
1932
|
+
type: "boolean",
|
|
1933
|
+
description: "Confirm"
|
|
1934
|
+
} },
|
|
1935
|
+
params: ({ options }, { group }) => ({
|
|
1936
|
+
group,
|
|
1937
|
+
yes: options.yes === true
|
|
1938
|
+
})
|
|
1926
1939
|
},
|
|
1927
1940
|
"group link": {
|
|
1928
1941
|
method: "group.link",
|
|
@@ -2098,11 +2111,14 @@ var commands$2 = {
|
|
|
2098
2111
|
description: "The tool's output, from stdin"
|
|
2099
2112
|
}
|
|
2100
2113
|
},
|
|
2101
|
-
params: ({ options }, a) =>
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2114
|
+
params: ({ options }, a) => {
|
|
2115
|
+
if (options["evidence-file"] !== void 0 && options.stdin === true) throw new CliError("usage", "--evidence-file or --stdin, not both");
|
|
2116
|
+
return {
|
|
2117
|
+
draft: a.draft,
|
|
2118
|
+
evidenceFile: here(options["evidence-file"]),
|
|
2119
|
+
stdin: options.stdin === true
|
|
2120
|
+
};
|
|
2121
|
+
}
|
|
2106
2122
|
},
|
|
2107
2123
|
"identity contact": {
|
|
2108
2124
|
method: "identity.contact",
|
|
@@ -2885,9 +2901,99 @@ function writeCursor(path, seq) {
|
|
|
2885
2901
|
});
|
|
2886
2902
|
renameSync(path + ".tmp", path);
|
|
2887
2903
|
}
|
|
2904
|
+
/**
|
|
2905
|
+
* `--type`: one type (`message.received`, exactly: `group.message` is not its `group.message.edited`), or a family, a
|
|
2906
|
+
* word with no "." (`message`, `chat`) or one ending in "." or "*" (`group.typing.`). Before, a family needed its "." and
|
|
2907
|
+
* `--type chat` let nothing through. A family is whole words: `message` is not `messages.x`.
|
|
2908
|
+
*/
|
|
2888
2909
|
function matches(event, types) {
|
|
2889
2910
|
if (!types.length) return true;
|
|
2890
|
-
return types.some((type) =>
|
|
2911
|
+
return types.some((type) => {
|
|
2912
|
+
if (type === "*") return true;
|
|
2913
|
+
const family = /[.*]$/.test(type) ? type.replace(/\.?\*$/, "").replace(/\.$/, "") : type.includes(".") ? null : type;
|
|
2914
|
+
return event.type === type || family !== null && event.type.startsWith(family + ".");
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
/**
|
|
2918
|
+
* Every event type a daemon of this version emits (events.ts, appEvents.ts, holds.ts, identities.ts, calls/manager.ts,
|
|
2919
|
+
* main.ts) and `--turns`' own. A test reads them back from the source: a type added there and not here fails it.
|
|
2920
|
+
*/
|
|
2921
|
+
var EVENT_TYPES = [
|
|
2922
|
+
"agent.turn",
|
|
2923
|
+
"app.closed",
|
|
2924
|
+
"app.message",
|
|
2925
|
+
"app.opened",
|
|
2926
|
+
"button.pressed",
|
|
2927
|
+
"call.connected",
|
|
2928
|
+
"call.ended",
|
|
2929
|
+
"call.incoming",
|
|
2930
|
+
"call.outgoing",
|
|
2931
|
+
"call.resumed",
|
|
2932
|
+
"call.stalled",
|
|
2933
|
+
"chat.announced",
|
|
2934
|
+
"chat.connection",
|
|
2935
|
+
"chat.created",
|
|
2936
|
+
"chat.held",
|
|
2937
|
+
"chat.joined",
|
|
2938
|
+
"chat.pairing",
|
|
2939
|
+
"chat.pinned",
|
|
2940
|
+
"chat.released",
|
|
2941
|
+
"chat.removed",
|
|
2942
|
+
"chat.renamed",
|
|
2943
|
+
"daemon.started",
|
|
2944
|
+
"events.gap",
|
|
2945
|
+
"file.done",
|
|
2946
|
+
"file.failed",
|
|
2947
|
+
"file.offered",
|
|
2948
|
+
"file.stage",
|
|
2949
|
+
"group.created",
|
|
2950
|
+
"group.deleted",
|
|
2951
|
+
"group.event",
|
|
2952
|
+
"group.members",
|
|
2953
|
+
"group.mentioned",
|
|
2954
|
+
"group.message",
|
|
2955
|
+
"group.message.edited",
|
|
2956
|
+
"group.pinned",
|
|
2957
|
+
"group.reaction",
|
|
2958
|
+
"group.removed",
|
|
2959
|
+
"group.sent",
|
|
2960
|
+
"group.status",
|
|
2961
|
+
"group.typing.started",
|
|
2962
|
+
"group.typing.stopped",
|
|
2963
|
+
"identity.approval",
|
|
2964
|
+
"identity.progress",
|
|
2965
|
+
"identity.received",
|
|
2966
|
+
"identity.status",
|
|
2967
|
+
"message.deleted",
|
|
2968
|
+
"message.delivery",
|
|
2969
|
+
"message.edited",
|
|
2970
|
+
"message.reaction",
|
|
2971
|
+
"message.received",
|
|
2972
|
+
"message.sent",
|
|
2973
|
+
"payment.created",
|
|
2974
|
+
"payment.updated",
|
|
2975
|
+
"typing.started",
|
|
2976
|
+
"typing.stopped"
|
|
2977
|
+
];
|
|
2978
|
+
/** The families, the first word of each type: what a `--type` must start with. */
|
|
2979
|
+
var EVENT_FAMILIES = [...new Set(EVENT_TYPES.map((type) => type.split(".")[0]))];
|
|
2980
|
+
/**
|
|
2981
|
+
* Checks each `--type` before anything starts. Before, `--type bogus` (or a typo such as `message.recieved`) was taken
|
|
2982
|
+
* and the listener stayed silent for good. A first word that is no family is a usage error naming them; a type, or a
|
|
2983
|
+
* family below the first word, that no event has is said on stderr (`warn`) and kept: a newer daemon may emit it.
|
|
2984
|
+
*/
|
|
2985
|
+
function checkTypes(types, warn) {
|
|
2986
|
+
for (const type of types) {
|
|
2987
|
+
if (type === "*") continue;
|
|
2988
|
+
const family = type.split(/[.*]/)[0];
|
|
2989
|
+
if (!EVENT_FAMILIES.includes(family)) throw new CliError("usage", `No event is of type ${type}: --type takes a type, or a family (${EVENT_FAMILIES.join(", ")})`);
|
|
2990
|
+
if (!EVENT_TYPES.some((known) => matches({
|
|
2991
|
+
seq: 0,
|
|
2992
|
+
id: "",
|
|
2993
|
+
type: known,
|
|
2994
|
+
at: 0
|
|
2995
|
+
}, [type]))) warn(`ghostly: no event is of type ${type}; the ${family} family has ${EVENT_TYPES.filter((known) => known.startsWith(family + ".")).join(", ")}`);
|
|
2996
|
+
}
|
|
2891
2997
|
}
|
|
2892
2998
|
/** The environment a hook runs in: this one's, less the backup passphrase (a hook, and what it runs, never needs it). */
|
|
2893
2999
|
function hookEnv(env) {
|
|
@@ -3062,8 +3168,8 @@ var VERSION = package_default.version;
|
|
|
3062
3168
|
* command a running daemon answers loads none of them, and starts about as fast as Node does. Statically imported, they
|
|
3063
3169
|
* cost every command ~100 ms before its socket was opened.
|
|
3064
3170
|
*/
|
|
3065
|
-
var engineApi = () => import("./api-
|
|
3066
|
-
var engineHost = () => import("./host-
|
|
3171
|
+
var engineApi = () => import("./api-TiB5QSG9.js");
|
|
3172
|
+
var engineHost = () => import("./host-CWt-jtqz.js");
|
|
3067
3173
|
var pretty = false;
|
|
3068
3174
|
function print(value) {
|
|
3069
3175
|
process.stdout.write(JSON.stringify(value, null, pretty ? 2 : void 0) + "\n");
|
|
@@ -3262,7 +3368,7 @@ var SPECIAL = [
|
|
|
3262
3368
|
{
|
|
3263
3369
|
since: o("number", "Replay events after this seq first"),
|
|
3264
3370
|
cursor: o("string", "A file that keeps the last seq handled (read at start, written after each event)"),
|
|
3265
|
-
type: o("list", "Only events of this type
|
|
3371
|
+
type: o("list", "Only events of this type (message.received) or family (message, or group.typing.); repeat for more"),
|
|
3266
3372
|
turns: o("boolean", "Only agent turns: each message received, and each group message that mentions you, as one agent.turn event"),
|
|
3267
3373
|
from: o("list", "Only this chat's events (id, prefix, name or the contact's key; again for more)"),
|
|
3268
3374
|
group: o("list", "Only this group's events (again for more); with --from or --group, nobody else's event gets through"),
|
|
@@ -3523,7 +3629,7 @@ async function profileCommand(sub, argv) {
|
|
|
3523
3629
|
const [file, name] = parsed.positionals;
|
|
3524
3630
|
if (!file || !name) throw new CliError("usage", "ghostly profile restore <file> <new profile> [--passphrase-file f] [--use]");
|
|
3525
3631
|
noMoreThan(2, parsed.positionals, "profile restore <file> <new profile> [--passphrase-file f] [--use]");
|
|
3526
|
-
const { backupFileProtection, restoreProfile } = await import("./backup-
|
|
3632
|
+
const { backupFileProtection, restoreProfile } = await import("./backup-Bugnn3Ue.js");
|
|
3527
3633
|
const protection = await backupFileProtection(file);
|
|
3528
3634
|
const paths = await restoreProfile(g.home, checkProfileName(name), file, protection === "none" ? void 0 : backupPassphrase(parsed.options["passphrase-file"], RESTORE_PASSPHRASE));
|
|
3529
3635
|
if (parsed.options.use) selectProfile(g.home, name);
|
|
@@ -3800,6 +3906,7 @@ async function listenCommand(argv) {
|
|
|
3800
3906
|
const types = parsed.options.type ?? [];
|
|
3801
3907
|
const turns = parsed.options.turns === true;
|
|
3802
3908
|
if (turns && types.length) throw new CliError("usage", "--turns takes the place of --type: a turn is a message received, or a group message that mentions you");
|
|
3909
|
+
checkTypes(types, (line) => process.stderr.write(line + "\n"));
|
|
3803
3910
|
const from = parsed.options.from ?? [], groups = parsed.options.group ?? [];
|
|
3804
3911
|
const cursor = parsed.options.cursor;
|
|
3805
3912
|
checkCursor(cursor);
|
|
@@ -4024,7 +4131,7 @@ async function textCommand(name, argv) {
|
|
|
4024
4131
|
};
|
|
4025
4132
|
if (spec.target === "group") params.mentions = parsed.options.mention ?? [];
|
|
4026
4133
|
if (parsed.options.reply !== void 0) params.reply = parsed.options.reply;
|
|
4027
|
-
if (!spec.message) Object.assign(params, (await import("./buttons-
|
|
4134
|
+
if (!spec.message) Object.assign(params, (await import("./buttons-Bj7Vf7Pn.js")).buttonsOf(parsed.options));
|
|
4028
4135
|
print(await withSession(g, (s) => {
|
|
4029
4136
|
if (spec.target === "chat") {
|
|
4030
4137
|
params.wait = parsed.options.wait ?? (s.mode === "one-shot" ? spec.message ? "confirmed" : "sent" : "none");
|
|
@@ -4299,4 +4406,4 @@ async function run(argv) {
|
|
|
4299
4406
|
//#endregion
|
|
4300
4407
|
export { run };
|
|
4301
4408
|
|
|
4302
|
-
//# sourceMappingURL=main-
|
|
4409
|
+
//# sourceMappingURL=main-DbqcdShN.js.map
|