@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,360 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState, useCallback, useRef } from "react";
|
|
2
|
-
import type { CanvasComponent } from "@/types";
|
|
3
|
-
import { Badge } from "@/components/ui/badge";
|
|
4
|
-
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
5
|
-
import { Progress } from "@/components/ui/progress";
|
|
6
|
-
import { Activity, Layout, Terminal, User as UserIcon, Wifi, WifiOff, Bot, Server, FolderOpen, CheckCircle2, Circle, Loader2, XCircle, MinusCircle } from "lucide-react";
|
|
7
|
-
import { ComponentRenderer } from "./ComponentRenderer";
|
|
8
|
-
import { useUserStore } from "@/stores/userStore";
|
|
9
|
-
import { useCanvasStore, type GraphNode, type GraphEdge } from "@/stores/canvasStore";
|
|
10
|
-
|
|
11
|
-
// Use environment variable for gateway URL
|
|
12
|
-
const API_URL = import.meta.env.VITE_API_URL || "http://localhost:18790";
|
|
13
|
-
const GATEWAY_WS_URL = API_URL.replace(/^http/, "ws");
|
|
14
|
-
|
|
15
|
-
interface CanvasContainerProps {
|
|
16
|
-
sessionId?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface GatewayMessage {
|
|
20
|
-
type: string;
|
|
21
|
-
sessionId?: string;
|
|
22
|
-
component?: CanvasComponent;
|
|
23
|
-
componentId?: string;
|
|
24
|
-
data?: {
|
|
25
|
-
nodes?: GraphNode[];
|
|
26
|
-
edges?: GraphEdge[];
|
|
27
|
-
id?: string;
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// --- Graph Node Renderers ---
|
|
33
|
-
|
|
34
|
-
const STATUS_COLORS: Record<string, string> = {
|
|
35
|
-
active: "bg-green-500/10 text-green-400 border-green-500/20",
|
|
36
|
-
pending: "bg-yellow-500/10 text-yellow-400 border-yellow-500/20",
|
|
37
|
-
in_progress: "bg-yellow-500/10 text-yellow-400 border-yellow-500/20",
|
|
38
|
-
paused: "bg-gray-500/10 text-gray-400 border-gray-500/20",
|
|
39
|
-
idle: "bg-emerald-500/10 text-emerald-400 border-emerald-500/20",
|
|
40
|
-
completed: "bg-blue-500/10 text-blue-400 border-blue-500/20",
|
|
41
|
-
done: "bg-blue-500/10 text-blue-400 border-blue-500/20",
|
|
42
|
-
failed: "bg-red-500/10 text-red-400 border-red-500/20",
|
|
43
|
-
blocked: "bg-orange-500/10 text-orange-400 border-orange-500/20",
|
|
44
|
-
running: "bg-green-500/10 text-green-400 border-green-500/20",
|
|
45
|
-
thinking: "bg-purple-500/10 text-purple-400 border-purple-500/20",
|
|
46
|
-
tool_call: "bg-cyan-500/10 text-cyan-400 border-cyan-500/20",
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const STATUS_LABELS: Record<string, string> = {
|
|
50
|
-
active: "Activo",
|
|
51
|
-
pending: "Pendiente",
|
|
52
|
-
in_progress: "En progreso",
|
|
53
|
-
paused: "Pausado",
|
|
54
|
-
idle: "Disponible",
|
|
55
|
-
completed: "Completado",
|
|
56
|
-
done: "Completado",
|
|
57
|
-
failed: "Fallido",
|
|
58
|
-
blocked: "Bloqueado",
|
|
59
|
-
running: "Ejecutando",
|
|
60
|
-
thinking: "Pensando",
|
|
61
|
-
tool_call: "Usando Herramienta",
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
function TaskStatusIcon({ status }: { status: string }) {
|
|
65
|
-
switch (status) {
|
|
66
|
-
case "completed": return <CheckCircle2 className="h-3.5 w-3.5 text-green-400" />;
|
|
67
|
-
case "in_progress": return <Loader2 className="h-3.5 w-3.5 text-yellow-400 animate-spin" />;
|
|
68
|
-
case "failed": return <XCircle className="h-3.5 w-3.5 text-red-400" />;
|
|
69
|
-
case "blocked": return <MinusCircle className="h-3.5 w-3.5 text-orange-400" />;
|
|
70
|
-
default: return <Circle className="h-3.5 w-3.5 text-muted-foreground" />;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function AgentGraphNode({ node }: { node: GraphNode }) {
|
|
75
|
-
return (
|
|
76
|
-
<div className="hive-card group">
|
|
77
|
-
<div className="hive-card-body">
|
|
78
|
-
<div className="flex items-center gap-2">
|
|
79
|
-
<div className="hive-icon-wrap hive-icon-wrap--primary">
|
|
80
|
-
<Bot className="h-3.5 w-3.5" />
|
|
81
|
-
</div>
|
|
82
|
-
<span className="text-sm font-medium truncate flex-1">{node.name}</span>
|
|
83
|
-
</div>
|
|
84
|
-
<Badge
|
|
85
|
-
variant="outline"
|
|
86
|
-
className={`text-[10px] px-1.5 py-0 w-fit mt-2 ${STATUS_COLORS[node.status] ?? "bg-gray-500/10 text-gray-400"}`}
|
|
87
|
-
>
|
|
88
|
-
{STATUS_LABELS[node.status] ?? node.status}
|
|
89
|
-
</Badge>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function McpGraphNode({ node }: { node: GraphNode }) {
|
|
96
|
-
return (
|
|
97
|
-
<div className="hive-card group">
|
|
98
|
-
<div className="hive-card-body">
|
|
99
|
-
<div className="flex items-center gap-2">
|
|
100
|
-
<div className="hive-icon-wrap bg-purple-500/10 border-purple-500/20 text-purple-400">
|
|
101
|
-
<Server className="h-3.5 w-3.5" />
|
|
102
|
-
</div>
|
|
103
|
-
<span className="text-sm font-medium truncate flex-1">{node.name}</span>
|
|
104
|
-
</div>
|
|
105
|
-
<Badge
|
|
106
|
-
variant="outline"
|
|
107
|
-
className={`text-[10px] px-1.5 py-0 w-fit mt-2 ${STATUS_COLORS[node.status] ?? ""}`}
|
|
108
|
-
>
|
|
109
|
-
{STATUS_LABELS[node.status] ?? node.status}
|
|
110
|
-
</Badge>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function ProjectGraphNode({ node, tasks }: { node: GraphNode; tasks: GraphNode[] }) {
|
|
117
|
-
const [expanded, setExpanded] = useState(true);
|
|
118
|
-
const progress = (node.data?.progress as number) ?? 0;
|
|
119
|
-
const projectType = (node.data?.projectType as string) ?? "general";
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<div className="hive-card overflow-hidden">
|
|
123
|
-
<button
|
|
124
|
-
className="w-full flex items-center gap-2.5 p-3 text-left hover:bg-blue-500/10 transition-colors"
|
|
125
|
-
onClick={() => setExpanded(!expanded)}
|
|
126
|
-
>
|
|
127
|
-
<FolderOpen className="h-4 w-4 text-blue-400 shrink-0" />
|
|
128
|
-
<div className="flex-1 min-w-0">
|
|
129
|
-
<div className="flex items-center gap-2 flex-wrap">
|
|
130
|
-
<span className="text-sm font-medium">{node.name}</span>
|
|
131
|
-
<Badge variant="outline" className="hive-tag hive-tag--provider text-[10px] px-1.5 py-0">
|
|
132
|
-
{projectType}
|
|
133
|
-
</Badge>
|
|
134
|
-
<Badge
|
|
135
|
-
variant="outline"
|
|
136
|
-
className={`text-[10px] px-1.5 py-0 ${STATUS_COLORS[node.status] ?? ""}`}
|
|
137
|
-
>
|
|
138
|
-
{STATUS_LABELS[node.status] ?? node.status}
|
|
139
|
-
</Badge>
|
|
140
|
-
</div>
|
|
141
|
-
<div className="flex items-center gap-2 mt-1.5">
|
|
142
|
-
<Progress value={progress} className="h-1 flex-1" />
|
|
143
|
-
<span className="text-[11px] text-muted-foreground shrink-0">{progress}%</span>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
</button>
|
|
147
|
-
|
|
148
|
-
{expanded && tasks.length > 0 && (
|
|
149
|
-
<div className="border-t border-white/10 px-3 py-2 space-y-1.5">
|
|
150
|
-
{tasks.map((task) => {
|
|
151
|
-
const taskProgress = (task.data?.progress as number) ?? 0;
|
|
152
|
-
return (
|
|
153
|
-
<div key={task.id} className="flex items-center gap-2 py-0.5">
|
|
154
|
-
<TaskStatusIcon status={task.status} />
|
|
155
|
-
<span className="text-xs flex-1 text-muted-foreground truncate">{task.name}</span>
|
|
156
|
-
{task.status === "in_progress" && (
|
|
157
|
-
<div className="w-12 shrink-0">
|
|
158
|
-
<Progress value={taskProgress} className="h-1" />
|
|
159
|
-
</div>
|
|
160
|
-
)}
|
|
161
|
-
<span className="text-[10px] text-muted-foreground w-7 text-right shrink-0">{taskProgress}%</span>
|
|
162
|
-
</div>
|
|
163
|
-
);
|
|
164
|
-
})}
|
|
165
|
-
</div>
|
|
166
|
-
)}
|
|
167
|
-
|
|
168
|
-
{expanded && tasks.length === 0 && (
|
|
169
|
-
<div className="border-t border-white/10 px-3 py-2 text-xs text-muted-foreground">
|
|
170
|
-
Sin tareas
|
|
171
|
-
</div>
|
|
172
|
-
)}
|
|
173
|
-
</div>
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function GraphView({ nodes, edges }: { nodes: GraphNode[]; edges: GraphEdge[] }) {
|
|
178
|
-
const agentNodes = nodes.filter((n) => n.type === "agent");
|
|
179
|
-
const mcpNodes = nodes.filter((n) => n.type === "mcp");
|
|
180
|
-
const projectNodes = nodes.filter((n) => n.type === "project");
|
|
181
|
-
const taskNodes = nodes.filter((n) => n.type === "task");
|
|
182
|
-
|
|
183
|
-
// Map task nodes to their parent project
|
|
184
|
-
const tasksByProject = new Map<string, GraphNode[]>();
|
|
185
|
-
for (const edge of edges) {
|
|
186
|
-
if (edge.edgeType === "contains") {
|
|
187
|
-
const projectId = edge.source;
|
|
188
|
-
const taskId = edge.target;
|
|
189
|
-
const task = taskNodes.find((t) => t.id === taskId);
|
|
190
|
-
if (task) {
|
|
191
|
-
if (!tasksByProject.has(projectId)) tasksByProject.set(projectId, []);
|
|
192
|
-
tasksByProject.get(projectId)!.push(task);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (nodes.length === 0) {
|
|
198
|
-
return (
|
|
199
|
-
<div className="hive-empty-state">
|
|
200
|
-
<Activity className="h-10 w-10 opacity-30" />
|
|
201
|
-
<p className="text-sm mt-3">Sin agentes ni proyectos activos</p>
|
|
202
|
-
</div>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return (
|
|
207
|
-
<div className="space-y-4">
|
|
208
|
-
{/* Agents row */}
|
|
209
|
-
{agentNodes.length > 0 && (
|
|
210
|
-
<div>
|
|
211
|
-
<p className="hive-label mb-2">
|
|
212
|
-
Agentes
|
|
213
|
-
</p>
|
|
214
|
-
<div className="flex flex-wrap gap-2">
|
|
215
|
-
{agentNodes.map((n) => <AgentGraphNode key={n.id} node={n} />)}
|
|
216
|
-
</div>
|
|
217
|
-
</div>
|
|
218
|
-
)}
|
|
219
|
-
|
|
220
|
-
{/* MCP row */}
|
|
221
|
-
{mcpNodes.length > 0 && (
|
|
222
|
-
<div>
|
|
223
|
-
<p className="hive-label mb-2">
|
|
224
|
-
MCP Servers
|
|
225
|
-
</p>
|
|
226
|
-
<div className="flex flex-wrap gap-2">
|
|
227
|
-
{mcpNodes.map((n) => <McpGraphNode key={n.id} node={n} />)}
|
|
228
|
-
</div>
|
|
229
|
-
</div>
|
|
230
|
-
)}
|
|
231
|
-
|
|
232
|
-
{/* Projects */}
|
|
233
|
-
{projectNodes.length > 0 && (
|
|
234
|
-
<div>
|
|
235
|
-
<p className="hive-label mb-2">
|
|
236
|
-
Proyectos
|
|
237
|
-
</p>
|
|
238
|
-
<div className="space-y-2">
|
|
239
|
-
{projectNodes.map((n) => (
|
|
240
|
-
<ProjectGraphNode
|
|
241
|
-
key={n.id}
|
|
242
|
-
node={n}
|
|
243
|
-
tasks={tasksByProject.get(n.id) ?? []}
|
|
244
|
-
/>
|
|
245
|
-
))}
|
|
246
|
-
</div>
|
|
247
|
-
</div>
|
|
248
|
-
)}
|
|
249
|
-
</div>
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export function CanvasContainer({ sessionId: propSessionId }: CanvasContainerProps) {
|
|
254
|
-
const user = useUserStore((s) => s.currentUser);
|
|
255
|
-
const isConnected = useCanvasStore((s) => s.isConnected);
|
|
256
|
-
const components = useCanvasStore((s) => s.components);
|
|
257
|
-
const graphNodes = useCanvasStore((s) => s.graphNodes);
|
|
258
|
-
const graphEdges = useCanvasStore((s) => s.graphEdges);
|
|
259
|
-
const connect = useCanvasStore((s) => s.connect);
|
|
260
|
-
const sendMessage = useCanvasStore((s) => s.sendMessage);
|
|
261
|
-
|
|
262
|
-
// Get the effective session ID: use prop, or user.id, or default
|
|
263
|
-
const effectiveSessionId = propSessionId || user?.id || "default";
|
|
264
|
-
const canvasSessionId = effectiveSessionId.startsWith("canvas:")
|
|
265
|
-
? effectiveSessionId
|
|
266
|
-
: `canvas:${effectiveSessionId}`;
|
|
267
|
-
|
|
268
|
-
useEffect(() => {
|
|
269
|
-
// Conectar usando el store global (mantiene la conexión si ya existe)
|
|
270
|
-
connect(canvasSessionId, user?.id);
|
|
271
|
-
|
|
272
|
-
// NOTAR: No cerramos la conexión aquí para mantener el KeepAlive
|
|
273
|
-
// Solo se cerrará si el usuario lo solicita explícitamente o al cerrar la app
|
|
274
|
-
}, [canvasSessionId, user?.id, connect]);
|
|
275
|
-
|
|
276
|
-
const handleInteraction = useCallback((componentId: string, action: string, data?: unknown) => {
|
|
277
|
-
sendMessage({
|
|
278
|
-
type: "canvas:interact",
|
|
279
|
-
sessionId: canvasSessionId,
|
|
280
|
-
componentId,
|
|
281
|
-
action,
|
|
282
|
-
data,
|
|
283
|
-
});
|
|
284
|
-
}, [sendMessage, canvasSessionId]);
|
|
285
|
-
|
|
286
|
-
return (
|
|
287
|
-
<div className="hive-card flex h-full flex-col shadow-2xl">
|
|
288
|
-
{/* Header */}
|
|
289
|
-
<div className="flex flex-row items-center justify-between space-y-0 border-b border-white/5 bg-white/5 px-6 py-4">
|
|
290
|
-
<div className="flex items-center gap-3">
|
|
291
|
-
<div className="hive-icon-wrap hive-icon-wrap--primary">
|
|
292
|
-
<Layout className="h-5 w-5" />
|
|
293
|
-
</div>
|
|
294
|
-
<div>
|
|
295
|
-
<h2 className="hive-title-page !text-lg">Canvas</h2>
|
|
296
|
-
<div className="flex items-center gap-2 text-xs text-white/40 mt-0.5">
|
|
297
|
-
<UserIcon className="h-3 w-3" />
|
|
298
|
-
<span className="font-mono">{effectiveSessionId}</span>
|
|
299
|
-
</div>
|
|
300
|
-
</div>
|
|
301
|
-
</div>
|
|
302
|
-
|
|
303
|
-
<Badge
|
|
304
|
-
variant={isConnected ? "default" : "destructive"}
|
|
305
|
-
className={`flex items-center gap-1.5 px-3 py-1 transition-all duration-500 ${isConnected ? "bg-emerald-500/15 text-emerald-500 hover:bg-emerald-500/20" : "bg-red-500/15 text-red-500 hover:bg-red-500/20"}`}
|
|
306
|
-
>
|
|
307
|
-
{isConnected ? (
|
|
308
|
-
<>
|
|
309
|
-
<Wifi className="h-3.5 w-3.5 animate-pulse" />
|
|
310
|
-
<span className="font-semibold uppercase tracking-wider text-[10px]">Live</span>
|
|
311
|
-
</>
|
|
312
|
-
) : (
|
|
313
|
-
<>
|
|
314
|
-
<WifiOff className="h-3.5 w-3.5" />
|
|
315
|
-
<span className="font-semibold uppercase tracking-wider text-[10px]">Offline</span>
|
|
316
|
-
</>
|
|
317
|
-
)}
|
|
318
|
-
</Badge>
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
{/* Content */}
|
|
322
|
-
<div className="relative flex flex-1 flex-col overflow-hidden">
|
|
323
|
-
<ScrollArea className="flex-1 p-6">
|
|
324
|
-
{/* Graph view */}
|
|
325
|
-
<GraphView nodes={graphNodes} edges={graphEdges} />
|
|
326
|
-
|
|
327
|
-
{/* Agent-rendered UI components */}
|
|
328
|
-
{components.length > 0 && (
|
|
329
|
-
<div className="mt-6">
|
|
330
|
-
<p className="hive-label mb-3">
|
|
331
|
-
Componentes
|
|
332
|
-
</p>
|
|
333
|
-
<div className="grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3">
|
|
334
|
-
{components.map((component) => (
|
|
335
|
-
<ComponentRenderer
|
|
336
|
-
key={component.id}
|
|
337
|
-
component={component}
|
|
338
|
-
onInteraction={handleInteraction}
|
|
339
|
-
/>
|
|
340
|
-
))}
|
|
341
|
-
</div>
|
|
342
|
-
</div>
|
|
343
|
-
)}
|
|
344
|
-
</ScrollArea>
|
|
345
|
-
|
|
346
|
-
{/* Status bar */}
|
|
347
|
-
<div className="border-t border-white/5 bg-white/[0.02] px-6 py-2.5">
|
|
348
|
-
<div className="flex items-center gap-2">
|
|
349
|
-
<Terminal className="h-3 w-3 text-white/30" />
|
|
350
|
-
<span className="hive-mono">
|
|
351
|
-
{isConnected
|
|
352
|
-
? `Sincronizado · ${graphNodes.length} nodos · ${graphEdges.length} conexiones`
|
|
353
|
-
: "Reconectando..."}
|
|
354
|
-
</span>
|
|
355
|
-
</div>
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
358
|
-
</div>
|
|
359
|
-
);
|
|
360
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { getCanvasComponent } from "./CanvasComponentMap";
|
|
3
|
-
|
|
4
|
-
interface ComponentRendererProps {
|
|
5
|
-
component: {
|
|
6
|
-
type: string;
|
|
7
|
-
props: Record<string, unknown>;
|
|
8
|
-
id: string;
|
|
9
|
-
};
|
|
10
|
-
onInteraction: (id: string, action: string, data?: unknown) => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface DynamicProps extends Record<string, unknown> {
|
|
14
|
-
renderFn: (props: Record<string, unknown>) => React.ReactNode;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const DynamicCanvasComponent: React.FC<DynamicProps> = ({ renderFn, ...props }) => {
|
|
18
|
-
return <>{renderFn(props)}</>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const ComponentRenderer: React.FC<ComponentRendererProps> = ({ component, onInteraction }) => {
|
|
22
|
-
const { type, props, id } = component;
|
|
23
|
-
const renderFn = getCanvasComponent(type);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div data-canvas-type={type} data-canvas-id={id}>
|
|
27
|
-
<DynamicCanvasComponent renderFn={renderFn} {...props} id={id} onInteraction={onInteraction} />
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent } from "@/components/ui/card";
|
|
2
|
-
import { Button } from "@/components/ui/button";
|
|
3
|
-
import { Badge } from "@/components/ui/badge";
|
|
4
|
-
import { Plus, type LucideProps } from "lucide-react";
|
|
5
|
-
import { useChannels } from "@/hooks/useChannels";
|
|
6
|
-
import { ChannelIcon } from "../shared/ChannelIcon";
|
|
7
|
-
import type { ChannelType } from "@/types";
|
|
8
|
-
import { useState } from "react";
|
|
9
|
-
|
|
10
|
-
function Icon({ icon: IconComponent, ...props }: { icon: React.ComponentType<LucideProps> } & LucideProps) {
|
|
11
|
-
return <IconComponent {...props} />;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const channelInfo: Record<string, { name: string; description: string }> = {
|
|
15
|
-
telegram: { name: "Telegram", description: "Bot de Telegram con comandos y grupos" },
|
|
16
|
-
whatsapp: { name: "WhatsApp", description: "WhatsApp Web con QR o código" },
|
|
17
|
-
discord: { name: "Discord", description: "Bot de Discord para servidores" },
|
|
18
|
-
slack: { name: "Slack", description: "Integración con workspaces" },
|
|
19
|
-
signal: { name: "Signal", description: "Mensajería segura" },
|
|
20
|
-
webchat: { name: "Web Chat", description: "Widget embebible" },
|
|
21
|
-
matrix: { name: "Matrix", description: "Protocolo descentralizado" },
|
|
22
|
-
teams: { name: "Microsoft Teams", description: "Integración con Teams" },
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export function AvailableChannelsGrid() {
|
|
26
|
-
const { channels, fetchChannels, toggleChannel } = useChannels();
|
|
27
|
-
const [isToggling, setIsToggling] = useState<string | null>(null);
|
|
28
|
-
|
|
29
|
-
const handleActivate = async (type: string) => {
|
|
30
|
-
setIsToggling(type);
|
|
31
|
-
try {
|
|
32
|
-
await toggleChannel(type, true);
|
|
33
|
-
await fetchChannels();
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.error("Error al activar canal:", error);
|
|
36
|
-
} finally {
|
|
37
|
-
setIsToggling(null);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// Get channels that are not yet active
|
|
42
|
-
const inactiveChannelTypes = Object.keys(channelInfo).filter(
|
|
43
|
-
(type) => !channels.some((c) => c.type === type && c.active)
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div className="space-y-4">
|
|
48
|
-
<h3 className="text-sm font-semibold">Canales Disponibles</h3>
|
|
49
|
-
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
|
|
50
|
-
{inactiveChannelTypes.map((type) => {
|
|
51
|
-
const info = channelInfo[type];
|
|
52
|
-
return (
|
|
53
|
-
<Card key={type} className="transition-colors hover:border-primary/30">
|
|
54
|
-
<CardContent className="p-4 space-y-3">
|
|
55
|
-
<div className="flex items-center gap-2">
|
|
56
|
-
<ChannelIcon type={type as ChannelType} className="h-6 w-6" />
|
|
57
|
-
<div>
|
|
58
|
-
<p className="text-sm font-semibold">{info.name}</p>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
<p className="text-xs text-muted-foreground">{info.description}</p>
|
|
62
|
-
<Button
|
|
63
|
-
size="sm"
|
|
64
|
-
className="w-full"
|
|
65
|
-
onClick={() => handleActivate(type)}
|
|
66
|
-
disabled={isToggling === type}
|
|
67
|
-
>
|
|
68
|
-
{isToggling === type ? (
|
|
69
|
-
<>Activando...</>
|
|
70
|
-
) : (
|
|
71
|
-
<>
|
|
72
|
-
<Icon icon={Plus as any} className="mr-1 h-3 w-3" />
|
|
73
|
-
Activar
|
|
74
|
-
</>
|
|
75
|
-
)}
|
|
76
|
-
</Button>
|
|
77
|
-
</CardContent>
|
|
78
|
-
</Card>
|
|
79
|
-
);
|
|
80
|
-
})}
|
|
81
|
-
{inactiveChannelTypes.length === 0 && (
|
|
82
|
-
<div className="col-span-full py-8 text-center text-sm text-muted-foreground">
|
|
83
|
-
Todos los canales están activados
|
|
84
|
-
</div>
|
|
85
|
-
)}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
2
|
-
import { Label } from "@/components/ui/label";
|
|
3
|
-
import { Input } from "@/components/ui/input";
|
|
4
|
-
import { Button } from "@/components/ui/button";
|
|
5
|
-
import { Eye, EyeOff } from "lucide-react";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
|
|
8
|
-
interface ChannelAuthFormProps {
|
|
9
|
-
channelType: string;
|
|
10
|
-
onSubmit?: (credentials: Record<string, string>) => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function ChannelAuthForm({ channelType, onSubmit }: ChannelAuthFormProps) {
|
|
14
|
-
const [showToken, setShowToken] = useState(false);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Card>
|
|
18
|
-
<CardHeader><CardTitle className="text-sm">Autenticación — {channelType}</CardTitle></CardHeader>
|
|
19
|
-
<CardContent className="space-y-3">
|
|
20
|
-
<div className="space-y-1">
|
|
21
|
-
<Label className="text-xs">Token / API Key</Label>
|
|
22
|
-
<div className="relative">
|
|
23
|
-
<Input type={showToken ? "text" : "password"} placeholder="Ingresa el token..." className="h-8 pr-8 text-sm" />
|
|
24
|
-
<Button variant="ghost" size="icon" className="absolute right-0 top-0 h-8 w-8" onClick={() => setShowToken(!showToken)}>
|
|
25
|
-
{showToken ? <EyeOff className="h-3.5 w-3.5" /> : <Eye className="h-3.5 w-3.5" />}
|
|
26
|
-
</Button>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
<Button size="sm" className="w-full">Validar credenciales</Button>
|
|
30
|
-
</CardContent>
|
|
31
|
-
</Card>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
2
|
-
import { Button } from "@/components/ui/button";
|
|
3
|
-
import { ChevronRight, ChevronLeft } from "lucide-react";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import type { ChannelType } from "@/types";
|
|
6
|
-
|
|
7
|
-
interface ChannelSetupWizardProps {
|
|
8
|
-
channelType: ChannelType;
|
|
9
|
-
onComplete?: () => void;
|
|
10
|
-
onCancel?: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const steps = ["Instrucciones", "Credenciales", "Políticas", "Test", "Confirmar"];
|
|
14
|
-
|
|
15
|
-
export function ChannelSetupWizard({ channelType, onComplete, onCancel }: ChannelSetupWizardProps) {
|
|
16
|
-
const [currentStep, setCurrentStep] = useState(0);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<Card>
|
|
20
|
-
<CardHeader>
|
|
21
|
-
<CardTitle className="text-sm">Conectar {channelType} — Paso {currentStep + 1} de {steps.length}</CardTitle>
|
|
22
|
-
<div className="flex gap-1 pt-2">
|
|
23
|
-
{steps.map((step, i) => (
|
|
24
|
-
<div
|
|
25
|
-
key={step}
|
|
26
|
-
className={`h-1 flex-1 rounded-full ${i <= currentStep ? "bg-primary" : "bg-muted"}`}
|
|
27
|
-
/>
|
|
28
|
-
))}
|
|
29
|
-
</div>
|
|
30
|
-
</CardHeader>
|
|
31
|
-
<CardContent className="space-y-4">
|
|
32
|
-
<p className="text-sm text-muted-foreground">
|
|
33
|
-
{steps[currentStep]}: Contenido del paso pendiente de implementación
|
|
34
|
-
</p>
|
|
35
|
-
<div className="flex justify-between">
|
|
36
|
-
<Button variant="outline" size="sm" onClick={() => currentStep === 0 ? onCancel?.() : setCurrentStep((s) => s - 1)}>
|
|
37
|
-
<ChevronLeft className="mr-1 h-3.5 w-3.5" />
|
|
38
|
-
{currentStep === 0 ? "Cancelar" : "Anterior"}
|
|
39
|
-
</Button>
|
|
40
|
-
<Button size="sm" onClick={() => currentStep === steps.length - 1 ? onComplete?.() : setCurrentStep((s) => s + 1)}>
|
|
41
|
-
{currentStep === steps.length - 1 ? "Conectar" : "Siguiente"}
|
|
42
|
-
{currentStep < steps.length - 1 && <ChevronRight className="ml-1 h-3.5 w-3.5" />}
|
|
43
|
-
</Button>
|
|
44
|
-
</div>
|
|
45
|
-
</CardContent>
|
|
46
|
-
</Card>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
2
|
-
import { Button } from "@/components/ui/button";
|
|
3
|
-
import { CheckCircle, XCircle, Loader2 } from "lucide-react";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
|
|
6
|
-
interface ChannelTestConnectionProps {
|
|
7
|
-
onTest?: () => Promise<boolean>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function ChannelTestConnection({ onTest }: ChannelTestConnectionProps) {
|
|
11
|
-
const [status, setStatus] = useState<"idle" | "testing" | "success" | "error">("idle");
|
|
12
|
-
|
|
13
|
-
const handleTest = async () => {
|
|
14
|
-
setStatus("testing");
|
|
15
|
-
try {
|
|
16
|
-
const result = await onTest?.();
|
|
17
|
-
setStatus(result ? "success" : "error");
|
|
18
|
-
} catch {
|
|
19
|
-
setStatus("error");
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Card>
|
|
25
|
-
<CardHeader><CardTitle className="text-sm">Test de Conexión</CardTitle></CardHeader>
|
|
26
|
-
<CardContent className="flex flex-col items-center gap-3">
|
|
27
|
-
{status === "idle" && <p className="text-sm text-muted-foreground">Prueba la conexión antes de guardar</p>}
|
|
28
|
-
{status === "testing" && <Loader2 className="h-8 w-8 animate-spin text-primary" />}
|
|
29
|
-
{status === "success" && <CheckCircle className="h-8 w-8 text-hive-connected" />}
|
|
30
|
-
{status === "error" && <XCircle className="h-8 w-8 text-destructive" />}
|
|
31
|
-
<Button size="sm" onClick={handleTest} disabled={status === "testing"}>
|
|
32
|
-
{status === "testing" ? "Probando..." : "Probar conexión"}
|
|
33
|
-
</Button>
|
|
34
|
-
</CardContent>
|
|
35
|
-
</Card>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent } from "@/components/ui/card";
|
|
2
|
-
import { Button } from "@/components/ui/button";
|
|
3
|
-
import { Plus } from "lucide-react";
|
|
4
|
-
import { ChannelIcon } from "../shared/ChannelIcon";
|
|
5
|
-
import type { ChannelType } from "@/types";
|
|
6
|
-
|
|
7
|
-
interface ChannelTypeCardProps {
|
|
8
|
-
type: ChannelType;
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
onConnect?: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function ChannelTypeCard({ type, name, description, onConnect }: ChannelTypeCardProps) {
|
|
15
|
-
return (
|
|
16
|
-
<Card className="transition-colors hover:border-primary/40">
|
|
17
|
-
<CardContent className="flex flex-col items-center gap-3 p-4 text-center">
|
|
18
|
-
<ChannelIcon type={type} className="h-8 w-8" />
|
|
19
|
-
<div>
|
|
20
|
-
<p className="text-sm font-semibold">{name}</p>
|
|
21
|
-
<p className="mt-1 text-xs text-muted-foreground">{description}</p>
|
|
22
|
-
</div>
|
|
23
|
-
<Button size="sm" variant="outline" className="w-full" onClick={onConnect}>
|
|
24
|
-
<Plus className="mr-1 h-3.5 w-3.5" />
|
|
25
|
-
Conectar
|
|
26
|
-
</Button>
|
|
27
|
-
</CardContent>
|
|
28
|
-
</Card>
|
|
29
|
-
);
|
|
30
|
-
}
|