@mcp-b/react-components 0.28.0 → 0.30.0
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/dist/{AgentActivity-D3OvrC02.d.ts → AgentActivity-SP1WfLDW.d.ts} +2 -2
- package/dist/{AgentChat-CHEz8ts_.d.ts → AgentChat-CV-GuYA6.d.ts} +29 -11
- package/dist/{AgentChatStartScreen-DXZ0hAX0.d.ts → AgentChatStartScreen-CO49yepa.d.ts} +2 -2
- package/dist/{AgentMessageParts-CyD2UB3V.d.ts → AgentMessageParts-C7L-Mv9U.d.ts} +2 -2
- package/dist/{AgentToolRunsContext-BVe4stgw.d.ts → AgentToolRunsContext-Cgve-Upx.d.ts} +1 -1
- package/dist/{BrowserLiveView-BV5qgFgI.d.ts → BrowserLiveView-tJTWkoyu.d.ts} +1 -1
- package/dist/{BrowserReplay-xWvRjRAC.d.ts → BrowserReplay-B0BQZr-N.d.ts} +1 -1
- package/dist/{Button-SBIz6Lqi.d.ts → Button-CZt3yywF.d.ts} +1 -1
- package/dist/{CodeBlock-BUfEhDia.js → CodeBlock-CM5gfmdq.js} +4 -69
- package/dist/{CodeBlock-yMpGqScn.d.ts → CodeBlock-DzGhYyNe.d.ts} +5 -11
- package/dist/{Combobox-DI6xcQjc.d.ts → Combobox-WrrDDaEv.d.ts} +1 -1
- package/dist/{Dialog-BD8NBKaE.d.ts → Dialog-DeOSJ0Oy.d.ts} +1 -1
- package/dist/{FileTree-XOLP3Yvo.js → FileTree-4WP4Uc_m.js} +65 -72
- package/dist/{IconButton-CFKhu6OR.d.ts → IconButton-BAUFhUk8.d.ts} +2 -2
- package/dist/{Menu-L6MZm-7N.d.ts → Menu-DVmjBIuM.d.ts} +1 -1
- package/dist/{ModelSelector-CRdvHT_b.js → ModelSelector-DzdEs2fX.js} +33 -31
- package/dist/{PromptInput-B75Np5VB.d.ts → PromptInput-DOyee1kM.d.ts} +28 -90
- package/dist/{Select-B_13gg_J.d.ts → Select-D96d09ww.d.ts} +1 -1
- package/dist/{SessionCompaction-DMa1vv6Y.d.ts → SessionCompaction-CmTJFpzj.d.ts} +32 -2
- package/dist/{Tabs-C49J5m0Q.d.ts → Tabs-Ptrbaynh.d.ts} +1 -1
- package/dist/{ThinkChat-Bp-nAnoW.js → ThinkChat-Dsm1xF3a.js} +47 -18
- package/dist/{ThinkChatActivity-C2uaL3el.d.ts → ThinkChatActivity-CgqpROz_.d.ts} +5 -5
- package/dist/{ThinkChatActivitySummary-F062wneC.d.ts → ThinkChatActivitySummary-teRjrPxW.d.ts} +3 -3
- package/dist/{ThinkChatContext-B-Nk84Wi.d.ts → ThinkChatContext-COIgzkYp.d.ts} +1 -1
- package/dist/{ThinkChatToolParts-BfroXQ4F.d.ts → ThinkChatToolParts-D4qcnnxt.d.ts} +3 -13
- package/dist/{ThinkExecutionRun-ChhWhOoU.d.ts → ThinkExecutionRun-lYYgyeE1.d.ts} +1 -1
- package/dist/{ThinkRecoveryNotice-D6gYcBbr.d.ts → ThinkRecoveryNotice-DGWr94rk.d.ts} +2 -2
- package/dist/{Toggle-JKZ43D5S.d.ts → Toggle-DLrIf5YH.d.ts} +1 -1
- package/dist/{ToggleGroup-BW1jrhAF.d.ts → ToggleGroup-CSBWfPXo.d.ts} +12 -12
- package/dist/{Workspace-Bn6In4wi.d.ts → Workspace-EhvvlHOB.d.ts} +2 -2
- package/dist/{WorkspaceExplorer-D0aiscG6.d.ts → WorkspaceExplorer-DygQnEyi.d.ts} +3 -3
- package/dist/{WorkspaceFile-DMtRMwVv.d.ts → WorkspaceFile-C8Riev9j.d.ts} +2 -2
- package/dist/{WorkspaceFileView-CKEmUyeT.js → WorkspaceFileView-hd1-cpuz.js} +12 -12
- package/dist/{WorkspaceLink-O-EBKUJ8.d.ts → WorkspaceLink-DQogVe8E.d.ts} +1 -1
- package/dist/{WorkspaceLink-BYYeTQLf.js → WorkspaceLink-DZeLe_jN.js} +3 -4
- package/dist/WorkspaceMessageResponse-BWbkIELl.js +100 -0
- package/dist/{attachment-preview-DIs50Q0h.js → attachment-preview-1CXJvrmb.js} +1 -1
- package/dist/components/{AgentActivity.d.ts → agents-sdk/AgentActivity.d.ts} +1 -1
- package/dist/components/{AgentActivity.js → agents-sdk/AgentActivity.js} +3 -3
- package/dist/components/{AgentActivityPreview.d.ts → agents-sdk/AgentActivityPreview.d.ts} +3 -3
- package/dist/components/{AgentActivityPreview.js → agents-sdk/AgentActivityPreview.js} +12 -10
- package/dist/components/{AgentChat.d.ts → agents-sdk/AgentChat.d.ts} +1 -1
- package/dist/components/{AgentChat.js → agents-sdk/AgentChat.js} +79 -41
- package/dist/components/{AgentToolRunsContext.d.ts → agents-sdk/AgentToolRunsContext.d.ts} +1 -1
- package/dist/components/{AgentToolRunsContext.js → agents-sdk/AgentToolRunsContext.js} +1 -1
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +2 -0
- package/dist/components/{BrowserLiveView.js → agents-sdk/BrowserLiveView.js} +7 -7
- package/dist/components/agents-sdk/BrowserReplay.d.ts +2 -0
- package/dist/components/{BrowserReplay.js → agents-sdk/BrowserReplay.js} +7 -7
- package/dist/components/{BrowserRunPanel.d.ts → agents-sdk/BrowserRunPanel.d.ts} +1 -1
- package/dist/components/{BrowserRunPanel.js → agents-sdk/BrowserRunPanel.js} +6 -6
- package/dist/components/{McpConnectionRequest.d.ts → agents-sdk/McpConnectionRequest.d.ts} +3 -15
- package/dist/components/{McpConnectionRequest.js → agents-sdk/McpConnectionRequest.js} +46 -18
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +39 -0
- package/dist/components/agents-sdk/McpConnectorForm.js +151 -0
- package/dist/components/{McpPluginCatalog.d.ts → agents-sdk/McpPluginCatalog.d.ts} +3 -3
- package/dist/components/{McpPluginCatalog.js → agents-sdk/McpPluginCatalog.js} +23 -47
- package/dist/components/{McpServerPicker.d.ts → agents-sdk/McpServerPicker.d.ts} +5 -5
- package/dist/components/{McpServerPicker.js → agents-sdk/McpServerPicker.js} +30 -40
- package/dist/components/{ModelSelector.d.ts → agents-sdk/ModelSelector.d.ts} +4 -4
- package/dist/components/{ModelSelector.js → agents-sdk/ModelSelector.js} +1 -1
- package/dist/components/agents-sdk/PromptInputApproval.d.ts +44 -0
- package/dist/components/agents-sdk/PromptInputApproval.js +61 -0
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +11 -0
- package/dist/components/agents-sdk/PromptInputCommands.js +33 -0
- package/dist/components/agents-sdk/SessionCompaction.d.ts +2 -0
- package/dist/components/{SessionCompaction.js → agents-sdk/SessionCompaction.js} +32 -11
- package/dist/components/{SubagentRunDetails.d.ts → agents-sdk/SubagentRunDetails.d.ts} +1 -1
- package/dist/components/{SubagentRunDetails.js → agents-sdk/SubagentRunDetails.js} +4 -4
- package/dist/components/{SubagentRunIndicator.d.ts → agents-sdk/SubagentRunIndicator.d.ts} +1 -1
- package/dist/components/{SubagentRunIndicator.js → agents-sdk/SubagentRunIndicator.js} +3 -3
- package/dist/components/{SubagentRunList.d.ts → agents-sdk/SubagentRunList.d.ts} +1 -1
- package/dist/components/{SubagentRunList.js → agents-sdk/SubagentRunList.js} +2 -2
- package/dist/components/{SubagentRunSelector.d.ts → agents-sdk/SubagentRunSelector.d.ts} +1 -1
- package/dist/components/{SubagentRunSelector.js → agents-sdk/SubagentRunSelector.js} +7 -7
- package/dist/components/{ThinkChat.d.ts → agents-sdk/ThinkChat.d.ts} +18 -16
- package/dist/components/{ThinkChat.js → agents-sdk/ThinkChat.js} +3 -3
- package/dist/components/{ThinkChatActivity.d.ts → agents-sdk/ThinkChatActivity.d.ts} +3 -3
- package/dist/components/{ThinkChatActivity.js → agents-sdk/ThinkChatActivity.js} +6 -6
- package/dist/components/{ThinkChatActivitySummary.d.ts → agents-sdk/ThinkChatActivitySummary.d.ts} +1 -1
- package/dist/components/{ThinkChatActivitySummary.js → agents-sdk/ThinkChatActivitySummary.js} +5 -4
- package/dist/components/{ThinkChatContext.d.ts → agents-sdk/ThinkChatContext.d.ts} +1 -1
- package/dist/components/{ThinkChatContext.js → agents-sdk/ThinkChatContext.js} +1 -1
- package/dist/components/{ThinkChatToolPanels.d.ts → agents-sdk/ThinkChatToolPanels.d.ts} +2 -2
- package/dist/components/{ThinkChatToolPanels.js → agents-sdk/ThinkChatToolPanels.js} +5 -5
- package/dist/components/agents-sdk/ThinkChatToolParts.d.ts +2 -0
- package/dist/components/{ThinkChatToolParts.js → agents-sdk/ThinkChatToolParts.js} +3 -33
- package/dist/components/{ThinkExecutionDetail.d.ts → agents-sdk/ThinkExecutionDetail.d.ts} +2 -2
- package/dist/components/{ThinkExecutionDetail.js → agents-sdk/ThinkExecutionDetail.js} +5 -8
- package/dist/components/{ThinkExecutionRun.d.ts → agents-sdk/ThinkExecutionRun.d.ts} +1 -1
- package/dist/components/{ThinkExecutionRun.js → agents-sdk/ThinkExecutionRun.js} +2 -2
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +35 -0
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +59 -0
- package/dist/components/{ThinkExecutionWorkbench.d.ts → agents-sdk/ThinkExecutionWorkbench.d.ts} +2 -2
- package/dist/components/{ThinkExecutionWorkbench.js → agents-sdk/ThinkExecutionWorkbench.js} +15 -32
- package/dist/components/{ThinkFullApp.d.ts → agents-sdk/ThinkFullApp.d.ts} +9 -9
- package/dist/components/{ThinkFullApp.js → agents-sdk/ThinkFullApp.js} +18 -20
- package/dist/components/{ThinkFullAppViewSwitch.d.ts → agents-sdk/ThinkFullAppViewSwitch.d.ts} +2 -2
- package/dist/components/{ThinkFullAppViewSwitch.js → agents-sdk/ThinkFullAppViewSwitch.js} +4 -4
- package/dist/components/{ThinkPendingApproval.d.ts → agents-sdk/ThinkPendingApproval.d.ts} +1 -1
- package/dist/components/{ThinkPendingApproval.js → agents-sdk/ThinkPendingApproval.js} +3 -3
- package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +2 -0
- package/dist/components/{ThinkRecoveryNotice.js → agents-sdk/ThinkRecoveryNotice.js} +3 -3
- package/dist/components/{ThinkRoutine.d.ts → agents-sdk/ThinkRoutine.d.ts} +2 -2
- package/dist/components/{ThinkRoutine.js → agents-sdk/ThinkRoutine.js} +1 -1
- package/dist/components/{ThinkRoutineBrowser.d.ts → agents-sdk/ThinkRoutineBrowser.d.ts} +1 -1
- package/dist/components/{ThinkRoutineBrowser.js → agents-sdk/ThinkRoutineBrowser.js} +9 -9
- package/dist/components/{ThinkRoutineDetail.d.ts → agents-sdk/ThinkRoutineDetail.d.ts} +1 -1
- package/dist/components/{ThinkRoutineDetail.js → agents-sdk/ThinkRoutineDetail.js} +4 -4
- package/dist/components/{ThinkRoutineForm.d.ts → agents-sdk/ThinkRoutineForm.d.ts} +1 -1
- package/dist/components/{ThinkRoutineForm.js → agents-sdk/ThinkRoutineForm.js} +9 -9
- package/dist/components/{ThinkRoutineLibrary.d.ts → agents-sdk/ThinkRoutineLibrary.d.ts} +2 -2
- package/dist/components/{ThinkRoutineLibrary.js → agents-sdk/ThinkRoutineLibrary.js} +12 -14
- package/dist/components/{ThinkRoutineRuns.d.ts → agents-sdk/ThinkRoutineRuns.d.ts} +2 -2
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +59 -0
- package/dist/components/{ThinkThreadPicker.d.ts → agents-sdk/ThinkThreadPicker.d.ts} +1 -1
- package/dist/components/{ThinkThreadPicker.js → agents-sdk/ThinkThreadPicker.js} +12 -14
- package/dist/components/{ThinkThreadShell.d.ts → agents-sdk/ThinkThreadShell.d.ts} +2 -2
- package/dist/components/{ThinkThreadShell.js → agents-sdk/ThinkThreadShell.js} +3 -3
- package/dist/components/{Workspace.d.ts → agents-sdk/Workspace.d.ts} +1 -1
- package/dist/components/{Workspace.js → agents-sdk/Workspace.js} +5 -7
- package/dist/components/{WorkspaceBrowser.d.ts → agents-sdk/WorkspaceBrowser.d.ts} +2 -2
- package/dist/components/{WorkspaceBrowser.js → agents-sdk/WorkspaceBrowser.js} +3 -3
- package/dist/components/{WorkspaceExplorer.d.ts → agents-sdk/WorkspaceExplorer.d.ts} +4 -4
- package/dist/components/{WorkspaceExplorer.js → agents-sdk/WorkspaceExplorer.js} +5 -5
- package/dist/components/{WorkspaceFile.d.ts → agents-sdk/WorkspaceFile.d.ts} +1 -1
- package/dist/components/{WorkspaceFile.js → agents-sdk/WorkspaceFile.js} +1 -1
- package/dist/components/{WorkspaceFileView.d.ts → agents-sdk/WorkspaceFileView.d.ts} +2 -2
- package/dist/components/agents-sdk/WorkspaceFileView.js +2 -0
- package/dist/components/{WorkspaceHeader.d.ts → agents-sdk/WorkspaceHeader.d.ts} +1 -1
- package/dist/components/{WorkspaceHeader.js → agents-sdk/WorkspaceHeader.js} +3 -3
- package/dist/components/{WorkspaceLink.d.ts → agents-sdk/WorkspaceLink.d.ts} +1 -1
- package/dist/components/{WorkspaceLink.js → agents-sdk/WorkspaceLink.js} +1 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +12 -0
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +2 -0
- package/dist/components/{WorkspaceMountManager.d.ts → agents-sdk/WorkspaceMountManager.d.ts} +1 -1
- package/dist/components/{WorkspaceMountManager.js → agents-sdk/WorkspaceMountManager.js} +8 -8
- package/dist/components/{Activity.d.ts → ai-sdk/Activity.d.ts} +4 -4
- package/dist/components/{Activity.js → ai-sdk/Activity.js} +6 -6
- package/dist/components/{AgentAttention.d.ts → ai-sdk/AgentAttention.d.ts} +2 -2
- package/dist/components/{AgentAttention.js → ai-sdk/AgentAttention.js} +3 -3
- package/dist/components/{AgentChatMessageEditor.d.ts → ai-sdk/AgentChatMessageEditor.d.ts} +1 -1
- package/dist/components/{AgentChatMessageEditor.js → ai-sdk/AgentChatMessageEditor.js} +5 -5
- package/dist/components/{AgentChatStartScreen.d.ts → ai-sdk/AgentChatStartScreen.d.ts} +1 -1
- package/dist/components/{AgentChatStartScreen.js → ai-sdk/AgentChatStartScreen.js} +5 -5
- package/dist/components/{AgentChatTurnError.d.ts → ai-sdk/AgentChatTurnError.d.ts} +1 -1
- package/dist/components/{AgentChatTurnError.js → ai-sdk/AgentChatTurnError.js} +2 -2
- package/dist/components/{AgentMessageParts.d.ts → ai-sdk/AgentMessageParts.d.ts} +1 -1
- package/dist/components/{AgentMessageParts.js → ai-sdk/AgentMessageParts.js} +4 -28
- package/dist/components/{Approval.d.ts → ai-sdk/Approval.d.ts} +1 -1
- package/dist/components/{Approval.js → ai-sdk/Approval.js} +5 -5
- package/dist/components/{Artifact.d.ts → ai-sdk/Artifact.d.ts} +2 -2
- package/dist/components/{Artifact.js → ai-sdk/Artifact.js} +4 -4
- package/dist/components/{ChainOfThought.d.ts → ai-sdk/ChainOfThought.d.ts} +3 -3
- package/dist/components/{ChainOfThought.js → ai-sdk/ChainOfThought.js} +4 -4
- package/dist/components/{Checkpoint.d.ts → ai-sdk/Checkpoint.d.ts} +2 -2
- package/dist/components/{Checkpoint.js → ai-sdk/Checkpoint.js} +4 -4
- package/dist/components/ai-sdk/CodeBlock.d.ts +2 -0
- package/dist/components/{CodeBlock.js → ai-sdk/CodeBlock.js} +2 -2
- package/dist/components/{Context.d.ts → ai-sdk/Context.d.ts} +2 -2
- package/dist/components/{Context.js → ai-sdk/Context.js} +5 -5
- package/dist/components/{Conversation.d.ts → ai-sdk/Conversation.d.ts} +2 -2
- package/dist/components/{Conversation.js → ai-sdk/Conversation.js} +5 -5
- package/dist/components/{ExpansionState.d.ts → ai-sdk/ExpansionState.d.ts} +1 -1
- package/dist/components/{ExpansionState.js → ai-sdk/ExpansionState.js} +1 -1
- package/dist/components/{Goal.d.ts → ai-sdk/Goal.d.ts} +1 -1
- package/dist/components/{Goal.js → ai-sdk/Goal.js} +6 -5
- package/dist/components/{InlineCitation.d.ts → ai-sdk/InlineCitation.d.ts} +1 -1
- package/dist/components/{InlineCitation.js → ai-sdk/InlineCitation.js} +4 -4
- package/dist/components/{MediaPreviewCard.d.ts → ai-sdk/MediaPreviewCard.d.ts} +2 -2
- package/dist/components/{MediaPreviewCard.js → ai-sdk/MediaPreviewCard.js} +5 -5
- package/dist/components/{Message.d.ts → ai-sdk/Message.d.ts} +2 -3
- package/dist/{Message-BF6SiKKL.js → components/ai-sdk/Message.js} +14 -99
- package/dist/components/{MessageScroller.d.ts → ai-sdk/MessageScroller.d.ts} +2 -2
- package/dist/components/{MessageScroller.js → ai-sdk/MessageScroller.js} +4 -4
- package/dist/components/{MessageScrollerVirtual.d.ts → ai-sdk/MessageScrollerVirtual.d.ts} +7 -8
- package/dist/components/{MessageScrollerVirtual.js → ai-sdk/MessageScrollerVirtual.js} +10 -10
- package/dist/components/{Plan.d.ts → ai-sdk/Plan.d.ts} +5 -6
- package/dist/components/{Plan.js → ai-sdk/Plan.js} +6 -6
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -0
- package/dist/components/{PromptInput.js → ai-sdk/PromptInput.js} +32 -130
- package/dist/components/{Queue.d.ts → ai-sdk/Queue.d.ts} +4 -4
- package/dist/components/{Queue.js → ai-sdk/Queue.js} +7 -7
- package/dist/components/{Reasoning.d.ts → ai-sdk/Reasoning.d.ts} +2 -2
- package/dist/components/{Reasoning.js → ai-sdk/Reasoning.js} +5 -5
- package/dist/components/{Sources.d.ts → ai-sdk/Sources.d.ts} +2 -2
- package/dist/components/{Sources.js → ai-sdk/Sources.js} +4 -4
- package/dist/components/{Task.d.ts → ai-sdk/Task.d.ts} +2 -2
- package/dist/components/{Task.js → ai-sdk/Task.js} +4 -4
- package/dist/components/{ToolApproval.d.ts → ai-sdk/ToolApproval.d.ts} +1 -1
- package/dist/components/{ToolApproval.js → ai-sdk/ToolApproval.js} +1 -1
- package/dist/components/{ToolInvocation.d.ts → ai-sdk/ToolInvocation.d.ts} +1 -1
- package/dist/components/{ToolInvocation.js → ai-sdk/ToolInvocation.js} +7 -9
- package/dist/components/ai-sdk/ToolPart.d.ts +11 -0
- package/dist/components/ai-sdk/ToolPart.js +15 -0
- package/dist/components/{ChatGptSignInScreen.d.ts → extension/ChatGptSignInScreen.d.ts} +1 -1
- package/dist/components/{ChatGptSignInScreen.js → extension/ChatGptSignInScreen.js} +5 -5
- package/dist/components/{CodexModelSelector.d.ts → extension/CodexModelSelector.d.ts} +3 -3
- package/dist/components/{CodexModelSelector.js → extension/CodexModelSelector.js} +6 -6
- package/dist/components/{ConversationTabPicker.d.ts → extension/ConversationTabPicker.d.ts} +1 -1
- package/dist/components/{ConversationTabPicker.js → extension/ConversationTabPicker.js} +7 -6
- package/dist/components/{Accordion.d.ts → foundations/Accordion.d.ts} +1 -1
- package/dist/components/{Accordion.js → foundations/Accordion.js} +3 -3
- package/dist/components/{AlertDialog.d.ts → foundations/AlertDialog.d.ts} +2 -2
- package/dist/components/{AlertDialog.js → foundations/AlertDialog.js} +2 -2
- package/dist/components/{AppIcon.d.ts → foundations/AppIcon.d.ts} +1 -1
- package/dist/components/{AppIcon.js → foundations/AppIcon.js} +2 -2
- package/dist/components/{Autocomplete.d.ts → foundations/Autocomplete.d.ts} +1 -1
- package/dist/components/{Autocomplete.js → foundations/Autocomplete.js} +2 -2
- package/dist/components/{Avatar.d.ts → foundations/Avatar.d.ts} +1 -1
- package/dist/components/{Avatar.js → foundations/Avatar.js} +2 -2
- package/dist/components/{Badge.d.ts → foundations/Badge.d.ts} +1 -1
- package/dist/components/{Badge.js → foundations/Badge.js} +1 -1
- package/dist/components/{Button.d.ts → foundations/Button.d.ts} +1 -1
- package/dist/components/{Button.js → foundations/Button.js} +2 -2
- package/dist/components/{Card.d.ts → foundations/Card.d.ts} +1 -1
- package/dist/components/{Card.js → foundations/Card.js} +2 -2
- package/dist/components/{Checkbox.d.ts → foundations/Checkbox.d.ts} +7 -3
- package/dist/components/{Checkbox.js → foundations/Checkbox.js} +9 -5
- package/dist/components/{CheckboxGroup.d.ts → foundations/CheckboxGroup.d.ts} +1 -1
- package/dist/components/{CheckboxGroup.js → foundations/CheckboxGroup.js} +2 -2
- package/dist/{Collapsible-N64ASIQr.d.ts → components/foundations/Collapsible.d.ts} +7 -7
- package/dist/components/{Collapsible.js → foundations/Collapsible.js} +2 -2
- package/dist/components/foundations/Combobox.d.ts +2 -0
- package/dist/components/{Combobox.js → foundations/Combobox.js} +2 -2
- package/dist/components/{ContextMenu.d.ts → foundations/ContextMenu.d.ts} +1 -1
- package/dist/components/{ContextMenu.js → foundations/ContextMenu.js} +3 -3
- package/dist/components/{DescriptionList.d.ts → foundations/DescriptionList.d.ts} +1 -1
- package/dist/components/{DescriptionList.js → foundations/DescriptionList.js} +1 -1
- package/dist/components/{DescriptionListParts.d.ts → foundations/DescriptionListParts.d.ts} +1 -1
- package/dist/components/{DescriptionListParts.js → foundations/DescriptionListParts.js} +2 -2
- package/dist/components/{Dialog.d.ts → foundations/Dialog.d.ts} +1 -1
- package/dist/components/{Dialog.js → foundations/Dialog.js} +2 -2
- package/dist/components/{EmptyState.d.ts → foundations/EmptyState.d.ts} +1 -1
- package/dist/components/{EmptyState.js → foundations/EmptyState.js} +2 -2
- package/dist/components/{Field.d.ts → foundations/Field.d.ts} +1 -1
- package/dist/components/{Field.js → foundations/Field.js} +2 -2
- package/dist/components/{Fieldset.d.ts → foundations/Fieldset.d.ts} +1 -1
- package/dist/components/{Fieldset.js → foundations/Fieldset.js} +2 -2
- package/dist/components/{Form.d.ts → foundations/Form.d.ts} +1 -1
- package/dist/components/{Form.js → foundations/Form.js} +2 -2
- package/dist/components/{FormattedDate.d.ts → foundations/FormattedDate.d.ts} +1 -1
- package/dist/components/{FormattedDate.js → foundations/FormattedDate.js} +1 -1
- package/dist/components/foundations/IconButton.d.ts +2 -0
- package/dist/components/{IconButton.js → foundations/IconButton.js} +1 -1
- package/dist/components/{Input.d.ts → foundations/Input.d.ts} +1 -1
- package/dist/components/{Input.js → foundations/Input.js} +2 -2
- package/dist/components/{Kbd.d.ts → foundations/Kbd.d.ts} +1 -1
- package/dist/components/{Kbd.js → foundations/Kbd.js} +2 -2
- package/dist/components/{Label.d.ts → foundations/Label.d.ts} +1 -1
- package/dist/components/{Label.js → foundations/Label.js} +2 -2
- package/dist/components/{LinkButton.d.ts → foundations/LinkButton.d.ts} +2 -2
- package/dist/components/{LinkButton.js → foundations/LinkButton.js} +1 -1
- package/dist/components/{Marker.d.ts → foundations/Marker.d.ts} +1 -1
- package/dist/components/{Marker.js → foundations/Marker.js} +2 -2
- package/dist/components/{Menu.d.ts → foundations/Menu.d.ts} +1 -1
- package/dist/components/{Menu.js → foundations/Menu.js} +2 -2
- package/dist/components/{Menubar.d.ts → foundations/Menubar.d.ts} +1 -1
- package/dist/components/{Menubar.js → foundations/Menubar.js} +3 -3
- package/dist/components/{Meter.d.ts → foundations/Meter.d.ts} +1 -1
- package/dist/components/{Meter.js → foundations/Meter.js} +2 -2
- package/dist/components/{NavigationMenu.d.ts → foundations/NavigationMenu.d.ts} +1 -1
- package/dist/components/{NavigationMenu.js → foundations/NavigationMenu.js} +2 -2
- package/dist/components/{NumberField.d.ts → foundations/NumberField.d.ts} +1 -1
- package/dist/components/{NumberField.js → foundations/NumberField.js} +2 -2
- package/dist/components/{Popover.d.ts → foundations/Popover.d.ts} +1 -1
- package/dist/components/{Popover.js → foundations/Popover.js} +3 -3
- package/dist/components/{PreviewCard.d.ts → foundations/PreviewCard.d.ts} +1 -1
- package/dist/components/{PreviewCard.js → foundations/PreviewCard.js} +2 -2
- package/dist/components/{Progress.d.ts → foundations/Progress.d.ts} +1 -1
- package/dist/components/{Progress.js → foundations/Progress.js} +2 -2
- package/dist/components/{RadioGroup.d.ts → foundations/RadioGroup.d.ts} +1 -1
- package/dist/components/{RadioGroup.js → foundations/RadioGroup.js} +2 -2
- package/dist/components/{ScrollArea.d.ts → foundations/ScrollArea.d.ts} +1 -1
- package/dist/components/{ScrollArea.js → foundations/ScrollArea.js} +2 -2
- package/dist/components/{SearchField.d.ts → foundations/SearchField.d.ts} +1 -1
- package/dist/components/{SearchField.js → foundations/SearchField.js} +3 -3
- package/dist/components/{Select.d.ts → foundations/Select.d.ts} +1 -1
- package/dist/components/{Select.js → foundations/Select.js} +3 -3
- package/dist/components/{Separator.d.ts → foundations/Separator.d.ts} +1 -1
- package/dist/components/{Separator.js → foundations/Separator.js} +2 -2
- package/dist/components/{Slider.d.ts → foundations/Slider.d.ts} +1 -1
- package/dist/components/{Slider.js → foundations/Slider.js} +2 -2
- package/dist/components/{StatusPill.d.ts → foundations/StatusPill.d.ts} +1 -1
- package/dist/components/{StatusPill.js → foundations/StatusPill.js} +2 -2
- package/dist/components/{Stepper.d.ts → foundations/Stepper.d.ts} +2 -2
- package/dist/components/{Stepper.js → foundations/Stepper.js} +3 -3
- package/dist/components/{Switch.d.ts → foundations/Switch.d.ts} +7 -7
- package/dist/components/{Switch.js → foundations/Switch.js} +8 -8
- package/dist/components/{Tabs.d.ts → foundations/Tabs.d.ts} +1 -1
- package/dist/components/{Tabs.js → foundations/Tabs.js} +2 -2
- package/dist/components/{Textarea.d.ts → foundations/Textarea.d.ts} +1 -1
- package/dist/components/{Textarea.js → foundations/Textarea.js} +2 -2
- package/dist/components/{ThemeProvider.d.ts → foundations/ThemeProvider.d.ts} +2 -2
- package/dist/components/{ThemeProvider.js → foundations/ThemeProvider.js} +2 -2
- package/dist/components/{Toast.d.ts → foundations/Toast.d.ts} +1 -1
- package/dist/components/{Toast.js → foundations/Toast.js} +3 -3
- package/dist/components/{Toggle.d.ts → foundations/Toggle.d.ts} +1 -1
- package/dist/components/{Toggle.js → foundations/Toggle.js} +2 -2
- package/dist/components/foundations/ToggleGroup.d.ts +2 -0
- package/dist/components/{ToggleGroup.js → foundations/ToggleGroup.js} +13 -13
- package/dist/components/{Toolbar.d.ts → foundations/Toolbar.d.ts} +1 -1
- package/dist/components/{Toolbar.js → foundations/Toolbar.js} +2 -2
- package/dist/components/{Tooltip.d.ts → foundations/Tooltip.d.ts} +1 -1
- package/dist/components/{Tooltip.js → foundations/Tooltip.js} +2 -2
- package/dist/components/{TransitionSurface.d.ts → foundations/TransitionSurface.d.ts} +1 -1
- package/dist/components/{TransitionSurface.js → foundations/TransitionSurface.js} +2 -2
- package/dist/components/{icons.d.ts → foundations/icons.d.ts} +1 -1
- package/dist/components/{icons.js → foundations/icons.js} +1 -1
- package/dist/components/{ActionGuide.d.ts → general-purpose/ActionGuide.d.ts} +2 -2
- package/dist/components/{ActionGuide.js → general-purpose/ActionGuide.js} +3 -3
- package/dist/components/general-purpose/AppFrame.d.ts +24 -0
- package/dist/components/general-purpose/AppFrame.js +25 -0
- package/dist/components/{AppTopBar.d.ts → general-purpose/AppTopBar.d.ts} +2 -2
- package/dist/components/{AppTopBar.js → general-purpose/AppTopBar.js} +5 -5
- package/dist/components/{Commit.d.ts → general-purpose/Commit.d.ts} +5 -12
- package/dist/components/{Commit.js → general-purpose/Commit.js} +11 -13
- package/dist/components/{EnvironmentVariables.d.ts → general-purpose/EnvironmentVariables.d.ts} +2 -4
- package/dist/components/{EnvironmentVariables.js → general-purpose/EnvironmentVariables.js} +9 -10
- package/dist/components/{FileTree.d.ts → general-purpose/FileTree.d.ts} +10 -1
- package/dist/components/{FileTree.js → general-purpose/FileTree.js} +1 -1
- package/dist/components/{Pricing.d.ts → general-purpose/Pricing.d.ts} +1 -1
- package/dist/components/{Pricing.js → general-purpose/Pricing.js} +1 -1
- package/dist/components/{PricingBillingToggle.d.ts → general-purpose/PricingBillingToggle.d.ts} +1 -1
- package/dist/components/{PricingBillingToggle.js → general-purpose/PricingBillingToggle.js} +7 -7
- package/dist/components/{PricingConfirmationDialog.d.ts → general-purpose/PricingConfirmationDialog.d.ts} +1 -1
- package/dist/components/{PricingConfirmationDialog.js → general-purpose/PricingConfirmationDialog.js} +3 -3
- package/dist/components/{PricingFAQ.d.ts → general-purpose/PricingFAQ.d.ts} +1 -1
- package/dist/components/{PricingFAQ.js → general-purpose/PricingFAQ.js} +3 -3
- package/dist/components/{PricingPage.d.ts → general-purpose/PricingPage.d.ts} +1 -1
- package/dist/components/{PricingPage.js → general-purpose/PricingPage.js} +2 -2
- package/dist/components/{PricingPlanCard.d.ts → general-purpose/PricingPlanCard.d.ts} +1 -1
- package/dist/components/{PricingPlanCard.js → general-purpose/PricingPlanCard.js} +8 -8
- package/dist/components/{PricingUsageCalculator.d.ts → general-purpose/PricingUsageCalculator.d.ts} +1 -1
- package/dist/components/{PricingUsageCalculator.js → general-purpose/PricingUsageCalculator.js} +6 -6
- package/dist/components/{ResizableSidePanel.d.ts → general-purpose/ResizableSidePanel.d.ts} +2 -2
- package/dist/components/{ResizableSidePanel.js → general-purpose/ResizableSidePanel.js} +4 -4
- package/dist/{ResponsiveSidebarShell-CsAh4NyL.d.ts → components/general-purpose/ResponsiveSidebarShell.d.ts} +2 -2
- package/dist/components/{ResponsiveSidebarShell.js → general-purpose/ResponsiveSidebarShell.js} +6 -6
- package/dist/components/{SettingsFormDialog.d.ts → general-purpose/SettingsFormDialog.d.ts} +1 -1
- package/dist/components/{SettingsFormDialog.js → general-purpose/SettingsFormDialog.js} +8 -7
- package/dist/components/{SetupChecklist.d.ts → general-purpose/SetupChecklist.d.ts} +1 -1
- package/dist/components/{SetupChecklist.js → general-purpose/SetupChecklist.js} +4 -4
- package/dist/components/{Shell.d.ts → general-purpose/Shell.d.ts} +1 -1
- package/dist/components/{Shell.js → general-purpose/Shell.js} +2 -2
- package/dist/components/{Terminal.d.ts → general-purpose/Terminal.d.ts} +3 -3
- package/dist/components/{Terminal.js → general-purpose/Terminal.js} +7 -7
- package/dist/components/{TestResults.d.ts → general-purpose/TestResults.d.ts} +2 -2
- package/dist/components/{TestResults.js → general-purpose/TestResults.js} +6 -6
- package/dist/components/{ThemeModeControl.d.ts → general-purpose/ThemeModeControl.d.ts} +1 -1
- package/dist/components/{ThemeModeControl.js → general-purpose/ThemeModeControl.js} +4 -4
- package/dist/components/{WebPreview.d.ts → general-purpose/WebPreview.d.ts} +4 -4
- package/dist/components/{WebPreview.js → general-purpose/WebPreview.js} +12 -12
- package/dist/components/{AgentConnection.d.ts → nanites/AgentConnection.d.ts} +2 -36
- package/dist/components/{AgentConnection.js → nanites/AgentConnection.js} +7 -149
- package/dist/components/{AgentToolDetail.d.ts → nanites/AgentToolDetail.d.ts} +4 -4
- package/dist/components/{AgentToolDetail.js → nanites/AgentToolDetail.js} +8 -8
- package/dist/components/{GithubMotionMark.d.ts → nanites/GithubMotionMark.d.ts} +1 -1
- package/dist/components/{GithubMotionMark.js → nanites/GithubMotionMark.js} +2 -2
- package/dist/components/{NaniteScene.d.ts → nanites/NaniteScene.d.ts} +1 -1
- package/dist/components/{NaniteScene.js → nanites/NaniteScene.js} +2 -2
- package/dist/{copy-button-EBv_B9F6.d.ts → copy-button-C0JyjClr.d.ts} +1 -1
- package/dist/{copy-button-7ttJAorN.js → copy-button-CsNSSKYG.js} +2 -2
- package/dist/{format-S6uWyoSb.js → format-CmopcfqJ.js} +4 -1
- package/dist/mcp-server-U71zhxFF.js +26 -0
- package/dist/{navigation-link-Cob7KBlM.js → navigation-link-kqMa81v5.js} +5 -1
- package/dist/{progress-ring-BjqTZqBk.js → progress-ring-Dz_ztrW2.js} +1 -1
- package/dist/styles/activity-header.css +5 -1
- package/dist/styles/agent-activity-preview-overlay.css +43 -5
- package/dist/styles/app-frame.css +15 -0
- package/dist/styles/file-tree.css +16 -2
- package/dist/styles/index.css +2 -1
- package/dist/styles/message-scroller.css +2 -3
- package/dist/styles/sources.css +8 -0
- package/dist/styles/think-execution-status.css +57 -0
- package/dist/styles/think-execution-workbench.css +1 -50
- package/dist/styles/think-routine-library.css +0 -27
- package/dist/utils/codex-model-catalog.d.ts +4 -4
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +2 -2
- package/dist/components/BrowserLiveView.d.ts +0 -2
- package/dist/components/BrowserReplay.d.ts +0 -2
- package/dist/components/CodeBlock.d.ts +0 -2
- package/dist/components/Collapsible.d.ts +0 -2
- package/dist/components/Combobox.d.ts +0 -2
- package/dist/components/IconButton.d.ts +0 -2
- package/dist/components/Message.js +0 -2
- package/dist/components/PromptInput.d.ts +0 -2
- package/dist/components/ResponsiveSidebarShell.d.ts +0 -2
- package/dist/components/SessionCompaction.d.ts +0 -2
- package/dist/components/ThinkChatToolParts.d.ts +0 -2
- package/dist/components/ThinkExecutionStatus.d.ts +0 -22
- package/dist/components/ThinkExecutionStatus.js +0 -36
- package/dist/components/ThinkRecoveryNotice.d.ts +0 -2
- package/dist/components/ThinkRoutineRuns.js +0 -76
- package/dist/components/ToggleGroup.d.ts +0 -2
- package/dist/components/WorkspaceFileView.js +0 -2
- package/dist/{icons-B4mGvCvc.js → icons-B1Qw05te.js} +1 -1
|
@@ -1,43 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
|
|
2
|
+
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
|
+
import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
|
+
import { Button } from "../foundations/Button.js";
|
|
5
|
+
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
6
|
+
import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
7
|
+
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
8
|
+
import { n as getMcpServerConnectionKind } from "../../mcp-server-U71zhxFF.js";
|
|
7
9
|
import * as React from "react";
|
|
8
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { getToolPartState } from "@cloudflare/think/react";
|
|
10
|
-
//#region src/components/McpConnectionRequest.tsx
|
|
12
|
+
//#region src/components/agents-sdk/McpConnectionRequest.tsx
|
|
11
13
|
/**
|
|
12
14
|
* In-chat MCP connection request backed by the AI SDK tool part and Agents MCP
|
|
13
15
|
* state. Failed and interrupted connections deliberately restart through the
|
|
14
16
|
* same `onConnect` seam instead of introducing recovery operations.
|
|
15
17
|
*/
|
|
16
|
-
function McpConnectionRequest(
|
|
18
|
+
function McpConnectionRequest(props) {
|
|
19
|
+
const { mcp, part, server, serverId } = props;
|
|
20
|
+
const entry = getMcpServerEntry(server, mcp);
|
|
21
|
+
const connectedServer = serverId === void 0 ? entry?.[1] : mcp?.servers[serverId];
|
|
22
|
+
const serverState = connectedServer ? getMcpServerRuntimeState(connectedServer) : void 0;
|
|
23
|
+
const actionStateKey = JSON.stringify([
|
|
24
|
+
part.toolCallId,
|
|
25
|
+
server.id,
|
|
26
|
+
server.url,
|
|
27
|
+
serverId ?? entry?.[0],
|
|
28
|
+
serverState,
|
|
29
|
+
connectedServer?.error
|
|
30
|
+
]);
|
|
31
|
+
return /* @__PURE__ */ jsx(McpConnectionRequestContent, { ...props }, actionStateKey);
|
|
32
|
+
}
|
|
33
|
+
function McpConnectionRequestContent({ part, server, reason, mcp, serverId, outcome, onConnect, onDecline, className, ref, ...props }) {
|
|
17
34
|
const [action, setAction] = React.useState(null);
|
|
18
35
|
const entry = getMcpServerEntry(server, mcp);
|
|
19
36
|
const connectedServer = serverId === void 0 ? entry?.[1] : mcp?.servers[serverId];
|
|
20
37
|
const serverState = connectedServer ? getMcpServerRuntimeState(connectedServer) : void 0;
|
|
21
|
-
const
|
|
22
|
-
const
|
|
38
|
+
const connectionKind = getMcpServerConnectionKind(connectedServer);
|
|
39
|
+
const pendingAction = action?.status === "pending" ? action.kind : null;
|
|
40
|
+
const actionError = action?.status === "error" ? action.error : null;
|
|
41
|
+
const failedAction = action?.status === "error" ? action.kind : null;
|
|
23
42
|
const toolState = part.state === "output-available" && part.preliminary === true ? "streaming" : getToolPartState(part);
|
|
24
43
|
const authorizationPending = outcome === "authorization-required" && toolState === "complete";
|
|
25
44
|
const settled = toolState === "error" || toolState === "denied" || toolState === "complete" && !authorizationPending;
|
|
26
45
|
const preparing = !settled && (toolState === "streaming" || toolState === "waiting-approval" || toolState === "approved");
|
|
27
|
-
const ready =
|
|
46
|
+
const ready = connectionKind === "connected";
|
|
28
47
|
const authorizationFailed = authorizationPending && (serverState === "failed" || serverState === "not-connected" || Boolean(connectedServer?.error) || Boolean(actionError));
|
|
29
48
|
const authorizing = authorizationPending && !ready && !authorizationFailed;
|
|
30
|
-
const connecting = !authorizationPending && (pendingAction === "connect" ||
|
|
31
|
-
const reconnect =
|
|
32
|
-
const connectionError = actionError ?? connectedServer?.error ?? (serverState === "failed" ? "
|
|
49
|
+
const connecting = !authorizationPending && (pendingAction === "connect" || connectionKind === "connecting");
|
|
50
|
+
const reconnect = failedAction === "connect" || connectionKind === "reconnect";
|
|
51
|
+
const connectionError = actionError ?? connectedServer?.error ?? (serverState === "failed" ? "The connection did not complete." : authorizationFailed ? "Connection did not complete." : void 0);
|
|
33
52
|
async function runAction(kind, callback) {
|
|
34
53
|
if (pendingAction) return;
|
|
35
|
-
|
|
54
|
+
const nextAction = {
|
|
55
|
+
kind,
|
|
56
|
+
status: "pending"
|
|
57
|
+
};
|
|
58
|
+
setAction(nextAction);
|
|
36
59
|
try {
|
|
37
60
|
await callback();
|
|
38
|
-
setAction(null);
|
|
61
|
+
setAction((current) => current === nextAction ? null : current);
|
|
39
62
|
} catch (error) {
|
|
40
|
-
|
|
63
|
+
const message = formatErrorMessage(error);
|
|
64
|
+
setAction((current) => current === nextAction ? {
|
|
65
|
+
error: message,
|
|
66
|
+
kind,
|
|
67
|
+
status: "error"
|
|
68
|
+
} : current);
|
|
41
69
|
}
|
|
42
70
|
}
|
|
43
71
|
if (settled) {
|
|
@@ -61,7 +89,7 @@ function McpConnectionRequest({ part, server, reason, mcp, serverId, outcome, on
|
|
|
61
89
|
}) }) : null]
|
|
62
90
|
});
|
|
63
91
|
}
|
|
64
|
-
const title = preparing ? "Preparing connection request" : authorizationFailed ? `Couldn’t connect ${server.name}` : authorizing ? `Authorizing ${server.name}` : connecting ? `Connecting ${server.name}` : ready ? `Connected to ${server.name}` : reconnect ?
|
|
92
|
+
const title = preparing ? "Preparing connection request" : authorizationFailed ? `Couldn’t connect ${server.name}` : authorizing ? `Authorizing ${server.name}` : connecting ? `Connecting ${server.name}` : ready ? `Connected to ${server.name}` : reconnect ? `${server.name} connection needs attention` : `${server.name} connection requested`;
|
|
65
93
|
const description = preparing ? "Reading assistant request" : authorizationFailed ? "Connection failed" : authorizing ? "The agent is completing sign-in" : connecting ? "Setting up connection" : ready ? "Connection is ready" : reconnect ? "The previous connection needs attention" : "Assistant requested access";
|
|
66
94
|
const connectLabel = pendingAction === "connect" ? "Connecting…" : ready ? "Continue" : reconnect ? `Reconnect ${server.name}` : `Connect ${server.name}`;
|
|
67
95
|
return /* @__PURE__ */ jsxs(AgentAttention, {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { d as McpServerSetupAuthFieldName, l as McpServerSetupAuth } from "../../mcp-server-catalog-CO7GAl1f.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/McpConnectorForm.d.ts
|
|
5
|
+
type CredentialFieldName = Exclude<McpServerSetupAuthFieldName, "redirectUrl">;
|
|
6
|
+
type McpConnectorFormValues = Readonly<Partial<Record<CredentialFieldName, string>> & {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly url: string;
|
|
9
|
+
}>;
|
|
10
|
+
type McpConnectorFormProps = Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "status"> & {
|
|
11
|
+
/** Authentication metadata that decides which credential fields render. */readonly auth?: McpServerSetupAuth; /** Initial connector values. Publisher client credentials remain app-owned. */
|
|
12
|
+
readonly defaults?: Partial<McpConnectorFormValues>; /** Optional pattern used to validate the MCP name field. */
|
|
13
|
+
readonly namePattern?: string; /** Keep a catalog-owned MCP name and URL visible but immutable. */
|
|
14
|
+
readonly readOnlyServer?: boolean; /** Read-only redirect URL shown for manual OAuth client setup. */
|
|
15
|
+
readonly redirectUrl?: string; /** Inline connection status announced politely to assistive tech. */
|
|
16
|
+
readonly status?: React.ReactNode; /** Label for the submit button. */
|
|
17
|
+
readonly submitLabel?: string; /** Label shown while submit is pending. */
|
|
18
|
+
readonly submittingLabel?: string; /** Called with normalized connector values after native form validation passes. */
|
|
19
|
+
readonly onSubmit: (values: McpConnectorFormValues) => void | Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
/** Collects MCP connector settings and optional credentials with native form validation. */
|
|
22
|
+
declare function McpConnectorForm({
|
|
23
|
+
auth,
|
|
24
|
+
className,
|
|
25
|
+
defaults,
|
|
26
|
+
namePattern,
|
|
27
|
+
readOnlyServer,
|
|
28
|
+
redirectUrl,
|
|
29
|
+
status,
|
|
30
|
+
submitLabel,
|
|
31
|
+
submittingLabel,
|
|
32
|
+
onSubmit,
|
|
33
|
+
ref,
|
|
34
|
+
...props
|
|
35
|
+
}: McpConnectorFormProps & {
|
|
36
|
+
ref?: React.Ref<HTMLFormElement>;
|
|
37
|
+
}): React.JSX.Element;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { McpConnectorForm, McpConnectorFormProps, McpConnectorFormValues };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { CUSTOM_MCP_SERVER_CARD } from "../../utils/mcp-server-catalog.js";
|
|
2
|
+
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
|
+
import { Button } from "../foundations/Button.js";
|
|
4
|
+
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
5
|
+
import { Field } from "../foundations/Field.js";
|
|
6
|
+
import { Form } from "../foundations/Form.js";
|
|
7
|
+
import { Fieldset } from "../foundations/Fieldset.js";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/agents-sdk/McpConnectorForm.tsx
|
|
11
|
+
const CUSTOM_AUTH_FIELDS = [{
|
|
12
|
+
inputType: "password",
|
|
13
|
+
label: "Bearer",
|
|
14
|
+
name: "bearerToken"
|
|
15
|
+
}];
|
|
16
|
+
/** Collects MCP connector settings and optional credentials with native form validation. */
|
|
17
|
+
function McpConnectorForm({ auth, className, defaults, namePattern, readOnlyServer = false, redirectUrl = "", status, submitLabel = "Connect MCP", submittingLabel = "Connecting", onSubmit, ref, ...props }) {
|
|
18
|
+
const [submission, setSubmission] = React.useState(null);
|
|
19
|
+
const credentialFields = (auth?.fields ?? CUSTOM_AUTH_FIELDS).filter(isCredentialAuthField);
|
|
20
|
+
const redirectUrlField = auth?.fields.find((field) => field.name === "redirectUrl");
|
|
21
|
+
async function handleSubmit(values) {
|
|
22
|
+
setSubmission(true);
|
|
23
|
+
try {
|
|
24
|
+
await onSubmit(readMcpConnectorFormValues(values));
|
|
25
|
+
setSubmission(null);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
setSubmission(formatErrorMessage(error));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return /* @__PURE__ */ jsxs(Form, {
|
|
31
|
+
ref,
|
|
32
|
+
"aria-label": "MCP connector",
|
|
33
|
+
className: cx("agent-connect__mcp-form", className),
|
|
34
|
+
onFormSubmit: handleSubmit,
|
|
35
|
+
...props,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsxs(Field.Root, {
|
|
38
|
+
name: "name",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx(Field.Label, { children: "MCP name" }),
|
|
41
|
+
/* @__PURE__ */ jsx(Field.Control, {
|
|
42
|
+
defaultValue: defaults?.name ?? CUSTOM_MCP_SERVER_CARD.id,
|
|
43
|
+
pattern: namePattern,
|
|
44
|
+
readOnly: readOnlyServer,
|
|
45
|
+
required: true,
|
|
46
|
+
title: namePattern ? "Use the required name format." : void 0
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx(Field.Error, {
|
|
49
|
+
match: "valueMissing",
|
|
50
|
+
children: "MCP name is required."
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ jsx(Field.Error, {
|
|
53
|
+
match: "patternMismatch",
|
|
54
|
+
children: "Use the required name format."
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ jsxs(Field.Root, {
|
|
59
|
+
name: "url",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(Field.Label, { children: "MCP URL" }),
|
|
62
|
+
/* @__PURE__ */ jsx(Field.Control, {
|
|
63
|
+
defaultValue: defaults?.url ?? "",
|
|
64
|
+
placeholder: "http://127.0.0.1:8787/mcp",
|
|
65
|
+
readOnly: readOnlyServer,
|
|
66
|
+
required: true,
|
|
67
|
+
type: "url"
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ jsx(Field.Error, {
|
|
70
|
+
match: "valueMissing",
|
|
71
|
+
children: "MCP URL is required."
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ jsx(Field.Error, {
|
|
74
|
+
match: "typeMismatch",
|
|
75
|
+
children: "MCP URL must use http or https."
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}),
|
|
79
|
+
redirectUrlField ? /* @__PURE__ */ jsxs(Field.Root, {
|
|
80
|
+
name: "redirectUrl",
|
|
81
|
+
children: [/* @__PURE__ */ jsx(Field.Label, { children: redirectUrlField.label }), /* @__PURE__ */ jsx(Field.Control, {
|
|
82
|
+
readOnly: true,
|
|
83
|
+
type: "url",
|
|
84
|
+
value: redirectUrl
|
|
85
|
+
})]
|
|
86
|
+
}) : null,
|
|
87
|
+
credentialFields.length > 0 ? /* @__PURE__ */ jsxs(Fieldset.Root, {
|
|
88
|
+
variant: "plain",
|
|
89
|
+
children: [/* @__PURE__ */ jsx(Fieldset.Legend, { children: auth?.label ?? "Credentials" }), /* @__PURE__ */ jsx(Field.Group, { children: credentialFields.map((authField) => /* @__PURE__ */ jsxs(Field.Root, {
|
|
90
|
+
name: authField.name,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx(Field.Label, { children: authField.label }),
|
|
93
|
+
/* @__PURE__ */ jsx(Field.Control, {
|
|
94
|
+
autoComplete: "off",
|
|
95
|
+
defaultValue: defaults?.[authField.name],
|
|
96
|
+
placeholder: authField.placeholder,
|
|
97
|
+
required: authField.required,
|
|
98
|
+
type: authField.inputType ?? "text"
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsxs(Field.Error, {
|
|
101
|
+
match: "valueMissing",
|
|
102
|
+
children: [authField.label, " is required."]
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
}, authField.name)) })]
|
|
106
|
+
}) : null,
|
|
107
|
+
/* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: "agent-connect__mcp-form-actions",
|
|
109
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
110
|
+
type: "submit",
|
|
111
|
+
size: "sm",
|
|
112
|
+
disabled: submission === true,
|
|
113
|
+
focusableWhenDisabled: submission === true,
|
|
114
|
+
children: submission === true ? submittingLabel : submitLabel
|
|
115
|
+
})
|
|
116
|
+
}),
|
|
117
|
+
typeof submission === "string" ? /* @__PURE__ */ jsx("span", {
|
|
118
|
+
className: "agent-connect__mcp-form-status",
|
|
119
|
+
"aria-atomic": "true",
|
|
120
|
+
role: "alert",
|
|
121
|
+
children: submission
|
|
122
|
+
}) : status ? /* @__PURE__ */ jsx("span", {
|
|
123
|
+
className: "agent-connect__mcp-form-status",
|
|
124
|
+
"aria-atomic": "true",
|
|
125
|
+
role: "status",
|
|
126
|
+
children: status
|
|
127
|
+
}) : null
|
|
128
|
+
]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function readMcpConnectorFormValues(data) {
|
|
132
|
+
const bearerToken = readFormString(data, "bearerToken");
|
|
133
|
+
const clientId = readFormString(data, "clientId");
|
|
134
|
+
const clientSecret = readFormString(data, "clientSecret");
|
|
135
|
+
return {
|
|
136
|
+
...bearerToken ? { bearerToken } : {},
|
|
137
|
+
...clientId ? { clientId } : {},
|
|
138
|
+
...clientSecret ? { clientSecret } : {},
|
|
139
|
+
name: readFormString(data, "name"),
|
|
140
|
+
url: readFormString(data, "url")
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function readFormString(data, name) {
|
|
144
|
+
const value = data[name];
|
|
145
|
+
return typeof value === "string" ? value.trim() : "";
|
|
146
|
+
}
|
|
147
|
+
function isCredentialAuthField(field) {
|
|
148
|
+
return field.name !== "redirectUrl";
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
export { McpConnectorForm };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { o as McpServerCard } from "
|
|
2
|
-
import { l as DialogProps } from "
|
|
1
|
+
import { o as McpServerCard } from "../../mcp-server-catalog-CO7GAl1f.js";
|
|
2
|
+
import { l as DialogProps } from "../../Dialog-DeOSJ0Oy.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { MCPServersState } from "agents";
|
|
5
5
|
|
|
6
|
-
//#region src/components/McpPluginCatalog.d.ts
|
|
6
|
+
//#region src/components/agents-sdk/McpPluginCatalog.d.ts
|
|
7
7
|
/** Optional plugin-specific copy layered over the canonical MCP server card. */
|
|
8
8
|
interface McpPluginDetails {
|
|
9
9
|
developerName?: string;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "
|
|
4
|
-
import { AppIcon } from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Dialog } from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { getMcpServerEntry } from "../../utils/mcp-server-catalog.js";
|
|
2
|
+
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
|
+
import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
|
+
import { AppIcon } from "../foundations/AppIcon.js";
|
|
5
|
+
import { Button } from "../foundations/Button.js";
|
|
6
|
+
import { IconButton } from "../foundations/IconButton.js";
|
|
7
|
+
import { Dialog } from "../foundations/Dialog.js";
|
|
8
|
+
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
9
|
+
import { Separator } from "../foundations/Separator.js";
|
|
10
|
+
import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
11
|
+
import { n as getMcpServerConnectionKind, t as McpServerIcon } from "../../mcp-server-U71zhxFF.js";
|
|
12
|
+
import { SearchField } from "../foundations/SearchField.js";
|
|
11
13
|
import * as React from "react";
|
|
12
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
//#region src/components/McpPluginCatalog.tsx
|
|
15
|
+
//#region src/components/agents-sdk/McpPluginCatalog.tsx
|
|
14
16
|
/**
|
|
15
17
|
* Searchable plugin directory backed by the same MCP cards and live Agents
|
|
16
18
|
* state as {@link McpServerPicker}. Selecting a row opens the shared details
|
|
@@ -66,7 +68,7 @@ function McpPluginCatalog({ servers, mcp, detailsByServerId, featuredServerIds =
|
|
|
66
68
|
tooltipSide: "bottom",
|
|
67
69
|
variant: "ghost",
|
|
68
70
|
onClick: () => setSelectedServer(server),
|
|
69
|
-
children: /* @__PURE__ */ jsx(
|
|
71
|
+
children: /* @__PURE__ */ jsx(McpServerIcon, { server })
|
|
70
72
|
}) }, `${server.id}:${server.url}`))
|
|
71
73
|
})]
|
|
72
74
|
}) : null,
|
|
@@ -110,7 +112,7 @@ function McpPluginCatalog({ servers, mcp, detailsByServerId, featuredServerIds =
|
|
|
110
112
|
/** Reference-derived plugin detail surface without a parallel install state. */
|
|
111
113
|
function McpPluginDetailsDialog({ server, details, mcp, brandName = "your AI", brandLogo = /* @__PURE__ */ jsx("img", {
|
|
112
114
|
alt: "",
|
|
113
|
-
src: new URL("
|
|
115
|
+
src: new URL("../../assets/think-browser-host.png", import.meta.url).href
|
|
114
116
|
}), disclosure = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
115
117
|
/* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: "You're in control." }), " This plugin is limited to the account and permissions you approve, and you can disconnect it at any time."] }),
|
|
116
118
|
/* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: "Plugins may introduce elevated risk." }), " Only connect tools you trust. A compromised plugin could use its access to read or change data in the connected service."] }),
|
|
@@ -146,7 +148,7 @@ function McpPluginDetailsDialog({ server, details, mcp, brandName = "your AI", b
|
|
|
146
148
|
className: "mcp-plugin-details__identity",
|
|
147
149
|
"aria-hidden": "true",
|
|
148
150
|
children: [
|
|
149
|
-
/* @__PURE__ */ jsx(
|
|
151
|
+
/* @__PURE__ */ jsx(McpServerIcon, {
|
|
150
152
|
server,
|
|
151
153
|
size: "xl",
|
|
152
154
|
variant: "surface"
|
|
@@ -201,7 +203,7 @@ function McpPluginCard({ server, details, mcp, onSelect }) {
|
|
|
201
203
|
size: "xl",
|
|
202
204
|
variant: "ghost",
|
|
203
205
|
onClick: onSelect,
|
|
204
|
-
children: [/* @__PURE__ */ jsx(
|
|
206
|
+
children: [/* @__PURE__ */ jsx(McpServerIcon, { server }), /* @__PURE__ */ jsxs("span", {
|
|
205
207
|
className: "mcp-plugin-catalog__card-copy",
|
|
206
208
|
children: [/* @__PURE__ */ jsx("span", {
|
|
207
209
|
className: "mcp-plugin-catalog__card-name sigvelo-truncate",
|
|
@@ -224,19 +226,6 @@ function McpPluginCard({ server, details, mcp, onSelect }) {
|
|
|
224
226
|
})]
|
|
225
227
|
});
|
|
226
228
|
}
|
|
227
|
-
function McpPluginAvatar({ server, size = "lg", variant }) {
|
|
228
|
-
const src = getMcpServerIconSrc(server);
|
|
229
|
-
return /* @__PURE__ */ jsxs(AppIcon.Root, {
|
|
230
|
-
size,
|
|
231
|
-
variant,
|
|
232
|
-
"aria-hidden": "true",
|
|
233
|
-
children: [src ? /* @__PURE__ */ jsx(AppIcon.Image, {
|
|
234
|
-
alt: "",
|
|
235
|
-
fit: "contain",
|
|
236
|
-
src
|
|
237
|
-
}, src) : null, /* @__PURE__ */ jsx(AppIcon.Fallback, { children: server.name.slice(0, 1) })]
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
229
|
function McpPluginDialogActions({ projection, server, onConnect, onDisconnect }) {
|
|
241
230
|
const [action, setAction] = React.useState({ pending: false });
|
|
242
231
|
if (!projection) return null;
|
|
@@ -255,7 +244,7 @@ function McpPluginDialogActions({ projection, server, onConnect, onDisconnect })
|
|
|
255
244
|
console.error(`MCP server ${disconnect ? "disconnect" : "connect"} failed`, error);
|
|
256
245
|
setAction({
|
|
257
246
|
pending: false,
|
|
258
|
-
error:
|
|
247
|
+
error: formatErrorMessage(error)
|
|
259
248
|
});
|
|
260
249
|
}
|
|
261
250
|
}
|
|
@@ -285,25 +274,12 @@ function McpPluginDialogActions({ projection, server, onConnect, onDisconnect })
|
|
|
285
274
|
}
|
|
286
275
|
function getServerProjection(server, mcp) {
|
|
287
276
|
const entry = getMcpServerEntry(server, mcp);
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
statusLabel: "Available"
|
|
291
|
-
};
|
|
292
|
-
const state = getMcpServerRuntimeState(entry[1]);
|
|
293
|
-
if (state === "ready") return {
|
|
294
|
-
kind: "connected",
|
|
295
|
-
serverId: entry[0],
|
|
296
|
-
statusLabel: "Connected"
|
|
297
|
-
};
|
|
298
|
-
if (state === "connecting" || state === "discovering" || state === "connected" && !entry[1].error) return {
|
|
299
|
-
kind: "connecting",
|
|
300
|
-
serverId: entry[0],
|
|
301
|
-
statusLabel: "Connecting"
|
|
302
|
-
};
|
|
277
|
+
const kind = getMcpServerConnectionKind(entry?.[1]);
|
|
278
|
+
const statusLabel = kind === "connected" ? "Connected" : kind === "connecting" ? "Connecting" : kind === "reconnect" ? "Needs attention" : "Available";
|
|
303
279
|
return {
|
|
304
|
-
kind
|
|
305
|
-
serverId: entry[0],
|
|
306
|
-
statusLabel
|
|
280
|
+
kind,
|
|
281
|
+
serverId: entry?.[0],
|
|
282
|
+
statusLabel
|
|
307
283
|
};
|
|
308
284
|
}
|
|
309
285
|
function getDialogTitle(name, kind, brandName) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { s as MenuItemProps, t as Menu } from "
|
|
2
|
-
import { o as McpServerCard } from "
|
|
3
|
-
import { McpConnectorFormProps } from "./
|
|
4
|
-
import { l as DialogProps } from "
|
|
1
|
+
import { s as MenuItemProps, t as Menu } from "../../Menu-DVmjBIuM.js";
|
|
2
|
+
import { o as McpServerCard } from "../../mcp-server-catalog-CO7GAl1f.js";
|
|
3
|
+
import { McpConnectorFormProps } from "./McpConnectorForm.js";
|
|
4
|
+
import { l as DialogProps } from "../../Dialog-DeOSJ0Oy.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { MCPServersState } from "agents";
|
|
7
7
|
|
|
8
|
-
//#region src/components/McpServerPicker.d.ts
|
|
8
|
+
//#region src/components/agents-sdk/McpServerPicker.d.ts
|
|
9
9
|
interface McpServerPickerProps {
|
|
10
10
|
/** MCP servers to show in the plus-menu picker. */
|
|
11
11
|
servers: readonly McpServerCard[];
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "
|
|
4
|
-
import {
|
|
5
|
-
import { Dialog } from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
|
|
2
|
+
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
3
|
+
import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
|
+
import { buttonVariants } from "../foundations/Button.js";
|
|
5
|
+
import { Dialog } from "../foundations/Dialog.js";
|
|
6
|
+
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
7
|
+
import { Menu } from "../foundations/Menu.js";
|
|
8
|
+
import { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger } from "../ai-sdk/PromptInput.js";
|
|
9
|
+
import { n as getMcpServerConnectionKind, t as McpServerIcon } from "../../mcp-server-U71zhxFF.js";
|
|
10
|
+
import { McpConnectorForm } from "./McpConnectorForm.js";
|
|
10
11
|
import * as React from "react";
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
//#region src/components/McpServerPicker.tsx
|
|
13
|
+
//#region src/components/agents-sdk/McpServerPicker.tsx
|
|
13
14
|
/** Manual MCP setup surface driven by the same catalog metadata as the picker. */
|
|
14
15
|
function McpServerSetupDialog({ server, defaults, onOpenChange, onSubmit, redirectUrl, status }) {
|
|
15
16
|
const formDefaults = server ? {
|
|
@@ -88,7 +89,7 @@ function McpServerPickerItems({ servers, onConnect, mcp, onDisconnect, actions,
|
|
|
88
89
|
await callback();
|
|
89
90
|
setAction(null);
|
|
90
91
|
} catch (error) {
|
|
91
|
-
setAction({ error:
|
|
92
|
+
setAction({ error: formatErrorMessage(error) });
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -159,12 +160,12 @@ function McpServerPickerRow({ row, onConnect, onDisconnect, pendingAction }) {
|
|
|
159
160
|
const connectedServerId = entry?.[0];
|
|
160
161
|
const connectedServer = entry?.[1];
|
|
161
162
|
const state = connectedServer ? getMcpServerRuntimeState(connectedServer) : void 0;
|
|
163
|
+
const connectionKind = getMcpServerConnectionKind(connectedServer);
|
|
162
164
|
const connectKey = `connect:${server.id}:${server.url}`;
|
|
163
|
-
const connecting =
|
|
164
|
-
const reconnectable = state === "authenticating" || state === "failed" || state === "not-connected" || state === "connected" && Boolean(connectedServer?.error);
|
|
165
|
+
const connecting = connectionKind === "connecting";
|
|
165
166
|
const pendingConnect = pendingAction === connectKey;
|
|
166
|
-
const statusText = pendingConnect ? "Connecting" : getStatusLabel(
|
|
167
|
-
const disabled = !onConnect || !(
|
|
167
|
+
const statusText = pendingConnect ? "Connecting" : getStatusLabel(connectionKind, state);
|
|
168
|
+
const disabled = !onConnect || !(connectionKind === "available" || connectionKind === "reconnect") || pendingAction !== null;
|
|
168
169
|
const description = connectedServer?.error || server.description;
|
|
169
170
|
const disconnectPending = pendingAction === `disconnect:${connectedServerId}`;
|
|
170
171
|
let disconnectLabel = state === "ready" ? `Disconnect ${server.name}` : `Remove ${server.name}`;
|
|
@@ -183,7 +184,10 @@ function McpServerPickerRow({ row, onConnect, onDisconnect, pendingAction }) {
|
|
|
183
184
|
children: [
|
|
184
185
|
/* @__PURE__ */ jsx("span", {
|
|
185
186
|
className: "mcp-server-picker__icon",
|
|
186
|
-
children: /* @__PURE__ */ jsx(McpServerIcon, {
|
|
187
|
+
children: /* @__PURE__ */ jsx(McpServerIcon, {
|
|
188
|
+
server,
|
|
189
|
+
size: "xs"
|
|
190
|
+
})
|
|
187
191
|
}),
|
|
188
192
|
/* @__PURE__ */ jsxs("span", {
|
|
189
193
|
className: "mcp-server-picker__copy",
|
|
@@ -207,9 +211,8 @@ function McpServerPickerRow({ row, onConnect, onDisconnect, pendingAction }) {
|
|
|
207
211
|
className: "mcp-server-picker__row-status",
|
|
208
212
|
title: statusText,
|
|
209
213
|
children: /* @__PURE__ */ jsx(StatusIcon, {
|
|
210
|
-
|
|
211
|
-
pending: pendingConnect
|
|
212
|
-
state
|
|
214
|
+
connectionKind,
|
|
215
|
+
pending: pendingConnect
|
|
213
216
|
})
|
|
214
217
|
}), connectedServerId && onDisconnect ? /* @__PURE__ */ jsxs(Menu.Item, {
|
|
215
218
|
className: "mcp-server-picker__action",
|
|
@@ -225,17 +228,16 @@ function McpServerPickerRow({ row, onConnect, onDisconnect, pendingAction }) {
|
|
|
225
228
|
}) : null]
|
|
226
229
|
});
|
|
227
230
|
}
|
|
228
|
-
function StatusIcon({
|
|
229
|
-
if (pending ||
|
|
230
|
-
if (
|
|
231
|
+
function StatusIcon({ connectionKind, pending }) {
|
|
232
|
+
if (pending || connectionKind === "connecting") return /* @__PURE__ */ jsx(SpinnerIcon, { size: 14 });
|
|
233
|
+
if (connectionKind === "connected") return /* @__PURE__ */ jsx(CheckIcon, { size: 14 });
|
|
231
234
|
return /* @__PURE__ */ jsx(WarningIcon, { size: 14 });
|
|
232
235
|
}
|
|
233
|
-
function getStatusLabel(
|
|
234
|
-
if (
|
|
235
|
-
if (
|
|
236
|
+
function getStatusLabel(connectionKind, state) {
|
|
237
|
+
if (connectionKind === "connected") return "Connected";
|
|
238
|
+
if (connectionKind === "connecting") return "Connecting";
|
|
236
239
|
if (state === "authenticating") return "Reconnect to sign in";
|
|
237
|
-
|
|
238
|
-
return "";
|
|
240
|
+
return connectionKind === "reconnect" ? "Reconnect" : "";
|
|
239
241
|
}
|
|
240
242
|
function getPickerRows(servers, mcp) {
|
|
241
243
|
const catalogRows = servers.map((server) => ({
|
|
@@ -257,7 +259,7 @@ function getPickerRows(servers, mcp) {
|
|
|
257
259
|
function groupPickerRows(rows) {
|
|
258
260
|
const groups = /* @__PURE__ */ new Map();
|
|
259
261
|
for (const row of rows) {
|
|
260
|
-
const key = (row.entry
|
|
262
|
+
const key = getMcpServerConnectionKind(row.entry?.[1]) === "connected" ? "Connected" : row.server.category === "Auto" ? "MCP connectors" : row.server.category === "Manual" ? "Manual setup" : row.server.category ?? "Other";
|
|
261
263
|
const group = groups.get(key) ?? [];
|
|
262
264
|
group.push(row);
|
|
263
265
|
groups.set(key, group);
|
|
@@ -270,17 +272,5 @@ function groupPickerRows(rows) {
|
|
|
270
272
|
];
|
|
271
273
|
return [...groups.entries()].sort(([left], [right]) => (order.indexOf(left) === -1 ? order.length : order.indexOf(left)) - (order.indexOf(right) === -1 ? order.length : order.indexOf(right)));
|
|
272
274
|
}
|
|
273
|
-
function McpServerIcon({ server }) {
|
|
274
|
-
const src = getMcpServerIconSrc(server);
|
|
275
|
-
return /* @__PURE__ */ jsxs(AppIcon.Root, {
|
|
276
|
-
size: "xs",
|
|
277
|
-
"aria-hidden": "true",
|
|
278
|
-
children: [src ? /* @__PURE__ */ jsx(AppIcon.Image, {
|
|
279
|
-
alt: "",
|
|
280
|
-
fit: "contain",
|
|
281
|
-
src
|
|
282
|
-
}, src) : null, /* @__PURE__ */ jsx(AppIcon.Fallback, { children: server.name.slice(0, 1) })]
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
275
|
//#endregion
|
|
286
276
|
export { McpServerPicker, McpServerPickerAction, McpServerPickerGroup, McpServerPickerItems, McpServerSetupDialog };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as ButtonProps } from "
|
|
2
|
-
import { l as DialogProps } from "
|
|
3
|
-
import { SeparatorProps } from "
|
|
1
|
+
import { r as ButtonProps } from "../../Button-CZt3yywF.js";
|
|
2
|
+
import { l as DialogProps } from "../../Dialog-DeOSJ0Oy.js";
|
|
3
|
+
import { SeparatorProps } from "../foundations/Separator.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import Cloudflare from "cloudflare";
|
|
6
6
|
import { AiModelsSearchObject } from "@cloudflare/workers-types";
|
|
7
7
|
|
|
8
|
-
//#region src/components/ModelSelector.d.ts
|
|
8
|
+
//#region src/components/agents-sdk/ModelSelector.d.ts
|
|
9
9
|
type CloudflareModelSelectorModels = readonly Cloudflare.AI.ModelListResponse[] | readonly CloudflareModelCatalogEntry[] | readonly AiModelsSearchObject[] | readonly string[];
|
|
10
10
|
interface CloudflareModelCatalogEntry {
|
|
11
11
|
readonly model_id: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as getCloudflareModelProvider, a as ModelSelectorEmpty, b as normalizeCloudflareModelSelectorModels, c as ModelSelectorItem, d as ModelSelectorLogoGroup, f as ModelSelectorName, g as formatCloudflareModelProvider, h as ModelSelectorTrigger, i as ModelSelectorDialog, l as ModelSelectorList, m as ModelSelectorSource, n as ModelSelector, o as ModelSelectorGroup, p as ModelSelectorSeparator, r as ModelSelectorContent, s as ModelSelectorInput, t as CloudflareModelSelector, u as ModelSelectorLogo, v as isCloudflareRunnableModelId, x as readCloudflareModelId, y as listCloudflareModelSelectorOptions } from "
|
|
1
|
+
import { _ as getCloudflareModelProvider, a as ModelSelectorEmpty, b as normalizeCloudflareModelSelectorModels, c as ModelSelectorItem, d as ModelSelectorLogoGroup, f as ModelSelectorName, g as formatCloudflareModelProvider, h as ModelSelectorTrigger, i as ModelSelectorDialog, l as ModelSelectorList, m as ModelSelectorSource, n as ModelSelector, o as ModelSelectorGroup, p as ModelSelectorSeparator, r as ModelSelectorContent, s as ModelSelectorInput, t as CloudflareModelSelector, u as ModelSelectorLogo, v as isCloudflareRunnableModelId, x as readCloudflareModelId, y as listCloudflareModelSelectorOptions } from "../../ModelSelector-DzdEs2fX.js";
|
|
2
2
|
export { CloudflareModelSelector, ModelSelector, ModelSelectorContent, ModelSelectorDialog, ModelSelectorEmpty, ModelSelectorGroup, ModelSelectorInput, ModelSelectorItem, ModelSelectorList, ModelSelectorLogo, ModelSelectorLogoGroup, ModelSelectorName, ModelSelectorSeparator, ModelSelectorSource, ModelSelectorTrigger, formatCloudflareModelProvider, getCloudflareModelProvider, isCloudflareRunnableModelId, listCloudflareModelSelectorOptions, normalizeCloudflareModelSelectorModels, readCloudflareModelId };
|