Add MCP support (#1028)
This commit is contained in:
@@ -128,7 +128,7 @@ export type RuntimeMode = z.infer<typeof RuntimeModeSchema>;
|
||||
export const RuntimeMode2Schema = z.enum(["host", "docker"]);
|
||||
export type RuntimeMode2 = z.infer<typeof RuntimeMode2Schema>;
|
||||
|
||||
export const ChatModeSchema = z.enum(["build", "ask"]);
|
||||
export const ChatModeSchema = z.enum(["build", "ask", "agent"]);
|
||||
export type ChatMode = z.infer<typeof ChatModeSchema>;
|
||||
|
||||
export const GitHubSecretsSchema = z.object({
|
||||
|
||||
@@ -3,6 +3,7 @@ import { PostHog } from "posthog-js";
|
||||
import React from "react";
|
||||
import { CustomErrorToast } from "../components/CustomErrorToast";
|
||||
import { InputRequestToast } from "../components/InputRequestToast";
|
||||
import { McpConsentToast } from "../components/McpConsentToast";
|
||||
|
||||
/**
|
||||
* Toast utility functions for consistent notifications across the app
|
||||
@@ -111,6 +112,29 @@ export const showInputRequest = (
|
||||
return toastId;
|
||||
};
|
||||
|
||||
export function showMcpConsentToast(args: {
|
||||
serverName: string;
|
||||
toolName: string;
|
||||
toolDescription?: string | null;
|
||||
inputPreview?: string | null;
|
||||
onDecision: (d: "accept-once" | "accept-always" | "decline") => void;
|
||||
}) {
|
||||
const toastId = toast.custom(
|
||||
(t) => (
|
||||
<McpConsentToast
|
||||
toastId={t}
|
||||
serverName={args.serverName}
|
||||
toolName={args.toolName}
|
||||
toolDescription={args.toolDescription}
|
||||
inputPreview={args.inputPreview}
|
||||
onDecision={args.onDecision}
|
||||
/>
|
||||
),
|
||||
{ duration: Infinity },
|
||||
);
|
||||
return toastId;
|
||||
}
|
||||
|
||||
export const showExtraFilesToast = ({
|
||||
files,
|
||||
error,
|
||||
|
||||
Reference in New Issue
Block a user