@ghostlytools/cli 1.6.0 → 1.7.0
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 +21 -4
- package/dist/assets/{api-Dt0zan2-.js → api-BIqr8SpM.js} +9 -9
- package/dist/assets/{api-Dt0zan2-.js.map → api-BIqr8SpM.js.map} +1 -1
- package/dist/assets/{api--A27YnXu.js → api-BnCmJLiQ.js} +2 -2
- package/dist/assets/{apiKit-Bic3_V6V.js → apiKit-CWalYh1t.js} +2 -2
- package/dist/assets/{apiKit-Bic3_V6V.js.map → apiKit-CWalYh1t.js.map} +1 -1
- package/dist/assets/{apps-mKn2UJOu.js → apps-Bx3tXbJ9.js} +2 -2
- package/dist/assets/{apps-mKn2UJOu.js.map → apps-Bx3tXbJ9.js.map} +1 -1
- package/dist/assets/{apps-wz_jQ_JD.js → apps-_hVUaHIT.js} +1 -1
- package/dist/assets/{arkade-Ds-kFF3w.js → arkade-AxrcyS1C.js} +2 -2
- package/dist/assets/{arkade-Ds-kFF3w.js.map → arkade-AxrcyS1C.js.map} +1 -1
- package/dist/assets/{backup-BzhzeQMo.js → backup-Y1V1Yxqr.js} +4 -4
- package/dist/assets/{backup-BzhzeQMo.js.map → backup-Y1V1Yxqr.js.map} +1 -1
- package/dist/assets/{backup-BgM_lskM.js → backup-d_XvXpEK.js} +1 -1
- package/dist/assets/{buttons-Dq4tuXEE.js → buttons-BiQyQBb0.js} +3 -3
- package/dist/assets/{buttons-Dq4tuXEE.js.map → buttons-BiQyQBb0.js.map} +1 -1
- package/dist/assets/buttons-LO3Ql1Hd.js +2 -0
- package/dist/assets/{envelope-PwD8vda7.js → envelope-D3oeVhv8.js} +2 -2
- package/dist/assets/{envelope-PwD8vda7.js.map → envelope-D3oeVhv8.js.map} +1 -1
- package/dist/assets/{groupFiles-BxZ0R_e2.js → groupFiles-DU1wMGI9.js} +3 -3
- package/dist/assets/{groupFiles-BxZ0R_e2.js.map → groupFiles-DU1wMGI9.js.map} +1 -1
- package/dist/assets/{host-BUk43Gs5.js → host-DDMQfR7B.js} +8 -8
- package/dist/assets/{host-BUk43Gs5.js.map → host-DDMQfR7B.js.map} +1 -1
- package/dist/assets/{hyperdhtRelay-C3TF3MYd.js → hyperdhtRelay-B2v8eqRd.js} +2 -2
- package/dist/assets/{hyperdhtRelay-C3TF3MYd.js.map → hyperdhtRelay-B2v8eqRd.js.map} +1 -1
- package/dist/assets/{irohWeb-3j4AE5iy.js → irohWeb-9RVIbF_l.js} +2 -2
- package/dist/assets/{irohWeb-3j4AE5iy.js.map → irohWeb-9RVIbF_l.js.map} +1 -1
- package/dist/assets/{main-CRpIo2aG.js → main-BNwNEPEy.js} +70 -25
- package/dist/assets/main-BNwNEPEy.js.map +1 -0
- package/dist/assets/{mainline-DOZO9JX0.js → mainline-RXv5_Fby.js} +2 -2
- package/dist/assets/{mainline-DOZO9JX0.js.map → mainline-RXv5_Fby.js.map} +1 -1
- package/dist/assets/{networkReason-CmuzZ0iS.js → networkReason-CIn4yN9h.js} +2 -2
- package/dist/assets/{networkReason-CmuzZ0iS.js.map → networkReason-CIn4yN9h.js.map} +1 -1
- package/dist/assets/{nwc-C4scgLOx.js → nwc-BNPzuT-6.js} +3 -3
- package/dist/assets/{nwc-C4scgLOx.js.map → nwc-BNPzuT-6.js.map} +1 -1
- package/dist/assets/{nwcProvider-DNqnRGj4.js → nwcProvider-C9Y6PUNC.js} +2 -2
- package/dist/assets/{nwcProvider-DNqnRGj4.js.map → nwcProvider-C9Y6PUNC.js.map} +1 -1
- package/dist/assets/{registry-C-UBjvCc.js → registry-B9aYHNNf.js} +3 -3
- package/dist/assets/registry-B9aYHNNf.js.map +1 -0
- package/dist/assets/{registry-4cyOe4FI.js → registry-DOkDhUAu.js} +1 -1
- package/dist/assets/{resolve-BTQyQYzW.js → resolve-imkCgogd.js} +2 -2
- package/dist/assets/{resolve-BTQyQYzW.js.map → resolve-imkCgogd.js.map} +1 -1
- package/dist/assets/{server-CwR20_p5.js → server-CB9_JuWZ.js} +12 -12
- package/dist/assets/{server-CwR20_p5.js.map → server-CB9_JuWZ.js.map} +1 -1
- package/dist/assets/{src-D3M3UPVO.js → src-BBG_NwMc.js} +155 -4
- package/dist/assets/src-BBG_NwMc.js.map +1 -0
- package/dist/assets/translate-BcP139SV.js +1067 -0
- package/dist/assets/translate-BcP139SV.js.map +1 -0
- package/dist/assets/{usdt-Bet4_yNL.js → usdt-C5Gf9-IC.js} +3 -3
- package/dist/assets/{usdt-Bet4_yNL.js.map → usdt-C5Gf9-IC.js.map} +1 -1
- package/dist/assets/{words-CHas8X7A.js → words-ZUiQo4yo.js} +2 -2
- package/dist/assets/{words-CHas8X7A.js.map → words-ZUiQo4yo.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/buttons-D6kjMAsr.js +0 -2
- package/dist/assets/main-CRpIo2aG.js.map +0 -1
- package/dist/assets/registry-C-UBjvCc.js.map +0 -1
- package/dist/assets/src-D3M3UPVO.js.map +0 -1
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
112
112
|
| `call start <chat> [--rate 48000]`, `call answer [<chat\|call>] [--rate n]` | Voice calls (daemon): the result names the call's audio socket ([Calls](#calls)) |
|
|
113
113
|
| `chat accept <chat> <method> [--off] [--networks mainnet,testnet]` | Which ways of paying the chat takes |
|
|
114
114
|
| `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)) |
|
|
115
|
-
| `chat history <chat> [--limit n] [--before x] [--after x]` | Messages, oldest first; `x` is a message id or a time in ms |
|
|
115
|
+
| `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)) |
|
|
116
116
|
| `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` |
|
|
117
117
|
| `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) |
|
|
118
118
|
| `chat rename <chat> <name>`, `chat remove <chat> --yes` | Name it here; delete it (keys and history) here |
|
|
@@ -123,7 +123,7 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
123
123
|
| `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)); `restart` stops it and starts this release's code in the background ([After an upgrade](#after-an-upgrade)). Ctrl-C, SIGTERM and the terminal closing (SIGHUP) stop it cleanly |
|
|
124
124
|
| `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 |
|
|
125
125
|
| `engine <method> [json \| -] [--confirm-real] [--show-secret] [--yes] [--force]`, `engine --list [--verbose]` | Any call of the app's engine; `--verbose` lists what each takes (`{ linkId, label }`, `?` for an optional key). A call given less than it takes is refused as `bad_request`. One that deletes chats or groups (`clearProfileData`, `removeLink`, `leaveGroup`, `forgetGroup`, `deviceRemove`) needs `--yes`; `clearProfileData` answers what it removed and stops a daemon. One that sends a text that looks like a secret (`sendMessage`, `sendGroupMessage`, `editMessage`, `forwardMessages`) needs `--force` |
|
|
126
|
-
| `events [--since seq]` | What the event journal holds, without following |
|
|
126
|
+
| `events [--since seq] [--translate lang]` | What the event journal holds, without following ([Translation](#translation)) |
|
|
127
127
|
| `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). A file's id names its chat or its group, so `<chat>` may be left out |
|
|
128
128
|
| `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) |
|
|
129
129
|
| `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 (the answer's `path` is what was written). Never over a file without `--force`; an unfinished one says how many bytes are here; `--wait` waits for it first |
|
|
@@ -148,7 +148,7 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
148
148
|
| `invite create [--label <name>]` | A new chat's `ghostly1…` invite and its link |
|
|
149
149
|
| `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 |
|
|
150
150
|
| `lightning default <card>`, `lightning rename <card> <name>` | Lightning cards: which receives by default |
|
|
151
|
-
| `listen [--since seq] [--cursor file] [--type t]… [--turns] [--from <chat\|key>]… [--group <group>]… [--exec cmd] [--webhook url] [--print]` | The event stream; `--from` and `--group` an allowlist, `--turns` one `agent.turn` per message to answer ([Events](#events)) |
|
|
151
|
+
| `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)) |
|
|
152
152
|
| `message delete <chat\|group> <message> --everyone` | 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. 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) |
|
|
153
153
|
| `message retry\|delete\|details <chat> <message>` | One message |
|
|
154
154
|
| `pay <invoice\|address\|lnurl> [--amount sats] [--network n] [--max-fee sats] [--confirm-real]` | Pay over Lightning (Testnet unless `--network mainnet`) |
|
|
@@ -352,7 +352,7 @@ chat (`chat list`, `chat show`, `chat rename`, …) and `engine getState` print
|
|
|
352
352
|
- `--turns`: one `agent.turn` event per `message.received`, and per `group.message` that mentions this profile (or
|
|
353
353
|
`group.mentioned`, `source: "group.mentioned"`, for a mention learned later):
|
|
354
354
|
`{seq, id: "agent.turn:<source>:<chat | group>:<messageId>", type, at, source, chat | group + member, messageId, timestamp, press?, untrusted:
|
|
355
|
-
{text, name, messageId, replyTo?: {id, snippet}, file?: {id, name, size, mime, voice}}}`. `messageId` is made here
|
|
355
|
+
{text, name, messageId, replyTo?: {id, snippet}, file?: {id, name, size, mime, voice}, translation?: {from, text}}}`. `messageId` is made here
|
|
356
356
|
(`t_` and 32 hex digits) and every command that takes a message takes it; the id the message is stored under, which
|
|
357
357
|
its sender chose most of, is `untrusted.messageId`. `press` (`{messageId, button, label,
|
|
358
358
|
inferred?}`): the message pressed a button of yours, as `button.pressed` says. `seq` is the source's (cursors
|
|
@@ -366,10 +366,27 @@ chat (`chat list`, `chat show`, `chat rename`, …) and `engine getState` print
|
|
|
366
366
|
apart, and the cursor stays before it until the bridge takes it. A 4xx or a redirect (not followed) passes the event
|
|
367
367
|
as not taken.
|
|
368
368
|
- With no daemon running, `listen` becomes the daemon (socket included), so a hook can answer with `ghostly send`.
|
|
369
|
+
- `--translate <lang>`: received messages carry a translation ([Translation](#translation)).
|
|
369
370
|
|
|
370
371
|
As the app's chat screen does, the side that joined a chat says `👋 <name> joined` once it first goes live, and the
|
|
371
372
|
side that invited answers once.
|
|
372
373
|
|
|
374
|
+
### Translation
|
|
375
|
+
|
|
376
|
+
`listen`, `events` and `chat history` take `--translate <lang>` (an ISO 639 code: `en`, `pt`, `es`...). A message a
|
|
377
|
+
contact or a member sent, in another language, then carries `translation: {from, text}` beside its `text`: `from` is
|
|
378
|
+
the language it was written in. It is made on this machine by the translation runtime the Desktop app downloads; the
|
|
379
|
+
CLI fetches nothing. Mine, files, payments, cards, the group's own lines, join notices, text the language detector is
|
|
380
|
+
not sure of (a few letters on their own take the language the chat's others last wrote with confidence) and a language
|
|
381
|
+
with no model stay as they are, without the field. With `--turns` it is `untrusted.translation`: the sender's words,
|
|
382
|
+
as the text is.
|
|
383
|
+
|
|
384
|
+
The runtime is found in the data folder (`--home`, `~/.ghostly` by default): `translation-runtime/<version>/` holds the
|
|
385
|
+
unpacked runtime and `translation-models/<from>-<to>/` each model (a pair with English on neither side goes through
|
|
386
|
+
English, so `es-en` and `en-pt` for Spanish to Portuguese). When the runtime is not there, the command says so in one
|
|
387
|
+
line on stderr and prints what it prints without the flag. One runtime process serves a whole `listen` and ends with
|
|
388
|
+
it. A message's text never goes to stderr or a log.
|
|
389
|
+
|
|
373
390
|
## The socket API
|
|
374
391
|
|
|
375
392
|
The daemon listens on a Unix socket in the profile's folder (`daemon.sock`, 0600; in `ghostly-<hash>/` in
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Do as GhostlyHttpError, Ec as APP_PERMISSIONS, Ir as sanitizeTypingStatus, Nr as TYPING_KINDS, Pr as TYPING_REFRESH_MS, Qa as appCardId, Uc as isAppRef, Wi as identityStatement, Wn as GROUP_FILE_LIMITS, Xa as STATUS_CARD_LIMITS, Y as groupName, Yc as readImageMeta, _a as voiceDownloadName, _u as toBase64Url, ca as sanitizeFileName, da as VOICE_LIMITS, dl as ownInviteRefusal, du as sanitizeAvatar, eo as cardLine, fa as VOICE_METER, ga as parseVoiceMeta, gu as randomBytes$1, jc as isAppUrl, jo as LIMITS, la as sanitizeMime, ll as inviteLink, ma as downsamplePeaks, ni as APP_DATA_MAX_BYTES, no as checkStatusCard, pa as baseMime, ua as PLAYABLE_AUDIO, uu as MAX_AVATAR_LENGTH, va as voiceLevel, xo as AWAITING_PEER_MS, zc as appRef } from "./src-
|
|
1
|
+
import { Do as GhostlyHttpError, Ec as APP_PERMISSIONS, Ir as sanitizeTypingStatus, Nr as TYPING_KINDS, Pr as TYPING_REFRESH_MS, Qa as appCardId, Uc as isAppRef, Wi as identityStatement, Wn as GROUP_FILE_LIMITS, Xa as STATUS_CARD_LIMITS, Y as groupName, Yc as readImageMeta, _a as voiceDownloadName, _u as toBase64Url, ca as sanitizeFileName, da as VOICE_LIMITS, dl as ownInviteRefusal, du as sanitizeAvatar, eo as cardLine, fa as VOICE_METER, ga as parseVoiceMeta, gu as randomBytes$1, jc as isAppUrl, jo as LIMITS, la as sanitizeMime, ll as inviteLink, ma as downsamplePeaks, ni as APP_DATA_MAX_BYTES, no as checkStatusCard, pa as baseMime, ua as PLAYABLE_AUDIO, uu as MAX_AVATAR_LENGTH, va as voiceLevel, xo as AWAITING_PEER_MS, zc as appRef } from "./src-BBG_NwMc.js";
|
|
2
2
|
import { u as fileStore } from "./idb-BlH8-O3R.js";
|
|
3
|
-
import { O as waitingGroupFile, T as removeStored, U as iceServerProblem, W as iceServerSetting, i as groupOfFile, l as replyRef, n as groupFileId, v as paymentNetwork } from "./groupFiles-
|
|
3
|
+
import { O as waitingGroupFile, T as removeStored, U as iceServerProblem, W as iceServerSetting, i as groupOfFile, l as replyRef, n as groupFileId, v as paymentNetwork } from "./groupFiles-DU1wMGI9.js";
|
|
4
4
|
import { f as FILE_BYTES_STEP, o as fileBytes, s as fileBytesOf } from "./fileBytes-BMEBas7S.js";
|
|
5
|
-
import { t as IDENTITY_PROVIDERS } from "./registry-
|
|
6
|
-
import { a as waitForEdit, c as findSecret, i as pressable, n as buttonsCard, o as waitForGroupFrame, s as waitForMessage, t as BUTTON_METHODS } from "./buttons-
|
|
7
|
-
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-
|
|
5
|
+
import { t as IDENTITY_PROVIDERS } from "./registry-B9aYHNNf.js";
|
|
6
|
+
import { a as waitForEdit, c as findSecret, i as pressable, n as buttonsCard, o as waitForGroupFrame, s as waitForMessage, t as BUTTON_METHODS } from "./buttons-BiQyQBb0.js";
|
|
7
|
+
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-ZUiQo4yo.js";
|
|
8
8
|
import { i as localFileError, r as asCliError, t as CliError } from "./errors-CzXgR8Cc.js";
|
|
9
|
-
import { _ as state, a as findChat, d as list, f as messageOf, g as sentAt, h as oneOf, i as chatOrGroup, l as groupOf, m as num, n as bool, o as findChatOrGroup, p as node, r as chatOf, s as findGroup, u as inviteTaken, v as str, y as waitForState } from "./apiKit-
|
|
9
|
+
import { _ as state, a as findChat, d as list, f as messageOf, g as sentAt, h as oneOf, i as chatOrGroup, l as groupOf, m as num, n as bool, o as findChatOrGroup, p as node, r as chatOf, s as findGroup, u as inviteTaken, v as str, y as waitForState } from "./apiKit-CWalYh1t.js";
|
|
10
10
|
import { a as checkShownName } from "./profiles-CEnZfN78.js";
|
|
11
|
-
import { t as BACKUP_METHODS } from "./backup-
|
|
12
|
-
import { o as checkedBundle } from "./apps-
|
|
11
|
+
import { t as BACKUP_METHODS } from "./backup-Y1V1Yxqr.js";
|
|
12
|
+
import { o as checkedBundle } from "./apps-Bx3tXbJ9.js";
|
|
13
13
|
import { generateMnemonic } from "@scure/bip39";
|
|
14
14
|
import { wordlist } from "@scure/bip39/wordlists/english.js";
|
|
15
15
|
import { openAsBlob, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
@@ -4663,4 +4663,4 @@ async function callApi(ctx, method, params = {}) {
|
|
|
4663
4663
|
//#endregion
|
|
4664
4664
|
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 };
|
|
4665
4665
|
|
|
4666
|
-
//# sourceMappingURL=api-
|
|
4666
|
+
//# sourceMappingURL=api-BIqr8SpM.js.map
|