@ghostlytools/cli 1.4.5 → 1.5.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 +14 -7
- package/dist/assets/{api-XX7bbtTZ.js → api-C_IHKsrl.js} +2 -2
- package/dist/assets/{api-D70he3-A.js → api-ClHM_G5A.js} +87 -60
- package/dist/assets/api-ClHM_G5A.js.map +1 -0
- package/dist/assets/{apiKit-CpsEqF-1.js → apiKit-gS-yfb25.js} +2 -2
- package/dist/assets/{apiKit-CpsEqF-1.js.map → apiKit-gS-yfb25.js.map} +1 -1
- package/dist/assets/{apps-VA8W_YCQ.js → apps-DP8pElH-.js} +2 -2
- package/dist/assets/{apps-VA8W_YCQ.js.map → apps-DP8pElH-.js.map} +1 -1
- package/dist/assets/{apps-DVMnlwGF.js → apps-DyihkNO-.js} +1 -1
- package/dist/assets/{arkade-DxgW4-dK.js → arkade-GzJoov-w.js} +2 -2
- package/dist/assets/{arkade-DxgW4-dK.js.map → arkade-GzJoov-w.js.map} +1 -1
- package/dist/assets/{backup-BRTH1y3-.js → backup-A_C4hYNO.js} +1 -1
- package/dist/assets/{backup-c9xvXgCS.js → backup-DKDXkaS1.js} +6 -6
- package/dist/assets/{backup-c9xvXgCS.js.map → backup-DKDXkaS1.js.map} +1 -1
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/{blobFiles-B0rNnHlO.js → blobFiles-1wUBd8ZD.js} +3 -3
- package/dist/assets/{blobFiles-B0rNnHlO.js.map → blobFiles-1wUBd8ZD.js.map} +1 -1
- package/dist/assets/{buttons-D31LBftz.js → buttons-BDw8cqDq.js} +3 -3
- package/dist/assets/{buttons-D31LBftz.js.map → buttons-BDw8cqDq.js.map} +1 -1
- package/dist/assets/buttons-CNkxiN2c.js +2 -0
- package/dist/assets/daemonProof-CWTVNUmr.js +254 -0
- package/dist/assets/daemonProof-CWTVNUmr.js.map +1 -0
- package/dist/assets/{envelope-hAl4pblf.js → envelope-DEvU5FA9.js} +2 -2
- package/dist/assets/{envelope-hAl4pblf.js.map → envelope-DEvU5FA9.js.map} +1 -1
- package/dist/assets/fedimint_client_wasm_bg-BtHHlFpp.js.map +1 -1
- package/dist/assets/{fileBytes-B-fqGdEd.js → fileBytes-B8eTZfAT.js} +3 -3
- package/dist/assets/{fileBytes-B-fqGdEd.js.map → fileBytes-B8eTZfAT.js.map} +1 -1
- package/dist/assets/{fileBytes-C2jycN_7.js → fileBytes-gTd_8l-P.js} +1 -1
- package/dist/assets/{fileBytes-D6fqFQEX.js → fileBytes-uRqLyxa0.js} +2 -2
- package/dist/assets/{fileBytes-D6fqFQEX.js.map → fileBytes-uRqLyxa0.js.map} +1 -1
- package/dist/assets/{fileBytesIdb-_HnxdacI.js → fileBytesIdb-BIFKtgln.js} +3 -3
- package/dist/assets/{fileBytesIdb-_HnxdacI.js.map → fileBytesIdb-BIFKtgln.js.map} +1 -1
- package/dist/assets/fileBytesIdb-BVVr_rWX.js +2 -0
- package/dist/assets/{fileBytesOpfs-p_CANncD.js → fileBytesOpfs-ChrHcCVV.js} +3 -3
- package/dist/assets/{fileBytesOpfs-p_CANncD.js.map → fileBytesOpfs-ChrHcCVV.js.map} +1 -1
- package/dist/assets/{groupFiles-gQ8_792r.js → groupFiles-Cr4Gj9-R.js} +45 -13
- package/dist/assets/groupFiles-Cr4Gj9-R.js.map +1 -0
- package/dist/assets/{host-Dmo6m7So.js → host-D0MIWyOe.js} +15 -122
- package/dist/assets/host-D0MIWyOe.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-DwkZ8vpt.js → hyperdhtRelay-SBo4aoMk.js} +2 -2
- package/dist/assets/{hyperdhtRelay-DwkZ8vpt.js.map → hyperdhtRelay-SBo4aoMk.js.map} +1 -1
- package/dist/assets/{idb-CMVgtn2k.js → idb-BJARz3Qi.js} +5 -3
- package/dist/assets/idb-BJARz3Qi.js.map +1 -0
- package/dist/assets/{irohWeb-DKJhESuV.js → irohWeb-D2WaYPdN.js} +2 -2
- package/dist/assets/{irohWeb-DKJhESuV.js.map → irohWeb-D2WaYPdN.js.map} +1 -1
- package/dist/assets/{main-DgXvK9Cr.js → main-DUG0nGLw.js} +240 -53
- package/dist/assets/main-DUG0nGLw.js.map +1 -0
- package/dist/assets/{mainline-9j_FqcJe.js → mainline-B8NGRodL.js} +2 -2
- package/dist/assets/{mainline-9j_FqcJe.js.map → mainline-B8NGRodL.js.map} +1 -1
- package/dist/assets/{networkReason-Bp8Huk9Z.js → networkReason-BAnNO1Ji.js} +3 -3
- package/dist/assets/{networkReason-Bp8Huk9Z.js.map → networkReason-BAnNO1Ji.js.map} +1 -1
- package/dist/assets/{nwc-DxIjNmYz.js → nwc-DQT3rx-s.js} +3 -3
- package/dist/assets/{nwc-DxIjNmYz.js.map → nwc-DQT3rx-s.js.map} +1 -1
- package/dist/assets/{nwcProvider-CyGVe35t.js → nwcProvider-Dq647EAl.js} +2 -2
- package/dist/assets/{nwcProvider-CyGVe35t.js.map → nwcProvider-Dq647EAl.js.map} +1 -1
- package/dist/assets/{profiles-ClRPr6y8.js → profiles-BehWURA9.js} +7 -3
- package/dist/assets/profiles-BehWURA9.js.map +1 -0
- package/dist/assets/{registry-siqMiD8L.js → registry-DFiOxH5q.js} +1 -1
- package/dist/assets/{registry-BTIRr7gH.js → registry-ieI8INKT.js} +3 -3
- package/dist/assets/registry-ieI8INKT.js.map +1 -0
- package/dist/assets/{resolve-CZ4yb7wp.js → resolve-C39pc4Kf.js} +2 -2
- package/dist/assets/{resolve-CZ4yb7wp.js.map → resolve-C39pc4Kf.js.map} +1 -1
- package/dist/assets/{restoredRows-DeBImGRd.js → restoredRows-DGuKtIBz.js} +2 -2
- package/dist/assets/{restoredRows-DeBImGRd.js.map → restoredRows-DGuKtIBz.js.map} +1 -1
- package/dist/assets/{server-ZrkwMbFo.js → server-DIICuvgy.js} +832 -149
- package/dist/assets/server-DIICuvgy.js.map +1 -0
- package/dist/assets/{src-CxEO33Hb.js → src-CwMTZ5Hj.js} +762 -54
- package/dist/assets/src-CwMTZ5Hj.js.map +1 -0
- package/dist/assets/{usdt-exH8dIZK.js → usdt-CxSyuXq4.js} +3 -3
- package/dist/assets/{usdt-exH8dIZK.js.map → usdt-CxSyuXq4.js.map} +1 -1
- package/dist/assets/{turnRefs-Dndxqyxk.js → words-31VaDW5h.js} +61 -3
- package/dist/assets/words-31VaDW5h.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/skills/ghostly/scripts/status +3 -2
- package/dist/assets/api-D70he3-A.js.map +0 -1
- package/dist/assets/buttons-CtGCix-8.js +0 -2
- package/dist/assets/daemonProof-B53VnZ1Z.js +0 -100
- package/dist/assets/daemonProof-B53VnZ1Z.js.map +0 -1
- package/dist/assets/fileBytesIdb-DOxm_BKt.js +0 -2
- package/dist/assets/groupFiles-gQ8_792r.js.map +0 -1
- package/dist/assets/host-Dmo6m7So.js.map +0 -1
- package/dist/assets/idb-CMVgtn2k.js.map +0 -1
- package/dist/assets/main-DgXvK9Cr.js.map +0 -1
- package/dist/assets/profiles-ClRPr6y8.js.map +0 -1
- package/dist/assets/registry-BTIRr7gH.js.map +0 -1
- package/dist/assets/server-ZrkwMbFo.js.map +0 -1
- package/dist/assets/src-CxEO33Hb.js.map +0 -1
- package/dist/assets/turnRefs-Dndxqyxk.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Ao as
|
|
2
|
-
import { a as fedimintSdkOn, r as irohRelayProblem } from "./irohWeb-
|
|
1
|
+
import { Ao as RTC_CONFIG, Hl as setLinkTraceSink, Io as extractParamsFromSdp, Lo as parseCallSignal, Mo as buildSdpFromSignal, No as callRtcConfig, Po as callSignalHeardAt, Ro as signalHasVideo, Si as isPublicAddress, Xr as checkPushEndpoint, cu as fromBase64Url, jo as answersOffer, ko as CALL_SIGNAL_MAX_AGE_MS } from "./src-CwMTZ5Hj.js";
|
|
2
|
+
import { a as fedimintSdkOn, r as irohRelayProblem } from "./irohWeb-D2WaYPdN.js";
|
|
3
3
|
import { r as asCliError, t as CliError } from "./errors-BLSPp0tK.js";
|
|
4
|
-
import { a as findChat } from "./apiKit-
|
|
5
|
-
import { _ as flushCardUpdates, c as paymentJson, d as nodeLocalFetch, f as chatJson, g as resumeHolds, h as groupMessageJson, l as reportAppFrames, m as groupJson, p as chatMessageJson, r as callApi, u as servedApps } from "./api-
|
|
6
|
-
import { n as RESTORED_MARK, r as acquireLock } from "./profiles-
|
|
7
|
-
import {
|
|
4
|
+
import { a as findChat } from "./apiKit-gS-yfb25.js";
|
|
5
|
+
import { _ as flushCardUpdates, c as paymentJson, d as nodeLocalFetch, f as chatJson, g as resumeHolds, h as groupMessageJson, l as reportAppFrames, m as groupJson, p as chatMessageJson, r as callApi, u as servedApps } from "./api-ClHM_G5A.js";
|
|
6
|
+
import { n as RESTORED_MARK, r as acquireLock } from "./profiles-BehWURA9.js";
|
|
7
|
+
import { _ as ownFolder, a as proof, d as DEFAULT_RATE, f as PlaybackQueue, g as isCallRate, h as frameSamples, l as removeDaemonSecret, m as frameBytes, n as greeting, p as bytesToMs, r as newDaemonSecret, y as privateFolder } from "./daemonProof-CWTVNUmr.js";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
9
|
import { appendFileSync, chmodSync, closeSync, existsSync, fstatSync, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, renameSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
@@ -44,115 +44,6 @@ function announceJoins(hub, node) {
|
|
|
44
44
|
else if (event.type === "chat.joined") say(chat);
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
var CALL_RATES = [
|
|
48
|
-
8e3,
|
|
49
|
-
12e3,
|
|
50
|
-
16e3,
|
|
51
|
-
24e3,
|
|
52
|
-
48e3
|
|
53
|
-
];
|
|
54
|
-
var DEFAULT_RATE = 48e3;
|
|
55
|
-
var frameSamples = (rate) => rate * 20 / 1e3;
|
|
56
|
-
var frameBytes = (rate) => frameSamples(rate) * 2;
|
|
57
|
-
var bytesToMs = (rate, bytes) => Math.round(bytes / 2 / rate * 1e3);
|
|
58
|
-
function isCallRate(value) {
|
|
59
|
-
return CALL_RATES.includes(value);
|
|
60
|
-
}
|
|
61
|
-
/** The most a program may queue ahead of the call: five minutes of speech. What goes past it is dropped. */
|
|
62
|
-
var MAX_QUEUE_MS = 3e5;
|
|
63
|
-
/**
|
|
64
|
-
* What the program wrote, waiting to be sent: taken one 20 ms frame per tick, silence when there is nothing, and
|
|
65
|
-
* dropped whole by a flush (barge-in). The program may write any amount at any time, faster than real time too.
|
|
66
|
-
*/
|
|
67
|
-
var PlaybackQueue = class {
|
|
68
|
-
rate;
|
|
69
|
-
now;
|
|
70
|
-
chunks = [];
|
|
71
|
-
head = 0;
|
|
72
|
-
length = 0;
|
|
73
|
-
lastPush = 0;
|
|
74
|
-
frame;
|
|
75
|
-
max;
|
|
76
|
-
silence;
|
|
77
|
-
/** Bytes dropped because the queue was full, since the start. */
|
|
78
|
-
dropped = 0;
|
|
79
|
-
constructor(rate, now = Date.now, maxMs = MAX_QUEUE_MS) {
|
|
80
|
-
this.rate = rate;
|
|
81
|
-
this.now = now;
|
|
82
|
-
this.frame = frameBytes(rate);
|
|
83
|
-
this.max = Math.floor(rate * maxMs / 1e3) * 2;
|
|
84
|
-
this.silence = Buffer.alloc(this.frame);
|
|
85
|
-
}
|
|
86
|
-
/** Adds what the program wrote. Returns the bytes it could not keep (the queue was full). */
|
|
87
|
-
push(chunk) {
|
|
88
|
-
if (!chunk.length) return 0;
|
|
89
|
-
this.lastPush = this.now();
|
|
90
|
-
const room = this.max - this.length;
|
|
91
|
-
const kept = chunk.length <= room ? chunk : chunk.subarray(0, Math.max(0, room));
|
|
92
|
-
const lost = chunk.length - kept.length;
|
|
93
|
-
this.dropped += lost;
|
|
94
|
-
if (kept.length) {
|
|
95
|
-
this.chunks.push(Buffer.from(kept));
|
|
96
|
-
this.length += kept.length;
|
|
97
|
-
}
|
|
98
|
-
return lost;
|
|
99
|
-
}
|
|
100
|
-
/** Queued audio, in milliseconds (whole frames and a partial one). */
|
|
101
|
-
get queuedMs() {
|
|
102
|
-
return bytesToMs(this.rate, this.length - this.length % 2);
|
|
103
|
-
}
|
|
104
|
-
/** One frame to send now, and whether it is the program's audio or silence. */
|
|
105
|
-
next() {
|
|
106
|
-
if (this.length >= this.frame) return {
|
|
107
|
-
frame: this.take(this.frame),
|
|
108
|
-
silent: false
|
|
109
|
-
};
|
|
110
|
-
const whole = this.length - this.length % 2;
|
|
111
|
-
if (whole > 0 && this.now() - this.lastPush >= 60) {
|
|
112
|
-
const frame = Buffer.alloc(this.frame);
|
|
113
|
-
this.take(whole).copy(frame);
|
|
114
|
-
return {
|
|
115
|
-
frame,
|
|
116
|
-
silent: false
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
frame: this.silence,
|
|
121
|
-
silent: true
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
/** Drops everything queued; returns how much, in milliseconds. */
|
|
125
|
-
flush() {
|
|
126
|
-
const ms = this.queuedMs;
|
|
127
|
-
this.chunks = [];
|
|
128
|
-
this.head = 0;
|
|
129
|
-
this.length = 0;
|
|
130
|
-
return ms;
|
|
131
|
-
}
|
|
132
|
-
/** Drops up to that much from the front, in whole frames (audio whose time went by); returns how much, in milliseconds. */
|
|
133
|
-
skip(ms) {
|
|
134
|
-
const frames = Math.min(Math.floor(ms / 20), Math.floor(this.length / this.frame));
|
|
135
|
-
if (frames > 0) this.take(frames * this.frame);
|
|
136
|
-
return Math.max(0, frames) * 20;
|
|
137
|
-
}
|
|
138
|
-
take(bytes) {
|
|
139
|
-
const out = Buffer.allocUnsafe(bytes);
|
|
140
|
-
let filled = 0;
|
|
141
|
-
while (filled < bytes) {
|
|
142
|
-
const chunk = this.chunks[0];
|
|
143
|
-
const n = Math.min(bytes - filled, chunk.length - this.head);
|
|
144
|
-
chunk.copy(out, filled, this.head, this.head + n);
|
|
145
|
-
filled += n;
|
|
146
|
-
this.head += n;
|
|
147
|
-
if (this.head === chunk.length) {
|
|
148
|
-
this.chunks.shift();
|
|
149
|
-
this.head = 0;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
this.length -= bytes;
|
|
153
|
-
return out;
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
47
|
//#endregion
|
|
157
48
|
//#region src/calls/audioSocket.ts
|
|
158
49
|
/**
|
|
@@ -4780,7 +4671,7 @@ async function startRuntime(paths, options = {}) {
|
|
|
4780
4671
|
const restored = join(paths.dir, RESTORED_MARK);
|
|
4781
4672
|
if (existsSync(restored)) {
|
|
4782
4673
|
try {
|
|
4783
|
-
const rows = await import("./restoredRows-
|
|
4674
|
+
const rows = await import("./restoredRows-DGuKtIBz.js");
|
|
4784
4675
|
await rows.markRestoredWallet();
|
|
4785
4676
|
await rows.markLeftOutFiles(leftOutIn(restored));
|
|
4786
4677
|
await store.compact();
|
|
@@ -4799,17 +4690,17 @@ async function startRuntime(paths, options = {}) {
|
|
|
4799
4690
|
await installEventSource();
|
|
4800
4691
|
await preloadWalletModules();
|
|
4801
4692
|
(await import("./ghostly_iroh_web-BsAEFIjl.js")).initSync({ module: irohWasmBytes() });
|
|
4802
|
-
const [{ registerFileBytes }, { NodeFileBytes }] = await Promise.all([import("./fileBytes-
|
|
4693
|
+
const [{ registerFileBytes }, { NodeFileBytes }] = await Promise.all([import("./fileBytes-gTd_8l-P.js"), import("./fileBytes-uRqLyxa0.js")]);
|
|
4803
4694
|
registerFileBytes("native", async () => new NodeFileBytes(paths.files), true);
|
|
4804
|
-
if (await (await import("./blobFiles-
|
|
4805
|
-
const [{ EngineServer }, { createHyperEndpoint }] = await Promise.all([import("./server-
|
|
4695
|
+
if (await (await import("./blobFiles-1wUBd8ZD.js")).moveBlobFiles()) await store.compact();
|
|
4696
|
+
const [{ EngineServer }, { createHyperEndpoint }] = await Promise.all([import("./server-DIICuvgy.js"), import("./endpoint-Cl3cgAYl.js")]);
|
|
4806
4697
|
const network = hyperdhtNetwork();
|
|
4807
4698
|
const dht = mainlineNetwork();
|
|
4808
|
-
const mainline = dht.off ? null : new (await (import("./mainline-
|
|
4699
|
+
const mainline = dht.off ? null : new (await (import("./mainline-B8NGRodL.js"))).Mainline({
|
|
4809
4700
|
bootstrap: dht.bootstrap,
|
|
4810
4701
|
host: dht.host
|
|
4811
4702
|
});
|
|
4812
|
-
const transport = mainline || pinned ? new (await (import("./mainline-
|
|
4703
|
+
const transport = mainline || pinned ? new (await (import("./mainline-B8NGRodL.js"))).RelaysAndDht(mainline, pinned ? { relays: pinned } : {}, !!pinned) : null;
|
|
4813
4704
|
const apps = servedApps(paths.dir).length > 0;
|
|
4814
4705
|
const server = new EngineServer({
|
|
4815
4706
|
...transport ? { transport } : {},
|
|
@@ -4979,6 +4870,7 @@ async function serve(host) {
|
|
|
4979
4870
|
return {
|
|
4980
4871
|
server,
|
|
4981
4872
|
close: () => closing ??= new Promise((resolve) => {
|
|
4873
|
+
removeDaemonSecret(ctx.runtime.paths.dir);
|
|
4982
4874
|
server.close(() => resolve());
|
|
4983
4875
|
for (const socket of sockets) socket.end();
|
|
4984
4876
|
setTimeout(() => {
|
|
@@ -5046,6 +4938,7 @@ function connection(ctx, socket, secret) {
|
|
|
5046
4938
|
});
|
|
5047
4939
|
socket.on("close", unsubscribe);
|
|
5048
4940
|
socket.on("error", () => {});
|
|
4941
|
+
write(greeting(secret));
|
|
5049
4942
|
const lines = createInterface({
|
|
5050
4943
|
input: socket,
|
|
5051
4944
|
crlfDelay: Infinity
|
|
@@ -5147,4 +5040,4 @@ function connection(ctx, socket, secret) {
|
|
|
5147
5040
|
//#endregion
|
|
5148
5041
|
export { BASELINE_NEWEST, MAX_LINE, MAX_UNREAD, keepServing, openHost, serve };
|
|
5149
5042
|
|
|
5150
|
-
//# sourceMappingURL=host-
|
|
5043
|
+
//# sourceMappingURL=host-D0MIWyOe.js.map
|