arona-agent 1.1.7 → 1.1.8

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/gui/main.cjs CHANGED
@@ -1,9 +1,20 @@
1
1
  // ARONA GUI Electron 主进程:单窗口,与 Node 后端父进程经 stdin/stdout JSON lines 通信
2
2
  // (协议行前缀 ###GUI### 过滤 Electron 日志;与桌宠桥同模式)。
3
- const { app, BrowserWindow, ipcMain, nativeImage } = require("electron");
3
+ const { app, BrowserWindow, Menu, ipcMain, nativeImage } = require("electron");
4
4
  const fs = require("fs");
5
5
  const path = require("path");
6
6
 
7
+ // Windows:GUI 是纯 HTML/CSS(无 WebGL),默认硬件加速下页面加载/脚本均正常但不 paint(白屏,
8
+ // 无 did-fail-load / render-process-gone / renderer 报错)——本机硬件 GPU 合成路径有问题,禁 GPU 走
9
+ // 软件渲染(桌宠同款已验证配置)。ARONA_GUI_GPU=1 可强制恢复硬件加速用于排障对比。
10
+ if (process.platform === "win32" && process.env.ARONA_GUI_GPU !== "1") {
11
+ app.commandLine.appendSwitch("disable-gpu");
12
+ }
13
+ // 桌宠(pet/main.cjs)与本 GUI 是两个 Electron 进程,默认共用 userData(%APPDATA%/arona-agent)会
14
+ // 竞争磁盘缓存锁(日志表现:Unable to move the cache 0x5 / Gpu Cache Creation failed / DIPS SQLite
15
+ // 初始化失败),ready 前按进程隔离。
16
+ app.setPath("userData", path.join(app.getPath("appData"), "arona-agent-gui"));
17
+
7
18
  const APP_TITLE = "Arona Agent";
8
19
  const ICON_PATH = path.join(__dirname, "renderer", "assets", "icon.png");
9
20
 
@@ -226,8 +237,10 @@ function createWindow() {
226
237
  minHeight: 480,
227
238
  title: APP_TITLE,
228
239
  backgroundColor: "#f6f7f9",
229
- titleBarStyle: "hiddenInset",
230
- trafficLightPosition: { x: 16, y: 16 },
240
+ // hiddenInset/trafficLightPosition 是 macOS 专用(Windows 忽略 titleBarStyle,标准边框 + 无菜单)
241
+ ...(process.platform === "darwin"
242
+ ? { titleBarStyle: "hiddenInset", trafficLightPosition: { x: 16, y: 16 } }
243
+ : {}),
231
244
  icon: ICON_PATH,
232
245
  webPreferences: {
233
246
  preload: path.join(__dirname, "preload.cjs"),
@@ -247,6 +260,16 @@ function createWindow() {
247
260
  win.webContents.on("did-fail-load", (_e, code, desc, url) => {
248
261
  console.error(`[gui] did-fail-load ${code} ${desc} ${url}`);
249
262
  });
263
+ // renderer console → stderr:GUI 白屏等"进程活着但无画面"问题时可见。error 级无条件转发,
264
+ // 其余仅 VERBOSE(Electron 43 规范签名为单事件对象 event.{message,level,lineNumber},与桌宠同)
265
+ win.webContents.on("console-message", (event) => {
266
+ const msg = typeof event.message === "string" ? event.message : "";
267
+ if (!msg) return;
268
+ if (VERBOSE || event.level === 3) {
269
+ const line = event.lineNumber ? `:${event.lineNumber}` : "";
270
+ console.error(`[gui:render:${event.level ?? "?"}]${line} ${msg}`);
271
+ }
272
+ });
250
273
  if (VERBOSE) win.webContents.openDevTools({ mode: "detach" });
251
274
  }
252
275
 
@@ -279,11 +302,23 @@ app.on("window-all-closed", () => {
279
302
  });
280
303
 
281
304
  app.whenReady().then(() => {
305
+ // Windows 上默认应用菜单(File/Edit/View/Window)画进窗口顶部,GUI 用不到 → 移除
306
+ //(须在 ready 后调用;Ctrl+C/V 等编辑快捷键是原生行为不受影响,仅去掉 Reload/DevTools 默认键)
307
+ if (process.platform === "win32") Menu.setApplicationMenu(null);
282
308
  // macOS 开发模式下 Dock 图标默认是 Electron 图标,用 LOGO 替换(打包后由应用 bundle 提供)
283
309
  if (process.platform === "darwin" && app.dock) {
284
310
  const icon = nativeImage.createFromPath(ICON_PATH);
285
311
  if (!icon.isEmpty()) app.dock.setIcon(icon);
286
312
  }
313
+ if (VERBOSE) {
314
+ // GPU 功能状态:Windows 白屏排查关键(disable-gpu 下预期 gpu_compositing=disabled_software 且可正常上屏)
315
+ try {
316
+ console.error("[gui:verbose] GPU feature status:", JSON.stringify(app.getGPUFeatureStatus()));
317
+ } catch (e) {
318
+ console.error("[gui:verbose] getGPUFeatureStatus failed:", e.message);
319
+ }
320
+ console.error("[gui:verbose] platform:", process.platform, "electron:", process.versions.electron, "chrome:", process.versions.chrome);
321
+ }
287
322
  createWindow();
288
323
  });
289
324
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arona-agent",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Terminal AI Agent with desktop pet Arona — eye-tracking pupils, voice cloning, Computer Use, TTS/STT, MCP.",
5
5
  "keywords": ["voice-clone", "Blue Archive", "blue-archive", "ai-agent", "arona", "computer-use", "desktop-pet"],
6
6
  "license": "MIT",
package/pet/main.cjs CHANGED
@@ -8,6 +8,11 @@ const fs = require("fs");
8
8
  const os = require("os");
9
9
  const { AGENTS } = require("./agents.cjs");
10
10
 
11
+ // 与 GUI(gui/main.cjs)是两个 Electron 进程:默认共用 userData(%APPDATA%/arona-agent)会竞争磁盘
12
+ // 缓存锁(Windows 日志表现:Unable to move the cache 0x5 / Gpu Cache Creation failed / DIPS SQLite
13
+ // 初始化失败),ready 前按进程隔离。
14
+ app.setPath("userData", path.join(app.getPath("appData"), "arona-agent-pet"));
15
+
11
16
  // Windows 透明无边框窗口在部分显卡驱动下会触发渲染进程崩溃;禁 GPU 硬件加速(须在 app ready 前调用)。
12
17
  // 注意:不能用 app.disableHardwareAcceleration()——Electron 43 里它会顺带 --disable-software-rasterizer,
13
18
  // 把软件 WebGL 一并堵死(实测 getGPUFeatureStatus().webgl === "disabled_off",Spine 直接白屏)。
package/src/gui/index.ts CHANGED
@@ -41,7 +41,14 @@ class GuiBridge {
41
41
  const env: NodeJS.ProcessEnv = { ...process.env, ARONA_GUI: "1" };
42
42
  delete env.ELECTRON_RUN_AS_NODE;
43
43
  const args = ["--no-sandbox"];
44
- if (verbose) args.push("--enable-logging");
44
+ if (verbose) {
45
+ // --enable-logging:渲染进程 console(GPU 初始化失败等)原样打进 stderr,白屏根因不传则完全不可见;
46
+ // ARONA_GUI_VERBOSE:接通 gui/main.cjs 的 VERBOSE 分支(GPU feature status / renderer console
47
+ // 全量转发 / devtools 自动打开)——此前未接线,--verbose 下这些诊断从未生效过。
48
+ args.push("--enable-logging");
49
+ env.ARONA_GUI_VERBOSE = "1";
50
+ console.error(chalk.gray("[gui:verbose]"), "spawn", electronPath, args.concat(join(GUI_DIR, "main.cjs")).join(" "));
51
+ }
45
52
 
46
53
  this.proc = spawn(electronPath, args.concat(join(GUI_DIR, "main.cjs")), {
47
54
  env,