👨‍✈️ chore: Minor MCP-UI Logic Cleanup (#10950)

This commit is contained in:
Dustin Healy 2025-12-12 14:10:57 -08:00 committed by GitHub
parent 959e301f99
commit 5b0cce2e2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 14 deletions

View file

@ -1,4 +1,7 @@
import React from 'react';
import type { UIActionResult } from '@mcp-ui/client';
import { TAskFunction } from '~/common';
import logger from './logger';
export * from './map';
export * from './json';
@ -125,7 +128,7 @@ export const normalizeLayout = (layout: number[]) => {
return normalizedLayout;
};
export const handleUIAction = async (result: any, ask: any) => {
export const handleUIAction = async (result: UIActionResult, ask: TAskFunction) => {
const supportedTypes = ['intent', 'tool', 'prompt'];
const { type, payload } = result;
@ -171,12 +174,7 @@ Execute the intention of the prompt that is mentioned in the message using the t
`;
}
console.log('About to submit message:', messageText);
try {
await ask({ text: messageText });
console.log('Message submitted successfully');
} catch (error) {
console.error('Error submitting message:', error);
}
logger.debug('MCP-UI', 'About to submit message:', messageText);
ask({ text: messageText });
logger.debug('MCP-UI', 'Message submitted successfully');
};