const {contextBridge,ipcRenderer,webUtils}=require('electron'); const names=['bootstrap','newProject','openProject','saveProject','importFiles','importFolder','importDrop','updateProject','splitClip','undo','export','preview','analyze','semanticSearch','proxy','plan','assemble','applyPlan','saveConfig','models','testModel','requestLogs','hardware','ollamaStatus','ollamaStart','ollamaStop','ollamaPull','ollamaDelete','ollamaInstall','cancelTask','relink','reveal','packMedia','clearCache','openRecent']; const api=Object.fromEntries(names.map(n=>[n,(...args)=>ipcRenderer.invoke(n,...args)])); api.dropPaths=files=>Array.from(files).map(f=>webUtils.getPathForFile(f)); api.onEvent=fn=>{const cb=(_,event)=>fn(event);ipcRenderer.on('event',cb);return()=>ipcRenderer.removeListener('event',cb);}; contextBridge.exposeInMainWorld('studio',api);