Add MCP support (#1028)

This commit is contained in:
Will Chen
2025-09-19 15:43:39 -07:00
committed by GitHub
parent 7b160b7d0b
commit 6d3c397d40
39 changed files with 3865 additions and 650 deletions

View File

@@ -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({

View File

@@ -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,