All of the mid-session and step-up auth work
This commit is contained in:
parent
1f31e0f1f8
commit
562bdd00f1
1 changed files with 11437 additions and 1212 deletions
|
|
@ -2,6 +2,7 @@ import React, { useState } from "react";
|
|||
import { Box, Text, useInput, type Key } from "ink";
|
||||
import { Form } from "ink-form";
|
||||
import { InspectorClient } from "@inspector/core/mcp/index.js";
|
||||
import { AuthRecoveryRequiredError } from "@inspector/core/auth/challenge.js";
|
||||
import type {
|
||||
Prompt,
|
||||
GetPromptResult,
|
||||
|
|
@ -29,6 +30,7 @@ interface PromptTestModalProps {
|
|||
width: number;
|
||||
height: number;
|
||||
onClose: () => void;
|
||||
onAuthRecoveryRequired?: (error: AuthRecoveryRequiredError) => void;
|
||||
}
|
||||
|
||||
type ModalState = "form" | "loading" | "results";
|
||||
|
|
@ -47,6 +49,7 @@ export function PromptTestModal({
|
|||
width,
|
||||
height,
|
||||
onClose,
|
||||
onAuthRecoveryRequired,
|
||||
}: PromptTestModalProps) {
|
||||
const [state, setState] = useState<ModalState>("form");
|
||||
const [result, setResult] = useState<PromptResult | null>(null);
|
||||
|
|
@ -144,6 +147,11 @@ export function PromptTestModal({
|
|||
});
|
||||
setState("results");
|
||||
} catch (error) {
|
||||
if (error instanceof AuthRecoveryRequiredError) {
|
||||
onAuthRecoveryRequired?.(error);
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
const duration = Date.now() - startTime;
|
||||
const errorMessage = getErrorMessage(error);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue