feat: implement MCP UIs

This commit is contained in:
Li Xin
2025-04-24 15:41:33 +08:00
parent d9ffb19950
commit 10b1d63834
32 changed files with 1419 additions and 321 deletions

View File

@@ -30,7 +30,7 @@ export function InputBox({
size?: "large" | "normal";
responding?: boolean;
feedback?: { option: Option } | null;
onSend?: (message: string, feedback: { option: Option } | null) => void;
onSend?: (message: string, options?: { interruptFeedback?: string }) => void;
onCancel?: () => void;
onRemoveFeedback?: () => void;
}) {
@@ -63,7 +63,9 @@ export function InputBox({
return;
}
if (onSend) {
onSend(message, feedback ?? null);
onSend(message, {
interruptFeedback: feedback?.option.value,
});
setMessage("");
onRemoveFeedback?.();
}