# Conflicts: # apps/desktop/electron/electron-env.d.ts # apps/desktop/electron/ipc/index.ts # apps/desktop/electron/preload.ts # apps/desktop/src/App.tsx # apps/desktop/src/pages/layout.tsx # src/agent/async-agent.ts # src/agent/runner.ts # src/hub/hub.ts
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
/**
|
|
* IPC handlers index - register all handlers from main process.
|
|
*/
|
|
export { registerAgentIpcHandlers, cleanupAgent } from './agent.js'
|
|
export { registerSkillsIpcHandlers } from './skills.js'
|
|
export { registerHubIpcHandlers, cleanupHub, initializeHub, setupDeviceConfirmation } from './hub.js'
|
|
export { registerProfileIpcHandlers } from './profile.js'
|
|
export { registerProviderIpcHandlers } from './provider.js'
|
|
export { registerChannelsIpcHandlers } from './channels.js'
|
|
export { registerCronIpcHandlers } from './cron.js'
|
|
export { registerHeartbeatIpcHandlers } from './heartbeat.js'
|
|
|
|
import { registerAgentIpcHandlers, cleanupAgent } from './agent.js'
|
|
import { registerSkillsIpcHandlers } from './skills.js'
|
|
import { registerHubIpcHandlers, cleanupHub, initializeHub } from './hub.js'
|
|
import { registerProfileIpcHandlers } from './profile.js'
|
|
import { registerProviderIpcHandlers } from './provider.js'
|
|
import { registerChannelsIpcHandlers } from './channels.js'
|
|
import { registerCronIpcHandlers } from './cron.js'
|
|
import { registerHeartbeatIpcHandlers } from './heartbeat.js'
|
|
|
|
/**
|
|
* Register all IPC handlers.
|
|
* Call this in main.ts after app is ready.
|
|
*/
|
|
export function registerAllIpcHandlers(): void {
|
|
registerHubIpcHandlers()
|
|
registerAgentIpcHandlers()
|
|
registerSkillsIpcHandlers()
|
|
registerProfileIpcHandlers()
|
|
registerProviderIpcHandlers()
|
|
registerChannelsIpcHandlers()
|
|
registerCronIpcHandlers()
|
|
registerHeartbeatIpcHandlers()
|
|
}
|
|
|
|
/**
|
|
* Initialize Hub and create default agent.
|
|
* Call this after IPC handlers are registered.
|
|
*/
|
|
export async function initializeApp(): Promise<void> {
|
|
console.log('[Desktop] Initializing app...')
|
|
await initializeHub()
|
|
console.log('[Desktop] App initialized')
|
|
}
|
|
|
|
/**
|
|
* Cleanup all resources.
|
|
* Call this before app quits.
|
|
*/
|
|
export function cleanupAll(): void {
|
|
cleanupHub()
|
|
cleanupAgent()
|
|
}
|