accelr8 3.8.0 → 3.8.1
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/dist/chunks/{app-DCVVDS5A.js → app-7YGYMFSZ.js} +66 -25
- package/dist/chunks/{chunk-YUZORFN4.js → chunk-UTWXIX5N.js} +1 -1
- package/dist/chunks/{client-Y2PNGYRP.js → client-3RLQY3ZB.js} +1 -1
- package/dist/chunks/{server-6VK3AAAJ.js → server-V56IHFUH.js} +1 -1
- package/dist/cli.js +4 -4
- package/package.json +1 -1
|
@@ -5,11 +5,15 @@ import {
|
|
|
5
5
|
tzToCoords
|
|
6
6
|
} from "./chunk-HY6ULYGH.js";
|
|
7
7
|
import {
|
|
8
|
-
DEFAULT_SERVER
|
|
9
|
-
|
|
8
|
+
DEFAULT_SERVER,
|
|
9
|
+
VERSION
|
|
10
|
+
} from "./chunk-UTWXIX5N.js";
|
|
10
11
|
|
|
11
12
|
// src/radio/app.ts
|
|
12
13
|
import tk from "terminal-kit";
|
|
14
|
+
import fs from "node:fs";
|
|
15
|
+
import os from "node:os";
|
|
16
|
+
import path from "node:path";
|
|
13
17
|
import { WebSocket } from "ws";
|
|
14
18
|
|
|
15
19
|
// src/radio/asciivideo.ts
|
|
@@ -5463,6 +5467,15 @@ var SyncedAudio = class {
|
|
|
5463
5467
|
};
|
|
5464
5468
|
|
|
5465
5469
|
// src/radio/app.ts
|
|
5470
|
+
function rlog(msg) {
|
|
5471
|
+
try {
|
|
5472
|
+
const dir = path.join(os.homedir(), ".accelr8");
|
|
5473
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
5474
|
+
fs.appendFileSync(path.join(dir, "radio.log"), `${(/* @__PURE__ */ new Date()).toISOString()} ${msg}
|
|
5475
|
+
`);
|
|
5476
|
+
} catch {
|
|
5477
|
+
}
|
|
5478
|
+
}
|
|
5466
5479
|
var term = tk.terminal;
|
|
5467
5480
|
var ScreenBuffer = tk.ScreenBuffer;
|
|
5468
5481
|
var RENDER_FPS = 20;
|
|
@@ -5666,21 +5679,26 @@ function blitOverlay(cells) {
|
|
|
5666
5679
|
screen.put({ x: c.x, y: c.y, attr: { color: c.color ?? 231, bgColor: bg, bold: !!c.bold }, dx: 1, dy: 0, wrap: false }, c.ch || " ");
|
|
5667
5680
|
}
|
|
5668
5681
|
}
|
|
5682
|
+
var renderErrs = 0;
|
|
5669
5683
|
function renderFrame() {
|
|
5670
5684
|
if (!running) return;
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5685
|
+
try {
|
|
5686
|
+
const tMs = Date.now() - startedAt;
|
|
5687
|
+
if (visuals) {
|
|
5688
|
+
lastFrame = visuals.frame(tMs, screen.width, screen.height);
|
|
5689
|
+
frameW = screen.width;
|
|
5690
|
+
frameH = screen.height;
|
|
5691
|
+
}
|
|
5692
|
+
const serverNowMs = serverNow();
|
|
5693
|
+
state = { ...state, serverNowMs, nowPlaying: nowPlaying(state.schedule, serverNowMs), nowShowing: nowShowing(state.schedule, serverNowMs) };
|
|
5694
|
+
blitVideo();
|
|
5695
|
+
const cells = renderOverlay({ w: screen.width, h: screen.height, tMs, state });
|
|
5696
|
+
blitOverlay(cells);
|
|
5697
|
+
drawControls();
|
|
5698
|
+
if (screen.dst) screen.draw({ delta: true });
|
|
5699
|
+
} catch (e) {
|
|
5700
|
+
if (renderErrs++ < 5) rlog(`renderFrame error @${screen?.width}x${screen?.height}: ${e?.stack || e?.message || e}`);
|
|
5701
|
+
}
|
|
5684
5702
|
}
|
|
5685
5703
|
function teardown() {
|
|
5686
5704
|
running = false;
|
|
@@ -5715,23 +5733,46 @@ function quit() {
|
|
|
5715
5733
|
process.exit(0);
|
|
5716
5734
|
}
|
|
5717
5735
|
function runRadio(opts) {
|
|
5718
|
-
|
|
5736
|
+
let tz = "UTC";
|
|
5737
|
+
try {
|
|
5738
|
+
tz = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
5739
|
+
} catch {
|
|
5740
|
+
}
|
|
5719
5741
|
me = { id: "me_" + Math.random().toString(36).slice(2, 10), name: opts.name || "you", tz, color: 39 };
|
|
5720
5742
|
state = baseState(me);
|
|
5743
|
+
try {
|
|
5744
|
+
const tools = detectVoiceTools();
|
|
5745
|
+
rlog(`\u2500\u2500 radio start v${VERSION} \xB7 ${process.platform} \xB7 node ${process.version} \xB7 term ${process.stdout.columns}x${process.stdout.rows} \xB7 TERM=${process.env.TERM} \xB7 ffmpeg=${!!tools.ffmpegPath} ffplay=${!!tools.ffplayPath}`);
|
|
5746
|
+
} catch (e) {
|
|
5747
|
+
rlog(`start probe failed: ${e?.stack || e}`);
|
|
5748
|
+
}
|
|
5721
5749
|
const die = (err) => {
|
|
5750
|
+
const detail = err instanceof Error ? err.stack || err.message : String(err);
|
|
5751
|
+
rlog(`CRASH: ${detail}`);
|
|
5722
5752
|
teardown();
|
|
5723
|
-
console.error("
|
|
5724
|
-
|
|
5753
|
+
console.error("\naccelr8 radio crashed:\n" + detail + "\n\nlog: " + path.join(os.homedir(), ".accelr8", "radio.log") + "\n(press any key to close)");
|
|
5754
|
+
try {
|
|
5755
|
+
process.stdin.setRawMode?.(true);
|
|
5756
|
+
process.stdin.resume();
|
|
5757
|
+
process.stdin.once("data", () => process.exit(1));
|
|
5758
|
+
setTimeout(() => process.exit(1), 3e4);
|
|
5759
|
+
} catch {
|
|
5760
|
+
process.exit(1);
|
|
5761
|
+
}
|
|
5725
5762
|
};
|
|
5726
5763
|
process.on("uncaughtException", die);
|
|
5727
5764
|
process.on("unhandledRejection", die);
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5765
|
+
try {
|
|
5766
|
+
term.fullscreen(true);
|
|
5767
|
+
term.hideCursor();
|
|
5768
|
+
term.grabInput(true);
|
|
5769
|
+
makeScreen();
|
|
5770
|
+
running = true;
|
|
5771
|
+
startBackground(opts);
|
|
5772
|
+
connectStation(opts);
|
|
5773
|
+
} catch (e) {
|
|
5774
|
+
return die(e);
|
|
5775
|
+
}
|
|
5735
5776
|
term.on("key", (name) => {
|
|
5736
5777
|
if (name === "CTRL_C" || name === "q" || name === "ESCAPE") return quit();
|
|
5737
5778
|
if (name === "m") return muteToggle();
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DEFAULT_SERVER,
|
|
4
4
|
PORT,
|
|
5
5
|
VERSION
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-UTWXIX5N.js";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
var HELP = `
|
|
@@ -53,7 +53,7 @@ async function main() {
|
|
|
53
53
|
console.error(`invalid port: ${argVal(args, "--port")}`);
|
|
54
54
|
process.exit(1);
|
|
55
55
|
}
|
|
56
|
-
const { runServer } = await import("./chunks/server-
|
|
56
|
+
const { runServer } = await import("./chunks/server-V56IHFUH.js");
|
|
57
57
|
runServer(port);
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
@@ -67,7 +67,7 @@ async function main() {
|
|
|
67
67
|
console.error("accelr8 radio needs an interactive terminal (TTY).");
|
|
68
68
|
process.exit(1);
|
|
69
69
|
}
|
|
70
|
-
const { runRadio } = await import("./chunks/app-
|
|
70
|
+
const { runRadio } = await import("./chunks/app-7YGYMFSZ.js");
|
|
71
71
|
runRadio({
|
|
72
72
|
name: argVal(args, "--name"),
|
|
73
73
|
server: argVal(args, "--server"),
|
|
@@ -90,7 +90,7 @@ async function main() {
|
|
|
90
90
|
const { cachedUpdate, refreshUpdateCache } = await import("./chunks/update-UEPNGB6Y.js");
|
|
91
91
|
refreshUpdateCache();
|
|
92
92
|
const update = cachedUpdate(VERSION);
|
|
93
|
-
const { runClient } = await import("./chunks/client-
|
|
93
|
+
const { runClient } = await import("./chunks/client-3RLQY3ZB.js");
|
|
94
94
|
runClient({
|
|
95
95
|
name: argVal(args, "--name"),
|
|
96
96
|
server: argVal(args, "--server"),
|