@ranker/raxflow 2.0.4 → 2.1.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/dist/hub/components/ChatInput.d.ts +14 -0
- package/dist/hub/components/ChatInput.d.ts.map +1 -0
- package/dist/hub/components/ChatInput.js +14 -0
- package/dist/hub/components/ChatInput.js.map +1 -0
- package/dist/hub/components/ChatMessage.d.ts +14 -0
- package/dist/hub/components/ChatMessage.d.ts.map +1 -0
- package/dist/hub/components/ChatMessage.js +23 -0
- package/dist/hub/components/ChatMessage.js.map +1 -0
- package/dist/hub/components/HubHeader.d.ts +12 -0
- package/dist/hub/components/HubHeader.d.ts.map +1 -0
- package/dist/hub/components/HubHeader.js +12 -0
- package/dist/hub/components/HubHeader.js.map +1 -0
- package/dist/hub/components/index.d.ts +7 -0
- package/dist/hub/components/index.d.ts.map +1 -0
- package/dist/hub/components/index.js +7 -0
- package/dist/hub/components/index.js.map +1 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +7 -6
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/components/ChatPanel.d.ts +1 -1
- package/dist/tui/components/ChatPanel.d.ts.map +1 -1
- package/dist/tui/components/ChatPanel.js +37 -26
- package/dist/tui/components/ChatPanel.js.map +1 -1
- package/dist/tui/components/DAGPanel.d.ts +3 -4
- package/dist/tui/components/DAGPanel.d.ts.map +1 -1
- package/dist/tui/components/DAGPanel.js +44 -36
- package/dist/tui/components/DAGPanel.js.map +1 -1
- package/dist/tui/components/Header.d.ts.map +1 -1
- package/dist/tui/components/Header.js +54 -36
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/HelpOverlay.d.ts.map +1 -1
- package/dist/tui/components/HelpOverlay.js +7 -5
- package/dist/tui/components/HelpOverlay.js.map +1 -1
- package/dist/tui/components/InputBar.d.ts.map +1 -1
- package/dist/tui/components/InputBar.js +25 -13
- package/dist/tui/components/InputBar.js.map +1 -1
- package/dist/tui/components/LogsPanel.d.ts.map +1 -1
- package/dist/tui/components/LogsPanel.js +23 -17
- package/dist/tui/components/LogsPanel.js.map +1 -1
- package/dist/tui/components/MemoryPanel.d.ts +1 -1
- package/dist/tui/components/MemoryPanel.d.ts.map +1 -1
- package/dist/tui/components/MemoryPanel.js +24 -31
- package/dist/tui/components/MemoryPanel.js.map +1 -1
- package/dist/tui/components/MetricsPanel.d.ts +1 -1
- package/dist/tui/components/MetricsPanel.d.ts.map +1 -1
- package/dist/tui/components/MetricsPanel.js +10 -13
- package/dist/tui/components/MetricsPanel.js.map +1 -1
- package/dist/tui/components/SelectMenu.d.ts +20 -0
- package/dist/tui/components/SelectMenu.d.ts.map +1 -0
- package/dist/tui/components/SelectMenu.js +19 -0
- package/dist/tui/components/SelectMenu.js.map +1 -0
- package/dist/tui/components/StatusPanel.d.ts +1 -1
- package/dist/tui/components/StatusPanel.d.ts.map +1 -1
- package/dist/tui/components/StatusPanel.js +26 -18
- package/dist/tui/components/StatusPanel.js.map +1 -1
- package/dist/tui/components/animations/ProgressBar.d.ts +8 -1
- package/dist/tui/components/animations/ProgressBar.d.ts.map +1 -1
- package/dist/tui/components/animations/ProgressBar.js +52 -26
- package/dist/tui/components/animations/ProgressBar.js.map +1 -1
- package/dist/tui/components/animations/Pulse.d.ts +11 -3
- package/dist/tui/components/animations/Pulse.d.ts.map +1 -1
- package/dist/tui/components/animations/Pulse.js +23 -14
- package/dist/tui/components/animations/Pulse.js.map +1 -1
- package/dist/tui/components/animations/Spinner.d.ts +2 -1
- package/dist/tui/components/animations/Spinner.d.ts.map +1 -1
- package/dist/tui/components/animations/Spinner.js +31 -16
- package/dist/tui/components/animations/Spinner.js.map +1 -1
- package/dist/tui/components/animations/StatusAnimator.d.ts +3 -0
- package/dist/tui/components/animations/StatusAnimator.d.ts.map +1 -1
- package/dist/tui/components/animations/StatusAnimator.js +43 -28
- package/dist/tui/components/animations/StatusAnimator.js.map +1 -1
- package/dist/tui/components/animations/TypingEffect.d.ts +1 -0
- package/dist/tui/components/animations/TypingEffect.d.ts.map +1 -1
- package/dist/tui/components/animations/TypingEffect.js +13 -7
- package/dist/tui/components/animations/TypingEffect.js.map +1 -1
- package/dist/tui/components/animations/index.d.ts +3 -2
- package/dist/tui/components/animations/index.d.ts.map +1 -1
- package/dist/tui/components/animations/index.js +2 -2
- package/dist/tui/components/animations/index.js.map +1 -1
- package/dist/tui/components/composed/Button.d.ts +18 -0
- package/dist/tui/components/composed/Button.d.ts.map +1 -0
- package/dist/tui/components/composed/Button.js +22 -0
- package/dist/tui/components/composed/Button.js.map +1 -0
- package/dist/tui/components/composed/Divider.d.ts +13 -0
- package/dist/tui/components/composed/Divider.d.ts.map +1 -0
- package/dist/tui/components/composed/Divider.js +18 -0
- package/dist/tui/components/composed/Divider.js.map +1 -0
- package/dist/tui/components/composed/StatusBadge.d.ts +14 -0
- package/dist/tui/components/composed/StatusBadge.d.ts.map +1 -0
- package/dist/tui/components/composed/StatusBadge.js +28 -0
- package/dist/tui/components/composed/StatusBadge.js.map +1 -0
- package/dist/tui/components/composed/index.d.ts +7 -0
- package/dist/tui/components/composed/index.d.ts.map +1 -0
- package/dist/tui/components/composed/index.js +7 -0
- package/dist/tui/components/composed/index.js.map +1 -0
- package/dist/tui/components/layouts/Container.d.ts +14 -0
- package/dist/tui/components/layouts/Container.d.ts.map +1 -0
- package/dist/tui/components/layouts/Container.js +10 -0
- package/dist/tui/components/layouts/Container.js.map +1 -0
- package/dist/tui/components/layouts/Grid.d.ts +14 -0
- package/dist/tui/components/layouts/Grid.d.ts.map +1 -0
- package/dist/tui/components/layouts/Grid.js +13 -0
- package/dist/tui/components/layouts/Grid.js.map +1 -0
- package/dist/tui/components/layouts/Stack.d.ts +32 -0
- package/dist/tui/components/layouts/Stack.d.ts.map +1 -0
- package/dist/tui/components/layouts/Stack.js +17 -0
- package/dist/tui/components/layouts/Stack.js.map +1 -0
- package/dist/tui/components/layouts/index.d.ts +7 -0
- package/dist/tui/components/layouts/index.d.ts.map +1 -0
- package/dist/tui/components/layouts/index.js +7 -0
- package/dist/tui/components/layouts/index.js.map +1 -0
- package/dist/tui/components/primitives/Box.d.ts +28 -0
- package/dist/tui/components/primitives/Box.d.ts.map +1 -0
- package/dist/tui/components/primitives/Box.js +38 -0
- package/dist/tui/components/primitives/Box.js.map +1 -0
- package/dist/tui/components/primitives/Panel.d.ts +17 -0
- package/dist/tui/components/primitives/Panel.d.ts.map +1 -0
- package/dist/tui/components/primitives/Panel.js +12 -0
- package/dist/tui/components/primitives/Panel.js.map +1 -0
- package/dist/tui/components/primitives/Text.d.ts +18 -0
- package/dist/tui/components/primitives/Text.d.ts.map +1 -0
- package/dist/tui/components/primitives/Text.js +21 -0
- package/dist/tui/components/primitives/Text.js.map +1 -0
- package/dist/tui/components/primitives/index.d.ts +7 -0
- package/dist/tui/components/primitives/index.d.ts.map +1 -0
- package/dist/tui/components/primitives/index.js +7 -0
- package/dist/tui/components/primitives/index.js.map +1 -0
- package/dist/tui/hooks/useTerminalSize.d.ts +3 -0
- package/dist/tui/hooks/useTerminalSize.d.ts.map +1 -1
- package/dist/tui/hooks/useTerminalSize.js +36 -10
- package/dist/tui/hooks/useTerminalSize.js.map +1 -1
- package/dist/tui/styles/colors.d.ts +4 -0
- package/dist/tui/styles/colors.d.ts.map +1 -1
- package/dist/tui/styles/colors.js +54 -14
- package/dist/tui/styles/colors.js.map +1 -1
- package/dist/tui/styles/design-system.d.ts +107 -0
- package/dist/tui/styles/design-system.d.ts.map +1 -0
- package/dist/tui/styles/design-system.js +140 -0
- package/dist/tui/styles/design-system.js.map +1 -0
- package/dist/tui/styles/index.d.ts +4 -2
- package/dist/tui/styles/index.d.ts.map +1 -1
- package/dist/tui/styles/index.js +3 -2
- package/dist/tui/styles/index.js.map +1 -1
- package/dist/tui/styles/themes.d.ts +10 -0
- package/dist/tui/styles/themes.d.ts.map +1 -1
- package/dist/tui/styles/themes.js +137 -47
- package/dist/tui/styles/themes.js.map +1 -1
- package/dist/tui/styles/tokens.d.ts +262 -0
- package/dist/tui/styles/tokens.d.ts.map +1 -0
- package/dist/tui/styles/tokens.js +230 -0
- package/dist/tui/styles/tokens.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
|
-
import { treeChars } from "../styles/index.js";
|
|
5
4
|
import { Pulse } from "./animations/index.js";
|
|
6
5
|
import { getCurrentTheme } from "../styles/colors.js";
|
|
6
|
+
import { indicators } from "../styles/tokens.js";
|
|
7
7
|
const DEFAULT_NODES = [
|
|
8
8
|
{ id: "1", type: "action", label: "code_gen" },
|
|
9
9
|
{ id: "2", type: "file", label: "auth.ts" },
|
|
@@ -18,53 +18,46 @@ const DEFAULT_EDGES = [
|
|
|
18
18
|
{ from: "4", to: "5" },
|
|
19
19
|
{ from: "2", to: "5" },
|
|
20
20
|
];
|
|
21
|
-
const
|
|
22
|
-
action: "
|
|
23
|
-
file: "
|
|
24
|
-
task: "
|
|
25
|
-
test: "
|
|
26
|
-
fix: "
|
|
21
|
+
const NODE_TYPE_COLORS = {
|
|
22
|
+
action: "primary",
|
|
23
|
+
file: "success",
|
|
24
|
+
task: "warning",
|
|
25
|
+
test: "textTertiary",
|
|
26
|
+
fix: "error",
|
|
27
27
|
};
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
test: "#475569",
|
|
33
|
-
fix: "#ef4444",
|
|
34
|
-
};
|
|
35
|
-
const NodeTypeBadge = memo(function NodeTypeBadge({ type, isActive, compact, isDark }) {
|
|
36
|
-
const colors = isDark ? NODE_TYPE_COLORS_DARK : NODE_TYPE_COLORS_LIGHT;
|
|
37
|
-
const color = colors[type] || (isDark ? "#606060" : "#94a3b8");
|
|
28
|
+
const NodeTypeBadge = memo(function NodeTypeBadge({ type, isActive, compact }) {
|
|
29
|
+
const theme = getCurrentTheme();
|
|
30
|
+
const colorKey = NODE_TYPE_COLORS[type] || "textTertiary";
|
|
31
|
+
const color = theme.colors[colorKey] || theme.colors.textTertiary;
|
|
38
32
|
return (_jsxs(Box, { flexDirection: "row", children: [isActive && !compact && _jsx(Pulse, { interval: 400, color: color, type: "pulse" }), _jsxs(Text, { color: color, children: ["[", compact ? type.slice(0, 4) : type, "]"] })] }));
|
|
39
33
|
});
|
|
40
|
-
export const MemoryPanel = memo(function MemoryPanel({ nodes, edges, nodeCount = 0, cacheHitRate = 0, isActive = false, tick = 0, maxHeight = 15, width = 30 }) {
|
|
34
|
+
export const MemoryPanel = memo(function MemoryPanel({ nodes, edges, nodeCount = 0, cacheHitRate = 0, isActive = false, tick = 0, maxHeight = 15, width = 30, }) {
|
|
41
35
|
const theme = getCurrentTheme();
|
|
42
|
-
const isDark = theme.name === "default";
|
|
43
36
|
const borderColor = isActive
|
|
44
|
-
? theme.colors.
|
|
37
|
+
? theme.colors.borderActive
|
|
45
38
|
: theme.colors.border;
|
|
46
39
|
const compact = width < 25 || maxHeight < 12;
|
|
47
|
-
const displayNodes =
|
|
48
|
-
const displayEdges =
|
|
40
|
+
const displayNodes = nodes && nodes.length > 0 ? nodes : DEFAULT_NODES;
|
|
41
|
+
const displayEdges = edges && edges.length > 0 ? edges : DEFAULT_EDGES;
|
|
49
42
|
const displayNodeCount = nodeCount > 0 ? nodeCount : 247;
|
|
50
43
|
const displayCacheHitRate = cacheHitRate > 0 ? cacheHitRate : 94;
|
|
51
44
|
const activeNodeIndex = isActive ? tick % 4 : -1;
|
|
52
45
|
const maxVisibleNodes = compact ? 3 : 4;
|
|
53
46
|
const maxVisibleEdges = compact ? 2 : 3;
|
|
54
47
|
const nodeElements = useMemo(() => displayNodes.slice(0, maxVisibleNodes).map((node, idx) => {
|
|
55
|
-
const isLast = idx === Math.min(maxVisibleNodes - 1, displayNodes.length - 1);
|
|
56
48
|
const isNodeActive = idx === activeNodeIndex;
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
const label = compact ? node.label.slice(0, 8) : node.label;
|
|
50
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: theme.colors.textQuaternary, children: [compact ? " " : "│", " "] }), _jsx(NodeTypeBadge, { type: node.type, isActive: isNodeActive, compact: compact }), _jsxs(Text, { color: theme.colors.textPrimary, children: [" ", label] })] }, node.id));
|
|
51
|
+
}), [displayNodes, activeNodeIndex, compact, maxVisibleNodes, theme]);
|
|
59
52
|
const edgeElements = useMemo(() => displayEdges.slice(0, maxVisibleEdges).map((edge, i) => {
|
|
60
53
|
const fromNode = displayNodes.find((n) => n.id === edge.from);
|
|
61
54
|
const toNode = displayNodes.find((n) => n.id === edge.to);
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
const fromLabel = compact ? (fromNode?.label || "?").slice(0, 6) : fromNode?.label || "?";
|
|
56
|
+
const toLabel = compact ? (toNode?.label || "?").slice(0, 6) : toNode?.label || "?";
|
|
57
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.colors.textQuaternary, children: "\u251C\u2500" }), _jsxs(Text, { color: theme.colors.textPrimary, children: [" ", fromLabel] }), _jsxs(Text, { color: theme.colors.primary, children: [" ", indicators.arrow, " "] }), _jsx(Text, { color: theme.colors.textPrimary, children: toLabel })] }, i));
|
|
58
|
+
}), [displayEdges, displayNodes, compact, maxVisibleEdges, theme]);
|
|
64
59
|
const mutationCount = useMemo(() => Math.floor(Math.random() * 4) + 1, [tick]);
|
|
65
|
-
const title = "
|
|
66
|
-
|
|
67
|
-
const successColor = isDark ? "#22c55e" : "#10b981";
|
|
68
|
-
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, width: width, height: maxHeight, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { marginBottom: 1, flexShrink: 0, children: [_jsx(Text, { color: primaryColor, bold: true, children: "\u250C\u2500" }), _jsx(Text, { color: primaryColor, bold: true, children: title }), _jsxs(Text, { color: isDark ? "#606060" : "#94a3b8", children: [" n:", displayNodeCount, " "] }), isActive && !compact && _jsx(Pulse, { interval: 500, color: primaryColor, type: "pulse" })] }), !compact && (_jsx(Box, { flexDirection: "column", flexShrink: 0, children: _jsx(Text, { color: isDark ? "#606060" : "#94a3b8", bold: true, children: "QUANTUM_GRAPH" }) })), _jsxs(Box, { flexDirection: "column", marginTop: compact ? 0 : 1, overflow: "hidden", children: [_jsx(Text, { color: isDark ? "#606060" : "#94a3b8", bold: true, children: compact ? "GRAPH" : "VISUALIZATION" }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: nodeElements })] }), !compact && maxHeight > 12 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, overflow: "hidden", children: [_jsx(Text, { color: isDark ? "#606060" : "#94a3b8", bold: true, children: "LINKS" }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: edgeElements })] })), _jsx(Box, { marginTop: 1, flexShrink: 0, children: _jsx(Text, { color: isDark ? "#606060" : "#94a3b8", children: "\u251C\u2500" }) }), _jsxs(Box, { flexDirection: "row", flexShrink: 0, children: [_jsx(Text, { color: isDark ? "#a0a0a0" : "#475569", children: "Cache:" }), _jsx(Text, { color: successColor, children: " " }), !compact && _jsx(Pulse, { interval: 800, color: successColor, type: "breath" }), _jsxs(Text, { color: successColor, children: [" ", displayCacheHitRate, "%"] }), !compact && _jsxs(Text, { color: isDark ? "#606060" : "#94a3b8", children: [" \u2502 +", mutationCount] })] })] }));
|
|
60
|
+
const title = compact ? "QSGM" : "QSGM";
|
|
61
|
+
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, width: width, height: maxHeight, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { marginBottom: 1, flexShrink: 0, children: [_jsx(Text, { color: theme.colors.primary, bold: true, children: indicators.square }), _jsxs(Text, { color: theme.colors.textPrimary, bold: true, children: [" ", title] }), _jsxs(Text, { color: theme.colors.textQuaternary, children: [" n:", displayNodeCount] }), isActive && !compact && (_jsx(Pulse, { interval: 500, color: theme.colors.primary, type: "pulse" }))] }), !compact && (_jsx(Box, { flexDirection: "column", flexShrink: 0, children: _jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: "QUANTUM_GRAPH" }) })), _jsxs(Box, { flexDirection: "column", marginTop: compact ? 0 : 1, overflow: "hidden", children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: compact ? "GRAPH" : "VISUALIZATION" }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: nodeElements })] }), !compact && maxHeight > 12 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, overflow: "hidden", children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: "LINKS" }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: edgeElements })] })), _jsx(Box, { marginTop: 1, flexShrink: 0, children: _jsx(Text, { color: theme.colors.textQuaternary, children: "\u251C\u2500" }) }), _jsxs(Box, { flexDirection: "row", flexShrink: 0, children: [_jsx(Text, { color: theme.colors.textSecondary, children: "Cache:" }), _jsx(Text, { color: theme.colors.success, children: " " }), !compact && _jsx(Pulse, { interval: 800, color: theme.colors.success, type: "breath" }), _jsxs(Text, { color: theme.colors.success, children: [" ", displayCacheHitRate, "%"] }), !compact && (_jsxs(Text, { color: theme.colors.textQuaternary, children: [" \u2502 +", mutationCount] }))] })] }));
|
|
69
62
|
});
|
|
70
63
|
//# sourceMappingURL=MemoryPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryPanel.js","sourceRoot":"","sources":["../../../src/tui/components/MemoryPanel.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MemoryPanel.js","sourceRoot":"","sources":["../../../src/tui/components/MemoryPanel.tsx"],"names":[],"mappings":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/C,EACN,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,UAAU,EAAE,CAAC,aACpC,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,uBAAe,EACtD,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,kBAAU,EAC1C,CAAC,OAAO,IAAI,KAAC,KAAK,IAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAC,QAAQ,GAAG,EAChF,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,kBAAI,mBAAmB,SAAS,EAChE,CAAC,OAAO,IAAI,CACX,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,0BAAO,aAAa,IAAQ,CACrE,IACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsPanel.d.ts","sourceRoot":"","sources":["../../../src/tui/components/MetricsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MetricsPanel.d.ts","sourceRoot":"","sources":["../../../src/tui/components/MetricsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA2CD,eAAO,MAAM,YAAY,+CAyHvB,CAAC;AAEH,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -3,30 +3,27 @@ import { memo, useMemo } from "react";
|
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
4
|
import { AnimatedProgressBar, Pulse } from "./animations/index.js";
|
|
5
5
|
import { getCurrentTheme } from "../styles/colors.js";
|
|
6
|
+
import { indicators } from "../styles/tokens.js";
|
|
6
7
|
const TOP_AGENTS = [
|
|
7
|
-
{ name: "
|
|
8
|
+
{ name: "CodeGen", percent: 45 },
|
|
8
9
|
{ name: "TestAgent", percent: 32 },
|
|
9
10
|
{ name: "FixAgent", percent: 18 },
|
|
10
11
|
];
|
|
11
|
-
const AnimatedMetricBar = memo(function AnimatedMetricBar({ value, max, width =
|
|
12
|
+
const AnimatedMetricBar = memo(function AnimatedMetricBar({ value, max, width = 12, tick, animated, compact = false, }) {
|
|
12
13
|
const percent = useMemo(() => Math.min((value / max) * 100, 100), [value, max]);
|
|
13
|
-
return (_jsx(AnimatedProgressBar, { progress: percent, width: width, tick: tick || 0, animated: animated, showPercentage: false }));
|
|
14
|
+
return (_jsx(AnimatedProgressBar, { progress: percent, width: width, tick: tick || 0, animated: animated, showPercentage: false, compact: compact }));
|
|
14
15
|
});
|
|
15
|
-
export const MetricsPanel = memo(function MetricsPanel({ metrics, fitness, isActive, tick = 0, maxHeight = 15, width = 30 }) {
|
|
16
|
+
export const MetricsPanel = memo(function MetricsPanel({ metrics, fitness, isActive, tick = 0, maxHeight = 15, width = 30, }) {
|
|
16
17
|
const theme = getCurrentTheme();
|
|
17
|
-
const isDark = theme.name === "default";
|
|
18
18
|
const borderColor = isActive
|
|
19
|
-
?
|
|
20
|
-
:
|
|
19
|
+
? theme.colors.borderActive
|
|
20
|
+
: theme.colors.border;
|
|
21
21
|
const compact = width < 25 || maxHeight < 12;
|
|
22
22
|
const showTopAgents = !compact && maxHeight > 12;
|
|
23
23
|
const showSuccessPulse = metrics.successRate >= 90;
|
|
24
24
|
const costStr = useMemo(() => metrics.totalCost.toFixed(4), [metrics.totalCost]);
|
|
25
|
-
const agentElements = useMemo(() => TOP_AGENTS.slice(0, compact ? 2 : 3).map((agent, idx) => (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color:
|
|
26
|
-
const title = compact ? "
|
|
27
|
-
|
|
28
|
-
const successColor = isDark ? "#22c55e" : "#10b981";
|
|
29
|
-
const warningColor = isDark ? "#f59e0b" : "#f59e0b";
|
|
30
|
-
return (_jsxs(Box, { flexDirection: "column", width: width, height: maxHeight, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { marginBottom: 1, flexShrink: 0, children: [_jsx(Text, { color: primaryColor, bold: true, children: "\u250C\u2500" }), _jsx(Text, { color: primaryColor, bold: true, children: title }), _jsx(Text, { color: isDark ? "#606060" : "#94a3b8", children: "─".repeat(Math.max(5, width - (compact ? 10 : 16))) })] }), _jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [_jsx(Text, { color: isDark ? "#606060" : "#94a3b8", bold: true, children: compact ? "STATS" : "METRICS" }), _jsxs(Box, { flexDirection: "row", marginTop: 1, children: [_jsx(Text, { color: isDark ? "#a0a0a0" : "#475569", children: compact ? "Sess:" : "Sessions:" }), _jsxs(Text, { color: isDark ? "#ffffff" : "#1e293b", bold: true, children: [" ", metrics.sessions] })] }), !compact && (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: isDark ? "#a0a0a0" : "#475569", children: "Avg Duration:" }), _jsxs(Text, { color: isDark ? "#ffffff" : "#1e293b", children: [" ", metrics.avgDuration, "ms"] })] })), _jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: isDark ? "#a0a0a0" : "#475569", children: compact ? "Rate:" : "Success Rate:" }), _jsxs(Text, { color: successColor, children: [" ", metrics.successRate, "%"] }), showSuccessPulse && !compact && _jsx(Pulse, { interval: 1000, color: successColor, type: "breath" })] }), !compact && (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: isDark ? "#a0a0a0" : "#475569", children: "Cost:" }), _jsxs(Text, { color: warningColor, children: [" $", costStr] })] }))] }), !compact && (_jsxs(Box, { flexDirection: "column", marginTop: 1, flexShrink: 0, children: [_jsx(Text, { color: isDark ? "#606060" : "#94a3b8", bold: true, children: "FITNESS" }), _jsxs(Box, { flexDirection: "row", children: [_jsx(AnimatedMetricBar, { value: fitness, max: 1, width: compact ? 8 : 12, tick: tick, animated: isActive }), _jsxs(Text, { color: isDark ? "#ffffff" : "#1e293b", children: [" ", fitness.toFixed(2)] })] })] })), showTopAgents && (_jsxs(Box, { flexDirection: "column", marginTop: 1, overflow: "hidden", children: [_jsx(Text, { color: isDark ? "#606060" : "#94a3b8", bold: true, children: "TOP AGENTS" }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: agentElements })] }))] }));
|
|
25
|
+
const agentElements = useMemo(() => TOP_AGENTS.slice(0, compact ? 2 : 3).map((agent, idx) => (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.colors.textPrimary, children: agent.name.slice(0, compact ? 8 : 12).padEnd(compact ? 8 : 12) }), _jsx(AnimatedMetricBar, { value: agent.percent, max: 100, width: compact ? 6 : 8, tick: tick, animated: isActive && idx === 0, compact: compact }), _jsxs(Text, { color: theme.colors.textTertiary, children: [" ", agent.percent, "%"] })] }, agent.name))), [tick, isActive, compact, theme]);
|
|
26
|
+
const title = compact ? "PERF" : "PERFORMANCE";
|
|
27
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, height: maxHeight, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { marginBottom: 1, flexShrink: 0, children: [_jsx(Text, { color: theme.colors.primary, bold: true, children: indicators.square }), _jsxs(Text, { color: theme.colors.textPrimary, bold: true, children: [" ", title] })] }), _jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: compact ? "STATS" : "METRICS" }), _jsxs(Box, { flexDirection: "row", marginTop: 1, children: [_jsx(Text, { color: theme.colors.textSecondary, children: compact ? "Sess:" : "Sessions:" }), _jsxs(Text, { color: theme.colors.textPrimary, bold: true, children: [" ", metrics.sessions] })] }), !compact && (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.colors.textSecondary, children: "Avg Duration:" }), _jsxs(Text, { color: theme.colors.textPrimary, children: [" ", metrics.avgDuration, "ms"] })] })), _jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.colors.textSecondary, children: compact ? "Rate:" : "Success:" }), _jsxs(Text, { color: theme.colors.success, children: [" ", metrics.successRate, "%"] }), showSuccessPulse && !compact && (_jsx(Pulse, { interval: 1000, color: theme.colors.success, type: "breath" }))] }), !compact && (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.colors.textSecondary, children: "Cost:" }), _jsxs(Text, { color: theme.colors.warning, children: [" $", costStr] })] }))] }), !compact && (_jsxs(Box, { flexDirection: "column", marginTop: 1, flexShrink: 0, children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: "FITNESS" }), _jsxs(Box, { flexDirection: "row", children: [_jsx(AnimatedMetricBar, { value: fitness, max: 1, width: 12, tick: tick, animated: isActive, compact: compact }), _jsxs(Text, { color: theme.colors.textPrimary, children: [" ", fitness.toFixed(2)] })] })] })), showTopAgents && (_jsxs(Box, { flexDirection: "column", marginTop: 1, overflow: "hidden", children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: "TOP AGENTS" }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: agentElements })] }))] }));
|
|
31
28
|
});
|
|
32
29
|
//# sourceMappingURL=MetricsPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsPanel.js","sourceRoot":"","sources":["../../../src/tui/components/MetricsPanel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AAC,aAAa,sBAAc,EACrD,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,mBAAK,OAAO,IAAQ,IACjD,CACP,IACG,EAEL,CAAC,OAAO,IAAI,CACX,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,aACrD,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,8BAAe,EAC7D,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,aACtB,KAAC,iBAAiB,IAChB,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,EAAE,EACT,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,GAChB,EACF,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,kBAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAQ,IAC/D,IACF,CACP,EAEA,aAAa,IAAI,CAChB,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAC,QAAQ,aACzD,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,iCAAkB,EAChE,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,YACrC,aAAa,GACV,IACF,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectMenu - Improved interactive menu component
|
|
3
|
+
* Minimaliste avec meilleure UX
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
interface MenuOption {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
interface SelectMenuProps {
|
|
12
|
+
title: string;
|
|
13
|
+
options: MenuOption[];
|
|
14
|
+
selectedIndex: number;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
width?: number | string;
|
|
17
|
+
}
|
|
18
|
+
export declare const SelectMenu: React.FC<SelectMenuProps>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=SelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectMenu.d.ts","sourceRoot":"","sources":["../../../src/tui/components/SelectMenu.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoFhD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "./primitives/Box.js";
|
|
3
|
+
import { Text } from "./primitives/Text.js";
|
|
4
|
+
import { Stack } from "./layouts/Stack.js";
|
|
5
|
+
import { getCurrentTheme } from "../styles/colors.js";
|
|
6
|
+
import { indicators } from "../styles/design-system.js";
|
|
7
|
+
export const SelectMenu = ({ title, options, selectedIndex, compact = false, width = "100%", }) => {
|
|
8
|
+
const theme = getCurrentTheme();
|
|
9
|
+
if (options.length === 0) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return (_jsxs(Stack, { gap: compact ? "xs" : "sm", width: width, children: [_jsxs(Box, { flexDirection: "row", gap: 1, marginBottom: compact ? 0 : 1, children: [_jsx(Text, { color: "primary", bold: true, children: indicators.arrowRight }), _jsx(Text, { color: "primary", bold: true, children: title })] }), _jsx(Stack, { gap: compact ? "xs" : "sm", pl: 2, children: options.map((option, index) => {
|
|
13
|
+
const isSelected = index === selectedIndex;
|
|
14
|
+
const indicator = isSelected ? indicators.selected : indicators.unselected;
|
|
15
|
+
return (_jsxs(Box, { flexDirection: "column", gap: compact ? 0 : 1, paddingX: 1, children: [_jsxs(Box, { flexDirection: "row", gap: 1, alignItems: "center", children: [_jsx(Text, { color: isSelected ? "primary" : "secondary", bold: isSelected, children: indicator }), _jsx(Text, { color: isSelected ? "primary" : "secondary", bold: isSelected, children: option.label })] }), option.description && !compact && (_jsx(Text, { color: "tertiary", dim: true, children: option.description }))] }, option.id));
|
|
16
|
+
}) }), !compact && (_jsxs(Box, { flexDirection: "row", gap: 2, paddingTop: 1, marginTop: 1, borderTopColor: theme.colors.border, children: [_jsxs(Text, { color: "success", dim: true, children: [indicators.arrowUp, indicators.arrowDown, " navigate"] }), _jsxs(Text, { color: "info", dim: true, children: [indicators.selected, " select"] }), _jsx(Text, { color: "error", dim: true, children: "esc cancel" })] }))] }));
|
|
17
|
+
};
|
|
18
|
+
SelectMenu.displayName = "SelectMenu";
|
|
19
|
+
//# sourceMappingURL=SelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectMenu.js","sourceRoot":"","sources":["../../../src/tui/components/SelectMenu.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD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AE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA6DD,eAAO,MAAM,WAAW,8CA+FtB,CAAC;AAEH,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
|
-
import {
|
|
5
|
-
import { Pulse, FitnessAnimator, StatusAnimator } from "./animations/index.js";
|
|
4
|
+
import { Pulse, FitnessAnimator } from "./animations/index.js";
|
|
6
5
|
import { getCurrentTheme } from "../styles/colors.js";
|
|
7
|
-
|
|
6
|
+
import { indicators } from "../styles/tokens.js";
|
|
7
|
+
const AGENT_STATUS_COLORS = {
|
|
8
|
+
idle: "textTertiary",
|
|
9
|
+
running: "warning",
|
|
10
|
+
queued: "info",
|
|
11
|
+
done: "success",
|
|
12
|
+
};
|
|
13
|
+
const AgentRow = memo(function AgentRow({ agent, compact }) {
|
|
8
14
|
const theme = getCurrentTheme();
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
15
|
+
const isRunning = agent.status === "running";
|
|
16
|
+
const statusColor = theme.colors[AGENT_STATUS_COLORS[agent.status]] || theme.colors.textTertiary;
|
|
17
|
+
const name = compact ? agent.name.slice(0, 8) : agent.name.slice(0, 12);
|
|
18
|
+
const statusLabel = agent.status.toUpperCase().slice(0, compact ? 4 : 8);
|
|
19
|
+
return (_jsxs(Box, { flexDirection: "row", children: [isRunning ? (_jsx(Pulse, { interval: 200, color: statusColor, type: "wave" })) : (_jsx(Text, { color: statusColor, children: "\u25CF" })), _jsxs(Text, { color: theme.colors.textPrimary, children: [" ", name.padEnd(compact ? 8 : 12)] }), _jsxs(Text, { color: theme.colors.textTertiary, children: [" ", statusLabel] })] }));
|
|
13
20
|
});
|
|
14
|
-
const ProviderRow = memo(function ProviderRow({ provider,
|
|
21
|
+
const ProviderRow = memo(function ProviderRow({ provider, compact }) {
|
|
15
22
|
const theme = getCurrentTheme();
|
|
16
|
-
const isDark = theme.name === "default";
|
|
17
23
|
const isActive = provider.status === "active";
|
|
18
|
-
|
|
24
|
+
const name = compact ? provider.name.slice(0, 6) : provider.name.slice(0, 10);
|
|
25
|
+
return (_jsxs(Box, { flexDirection: "row", children: [isActive ? (_jsx(Pulse, { interval: 600, color: theme.colors.success, type: "breath" })) : (_jsx(Text, { color: theme.colors.textQuaternary, children: "\u25CB" })), _jsxs(Text, { color: theme.colors.textPrimary, children: [" ", name.padEnd(compact ? 6 : 10)] }), !compact && (_jsx(Text, { color: theme.colors.textTertiary, children: provider.latency > 0 ? `${provider.latency}ms`.padStart(5) : " --" }))] }));
|
|
19
26
|
});
|
|
20
|
-
export const StatusPanel = memo(function StatusPanel({ agents, providers, fitness, currentWorkflow, isActive, tick = 0, maxHeight = 20, width = 30, model }) {
|
|
27
|
+
export const StatusPanel = memo(function StatusPanel({ agents, providers, fitness, currentWorkflow, isActive, tick = 0, maxHeight = 20, width = 30, model, }) {
|
|
21
28
|
const theme = getCurrentTheme();
|
|
22
|
-
const isDark = theme.name === "default";
|
|
23
29
|
const borderColor = isActive
|
|
24
|
-
? theme.colors.
|
|
30
|
+
? theme.colors.borderActive
|
|
25
31
|
: theme.colors.border;
|
|
26
32
|
const compact = width < 25 || maxHeight < 15;
|
|
27
|
-
const maxAgents = Math.max(2, Math.floor((maxHeight - (compact ?
|
|
28
|
-
const activeAgents = useMemo(() => agents.filter(a => a.status === "running" || a.status === "queued").slice(0, maxAgents), [agents, maxAgents]);
|
|
33
|
+
const maxAgents = Math.max(2, Math.floor((maxHeight - (compact ? 6 : 12)) / 2));
|
|
34
|
+
const activeAgents = useMemo(() => agents.filter((a) => a.status === "running" || a.status === "queued").slice(0, maxAgents), [agents, maxAgents]);
|
|
29
35
|
const hasNoActiveAgents = activeAgents.length === 0;
|
|
30
|
-
const workflowDisplay = useMemo(() => currentWorkflow
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
const workflowDisplay = useMemo(() => currentWorkflow
|
|
37
|
+
? `${indicators.arrow} ${currentWorkflow.slice(0, compact ? 10 : 16)}`
|
|
38
|
+
: `${indicators.offline} None`, [currentWorkflow, compact]);
|
|
39
|
+
const title = compact ? "STATUS" : "STATUS";
|
|
40
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, height: maxHeight, borderStyle: "single", borderColor: borderColor, paddingX: 1, children: [_jsxs(Box, { flexShrink: 0, marginBottom: 1, children: [_jsx(Text, { color: theme.colors.primary, bold: true, children: indicators.square }), _jsxs(Text, { color: theme.colors.textPrimary, bold: true, children: [" ", title] })] }), _jsxs(Box, { flexDirection: "column", flexShrink: 0, marginBottom: 1, children: [_jsx(Text, { color: theme.colors.textTertiary, bold: true, children: compact ? "HUB" : "ORCHESTRATOR" }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Pulse, { interval: 600, color: theme.colors.success, type: "breath" }), _jsx(Text, { color: theme.colors.success, bold: true, children: " ACTIVE" })] }), model && !compact && (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.colors.textTertiary, children: "Model: " }), _jsx(Text, { color: theme.colors.primary, children: model.slice(0, 14) })] }))] }), !compact && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, flexShrink: 0, children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: "WORKFLOW" }), _jsx(Text, { color: theme.colors.textPrimary, children: workflowDisplay }), _jsx(FitnessAnimator, { value: fitness, compact: compact })] })), _jsxs(Box, { flexDirection: "column", overflow: "hidden", marginBottom: 1, children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: "AGENTS" }), activeAgents.map((agent) => (_jsx(AgentRow, { agent: agent, compact: compact }, agent.name))), hasNoActiveAgents && (_jsxs(Text, { color: theme.colors.textMuted, children: [" ", indicators.offline, " All idle"] }))] }), maxHeight > 12 && (_jsxs(Box, { flexDirection: "column", overflow: "hidden", children: [_jsx(Text, { color: theme.colors.textQuaternary, bold: true, children: "PROVIDERS" }), providers.slice(0, compact ? 2 : 4).map((provider) => (_jsx(ProviderRow, { provider: provider, compact: compact }, provider.name)))] }))] }));
|
|
33
41
|
});
|
|
34
42
|
//# sourceMappingURL=StatusPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusPanel.js","sourceRoot":"","sources":["../../../src/tui/components/StatusPanel.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StatusPanel.js","sourceRoot":"","sources":["../../../src/tui/components/StatusPanel.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA4BjD,MAAM,mBAAmB,GAA2B;IAClD,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,SAAS;CAChB,CAAC;AAOF,MAAM,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,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACrD,KAAC,WAAW,IAAqB,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,IAAnD,QAAQ,CAAC,IAAI,CAA0C,CAC1E,CAAC,IACE,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -8,7 +8,11 @@ interface ProgressBarProps {
|
|
|
8
8
|
showMarker?: boolean;
|
|
9
9
|
glowEffect?: boolean;
|
|
10
10
|
color?: string;
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
label?: string;
|
|
11
13
|
}
|
|
14
|
+
declare function getProgressGlow(tick: number): string;
|
|
15
|
+
declare function getProgressMarker(tick: number): string;
|
|
12
16
|
export declare const AnimatedProgressBar: React.NamedExoticComponent<ProgressBarProps>;
|
|
13
17
|
interface ProgressWithLabelProps {
|
|
14
18
|
label: string;
|
|
@@ -16,6 +20,7 @@ interface ProgressWithLabelProps {
|
|
|
16
20
|
width?: number;
|
|
17
21
|
tick?: number;
|
|
18
22
|
animated?: boolean;
|
|
23
|
+
compact?: boolean;
|
|
19
24
|
}
|
|
20
25
|
export declare const ProgressWithLabel: React.NamedExoticComponent<ProgressWithLabelProps>;
|
|
21
26
|
interface SegmentedProgressProps {
|
|
@@ -26,6 +31,7 @@ interface SegmentedProgressProps {
|
|
|
26
31
|
}[];
|
|
27
32
|
width?: number;
|
|
28
33
|
tick?: number;
|
|
34
|
+
compact?: boolean;
|
|
29
35
|
}
|
|
30
36
|
export declare const SegmentedProgress: React.NamedExoticComponent<SegmentedProgressProps>;
|
|
31
37
|
interface WorkflowProgressProps {
|
|
@@ -33,7 +39,8 @@ interface WorkflowProgressProps {
|
|
|
33
39
|
progress: number;
|
|
34
40
|
isActive: boolean;
|
|
35
41
|
tick?: number;
|
|
42
|
+
compact?: boolean;
|
|
36
43
|
}
|
|
37
44
|
export declare const WorkflowProgress: React.NamedExoticComponent<WorkflowProgressProps>;
|
|
38
|
-
export {};
|
|
45
|
+
export { getProgressGlow, getProgressMarker };
|
|
39
46
|
//# sourceMappingURL=ProgressBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/animations/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/animations/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAK7C,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,iBAAS,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,iBAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAOD,eAAO,MAAM,mBAAmB,8CAyD9B,CAAC;AAEH,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,oDAwB5B,CAAC;AAEH,UAAU,sBAAsB;IAC9B,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,oDAgC5B,CAAC;AAEH,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,mDA0B3B,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,39 +1,65 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { getCurrentTheme } from "../../styles/colors.js";
|
|
5
|
+
import { indicators } from "../../styles/tokens.js";
|
|
6
|
+
const GLOW_CHARS = ["█", "▓", "█", "▓"];
|
|
7
|
+
const MARKER_CHARS = ["▸", "▶", "▸", "▶"];
|
|
8
|
+
const WAVE_CHARS = ["░", "▒", "▓", "█", "▓", "▒"];
|
|
9
|
+
function getProgressGlow(tick) {
|
|
10
|
+
return GLOW_CHARS[tick % GLOW_CHARS.length];
|
|
11
|
+
}
|
|
12
|
+
function getProgressMarker(tick) {
|
|
13
|
+
return MARKER_CHARS[tick % MARKER_CHARS.length];
|
|
14
|
+
}
|
|
15
|
+
function getWaveChar(tick, position) {
|
|
16
|
+
const offset = (tick + position) % WAVE_CHARS.length;
|
|
17
|
+
return WAVE_CHARS[offset];
|
|
18
|
+
}
|
|
19
|
+
export const AnimatedProgressBar = memo(function AnimatedProgressBar({ progress, width = 16, showPercentage = true, animated = true, tick = 0, showMarker = true, glowEffect = false, color, compact = false, }) {
|
|
20
|
+
const theme = getCurrentTheme();
|
|
21
|
+
const clampedProgress = Math.max(0, Math.min(100, progress));
|
|
22
|
+
const filled = Math.round((clampedProgress / 100) * width);
|
|
7
23
|
const empty = width - filled;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
const barColor = useMemo(() => {
|
|
25
|
+
if (color)
|
|
26
|
+
return color;
|
|
27
|
+
if (clampedProgress >= 100)
|
|
28
|
+
return theme.colors.success;
|
|
29
|
+
if (clampedProgress >= 70)
|
|
30
|
+
return theme.colors.warning;
|
|
31
|
+
if (clampedProgress > 0)
|
|
32
|
+
return theme.colors.primary;
|
|
33
|
+
return theme.colors.textTertiary;
|
|
34
|
+
}, [clampedProgress, color, theme]);
|
|
35
|
+
const filledChar = glowEffect && animated ? getProgressGlow(tick) : indicators.progress.filled;
|
|
36
|
+
const emptyChar = compact ? "·" : indicators.progress.empty;
|
|
37
|
+
const markerChar = showMarker && animated && clampedProgress > 0 && clampedProgress < 100
|
|
38
|
+
? getProgressMarker(tick)
|
|
39
|
+
: "";
|
|
17
40
|
const beforeMarker = filled > 0 ? filledChar.repeat(Math.max(0, filled - 1)) : "";
|
|
18
41
|
const afterMarker = emptyChar.repeat(empty);
|
|
19
|
-
const progressStr = useMemo(() =>
|
|
20
|
-
if (showMarker && animated &&
|
|
21
|
-
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: barColor, children: beforeMarker }), _jsx(Text, { color:
|
|
42
|
+
const progressStr = useMemo(() => Math.round(clampedProgress).toString().padStart(3), [clampedProgress]);
|
|
43
|
+
if (showMarker && animated && clampedProgress > 0 && clampedProgress < 100) {
|
|
44
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: barColor, children: beforeMarker }), _jsx(Text, { color: theme.colors.accent, bold: true, children: markerChar }), _jsx(Text, { color: theme.colors.textTertiary, children: afterMarker.slice(1) }), showPercentage && !compact && (_jsxs(Text, { color: barColor, children: [" ", progressStr, "%"] }))] }));
|
|
22
45
|
}
|
|
23
46
|
const bar = filledChar.repeat(filled) + emptyChar.repeat(empty);
|
|
24
|
-
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: barColor, children: bar }), showPercentage && (_jsxs(Text, { color: barColor, children: [" ", progressStr, "%"] }))] }));
|
|
47
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: barColor, children: bar }), showPercentage && !compact && (_jsxs(Text, { color: barColor, children: [" ", progressStr, "%"] }))] }));
|
|
25
48
|
});
|
|
26
|
-
export const ProgressWithLabel = memo(function ProgressWithLabel({ label, progress, width = 12, tick = 0, animated = true }) {
|
|
27
|
-
const
|
|
28
|
-
|
|
49
|
+
export const ProgressWithLabel = memo(function ProgressWithLabel({ label, progress, width = 12, tick = 0, animated = true, compact = false, }) {
|
|
50
|
+
const theme = getCurrentTheme();
|
|
51
|
+
const paddedLabel = useMemo(() => label.slice(0, compact ? 8 : 12).padEnd(compact ? 8 : 12), [label, compact]);
|
|
52
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.colors.textSecondary, children: paddedLabel }), _jsx(AnimatedProgressBar, { progress: progress, width: width, tick: tick, animated: animated, showMarker: true, compact: compact })] }));
|
|
29
53
|
});
|
|
30
|
-
export const SegmentedProgress = memo(function SegmentedProgress({ segments, width = 20, tick = 0 }) {
|
|
31
|
-
const
|
|
32
|
-
return (_jsx(Box, { flexDirection: "column", children: segments.map((segment, idx) => (_jsxs(Box, { flexDirection: "row", children: [segment.label && _jsx(Text, { color:
|
|
54
|
+
export const SegmentedProgress = memo(function SegmentedProgress({ segments, width = 20, tick = 0, compact = false, }) {
|
|
55
|
+
const theme = getCurrentTheme();
|
|
56
|
+
return (_jsx(Box, { flexDirection: "column", children: segments.map((segment, idx) => (_jsxs(Box, { flexDirection: "row", children: [segment.label && (_jsx(Text, { color: theme.colors.textTertiary, children: segment.label.slice(0, compact ? 6 : 10).padEnd(compact ? 6 : 10) })), _jsx(AnimatedProgressBar, { progress: segment.progress, width: width, tick: tick, color: segment.color, showPercentage: false, compact: compact }), _jsxs(Text, { color: segment.color || theme.colors.textPrimary, children: [" ", Math.round(segment.progress), "%"] })] }, idx))) }));
|
|
33
57
|
});
|
|
34
|
-
export const WorkflowProgress = memo(function WorkflowProgress({ level, progress, isActive, tick = 0 }) {
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
58
|
+
export const WorkflowProgress = memo(function WorkflowProgress({ level, progress, isActive, tick = 0, compact = false, }) {
|
|
59
|
+
const theme = getCurrentTheme();
|
|
60
|
+
const levelColor = isActive ? theme.colors.primary : theme.colors.textSecondary;
|
|
61
|
+
const paddedLevel = useMemo(() => level.slice(0, compact ? 8 : 12).padEnd(compact ? 8 : 12), [level, compact]);
|
|
62
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: levelColor, bold: isActive, children: paddedLevel }), _jsx(AnimatedProgressBar, { progress: progress, width: compact ? 10 : 14, tick: tick, animated: isActive, showMarker: isActive, glowEffect: isActive, color: isActive ? theme.colors.warning : undefined, compact: compact })] }));
|
|
38
63
|
});
|
|
64
|
+
export { getProgressGlow, getProgressMarker };
|
|
39
65
|
//# sourceMappingURL=ProgressBar.js.map
|