mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
Seventh main.cjs cluster peel. The two hermes:vscode-theme:* handlers (fetch,
search) move verbatim into electron/vscode-theme-ipc.cjs behind a
registerVscodeThemeIpc({ ipcMain }) registrar. Both delegate to the
vscode-marketplace sibling module, which the new module requires directly — so
the now-dead require in main.cjs is removed.
Channel names unchanged → preload + renderer untouched. Adds
electron/vscode-theme-ipc.test.cjs (surface invariant).
19 lines
922 B
JavaScript
19 lines
922 B
JavaScript
'use strict'
|
|
|
|
const { fetchMarketplaceThemes, searchMarketplaceThemes } = require('./vscode-marketplace.cjs')
|
|
|
|
// VS Code Marketplace color-theme IPC: fetch a theme by extension id + search the
|
|
// marketplace. Both delegate to the vscode-marketplace sibling module; no theme
|
|
// code is ever executed (only JSON is read from the .vsix).
|
|
function registerVscodeThemeIpc({ ipcMain }) {
|
|
// Download a VS Code Marketplace extension and return the raw color-theme JSON
|
|
// it contributes. No theme code is executed — we only read JSON from the .vsix.
|
|
ipcMain.handle('hermes:vscode-theme:fetch', async (_event, id) => fetchMarketplaceThemes(String(id || '')))
|
|
|
|
// Search the Marketplace for color-theme extensions (empty query = top installs).
|
|
ipcMain.handle('hermes:vscode-theme:search', async (_event, query) =>
|
|
searchMarketplaceThemes(String(query || ''), 20)
|
|
)
|
|
}
|
|
|
|
module.exports = { registerVscodeThemeIpc }
|