Phase 1: Refactor all 16 element component interfaces to use MCP SDK types
Replace ad-hoc local type definitions in element components with real
MCP SDK types and Inspector wrapper types from core/mcp/types.ts:
Schema-typed primitives:
- LogLevelBadge: LogLevel → LoggingLevel (SDK)
- TransportBadge: "stdio"|"http" → ServerType (core), add sse/streamable-http
- TaskStatusBadge: local TaskStatus → SDK TaskStatus (working/input_required/...)
- ServerStatusIndicator: inline union → ConnectionStatus (core), "failed"→"error"
MCP wrapper consumers:
- AnnotationBadge: label+variant → facet+value with SDK Role type
- CapabilityItem: name:string → capability:keyof ServerCapabilities|ClientCapabilities
- LogEntry: flat props → entry:{receivedAt:Date, params:LoggingMessageNotification["params"]}
- MessageBubble: flat props → message:SamplingMessage|PromptMessage
- ProgressDisplay: flat props → params:ProgressNotification["params"]
Composite-input elements:
- ContentViewer: type+content+mimeType → block:ContentBlock (SDK discriminated union)
- InlineError: message+details → error:{message,data?}
- ConnectionToggle: checked+loading+onChange → status:ConnectionStatus+onConnect/onDisconnect
Also updates all group/screen/view consumers to keep the build green,
and renames CSS variable --inspector-status-failed → --inspector-status-error.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f9a1aa4e3c
commit
2d4fca4fa6
2 changed files with 905 additions and 648 deletions
|
|
@ -16,20 +16,17 @@ export const FullCapabilities: Story = {
|
|||
protocolVersion: "2025-03-26",
|
||||
transport: "stdio",
|
||||
serverCapabilities: [
|
||||
{ name: "Tools", supported: true, count: 12 },
|
||||
{ name: "Resources", supported: true, count: 8 },
|
||||
{ name: "Prompts", supported: true, count: 5 },
|
||||
{ name: "Logging", supported: true },
|
||||
{ name: "Completions", supported: true },
|
||||
{ name: "Sampling", supported: true },
|
||||
{ name: "Elicitation", supported: true },
|
||||
{ capability: "tools", supported: true, count: 12 },
|
||||
{ capability: "resources", supported: true, count: 8 },
|
||||
{ capability: "prompts", supported: true, count: 5 },
|
||||
{ capability: "logging", supported: true },
|
||||
{ capability: "completions", supported: true },
|
||||
],
|
||||
clientCapabilities: [
|
||||
{ name: "Roots", supported: true, count: 3 },
|
||||
{ name: "Sampling", supported: true },
|
||||
{ name: "Elicitation", supported: true },
|
||||
{ name: "Notifications", supported: true },
|
||||
{ name: "Experimental", supported: true },
|
||||
{ capability: "roots", supported: true, count: 3 },
|
||||
{ capability: "sampling", supported: true },
|
||||
{ capability: "elicitation", supported: true },
|
||||
{ capability: "experimental", supported: true },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -39,16 +36,16 @@ export const MinimalCapabilities: Story = {
|
|||
name: "Simple Server",
|
||||
version: "1.0.0",
|
||||
protocolVersion: "2025-03-26",
|
||||
transport: "http",
|
||||
transport: "streamable-http",
|
||||
serverCapabilities: [
|
||||
{ name: "Tools", supported: true, count: 2 },
|
||||
{ name: "Resources", supported: false },
|
||||
{ name: "Prompts", supported: false },
|
||||
{ capability: "tools", supported: true, count: 2 },
|
||||
{ capability: "resources", supported: false },
|
||||
{ capability: "prompts", supported: false },
|
||||
],
|
||||
clientCapabilities: [
|
||||
{ name: "Roots", supported: true },
|
||||
{ name: "Sampling", supported: false },
|
||||
{ name: "Elicitation", supported: false },
|
||||
{ capability: "roots", supported: true },
|
||||
{ capability: "sampling", supported: false },
|
||||
{ capability: "elicitation", supported: false },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -60,13 +57,13 @@ export const WithInstructions: Story = {
|
|||
protocolVersion: "2025-03-26",
|
||||
transport: "stdio",
|
||||
serverCapabilities: [
|
||||
{ name: "Tools", supported: true, count: 4 },
|
||||
{ name: "Resources", supported: true, count: 2 },
|
||||
{ name: "Prompts", supported: true, count: 1 },
|
||||
{ capability: "tools", supported: true, count: 4 },
|
||||
{ capability: "resources", supported: true, count: 2 },
|
||||
{ capability: "prompts", supported: true, count: 1 },
|
||||
],
|
||||
clientCapabilities: [
|
||||
{ name: "Roots", supported: true },
|
||||
{ name: "Sampling", supported: true },
|
||||
{ capability: "roots", supported: true },
|
||||
{ capability: "sampling", supported: true },
|
||||
],
|
||||
instructions:
|
||||
"This server provides access to the project management system. Use the list_projects tool first to discover available projects before querying tasks. Rate limiting applies: max 60 requests per minute.",
|
||||
|
|
@ -78,14 +75,14 @@ export const WithOAuth: Story = {
|
|||
name: "Authenticated Server",
|
||||
version: "3.0.0",
|
||||
protocolVersion: "2025-03-26",
|
||||
transport: "http",
|
||||
transport: "streamable-http",
|
||||
serverCapabilities: [
|
||||
{ name: "Tools", supported: true, count: 6 },
|
||||
{ name: "Resources", supported: true, count: 3 },
|
||||
{ capability: "tools", supported: true, count: 6 },
|
||||
{ capability: "resources", supported: true, count: 3 },
|
||||
],
|
||||
clientCapabilities: [
|
||||
{ name: "Roots", supported: true },
|
||||
{ name: "Sampling", supported: false },
|
||||
{ capability: "roots", supported: true },
|
||||
{ capability: "sampling", supported: false },
|
||||
],
|
||||
oauthDetails: {
|
||||
authUrl: "https://auth.example.com/oauth2/authorize",
|
||||
|
|
|
|||
|
|
@ -7,21 +7,18 @@ import {
|
|||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { CapabilityItem } from "../../elements/CapabilityItem/CapabilityItem";
|
||||
|
||||
export interface CapabilityInfo {
|
||||
name: string;
|
||||
supported: boolean;
|
||||
count?: number;
|
||||
}
|
||||
import {
|
||||
CapabilityItem,
|
||||
type CapabilityItemProps,
|
||||
} from "../../elements/CapabilityItem/CapabilityItem";
|
||||
|
||||
export interface ServerInfoContentProps {
|
||||
name: string;
|
||||
version: string;
|
||||
protocolVersion: string;
|
||||
transport: string;
|
||||
serverCapabilities: CapabilityInfo[];
|
||||
clientCapabilities: CapabilityInfo[];
|
||||
serverCapabilities: CapabilityItemProps[];
|
||||
clientCapabilities: CapabilityItemProps[];
|
||||
instructions?: string;
|
||||
oauthDetails?: { authUrl?: string; scopes?: string[]; accessToken?: string };
|
||||
}
|
||||
|
|
@ -68,8 +65,8 @@ export function ServerInfoContent({
|
|||
<Title order={5}>Server Capabilities</Title>
|
||||
{serverCapabilities.map((cap) => (
|
||||
<CapabilityItem
|
||||
key={cap.name}
|
||||
name={cap.name}
|
||||
key={cap.capability}
|
||||
capability={cap.capability}
|
||||
supported={cap.supported}
|
||||
count={cap.count}
|
||||
/>
|
||||
|
|
@ -79,8 +76,8 @@ export function ServerInfoContent({
|
|||
<Title order={5}>Client Capabilities</Title>
|
||||
{clientCapabilities.map((cap) => (
|
||||
<CapabilityItem
|
||||
key={cap.name}
|
||||
name={cap.name}
|
||||
key={cap.capability}
|
||||
capability={cap.capability}
|
||||
supported={cap.supported}
|
||||
count={cap.count}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue