agentflow-dashboard 0.8.1 → 0.8.2
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/{chunk-JRVE5NM3.js → chunk-EG254FLY.js} +20 -6
- package/dist/cli.cjs +19 -4
- package/dist/cli.js +1 -1
- package/dist/client/assets/{index-CyQ7qX-x.js → index-DCSWGDzI.js} +7 -7
- package/dist/client/index.html +1 -1
- package/dist/index.cjs +23 -8
- package/dist/index.js +1 -1
- package/dist/server.cjs +23 -8
- package/dist/server.js +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import { execSync } from "child_process";
|
|
|
10
10
|
import * as fs3 from "fs";
|
|
11
11
|
import { createServer } from "http";
|
|
12
12
|
import * as path3 from "path";
|
|
13
|
-
import { fileURLToPath } from "url";
|
|
13
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
14
14
|
|
|
15
15
|
// src/config.ts
|
|
16
16
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -2050,8 +2050,8 @@ var TraceWatcher = class _TraceWatcher extends EventEmitter {
|
|
|
2050
2050
|
return (b.lastModified || b.startTime) - (a.lastModified || a.startTime);
|
|
2051
2051
|
});
|
|
2052
2052
|
}
|
|
2053
|
-
getTrace(filename) {
|
|
2054
|
-
|
|
2053
|
+
getTrace(filename, agentId) {
|
|
2054
|
+
let candidates = [];
|
|
2055
2055
|
const exact = this.traces.get(filename);
|
|
2056
2056
|
if (exact) candidates.push(exact);
|
|
2057
2057
|
if (filename.includes("::")) {
|
|
@@ -2076,6 +2076,13 @@ var TraceWatcher = class _TraceWatcher extends EventEmitter {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
if (candidates.length === 0) return void 0;
|
|
2078
2078
|
if (candidates.length === 1) return candidates[0];
|
|
2079
|
+
if (agentId) {
|
|
2080
|
+
const agentMatches = candidates.filter((c) => c.agentId === agentId);
|
|
2081
|
+
if (agentMatches.length > 0) {
|
|
2082
|
+
candidates = agentMatches;
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
if (candidates.length === 1) return candidates[0];
|
|
2079
2086
|
let best = candidates[0];
|
|
2080
2087
|
let bestNodeCount = best.nodes instanceof Map ? best.nodes.size : Object.keys(best.nodes ?? {}).length;
|
|
2081
2088
|
for (let i = 1; i < candidates.length; i++) {
|
|
@@ -2133,7 +2140,9 @@ var TraceWatcher = class _TraceWatcher extends EventEmitter {
|
|
|
2133
2140
|
import * as fs2 from "fs";
|
|
2134
2141
|
import * as os from "os";
|
|
2135
2142
|
import * as path2 from "path";
|
|
2136
|
-
|
|
2143
|
+
import { fileURLToPath } from "url";
|
|
2144
|
+
var __cliDirname = path2.dirname(fileURLToPath(import.meta.url));
|
|
2145
|
+
var VERSION = JSON.parse(fs2.readFileSync(path2.resolve(__cliDirname, "../package.json"), "utf-8")).version;
|
|
2137
2146
|
function getLanAddress() {
|
|
2138
2147
|
const interfaces = os.networkInterfaces();
|
|
2139
2148
|
for (const name of Object.keys(interfaces)) {
|
|
@@ -2310,7 +2319,7 @@ Examples:
|
|
|
2310
2319
|
}
|
|
2311
2320
|
|
|
2312
2321
|
// src/server.ts
|
|
2313
|
-
var __filename =
|
|
2322
|
+
var __filename = fileURLToPath2(import.meta.url);
|
|
2314
2323
|
var __dirname = path3.dirname(__filename);
|
|
2315
2324
|
function serializeTrace(trace) {
|
|
2316
2325
|
if (!trace) return trace;
|
|
@@ -2416,6 +2425,10 @@ var DashboardServer = class {
|
|
|
2416
2425
|
if (fs3.existsSync(clientDir)) {
|
|
2417
2426
|
this.app.use(express.static(clientDir));
|
|
2418
2427
|
}
|
|
2428
|
+
const pkgVersion = JSON.parse(fs3.readFileSync(path3.resolve(__dirname, "../package.json"), "utf-8")).version;
|
|
2429
|
+
this.app.get("/api/version", (_req, res) => {
|
|
2430
|
+
res.json({ version: pkgVersion });
|
|
2431
|
+
});
|
|
2419
2432
|
this.app.get("/api/traces", (req, res) => {
|
|
2420
2433
|
try {
|
|
2421
2434
|
const limit = Math.min(Math.max(parseInt(req.query.limit, 10) || 50, 1), 200);
|
|
@@ -2435,7 +2448,8 @@ var DashboardServer = class {
|
|
|
2435
2448
|
});
|
|
2436
2449
|
this.app.get("/api/traces/:filename", (req, res) => {
|
|
2437
2450
|
try {
|
|
2438
|
-
const
|
|
2451
|
+
const agentId = typeof req.query.agent === "string" ? req.query.agent : void 0;
|
|
2452
|
+
const trace = this.watcher.getTrace(req.params.filename, agentId);
|
|
2439
2453
|
if (!trace) {
|
|
2440
2454
|
return res.status(404).json({ error: "Trace not found" });
|
|
2441
2455
|
}
|
package/dist/cli.cjs
CHANGED
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(cli_exports);
|
|
|
35
35
|
var fs3 = __toESM(require("fs"), 1);
|
|
36
36
|
var os = __toESM(require("os"), 1);
|
|
37
37
|
var path3 = __toESM(require("path"), 1);
|
|
38
|
+
var import_node_url2 = require("url");
|
|
38
39
|
|
|
39
40
|
// src/server.ts
|
|
40
41
|
var import_node_child_process = require("child_process");
|
|
@@ -2072,8 +2073,8 @@ var TraceWatcher = class _TraceWatcher extends import_node_events.EventEmitter {
|
|
|
2072
2073
|
return (b.lastModified || b.startTime) - (a.lastModified || a.startTime);
|
|
2073
2074
|
});
|
|
2074
2075
|
}
|
|
2075
|
-
getTrace(filename) {
|
|
2076
|
-
|
|
2076
|
+
getTrace(filename, agentId) {
|
|
2077
|
+
let candidates = [];
|
|
2077
2078
|
const exact = this.traces.get(filename);
|
|
2078
2079
|
if (exact) candidates.push(exact);
|
|
2079
2080
|
if (filename.includes("::")) {
|
|
@@ -2098,6 +2099,13 @@ var TraceWatcher = class _TraceWatcher extends import_node_events.EventEmitter {
|
|
|
2098
2099
|
}
|
|
2099
2100
|
if (candidates.length === 0) return void 0;
|
|
2100
2101
|
if (candidates.length === 1) return candidates[0];
|
|
2102
|
+
if (agentId) {
|
|
2103
|
+
const agentMatches = candidates.filter((c) => c.agentId === agentId);
|
|
2104
|
+
if (agentMatches.length > 0) {
|
|
2105
|
+
candidates = agentMatches;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
if (candidates.length === 1) return candidates[0];
|
|
2101
2109
|
let best = candidates[0];
|
|
2102
2110
|
let bestNodeCount = best.nodes instanceof Map ? best.nodes.size : Object.keys(best.nodes ?? {}).length;
|
|
2103
2111
|
for (let i = 1; i < candidates.length; i++) {
|
|
@@ -2259,6 +2267,10 @@ var DashboardServer = class {
|
|
|
2259
2267
|
if (fs2.existsSync(clientDir)) {
|
|
2260
2268
|
this.app.use(import_express.default.static(clientDir));
|
|
2261
2269
|
}
|
|
2270
|
+
const pkgVersion = JSON.parse(fs2.readFileSync(path2.resolve(__dirname, "../package.json"), "utf-8")).version;
|
|
2271
|
+
this.app.get("/api/version", (_req, res) => {
|
|
2272
|
+
res.json({ version: pkgVersion });
|
|
2273
|
+
});
|
|
2262
2274
|
this.app.get("/api/traces", (req, res) => {
|
|
2263
2275
|
try {
|
|
2264
2276
|
const limit = Math.min(Math.max(parseInt(req.query.limit, 10) || 50, 1), 200);
|
|
@@ -2278,7 +2290,8 @@ var DashboardServer = class {
|
|
|
2278
2290
|
});
|
|
2279
2291
|
this.app.get("/api/traces/:filename", (req, res) => {
|
|
2280
2292
|
try {
|
|
2281
|
-
const
|
|
2293
|
+
const agentId = typeof req.query.agent === "string" ? req.query.agent : void 0;
|
|
2294
|
+
const trace = this.watcher.getTrace(req.params.filename, agentId);
|
|
2282
2295
|
if (!trace) {
|
|
2283
2296
|
return res.status(404).json({ error: "Trace not found" });
|
|
2284
2297
|
}
|
|
@@ -3363,7 +3376,9 @@ if (import_meta.url === `file://${process.argv[1]}`) {
|
|
|
3363
3376
|
}
|
|
3364
3377
|
|
|
3365
3378
|
// src/cli.ts
|
|
3366
|
-
var
|
|
3379
|
+
var import_meta2 = {};
|
|
3380
|
+
var __cliDirname = path3.dirname((0, import_node_url2.fileURLToPath)(import_meta2.url));
|
|
3381
|
+
var VERSION = JSON.parse(fs3.readFileSync(path3.resolve(__cliDirname, "../package.json"), "utf-8")).version;
|
|
3367
3382
|
function getLanAddress() {
|
|
3368
3383
|
const interfaces = os.networkInterfaces();
|
|
3369
3384
|
for (const name of Object.keys(interfaces)) {
|