@mcp-use/inspector 20.0.0-beta.36 → 20.0.0-beta.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/app/inspector.css.gz +0 -0
- package/dist/app/inspector.js.gz +0 -0
- package/dist/cli.js +9 -9
- package/dist/client/index.d.ts +37 -33
- package/dist/client/index.js +49 -51
- package/dist/server/index.js +3 -3
- package/package.json +4 -4
package/dist/client/index.d.ts
CHANGED
|
@@ -249,11 +249,12 @@ interface ToolResultRendererProps {
|
|
|
249
249
|
serverId?: string;
|
|
250
250
|
readResource?: (uri: string) => Promise<any>;
|
|
251
251
|
toolMeta?: Record<string, any>;
|
|
252
|
-
onSendFollowUp?: (content: MessageContentBlock[]) => void
|
|
252
|
+
onSendFollowUp?: (content: MessageContentBlock[]) => Promise<void>;
|
|
253
|
+
modelContextScope?: string;
|
|
253
254
|
partialToolArgs?: Record<string, unknown>;
|
|
254
255
|
cancelled?: boolean;
|
|
255
256
|
}
|
|
256
|
-
declare function ToolResultRenderer({ toolName, toolArgs, result, serverId, readResource, toolMeta, onSendFollowUp, partialToolArgs, cancelled, }: ToolResultRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
257
|
+
declare function ToolResultRenderer({ toolName, toolArgs, result, serverId, readResource, toolMeta, onSendFollowUp, modelContextScope, partialToolArgs, cancelled, }: ToolResultRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
257
258
|
|
|
258
259
|
type Theme = "light" | "dark" | "system";
|
|
259
260
|
interface ThemeProviderProps {
|
|
@@ -264,6 +265,14 @@ interface ThemeProviderProps {
|
|
|
264
265
|
}
|
|
265
266
|
declare function ThemeProvider({ children, defaultTheme, storageKey, forcedTheme, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
266
267
|
|
|
268
|
+
interface WidgetModelContext {
|
|
269
|
+
content?: Array<{
|
|
270
|
+
type: "text";
|
|
271
|
+
text: string;
|
|
272
|
+
}>;
|
|
273
|
+
structuredContent?: Record<string, unknown>;
|
|
274
|
+
}
|
|
275
|
+
|
|
267
276
|
/**
|
|
268
277
|
* Provider for widget debugging context
|
|
269
278
|
*
|
|
@@ -309,6 +318,20 @@ interface Message$1 {
|
|
|
309
318
|
result?: any;
|
|
310
319
|
}>;
|
|
311
320
|
}
|
|
321
|
+
interface ChatSerializedMessage {
|
|
322
|
+
role: string;
|
|
323
|
+
content: unknown;
|
|
324
|
+
attachments?: unknown;
|
|
325
|
+
}
|
|
326
|
+
interface ChatBodyContext {
|
|
327
|
+
disabledTools: string[];
|
|
328
|
+
widgetModelContext?: string;
|
|
329
|
+
}
|
|
330
|
+
type ChatBodyBuilder = (messages: ChatSerializedMessage[], context: ChatBodyContext) => unknown;
|
|
331
|
+
interface SendMessageOptions {
|
|
332
|
+
throwOnError?: boolean;
|
|
333
|
+
onAccepted?: () => void;
|
|
334
|
+
}
|
|
312
335
|
interface LLMConfig {
|
|
313
336
|
provider: ProviderName;
|
|
314
337
|
apiKey: string;
|
|
@@ -754,13 +777,10 @@ interface ChatTabProps {
|
|
|
754
777
|
extraHeaders?: Record<string, string>;
|
|
755
778
|
/**
|
|
756
779
|
* Custom body builder for the streaming request.
|
|
757
|
-
*
|
|
780
|
+
* The second argument contains the effective disabled tools and serialized
|
|
781
|
+
* scoped widget context. Existing one-argument callbacks remain valid.
|
|
758
782
|
*/
|
|
759
|
-
body?:
|
|
760
|
-
role: string;
|
|
761
|
-
content: unknown;
|
|
762
|
-
attachments?: unknown;
|
|
763
|
-
}>) => unknown;
|
|
783
|
+
body?: ChatBodyBuilder;
|
|
764
784
|
/** Pluggable chat history storage. Defaults to localStorage in standalone mode. */
|
|
765
785
|
chatStorageProvider?: ChatStorageProvider;
|
|
766
786
|
/** When false, hides the built-in history sidebar even if a provider is available. */
|
|
@@ -824,8 +844,9 @@ interface MessageListProps {
|
|
|
824
844
|
messagesEndRef?: RefObject<HTMLDivElement | null>;
|
|
825
845
|
/** Trace events used to derive per-message token counts on hover. */
|
|
826
846
|
traceEvents?: InspectorTraceEvent[];
|
|
847
|
+
modelContextScope?: string;
|
|
827
848
|
}
|
|
828
|
-
declare const MessageList: react.MemoExoticComponent<({ messages, isLoading, serverId, readResource, tools, sendMessage, messagesEndRef, traceEvents, }: MessageListProps) => react_jsx_runtime.JSX.Element>;
|
|
849
|
+
declare const MessageList: react.MemoExoticComponent<({ messages, isLoading, serverId, readResource, tools, sendMessage, messagesEndRef, traceEvents, modelContextScope, }: MessageListProps) => react_jsx_runtime.JSX.Element>;
|
|
829
850
|
|
|
830
851
|
interface ChatHeaderProps {
|
|
831
852
|
llmConfig: LLMConfig | null;
|
|
@@ -1136,19 +1157,12 @@ type ManagedChatNotice = {
|
|
|
1136
1157
|
};
|
|
1137
1158
|
|
|
1138
1159
|
type MCPConnection = McpServer;
|
|
1139
|
-
interface WidgetModelContext$1 {
|
|
1140
|
-
content?: Array<{
|
|
1141
|
-
type: string;
|
|
1142
|
-
text: string;
|
|
1143
|
-
}>;
|
|
1144
|
-
structuredContent?: Record<string, unknown>;
|
|
1145
|
-
}
|
|
1146
1160
|
interface UseChatMessagesClientSideProps {
|
|
1147
1161
|
connection: MCPConnection;
|
|
1148
1162
|
llmConfig: LLMConfig | null;
|
|
1149
1163
|
isConnected: boolean;
|
|
1150
1164
|
readResource?: (uri: string) => Promise<any>;
|
|
1151
|
-
widgetModelContexts?: Map<string, WidgetModelContext
|
|
1165
|
+
widgetModelContexts?: Map<string, WidgetModelContext | undefined>;
|
|
1152
1166
|
disabledTools?: Set<string>;
|
|
1153
1167
|
initialMessages?: Message$1[];
|
|
1154
1168
|
systemPrompt?: string;
|
|
@@ -1158,7 +1172,7 @@ declare function useChatMessagesClientSide({ connection, llmConfig, isConnected,
|
|
|
1158
1172
|
isLoading: boolean;
|
|
1159
1173
|
attachments: MessageAttachment[];
|
|
1160
1174
|
managedChatNotice: ManagedChatNotice | null;
|
|
1161
|
-
sendMessage: (userInput: string, promptResults: PromptResult[], extraAttachments?: MessageAttachment[]) => Promise<void>;
|
|
1175
|
+
sendMessage: (userInput: string, promptResults: PromptResult[], extraAttachments?: MessageAttachment[], options?: SendMessageOptions) => Promise<void>;
|
|
1162
1176
|
clearMessages: () => void;
|
|
1163
1177
|
clearManagedChatNotice: () => void;
|
|
1164
1178
|
showManagedChatNotice: (notice: ManagedChatNotice) => void;
|
|
@@ -1172,13 +1186,6 @@ declare function useChatMessagesClientSide({ connection, llmConfig, isConnected,
|
|
|
1172
1186
|
tokenUsage: InspectorTokenUsage | undefined;
|
|
1173
1187
|
};
|
|
1174
1188
|
|
|
1175
|
-
interface WidgetModelContext {
|
|
1176
|
-
content?: Array<{
|
|
1177
|
-
type: string;
|
|
1178
|
-
text: string;
|
|
1179
|
-
}>;
|
|
1180
|
-
structuredContent?: Record<string, unknown>;
|
|
1181
|
-
}
|
|
1182
1189
|
interface UseChatMessagesProps {
|
|
1183
1190
|
mcpServerUrl: string;
|
|
1184
1191
|
llmConfig: LLMConfig | null;
|
|
@@ -1211,13 +1218,10 @@ interface UseChatMessagesProps {
|
|
|
1211
1218
|
* object that will be JSON-stringified as the request body.
|
|
1212
1219
|
* When omitted, the default body includes `mcpServerUrl`, `llmConfig`,
|
|
1213
1220
|
* `authConfig`, and `messages`.
|
|
1214
|
-
*
|
|
1221
|
+
* The second argument contains the effective disabled tools and serialized
|
|
1222
|
+
* scoped widget context.
|
|
1215
1223
|
*/
|
|
1216
|
-
body?:
|
|
1217
|
-
role: string;
|
|
1218
|
-
content: unknown;
|
|
1219
|
-
attachments?: unknown;
|
|
1220
|
-
}>) => unknown;
|
|
1224
|
+
body?: ChatBodyBuilder;
|
|
1221
1225
|
}
|
|
1222
1226
|
declare function useChatMessages({ mcpServerUrl, llmConfig, authConfig, mcpAuthTokens, isConnected, chatApiUrl, waitForChatApiUrl, widgetModelContexts, initialMessages, disabledTools, streamProtocol, credentials, extraHeaders, body: bodyBuilder, }: UseChatMessagesProps): {
|
|
1223
1227
|
messages: Message$1[];
|
|
@@ -1228,7 +1232,7 @@ declare function useChatMessages({ mcpServerUrl, llmConfig, authConfig, mcpAuthT
|
|
|
1228
1232
|
mcpServerUrl: string;
|
|
1229
1233
|
message?: string;
|
|
1230
1234
|
} | null;
|
|
1231
|
-
sendMessage: (userInput: string, promptResults: PromptResult[], extraAttachments?: MessageAttachment[]) => Promise<void>;
|
|
1235
|
+
sendMessage: (userInput: string, promptResults: PromptResult[], extraAttachments?: MessageAttachment[], options?: SendMessageOptions) => Promise<void>;
|
|
1232
1236
|
clearMessages: () => void;
|
|
1233
1237
|
clearManagedChatNotice: () => void;
|
|
1234
1238
|
showManagedChatNotice: (notice: ManagedChatNotice) => void;
|
|
@@ -1396,4 +1400,4 @@ type UseChatTitleGenerationParams = {
|
|
|
1396
1400
|
};
|
|
1397
1401
|
declare function useChatTitleGeneration({ activeChatId, storage, messages, isLoading, effectiveClientSide, llmConfig, activeChatTitle, titleGenerationReady, onTitleGenerated, onHistoryRefetch, }: UseChatTitleGenerationParams): void;
|
|
1398
1402
|
|
|
1399
|
-
export { AddToClientDropdown, type AuthConfig, CHAT_TITLE_PLACEHOLDER, CHAT_TITLE_SIMPLE, type ChatEventRowForMessages, ChatHeader, ChatHistoryHeader, ChatHistoryPanel, ChatHistoryRail, ChatInputArea, ChatLandingForm, ChatList, type ChatSession, type ChatStorageProvider, type ChatSystemPromptProvider, ChatTab, type ChatTabProps, ChatTitleReveal, type ChatView, ConfigurationDialog, ConfigureEmptyState, DEFAULT_CHAT_SYSTEM_PROMPT, type EmbeddedConfig, InspectorProvider, type InspectorTokenUsage, type InspectorTraceEvent, type InspectorTraceSpan, type InspectorTraceState, type LLMConfig, type ListChatsParams, LocalChatStorageProvider, type MCPConfig, type MCPServerConfig, type Message$1 as Message, type MessageAttachment, MessageList, type PromptResult, PromptsTab, type PromptsTabRef, ResourcesTab, type ResourcesTabRef, type StreamProtocol, type TabType, ThemeProvider, ToolInputForm, type ToolResult, ToolResultDisplay, ToolResultRenderer, ToolsTab, type ToolsTabRef, WidgetDebugProvider, chatBarActionButtonClass, chatBarFrostedPill, chatBarTitleFrostedClass, chatEventsToInspectorMessages, downloadMcpbFile, firstUserMessageFromMessages, generateChatTitleWithLlm, generateClaudeCodeCommand, generateCodexConfig, generateCursorDeepLink, generateGeminiCLICommand, generateMcpbConfig, generatePythonSDKCode, generateTypeScriptSDKCode, generateVSCodeDeepLink, generateVSCodeInsidersDeepLink, getEnvVarInstructions, getSystemPromptStorageKey, isPlaceholderTitle, readStoredSystemPrompt, resolveSystemPrompt, useChatHistory, useChatMessages, useChatMessagesClientSide, useChatTitleGeneration, useConfig, useInspector, useMCPPrompts, writeStoredSystemPrompt };
|
|
1403
|
+
export { AddToClientDropdown, type AuthConfig, CHAT_TITLE_PLACEHOLDER, CHAT_TITLE_SIMPLE, type ChatBodyBuilder, type ChatBodyContext, type ChatEventRowForMessages, ChatHeader, ChatHistoryHeader, ChatHistoryPanel, ChatHistoryRail, ChatInputArea, ChatLandingForm, ChatList, type ChatSerializedMessage, type ChatSession, type ChatStorageProvider, type ChatSystemPromptProvider, ChatTab, type ChatTabProps, ChatTitleReveal, type ChatView, ConfigurationDialog, ConfigureEmptyState, DEFAULT_CHAT_SYSTEM_PROMPT, type EmbeddedConfig, InspectorProvider, type InspectorTokenUsage, type InspectorTraceEvent, type InspectorTraceSpan, type InspectorTraceState, type LLMConfig, type ListChatsParams, LocalChatStorageProvider, type MCPConfig, type MCPServerConfig, type Message$1 as Message, type MessageAttachment, MessageList, type PromptResult, PromptsTab, type PromptsTabRef, ResourcesTab, type ResourcesTabRef, type StreamProtocol, type TabType, ThemeProvider, ToolInputForm, type ToolResult, ToolResultDisplay, ToolResultRenderer, ToolsTab, type ToolsTabRef, WidgetDebugProvider, chatBarActionButtonClass, chatBarFrostedPill, chatBarTitleFrostedClass, chatEventsToInspectorMessages, downloadMcpbFile, firstUserMessageFromMessages, generateChatTitleWithLlm, generateClaudeCodeCommand, generateCodexConfig, generateCursorDeepLink, generateGeminiCLICommand, generateMcpbConfig, generatePythonSDKCode, generateTypeScriptSDKCode, generateVSCodeDeepLink, generateVSCodeInsidersDeepLink, getEnvVarInstructions, getSystemPromptStorageKey, isPlaceholderTitle, readStoredSystemPrompt, resolveSystemPrompt, useChatHistory, useChatMessages, useChatMessagesClientSide, useChatTitleGeneration, useConfig, useInspector, useMCPPrompts, writeStoredSystemPrompt };
|