multica/apps/desktop/electron/ipc/index.ts
Jiang Bohan 48245be52d feat(desktop): add provider IPC handlers
- Add provider.ts with handlers for list, current, set, saveApiKey, importOAuth
- Import OAuth credentials from CLI tools (Claude Code, Codex)
- Register provider handlers in IPC index
- Expose provider API in preload.ts with TypeScript types

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

45 lines
1.4 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'
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'
/**
* Register all IPC handlers.
* Call this in main.ts after app is ready.
*/
export function registerAllIpcHandlers(): void {
registerHubIpcHandlers()
registerAgentIpcHandlers()
registerSkillsIpcHandlers()
registerProfileIpcHandlers()
registerProviderIpcHandlers()
}
/**
* 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()
}