@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,90 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@johpaz/hive-ui",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.7.2",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "vite build",
|
|
9
|
-
"build:dev": "vite build --mode development",
|
|
10
|
-
"lint": "eslint .",
|
|
11
|
-
"preview": "vite preview",
|
|
12
|
-
"test": "vitest run",
|
|
13
|
-
"test:watch": "vitest"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@hookform/resolvers": "^3.10.0",
|
|
17
|
-
"@radix-ui/react-accordion": "^1.2.11",
|
|
18
|
-
"@radix-ui/react-alert-dialog": "^1.1.14",
|
|
19
|
-
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
|
20
|
-
"@radix-ui/react-avatar": "^1.1.10",
|
|
21
|
-
"@radix-ui/react-checkbox": "^1.3.2",
|
|
22
|
-
"@radix-ui/react-collapsible": "^1.1.11",
|
|
23
|
-
"@radix-ui/react-context-menu": "^2.2.15",
|
|
24
|
-
"@radix-ui/react-dialog": "^1.1.14",
|
|
25
|
-
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
26
|
-
"@radix-ui/react-hover-card": "^1.1.14",
|
|
27
|
-
"@radix-ui/react-label": "^2.1.7",
|
|
28
|
-
"@radix-ui/react-menubar": "^1.1.15",
|
|
29
|
-
"@radix-ui/react-navigation-menu": "^1.2.13",
|
|
30
|
-
"@radix-ui/react-popover": "^1.1.14",
|
|
31
|
-
"@radix-ui/react-progress": "^1.1.7",
|
|
32
|
-
"@radix-ui/react-radio-group": "^1.3.7",
|
|
33
|
-
"@radix-ui/react-scroll-area": "^1.2.9",
|
|
34
|
-
"@radix-ui/react-select": "^2.2.5",
|
|
35
|
-
"@radix-ui/react-separator": "^1.1.7",
|
|
36
|
-
"@radix-ui/react-slider": "^1.3.5",
|
|
37
|
-
"@radix-ui/react-slot": "^1.2.3",
|
|
38
|
-
"@radix-ui/react-switch": "^1.2.5",
|
|
39
|
-
"@radix-ui/react-tabs": "^1.1.12",
|
|
40
|
-
"@radix-ui/react-toast": "^1.2.14",
|
|
41
|
-
"@radix-ui/react-toggle": "^1.1.9",
|
|
42
|
-
"@radix-ui/react-toggle-group": "^1.1.10",
|
|
43
|
-
"@radix-ui/react-tooltip": "^1.2.7",
|
|
44
|
-
"@tanstack/react-query": "^5.83.0",
|
|
45
|
-
"class-variance-authority": "^0.7.1",
|
|
46
|
-
"clsx": "^2.1.1",
|
|
47
|
-
"cmdk": "^1.1.1",
|
|
48
|
-
"date-fns": "^3.6.0",
|
|
49
|
-
"embla-carousel-react": "^8.6.0",
|
|
50
|
-
"input-otp": "^1.4.2",
|
|
51
|
-
"lucide-react": "^0.462.0",
|
|
52
|
-
"next-themes": "^0.3.0",
|
|
53
|
-
"react": "^18.3.1",
|
|
54
|
-
"react-day-picker": "^8.10.1",
|
|
55
|
-
"react-dom": "^18.3.1",
|
|
56
|
-
"react-hook-form": "^7.61.1",
|
|
57
|
-
"react-resizable-panels": "^2.1.9",
|
|
58
|
-
"react-router-dom": "^7.1.0",
|
|
59
|
-
"recharts": "^2.15.4",
|
|
60
|
-
"remark-gfm": "^4.0.1",
|
|
61
|
-
"sonner": "^1.7.4",
|
|
62
|
-
"sweetalert2": "^11.26.21",
|
|
63
|
-
"tailwind-merge": "^2.6.0",
|
|
64
|
-
"tailwindcss-animate": "^1.0.7",
|
|
65
|
-
"vaul": "^0.9.9",
|
|
66
|
-
"zod": "^3.25.76",
|
|
67
|
-
"zustand": "^5.0.11"
|
|
68
|
-
},
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@eslint/js": "^9.32.0",
|
|
71
|
-
"@tailwindcss/typography": "^0.5.16",
|
|
72
|
-
"@testing-library/jest-dom": "^6.6.0",
|
|
73
|
-
"@testing-library/react": "^16.0.0",
|
|
74
|
-
"@tailwindcss/vite": "4.2.1",
|
|
75
|
-
"@types/node": "^22.16.5",
|
|
76
|
-
"@types/react": "^18.3.23",
|
|
77
|
-
"@types/react-dom": "^18.3.7",
|
|
78
|
-
"@vitejs/plugin-react": "^5.1.4",
|
|
79
|
-
"eslint": "^9.32.0",
|
|
80
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
81
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
82
|
-
"globals": "^15.15.0",
|
|
83
|
-
"jsdom": "^20.0.3",
|
|
84
|
-
"tailwindcss": "^4.2.1",
|
|
85
|
-
"typescript": "5.9.3",
|
|
86
|
-
"typescript-eslint": "^8.38.0",
|
|
87
|
-
"vite": "^7.3.1",
|
|
88
|
-
"vitest": "^3.2.4"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" fill="none"><rect width="1200" height="1200" fill="#EAEAEA" rx="3"/><g opacity=".5"><g opacity=".5"><path fill="#FAFAFA" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/></g><path stroke="url(#a)" stroke-width="2.418" d="M0-1.209h553.581" transform="scale(1 -1) rotate(45 1163.11 91.165)"/><path stroke="url(#b)" stroke-width="2.418" d="M404.846 598.671h391.726"/><path stroke="url(#c)" stroke-width="2.418" d="M599.5 795.742V404.017"/><path stroke="url(#d)" stroke-width="2.418" d="m795.717 796.597-391.441-391.44"/><path fill="#fff" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/><g clip-path="url(#e)"><path fill="#666" fill-rule="evenodd" d="M616.426 586.58h-31.434v16.176l3.553-3.554.531-.531h9.068l.074-.074 8.463-8.463h2.565l7.18 7.181V586.58Zm-15.715 14.654 3.698 3.699 1.283 1.282-2.565 2.565-1.282-1.283-5.2-5.199h-6.066l-5.514 5.514-.073.073v2.876a2.418 2.418 0 0 0 2.418 2.418h26.598a2.418 2.418 0 0 0 2.418-2.418v-8.317l-8.463-8.463-7.181 7.181-.071.072Zm-19.347 5.442v4.085a6.045 6.045 0 0 0 6.046 6.045h26.598a6.044 6.044 0 0 0 6.045-6.045v-7.108l1.356-1.355-1.282-1.283-.074-.073v-17.989h-38.689v23.43l-.146.146.146.147Z" clip-rule="evenodd"/></g><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/></g><defs><linearGradient id="a" x1="554.061" x2="-.48" y1=".083" y2=".087" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="b" x1="796.912" x2="404.507" y1="599.963" y2="599.965" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="c" x1="600.792" x2="600.794" y1="403.677" y2="796.082" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="d" x1="404.85" x2="796.972" y1="403.903" y2="796.02" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><clipPath id="e"><path fill="#fff" d="M581.364 580.535h38.689v38.689h-38.689z"/></clipPath></defs></svg>
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { Toaster } from "@/components/ui/toaster";
|
|
2
|
-
import { Toaster as Sonner } from "@/components/ui/sonner";
|
|
3
|
-
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
4
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
-
import { BrowserRouter, Routes, Route, useNavigate, useLocation } from "react-router-dom";
|
|
6
|
-
import { AppLayout } from "@/modules/layout/AppLayout";
|
|
7
|
-
import { DashboardPage } from "@/pages/DashboardPage";
|
|
8
|
-
import { AgentsPage } from "@/pages/AgentsPage";
|
|
9
|
-
import { AgentDetailPage } from "@/pages/AgentDetailPage";
|
|
10
|
-
import { SettingsPage } from "@/pages/SettingsPage";
|
|
11
|
-
import { AgentNewPage } from "@/pages/AgentNewPage";
|
|
12
|
-
import { CanvasPage } from "@/pages/CanvasPage";
|
|
13
|
-
import { BridgePage } from "@/pages/BridgePage";
|
|
14
|
-
import { LogsPage } from "@/pages/LogsPage";
|
|
15
|
-
import { ChannelsPage } from "@/pages/ChannelsPage";
|
|
16
|
-
import { ProjectsPage } from "@/pages/ProjectsPage";
|
|
17
|
-
import { ProvidersPage } from "@/pages/ProvidersPage";
|
|
18
|
-
import { WebChatPage } from "@/pages/WebChatPage";
|
|
19
|
-
import SetupPage from "@/pages/SetupPage";
|
|
20
|
-
import NotFound from "@/pages/NotFound";
|
|
21
|
-
import { useInitializeGlobalConfig } from "@/stores/useGlobalConfigStore";
|
|
22
|
-
import { useUserStore } from "@/stores/userStore";
|
|
23
|
-
import { WelcomeDialog } from "@/components/WelcomeDialog";
|
|
24
|
-
import { useEffect, useState } from "react";
|
|
25
|
-
import { BeeLoader } from "@/components/ui/bee-loader";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const queryClient = new QueryClient();
|
|
29
|
-
|
|
30
|
-
const AppContent = () => {
|
|
31
|
-
useInitializeGlobalConfig();
|
|
32
|
-
|
|
33
|
-
const fetchUser = useUserStore(s => s.fetchUser);
|
|
34
|
-
const navigate = useNavigate();
|
|
35
|
-
const location = useLocation();
|
|
36
|
-
const [setupChecked, setSetupChecked] = useState(false);
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
// Capturar token de la URL si existe
|
|
40
|
-
const params = new URLSearchParams(window.location.search);
|
|
41
|
-
const token = params.get("token");
|
|
42
|
-
if (token) {
|
|
43
|
-
localStorage.setItem("hive-auth-token", token);
|
|
44
|
-
const newUrl = window.location.pathname + window.location.hash;
|
|
45
|
-
window.history.replaceState({}, "", newUrl);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Verificar si el setup está completo y redirigir según corresponda
|
|
49
|
-
fetch("/api/setup/status")
|
|
50
|
-
.then(r => r.json())
|
|
51
|
-
.then(({ setupMode }) => {
|
|
52
|
-
if (setupMode && location.pathname !== "/setup") {
|
|
53
|
-
// Primera ejecución → ir al setup
|
|
54
|
-
navigate("/setup", { replace: true });
|
|
55
|
-
} else if (!setupMode && location.pathname === "/setup") {
|
|
56
|
-
// Ya configurado y el usuario navegó a /setup manualmente → al dashboard
|
|
57
|
-
navigate("/", { replace: true });
|
|
58
|
-
}
|
|
59
|
-
setSetupChecked(true);
|
|
60
|
-
if (!setupMode) fetchUser();
|
|
61
|
-
})
|
|
62
|
-
.catch(() => {
|
|
63
|
-
// Si el gateway no responde todavía, dejamos que el usuario vea lo que hay
|
|
64
|
-
setSetupChecked(true);
|
|
65
|
-
fetchUser();
|
|
66
|
-
});
|
|
67
|
-
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
68
|
-
|
|
69
|
-
// No renderizar nada hasta saber si hay que redirigir (evita flash)
|
|
70
|
-
if (!setupChecked) return null;
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<>
|
|
74
|
-
<BeeLoader />
|
|
75
|
-
<WelcomeDialog />
|
|
76
|
-
|
|
77
|
-
<Routes>
|
|
78
|
-
<Route path="/setup" element={<SetupPage />} />
|
|
79
|
-
<Route element={<AppLayout />}>
|
|
80
|
-
<Route path="/" element={<DashboardPage />} />
|
|
81
|
-
<Route path="/chat" element={<WebChatPage />} />
|
|
82
|
-
<Route path="/agents" element={<AgentsPage />} />
|
|
83
|
-
<Route path="/agents/new" element={<AgentNewPage />} />
|
|
84
|
-
<Route path="/agents/:id" element={<AgentDetailPage />} />
|
|
85
|
-
<Route path="/notas" element={<SettingsPage forcePanel="notas" />} />
|
|
86
|
-
<Route path="/cron-jobs" element={<SettingsPage forcePanel="cron-jobs" />} />
|
|
87
|
-
<Route path="/settings" element={<SettingsPage />} />
|
|
88
|
-
<Route path="/settings/:panel" element={<SettingsPage />} />
|
|
89
|
-
<Route path="/canvas" element={<CanvasPage />} />
|
|
90
|
-
<Route path="/canvas/:sessionId" element={<CanvasPage />} />
|
|
91
|
-
<Route path="/projects" element={<ProjectsPage />} />
|
|
92
|
-
<Route path="/bridge" element={<BridgePage />} />
|
|
93
|
-
<Route path="/channels" element={<ChannelsPage />} />
|
|
94
|
-
<Route path="/providers" element={<ProvidersPage />} />
|
|
95
|
-
<Route path="/logs" element={<LogsPage />} />
|
|
96
|
-
</Route>
|
|
97
|
-
<Route path="*" element={<NotFound />} />
|
|
98
|
-
</Routes>
|
|
99
|
-
</>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const App = () => (
|
|
104
|
-
<QueryClientProvider client={queryClient}>
|
|
105
|
-
<TooltipProvider>
|
|
106
|
-
<Toaster />
|
|
107
|
-
<Sonner />
|
|
108
|
-
<BrowserRouter>
|
|
109
|
-
<AppContent />
|
|
110
|
-
</BrowserRouter>
|
|
111
|
-
</TooltipProvider>
|
|
112
|
-
</QueryClientProvider>
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
export default App;
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { useNotesAndCronsStore } from '../stores/useNotesAndCronsStore';
|
|
3
|
-
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from './ui/card';
|
|
4
|
-
import { ScrollArea } from './ui/scroll-area';
|
|
5
|
-
import { Clock, Loader2, Calendar, Activity, MessageCircle, Send } from 'lucide-react';
|
|
6
|
-
import { Switch } from './ui/switch';
|
|
7
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
|
|
8
|
-
|
|
9
|
-
// ── Channel icon helper ────────────────────────────────────────────────────────
|
|
10
|
-
function ChannelBadge({ channelId }: { channelId?: string | null }) {
|
|
11
|
-
if (!channelId || channelId === 'webchat') {
|
|
12
|
-
return (
|
|
13
|
-
<span className="inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400 border border-blue-500/20">
|
|
14
|
-
<MessageCircle className="w-2.5 h-2.5" />
|
|
15
|
-
Web
|
|
16
|
-
</span>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
if (channelId === 'telegram') {
|
|
20
|
-
return (
|
|
21
|
-
<span className="inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-sky-500/10 text-sky-400 border border-sky-500/20">
|
|
22
|
-
<Send className="w-2.5 h-2.5" />
|
|
23
|
-
Telegram
|
|
24
|
-
</span>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
return (
|
|
28
|
-
<span className="inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-muted/40 text-muted-foreground border border-white/10">
|
|
29
|
-
{channelId}
|
|
30
|
-
</span>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// ── Expiry label ───────────────────────────────────────────────────────────────
|
|
35
|
-
function ExpiryLabel({ expiresAt }: { expiresAt?: number | null }) {
|
|
36
|
-
if (!expiresAt) return null;
|
|
37
|
-
const date = new Date(expiresAt * 1000);
|
|
38
|
-
const now = Date.now();
|
|
39
|
-
const diffDays = Math.ceil((date.getTime() - now) / 86400000);
|
|
40
|
-
const label = diffDays <= 0
|
|
41
|
-
? 'Expirado'
|
|
42
|
-
: diffDays === 1
|
|
43
|
-
? 'Expira mañana'
|
|
44
|
-
: `Expira en ${diffDays}d`;
|
|
45
|
-
const urgent = diffDays <= 3;
|
|
46
|
-
return (
|
|
47
|
-
<span className={`text-[9px] font-mono ${urgent ? 'text-amber-400' : 'text-muted-foreground'}`}>
|
|
48
|
-
{label}
|
|
49
|
-
</span>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// ── Max runs label ─────────────────────────────────────────────────────────────
|
|
54
|
-
function MaxRunsLabel({ maxRuns }: { maxRuns?: number | null }) {
|
|
55
|
-
if (!maxRuns) return null;
|
|
56
|
-
return (
|
|
57
|
-
<span className="text-[9px] font-mono text-muted-foreground">
|
|
58
|
-
{maxRuns} {maxRuns === 1 ? 'vez' : 'veces'}
|
|
59
|
-
</span>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// ── Channel option label ───────────────────────────────────────────────────────
|
|
64
|
-
function channelLabel(id: string, recommended: string) {
|
|
65
|
-
const base = id === 'telegram' ? 'Telegram' : id === 'webchat' ? 'Web Chat' : id;
|
|
66
|
-
return id === recommended ? `${base} (recomendado)` : base;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// ── Main component ─────────────────────────────────────────────────────────────
|
|
70
|
-
export const CronJobsPanel: React.FC = () => {
|
|
71
|
-
const {
|
|
72
|
-
cronJobs,
|
|
73
|
-
cronChannels,
|
|
74
|
-
cronRecommended,
|
|
75
|
-
cronUserPreference,
|
|
76
|
-
isLoading,
|
|
77
|
-
fetchCronJobs,
|
|
78
|
-
fetchCronChannels,
|
|
79
|
-
toggleCronJobActive,
|
|
80
|
-
saveCronChannelPreference,
|
|
81
|
-
} = useNotesAndCronsStore();
|
|
82
|
-
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
fetchCronJobs();
|
|
85
|
-
fetchCronChannels();
|
|
86
|
-
}, [fetchCronJobs, fetchCronChannels]);
|
|
87
|
-
|
|
88
|
-
const activeJobs = (cronJobs ?? []).filter(j => Number(j.enabled) === 1);
|
|
89
|
-
const activeChannels = (cronChannels ?? []).filter(c => c.active);
|
|
90
|
-
|
|
91
|
-
console.log("[CronPanel] cronJobs:", cronJobs);
|
|
92
|
-
console.log("[CronPanel] activeJobs:", activeJobs);
|
|
93
|
-
console.log("[CronPanel] cronChannels:", cronChannels);
|
|
94
|
-
console.log("[CronPanel] activeChannels:", activeChannels);
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<Card className="border-none bg-background/50 backdrop-blur-xl shadow-2xl overflow-hidden group border border-white/10">
|
|
98
|
-
<CardHeader className="pb-2">
|
|
99
|
-
<div className="flex items-center justify-between">
|
|
100
|
-
<div className="flex items-center gap-2">
|
|
101
|
-
<div className="p-2 rounded-xl bg-primary/10 text-primary">
|
|
102
|
-
<Clock className="w-5 h-5" />
|
|
103
|
-
</div>
|
|
104
|
-
<div>
|
|
105
|
-
<CardTitle className="text-xl font-bold tracking-tight">Cron Jobs</CardTitle>
|
|
106
|
-
<CardDescription>Tareas programadas activas</CardDescription>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
<div className="flex items-center gap-2">
|
|
110
|
-
{isLoading && <Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />}
|
|
111
|
-
{/* Global channel preference picker */}
|
|
112
|
-
{activeChannels.length > 1 && (
|
|
113
|
-
<Select
|
|
114
|
-
value={cronUserPreference}
|
|
115
|
-
onValueChange={saveCronChannelPreference}
|
|
116
|
-
>
|
|
117
|
-
<SelectTrigger className="h-7 text-[10px] w-[130px] border-white/10 bg-card/40">
|
|
118
|
-
<SelectValue placeholder="Canal" />
|
|
119
|
-
</SelectTrigger>
|
|
120
|
-
<SelectContent>
|
|
121
|
-
<SelectItem value="auto" className="text-xs">
|
|
122
|
-
Auto (recomendado)
|
|
123
|
-
</SelectItem>
|
|
124
|
-
{activeChannels.map(ch => (
|
|
125
|
-
<SelectItem key={ch.id} value={ch.id} className="text-xs">
|
|
126
|
-
{channelLabel(ch.id, cronRecommended)}
|
|
127
|
-
</SelectItem>
|
|
128
|
-
))}
|
|
129
|
-
</SelectContent>
|
|
130
|
-
</Select>
|
|
131
|
-
)}
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
</CardHeader>
|
|
135
|
-
<CardContent>
|
|
136
|
-
<ScrollArea className="h-[350px] pr-4">
|
|
137
|
-
<div className="space-y-4">
|
|
138
|
-
{activeJobs.length === 0 ? (
|
|
139
|
-
<div className="flex flex-col items-center justify-center h-[250px] text-muted-foreground space-y-2">
|
|
140
|
-
<Clock className="w-12 h-12 opacity-20" />
|
|
141
|
-
<p className="text-sm">No hay tareas activas</p>
|
|
142
|
-
<p className="text-[10px] opacity-70">Define nuevas tareas cron desde el bot</p>
|
|
143
|
-
</div>
|
|
144
|
-
) : (
|
|
145
|
-
activeJobs.map((job) => {
|
|
146
|
-
console.log("[CronPanel] Rendering job:", job);
|
|
147
|
-
return (
|
|
148
|
-
<div
|
|
149
|
-
key={job.id}
|
|
150
|
-
className="p-4 rounded-2xl border border-white/5 bg-card/40 hover:bg-card/60 transition-all duration-300 group/item relative overflow-hidden"
|
|
151
|
-
>
|
|
152
|
-
{/* Stop toggle */}
|
|
153
|
-
<div className="absolute top-0 right-0 p-3 opacity-0 group-hover/item:opacity-100 transition-opacity">
|
|
154
|
-
<div className="flex items-center gap-2">
|
|
155
|
-
<span className="text-[10px] text-muted-foreground uppercase tracking-widest font-bold">Detener</span>
|
|
156
|
-
<Switch
|
|
157
|
-
checked={true}
|
|
158
|
-
onCheckedChange={() => toggleCronJobActive(job.id, false)}
|
|
159
|
-
className="scale-75 data-[state=checked]:bg-primary"
|
|
160
|
-
/>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
|
|
164
|
-
<h4 className="font-semibold text-sm mb-1.5 pr-16 truncate">{job.name}</h4>
|
|
165
|
-
|
|
166
|
-
{/* Schedule expression */}
|
|
167
|
-
<div className="flex items-center gap-1.5 text-[10px] text-primary font-bold uppercase tracking-wider mb-2 bg-primary/5 w-fit px-2 py-0.5 rounded-full">
|
|
168
|
-
<Calendar className="w-3 h-3" />
|
|
169
|
-
{job.cron_expression}
|
|
170
|
-
</div>
|
|
171
|
-
|
|
172
|
-
{/* Meta row: channel + limits */}
|
|
173
|
-
<div className="flex items-center gap-2 mb-2 flex-wrap">
|
|
174
|
-
<ChannelBadge channelId={job.notify_channel_id} />
|
|
175
|
-
<MaxRunsLabel maxRuns={job.max_runs} />
|
|
176
|
-
<ExpiryLabel expiresAt={job.expires_at} />
|
|
177
|
-
</div>
|
|
178
|
-
|
|
179
|
-
{/* Footer: status + last run */}
|
|
180
|
-
<div className="mt-2 flex items-center justify-between">
|
|
181
|
-
<div className="flex items-center gap-1.5 text-xs text-green-500 font-medium">
|
|
182
|
-
<Activity className="w-3 h-3" />
|
|
183
|
-
<span className="text-[10px] uppercase tracking-tighter">Running</span>
|
|
184
|
-
</div>
|
|
185
|
-
{job.last_run && (
|
|
186
|
-
<span className="text-[10px] text-muted-foreground font-mono">
|
|
187
|
-
{new Date(job.last_run * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
|
|
188
|
-
</span>
|
|
189
|
-
)}
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
);
|
|
193
|
-
})
|
|
194
|
-
)}
|
|
195
|
-
</div>
|
|
196
|
-
</ScrollArea>
|
|
197
|
-
</CardContent>
|
|
198
|
-
</Card>
|
|
199
|
-
);
|
|
200
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { NavLink as RouterNavLink, NavLinkProps } from "react-router-dom";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
interface NavLinkCompatProps extends Omit<NavLinkProps, "className"> {
|
|
6
|
-
className?: string;
|
|
7
|
-
activeClassName?: string;
|
|
8
|
-
pendingClassName?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Workaround for type incompatibility between react-router-dom v7 (React 19) and React 18
|
|
12
|
-
// Using type assertion to bypass the JSX component type check
|
|
13
|
-
const RouterNavLinkTyped = RouterNavLink as unknown as (
|
|
14
|
-
props: NavLinkProps & { ref?: React.Ref<HTMLAnchorElement> }
|
|
15
|
-
) => React.ReactElement | null;
|
|
16
|
-
|
|
17
|
-
const NavLink = forwardRef<HTMLAnchorElement, NavLinkCompatProps>(
|
|
18
|
-
({ className, activeClassName, pendingClassName, to, ...props }, ref) => {
|
|
19
|
-
return (
|
|
20
|
-
<RouterNavLinkTyped
|
|
21
|
-
ref={ref}
|
|
22
|
-
to={to}
|
|
23
|
-
className={({ isActive, isPending }) =>
|
|
24
|
-
cn(className, isActive && activeClassName, isPending && pendingClassName)
|
|
25
|
-
}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
},
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
NavLink.displayName = "NavLink";
|
|
33
|
-
|
|
34
|
-
export { NavLink };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { useNotesAndCronsStore } from '../stores/useNotesAndCronsStore';
|
|
3
|
-
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from './ui/card';
|
|
4
|
-
import { Badge } from './ui/badge';
|
|
5
|
-
import { ScrollArea } from './ui/scroll-area';
|
|
6
|
-
import { StickyNote, Loader2 } from 'lucide-react';
|
|
7
|
-
import { Switch } from './ui/switch';
|
|
8
|
-
|
|
9
|
-
export const NotesPanel: React.FC = () => {
|
|
10
|
-
const { notes, isLoading, fetchNotes, toggleNoteActive } = useNotesAndCronsStore();
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
fetchNotes();
|
|
14
|
-
}, [fetchNotes]);
|
|
15
|
-
|
|
16
|
-
const activeNotes = notes.filter(n => Number(n.active) === 1);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<Card className="border-none bg-background/50 backdrop-blur-xl shadow-2xl overflow-hidden group border border-white/10">
|
|
20
|
-
<CardHeader className="pb-2">
|
|
21
|
-
<div className="flex items-center justify-between">
|
|
22
|
-
<div className="flex items-center gap-2">
|
|
23
|
-
<div className="p-2 rounded-xl bg-primary/10 text-primary">
|
|
24
|
-
<StickyNote className="w-5 h-5" />
|
|
25
|
-
</div>
|
|
26
|
-
<div>
|
|
27
|
-
<CardTitle className="text-xl font-bold tracking-tight">Notas</CardTitle>
|
|
28
|
-
<CardDescription>Notas activas en el panel</CardDescription>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
{isLoading && <Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />}
|
|
32
|
-
</div>
|
|
33
|
-
</CardHeader>
|
|
34
|
-
<CardContent>
|
|
35
|
-
<ScrollArea className="h-[350px] pr-4">
|
|
36
|
-
<div className="space-y-4">
|
|
37
|
-
{activeNotes.length === 0 ? (
|
|
38
|
-
<div className="flex flex-col items-center justify-center h-[250px] text-muted-foreground space-y-2">
|
|
39
|
-
<StickyNote className="w-12 h-12 opacity-20" />
|
|
40
|
-
<p className="text-sm">No hay notas activas</p>
|
|
41
|
-
<p className="text-[10px] opacity-70">Usa el sistema para generar nuevas notas</p>
|
|
42
|
-
</div>
|
|
43
|
-
) : (
|
|
44
|
-
activeNotes.map((note) => (
|
|
45
|
-
<div
|
|
46
|
-
key={note.id}
|
|
47
|
-
className="p-4 rounded-2xl border border-white/5 bg-card/40 hover:bg-card/60 transition-all duration-300 group/item relative overflow-hidden"
|
|
48
|
-
>
|
|
49
|
-
<div className="absolute top-0 right-0 p-3 opacity-0 group-hover/item:opacity-100 transition-opacity">
|
|
50
|
-
<div className="flex items-center gap-2">
|
|
51
|
-
<span className="text-[10px] text-muted-foreground uppercase tracking-widest font-bold">Ocultar</span>
|
|
52
|
-
<Switch
|
|
53
|
-
checked={true}
|
|
54
|
-
onCheckedChange={() => toggleNoteActive(note.id, false)}
|
|
55
|
-
className="scale-75 data-[state=checked]:bg-primary"
|
|
56
|
-
/>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
<h4 className="font-semibold text-sm mb-1.5 line-clamp-1 pr-16">{note.title}</h4>
|
|
60
|
-
<p className="text-xs text-muted-foreground line-clamp-3 leading-relaxed">
|
|
61
|
-
{note.content}
|
|
62
|
-
</p>
|
|
63
|
-
<div className="mt-4 flex items-center justify-between">
|
|
64
|
-
<Badge variant="secondary" className="text-[10px] px-2 py-0.5 bg-primary/10 text-primary border-none font-medium">
|
|
65
|
-
NOTE
|
|
66
|
-
</Badge>
|
|
67
|
-
<span className="text-[10px] text-muted-foreground font-mono">
|
|
68
|
-
{new Date(note.updatedAt * 1000).toLocaleDateString()}
|
|
69
|
-
</span>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
))
|
|
73
|
-
)}
|
|
74
|
-
</div>
|
|
75
|
-
</ScrollArea>
|
|
76
|
-
</CardContent>
|
|
77
|
-
</Card>
|
|
78
|
-
);
|
|
79
|
-
};
|