open-agents-ai 0.105.4 → 0.105.5
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/index.js +3 -41
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48477,10 +48477,10 @@ var init_status_bar = __esm({
|
|
|
48477
48477
|
const metricsPath = nexusDir + "/remote-metrics.json";
|
|
48478
48478
|
const raw = readFileSync31(metricsPath, "utf8");
|
|
48479
48479
|
const cached = JSON.parse(raw);
|
|
48480
|
-
if (cached && cached.ts && Date.now() - cached.ts <
|
|
48480
|
+
if (cached && cached.ts && Date.now() - cached.ts < 6e4) {
|
|
48481
48481
|
const m = cached.data;
|
|
48482
48482
|
if (m?.cpu) {
|
|
48483
|
-
lastPeerMetricsDebug = `ok
|
|
48483
|
+
lastPeerMetricsDebug = `ok: cpu=${m.cpu?.utilization}%`;
|
|
48484
48484
|
this.setRemoteMetrics({
|
|
48485
48485
|
cpuUtil: m.cpu?.utilization ?? 0,
|
|
48486
48486
|
cpuCores: m.cpu?.cores ?? 0,
|
|
@@ -48500,48 +48500,10 @@ var init_status_bar = __esm({
|
|
|
48500
48500
|
} catch {
|
|
48501
48501
|
}
|
|
48502
48502
|
}
|
|
48503
|
-
try {
|
|
48504
|
-
const queryData = { type: "query" };
|
|
48505
|
-
if (authKey)
|
|
48506
|
-
queryData.auth_key = authKey;
|
|
48507
|
-
const raw = await sendCommand("invoke_capability", {
|
|
48508
|
-
target_peer: peerId,
|
|
48509
|
-
capability: "system_metrics",
|
|
48510
|
-
input: queryData
|
|
48511
|
-
}, 15e3);
|
|
48512
|
-
if (typeof raw === "string" && raw.startsWith("Invoke error:")) {
|
|
48513
|
-
lastPeerMetricsDebug = `invoke error: ${raw.slice(0, 200)}`;
|
|
48514
|
-
throw new Error(raw);
|
|
48515
|
-
}
|
|
48516
|
-
const metricsData = extractMetrics(raw);
|
|
48517
|
-
if (metricsData?.cpu) {
|
|
48518
|
-
lastPeerMetricsDebug = `ok: cpu=${metricsData.cpu.utilization}%`;
|
|
48519
|
-
this.setRemoteMetrics({
|
|
48520
|
-
cpuUtil: metricsData.cpu?.utilization ?? 0,
|
|
48521
|
-
cpuCores: metricsData.cpu?.cores ?? 0,
|
|
48522
|
-
cpuModel: metricsData.cpu?.model ?? "",
|
|
48523
|
-
gpuUtil: metricsData.gpu?.available ? metricsData.gpu.utilization ?? 0 : -1,
|
|
48524
|
-
gpuName: metricsData.gpu?.name ?? "",
|
|
48525
|
-
vramUtil: metricsData.gpu?.available ? metricsData.gpu.vramUtilization ?? 0 : -1,
|
|
48526
|
-
vramUsedMB: metricsData.gpu?.vramUsedMB ?? 0,
|
|
48527
|
-
vramTotalMB: metricsData.gpu?.vramTotalMB ?? 0,
|
|
48528
|
-
memUtil: metricsData.memory?.utilization ?? 0,
|
|
48529
|
-
memTotalGB: metricsData.memory?.totalGB ?? 0,
|
|
48530
|
-
memUsedGB: metricsData.memory?.usedGB ?? 0
|
|
48531
|
-
});
|
|
48532
|
-
return;
|
|
48533
|
-
}
|
|
48534
|
-
lastPeerMetricsDebug = `parse fail: ${typeof raw === "string" ? raw.slice(0, 300) : "non-string"}`;
|
|
48535
|
-
} catch (e) {
|
|
48536
|
-
if (!lastPeerMetricsDebug.startsWith("invoke error:")) {
|
|
48537
|
-
lastPeerMetricsDebug = `exception: ${e instanceof Error ? e.message.slice(0, 200) : String(e).slice(0, 200)}`;
|
|
48538
|
-
}
|
|
48539
|
-
}
|
|
48540
48503
|
this.setRemoteMetrics({
|
|
48541
48504
|
cpuUtil: -1,
|
|
48542
|
-
// -1 = unavailable (won't render bar)
|
|
48543
48505
|
gpuUtil: -1,
|
|
48544
|
-
gpuName:
|
|
48506
|
+
gpuName: "peer (send a message to get metrics)",
|
|
48545
48507
|
vramUtil: -1,
|
|
48546
48508
|
memUtil: -1
|
|
48547
48509
|
});
|
package/package.json
CHANGED