@ghostlytools/cli 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/SKILL.md +1 -1
- package/dist/assets/argon2id-088uQfnH.js.map +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/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/dist/assets/fedimint_client_wasm_bg-BtHHlFpp.js.map +1 -1
- package/dist/assets/{hyperdhtRelay-CVLCuqVr.js → hyperdhtRelay-BoxPHp7v.js} +3 -3
- package/dist/assets/{hyperdhtRelay-CVLCuqVr.js.map → hyperdhtRelay-BoxPHp7v.js.map} +1 -1
- package/dist/assets/legacy_ciphers-JJOu0JXL.js.map +1 -1
- package/dist/assets/{mainline-CKFpwXcB.js → mainline-dkA94eh2.js} +2 -2
- package/dist/assets/{mainline-CKFpwXcB.js.map → mainline-dkA94eh2.js.map} +1 -1
- package/dist/assets/nacl-fast-CDhNCYHs.js.map +1 -1
- package/dist/assets/noble_curves-DDWn5AH0.js.map +1 -1
- package/dist/assets/noble_hashes-B7AZyFyS.js.map +1 -1
- package/dist/assets/openpgp-BBFr-zHQ.js.map +1 -1
- package/dist/assets/{server-vGoe9MET.js → server-CXFTDnFI.js} +285 -99
- package/dist/assets/server-CXFTDnFI.js.map +1 -0
- package/dist/assets/sha512-BYId-G-T.js.map +1 -1
- package/dist/assets/{src-CJdPTl7Q.js → src-K3NijMq-.js} +455 -87
- package/dist/assets/src-K3NijMq-.js.map +1 -0
- package/dist/assets/storage-Bya5b2Xt.js.map +1 -1
- package/dist/assets/tree-store-N362nuzZ.js.map +1 -1
- package/dist/assets/unbzip2-stream-B1C-JX9L.js.map +1 -1
- package/dist/assets/{web-OUQl4Q7L.js → web-DwgdhfcY.js} +16 -16
- package/dist/assets/{web-OUQl4Q7L.js.map → web-DwgdhfcY.js.map} +1 -1
- package/dist/ghostly.mjs +55 -40
- package/dist/ghostly.mjs.map +1 -1
- package/examples/call-echo.mjs +1 -1
- package/package.json +7 -7
- package/dist/assets/server-vGoe9MET.js.map +0 -1
- package/dist/assets/src-CJdPTl7Q.js.map +0 -1
package/dist/ghostly.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as fileBytesOf, d as __exportAll, i as fileBytes, l as FILE_BYTES_STEP } from "./assets/fileBytes-DxiJHmTk.js";
|
|
3
|
-
import { $ as checkAtprotoProofRecord, $s as
|
|
3
|
+
import { $ as checkAtprotoProofRecord, $i as replySnippet, $r as IdentityCheckUnavailable, $s as fromBase64Url$1, $t as isPubkyKey, Aa as CALL_SIGNAL_MAX_AGE_MS, Ai as parseVoiceMeta, B as sameSshKey, Bs as RELAY_PAYLOAD_MAX_BYTES, Ca as GhostlyHttpError, Cn as resolveLightningDestination, Ct as parseDidSignaturePaste, Da as LIMITS, Di as VOICE_LIMITS, Ei as PLAYABLE_AUDIO, En as decodeBolt11, Et as strictBase64Url, Fa as callSignalHeardAt, G as decodeAnyBitcoinAddress, H as verifySshSignature, I as SSHSIG_NAMESPACE, Ia as extractParamsFromSdp, Ir as BUTTONS_CAPABILITY, J as ATPROTO_PROOF_COLLECTION, K as ATPROTO_DECLARED_SCOPE, Kt as walletNetworkOf, L as SshSigError, La as parseCallSignal, Ma as answersOffer, Na as buildSdpFromSignal, Oi as baseMime, P as groupName, Pa as callRtcConfig, Pr as checkPushEndpoint, Ps as setLinkTraceSink, Q as atprotoProofRkey, Qt as PUBKY_PROOF_MAX_BYTES, R as parseSshPublicKey, Ra as signalHasVideo, Si as readImageMeta, Sn as requestLnurlInvoice, St as parseDidDocument, Ti as sanitizeMime, Tn as engineText, Tt as staticDidDocument, U as verifyBitcoinMessage, Us as openRelayPayload, V as sshSignCommand, Vt as WALLET_NETWORKS, W as BitcoinAddressError, X as atprotoDidMethod, Xs as MAX_AVATAR_LENGTH, Y as ATPROTO_PROOF_SCOPE, Z as atprotoProofRecord, Zs as sanitizeAvatar, _n as recordsFromTxt, _t as didWebFileNames, aa as checkStatusCard, an as pubkyProofPath, at as verifyAtprotoRecordProof, bn as txtValue, bt as normalizeDid, cn as DOMAIN_FILE_MAX_BYTES, dn as domainTxtRecord, dt as checkDidSignature, ec as randomBytes$1, en as isPubkyProofFolder, et as isAtprotoDid, fn as domainWellKnownFile, ft as didGhostlyServiceEntry, gn as normalizeDomain, gr as TYPING_REFRESH_MS, gt as didWebFile, hn as nip05RootKey, hr as TYPING_KINDS, ht as didWebDocumentUrl, ia as buttonLabelClash, ic as utf8Encode, ii as identityStatement, in as pubkyProofFile, it as AtprotoProofError, ja as RTC_CONFIG, ji as voicePeaksOf, jt as resolveDidDht, ln as decodeDnsResponse, lt as DidError, mn as isPublicAddress, mt as didSignedMessages, na as RUN_RESULTS, nn as normalizePubkyKey, nt as parseAtprotoDidDocument, on as homeserverWebEndpoint, ot as DID_DOCUMENT_MAX_BYTES$1, pn as encodeDnsQuery, pt as didJwsAlg, q as ATPROTO_FULL_SCOPE, ra as STATUS_CARD_LIMITS, rc as utf8Decode, rn as pubkyProofCapability, rs as inviteLink, rt as shortAtprotoDid, sn as pubkyHomeserverOf, st as DID_FILE_MAX_BYTES, ta as ITEM_STATES, tc as toBase64Url$1, ti as boundVerifiedIdentity, tn as newPubkyProofFolder, tt as normalizeAtprotoHandle, un as dnsProofName, ut as checkDidJws, vn as recordsFromWellKnown, vr as sanitizeTypingStatus, vt as didWebFileUrl, wi as sanitizeFileName, wn as engineError, wt as signingKeys, xn as wellKnownUrl, xt as parseDid, yn as recordsName, yt as didWebHost, z as parseSshSignature } from "./assets/src-K3NijMq-.js";
|
|
4
4
|
import { d as wrap, i as databaseName, l as store$1, n as STORES, o as fileStore, s as openDb, u as transact } from "./assets/idb-Co2lObpU.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -34,7 +34,7 @@ import { IDBFactory, IDBKeyRange as IDBKeyRange$1, IDBTransaction } from "fake-i
|
|
|
34
34
|
import { format } from "node:util";
|
|
35
35
|
var package_default = {
|
|
36
36
|
name: "@ghostlytools/cli",
|
|
37
|
-
version: "1.1.
|
|
37
|
+
version: "1.1.4",
|
|
38
38
|
type: "module",
|
|
39
39
|
description: "Ghostly for bots and terminals: the app's own engine, headless on Node, behind a daemon and a `ghostly` command with JSON output.",
|
|
40
40
|
license: "MIT",
|
|
@@ -60,9 +60,9 @@ var package_default = {
|
|
|
60
60
|
"test": "vitest run"
|
|
61
61
|
},
|
|
62
62
|
dependencies: {
|
|
63
|
-
"@arkade-os/sdk": "0.4.
|
|
63
|
+
"@arkade-os/sdk": "0.4.78",
|
|
64
64
|
"@atproto/jwk-webcrypto": "^0.3.4",
|
|
65
|
-
"@atproto/oauth-client": "^0.8.
|
|
65
|
+
"@atproto/oauth-client": "^0.8.8",
|
|
66
66
|
"@bitcoindevkit/bdk-wallet-web": "0.3.0",
|
|
67
67
|
"@bitcoinerlab/descriptors-scure": "^3.2.0",
|
|
68
68
|
"@cashu/cashu-ts": "^4.11.0",
|
|
@@ -80,7 +80,7 @@ var package_default = {
|
|
|
80
80
|
"@secondts/bark": "0.25.0",
|
|
81
81
|
"@serenity-kit/opaque": "1.1.0",
|
|
82
82
|
"@synonymdev/pubky": "0.14.0",
|
|
83
|
-
"@tetherto/wdk-wallet-evm": "1.0.0-beta.
|
|
83
|
+
"@tetherto/wdk-wallet-evm": "1.0.0-beta.20",
|
|
84
84
|
"b4a": "1.9.0",
|
|
85
85
|
"bittorrent-dht": "11.0.12",
|
|
86
86
|
"ethers": "6.17.0",
|
|
@@ -98,10 +98,10 @@ var package_default = {
|
|
|
98
98
|
"@ghostly/browser": "*",
|
|
99
99
|
"@ghostly/core": "*",
|
|
100
100
|
"@ghostly/iroh-web": "*",
|
|
101
|
-
"@types/node": "^26.6.
|
|
101
|
+
"@types/node": "^26.6.4",
|
|
102
102
|
"typescript": "^5.9.3",
|
|
103
|
-
"vite": "^8.3.
|
|
104
|
-
"vitest": "^5.0.
|
|
103
|
+
"vite": "^8.3.2",
|
|
104
|
+
"vitest": "^5.0.3"
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
//#endregion
|
|
@@ -339,16 +339,29 @@ function findSecret(text) {
|
|
|
339
339
|
* 12 to 24 words in a row from the English BIP39 list whose checksum holds, anywhere in the text; or a message that
|
|
340
340
|
* is nothing but 12, 15, 18, 21 or 24 of those words (a seed with one word mistyped is still most of a seed). Prose
|
|
341
341
|
* breaks a run at once: "the", "a", "is", "to", "and", "of" and "I" are not on the list.
|
|
342
|
+
*
|
|
343
|
+
* One word said over and over is not a seed, though one in 16 such runs passes a 12-word checksum ("word" does): a
|
|
344
|
+
* window of a single word never counts, and a window mostly of one word ("abandon … about") counts only when that
|
|
345
|
+
* word does not go on past it on either side.
|
|
342
346
|
*/
|
|
343
347
|
function hasMnemonic(text) {
|
|
344
348
|
const tokens = text.toLowerCase().match(/[a-z]+/g);
|
|
345
349
|
if (!tokens || tokens.length < 12) return false;
|
|
346
350
|
let budget = CHECKSUM_BUDGET;
|
|
347
351
|
let run = [];
|
|
352
|
+
const seedLike = (start, length) => {
|
|
353
|
+
const window = run.slice(start, start + length);
|
|
354
|
+
const counts = /* @__PURE__ */ new Map();
|
|
355
|
+
for (const word of window) counts.set(word, (counts.get(word) ?? 0) + 1);
|
|
356
|
+
if (counts.size === 1) return false;
|
|
357
|
+
const [most, times] = [...counts].reduce((a, b) => b[1] > a[1] ? b : a);
|
|
358
|
+
if (times > length / 2 && (run[start - 1] === most || run[start + length] === most)) return false;
|
|
359
|
+
return checksumHolds(window);
|
|
360
|
+
};
|
|
348
361
|
const check = () => {
|
|
349
362
|
if (run.length >= 12) {
|
|
350
|
-
for (const length of MNEMONIC_LENGTHS) for (let start = 0; start + length <= run.length && budget > 0; start++, budget--) if (
|
|
351
|
-
if (run.length === tokens.length && MNEMONIC_LENGTHS.includes(run.length)) return true;
|
|
363
|
+
for (const length of MNEMONIC_LENGTHS) for (let start = 0; start + length <= run.length && budget > 0; start++, budget--) if (seedLike(start, length)) return true;
|
|
364
|
+
if (run.length === tokens.length && MNEMONIC_LENGTHS.includes(run.length) && new Set(run).size > 1) return true;
|
|
352
365
|
}
|
|
353
366
|
run = [];
|
|
354
367
|
return false;
|
|
@@ -495,7 +508,7 @@ function decodeCbor(bytes) {
|
|
|
495
508
|
//#endregion
|
|
496
509
|
//#region src/engineMethods.ts
|
|
497
510
|
/**
|
|
498
|
-
* The engine's calls the daemon passes through as `engine.<method>` (WISP
|
|
511
|
+
* The engine's calls the daemon passes through as `engine.<method>` (WISP 1100 § Local control API): exactly the
|
|
499
512
|
* app's `EngineApi` (packages/browser/src/shared/rpc.ts; `engineMethods.test.ts` keeps the two equal), plus two
|
|
500
513
|
* reads every host has. Nothing else on the engine object is reachable.
|
|
501
514
|
*/
|
|
@@ -645,6 +658,7 @@ var ENGINE_METHODS = [
|
|
|
645
658
|
"setWakeSubscription",
|
|
646
659
|
"setWakeMuted",
|
|
647
660
|
"wakeForCall",
|
|
661
|
+
"setCallOn",
|
|
648
662
|
"wakeConfirm",
|
|
649
663
|
"setFastPoll",
|
|
650
664
|
"createGroup",
|
|
@@ -675,6 +689,7 @@ var ENGINE_METHODS = [
|
|
|
675
689
|
"deviceEnrollCancel",
|
|
676
690
|
"deviceEnrollView",
|
|
677
691
|
"deviceEnrollJoin",
|
|
692
|
+
"deviceEnrollReady",
|
|
678
693
|
"deviceEnrollFinish",
|
|
679
694
|
"deviceEnrollRemove",
|
|
680
695
|
"deviceSet",
|
|
@@ -1002,7 +1017,7 @@ function groupReply(reply, myKey) {
|
|
|
1002
1017
|
//#endregion
|
|
1003
1018
|
//#region src/typing.ts
|
|
1004
1019
|
/**
|
|
1005
|
-
* `typing --for` and `group typing --for`: a `start` holds 6 s on the other side (WISP 401 § Typing, WISP
|
|
1020
|
+
* `typing --for` and `group typing --for`: a `start` holds 6 s on the other side (WISP 401 § Typing, WISP 902 · Group
|
|
1006
1021
|
* Mesh § Typing), so the daemon says it again until the time is up, a message goes to that chat or group, or a
|
|
1007
1022
|
* `--stop`. The engine sends a `start` at most once per refresh, counted from when the last one went: asking every half
|
|
1008
1023
|
* refresh missed the tick at 3 s by a millisecond about half the time, so a start went every 4.5 s, 1.5 s inside the
|
|
@@ -1415,7 +1430,7 @@ function decodeWithFfmpeg(path, command = process.env.GHOSTLY_FFMPEG || "ffmpeg"
|
|
|
1415
1430
|
//#endregion
|
|
1416
1431
|
//#region src/files.ts
|
|
1417
1432
|
/**
|
|
1418
|
-
* Files and voice notes in a chat (WISP
|
|
1433
|
+
* Files and voice notes in a chat (WISP 1100, phase 3), as the app's composer sends them (packages/browser
|
|
1419
1434
|
* platform/services.ts `sendFile`): the bytes go into the profile's file store first, then the engine offers them.
|
|
1420
1435
|
* Large files follow files/3: the receiving side's person (here, a command) accepts or declines each offer.
|
|
1421
1436
|
*/
|
|
@@ -1727,7 +1742,7 @@ async function waitForEdit(ctx, chat, messageId, ms) {
|
|
|
1727
1742
|
}
|
|
1728
1743
|
}
|
|
1729
1744
|
/**
|
|
1730
|
-
* Waits until an edge took my group message, or its edit number `edit` (WISP
|
|
1745
|
+
* Waits until an edge took my group message, or its edit number `edit` (WISP 902: a group has no receipts, so this is
|
|
1731
1746
|
* as far as the author sees): a member's edge in a private group, an edge to one of my hubs in a community.
|
|
1732
1747
|
*/
|
|
1733
1748
|
async function waitForGroupFrame(ctx, groupId, messageId, edit, ms) {
|
|
@@ -1874,7 +1889,7 @@ function answer(target, kind, id, messageId, extra) {
|
|
|
1874
1889
|
};
|
|
1875
1890
|
}
|
|
1876
1891
|
/**
|
|
1877
|
-
* A task's parent is another task of mine in the same chat or group (WISP
|
|
1892
|
+
* A task's parent is another task of mine in the same chat or group (WISP 405 · Status Cards § A task): one that is
|
|
1878
1893
|
* not there is refused here, with its name, rather than sent to stand alone on every board (a reader keeps the field
|
|
1879
1894
|
* and shows the task ungrouped). Send the parent first.
|
|
1880
1895
|
*/
|
|
@@ -2020,7 +2035,7 @@ async function flushCardUpdates(ctx) {
|
|
|
2020
2035
|
await Promise.all(waiting.map((pace) => pace.flushed));
|
|
2021
2036
|
}
|
|
2022
2037
|
var STATUS_CARD_METHODS = {
|
|
2023
|
-
/** WISP
|
|
2038
|
+
/** WISP 405 · Status Cards: a task card in a chat or a group; the answer names the task's id and its message. */
|
|
2024
2039
|
"task.send": (ctx, params) => sendCard(ctx, params, "task"),
|
|
2025
2040
|
/** A task's update: the fields given, merged over its latest state, paced one per `CARD_UPDATE_GAP_MS`. */
|
|
2026
2041
|
"task.update": (ctx, params) => updateCard(ctx, params, "task"),
|
|
@@ -2216,9 +2231,9 @@ async function pressButton(ctx, params) {
|
|
|
2216
2231
|
};
|
|
2217
2232
|
}
|
|
2218
2233
|
var BUTTON_METHODS = {
|
|
2219
|
-
/** WISP
|
|
2234
|
+
/** WISP 406 · Message Buttons: a press on a button of someone else's message, as the app's tap. */
|
|
2220
2235
|
"button.press": pressButton,
|
|
2221
|
-
/** WISP
|
|
2236
|
+
/** WISP 406 · Message Buttons: the answer chosen on a question of mine, its buttons closed, or its text changed. */
|
|
2222
2237
|
"button.update": updateButtons
|
|
2223
2238
|
};
|
|
2224
2239
|
//#endregion
|
|
@@ -2522,7 +2537,7 @@ function groupJson(group, showSecret = false) {
|
|
|
2522
2537
|
//#endregion
|
|
2523
2538
|
//#region src/groupAdmin.ts
|
|
2524
2539
|
/**
|
|
2525
|
-
* Group administration and pictures (WISP
|
|
2540
|
+
* Group administration and pictures (WISP 1100, phase 3): what the app's group menu and profile screen do. The
|
|
2526
2541
|
* engine enforces who may do what (the admin); these check the arguments and name members.
|
|
2527
2542
|
*/
|
|
2528
2543
|
/** A member by key, unique key prefix or name; never this profile itself. */
|
|
@@ -3966,7 +3981,7 @@ async function keyserverVerifiedEmails(keyserverArmored, fingerprint, options =
|
|
|
3966
3981
|
//#region ../browser/src/proofs/providers/openpgp.ts
|
|
3967
3982
|
/**
|
|
3968
3983
|
* OpenPGP keys, signed with the person's own gpg — a YubiKey or another OpenPGP card works unchanged,
|
|
3969
|
-
* since gpg drives it. The subject is the primary key's fingerprint. See docs/wisps/
|
|
3984
|
+
* since gpg drives it. The subject is the primary key's fingerprint. See docs/wisps/305-openpgp.md.
|
|
3970
3985
|
*/
|
|
3971
3986
|
/** A v4 (40 hex) or v6 (64 hex) fingerprint, as gpg prints it or not: spaces and 0x are dropped. */
|
|
3972
3987
|
function normalizeFingerprint(input) {
|
|
@@ -7369,7 +7384,7 @@ var IDENTITY_METHODS = {
|
|
|
7369
7384
|
//#endregion
|
|
7370
7385
|
//#region src/services.ts
|
|
7371
7386
|
/**
|
|
7372
|
-
* Shared services (WISP 700/701, WISP
|
|
7387
|
+
* Shared services (WISP 700/701, WISP 1100 phase 3b): a web app on this machine a contact may open over the chat's live
|
|
7373
7388
|
* link, and a contact's app opened here on a loopback port. As on the Desktop: only loopback is reached, redirects are
|
|
7374
7389
|
* handed back rather than followed, and a service is shared with each contact by name, never by default.
|
|
7375
7390
|
*/
|
|
@@ -8097,7 +8112,7 @@ var keptInLight = (size, voice) => size <= (voice ? LIGHT_VOICE_BYTES : LIGHT_FI
|
|
|
8097
8112
|
//#endregion
|
|
8098
8113
|
//#region src/profiles.ts
|
|
8099
8114
|
/**
|
|
8100
|
-
* Profiles on disk (WISP
|
|
8115
|
+
* Profiles on disk (WISP 1100 § Profiles and files): `<home>/profiles/<name>/`, 0700, one engine store each.
|
|
8101
8116
|
* `<home>/current` names the profile commands use when none is given.
|
|
8102
8117
|
*/
|
|
8103
8118
|
var DEFAULT_PROFILE = "default";
|
|
@@ -8225,7 +8240,7 @@ function lockOwner(paths) {
|
|
|
8225
8240
|
* A headless profile's backup: the WISP 05 envelope around the profile itself, its store and its files, written and
|
|
8226
8241
|
* read a piece at a time (envelope version 2), so a profile with large files never has to fit in memory. It restores
|
|
8227
8242
|
* into a new headless profile; the app's own backups are made from its page's storage and are not this format
|
|
8228
|
-
* (WISP
|
|
8243
|
+
* (WISP 1100 § Parity). A backup an older CLI made (version 1: everything in one sealed JSON document) still restores.
|
|
8229
8244
|
*/
|
|
8230
8245
|
var FORMAT$1 = "ghostly-cli-profile/2";
|
|
8231
8246
|
var FORMAT_1 = "ghostly-cli-profile/1";
|
|
@@ -8584,7 +8599,7 @@ async function writeWhole(paths, payload) {
|
|
|
8584
8599
|
}
|
|
8585
8600
|
//#endregion
|
|
8586
8601
|
//#region src/calls/api.ts
|
|
8587
|
-
/** Voice calls (WISP
|
|
8602
|
+
/** Voice calls (WISP 1100 § Calls): the API methods. The audio itself goes over each call's own socket. */
|
|
8588
8603
|
var CALL_METHODS = {
|
|
8589
8604
|
async "call.start"(ctx, params) {
|
|
8590
8605
|
return ctx.calls.start(str(params, "chat", true), { rate: params.rate });
|
|
@@ -10762,7 +10777,7 @@ function createFailure(label, error) {
|
|
|
10762
10777
|
//#endregion
|
|
10763
10778
|
//#region src/wallets.ts
|
|
10764
10779
|
/**
|
|
10765
|
-
* Wallets and payments (WISP
|
|
10780
|
+
* Wallets and payments (WISP 1100, phase 2): the app's wallet deck and a chat's payment sheet, as methods. Test
|
|
10766
10781
|
* networks move nothing real. On Mainnet every spend passes `confirmedReal`, which the engine requires, only when the
|
|
10767
10782
|
* call says `confirmReal: true` (the CLI's `--confirm-real`): no flag, no spend.
|
|
10768
10783
|
*/
|
|
@@ -10792,7 +10807,7 @@ var CHAT_METHODS = [
|
|
|
10792
10807
|
...METHODS$1.filter((m) => m !== "cashu")
|
|
10793
10808
|
];
|
|
10794
10809
|
/**
|
|
10795
|
-
* What the app has and a headless Ghostly cannot run yet, and why (WISP
|
|
10810
|
+
* What the app has and a headless Ghostly cannot run yet, and why (WISP 1100 § Wallet SDKs on Node). New offers
|
|
10796
10811
|
* them as unavailable; creating one is refused before the engine is asked.
|
|
10797
10812
|
*/
|
|
10798
10813
|
var NODE_GAPS = { bark: "Bark's SDK ships a browser build only: its WebAssembly needs a browser window. Use it from the app." };
|
|
@@ -11270,7 +11285,7 @@ var TRANSPORT_NAMES = {
|
|
|
11270
11285
|
"iroh/1": "iroh/1",
|
|
11271
11286
|
"hyperdht/1": "hyperdht/1"
|
|
11272
11287
|
};
|
|
11273
|
-
/** Code points before `index` (UTF-16) in `text`: mentions count code points (WISP
|
|
11288
|
+
/** Code points before `index` (UTF-16) in `text`: mentions count code points (WISP 902 § Mentions). */
|
|
11274
11289
|
var codePoints = (text, index) => [...text.slice(0, index)].length;
|
|
11275
11290
|
/**
|
|
11276
11291
|
* Mentions for a group message: each ref (a member key, a unique prefix of one, a member's name, or `everyone`) must
|
|
@@ -11818,7 +11833,7 @@ var METHODS = {
|
|
|
11818
11833
|
};
|
|
11819
11834
|
},
|
|
11820
11835
|
/**
|
|
11821
|
-
* WISP
|
|
11836
|
+
* WISP 902 § Edits: the whole new text of one of my messages in a group. It shows here at once and goes to the members
|
|
11822
11837
|
* (a private group's over the edges that are up, the others when theirs open; a community's through the group).
|
|
11823
11838
|
* `mentions`: members the new text names beyond those the message named. `sent`: no longer waiting for the pace.
|
|
11824
11839
|
*/
|
|
@@ -11874,7 +11889,7 @@ var METHODS = {
|
|
|
11874
11889
|
};
|
|
11875
11890
|
},
|
|
11876
11891
|
/**
|
|
11877
|
-
* WISP
|
|
11892
|
+
* WISP 902 · Group Mesh § Typing: `chat.typing` in a private group, said on the edges that are open (`reached`: to
|
|
11878
11893
|
* how many members), with the same kinds, status rules, 6 s hold and `for`. A community does not carry typing yet.
|
|
11879
11894
|
*/
|
|
11880
11895
|
async "group.typing"(ctx, params) {
|
|
@@ -12110,7 +12125,7 @@ function ownSocket(path) {
|
|
|
12110
12125
|
//#endregion
|
|
12111
12126
|
//#region src/client.ts
|
|
12112
12127
|
/**
|
|
12113
|
-
* A connection to a profile's daemon over its socket (WISP
|
|
12128
|
+
* A connection to a profile's daemon over its socket (WISP 1100 § Local control API). `null` from `connectDaemon`
|
|
12114
12129
|
* means no daemon answers there: a one-shot command runs the profile itself.
|
|
12115
12130
|
*/
|
|
12116
12131
|
var DaemonClient = class {
|
|
@@ -12262,7 +12277,7 @@ var reply = {
|
|
|
12262
12277
|
type: "string",
|
|
12263
12278
|
description: "Reply to this message (its id, from history or an event)"
|
|
12264
12279
|
};
|
|
12265
|
-
/** Buttons under a message (WISP
|
|
12280
|
+
/** Buttons under a message (WISP 406 · Message Buttons): the text is the question. */
|
|
12266
12281
|
var buttonOptions = {
|
|
12267
12282
|
button: {
|
|
12268
12283
|
type: "list",
|
|
@@ -12294,7 +12309,7 @@ function cursor(value) {
|
|
|
12294
12309
|
return /^\d{10,}$/.test(text) ? Number(text) : text;
|
|
12295
12310
|
}
|
|
12296
12311
|
/**
|
|
12297
|
-
* A status card's fields given as JSON (WISP
|
|
12312
|
+
* A status card's fields given as JSON (WISP 405 · Status Cards): inline (`{...}`), `-` for stdin, or a file's path. The
|
|
12298
12313
|
* flags given beside it win over it.
|
|
12299
12314
|
*/
|
|
12300
12315
|
function cardJson(value) {
|
|
@@ -14329,7 +14344,7 @@ var PlaybackQueue = class {
|
|
|
14329
14344
|
//#endregion
|
|
14330
14345
|
//#region src/calls/audioSocket.ts
|
|
14331
14346
|
/**
|
|
14332
|
-
* A call's audio socket (WISP
|
|
14347
|
+
* A call's audio socket (WISP 1100 § Calls): `<profile>/calls/<call>.sock`, 0600, in a folder only the owner may
|
|
14333
14348
|
* open. When that path is too long for a Unix socket: `/tmp/ghostly-calls-<hash of the profile>/<call>.sock`, in a
|
|
14334
14349
|
* folder of the owner's, 0700, checked as such before use. A named pipe on Windows.
|
|
14335
14350
|
*/
|
|
@@ -15912,7 +15927,7 @@ var EventHub = class {
|
|
|
15912
15927
|
for (const [fileId, messageId] of files) this.flushFile(fileId, messageId);
|
|
15913
15928
|
}
|
|
15914
15929
|
/**
|
|
15915
|
-
* A press on a button of a message of mine (WISP
|
|
15930
|
+
* A press on a button of a message of mine (WISP 406 · Message Buttons), after the reply's own event: the question
|
|
15916
15931
|
* (`messageId`), the button, its label, who pressed (`by`: the chat, or a group member's key), `name` (the chat's name
|
|
15917
15932
|
* here, as `chat list` gives it: its label, else the contact's own name; a group member's roster name) and the reply
|
|
15918
15933
|
* (`replyId`). `untrusted.name` is the name the person gave themselves, as an agent turn's: theirs to choose, so
|
|
@@ -16380,7 +16395,7 @@ async function fedimintSdkOn(platform) {
|
|
|
16380
16395
|
//#endregion
|
|
16381
16396
|
//#region src/runtime/fedimint.ts
|
|
16382
16397
|
/**
|
|
16383
|
-
* The Fedimint client on Node (WISP
|
|
16398
|
+
* The Fedimint client on Node (WISP 1100 § Wallet SDKs on Node): the app's own SDK and WebAssembly, each database in
|
|
16384
16399
|
* a `worker_threads` worker (fedimintWorker.mjs) and a file of the profile's `fedimint/` folder, where the browser has
|
|
16385
16400
|
* a module worker and the origin-private file system. Only the platform differs: the client and what the engine does
|
|
16386
16401
|
* with it are the app's.
|
|
@@ -16986,7 +17001,7 @@ function irohWasmBytes() {
|
|
|
16986
17001
|
return readFileSync(createRequire(import.meta.url).resolve("@ghostly/iroh-web/wasm"));
|
|
16987
17002
|
}
|
|
16988
17003
|
/**
|
|
16989
|
-
* Starts the app's engine on this profile (WISP
|
|
17004
|
+
* Starts the app's engine on this profile (WISP 1100 § Runtime): IndexedDB on disk, WebRTC through libdatachannel,
|
|
16990
17005
|
* HyperDHT native in this process, Iroh's wasm build (relay only, as the web app), Pkarr through the relays in the
|
|
16991
17006
|
* settings and the Mainline DHT directly (read when the relays fail, written always).
|
|
16992
17007
|
* The caller holds the profile's lock.
|
|
@@ -17029,14 +17044,14 @@ async function startRuntime(paths, options = {}) {
|
|
|
17029
17044
|
(await import("./assets/ghostly_iroh_web-Dvzh3Y6E.js")).initSync({ module: irohWasmBytes() });
|
|
17030
17045
|
const [{ registerFileBytes }, { NodeFileBytes }] = await Promise.all([import("./assets/fileBytes-DxiJHmTk.js").then((n) => n.o), import("./assets/fileBytes-BQ84L9Fe.js")]);
|
|
17031
17046
|
registerFileBytes("native", async () => new NodeFileBytes(paths.files), true);
|
|
17032
|
-
const [{ EngineServer }, { createHyperEndpoint }] = await Promise.all([import("./assets/server-
|
|
17047
|
+
const [{ EngineServer }, { createHyperEndpoint }] = await Promise.all([import("./assets/server-CXFTDnFI.js").then((n) => n.t), import("./assets/endpoint-CaSbSFDw.js")]);
|
|
17033
17048
|
const network = hyperdhtNetwork();
|
|
17034
17049
|
const dht = mainlineNetwork();
|
|
17035
|
-
const mainline = dht.off ? null : new (await (import("./assets/mainline-
|
|
17050
|
+
const mainline = dht.off ? null : new (await (import("./assets/mainline-dkA94eh2.js"))).Mainline({
|
|
17036
17051
|
bootstrap: dht.bootstrap,
|
|
17037
17052
|
host: dht.host
|
|
17038
17053
|
});
|
|
17039
|
-
const transport = mainline || pinned ? new (await (import("./assets/mainline-
|
|
17054
|
+
const transport = mainline || pinned ? new (await (import("./assets/mainline-dkA94eh2.js"))).RelaysAndDht(mainline, pinned ? { relays: pinned } : {}, !!pinned) : null;
|
|
17040
17055
|
const server = new EngineServer({
|
|
17041
17056
|
...transport ? { transport } : {},
|
|
17042
17057
|
irohWeb: true,
|
|
@@ -17368,7 +17383,7 @@ function turn(event, source, where, message) {
|
|
|
17368
17383
|
}
|
|
17369
17384
|
};
|
|
17370
17385
|
}
|
|
17371
|
-
/** Only loopback: events carry message text, and a webhook is a local bridge (WISP
|
|
17386
|
+
/** Only loopback: events carry message text, and a webhook is a local bridge (WISP 1100 § Security). */
|
|
17372
17387
|
function checkWebhook(url) {
|
|
17373
17388
|
let parsed;
|
|
17374
17389
|
try {
|