wip: complete rework first round
This commit is contained in:
@@ -8,7 +8,6 @@ import { OpenCodeManager } from '../engine/OpenCodeManager';
|
||||
import { getPostEngine } from '../engine/PostEngine';
|
||||
import { getMediaEngine } from '../engine/MediaEngine';
|
||||
import { getDatabase } from '../database';
|
||||
import { getProtocolTelemetryService } from '../agentic/observability/protocolTelemetry';
|
||||
|
||||
let chatEngine: ChatEngine | null = null;
|
||||
let openCodeManager: OpenCodeManager | null = null;
|
||||
@@ -136,10 +135,6 @@ export function registerChatHandlers(): void {
|
||||
|
||||
// ============ Chat Settings ============
|
||||
|
||||
ipcMain.handle('chat:getProtocolHealth', async () => {
|
||||
return getProtocolTelemetryService().getSnapshot();
|
||||
});
|
||||
|
||||
// Get available models
|
||||
ipcMain.handle('chat:getAvailableModels', async () => {
|
||||
try {
|
||||
@@ -283,6 +278,11 @@ export function registerChatHandlers(): void {
|
||||
mainWindow.webContents.send('chat-tool-result', { conversationId, result });
|
||||
}
|
||||
},
|
||||
onA2UIMessage: (message) => {
|
||||
if (mainWindow) {
|
||||
mainWindow.webContents.send('a2ui-message', { conversationId, message });
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return result;
|
||||
@@ -379,6 +379,20 @@ export function registerChatHandlers(): void {
|
||||
return { success: false, error: (error as Error).message };
|
||||
}
|
||||
});
|
||||
|
||||
// ============ A2UI Actions ============
|
||||
|
||||
ipcMain.handle('a2ui:dispatch', async (_, action: { surfaceId: string; componentId: string; action: string; payload?: Record<string, unknown> }) => {
|
||||
try {
|
||||
console.log('[Chat IPC] A2UI action dispatched:', action);
|
||||
// Currently, A2UI actions are handled client-side (navigation, UI toggles).
|
||||
// Server-side action handling can be added here in the future.
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
console.error('[Chat IPC] Error dispatching A2UI action:', error);
|
||||
return { success: false, error: (error as Error).message };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user