@ranker/raxflow 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/benchmark.d.ts +10 -0
  2. package/dist/bin.d.ts +3 -0
  3. package/dist/bootstrap.d.ts +8 -0
  4. package/dist/bridge-adapter-templates.d.ts +4 -0
  5. package/dist/bridge-test.d.ts +7 -0
  6. package/dist/dashboard.d.ts +4 -0
  7. package/dist/doctor.d.ts +6 -0
  8. package/dist/evolve.d.ts +7 -0
  9. package/dist/host-init-templates.d.ts +16 -0
  10. package/dist/hub/__tests__/commands.test.d.ts +2 -0
  11. package/dist/hub/__tests__/history.test.d.ts +2 -0
  12. package/dist/hub/__tests__/parser.test.d.ts +2 -0
  13. package/dist/hub/commands/agents.d.ts +3 -0
  14. package/dist/hub/commands/index.d.ts +4 -0
  15. package/dist/hub/commands/logs.d.ts +3 -0
  16. package/dist/hub/commands/memory.d.ts +3 -0
  17. package/dist/hub/commands/metrics.d.ts +3 -0
  18. package/dist/hub/commands/providers.d.ts +3 -0
  19. package/dist/hub/commands/run.d.ts +3 -0
  20. package/dist/hub/commands/status.d.ts +3 -0
  21. package/dist/hub/commands/workflows.d.ts +3 -0
  22. package/dist/hub/config-loader.d.ts +4 -0
  23. package/dist/hub/history.d.ts +13 -0
  24. package/dist/hub/index.d.ts +4 -0
  25. package/dist/hub/parser.d.ts +4 -0
  26. package/dist/hub/styles/borders.d.ts +23 -0
  27. package/dist/hub/styles/colors.d.ts +63 -0
  28. package/dist/hub/styles/typography.d.ts +34 -0
  29. package/dist/hub/types.d.ts +27 -0
  30. package/{src/index.ts → dist/index.d.ts} +1 -0
  31. package/dist/init-host.d.ts +10 -0
  32. package/dist/install.d.ts +8 -0
  33. package/dist/run.d.ts +16 -0
  34. package/dist/setup/components/ProviderSelector.d.ts.map +1 -1
  35. package/dist/setup/components/ProviderSelector.js +8 -7
  36. package/dist/setup/components/ProviderSelector.js.map +1 -1
  37. package/dist/styles.d.ts +12 -0
  38. package/dist/tui/App.d.ts.map +1 -1
  39. package/dist/tui/App.js +7 -2
  40. package/dist/tui/App.js.map +1 -1
  41. package/dist/tui/components/ChatPanel.d.ts +1 -0
  42. package/dist/tui/components/ChatPanel.d.ts.map +1 -1
  43. package/dist/tui/components/ChatPanel.js +4 -3
  44. package/dist/tui/components/ChatPanel.js.map +1 -1
  45. package/dist/tui/components/DAGPanel.d.ts +1 -0
  46. package/dist/tui/components/DAGPanel.d.ts.map +1 -1
  47. package/dist/tui/components/DAGPanel.js +4 -3
  48. package/dist/tui/components/DAGPanel.js.map +1 -1
  49. package/dist/tui/components/Header.d.ts.map +1 -1
  50. package/dist/tui/components/Header.js +1 -1
  51. package/dist/tui/components/Header.js.map +1 -1
  52. package/dist/tui/components/InputBar.d.ts.map +1 -1
  53. package/dist/tui/components/InputBar.js +1 -1
  54. package/dist/tui/components/InputBar.js.map +1 -1
  55. package/dist/tui/components/LogsPanel.d.ts +1 -0
  56. package/dist/tui/components/LogsPanel.d.ts.map +1 -1
  57. package/dist/tui/components/LogsPanel.js +4 -3
  58. package/dist/tui/components/LogsPanel.js.map +1 -1
  59. package/dist/tui/components/MemoryPanel.d.ts +1 -0
  60. package/dist/tui/components/MemoryPanel.d.ts.map +1 -1
  61. package/dist/tui/components/MemoryPanel.js +2 -2
  62. package/dist/tui/components/MemoryPanel.js.map +1 -1
  63. package/dist/tui/components/MetricsPanel.d.ts +1 -0
  64. package/dist/tui/components/MetricsPanel.d.ts.map +1 -1
  65. package/dist/tui/components/MetricsPanel.js +2 -2
  66. package/dist/tui/components/MetricsPanel.js.map +1 -1
  67. package/dist/tui/components/StatusPanel.d.ts +1 -0
  68. package/dist/tui/components/StatusPanel.d.ts.map +1 -1
  69. package/dist/tui/components/StatusPanel.js +4 -3
  70. package/dist/tui/components/StatusPanel.js.map +1 -1
  71. package/dist/vendor-manifests.d.ts +22 -0
  72. package/package.json +5 -1
  73. package/dashboard/index.html +0 -420
  74. package/dist/hub/chat/ChatApp.d.ts +0 -2
  75. package/dist/hub/chat/ChatApp.d.ts.map +0 -1
  76. package/dist/hub/chat/ChatApp.js +0 -146
  77. package/dist/hub/chat/ChatApp.js.map +0 -1
  78. package/dist/hub/chat/components/ChatInput.d.ts +0 -9
  79. package/dist/hub/chat/components/ChatInput.d.ts.map +0 -1
  80. package/dist/hub/chat/components/ChatInput.js +0 -19
  81. package/dist/hub/chat/components/ChatInput.js.map +0 -1
  82. package/dist/hub/chat/components/MessageList.d.ts +0 -7
  83. package/dist/hub/chat/components/MessageList.d.ts.map +0 -1
  84. package/dist/hub/chat/components/MessageList.js +0 -6
  85. package/dist/hub/chat/components/MessageList.js.map +0 -1
  86. package/dist/hub/chat/context.d.ts.map +0 -1
  87. package/dist/hub/chat/context.js +0 -42
  88. package/dist/hub/chat/context.js.map +0 -1
  89. package/dist/hub/chat/hooks/useChatHistory.d.ts +0 -7
  90. package/dist/hub/chat/hooks/useChatHistory.d.ts.map +0 -1
  91. package/dist/hub/chat/hooks/useChatHistory.js +0 -31
  92. package/dist/hub/chat/hooks/useChatHistory.js.map +0 -1
  93. package/dist/hub/chat/index.d.ts.map +0 -1
  94. package/dist/hub/chat/index.js +0 -7
  95. package/dist/hub/chat/index.js.map +0 -1
  96. package/dist/hub/chat/intent-parser.d.ts.map +0 -1
  97. package/dist/hub/chat/intent-parser.js +0 -48
  98. package/dist/hub/chat/intent-parser.js.map +0 -1
  99. package/dist/hub/chat/types.d.ts.map +0 -1
  100. package/dist/hub/chat/types.js +0 -2
  101. package/dist/hub/chat/types.js.map +0 -1
  102. package/dist/hub/tui/App.d.ts +0 -2
  103. package/dist/hub/tui/App.d.ts.map +0 -1
  104. package/dist/hub/tui/App.js +0 -53
  105. package/dist/hub/tui/App.js.map +0 -1
  106. package/dist/hub/tui/components/AgentQueue.d.ts +0 -6
  107. package/dist/hub/tui/components/AgentQueue.d.ts.map +0 -1
  108. package/dist/hub/tui/components/AgentQueue.js +0 -20
  109. package/dist/hub/tui/components/AgentQueue.js.map +0 -1
  110. package/dist/hub/tui/components/DAGPanel.d.ts +0 -16
  111. package/dist/hub/tui/components/DAGPanel.d.ts.map +0 -1
  112. package/dist/hub/tui/components/DAGPanel.js +0 -51
  113. package/dist/hub/tui/components/DAGPanel.js.map +0 -1
  114. package/dist/hub/tui/components/Header.d.ts +0 -7
  115. package/dist/hub/tui/components/Header.d.ts.map +0 -1
  116. package/dist/hub/tui/components/Header.js +0 -17
  117. package/dist/hub/tui/components/Header.js.map +0 -1
  118. package/dist/hub/tui/components/LogsPanel.d.ts +0 -6
  119. package/dist/hub/tui/components/LogsPanel.d.ts.map +0 -1
  120. package/dist/hub/tui/components/LogsPanel.js +0 -26
  121. package/dist/hub/tui/components/LogsPanel.js.map +0 -1
  122. package/dist/hub/tui/components/StatusBar.d.ts +0 -8
  123. package/dist/hub/tui/components/StatusBar.d.ts.map +0 -1
  124. package/dist/hub/tui/components/StatusBar.js +0 -7
  125. package/dist/hub/tui/components/StatusBar.js.map +0 -1
  126. package/dist/hub/tui/hooks/useEvents.d.ts +0 -2
  127. package/dist/hub/tui/hooks/useEvents.d.ts.map +0 -1
  128. package/dist/hub/tui/hooks/useEvents.js +0 -13
  129. package/dist/hub/tui/hooks/useEvents.js.map +0 -1
  130. package/dist/hub/tui/index.d.ts.map +0 -1
  131. package/dist/hub/tui/index.js +0 -7
  132. package/dist/hub/tui/index.js.map +0 -1
  133. package/dist/hub/tui/types.d.ts.map +0 -1
  134. package/dist/hub/tui/types.js +0 -2
  135. package/dist/hub/tui/types.js.map +0 -1
  136. package/src/benchmark.ts +0 -156
  137. package/src/bin.ts +0 -156
  138. package/src/bootstrap.ts +0 -36
  139. package/src/bridge-adapter-templates.ts +0 -181
  140. package/src/bridge-test.ts +0 -107
  141. package/src/dashboard.ts +0 -51
  142. package/src/doctor.ts +0 -92
  143. package/src/evolve.ts +0 -74
  144. package/src/host-init-templates.ts +0 -134
  145. package/src/hub/__tests__/commands.test.ts +0 -84
  146. package/src/hub/__tests__/history.test.ts +0 -137
  147. package/src/hub/__tests__/parser.test.ts +0 -105
  148. package/src/hub/commands/agents.ts +0 -53
  149. package/src/hub/commands/index.ts +0 -140
  150. package/src/hub/commands/logs.ts +0 -70
  151. package/src/hub/commands/memory.ts +0 -47
  152. package/src/hub/commands/metrics.ts +0 -49
  153. package/src/hub/commands/providers.ts +0 -39
  154. package/src/hub/commands/run.ts +0 -37
  155. package/src/hub/commands/status.ts +0 -69
  156. package/src/hub/commands/workflows.ts +0 -64
  157. package/src/hub/config-loader.ts +0 -37
  158. package/src/hub/event-listener.ts +0 -17
  159. package/src/hub/history.ts +0 -66
  160. package/src/hub/index.ts +0 -132
  161. package/src/hub/parser.ts +0 -107
  162. package/src/hub/styles/borders.ts +0 -74
  163. package/src/hub/styles/colors.ts +0 -129
  164. package/src/hub/styles/typography.ts +0 -68
  165. package/src/hub/types.ts +0 -31
  166. package/src/init-host.ts +0 -285
  167. package/src/install.ts +0 -118
  168. package/src/run.ts +0 -317
  169. package/src/setup/components/ApiKeyInput.tsx +0 -158
  170. package/src/setup/components/AsciiBanner.tsx +0 -125
  171. package/src/setup/components/CliDetector.tsx +0 -230
  172. package/src/setup/components/ModeSelector.tsx +0 -137
  173. package/src/setup/components/ProviderSelector.tsx +0 -174
  174. package/src/setup/components/SetupWizard.tsx +0 -368
  175. package/src/setup/components/StepIndicator.tsx +0 -74
  176. package/src/setup/components/SuccessScreen.tsx +0 -229
  177. package/src/setup/index.ts +0 -34
  178. package/src/setup/utils/cli-detection.ts +0 -99
  179. package/src/setup/utils/config-writer.ts +0 -249
  180. package/src/styles.ts +0 -12
  181. package/src/tui/App.tsx +0 -177
  182. package/src/tui/components/AgentStateIcon.tsx +0 -84
  183. package/src/tui/components/AnimatedBranch.tsx +0 -134
  184. package/src/tui/components/ChatPanel.tsx +0 -125
  185. package/src/tui/components/DAGPanel.tsx +0 -208
  186. package/src/tui/components/ExecutionTimeline.tsx +0 -225
  187. package/src/tui/components/Header.tsx +0 -109
  188. package/src/tui/components/HelpOverlay.tsx +0 -140
  189. package/src/tui/components/InputBar.tsx +0 -69
  190. package/src/tui/components/LogsPanel.tsx +0 -129
  191. package/src/tui/components/MemoryPanel.tsx +0 -163
  192. package/src/tui/components/MetricsPanel.tsx +0 -149
  193. package/src/tui/components/StatusPanel.tsx +0 -137
  194. package/src/tui/components/TaskTree.tsx +0 -159
  195. package/src/tui/components/animations/ProgressBar.tsx +0 -160
  196. package/src/tui/components/animations/Pulse.tsx +0 -73
  197. package/src/tui/components/animations/Spinner.tsx +0 -54
  198. package/src/tui/components/animations/StatusAnimator.tsx +0 -153
  199. package/src/tui/components/animations/TypingEffect.tsx +0 -119
  200. package/src/tui/components/animations/index.ts +0 -16
  201. package/src/tui/hooks/useAnimation.ts +0 -290
  202. package/src/tui/hooks/useAppState.ts +0 -403
  203. package/src/tui/index.ts +0 -9
  204. package/src/tui/services/orchestrator.ts +0 -195
  205. package/src/tui/styles/borders.ts +0 -51
  206. package/src/tui/styles/colors.ts +0 -19
  207. package/src/tui/styles/index.ts +0 -20
  208. package/src/tui/styles/indicators.ts +0 -54
  209. package/src/tui/styles/layout.ts +0 -44
  210. package/src/tui/styles/providers.ts +0 -32
  211. package/src/tui/utils/animation.ts +0 -124
  212. package/src/vendor-manifests.ts +0 -113
  213. package/src/ws-relay.ts +0 -156
  214. package/tsconfig.json +0 -28
@@ -1,368 +0,0 @@
1
- import React, { useState, useCallback, useEffect } from "react";
2
- import { Box, Text, useApp, useInput } from "ink";
3
- import { AsciiBanner } from "./AsciiBanner.js";
4
- import { StepIndicator } from "./StepIndicator.js";
5
- import { ProviderSelector, PROVIDERS } from "./ProviderSelector.js";
6
- import { ApiKeyCollector } from "./ApiKeyInput.js";
7
- import { ModeSelector } from "./ModeSelector.js";
8
- import { CliDetector, CliSelector, DetectedCli } from "./CliDetector.js";
9
- import { SuccessScreen, ErrorScreen } from "./SuccessScreen.js";
10
- import {
11
- writeRaxrc,
12
- writeHubBootstrap,
13
- writeStandaloneConfig,
14
- SetupConfig,
15
- } from "../utils/config-writer.js";
16
-
17
- type SetupStep =
18
- | "welcome"
19
- | "providers"
20
- | "apikeys"
21
- | "mode"
22
- | "hub"
23
- | "cli-select"
24
- | "standalone"
25
- | "complete"
26
- | "error";
27
-
28
- const STEPS = ["Welcome", "Providers", "API Keys", "Mode", "Configure", "Complete"];
29
- const TOTAL_STEPS = 5;
30
-
31
- interface WizardState {
32
- step: SetupStep;
33
- selectedProviders: string[];
34
- apiKeys: Record<string, string>;
35
- mode: "hub" | "standalone" | "both" | null;
36
- detectedClis: DetectedCli[];
37
- selectedClis: string[];
38
- filesCreated: string[];
39
- error: string | null;
40
- currentKeyIndex: number;
41
- }
42
-
43
- export function SetupWizard() {
44
- const { exit } = useApp();
45
-
46
- const [state, setState] = useState<WizardState>({
47
- step: "welcome",
48
- selectedProviders: [],
49
- apiKeys: {},
50
- mode: null,
51
- detectedClis: [],
52
- selectedClis: [],
53
- filesCreated: [],
54
- error: null,
55
- currentKeyIndex: 0,
56
- });
57
-
58
- const PRIMARY = "#f97316";
59
-
60
- const getStepNumber = useCallback(() => {
61
- switch (state.step) {
62
- case "welcome":
63
- return 1;
64
- case "providers":
65
- return 2;
66
- case "apikeys":
67
- return 2;
68
- case "mode":
69
- return 3;
70
- case "hub":
71
- case "cli-select":
72
- case "standalone":
73
- return 4;
74
- case "complete":
75
- return 5;
76
- default:
77
- return 1;
78
- }
79
- }, [state.step]);
80
-
81
- useInput((input, key) => {
82
- if (state.step === "welcome") {
83
- if (key.return || input === " ") {
84
- setState((s) => ({ ...s, step: "providers" }));
85
- }
86
- }
87
-
88
- if (state.step === "complete") {
89
- exit();
90
- }
91
-
92
- if (state.step === "error") {
93
- if (input.toLowerCase() === "e" || key.escape) {
94
- exit();
95
- }
96
- }
97
-
98
- if (key.ctrl && input === "c") {
99
- exit();
100
- }
101
- });
102
-
103
- const handleProviderToggle = useCallback((providerId: string) => {
104
- setState((s) => ({
105
- ...s,
106
- selectedProviders: s.selectedProviders.includes(providerId)
107
- ? s.selectedProviders.filter((id) => id !== providerId)
108
- : [...s.selectedProviders, providerId],
109
- }));
110
- }, []);
111
-
112
- const handleProviderContinue = useCallback(() => {
113
- const providersNeedingKeys = PROVIDERS.filter(
114
- (p) => p.requiresApiKey && state.selectedProviders.includes(p.id)
115
- );
116
-
117
- if (providersNeedingKeys.length > 0) {
118
- setState((s) => ({ ...s, step: "apikeys", currentKeyIndex: 0 }));
119
- } else {
120
- setState((s) => ({ ...s, step: "mode" }));
121
- }
122
- }, [state.selectedProviders]);
123
-
124
- const handleApiKeySet = useCallback((providerId: string, key: string) => {
125
- setState((s) => ({
126
- ...s,
127
- apiKeys: { ...s.apiKeys, [providerId]: key },
128
- step: "mode",
129
- }));
130
- }, []);
131
-
132
- const handleApiKeySkip = useCallback(() => {
133
- setState((s) => ({ ...s, step: "mode" }));
134
- }, []);
135
-
136
- const handleModeSelect = useCallback((mode: "hub" | "standalone" | "both") => {
137
- setState((s) => ({ ...s, mode }));
138
- }, []);
139
-
140
- const handleModeContinue = useCallback(() => {
141
- if (state.mode === "hub" || state.mode === "both") {
142
- setState((s) => ({ ...s, step: "hub" }));
143
- } else {
144
- setState((s) => ({ ...s, step: "standalone" }));
145
- }
146
- }, [state.mode]);
147
-
148
- const handleClisDetected = useCallback((clis: DetectedCli[]) => {
149
- setState((s) => ({ ...s, detectedClis: clis }));
150
- }, []);
151
-
152
- const handleHubContinue = useCallback(() => {
153
- const availableClis = state.detectedClis.filter((c) => c.detected);
154
- if (availableClis.length > 0) {
155
- setState((s) => ({ ...s, step: "cli-select" }));
156
- } else {
157
- setState((s) => ({ ...s, step: "standalone" }));
158
- }
159
- }, [state.detectedClis]);
160
-
161
- const handleCliToggle = useCallback((cliId: string) => {
162
- setState((s) => ({
163
- ...s,
164
- selectedClis: s.selectedClis.includes(cliId)
165
- ? s.selectedClis.filter((id) => id !== cliId)
166
- : [...s.selectedClis, cliId],
167
- }));
168
- }, []);
169
-
170
- const handleCliSelectContinue = useCallback(() => {
171
- setState((s) => ({ ...s, step: "standalone" }));
172
- }, []);
173
-
174
- const handleBack = useCallback((targetStep: SetupStep) => {
175
- setState((s) => ({ ...s, step: targetStep }));
176
- }, []);
177
-
178
- const runFinalSetup = useCallback(async () => {
179
- try {
180
- const config: SetupConfig = {
181
- mode: state.mode!,
182
- providers: state.selectedProviders.map((id) => ({
183
- id,
184
- name: PROVIDERS.find((p) => p.id === id)?.name || id,
185
- apiKey: state.apiKeys[id],
186
- })),
187
- defaultProvider: state.selectedProviders[0] === "host" ? "host" : state.selectedProviders[0] || "openai",
188
- hubTargets: state.selectedClis,
189
- projectPath: process.cwd(),
190
- };
191
-
192
- const files: string[] = [];
193
-
194
- const raxrcPath = await writeRaxrc(process.cwd(), config);
195
- files.push(raxrcPath);
196
-
197
- if (state.mode === "hub" || state.mode === "both") {
198
- for (const cliId of state.selectedClis) {
199
- const cli = state.detectedClis.find((c) => c.id === cliId);
200
- if (cli?.configPath) {
201
- const bootstrapPath = await writeHubBootstrap(
202
- cliId,
203
- cli.configPath,
204
- process.cwd()
205
- );
206
- files.push(bootstrapPath);
207
- }
208
- }
209
- }
210
-
211
- if (state.mode === "standalone" || state.mode === "both") {
212
- const { raxFlowDir, globalDir } = await writeStandaloneConfig(process.cwd());
213
- files.push(raxFlowDir);
214
- files.push(globalDir);
215
- }
216
-
217
- setState((s) => ({
218
- ...s,
219
- filesCreated: files,
220
- step: "complete",
221
- }));
222
- } catch (err) {
223
- setState((s) => ({
224
- ...s,
225
- error: err instanceof Error ? err.message : "Unknown error",
226
- step: "error",
227
- }));
228
- }
229
- }, [state.mode, state.selectedProviders, state.apiKeys, state.selectedClis, state.detectedClis]);
230
-
231
- useEffect(() => {
232
- if (state.step === "standalone") {
233
- runFinalSetup();
234
- }
235
- }, [state.step, runFinalSetup]);
236
-
237
- const renderStep = () => {
238
- switch (state.step) {
239
- case "welcome":
240
- return (
241
- <Box flexDirection="column" alignItems="center">
242
- <AsciiBanner />
243
- <Box marginTop={2} marginBottom={1}>
244
- <Text color="#a1a1aa">
245
- Welcome to the RAXFLOW Setup Wizard
246
- </Text>
247
- </Box>
248
- <Box marginBottom={1}>
249
- <Text color="#71717a" dimColor>
250
- This wizard will help you configure RAXFLOW for your environment.
251
- </Text>
252
- </Box>
253
- <Box marginTop={2}>
254
- <Text color={PRIMARY}>Press ENTER to continue...</Text>
255
- </Box>
256
- </Box>
257
- );
258
-
259
- case "providers":
260
- return (
261
- <ProviderSelector
262
- selectedProviders={state.selectedProviders}
263
- onToggle={handleProviderToggle}
264
- onContinue={handleProviderContinue}
265
- onBack={() => handleBack("welcome")}
266
- />
267
- );
268
-
269
- case "apikeys": {
270
- const providersNeedingKeys = PROVIDERS.filter(
271
- (p) => p.requiresApiKey && state.selectedProviders.includes(p.id)
272
- );
273
- return (
274
- <ApiKeyCollector
275
- providers={providersNeedingKeys}
276
- currentIndex={state.currentKeyIndex}
277
- keys={state.apiKeys}
278
- onSetKey={handleApiKeySet}
279
- onSkip={handleApiKeySkip}
280
- onBack={() => handleBack("providers")}
281
- />
282
- );
283
- }
284
-
285
- case "mode":
286
- return (
287
- <ModeSelector
288
- selectedMode={state.mode}
289
- onSelect={handleModeSelect}
290
- onContinue={handleModeContinue}
291
- />
292
- );
293
-
294
- case "hub":
295
- return (
296
- <CliDetector
297
- onDetected={handleClisDetected}
298
- onContinue={handleHubContinue}
299
- onBack={() => handleBack("mode")}
300
- />
301
- );
302
-
303
- case "cli-select":
304
- return (
305
- <CliSelector
306
- detectedClis={state.detectedClis}
307
- selectedClis={state.selectedClis}
308
- onToggle={handleCliToggle}
309
- onContinue={handleCliSelectContinue}
310
- onBack={() => handleBack("hub")}
311
- />
312
- );
313
-
314
- case "standalone":
315
- return (
316
- <Box flexDirection="column" alignItems="center">
317
- <Text color="#f59e0b">Setting up standalone configuration...</Text>
318
- </Box>
319
- );
320
-
321
- case "complete":
322
- return (
323
- <SuccessScreen
324
- summary={{
325
- mode: state.mode!,
326
- providers: state.selectedProviders,
327
- hubTargets: state.selectedClis,
328
- filesCreated: state.filesCreated,
329
- }}
330
- onExit={exit}
331
- />
332
- );
333
-
334
- case "error":
335
- return (
336
- <ErrorScreen
337
- error={state.error || "Unknown error"}
338
- onExit={exit}
339
- />
340
- );
341
-
342
- default:
343
- return null;
344
- }
345
- };
346
-
347
- return (
348
- <Box flexDirection="column" padding={1} height="100%">
349
- {state.step !== "welcome" && state.step !== "complete" && state.step !== "error" && (
350
- <StepIndicator
351
- currentStep={getStepNumber()}
352
- totalSteps={TOTAL_STEPS}
353
- steps={STEPS}
354
- />
355
- )}
356
- <Box flexGrow={1} flexDirection="column">
357
- {renderStep()}
358
- </Box>
359
- {state.step !== "welcome" && state.step !== "complete" && state.step !== "error" && (
360
- <Box marginTop={1}>
361
- <Text color="#71717a" dimColor>
362
- Ctrl+C to exit
363
- </Text>
364
- </Box>
365
- )}
366
- </Box>
367
- );
368
- }
@@ -1,74 +0,0 @@
1
- import React from "react";
2
- import { Box, Text } from "ink";
3
-
4
- interface StepIndicatorProps {
5
- currentStep: number;
6
- totalSteps: number;
7
- steps: string[];
8
- }
9
-
10
- export function StepIndicator({ currentStep, totalSteps, steps }: StepIndicatorProps) {
11
- const PRIMARY = "#f97316";
12
- const SECONDARY = "#a1a1aa";
13
- const BORDER = "#27272a";
14
-
15
- return (
16
- <Box flexDirection="column" marginBottom={1}>
17
- <Box>
18
- <Text color={SECONDARY}>╭</Text>
19
- <Text color={BORDER}>{"─".repeat(58)}</Text>
20
- <Text color={SECONDARY}>╮</Text>
21
- </Box>
22
-
23
- <Box>
24
- <Text color={SECONDARY}>│</Text>
25
- <Box width={58} flexDirection="row">
26
- {steps.map((step, index) => {
27
- const stepNum = index + 1;
28
- const isActive = stepNum === currentStep;
29
- const isCompleted = stepNum < currentStep;
30
-
31
- return (
32
- <Box key={index} marginRight={1}>
33
- {isCompleted ? (
34
- <Text color="#22c55e">✓</Text>
35
- ) : isActive ? (
36
- <Text color={PRIMARY} bold>{`[${stepNum}]`}</Text>
37
- ) : (
38
- <Text color={SECONDARY}>{` ${stepNum} `}</Text>
39
- )}
40
- <Text color={isActive ? PRIMARY : SECONDARY}> {step}</Text>
41
- </Box>
42
- );
43
- })}
44
- </Box>
45
- <Text color={SECONDARY}>│</Text>
46
- </Box>
47
-
48
- <Box>
49
- <Text color={SECONDARY}>╰</Text>
50
- <Text color={BORDER}>{"─".repeat(58)}</Text>
51
- <Text color={SECONDARY}>╯</Text>
52
- </Box>
53
- </Box>
54
- );
55
- }
56
-
57
- interface CompactStepIndicatorProps {
58
- currentStep: number;
59
- totalSteps: number;
60
- }
61
-
62
- export function CompactStepIndicator({ currentStep, totalSteps }: CompactStepIndicatorProps) {
63
- const PRIMARY = "#f97316";
64
-
65
- return (
66
- <Box>
67
- <Text color={PRIMARY} bold>
68
- STEP {currentStep}/{totalSteps}
69
- </Text>
70
- <Text color="#27272a"> │ </Text>
71
- <Text color="#a1a1aa">{"●".repeat(currentStep)}{"○".repeat(totalSteps - currentStep)}</Text>
72
- </Box>
73
- );
74
- }
@@ -1,229 +0,0 @@
1
- import React, { useState, useEffect } from "react";
2
- import { Box, Text } from "ink";
3
-
4
- interface SuccessScreenProps {
5
- summary: {
6
- mode: "hub" | "standalone" | "both";
7
- providers: string[];
8
- hubTargets?: string[];
9
- filesCreated: string[];
10
- warnings?: string[];
11
- };
12
- onExit: () => void;
13
- }
14
-
15
- const CHECKMARK_ANIMATION = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
16
- const SUCCESS_FRAMES = ["✓", "✓", "✓"];
17
-
18
- export function SuccessScreen({ summary, onExit }: SuccessScreenProps) {
19
- const [animFrame, setAnimFrame] = useState(0);
20
- const [showContent, setShowContent] = useState(false);
21
- const PRIMARY = "#f97316";
22
-
23
- useEffect(() => {
24
- const animInterval = setInterval(() => {
25
- setAnimFrame((prev) => {
26
- if (prev < CHECKMARK_ANIMATION.length - 1) {
27
- return prev + 1;
28
- } else {
29
- setShowContent(true);
30
- clearInterval(animInterval);
31
- return prev;
32
- }
33
- });
34
- }, 80);
35
-
36
- return () => clearInterval(animInterval);
37
- }, []);
38
-
39
- useEffect(() => {
40
- if (showContent) {
41
- const timer = setTimeout(() => {
42
- // Auto-close after showing content
43
- }, 5000);
44
- return () => clearTimeout(timer);
45
- }
46
- }, [showContent]);
47
-
48
- return (
49
- <Box flexDirection="column" alignItems="center">
50
- {!showContent ? (
51
- <Box>
52
- <Text color="#22c55e">{CHECKMARK_ANIMATION[animFrame]}</Text>
53
- <Text color="#a1a1aa"> Finalizing setup...</Text>
54
- </Box>
55
- ) : (
56
- <>
57
- <Box marginBottom={1}>
58
- <Text color="#22c55e" bold>
59
- ╔═══════════════════════════════════════════════════════╗
60
- </Text>
61
- </Box>
62
-
63
- <Box>
64
- <Text color="#22c55e" bold>
65
-
66
- </Text>
67
- <Text color="#22c55e" bold>
68
- {" ✓ SETUP COMPLETE "}
69
- </Text>
70
- <Text color="#22c55e" bold>
71
-
72
- </Text>
73
- </Box>
74
-
75
- <Box>
76
- <Text color="#27272a" bold>
77
- ╚═══════════════════════════════════════════════════════╝
78
- </Text>
79
- </Box>
80
-
81
- <Box marginTop={2} flexDirection="column">
82
- <Box marginBottom={1}>
83
- <Text color={PRIMARY} bold>
84
- CONFIGURATION SUMMARY
85
- </Text>
86
- </Box>
87
-
88
- <Box>
89
- <Text color="#a1a1aa">Mode: </Text>
90
- <Text color="#ffffff" bold>
91
- {summary.mode.toUpperCase()}
92
- </Text>
93
- </Box>
94
-
95
- <Box>
96
- <Text color="#a1a1aa">Providers: </Text>
97
- <Text color="#22c55e">{summary.providers.join(", ")}</Text>
98
- </Box>
99
-
100
- {summary.hubTargets && summary.hubTargets.length > 0 && (
101
- <Box>
102
- <Text color="#a1a1aa">Hub Integration: </Text>
103
- <Text color="#f59e0b">{summary.hubTargets.join(", ")}</Text>
104
- </Box>
105
- )}
106
-
107
- <Box marginTop={1}>
108
- <Text color={PRIMARY} bold>
109
- FILES CREATED
110
- </Text>
111
- </Box>
112
-
113
- {summary.filesCreated.map((file, index) => (
114
- <Box key={index}>
115
- <Text color="#22c55e"> ● </Text>
116
- <Text color="#a1a1aa">{file}</Text>
117
- </Box>
118
- ))}
119
-
120
- {summary.warnings && summary.warnings.length > 0 && (
121
- <>
122
- <Box marginTop={1}>
123
- <Text color="#f59e0b" bold>
124
- WARNINGS
125
- </Text>
126
- </Box>
127
- {summary.warnings.map((warning, index) => (
128
- <Box key={index}>
129
- <Text color="#f59e0b"> ⚠ </Text>
130
- <Text color="#a1a1aa">{warning}</Text>
131
- </Box>
132
- ))}
133
- </>
134
- )}
135
- </Box>
136
-
137
- <Box marginTop={2} flexDirection="column">
138
- <Box marginBottom={1}>
139
- <Text color={PRIMARY} bold>
140
- NEXT STEPS
141
- </Text>
142
- </Box>
143
-
144
- <Box>
145
- <Text color="#71717a">1. Run </Text>
146
- <Text color="#f59e0b">raxflow doctor</Text>
147
- <Text color="#71717a"> to verify setup</Text>
148
- </Box>
149
-
150
- <Box>
151
- <Text color="#71717a">2. Try </Text>
152
- <Text color="#f59e0b">raxflow</Text>
153
- <Text color="#71717a"> to launch the hub</Text>
154
- </Box>
155
-
156
- <Box>
157
- <Text color="#71717a">3. Run </Text>
158
- <Text color="#f59e0b">raxflow run --prompt "..." --stream</Text>
159
- <Text color="#71717a"> to execute</Text>
160
- </Box>
161
- </Box>
162
-
163
- <Box marginTop={2}>
164
- <Text color="#27272a">{"─".repeat(55)}</Text>
165
- </Box>
166
-
167
- <Box marginTop={1}>
168
- <Text color={PRIMARY}>
169
- RAXFLOW is now the operational backbone of your CLI workflow.
170
- </Text>
171
- </Box>
172
-
173
- <Box marginTop={1}>
174
- <Text color="#71717a" dimColor>
175
- Press any key to exit...
176
- </Text>
177
- </Box>
178
- </>
179
- )}
180
- </Box>
181
- );
182
- }
183
-
184
- export function ErrorScreen({
185
- error,
186
- onRetry,
187
- onExit,
188
- }: {
189
- error: string;
190
- onRetry?: () => void;
191
- onExit: () => void;
192
- }) {
193
- return (
194
- <Box flexDirection="column" alignItems="center">
195
- <Box marginBottom={1}>
196
- <Text color="#ef4444" bold>
197
- ╔═══════════════════════════════════════════════════════╗
198
- </Text>
199
- </Box>
200
-
201
- <Box>
202
- <Text color="#ef4444" bold>
203
-
204
- </Text>
205
- <Text color="#ef4444" bold>
206
- {" ✗ SETUP FAILED "}
207
- </Text>
208
- <Text color="#ef4444" bold>
209
-
210
- </Text>
211
- </Box>
212
-
213
- <Box>
214
- <Text color="#27272a" bold>
215
- ╚═══════════════════════════════════════════════════════╝
216
- </Text>
217
- </Box>
218
-
219
- <Box marginTop={1}>
220
- <Text color="#ef4444">{error}</Text>
221
- </Box>
222
-
223
- <Box marginTop={2}>
224
- {onRetry && <Text color="#f59e0b">[R] Retry</Text>}
225
- <Text color="#71717a"> [E] Exit</Text>
226
- </Box>
227
- </Box>
228
- );
229
- }
@@ -1,34 +0,0 @@
1
- import { render } from "ink";
2
- import React from "react";
3
- import { SetupWizard } from "./components/SetupWizard.js";
4
-
5
- export async function runSetup(): Promise<number> {
6
- return new Promise((resolve) => {
7
- const { unmount } = render(
8
- React.createElement(SetupWizard)
9
- );
10
-
11
- // Handle process termination
12
- const handleExit = () => {
13
- unmount();
14
- resolve(0);
15
- };
16
-
17
- process.on("exit", handleExit);
18
- process.on("SIGINT", () => {
19
- unmount();
20
- resolve(0);
21
- });
22
- });
23
- }
24
-
25
- export { SetupWizard } from "./components/SetupWizard.js";
26
- export { AsciiBanner, IndustrialDivider, IndustrialBox, StatusIndicator } from "./components/AsciiBanner.js";
27
- export { StepIndicator, CompactStepIndicator } from "./components/StepIndicator.js";
28
- export { ProviderSelector, PROVIDERS } from "./components/ProviderSelector.js";
29
- export { ApiKeyInput, ApiKeyCollector } from "./components/ApiKeyInput.js";
30
- export { CliDetector, CliSelector } from "./components/CliDetector.js";
31
- export { ModeSelector } from "./components/ModeSelector.js";
32
- export { SuccessScreen, ErrorScreen } from "./components/SuccessScreen.js";
33
- export * from "./utils/cli-detection.js";
34
- export * from "./utils/config-writer.js";