From c7641f9d5e182e05e47d74b2d2f27568e962a399 Mon Sep 17 00:00:00 2001 From: ddonaldson130 Date: Thu, 2 Jul 2026 23:03:43 -0400 Subject: [PATCH] fix(cli): add electron as runtime dependency for fusion desktop The published @runfusion/fusion package ships the desktop runtime assets in dist/desktop/, but the [title-id-drift] db.ts migration normalized 0 active titles [done-paused-backfill] db.ts migration repaired 0 done task rows [title-id-drift] archive-db normalized 0 archived titles [desktop] Auto-registered project "Fusion" at C:\Users\drewd\Tools\fusion-latest [server:terminal] WebSocket server mounted { path: '/api/terminal/ws' } [ai-session-store] Cleanup removed stale sessions { terminalDeleted: 0, orphanedDeleted: 0, totalDeleted: 0, maxAgeMs: 604800000, operation: 'cleanup-stale-sessions', _emittedAt: '2026-07-03T03:03:31.683Z', _diagnosticsId: 'bc57bc09-d320-46b1-8717-a139f95bb9b7' } [server] AI session cleanup summary { message: 'Removed stale AI sessions', source: 'initial', ttlMs: 604800000, terminalDeleted: 0, orphanedDeleted: 0, totalDeleted: 0 } command calls require('electron') to find the Electron binary. Electron was only declared as a built dependency in pnpm-workspace.yaml, which makes it available during source builds but does not include it in the published npm package. As a result, [title-id-drift] archive-db normalized 0 archived titles [server:terminal] WebSocket server mounted { path: '/api/terminal/ws' } [ai-session-store] Cleanup removed stale sessions { terminalDeleted: 0, orphanedDeleted: 0, totalDeleted: 0, maxAgeMs: 604800000, operation: 'cleanup-stale-sessions', _emittedAt: '2026-07-03T03:03:37.491Z', _diagnosticsId: 'a0c428a8-133d-4673-ab93-82a092646b13' } [server] AI session cleanup summary { message: 'Removed stale AI sessions', source: 'initial', ttlMs: 604800000, terminalDeleted: 0, orphanedDeleted: 0, totalDeleted: 0 } fails or hangs for npm consumers. Fix: move electron to the dependencies of @runfusion/fusion so it is installed alongside the CLI, and remove it from onlyBuiltDependencies. Fixes: the desktop launcher regression where [title-id-drift] archive-db normalized 0 archived titles [server:terminal] WebSocket server mounted { path: '/api/terminal/ws' } [ai-session-store] Cleanup removed stale sessions { terminalDeleted: 0, orphanedDeleted: 0, totalDeleted: 0, maxAgeMs: 604800000, operation: 'cleanup-stale-sessions', _emittedAt: '2026-07-03T03:03:43.460Z', _diagnosticsId: '325b9f28-e5d3-4937-855e-c5d1b95420b8' } [server] AI session cleanup summary { message: 'Removed stale AI sessions', source: 'initial', ttlMs: 604800000, terminalDeleted: 0, orphanedDeleted: 0, totalDeleted: 0 } cannot resolve the Electron binary from a normal npm install. --- .changeset/fix-desktop-electron-dep.md | 7 +++++++ packages/cli/package.json | 1 + pnpm-workspace.yaml | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-desktop-electron-dep.md diff --git a/.changeset/fix-desktop-electron-dep.md b/.changeset/fix-desktop-electron-dep.md new file mode 100644 index 0000000000..3aa63fe5e8 --- /dev/null +++ b/.changeset/fix-desktop-electron-dep.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": patch +--- + +summary: Add `electron` as a runtime dependency so `fusion desktop` works from a published npm install. +category: fix +dev: `packages/cli/package.json` now depends on `electron`. Previously the desktop launcher called `require("electron")`, which is only available inside the source checkout (via `pnpm-workspace.yaml` `onlyBuiltDependencies`) and is missing for npm consumers, causing `fusion desktop` to hang or fail silently. diff --git a/packages/cli/package.json b/packages/cli/package.json index 3b61055f03..d14f7d292a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -63,6 +63,7 @@ "@earendil-works/pi-coding-agent": "^0.80.3", "dockerode": "^4.0.12", "express": "^5.1.0", + "electron": "^33.4.11", "i18next": "^26.3.1", "ink": "^7.0.5", "ink-spinner": "^5.0.0", diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6644bf1570..21279d44e9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,7 +8,6 @@ ignoredBuiltDependencies: - ssh2 onlyBuiltDependencies: - '@homebridge/node-pty-prebuilt-multiarch' - - electron - esbuild - koffi - protobufjs