feat: add tool status management and localization for skill installation
- Updated chat message types to include tool statuses. - Enhanced localization files for English, Thai, and Chinese to support new tool status messages. - Modified HomePage and SkillsPage components to handle tool statuses in chat messages. - Implemented tool status merging and updating logic in the chat store. - Added handling for tool status events in the gateway event processing. - Created tests for chat message rendering with tool statuses and skill installation shortcuts. - Improved gateway event dispatching for tool lifecycle events.
This commit is contained in:
@@ -27,6 +27,12 @@ export function dispatchProtocolEvent(
|
||||
case 'ready':
|
||||
emitter.emit('gateway:ready', payload);
|
||||
break;
|
||||
case GatewayEventType.TOOL_CALL_STARTED:
|
||||
emitter.emit('tool:status', { status: 'running', payload });
|
||||
break;
|
||||
case GatewayEventType.TOOL_CALL_COMPLETED:
|
||||
emitter.emit('tool:status', { status: 'completed', payload });
|
||||
break;
|
||||
default:
|
||||
emitter.emit('notification', { method: event, params: payload });
|
||||
}
|
||||
@@ -44,6 +50,12 @@ export function dispatchJsonRpcNotification(
|
||||
case GatewayEventType.MESSAGE_RECEIVED:
|
||||
emitter.emit('chat:message', notification.params as { message: unknown });
|
||||
break;
|
||||
case GatewayEventType.TOOL_CALL_STARTED:
|
||||
emitter.emit('tool:status', { status: 'running', payload: notification.params });
|
||||
break;
|
||||
case GatewayEventType.TOOL_CALL_COMPLETED:
|
||||
emitter.emit('tool:status', { status: 'completed', payload: notification.params });
|
||||
break;
|
||||
case GatewayEventType.ERROR: {
|
||||
const errorData = notification.params as { message?: string };
|
||||
emitter.emit('error', new Error(errorData.message || 'Gateway error'));
|
||||
|
||||
Reference in New Issue
Block a user