rax-flow 0.1.7 → 0.1.8
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/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +35 -3
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/components/ChatPanel.d.ts +2 -1
- package/dist/tui/components/ChatPanel.d.ts.map +1 -1
- package/dist/tui/components/ChatPanel.js +3 -2
- package/dist/tui/components/ChatPanel.js.map +1 -1
- package/dist/tui/components/DAGPanel.d.ts +24 -0
- package/dist/tui/components/DAGPanel.d.ts.map +1 -0
- package/dist/tui/components/DAGPanel.js +30 -0
- package/dist/tui/components/DAGPanel.js.map +1 -0
- package/dist/tui/components/Header.d.ts +3 -1
- package/dist/tui/components/Header.d.ts.map +1 -1
- package/dist/tui/components/Header.js +11 -3
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/HelpOverlay.d.ts +6 -0
- package/dist/tui/components/HelpOverlay.d.ts.map +1 -0
- package/dist/tui/components/HelpOverlay.js +42 -0
- package/dist/tui/components/HelpOverlay.js.map +1 -0
- package/dist/tui/components/StatusPanel.d.ts +2 -1
- package/dist/tui/components/StatusPanel.d.ts.map +1 -1
- package/dist/tui/components/StatusPanel.js +7 -6
- package/dist/tui/components/StatusPanel.js.map +1 -1
- package/dist/tui/hooks/useAppState.d.ts +17 -0
- package/dist/tui/hooks/useAppState.d.ts.map +1 -1
- package/dist/tui/hooks/useAppState.js +91 -28
- package/dist/tui/hooks/useAppState.js.map +1 -1
- package/package.json +1 -1
- package/src/tui/App.tsx +71 -19
- package/src/tui/components/ChatPanel.tsx +8 -4
- package/src/tui/components/DAGPanel.tsx +116 -0
- package/src/tui/components/Header.tsx +42 -19
- package/src/tui/components/HelpOverlay.tsx +83 -0
- package/src/tui/components/StatusPanel.tsx +13 -8
- package/src/tui/hooks/useAppState.ts +124 -28
- package/tsconfig.tsbuildinfo +1 -1
package/dist/tui/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":"AAYA,wBAAgB,GAAG,4CAoGlB"}
|
package/dist/tui/App.js
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
2
3
|
import { Box, useApp, useInput } from "ink";
|
|
3
4
|
import { Header } from "./components/Header.js";
|
|
4
5
|
import { ChatPanel } from "./components/ChatPanel.js";
|
|
5
6
|
import { StatusPanel } from "./components/StatusPanel.js";
|
|
7
|
+
import { DAGPanel } from "./components/DAGPanel.js";
|
|
6
8
|
import { InputBar } from "./components/InputBar.js";
|
|
9
|
+
import { HelpOverlay } from "./components/HelpOverlay.js";
|
|
7
10
|
import { useAppState } from "./hooks/useAppState.js";
|
|
8
11
|
export function App() {
|
|
9
12
|
const { exit } = useApp();
|
|
10
|
-
const { state,
|
|
13
|
+
const { state, processCommand } = useAppState();
|
|
14
|
+
const [activePanel, setActivePanel] = useState("chat");
|
|
15
|
+
const [showHelp, setShowHelp] = useState(false);
|
|
16
|
+
const [tick, setTick] = useState(0);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const interval = setInterval(() => {
|
|
19
|
+
setTick((t) => t + 1);
|
|
20
|
+
}, 100);
|
|
21
|
+
return () => clearInterval(interval);
|
|
22
|
+
}, []);
|
|
11
23
|
useInput((input, key) => {
|
|
12
24
|
if (key.ctrl && input === "c") {
|
|
13
25
|
exit();
|
|
@@ -15,6 +27,22 @@ export function App() {
|
|
|
15
27
|
if (key.ctrl && input === "d") {
|
|
16
28
|
exit();
|
|
17
29
|
}
|
|
30
|
+
if (key.escape) {
|
|
31
|
+
setShowHelp(false);
|
|
32
|
+
}
|
|
33
|
+
if (input === "?" && !showHelp) {
|
|
34
|
+
setShowHelp(true);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (showHelp)
|
|
38
|
+
return;
|
|
39
|
+
if (key.return && input === "") {
|
|
40
|
+
}
|
|
41
|
+
if (key.tab) {
|
|
42
|
+
const panels = ["chat", "dag", "status"];
|
|
43
|
+
const currentIndex = panels.indexOf(activePanel);
|
|
44
|
+
setActivePanel(panels[(currentIndex + 1) % panels.length]);
|
|
45
|
+
}
|
|
18
46
|
});
|
|
19
47
|
const handleSubmit = (input) => {
|
|
20
48
|
const trimmed = input.trim();
|
|
@@ -24,8 +52,12 @@ export function App() {
|
|
|
24
52
|
exit();
|
|
25
53
|
return;
|
|
26
54
|
}
|
|
55
|
+
if (trimmed === "?" || trimmed === "/help") {
|
|
56
|
+
setShowHelp(!showHelp);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
27
59
|
processCommand(trimmed);
|
|
28
60
|
};
|
|
29
|
-
return (_jsxs(Box, { flexDirection: "column", height: "100%", width: "100%", children: [_jsx(Header, { projectName: state.projectName, agentCount: state.agentCount, provider: state.provider, status: state.status }), _jsxs(Box, { flexGrow: 1, flexDirection: "row", width: "100%", children: [_jsx(ChatPanel, { messages: state.messages, isProcessing: state.isProcessing }), _jsx(StatusPanel, { agents: state.agents, providers: state.providers, fitness: state.fitness, currentWorkflow: state.currentWorkflow })] }), _jsx(InputBar, { onSubmit: handleSubmit, suggestions: state.suggestions, isProcessing: state.isProcessing })] }));
|
|
61
|
+
return (_jsxs(Box, { flexDirection: "column", height: "100%", width: "100%", children: [_jsx(Header, { projectName: state.projectName, agentCount: state.agentCount, provider: state.provider, status: state.status, tick: tick, activePanel: activePanel }), showHelp ? (_jsx(HelpOverlay, { onDismiss: () => setShowHelp(false) })) : (_jsxs(_Fragment, { children: [_jsxs(Box, { flexGrow: 1, flexDirection: "row", width: "100%", children: [_jsx(ChatPanel, { messages: state.messages, isProcessing: state.isProcessing, isActive: activePanel === "chat" }), _jsx(DAGPanel, { workflowState: state.workflowState, tick: tick, isActive: activePanel === "dag" }), _jsx(StatusPanel, { agents: state.agents, providers: state.providers, fitness: state.fitness, currentWorkflow: state.currentWorkflow, isActive: activePanel === "status" })] }), _jsx(InputBar, { onSubmit: handleSubmit, suggestions: state.suggestions, isProcessing: state.isProcessing })] }))] }));
|
|
30
62
|
}
|
|
31
63
|
//# sourceMappingURL=App.js.map
|
package/dist/tui/App.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAQ,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,WAAW,EAAE,CAAC;IAChD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAc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AAE,WAAW,KAAK,MAAM,GAChC,EACF,KAAC,QAAQ,IACP,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,WAAW,KAAK,KAAK,GAC/B,EACF,KAAC,WAAW,IACV,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,eAAe,EAAE,KAAK,CAAC,eAAe,EACtC,QAAQ,EAAE,WAAW,KAAK,QAAQ,GAClC,IACE,EACN,KAAC,QAAQ,IACP,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,YAAY,EAAE,KAAK,CAAC,YAAY,GAChC,IACD,CACJ,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,8 @@ interface Message {
|
|
|
8
8
|
interface ChatPanelProps {
|
|
9
9
|
messages: Message[];
|
|
10
10
|
isProcessing: boolean;
|
|
11
|
+
isActive: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare function ChatPanel({ messages, isProcessing }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function ChatPanel({ messages, isProcessing, isActive }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
14
15
|
//# 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;
|
|
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"}
|
|
@@ -24,7 +24,8 @@ function MessageItem({ message }) {
|
|
|
24
24
|
};
|
|
25
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
26
|
}
|
|
27
|
-
export function ChatPanel({ messages, isProcessing }) {
|
|
28
|
-
|
|
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..." }) }))] })] }));
|
|
29
30
|
}
|
|
30
31
|
//# 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,
|
|
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;QACd,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,OAAO;KACjB,CAAC;IAEF,MAAM,UAAU,GAA2B;QACzC,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,OAAO;QAC/B,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,IAAI;KACd,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,IAAC,aAAa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AK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAChC,KAAC,WAAW,IAAc,OAAO,EAAE,GAAG,IAApB,GAAG,CAAC,EAAE,CAAkB,CAC3C,CAAC,EACD,YAAY,IAAI,CACf,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,qCAAuB,GACvC,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface DAGNode {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: "pending" | "running" | "done" | "error";
|
|
5
|
+
agent?: string;
|
|
6
|
+
}
|
|
7
|
+
interface DAGLevel {
|
|
8
|
+
name: string;
|
|
9
|
+
progress: number;
|
|
10
|
+
nodes: DAGNode[];
|
|
11
|
+
}
|
|
12
|
+
interface WorkflowState {
|
|
13
|
+
levels: DAGLevel[];
|
|
14
|
+
currentLevel: number;
|
|
15
|
+
totalProgress: number;
|
|
16
|
+
}
|
|
17
|
+
interface DAGPanelProps {
|
|
18
|
+
workflowState: WorkflowState;
|
|
19
|
+
tick: number;
|
|
20
|
+
isActive: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function DAGPanel({ workflowState, tick, isActive }: DAGPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=DAGPanel.d.ts.map
|
|
@@ -0,0 +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;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,aAAa;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAuDD,wBAAgB,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAkCxE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
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" },
|
|
8
|
+
};
|
|
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
|
+
}
|
|
30
|
+
//# sourceMappingURL=DAGPanel.js.map
|
|
@@ -0,0 +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,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,CAAC,CAAC,CAAC,MAAM,CAAC;IAElD,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,EAAE,EACT,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,aAEX,MAAC,GAAG,IAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,SAAS,EAAC,YAAY,EAAE,CAAC,aAC7D,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,0BAAW,EACrC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,2BAAkB,IAChC,EAEN,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,YACpC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1C,KAAC,YAAY,IAEX,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,KAAK,KAAK,aAAa,CAAC,YAAY,IAHzC,KAAK,CAAC,IAAI,CAIf,CACH,CAAC,GACE,EAEN,MAAC,GAAG,IAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM,EAAC,SAAS,EAAE,CAAC,aACvD,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,wBAAe,EACjC,KAAC,WAAW,IAAC,QAAQ,EAAE,aAAa,CAAC,aAAa,EAAE,KAAK,EAAE,EAAE,GAAI,EACjE,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,kBAAG,aAAa,CAAC,aAAa,SAAS,IACtD,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -3,7 +3,9 @@ interface HeaderProps {
|
|
|
3
3
|
agentCount: number;
|
|
4
4
|
provider: string;
|
|
5
5
|
status: "ready" | "running" | "error";
|
|
6
|
+
tick: number;
|
|
7
|
+
activePanel: string;
|
|
6
8
|
}
|
|
7
|
-
export declare function Header({ projectName, agentCount, provider, status }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function Header({ projectName, agentCount, provider, status, tick, activePanel }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/tui/components/Header.tsx"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/tui/components/Header.tsx"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AASD,wBAAgB,MAAM,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,WAAW,2CAwDnG"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
|
-
|
|
3
|
+
const spinnerFrames = ["◐", "◓", "◑", "◒"];
|
|
4
|
+
const panelNames = {
|
|
5
|
+
chat: "CHAT",
|
|
6
|
+
dag: "DAG",
|
|
7
|
+
status: "STATUS",
|
|
8
|
+
};
|
|
9
|
+
export function Header({ projectName, agentCount, provider, status, tick, activePanel }) {
|
|
4
10
|
const statusColors = {
|
|
5
11
|
ready: "green",
|
|
6
12
|
running: "yellow",
|
|
@@ -11,7 +17,9 @@ export function Header({ projectName, agentCount, provider, status }) {
|
|
|
11
17
|
running: "RUNNING",
|
|
12
18
|
error: "ERROR",
|
|
13
19
|
};
|
|
14
|
-
const
|
|
15
|
-
|
|
20
|
+
const animatedStatus = status === "running"
|
|
21
|
+
? spinnerFrames[tick % spinnerFrames.length]
|
|
22
|
+
: status === "error" ? "✗" : "●";
|
|
23
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", width: "100%", children: [_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingX: 1, children: [_jsxs(Box, { flexDirection: "row", alignItems: "center", children: [_jsx(Text, { color: "#f97316", bold: true, children: "\u25A0" }), _jsx(Text, { color: "white", bold: true, children: " RAX-FLOW" }), _jsx(Text, { color: "gray", children: " HUB" })] }), _jsxs(Box, { flexDirection: "row", alignItems: "center", children: [_jsx(Text, { color: "gray", children: "Project:" }), _jsxs(Text, { color: "cyan", children: [" ", projectName] }), _jsx(Text, { color: "gray", children: " \u2502 Agents:" }), _jsxs(Text, { color: "green", children: [" ", agentCount, "/12"] }), _jsxs(Text, { color: "gray", children: [" \u2502 [", provider, "]"] }), _jsxs(Text, { color: statusColors[status], children: [" ", animatedStatus, " ", statusText[status]] })] })] }), _jsxs(Box, { flexDirection: "row", paddingX: 1, children: [["chat", "dag", "status"].map((panel) => (_jsx(Box, { marginRight: 2, children: _jsxs(Text, { color: activePanel === panel ? "#f97316" : "gray", bold: activePanel === panel, children: ["[", panelNames[panel], "]"] }) }, panel))), _jsx(Text, { color: "gray", children: "| Tab: Changer \u2502 ?: Aide \u2502 Ctrl+C: Quitter" })] })] }));
|
|
16
24
|
}
|
|
17
25
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/tui/components/Header.tsx"],"names":[],"mapp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","sources":["../../../src/tui/components/HelpOverlay.tsx"],"names":[],"mappings":"AAGA,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,gBAAgB,2CA2E1D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
export function HelpOverlay({ onDismiss }) {
|
|
4
|
+
useInput((input, key) => {
|
|
5
|
+
if (key.escape || input === "q") {
|
|
6
|
+
onDismiss();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const sections = [
|
|
10
|
+
{
|
|
11
|
+
title: "COMMANDES",
|
|
12
|
+
items: [
|
|
13
|
+
["/run <prompt>", "Exécuter un workflow"],
|
|
14
|
+
["/status", "État du système"],
|
|
15
|
+
["/agents", "Liste des agents"],
|
|
16
|
+
["/providers", "Liste des providers"],
|
|
17
|
+
["/workflows", "Blueprints disponibles"],
|
|
18
|
+
["/help, ?", "Cette aide"],
|
|
19
|
+
["/exit", "Quitter"],
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: "NAVIGATION",
|
|
24
|
+
items: [
|
|
25
|
+
["Tab", "Changer de panel actif"],
|
|
26
|
+
["F1-F8", "Aller au panel spécifique"],
|
|
27
|
+
["Ctrl+C", "Quitter"],
|
|
28
|
+
["Esc", "Fermer l'aide"],
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: "PANELS",
|
|
33
|
+
items: [
|
|
34
|
+
["CHAT", "Messages et interaction"],
|
|
35
|
+
["DAG", "Visualisation du workflow"],
|
|
36
|
+
["STATUS", "Agents et providers"],
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, borderStyle: "double", borderColor: "#f97316", paddingX: 2, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: "#f97316", bold: true, children: "\u25A0 RAX-FLOW HELP" }), _jsx(Text, { color: "gray", children: " \u2014 [Esc] pour fermer" })] }), _jsx(Box, { flexDirection: "row", flexGrow: 1, children: sections.map((section) => (_jsxs(Box, { flexDirection: "column", width: 30, children: [_jsx(Text, { color: "gray", bold: true, underline: true, children: section.title }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: section.items.map(([cmd, desc]) => (_jsxs(Box, { flexDirection: "row", marginBottom: 1, children: [_jsx(Text, { color: "cyan", children: cmd.padEnd(16) }), _jsx(Text, { color: "white", children: desc })] }, cmd))) })] }, section.title))) }), _jsx(Box, { borderStyle: "single", borderColor: "gray", marginTop: 1, children: _jsx(Text, { color: "gray", children: "Pour ex\u00E9cuter un workflow, tapez simplement votre prompt ou /run \"...\"" }) })] }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=HelpOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpOverlay.js","sourceRoot":"","sources":["../../../src/tui/components/HelpOverlay.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAM1C,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAoB;IACzD,QAAQ,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACtB,IAAI,GAAG,CAAC,MAAM,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;YAChC,SAAS,EAAE,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG;QACf;YACE,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE;gBACL,CAAC,eAAe,EAAE,sBAAsB,CAAC;gBACzC,CAAC,SAAS,EAAE,iBAAiB,CAAC;gBAC9B,CAAC,SAAS,EAAE,kBAAkB,CAAC;gBAC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C,YACrC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAClC,MAAC,GAAG,IAAW,aAAa,EAAC,KAAK,EAAC,YAAY,EAAE,CAAC,aAChD,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAQ,EAC1C,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,IAAI,GAAQ,KAFzB,GAAG,CAGP,CACP,CAAC,GACE,KAXE,OAAO,CAAC,KAAK,CAYjB,CACP,CAAC,GACE,EAEN,KAAC,GAAG,IAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM,EAAC,SAAS,EAAE,CAAC,YACvD,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,8FAA8E,GAC5F,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,8 @@ interface StatusPanelProps {
|
|
|
14
14
|
providers: Provider[];
|
|
15
15
|
fitness: number;
|
|
16
16
|
currentWorkflow: string | null;
|
|
17
|
+
isActive: boolean;
|
|
17
18
|
}
|
|
18
|
-
export declare function StatusPanel({ agents, providers, fitness, currentWorkflow }: StatusPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function StatusPanel({ agents, providers, fitness, currentWorkflow, isActive }: StatusPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export {};
|
|
20
21
|
//# sourceMappingURL=StatusPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusPanel.d.ts","sourceRoot":"","sources":["../../../src/tui/components/StatusPanel.tsx"],"names":[],"mappings":"AAGA,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusPanel.d.ts","sourceRoot":"","sources":["../../../src/tui/components/StatusPanel.tsx"],"names":[],"mappings":"AAGA,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,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;CACnB;AAgCD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAmCtG"}
|
|
@@ -6,15 +6,16 @@ const statusIcons = {
|
|
|
6
6
|
queued: { icon: "◐", color: "cyan" },
|
|
7
7
|
done: { icon: "●", color: "green" },
|
|
8
8
|
};
|
|
9
|
-
function AgentRow({ agent
|
|
9
|
+
function AgentRow({ agent }) {
|
|
10
10
|
const { icon, color } = statusIcons[agent.status];
|
|
11
|
-
return (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsx(Text, { color: color, children: icon }), _jsx(Text, { color: "white", children: agent.name.slice(0, 12).padEnd(12) }), _jsxs(Text, { color: "gray", children: ["[", agent.provider, "]"] })] }
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsx(Text, { color: color, children: icon }), _jsx(Text, { color: "white", children: agent.name.slice(0, 12).padEnd(12) }), _jsxs(Text, { color: "gray", children: ["[", agent.provider, "]"] })] }));
|
|
12
12
|
}
|
|
13
|
-
function ProviderRow({ provider
|
|
14
|
-
return (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsx(Text, { color: provider.status === "active" ? "green" : "gray", children: provider.status === "active" ? "●" : "○" }), _jsx(Text, { color: "white", children: provider.name }), _jsx(Text, { color: "gray", children: provider.latency > 0 ? `${provider.latency}ms` : "--" })] }
|
|
13
|
+
function ProviderRow({ provider }) {
|
|
14
|
+
return (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsx(Text, { color: provider.status === "active" ? "green" : "gray", children: provider.status === "active" ? "●" : "○" }), _jsx(Text, { color: "white", children: provider.name }), _jsx(Text, { color: "gray", children: provider.latency > 0 ? `${provider.latency}ms` : "--" })] }));
|
|
15
15
|
}
|
|
16
|
-
export function StatusPanel({ agents, providers, fitness, currentWorkflow }) {
|
|
16
|
+
export function StatusPanel({ agents, providers, fitness, currentWorkflow, isActive }) {
|
|
17
17
|
const fitnessColor = fitness >= 0.9 ? "green" : fitness >= 0.7 ? "yellow" : "red";
|
|
18
|
-
|
|
18
|
+
const borderColor = isActive ? "#f97316" : "gray";
|
|
19
|
+
return (_jsxs(Box, { flexDirection: "column", width: 30, borderStyle: "single", borderColor: borderColor, children: [_jsxs(Box, { borderStyle: "single", borderColor: "#f97316", marginBottom: 1, children: [_jsx(Text, { color: "#f97316", bold: true, children: "STATUS" }), isActive && _jsx(Text, { color: "yellow", children: " [ACTIF]" })] }), _jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsx(Text, { color: "gray", bold: true, children: "WORKFLOW" }), _jsx(Text, { color: "white", children: currentWorkflow || "Aucun" }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: "gray", children: "Fitness: " }), _jsx(Text, { color: fitnessColor, bold: true, children: fitness.toFixed(2) })] })] }), _jsxs(Box, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [_jsx(Text, { color: "gray", bold: true, children: "AGENTS" }), agents.slice(0, 6).map((agent) => (_jsx(AgentRow, { agent: agent }, agent.name)))] }), _jsxs(Box, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [_jsx(Text, { color: "gray", bold: true, children: "PROVIDERS" }), providers.map((provider) => (_jsx(ProviderRow, { provider: provider }, provider.name)))] })] }));
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=StatusPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusPanel.js","sourceRoot":"","sources":["../../../src/tui/components/StatusPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusPanel.js","sourceRoot":"","sources":["../../../src/tui/components/StatusPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAuBhC,MAAM,WAAW,GAAoD;IACnE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE;IAClC,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;IACvC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE;IACpC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;CACpC,CAAC;AA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AE,EAAE,CAAC,CACjC,KAAC,QAAQ,IAAkB,KAAK,EAAE,KAAK,IAAxB,KAAK,CAAC,IAAI,CAAkB,CAC5C,CAAC,IACE,EAEN,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,aACnD,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,gCAAiB,EACvC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC3B,KAAC,WAAW,IAAqB,QAAQ,EAAE,QAAQ,IAAjC,QAAQ,CAAC,IAAI,CAAwB,CACxD,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -16,6 +16,22 @@ interface Provider {
|
|
|
16
16
|
status: "active" | "idle";
|
|
17
17
|
latency: number;
|
|
18
18
|
}
|
|
19
|
+
interface DAGNode {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
status: "pending" | "running" | "done" | "error";
|
|
23
|
+
agent?: string;
|
|
24
|
+
}
|
|
25
|
+
interface DAGLevel {
|
|
26
|
+
name: string;
|
|
27
|
+
progress: number;
|
|
28
|
+
nodes: DAGNode[];
|
|
29
|
+
}
|
|
30
|
+
interface WorkflowState {
|
|
31
|
+
levels: DAGLevel[];
|
|
32
|
+
currentLevel: number;
|
|
33
|
+
totalProgress: number;
|
|
34
|
+
}
|
|
19
35
|
interface AppState {
|
|
20
36
|
projectName: string;
|
|
21
37
|
agentCount: number;
|
|
@@ -28,6 +44,7 @@ interface AppState {
|
|
|
28
44
|
currentWorkflow: string | null;
|
|
29
45
|
suggestions: string[];
|
|
30
46
|
isProcessing: boolean;
|
|
47
|
+
workflowState: WorkflowState;
|
|
31
48
|
}
|
|
32
49
|
export declare function useAppState(): {
|
|
33
50
|
state: AppState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppState.d.ts","sourceRoot":"","sources":["../../../src/tui/hooks/useAppState.ts"],"names":[],"mappings":"AAEA,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,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,QAAQ;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACtC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useAppState.d.ts","sourceRoot":"","sources":["../../../src/tui/hooks/useAppState.ts"],"names":[],"mappings":"AAEA,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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a,CAAC;CAC9B;AA6DD,wBAAgB,WAAW;;;4BAgEkB,MAAM;EAmFlD"}
|
|
@@ -19,6 +19,37 @@ const DEFAULT_PROVIDERS = [
|
|
|
19
19
|
{ name: "OpenCode", status: "idle", latency: 0 },
|
|
20
20
|
{ name: "Anthropic", status: "idle", latency: 0 },
|
|
21
21
|
];
|
|
22
|
+
const DEFAULT_WORKFLOW_STATE = {
|
|
23
|
+
levels: [
|
|
24
|
+
{
|
|
25
|
+
name: "L1: SPEC",
|
|
26
|
+
progress: 0,
|
|
27
|
+
nodes: [
|
|
28
|
+
{ id: "intent", name: "IntentClassifier", status: "pending", agent: "H" },
|
|
29
|
+
{ id: "spec", name: "SpecAgent", status: "pending", agent: "H" },
|
|
30
|
+
{ id: "arch", name: "ArchitectureAgent", status: "pending", agent: "H" },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "L2: CODE",
|
|
35
|
+
progress: 0,
|
|
36
|
+
nodes: [
|
|
37
|
+
{ id: "task", name: "TaskPlanner", status: "pending", agent: "H" },
|
|
38
|
+
{ id: "codegen", name: "CodeGenerator", status: "pending", agent: "H" },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "L3: TEST",
|
|
43
|
+
progress: 0,
|
|
44
|
+
nodes: [
|
|
45
|
+
{ id: "test", name: "TestAgent", status: "pending", agent: "H" },
|
|
46
|
+
{ id: "fix", name: "FixAgent", status: "pending", agent: "H" },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
currentLevel: 0,
|
|
51
|
+
totalProgress: 0,
|
|
52
|
+
};
|
|
22
53
|
function generateId() {
|
|
23
54
|
return Math.random().toString(36).slice(2, 9);
|
|
24
55
|
}
|
|
@@ -42,6 +73,7 @@ export function useAppState() {
|
|
|
42
73
|
currentWorkflow: null,
|
|
43
74
|
suggestions: COMMAND_SUGGESTIONS,
|
|
44
75
|
isProcessing: false,
|
|
76
|
+
workflowState: DEFAULT_WORKFLOW_STATE,
|
|
45
77
|
});
|
|
46
78
|
const addMessage = useCallback((type, content, agent) => {
|
|
47
79
|
setState((prev) => ({
|
|
@@ -52,6 +84,31 @@ export function useAppState() {
|
|
|
52
84
|
],
|
|
53
85
|
}));
|
|
54
86
|
}, []);
|
|
87
|
+
const updateWorkflowProgress = useCallback((level, nodeIndex, status) => {
|
|
88
|
+
setState((prev) => {
|
|
89
|
+
const newLevels = prev.workflowState.levels.map((l, i) => {
|
|
90
|
+
if (i !== level)
|
|
91
|
+
return l;
|
|
92
|
+
const newNodes = l.nodes.map((n, j) => j === nodeIndex ? { ...n, status } : n);
|
|
93
|
+
const doneCount = newNodes.filter((n) => n.status === "done").length;
|
|
94
|
+
return {
|
|
95
|
+
...l,
|
|
96
|
+
nodes: newNodes,
|
|
97
|
+
progress: Math.round((doneCount / newNodes.length) * 100),
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
const totalDone = newLevels.reduce((acc, l) => acc + l.nodes.filter((n) => n.status === "done").length, 0);
|
|
101
|
+
const totalNodes = newLevels.reduce((acc, l) => acc + l.nodes.length, 0);
|
|
102
|
+
return {
|
|
103
|
+
...prev,
|
|
104
|
+
workflowState: {
|
|
105
|
+
levels: newLevels,
|
|
106
|
+
currentLevel: level,
|
|
107
|
+
totalProgress: Math.round((totalDone / totalNodes) * 100),
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}, []);
|
|
55
112
|
const processCommand = useCallback((input) => {
|
|
56
113
|
if (input.startsWith("/")) {
|
|
57
114
|
const cmd = input.slice(1).toLowerCase();
|
|
@@ -77,24 +134,7 @@ export function useAppState() {
|
|
|
77
134
|
default:
|
|
78
135
|
if (cmd.startsWith("run ")) {
|
|
79
136
|
const prompt = cmd.slice(4);
|
|
80
|
-
|
|
81
|
-
addMessage("user", prompt);
|
|
82
|
-
addMessage("agent", "Analyse de l'intent...", "IntentClassifier");
|
|
83
|
-
setTimeout(() => {
|
|
84
|
-
addMessage("agent", `Intent détecté: code_generation`, "IntentClassifier");
|
|
85
|
-
addMessage("agent", "Décomposition en tâches...", "TaskPlanner");
|
|
86
|
-
setState((prev) => ({
|
|
87
|
-
...prev,
|
|
88
|
-
status: "ready",
|
|
89
|
-
isProcessing: false,
|
|
90
|
-
fitness: Math.min(prev.fitness + 0.02, 0.99),
|
|
91
|
-
currentWorkflow: prompt,
|
|
92
|
-
agents: prev.agents.map((a, i) => ({
|
|
93
|
-
...a,
|
|
94
|
-
status: i === 0 ? "done" : i === 1 ? "running" : "idle",
|
|
95
|
-
})),
|
|
96
|
-
}));
|
|
97
|
-
}, 1500);
|
|
137
|
+
runWorkflow(prompt);
|
|
98
138
|
}
|
|
99
139
|
else {
|
|
100
140
|
addMessage("error", `Commande inconnue: /${cmd}. Tapez /help pour l'aide.`);
|
|
@@ -102,22 +142,45 @@ export function useAppState() {
|
|
|
102
142
|
}
|
|
103
143
|
}
|
|
104
144
|
else {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
145
|
+
runWorkflow(input);
|
|
146
|
+
}
|
|
147
|
+
}, [state, addMessage]);
|
|
148
|
+
const runWorkflow = useCallback((prompt) => {
|
|
149
|
+
setState((prev) => ({ ...prev, status: "running", isProcessing: true }));
|
|
150
|
+
addMessage("user", prompt);
|
|
151
|
+
let step = 0;
|
|
152
|
+
const steps = [
|
|
153
|
+
{ level: 0, node: 0, msg: "Analyse de l'intent...", agent: "IntentClassifier" },
|
|
154
|
+
{ level: 0, node: 1, msg: "Génération des specs...", agent: "SpecAgent" },
|
|
155
|
+
{ level: 0, node: 2, msg: "Design de l'architecture...", agent: "ArchitectureAgent" },
|
|
156
|
+
{ level: 1, node: 0, msg: "Planification des tâches...", agent: "TaskPlanner" },
|
|
157
|
+
{ level: 1, node: 1, msg: "Génération du code...", agent: "CodeGenerator" },
|
|
158
|
+
{ level: 2, node: 0, msg: "Exécution des tests...", agent: "TestAgent" },
|
|
159
|
+
{ level: 2, node: 1, msg: "Application des fixes...", agent: "FixAgent" },
|
|
160
|
+
];
|
|
161
|
+
function executeStep() {
|
|
162
|
+
if (step >= steps.length) {
|
|
111
163
|
setState((prev) => ({
|
|
112
164
|
...prev,
|
|
113
165
|
status: "ready",
|
|
114
166
|
isProcessing: false,
|
|
115
|
-
fitness: Math.min(prev.fitness + 0.
|
|
116
|
-
currentWorkflow:
|
|
167
|
+
fitness: Math.min(prev.fitness + 0.05, 0.99),
|
|
168
|
+
currentWorkflow: prompt,
|
|
117
169
|
}));
|
|
118
|
-
|
|
170
|
+
addMessage("success", `✓ Workflow terminé! Fitness: ${(state.fitness + 0.05).toFixed(2)}`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const s = steps[step];
|
|
174
|
+
updateWorkflowProgress(s.level, s.node, "running");
|
|
175
|
+
addMessage("agent", s.msg, s.agent);
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
updateWorkflowProgress(s.level, s.node, "done");
|
|
178
|
+
step++;
|
|
179
|
+
executeStep();
|
|
180
|
+
}, 500 + Math.random() * 500);
|
|
119
181
|
}
|
|
120
|
-
|
|
182
|
+
executeStep();
|
|
183
|
+
}, [addMessage, updateWorkflowProgress, state.fitness]);
|
|
121
184
|
return {
|
|
122
185
|
state,
|
|
123
186
|
dispatch: setState,
|