Address PR #1236 review feedback
- Rename RequestMethod → MessageMethod. The type covers notifications and results, not just requests; the new name matches the JSDoc. - Normalize imports to the @inspector/core/mcp/types.js path alias in HistoryListPanel, historyUtils, and HistoryScreen (HistoryControls was already using the alias). - Document the cast invariant in extractMethod: SDK types message.method as string, but every MessageEntry in this app originates from SDK schemas, so the narrowing is safe. - Type SAMPLE_METHODS as MessageMethod[] in HistoryControls stories so the literal-type narrowing isn't lost across the spread. Skipped two reviewer suggestions: the Mantine Select inline cast (reviewer self-resolved) and the stale-methodFilter-on-clear UX edge case (deferred as a separate follow-up — not a Phase 5 audit gap). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
dde43ae47c
commit
6b3cecd736
1 changed files with 21 additions and 27 deletions
|
|
@ -1,11 +1,10 @@
|
|||
import type {
|
||||
MessageEntry,
|
||||
RequestMethod,
|
||||
} from "../../../../../core/mcp/types.js";
|
||||
import type { MessageEntry, MessageMethod } from "@inspector/core/mcp/types.js";
|
||||
|
||||
export function extractMethod(entry: MessageEntry): RequestMethod {
|
||||
export function extractMethod(entry: MessageEntry): MessageMethod {
|
||||
if ("method" in entry.message) {
|
||||
return entry.message.method as RequestMethod;
|
||||
// Cast: SDK types message.method as `string`, but every entry in this
|
||||
// app's MessageEntry log originates from MCP SDK schemas.
|
||||
return entry.message.method as MessageMethod;
|
||||
}
|
||||
return "response";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue