hermes-agent/apps/desktop/electron/version-ipc.cjs
Brooklyn Nicholson 9d19cfbb78 refactor(desktop): extract app-version IPC from main.cjs into version-ipc.cjs
Ninth main.cjs cluster peel. The hermes:version handler moves verbatim into
electron/version-ipc.cjs behind a registerVersionIpc({ ipcMain,
resolveHermesVersion, resolveUpdateRoot }) registrar. The version + root resolvers
stay in the main process (shared with the About menu) and are injected.

Channel name unchanged → preload + renderer untouched. Adds
electron/version-ipc.test.cjs (surface + payload behavior).
2026-06-30 14:12:39 -05:00

17 lines
677 B
JavaScript

'use strict'
// App-version IPC: report the canonical Hermes version (resolved from the source
// tree, falling back to the Electron app version) alongside the Electron/Node
// runtime versions + the resolved Hermes root. The version + root resolvers live
// in the main process and are injected.
function registerVersionIpc({ ipcMain, resolveHermesVersion, resolveUpdateRoot }) {
ipcMain.handle('hermes:version', async () => ({
appVersion: resolveHermesVersion(),
electronVersion: process.versions.electron,
nodeVersion: process.versions.node,
platform: process.platform,
hermesRoot: resolveUpdateRoot()
}))
}
module.exports = { registerVersionIpc }