@ghostlytools/cli 1.5.3 → 1.5.5
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 +2 -2
- package/dist/assets/{api-BIg0Msax.js → api-ButrHieZ.js} +2 -2
- package/dist/assets/{api-d2aXkbM5.js → api-DDmune9b.js} +24 -19
- package/dist/assets/api-DDmune9b.js.map +1 -0
- package/dist/assets/{apiKit-Ba_t7MZO.js → apiKit-DfFlJhXO.js} +3 -3
- package/dist/assets/{apiKit-Ba_t7MZO.js.map → apiKit-DfFlJhXO.js.map} +1 -1
- package/dist/assets/{apps-B_F3gEI4.js → apps-BVnNpB2f.js} +1 -1
- package/dist/assets/{apps-CJo1MmSY.js → apps-CpQVuYqT.js} +4 -4
- package/dist/assets/{apps-CJo1MmSY.js.map → apps-CpQVuYqT.js.map} +1 -1
- package/dist/assets/{arkade-DTne0O3Q.js → arkade-C9Ne-zJb.js} +2 -2
- package/dist/assets/{arkade-DTne0O3Q.js.map → arkade-C9Ne-zJb.js.map} +1 -1
- package/dist/assets/{backup-CqpDAZZG.js → backup-DavZrUf6.js} +1 -1
- package/dist/assets/{backup-BY88aZr5.js → backup-MN2sZQeW.js} +7 -7
- package/dist/assets/{backup-BY88aZr5.js.map → backup-MN2sZQeW.js.map} +1 -1
- package/dist/assets/{blobFiles-B1lX6iGy.js → blobFiles-B6nf0gCG.js} +3 -3
- package/dist/assets/{blobFiles-B1lX6iGy.js.map → blobFiles-B6nf0gCG.js.map} +1 -1
- package/dist/assets/buttons-DC20Q2no.js +2 -0
- package/dist/assets/{buttons-B5EnA2nh.js → buttons-DIWDW2n5.js} +4 -4
- package/dist/assets/{buttons-B5EnA2nh.js.map → buttons-DIWDW2n5.js.map} +1 -1
- package/dist/assets/{daemonProof-Dx3N_DLC.js → daemonProof-ui8jtIw0.js} +2 -2
- package/dist/assets/{daemonProof-Dx3N_DLC.js.map → daemonProof-ui8jtIw0.js.map} +1 -1
- package/dist/assets/{envelope-BU-BB1wR.js → envelope-ByeUit1N.js} +2 -2
- package/dist/assets/{envelope-BU-BB1wR.js.map → envelope-ByeUit1N.js.map} +1 -1
- package/dist/assets/{errors-DI6Z3jTH.js → errors-CzXgR8Cc.js} +14 -4
- package/dist/assets/errors-CzXgR8Cc.js.map +1 -0
- package/dist/assets/{fileBytes-D85lBh-Q.js → fileBytes-BMEBas7S.js} +3 -3
- package/dist/assets/{fileBytes-D85lBh-Q.js.map → fileBytes-BMEBas7S.js.map} +1 -1
- package/dist/assets/{fileBytes-D0CYuRwZ.js → fileBytes-CFNrRfcl.js} +2 -2
- package/dist/assets/{fileBytes-D0CYuRwZ.js.map → fileBytes-CFNrRfcl.js.map} +1 -1
- package/dist/assets/{fileBytes-BMlLVdfg.js → fileBytes-CtwagJ8h.js} +1 -1
- package/dist/assets/{fileBytesIdb-LAhH7kY2.js → fileBytesIdb-BXAN7i-N.js} +3 -3
- package/dist/assets/{fileBytesIdb-LAhH7kY2.js.map → fileBytesIdb-BXAN7i-N.js.map} +1 -1
- package/dist/assets/fileBytesIdb-C20oXDdr.js +2 -0
- package/dist/assets/{fileBytesOpfs-DjBBghvq.js → fileBytesOpfs-Do1Vpkis.js} +3 -3
- package/dist/assets/{fileBytesOpfs-DjBBghvq.js.map → fileBytesOpfs-Do1Vpkis.js.map} +1 -1
- package/dist/assets/{groupFiles-D9k6fyhf.js → groupFiles-DVxX0O1g.js} +5 -5
- package/dist/assets/groupFiles-DVxX0O1g.js.map +1 -0
- package/dist/assets/{host-DrL7FPG4.js → host-AB2Cr46b.js} +16 -15
- package/dist/assets/host-AB2Cr46b.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-C-BsT6_V.js → hyperdhtRelay-BcrwJRtb.js} +2 -2
- package/dist/assets/{hyperdhtRelay-C-BsT6_V.js.map → hyperdhtRelay-BcrwJRtb.js.map} +1 -1
- package/dist/assets/{idb-CWvq4HKc.js → idb-BlH8-O3R.js} +11 -3
- package/dist/assets/{idb-CWvq4HKc.js.map → idb-BlH8-O3R.js.map} +1 -1
- package/dist/assets/{irohWeb-DdHXEwgj.js → irohWeb-B5j2rgWj.js} +2 -2
- package/dist/assets/{irohWeb-DdHXEwgj.js.map → irohWeb-B5j2rgWj.js.map} +1 -1
- package/dist/assets/{main-xeoX7yLM.js → main-CPCNBewr.js} +84 -29
- package/dist/assets/main-CPCNBewr.js.map +1 -0
- package/dist/assets/{mainline-CEqGvRYJ.js → mainline-afyQ77bv.js} +2 -2
- package/dist/assets/{mainline-CEqGvRYJ.js.map → mainline-afyQ77bv.js.map} +1 -1
- package/dist/assets/{networkReason-RGRU5xoa.js → networkReason-DWzsMN8E.js} +3 -3
- package/dist/assets/{networkReason-RGRU5xoa.js.map → networkReason-DWzsMN8E.js.map} +1 -1
- package/dist/assets/{nwc-s5xHLqNf.js → nwc-DYXTp8UX.js} +3 -3
- package/dist/assets/{nwc-s5xHLqNf.js.map → nwc-DYXTp8UX.js.map} +1 -1
- package/dist/assets/{nwcProvider-CfAFO5Fr.js → nwcProvider-B4k6mYJl.js} +2 -2
- package/dist/assets/{nwcProvider-CfAFO5Fr.js.map → nwcProvider-B4k6mYJl.js.map} +1 -1
- package/dist/assets/{profiles-gZdQPyaz.js → profiles-CEnZfN78.js} +2 -2
- package/dist/assets/{profiles-gZdQPyaz.js.map → profiles-CEnZfN78.js.map} +1 -1
- package/dist/assets/{registry-BUhSjM-J.js → registry-Ccru6KBP.js} +1 -1
- package/dist/assets/{registry-CVUdD4bJ.js → registry-wSZHgbsv.js} +3 -3
- package/dist/assets/{registry-CVUdD4bJ.js.map → registry-wSZHgbsv.js.map} +1 -1
- package/dist/assets/{resolve-uZECJ3f7.js → resolve-BPJnMtLC.js} +2 -2
- package/dist/assets/{resolve-uZECJ3f7.js.map → resolve-BPJnMtLC.js.map} +1 -1
- package/dist/assets/{restoredRows-D6WZUA2U.js → restoredRows-Fv-MuY45.js} +2 -2
- package/dist/assets/{restoredRows-D6WZUA2U.js.map → restoredRows-Fv-MuY45.js.map} +1 -1
- package/dist/assets/{server-DOtUKoYR.js → server-DPzt5V2x.js} +236 -54
- package/dist/assets/server-DPzt5V2x.js.map +1 -0
- package/dist/assets/{src-Dd_7Ew1X.js → src-CFeRBeHz.js} +60 -6
- package/dist/assets/{src-Dd_7Ew1X.js.map → src-CFeRBeHz.js.map} +1 -1
- package/dist/assets/{usdt-C2Anx8p7.js → usdt-CBh78JVF.js} +3 -3
- package/dist/assets/{usdt-C2Anx8p7.js.map → usdt-CBh78JVF.js.map} +1 -1
- package/dist/assets/{words-DoLU6p8H.js → words-DC8BQvPO.js} +2 -2
- package/dist/assets/{words-DoLU6p8H.js.map → words-DC8BQvPO.js.map} +1 -1
- package/dist/ghostly.mjs +1 -1
- package/examples/payment-bot.mjs +5 -2
- package/package.json +1 -1
- package/dist/assets/api-d2aXkbM5.js.map +0 -1
- package/dist/assets/buttons-azvbN6xn.js +0 -2
- package/dist/assets/errors-DI6Z3jTH.js.map +0 -1
- package/dist/assets/fileBytesIdb-Dn9levD1.js +0 -2
- package/dist/assets/groupFiles-D9k6fyhf.js.map +0 -1
- package/dist/assets/host-DrL7FPG4.js.map +0 -1
- package/dist/assets/main-xeoX7yLM.js.map +0 -1
- package/dist/assets/server-DOtUKoYR.js.map +0 -1
package/README.md
CHANGED
|
@@ -114,9 +114,9 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
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
115
|
| `chat history <chat> [--limit n] [--before x] [--after x]` | Messages, oldest first; `x` is a message id or a time in ms |
|
|
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
|
-
| `chat pay <chat> <sats> [--memo t] [--network n] [--confirm-real]` | Ecash to a contact |
|
|
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 |
|
|
119
|
-
| `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 |
|
|
119
|
+
| `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 |
|
|
120
120
|
| `chat transport <chat> <auto\|dht\|webrtc\|iroh\|hyperdht>` | What carries the chat |
|
|
121
121
|
| `chat verify <chat> --code <code>` | Mark the contact verified after comparing the codes out of band |
|
|
122
122
|
| `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 |
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as findChat, s as findGroup } from "./apiKit-
|
|
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-
|
|
1
|
+
import { a as findChat, s as findGroup } from "./apiKit-DfFlJhXO.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-DDmune9b.js";
|
|
3
3
|
export { API_METHODS, SETTABLE, callApi, findChat, findGroup, groupSendRefused, hideStateSecrets, mentionsFor, redactSettings };
|
|
@@ -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-
|
|
2
|
-
import { u as fileStore } from "./idb-
|
|
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-
|
|
4
|
-
import { f as FILE_BYTES_STEP, o as fileBytes, s as fileBytesOf } from "./fileBytes-
|
|
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-
|
|
8
|
-
import { i as localFileError, r as asCliError, t as CliError } from "./errors-
|
|
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-
|
|
10
|
-
import { a as checkShownName } from "./profiles-
|
|
11
|
-
import { t as BACKUP_METHODS } from "./backup-
|
|
12
|
-
import { o as checkedBundle } from "./apps-
|
|
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-CFeRBeHz.js";
|
|
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-DVxX0O1g.js";
|
|
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-wSZHgbsv.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-DIWDW2n5.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-DC8BQvPO.js";
|
|
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-DfFlJhXO.js";
|
|
10
|
+
import { a as checkShownName } from "./profiles-CEnZfN78.js";
|
|
11
|
+
import { t as BACKUP_METHODS } from "./backup-MN2sZQeW.js";
|
|
12
|
+
import { o as checkedBundle } from "./apps-CpQVuYqT.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";
|
|
@@ -3106,11 +3106,11 @@ var isLnurl = (text) => /^(lightning:)?lnurl[0-9a-z]+$/i.test(text.trim()) || /^
|
|
|
3106
3106
|
* its shape: the engine's `EngineError` carries `engineCode`.
|
|
3107
3107
|
*/
|
|
3108
3108
|
/** A payment's memo: the contact reads it as a message's text, so the secret guard of `send` holds (docs/CLI.md § Safety). */
|
|
3109
|
-
function memoOf(params, verb) {
|
|
3110
|
-
const memo = str(params,
|
|
3109
|
+
function memoOf(params, verb, field = "memo") {
|
|
3110
|
+
const memo = str(params, field);
|
|
3111
3111
|
if (memo && !bool(params, "force")) {
|
|
3112
3112
|
const secret = findSecret(memo);
|
|
3113
|
-
if (secret) throw new CliError("confirm", `The
|
|
3113
|
+
if (secret) throw new CliError("confirm", `The ${field} looks like ${secret.kind === "cashu" ? "a Cashu token (money anyone who reads it can take)" : "a secret (a seed or a private key)"}; ${verb} with --force if you mean to`, { kind: secret.kind });
|
|
3114
3114
|
}
|
|
3115
3115
|
return memo || void 0;
|
|
3116
3116
|
}
|
|
@@ -3310,6 +3310,7 @@ var WALLET_METHODS = Object.fromEntries(Object.entries({
|
|
|
3310
3310
|
},
|
|
3311
3311
|
/** An invoice, a Lightning address or an LNURL, from the network's Lightning (a card of it, or its default). */
|
|
3312
3312
|
async "pay"(ctx, params) {
|
|
3313
|
+
const comment = memoOf(params, "pay", "comment");
|
|
3313
3314
|
const text = str(params, "target", true).trim();
|
|
3314
3315
|
const card = str(params, "card");
|
|
3315
3316
|
let invoice = text.replace(/^lightning:/i, "");
|
|
@@ -3328,7 +3329,7 @@ var WALLET_METHODS = Object.fromEntries(Object.entries({
|
|
|
3328
3329
|
const got = await node(ctx).lnurlInvoice({
|
|
3329
3330
|
id: view.id,
|
|
3330
3331
|
amount,
|
|
3331
|
-
...
|
|
3332
|
+
...comment ? { comment } : {},
|
|
3332
3333
|
network: n
|
|
3333
3334
|
});
|
|
3334
3335
|
invoice = got.invoice;
|
|
@@ -4443,14 +4444,18 @@ var ENGINE_SENDS = /* @__PURE__ */ new Set([
|
|
|
4443
4444
|
"sendPayment",
|
|
4444
4445
|
"requestPayment",
|
|
4445
4446
|
"requestGroupPayment",
|
|
4446
|
-
"askToPay"
|
|
4447
|
+
"askToPay",
|
|
4448
|
+
"preparePayment",
|
|
4449
|
+
"fedimintInvoice",
|
|
4450
|
+
"lnurlInvoice"
|
|
4447
4451
|
]);
|
|
4448
4452
|
async function guardEngineSend(ctx, method, args) {
|
|
4449
4453
|
let texts = [
|
|
4450
4454
|
args.text,
|
|
4451
4455
|
args.card,
|
|
4452
4456
|
args.caption,
|
|
4453
|
-
args.memo
|
|
4457
|
+
args.memo,
|
|
4458
|
+
args.comment
|
|
4454
4459
|
];
|
|
4455
4460
|
if (method === "forwardMessages") {
|
|
4456
4461
|
const ids = Array.isArray(args.messageIds) ? args.messageIds.filter((id) => typeof id === "string") : [];
|
|
@@ -4658,4 +4663,4 @@ async function callApi(ctx, method, params = {}) {
|
|
|
4658
4663
|
//#endregion
|
|
4659
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 };
|
|
4660
4665
|
|
|
4661
|
-
//# sourceMappingURL=api-
|
|
4666
|
+
//# sourceMappingURL=api-DDmune9b.js.map
|