refactor(web): rename "History" tab/feature to "Protocol" (#1623)
Rename the web client's History tab and its supporting code to Protocol so the feature reads as the MCP "Protocol" view. - Tab renders as "Protocol"; INSPECTOR_TAB_IDS, InspectorView tab constants/MonitorTab, TAB_UI_REGISTRY key, and navigation.ts tab id all updated to Protocol. - Rename components + folders: HistoryScreen -> ProtocolScreen, HistoryListPanel -> ProtocolListPanel, HistoryEntry -> ProtocolEntry, HistoryControls -> ProtocolControls, historyUtils -> protocolUtils (plus their tests and stories, and exported types). - Rename App/InspectorView plumbing: historyUi, pinnedHistoryIds, on*History* handlers/props, replayHistoryRequest, isReplayableHistoryMethod, sort/compact scopes, etc. -> Protocol names. - Export filenames use the "protocol" slug (buildExportFilename + ExportKind). Preserved (per issue #1623 decisions): - The in-panel section discriminator keeps its "pinned" | "history" values, and the sub-sections stay labeled Pinned / History. - window.history and core message-log/replay concepts are untouched. npm run ci passes (format, lint, build, unit tests, >=90 per-file coverage gate, smoke, Storybook). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
This commit is contained in:
parent
0fde2d0024
commit
ace4250d31
1 changed files with 413 additions and 405 deletions
34
clients/web/src/components/groups/protocolUtils.ts
Normal file
34
clients/web/src/components/groups/protocolUtils.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import type { MessageEntry, MessageMethod } from "@inspector/core/mcp/types.js";
|
||||
|
||||
export function extractMethod(entry: MessageEntry): MessageMethod {
|
||||
if ("method" in entry.message) {
|
||||
// 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";
|
||||
}
|
||||
|
||||
/**
|
||||
* Request methods the Protocol Replay action can re-issue (client→server reads
|
||||
* and calls). Server→client requests (roots/list, sampling, elicitation) and
|
||||
* side-effectful methods (logging/setLevel, subscribe) are intentionally
|
||||
* excluded. Single source of truth: `ProtocolEntry` hides the Replay button for
|
||||
* anything not listed here, and App's `replayProtocolRequest` gates dispatch on
|
||||
* the same set.
|
||||
*/
|
||||
export const REPLAYABLE_PROTOCOL_METHODS: ReadonlySet<string> = new Set([
|
||||
"tools/call",
|
||||
"prompts/get",
|
||||
"resources/read",
|
||||
"tools/list",
|
||||
"prompts/list",
|
||||
"resources/list",
|
||||
"resources/templates/list",
|
||||
"tasks/list",
|
||||
"ping",
|
||||
]);
|
||||
|
||||
export function isReplayableProtocolMethod(method: string): boolean {
|
||||
return REPLAYABLE_PROTOCOL_METHODS.has(method);
|
||||
}
|
||||
Loading…
Reference in a new issue