@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,1177 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { useNavigate } from "react-router-dom";
|
|
3
|
-
import { Button } from "@/components/ui/button";
|
|
4
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
|
5
|
-
import { Input } from "@/components/ui/input";
|
|
6
|
-
import { Label } from "@/components/ui/label";
|
|
7
|
-
import { Switch } from "@/components/ui/switch";
|
|
8
|
-
import { Badge } from "@/components/ui/badge";
|
|
9
|
-
import { Progress } from "@/components/ui/progress";
|
|
10
|
-
import {
|
|
11
|
-
Select,
|
|
12
|
-
SelectContent,
|
|
13
|
-
SelectItem,
|
|
14
|
-
SelectTrigger,
|
|
15
|
-
SelectValue,
|
|
16
|
-
} from "@/components/ui/select";
|
|
17
|
-
import {
|
|
18
|
-
Accordion,
|
|
19
|
-
AccordionContent,
|
|
20
|
-
AccordionItem,
|
|
21
|
-
AccordionTrigger,
|
|
22
|
-
} from "@/components/ui/accordion";
|
|
23
|
-
import { Checkbox } from "@/components/ui/checkbox";
|
|
24
|
-
import { Alert, AlertDescription } from "@/components/ui/alert";
|
|
25
|
-
import { CheckCircle2, XCircle, Loader2, Sparkles, Hexagon, Volume2, VolumeX } from "lucide-react";
|
|
26
|
-
import { cn } from "@/lib/utils";
|
|
27
|
-
import { apiClient } from "@/lib/api";
|
|
28
|
-
import { swal } from "@/lib/swal";
|
|
29
|
-
|
|
30
|
-
const PROVIDERS = [
|
|
31
|
-
{ id: "gemini", name: "Google Gemini", description: "Modelos rápidos y económicos de Google", logo: "🔵" },
|
|
32
|
-
{ id: "anthropic", name: "Anthropic", description: "Claude — mejor equilibrio para coding", logo: "🟠" },
|
|
33
|
-
{ id: "openai", name: "OpenAI", description: "GPT-5 — el estándar de la industria", logo: "🟢" },
|
|
34
|
-
{ id: "groq", name: "Groq", description: "Inferencia ultra-rápida", logo: "🔴" },
|
|
35
|
-
{ id: "ollama", name: "Ollama", description: "Modelos locales — sin costo", logo: "🟣" },
|
|
36
|
-
{ id: "openrouter", name: "OpenRouter", description: "Multi-proveedor — unifica tus keys", logo: "🟡" },
|
|
37
|
-
{ id: "deepseek", name: "DeepSeek", description: "Modelos de alta calidad y bajo costo", logo: "🔷" },
|
|
38
|
-
{ id: "mistral", name: "Mistral AI", description: "Modelos europeos open-weight", logo: "🔸" },
|
|
39
|
-
{ id: "kimi", name: "Kimi (Moonshot)", description: "Contexto largo, ideal para código", logo: "🌙" },
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
const CHANNELS = [
|
|
43
|
-
{ id: "webchat", name: "WebChat", description: "Chat web integrado", icon: "💬", required: true },
|
|
44
|
-
{ id: "telegram", name: "Telegram", description: "Bot de Telegram", icon: "✈️", required: false },
|
|
45
|
-
{ id: "discord", name: "Discord", description: "Bot de Discord", icon: "🎮", required: false },
|
|
46
|
-
{ id: "whatsapp", name: "WhatsApp", description: "Bot de WhatsApp", icon: "📱", required: false },
|
|
47
|
-
{ id: "slack", name: "Slack", description: "Bot de Slack", icon: "💼", required: false },
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
const ETHICS_RULES = [
|
|
51
|
-
{ id: "no-harm", category: "NUNCA", description: "No causar daño físico o emocional a personas" },
|
|
52
|
-
{ id: "no-illegal", category: "NUNCA", description: "No facilitar actividades ilegales o peligrosas" },
|
|
53
|
-
{ id: "no-deception", category: "NUNCA", description: "No engañar o manipular deliberadamente" },
|
|
54
|
-
{ id: "privacy-first", category: "SIEMPRE", description: "Proteger la privacidad del usuario" },
|
|
55
|
-
{ id: "transparency", category: "SIEMPRE", description: "Ser transparente sobre limitaciones" },
|
|
56
|
-
{ id: "confirm-destructive", category: "CONFIRMAR", description: "Confirmar antes de acciones destructivas" },
|
|
57
|
-
{ id: "confirm-expensive", category: "CONFIRMAR", description: "Confirmar antes de operaciones costosas" },
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
const AVATARS = [
|
|
61
|
-
{ id: "amber", color: "bg-amber-500", hex: "#f59e0b" },
|
|
62
|
-
{ id: "blue", color: "bg-blue-500", hex: "#3b82f6" },
|
|
63
|
-
{ id: "green", color: "bg-green-500", hex: "#22c55e" },
|
|
64
|
-
{ id: "purple", color: "bg-purple-500", hex: "#a855f7" },
|
|
65
|
-
{ id: "red", color: "bg-red-500", hex: "#ef4444" },
|
|
66
|
-
{ id: "cyan", color: "bg-cyan-500", hex: "#06b6d4" },
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
interface WizardData {
|
|
70
|
-
// Step 1
|
|
71
|
-
userName: string;
|
|
72
|
-
userLanguage: string;
|
|
73
|
-
userTimezone: string;
|
|
74
|
-
// Step 2
|
|
75
|
-
agentName: string;
|
|
76
|
-
agentDescription: string;
|
|
77
|
-
agentAvatar: string;
|
|
78
|
-
// Step 3
|
|
79
|
-
provider: string;
|
|
80
|
-
apiKey: string;
|
|
81
|
-
model: string;
|
|
82
|
-
apiKeyVerified: boolean;
|
|
83
|
-
// Step 4
|
|
84
|
-
channels: Record<string, { enabled: boolean; config?: Record<string, string> }>;
|
|
85
|
-
// Step 5
|
|
86
|
-
voiceEnabled: boolean;
|
|
87
|
-
sttProvider: string;
|
|
88
|
-
ttsProvider: string;
|
|
89
|
-
ttsVoice: string;
|
|
90
|
-
// Step 6
|
|
91
|
-
ethicsRules: Record<string, { enabled: boolean; category: string }>;
|
|
92
|
-
customRules: Array<{ text: string; category: string }>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const STORAGE_KEY = "hive_setup_wizard_data";
|
|
96
|
-
|
|
97
|
-
function loadWizardData(): WizardData | null {
|
|
98
|
-
try {
|
|
99
|
-
const stored = sessionStorage.getItem(STORAGE_KEY);
|
|
100
|
-
if (stored) {
|
|
101
|
-
return JSON.parse(stored);
|
|
102
|
-
}
|
|
103
|
-
} catch (e) {
|
|
104
|
-
console.error("Failed to load wizard data:", e);
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function saveWizardData(data: WizardData): void {
|
|
110
|
-
try {
|
|
111
|
-
sessionStorage.setItem(STORAGE_KEY, JSON.stringify(data));
|
|
112
|
-
} catch (e) {
|
|
113
|
-
console.error("Failed to save wizard data:", e);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function clearWizardData(): void {
|
|
118
|
-
try {
|
|
119
|
-
sessionStorage.removeItem(STORAGE_KEY);
|
|
120
|
-
} catch (e) {
|
|
121
|
-
console.error("Failed to clear wizard data:", e);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function getDefaultWizardData(): WizardData {
|
|
126
|
-
return {
|
|
127
|
-
userName: "",
|
|
128
|
-
userLanguage: "es",
|
|
129
|
-
userTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC",
|
|
130
|
-
agentName: "Bee",
|
|
131
|
-
agentDescription: "",
|
|
132
|
-
agentAvatar: "amber",
|
|
133
|
-
provider: "",
|
|
134
|
-
apiKey: "",
|
|
135
|
-
model: "",
|
|
136
|
-
apiKeyVerified: false,
|
|
137
|
-
channels: {
|
|
138
|
-
webchat: { enabled: true },
|
|
139
|
-
telegram: { enabled: false },
|
|
140
|
-
discord: { enabled: false },
|
|
141
|
-
whatsapp: { enabled: false },
|
|
142
|
-
slack: { enabled: false },
|
|
143
|
-
},
|
|
144
|
-
voiceEnabled: false,
|
|
145
|
-
sttProvider: "groq-whisper",
|
|
146
|
-
ttsProvider: "elevenlabs",
|
|
147
|
-
ttsVoice: "",
|
|
148
|
-
ethicsRules: Object.fromEntries(
|
|
149
|
-
ETHICS_RULES.map(rule => [rule.id, { enabled: true, category: rule.category }])
|
|
150
|
-
),
|
|
151
|
-
customRules: [],
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export default function SetupPage() {
|
|
156
|
-
const navigate = useNavigate();
|
|
157
|
-
const [currentStep, setCurrentStep] = useState(1);
|
|
158
|
-
const [wizardData, setWizardData] = useState<WizardData>(() => {
|
|
159
|
-
const loaded = loadWizardData();
|
|
160
|
-
return loaded || getDefaultWizardData();
|
|
161
|
-
});
|
|
162
|
-
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
163
|
-
const [submitSuccess, setSubmitSuccess] = useState(false);
|
|
164
|
-
const [verificationStatus, setVerificationStatus] = useState<"idle" | "verifying" | "success" | "error">("idle");
|
|
165
|
-
|
|
166
|
-
useEffect(() => {
|
|
167
|
-
saveWizardData(wizardData);
|
|
168
|
-
}, [wizardData]);
|
|
169
|
-
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
// Check if already configured
|
|
172
|
-
fetch("/api/setup/status")
|
|
173
|
-
.then(res => res.json())
|
|
174
|
-
.then(data => {
|
|
175
|
-
if (data.configured) {
|
|
176
|
-
navigate("/ui");
|
|
177
|
-
}
|
|
178
|
-
})
|
|
179
|
-
.catch(() => {
|
|
180
|
-
// API might not exist yet, continue
|
|
181
|
-
});
|
|
182
|
-
}, [navigate]);
|
|
183
|
-
|
|
184
|
-
const updateData = (updates: Partial<WizardData>) => {
|
|
185
|
-
setWizardData(prev => ({ ...prev, ...updates }));
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const canProceed = (): boolean => {
|
|
189
|
-
switch (currentStep) {
|
|
190
|
-
case 1:
|
|
191
|
-
return wizardData.userName.trim().length >= 2;
|
|
192
|
-
case 2:
|
|
193
|
-
return wizardData.agentName.trim().length >= 2;
|
|
194
|
-
case 3:
|
|
195
|
-
return wizardData.provider !== "" && wizardData.apiKeyVerified;
|
|
196
|
-
case 4:
|
|
197
|
-
return true; // WebChat is always enabled
|
|
198
|
-
case 5:
|
|
199
|
-
return true; // Voice is optional
|
|
200
|
-
case 6:
|
|
201
|
-
return true; // At least one rule should be enabled (default)
|
|
202
|
-
case 7:
|
|
203
|
-
return true;
|
|
204
|
-
default:
|
|
205
|
-
return false;
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
const handleNext = () => {
|
|
210
|
-
if (canProceed() && currentStep < 7) {
|
|
211
|
-
setCurrentStep(prev => prev + 1);
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
const handleBack = () => {
|
|
216
|
-
if (currentStep > 1) {
|
|
217
|
-
setCurrentStep(prev => prev - 1);
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const handleReset = () => {
|
|
222
|
-
if (confirm("¿Estás seguro de que quieres reiniciar la configuración? Se perderá todo el progreso.")) {
|
|
223
|
-
clearWizardData();
|
|
224
|
-
setWizardData(getDefaultWizardData());
|
|
225
|
-
setCurrentStep(1);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
const verifyApiKey = async () => {
|
|
230
|
-
if (!wizardData.apiKey || !wizardData.provider) return;
|
|
231
|
-
|
|
232
|
-
setVerificationStatus("verifying");
|
|
233
|
-
try {
|
|
234
|
-
const result = await apiClient<{ success: boolean }>("/api/setup/verify-provider", {
|
|
235
|
-
method: "POST",
|
|
236
|
-
body: {
|
|
237
|
-
provider: wizardData.provider,
|
|
238
|
-
apiKey: wizardData.apiKey,
|
|
239
|
-
model: wizardData.model || "test",
|
|
240
|
-
},
|
|
241
|
-
showLoader: "Verificando conexión...",
|
|
242
|
-
showError: false
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
if (result.success) {
|
|
246
|
-
setVerificationStatus("success");
|
|
247
|
-
updateData({ apiKeyVerified: true });
|
|
248
|
-
} else {
|
|
249
|
-
setVerificationStatus("error");
|
|
250
|
-
updateData({ apiKeyVerified: false });
|
|
251
|
-
}
|
|
252
|
-
} catch (error) {
|
|
253
|
-
setVerificationStatus("error");
|
|
254
|
-
updateData({ apiKeyVerified: false });
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
const handleSubmit = async () => {
|
|
259
|
-
setIsSubmitting(true);
|
|
260
|
-
try {
|
|
261
|
-
const result = await apiClient<{ success: boolean; authToken?: string; error?: string }>("/api/setup/complete", {
|
|
262
|
-
method: "POST",
|
|
263
|
-
body: wizardData,
|
|
264
|
-
showLoader: "Finalizando configuración...",
|
|
265
|
-
showError: true
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
if (result.success) {
|
|
269
|
-
if (result.authToken) {
|
|
270
|
-
localStorage.setItem("hive-auth-token", result.authToken);
|
|
271
|
-
}
|
|
272
|
-
setSubmitSuccess(true);
|
|
273
|
-
clearWizardData();
|
|
274
|
-
setTimeout(() => {
|
|
275
|
-
navigate("/");
|
|
276
|
-
}, 2000);
|
|
277
|
-
}
|
|
278
|
-
} catch (error) {
|
|
279
|
-
// Error handled by apiClient
|
|
280
|
-
} finally {
|
|
281
|
-
setIsSubmitting(false);
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
const renderStep = () => {
|
|
286
|
-
switch (currentStep) {
|
|
287
|
-
case 1:
|
|
288
|
-
return renderStep1();
|
|
289
|
-
case 2:
|
|
290
|
-
return renderStep2();
|
|
291
|
-
case 3:
|
|
292
|
-
return renderStep3();
|
|
293
|
-
case 4:
|
|
294
|
-
return renderStep4();
|
|
295
|
-
case 5:
|
|
296
|
-
return renderStep5();
|
|
297
|
-
case 6:
|
|
298
|
-
return renderStep6();
|
|
299
|
-
case 7:
|
|
300
|
-
return renderStep7();
|
|
301
|
-
default:
|
|
302
|
-
return null;
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
const renderStep1 = () => (
|
|
307
|
-
<div className="space-y-6">
|
|
308
|
-
<div className="text-center space-y-4">
|
|
309
|
-
<div className="flex justify-center">
|
|
310
|
-
<div className="relative">
|
|
311
|
-
<Hexagon className="w-24 h-24 text-amber-500" fill="currentColor" />
|
|
312
|
-
<Sparkles className="w-8 h-8 text-amber-300 absolute -top-2 -right-2" />
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
<h1 className="text-3xl font-bold">Bienvenido a Hive</h1>
|
|
316
|
-
<p className="text-muted-foreground max-w-md mx-auto">
|
|
317
|
-
Hive es tu colmena de agentes IA. Local-first. Multi-canal. Open source.
|
|
318
|
-
En los próximos minutos configurarás tu agente personal Bee.
|
|
319
|
-
</p>
|
|
320
|
-
</div>
|
|
321
|
-
|
|
322
|
-
<Card>
|
|
323
|
-
<CardHeader>
|
|
324
|
-
<CardTitle>Tu información</CardTitle>
|
|
325
|
-
<CardDescription>Comencemos con tus datos básicos</CardDescription>
|
|
326
|
-
</CardHeader>
|
|
327
|
-
<CardContent className="space-y-4">
|
|
328
|
-
<div className="space-y-2">
|
|
329
|
-
<Label htmlFor="userName">Tu nombre</Label>
|
|
330
|
-
<Input
|
|
331
|
-
id="userName"
|
|
332
|
-
placeholder="¿Cómo te llamas?"
|
|
333
|
-
value={wizardData.userName}
|
|
334
|
-
onChange={(e) => updateData({ userName: e.target.value })}
|
|
335
|
-
/>
|
|
336
|
-
</div>
|
|
337
|
-
|
|
338
|
-
<div className="space-y-2">
|
|
339
|
-
<Label htmlFor="userLanguage">Idioma preferido</Label>
|
|
340
|
-
<Select
|
|
341
|
-
value={wizardData.userLanguage}
|
|
342
|
-
onValueChange={(value) => updateData({ userLanguage: value })}
|
|
343
|
-
>
|
|
344
|
-
<SelectTrigger>
|
|
345
|
-
<SelectValue />
|
|
346
|
-
</SelectTrigger>
|
|
347
|
-
<SelectContent>
|
|
348
|
-
<SelectItem value="es">Español</SelectItem>
|
|
349
|
-
<SelectItem value="en">English</SelectItem>
|
|
350
|
-
<SelectItem value="pt">Português</SelectItem>
|
|
351
|
-
<SelectItem value="fr">Français</SelectItem>
|
|
352
|
-
</SelectContent>
|
|
353
|
-
</Select>
|
|
354
|
-
</div>
|
|
355
|
-
|
|
356
|
-
<div className="space-y-2">
|
|
357
|
-
<Label htmlFor="userTimezone">Zona horaria</Label>
|
|
358
|
-
<Input
|
|
359
|
-
id="userTimezone"
|
|
360
|
-
value={wizardData.userTimezone}
|
|
361
|
-
onChange={(e) => updateData({ userTimezone: e.target.value })}
|
|
362
|
-
placeholder="America/Bogota"
|
|
363
|
-
/>
|
|
364
|
-
<p className="text-xs text-muted-foreground">
|
|
365
|
-
Detectada automáticamente: {Intl.DateTimeFormat().resolvedOptions().timeZone}
|
|
366
|
-
</p>
|
|
367
|
-
</div>
|
|
368
|
-
</CardContent>
|
|
369
|
-
</Card>
|
|
370
|
-
</div>
|
|
371
|
-
);
|
|
372
|
-
|
|
373
|
-
const renderStep2 = () => (
|
|
374
|
-
<div className="space-y-6">
|
|
375
|
-
<div className="text-center space-y-2">
|
|
376
|
-
<h2 className="text-2xl font-bold">Tu agente</h2>
|
|
377
|
-
<p className="text-muted-foreground">Personaliza a Bee, tu agente personal</p>
|
|
378
|
-
</div>
|
|
379
|
-
|
|
380
|
-
<Card>
|
|
381
|
-
<CardHeader>
|
|
382
|
-
<CardTitle>Identidad del agente</CardTitle>
|
|
383
|
-
</CardHeader>
|
|
384
|
-
<CardContent className="space-y-4">
|
|
385
|
-
<div className="space-y-2">
|
|
386
|
-
<Label htmlFor="agentName">Nombre del agente</Label>
|
|
387
|
-
<Input
|
|
388
|
-
id="agentName"
|
|
389
|
-
value={wizardData.agentName}
|
|
390
|
-
onChange={(e) => updateData({ agentName: e.target.value })}
|
|
391
|
-
placeholder="Bee"
|
|
392
|
-
/>
|
|
393
|
-
</div>
|
|
394
|
-
|
|
395
|
-
<div className="space-y-2">
|
|
396
|
-
<Label htmlFor="agentDescription">Descripción / Personalidad</Label>
|
|
397
|
-
<textarea
|
|
398
|
-
id="agentDescription"
|
|
399
|
-
className="w-full min-h-[100px] p-3 border rounded-md bg-background resize-none"
|
|
400
|
-
value={wizardData.agentDescription}
|
|
401
|
-
onChange={(e) => updateData({ agentDescription: e.target.value })}
|
|
402
|
-
placeholder="Ej: Eres un asistente útil y amable. Respondes de forma concisa pero completa. Te especializas en ayudar con tareas de programación y productividad..."
|
|
403
|
-
/>
|
|
404
|
-
</div>
|
|
405
|
-
|
|
406
|
-
<div className="space-y-2">
|
|
407
|
-
<Label>Avatar del agente</Label>
|
|
408
|
-
<div className="flex gap-3 flex-wrap">
|
|
409
|
-
{AVATARS.map((avatar) => (
|
|
410
|
-
<button
|
|
411
|
-
key={avatar.id}
|
|
412
|
-
className={cn(
|
|
413
|
-
"w-12 h-12 rounded-lg flex items-center justify-center transition-all",
|
|
414
|
-
avatar.color,
|
|
415
|
-
wizardData.agentAvatar === avatar.id
|
|
416
|
-
? "ring-2 ring-offset-2 ring-amber-500 scale-110"
|
|
417
|
-
: "hover:scale-105"
|
|
418
|
-
)}
|
|
419
|
-
onClick={() => updateData({ agentAvatar: avatar.id })}
|
|
420
|
-
>
|
|
421
|
-
<Hexagon className="w-6 h-6 text-white" fill="currentColor" />
|
|
422
|
-
</button>
|
|
423
|
-
))}
|
|
424
|
-
</div>
|
|
425
|
-
</div>
|
|
426
|
-
</CardContent>
|
|
427
|
-
</Card>
|
|
428
|
-
</div>
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
const renderStep3 = () => (
|
|
432
|
-
<div className="space-y-6">
|
|
433
|
-
<div className="text-center space-y-2">
|
|
434
|
-
<h2 className="text-2xl font-bold">Proveedor LLM</h2>
|
|
435
|
-
<p className="text-muted-foreground">Selecciona el cerebro de tu agente</p>
|
|
436
|
-
</div>
|
|
437
|
-
|
|
438
|
-
<div className="grid gap-3">
|
|
439
|
-
{PROVIDERS.map((provider) => (
|
|
440
|
-
<Card
|
|
441
|
-
key={provider.id}
|
|
442
|
-
className={cn(
|
|
443
|
-
"cursor-pointer transition-all hover:shadow-md",
|
|
444
|
-
wizardData.provider === provider.id && "border-amber-500 ring-2 ring-amber-500"
|
|
445
|
-
)}
|
|
446
|
-
onClick={() => updateData({ provider: provider.id, apiKeyVerified: false })}
|
|
447
|
-
>
|
|
448
|
-
<CardContent className="flex items-center gap-4 p-4">
|
|
449
|
-
<span className="text-3xl">{provider.logo}</span>
|
|
450
|
-
<div className="flex-1">
|
|
451
|
-
<h3 className="font-semibold">{provider.name}</h3>
|
|
452
|
-
<p className="text-sm text-muted-foreground">{provider.description}</p>
|
|
453
|
-
</div>
|
|
454
|
-
{wizardData.provider === provider.id && (
|
|
455
|
-
<CheckCircle2 className="w-5 h-5 text-amber-500" />
|
|
456
|
-
)}
|
|
457
|
-
</CardContent>
|
|
458
|
-
</Card>
|
|
459
|
-
))}
|
|
460
|
-
</div>
|
|
461
|
-
|
|
462
|
-
{wizardData.provider && (
|
|
463
|
-
<Card className="mt-4">
|
|
464
|
-
<CardHeader>
|
|
465
|
-
<CardTitle>Configuración de {PROVIDERS.find(p => p.id === wizardData.provider)?.name}</CardTitle>
|
|
466
|
-
</CardHeader>
|
|
467
|
-
<CardContent className="space-y-4">
|
|
468
|
-
<div className="space-y-2">
|
|
469
|
-
<Label htmlFor="apiKey">API Key</Label>
|
|
470
|
-
<div className="flex gap-2">
|
|
471
|
-
<Input
|
|
472
|
-
id="apiKey"
|
|
473
|
-
type="password"
|
|
474
|
-
value={wizardData.apiKey}
|
|
475
|
-
onChange={(e) => updateData({ apiKey: e.target.value, apiKeyVerified: false })}
|
|
476
|
-
placeholder={wizardData.provider === "ollama" ? "No requerida" : "sk-..."}
|
|
477
|
-
disabled={wizardData.provider === "ollama"}
|
|
478
|
-
/>
|
|
479
|
-
{wizardData.provider !== "ollama" && (
|
|
480
|
-
<Button
|
|
481
|
-
variant="outline"
|
|
482
|
-
onClick={verifyApiKey}
|
|
483
|
-
disabled={!wizardData.apiKey || verificationStatus === "verifying"}
|
|
484
|
-
>
|
|
485
|
-
{verificationStatus === "verifying" ? (
|
|
486
|
-
<Loader2 className="w-4 h-4 animate-spin" />
|
|
487
|
-
) : verificationStatus === "success" ? (
|
|
488
|
-
<CheckCircle2 className="w-4 h-4 text-green-500" />
|
|
489
|
-
) : verificationStatus === "error" ? (
|
|
490
|
-
<XCircle className="w-4 h-4 text-red-500" />
|
|
491
|
-
) : (
|
|
492
|
-
"Verificar"
|
|
493
|
-
)}
|
|
494
|
-
</Button>
|
|
495
|
-
)}
|
|
496
|
-
</div>
|
|
497
|
-
{verificationStatus === "success" && (
|
|
498
|
-
<p className="text-sm text-green-600 flex items-center gap-1">
|
|
499
|
-
<CheckCircle2 className="w-4 h-4" /> API key verificada correctamente
|
|
500
|
-
</p>
|
|
501
|
-
)}
|
|
502
|
-
{verificationStatus === "error" && (
|
|
503
|
-
<p className="text-sm text-red-600 flex items-center gap-1">
|
|
504
|
-
<XCircle className="w-4 h-4" /> API key inválida o error de conexión
|
|
505
|
-
</p>
|
|
506
|
-
)}
|
|
507
|
-
{wizardData.provider !== "ollama" && (
|
|
508
|
-
<p className="text-xs text-muted-foreground">
|
|
509
|
-
¿No tienes tu API key?{" "}
|
|
510
|
-
<a
|
|
511
|
-
href={
|
|
512
|
-
{
|
|
513
|
-
gemini: "https://aistudio.google.com/app/apikey",
|
|
514
|
-
anthropic: "https://console.anthropic.com/keys",
|
|
515
|
-
openai: "https://platform.openai.com/api-keys",
|
|
516
|
-
groq: "https://console.groq.com/keys",
|
|
517
|
-
openrouter: "https://openrouter.ai/keys",
|
|
518
|
-
deepseek: "https://platform.deepseek.com/api_keys",
|
|
519
|
-
mistral: "https://console.mistral.ai/api-keys",
|
|
520
|
-
kimi: "https://platform.moonshot.cn/console/api-keys",
|
|
521
|
-
}[wizardData.provider] || "#"
|
|
522
|
-
}
|
|
523
|
-
target="_blank"
|
|
524
|
-
rel="noopener noreferrer"
|
|
525
|
-
className="text-amber-500 hover:underline"
|
|
526
|
-
>
|
|
527
|
-
Obtener aquí
|
|
528
|
-
</a>
|
|
529
|
-
</p>
|
|
530
|
-
)}
|
|
531
|
-
</div>
|
|
532
|
-
|
|
533
|
-
<div className="space-y-2">
|
|
534
|
-
<Label htmlFor="model">Modelo</Label>
|
|
535
|
-
<Select
|
|
536
|
-
value={wizardData.model}
|
|
537
|
-
onValueChange={(value) => updateData({ model: value })}
|
|
538
|
-
>
|
|
539
|
-
<SelectTrigger>
|
|
540
|
-
<SelectValue placeholder="Selecciona un modelo" />
|
|
541
|
-
</SelectTrigger>
|
|
542
|
-
<SelectContent>
|
|
543
|
-
{wizardData.provider === "gemini" && (
|
|
544
|
-
<>
|
|
545
|
-
<SelectItem value="gemini-2.5-flash">Gemini 2.5 Flash (Recomendado)</SelectItem>
|
|
546
|
-
<SelectItem value="gemini-2.5-pro">Gemini 2.5 Pro</SelectItem>
|
|
547
|
-
<SelectItem value="gemini-3.1-pro-preview">Gemini 3.1 Pro (Preview)</SelectItem>
|
|
548
|
-
</>
|
|
549
|
-
)}
|
|
550
|
-
{wizardData.provider === "anthropic" && (
|
|
551
|
-
<>
|
|
552
|
-
<SelectItem value="claude-sonnet-4-6">Claude Sonnet 4.6 (Recomendado)</SelectItem>
|
|
553
|
-
<SelectItem value="claude-opus-4-6">Claude Opus 4.6</SelectItem>
|
|
554
|
-
<SelectItem value="claude-haiku-4-6">Claude Haiku 4.6</SelectItem>
|
|
555
|
-
</>
|
|
556
|
-
)}
|
|
557
|
-
{wizardData.provider === "openai" && (
|
|
558
|
-
<>
|
|
559
|
-
<SelectItem value="gpt-5.2">GPT-5.2 (Recomendado)</SelectItem>
|
|
560
|
-
<SelectItem value="gpt-5.1">GPT-5.1</SelectItem>
|
|
561
|
-
<SelectItem value="o4-mini">o4-mini</SelectItem>
|
|
562
|
-
</>
|
|
563
|
-
)}
|
|
564
|
-
{wizardData.provider === "groq" && (
|
|
565
|
-
<>
|
|
566
|
-
<SelectItem value="llama-3.3-70b-versatile">Llama 3.3 70B (Recomendado)</SelectItem>
|
|
567
|
-
<SelectItem value="mixtral-8x7b-32768">Mixtral 8x7B</SelectItem>
|
|
568
|
-
</>
|
|
569
|
-
)}
|
|
570
|
-
{wizardData.provider === "ollama" && (
|
|
571
|
-
<>
|
|
572
|
-
<SelectItem value="llama3.3:8b">Llama 3.3 8B (Recomendado)</SelectItem>
|
|
573
|
-
<SelectItem value="qwen2.5:7b">Qwen 2.5 7B</SelectItem>
|
|
574
|
-
<SelectItem value="mistral:7b">Mistral 7B</SelectItem>
|
|
575
|
-
</>
|
|
576
|
-
)}
|
|
577
|
-
{wizardData.provider === "openrouter" && (
|
|
578
|
-
<>
|
|
579
|
-
<SelectItem value="meta-llama/llama-3.3-70b-instruct">Llama 3.3 70B (Gratis)</SelectItem>
|
|
580
|
-
<SelectItem value="google/gemini-2.0-flash-exp:free">Gemini 2.0 Flash (Gratis)</SelectItem>
|
|
581
|
-
<SelectItem value="anthropic/claude-sonnet-4-6">Claude Sonnet 4.6</SelectItem>
|
|
582
|
-
</>
|
|
583
|
-
)}
|
|
584
|
-
{wizardData.provider === "deepseek" && (
|
|
585
|
-
<>
|
|
586
|
-
<SelectItem value="deepseek-chat">DeepSeek Chat (Recomendado)</SelectItem>
|
|
587
|
-
<SelectItem value="deepseek-coder">DeepSeek Coder</SelectItem>
|
|
588
|
-
<SelectItem value="deepseek-reasoner">DeepSeek Reasoner (R1)</SelectItem>
|
|
589
|
-
</>
|
|
590
|
-
)}
|
|
591
|
-
{wizardData.provider === "mistral" && (
|
|
592
|
-
<>
|
|
593
|
-
<SelectItem value="mistral-small-latest">Mistral Small (Recomendado)</SelectItem>
|
|
594
|
-
<SelectItem value="mistral-large-latest">Mistral Large</SelectItem>
|
|
595
|
-
<SelectItem value="codestral-latest">Codestral</SelectItem>
|
|
596
|
-
</>
|
|
597
|
-
)}
|
|
598
|
-
{wizardData.provider === "kimi" && (
|
|
599
|
-
<>
|
|
600
|
-
<SelectItem value="moonshot-v1-8k">Moonshot v1 8K (Recomendado)</SelectItem>
|
|
601
|
-
<SelectItem value="moonshot-v1-32k">Moonshot v1 32K</SelectItem>
|
|
602
|
-
<SelectItem value="moonshot-v1-128k">Moonshot v1 128K</SelectItem>
|
|
603
|
-
</>
|
|
604
|
-
)}
|
|
605
|
-
</SelectContent>
|
|
606
|
-
</Select>
|
|
607
|
-
</div>
|
|
608
|
-
</CardContent>
|
|
609
|
-
</Card>
|
|
610
|
-
)}
|
|
611
|
-
</div>
|
|
612
|
-
);
|
|
613
|
-
|
|
614
|
-
const renderStep4 = () => (
|
|
615
|
-
<div className="space-y-6">
|
|
616
|
-
<div className="text-center space-y-2">
|
|
617
|
-
<h2 className="text-2xl font-bold">Canales</h2>
|
|
618
|
-
<p className="text-muted-foreground">¿Dónde quieres que Bee esté disponible?</p>
|
|
619
|
-
</div>
|
|
620
|
-
|
|
621
|
-
<div className="grid gap-3">
|
|
622
|
-
{CHANNELS.map((channel) => (
|
|
623
|
-
<Card
|
|
624
|
-
key={channel.id}
|
|
625
|
-
className={cn(
|
|
626
|
-
"transition-all",
|
|
627
|
-
wizardData.channels[channel.id]?.enabled && "border-amber-500"
|
|
628
|
-
)}
|
|
629
|
-
>
|
|
630
|
-
<CardContent className="p-4">
|
|
631
|
-
<div className="flex items-center justify-between">
|
|
632
|
-
<div className="flex items-center gap-3">
|
|
633
|
-
<span className="text-2xl">{channel.icon}</span>
|
|
634
|
-
<div>
|
|
635
|
-
<h3 className="font-semibold flex items-center gap-2">
|
|
636
|
-
{channel.name}
|
|
637
|
-
{channel.required && (
|
|
638
|
-
<Badge variant="secondary" className="text-xs">Requerido</Badge>
|
|
639
|
-
)}
|
|
640
|
-
</h3>
|
|
641
|
-
<p className="text-sm text-muted-foreground">{channel.description}</p>
|
|
642
|
-
</div>
|
|
643
|
-
</div>
|
|
644
|
-
<Switch
|
|
645
|
-
checked={wizardData.channels[channel.id]?.enabled}
|
|
646
|
-
onCheckedChange={(checked) => {
|
|
647
|
-
if (channel.required && !checked) return;
|
|
648
|
-
updateData({
|
|
649
|
-
channels: {
|
|
650
|
-
...wizardData.channels,
|
|
651
|
-
[channel.id]: { enabled: checked },
|
|
652
|
-
},
|
|
653
|
-
});
|
|
654
|
-
}}
|
|
655
|
-
disabled={channel.required}
|
|
656
|
-
/>
|
|
657
|
-
</div>
|
|
658
|
-
|
|
659
|
-
{!channel.required && wizardData.channels[channel.id]?.enabled && (
|
|
660
|
-
<Accordion type="single" collapsible className="mt-4">
|
|
661
|
-
<AccordionItem value="config">
|
|
662
|
-
<AccordionTrigger>Configuración</AccordionTrigger>
|
|
663
|
-
<AccordionContent>
|
|
664
|
-
<div className="space-y-3 pt-2">
|
|
665
|
-
{channel.id === "telegram" && (
|
|
666
|
-
<>
|
|
667
|
-
<div className="space-y-2">
|
|
668
|
-
<Label htmlFor="telegramToken">Token del Bot</Label>
|
|
669
|
-
<Input
|
|
670
|
-
id="telegramToken"
|
|
671
|
-
placeholder="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
|
|
672
|
-
value={wizardData.channels.telegram.config?.botToken || ""}
|
|
673
|
-
onChange={(e) => updateData({
|
|
674
|
-
channels: {
|
|
675
|
-
...wizardData.channels,
|
|
676
|
-
telegram: { enabled: true, config: { botToken: e.target.value } },
|
|
677
|
-
},
|
|
678
|
-
})}
|
|
679
|
-
/>
|
|
680
|
-
<p className="text-xs text-muted-foreground">
|
|
681
|
-
<a
|
|
682
|
-
href="https://t.me/BotFather"
|
|
683
|
-
target="_blank"
|
|
684
|
-
rel="noopener noreferrer"
|
|
685
|
-
className="text-amber-500 hover:underline"
|
|
686
|
-
>
|
|
687
|
-
Obtén tu token en BotFather
|
|
688
|
-
</a>
|
|
689
|
-
</p>
|
|
690
|
-
</div>
|
|
691
|
-
</>
|
|
692
|
-
)}
|
|
693
|
-
{channel.id === "discord" && (
|
|
694
|
-
<>
|
|
695
|
-
<div className="space-y-2">
|
|
696
|
-
<Label htmlFor="discordToken">Token del Bot</Label>
|
|
697
|
-
<Input
|
|
698
|
-
id="discordToken"
|
|
699
|
-
placeholder="MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.GJKlMn.OpQrStUvWxYz"
|
|
700
|
-
value={wizardData.channels.discord.config?.botToken || ""}
|
|
701
|
-
onChange={(e) => updateData({
|
|
702
|
-
channels: {
|
|
703
|
-
...wizardData.channels,
|
|
704
|
-
discord: { enabled: true, config: { botToken: e.target.value } },
|
|
705
|
-
},
|
|
706
|
-
})}
|
|
707
|
-
/>
|
|
708
|
-
</div>
|
|
709
|
-
<div className="space-y-2">
|
|
710
|
-
<Label htmlFor="discordClientId">Client ID</Label>
|
|
711
|
-
<Input
|
|
712
|
-
id="discordClientId"
|
|
713
|
-
placeholder="1234567890123456789"
|
|
714
|
-
value={wizardData.channels.discord.config?.clientId || ""}
|
|
715
|
-
onChange={(e) => updateData({
|
|
716
|
-
channels: {
|
|
717
|
-
...wizardData.channels,
|
|
718
|
-
discord: { enabled: true, config: { clientId: e.target.value } },
|
|
719
|
-
},
|
|
720
|
-
})}
|
|
721
|
-
/>
|
|
722
|
-
</div>
|
|
723
|
-
</>
|
|
724
|
-
)}
|
|
725
|
-
{channel.id === "whatsapp" && (
|
|
726
|
-
<>
|
|
727
|
-
<div className="space-y-2">
|
|
728
|
-
<Label htmlFor="whatsappToken">Token de la API</Label>
|
|
729
|
-
<Input
|
|
730
|
-
id="whatsappToken"
|
|
731
|
-
placeholder="..."
|
|
732
|
-
value={wizardData.channels.whatsapp.config?.apiToken || ""}
|
|
733
|
-
onChange={(e) => updateData({
|
|
734
|
-
channels: {
|
|
735
|
-
...wizardData.channels,
|
|
736
|
-
whatsapp: { enabled: true, config: { apiToken: e.target.value } },
|
|
737
|
-
},
|
|
738
|
-
})}
|
|
739
|
-
/>
|
|
740
|
-
</div>
|
|
741
|
-
</>
|
|
742
|
-
)}
|
|
743
|
-
{channel.id === "slack" && (
|
|
744
|
-
<>
|
|
745
|
-
<div className="space-y-2">
|
|
746
|
-
<Label htmlFor="slackToken">Bot Token</Label>
|
|
747
|
-
<Input
|
|
748
|
-
id="slackToken"
|
|
749
|
-
placeholder="xoxb-..."
|
|
750
|
-
value={wizardData.channels.slack.config?.botToken || ""}
|
|
751
|
-
onChange={(e) => updateData({
|
|
752
|
-
channels: {
|
|
753
|
-
...wizardData.channels,
|
|
754
|
-
slack: { enabled: true, config: { botToken: e.target.value } },
|
|
755
|
-
},
|
|
756
|
-
})}
|
|
757
|
-
/>
|
|
758
|
-
</div>
|
|
759
|
-
<div className="space-y-2">
|
|
760
|
-
<Label htmlFor="slackSigningSecret">Signing Secret</Label>
|
|
761
|
-
<Input
|
|
762
|
-
id="slackSigningSecret"
|
|
763
|
-
placeholder="..."
|
|
764
|
-
value={wizardData.channels.slack.config?.signingSecret || ""}
|
|
765
|
-
onChange={(e) => updateData({
|
|
766
|
-
channels: {
|
|
767
|
-
...wizardData.channels,
|
|
768
|
-
slack: { enabled: true, config: { signingSecret: e.target.value } },
|
|
769
|
-
},
|
|
770
|
-
})}
|
|
771
|
-
/>
|
|
772
|
-
</div>
|
|
773
|
-
</>
|
|
774
|
-
)}
|
|
775
|
-
</div>
|
|
776
|
-
</AccordionContent>
|
|
777
|
-
</AccordionItem>
|
|
778
|
-
</Accordion>
|
|
779
|
-
)}
|
|
780
|
-
</CardContent>
|
|
781
|
-
</Card>
|
|
782
|
-
))}
|
|
783
|
-
</div>
|
|
784
|
-
</div>
|
|
785
|
-
);
|
|
786
|
-
|
|
787
|
-
const renderStep5 = () => (
|
|
788
|
-
<div className="space-y-6">
|
|
789
|
-
<div className="text-center space-y-2">
|
|
790
|
-
<h2 className="text-2xl font-bold">Voz (opcional)</h2>
|
|
791
|
-
<p className="text-muted-foreground">Permite que Bee hable y escuche</p>
|
|
792
|
-
</div>
|
|
793
|
-
|
|
794
|
-
<Card>
|
|
795
|
-
<CardHeader>
|
|
796
|
-
<div className="flex items-center justify-between">
|
|
797
|
-
<CardTitle>Activar voz</CardTitle>
|
|
798
|
-
<Switch
|
|
799
|
-
checked={wizardData.voiceEnabled}
|
|
800
|
-
onCheckedChange={(checked) => updateData({ voiceEnabled: checked })}
|
|
801
|
-
/>
|
|
802
|
-
</div>
|
|
803
|
-
</CardHeader>
|
|
804
|
-
<CardContent>
|
|
805
|
-
{wizardData.voiceEnabled ? (
|
|
806
|
-
<div className="space-y-4">
|
|
807
|
-
<div className="space-y-2">
|
|
808
|
-
<Label htmlFor="sttProvider">Reconocimiento de voz (STT)</Label>
|
|
809
|
-
<Select
|
|
810
|
-
value={wizardData.sttProvider}
|
|
811
|
-
onValueChange={(value) => updateData({ sttProvider: value })}
|
|
812
|
-
>
|
|
813
|
-
<SelectTrigger>
|
|
814
|
-
<SelectValue />
|
|
815
|
-
</SelectTrigger>
|
|
816
|
-
<SelectContent>
|
|
817
|
-
<SelectItem value="groq-whisper">
|
|
818
|
-
Groq Whisper (Recomendado)
|
|
819
|
-
</SelectItem>
|
|
820
|
-
<SelectItem value="openai-whisper">
|
|
821
|
-
OpenAI Whisper
|
|
822
|
-
</SelectItem>
|
|
823
|
-
</SelectContent>
|
|
824
|
-
</Select>
|
|
825
|
-
</div>
|
|
826
|
-
|
|
827
|
-
<div className="space-y-2">
|
|
828
|
-
<Label htmlFor="ttsProvider">Síntesis de voz (TTS)</Label>
|
|
829
|
-
<Select
|
|
830
|
-
value={wizardData.ttsProvider}
|
|
831
|
-
onValueChange={(value) => updateData({ ttsProvider: value })}
|
|
832
|
-
>
|
|
833
|
-
<SelectTrigger>
|
|
834
|
-
<SelectValue />
|
|
835
|
-
</SelectTrigger>
|
|
836
|
-
<SelectContent>
|
|
837
|
-
<SelectItem value="elevenlabs">
|
|
838
|
-
ElevenLabs (Recomendado)
|
|
839
|
-
</SelectItem>
|
|
840
|
-
<SelectItem value="openai">
|
|
841
|
-
OpenAI TTS
|
|
842
|
-
</SelectItem>
|
|
843
|
-
<SelectItem value="gemini">
|
|
844
|
-
Google Gemini
|
|
845
|
-
</SelectItem>
|
|
846
|
-
</SelectContent>
|
|
847
|
-
</Select>
|
|
848
|
-
</div>
|
|
849
|
-
|
|
850
|
-
<div className="space-y-2">
|
|
851
|
-
<Label htmlFor="ttsVoice">Voz</Label>
|
|
852
|
-
<div className="flex gap-2">
|
|
853
|
-
<Select
|
|
854
|
-
value={wizardData.ttsVoice}
|
|
855
|
-
onValueChange={(value) => updateData({ ttsVoice: value })}
|
|
856
|
-
>
|
|
857
|
-
<SelectTrigger>
|
|
858
|
-
<SelectValue placeholder="Selecciona una voz" />
|
|
859
|
-
</SelectTrigger>
|
|
860
|
-
<SelectContent>
|
|
861
|
-
<SelectItem value="Rachel">Rachel (ElevenLabs)</SelectItem>
|
|
862
|
-
<SelectItem value="Adam">Adam (ElevenLabs)</SelectItem>
|
|
863
|
-
<SelectItem value="Antoni">Antoni (ElevenLabs)</SelectItem>
|
|
864
|
-
<SelectItem value="Elli">Elli (ElevenLabs)</SelectItem>
|
|
865
|
-
<SelectItem value="Josh">Josh (ElevenLabs)</SelectItem>
|
|
866
|
-
<SelectItem value="alloy">Alloy (OpenAI)</SelectItem>
|
|
867
|
-
<SelectItem value="echo">Echo (OpenAI)</SelectItem>
|
|
868
|
-
<SelectItem value="fable">Fable (OpenAI)</SelectItem>
|
|
869
|
-
<SelectItem value="onyx">Onyx (OpenAI)</SelectItem>
|
|
870
|
-
<SelectItem value="nova">Nova (OpenAI)</SelectItem>
|
|
871
|
-
<SelectItem value="shimmer">Shimmer (OpenAI)</SelectItem>
|
|
872
|
-
</SelectContent>
|
|
873
|
-
</Select>
|
|
874
|
-
<Button variant="outline" size="icon">
|
|
875
|
-
<Volume2 className="w-4 h-4" />
|
|
876
|
-
</Button>
|
|
877
|
-
</div>
|
|
878
|
-
</div>
|
|
879
|
-
|
|
880
|
-
<Alert>
|
|
881
|
-
<AlertDescription className="text-sm">
|
|
882
|
-
{wizardData.provider === wizardData.ttsProvider && (
|
|
883
|
-
<span className="text-green-600 flex items-center gap-1">
|
|
884
|
-
<CheckCircle2 className="w-4 h-4" /> Ya tienes la API key configurada
|
|
885
|
-
</span>
|
|
886
|
-
)}
|
|
887
|
-
</AlertDescription>
|
|
888
|
-
</Alert>
|
|
889
|
-
</div>
|
|
890
|
-
) : (
|
|
891
|
-
<p className="text-muted-foreground text-center py-4">
|
|
892
|
-
Puedes activar la voz más tarde en la configuración
|
|
893
|
-
</p>
|
|
894
|
-
)}
|
|
895
|
-
</CardContent>
|
|
896
|
-
</Card>
|
|
897
|
-
</div>
|
|
898
|
-
);
|
|
899
|
-
|
|
900
|
-
const renderStep6 = () => (
|
|
901
|
-
<div className="space-y-6">
|
|
902
|
-
<div className="text-center space-y-2">
|
|
903
|
-
<h2 className="text-2xl font-bold">Reglas éticas</h2>
|
|
904
|
-
<p className="text-muted-foreground">Define los límites de tu agente</p>
|
|
905
|
-
</div>
|
|
906
|
-
|
|
907
|
-
<Alert>
|
|
908
|
-
<AlertDescription className="text-sm">
|
|
909
|
-
Las reglas de categoría <strong className="text-red-500">NUNCA</strong> son las protecciones más importantes.
|
|
910
|
-
Desactivarlas puede comprometer la seguridad.
|
|
911
|
-
</AlertDescription>
|
|
912
|
-
</Alert>
|
|
913
|
-
|
|
914
|
-
<div className="space-y-3">
|
|
915
|
-
{ETHICS_RULES.map((rule) => {
|
|
916
|
-
const ruleState = wizardData.ethicsRules[rule.id];
|
|
917
|
-
const categoryColor = {
|
|
918
|
-
NUNCA: "text-red-500 bg-red-500/10",
|
|
919
|
-
SIEMPRE: "text-green-500 bg-green-500/10",
|
|
920
|
-
CONFIRMAR: "text-amber-500 bg-amber-500/10",
|
|
921
|
-
}[rule.category];
|
|
922
|
-
|
|
923
|
-
return (
|
|
924
|
-
<Card key={rule.id}>
|
|
925
|
-
<CardContent className="p-4">
|
|
926
|
-
<div className="flex items-start justify-between gap-4">
|
|
927
|
-
<div className="flex items-start gap-3">
|
|
928
|
-
<Checkbox
|
|
929
|
-
checked={ruleState?.enabled}
|
|
930
|
-
onCheckedChange={(checked) => {
|
|
931
|
-
if (rule.category === "NUNCA" && !checked) {
|
|
932
|
-
if (!confirm("¿Estás seguro de desactivar esta regla de protección?")) {
|
|
933
|
-
return;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
updateData({
|
|
937
|
-
ethicsRules: {
|
|
938
|
-
...wizardData.ethicsRules,
|
|
939
|
-
[rule.id]: { ...ruleState, enabled: checked as boolean },
|
|
940
|
-
},
|
|
941
|
-
});
|
|
942
|
-
}}
|
|
943
|
-
/>
|
|
944
|
-
<div>
|
|
945
|
-
<div className="flex items-center gap-2">
|
|
946
|
-
<h3 className="font-medium">{rule.description}</h3>
|
|
947
|
-
<Badge className={cn("text-xs", categoryColor)}>
|
|
948
|
-
{rule.category}
|
|
949
|
-
</Badge>
|
|
950
|
-
</div>
|
|
951
|
-
<p className="text-sm text-muted-foreground mt-1">
|
|
952
|
-
ID: {rule.id}
|
|
953
|
-
</p>
|
|
954
|
-
</div>
|
|
955
|
-
</div>
|
|
956
|
-
</div>
|
|
957
|
-
</CardContent>
|
|
958
|
-
</Card>
|
|
959
|
-
);
|
|
960
|
-
})}
|
|
961
|
-
</div>
|
|
962
|
-
|
|
963
|
-
<Button
|
|
964
|
-
variant="outline"
|
|
965
|
-
className="w-full"
|
|
966
|
-
onClick={() => {
|
|
967
|
-
const text = prompt("Ingresa tu regla personalizada:");
|
|
968
|
-
if (text) {
|
|
969
|
-
const category = prompt("Categoría (SIEMPRE/NUNCA/CONFIRMAR):", "CONFIRMAR");
|
|
970
|
-
if (category && ["SIEMPRE", "NUNCA", "CONFIRMAR"].includes(category.toUpperCase())) {
|
|
971
|
-
updateData({
|
|
972
|
-
customRules: [
|
|
973
|
-
...wizardData.customRules,
|
|
974
|
-
{ text, category: category.toUpperCase() },
|
|
975
|
-
],
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}}
|
|
980
|
-
>
|
|
981
|
-
+ Añadir regla personalizada
|
|
982
|
-
</Button>
|
|
983
|
-
|
|
984
|
-
{wizardData.customRules.length > 0 && (
|
|
985
|
-
<div className="space-y-2">
|
|
986
|
-
<Label>Reglas personalizadas</Label>
|
|
987
|
-
{wizardData.customRules.map((rule, index) => (
|
|
988
|
-
<Card key={index}>
|
|
989
|
-
<CardContent className="p-4 flex items-center justify-between">
|
|
990
|
-
<div>
|
|
991
|
-
<p className="font-medium">{rule.text}</p>
|
|
992
|
-
<Badge className={cn(
|
|
993
|
-
"text-xs mt-1",
|
|
994
|
-
rule.category === "NUNCA" && "text-red-500 bg-red-500/10",
|
|
995
|
-
rule.category === "SIEMPRE" && "text-green-500 bg-green-500/10",
|
|
996
|
-
rule.category === "CONFIRMAR" && "text-amber-500 bg-amber-500/10"
|
|
997
|
-
)}>
|
|
998
|
-
{rule.category}
|
|
999
|
-
</Badge>
|
|
1000
|
-
</div>
|
|
1001
|
-
<Button
|
|
1002
|
-
variant="ghost"
|
|
1003
|
-
size="sm"
|
|
1004
|
-
onClick={() => {
|
|
1005
|
-
updateData({
|
|
1006
|
-
customRules: wizardData.customRules.filter((_, i) => i !== index),
|
|
1007
|
-
});
|
|
1008
|
-
}}
|
|
1009
|
-
>
|
|
1010
|
-
Eliminar
|
|
1011
|
-
</Button>
|
|
1012
|
-
</CardContent>
|
|
1013
|
-
</Card>
|
|
1014
|
-
))}
|
|
1015
|
-
</div>
|
|
1016
|
-
)}
|
|
1017
|
-
</div>
|
|
1018
|
-
);
|
|
1019
|
-
|
|
1020
|
-
const renderStep7 = () => (
|
|
1021
|
-
<div className="space-y-6">
|
|
1022
|
-
<div className="text-center space-y-2">
|
|
1023
|
-
<h2 className="text-2xl font-bold">¡Todo listo!</h2>
|
|
1024
|
-
<p className="text-muted-foreground">Revisa tu configuración antes de continuar</p>
|
|
1025
|
-
</div>
|
|
1026
|
-
|
|
1027
|
-
{submitSuccess ? (
|
|
1028
|
-
<Card className="border-green-500 bg-green-500/10">
|
|
1029
|
-
<CardContent className="p-8 text-center space-y-4">
|
|
1030
|
-
<div className="flex justify-center">
|
|
1031
|
-
<div className="relative">
|
|
1032
|
-
<Hexagon className="w-24 h-24 text-amber-500 animate-pulse" fill="currentColor" />
|
|
1033
|
-
<Sparkles className="w-8 h-8 text-amber-300 absolute -top-2 -right-2 animate-bounce" />
|
|
1034
|
-
</div>
|
|
1035
|
-
</div>
|
|
1036
|
-
<h3 className="text-xl font-bold">¡Bienvenido a Hive!</h3>
|
|
1037
|
-
<p className="text-muted-foreground">
|
|
1038
|
-
{wizardData.agentName} está listo para ayudarte. Redirigiendo...
|
|
1039
|
-
</p>
|
|
1040
|
-
</CardContent>
|
|
1041
|
-
</Card>
|
|
1042
|
-
) : (
|
|
1043
|
-
<>
|
|
1044
|
-
<Card>
|
|
1045
|
-
<CardHeader>
|
|
1046
|
-
<CardTitle className="flex items-center gap-3">
|
|
1047
|
-
<div className={cn(
|
|
1048
|
-
"w-10 h-10 rounded-lg flex items-center justify-center",
|
|
1049
|
-
AVATARS.find(a => a.id === wizardData.agentAvatar)?.color
|
|
1050
|
-
)}>
|
|
1051
|
-
<Hexagon className="w-6 h-6 text-white" fill="currentColor" />
|
|
1052
|
-
</div>
|
|
1053
|
-
{wizardData.agentName}
|
|
1054
|
-
</CardTitle>
|
|
1055
|
-
<CardDescription>{wizardData.agentDescription || "Sin descripción"}</CardDescription>
|
|
1056
|
-
</CardHeader>
|
|
1057
|
-
<CardContent className="space-y-4">
|
|
1058
|
-
<div>
|
|
1059
|
-
<Label className="text-sm text-muted-foreground">Proveedor</Label>
|
|
1060
|
-
<p className="font-medium">
|
|
1061
|
-
{PROVIDERS.find(p => p.id === wizardData.provider)?.name || wizardData.provider} — {wizardData.model}
|
|
1062
|
-
</p>
|
|
1063
|
-
</div>
|
|
1064
|
-
|
|
1065
|
-
<div>
|
|
1066
|
-
<Label className="text-sm text-muted-foreground">Canales activos</Label>
|
|
1067
|
-
<div className="flex gap-2 flex-wrap mt-1">
|
|
1068
|
-
{Object.entries(wizardData.channels)
|
|
1069
|
-
.filter(([_, data]) => data.enabled)
|
|
1070
|
-
.map(([id]) => {
|
|
1071
|
-
const channel = CHANNELS.find(c => c.id === id);
|
|
1072
|
-
return (
|
|
1073
|
-
<Badge key={id} variant="secondary">
|
|
1074
|
-
{channel?.icon} {channel?.name}
|
|
1075
|
-
</Badge>
|
|
1076
|
-
);
|
|
1077
|
-
})}
|
|
1078
|
-
</div>
|
|
1079
|
-
</div>
|
|
1080
|
-
|
|
1081
|
-
{wizardData.voiceEnabled && (
|
|
1082
|
-
<div>
|
|
1083
|
-
<Label className="text-sm text-muted-foreground">Voz</Label>
|
|
1084
|
-
<p className="font-medium">
|
|
1085
|
-
STT: {wizardData.sttProvider} | TTS: {wizardData.ttsProvider}
|
|
1086
|
-
{wizardData.ttsVoice && ` (${wizardData.ttsVoice})`}
|
|
1087
|
-
</p>
|
|
1088
|
-
</div>
|
|
1089
|
-
)}
|
|
1090
|
-
|
|
1091
|
-
<div>
|
|
1092
|
-
<Label className="text-sm text-muted-foreground">Reglas éticas activas</Label>
|
|
1093
|
-
<div className="flex gap-2 flex-wrap mt-1">
|
|
1094
|
-
{Object.entries(wizardData.ethicsRules)
|
|
1095
|
-
.filter(([_, data]) => data.enabled)
|
|
1096
|
-
.map(([id]) => {
|
|
1097
|
-
const rule = ETHICS_RULES.find(r => r.id === id);
|
|
1098
|
-
return (
|
|
1099
|
-
<Badge key={id} variant="outline">
|
|
1100
|
-
{rule?.description.substring(0, 30)}...
|
|
1101
|
-
</Badge>
|
|
1102
|
-
);
|
|
1103
|
-
})}
|
|
1104
|
-
</div>
|
|
1105
|
-
</div>
|
|
1106
|
-
</CardContent>
|
|
1107
|
-
</Card>
|
|
1108
|
-
|
|
1109
|
-
<Button
|
|
1110
|
-
className="w-full h-14 text-lg bg-amber-500 hover:bg-amber-600"
|
|
1111
|
-
onClick={handleSubmit}
|
|
1112
|
-
disabled={isSubmitting}
|
|
1113
|
-
>
|
|
1114
|
-
{isSubmitting ? (
|
|
1115
|
-
<>
|
|
1116
|
-
<Loader2 className="w-5 h-5 mr-2 animate-spin" />
|
|
1117
|
-
Configurando...
|
|
1118
|
-
</>
|
|
1119
|
-
) : (
|
|
1120
|
-
<>
|
|
1121
|
-
<Sparkles className="w-5 h-5 mr-2" />
|
|
1122
|
-
Iniciar a {wizardData.agentName}
|
|
1123
|
-
</>
|
|
1124
|
-
)}
|
|
1125
|
-
</Button>
|
|
1126
|
-
</>
|
|
1127
|
-
)}
|
|
1128
|
-
</div>
|
|
1129
|
-
);
|
|
1130
|
-
|
|
1131
|
-
return (
|
|
1132
|
-
<div className="min-h-screen bg-gradient-to-b from-background to-muted/20">
|
|
1133
|
-
<div className="container max-w-2xl mx-auto py-8 px-4">
|
|
1134
|
-
{/* Progress */}
|
|
1135
|
-
<div className="mb-8 space-y-2">
|
|
1136
|
-
<div className="flex justify-between text-sm text-muted-foreground">
|
|
1137
|
-
<span>Paso {currentStep} de 7</span>
|
|
1138
|
-
<button
|
|
1139
|
-
onClick={handleReset}
|
|
1140
|
-
className="text-xs text-muted-foreground hover:text-foreground"
|
|
1141
|
-
>
|
|
1142
|
-
Reiniciar configuración
|
|
1143
|
-
</button>
|
|
1144
|
-
</div>
|
|
1145
|
-
<Progress value={(currentStep / 7) * 100} className="h-2" />
|
|
1146
|
-
</div>
|
|
1147
|
-
|
|
1148
|
-
{/* Step content */}
|
|
1149
|
-
{renderStep()}
|
|
1150
|
-
|
|
1151
|
-
{/* Navigation */}
|
|
1152
|
-
{!submitSuccess && (
|
|
1153
|
-
<div className="flex justify-between mt-8 pt-8 border-t">
|
|
1154
|
-
<Button
|
|
1155
|
-
variant="outline"
|
|
1156
|
-
onClick={handleBack}
|
|
1157
|
-
disabled={currentStep === 1}
|
|
1158
|
-
>
|
|
1159
|
-
← Anterior
|
|
1160
|
-
</Button>
|
|
1161
|
-
{currentStep < 7 ? (
|
|
1162
|
-
<Button
|
|
1163
|
-
onClick={handleNext}
|
|
1164
|
-
disabled={!canProceed()}
|
|
1165
|
-
className="bg-amber-500 hover:bg-amber-600"
|
|
1166
|
-
>
|
|
1167
|
-
Siguiente →
|
|
1168
|
-
</Button>
|
|
1169
|
-
) : (
|
|
1170
|
-
<div /> /* Spacer */
|
|
1171
|
-
)}
|
|
1172
|
-
</div>
|
|
1173
|
-
)}
|
|
1174
|
-
</div>
|
|
1175
|
-
</div>
|
|
1176
|
-
);
|
|
1177
|
-
}
|