From 124c78125365c4a41e5479b08ad307a5b472f45b Mon Sep 17 00:00:00 2001 From: Alex Andru Date: Thu, 19 Jun 2025 17:22:44 +0200 Subject: [PATCH] feat: add elicitation handling to App --- client/src/App.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/client/src/App.tsx b/client/src/App.tsx index 26eb44c5..8e5570ae 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -71,6 +71,9 @@ import { initializeInspectorConfig, saveInspectorConfig, } from "./utils/configUtils"; +import ElicitationModal, { + ElicitationRequest, +} from "./components/ElicitationModal"; const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1"; @@ -124,6 +127,8 @@ const App = () => { } > >([]); + const [pendingElicitationRequest, setPendingElicitationRequest] = + useState(null); const [isAuthDebuggerVisible, setIsAuthDebuggerVisible] = useState(false); // Auth debugger state @@ -200,6 +205,14 @@ const App = () => { { id: nextRequestId.current++, request, resolve, reject }, ]); }, + onElicitationRequest: (request, resolve) => { + setPendingElicitationRequest({ + id: nextRequestId.current++, + message: request.params.message, + requestedSchema: request.params.requestedSchema, + resolve, + }); + }, getRoots: () => rootsRef.current, }); @@ -586,6 +599,10 @@ const App = () => { setStdErrNotifications([]); }; + const handleCloseElicitationModal = () => { + setPendingElicitationRequest(null); + }; + // Helper component for rendering the AuthDebugger const AuthDebuggerWrapper = () => ( @@ -938,6 +955,11 @@ const App = () => { + + ); };