@kenkaiiii/gg-boss 4.3.152 → 4.3.154

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/cli.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  use_app_default,
44
44
  use_input_default,
45
45
  use_stdout_default
46
- } from "./chunk-SFFLLX2R.js";
46
+ } from "./chunk-WGJRDNT6.js";
47
47
  import "./chunk-QT366Y52.js";
48
48
  import {
49
49
  source_default
@@ -336,7 +336,7 @@ init_esm_shims();
336
336
  // package.json
337
337
  var package_default = {
338
338
  name: "@kenkaiiii/gg-boss",
339
- version: "4.3.152",
339
+ version: "4.3.154",
340
340
  type: "module",
341
341
  description: "Orchestrator agent that drives multiple ggcoder sessions across projects from a single chat",
342
342
  license: "MIT",
@@ -1256,6 +1256,7 @@ var import_react10 = __toESM(require_react(), 1);
1256
1256
  // src/radio.ts
1257
1257
  init_esm_shims();
1258
1258
  import { spawn } from "child_process";
1259
+ import { existsSync } from "fs";
1259
1260
  var RADIO_STATIONS = [
1260
1261
  {
1261
1262
  id: "somafm-groove-salad",
@@ -1314,10 +1315,65 @@ function stopRadio() {
1314
1315
  currentStationId = null;
1315
1316
  log("INFO", "radio", "stopped");
1316
1317
  }
1318
+ function isWsl() {
1319
+ if (process.platform !== "linux") return false;
1320
+ return !!process.env.WSL_DISTRO_NAME || existsSync("/proc/sys/fs/binfmt_misc/WSLInterop");
1321
+ }
1322
+ function tryPlayOnWindowsHost(station) {
1323
+ const allowedUrls = new Set(RADIO_STATIONS.map((s) => s.url));
1324
+ if (!allowedUrls.has(station.url)) return null;
1325
+ if (!/^https?:\/\//i.test(station.url)) return null;
1326
+ const psScript = [
1327
+ "Add-Type -AssemblyName presentationCore;",
1328
+ "Add-Type -AssemblyName WindowsBase;",
1329
+ "$p = New-Object System.Windows.Media.MediaPlayer;",
1330
+ "$p.Open([uri]$env:GGBOSS_RADIO_URL);",
1331
+ "$p.Play();",
1332
+ "[System.Windows.Threading.Dispatcher]::Run();"
1333
+ ].join(" ");
1334
+ try {
1335
+ const child = spawn(
1336
+ "powershell.exe",
1337
+ ["-NoProfile", "-WindowStyle", "Hidden", "-Command", psScript],
1338
+ {
1339
+ detached: true,
1340
+ stdio: "ignore",
1341
+ env: {
1342
+ ...process.env,
1343
+ GGBOSS_RADIO_URL: station.url,
1344
+ WSLENV: (process.env.WSLENV ? process.env.WSLENV + ":" : "") + "GGBOSS_RADIO_URL"
1345
+ }
1346
+ }
1347
+ );
1348
+ return child;
1349
+ } catch {
1350
+ return null;
1351
+ }
1352
+ }
1317
1353
  function playRadio(stationId) {
1318
1354
  const station = RADIO_STATIONS.find((s) => s.id === stationId);
1319
1355
  if (!station) return { ok: false, error: `Unknown station: ${stationId}` };
1320
1356
  stopRadio();
1357
+ if (isWsl()) {
1358
+ const child = tryPlayOnWindowsHost(station);
1359
+ if (child) {
1360
+ let errored = false;
1361
+ child.once("error", () => {
1362
+ errored = true;
1363
+ });
1364
+ if (child.pid && !errored) {
1365
+ currentChild = child;
1366
+ currentStationId = stationId;
1367
+ log("INFO", "radio", "playing", {
1368
+ station: station.id,
1369
+ player: "powershell.exe (wsl\u2192host)",
1370
+ url: station.url
1371
+ });
1372
+ child.unref();
1373
+ return { ok: true };
1374
+ }
1375
+ }
1376
+ }
1321
1377
  for (const player of PLAYERS) {
1322
1378
  try {
1323
1379
  const child = spawn(player.cmd, player.args(station.url), {