multica/apps/desktop/electron/ipc/index.ts
Jiang Bohan 2a4fcded03 feat(desktop): add IPC handlers for Hub, Tools, and Skills management
- Create hub.ts IPC handlers for Hub initialization and agent management
- Create agent.ts IPC handlers for tools list, toggle, setStatus, reload
- Create skills.ts IPC handlers for skills list, get, toggle, add, remove
- Expose typed electronAPI via preload.ts with contextBridge
- Add TypeScript definitions in electron-env.d.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:25:20 +08:00

39 lines
1.1 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 } from './hub.js'
import { registerAgentIpcHandlers, cleanupAgent } from './agent.js'
import { registerSkillsIpcHandlers } from './skills.js'
import { registerHubIpcHandlers, cleanupHub, initializeHub } from './hub.js'
/**
* Register all IPC handlers.
* Call this in main.ts after app is ready.
*/
export function registerAllIpcHandlers(): void {
registerHubIpcHandlers()
registerAgentIpcHandlers()
registerSkillsIpcHandlers()
}
/**
* 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()
}