const { contextBridge, ipcRenderer } = require('electron') contextBridge.exposeInMainWorld('tunjiAPI', { workspace: { select: () => ipcRenderer.invoke('workspace:select'), get: () => ipcRenderer.invoke('workspace:get'), set: (path) => ipcRenderer.invoke('workspace:set', path), ensureStructure: (path) => ipcRenderer.invoke('workspace:ensure-structure', path), }, file: { read: (filePath) => ipcRenderer.invoke('file:read', filePath), write: (filePath, content) => ipcRenderer.invoke('file:write', filePath, content), list: (dirPath) => ipcRenderer.invoke('file:list', dirPath), mkdir: (dirPath) => ipcRenderer.invoke('file:mkdir', dirPath), }, })