gaslighting-engine 0.4.0 → 0.4.2

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.
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Gaslighting Mission Control</title>
7
- <script type="module" crossorigin src="/assets/index-BoI6eWtN.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-oFTvTTu8.css">
7
+ <script type="module" crossorigin src="./assets/index-BoI6eWtN.js"></script>
8
+ <link rel="stylesheet" crossorigin href="./assets/index-oFTvTTu8.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -28,10 +28,18 @@ export async function runDesktop(request = "", options) {
28
28
  async function resolveElectronCommand(mainPath) {
29
29
  try {
30
30
  const { default: electronPath } = await import("electron");
31
- return { file: String(electronPath), args: [mainPath] };
31
+ const electronFile = String(electronPath);
32
+ if (electronFile && existsSync(electronFile))
33
+ return { file: electronFile, args: [mainPath] };
32
34
  }
33
35
  catch {
34
- const npmFile = platform() === "win32" ? "npm.cmd" : "npm";
35
- return { file: npmFile, args: ["exec", "--yes", "--package", "electron", "--", "electron", mainPath] };
36
+ // Fall through to the npm-exec fallback below.
36
37
  }
38
+ if (platform() === "win32") {
39
+ return {
40
+ file: process.env.ComSpec || "cmd.exe",
41
+ args: ["/d", "/s", "/c", "npm", "exec", "--yes", "--package", "electron", "--", "electron", mainPath],
42
+ };
43
+ }
44
+ return { file: "npm", args: ["exec", "--yes", "--package", "electron", "--", "electron", mainPath] };
37
45
  }
@@ -1,7 +1,7 @@
1
1
  import { app, BrowserWindow, dialog, ipcMain } from "electron";
2
2
  import { spawn } from "node:child_process";
3
3
  import { existsSync } from "node:fs";
4
- import { join, resolve } from "node:path";
4
+ import { dirname, join, resolve } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { platform } from "node:os";
7
7
  import { analyze } from "../core/analyze.js";
@@ -16,6 +16,8 @@ import { writeDocs } from "../utils/file.js";
16
16
  import { packageVersion } from "../version.js";
17
17
  const initialRoot = resolve(process.env.GASLIGHTING_DESKTOP_ROOT || process.cwd());
18
18
  const initialRequest = process.env.GASLIGHTING_DESKTOP_REQUEST || "";
19
+ const desktopMainDir = dirname(fileURLToPath(import.meta.url));
20
+ const packageRoot = resolve(desktopMainDir, "..", "..");
19
21
  let currentRoot = initialRoot;
20
22
  let currentRequest = initialRequest || "Build a practical MVP without shrinking scope.";
21
23
  let mainWindow;
@@ -28,7 +30,7 @@ async function createWindow() {
28
30
  title: "Gaslighting Mission Control",
29
31
  backgroundColor: "#f5f5f3",
30
32
  webPreferences: {
31
- preload: join(app.getAppPath(), "dist", "desktop", "preload.js"),
33
+ preload: join(desktopMainDir, "preload.js"),
32
34
  contextIsolation: true,
33
35
  nodeIntegration: false,
34
36
  },
@@ -37,7 +39,7 @@ async function createWindow() {
37
39
  await mainWindow.loadURL("http://127.0.0.1:5173");
38
40
  }
39
41
  else {
40
- await mainWindow.loadFile(join(app.getAppPath(), "desktop-dist", "index.html"));
42
+ await mainWindow.loadFile(join(packageRoot, "desktop-dist", "index.html"));
41
43
  }
42
44
  }
43
45
  app.whenReady().then(createWindow);
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const packageName = "gaslighting-engine";
2
- export const packageVersion = "0.4.0";
2
+ export const packageVersion = "0.4.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaslighting-engine",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "LUDGI Gaslighting-engine: a hardcore project-discipline generator for AI coding agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",