hermes-agent/apps/desktop/electron/pool-retirement-live-fixture/preload.ts
hermes-seaeye[bot] bc655bfb40
fmt(js): npm run fix on merge (#118250)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-21 14:41:52 +00:00

12 lines
615 B
TypeScript

import { contextBridge, ipcRenderer } from 'electron'
// Deliberate fixture IPC only; the renderer still uses production gateway/WS code.
contextBridge.exposeInMainWorld('hermesDesktop', {
getConnection: (profile: string) => ipcRenderer.invoke('retirement-fixture:descriptor', profile),
getConnectionFor: ({ profile }: { profile: string }) => ipcRenderer.invoke('retirement-fixture:descriptor', profile)
})
contextBridge.exposeInMainWorld('retirementFixture', {
onRetiring: (handler: (key: string) => void) => {
ipcRenderer.on('retirement-fixture:retiring', (_event, key: string) => handler(key))
}
})