@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,30 +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 { Copy } from "lucide-react";
|
|
6
|
-
|
|
7
|
-
interface ChannelWebhookConfigProps {
|
|
8
|
-
webhookUrl?: string;
|
|
9
|
-
onSave?: (url: string) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function ChannelWebhookConfig({ webhookUrl, onSave }: ChannelWebhookConfigProps) {
|
|
13
|
-
return (
|
|
14
|
-
<Card>
|
|
15
|
-
<CardHeader><CardTitle className="text-sm">Configuración de Webhook</CardTitle></CardHeader>
|
|
16
|
-
<CardContent className="space-y-3">
|
|
17
|
-
<div className="space-y-1">
|
|
18
|
-
<Label className="text-xs">URL del Webhook</Label>
|
|
19
|
-
<div className="flex gap-2">
|
|
20
|
-
<Input defaultValue={webhookUrl} placeholder="https://..." className="h-8 text-sm" />
|
|
21
|
-
<Button variant="outline" size="icon" className="h-8 w-8 shrink-0">
|
|
22
|
-
<Copy className="h-3.5 w-3.5" />
|
|
23
|
-
</Button>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<p className="text-xs text-muted-foreground">Configura esta URL en la plataforma del canal para recibir eventos.</p>
|
|
27
|
-
</CardContent>
|
|
28
|
-
</Card>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { AvailableChannelsGrid } from "./AvailableChannelsGrid";
|
|
2
|
-
export { ChannelTypeCard } from "./ChannelTypeCard";
|
|
3
|
-
export { ChannelSetupWizard } from "./ChannelSetupWizard";
|
|
4
|
-
export { ChannelAuthForm } from "./ChannelAuthForm";
|
|
5
|
-
export { ChannelWebhookConfig } from "./ChannelWebhookConfig";
|
|
6
|
-
export { ChannelTestConnection } from "./ChannelTestConnection";
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
2
|
-
import { Button } from "@/components/ui/button";
|
|
3
|
-
import { Settings, RefreshCw, Power, type LucideProps } from "lucide-react";
|
|
4
|
-
import type { ConnectedChannel } from "@/types";
|
|
5
|
-
import { ChannelStatusBadge } from "./ChannelStatusBadge";
|
|
6
|
-
import { ChannelIcon } from "../shared/ChannelIcon";
|
|
7
|
-
import { useChannels } from "@/hooks/useChannels";
|
|
8
|
-
import { useState } from "react";
|
|
9
|
-
import {
|
|
10
|
-
Sheet,
|
|
11
|
-
SheetContent,
|
|
12
|
-
SheetDescription,
|
|
13
|
-
SheetHeader,
|
|
14
|
-
SheetTitle,
|
|
15
|
-
SheetTrigger
|
|
16
|
-
} from "@/components/ui/sheet";
|
|
17
|
-
import { ChannelConfigPanel } from "./ChannelConfigPanel";
|
|
18
|
-
|
|
19
|
-
function Icon({ icon: IconComponent, ...props }: { icon: React.ComponentType<LucideProps> } & LucideProps) {
|
|
20
|
-
return <IconComponent {...props} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface ChannelCardProps {
|
|
24
|
-
channel: ConnectedChannel;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function ChannelCard({ channel }: ChannelCardProps) {
|
|
28
|
-
const { toggleChannel } = useChannels();
|
|
29
|
-
const [isToggling, setIsToggling] = useState(false);
|
|
30
|
-
|
|
31
|
-
const handleToggle = async () => {
|
|
32
|
-
setIsToggling(true);
|
|
33
|
-
try {
|
|
34
|
-
await toggleChannel(channel.id, false);
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error("Error al desactivar canal:", error);
|
|
37
|
-
} finally {
|
|
38
|
-
setIsToggling(false);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Card>
|
|
44
|
-
<CardHeader className="pb-2">
|
|
45
|
-
<div className="flex items-center justify-between">
|
|
46
|
-
<div className="flex items-center gap-2">
|
|
47
|
-
<ChannelIcon type={channel.type} className="h-5 w-5" />
|
|
48
|
-
<CardTitle className="text-sm">{channel.name}</CardTitle>
|
|
49
|
-
</div>
|
|
50
|
-
<ChannelStatusBadge status={channel.status} />
|
|
51
|
-
</div>
|
|
52
|
-
</CardHeader>
|
|
53
|
-
<CardContent>
|
|
54
|
-
<div className="flex items-center justify-between">
|
|
55
|
-
<div className="space-y-1 text-xs text-muted-foreground">
|
|
56
|
-
<p>{channel.stats?.messagesLast24h ?? 0} mensajes (24h)</p>
|
|
57
|
-
<p>{channel.stats?.activeUsers ?? 0} usuarios activos</p>
|
|
58
|
-
</div>
|
|
59
|
-
<div className="flex gap-1">
|
|
60
|
-
<Sheet>
|
|
61
|
-
<SheetTrigger asChild>
|
|
62
|
-
<Button variant="ghost" size="icon" className="h-7 w-7">
|
|
63
|
-
<Icon icon={Settings as any} className="h-3.5 w-3.5" />
|
|
64
|
-
</Button>
|
|
65
|
-
</SheetTrigger>
|
|
66
|
-
<SheetContent className="sm:max-w-[540px] border-l-white/5 bg-background/95 backdrop-blur-2xl">
|
|
67
|
-
<SheetHeader className="pb-6">
|
|
68
|
-
<SheetTitle>Configuración del Canal</SheetTitle>
|
|
69
|
-
<SheetDescription>
|
|
70
|
-
Ajusta la personalización y políticas de seguridad para {channel.name}.
|
|
71
|
-
</SheetDescription>
|
|
72
|
-
</SheetHeader>
|
|
73
|
-
<div className="py-2">
|
|
74
|
-
<ChannelConfigPanel channel={channel} />
|
|
75
|
-
</div>
|
|
76
|
-
</SheetContent>
|
|
77
|
-
</Sheet>
|
|
78
|
-
<Button variant="ghost" size="icon" className="h-7 w-7">
|
|
79
|
-
<Icon icon={RefreshCw as any} className="h-3.5 w-3.5" />
|
|
80
|
-
</Button>
|
|
81
|
-
<Button
|
|
82
|
-
variant="ghost"
|
|
83
|
-
size="icon"
|
|
84
|
-
className="h-7 w-7 text-destructive"
|
|
85
|
-
onClick={handleToggle}
|
|
86
|
-
disabled={isToggling}
|
|
87
|
-
>
|
|
88
|
-
<Icon icon={Power as any} className="h-3.5 w-3.5" />
|
|
89
|
-
</Button>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</CardContent>
|
|
93
|
-
</Card>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
3
|
-
import { Label } from "@/components/ui/label";
|
|
4
|
-
import { Input } from "@/components/ui/input";
|
|
5
|
-
import { Button } from "@/components/ui/button";
|
|
6
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
|
7
|
-
import { SaveStatusIndicator } from "@/modules/agent-config/shared/SaveStatusIndicator";
|
|
8
|
-
import { Settings, Shield, User, Zap, Info, Save, X, Activity } from "lucide-react";
|
|
9
|
-
import { useChannels } from "@/hooks/useChannels";
|
|
10
|
-
import { ChannelIcon } from "../shared/ChannelIcon";
|
|
11
|
-
import { cn } from "@/lib/utils";
|
|
12
|
-
import type { ConnectedChannel } from "@/types";
|
|
13
|
-
|
|
14
|
-
interface ChannelConfigPanelProps {
|
|
15
|
-
channel: ConnectedChannel;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function ChannelConfigPanel({ channel }: ChannelConfigPanelProps) {
|
|
19
|
-
const { updateChannel } = useChannels();
|
|
20
|
-
const [isSaving, setIsSaving] = useState(false);
|
|
21
|
-
const [saveStatus, setSaveStatus] = useState<"saved" | "saving" | "error" | "idle">("idle");
|
|
22
|
-
|
|
23
|
-
// Local state for the configuration
|
|
24
|
-
const [config, setConfig] = useState({
|
|
25
|
-
name: channel.name || "",
|
|
26
|
-
bindingMode: channel.bindingMode || "fixed",
|
|
27
|
-
policies: {
|
|
28
|
-
dmPolicy: channel.config?.policies?.dmPolicy || "open",
|
|
29
|
-
requireAuth: channel.config?.policies?.requireAuth || false,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// Track if there are unsaved changes
|
|
34
|
-
const [hasChanges, setHasChanges] = useState(false);
|
|
35
|
-
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
setConfig({
|
|
38
|
-
name: channel.name || "",
|
|
39
|
-
bindingMode: channel.bindingMode || "fixed",
|
|
40
|
-
policies: {
|
|
41
|
-
dmPolicy: channel.config?.policies?.dmPolicy || "open",
|
|
42
|
-
requireAuth: channel.config?.policies?.requireAuth || false,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
setHasChanges(false);
|
|
46
|
-
}, [channel]);
|
|
47
|
-
|
|
48
|
-
const handleSave = async () => {
|
|
49
|
-
setIsSaving(true);
|
|
50
|
-
setSaveStatus("saving");
|
|
51
|
-
try {
|
|
52
|
-
// Assuming the backend expectation is matched with updateChannel(type, accountId, config)
|
|
53
|
-
// Note: channel.type and channel.accountId are needed
|
|
54
|
-
// Based on server.ts: /api/channels/:type/:accountId
|
|
55
|
-
await updateChannel(channel.id, {
|
|
56
|
-
...channel.config,
|
|
57
|
-
name: config.name,
|
|
58
|
-
bindingMode: config.bindingMode,
|
|
59
|
-
policies: {
|
|
60
|
-
...channel.config?.policies,
|
|
61
|
-
...config.policies,
|
|
62
|
-
},
|
|
63
|
-
} as any);
|
|
64
|
-
|
|
65
|
-
setSaveStatus("saved");
|
|
66
|
-
setHasChanges(false);
|
|
67
|
-
setTimeout(() => setSaveStatus("idle"), 3000);
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error("Error saving channel config:", error);
|
|
70
|
-
setSaveStatus("error");
|
|
71
|
-
} finally {
|
|
72
|
-
setIsSaving(false);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const handleReset = () => {
|
|
77
|
-
setConfig({
|
|
78
|
-
name: channel.name || "",
|
|
79
|
-
bindingMode: channel.bindingMode || "fixed",
|
|
80
|
-
policies: {
|
|
81
|
-
dmPolicy: channel.config?.policies?.dmPolicy || "open",
|
|
82
|
-
requireAuth: channel.config?.policies?.requireAuth || false,
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
setHasChanges(false);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const updateField = (field: string, value: any) => {
|
|
89
|
-
setConfig(prev => {
|
|
90
|
-
const newConfig = { ...prev };
|
|
91
|
-
if (field.includes('.')) {
|
|
92
|
-
const [parent, child] = field.split('.');
|
|
93
|
-
(newConfig as any)[parent] = { ...(newConfig as any)[parent], [child]: value };
|
|
94
|
-
} else {
|
|
95
|
-
(newConfig as any)[field] = value;
|
|
96
|
-
}
|
|
97
|
-
return newConfig;
|
|
98
|
-
});
|
|
99
|
-
setHasChanges(true);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<div className="space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-500">
|
|
104
|
-
<div className="flex items-center justify-between">
|
|
105
|
-
<div className="flex items-center gap-3">
|
|
106
|
-
<div className="p-2 rounded-xl bg-primary/10">
|
|
107
|
-
<ChannelIcon type={channel.type} className="h-5 w-5" />
|
|
108
|
-
</div>
|
|
109
|
-
<div>
|
|
110
|
-
<h3 className="text-base font-bold tracking-tight">Personalización del Canal</h3>
|
|
111
|
-
<p className="text-[10px] text-muted-foreground uppercase tracking-widest font-medium">ID: {channel.id}</p>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
<div className="flex items-center gap-3">
|
|
115
|
-
{hasChanges && <span className="text-[10px] font-bold text-amber-500 animate-pulse">CAMBIOS SIN GUARDAR</span>}
|
|
116
|
-
<SaveStatusIndicator status={saveStatus === "idle" ? "saved" : saveStatus} />
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
121
|
-
{/* General Settings */}
|
|
122
|
-
<Card className="border-none bg-secondary/30 backdrop-blur-sm overflow-hidden group">
|
|
123
|
-
<div className="absolute inset-x-0 top-0 h-[2px] bg-gradient-to-r from-transparent via-primary/40 to-transparent opacity-0 group-hover:opacity-100 transition-opacity" />
|
|
124
|
-
<CardHeader className="pb-3 border-b border-white/5">
|
|
125
|
-
<CardTitle className="text-xs font-bold flex items-center gap-2">
|
|
126
|
-
<Settings className="h-3.5 w-3.5 text-primary" />
|
|
127
|
-
GENERAL
|
|
128
|
-
</CardTitle>
|
|
129
|
-
</CardHeader>
|
|
130
|
-
<CardContent className="pt-4 space-y-4">
|
|
131
|
-
<div className="space-y-2">
|
|
132
|
-
<Label className="text-[10px] font-bold text-muted-foreground uppercase tracking-wider flex items-center gap-2">
|
|
133
|
-
<Info className="h-3 w-3" /> Nombre del canal
|
|
134
|
-
</Label>
|
|
135
|
-
<Input
|
|
136
|
-
value={config.name}
|
|
137
|
-
onChange={(e) => updateField('name', e.target.value)}
|
|
138
|
-
className="h-10 bg-background/50 border-white/5 focus-visible:ring-primary/20 transition-all text-sm font-medium"
|
|
139
|
-
placeholder="Ej. Mi Canal Principal"
|
|
140
|
-
/>
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
<div className="space-y-2">
|
|
144
|
-
<Label className="text-[10px] font-bold text-muted-foreground uppercase tracking-wider flex items-center gap-2">
|
|
145
|
-
<Zap className="h-3 w-3 text-amber-500" /> Modo de Binding
|
|
146
|
-
</Label>
|
|
147
|
-
<Select
|
|
148
|
-
value={config.bindingMode}
|
|
149
|
-
onValueChange={(val) => updateField('bindingMode', val)}
|
|
150
|
-
>
|
|
151
|
-
<SelectTrigger className="h-10 bg-background/50 border-white/5 focus-visible:ring-primary/20 transition-all text-sm font-medium">
|
|
152
|
-
<SelectValue />
|
|
153
|
-
</SelectTrigger>
|
|
154
|
-
<SelectContent className="bg-popover/95 border-white/10 backdrop-blur-xl">
|
|
155
|
-
<SelectItem value="fixed" className="text-sm cursor-pointer hover:bg-primary/10 transition-colors">
|
|
156
|
-
<div className="flex flex-col">
|
|
157
|
-
<span>Fijo</span>
|
|
158
|
-
<span className="text-[10px] text-muted-foreground">Siempre el mismo agente</span>
|
|
159
|
-
</div>
|
|
160
|
-
</SelectItem>
|
|
161
|
-
<SelectItem value="conditional" className="text-sm cursor-pointer hover:bg-primary/10 transition-colors">
|
|
162
|
-
<div className="flex flex-col">
|
|
163
|
-
<span>Condicional</span>
|
|
164
|
-
<span className="text-[10px] text-muted-foreground">Reglas predefinidas</span>
|
|
165
|
-
</div>
|
|
166
|
-
</SelectItem>
|
|
167
|
-
<SelectItem value="dynamic" className="text-sm cursor-pointer hover:bg-primary/10 transition-colors">
|
|
168
|
-
<div className="flex flex-col">
|
|
169
|
-
<span>Dinámico</span>
|
|
170
|
-
<span className="text-[10px] text-muted-foreground">Selección por IA</span>
|
|
171
|
-
</div>
|
|
172
|
-
</SelectItem>
|
|
173
|
-
</SelectContent>
|
|
174
|
-
</Select>
|
|
175
|
-
</div>
|
|
176
|
-
</CardContent>
|
|
177
|
-
</Card>
|
|
178
|
-
|
|
179
|
-
{/* Policies Settings */}
|
|
180
|
-
<Card className="border-none bg-secondary/30 backdrop-blur-sm overflow-hidden group">
|
|
181
|
-
<div className="absolute inset-x-0 top-0 h-[2px] bg-gradient-to-r from-transparent via-indigo-400/40 to-transparent opacity-0 group-hover:opacity-100 transition-opacity" />
|
|
182
|
-
<CardHeader className="pb-3 border-b border-white/5">
|
|
183
|
-
<CardTitle className="text-xs font-bold flex items-center gap-2">
|
|
184
|
-
<Shield className="h-3.5 w-3.5 text-indigo-400" />
|
|
185
|
-
POLÍTICAS Y SEGURIDAD
|
|
186
|
-
</CardTitle>
|
|
187
|
-
</CardHeader>
|
|
188
|
-
<CardContent className="pt-4 space-y-4">
|
|
189
|
-
<div className="space-y-2">
|
|
190
|
-
<Label className="text-[10px] font-bold text-muted-foreground uppercase tracking-wider flex items-center gap-2">
|
|
191
|
-
<User className="h-3 w-3" /> Política de Mensajes Directos (DM)
|
|
192
|
-
</Label>
|
|
193
|
-
<Select
|
|
194
|
-
value={config.policies.dmPolicy}
|
|
195
|
-
onValueChange={(val) => updateField('policies.dmPolicy', val)}
|
|
196
|
-
>
|
|
197
|
-
<SelectTrigger className="h-10 bg-background/50 border-white/5 focus-visible:ring-primary/20 transition-all text-sm font-medium">
|
|
198
|
-
<SelectValue />
|
|
199
|
-
</SelectTrigger>
|
|
200
|
-
<SelectContent className="bg-popover/95 border-white/10 backdrop-blur-xl">
|
|
201
|
-
<SelectItem value="open" className="text-sm cursor-pointer hover:bg-primary/10 transition-colors">
|
|
202
|
-
<div className="flex flex-col">
|
|
203
|
-
<span>Abierto</span>
|
|
204
|
-
<span className="text-[10px] text-muted-foreground">Cualquiera puede iniciar chat</span>
|
|
205
|
-
</div>
|
|
206
|
-
</SelectItem>
|
|
207
|
-
<SelectItem value="pairing" className="text-sm cursor-pointer hover:bg-primary/10 transition-colors">
|
|
208
|
-
<div className="flex flex-col">
|
|
209
|
-
<span>Emparejamiento</span>
|
|
210
|
-
<span className="text-[10px] text-muted-foreground">Requiere vinculación manual</span>
|
|
211
|
-
</div>
|
|
212
|
-
</SelectItem>
|
|
213
|
-
</SelectContent>
|
|
214
|
-
</Select>
|
|
215
|
-
</div>
|
|
216
|
-
|
|
217
|
-
<div className="p-3 rounded-lg bg-indigo-500/5 border border-indigo-500/10 flex items-start gap-3">
|
|
218
|
-
<Activity className="h-4 w-4 text-indigo-400 mt-0.5" />
|
|
219
|
-
<div className="space-y-1">
|
|
220
|
-
<p className="text-[11px] font-bold text-indigo-300 tracking-wide uppercase">Estado del Sistema</p>
|
|
221
|
-
<p className="text-[10px] text-muted-foreground">Canal optimizado con encripción de nivel militar y redundancia multi-zona.</p>
|
|
222
|
-
</div>
|
|
223
|
-
</div>
|
|
224
|
-
</CardContent>
|
|
225
|
-
</Card>
|
|
226
|
-
</div>
|
|
227
|
-
|
|
228
|
-
<div className="flex justify-end items-center gap-4 pt-4 border-t border-white/5">
|
|
229
|
-
<Button
|
|
230
|
-
variant="ghost"
|
|
231
|
-
size="sm"
|
|
232
|
-
onClick={handleReset}
|
|
233
|
-
disabled={!hasChanges || isSaving}
|
|
234
|
-
className="h-9 px-6 text-xs font-bold tracking-tight hover:bg-white/5 transition-colors"
|
|
235
|
-
>
|
|
236
|
-
<X className="h-3.5 w-3.5 mr-2" /> REVERTIR
|
|
237
|
-
</Button>
|
|
238
|
-
<Button
|
|
239
|
-
size="sm"
|
|
240
|
-
onClick={handleSave}
|
|
241
|
-
disabled={!hasChanges || isSaving}
|
|
242
|
-
className={cn(
|
|
243
|
-
"h-9 px-8 text-xs font-bold tracking-tight shadow-lg shadow-primary/20 transition-all active:scale-95",
|
|
244
|
-
hasChanges ? "bg-primary text-primary-foreground hover:opacity-90" : "bg-muted text-muted-foreground cursor-not-allowed"
|
|
245
|
-
)}
|
|
246
|
-
>
|
|
247
|
-
{isSaving ? (
|
|
248
|
-
<span className="flex items-center gap-2">
|
|
249
|
-
<Save className="h-3.5 w-3.5 animate-spin" /> PROCESANDO...
|
|
250
|
-
</span>
|
|
251
|
-
) : (
|
|
252
|
-
<span className="flex items-center gap-2">
|
|
253
|
-
<Save className="h-3.5 w-3.5" /> GUARDAR CAMBIOS
|
|
254
|
-
</span>
|
|
255
|
-
)}
|
|
256
|
-
</Button>
|
|
257
|
-
</div>
|
|
258
|
-
</div>
|
|
259
|
-
);
|
|
260
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { Power } from "lucide-react";
|
|
3
|
-
|
|
4
|
-
interface ChannelDisconnectButtonProps {
|
|
5
|
-
channelId: string;
|
|
6
|
-
channelName: string;
|
|
7
|
-
onDisconnect?: (id: string) => void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function ChannelDisconnectButton({ channelId, channelName, onDisconnect }: ChannelDisconnectButtonProps) {
|
|
11
|
-
return (
|
|
12
|
-
<Button
|
|
13
|
-
variant="destructive"
|
|
14
|
-
size="sm"
|
|
15
|
-
onClick={() => onDisconnect?.(channelId)}
|
|
16
|
-
>
|
|
17
|
-
<Power className="mr-1 h-3.5 w-3.5" />
|
|
18
|
-
Desconectar
|
|
19
|
-
</Button>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
2
|
-
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
3
|
-
import { Badge } from "@/components/ui/badge";
|
|
4
|
-
import type { ChannelLog } from "@/types";
|
|
5
|
-
|
|
6
|
-
interface ChannelLogsViewerProps {
|
|
7
|
-
logs: ChannelLog[];
|
|
8
|
-
channelName?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const logTypeColors: Record<string, string> = {
|
|
12
|
-
info: "bg-primary/15 text-primary border-primary/30",
|
|
13
|
-
warning: "bg-hive-thinking/15 text-hive-thinking border-hive-thinking/30",
|
|
14
|
-
error: "bg-destructive/15 text-destructive border-destructive/30",
|
|
15
|
-
debug: "bg-muted text-muted-foreground border-border",
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function ChannelLogsViewer({ logs, channelName }: ChannelLogsViewerProps) {
|
|
19
|
-
return (
|
|
20
|
-
<div className="space-y-3">
|
|
21
|
-
<h3 className="text-sm font-semibold">Logs{channelName ? `: ${channelName}` : ""}</h3>
|
|
22
|
-
<ScrollArea className="h-64">
|
|
23
|
-
<div className="space-y-1 font-mono text-xs">
|
|
24
|
-
{logs.map((log) => (
|
|
25
|
-
<div key={log.id} className="flex items-start gap-2 rounded px-2 py-1 hover:bg-muted/50">
|
|
26
|
-
<Badge variant="outline" className={`${logTypeColors[log.type]} text-[10px] shrink-0`}>
|
|
27
|
-
{log.type}
|
|
28
|
-
</Badge>
|
|
29
|
-
<span className="text-muted-foreground shrink-0">
|
|
30
|
-
{new Date(log.timestamp).toLocaleTimeString()}
|
|
31
|
-
</span>
|
|
32
|
-
<span>{log.message}</span>
|
|
33
|
-
</div>
|
|
34
|
-
))}
|
|
35
|
-
{logs.length === 0 && (
|
|
36
|
-
<p className="py-4 text-center text-muted-foreground">Sin logs recientes</p>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
</ScrollArea>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent } from "@/components/ui/card";
|
|
2
|
-
import { QrCode } from "lucide-react";
|
|
3
|
-
|
|
4
|
-
interface ChannelQRCodeProps {
|
|
5
|
-
qrData?: string;
|
|
6
|
-
pairingCode?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function ChannelQRCode({ qrData, pairingCode }: ChannelQRCodeProps) {
|
|
10
|
-
return (
|
|
11
|
-
<Card>
|
|
12
|
-
<CardContent className="flex flex-col items-center gap-3 py-6">
|
|
13
|
-
<div className="flex h-48 w-48 items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/30 bg-muted/50">
|
|
14
|
-
{qrData ? (
|
|
15
|
-
<img src={qrData} alt="QR Code" className="h-full w-full rounded-lg object-contain" />
|
|
16
|
-
) : (
|
|
17
|
-
<QrCode className="h-16 w-16 text-muted-foreground/50" />
|
|
18
|
-
)}
|
|
19
|
-
</div>
|
|
20
|
-
{pairingCode && (
|
|
21
|
-
<div className="text-center">
|
|
22
|
-
<p className="text-xs text-muted-foreground">Código de emparejamiento</p>
|
|
23
|
-
<p className="font-mono text-lg font-bold tracking-widest">{pairingCode}</p>
|
|
24
|
-
</div>
|
|
25
|
-
)}
|
|
26
|
-
{!qrData && !pairingCode && (
|
|
27
|
-
<p className="text-xs text-muted-foreground">Esperando código QR...</p>
|
|
28
|
-
)}
|
|
29
|
-
</CardContent>
|
|
30
|
-
</Card>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Button } from "@/components/ui/button";
|
|
2
|
-
import { RefreshCw } from "lucide-react";
|
|
3
|
-
|
|
4
|
-
interface ChannelReconnectButtonProps {
|
|
5
|
-
channelId: string;
|
|
6
|
-
onReconnect?: (id: string) => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function ChannelReconnectButton({ channelId, onReconnect }: ChannelReconnectButtonProps) {
|
|
10
|
-
return (
|
|
11
|
-
<Button variant="outline" size="sm" onClick={() => onReconnect?.(channelId)}>
|
|
12
|
-
<RefreshCw className="mr-1 h-3.5 w-3.5" />
|
|
13
|
-
Reconectar
|
|
14
|
-
</Button>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Badge } from "@/components/ui/badge";
|
|
2
|
-
import type { ChannelStatus } from "@/types";
|
|
3
|
-
|
|
4
|
-
const statusConfig: Record<ChannelStatus, { label: string; className: string }> = {
|
|
5
|
-
connected: { label: "Conectado", className: "bg-hive-connected/15 text-hive-connected border-hive-connected/30" },
|
|
6
|
-
connecting: { label: "Conectando", className: "bg-hive-thinking/15 text-hive-thinking border-hive-thinking/30 animate-pulse" },
|
|
7
|
-
disconnected: { label: "Desconectado", className: "bg-muted text-muted-foreground border-border" },
|
|
8
|
-
error: { label: "Error", className: "bg-destructive/15 text-destructive border-destructive/30" },
|
|
9
|
-
rate_limited: { label: "Rate Limited", className: "bg-hive-thinking/15 text-hive-thinking border-hive-thinking/30" },
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
interface ChannelStatusBadgeProps {
|
|
13
|
-
status: ChannelStatus;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function ChannelStatusBadge({ status }: ChannelStatusBadgeProps) {
|
|
17
|
-
// Handle undefined or invalid status with fallback to disconnected
|
|
18
|
-
const validStatus = status ?? 'disconnected';
|
|
19
|
-
const config = statusConfig[validStatus] ?? statusConfig.disconnected;
|
|
20
|
-
return (
|
|
21
|
-
<Badge variant="outline" className={config?.className ?? 'border-muted'}>
|
|
22
|
-
<span className="mr-1.5 inline-block h-1.5 w-1.5 rounded-full bg-current" />
|
|
23
|
-
{config?.label ?? 'Desconocido'}
|
|
24
|
-
</Badge>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Card, CardContent } from "@/components/ui/card";
|
|
2
|
-
import { Badge } from "@/components/ui/badge";
|
|
3
|
-
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
4
|
-
import { useChannels } from "@/hooks/useChannels";
|
|
5
|
-
import { ChannelCard } from "./ChannelCard";
|
|
6
|
-
|
|
7
|
-
export function ConnectedChannelsList() {
|
|
8
|
-
const { activeChannels, isLoading } = useChannels();
|
|
9
|
-
|
|
10
|
-
if (isLoading) {
|
|
11
|
-
return (
|
|
12
|
-
<div className="flex items-center justify-center py-8">
|
|
13
|
-
<p className="text-sm text-muted-foreground">Cargando canales...</p>
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className="space-y-4">
|
|
20
|
-
<div className="flex items-center justify-between">
|
|
21
|
-
<h3 className="text-sm font-semibold">Canales Activos</h3>
|
|
22
|
-
<Badge variant="secondary">{activeChannels.length}</Badge>
|
|
23
|
-
</div>
|
|
24
|
-
<ScrollArea className="h-[calc(100vh-16rem)]">
|
|
25
|
-
<div className="space-y-3">
|
|
26
|
-
{activeChannels.map((channel) => (
|
|
27
|
-
<ChannelCard key={channel.id} channel={channel} />
|
|
28
|
-
))}
|
|
29
|
-
{activeChannels.length === 0 && (
|
|
30
|
-
<Card>
|
|
31
|
-
<CardContent className="py-8 text-center text-sm text-muted-foreground">
|
|
32
|
-
No hay canales conectados. Ve a la pestaña "Disponibles" para activar uno.
|
|
33
|
-
</CardContent>
|
|
34
|
-
</Card>
|
|
35
|
-
)}
|
|
36
|
-
</div>
|
|
37
|
-
</ScrollArea>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { ConnectedChannelsList } from "./ConnectedChannelsList";
|
|
2
|
-
export { ChannelCard } from "./ChannelCard";
|
|
3
|
-
export { ChannelStatusBadge } from "./ChannelStatusBadge";
|
|
4
|
-
export { ChannelConfigPanel } from "./ChannelConfigPanel";
|
|
5
|
-
export { ChannelLogsViewer } from "./ChannelLogsViewer";
|
|
6
|
-
export { ChannelDisconnectButton } from "./ChannelDisconnectButton";
|
|
7
|
-
export { ChannelReconnectButton } from "./ChannelReconnectButton";
|
|
8
|
-
export { ChannelQRCode } from "./ChannelQRCode";
|