chore: restructure project and add i18n support
- Reorganize project structure with new electron and shared directories - Add comprehensive i18n support with Chinese, English, and Japanese locales - Update build configurations and TypeScript paths for new structure - Add various UI components including chat interface and task management - Include Windows release binaries and localization files - Update dependencies and fix import paths throughout the codebase
This commit is contained in:
51
electron/main.ts
Normal file
51
electron/main.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
import { CONFIG_KEYS } from '@lib/constants'
|
||||
import { setupMainWindow } from './wins';
|
||||
import started from 'electron-squirrel-startup'
|
||||
import configManager from '@electron/service/config-service'
|
||||
import { runTaskOperationService } from '@electron/process/runTaskOperationService'
|
||||
import log from 'electron-log';
|
||||
import 'bytenode'; // Ensure bytenode is bundled/externalized correctly
|
||||
|
||||
// import logManager from '@electron/service/logger'
|
||||
|
||||
|
||||
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
||||
if (started) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
// process.on('uncaughtException', (err) => {
|
||||
// logManager.error('uncaughtException', err);
|
||||
// });
|
||||
|
||||
// process.on('unhandledRejection', (reason, promise) => {
|
||||
// logManager.error('unhandledRejection', reason, promise);
|
||||
// });
|
||||
|
||||
app.whenReady().then(() => {
|
||||
setupMainWindow();
|
||||
|
||||
// 开启任务操作子进程
|
||||
runTaskOperationService()
|
||||
|
||||
// 开启subagent子进程
|
||||
});
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin' && !configManager.get(CONFIG_KEYS.MINIMIZE_TO_TRAY)) {
|
||||
log.info('app closing due to all windows being closed');
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
setupMainWindow();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user