@ghostlytools/cli 1.10.0 → 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.
- package/README.md +19 -17
- package/SKILL.md +5 -4
- package/dist/assets/api-DcE4KylM.js +3 -0
- package/dist/assets/{api-BF_KwecF.js → api-EUGHGnRz.js} +108 -49
- package/dist/assets/api-EUGHGnRz.js.map +1 -0
- package/dist/assets/{apiKit-Du1u2l4x.js → apiKit-CJVp_crp.js} +85 -22
- package/dist/assets/apiKit-CJVp_crp.js.map +1 -0
- package/dist/assets/{apps-Bti9fDoW.js → apps-C-KbyLCa.js} +1 -1
- package/dist/assets/{apps-DwPfp54I.js → apps-C54T_MOT.js} +33 -12
- package/dist/assets/apps-C54T_MOT.js.map +1 -0
- package/dist/assets/{arkade-DOWpA2Kr.js → arkade-BmxJTa65.js} +2 -2
- package/dist/assets/{arkade-DOWpA2Kr.js.map → arkade-BmxJTa65.js.map} +1 -1
- package/dist/assets/{backup-DZ_Q1eSu.js → backup-BxSH5BZG.js} +7 -6
- package/dist/assets/{backup-DZ_Q1eSu.js.map → backup-BxSH5BZG.js.map} +1 -1
- package/dist/assets/{backup-CeRckyl2.js → backup-C0Plp-DF.js} +1 -1
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
- package/dist/assets/{buttons-BxIThdg9.js → buttons-B-ZJYdo0.js} +6 -6
- package/dist/assets/{buttons-BxIThdg9.js.map → buttons-B-ZJYdo0.js.map} +1 -1
- package/dist/assets/buttons-DA3wZfG0.js +2 -0
- package/dist/assets/childEnv-BVOQK9EA.js +21 -0
- package/dist/assets/childEnv-BVOQK9EA.js.map +1 -0
- package/dist/assets/{client-D5E1RQYB.js → client-CDa87uYD.js} +3 -3
- package/dist/assets/{client-D5E1RQYB.js.map → client-CDa87uYD.js.map} +1 -1
- package/dist/assets/codec-D45W1L8n.js +13 -0
- package/dist/assets/codec-D45W1L8n.js.map +1 -0
- package/dist/assets/{envelope-CugS9qwQ.js → envelope-C3yFCQa-.js} +3 -12
- package/dist/assets/envelope-C3yFCQa-.js.map +1 -0
- package/dist/assets/{errors-R4S2SAEM.js → errors-Dt-ZnyOX.js} +3 -1
- package/dist/assets/errors-Dt-ZnyOX.js.map +1 -0
- package/dist/assets/{fixedHosts-B4E4VrYE.js → fixedHosts-C6nCHjOa.js} +4 -4
- package/dist/assets/{fixedHosts-B4E4VrYE.js.map → fixedHosts-C6nCHjOa.js.map} +1 -1
- package/dist/assets/{groupFiles-NonOYBKN.js → groupFiles-DYopNE57.js} +217 -178
- package/dist/assets/groupFiles-DYopNE57.js.map +1 -0
- package/dist/assets/{host-DvcVt5YI.js → host-G5seUwaI.js} +241 -87
- package/dist/assets/host-G5seUwaI.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-Ce42sR8x.js → hyperdhtRelay-B_uHjg_r.js} +28 -20
- package/dist/assets/hyperdhtRelay-B_uHjg_r.js.map +1 -0
- package/dist/assets/{irohWeb-C9ChbD-c.js → irohWeb-C-2oslSU.js} +120 -38
- package/dist/assets/irohWeb-C-2oslSU.js.map +1 -0
- package/dist/assets/{main-4qE381KM.js → main-Dk--nD7X.js} +92 -48
- package/dist/assets/main-Dk--nD7X.js.map +1 -0
- package/dist/assets/{mainline-DOwZDHVy.js → mainline-HPlVrl8R.js} +5 -5
- package/dist/assets/mainline-HPlVrl8R.js.map +1 -0
- package/dist/assets/networkReason-CfpO9ayz.js +474 -0
- package/dist/assets/networkReason-CfpO9ayz.js.map +1 -0
- package/dist/assets/{nwc-CHLWFV1R.js → nwc-BY7BPttn.js} +3 -3
- package/dist/assets/{nwc-CHLWFV1R.js.map → nwc-BY7BPttn.js.map} +1 -1
- package/dist/assets/{nwcProvider-BlkPOJen.js → nwcProvider-CfpbNUf7.js} +2 -2
- package/dist/assets/{nwcProvider-BlkPOJen.js.map → nwcProvider-CfpbNUf7.js.map} +1 -1
- package/dist/assets/{ownDid-yXtY_1B5.js → ownDid-DJFZM2cV.js} +2 -2
- package/dist/assets/{ownDid-yXtY_1B5.js.map → ownDid-DJFZM2cV.js.map} +1 -1
- package/dist/assets/{profiles-vbXHs0Mq.js → profiles-DKmZGXp6.js} +22 -9
- package/dist/assets/profiles-DKmZGXp6.js.map +1 -0
- package/dist/assets/{registry-chCD0KWS.js → registry-BUm4cAzV.js} +60 -19
- package/dist/assets/registry-BUm4cAzV.js.map +1 -0
- package/dist/assets/{registry-BN9r2pR4.js → registry-CAzrtV0_.js} +1 -1
- package/dist/assets/{resolve-Dtzogt2W.js → resolve-CDD4X68j.js} +5 -3
- package/dist/assets/resolve-CDD4X68j.js.map +1 -0
- package/dist/assets/{restoredRows-CRYwIx3g.js → restoredRows-YhlbokEE.js} +4 -2
- package/dist/assets/restoredRows-YhlbokEE.js.map +1 -0
- package/dist/assets/{secretGuard-CSVNxXVW.js → secretGuard-B7Hj0Kvz.js} +2 -2
- package/dist/assets/{secretGuard-CSVNxXVW.js.map → secretGuard-B7Hj0Kvz.js.map} +1 -1
- package/dist/assets/secretGuard-DUr6bgKc.js +2 -0
- package/dist/assets/{server-BZnsm5X5.js → server-DcOsgYDU.js} +1046 -573
- package/dist/assets/server-DcOsgYDU.js.map +1 -0
- package/dist/assets/{src-DZagapGt.js → src-D31D1_oY.js} +2360 -1673
- package/dist/assets/src-D31D1_oY.js.map +1 -0
- package/dist/assets/{sshForges-BkTgy5rx.js → sshForges-DerRwMf3.js} +2 -2
- package/dist/assets/{sshForges-BkTgy5rx.js.map → sshForges-DerRwMf3.js.map} +1 -1
- package/dist/assets/{translate-B9SMd6uf.js → translate-C-sj0VJe.js} +12 -8
- package/dist/assets/{translate-B9SMd6uf.js.map → translate-C-sj0VJe.js.map} +1 -1
- package/dist/assets/{usdt-BU4ezonh.js → usdt-DwHqp625.js} +3 -3
- package/dist/assets/{usdt-BU4ezonh.js.map → usdt-DwHqp625.js.map} +1 -1
- package/dist/assets/{waitNotice-B8D8WhbE.js → waitNotice-D52RWbV4.js} +38 -4
- package/dist/assets/waitNotice-D52RWbV4.js.map +1 -0
- package/dist/assets/{words-jYy7lTcb.js → words-Db9WgatT.js} +3 -3
- package/dist/assets/words-Db9WgatT.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-BF_KwecF.js.map +0 -1
- package/dist/assets/api-DdrA86Ur.js +0 -3
- package/dist/assets/apiKit-Du1u2l4x.js.map +0 -1
- package/dist/assets/apps-DwPfp54I.js.map +0 -1
- package/dist/assets/buttons-D9QBHS9Y.js +0 -2
- package/dist/assets/envelope-CugS9qwQ.js.map +0 -1
- package/dist/assets/errors-R4S2SAEM.js.map +0 -1
- package/dist/assets/groupFiles-NonOYBKN.js.map +0 -1
- package/dist/assets/host-DvcVt5YI.js.map +0 -1
- package/dist/assets/hyperdhtRelay-Ce42sR8x.js.map +0 -1
- package/dist/assets/irohWeb-C9ChbD-c.js.map +0 -1
- package/dist/assets/main-4qE381KM.js.map +0 -1
- package/dist/assets/mainline-DOwZDHVy.js.map +0 -1
- package/dist/assets/networkReason-MInk1Y63.js +0 -154
- package/dist/assets/networkReason-MInk1Y63.js.map +0 -1
- package/dist/assets/profiles-vbXHs0Mq.js.map +0 -1
- package/dist/assets/registry-chCD0KWS.js.map +0 -1
- package/dist/assets/resolve-Dtzogt2W.js.map +0 -1
- package/dist/assets/restoredRows-CRYwIx3g.js.map +0 -1
- package/dist/assets/secretGuard-Q2BKq0q0.js +0 -2
- package/dist/assets/server-BZnsm5X5.js.map +0 -1
- package/dist/assets/src-DZagapGt.js.map +0 -1
- package/dist/assets/waitNotice-B8D8WhbE.js.map +0 -1
- package/dist/assets/words-jYy7lTcb.js.map +0 -1
package/README.md
CHANGED
|
@@ -102,7 +102,8 @@ a command that waits (`chat wait`, `file wait`, `--wait`) within its `--timeout`
|
|
|
102
102
|
`details.method`); `ghostly daemon restart` is the way out ([docs/CLI.md](../../docs/CLI.md#what-it-does)). On a
|
|
103
103
|
terminal, a command that waits says on stderr what it waits for once it has waited a second; nothing is said there on
|
|
104
104
|
a pipe. A `<chat>` is
|
|
105
|
-
its id, a unique prefix of it, or its name; a `<group>` too
|
|
105
|
+
its id, a unique prefix of it, or its name; a `<group>` too, each also as `group:<ref>` (every group command,
|
|
106
|
+
`listen --group` and every command that takes a chat or a group). A `<group>` that is one group's name and a prefix of
|
|
106
107
|
another's id is refused (exit 1, `bad_request`, both ids in `details.matches`): use its id.
|
|
107
108
|
|
|
108
109
|
The rows are in alphabetical order of their first command, and every command of `ghostly help` has one
|
|
@@ -126,9 +127,9 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
126
127
|
| `chat connect <chat>`, `chat disconnect <chat> [--hold <minutes>]` | Reconnect now (ends a hold); close the live session, or with `--hold` stay off the direct link that long ([Staying off the direct link](#staying-off-the-direct-link)) |
|
|
127
128
|
| `chat history <chat> [--limit n] [--before x] [--after x] [--translate lang]` | Messages, oldest first; `x` is a message id or a time in ms ([Translation](#translation)) |
|
|
128
129
|
| `chat list [--show-secret]`, `chat show <chat> [--show-secret]` | Chats, and one chat's connection: transports, last attempt, comparison code. A pending chat's `invite` prints as `<hidden>` without `--show-secret` |
|
|
129
|
-
| `chat pay <chat> <sats> [--memo t] [--network n] [--confirm-real]` | Ecash to a contact. A contact that offers no way of paying is `refused`: `details.reason` `contact_no_wallet` (it has no wallet yet) or `contact_payments_off` (it has payments off in this chat, or an older app). With no Cashu wallet of the network on this side, `refused` with `details.reason` `no_wallet` and the `wallet create` command to run; with one too short of sats, `refused
|
|
130
|
-
| `chat rename <chat> <name>`, `chat remove <chat> --yes` | Name it here; delete it (keys and history) here, refused (`busy`) while a call is on in it: hang the call up first |
|
|
131
|
-
| `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`) |
|
|
130
|
+
| `chat pay <chat> <sats> [--memo t] [--network n] [--confirm-real]` | Ecash to a contact. A contact that offers no way of paying is `refused`: `details.reason` `contact_no_wallet` (it has no wallet yet) or `contact_payments_off` (it has payments off in this chat, or an older app). With no Cashu wallet of the network on this side, `refused` with `details.reason` `no_wallet` and the `wallet create` command to run; with one too short of sats, `refused`. It 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 |
|
|
131
|
+
| `chat rename <chat> <name>`, `chat remove <chat> --yes` | Name it here (up to 48 characters, counted as stored: a tab or a line break is a space and invisible characters go, so a name with nothing that shows is refused; an empty name gives back the contact's own); delete it (keys and history) here, refused (`busy`) while a call is on in it: hang the call up first |
|
|
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 |
|
|
132
133
|
| `chat transport <chat> <auto\|dht\|webrtc\|iroh\|hyperdht>` | What carries the chat |
|
|
133
134
|
| `chat verify <chat> --code <code>` | Mark the contact verified after comparing the codes out of band |
|
|
134
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 |
|
|
@@ -147,7 +148,7 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
147
148
|
| `group hub <group> <member> [--pin \| --exclude \| --auto]` | Past 16 members: pin a member as a hub, keep one from being a hub, or leave it to their app (a daemon offers itself) |
|
|
148
149
|
| `group invite <group> <chat>`, `group remove <group> <member>`, `group admin <group> <member>` | Membership, for the admin (each prints the group; `--show-secret` for its link). `group invite` 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 |
|
|
149
150
|
| `group leave <group> --yes`, `group forget <group> --yes`, `group accept\|decline <group>` | Membership. Leaving deletes the group's history and files on this device, so it asks for `--yes` (`confirm`, exit 5, without it), as `group forget` does; forget also deletes a group you were removed from, which keeps its history. An admin's leave hands the role to a member who is online and names them: `{left, admin: {key, name}}` |
|
|
150
|
-
| `group list [--show-secret]`, `group show <group> [--show-secret]`, `group history <group>` | Groups, members, history; a message names its author (`member` key, `nick` from the roster, or the name an author no longer in it had). The entry link prints as `<hidden>` without `--show-secret` |
|
|
151
|
+
| `group list [--show-secret]`, `group show <group> [--show-secret]`, `group history <group>` | Groups, members, history; a message names its author (`member` key, `nick` from the roster, or the name an author no longer in it had). The entry link prints as `<hidden>` without `--show-secret`. `others` (only when there are some): other groups that came under the same id, kept beside it until you pick, each a contact's invitation (`chat`, `name`, `members`) or a link opened (`link`, hidden the same way); `engine keepGroup '{"groupId":"<id>"}'` keeps the one shown, `engine switchGroup '{"groupId":"<id>","to":"<chat or link>"}'` takes another |
|
|
151
152
|
| `group react <group> <message> <emoji> [--remove]` | React to a group's message. `refused` when the profile is not a member any more |
|
|
152
153
|
| `group rename <group> <name> [--force]` | A new name, for the admin (1 to 64 characters on one line; one that looks like a secret needs `--force`, as for `group create`); the picture stays. Members see it once it reaches them; until then, and on apps from before names, the group keeps the name it had when they got in |
|
|
153
154
|
| `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 |
|
|
@@ -156,20 +157,20 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
156
157
|
| `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). 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 |
|
|
157
158
|
| `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 |
|
|
158
159
|
| `identity providers`, `identity list` | Kinds of proof and their signers; this profile's proofs |
|
|
159
|
-
| `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`
|
|
160
|
+
| `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 |
|
|
160
161
|
| `invite create [--label <name>]` | A new chat's `ghostly1…` invite and its link |
|
|
161
162
|
| `invite join [<invite-or-link> \| -] [--label <name>]` | Join a chat (your own invite is refused). The invite comes from stdin when none is given or `-`, out of `ps` and the shell's history; on the command line the CLI warns |
|
|
162
163
|
| `lightning default <card>`, `lightning rename <card> <name>` | Lightning cards: which receives by default |
|
|
163
164
|
| `listen [--since seq] [--cursor file] [--type t]… [--turns] [--from <chat\|key>]… [--group <group>]… [--exec cmd] [--webhook url] [--print] [--translate lang]` | The event stream; `--from` and `--group` an allowlist, `--turns` one `agent.turn` per message to answer, `--translate` a translation of received messages ([Events](#events), [Translation](#translation)) |
|
|
164
|
-
| `message delete <chat\|group> <message> --everyone [--wait none\|confirmed] [--timeout s]` | Deletes a message of yours for everyone (a text, a card, a file or a voice message; never a payment): it goes from this device at once and from every member's as the message's last edit, once they are back if they are away. An app from before this shows "🗑 Message removed" in its place. In a chat, `--wait confirmed` waits for the contact's app to confirm (the default without a daemon, which is offline once the command ends), and the answer's `confirmed` says whether it did. Without `--everyone`, only this device forgets it. Answers the chat or group, the message's `messageId` and `everyone` (`deleted` says the same id, kept for callers that read it) |
|
|
165
|
+
| `message delete <chat\|group> <message> --everyone [--wait none\|confirmed\|sent] [--timeout s]` | Deletes a message of yours for everyone (a text, a card, a file or a voice message; never a payment): it goes from this device at once and from every member's as the message's last edit, once they are back if they are away. An app from before this shows "🗑 Message removed" in its place. In a chat, `--wait confirmed` waits for the contact's app to confirm (the default without a daemon, which is offline once the command ends), and the answer's `confirmed` says whether it did. In a group (no receipts), `--wait sent` waits until a member's edge (a hub's, in a community) took the removal, the default without a daemon, and the answer's `edges` and `sent` say how many did, as for `group send`. Without `--everyone`, only this device forgets it. Answers the chat or group, the message's `messageId` and `everyone` (`deleted` says the same id, kept for callers that read it) |
|
|
165
166
|
| `message retry\|delete\|details <chat> <message>` | One message |
|
|
166
|
-
| `pay <invoice\|address\|lnurl> [--amount sats] [--network n] [--max-fee sats] [--chat <chat>] [--confirm-real]` | Pay over Lightning (Testnet unless `--network mainnet`). `--chat`: the chat the invoice came from, whose contact is told a Testnet invoice was paid |
|
|
167
|
+
| `pay <invoice\|address\|lnurl> [--amount sats] [--network n] [--max-fee sats] [--chat <chat>] [--confirm-real]` | Pay over Lightning (Testnet unless `--network mainnet`). `--chat`: the chat the invoice came from, whose contact is told a Testnet invoice was paid, named 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 |
|
|
167
168
|
| `payment list [--chat c]`, `payment check <chat> <payment>`, `payment reclaim <payment>` | Payments and requests |
|
|
168
169
|
| `pin <chat\|group> <message> \| --remove [--wait none\|confirmed] [--timeout s]` | Pin a message at the top of a chat or group, for everyone in it: one per chat, a new pin replaces it; `pin <chat\|group> --remove` unpins (it names no message). In a community only the admin pins. A profile that is not a member of the group any more (removed from it) gets `refused`, with the reason, and nothing is pinned. A 1:1 pin reaches the contact on the next live session; without a daemon `pin` stays until the contact confirmed it (`--wait confirmed`, the default there; `--timeout`, 30 s), and `confirmed` says whether it has. The other side hears `chat.pinned` or `group.pinned`. `chat show`, `group show` and `group list` say what is pinned now: `pin: {messageId, ref, by, at}` (`messageId` null when the message is not here), or `pin: null` |
|
|
169
170
|
| `profile backup --out <file>`, `profile restore <file> <new profile>` | A backup (WISP 05 envelope, written and read a piece at a time), encrypted with the passphrase from `--passphrase-file` or `GHOSTLY_BACKUP_PASSPHRASE`. `--no-passphrase` makes one that is not encrypted: the file then holds the profile's keys and wallet secrets in the clear. Neither given, nothing is made. `--light` leaves out files over 1 MB (voice messages over 4 MB): their messages stay, and the restored copy says each one is not in this backup |
|
|
170
171
|
| `profile create <name> [--use] [--name <shown>] [--force]`, `profile list`, `profile use <name>` | Profiles |
|
|
171
172
|
| `profile picture <jpeg> \| --clear` | The picture contacts see (a JPEG within 512 px; 128 px is what the app sends) |
|
|
172
|
-
| `profile show`, `profile set [--name <name>] [--share-profile \| --no-share-profile] [--force]` | The name contacts see (one that looks like a secret needs `--force`) |
|
|
173
|
+
| `profile show`, `profile set [--name <name>] [--share-profile \| --no-share-profile] [--force]` | The name contacts see (up to 64 characters, cleaned as a chat's or a group's name is; empty is no name; one that looks like a secret needs `--force`) |
|
|
173
174
|
| `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. 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 |
|
|
174
175
|
| `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 |
|
|
175
176
|
| `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 |
|
|
@@ -178,7 +179,7 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
178
179
|
| `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) |
|
|
179
180
|
| `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), … `<json>` as `-`, or none on a pipe, is read from stdin: a TURN password stays out of `ps` |
|
|
180
181
|
| `status` | The profile, its chats, whether WebRTC and calls run, the last event seq |
|
|
181
|
-
| `store sign <index> --key <file> [--out <dir>]` | Sign a store index (WISP 1200 · Stores) with the store key file (kept offline; made when missing, the index names no `key` and no signed index is in the output folder): writes `ghostly-store.json`, canonical, and `ghostly-store.sig` beside the index or in `--out`. Refused, with the reason, when a client would refuse the index (`expires` more than 90 days ahead, a bad field), or when the index already there has a higher `sequence` (`rollback`), the same one with other content (`equivocation`), or is signed by another key (`store-key`: another store is another `--out`) |
|
|
182
|
+
| `store sign <index> --key <file> [--out <dir>]` | Sign a store index (WISP 1200 · Stores) with the store key file (kept offline; made when missing, the index names no `key` and no signed index is in the output folder): writes `ghostly-store.json`, canonical, and `ghostly-store.sig` beside the index or in `--out`. Refused, with the reason, when a client would refuse the index (`expires` more than 90 days ahead, a bad field), or when the index already there has a higher `sequence` (`rollback`), the same one with other content (`equivocation`), or is signed by another key (`store-key`: another store is another `--out`), or when a `ghostly-store.json` or `ghostly-store.sig` there does not read as a signed index (move them away, or name another `--out`) |
|
|
182
183
|
| `task send <chat\|group> --title <title> [--status s] [--progress n \| --steps a/b] [--step "…"] [--item state:text]… [--pr-url url --pr-number n --additions n --deletions n --files n --pr-state s --pr-checks c] [--branch b] [--tag label]… [--parent task] [--link url]… [--id id] [--text <text>] [--json json\|-\|file] [--force]`, `task update <chat\|group> <task> [fields…]` | A task card for a bot's work (WISP 405 · Status Cards): a title, a status (queued, running, blocked, done, failed, cancelled), progress, the step it is on, up to 20 steps or log lines (`--item done:Codec`; the card holds at most 8 KiB in all, so 20 long items of non-Latin text are past it; a lowercase word before the colon must be an item state: pending, running, done, failed or skipped) and its pull request, shown as a small card that apps without cards read as text. Optional, and ignored by apps from before them: where the pull request stands (`--pr-state draft`, `open`, `merged` or `closed`; an open one puts the task in the board's Review column) and its checks (`--pr-checks passing`, `failing` or `pending`), up to 3 tags of 24 characters (`--tag core --tag web`; an update's tags replace the card's), and `--parent <task>`, a task of yours in the same chat that this one is a part of (sent first; its parts stack under it on the board). `send` prints the task's id and message; `update` merges the fields given over the card (an update's `--item` list replaces the card's: give all of them) and edits its message, at most once per 2.5 s (sooner updates merge into the next). `--json` takes the whole card; `null` in it removes a field. Without a daemon a card in a chat stays until it went out: `send` until it is sent (`--wait sent`), `update` until the contact confirmed it (`--wait confirmed`), up to `--timeout` (30 s, then exit 4: it goes with the next command); `--wait none` answers at once, as a daemon and a group do by default. Only the CLI sends cards: the app shows them |
|
|
183
184
|
| `typing <chat> [--kind typing\|recording\|thinking] [--status "<text>"] [--for s] [--stop]` | Show the contact you are writing, recording or thinking, or a short status line in its place ("Transcribing your audio…", 40 characters, no links): live chats only, it holds 6 s there; `--for s` keeps it on that long (up to 600 s; a one-shot stays that long once the chat is live, and stops with `live: false` when it is not live within 15 s); a new kind or status shows at once; a message to the chat or `--stop` ends it |
|
|
184
185
|
| `usage send [<chat\|group>] [--all] --left <percent> [--window "5 h"] [--resets <time>] [--label Claude] [--account <name>] [--also week=80@<time>]… [--used n --limit n] [--id id] [--text <text>] [--json json\|-\|file] [--force]` | How much of a quota the bot has left (WISP 405 § Usage): the percent (or `--used` of `--limit`), what it is of, the account, the window, when it resets, and up to 3 other windows (`--also week=80@2026-10-10T00:00:00Z`); `--resets` and `@` take milliseconds or a date within a year (no zone: local time, a bare date local midnight). The app shows a small meter on the chat's row and in its header, amber under 20%, red under 5%, muted once 6 h old or past the reset. One card per chat: the first report sends it, later ones edit it in place (quiet, paced as `task update`'s); each report is whole, so a field it leaves out goes. Without a daemon a report in a chat stays until it went out (`--wait sent`: the first sent, a later one confirmed by the contact), up to `--timeout`; `--wait none` answers at once. `--all` reports to every 1:1 chat with a contact. See [docs/AI-AGENTS.md](../../docs/AI-AGENTS.md#reporting-usage) for where a bot gets its numbers |
|
|
@@ -277,7 +278,8 @@ A spend on Mainnet needs the engine's `confirmedReal` (the app asks the person).
|
|
|
277
278
|
|
|
278
279
|
SSH (`ssh-keygen`), OpenPGP (`gpg`) and Bitcoin (a wallet's "sign message") proofs are made with the tool: `identity
|
|
279
280
|
add` prints the statement and the command, `identity complete` takes its output. A domain or a DID publishes a record,
|
|
280
|
-
then `identity complete` asks the engine to look it up.
|
|
281
|
+
then `identity complete` asks the engine to look it up. The last of the steps `identity add` answers is that `identity
|
|
282
|
+
complete` command, with its draft (the app's "press Check" and "paste it into Ghostly" point to it). In-app signers (a Nostr signer over NIP-46, Pubky) run in one
|
|
281
283
|
`identity add`, with their fields in `--field` (a NIP-46 `bunker://` link on stdin: `printf 'bunker=%s\n' "$LINK" | ghostly
|
|
282
284
|
identity add nostr --signer nip46 --stdin`), and print what they wait on (a link, a code) to stderr. OpenID Connect,
|
|
283
285
|
AT Protocol and a NIP-07 browser extension need a browser window: make those proofs in the app. `identity providers`
|
|
@@ -324,7 +326,7 @@ chat (`chat list`, `chat show`, `chat rename`, …) and `engine getState` print
|
|
|
324
326
|
file that holds no event number (empty, edited by hand) is refused at start (`bad_request`, naming the file): fix or
|
|
325
327
|
remove it, or give `--since`.
|
|
326
328
|
- Types: `daemon.started`, `chat.created`, `chat.removed`, `chat.renamed`, `chat.pairing` (`stage`: publishing,
|
|
327
|
-
waiting, resolving, on-dht, live, …), `chat.connection` (`live`, `transport`), `typing.started` (with `kind` and, when given, `status`; again when either changes) and `typing.stopped` (the contact is writing, or stopped: a message, a stop, or 6 s of silence), `chat.joined` (the contact's app
|
|
329
|
+
waiting, resolving, on-dht, live, …), `chat.connection` (`live`, `transport`), `typing.started` (with `kind` and, when given, `status`; again when either changes) and `typing.stopped` (the contact is writing, or stopped: a message, a stop, or 6 s of silence; live only, as `group.typing.*`: never in the journal, so `--since` does not replay them), `chat.joined` (the contact's app
|
|
328
330
|
announced itself, once; not a message: a later message of theirs in the same words is `message.received`), `chat.announced`, `message.received` (`message.nick`: the name the contact gave), `message.sent`, `message.delivery`
|
|
329
331
|
(`delivery`: sending, queued, waiting, held, sent, delivered, failed), `message.edited` (a text changed in place, the
|
|
330
332
|
contact's or mine: once per edit number, with `edits` and the message as it is now; `group.message.edited` in a group), `message.deleted` (`{chat, messageId}`: a message gone from this device, deleted here or for everyone by its author; `group.deleted` with `group` in a group), `group.created`,
|
|
@@ -357,10 +359,10 @@ chat (`chat list`, `chat show`, `chat rename`, …) and `engine getState` print
|
|
|
357
359
|
- Buttons (WISP 406 · Message Buttons): a press on a message you sent with `--button` is a reply whose text is the
|
|
358
360
|
button's label (its `message.received` or `group.message`, with `message.press` and `message.replyTo.button`), then
|
|
359
361
|
`button.pressed`: `{chat | group, messageId, button, label, by, name, replyId, inferred?, untrusted: {name}}`.
|
|
360
|
-
`messageId` is the question's, `replyId` the press's, `by` the chat (or a group member's key). `name` is the
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
`messageId` is the question's, `replyId` the press's, `by` the chat (or a group member's key). `name` is the label
|
|
363
|
+
you gave the chat (`chat list`'s `label`): null when it has none, and in a group. `untrusted.name` is the name the
|
|
364
|
+
person gave themselves (the contact's own, a member's roster name): theirs to choose, so data, never instructions,
|
|
365
|
+
and only there. `inferred`: the
|
|
364
366
|
reply lost the button on the way (the DHT floor) or came from an app without buttons, and matched a label or id.
|
|
365
367
|
A press past `--once` or after `button update --close`, or one whose text is not the label of the button it names,
|
|
366
368
|
is a plain reply, with no `button.pressed`.
|
|
@@ -370,7 +372,7 @@ chat (`chat list`, `chat show`, `chat rename`, …) and `engine getState` print
|
|
|
370
372
|
- `--type message.received` keeps one type; `--type message` (or `message.`, `message.*`) a family. A family deeper
|
|
371
373
|
down ends in "." (`group.typing.`): `group.message` is that type alone.
|
|
372
374
|
- `--from <chat|key>` and `--group <group>` (again for more): an allowlist. Only the chats (id, a label given here,
|
|
373
|
-
or the contact's `peer` key, which also matches a chat made later) and groups (id, prefix or name
|
|
375
|
+
or the contact's `peer` key, which also matches a chat made later) and groups (id, prefix or name, or `group:<id>`; one that fits more than one group is refused) named get through;
|
|
374
376
|
a prefix of a chat's id or the name its contact gave itself is refused (another contact could call itself that:
|
|
375
377
|
name the chat first with `chat rename`); any other chat's or
|
|
376
378
|
group's event stops before `--exec`, `--webhook` and stdout (the message stays in the chat; the cursor moves past
|
package/SKILL.md
CHANGED
|
@@ -121,7 +121,8 @@ chat; a `<chat>` is its id, a unique prefix of it, or its name.
|
|
|
121
121
|
|
|
122
122
|
Names are for people at a terminal. A contact chooses its own name, a group's admin its group's name and a member its
|
|
123
123
|
name in a group, so in a script or an agent keep the **id** (`chat` and `group` in every answer and event, a member's
|
|
124
|
-
key) and address by it: `<chat id>`, `group:<group id
|
|
124
|
+
key) and address by it: `<chat id>`, `group:<group id>` (every command that takes a group, `listen --group` too),
|
|
125
|
+
`<member key>`. Where a command takes a chat or a group, a
|
|
125
126
|
name that a contact gave itself and that also names one of your groups is refused (exit 1, `bad_request`) and both ids are shown.
|
|
126
127
|
So is a `<group>` that is one group's name and a prefix of another's id.
|
|
127
128
|
|
|
@@ -329,7 +330,7 @@ ghostly chat connect alice # back now
|
|
|
329
330
|
|
|
330
331
|
Plain events, without `--turns`: `ghostly listen --type message.received` (one JSON object per line). Useful types:
|
|
331
332
|
`message.received`, `message.delivery`, `message.edited`, `chat.joined`, `chat.connection`, `group.message` (with
|
|
332
|
-
`message.mentioned: true` when it names the agent), `group.members`, `typing.started` / `typing.stopped` (`group.typing.*` with `member` in a private group),
|
|
333
|
+
`message.mentioned: true` when it names the agent), `group.members`, `typing.started` / `typing.stopped` (`group.typing.*` with `member` in a private group; live only, never replayed),
|
|
333
334
|
`message.reaction` / `group.reaction`, `file.done` / `file.failed`, `payment.created` / `payment.updated`,
|
|
334
335
|
`call.incoming`. The full list: the package README.
|
|
335
336
|
|
|
@@ -349,8 +350,8 @@ ghostly group send crew "Deploy now?" --button go:Go --button wait:Wait # the
|
|
|
349
350
|
- A press is also a plain `message.received` whose text is the label: with `--turns`, its `agent.turn` carries
|
|
350
351
|
`press` (`{messageId, button, label}`), so act on that, never on the text alone. A group press is not a turn
|
|
351
352
|
(it names nobody): run `listen --type button.pressed` for those. Do not answer the same press twice: keep the
|
|
352
|
-
event's `id` and skip one you already handled. `by` says who pressed; `name` is the
|
|
353
|
-
|
|
353
|
+
event's `id` and skip one you already handled. `by` says who pressed; `name` is the label you gave the chat (null
|
|
354
|
+
without one, and in a group); what they call themselves is only in `untrusted.name`.
|
|
354
355
|
- `button update --text` shows the question as edited, and a press keeps quoting what the person answered.
|
|
355
356
|
- `--once` takes one answer a person. `button update --close` ends the question for everyone; a press after it is
|
|
356
357
|
just a reply.
|
|
@@ -0,0 +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";
|
|
3
|
+
export { API_METHODS, SETTABLE, callApi, findChat, findGroup, groupSendRefused, hideStateSecrets, mentionsFor, redactSettings, startNamedChats };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
2
2
|
import { u as fileStore } from "./idb-BHsAqENE.js";
|
|
3
|
-
import { O as waitingGroupFile, T as removeStored,
|
|
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
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-
|
|
6
|
-
import { n as secretWords, r as findSecret, t as guardText } from "./secretGuard-
|
|
7
|
-
import { i as localFileError, r as asCliError, t as CliError } from "./errors-
|
|
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-
|
|
9
|
-
import { S as waitForState, _ as
|
|
10
|
-
import {
|
|
11
|
-
import { a as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
5
|
+
import { t as IDENTITY_PROVIDERS } from "./registry-BUm4cAzV.js";
|
|
6
|
+
import { n as secretWords, r as findSecret, t as guardText } from "./secretGuard-B7Hj0Kvz.js";
|
|
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";
|
|
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";
|
|
14
15
|
import { generateMnemonic } from "@scure/bip39";
|
|
15
16
|
import { wordlist } from "@scure/bip39/wordlists/english.js";
|
|
16
17
|
import { execFile, spawn } from "node:child_process";
|
|
@@ -599,11 +600,14 @@ function streamFfmpeg(path, sink, command = process.env.GHOSTLY_FFMPEG || "ffmpe
|
|
|
599
600
|
"-c:a",
|
|
600
601
|
"pcm_f32le",
|
|
601
602
|
"-"
|
|
602
|
-
], {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
603
|
+
], {
|
|
604
|
+
stdio: [
|
|
605
|
+
"ignore",
|
|
606
|
+
"pipe",
|
|
607
|
+
"pipe"
|
|
608
|
+
],
|
|
609
|
+
env: childEnv()
|
|
610
|
+
});
|
|
607
611
|
let errors = "", pending = Buffer.alloc(0), header = null, done = false, failed = null;
|
|
608
612
|
let read, left = Infinity, timedOut = false;
|
|
609
613
|
const timer = setTimeout(() => {
|
|
@@ -982,7 +986,10 @@ async function markDownloaded(path) {
|
|
|
982
986
|
"com.apple.quarantine",
|
|
983
987
|
value,
|
|
984
988
|
path
|
|
985
|
-
], {
|
|
989
|
+
], {
|
|
990
|
+
timeout: 1e4,
|
|
991
|
+
env: childEnv()
|
|
992
|
+
}, () => done()));
|
|
986
993
|
} else if (process.platform === "win32") await writeFile(`${path}:Zone.Identifier`, "[ZoneTransfer]\r\nZoneId=3\r\n").catch(() => {});
|
|
987
994
|
}
|
|
988
995
|
var ACTIONS = [
|
|
@@ -2059,6 +2066,11 @@ function groupJson(group, showSecret = false) {
|
|
|
2059
2066
|
viaLink: !!group.invitation.viaLink,
|
|
2060
2067
|
stage: group.invitation.stage ?? null
|
|
2061
2068
|
} : null,
|
|
2069
|
+
...group.others?.length ? { others: group.others.map((o) => "link" in o ? { link: showSecret ? o.link : "<hidden>" } : {
|
|
2070
|
+
chat: o.linkId,
|
|
2071
|
+
name: o.name,
|
|
2072
|
+
members: o.members
|
|
2073
|
+
}) } : {},
|
|
2062
2074
|
community: group.community ?? null,
|
|
2063
2075
|
picture: !!group.picture,
|
|
2064
2076
|
pin: pinJson(group.pin)
|
|
@@ -2126,7 +2138,7 @@ var view = (ctx, id, params) => groupJson(state(ctx).groups.find((g) => g.id ===
|
|
|
2126
2138
|
var GROUP_ADMIN_METHODS = {
|
|
2127
2139
|
async "group.invite"(ctx, params) {
|
|
2128
2140
|
const group = groupOf(ctx, params);
|
|
2129
|
-
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true));
|
|
2141
|
+
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true), state(ctx).groups);
|
|
2130
2142
|
await node(ctx).inviteToGroup({
|
|
2131
2143
|
groupId: group.id,
|
|
2132
2144
|
linkId: link.id
|
|
@@ -2166,7 +2178,8 @@ var GROUP_ADMIN_METHODS = {
|
|
|
2166
2178
|
},
|
|
2167
2179
|
async "group.rename"(ctx, params) {
|
|
2168
2180
|
const group = groupOf(ctx, params, "chat rename <chat> <name...>");
|
|
2169
|
-
const
|
|
2181
|
+
const clean = cleanName(str(params, "name", true), 64);
|
|
2182
|
+
const name = clean && groupName(clean);
|
|
2170
2183
|
if (!name) throw new CliError("bad_request", `A group's name is 1 to 64 characters on one line`);
|
|
2171
2184
|
guardText(name, bool(params, "force"), "group's name", "rename it");
|
|
2172
2185
|
await node(ctx).renameGroup({
|
|
@@ -2250,12 +2263,32 @@ function signerOf(p, id) {
|
|
|
2250
2263
|
}
|
|
2251
2264
|
return found;
|
|
2252
2265
|
}
|
|
2253
|
-
|
|
2266
|
+
var keep = (verb) => verb[0] === verb[0].toUpperCase() ? "Keep" : "keep";
|
|
2267
|
+
/**
|
|
2268
|
+
* The app's words for its own Check button and paste field, in the CLI's: what was pasted is kept for the last step,
|
|
2269
|
+
* `identity complete`. The steps stay the app's otherwise (a wallet's "paste the statement" is the wallet's field).
|
|
2270
|
+
*/
|
|
2271
|
+
var APP_WORDS = [
|
|
2272
|
+
[/press Check/g, () => "finish it with the last step"],
|
|
2273
|
+
[/\b(paste|copy) (it|the [\w ]+?) into Ghostly/gi, (_, verb, what) => `${keep(verb)} ${what} for the last step`],
|
|
2274
|
+
[/\b(paste) (?=what it prints|the whole signature it prints|the <file>\.sig it writes)/gi, (_, verb) => `${keep(verb)} `]
|
|
2275
|
+
];
|
|
2276
|
+
var inCliWords = (text) => APP_WORDS.reduce((t, [pattern, words]) => t.replace(pattern, words), text);
|
|
2277
|
+
/** The signer's steps, then the CLI's own last one: `identity complete` with this draft, then `identity share`. */
|
|
2278
|
+
function instructionsJson(signer, i, draftId) {
|
|
2279
|
+
const share = "It answers the proof; show it to a contact with ghostly identity share <chat> <id>.";
|
|
2280
|
+
const last = signer.kind === "publish" ? {
|
|
2281
|
+
text: `Once it is published, check it from here: the engine looks it up. ${share}`,
|
|
2282
|
+
copy: `ghostly identity complete ${draftId}`
|
|
2283
|
+
} : {
|
|
2284
|
+
text: `Then finish it with what you kept${i.paste ? ` (${i.paste.label})` : ""}, from a file or piped to it (… | ghostly identity complete ${draftId}). ${share}`,
|
|
2285
|
+
copy: `ghostly identity complete ${draftId} --evidence-file <file>`
|
|
2286
|
+
};
|
|
2254
2287
|
return {
|
|
2255
|
-
steps: i.steps.map((s) => ({
|
|
2256
|
-
text: s.text,
|
|
2288
|
+
steps: [...i.steps.map((s) => ({
|
|
2289
|
+
text: inCliWords(s.text),
|
|
2257
2290
|
...s.copy ? { copy: s.copy } : {}
|
|
2258
|
-
})),
|
|
2291
|
+
})), last],
|
|
2259
2292
|
...i.paste ? { paste: i.paste.label } : {}
|
|
2260
2293
|
};
|
|
2261
2294
|
}
|
|
@@ -2271,6 +2304,11 @@ function proofJson(p) {
|
|
|
2271
2304
|
...p.publicUri ? { publicUri: p.publicUri } : {}
|
|
2272
2305
|
};
|
|
2273
2306
|
}
|
|
2307
|
+
/** Where the CLI takes a signer's field: a secret (a bunker:// link) on stdin first, kept out of ps and the shell's history. */
|
|
2308
|
+
function howToGive(field) {
|
|
2309
|
+
const stdin = `on stdin (--stdin, a ${field.name}=... line)`, flag = `--field ${field.name}=...`;
|
|
2310
|
+
return field.kind === "secret" ? `give it ${stdin}, or ${flag}` : `give it with ${flag}, or ${stdin}`;
|
|
2311
|
+
}
|
|
2274
2312
|
function pruneDrafts(now = Date.now()) {
|
|
2275
2313
|
for (const [id, draft] of drafts) if (now - draft.createdAt > 18e5) drafts.delete(id);
|
|
2276
2314
|
}
|
|
@@ -2328,7 +2366,7 @@ var IDENTITY_METHODS = {
|
|
|
2328
2366
|
if (signer.kind === "in-app") {
|
|
2329
2367
|
const values = params.fields ?? {};
|
|
2330
2368
|
if (typeof values !== "object" || Array.isArray(values) || Object.values(values).some((v) => typeof v !== "string")) throw new CliError("bad_request", "fields must be an object of strings");
|
|
2331
|
-
for (const field of signer.fields ?? []) if (!field.optional && !values[field.name]) throw new CliError("
|
|
2369
|
+
for (const field of signer.fields ?? []) if (!field.optional && !values[field.name]) throw new CliError("usage", `${signer.label} needs ${field.name} (${field.label}): ${howToGive(field)}`);
|
|
2332
2370
|
const seconds = num(params, "timeout", 300, {
|
|
2333
2371
|
min: 5,
|
|
2334
2372
|
max: 3600
|
|
@@ -2402,7 +2440,7 @@ var IDENTITY_METHODS = {
|
|
|
2402
2440
|
provider: p.id,
|
|
2403
2441
|
signer: signer.id,
|
|
2404
2442
|
statement: statement.text,
|
|
2405
|
-
instructions: instructionsJson(signer.instructions(statement)),
|
|
2443
|
+
instructions: instructionsJson(signer, signer.instructions(statement), draftId),
|
|
2406
2444
|
expiresInSeconds: IDENTITY_DRAFT_TTL_MS / 1e3
|
|
2407
2445
|
};
|
|
2408
2446
|
},
|
|
@@ -2448,7 +2486,7 @@ var IDENTITY_METHODS = {
|
|
|
2448
2486
|
return { removed: id };
|
|
2449
2487
|
},
|
|
2450
2488
|
async "identity.share"(ctx, params) {
|
|
2451
|
-
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true));
|
|
2489
|
+
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true), state(ctx).groups);
|
|
2452
2490
|
const id = str(params, "id", true);
|
|
2453
2491
|
if (!state(ctx).identityProofs.some((p) => p.id === id)) throw new CliError("not_found", `No identity proof ${JSON.stringify(id)} (ghostly identity list)`);
|
|
2454
2492
|
await node(ctx).shareIdentityProof({
|
|
@@ -2461,7 +2499,7 @@ var IDENTITY_METHODS = {
|
|
|
2461
2499
|
};
|
|
2462
2500
|
},
|
|
2463
2501
|
async "identity.withdraw"(ctx, params) {
|
|
2464
|
-
const link =
|
|
2502
|
+
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true), state(ctx).groups);
|
|
2465
2503
|
const id = str(params, "id", true);
|
|
2466
2504
|
if (!link.identities?.shared.some((s) => s.id === id)) throw new CliError("not_found", `No identity proof ${JSON.stringify(id)} shared in this chat (ghostly identity contact ${link.id})`);
|
|
2467
2505
|
await node(ctx).withdrawIdentityProof({
|
|
@@ -2858,7 +2896,7 @@ var SERVICE_METHODS = {
|
|
|
2858
2896
|
};
|
|
2859
2897
|
},
|
|
2860
2898
|
async "service.share"(ctx, params) {
|
|
2861
|
-
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true));
|
|
2899
|
+
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true), state(ctx).groups);
|
|
2862
2900
|
const shared = !bool(params, "off");
|
|
2863
2901
|
const serviceId = serviceOf(ctx, params);
|
|
2864
2902
|
await node(ctx).setServiceShared({
|
|
@@ -3613,7 +3651,7 @@ var WALLET_METHODS = Object.fromEntries(Object.entries({
|
|
|
3613
3651
|
let n;
|
|
3614
3652
|
let note;
|
|
3615
3653
|
if (params.chat !== void 0 && !isInvoice(text)) throw new CliError("usage", "--chat names the chat an invoice came from: an address's or LNURL's invoice is its server's");
|
|
3616
|
-
const chat = params.chat === void 0 ? void 0 :
|
|
3654
|
+
const chat = params.chat === void 0 ? void 0 : findOwnNamedChat(state(ctx).links, str(params, "chat", true), state(ctx).groups);
|
|
3617
3655
|
if (chat) inviteTaken(chat);
|
|
3618
3656
|
if (isInvoice(text)) n = network(params);
|
|
3619
3657
|
else if (isLnurl(text)) {
|
|
@@ -3665,7 +3703,7 @@ var WALLET_METHODS = Object.fromEntries(Object.entries({
|
|
|
3665
3703
|
/** Ecash to a contact in a chat (the payment sheet's Pay). */
|
|
3666
3704
|
async "chat.pay"(ctx, params) {
|
|
3667
3705
|
const memo = memoOf(params, "pay");
|
|
3668
|
-
const link =
|
|
3706
|
+
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true), state(ctx).groups);
|
|
3669
3707
|
inviteTaken(link);
|
|
3670
3708
|
const amount = num(params, "amount", 0, { min: 1 });
|
|
3671
3709
|
if (!amount) throw new CliError("bad_request", "amount is required");
|
|
@@ -3716,7 +3754,7 @@ var WALLET_METHODS = Object.fromEntries(Object.entries({
|
|
|
3716
3754
|
},
|
|
3717
3755
|
/** Pays a request the contact made in a chat. */
|
|
3718
3756
|
async "chat.payRequest"(ctx, params) {
|
|
3719
|
-
const link =
|
|
3757
|
+
const link = findOwnNamedChat(state(ctx).links, str(params, "chat", true), state(ctx).groups);
|
|
3720
3758
|
const paymentId = str(params, "payment", true);
|
|
3721
3759
|
const request = state(ctx).payments[paymentId];
|
|
3722
3760
|
if (!request || request.linkId !== link.id || request.kind !== "request") throw new CliError("not_found", `No request ${paymentId} in this chat`);
|
|
@@ -3867,17 +3905,21 @@ function relayRefused(error, patch) {
|
|
|
3867
3905
|
].filter((key) => Object.hasOwn(patch, key));
|
|
3868
3906
|
return new CliError("bad_request", `${keys.join(", ") || "relays"}: ${error.message.replace(/^Enter /, "give ").replace(/^(Not|Use) /, (word) => word.toLowerCase())}`);
|
|
3869
3907
|
}
|
|
3870
|
-
/** The engine keeps a chat's name to 48
|
|
3871
|
-
var
|
|
3908
|
+
/** The engine keeps a chat's name to 48 characters (code points: `renameLink`). */
|
|
3909
|
+
var CHAT_NAME_LENGTH = 48;
|
|
3872
3910
|
/**
|
|
3873
|
-
* A chat's name on this side (`chat rename`, an invite's `--label`)
|
|
3874
|
-
*
|
|
3875
|
-
*
|
|
3911
|
+
* A chat's name on this side (`chat rename`, an invite's `--label`), as the engine stores it (`cleanName`): a tab or a
|
|
3912
|
+
* line break is a space, invisible characters go, and what is left is counted. Longer than the engine keeps whole is
|
|
3913
|
+
* 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.
|
|
3876
3915
|
*/
|
|
3877
3916
|
function chatName(params, name) {
|
|
3878
3917
|
const value = str(params, name);
|
|
3879
|
-
if (value
|
|
3880
|
-
|
|
3918
|
+
if (value === void 0 || !value.trim()) return value === void 0 ? void 0 : "";
|
|
3919
|
+
const clean = cleanName(value, CHAT_NAME_LENGTH);
|
|
3920
|
+
if (clean === void 0) throw new CliError("bad_request", `A chat's name is up to ${CHAT_NAME_LENGTH} characters on one line`);
|
|
3921
|
+
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)`);
|
|
3922
|
+
return clean;
|
|
3881
3923
|
}
|
|
3882
3924
|
/** Code points before `index` (UTF-16) in `text`: mentions count code points (WISP 902 § Mentions). */
|
|
3883
3925
|
var codePoints = (text, index) => [...text.slice(0, index)].length;
|
|
@@ -4031,6 +4073,7 @@ var METHODS = {
|
|
|
4031
4073
|
if (kind === "strings" && !(Array.isArray(value) && value.every((v) => typeof v === "string"))) throw new CliError("bad_request", `${key} must be a list of strings`);
|
|
4032
4074
|
if (kind === "string" && typeof value !== "string") throw new CliError("bad_request", `${key} must be a string`);
|
|
4033
4075
|
if (kind === "boolean" && typeof value !== "boolean") throw new CliError("bad_request", `${key} must be true or false`);
|
|
4076
|
+
if (key === "relays" && value.length && !value.some(normalizeRelayUrl)) throw relayRefused(new Error(relayUrlProblem(value[0]) ?? ""), { relays: value });
|
|
4034
4077
|
if (key === "nick") {
|
|
4035
4078
|
patch.nick = checkShownName(value, key);
|
|
4036
4079
|
guardText(patch.nick, bool(params, "force"), "nick", "set it");
|
|
@@ -4403,8 +4446,13 @@ var METHODS = {
|
|
|
4403
4446
|
async "chat.delete"(ctx, params) {
|
|
4404
4447
|
if (bool(params, "everyone")) {
|
|
4405
4448
|
const target = chatOrGroup(ctx, str(params, "chat", true));
|
|
4406
|
-
const wait = oneOf(params, "wait", [
|
|
4407
|
-
|
|
4449
|
+
const wait = oneOf(params, "wait", [
|
|
4450
|
+
"none",
|
|
4451
|
+
"confirmed",
|
|
4452
|
+
"sent"
|
|
4453
|
+
], ctx.mode !== "one-shot" ? "none" : target.group ? "sent" : "confirmed");
|
|
4454
|
+
if (target.group && wait === "confirmed") throw new CliError("bad_request", "A group has no receipts: --wait confirmed is for a chat (--wait sent waits until a member's edge took it)");
|
|
4455
|
+
if (!target.group && wait === "sent") throw new CliError("bad_request", "--wait sent is for a group: a chat's removal waits with --wait confirmed");
|
|
4408
4456
|
const ms = num(params, "timeout", 30, {
|
|
4409
4457
|
min: 1,
|
|
4410
4458
|
max: 3600
|
|
@@ -4417,12 +4465,22 @@ var METHODS = {
|
|
|
4417
4465
|
messageId: message.id
|
|
4418
4466
|
});
|
|
4419
4467
|
if (result.error) throw new CliError(result.refused ? "refused" : "unavailable", result.error);
|
|
4420
|
-
if (target.group)
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4468
|
+
if (target.group) {
|
|
4469
|
+
const e = result.e;
|
|
4470
|
+
const edges = !e ? 0 : wait === "sent" ? await waitForGroupFrame(ctx, target.id, message.id, e, ms) : node(ctx).groupTaken({
|
|
4471
|
+
groupId: target.id,
|
|
4472
|
+
messageId: message.id,
|
|
4473
|
+
edit: e
|
|
4474
|
+
});
|
|
4475
|
+
return {
|
|
4476
|
+
group: target.id,
|
|
4477
|
+
messageId: message.id,
|
|
4478
|
+
deleted: message.id,
|
|
4479
|
+
everyone: true,
|
|
4480
|
+
sent: edges > 0,
|
|
4481
|
+
edges
|
|
4482
|
+
};
|
|
4483
|
+
}
|
|
4426
4484
|
if (wait === "confirmed") await waitForRemoval(ctx, target.linkId, message.id, ms);
|
|
4427
4485
|
return {
|
|
4428
4486
|
chat: target.id,
|
|
@@ -4554,7 +4612,8 @@ var METHODS = {
|
|
|
4554
4612
|
}, ms, `chat ${link.id} to be ${until}`));
|
|
4555
4613
|
},
|
|
4556
4614
|
async "group.create"(ctx, params) {
|
|
4557
|
-
const
|
|
4615
|
+
const clean = cleanName(str(params, "name", true), 64);
|
|
4616
|
+
const name = clean && groupName(clean);
|
|
4558
4617
|
if (!name) throw new CliError("bad_request", `A group's name is 1 to 64 characters on one line`);
|
|
4559
4618
|
guardText(name, bool(params, "force"), "group's name", "create it");
|
|
4560
4619
|
const profile = oneOf(params, "profile", ["community", "mesh"], "community");
|
|
@@ -4945,7 +5004,7 @@ function notAGroup(ctx, params, chat, hint) {
|
|
|
4945
5004
|
} catch (error) {
|
|
4946
5005
|
if (!(error instanceof CliError) || error.code !== "not_found") throw error;
|
|
4947
5006
|
const ref = str(params, "chat", true);
|
|
4948
|
-
const named =
|
|
5007
|
+
const named = groupPrefixed(ref) ?? ref;
|
|
4949
5008
|
let group;
|
|
4950
5009
|
try {
|
|
4951
5010
|
group = findGroup(state(ctx).groups, named);
|
|
@@ -5092,4 +5151,4 @@ async function callApi(ctx, method, params = {}) {
|
|
|
5092
5151
|
//#endregion
|
|
5093
5152
|
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 };
|
|
5094
5153
|
|
|
5095
|
-
//# sourceMappingURL=api-
|
|
5154
|
+
//# sourceMappingURL=api-EUGHGnRz.js.map
|