open-agents-ai 0.103.90 → 0.103.92
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 +43 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45830,6 +45830,26 @@ async function collectGpuMetrics() {
|
|
|
45830
45830
|
return noGpu;
|
|
45831
45831
|
}
|
|
45832
45832
|
}
|
|
45833
|
+
function getInstantSnapshot() {
|
|
45834
|
+
const cr = collectCpuRam();
|
|
45835
|
+
return {
|
|
45836
|
+
source: "local",
|
|
45837
|
+
hardware: {
|
|
45838
|
+
cpuUtil: cr.cpuUtil,
|
|
45839
|
+
cpuCores: cr.cpuCores,
|
|
45840
|
+
cpuModel: cr.cpuModel,
|
|
45841
|
+
gpuUtil: -1,
|
|
45842
|
+
gpuName: "",
|
|
45843
|
+
vramUtil: -1,
|
|
45844
|
+
vramUsedMB: 0,
|
|
45845
|
+
vramTotalMB: 0,
|
|
45846
|
+
memUtil: cr.memUtil,
|
|
45847
|
+
memUsedGB: cr.memUsedGB,
|
|
45848
|
+
memTotalGB: cr.memTotalGB
|
|
45849
|
+
},
|
|
45850
|
+
network: { rxBytesPerSec: 0, txBytesPerSec: 0 }
|
|
45851
|
+
};
|
|
45852
|
+
}
|
|
45833
45853
|
function collectCpuRam() {
|
|
45834
45854
|
const [l1] = loadavg2();
|
|
45835
45855
|
const cores = cpus2().length;
|
|
@@ -46161,6 +46181,9 @@ var init_status_bar = __esm({
|
|
|
46161
46181
|
_prevTermCols = 0;
|
|
46162
46182
|
/** Debounce timer for resize events — prevents separator stacking during drag */
|
|
46163
46183
|
_resizeTimer = null;
|
|
46184
|
+
/** True while resize is in-flight (between first SIGWINCH and debounce settle).
|
|
46185
|
+
* Suppresses ALL footer renders to prevent separator debris at intermediate sizes. */
|
|
46186
|
+
_resizing = false;
|
|
46164
46187
|
/**
|
|
46165
46188
|
* Depth-counted content write guard. Incremented by beginContentWrite(),
|
|
46166
46189
|
* decremented by endContentWrite(). Footer is only redrawn and cursor
|
|
@@ -46587,13 +46610,13 @@ var init_status_bar = __esm({
|
|
|
46587
46610
|
poll();
|
|
46588
46611
|
this._remoteMetricsTimer = setInterval(poll, 1e4);
|
|
46589
46612
|
}
|
|
46590
|
-
/** Stop polling remote metrics */
|
|
46613
|
+
/** Stop polling remote metrics and switch back to local */
|
|
46591
46614
|
stopRemoteMetricsPolling() {
|
|
46592
46615
|
if (this._remoteMetricsTimer) {
|
|
46593
46616
|
clearInterval(this._remoteMetricsTimer);
|
|
46594
46617
|
this._remoteMetricsTimer = null;
|
|
46595
46618
|
}
|
|
46596
|
-
this.
|
|
46619
|
+
this.startLocalMetrics();
|
|
46597
46620
|
}
|
|
46598
46621
|
/** Update token metrics from a token_usage event */
|
|
46599
46622
|
updateMetrics(update) {
|
|
@@ -46661,6 +46684,11 @@ var init_status_bar = __esm({
|
|
|
46661
46684
|
/** Deactivate — restore full-screen scroll region */
|
|
46662
46685
|
deactivate() {
|
|
46663
46686
|
this.active = false;
|
|
46687
|
+
this._resizing = false;
|
|
46688
|
+
if (this._resizeTimer) {
|
|
46689
|
+
clearTimeout(this._resizeTimer);
|
|
46690
|
+
this._resizeTimer = null;
|
|
46691
|
+
}
|
|
46664
46692
|
this.stopAllMetrics();
|
|
46665
46693
|
const rows = process.stdout.rows ?? 24;
|
|
46666
46694
|
process.stdout.write(`\x1B[1;${rows}r`);
|
|
@@ -46710,10 +46738,12 @@ var init_status_bar = __esm({
|
|
|
46710
46738
|
handleResize() {
|
|
46711
46739
|
if (!this.active)
|
|
46712
46740
|
return;
|
|
46741
|
+
this._resizing = true;
|
|
46713
46742
|
if (this._resizeTimer)
|
|
46714
46743
|
clearTimeout(this._resizeTimer);
|
|
46715
46744
|
this._resizeTimer = setTimeout(() => {
|
|
46716
46745
|
this._resizeTimer = null;
|
|
46746
|
+
this._resizing = false;
|
|
46717
46747
|
this._handleResizeImmediate();
|
|
46718
46748
|
}, 50);
|
|
46719
46749
|
}
|
|
@@ -46730,7 +46760,7 @@ var init_status_bar = __esm({
|
|
|
46730
46760
|
this._prevTermCols = cols;
|
|
46731
46761
|
const pos = this.rowPositions(rows);
|
|
46732
46762
|
const w = getTermWidth();
|
|
46733
|
-
const sep =
|
|
46763
|
+
const sep = `\x1B[38;5;236m${"\u2500".repeat(w)}\x1B[0m`;
|
|
46734
46764
|
if (this.writeDepth > 0) {
|
|
46735
46765
|
const inputWrap = this.wrapInput(w);
|
|
46736
46766
|
let buf = `\x1B[${this.scrollRegionTop};${pos.scrollEnd}r\x1B[?25l\x1B[?7l`;
|
|
@@ -46969,8 +46999,8 @@ var init_status_bar = __esm({
|
|
|
46969
46999
|
empty: false
|
|
46970
47000
|
});
|
|
46971
47001
|
}
|
|
46972
|
-
|
|
46973
|
-
const um = this._unifiedMetrics;
|
|
47002
|
+
{
|
|
47003
|
+
const um = this._unifiedMetrics ?? getInstantSnapshot();
|
|
46974
47004
|
const rm2 = um.hardware;
|
|
46975
47005
|
const isLocal = um.source === "local";
|
|
46976
47006
|
const srcTag = isLocal ? pastel2(120, "L") : pastel2(117, "R");
|
|
@@ -47007,7 +47037,9 @@ var init_status_bar = __esm({
|
|
|
47007
47037
|
const vramColor = rm2.vramUtil > 80 ? c2.red : rm2.vramUtil > 50 ? c2.yellow : c2.green;
|
|
47008
47038
|
const vramDetail = rm2.vramTotalMB > 0 ? ` (${rm2.vramUsedMB}/${rm2.vramTotalMB}MB)` : "";
|
|
47009
47039
|
hwExpStr += ` VRAM ${vramColor(rm2.vramUtil + "%")}${c2.dim(vramDetail)}`;
|
|
47040
|
+
hwCompStr += ` VRAM ${vramColor(rm2.vramUtil + "%")}`;
|
|
47010
47041
|
hwExpW += 6 + `${rm2.vramUtil}%`.length + vramDetail.length;
|
|
47042
|
+
hwCompW += 6 + `${rm2.vramUtil}%`.length;
|
|
47011
47043
|
}
|
|
47012
47044
|
const net = um.network;
|
|
47013
47045
|
const rxStr = formatRate(net.rxBytesPerSec);
|
|
@@ -47200,7 +47232,7 @@ var init_status_bar = __esm({
|
|
|
47200
47232
|
* applyScrollRegion() and beginContentWrite().
|
|
47201
47233
|
*/
|
|
47202
47234
|
renderFooterAndPositionInput() {
|
|
47203
|
-
if (!this.active)
|
|
47235
|
+
if (!this.active || this._resizing)
|
|
47204
47236
|
return;
|
|
47205
47237
|
const rows = process.stdout.rows ?? 24;
|
|
47206
47238
|
const w = getTermWidth();
|
|
@@ -47225,7 +47257,7 @@ var init_status_bar = __esm({
|
|
|
47225
47257
|
process.stdout.write(scrollDown);
|
|
47226
47258
|
}
|
|
47227
47259
|
}
|
|
47228
|
-
const sep =
|
|
47260
|
+
const sep = `\x1B[38;5;236m${"\u2500".repeat(w)}\x1B[0m`;
|
|
47229
47261
|
const inputWrap = this.wrapInput(w);
|
|
47230
47262
|
let buf = `\x1B[?7l\x1B[${pos.bufferRow};1H\x1B[2K${this.buildBufferContent(w)}\x1B[${pos.topSepRow};1H\x1B[2K${sep}`;
|
|
47231
47263
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
|
@@ -47250,7 +47282,7 @@ var init_status_bar = __esm({
|
|
|
47250
47282
|
* cursor save/restore corrupts the restore position on many terminals.
|
|
47251
47283
|
*/
|
|
47252
47284
|
renderFooterPreserveCursor() {
|
|
47253
|
-
if (!this.active)
|
|
47285
|
+
if (!this.active || this._resizing)
|
|
47254
47286
|
return;
|
|
47255
47287
|
if (this.footerHeightChanged()) {
|
|
47256
47288
|
if (this.writeDepth === 0) {
|
|
@@ -47261,7 +47293,7 @@ var init_status_bar = __esm({
|
|
|
47261
47293
|
const rows = process.stdout.rows ?? 24;
|
|
47262
47294
|
const w = getTermWidth();
|
|
47263
47295
|
const pos = this.rowPositions(rows);
|
|
47264
|
-
const sep =
|
|
47296
|
+
const sep = `\x1B[38;5;236m${"\u2500".repeat(w)}\x1B[0m`;
|
|
47265
47297
|
const buf = `\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H\x1B[2K${this.buildBufferContent(w)}\x1B[${pos.topSepRow};1H\x1B[2K${sep}\x1B[${pos.bottomSepRow};1H\x1B[2K${sep}\x1B[${pos.metricsRow};1H\x1B[2K${this.buildMetricsLine()}\x1B[?7h\x1B8` + // DEC restore cursor
|
|
47266
47298
|
(this.writeDepth === 0 ? "\x1B[?25h" : "");
|
|
47267
47299
|
process.stdout.write(buf);
|
|
@@ -47272,7 +47304,7 @@ var init_status_bar = __esm({
|
|
|
47272
47304
|
* If footer height changed, also updates DECSTBM and redraws full footer.
|
|
47273
47305
|
*/
|
|
47274
47306
|
renderInputRowDuringStream() {
|
|
47275
|
-
if (!this.active || !this.inputStateProvider)
|
|
47307
|
+
if (!this.active || this._resizing || !this.inputStateProvider)
|
|
47276
47308
|
return;
|
|
47277
47309
|
const rows = process.stdout.rows ?? 24;
|
|
47278
47310
|
const w = getTermWidth();
|
|
@@ -47297,7 +47329,7 @@ var init_status_bar = __esm({
|
|
|
47297
47329
|
buf += "\x1BM";
|
|
47298
47330
|
}
|
|
47299
47331
|
buf += "\x1B[?7l";
|
|
47300
|
-
const sep =
|
|
47332
|
+
const sep = `\x1B[38;5;236m${"\u2500".repeat(w)}\x1B[0m`;
|
|
47301
47333
|
buf += `\x1B[${pos.bufferRow};1H\x1B[2K${this.buildBufferContent(w)}`;
|
|
47302
47334
|
buf += `\x1B[${pos.topSepRow};1H\x1B[2K${sep}`;
|
|
47303
47335
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
package/package.json
CHANGED