import { Alert, AlertDescription } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { TabsContent } from "@/components/ui/tabs"; import { CreateMessageRequest, CreateMessageResult, } from "@modelcontextprotocol/sdk/types.js"; export type PendingRequest = { id: number; request: CreateMessageRequest; }; export type Props = { pendingRequests: PendingRequest[]; onApprove: (id: number, result: CreateMessageResult) => void; onReject: (id: number) => void; }; const SamplingTab = ({ pendingRequests, onApprove, onReject }: Props) => { const handleApprove = (id: number) => { // For now, just return a stub response onApprove(id, { model: "stub-model", stopReason: "endTurn", role: "assistant", content: { type: "text", text: "This is a stub response.", }, }); }; return ( When the server requests LLM sampling, requests will appear here for approval.

Recent Requests

{pendingRequests.map((request) => (
              {JSON.stringify(request.request, null, 2)}
            
))} {pendingRequests.length === 0 && (

No pending requests

)}
); }; export default SamplingTab;