@ghostlytools/cli 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +7 -6
  2. package/dist/assets/{api-CVtg7MpI.js → api-DF36rBJK.js} +2 -2
  3. package/dist/assets/{api-CjOaoG-v.js → api-Dnq86JAA.js} +135 -37
  4. package/dist/assets/api-Dnq86JAA.js.map +1 -0
  5. package/dist/assets/{apiKit-BAGvlQtm.js → apiKit-nLK4jeTq.js} +3 -3
  6. package/dist/assets/{apiKit-BAGvlQtm.js.map → apiKit-nLK4jeTq.js.map} +1 -1
  7. package/dist/assets/{appFetch-BwJd-kNq.js → appFetch-wqBWi3Ry.js} +2 -2
  8. package/dist/assets/{appFetch-BwJd-kNq.js.map → appFetch-wqBWi3Ry.js.map} +1 -1
  9. package/dist/assets/{apps-Cuk45sz5.js → apps-DBVhKpfe.js} +10 -10
  10. package/dist/assets/apps-DBVhKpfe.js.map +1 -0
  11. package/dist/assets/{apps-DjY095Af.js → apps-nLtyhC2f.js} +1 -1
  12. package/dist/assets/{backup-DekVCDWv.js → backup-Bczllmzf.js} +4 -4
  13. package/dist/assets/{backup-DekVCDWv.js.map → backup-Bczllmzf.js.map} +1 -1
  14. package/dist/assets/{backup-B56sQqoQ.js → backup-D6s0LQdg.js} +1 -1
  15. package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +1 -1
  16. package/dist/assets/{bitcoind-B2bbVSzh.js → bitcoind-DML_-Xbv.js} +2 -2
  17. package/dist/assets/{bitcoind-B2bbVSzh.js.map → bitcoind-DML_-Xbv.js.map} +1 -1
  18. package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +1 -1
  19. package/dist/assets/{buttons-BGxzOtrq.js → buttons-B3C3vdhH.js} +8 -8
  20. package/dist/assets/buttons-B3C3vdhH.js.map +1 -0
  21. package/dist/assets/buttons-DaY5FYlV.js +1 -0
  22. package/dist/assets/{client-DcQAfc3h.js → client-B7jRrSnb.js} +3 -3
  23. package/dist/assets/{client-DcQAfc3h.js.map → client-B7jRrSnb.js.map} +1 -1
  24. package/dist/assets/{domainProofs-BDNP1dIy.js → domainProofs-b3Y1Gj9g.js} +6 -2
  25. package/dist/assets/{domainProofs-BDNP1dIy.js.map → domainProofs-b3Y1Gj9g.js.map} +1 -1
  26. package/dist/assets/{errors-DDLFO4Gf.js → errors-JVJsO8Iu.js} +18 -2
  27. package/dist/assets/errors-JVJsO8Iu.js.map +1 -0
  28. package/dist/assets/{fixedHosts-C3hBliM9.js → fixedHosts-H3i6o9Iy.js} +2 -2
  29. package/dist/assets/{fixedHosts-C3hBliM9.js.map → fixedHosts-H3i6o9Iy.js.map} +1 -1
  30. package/dist/assets/{ghostly_iroh_web-DIj5xGmR.js → ghostly_iroh_web-9VOwZcJQ.js} +30 -35
  31. package/dist/assets/ghostly_iroh_web-9VOwZcJQ.js.map +1 -0
  32. package/dist/assets/ghostly_iroh_web_bg.wasm +0 -0
  33. package/dist/assets/{groupMeta-goASqzOt.js → groupMeta--fxSh792.js} +72 -4
  34. package/dist/assets/groupMeta--fxSh792.js.map +1 -0
  35. package/dist/assets/{host-C2WRKj3g.js → host-CGzVFfMz.js} +169 -36
  36. package/dist/assets/host-CGzVFfMz.js.map +1 -0
  37. package/dist/assets/{hyperdhtRelay-bjNGacf5.js → hyperdhtRelay-B4_wdCtx.js} +2 -2
  38. package/dist/assets/{hyperdhtRelay-bjNGacf5.js.map → hyperdhtRelay-B4_wdCtx.js.map} +1 -1
  39. package/dist/assets/{hyperdhtRelay-DLUiwfnt.js → hyperdhtRelay-Ce-gWsRY.js} +2 -2
  40. package/dist/assets/{hyperdhtRelay-DLUiwfnt.js.map → hyperdhtRelay-Ce-gWsRY.js.map} +1 -1
  41. package/dist/assets/{irohWeb-NfthOL98.js → irohWeb-Dp1i8v6n.js} +12 -11
  42. package/dist/assets/irohWeb-Dp1i8v6n.js.map +1 -0
  43. package/dist/assets/{main-Dh7fePd8.js → main-C8J53SwH.js} +67 -62
  44. package/dist/assets/main-C8J53SwH.js.map +1 -0
  45. package/dist/assets/{ownDid-BErplN7N.js → ownDid-oa-T2vmZ.js} +8 -4
  46. package/dist/assets/ownDid-oa-T2vmZ.js.map +1 -0
  47. package/dist/assets/{ownStatus-ClrFjd7h.js → ownStatus-Bc08eNJY.js} +6 -6
  48. package/dist/assets/{ownStatus-ClrFjd7h.js.map → ownStatus-Bc08eNJY.js.map} +1 -1
  49. package/dist/assets/{pairedTransports-BKmvlKz1.js → pairedTransports-Dppn8lUN.js} +3 -3
  50. package/dist/assets/pairedTransports-Dppn8lUN.js.map +1 -0
  51. package/dist/assets/{profiles-B8xO8-oj.js → profiles-B2uy04ph.js} +3 -3
  52. package/dist/assets/{profiles-B8xO8-oj.js.map → profiles-B2uy04ph.js.map} +1 -1
  53. package/dist/assets/{registry-CU8PevhI.js → registry-DbTLLs3y.js} +9 -5
  54. package/dist/assets/registry-DbTLLs3y.js.map +1 -0
  55. package/dist/assets/{registry--Rg2YvOH.js → registry-bLIfG619.js} +1 -1
  56. package/dist/assets/{resolve-B1upovPM.js → resolve-DNX-eecG.js} +9 -4
  57. package/dist/assets/resolve-DNX-eecG.js.map +1 -0
  58. package/dist/assets/secretGuard-Bh11MPdI.js +1 -0
  59. package/dist/assets/{secretGuard-BrATm_gl.js → secretGuard-oz_3hBfW.js} +19 -2
  60. package/dist/assets/{secretGuard-BrATm_gl.js.map → secretGuard-oz_3hBfW.js.map} +1 -1
  61. package/dist/assets/{server-Dgxx_DaN.js → server-DWJ4RzJn.js} +536 -209
  62. package/dist/assets/server-DWJ4RzJn.js.map +1 -0
  63. package/dist/assets/{translate-BcbSWkuq.js → translate-CHj_PdLg.js} +13 -8
  64. package/dist/assets/translate-CHj_PdLg.js.map +1 -0
  65. package/dist/assets/{waitNotice-ylU3XwjO.js → waitNotice-Cvz5CiKR.js} +57 -3
  66. package/dist/assets/waitNotice-Cvz5CiKR.js.map +1 -0
  67. package/dist/ghostly.mjs +1 -1
  68. package/npm-shrinkwrap.json +2 -2
  69. package/package.json +1 -1
  70. package/dist/assets/api-CjOaoG-v.js.map +0 -1
  71. package/dist/assets/apps-Cuk45sz5.js.map +0 -1
  72. package/dist/assets/buttons-BGxzOtrq.js.map +0 -1
  73. package/dist/assets/buttons-CsN2WJOf.js +0 -1
  74. package/dist/assets/errors-DDLFO4Gf.js.map +0 -1
  75. package/dist/assets/ghostly_iroh_web-DIj5xGmR.js.map +0 -1
  76. package/dist/assets/groupMeta-goASqzOt.js.map +0 -1
  77. package/dist/assets/host-C2WRKj3g.js.map +0 -1
  78. package/dist/assets/irohWeb-NfthOL98.js.map +0 -1
  79. package/dist/assets/main-Dh7fePd8.js.map +0 -1
  80. package/dist/assets/ownDid-BErplN7N.js.map +0 -1
  81. package/dist/assets/pairedTransports-BKmvlKz1.js.map +0 -1
  82. package/dist/assets/registry-CU8PevhI.js.map +0 -1
  83. package/dist/assets/resolve-B1upovPM.js.map +0 -1
  84. package/dist/assets/secretGuard-Bm6nci0I.js +0 -1
  85. package/dist/assets/server-Dgxx_DaN.js.map +0 -1
  86. package/dist/assets/translate-BcbSWkuq.js.map +0 -1
  87. package/dist/assets/waitNotice-ylU3XwjO.js.map +0 -1
package/README.md CHANGED
@@ -137,15 +137,15 @@ The rows are in alphabetical order of their first command, and every command of
137
137
  | `chat verify <chat> --code <code>` | Mark the contact verified after comparing the codes out of band |
138
138
  | `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 |
139
139
  | `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)), keeping the profile for the new daemon in between: other commands wait for its socket rather than open the profile. 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 |
140
- | `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 |
140
+ | `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. In a chat on the DHT only, an edit past about 214 bytes once sealed is `refused` (an edit never waits for a live transport as a long text does) |
141
141
  | `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`, `switchGroup`, `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; `removeLink` while a delete for everyone has not reached the contact, as `chat remove` is, and `clearProfileData` while one has not in any chat, until `--force`; `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` |
142
142
  | `events [--since seq] [--translate lang]` | What the event journal holds, without following ([Translation](#translation)) |
143
- | `file list <chat\|group>`, `file accept\|decline\|pause\|resume\|cancel [<chat>] <file>` | Transfers; a file over 25 MiB waits for `file accept` (files/3), and so does a group's file that did not come by itself (over 8 MiB): its row's `transfer` says `stage: "asking"`, `waitingFor: "me"` (a file sent from here that the contact has not taken yet: `waitingFor: "contact"`; one sent while the contact is away: `stage: "waiting"`, `waitingFor: "contact"`). A file's id names its chat or its group, so `<chat>` may be left out. One the contact paused (`pausedBy: "peer"`) goes on only when they resume it: `file resume`, `file request` and `file resend` of it are `refused`, as are `file pause`, `file resume` and `file request` of one offered here that waits for `file accept` |
143
+ | `file list <chat\|group>`, `file accept\|decline\|pause\|resume\|cancel [<chat>] <file>` | Transfers; a file over 25 MiB waits for `file accept` (files/3), and so does a group's file that did not come by itself (over 8 MiB): its row's `transfer` says `stage: "asking"`, `waitingFor: "me"` (a file sent from here that the contact has not taken yet: `waitingFor: "contact"`; one sent while the contact is away: `stage: "waiting"`, `waitingFor: "contact"`). A file's id names its chat or its group, so `<chat>` may be left out. One the contact paused (`pausedBy: "peer"`) goes on only when they resume it: `file resume`, `file request` and `file resend` of it are `refused`, as are `file pause`, `file resume` and `file request` of one offered here that waits for `file accept`. `file accept` reads this device's room first: a file larger than the room left (beside the files still on their way) is not started and is `refused` with `details.reason: "no_room"` and `details.room` (bytes), and it keeps waiting, so free some space and accept it again |
144
144
  | `file resend [<chat>] <file>`, `file request [<chat>] <file>` | A file that stopped moving: sent again from here, or asked for again from the contact (a group's file: from whoever holds it); either goes on from the bytes the receiver holds (files/3) |
145
145
  | `file save [<chat>] <file> [--dir d \| --path p] [--force] [--wait [--timeout s]]` | Write a received file to disk: to `--path`, or into `--dir` under the name its sender gave it, with a `_` first when that name starts with `-`, so no tool run in the folder takes it for an option; a voice message goes in under the name Ghostly makes for it (`Ghostly voice <date time>`), and when that name is taken (two of one second) under a free `… (2)` (the answer's `path` is what was written). Never over a file without `--force`: a name taken in `--dir` is answered with the next free `--path … (2)` that keeps both; an unfinished one says how many bytes are here (exit `1`), one that waits for you to take it answers `5` naming `file accept`, with or without `--wait`; `--wait` waits for a received one first (a sent one is all here) |
146
146
  | `file send <chat\|group> <path> [--name n] [--mime t] [--voice [ms] [--peaks …]] [--reply <message>] [--force] [--wait none\|sent] [--timeout s]` | A file, or a voice note (its length and waveform measured from the file unless given); `--reply` quotes a message, as `send --reply` does. Answers the message's `messageId` (what `message delete`, `react` and `pin` take) and the file's id. Without a daemon, a file to a chat stays until the contact has all of it (`--wait sent`, the default there; `--timeout`, 300 s, then exit 4 with the `messageId` and the file's id in `details`, and it goes on with your next command; a file over 25 MiB waits for the contact's `file accept` meanwhile); `--wait none` answers at once, as a daemon does by default. To a group (`group:<id>` when a chat has the same name), up to 100 MiB: every member sees it at once and each member's app fetches it from a member who has it (WISP 503) |
147
147
  | `file wait [<chat>] <file> [--timeout s]` | Wait until a transfer ends: exit `0` when the file is all here, `1` with the transfer's error when it failed (`details.retry`: `file resend` can go on), `4` on timeout (default 300 s), `5` at once when a received file waits for you to take it (over 25 MiB, or a group's file that did not come by itself): the message names `file accept` |
148
- | `forward <chat\|group> <message>… --to <chat\|group>… [--force] [--wait none\|sent] [--timeout s]` | Forward messages to up to 5 chats and groups (`--to` again for each; `group:<id>` names a group when a chat has the same name; an id that starts with a dash is taken as it is, `--to -Ab…` or `--to=-Ab…`). Each is a new message of yours that says it was forwarded (`forwarded`, the hop count) and nothing of who wrote it. Files go from the bytes this profile holds, never fetched again; a group takes texts only. A text that looks like a seed, a key or ecash needs `--force`. Answers `{from, results: [{to, kind, messageIds, error}]}`, a group's with `edges` (how many edges took its copies so far, as for `group send`); any refusal fails the command (exit 1) with the results in `details`. `--wait sent`: each text on its way (a group's taken by an edge), each file's transfer done; without a daemon a group's copies wait for an edge by default (`--wait none` answers at once). A wait that ends short (a timeout, exit 4) has the results in `details` too, next to the copy's `messageId`; a refusal comes first |
148
+ | `forward <chat\|group> <message>… --to <chat\|group>… [--force] [--wait none\|sent] [--timeout s]` | Forward messages to up to 5 chats and groups (`--to` again for each; `group:<id>` names a group when a chat has the same name; an id that starts with a dash is taken as it is, `--to -Ab…` or `--to=-Ab…`). Each is a new message of yours that says it was forwarded (`forwarded`, the hop count) and nothing of who wrote it. Files go from the bytes this profile holds, never fetched again; a group takes texts only. A text that looks like a seed, a key or ecash needs `--force`. Answers `{from, results: [{to, kind, messageIds, error}]}`, a group's with `edges` (how many edges took its copies so far, as for `group send`); any refusal fails the command (exit 1) with the results in `details`. `--wait sent`: each text on its way (a group's taken by an edge), each file's transfer done; without a daemon a group's copies wait for an edge by default (`--wait none` answers at once). A wait that ends short (a timeout, exit 4) has the results in `details` too, next to the copy's `messageId`; a refusal comes first. A text past the 256 bytes the DHT carries, forwarded into a chat on the DHT only, waits for a live transport as `send`'s does: that chat's result says so in a `note`, and a `--wait sent` timeout says the same, also as `details.note` |
149
149
  | `group auto [on\|off] [--from <chat>]…` | Accept group invitations by themselves, only those over the chats named (their id, their contact's key or a label given here; `on` needs at least one, and names them all: a new `on` replaces the list): the daemon accepts them at once, and on start those that came while it was down; any other waits for `group accept`. Kept in the profile's `groups.json` with each chat's contact key: a removed chat, or one whose contact's key changed, leaves the list. When the 32 waiting invitations are full, one over a chat on the list takes the place of the oldest waiting from the chat that holds the most (its inviter is told no). An invitation over a chat on the list kept beside another contact's under the same group id (`others`) is the one taken, the other told no, while the group held is only an invitation not answered yet; beside a group joined or accepted it waits for you (a line in the log). With no argument, prints `{autoJoin: {on, from}}`; `group list` carries it too. Each accept is a line in the daemon's log |
150
150
  | `group call <group> --sfu <https origin> [--e2ee \| --no-e2ee] \| --e2ee \| --no-e2ee \| --clear` | A community's admin names the node its calls go through (WISP 602), signed beside the name and picture, or `--clear` turns its calls off. `--e2ee` asks for sealed call media (§ End-to-end encryption), `--no-e2ee` turns it off, with `--sfu` or alone for the node already named; left out, the group keeps what it had. An https origin only, at most 200 characters, in one spelling (`https://call.example.com`: no path, query, trailing `/`, capitals or default port `:443`); anything else is refused before it is signed, with the origin to use when there is one, or the limit when the origin is longer. A member who is not the admin, one out of the group (removed, or left: with that reason), or a private group, is `refused`. Answers the group as `group show` does, whose `call` is `{sfu, e2ee}` or null |
151
151
  | `group create <name> [--mesh] [--force]`, `group join [<link> \| -]` | A community (a link anyone can open), or a private mesh. `group join` reads the link from stdin when none is given or `-` (on the command line it shows in `ps` and the shell's history, and the CLI warns). `group join` with the link of a community the profile was removed from asks to be let in again, and keeps its history. It answers `{group, joined, stage}`: without a daemon after waiting up to 60 s to be let in, through one at once (the daemon goes on knocking) |
@@ -159,7 +159,7 @@ The rows are in alphabetical order of their first command, and every command of
159
159
  | `group rotate <group>`, `group link <group> [--off] [--reset]`, `group picture <group> <jpeg> \| --clear` | A fresh secret; the link (printed: asking for it is asking for the secret); the picture |
160
160
  | `group send <group> [text…] [--mention <member>]… [--reply <message>] [--button id:Label]… [--style id=primary\|neutral\|danger]… [--once] [--id id] [--wait none\|sent] [--timeout s]` | Send; each mentioned member is written as `@name` in the text. `--button` puts buttons under it, as `send --button`. Answers `{group, messageId, sent, edges}`: the id `--reply`, `group react` and `group edit` take, how many edges took it so far, and `sent`, true once one did. A profile that is not a member any more (removed from the group) gets `refused`, with the reason, and nothing is sent. A group has no receipts: `--wait sent` waits until at least one edge took it (a member's in a private group, one of your hubs' in a community), and exits 4 after `--timeout` (default 30 s) if none did; the message still goes when an edge opens, while the profile is online. Use it for a one-shot send with no daemon. In a private group with nobody else in it (they all left, or nobody accepted yet), nobody gets the message, not even someone who joins later: the answer comes at once with `sent: false` and a `note` saying so. A profile removed while it was away learns it only once it is back: a wait that learns it ends at once as `refused` (exit 1) with the reason and the `messageId`, since nothing goes any more |
161
161
  | `group typing <group> [--kind typing\|recording\|thinking] [--status "<text>"] [--for s] [--stop]` | `typing` in a private group: the members whose edge is open see "Ana is typing…" (or recording, thinking, or your status line), with the same rules, 6 s hold and `--for` (a one-shot without `--for` reaches nobody and says so in a `note`). Answers `{group, typing, kind, status, reached, sendTyping}` (`reached`: members with an open edge). A community does not carry typing yet (exit 1, `unavailable`) |
162
- | `identity add <provider> [subject] [--signer id] [--field name=value]… [--stdin] [--days n] [--timeout s]` | A proof: an in-app signer (NIP-46 and the like) finishes here; a tool or a published record answers with the statement; `--timeout` is how long it waits for an approval (300 s, up to 3600; a NIP-46 signer waits as long), and one that does not come is `timeout` (exit 4). Pubky waits at most 300 s, as long as its relay keeps the request: a longer `--timeout` is refused. With `--stdin`, fields come as `name=value` lines on stdin, out of `ps` and the shell's history; a `--field` the signer marks secret (a NIP-46 `bunker://` link) is warned about |
162
+ | `identity add <provider> [subject] [--signer id] [--field name=value]… [--stdin] [--days n] [--timeout s]` | A proof: an in-app signer (NIP-46 and the like) finishes here; a tool or a published record answers with the statement; `--timeout` is how long it waits for an approval (300 s, up to 3600; a NIP-46 signer waits as long), and one that does not come is `timeout` (exit 4); once the signer approved, a refusal of the proof keeps its own words and code, even when the check ends past it. Pubky waits at most 300 s, as long as its relay keeps the request: a longer `--timeout` is refused. With `--stdin`, fields come as `name=value` lines on stdin, out of `ps` and the shell's history; a `--field` the signer marks secret (a NIP-46 `bunker://` link) is warned about |
163
163
  | `identity complete <draft> [--evidence-file f \| --stdin]`, `identity cancel <draft>` | Finish it with the tool's output, from a file, `--stdin` or piped to it (or nothing, for a published record); needs the daemon that began it. Cancel drops one not finished |
164
164
  | `identity providers`, `identity list` | Kinds of proof and their signers; this profile's proofs |
165
165
  | `identity share\|withdraw <chat> <id>`, `identity contact <chat>`, `identity recheck <chat> <id>`, `identity remove <id>` | Show a proof to a contact; what a contact showed, as checked here. `identity share` and `identity withdraw` name 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 |
@@ -179,7 +179,7 @@ The rows are in alphabetical order of their first command, and every command of
179
179
  | `react <chat> <message> <emoji> [--remove] [--wait none\|confirmed] [--timeout s]` | React to a message with one emoji; a new one replaces yours, `--remove` takes it back. Anything else as `<emoji>` (a word, two emoji) is a usage error (exit 2) before the profile opens. Without a daemon it stays until the contact confirmed it (`--wait confirmed`, the default there; `--timeout`, 30 s): a one-shot that left at once took the reaction along unsaid. `confirmed` says whether the contact has it |
180
180
  | `routine send <chat\|group> --name <name> --schedule "every day 01:00" [--cron "0 1 * * *"] [--state active\|paused] [--next <time>] [--run ok\|failed\|skipped[:summary]] [--link url]… [--id id] [--text <text>] [--json json\|-\|file] [--force]`, `routine update <chat\|group> <routine> [fields…]` | A routine card for something a bot runs on a schedule (WISP 405 · Status Cards): its name, schedule (and cron line, shown only), state, last run and result, next run and up to 10 recent runs. `--run` records a run now as the last one; `--next` takes milliseconds or a date within a year (no zone: local time, a bare `2026-09-30` local midnight; `Z` or `+02:00` as given). Updates merge and are paced as `task update`'s, and wait as `task send` and `task update` do. The app shows it, and runs nothing |
181
181
  | `saved add\|remove <chat\|group> <message>`, `saved list` | Saved messages: mark a message of a chat or a group to find it again, kept for this profile on this device and never sent (the app shows the same list in its Saved view). `saved list` gives them under `saved`, the last saved first, each as it is now (an edit shows its latest text) with its `chat` or `group` and `savedAt`; a deleted message drops out |
182
- | `send <chat> [text…] [--reply <message>] [--button id:Label]… [--style id=primary\|neutral\|danger]… [--once] [--id id] [--stdin] [--force] [--wait none\|sent\|delivered] [--timeout s]` | Send text (arguments, or stdin); `--reply` quotes a message of the chat. `--button yes:Yes` (1 to 6; the id ends at the first colon; no two labels alike ignoring case and spaces, and no label that is another button's id, else exit 2) puts buttons under the text, which is the question and what older apps show, so say how to answer in words. `--once`: one answer a person. A question that goes on the DHT floor or into a hold (the contact's app closed) reaches them as text alone; the engine sends its buttons again once the chat is live, as an edit of the buttons alone (no `message.edited` for it). The answer adds `buttons` (the question's id, `ask-…` unless `--id`), `card`, and `pressable`: whether the contact's app shows buttons (null until it says). A press comes back as `button.pressed` ([Events](#events)) |
182
+ | `send <chat> [text…] [--reply <message>] [--button id:Label]… [--style id=primary\|neutral\|danger]… [--once] [--id id] [--stdin] [--force] [--wait none\|sent\|delivered] [--timeout s]` | Send text (arguments, or stdin); `--reply` quotes a message of the chat. `--button yes:Yes` (1 to 6; the id ends at the first colon; no two labels alike ignoring case and spaces, and no label that is another button's id, else exit 2) puts buttons under the text, which is the question and what older apps show, so say how to answer in words. `--once`: one answer a person. A question that goes on the DHT floor or into a hold (the contact's app closed) reaches them as text alone; the engine sends its buttons again once the chat is live, as an edit of the buttons alone (no `message.edited` for it). The answer adds `buttons` (the question's id, `ask-…` unless `--id`), `card`, and `pressable`: whether the contact's app shows buttons (null until it says). A press comes back as `button.pressed` ([Events](#events)). A text past the 256 bytes the DHT carries, in a chat on the DHT only, waits for a live transport: the answer says so at once in a `note`, and with `--wait sent\|delivered` its timeout (exit 4) says the same, also as `details.note`, as do the wait's notice on a terminal and its Ctrl-C line |
183
183
  | `service add <name> <http://127.0.0.1:port>`, `service share <service> <chat> [--off]`, `service list`, `service remove\|enable` | Share a web app on this machine, per contact. `service share` 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, and is `refused` past the 13 apps one contact can see. On the socket, `service.share` and `service.enable` take `off: true`, or the answer's own `shared` / `enabled` key (refused beside an `off` that says the opposite). `service add` answers the new one as `service` (the id the others take); its old key `serviceId` stays beside it for one release |
184
184
  | `service peer <chat>`, `service open <chat> <service> [--port p]`, `service close <chat> <service>` | A contact's app on a loopback port here (daemon). `url` is a link for your browser, `http://<random>.localhost:<port>/.ghostly-open/<token>`: it sets the service's cookie and shows the app on a host name of its own; any other host name, or a request without that cookie, gets 404. Chrome, Edge and curl reach `*.localhost` names by themselves; Safari and Node's `fetch` on macOS may not (add the name to `/etc/hosts` for them). With Hide my IP from contacts on, `service open` fails with `unavailable`: a browser tab cannot keep the app's page off WebRTC |
185
185
  | `settings get [--show-secret]`, `settings set <key> <json> [--force]` | Relays, Iroh relays, the HyperDHT relay, ICE servers, `sendTyping` (false: contacts are never told you type), `daemonPresence` (true: while a daemon runs the profile, contacts see it online, WISP 401 § Presence and status; off by default, so a bot is never shown online unless you turn it on), … `settings get` shows every key `settings set` takes with its value in effect (one never set as its default: `sendTyping: true`, the default Iroh relays). `<json>` as `-`, or none on a pipe, is read from stdin: a TURN password stays out of `ps` |
@@ -239,7 +239,8 @@ ghostly listen --type message.received --exec '
239
239
  `chat disconnect <chat>` closes the live session, but the contact's app dials again within seconds.
240
240
  `chat disconnect <chat> --hold <minutes>` (up to a week) keeps the chat off its direct link for that long: it is the
241
241
  chat's own "DHT only" choice (WISP 400: either side choosing it keeps both off the live link), taken back when the
242
- time is up. Meanwhile text still goes over the DHT (up to 256 bytes a message; longer ones wait), files, calls and
242
+ time is up. Meanwhile text still goes over the DHT (a text of about 248 bytes at most once sealed, an edit about
243
+ 214; a longer text is refused up to 256 bytes and waits past them, a longer edit is refused), files, calls and
243
244
  typing wait, and the contact's app shows the chat as DHT only. A hold, or `chat transport <chat> dht`, while a call
244
245
  is on in the chat is refused (`busy`): hang the call up first. `chat connect`, or `--hold 0`, ends it early. The
245
246
  hold is kept in the profile folder, and a `profile backup` carries it: a daemon that restarts (or a restored copy
@@ -1,3 +1,3 @@
1
- import { F as startNamedChats, l as findGroup, s as findChat } from "./apiKit-BAGvlQtm.js";
2
- import { a as hideStateSecrets, c as settingsInEffect, i as groupSendRefused, n as SETTABLE, o as mentionsFor, r as callApi, s as redactSettings, t as API_METHODS } from "./api-CjOaoG-v.js";
1
+ import { F as startNamedChats, l as findGroup, s as findChat } from "./apiKit-nLK4jeTq.js";
2
+ import { a as hideStateSecrets, c as settingsInEffect, i as groupSendRefused, n as SETTABLE, o as mentionsFor, r as callApi, s as redactSettings, t as API_METHODS } from "./api-Dnq86JAA.js";
3
3
  export { API_METHODS, SETTABLE, callApi, findChat, findGroup, groupSendRefused, hideStateSecrets, mentionsFor, redactSettings, settingsInEffect, startNamedChats };
@@ -1,24 +1,24 @@
1
- import { Ai as parseLocalTarget, At as sanitizeTypingStatus, Ca as isAppUrl, Cn as sanitizeFileName, D as GROUP_FILE_LIMITS, Di as GhostlyHttpError, Dn as VOICE_METER, Dr as statusCardBytes, Dt as TYPING_REFRESH_MS, En as VOICE_LIMITS, Et as TYPING_KINDS, La as isAppRef, Mi as LIMITS, Mn as voiceDownloadName, Nn as voiceLevel, Oi as VIEWER_PERMISSIONS_POLICY, On as baseMime, Sr as cardLine, Tn as PLAYABLE_AUDIO, Ya as readImageMeta, ao as inviteLink, gr as STATUS_CARD_LIMITS, ja as appRef, jn as parseVoiceMeta, jr as claimedTime, kn as downsamplePeaks, kr as MESSAGE_CLOCK_SKEW_MS, n as groupCallSfu, or as replySnippet, so as ownInviteRefusal, tn as APP_DATA_MAX_BYTES, vr as appCardId, wn as sanitizeMime, wr as checkStatusCard, yi as AWAITING_PEER_MS, yr as appCardUrl } from "./groupMeta-goASqzOt.js";
2
- import { B as removeStored, Qt as withoutPictureMetadata, Tt as decodeGroupEntryLink, U as waitingGroupFile, W as IDENTITY_DRAFT_TTL_MS, Xt as NO_PICTURE_METADATA, Yt as withoutVideoMetadata, Zt as stripPictureMetadata, a as groupMemberOfLink, b as replyRef, c as groupPayTwin, ft as iceServerProblem, h as groupOfFile, k as paymentNetwork, o as groupPayLineId, p as groupFileId, pt as iceServerSetting, qt as withoutAudioMetadata, s as groupPayNoteId, t as DEFAULT_IROH_RELAYS } from "./irohWeb-NfthOL98.js";
1
+ import { Ai as GhostlyHttpError, An as baseMime, Ba as isAppRef, Dn as PLAYABLE_AUDIO, Dt as TYPING_KINDS, Ea as isAppUrl, En as sanitizeMime, Er as checkStatusCard, Fi as LIMITS, Fn as voiceLevel, Mr as MESSAGE_CLOCK_SKEW_MS, Ni as parseLocalTarget, Nn as parseVoiceMeta, O as GROUP_FILE_LIMITS, On as VOICE_LIMITS, Ot as TYPING_REFRESH_MS, Pa as appRef, Pn as voiceDownloadName, Pr as claimedTime, Qa as readImageMeta, Si as AWAITING_PEER_MS, Tn as sanitizeFileName, br as appCardId, co as inviteLink, cr as replySnippet, ji as VIEWER_PERMISSIONS_POLICY, jn as downsamplePeaks, jt as sanitizeTypingStatus, kn as VOICE_METER, kr as statusCardBytes, n as groupCallSfu, nn as APP_DATA_MAX_BYTES, uo as ownInviteRefusal, vr as STATUS_CARD_LIMITS, wr as cardLine, xr as appCardUrl } from "./groupMeta--fxSh792.js";
2
+ import { B as removeStored, Qt as withoutPictureMetadata, Tt as decodeGroupEntryLink, U as waitingGroupFile, W as IDENTITY_DRAFT_TTL_MS, Xt as NO_PICTURE_METADATA, Yt as withoutVideoMetadata, Zt as stripPictureMetadata, a as groupMemberOfLink, b as replyRef, c as groupPayTwin, ft as iceServerProblem, h as groupOfFile, k as paymentNetwork, o as groupPayLineId, p as groupFileId, pt as iceServerSetting, qt as withoutAudioMetadata, s as groupPayNoteId, t as DEFAULT_IROH_RELAYS } from "./irohWeb-Dp1i8v6n.js";
3
3
  import { c as normalizeRelayUrl, l as relayUrlProblem } from "./relay-CHWg5hpZ.js";
4
- import { n as secretWords, r as findSecret, t as guardText } from "./secretGuard-BrATm_gl.js";
5
- import { a as PAY_METHODS, d as ENGINE_METHODS, f as ENGINE_PARAMS, g as engineParamsProblem, i as CHAT_METHODS, l as withStoredIds, m as READ_PARAMS, n as statusJson, o as TRANSPORT_NAMES, p as ENGINE_READS, r as ADDRESS_TYPES, s as WALLET_TYPES, t as checkOwnStatus, u as DESTRUCTIVE_CALLS } from "./ownStatus-ClrFjd7h.js";
6
- import { i as localFileError, r as asCliError, t as CliError } from "./errors-DDLFO4Gf.js";
7
- import { A as sentAt, B as shellWord, C as nobodyJoined, D as oneOf, E as num, I as state, L as str, M as shownName, N as sinceSeq, O as oneShotWaits, P as somebodyJoined, R as transportOffered, S as noMessage, T as node, _ as list, a as contactKeyOf, c as findChatOrGroup, d as groupById, f as groupNameOf, g as keptForJoin, h as inviteTaken, j as settingsOf, k as ownChatOf, l as findGroup, m as groupPrefixed, n as chatOf, o as dhtOnly, p as groupOf, r as chatOrGroup, s as findChat, t as bool, v as messageOf, x as noFile, z as waitForState } from "./apiKit-BAGvlQtm.js";
4
+ import { n as secretWords, r as findSecret, t as guardText } from "./secretGuard-oz_3hBfW.js";
5
+ import { a as PAY_METHODS, d as ENGINE_METHODS, f as ENGINE_PARAMS, g as engineParamsProblem, i as CHAT_METHODS, l as withStoredIds, m as READ_PARAMS, n as statusJson, o as TRANSPORT_NAMES, p as ENGINE_READS, r as ADDRESS_TYPES, s as WALLET_TYPES, t as checkOwnStatus, u as DESTRUCTIVE_CALLS } from "./ownStatus-Bc08eNJY.js";
6
+ import { i as localFileError, o as shownValue, r as asCliError, t as CliError } from "./errors-JVJsO8Iu.js";
7
+ import { A as sentAt, B as shellWord, C as nobodyJoined, D as oneOf, E as num, I as state, L as str, M as shownName, N as sinceSeq, O as oneShotWaits, P as somebodyJoined, R as transportOffered, S as noMessage, T as node, _ as list, a as contactKeyOf, c as findChatOrGroup, d as groupById, f as groupNameOf, g as keptForJoin, h as inviteTaken, j as settingsOf, k as ownChatOf, l as findGroup, m as groupPrefixed, n as chatOf, o as dhtOnly, p as groupOf, r as chatOrGroup, s as findChat, t as bool, v as messageOf, x as noFile, z as waitForState } from "./apiKit-nLK4jeTq.js";
8
8
  import { l as toBase64Url, s as randomBytes$1 } from "./bytes-C1DNGY18.js";
9
9
  import { f as FILE_BYTES_STEP, o as fileBytes, s as fileBytesOf } from "./fileBytes-CfvUXdSy.js";
10
10
  import { p as fileStore } from "./idb-ewvbqyDI.js";
11
11
  import { t as childEnv } from "./childEnv-C-99hdbL.js";
12
- import { a as checkTextSize$1, c as goesOn, d as purgeMessage, f as waitForConfirmed, g as waitForRemoval, h as waitForMessage, i as pressable, l as nobodyElseIn, m as waitForGroupFrame, n as buttonsCard, o as ended, p as waitForEdit, s as foldsAnyway, t as BUTTON_METHODS, u as outOf } from "./buttons-BGxzOtrq.js";
13
- import { a as checkShownName } from "./profiles-B8xO8-oj.js";
12
+ import { a as checkTextSize$1, c as goesOn, d as purgeMessage, f as waitForConfirmed, g as waitForRemoval, h as waitForMessage, i as pressable, l as nobodyElseIn, m as waitForGroupFrame, n as buttonsCard, o as ended, p as waitForEdit, s as foldsAnyway, t as BUTTON_METHODS, u as outOf } from "./buttons-B3C3vdhH.js";
13
+ import { a as checkShownName } from "./profiles-B2uy04ph.js";
14
14
  import { a as MAX_AVATAR_LENGTH, o as sanitizeAvatar } from "./linkPreview-DdMf-YAc.js";
15
15
  import { m as identityStatement } from "./identityProofs-Cksc_K7_.js";
16
- import { a as SignerTimeout, i as parseProofBunker, t as IDENTITY_PROVIDERS } from "./registry-CU8PevhI.js";
17
- import { t as BACKUP_METHODS } from "./backup-DekVCDWv.js";
18
- import { s as isAppFetchUrl } from "./appFetch-BwJd-kNq.js";
19
- import { o as checkedBundle } from "./apps-Cuk45sz5.js";
16
+ import { a as SignerTimeout, i as parseProofBunker, t as IDENTITY_PROVIDERS } from "./registry-DbTLLs3y.js";
17
+ import { t as BACKUP_METHODS } from "./backup-Bczllmzf.js";
18
+ import { s as isAppFetchUrl } from "./appFetch-wqBWi3Ry.js";
19
+ import { o as checkedBundle } from "./apps-DBVhKpfe.js";
20
20
  import { m as parsePaymentAmount } from "./paymentIntent-DySU3Ajm.js";
21
- import { t as chatState } from "./waitNotice-ylU3XwjO.js";
21
+ import { a as heldWords, n as dhtOnlyNote, t as chatState } from "./waitNotice-Cvz5CiKR.js";
22
22
  import { generateMnemonic } from "@scure/bip39";
23
23
  import { wordlist } from "@scure/bip39/wordlists/english.js";
24
24
  import { execFile, spawn } from "node:child_process";
@@ -1320,11 +1320,20 @@ var FILE_METHODS = {
1320
1320
  const view = state(ctx).transfers[fileId];
1321
1321
  if ((action === "resume" || action === "request" || action === "resend") && view?.stage === "paused" && view.pausedBy === "peer") throw new CliError("refused", "Paused by the contact: it goes on when they resume it");
1322
1322
  if ((action === "pause" || action === "resume" || action === "request") && view?.stage === "asking" && view.direction === "in") throw new CliError("refused", "Not taken yet: it waits for you to take it (file accept, or file decline)");
1323
- await node(ctx).fileAction({
1324
- linkId,
1325
- fileId,
1326
- action
1327
- });
1323
+ try {
1324
+ await node(ctx).fileAction({
1325
+ linkId,
1326
+ fileId,
1327
+ action
1328
+ });
1329
+ } catch (error) {
1330
+ const room = error?.room;
1331
+ if (action === "accept" && error instanceof Error && typeof room === "number" && error.message.startsWith("No room on this device")) throw new CliError("refused", error.message, {
1332
+ reason: "no_room",
1333
+ room
1334
+ });
1335
+ throw error;
1336
+ }
1328
1337
  return {
1329
1338
  ...where,
1330
1339
  file: fileId,
@@ -2029,6 +2038,15 @@ function holdOf(ctx, linkId) {
2029
2038
  const until = readHolds(ctx)[linkId]?.until;
2030
2039
  return until !== void 0 && until > Date.now() ? until : null;
2031
2040
  }
2041
+ /**
2042
+ * When the chat's hold ends, or null for none, as what waits in a held chat reads it: also a hold whose time is up and
2043
+ * that has not ended yet (its release is under way, or waits for the chat to open: `expire`), which `holdOf` no longer
2044
+ * reports while the chat is still on DHT only. Read as no hold, a text or edit waiting through it was said to wait
2045
+ * for a transport to be chosen, and it goes by itself.
2046
+ */
2047
+ function holdEnds(ctx, linkId) {
2048
+ return readHolds(ctx)[linkId]?.until ?? null;
2049
+ }
2032
2050
  /** Keeps the chat off its direct link for `minutes` (again: from now). */
2033
2051
  function holdChat(ctx, link, minutes) {
2034
2052
  return inTurn(ctx, link.id, async () => {
@@ -2772,6 +2790,7 @@ var IDENTITY_METHODS = {
2772
2790
  max: most
2773
2791
  });
2774
2792
  const signal = AbortSignal.timeout(seconds * 1e3);
2793
+ let signed = false;
2775
2794
  return {
2776
2795
  done: true,
2777
2796
  proof: proofJson(await signer.run({
@@ -2803,9 +2822,11 @@ var IDENTITY_METHODS = {
2803
2822
  }, async (session) => {
2804
2823
  const { draftId, binding } = await begin(ctx, p, await session.subject(), params);
2805
2824
  try {
2825
+ const evidence = await session.sign(identityStatement(binding));
2826
+ signed = true;
2806
2827
  return await node(ctx).completeIdentityProof({
2807
2828
  draftId,
2808
- evidence: await session.sign(identityStatement(binding))
2829
+ evidence
2809
2830
  });
2810
2831
  } catch (error) {
2811
2832
  try {
@@ -2814,7 +2835,7 @@ var IDENTITY_METHODS = {
2814
2835
  throw error;
2815
2836
  }
2816
2837
  }).catch((error) => {
2817
- if (!(signal.aborted || error instanceof SignerTimeout) || error instanceof CliError) throw error;
2838
+ if (signed || !(signal.aborted || error instanceof SignerTimeout) || error instanceof CliError) throw error;
2818
2839
  throw new CliError("timeout", `Timed out after ${seconds} s waiting for ${signer.label} to approve the ${p.label} proof: --timeout <seconds> waits longer`);
2819
2840
  }))
2820
2841
  };
@@ -3526,7 +3547,7 @@ var APP_SERVE_METHODS = {
3526
3547
  if (grant.includes("internet")) throw new CliError("refused", "internet cannot be granted here: no app's page runs on the CLI, and a bot reaches the network as its own program");
3527
3548
  if (grant.includes("files")) throw new CliError("refused", "files cannot be granted here: no app's page runs on the CLI to ask a person for a file, and a bot reads files as its own program");
3528
3549
  const ungrantable = grant.filter((p) => !GRANTABLE.includes(p));
3529
- if (ungrantable.length) throw new CliError("bad_request", `grant takes ${GRANTABLE.join(" or ")}, not ${ungrantable.map((p) => JSON.stringify(p)).join(", ")}`);
3550
+ if (ungrantable.length) throw new CliError("bad_request", `grant takes ${GRANTABLE.join(" or ")}, not ${ungrantable.map((p) => shownValue(p)).join(", ")}`);
3530
3551
  const given = str(params, "url");
3531
3552
  if (given !== void 0 && !isAppUrl(given)) throw new CliError("bad_request", "url is where a contact's app reads the bundle: https only, no user or password, jsDelivr only at a full commit");
3532
3553
  if (given !== void 0 && /[?#]/.test(given)) throw new CliError("bad_request", "url goes to contacts on the app's card: no query or fragment (a private repository's token rides there); publish the app in a public repository");
@@ -4784,6 +4805,34 @@ async function letIn(ctx, groupId, link, held) {
4784
4805
  warning: `Not in yet: no member's app has let you in. A member's app lets you in only while this profile is running: ${show}`
4785
4806
  };
4786
4807
  }
4808
+ /**
4809
+ * Why a text that waits will not go by itself, or undefined (waitNotice.ts `dhtOnlyNote`). This side's DHT only that is
4810
+ * a hold (`chat disconnect --hold`) is read from `ctx`'s profile; without it, as a DHT only chosen.
4811
+ */
4812
+ function dhtOnlyWait(link, text, ref, ctx) {
4813
+ const mine = link.deliveryMode === "dht";
4814
+ return dhtOnlyNote({
4815
+ mine,
4816
+ theirs: link.dhtDelivery?.peerMode === "dht",
4817
+ heldUntil: mine && ctx ? holdEnds(ctx, link.id) : null,
4818
+ oneShot: ctx?.mode === "one-shot"
4819
+ }, text, ref);
4820
+ }
4821
+ /**
4822
+ * A `--wait sent|delivered` on a text `dhtOnlyWait` holds back, ended short (its timeout, the daemon's stop): it said the
4823
+ * text still goes by itself, or with this profile's next command, which it does not while the chat stays on the DHT
4824
+ * only. It says why instead, with the note in `details.note` too; same code and exit. Read again at the end: a chat
4825
+ * taken off DHT only meanwhile keeps the usual words.
4826
+ */
4827
+ function dhtOnlyTimeout(ctx, chat, text, ref, ms, error) {
4828
+ if (!(error instanceof CliError) || error.code !== "timeout" || error.details?.delivery !== "waiting") return error;
4829
+ const link = state(ctx).links.find((l) => l.id === chat);
4830
+ const note = link && dhtOnlyWait(link, text, ref, ctx);
4831
+ return note ? new CliError("timeout", `${ended(ctx, ms)}: the message is waiting. ${note}`, {
4832
+ ...error.details,
4833
+ note
4834
+ }) : error;
4835
+ }
4787
4836
  var METHODS = {
4788
4837
  ...WALLET_METHODS,
4789
4838
  ...FILE_METHODS,
@@ -5006,10 +5055,14 @@ var METHODS = {
5006
5055
  if (result.error) throw replyTo && notHere(result.error, replyTo, {
5007
5056
  group: false,
5008
5057
  ref: str(params, "chat", true)
5009
- }) || (/not in this chat|cannot be replied to/.test(result.error) ? new CliError("not_found", result.error) : new CliError(result.refused ? "refused" : "unavailable", result.error));
5058
+ }) || (/not in this chat|cannot be replied to/.test(result.error) ? new CliError("not_found", result.error) : new CliError(result.refused ? "refused" : "unavailable", dhtTooLong(ctx, link, result.error, "text", str(params, "chat", true))));
5010
5059
  if (!result.messageId) throw new CliError("bad_request", "Nothing to send");
5011
5060
  let message = await node(ctx).getMessage(link.id, result.messageId);
5012
- if (wait !== "none") message = await waitForMessage(ctx, link.id, result.messageId, wait, ms);
5061
+ const ref = str(params, "chat", true);
5062
+ const dhtOnly = message?.delivery === "waiting" ? dhtOnlyWait(link, text, ref, ctx) : void 0;
5063
+ if (wait !== "none" && !(dhtOnly && params.wait === void 0)) message = await waitForMessage(ctx, link.id, result.messageId, wait, ms).catch((error) => {
5064
+ throw dhtOnlyTimeout(ctx, link.id, text, ref, ms, error);
5065
+ });
5013
5066
  return {
5014
5067
  chat: link.id,
5015
5068
  messageId: result.messageId,
@@ -5019,7 +5072,8 @@ var METHODS = {
5019
5072
  card,
5020
5073
  pressable: pressable(link)
5021
5074
  } : {},
5022
- ...unjoined && message?.delivery === "waiting" && { note: `Nobody joined this chat yet: the message goes once they join${ctx.mode === "one-shot" ? " while this profile is online (`ghostly daemon --detach`)" : ""}` }
5075
+ ...unjoined && message?.delivery === "waiting" && { note: `Nobody joined this chat yet: the message goes once they join${ctx.mode === "one-shot" ? " while this profile is online (`ghostly daemon --detach`)" : ""}` },
5076
+ ...dhtOnly && message?.delivery === "waiting" && { note: dhtOnly }
5023
5077
  };
5024
5078
  },
5025
5079
  /**
@@ -5041,10 +5095,10 @@ var METHODS = {
5041
5095
  messageId,
5042
5096
  text
5043
5097
  });
5044
- if (result.error) throw editRefused(await messageOf(ctx, link.id, messageId), messageId, {
5098
+ if (result.error) throw await editRefused(ctx, link.id, messageId, {
5045
5099
  group: false,
5046
5100
  ref: str(params, "chat", true)
5047
- }, result.error, result.refused);
5101
+ }, dhtTooLong(ctx, link, result.error, "edit", str(params, "chat", true)), result);
5048
5102
  const id = result.messageId ?? messageId;
5049
5103
  let message = await node(ctx).getMessage(link.id, id);
5050
5104
  if (wait === "confirmed" && message?.edit?.pending) message = await waitForEdit(ctx, link.id, id, ms);
@@ -5054,6 +5108,7 @@ var METHODS = {
5054
5108
  messageId: id,
5055
5109
  edits: message?.edit?.seq ?? 0,
5056
5110
  confirmed,
5111
+ ...!confirmed && result.note && { note: result.note },
5057
5112
  ...!confirmed && keptForJoin(ctx, link.id, "the edit")
5058
5113
  };
5059
5114
  },
@@ -5223,7 +5278,10 @@ var METHODS = {
5223
5278
  const target = chatOrGroup(ctx, ref, s);
5224
5279
  if (to.some((t) => t.linkId === target.linkId)) continue;
5225
5280
  if (to.length === 5) throw new CliError("bad_request", `Forward to at most 5 chats and groups at once`);
5226
- to.push(target);
5281
+ to.push({
5282
+ ...target,
5283
+ ref
5284
+ });
5227
5285
  }
5228
5286
  if (!to.length) throw new CliError("bad_request", "Forward to which chat? Name one or more with --to");
5229
5287
  const chosen = [];
@@ -5265,6 +5323,14 @@ var METHODS = {
5265
5323
  sent: result.sent,
5266
5324
  error: result.error
5267
5325
  }));
5326
+ for (const [i, result] of out.entries()) {
5327
+ const link = to[i].group ? void 0 : state(ctx).links.find((l) => l.id === to[i].id);
5328
+ if (!link || link.deliveryMode !== "dht" && link.dhtDelivery?.peerMode !== "dht") continue;
5329
+ for (const messageId of result.messageIds) {
5330
+ const copy = await node(ctx).getMessage(link.id, messageId);
5331
+ if (copy && !copy.file && copy.delivery === "waiting") result.note ??= dhtOnlyWait(link, copy.text, to[i].ref);
5332
+ }
5333
+ }
5268
5334
  let short;
5269
5335
  const waited = async (wait, now) => {
5270
5336
  if (short) return now();
@@ -5296,7 +5362,9 @@ var METHODS = {
5296
5362
  file: sent.file.id,
5297
5363
  timeout: ms / 1e3
5298
5364
  });
5299
- else await waitForMessage(ctx, to[i].id, messageId, "sent", ms);
5365
+ else await waitForMessage(ctx, to[i].id, messageId, "sent", ms).catch((error) => {
5366
+ throw dhtOnlyTimeout(ctx, to[i].id, sent?.text ?? "", to[i].ref, ms, error);
5367
+ });
5300
5368
  }, () => void 0);
5301
5369
  }
5302
5370
  const failed = out.filter((r) => r.error);
@@ -5679,10 +5747,10 @@ var METHODS = {
5679
5747
  text,
5680
5748
  ...mentions.length ? { mentions } : {}
5681
5749
  });
5682
- if (result.error) throw editRefused(await messageOf(ctx, linkId, messageId), messageId, {
5750
+ if (result.error) throw await editRefused(ctx, linkId, messageId, {
5683
5751
  group: true,
5684
5752
  ref: str(params, "group", true)
5685
- }, result.error, result.refused);
5753
+ }, result.error, result);
5686
5754
  const edits = (await node(ctx).getMessage(linkId, messageId))?.edit?.seq ?? 0;
5687
5755
  if (edits === before) return {
5688
5756
  group: group.id,
@@ -5905,7 +5973,8 @@ var ENGINE_SENDS = /* @__PURE__ */ new Set([
5905
5973
  "renameGroup",
5906
5974
  "updateSettings",
5907
5975
  "sendFile",
5908
- "setOwnStatus"
5976
+ "setOwnStatus",
5977
+ "nostrDraft"
5909
5978
  ]);
5910
5979
  async function guardEngineSend(ctx, method, args) {
5911
5980
  const of = (value, key) => value && typeof value === "object" ? value[key] : void 0;
@@ -5918,7 +5987,9 @@ async function guardEngineSend(ctx, method, args) {
5918
5987
  args.name,
5919
5988
  of(args.settings, "nick"),
5920
5989
  of(args.file, "name"),
5921
- of(args.status, "text")
5990
+ of(args.status, "text"),
5991
+ args.content,
5992
+ ...args.fields && typeof args.fields === "object" ? Object.values(args.fields) : []
5922
5993
  ];
5923
5994
  if (method === "forwardMessages") {
5924
5995
  const ids = Array.isArray(args.messageIds) ? args.messageIds.filter((id) => typeof id === "string") : [];
@@ -6028,11 +6099,38 @@ function chatNotGroup(ctx, params, command, rest = "") {
6028
6099
  /**
6029
6100
  * An edit the engine refused. A message that is not in the chat or group at all is `not_found` (exit 3), said as every
6030
6101
  * message id is (`noMessage`); before, a mistyped or lost id read "Only your own text messages can be edited"
6031
- * (`refused`, exit 1), as if the message were someone else's.
6102
+ * (`refused`, exit 1), as if the message were someone else's. Whether it is there is the engine's answer (`missing`)
6103
+ * once it looked for it: read again here, an id no message goes by read the chat's whole history a second time (0.7 s
6104
+ * at 100,000 messages). Only a refusal before it looked (a chat that cannot edit, a group I am not in) looks here.
6105
+ */
6106
+ async function editRefused(ctx, linkId, ref, place, error, result) {
6107
+ if (!result.refused) return new CliError("unavailable", error);
6108
+ if (result.missing ?? !await messageOf(ctx, linkId, ref)) return noMessage(ref, place);
6109
+ return new CliError("refused", error);
6110
+ }
6111
+ /**
6112
+ * About the longest ASCII text, and edit, the DHT packet carries once sealed and signed: within the 256 bytes, the
6113
+ * envelope's authentication (and an edit's element) takes the rest. The edge moves by a byte or two with the chat (the
6114
+ * envelope's sequence, the edit's number), so the words say "about"; `dhtBudgetWords.test.ts` sends both sizes on two
6115
+ * paired daemons.
6116
+ */
6117
+ var DHT_TEXT_FITS = 248;
6118
+ var DHT_EDIT_FITS = 214;
6119
+ /**
6120
+ * The engine's refusal of a text or an edit within 256 bytes that the DHT packet cannot carry (`DHT_PACKET_BUDGET`,
6121
+ * "Text and authentication exceed the DHT packet budget"), said as the apps and `dhtOnlyWait` say it: too long for the
6122
+ * DHT, about how much fits, and what ends it, by whose choice keeps the chat on the DHT only (this side's hold: when
6123
+ * it ends, and the command that ends it now). Any other error as is.
6032
6124
  */
6033
- function editRefused(message, ref, place, error, refused) {
6034
- if (refused && !message) return noMessage(ref, place);
6035
- return new CliError(refused ? "refused" : "unavailable", error);
6125
+ function dhtTooLong(ctx, asked, error, kind, ref) {
6126
+ if (error !== "Text and authentication exceed the DHT packet budget. Shorten the message.") return error;
6127
+ const link = state(ctx).links.find((l) => l.id === asked.id) ?? asked;
6128
+ const mine = link.deliveryMode === "dht", theirs = link.dhtDelivery?.peerMode === "dht";
6129
+ const held = mine ? holdEnds(ctx, link.id) : null, chosen = mine && held === null;
6130
+ const fits = kind === "text" ? `a text fits about ${DHT_TEXT_FITS} bytes there` : `an edit fits about ${DHT_EDIT_FITS} bytes there`;
6131
+ const act = kind === "text" ? "send it" : "make the edit";
6132
+ const switchBack = `ghostly chat transport ${shellWord(ref, "<chat>")} auto`;
6133
+ return `Too long for the DHT (${fits} once sealed): ${chosen && theirs ? `you and the contact keep this chat on the DHT only: ${act} once both choose a live transport (${switchBack}), or shorten it` : chosen ? `this chat is on the DHT only: ${act} once you choose a live transport (${switchBack}), or shorten it` : theirs ? `the contact keeps this chat on the DHT only: ${act} once they choose a live transport, or shorten it` : held !== null ? `${heldWords(held, ref, act)}, or shorten it` : `shorten it, or ${act} once the chat is live`}`;
6036
6134
  }
6037
6135
  /**
6038
6136
  * The engine's "That message is not in this chat" (", or takes no reaction", ", or cannot be pinned", ", or cannot be
@@ -6216,4 +6314,4 @@ async function callApi(ctx, method, params = {}, call) {
6216
6314
  }
6217
6315
  export { groupPayTwins as _, hideStateSecrets as a, settingsInEffect as c, servedApps as d, nodeLocalFetch as f, groupMessageJson as g, groupJson as h, groupSendRefused as i, paymentJson as l, chatMessageJson as m, SETTABLE as n, mentionsFor as o, chatJson as p, callApi as r, redactSettings as s, API_METHODS as t, reportAppFrames as u, resumeHolds as v, flushCardUpdates as y };
6218
6316
 
6219
- //# sourceMappingURL=api-CjOaoG-v.js.map
6317
+ //# sourceMappingURL=api-Dnq86JAA.js.map