/**
 * VLCode Lite — Electron Preload Script
 * Exposes safe APIs to the renderer via contextBridge.
 */
const { contextBridge, ipcRenderer } = require('electron');

contextBridge.exposeInMainWorld('vlcodeDesktop', {
  isElectron: true,
  platform: process.platform,
  arch: process.arch,
  pickDirectory(options = {}) {
    return ipcRenderer.invoke('vlcode:pick-directory', options);
  },
  openWorkspaceWindow(payload = {}) {
    return ipcRenderer.invoke('vlcode:open-workspace-window', payload);
  },
  versions: {
    electron: process.versions.electron,
    node: process.versions.node,
    chrome: process.versions.chrome,
  },
});
