@ranker/raxflow 0.2.0
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/dashboard/index.html +420 -0
- package/dist/benchmark.d.ts.map +1 -0
- package/dist/benchmark.js +123 -0
- package/dist/benchmark.js.map +1 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +141 -0
- package/dist/bin.js.map +1 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +22 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/bridge-adapter-templates.d.ts.map +1 -0
- package/dist/bridge-adapter-templates.js +185 -0
- package/dist/bridge-adapter-templates.js.map +1 -0
- package/dist/bridge-test.d.ts.map +1 -0
- package/dist/bridge-test.js +89 -0
- package/dist/bridge-test.js.map +1 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +49 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +70 -0
- package/dist/doctor.js.map +1 -0
- package/dist/evolve.d.ts.map +1 -0
- package/dist/evolve.js +48 -0
- package/dist/evolve.js.map +1 -0
- package/dist/host-init-templates.d.ts.map +1 -0
- package/dist/host-init-templates.js +119 -0
- package/dist/host-init-templates.js.map +1 -0
- package/dist/hub/__tests__/commands.test.d.ts.map +1 -0
- package/dist/hub/__tests__/commands.test.js +72 -0
- package/dist/hub/__tests__/commands.test.js.map +1 -0
- package/dist/hub/__tests__/history.test.d.ts.map +1 -0
- package/dist/hub/__tests__/history.test.js +119 -0
- package/dist/hub/__tests__/history.test.js.map +1 -0
- package/dist/hub/__tests__/parser.test.d.ts.map +1 -0
- package/dist/hub/__tests__/parser.test.js +92 -0
- package/dist/hub/__tests__/parser.test.js.map +1 -0
- package/dist/hub/chat/ChatApp.d.ts +2 -0
- package/dist/hub/chat/ChatApp.d.ts.map +1 -0
- package/dist/hub/chat/ChatApp.js +146 -0
- package/dist/hub/chat/ChatApp.js.map +1 -0
- package/dist/hub/chat/components/ChatInput.d.ts +9 -0
- package/dist/hub/chat/components/ChatInput.d.ts.map +1 -0
- package/dist/hub/chat/components/ChatInput.js +19 -0
- package/dist/hub/chat/components/ChatInput.js.map +1 -0
- package/dist/hub/chat/components/MessageList.d.ts +7 -0
- package/dist/hub/chat/components/MessageList.d.ts.map +1 -0
- package/dist/hub/chat/components/MessageList.js +6 -0
- package/dist/hub/chat/components/MessageList.js.map +1 -0
- package/dist/hub/chat/context.d.ts.map +1 -0
- package/dist/hub/chat/context.js +42 -0
- package/dist/hub/chat/context.js.map +1 -0
- package/dist/hub/chat/hooks/useChatHistory.d.ts +7 -0
- package/dist/hub/chat/hooks/useChatHistory.d.ts.map +1 -0
- package/dist/hub/chat/hooks/useChatHistory.js +31 -0
- package/dist/hub/chat/hooks/useChatHistory.js.map +1 -0
- package/dist/hub/chat/index.d.ts.map +1 -0
- package/dist/hub/chat/index.js +7 -0
- package/dist/hub/chat/index.js.map +1 -0
- package/dist/hub/chat/intent-parser.d.ts.map +1 -0
- package/dist/hub/chat/intent-parser.js +48 -0
- package/dist/hub/chat/intent-parser.js.map +1 -0
- package/dist/hub/chat/types.d.ts.map +1 -0
- package/dist/hub/chat/types.js +2 -0
- package/dist/hub/chat/types.js.map +1 -0
- package/dist/hub/commands/agents.d.ts.map +1 -0
- package/dist/hub/commands/agents.js +36 -0
- package/dist/hub/commands/agents.js.map +1 -0
- package/dist/hub/commands/index.d.ts.map +1 -0
- package/dist/hub/commands/index.js +123 -0
- package/dist/hub/commands/index.js.map +1 -0
- package/dist/hub/commands/logs.d.ts.map +1 -0
- package/dist/hub/commands/logs.js +53 -0
- package/dist/hub/commands/logs.js.map +1 -0
- package/dist/hub/commands/memory.d.ts.map +1 -0
- package/dist/hub/commands/memory.js +40 -0
- package/dist/hub/commands/memory.js.map +1 -0
- package/dist/hub/commands/metrics.d.ts.map +1 -0
- package/dist/hub/commands/metrics.js +35 -0
- package/dist/hub/commands/metrics.js.map +1 -0
- package/dist/hub/commands/providers.d.ts.map +1 -0
- package/dist/hub/commands/providers.js +26 -0
- package/dist/hub/commands/providers.js.map +1 -0
- package/dist/hub/commands/run.d.ts.map +1 -0
- package/dist/hub/commands/run.js +31 -0
- package/dist/hub/commands/run.js.map +1 -0
- package/dist/hub/commands/status.d.ts.map +1 -0
- package/dist/hub/commands/status.js +61 -0
- package/dist/hub/commands/status.js.map +1 -0
- package/dist/hub/commands/workflows.d.ts.map +1 -0
- package/dist/hub/commands/workflows.js +45 -0
- package/dist/hub/commands/workflows.js.map +1 -0
- package/dist/hub/config-loader.d.ts.map +1 -0
- package/dist/hub/config-loader.js +27 -0
- package/dist/hub/config-loader.js.map +1 -0
- package/dist/hub/event-listener.d.ts +6 -0
- package/dist/hub/event-listener.d.ts.map +1 -0
- package/dist/hub/event-listener.js +12 -0
- package/dist/hub/event-listener.js.map +1 -0
- package/dist/hub/history.d.ts.map +1 -0
- package/dist/hub/history.js +59 -0
- package/dist/hub/history.js.map +1 -0
- package/dist/hub/index.d.ts.map +1 -0
- package/dist/hub/index.js +114 -0
- package/dist/hub/index.js.map +1 -0
- package/dist/hub/parser.d.ts.map +1 -0
- package/dist/hub/parser.js +98 -0
- package/dist/hub/parser.js.map +1 -0
- package/dist/hub/styles/borders.d.ts.map +1 -0
- package/dist/hub/styles/borders.js +64 -0
- package/dist/hub/styles/borders.js.map +1 -0
- package/dist/hub/styles/colors.d.ts.map +1 -0
- package/dist/hub/styles/colors.js +115 -0
- package/dist/hub/styles/colors.js.map +1 -0
- package/dist/hub/styles/typography.d.ts.map +1 -0
- package/dist/hub/styles/typography.js +60 -0
- package/dist/hub/styles/typography.js.map +1 -0
- package/dist/hub/tui/App.d.ts +2 -0
- package/dist/hub/tui/App.d.ts.map +1 -0
- package/dist/hub/tui/App.js +53 -0
- package/dist/hub/tui/App.js.map +1 -0
- package/dist/hub/tui/components/AgentQueue.d.ts +6 -0
- package/dist/hub/tui/components/AgentQueue.d.ts.map +1 -0
- package/dist/hub/tui/components/AgentQueue.js +20 -0
- package/dist/hub/tui/components/AgentQueue.js.map +1 -0
- package/dist/hub/tui/components/DAGPanel.d.ts +16 -0
- package/dist/hub/tui/components/DAGPanel.d.ts.map +1 -0
- package/dist/hub/tui/components/DAGPanel.js +51 -0
- package/dist/hub/tui/components/DAGPanel.js.map +1 -0
- package/dist/hub/tui/components/Header.d.ts +7 -0
- package/dist/hub/tui/components/Header.d.ts.map +1 -0
- package/dist/hub/tui/components/Header.js +17 -0
- package/dist/hub/tui/components/Header.js.map +1 -0
- package/dist/hub/tui/components/LogsPanel.d.ts +6 -0
- package/dist/hub/tui/components/LogsPanel.d.ts.map +1 -0
- package/dist/hub/tui/components/LogsPanel.js +26 -0
- package/dist/hub/tui/components/LogsPanel.js.map +1 -0
- package/dist/hub/tui/components/StatusBar.d.ts +8 -0
- package/dist/hub/tui/components/StatusBar.d.ts.map +1 -0
- package/dist/hub/tui/components/StatusBar.js +7 -0
- package/dist/hub/tui/components/StatusBar.js.map +1 -0
- package/dist/hub/tui/hooks/useEvents.d.ts +2 -0
- package/dist/hub/tui/hooks/useEvents.d.ts.map +1 -0
- package/dist/hub/tui/hooks/useEvents.js +13 -0
- package/dist/hub/tui/hooks/useEvents.js.map +1 -0
- package/dist/hub/tui/index.d.ts.map +1 -0
- package/dist/hub/tui/index.js +7 -0
- package/dist/hub/tui/index.js.map +1 -0
- package/dist/hub/tui/types.d.ts.map +1 -0
- package/dist/hub/tui/types.js +2 -0
- package/dist/hub/tui/types.js.map +1 -0
- package/dist/hub/types.d.ts.map +1 -0
- package/dist/hub/types.js +2 -0
- package/dist/hub/types.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/init-host.d.ts.map +1 -0
- package/dist/init-host.js +232 -0
- package/dist/init-host.js.map +1 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +99 -0
- package/dist/install.js.map +1 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +238 -0
- package/dist/run.js.map +1 -0
- package/dist/setup/components/ApiKeyInput.d.ts +25 -0
- package/dist/setup/components/ApiKeyInput.d.ts.map +1 -0
- package/dist/setup/components/ApiKeyInput.js +54 -0
- package/dist/setup/components/ApiKeyInput.js.map +1 -0
- package/dist/setup/components/AsciiBanner.d.ts +22 -0
- package/dist/setup/components/AsciiBanner.d.ts.map +1 -0
- package/dist/setup/components/AsciiBanner.js +55 -0
- package/dist/setup/components/AsciiBanner.js.map +1 -0
- package/dist/setup/components/CliDetector.d.ts +17 -0
- package/dist/setup/components/CliDetector.d.ts.map +1 -0
- package/dist/setup/components/CliDetector.js +79 -0
- package/dist/setup/components/CliDetector.js.map +1 -0
- package/dist/setup/components/ModeSelector.d.ts +8 -0
- package/dist/setup/components/ModeSelector.d.ts.map +1 -0
- package/dist/setup/components/ModeSelector.js +76 -0
- package/dist/setup/components/ModeSelector.js.map +1 -0
- package/dist/setup/components/ProviderSelector.d.ts +18 -0
- package/dist/setup/components/ProviderSelector.d.ts.map +1 -0
- package/dist/setup/components/ProviderSelector.js +97 -0
- package/dist/setup/components/ProviderSelector.js.map +1 -0
- package/dist/setup/components/SetupWizard.d.ts +2 -0
- package/dist/setup/components/SetupWizard.d.ts.map +1 -0
- package/dist/setup/components/SetupWizard.js +212 -0
- package/dist/setup/components/SetupWizard.js.map +1 -0
- package/dist/setup/components/StepIndicator.d.ts +13 -0
- package/dist/setup/components/StepIndicator.d.ts.map +1 -0
- package/dist/setup/components/StepIndicator.js +18 -0
- package/dist/setup/components/StepIndicator.js.map +1 -0
- package/dist/setup/components/SuccessScreen.d.ts +18 -0
- package/dist/setup/components/SuccessScreen.d.ts.map +1 -0
- package/dist/setup/components/SuccessScreen.js +38 -0
- package/dist/setup/components/SuccessScreen.js.map +1 -0
- package/dist/setup/index.d.ts +12 -0
- package/dist/setup/index.d.ts.map +1 -0
- package/dist/setup/index.js +29 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/setup/utils/cli-detection.d.ts +12 -0
- package/dist/setup/utils/cli-detection.d.ts.map +1 -0
- package/dist/setup/utils/cli-detection.js +83 -0
- package/dist/setup/utils/cli-detection.js.map +1 -0
- package/dist/setup/utils/config-writer.d.ts +43 -0
- package/dist/setup/utils/config-writer.d.ts.map +1 -0
- package/dist/setup/utils/config-writer.js +180 -0
- package/dist/setup/utils/config-writer.js.map +1 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +12 -0
- package/dist/styles.js.map +1 -0
- package/dist/tui/App.d.ts +3 -0
- package/dist/tui/App.d.ts.map +1 -0
- package/dist/tui/App.js +131 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/components/AgentStateIcon.d.ts +18 -0
- package/dist/tui/components/AgentStateIcon.d.ts.map +1 -0
- package/dist/tui/components/AgentStateIcon.js +57 -0
- package/dist/tui/components/AgentStateIcon.js.map +1 -0
- package/dist/tui/components/AnimatedBranch.d.ts +39 -0
- package/dist/tui/components/AnimatedBranch.d.ts.map +1 -0
- package/dist/tui/components/AnimatedBranch.js +64 -0
- package/dist/tui/components/AnimatedBranch.js.map +1 -0
- package/dist/tui/components/ChatPanel.d.ts +16 -0
- package/dist/tui/components/ChatPanel.d.ts.map +1 -0
- package/dist/tui/components/ChatPanel.js +50 -0
- package/dist/tui/components/ChatPanel.js.map +1 -0
- package/dist/tui/components/DAGPanel.d.ts +36 -0
- package/dist/tui/components/DAGPanel.d.ts.map +1 -0
- package/dist/tui/components/DAGPanel.js +51 -0
- package/dist/tui/components/DAGPanel.js.map +1 -0
- package/dist/tui/components/ExecutionTimeline.d.ts +34 -0
- package/dist/tui/components/ExecutionTimeline.d.ts.map +1 -0
- package/dist/tui/components/ExecutionTimeline.js +67 -0
- package/dist/tui/components/ExecutionTimeline.js.map +1 -0
- package/dist/tui/components/Header.d.ts +12 -0
- package/dist/tui/components/Header.d.ts.map +1 -0
- package/dist/tui/components/Header.js +32 -0
- package/dist/tui/components/Header.js.map +1 -0
- package/dist/tui/components/HelpOverlay.d.ts +7 -0
- package/dist/tui/components/HelpOverlay.d.ts.map +1 -0
- package/dist/tui/components/HelpOverlay.js +60 -0
- package/dist/tui/components/HelpOverlay.js.map +1 -0
- package/dist/tui/components/InputBar.d.ts +10 -0
- package/dist/tui/components/InputBar.d.ts.map +1 -0
- package/dist/tui/components/InputBar.js +21 -0
- package/dist/tui/components/InputBar.js.map +1 -0
- package/dist/tui/components/LogsPanel.d.ts +9 -0
- package/dist/tui/components/LogsPanel.d.ts.map +1 -0
- package/dist/tui/components/LogsPanel.js +56 -0
- package/dist/tui/components/LogsPanel.js.map +1 -0
- package/dist/tui/components/MemoryPanel.d.ts +21 -0
- package/dist/tui/components/MemoryPanel.d.ts.map +1 -0
- package/dist/tui/components/MemoryPanel.js +51 -0
- package/dist/tui/components/MemoryPanel.js.map +1 -0
- package/dist/tui/components/MetricsPanel.d.ts +18 -0
- package/dist/tui/components/MetricsPanel.d.ts.map +1 -0
- package/dist/tui/components/MetricsPanel.js +27 -0
- package/dist/tui/components/MetricsPanel.js.map +1 -0
- package/dist/tui/components/StatusPanel.d.ts +23 -0
- package/dist/tui/components/StatusPanel.d.ts.map +1 -0
- package/dist/tui/components/StatusPanel.js +23 -0
- package/dist/tui/components/StatusPanel.js.map +1 -0
- package/dist/tui/components/TaskTree.d.ts +28 -0
- package/dist/tui/components/TaskTree.d.ts.map +1 -0
- package/dist/tui/components/TaskTree.js +29 -0
- package/dist/tui/components/TaskTree.js.map +1 -0
- package/dist/tui/components/animations/ProgressBar.d.ts +39 -0
- package/dist/tui/components/animations/ProgressBar.d.ts.map +1 -0
- package/dist/tui/components/animations/ProgressBar.js +39 -0
- package/dist/tui/components/animations/ProgressBar.js.map +1 -0
- package/dist/tui/components/animations/Pulse.d.ts +17 -0
- package/dist/tui/components/animations/Pulse.d.ts.map +1 -0
- package/dist/tui/components/animations/Pulse.js +47 -0
- package/dist/tui/components/animations/Pulse.js.map +1 -0
- package/dist/tui/components/animations/Spinner.d.ts +13 -0
- package/dist/tui/components/animations/Spinner.d.ts.map +1 -0
- package/dist/tui/components/animations/Spinner.js +36 -0
- package/dist/tui/components/animations/Spinner.js.map +1 -0
- package/dist/tui/components/animations/StatusAnimator.d.ts +27 -0
- package/dist/tui/components/animations/StatusAnimator.d.ts.map +1 -0
- package/dist/tui/components/animations/StatusAnimator.js +85 -0
- package/dist/tui/components/animations/StatusAnimator.js.map +1 -0
- package/dist/tui/components/animations/TypingEffect.d.ts +26 -0
- package/dist/tui/components/animations/TypingEffect.d.ts.map +1 -0
- package/dist/tui/components/animations/TypingEffect.js +59 -0
- package/dist/tui/components/animations/TypingEffect.js.map +1 -0
- package/dist/tui/components/animations/index.d.ts +8 -0
- package/dist/tui/components/animations/index.d.ts.map +1 -0
- package/dist/tui/components/animations/index.js +6 -0
- package/dist/tui/components/animations/index.js.map +1 -0
- package/dist/tui/hooks/useAnimation.d.ts +42 -0
- package/dist/tui/hooks/useAnimation.d.ts.map +1 -0
- package/dist/tui/hooks/useAnimation.js +212 -0
- package/dist/tui/hooks/useAnimation.js.map +1 -0
- package/dist/tui/hooks/useAppState.d.ts +65 -0
- package/dist/tui/hooks/useAppState.d.ts.map +1 -0
- package/dist/tui/hooks/useAppState.js +293 -0
- package/dist/tui/hooks/useAppState.js.map +1 -0
- package/dist/tui/index.d.ts +3 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/services/orchestrator.d.ts +16 -0
- package/dist/tui/services/orchestrator.d.ts.map +1 -0
- package/dist/tui/services/orchestrator.js +152 -0
- package/dist/tui/services/orchestrator.js.map +1 -0
- package/dist/tui/styles/borders.d.ts +31 -0
- package/dist/tui/styles/borders.d.ts.map +1 -0
- package/dist/tui/styles/borders.js +47 -0
- package/dist/tui/styles/borders.js.map +1 -0
- package/dist/tui/styles/colors.d.ts +18 -0
- package/dist/tui/styles/colors.d.ts.map +1 -0
- package/dist/tui/styles/colors.js +18 -0
- package/dist/tui/styles/colors.js.map +1 -0
- package/dist/tui/styles/index.d.ts +6 -0
- package/dist/tui/styles/index.d.ts.map +1 -0
- package/dist/tui/styles/index.js +6 -0
- package/dist/tui/styles/index.js.map +1 -0
- package/dist/tui/styles/indicators.d.ts +67 -0
- package/dist/tui/styles/indicators.d.ts.map +1 -0
- package/dist/tui/styles/indicators.js +42 -0
- package/dist/tui/styles/indicators.js.map +1 -0
- package/dist/tui/styles/layout.d.ts +21 -0
- package/dist/tui/styles/layout.d.ts.map +1 -0
- package/dist/tui/styles/layout.js +42 -0
- package/dist/tui/styles/layout.js.map +1 -0
- package/dist/tui/styles/providers.d.ts +77 -0
- package/dist/tui/styles/providers.d.ts.map +1 -0
- package/dist/tui/styles/providers.js +31 -0
- package/dist/tui/styles/providers.js.map +1 -0
- package/dist/tui/utils/animation.d.ts +44 -0
- package/dist/tui/utils/animation.d.ts.map +1 -0
- package/dist/tui/utils/animation.js +107 -0
- package/dist/tui/utils/animation.js.map +1 -0
- package/dist/vendor-manifests.d.ts.map +1 -0
- package/dist/vendor-manifests.js +94 -0
- package/dist/vendor-manifests.js.map +1 -0
- package/dist/ws-relay.d.ts +12 -0
- package/dist/ws-relay.d.ts.map +1 -0
- package/dist/ws-relay.js +148 -0
- package/dist/ws-relay.js.map +1 -0
- package/package.json +34 -0
- package/src/benchmark.ts +156 -0
- package/src/bin.ts +156 -0
- package/src/bootstrap.ts +36 -0
- package/src/bridge-adapter-templates.ts +181 -0
- package/src/bridge-test.ts +107 -0
- package/src/dashboard.ts +51 -0
- package/src/doctor.ts +92 -0
- package/src/evolve.ts +74 -0
- package/src/host-init-templates.ts +134 -0
- package/src/hub/__tests__/commands.test.ts +84 -0
- package/src/hub/__tests__/history.test.ts +137 -0
- package/src/hub/__tests__/parser.test.ts +105 -0
- package/src/hub/commands/agents.ts +53 -0
- package/src/hub/commands/index.ts +140 -0
- package/src/hub/commands/logs.ts +70 -0
- package/src/hub/commands/memory.ts +47 -0
- package/src/hub/commands/metrics.ts +49 -0
- package/src/hub/commands/providers.ts +39 -0
- package/src/hub/commands/run.ts +37 -0
- package/src/hub/commands/status.ts +69 -0
- package/src/hub/commands/workflows.ts +64 -0
- package/src/hub/config-loader.ts +37 -0
- package/src/hub/event-listener.ts +17 -0
- package/src/hub/history.ts +66 -0
- package/src/hub/index.ts +132 -0
- package/src/hub/parser.ts +107 -0
- package/src/hub/styles/borders.ts +74 -0
- package/src/hub/styles/colors.ts +129 -0
- package/src/hub/styles/typography.ts +68 -0
- package/src/hub/types.ts +31 -0
- package/src/index.ts +10 -0
- package/src/init-host.ts +285 -0
- package/src/install.ts +118 -0
- package/src/run.ts +317 -0
- package/src/setup/components/ApiKeyInput.tsx +158 -0
- package/src/setup/components/AsciiBanner.tsx +125 -0
- package/src/setup/components/CliDetector.tsx +230 -0
- package/src/setup/components/ModeSelector.tsx +137 -0
- package/src/setup/components/ProviderSelector.tsx +174 -0
- package/src/setup/components/SetupWizard.tsx +368 -0
- package/src/setup/components/StepIndicator.tsx +74 -0
- package/src/setup/components/SuccessScreen.tsx +229 -0
- package/src/setup/index.ts +34 -0
- package/src/setup/utils/cli-detection.ts +99 -0
- package/src/setup/utils/config-writer.ts +249 -0
- package/src/styles.ts +12 -0
- package/src/tui/App.tsx +177 -0
- package/src/tui/components/AgentStateIcon.tsx +84 -0
- package/src/tui/components/AnimatedBranch.tsx +134 -0
- package/src/tui/components/ChatPanel.tsx +125 -0
- package/src/tui/components/DAGPanel.tsx +208 -0
- package/src/tui/components/ExecutionTimeline.tsx +225 -0
- package/src/tui/components/Header.tsx +109 -0
- package/src/tui/components/HelpOverlay.tsx +140 -0
- package/src/tui/components/InputBar.tsx +69 -0
- package/src/tui/components/LogsPanel.tsx +129 -0
- package/src/tui/components/MemoryPanel.tsx +163 -0
- package/src/tui/components/MetricsPanel.tsx +149 -0
- package/src/tui/components/StatusPanel.tsx +137 -0
- package/src/tui/components/TaskTree.tsx +159 -0
- package/src/tui/components/animations/ProgressBar.tsx +160 -0
- package/src/tui/components/animations/Pulse.tsx +73 -0
- package/src/tui/components/animations/Spinner.tsx +54 -0
- package/src/tui/components/animations/StatusAnimator.tsx +153 -0
- package/src/tui/components/animations/TypingEffect.tsx +119 -0
- package/src/tui/components/animations/index.ts +16 -0
- package/src/tui/hooks/useAnimation.ts +290 -0
- package/src/tui/hooks/useAppState.ts +403 -0
- package/src/tui/index.ts +9 -0
- package/src/tui/services/orchestrator.ts +195 -0
- package/src/tui/styles/borders.ts +51 -0
- package/src/tui/styles/colors.ts +19 -0
- package/src/tui/styles/index.ts +20 -0
- package/src/tui/styles/indicators.ts +54 -0
- package/src/tui/styles/layout.ts +44 -0
- package/src/tui/styles/providers.ts +32 -0
- package/src/tui/utils/animation.ts +124 -0
- package/src/vendor-manifests.ts +113 -0
- package/src/ws-relay.ts +156 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React, { memo, useMemo } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { tuiColors } from "../styles/index.js";
|
|
4
|
+
|
|
5
|
+
const VERTICAL_PULSE_FRAMES = ["│", "┃", "│", "┃"];
|
|
6
|
+
const HORIZONTAL_PULSE_FRAMES = ["─", "━", "─", "━"];
|
|
7
|
+
const FLOW_FRAMES = ["◀═══▶", "═◀═══▶", "══◀══▶", "═══◀═▶", "════◀▶", "═▶═══◀", "══▶══◀", "═══▶═◀"];
|
|
8
|
+
|
|
9
|
+
export type BranchType = 'vertical' | 'horizontal' | 'corner-left' | 'corner-right' | 'branch' | 'last-branch' | 'flow';
|
|
10
|
+
|
|
11
|
+
interface AnimatedBranchProps {
|
|
12
|
+
type: BranchType;
|
|
13
|
+
tick?: number;
|
|
14
|
+
animated?: boolean;
|
|
15
|
+
length?: number;
|
|
16
|
+
color?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const AnimatedBranch = memo(function AnimatedBranch({
|
|
20
|
+
type,
|
|
21
|
+
tick = 0,
|
|
22
|
+
animated = true,
|
|
23
|
+
length = 1,
|
|
24
|
+
color
|
|
25
|
+
}: AnimatedBranchProps) {
|
|
26
|
+
const branchColor = color || tuiColors.textTertiary;
|
|
27
|
+
|
|
28
|
+
const getFrame = (frames: string[]): string => {
|
|
29
|
+
return frames[tick % frames.length];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const renderBranch = (): string => {
|
|
33
|
+
switch (type) {
|
|
34
|
+
case 'vertical':
|
|
35
|
+
return animated ? getFrame(VERTICAL_PULSE_FRAMES) : "│";
|
|
36
|
+
case 'horizontal':
|
|
37
|
+
return animated ? getFrame(HORIZONTAL_PULSE_FRAMES).repeat(length) : "─".repeat(length);
|
|
38
|
+
case 'corner-left':
|
|
39
|
+
return "┌";
|
|
40
|
+
case 'corner-right':
|
|
41
|
+
return "┐";
|
|
42
|
+
case 'branch':
|
|
43
|
+
return "├─";
|
|
44
|
+
case 'last-branch':
|
|
45
|
+
return "└─";
|
|
46
|
+
case 'flow':
|
|
47
|
+
return animated ? getFrame(FLOW_FRAMES) : "◀═══▶";
|
|
48
|
+
default:
|
|
49
|
+
return "│";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return <Text color={branchColor}>{renderBranch()}</Text>;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
interface BranchLineProps {
|
|
57
|
+
tick: number;
|
|
58
|
+
animated?: boolean;
|
|
59
|
+
length?: number;
|
|
60
|
+
color?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const VerticalBranch = memo(function VerticalBranch({ tick, animated = true, length = 1, color }: BranchLineProps) {
|
|
64
|
+
return <AnimatedBranch type="vertical" tick={tick} animated={animated} color={color} />;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const HorizontalBranch = memo(function HorizontalBranch({ tick, animated = true, length = 1, color }: BranchLineProps) {
|
|
68
|
+
return <AnimatedBranch type="horizontal" tick={tick} animated={animated} length={length} color={color} />;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export const BranchConnector = memo(function BranchConnector({ tick, animated = true, color }: BranchLineProps) {
|
|
72
|
+
return <AnimatedBranch type="branch" tick={tick} animated={animated} color={color} />;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const LastBranchConnector = memo(function LastBranchConnector({ tick, animated = true, color }: BranchLineProps) {
|
|
76
|
+
return <AnimatedBranch type="last-branch" tick={tick} animated={animated} color={color} />;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export const FlowIndicator = memo(function FlowIndicator({ tick, animated = true, color }: BranchLineProps) {
|
|
80
|
+
return <AnimatedBranch type="flow" tick={tick} animated={animated} color={color} />;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
interface TaskBranchProps {
|
|
84
|
+
tick: number;
|
|
85
|
+
depth: number;
|
|
86
|
+
isLast: boolean;
|
|
87
|
+
hasChildren?: boolean;
|
|
88
|
+
isExpanded?: boolean;
|
|
89
|
+
color?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const TaskBranch = memo(function TaskBranch({ tick, depth, isLast, hasChildren = false, isExpanded = true, color }: TaskBranchProps) {
|
|
93
|
+
const branchColor = color || tuiColors.textTertiary;
|
|
94
|
+
|
|
95
|
+
if (depth === 0) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const indent = " ".repeat(depth - 1);
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<Box flexDirection="row">
|
|
103
|
+
<Text color={branchColor}>{indent}</Text>
|
|
104
|
+
<AnimatedBranch type={isLast ? "last-branch" : "branch"} tick={tick} color={branchColor} />
|
|
105
|
+
</Box>
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
interface AnimatedConnectorProps {
|
|
110
|
+
tick: number;
|
|
111
|
+
fromLevel: number;
|
|
112
|
+
toLevel: number;
|
|
113
|
+
isActive: boolean;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const AnimatedConnector = memo(function AnimatedConnector({ tick, fromLevel, toLevel, isActive }: AnimatedConnectorProps) {
|
|
117
|
+
const color = isActive ? tuiColors.primary : tuiColors.textTertiary;
|
|
118
|
+
const rows = toLevel - fromLevel;
|
|
119
|
+
|
|
120
|
+
const connectorElements = useMemo(() =>
|
|
121
|
+
Array.from({ length: rows }).map((_, idx) => (
|
|
122
|
+
<Box key={idx} paddingLeft={2}>
|
|
123
|
+
<AnimatedBranch type="vertical" tick={tick} animated={isActive} color={color} />
|
|
124
|
+
</Box>
|
|
125
|
+
)),
|
|
126
|
+
[rows, tick, isActive, color]
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<Box flexDirection="column">
|
|
131
|
+
{connectorElements}
|
|
132
|
+
</Box>
|
|
133
|
+
);
|
|
134
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import React, { useState, useEffect, useMemo, memo, useCallback } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { tuiColors, formatTimestamp, getProviderTag } from "../styles/index.js";
|
|
4
|
+
import { TypingEffect, ProcessingIndicator } from "./animations/index.js";
|
|
5
|
+
|
|
6
|
+
interface Message {
|
|
7
|
+
id: string;
|
|
8
|
+
type: "user" | "system" | "agent" | "error" | "success";
|
|
9
|
+
content: string;
|
|
10
|
+
timestamp: Date;
|
|
11
|
+
agent?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ChatPanelProps {
|
|
15
|
+
messages: Message[];
|
|
16
|
+
isProcessing: boolean;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const MESSAGE_CONFIG: Record<string, { tag: string; color: string }> = {
|
|
21
|
+
user: { tag: "[YOU]", color: tuiColors.textPrimary },
|
|
22
|
+
system: { tag: "[SYS]", color: tuiColors.textTertiary },
|
|
23
|
+
agent: { tag: "[AGENT]", color: tuiColors.primary },
|
|
24
|
+
error: { tag: "[ERROR]", color: tuiColors.error },
|
|
25
|
+
success: { tag: "[SUCCESS]", color: tuiColors.success },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const MAX_DISPLAYED_MESSAGES = 12;
|
|
29
|
+
const TYPING_SPEED_PER_CHAR = 15;
|
|
30
|
+
const TYPING_BUFFER_MS = 500;
|
|
31
|
+
|
|
32
|
+
interface MessageItemProps {
|
|
33
|
+
message: Message;
|
|
34
|
+
animate?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const MessageItem = memo(function MessageItem({ message, animate = false }: MessageItemProps) {
|
|
38
|
+
const config = MESSAGE_CONFIG[message.type];
|
|
39
|
+
const providerInfo = useMemo(() =>
|
|
40
|
+
message.agent ? getProviderTag(message.agent) : null,
|
|
41
|
+
[message.agent]
|
|
42
|
+
);
|
|
43
|
+
const tag = message.type === "agent" && message.agent
|
|
44
|
+
? `[${message.agent.toUpperCase().slice(0, 8)}]`
|
|
45
|
+
: config.tag;
|
|
46
|
+
const formattedTime = useMemo(() => formatTimestamp(message.timestamp), [message.timestamp]);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Box flexDirection="column" marginBottom={1}>
|
|
50
|
+
<Box flexDirection="row">
|
|
51
|
+
<Text color={tuiColors.textTertiary}>[{formattedTime}]</Text>
|
|
52
|
+
<Text color={config.color} bold>{tag.padEnd(12)}</Text>
|
|
53
|
+
{providerInfo && (
|
|
54
|
+
<Text color={tuiColors.textTertiary}>{providerInfo.code}</Text>
|
|
55
|
+
)}
|
|
56
|
+
</Box>
|
|
57
|
+
{animate ? (
|
|
58
|
+
<TypingEffect text={message.content} speed={TYPING_SPEED_PER_CHAR} showCursor={false} />
|
|
59
|
+
) : (
|
|
60
|
+
<Text color={tuiColors.textPrimary}> {message.content}</Text>
|
|
61
|
+
)}
|
|
62
|
+
</Box>
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const ChatPanel = memo(function ChatPanel({ messages, isProcessing, isActive }: ChatPanelProps) {
|
|
67
|
+
const borderColor = isActive ? tuiColors.primary : tuiColors.border;
|
|
68
|
+
const [animatingMessageId, setAnimatingMessageId] = useState<string | null>(null);
|
|
69
|
+
const timeoutRef = React.useRef<NodeJS.Timeout | null>(null);
|
|
70
|
+
|
|
71
|
+
const displayMessages = useMemo(() =>
|
|
72
|
+
messages.slice(-MAX_DISPLAYED_MESSAGES),
|
|
73
|
+
[messages]
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (messages.length === 0) return;
|
|
78
|
+
|
|
79
|
+
const lastMessage = messages[messages.length - 1];
|
|
80
|
+
if (lastMessage.type !== "agent" && lastMessage.type !== "system") return;
|
|
81
|
+
|
|
82
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
83
|
+
|
|
84
|
+
setAnimatingMessageId(lastMessage.id);
|
|
85
|
+
timeoutRef.current = setTimeout(() => {
|
|
86
|
+
setAnimatingMessageId(null);
|
|
87
|
+
}, lastMessage.content.length * TYPING_SPEED_PER_CHAR + TYPING_BUFFER_MS);
|
|
88
|
+
|
|
89
|
+
return () => {
|
|
90
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
91
|
+
};
|
|
92
|
+
}, [messages]);
|
|
93
|
+
|
|
94
|
+
const messageElements = useMemo(() =>
|
|
95
|
+
displayMessages.map((msg) => (
|
|
96
|
+
<MessageItem
|
|
97
|
+
key={msg.id}
|
|
98
|
+
message={msg}
|
|
99
|
+
animate={msg.id === animatingMessageId}
|
|
100
|
+
/>
|
|
101
|
+
)),
|
|
102
|
+
[displayMessages, animatingMessageId]
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<Box
|
|
107
|
+
flexDirection="column"
|
|
108
|
+
flexGrow={2}
|
|
109
|
+
borderStyle="single"
|
|
110
|
+
borderColor={borderColor}
|
|
111
|
+
paddingX={1}
|
|
112
|
+
>
|
|
113
|
+
<Box marginBottom={1}>
|
|
114
|
+
<Text color={tuiColors.primary} bold>┌─</Text>
|
|
115
|
+
<Text color={tuiColors.primary} bold> CHAT </Text>
|
|
116
|
+
<Text color={tuiColors.textTertiary}>─────────────────────────────────────</Text>
|
|
117
|
+
</Box>
|
|
118
|
+
|
|
119
|
+
<Box flexDirection="column" flexGrow={1} overflow="hidden">
|
|
120
|
+
{messageElements}
|
|
121
|
+
{isProcessing && <ProcessingIndicator text="Processing" />}
|
|
122
|
+
</Box>
|
|
123
|
+
</Box>
|
|
124
|
+
);
|
|
125
|
+
});
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import React, { useMemo, memo } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { tuiColors, getStatusIndicator, getSpinnerFrame, treeChars } from "../styles/index.js";
|
|
4
|
+
import { AnimatedProgressBar } from "./animations/index.js";
|
|
5
|
+
import { AgentStateIcon, AgentState } from "./AgentStateIcon.js";
|
|
6
|
+
|
|
7
|
+
interface DAGSubtask {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
state: AgentState;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface DAGNode {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
status: "pending" | "running" | "done" | "error";
|
|
17
|
+
agent?: string;
|
|
18
|
+
state?: AgentState;
|
|
19
|
+
executionTime?: number;
|
|
20
|
+
detail?: string;
|
|
21
|
+
subtasks?: DAGSubtask[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface DAGLevel {
|
|
25
|
+
name: string;
|
|
26
|
+
progress: number;
|
|
27
|
+
nodes: DAGNode[];
|
|
28
|
+
status?: 'done' | 'running' | 'pending';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface WorkflowState {
|
|
32
|
+
levels: DAGLevel[];
|
|
33
|
+
currentLevel: number;
|
|
34
|
+
totalProgress: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface DAGNodeItemProps {
|
|
38
|
+
node: DAGNode;
|
|
39
|
+
tick: number;
|
|
40
|
+
isLast: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const STATE_LABELS: Record<AgentState, string> = {
|
|
44
|
+
idle: "pending",
|
|
45
|
+
thinking: "thinking...",
|
|
46
|
+
processing: "processing",
|
|
47
|
+
running: "running",
|
|
48
|
+
success: "done",
|
|
49
|
+
error: "error",
|
|
50
|
+
waiting: "waiting",
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const DAGNodeItem = memo(function DAGNodeItem({ node, tick, isLast }: DAGNodeItemProps) {
|
|
54
|
+
const statusInfo = useMemo(() => getStatusIndicator(node.status), [node.status]);
|
|
55
|
+
const agentState = useMemo((): AgentState => {
|
|
56
|
+
if (node.state) return node.state;
|
|
57
|
+
if (node.status === 'running') return 'running';
|
|
58
|
+
if (node.status === 'done') return 'success';
|
|
59
|
+
if (node.status === 'error') return 'error';
|
|
60
|
+
return 'idle';
|
|
61
|
+
}, [node.state, node.status]);
|
|
62
|
+
|
|
63
|
+
const icon = node.status === "running"
|
|
64
|
+
? getSpinnerFrame(tick, "dots")
|
|
65
|
+
: statusInfo.icon;
|
|
66
|
+
const prefix = isLast ? treeChars.lastBranch : treeChars.branch;
|
|
67
|
+
const timeStr = node.executionTime ? `${node.executionTime.toFixed(1)}s` : "";
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Box flexDirection="column">
|
|
71
|
+
<Box flexDirection="row">
|
|
72
|
+
<Text color={tuiColors.textTertiary}>{prefix} </Text>
|
|
73
|
+
<Box flexDirection="row">
|
|
74
|
+
<Text color={tuiColors.textSecondary}>[</Text>
|
|
75
|
+
<AgentStateIcon state={agentState} tick={tick} />
|
|
76
|
+
<Text color={tuiColors.textSecondary}>]</Text>
|
|
77
|
+
</Box>
|
|
78
|
+
<Text color={tuiColors.textPrimary}> {node.name.padEnd(18)}</Text>
|
|
79
|
+
{timeStr && (
|
|
80
|
+
<Text color={tuiColors.textTertiary}> ● {timeStr}</Text>
|
|
81
|
+
)}
|
|
82
|
+
</Box>
|
|
83
|
+
{node.detail && (
|
|
84
|
+
<Box flexDirection="row">
|
|
85
|
+
<Text color={tuiColors.textTertiary}> └── {node.detail}</Text>
|
|
86
|
+
</Box>
|
|
87
|
+
)}
|
|
88
|
+
{node.subtasks && node.subtasks.length > 0 && (
|
|
89
|
+
<Box flexDirection="column">
|
|
90
|
+
{node.subtasks.map((subtask, idx) => (
|
|
91
|
+
<Box key={subtask.id} flexDirection="row">
|
|
92
|
+
<Text color={tuiColors.textTertiary}> {idx === node.subtasks!.length - 1 ? '└──' : '├──'} </Text>
|
|
93
|
+
<AgentStateIcon state={subtask.state} tick={tick} />
|
|
94
|
+
<Text color={tuiColors.textTertiary}> {subtask.name}</Text>
|
|
95
|
+
</Box>
|
|
96
|
+
))}
|
|
97
|
+
</Box>
|
|
98
|
+
)}
|
|
99
|
+
</Box>
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
interface DAGLevelViewProps {
|
|
104
|
+
level: DAGLevel;
|
|
105
|
+
tick: number;
|
|
106
|
+
isActive: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const DAGLevelView = memo(function DAGLevelView({ level, tick, isActive }: DAGLevelViewProps) {
|
|
110
|
+
const levelColor = isActive ? tuiColors.primary : tuiColors.textSecondary;
|
|
111
|
+
const statusColor = level.status === 'done'
|
|
112
|
+
? tuiColors.success
|
|
113
|
+
: level.status === 'running'
|
|
114
|
+
? tuiColors.warning
|
|
115
|
+
: tuiColors.textTertiary;
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<Box flexDirection="column" marginBottom={1}>
|
|
119
|
+
<Box flexDirection="row">
|
|
120
|
+
<Text color={levelColor} bold>{level.name.padEnd(12)}</Text>
|
|
121
|
+
<AnimatedProgressBar
|
|
122
|
+
progress={level.progress}
|
|
123
|
+
width={16}
|
|
124
|
+
tick={tick}
|
|
125
|
+
animated={isActive}
|
|
126
|
+
showMarker={isActive}
|
|
127
|
+
glowEffect={isActive}
|
|
128
|
+
/>
|
|
129
|
+
</Box>
|
|
130
|
+
<Box flexDirection="row">
|
|
131
|
+
<Text color={isActive ? tuiColors.primary : tuiColors.textTertiary}>
|
|
132
|
+
{isActive ? "┃" : "│"}
|
|
133
|
+
</Text>
|
|
134
|
+
</Box>
|
|
135
|
+
{level.nodes.map((node, idx) => (
|
|
136
|
+
<DAGNodeItem
|
|
137
|
+
key={node.id}
|
|
138
|
+
node={node}
|
|
139
|
+
tick={tick}
|
|
140
|
+
isLast={idx === level.nodes.length - 1}
|
|
141
|
+
/>
|
|
142
|
+
))}
|
|
143
|
+
</Box>
|
|
144
|
+
);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
interface DAGPanelProps {
|
|
148
|
+
workflowState: WorkflowState;
|
|
149
|
+
tick: number;
|
|
150
|
+
isActive: boolean;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export const DAGPanel = memo(function DAGPanel({ workflowState, tick, isActive }: DAGPanelProps) {
|
|
154
|
+
const borderColor = isActive ? tuiColors.primary : tuiColors.border;
|
|
155
|
+
|
|
156
|
+
const levelViews = useMemo(() =>
|
|
157
|
+
workflowState.levels.map((level, index) => (
|
|
158
|
+
<DAGLevelView
|
|
159
|
+
key={level.name}
|
|
160
|
+
level={level}
|
|
161
|
+
tick={tick}
|
|
162
|
+
isActive={index === workflowState.currentLevel}
|
|
163
|
+
/>
|
|
164
|
+
)),
|
|
165
|
+
[workflowState.levels, workflowState.currentLevel, tick]
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
const isAnimating = useMemo(() =>
|
|
169
|
+
workflowState.totalProgress > 0 && workflowState.totalProgress < 100,
|
|
170
|
+
[workflowState.totalProgress]
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<Box
|
|
175
|
+
flexDirection="column"
|
|
176
|
+
width={46}
|
|
177
|
+
borderStyle="single"
|
|
178
|
+
borderColor={borderColor}
|
|
179
|
+
paddingX={1}
|
|
180
|
+
>
|
|
181
|
+
<Box marginBottom={1}>
|
|
182
|
+
<Text color={tuiColors.primary} bold>┌─</Text>
|
|
183
|
+
<Text color={tuiColors.primary} bold> DAG_EXECUTION </Text>
|
|
184
|
+
<Text color={tuiColors.textTertiary}>──────────────────────</Text>
|
|
185
|
+
</Box>
|
|
186
|
+
|
|
187
|
+
<Box flexDirection="column" flexGrow={1}>
|
|
188
|
+
{levelViews}
|
|
189
|
+
</Box>
|
|
190
|
+
|
|
191
|
+
<Box marginTop={1}>
|
|
192
|
+
<Text color={tuiColors.textTertiary}>├─ TOTAL ─────────────────────────</Text>
|
|
193
|
+
</Box>
|
|
194
|
+
<Box flexDirection="row">
|
|
195
|
+
<Text color={tuiColors.textSecondary}>Progress: </Text>
|
|
196
|
+
<AnimatedProgressBar
|
|
197
|
+
progress={workflowState.totalProgress}
|
|
198
|
+
width={16}
|
|
199
|
+
tick={tick}
|
|
200
|
+
animated={isAnimating}
|
|
201
|
+
showMarker
|
|
202
|
+
/>
|
|
203
|
+
</Box>
|
|
204
|
+
</Box>
|
|
205
|
+
);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
export type { DAGNode, DAGLevel, WorkflowState, DAGSubtask };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import React, { memo, useMemo } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { tuiColors } from "../styles/index.js";
|
|
4
|
+
import { AnimatedBranch } from "./AnimatedBranch.js";
|
|
5
|
+
|
|
6
|
+
interface TimelineAgent {
|
|
7
|
+
name: string;
|
|
8
|
+
startTime: number;
|
|
9
|
+
endTime?: number;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
color?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface TimelineLevel {
|
|
15
|
+
name: string;
|
|
16
|
+
startTime: number;
|
|
17
|
+
endTime?: number;
|
|
18
|
+
progress: number;
|
|
19
|
+
status: 'done' | 'running' | 'pending';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ExecutionTimelineProps {
|
|
23
|
+
tick: number;
|
|
24
|
+
totalDuration: number;
|
|
25
|
+
currentTime: number;
|
|
26
|
+
levels: TimelineLevel[];
|
|
27
|
+
agents: TimelineAgent[];
|
|
28
|
+
isActive?: boolean;
|
|
29
|
+
width?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const ACTIVE_MARKER_FRAMES = ["┃", "║", "┃", "║"];
|
|
33
|
+
|
|
34
|
+
const BAR_COLORS: Record<string, string> = {
|
|
35
|
+
done: tuiColors.success,
|
|
36
|
+
running: tuiColors.warning,
|
|
37
|
+
pending: tuiColors.textTertiary,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const STATUS_TEXT = {
|
|
41
|
+
done: (endTime: number | undefined) => `done at ${endTime?.toFixed(1)}s`,
|
|
42
|
+
running: () => "running...",
|
|
43
|
+
pending: () => "pending",
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function formatTime(s: number): string {
|
|
47
|
+
return `${s}s`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface TimelineBarProps {
|
|
51
|
+
level: TimelineLevel;
|
|
52
|
+
timeScale: number;
|
|
53
|
+
width: number;
|
|
54
|
+
currentTime: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const TimelineBar = memo(function TimelineBar({ level, timeScale, width, currentTime }: TimelineBarProps) {
|
|
58
|
+
const startCol = Math.floor(level.startTime * timeScale);
|
|
59
|
+
const endCol = level.endTime
|
|
60
|
+
? Math.floor(level.endTime * timeScale)
|
|
61
|
+
: Math.floor(currentTime * timeScale);
|
|
62
|
+
const barWidth = Math.max(0, endCol - startCol);
|
|
63
|
+
const beforeBar = "░".repeat(startCol);
|
|
64
|
+
|
|
65
|
+
const barChar = level.status === 'done' ? "█" : level.status === 'running' ? "▓" : "░";
|
|
66
|
+
const afterBar = "░".repeat(Math.max(0, width - endCol));
|
|
67
|
+
|
|
68
|
+
const statusText = STATUS_TEXT[level.status](level.endTime);
|
|
69
|
+
const paddedName = useMemo(() => level.name.padEnd(4), [level.name]);
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Box flexDirection="row">
|
|
73
|
+
<Text color={tuiColors.textTertiary}>{paddedName} </Text>
|
|
74
|
+
<Text color={BAR_COLORS[level.status]}>{beforeBar}{barChar.repeat(barWidth)}</Text>
|
|
75
|
+
<Text color={tuiColors.textTertiary}>{afterBar}</Text>
|
|
76
|
+
<Text color={tuiColors.textTertiary}> {statusText}</Text>
|
|
77
|
+
</Box>
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
interface AgentTimelineProps {
|
|
82
|
+
agent: TimelineAgent;
|
|
83
|
+
timeScale: number;
|
|
84
|
+
width: number;
|
|
85
|
+
currentTime: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const AgentTimeline = memo(function AgentTimeline({ agent, timeScale, width, currentTime }: AgentTimelineProps) {
|
|
89
|
+
const startCol = Math.floor(agent.startTime * timeScale);
|
|
90
|
+
const endCol = agent.endTime
|
|
91
|
+
? Math.floor(agent.endTime * timeScale)
|
|
92
|
+
: Math.floor(currentTime * timeScale);
|
|
93
|
+
const barWidth = Math.max(0, endCol - startCol);
|
|
94
|
+
const indent = " ".repeat(startCol);
|
|
95
|
+
const bar = agent.isActive ? "─".repeat(barWidth) + "▶" : "─".repeat(barWidth) + "┘";
|
|
96
|
+
const afterBar = " ".repeat(Math.max(0, width - endCol - 1));
|
|
97
|
+
|
|
98
|
+
const agentColor = agent.color || (agent.isActive ? tuiColors.primary : tuiColors.textSecondary);
|
|
99
|
+
const prefix = agent.isActive ? "▶" : "●";
|
|
100
|
+
const paddedName = useMemo(() => agent.name.padEnd(10), [agent.name]);
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<Box flexDirection="row">
|
|
104
|
+
<Text color={agentColor}>{prefix} {paddedName} </Text>
|
|
105
|
+
<Text color={tuiColors.textTertiary}>{indent}</Text>
|
|
106
|
+
<Text color={agentColor}>{bar}</Text>
|
|
107
|
+
<Text color={tuiColors.textTertiary}>{afterBar}</Text>
|
|
108
|
+
</Box>
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
export const ExecutionTimeline = memo(function ExecutionTimeline({
|
|
113
|
+
tick,
|
|
114
|
+
totalDuration,
|
|
115
|
+
currentTime,
|
|
116
|
+
levels,
|
|
117
|
+
agents,
|
|
118
|
+
isActive = false,
|
|
119
|
+
width = 50,
|
|
120
|
+
}: ExecutionTimelineProps) {
|
|
121
|
+
const borderColor = isActive ? tuiColors.primary : tuiColors.border;
|
|
122
|
+
const timeScale = width / totalDuration;
|
|
123
|
+
const markerPositions = [0, 5, 10, 15, 20];
|
|
124
|
+
|
|
125
|
+
const activeMarker = isActive ? ACTIVE_MARKER_FRAMES[tick % ACTIVE_MARKER_FRAMES.length] : "│";
|
|
126
|
+
|
|
127
|
+
const markerElements = useMemo(() =>
|
|
128
|
+
markerPositions.map((pos, idx) => (
|
|
129
|
+
<Box key={idx} width={10}>
|
|
130
|
+
<Text color={tuiColors.textTertiary}>{formatTime(pos).padStart(6)}</Text>
|
|
131
|
+
</Box>
|
|
132
|
+
)),
|
|
133
|
+
[]
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
const separatorElements = useMemo(() =>
|
|
137
|
+
Array.from({ length: 5 }).map((_, idx) => (
|
|
138
|
+
<Box key={idx} width={10}>
|
|
139
|
+
<Text color={tuiColors.textTertiary}>{idx === 0 ? "│" : " │"}</Text>
|
|
140
|
+
</Box>
|
|
141
|
+
)),
|
|
142
|
+
[]
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
const levelElements = useMemo(() =>
|
|
146
|
+
levels.map((level, idx) => (
|
|
147
|
+
<Box key={idx} marginBottom={1}>
|
|
148
|
+
<TimelineBar level={level} timeScale={timeScale} width={width} currentTime={currentTime} />
|
|
149
|
+
</Box>
|
|
150
|
+
)),
|
|
151
|
+
[levels, timeScale, width, currentTime]
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
const agentElements = useMemo(() =>
|
|
155
|
+
agents.map((agent, idx) => (
|
|
156
|
+
<Box key={idx}>
|
|
157
|
+
<AgentTimeline agent={agent} timeScale={timeScale} width={width} currentTime={currentTime} />
|
|
158
|
+
</Box>
|
|
159
|
+
)),
|
|
160
|
+
[agents, timeScale, width, currentTime]
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<Box flexDirection="column" borderStyle="single" borderColor={borderColor} paddingX={1}>
|
|
165
|
+
<Box marginBottom={1}>
|
|
166
|
+
<Text color={tuiColors.primary} bold>┌─</Text>
|
|
167
|
+
<Text color={tuiColors.primary} bold> EXECUTION_TIMELINE </Text>
|
|
168
|
+
<Text color={tuiColors.textTertiary}>────────────────</Text>
|
|
169
|
+
</Box>
|
|
170
|
+
|
|
171
|
+
<Box flexDirection="row" marginBottom={1}>
|
|
172
|
+
{markerElements}
|
|
173
|
+
</Box>
|
|
174
|
+
|
|
175
|
+
<Box flexDirection="row" marginBottom={1}>
|
|
176
|
+
{separatorElements}
|
|
177
|
+
</Box>
|
|
178
|
+
|
|
179
|
+
<Box flexDirection="row" marginBottom={1}>
|
|
180
|
+
<Text color={tuiColors.textTertiary}>{"├" + "─".repeat(width - 2) + "┤"}</Text>
|
|
181
|
+
</Box>
|
|
182
|
+
|
|
183
|
+
<Box flexDirection="column">
|
|
184
|
+
{levelElements}
|
|
185
|
+
</Box>
|
|
186
|
+
|
|
187
|
+
<Box flexDirection="row" marginTop={1} marginBottom={1}>
|
|
188
|
+
<AnimatedBranch type="vertical" tick={tick} animated={isActive} />
|
|
189
|
+
</Box>
|
|
190
|
+
|
|
191
|
+
<Box marginTop={1}>
|
|
192
|
+
<Text color={tuiColors.textSecondary}>Agents:</Text>
|
|
193
|
+
</Box>
|
|
194
|
+
|
|
195
|
+
<Box flexDirection="column" marginTop={1}>
|
|
196
|
+
{agentElements}
|
|
197
|
+
</Box>
|
|
198
|
+
</Box>
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
interface MiniTimelineProps {
|
|
203
|
+
progress: number;
|
|
204
|
+
tick: number;
|
|
205
|
+
isActive: boolean;
|
|
206
|
+
width?: number;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export const MiniTimeline = memo(function MiniTimeline({ progress, tick, isActive, width = 30 }: MiniTimelineProps) {
|
|
210
|
+
const filled = Math.floor((progress / 100) * width);
|
|
211
|
+
const empty = width - filled;
|
|
212
|
+
const currentPos = Math.min(filled, width - 1);
|
|
213
|
+
|
|
214
|
+
const before = "─".repeat(currentPos);
|
|
215
|
+
const marker = isActive ? "●" : "○";
|
|
216
|
+
const after = "─".repeat(empty);
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<Box flexDirection="row">
|
|
220
|
+
<Text color={tuiColors.textTertiary}>├{before}</Text>
|
|
221
|
+
<Text color={isActive ? tuiColors.primary : tuiColors.textSecondary}>{marker}</Text>
|
|
222
|
+
<Text color={tuiColors.textTertiary}>{after}┤</Text>
|
|
223
|
+
</Box>
|
|
224
|
+
);
|
|
225
|
+
});
|