@mcp-use/inspector 20.0.0-beta.4 → 20.0.0-beta.40
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,2210 +0,0 @@
|
|
|
1
|
-
import { s as e, t } from "./react-BIs9pQ3H.js";
|
|
2
|
-
import { G as n, K as r, Rr as i, a, n as o, r as s, sr as c, t as l } from "./input-C2OBd4PJ.js";
|
|
3
|
-
import { t as u } from "./jsx-runtime-CIxvMpEo.js";
|
|
4
|
-
import { _ as d, a as f, c as p, d as m, i as h, l as g, n as _, o as v, s as y, t as b, u as x, v as S } from "./sheet-Br_l2kry.js";
|
|
5
|
-
import { t as C } from "./label-B9Jmm9be.js";
|
|
6
|
-
import { a as w, i as T, n as E, r as D, t as O } from "./select-DDdiIPR2.js";
|
|
7
|
-
import { t as k } from "./createLucideIcon-C5fZZ6oB.js";
|
|
8
|
-
import { A, E as j, S as M, T as N, a as P, b as F, c as ee, i as I, l as te, n as ne, o as re, r as ie, s as ae, t as oe, w as L } from "./dialog-BsDpuJd3.js";
|
|
9
|
-
import { i as se, t as ce } from "./browser-CbQIH4w2.js";
|
|
10
|
-
import { t as le } from "./clock-CmUbSx_B.js";
|
|
11
|
-
import { t as ue } from "./JSONDisplay-BFxf5oEu.js";
|
|
12
|
-
import { t as de } from "./loader-circle-BLy9A_pp.js";
|
|
13
|
-
import { t as fe } from "./maximize-2-CH5Lq90B.js";
|
|
14
|
-
import { t as pe } from "./sparkles-BntO2rDR.js";
|
|
15
|
-
import { t as me } from "./trash-2-RwpJY5SL.js";
|
|
16
|
-
import { t as he } from "./x-C3vRQIYu.js";
|
|
17
|
-
import { t as ge } from "./switch-C3IyQuid.js";
|
|
18
|
-
import { n as R } from "./dist-DaMB0Su9.js";
|
|
19
|
-
import { r as _e, s as ve } from "./WidgetDebugContext-D4usL_MA.js";
|
|
20
|
-
import { a as z } from "./dist-3QLh0dt8.js";
|
|
21
|
-
import { t as B } from "./textarea-DSbwcFVt.js";
|
|
22
|
-
import { a as ye, i as be, n as xe, o as Se, r as Ce } from "./useViewHostProps-ru80AnlT.js";
|
|
23
|
-
var we = k("braces", [["path", {
|
|
24
|
-
d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",
|
|
25
|
-
key: "ezmyqa"
|
|
26
|
-
}], ["path", {
|
|
27
|
-
d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
|
|
28
|
-
key: "e1hn23"
|
|
29
|
-
}]]), Te = k("database", [
|
|
30
|
-
["ellipse", {
|
|
31
|
-
cx: "12",
|
|
32
|
-
cy: "5",
|
|
33
|
-
rx: "9",
|
|
34
|
-
ry: "3",
|
|
35
|
-
key: "msslwz"
|
|
36
|
-
}],
|
|
37
|
-
["path", {
|
|
38
|
-
d: "M3 5V19A9 3 0 0 0 21 19V5",
|
|
39
|
-
key: "1wlel7"
|
|
40
|
-
}],
|
|
41
|
-
["path", {
|
|
42
|
-
d: "M3 12A9 3 0 0 0 21 12",
|
|
43
|
-
key: "mv7ke4"
|
|
44
|
-
}]
|
|
45
|
-
]), Ee = k("mouse-pointer-2", [["path", {
|
|
46
|
-
d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",
|
|
47
|
-
key: "edeuup"
|
|
48
|
-
}]]), De = k("picture-in-picture", [
|
|
49
|
-
["path", {
|
|
50
|
-
d: "M2 10h6V4",
|
|
51
|
-
key: "zwrco"
|
|
52
|
-
}],
|
|
53
|
-
["path", {
|
|
54
|
-
d: "m2 4 6 6",
|
|
55
|
-
key: "ug085t"
|
|
56
|
-
}],
|
|
57
|
-
["path", {
|
|
58
|
-
d: "M21 10V7a2 2 0 0 0-2-2h-7",
|
|
59
|
-
key: "git5jr"
|
|
60
|
-
}],
|
|
61
|
-
["path", {
|
|
62
|
-
d: "M3 14v2a2 2 0 0 0 2 2h3",
|
|
63
|
-
key: "1f7fh3"
|
|
64
|
-
}],
|
|
65
|
-
["rect", {
|
|
66
|
-
x: "12",
|
|
67
|
-
y: "14",
|
|
68
|
-
width: "10",
|
|
69
|
-
height: "7",
|
|
70
|
-
rx: "1",
|
|
71
|
-
key: "1wjs3o"
|
|
72
|
-
}]
|
|
73
|
-
]), Oe = k("pointer", [
|
|
74
|
-
["path", {
|
|
75
|
-
d: "M22 14a8 8 0 0 1-8 8",
|
|
76
|
-
key: "56vcr3"
|
|
77
|
-
}],
|
|
78
|
-
["path", {
|
|
79
|
-
d: "M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2",
|
|
80
|
-
key: "1agjmk"
|
|
81
|
-
}],
|
|
82
|
-
["path", {
|
|
83
|
-
d: "M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1",
|
|
84
|
-
key: "wdbh2u"
|
|
85
|
-
}],
|
|
86
|
-
["path", {
|
|
87
|
-
d: "M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10",
|
|
88
|
-
key: "1ibuk9"
|
|
89
|
-
}],
|
|
90
|
-
["path", {
|
|
91
|
-
d: "M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",
|
|
92
|
-
key: "g6ys72"
|
|
93
|
-
}]
|
|
94
|
-
]), ke = k("shield-check", [["path", {
|
|
95
|
-
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
96
|
-
key: "oel41y"
|
|
97
|
-
}], ["path", {
|
|
98
|
-
d: "m9 12 2 2 4-4",
|
|
99
|
-
key: "dzmm74"
|
|
100
|
-
}]]), Ae = k("shield-off", [
|
|
101
|
-
["path", {
|
|
102
|
-
d: "m2 2 20 20",
|
|
103
|
-
key: "1ooewy"
|
|
104
|
-
}],
|
|
105
|
-
["path", {
|
|
106
|
-
d: "M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",
|
|
107
|
-
key: "1jlk70"
|
|
108
|
-
}],
|
|
109
|
-
["path", {
|
|
110
|
-
d: "M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",
|
|
111
|
-
key: "18rp1v"
|
|
112
|
-
}]
|
|
113
|
-
]), je = k("smartphone", [["rect", {
|
|
114
|
-
width: "14",
|
|
115
|
-
height: "20",
|
|
116
|
-
x: "5",
|
|
117
|
-
y: "2",
|
|
118
|
-
rx: "2",
|
|
119
|
-
ry: "2",
|
|
120
|
-
key: "1yt0o3"
|
|
121
|
-
}], ["path", {
|
|
122
|
-
d: "M12 18h.01",
|
|
123
|
-
key: "mhygvu"
|
|
124
|
-
}]]), Me = k("square-dashed-mouse-pointer", [
|
|
125
|
-
["path", {
|
|
126
|
-
d: "M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",
|
|
127
|
-
key: "xwnzip"
|
|
128
|
-
}],
|
|
129
|
-
["path", {
|
|
130
|
-
d: "M5 3a2 2 0 0 0-2 2",
|
|
131
|
-
key: "y57alp"
|
|
132
|
-
}],
|
|
133
|
-
["path", {
|
|
134
|
-
d: "M19 3a2 2 0 0 1 2 2",
|
|
135
|
-
key: "18rm91"
|
|
136
|
-
}],
|
|
137
|
-
["path", {
|
|
138
|
-
d: "M5 21a2 2 0 0 1-2-2",
|
|
139
|
-
key: "sbafld"
|
|
140
|
-
}],
|
|
141
|
-
["path", {
|
|
142
|
-
d: "M9 3h1",
|
|
143
|
-
key: "1yesri"
|
|
144
|
-
}],
|
|
145
|
-
["path", {
|
|
146
|
-
d: "M9 21h2",
|
|
147
|
-
key: "1qve2z"
|
|
148
|
-
}],
|
|
149
|
-
["path", {
|
|
150
|
-
d: "M14 3h1",
|
|
151
|
-
key: "1ec4yj"
|
|
152
|
-
}],
|
|
153
|
-
["path", {
|
|
154
|
-
d: "M3 9v1",
|
|
155
|
-
key: "1r0deq"
|
|
156
|
-
}],
|
|
157
|
-
["path", {
|
|
158
|
-
d: "M21 9v2",
|
|
159
|
-
key: "p14lih"
|
|
160
|
-
}],
|
|
161
|
-
["path", {
|
|
162
|
-
d: "M3 14v1",
|
|
163
|
-
key: "vnatye"
|
|
164
|
-
}]
|
|
165
|
-
]), Ne = k("tablet", [["rect", {
|
|
166
|
-
width: "16",
|
|
167
|
-
height: "20",
|
|
168
|
-
x: "4",
|
|
169
|
-
y: "2",
|
|
170
|
-
rx: "2",
|
|
171
|
-
ry: "2",
|
|
172
|
-
key: "76otgf"
|
|
173
|
-
}], ["line", {
|
|
174
|
-
x1: "12",
|
|
175
|
-
x2: "12.01",
|
|
176
|
-
y1: "18",
|
|
177
|
-
y2: "18",
|
|
178
|
-
key: "1dp563"
|
|
179
|
-
}]]), V = k("terminal", [["path", {
|
|
180
|
-
d: "M12 19h8",
|
|
181
|
-
key: "baeox8"
|
|
182
|
-
}], ["path", {
|
|
183
|
-
d: "m4 17 6-6-6-6",
|
|
184
|
-
key: "1yngyt"
|
|
185
|
-
}]]), Pe = k("trash", [
|
|
186
|
-
["path", {
|
|
187
|
-
d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
|
|
188
|
-
key: "miytrc"
|
|
189
|
-
}],
|
|
190
|
-
["path", {
|
|
191
|
-
d: "M3 6h18",
|
|
192
|
-
key: "d0wm0j"
|
|
193
|
-
}],
|
|
194
|
-
["path", {
|
|
195
|
-
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
196
|
-
key: "e791ji"
|
|
197
|
-
}]
|
|
198
|
-
]), H = /* @__PURE__ */ e(t(), 1), Fe = [
|
|
199
|
-
{
|
|
200
|
-
value: "en-US",
|
|
201
|
-
label: "English (US)"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
value: "en-GB",
|
|
205
|
-
label: "English (UK)"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
value: "en-CA",
|
|
209
|
-
label: "English (Canada)"
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
value: "en-AU",
|
|
213
|
-
label: "English (Australia)"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
value: "en-IN",
|
|
217
|
-
label: "English (India)"
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
value: "es-ES",
|
|
221
|
-
label: "Spanish (Spain)"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
value: "es-MX",
|
|
225
|
-
label: "Spanish (Mexico)"
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
value: "es-AR",
|
|
229
|
-
label: "Spanish (Argentina)"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
value: "es-CO",
|
|
233
|
-
label: "Spanish (Colombia)"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
value: "fr-FR",
|
|
237
|
-
label: "French (France)"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
value: "fr-CA",
|
|
241
|
-
label: "French (Canada)"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
value: "fr-BE",
|
|
245
|
-
label: "French (Belgium)"
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
value: "fr-CH",
|
|
249
|
-
label: "French (Switzerland)"
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
value: "de-DE",
|
|
253
|
-
label: "German (Germany)"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
value: "de-AT",
|
|
257
|
-
label: "German (Austria)"
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
value: "de-CH",
|
|
261
|
-
label: "German (Switzerland)"
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
value: "pt-BR",
|
|
265
|
-
label: "Portuguese (Brazil)"
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
value: "pt-PT",
|
|
269
|
-
label: "Portuguese (Portugal)"
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
value: "zh-CN",
|
|
273
|
-
label: "Chinese (Simplified, China)"
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
value: "zh-TW",
|
|
277
|
-
label: "Chinese (Traditional, Taiwan)"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
value: "zh-HK",
|
|
281
|
-
label: "Chinese (Traditional, Hong Kong)"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
value: "ja-JP",
|
|
285
|
-
label: "Japanese (Japan)"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
value: "ko-KR",
|
|
289
|
-
label: "Korean (Korea)"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
value: "ar-SA",
|
|
293
|
-
label: "Arabic (Saudi Arabia)"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
value: "ar-EG",
|
|
297
|
-
label: "Arabic (Egypt)"
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
value: "hi-IN",
|
|
301
|
-
label: "Hindi (India)"
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
value: "ru-RU",
|
|
305
|
-
label: "Russian (Russia)"
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
value: "it-IT",
|
|
309
|
-
label: "Italian (Italy)"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
value: "nl-NL",
|
|
313
|
-
label: "Dutch (Netherlands)"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
value: "nl-BE",
|
|
317
|
-
label: "Dutch (Belgium)"
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
value: "pl-PL",
|
|
321
|
-
label: "Polish (Poland)"
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
value: "sv-SE",
|
|
325
|
-
label: "Swedish (Sweden)"
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
value: "no-NO",
|
|
329
|
-
label: "Norwegian (Norway)"
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
value: "da-DK",
|
|
333
|
-
label: "Danish (Denmark)"
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
value: "fi-FI",
|
|
337
|
-
label: "Finnish (Finland)"
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
value: "tr-TR",
|
|
341
|
-
label: "Turkish (Turkey)"
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
value: "el-GR",
|
|
345
|
-
label: "Greek (Greece)"
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
value: "cs-CZ",
|
|
349
|
-
label: "Czech (Czech Republic)"
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
value: "hu-HU",
|
|
353
|
-
label: "Hungarian (Hungary)"
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
value: "ro-RO",
|
|
357
|
-
label: "Romanian (Romania)"
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
value: "th-TH",
|
|
361
|
-
label: "Thai (Thailand)"
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
value: "vi-VN",
|
|
365
|
-
label: "Vietnamese (Vietnam)"
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
value: "id-ID",
|
|
369
|
-
label: "Indonesian (Indonesia)"
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
value: "ms-MY",
|
|
373
|
-
label: "Malay (Malaysia)"
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
value: "tl-PH",
|
|
377
|
-
label: "Tagalog (Philippines)"
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
value: "he-IL",
|
|
381
|
-
label: "Hebrew (Israel)"
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
value: "uk-UA",
|
|
385
|
-
label: "Ukrainian (Ukraine)"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
value: "bg-BG",
|
|
389
|
-
label: "Bulgarian (Bulgaria)"
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
value: "hr-HR",
|
|
393
|
-
label: "Croatian (Croatia)"
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
value: "sk-SK",
|
|
397
|
-
label: "Slovak (Slovakia)"
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
value: "sl-SI",
|
|
401
|
-
label: "Slovenian (Slovenia)"
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
value: "sr-RS",
|
|
405
|
-
label: "Serbian (Serbia)"
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
value: "bn-BD",
|
|
409
|
-
label: "Bengali (Bangladesh)"
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
value: "ta-IN",
|
|
413
|
-
label: "Tamil (India)"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
value: "te-IN",
|
|
417
|
-
label: "Telugu (India)"
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
value: "mr-IN",
|
|
421
|
-
label: "Marathi (India)"
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
value: "ur-PK",
|
|
425
|
-
label: "Urdu (Pakistan)"
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
value: "fa-IR",
|
|
429
|
-
label: "Persian (Iran)"
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
value: "sw-KE",
|
|
433
|
-
label: "Swahili (Kenya)"
|
|
434
|
-
}
|
|
435
|
-
];
|
|
436
|
-
function Ie() {
|
|
437
|
-
return Intl.supportedValuesOf("timeZone").map((e) => ({
|
|
438
|
-
value: e,
|
|
439
|
-
label: e.replace(/_/g, " ")
|
|
440
|
-
}));
|
|
441
|
-
}
|
|
442
|
-
var Le = Ie(), U = (e) => `mcp-inspector-resource-props-${e}`;
|
|
443
|
-
function Re(e) {
|
|
444
|
-
let [t, n] = (0, H.useState)([]), [r, i] = (0, H.useState)(null);
|
|
445
|
-
return (0, H.useEffect)(() => {
|
|
446
|
-
(() => {
|
|
447
|
-
try {
|
|
448
|
-
let t = U(e), r = localStorage.getItem(t);
|
|
449
|
-
if (r) {
|
|
450
|
-
let e = JSON.parse(r);
|
|
451
|
-
n(e.presets || []), i(e.activePresetId || null);
|
|
452
|
-
} else n([]), i(null);
|
|
453
|
-
} catch (e) {
|
|
454
|
-
console.error("[useResourceProps] Failed to load presets:", e), n([]), i(null);
|
|
455
|
-
}
|
|
456
|
-
})();
|
|
457
|
-
}, [e]), (0, H.useEffect)(() => {
|
|
458
|
-
let n = U(e), i = {
|
|
459
|
-
presets: t,
|
|
460
|
-
activePresetId: r
|
|
461
|
-
};
|
|
462
|
-
localStorage.setItem(n, JSON.stringify(i));
|
|
463
|
-
}, [
|
|
464
|
-
e,
|
|
465
|
-
t,
|
|
466
|
-
r
|
|
467
|
-
]), {
|
|
468
|
-
presets: t,
|
|
469
|
-
activePresetId: r,
|
|
470
|
-
savePreset: (0, H.useCallback)((e) => {
|
|
471
|
-
n((t) => {
|
|
472
|
-
let n = t.findIndex((t) => t.id === e.id), r;
|
|
473
|
-
return n >= 0 ? (r = [...t], r[n] = e) : r = [...t, e], r;
|
|
474
|
-
});
|
|
475
|
-
}, []),
|
|
476
|
-
deletePreset: (0, H.useCallback)((e) => {
|
|
477
|
-
n((t) => t.filter((t) => t.id !== e)), i((t) => t === e ? null : t);
|
|
478
|
-
}, []),
|
|
479
|
-
setActivePreset: (0, H.useCallback)((e) => {
|
|
480
|
-
i(e);
|
|
481
|
-
}, []),
|
|
482
|
-
getActiveProps: (0, H.useCallback)(() => r && t.find((e) => e.id === r)?.props || null, [r, t])
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
//#endregion
|
|
486
|
-
//#region src/client/hooks/useIframeConsole.ts
|
|
487
|
-
function W(e = {}) {
|
|
488
|
-
let { enabled: t = !0, maxLogs: n = 1e3, proxyToPageConsole: r = !1 } = e, [i, a] = (0, H.useState)([]), [o, s] = (0, H.useState)(!1), c = (0, H.useRef)(0), l = (0, H.useCallback)((e) => {
|
|
489
|
-
if (!t) return;
|
|
490
|
-
let i = {
|
|
491
|
-
...e,
|
|
492
|
-
id: `log-${++c.current}-${Date.now()}`
|
|
493
|
-
};
|
|
494
|
-
if (a((e) => [...e, i].slice(-n)), r) {
|
|
495
|
-
let t = "[WIDGET CONSOLE]", n = e.args.map((e) => {
|
|
496
|
-
if (typeof e == "object" && e) try {
|
|
497
|
-
return JSON.stringify(e, null, 2);
|
|
498
|
-
} catch {
|
|
499
|
-
return String(e);
|
|
500
|
-
}
|
|
501
|
-
return e;
|
|
502
|
-
});
|
|
503
|
-
switch (e.level) {
|
|
504
|
-
case "error":
|
|
505
|
-
console.error(t, ...n);
|
|
506
|
-
break;
|
|
507
|
-
case "warn":
|
|
508
|
-
console.warn(t, ...n);
|
|
509
|
-
break;
|
|
510
|
-
case "info":
|
|
511
|
-
console.info(t, ...n);
|
|
512
|
-
break;
|
|
513
|
-
case "debug":
|
|
514
|
-
console.debug(t, ...n);
|
|
515
|
-
break;
|
|
516
|
-
case "trace":
|
|
517
|
-
console.trace(t, ...n);
|
|
518
|
-
break;
|
|
519
|
-
default: console.log(t, ...n);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}, [
|
|
523
|
-
t,
|
|
524
|
-
n,
|
|
525
|
-
r
|
|
526
|
-
]), u = (0, H.useCallback)(() => {
|
|
527
|
-
a([]), c.current = 0;
|
|
528
|
-
}, []);
|
|
529
|
-
return (0, H.useEffect)(() => {
|
|
530
|
-
if (!t) return;
|
|
531
|
-
let e = (e) => {
|
|
532
|
-
e.data && e.data.type === "iframe-console-log" && e.data.level && Array.isArray(e.data.args) && l({
|
|
533
|
-
level: e.data.level,
|
|
534
|
-
args: e.data.args,
|
|
535
|
-
timestamp: e.data.timestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
536
|
-
url: e.data.url
|
|
537
|
-
});
|
|
538
|
-
};
|
|
539
|
-
return window.addEventListener("message", e), () => {
|
|
540
|
-
window.removeEventListener("message", e);
|
|
541
|
-
};
|
|
542
|
-
}, [t, l]), (0, H.useEffect)(() => {
|
|
543
|
-
if (t) return Se.subscribe(l);
|
|
544
|
-
}, [t, l]), {
|
|
545
|
-
logs: i,
|
|
546
|
-
addLog: l,
|
|
547
|
-
clearLogs: u,
|
|
548
|
-
isOpen: o,
|
|
549
|
-
setIsOpen: s
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
//#endregion
|
|
553
|
-
//#region src/client/components/IframeConsole.tsx
|
|
554
|
-
var G = u(), ze = 200, Be = .9;
|
|
555
|
-
function K(e) {
|
|
556
|
-
if (e === null) return "null";
|
|
557
|
-
if (e === void 0) return "undefined";
|
|
558
|
-
if (typeof e == "string") return e;
|
|
559
|
-
if (typeof e == "object") try {
|
|
560
|
-
return JSON.stringify(e, null, 2);
|
|
561
|
-
} catch {
|
|
562
|
-
return String(e);
|
|
563
|
-
}
|
|
564
|
-
return String(e);
|
|
565
|
-
}
|
|
566
|
-
function q(e) {
|
|
567
|
-
if (e.length === 0) return [];
|
|
568
|
-
let t = e[0];
|
|
569
|
-
if (typeof t != "string" || !/%[oOdisfc]/.test(t)) return e.map(K);
|
|
570
|
-
let n = e.slice(1), r = 0, i = "";
|
|
571
|
-
for (let e = 0; e < t.length; e++) {
|
|
572
|
-
let a = t[e];
|
|
573
|
-
if (a === "%" && e + 1 < t.length) {
|
|
574
|
-
let o = t[e + 1], s = n[r++];
|
|
575
|
-
switch (o) {
|
|
576
|
-
case "o":
|
|
577
|
-
case "O":
|
|
578
|
-
i += K(s), e++;
|
|
579
|
-
break;
|
|
580
|
-
case "s":
|
|
581
|
-
i += s === void 0 ? "undefined" : String(s), e++;
|
|
582
|
-
break;
|
|
583
|
-
case "d":
|
|
584
|
-
case "i":
|
|
585
|
-
i += String(Number.parseInt(String(s ?? ""), 10) || 0), e++;
|
|
586
|
-
break;
|
|
587
|
-
case "f":
|
|
588
|
-
i += String(Number.parseFloat(String(s ?? "")) || 0), e++;
|
|
589
|
-
break;
|
|
590
|
-
case "c":
|
|
591
|
-
e++;
|
|
592
|
-
break;
|
|
593
|
-
default: i += a;
|
|
594
|
-
}
|
|
595
|
-
continue;
|
|
596
|
-
}
|
|
597
|
-
i += a;
|
|
598
|
-
}
|
|
599
|
-
let a = [i.trim()];
|
|
600
|
-
for (; r < n.length;) a.push(K(n[r++]));
|
|
601
|
-
return a.filter((e) => e.length > 0);
|
|
602
|
-
}
|
|
603
|
-
function Ve({ level: e }) {
|
|
604
|
-
return /* @__PURE__ */ (0, G.jsx)("span", {
|
|
605
|
-
className: i("px-1.5 py-0.5 text-[11px] font-mono font-semibold rounded-full text-white shrink-0", {
|
|
606
|
-
log: "bg-zinc-500",
|
|
607
|
-
info: "bg-blue-500",
|
|
608
|
-
warn: "bg-yellow-500",
|
|
609
|
-
error: "bg-red-500",
|
|
610
|
-
debug: "bg-purple-500",
|
|
611
|
-
trace: "bg-gray-500"
|
|
612
|
-
}[e]),
|
|
613
|
-
children: e.toUpperCase()
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
function He({ log: e }) {
|
|
617
|
-
let [t, n] = (0, H.useState)(!1), a = (0, H.useMemo)(() => {
|
|
618
|
-
try {
|
|
619
|
-
return new Date(e.timestamp).toLocaleTimeString();
|
|
620
|
-
} catch {
|
|
621
|
-
return "";
|
|
622
|
-
}
|
|
623
|
-
}, [e.timestamp]), o = (0, H.useMemo)(() => q(e.args), [e.args]), s = (0, H.useMemo)(() => {
|
|
624
|
-
if (o.length === 0) return "";
|
|
625
|
-
let e = o[0].replace(/\s*\n\s*/g, " ").trim();
|
|
626
|
-
return (e.length > 120 ? e.slice(0, 120) + "…" : e) + (o.length > 1 ? ` +${o.length - 1}` : "");
|
|
627
|
-
}, [o]), c = async (e) => {
|
|
628
|
-
e.stopPropagation();
|
|
629
|
-
try {
|
|
630
|
-
await ce(o.join("\n")), R.success("Copied to clipboard");
|
|
631
|
-
} catch {
|
|
632
|
-
R.error("Failed to copy");
|
|
633
|
-
}
|
|
634
|
-
}, l = i("font-mono text-xs border-b border-zinc-200 dark:border-zinc-800", e.level === "error" && "bg-red-50/30 dark:bg-red-950/10", e.level === "warn" && "bg-yellow-50/30 dark:bg-yellow-950/10"), u = i("cursor-pointer select-none", e.level === "error" && "hover:bg-red-50/50 dark:hover:bg-red-950/20", e.level === "warn" && "hover:bg-yellow-50/50 dark:hover:bg-yellow-950/20", e.level !== "error" && e.level !== "warn" && "hover:bg-zinc-100/70 dark:hover:bg-zinc-800/40");
|
|
635
|
-
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
636
|
-
className: i(l, "group"),
|
|
637
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
638
|
-
className: i("flex items-center gap-2 px-2 py-1.5", u),
|
|
639
|
-
onClick: () => n((e) => !e),
|
|
640
|
-
children: [
|
|
641
|
-
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
642
|
-
className: "text-zinc-400 dark:text-zinc-500 shrink-0",
|
|
643
|
-
children: t ? /* @__PURE__ */ (0, G.jsx)(A, { className: "size-3" }) : /* @__PURE__ */ (0, G.jsx)(r, { className: "size-3" })
|
|
644
|
-
}),
|
|
645
|
-
/* @__PURE__ */ (0, G.jsx)(Ve, { level: e.level }),
|
|
646
|
-
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
647
|
-
className: "text-zinc-500 dark:text-zinc-400 text-[10px] shrink-0",
|
|
648
|
-
children: a
|
|
649
|
-
}),
|
|
650
|
-
!t && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
651
|
-
className: i("truncate text-[11px]", e.level === "error" && "text-red-700 dark:text-red-400", e.level === "warn" && "text-yellow-700 dark:text-yellow-400", e.level !== "error" && e.level !== "warn" && "text-zinc-700 dark:text-zinc-300"),
|
|
652
|
-
children: s
|
|
653
|
-
}),
|
|
654
|
-
t && e.url && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
655
|
-
className: "text-zinc-400 dark:text-zinc-500 text-[10px] truncate flex-1",
|
|
656
|
-
children: (() => {
|
|
657
|
-
try {
|
|
658
|
-
return new URL(e.url).pathname;
|
|
659
|
-
} catch {
|
|
660
|
-
return e.url;
|
|
661
|
-
}
|
|
662
|
-
})()
|
|
663
|
-
}),
|
|
664
|
-
t && /* @__PURE__ */ (0, G.jsx)("button", {
|
|
665
|
-
onClick: c,
|
|
666
|
-
"aria-label": "Copy log",
|
|
667
|
-
className: "ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200",
|
|
668
|
-
children: /* @__PURE__ */ (0, G.jsx)(se, { className: "size-3" })
|
|
669
|
-
})
|
|
670
|
-
]
|
|
671
|
-
}), t && /* @__PURE__ */ (0, G.jsx)("div", {
|
|
672
|
-
className: "pl-8 pr-2 pb-2 select-text",
|
|
673
|
-
children: o.map((t, n) => /* @__PURE__ */ (0, G.jsx)("pre", {
|
|
674
|
-
className: i("whitespace-pre-wrap wrap-break-word text-[11px]", e.level === "error" && "text-red-700 dark:text-red-400", e.level === "warn" && "text-yellow-700 dark:text-yellow-400", e.level !== "error" && e.level !== "warn" && "text-zinc-700 dark:text-zinc-300"),
|
|
675
|
-
children: t
|
|
676
|
-
}, n))
|
|
677
|
-
})]
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
var J = "mcp-inspector-console-proxy-enabled", Ue = "mcp-inspector-console-height", We = [
|
|
681
|
-
"log",
|
|
682
|
-
"info",
|
|
683
|
-
"warn",
|
|
684
|
-
"error",
|
|
685
|
-
"debug",
|
|
686
|
-
"trace"
|
|
687
|
-
], Ge = {
|
|
688
|
-
log: "text-zinc-500",
|
|
689
|
-
info: "text-blue-500",
|
|
690
|
-
warn: "text-yellow-500",
|
|
691
|
-
error: "text-red-500",
|
|
692
|
-
debug: "text-purple-500",
|
|
693
|
-
trace: "text-gray-500"
|
|
694
|
-
};
|
|
695
|
-
function Ke({ iframeId: e, enabled: t = !0 }) {
|
|
696
|
-
let [r, l] = (0, H.useState)(() => {
|
|
697
|
-
if (typeof window > "u") return !0;
|
|
698
|
-
try {
|
|
699
|
-
return localStorage.getItem(J) === "true";
|
|
700
|
-
} catch {
|
|
701
|
-
return !0;
|
|
702
|
-
}
|
|
703
|
-
}), [u, d] = (0, H.useState)(() => {
|
|
704
|
-
if (typeof window > "u") return 400;
|
|
705
|
-
try {
|
|
706
|
-
let e = localStorage.getItem(Ue);
|
|
707
|
-
return e ? Math.max(ze, parseInt(e, 10)) : 400;
|
|
708
|
-
} catch {
|
|
709
|
-
return 400;
|
|
710
|
-
}
|
|
711
|
-
}), p = (0, H.useRef)(!1), m = (0, H.useCallback)((e) => {
|
|
712
|
-
e.preventDefault(), p.current = !0;
|
|
713
|
-
let t = (e) => {
|
|
714
|
-
if (!p.current) return;
|
|
715
|
-
let t = Math.floor(window.innerHeight * Be);
|
|
716
|
-
d(Math.min(t, Math.max(ze, window.innerHeight - e.clientY)));
|
|
717
|
-
}, n = () => {
|
|
718
|
-
p.current = !1, window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", n);
|
|
719
|
-
};
|
|
720
|
-
window.addEventListener("mousemove", t), window.addEventListener("mouseup", n);
|
|
721
|
-
}, []);
|
|
722
|
-
(0, H.useEffect)(() => {
|
|
723
|
-
try {
|
|
724
|
-
localStorage.setItem(Ue, String(u));
|
|
725
|
-
} catch {}
|
|
726
|
-
}, [u]);
|
|
727
|
-
let [g, y] = (0, H.useState)("all"), [x, S] = (0, H.useState)(""), { logs: w, clearLogs: T, isOpen: E, setIsOpen: D } = W({
|
|
728
|
-
enabled: t,
|
|
729
|
-
proxyToPageConsole: r
|
|
730
|
-
}), O = (0, H.useRef)(null);
|
|
731
|
-
(0, H.useEffect)(() => {
|
|
732
|
-
try {
|
|
733
|
-
localStorage.setItem(J, String(r));
|
|
734
|
-
} catch {}
|
|
735
|
-
}, [r]);
|
|
736
|
-
let k = (0, H.useMemo)(() => {
|
|
737
|
-
let e = {
|
|
738
|
-
log: 0,
|
|
739
|
-
info: 0,
|
|
740
|
-
warn: 0,
|
|
741
|
-
error: 0,
|
|
742
|
-
debug: 0,
|
|
743
|
-
trace: 0
|
|
744
|
-
};
|
|
745
|
-
for (let t of w) e[t.level]++;
|
|
746
|
-
return e;
|
|
747
|
-
}, [w]), A = k.error, j = k.warn, M = k.log + k.info + k.debug + k.trace, N = w.length, P = (0, H.useMemo)(() => A > 0 ? "bg-red-500" : j > 0 ? "bg-yellow-500" : "bg-zinc-500", [
|
|
748
|
-
A,
|
|
749
|
-
j,
|
|
750
|
-
M
|
|
751
|
-
]), F = (0, H.useMemo)(() => {
|
|
752
|
-
let e = g === "all" ? w : w.filter((e) => e.level === g), t = x.trim().toLowerCase();
|
|
753
|
-
return t && (e = e.filter((e) => {
|
|
754
|
-
let n = q(e.args).join(" ").toLowerCase(), r = (e.url ?? "").toLowerCase();
|
|
755
|
-
return n.includes(t) || r.includes(t);
|
|
756
|
-
})), e;
|
|
757
|
-
}, [
|
|
758
|
-
w,
|
|
759
|
-
g,
|
|
760
|
-
x
|
|
761
|
-
]);
|
|
762
|
-
return (0, H.useEffect)(() => {
|
|
763
|
-
E && !x && O.current && (O.current.scrollTop = O.current.scrollHeight);
|
|
764
|
-
}, [
|
|
765
|
-
F,
|
|
766
|
-
E,
|
|
767
|
-
x
|
|
768
|
-
]), /* @__PURE__ */ (0, G.jsxs)(b, {
|
|
769
|
-
open: E,
|
|
770
|
-
onOpenChange: D,
|
|
771
|
-
children: [/* @__PURE__ */ (0, G.jsx)(v, {
|
|
772
|
-
render: /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
773
|
-
render: /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
774
|
-
variant: "outline",
|
|
775
|
-
size: "sm",
|
|
776
|
-
className: "relative bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
777
|
-
onClick: () => D(!0),
|
|
778
|
-
children: [/* @__PURE__ */ (0, G.jsx)(V, { className: "size-4" }), N > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
779
|
-
className: i("ml-2 px-1.5 py-0.5 text-xs rounded-full text-white font-semibold", P),
|
|
780
|
-
children: N
|
|
781
|
-
})]
|
|
782
|
-
}),
|
|
783
|
-
nativeButton: !0
|
|
784
|
-
}), /* @__PURE__ */ (0, G.jsx)(s, { children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
785
|
-
className: "text-xs space-y-1",
|
|
786
|
-
children: [
|
|
787
|
-
/* @__PURE__ */ (0, G.jsxs)("p", {
|
|
788
|
-
className: "font-semibold",
|
|
789
|
-
children: [
|
|
790
|
-
N,
|
|
791
|
-
" console ",
|
|
792
|
-
N === 1 ? "log" : "logs"
|
|
793
|
-
]
|
|
794
|
-
}),
|
|
795
|
-
A > 0 && /* @__PURE__ */ (0, G.jsxs)("p", {
|
|
796
|
-
className: "text-red-400",
|
|
797
|
-
children: [
|
|
798
|
-
A,
|
|
799
|
-
" error",
|
|
800
|
-
A === 1 ? "" : "s"
|
|
801
|
-
]
|
|
802
|
-
}),
|
|
803
|
-
j > 0 && /* @__PURE__ */ (0, G.jsxs)("p", {
|
|
804
|
-
className: "text-yellow-400",
|
|
805
|
-
children: [
|
|
806
|
-
j,
|
|
807
|
-
" warning",
|
|
808
|
-
j === 1 ? "" : "s"
|
|
809
|
-
]
|
|
810
|
-
}),
|
|
811
|
-
M > 0 && /* @__PURE__ */ (0, G.jsxs)("p", {
|
|
812
|
-
className: "text-zinc-400",
|
|
813
|
-
children: [M, " info"]
|
|
814
|
-
})
|
|
815
|
-
]
|
|
816
|
-
}) })] }),
|
|
817
|
-
nativeButton: !1
|
|
818
|
-
}), /* @__PURE__ */ (0, G.jsxs)(_, {
|
|
819
|
-
side: "bottom",
|
|
820
|
-
className: "flex flex-col p-0 transition-none m-0 gap-0",
|
|
821
|
-
style: { height: u },
|
|
822
|
-
children: [
|
|
823
|
-
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
824
|
-
className: "h-1.5 w-full shrink-0 cursor-ns-resize bg-zinc-200 dark:bg-zinc-700 hover:bg-zinc-300 dark:hover:bg-zinc-600 transition-colors",
|
|
825
|
-
onMouseDown: m
|
|
826
|
-
}),
|
|
827
|
-
/* @__PURE__ */ (0, G.jsxs)(h, {
|
|
828
|
-
className: "px-4 py-4 m-0 border-b border-zinc-200 dark:border-zinc-800 shrink-0",
|
|
829
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
830
|
-
className: "flex items-center justify-between",
|
|
831
|
-
children: [/* @__PURE__ */ (0, G.jsxs)(f, {
|
|
832
|
-
className: "flex items-center gap-2",
|
|
833
|
-
children: [
|
|
834
|
-
/* @__PURE__ */ (0, G.jsx)(V, { className: "size-4" }),
|
|
835
|
-
"Widget Console Logs",
|
|
836
|
-
w.length > 0 && /* @__PURE__ */ (0, G.jsxs)("span", {
|
|
837
|
-
className: "text-sm font-normal text-zinc-500 dark:text-zinc-400",
|
|
838
|
-
children: [
|
|
839
|
-
"(",
|
|
840
|
-
w.length,
|
|
841
|
-
" ",
|
|
842
|
-
w.length === 1 ? "log" : "logs",
|
|
843
|
-
")"
|
|
844
|
-
]
|
|
845
|
-
})
|
|
846
|
-
]
|
|
847
|
-
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
848
|
-
className: "flex items-center gap-4 pr-4",
|
|
849
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
850
|
-
className: "flex items-center gap-2",
|
|
851
|
-
children: [/* @__PURE__ */ (0, G.jsx)(ge, {
|
|
852
|
-
id: "proxy-console-toggle",
|
|
853
|
-
checked: r,
|
|
854
|
-
onCheckedChange: l
|
|
855
|
-
}), /* @__PURE__ */ (0, G.jsx)(C, {
|
|
856
|
-
htmlFor: "proxy-console-toggle",
|
|
857
|
-
className: "text-sm font-normal cursor-pointer",
|
|
858
|
-
children: "Proxy logs to page console"
|
|
859
|
-
})]
|
|
860
|
-
}), w.length > 0 && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsxs)(c, {
|
|
861
|
-
variant: "ghost",
|
|
862
|
-
size: "sm",
|
|
863
|
-
onClick: async () => {
|
|
864
|
-
try {
|
|
865
|
-
await ce(F.map((e) => {
|
|
866
|
-
let t = new Date(e.timestamp).toLocaleTimeString();
|
|
867
|
-
return `[${e.level.toUpperCase()}] ${t}${e.url ? ` ${e.url}` : ""}\n${q(e.args).join("\n")}`;
|
|
868
|
-
}).join("\n\n")), R.success(`Copied ${F.length} logs to clipboard`);
|
|
869
|
-
} catch {
|
|
870
|
-
R.error("Failed to copy logs to clipboard");
|
|
871
|
-
}
|
|
872
|
-
},
|
|
873
|
-
className: "-my-2",
|
|
874
|
-
children: [/* @__PURE__ */ (0, G.jsx)(se, { className: "size-4 mr-1" }), "Copy All"]
|
|
875
|
-
}), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
876
|
-
variant: "ghost",
|
|
877
|
-
size: "sm",
|
|
878
|
-
onClick: T,
|
|
879
|
-
className: "-my-2",
|
|
880
|
-
children: [/* @__PURE__ */ (0, G.jsx)(Pe, { className: "size-4 mr-1" }), "Clear"]
|
|
881
|
-
})] })]
|
|
882
|
-
})]
|
|
883
|
-
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
884
|
-
className: "flex items-center gap-1 pt-1",
|
|
885
|
-
children: [
|
|
886
|
-
/* @__PURE__ */ (0, G.jsxs)("button", {
|
|
887
|
-
onClick: () => y("all"),
|
|
888
|
-
className: i("px-2 py-0.5 text-xs rounded font-medium transition-colors", g === "all" ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-900 dark:text-zinc-100" : "text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800"),
|
|
889
|
-
children: ["All", N > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
890
|
-
className: "ml-1 text-[10px] opacity-70",
|
|
891
|
-
children: N
|
|
892
|
-
})]
|
|
893
|
-
}),
|
|
894
|
-
We.map((e) => {
|
|
895
|
-
let t = k[e];
|
|
896
|
-
return /* @__PURE__ */ (0, G.jsxs)("button", {
|
|
897
|
-
onClick: () => y(g === e ? "all" : e),
|
|
898
|
-
className: i("px-2 py-0.5 text-xs rounded font-medium transition-colors", g === e ? "bg-zinc-200 dark:bg-zinc-700 text-zinc-900 dark:text-zinc-100" : "text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800"),
|
|
899
|
-
children: [/* @__PURE__ */ (0, G.jsx)("span", {
|
|
900
|
-
className: i(t > 0 && Ge[e]),
|
|
901
|
-
children: e.charAt(0).toUpperCase() + e.slice(1)
|
|
902
|
-
}), t > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
903
|
-
className: i("ml-1 text-[10px]", Ge[e]),
|
|
904
|
-
children: t
|
|
905
|
-
})]
|
|
906
|
-
}, e);
|
|
907
|
-
}),
|
|
908
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
909
|
-
className: "ml-auto flex items-center gap-1 relative",
|
|
910
|
-
children: [
|
|
911
|
-
/* @__PURE__ */ (0, G.jsx)(n, { className: "absolute left-2 size-3 text-zinc-400 dark:text-zinc-500 pointer-events-none" }),
|
|
912
|
-
/* @__PURE__ */ (0, G.jsx)("input", {
|
|
913
|
-
type: "text",
|
|
914
|
-
placeholder: "Filter logs…",
|
|
915
|
-
value: x,
|
|
916
|
-
onChange: (e) => S(e.target.value),
|
|
917
|
-
className: "pl-6 pr-6 py-0.5 text-xs rounded border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-400 dark:focus:ring-zinc-500 w-44"
|
|
918
|
-
}),
|
|
919
|
-
x && /* @__PURE__ */ (0, G.jsx)("button", {
|
|
920
|
-
onClick: () => S(""),
|
|
921
|
-
"aria-label": "Clear search",
|
|
922
|
-
className: "absolute right-1.5 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300",
|
|
923
|
-
children: /* @__PURE__ */ (0, G.jsx)(he, { className: "size-3" })
|
|
924
|
-
})
|
|
925
|
-
]
|
|
926
|
-
})
|
|
927
|
-
]
|
|
928
|
-
})]
|
|
929
|
-
}),
|
|
930
|
-
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
931
|
-
ref: O,
|
|
932
|
-
className: "flex-1 overflow-auto bg-zinc-50 dark:bg-zinc-950",
|
|
933
|
-
children: F.length === 0 ? /* @__PURE__ */ (0, G.jsx)("div", {
|
|
934
|
-
className: "flex items-center justify-center h-full text-zinc-500 dark:text-zinc-400",
|
|
935
|
-
children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
936
|
-
className: "text-center",
|
|
937
|
-
children: [
|
|
938
|
-
/* @__PURE__ */ (0, G.jsx)(V, { className: "size-8 mx-auto mb-2 opacity-50" }),
|
|
939
|
-
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
940
|
-
className: "text-sm",
|
|
941
|
-
children: w.length === 0 ? "No console logs yet" : x ? `No logs match "${x}"` : "No logs match the current filter"
|
|
942
|
-
}),
|
|
943
|
-
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
944
|
-
className: "text-xs mt-1",
|
|
945
|
-
children: w.length === 0 ? "Logs from iframes will appear here" : `${w.length} log${w.length === 1 ? "" : "s"} hidden by filter`
|
|
946
|
-
})
|
|
947
|
-
]
|
|
948
|
-
})
|
|
949
|
-
}) : /* @__PURE__ */ (0, G.jsx)("div", { children: F.map((e) => /* @__PURE__ */ (0, G.jsx)(He, { log: e }, e.id)) })
|
|
950
|
-
})
|
|
951
|
-
]
|
|
952
|
-
})]
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
//#endregion
|
|
956
|
-
//#region src/client/hooks/usePropsLLM.ts
|
|
957
|
-
function qe(e) {
|
|
958
|
-
let t = e.trim(), n = t.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
959
|
-
n && (t = n[1].trim());
|
|
960
|
-
let r = t.indexOf("{");
|
|
961
|
-
if (r < 0) return null;
|
|
962
|
-
let i = 0;
|
|
963
|
-
for (let e = r; e < t.length; e++) if (t[e] === "{") i++;
|
|
964
|
-
else if (t[e] === "}" && (i--, i === 0)) try {
|
|
965
|
-
return JSON.parse(t.slice(r, e + 1));
|
|
966
|
-
} catch {
|
|
967
|
-
return null;
|
|
968
|
-
}
|
|
969
|
-
return null;
|
|
970
|
-
}
|
|
971
|
-
function Je({ llmConfig: e }) {
|
|
972
|
-
return {
|
|
973
|
-
generateProps: (0, H.useCallback)(async ({ resource: t, resourceAnnotations: n, propsSchema: r }) => {
|
|
974
|
-
if (!e) throw Error("LLM config is not available");
|
|
975
|
-
let i = t.mimeType || n?.mimeType || "unknown", a = t.description || n?.description || "N/A";
|
|
976
|
-
if (r?.properties) {
|
|
977
|
-
let n = Object.keys(r.properties).map((e) => {
|
|
978
|
-
let t = r.properties[e], n = ` - ${e} (${t.type || "string"})`, i = t.description ? `: ${t.description}` : "", a = "";
|
|
979
|
-
return t.type === "array" && t.items?.type === "object" && t.items?.properties && (a = ` — array of objects with keys: {${Object.keys(t.items.properties).join(", ")}}`), `${n}${a}${i}`;
|
|
980
|
-
}).join("\n"), i = [{
|
|
981
|
-
role: "system",
|
|
982
|
-
content: "You are helping a developer configure props for a UI widget. The widget has a defined schema with specific props. Generate appropriate values for ONLY the props listed in the schema. Return ONLY a JSON object with these exact keys. For array props, each item must match the specified structure."
|
|
983
|
-
}, {
|
|
984
|
-
role: "user",
|
|
985
|
-
content: `Widget: ${t.name || t.uri}
|
|
986
|
-
Description: ${a}
|
|
987
|
-
|
|
988
|
-
Props Schema:
|
|
989
|
-
${n}
|
|
990
|
-
|
|
991
|
-
Generate appropriate default/example values for these props. Return ONLY a JSON object with the exact prop names as keys.
|
|
992
|
-
Example: {"query": "example search term", "results": [{"fruit": "Apple", "color": "red"}]}`
|
|
993
|
-
}], o = qe(await z({
|
|
994
|
-
config: {
|
|
995
|
-
provider: e.provider,
|
|
996
|
-
model: e.model,
|
|
997
|
-
apiKey: e.apiKey,
|
|
998
|
-
temperature: e.temperature,
|
|
999
|
-
baseUrl: e.baseUrl
|
|
1000
|
-
},
|
|
1001
|
-
messages: i
|
|
1002
|
-
}));
|
|
1003
|
-
if (o) return Object.entries(o).map(([e, t]) => ({
|
|
1004
|
-
key: e,
|
|
1005
|
-
value: typeof t == "object" && t ? JSON.stringify(t) : String(t)
|
|
1006
|
-
}));
|
|
1007
|
-
throw Error("Could not parse props from LLM response");
|
|
1008
|
-
}
|
|
1009
|
-
let o = t.uri?.startsWith("ui://") || t.mimeType === "text/html;profile=mcp-app" || !!n?.ui, s = o ? "You are helping preview an MCP App widget in the inspector.\nGenerate sample tool result data (structuredContent) that the widget receives via useToolContext().\nReturn ONLY a JSON object with realistic sample data the widget needs to render — query strings, item arrays, IDs, labels, etc.\nDo NOT generate UI styling props like theme, width, height, or showFilters unless explicitly required.\nFor search/list widgets, always include the collection array (e.g. \"items\") with at least 2 sample entries." : "You are helping a developer configure props for a UI widget/resource.\nAnalyze the provided information and suggest appropriate props in key-value format.\nReturn ONLY a JSON object with key-value pairs, where both keys and values are strings.\nExample format: {\"theme\": \"dark\", \"width\": \"400\", \"title\": \"My Widget\"}", c = o ? `Widget: ${t.name || t.uri}
|
|
1010
|
-
Description: ${a}
|
|
1011
|
-
|
|
1012
|
-
Generate sample structuredContent for previewing this widget in the inspector.
|
|
1013
|
-
Include every data field the widget likely reads from toolOutput (arrays must be non-empty).
|
|
1014
|
-
Example for a fruit search widget: {"query": "apple", "items": [{"id": "apple", "name": "Apple"}, {"id": "banana", "name": "Banana"}]}
|
|
1015
|
-
Return ONLY JSON.` : `Resource Information:
|
|
1016
|
-
- URI: ${t.uri}
|
|
1017
|
-
- Name: ${t.name || "N/A"}
|
|
1018
|
-
- Type: ${i}
|
|
1019
|
-
- Description: ${a}
|
|
1020
|
-
|
|
1021
|
-
Based on this information, suggest 3-5 common customizable properties like theme, dimensions, colors, titles, or configuration options that would be useful for this type of resource. Keep it simple and practical.`, l = [{
|
|
1022
|
-
role: "system",
|
|
1023
|
-
content: s
|
|
1024
|
-
}, {
|
|
1025
|
-
role: "user",
|
|
1026
|
-
content: c
|
|
1027
|
-
}], u = await z({
|
|
1028
|
-
config: {
|
|
1029
|
-
provider: e.provider,
|
|
1030
|
-
model: e.model,
|
|
1031
|
-
apiKey: e.apiKey,
|
|
1032
|
-
temperature: e.temperature,
|
|
1033
|
-
baseUrl: e.baseUrl
|
|
1034
|
-
},
|
|
1035
|
-
messages: l
|
|
1036
|
-
});
|
|
1037
|
-
try {
|
|
1038
|
-
let e = qe(u);
|
|
1039
|
-
if (e) return Object.entries(e).map(([e, t]) => ({
|
|
1040
|
-
key: e,
|
|
1041
|
-
value: typeof t == "object" && t ? JSON.stringify(t) : String(t)
|
|
1042
|
-
}));
|
|
1043
|
-
let t = u.split("\n"), n = [];
|
|
1044
|
-
for (let e of t) {
|
|
1045
|
-
let t = e.match(/^\s*["']?(\w+)["']?\s*[:=]\s*["']?(.+?)["']?\s*,?\s*$/);
|
|
1046
|
-
t && n.push({
|
|
1047
|
-
key: t[1].trim(),
|
|
1048
|
-
value: t[2].trim().replace(/^["']|["']$/g, "")
|
|
1049
|
-
});
|
|
1050
|
-
}
|
|
1051
|
-
if (n.length > 0) return n;
|
|
1052
|
-
throw Error("Could not parse props from LLM response");
|
|
1053
|
-
} catch (e) {
|
|
1054
|
-
throw console.error("[usePropsLLM] Failed to parse LLM response:", e), Error(`Failed to parse props from LLM response: ${u.slice(0, 100)}...`);
|
|
1055
|
-
}
|
|
1056
|
-
}, [e]),
|
|
1057
|
-
isAvailable: e !== null
|
|
1058
|
-
};
|
|
1059
|
-
}
|
|
1060
|
-
//#endregion
|
|
1061
|
-
//#region src/client/components/shared/SchemaFormField.tsx
|
|
1062
|
-
function Y(e, t) {
|
|
1063
|
-
if (!e?.$ref) return e;
|
|
1064
|
-
let n = e.$ref;
|
|
1065
|
-
if (n.startsWith("#/")) {
|
|
1066
|
-
let r = n.substring(2).split("/"), i = t;
|
|
1067
|
-
for (let t of r) if (i && typeof i == "object" && t in i) i = i[t];
|
|
1068
|
-
else return console.warn(`Could not resolve $ref: ${n}`), e;
|
|
1069
|
-
return i;
|
|
1070
|
-
}
|
|
1071
|
-
return e;
|
|
1072
|
-
}
|
|
1073
|
-
function Ye(e, t) {
|
|
1074
|
-
if (e.anyOf && Array.isArray(e.anyOf)) {
|
|
1075
|
-
let n = e.anyOf.find((e) => e.type !== "null");
|
|
1076
|
-
if (n) return {
|
|
1077
|
-
...Y(n, t),
|
|
1078
|
-
nullable: !0
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
|
-
return e;
|
|
1082
|
-
}
|
|
1083
|
-
function Xe(e) {
|
|
1084
|
-
return Array.isArray(e.enum) ? e.enum : null;
|
|
1085
|
-
}
|
|
1086
|
-
function X({ name: e, schema: t, value: n, onChange: r, required: i = !1, disabled: a = !1, rootSchema: o }) {
|
|
1087
|
-
let s = o || t, c = Ye(t, s);
|
|
1088
|
-
c = Y(c, s);
|
|
1089
|
-
let u = Xe(c), d = c.type === "string" && u !== null, f = c;
|
|
1090
|
-
return f.type === "object" || f.type === "array" ? /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1091
|
-
className: "space-y-2",
|
|
1092
|
-
children: [
|
|
1093
|
-
/* @__PURE__ */ (0, G.jsxs)(C, {
|
|
1094
|
-
htmlFor: e,
|
|
1095
|
-
className: "text-sm font-medium",
|
|
1096
|
-
children: [e, i && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1097
|
-
className: "text-red-500 ml-1",
|
|
1098
|
-
children: "*"
|
|
1099
|
-
})]
|
|
1100
|
-
}),
|
|
1101
|
-
/* @__PURE__ */ (0, G.jsx)(B, {
|
|
1102
|
-
id: e,
|
|
1103
|
-
value: n,
|
|
1104
|
-
onChange: (e) => r(e.target.value),
|
|
1105
|
-
placeholder: f?.description || f?.default ? JSON.stringify(f.default, null, 2) : `Enter ${e}`,
|
|
1106
|
-
className: "min-h-[100px]",
|
|
1107
|
-
disabled: a
|
|
1108
|
-
}),
|
|
1109
|
-
f?.description && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1110
|
-
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1111
|
-
children: f.description
|
|
1112
|
-
})
|
|
1113
|
-
]
|
|
1114
|
-
}) : d && u ? /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1115
|
-
className: "space-y-2",
|
|
1116
|
-
children: [
|
|
1117
|
-
/* @__PURE__ */ (0, G.jsxs)(C, {
|
|
1118
|
-
htmlFor: e,
|
|
1119
|
-
className: "text-sm font-medium",
|
|
1120
|
-
children: [e, i && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1121
|
-
className: "text-red-500 ml-1",
|
|
1122
|
-
children: "*"
|
|
1123
|
-
})]
|
|
1124
|
-
}),
|
|
1125
|
-
/* @__PURE__ */ (0, G.jsxs)(O, {
|
|
1126
|
-
value: n || "",
|
|
1127
|
-
onValueChange: r,
|
|
1128
|
-
disabled: a,
|
|
1129
|
-
children: [/* @__PURE__ */ (0, G.jsx)(T, {
|
|
1130
|
-
id: e,
|
|
1131
|
-
className: "w-full",
|
|
1132
|
-
children: /* @__PURE__ */ (0, G.jsx)(w, { placeholder: f.description || "Select an option" })
|
|
1133
|
-
}), /* @__PURE__ */ (0, G.jsx)(E, { children: u.map((e, t) => /* @__PURE__ */ (0, G.jsx)(D, {
|
|
1134
|
-
value: e,
|
|
1135
|
-
children: f.enumNames?.[t] || e
|
|
1136
|
-
}, e)) })]
|
|
1137
|
-
}),
|
|
1138
|
-
f.description && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1139
|
-
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1140
|
-
children: f.description
|
|
1141
|
-
})
|
|
1142
|
-
]
|
|
1143
|
-
}) : /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1144
|
-
className: "space-y-2",
|
|
1145
|
-
children: [
|
|
1146
|
-
/* @__PURE__ */ (0, G.jsxs)(C, {
|
|
1147
|
-
htmlFor: e,
|
|
1148
|
-
className: "text-sm font-medium",
|
|
1149
|
-
children: [e, i && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1150
|
-
className: "text-red-500 ml-1",
|
|
1151
|
-
children: "*"
|
|
1152
|
-
})]
|
|
1153
|
-
}),
|
|
1154
|
-
/* @__PURE__ */ (0, G.jsx)(l, {
|
|
1155
|
-
id: e,
|
|
1156
|
-
value: n,
|
|
1157
|
-
onChange: (e) => r(e.target.value),
|
|
1158
|
-
placeholder: f?.description || (f?.default === void 0 ? `Enter ${e}` : String(f.default)),
|
|
1159
|
-
type: f.type === "number" ? "number" : "text",
|
|
1160
|
-
disabled: a
|
|
1161
|
-
}),
|
|
1162
|
-
f?.description && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1163
|
-
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
1164
|
-
children: f.description
|
|
1165
|
-
})
|
|
1166
|
-
]
|
|
1167
|
-
});
|
|
1168
|
-
}
|
|
1169
|
-
//#endregion
|
|
1170
|
-
//#region src/client/components/resources/PropsConfigDialog.tsx
|
|
1171
|
-
function Ze({ open: e, onOpenChange: t, onSave: n, existingPresets: r, resource: i, resourceAnnotations: a, llmConfig: o, editingPreset: s }) {
|
|
1172
|
-
let u = (0, H.useMemo)(() => {
|
|
1173
|
-
let e = (e) => {
|
|
1174
|
-
if (!e) return null;
|
|
1175
|
-
if (e.type === "object" && e.properties) return e;
|
|
1176
|
-
let t = e?.def?.shape ?? e?._def?.shape;
|
|
1177
|
-
if (t && typeof t == "object") {
|
|
1178
|
-
let e = {}, n = [], r = (e) => ({
|
|
1179
|
-
ZodString: "string",
|
|
1180
|
-
string: "string",
|
|
1181
|
-
ZodNumber: "number",
|
|
1182
|
-
number: "number",
|
|
1183
|
-
ZodBoolean: "boolean",
|
|
1184
|
-
boolean: "boolean",
|
|
1185
|
-
ZodArray: "array",
|
|
1186
|
-
array: "array",
|
|
1187
|
-
ZodObject: "object",
|
|
1188
|
-
object: "object"
|
|
1189
|
-
})[e] || "string", i = (e) => e?.typeName ?? e?.type ?? "", a = (e) => {
|
|
1190
|
-
let t = e?._def ?? e?.def ?? {}, n = e, a = i(t);
|
|
1191
|
-
for (; a === "ZodOptional" || a === "ZodDefault" || a === "ZodNullable";) n = t.innerType ?? n, a = i(n?._def ?? n?.def ?? {});
|
|
1192
|
-
let o = r(a);
|
|
1193
|
-
if (o === "array") {
|
|
1194
|
-
let e = n?._def?.type ?? n?.def?.element ?? n?.element;
|
|
1195
|
-
if (e) {
|
|
1196
|
-
let t = e._def ?? e.def ?? {};
|
|
1197
|
-
if (r(i(t)) === "object") {
|
|
1198
|
-
let n = t.shape ?? e._def?.shape ?? e.def?.shape ?? {};
|
|
1199
|
-
return {
|
|
1200
|
-
type: "array",
|
|
1201
|
-
items: {
|
|
1202
|
-
type: "object",
|
|
1203
|
-
properties: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, { type: r(i(t?._def ?? t?.def ?? {})) }]))
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
return { type: "array" };
|
|
1209
|
-
}
|
|
1210
|
-
return { type: o };
|
|
1211
|
-
};
|
|
1212
|
-
for (let [r, o] of Object.entries(t)) {
|
|
1213
|
-
let t = o, s = t?._def ?? t?.def ?? {}, c = i(s), l = c === "ZodOptional" || c === "ZodDefault" || c === "ZodNullable", u = a(t);
|
|
1214
|
-
e[r] = {
|
|
1215
|
-
type: u.type,
|
|
1216
|
-
...u.items && { items: u.items },
|
|
1217
|
-
description: t?.description ?? s.description
|
|
1218
|
-
}, l || n.push(r);
|
|
1219
|
-
}
|
|
1220
|
-
if (Object.keys(e).length > 0) return {
|
|
1221
|
-
type: "object",
|
|
1222
|
-
properties: e,
|
|
1223
|
-
required: n.length > 0 ? n : void 0
|
|
1224
|
-
};
|
|
1225
|
-
}
|
|
1226
|
-
return null;
|
|
1227
|
-
}, t = a;
|
|
1228
|
-
if (t?.["mcp-use/propsSchema"]) return e(t["mcp-use/propsSchema"]);
|
|
1229
|
-
let n = i.annotations;
|
|
1230
|
-
return n?.["mcp-use/propsSchema"] ? e(n["mcp-use/propsSchema"]) : null;
|
|
1231
|
-
}, [
|
|
1232
|
-
a,
|
|
1233
|
-
i.annotations,
|
|
1234
|
-
i.uri,
|
|
1235
|
-
i.name
|
|
1236
|
-
]), d = !!u, [f, p] = (0, H.useState)(""), [m, h] = (0, H.useState)({}), [g, _] = (0, H.useState)([{
|
|
1237
|
-
id: crypto.randomUUID(),
|
|
1238
|
-
key: "",
|
|
1239
|
-
value: ""
|
|
1240
|
-
}]), [v, y] = (0, H.useState)(!1), [b, x] = (0, H.useState)(null), { generateProps: S, isAvailable: w } = Je({ llmConfig: o });
|
|
1241
|
-
(0, H.useEffect)(() => {
|
|
1242
|
-
if (e) {
|
|
1243
|
-
if (s) if (p(s.name), d) h(s.props);
|
|
1244
|
-
else {
|
|
1245
|
-
let e = Object.entries(s.props).map(([e, t]) => ({
|
|
1246
|
-
id: crypto.randomUUID(),
|
|
1247
|
-
key: e,
|
|
1248
|
-
value: t
|
|
1249
|
-
}));
|
|
1250
|
-
_(e.length > 0 ? e : [{
|
|
1251
|
-
id: crypto.randomUUID(),
|
|
1252
|
-
key: "",
|
|
1253
|
-
value: ""
|
|
1254
|
-
}]);
|
|
1255
|
-
}
|
|
1256
|
-
else p(""), d ? h({}) : _([{
|
|
1257
|
-
id: crypto.randomUUID(),
|
|
1258
|
-
key: "",
|
|
1259
|
-
value: ""
|
|
1260
|
-
}]);
|
|
1261
|
-
x(null);
|
|
1262
|
-
}
|
|
1263
|
-
}, [
|
|
1264
|
-
e,
|
|
1265
|
-
s,
|
|
1266
|
-
d
|
|
1267
|
-
]);
|
|
1268
|
-
let T = () => {
|
|
1269
|
-
_([...g, {
|
|
1270
|
-
id: crypto.randomUUID(),
|
|
1271
|
-
key: "",
|
|
1272
|
-
value: ""
|
|
1273
|
-
}]);
|
|
1274
|
-
}, E = (e) => {
|
|
1275
|
-
g.length > 1 && _(g.filter((t) => t.id !== e));
|
|
1276
|
-
}, D = (e, t, n) => {
|
|
1277
|
-
_(g.map((r) => r.id === e ? {
|
|
1278
|
-
...r,
|
|
1279
|
-
[t]: n
|
|
1280
|
-
} : r));
|
|
1281
|
-
};
|
|
1282
|
-
return /* @__PURE__ */ (0, G.jsx)(oe, {
|
|
1283
|
-
open: e,
|
|
1284
|
-
onOpenChange: t,
|
|
1285
|
-
children: /* @__PURE__ */ (0, G.jsxs)(ie, {
|
|
1286
|
-
scrollable: !0,
|
|
1287
|
-
className: "sm:max-w-[600px] max-h-[80vh]",
|
|
1288
|
-
"data-testid": "props-config-dialog",
|
|
1289
|
-
children: [
|
|
1290
|
-
/* @__PURE__ */ (0, G.jsxs)(re, { children: [/* @__PURE__ */ (0, G.jsx)(ee, { children: s ? "Edit Preset" : "Create Props Preset" }), /* @__PURE__ */ (0, G.jsxs)(I, { children: [
|
|
1291
|
-
"Configure props for ",
|
|
1292
|
-
i.name || i.uri,
|
|
1293
|
-
". You can manually add key-value pairs or generate them with AI."
|
|
1294
|
-
] })] }),
|
|
1295
|
-
/* @__PURE__ */ (0, G.jsxs)(ne, {
|
|
1296
|
-
className: "space-y-4 py-4",
|
|
1297
|
-
children: [
|
|
1298
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1299
|
-
className: "space-y-2",
|
|
1300
|
-
children: [/* @__PURE__ */ (0, G.jsx)(C, {
|
|
1301
|
-
htmlFor: "preset-name",
|
|
1302
|
-
children: "Preset Name"
|
|
1303
|
-
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1304
|
-
id: "preset-name",
|
|
1305
|
-
"data-testid": "props-config-preset-name",
|
|
1306
|
-
value: f,
|
|
1307
|
-
onChange: (e) => p(e.target.value),
|
|
1308
|
-
placeholder: "e.g., Dark Theme, Production Config",
|
|
1309
|
-
disabled: v
|
|
1310
|
-
})]
|
|
1311
|
-
}),
|
|
1312
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1313
|
-
className: "space-y-2 p-3 bg-muted rounded-lg",
|
|
1314
|
-
children: [
|
|
1315
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1316
|
-
className: "flex items-center justify-between",
|
|
1317
|
-
children: [/* @__PURE__ */ (0, G.jsx)(C, {
|
|
1318
|
-
className: "text-sm font-medium",
|
|
1319
|
-
children: "Generate with AI"
|
|
1320
|
-
}), w && /* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1321
|
-
className: "text-xs text-muted-foreground",
|
|
1322
|
-
children: [
|
|
1323
|
-
"Using ",
|
|
1324
|
-
o?.provider,
|
|
1325
|
-
" (",
|
|
1326
|
-
o?.model,
|
|
1327
|
-
")"
|
|
1328
|
-
]
|
|
1329
|
-
})]
|
|
1330
|
-
}),
|
|
1331
|
-
w ? /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1332
|
-
onClick: async () => {
|
|
1333
|
-
if (!w) {
|
|
1334
|
-
R.error("LLM not configured", { description: "Please configure LLM in the Chat tab first." });
|
|
1335
|
-
return;
|
|
1336
|
-
}
|
|
1337
|
-
y(!0), x(null);
|
|
1338
|
-
try {
|
|
1339
|
-
let e = await S({
|
|
1340
|
-
resource: i,
|
|
1341
|
-
resourceAnnotations: a,
|
|
1342
|
-
propsSchema: d ? u : void 0
|
|
1343
|
-
});
|
|
1344
|
-
if (d) {
|
|
1345
|
-
let t = {};
|
|
1346
|
-
for (let n of e) u.properties?.[n.key] && (t[n.key] = n.value);
|
|
1347
|
-
h(t);
|
|
1348
|
-
} else _(e.map((e) => ({
|
|
1349
|
-
id: crypto.randomUUID(),
|
|
1350
|
-
key: e.key,
|
|
1351
|
-
value: e.value
|
|
1352
|
-
})));
|
|
1353
|
-
R.success("Props generated successfully", { description: `Generated ${e.length} prop(s) using ${o?.provider}` });
|
|
1354
|
-
} catch (e) {
|
|
1355
|
-
let t = e instanceof Error ? e.message : "Failed to generate props";
|
|
1356
|
-
x(t), R.error("LLM Generation Failed", { description: t });
|
|
1357
|
-
} finally {
|
|
1358
|
-
y(!1);
|
|
1359
|
-
}
|
|
1360
|
-
},
|
|
1361
|
-
disabled: v,
|
|
1362
|
-
size: "sm",
|
|
1363
|
-
variant: "outline",
|
|
1364
|
-
className: "w-full",
|
|
1365
|
-
"data-testid": "props-config-generate-llm-button",
|
|
1366
|
-
children: v ? /* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1367
|
-
"data-testid": "props-config-generating",
|
|
1368
|
-
className: "flex items-center gap-2",
|
|
1369
|
-
children: [/* @__PURE__ */ (0, G.jsx)(de, { className: "h-4 w-4 mr-2 animate-spin" }), "Generating..."]
|
|
1370
|
-
}) : /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)(pe, { className: "h-4 w-4 mr-2" }), "Generate Props with LLM"] })
|
|
1371
|
-
}) : /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1372
|
-
className: "text-xs text-muted-foreground",
|
|
1373
|
-
children: "LLM not configured. Please configure LLM in the Chat tab to use this feature."
|
|
1374
|
-
}),
|
|
1375
|
-
b && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1376
|
-
className: "text-xs text-destructive",
|
|
1377
|
-
"data-testid": "props-config-error",
|
|
1378
|
-
children: b
|
|
1379
|
-
})
|
|
1380
|
-
]
|
|
1381
|
-
}),
|
|
1382
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1383
|
-
className: "space-y-3",
|
|
1384
|
-
children: [/* @__PURE__ */ (0, G.jsx)(C, {
|
|
1385
|
-
className: "text-sm font-medium",
|
|
1386
|
-
children: "Props"
|
|
1387
|
-
}), d ? /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1388
|
-
className: "space-y-4",
|
|
1389
|
-
children: Object.entries(u.properties || {}).map(([e, t]) => /* @__PURE__ */ (0, G.jsx)(X, {
|
|
1390
|
-
name: e,
|
|
1391
|
-
schema: t,
|
|
1392
|
-
value: m[e] || "",
|
|
1393
|
-
onChange: (t) => h((n) => ({
|
|
1394
|
-
...n,
|
|
1395
|
-
[e]: t
|
|
1396
|
-
})),
|
|
1397
|
-
required: u.required?.includes(e),
|
|
1398
|
-
disabled: v,
|
|
1399
|
-
rootSchema: u
|
|
1400
|
-
}, e))
|
|
1401
|
-
}) : /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1402
|
-
className: "flex items-center justify-between",
|
|
1403
|
-
children: /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1404
|
-
onClick: T,
|
|
1405
|
-
size: "sm",
|
|
1406
|
-
variant: "ghost",
|
|
1407
|
-
disabled: v,
|
|
1408
|
-
"data-testid": "props-config-add-prop",
|
|
1409
|
-
children: [/* @__PURE__ */ (0, G.jsx)(L, { className: "h-4 w-4 mr-1" }), "Add Prop"]
|
|
1410
|
-
})
|
|
1411
|
-
}), g.map((e, t) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1412
|
-
className: "flex items-center gap-2",
|
|
1413
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1414
|
-
className: "flex-1 grid grid-cols-2 gap-2",
|
|
1415
|
-
children: [/* @__PURE__ */ (0, G.jsx)(l, {
|
|
1416
|
-
placeholder: "Key",
|
|
1417
|
-
value: e.key,
|
|
1418
|
-
onChange: (t) => D(e.id, "key", t.target.value),
|
|
1419
|
-
disabled: v,
|
|
1420
|
-
"data-testid": `props-config-key-${t}`
|
|
1421
|
-
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1422
|
-
placeholder: "Value",
|
|
1423
|
-
value: e.value,
|
|
1424
|
-
onChange: (t) => D(e.id, "value", t.target.value),
|
|
1425
|
-
disabled: v,
|
|
1426
|
-
"data-testid": `props-config-value-${t}`
|
|
1427
|
-
})]
|
|
1428
|
-
}), /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1429
|
-
variant: "ghost",
|
|
1430
|
-
size: "sm",
|
|
1431
|
-
onClick: () => E(e.id),
|
|
1432
|
-
disabled: g.length === 1 || v,
|
|
1433
|
-
className: "h-9 w-9 p-0",
|
|
1434
|
-
"data-testid": `props-config-remove-${t}`,
|
|
1435
|
-
children: /* @__PURE__ */ (0, G.jsx)(me, { className: "h-4 w-4 text-muted-foreground" })
|
|
1436
|
-
})]
|
|
1437
|
-
}, e.id))] })]
|
|
1438
|
-
})
|
|
1439
|
-
]
|
|
1440
|
-
}),
|
|
1441
|
-
/* @__PURE__ */ (0, G.jsxs)(P, { children: [/* @__PURE__ */ (0, G.jsx)(c, {
|
|
1442
|
-
variant: "outline",
|
|
1443
|
-
onClick: () => t(!1),
|
|
1444
|
-
disabled: v,
|
|
1445
|
-
"data-testid": "props-config-cancel-button",
|
|
1446
|
-
children: "Cancel"
|
|
1447
|
-
}), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1448
|
-
onClick: () => {
|
|
1449
|
-
if (!f.trim()) {
|
|
1450
|
-
R.error("Preset name required", { description: "Please enter a name for this preset." });
|
|
1451
|
-
return;
|
|
1452
|
-
}
|
|
1453
|
-
if (r.find((e) => e.name.toLowerCase() === f.toLowerCase() && e.id !== s?.id)) {
|
|
1454
|
-
R.error("Duplicate preset name", { description: "A preset with this name already exists." });
|
|
1455
|
-
return;
|
|
1456
|
-
}
|
|
1457
|
-
let e;
|
|
1458
|
-
if (d) e = { ...m };
|
|
1459
|
-
else {
|
|
1460
|
-
e = {};
|
|
1461
|
-
for (let t of g) t.key.trim() && (e[t.key.trim()] = t.value);
|
|
1462
|
-
}
|
|
1463
|
-
if (Object.keys(e).length === 0) {
|
|
1464
|
-
R.error("No props defined", { description: "Please add at least one prop with a key." });
|
|
1465
|
-
return;
|
|
1466
|
-
}
|
|
1467
|
-
let i = {
|
|
1468
|
-
id: s?.id || crypto.randomUUID(),
|
|
1469
|
-
name: f.trim(),
|
|
1470
|
-
props: e
|
|
1471
|
-
};
|
|
1472
|
-
n(i), t(!1), R.success(s ? "Preset updated" : "Preset created", { description: `Preset "${i.name}" saved successfully.` });
|
|
1473
|
-
},
|
|
1474
|
-
disabled: v,
|
|
1475
|
-
"data-testid": "props-config-save-button",
|
|
1476
|
-
children: [s ? "Update" : "Create", " Preset"]
|
|
1477
|
-
})] })
|
|
1478
|
-
]
|
|
1479
|
-
})
|
|
1480
|
-
});
|
|
1481
|
-
}
|
|
1482
|
-
//#endregion
|
|
1483
|
-
//#region src/client/components/ui-playground/shared/SafeAreaInsetsEditor.tsx
|
|
1484
|
-
function Qe({ value: e, onChange: t }) {
|
|
1485
|
-
let n = (n, r) => {
|
|
1486
|
-
let i = parseInt(r, 10);
|
|
1487
|
-
isNaN(i) || t({
|
|
1488
|
-
...e,
|
|
1489
|
-
[n]: i
|
|
1490
|
-
});
|
|
1491
|
-
};
|
|
1492
|
-
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1493
|
-
className: "grid grid-cols-2 gap-2",
|
|
1494
|
-
children: [
|
|
1495
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1496
|
-
className: "space-y-1",
|
|
1497
|
-
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1498
|
-
className: "text-xs text-muted-foreground",
|
|
1499
|
-
children: "Top"
|
|
1500
|
-
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1501
|
-
type: "number",
|
|
1502
|
-
min: "0",
|
|
1503
|
-
value: e.top,
|
|
1504
|
-
onChange: (e) => n("top", e.target.value),
|
|
1505
|
-
className: "h-8",
|
|
1506
|
-
"data-testid": "debugger-safe-area-top"
|
|
1507
|
-
})]
|
|
1508
|
-
}),
|
|
1509
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1510
|
-
className: "space-y-1",
|
|
1511
|
-
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1512
|
-
className: "text-xs text-muted-foreground",
|
|
1513
|
-
children: "Right"
|
|
1514
|
-
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1515
|
-
type: "number",
|
|
1516
|
-
min: "0",
|
|
1517
|
-
value: e.right,
|
|
1518
|
-
onChange: (e) => n("right", e.target.value),
|
|
1519
|
-
className: "h-8",
|
|
1520
|
-
"data-testid": "debugger-safe-area-right"
|
|
1521
|
-
})]
|
|
1522
|
-
}),
|
|
1523
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1524
|
-
className: "space-y-1",
|
|
1525
|
-
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1526
|
-
className: "text-xs text-muted-foreground",
|
|
1527
|
-
children: "Bottom"
|
|
1528
|
-
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1529
|
-
type: "number",
|
|
1530
|
-
min: "0",
|
|
1531
|
-
value: e.bottom,
|
|
1532
|
-
onChange: (e) => n("bottom", e.target.value),
|
|
1533
|
-
className: "h-8",
|
|
1534
|
-
"data-testid": "debugger-safe-area-bottom"
|
|
1535
|
-
})]
|
|
1536
|
-
}),
|
|
1537
|
-
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1538
|
-
className: "space-y-1",
|
|
1539
|
-
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
1540
|
-
className: "text-xs text-muted-foreground",
|
|
1541
|
-
children: "Left"
|
|
1542
|
-
}), /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1543
|
-
type: "number",
|
|
1544
|
-
min: "0",
|
|
1545
|
-
value: e.left,
|
|
1546
|
-
onChange: (e) => n("left", e.target.value),
|
|
1547
|
-
className: "h-8",
|
|
1548
|
-
"data-testid": "debugger-safe-area-left"
|
|
1549
|
-
})]
|
|
1550
|
-
})
|
|
1551
|
-
]
|
|
1552
|
-
});
|
|
1553
|
-
}
|
|
1554
|
-
//#endregion
|
|
1555
|
-
//#region src/client/mcp-apps/debug/csp-suggestions.ts
|
|
1556
|
-
function $e(e, t) {
|
|
1557
|
-
let n = new Set(t?.connectDomains ?? []), r = new Set(t?.resourceDomains ?? []), i = new Set(t?.frameDomains ?? []), a = new Set([
|
|
1558
|
-
"script-src",
|
|
1559
|
-
"style-src",
|
|
1560
|
-
"img-src",
|
|
1561
|
-
"font-src",
|
|
1562
|
-
"media-src"
|
|
1563
|
-
]);
|
|
1564
|
-
for (let t of e) {
|
|
1565
|
-
let e = (t.blockedUri || "").trim();
|
|
1566
|
-
if (!e || e === "(inline)" || e.startsWith("blob:") || e.startsWith("data:")) continue;
|
|
1567
|
-
let o = null;
|
|
1568
|
-
try {
|
|
1569
|
-
o = new URL(e).origin;
|
|
1570
|
-
} catch {
|
|
1571
|
-
continue;
|
|
1572
|
-
}
|
|
1573
|
-
if (!o) continue;
|
|
1574
|
-
let s = (t.effectiveDirective || t.directive || "").toLowerCase();
|
|
1575
|
-
s === "connect-src" ? (n.add(o), o.startsWith("http://") ? n.add(o.replace("http://", "ws://")) : o.startsWith("https://") && n.add(o.replace("https://", "wss://"))) : a.has(s) ? r.add(o) : s === "frame-src" && i.add(o);
|
|
1576
|
-
}
|
|
1577
|
-
let o = {
|
|
1578
|
-
connectDomains: Array.from(n).sort(),
|
|
1579
|
-
resourceDomains: Array.from(r).sort()
|
|
1580
|
-
};
|
|
1581
|
-
return i.size > 0 && (o.frameDomains = Array.from(i).sort()), o;
|
|
1582
|
-
}
|
|
1583
|
-
var Z = "https://raw.githubusercontent.com/modelcontextprotocol/ext-apps/bcfffb6585ea4fb1e3a9da39fb8911b83399fa71/specification/2026-01-26/apps.mdx", et = "https://mcp-use.com/docs/typescript/server/csp";
|
|
1584
|
-
function tt(e, t, n, r) {
|
|
1585
|
-
let i = [
|
|
1586
|
-
"Fix the Content Security Policy (CSP) for this MCP Apps widget. The widget has CSP violations that block network requests and resources.",
|
|
1587
|
-
"",
|
|
1588
|
-
"**References:**",
|
|
1589
|
-
`- MCP Apps CSP spec: ${Z}`,
|
|
1590
|
-
`- mcp-use CSP docs: ${et}`,
|
|
1591
|
-
""
|
|
1592
|
-
];
|
|
1593
|
-
if (i.push("**Current declared CSP:**"), e ? (i.push(`connectDomains: ${JSON.stringify(e.connectDomains ?? [])}`), i.push(`resourceDomains: ${JSON.stringify(e.resourceDomains ?? [])}`), i.push(`frameDomains: ${JSON.stringify(e.frameDomains ?? [])}`), i.push(`baseUriDomains: ${JSON.stringify(e.baseUriDomains ?? [])}`)) : i.push("No CSP declared."), i.push(""), t && (i.push("**Effective policy (originalPolicy):**"), i.push("```"), i.push(t), i.push("```"), i.push("")), n.length > 0) {
|
|
1594
|
-
i.push(`**Blocked requests (${n.length}):**`);
|
|
1595
|
-
for (let e of n) {
|
|
1596
|
-
let t = e.effectiveDirective || e.directive, n = e.blockedUri || "(inline)";
|
|
1597
|
-
i.push(`- ${t}: ${n}`);
|
|
1598
|
-
}
|
|
1599
|
-
i.push("");
|
|
1600
|
-
}
|
|
1601
|
-
return r ? (i.push("**Apply this CSP config to fix the violations:**"), i.push("Add these domains to the widget's CSP metadata (resource _meta.ui.csp). Use camelCase for MCP Apps (connectDomains, resourceDomains)."), i.push(""), i.push("```json"), i.push(JSON.stringify({
|
|
1602
|
-
connectDomains: r.connectDomains,
|
|
1603
|
-
resourceDomains: r.resourceDomains,
|
|
1604
|
-
...r.frameDomains?.length ? { frameDomains: r.frameDomains } : {}
|
|
1605
|
-
}, null, 2)), i.push("```")) : i.push("No blocked requests - no fix needed."), i.join("\n");
|
|
1606
|
-
}
|
|
1607
|
-
//#endregion
|
|
1608
|
-
//#region src/client/components/MCPAppsDebugControls.tsx
|
|
1609
|
-
var Q = "__no_props__", $ = "__tool_props__", nt = "__create_preset__", rt = [
|
|
1610
|
-
{
|
|
1611
|
-
value: "desktop",
|
|
1612
|
-
label: "Desktop",
|
|
1613
|
-
icon: j
|
|
1614
|
-
},
|
|
1615
|
-
{
|
|
1616
|
-
value: "mobile",
|
|
1617
|
-
label: "Mobile",
|
|
1618
|
-
icon: je
|
|
1619
|
-
},
|
|
1620
|
-
{
|
|
1621
|
-
value: "tablet",
|
|
1622
|
-
label: "Tablet",
|
|
1623
|
-
icon: Ne
|
|
1624
|
-
}
|
|
1625
|
-
];
|
|
1626
|
-
function it({ options: e, value: t, onValueChange: n, placeholder: r, contentTestId: i, searchTestId: a, optionTestId: o, trigger: s }) {
|
|
1627
|
-
let [c, u] = (0, H.useState)(!1), [d, f] = (0, H.useState)(""), p = (0, H.useRef)(null);
|
|
1628
|
-
(0, H.useEffect)(() => {
|
|
1629
|
-
if (!c) {
|
|
1630
|
-
f("");
|
|
1631
|
-
return;
|
|
1632
|
-
}
|
|
1633
|
-
let e = requestAnimationFrame(() => p.current?.focus());
|
|
1634
|
-
return () => cancelAnimationFrame(e);
|
|
1635
|
-
}, [c]);
|
|
1636
|
-
let h = (0, H.useMemo)(() => {
|
|
1637
|
-
let t = d.trim().toLowerCase();
|
|
1638
|
-
return t ? e.filter((e) => e.label.toLowerCase().includes(t) || e.value.toLowerCase().includes(t)) : [...e];
|
|
1639
|
-
}, [e, d]), g = h.findIndex((e) => e.value === t);
|
|
1640
|
-
return /* @__PURE__ */ (0, G.jsxs)(x, {
|
|
1641
|
-
open: c,
|
|
1642
|
-
onOpenChange: u,
|
|
1643
|
-
children: [s, /* @__PURE__ */ (0, G.jsxs)(m, {
|
|
1644
|
-
"data-testid": i,
|
|
1645
|
-
checkedIndex: g >= 0 ? g : void 0,
|
|
1646
|
-
className: "w-80 overflow-hidden",
|
|
1647
|
-
children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1648
|
-
className: "border-b border-border p-2",
|
|
1649
|
-
onKeyDown: (e) => e.stopPropagation(),
|
|
1650
|
-
children: /* @__PURE__ */ (0, G.jsx)(l, {
|
|
1651
|
-
ref: p,
|
|
1652
|
-
value: d,
|
|
1653
|
-
onChange: (e) => f(e.target.value),
|
|
1654
|
-
placeholder: r,
|
|
1655
|
-
"data-testid": a,
|
|
1656
|
-
className: "h-8"
|
|
1657
|
-
})
|
|
1658
|
-
}), /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1659
|
-
className: "max-h-64 overflow-y-auto",
|
|
1660
|
-
children: h.length === 0 ? /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1661
|
-
className: "px-3 py-4 text-xs text-muted-foreground",
|
|
1662
|
-
children: "No results found."
|
|
1663
|
-
}) : h.map((e, r) => /* @__PURE__ */ (0, G.jsx)(S, {
|
|
1664
|
-
index: r,
|
|
1665
|
-
label: e.label,
|
|
1666
|
-
checked: t === e.value,
|
|
1667
|
-
"data-testid": o(e.value),
|
|
1668
|
-
onSelect: () => {
|
|
1669
|
-
n(e.value), u(!1);
|
|
1670
|
-
}
|
|
1671
|
-
}, e.value))
|
|
1672
|
-
})]
|
|
1673
|
-
})]
|
|
1674
|
-
});
|
|
1675
|
-
}
|
|
1676
|
-
function at({ displayMode: e, onDisplayModeChange: t, toolCallId: n, propsContext: i, resourceUri: l, toolInput: u, resourceAnnotations: f, llmConfig: h, resource: _, onPropsChange: v, requiredProps: b }) {
|
|
1677
|
-
let { resolvedTheme: C, setTheme: w } = ve(), { playground: T, updatePlaygroundSettings: E, widgets: D, clearCspViolations: O } = _e(), k = D.get(n), P = k?.cspViolations ?? [], I = k?.declaredCsp, L = k?.effectivePolicy, de = P.length > 0 ? $e(P, I) : null, pe = P.length > 0 ? tt(I, L, P, de) : "", he = e === "fullscreen", ge = e === "pip", { presets: z, activePresetId: B, savePreset: Se, deletePreset: Te, setActivePreset: V, getActiveProps: Pe } = Re(l), [Ie, U] = (0, H.useState)(!1), W = !!b?.length && !B, [ze, Be] = (0, H.useState)(() => W);
|
|
1678
|
-
(0, H.useEffect)(() => {
|
|
1679
|
-
W && Be(!0);
|
|
1680
|
-
}, [W]);
|
|
1681
|
-
let [K, q] = (0, H.useState)(null), [Ve, He] = (0, H.useState)(!1), [J, Ue] = (0, H.useState)("mode"), [We, Ge] = (0, H.useState)(!0), qe = (0, H.useMemo)(() => ye(I), [I]), Je = (0, H.useMemo)(() => be(L), [L]), Y = (0, H.useMemo)(() => Ce(qe, Je), [qe, Je]), Ye = (0, H.useMemo)(() => xe({
|
|
1682
|
-
mode: T.cspMode,
|
|
1683
|
-
declared: I,
|
|
1684
|
-
effectivePolicy: L,
|
|
1685
|
-
violations: P
|
|
1686
|
-
}), [
|
|
1687
|
-
T.cspMode,
|
|
1688
|
-
I,
|
|
1689
|
-
L,
|
|
1690
|
-
P
|
|
1691
|
-
]), Xe = (0, H.useCallback)(() => i === "tool" && u ? $ : Q, [i, u]), [X, Z] = (0, H.useState)(Xe());
|
|
1692
|
-
(0, H.useEffect)(() => {
|
|
1693
|
-
B && i !== "tool" ? Z(B) : X !== Q && X !== $ && Z(Xe());
|
|
1694
|
-
}, [
|
|
1695
|
-
B,
|
|
1696
|
-
X,
|
|
1697
|
-
Xe,
|
|
1698
|
-
i
|
|
1699
|
-
]), (0, H.useEffect)(() => {
|
|
1700
|
-
if (v) {
|
|
1701
|
-
if (X === Q || X === $) v(null);
|
|
1702
|
-
else if (B && X === B) {
|
|
1703
|
-
let e = Pe();
|
|
1704
|
-
e && v(e);
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
}, [
|
|
1708
|
-
X,
|
|
1709
|
-
B,
|
|
1710
|
-
u,
|
|
1711
|
-
Pe,
|
|
1712
|
-
v,
|
|
1713
|
-
z
|
|
1714
|
-
]);
|
|
1715
|
-
let et = (e) => {
|
|
1716
|
-
if (e === nt) {
|
|
1717
|
-
q(null), U(!0);
|
|
1718
|
-
return;
|
|
1719
|
-
}
|
|
1720
|
-
if (e === Q || e === $) V(null), Z(e), v?.(null);
|
|
1721
|
-
else {
|
|
1722
|
-
V(e), Z(e);
|
|
1723
|
-
let t = z.find((t) => t.id === e);
|
|
1724
|
-
v?.(t?.props ?? null);
|
|
1725
|
-
}
|
|
1726
|
-
}, at = (e) => {
|
|
1727
|
-
Se(e), V(e.id), Z(e.id), v?.(e.props);
|
|
1728
|
-
}, ot = (e, t) => {
|
|
1729
|
-
t.stopPropagation();
|
|
1730
|
-
let n = z.find((t) => t.id === e);
|
|
1731
|
-
n && (Te(e), R.success("Preset deleted", { description: `Preset "${n.name}" has been deleted.` }));
|
|
1732
|
-
}, st = (e, t) => {
|
|
1733
|
-
t.stopPropagation(), q(e), U(!0);
|
|
1734
|
-
}, ct = () => {
|
|
1735
|
-
switch (T.deviceType) {
|
|
1736
|
-
case "mobile": return /* @__PURE__ */ (0, G.jsx)(je, { className: "size-3" });
|
|
1737
|
-
case "tablet": return /* @__PURE__ */ (0, G.jsx)(Ne, { className: "size-3" });
|
|
1738
|
-
default: return /* @__PURE__ */ (0, G.jsx)(j, { className: "size-3" });
|
|
1739
|
-
}
|
|
1740
|
-
}, lt = rt.findIndex((e) => e.value === T.deviceType);
|
|
1741
|
-
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1742
|
-
className: "flex items-center gap-2",
|
|
1743
|
-
children: [
|
|
1744
|
-
!he && !ge && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1745
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1746
|
-
"data-testid": "debugger-fullscreen-button",
|
|
1747
|
-
variant: "outline",
|
|
1748
|
-
size: "sm",
|
|
1749
|
-
className: "bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1750
|
-
onClick: () => t("fullscreen"),
|
|
1751
|
-
children: /* @__PURE__ */ (0, G.jsx)(fe, { className: "size-4" })
|
|
1752
|
-
}),
|
|
1753
|
-
nativeButton: !0
|
|
1754
|
-
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "Enter fullscreen mode" })] }), /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1755
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1756
|
-
"data-testid": "debugger-pip-button",
|
|
1757
|
-
variant: "outline",
|
|
1758
|
-
size: "sm",
|
|
1759
|
-
className: "bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1760
|
-
onClick: () => t("pip"),
|
|
1761
|
-
children: /* @__PURE__ */ (0, G.jsx)(De, { className: "size-4" })
|
|
1762
|
-
}),
|
|
1763
|
-
nativeButton: !0
|
|
1764
|
-
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "Picture-in-picture" })] })] }),
|
|
1765
|
-
/* @__PURE__ */ (0, G.jsxs)(x, { children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1766
|
-
render: /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1767
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1768
|
-
"data-testid": "debugger-device-button",
|
|
1769
|
-
variant: "outline",
|
|
1770
|
-
size: "sm",
|
|
1771
|
-
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1772
|
-
children: ct()
|
|
1773
|
-
}),
|
|
1774
|
-
nativeButton: !0
|
|
1775
|
-
}),
|
|
1776
|
-
nativeButton: !0
|
|
1777
|
-
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Device: ", T.deviceType] })] }), /* @__PURE__ */ (0, G.jsx)(m, {
|
|
1778
|
-
"data-testid": "debugger-device-dialog",
|
|
1779
|
-
checkedIndex: lt >= 0 ? lt : void 0,
|
|
1780
|
-
className: "w-56",
|
|
1781
|
-
children: rt.map((e, t) => /* @__PURE__ */ (0, G.jsx)(S, {
|
|
1782
|
-
index: t,
|
|
1783
|
-
icon: e.icon,
|
|
1784
|
-
label: e.label,
|
|
1785
|
-
checked: T.deviceType === e.value,
|
|
1786
|
-
"data-testid": `debugger-device-option-${e.value}`,
|
|
1787
|
-
onSelect: () => E({ deviceType: e.value })
|
|
1788
|
-
}, e.value))
|
|
1789
|
-
})] }),
|
|
1790
|
-
/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1791
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1792
|
-
"data-testid": "debugger-theme-button",
|
|
1793
|
-
variant: "outline",
|
|
1794
|
-
size: "sm",
|
|
1795
|
-
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1796
|
-
onClick: () => {
|
|
1797
|
-
w(C === "dark" ? "light" : "dark");
|
|
1798
|
-
},
|
|
1799
|
-
children: C === "dark" ? /* @__PURE__ */ (0, G.jsx)(N, { className: "size-3.5" }) : /* @__PURE__ */ (0, G.jsx)(F, { className: "size-3.5" })
|
|
1800
|
-
}),
|
|
1801
|
-
nativeButton: !0
|
|
1802
|
-
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Theme: ", C === "dark" ? "Dark" : "Light"] })] }),
|
|
1803
|
-
/* @__PURE__ */ (0, G.jsx)(it, {
|
|
1804
|
-
options: Fe,
|
|
1805
|
-
value: T.locale,
|
|
1806
|
-
onValueChange: (e) => E({ locale: e }),
|
|
1807
|
-
placeholder: "Search locales...",
|
|
1808
|
-
contentTestId: "debugger-locale-dialog",
|
|
1809
|
-
searchTestId: "debugger-locale-search",
|
|
1810
|
-
optionTestId: (e) => `debugger-locale-option-${e}`,
|
|
1811
|
-
trigger: /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1812
|
-
render: /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1813
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1814
|
-
"data-testid": "debugger-locale-button",
|
|
1815
|
-
variant: "outline",
|
|
1816
|
-
size: "sm",
|
|
1817
|
-
className: "h-8 min-w-[50px] px-2 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1818
|
-
children: /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1819
|
-
className: "text-xs font-mono",
|
|
1820
|
-
children: T.locale
|
|
1821
|
-
})
|
|
1822
|
-
}),
|
|
1823
|
-
nativeButton: !0
|
|
1824
|
-
}),
|
|
1825
|
-
nativeButton: !0
|
|
1826
|
-
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "Locale" })] })
|
|
1827
|
-
}),
|
|
1828
|
-
/* @__PURE__ */ (0, G.jsx)(it, {
|
|
1829
|
-
options: Le,
|
|
1830
|
-
value: T.timeZone,
|
|
1831
|
-
onValueChange: (e) => E({ timeZone: e }),
|
|
1832
|
-
placeholder: "Search timezones...",
|
|
1833
|
-
contentTestId: "debugger-timezone-dialog",
|
|
1834
|
-
searchTestId: "debugger-timezone-search",
|
|
1835
|
-
optionTestId: (e) => `debugger-timezone-option-${e.replace(/\//g, "-")}`,
|
|
1836
|
-
trigger: /* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1837
|
-
render: /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1838
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
1839
|
-
"data-testid": "debugger-timezone-button",
|
|
1840
|
-
variant: "outline",
|
|
1841
|
-
size: "sm",
|
|
1842
|
-
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1843
|
-
children: /* @__PURE__ */ (0, G.jsx)(le, { className: "size-3.5" })
|
|
1844
|
-
}),
|
|
1845
|
-
nativeButton: !0
|
|
1846
|
-
}),
|
|
1847
|
-
nativeButton: !0
|
|
1848
|
-
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Timezone: ", T.timeZone] })] })
|
|
1849
|
-
}),
|
|
1850
|
-
/* @__PURE__ */ (0, G.jsxs)(oe, {
|
|
1851
|
-
open: Ve,
|
|
1852
|
-
onOpenChange: He,
|
|
1853
|
-
children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1854
|
-
render: /* @__PURE__ */ (0, G.jsx)(te, {
|
|
1855
|
-
render: /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1856
|
-
"data-testid": "debugger-csp-button",
|
|
1857
|
-
variant: "outline",
|
|
1858
|
-
size: "sm",
|
|
1859
|
-
className: "relative h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
1860
|
-
children: [T.cspMode === "permissive" ? /* @__PURE__ */ (0, G.jsx)(Ae, { className: "size-3.5" }) : /* @__PURE__ */ (0, G.jsx)(ke, { className: "size-3.5" }), P.length > 0 && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1861
|
-
className: `absolute -top-1.5 -right-1.5 flex h-4 min-w-4 items-center justify-center rounded-full px-0.5 text-[9px] font-bold text-white leading-none ${T.cspMode === "permissive" ? "bg-yellow-500" : "bg-red-500"}`,
|
|
1862
|
-
children: P.length > 99 ? "99+" : P.length
|
|
1863
|
-
})]
|
|
1864
|
-
}),
|
|
1865
|
-
nativeButton: !0
|
|
1866
|
-
}),
|
|
1867
|
-
nativeButton: !0
|
|
1868
|
-
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: [
|
|
1869
|
-
"CSP:",
|
|
1870
|
-
" ",
|
|
1871
|
-
T.cspMode === "permissive" ? "Permissive" : "Declared",
|
|
1872
|
-
P.length > 0 && ` · ${P.length} ${T.cspMode === "permissive" ? "would be blocked" : "blocked"}`
|
|
1873
|
-
] })] }), /* @__PURE__ */ (0, G.jsxs)(ie, {
|
|
1874
|
-
scrollable: !0,
|
|
1875
|
-
className: "sm:max-w-[520px] max-h-[85vh]",
|
|
1876
|
-
"data-testid": "debugger-csp-dialog",
|
|
1877
|
-
children: [/* @__PURE__ */ (0, G.jsx)(re, { children: /* @__PURE__ */ (0, G.jsx)(ee, { children: "CSP Mode" }) }), /* @__PURE__ */ (0, G.jsxs)(ne, {
|
|
1878
|
-
className: "space-y-3",
|
|
1879
|
-
children: [
|
|
1880
|
-
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1881
|
-
role: "tablist",
|
|
1882
|
-
"aria-label": "CSP diagnostics",
|
|
1883
|
-
className: "grid grid-cols-3 rounded-md border border-zinc-200 dark:border-zinc-700 p-1",
|
|
1884
|
-
children: [
|
|
1885
|
-
["mode", "Mode"],
|
|
1886
|
-
["diff", "Policy Diff"],
|
|
1887
|
-
["findings", "Findings"]
|
|
1888
|
-
].map(([e, t]) => /* @__PURE__ */ (0, G.jsx)("button", {
|
|
1889
|
-
type: "button",
|
|
1890
|
-
role: "tab",
|
|
1891
|
-
"aria-selected": J === e,
|
|
1892
|
-
onClick: () => Ue(e),
|
|
1893
|
-
className: `rounded px-2 py-1.5 text-xs font-medium ${J === e ? "bg-zinc-100 dark:bg-zinc-800" : "text-muted-foreground"}`,
|
|
1894
|
-
children: t
|
|
1895
|
-
}, e))
|
|
1896
|
-
}),
|
|
1897
|
-
J === "mode" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1898
|
-
role: "tabpanel",
|
|
1899
|
-
className: "space-y-2",
|
|
1900
|
-
children: [
|
|
1901
|
-
/* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1902
|
-
"data-testid": "debugger-csp-option-permissive",
|
|
1903
|
-
variant: T.cspMode === "permissive" ? "default" : "outline",
|
|
1904
|
-
className: "w-full justify-start",
|
|
1905
|
-
onClick: () => E({ cspMode: "permissive" }),
|
|
1906
|
-
children: [/* @__PURE__ */ (0, G.jsx)(Ae, { className: "size-4 mr-2" }), "Permissive"]
|
|
1907
|
-
}),
|
|
1908
|
-
/* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1909
|
-
"data-testid": "debugger-csp-option-widget-declared",
|
|
1910
|
-
variant: T.cspMode === "widget-declared" ? "default" : "outline",
|
|
1911
|
-
className: "w-full justify-start",
|
|
1912
|
-
onClick: () => E({ cspMode: "widget-declared" }),
|
|
1913
|
-
children: [/* @__PURE__ */ (0, G.jsx)(ke, { className: "size-4 mr-2" }), "Widget-Declared"]
|
|
1914
|
-
}),
|
|
1915
|
-
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
1916
|
-
className: "text-xs text-muted-foreground",
|
|
1917
|
-
children: "Permissive records would-be blocks; Widget-Declared enforces the resource metadata policy."
|
|
1918
|
-
})
|
|
1919
|
-
]
|
|
1920
|
-
}),
|
|
1921
|
-
J === "diff" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1922
|
-
role: "tabpanel",
|
|
1923
|
-
className: "space-y-2",
|
|
1924
|
-
children: [Y.length ? /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1925
|
-
className: "max-h-64 overflow-y-auto rounded border border-zinc-200 dark:border-zinc-700",
|
|
1926
|
-
children: Y.map((e) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1927
|
-
className: "border-b border-zinc-100 dark:border-zinc-800 p-2 text-xs last:border-0",
|
|
1928
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1929
|
-
className: "flex items-center justify-between",
|
|
1930
|
-
children: [/* @__PURE__ */ (0, G.jsx)("code", { children: e.directive }), /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1931
|
-
className: "text-[10px] uppercase text-muted-foreground",
|
|
1932
|
-
children: e.status
|
|
1933
|
-
})]
|
|
1934
|
-
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1935
|
-
className: "mt-1 font-mono text-[10px] text-muted-foreground break-all",
|
|
1936
|
-
children: [
|
|
1937
|
-
"requested: ",
|
|
1938
|
-
e.requested.join(" ") || "—",
|
|
1939
|
-
/* @__PURE__ */ (0, G.jsx)("br", {}),
|
|
1940
|
-
"effective: ",
|
|
1941
|
-
e.effective.join(" ") || "—"
|
|
1942
|
-
]
|
|
1943
|
-
})]
|
|
1944
|
-
}, e.directive))
|
|
1945
|
-
}) : /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1946
|
-
className: "text-xs text-muted-foreground",
|
|
1947
|
-
children: "No requested or effective policy data yet."
|
|
1948
|
-
}), L && /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1949
|
-
variant: "outline",
|
|
1950
|
-
size: "sm",
|
|
1951
|
-
onClick: async () => {
|
|
1952
|
-
try {
|
|
1953
|
-
await ce(L), R.success("Policy copied to clipboard");
|
|
1954
|
-
} catch {
|
|
1955
|
-
R.error("Failed to copy");
|
|
1956
|
-
}
|
|
1957
|
-
},
|
|
1958
|
-
children: [/* @__PURE__ */ (0, G.jsx)(se, { className: "size-3.5 mr-2" }), "Copy effective policy"]
|
|
1959
|
-
})]
|
|
1960
|
-
}),
|
|
1961
|
-
J === "findings" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1962
|
-
role: "tabpanel",
|
|
1963
|
-
className: "space-y-2",
|
|
1964
|
-
children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1965
|
-
className: "space-y-1.5",
|
|
1966
|
-
children: Ye.map((e, t) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1967
|
-
className: "rounded border border-zinc-200 dark:border-zinc-700 p-2",
|
|
1968
|
-
children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1969
|
-
className: "text-xs font-medium",
|
|
1970
|
-
children: e.title
|
|
1971
|
-
}), /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1972
|
-
className: "text-[11px] text-muted-foreground break-all",
|
|
1973
|
-
children: e.detail
|
|
1974
|
-
})]
|
|
1975
|
-
}, `${e.title}-${t}`))
|
|
1976
|
-
}), P.length > 0 && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1977
|
-
className: "flex items-center justify-between",
|
|
1978
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1979
|
-
className: "text-xs font-medium",
|
|
1980
|
-
children: [
|
|
1981
|
-
P.length,
|
|
1982
|
-
" observed request",
|
|
1983
|
-
P.length === 1 ? "" : "s"
|
|
1984
|
-
]
|
|
1985
|
-
}), /* @__PURE__ */ (0, G.jsx)("button", {
|
|
1986
|
-
className: "text-xs text-muted-foreground underline",
|
|
1987
|
-
onClick: () => O(n),
|
|
1988
|
-
children: "Clear"
|
|
1989
|
-
})]
|
|
1990
|
-
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1991
|
-
className: "border border-amber-200 dark:border-amber-800 rounded-md overflow-hidden",
|
|
1992
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1993
|
-
className: "flex items-center justify-between bg-amber-50 dark:bg-amber-950/30 px-3 py-2",
|
|
1994
|
-
children: [/* @__PURE__ */ (0, G.jsxs)("button", {
|
|
1995
|
-
type: "button",
|
|
1996
|
-
className: "flex items-center gap-2 text-xs font-medium text-amber-800 dark:text-amber-200",
|
|
1997
|
-
onClick: () => Ge((e) => !e),
|
|
1998
|
-
children: [We ? /* @__PURE__ */ (0, G.jsx)(A, { className: "size-3.5" }) : /* @__PURE__ */ (0, G.jsx)(r, { className: "size-3.5" }), "Prompt for Agents"]
|
|
1999
|
-
}), /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2000
|
-
variant: "ghost",
|
|
2001
|
-
size: "sm",
|
|
2002
|
-
className: "h-7 w-7 p-0",
|
|
2003
|
-
onClick: () => void ce(pe),
|
|
2004
|
-
"aria-label": "Copy prompt for agents",
|
|
2005
|
-
children: /* @__PURE__ */ (0, G.jsx)(se, { className: "size-3.5" })
|
|
2006
|
-
})]
|
|
2007
|
-
}), We && /* @__PURE__ */ (0, G.jsx)("pre", {
|
|
2008
|
-
className: "max-h-48 overflow-auto whitespace-pre-wrap p-2 text-[11px]",
|
|
2009
|
-
"data-testid": "debugger-csp-prompt-for-agents",
|
|
2010
|
-
children: pe
|
|
2011
|
-
})]
|
|
2012
|
-
})] })]
|
|
2013
|
-
})
|
|
2014
|
-
]
|
|
2015
|
-
})]
|
|
2016
|
-
})]
|
|
2017
|
-
}),
|
|
2018
|
-
/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2019
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2020
|
-
"data-testid": "debugger-touch-button",
|
|
2021
|
-
variant: "outline",
|
|
2022
|
-
size: "sm",
|
|
2023
|
-
className: `h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900 ${T.capabilities.touch ? "border-blue-500 dark:border-blue-400" : ""}`,
|
|
2024
|
-
onClick: () => {
|
|
2025
|
-
E({ capabilities: {
|
|
2026
|
-
...T.capabilities,
|
|
2027
|
-
touch: !T.capabilities.touch
|
|
2028
|
-
} });
|
|
2029
|
-
},
|
|
2030
|
-
children: /* @__PURE__ */ (0, G.jsx)(Oe, { className: `size-3.5 ${T.capabilities.touch ? "text-blue-600 dark:text-blue-400" : ""}` })
|
|
2031
|
-
}),
|
|
2032
|
-
nativeButton: !0
|
|
2033
|
-
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Touch: ", T.capabilities.touch ? "Enabled" : "Disabled"] })] }),
|
|
2034
|
-
/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2035
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2036
|
-
"data-testid": "debugger-hover-button",
|
|
2037
|
-
variant: "outline",
|
|
2038
|
-
size: "sm",
|
|
2039
|
-
className: `h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900 ${T.capabilities.hover ? "border-blue-500 dark:border-blue-400" : ""}`,
|
|
2040
|
-
onClick: () => {
|
|
2041
|
-
E({ capabilities: {
|
|
2042
|
-
...T.capabilities,
|
|
2043
|
-
hover: !T.capabilities.hover
|
|
2044
|
-
} });
|
|
2045
|
-
},
|
|
2046
|
-
children: /* @__PURE__ */ (0, G.jsx)(Ee, { className: `size-3.5 ${T.capabilities.hover ? "text-blue-600 dark:text-blue-400" : ""}` })
|
|
2047
|
-
}),
|
|
2048
|
-
nativeButton: !0
|
|
2049
|
-
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: ["Hover: ", T.capabilities.hover ? "Enabled" : "Disabled"] })] }),
|
|
2050
|
-
/* @__PURE__ */ (0, G.jsxs)(y, { children: [/* @__PURE__ */ (0, G.jsx)(g, {
|
|
2051
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2052
|
-
"data-testid": "debugger-safe-area-button",
|
|
2053
|
-
variant: "outline",
|
|
2054
|
-
size: "sm",
|
|
2055
|
-
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
2056
|
-
children: /* @__PURE__ */ (0, G.jsx)(Me, { className: "size-3.5" })
|
|
2057
|
-
}),
|
|
2058
|
-
nativeButton: !0
|
|
2059
|
-
}), /* @__PURE__ */ (0, G.jsx)(p, {
|
|
2060
|
-
className: "w-64 p-3",
|
|
2061
|
-
"data-testid": "debugger-safe-area-dialog",
|
|
2062
|
-
children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2063
|
-
className: "space-y-2",
|
|
2064
|
-
children: [/* @__PURE__ */ (0, G.jsx)("label", {
|
|
2065
|
-
className: "text-xs font-medium",
|
|
2066
|
-
children: "Safe Area Insets"
|
|
2067
|
-
}), /* @__PURE__ */ (0, G.jsx)(Qe, {
|
|
2068
|
-
value: T.safeAreaInsets,
|
|
2069
|
-
onChange: (e) => {
|
|
2070
|
-
E({ safeAreaInsets: e });
|
|
2071
|
-
}
|
|
2072
|
-
})]
|
|
2073
|
-
})
|
|
2074
|
-
})] }),
|
|
2075
|
-
i === "tool" ? /* @__PURE__ */ (0, G.jsxs)(oe, { children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2076
|
-
render: /* @__PURE__ */ (0, G.jsx)(te, {
|
|
2077
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2078
|
-
variant: "outline",
|
|
2079
|
-
size: "sm",
|
|
2080
|
-
className: "h-8 w-8 p-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm shadow-sm hover:bg-white dark:hover:bg-zinc-900",
|
|
2081
|
-
"data-testid": "debugger-props-button",
|
|
2082
|
-
children: /* @__PURE__ */ (0, G.jsx)(we, { className: "size-3.5" })
|
|
2083
|
-
}),
|
|
2084
|
-
nativeButton: !0
|
|
2085
|
-
}),
|
|
2086
|
-
nativeButton: !0
|
|
2087
|
-
}), /* @__PURE__ */ (0, G.jsx)(s, { children: "View Tool Props" })] }), /* @__PURE__ */ (0, G.jsxs)(ie, {
|
|
2088
|
-
scrollable: !0,
|
|
2089
|
-
className: "sm:max-w-[600px] max-h-[85vh]",
|
|
2090
|
-
"data-testid": "debugger-props-dialog",
|
|
2091
|
-
children: [/* @__PURE__ */ (0, G.jsx)(re, { children: /* @__PURE__ */ (0, G.jsx)(ee, { children: "Tool Props" }) }), /* @__PURE__ */ (0, G.jsx)(ne, { children: /* @__PURE__ */ (0, G.jsx)(ae, { children: /* @__PURE__ */ (0, G.jsx)(ue, {
|
|
2092
|
-
data: u ?? {},
|
|
2093
|
-
filename: "tool-props.json"
|
|
2094
|
-
}) }) })]
|
|
2095
|
-
})] }) : /* @__PURE__ */ (0, G.jsxs)(y, {
|
|
2096
|
-
open: ze,
|
|
2097
|
-
onOpenChange: Be,
|
|
2098
|
-
children: [/* @__PURE__ */ (0, G.jsxs)(o, { children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2099
|
-
render: /* @__PURE__ */ (0, G.jsx)(g, {
|
|
2100
|
-
render: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2101
|
-
variant: "outline",
|
|
2102
|
-
size: "sm",
|
|
2103
|
-
className: `h-8 w-8 p-0 backdrop-blur-sm shadow-sm ${W ? "bg-amber-50 dark:bg-amber-950/40 border-amber-300 dark:border-amber-700 hover:bg-amber-100 dark:hover:bg-amber-900/50 animate-pulse" : "bg-white/90 dark:bg-zinc-900/90 hover:bg-white dark:hover:bg-zinc-900"}`,
|
|
2104
|
-
"data-testid": "debugger-props-button",
|
|
2105
|
-
children: /* @__PURE__ */ (0, G.jsx)(we, { className: `size-3.5 ${W ? "text-amber-500" : ""}` })
|
|
2106
|
-
}),
|
|
2107
|
-
nativeButton: !0
|
|
2108
|
-
}),
|
|
2109
|
-
nativeButton: !0
|
|
2110
|
-
}), /* @__PURE__ */ (0, G.jsxs)(s, { children: [
|
|
2111
|
-
"Props:",
|
|
2112
|
-
" ",
|
|
2113
|
-
X === Q ? "No Props" : X === $ ? "Tool Props" : z.find((e) => e.id === X)?.name || "Custom"
|
|
2114
|
-
] })] }), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
2115
|
-
className: "w-64 p-2",
|
|
2116
|
-
"data-testid": "debugger-props-popover",
|
|
2117
|
-
children: [W && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2118
|
-
className: "mb-2 rounded-md border border-amber-200 dark:border-amber-800/50 bg-amber-50 dark:bg-amber-950/30 px-3 py-2",
|
|
2119
|
-
children: [
|
|
2120
|
-
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2121
|
-
className: "text-xs font-medium text-amber-700 dark:text-amber-300 mb-0.5",
|
|
2122
|
-
children: "Props required to render this widget:"
|
|
2123
|
-
}),
|
|
2124
|
-
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2125
|
-
className: "text-xs font-mono text-amber-600 dark:text-amber-400",
|
|
2126
|
-
children: b.join(", ")
|
|
2127
|
-
}),
|
|
2128
|
-
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2129
|
-
className: "text-xs text-amber-500 dark:text-amber-400 mt-1",
|
|
2130
|
-
children: "Create a preset below to set them."
|
|
2131
|
-
})
|
|
2132
|
-
]
|
|
2133
|
-
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2134
|
-
className: "space-y-1",
|
|
2135
|
-
children: [
|
|
2136
|
-
/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2137
|
-
variant: X === Q ? "secondary" : "ghost",
|
|
2138
|
-
size: "sm",
|
|
2139
|
-
className: "w-full justify-start",
|
|
2140
|
-
onClick: () => et(Q),
|
|
2141
|
-
"data-testid": "debugger-props-no-props",
|
|
2142
|
-
children: "No Props"
|
|
2143
|
-
}),
|
|
2144
|
-
z.map((e) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2145
|
-
className: "relative group flex items-center",
|
|
2146
|
-
children: [/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2147
|
-
variant: X === e.id ? "secondary" : "ghost",
|
|
2148
|
-
size: "sm",
|
|
2149
|
-
className: "w-full justify-start pr-14",
|
|
2150
|
-
onClick: () => et(e.id),
|
|
2151
|
-
"data-testid": `debugger-props-preset-${e.id}`,
|
|
2152
|
-
children: e.name
|
|
2153
|
-
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2154
|
-
className: "absolute right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2155
|
-
children: [/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2156
|
-
variant: "ghost",
|
|
2157
|
-
size: "sm",
|
|
2158
|
-
className: "h-6 w-6 p-0",
|
|
2159
|
-
onClick: (t) => st(e, t),
|
|
2160
|
-
"data-testid": `debugger-props-edit-${e.id}`,
|
|
2161
|
-
children: /* @__PURE__ */ (0, G.jsx)(M, { className: "h-3 w-3" })
|
|
2162
|
-
}), /* @__PURE__ */ (0, G.jsx)(c, {
|
|
2163
|
-
variant: "ghost",
|
|
2164
|
-
size: "sm",
|
|
2165
|
-
className: "h-6 w-6 p-0",
|
|
2166
|
-
onClick: (t) => ot(e.id, t),
|
|
2167
|
-
"data-testid": `debugger-props-delete-${e.id}`,
|
|
2168
|
-
children: /* @__PURE__ */ (0, G.jsx)(me, { className: "h-3 w-3 text-destructive" })
|
|
2169
|
-
})]
|
|
2170
|
-
})]
|
|
2171
|
-
}, e.id)),
|
|
2172
|
-
/* @__PURE__ */ (0, G.jsx)(c, {
|
|
2173
|
-
variant: "ghost",
|
|
2174
|
-
size: "sm",
|
|
2175
|
-
className: "w-full justify-start text-primary",
|
|
2176
|
-
onClick: () => et(nt),
|
|
2177
|
-
"data-testid": "debugger-props-create-preset",
|
|
2178
|
-
children: "+ Create Preset..."
|
|
2179
|
-
})
|
|
2180
|
-
]
|
|
2181
|
-
})]
|
|
2182
|
-
})]
|
|
2183
|
-
}),
|
|
2184
|
-
/* @__PURE__ */ (0, G.jsx)(Ke, {
|
|
2185
|
-
iframeId: n,
|
|
2186
|
-
enabled: !0
|
|
2187
|
-
}),
|
|
2188
|
-
_ && /* @__PURE__ */ (0, G.jsx)(Ze, {
|
|
2189
|
-
open: Ie,
|
|
2190
|
-
onOpenChange: U,
|
|
2191
|
-
onSave: at,
|
|
2192
|
-
existingPresets: z,
|
|
2193
|
-
resource: _,
|
|
2194
|
-
resourceAnnotations: f,
|
|
2195
|
-
llmConfig: h || null,
|
|
2196
|
-
editingPreset: K
|
|
2197
|
-
})
|
|
2198
|
-
]
|
|
2199
|
-
});
|
|
2200
|
-
}
|
|
2201
|
-
//#endregion
|
|
2202
|
-
//#region src/client/components/ui/WidgetWrapper.tsx
|
|
2203
|
-
function ot({ children: e, className: t, noWrapper: n }) {
|
|
2204
|
-
return n ? e : /* @__PURE__ */ (0, G.jsx)("div", {
|
|
2205
|
-
className: i("flex flex-1 items-center justify-center bg-zinc-50 dark:bg-zinc-800", "[background-image:radial-gradient(circle,rgba(0,0,0,0.12)_1px,transparent_1px)]", "dark:[background-image:radial-gradient(circle,rgba(255,255,255,0.1)_1px,transparent_1px)]", "bg-[length:32px_32px]", t),
|
|
2206
|
-
children: e
|
|
2207
|
-
});
|
|
2208
|
-
}
|
|
2209
|
-
//#endregion
|
|
2210
|
-
export { at as n, Te as r, ot as t };
|