agentflow-dashboard 0.3.0 → 0.4.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/README.md +116 -297
- package/dist/{chunk-2FTN742J.js → chunk-25MUPUYY.js} +748 -72
- package/dist/cli.cjs +584 -56
- package/dist/cli.js +2 -147
- package/dist/index.cjs +740 -67
- package/dist/index.js +1 -1
- package/dist/public/dashboard.js +401 -25
- package/dist/public/debug.html +43 -0
- package/dist/public/index.html +215 -1
- package/dist/server.cjs +1875 -0
- package/dist/server.js +6 -0
- package/package.json +21 -5
- package/public/dashboard.js +401 -25
- package/public/debug.html +43 -0
- package/public/index.html +215 -1
package/dist/cli.js
CHANGED
|
@@ -1,151 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
|
|
5
|
-
// src/cli.ts
|
|
6
|
-
import * as fs from "fs";
|
|
7
|
-
import * as os from "os";
|
|
8
|
-
import * as path from "path";
|
|
9
|
-
var VERSION = "0.2.2";
|
|
10
|
-
function getLanAddress() {
|
|
11
|
-
const interfaces = os.networkInterfaces();
|
|
12
|
-
for (const name of Object.keys(interfaces)) {
|
|
13
|
-
for (const iface of interfaces[name] || []) {
|
|
14
|
-
if (iface.family === "IPv4" && !iface.internal) {
|
|
15
|
-
return iface.address;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
function printBanner(config, traceCount, stats) {
|
|
22
|
-
var _a;
|
|
23
|
-
const lan = getLanAddress();
|
|
24
|
-
const host = config.host || "localhost";
|
|
25
|
-
const port = config.port;
|
|
26
|
-
const isPublic = host === "0.0.0.0";
|
|
27
|
-
console.log(`
|
|
28
|
-
___ _ _____ _
|
|
29
|
-
/ _ \\ __ _ ___ _ __ | |_| ___| | _____ __
|
|
30
|
-
| |_| |/ _\` |/ _ \\ '_ \\| __| |_ | |/ _ \\ \\ /\\ / /
|
|
31
|
-
| _ | (_| | __/ | | | |_| _| | | (_) \\ V V /
|
|
32
|
-
|_| |_|\\__, |\\___|_| |_|\\__|_| |_|\\___/ \\_/\\_/
|
|
33
|
-
|___/ dashboard v${VERSION}
|
|
34
|
-
|
|
35
|
-
See your agents think.
|
|
36
|
-
|
|
37
|
-
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
|
|
38
|
-
\u2502 \u{1F916} Agents \u2502 TRACE FILES \u2502 \u{1F4CA} AgentFlow \u2502 SHOWS YOU \u2502 \u{1F310} Your browser \u2502
|
|
39
|
-
\u2502 Execute tasks, \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500> \u2502 Reads traces, \u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500> \u2502 Interactive \u2502
|
|
40
|
-
\u2502 write JSON \u2502 \u2502 builds graphs, \u2502 \u2502 graph, timeline, \u2502
|
|
41
|
-
\u2502 trace files. \u2502 \u2502 serves dashboard.\u2502 \u2502 metrics, health. \u2502
|
|
42
|
-
\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
|
|
43
|
-
|
|
44
|
-
Runs locally. Your data never leaves your machine.
|
|
45
|
-
|
|
46
|
-
Tabs: \u{1F3AF} Graph \xB7 \u23F1\uFE0F Timeline \xB7 \u{1F4CA} Metrics \xB7 \u{1F6E0}\uFE0F Process Health \xB7 \u26A0\uFE0F Errors
|
|
47
|
-
|
|
48
|
-
Traces: ${config.tracesDir}${((_a = config.dataDirs) == null ? void 0 : _a.length) ? "\n Data dirs: " + config.dataDirs.join("\n ") : ""}
|
|
49
|
-
Loaded: ${traceCount} traces \xB7 ${stats.totalAgents} agents \xB7 ${stats.totalExecutions} executions
|
|
50
|
-
Success: ${stats.globalSuccessRate.toFixed(1)}%${stats.activeAgents > 0 ? ` \xB7 ${stats.activeAgents} active now` : ""}
|
|
51
|
-
CORS: ${config.enableCors ? "enabled" : "disabled"}
|
|
52
|
-
WebSocket: live updates enabled
|
|
53
|
-
|
|
54
|
-
\u2192 http://localhost:${port}${isPublic && lan ? `
|
|
55
|
-
\u2192 http://${lan}:${port} (LAN)` : ""}
|
|
56
|
-
`);
|
|
57
|
-
}
|
|
58
|
-
async function startDashboard() {
|
|
59
|
-
const args = process.argv.slice(2);
|
|
60
|
-
const config = {
|
|
61
|
-
port: 3e3,
|
|
62
|
-
tracesDir: "./traces",
|
|
63
|
-
host: "localhost",
|
|
64
|
-
enableCors: false
|
|
65
|
-
};
|
|
66
|
-
for (let i = 0; i < args.length; i++) {
|
|
67
|
-
switch (args[i]) {
|
|
68
|
-
case "--port":
|
|
69
|
-
case "-p":
|
|
70
|
-
config.port = parseInt(args[++i]) || 3e3;
|
|
71
|
-
break;
|
|
72
|
-
case "--traces":
|
|
73
|
-
case "-t":
|
|
74
|
-
config.tracesDir = args[++i];
|
|
75
|
-
break;
|
|
76
|
-
case "--host":
|
|
77
|
-
case "-h":
|
|
78
|
-
config.host = args[++i];
|
|
79
|
-
break;
|
|
80
|
-
case "--data-dir":
|
|
81
|
-
if (!config.dataDirs) config.dataDirs = [];
|
|
82
|
-
config.dataDirs.push(args[++i]);
|
|
83
|
-
break;
|
|
84
|
-
case "--cors":
|
|
85
|
-
config.enableCors = true;
|
|
86
|
-
break;
|
|
87
|
-
case "--help":
|
|
88
|
-
printHelp();
|
|
89
|
-
process.exit(0);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const tracesPath = path.resolve(config.tracesDir);
|
|
93
|
-
if (!fs.existsSync(tracesPath)) {
|
|
94
|
-
fs.mkdirSync(tracesPath, { recursive: true });
|
|
95
|
-
}
|
|
96
|
-
config.tracesDir = tracesPath;
|
|
97
|
-
console.log("\nStarting AgentFlow Dashboard...\n");
|
|
98
|
-
const dashboard = new DashboardServer(config);
|
|
99
|
-
process.on("SIGINT", async () => {
|
|
100
|
-
console.log("\n\u{1F6D1} Shutting down dashboard...");
|
|
101
|
-
await dashboard.stop();
|
|
102
|
-
process.exit(0);
|
|
103
|
-
});
|
|
104
|
-
process.on("SIGTERM", async () => {
|
|
105
|
-
await dashboard.stop();
|
|
106
|
-
process.exit(0);
|
|
107
|
-
});
|
|
108
|
-
try {
|
|
109
|
-
await dashboard.start();
|
|
110
|
-
setTimeout(() => {
|
|
111
|
-
const stats = dashboard.getStats();
|
|
112
|
-
const traces = dashboard.getTraces();
|
|
113
|
-
printBanner(config, traces.length, stats);
|
|
114
|
-
}, 1500);
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.error("\u274C Failed to start dashboard:", error);
|
|
117
|
-
process.exit(1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function printHelp() {
|
|
121
|
-
console.log(`
|
|
122
|
-
\u{1F4CA} AgentFlow Dashboard v${VERSION} \u2014 See your agents think.
|
|
123
|
-
|
|
124
|
-
Usage:
|
|
125
|
-
agentflow-dashboard [options]
|
|
126
|
-
npx agentflow-dashboard [options]
|
|
127
|
-
|
|
128
|
-
Options:
|
|
129
|
-
-p, --port <number> Server port (default: 3000)
|
|
130
|
-
-t, --traces <path> Traces directory (default: ./traces)
|
|
131
|
-
-h, --host <address> Host address (default: localhost)
|
|
132
|
-
--data-dir <path> Extra data directory for process discovery (repeatable)
|
|
133
|
-
--cors Enable CORS headers
|
|
134
|
-
--help Show this help message
|
|
135
|
-
|
|
136
|
-
Examples:
|
|
137
|
-
agentflow-dashboard --traces ./traces --host 0.0.0.0 --cors
|
|
138
|
-
agentflow-dashboard -p 8080 -t /var/log/agentflow
|
|
139
|
-
agentflow-dashboard --traces ./traces --data-dir ./workers --data-dir ./cron
|
|
140
|
-
|
|
141
|
-
Tabs:
|
|
142
|
-
\u{1F3AF} Graph Interactive Cytoscape.js execution graph
|
|
143
|
-
\u23F1\uFE0F Timeline Waterfall view of node durations
|
|
144
|
-
\u{1F4CA} Metrics Success rates, durations, node breakdown
|
|
145
|
-
\u{1F6E0}\uFE0F Process Health PID files, systemd, workers, orphans
|
|
146
|
-
\u26A0\uFE0F Errors Failed and hung nodes with metadata
|
|
147
|
-
`);
|
|
148
|
-
}
|
|
2
|
+
startDashboard
|
|
3
|
+
} from "./chunk-25MUPUYY.js";
|
|
149
4
|
export {
|
|
150
5
|
startDashboard
|
|
151
6
|
};
|