@mcp-use/inspector 20.0.0-beta.5 → 20.0.0-beta.50
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 +31 -78
- package/dist/app/inspector.css.gz +0 -0
- package/dist/app/inspector.js.gz +0 -0
- package/dist/app/providers/anthropic.png +0 -0
- package/dist/app/providers/google.png +0 -0
- package/dist/app/providers/openai.png +0 -0
- package/dist/cli.js +332 -1384
- package/dist/client/index.d.ts +1405 -50
- package/dist/client/index.js +165 -24019
- package/dist/server/index.d.ts +79 -7
- package/dist/server/index.js +370 -22
- package/package.json +77 -35
- package/dist/cdn/AnimatePresence-Dcw-FOy8.js +0 -393
- package/dist/cdn/ChatTab-B255lH5i.js +0 -6744
- package/dist/cdn/CheckboxIndicator-Bt4IICtv.js +0 -251
- package/dist/cdn/ConnectionSettingsForm-DF-NS58d.js +0 -929
- package/dist/cdn/ConnectionSettingsTab-dI-Cqe79.js +0 -150
- package/dist/cdn/ElicitationTab-CL1KJ0bz.js +0 -654
- package/dist/cdn/FormContext-tmgN_Vdr.js +0 -135
- package/dist/cdn/InspectorContext-UjtEbNod.js +0 -123
- package/dist/cdn/JSONDisplay-BFxf5oEu.js +0 -324
- package/dist/cdn/ListTabHeader-Cv-GmtGF.js +0 -88
- package/dist/cdn/ManufactOAuthCallback-B98kSYCj.js +0 -31
- package/dist/cdn/MarkdownRenderer-Ba7nA4Ie.js +0 -3610
- package/dist/cdn/NotificationsTab-CeImSrhx.js +0 -290
- package/dist/cdn/OAuthCallback-Blc2Asxc.js +0 -58
- package/dist/cdn/PromptsTab-BYKnY7Rp.js +0 -901
- package/dist/cdn/ResourcesTab-BGualKW-.js +0 -564
- package/dist/cdn/SamplingTab-BeZBUeni.js +0 -658
- package/dist/cdn/ServerMetadataTab-CvrKX8fz.js +0 -244
- package/dist/cdn/StatusIcon-D0-ARyOh.js +0 -66
- package/dist/cdn/ToolsTab-j6n4O_3s.js +0 -2033
- package/dist/cdn/ViewPreview-DihyG6Qd.js +0 -238
- package/dist/cdn/WidgetDebugContext-D4usL_MA.js +0 -324
- package/dist/cdn/WidgetWrapper-B4H3Fek7.js +0 -2210
- package/dist/cdn/basePath-B8HuhIMu.js +0 -25
- package/dist/cdn/bell-CGjAO_0s.js +0 -10
- package/dist/cdn/browser-CbQIH4w2.js +0 -42
- package/dist/cdn/brush-B_mKhyxG.js +0 -17
- package/dist/cdn/card-DgiYnSg-.js +0 -41
- package/dist/cdn/cfWorker-Bxcs9rNe.js +0 -10799
- package/dist/cdn/checkbox-By0FklhG.js +0 -20
- package/dist/cdn/chunk-QUQL4437-XnDcYQEx.js +0 -1508
- package/dist/cdn/clock-CmUbSx_B.js +0 -12
- package/dist/cdn/code-V_0nf5rg.js +0 -10
- package/dist/cdn/createLucideIcon-C5fZZ6oB.js +0 -38
- package/dist/cdn/dialog-BsDpuJd3.js +0 -1028
- package/dist/cdn/dist-DaMB0Su9.js +0 -616
- package/dist/cdn/dist-DbX5yidW.js +0 -2306
- package/dist/cdn/external-link-CjmfT6rW.js +0 -17
- package/dist/cdn/eye-B7H96av8.js +0 -29
- package/dist/cdn/folder-open-B3lu2rG_.js +0 -7
- package/dist/cdn/hash-BVQnWi7q.js +0 -33
- package/dist/cdn/history-Csw4rb44.js +0 -17
- package/dist/cdn/index-browser-DkQOzkvX.js +0 -1934
- package/dist/cdn/info-CNiOwqkf.js +0 -19
- package/dist/cdn/input-C2OBd4PJ.js +0 -12160
- package/dist/cdn/inspector-settings-layout-0VDsjeqb.js +0 -4
- package/dist/cdn/inspector.css +0 -2
- package/dist/cdn/inspector.js +0 -24523
- package/dist/cdn/jsx-runtime-CIxvMpEo.js +0 -180
- package/dist/cdn/label-B9Jmm9be.js +0 -60
- package/dist/cdn/loader-circle-BLy9A_pp.js +0 -7
- package/dist/cdn/manufact-auth-BQMHhbLV.js +0 -423
- package/dist/cdn/maximize-2-CH5Lq90B.js +0 -21
- package/dist/cdn/maximize-BALCV_ep.js +0 -21
- package/dist/cdn/message-square-BnxdpJxZ.js +0 -7
- package/dist/cdn/not-found-DEtSM_Wd.js +0 -34
- package/dist/cdn/play-vuZ5PLnI.js +0 -7
- package/dist/cdn/providerMeta-BQIfHuNL.js +0 -379
- package/dist/cdn/providers/anthropic.png +0 -0
- package/dist/cdn/providers/google.png +0 -0
- package/dist/cdn/providers/openai.png +0 -0
- package/dist/cdn/react-BIs9pQ3H.js +0 -926
- package/dist/cdn/react-BajV-X4P.js +0 -5425
- package/dist/cdn/refresh-cw-BXY-Pa0U.js +0 -21
- package/dist/cdn/save-Tgil_AJZ.js +0 -34
- package/dist/cdn/schemaHelpers-DTV38jGq.js +0 -16
- package/dist/cdn/select-DDdiIPR2.js +0 -2594
- package/dist/cdn/servers-Dm72iTpY.js +0 -26
- package/dist/cdn/shared-DaILIQPP.js +0 -1700
- package/dist/cdn/sheet-Br_l2kry.js +0 -2077
- package/dist/cdn/sparkles-BntO2rDR.js +0 -23
- package/dist/cdn/spinner-jQtC7EBj.js +0 -15
- package/dist/cdn/square-check-big-BvwQ17Bl.js +0 -10
- package/dist/cdn/switch-C3IyQuid.js +0 -664
- package/dist/cdn/tabs-subtle-CkdI6Mac.js +0 -787
- package/dist/cdn/telemetry-DabTAQ8x.js +0 -240
- package/dist/cdn/textarea-DSbwcFVt.js +0 -14
- package/dist/cdn/trash-2-RwpJY5SL.js +0 -25
- package/dist/cdn/useAriaLabelledBy-DqAdnppm.js +0 -29
- package/dist/cdn/useCompositeItem-BRqEzYh-.js +0 -26
- package/dist/cdn/useConfig-Btmh8wjJ.js +0 -235
- package/dist/cdn/useSavedRequests-Ci2I919u.js +0 -51
- package/dist/cdn/useViewHostProps-B6SKeeH9.js +0 -349
- package/dist/cdn/wrench-DzGmCfnb.js +0 -7
- package/dist/cdn/x-C3vRQIYu.js +0 -10
- package/dist/cdn/zap-Mb-pbw2X.js +0 -10
- package/dist/client/auth/manufact-auth.d.ts +0 -32
- package/dist/client/auth/manufact-auth.d.ts.map +0 -1
- package/dist/client/chat-history/ChatHistoryHeader.d.ts +0 -4
- package/dist/client/chat-history/ChatHistoryHeader.d.ts.map +0 -1
- package/dist/client/chat-history/ChatHistoryPanel.d.ts +0 -28
- package/dist/client/chat-history/ChatHistoryPanel.d.ts.map +0 -1
- package/dist/client/chat-history/ChatHistoryRail.d.ts +0 -5
- package/dist/client/chat-history/ChatHistoryRail.d.ts.map +0 -1
- package/dist/client/chat-history/ChatList.d.ts +0 -18
- package/dist/client/chat-history/ChatList.d.ts.map +0 -1
- package/dist/client/chat-history/ChatTitleReveal.d.ts +0 -10
- package/dist/client/chat-history/ChatTitleReveal.d.ts.map +0 -1
- package/dist/client/chat-history/chat-events-to-inspector-messages.d.ts +0 -13
- package/dist/client/chat-history/chat-events-to-inspector-messages.d.ts.map +0 -1
- package/dist/client/chat-history/chat-title.d.ts +0 -10
- package/dist/client/chat-history/chat-title.d.ts.map +0 -1
- package/dist/client/chat-history/providers/local-storage.d.ts +0 -21
- package/dist/client/chat-history/providers/local-storage.d.ts.map +0 -1
- package/dist/client/chat-history/types.d.ts +0 -39
- package/dist/client/chat-history/types.d.ts.map +0 -1
- package/dist/client/chat-history/useChatHistory.d.ts +0 -20
- package/dist/client/chat-history/useChatHistory.d.ts.map +0 -1
- package/dist/client/chat-history/useChatTitleGeneration.d.ts +0 -17
- package/dist/client/chat-history/useChatTitleGeneration.d.ts.map +0 -1
- package/dist/client/components/AddToClientDropdown.d.ts +0 -52
- package/dist/client/components/AddToClientDropdown.d.ts.map +0 -1
- package/dist/client/components/ChatTab.d.ts +0 -98
- package/dist/client/components/ChatTab.d.ts.map +0 -1
- package/dist/client/components/IframeConsole.d.ts +0 -7
- package/dist/client/components/IframeConsole.d.ts.map +0 -1
- package/dist/client/components/MCPAppsDebugControls.d.ts +0 -19
- package/dist/client/components/MCPAppsDebugControls.d.ts.map +0 -1
- package/dist/client/components/PromptsTab.d.ts +0 -34
- package/dist/client/components/PromptsTab.d.ts.map +0 -1
- package/dist/client/components/ResourcesTab.d.ts +0 -31
- package/dist/client/components/ResourcesTab.d.ts.map +0 -1
- package/dist/client/components/ToolsTab.d.ts +0 -39
- package/dist/client/components/ToolsTab.d.ts.map +0 -1
- package/dist/client/components/chat/AssistantMessage.d.ts +0 -10
- package/dist/client/components/chat/AssistantMessage.d.ts.map +0 -1
- package/dist/client/components/chat/ChatHeader.d.ts +0 -70
- package/dist/client/components/chat/ChatHeader.d.ts.map +0 -1
- package/dist/client/components/chat/ChatInput.d.ts +0 -29
- package/dist/client/components/chat/ChatInput.d.ts.map +0 -1
- package/dist/client/components/chat/ChatInputArea.d.ts +0 -65
- package/dist/client/components/chat/ChatInputArea.d.ts.map +0 -1
- package/dist/client/components/chat/ChatLandingForm.d.ts +0 -15
- package/dist/client/components/chat/ChatLandingForm.d.ts.map +0 -1
- package/dist/client/components/chat/ChatManagedNotice.d.ts +0 -10
- package/dist/client/components/chat/ChatManagedNotice.d.ts.map +0 -1
- package/dist/client/components/chat/ChatScrollToBottomButton.d.ts +0 -7
- package/dist/client/components/chat/ChatScrollToBottomButton.d.ts.map +0 -1
- package/dist/client/components/chat/ChatScrollTopFade.d.ts +0 -7
- package/dist/client/components/chat/ChatScrollTopFade.d.ts.map +0 -1
- package/dist/client/components/chat/ChatTraceView.d.ts +0 -7
- package/dist/client/components/chat/ChatTraceView.d.ts.map +0 -1
- package/dist/client/components/chat/ConfigurationDialog.d.ts +0 -42
- package/dist/client/components/chat/ConfigurationDialog.d.ts.map +0 -1
- package/dist/client/components/chat/ConfigureEmptyState.d.ts +0 -6
- package/dist/client/components/chat/ConfigureEmptyState.d.ts.map +0 -1
- package/dist/client/components/chat/CopyButton.d.ts +0 -10
- package/dist/client/components/chat/CopyButton.d.ts.map +0 -1
- package/dist/client/components/chat/FloatingChatElicitation.d.ts +0 -10
- package/dist/client/components/chat/FloatingChatElicitation.d.ts.map +0 -1
- package/dist/client/components/chat/McpReconnectBanner.d.ts +0 -10
- package/dist/client/components/chat/McpReconnectBanner.d.ts.map +0 -1
- package/dist/client/components/chat/MessageList.d.ts +0 -47
- package/dist/client/components/chat/MessageList.d.ts.map +0 -1
- package/dist/client/components/chat/MessageMetaActions.d.ts +0 -7
- package/dist/client/components/chat/MessageMetaActions.d.ts.map +0 -1
- package/dist/client/components/chat/PromptResultsList.d.ts +0 -8
- package/dist/client/components/chat/PromptResultsList.d.ts.map +0 -1
- package/dist/client/components/chat/PromptsDropdown.d.ts +0 -11
- package/dist/client/components/chat/PromptsDropdown.d.ts.map +0 -1
- package/dist/client/components/chat/StreamingAssistantContent.d.ts +0 -7
- package/dist/client/components/chat/StreamingAssistantContent.d.ts.map +0 -1
- package/dist/client/components/chat/SystemPromptButton.d.ts +0 -11
- package/dist/client/components/chat/SystemPromptButton.d.ts.map +0 -1
- package/dist/client/components/chat/ToolCallDisplay.d.ts +0 -10
- package/dist/client/components/chat/ToolCallDisplay.d.ts.map +0 -1
- package/dist/client/components/chat/ToolResultRenderer.d.ts +0 -15
- package/dist/client/components/chat/ToolResultRenderer.d.ts.map +0 -1
- package/dist/client/components/chat/ToolSelector.d.ts +0 -13
- package/dist/client/components/chat/ToolSelector.d.ts.map +0 -1
- package/dist/client/components/chat/UserMessage.d.ts +0 -10
- package/dist/client/components/chat/UserMessage.d.ts.map +0 -1
- package/dist/client/components/chat/chat-bar-styles.d.ts +0 -6
- package/dist/client/components/chat/chat-bar-styles.d.ts.map +0 -1
- package/dist/client/components/chat/chatModeStorage.d.ts +0 -11
- package/dist/client/components/chat/chatModeStorage.d.ts.map +0 -1
- package/dist/client/components/chat/conversion.d.ts +0 -19
- package/dist/client/components/chat/conversion.d.ts.map +0 -1
- package/dist/client/components/chat/freeTier.d.ts +0 -32
- package/dist/client/components/chat/freeTier.d.ts.map +0 -1
- package/dist/client/components/chat/managedChatNotice.d.ts +0 -16
- package/dist/client/components/chat/managedChatNotice.d.ts.map +0 -1
- package/dist/client/components/chat/providerMeta.d.ts +0 -27
- package/dist/client/components/chat/providerMeta.d.ts.map +0 -1
- package/dist/client/components/chat/system-prompt/local-storage.d.ts +0 -5
- package/dist/client/components/chat/system-prompt/local-storage.d.ts.map +0 -1
- package/dist/client/components/chat/system-prompt/types.d.ts +0 -8
- package/dist/client/components/chat/system-prompt/types.d.ts.map +0 -1
- package/dist/client/components/chat/system-prompt/useLocalSystemPrompt.d.ts +0 -3
- package/dist/client/components/chat/system-prompt/useLocalSystemPrompt.d.ts.map +0 -1
- package/dist/client/components/chat/system-prompt-default.d.ts +0 -2
- package/dist/client/components/chat/system-prompt-default.d.ts.map +0 -1
- package/dist/client/components/chat/trace.d.ts +0 -84
- package/dist/client/components/chat/trace.d.ts.map +0 -1
- package/dist/client/components/chat/types.d.ts +0 -75
- package/dist/client/components/chat/types.d.ts.map +0 -1
- package/dist/client/components/chat/useChatMessages.d.ts +0 -76
- package/dist/client/components/chat/useChatMessages.d.ts.map +0 -1
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts +0 -43
- package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +0 -1
- package/dist/client/components/chat/useChatScrollToBottom.d.ts +0 -14
- package/dist/client/components/chat/useChatScrollToBottom.d.ts.map +0 -1
- package/dist/client/components/chat/useConfig.d.ts +0 -24
- package/dist/client/components/chat/useConfig.d.ts.map +0 -1
- package/dist/client/components/chat/useHostedChatMode.d.ts +0 -14
- package/dist/client/components/chat/useHostedChatMode.d.ts.map +0 -1
- package/dist/client/components/chat/useManagedCloudModel.d.ts +0 -14
- package/dist/client/components/chat/useManagedCloudModel.d.ts.map +0 -1
- package/dist/client/components/chat/utils.d.ts +0 -11
- package/dist/client/components/chat/utils.d.ts.map +0 -1
- package/dist/client/components/elicitation/shared/ElicitationAskUserPanel.d.ts +0 -12
- package/dist/client/components/elicitation/shared/ElicitationAskUserPanel.d.ts.map +0 -1
- package/dist/client/components/elicitation/shared/elicitationToAskUserQuestions.d.ts +0 -9
- package/dist/client/components/elicitation/shared/elicitationToAskUserQuestions.d.ts.map +0 -1
- package/dist/client/components/elicitation/shared/schemaHelpers.d.ts +0 -8
- package/dist/client/components/elicitation/shared/schemaHelpers.d.ts.map +0 -1
- package/dist/client/components/prompts/PromptExecutionPanel.d.ts +0 -13
- package/dist/client/components/prompts/PromptExecutionPanel.d.ts.map +0 -1
- package/dist/client/components/prompts/PromptInputForm.d.ts +0 -9
- package/dist/client/components/prompts/PromptInputForm.d.ts.map +0 -1
- package/dist/client/components/prompts/PromptMessageCard.d.ts +0 -29
- package/dist/client/components/prompts/PromptMessageCard.d.ts.map +0 -1
- package/dist/client/components/prompts/PromptResultDisplay.d.ts +0 -34
- package/dist/client/components/prompts/PromptResultDisplay.d.ts.map +0 -1
- package/dist/client/components/prompts/PromptsList.d.ts +0 -10
- package/dist/client/components/prompts/PromptsList.d.ts.map +0 -1
- package/dist/client/components/prompts/SavedPromptsList.d.ts +0 -19
- package/dist/client/components/prompts/SavedPromptsList.d.ts.map +0 -1
- package/dist/client/components/resources/PropsConfigDialog.d.ts +0 -16
- package/dist/client/components/resources/PropsConfigDialog.d.ts.map +0 -1
- package/dist/client/components/resources/ResourceResultDisplay.d.ts +0 -30
- package/dist/client/components/resources/ResourceResultDisplay.d.ts.map +0 -1
- package/dist/client/components/resources/ResourcesList.d.ts +0 -10
- package/dist/client/components/resources/ResourcesList.d.ts.map +0 -1
- package/dist/client/components/shared/CollapsibleJSON.d.ts +0 -6
- package/dist/client/components/shared/CollapsibleJSON.d.ts.map +0 -1
- package/dist/client/components/shared/InspectorScrollArea.d.ts +0 -9
- package/dist/client/components/shared/InspectorScrollArea.d.ts.map +0 -1
- package/dist/client/components/shared/JSONDisplay.d.ts +0 -12
- package/dist/client/components/shared/JSONDisplay.d.ts.map +0 -1
- package/dist/client/components/shared/ListItem.d.ts +0 -24
- package/dist/client/components/shared/ListItem.d.ts.map +0 -1
- package/dist/client/components/shared/ListTabHeader.d.ts +0 -47
- package/dist/client/components/shared/ListTabHeader.d.ts.map +0 -1
- package/dist/client/components/shared/MarkdownRenderer.d.ts +0 -15
- package/dist/client/components/shared/MarkdownRenderer.d.ts.map +0 -1
- package/dist/client/components/shared/SchemaFormField.d.ts +0 -12
- package/dist/client/components/shared/SchemaFormField.d.ts.map +0 -1
- package/dist/client/components/shared/SearchTabHeader.d.ts +0 -28
- package/dist/client/components/shared/SearchTabHeader.d.ts.map +0 -1
- package/dist/client/components/shared/StatusIcon.d.ts +0 -12
- package/dist/client/components/shared/StatusIcon.d.ts.map +0 -1
- package/dist/client/components/shared/index.d.ts +0 -7
- package/dist/client/components/shared/index.d.ts.map +0 -1
- package/dist/client/components/tools/SaveRequestDialog.d.ts +0 -11
- package/dist/client/components/tools/SaveRequestDialog.d.ts.map +0 -1
- package/dist/client/components/tools/SavedRequestsList.d.ts +0 -19
- package/dist/client/components/tools/SavedRequestsList.d.ts.map +0 -1
- package/dist/client/components/tools/ToolExecutionPanel.d.ts +0 -20
- package/dist/client/components/tools/ToolExecutionPanel.d.ts.map +0 -1
- package/dist/client/components/tools/ToolInputForm.d.ts +0 -14
- package/dist/client/components/tools/ToolInputForm.d.ts.map +0 -1
- package/dist/client/components/tools/ToolResultDisplay.d.ts +0 -24
- package/dist/client/components/tools/ToolResultDisplay.d.ts.map +0 -1
- package/dist/client/components/tools/ToolsList.d.ts +0 -10
- package/dist/client/components/tools/ToolsList.d.ts.map +0 -1
- package/dist/client/components/tools/schema-utils.d.ts +0 -13
- package/dist/client/components/tools/schema-utils.d.ts.map +0 -1
- package/dist/client/components/tools/useToolExecution.d.ts +0 -26
- package/dist/client/components/tools/useToolExecution.d.ts.map +0 -1
- package/dist/client/components/tools/useToolsTabNavigation.d.ts +0 -35
- package/dist/client/components/tools/useToolsTabNavigation.d.ts.map +0 -1
- package/dist/client/components/ui/MeshGradientCanvas.d.ts +0 -13
- package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +0 -1
- package/dist/client/components/ui/WidgetWrapper.d.ts +0 -12
- package/dist/client/components/ui/WidgetWrapper.d.ts.map +0 -1
- package/dist/client/components/ui/alert-dialog.d.ts +0 -15
- package/dist/client/components/ui/alert-dialog.d.ts.map +0 -1
- package/dist/client/components/ui/ask-user-questions.d.ts +0 -80
- package/dist/client/components/ui/ask-user-questions.d.ts.map +0 -1
- package/dist/client/components/ui/badge.d.ts +0 -34
- package/dist/client/components/ui/badge.d.ts.map +0 -1
- package/dist/client/components/ui/blur-fade.d.ts +0 -25
- package/dist/client/components/ui/blur-fade.d.ts.map +0 -1
- package/dist/client/components/ui/button.d.ts +0 -34
- package/dist/client/components/ui/button.d.ts.map +0 -1
- package/dist/client/components/ui/chat-message.d.ts +0 -23
- package/dist/client/components/ui/chat-message.d.ts.map +0 -1
- package/dist/client/components/ui/checkbox.d.ts +0 -4
- package/dist/client/components/ui/checkbox.d.ts.map +0 -1
- package/dist/client/components/ui/client-icons.d.ts +0 -20
- package/dist/client/components/ui/client-icons.d.ts.map +0 -1
- package/dist/client/components/ui/command.d.ts +0 -17
- package/dist/client/components/ui/command.d.ts.map +0 -1
- package/dist/client/components/ui/dialog.d.ts +0 -37
- package/dist/client/components/ui/dialog.d.ts.map +0 -1
- package/dist/client/components/ui/dropdown-menu.d.ts +0 -25
- package/dist/client/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/client/components/ui/dropdown.d.ts +0 -30
- package/dist/client/components/ui/dropdown.d.ts.map +0 -1
- package/dist/client/components/ui/file-thumbnail.d.ts +0 -9
- package/dist/client/components/ui/file-thumbnail.d.ts.map +0 -1
- package/dist/client/components/ui/input.d.ts +0 -4
- package/dist/client/components/ui/input.d.ts.map +0 -1
- package/dist/client/components/ui/kbd.d.ts +0 -3
- package/dist/client/components/ui/kbd.d.ts.map +0 -1
- package/dist/client/components/ui/label.d.ts +0 -4
- package/dist/client/components/ui/label.d.ts.map +0 -1
- package/dist/client/components/ui/menu-item.d.ts +0 -52
- package/dist/client/components/ui/menu-item.d.ts.map +0 -1
- package/dist/client/components/ui/mesh-tab-background.d.ts +0 -12
- package/dist/client/components/ui/mesh-tab-background.d.ts.map +0 -1
- package/dist/client/components/ui/not-found.d.ts +0 -9
- package/dist/client/components/ui/not-found.d.ts.map +0 -1
- package/dist/client/components/ui/popover.d.ts +0 -6
- package/dist/client/components/ui/popover.d.ts.map +0 -1
- package/dist/client/components/ui/resizable.d.ts +0 -10
- package/dist/client/components/ui/resizable.d.ts.map +0 -1
- package/dist/client/components/ui/scroll-area.d.ts +0 -4
- package/dist/client/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/client/components/ui/select.d.ts +0 -52
- package/dist/client/components/ui/select.d.ts.map +0 -1
- package/dist/client/components/ui/sheet.d.ts +0 -14
- package/dist/client/components/ui/sheet.d.ts.map +0 -1
- package/dist/client/components/ui/skeleton.d.ts +0 -4
- package/dist/client/components/ui/skeleton.d.ts.map +0 -1
- package/dist/client/components/ui/spinner.d.ts +0 -3
- package/dist/client/components/ui/spinner.d.ts.map +0 -1
- package/dist/client/components/ui/switch.d.ts +0 -22
- package/dist/client/components/ui/switch.d.ts.map +0 -1
- package/dist/client/components/ui/table.d.ts +0 -9
- package/dist/client/components/ui/table.d.ts.map +0 -1
- package/dist/client/components/ui/tabs-subtle.d.ts +0 -25
- package/dist/client/components/ui/tabs-subtle.d.ts.map +0 -1
- package/dist/client/components/ui/text-shimmer.d.ts +0 -11
- package/dist/client/components/ui/text-shimmer.d.ts.map +0 -1
- package/dist/client/components/ui/textarea.d.ts +0 -4
- package/dist/client/components/ui/textarea.d.ts.map +0 -1
- package/dist/client/components/ui/tooltip.d.ts +0 -43
- package/dist/client/components/ui/tooltip.d.ts.map +0 -1
- package/dist/client/components/ui-playground/shared/SafeAreaInsetsEditor.d.ts +0 -19
- package/dist/client/components/ui-playground/shared/SafeAreaInsetsEditor.d.ts.map +0 -1
- package/dist/client/console-log-bus.d.ts +0 -24
- package/dist/client/console-log-bus.d.ts.map +0 -1
- package/dist/client/constants/debug-options.d.ts +0 -16
- package/dist/client/constants/debug-options.d.ts.map +0 -1
- package/dist/client/context/InspectorContext.d.ts +0 -134
- package/dist/client/context/InspectorContext.d.ts.map +0 -1
- package/dist/client/context/ThemeContext.d.ts +0 -17
- package/dist/client/context/ThemeContext.d.ts.map +0 -1
- package/dist/client/context/WidgetDebugContext.d.ts +0 -121
- package/dist/client/context/WidgetDebugContext.d.ts.map +0 -1
- package/dist/client/hooks/use-merge-split.d.ts +0 -36
- package/dist/client/hooks/use-merge-split.d.ts.map +0 -1
- package/dist/client/hooks/use-proximity-hover-index.d.ts +0 -27
- package/dist/client/hooks/use-proximity-hover-index.d.ts.map +0 -1
- package/dist/client/hooks/use-proximity-hover.d.ts +0 -26
- package/dist/client/hooks/use-proximity-hover.d.ts.map +0 -1
- package/dist/client/hooks/use-touch-primary.d.ts +0 -2
- package/dist/client/hooks/use-touch-primary.d.ts.map +0 -1
- package/dist/client/hooks/useDeviceViewport.d.ts +0 -18
- package/dist/client/hooks/useDeviceViewport.d.ts.map +0 -1
- package/dist/client/hooks/useHostedSession.d.ts +0 -9
- package/dist/client/hooks/useHostedSession.d.ts.map +0 -1
- package/dist/client/hooks/useIframeConsole.d.ts +0 -24
- package/dist/client/hooks/useIframeConsole.d.ts.map +0 -1
- package/dist/client/hooks/useKeyboardShortcuts.d.ts +0 -28
- package/dist/client/hooks/useKeyboardShortcuts.d.ts.map +0 -1
- package/dist/client/hooks/useMCPPrompts.d.ts +0 -94
- package/dist/client/hooks/useMCPPrompts.d.ts.map +0 -1
- package/dist/client/hooks/useMcpAppsHostContext.d.ts +0 -27
- package/dist/client/hooks/useMcpAppsHostContext.d.ts.map +0 -1
- package/dist/client/hooks/usePropsLLM.d.ts +0 -20
- package/dist/client/hooks/usePropsLLM.d.ts.map +0 -1
- package/dist/client/hooks/useResourceProps.d.ts +0 -14
- package/dist/client/hooks/useResourceProps.d.ts.map +0 -1
- package/dist/client/hooks/useSavedRequests.d.ts +0 -6
- package/dist/client/hooks/useSavedRequests.d.ts.map +0 -1
- package/dist/client/hooks/useViewHostProps.d.ts +0 -19
- package/dist/client/hooks/useViewHostProps.d.ts.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/lib/elevated.d.ts +0 -28
- package/dist/client/lib/elevated.d.ts.map +0 -1
- package/dist/client/lib/font-weight.d.ts +0 -10
- package/dist/client/lib/font-weight.d.ts.map +0 -1
- package/dist/client/lib/icon-context.d.ts +0 -15
- package/dist/client/lib/icon-context.d.ts.map +0 -1
- package/dist/client/lib/shape-context.d.ts +0 -21
- package/dist/client/lib/shape-context.d.ts.map +0 -1
- package/dist/client/lib/springs.d.ts +0 -32
- package/dist/client/lib/springs.d.ts.map +0 -1
- package/dist/client/lib/surface-classes.d.ts +0 -2
- package/dist/client/lib/surface-classes.d.ts.map +0 -1
- package/dist/client/lib/surface-context.d.ts +0 -7
- package/dist/client/lib/surface-context.d.ts.map +0 -1
- package/dist/client/lib/utils.d.ts +0 -3
- package/dist/client/lib/utils.d.ts.map +0 -1
- package/dist/client/mcp-apps/csp.d.ts +0 -26
- package/dist/client/mcp-apps/csp.d.ts.map +0 -1
- package/dist/client/mcp-apps/debug/csp-suggestions.d.ts +0 -17
- package/dist/client/mcp-apps/debug/csp-suggestions.d.ts.map +0 -1
- package/dist/client/mcp-apps/logging-transport.d.ts +0 -13
- package/dist/client/mcp-apps/logging-transport.d.ts.map +0 -1
- package/dist/client/rpc-traffic-coalesce.d.ts +0 -7
- package/dist/client/rpc-traffic-coalesce.d.ts.map +0 -1
- package/dist/client/rpc-traffic-store.d.ts +0 -37
- package/dist/client/rpc-traffic-store.d.ts.map +0 -1
- package/dist/client/telemetry/capture.d.ts +0 -7
- package/dist/client/telemetry/capture.d.ts.map +0 -1
- package/dist/client/telemetry/events.d.ts +0 -168
- package/dist/client/telemetry/events.d.ts.map +0 -1
- package/dist/client/telemetry/index.d.ts +0 -5
- package/dist/client/telemetry/index.d.ts.map +0 -1
- package/dist/client/telemetry/init.d.ts +0 -2
- package/dist/client/telemetry/init.d.ts.map +0 -1
- package/dist/client/telemetry/utils.d.ts +0 -7
- package/dist/client/telemetry/utils.d.ts.map +0 -1
- package/dist/client/types/message-content-block.d.ts +0 -19
- package/dist/client/types/message-content-block.d.ts.map +0 -1
- package/dist/client/types/pending-requests.d.ts +0 -17
- package/dist/client/types/pending-requests.d.ts.map +0 -1
- package/dist/client/utils/basePath.d.ts +0 -34
- package/dist/client/utils/basePath.d.ts.map +0 -1
- package/dist/client/utils/browser.d.ts +0 -5
- package/dist/client/utils/browser.d.ts.map +0 -1
- package/dist/client/utils/format.d.ts +0 -4
- package/dist/client/utils/format.d.ts.map +0 -1
- package/dist/client/utils/highlightJson.d.ts +0 -11
- package/dist/client/utils/highlightJson.d.ts.map +0 -1
- package/dist/client/utils/jsonUtils.d.ts +0 -24
- package/dist/client/utils/jsonUtils.d.ts.map +0 -1
- package/dist/client/utils/mcpClientUtils.d.ts +0 -131
- package/dist/client/utils/mcpClientUtils.d.ts.map +0 -1
- package/dist/client/utils/servers.d.ts +0 -14
- package/dist/client/utils/servers.d.ts.map +0 -1
- package/dist/server/asset-urls.d.ts +0 -18
- package/dist/server/asset-urls.d.ts.map +0 -1
- package/dist/server/asset-urls.js +0 -17
- package/dist/server/cdn-shell.d.ts +0 -18
- package/dist/server/cdn-shell.d.ts.map +0 -1
- package/dist/server/cdn-shell.js +0 -12
- package/dist/server/chunk-DSTNUYWX.js +0 -148
- package/dist/server/chunk-H6ZCIKBS.js +0 -63
- package/dist/server/chunk-IKTZUWSX.js +0 -0
- package/dist/server/chunk-J4FNYLBF.js +0 -54
- package/dist/server/chunk-K2F2AJOI.js +0 -619
- package/dist/server/chunk-KD7K27XK.js +0 -77
- package/dist/server/chunk-M5TZA42I.js +0 -54
- package/dist/server/chunk-OWR2BIBW.js +0 -40
- package/dist/server/chunk-PKBMQBKP.js +0 -7
- package/dist/server/chunk-SQ4XNMLT.js +0 -72
- package/dist/server/chunk-UJLXHNQP.js +0 -43
- package/dist/server/chunk-WFT4JHYI.js +0 -24
- package/dist/server/chunk-XCNS5CIW.js +0 -199
- package/dist/server/chunk-ZCGLU5T7.js +0 -156
- package/dist/server/cli.d.ts +0 -3
- package/dist/server/cli.d.ts.map +0 -1
- package/dist/server/cli.js +0 -141
- package/dist/server/create-dev-api-app.d.ts +0 -4
- package/dist/server/create-dev-api-app.d.ts.map +0 -1
- package/dist/server/create-dev-api-app.js +0 -11
- package/dist/server/dev-callback-redirect.d.ts +0 -3
- package/dist/server/dev-callback-redirect.d.ts.map +0 -1
- package/dist/server/dev-callback-redirect.js +0 -18
- package/dist/server/favicon-links.d.ts +0 -12
- package/dist/server/favicon-links.d.ts.map +0 -1
- package/dist/server/favicon-links.js +0 -11
- package/dist/server/favicon-static.d.ts +0 -4
- package/dist/server/favicon-static.d.ts.map +0 -1
- package/dist/server/favicon-static.js +0 -8
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/middleware.d.ts +0 -40
- package/dist/server/middleware.d.ts.map +0 -1
- package/dist/server/middleware.js +0 -17
- package/dist/server/proxy/index.d.ts +0 -3
- package/dist/server/proxy/index.d.ts.map +0 -1
- package/dist/server/proxy/index.js +0 -12
- package/dist/server/proxy/mcp-proxy.d.ts +0 -101
- package/dist/server/proxy/mcp-proxy.d.ts.map +0 -1
- package/dist/server/proxy/mcp-proxy.js +0 -10
- package/dist/server/proxy/oauth-proxy.d.ts +0 -26
- package/dist/server/proxy/oauth-proxy.d.ts.map +0 -1
- package/dist/server/proxy/oauth-proxy.js +0 -9
- package/dist/server/proxy-routes.d.ts +0 -16
- package/dist/server/proxy-routes.d.ts.map +0 -1
- package/dist/server/proxy-routes.js +0 -10
- package/dist/server/rpc-log-bus.d.ts +0 -17
- package/dist/server/rpc-log-bus.d.ts.map +0 -1
- package/dist/server/rpc-log-bus.js +0 -77
- package/dist/server/server.d.ts +0 -15
- package/dist/server/server.d.ts.map +0 -1
- package/dist/server/server.js +0 -66
- package/dist/server/static-assets.d.ts +0 -5
- package/dist/server/static-assets.d.ts.map +0 -1
- package/dist/server/static-assets.js +0 -9
- package/dist/server/utils.d.ts +0 -33
- package/dist/server/utils.d.ts.map +0 -1
- package/dist/server/utils.js +0 -17
- package/dist/server/version.d.ts +0 -7
- package/dist/server/version.d.ts.map +0 -1
- package/dist/server/version.js +0 -9
- package/dist/server/vite-dev-api-plugin.d.ts +0 -4
- package/dist/server/vite-dev-api-plugin.d.ts.map +0 -1
- package/dist/server/vite-dev-api-plugin.js +0 -30
- package/dist/web/apple-touch-icon.png +0 -0
- package/dist/web/assets/AnimatePresence-C5p0yiY1.js +0 -9
- package/dist/web/assets/ChatTab-BCobuZDc.js +0 -18
- package/dist/web/assets/ConnectionSettingsTab-BjGkLwVu.js +0 -1
- package/dist/web/assets/ElicitationTab-D3ZUKHND.js +0 -1
- package/dist/web/assets/FormContext-DH2caWKO.js +0 -1
- package/dist/web/assets/ListTabHeader-R17w_JsB.js +0 -1
- package/dist/web/assets/ManufactOAuthCallback-CS3ydSZg.js +0 -1
- package/dist/web/assets/MarkdownRenderer-BeeBfQhv.js +0 -47
- package/dist/web/assets/NotificationsTab-Uj0_DrmK.js +0 -1
- package/dist/web/assets/OAuthCallback-C0ljgCiw.js +0 -1
- package/dist/web/assets/PromptsTab-Bns2u0G-.js +0 -15
- package/dist/web/assets/ResourcesTab-CO24312V.js +0 -2
- package/dist/web/assets/SamplingTab-7gtN7FwU.js +0 -1
- package/dist/web/assets/ServerMetadataTab-CQwqYSjL.js +0 -1
- package/dist/web/assets/ToolsTab-bDdRxI1b.js +0 -8
- package/dist/web/assets/ViewPreview-Ba1Ec5uA.js +0 -1
- package/dist/web/assets/WidgetWrapper-CYHfzrtb.js +0 -34
- package/dist/web/assets/brush--0LobUi4.js +0 -1
- package/dist/web/assets/checkbox-CzBkaNKa.js +0 -1
- package/dist/web/assets/code-tME-5H6D.js +0 -1
- package/dist/web/assets/createLucideIcon-B3b8EU0b.js +0 -1
- package/dist/web/assets/dist-C5JjLJN9.js +0 -21
- package/dist/web/assets/index-TQ5V7cM9.js +0 -492
- package/dist/web/assets/index-fBX3akc8.css +0 -1
- package/dist/web/assets/input-CLYhA7PK.js +0 -1
- package/dist/web/assets/inspector-settings-layout-yjKRJDai.js +0 -1
- package/dist/web/assets/jsx-runtime-Cjj9sGSy.js +0 -1
- package/dist/web/assets/label-Cdim77Jw.js +0 -1
- package/dist/web/assets/maximize-2-BTT9QQU9.js +0 -1
- package/dist/web/assets/maximize-_O55kFcr.js +0 -1
- package/dist/web/assets/react-CU_d2d5K.js +0 -1
- package/dist/web/assets/refresh-cw-C9wQl8_d.js +0 -1
- package/dist/web/assets/save-B-MsgxX9.js +0 -1
- package/dist/web/assets/schemaHelpers-DLNTQr_6.js +0 -1
- package/dist/web/assets/select-CJ57-Bor.js +0 -1
- package/dist/web/assets/shared-BF0rJNdE.js +0 -1
- package/dist/web/assets/sparkles-2OAsc1aP.js +0 -1
- package/dist/web/assets/tabs-subtle-6D79T1xd.js +0 -1
- package/dist/web/assets/textarea-DLAmNVf_.js +0 -1
- package/dist/web/assets/useConfig-BAgALiZg.js +0 -1
- package/dist/web/assets/useViewHostProps-BYitt_6K.js +0 -1
- package/dist/web/assets/zap-Du2Uc5pa.js +0 -1
- package/dist/web/favicon-96x96.png +0 -0
- package/dist/web/favicon-black.svg +0 -5
- package/dist/web/favicon-white.svg +0 -5
- package/dist/web/favicon.ico +0 -0
- package/dist/web/favicon.svg +0 -5
- package/dist/web/index.html +0 -89
- package/dist/web/providers/anthropic.png +0 -0
- package/dist/web/providers/google.png +0 -0
- package/dist/web/providers/openai.png +0 -0
- package/dist/web/site.webmanifest +0 -21
- package/dist/web/web-app-manifest-192x192.png +0 -0
- package/dist/web/web-app-manifest-512x512.png +0 -0
- /package/dist/{cdn → app}/apple-touch-icon.png +0 -0
- /package/dist/{cdn → app}/favicon-96x96.png +0 -0
- /package/dist/{cdn → app}/favicon-black.svg +0 -0
- /package/dist/{cdn → app}/favicon-white.svg +0 -0
- /package/dist/{cdn → app}/favicon.ico +0 -0
- /package/dist/{cdn → app}/favicon.svg +0 -0
- /package/dist/{cdn → app}/site.webmanifest +0 -0
- /package/dist/{cdn → app}/web-app-manifest-192x192.png +0 -0
- /package/dist/{cdn → app}/web-app-manifest-512x512.png +0 -0
|
@@ -1,658 +0,0 @@
|
|
|
1
|
-
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import { a as n, n as r, r as i, sr as a, t as o } from "./input-C2OBd4PJ.js";
|
|
3
|
-
import { t as s } from "./jsx-runtime-CIxvMpEo.js";
|
|
4
|
-
import { t as c } from "./label-B9Jmm9be.js";
|
|
5
|
-
import { a as l, i as u, n as d, r as f, t as p } from "./select-DDdiIPR2.js";
|
|
6
|
-
import { a as m, i as h, r as g, t as _ } from "./browser-CbQIH4w2.js";
|
|
7
|
-
import { a as v, t as y } from "./JSONDisplay-BFxf5oEu.js";
|
|
8
|
-
import { a as b, i as ee, n as x, o as S, r as C, t as te } from "./shared-DaILIQPP.js";
|
|
9
|
-
import { t as w } from "./hash-BVQnWi7q.js";
|
|
10
|
-
import { t as T } from "./loader-circle-BLy9A_pp.js";
|
|
11
|
-
import { t as E } from "./maximize-2-CH5Lq90B.js";
|
|
12
|
-
import { t as D } from "./sparkles-BntO2rDR.js";
|
|
13
|
-
import { t as O } from "./trash-2-RwpJY5SL.js";
|
|
14
|
-
import { t as k } from "./x-C3vRQIYu.js";
|
|
15
|
-
import { t as A } from "./not-found-DEtSM_Wd.js";
|
|
16
|
-
import { u as j } from "./cfWorker-Bxcs9rNe.js";
|
|
17
|
-
import "./react-BajV-X4P.js";
|
|
18
|
-
import { n as M } from "./dist-DaMB0Su9.js";
|
|
19
|
-
import { n as N } from "./InspectorContext-UjtEbNod.js";
|
|
20
|
-
import { a as P } from "./dist-DbX5yidW.js";
|
|
21
|
-
import { t as F } from "./useConfig-Btmh8wjJ.js";
|
|
22
|
-
import { t as I } from "./textarea-DSbwcFVt.js";
|
|
23
|
-
//#region src/client/components/sampling/SamplingRequestsList.tsx
|
|
24
|
-
var L = /* @__PURE__ */ e(t(), 1), R = s();
|
|
25
|
-
function z({ requests: e, selectedRequest: t, onRequestSelect: n, focusedIndex: r, formatRelativeTime: i }) {
|
|
26
|
-
return e.length === 0 ? /* @__PURE__ */ (0, R.jsx)("div", {
|
|
27
|
-
className: "flex flex-1 flex-col items-center justify-center p-4 text-center",
|
|
28
|
-
children: /* @__PURE__ */ (0, R.jsx)(A, {
|
|
29
|
-
vertical: !0,
|
|
30
|
-
noBorder: !0,
|
|
31
|
-
message: "No sampling requests"
|
|
32
|
-
})
|
|
33
|
-
}) : /* @__PURE__ */ (0, R.jsx)("div", { children: e.map((e, a) => {
|
|
34
|
-
let o = e.request.params?.messages?.length || 0, s = e.request.params?.maxTokens;
|
|
35
|
-
return /* @__PURE__ */ (0, R.jsx)(C, {
|
|
36
|
-
id: `sampling-request-${e.id}`,
|
|
37
|
-
isSelected: t?.id === e.id,
|
|
38
|
-
isFocused: r === a,
|
|
39
|
-
title: /* @__PURE__ */ (0, R.jsxs)("span", {
|
|
40
|
-
className: "flex items-center gap-3",
|
|
41
|
-
children: [e.serverName, /* @__PURE__ */ (0, R.jsx)("span", { className: "size-1.5 block rounded-full bg-orange-500" })]
|
|
42
|
-
}),
|
|
43
|
-
description: (() => {
|
|
44
|
-
let t = i(e.timestamp), n = [];
|
|
45
|
-
return o > 0 && n.push(`${o} message${o > 1 ? "s" : ""}`), s && n.push(`max ${s} tokens`), t + (n.length > 0 ? ` | ${n.join(", ")}` : "");
|
|
46
|
-
})(),
|
|
47
|
-
onClick: () => n(e)
|
|
48
|
-
}, e.id);
|
|
49
|
-
}) });
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/client/components/sampling/useSamplingLLM.ts
|
|
53
|
-
function B({ llmConfig: e }) {
|
|
54
|
-
return {
|
|
55
|
-
generateResponse: (0, L.useCallback)(async ({ request: t }) => {
|
|
56
|
-
if (!e) throw Error("LLM config is not available");
|
|
57
|
-
let n = t.params || {}, r = n.maxTokens, i = n.temperature, a = n.messages || [];
|
|
58
|
-
if (a.length === 0) throw Error("No messages found in sampling request");
|
|
59
|
-
let o = [];
|
|
60
|
-
for (let e of a) {
|
|
61
|
-
if (!e || !e.role) continue;
|
|
62
|
-
let t = Array.isArray(e.content) ? e.content[0] : e.content;
|
|
63
|
-
t && t.type === "text" && t.text && (e.role === "user" || e.role === "assistant") && o.push({
|
|
64
|
-
role: e.role,
|
|
65
|
-
content: t.text
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (o.length === 0) throw Error("No valid messages could be converted. Please ensure messages have 'text' content type.");
|
|
69
|
-
return {
|
|
70
|
-
role: "assistant",
|
|
71
|
-
content: {
|
|
72
|
-
type: "text",
|
|
73
|
-
text: await P({
|
|
74
|
-
config: {
|
|
75
|
-
provider: e.provider,
|
|
76
|
-
model: e.model,
|
|
77
|
-
apiKey: e.apiKey,
|
|
78
|
-
temperature: i ?? e.temperature,
|
|
79
|
-
maxTokens: r,
|
|
80
|
-
baseUrl: e.baseUrl
|
|
81
|
-
},
|
|
82
|
-
messages: o
|
|
83
|
-
})
|
|
84
|
-
},
|
|
85
|
-
model: e.model,
|
|
86
|
-
stopReason: "endTurn"
|
|
87
|
-
};
|
|
88
|
-
}, [e]),
|
|
89
|
-
isAvailable: e !== null
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/client/components/sampling/SamplingRequestDisplay.tsx
|
|
94
|
-
function V({ request: t, onApprove: s, onReject: g, onClose: _, previewMode: b, onTogglePreview: ee, isCopied: x, onCopy: S, onDownload: C, onFullscreen: te, llmConfig: w }) {
|
|
95
|
-
let [O, A] = (0, L.useState)("manual"), [N, P] = (0, L.useState)("stub-model"), [F, z] = (0, L.useState)("endTurn"), [V, H] = (0, L.useState)("assistant"), [U, W] = (0, L.useState)("text"), [G, K] = (0, L.useState)("positive"), [q, J] = (0, L.useState)(""), [Y, X] = (0, L.useState)("image/png"), [Z, ne] = (0, L.useState)(!1), [re, Q] = (0, L.useState)(null), { generateResponse: ie, isAvailable: $ } = B({ llmConfig: w });
|
|
96
|
-
(0, L.useEffect)(() => {
|
|
97
|
-
t && (P(O === "llm" && w?.model ? w.model : "stub-model"), z("endTurn"), H("assistant"), W("text"), K("positive"), J(""), X("image/png"), Q(null));
|
|
98
|
-
}, [t?.id]), (0, L.useEffect)(() => {
|
|
99
|
-
O === "llm" && w?.model && P(w.model);
|
|
100
|
-
}, [O, w?.model]);
|
|
101
|
-
let ae = async () => {
|
|
102
|
-
if (!t || !$) {
|
|
103
|
-
console.log("[SamplingRequestDisplay] Cannot generate:", {
|
|
104
|
-
hasRequest: !!t,
|
|
105
|
-
isAvailable: $
|
|
106
|
-
});
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
console.log("[SamplingRequestDisplay] Starting LLM generation:", {
|
|
110
|
-
requestId: t.id,
|
|
111
|
-
llmConfig: w
|
|
112
|
-
}), ne(!0), Q(null);
|
|
113
|
-
try {
|
|
114
|
-
let e = await ie({ request: t.request });
|
|
115
|
-
console.log("[SamplingRequestDisplay] LLM generation result:", {
|
|
116
|
-
result: e,
|
|
117
|
-
model: e.model,
|
|
118
|
-
stopReason: e.stopReason,
|
|
119
|
-
role: e.role,
|
|
120
|
-
contentIsArray: Array.isArray(e.content),
|
|
121
|
-
content: e.content
|
|
122
|
-
}), P(e.model || w?.model || "stub-model"), z(e.stopReason || "endTurn"), H(e.role || "assistant");
|
|
123
|
-
let n = Array.isArray(e.content) ? e.content[0] : e.content;
|
|
124
|
-
console.log("[SamplingRequestDisplay] Setting content:", {
|
|
125
|
-
contentType: n.type,
|
|
126
|
-
hasText: "text" in n,
|
|
127
|
-
text: "text" in n ? n.text : void 0
|
|
128
|
-
}), n.type === "text" ? (W("text"), K(n.text || ""), console.log("[SamplingRequestDisplay] Set text content:", n.text)) : n.type === "image" && (W("image"), J(n.data || ""), X(n.mimeType || "image/png"), console.log("[SamplingRequestDisplay] Set image content")), console.log("[SamplingRequestDisplay] Form state after update:", {
|
|
129
|
-
model: N,
|
|
130
|
-
stopReason: F,
|
|
131
|
-
role: V,
|
|
132
|
-
contentType: U,
|
|
133
|
-
textContent: G
|
|
134
|
-
});
|
|
135
|
-
} catch (e) {
|
|
136
|
-
console.error("[SamplingRequestDisplay] LLM generation error:", e);
|
|
137
|
-
let t = e instanceof Error ? e.message : "Failed to generate response";
|
|
138
|
-
Q(t), M.error("LLM Generation Failed", { description: t });
|
|
139
|
-
} finally {
|
|
140
|
-
ne(!1), console.log("[SamplingRequestDisplay] Generation complete");
|
|
141
|
-
}
|
|
142
|
-
}, oe = (0, L.useMemo)(() => {
|
|
143
|
-
let e = {
|
|
144
|
-
model: N,
|
|
145
|
-
stopReason: F,
|
|
146
|
-
role: V,
|
|
147
|
-
content: { type: U }
|
|
148
|
-
};
|
|
149
|
-
return U === "text" ? e.content.text = G : U === "image" && (e.content.data = q, e.content.mimeType = Y), e;
|
|
150
|
-
}, [
|
|
151
|
-
N,
|
|
152
|
-
F,
|
|
153
|
-
V,
|
|
154
|
-
U,
|
|
155
|
-
G,
|
|
156
|
-
q,
|
|
157
|
-
Y
|
|
158
|
-
]);
|
|
159
|
-
return t ? /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
160
|
-
className: "flex flex-col h-full",
|
|
161
|
-
children: [
|
|
162
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
163
|
-
className: "flex items-center justify-between p-4 border-b dark:border-zinc-700",
|
|
164
|
-
children: [/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
165
|
-
className: "flex items-center gap-2",
|
|
166
|
-
children: [/* @__PURE__ */ (0, R.jsx)("h3", {
|
|
167
|
-
className: "font-medium text-gray-900 dark:text-gray-100",
|
|
168
|
-
children: t.serverName
|
|
169
|
-
}), /* @__PURE__ */ (0, R.jsx)("span", {
|
|
170
|
-
className: "text-sm text-gray-500 dark:text-gray-400",
|
|
171
|
-
children: new Date(t.timestamp).toLocaleString()
|
|
172
|
-
})]
|
|
173
|
-
}), /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
174
|
-
className: "flex items-center gap-2",
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ (0, R.jsxs)(r, { children: [/* @__PURE__ */ (0, R.jsx)(n, {
|
|
177
|
-
render: /* @__PURE__ */ (0, R.jsx)(a, {
|
|
178
|
-
variant: "ghost",
|
|
179
|
-
size: "sm",
|
|
180
|
-
onClick: S,
|
|
181
|
-
className: "h-8 w-8 p-0",
|
|
182
|
-
children: x ? /* @__PURE__ */ (0, R.jsx)(m, { className: "h-4 w-4 text-green-600" }) : /* @__PURE__ */ (0, R.jsx)(h, { className: "h-4 w-4" })
|
|
183
|
-
}),
|
|
184
|
-
nativeButton: !0
|
|
185
|
-
}), /* @__PURE__ */ (0, R.jsx)(i, { children: "Copy request" })] }),
|
|
186
|
-
/* @__PURE__ */ (0, R.jsxs)(r, { children: [/* @__PURE__ */ (0, R.jsx)(n, {
|
|
187
|
-
render: /* @__PURE__ */ (0, R.jsx)(a, {
|
|
188
|
-
variant: "ghost",
|
|
189
|
-
size: "sm",
|
|
190
|
-
onClick: C,
|
|
191
|
-
className: "h-8 w-8 p-0",
|
|
192
|
-
children: /* @__PURE__ */ (0, R.jsx)(v, { className: "h-4 w-4" })
|
|
193
|
-
}),
|
|
194
|
-
nativeButton: !0
|
|
195
|
-
}), /* @__PURE__ */ (0, R.jsx)(i, { children: "Download request" })] }),
|
|
196
|
-
/* @__PURE__ */ (0, R.jsxs)(r, { children: [/* @__PURE__ */ (0, R.jsx)(n, {
|
|
197
|
-
render: /* @__PURE__ */ (0, R.jsx)(a, {
|
|
198
|
-
variant: "ghost",
|
|
199
|
-
size: "sm",
|
|
200
|
-
onClick: te,
|
|
201
|
-
className: "h-8 w-8 p-0",
|
|
202
|
-
children: /* @__PURE__ */ (0, R.jsx)(E, { className: "h-4 w-4" })
|
|
203
|
-
}),
|
|
204
|
-
nativeButton: !0
|
|
205
|
-
}), /* @__PURE__ */ (0, R.jsx)(i, { children: "Fullscreen" })] }),
|
|
206
|
-
/* @__PURE__ */ (0, R.jsx)(a, {
|
|
207
|
-
variant: "ghost",
|
|
208
|
-
size: "sm",
|
|
209
|
-
onClick: _,
|
|
210
|
-
className: "h-8 w-8 p-0",
|
|
211
|
-
children: /* @__PURE__ */ (0, R.jsx)(k, { className: "h-4 w-4" })
|
|
212
|
-
})
|
|
213
|
-
]
|
|
214
|
-
})]
|
|
215
|
-
}),
|
|
216
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
217
|
-
className: "flex-1 overflow-y-auto p-4 space-y-6",
|
|
218
|
-
children: [/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
219
|
-
className: "space-y-2",
|
|
220
|
-
children: [/* @__PURE__ */ (0, R.jsx)("h4", {
|
|
221
|
-
className: "text-sm font-semibold text-gray-900 dark:text-gray-100",
|
|
222
|
-
children: "Request"
|
|
223
|
-
}), /* @__PURE__ */ (0, R.jsx)("div", {
|
|
224
|
-
className: "bg-muted rounded-lg p-3 max-h-64 overflow-auto",
|
|
225
|
-
children: /* @__PURE__ */ (0, R.jsx)(y, { data: t.request })
|
|
226
|
-
})]
|
|
227
|
-
}), /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
228
|
-
className: "space-y-4",
|
|
229
|
-
children: [
|
|
230
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
231
|
-
className: "flex items-center justify-between",
|
|
232
|
-
children: [/* @__PURE__ */ (0, R.jsx)("h4", {
|
|
233
|
-
className: "text-sm font-semibold text-gray-900 dark:text-gray-100",
|
|
234
|
-
children: "Response"
|
|
235
|
-
}), /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
236
|
-
className: "flex items-center gap-2",
|
|
237
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
238
|
-
htmlFor: `responseMode-${t.id}`,
|
|
239
|
-
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
240
|
-
children: "Mode:"
|
|
241
|
-
}), /* @__PURE__ */ (0, R.jsxs)(p, {
|
|
242
|
-
value: O,
|
|
243
|
-
onValueChange: (e) => A(e),
|
|
244
|
-
children: [/* @__PURE__ */ (0, R.jsx)(u, {
|
|
245
|
-
id: `responseMode-${t.id}`,
|
|
246
|
-
className: "w-32 h-8 text-xs",
|
|
247
|
-
"data-testid": "sampling-response-mode-select",
|
|
248
|
-
children: /* @__PURE__ */ (0, R.jsx)(l, {})
|
|
249
|
-
}), /* @__PURE__ */ (0, R.jsxs)(d, { children: [/* @__PURE__ */ (0, R.jsx)(f, {
|
|
250
|
-
value: "manual",
|
|
251
|
-
"data-testid": "sampling-response-mode-manual",
|
|
252
|
-
children: "Manual"
|
|
253
|
-
}), /* @__PURE__ */ (0, R.jsx)(f, {
|
|
254
|
-
value: "llm",
|
|
255
|
-
"data-testid": "sampling-response-mode-llm",
|
|
256
|
-
children: "LLM"
|
|
257
|
-
})] })]
|
|
258
|
-
})]
|
|
259
|
-
})]
|
|
260
|
-
}),
|
|
261
|
-
O === "llm" && /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
262
|
-
className: "space-y-2 p-3 bg-muted rounded-lg",
|
|
263
|
-
children: [$ ? /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
264
|
-
className: "flex items-center gap-2",
|
|
265
|
-
children: [/* @__PURE__ */ (0, R.jsx)(a, {
|
|
266
|
-
onClick: ae,
|
|
267
|
-
disabled: Z,
|
|
268
|
-
size: "sm",
|
|
269
|
-
className: "flex items-center gap-2",
|
|
270
|
-
"data-testid": "sampling-generate-llm-button",
|
|
271
|
-
children: Z ? /* @__PURE__ */ (0, R.jsxs)("span", {
|
|
272
|
-
"data-testid": "sampling-generating",
|
|
273
|
-
className: "flex items-center gap-2",
|
|
274
|
-
children: [/* @__PURE__ */ (0, R.jsx)(T, { className: "h-4 w-4 animate-spin" }), "Generating..."]
|
|
275
|
-
}) : /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(D, { className: "h-4 w-4" }), "Generate with LLM"] })
|
|
276
|
-
}), /* @__PURE__ */ (0, R.jsxs)("span", {
|
|
277
|
-
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
278
|
-
children: [
|
|
279
|
-
"Using ",
|
|
280
|
-
w?.provider,
|
|
281
|
-
" (",
|
|
282
|
-
w?.model,
|
|
283
|
-
")"
|
|
284
|
-
]
|
|
285
|
-
})]
|
|
286
|
-
}) : /* @__PURE__ */ (0, R.jsx)("div", {
|
|
287
|
-
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
288
|
-
children: "LLM not configured. Please configure LLM in the Chat tab."
|
|
289
|
-
}), re && /* @__PURE__ */ (0, R.jsx)("div", {
|
|
290
|
-
className: "text-xs text-red-600 dark:text-red-400",
|
|
291
|
-
"data-testid": "sampling-generation-error",
|
|
292
|
-
children: re
|
|
293
|
-
})]
|
|
294
|
-
}),
|
|
295
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
296
|
-
className: "space-y-2",
|
|
297
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
298
|
-
htmlFor: `model-${t.id}`,
|
|
299
|
-
children: "Model"
|
|
300
|
-
}), /* @__PURE__ */ (0, R.jsx)(o, {
|
|
301
|
-
id: `model-${t.id}`,
|
|
302
|
-
value: N,
|
|
303
|
-
onChange: (e) => P(e.target.value),
|
|
304
|
-
placeholder: "stub-model",
|
|
305
|
-
disabled: O === "llm" && Z,
|
|
306
|
-
"data-testid": "sampling-model-input"
|
|
307
|
-
})]
|
|
308
|
-
}),
|
|
309
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
310
|
-
className: "space-y-2",
|
|
311
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
312
|
-
htmlFor: `stopReason-${t.id}`,
|
|
313
|
-
children: "Stop Reason"
|
|
314
|
-
}), /* @__PURE__ */ (0, R.jsx)(o, {
|
|
315
|
-
id: `stopReason-${t.id}`,
|
|
316
|
-
value: F,
|
|
317
|
-
onChange: (e) => z(e.target.value),
|
|
318
|
-
placeholder: "endTurn",
|
|
319
|
-
disabled: O === "llm" && Z,
|
|
320
|
-
"data-testid": "sampling-stop-reason-input"
|
|
321
|
-
})]
|
|
322
|
-
}),
|
|
323
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
324
|
-
className: "space-y-2",
|
|
325
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
326
|
-
htmlFor: `role-${t.id}`,
|
|
327
|
-
children: "Role"
|
|
328
|
-
}), /* @__PURE__ */ (0, R.jsxs)(p, {
|
|
329
|
-
value: V,
|
|
330
|
-
onValueChange: (e) => H(e),
|
|
331
|
-
disabled: O === "llm" && Z,
|
|
332
|
-
children: [/* @__PURE__ */ (0, R.jsx)(u, {
|
|
333
|
-
id: `role-${t.id}`,
|
|
334
|
-
"data-testid": "sampling-role-select",
|
|
335
|
-
children: /* @__PURE__ */ (0, R.jsx)(l, {})
|
|
336
|
-
}), /* @__PURE__ */ (0, R.jsxs)(d, { children: [/* @__PURE__ */ (0, R.jsx)(f, {
|
|
337
|
-
value: "assistant",
|
|
338
|
-
children: "assistant"
|
|
339
|
-
}), /* @__PURE__ */ (0, R.jsx)(f, {
|
|
340
|
-
value: "user",
|
|
341
|
-
children: "user"
|
|
342
|
-
})] })]
|
|
343
|
-
})]
|
|
344
|
-
}),
|
|
345
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
346
|
-
className: "space-y-2",
|
|
347
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
348
|
-
htmlFor: `contentType-${t.id}`,
|
|
349
|
-
children: "Content Type"
|
|
350
|
-
}), /* @__PURE__ */ (0, R.jsxs)(p, {
|
|
351
|
-
value: U,
|
|
352
|
-
onValueChange: (e) => W(e),
|
|
353
|
-
disabled: O === "llm" && Z,
|
|
354
|
-
children: [/* @__PURE__ */ (0, R.jsx)(u, {
|
|
355
|
-
id: `contentType-${t.id}`,
|
|
356
|
-
"data-testid": "sampling-content-type-select",
|
|
357
|
-
children: /* @__PURE__ */ (0, R.jsx)(l, {})
|
|
358
|
-
}), /* @__PURE__ */ (0, R.jsxs)(d, { children: [/* @__PURE__ */ (0, R.jsx)(f, {
|
|
359
|
-
value: "text",
|
|
360
|
-
children: "text"
|
|
361
|
-
}), /* @__PURE__ */ (0, R.jsx)(f, {
|
|
362
|
-
value: "image",
|
|
363
|
-
children: "image"
|
|
364
|
-
})] })]
|
|
365
|
-
})]
|
|
366
|
-
}),
|
|
367
|
-
U === "text" && /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
368
|
-
className: "space-y-2",
|
|
369
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
370
|
-
htmlFor: `text-${t.id}`,
|
|
371
|
-
children: "Text Content"
|
|
372
|
-
}), /* @__PURE__ */ (0, R.jsx)(I, {
|
|
373
|
-
id: `text-${t.id}`,
|
|
374
|
-
value: G,
|
|
375
|
-
onChange: (e) => K(e.target.value),
|
|
376
|
-
placeholder: "Enter response text...",
|
|
377
|
-
rows: 6,
|
|
378
|
-
disabled: O === "llm" && Z,
|
|
379
|
-
"data-testid": "sampling-text-content"
|
|
380
|
-
})]
|
|
381
|
-
}),
|
|
382
|
-
U === "image" && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
383
|
-
className: "space-y-2",
|
|
384
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
385
|
-
htmlFor: `imageData-${t.id}`,
|
|
386
|
-
children: "Base64 Image Data"
|
|
387
|
-
}), /* @__PURE__ */ (0, R.jsx)(I, {
|
|
388
|
-
id: `imageData-${t.id}`,
|
|
389
|
-
value: q,
|
|
390
|
-
onChange: (e) => J(e.target.value),
|
|
391
|
-
placeholder: "Base64 encoded image data...",
|
|
392
|
-
rows: 4,
|
|
393
|
-
disabled: O === "llm" && Z
|
|
394
|
-
})]
|
|
395
|
-
}), /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
396
|
-
className: "space-y-2",
|
|
397
|
-
children: [/* @__PURE__ */ (0, R.jsx)(c, {
|
|
398
|
-
htmlFor: `mimeType-${t.id}`,
|
|
399
|
-
children: "MIME Type"
|
|
400
|
-
}), /* @__PURE__ */ (0, R.jsx)(o, {
|
|
401
|
-
id: `mimeType-${t.id}`,
|
|
402
|
-
value: Y,
|
|
403
|
-
onChange: (e) => X(e.target.value),
|
|
404
|
-
placeholder: "image/png",
|
|
405
|
-
disabled: O === "llm" && Z
|
|
406
|
-
})]
|
|
407
|
-
})] })
|
|
408
|
-
]
|
|
409
|
-
})]
|
|
410
|
-
}),
|
|
411
|
-
/* @__PURE__ */ (0, R.jsxs)("div", {
|
|
412
|
-
className: "flex gap-2 p-4 border-t dark:border-zinc-700",
|
|
413
|
-
children: [/* @__PURE__ */ (0, R.jsx)(a, {
|
|
414
|
-
onClick: () => {
|
|
415
|
-
if (!t) return;
|
|
416
|
-
let n = j.CreateMessageResult["~standard"].validate(oe);
|
|
417
|
-
if (n.issues) {
|
|
418
|
-
M.error("Invalid response", { description: `Validation failed: ${n.issues.map((e) => e.message).join(", ")}` });
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
s(t.id, n.value), _(), import("./react-BIs9pQ3H.js").then((t) => /* @__PURE__ */ e(t.t(), 1)).then((e) => {
|
|
422
|
-
let n = M(e.createElement("div", { className: "space-y-3" }, e.createElement("div", null, e.createElement("strong", null, "Sampling Response Sent"), e.createElement("p", { className: "text-sm text-muted-foreground mt-1" }, "The tool will continue executing.")), e.createElement("div", { className: "flex gap-2" }, e.createElement("button", {
|
|
423
|
-
"data-testid": "sampling-view-tool-result",
|
|
424
|
-
className: "px-3 py-1.5 text-xs font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90",
|
|
425
|
-
onClick: () => {
|
|
426
|
-
let e = new globalThis.CustomEvent("navigate-to-tool-result", { detail: { toolName: t.toolName } });
|
|
427
|
-
window.dispatchEvent(e), M.dismiss(n);
|
|
428
|
-
}
|
|
429
|
-
}, "View Tool Result"))), { duration: 5e3 });
|
|
430
|
-
});
|
|
431
|
-
},
|
|
432
|
-
className: "flex-1",
|
|
433
|
-
disabled: O === "llm" && Z,
|
|
434
|
-
"data-testid": "sampling-approve-button",
|
|
435
|
-
children: "Approve"
|
|
436
|
-
}), /* @__PURE__ */ (0, R.jsx)(a, {
|
|
437
|
-
onClick: () => {
|
|
438
|
-
t && (g(t.id, "User rejected sampling request"), _());
|
|
439
|
-
},
|
|
440
|
-
variant: "outline",
|
|
441
|
-
className: "flex-1",
|
|
442
|
-
disabled: O === "llm" && Z,
|
|
443
|
-
"data-testid": "sampling-reject-button",
|
|
444
|
-
children: "Reject"
|
|
445
|
-
})]
|
|
446
|
-
})
|
|
447
|
-
]
|
|
448
|
-
}) : /* @__PURE__ */ (0, R.jsx)("div", {
|
|
449
|
-
className: "flex flex-col items-center justify-center h-full p-4 text-center",
|
|
450
|
-
children: /* @__PURE__ */ (0, R.jsx)("p", {
|
|
451
|
-
className: "text-gray-500 dark:text-gray-400",
|
|
452
|
-
children: "Select a sampling request to view details"
|
|
453
|
-
})
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
//#endregion
|
|
457
|
-
//#region src/client/components/SamplingTab.tsx
|
|
458
|
-
function H({ pendingRequests: e, onApprove: t, onReject: n, serverId: r, isConnected: i, mcpServerUrl: a }) {
|
|
459
|
-
let { selectedSamplingRequestId: o, setSelectedSamplingRequestId: s } = N(), { llmConfig: c } = F({ mcpServerUrl: a }), [l, u] = (0, L.useState)(null), [d, f] = (0, L.useState)(""), [p, m] = (0, L.useState)(-1), [h, v] = (0, L.useState)(!0), [y, C] = (0, L.useState)(!1), [T, E] = (0, L.useState)(!0), [D, k] = (0, L.useState)(!1), A = (0, L.useRef)(null), j = (0, L.useRef)(null), M = (0, L.useRef)(null), P = (0, L.useRef)(!1);
|
|
460
|
-
(0, L.useEffect)(() => {
|
|
461
|
-
if (console.log("[SamplingTab] Auto-selection check:", {
|
|
462
|
-
selectedSamplingRequestId: o,
|
|
463
|
-
pendingRequestsCount: e.length,
|
|
464
|
-
currentSelectedId: l?.id
|
|
465
|
-
}), o && e.length > 0) {
|
|
466
|
-
let t = e.find((e) => e.id === o);
|
|
467
|
-
console.log("[SamplingTab] Found request for auto-selection:", !!t, t?.id), t && (console.log("[SamplingTab] Auto-selecting request:", t.id), s(null), u(t), setTimeout(() => {
|
|
468
|
-
let e = document.getElementById(`sampling-request-${t.id}`);
|
|
469
|
-
console.log("[SamplingTab] Scrolling to element:", !!e), e && e.scrollIntoView({
|
|
470
|
-
behavior: "smooth",
|
|
471
|
-
block: "nearest"
|
|
472
|
-
});
|
|
473
|
-
}, 100));
|
|
474
|
-
}
|
|
475
|
-
}, [
|
|
476
|
-
o,
|
|
477
|
-
e,
|
|
478
|
-
s
|
|
479
|
-
]), (0, L.useEffect)(() => {
|
|
480
|
-
let t = (t) => {
|
|
481
|
-
let n = t.detail.requestId;
|
|
482
|
-
console.log("[SamplingTab] Custom navigate event received:", n);
|
|
483
|
-
let r = e.find((e) => e.id === n);
|
|
484
|
-
r && (console.log("[SamplingTab] Selecting request from event:", n), u(r), setTimeout(() => {
|
|
485
|
-
let e = document.getElementById(`sampling-request-${n}`);
|
|
486
|
-
e && e.scrollIntoView({
|
|
487
|
-
behavior: "smooth",
|
|
488
|
-
block: "nearest"
|
|
489
|
-
});
|
|
490
|
-
}, 200));
|
|
491
|
-
};
|
|
492
|
-
return window.addEventListener("navigate-to-sampling", t), () => window.removeEventListener("navigate-to-sampling", t);
|
|
493
|
-
}, [e]), (0, L.useEffect)(() => {
|
|
494
|
-
h && e.length > 0 && A.current && !P.current && (A.current.scrollTop = 0);
|
|
495
|
-
}, [e.length, h]), (0, L.useEffect)(() => {
|
|
496
|
-
let e = A.current;
|
|
497
|
-
if (!e) return;
|
|
498
|
-
let t = () => {
|
|
499
|
-
e.scrollTop > 0 && (P.current = !0, v(!1));
|
|
500
|
-
};
|
|
501
|
-
return e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t);
|
|
502
|
-
}, []), (0, L.useEffect)(() => {
|
|
503
|
-
e.length === 0 && (P.current = !1, v(!0));
|
|
504
|
-
}, [e.length]), (0, L.useEffect)(() => {
|
|
505
|
-
y && M.current && M.current.focus();
|
|
506
|
-
}, [y]);
|
|
507
|
-
let I = (0, L.useCallback)(() => {
|
|
508
|
-
d.trim() || C(!1);
|
|
509
|
-
}, [d]), B = (0, L.useMemo)(() => {
|
|
510
|
-
if (!d.trim()) return e;
|
|
511
|
-
let t = d.toLowerCase();
|
|
512
|
-
return e.filter((e) => e.serverName.toLowerCase().includes(t) || JSON.stringify(e.request || {}).toLowerCase().includes(t));
|
|
513
|
-
}, [e, d]);
|
|
514
|
-
(0, L.useEffect)(() => {
|
|
515
|
-
m(-1);
|
|
516
|
-
}, [d]), (0, L.useEffect)(() => {
|
|
517
|
-
let e = (e) => {
|
|
518
|
-
let t = e.target;
|
|
519
|
-
if (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.contentEditable === "true" || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
520
|
-
let n = B;
|
|
521
|
-
if (e.key === "ArrowDown") e.preventDefault(), m((e) => {
|
|
522
|
-
let t = e + 1;
|
|
523
|
-
return t >= n.length ? 0 : t;
|
|
524
|
-
});
|
|
525
|
-
else if (e.key === "ArrowUp") e.preventDefault(), m((e) => {
|
|
526
|
-
let t = e - 1;
|
|
527
|
-
return t < 0 ? n.length - 1 : t;
|
|
528
|
-
});
|
|
529
|
-
else if (e.key === "Enter" && p >= 0) {
|
|
530
|
-
e.preventDefault();
|
|
531
|
-
let t = B[p];
|
|
532
|
-
t && H(t);
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
536
|
-
}, [p, B]), (0, L.useEffect)(() => {
|
|
537
|
-
if (p >= 0) {
|
|
538
|
-
let e = `sampling-request-${B[p]?.id}`, t = document.getElementById(e);
|
|
539
|
-
t && t.scrollIntoView({
|
|
540
|
-
behavior: "smooth",
|
|
541
|
-
block: "nearest"
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
}, [p, B]);
|
|
545
|
-
let H = (0, L.useCallback)((e) => {
|
|
546
|
-
u(e);
|
|
547
|
-
}, []), U = (0, L.useCallback)(() => {
|
|
548
|
-
window.confirm("Are you sure you want to reject all sampling requests? This cannot be undone.") && (e.forEach((e) => {
|
|
549
|
-
n(e.id, "User rejected all requests");
|
|
550
|
-
}), u(null));
|
|
551
|
-
}, [e, n]), W = (0, L.useCallback)(async () => {
|
|
552
|
-
if (l) try {
|
|
553
|
-
await _(JSON.stringify({
|
|
554
|
-
id: l.id,
|
|
555
|
-
serverName: l.serverName,
|
|
556
|
-
timestamp: l.timestamp,
|
|
557
|
-
request: l.request
|
|
558
|
-
}, null, 2)), k(!0), setTimeout(() => k(!1), 2e3);
|
|
559
|
-
} catch (e) {
|
|
560
|
-
console.error("[SamplingTab] Failed to copy request:", e);
|
|
561
|
-
}
|
|
562
|
-
}, [l]), G = (0, L.useCallback)(() => {
|
|
563
|
-
if (l) try {
|
|
564
|
-
let e = new globalThis.Blob([JSON.stringify({
|
|
565
|
-
id: l.id,
|
|
566
|
-
serverName: l.serverName,
|
|
567
|
-
timestamp: l.timestamp,
|
|
568
|
-
request: l.request
|
|
569
|
-
}, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
|
|
570
|
-
n.href = t, n.download = `sampling-request-${Date.now()}.json`, document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(t);
|
|
571
|
-
} catch (e) {
|
|
572
|
-
console.error("[SamplingTab] Failed to download request:", e);
|
|
573
|
-
}
|
|
574
|
-
}, [l]), K = (0, L.useCallback)(async () => {
|
|
575
|
-
if (j.current) try {
|
|
576
|
-
document.fullscreenElement ? await document.exitFullscreen() : await j.current.requestFullscreen();
|
|
577
|
-
} catch (e) {
|
|
578
|
-
console.error("[SamplingTab] Failed to toggle fullscreen:", e);
|
|
579
|
-
}
|
|
580
|
-
}, []);
|
|
581
|
-
return i ? /* @__PURE__ */ (0, R.jsxs)(S, {
|
|
582
|
-
orientation: "horizontal",
|
|
583
|
-
className: "h-full",
|
|
584
|
-
children: [
|
|
585
|
-
/* @__PURE__ */ (0, R.jsx)(b, {
|
|
586
|
-
defaultSize: 40,
|
|
587
|
-
minSize: 30,
|
|
588
|
-
children: /* @__PURE__ */ (0, R.jsx)(S, {
|
|
589
|
-
orientation: "vertical",
|
|
590
|
-
className: "h-full border-r dark:border-zinc-700",
|
|
591
|
-
children: /* @__PURE__ */ (0, R.jsx)(b, {
|
|
592
|
-
defaultSize: 75,
|
|
593
|
-
minSize: 30,
|
|
594
|
-
className: "h-full overflow-hidden",
|
|
595
|
-
children: /* @__PURE__ */ (0, R.jsx)(x, {
|
|
596
|
-
scrollRef: A,
|
|
597
|
-
children: (t) => /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(te, {
|
|
598
|
-
isScrolled: t,
|
|
599
|
-
title: "Sampling",
|
|
600
|
-
icon: w,
|
|
601
|
-
count: B.length,
|
|
602
|
-
isSearchExpanded: y,
|
|
603
|
-
searchQuery: d,
|
|
604
|
-
searchPlaceholder: "Search requests...",
|
|
605
|
-
onSearchExpand: () => C(!0),
|
|
606
|
-
onSearchChange: f,
|
|
607
|
-
onSearchBlur: I,
|
|
608
|
-
bulkAction: {
|
|
609
|
-
icon: O,
|
|
610
|
-
label: "Reject all",
|
|
611
|
-
onClick: U,
|
|
612
|
-
disabled: e.length === 0
|
|
613
|
-
},
|
|
614
|
-
searchInputRef: M
|
|
615
|
-
}), /* @__PURE__ */ (0, R.jsx)(z, {
|
|
616
|
-
requests: B,
|
|
617
|
-
selectedRequest: l,
|
|
618
|
-
onRequestSelect: H,
|
|
619
|
-
focusedIndex: p,
|
|
620
|
-
formatRelativeTime: g
|
|
621
|
-
})] })
|
|
622
|
-
})
|
|
623
|
-
})
|
|
624
|
-
})
|
|
625
|
-
}),
|
|
626
|
-
/* @__PURE__ */ (0, R.jsx)(ee, {}),
|
|
627
|
-
/* @__PURE__ */ (0, R.jsx)(b, {
|
|
628
|
-
defaultSize: 60,
|
|
629
|
-
minSize: 40,
|
|
630
|
-
children: /* @__PURE__ */ (0, R.jsx)("div", {
|
|
631
|
-
ref: j,
|
|
632
|
-
className: "h-full bg-white dark:bg-zinc-900",
|
|
633
|
-
children: /* @__PURE__ */ (0, R.jsx)(V, {
|
|
634
|
-
request: l,
|
|
635
|
-
onApprove: t,
|
|
636
|
-
onReject: n,
|
|
637
|
-
onClose: () => u(null),
|
|
638
|
-
previewMode: T,
|
|
639
|
-
onTogglePreview: () => E(!T),
|
|
640
|
-
isCopied: D,
|
|
641
|
-
onCopy: W,
|
|
642
|
-
onDownload: G,
|
|
643
|
-
onFullscreen: K,
|
|
644
|
-
llmConfig: c
|
|
645
|
-
})
|
|
646
|
-
})
|
|
647
|
-
})
|
|
648
|
-
]
|
|
649
|
-
}) : /* @__PURE__ */ (0, R.jsxs)("div", {
|
|
650
|
-
className: "flex flex-col items-center justify-center h-full p-4 text-center",
|
|
651
|
-
children: [/* @__PURE__ */ (0, R.jsx)(w, { className: "h-12 w-12 text-gray-400 dark:text-gray-600 mb-3" }), /* @__PURE__ */ (0, R.jsx)("p", {
|
|
652
|
-
className: "text-gray-500 dark:text-gray-400",
|
|
653
|
-
children: "Not connected to server"
|
|
654
|
-
})]
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
//#endregion
|
|
658
|
-
export { H as SamplingTab };
|