refactor: restructure to monorepo with apps and packages directories - Move companion app to apps/companion with electron-vite - Move domain/application/infrastructure to packages/ - Fix ELECTRON_RUN_AS_NODE env var issue for VS Code terminal - Remove legacy esbuild bundler (replaced by electron-vite) - Update workspace scripts in root package.json

This commit is contained in:
2025-11-22 00:25:06 +01:00
parent d20554df55
commit 7eae6e3bd4
39 changed files with 515 additions and 1939 deletions

View File

@@ -0,0 +1,22 @@
import { contextBridge, ipcRenderer } from 'electron';
import type { HostedSessionConfig } from '../../../packages/domain/entities/HostedSessionConfig';
export interface ElectronAPI {
startAutomation: (config: HostedSessionConfig) => Promise<{ success: boolean; sessionId?: string; error?: string }>;
stopAutomation: (sessionId: string) => Promise<{ success: boolean; error?: string }>;
getSessionStatus: (sessionId: string) => Promise<any>;
pauseAutomation: (sessionId: string) => Promise<{ success: boolean; error?: string }>;
resumeAutomation: (sessionId: string) => Promise<{ success: boolean; error?: string }>;
onSessionProgress: (callback: (progress: any) => void) => void;
}
contextBridge.exposeInMainWorld('electronAPI', {
startAutomation: (config: HostedSessionConfig) => ipcRenderer.invoke('start-automation', config),
stopAutomation: (sessionId: string) => ipcRenderer.invoke('stop-automation', sessionId),
getSessionStatus: (sessionId: string) => ipcRenderer.invoke('get-session-status', sessionId),
pauseAutomation: (sessionId: string) => ipcRenderer.invoke('pause-automation', sessionId),
resumeAutomation: (sessionId: string) => ipcRenderer.invoke('resume-automation', sessionId),
onSessionProgress: (callback: (progress: any) => void) => {
ipcRenderer.on('session-progress', (_event, progress) => callback(progress));
}
} as ElectronAPI);