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.
This commit is contained in:
ddonaldson130
2026-07-02 23:03:43 -04:00
parent 765218f80f
commit c7641f9d5e
3 changed files with 8 additions and 1 deletions

View File

@@ -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.

View File

@@ -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",

View File

@@ -8,7 +8,6 @@ ignoredBuiltDependencies:
- ssh2
onlyBuiltDependencies:
- '@homebridge/node-pty-prebuilt-multiarch'
- electron
- esbuild
- koffi
- protobufjs