@johpaz/hive 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -36
- package/dist/hive.js +315124 -0
- package/package.json +11 -3
- package/packages/core/src/index.ts +0 -1
- package/.dockerignore +0 -9
- package/CONTRIBUTING.md +0 -44
- package/Dockerfile +0 -67
- package/docker-compose.yml +0 -19
- package/packages/cli/package.json +0 -28
- package/packages/cli/src/commands/agent-run.ts +0 -168
- package/packages/cli/src/commands/agents.ts +0 -398
- package/packages/cli/src/commands/chat.ts +0 -142
- package/packages/cli/src/commands/config.ts +0 -50
- package/packages/cli/src/commands/cron.ts +0 -161
- package/packages/cli/src/commands/dev.ts +0 -95
- package/packages/cli/src/commands/doctor.ts +0 -133
- package/packages/cli/src/commands/gateway.ts +0 -422
- package/packages/cli/src/commands/logs.ts +0 -57
- package/packages/cli/src/commands/mcp.ts +0 -175
- package/packages/cli/src/commands/message.ts +0 -77
- package/packages/cli/src/commands/onboard.ts +0 -1696
- package/packages/cli/src/commands/security.ts +0 -144
- package/packages/cli/src/commands/service.ts +0 -50
- package/packages/cli/src/commands/sessions.ts +0 -116
- package/packages/cli/src/commands/skills.ts +0 -187
- package/packages/cli/src/commands/update.ts +0 -25
- package/packages/cli/src/index.ts +0 -190
- package/packages/cli/src/utils/token.ts +0 -6
- package/packages/code-bridge/README.md +0 -78
- package/packages/code-bridge/package.json +0 -18
- package/packages/code-bridge/src/index.ts +0 -95
- package/packages/code-bridge/src/process-manager.ts +0 -212
- package/packages/code-bridge/src/schemas.ts +0 -133
- package/packages/core/package.json +0 -55
- package/packages/core/src/agent/agent-loop.ts +0 -520
- package/packages/core/src/agent/compaction.ts +0 -183
- package/packages/core/src/agent/context-compiler.ts +0 -544
- package/packages/core/src/agent/context-guard.ts +0 -91
- package/packages/core/src/agent/conversation-store.ts +0 -193
- package/packages/core/src/agent/curator.ts +0 -158
- package/packages/core/src/agent/hooks.ts +0 -166
- package/packages/core/src/agent/llm-client.ts +0 -503
- package/packages/core/src/agent/native-tools.ts +0 -31
- package/packages/core/src/agent/playbook-selector.ts +0 -143
- package/packages/core/src/agent/prompt-builder.ts +0 -167
- package/packages/core/src/agent/providers/index.ts +0 -186
- package/packages/core/src/agent/providers.ts +0 -1
- package/packages/core/src/agent/reflector.ts +0 -200
- package/packages/core/src/agent/service.ts +0 -266
- package/packages/core/src/agent/skill-selector.ts +0 -413
- package/packages/core/src/agent/stuck-loop.ts +0 -133
- package/packages/core/src/agent/tool-selector.ts +0 -623
- package/packages/core/src/agent/tracer.ts +0 -102
- package/packages/core/src/canvas/canvas-manager.ts +0 -319
- package/packages/core/src/canvas/canvas-tools.ts +0 -420
- package/packages/core/src/canvas/emitter.ts +0 -119
- package/packages/core/src/canvas/index.ts +0 -2
- package/packages/core/src/channels/base.ts +0 -140
- package/packages/core/src/channels/discord.ts +0 -260
- package/packages/core/src/channels/index.ts +0 -7
- package/packages/core/src/channels/manager.ts +0 -383
- package/packages/core/src/channels/slack.ts +0 -287
- package/packages/core/src/channels/telegram.ts +0 -552
- package/packages/core/src/channels/webchat.ts +0 -139
- package/packages/core/src/channels/whatsapp.ts +0 -375
- package/packages/core/src/config/index.ts +0 -12
- package/packages/core/src/config/loader.ts +0 -529
- package/packages/core/src/events/agent-bus.ts +0 -460
- package/packages/core/src/events/event-bus.ts +0 -169
- package/packages/core/src/gateway/helpers/cors.ts +0 -32
- package/packages/core/src/gateway/helpers/index.ts +0 -4
- package/packages/core/src/gateway/helpers/narration.ts +0 -60
- package/packages/core/src/gateway/helpers/path.ts +0 -13
- package/packages/core/src/gateway/helpers/redact.ts +0 -61
- package/packages/core/src/gateway/index.ts +0 -5
- package/packages/core/src/gateway/initializer.ts +0 -332
- package/packages/core/src/gateway/lane-queue.ts +0 -169
- package/packages/core/src/gateway/resolver.ts +0 -108
- package/packages/core/src/gateway/router.ts +0 -124
- package/packages/core/src/gateway/routes/agents.ts +0 -187
- package/packages/core/src/gateway/routes/channels.ts +0 -203
- package/packages/core/src/gateway/routes/chat.ts +0 -241
- package/packages/core/src/gateway/routes/config.ts +0 -12
- package/packages/core/src/gateway/routes/cron.ts +0 -42
- package/packages/core/src/gateway/routes/ethics.ts +0 -46
- package/packages/core/src/gateway/routes/mcp.ts +0 -346
- package/packages/core/src/gateway/routes/models.ts +0 -93
- package/packages/core/src/gateway/routes/projects.ts +0 -179
- package/packages/core/src/gateway/routes/providers.ts +0 -192
- package/packages/core/src/gateway/routes/setup.ts +0 -267
- package/packages/core/src/gateway/routes/skills.ts +0 -70
- package/packages/core/src/gateway/routes/system.ts +0 -165
- package/packages/core/src/gateway/routes/tasks.ts +0 -44
- package/packages/core/src/gateway/routes/tools.ts +0 -35
- package/packages/core/src/gateway/routes/users.ts +0 -118
- package/packages/core/src/gateway/routes/voice.ts +0 -73
- package/packages/core/src/gateway/routes/workspace.ts +0 -281
- package/packages/core/src/gateway/server.ts +0 -1978
- package/packages/core/src/gateway/session.ts +0 -95
- package/packages/core/src/gateway/slash-commands.ts +0 -193
- package/packages/core/src/heartbeat/index.ts +0 -157
- package/packages/core/src/mcp/hot-reload.ts +0 -213
- package/packages/core/src/mcp/singleton.ts +0 -21
- package/packages/core/src/memory/index.ts +0 -1
- package/packages/core/src/memory/notes.ts +0 -68
- package/packages/core/src/plugins/api.ts +0 -128
- package/packages/core/src/plugins/index.ts +0 -2
- package/packages/core/src/plugins/loader.ts +0 -365
- package/packages/core/src/resilience/circuit-breaker.ts +0 -225
- package/packages/core/src/security/google-chat.ts +0 -269
- package/packages/core/src/security/index.ts +0 -192
- package/packages/core/src/security/pairing.ts +0 -250
- package/packages/core/src/security/rate-limit.ts +0 -270
- package/packages/core/src/security/signal.ts +0 -321
- package/packages/core/src/state/store.ts +0 -312
- package/packages/core/src/storage/crypto.ts +0 -101
- package/packages/core/src/storage/onboarding.ts +0 -1609
- package/packages/core/src/storage/schema.ts +0 -567
- package/packages/core/src/storage/seed.ts +0 -608
- package/packages/core/src/storage/sqlite.ts +0 -363
- package/packages/core/src/storage/usage.ts +0 -270
- package/packages/core/src/tools/agents/index.ts +0 -607
- package/packages/core/src/tools/bridge-events.ts +0 -26
- package/packages/core/src/tools/canvas/index.ts +0 -281
- package/packages/core/src/tools/cli/index.ts +0 -142
- package/packages/core/src/tools/codebridge/index.ts +0 -179
- package/packages/core/src/tools/core/index.ts +0 -257
- package/packages/core/src/tools/cron/index.ts +0 -373
- package/packages/core/src/tools/filesystem/fs-delete.ts +0 -78
- package/packages/core/src/tools/filesystem/fs-edit.ts +0 -106
- package/packages/core/src/tools/filesystem/fs-exists.ts +0 -63
- package/packages/core/src/tools/filesystem/fs-glob.ts +0 -108
- package/packages/core/src/tools/filesystem/fs-list.ts +0 -129
- package/packages/core/src/tools/filesystem/fs-read.ts +0 -72
- package/packages/core/src/tools/filesystem/fs-write.ts +0 -67
- package/packages/core/src/tools/filesystem/index.ts +0 -34
- package/packages/core/src/tools/filesystem/workspace-guard.ts +0 -62
- package/packages/core/src/tools/index.ts +0 -197
- package/packages/core/src/tools/projects/index.ts +0 -37
- package/packages/core/src/tools/projects/project-create.ts +0 -94
- package/packages/core/src/tools/projects/project-done.ts +0 -66
- package/packages/core/src/tools/projects/project-fail.ts +0 -66
- package/packages/core/src/tools/projects/project-list.ts +0 -96
- package/packages/core/src/tools/projects/project-update.ts +0 -72
- package/packages/core/src/tools/projects/task-create.ts +0 -68
- package/packages/core/src/tools/projects/task-evaluate.ts +0 -93
- package/packages/core/src/tools/projects/task-update.ts +0 -93
- package/packages/core/src/tools/search-knowledge/search-knowledge.ts +0 -155
- package/packages/core/src/tools/types.ts +0 -39
- package/packages/core/src/tools/voice/index.ts +0 -104
- package/packages/core/src/tools/web/browser-click.ts +0 -54
- package/packages/core/src/tools/web/browser-navigate.ts +0 -84
- package/packages/core/src/tools/web/browser-screenshot.ts +0 -54
- package/packages/core/src/tools/web/browser-type.ts +0 -60
- package/packages/core/src/tools/web/index.ts +0 -31
- package/packages/core/src/tools/web/web-fetch.ts +0 -78
- package/packages/core/src/tools/web/web-search.ts +0 -123
- package/packages/core/src/utils/benchmark.ts +0 -80
- package/packages/core/src/utils/crypto.ts +0 -73
- package/packages/core/src/utils/date.ts +0 -42
- package/packages/core/src/utils/index.ts +0 -5
- package/packages/core/src/utils/logger.ts +0 -389
- package/packages/core/src/utils/retry.ts +0 -70
- package/packages/core/src/utils/toon.ts +0 -356
- package/packages/core/src/voice/index.ts +0 -583
- package/packages/hive-ui/README.md +0 -52
- package/packages/hive-ui/components.json +0 -20
- package/packages/hive-ui/index.html +0 -30
- package/packages/hive-ui/package.json +0 -90
- package/packages/hive-ui/public/favicon.ico +0 -0
- package/packages/hive-ui/public/placeholder.svg +0 -1
- package/packages/hive-ui/src/App.tsx +0 -115
- package/packages/hive-ui/src/components/CronJobsPanel.tsx +0 -200
- package/packages/hive-ui/src/components/NavLink.tsx +0 -34
- package/packages/hive-ui/src/components/NotesPanel.tsx +0 -79
- package/packages/hive-ui/src/components/SystemMonitor.tsx +0 -270
- package/packages/hive-ui/src/components/UsageStatsPanel.tsx +0 -334
- package/packages/hive-ui/src/components/WelcomeDialog.tsx +0 -279
- package/packages/hive-ui/src/components/ui/accordion.tsx +0 -52
- package/packages/hive-ui/src/components/ui/alert-dialog.tsx +0 -104
- package/packages/hive-ui/src/components/ui/alert.tsx +0 -45
- package/packages/hive-ui/src/components/ui/aspect-ratio.tsx +0 -5
- package/packages/hive-ui/src/components/ui/avatar.tsx +0 -38
- package/packages/hive-ui/src/components/ui/badge.tsx +0 -29
- package/packages/hive-ui/src/components/ui/bee-loader.tsx +0 -68
- package/packages/hive-ui/src/components/ui/breadcrumb.tsx +0 -90
- package/packages/hive-ui/src/components/ui/button.tsx +0 -47
- package/packages/hive-ui/src/components/ui/calendar.tsx +0 -54
- package/packages/hive-ui/src/components/ui/card.tsx +0 -45
- package/packages/hive-ui/src/components/ui/carousel.tsx +0 -224
- package/packages/hive-ui/src/components/ui/chart.tsx +0 -303
- package/packages/hive-ui/src/components/ui/checkbox.tsx +0 -26
- package/packages/hive-ui/src/components/ui/collapsible.tsx +0 -9
- package/packages/hive-ui/src/components/ui/command.tsx +0 -133
- package/packages/hive-ui/src/components/ui/context-menu.tsx +0 -178
- package/packages/hive-ui/src/components/ui/dialog.tsx +0 -95
- package/packages/hive-ui/src/components/ui/drawer.tsx +0 -87
- package/packages/hive-ui/src/components/ui/dropdown-menu.tsx +0 -179
- package/packages/hive-ui/src/components/ui/form.tsx +0 -129
- package/packages/hive-ui/src/components/ui/hover-card.tsx +0 -27
- package/packages/hive-ui/src/components/ui/input-otp.tsx +0 -61
- package/packages/hive-ui/src/components/ui/input.tsx +0 -22
- package/packages/hive-ui/src/components/ui/label.tsx +0 -17
- package/packages/hive-ui/src/components/ui/menubar.tsx +0 -207
- package/packages/hive-ui/src/components/ui/navigation-menu.tsx +0 -120
- package/packages/hive-ui/src/components/ui/pagination.tsx +0 -80
- package/packages/hive-ui/src/components/ui/popover.tsx +0 -29
- package/packages/hive-ui/src/components/ui/progress.tsx +0 -23
- package/packages/hive-ui/src/components/ui/radio-group.tsx +0 -36
- package/packages/hive-ui/src/components/ui/resizable.tsx +0 -37
- package/packages/hive-ui/src/components/ui/scroll-area.tsx +0 -38
- package/packages/hive-ui/src/components/ui/select.tsx +0 -143
- package/packages/hive-ui/src/components/ui/separator.tsx +0 -20
- package/packages/hive-ui/src/components/ui/sheet.tsx +0 -107
- package/packages/hive-ui/src/components/ui/sidebar.tsx +0 -636
- package/packages/hive-ui/src/components/ui/skeleton.tsx +0 -7
- package/packages/hive-ui/src/components/ui/slider.tsx +0 -23
- package/packages/hive-ui/src/components/ui/sonner.tsx +0 -27
- package/packages/hive-ui/src/components/ui/switch.tsx +0 -27
- package/packages/hive-ui/src/components/ui/table.tsx +0 -72
- package/packages/hive-ui/src/components/ui/tabs.tsx +0 -53
- package/packages/hive-ui/src/components/ui/textarea.tsx +0 -21
- package/packages/hive-ui/src/components/ui/toast.tsx +0 -111
- package/packages/hive-ui/src/components/ui/toaster.tsx +0 -24
- package/packages/hive-ui/src/components/ui/toggle-group.tsx +0 -49
- package/packages/hive-ui/src/components/ui/toggle.tsx +0 -37
- package/packages/hive-ui/src/components/ui/tooltip.tsx +0 -28
- package/packages/hive-ui/src/components/ui/use-toast.ts +0 -3
- package/packages/hive-ui/src/hooks/use-mobile.tsx +0 -19
- package/packages/hive-ui/src/hooks/use-toast.ts +0 -186
- package/packages/hive-ui/src/hooks/useAgentConfig.ts +0 -25
- package/packages/hive-ui/src/hooks/useAgents.ts +0 -38
- package/packages/hive-ui/src/hooks/useBridge.ts +0 -38
- package/packages/hive-ui/src/hooks/useCanvas.ts +0 -24
- package/packages/hive-ui/src/hooks/useChannels.ts +0 -2
- package/packages/hive-ui/src/hooks/useEthics.ts +0 -51
- package/packages/hive-ui/src/hooks/useProviders.ts +0 -14
- package/packages/hive-ui/src/hooks/useTheme.ts +0 -29
- package/packages/hive-ui/src/hooks/useUserConfig.ts +0 -17
- package/packages/hive-ui/src/hooks/useWebSocket.ts +0 -12
- package/packages/hive-ui/src/index.css +0 -620
- package/packages/hive-ui/src/lib/api.ts +0 -100
- package/packages/hive-ui/src/lib/constants.ts +0 -6
- package/packages/hive-ui/src/lib/models.ts +0 -64
- package/packages/hive-ui/src/lib/swal.ts +0 -30
- package/packages/hive-ui/src/lib/utils.ts +0 -6
- package/packages/hive-ui/src/lib/websocket.ts +0 -7
- package/packages/hive-ui/src/main.tsx +0 -5
- package/packages/hive-ui/src/modules/agent-config/details/AgentDetailsEditor.tsx +0 -524
- package/packages/hive-ui/src/modules/agent-config/ethics/EthicsConflictDetector.tsx +0 -18
- package/packages/hive-ui/src/modules/agent-config/ethics/EthicsEditor.tsx +0 -19
- package/packages/hive-ui/src/modules/agent-config/ethics/EthicsRulesList.tsx +0 -36
- package/packages/hive-ui/src/modules/agent-config/ethics/EthicsTemplateGallery.tsx +0 -361
- package/packages/hive-ui/src/modules/agent-config/ethics/index.ts +0 -4
- package/packages/hive-ui/src/modules/agent-config/index.ts +0 -6
- package/packages/hive-ui/src/modules/agent-config/mcp/MCPServerAdd.tsx +0 -322
- package/packages/hive-ui/src/modules/agent-config/mcp/MCPServerCard.tsx +0 -93
- package/packages/hive-ui/src/modules/agent-config/mcp/MCPServerConfig.tsx +0 -427
- package/packages/hive-ui/src/modules/agent-config/mcp/MCPServerList.tsx +0 -85
- package/packages/hive-ui/src/modules/agent-config/mcp/MCPToolExplorer.tsx +0 -79
- package/packages/hive-ui/src/modules/agent-config/mcp/index.ts +0 -5
- package/packages/hive-ui/src/modules/agent-config/shared/ConfigEditorLayout.tsx +0 -30
- package/packages/hive-ui/src/modules/agent-config/shared/ConfigExporter.tsx +0 -26
- package/packages/hive-ui/src/modules/agent-config/shared/ConfigImporter.tsx +0 -25
- package/packages/hive-ui/src/modules/agent-config/shared/DiffViewer.tsx +0 -31
- package/packages/hive-ui/src/modules/agent-config/shared/MarkdownEditor.tsx +0 -32
- package/packages/hive-ui/src/modules/agent-config/shared/SaveStatusIndicator.tsx +0 -23
- package/packages/hive-ui/src/modules/agent-config/shared/ValidationPanel.tsx +0 -36
- package/packages/hive-ui/src/modules/agent-config/shared/index.ts +0 -7
- package/packages/hive-ui/src/modules/agent-config/skills/SkillCard.tsx +0 -81
- package/packages/hive-ui/src/modules/agent-config/skills/SkillConfigEditor.tsx +0 -22
- package/packages/hive-ui/src/modules/agent-config/skills/SkillCreator.tsx +0 -60
- package/packages/hive-ui/src/modules/agent-config/skills/SkillInstaller.tsx +0 -23
- package/packages/hive-ui/src/modules/agent-config/skills/SkillList.tsx +0 -72
- package/packages/hive-ui/src/modules/agent-config/skills/SkillsTab.tsx +0 -202
- package/packages/hive-ui/src/modules/agent-config/skills/index.ts +0 -5
- package/packages/hive-ui/src/modules/agent-config/tools/ToolCard.tsx +0 -27
- package/packages/hive-ui/src/modules/agent-config/tools/ToolConfigPanel.tsx +0 -22
- package/packages/hive-ui/src/modules/agent-config/tools/ToolManager.tsx +0 -266
- package/packages/hive-ui/src/modules/agent-config/tools/ToolPermissions.tsx +0 -287
- package/packages/hive-ui/src/modules/agent-config/tools/ToolRegistry.tsx +0 -84
- package/packages/hive-ui/src/modules/agent-config/tools/ToolUsageStats.tsx +0 -52
- package/packages/hive-ui/src/modules/agent-config/tools/index.ts +0 -4
- package/packages/hive-ui/src/modules/agent-config/user/ActiveAgentsList.tsx +0 -109
- package/packages/hive-ui/src/modules/agent-config/user/GlobalConfigOverview.tsx +0 -119
- package/packages/hive-ui/src/modules/agent-config/user/UserMemoryManager.tsx +0 -54
- package/packages/hive-ui/src/modules/agent-config/user/UserPreferencesForm.tsx +0 -163
- package/packages/hive-ui/src/modules/agent-config/user/UserProfileEditor.tsx +0 -261
- package/packages/hive-ui/src/modules/agent-config/user/index.ts +0 -3
- package/packages/hive-ui/src/modules/agents/AgentActivityLog.tsx +0 -25
- package/packages/hive-ui/src/modules/agents/AgentCard.tsx +0 -305
- package/packages/hive-ui/src/modules/agents/AgentCreateForm.tsx +0 -446
- package/packages/hive-ui/src/modules/agents/AgentDetail.tsx +0 -28
- package/packages/hive-ui/src/modules/agents/AgentInternalCard.tsx +0 -162
- package/packages/hive-ui/src/modules/agents/AgentList.tsx +0 -29
- package/packages/hive-ui/src/modules/agents/AgentStatusBadge.tsx +0 -34
- package/packages/hive-ui/src/modules/agents/ModelSelector.tsx +0 -151
- package/packages/hive-ui/src/modules/bridge/BridgeLogViewer.tsx +0 -61
- package/packages/hive-ui/src/modules/bridge/BridgeProcessList.tsx +0 -77
- package/packages/hive-ui/src/modules/bridge/BridgeStatus.tsx +0 -23
- package/packages/hive-ui/src/modules/bridge/BridgeTerminal.tsx +0 -7
- package/packages/hive-ui/src/modules/canvas/CanvasButton.tsx +0 -3
- package/packages/hive-ui/src/modules/canvas/CanvasChart.tsx +0 -3
- package/packages/hive-ui/src/modules/canvas/CanvasComponentMap.tsx +0 -605
- package/packages/hive-ui/src/modules/canvas/CanvasContainer.tsx +0 -360
- package/packages/hive-ui/src/modules/canvas/CanvasForm.tsx +0 -3
- package/packages/hive-ui/src/modules/canvas/CanvasMarkdown.tsx +0 -3
- package/packages/hive-ui/src/modules/canvas/CanvasTable.tsx +0 -3
- package/packages/hive-ui/src/modules/canvas/ComponentRenderer.tsx +0 -30
- package/packages/hive-ui/src/modules/canvas/DynamicRenderer.tsx +0 -3
- package/packages/hive-ui/src/modules/channels/available/AvailableChannelsGrid.tsx +0 -89
- package/packages/hive-ui/src/modules/channels/available/ChannelAuthForm.tsx +0 -33
- package/packages/hive-ui/src/modules/channels/available/ChannelSetupWizard.tsx +0 -48
- package/packages/hive-ui/src/modules/channels/available/ChannelTestConnection.tsx +0 -37
- package/packages/hive-ui/src/modules/channels/available/ChannelTypeCard.tsx +0 -30
- package/packages/hive-ui/src/modules/channels/available/ChannelWebhookConfig.tsx +0 -30
- package/packages/hive-ui/src/modules/channels/available/index.ts +0 -6
- package/packages/hive-ui/src/modules/channels/connected/ChannelCard.tsx +0 -95
- package/packages/hive-ui/src/modules/channels/connected/ChannelConfigPanel.tsx +0 -260
- package/packages/hive-ui/src/modules/channels/connected/ChannelDisconnectButton.tsx +0 -21
- package/packages/hive-ui/src/modules/channels/connected/ChannelLogsViewer.tsx +0 -42
- package/packages/hive-ui/src/modules/channels/connected/ChannelQRCode.tsx +0 -32
- package/packages/hive-ui/src/modules/channels/connected/ChannelReconnectButton.tsx +0 -16
- package/packages/hive-ui/src/modules/channels/connected/ChannelStatusBadge.tsx +0 -26
- package/packages/hive-ui/src/modules/channels/connected/ConnectedChannelsList.tsx +0 -40
- package/packages/hive-ui/src/modules/channels/connected/index.ts +0 -8
- package/packages/hive-ui/src/modules/channels/shared/ChannelCard.tsx +0 -84
- package/packages/hive-ui/src/modules/channels/shared/ChannelConfigDialog.tsx +0 -279
- package/packages/hive-ui/src/modules/channels/shared/ChannelIcon.tsx +0 -40
- package/packages/hive-ui/src/modules/channels/shared/ChannelStats.tsx +0 -37
- package/packages/hive-ui/src/modules/channels/shared/ChannelTypeBadge.tsx +0 -23
- package/packages/hive-ui/src/modules/channels/shared/ConnectionHealthIndicator.tsx +0 -20
- package/packages/hive-ui/src/modules/channels/shared/MessagePreview.tsx +0 -19
- package/packages/hive-ui/src/modules/channels/shared/index.ts +0 -5
- package/packages/hive-ui/src/modules/chat/ChatContainer.tsx +0 -268
- package/packages/hive-ui/src/modules/chat/ChatHistory.tsx +0 -101
- package/packages/hive-ui/src/modules/chat/ChatInput.tsx +0 -108
- package/packages/hive-ui/src/modules/chat/ChatMessage.tsx +0 -137
- package/packages/hive-ui/src/modules/chat/ThinkingIndicator.tsx +0 -10
- package/packages/hive-ui/src/modules/layout/AppLayout.tsx +0 -45
- package/packages/hive-ui/src/modules/layout/ConnectionStatus.tsx +0 -19
- package/packages/hive-ui/src/modules/layout/Header.tsx +0 -20
- package/packages/hive-ui/src/modules/layout/HiveSidebar.tsx +0 -173
- package/packages/hive-ui/src/modules/layout/ThemeToggle.tsx +0 -18
- package/packages/hive-ui/src/modules/providers/ProviderCard.tsx +0 -319
- package/packages/hive-ui/src/modules/providers/ProviderConfigForm.tsx +0 -146
- package/packages/hive-ui/src/modules/providers/ProviderFailoverConfig.tsx +0 -110
- package/packages/hive-ui/src/modules/providers/ProviderList.tsx +0 -33
- package/packages/hive-ui/src/modules/providers/ProviderStatusIndicator.tsx +0 -23
- package/packages/hive-ui/src/modules/providers/configs/ProviderAPIKeyManager.tsx +0 -39
- package/packages/hive-ui/src/modules/providers/configs/ProviderEndpointConfig.tsx +0 -27
- package/packages/hive-ui/src/modules/providers/configs/ProviderRateLimits.tsx +0 -37
- package/packages/hive-ui/src/modules/providers/configs/ProviderRetryPolicy.tsx +0 -46
- package/packages/hive-ui/src/modules/providers/configs/index.ts +0 -4
- package/packages/hive-ui/src/modules/providers/index.ts +0 -5
- package/packages/hive-ui/src/modules/providers/models/ModelBenchmarkBadge.tsx +0 -21
- package/packages/hive-ui/src/modules/providers/models/ModelCapabilities.tsx +0 -44
- package/packages/hive-ui/src/modules/providers/models/ModelCard.tsx +0 -36
- package/packages/hive-ui/src/modules/providers/models/ModelComparisonTable.tsx +0 -47
- package/packages/hive-ui/src/modules/providers/models/ModelList.tsx +0 -51
- package/packages/hive-ui/src/modules/providers/models/ModelPricingInfo.tsx +0 -17
- package/packages/hive-ui/src/modules/providers/models/ModelSelector.tsx +0 -32
- package/packages/hive-ui/src/modules/providers/models/index.ts +0 -7
- package/packages/hive-ui/src/pages/AgentDetailPage.tsx +0 -74
- package/packages/hive-ui/src/pages/AgentNewPage.tsx +0 -5
- package/packages/hive-ui/src/pages/AgentsPage.tsx +0 -147
- package/packages/hive-ui/src/pages/BridgePage.tsx +0 -83
- package/packages/hive-ui/src/pages/CanvasPage.tsx +0 -32
- package/packages/hive-ui/src/pages/ChannelsPage.tsx +0 -176
- package/packages/hive-ui/src/pages/DashboardPage.tsx +0 -321
- package/packages/hive-ui/src/pages/Index.tsx +0 -14
- package/packages/hive-ui/src/pages/LogsPage.tsx +0 -252
- package/packages/hive-ui/src/pages/NotFound.tsx +0 -24
- package/packages/hive-ui/src/pages/ProjectsPage.tsx +0 -241
- package/packages/hive-ui/src/pages/ProvidersPage.tsx +0 -111
- package/packages/hive-ui/src/pages/SettingsPage.tsx +0 -147
- package/packages/hive-ui/src/pages/SetupPage.tsx +0 -1177
- package/packages/hive-ui/src/pages/WebChatPage.tsx +0 -15
- package/packages/hive-ui/src/stores/agentConfigStore.ts +0 -32
- package/packages/hive-ui/src/stores/agentStore.ts +0 -5
- package/packages/hive-ui/src/stores/bridgeStore.ts +0 -237
- package/packages/hive-ui/src/stores/canvasStore.ts +0 -250
- package/packages/hive-ui/src/stores/channelStore.ts +0 -5
- package/packages/hive-ui/src/stores/chatStore.ts +0 -42
- package/packages/hive-ui/src/stores/ethicsStore.ts +0 -141
- package/packages/hive-ui/src/stores/mcpStore.ts +0 -5
- package/packages/hive-ui/src/stores/modelStore.ts +0 -2
- package/packages/hive-ui/src/stores/projectsStore.ts +0 -141
- package/packages/hive-ui/src/stores/providerStore.ts +0 -2
- package/packages/hive-ui/src/stores/skillStore.ts +0 -5
- package/packages/hive-ui/src/stores/toolStore.ts +0 -5
- package/packages/hive-ui/src/stores/useGlobalConfigStore.ts +0 -937
- package/packages/hive-ui/src/stores/useLoaderStore.ts +0 -21
- package/packages/hive-ui/src/stores/useNotesAndCronsStore.ts +0 -144
- package/packages/hive-ui/src/stores/useWebSocketStore.ts +0 -152
- package/packages/hive-ui/src/stores/useWelcomeStore.ts +0 -37
- package/packages/hive-ui/src/stores/userConfigStore.ts +0 -23
- package/packages/hive-ui/src/stores/userStore.ts +0 -82
- package/packages/hive-ui/src/test/setup.ts +0 -15
- package/packages/hive-ui/src/types/agent-config.ts +0 -33
- package/packages/hive-ui/src/types/agent.ts +0 -65
- package/packages/hive-ui/src/types/bridge.ts +0 -27
- package/packages/hive-ui/src/types/canvas.ts +0 -76
- package/packages/hive-ui/src/types/channels.ts +0 -109
- package/packages/hive-ui/src/types/chat.ts +0 -25
- package/packages/hive-ui/src/types/connections.ts +0 -17
- package/packages/hive-ui/src/types/ethics.ts +0 -41
- package/packages/hive-ui/src/types/index.ts +0 -15
- package/packages/hive-ui/src/types/mcp.ts +0 -36
- package/packages/hive-ui/src/types/notes-crons.ts +0 -31
- package/packages/hive-ui/src/types/providers.ts +0 -145
- package/packages/hive-ui/src/types/skill.ts +0 -12
- package/packages/hive-ui/src/types/tool.ts +0 -44
- package/packages/hive-ui/src/types/user.ts +0 -26
- package/packages/hive-ui/src/types/websocket.ts +0 -14
- package/packages/hive-ui/src/vite-env.d.ts +0 -1
- package/packages/mcp/package.json +0 -26
- package/packages/mcp/src/config.ts +0 -13
- package/packages/mcp/src/index.ts +0 -1
- package/packages/mcp/src/logger.ts +0 -42
- package/packages/mcp/src/manager.ts +0 -439
- package/packages/mcp/src/transports/index.ts +0 -67
- package/packages/mcp/src/transports/sse.ts +0 -241
- package/packages/mcp/src/transports/websocket.ts +0 -159
- package/packages/skills/package.json +0 -21
- package/packages/skills/src/index.ts +0 -1
- package/packages/skills/src/loader.ts +0 -346
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Dialog,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogHeader,
|
|
6
|
-
DialogTitle,
|
|
7
|
-
DialogDescription,
|
|
8
|
-
DialogFooter,
|
|
9
|
-
} from "@/components/ui/dialog";
|
|
10
|
-
import { Input } from "@/components/ui/input";
|
|
11
|
-
import { Button } from "@/components/ui/button";
|
|
12
|
-
import { Label } from "@/components/ui/label";
|
|
13
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
|
14
|
-
import {
|
|
15
|
-
X,
|
|
16
|
-
Loader2,
|
|
17
|
-
Trash2,
|
|
18
|
-
Settings2,
|
|
19
|
-
Terminal,
|
|
20
|
-
Globe,
|
|
21
|
-
Power,
|
|
22
|
-
Key,
|
|
23
|
-
ShieldCheck,
|
|
24
|
-
Code,
|
|
25
|
-
Lock
|
|
26
|
-
} from "lucide-react";
|
|
27
|
-
import { Toast, swal } from "@/lib/swal";
|
|
28
|
-
import { loader } from "@/stores/useLoaderStore";
|
|
29
|
-
import { apiClient } from "@/lib/api";
|
|
30
|
-
import { MCPToolExplorer } from "./MCPToolExplorer";
|
|
31
|
-
import { useMCPServers } from "@/hooks/useProviders";
|
|
32
|
-
|
|
33
|
-
interface MCPServerConfigProps {
|
|
34
|
-
server: {
|
|
35
|
-
id: string;
|
|
36
|
-
name: string;
|
|
37
|
-
transport: string;
|
|
38
|
-
status: string;
|
|
39
|
-
enabled: boolean | number;
|
|
40
|
-
active: boolean | number;
|
|
41
|
-
builtin: boolean | number;
|
|
42
|
-
command?: string;
|
|
43
|
-
args?: string[];
|
|
44
|
-
url?: string;
|
|
45
|
-
headers?: Record<string, string>;
|
|
46
|
-
tools?: any[];
|
|
47
|
-
};
|
|
48
|
-
onClose: () => void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function getAuthFromHeaders(headers?: Record<string, string>): { authType: string; authToken: string } {
|
|
52
|
-
if (!headers) return { authType: "none", authToken: "" };
|
|
53
|
-
if (headers["x-api-key"]) return { authType: "api-key", authToken: headers["x-api-key"] };
|
|
54
|
-
if (headers["Authorization"]?.startsWith("Bearer ")) {
|
|
55
|
-
return { authType: "bearer", authToken: headers["Authorization"].replace("Bearer ", "") };
|
|
56
|
-
}
|
|
57
|
-
if (Object.keys(headers).length > 0) return { authType: "custom", authToken: "" };
|
|
58
|
-
return { authType: "none", authToken: "" };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function MCPServerConfig({ server, onClose }: MCPServerConfigProps) {
|
|
62
|
-
const { updateMCPServer, toggleMCPServer, deleteMCPServer, fetchMCPServers } = useMCPServers();
|
|
63
|
-
const [transport, setTransport] = useState(server.transport || "stdio");
|
|
64
|
-
const [command, setCommand] = useState(server.command || "");
|
|
65
|
-
const [args, setArgs] = useState(server.args?.join(" ") || "");
|
|
66
|
-
const [url, setUrl] = useState(server.url || "");
|
|
67
|
-
const [authType, setAuthType] = useState(() => getAuthFromHeaders(server.headers).authType);
|
|
68
|
-
const [authToken, setAuthToken] = useState(() => getAuthFromHeaders(server.headers).authToken);
|
|
69
|
-
const [headers, setHeaders] = useState(server.headers ? JSON.stringify(server.headers, null, 2) : "");
|
|
70
|
-
const [isUpdating, setIsUpdating] = useState(false);
|
|
71
|
-
const [isDeleting, setIsDeleting] = useState(false);
|
|
72
|
-
const [isToggling, setIsToggling] = useState(false);
|
|
73
|
-
const [activeTab, setActiveTab] = useState<"config" | "tools">("config");
|
|
74
|
-
|
|
75
|
-
const isConnected = server.status === "connected" || server.active === 1 || server.active === true;
|
|
76
|
-
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (server.args && Array.isArray(server.args)) {
|
|
79
|
-
setArgs(server.args.join(" "));
|
|
80
|
-
}
|
|
81
|
-
const auth = getAuthFromHeaders(server.headers);
|
|
82
|
-
setAuthType(auth.authType);
|
|
83
|
-
setAuthToken(auth.authToken);
|
|
84
|
-
}, [server]);
|
|
85
|
-
|
|
86
|
-
const handleUpdate = async () => {
|
|
87
|
-
setIsUpdating(true);
|
|
88
|
-
loader.show("Actualizando configuración...");
|
|
89
|
-
try {
|
|
90
|
-
const config: any = { transport };
|
|
91
|
-
if (transport === "stdio") {
|
|
92
|
-
if (!command) {
|
|
93
|
-
Toast.fire({ icon: "warning", title: "El comando es obligatorio" });
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
config.command = command;
|
|
97
|
-
// Parse arguments: handle JSON arrays or space/comma separated strings
|
|
98
|
-
const trimmedArgs = args.trim();
|
|
99
|
-
if (trimmedArgs.startsWith('[') && trimmedArgs.endsWith(']')) {
|
|
100
|
-
try {
|
|
101
|
-
config.args = JSON.parse(trimmedArgs);
|
|
102
|
-
} catch {
|
|
103
|
-
config.args = trimmedArgs.match(/"[^"]*"|'[^']*'|[^\\s,]+/g)?.map(arg =>
|
|
104
|
-
arg.replace(/^["']|["']$/g, '').replace(/,$/, '').trim()
|
|
105
|
-
).filter(Boolean) || [];
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
config.args = trimmedArgs.match(/"[^"]*"|'[^']*'|[^\\s,]+/g)?.map(arg =>
|
|
109
|
-
arg.replace(/^["']|["']$/g, '').replace(/,$/, '').trim()
|
|
110
|
-
).filter(Boolean) || [];
|
|
111
|
-
}
|
|
112
|
-
} else if (transport === "sse") {
|
|
113
|
-
if (!url) {
|
|
114
|
-
Toast.fire({ icon: "warning", title: "La URL es obligatoria" });
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
config.url = url;
|
|
118
|
-
|
|
119
|
-
let finalHeaders: Record<string, string> = {};
|
|
120
|
-
if (authType === "api-key" && authToken) {
|
|
121
|
-
finalHeaders["x-api-key"] = authToken;
|
|
122
|
-
} else if (authType === "bearer" && authToken) {
|
|
123
|
-
finalHeaders["Authorization"] = `Bearer ${authToken}`;
|
|
124
|
-
} else if (authType === "custom" && headers.trim()) {
|
|
125
|
-
try {
|
|
126
|
-
finalHeaders = JSON.parse(headers.trim());
|
|
127
|
-
} catch (e) {
|
|
128
|
-
Toast.fire({ icon: "error", title: "JSON de Headers inválido" });
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (Object.keys(finalHeaders).length > 0) {
|
|
134
|
-
config.headers = finalHeaders;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
await updateMCPServer(server.id, config);
|
|
139
|
-
await fetchMCPServers();
|
|
140
|
-
Toast.fire({ icon: "success", title: "Configuración actualizada" });
|
|
141
|
-
} catch (error) {
|
|
142
|
-
Toast.fire({ icon: "error", title: error instanceof Error ? error.message : "Error al actualizar configuración" });
|
|
143
|
-
} finally {
|
|
144
|
-
setIsUpdating(false);
|
|
145
|
-
loader.hide();
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
const handleToggleConnection = async () => {
|
|
150
|
-
setIsToggling(true);
|
|
151
|
-
loader.show(isConnected ? "Desconectando servidor..." : "Conectando servidor...");
|
|
152
|
-
try {
|
|
153
|
-
await toggleMCPServer(server.id, !isConnected);
|
|
154
|
-
Toast.fire({ icon: "success", title: isConnected ? "Servidor desconectado" : "Servidor conectado" });
|
|
155
|
-
// Forzamos refresh para ver estado final si la API es lenta
|
|
156
|
-
setTimeout(fetchMCPServers, 1500);
|
|
157
|
-
} catch (error) {
|
|
158
|
-
Toast.fire({ icon: "error", title: "Error al cambiar estado de conexión" });
|
|
159
|
-
} finally {
|
|
160
|
-
setIsToggling(false);
|
|
161
|
-
loader.hide();
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const handleDelete = async () => {
|
|
166
|
-
const result = await swal.fire({
|
|
167
|
-
title: "¿Eliminar Servidor?",
|
|
168
|
-
text: `¿Estás seguro de que deseas eliminar el servidor "${server.name}"? Esta acción no se puede deshacer.`,
|
|
169
|
-
icon: "warning",
|
|
170
|
-
showCancelButton: true,
|
|
171
|
-
confirmButtonText: "Sí, eliminar",
|
|
172
|
-
cancelButtonText: "Cancelar",
|
|
173
|
-
reverseButtons: true
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
if (!result.isConfirmed) return;
|
|
177
|
-
|
|
178
|
-
setIsDeleting(true);
|
|
179
|
-
try {
|
|
180
|
-
await apiClient(`/api/mcp/servers/${server.id}`, {
|
|
181
|
-
method: "DELETE",
|
|
182
|
-
showLoader: "Eliminando servidor...",
|
|
183
|
-
showError: true
|
|
184
|
-
});
|
|
185
|
-
onClose();
|
|
186
|
-
} catch (error) {
|
|
187
|
-
// Error handled by apiClient
|
|
188
|
-
} finally {
|
|
189
|
-
setIsDeleting(false);
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
return (
|
|
194
|
-
<Dialog open={true} onOpenChange={(open) => !open && onClose()}>
|
|
195
|
-
<DialogContent className="sm:max-w-[500px] border-cyan-500/20 bg-zinc-950/95 backdrop-blur-xl p-0 overflow-hidden">
|
|
196
|
-
<div className="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-transparent via-cyan-500/50 to-transparent" />
|
|
197
|
-
|
|
198
|
-
<DialogHeader className="p-6 pb-0">
|
|
199
|
-
<div className="flex items-center justify-between">
|
|
200
|
-
<div className="flex items-center gap-3">
|
|
201
|
-
<div className={`p-2 rounded-lg ${isConnected ? "bg-cyan-500/10 text-cyan-400" : "bg-zinc-800 text-zinc-500"}`}>
|
|
202
|
-
<Settings2 className="h-5 w-5" />
|
|
203
|
-
</div>
|
|
204
|
-
<div>
|
|
205
|
-
<DialogTitle className="text-white flex items-center gap-2">
|
|
206
|
-
Configurar {server.name}
|
|
207
|
-
{isConnected && <div className="h-1.5 w-1.5 rounded-full bg-cyan-500 animate-pulse" />}
|
|
208
|
-
</DialogTitle>
|
|
209
|
-
<DialogDescription className="text-[10px] font-mono opacity-50 uppercase tracking-widest mt-0.5">
|
|
210
|
-
ID: {server.id} • {server.transport}
|
|
211
|
-
</DialogDescription>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
{!server.builtin && (
|
|
215
|
-
<Button
|
|
216
|
-
variant="ghost"
|
|
217
|
-
size="icon"
|
|
218
|
-
onClick={handleDelete}
|
|
219
|
-
disabled={isDeleting}
|
|
220
|
-
className="text-zinc-600 hover:text-red-400 hover:bg-red-400/10 h-8 w-8 transition-colors"
|
|
221
|
-
title="Eliminar Servidor"
|
|
222
|
-
>
|
|
223
|
-
{isDeleting ? <Loader2 className="h-4 w-4 animate-spin" /> : <Trash2 className="h-4 w-4" />}
|
|
224
|
-
</Button>
|
|
225
|
-
)}
|
|
226
|
-
</div>
|
|
227
|
-
|
|
228
|
-
<div className="flex items-center gap-1 mt-6 border-b border-white/5">
|
|
229
|
-
<button
|
|
230
|
-
onClick={() => setActiveTab("config")}
|
|
231
|
-
className={`px-4 py-2 text-[10px] uppercase font-bold tracking-widest transition-all relative ${activeTab === "config" ? "text-cyan-400" : "text-zinc-500 hover:text-zinc-300"
|
|
232
|
-
}`}
|
|
233
|
-
>
|
|
234
|
-
Configuración
|
|
235
|
-
{activeTab === "config" && <div className="absolute bottom-0 left-0 w-full h-0.5 bg-cyan-500" />}
|
|
236
|
-
</button>
|
|
237
|
-
<button
|
|
238
|
-
onClick={() => setActiveTab("tools")}
|
|
239
|
-
className={`px-4 py-2 text-[10px] uppercase font-bold tracking-widest transition-all relative ${activeTab === "tools" ? "text-cyan-400" : "text-zinc-500 hover:text-zinc-300"
|
|
240
|
-
}`}
|
|
241
|
-
>
|
|
242
|
-
Herramientas
|
|
243
|
-
{activeTab === "tools" && <div className="absolute bottom-0 left-0 w-full h-0.5 bg-cyan-500" />}
|
|
244
|
-
</button>
|
|
245
|
-
</div>
|
|
246
|
-
</DialogHeader>
|
|
247
|
-
|
|
248
|
-
<div className="p-6">
|
|
249
|
-
{activeTab === "config" ? (
|
|
250
|
-
<div className="space-y-4 animate-in fade-in duration-300">
|
|
251
|
-
<div className="space-y-2">
|
|
252
|
-
<Label className="text-[10px] font-bold text-zinc-500 uppercase tracking-widest">Transporte</Label>
|
|
253
|
-
<Select value={transport} onValueChange={setTransport}>
|
|
254
|
-
<SelectTrigger className="bg-white/5 border-white/10 h-9">
|
|
255
|
-
<SelectValue />
|
|
256
|
-
</SelectTrigger>
|
|
257
|
-
<SelectContent className="bg-zinc-900 border-white/10">
|
|
258
|
-
<SelectItem value="stdio" className="focus:bg-cyan-500/20 focus:text-cyan-400">
|
|
259
|
-
<div className="flex items-center gap-2">
|
|
260
|
-
<Terminal className="h-3.5 w-3.5" />
|
|
261
|
-
<span>stdio (Binario Local)</span>
|
|
262
|
-
</div>
|
|
263
|
-
</SelectItem>
|
|
264
|
-
<SelectItem value="sse" className="focus:bg-cyan-500/20 focus:text-cyan-400">
|
|
265
|
-
<div className="flex items-center gap-2">
|
|
266
|
-
<Globe className="h-3.5 w-3.5" />
|
|
267
|
-
<span>SSE (Remote HTTP)</span>
|
|
268
|
-
</div>
|
|
269
|
-
</SelectItem>
|
|
270
|
-
</SelectContent>
|
|
271
|
-
</Select>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
{transport === "stdio" ? (
|
|
275
|
-
<div className="space-y-4">
|
|
276
|
-
<div className="space-y-2">
|
|
277
|
-
<Label className="text-[10px] font-bold text-zinc-500 uppercase tracking-widest">Comando</Label>
|
|
278
|
-
<Input
|
|
279
|
-
value={command}
|
|
280
|
-
onChange={(e) => setCommand(e.target.value)}
|
|
281
|
-
className="bg-white/5 border-white/10 focus:border-cyan-500/50 h-9"
|
|
282
|
-
/>
|
|
283
|
-
</div>
|
|
284
|
-
<div className="space-y-2">
|
|
285
|
-
<Label className="text-[10px] font-bold text-zinc-500 uppercase tracking-widest">Argumentos</Label>
|
|
286
|
-
<Input
|
|
287
|
-
value={args}
|
|
288
|
-
onChange={(e) => setArgs(e.target.value)}
|
|
289
|
-
className="bg-white/5 border-white/10 focus:border-cyan-500/50 h-9"
|
|
290
|
-
/>
|
|
291
|
-
</div>
|
|
292
|
-
</div>
|
|
293
|
-
) : (
|
|
294
|
-
<div className="space-y-4">
|
|
295
|
-
<div className="space-y-2">
|
|
296
|
-
<Label className="text-[10px] font-bold text-zinc-500 uppercase tracking-widest">Endpoint URL</Label>
|
|
297
|
-
<Input
|
|
298
|
-
value={url}
|
|
299
|
-
onChange={(e) => setUrl(e.target.value)}
|
|
300
|
-
className="bg-white/5 border-white/10 focus:border-cyan-500/50 h-9"
|
|
301
|
-
/>
|
|
302
|
-
</div>
|
|
303
|
-
<div className="space-y-4 pt-2 border-t border-white/5">
|
|
304
|
-
<div className="space-y-2">
|
|
305
|
-
<Label className="text-[10px] font-bold text-zinc-500 uppercase tracking-widest">Autenticación</Label>
|
|
306
|
-
<Select value={authType} onValueChange={setAuthType}>
|
|
307
|
-
<SelectTrigger className="bg-white/5 border-white/10 focus:border-cyan-500/50 h-9">
|
|
308
|
-
<SelectValue />
|
|
309
|
-
</SelectTrigger>
|
|
310
|
-
<SelectContent className="bg-zinc-900 border-white/10">
|
|
311
|
-
<SelectItem value="none" className="focus:bg-cyan-500/20 focus:text-cyan-400">
|
|
312
|
-
<div className="flex items-center gap-2">
|
|
313
|
-
<Globe className="h-3.5 w-3.5" />
|
|
314
|
-
<span>Ninguna</span>
|
|
315
|
-
</div>
|
|
316
|
-
</SelectItem>
|
|
317
|
-
<SelectItem value="api-key" className="focus:bg-cyan-500/20 focus:text-cyan-400">
|
|
318
|
-
<div className="flex items-center gap-2">
|
|
319
|
-
<Key className="h-3.5 w-3.5" />
|
|
320
|
-
<span>API Key (x-api-key)</span>
|
|
321
|
-
</div>
|
|
322
|
-
</SelectItem>
|
|
323
|
-
<SelectItem value="bearer" className="focus:bg-cyan-500/20 focus:text-cyan-400">
|
|
324
|
-
<div className="flex items-center gap-2">
|
|
325
|
-
<ShieldCheck className="h-3.5 w-3.5" />
|
|
326
|
-
<span>Bearer Token (Authorization)</span>
|
|
327
|
-
</div>
|
|
328
|
-
</SelectItem>
|
|
329
|
-
<SelectItem value="custom" className="focus:bg-cyan-500/20 focus:text-cyan-400">
|
|
330
|
-
<div className="flex items-center gap-2">
|
|
331
|
-
<Code className="h-3.5 w-3.5" />
|
|
332
|
-
<span>Custom Headers (JSON)</span>
|
|
333
|
-
</div>
|
|
334
|
-
</SelectItem>
|
|
335
|
-
</SelectContent>
|
|
336
|
-
</Select>
|
|
337
|
-
</div>
|
|
338
|
-
|
|
339
|
-
{(authType === "api-key" || authType === "bearer") && (
|
|
340
|
-
<div className="space-y-2 animate-in fade-in slide-in-from-top-1 duration-200">
|
|
341
|
-
<Label className="text-[10px] font-bold text-zinc-500 uppercase tracking-widest">
|
|
342
|
-
{authType === "api-key" ? "API Key" : "Bearer Token"}
|
|
343
|
-
</Label>
|
|
344
|
-
<div className="relative">
|
|
345
|
-
<Input
|
|
346
|
-
type="password"
|
|
347
|
-
placeholder="sk-..."
|
|
348
|
-
value={authToken}
|
|
349
|
-
onChange={(e) => setAuthToken(e.target.value)}
|
|
350
|
-
className="bg-white/5 border-white/10 focus:border-cyan-500/50 transition-all h-9 pl-9"
|
|
351
|
-
/>
|
|
352
|
-
<Lock className="absolute left-3 top-2.5 h-3.5 w-3.5 text-zinc-500" />
|
|
353
|
-
</div>
|
|
354
|
-
</div>
|
|
355
|
-
)}
|
|
356
|
-
|
|
357
|
-
{authType === "custom" && (
|
|
358
|
-
<div className="space-y-2 animate-in fade-in slide-in-from-top-1 duration-200">
|
|
359
|
-
<div className="flex items-center justify-between">
|
|
360
|
-
<Label className="text-[10px] font-bold text-zinc-500 uppercase tracking-widest">Headers JSON</Label>
|
|
361
|
-
</div>
|
|
362
|
-
<textarea
|
|
363
|
-
value={headers}
|
|
364
|
-
onChange={(e) => setHeaders(e.target.value)}
|
|
365
|
-
placeholder='{ "x-custom-auth": "secret" }'
|
|
366
|
-
rows={3}
|
|
367
|
-
className="w-full bg-white/5 border border-white/10 rounded-md p-2 text-xs text-zinc-300 focus:outline-none focus:border-cyan-500/50 transition-all font-mono"
|
|
368
|
-
/>
|
|
369
|
-
</div>
|
|
370
|
-
)}
|
|
371
|
-
</div>
|
|
372
|
-
</div>
|
|
373
|
-
)}
|
|
374
|
-
|
|
375
|
-
<div className="p-3 rounded-lg bg-zinc-900 border border-white/5 flex items-center justify-between mt-6">
|
|
376
|
-
<div className="flex items-center gap-3">
|
|
377
|
-
<div className={`p-1.5 rounded-full ${isConnected ? "bg-green-500/10 text-green-400" : "bg-zinc-800 text-zinc-500"}`}>
|
|
378
|
-
<Power className={`h-3.5 w-3.5 ${isConnected ? "animate-pulse" : ""}`} />
|
|
379
|
-
</div>
|
|
380
|
-
<div className="flex flex-col">
|
|
381
|
-
<span className="text-[10px] font-bold text-zinc-300 uppercase tracking-tight">Estado del Nodo</span>
|
|
382
|
-
<span className={`text-[9px] font-mono ${isConnected ? "text-green-500" : "text-zinc-500"}`}>
|
|
383
|
-
{isConnected ? "ACTIVE_CONNECTION" : "INACTIVE_NODE"}
|
|
384
|
-
</span>
|
|
385
|
-
</div>
|
|
386
|
-
</div>
|
|
387
|
-
<Button
|
|
388
|
-
size="sm"
|
|
389
|
-
variant={isConnected ? "outline" : "default"}
|
|
390
|
-
onClick={handleToggleConnection}
|
|
391
|
-
disabled={isToggling}
|
|
392
|
-
className={`h-7 px-4 text-[10px] font-bold uppercase tracking-wider ${isConnected ? "border-zinc-800 text-zinc-400 hover:bg-zinc-800" : "bg-cyan-600 hover:bg-cyan-500 text-white"
|
|
393
|
-
}`}
|
|
394
|
-
>
|
|
395
|
-
{isToggling ? <Loader2 className="h-3 w-3 animate-spin" /> : isConnected ? "Desconectar" : "Conectar"}
|
|
396
|
-
</Button>
|
|
397
|
-
</div>
|
|
398
|
-
</div>
|
|
399
|
-
) : (
|
|
400
|
-
<div className="animate-in fade-in duration-300">
|
|
401
|
-
<MCPToolExplorer serverId={server.id} serverName={server.name} tools={server.tools || []} />
|
|
402
|
-
</div>
|
|
403
|
-
)}
|
|
404
|
-
</div>
|
|
405
|
-
|
|
406
|
-
<DialogFooter className="p-6 bg-white/[0.02] border-t border-white/5">
|
|
407
|
-
<Button
|
|
408
|
-
variant="ghost"
|
|
409
|
-
onClick={onClose}
|
|
410
|
-
className="text-zinc-500 hover:text-white"
|
|
411
|
-
>
|
|
412
|
-
Cerrar
|
|
413
|
-
</Button>
|
|
414
|
-
{activeTab === "config" && (
|
|
415
|
-
<Button
|
|
416
|
-
onClick={handleUpdate}
|
|
417
|
-
disabled={isUpdating}
|
|
418
|
-
className="bg-cyan-600 hover:bg-cyan-500 text-white min-w-[120px]"
|
|
419
|
-
>
|
|
420
|
-
{isUpdating ? <Loader2 className="h-4 w-4 animate-spin" /> : "Guardar Cambios"}
|
|
421
|
-
</Button>
|
|
422
|
-
)}
|
|
423
|
-
</DialogFooter>
|
|
424
|
-
</DialogContent>
|
|
425
|
-
</Dialog>
|
|
426
|
-
);
|
|
427
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { Badge } from "@/components/ui/badge";
|
|
3
|
-
import { Loader2, Server, AlertTriangle, Search } from "lucide-react";
|
|
4
|
-
import { Input } from "@/components/ui/input";
|
|
5
|
-
import { MCPServerCard } from "./MCPServerCard";
|
|
6
|
-
import { MCPServerConfig } from "./MCPServerConfig";
|
|
7
|
-
import { MCPServerAdd } from "./MCPServerAdd";
|
|
8
|
-
import { useMCPServers } from "@/hooks/useProviders";
|
|
9
|
-
|
|
10
|
-
export function MCPServerList() {
|
|
11
|
-
const { servers, activeServers, isLoading, fetchMCPServers } = useMCPServers();
|
|
12
|
-
const [configuringServer, setConfiguringServer] = useState<any | null>(null);
|
|
13
|
-
const [search, setSearch] = useState("");
|
|
14
|
-
|
|
15
|
-
useEffect(() => { fetchMCPServers(); }, [fetchMCPServers]);
|
|
16
|
-
|
|
17
|
-
const filteredServers = servers.filter(s =>
|
|
18
|
-
s.name.toLowerCase().includes(search.toLowerCase())
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
const handleCardClick = (server: any) => {
|
|
22
|
-
setConfiguringServer({
|
|
23
|
-
...server,
|
|
24
|
-
args: typeof server.args === "string" ? JSON.parse(server.args) : server.args,
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// Note: Global loader is handled by apiClient in fetchMCPServers or initial sync
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className="space-y-6">
|
|
32
|
-
<div className="flex items-center justify-between border-b border-white/5 pb-4">
|
|
33
|
-
<div className="flex items-center gap-3">
|
|
34
|
-
<div className="p-2 rounded-lg bg-cyan-500/10 text-cyan-400">
|
|
35
|
-
<Server className="h-5 w-5" />
|
|
36
|
-
</div>
|
|
37
|
-
<div>
|
|
38
|
-
<h4 className="text-sm font-bold text-white uppercase tracking-wider">MCP Ecosystem</h4>
|
|
39
|
-
<p className="text-[10px] text-zinc-500 font-mono">Model Context Protocol Servers</p>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div className="flex items-center gap-4">
|
|
43
|
-
<div className="relative group">
|
|
44
|
-
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-zinc-500 group-focus-within:text-cyan-400 transition-colors" />
|
|
45
|
-
<Input
|
|
46
|
-
placeholder="Buscar servidor..."
|
|
47
|
-
value={search}
|
|
48
|
-
onChange={e => setSearch(e.target.value)}
|
|
49
|
-
className="pl-9 bg-zinc-900/50 border-white/5 focus:border-cyan-500/30 transition-all h-9 w-[260px] text-xs"
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
<MCPServerAdd />
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
{filteredServers.length === 0 ? (
|
|
57
|
-
<div className="py-16 flex flex-col items-center justify-center border border-dashed border-white/10 rounded-2xl bg-zinc-950/20 group hover:border-cyan-500/20 transition-colors">
|
|
58
|
-
<div className="p-4 rounded-full bg-zinc-900 mb-4 group-hover:scale-110 transition-transform">
|
|
59
|
-
<AlertTriangle className="h-8 w-8 text-zinc-700 group-hover:text-cyan-500/50 transition-colors" />
|
|
60
|
-
</div>
|
|
61
|
-
<p className="text-xs text-zinc-500 font-medium">No se detectan servidores MCP configurados.</p>
|
|
62
|
-
<p className="text-[10px] text-zinc-600 mt-1">Añade uno para expandir las capacidades de tus agentes.</p>
|
|
63
|
-
</div>
|
|
64
|
-
) : (
|
|
65
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
66
|
-
{filteredServers.map(server => (
|
|
67
|
-
<MCPServerCard
|
|
68
|
-
key={server.id}
|
|
69
|
-
server={server}
|
|
70
|
-
isConnected={server.status === "connected" || server.active === 1}
|
|
71
|
-
onClick={() => handleCardClick(server)}
|
|
72
|
-
/>
|
|
73
|
-
))}
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
76
|
-
|
|
77
|
-
{configuringServer && (
|
|
78
|
-
<MCPServerConfig
|
|
79
|
-
server={configuringServer}
|
|
80
|
-
onClose={() => setConfiguringServer(null)}
|
|
81
|
-
/>
|
|
82
|
-
)}
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
|
|
3
|
-
import { Search, Hammer, AlertCircle, Info } from "lucide-react";
|
|
4
|
-
import { Input } from "@/components/ui/input";
|
|
5
|
-
import { Badge } from "@/components/ui/badge";
|
|
6
|
-
|
|
7
|
-
interface Tool {
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
inputSchema?: any;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface MCPToolExplorerProps {
|
|
14
|
-
serverId: string;
|
|
15
|
-
serverName: string;
|
|
16
|
-
tools?: Tool[]; // Tools from parent component (already loaded)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function MCPToolExplorer({ serverId, serverName, tools = [] }: MCPToolExplorerProps) {
|
|
20
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
21
|
-
|
|
22
|
-
const filteredTools = tools.filter(tool =>
|
|
23
|
-
tool.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
24
|
-
tool.description.toLowerCase().includes(searchQuery.toLowerCase())
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div className="space-y-4">
|
|
29
|
-
<div className="flex items-center gap-2 relative">
|
|
30
|
-
<Search className="absolute left-2.5 top-2.5 h-3.5 w-3.5 text-zinc-500" />
|
|
31
|
-
<Input
|
|
32
|
-
placeholder="Buscar herramientas..."
|
|
33
|
-
className="pl-8 h-8 text-[11px] bg-white/5 border-white/10 focus:border-cyan-500/30"
|
|
34
|
-
value={searchQuery}
|
|
35
|
-
onChange={(e) => setSearchQuery(e.target.value)}
|
|
36
|
-
/>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div className="space-y-2 max-h-[300px] overflow-y-auto pr-1 custom-scrollbar">
|
|
40
|
-
{filteredTools.length === 0 ? (
|
|
41
|
-
<div className="py-8 text-center text-[10px] text-zinc-500 italic">
|
|
42
|
-
{searchQuery ? "No se encontraron herramientas que coincidan." : "Este servidor no expone herramientas actualmente."}
|
|
43
|
-
</div>
|
|
44
|
-
) : (
|
|
45
|
-
filteredTools.map((tool) => (
|
|
46
|
-
<div
|
|
47
|
-
key={tool.name}
|
|
48
|
-
className="p-3 rounded-lg bg-zinc-900/50 border border-white/5 hover:border-cyan-500/20 transition-all group"
|
|
49
|
-
>
|
|
50
|
-
<div className="flex items-start justify-between gap-4">
|
|
51
|
-
<div className="flex items-center gap-2">
|
|
52
|
-
<div className="p-1.5 rounded bg-cyan-500/5 text-cyan-400 group-hover:bg-cyan-500/10 transition-colors">
|
|
53
|
-
<Hammer className="h-3.5 w-3.5" />
|
|
54
|
-
</div>
|
|
55
|
-
<h5 className="text-[11px] font-bold text-zinc-200 group-hover:text-cyan-400 transition-colors">{tool.name}</h5>
|
|
56
|
-
</div>
|
|
57
|
-
{tool.inputSchema && (
|
|
58
|
-
<Badge variant="outline" className="text-[9px] border-zinc-800 text-zinc-600 h-4">
|
|
59
|
-
JSON Schema
|
|
60
|
-
</Badge>
|
|
61
|
-
)}
|
|
62
|
-
</div>
|
|
63
|
-
<p className="mt-1.5 text-[10px] text-zinc-500 leading-relaxed line-clamp-2">
|
|
64
|
-
{tool.description}
|
|
65
|
-
</p>
|
|
66
|
-
</div>
|
|
67
|
-
))
|
|
68
|
-
)}
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div className="p-2 rounded bg-cyan-500/5 border border-cyan-500/10 flex items-center gap-2">
|
|
72
|
-
<Info className="h-3 w-3 text-cyan-500" />
|
|
73
|
-
<span className="text-[9px] text-cyan-200/50">
|
|
74
|
-
Estas herramientas son gestionadas directamente por <span className="text-cyan-400 font-mono">{serverName}</span>.
|
|
75
|
-
</span>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
3
|
-
import { SaveStatusIndicator } from "./SaveStatusIndicator";
|
|
4
|
-
import type { SaveStatus } from "@/types";
|
|
5
|
-
|
|
6
|
-
interface ConfigEditorLayoutProps {
|
|
7
|
-
title: string;
|
|
8
|
-
icon?: ReactNode;
|
|
9
|
-
saveStatus?: SaveStatus;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
actions?: ReactNode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function ConfigEditorLayout({ title, icon, saveStatus = "saved", children, actions }: ConfigEditorLayoutProps) {
|
|
15
|
-
return (
|
|
16
|
-
<div className="flex h-full flex-col">
|
|
17
|
-
<div className="flex items-center justify-between border-b px-4 py-3">
|
|
18
|
-
<div className="flex items-center gap-2">
|
|
19
|
-
{icon}
|
|
20
|
-
<h3 className="text-sm font-semibold">{title}</h3>
|
|
21
|
-
<SaveStatusIndicator status={saveStatus} />
|
|
22
|
-
</div>
|
|
23
|
-
{actions && <div className="flex items-center gap-2">{actions}</div>}
|
|
24
|
-
</div>
|
|
25
|
-
<ScrollArea className="flex-1">
|
|
26
|
-
<div className="p-4">{children}</div>
|
|
27
|
-
</ScrollArea>
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { Download } from "lucide-react";
|
|
3
|
-
|
|
4
|
-
interface ConfigExporterProps {
|
|
5
|
-
content: string;
|
|
6
|
-
filename: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function ConfigExporter({ content, filename }: ConfigExporterProps) {
|
|
10
|
-
const handleExport = () => {
|
|
11
|
-
const blob = new Blob([content], { type: "text/plain" });
|
|
12
|
-
const url = URL.createObjectURL(blob);
|
|
13
|
-
const a = document.createElement("a");
|
|
14
|
-
a.href = url;
|
|
15
|
-
a.download = filename;
|
|
16
|
-
a.click();
|
|
17
|
-
URL.revokeObjectURL(url);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Button variant="outline" size="sm" className="gap-1" onClick={handleExport}>
|
|
22
|
-
<Download className="h-3.5 w-3.5" />
|
|
23
|
-
Exportar
|
|
24
|
-
</Button>
|
|
25
|
-
);
|
|
26
|
-
}
|