accelr8 3.3.1 → 3.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/protocol.ts
4
- var VERSION = true ? "3.3.1" : "3.3.1";
4
+ var VERSION = true ? "3.5.0" : "3.5.0";
5
5
  var PROTO = 3;
6
6
  var PORT = 8787;
7
7
  var DEFAULT_SERVER = "wss://accelr8-canvas.patonchain.workers.dev";
@@ -1,13 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- CANVAS_H,
4
- CANVAS_W,
5
- DEFAULT_SERVER,
6
- PROTO,
7
- VERSION,
8
- decode,
9
- encode
10
- } from "./chunk-EDJM2GDQ.js";
11
2
  import {
12
3
  DEFAULT_MODEL,
13
4
  addAccount,
@@ -33,11 +24,20 @@ import {
33
24
  vlogSession,
34
25
  voiceLogPath
35
26
  } from "./chunk-HY6ULYGH.js";
27
+ import {
28
+ CANVAS_H,
29
+ CANVAS_W,
30
+ DEFAULT_SERVER,
31
+ PROTO,
32
+ VERSION,
33
+ decode,
34
+ encode
35
+ } from "./chunk-HXKHZMYJ.js";
36
36
 
37
37
  // src/client.ts
38
38
  import tk from "terminal-kit";
39
39
  import { WebSocket } from "ws";
40
- import { spawn } from "node:child_process";
40
+ import { spawn as spawn2 } from "node:child_process";
41
41
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
42
42
  import { homedir } from "node:os";
43
43
  import { join } from "node:path";
@@ -845,6 +845,64 @@ var CinePlayer = class {
845
845
  }
846
846
  };
847
847
 
848
+ // src/radio/launch.ts
849
+ import { spawn } from "node:child_process";
850
+ import path from "node:path";
851
+ function radioCommand() {
852
+ const entry = process.argv[1] || "";
853
+ const isSource = /src[/\\]cli\.ts$/.test(entry);
854
+ if (isSource) {
855
+ const repo = path.resolve(path.dirname(entry), "..");
856
+ return `cd '${repo}' && npx tsx '${entry}' radio`;
857
+ }
858
+ return "accelr8 radio";
859
+ }
860
+ function windowSpawn(platform, cmd, termProgram) {
861
+ if (platform === "darwin") {
862
+ if (termProgram === "iTerm.app") {
863
+ return { file: "osascript", args: ["-e", `tell application "iTerm" to create window with default profile command "${cmd}"`] };
864
+ }
865
+ return { file: "osascript", args: ["-e", `tell application "Terminal" to do script "${cmd}"`, "-e", 'tell application "Terminal" to activate'] };
866
+ }
867
+ if (platform === "win32") {
868
+ return { file: "cmd", args: ["/c", "start", "", "cmd", "/k", cmd] };
869
+ }
870
+ return null;
871
+ }
872
+ var LINUX_TERMINALS = [
873
+ { file: "x-terminal-emulator", mk: (c) => ["-e", "sh", "-c", c] },
874
+ { file: "gnome-terminal", mk: (c) => ["--", "sh", "-c", c] },
875
+ { file: "konsole", mk: (c) => ["-e", "sh", "-c", c] },
876
+ { file: "xfce4-terminal", mk: (c) => ["-e", `sh -c '${c}'`] },
877
+ { file: "alacritty", mk: (c) => ["-e", "sh", "-c", c] },
878
+ { file: "kitty", mk: (c) => ["sh", "-c", c] },
879
+ { file: "xterm", mk: (c) => ["-e", "sh", "-c", c] }
880
+ ];
881
+ function launchRadioWindow() {
882
+ const cmd = radioCommand();
883
+ const fallback = cmd;
884
+ try {
885
+ const plan = windowSpawn(process.platform, cmd, process.env.TERM_PROGRAM);
886
+ if (plan) {
887
+ spawn(plan.file, plan.args, { detached: true, stdio: "ignore" }).unref();
888
+ return { ok: true, fallback };
889
+ }
890
+ for (const t of LINUX_TERMINALS) {
891
+ try {
892
+ const child = spawn(t.file, t.mk(cmd), { detached: true, stdio: "ignore" });
893
+ child.on("error", () => {
894
+ });
895
+ child.unref();
896
+ return { ok: true, fallback };
897
+ } catch {
898
+ }
899
+ }
900
+ return { ok: false, fallback };
901
+ } catch {
902
+ return { ok: false, fallback };
903
+ }
904
+ }
905
+
848
906
  // src/orb.ts
849
907
  var ACCENT2 = 39;
850
908
  var BRIGHT = 231;
@@ -1647,6 +1705,10 @@ function openSettings() {
1647
1705
  overlay = "settings";
1648
1706
  overlayFocus = 0;
1649
1707
  }
1708
+ function openRadio() {
1709
+ const r = launchRadioWindow();
1710
+ state.status = r.ok ? "ACCELR8 radio opening in a new window \u266B" : `run this to tune in: ${r.fallback}`;
1711
+ }
1650
1712
  function goHome() {
1651
1713
  if (state.project) {
1652
1714
  if (voiceOn) leaveVoice();
@@ -2744,7 +2806,8 @@ function renderHome(rung) {
2744
2806
  let bx = 2;
2745
2807
  bx = button(bx, y, " + new project ", { bgColor: C.good, color: onFill(C.good), bold: true }, promptCreate) + 2;
2746
2808
  bx = button(bx, y, " join by code ", { bgColor: C.accent, color: onFill(C.accent), bold: true }, promptJoin) + 2;
2747
- button(bx, y, " accounts ", { bgColor: C.tabOff, color: C.text }, openAccounts);
2809
+ bx = button(bx, y, " accounts ", { bgColor: C.tabOff, color: C.text }, openAccounts) + 2;
2810
+ button(bx, y, " \u266B radio \u2197 ", { bgColor: C.tabOff, color: readableFg(213, C.tabOff), bold: true }, openRadio);
2748
2811
  y += 2;
2749
2812
  if (bootHint) puts(2, H() - 1, bootHint, { color: C.dim });
2750
2813
  if (state.projects.length === 0) {
@@ -3490,7 +3553,7 @@ function copyToClipboard(text, tools) {
3490
3553
  return;
3491
3554
  }
3492
3555
  try {
3493
- const p = spawn(tool, args, { stdio: ["pipe", "ignore", "ignore"] });
3556
+ const p = spawn2(tool, args, { stdio: ["pipe", "ignore", "ignore"] });
3494
3557
  p.on("error", () => copyToClipboard(text, candidatesList.slice(1)));
3495
3558
  p.on("close", (code) => {
3496
3559
  state.status = code === 0 ? "copied join command" : "copy failed";
@@ -6,7 +6,7 @@ import {
6
6
  LIMITS,
7
7
  PORT,
8
8
  PROTO
9
- } from "./chunk-EDJM2GDQ.js";
9
+ } from "./chunk-HXKHZMYJ.js";
10
10
 
11
11
  // src/server.ts
12
12
  import { WebSocketServer, WebSocket } from "ws";
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DEFAULT_SERVER,
4
4
  PORT,
5
5
  VERSION
6
- } from "./chunks/chunk-EDJM2GDQ.js";
6
+ } from "./chunks/chunk-HXKHZMYJ.js";
7
7
 
8
8
  // src/cli.ts
9
9
  var HELP = `
@@ -13,6 +13,7 @@ USAGE
13
13
  accelr8 open the app
14
14
  accelr8 join <CODE> open straight into a project
15
15
  accelr8 serve run your own sync server
16
+ accelr8 radio tune in to ACCELR8 radio (or press the button)
16
17
  accelr8 --intro replay the opening cinematic
17
18
 
18
19
  OPTIONS
@@ -52,7 +53,7 @@ async function main() {
52
53
  console.error(`invalid port: ${argVal(args, "--port")}`);
53
54
  process.exit(1);
54
55
  }
55
- const { runServer } = await import("./chunks/server-EMXYO3SS.js");
56
+ const { runServer } = await import("./chunks/server-2YXWW32W.js");
56
57
  runServer(port);
57
58
  return;
58
59
  }
@@ -66,7 +67,7 @@ async function main() {
66
67
  console.error("accelr8 radio needs an interactive terminal (TTY).");
67
68
  process.exit(1);
68
69
  }
69
- const { runRadio } = await import("./chunks/app-VQ33JVDI.js");
70
+ const { runRadio } = await import("./chunks/app-RF2DF5XE.js");
70
71
  runRadio({
71
72
  name: argVal(args, "--name"),
72
73
  server: argVal(args, "--server"),
@@ -89,7 +90,7 @@ async function main() {
89
90
  const { cachedUpdate, refreshUpdateCache } = await import("./chunks/update-UEPNGB6Y.js");
90
91
  refreshUpdateCache();
91
92
  const update = cachedUpdate(VERSION);
92
- const { runClient } = await import("./chunks/client-TPFFAT7E.js");
93
+ const { runClient } = await import("./chunks/client-LW44RAH4.js");
93
94
  runClient({
94
95
  name: argVal(args, "--name"),
95
96
  server: argVal(args, "--server"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accelr8",
3
- "version": "3.3.1",
3
+ "version": "3.5.0",
4
4
  "description": "Collaborative ascii canvas in your terminal. Real multiplayer, live cursors, mouse-driven TUI.",
5
5
  "type": "module",
6
6
  "license": "ISC",
@@ -42,8 +42,8 @@
42
42
  "chattest": "tsx src/chattest.ts",
43
43
  "inputtest": "tsx src/inputtest.ts",
44
44
  "torturetest": "tsx src/torturetest.ts",
45
- "test": "for t in core chat input ladder boot orb crypto accounts executor agentcontext map voice voiceroom chain glyph materialize update install geo map contrast; do tsx src/${t}test.ts || exit 1; done && for t in station asciivideo audio funfacts launch overlay; do tsx src/radio/${t}test.ts || exit 1; done && tsx src/rendertest.ts > /dev/null && echo RENDER OK",
46
- "teste2e": "tsx src/voicetransporttest.ts",
45
+ "test": "for t in core chat input ladder boot orb crypto accounts executor agentcontext map voice voiceroom glyph materialize update install geo map contrast; do tsx src/${t}test.ts || exit 1; done && for t in station asciivideo audio funfacts launch overlay visualizers showrunner scenessweep; do tsx src/radio/${t}test.ts || exit 1; done && tsx src/rendertest.ts > /dev/null && echo RENDER OK",
46
+ "teste2e": "tsx src/voicetransporttest.ts && tsx src/chaintest.ts",
47
47
  "laddertest": "tsx src/laddertest.ts",
48
48
  "boottest": "tsx src/boottest.ts",
49
49
  "reconnecttest": "tsx src/reconnecttest.ts",