@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,583 +0,0 @@
|
|
|
1
|
-
import { getDb } from "../storage/sqlite";
|
|
2
|
-
import { decryptApiKey } from "../storage/crypto";
|
|
3
|
-
import { logger } from "../utils/logger";
|
|
4
|
-
|
|
5
|
-
export interface VoiceConfig {
|
|
6
|
-
voiceEnabled: boolean;
|
|
7
|
-
ttsEnabled: boolean;
|
|
8
|
-
sttProvider: string | null;
|
|
9
|
-
ttsProvider: string | null;
|
|
10
|
-
ttsVoiceId: string | null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface AudioInput {
|
|
14
|
-
type: "buffer" | "url" | "base64";
|
|
15
|
-
data: Buffer | string;
|
|
16
|
-
mimeType?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface AudioOutput {
|
|
20
|
-
type: "buffer" | "base64";
|
|
21
|
-
data: Buffer | string;
|
|
22
|
-
mimeType: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const log = logger.child("voice");
|
|
26
|
-
|
|
27
|
-
class VoiceService {
|
|
28
|
-
private static instance: VoiceService;
|
|
29
|
-
|
|
30
|
-
private constructor() {}
|
|
31
|
-
|
|
32
|
-
static getInstance(): VoiceService {
|
|
33
|
-
if (!VoiceService.instance) {
|
|
34
|
-
VoiceService.instance = new VoiceService();
|
|
35
|
-
}
|
|
36
|
-
return VoiceService.instance;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getChannelVoiceConfig(channelId: string): VoiceConfig {
|
|
40
|
-
const db = getDb();
|
|
41
|
-
const result = db.query(`
|
|
42
|
-
SELECT voice_enabled, tts_enabled, stt_provider, tts_provider, tts_voice_id
|
|
43
|
-
FROM channels WHERE id = ?
|
|
44
|
-
`).get(channelId) as {
|
|
45
|
-
voice_enabled: number;
|
|
46
|
-
tts_enabled: number;
|
|
47
|
-
stt_provider: string | null;
|
|
48
|
-
tts_provider: string | null;
|
|
49
|
-
tts_voice_id: string | null;
|
|
50
|
-
} | undefined;
|
|
51
|
-
|
|
52
|
-
if (!result) {
|
|
53
|
-
return {
|
|
54
|
-
voiceEnabled: false,
|
|
55
|
-
ttsEnabled: false,
|
|
56
|
-
sttProvider: null,
|
|
57
|
-
ttsProvider: null,
|
|
58
|
-
ttsVoiceId: null,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
voiceEnabled: result.voice_enabled === 1,
|
|
64
|
-
ttsEnabled: result.tts_enabled === 1,
|
|
65
|
-
sttProvider: result.stt_provider,
|
|
66
|
-
ttsProvider: result.tts_provider,
|
|
67
|
-
ttsVoiceId: result.tts_voice_id,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async transcribe(audio: AudioInput, modelId: string): Promise<string> {
|
|
72
|
-
const isGroq = modelId.startsWith("whisper");
|
|
73
|
-
const isOpenAi = modelId === "whisper-1";
|
|
74
|
-
|
|
75
|
-
if (isGroq) {
|
|
76
|
-
return this.transcribeWithGroq(audio, modelId);
|
|
77
|
-
} else if (isOpenAi) {
|
|
78
|
-
return this.transcribeWithOpenAIWhisper(audio);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
log.warn(`Unknown STT provider ${modelId}, defaulting to Groq Whisper`);
|
|
82
|
-
return this.transcribeWithGroq(audio, "whisper-large-v3-turbo");
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
private async getProviderApiKey(providerId: string): Promise<string | null> {
|
|
86
|
-
const db = getDb();
|
|
87
|
-
const provider = db.query(`
|
|
88
|
-
SELECT api_key_encrypted, api_key_iv FROM providers WHERE id = ?
|
|
89
|
-
`).get(providerId) as { api_key_encrypted: string; api_key_iv: string } | undefined;
|
|
90
|
-
|
|
91
|
-
if (!provider?.api_key_encrypted) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
return await decryptApiKey(provider.api_key_encrypted, provider.api_key_iv);
|
|
97
|
-
} catch (error) {
|
|
98
|
-
log.error(`Failed to decrypt API key for provider ${providerId}: ${(error as Error).message}`);
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
private async transcribeWithGroq(audio: AudioInput, modelId: string): Promise<string> {
|
|
104
|
-
const key = await this.getProviderApiKey("groq") || process.env.GROQ_API_KEY;
|
|
105
|
-
if (!key) {
|
|
106
|
-
throw new Error("GROQ_API_KEY not configured. Configúrala en Proveedores o en las variables de entorno.");
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
let audioData: ArrayBuffer | Uint8Array;
|
|
110
|
-
|
|
111
|
-
if (audio.type === "buffer") {
|
|
112
|
-
audioData = new Uint8Array((audio.data as Buffer));
|
|
113
|
-
} else if (audio.type === "base64") {
|
|
114
|
-
const buf = Buffer.from(audio.data as string, "base64");
|
|
115
|
-
audioData = new Uint8Array(buf);
|
|
116
|
-
} else if (audio.type === "url") {
|
|
117
|
-
const response = await fetch(audio.data as string);
|
|
118
|
-
const ab = await response.arrayBuffer();
|
|
119
|
-
audioData = new Uint8Array(ab);
|
|
120
|
-
} else {
|
|
121
|
-
throw new Error("Invalid audio input type");
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const blob = new Blob([audioData as BlobPart], { type: audio.mimeType || "audio/ogg" });
|
|
125
|
-
const formData = new FormData();
|
|
126
|
-
formData.append("file", blob, "audio.ogg");
|
|
127
|
-
formData.append("model", modelId);
|
|
128
|
-
formData.append("response_format", "json");
|
|
129
|
-
formData.append("language", "es");
|
|
130
|
-
|
|
131
|
-
const result = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
|
|
132
|
-
method: "POST",
|
|
133
|
-
headers: {
|
|
134
|
-
"Authorization": `Bearer ${key}`,
|
|
135
|
-
},
|
|
136
|
-
body: formData,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
if (!result.ok) {
|
|
140
|
-
const error = await result.text();
|
|
141
|
-
throw new Error(`Groq Whisper transcription failed: ${error}`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const data = await result.json() as { text: string };
|
|
145
|
-
return data.text;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
private async transcribeWithOpenAIWhisper(audio: AudioInput): Promise<string> {
|
|
149
|
-
const key = await this.getProviderApiKey("openai") || process.env.OPENAI_API_KEY;
|
|
150
|
-
if (!key) {
|
|
151
|
-
throw new Error("OPENAI_API_KEY not configured. Configúrala en Proveedores o en las variables de entorno.");
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
let audioData: ArrayBuffer | Uint8Array;
|
|
155
|
-
|
|
156
|
-
if (audio.type === "buffer") {
|
|
157
|
-
audioData = new Uint8Array(audio.data as Buffer);
|
|
158
|
-
} else if (audio.type === "base64") {
|
|
159
|
-
const buf = Buffer.from(audio.data as string, "base64");
|
|
160
|
-
audioData = new Uint8Array(buf);
|
|
161
|
-
} else if (audio.type === "url") {
|
|
162
|
-
const response = await fetch(audio.data as string);
|
|
163
|
-
const ab = await response.arrayBuffer();
|
|
164
|
-
audioData = new Uint8Array(ab);
|
|
165
|
-
} else {
|
|
166
|
-
throw new Error("Invalid audio input type");
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const blob = new Blob([audioData as BlobPart], { type: audio.mimeType || "audio/webm" });
|
|
170
|
-
const formData = new FormData();
|
|
171
|
-
formData.append("file", blob, "audio.webm");
|
|
172
|
-
|
|
173
|
-
formData.append("model", "whisper-1");
|
|
174
|
-
formData.append("response_format", "json");
|
|
175
|
-
formData.append("language", "es");
|
|
176
|
-
|
|
177
|
-
const result = await fetch("https://api.openai.com/v1/audio/transcriptions", {
|
|
178
|
-
method: "POST",
|
|
179
|
-
headers: {
|
|
180
|
-
"Authorization": `Bearer ${key}`,
|
|
181
|
-
},
|
|
182
|
-
body: formData,
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
if (!result.ok) {
|
|
186
|
-
const error = await result.text();
|
|
187
|
-
throw new Error(`OpenAI Whisper transcription failed: ${error}`);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
const data = await result.json() as { text: string };
|
|
191
|
-
return data.text;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
async speak(text: string, modelId: string, voiceId?: string): Promise<AudioOutput> {
|
|
195
|
-
const isElevenLabs = modelId.startsWith("eleven");
|
|
196
|
-
const isOpenAI = modelId.startsWith("tts-") || modelId.startsWith("gpt-");
|
|
197
|
-
const isGemini = modelId.startsWith("gemini");
|
|
198
|
-
const isQwen = modelId.startsWith("qwen");
|
|
199
|
-
|
|
200
|
-
if (isElevenLabs) {
|
|
201
|
-
return this.speakWithElevenLabs(text, modelId, voiceId);
|
|
202
|
-
} else if (isOpenAI) {
|
|
203
|
-
return this.speakWithOpenAI(text, modelId, voiceId);
|
|
204
|
-
} else if (isGemini) {
|
|
205
|
-
return this.speakWithGemini(text, modelId, voiceId);
|
|
206
|
-
} else if (isQwen) {
|
|
207
|
-
return this.speakWithQwen(text, modelId, voiceId);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
log.warn(`Unknown TTS provider ${modelId}, defaulting to ElevenLabs Flash`);
|
|
211
|
-
return this.speakWithElevenLabs(text, "eleven_flash_v2_5", voiceId);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
private async speakWithElevenLabs(text: string, modelId: string, voiceId?: string): Promise<AudioOutput> {
|
|
215
|
-
const apiKey = await this.getProviderApiKey("elevenlabs");
|
|
216
|
-
const key = apiKey || process.env.ELEVENLABS_API_KEY;
|
|
217
|
-
|
|
218
|
-
if (!key) {
|
|
219
|
-
throw new Error("ELEVENLABS_API_KEY not configured");
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
const voice = voiceId || "21m00Tcm4TlvDq8ikWAM";
|
|
223
|
-
|
|
224
|
-
const response = await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${voice}`, {
|
|
225
|
-
method: "POST",
|
|
226
|
-
headers: {
|
|
227
|
-
"Content-Type": "application/json",
|
|
228
|
-
"xi-api-key": key,
|
|
229
|
-
},
|
|
230
|
-
body: JSON.stringify({
|
|
231
|
-
text,
|
|
232
|
-
model_id: modelId,
|
|
233
|
-
voice_settings: {
|
|
234
|
-
stability: 0.5,
|
|
235
|
-
similarity_boost: 0.75,
|
|
236
|
-
},
|
|
237
|
-
}),
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
if (!response.ok) {
|
|
241
|
-
const error = await response.text();
|
|
242
|
-
throw new Error(`ElevenLabs TTS failed: ${error}`);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const buffer = await response.arrayBuffer();
|
|
246
|
-
return {
|
|
247
|
-
type: "buffer",
|
|
248
|
-
data: Buffer.from(buffer),
|
|
249
|
-
mimeType: "audio/mpeg",
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
private async speakWithOpenAI(text: string, modelId: string = "gpt-4o-mini-tts", voiceId?: string): Promise<AudioOutput> {
|
|
254
|
-
const apiKey = await this.getProviderApiKey("openai-tts");
|
|
255
|
-
const key = apiKey || process.env.OPENAI_API_KEY;
|
|
256
|
-
|
|
257
|
-
if (!key) {
|
|
258
|
-
throw new Error("OPENAI_API_KEY not configured");
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
const voice = voiceId || "alloy";
|
|
262
|
-
|
|
263
|
-
const response = await fetch("https://api.openai.com/v1/audio/speech", {
|
|
264
|
-
method: "POST",
|
|
265
|
-
headers: {
|
|
266
|
-
"Content-Type": "application/json",
|
|
267
|
-
"Authorization": `Bearer ${key}`,
|
|
268
|
-
},
|
|
269
|
-
body: JSON.stringify({
|
|
270
|
-
model: modelId,
|
|
271
|
-
voice,
|
|
272
|
-
input: text,
|
|
273
|
-
response_format: "mp3",
|
|
274
|
-
}),
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
if (!response.ok) {
|
|
278
|
-
const error = await response.text();
|
|
279
|
-
throw new Error(`OpenAI TTS failed: ${error}`);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
const buffer = await response.arrayBuffer();
|
|
283
|
-
return {
|
|
284
|
-
type: "buffer",
|
|
285
|
-
data: Buffer.from(buffer),
|
|
286
|
-
mimeType: "audio/mpeg",
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
private async speakWithGemini(text: string, modelId: string, voiceId?: string): Promise<AudioOutput> {
|
|
291
|
-
const key = process.env.GEMINI_API_KEY;
|
|
292
|
-
|
|
293
|
-
if (!key) {
|
|
294
|
-
throw new Error("GEMINI_API_KEY not configured");
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const voiceName = voiceId || "Aoede";
|
|
298
|
-
|
|
299
|
-
const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${modelId}:generateContent?key=${key}`, {
|
|
300
|
-
method: "POST",
|
|
301
|
-
headers: {
|
|
302
|
-
"Content-Type": "application/json",
|
|
303
|
-
},
|
|
304
|
-
body: JSON.stringify({
|
|
305
|
-
contents: [{
|
|
306
|
-
parts: [{
|
|
307
|
-
text: `Genera audio de este texto: ${text}`,
|
|
308
|
-
}]
|
|
309
|
-
}],
|
|
310
|
-
generationConfig: {
|
|
311
|
-
responseModalities: ["AUDIO"],
|
|
312
|
-
speechConfig: {
|
|
313
|
-
languageCode: "es-ES",
|
|
314
|
-
voiceConfig: {
|
|
315
|
-
prebuiltVoiceConfig: {
|
|
316
|
-
voiceName,
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
}),
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
if (!response.ok) {
|
|
325
|
-
const error = await response.text();
|
|
326
|
-
throw new Error(`Gemini TTS failed: ${error}`);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
const data = await response.json() as { candidates?: Array<{ content?: { parts?: Array<{ inlineData?: { data: string } }> } }> };
|
|
330
|
-
const audioData = data.candidates?.[0]?.content?.parts?.[0]?.inlineData?.data;
|
|
331
|
-
|
|
332
|
-
if (!audioData) {
|
|
333
|
-
throw new Error("No audio returned from Gemini");
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const buffer = Buffer.from(audioData, "base64");
|
|
337
|
-
return {
|
|
338
|
-
type: "buffer",
|
|
339
|
-
data: buffer,
|
|
340
|
-
mimeType: "audio/mpeg",
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
private async speakWithQwen(text: string, modelId: string, voiceId?: string): Promise<AudioOutput> {
|
|
345
|
-
const key = process.env.DASHSCOPE_API_KEY;
|
|
346
|
-
|
|
347
|
-
if (!key) {
|
|
348
|
-
throw new Error("DASHSCOPE_API_KEY not configured");
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
const voice = voiceId || "ruoxi";
|
|
352
|
-
|
|
353
|
-
const response = await fetch("https://dashscope.aliyuncs.com/api/v1/services/audio/t2a/generation", {
|
|
354
|
-
method: "POST",
|
|
355
|
-
headers: {
|
|
356
|
-
"Content-Type": "application/json",
|
|
357
|
-
"Authorization": `Bearer ${key}`,
|
|
358
|
-
},
|
|
359
|
-
body: JSON.stringify({
|
|
360
|
-
model: modelId,
|
|
361
|
-
input: {
|
|
362
|
-
text,
|
|
363
|
-
},
|
|
364
|
-
parameters: {
|
|
365
|
-
voice,
|
|
366
|
-
format: "mp3",
|
|
367
|
-
},
|
|
368
|
-
}),
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
if (!response.ok) {
|
|
372
|
-
const error = await response.text();
|
|
373
|
-
throw new Error(`Qwen TTS failed: ${error}`);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
const data = await response.json() as { output?: { audio?: string } };
|
|
377
|
-
const audioData = data.output?.audio;
|
|
378
|
-
|
|
379
|
-
if (!audioData) {
|
|
380
|
-
throw new Error("No audio returned from Qwen");
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
const buffer = Buffer.from(audioData, "base64");
|
|
384
|
-
return {
|
|
385
|
-
type: "buffer",
|
|
386
|
-
data: buffer,
|
|
387
|
-
mimeType: "audio/mpeg",
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
getConfiguredVoiceProviders(): { groq: boolean; elevenlabs: boolean; openai: boolean; gemini: boolean; qwen: boolean } {
|
|
392
|
-
const db = getDb();
|
|
393
|
-
const hasDbKey = (providerId: string): boolean => {
|
|
394
|
-
const row = db.query(
|
|
395
|
-
`SELECT api_key_encrypted FROM providers WHERE id = ? AND api_key_encrypted IS NOT NULL AND api_key_encrypted != ''`
|
|
396
|
-
).get(providerId) as { api_key_encrypted: string } | undefined;
|
|
397
|
-
return !!row;
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
return {
|
|
401
|
-
groq: hasDbKey("groq") || !!(process.env.GROQ_API_KEY),
|
|
402
|
-
elevenlabs: hasDbKey("elevenlabs") || !!(process.env.ELEVENLABS_API_KEY),
|
|
403
|
-
openai: hasDbKey("openai") || !!(process.env.OPENAI_API_KEY),
|
|
404
|
-
gemini: hasDbKey("gemini") || !!(process.env.GEMINI_API_KEY),
|
|
405
|
-
qwen: hasDbKey("qwen") || !!(process.env.DASHSCOPE_API_KEY),
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
getOpenAIVoices(): Array<{ id: string; name: string }> {
|
|
410
|
-
return [
|
|
411
|
-
{ id: "alloy", name: "Alloy" },
|
|
412
|
-
{ id: "echo", name: "Echo" },
|
|
413
|
-
{ id: "fable", name: "Fable" },
|
|
414
|
-
{ id: "onyx", name: "Onyx" },
|
|
415
|
-
{ id: "nova", name: "Nova" },
|
|
416
|
-
{ id: "shimmer", name: "Shimmer" },
|
|
417
|
-
{ id: "ash", name: "Ash" },
|
|
418
|
-
{ id: "ballad", name: "Ballad" },
|
|
419
|
-
{ id: "coral", name: "Coral" },
|
|
420
|
-
{ id: "sage", name: "Sage" },
|
|
421
|
-
{ id: "verse", name: "Verse" },
|
|
422
|
-
];
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
getGeminiVoices(): Array<{ id: string; name: string }> {
|
|
426
|
-
return [
|
|
427
|
-
{ id: "Puck", name: "Puck" },
|
|
428
|
-
{ id: "Charon", name: "Charon" },
|
|
429
|
-
{ id: "Kore", name: "Kore" },
|
|
430
|
-
{ id: "Fenrir", name: "Fenrir" },
|
|
431
|
-
{ id: "Aoede", name: "Aoede" },
|
|
432
|
-
{ id: "Orbit", name: "Orbit" },
|
|
433
|
-
{ id: "Zephyr", name: "Zephyr" },
|
|
434
|
-
{ id: "Autonoe", name: "Autonoe" },
|
|
435
|
-
{ id: "Enceladus", name: "Enceladus" },
|
|
436
|
-
{ id: "Iapetus", name: "Iapetus" },
|
|
437
|
-
{ id: "Umbriel", name: "Umbriel" },
|
|
438
|
-
{ id: "Algieba", name: "Algieba" },
|
|
439
|
-
{ id: "Despina", name: "Despina" },
|
|
440
|
-
{ id: "Erinome", name: "Erinome" },
|
|
441
|
-
{ id: "Laomedeia", name: "Laomedeia" },
|
|
442
|
-
{ id: "Achernar", name: "Achernar" },
|
|
443
|
-
{ id: "Rasalgethi", name: "Rasalgethi" },
|
|
444
|
-
{ id: "Schedar", name: "Schedar" },
|
|
445
|
-
{ id: "Sulafat", name: "Sulafat" },
|
|
446
|
-
{ id: "Vindemiatrix", name: "Vindemiatrix" },
|
|
447
|
-
{ id: "Zubenelgenubi", name: "Zubenelgenubi" },
|
|
448
|
-
{ id: "Pulcherrima", name: "Pulcherrima" },
|
|
449
|
-
{ id: "Achird", name: "Achird" },
|
|
450
|
-
{ id: "Zubeneschamali", name: "Zubeneschamali" },
|
|
451
|
-
{ id: "Sadachbia", name: "Sadachbia" },
|
|
452
|
-
{ id: "Sadaltager", name: "Sadaltager" },
|
|
453
|
-
{ id: "Sheratan", name: "Sheratan" },
|
|
454
|
-
];
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
getQwenVoices(): Array<{ id: string; name: string }> {
|
|
458
|
-
return [
|
|
459
|
-
{ id: "ruoxi", name: "Ruoxi (F, Chinese)" },
|
|
460
|
-
{ id: "longhua", name: "Longhua (M, Chinese)" },
|
|
461
|
-
{ id: "lingli", name: "Lingli (F, Chinese)" },
|
|
462
|
-
{ id: "zhiyan", name: "Zhiyan (F, Chinese)" },
|
|
463
|
-
{ id: "aicheng", name: "Aicheng (F, Chinese)" },
|
|
464
|
-
{ id: "aida", name: "Aida (F, Chinese)" },
|
|
465
|
-
{ id: "yucheng", name: "Yucheng (M, Chinese)" },
|
|
466
|
-
{ id: "yijia", name: "Yijia (F, Chinese)" },
|
|
467
|
-
{ id: "yinan", name: "Yinan (M, Chinese)" },
|
|
468
|
-
{ id: "sijia", name: "Sijia (F, Chinese)" },
|
|
469
|
-
{ id: "sicheng", name: "Sicheng (M, Chinese)" },
|
|
470
|
-
{ id: "siqi", name: "Siqi (F, Chinese)" },
|
|
471
|
-
{ id: "aixia", name: "Aixia (F, Chinese)" },
|
|
472
|
-
];
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
async getElevenLabsVoices(): Promise<Array<{ id: string; name: string; category: string }>> {
|
|
476
|
-
const apiKey = await this.getProviderApiKey("elevenlabs");
|
|
477
|
-
const key = apiKey || process.env.ELEVENLABS_API_KEY;
|
|
478
|
-
|
|
479
|
-
if (!key) {
|
|
480
|
-
throw new Error("ELEVENLABS_API_KEY not configured");
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
const response = await fetch("https://api.elevenlabs.io/v1/voices", {
|
|
484
|
-
headers: {
|
|
485
|
-
"xi-api-key": key,
|
|
486
|
-
},
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
if (!response.ok) {
|
|
490
|
-
const error = await response.text();
|
|
491
|
-
throw new Error(`Failed to fetch ElevenLabs voices: ${error}`);
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
const data = await response.json() as { voices: Array<{ voice_id: string; name: string; category: string }> };
|
|
495
|
-
return data.voices.map(v => ({
|
|
496
|
-
id: v.voice_id,
|
|
497
|
-
name: v.name,
|
|
498
|
-
category: v.category,
|
|
499
|
-
}));
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
normalizeAudioFromChannel(channelType: string, audioData: unknown): AudioInput {
|
|
503
|
-
switch (channelType) {
|
|
504
|
-
case "telegram":
|
|
505
|
-
return this.normalizeTelegramAudio(audioData);
|
|
506
|
-
case "discord":
|
|
507
|
-
return this.normalizeDiscordAudio(audioData);
|
|
508
|
-
case "whatsapp":
|
|
509
|
-
return this.normalizeWhatsAppAudio(audioData);
|
|
510
|
-
case "slack":
|
|
511
|
-
return this.normalizeSlackAudio(audioData);
|
|
512
|
-
case "webchat":
|
|
513
|
-
return this.normalizeWebChatAudio(audioData);
|
|
514
|
-
default:
|
|
515
|
-
throw new Error(`Unknown channel type: ${channelType}`);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
private normalizeTelegramAudio(audioData: unknown): AudioInput {
|
|
520
|
-
const data = audioData as { fileId?: string; buffer?: Buffer; url?: string };
|
|
521
|
-
|
|
522
|
-
if (data.buffer) {
|
|
523
|
-
return { type: "buffer", data: data.buffer, mimeType: "audio/ogg" };
|
|
524
|
-
}
|
|
525
|
-
if (data.url) {
|
|
526
|
-
return { type: "url", data: data.url, mimeType: "audio/ogg" };
|
|
527
|
-
}
|
|
528
|
-
throw new Error("Telegram audio missing buffer or URL");
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
private normalizeDiscordAudio(audioData: unknown): AudioInput {
|
|
532
|
-
const data = audioData as { buffer?: Buffer; url?: string; mimeType?: string };
|
|
533
|
-
|
|
534
|
-
if (data.buffer) {
|
|
535
|
-
return { type: "buffer", data: data.buffer, mimeType: data.mimeType || "audio/webm" };
|
|
536
|
-
}
|
|
537
|
-
if (data.url) {
|
|
538
|
-
return { type: "url", data: data.url, mimeType: data.mimeType || "audio/webm" };
|
|
539
|
-
}
|
|
540
|
-
throw new Error("Discord audio missing buffer or URL");
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
private normalizeWhatsAppAudio(audioData: unknown): AudioInput {
|
|
544
|
-
const data = audioData as { mediaId?: string; buffer?: Buffer; url?: string };
|
|
545
|
-
|
|
546
|
-
if (data.buffer) {
|
|
547
|
-
return { type: "buffer", data: data.buffer, mimeType: "audio/ogg" };
|
|
548
|
-
}
|
|
549
|
-
if (data.url) {
|
|
550
|
-
return { type: "url", data: data.url, mimeType: "audio/ogg" };
|
|
551
|
-
}
|
|
552
|
-
if (data.mediaId) {
|
|
553
|
-
return { type: "url", data: `https://wa.me/${data.mediaId}`, mimeType: "audio/ogg" };
|
|
554
|
-
}
|
|
555
|
-
throw new Error("WhatsApp audio missing buffer, URL, or mediaId");
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
private normalizeSlackAudio(audioData: unknown): AudioInput {
|
|
559
|
-
const data = audioData as { buffer?: Buffer; url?: string; mimeType?: string };
|
|
560
|
-
|
|
561
|
-
if (data.buffer) {
|
|
562
|
-
return { type: "buffer", data: data.buffer, mimeType: data.mimeType || "audio/webm" };
|
|
563
|
-
}
|
|
564
|
-
if (data.url) {
|
|
565
|
-
return { type: "url", data: data.url, mimeType: data.mimeType || "audio/webm" };
|
|
566
|
-
}
|
|
567
|
-
throw new Error("Slack audio missing buffer or URL");
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
private normalizeWebChatAudio(audioData: unknown): AudioInput {
|
|
571
|
-
const data = audioData as { base64?: string; buffer?: Buffer };
|
|
572
|
-
|
|
573
|
-
if (data.base64) {
|
|
574
|
-
return { type: "base64", data: data.base64, mimeType: "audio/webm" };
|
|
575
|
-
}
|
|
576
|
-
if (data.buffer) {
|
|
577
|
-
return { type: "buffer", data: data.buffer, mimeType: "audio/webm" };
|
|
578
|
-
}
|
|
579
|
-
throw new Error("WebChat audio missing base64 or buffer");
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
export const voiceService = VoiceService.getInstance();
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Hive UI
|
|
2
|
-
|
|
3
|
-
Dashboard and interaction interface for **Hive**, the personal AI agent runtime.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Hive UI provides a modern, interactive environment to manage your AI agents, monitor real-time execution flows, and track long-running projects. Built with performance and user experience in mind, it leverages the AG-UI protocol for rich, visual agent-user interactions.
|
|
8
|
-
|
|
9
|
-
## Features
|
|
10
|
-
|
|
11
|
-
- **Agent Management**: View status, logs, and configuration for all your local and remote agents.
|
|
12
|
-
- **Real-time Canvas**: Interactive visualization of agent execution steps using the AG-UI protocol.
|
|
13
|
-
- **Project Tracking**: Dedicated views for multi-step tasks, including progress bars and step-by-step history.
|
|
14
|
-
- **MCP Integration**: Manage Model Context Protocol servers and their exposed tools.
|
|
15
|
-
- **Theme Support**: Seamless dark and light mode transitions.
|
|
16
|
-
|
|
17
|
-
## Tech Stack
|
|
18
|
-
|
|
19
|
-
- **Framework**: [Vite](https://vitejs.dev/) + [React](https://react.dev/)
|
|
20
|
-
- **Styling**: [Tailwind CSS](https://tailwindcss.com/) + [shadcn/ui](https://ui.shadcn.com/)
|
|
21
|
-
- **State Management**: [Zustand](https://docs.pmnd.rs/zustand/getting-started/introduction)
|
|
22
|
-
- **Data Fetching**: [React Query](https://tanstack.com/query/latest)
|
|
23
|
-
- **Icons**: [Lucide React](https://lucide.dev/)
|
|
24
|
-
|
|
25
|
-
## Getting Started
|
|
26
|
-
|
|
27
|
-
### Prerequisites
|
|
28
|
-
|
|
29
|
-
- Node.js (v18+)
|
|
30
|
-
- Local instance of **Hive Core** running
|
|
31
|
-
|
|
32
|
-
### Installation
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Install dependencies
|
|
36
|
-
npm install
|
|
37
|
-
|
|
38
|
-
# Start the development server
|
|
39
|
-
npm run dev
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The UI will be available at `http://localhost:5173`. It connects to the Hive Gateway at `http://localhost:18790` by default.
|
|
43
|
-
|
|
44
|
-
## Deployment
|
|
45
|
-
|
|
46
|
-
To build the project for production:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
npm run build
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
The output will be in the `dist/` directory, which can be served by the Hive Gateway or any static host.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "default",
|
|
4
|
-
"rsc": false,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "tailwind.config.ts",
|
|
8
|
-
"css": "src/index.css",
|
|
9
|
-
"baseColor": "slate",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"utils": "@/lib/utils",
|
|
16
|
-
"ui": "@/components/ui",
|
|
17
|
-
"lib": "@/lib",
|
|
18
|
-
"hooks": "@/hooks"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<!-- TODO: Set the document title to the name of your application -->
|
|
7
|
-
<title>Hive</title>
|
|
8
|
-
<meta name="description" content="Lovable Generated Project">
|
|
9
|
-
<meta name="author" content="Lovable" />
|
|
10
|
-
|
|
11
|
-
<!-- TODO: Update og:title to match your application name -->
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<meta property="og:type" content="website" />
|
|
15
|
-
<meta property="og:image" content="https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/f1160d3a-51b5-4069-aabb-bef1187d22ef/id-preview-be64b654--a3cb4b78-5d44-48e2-a6da-7ac7372bf684.lovable.app-1771854083721.png">
|
|
16
|
-
|
|
17
|
-
<meta name="twitter:card" content="summary_large_image" />
|
|
18
|
-
<meta name="twitter:site" content="@Lovable" />
|
|
19
|
-
<meta name="twitter:image" content="https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/f1160d3a-51b5-4069-aabb-bef1187d22ef/id-preview-be64b654--a3cb4b78-5d44-48e2-a6da-7ac7372bf684.lovable.app-1771854083721.png">
|
|
20
|
-
<meta property="og:title" content="Hive">
|
|
21
|
-
<meta name="twitter:title" content="Hive">
|
|
22
|
-
<meta property="og:description" content="Lovable Generated Project">
|
|
23
|
-
<meta name="twitter:description" content="Lovable Generated Project">
|
|
24
|
-
</head>
|
|
25
|
-
|
|
26
|
-
<body>
|
|
27
|
-
<div id="root"></div>
|
|
28
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
29
|
-
</body>
|
|
30
|
-
</html>
|