open-agents-ai 0.105.2 → 0.105.3
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 +53 -53
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29958,14 +29958,6 @@ ${this.formatConnectionInfo()}`);
|
|
|
29958
29958
|
lines.push(`\x1B]52;c;${b64}\x07`);
|
|
29959
29959
|
lines.push(` ${c2.dim("(copied to clipboard)")}`);
|
|
29960
29960
|
}
|
|
29961
|
-
const infCaps = this._capabilities.filter((cap) => cap.startsWith("inference:"));
|
|
29962
|
-
if (infCaps.length > 0) {
|
|
29963
|
-
lines.push("");
|
|
29964
|
-
lines.push(` ${c2.bold("Exposed capabilities:")}`);
|
|
29965
|
-
for (const cap of infCaps) {
|
|
29966
|
-
lines.push(` ${c2.cyan(cap)}`);
|
|
29967
|
-
}
|
|
29968
|
-
}
|
|
29969
29961
|
return lines.join("\n");
|
|
29970
29962
|
}
|
|
29971
29963
|
/** Format usage stats for display */
|
|
@@ -48393,56 +48385,64 @@ var init_status_bar = __esm({
|
|
|
48393
48385
|
return null;
|
|
48394
48386
|
};
|
|
48395
48387
|
let lastPeerMetricsDebug = "";
|
|
48388
|
+
let pollInFlight = false;
|
|
48396
48389
|
const poll = async () => {
|
|
48397
|
-
|
|
48390
|
+
if (pollInFlight)
|
|
48391
|
+
return;
|
|
48392
|
+
pollInFlight = true;
|
|
48398
48393
|
try {
|
|
48399
|
-
|
|
48400
|
-
|
|
48401
|
-
queryData
|
|
48402
|
-
|
|
48403
|
-
|
|
48404
|
-
|
|
48405
|
-
|
|
48406
|
-
|
|
48407
|
-
|
|
48408
|
-
|
|
48409
|
-
|
|
48410
|
-
|
|
48411
|
-
|
|
48412
|
-
|
|
48413
|
-
|
|
48414
|
-
|
|
48415
|
-
|
|
48416
|
-
|
|
48417
|
-
|
|
48418
|
-
|
|
48419
|
-
|
|
48420
|
-
|
|
48421
|
-
|
|
48422
|
-
|
|
48423
|
-
|
|
48424
|
-
|
|
48425
|
-
|
|
48426
|
-
|
|
48427
|
-
|
|
48428
|
-
|
|
48429
|
-
|
|
48430
|
-
|
|
48431
|
-
|
|
48432
|
-
|
|
48394
|
+
pollAttempt++;
|
|
48395
|
+
try {
|
|
48396
|
+
const queryData = { type: "query" };
|
|
48397
|
+
if (authKey)
|
|
48398
|
+
queryData.auth_key = authKey;
|
|
48399
|
+
const raw = await sendCommand("invoke_capability", {
|
|
48400
|
+
target_peer: peerId,
|
|
48401
|
+
capability: "system_metrics",
|
|
48402
|
+
input: queryData
|
|
48403
|
+
}, 15e3);
|
|
48404
|
+
if (typeof raw === "string" && raw.startsWith("Invoke error:")) {
|
|
48405
|
+
lastPeerMetricsDebug = `invoke error: ${raw.slice(0, 200)}`;
|
|
48406
|
+
throw new Error(raw);
|
|
48407
|
+
}
|
|
48408
|
+
const metricsData = extractMetrics(raw);
|
|
48409
|
+
if (metricsData?.cpu) {
|
|
48410
|
+
lastPeerMetricsDebug = `ok: cpu=${metricsData.cpu.utilization}%`;
|
|
48411
|
+
this.setRemoteMetrics({
|
|
48412
|
+
cpuUtil: metricsData.cpu?.utilization ?? 0,
|
|
48413
|
+
cpuCores: metricsData.cpu?.cores ?? 0,
|
|
48414
|
+
cpuModel: metricsData.cpu?.model ?? "",
|
|
48415
|
+
gpuUtil: metricsData.gpu?.available ? metricsData.gpu.utilization ?? 0 : -1,
|
|
48416
|
+
gpuName: metricsData.gpu?.name ?? "",
|
|
48417
|
+
vramUtil: metricsData.gpu?.available ? metricsData.gpu.vramUtilization ?? 0 : -1,
|
|
48418
|
+
vramUsedMB: metricsData.gpu?.vramUsedMB ?? 0,
|
|
48419
|
+
vramTotalMB: metricsData.gpu?.vramTotalMB ?? 0,
|
|
48420
|
+
memUtil: metricsData.memory?.utilization ?? 0,
|
|
48421
|
+
memTotalGB: metricsData.memory?.totalGB ?? 0,
|
|
48422
|
+
memUsedGB: metricsData.memory?.usedGB ?? 0
|
|
48423
|
+
});
|
|
48424
|
+
return;
|
|
48425
|
+
}
|
|
48426
|
+
lastPeerMetricsDebug = `parse fail: ${typeof raw === "string" ? raw.slice(0, 300) : "non-string"}`;
|
|
48427
|
+
} catch (e) {
|
|
48428
|
+
if (!lastPeerMetricsDebug.startsWith("invoke error:")) {
|
|
48429
|
+
lastPeerMetricsDebug = `exception: ${e instanceof Error ? e.message.slice(0, 200) : String(e).slice(0, 200)}`;
|
|
48430
|
+
}
|
|
48433
48431
|
}
|
|
48432
|
+
this.setRemoteMetrics({
|
|
48433
|
+
cpuUtil: -1,
|
|
48434
|
+
// -1 = unavailable (won't render bar)
|
|
48435
|
+
gpuUtil: -1,
|
|
48436
|
+
gpuName: pollAttempt <= 5 ? "connecting..." : `peer (${lastPeerMetricsDebug.slice(0, 40)})`,
|
|
48437
|
+
vramUtil: -1,
|
|
48438
|
+
memUtil: -1
|
|
48439
|
+
});
|
|
48440
|
+
} finally {
|
|
48441
|
+
pollInFlight = false;
|
|
48434
48442
|
}
|
|
48435
|
-
this.setRemoteMetrics({
|
|
48436
|
-
cpuUtil: -1,
|
|
48437
|
-
// -1 = unavailable (won't render bar)
|
|
48438
|
-
gpuUtil: -1,
|
|
48439
|
-
gpuName: pollAttempt <= 5 ? "connecting..." : `peer (${lastPeerMetricsDebug.slice(0, 40)})`,
|
|
48440
|
-
vramUtil: -1,
|
|
48441
|
-
memUtil: -1
|
|
48442
|
-
});
|
|
48443
48443
|
};
|
|
48444
|
-
setTimeout(poll,
|
|
48445
|
-
this._remoteMetricsTimer = setInterval(poll,
|
|
48444
|
+
setTimeout(poll, 2e3);
|
|
48445
|
+
this._remoteMetricsTimer = setInterval(poll, 1e4);
|
|
48446
48446
|
}
|
|
48447
48447
|
/** Stop polling remote metrics and switch back to local */
|
|
48448
48448
|
stopRemoteMetricsPolling() {
|
package/package.json
CHANGED