@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,94 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
function toRelative(baseDir, file) {
|
|
3
|
+
const rel = path.relative(baseDir, file);
|
|
4
|
+
return rel.length > 0 ? rel : path.basename(file);
|
|
5
|
+
}
|
|
6
|
+
function buildClaudeManifest(baseDir, manifest) {
|
|
7
|
+
return {
|
|
8
|
+
schema: "rax.vendor.claude-code.v1",
|
|
9
|
+
session: {
|
|
10
|
+
initMessageFile: toRelative(baseDir, manifest.files.bootstrapPrompt),
|
|
11
|
+
mode: manifest.autoInjectMode,
|
|
12
|
+
bridgeCommand: manifest.bridgeCommand
|
|
13
|
+
},
|
|
14
|
+
orchestrator: {
|
|
15
|
+
tool: "rax-flow",
|
|
16
|
+
quickCommands: manifest.quickCommands
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function buildCodexManifest(baseDir, manifest) {
|
|
21
|
+
return {
|
|
22
|
+
schema: "rax.vendor.codex.v1",
|
|
23
|
+
chat: {
|
|
24
|
+
bootstrapFile: toRelative(baseDir, manifest.files.bootstrapPrompt),
|
|
25
|
+
strategy: manifest.autoInjectMode
|
|
26
|
+
},
|
|
27
|
+
runtime: {
|
|
28
|
+
bridgeCommand: manifest.bridgeCommand,
|
|
29
|
+
taskContext: manifest.task
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function buildOpenCodeManifest(baseDir, manifest) {
|
|
34
|
+
return {
|
|
35
|
+
schema: "rax.vendor.opencode.v1",
|
|
36
|
+
integration: {
|
|
37
|
+
startupPromptFile: toRelative(baseDir, manifest.files.bootstrapPrompt),
|
|
38
|
+
launchMode: manifest.autoInjectMode
|
|
39
|
+
},
|
|
40
|
+
orchestration: {
|
|
41
|
+
quickCommands: manifest.quickCommands,
|
|
42
|
+
bridgeCommand: manifest.bridgeCommand
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function buildKiloManifest(baseDir, manifest) {
|
|
47
|
+
return {
|
|
48
|
+
schema: "rax.vendor.kilo.v1",
|
|
49
|
+
initializer: {
|
|
50
|
+
promptFile: toRelative(baseDir, manifest.files.bootstrapPrompt),
|
|
51
|
+
injectMode: manifest.autoInjectMode
|
|
52
|
+
},
|
|
53
|
+
runtime: {
|
|
54
|
+
bridgeCommand: manifest.bridgeCommand,
|
|
55
|
+
commandHints: manifest.sessionEntryExamples
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function buildGenericManifest(baseDir, manifest) {
|
|
60
|
+
return {
|
|
61
|
+
schema: "rax.vendor.generic.v1",
|
|
62
|
+
bootstrap: {
|
|
63
|
+
file: toRelative(baseDir, manifest.files.bootstrapPrompt)
|
|
64
|
+
},
|
|
65
|
+
bridge: {
|
|
66
|
+
command: manifest.bridgeCommand,
|
|
67
|
+
mode: manifest.autoInjectMode
|
|
68
|
+
},
|
|
69
|
+
commands: manifest.quickCommands
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function generateVendorManifest(target, baseDir, manifest) {
|
|
73
|
+
if (target === "claude-code")
|
|
74
|
+
return buildClaudeManifest(baseDir, manifest);
|
|
75
|
+
if (target === "codex")
|
|
76
|
+
return buildCodexManifest(baseDir, manifest);
|
|
77
|
+
if (target === "opencode")
|
|
78
|
+
return buildOpenCodeManifest(baseDir, manifest);
|
|
79
|
+
if (target === "kilo")
|
|
80
|
+
return buildKiloManifest(baseDir, manifest);
|
|
81
|
+
return buildGenericManifest(baseDir, manifest);
|
|
82
|
+
}
|
|
83
|
+
export function vendorManifestFilename(target) {
|
|
84
|
+
if (target === "claude-code")
|
|
85
|
+
return "vendor-claude-code.json";
|
|
86
|
+
if (target === "codex")
|
|
87
|
+
return "vendor-codex.json";
|
|
88
|
+
if (target === "opencode")
|
|
89
|
+
return "vendor-opencode.json";
|
|
90
|
+
if (target === "kilo")
|
|
91
|
+
return "vendor-kilo.json";
|
|
92
|
+
return "vendor-generic.json";
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=vendor-manifests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor-manifests.js","sourceRoot":"","sources":["../src/vendor-manifests.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAsB7B,SAAS,UAAU,CAAC,OAAe,EAAE,IAAY;IAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe,EAAE,QAA2B;IACvE,OAAO;QACL,MAAM,EAAE,2BAA2B;QACnC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC;YACpE,IAAI,EAAE,QAAQ,CAAC,cAAc;YAC7B,aAAa,EAAE,QAAQ,CAAC,aA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7
|
+
constructor(port?: number);
|
|
8
|
+
start(eventBus: RuntimeEventBus): void;
|
|
9
|
+
private broadcast;
|
|
10
|
+
stop(): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ws-relay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-relay.d.ts","sourceRoot":"","sources":["../src/ws-relay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhD,qBAAa,cAAc;IAKX,OAAO,CAAC,IAAI;IAJxB,OAAO,CAAC,GAAG,CAAgC;IAC3C,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,GAAG,CAAgC;gBAEvB,IAAI,GAAE,MAAa;IAEhC,KAAK,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IA6H7C,OAAO,CAAC,SAAS;IAUV,IAAI,IAAI,IAAI;CAQtB"}
|
package/dist/ws-relay.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { WebSocketServer, WebSocket } from "ws";
|
|
2
|
+
import { readdir, readFile, mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
export class WebSocketRelay {
|
|
5
|
+
port;
|
|
6
|
+
wss = null;
|
|
7
|
+
clients = new Set();
|
|
8
|
+
bus = null;
|
|
9
|
+
constructor(port = 3002) {
|
|
10
|
+
this.port = port;
|
|
11
|
+
}
|
|
12
|
+
start(eventBus) {
|
|
13
|
+
this.bus = eventBus;
|
|
14
|
+
try {
|
|
15
|
+
this.wss = new WebSocketServer({ port: this.port });
|
|
16
|
+
console.log(`\n[UI] 📡 WebSocket relay started on ws://localhost:${this.port}`);
|
|
17
|
+
this.wss.on("connection", (ws) => {
|
|
18
|
+
this.clients.add(ws);
|
|
19
|
+
ws.send(JSON.stringify({ type: "HELLO", timestamp: Date.now() }));
|
|
20
|
+
ws.on("close", () => {
|
|
21
|
+
this.clients.delete(ws);
|
|
22
|
+
});
|
|
23
|
+
ws.on("message", async (data) => {
|
|
24
|
+
try {
|
|
25
|
+
const message = JSON.parse(data.toString());
|
|
26
|
+
const historyDir = path.join(process.cwd(), ".rax-flow", "history");
|
|
27
|
+
if (message.type === "GET_HISTORY") {
|
|
28
|
+
try {
|
|
29
|
+
const files = await readdir(historyDir);
|
|
30
|
+
const runs = await Promise.all(files.filter(f => f.endsWith(".json")).map(async (f) => {
|
|
31
|
+
const content = await readFile(path.join(historyDir, f), "utf8");
|
|
32
|
+
const parsed = JSON.parse(content);
|
|
33
|
+
return {
|
|
34
|
+
taskId: parsed.taskId,
|
|
35
|
+
timestamp: parsed.timestamp,
|
|
36
|
+
prompt: parsed.prompt,
|
|
37
|
+
success: parsed.result.success,
|
|
38
|
+
costUsd: parsed.metrics.totalCostUsd
|
|
39
|
+
};
|
|
40
|
+
}));
|
|
41
|
+
ws.send(JSON.stringify({ type: "HISTORY_LIST", runs: runs.sort((a, b) => b.timestamp - a.timestamp) }));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
ws.send(JSON.stringify({ type: "HISTORY_LIST", runs: [] }));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else if (message.type === "LOAD_RUN") {
|
|
48
|
+
try {
|
|
49
|
+
const file = path.join(historyDir, `${message.taskId}.json`);
|
|
50
|
+
const content = await readFile(file, "utf8");
|
|
51
|
+
ws.send(JSON.stringify({ type: "RUN_DATA", data: JSON.parse(content) }));
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
ws.send(JSON.stringify({ type: "ERROR", message: "Run not found" }));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (message.type === "LIST_WORKFLOWS") {
|
|
58
|
+
const workflowsDir = path.join(process.cwd(), ".rax-flow", "workflows");
|
|
59
|
+
try {
|
|
60
|
+
const files = await readdir(workflowsDir);
|
|
61
|
+
const list = files.filter(f => f.endsWith(".json")).map(f => ({
|
|
62
|
+
id: f.replace(".json", ""),
|
|
63
|
+
filename: f
|
|
64
|
+
}));
|
|
65
|
+
ws.send(JSON.stringify({ type: "WORKFLOW_LIST", workflows: list }));
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
ws.send(JSON.stringify({ type: "WORKFLOW_LIST", workflows: [] }));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if (message.type === "RESOLVE_APPROVAL") {
|
|
72
|
+
this.bus?.emit({
|
|
73
|
+
type: "INTERNAL_RESOLVE_APPROVAL",
|
|
74
|
+
taskId: message.taskId,
|
|
75
|
+
nodeId: message.nodeId,
|
|
76
|
+
approved: message.approved,
|
|
77
|
+
feedback: message.feedback
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
else if (message.type === "SAVE_WORKFLOW") {
|
|
81
|
+
try {
|
|
82
|
+
const workflowsDir = path.join(process.cwd(), ".rax-flow", "workflows");
|
|
83
|
+
await mkdir(workflowsDir, { recursive: true });
|
|
84
|
+
const file = path.join(workflowsDir, `${message.id}.json`);
|
|
85
|
+
const data = {
|
|
86
|
+
id: message.id,
|
|
87
|
+
nodes: message.nodes,
|
|
88
|
+
edges: message.edges
|
|
89
|
+
};
|
|
90
|
+
await writeFile(file, JSON.stringify(data, null, 2));
|
|
91
|
+
ws.send(JSON.stringify({ type: "INFO", message: `Workflow ${message.id} saved.` }));
|
|
92
|
+
this.broadcast({ type: "REFRESH_WORKFLOWS" });
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
ws.send(JSON.stringify({ type: "ERROR", message: "Failed to save workflow" }));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (message.type === "DELETE_WORKFLOW") {
|
|
99
|
+
try {
|
|
100
|
+
const url = path.join(process.cwd(), ".rax-flow", "workflows", `${message.id}.json`);
|
|
101
|
+
const { unlink } = await import("node:fs/promises");
|
|
102
|
+
await unlink(url);
|
|
103
|
+
this.broadcast({ type: "REFRESH_WORKFLOWS" });
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
ws.send(JSON.stringify({ type: "ERROR", message: "Failed to delete workflow" }));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
console.error("[WS] Message parse error:", e);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
ws.on("error", () => {
|
|
115
|
+
this.clients.delete(ws);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
this.wss.on("error", (err) => {
|
|
119
|
+
console.error(`[UI] WebSocket server error: ${err.message}`);
|
|
120
|
+
});
|
|
121
|
+
eventBus.onEvent((event) => {
|
|
122
|
+
this.broadcast(event);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
console.error(`[UI] Failed to start WebSocket server: ${err}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
broadcast(event) {
|
|
130
|
+
if (!this.wss)
|
|
131
|
+
return;
|
|
132
|
+
const payload = JSON.stringify(event);
|
|
133
|
+
for (const client of this.clients) {
|
|
134
|
+
if (client.readyState === WebSocket.OPEN) {
|
|
135
|
+
client.send(payload);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
stop() {
|
|
140
|
+
if (this.wss) {
|
|
141
|
+
this.wss.close();
|
|
142
|
+
this.wss = null;
|
|
143
|
+
this.clients.clear();
|
|
144
|
+
console.log("[UI] 📡 WebSocket relay stopped.");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=ws-relay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-relay.js","sourceRoot":"","sources":["../src/ws-relay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAA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
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"raxflow": "dist/bin.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.json",
|
|
12
|
+
"dev": "tsx src/bin.ts",
|
|
13
|
+
"test": "vitest run --passWithNoTests",
|
|
14
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"ink": "^6.8.0",
|
|
18
|
+
"ink-box": "^2.0.0",
|
|
19
|
+
"ink-spinner": "^5.0.0",
|
|
20
|
+
"ink-text-input": "^6.0.0",
|
|
21
|
+
"rax-flow-agents": "workspace:*",
|
|
22
|
+
"rax-flow-core": "workspace:*",
|
|
23
|
+
"rax-flow-providers": "workspace:*",
|
|
24
|
+
"react": "19.2.3",
|
|
25
|
+
"ws": "^8.19.0"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/react": "^19.2.14",
|
|
32
|
+
"@types/ws": "^8.18.1"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/benchmark.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { performance } from "node:perf_hooks";
|
|
4
|
+
import { CoreOrchestrator } from "rax-flow-core";
|
|
5
|
+
import { buildOfficialAgentsRuntime } from "rax-flow-agents";
|
|
6
|
+
import { ClaudeAdapter, GenericRestAdapter, HostBridgeAdapter, OpenAIAdapter } from "rax-flow-providers";
|
|
7
|
+
import { c } from "./styles.js";
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
|
+
|
|
10
|
+
interface BenchOptions {
|
|
11
|
+
cwd: string;
|
|
12
|
+
prompt: string;
|
|
13
|
+
output?: string;
|
|
14
|
+
providerOverride?: string;
|
|
15
|
+
bridgeCommandOverride?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface RaxConfig {
|
|
19
|
+
defaultProvider?: string;
|
|
20
|
+
strongProvider?: string;
|
|
21
|
+
providers?: {
|
|
22
|
+
host?: { model?: string; mode?: "auto" | "bridge-only" | "mock"; bridgeCommandEnv?: string; timeoutMs?: number };
|
|
23
|
+
openai?: { model?: string; apiKeyEnv?: string; baseUrl?: string };
|
|
24
|
+
claude?: { model?: string; apiKeyEnv?: string; baseUrl?: string };
|
|
25
|
+
rest?: { endpoint?: string; tokenEnv?: string; model?: string };
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function loadConfig(cwd: string): Promise<RaxConfig> {
|
|
30
|
+
const file = path.join(cwd, ".raxrc");
|
|
31
|
+
const raw = await readFile(file, "utf8");
|
|
32
|
+
return JSON.parse(raw) as RaxConfig;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function createProviders(config: RaxConfig, bridgeCommandOverride?: string) {
|
|
36
|
+
const providers: Record<string, OpenAIAdapter | ClaudeAdapter | GenericRestAdapter | HostBridgeAdapter> = {};
|
|
37
|
+
|
|
38
|
+
const hostCfg = config.providers?.host;
|
|
39
|
+
const bridgeCommand = bridgeCommandOverride ?? process.env[hostCfg?.bridgeCommandEnv ?? "RAX_HOST_BRIDGE_COMMAND"];
|
|
40
|
+
providers.host = new HostBridgeAdapter({
|
|
41
|
+
model: hostCfg?.model ?? "host-managed",
|
|
42
|
+
mode: hostCfg?.mode ?? "auto",
|
|
43
|
+
command: bridgeCommand,
|
|
44
|
+
timeoutMs: hostCfg?.timeoutMs ?? 20000
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const openaiKey = process.env[config.providers?.openai?.apiKeyEnv ?? "OPENAI_API_KEY"];
|
|
48
|
+
if (openaiKey) {
|
|
49
|
+
providers.openai = new OpenAIAdapter(openaiKey, config.providers?.openai?.baseUrl);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const claudeKey = process.env[config.providers?.claude?.apiKeyEnv ?? "ANTHROPIC_API_KEY"];
|
|
53
|
+
if (claudeKey) {
|
|
54
|
+
providers.claude = new ClaudeAdapter(claudeKey, config.providers?.claude?.baseUrl);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const restEndpoint = config.providers?.rest?.endpoint;
|
|
58
|
+
if (restEndpoint) {
|
|
59
|
+
const restToken = process.env[config.providers?.rest?.tokenEnv ?? "RAX_REST_TOKEN"];
|
|
60
|
+
providers.rest = new GenericRestAdapter(restEndpoint, restToken);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return providers;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function pseudoScore(text: string): number {
|
|
67
|
+
const clean = text.trim();
|
|
68
|
+
if (!clean) return 0;
|
|
69
|
+
const lengthScore = Math.min(clean.length / 1200, 1);
|
|
70
|
+
const structureScore = ["{", "}", "-", "1.", "2."].reduce((acc, token) => acc + (clean.includes(token) ? 0.08 : 0), 0);
|
|
71
|
+
return Math.min(1, 0.45 + lengthScore * 0.35 + structureScore);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function runBenchmark(options: BenchOptions): Promise<number> {
|
|
75
|
+
let config: RaxConfig;
|
|
76
|
+
try {
|
|
77
|
+
config = await loadConfig(options.cwd);
|
|
78
|
+
} catch {
|
|
79
|
+
console.error(c.red("Missing .raxrc. Run `raxflow install` first."));
|
|
80
|
+
return 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const providers = createProviders(config, options.bridgeCommandOverride);
|
|
84
|
+
const selectedProvider = options.providerOverride ?? config.defaultProvider ?? "host";
|
|
85
|
+
const provider = providers[selectedProvider] ?? Object.values(providers)[0];
|
|
86
|
+
if (!provider) {
|
|
87
|
+
console.error(c.red("No provider configured for benchmark."));
|
|
88
|
+
return 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const baselineStart = performance.now();
|
|
92
|
+
const baselineRaw = await provider.callModel(options.prompt, { temperature: 0.2, maxTokens: 1200 });
|
|
93
|
+
const baselineLatency = performance.now() - baselineStart;
|
|
94
|
+
|
|
95
|
+
const agents = buildOfficialAgentsRuntime({
|
|
96
|
+
providers,
|
|
97
|
+
defaultProvider: selectedProvider,
|
|
98
|
+
strongProvider: config.strongProvider ?? "host",
|
|
99
|
+
providerModels: {
|
|
100
|
+
host: config.providers?.host?.model ?? "host-managed",
|
|
101
|
+
openai: config.providers?.openai?.model ?? "gpt-4.1-mini",
|
|
102
|
+
claude: config.providers?.claude?.model ?? "claude-3-5-sonnet-latest",
|
|
103
|
+
rest: config.providers?.rest?.model ?? "generic-llm"
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const orchestrator = new CoreOrchestrator(providers, agents, {}, { maxParallel: 4, cacheTtlMs: 0 });
|
|
108
|
+
const raxStart = performance.now();
|
|
109
|
+
const rax = await orchestrator.run({
|
|
110
|
+
taskId: `bench_${Date.now()}`,
|
|
111
|
+
userPrompt: options.prompt,
|
|
112
|
+
context: { benchmark: true }
|
|
113
|
+
});
|
|
114
|
+
const raxLatency = performance.now() - raxStart;
|
|
115
|
+
|
|
116
|
+
const baselineCorrectness = pseudoScore(baselineRaw.output);
|
|
117
|
+
const report = {
|
|
118
|
+
generatedAt: new Date().toISOString(),
|
|
119
|
+
prompt: options.prompt,
|
|
120
|
+
baseline: {
|
|
121
|
+
correctness: baselineCorrectness,
|
|
122
|
+
cost: 0,
|
|
123
|
+
latencyMs: Math.round(baselineLatency),
|
|
124
|
+
stability: baselineCorrectness * 0.9,
|
|
125
|
+
humanIntervention: baselineCorrectness < 0.7 ? 0.6 : 0.3
|
|
126
|
+
},
|
|
127
|
+
orchestrated: {
|
|
128
|
+
correctness: rax.result.confidence,
|
|
129
|
+
cost: rax.metrics.totalCostUsd,
|
|
130
|
+
latencyMs: Math.round(raxLatency),
|
|
131
|
+
stability: rax.result.success ? 0.9 : 0.5,
|
|
132
|
+
humanIntervention: rax.metrics.humanInterventionRequired ? 0.6 : 0.1
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const delta = {
|
|
137
|
+
correctness: +(report.orchestrated.correctness - report.baseline.correctness).toFixed(3),
|
|
138
|
+
cost: +(report.orchestrated.cost - report.baseline.cost).toFixed(3),
|
|
139
|
+
latencyMs: report.orchestrated.latencyMs - report.baseline.latencyMs,
|
|
140
|
+
stability: +(report.orchestrated.stability - report.baseline.stability).toFixed(3),
|
|
141
|
+
humanIntervention: +(report.orchestrated.humanIntervention - report.baseline.humanIntervention).toFixed(3)
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const full = { ...report, delta };
|
|
145
|
+
const outputFile = path.resolve(options.cwd, options.output ?? "benchmarks/reports/latest.json");
|
|
146
|
+
await mkdir(path.dirname(outputFile), { recursive: true });
|
|
147
|
+
await writeFile(outputFile, `${JSON.stringify(full, null, 2)}\n`, "utf8");
|
|
148
|
+
|
|
149
|
+
console.log(c.blue("RAXFLOW Benchmark"));
|
|
150
|
+
console.log(`report: ${outputFile}`);
|
|
151
|
+
console.log(`delta correctness: ${delta.correctness}`);
|
|
152
|
+
console.log(`delta latency(ms): ${delta.latencyMs}`);
|
|
153
|
+
console.log(`delta stability: ${delta.stability}`);
|
|
154
|
+
console.log(`delta humanIntervention: ${delta.humanIntervention}`);
|
|
155
|
+
return 0;
|
|
156
|
+
}
|
package/src/bin.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runInstall } from "./install.js";
|
|
3
|
+
import { runBenchmark } from "./benchmark.js";
|
|
4
|
+
import { runBootstrap } from "./bootstrap.js";
|
|
5
|
+
import { runBridgeTest } from "./bridge-test.js";
|
|
6
|
+
import { runDoctor } from "./doctor.js";
|
|
7
|
+
import { runInitHost } from "./init-host.js";
|
|
8
|
+
import { runWorkflow } from "./run.js";
|
|
9
|
+
import { runDashboard } from "./dashboard.js";
|
|
10
|
+
import { startHubOneShot } from "./hub/index.js";
|
|
11
|
+
import { runSetup } from "./setup/index.js";
|
|
12
|
+
|
|
13
|
+
function getFlag(args: string[], flag: string): string | undefined {
|
|
14
|
+
const index = args.indexOf(flag);
|
|
15
|
+
if (index === -1) return undefined;
|
|
16
|
+
return args[index + 1];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function main() {
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const command = args[0];
|
|
22
|
+
|
|
23
|
+
// Mode hub interactif (défaut) - sans arguments ou avec 'hub'
|
|
24
|
+
if (!command || command === "hub") {
|
|
25
|
+
const { startTUI } = await import("./tui/index.js");
|
|
26
|
+
startTUI();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Mode one-shot
|
|
31
|
+
if (command === "--run") {
|
|
32
|
+
const prompt = getFlag(args, "--run");
|
|
33
|
+
if (!prompt) {
|
|
34
|
+
console.error("Missing --run <prompt>");
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
await startHubOneShot("run", [prompt, ...args.slice(1)]);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Help pour le hub
|
|
42
|
+
if (command === "--help" || command === "-h") {
|
|
43
|
+
console.log("Usage: raxflow [command]");
|
|
44
|
+
console.log("");
|
|
45
|
+
console.log("Modes:");
|
|
46
|
+
console.log(" (no args) Launch interactive hub (default)");
|
|
47
|
+
console.log(" hub Launch interactive hub");
|
|
48
|
+
console.log(" --run <prompt> One-shot mode (execute and exit)");
|
|
49
|
+
console.log("");
|
|
50
|
+
console.log("Setup:");
|
|
51
|
+
console.log(" setup Interactive setup wizard (TUI)");
|
|
52
|
+
console.log(" install [--ui] Legacy setup (alias for setup)");
|
|
53
|
+
console.log("");
|
|
54
|
+
console.log("Commands:");
|
|
55
|
+
console.log(" run --prompt <text> [--workflow path] [--json] [--stream] [--max-parallel N] [--no-cache-persist]");
|
|
56
|
+
console.log(" Execute workflow");
|
|
57
|
+
console.log(" Optional: [--provider host|openai|claude|rest] [--bridge-command \"node bridge.mjs\"]");
|
|
58
|
+
console.log(" benchmark --prompt <text> [--output path] Compare baseline vs orchestrated");
|
|
59
|
+
console.log(" Optional: [--provider host|openai|claude|rest] [--bridge-command \"node bridge.mjs\"]");
|
|
60
|
+
console.log(" doctor Validate host-native bridge setup");
|
|
61
|
+
console.log(" bridge-test [--target claude-code|codex|opencode|kilo|generic] Run bridge smoke payload");
|
|
62
|
+
console.log(" bootstrap [--target claude-code|codex|opencode|kilo|generic] [--task \"...\"] [--json]");
|
|
63
|
+
console.log(" Print chat bootstrap prompt");
|
|
64
|
+
console.log(" dashboard [--port N] Start the visual insights dashboard");
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (command === "install" || command === "setup") {
|
|
69
|
+
const code = await runSetup();
|
|
70
|
+
process.exit(code);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (command === "run") {
|
|
74
|
+
const prompt = getFlag(args, "--prompt");
|
|
75
|
+
if (!prompt) {
|
|
76
|
+
console.error("Missing --prompt");
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
const workflowPath = getFlag(args, "--workflow");
|
|
80
|
+
const provider = getFlag(args, "--provider");
|
|
81
|
+
const bridgeCommand = getFlag(args, "--bridge-command");
|
|
82
|
+
const maxParallelRaw = getFlag(args, "--max-parallel");
|
|
83
|
+
const maxParallel = maxParallelRaw ? Number(maxParallelRaw) : undefined;
|
|
84
|
+
const code = await runWorkflow({
|
|
85
|
+
cwd: process.cwd(),
|
|
86
|
+
prompt,
|
|
87
|
+
workflowPath,
|
|
88
|
+
asJson: args.includes("--json"),
|
|
89
|
+
stream: args.includes("--stream"),
|
|
90
|
+
maxParallel: Number.isFinite(maxParallel) ? maxParallel : undefined,
|
|
91
|
+
noCachePersist: args.includes("--no-cache-persist"),
|
|
92
|
+
providerOverride: provider,
|
|
93
|
+
bridgeCommandOverride: bridgeCommand,
|
|
94
|
+
ui: args.includes("--ui")
|
|
95
|
+
});
|
|
96
|
+
process.exit(code);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (command === "benchmark") {
|
|
100
|
+
const prompt = getFlag(args, "--prompt");
|
|
101
|
+
if (!prompt) {
|
|
102
|
+
console.error("Missing --prompt");
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
const output = getFlag(args, "--output");
|
|
106
|
+
const provider = getFlag(args, "--provider");
|
|
107
|
+
const bridgeCommand = getFlag(args, "--bridge-command");
|
|
108
|
+
const code = await runBenchmark({ cwd: process.cwd(), prompt, output, providerOverride: provider, bridgeCommandOverride: bridgeCommand });
|
|
109
|
+
process.exit(code);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (command === "doctor") {
|
|
113
|
+
const code = await runDoctor({ cwd: process.cwd() });
|
|
114
|
+
process.exit(code);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (command === "bridge-test") {
|
|
118
|
+
const target = getFlag(args, "--target");
|
|
119
|
+
const code = await runBridgeTest({ cwd: process.cwd(), target });
|
|
120
|
+
process.exit(code);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (command === "init-host") {
|
|
124
|
+
const target = getFlag(args, "--target");
|
|
125
|
+
const task = getFlag(args, "--task");
|
|
126
|
+
const code = await runInitHost({ cwd: process.cwd(), target, printOnly: args.includes("--print"), all: args.includes("--all"), task });
|
|
127
|
+
process.exit(code);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (command === "bootstrap") {
|
|
131
|
+
const target = getFlag(args, "--target");
|
|
132
|
+
const task = getFlag(args, "--task");
|
|
133
|
+
const code = await runBootstrap({ target, task, asJson: args.includes("--json") });
|
|
134
|
+
process.exit(code);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (command === "dashboard") {
|
|
138
|
+
const port = getFlag(args, "--port");
|
|
139
|
+
const code = await runDashboard({ port: port ? Number(port) : 3003 });
|
|
140
|
+
process.exit(code);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (command === "evolve") {
|
|
144
|
+
const { showEvolution } = await import("./evolve.js");
|
|
145
|
+
const code = await showEvolution({ cwd: process.cwd(), history: args.includes("--history") });
|
|
146
|
+
process.exit(code);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
console.error(`Unknown command: ${command}`);
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
main().catch((error) => {
|
|
154
|
+
console.error(error);
|
|
155
|
+
process.exit(1);
|
|
156
|
+
});
|
package/src/bootstrap.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { c } from "./styles.js";
|
|
2
|
+
import { HOST_TEMPLATES, buildBootstrapPrompt, parseHostTarget } from "./host-init-templates.js";
|
|
3
|
+
|
|
4
|
+
interface BootstrapOptions {
|
|
5
|
+
target?: string;
|
|
6
|
+
asJson?: boolean;
|
|
7
|
+
task?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function runBootstrap(options: BootstrapOptions): Promise<number> {
|
|
11
|
+
const target = parseHostTarget(options.target);
|
|
12
|
+
const template = HOST_TEMPLATES[target];
|
|
13
|
+
const prompt = buildBootstrapPrompt(target, options.task);
|
|
14
|
+
|
|
15
|
+
if (options.asJson) {
|
|
16
|
+
console.log(
|
|
17
|
+
JSON.stringify(
|
|
18
|
+
{
|
|
19
|
+
target,
|
|
20
|
+
title: template.title,
|
|
21
|
+
autoInjectMode: template.autoInjectMode,
|
|
22
|
+
prompt,
|
|
23
|
+
quickCommands: template.quickCommands,
|
|
24
|
+
sessionEntryExamples: template.sessionEntryExamples
|
|
25
|
+
},
|
|
26
|
+
null,
|
|
27
|
+
2
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.log(c.blue(`RAX-FLOW Bootstrap Prompt (${target})`));
|
|
34
|
+
console.log(prompt);
|
|
35
|
+
return 0;
|
|
36
|
+
}
|