@ghostlytools/cli 1.10.1 → 1.10.2

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.
Files changed (94) hide show
  1. package/README.md +10 -8
  2. package/SKILL.md +3 -2
  3. package/dist/assets/{api-BOWLZYXM.js → api-DcE4KylM.js} +2 -2
  4. package/dist/assets/{api-Bi6hCcwG.js → api-EUGHGnRz.js} +95 -43
  5. package/dist/assets/api-EUGHGnRz.js.map +1 -0
  6. package/dist/assets/{apiKit-DzXHZojD.js → apiKit-CJVp_crp.js} +68 -22
  7. package/dist/assets/apiKit-CJVp_crp.js.map +1 -0
  8. package/dist/assets/{apps-0Ks6KjqS.js → apps-C-KbyLCa.js} +1 -1
  9. package/dist/assets/{apps-DIQbzG08.js → apps-C54T_MOT.js} +5 -5
  10. package/dist/assets/{apps-DIQbzG08.js.map → apps-C54T_MOT.js.map} +1 -1
  11. package/dist/assets/{arkade-zozCldAE.js → arkade-BmxJTa65.js} +2 -2
  12. package/dist/assets/{arkade-zozCldAE.js.map → arkade-BmxJTa65.js.map} +1 -1
  13. package/dist/assets/{backup-BL49Kt-T.js → backup-BxSH5BZG.js} +7 -7
  14. package/dist/assets/{backup-BL49Kt-T.js.map → backup-BxSH5BZG.js.map} +1 -1
  15. package/dist/assets/{backup-BvIFcZM7.js → backup-C0Plp-DF.js} +1 -1
  16. package/dist/assets/{buttons-CAW5v5EE.js → buttons-B-ZJYdo0.js} +6 -6
  17. package/dist/assets/{buttons-CAW5v5EE.js.map → buttons-B-ZJYdo0.js.map} +1 -1
  18. package/dist/assets/buttons-DA3wZfG0.js +2 -0
  19. package/dist/assets/{client-CyApKBEw.js → client-CDa87uYD.js} +3 -3
  20. package/dist/assets/{client-CyApKBEw.js.map → client-CDa87uYD.js.map} +1 -1
  21. package/dist/assets/{codec-DqFxxB_q.js → codec-D45W1L8n.js} +2 -2
  22. package/dist/assets/{codec-DqFxxB_q.js.map → codec-D45W1L8n.js.map} +1 -1
  23. package/dist/assets/{envelope-CMUgz31I.js → envelope-C3yFCQa-.js} +2 -2
  24. package/dist/assets/{envelope-CMUgz31I.js.map → envelope-C3yFCQa-.js.map} +1 -1
  25. package/dist/assets/{errors-R4S2SAEM.js → errors-Dt-ZnyOX.js} +3 -1
  26. package/dist/assets/errors-Dt-ZnyOX.js.map +1 -0
  27. package/dist/assets/{fixedHosts-C2hdCfzK.js → fixedHosts-C6nCHjOa.js} +4 -4
  28. package/dist/assets/{fixedHosts-C2hdCfzK.js.map → fixedHosts-C6nCHjOa.js.map} +1 -1
  29. package/dist/assets/{groupFiles-BAQIt_bJ.js → groupFiles-DYopNE57.js} +156 -41
  30. package/dist/assets/groupFiles-DYopNE57.js.map +1 -0
  31. package/dist/assets/{host-CaRlDMTd.js → host-G5seUwaI.js} +108 -55
  32. package/dist/assets/host-G5seUwaI.js.map +1 -0
  33. package/dist/assets/{hyperdhtRelay-BxADl3SG.js → hyperdhtRelay-B_uHjg_r.js} +28 -20
  34. package/dist/assets/hyperdhtRelay-B_uHjg_r.js.map +1 -0
  35. package/dist/assets/{irohWeb-D2sh6EWp.js → irohWeb-C-2oslSU.js} +112 -34
  36. package/dist/assets/{irohWeb-D2sh6EWp.js.map → irohWeb-C-2oslSU.js.map} +1 -1
  37. package/dist/assets/{main-Bc4Ow56Z.js → main-Dk--nD7X.js} +69 -41
  38. package/dist/assets/main-Dk--nD7X.js.map +1 -0
  39. package/dist/assets/{mainline-DWh4Ccri.js → mainline-HPlVrl8R.js} +5 -5
  40. package/dist/assets/mainline-HPlVrl8R.js.map +1 -0
  41. package/dist/assets/{networkReason-DT_D_Wpc.js → networkReason-CfpO9ayz.js} +3 -3
  42. package/dist/assets/{networkReason-DT_D_Wpc.js.map → networkReason-CfpO9ayz.js.map} +1 -1
  43. package/dist/assets/{nwc-DoSEhUKb.js → nwc-BY7BPttn.js} +3 -3
  44. package/dist/assets/{nwc-DoSEhUKb.js.map → nwc-BY7BPttn.js.map} +1 -1
  45. package/dist/assets/{nwcProvider-CGWqUjpB.js → nwcProvider-CfpbNUf7.js} +2 -2
  46. package/dist/assets/{nwcProvider-CGWqUjpB.js.map → nwcProvider-CfpbNUf7.js.map} +1 -1
  47. package/dist/assets/{ownDid-CbGjRLBn.js → ownDid-DJFZM2cV.js} +2 -2
  48. package/dist/assets/{ownDid-CbGjRLBn.js.map → ownDid-DJFZM2cV.js.map} +1 -1
  49. package/dist/assets/{profiles-DgIfvBeN.js → profiles-DKmZGXp6.js} +13 -6
  50. package/dist/assets/profiles-DKmZGXp6.js.map +1 -0
  51. package/dist/assets/{registry-BSyxGjN6.js → registry-BUm4cAzV.js} +54 -15
  52. package/dist/assets/registry-BUm4cAzV.js.map +1 -0
  53. package/dist/assets/{registry-C5cn80Rw.js → registry-CAzrtV0_.js} +1 -1
  54. package/dist/assets/{resolve-D-9YRFhl.js → resolve-CDD4X68j.js} +5 -3
  55. package/dist/assets/resolve-CDD4X68j.js.map +1 -0
  56. package/dist/assets/{restoredRows-CRYwIx3g.js → restoredRows-YhlbokEE.js} +4 -2
  57. package/dist/assets/restoredRows-YhlbokEE.js.map +1 -0
  58. package/dist/assets/{secretGuard-CSVNxXVW.js → secretGuard-B7Hj0Kvz.js} +2 -2
  59. package/dist/assets/{secretGuard-CSVNxXVW.js.map → secretGuard-B7Hj0Kvz.js.map} +1 -1
  60. package/dist/assets/secretGuard-DUr6bgKc.js +2 -0
  61. package/dist/assets/{server-BufntkX8.js → server-DcOsgYDU.js} +821 -299
  62. package/dist/assets/server-DcOsgYDU.js.map +1 -0
  63. package/dist/assets/{src-CCt5s4DK.js → src-D31D1_oY.js} +417 -67
  64. package/dist/assets/src-D31D1_oY.js.map +1 -0
  65. package/dist/assets/{sshForges-D8CPaIbR.js → sshForges-DerRwMf3.js} +2 -2
  66. package/dist/assets/{sshForges-D8CPaIbR.js.map → sshForges-DerRwMf3.js.map} +1 -1
  67. package/dist/assets/{translate-Cb-6hMhD.js → translate-C-sj0VJe.js} +3 -3
  68. package/dist/assets/{translate-Cb-6hMhD.js.map → translate-C-sj0VJe.js.map} +1 -1
  69. package/dist/assets/{usdt-ds461mzA.js → usdt-DwHqp625.js} +3 -3
  70. package/dist/assets/{usdt-ds461mzA.js.map → usdt-DwHqp625.js.map} +1 -1
  71. package/dist/assets/{waitNotice-B8D8WhbE.js → waitNotice-D52RWbV4.js} +38 -4
  72. package/dist/assets/waitNotice-D52RWbV4.js.map +1 -0
  73. package/dist/assets/{words-B1ylON2h.js → words-Db9WgatT.js} +3 -3
  74. package/dist/assets/words-Db9WgatT.js.map +1 -0
  75. package/dist/ghostly.mjs +1 -1
  76. package/package.json +1 -1
  77. package/dist/assets/api-Bi6hCcwG.js.map +0 -1
  78. package/dist/assets/apiKit-DzXHZojD.js.map +0 -1
  79. package/dist/assets/buttons-oJI5mHSL.js +0 -2
  80. package/dist/assets/errors-R4S2SAEM.js.map +0 -1
  81. package/dist/assets/groupFiles-BAQIt_bJ.js.map +0 -1
  82. package/dist/assets/host-CaRlDMTd.js.map +0 -1
  83. package/dist/assets/hyperdhtRelay-BxADl3SG.js.map +0 -1
  84. package/dist/assets/main-Bc4Ow56Z.js.map +0 -1
  85. package/dist/assets/mainline-DWh4Ccri.js.map +0 -1
  86. package/dist/assets/profiles-DgIfvBeN.js.map +0 -1
  87. package/dist/assets/registry-BSyxGjN6.js.map +0 -1
  88. package/dist/assets/resolve-D-9YRFhl.js.map +0 -1
  89. package/dist/assets/restoredRows-CRYwIx3g.js.map +0 -1
  90. package/dist/assets/secretGuard-Q2BKq0q0.js +0 -2
  91. package/dist/assets/server-BufntkX8.js.map +0 -1
  92. package/dist/assets/src-CCt5s4DK.js.map +0 -1
  93. package/dist/assets/waitNotice-B8D8WhbE.js.map +0 -1
  94. package/dist/assets/words-B1ylON2h.js.map +0 -1
@@ -1,11 +1,11 @@
1
- import { _o as cardLine, co as PR_CHECKS, do as RUN_RESULTS, er as GROUP_FILE_LIMITS, fo as STATUS_CARD_LIMITS, lo as PR_STATES, oo as CRON_LINE, po as TASK_STATUSES, so as ITEM_STATES, uo as ROUTINE_STATES, vo as cardUrl, wa as VOICE_LIMITS, xo as statusCardBytes } from "./src-CCt5s4DK.js";
2
- import { i as localFileError, n as EXIT, r as asCliError, t as CliError } from "./errors-R4S2SAEM.js";
3
- import { a as WALLET_TYPES, d as ENGINE_READS, f as READ_PARAMS, i as TRANSPORT_NAMES, l as ENGINE_METHODS, n as CHAT_METHODS, o as turnRef, p as SECRET_RESULTS, r as PAY_METHODS, t as ADDRESS_TYPES, u as ENGINE_PARAMS } from "./words-B1ylON2h.js";
4
- import { m as namedByThem, t as CONTACT_KEY } from "./apiKit-DzXHZojD.js";
1
+ import { Da as VOICE_LIMITS, bo as cardLine, do as PR_CHECKS, fo as PR_STATES, go as TASK_STATUSES, ho as STATUS_CARD_LIMITS, lo as CRON_LINE, mo as RUN_RESULTS, nr as GROUP_FILE_LIMITS, po as ROUTINE_STATES, uo as ITEM_STATES, wo as statusCardBytes, xo as cardUrl } from "./src-D31D1_oY.js";
2
+ import { i as localFileError, n as EXIT, r as asCliError, t as CliError } from "./errors-Dt-ZnyOX.js";
3
+ import { a as WALLET_TYPES, d as ENGINE_READS, f as READ_PARAMS, i as TRANSPORT_NAMES, l as ENGINE_METHODS, n as CHAT_METHODS, o as turnRef, p as SECRET_RESULTS, r as PAY_METHODS, t as ADDRESS_TYPES, u as ENGINE_PARAMS } from "./words-Db9WgatT.js";
4
+ import { g as namedByThem, t as CONTACT_KEY } from "./apiKit-CJVp_crp.js";
5
5
  import { n as dropSecretEnv, t as childEnv } from "./childEnv-BVOQK9EA.js";
6
- import { _ as userPath, a as checkShownName, c as ghostlyHome, f as profileExists, h as startingDaemon, i as checkProfileName, l as listProfiles, m as selectProfile, o as createProfile, p as profilePaths, s as currentProfile, u as lockOwner, y as ownProfile } from "./profiles-DgIfvBeN.js";
7
- import { n as waitNotice, r as waitsFor } from "./waitNotice-B8D8WhbE.js";
8
- import { g as isCallRate, i as isNotTheDaemon, r as connectDaemon, t as DaemonClient, u as CALL_RATES } from "./client-CyApKBEw.js";
6
+ import { _ as userPath, a as checkShownName, c as ghostlyHome, f as profileExists, h as startingDaemon, i as checkProfileName, l as listProfiles, m as selectProfile, o as createProfile, p as profilePaths, s as currentProfile, u as lockOwner, y as ownProfile } from "./profiles-DKmZGXp6.js";
7
+ import { n as waitNotice, r as waitsFor } from "./waitNotice-D52RWbV4.js";
8
+ import { g as isCallRate, i as isNotTheDaemon, r as connectDaemon, t as DaemonClient, u as CALL_RATES } from "./client-CDa87uYD.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 } 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.10.1",
16
+ version: "1.10.2",
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",
@@ -1083,7 +1083,7 @@ var commands$8 = {
1083
1083
  description: "Replace the three files when they are there"
1084
1084
  }
1085
1085
  },
1086
- run: async ({ options }, a) => (await import("./apps-0Ks6KjqS.js")).initApp(a.dir, {
1086
+ run: async ({ options }, a) => (await import("./apps-C-KbyLCa.js")).initApp(a.dir, {
1087
1087
  name: options.name,
1088
1088
  title: options.title,
1089
1089
  force: options.force === true
@@ -1123,7 +1123,7 @@ var commands$8 = {
1123
1123
  description: "This version's sequence, higher than the bundle at --out's (default: one more than it)"
1124
1124
  }
1125
1125
  },
1126
- run: async ({ options }, a) => (await import("./apps-0Ks6KjqS.js")).publishApp(a.dir, keyFile(options.key, "app publish <dir> --key <file> [--out <file>] [--sequence n]"), here(options.out), options.sequence)
1126
+ run: async ({ options }, a) => (await import("./apps-C-KbyLCa.js")).publishApp(a.dir, keyFile(options.key, "app publish <dir> --key <file> [--out <file>] [--sequence n]"), here(options.out), options.sequence)
1127
1127
  },
1128
1128
  "app revoke": {
1129
1129
  method: "app.revoke",
@@ -1156,7 +1156,7 @@ var commands$8 = {
1156
1156
  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"
1157
1157
  }
1158
1158
  },
1159
- run: async ({ options }, a) => (await import("./apps-0Ks6KjqS.js")).revokeApp(a.dir, keyFile(options.key, "app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>] [--force]"), {
1159
+ run: async ({ options }, a) => (await import("./apps-C-KbyLCa.js")).revokeApp(a.dir, keyFile(options.key, "app revoke <dir> --key <file> (--digest <digest>... | --up-to <sequence>) [--reason <text>] [--bundle <file>] [--force]"), {
1160
1160
  digests: options.digest,
1161
1161
  upTo: options["up-to"],
1162
1162
  reason: options.reason,
@@ -1217,7 +1217,7 @@ var commands$8 = {
1217
1217
  usage: "app verify <bundle|url>",
1218
1218
  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 revokes this version",
1219
1219
  args: ["bundle"],
1220
- run: async (_, a) => (await import("./apps-0Ks6KjqS.js")).verifyApp(a.bundle)
1220
+ run: async (_, a) => (await import("./apps-C-KbyLCa.js")).verifyApp(a.bundle)
1221
1221
  },
1222
1222
  "store sign": {
1223
1223
  method: "store.sign",
@@ -1234,7 +1234,7 @@ var commands$8 = {
1234
1234
  description: "The folder to write ghostly-store.json and ghostly-store.sig in (default: the index's)"
1235
1235
  }
1236
1236
  },
1237
- run: async ({ options }, a) => (await import("./apps-0Ks6KjqS.js")).signStore(a.index, keyFile(options.key, "store sign <index> --key <file> [--out <dir>]"), here(options.out))
1237
+ run: async ({ options }, a) => (await import("./apps-C-KbyLCa.js")).signStore(a.index, keyFile(options.key, "store sign <index> --key <file> [--out <dir>]"), here(options.out))
1238
1238
  }
1239
1239
  };
1240
1240
  //#endregion
@@ -1648,7 +1648,7 @@ var commands$6 = {
1648
1648
  },
1649
1649
  "message delete": {
1650
1650
  method: "chat.delete",
1651
- usage: "message delete <chat|group> <message> [--everyone [--wait none|confirmed] [--timeout s]]",
1651
+ usage: "message delete <chat|group> <message> [--everyone [--wait none|confirmed|sent] [--timeout s]]",
1652
1652
  summary: "Forget a message on this device (the contact keeps theirs); --everyone deletes one of yours, in a chat or a group, from every member's device",
1653
1653
  args: ["chat", "message"],
1654
1654
  options: {
@@ -1658,8 +1658,12 @@ var commands$6 = {
1658
1658
  },
1659
1659
  wait: {
1660
1660
  type: "string",
1661
- choices: ["none", "confirmed"],
1662
- description: "With --everyone in a chat: none or confirmed, until the contact has it (default: none with a daemon, confirmed without)"
1661
+ choices: [
1662
+ "none",
1663
+ "confirmed",
1664
+ "sent"
1665
+ ],
1666
+ description: "With --everyone: in a chat none or confirmed, until the contact has it; in a group none or sent, until a member's edge took it (default: none with a daemon, confirmed or sent without)"
1663
1667
  },
1664
1668
  timeout: wait.timeout
1665
1669
  },
@@ -3315,7 +3319,7 @@ async function allowlist(from, groups, call, peerOf) {
3315
3319
  keys.add(ref);
3316
3320
  continue;
3317
3321
  }
3318
- const chat = await call("chat.get", { chat: ref });
3322
+ const chat = await otherFlag(call("chat.get", { chat: ref }), ref, "--from");
3319
3323
  if (chat.id !== ref && chat.label?.toLowerCase() !== ref.toLowerCase()) throw namedByThem(ref, {
3320
3324
  chat: chat.id,
3321
3325
  name: chat.peerName ?? null,
@@ -3323,9 +3327,23 @@ async function allowlist(from, groups, call, peerOf) {
3323
3327
  });
3324
3328
  chats.add(chat.id);
3325
3329
  }
3326
- for (const ref of groups) groupIds.add((await call("group.get", { group: ref })).id);
3330
+ for (const ref of groups) groupIds.add((await otherFlag(call("group.get", { group: ref }), ref, "--group")).id);
3327
3331
  return new Allowlist(chats, keys, groupIds, peerOf);
3328
3332
  }
3333
+ /**
3334
+ * A `--from` that names a group, or a `--group` a chat: said with the flag that takes it. The lookup's own hint named
3335
+ * `ghostly group show` (or `chat show`), which lists nothing.
3336
+ */
3337
+ async function otherFlag(lookup, ref, flag) {
3338
+ try {
3339
+ return await lookup;
3340
+ } catch (error) {
3341
+ const other = flag === "--from" ? "group" : "chat";
3342
+ if (!(error instanceof CliError) || error.code !== "not_found" || typeof error.details?.[other] !== "string") throw error;
3343
+ const shown = /^[\w.:-]+$/.test(ref) ? ref : JSON.stringify(ref);
3344
+ 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);
3345
+ }
3346
+ }
3329
3347
  /** The turn an event starts, or null: only a contact's message, and a group message that mentions this profile. */
3330
3348
  function toTurn(event) {
3331
3349
  const message = event.message;
@@ -3903,7 +3921,7 @@ async function completeWithPipedEvidence(call, params, read, note) {
3903
3921
  * `credential`) given on the command line still goes, with the ps/history warning: `settings get` hides it as a secret.
3904
3922
  */
3905
3923
  async function settingValue(key, value, read, tty = false, note = () => {}) {
3906
- const usage = "Missing <json-value>: ghostly settings set <key> <json-value>";
3924
+ const usage = "Missing <json-value>: ghostly settings set <key> <json-value> [--force]";
3907
3925
  if (value !== void 0 && value !== "-") return {
3908
3926
  value,
3909
3927
  ...key === "iceServers" && hasCredential(value) && { warning: `A TURN password on the command line shows in ps and the shell's history: give it on stdin instead (… | ghostly settings set ${key} -)` }
@@ -3997,15 +4015,15 @@ var VERSION = package_default.version;
3997
4015
  * command a running daemon answers loads none of them, and starts about as fast as Node does. Statically imported, they
3998
4016
  * cost every command ~100 ms before its socket was opened.
3999
4017
  */
4000
- var engineApi = () => import("./api-BOWLZYXM.js");
4001
- var engineHost = () => import("./host-CaRlDMTd.js");
4018
+ var engineApi = () => import("./api-DcE4KylM.js");
4019
+ var engineHost = () => import("./host-G5seUwaI.js");
4002
4020
  /**
4003
4021
  * `--translate <lang>`'s translator, or null (not asked; or the runtime is not there, said on stderr). Loaded only when
4004
4022
  * asked: the app's message parser it reads costs every other command nothing.
4005
4023
  */
4006
4024
  async function translatorFor(value, home) {
4007
4025
  if (value === void 0) return null;
4008
- const { loadDetector, openTranslator, translateTarget } = await import("./translate-Cb-6hMhD.js");
4026
+ const { loadDetector, openTranslator, translateTarget } = await import("./translate-C-sj0VJe.js");
4009
4027
  return openTranslator({
4010
4028
  home,
4011
4029
  to: translateTarget(value),
@@ -4119,10 +4137,15 @@ function settlesWithin(promise, ms) {
4119
4137
  * waited for the next minute (60 s and more instead of 3 to 5).
4120
4138
  */
4121
4139
  function chatOnly(method, params) {
4122
- if (method.startsWith("task.") || method.startsWith("routine.") || method.startsWith("button.")) return false;
4123
4140
  if (method === "usage.send") return params.all === true;
4141
+ if (chatOrGroup(method, params)) return false;
4124
4142
  return method.startsWith("chat.") || params.chat !== void 0 && params.group === void 0 && !method.startsWith("group.");
4125
4143
  }
4144
+ /** A command whose `chat` may name a group as well: a one-shot for it starts the groups' sessions. */
4145
+ function chatOrGroup(method, params) {
4146
+ if (method.startsWith("task.") || method.startsWith("routine.") || method.startsWith("button.") || method === "usage.send") return true;
4147
+ return method === "chat.delete" && params.everyone === true;
4148
+ }
4126
4149
  /**
4127
4150
  * A command that makes a new chat and needs no other: a one-shot for it leaves the saved chats and the groups unstarted.
4128
4151
  * Started, each saved chat put its records and its leave packet on the relays: from about ten that was the relays' 30
@@ -4136,10 +4159,11 @@ function newChatOnly(method) {
4136
4159
  * A command about the 1:1 chat it names, or one that makes or joins a new chat (`newChatOnly`): a one-shot for it leaves
4137
4160
  * the other saved chats unstarted too, and starts only the chat a call names (`startNamedChats`). Started, each saved
4138
4161
  * chat put its records and its leave packet on the relays: with 12 invites saved one `send` took the relays' 30
4139
- * requests a minute, and a text to a contact who is away, or the next one-shot, waited behind them.
4162
+ * requests a minute, and a text to a contact who is away, or the next one-shot, waited behind them. So does a command
4163
+ * whose chat may name a group (`chatOrGroup`: a bot's `task send`): the groups start for it, the other 1:1 chats do not.
4140
4164
  */
4141
4165
  function oneChatOnly(method, params) {
4142
- return newChatOnly(method) || chatOnly(method, params) && typeof params.chat === "string";
4166
+ return newChatOnly(method) || (chatOnly(method, params) || chatOrGroup(method, params)) && typeof params.chat === "string";
4143
4167
  }
4144
4168
  /**
4145
4169
  * Calls that only read what the profile stores: a one-shot for one opens it offline (`RuntimeOptions.offline`).
@@ -4424,7 +4448,7 @@ var o = (type, description) => ({
4424
4448
  /** Commands with their own flow (main.ts), as help shows them. */
4425
4449
  var SPECIAL = [
4426
4450
  [
4427
- "profile create <name> [--use] [--name <shown name>]",
4451
+ "profile create <name> [--use] [--name <shown name>] [--force]",
4428
4452
  "Make a profile (its own keys, chats and wallets)",
4429
4453
  {
4430
4454
  use: o("boolean", "Make it the current profile"),
@@ -4436,7 +4460,7 @@ var SPECIAL = [
4436
4460
  ["profile use <name>", "Make a profile the current one"],
4437
4461
  ["profile show", "The name contacts see, and whether it is shared"],
4438
4462
  [
4439
- "profile set [--name <name>] [--share-profile | --no-share-profile]",
4463
+ "profile set [--name <name>] [--share-profile | --no-share-profile] [--force]",
4440
4464
  "Change the name contacts see",
4441
4465
  {
4442
4466
  name: o("string", "The name contacts see"),
@@ -4510,7 +4534,7 @@ var SPECIAL = [
4510
4534
  { "show-secret": o("boolean", "Show credentials too") }
4511
4535
  ],
4512
4536
  [
4513
- "settings set <key> <json-value>",
4537
+ "settings set <key> <json-value> [--force]",
4514
4538
  "Change one: relays, irohRelays, hyperdhtRelay, iceServers, publicProfiles, online, shareProfile, sendTyping, autoDownloads, serveFiles, nick. <json-value> - (or none, piped) reads it from stdin: a TURN password stays out of ps",
4515
4539
  { force: o("boolean", "Set a nick even if it looks like a seed, a key or ecash") }
4516
4540
  ],
@@ -4775,11 +4799,11 @@ async function profileCommand(sub, argv) {
4775
4799
  switch (sub) {
4776
4800
  case "create": {
4777
4801
  const [name] = parsed.positionals;
4778
- if (!name) throw new CliError("usage", "Missing <name>: ghostly profile create <name> [--use] [--name <shown name>]");
4779
- noMoreThan(1, parsed.positionals, "profile create <name> [--use] [--name <shown name>]");
4802
+ if (!name) throw new CliError("usage", "Missing <name>: ghostly profile create <name> [--use] [--name <shown name>] [--force]");
4803
+ noMoreThan(1, parsed.positionals, "profile create <name> [--use] [--name <shown name>] [--force]");
4780
4804
  const shownName = parsed.options.name === void 0 ? void 0 : checkShownName(parsed.options.name);
4781
4805
  const force = parsed.options.force === true;
4782
- if (shownName) (await import("./secretGuard-Q2BKq0q0.js")).guardText(shownName, force, "name", "set it");
4806
+ if (shownName) (await import("./secretGuard-DUr6bgKc.js")).guardText(shownName, force, "name", "set it");
4783
4807
  const paths = createProfile(g.home, name);
4784
4808
  let shown = null;
4785
4809
  if (shownName !== void 0) try {
@@ -4833,11 +4857,11 @@ async function profileCommand(sub, argv) {
4833
4857
  print(await withSession(g, (s) => s.call("profile.get"), { offline: true }));
4834
4858
  return;
4835
4859
  case "set": {
4836
- noMoreThan(0, parsed.positionals, "profile set [--name <name>] [--share-profile | --no-share-profile]");
4860
+ noMoreThan(0, parsed.positionals, "profile set [--name <name>] [--share-profile | --no-share-profile] [--force]");
4837
4861
  const params = {};
4838
4862
  if (parsed.options.name !== void 0) params.name = parsed.options.name;
4839
4863
  if (parsed.options["share-profile"] !== void 0) params.shareProfile = parsed.options["share-profile"];
4840
- if (!Object.keys(params).length) throw new CliError("usage", "Nothing to change: ghostly profile set [--name <name>] [--share-profile | --no-share-profile]");
4864
+ if (!Object.keys(params).length) throw new CliError("usage", "Nothing to change: ghostly profile set [--name <name>] [--share-profile | --no-share-profile] [--force]");
4841
4865
  if (parsed.options.force === true) params.force = true;
4842
4866
  print(await withSession(g, (s) => s.call("profile.set", params)));
4843
4867
  return;
@@ -4870,7 +4894,7 @@ async function profileCommand(sub, argv) {
4870
4894
  if (!given || !name) throw new CliError("usage", `Missing <${given ? "new profile" : "file"}>: ghostly profile restore <file> <new profile> [--passphrase-file f] [--use]`);
4871
4895
  noMoreThan(2, parsed.positionals, "profile restore <file> <new profile> [--passphrase-file f] [--use]");
4872
4896
  const file = here(given);
4873
- const { backupFileProtection, restoreProfile } = await import("./backup-BvIFcZM7.js");
4897
+ const { backupFileProtection, restoreProfile } = await import("./backup-C0Plp-DF.js");
4874
4898
  const protection = await backupFileProtection(file);
4875
4899
  const paths = await restoreProfile(g.home, checkProfileName(name), file, protection === "none" ? void 0 : backupPassphrase(parsed.options["passphrase-file"], RESTORE_PASSPHRASE));
4876
4900
  if (parsed.options.use) selectProfile(g.home, name);
@@ -5560,8 +5584,8 @@ async function settingsCommand(sub, argv) {
5560
5584
  }
5561
5585
  if (sub === "set") {
5562
5586
  const [key, given] = parsed.positionals;
5563
- if (!key) throw new CliError("usage", "Missing <key>: ghostly settings set <key> <json-value>");
5564
- noMoreThan(2, parsed.positionals, "settings set <key> <json-value>");
5587
+ if (!key) throw new CliError("usage", "Missing <key>: ghostly settings set <key> <json-value> [--force]");
5588
+ noMoreThan(2, parsed.positionals, "settings set <key> <json-value> [--force]");
5565
5589
  const { value, warning } = await settingValue(key, given, readStdin, process.stdin.isTTY === true, (note) => process.stderr.write(`ghostly: ${note}\n`));
5566
5590
  if (warning) process.stderr.write(`ghostly: ${warning}\n`);
5567
5591
  let parsedValue;
@@ -5609,7 +5633,7 @@ async function textCommand(name, argv) {
5609
5633
  };
5610
5634
  if (spec.target === "group") params.mentions = parsed.options.mention ?? [];
5611
5635
  if (parsed.options.reply !== void 0) params.reply = parsed.options.reply;
5612
- if (!spec.message) Object.assign(params, (await import("./buttons-oJI5mHSL.js")).buttonsOf(parsed.options));
5636
+ if (!spec.message) Object.assign(params, (await import("./buttons-DA3wZfG0.js")).buttonsOf(parsed.options));
5613
5637
  print(await withSession(g, (s) => {
5614
5638
  if (spec.target === "chat") {
5615
5639
  params.wait = parsed.options.wait ?? (s.mode === "one-shot" ? spec.message ? "confirmed" : "sent" : "none");
@@ -5658,7 +5682,7 @@ async function identityAddCommand(argv) {
5658
5682
  if (!provider) throw new CliError("usage", "Missing <provider>: ghostly identity add <provider> [subject] [--signer id] [--field name=value]... [--stdin] [--days n] [--timeout s]");
5659
5683
  inRange(parsed.options, "timeout", "a number of seconds", 5, 3600);
5660
5684
  const items = parsed.options.field ?? [];
5661
- const known = parsed.options.days !== void 0 || items.length ? (await import("./registry-C5cn80Rw.js")).IDENTITY_PROVIDERS.find((p) => p.id === provider) : void 0;
5685
+ const known = parsed.options.days !== void 0 || items.length ? (await import("./registry-CAzrtV0_.js")).IDENTITY_PROVIDERS.find((p) => p.id === provider) : void 0;
5662
5686
  if (known && parsed.options.days !== void 0) inRange(parsed.options, "days", "a whole number", 1, known.validity.maxDays, true);
5663
5687
  const { fields, warning } = await identityFields(items, parsed.options.stdin === true, identitySecretFields(known, parsed.options.signer), readStdin, process.stdin.isTTY === true);
5664
5688
  if (warning) process.stderr.write(`ghostly: ${warning}\n`);
@@ -5762,13 +5786,13 @@ async function tableCommand(name, argv) {
5762
5786
  }
5763
5787
  return result;
5764
5788
  }, {
5765
- deferGroups: chatOnly(command.method, params) || oneChatOnly(command.method, params),
5789
+ deferGroups: chatOnly(command.method, params) || newChatOnly(command.method),
5766
5790
  deferChats: oneChatOnly(command.method, params),
5767
5791
  offline: offlineCall(command.method, params)
5768
5792
  });
5769
5793
  if (translator) {
5770
5794
  try {
5771
- printAnswer(await (await import("./translate-Cb-6hMhD.js")).translateAnswer(result, translator));
5795
+ printAnswer(await (await import("./translate-C-sj0VJe.js")).translateAnswer(result, translator));
5772
5796
  } finally {
5773
5797
  translator.close();
5774
5798
  }
@@ -5802,6 +5826,10 @@ async function callPipeCommand(argv) {
5802
5826
  socket.write(`${audio.token}\n`);
5803
5827
  process.stderr.write(`ghostly: call ${call.call}: s16le mono ${audio.rate} Hz on stdin/stdout\n`);
5804
5828
  process.stdin.pipe(socket, { end: false });
5829
+ onReaderGone(() => {
5830
+ process.stderr.write(`ghostly: call ${call.call}: nothing reads its audio any more; the call goes on\n`);
5831
+ socket.destroy();
5832
+ });
5805
5833
  socket.pipe(process.stdout);
5806
5834
  socket.on("close", () => exit(0));
5807
5835
  socket.on("error", () => exit(1));
@@ -5989,4 +6017,4 @@ async function run(argv) {
5989
6017
  //#endregion
5990
6018
  export { run };
5991
6019
 
5992
- //# sourceMappingURL=main-Bc4Ow56Z.js.map
6020
+ //# sourceMappingURL=main-Dk--nD7X.js.map