@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,446 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { swal } from "@/lib/swal";
|
|
3
|
-
import { apiClient } from "@/lib/api";
|
|
4
|
-
|
|
5
|
-
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
|
|
6
|
-
import { Label } from "@/components/ui/label";
|
|
7
|
-
import { Input } from "@/components/ui/input";
|
|
8
|
-
import { Button } from "@/components/ui/button";
|
|
9
|
-
import { Textarea } from "@/components/ui/textarea";
|
|
10
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
|
11
|
-
import { Switch } from "@/components/ui/switch";
|
|
12
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, DialogFooter, DialogClose } from "@/components/ui/dialog";
|
|
13
|
-
import { ModelSelector } from "./ModelSelector";
|
|
14
|
-
import { useAgents, useProviders } from "@/stores/useGlobalConfigStore";
|
|
15
|
-
import { Loader2, Sparkles, Shield, Cpu, Save, X, FolderOpen, Check, AlertCircle, ExternalLink } from "lucide-react";
|
|
16
|
-
import type { Agent } from "@/types";
|
|
17
|
-
import { cn } from "@/lib/utils";
|
|
18
|
-
|
|
19
|
-
interface AgentCreateFormProps {
|
|
20
|
-
initialData?: Agent;
|
|
21
|
-
onSuccess?: () => void;
|
|
22
|
-
onCancel?: () => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const TONE_OPTIONS = [
|
|
26
|
-
{ value: "friendly", label: "Amigable" },
|
|
27
|
-
{ value: "professional", label: "Profesional" },
|
|
28
|
-
{ value: "casual", label: "Casual" },
|
|
29
|
-
{ value: "formal", label: "Formal" },
|
|
30
|
-
{ value: "creative", label: "Creativo" },
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
export function AgentCreateForm({ initialData, onSuccess, onCancel }: AgentCreateFormProps) {
|
|
34
|
-
const { createAgent, updateAgent, isLoading, error } = useAgents();
|
|
35
|
-
const { activeProviders } = useProviders();
|
|
36
|
-
|
|
37
|
-
const [workspaceValidation, setWorkspaceValidation] = useState<{
|
|
38
|
-
isValidating: boolean;
|
|
39
|
-
exists: boolean;
|
|
40
|
-
accessible: boolean;
|
|
41
|
-
error?: string;
|
|
42
|
-
message?: string;
|
|
43
|
-
}>({ isValidating: false, exists: false, accessible: false });
|
|
44
|
-
|
|
45
|
-
const [formData, setFormData] = useState<Partial<Agent>>({
|
|
46
|
-
name: "",
|
|
47
|
-
description: "",
|
|
48
|
-
tone: "professional",
|
|
49
|
-
provider_id: "",
|
|
50
|
-
model_id: "",
|
|
51
|
-
role: "coordinator" as "coordinator" | "worker",
|
|
52
|
-
enabled: true,
|
|
53
|
-
systemPrompt: "",
|
|
54
|
-
workspace: initialData?.workspace || "",
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (initialData) setFormData({ ...initialData });
|
|
59
|
-
}, [initialData]);
|
|
60
|
-
|
|
61
|
-
const validateWorkspace = async (path: string) => {
|
|
62
|
-
if (!path || path.trim() === "") {
|
|
63
|
-
setWorkspaceValidation({ isValidating: false, exists: false, accessible: false });
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
setWorkspaceValidation({ isValidating: true, exists: false, accessible: false });
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
const response = await apiClient<{
|
|
71
|
-
exists: boolean;
|
|
72
|
-
accessible: boolean;
|
|
73
|
-
error?: string;
|
|
74
|
-
message?: string;
|
|
75
|
-
}>("/api/workspace/validate", {
|
|
76
|
-
method: "POST",
|
|
77
|
-
body: { path },
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
setWorkspaceValidation({
|
|
81
|
-
isValidating: false,
|
|
82
|
-
exists: response.exists,
|
|
83
|
-
accessible: response.accessible,
|
|
84
|
-
error: response.error,
|
|
85
|
-
message: response.message,
|
|
86
|
-
});
|
|
87
|
-
} catch (err) {
|
|
88
|
-
setWorkspaceValidation({
|
|
89
|
-
isValidating: false,
|
|
90
|
-
exists: false,
|
|
91
|
-
accessible: false,
|
|
92
|
-
error: (err as Error).message,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const handleCreateWorkspace = async () => {
|
|
98
|
-
if (!formData.workspace) return;
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
await apiClient("/api/workspace/create", {
|
|
102
|
-
method: "POST",
|
|
103
|
-
body: { path: formData.workspace },
|
|
104
|
-
showLoader: "Creando directorio...",
|
|
105
|
-
showSuccess: "Directorio creado exitosamente",
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// Re-validar después de crear
|
|
109
|
-
await validateWorkspace(formData.workspace);
|
|
110
|
-
} catch (err) {
|
|
111
|
-
swal.fire("Error", (err as Error).message, "error");
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const handleOpenWorkspace = async () => {
|
|
116
|
-
if (!formData.workspace) return;
|
|
117
|
-
|
|
118
|
-
try {
|
|
119
|
-
await apiClient(`/api/workspace/open?path=${encodeURIComponent(formData.workspace)}`, {
|
|
120
|
-
method: "GET",
|
|
121
|
-
});
|
|
122
|
-
} catch (err) {
|
|
123
|
-
swal.fire("Error", (err as Error).message, "error");
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const handleSubmit = async (e: React.FormEvent) => {
|
|
128
|
-
e.preventDefault();
|
|
129
|
-
if (!formData.provider_id || !formData.model_id) {
|
|
130
|
-
swal.fire("Incompleto", "Por favor selecciona un proveedor y modelo", "warning");
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
try {
|
|
134
|
-
if (initialData?.id) {
|
|
135
|
-
await updateAgent(initialData.id, formData);
|
|
136
|
-
} else {
|
|
137
|
-
await createAgent(formData);
|
|
138
|
-
}
|
|
139
|
-
if (onSuccess) onSuccess();
|
|
140
|
-
} catch (err) {
|
|
141
|
-
console.error(err);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const isEdit = !!initialData?.id;
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<Card className="hive-card--form group">
|
|
149
|
-
{/* Decorative Glow */}
|
|
150
|
-
<div className="hive-glow-blob--card absolute -top-24 -right-24 h-48 w-48 bg-blue-600/10 group-hover:bg-blue-600/20" style={{ borderRadius: "50%", filter: "blur(80px)" }} />
|
|
151
|
-
|
|
152
|
-
<CardHeader className="relative">
|
|
153
|
-
<div className="flex items-center justify-between">
|
|
154
|
-
<div className="flex items-center gap-3">
|
|
155
|
-
<div className="hive-icon-wrap hive-icon-wrap--primary">
|
|
156
|
-
{isEdit ? <Save className="h-5 w-5" /> : <Sparkles className="h-5 w-5" />}
|
|
157
|
-
</div>
|
|
158
|
-
<div>
|
|
159
|
-
<CardTitle className="text-xl font-bold text-white/90">
|
|
160
|
-
{isEdit ? "Configurar Nodo" : "Desplegar Nuevo Nodo"}
|
|
161
|
-
</CardTitle>
|
|
162
|
-
<CardDescription className="text-white/40">
|
|
163
|
-
{isEdit
|
|
164
|
-
? "Ajusta los parámetros de tu agente inteligente."
|
|
165
|
-
: "Crea una nueva entidad inteligente para tu colmena."}
|
|
166
|
-
</CardDescription>
|
|
167
|
-
</div>
|
|
168
|
-
</div>
|
|
169
|
-
{onCancel && (
|
|
170
|
-
<Button variant="ghost" size="icon" onClick={onCancel} className="text-white/40 hover:text-white hover:bg-white/5">
|
|
171
|
-
<X className="h-5 w-5" />
|
|
172
|
-
</Button>
|
|
173
|
-
)}
|
|
174
|
-
</div>
|
|
175
|
-
</CardHeader>
|
|
176
|
-
|
|
177
|
-
<CardContent className="relative space-y-6 pt-2">
|
|
178
|
-
<form onSubmit={handleSubmit} className="space-y-8">
|
|
179
|
-
{/* Main Info */}
|
|
180
|
-
<div className="grid gap-6">
|
|
181
|
-
<div className="space-y-2">
|
|
182
|
-
<Label htmlFor="name" className="hive-label--field">Nombre del Agente</Label>
|
|
183
|
-
<Input
|
|
184
|
-
id="name"
|
|
185
|
-
placeholder="Ej: Analista de Mercado"
|
|
186
|
-
className="hive-input"
|
|
187
|
-
value={formData.name}
|
|
188
|
-
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
|
|
189
|
-
disabled={isLoading}
|
|
190
|
-
required
|
|
191
|
-
/>
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
<div className="space-y-2">
|
|
195
|
-
<Label htmlFor="description" className="hive-label--field">Descripción / Rol</Label>
|
|
196
|
-
<Textarea
|
|
197
|
-
id="description"
|
|
198
|
-
placeholder="Describe qué hace este agente y cuáles son sus objetivos..."
|
|
199
|
-
className="hive-textarea"
|
|
200
|
-
value={formData.description}
|
|
201
|
-
onChange={(e) => setFormData({ ...formData, description: e.target.value })}
|
|
202
|
-
disabled={isLoading}
|
|
203
|
-
/>
|
|
204
|
-
</div>
|
|
205
|
-
</div>
|
|
206
|
-
|
|
207
|
-
<div className="space-y-2">
|
|
208
|
-
<div className="flex items-center justify-between">
|
|
209
|
-
<Label htmlFor="systemPrompt" className="hive-label--field">System Prompt</Label>
|
|
210
|
-
<Dialog>
|
|
211
|
-
<DialogTrigger asChild>
|
|
212
|
-
<Button type="button" variant="outline" size="sm" className="h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors">
|
|
213
|
-
Modifica acá el System Prompt
|
|
214
|
-
</Button>
|
|
215
|
-
</DialogTrigger>
|
|
216
|
-
<DialogContent className="sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white">
|
|
217
|
-
<DialogHeader>
|
|
218
|
-
<DialogTitle className="text-xl">Editar System Prompt</DialogTitle>
|
|
219
|
-
<p className="text-sm text-white/50">El prompt base de comportamiento del agente. Se recomienda formato Markdown.</p>
|
|
220
|
-
</DialogHeader>
|
|
221
|
-
<div className="py-2">
|
|
222
|
-
<Textarea
|
|
223
|
-
value={formData.systemPrompt || ""}
|
|
224
|
-
onChange={(e) => setFormData({ ...formData, systemPrompt: e.target.value })}
|
|
225
|
-
className="min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y"
|
|
226
|
-
placeholder="Escribe el system prompt detallado aquí..."
|
|
227
|
-
disabled={isLoading}
|
|
228
|
-
/>
|
|
229
|
-
</div>
|
|
230
|
-
<DialogFooter>
|
|
231
|
-
<DialogClose asChild>
|
|
232
|
-
<Button type="button" className="bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]">Guardar Cambios</Button>
|
|
233
|
-
</DialogClose>
|
|
234
|
-
</DialogFooter>
|
|
235
|
-
</DialogContent>
|
|
236
|
-
</Dialog>
|
|
237
|
-
</div>
|
|
238
|
-
{formData.systemPrompt ? (
|
|
239
|
-
<p className="text-xs text-white/40 line-clamp-1 italic border border-white/5 bg-white/[0.02] p-2 rounded-md">
|
|
240
|
-
"{formData.systemPrompt}"
|
|
241
|
-
</p>
|
|
242
|
-
) : (
|
|
243
|
-
<p className="text-xs text-white/30 italic">Sin system prompt configurado...</p>
|
|
244
|
-
)}
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
{/* Workspace Configuration */}
|
|
248
|
-
<div className="space-y-3">
|
|
249
|
-
<div className="flex items-center gap-2 mb-2">
|
|
250
|
-
<FolderOpen className="h-4 w-4 text-emerald-400" />
|
|
251
|
-
<h3 className="hive-title-section">Workspace Directory</h3>
|
|
252
|
-
</div>
|
|
253
|
-
<div className="space-y-2">
|
|
254
|
-
<Label htmlFor="workspace" className="hive-label--field">
|
|
255
|
-
Directorio de Trabajo del Agente
|
|
256
|
-
</Label>
|
|
257
|
-
<div className="flex gap-2">
|
|
258
|
-
<Input
|
|
259
|
-
id="workspace"
|
|
260
|
-
placeholder="Ej: /home/user/proyectos, D:\Work, /Volumes/USB"
|
|
261
|
-
className="hive-input flex-1 font-mono text-sm"
|
|
262
|
-
value={formData.workspace}
|
|
263
|
-
onChange={(e) => {
|
|
264
|
-
setFormData({ ...formData, workspace: e.target.value });
|
|
265
|
-
validateWorkspace(e.target.value);
|
|
266
|
-
}}
|
|
267
|
-
disabled={isLoading}
|
|
268
|
-
/>
|
|
269
|
-
{formData.workspace && workspaceValidation.exists && workspaceValidation.accessible && (
|
|
270
|
-
<Button
|
|
271
|
-
type="button"
|
|
272
|
-
variant="outline"
|
|
273
|
-
size="icon"
|
|
274
|
-
onClick={handleOpenWorkspace}
|
|
275
|
-
className="shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10"
|
|
276
|
-
title="Abrir en el explorador"
|
|
277
|
-
>
|
|
278
|
-
<ExternalLink className="h-4 w-4" />
|
|
279
|
-
</Button>
|
|
280
|
-
)}
|
|
281
|
-
</div>
|
|
282
|
-
<p className="text-xs text-white/40 leading-relaxed">
|
|
283
|
-
Directorio donde el agente creará archivos, carpetas y ejecutará comandos.
|
|
284
|
-
Puede ser cualquier ubicación en tu sistema (disco duro, USB, red, etc.).
|
|
285
|
-
</p>
|
|
286
|
-
|
|
287
|
-
{/* Validation Status */}
|
|
288
|
-
{formData.workspace && formData.workspace.trim() !== "" && (
|
|
289
|
-
<div className={cn(
|
|
290
|
-
"flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all",
|
|
291
|
-
workspaceValidation.isValidating && "bg-blue-500/10 border-blue-500/20 text-blue-400",
|
|
292
|
-
!workspaceValidation.isValidating && workspaceValidation.exists && workspaceValidation.accessible && "bg-emerald-500/10 border-emerald-500/20 text-emerald-400",
|
|
293
|
-
!workspaceValidation.isValidating && workspaceValidation.exists && !workspaceValidation.accessible && "bg-amber-500/10 border-amber-500/20 text-amber-400",
|
|
294
|
-
!workspaceValidation.isValidating && !workspaceValidation.exists && "bg-purple-500/10 border-purple-500/20 text-purple-400"
|
|
295
|
-
)}>
|
|
296
|
-
{workspaceValidation.isValidating && (
|
|
297
|
-
<>
|
|
298
|
-
<Loader2 className="h-3.5 w-3.5 animate-spin" />
|
|
299
|
-
<span>Validando directorio...</span>
|
|
300
|
-
</>
|
|
301
|
-
)}
|
|
302
|
-
{!workspaceValidation.isValidating && workspaceValidation.exists && workspaceValidation.accessible && (
|
|
303
|
-
<>
|
|
304
|
-
<Check className="h-3.5 w-3.5" />
|
|
305
|
-
<span>{workspaceValidation.message || "Directorio válido y accesible"}</span>
|
|
306
|
-
</>
|
|
307
|
-
)}
|
|
308
|
-
{!workspaceValidation.isValidating && workspaceValidation.exists && !workspaceValidation.accessible && (
|
|
309
|
-
<>
|
|
310
|
-
<AlertCircle className="h-3.5 w-3.5" />
|
|
311
|
-
<span>{workspaceValidation.message || "El directorio existe pero no tiene permisos de lectura/escritura"}</span>
|
|
312
|
-
</>
|
|
313
|
-
)}
|
|
314
|
-
{!workspaceValidation.isValidating && !workspaceValidation.exists && (
|
|
315
|
-
<>
|
|
316
|
-
<FolderOpen className="h-3.5 w-3.5" />
|
|
317
|
-
<span>{workspaceValidation.message || "El directorio no existe"}</span>
|
|
318
|
-
{!workspaceValidation.error && (
|
|
319
|
-
<Button
|
|
320
|
-
type="button"
|
|
321
|
-
variant="outline"
|
|
322
|
-
size="sm"
|
|
323
|
-
onClick={handleCreateWorkspace}
|
|
324
|
-
className="ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30"
|
|
325
|
-
>
|
|
326
|
-
Crear directorio
|
|
327
|
-
</Button>
|
|
328
|
-
)}
|
|
329
|
-
</>
|
|
330
|
-
)}
|
|
331
|
-
</div>
|
|
332
|
-
)}
|
|
333
|
-
</div>
|
|
334
|
-
</div>
|
|
335
|
-
|
|
336
|
-
<div className="hive-card-divider" />
|
|
337
|
-
|
|
338
|
-
{/* AI Configuration */}
|
|
339
|
-
<div className="space-y-4">
|
|
340
|
-
<div className="flex items-center gap-2 mb-2">
|
|
341
|
-
<Cpu className="h-4 w-4 text-blue-400" />
|
|
342
|
-
<h3 className="hive-title-section">Motor de Inteligencia</h3>
|
|
343
|
-
</div>
|
|
344
|
-
<ModelSelector
|
|
345
|
-
selectedProviderId={formData.provider_id || undefined}
|
|
346
|
-
selectedModelId={formData.model_id || undefined}
|
|
347
|
-
onProviderChange={(providerId) =>
|
|
348
|
-
setFormData({ ...formData, provider_id: providerId, model_id: "" })
|
|
349
|
-
}
|
|
350
|
-
onModelChange={(modelId) => setFormData({ ...formData, model_id: modelId })}
|
|
351
|
-
disabled={isLoading}
|
|
352
|
-
/>
|
|
353
|
-
</div>
|
|
354
|
-
|
|
355
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
356
|
-
{/* Tone Selection */}
|
|
357
|
-
<div className="space-y-2">
|
|
358
|
-
<Label htmlFor="tone" className="hive-label--field">Tono de Voz</Label>
|
|
359
|
-
<Select
|
|
360
|
-
value={formData.tone}
|
|
361
|
-
onValueChange={(tone) => setFormData({ ...formData, tone })}
|
|
362
|
-
disabled={isLoading}
|
|
363
|
-
>
|
|
364
|
-
<SelectTrigger className="hive-select-trigger">
|
|
365
|
-
<SelectValue placeholder="Selecciona un tono" />
|
|
366
|
-
</SelectTrigger>
|
|
367
|
-
<SelectContent className="hive-select-content">
|
|
368
|
-
{TONE_OPTIONS.map((option) => (
|
|
369
|
-
<SelectItem key={option.value} value={option.value} className="hive-select-item">
|
|
370
|
-
{option.label}
|
|
371
|
-
</SelectItem>
|
|
372
|
-
))}
|
|
373
|
-
</SelectContent>
|
|
374
|
-
</Select>
|
|
375
|
-
</div>
|
|
376
|
-
|
|
377
|
-
{/* Status & Role */}
|
|
378
|
-
<div className="hive-toggle-panel">
|
|
379
|
-
<div className="flex items-center justify-between">
|
|
380
|
-
<div className="flex items-center gap-2">
|
|
381
|
-
<Shield className="h-3.5 w-3.5 text-purple-400" />
|
|
382
|
-
<Label htmlFor="role" className="text-xs font-medium text-white/70">Rol</Label>
|
|
383
|
-
</div>
|
|
384
|
-
<Select
|
|
385
|
-
value={formData.role}
|
|
386
|
-
onValueChange={(val) => setFormData({ ...formData, role: val as "coordinator" | "worker" })}
|
|
387
|
-
disabled={isLoading}
|
|
388
|
-
>
|
|
389
|
-
<SelectTrigger className="w-[120px] bg-white/5 border-white/10 text-white">
|
|
390
|
-
<SelectValue />
|
|
391
|
-
</SelectTrigger>
|
|
392
|
-
<SelectContent className="bg-zinc-900 border-white/10">
|
|
393
|
-
<SelectItem value="coordinator">Coordinador</SelectItem>
|
|
394
|
-
<SelectItem value="worker">Worker</SelectItem>
|
|
395
|
-
</SelectContent>
|
|
396
|
-
</Select>
|
|
397
|
-
</div>
|
|
398
|
-
<div className="flex items-center justify-between">
|
|
399
|
-
<div className="flex items-center gap-2">
|
|
400
|
-
<div className={`h-2 w-2 rounded-full ${formData.enabled ? "bg-blue-400" : "bg-zinc-600"}`} />
|
|
401
|
-
<Label htmlFor="enabled" className="text-xs font-medium text-white/70">Habilitado</Label>
|
|
402
|
-
</div>
|
|
403
|
-
<Switch
|
|
404
|
-
id="enabled"
|
|
405
|
-
checked={formData.enabled}
|
|
406
|
-
onCheckedChange={(checked) => setFormData({ ...formData, enabled: checked })}
|
|
407
|
-
disabled={isLoading}
|
|
408
|
-
/>
|
|
409
|
-
</div>
|
|
410
|
-
</div>
|
|
411
|
-
</div>
|
|
412
|
-
|
|
413
|
-
{error && <div className="hive-form-error">{error}</div>}
|
|
414
|
-
|
|
415
|
-
<div className="flex items-center gap-3 pt-4">
|
|
416
|
-
{onCancel && (
|
|
417
|
-
<Button
|
|
418
|
-
type="button"
|
|
419
|
-
variant="outline"
|
|
420
|
-
onClick={onCancel}
|
|
421
|
-
disabled={isLoading}
|
|
422
|
-
className="hive-btn--form-cancel"
|
|
423
|
-
>
|
|
424
|
-
Cancelar
|
|
425
|
-
</Button>
|
|
426
|
-
)}
|
|
427
|
-
<Button
|
|
428
|
-
type="submit"
|
|
429
|
-
disabled={isLoading}
|
|
430
|
-
className="hive-btn--form-submit"
|
|
431
|
-
>
|
|
432
|
-
{isLoading ? (
|
|
433
|
-
<>
|
|
434
|
-
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
435
|
-
Procesando...
|
|
436
|
-
</>
|
|
437
|
-
) : (
|
|
438
|
-
<>{isEdit ? "Actualizar Agente" : "Desplegar Agente"}</>
|
|
439
|
-
)}
|
|
440
|
-
</Button>
|
|
441
|
-
</div>
|
|
442
|
-
</form>
|
|
443
|
-
</CardContent>
|
|
444
|
-
</Card>
|
|
445
|
-
);
|
|
446
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Agent } from "@/types";
|
|
2
|
-
import { AgentStatusBadge } from "./AgentStatusBadge";
|
|
3
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
4
|
-
import { Separator } from "@/components/ui/separator";
|
|
5
|
-
|
|
6
|
-
interface AgentDetailProps {
|
|
7
|
-
agent: Agent | null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function AgentDetail({ agent }: AgentDetailProps) {
|
|
11
|
-
if (!agent) {
|
|
12
|
-
return <p className="text-sm text-muted-foreground">Agente no encontrado</p>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Card>
|
|
17
|
-
<CardHeader className="flex flex-row items-center justify-between">
|
|
18
|
-
<CardTitle>{agent.name}</CardTitle>
|
|
19
|
-
<AgentStatusBadge status={agent.status} />
|
|
20
|
-
</CardHeader>
|
|
21
|
-
<Separator />
|
|
22
|
-
<CardContent className="pt-4">
|
|
23
|
-
<p className="text-sm text-muted-foreground">{agent.description}</p>
|
|
24
|
-
{/* Detail sections will be added here */}
|
|
25
|
-
</CardContent>
|
|
26
|
-
</Card>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { Badge } from "@/components/ui/badge";
|
|
2
|
-
import { AgentStatusBadge } from "./AgentStatusBadge";
|
|
3
|
-
import type { Agent } from "@/types";
|
|
4
|
-
import { Cpu, Shield, Calendar, Fingerprint, Activity, Zap } from "lucide-react";
|
|
5
|
-
import { format } from "date-fns";
|
|
6
|
-
import { es } from "date-fns/locale";
|
|
7
|
-
import { useProviders, useModels } from "@/stores/useGlobalConfigStore";
|
|
8
|
-
|
|
9
|
-
interface AgentInternalCardProps {
|
|
10
|
-
agent: Agent;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function AgentInternalCard({ agent }: AgentInternalCardProps) {
|
|
14
|
-
const { providers } = useProviders();
|
|
15
|
-
const { models } = useModels();
|
|
16
|
-
|
|
17
|
-
const isCoordinator = agent.role === 'coordinator';
|
|
18
|
-
const providerId = agent.provider_id || agent.providerId;
|
|
19
|
-
const modelId = agent.model_id || agent.modelId;
|
|
20
|
-
const createdAt = agent.created_at || agent.createdAt;
|
|
21
|
-
|
|
22
|
-
const formattedDate = createdAt
|
|
23
|
-
? format(typeof createdAt === "string" ? new Date(createdAt) : new Date(createdAt * 1000), "PPP", { locale: es })
|
|
24
|
-
: "Fecha desconocida";
|
|
25
|
-
|
|
26
|
-
const providerName = providers.find(p => p.id === providerId)?.name || providerId;
|
|
27
|
-
const modelName = models.find(m => m.id === modelId)?.name || modelId;
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div
|
|
31
|
-
className={`hive-card--internal group ${agent.enabled ? "hive-card--internal-active" : "hive-card--internal-disabled"
|
|
32
|
-
}`}
|
|
33
|
-
>
|
|
34
|
-
{/* Ambient Glows */}
|
|
35
|
-
{agent.enabled && (
|
|
36
|
-
<>
|
|
37
|
-
<div className="absolute -top-24 -right-24 h-64 w-64 bg-blue-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-blue-600/20 transition-all duration-700" />
|
|
38
|
-
<div className="absolute -bottom-24 -left-24 h-64 w-64 bg-purple-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-purple-600/20 transition-all duration-700" />
|
|
39
|
-
</>
|
|
40
|
-
)}
|
|
41
|
-
|
|
42
|
-
<div className="relative flex flex-col md:flex-row gap-8 items-start justify-between">
|
|
43
|
-
<div className="flex-1 space-y-6">
|
|
44
|
-
<div className="flex flex-col gap-4">
|
|
45
|
-
{/* Icon + Title */}
|
|
46
|
-
<div className="flex items-center gap-3">
|
|
47
|
-
<div className={`hive-icon-wrap--internal ${agent.enabled ? "hive-icon-wrap--internal-active" : "hive-icon-wrap--internal-disabled"}`}>
|
|
48
|
-
<Fingerprint className={`h-6 w-6 ${agent.enabled ? "text-blue-400" : "text-white/20"}`} />
|
|
49
|
-
</div>
|
|
50
|
-
<div>
|
|
51
|
-
<div className="flex items-center gap-2 mb-1">
|
|
52
|
-
<span className={`hive-page-header__label ${!agent.enabled && "text-white/20"}`}>
|
|
53
|
-
Identidad de Nodo
|
|
54
|
-
</span>
|
|
55
|
-
{isCoordinator && (
|
|
56
|
-
<Badge className={`hive-tag--coordinator ${!agent.enabled && "bg-white/5 text-white/20 border-white/10"}`}>
|
|
57
|
-
Coordinador
|
|
58
|
-
</Badge>
|
|
59
|
-
)}
|
|
60
|
-
</div>
|
|
61
|
-
<h1 className={`text-4xl font-black tracking-tighter ${agent.enabled ? "text-white" : "text-white/40"}`}>
|
|
62
|
-
{agent.name}
|
|
63
|
-
</h1>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
<p className={`text-lg leading-relaxed max-w-2xl font-light italic ${agent.enabled ? "text-white/60" : "text-white/20"}`}>
|
|
67
|
-
"{agent.description || "Este agente no tiene una descripción definida aún."}"
|
|
68
|
-
</p>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
{/* Info Cards Grid */}
|
|
72
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
|
73
|
-
<InfoCard
|
|
74
|
-
icon={Cpu}
|
|
75
|
-
label="Infraestructura"
|
|
76
|
-
value={providerName}
|
|
77
|
-
subValue={modelName}
|
|
78
|
-
color={agent.enabled ? "text-blue-400" : "text-white/20"}
|
|
79
|
-
enabled={agent.enabled}
|
|
80
|
-
/>
|
|
81
|
-
<InfoCard
|
|
82
|
-
icon={Zap}
|
|
83
|
-
label="Personalidad"
|
|
84
|
-
value={agent.tone || "Neutral"}
|
|
85
|
-
color={agent.enabled ? "text-purple-400" : "text-white/20"}
|
|
86
|
-
enabled={agent.enabled}
|
|
87
|
-
/>
|
|
88
|
-
<InfoCard
|
|
89
|
-
icon={Calendar}
|
|
90
|
-
label="Desplegado el"
|
|
91
|
-
value={formattedDate}
|
|
92
|
-
color={agent.enabled ? "text-emerald-400" : "text-white/20"}
|
|
93
|
-
enabled={agent.enabled}
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
{/* Right: Status + Network load */}
|
|
99
|
-
<div className="flex flex-col items-center md:items-end gap-6 min-w-[200px]">
|
|
100
|
-
<div className="text-center md:text-right space-y-2">
|
|
101
|
-
<span className="hive-label block">Estado Operativo</span>
|
|
102
|
-
<AgentStatusBadge
|
|
103
|
-
status={agent.enabled ? agent.status : "hibernated"}
|
|
104
|
-
className="px-6 py-2 text-sm border-2"
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<div className="hive-network-panel md:w-auto">
|
|
109
|
-
<div className="flex-1">
|
|
110
|
-
<p className="hive-label mb-1">Carga de Red</p>
|
|
111
|
-
<div className="hive-network-track">
|
|
112
|
-
{agent.enabled && <div className="hive-network-fill" />}
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
<Activity className={`h-5 w-5 ${agent.enabled ? "text-blue-400 animate-pulse" : "text-white/10"}`} />
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
{/* Decorative Strip */}
|
|
121
|
-
<div className={`hive-strip--bottom ${!agent.enabled && "opacity-20"}`} />
|
|
122
|
-
<div className="absolute top-4 right-8 hive-mono hidden md:block">
|
|
123
|
-
NODE_UID: {agent.id}
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function InfoCard({
|
|
130
|
-
icon: IconComponent,
|
|
131
|
-
label,
|
|
132
|
-
value,
|
|
133
|
-
subValue,
|
|
134
|
-
color,
|
|
135
|
-
enabled,
|
|
136
|
-
}: {
|
|
137
|
-
icon: React.ComponentType<{ className?: string }>;
|
|
138
|
-
label: string;
|
|
139
|
-
value: string;
|
|
140
|
-
subValue?: string;
|
|
141
|
-
color: string;
|
|
142
|
-
enabled: boolean;
|
|
143
|
-
}) {
|
|
144
|
-
return (
|
|
145
|
-
<div className={`hive-info-card ${enabled ? "hive-info-card--active" : "hive-info-card--disabled"}`}>
|
|
146
|
-
<div className="flex items-center gap-2 mb-2">
|
|
147
|
-
<IconComponent className={`h-3.5 w-3.5 ${color}`} />
|
|
148
|
-
<span className="hive-info-card__label">{label}</span>
|
|
149
|
-
</div>
|
|
150
|
-
<div className="space-y-0.5">
|
|
151
|
-
<p className={`hive-info-card__value ${enabled ? "text-white/80 group-hover/item:text-white" : "text-white/20"}`}>
|
|
152
|
-
{value}
|
|
153
|
-
</p>
|
|
154
|
-
{subValue && (
|
|
155
|
-
<p className={`hive-info-card__sub ${enabled ? "text-white/40" : "text-white/10"}`}>
|
|
156
|
-
{subValue}
|
|
157
|
-
</p>
|
|
158
|
-
)}
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
);
|
|
162
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AgentCard } from "./AgentCard";
|
|
2
|
-
import type { Agent } from "@/types";
|
|
3
|
-
|
|
4
|
-
interface AgentListProps {
|
|
5
|
-
agents: Agent[];
|
|
6
|
-
onEdit?: (agent: Agent) => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function AgentList({ agents, onEdit }: AgentListProps) {
|
|
10
|
-
if (agents.length === 0) {
|
|
11
|
-
return (
|
|
12
|
-
<div className="hive-empty-state">
|
|
13
|
-
<div className="p-4 rounded-full bg-white/5 mb-4">
|
|
14
|
-
<div className="h-10 w-10 border-2 border-dashed border-white/20 rounded-full" />
|
|
15
|
-
</div>
|
|
16
|
-
<p className="hive-label uppercase">No se detectaron nodos activos</p>
|
|
17
|
-
<p className="text-xs text-white/20 mt-1">Comienza desplegando un nuevo agente en tu red.</p>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3 pb-20">
|
|
24
|
-
{agents.map((agent) => (
|
|
25
|
-
<AgentCard key={agent.id} agent={agent} onEdit={onEdit} />
|
|
26
|
-
))}
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
29
|
-
}
|