Address PR #1219 minor observations
- Tighten ElicitationFormPanel story fixtures from satisfies ElicitRequest["params"] to satisfies ElicitRequestFormParams - Show model preferences container when modelPreferences exists even without hints, so costPriority/speedPriority/intelligencePriority are visible independently - Fix stop reason ordering to match SDK enum: endTurn, stopSequence, maxTokens Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
513582ad50
commit
4b2d4d1622
2 changed files with 14 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import type { ElicitRequest } from "@modelcontextprotocol/sdk/types.js";
|
||||
import type { ElicitRequestFormParams } from "@modelcontextprotocol/sdk/types.js";
|
||||
import { fn } from "storybook/test";
|
||||
import { ElicitationFormPanel } from "./ElicitationFormPanel";
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ const dbRequest = {
|
|||
database: { type: "string" as const, title: "Database" },
|
||||
},
|
||||
},
|
||||
} satisfies ElicitRequest["params"];
|
||||
} satisfies ElicitRequestFormParams;
|
||||
|
||||
const sslRequest = {
|
||||
message: "Please select your SSL mode preference.",
|
||||
|
|
@ -42,7 +42,7 @@ const sslRequest = {
|
|||
},
|
||||
},
|
||||
},
|
||||
} satisfies ElicitRequest["params"];
|
||||
} satisfies ElicitRequestFormParams;
|
||||
|
||||
const deployRequest = {
|
||||
message: "Please confirm the deployment.",
|
||||
|
|
@ -57,7 +57,7 @@ const deployRequest = {
|
|||
confirm: { type: "boolean" as const, title: "Confirm deployment" },
|
||||
},
|
||||
},
|
||||
} satisfies ElicitRequest["params"];
|
||||
} satisfies ElicitRequestFormParams;
|
||||
|
||||
export const SimpleForm: Story = {
|
||||
args: { request: dbRequest },
|
||||
|
|
|
|||
|
|
@ -85,16 +85,18 @@ export function SamplingRequestPanel({
|
|||
<MessageBubble key={index} index={index} message={message} />
|
||||
))}
|
||||
|
||||
{hints.length > 0 && (
|
||||
{modelPreferences && (
|
||||
<PreferencesContainer>
|
||||
<Stack gap="xs">
|
||||
<Title order={5}>Model Preferences:</Title>
|
||||
<Group gap="xs">
|
||||
<Text size="sm">Hints:</Text>
|
||||
{hints.map((hint) => (
|
||||
<Badge key={hint}>{hint}</Badge>
|
||||
))}
|
||||
</Group>
|
||||
{hints.length > 0 && (
|
||||
<Group gap="xs">
|
||||
<Text size="sm">Hints:</Text>
|
||||
{hints.map((hint) => (
|
||||
<Badge key={hint}>{hint}</Badge>
|
||||
))}
|
||||
</Group>
|
||||
)}
|
||||
{modelPreferences?.costPriority !== undefined && (
|
||||
<Text size="sm">
|
||||
Cost Priority: {formatPriority(modelPreferences.costPriority)}
|
||||
|
|
@ -160,7 +162,7 @@ export function SamplingRequestPanel({
|
|||
/>
|
||||
<Select
|
||||
label="Stop Reason"
|
||||
data={["endTurn", "maxTokens", "stopSequence"]}
|
||||
data={["endTurn", "stopSequence", "maxTokens"]}
|
||||
value={draftResult.stopReason ?? null}
|
||||
onChange={(value) =>
|
||||
onResultChange({
|
||||
|
|
|
|||
Loading…
Reference in a new issue