@julianpedro/plugin-dev-ai-hub 0.3.0 → 0.4.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/api/DevAiHubClient.esm.js +5 -0
- package/dist/api/DevAiHubClient.esm.js.map +1 -1
- package/dist/components/AdminPage/AdminPage.esm.js +106 -0
- package/dist/components/AdminPage/AdminPage.esm.js.map +1 -0
- package/dist/components/AdminPage/index.esm.js +6 -0
- package/dist/components/AdminPage/index.esm.js.map +1 -0
- package/dist/components/AssetCard/AssetCard.esm.js +36 -17
- package/dist/components/AssetCard/AssetCard.esm.js.map +1 -1
- package/dist/components/AssetDetailPanel/AssetDetailPanel.esm.js +10 -13
- package/dist/components/AssetDetailPanel/AssetDetailPanel.esm.js.map +1 -1
- package/dist/components/AssetFilters/AssetFilters.esm.js +5 -3
- package/dist/components/AssetFilters/AssetFilters.esm.js.map +1 -1
- package/dist/components/AssetHelpDialog/AssetHelpDialog.esm.js +1 -1
- package/dist/components/AssetHelpDialog/AssetHelpDialog.esm.js.map +1 -1
- package/dist/components/AssetInstallDialog/AssetInstallDialog.esm.js +3 -3
- package/dist/components/AssetInstallDialog/AssetInstallDialog.esm.js.map +1 -1
- package/dist/components/AssetsTab/AssetsTab.esm.js +221 -0
- package/dist/components/AssetsTab/AssetsTab.esm.js.map +1 -0
- package/dist/components/AssetsTab/index.esm.js +6 -0
- package/dist/components/AssetsTab/index.esm.js.map +1 -0
- package/dist/components/DevAiHubPage/DevAiHubPage.esm.js +194 -111
- package/dist/components/DevAiHubPage/DevAiHubPage.esm.js.map +1 -1
- package/dist/components/McpConfigDialog/McpConfigDialog.esm.js +3 -581
- package/dist/components/McpConfigDialog/McpConfigDialog.esm.js.map +1 -1
- package/dist/components/McpPage/McpPage.esm.js +478 -0
- package/dist/components/McpPage/McpPage.esm.js.map +1 -0
- package/dist/components/McpPage/index.esm.js +6 -0
- package/dist/components/McpPage/index.esm.js.map +1 -0
- package/dist/components/ModelIcon/ModelBadge.esm.js +73 -0
- package/dist/components/ModelIcon/ModelBadge.esm.js.map +1 -0
- package/dist/components/ModelIcon/ModelIcon.esm.js +45 -0
- package/dist/components/ModelIcon/ModelIcon.esm.js.map +1 -0
- package/dist/components/ToolIcon/ToolIcon.esm.js +1 -1
- package/dist/components/ToolIcon/ToolIcon.esm.js.map +1 -1
- package/dist/context/UiConfigContext.esm.js +79 -0
- package/dist/context/UiConfigContext.esm.js.map +1 -0
- package/dist/hooks/index.esm.js +22 -1
- package/dist/hooks/index.esm.js.map +1 -1
- package/dist/index.d.ts +140 -20
- package/dist/index.esm.js +1 -1
- package/dist/locales/es.esm.js +18 -9
- package/dist/locales/es.esm.js.map +1 -1
- package/dist/locales/pt-BR.esm.js +18 -9
- package/dist/locales/pt-BR.esm.js.map +1 -1
- package/dist/plugin.esm.js +35 -6
- package/dist/plugin.esm.js.map +1 -1
- package/dist/translation.esm.js +27 -11
- package/dist/translation.esm.js.map +1 -1
- package/package.json +15 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpConfigDialog.esm.js","sources":["../../../src/components/McpConfigDialog/McpConfigDialog.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Chip from '@mui/material/Chip';\nimport Collapse from '@mui/material/Collapse';\nimport Dialog from '@mui/material/Dialog';\nimport Grid from '@mui/material/Grid';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport Divider from '@mui/material/Divider';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport IconButton from '@mui/material/IconButton';\nimport Switch from '@mui/material/Switch';\nimport Tab from '@mui/material/Tab';\nimport Tabs from '@mui/material/Tabs';\nimport Tooltip from '@mui/material/Tooltip';\nimport Typography from '@mui/material/Typography';\nimport { useTheme } from '@mui/material/styles';\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy';\nimport CheckIcon from '@mui/icons-material/Check';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\nimport StorageIcon from '@mui/icons-material/Storage';\nimport OpenInBrowserIcon from '@mui/icons-material/OpenInBrowser';\nimport AppsIcon from '@mui/icons-material/Apps';\nimport TuneIcon from '@mui/icons-material/Tune';\nimport { useApi, discoveryApiRef } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { ToolIcon } from '../ToolIcon';\nimport { useCopyToClipboard, useMcpCatalog, useProviders } from '../../hooks';\nimport type { AiTool, McpCatalogEntry } from '@julianpedro/plugin-dev-ai-hub-common';\nimport { devAiHubTranslationRef } from '../../translation';\n\ninterface ToolConfig {\n tool: AiTool;\n label: string;\n file: string;\n description: string;\n buildConfig: (mcpUrl: string) => string;\n}\n\nconst TYPE_ACCENT: Record<string, string> = {\n http: '#2563EB',\n stdio: '#059669',\n};\n\nfunction providerLabel(target: string): string {\n return target.split('/').pop()?.replace(/\\.git$/, '') ?? target;\n}\n\n// ─── MCP Catalog entry card ───────────────────────────────────────────────────\n\ninterface CatalogEntryCardProps {\n entry: McpCatalogEntry;\n}\n\nfunction CatalogEntryCard({ entry }: CatalogEntryCardProps) {\n const { t } = useTranslationRef(devAiHubTranslationRef);\n const accent = TYPE_ACCENT[entry.type] ?? '#64748b';\n\n const handleInstallVscode = () => {\n const config: Record<string, unknown> = { name: entry.id, type: entry.type };\n if (entry.type === 'http') config.url = entry.url;\n if (entry.type === 'stdio') {\n config.command = entry.command;\n if (entry.args?.length) config.args = entry.args;\n if (entry.env && Object.keys(entry.env).length) config.env = entry.env;\n }\n window.location.href = `vscode:mcp/install?${encodeURIComponent(JSON.stringify(config))}`;\n };\n\n const handleInstallCursor = () => {\n const config: Record<string, unknown> = { type: entry.type };\n if (entry.type === 'http') config.url = entry.url;\n if (entry.type === 'stdio') {\n config.command = entry.command;\n if (entry.args?.length) config.args = entry.args;\n if (entry.env && Object.keys(entry.env).length) config.env = entry.env;\n }\n window.location.href = `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(entry.name)}&config=${btoa(JSON.stringify(config))}`;\n };\n\n const canInstall =\n (entry.type === 'http' && !!entry.url) ||\n (entry.type === 'stdio' && !!entry.command);\n\n return (\n <Box\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderLeft: `3px solid ${accent}`,\n borderRadius: 2,\n p: 2,\n display: 'flex',\n flexDirection: 'column',\n gap: 1.25,\n height: '100%',\n minHeight: 148,\n transition: 'all 0.15s ease',\n '&:hover': {\n boxShadow: `0 4px 16px ${accent}25`,\n borderColor: `${accent}60`,\n },\n }}\n >\n <Box sx={{ display: 'flex', alignItems: 'flex-start', gap: 1.25 }}>\n <Box\n sx={{\n width: 48,\n height: 48,\n borderRadius: 2,\n backgroundColor: `${accent}18`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n boxShadow: `0 2px 8px ${accent}20`,\n }}\n >\n {entry.icon ? (\n <Box\n component=\"img\"\n src={entry.icon}\n alt={entry.name}\n sx={{ width: 32, height: 32, objectFit: 'contain' }}\n onError={e => { (e.target as HTMLImageElement).style.display = 'none'; }}\n />\n ) : (\n <StorageIcon sx={{ fontSize: '1.4rem', color: accent }} />\n )}\n </Box>\n\n <Box sx={{ flex: 1, minWidth: 0 }}>\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75, mb: 0.25, flexWrap: 'wrap' }}>\n <Typography variant=\"subtitle2\" fontWeight={700} noWrap title={entry.name} sx={{ flex: 1 }}>\n {entry.name}\n </Typography>\n <Chip\n label={entry.type}\n size=\"small\"\n sx={{\n height: 18,\n fontSize: '0.6rem',\n fontFamily: 'monospace',\n fontWeight: 700,\n bgcolor: `${accent}18`,\n color: accent,\n border: '1px solid',\n borderColor: `${accent}40`,\n }}\n />\n </Box>\n {entry.description && (\n <Typography variant=\"caption\" color=\"text.secondary\" title={entry.description} sx={{ display: 'block', lineHeight: 1.4 }}>\n {entry.description}\n </Typography>\n )}\n {entry.type === 'http' && entry.url && (\n <Typography\n variant=\"caption\"\n sx={{ display: 'block', fontFamily: 'monospace', fontSize: '0.68rem', color: 'text.disabled', mt: 0.25, wordBreak: 'break-all' }}\n >\n {entry.url}\n </Typography>\n )}\n {entry.type === 'stdio' && entry.command && (\n <Typography\n variant=\"caption\"\n sx={{ display: 'block', fontFamily: 'monospace', fontSize: '0.68rem', color: 'text.disabled', mt: 0.25 }}\n >\n {[entry.command, ...(entry.args ?? [])].join(' ')}\n </Typography>\n )}\n </Box>\n </Box>\n\n {canInstall && (\n <Divider sx={{ mt: 'auto' }} />\n )}\n {canInstall && (\n <Box sx={{ display: 'flex', gap: 0.75 }}>\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<OpenInBrowserIcon sx={{ fontSize: '0.85rem !important' }} />}\n onClick={handleInstallVscode}\n fullWidth\n sx={{\n fontSize: '0.75rem',\n fontWeight: 700,\n py: 0.5,\n borderColor: `${accent}50`,\n color: accent,\n '&:hover': { borderColor: accent, bgcolor: `${accent}0a` },\n }}\n >\n {t('mcpConfigDialog.installInVscode')}\n </Button>\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<ToolIcon tool=\"cursor\" branded={false} sx={{ fontSize: '0.85rem !important', color: `${accent} !important` }} />}\n onClick={handleInstallCursor}\n fullWidth\n sx={{\n fontSize: '0.75rem',\n fontWeight: 700,\n py: 0.5,\n borderColor: `${accent}50`,\n color: accent,\n '&:hover': { borderColor: accent, bgcolor: `${accent}0a` },\n }}\n >\n {t('mcpConfigDialog.installInCursor')}\n </Button>\n </Box>\n )}\n </Box>\n );\n}\n\n// ─── Main dialog ──────────────────────────────────────────────────────────────\n\ninterface McpConfigDialogProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function McpConfigDialog({ open, onClose }: McpConfigDialogProps) {\n const theme = useTheme();\n const { t } = useTranslationRef(devAiHubTranslationRef);\n const discoveryApi = useApi(discoveryApiRef);\n const { copy: copyUrl, copied: copiedUrl } = useCopyToClipboard();\n const { copy: copySnippet, copied: copiedSnippet } = useCopyToClipboard();\n const [tab, setTab] = useState(0);\n const [baseUrl, setBaseUrl] = useState('');\n const [selectedProvider, setSelectedProvider] = useState<string>('');\n const [proactiveEnabled, setProactiveEnabled] = useState(false);\n const [toolConfigExpanded, setToolConfigExpanded] = useState(false);\n const [manualExpanded, setManualExpanded] = useState(false);\n\n const { providers } = useProviders();\n const { catalog } = useMcpCatalog();\n const showProviderFilter = providers.length > 1;\n\n const toolConfigs = useMemo<ToolConfig[]>(() => [\n {\n tool: 'claude-code',\n label: 'Claude Code',\n file: '.mcp.json',\n description: t('mcpConfigDialog.claudeConfigDesc'),\n buildConfig: url => JSON.stringify({\n mcpServers: { 'dev-ai-hub': { type: 'http', url } },\n }, null, 2),\n },\n {\n tool: 'github-copilot',\n label: 'GitHub Copilot',\n file: '.vscode/settings.json',\n description: t('mcpConfigDialog.copilotConfigDesc'),\n buildConfig: url => JSON.stringify({\n 'github.copilot.chat.mcp.servers': { 'dev-ai-hub': { type: 'http', url } },\n }, null, 2),\n },\n {\n tool: 'google-gemini',\n label: 'Google Gemini',\n file: 'gemini-config.json',\n description: t('mcpConfigDialog.geminiConfigDesc'),\n buildConfig: url => JSON.stringify({\n mcpServers: { 'dev-ai-hub': { url } },\n }, null, 2),\n },\n {\n tool: 'cursor',\n label: 'Cursor',\n file: '.cursor/mcp.json',\n description: t('mcpConfigDialog.cursorConfigDesc'),\n buildConfig: url => JSON.stringify({\n mcpServers: { 'dev-ai-hub': { type: 'http', url } },\n }, null, 2),\n },\n ], [t]);\n\n useEffect(() => {\n if (open) {\n discoveryApi.getBaseUrl('dev-ai-hub').then(url => setBaseUrl(url));\n }\n }, [open, discoveryApi]);\n\n const cfg = toolConfigs[tab] ?? toolConfigs[0];\n\n const buildMcpUrl = () => {\n if (!baseUrl) return 'loading...';\n const params = new URLSearchParams();\n params.set('tool', cfg.tool);\n if (selectedProvider) params.set('provider', selectedProvider);\n if (proactiveEnabled) params.set('proactive', 'true');\n return `${baseUrl}/mcp?${params.toString()}`;\n };\n\n const mcpUrl = buildMcpUrl();\n const configSnippet = baseUrl ? cfg.buildConfig(mcpUrl) : '';\n\n const handleInstallInVscode = () => {\n if (!baseUrl) return;\n const config = JSON.stringify({ name: 'dev-ai-hub', type: 'http', url: mcpUrl });\n window.location.href = `vscode:mcp/install?${encodeURIComponent(config)}`;\n };\n\n const handleInstallInCursor = () => {\n if (!baseUrl) return;\n const config = btoa(JSON.stringify({ type: 'http', url: mcpUrl }));\n window.location.href = `cursor://anysphere.cursor-deeplink/mcp/install?name=dev-ai-hub&config=${config}`;\n };\n\n const showVscodeButton = cfg.tool === 'github-copilot';\n const showCursorButton = cfg.tool === 'cursor';\n\n return (\n <Dialog open={open} onClose={onClose} maxWidth=\"md\" fullWidth>\n <DialogTitle sx={{ pb: 1 }}>\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5 }}>\n <Box\n sx={{\n width: 36, height: 36, borderRadius: 1.5,\n background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',\n display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0,\n boxShadow: '0 2px 8px #6366f140',\n }}\n >\n <AppsIcon sx={{ color: '#fff', fontSize: '1.2rem' }} />\n </Box>\n <Box>\n <Typography variant=\"h6\" fontWeight={700} sx={{ lineHeight: 1.2 }}>\n {t('mcpConfigDialog.title')}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {t('mcpConfigDialog.subtitle')}\n </Typography>\n </Box>\n </Box>\n </DialogTitle>\n\n <DialogContent sx={{ pt: 0 }}>\n {/* ── Section 1: MCP Catalog ── */}\n <Box sx={{ mb: 2 }}>\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75, mb: 1, pt: 0.5 }}>\n <AppsIcon sx={{ fontSize: '0.95rem', color: 'text.secondary' }} />\n <Typography\n variant=\"caption\"\n fontWeight={700}\n color=\"text.secondary\"\n sx={{ textTransform: 'uppercase', letterSpacing: 0.8, flex: 1 }}\n >\n {t('mcpConfigDialog.catalogTab')}\n </Typography>\n {catalog.length > 0 && (\n <Chip\n label={catalog.length}\n size=\"small\"\n sx={{ height: 18, fontSize: '0.65rem', fontWeight: 700, bgcolor: 'action.selected', color: 'text.secondary', border: '1px solid', borderColor: 'divider' }}\n />\n )}\n </Box>\n\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ mb: 1.5, fontSize: '0.8rem' }}>\n {t('mcpConfigDialog.catalogDescription')}\n </Typography>\n\n {catalog.length === 0 ? (\n <Box\n sx={{\n border: '1px dashed',\n borderColor: 'divider',\n borderRadius: 2,\n p: 3,\n textAlign: 'center',\n }}\n >\n <AppsIcon sx={{ fontSize: '2rem', color: 'text.disabled', mb: 1 }} />\n <Typography variant=\"body2\" color=\"text.secondary\">\n {t('mcpConfigDialog.catalogEmpty')}\n </Typography>\n <Typography variant=\"caption\" color=\"text.disabled\">\n {t('mcpConfigDialog.catalogAddHint')}\n </Typography>\n </Box>\n ) : (\n <Grid container spacing={1.5}>\n {catalog.map(entry => (\n <Grid item xs={12} sm={6} key={entry.id}>\n <CatalogEntryCard entry={entry} />\n </Grid>\n ))}\n </Grid>\n )}\n </Box>\n\n <Divider sx={{ mb: 0 }} />\n\n {/* ── Section 2: Tool Config (collapsible) ── */}\n <Box>\n <Box\n onClick={() => setToolConfigExpanded(v => !v)}\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 0.75,\n cursor: 'pointer',\n userSelect: 'none',\n py: 1.25,\n '&:hover': { opacity: 0.8 },\n }}\n >\n <TuneIcon sx={{ fontSize: '0.95rem', color: 'text.secondary' }} />\n <Typography\n variant=\"caption\"\n fontWeight={700}\n color=\"text.secondary\"\n sx={{ textTransform: 'uppercase', letterSpacing: 0.8, flex: 1 }}\n >\n {t('mcpConfigDialog.toolConfigSection')}\n </Typography>\n <ExpandMoreIcon\n fontSize=\"small\"\n sx={{\n color: 'text.disabled',\n transition: 'transform 0.2s ease',\n transform: toolConfigExpanded ? 'rotate(180deg)' : 'rotate(0deg)',\n }}\n />\n </Box>\n\n <Collapse in={toolConfigExpanded}>\n {/* Tool tabs */}\n <Tabs\n value={tab}\n onChange={(_, v) => setTab(v)}\n sx={{ mb: 2, borderBottom: 1, borderColor: 'divider' }}\n >\n {toolConfigs.map((toolCfg, i) => (\n <Tab\n key={toolCfg.tool}\n value={i}\n sx={{\n color: 'text.secondary',\n minHeight: 40,\n '&.Mui-selected': { color: 'primary.main' },\n '&:hover': {\n backgroundColor: 'transparent',\n color: 'text.primary',\n },\n '&.Mui-selected:hover': {\n backgroundColor: 'transparent',\n },\n }}\n label={\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75 }}>\n <ToolIcon tool={toolCfg.tool} branded={false} sx={{ fontSize: '1rem' }} />\n <span>{toolCfg.label}</span>\n </Box>\n }\n />\n ))}\n </Tabs>\n\n {/* Provider filter — only shown when there are 2+ providers */}\n {showProviderFilter && (\n <Box sx={{ mb: 2 }}>\n <Typography variant=\"caption\" fontWeight={600} color=\"text.secondary\" sx={{ textTransform: 'uppercase', letterSpacing: 0.5, display: 'block', mb: 0.75 }}>\n {t('mcpConfigDialog.scopeToProvider')}\n </Typography>\n <Box sx={{ display: 'flex', gap: 0.75, flexWrap: 'wrap' }}>\n <Chip\n label={t('mcpConfigDialog.allProviders')}\n size=\"small\"\n clickable\n onClick={() => setSelectedProvider('')}\n sx={{\n fontWeight: 600,\n fontSize: '0.75rem',\n borderRadius: 2,\n border: '1.5px solid',\n borderColor: !selectedProvider ? 'text.primary' : 'divider',\n backgroundColor: !selectedProvider ? 'text.primary' : 'transparent',\n color: !selectedProvider ? 'background.paper' : 'text.secondary',\n transition: 'all 0.15s ease',\n }}\n />\n {providers.map(p => {\n const isSelected = selectedProvider === p.id;\n const label = providerLabel(p.target);\n return (\n <Chip\n key={p.id}\n icon={<StorageIcon sx={{ fontSize: '0.8rem !important', color: isSelected ? 'background.paper' : 'inherit' }} />}\n label={label}\n size=\"small\"\n clickable\n onClick={() => setSelectedProvider(isSelected ? '' : p.id)}\n sx={{\n fontWeight: 600,\n fontSize: '0.75rem',\n borderRadius: 2,\n border: '1.5px solid',\n borderColor: isSelected ? 'text.primary' : 'divider',\n backgroundColor: isSelected ? 'text.primary' : 'transparent',\n color: isSelected ? 'background.paper' : 'text.secondary',\n transition: 'all 0.15s ease',\n }}\n />\n );\n })}\n </Box>\n </Box>\n )}\n\n {/* Proactive suggestions toggle */}\n <Box sx={{ mb: 2 }}>\n <FormControlLabel\n control={\n <Switch\n size=\"small\"\n checked={proactiveEnabled}\n onChange={e => setProactiveEnabled(e.target.checked)}\n />\n }\n label={\n <Box>\n <Typography variant=\"body2\" fontWeight={600}>{t('mcpConfigDialog.proactiveSuggestions')}</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {t('mcpConfigDialog.proactiveDescription')}\n </Typography>\n </Box>\n }\n sx={{ alignItems: 'flex-start', ml: 0, gap: 1 }}\n />\n </Box>\n\n {/* MCP URL */}\n <Typography variant=\"caption\" fontWeight={600} color=\"text.secondary\" sx={{ textTransform: 'uppercase', letterSpacing: 0.5 }}>\n {t('mcpConfigDialog.mcpEndpoint')}\n </Typography>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 1,\n mt: 0.5,\n mb: (showVscodeButton || showCursorButton) ? 1.5 : 1.5,\n px: 1.5,\n py: 1,\n borderRadius: 1.5,\n border: '1px solid',\n borderColor: 'divider',\n backgroundColor: theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.03)',\n }}\n >\n <Typography\n variant=\"body2\"\n sx={{ flex: 1, fontFamily: 'monospace', fontSize: '0.8rem', wordBreak: 'break-all' }}\n >\n {mcpUrl}\n </Typography>\n <Tooltip title={copiedUrl ? t('assetInstallDialog.copied') : t('mcpConfigDialog.copyUrl')}>\n <IconButton size=\"small\" onClick={() => copyUrl(mcpUrl)}>\n {copiedUrl ? <CheckIcon fontSize=\"small\" color=\"success\" /> : <ContentCopyIcon fontSize=\"small\" />}\n </IconButton>\n </Tooltip>\n </Box>\n\n {showVscodeButton && (\n <Button\n variant=\"contained\"\n startIcon={<OpenInBrowserIcon />}\n onClick={handleInstallInVscode}\n disabled={!baseUrl}\n fullWidth\n sx={{ mb: 2, fontSize: '0.8rem' }}\n >\n {t('mcpConfigDialog.installInVscode')}\n </Button>\n )}\n\n {showCursorButton && (\n <Button\n variant=\"contained\"\n startIcon={<ToolIcon tool=\"cursor\" branded={false} sx={{ fontSize: '1rem !important' }} />}\n onClick={handleInstallInCursor}\n disabled={!baseUrl}\n fullWidth\n sx={{ mb: 2, fontSize: '0.8rem' }}\n >\n {t('mcpConfigDialog.installInCursor')}\n </Button>\n )}\n\n <Divider sx={{ mb: 1.5 }} />\n\n {/* Manual config snippet — collapsed by default */}\n <Box\n onClick={() => setManualExpanded(v => !v)}\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n cursor: 'pointer',\n userSelect: 'none',\n py: 0.75,\n }}\n >\n <Typography variant=\"caption\" fontWeight={600} color=\"text.secondary\" sx={{ textTransform: 'uppercase', letterSpacing: 0.5 }}>\n {t('mcpConfigDialog.manualConfig', { file: cfg.file })}\n </Typography>\n <ExpandMoreIcon\n fontSize=\"small\"\n sx={{\n color: 'text.disabled',\n transition: 'transform 0.2s ease',\n transform: manualExpanded ? 'rotate(180deg)' : 'rotate(0deg)',\n }}\n />\n </Box>\n\n <Collapse in={manualExpanded}>\n <Typography variant=\"caption\" color=\"text.secondary\" sx={{ display: 'block', mb: 1, mt: 0.5 }}>\n {cfg.description}\n </Typography>\n <Box sx={{ position: 'relative' }}>\n <Box\n component=\"pre\"\n sx={{\n m: 0,\n p: 2,\n borderRadius: 2,\n border: '1px solid',\n borderColor: 'divider',\n backgroundColor: theme.palette.mode === 'dark' ? '#0d1117' : '#f6f8fa',\n color: theme.palette.mode === 'dark' ? '#e6edf3' : '#24292f',\n fontFamily: 'monospace',\n fontSize: '0.8rem',\n overflowX: 'auto',\n whiteSpace: 'pre',\n }}\n >\n {configSnippet}\n </Box>\n <Tooltip title={copiedSnippet ? t('assetInstallDialog.copied') : t('mcpConfigDialog.copyUrl')}>\n <IconButton\n size=\"small\"\n onClick={e => { e.stopPropagation(); copySnippet(configSnippet); }}\n sx={{\n position: 'absolute',\n top: 8,\n right: 8,\n backgroundColor: theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.06)',\n '&:hover': {\n backgroundColor: theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.2)' : 'rgba(0,0,0,0.12)',\n },\n }}\n >\n {copiedSnippet ? <CheckIcon fontSize=\"small\" color=\"success\" /> : <ContentCopyIcon fontSize=\"small\" />}\n </IconButton>\n </Tooltip>\n </Box>\n\n <Typography variant=\"caption\" color=\"text.disabled\" sx={{ display: 'block', mt: 1.5 }}>\n {t('mcpConfigDialog.omitToolHint')}\n </Typography>\n </Collapse>\n </Collapse>\n </Box>\n </DialogContent>\n\n <DialogActions>\n <Button onClick={onClose}>{t('mcpConfigDialog.close')}</Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,WAAA,GAAsC;AAAA,EAC1C,IAAA,EAAM,SAAA;AAAA,EACN,KAAA,EAAO;AACT,CAAA;AAEA,SAAS,cAAc,MAAA,EAAwB;AAC7C,EAAA,OAAO,MAAA,CAAO,MAAM,GAAG,CAAA,CAAE,KAAI,EAAG,OAAA,CAAQ,QAAA,EAAU,EAAE,CAAA,IAAK,MAAA;AAC3D;AAQA,SAAS,gBAAA,CAAiB,EAAE,KAAA,EAAM,EAA0B;AAC1D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,sBAAsB,CAAA;AACtD,EAAA,MAAM,MAAA,GAAS,WAAA,CAAY,KAAA,CAAM,IAAI,CAAA,IAAK,SAAA;AAE1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F;AAAA,kBAEC,QAAA,EAAA,aAAA,mBAAgB,GAAA,CAAC,SAAA,EAAA,EAAU,QAAA,EAAS,OAAA,EAAQ,KAAA,EAAM,SAAA,EAAU,CAAA,mBAAK,GAAA,CAAC,eAAA,EAAA,EAAgB,QAAA,EAAS,OAAA,EAAQ;AAAA;AAAA,eACtG,EACF;AAAA,aAAA,EACF,CAAA;AAAA,4BAEA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EAAU,OAAM,eAAA,EAAgB,EAAA,EAAI,EAAE,OAAA,EAAS,SAAS,EAAA,EAAI,GAAA,EAAI,EACjF,QAAA,EAAA,CAAA,CAAE,8BAA8B,CAAA,EACnC;AAAA,WAAA,EACF;AAAA,SAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EACF,CAAA;AAAA,oBAEA,GAAA,CAAC,iBACC,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,SAAS,OAAA,EAAU,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAAE,CAAA,EACxD;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"McpConfigDialog.esm.js","sources":["../../../src/components/McpConfigDialog/McpConfigDialog.tsx"],"sourcesContent":["import Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport Typography from '@mui/material/Typography';\nimport AppsIcon from '@mui/icons-material/Apps';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { devAiHubTranslationRef } from '../../translation';\nimport { McpPage } from '../McpPage';\n\ninterface McpConfigDialogProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function McpConfigDialog({ open, onClose }: McpConfigDialogProps) {\n const { t } = useTranslationRef(devAiHubTranslationRef);\n\n return (\n <Dialog open={open} onClose={onClose} maxWidth=\"md\" fullWidth>\n <DialogTitle sx={{ pb: 1 }}>\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5 }}>\n <Box\n sx={{\n width: 36, height: 36, borderRadius: 1.5,\n background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',\n display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0,\n boxShadow: '0 2px 8px #6366f140',\n }}\n >\n <AppsIcon sx={{ color: '#fff', fontSize: '1.2rem' }} />\n </Box>\n <Box>\n <Typography variant=\"h6\" fontWeight={700} sx={{ lineHeight: 1.2 }}>\n {t('mcpConfigDialog.title')}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {t('mcpConfigDialog.subtitle')}\n </Typography>\n </Box>\n </Box>\n </DialogTitle>\n\n <DialogContent sx={{ pt: 0 }}>\n {/* Only mount McpPage when dialog is open so useEffect fires on each open */}\n {open && <McpPage embedded />}\n </DialogContent>\n\n <DialogActions>\n <Button onClick={onClose}>{t('mcpConfigDialog.close')}</Button>\n </DialogActions>\n </Dialog>\n );\n}"],"names":[],"mappings":";;;;;;;;;;;;;AAiBO,SAAS,eAAA,CAAgB,EAAE,IAAA,EAAM,OAAA,EAAQ,EAAyB;AACvE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,sBAAsB,CAAA;AAEtD,EAAA,4BACG,MAAA,EAAA,EAAO,IAAA,EAAY,SAAkB,QAAA,EAAS,IAAA,EAAK,WAAS,IAAA,EAC3D,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,eAAY,EAAA,EAAI,EAAE,EAAA,EAAI,CAAA,IACrB,QAAA,kBAAA,IAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,EAAE,SAAS,MAAA,EAAQ,UAAA,EAAY,QAAA,EAAU,GAAA,EAAK,KAAI,EACzD,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,GAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAI;AAAA,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ragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useMemo, useEffect } from 'react';
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
|
+
import Button from '@mui/material/Button';
|
|
5
|
+
import Card from '@mui/material/Card';
|
|
6
|
+
import CardActions from '@mui/material/CardActions';
|
|
7
|
+
import CardContent from '@mui/material/CardContent';
|
|
8
|
+
import Chip from '@mui/material/Chip';
|
|
9
|
+
import Collapse from '@mui/material/Collapse';
|
|
10
|
+
import Divider from '@mui/material/Divider';
|
|
11
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
12
|
+
import Grid from '@mui/material/Grid';
|
|
13
|
+
import IconButton from '@mui/material/IconButton';
|
|
14
|
+
import Switch from '@mui/material/Switch';
|
|
15
|
+
import Tab from '@mui/material/Tab';
|
|
16
|
+
import Tabs from '@mui/material/Tabs';
|
|
17
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
18
|
+
import Typography from '@mui/material/Typography';
|
|
19
|
+
import { useTheme, alpha } from '@mui/material/styles';
|
|
20
|
+
import AppsIcon from '@mui/icons-material/Apps';
|
|
21
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
22
|
+
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
|
23
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
24
|
+
import OpenInBrowserIcon from '@mui/icons-material/OpenInBrowser';
|
|
25
|
+
import StorageIcon from '@mui/icons-material/Storage';
|
|
26
|
+
import TuneIcon from '@mui/icons-material/Tune';
|
|
27
|
+
import { Content } from '@backstage/core-components';
|
|
28
|
+
import { useApi, discoveryApiRef } from '@backstage/core-plugin-api';
|
|
29
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
30
|
+
import { devAiHubTranslationRef } from '../../translation.esm.js';
|
|
31
|
+
import { ToolIcon } from '../ToolIcon/ToolIcon.esm.js';
|
|
32
|
+
import { useCopyToClipboard, useProviders, useMcpCatalog } from '../../hooks/index.esm.js';
|
|
33
|
+
|
|
34
|
+
const TYPE_ACCENT = {
|
|
35
|
+
http: "#2563EB",
|
|
36
|
+
stdio: "#059669"
|
|
37
|
+
};
|
|
38
|
+
function providerLabel(target) {
|
|
39
|
+
return target.split("/").pop()?.replace(/\.git$/, "") ?? target;
|
|
40
|
+
}
|
|
41
|
+
function CatalogEntryCard({ entry }) {
|
|
42
|
+
const { t } = useTranslationRef(devAiHubTranslationRef);
|
|
43
|
+
const accent = TYPE_ACCENT[entry.type] ?? "#64748b";
|
|
44
|
+
const handleInstallVscode = () => {
|
|
45
|
+
const config = { name: entry.id, type: entry.type };
|
|
46
|
+
if (entry.type === "http") config.url = entry.url;
|
|
47
|
+
if (entry.type === "stdio") {
|
|
48
|
+
config.command = entry.command;
|
|
49
|
+
if (entry.args?.length) config.args = entry.args;
|
|
50
|
+
if (entry.env && Object.keys(entry.env).length) config.env = entry.env;
|
|
51
|
+
}
|
|
52
|
+
window.location.href = `vscode:mcp/install?${encodeURIComponent(JSON.stringify(config))}`;
|
|
53
|
+
};
|
|
54
|
+
const handleInstallCursor = () => {
|
|
55
|
+
const config = { type: entry.type };
|
|
56
|
+
if (entry.type === "http") config.url = entry.url;
|
|
57
|
+
if (entry.type === "stdio") {
|
|
58
|
+
config.command = entry.command;
|
|
59
|
+
if (entry.args?.length) config.args = entry.args;
|
|
60
|
+
if (entry.env && Object.keys(entry.env).length) config.env = entry.env;
|
|
61
|
+
}
|
|
62
|
+
window.location.href = `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(entry.name)}&config=${btoa(JSON.stringify(config))}`;
|
|
63
|
+
};
|
|
64
|
+
const canInstall = entry.type === "http" && !!entry.url || entry.type === "stdio" && !!entry.command;
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
Card,
|
|
67
|
+
{
|
|
68
|
+
variant: "outlined",
|
|
69
|
+
sx: {
|
|
70
|
+
height: "100%",
|
|
71
|
+
display: "flex",
|
|
72
|
+
flexDirection: "column",
|
|
73
|
+
borderRadius: 2,
|
|
74
|
+
border: "1px solid",
|
|
75
|
+
borderColor: "divider",
|
|
76
|
+
borderLeft: `3px solid ${accent}`,
|
|
77
|
+
transition: "all 0.18s ease",
|
|
78
|
+
"&:hover": {
|
|
79
|
+
boxShadow: `0 6px 24px ${accent}30`,
|
|
80
|
+
borderColor: accent,
|
|
81
|
+
transform: "translateY(-2px)"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsxs(CardContent, { sx: { p: 1.5, pb: "0 !important", flex: 1 }, children: [
|
|
86
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "flex-start", gap: 1, mb: 1 }, children: [
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
Box,
|
|
89
|
+
{
|
|
90
|
+
sx: {
|
|
91
|
+
width: 40,
|
|
92
|
+
height: 40,
|
|
93
|
+
borderRadius: 1.5,
|
|
94
|
+
backgroundColor: alpha(accent, 0.12),
|
|
95
|
+
display: "flex",
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
justifyContent: "center",
|
|
98
|
+
flexShrink: 0,
|
|
99
|
+
boxShadow: `0 2px 8px ${accent}25`
|
|
100
|
+
},
|
|
101
|
+
children: entry.icon ? /* @__PURE__ */ jsx(
|
|
102
|
+
Box,
|
|
103
|
+
{
|
|
104
|
+
component: "img",
|
|
105
|
+
src: entry.icon,
|
|
106
|
+
alt: entry.name,
|
|
107
|
+
sx: { width: 26, height: 26, objectFit: "contain" },
|
|
108
|
+
onError: (e) => {
|
|
109
|
+
e.target.style.display = "none";
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
) : /* @__PURE__ */ jsx(StorageIcon, { sx: { color: accent, fontSize: "1.3rem" } })
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
116
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5, mb: 0.2 }, children: [
|
|
117
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", fontWeight: 700, noWrap: true, title: entry.name, sx: { lineHeight: 1.2, flex: 1 }, children: entry.name }),
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
Chip,
|
|
120
|
+
{
|
|
121
|
+
label: entry.type,
|
|
122
|
+
size: "small",
|
|
123
|
+
sx: {
|
|
124
|
+
height: 18,
|
|
125
|
+
fontSize: "0.6rem",
|
|
126
|
+
fontFamily: "monospace",
|
|
127
|
+
fontWeight: 700,
|
|
128
|
+
bgcolor: accent,
|
|
129
|
+
color: "#fff",
|
|
130
|
+
flexShrink: 0,
|
|
131
|
+
"& .MuiChip-label": { px: "6px" }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", sx: { color: accent, fontWeight: 600 }, children: entry.type === "http" ? "HTTP" : "Stdio" })
|
|
137
|
+
] })
|
|
138
|
+
] }),
|
|
139
|
+
entry.description && /* @__PURE__ */ jsx(
|
|
140
|
+
Typography,
|
|
141
|
+
{
|
|
142
|
+
variant: "caption",
|
|
143
|
+
color: "text.secondary",
|
|
144
|
+
title: entry.description,
|
|
145
|
+
sx: {
|
|
146
|
+
mb: 0.75,
|
|
147
|
+
display: "-webkit-box",
|
|
148
|
+
WebkitLineClamp: 2,
|
|
149
|
+
WebkitBoxOrient: "vertical",
|
|
150
|
+
overflow: "hidden",
|
|
151
|
+
lineHeight: 1.4
|
|
152
|
+
},
|
|
153
|
+
children: entry.description
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
entry.type === "http" && entry.url && /* @__PURE__ */ jsx(Typography, { variant: "caption", sx: { display: "block", fontFamily: "monospace", fontSize: "0.65rem", color: "text.disabled", wordBreak: "break-all" }, children: entry.url }),
|
|
157
|
+
entry.type === "stdio" && entry.command && /* @__PURE__ */ jsx(Typography, { variant: "caption", sx: { display: "block", fontFamily: "monospace", fontSize: "0.65rem", color: "text.disabled" }, children: [entry.command, ...entry.args ?? []].join(" ") })
|
|
158
|
+
] }),
|
|
159
|
+
canInstall && /* @__PURE__ */ jsxs(CardActions, { sx: { px: 1.5, py: 1, mt: "auto", borderTop: "1px solid", borderColor: "divider", gap: 0.75 }, children: [
|
|
160
|
+
/* @__PURE__ */ jsx(
|
|
161
|
+
Button,
|
|
162
|
+
{
|
|
163
|
+
size: "small",
|
|
164
|
+
variant: "outlined",
|
|
165
|
+
fullWidth: true,
|
|
166
|
+
startIcon: /* @__PURE__ */ jsx(OpenInBrowserIcon, { sx: { fontSize: "0.85rem !important" } }),
|
|
167
|
+
onClick: handleInstallVscode,
|
|
168
|
+
sx: { fontSize: "0.72rem", fontWeight: 700, py: 0.5, borderColor: accent, color: accent, "&:hover": { borderColor: accent, bgcolor: alpha(accent, 0.08) } },
|
|
169
|
+
children: t("mcpConfigDialog.installInVscode")
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
Button,
|
|
174
|
+
{
|
|
175
|
+
size: "small",
|
|
176
|
+
variant: "outlined",
|
|
177
|
+
fullWidth: true,
|
|
178
|
+
startIcon: /* @__PURE__ */ jsx(ToolIcon, { tool: "cursor", branded: false, sx: { fontSize: "0.85rem !important", color: `${accent} !important` } }),
|
|
179
|
+
onClick: handleInstallCursor,
|
|
180
|
+
sx: { fontSize: "0.72rem", fontWeight: 700, py: 0.5, borderColor: accent, color: accent, "&:hover": { borderColor: accent, bgcolor: alpha(accent, 0.08) } },
|
|
181
|
+
children: t("mcpConfigDialog.installInCursor")
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
function McpPage({ embedded = false }) {
|
|
190
|
+
const theme = useTheme();
|
|
191
|
+
const { t } = useTranslationRef(devAiHubTranslationRef);
|
|
192
|
+
const discoveryApi = useApi(discoveryApiRef);
|
|
193
|
+
const { copy: copyUrl, copied: copiedUrl } = useCopyToClipboard();
|
|
194
|
+
const { copy: copySnippet, copied: copiedSnippet } = useCopyToClipboard();
|
|
195
|
+
const [tab, setTab] = useState(0);
|
|
196
|
+
const [baseUrl, setBaseUrl] = useState("");
|
|
197
|
+
const [selectedProvider, setSelectedProvider] = useState("");
|
|
198
|
+
const [proactiveEnabled, setProactiveEnabled] = useState(false);
|
|
199
|
+
const [toolConfigExpanded, setToolConfigExpanded] = useState(false);
|
|
200
|
+
const [manualExpanded, setManualExpanded] = useState(false);
|
|
201
|
+
const { providers } = useProviders();
|
|
202
|
+
const { catalog } = useMcpCatalog();
|
|
203
|
+
const showProviderFilter = providers.length > 1;
|
|
204
|
+
const toolConfigs = useMemo(() => [
|
|
205
|
+
{
|
|
206
|
+
tool: "claude-code",
|
|
207
|
+
label: "Claude Code",
|
|
208
|
+
file: ".mcp.json",
|
|
209
|
+
description: t("mcpConfigDialog.claudeConfigDesc"),
|
|
210
|
+
buildConfig: (url) => JSON.stringify({ mcpServers: { "dev-ai-hub": { type: "http", url } } }, null, 2)
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
tool: "github-copilot",
|
|
214
|
+
label: "GitHub Copilot",
|
|
215
|
+
file: ".vscode/settings.json",
|
|
216
|
+
description: t("mcpConfigDialog.copilotConfigDesc"),
|
|
217
|
+
buildConfig: (url) => JSON.stringify({ "github.copilot.chat.mcp.servers": { "dev-ai-hub": { type: "http", url } } }, null, 2)
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
tool: "google-gemini",
|
|
221
|
+
label: "Google Gemini",
|
|
222
|
+
file: "gemini-config.json",
|
|
223
|
+
description: t("mcpConfigDialog.geminiConfigDesc"),
|
|
224
|
+
buildConfig: (url) => JSON.stringify({ mcpServers: { "dev-ai-hub": { url } } }, null, 2)
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
tool: "cursor",
|
|
228
|
+
label: "Cursor",
|
|
229
|
+
file: ".cursor/mcp.json",
|
|
230
|
+
description: t("mcpConfigDialog.cursorConfigDesc"),
|
|
231
|
+
buildConfig: (url) => JSON.stringify({ mcpServers: { "dev-ai-hub": { type: "http", url } } }, null, 2)
|
|
232
|
+
}
|
|
233
|
+
], [t]);
|
|
234
|
+
useEffect(() => {
|
|
235
|
+
discoveryApi.getBaseUrl("dev-ai-hub").then((url) => setBaseUrl(url));
|
|
236
|
+
}, [discoveryApi]);
|
|
237
|
+
const cfg = toolConfigs[tab] ?? toolConfigs[0];
|
|
238
|
+
const buildMcpUrl = () => {
|
|
239
|
+
if (!baseUrl) return "loading...";
|
|
240
|
+
const params = new URLSearchParams();
|
|
241
|
+
params.set("tool", cfg.tool);
|
|
242
|
+
if (selectedProvider) params.set("provider", selectedProvider);
|
|
243
|
+
if (proactiveEnabled) params.set("proactive", "true");
|
|
244
|
+
return `${baseUrl}/mcp?${params.toString()}`;
|
|
245
|
+
};
|
|
246
|
+
const mcpUrl = buildMcpUrl();
|
|
247
|
+
const configSnippet = baseUrl ? cfg.buildConfig(mcpUrl) : "";
|
|
248
|
+
const handleInstallInVscode = () => {
|
|
249
|
+
if (!baseUrl) return;
|
|
250
|
+
const config = JSON.stringify({ name: "dev-ai-hub", type: "http", url: mcpUrl });
|
|
251
|
+
window.location.href = `vscode:mcp/install?${encodeURIComponent(config)}`;
|
|
252
|
+
};
|
|
253
|
+
const handleInstallInCursor = () => {
|
|
254
|
+
if (!baseUrl) return;
|
|
255
|
+
const config = btoa(JSON.stringify({ type: "http", url: mcpUrl }));
|
|
256
|
+
window.location.href = `cursor://anysphere.cursor-deeplink/mcp/install?name=dev-ai-hub&config=${config}`;
|
|
257
|
+
};
|
|
258
|
+
const showVscodeButton = cfg.tool === "github-copilot";
|
|
259
|
+
const showCursorButton = cfg.tool === "cursor";
|
|
260
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
261
|
+
/* @__PURE__ */ jsxs(Box, { sx: { mb: 3 }, children: [
|
|
262
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.75, mb: 1 }, children: [
|
|
263
|
+
/* @__PURE__ */ jsx(AppsIcon, { sx: { fontSize: "0.95rem", color: "text.secondary" } }),
|
|
264
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 700, color: "text.secondary", sx: { textTransform: "uppercase", letterSpacing: 0.8, flex: 1 }, children: t("mcpConfigDialog.catalogTab") }),
|
|
265
|
+
catalog.length > 0 && /* @__PURE__ */ jsx(
|
|
266
|
+
Chip,
|
|
267
|
+
{
|
|
268
|
+
label: catalog.length,
|
|
269
|
+
size: "small",
|
|
270
|
+
sx: { height: 18, fontSize: "0.65rem", fontWeight: 700, bgcolor: "action.selected", color: "text.secondary", border: "1px solid", borderColor: "divider" }
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] }),
|
|
274
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", sx: { mb: 1.5, fontSize: "0.8rem" }, children: t("mcpConfigDialog.catalogDescription") }),
|
|
275
|
+
catalog.length === 0 ? /* @__PURE__ */ jsxs(Box, { sx: { border: "1px dashed", borderColor: "divider", borderRadius: 2, p: 3, textAlign: "center" }, children: [
|
|
276
|
+
/* @__PURE__ */ jsx(AppsIcon, { sx: { fontSize: "2rem", color: "text.disabled", mb: 1 } }),
|
|
277
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: t("mcpConfigDialog.catalogEmpty") }),
|
|
278
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.disabled", children: t("mcpConfigDialog.catalogAddHint") })
|
|
279
|
+
] }) : /* @__PURE__ */ jsx(Grid, { container: true, spacing: 1.5, children: catalog.map((entry) => /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, sm: 6, md: 4, children: /* @__PURE__ */ jsx(CatalogEntryCard, { entry }) }, entry.id)) })
|
|
280
|
+
] }),
|
|
281
|
+
/* @__PURE__ */ jsx(Divider, { sx: { mb: 0 } }),
|
|
282
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
283
|
+
/* @__PURE__ */ jsxs(
|
|
284
|
+
Box,
|
|
285
|
+
{
|
|
286
|
+
onClick: () => setToolConfigExpanded((v) => !v),
|
|
287
|
+
sx: { display: "flex", alignItems: "center", gap: 0.75, cursor: "pointer", userSelect: "none", py: 1.25, "&:hover": { opacity: 0.8 } },
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ jsx(TuneIcon, { sx: { fontSize: "0.95rem", color: "text.secondary" } }),
|
|
290
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 700, color: "text.secondary", sx: { textTransform: "uppercase", letterSpacing: 0.8, flex: 1 }, children: t("mcpConfigDialog.toolConfigSection") }),
|
|
291
|
+
/* @__PURE__ */ jsx(
|
|
292
|
+
ExpandMoreIcon,
|
|
293
|
+
{
|
|
294
|
+
fontSize: "small",
|
|
295
|
+
sx: { color: "text.disabled", transition: "transform 0.2s ease", transform: toolConfigExpanded ? "rotate(180deg)" : "rotate(0deg)" }
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ jsxs(Collapse, { in: toolConfigExpanded, mountOnEnter: true, unmountOnExit: true, children: [
|
|
302
|
+
/* @__PURE__ */ jsx(Tabs, { value: tab, onChange: (_, v) => setTab(v), sx: { mb: 2, borderBottom: 1, borderColor: "divider" }, children: toolConfigs.map((toolCfg, i) => /* @__PURE__ */ jsx(
|
|
303
|
+
Tab,
|
|
304
|
+
{
|
|
305
|
+
value: i,
|
|
306
|
+
sx: { color: "text.secondary", minHeight: 40, "&.Mui-selected": { color: "primary.main" }, "&:hover": { backgroundColor: "transparent", color: "text.primary" }, "&.Mui-selected:hover": { backgroundColor: "transparent" } },
|
|
307
|
+
label: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
|
|
308
|
+
/* @__PURE__ */ jsx(ToolIcon, { tool: toolCfg.tool, branded: false, sx: { fontSize: "1rem" } }),
|
|
309
|
+
/* @__PURE__ */ jsx("span", { children: toolCfg.label })
|
|
310
|
+
] })
|
|
311
|
+
},
|
|
312
|
+
toolCfg.tool
|
|
313
|
+
)) }),
|
|
314
|
+
showProviderFilter && /* @__PURE__ */ jsxs(Box, { sx: { mb: 2 }, children: [
|
|
315
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 600, color: "text.secondary", sx: { textTransform: "uppercase", letterSpacing: 0.5, display: "block", mb: 0.75 }, children: t("mcpConfigDialog.scopeToProvider") }),
|
|
316
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 0.75, flexWrap: "wrap" }, children: [
|
|
317
|
+
/* @__PURE__ */ jsx(
|
|
318
|
+
Chip,
|
|
319
|
+
{
|
|
320
|
+
label: t("mcpConfigDialog.allProviders"),
|
|
321
|
+
size: "small",
|
|
322
|
+
clickable: true,
|
|
323
|
+
onClick: () => setSelectedProvider(""),
|
|
324
|
+
sx: {
|
|
325
|
+
fontWeight: 600,
|
|
326
|
+
fontSize: "0.75rem",
|
|
327
|
+
borderRadius: 2,
|
|
328
|
+
border: "1.5px solid",
|
|
329
|
+
borderColor: !selectedProvider ? "text.primary" : "divider",
|
|
330
|
+
backgroundColor: !selectedProvider ? "text.primary" : "transparent",
|
|
331
|
+
color: !selectedProvider ? "background.paper" : "text.secondary",
|
|
332
|
+
transition: "all 0.15s ease"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
),
|
|
336
|
+
providers.map((p) => {
|
|
337
|
+
const isSelected = selectedProvider === p.id;
|
|
338
|
+
return /* @__PURE__ */ jsx(
|
|
339
|
+
Chip,
|
|
340
|
+
{
|
|
341
|
+
size: "small",
|
|
342
|
+
clickable: true,
|
|
343
|
+
icon: /* @__PURE__ */ jsx(StorageIcon, { sx: { fontSize: "0.8rem !important", color: isSelected ? "background.paper" : "inherit" } }),
|
|
344
|
+
label: providerLabel(p.target),
|
|
345
|
+
onClick: () => setSelectedProvider(isSelected ? "" : p.id),
|
|
346
|
+
sx: {
|
|
347
|
+
fontWeight: 600,
|
|
348
|
+
fontSize: "0.75rem",
|
|
349
|
+
borderRadius: 2,
|
|
350
|
+
border: "1.5px solid",
|
|
351
|
+
borderColor: isSelected ? "text.primary" : "divider",
|
|
352
|
+
backgroundColor: isSelected ? "text.primary" : "transparent",
|
|
353
|
+
color: isSelected ? "background.paper" : "text.secondary",
|
|
354
|
+
transition: "all 0.15s ease"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
p.id
|
|
358
|
+
);
|
|
359
|
+
})
|
|
360
|
+
] })
|
|
361
|
+
] }),
|
|
362
|
+
/* @__PURE__ */ jsx(Box, { sx: { mb: 2 }, children: /* @__PURE__ */ jsx(
|
|
363
|
+
FormControlLabel,
|
|
364
|
+
{
|
|
365
|
+
control: /* @__PURE__ */ jsx(Switch, { size: "small", checked: proactiveEnabled, onChange: (e) => setProactiveEnabled(e.target.checked) }),
|
|
366
|
+
label: /* @__PURE__ */ jsxs(Box, { children: [
|
|
367
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", fontWeight: 600, children: t("mcpConfigDialog.proactiveSuggestions") }),
|
|
368
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: t("mcpConfigDialog.proactiveDescription") })
|
|
369
|
+
] }),
|
|
370
|
+
sx: { alignItems: "flex-start", ml: 0, gap: 1 }
|
|
371
|
+
}
|
|
372
|
+
) }),
|
|
373
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 600, color: "text.secondary", sx: { textTransform: "uppercase", letterSpacing: 0.5 }, children: t("mcpConfigDialog.mcpEndpoint") }),
|
|
374
|
+
/* @__PURE__ */ jsxs(
|
|
375
|
+
Box,
|
|
376
|
+
{
|
|
377
|
+
sx: {
|
|
378
|
+
display: "flex",
|
|
379
|
+
alignItems: "center",
|
|
380
|
+
gap: 1,
|
|
381
|
+
mt: 0.5,
|
|
382
|
+
mb: 1.5,
|
|
383
|
+
px: 1.5,
|
|
384
|
+
py: 1,
|
|
385
|
+
borderRadius: 1.5,
|
|
386
|
+
border: "1px solid",
|
|
387
|
+
borderColor: "divider",
|
|
388
|
+
backgroundColor: theme.palette.mode === "dark" ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.03)"
|
|
389
|
+
},
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { flex: 1, fontFamily: "monospace", fontSize: "0.8rem", wordBreak: "break-all" }, children: mcpUrl }),
|
|
392
|
+
/* @__PURE__ */ jsx(Tooltip, { title: copiedUrl ? t("assetInstallDialog.copied") : t("mcpConfigDialog.copyUrl"), children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => copyUrl(mcpUrl), children: copiedUrl ? /* @__PURE__ */ jsx(CheckIcon, { fontSize: "small", color: "success" }) : /* @__PURE__ */ jsx(ContentCopyIcon, { fontSize: "small" }) }) })
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
showVscodeButton && /* @__PURE__ */ jsx(Button, { variant: "contained", startIcon: /* @__PURE__ */ jsx(OpenInBrowserIcon, {}), onClick: handleInstallInVscode, disabled: !baseUrl, fullWidth: true, sx: { mb: 2, fontSize: "0.8rem" }, children: t("mcpConfigDialog.installInVscode") }),
|
|
397
|
+
showCursorButton && /* @__PURE__ */ jsx(
|
|
398
|
+
Button,
|
|
399
|
+
{
|
|
400
|
+
variant: "contained",
|
|
401
|
+
fullWidth: true,
|
|
402
|
+
onClick: handleInstallInCursor,
|
|
403
|
+
disabled: !baseUrl,
|
|
404
|
+
startIcon: /* @__PURE__ */ jsx(ToolIcon, { tool: "cursor", branded: false, sx: { fontSize: "1rem !important" } }),
|
|
405
|
+
sx: { mb: 2, fontSize: "0.8rem" },
|
|
406
|
+
children: t("mcpConfigDialog.installInCursor")
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
/* @__PURE__ */ jsx(Divider, { sx: { mb: 1.5 } }),
|
|
410
|
+
/* @__PURE__ */ jsxs(
|
|
411
|
+
Box,
|
|
412
|
+
{
|
|
413
|
+
onClick: () => setManualExpanded((v) => !v),
|
|
414
|
+
sx: { display: "flex", alignItems: "center", justifyContent: "space-between", cursor: "pointer", userSelect: "none", py: 0.75 },
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", fontWeight: 600, color: "text.secondary", sx: { textTransform: "uppercase", letterSpacing: 0.5 }, children: t("mcpConfigDialog.manualConfig", { file: cfg.file }) }),
|
|
417
|
+
/* @__PURE__ */ jsx(
|
|
418
|
+
ExpandMoreIcon,
|
|
419
|
+
{
|
|
420
|
+
fontSize: "small",
|
|
421
|
+
sx: { color: "text.disabled", transition: "transform 0.2s ease", transform: manualExpanded ? "rotate(180deg)" : "rotate(0deg)" }
|
|
422
|
+
}
|
|
423
|
+
)
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
),
|
|
427
|
+
/* @__PURE__ */ jsxs(Collapse, { in: manualExpanded, mountOnEnter: true, unmountOnExit: true, children: [
|
|
428
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", sx: { display: "block", mb: 1, mt: 0.5 }, children: cfg.description }),
|
|
429
|
+
/* @__PURE__ */ jsxs(Box, { sx: { position: "relative" }, children: [
|
|
430
|
+
/* @__PURE__ */ jsx(
|
|
431
|
+
Box,
|
|
432
|
+
{
|
|
433
|
+
component: "pre",
|
|
434
|
+
sx: {
|
|
435
|
+
m: 0,
|
|
436
|
+
p: 2,
|
|
437
|
+
borderRadius: 2,
|
|
438
|
+
border: "1px solid",
|
|
439
|
+
borderColor: "divider",
|
|
440
|
+
backgroundColor: theme.palette.mode === "dark" ? "#0d1117" : "#f6f8fa",
|
|
441
|
+
color: theme.palette.mode === "dark" ? "#e6edf3" : "#24292f",
|
|
442
|
+
fontFamily: "monospace",
|
|
443
|
+
fontSize: "0.8rem",
|
|
444
|
+
overflowX: "auto",
|
|
445
|
+
whiteSpace: "pre"
|
|
446
|
+
},
|
|
447
|
+
children: configSnippet
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
/* @__PURE__ */ jsx(Tooltip, { title: copiedSnippet ? t("assetInstallDialog.copied") : t("mcpConfigDialog.copyUrl"), children: /* @__PURE__ */ jsx(
|
|
451
|
+
IconButton,
|
|
452
|
+
{
|
|
453
|
+
size: "small",
|
|
454
|
+
onClick: (e) => {
|
|
455
|
+
e.stopPropagation();
|
|
456
|
+
copySnippet(configSnippet);
|
|
457
|
+
},
|
|
458
|
+
sx: {
|
|
459
|
+
position: "absolute",
|
|
460
|
+
top: 8,
|
|
461
|
+
right: 8,
|
|
462
|
+
backgroundColor: theme.palette.mode === "dark" ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.06)",
|
|
463
|
+
"&:hover": { backgroundColor: theme.palette.mode === "dark" ? "rgba(255,255,255,0.2)" : "rgba(0,0,0,0.12)" }
|
|
464
|
+
},
|
|
465
|
+
children: copiedSnippet ? /* @__PURE__ */ jsx(CheckIcon, { fontSize: "small", color: "success" }) : /* @__PURE__ */ jsx(ContentCopyIcon, { fontSize: "small" })
|
|
466
|
+
}
|
|
467
|
+
) })
|
|
468
|
+
] }),
|
|
469
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.disabled", sx: { display: "block", mt: 1.5 }, children: t("mcpConfigDialog.omitToolHint") })
|
|
470
|
+
] })
|
|
471
|
+
] })
|
|
472
|
+
] })
|
|
473
|
+
] });
|
|
474
|
+
return embedded ? body : /* @__PURE__ */ jsx(Content, { children: body });
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export { McpPage };
|
|
478
|
+
//# sourceMappingURL=McpPage.esm.js.map
|