Download desktop/src/preload.js from EnergyVenom/patchwise-agent-studio: direct link, hf CLI and curl.
- Browser
- Download file 635 Bytes
-
https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/desktop/src/preload.js
- Command line
-
hf download hf://spaces/EnergyVenom/patchwise-agent-studio/desktop/src/preload.js
-
curl -L -o preload.js https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/desktop/src/preload.js
635 Bytes
| ; | |
| // Minimal, validated bridge. The renderer gets NO Node.js access (contextIsolation + sandbox + nodeIntegration off). | |
| const { contextBridge, ipcRenderer } = require('electron'); | |
| contextBridge.exposeInMainWorld('fptDesktop', { | |
| version: '1.0.0', | |
| notify: (title, body) => ipcRenderer.send('fpt:notify', { title: String(title), body: String(body) }), | |
| openSettings: () => ipcRenderer.send('fpt:open-settings'), | |
| // Only honoured by the main process for the local settings page: | |
| getConfig: () => ipcRenderer.invoke('fpt:get-config'), | |
| saveConfig: (cfg) => ipcRenderer.invoke('fpt:save-config', cfg), | |
| }); | |