mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
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).
17 lines
677 B
JavaScript
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 }
|