@ghostlytools/cli 1.10.2 → 1.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +4 -2
  2. package/dist/assets/{api-DcE4KylM.js → api-DgS7f5TT.js} +2 -2
  3. package/dist/assets/{api-EUGHGnRz.js → api-DkcMOWLX.js} +44 -19
  4. package/dist/assets/api-DkcMOWLX.js.map +1 -0
  5. package/dist/assets/{apiKit-CJVp_crp.js → apiKit-D6Oj-vFx.js} +27 -11
  6. package/dist/assets/apiKit-D6Oj-vFx.js.map +1 -0
  7. package/dist/assets/{apps-C54T_MOT.js → apps-B22SeD6T.js} +3 -3
  8. package/dist/assets/{apps-C54T_MOT.js.map → apps-B22SeD6T.js.map} +1 -1
  9. package/dist/assets/{apps-C-KbyLCa.js → apps-DgALLHzS.js} +1 -1
  10. package/dist/assets/{arkade-BmxJTa65.js → arkade-D5cPr_dV.js} +2 -2
  11. package/dist/assets/{arkade-BmxJTa65.js.map → arkade-D5cPr_dV.js.map} +1 -1
  12. package/dist/assets/{backup-C0Plp-DF.js → backup-DndsW2uX.js} +1 -1
  13. package/dist/assets/{backup-BxSH5BZG.js → backup-dzJLzg-k.js} +6 -6
  14. package/dist/assets/{backup-BxSH5BZG.js.map → backup-dzJLzg-k.js.map} +1 -1
  15. package/dist/assets/{blobFiles-BnjN_Vrz.js → blobFiles-XZ9PEXYy.js} +2 -2
  16. package/dist/assets/{blobFiles-BnjN_Vrz.js.map → blobFiles-XZ9PEXYy.js.map} +1 -1
  17. package/dist/assets/{buttons-B-ZJYdo0.js → buttons-ByKT_vP8.js} +4 -4
  18. package/dist/assets/{buttons-B-ZJYdo0.js.map → buttons-ByKT_vP8.js.map} +1 -1
  19. package/dist/assets/buttons-TVCNj280.js +2 -0
  20. package/dist/assets/{client-CDa87uYD.js → client-q7dVOtYb.js} +10 -4
  21. package/dist/assets/client-q7dVOtYb.js.map +1 -0
  22. package/dist/assets/{codec-D45W1L8n.js → codec-HD6iOn_D.js} +2 -2
  23. package/dist/assets/{codec-D45W1L8n.js.map → codec-HD6iOn_D.js.map} +1 -1
  24. package/dist/assets/{envelope-C3yFCQa-.js → envelope-C-0tfbOG.js} +2 -2
  25. package/dist/assets/{envelope-C3yFCQa-.js.map → envelope-C-0tfbOG.js.map} +1 -1
  26. package/dist/assets/{fileBytes-DjBYYyXT.js → fileBytes-BABGEF13.js} +2 -2
  27. package/dist/assets/{fileBytes-DjBYYyXT.js.map → fileBytes-BABGEF13.js.map} +1 -1
  28. package/dist/assets/{fileBytes-DMzrIdCu.js → fileBytes-CQQK2uOh.js} +1 -1
  29. package/dist/assets/{fileBytes-Douk1yOp.js → fileBytes-DqnfKIkj.js} +2 -2
  30. package/dist/assets/{fileBytes-Douk1yOp.js.map → fileBytes-DqnfKIkj.js.map} +1 -1
  31. package/dist/assets/fileBytesIdb-BtXATa7j.js +2 -0
  32. package/dist/assets/{fileBytesIdb-CkClu9YI.js → fileBytesIdb-DrXmDUSy.js} +2 -2
  33. package/dist/assets/{fileBytesIdb-CkClu9YI.js.map → fileBytesIdb-DrXmDUSy.js.map} +1 -1
  34. package/dist/assets/{fileBytesOpfs-WryQuOgK.js → fileBytesOpfs-udKCzcLe.js} +6 -9
  35. package/dist/assets/{fileBytesOpfs-WryQuOgK.js.map → fileBytesOpfs-udKCzcLe.js.map} +1 -1
  36. package/dist/assets/{fixedHosts-C6nCHjOa.js → fixedHosts-CN3CsslV.js} +7 -8
  37. package/dist/assets/fixedHosts-CN3CsslV.js.map +1 -0
  38. package/dist/assets/{groupFiles-DYopNE57.js → groupFiles-BFv9K_za.js} +256 -110
  39. package/dist/assets/groupFiles-BFv9K_za.js.map +1 -0
  40. package/dist/assets/{host-G5seUwaI.js → host-C-wwtVt2.js} +378 -60
  41. package/dist/assets/host-C-wwtVt2.js.map +1 -0
  42. package/dist/assets/{hyperdhtRelay-B_uHjg_r.js → hyperdhtRelay-B9EQTm_M.js} +2 -2
  43. package/dist/assets/{hyperdhtRelay-B_uHjg_r.js.map → hyperdhtRelay-B9EQTm_M.js.map} +1 -1
  44. package/dist/assets/{irohWeb-C-2oslSU.js → irohWeb-o0H_NlCF.js} +2 -2
  45. package/dist/assets/{irohWeb-C-2oslSU.js.map → irohWeb-o0H_NlCF.js.map} +1 -1
  46. package/dist/assets/{main-Dk--nD7X.js → main-CLUIPy4d.js} +49 -30
  47. package/dist/assets/main-CLUIPy4d.js.map +1 -0
  48. package/dist/assets/{mainline-HPlVrl8R.js → mainline-B2qmNsib.js} +155 -3
  49. package/dist/assets/mainline-B2qmNsib.js.map +1 -0
  50. package/dist/assets/{networkReason-CfpO9ayz.js → networkReason-BEl-DDWd.js} +4 -4
  51. package/dist/assets/{networkReason-CfpO9ayz.js.map → networkReason-BEl-DDWd.js.map} +1 -1
  52. package/dist/assets/{nwc-BY7BPttn.js → nwc-BNkhjJHN.js} +3 -3
  53. package/dist/assets/{nwc-BY7BPttn.js.map → nwc-BNkhjJHN.js.map} +1 -1
  54. package/dist/assets/{nwcProvider-CfpbNUf7.js → nwcProvider-CvaRJdHT.js} +2 -2
  55. package/dist/assets/{nwcProvider-CfpbNUf7.js.map → nwcProvider-CvaRJdHT.js.map} +1 -1
  56. package/dist/assets/{ownDid-DJFZM2cV.js → ownDid-D67KNdJq.js} +3 -2
  57. package/dist/assets/ownDid-D67KNdJq.js.map +1 -0
  58. package/dist/assets/{profiles-DKmZGXp6.js → profiles-QDB7V_Qt.js} +7 -5
  59. package/dist/assets/profiles-QDB7V_Qt.js.map +1 -0
  60. package/dist/assets/{registry-BUm4cAzV.js → registry-BKkSnpjL.js} +126 -19
  61. package/dist/assets/registry-BKkSnpjL.js.map +1 -0
  62. package/dist/assets/{registry-CAzrtV0_.js → registry-DN5a8Ul6.js} +1 -1
  63. package/dist/assets/{resolve-CDD4X68j.js → resolve-DhpAggDP.js} +24 -5
  64. package/dist/assets/resolve-DhpAggDP.js.map +1 -0
  65. package/dist/assets/{server-DcOsgYDU.js → server-7w2O5wsv.js} +956 -277
  66. package/dist/assets/server-7w2O5wsv.js.map +1 -0
  67. package/dist/assets/{src-D31D1_oY.js → src-BZkY6N3J.js} +909 -198
  68. package/dist/assets/src-BZkY6N3J.js.map +1 -0
  69. package/dist/assets/{sshForges-DerRwMf3.js → sshForges-Cxjt3c51.js} +2 -2
  70. package/dist/assets/{sshForges-DerRwMf3.js.map → sshForges-Cxjt3c51.js.map} +1 -1
  71. package/dist/assets/{translate-C-sj0VJe.js → translate-v8wF1GcF.js} +2 -2
  72. package/dist/assets/{translate-C-sj0VJe.js.map → translate-v8wF1GcF.js.map} +1 -1
  73. package/dist/assets/{usdt-DwHqp625.js → usdt-63gYjM5E.js} +7 -4
  74. package/dist/assets/usdt-63gYjM5E.js.map +1 -0
  75. package/dist/assets/{waitNotice-D52RWbV4.js → waitNotice-Ce3YCinu.js} +27 -5
  76. package/dist/assets/waitNotice-Ce3YCinu.js.map +1 -0
  77. package/dist/assets/{words-Db9WgatT.js → words-PUnyO4ph.js} +4 -4
  78. package/dist/assets/words-PUnyO4ph.js.map +1 -0
  79. package/dist/ghostly.mjs +1 -1
  80. package/package.json +1 -1
  81. package/dist/assets/api-EUGHGnRz.js.map +0 -1
  82. package/dist/assets/apiKit-CJVp_crp.js.map +0 -1
  83. package/dist/assets/buttons-DA3wZfG0.js +0 -2
  84. package/dist/assets/client-CDa87uYD.js.map +0 -1
  85. package/dist/assets/fileBytesIdb-CD5Uv490.js +0 -2
  86. package/dist/assets/fixedHosts-C6nCHjOa.js.map +0 -1
  87. package/dist/assets/groupFiles-DYopNE57.js.map +0 -1
  88. package/dist/assets/host-G5seUwaI.js.map +0 -1
  89. package/dist/assets/main-Dk--nD7X.js.map +0 -1
  90. package/dist/assets/mainline-HPlVrl8R.js.map +0 -1
  91. package/dist/assets/ownDid-DJFZM2cV.js.map +0 -1
  92. package/dist/assets/profiles-DKmZGXp6.js.map +0 -1
  93. package/dist/assets/registry-BUm4cAzV.js.map +0 -1
  94. package/dist/assets/resolve-CDD4X68j.js.map +0 -1
  95. package/dist/assets/server-DcOsgYDU.js.map +0 -1
  96. package/dist/assets/src-D31D1_oY.js.map +0 -1
  97. package/dist/assets/usdt-DwHqp625.js.map +0 -1
  98. package/dist/assets/waitNotice-D52RWbV4.js.map +0 -1
  99. package/dist/assets/words-Db9WgatT.js.map +0 -1
package/README.md CHANGED
@@ -132,7 +132,7 @@ The rows are in alphabetical order of their first command, and every command of
132
132
  | `chat request <chat> <sats> [--memo t] [--method m] [--rail r]`, `chat pay-request <chat> <payment>` | Ask a contact to pay; pay the contact's request. Refused as `chat pay` is when the contact offers no way of paying, or when `chat request` has no Cashu wallet of the network here (`no_wallet`). `chat pay-request` names its chat by the chat's id, its contact's key or a label given here, never only by the contact's own name or a prefix of its id |
133
133
  | `chat transport <chat> <auto\|dht\|webrtc\|iroh\|hyperdht>` | What carries the chat |
134
134
  | `chat verify <chat> --code <code>` | Mark the contact verified after comparing the codes out of band |
135
- | `chat wait <chat> [--until live\|text\|paired] [--timeout s]` | Wait for a chat to go live, carry text, or see its contact. Live means a session that exists now, in this run of the daemon: a chat that was live before a restart counts once its contact answers again |
135
+ | `chat wait <chat> [--until live\|text\|paired] [--timeout s]` | Wait for a chat to go live, carry text, or see its contact. Live means a session that exists now, in this run of the daemon: a chat that was live before a restart counts once its contact answers again. Paired answers at once for a chat that paired before, whether its contact is online or not |
136
136
  | `daemon [--detach] [--timeout s]`, `daemon status [--timeout s]`, `daemon stop [--timeout s]`, `daemon restart [--timeout s]` | Keep the profile online; `status` names its version and its socket (`socket`, for the [socket API](#the-socket-api)), or says `"starting": true` with the `pid` of a daemon whose socket does not listen yet (`stop` and `restart` wait up to `--timeout` for that socket, then stop it); `restart` stops it and starts this release's code in the background ([After an upgrade](#after-an-upgrade)). Ctrl-C, SIGTERM and the terminal closing (SIGHUP) stop it cleanly. A command that holds the profile for a moment (a bot's `send` while a service manager restarts it) is waited for, up to `--timeout` (60 s): still held then, `busy` with its pid |
137
137
  | `edit <chat> <message> [text… \| --text <text> \| --stdin] [--force] [--wait none\|confirmed] [--timeout s]` | Replace the text of a message you sent (1:1 chats, `group edit` for a group; `<message>` is the `messageId` `send` gave, or its wire id). The contact sees it in place, marked edited; `--wait confirmed` waits for its app to confirm (the default without a daemon). At most 100 edits a message, no time limit; an older contact app gets it once it shows edits |
138
138
  | `engine <method> [json \| -] [--confirm-real] [--show-secret] [--yes] [--force]`, `engine --list [--verbose]` | Any call of the app's engine; `--verbose` lists what each takes (`{ linkId, label }`, `?` for an optional key). A call given less than it takes is refused as `bad_request`. One that deletes chats or groups (`clearProfileData`, `removeLink`, `leaveGroup`, `forgetGroup`, `deviceRemove`) needs `--yes`; `clearProfileData` answers what it removed and stops a daemon. `removeLink`, and `setChatTransport` or `setDeliveryMode` to `dht`, are refused (`busy`) while a call is on in the chat, as `chat remove` and `chat transport dht` are; `clearProfileData` while a call is on in any chat. One that sends a text that looks like a secret (`sendMessage`, `sendGroupMessage`, `editMessage`, `forwardMessages`, a payment's memo or comment, a file's name, a group's name in `createGroup` or `renameGroup`, the nick in `updateSettings`) needs `--force` |
@@ -321,7 +321,9 @@ chat (`chat list`, `chat show`, `chat rename`, …) and `engine getState` print
321
321
  said, which orders nothing (a clock can be wrong).
322
322
  - A message's `from` is `me`, `peer`, or `system` for a group's own line in `group history` (`event`: created, joined,
323
323
  renamed, …; the stream says it as `group.event`): nobody wrote it, whatever `member` key it carries.
324
- - `seq` grows by one per event in the profile, across restarts; `id` is the same whenever the same fact is reported.
324
+ - `seq` grows by one per event in the profile, across restarts, and is never given to two events; after a crash, or a
325
+ full disk that kept events out of the journal, it can skip numbers, and a replay across them starts with
326
+ `events.gap`. `id` is the same whenever the same fact is reported.
325
327
  Dedupe by `id`; resume with `--since <seq>`, or let `--cursor <file>` remember the last event handled. A cursor
326
328
  file that holds no event number (empty, edited by hand) is refused at start (`bad_request`, naming the file): fix or
327
329
  remove it, or give `--since`.
@@ -1,3 +1,3 @@
1
- import { l as findGroup, s as findChat, x as startNamedChats } from "./apiKit-CJVp_crp.js";
2
- import { a as hideStateSecrets, i as groupSendRefused, n as SETTABLE, o as mentionsFor, r as callApi, s as redactSettings, t as API_METHODS } from "./api-EUGHGnRz.js";
1
+ import { l as findGroup, s as findChat, x as startNamedChats } from "./apiKit-D6Oj-vFx.js";
2
+ import { a as hideStateSecrets, i as groupSendRefused, n as SETTABLE, o as mentionsFor, r as callApi, s as redactSettings, t as API_METHODS } from "./api-DkcMOWLX.js";
3
3
  export { API_METHODS, SETTABLE, callApi, findChat, findGroup, groupSendRefused, hideStateSecrets, mentionsFor, redactSettings, startNamedChats };
@@ -1,17 +1,18 @@
1
- import { Aa as downsamplePeaks, Al as readImageMeta, Bn as NO_PICTURE_METADATA, Da as VOICE_LIMITS, Do as claimedTime, Ea as PLAYABLE_AUDIO, Ii as identityStatement, Jr as TYPING_REFRESH_MS, Kl as ownInviteRefusal, Ko as AWAITING_PEER_MS, Ku as MAX_AVATAR_LENGTH, Ma as parseVoiceMeta, Na as voiceDownloadName, Oa as VOICE_METER, Ou as normalizeRelayUrl, Pa as voiceLevel, Sl as isAppRef, So as checkStatusCard, Ta as sanitizeMime, Un as stripPictureMetadata, Wl as inviteLink, Wn as withoutPictureMetadata, Xr as sanitizeTypingStatus, Z as groupName, _l as appRef, _o as appCardId, bo as cardLine, ed as randomBytes$1, es as GhostlyHttpError, gi as APP_DATA_MAX_BYTES, ho as STATUS_CARD_LIMITS, il as APP_PERMISSIONS, is as LIMITS, ka as baseMime, ku as relayUrlProblem, ll as isAppUrl, nr as GROUP_FILE_LIMITS, ns as parseLocalTarget, oo as replySnippet, qr as TYPING_KINDS, qu as sanitizeAvatar, td as toBase64Url, vo as appCardUrl, wa as sanitizeFileName, wo as statusCardBytes, zn as withoutVideoMetadata } from "./src-D31D1_oY.js";
1
+ import { Aa as VOICE_LIMITS, Ao as claimedTime, Bn as NO_PICTURE_METADATA, Co as cardLine, Da as sanitizeFileName, Do as statusCardBytes, Fa as parseVoiceMeta, Ia as voiceDownloadName, Jr as TYPING_REFRESH_MS, La as voiceLevel, Ma as baseMime, Mu as relayUrlProblem, Na as downsamplePeaks, Nl as readImageMeta, Oa as sanitizeMime, Ri as identityStatement, Tl as isAppRef, To as checkStatusCard, Un as stripPictureMetadata, Wn as withoutPictureMetadata, Xr as sanitizeTypingStatus, Xu as MAX_AVATAR_LENGTH, Yl as ownInviteRefusal, Yo as AWAITING_PEER_MS, Z as groupName, Zu as sanitizeAvatar, ad as toBase64Url, as as parseLocalTarget, bl as appRef, bo as appCardId, fl as isAppUrl, gi as APP_DATA_MAX_BYTES, id as randomBytes$1, ja as VOICE_METER, ju as normalizeRelayUrl, ka as PLAYABLE_AUDIO, lo as replySnippet, nr as GROUP_FILE_LIMITS, ql as inviteLink, qr as TYPING_KINDS, rs as GhostlyHttpError, sl as APP_PERMISSIONS, ss as LIMITS, vo as STATUS_CARD_LIMITS, xo as appCardUrl, zn as withoutVideoMetadata } from "./src-BZkY6N3J.js";
2
2
  import { u as fileStore } from "./idb-BHsAqENE.js";
3
- import { O as waitingGroupFile, T as removeStored, X as iceServerSetting, Y as iceServerProblem, i as groupOfFile, k as IDENTITY_DRAFT_TTL_MS, l as replyRef, n as groupFileId, v as paymentNetwork } from "./groupFiles-DYopNE57.js";
4
- import { f as FILE_BYTES_STEP, o as fileBytes, s as fileBytesOf } from "./fileBytes-DjBYYyXT.js";
5
- import { t as IDENTITY_PROVIDERS } from "./registry-BUm4cAzV.js";
3
+ import { O as waitingGroupFile, T as removeStored, X as iceServerSetting, Y as iceServerProblem, i as groupOfFile, k as IDENTITY_DRAFT_TTL_MS, l as replyRef, n as groupFileId, v as paymentNetwork } from "./groupFiles-BFv9K_za.js";
4
+ import { f as FILE_BYTES_STEP, o as fileBytes, s as fileBytesOf } from "./fileBytes-BABGEF13.js";
5
+ import { t as IDENTITY_PROVIDERS } from "./registry-BKkSnpjL.js";
6
6
  import { n as secretWords, r as findSecret, t as guardText } from "./secretGuard-B7Hj0Kvz.js";
7
7
  import { i as localFileError, r as asCliError, t as CliError } from "./errors-Dt-ZnyOX.js";
8
- import { a as WALLET_TYPES, c as DESTRUCTIVE_CALLS, d as ENGINE_READS, f as READ_PARAMS, i as TRANSPORT_NAMES, l as ENGINE_METHODS, m as engineParamsProblem, n as CHAT_METHODS, r as PAY_METHODS, s as withStoredIds, t as ADDRESS_TYPES, u as ENGINE_PARAMS } from "./words-Db9WgatT.js";
9
- import { C as str, S as state, T as waitForState, _ as node, a as cleanName, b as sentAt, c as findChatOrGroup, d as groupOf, f as groupPrefixed, h as messageOf, i as chatOrGroup, l as findGroup, m as list, n as bool, o as dhtOnly, p as inviteTaken, r as chatOf, s as findChat, u as findOwnNamedChat, v as num, w as transportOffered, y as oneOf } from "./apiKit-CJVp_crp.js";
8
+ import { a as WALLET_TYPES, c as DESTRUCTIVE_CALLS, d as ENGINE_READS, f as READ_PARAMS, i as TRANSPORT_NAMES, l as ENGINE_METHODS, m as engineParamsProblem, n as CHAT_METHODS, r as PAY_METHODS, s as withStoredIds, t as ADDRESS_TYPES, u as ENGINE_PARAMS } from "./words-PUnyO4ph.js";
9
+ import { C as str, S as state, T as waitForState, _ as node, a as cleanName, b as sentAt, c as findChatOrGroup, d as groupOf, f as groupPrefixed, h as messageOf, i as chatOrGroup, l as findGroup, m as list, n as bool, o as dhtOnly, p as inviteTaken, r as chatOf, s as findChat, u as findOwnNamedChat, v as num, w as transportOffered, y as oneOf } from "./apiKit-D6Oj-vFx.js";
10
10
  import { t as childEnv } from "./childEnv-BVOQK9EA.js";
11
- import { a as checkShownName } from "./profiles-DKmZGXp6.js";
12
- import { a as waitForConfirmed, c as waitForMessage, i as pressable, l as waitForRemoval, n as buttonsCard, o as waitForEdit, s as waitForGroupFrame, t as BUTTON_METHODS } from "./buttons-B-ZJYdo0.js";
13
- import { t as BACKUP_METHODS } from "./backup-BxSH5BZG.js";
14
- import { o as checkedBundle } from "./apps-C54T_MOT.js";
11
+ import { a as checkShownName } from "./profiles-QDB7V_Qt.js";
12
+ import { t as chatState } from "./waitNotice-Ce3YCinu.js";
13
+ import { a as waitForConfirmed, c as waitForMessage, i as pressable, l as waitForRemoval, n as buttonsCard, o as waitForEdit, s as waitForGroupFrame, t as BUTTON_METHODS } from "./buttons-ByKT_vP8.js";
14
+ import { t as BACKUP_METHODS } from "./backup-dzJLzg-k.js";
15
+ import { o as checkedBundle } from "./apps-B22SeD6T.js";
15
16
  import { generateMnemonic } from "@scure/bip39";
16
17
  import { wordlist } from "@scure/bip39/wordlists/english.js";
17
18
  import { execFile, spawn } from "node:child_process";
@@ -1261,6 +1262,14 @@ var FILE_METHODS = {
1261
1262
  target = `${stem} (${n})${ext}`;
1262
1263
  }
1263
1264
  const partial = join(dirname(target), `.ghostly-save-${process.pid}-${toBase64Url(randomBytes$1(6))}.partial`);
1265
+ const asked = (error, where) => {
1266
+ const failed = error;
1267
+ if (failed instanceof Error && failed.path === partial) {
1268
+ failed.path = where;
1269
+ failed.message = failed.message.replaceAll(partial, where);
1270
+ }
1271
+ return error;
1272
+ };
1264
1273
  let out;
1265
1274
  try {
1266
1275
  out = await open(partial, "wx", 384);
@@ -1271,7 +1280,7 @@ var FILE_METHODS = {
1271
1280
  if (!there) throw new CliError("not_found", `No such file or folder: ${folder}`);
1272
1281
  if (!there.isDirectory()) throw new CliError("not_found", `${folder} is a file, not a folder`);
1273
1282
  }
1274
- throw error;
1283
+ throw asked(error, dirname(target));
1275
1284
  }
1276
1285
  let written = 0, complete = false;
1277
1286
  try {
@@ -1303,7 +1312,9 @@ var FILE_METHODS = {
1303
1312
  }
1304
1313
  throw refused ?? error;
1305
1314
  }
1306
- if (stored.direction !== "out") await markDownloaded(target);
1315
+ await markDownloaded(target);
1316
+ } catch (error) {
1317
+ throw asked(error, target);
1307
1318
  } finally {
1308
1319
  await out?.close();
1309
1320
  await rm(partial, { force: true });
@@ -3911,7 +3922,8 @@ var CHAT_NAME_LENGTH = 48;
3911
3922
  * A chat's name on this side (`chat rename`, an invite's `--label`), as the engine stores it (`cleanName`): a tab or a
3912
3923
  * line break is a space, invisible characters go, and what is left is counted. Longer than the engine keeps whole is
3913
3924
  * refused, not cut. An empty name (or spaces) is the documented one of `chat rename` (the contact's own name) and no
3914
- * label for an invite; a name with nothing that shows is refused: given as is, the engine cleared the chat's name.
3925
+ * label for an invite; a name with nothing that shows is refused: given as is, the engine cleared the chat's name. A
3926
+ * name starting with `group:` is refused: `group:<ref>` names a group in every command (`groupPrefixed`).
3915
3927
  */
3916
3928
  function chatName(params, name) {
3917
3929
  const value = str(params, name);
@@ -3919,6 +3931,7 @@ function chatName(params, name) {
3919
3931
  const clean = cleanName(value, CHAT_NAME_LENGTH);
3920
3932
  if (clean === void 0) throw new CliError("bad_request", `A chat's name is up to ${CHAT_NAME_LENGTH} characters on one line`);
3921
3933
  if (!clean) throw new CliError("bad_request", `A chat's name needs a character that shows (an empty name gives back the contact's own)`);
3934
+ if (groupPrefixed(clean) !== null) throw new CliError("bad_request", `A chat's name can't start with "group:": that names a group`);
3922
3935
  return clean;
3923
3936
  }
3924
3937
  /** Code points before `index` (UTF-16) in `text`: mentions count code points (WISP 902 § Mentions). */
@@ -4004,6 +4017,17 @@ function showUntilPaired(ctx, linkId) {
4004
4017
  });
4005
4018
  inviteShown.set(ctx, stop);
4006
4019
  }
4020
+ /**
4021
+ * `invite create`'s `reason` when no relay took the invite. The engine's words ("Publish failed on every relay: Error:
4022
+ * http://… did not answer a moment ago; retry shortly; Error: …") read as the CLI failing, a class name per relay, beside
4023
+ * a `note` that says the invite is good: the relays are named, and nothing is asked of whoever reads it.
4024
+ */
4025
+ function inviteNotOut(detail) {
4026
+ if (!detail.startsWith("Publish failed on every relay:")) return detail;
4027
+ const hosts = [...new Set([...detail.matchAll(/\bhttps?:\/\/[^\s;,]+/g)].map(([url]) => URL.canParse(url) ? new URL(url).host : url))];
4028
+ const named = hosts.length ? ` (${hosts.join(", ")})` : "";
4029
+ return `${/ responded \d{3}\b/.test(detail) ? "No relay took the invite" : "No relay answered"}${named}: it goes out once one does`;
4030
+ }
4007
4031
  /** V8's words for reading what a value does not have: an `engine.call` given a parameter of the wrong kind. */
4008
4032
  var BAD_VALUE = /^Cannot (destructure|read properties of (undefined|null))|is not (a function|iterable)/;
4009
4033
  var METHODS = {
@@ -4126,7 +4150,7 @@ var METHODS = {
4126
4150
  return {
4127
4151
  ...answer,
4128
4152
  ...waitUntil !== void 0 && { retryInMs: Math.max(0, waitUntil - Date.now()) },
4129
- ...progress?.detail && { reason: progress.detail },
4153
+ ...progress?.detail && { reason: inviteNotOut(progress.detail) },
4130
4154
  note: "The invite is good: it goes out by itself once a relay answers, while a daemon runs for this profile"
4131
4155
  };
4132
4156
  },
@@ -4608,8 +4632,8 @@ var METHODS = {
4608
4632
  return chatJson(await waitForState(ctx, (s) => {
4609
4633
  const now = s.links.find((l) => l.id === link.id);
4610
4634
  if (!now) throw new CliError("not_found", `Chat ${link.id} was removed`);
4611
- return (until === "live" ? isLive(now) : until === "text" ? now.textDelivery === "stream" || now.textDelivery === "dht" || now.textDelivery === "hold" : !!now.pairingProgress?.peerSeen || now.pairing?.status === "ready" || isLive(now)) ? now : void 0;
4612
- }, ms, `chat ${link.id} to be ${until}`));
4635
+ return (until === "live" ? isLive(now) : until === "text" ? now.textDelivery === "stream" || now.textDelivery === "dht" || now.textDelivery === "hold" : !!now.peerParticipationKey || !!now.pairingProgress?.peerSeen || now.pairing?.status === "ready" || isLive(now)) ? now : void 0;
4636
+ }, ms, `chat ${link.id} ${chatState(until).to}`));
4613
4637
  },
4614
4638
  async "group.create"(ctx, params) {
4615
4639
  const clean = cleanName(str(params, "name", true), 64);
@@ -5058,8 +5082,9 @@ async function saveMark(ctx, params, remove) {
5058
5082
  messageId,
5059
5083
  remove
5060
5084
  });
5061
- if (result.error && remove && /not in this chat/.test(result.error)) throw new CliError("not_found", `No saved message ${JSON.stringify(messageId)} in this chat (ghostly saved list shows the saved ones)`);
5062
- if (result.error) throw new CliError(/not in this chat/.test(result.error) ? "not_found" : "bad_request", result.error);
5085
+ const where = target.group ? "group" : "chat";
5086
+ if (result.error && /not in this chat/.test(result.error)) throw new CliError("not_found", remove ? `No saved message ${JSON.stringify(messageId)} in this ${where} (ghostly saved list shows the saved ones)` : `No message ${JSON.stringify(messageId)} in this ${where}`);
5087
+ if (result.error) throw new CliError("bad_request", result.error);
5063
5088
  return {
5064
5089
  [target.group ? "group" : "chat"]: target.id,
5065
5090
  messageId,
@@ -5151,4 +5176,4 @@ async function callApi(ctx, method, params = {}) {
5151
5176
  //#endregion
5152
5177
  export { flushCardUpdates as _, hideStateSecrets as a, paymentJson as c, nodeLocalFetch as d, chatJson as f, resumeHolds as g, groupMessageJson as h, groupSendRefused as i, reportAppFrames as l, groupJson as m, SETTABLE as n, mentionsFor as o, chatMessageJson as p, callApi as r, redactSettings as s, API_METHODS as t, servedApps as u };
5153
5178
 
5154
- //# sourceMappingURL=api-EUGHGnRz.js.map
5179
+ //# sourceMappingURL=api-DkcMOWLX.js.map