rax-flow 0.1.9 → 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.
Files changed (223) hide show
  1. package/dist/bin.js +8 -6
  2. package/dist/bin.js.map +1 -1
  3. package/dist/hub/commands/index.d.ts.map +1 -1
  4. package/dist/hub/commands/index.js +7 -4
  5. package/dist/hub/commands/index.js.map +1 -1
  6. package/dist/hub/event-listener.d.ts +6 -0
  7. package/dist/hub/event-listener.d.ts.map +1 -1
  8. package/dist/hub/event-listener.js +10 -6
  9. package/dist/hub/event-listener.js.map +1 -1
  10. package/dist/hub/index.d.ts.map +1 -1
  11. package/dist/hub/index.js +12 -0
  12. package/dist/hub/index.js.map +1 -1
  13. package/dist/setup/components/ApiKeyInput.d.ts +25 -0
  14. package/dist/setup/components/ApiKeyInput.d.ts.map +1 -0
  15. package/dist/setup/components/ApiKeyInput.js +54 -0
  16. package/dist/setup/components/ApiKeyInput.js.map +1 -0
  17. package/dist/setup/components/AsciiBanner.d.ts +22 -0
  18. package/dist/setup/components/AsciiBanner.d.ts.map +1 -0
  19. package/dist/setup/components/AsciiBanner.js +55 -0
  20. package/dist/setup/components/AsciiBanner.js.map +1 -0
  21. package/dist/setup/components/CliDetector.d.ts +17 -0
  22. package/dist/setup/components/CliDetector.d.ts.map +1 -0
  23. package/dist/setup/components/CliDetector.js +79 -0
  24. package/dist/setup/components/CliDetector.js.map +1 -0
  25. package/dist/setup/components/ModeSelector.d.ts +8 -0
  26. package/dist/setup/components/ModeSelector.d.ts.map +1 -0
  27. package/dist/setup/components/ModeSelector.js +76 -0
  28. package/dist/setup/components/ModeSelector.js.map +1 -0
  29. package/dist/setup/components/ProviderSelector.d.ts +18 -0
  30. package/dist/setup/components/ProviderSelector.d.ts.map +1 -0
  31. package/dist/setup/components/ProviderSelector.js +97 -0
  32. package/dist/setup/components/ProviderSelector.js.map +1 -0
  33. package/dist/setup/components/SetupWizard.d.ts +2 -0
  34. package/dist/setup/components/SetupWizard.d.ts.map +1 -0
  35. package/dist/setup/components/SetupWizard.js +212 -0
  36. package/dist/setup/components/SetupWizard.js.map +1 -0
  37. package/dist/setup/components/StepIndicator.d.ts +13 -0
  38. package/dist/setup/components/StepIndicator.d.ts.map +1 -0
  39. package/dist/setup/components/StepIndicator.js +18 -0
  40. package/dist/setup/components/StepIndicator.js.map +1 -0
  41. package/dist/setup/components/SuccessScreen.d.ts +18 -0
  42. package/dist/setup/components/SuccessScreen.d.ts.map +1 -0
  43. package/dist/setup/components/SuccessScreen.js +38 -0
  44. package/dist/setup/components/SuccessScreen.js.map +1 -0
  45. package/dist/setup/index.d.ts +12 -0
  46. package/dist/setup/index.d.ts.map +1 -0
  47. package/dist/setup/index.js +29 -0
  48. package/dist/setup/index.js.map +1 -0
  49. package/dist/setup/utils/cli-detection.d.ts +12 -0
  50. package/dist/setup/utils/cli-detection.d.ts.map +1 -0
  51. package/dist/setup/utils/cli-detection.js +83 -0
  52. package/dist/setup/utils/cli-detection.js.map +1 -0
  53. package/dist/setup/utils/config-writer.d.ts +43 -0
  54. package/dist/setup/utils/config-writer.d.ts.map +1 -0
  55. package/dist/setup/utils/config-writer.js +180 -0
  56. package/dist/setup/utils/config-writer.js.map +1 -0
  57. package/dist/tui/App.d.ts +2 -1
  58. package/dist/tui/App.d.ts.map +1 -1
  59. package/dist/tui/App.js +78 -18
  60. package/dist/tui/App.js.map +1 -1
  61. package/dist/tui/components/AgentStateIcon.d.ts +18 -0
  62. package/dist/tui/components/AgentStateIcon.d.ts.map +1 -0
  63. package/dist/tui/components/AgentStateIcon.js +57 -0
  64. package/dist/tui/components/AgentStateIcon.js.map +1 -0
  65. package/dist/tui/components/AnimatedBranch.d.ts +39 -0
  66. package/dist/tui/components/AnimatedBranch.d.ts.map +1 -0
  67. package/dist/tui/components/AnimatedBranch.js +64 -0
  68. package/dist/tui/components/AnimatedBranch.js.map +1 -0
  69. package/dist/tui/components/ChatPanel.d.ts +2 -1
  70. package/dist/tui/components/ChatPanel.d.ts.map +1 -1
  71. package/dist/tui/components/ChatPanel.js +47 -28
  72. package/dist/tui/components/ChatPanel.js.map +1 -1
  73. package/dist/tui/components/DAGPanel.d.ts +14 -2
  74. package/dist/tui/components/DAGPanel.d.ts.map +1 -1
  75. package/dist/tui/components/DAGPanel.js +48 -27
  76. package/dist/tui/components/DAGPanel.js.map +1 -1
  77. package/dist/tui/components/ExecutionTimeline.d.ts +34 -0
  78. package/dist/tui/components/ExecutionTimeline.d.ts.map +1 -0
  79. package/dist/tui/components/ExecutionTimeline.js +67 -0
  80. package/dist/tui/components/ExecutionTimeline.js.map +1 -0
  81. package/dist/tui/components/Header.d.ts +2 -1
  82. package/dist/tui/components/Header.d.ts.map +1 -1
  83. package/dist/tui/components/Header.js +23 -20
  84. package/dist/tui/components/Header.js.map +1 -1
  85. package/dist/tui/components/HelpOverlay.d.ts +2 -1
  86. package/dist/tui/components/HelpOverlay.d.ts.map +1 -1
  87. package/dist/tui/components/HelpOverlay.js +59 -41
  88. package/dist/tui/components/HelpOverlay.js.map +1 -1
  89. package/dist/tui/components/InputBar.d.ts +3 -1
  90. package/dist/tui/components/InputBar.d.ts.map +1 -1
  91. package/dist/tui/components/InputBar.js +12 -7
  92. package/dist/tui/components/InputBar.js.map +1 -1
  93. package/dist/tui/components/LogsPanel.d.ts +3 -1
  94. package/dist/tui/components/LogsPanel.d.ts.map +1 -1
  95. package/dist/tui/components/LogsPanel.js +52 -3
  96. package/dist/tui/components/LogsPanel.js.map +1 -1
  97. package/dist/tui/components/MemoryPanel.d.ts +8 -6
  98. package/dist/tui/components/MemoryPanel.d.ts.map +1 -1
  99. package/dist/tui/components/MemoryPanel.js +37 -10
  100. package/dist/tui/components/MemoryPanel.js.map +1 -1
  101. package/dist/tui/components/MetricsPanel.d.ts +12 -7
  102. package/dist/tui/components/MetricsPanel.d.ts.map +1 -1
  103. package/dist/tui/components/MetricsPanel.js +24 -11
  104. package/dist/tui/components/MetricsPanel.js.map +1 -1
  105. package/dist/tui/components/StatusPanel.d.ts +3 -1
  106. package/dist/tui/components/StatusPanel.d.ts.map +1 -1
  107. package/dist/tui/components/StatusPanel.js +20 -18
  108. package/dist/tui/components/StatusPanel.js.map +1 -1
  109. package/dist/tui/components/TaskTree.d.ts +28 -0
  110. package/dist/tui/components/TaskTree.d.ts.map +1 -0
  111. package/dist/tui/components/TaskTree.js +29 -0
  112. package/dist/tui/components/TaskTree.js.map +1 -0
  113. package/dist/tui/components/animations/ProgressBar.d.ts +39 -0
  114. package/dist/tui/components/animations/ProgressBar.d.ts.map +1 -0
  115. package/dist/tui/components/animations/ProgressBar.js +39 -0
  116. package/dist/tui/components/animations/ProgressBar.js.map +1 -0
  117. package/dist/tui/components/animations/Pulse.d.ts +17 -0
  118. package/dist/tui/components/animations/Pulse.d.ts.map +1 -0
  119. package/dist/tui/components/animations/Pulse.js +47 -0
  120. package/dist/tui/components/animations/Pulse.js.map +1 -0
  121. package/dist/tui/components/animations/Spinner.d.ts +13 -0
  122. package/dist/tui/components/animations/Spinner.d.ts.map +1 -0
  123. package/dist/tui/components/animations/Spinner.js +36 -0
  124. package/dist/tui/components/animations/Spinner.js.map +1 -0
  125. package/dist/tui/components/animations/StatusAnimator.d.ts +27 -0
  126. package/dist/tui/components/animations/StatusAnimator.d.ts.map +1 -0
  127. package/dist/tui/components/animations/StatusAnimator.js +85 -0
  128. package/dist/tui/components/animations/StatusAnimator.js.map +1 -0
  129. package/dist/tui/components/animations/TypingEffect.d.ts +26 -0
  130. package/dist/tui/components/animations/TypingEffect.d.ts.map +1 -0
  131. package/dist/tui/components/animations/TypingEffect.js +59 -0
  132. package/dist/tui/components/animations/TypingEffect.js.map +1 -0
  133. package/dist/tui/components/animations/index.d.ts +8 -0
  134. package/dist/tui/components/animations/index.d.ts.map +1 -0
  135. package/dist/tui/components/animations/index.js +6 -0
  136. package/dist/tui/components/animations/index.js.map +1 -0
  137. package/dist/tui/hooks/useAnimation.d.ts +42 -0
  138. package/dist/tui/hooks/useAnimation.d.ts.map +1 -0
  139. package/dist/tui/hooks/useAnimation.js +212 -0
  140. package/dist/tui/hooks/useAnimation.js.map +1 -0
  141. package/dist/tui/hooks/useAppState.d.ts +9 -6
  142. package/dist/tui/hooks/useAppState.d.ts.map +1 -1
  143. package/dist/tui/hooks/useAppState.js +84 -69
  144. package/dist/tui/hooks/useAppState.js.map +1 -1
  145. package/dist/tui/services/orchestrator.d.ts.map +1 -1
  146. package/dist/tui/services/orchestrator.js +47 -3
  147. package/dist/tui/services/orchestrator.js.map +1 -1
  148. package/dist/tui/styles/borders.d.ts +31 -0
  149. package/dist/tui/styles/borders.d.ts.map +1 -0
  150. package/dist/tui/styles/borders.js +47 -0
  151. package/dist/tui/styles/borders.js.map +1 -0
  152. package/dist/tui/styles/colors.d.ts +18 -0
  153. package/dist/tui/styles/colors.d.ts.map +1 -0
  154. package/dist/tui/styles/colors.js +18 -0
  155. package/dist/tui/styles/colors.js.map +1 -0
  156. package/dist/tui/styles/index.d.ts +6 -0
  157. package/dist/tui/styles/index.d.ts.map +1 -0
  158. package/dist/tui/styles/index.js +6 -0
  159. package/dist/tui/styles/index.js.map +1 -0
  160. package/dist/tui/styles/indicators.d.ts +67 -0
  161. package/dist/tui/styles/indicators.d.ts.map +1 -0
  162. package/dist/tui/styles/indicators.js +42 -0
  163. package/dist/tui/styles/indicators.js.map +1 -0
  164. package/dist/tui/styles/layout.d.ts +21 -0
  165. package/dist/tui/styles/layout.d.ts.map +1 -0
  166. package/dist/tui/styles/layout.js +42 -0
  167. package/dist/tui/styles/layout.js.map +1 -0
  168. package/dist/tui/styles/providers.d.ts +77 -0
  169. package/dist/tui/styles/providers.d.ts.map +1 -0
  170. package/dist/tui/styles/providers.js +31 -0
  171. package/dist/tui/styles/providers.js.map +1 -0
  172. package/dist/tui/utils/animation.d.ts +44 -0
  173. package/dist/tui/utils/animation.d.ts.map +1 -0
  174. package/dist/tui/utils/animation.js +107 -0
  175. package/dist/tui/utils/animation.js.map +1 -0
  176. package/package.json +8 -8
  177. package/src/bin.ts +8 -5
  178. package/src/hub/commands/index.ts +7 -4
  179. package/src/hub/event-listener.ts +14 -10
  180. package/src/hub/index.ts +14 -2
  181. package/src/setup/components/ApiKeyInput.tsx +158 -0
  182. package/src/setup/components/AsciiBanner.tsx +125 -0
  183. package/src/setup/components/CliDetector.tsx +230 -0
  184. package/src/setup/components/ModeSelector.tsx +137 -0
  185. package/src/setup/components/ProviderSelector.tsx +174 -0
  186. package/src/setup/components/SetupWizard.tsx +368 -0
  187. package/src/setup/components/StepIndicator.tsx +74 -0
  188. package/src/setup/components/SuccessScreen.tsx +229 -0
  189. package/src/setup/index.ts +34 -0
  190. package/src/setup/utils/cli-detection.ts +99 -0
  191. package/src/setup/utils/config-writer.ts +249 -0
  192. package/src/tui/App.tsx +95 -64
  193. package/src/tui/components/AgentStateIcon.tsx +84 -0
  194. package/src/tui/components/AnimatedBranch.tsx +134 -0
  195. package/src/tui/components/ChatPanel.tsx +85 -43
  196. package/src/tui/components/DAGPanel.tsx +150 -58
  197. package/src/tui/components/ExecutionTimeline.tsx +225 -0
  198. package/src/tui/components/Header.tsx +67 -43
  199. package/src/tui/components/HelpOverlay.tsx +118 -61
  200. package/src/tui/components/InputBar.tsx +33 -19
  201. package/src/tui/components/LogsPanel.tsx +106 -14
  202. package/src/tui/components/MemoryPanel.tsx +106 -42
  203. package/src/tui/components/MetricsPanel.tsx +102 -61
  204. package/src/tui/components/StatusPanel.tsx +84 -37
  205. package/src/tui/components/TaskTree.tsx +159 -0
  206. package/src/tui/components/animations/ProgressBar.tsx +160 -0
  207. package/src/tui/components/animations/Pulse.tsx +73 -0
  208. package/src/tui/components/animations/Spinner.tsx +54 -0
  209. package/src/tui/components/animations/StatusAnimator.tsx +153 -0
  210. package/src/tui/components/animations/TypingEffect.tsx +119 -0
  211. package/src/tui/components/animations/index.ts +16 -0
  212. package/src/tui/hooks/useAnimation.ts +290 -0
  213. package/src/tui/hooks/useAppState.ts +52 -32
  214. package/src/tui/services/orchestrator.ts +57 -4
  215. package/src/tui/styles/borders.ts +51 -0
  216. package/src/tui/styles/colors.ts +19 -0
  217. package/src/tui/styles/index.ts +20 -0
  218. package/src/tui/styles/indicators.ts +54 -0
  219. package/src/tui/styles/layout.ts +44 -0
  220. package/src/tui/styles/providers.ts +32 -0
  221. package/src/tui/utils/animation.ts +124 -0
  222. package/LICENSE +0 -21
  223. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { Text } from "ink";
4
+ import { tuiColors } from "../styles/index.js";
5
+ const THINKING_FRAMES = ["◠", "◡", "◠", "◡"];
6
+ const PROCESSING_FRAMES = ["▶", "▷", "▶", "▷"];
7
+ const RUNNING_FRAMES = ["●", "◉", "●", "○"];
8
+ const WAITING_FRAMES = ["◐", "◓", "◐", "◓"];
9
+ const STATE_CONFIG = {
10
+ idle: { icon: "○", color: tuiColors.textTertiary, animated: false },
11
+ thinking: { icon: "◠", color: tuiColors.warning, animated: true, frames: THINKING_FRAMES },
12
+ processing: { icon: "▶", color: tuiColors.primary, animated: true, frames: PROCESSING_FRAMES },
13
+ running: { icon: "●", color: tuiColors.success, animated: true, frames: RUNNING_FRAMES },
14
+ success: { icon: "✓", color: tuiColors.success, animated: false },
15
+ error: { icon: "✗", color: tuiColors.error, animated: false },
16
+ waiting: { icon: "◐", color: tuiColors.warning, animated: true, frames: WAITING_FRAMES },
17
+ };
18
+ export const AgentStateIcon = memo(function AgentStateIcon({ state, animated = true, tick = 0 }) {
19
+ const config = STATE_CONFIG[state];
20
+ const showAnimation = animated && config.animated && config.frames;
21
+ const icon = useMemo(() => {
22
+ if (showAnimation && config.frames) {
23
+ return config.frames[tick % config.frames.length];
24
+ }
25
+ return config.icon;
26
+ }, [showAnimation, config.frames, config.icon, tick]);
27
+ return _jsx(Text, { color: config.color, children: icon });
28
+ });
29
+ export function useAgentStateFrame(state, tick) {
30
+ const config = STATE_CONFIG[state];
31
+ if (config.frames) {
32
+ return config.frames[tick % config.frames.length];
33
+ }
34
+ return config.icon;
35
+ }
36
+ const STATE_LABELS = {
37
+ idle: "pending",
38
+ thinking: "thinking...",
39
+ processing: "processing",
40
+ running: "running",
41
+ success: "done",
42
+ error: "error",
43
+ waiting: "waiting",
44
+ };
45
+ export const AgentStateWithLabel = memo(function AgentStateWithLabel({ state, label, tick }) {
46
+ return (_jsxs(_Fragment, { children: [_jsx(AgentStateIcon, { state: state, tick: tick }), _jsxs(Text, { color: tuiColors.textSecondary, children: [" ", label] }), _jsxs(Text, { color: tuiColors.textTertiary, children: [" ", STATE_LABELS[state]] })] }));
47
+ });
48
+ export const agentStateColors = {
49
+ idle: tuiColors.textTertiary,
50
+ thinking: tuiColors.warning,
51
+ processing: tuiColors.primary,
52
+ running: tuiColors.success,
53
+ success: tuiColors.success,
54
+ error: tuiColors.error,
55
+ waiting: tuiColors.warning,
56
+ };
57
+ //# sourceMappingURL=AgentStateIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentStateIcon.js","sourceRoot":"","sources":["../../../src/tui/components/AgentStateIcon.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC7C,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC/C,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5C,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE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AC,IAAI,IAAC,KAAK,EAAE,SAAS,CAAC,YAAY,kBAAI,YAAY,CAAC,KAAK,CAAC,IAAQ,IACjE,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,IAAI,EAAE,SAAS,CAAC,YAAY;IAC5B,QAAQ,EAAE,SAAS,CAAC,OAAO;IAC3B,UAAU,EAAE,SAAS,CAAC,OAAO;IAC7B,OAAO,EAAE,SAAS,CAAC,OAAO;IAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;IAC1B,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,OAAO,EAAE,SAAS,CAAC,OAAO;CAC3B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ export type BranchType = 'vertical' | 'horizontal' | 'corner-left' | 'corner-right' | 'branch' | 'last-branch' | 'flow';
3
+ interface AnimatedBranchProps {
4
+ type: BranchType;
5
+ tick?: number;
6
+ animated?: boolean;
7
+ length?: number;
8
+ color?: string;
9
+ }
10
+ export declare const AnimatedBranch: React.NamedExoticComponent<AnimatedBranchProps>;
11
+ interface BranchLineProps {
12
+ tick: number;
13
+ animated?: boolean;
14
+ length?: number;
15
+ color?: string;
16
+ }
17
+ export declare const VerticalBranch: React.NamedExoticComponent<BranchLineProps>;
18
+ export declare const HorizontalBranch: React.NamedExoticComponent<BranchLineProps>;
19
+ export declare const BranchConnector: React.NamedExoticComponent<BranchLineProps>;
20
+ export declare const LastBranchConnector: React.NamedExoticComponent<BranchLineProps>;
21
+ export declare const FlowIndicator: React.NamedExoticComponent<BranchLineProps>;
22
+ interface TaskBranchProps {
23
+ tick: number;
24
+ depth: number;
25
+ isLast: boolean;
26
+ hasChildren?: boolean;
27
+ isExpanded?: boolean;
28
+ color?: string;
29
+ }
30
+ export declare const TaskBranch: React.NamedExoticComponent<TaskBranchProps>;
31
+ interface AnimatedConnectorProps {
32
+ tick: number;
33
+ fromLevel: number;
34
+ toLevel: number;
35
+ isActive: boolean;
36
+ }
37
+ export declare const AnimatedConnector: React.NamedExoticComponent<AnimatedConnectorProps>;
38
+ export {};
39
+ //# sourceMappingURL=AnimatedBranch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimatedBranch.d.ts","sourceRoot":"","sources":["../../../src/tui/components/AnimatedBranch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAQ7C,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AAExH,UAAU,mBAAmB;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,cAAc,iDAmCzB,CAAC;AAEH,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,cAAc,6CAEzB,CAAC;AAEH,eAAO,MAAM,gBAAgB,6CAE3B,CAAC;AAEH,eAAO,MAAM,eAAe,6CAE1B,CAAC;AAEH,eAAO,MAAM,mBAAmB,6CAE9B,CAAC;AAEH,eAAO,MAAM,aAAa,6CAExB,CAAC;AAEH,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,6CAerB,CAAC;AAEH,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,oDAkB5B,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { Box, Text } from "ink";
4
+ import { tuiColors } from "../styles/index.js";
5
+ const VERTICAL_PULSE_FRAMES = ["│", "┃", "│", "┃"];
6
+ const HORIZONTAL_PULSE_FRAMES = ["─", "━", "─", "━"];
7
+ const FLOW_FRAMES = ["◀═══▶", "═◀═══▶", "══◀══▶", "═══◀═▶", "════◀▶", "═▶═══◀", "══▶══◀", "═══▶═◀"];
8
+ export const AnimatedBranch = memo(function AnimatedBranch({ type, tick = 0, animated = true, length = 1, color }) {
9
+ const branchColor = color || tuiColors.textTertiary;
10
+ const getFrame = (frames) => {
11
+ return frames[tick % frames.length];
12
+ };
13
+ const renderBranch = () => {
14
+ switch (type) {
15
+ case 'vertical':
16
+ return animated ? getFrame(VERTICAL_PULSE_FRAMES) : "│";
17
+ case 'horizontal':
18
+ return animated ? getFrame(HORIZONTAL_PULSE_FRAMES).repeat(length) : "─".repeat(length);
19
+ case 'corner-left':
20
+ return "┌";
21
+ case 'corner-right':
22
+ return "┐";
23
+ case 'branch':
24
+ return "├─";
25
+ case 'last-branch':
26
+ return "└─";
27
+ case 'flow':
28
+ return animated ? getFrame(FLOW_FRAMES) : "◀═══▶";
29
+ default:
30
+ return "│";
31
+ }
32
+ };
33
+ return _jsx(Text, { color: branchColor, children: renderBranch() });
34
+ });
35
+ export const VerticalBranch = memo(function VerticalBranch({ tick, animated = true, length = 1, color }) {
36
+ return _jsx(AnimatedBranch, { type: "vertical", tick: tick, animated: animated, color: color });
37
+ });
38
+ export const HorizontalBranch = memo(function HorizontalBranch({ tick, animated = true, length = 1, color }) {
39
+ return _jsx(AnimatedBranch, { type: "horizontal", tick: tick, animated: animated, length: length, color: color });
40
+ });
41
+ export const BranchConnector = memo(function BranchConnector({ tick, animated = true, color }) {
42
+ return _jsx(AnimatedBranch, { type: "branch", tick: tick, animated: animated, color: color });
43
+ });
44
+ export const LastBranchConnector = memo(function LastBranchConnector({ tick, animated = true, color }) {
45
+ return _jsx(AnimatedBranch, { type: "last-branch", tick: tick, animated: animated, color: color });
46
+ });
47
+ export const FlowIndicator = memo(function FlowIndicator({ tick, animated = true, color }) {
48
+ return _jsx(AnimatedBranch, { type: "flow", tick: tick, animated: animated, color: color });
49
+ });
50
+ export const TaskBranch = memo(function TaskBranch({ tick, depth, isLast, hasChildren = false, isExpanded = true, color }) {
51
+ const branchColor = color || tuiColors.textTertiary;
52
+ if (depth === 0) {
53
+ return null;
54
+ }
55
+ const indent = " ".repeat(depth - 1);
56
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: branchColor, children: indent }), _jsx(AnimatedBranch, { type: isLast ? "last-branch" : "branch", tick: tick, color: branchColor })] }));
57
+ });
58
+ export const AnimatedConnector = memo(function AnimatedConnector({ tick, fromLevel, toLevel, isActive }) {
59
+ const color = isActive ? tuiColors.primary : tuiColors.textTertiary;
60
+ const rows = toLevel - fromLevel;
61
+ const connectorElements = useMemo(() => Array.from({ length: rows }).map((_, idx) => (_jsx(Box, { paddingLeft: 2, children: _jsx(AnimatedBranch, { type: "vertical", tick: tick, animated: isActive, color: color }) }, idx))), [rows, tick, isActive, color]);
62
+ return (_jsx(Box, { flexDirection: "column", children: connectorElements }));
63
+ });
64
+ //# sourceMappingURL=AnimatedBranch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimatedBranch.js","sourceRoot":"","sources":["../../../src/tui/components/AnimatedBranch.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EA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AAE,WAAW,GAAI,IACvF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AASH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,iBAAiB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAA0B;IAC7H,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;IACpE,MAAM,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;IAEjC,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,EAAE,CACrC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAC3C,KAAC,GAAG,IAAW,WAAW,EAAE,CAAC,YAC3B,KAAC,cAAc,IAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAI,IADxE,GAAG,CAEP,CACP,CAAC,EACF,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAC9B,CAAC;IAEF,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,YACxB,iBAAiB,GACd,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  interface Message {
2
3
  id: string;
3
4
  type: "user" | "system" | "agent" | "error" | "success";
@@ -10,6 +11,6 @@ interface ChatPanelProps {
10
11
  isProcessing: boolean;
11
12
  isActive: boolean;
12
13
  }
13
- export declare function ChatPanel({ messages, isProcessing, isActive }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare const ChatPanel: React.NamedExoticComponent<ChatPanelProps>;
14
15
  export {};
15
16
  //# sourceMappingURL=ChatPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ChatPanel.tsx"],"names":[],"mappings":"AAGA,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,cAAc;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAuCD,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,cAAc,2CA4B7E"}
1
+ {"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0D,MAAM,OAAO,CAAC;AAK/E,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,cAAc;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAgDD,eAAO,MAAM,SAAS,4CA2DpB,CAAC"}
@@ -1,31 +1,50 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { useState, useEffect, useMemo, memo } from "react";
2
3
  import { Box, Text } from "ink";
3
- function formatTime(date) {
4
- return date.toLocaleTimeString("fr-FR", {
5
- hour: "2-digit",
6
- minute: "2-digit",
7
- second: "2-digit",
8
- });
9
- }
10
- function MessageItem({ message }) {
11
- const typeColors = {
12
- user: "cyan",
13
- system: "gray",
14
- agent: "#f97316",
15
- error: "red",
16
- success: "green",
17
- };
18
- const typeLabels = {
19
- user: "YOU",
20
- system: "SYS",
21
- agent: message.agent || "AGENT",
22
- error: "ERR",
23
- success: "OK",
24
- };
25
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "gray", dimColor: true, children: ["[", formatTime(message.timestamp), "]"] }), _jsxs(Text, { color: typeColors[message.type], bold: true, children: [" [", typeLabels[message.type], "]"] }), message.agent && _jsxs(Text, { color: "gray", children: [" [", message.agent, "]"] })] }), _jsx(Text, { color: "white", children: message.content })] }));
26
- }
27
- export function ChatPanel({ messages, isProcessing, isActive }) {
28
- const borderColor = isActive ? "#f97316" : "gray";
29
- return (_jsxs(Box, { flexDirection: "column", flexGrow: 2, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { borderStyle: "single", borderColor: "#f97316", marginBottom: 1, children: [_jsx(Text, { color: "#f97316", bold: true, children: "CHAT" }), _jsx(Text, { color: "gray", children: " \u2014 Tapez /help pour les commandes" }), isActive && _jsx(Text, { color: "yellow", children: " [ACTIF]" })] }), _jsxs(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children: [messages.slice(-15).map((msg) => (_jsx(MessageItem, { message: msg }, msg.id))), isProcessing && (_jsx(Box, { children: _jsx(Text, { color: "yellow", children: "\u25CF Processing..." }) }))] })] }));
30
- }
4
+ import { tuiColors, formatTimestamp, getProviderTag } from "../styles/index.js";
5
+ import { TypingEffect, ProcessingIndicator } from "./animations/index.js";
6
+ const MESSAGE_CONFIG = {
7
+ user: { tag: "[YOU]", color: tuiColors.textPrimary },
8
+ system: { tag: "[SYS]", color: tuiColors.textTertiary },
9
+ agent: { tag: "[AGENT]", color: tuiColors.primary },
10
+ error: { tag: "[ERROR]", color: tuiColors.error },
11
+ success: { tag: "[SUCCESS]", color: tuiColors.success },
12
+ };
13
+ const MAX_DISPLAYED_MESSAGES = 12;
14
+ const TYPING_SPEED_PER_CHAR = 15;
15
+ const TYPING_BUFFER_MS = 500;
16
+ const MessageItem = memo(function MessageItem({ message, animate = false }) {
17
+ const config = MESSAGE_CONFIG[message.type];
18
+ const providerInfo = useMemo(() => message.agent ? getProviderTag(message.agent) : null, [message.agent]);
19
+ const tag = message.type === "agent" && message.agent
20
+ ? `[${message.agent.toUpperCase().slice(0, 8)}]`
21
+ : config.tag;
22
+ const formattedTime = useMemo(() => formatTimestamp(message.timestamp), [message.timestamp]);
23
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: tuiColors.textTertiary, children: ["[", formattedTime, "]"] }), _jsx(Text, { color: config.color, bold: true, children: tag.padEnd(12) }), providerInfo && (_jsx(Text, { color: tuiColors.textTertiary, children: providerInfo.code }))] }), animate ? (_jsx(TypingEffect, { text: message.content, speed: TYPING_SPEED_PER_CHAR, showCursor: false })) : (_jsxs(Text, { color: tuiColors.textPrimary, children: [" ", message.content] }))] }));
24
+ });
25
+ export const ChatPanel = memo(function ChatPanel({ messages, isProcessing, isActive }) {
26
+ const borderColor = isActive ? tuiColors.primary : tuiColors.border;
27
+ const [animatingMessageId, setAnimatingMessageId] = useState(null);
28
+ const timeoutRef = React.useRef(null);
29
+ const displayMessages = useMemo(() => messages.slice(-MAX_DISPLAYED_MESSAGES), [messages]);
30
+ useEffect(() => {
31
+ if (messages.length === 0)
32
+ return;
33
+ const lastMessage = messages[messages.length - 1];
34
+ if (lastMessage.type !== "agent" && lastMessage.type !== "system")
35
+ return;
36
+ if (timeoutRef.current)
37
+ clearTimeout(timeoutRef.current);
38
+ setAnimatingMessageId(lastMessage.id);
39
+ timeoutRef.current = setTimeout(() => {
40
+ setAnimatingMessageId(null);
41
+ }, lastMessage.content.length * TYPING_SPEED_PER_CHAR + TYPING_BUFFER_MS);
42
+ return () => {
43
+ if (timeoutRef.current)
44
+ clearTimeout(timeoutRef.current);
45
+ };
46
+ }, [messages]);
47
+ const messageElements = useMemo(() => displayMessages.map((msg) => (_jsx(MessageItem, { message: msg, animate: msg.id === animatingMessageId }, msg.id))), [displayMessages, animatingMessageId]);
48
+ return (_jsxs(Box, { flexDirection: "column", flexGrow: 2, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: tuiColors.primary, bold: true, children: "\u250C\u2500" }), _jsx(Text, { color: tuiColors.primary, bold: true, children: " CHAT " }), _jsx(Text, { color: tuiColors.textTertiary, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" })] }), _jsxs(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children: [messageElements, isProcessing && _jsx(ProcessingIndicator, { text: "Processing" })] })] }));
49
+ });
31
50
  //# sourceMappingURL=ChatPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatPanel.js","sourceRoot":"","sources":["../../../src/tui/components/ChatPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAgBhC,SAAS,UAAU,CAAC,IAAU;IAC5B,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;QACtC,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,OAAO,EAAwB;IACpD,MAAM,UAAU,GAA2B;QACzC,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;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SAAS,CAAC,YAAY,+OAA8C,IAC7E,EAEN,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAC,QAAQ,aACvD,eAAe,EACf,YAAY,IAAI,KAAC,mBAAmB,IAAC,IAAI,EAAC,YAAY,GAAG,IACtD,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,13 +1,25 @@
1
+ import React from "react";
2
+ import { AgentState } from "./AgentStateIcon.js";
3
+ interface DAGSubtask {
4
+ id: string;
5
+ name: string;
6
+ state: AgentState;
7
+ }
1
8
  interface DAGNode {
2
9
  id: string;
3
10
  name: string;
4
11
  status: "pending" | "running" | "done" | "error";
5
12
  agent?: string;
13
+ state?: AgentState;
14
+ executionTime?: number;
15
+ detail?: string;
16
+ subtasks?: DAGSubtask[];
6
17
  }
7
18
  interface DAGLevel {
8
19
  name: string;
9
20
  progress: number;
10
21
  nodes: DAGNode[];
22
+ status?: 'done' | 'running' | 'pending';
11
23
  }
12
24
  interface WorkflowState {
13
25
  levels: DAGLevel[];
@@ -19,6 +31,6 @@ interface DAGPanelProps {
19
31
  tick: number;
20
32
  isActive: boolean;
21
33
  }
22
- export declare function DAGPanel({ workflowState, tick, isActive }: DAGPanelProps): import("react/jsx-runtime").JSX.Element;
23
- export {};
34
+ export declare const DAGPanel: React.NamedExoticComponent<DAGPanelProps>;
35
+ export type { DAGNode, DAGLevel, WorkflowState, DAGSubtask };
24
36
  //# sourceMappingURL=DAGPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DAGPanel.d.ts","sourceRoot":"","sources":["../../../src/tui/components/DAGPanel.tsx"],"names":[],"mappings":"AAGA,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;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AG,SAAS,CAAC;CACzC;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAgHD,UAAU,aAAa;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,QAAQ,2CAqDnB,CAAC;AAEH,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
@@ -1,30 +1,51 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo, memo } from "react";
2
3
  import { Box, Text } from "ink";
3
- const statusIcons = {
4
- pending: { icon: "○", color: "gray" },
5
- running: { icon: "▶", color: "yellow" },
6
- done: { icon: "●", color: "green" },
7
- error: { icon: "", color: "red" },
4
+ import { tuiColors, getStatusIndicator, getSpinnerFrame, treeChars } from "../styles/index.js";
5
+ import { AnimatedProgressBar } from "./animations/index.js";
6
+ import { AgentStateIcon } from "./AgentStateIcon.js";
7
+ const STATE_LABELS = {
8
+ idle: "pending",
9
+ thinking: "thinking...",
10
+ processing: "processing",
11
+ running: "running",
12
+ success: "done",
13
+ error: "error",
14
+ waiting: "waiting",
8
15
  };
9
- const spinnerFrames = ["◐", "◓", "◑", "◒"];
10
- function ProgressBar({ progress, width = 20 }) {
11
- const filled = Math.round((progress / 100) * width);
12
- const empty = width - filled;
13
- const bar = "█".repeat(filled) + "░".repeat(empty);
14
- return (_jsx(Text, { color: progress >= 100 ? "green" : progress > 0 ? "yellow" : "gray", children: bar }));
15
- }
16
- function DAGNodeItem({ node, tick }) {
17
- const { icon, color } = statusIcons[node.status];
18
- const animatedIcon = node.status === "running"
19
- ? spinnerFrames[tick % spinnerFrames.length]
20
- : icon;
21
- return (_jsxs(Box, { flexDirection: "row", marginLeft: 2, children: [_jsx(Text, { color: color, children: animatedIcon }), _jsxs(Text, { color: "white", children: [" ", node.name] }), node.agent && _jsxs(Text, { color: "gray", children: [" [", node.agent, "]"] })] }));
22
- }
23
- function DAGLevelView({ level, tick, isActive }) {
24
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: isActive ? "#f97316" : "gray", bold: isActive, children: level.name }), _jsx(Text, { color: "gray", children: " " }), _jsx(ProgressBar, { progress: level.progress, width: 12 }), _jsxs(Text, { color: "gray", children: [" ", level.progress, "%"] })] }), level.nodes.map((node) => (_jsx(DAGNodeItem, { node: node, tick: tick }, node.id)))] }));
25
- }
26
- export function DAGPanel({ workflowState, tick, isActive }) {
27
- const borderColor = isActive ? "#f97316" : "gray";
28
- return (_jsxs(Box, { flexDirection: "column", width: 40, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { borderStyle: "single", borderColor: "#f97316", marginBottom: 1, children: [_jsx(Text, { color: "#f97316", bold: true, children: "DAG" }), _jsx(Text, { color: "gray", children: " EXECUTION" })] }), _jsx(Box, { flexDirection: "column", flexGrow: 1, children: workflowState.levels.map((level, index) => (_jsx(DAGLevelView, { level: level, tick: tick, isActive: index === workflowState.currentLevel }, level.name))) }), _jsxs(Box, { borderStyle: "single", borderColor: "gray", marginTop: 1, children: [_jsx(Text, { color: "gray", children: "Total: " }), _jsx(ProgressBar, { progress: workflowState.totalProgress, width: 10 }), _jsxs(Text, { color: "white", children: [" ", workflowState.totalProgress, "%"] })] })] }));
29
- }
16
+ const DAGNodeItem = memo(function DAGNodeItem({ node, tick, isLast }) {
17
+ const statusInfo = useMemo(() => getStatusIndicator(node.status), [node.status]);
18
+ const agentState = useMemo(() => {
19
+ if (node.state)
20
+ return node.state;
21
+ if (node.status === 'running')
22
+ return 'running';
23
+ if (node.status === 'done')
24
+ return 'success';
25
+ if (node.status === 'error')
26
+ return 'error';
27
+ return 'idle';
28
+ }, [node.state, node.status]);
29
+ const icon = node.status === "running"
30
+ ? getSpinnerFrame(tick, "dots")
31
+ : statusInfo.icon;
32
+ const prefix = isLast ? treeChars.lastBranch : treeChars.branch;
33
+ const timeStr = node.executionTime ? `${node.executionTime.toFixed(1)}s` : "";
34
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: tuiColors.textTertiary, children: [prefix, " "] }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: tuiColors.textSecondary, children: "[" }), _jsx(AgentStateIcon, { state: agentState, tick: tick }), _jsx(Text, { color: tuiColors.textSecondary, children: "]" })] }), _jsxs(Text, { color: tuiColors.textPrimary, children: [" ", node.name.padEnd(18)] }), timeStr && (_jsxs(Text, { color: tuiColors.textTertiary, children: [" \u25CF ", timeStr] }))] }), node.detail && (_jsx(Box, { flexDirection: "row", children: _jsxs(Text, { color: tuiColors.textTertiary, children: [" \u2514\u2500\u2500 ", node.detail] }) })), node.subtasks && node.subtasks.length > 0 && (_jsx(Box, { flexDirection: "column", children: node.subtasks.map((subtask, idx) => (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: tuiColors.textTertiary, children: [" ", idx === node.subtasks.length - 1 ? '└──' : '├──', " "] }), _jsx(AgentStateIcon, { state: subtask.state, tick: tick }), _jsxs(Text, { color: tuiColors.textTertiary, children: [" ", subtask.name] })] }, subtask.id))) }))] }));
35
+ });
36
+ const DAGLevelView = memo(function DAGLevelView({ level, tick, isActive }) {
37
+ const levelColor = isActive ? tuiColors.primary : tuiColors.textSecondary;
38
+ const statusColor = level.status === 'done'
39
+ ? tuiColors.success
40
+ : level.status === 'running'
41
+ ? tuiColors.warning
42
+ : tuiColors.textTertiary;
43
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: levelColor, bold: true, children: level.name.padEnd(12) }), _jsx(AnimatedProgressBar, { progress: level.progress, width: 16, tick: tick, animated: isActive, showMarker: isActive, glowEffect: isActive })] }), _jsx(Box, { flexDirection: "row", children: _jsx(Text, { color: isActive ? tuiColors.primary : tuiColors.textTertiary, children: isActive ? "┃" : "│" }) }), level.nodes.map((node, idx) => (_jsx(DAGNodeItem, { node: node, tick: tick, isLast: idx === level.nodes.length - 1 }, node.id)))] }));
44
+ });
45
+ export const DAGPanel = memo(function DAGPanel({ workflowState, tick, isActive }) {
46
+ const borderColor = isActive ? tuiColors.primary : tuiColors.border;
47
+ const levelViews = useMemo(() => workflowState.levels.map((level, index) => (_jsx(DAGLevelView, { level: level, tick: tick, isActive: index === workflowState.currentLevel }, level.name))), [workflowState.levels, workflowState.currentLevel, tick]);
48
+ const isAnimating = useMemo(() => workflowState.totalProgress > 0 && workflowState.totalProgress < 100, [workflowState.totalProgress]);
49
+ return (_jsxs(Box, { flexDirection: "column", width: 46, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: tuiColors.primary, bold: true, children: "\u250C\u2500" }), _jsx(Text, { color: tuiColors.primary, bold: true, children: " DAG_EXECUTION " }), _jsx(Text, { color: tuiColors.textTertiary, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" })] }), _jsx(Box, { flexDirection: "column", flexGrow: 1, children: levelViews }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: tuiColors.textTertiary, children: "\u251C\u2500 TOTAL \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }) }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: tuiColors.textSecondary, children: "Progress: " }), _jsx(AnimatedProgressBar, { progress: workflowState.totalProgress, width: 16, tick: tick, animated: isAnimating, showMarker: true })] })] }));
50
+ });
30
51
  //# sourceMappingURL=DAGPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DAGPanel.js","sourceRoot":"","sources":["../../../src/tui/components/DAGPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AA2BhC,MAAM,WAAW,GAAoD;IACnE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE;IACrC,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;IACvC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;IACnC,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;CACnC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE3C,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,EAAwC;IACjF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC7B,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,YACtE,GAAG,GACC,CACR,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,IAAI,EAAE,IA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C,KAAK,EAAE,EAAE,EACT,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,WAAW,EACrB,UAAU,SACV,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ interface TimelineAgent {
3
+ name: string;
4
+ startTime: number;
5
+ endTime?: number;
6
+ isActive: boolean;
7
+ color?: string;
8
+ }
9
+ interface TimelineLevel {
10
+ name: string;
11
+ startTime: number;
12
+ endTime?: number;
13
+ progress: number;
14
+ status: 'done' | 'running' | 'pending';
15
+ }
16
+ export interface ExecutionTimelineProps {
17
+ tick: number;
18
+ totalDuration: number;
19
+ currentTime: number;
20
+ levels: TimelineLevel[];
21
+ agents: TimelineAgent[];
22
+ isActive?: boolean;
23
+ width?: number;
24
+ }
25
+ export declare const ExecutionTimeline: React.NamedExoticComponent<ExecutionTimelineProps>;
26
+ interface MiniTimelineProps {
27
+ progress: number;
28
+ tick: number;
29
+ isActive: boolean;
30
+ width?: number;
31
+ }
32
+ export declare const MiniTimeline: React.NamedExoticComponent<MiniTimelineProps>;
33
+ export {};
34
+ //# sourceMappingURL=ExecutionTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutionTimeline.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ExecutionTimeline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAK7C,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkFD,eAAO,MAAM,iBAAiB,oDAwF5B,CAAC;AAEH,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,+CAgBvB,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { Box, Text } from "ink";
4
+ import { tuiColors } from "../styles/index.js";
5
+ import { AnimatedBranch } from "./AnimatedBranch.js";
6
+ const ACTIVE_MARKER_FRAMES = ["┃", "║", "┃", "║"];
7
+ const BAR_COLORS = {
8
+ done: tuiColors.success,
9
+ running: tuiColors.warning,
10
+ pending: tuiColors.textTertiary,
11
+ };
12
+ const STATUS_TEXT = {
13
+ done: (endTime) => `done at ${endTime?.toFixed(1)}s`,
14
+ running: () => "running...",
15
+ pending: () => "pending",
16
+ };
17
+ function formatTime(s) {
18
+ return `${s}s`;
19
+ }
20
+ const TimelineBar = memo(function TimelineBar({ level, timeScale, width, currentTime }) {
21
+ const startCol = Math.floor(level.startTime * timeScale);
22
+ const endCol = level.endTime
23
+ ? Math.floor(level.endTime * timeScale)
24
+ : Math.floor(currentTime * timeScale);
25
+ const barWidth = Math.max(0, endCol - startCol);
26
+ const beforeBar = "░".repeat(startCol);
27
+ const barChar = level.status === 'done' ? "█" : level.status === 'running' ? "▓" : "░";
28
+ const afterBar = "░".repeat(Math.max(0, width - endCol));
29
+ const statusText = STATUS_TEXT[level.status](level.endTime);
30
+ const paddedName = useMemo(() => level.name.padEnd(4), [level.name]);
31
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: tuiColors.textTertiary, children: [paddedName, " "] }), _jsxs(Text, { color: BAR_COLORS[level.status], children: [beforeBar, barChar.repeat(barWidth)] }), _jsx(Text, { color: tuiColors.textTertiary, children: afterBar }), _jsxs(Text, { color: tuiColors.textTertiary, children: [" ", statusText] })] }));
32
+ });
33
+ const AgentTimeline = memo(function AgentTimeline({ agent, timeScale, width, currentTime }) {
34
+ const startCol = Math.floor(agent.startTime * timeScale);
35
+ const endCol = agent.endTime
36
+ ? Math.floor(agent.endTime * timeScale)
37
+ : Math.floor(currentTime * timeScale);
38
+ const barWidth = Math.max(0, endCol - startCol);
39
+ const indent = " ".repeat(startCol);
40
+ const bar = agent.isActive ? "─".repeat(barWidth) + "▶" : "─".repeat(barWidth) + "┘";
41
+ const afterBar = " ".repeat(Math.max(0, width - endCol - 1));
42
+ const agentColor = agent.color || (agent.isActive ? tuiColors.primary : tuiColors.textSecondary);
43
+ const prefix = agent.isActive ? "▶" : "●";
44
+ const paddedName = useMemo(() => agent.name.padEnd(10), [agent.name]);
45
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: agentColor, children: [prefix, " ", paddedName, " "] }), _jsx(Text, { color: tuiColors.textTertiary, children: indent }), _jsx(Text, { color: agentColor, children: bar }), _jsx(Text, { color: tuiColors.textTertiary, children: afterBar })] }));
46
+ });
47
+ export const ExecutionTimeline = memo(function ExecutionTimeline({ tick, totalDuration, currentTime, levels, agents, isActive = false, width = 50, }) {
48
+ const borderColor = isActive ? tuiColors.primary : tuiColors.border;
49
+ const timeScale = width / totalDuration;
50
+ const markerPositions = [0, 5, 10, 15, 20];
51
+ const activeMarker = isActive ? ACTIVE_MARKER_FRAMES[tick % ACTIVE_MARKER_FRAMES.length] : "│";
52
+ const markerElements = useMemo(() => markerPositions.map((pos, idx) => (_jsx(Box, { width: 10, children: _jsx(Text, { color: tuiColors.textTertiary, children: formatTime(pos).padStart(6) }) }, idx))), []);
53
+ const separatorElements = useMemo(() => Array.from({ length: 5 }).map((_, idx) => (_jsx(Box, { width: 10, children: _jsx(Text, { color: tuiColors.textTertiary, children: idx === 0 ? "│" : " │" }) }, idx))), []);
54
+ const levelElements = useMemo(() => levels.map((level, idx) => (_jsx(Box, { marginBottom: 1, children: _jsx(TimelineBar, { level: level, timeScale: timeScale, width: width, currentTime: currentTime }) }, idx))), [levels, timeScale, width, currentTime]);
55
+ const agentElements = useMemo(() => agents.map((agent, idx) => (_jsx(Box, { children: _jsx(AgentTimeline, { agent: agent, timeScale: timeScale, width: width, currentTime: currentTime }) }, idx))), [agents, timeScale, width, currentTime]);
56
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: tuiColors.primary, bold: true, children: "\u250C\u2500" }), _jsx(Text, { color: tuiColors.primary, bold: true, children: " EXECUTION_TIMELINE " }), _jsx(Text, { color: tuiColors.textTertiary, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" })] }), _jsx(Box, { flexDirection: "row", marginBottom: 1, children: markerElements }), _jsx(Box, { flexDirection: "row", marginBottom: 1, children: separatorElements }), _jsx(Box, { flexDirection: "row", marginBottom: 1, children: _jsx(Text, { color: tuiColors.textTertiary, children: "├" + "─".repeat(width - 2) + "┤" }) }), _jsx(Box, { flexDirection: "column", children: levelElements }), _jsx(Box, { flexDirection: "row", marginTop: 1, marginBottom: 1, children: _jsx(AnimatedBranch, { type: "vertical", tick: tick, animated: isActive }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: tuiColors.textSecondary, children: "Agents:" }) }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: agentElements })] }));
57
+ });
58
+ export const MiniTimeline = memo(function MiniTimeline({ progress, tick, isActive, width = 30 }) {
59
+ const filled = Math.floor((progress / 100) * width);
60
+ const empty = width - filled;
61
+ const currentPos = Math.min(filled, width - 1);
62
+ const before = "─".repeat(currentPos);
63
+ const marker = isActive ? "●" : "○";
64
+ const after = "─".repeat(empty);
65
+ return (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: tuiColors.textTertiary, children: ["\u251C", before] }), _jsx(Text, { color: isActive ? tuiColors.primary : tuiColors.textSecondary, children: marker }), _jsxs(Text, { color: tuiColors.textTertiary, children: [after, "\u2524"] })] }));
66
+ });
67
+ //# sourceMappingURL=ExecutionTimeline.js.map