@mcp-use/inspector 20.0.0-beta.4 → 20.0.0-beta.41
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 +74 -1398
- package/dist/client/index.d.ts +1402 -50
- package/dist/client/index.js +165 -24019
- package/dist/server/index.d.ts +79 -7
- package/dist/server/index.js +99 -23
- package/package.json +77 -35
- package/dist/cdn/AnimatePresence-Dcw-FOy8.js +0 -393
- package/dist/cdn/ChatTab-UQAPDRQG.js +0 -6744
- package/dist/cdn/CheckboxIndicator-Bt4IICtv.js +0 -251
- package/dist/cdn/ConnectionSettingsForm-DrY1p-NO.js +0 -929
- package/dist/cdn/ConnectionSettingsTab-B1cRD7hz.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-BoDJE8tP.js +0 -3610
- package/dist/cdn/NotificationsTab-CeImSrhx.js +0 -290
- package/dist/cdn/OAuthCallback-C9AvCkOn.js +0 -58
- package/dist/cdn/PromptsTab-CkAWyWVb.js +0 -901
- package/dist/cdn/ResourcesTab-BtBKxd4c.js +0 -564
- package/dist/cdn/SamplingTab-Czp7Rmhz.js +0 -658
- package/dist/cdn/ServerMetadataTab-CvrKX8fz.js +0 -244
- package/dist/cdn/StatusIcon-D0-ARyOh.js +0 -66
- package/dist/cdn/ToolsTab-Dm4vCB8D.js +0 -2033
- package/dist/cdn/ViewPreview-CZvl_7x-.js +0 -238
- package/dist/cdn/WidgetDebugContext-D4usL_MA.js +0 -324
- package/dist/cdn/WidgetWrapper-DeiogRXV.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-3QLh0dt8.js +0 -2306
- package/dist/cdn/dist-DaMB0Su9.js +0 -616
- 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-CIoYSwCt.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-0oJnFpBS.js +0 -5425
- package/dist/cdn/react-BIs9pQ3H.js +0 -926
- 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-BbhH1Z_E.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-BNpU7Atw.js +0 -235
- package/dist/cdn/useSavedRequests-Ci2I919u.js +0 -51
- package/dist/cdn/useViewHostProps-ru80AnlT.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-5L3HMC5B.js +0 -72
- package/dist/server/chunk-BEJGHVKM.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-PGN3B3MQ.js +0 -156
- package/dist/server/chunk-PKBMQBKP.js +0 -7
- 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/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-B_5S87J1.js +0 -18
- package/dist/web/assets/ConnectionSettingsTab-XwjwKfsO.js +0 -1
- package/dist/web/assets/ElicitationTab-BD1tfmYR.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-DD3qfIC3.js +0 -1
- package/dist/web/assets/MarkdownRenderer-DH-7vpw0.js +0 -47
- package/dist/web/assets/NotificationsTab-Cg48O6IH.js +0 -1
- package/dist/web/assets/OAuthCallback-4i2i3YpE.js +0 -1
- package/dist/web/assets/PromptsTab-pAR6izrQ.js +0 -15
- package/dist/web/assets/ResourcesTab-CgvfWrsU.js +0 -2
- package/dist/web/assets/SamplingTab-DfIWMQFY.js +0 -1
- package/dist/web/assets/ServerMetadataTab-Dsz8Qhyr.js +0 -1
- package/dist/web/assets/ToolsTab-ln9w58BW.js +0 -8
- package/dist/web/assets/ViewPreview-CQ3G3VP0.js +0 -1
- package/dist/web/assets/WidgetWrapper-A-zaxY5s.js +0 -34
- package/dist/web/assets/brush--0LobUi4.js +0 -1
- package/dist/web/assets/checkbox-DZWS_U_i.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-DxRFPg-B.js +0 -21
- package/dist/web/assets/index-CoRK2C3M.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-Dbc2GbRx.js +0 -1
- package/dist/web/assets/sparkles-2OAsc1aP.js +0 -1
- package/dist/web/assets/tabs-subtle-CxMZqhP6.js +0 -1
- package/dist/web/assets/textarea-DLAmNVf_.js +0 -1
- package/dist/web/assets/useConfig-Cg-BtSHA.js +0 -1
- package/dist/web/assets/useViewHostProps-CMgPpdfy.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,2033 +0,0 @@
|
|
|
1
|
-
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import { Pr as n, Rr as r, a as i, cr as a, f as o, n as s, r as c, sr as l, t as u, ur as d } from "./input-C2OBd4PJ.js";
|
|
3
|
-
import { t as f } from "./jsx-runtime-CIxvMpEo.js";
|
|
4
|
-
import { t as p } from "./label-B9Jmm9be.js";
|
|
5
|
-
import { t as m } from "./AnimatePresence-Dcw-FOy8.js";
|
|
6
|
-
import { a as h, i as g, n as _, r as v, t as y } from "./select-DDdiIPR2.js";
|
|
7
|
-
import { t as b } from "./createLucideIcon-C5fZZ6oB.js";
|
|
8
|
-
import { A as x, _ as S, c as C, d as w, g as T, h as E, m as D, n as O, o as k, p as A, r as j, s as M, t as ee, v as N } from "./dialog-BsDpuJd3.js";
|
|
9
|
-
import { n as P, r as F, t as I } from "./WidgetWrapper-DeiogRXV.js";
|
|
10
|
-
import { a as L, i as R, t as z } from "./browser-CbQIH4w2.js";
|
|
11
|
-
import { n as B, t as te } from "./zap-Mb-pbw2X.js";
|
|
12
|
-
import { t as V } from "./code-V_0nf5rg.js";
|
|
13
|
-
import { t as H } from "./JSONDisplay-BFxf5oEu.js";
|
|
14
|
-
import { a as U, i as ne, n as W, o as re, r as G, s as ie } from "./shared-DaILIQPP.js";
|
|
15
|
-
import { t as K } from "./history-Csw4rb44.js";
|
|
16
|
-
import { t as ae } from "./maximize-BALCV_ep.js";
|
|
17
|
-
import { n as oe, t as se } from "./save-Tgil_AJZ.js";
|
|
18
|
-
import { n as ce, t as le } from "./useSavedRequests-Ci2I919u.js";
|
|
19
|
-
import { t as q } from "./play-vuZ5PLnI.js";
|
|
20
|
-
import { t as ue } from "./trash-2-RwpJY5SL.js";
|
|
21
|
-
import { t as de } from "./wrench-DzGmCfnb.js";
|
|
22
|
-
import { t as fe } from "./x-C3vRQIYu.js";
|
|
23
|
-
import { t as J } from "./switch-C3IyQuid.js";
|
|
24
|
-
import { t as pe } from "./not-found-DEtSM_Wd.js";
|
|
25
|
-
import { _ as me, t as he, v as ge } from "./telemetry-BbhH1Z_E.js";
|
|
26
|
-
import { c as _e, o as ve, r as ye } from "./react-0oJnFpBS.js";
|
|
27
|
-
import { n as be } from "./dist-DaMB0Su9.js";
|
|
28
|
-
import { t as Y } from "./spinner-jQtC7EBj.js";
|
|
29
|
-
import { n as xe } from "./InspectorContext-UjtEbNod.js";
|
|
30
|
-
import { t as Se } from "./textarea-DSbwcFVt.js";
|
|
31
|
-
import { t as Ce } from "./useViewHostProps-ru80AnlT.js";
|
|
32
|
-
import { t as we } from "./ListTabHeader-Cv-GmtGF.js";
|
|
33
|
-
var Te = b("chevron-up", [["path", {
|
|
34
|
-
d: "m18 15-6-6-6 6",
|
|
35
|
-
key: "153udz"
|
|
36
|
-
}]]), X = /* @__PURE__ */ e(t(), 1), Z = f();
|
|
37
|
-
function Ee({ savedRequests: e, selectedRequest: t, onLoadRequest: n, onDeleteRequest: r, focusedIndex: a }) {
|
|
38
|
-
if (e.length === 0) return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
39
|
-
className: "flex flex-1 flex-col items-center justify-center p-4 text-center",
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ (0, Z.jsx)(F, { className: "h-12 w-12 text-gray-400 dark:text-gray-600 mb-3" }),
|
|
42
|
-
/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
43
|
-
className: "text-gray-500 dark:text-gray-400 mb-2",
|
|
44
|
-
children: "No saved requests yet"
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
47
|
-
className: "text-xs text-gray-400 dark:text-gray-500",
|
|
48
|
-
children: "Execute a tool and click Save to store requests"
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
let o = (e, t) => {
|
|
53
|
-
e.stopPropagation(), t();
|
|
54
|
-
};
|
|
55
|
-
return /* @__PURE__ */ (0, Z.jsx)("div", { children: e.map((e, u) => /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
56
|
-
className: "relative group",
|
|
57
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(G, {
|
|
58
|
-
id: `saved-${e.id}`,
|
|
59
|
-
isSelected: t?.id === e.id,
|
|
60
|
-
isFocused: a === u,
|
|
61
|
-
title: e.name,
|
|
62
|
-
description: e.toolName,
|
|
63
|
-
metadata: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
64
|
-
className: "flex flex-col gap-1",
|
|
65
|
-
children: /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
66
|
-
className: "text-xs text-gray-400 dark:text-gray-500",
|
|
67
|
-
children: new Date(e.savedAt).toLocaleString()
|
|
68
|
-
})
|
|
69
|
-
}),
|
|
70
|
-
onClick: () => n(e)
|
|
71
|
-
}), /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
72
|
-
className: "absolute top-1/2 right-2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity z-10",
|
|
73
|
-
children: /* @__PURE__ */ (0, Z.jsxs)(s, { children: [/* @__PURE__ */ (0, Z.jsx)(i, {
|
|
74
|
-
render: /* @__PURE__ */ (0, Z.jsx)(l, {
|
|
75
|
-
variant: "secondary",
|
|
76
|
-
size: "sm",
|
|
77
|
-
onClick: (t) => o(t, () => r(e.id)),
|
|
78
|
-
className: "h-8 w-8 p-0",
|
|
79
|
-
children: /* @__PURE__ */ (0, Z.jsx)(ue, { className: "h-4 w-4" })
|
|
80
|
-
}),
|
|
81
|
-
nativeButton: !0
|
|
82
|
-
}), /* @__PURE__ */ (0, Z.jsx)(c, { children: /* @__PURE__ */ (0, Z.jsx)("p", { children: "Delete saved request" }) })] })
|
|
83
|
-
})]
|
|
84
|
-
}, e.id)) });
|
|
85
|
-
}
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/client/components/tools/SaveRequestDialog.tsx
|
|
88
|
-
function De({ isOpen: e, requestName: t, defaultPlaceholder: n, onRequestNameChange: r, onSave: i, onCancel: a }) {
|
|
89
|
-
return e ? /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
90
|
-
className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50",
|
|
91
|
-
onClick: a,
|
|
92
|
-
children: /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
93
|
-
className: "bg-white dark:bg-zinc-800 rounded-lg p-6 w-[400px] shadow-xl border border-gray-200 dark:border-zinc-700",
|
|
94
|
-
onClick: (e) => e.stopPropagation(),
|
|
95
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("h3", {
|
|
96
|
-
className: "text-lg font-semibold mb-4 text-gray-900 dark:text-gray-100",
|
|
97
|
-
children: "Save Request"
|
|
98
|
-
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
99
|
-
className: "space-y-4",
|
|
100
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", { children: [/* @__PURE__ */ (0, Z.jsx)(p, {
|
|
101
|
-
htmlFor: "request-name",
|
|
102
|
-
children: "Request Name (optional)"
|
|
103
|
-
}), /* @__PURE__ */ (0, Z.jsx)(u, {
|
|
104
|
-
id: "request-name",
|
|
105
|
-
value: t,
|
|
106
|
-
onChange: (e) => r(e.target.value),
|
|
107
|
-
placeholder: n,
|
|
108
|
-
className: "mt-2",
|
|
109
|
-
onKeyDown: (e) => {
|
|
110
|
-
e.key === "Enter" && i();
|
|
111
|
-
},
|
|
112
|
-
autoFocus: !0
|
|
113
|
-
})] }), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
114
|
-
className: "flex justify-end gap-2",
|
|
115
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(l, {
|
|
116
|
-
variant: "outline",
|
|
117
|
-
onClick: a,
|
|
118
|
-
children: "Cancel"
|
|
119
|
-
}), /* @__PURE__ */ (0, Z.jsxs)(l, {
|
|
120
|
-
onClick: i,
|
|
121
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(se, { className: "h-4 w-4 mr-2" }), "Save"]
|
|
122
|
-
})]
|
|
123
|
-
})]
|
|
124
|
-
})]
|
|
125
|
-
})
|
|
126
|
-
}) : null;
|
|
127
|
-
}
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region src/client/components/tools/schema-utils.ts
|
|
130
|
-
function Oe(e, t) {
|
|
131
|
-
if (!e?.$ref) return e;
|
|
132
|
-
let n = e.$ref;
|
|
133
|
-
if (!n.startsWith("#/")) return e;
|
|
134
|
-
let r = n.substring(2).split("/"), i = t;
|
|
135
|
-
for (let t of r) if (i && typeof i == "object" && t in i) i = i[t];
|
|
136
|
-
else return e;
|
|
137
|
-
return i;
|
|
138
|
-
}
|
|
139
|
-
function Q(e, t) {
|
|
140
|
-
if (e?.anyOf && Array.isArray(e.anyOf)) {
|
|
141
|
-
let n = e.anyOf.find((e) => Oe(e, t)?.type !== "null");
|
|
142
|
-
if (n) return {
|
|
143
|
-
...Oe(n, t),
|
|
144
|
-
nullable: !0
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
return e;
|
|
148
|
-
}
|
|
149
|
-
function $(e, t) {
|
|
150
|
-
let n = Q(e || {}, t);
|
|
151
|
-
return n = Oe(n, t), n;
|
|
152
|
-
}
|
|
153
|
-
function ke(e, t) {
|
|
154
|
-
let n = $(e, t);
|
|
155
|
-
if (typeof n.type == "string") return n.type;
|
|
156
|
-
if (Array.isArray(n.type)) {
|
|
157
|
-
let e = n.type.find((e) => e !== "null");
|
|
158
|
-
return typeof e == "string" ? e : void 0;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function Ae(e) {
|
|
162
|
-
let t = e?.enum;
|
|
163
|
-
return Array.isArray(t) && t.every((e) => typeof e == "string") ? t : null;
|
|
164
|
-
}
|
|
165
|
-
function je(e) {
|
|
166
|
-
let t = e.trim().toLowerCase();
|
|
167
|
-
return [
|
|
168
|
-
"true",
|
|
169
|
-
"1",
|
|
170
|
-
"yes",
|
|
171
|
-
"on"
|
|
172
|
-
].includes(t) ? !0 : [
|
|
173
|
-
"false",
|
|
174
|
-
"0",
|
|
175
|
-
"no",
|
|
176
|
-
"off"
|
|
177
|
-
].includes(t) ? !1 : e;
|
|
178
|
-
}
|
|
179
|
-
function Me(e, t) {
|
|
180
|
-
if (t === "number" || t === "integer") {
|
|
181
|
-
let t = e.trim();
|
|
182
|
-
if (!t) return e;
|
|
183
|
-
let n = Number(t);
|
|
184
|
-
return Number.isFinite(n) ? n : e;
|
|
185
|
-
}
|
|
186
|
-
return t === "boolean" ? je(e) : e;
|
|
187
|
-
}
|
|
188
|
-
function Ne(e, t) {
|
|
189
|
-
if (e === void 0) return e;
|
|
190
|
-
if (t === "object" || t === "array") {
|
|
191
|
-
if (typeof e == "string") try {
|
|
192
|
-
return JSON.parse(e);
|
|
193
|
-
} catch {
|
|
194
|
-
return e;
|
|
195
|
-
}
|
|
196
|
-
return e;
|
|
197
|
-
}
|
|
198
|
-
if (t === "number" || t === "integer") {
|
|
199
|
-
if (typeof e == "number") return e;
|
|
200
|
-
if (typeof e == "string") {
|
|
201
|
-
let t = e.trim();
|
|
202
|
-
if (!t) return e;
|
|
203
|
-
let n = Number(t);
|
|
204
|
-
return Number.isFinite(n) ? n : e;
|
|
205
|
-
}
|
|
206
|
-
return e;
|
|
207
|
-
}
|
|
208
|
-
return t === "boolean" ? typeof e == "boolean" ? e : typeof e == "string" ? je(e) : e : e;
|
|
209
|
-
}
|
|
210
|
-
function Pe(e) {
|
|
211
|
-
let t = "", n = 0, r = !1, i = !1;
|
|
212
|
-
for (; n < e.length;) {
|
|
213
|
-
let a = e[n];
|
|
214
|
-
if (i) {
|
|
215
|
-
t += a, i = !1, n++;
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
if (a === "\\") {
|
|
219
|
-
i = !0, t += a, n++;
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
if (a === "`") {
|
|
223
|
-
r ? (t += "\"", r = !1) : (t += "\"", r = !0), n++;
|
|
224
|
-
continue;
|
|
225
|
-
}
|
|
226
|
-
if (r && a === "\"") {
|
|
227
|
-
t += "\\\"", n++;
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
t += a, n++;
|
|
231
|
-
}
|
|
232
|
-
return t;
|
|
233
|
-
}
|
|
234
|
-
function Fe(e) {
|
|
235
|
-
if (!e || typeof e != "string") return null;
|
|
236
|
-
let t = e.trim();
|
|
237
|
-
if (!t.startsWith("{")) return null;
|
|
238
|
-
try {
|
|
239
|
-
let e = JSON.parse(t);
|
|
240
|
-
if (e && typeof e == "object" && !Array.isArray(e)) return e;
|
|
241
|
-
} catch {
|
|
242
|
-
try {
|
|
243
|
-
let e = Pe(t), n = JSON.parse(e);
|
|
244
|
-
if (n && typeof n == "object" && !Array.isArray(n)) return n;
|
|
245
|
-
} catch {
|
|
246
|
-
return null;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return null;
|
|
250
|
-
}
|
|
251
|
-
//#endregion
|
|
252
|
-
//#region src/client/components/tools/ToolInputForm.tsx
|
|
253
|
-
function Ie({ selectedTool: e, toolArgs: t, onArgChange: n, onBulkPaste: r, autoFilledFields: i, setFields: a, sendEmptyFields: o, onToggleEmpty: s }) {
|
|
254
|
-
let c = e?.inputSchema?.properties || {}, l = e?.inputSchema?.required || [], d = Object.keys(c).length > 0, f = async (e, t) => {
|
|
255
|
-
r && await r(e.clipboardData.getData("text"), t) && e.preventDefault();
|
|
256
|
-
};
|
|
257
|
-
return d ? /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
258
|
-
className: "space-y-4",
|
|
259
|
-
children: Object.entries(c).map(([r, c]) => {
|
|
260
|
-
let d = $(c, e?.inputSchema || {}), m = Ae(d), b = d.type === "string" && m !== null, x = d, S = l.includes(r), C = t[r], w = "";
|
|
261
|
-
C != null && (w = typeof C == "string" ? C : typeof C == "object" && C ? JSON.stringify(C, null, 2) : String(C));
|
|
262
|
-
let T = x.type === "object" || x.type === "array", E = T ? x.type === "array" ? "array" : "object" : "string", D = a?.has(r) ?? !0, O = s && (x.type === "string" || T);
|
|
263
|
-
return T ? /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
264
|
-
className: "space-y-2",
|
|
265
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
266
|
-
className: "flex items-start justify-between gap-2",
|
|
267
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
268
|
-
className: "min-w-0 flex-1",
|
|
269
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)(p, {
|
|
270
|
-
htmlFor: r,
|
|
271
|
-
className: "text-sm font-medium",
|
|
272
|
-
children: [r, S && /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
273
|
-
className: "text-red-500 ml-1",
|
|
274
|
-
children: "*"
|
|
275
|
-
})]
|
|
276
|
-
}), x?.description && /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
277
|
-
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
|
|
278
|
-
children: x.description
|
|
279
|
-
})]
|
|
280
|
-
}), O && s && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
281
|
-
className: "flex items-center gap-2 shrink-0",
|
|
282
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
283
|
-
className: "text-xs text-muted-foreground whitespace-nowrap",
|
|
284
|
-
children: E === "array" ? "Send empty array explicitly" : "Send empty object explicitly"
|
|
285
|
-
}), /* @__PURE__ */ (0, Z.jsx)(J, {
|
|
286
|
-
checked: o?.has(r) ?? !1,
|
|
287
|
-
onCheckedChange: (e) => s(r, E, e),
|
|
288
|
-
"aria-label": E === "array" ? "Send empty array" : "Send empty object",
|
|
289
|
-
title: E === "array" ? "Send empty array []" : "Send empty object {}"
|
|
290
|
-
})]
|
|
291
|
-
})]
|
|
292
|
-
}), /* @__PURE__ */ (0, Z.jsx)(Se, {
|
|
293
|
-
id: r,
|
|
294
|
-
"data-testid": `tool-param-${r}`,
|
|
295
|
-
value: w,
|
|
296
|
-
onChange: (e) => n(r, e.target.value),
|
|
297
|
-
onPaste: (e) => f(e, r),
|
|
298
|
-
placeholder: `Enter ${r}`,
|
|
299
|
-
disabled: o?.has(r) ?? !1,
|
|
300
|
-
className: `min-h-[100px] ${D ? "" : "opacity-70"} ${i?.has(r) ? "animate-pulse ring-2 ring-green-500 dark:ring-green-400" : ""}`
|
|
301
|
-
})]
|
|
302
|
-
}, r) : b && m ? /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
303
|
-
className: "space-y-2",
|
|
304
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", { children: [/* @__PURE__ */ (0, Z.jsxs)(p, {
|
|
305
|
-
htmlFor: r,
|
|
306
|
-
className: "text-sm font-medium",
|
|
307
|
-
children: [r, S && /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
308
|
-
className: "text-red-500 ml-1",
|
|
309
|
-
children: "*"
|
|
310
|
-
})]
|
|
311
|
-
}), x.description && /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
312
|
-
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
|
|
313
|
-
children: x.description
|
|
314
|
-
})] }), /* @__PURE__ */ (0, Z.jsxs)(y, {
|
|
315
|
-
value: String(t[r] || ""),
|
|
316
|
-
onValueChange: (e) => n(r, e),
|
|
317
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(g, {
|
|
318
|
-
id: r,
|
|
319
|
-
className: `w-full ${D ? "" : "opacity-70"}`,
|
|
320
|
-
"data-testid": `tool-param-${r}`,
|
|
321
|
-
children: /* @__PURE__ */ (0, Z.jsx)(h, { placeholder: "Select an option" })
|
|
322
|
-
}), /* @__PURE__ */ (0, Z.jsx)(_, { children: m.map((e, t) => /* @__PURE__ */ (0, Z.jsx)(v, {
|
|
323
|
-
value: e,
|
|
324
|
-
children: x.enumNames?.[t] || e
|
|
325
|
-
}, e)) })]
|
|
326
|
-
})]
|
|
327
|
-
}, r) : /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
328
|
-
className: "space-y-2",
|
|
329
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
330
|
-
className: "flex items-start justify-between gap-2",
|
|
331
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
332
|
-
className: "min-w-0 flex-1",
|
|
333
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)(p, {
|
|
334
|
-
htmlFor: r,
|
|
335
|
-
className: "text-sm font-medium",
|
|
336
|
-
children: [r, S && /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
337
|
-
className: "text-red-500 ml-1",
|
|
338
|
-
children: "*"
|
|
339
|
-
})]
|
|
340
|
-
}), x?.description && /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
341
|
-
className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
|
|
342
|
-
children: x.description
|
|
343
|
-
})]
|
|
344
|
-
}), O && s && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
345
|
-
className: "flex items-center gap-2 shrink-0",
|
|
346
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
347
|
-
className: "text-xs text-muted-foreground whitespace-nowrap",
|
|
348
|
-
children: "Send empty string"
|
|
349
|
-
}), /* @__PURE__ */ (0, Z.jsx)(J, {
|
|
350
|
-
checked: o?.has(r) ?? !1,
|
|
351
|
-
onCheckedChange: (e) => s(r, "string", e),
|
|
352
|
-
"aria-label": "Send empty string",
|
|
353
|
-
title: "Send empty string"
|
|
354
|
-
})]
|
|
355
|
-
})]
|
|
356
|
-
}), /* @__PURE__ */ (0, Z.jsx)(u, {
|
|
357
|
-
id: r,
|
|
358
|
-
"data-testid": `tool-param-${r}`,
|
|
359
|
-
value: w,
|
|
360
|
-
onChange: (e) => n(r, e.target.value),
|
|
361
|
-
onPaste: (e) => f(e, r),
|
|
362
|
-
placeholder: `Enter ${r}`,
|
|
363
|
-
disabled: o?.has(r) ?? !1,
|
|
364
|
-
className: `${D ? "" : "opacity-70"} ${i?.has(r) ? "animate-pulse ring-2 ring-green-500 dark:ring-green-400" : ""}`
|
|
365
|
-
})]
|
|
366
|
-
}, r);
|
|
367
|
-
})
|
|
368
|
-
}) : /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
369
|
-
className: "flex items-center justify-center h-32 text-gray-500 dark:text-gray-400 text-sm",
|
|
370
|
-
children: "No parameters required"
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
//#endregion
|
|
374
|
-
//#region src/client/components/tools/ToolExecutionPanel.tsx
|
|
375
|
-
function Le({ selectedTool: e, toolArgs: t, payloadToSend: n, isExecuting: o, isConnected: u, onArgChange: f, onExecute: p, onSave: m, onCancel: h, onBulkPaste: g, autoFilledFields: _, setFields: v, sendEmptyFields: y, onToggleEmpty: b }) {
|
|
376
|
-
let S = "hidden @[700px]/tool-exec:inline", w = "hidden @[700px]/tool-exec:inline shrink-0 text-[10px] leading-none border border-current/30 p-1 rounded-full", T = "max-[699px]/tool-exec:size-8 max-[699px]/tool-exec:min-w-8 max-[699px]/tool-exec:shrink-0 max-[699px]/tool-exec:gap-0 max-[699px]/tool-exec:rounded-full max-[699px]/tool-exec:px-0 max-[699px]/tool-exec:py-0", E = "max-[699px]/tool-exec:!pr-0", [D, A] = (0, X.useState)(!1), [N, P] = (0, X.useState)(!1), [F, I] = (0, X.useState)(!1), [B, te] = (0, X.useState)(!1), [U, ne] = (0, X.useState)(!1), W = (0, X.useRef)(null);
|
|
377
|
-
return (0, X.useEffect)(() => {
|
|
378
|
-
if (W.current && e?.description) {
|
|
379
|
-
let e = W.current, t = parseFloat(getComputedStyle(e).lineHeight), n = e.scrollHeight;
|
|
380
|
-
ne(Math.round(n / t) > 3), te(!1);
|
|
381
|
-
}
|
|
382
|
-
}, [e?.description]), (0, X.useEffect)(() => {
|
|
383
|
-
let t = (t) => {
|
|
384
|
-
(t.metaKey || t.ctrlKey) && t.key === "Enter" && e && !o && u && (t.preventDefault(), p()), t.key === "Escape" && o && h && (t.preventDefault(), h());
|
|
385
|
-
};
|
|
386
|
-
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
387
|
-
}, [
|
|
388
|
-
e,
|
|
389
|
-
o,
|
|
390
|
-
u,
|
|
391
|
-
p,
|
|
392
|
-
h
|
|
393
|
-
]), e ? /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
394
|
-
className: "flex flex-col h-full @container/tool-exec",
|
|
395
|
-
children: [
|
|
396
|
-
/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
397
|
-
className: "shrink-0 p-3 sm:p-5 pt-3 sm:pt-4 pb-2 sm:pb-2 sm:pr-4",
|
|
398
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", { children: /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
399
|
-
className: "flex flex-row items-center justify-between mb-0 gap-2",
|
|
400
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("h3", {
|
|
401
|
-
className: "text-base sm:text-lg font-semibold",
|
|
402
|
-
"data-testid": "tool-execution-title",
|
|
403
|
-
children: e.name
|
|
404
|
-
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
405
|
-
className: "flex gap-2 shrink-0",
|
|
406
|
-
children: [
|
|
407
|
-
/* @__PURE__ */ (0, Z.jsxs)(s, { children: [/* @__PURE__ */ (0, Z.jsx)(i, {
|
|
408
|
-
render: /* @__PURE__ */ (0, Z.jsxs)(l, {
|
|
409
|
-
"data-testid": "tool-execution-metadata-button",
|
|
410
|
-
variant: N ? "default" : "outline",
|
|
411
|
-
onClick: () => P(!N),
|
|
412
|
-
disabled: o,
|
|
413
|
-
size: "sm",
|
|
414
|
-
className: r(d, T),
|
|
415
|
-
title: "View tool metadata",
|
|
416
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(V, {}), /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
417
|
-
className: S,
|
|
418
|
-
children: "Metadata"
|
|
419
|
-
})]
|
|
420
|
-
}),
|
|
421
|
-
nativeButton: !0
|
|
422
|
-
}), /* @__PURE__ */ (0, Z.jsx)(c, { children: /* @__PURE__ */ (0, Z.jsx)("p", { children: "View tool definition metadata" }) })] }),
|
|
423
|
-
/* @__PURE__ */ (0, Z.jsxs)(s, { children: [/* @__PURE__ */ (0, Z.jsx)(i, {
|
|
424
|
-
render: /* @__PURE__ */ (0, Z.jsxs)(l, {
|
|
425
|
-
"data-testid": "tool-execution-copy-payload-button",
|
|
426
|
-
variant: "outline",
|
|
427
|
-
onClick: async () => {
|
|
428
|
-
if (e) try {
|
|
429
|
-
await z(JSON.stringify(n ?? t, null, 2)), I(!0), setTimeout(() => I(!1), 2e3);
|
|
430
|
-
} catch {}
|
|
431
|
-
},
|
|
432
|
-
disabled: o,
|
|
433
|
-
size: "sm",
|
|
434
|
-
className: r(d, T),
|
|
435
|
-
title: "Copy payload as JSON",
|
|
436
|
-
children: [F ? /* @__PURE__ */ (0, Z.jsx)(L, { className: "text-green-600" }) : /* @__PURE__ */ (0, Z.jsx)(R, {}), /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
437
|
-
className: S,
|
|
438
|
-
children: F ? "Copied!" : "Payload"
|
|
439
|
-
})]
|
|
440
|
-
}),
|
|
441
|
-
nativeButton: !0
|
|
442
|
-
}), /* @__PURE__ */ (0, Z.jsx)(c, { children: /* @__PURE__ */ (0, Z.jsx)("p", { children: "Copy payload as JSON" }) })] }),
|
|
443
|
-
/* @__PURE__ */ (0, Z.jsxs)(s, { children: [/* @__PURE__ */ (0, Z.jsx)(i, {
|
|
444
|
-
render: /* @__PURE__ */ (0, Z.jsxs)(l, {
|
|
445
|
-
"data-testid": "tool-execution-save-button",
|
|
446
|
-
variant: "outline",
|
|
447
|
-
onClick: m,
|
|
448
|
-
disabled: o,
|
|
449
|
-
size: "sm",
|
|
450
|
-
className: r(d, T),
|
|
451
|
-
title: "Save request",
|
|
452
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(se, {}), /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
453
|
-
className: S,
|
|
454
|
-
children: "Save"
|
|
455
|
-
})]
|
|
456
|
-
}),
|
|
457
|
-
nativeButton: !0
|
|
458
|
-
}), /* @__PURE__ */ (0, Z.jsx)(c, { children: /* @__PURE__ */ (0, Z.jsx)("p", { children: "Save request" }) })] }),
|
|
459
|
-
o && h ? /* @__PURE__ */ (0, Z.jsxs)(s, {
|
|
460
|
-
open: D ? void 0 : !1,
|
|
461
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(i, {
|
|
462
|
-
render: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
463
|
-
onMouseEnter: () => A(!0),
|
|
464
|
-
onMouseLeave: () => A(!1),
|
|
465
|
-
className: "relative",
|
|
466
|
-
children: /* @__PURE__ */ (0, Z.jsx)(l, {
|
|
467
|
-
"data-testid": "tool-execution-cancel-button",
|
|
468
|
-
onClick: h,
|
|
469
|
-
variant: D ? "destructive" : "default",
|
|
470
|
-
size: "sm",
|
|
471
|
-
className: r(a, T, E, "transition-all"),
|
|
472
|
-
children: D ? /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [
|
|
473
|
-
/* @__PURE__ */ (0, Z.jsx)(fe, {}),
|
|
474
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
475
|
-
className: S,
|
|
476
|
-
children: "Cancel"
|
|
477
|
-
}),
|
|
478
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
479
|
-
className: w,
|
|
480
|
-
children: "Esc"
|
|
481
|
-
})
|
|
482
|
-
] }) : /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(Y, {}), /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
483
|
-
className: S,
|
|
484
|
-
children: "Executing..."
|
|
485
|
-
})] })
|
|
486
|
-
})
|
|
487
|
-
}),
|
|
488
|
-
nativeButton: !1
|
|
489
|
-
}), /* @__PURE__ */ (0, Z.jsx)(c, { children: /* @__PURE__ */ (0, Z.jsx)("p", { children: "Hover to cancel (or press Esc)" }) })]
|
|
490
|
-
}) : /* @__PURE__ */ (0, Z.jsx)(l, {
|
|
491
|
-
"data-testid": "tool-execution-execute-button",
|
|
492
|
-
onClick: p,
|
|
493
|
-
disabled: o || !u,
|
|
494
|
-
size: "sm",
|
|
495
|
-
className: r(a, T, E),
|
|
496
|
-
children: o ? /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(Y, {}), /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
497
|
-
className: S,
|
|
498
|
-
children: "Executing..."
|
|
499
|
-
})] }) : /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [
|
|
500
|
-
/* @__PURE__ */ (0, Z.jsx)(q, {}),
|
|
501
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
502
|
-
className: S,
|
|
503
|
-
children: "Execute"
|
|
504
|
-
}),
|
|
505
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
506
|
-
className: w,
|
|
507
|
-
children: "⌘↵"
|
|
508
|
-
})
|
|
509
|
-
] })
|
|
510
|
-
})
|
|
511
|
-
]
|
|
512
|
-
})]
|
|
513
|
-
}) })
|
|
514
|
-
}),
|
|
515
|
-
/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
516
|
-
className: "flex-1 overflow-y-auto px-3 sm:px-5 pb-4 pr-3",
|
|
517
|
-
children: [e.description && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
518
|
-
className: "relative mb-6",
|
|
519
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
520
|
-
className: "relative",
|
|
521
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
522
|
-
ref: W,
|
|
523
|
-
"data-testid": "tool-execution-description",
|
|
524
|
-
className: `text-sm text-gray-600 dark:text-gray-400 leading-relaxed transition-all duration-300 ${!B && U ? "line-clamp-3" : ""}`,
|
|
525
|
-
children: e.description
|
|
526
|
-
}), U && !B && /* @__PURE__ */ (0, Z.jsx)("div", { className: "absolute bottom-0 left-0 right-0 h-[1.4em] bg-linear-to-t from-white/95 dark:from-black/95 via-white/55 dark:via-black/55 to-transparent pointer-events-none" })]
|
|
527
|
-
}), U && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
528
|
-
className: "flex justify-end",
|
|
529
|
-
children: /* @__PURE__ */ (0, Z.jsx)("button", {
|
|
530
|
-
onClick: () => te(!B),
|
|
531
|
-
className: "relative z-10 inline-flex items-center gap-1 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 mt-1 transition-colors",
|
|
532
|
-
children: B ? /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: ["Show less", /* @__PURE__ */ (0, Z.jsx)(Te, { className: "h-3 w-3" })] }) : /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: ["Show more", /* @__PURE__ */ (0, Z.jsx)(x, { className: "h-3 w-3" })] })
|
|
533
|
-
})
|
|
534
|
-
})]
|
|
535
|
-
}), /* @__PURE__ */ (0, Z.jsx)(Ie, {
|
|
536
|
-
selectedTool: e,
|
|
537
|
-
toolArgs: t,
|
|
538
|
-
onArgChange: f,
|
|
539
|
-
onBulkPaste: g,
|
|
540
|
-
autoFilledFields: _,
|
|
541
|
-
setFields: v,
|
|
542
|
-
sendEmptyFields: y,
|
|
543
|
-
onToggleEmpty: b
|
|
544
|
-
})]
|
|
545
|
-
}),
|
|
546
|
-
/* @__PURE__ */ (0, Z.jsx)(ee, {
|
|
547
|
-
open: N,
|
|
548
|
-
onOpenChange: P,
|
|
549
|
-
children: /* @__PURE__ */ (0, Z.jsxs)(j, {
|
|
550
|
-
scrollable: !0,
|
|
551
|
-
className: "max-w-3xl max-h-[80vh]",
|
|
552
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(k, {
|
|
553
|
-
sticky: !0,
|
|
554
|
-
children: /* @__PURE__ */ (0, Z.jsx)(C, { children: "Tool Definition" })
|
|
555
|
-
}), /* @__PURE__ */ (0, Z.jsx)(O, { children: /* @__PURE__ */ (0, Z.jsx)(M, {
|
|
556
|
-
onCopy: async () => {
|
|
557
|
-
e && await z(JSON.stringify(e, null, 2));
|
|
558
|
-
},
|
|
559
|
-
children: /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
560
|
-
data: e,
|
|
561
|
-
filename: `tool-definition-${e.name}-${Date.now()}.json`
|
|
562
|
-
})
|
|
563
|
-
}) })]
|
|
564
|
-
})
|
|
565
|
-
})
|
|
566
|
-
]
|
|
567
|
-
}) : /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
568
|
-
className: "flex flex-col items-center justify-center h-full p-4 text-center",
|
|
569
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
570
|
-
className: "text-gray-500 dark:text-gray-400 mb-2",
|
|
571
|
-
children: "Select a tool to get started"
|
|
572
|
-
}), /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
573
|
-
className: "text-xs text-gray-400 dark:text-gray-500",
|
|
574
|
-
children: "Choose a tool from the list to view its details and execute it"
|
|
575
|
-
})]
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
//#endregion
|
|
579
|
-
//#region src/client/components/tools/ToolResultDisplay.tsx
|
|
580
|
-
function Re({ timestamp: e }) {
|
|
581
|
-
let [t, n] = (0, X.useState)(() => ze(e));
|
|
582
|
-
return (0, X.useEffect)(() => {
|
|
583
|
-
let t = () => n(ze(e));
|
|
584
|
-
t();
|
|
585
|
-
let r = setInterval(t, 1e3);
|
|
586
|
-
return () => clearInterval(r);
|
|
587
|
-
}, [e]), /* @__PURE__ */ (0, Z.jsx)("span", { children: t });
|
|
588
|
-
}
|
|
589
|
-
function ze(e) {
|
|
590
|
-
let t = Date.now() - e, n = Math.floor(t / 1e3), r = Math.floor(n / 60), i = Math.floor(r / 60), a = Math.floor(i / 24);
|
|
591
|
-
return n < 10 ? "now" : n < 60 ? `${n}s ago` : r < 60 ? `${r}m ago` : i < 24 ? `${i}h ago` : `${a}d ago`;
|
|
592
|
-
}
|
|
593
|
-
function Be(e) {
|
|
594
|
-
if (!e?.isError) return null;
|
|
595
|
-
let t = e.content;
|
|
596
|
-
if (Array.isArray(t)) {
|
|
597
|
-
let e = t.filter((e) => e.type === "text").map((e) => e.text).filter(Boolean);
|
|
598
|
-
if (e.length > 0) return e.join("\n");
|
|
599
|
-
}
|
|
600
|
-
return "An error occurred";
|
|
601
|
-
}
|
|
602
|
-
function Ve(e) {
|
|
603
|
-
try {
|
|
604
|
-
return JSON.parse(e), !0;
|
|
605
|
-
} catch {
|
|
606
|
-
return !1;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
function He({ content: e }) {
|
|
610
|
-
let [t, n] = (0, X.useState)(/* @__PURE__ */ new Set()), r = (0, X.useCallback)((e) => {
|
|
611
|
-
n((t) => {
|
|
612
|
-
let n = new Set(t);
|
|
613
|
-
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
614
|
-
});
|
|
615
|
-
}, []);
|
|
616
|
-
return !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
617
|
-
className: "text-sm text-gray-500 dark:text-gray-400",
|
|
618
|
-
children: "No content"
|
|
619
|
-
}) : /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
620
|
-
className: "space-y-4",
|
|
621
|
-
children: e.map((e, n) => {
|
|
622
|
-
if (e.type === "text") {
|
|
623
|
-
let i = e.text || "", a = t.has(n), o = Ve(i), s = o ? (() => {
|
|
624
|
-
try {
|
|
625
|
-
return JSON.parse(i);
|
|
626
|
-
} catch {
|
|
627
|
-
return null;
|
|
628
|
-
}
|
|
629
|
-
})() : null;
|
|
630
|
-
return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
631
|
-
className: "space-y-2",
|
|
632
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
633
|
-
className: "flex items-center justify-between gap-2",
|
|
634
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
635
|
-
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
636
|
-
children: ["Text Content", a ? " (formatted)" : ""]
|
|
637
|
-
}), o && /* @__PURE__ */ (0, Z.jsx)("button", {
|
|
638
|
-
type: "button",
|
|
639
|
-
onClick: () => r(n),
|
|
640
|
-
className: "text-xs text-blue-600 dark:text-blue-400 hover:underline",
|
|
641
|
-
"data-testid": `tool-result-format-toggle-${n}`,
|
|
642
|
-
children: a ? "Show as text" : "Try to format"
|
|
643
|
-
})]
|
|
644
|
-
}), a && s !== null ? /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
645
|
-
data: s,
|
|
646
|
-
filename: `content-${n}.json`
|
|
647
|
-
}) : /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
648
|
-
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3 font-mono text-sm whitespace-pre-wrap break-words",
|
|
649
|
-
"data-testid": "tool-execution-results-text-content",
|
|
650
|
-
children: i
|
|
651
|
-
})]
|
|
652
|
-
}, n);
|
|
653
|
-
}
|
|
654
|
-
if (e.type === "image") return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
655
|
-
className: "space-y-2",
|
|
656
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
657
|
-
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
658
|
-
children: "Image Content"
|
|
659
|
-
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
660
|
-
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3",
|
|
661
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("img", {
|
|
662
|
-
src: `data:${e.mimeType || "image/png"};base64,${e.data}`,
|
|
663
|
-
alt: "Result",
|
|
664
|
-
className: "max-w-full rounded",
|
|
665
|
-
"data-testid": "tool-execution-results-image-content"
|
|
666
|
-
}), e.annotations && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
667
|
-
className: "mt-2 text-xs text-gray-500 dark:text-gray-400",
|
|
668
|
-
children: /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
669
|
-
data: e.annotations,
|
|
670
|
-
filename: `image-annotations-${n}.json`,
|
|
671
|
-
"data-testid": "tool-execution-results-image-annotations"
|
|
672
|
-
})
|
|
673
|
-
})]
|
|
674
|
-
})]
|
|
675
|
-
}, n);
|
|
676
|
-
if (e.type === "audio") return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
677
|
-
className: "space-y-2",
|
|
678
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
679
|
-
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
680
|
-
children: "Audio Content"
|
|
681
|
-
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
682
|
-
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3",
|
|
683
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("audio", {
|
|
684
|
-
controls: !0,
|
|
685
|
-
src: `data:${e.mimeType || "audio/wav"};base64,${e.data}`,
|
|
686
|
-
className: "w-full",
|
|
687
|
-
"data-testid": "tool-execution-results-audio-content"
|
|
688
|
-
}), e.annotations && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
689
|
-
className: "mt-2 text-xs text-gray-500 dark:text-gray-400",
|
|
690
|
-
children: /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
691
|
-
data: e.annotations,
|
|
692
|
-
filename: `audio-annotations-${n}.json`,
|
|
693
|
-
"data-testid": "tool-execution-results-audio-annotations"
|
|
694
|
-
})
|
|
695
|
-
})]
|
|
696
|
-
})]
|
|
697
|
-
}, n);
|
|
698
|
-
if (e.type === "resource_link") return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
699
|
-
className: "space-y-2",
|
|
700
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
701
|
-
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
702
|
-
children: "Resource Link"
|
|
703
|
-
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
704
|
-
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3 space-y-2",
|
|
705
|
-
children: [
|
|
706
|
-
/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
707
|
-
className: "font-mono text-sm break-all",
|
|
708
|
-
children: [
|
|
709
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
710
|
-
className: "text-gray-600 dark:text-gray-400",
|
|
711
|
-
children: "URI:"
|
|
712
|
-
}),
|
|
713
|
-
" ",
|
|
714
|
-
e.uri
|
|
715
|
-
]
|
|
716
|
-
}),
|
|
717
|
-
e.name && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
718
|
-
className: "text-sm",
|
|
719
|
-
children: [
|
|
720
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
721
|
-
className: "text-gray-600 dark:text-gray-400",
|
|
722
|
-
children: "Name:"
|
|
723
|
-
}),
|
|
724
|
-
" ",
|
|
725
|
-
e.name
|
|
726
|
-
]
|
|
727
|
-
}),
|
|
728
|
-
e.description && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
729
|
-
className: "text-sm",
|
|
730
|
-
children: [
|
|
731
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
732
|
-
className: "text-gray-600 dark:text-gray-400",
|
|
733
|
-
children: "Description:"
|
|
734
|
-
}),
|
|
735
|
-
" ",
|
|
736
|
-
e.description
|
|
737
|
-
]
|
|
738
|
-
}),
|
|
739
|
-
e.mimeType && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
740
|
-
className: "text-sm",
|
|
741
|
-
children: [
|
|
742
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
743
|
-
className: "text-gray-600 dark:text-gray-400",
|
|
744
|
-
children: "MIME Type:"
|
|
745
|
-
}),
|
|
746
|
-
" ",
|
|
747
|
-
e.mimeType
|
|
748
|
-
]
|
|
749
|
-
}),
|
|
750
|
-
e.annotations && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
751
|
-
className: "mt-2",
|
|
752
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
753
|
-
className: "text-xs text-gray-500 dark:text-gray-400 mb-1",
|
|
754
|
-
children: "Annotations:"
|
|
755
|
-
}), /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
756
|
-
data: e.annotations,
|
|
757
|
-
filename: `resource-link-annotations-${n}.json`,
|
|
758
|
-
"data-testid": "tool-execution-results-resource-link-annotations"
|
|
759
|
-
})]
|
|
760
|
-
})
|
|
761
|
-
]
|
|
762
|
-
})]
|
|
763
|
-
}, n);
|
|
764
|
-
if (e.type === "resource") {
|
|
765
|
-
let t = e.resource || {};
|
|
766
|
-
return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
767
|
-
className: "space-y-2",
|
|
768
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
769
|
-
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
770
|
-
children: "Embedded Resource"
|
|
771
|
-
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
772
|
-
className: "bg-gray-50 dark:bg-zinc-900 rounded-lg p-3 space-y-2",
|
|
773
|
-
children: [
|
|
774
|
-
/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
775
|
-
className: "font-mono text-sm break-all",
|
|
776
|
-
"data-testid": "tool-execution-results-resource-uri",
|
|
777
|
-
children: [
|
|
778
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
779
|
-
className: "text-gray-600 dark:text-gray-400",
|
|
780
|
-
children: "URI:"
|
|
781
|
-
}),
|
|
782
|
-
" ",
|
|
783
|
-
t.uri
|
|
784
|
-
]
|
|
785
|
-
}),
|
|
786
|
-
t.mimeType && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
787
|
-
className: "text-sm",
|
|
788
|
-
children: [
|
|
789
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
790
|
-
className: "text-gray-600 dark:text-gray-400",
|
|
791
|
-
"data-testid": "tool-execution-results-mime-type",
|
|
792
|
-
children: "MIME Type:"
|
|
793
|
-
}),
|
|
794
|
-
" ",
|
|
795
|
-
t.mimeType
|
|
796
|
-
]
|
|
797
|
-
}),
|
|
798
|
-
t.text && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
799
|
-
"data-testid": "tool-execution-results-resource-text-content",
|
|
800
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
801
|
-
className: "text-xs text-gray-500 dark:text-gray-400 mb-1",
|
|
802
|
-
children: "Content:"
|
|
803
|
-
}), /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
804
|
-
className: "bg-white dark:bg-black rounded p-2 font-mono text-sm whitespace-pre-wrap break-words max-h-60 overflow-y-auto",
|
|
805
|
-
children: t.text
|
|
806
|
-
})]
|
|
807
|
-
}),
|
|
808
|
-
t.blob && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
809
|
-
className: "text-sm text-gray-600 dark:text-gray-400",
|
|
810
|
-
children: [
|
|
811
|
-
"[Binary content: ",
|
|
812
|
-
t.blob.length || 0,
|
|
813
|
-
" bytes]"
|
|
814
|
-
]
|
|
815
|
-
}),
|
|
816
|
-
t.annotations && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
817
|
-
className: "mt-2",
|
|
818
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
819
|
-
className: "text-xs text-gray-500 dark:text-gray-400 mb-1",
|
|
820
|
-
children: "Annotations:"
|
|
821
|
-
}), /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
822
|
-
data: t.annotations,
|
|
823
|
-
filename: `resource-annotations-${n}.json`,
|
|
824
|
-
"data-testid": "tool-execution-results-resource-annotations"
|
|
825
|
-
})]
|
|
826
|
-
})
|
|
827
|
-
]
|
|
828
|
-
})]
|
|
829
|
-
}, n);
|
|
830
|
-
}
|
|
831
|
-
return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
832
|
-
className: "space-y-2",
|
|
833
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
834
|
-
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
835
|
-
children: ["Unknown Content Type: ", e.type || "N/A"]
|
|
836
|
-
}), /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
837
|
-
data: e,
|
|
838
|
-
filename: `content-${n}.json`,
|
|
839
|
-
"data-testid": "tool-execution-results-unknown-content"
|
|
840
|
-
})]
|
|
841
|
-
}, n);
|
|
842
|
-
})
|
|
843
|
-
});
|
|
844
|
-
}
|
|
845
|
-
function Ue({ serverId: e, viewId: t, toolName: n, resourceUri: r, toolInput: i, toolOutput: a, toolMetadata: o, readResource: s, customProps: c, displayMode: l, onDisplayModeChange: u, onSendFollowUp: d }) {
|
|
846
|
-
let f = Ce({
|
|
847
|
-
serverId: e,
|
|
848
|
-
viewId: t,
|
|
849
|
-
resourceUri: r,
|
|
850
|
-
toolName: n,
|
|
851
|
-
toolInput: i,
|
|
852
|
-
toolOutput: a,
|
|
853
|
-
toolMetadata: o,
|
|
854
|
-
readResource: s,
|
|
855
|
-
displayMode: l,
|
|
856
|
-
onDisplayModeChange: u
|
|
857
|
-
});
|
|
858
|
-
if (!f) return /* @__PURE__ */ (0, Z.jsx)(I, {
|
|
859
|
-
className: "w-full h-full min-h-[240px]",
|
|
860
|
-
children: /* @__PURE__ */ (0, Z.jsx)(Y, { className: "size-5" })
|
|
861
|
-
});
|
|
862
|
-
let p = l === "inline" ? "w-full h-full flex items-center justify-center relative p-4 min-h-0" : "w-full h-full relative p-4", m = c ? JSON.stringify(c) : "no-custom-props";
|
|
863
|
-
return /* @__PURE__ */ (0, Z.jsx)(I, {
|
|
864
|
-
className: "w-full h-full min-h-[240px]",
|
|
865
|
-
children: /* @__PURE__ */ (0, Z.jsx)(ye, {
|
|
866
|
-
viewId: t,
|
|
867
|
-
toolName: n,
|
|
868
|
-
toolInput: i,
|
|
869
|
-
toolOutput: a,
|
|
870
|
-
customProps: c,
|
|
871
|
-
className: p,
|
|
872
|
-
onMessage: (e) => {
|
|
873
|
-
e.length > 0 && d && d(e);
|
|
874
|
-
},
|
|
875
|
-
...f
|
|
876
|
-
}, m)
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
function We({ results: e, copiedResult: t, serverId: n, readResource: r, onCopy: i, onMaximize: a, isMaximized: o = !1, onRerunTool: s }) {
|
|
880
|
-
let [c, u] = (0, X.useState)(0), [d, f] = (0, X.useState)(!0), [p, m] = (0, X.useState)(null), [h, b] = (0, X.useState)("inline"), [x, S] = (0, X.useState)(null), C = (0, X.useRef)(!1), w = e[0], T = w ? e.filter((e) => e.toolName === w.toolName) : [], E = T[c] || T[0], D = e.findIndex((e) => e === E), O = (E ? E.error || Be(E.result) : null) ?? (E == null ? "" : JSON.stringify(E.result, null, 2));
|
|
881
|
-
(0, X.useEffect)(() => {
|
|
882
|
-
T.length > 0 && c >= T.length && u(0);
|
|
883
|
-
}, [T.length, c]), (0, X.useEffect)(() => {
|
|
884
|
-
C.current = !1, m(null);
|
|
885
|
-
}, [w?.toolName]);
|
|
886
|
-
let k = (0, X.useMemo)(() => E?.args, [E?.timestamp, c]), A = (0, X.useMemo)(() => E?.result, [
|
|
887
|
-
E?.timestamp,
|
|
888
|
-
E?.duration,
|
|
889
|
-
c
|
|
890
|
-
]), j = (0, X.useCallback)((e) => r(e), [r]), M = (0, X.useCallback)((e) => {
|
|
891
|
-
let t = e.filter((e) => e.type === "text" && "text" in e).map((e) => e.text).join("\n"), n = e.filter((e) => e.type === "image").length, r = e.filter((e) => e.type === "resource").length, i = [n > 0 && `${n} image${n > 1 ? "s" : ""}`, r > 0 && `${r} resource${r > 1 ? "s" : ""}`].filter(Boolean).join(", ");
|
|
892
|
-
be.info("Widget follow-up", {
|
|
893
|
-
description: [t, i].filter(Boolean).join(" — "),
|
|
894
|
-
duration: 5e3
|
|
895
|
-
});
|
|
896
|
-
}, []), ee = (0, X.useMemo)(() => E && _e(E.toolMeta) ? "mcp-apps" : null, [E]), N = (0, X.useMemo)(() => E?.toolMeta ? ve(E.toolMeta) : null, [E?.toolMeta]), F = (0, X.useMemo)(() => ee === "mcp-apps" && !!N, [ee, N]), I = (0, X.useMemo)(() => E?.result?.content || [], [E]), z = (0, X.useMemo)(() => N || null, [N]), B = (0, X.useMemo)(() => !!(I && I.length > 0 || E?.result?.structuredContent), [I, E]), V = (0, X.useMemo)(() => !F && B, [F, B]), U = (0, X.useMemo)(() => {
|
|
897
|
-
let e = [];
|
|
898
|
-
return F && N && e.push({
|
|
899
|
-
mode: "mcp-apps",
|
|
900
|
-
label: "Component (MCP Apps)"
|
|
901
|
-
}), e.push({
|
|
902
|
-
mode: "json",
|
|
903
|
-
label: "Raw JSON"
|
|
904
|
-
}), e;
|
|
905
|
-
}, [F, N]);
|
|
906
|
-
return (0, X.useEffect)(() => {
|
|
907
|
-
if (U.length === 0) return;
|
|
908
|
-
let e = p && U.some((e) => e.mode === p), t = U.find((e) => e.mode !== "json");
|
|
909
|
-
if (t) {
|
|
910
|
-
let n = C.current;
|
|
911
|
-
if (C.current = !0, !p || !e || p === "json" && !n) {
|
|
912
|
-
m(t.mode);
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
|
-
} else (!p || !e) && m("json");
|
|
916
|
-
}, [U, p]), e.length === 0 ? /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
917
|
-
className: "flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",
|
|
918
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
919
|
-
className: "flex-1 overflow-y-auto h-full",
|
|
920
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
921
|
-
className: "flex items-center justify-center h-full",
|
|
922
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
923
|
-
className: "text-center",
|
|
924
|
-
children: /* @__PURE__ */ (0, Z.jsx)(pe, {
|
|
925
|
-
vertical: !0,
|
|
926
|
-
noBorder: !0,
|
|
927
|
-
message: "No Results yet"
|
|
928
|
-
})
|
|
929
|
-
})
|
|
930
|
-
})
|
|
931
|
-
})
|
|
932
|
-
}) : /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
933
|
-
className: "relative flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",
|
|
934
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
935
|
-
className: "flex-1 overflow-y-auto h-full",
|
|
936
|
-
children: /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
937
|
-
className: "space-y-0 flex flex-col flex-1 h-full",
|
|
938
|
-
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
939
|
-
className: `sticky top-0 z-40 flex items-center gap-2 px-4 pt-2 backdrop-blur-xs bg-white/50 dark:bg-black/50 ${F || V ? "border-b border-gray-200 dark:border-zinc-600 pb-2" : ""}`,
|
|
940
|
-
children: [
|
|
941
|
-
/* @__PURE__ */ (0, Z.jsx)("h3", {
|
|
942
|
-
className: "text-sm font-medium hidden sm:block",
|
|
943
|
-
children: "Response"
|
|
944
|
-
}),
|
|
945
|
-
E.duration !== void 0 && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
946
|
-
className: "hidden sm:flex items-center gap-1",
|
|
947
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(te, { className: "h-3 w-3 text-gray-400" }), /* @__PURE__ */ (0, Z.jsxs)("span", {
|
|
948
|
-
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
949
|
-
children: [E.duration, "ms"]
|
|
950
|
-
})]
|
|
951
|
-
}),
|
|
952
|
-
F && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
953
|
-
className: "flex items-center gap-4 sm:ml-4",
|
|
954
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
955
|
-
className: "flex items-center gap-2",
|
|
956
|
-
children: U.map((e, t) => /* @__PURE__ */ (0, Z.jsxs)(X.Fragment, { children: [t > 0 && /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
957
|
-
className: "text-xs text-zinc-400",
|
|
958
|
-
children: "|"
|
|
959
|
-
}), /* @__PURE__ */ (0, Z.jsx)("button", {
|
|
960
|
-
"data-testid": `tool-result-view-${e.mode}`,
|
|
961
|
-
onClick: () => m(e.mode),
|
|
962
|
-
className: `text-xs font-medium ${p === e.mode ? "text-black dark:text-white" : "text-zinc-500 dark:text-zinc-400"}`,
|
|
963
|
-
children: e.label
|
|
964
|
-
})] }, e.mode))
|
|
965
|
-
})
|
|
966
|
-
}),
|
|
967
|
-
V && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
968
|
-
className: "flex items-center gap-2 sm:ml-4",
|
|
969
|
-
children: [
|
|
970
|
-
/* @__PURE__ */ (0, Z.jsx)("button", {
|
|
971
|
-
onClick: () => f(!0),
|
|
972
|
-
className: `text-xs font-medium ${d ? "text-black dark:text-white" : "text-zinc-500 dark:text-zinc-400"}`,
|
|
973
|
-
children: "Formatted"
|
|
974
|
-
}),
|
|
975
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
976
|
-
className: "text-xs text-zinc-400",
|
|
977
|
-
children: "|"
|
|
978
|
-
}),
|
|
979
|
-
/* @__PURE__ */ (0, Z.jsx)("button", {
|
|
980
|
-
onClick: () => f(!1),
|
|
981
|
-
className: `text-xs font-medium ${d ? "text-zinc-500 dark:text-zinc-400" : "text-black dark:text-white"}`,
|
|
982
|
-
children: "Raw"
|
|
983
|
-
})
|
|
984
|
-
]
|
|
985
|
-
}),
|
|
986
|
-
/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
987
|
-
className: "ml-auto flex items-center gap-1",
|
|
988
|
-
children: [
|
|
989
|
-
o && s && /* @__PURE__ */ (0, Z.jsxs)(l, {
|
|
990
|
-
"data-testid": "tool-result-rerun",
|
|
991
|
-
variant: "ghost",
|
|
992
|
-
size: "sm",
|
|
993
|
-
onClick: s,
|
|
994
|
-
title: "Re-run with same arguments",
|
|
995
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(q, { className: "h-4 w-4" }), /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
996
|
-
className: "hidden sm:inline ml-1",
|
|
997
|
-
children: "Re-run"
|
|
998
|
-
})]
|
|
999
|
-
}),
|
|
1000
|
-
F && a && /* @__PURE__ */ (0, Z.jsx)(l, {
|
|
1001
|
-
"data-testid": "tool-result-maximize",
|
|
1002
|
-
variant: "ghost",
|
|
1003
|
-
size: "sm",
|
|
1004
|
-
onClick: a,
|
|
1005
|
-
title: o ? "Restore" : "Maximize",
|
|
1006
|
-
children: o ? /* @__PURE__ */ (0, Z.jsx)(oe, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, Z.jsx)(ae, { className: "h-4 w-4" })
|
|
1007
|
-
}),
|
|
1008
|
-
T.length > 1 && /* @__PURE__ */ (0, Z.jsxs)(y, {
|
|
1009
|
-
value: c.toString(),
|
|
1010
|
-
onValueChange: (e) => u(parseInt(e)),
|
|
1011
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(g, {
|
|
1012
|
-
className: "w-[140px] h-8 text-xs",
|
|
1013
|
-
leading: /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1014
|
-
className: "flex items-center gap-1",
|
|
1015
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(K, { className: "h-3 w-3" }), /* @__PURE__ */ (0, Z.jsx)(Re, { timestamp: E.timestamp })]
|
|
1016
|
-
})
|
|
1017
|
-
}), /* @__PURE__ */ (0, Z.jsx)(_, { children: T.map((e, t) => /* @__PURE__ */ (0, Z.jsx)(v, {
|
|
1018
|
-
value: t.toString(),
|
|
1019
|
-
children: /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1020
|
-
className: "flex items-center gap-2",
|
|
1021
|
-
children: [
|
|
1022
|
-
/* @__PURE__ */ (0, Z.jsx)(K, { className: "h-3 w-3" }),
|
|
1023
|
-
/* @__PURE__ */ (0, Z.jsx)("span", { children: ze(e.timestamp) }),
|
|
1024
|
-
/* @__PURE__ */ (0, Z.jsxs)("span", {
|
|
1025
|
-
className: "text-xs text-muted-foreground",
|
|
1026
|
-
children: [
|
|
1027
|
-
"(",
|
|
1028
|
-
new Date(e.timestamp).toLocaleTimeString(),
|
|
1029
|
-
")"
|
|
1030
|
-
]
|
|
1031
|
-
})
|
|
1032
|
-
]
|
|
1033
|
-
})
|
|
1034
|
-
}, t)) })]
|
|
1035
|
-
}),
|
|
1036
|
-
/* @__PURE__ */ (0, Z.jsx)(l, {
|
|
1037
|
-
"data-testid": `tool-result-copy-${D}`,
|
|
1038
|
-
variant: "ghost",
|
|
1039
|
-
size: "sm",
|
|
1040
|
-
onClick: () => i(D, O),
|
|
1041
|
-
children: t === D ? /* @__PURE__ */ (0, Z.jsx)(L, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, Z.jsx)(R, { className: "h-4 w-4" })
|
|
1042
|
-
})
|
|
1043
|
-
]
|
|
1044
|
-
})
|
|
1045
|
-
]
|
|
1046
|
-
}), (() => {
|
|
1047
|
-
let e = E.error || Be(E.result);
|
|
1048
|
-
return e ? /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1049
|
-
className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3 mx-4",
|
|
1050
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1051
|
-
className: "text-red-800 dark:text-red-300 font-medium",
|
|
1052
|
-
children: "Error:"
|
|
1053
|
-
}), /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1054
|
-
className: "text-red-700 dark:text-red-400 text-sm",
|
|
1055
|
-
children: e
|
|
1056
|
-
})]
|
|
1057
|
-
}) : (() => {
|
|
1058
|
-
if (!p) return /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1059
|
-
className: "flex items-center justify-center w-full h-[200px]",
|
|
1060
|
-
children: /* @__PURE__ */ (0, Z.jsx)(Y, { className: "size-5" })
|
|
1061
|
-
});
|
|
1062
|
-
switch (p) {
|
|
1063
|
-
case "mcp-apps": return !F || !N ? /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1064
|
-
className: "px-4 pt-4",
|
|
1065
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1066
|
-
className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3",
|
|
1067
|
-
children: /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1068
|
-
className: "text-sm text-red-600 dark:text-red-400",
|
|
1069
|
-
children: "MCP Apps resource not available"
|
|
1070
|
-
})
|
|
1071
|
-
})
|
|
1072
|
-
}) : /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1073
|
-
className: "flex flex-1 relative flex-col min-h-0",
|
|
1074
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1075
|
-
className: "absolute top-2 right-2 z-30 flex items-center gap-2",
|
|
1076
|
-
children: /* @__PURE__ */ (0, Z.jsx)(P, {
|
|
1077
|
-
toolCallId: `tool-${E.timestamp}`,
|
|
1078
|
-
displayMode: h,
|
|
1079
|
-
onDisplayModeChange: b,
|
|
1080
|
-
propsContext: "tool",
|
|
1081
|
-
resourceUri: N,
|
|
1082
|
-
toolInput: E.args,
|
|
1083
|
-
resourceAnnotations: E.toolMeta,
|
|
1084
|
-
llmConfig: null,
|
|
1085
|
-
resource: null,
|
|
1086
|
-
onPropsChange: S
|
|
1087
|
-
})
|
|
1088
|
-
}), /* @__PURE__ */ (0, Z.jsx)(Ue, {
|
|
1089
|
-
serverId: n,
|
|
1090
|
-
viewId: `tool-${E.timestamp}`,
|
|
1091
|
-
toolName: E.toolName,
|
|
1092
|
-
toolInput: k,
|
|
1093
|
-
toolOutput: A,
|
|
1094
|
-
toolMetadata: E.toolMeta,
|
|
1095
|
-
resourceUri: N,
|
|
1096
|
-
readResource: j,
|
|
1097
|
-
customProps: x || void 0,
|
|
1098
|
-
displayMode: h,
|
|
1099
|
-
onDisplayModeChange: b,
|
|
1100
|
-
onSendFollowUp: M
|
|
1101
|
-
}, `mcp-apps-${E.timestamp}`)]
|
|
1102
|
-
});
|
|
1103
|
-
case "json":
|
|
1104
|
-
if (V && d) {
|
|
1105
|
-
let e = E.result?.structuredContent;
|
|
1106
|
-
return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1107
|
-
className: "px-4 pt-4 space-y-4",
|
|
1108
|
-
"data-testid": "tool-execution-results-content",
|
|
1109
|
-
children: [
|
|
1110
|
-
e && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1111
|
-
className: "space-y-2",
|
|
1112
|
-
"data-testid": "tool-execution-results-structured-content",
|
|
1113
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1114
|
-
className: "text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
1115
|
-
children: "Structured Content"
|
|
1116
|
-
}), /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
1117
|
-
data: e,
|
|
1118
|
-
filename: `structured-content-${E.toolName}-${Date.now()}.json`
|
|
1119
|
-
})]
|
|
1120
|
-
}),
|
|
1121
|
-
I && I.length > 0 && /* @__PURE__ */ (0, Z.jsx)(He, { content: I }),
|
|
1122
|
-
!e && (!I || I.length === 0) && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1123
|
-
className: "text-sm text-gray-500 dark:text-gray-400",
|
|
1124
|
-
"data-testid": "tool-execution-results-no-content",
|
|
1125
|
-
children: "No content to display"
|
|
1126
|
-
})
|
|
1127
|
-
]
|
|
1128
|
-
});
|
|
1129
|
-
}
|
|
1130
|
-
return /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1131
|
-
className: "px-4 pt-4",
|
|
1132
|
-
children: /* @__PURE__ */ (0, Z.jsx)(H, {
|
|
1133
|
-
data: E.result,
|
|
1134
|
-
filename: `tool-result-${E.toolName}-${Date.now()}.json`
|
|
1135
|
-
})
|
|
1136
|
-
});
|
|
1137
|
-
default: return null;
|
|
1138
|
-
}
|
|
1139
|
-
})();
|
|
1140
|
-
})()]
|
|
1141
|
-
})
|
|
1142
|
-
}), z && p === "mcp-apps" && /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1143
|
-
className: "absolute bottom-0 left-1/2 -translate-x-1/2 z-40 pointer-events-none",
|
|
1144
|
-
children: /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
1145
|
-
className: "text-[11px] bg-gray-200 dark:bg-zinc-800 text-gray-500 dark:text-gray-400 px-3 py-0.5 rounded-t-xl font-mono max-w-[320px] truncate block",
|
|
1146
|
-
children: z
|
|
1147
|
-
})
|
|
1148
|
-
})]
|
|
1149
|
-
});
|
|
1150
|
-
}
|
|
1151
|
-
//#endregion
|
|
1152
|
-
//#region src/client/components/tools/ToolsList.tsx
|
|
1153
|
-
function Ge({ tools: e, selectedTool: t, onToolSelect: r, focusedIndex: a }) {
|
|
1154
|
-
if (e.length === 0) return /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1155
|
-
className: "flex flex-1 flex-col items-center justify-center p-4 text-center",
|
|
1156
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(de, { className: "h-12 w-12 text-gray-400 dark:text-gray-600 mb-3" }), /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1157
|
-
className: "text-gray-500 dark:text-gray-400",
|
|
1158
|
-
children: "No tools available"
|
|
1159
|
-
})]
|
|
1160
|
-
});
|
|
1161
|
-
let o = e.some((e) => e.inputSchema?.properties && Object.keys(e.inputSchema.properties).length > 0);
|
|
1162
|
-
return /* @__PURE__ */ (0, Z.jsx)("div", { children: e.map((e, l) => {
|
|
1163
|
-
let u = e._meta, d = _e(u) ? "mcp-apps" : null, f = e.inputSchema?.properties, p = f ? Object.keys(f).length : 0, m = o && p > 0 && /* @__PURE__ */ (0, Z.jsxs)(n, {
|
|
1164
|
-
variant: "outline",
|
|
1165
|
-
className: "text-xs border-gray-300 dark:border-zinc-600 text-gray-600 dark:text-gray-400",
|
|
1166
|
-
children: [p, " params"]
|
|
1167
|
-
}), h = d === "mcp-apps" || m ? /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1168
|
-
className: "flex items-center gap-1.5",
|
|
1169
|
-
children: [d === "mcp-apps" && /* @__PURE__ */ (0, Z.jsxs)(s, { children: [/* @__PURE__ */ (0, Z.jsx)(i, {
|
|
1170
|
-
render: /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
1171
|
-
className: "inline-flex",
|
|
1172
|
-
children: /* @__PURE__ */ (0, Z.jsx)(ce, { className: "h-3.5 w-3.5" })
|
|
1173
|
-
}),
|
|
1174
|
-
nativeButton: !1
|
|
1175
|
-
}), /* @__PURE__ */ (0, Z.jsx)(c, { children: /* @__PURE__ */ (0, Z.jsx)("p", { children: "UI widget" }) })] }), m]
|
|
1176
|
-
}) : void 0;
|
|
1177
|
-
return /* @__PURE__ */ (0, Z.jsx)(G, {
|
|
1178
|
-
id: `tool-${e.name}`,
|
|
1179
|
-
"data-testid": `tool-item-${e.name}`,
|
|
1180
|
-
isSelected: t?.name === e.name,
|
|
1181
|
-
isFocused: a === l,
|
|
1182
|
-
title: e.name,
|
|
1183
|
-
description: e.description,
|
|
1184
|
-
metadata: h,
|
|
1185
|
-
onClick: () => r(e)
|
|
1186
|
-
}, e.name);
|
|
1187
|
-
}) });
|
|
1188
|
-
}
|
|
1189
|
-
//#endregion
|
|
1190
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@base-ui/react/alert-dialog/root/AlertDialogRoot.mjs
|
|
1191
|
-
function Ke(e) {
|
|
1192
|
-
return A(e, "alert-dialog");
|
|
1193
|
-
}
|
|
1194
|
-
//#endregion
|
|
1195
|
-
//#region src/client/components/ui/alert-dialog.tsx
|
|
1196
|
-
function qe({ ...e }) {
|
|
1197
|
-
return /* @__PURE__ */ (0, Z.jsx)(Ke, {
|
|
1198
|
-
"data-slot": "alert-dialog",
|
|
1199
|
-
...e
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
function Je({ ...e }) {
|
|
1203
|
-
return /* @__PURE__ */ (0, Z.jsx)(D, {
|
|
1204
|
-
"data-slot": "alert-dialog-portal",
|
|
1205
|
-
...e
|
|
1206
|
-
});
|
|
1207
|
-
}
|
|
1208
|
-
function Ye({ className: e, ...t }) {
|
|
1209
|
-
return /* @__PURE__ */ (0, Z.jsx)(N, {
|
|
1210
|
-
"data-slot": "alert-dialog-overlay",
|
|
1211
|
-
className: r("fixed inset-0 isolate z-50 bg-black/50 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
|
|
1212
|
-
...t
|
|
1213
|
-
});
|
|
1214
|
-
}
|
|
1215
|
-
function Xe({ className: e, size: t = "default", ...n }) {
|
|
1216
|
-
return /* @__PURE__ */ (0, Z.jsxs)(Je, { children: [/* @__PURE__ */ (0, Z.jsx)(Ye, {}), /* @__PURE__ */ (0, Z.jsx)(E, {
|
|
1217
|
-
"data-slot": "alert-dialog-content",
|
|
1218
|
-
"data-size": t,
|
|
1219
|
-
className: r("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
1220
|
-
...n
|
|
1221
|
-
})] });
|
|
1222
|
-
}
|
|
1223
|
-
function Ze({ className: e, ...t }) {
|
|
1224
|
-
return /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1225
|
-
"data-slot": "alert-dialog-header",
|
|
1226
|
-
className: r("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", e),
|
|
1227
|
-
...t
|
|
1228
|
-
});
|
|
1229
|
-
}
|
|
1230
|
-
function Qe({ className: e, ...t }) {
|
|
1231
|
-
return /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1232
|
-
"data-slot": "alert-dialog-footer",
|
|
1233
|
-
className: r("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", e),
|
|
1234
|
-
...t
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
function $e({ className: e, ...t }) {
|
|
1238
|
-
return /* @__PURE__ */ (0, Z.jsx)(w, {
|
|
1239
|
-
"data-slot": "alert-dialog-title",
|
|
1240
|
-
className: r("text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", e),
|
|
1241
|
-
...t
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
function et({ className: e, ...t }) {
|
|
1245
|
-
return /* @__PURE__ */ (0, Z.jsx)(T, {
|
|
1246
|
-
"data-slot": "alert-dialog-description",
|
|
1247
|
-
className: r("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
|
|
1248
|
-
...t
|
|
1249
|
-
});
|
|
1250
|
-
}
|
|
1251
|
-
function tt({ className: e, ...t }) {
|
|
1252
|
-
return /* @__PURE__ */ (0, Z.jsx)(l, {
|
|
1253
|
-
"data-slot": "alert-dialog-action",
|
|
1254
|
-
className: r(e),
|
|
1255
|
-
...t
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
function nt({ className: e, variant: t = "outline", size: n = "default", ...i }) {
|
|
1259
|
-
return /* @__PURE__ */ (0, Z.jsx)(S, {
|
|
1260
|
-
"data-slot": "alert-dialog-cancel",
|
|
1261
|
-
className: r(e),
|
|
1262
|
-
render: /* @__PURE__ */ (0, Z.jsx)(l, {
|
|
1263
|
-
variant: t,
|
|
1264
|
-
size: n
|
|
1265
|
-
}),
|
|
1266
|
-
...i
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
1269
|
-
//#endregion
|
|
1270
|
-
//#region src/client/components/tools/useToolExecution.ts
|
|
1271
|
-
function rt({ selectedTool: e, payloadToSend: t, toolArgs: n, callTool: r, readResource: i, serverId: a }) {
|
|
1272
|
-
let [o, s] = (0, X.useState)([]), [c, l] = (0, X.useState)(!1), [u, d] = (0, X.useState)(null), [f, p] = (0, X.useState)(null), m = (0, X.useCallback)(async () => {
|
|
1273
|
-
if (!e || c) return;
|
|
1274
|
-
let o = new AbortController();
|
|
1275
|
-
p(o), l(!0);
|
|
1276
|
-
let u = Date.now();
|
|
1277
|
-
try {
|
|
1278
|
-
let c = t, l = e?._meta || e?.metadata, d = l?.ui?.resourceUri;
|
|
1279
|
-
if (d && typeof d == "string") {
|
|
1280
|
-
try {
|
|
1281
|
-
await i(d);
|
|
1282
|
-
} catch {}
|
|
1283
|
-
s([{
|
|
1284
|
-
toolName: e.name,
|
|
1285
|
-
args: c,
|
|
1286
|
-
result: null,
|
|
1287
|
-
timestamp: u,
|
|
1288
|
-
duration: 0,
|
|
1289
|
-
toolMeta: l
|
|
1290
|
-
}]);
|
|
1291
|
-
}
|
|
1292
|
-
let f = await r(e.name, c, {
|
|
1293
|
-
timeout: 6e5,
|
|
1294
|
-
resetTimeoutOnProgress: !0,
|
|
1295
|
-
signal: o.signal
|
|
1296
|
-
}), p = Date.now() - u, m = f?._meta ?? l;
|
|
1297
|
-
he(new me({
|
|
1298
|
-
toolName: e.name,
|
|
1299
|
-
serverId: a,
|
|
1300
|
-
success: !0,
|
|
1301
|
-
duration: p
|
|
1302
|
-
})).catch(() => {}), window.dispatchEvent(new Event("mcp-tool-executed")), s(d && typeof d == "string" ? (e) => e.map((e, t) => t === 0 ? {
|
|
1303
|
-
...e,
|
|
1304
|
-
result: f,
|
|
1305
|
-
duration: p,
|
|
1306
|
-
toolMeta: m
|
|
1307
|
-
} : e) : (t) => [{
|
|
1308
|
-
toolName: e.name,
|
|
1309
|
-
args: n,
|
|
1310
|
-
result: f,
|
|
1311
|
-
timestamp: u,
|
|
1312
|
-
duration: p,
|
|
1313
|
-
toolMeta: m
|
|
1314
|
-
}, ...t]);
|
|
1315
|
-
} catch (t) {
|
|
1316
|
-
let r = Date.now() - u;
|
|
1317
|
-
he(new me({
|
|
1318
|
-
toolName: e.name,
|
|
1319
|
-
serverId: a,
|
|
1320
|
-
success: !1,
|
|
1321
|
-
duration: r,
|
|
1322
|
-
error: t instanceof Error ? t.message : String(t)
|
|
1323
|
-
})).catch(() => {}), window.dispatchEvent(new Event("mcp-tool-executed"));
|
|
1324
|
-
let i = e?._meta || e?.metadata, o = {
|
|
1325
|
-
toolName: e.name,
|
|
1326
|
-
args: n,
|
|
1327
|
-
result: null,
|
|
1328
|
-
error: t instanceof Error ? t.message : String(t),
|
|
1329
|
-
timestamp: u,
|
|
1330
|
-
duration: r,
|
|
1331
|
-
toolMeta: i
|
|
1332
|
-
};
|
|
1333
|
-
i?.ui?.resourceUri ? s([o]) : s((e) => [o, ...e]);
|
|
1334
|
-
} finally {
|
|
1335
|
-
l(!1);
|
|
1336
|
-
}
|
|
1337
|
-
}, [
|
|
1338
|
-
e,
|
|
1339
|
-
t,
|
|
1340
|
-
n,
|
|
1341
|
-
c,
|
|
1342
|
-
r,
|
|
1343
|
-
i,
|
|
1344
|
-
a
|
|
1345
|
-
]), h = (0, X.useCallback)(async (e, t) => {
|
|
1346
|
-
try {
|
|
1347
|
-
await z(t), d(e), setTimeout(() => d(null), 2e3);
|
|
1348
|
-
} catch (e) {
|
|
1349
|
-
console.error("[ToolsTab] Failed to copy result:", e);
|
|
1350
|
-
}
|
|
1351
|
-
}, []), g = (0, X.useCallback)((e) => {
|
|
1352
|
-
s((t) => t.filter((t, n) => n !== e));
|
|
1353
|
-
}, []), _ = (0, X.useMemo)(() => e ? o.filter((t) => t.toolName === e.name) : [], [o, e]);
|
|
1354
|
-
return {
|
|
1355
|
-
results: o,
|
|
1356
|
-
setResults: s,
|
|
1357
|
-
isExecuting: c,
|
|
1358
|
-
copiedResult: u,
|
|
1359
|
-
executeTool: m,
|
|
1360
|
-
handleCopyResult: h,
|
|
1361
|
-
handleDeleteResult: g,
|
|
1362
|
-
handleFullscreen: (0, X.useCallback)((e) => {
|
|
1363
|
-
let t = _[e];
|
|
1364
|
-
if (!t) return;
|
|
1365
|
-
let n = window.open("", "_blank", "width=800,height=600");
|
|
1366
|
-
n && (n.document.write(`
|
|
1367
|
-
<html>
|
|
1368
|
-
<head><title>${t.toolName} Result</title></head>
|
|
1369
|
-
<body><pre>${JSON.stringify(t.result, null, 2)}</pre></body>
|
|
1370
|
-
</html>
|
|
1371
|
-
`), n.document.close());
|
|
1372
|
-
}, [_]),
|
|
1373
|
-
filteredResults: _,
|
|
1374
|
-
cancelExecution: (0, X.useCallback)(() => {
|
|
1375
|
-
f?.abort(), p(null), l(!1);
|
|
1376
|
-
}, [f])
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1379
|
-
//#endregion
|
|
1380
|
-
//#region src/client/components/tools/useToolsTabNavigation.ts
|
|
1381
|
-
function it({ ref: e, activeTab: t, filteredTools: n, savedRequests: r, searchQuery: i, setSearchQuery: a, selectedTool: o, results: s, isExecuting: c, handleToolSelect: l, loadSavedRequest: u, refreshTools: d, selectedToolName: f, tools: p, setSelectedToolName: m }) {
|
|
1382
|
-
let [h, g] = (0, X.useState)(!1), [_, v] = (0, X.useState)(-1), y = (0, X.useRef)(null), [b, x] = (0, X.useState)(!1), [S, C] = (0, X.useState)("list"), [w, T] = (0, X.useState)(!1);
|
|
1383
|
-
(0, X.useEffect)(() => {
|
|
1384
|
-
let e = () => x(window.innerWidth < 1024);
|
|
1385
|
-
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
1386
|
-
}, []), (0, X.useEffect)(() => {
|
|
1387
|
-
C(o ? "detail" : "list");
|
|
1388
|
-
}, [o]), (0, X.useEffect)(() => {
|
|
1389
|
-
b && s.length > 0 && !c && C("response");
|
|
1390
|
-
}, [
|
|
1391
|
-
s,
|
|
1392
|
-
c,
|
|
1393
|
-
b
|
|
1394
|
-
]), (0, X.useImperativeHandle)(e, () => ({
|
|
1395
|
-
focusSearch: () => {
|
|
1396
|
-
g(!0), setTimeout(() => y.current?.focus(), 0);
|
|
1397
|
-
},
|
|
1398
|
-
blurSearch: () => {
|
|
1399
|
-
a(""), g(!1), y.current?.blur();
|
|
1400
|
-
}
|
|
1401
|
-
})), (0, X.useEffect)(() => {
|
|
1402
|
-
h && y.current?.focus();
|
|
1403
|
-
}, [h]);
|
|
1404
|
-
let E = (0, X.useCallback)(() => {
|
|
1405
|
-
i.trim() || g(!1);
|
|
1406
|
-
}, [i]), D = (0, X.useCallback)(async () => {
|
|
1407
|
-
if (d) {
|
|
1408
|
-
T(!0);
|
|
1409
|
-
try {
|
|
1410
|
-
await d();
|
|
1411
|
-
} finally {
|
|
1412
|
-
T(!1);
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
}, [d]);
|
|
1416
|
-
return (0, X.useEffect)(() => {
|
|
1417
|
-
t !== "tools" && g(!1);
|
|
1418
|
-
}, [t]), (0, X.useEffect)(() => {
|
|
1419
|
-
v(-1);
|
|
1420
|
-
}, [i, t]), (0, X.useEffect)(() => {
|
|
1421
|
-
let e = (e) => {
|
|
1422
|
-
let i = e.target;
|
|
1423
|
-
if (i.tagName === "INPUT" || i.tagName === "TEXTAREA" || i.contentEditable === "true" || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
1424
|
-
let a = t === "tools" ? n : r;
|
|
1425
|
-
if (e.key === "ArrowDown") e.preventDefault(), v((e) => e + 1 >= a.length ? 0 : e + 1);
|
|
1426
|
-
else if (e.key === "ArrowUp") e.preventDefault(), v((e) => e - 1 < 0 ? a.length - 1 : e - 1);
|
|
1427
|
-
else if (e.key === "Enter" && _ >= 0) if (e.preventDefault(), t === "tools") {
|
|
1428
|
-
let e = n[_];
|
|
1429
|
-
e && l(e);
|
|
1430
|
-
} else {
|
|
1431
|
-
let e = r[_];
|
|
1432
|
-
e && u(e);
|
|
1433
|
-
}
|
|
1434
|
-
};
|
|
1435
|
-
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1436
|
-
}, [
|
|
1437
|
-
_,
|
|
1438
|
-
n,
|
|
1439
|
-
r,
|
|
1440
|
-
t,
|
|
1441
|
-
l,
|
|
1442
|
-
u
|
|
1443
|
-
]), (0, X.useEffect)(() => {
|
|
1444
|
-
if (_ >= 0) {
|
|
1445
|
-
let e = t === "tools" ? `tool-${n[_]?.name}` : `saved-${r[_]?.id}`;
|
|
1446
|
-
document.getElementById(e)?.scrollIntoView({
|
|
1447
|
-
behavior: "smooth",
|
|
1448
|
-
block: "nearest"
|
|
1449
|
-
});
|
|
1450
|
-
}
|
|
1451
|
-
}, [
|
|
1452
|
-
_,
|
|
1453
|
-
n,
|
|
1454
|
-
r,
|
|
1455
|
-
t
|
|
1456
|
-
]), (0, X.useEffect)(() => {
|
|
1457
|
-
if (!f || p.length === 0) return;
|
|
1458
|
-
let e = p.find((e) => e.name === f);
|
|
1459
|
-
if (e) {
|
|
1460
|
-
m(null);
|
|
1461
|
-
let t = setTimeout(() => {
|
|
1462
|
-
l(e), document.getElementById(`tool-${e.name}`)?.scrollIntoView({
|
|
1463
|
-
behavior: "smooth",
|
|
1464
|
-
block: "nearest"
|
|
1465
|
-
});
|
|
1466
|
-
}, 100);
|
|
1467
|
-
return () => clearTimeout(t);
|
|
1468
|
-
}
|
|
1469
|
-
}, [
|
|
1470
|
-
f,
|
|
1471
|
-
p,
|
|
1472
|
-
l,
|
|
1473
|
-
m
|
|
1474
|
-
]), {
|
|
1475
|
-
isSearchExpanded: h,
|
|
1476
|
-
setIsSearchExpanded: g,
|
|
1477
|
-
focusedIndex: _,
|
|
1478
|
-
searchInputRef: y,
|
|
1479
|
-
isMobile: b,
|
|
1480
|
-
mobileView: S,
|
|
1481
|
-
setMobileView: C,
|
|
1482
|
-
isRefreshing: w,
|
|
1483
|
-
handleSearchBlur: E,
|
|
1484
|
-
handleRefresh: D
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1487
|
-
//#endregion
|
|
1488
|
-
//#region src/client/components/ToolsTab.tsx
|
|
1489
|
-
function at({ ref: e, tools: t, callTool: n, readResource: r, serverId: i, isConnected: a, refreshTools: s }) {
|
|
1490
|
-
let [c, u] = (0, X.useState)(null), [d, f] = (0, X.useState)(null), { selectedToolName: p, setSelectedToolName: h } = xe(), [g, _] = (0, X.useState)({}), [v, y] = (0, X.useState)(/* @__PURE__ */ new Set()), [b, x] = (0, X.useState)(/* @__PURE__ */ new Set()), [S, C] = (0, X.useState)(""), [w, T] = (0, X.useState)("tools"), { savedRequests: E, saveSavedRequests: D } = le(), [O, k] = (0, X.useState)(!1), [A, j] = (0, X.useState)(""), [M, ee] = (0, X.useState)(!1), [N, P] = (0, X.useState)({
|
|
1491
|
-
open: !1,
|
|
1492
|
-
parsedObject: {},
|
|
1493
|
-
fieldsToUpdate: [],
|
|
1494
|
-
newFields: [],
|
|
1495
|
-
resolve: null
|
|
1496
|
-
}), [I, L] = (0, X.useState)(/* @__PURE__ */ new Set()), R = ie(), z = ie(), te = (0, X.useCallback)(() => {
|
|
1497
|
-
M ? (R.current && R.current.expand(), z.current && z.current.expand(), ee(!1)) : (R.current && R.current.collapse(), z.current && z.current.collapse(), ee(!0));
|
|
1498
|
-
}, [
|
|
1499
|
-
M,
|
|
1500
|
-
R,
|
|
1501
|
-
z
|
|
1502
|
-
]), V = (0, X.useMemo)(() => {
|
|
1503
|
-
if (!S.trim()) return t;
|
|
1504
|
-
let e = S.toLowerCase();
|
|
1505
|
-
return t.filter((t) => t.name.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
|
|
1506
|
-
}, [t, S]), H = (0, X.useCallback)((e) => {
|
|
1507
|
-
u(e);
|
|
1508
|
-
let t = {}, n = /* @__PURE__ */ new Set();
|
|
1509
|
-
e.inputSchema?.properties && Object.entries(e.inputSchema.properties).forEach(([e, r]) => {
|
|
1510
|
-
let i = r;
|
|
1511
|
-
i.default !== void 0 && (t[e] = i.default, n.add(e));
|
|
1512
|
-
}), _(t), y(n), x(/* @__PURE__ */ new Set());
|
|
1513
|
-
}, []), G = (0, X.useCallback)((e) => {
|
|
1514
|
-
let n = t.find((t) => t.name === e.toolName);
|
|
1515
|
-
n && (u(n), _(e.args), y(new Set(Object.keys(e.args))), x(/* @__PURE__ */ new Set()), f(e));
|
|
1516
|
-
}, [t]);
|
|
1517
|
-
(0, X.useEffect)(() => {
|
|
1518
|
-
if (c) {
|
|
1519
|
-
let e = t.find((e) => e.name === c.name);
|
|
1520
|
-
e ? e !== c && (JSON.stringify(e.inputSchema) !== JSON.stringify(c.inputSchema) || e.description !== c.description || JSON.stringify(e?._meta) !== JSON.stringify(c?._meta)) && u(e) : (u(null), h(null));
|
|
1521
|
-
}
|
|
1522
|
-
}, [
|
|
1523
|
-
t,
|
|
1524
|
-
c,
|
|
1525
|
-
h
|
|
1526
|
-
]);
|
|
1527
|
-
let K = (0, X.useCallback)((e, t) => {
|
|
1528
|
-
let n = c?.inputSchema || {}, r = c?.inputSchema?.properties?.[e], i = r ? ke(r, n) : "string", a;
|
|
1529
|
-
a = i === "object" || i === "array" || i === "string" ? t : Me(t, i), _((t) => ({
|
|
1530
|
-
...t,
|
|
1531
|
-
[e]: a
|
|
1532
|
-
}));
|
|
1533
|
-
let o = String(t).trim() === "";
|
|
1534
|
-
y((t) => {
|
|
1535
|
-
let n = new Set(t);
|
|
1536
|
-
return o ? n.delete(e) : n.add(e), n;
|
|
1537
|
-
}), x((t) => {
|
|
1538
|
-
let n = new Set(t);
|
|
1539
|
-
return n.delete(e), n;
|
|
1540
|
-
});
|
|
1541
|
-
}, [c]), ae = (0, X.useCallback)((e, t, n) => {
|
|
1542
|
-
if (n) {
|
|
1543
|
-
let n = t === "array" ? "[]" : t === "object" ? "{}" : "";
|
|
1544
|
-
_((t) => ({
|
|
1545
|
-
...t,
|
|
1546
|
-
[e]: n
|
|
1547
|
-
})), y((t) => new Set(t).add(e)), x((t) => new Set(t).add(e));
|
|
1548
|
-
} else x((t) => {
|
|
1549
|
-
let n = new Set(t);
|
|
1550
|
-
return n.delete(e), n;
|
|
1551
|
-
}), y((t) => {
|
|
1552
|
-
let n = new Set(t);
|
|
1553
|
-
return n.delete(e), n;
|
|
1554
|
-
});
|
|
1555
|
-
}, []), oe = (0, X.useCallback)(async (e, t) => {
|
|
1556
|
-
if (!c) return !1;
|
|
1557
|
-
let n = Fe(e);
|
|
1558
|
-
if (!n) return !1;
|
|
1559
|
-
let r = c.inputSchema?.properties || {}, i = Object.keys(r), a = c.inputSchema || {}, o = [], s = [];
|
|
1560
|
-
return Object.entries(n).forEach(([e, t]) => {
|
|
1561
|
-
if (i.includes(e)) {
|
|
1562
|
-
let n = r[e], i = ke(n, a), c = t;
|
|
1563
|
-
i === "object" || i === "array" ? typeof t == "object" && t ? c = JSON.stringify(t, null, 2) : typeof t == "string" && (c = t) : c = typeof t == "object" && t ? JSON.stringify(t) : String(t);
|
|
1564
|
-
let l = g[e];
|
|
1565
|
-
l != null && l !== "" ? o.push({
|
|
1566
|
-
key: e,
|
|
1567
|
-
oldValue: l,
|
|
1568
|
-
newValue: c
|
|
1569
|
-
}) : (s.push(e), K(e, String(c)));
|
|
1570
|
-
}
|
|
1571
|
-
}), o.length === 0 && s.length === 0 ? !1 : o.length === 0 ? (L(new Set(s)), setTimeout(() => L(/* @__PURE__ */ new Set()), 2e3), !0) : new Promise((e) => {
|
|
1572
|
-
P({
|
|
1573
|
-
open: !0,
|
|
1574
|
-
parsedObject: n,
|
|
1575
|
-
fieldsToUpdate: o,
|
|
1576
|
-
newFields: s,
|
|
1577
|
-
resolve: e
|
|
1578
|
-
});
|
|
1579
|
-
});
|
|
1580
|
-
}, [
|
|
1581
|
-
c,
|
|
1582
|
-
g,
|
|
1583
|
-
K
|
|
1584
|
-
]), se = (0, X.useCallback)(() => {
|
|
1585
|
-
if (!N.resolve) return;
|
|
1586
|
-
N.fieldsToUpdate.forEach(({ key: e, newValue: t }) => {
|
|
1587
|
-
K(e, String(t));
|
|
1588
|
-
});
|
|
1589
|
-
let e = [...N.fieldsToUpdate.map((e) => e.key), ...N.newFields];
|
|
1590
|
-
L(new Set(e)), setTimeout(() => L(/* @__PURE__ */ new Set()), 2e3), N.resolve(!0), P({
|
|
1591
|
-
open: !1,
|
|
1592
|
-
parsedObject: {},
|
|
1593
|
-
fieldsToUpdate: [],
|
|
1594
|
-
newFields: [],
|
|
1595
|
-
resolve: null
|
|
1596
|
-
});
|
|
1597
|
-
}, [N, K]), ce = (0, X.useCallback)(() => {
|
|
1598
|
-
N.resolve && (N.resolve(!1), P({
|
|
1599
|
-
open: !1,
|
|
1600
|
-
parsedObject: {},
|
|
1601
|
-
fieldsToUpdate: [],
|
|
1602
|
-
newFields: [],
|
|
1603
|
-
resolve: null
|
|
1604
|
-
}));
|
|
1605
|
-
}, [N]), q = (0, X.useMemo)(() => {
|
|
1606
|
-
if (!c?.inputSchema?.properties) return {};
|
|
1607
|
-
let e = c.inputSchema || {}, t = {};
|
|
1608
|
-
for (let n of v) {
|
|
1609
|
-
let r = c.inputSchema.properties[n];
|
|
1610
|
-
if (!r) continue;
|
|
1611
|
-
let i = ke(r, e);
|
|
1612
|
-
t[n] = Ne(b.has(n) ? i === "array" ? "[]" : i === "object" ? "{}" : "" : g[n], i);
|
|
1613
|
-
}
|
|
1614
|
-
return t;
|
|
1615
|
-
}, [
|
|
1616
|
-
c,
|
|
1617
|
-
g,
|
|
1618
|
-
v,
|
|
1619
|
-
b
|
|
1620
|
-
]), { isExecuting: ue, copiedResult: fe, executeTool: J, handleCopyResult: pe, handleDeleteResult: me, handleFullscreen: _e, filteredResults: ve, cancelExecution: ye, results: be } = rt({
|
|
1621
|
-
selectedTool: c,
|
|
1622
|
-
payloadToSend: q,
|
|
1623
|
-
toolArgs: g,
|
|
1624
|
-
callTool: n,
|
|
1625
|
-
readResource: r,
|
|
1626
|
-
serverId: i
|
|
1627
|
-
}), { isSearchExpanded: Y, setIsSearchExpanded: Se, focusedIndex: Ce, searchInputRef: Te, isMobile: Oe, mobileView: Q, setMobileView: $, isRefreshing: Ae, handleSearchBlur: je, handleRefresh: Pe } = it({
|
|
1628
|
-
ref: e,
|
|
1629
|
-
activeTab: w,
|
|
1630
|
-
filteredTools: V,
|
|
1631
|
-
savedRequests: E,
|
|
1632
|
-
searchQuery: S,
|
|
1633
|
-
setSearchQuery: C,
|
|
1634
|
-
selectedTool: c,
|
|
1635
|
-
results: be,
|
|
1636
|
-
isExecuting: ue,
|
|
1637
|
-
handleToolSelect: H,
|
|
1638
|
-
loadSavedRequest: G,
|
|
1639
|
-
refreshTools: s,
|
|
1640
|
-
selectedToolName: p,
|
|
1641
|
-
tools: t,
|
|
1642
|
-
setSelectedToolName: h
|
|
1643
|
-
}), Ie = (0, X.useCallback)(() => {
|
|
1644
|
-
c && (j(""), k(!0));
|
|
1645
|
-
}, [c]), Re = (0, X.useCallback)(() => {
|
|
1646
|
-
if (!c) return;
|
|
1647
|
-
let e = {
|
|
1648
|
-
id: `${Date.now()}-${Math.random()}`,
|
|
1649
|
-
name: A.trim() || `${c.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1650
|
-
toolName: c.name,
|
|
1651
|
-
args: q,
|
|
1652
|
-
savedAt: Date.now(),
|
|
1653
|
-
serverId: c._serverId,
|
|
1654
|
-
serverName: c._serverName
|
|
1655
|
-
};
|
|
1656
|
-
D([...E, e]), he(new ge({
|
|
1657
|
-
toolName: c.name,
|
|
1658
|
-
serverId: i
|
|
1659
|
-
})).catch(() => {}), k(!1), j("");
|
|
1660
|
-
}, [
|
|
1661
|
-
c,
|
|
1662
|
-
A,
|
|
1663
|
-
q,
|
|
1664
|
-
E,
|
|
1665
|
-
D,
|
|
1666
|
-
i
|
|
1667
|
-
]), ze = (0, X.useCallback)((e) => {
|
|
1668
|
-
D(E.filter((t) => t.id !== e)), d?.id === e && f(null);
|
|
1669
|
-
}, [
|
|
1670
|
-
E,
|
|
1671
|
-
D,
|
|
1672
|
-
d
|
|
1673
|
-
]);
|
|
1674
|
-
return Oe ? /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1675
|
-
className: "h-full flex flex-col overflow-hidden relative bg-background",
|
|
1676
|
-
children: [
|
|
1677
|
-
Q !== "list" && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1678
|
-
className: "flex items-center gap-2 p-2 border-b shrink-0 bg-background z-10",
|
|
1679
|
-
children: [/* @__PURE__ */ (0, Z.jsx)(l, {
|
|
1680
|
-
variant: "ghost",
|
|
1681
|
-
size: "sm",
|
|
1682
|
-
onClick: () => {
|
|
1683
|
-
Q === "response" ? $("detail") : (u(null), $("list"));
|
|
1684
|
-
},
|
|
1685
|
-
className: "p-0 h-8 w-8",
|
|
1686
|
-
children: /* @__PURE__ */ (0, Z.jsx)(B, { className: "h-4 w-4" })
|
|
1687
|
-
}), /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1688
|
-
className: "flex items-center text-sm font-medium",
|
|
1689
|
-
children: [
|
|
1690
|
-
/* @__PURE__ */ (0, Z.jsx)("button", {
|
|
1691
|
-
onClick: () => {
|
|
1692
|
-
u(null), $("list");
|
|
1693
|
-
},
|
|
1694
|
-
className: "text-muted-foreground hover:text-foreground hover:underline cursor-pointer",
|
|
1695
|
-
children: "Tools"
|
|
1696
|
-
}),
|
|
1697
|
-
Q === "detail" && /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
1698
|
-
className: "mx-2 text-muted-foreground",
|
|
1699
|
-
children: "/"
|
|
1700
|
-
}), /* @__PURE__ */ (0, Z.jsx)("button", {
|
|
1701
|
-
onClick: () => {
|
|
1702
|
-
$("response");
|
|
1703
|
-
},
|
|
1704
|
-
className: Q === "detail" ? "text-foreground hover:underline" : Q === "response" ? "text-muted-foreground hover:text-foreground hover:underline cursor-pointer" : "text-muted-foreground",
|
|
1705
|
-
children: "Execute"
|
|
1706
|
-
})] }),
|
|
1707
|
-
Q === "response" && /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
1708
|
-
className: "mx-2 text-muted-foreground",
|
|
1709
|
-
children: "/"
|
|
1710
|
-
}), /* @__PURE__ */ (0, Z.jsx)("span", {
|
|
1711
|
-
className: "text-foreground",
|
|
1712
|
-
children: "Response"
|
|
1713
|
-
})] })
|
|
1714
|
-
]
|
|
1715
|
-
})]
|
|
1716
|
-
}),
|
|
1717
|
-
/* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1718
|
-
className: "flex-1 relative overflow-hidden",
|
|
1719
|
-
children: /* @__PURE__ */ (0, Z.jsxs)(m, {
|
|
1720
|
-
initial: !1,
|
|
1721
|
-
mode: "popLayout",
|
|
1722
|
-
children: [
|
|
1723
|
-
Q === "list" && /* @__PURE__ */ (0, Z.jsx)(o.div, {
|
|
1724
|
-
initial: { x: "-100%" },
|
|
1725
|
-
animate: { x: 0 },
|
|
1726
|
-
exit: { x: "-100%" },
|
|
1727
|
-
transition: {
|
|
1728
|
-
type: "spring",
|
|
1729
|
-
stiffness: 300,
|
|
1730
|
-
damping: 30
|
|
1731
|
-
},
|
|
1732
|
-
className: "absolute inset-0 flex flex-col bg-background z-0",
|
|
1733
|
-
children: /* @__PURE__ */ (0, Z.jsx)(W, { children: (e) => /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(we, {
|
|
1734
|
-
isScrolled: e,
|
|
1735
|
-
activeTab: w,
|
|
1736
|
-
isSearchExpanded: Y,
|
|
1737
|
-
searchQuery: S,
|
|
1738
|
-
primaryTabName: "tools",
|
|
1739
|
-
secondaryTabName: "saved",
|
|
1740
|
-
primaryTabTitle: "Tools",
|
|
1741
|
-
secondaryTabTitle: "Saved",
|
|
1742
|
-
primaryCount: V.length,
|
|
1743
|
-
secondaryCount: E.length,
|
|
1744
|
-
primaryIcon: de,
|
|
1745
|
-
secondaryIcon: F,
|
|
1746
|
-
searchPlaceholder: "Search tools...",
|
|
1747
|
-
onSearchExpand: () => Se(!0),
|
|
1748
|
-
onSearchChange: C,
|
|
1749
|
-
onSearchBlur: je,
|
|
1750
|
-
onTabSwitch: () => T(w === "tools" ? "saved" : "tools"),
|
|
1751
|
-
searchInputRef: Te,
|
|
1752
|
-
onRefresh: s ? Pe : void 0,
|
|
1753
|
-
isRefreshing: Ae
|
|
1754
|
-
}), w === "tools" ? /* @__PURE__ */ (0, Z.jsx)(Ge, {
|
|
1755
|
-
tools: V,
|
|
1756
|
-
selectedTool: c,
|
|
1757
|
-
onToolSelect: H,
|
|
1758
|
-
focusedIndex: Ce
|
|
1759
|
-
}) : /* @__PURE__ */ (0, Z.jsx)(Ee, {
|
|
1760
|
-
savedRequests: E,
|
|
1761
|
-
selectedRequest: d,
|
|
1762
|
-
onLoadRequest: G,
|
|
1763
|
-
onDeleteRequest: ze,
|
|
1764
|
-
focusedIndex: Ce
|
|
1765
|
-
})] }) })
|
|
1766
|
-
}, "list"),
|
|
1767
|
-
Q === "detail" && /* @__PURE__ */ (0, Z.jsx)(o.div, {
|
|
1768
|
-
initial: { x: "100%" },
|
|
1769
|
-
animate: { x: 0 },
|
|
1770
|
-
exit: { x: "-100%" },
|
|
1771
|
-
transition: {
|
|
1772
|
-
type: "spring",
|
|
1773
|
-
stiffness: 300,
|
|
1774
|
-
damping: 30
|
|
1775
|
-
},
|
|
1776
|
-
className: "absolute inset-0 bg-background z-10",
|
|
1777
|
-
children: /* @__PURE__ */ (0, Z.jsx)(Le, {
|
|
1778
|
-
selectedTool: c,
|
|
1779
|
-
toolArgs: g,
|
|
1780
|
-
payloadToSend: q,
|
|
1781
|
-
isExecuting: ue,
|
|
1782
|
-
isConnected: a,
|
|
1783
|
-
onArgChange: K,
|
|
1784
|
-
onExecute: J,
|
|
1785
|
-
onSave: Ie,
|
|
1786
|
-
onBulkPaste: oe,
|
|
1787
|
-
autoFilledFields: I,
|
|
1788
|
-
setFields: v,
|
|
1789
|
-
sendEmptyFields: b,
|
|
1790
|
-
onToggleEmpty: ae
|
|
1791
|
-
})
|
|
1792
|
-
}, "detail"),
|
|
1793
|
-
Q === "response" && /* @__PURE__ */ (0, Z.jsx)(o.div, {
|
|
1794
|
-
initial: { x: "100%" },
|
|
1795
|
-
animate: { x: 0 },
|
|
1796
|
-
exit: { x: "100%" },
|
|
1797
|
-
transition: {
|
|
1798
|
-
type: "spring",
|
|
1799
|
-
stiffness: 300,
|
|
1800
|
-
damping: 30
|
|
1801
|
-
},
|
|
1802
|
-
className: "absolute inset-0 bg-background z-20",
|
|
1803
|
-
children: /* @__PURE__ */ (0, Z.jsx)(We, {
|
|
1804
|
-
results: ve,
|
|
1805
|
-
copiedResult: fe,
|
|
1806
|
-
serverId: i,
|
|
1807
|
-
readResource: r,
|
|
1808
|
-
onCopy: pe,
|
|
1809
|
-
onDelete: me,
|
|
1810
|
-
onFullscreen: _e,
|
|
1811
|
-
onRerunTool: J
|
|
1812
|
-
})
|
|
1813
|
-
}, "response")
|
|
1814
|
-
]
|
|
1815
|
-
})
|
|
1816
|
-
}),
|
|
1817
|
-
/* @__PURE__ */ (0, Z.jsx)(De, {
|
|
1818
|
-
isOpen: O,
|
|
1819
|
-
requestName: A,
|
|
1820
|
-
defaultPlaceholder: `${c?.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1821
|
-
onRequestNameChange: j,
|
|
1822
|
-
onSave: Re,
|
|
1823
|
-
onCancel: () => k(!1)
|
|
1824
|
-
}),
|
|
1825
|
-
/* @__PURE__ */ (0, Z.jsx)(qe, {
|
|
1826
|
-
open: N.open,
|
|
1827
|
-
onOpenChange: (e) => {
|
|
1828
|
-
e || ce();
|
|
1829
|
-
},
|
|
1830
|
-
children: /* @__PURE__ */ (0, Z.jsxs)(Xe, { children: [/* @__PURE__ */ (0, Z.jsxs)(Ze, { children: [/* @__PURE__ */ (0, Z.jsx)($e, { children: "Auto-fill fields from pasted object?" }), /* @__PURE__ */ (0, Z.jsxs)(et, { children: [N.fieldsToUpdate.length > 0 && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1831
|
-
className: "mb-3",
|
|
1832
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1833
|
-
className: "font-medium mb-2",
|
|
1834
|
-
children: "The following fields will be updated:"
|
|
1835
|
-
}), /* @__PURE__ */ (0, Z.jsx)("ul", {
|
|
1836
|
-
className: "text-sm space-y-1 max-h-[200px] overflow-y-auto",
|
|
1837
|
-
children: N.fieldsToUpdate.map(({ key: e, oldValue: t, newValue: n }) => /* @__PURE__ */ (0, Z.jsxs)("li", {
|
|
1838
|
-
className: "font-mono",
|
|
1839
|
-
children: [
|
|
1840
|
-
/* @__PURE__ */ (0, Z.jsxs)("span", {
|
|
1841
|
-
className: "font-semibold",
|
|
1842
|
-
children: [e, ":"]
|
|
1843
|
-
}),
|
|
1844
|
-
" ",
|
|
1845
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
1846
|
-
className: "text-red-600 dark:text-red-400 line-through",
|
|
1847
|
-
children: typeof t == "object" ? JSON.stringify(t).substring(0, 30) + "..." : String(t).substring(0, 30)
|
|
1848
|
-
}),
|
|
1849
|
-
" ",
|
|
1850
|
-
"→",
|
|
1851
|
-
" ",
|
|
1852
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
1853
|
-
className: "text-green-600 dark:text-green-400",
|
|
1854
|
-
children: typeof n == "string" && n.length > 30 ? n.substring(0, 30) + "..." : String(n).substring(0, 30)
|
|
1855
|
-
})
|
|
1856
|
-
]
|
|
1857
|
-
}, e))
|
|
1858
|
-
})]
|
|
1859
|
-
}), N.newFields.length > 0 && /* @__PURE__ */ (0, Z.jsxs)("div", { children: [/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1860
|
-
className: "font-medium mb-1",
|
|
1861
|
-
children: "New fields to be filled:"
|
|
1862
|
-
}), /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1863
|
-
className: "text-sm font-mono",
|
|
1864
|
-
children: N.newFields.join(", ")
|
|
1865
|
-
})] })] })] }), /* @__PURE__ */ (0, Z.jsxs)(Qe, { children: [/* @__PURE__ */ (0, Z.jsx)(nt, {
|
|
1866
|
-
onClick: ce,
|
|
1867
|
-
children: "Cancel"
|
|
1868
|
-
}), /* @__PURE__ */ (0, Z.jsx)(tt, {
|
|
1869
|
-
onClick: se,
|
|
1870
|
-
children: "Auto-fill"
|
|
1871
|
-
})] })] })
|
|
1872
|
-
})
|
|
1873
|
-
]
|
|
1874
|
-
}) : /* @__PURE__ */ (0, Z.jsxs)(re, {
|
|
1875
|
-
orientation: "horizontal",
|
|
1876
|
-
className: "h-full",
|
|
1877
|
-
children: [
|
|
1878
|
-
/* @__PURE__ */ (0, Z.jsx)(U, {
|
|
1879
|
-
id: "left-panel",
|
|
1880
|
-
defaultSize: "33%",
|
|
1881
|
-
minSize: 250,
|
|
1882
|
-
collapsedSize: 0,
|
|
1883
|
-
collapsible: !0,
|
|
1884
|
-
className: "flex flex-col h-full relative",
|
|
1885
|
-
panelRef: R,
|
|
1886
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1887
|
-
className: "flex h-full flex-col overflow-hidden border-r dark:border-zinc-700",
|
|
1888
|
-
children: /* @__PURE__ */ (0, Z.jsx)(W, { children: (e) => /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(we, {
|
|
1889
|
-
isScrolled: e,
|
|
1890
|
-
activeTab: w,
|
|
1891
|
-
isSearchExpanded: Y,
|
|
1892
|
-
searchQuery: S,
|
|
1893
|
-
primaryTabName: "tools",
|
|
1894
|
-
secondaryTabName: "saved",
|
|
1895
|
-
primaryTabTitle: "Tools",
|
|
1896
|
-
secondaryTabTitle: "Saved",
|
|
1897
|
-
primaryCount: V.length,
|
|
1898
|
-
secondaryCount: E.length,
|
|
1899
|
-
primaryIcon: de,
|
|
1900
|
-
secondaryIcon: F,
|
|
1901
|
-
searchPlaceholder: "Search tools...",
|
|
1902
|
-
onSearchExpand: () => Se(!0),
|
|
1903
|
-
onSearchChange: C,
|
|
1904
|
-
onSearchBlur: je,
|
|
1905
|
-
onTabSwitch: () => T(w === "tools" ? "saved" : "tools"),
|
|
1906
|
-
searchInputRef: Te,
|
|
1907
|
-
onRefresh: s ? Pe : void 0,
|
|
1908
|
-
isRefreshing: Ae
|
|
1909
|
-
}), w === "tools" ? /* @__PURE__ */ (0, Z.jsx)(Ge, {
|
|
1910
|
-
tools: V,
|
|
1911
|
-
selectedTool: c,
|
|
1912
|
-
onToolSelect: H,
|
|
1913
|
-
focusedIndex: Ce
|
|
1914
|
-
}) : /* @__PURE__ */ (0, Z.jsx)(Ee, {
|
|
1915
|
-
savedRequests: E,
|
|
1916
|
-
selectedRequest: d,
|
|
1917
|
-
onLoadRequest: G,
|
|
1918
|
-
onDeleteRequest: ze,
|
|
1919
|
-
focusedIndex: Ce
|
|
1920
|
-
})] }) })
|
|
1921
|
-
})
|
|
1922
|
-
}),
|
|
1923
|
-
/* @__PURE__ */ (0, Z.jsx)(ne, { withHandle: !0 }),
|
|
1924
|
-
/* @__PURE__ */ (0, Z.jsx)(U, {
|
|
1925
|
-
defaultSize: "67%",
|
|
1926
|
-
children: /* @__PURE__ */ (0, Z.jsxs)(re, {
|
|
1927
|
-
orientation: "vertical",
|
|
1928
|
-
children: [
|
|
1929
|
-
/* @__PURE__ */ (0, Z.jsx)(U, {
|
|
1930
|
-
defaultSize: "40%",
|
|
1931
|
-
collapsible: !0,
|
|
1932
|
-
panelRef: z,
|
|
1933
|
-
children: /* @__PURE__ */ (0, Z.jsx)(Le, {
|
|
1934
|
-
selectedTool: c,
|
|
1935
|
-
toolArgs: g,
|
|
1936
|
-
payloadToSend: q,
|
|
1937
|
-
isExecuting: ue,
|
|
1938
|
-
isConnected: a,
|
|
1939
|
-
onArgChange: K,
|
|
1940
|
-
onExecute: J,
|
|
1941
|
-
onSave: Ie,
|
|
1942
|
-
onCancel: ye,
|
|
1943
|
-
onBulkPaste: oe,
|
|
1944
|
-
autoFilledFields: I,
|
|
1945
|
-
setFields: v,
|
|
1946
|
-
sendEmptyFields: b,
|
|
1947
|
-
onToggleEmpty: ae
|
|
1948
|
-
})
|
|
1949
|
-
}),
|
|
1950
|
-
/* @__PURE__ */ (0, Z.jsx)(ne, { withHandle: !0 }),
|
|
1951
|
-
/* @__PURE__ */ (0, Z.jsx)(U, {
|
|
1952
|
-
defaultSize: "60%",
|
|
1953
|
-
children: /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
1954
|
-
className: "flex flex-col h-full",
|
|
1955
|
-
children: /* @__PURE__ */ (0, Z.jsx)(We, {
|
|
1956
|
-
results: ve,
|
|
1957
|
-
copiedResult: fe,
|
|
1958
|
-
serverId: i,
|
|
1959
|
-
readResource: r,
|
|
1960
|
-
onCopy: pe,
|
|
1961
|
-
onDelete: me,
|
|
1962
|
-
onFullscreen: _e,
|
|
1963
|
-
onMaximize: te,
|
|
1964
|
-
isMaximized: M,
|
|
1965
|
-
onRerunTool: J
|
|
1966
|
-
})
|
|
1967
|
-
})
|
|
1968
|
-
})
|
|
1969
|
-
]
|
|
1970
|
-
})
|
|
1971
|
-
}),
|
|
1972
|
-
/* @__PURE__ */ (0, Z.jsx)(De, {
|
|
1973
|
-
isOpen: O,
|
|
1974
|
-
requestName: A,
|
|
1975
|
-
defaultPlaceholder: `${c?.name} - ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
1976
|
-
onRequestNameChange: j,
|
|
1977
|
-
onSave: Re,
|
|
1978
|
-
onCancel: () => k(!1)
|
|
1979
|
-
}),
|
|
1980
|
-
/* @__PURE__ */ (0, Z.jsx)(qe, {
|
|
1981
|
-
open: N.open,
|
|
1982
|
-
onOpenChange: (e) => {
|
|
1983
|
-
e || ce();
|
|
1984
|
-
},
|
|
1985
|
-
children: /* @__PURE__ */ (0, Z.jsxs)(Xe, { children: [/* @__PURE__ */ (0, Z.jsxs)(Ze, { children: [/* @__PURE__ */ (0, Z.jsx)($e, { children: "Auto-fill fields from pasted object?" }), /* @__PURE__ */ (0, Z.jsxs)(et, { children: [N.fieldsToUpdate.length > 0 && /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
1986
|
-
className: "mb-3",
|
|
1987
|
-
children: [/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
1988
|
-
className: "font-medium mb-2",
|
|
1989
|
-
children: "The following fields will be updated:"
|
|
1990
|
-
}), /* @__PURE__ */ (0, Z.jsx)("ul", {
|
|
1991
|
-
className: "text-sm space-y-1 max-h-[200px] overflow-y-auto",
|
|
1992
|
-
children: N.fieldsToUpdate.map(({ key: e, oldValue: t, newValue: n }) => /* @__PURE__ */ (0, Z.jsxs)("li", {
|
|
1993
|
-
className: "font-mono",
|
|
1994
|
-
children: [
|
|
1995
|
-
/* @__PURE__ */ (0, Z.jsxs)("span", {
|
|
1996
|
-
className: "font-semibold",
|
|
1997
|
-
children: [e, ":"]
|
|
1998
|
-
}),
|
|
1999
|
-
" ",
|
|
2000
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
2001
|
-
className: "text-red-600 dark:text-red-400 line-through",
|
|
2002
|
-
children: typeof t == "object" ? JSON.stringify(t).substring(0, 30) + "..." : String(t).substring(0, 30)
|
|
2003
|
-
}),
|
|
2004
|
-
" ",
|
|
2005
|
-
"→",
|
|
2006
|
-
" ",
|
|
2007
|
-
/* @__PURE__ */ (0, Z.jsx)("span", {
|
|
2008
|
-
className: "text-green-600 dark:text-green-400",
|
|
2009
|
-
children: typeof n == "string" && n.length > 30 ? n.substring(0, 30) + "..." : String(n).substring(0, 30)
|
|
2010
|
-
})
|
|
2011
|
-
]
|
|
2012
|
-
}, e))
|
|
2013
|
-
})]
|
|
2014
|
-
}), N.newFields.length > 0 && /* @__PURE__ */ (0, Z.jsxs)("div", { children: [/* @__PURE__ */ (0, Z.jsx)("p", {
|
|
2015
|
-
className: "font-medium mb-1",
|
|
2016
|
-
children: "New fields to be filled:"
|
|
2017
|
-
}), /* @__PURE__ */ (0, Z.jsx)("p", {
|
|
2018
|
-
className: "text-sm font-mono",
|
|
2019
|
-
children: N.newFields.join(", ")
|
|
2020
|
-
})] })] })] }), /* @__PURE__ */ (0, Z.jsxs)(Qe, { children: [/* @__PURE__ */ (0, Z.jsx)(nt, {
|
|
2021
|
-
onClick: ce,
|
|
2022
|
-
children: "Cancel"
|
|
2023
|
-
}), /* @__PURE__ */ (0, Z.jsx)(tt, {
|
|
2024
|
-
onClick: se,
|
|
2025
|
-
children: "Auto-fill"
|
|
2026
|
-
})] })] })
|
|
2027
|
-
})
|
|
2028
|
-
]
|
|
2029
|
-
});
|
|
2030
|
-
}
|
|
2031
|
-
at.displayName = "ToolsTab";
|
|
2032
|
-
//#endregion
|
|
2033
|
-
export { at as ToolsTab };
|