mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
All business logic has been migrated to the REST API server. This removes obsolete Electron IPC handlers and services that are no longer used: - Deleted electron/services/ directory (18 files) - Deleted electron/agent-service.js - Deleted electron/auto-mode-service.js - Renamed main-simplified.js → main.js - Renamed preload-simplified.js → preload.js - Removed unused dependencies from package.json The Electron layer now only handles native OS features (10 IPC handlers): - File dialogs, shell operations, and app info 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
/**
|
|
* Simplified Electron preload script
|
|
*
|
|
* Only exposes native features (dialogs, shell) and server URL.
|
|
* All other operations go through HTTP API.
|
|
*/
|
|
|
|
const { contextBridge, ipcRenderer } = require("electron");
|
|
|
|
// Expose minimal API for native features
|
|
contextBridge.exposeInMainWorld("electronAPI", {
|
|
// Platform info
|
|
platform: process.platform,
|
|
isElectron: true,
|
|
|
|
// Connection check
|
|
ping: () => ipcRenderer.invoke("ping"),
|
|
|
|
// Get server URL for HTTP client
|
|
getServerUrl: () => ipcRenderer.invoke("server:getUrl"),
|
|
|
|
// Native dialogs - better UX than prompt()
|
|
openDirectory: () => ipcRenderer.invoke("dialog:openDirectory"),
|
|
openFile: (options) => ipcRenderer.invoke("dialog:openFile", options),
|
|
saveFile: (options) => ipcRenderer.invoke("dialog:saveFile", options),
|
|
|
|
// Shell operations
|
|
openExternalLink: (url) => ipcRenderer.invoke("shell:openExternal", url),
|
|
openPath: (filePath) => ipcRenderer.invoke("shell:openPath", filePath),
|
|
|
|
// App info
|
|
getPath: (name) => ipcRenderer.invoke("app:getPath", name),
|
|
getVersion: () => ipcRenderer.invoke("app:getVersion"),
|
|
isPackaged: () => ipcRenderer.invoke("app:isPackaged"),
|
|
});
|
|
|
|
console.log("[Preload] Electron API exposed (simplified mode)");
|