Skip to content

Commit 124c781

Browse files
committed
feat: add elicitation handling to App
1 parent 6c809bd commit 124c781

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

client/src/App.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ import {
7171
initializeInspectorConfig,
7272
saveInspectorConfig,
7373
} from "./utils/configUtils";
74+
import ElicitationModal, {
75+
ElicitationRequest,
76+
} from "./components/ElicitationModal";
7477

7578
const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
7679

@@ -124,6 +127,8 @@ const App = () => {
124127
}
125128
>
126129
>([]);
130+
const [pendingElicitationRequest, setPendingElicitationRequest] =
131+
useState<ElicitationRequest | null>(null);
127132
const [isAuthDebuggerVisible, setIsAuthDebuggerVisible] = useState(false);
128133

129134
// Auth debugger state
@@ -200,6 +205,14 @@ const App = () => {
200205
{ id: nextRequestId.current++, request, resolve, reject },
201206
]);
202207
},
208+
onElicitationRequest: (request, resolve) => {
209+
setPendingElicitationRequest({
210+
id: nextRequestId.current++,
211+
message: request.params.message,
212+
requestedSchema: request.params.requestedSchema,
213+
resolve,
214+
});
215+
},
203216
getRoots: () => rootsRef.current,
204217
});
205218

@@ -586,6 +599,10 @@ const App = () => {
586599
setStdErrNotifications([]);
587600
};
588601

602+
const handleCloseElicitationModal = () => {
603+
setPendingElicitationRequest(null);
604+
};
605+
589606
// Helper component for rendering the AuthDebugger
590607
const AuthDebuggerWrapper = () => (
591608
<TabsContent value="auth">
@@ -938,6 +955,11 @@ const App = () => {
938955
</div>
939956
</div>
940957
</div>
958+
959+
<ElicitationModal
960+
request={pendingElicitationRequest}
961+
onClose={handleCloseElicitationModal}
962+
/>
941963
</div>
942964
);
943965
};

0 commit comments

Comments
 (0)