open-agents-ai 0.104.23 → 0.104.25
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 +66 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13325,7 +13325,7 @@ async function handleCmd(cmd) {
|
|
|
13325
13325
|
dlog('system_metrics: auth OK');
|
|
13326
13326
|
}
|
|
13327
13327
|
try {
|
|
13328
|
-
var os =
|
|
13328
|
+
var os = await import('node:os');
|
|
13329
13329
|
var loads = os.loadavg();
|
|
13330
13330
|
var cores = os.cpus().length;
|
|
13331
13331
|
var totalMem = os.totalmem();
|
|
@@ -13333,7 +13333,7 @@ async function handleCmd(cmd) {
|
|
|
13333
13333
|
var usedMem = totalMem - freeMem;
|
|
13334
13334
|
var gpuInfo = { available: false, name: '', utilization: 0, vramUsedMB: 0, vramTotalMB: 0, vramUtilization: 0 };
|
|
13335
13335
|
try {
|
|
13336
|
-
var cp =
|
|
13336
|
+
var cp = await import('node:child_process');
|
|
13337
13337
|
var smiOut = cp.execSync('nvidia-smi --query-gpu=utilization.gpu,memory.used,memory.total,name --format=csv,noheader,nounits 2>/dev/null', { encoding: 'utf8', timeout: 3000 });
|
|
13338
13338
|
var smiLine = smiOut.trim().split('\\n')[0];
|
|
13339
13339
|
if (smiLine) {
|
|
@@ -29494,6 +29494,8 @@ ${this.formatConnectionInfo()}`);
|
|
|
29494
29494
|
this._stats.totalRequests = invocCount;
|
|
29495
29495
|
this._prevInvocCount = invocCount;
|
|
29496
29496
|
this.emitStats();
|
|
29497
|
+
for (let i = 0; i < newRequests; i++)
|
|
29498
|
+
this.emit("token_flash");
|
|
29497
29499
|
return;
|
|
29498
29500
|
}
|
|
29499
29501
|
const now = Date.now();
|
|
@@ -29619,6 +29621,7 @@ ${this.formatConnectionInfo()}`);
|
|
|
29619
29621
|
}
|
|
29620
29622
|
}
|
|
29621
29623
|
this.emitStats();
|
|
29624
|
+
this.emit("token_flash");
|
|
29622
29625
|
}
|
|
29623
29626
|
}
|
|
29624
29627
|
} catch {
|
|
@@ -37431,6 +37434,8 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
|
37431
37434
|
});
|
|
37432
37435
|
|
|
37433
37436
|
// packages/cli/dist/tui/commands.js
|
|
37437
|
+
import * as nodeOs from "node:os";
|
|
37438
|
+
import { execSync as nodeExecSync } from "node:child_process";
|
|
37434
37439
|
function safeLog(text) {
|
|
37435
37440
|
if (isNeovimActive()) {
|
|
37436
37441
|
writeToNeovimOutput(text + "\n");
|
|
@@ -40167,16 +40172,15 @@ function fmtUptime(ms) {
|
|
|
40167
40172
|
return `${Math.floor(sec / 3600)}h ${Math.floor(sec % 3600 / 60)}m`;
|
|
40168
40173
|
}
|
|
40169
40174
|
function getLocalSystemMetrics() {
|
|
40170
|
-
const
|
|
40171
|
-
const
|
|
40172
|
-
const
|
|
40173
|
-
const
|
|
40174
|
-
const freeMem = os.freemem();
|
|
40175
|
+
const cpus4 = nodeOs.cpus();
|
|
40176
|
+
const loads = nodeOs.loadavg();
|
|
40177
|
+
const totalMem = nodeOs.totalmem();
|
|
40178
|
+
const freeMem = nodeOs.freemem();
|
|
40175
40179
|
const usedMem = totalMem - freeMem;
|
|
40176
40180
|
const result = {
|
|
40177
|
-
cpuModel:
|
|
40178
|
-
cpuCores:
|
|
40179
|
-
cpuUtil: Math.min(100, Math.round(loads[0] /
|
|
40181
|
+
cpuModel: cpus4[0]?.model?.trim() ?? "unknown",
|
|
40182
|
+
cpuCores: cpus4.length,
|
|
40183
|
+
cpuUtil: Math.min(100, Math.round(loads[0] / cpus4.length * 100)),
|
|
40180
40184
|
memTotalGB: Math.round(totalMem / (1024 * 1024 * 1024) * 10) / 10,
|
|
40181
40185
|
memUsedGB: Math.round(usedMem / (1024 * 1024 * 1024) * 10) / 10,
|
|
40182
40186
|
memUtil: Math.round(usedMem / totalMem * 100),
|
|
@@ -40188,8 +40192,7 @@ function getLocalSystemMetrics() {
|
|
|
40188
40192
|
vramUtil: 0
|
|
40189
40193
|
};
|
|
40190
40194
|
try {
|
|
40191
|
-
const
|
|
40192
|
-
const smiOut = execSync30("nvidia-smi --query-gpu=utilization.gpu,memory.used,memory.total,name --format=csv,noheader,nounits 2>/dev/null", { encoding: "utf8", timeout: 3e3 });
|
|
40195
|
+
const smiOut = nodeExecSync("nvidia-smi --query-gpu=utilization.gpu,memory.used,memory.total,name --format=csv,noheader,nounits 2>/dev/null", { encoding: "utf8", timeout: 3e3 });
|
|
40193
40196
|
const line = smiOut.trim().split("\n")[0];
|
|
40194
40197
|
if (line) {
|
|
40195
40198
|
const parts = line.split(",").map((s) => s.trim());
|
|
@@ -47138,7 +47141,7 @@ var init_braille_spinner = __esm({
|
|
|
47138
47141
|
});
|
|
47139
47142
|
|
|
47140
47143
|
// packages/cli/dist/tui/system-metrics.js
|
|
47141
|
-
import { loadavg as
|
|
47144
|
+
import { loadavg as loadavg3, cpus as cpus3, totalmem as totalmem4, freemem as freemem3, platform as platform4 } from "node:os";
|
|
47142
47145
|
import { exec as exec3 } from "node:child_process";
|
|
47143
47146
|
import { readFile as readFile16 } from "node:fs/promises";
|
|
47144
47147
|
function formatRate(bytesPerSec) {
|
|
@@ -47269,11 +47272,11 @@ function getInstantSnapshot() {
|
|
|
47269
47272
|
};
|
|
47270
47273
|
}
|
|
47271
47274
|
function collectCpuRam() {
|
|
47272
|
-
const [l1] =
|
|
47273
|
-
const cores =
|
|
47274
|
-
const cpuModel =
|
|
47275
|
-
const totalMem =
|
|
47276
|
-
const usedMem = totalMem -
|
|
47275
|
+
const [l1] = loadavg3();
|
|
47276
|
+
const cores = cpus3().length;
|
|
47277
|
+
const cpuModel = cpus3()[0]?.model ?? "";
|
|
47278
|
+
const totalMem = totalmem4();
|
|
47279
|
+
const usedMem = totalMem - freemem3();
|
|
47277
47280
|
return {
|
|
47278
47281
|
cpuUtil: Math.min(100, Math.round(l1 / cores * 100)),
|
|
47279
47282
|
cpuCores: cores,
|
|
@@ -47628,9 +47631,6 @@ var init_status_bar = __esm({
|
|
|
47628
47631
|
_countdown = 0;
|
|
47629
47632
|
_recBlink = true;
|
|
47630
47633
|
_recBlinkTimer = null;
|
|
47631
|
-
/** Alive blinker: green/black dot at 0.5s, always on when status bar active */
|
|
47632
|
-
_aliveBlink = true;
|
|
47633
|
-
_aliveBlinkTimer = null;
|
|
47634
47634
|
/** Whether agent is actively processing (braille animation) */
|
|
47635
47635
|
_processing = false;
|
|
47636
47636
|
_brailleSpinner = new BrailleSpinner();
|
|
@@ -47827,7 +47827,7 @@ var init_status_bar = __esm({
|
|
|
47827
47827
|
/** Current active peer/connection count — drives LED color spectrum */
|
|
47828
47828
|
_exposePeerCount = 0;
|
|
47829
47829
|
/**
|
|
47830
|
-
* Blue→magenta color spectrum based on peer count.
|
|
47830
|
+
* Blue→magenta color spectrum based on peer count (expose section LED).
|
|
47831
47831
|
* 256-color ANSI codes: 33(blue) → 69 → 105 → 141 → 177 → 201(magenta)
|
|
47832
47832
|
* 1 peer = blue, 5+ peers = magenta, 0 = dim gray (240).
|
|
47833
47833
|
*/
|
|
@@ -47839,6 +47839,19 @@ var init_status_bar = __esm({
|
|
|
47839
47839
|
const idx = Math.min(n - 1, stops.length - 1);
|
|
47840
47840
|
return stops[idx];
|
|
47841
47841
|
}
|
|
47842
|
+
/**
|
|
47843
|
+
* Cyan→magenta color spectrum for the alive LED (section 0).
|
|
47844
|
+
* 256-color ramp through the RGB cube: (0,5,5)→(5,0,5).
|
|
47845
|
+
* 1 peer = cyan, 5+ peers = magenta, 0 = dim gray (240).
|
|
47846
|
+
*/
|
|
47847
|
+
_aliveLedColor() {
|
|
47848
|
+
const n = this._exposePeerCount;
|
|
47849
|
+
if (n <= 0)
|
|
47850
|
+
return 240;
|
|
47851
|
+
const stops = [51, 81, 111, 141, 171, 201];
|
|
47852
|
+
const idx = Math.min(n - 1, stops.length - 1);
|
|
47853
|
+
return stops[idx];
|
|
47854
|
+
}
|
|
47842
47855
|
/** Update expose gateway status — only stores state, no blink timers */
|
|
47843
47856
|
setExposeStatus(status) {
|
|
47844
47857
|
this._expose = status;
|
|
@@ -48168,14 +48181,6 @@ var init_status_bar = __esm({
|
|
|
48168
48181
|
if (!this._metricsCollector.isActive) {
|
|
48169
48182
|
this.startLocalMetrics();
|
|
48170
48183
|
}
|
|
48171
|
-
this._aliveBlink = true;
|
|
48172
|
-
if (this._aliveBlinkTimer)
|
|
48173
|
-
clearInterval(this._aliveBlinkTimer);
|
|
48174
|
-
this._aliveBlinkTimer = setInterval(() => {
|
|
48175
|
-
this._aliveBlink = !this._aliveBlink;
|
|
48176
|
-
if (this.active)
|
|
48177
|
-
this.renderFooterPreserveCursor();
|
|
48178
|
-
}, 500);
|
|
48179
48184
|
}
|
|
48180
48185
|
/** Deactivate — restore full-screen scroll region */
|
|
48181
48186
|
deactivate() {
|
|
@@ -48185,10 +48190,6 @@ var init_status_bar = __esm({
|
|
|
48185
48190
|
clearTimeout(this._resizeTimer);
|
|
48186
48191
|
this._resizeTimer = null;
|
|
48187
48192
|
}
|
|
48188
|
-
if (this._aliveBlinkTimer) {
|
|
48189
|
-
clearInterval(this._aliveBlinkTimer);
|
|
48190
|
-
this._aliveBlinkTimer = null;
|
|
48191
|
-
}
|
|
48192
48193
|
this.stopAllMetrics();
|
|
48193
48194
|
const rows = process.stdout.rows ?? 24;
|
|
48194
48195
|
process.stdout.write(`\x1B[1;${rows}r`);
|
|
@@ -48379,9 +48380,10 @@ var init_status_bar = __esm({
|
|
|
48379
48380
|
const compactOrder = [];
|
|
48380
48381
|
let modelSectionIdx = -1;
|
|
48381
48382
|
let versionSectionIdx = -1;
|
|
48382
|
-
{
|
|
48383
|
-
const
|
|
48384
|
-
|
|
48383
|
+
if (this._exposeFlashOn) {
|
|
48384
|
+
const ledColor = this._aliveLedColor();
|
|
48385
|
+
const dot = `\x1B[38;5;${ledColor}m\u2B24\x1B[0m`;
|
|
48386
|
+
sections.push({ expanded: dot, compact: dot, expandedW: 1, compactW: 1, empty: false });
|
|
48385
48387
|
}
|
|
48386
48388
|
const tokInRaw = m.promptTokens > 0 ? m.promptTokens : Math.max(m.estimatedContextTokens, 0);
|
|
48387
48389
|
const effectiveOut = this.effectiveCompletionTokens;
|
|
@@ -48702,6 +48704,19 @@ var init_status_bar = __esm({
|
|
|
48702
48704
|
* Wrap input text into lines of availWidth characters.
|
|
48703
48705
|
* Returns the lines, plus cursor position within the wrapped layout.
|
|
48704
48706
|
*/
|
|
48707
|
+
/**
|
|
48708
|
+
* Insert a reverse-video block cursor at position `pos` in plain text `text`.
|
|
48709
|
+
* If pos is at end of text, renders a reverse-video space (block cursor).
|
|
48710
|
+
* If pos is mid-text, renders the character at pos with reverse video.
|
|
48711
|
+
*/
|
|
48712
|
+
static insertVisualCursor(text, pos) {
|
|
48713
|
+
const REV = "\x1B[7m";
|
|
48714
|
+
const RST = "\x1B[0m";
|
|
48715
|
+
if (pos >= text.length) {
|
|
48716
|
+
return text + REV + " " + RST;
|
|
48717
|
+
}
|
|
48718
|
+
return text.slice(0, pos) + REV + text[pos] + RST + text.slice(pos + 1);
|
|
48719
|
+
}
|
|
48705
48720
|
wrapInput(termWidth) {
|
|
48706
48721
|
const availWidth = Math.max(1, termWidth - this.promptWidth);
|
|
48707
48722
|
const inputState = this.inputStateProvider?.();
|
|
@@ -48709,21 +48724,27 @@ var init_status_bar = __esm({
|
|
|
48709
48724
|
const cursorPos = inputState?.cursor ?? 0;
|
|
48710
48725
|
const ghost = this.getGhostText(fullLine, cursorPos);
|
|
48711
48726
|
if (fullLine.length <= availWidth) {
|
|
48712
|
-
|
|
48727
|
+
let displayLine;
|
|
48728
|
+
if (ghost) {
|
|
48729
|
+
displayLine = fullLine + `\x1B[7m\x1B[38;5;240m${ghost[0]}\x1B[0m\x1B[2m\x1B[38;5;240m${ghost.slice(1)}\x1B[0m`;
|
|
48730
|
+
} else {
|
|
48731
|
+
displayLine = _StatusBar.insertVisualCursor(fullLine, cursorPos);
|
|
48732
|
+
}
|
|
48713
48733
|
return {
|
|
48714
48734
|
lines: [displayLine],
|
|
48715
48735
|
cursorRow: 0,
|
|
48716
48736
|
cursorCol: this.promptWidth + cursorPos + 1
|
|
48717
48737
|
};
|
|
48718
48738
|
}
|
|
48719
|
-
const
|
|
48739
|
+
const rawLines = [];
|
|
48720
48740
|
for (let i = 0; i < fullLine.length; i += availWidth) {
|
|
48721
|
-
|
|
48741
|
+
rawLines.push(fullLine.slice(i, i + availWidth));
|
|
48722
48742
|
}
|
|
48723
|
-
if (
|
|
48724
|
-
|
|
48725
|
-
const cursorLineIdx = Math.min(Math.floor(cursorPos / availWidth),
|
|
48743
|
+
if (rawLines.length === 0)
|
|
48744
|
+
rawLines.push("");
|
|
48745
|
+
const cursorLineIdx = Math.min(Math.floor(cursorPos / availWidth), rawLines.length - 1);
|
|
48726
48746
|
const cursorColInLine = cursorPos - cursorLineIdx * availWidth;
|
|
48747
|
+
const lines = rawLines.map((line, i) => i === cursorLineIdx ? _StatusBar.insertVisualCursor(line, cursorColInLine) : line);
|
|
48727
48748
|
return {
|
|
48728
48749
|
lines,
|
|
48729
48750
|
cursorRow: cursorLineIdx,
|
|
@@ -50594,6 +50615,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
50594
50615
|
modelUsage: stats.modelUsage
|
|
50595
50616
|
});
|
|
50596
50617
|
});
|
|
50618
|
+
reconnectedP2P.on("token_flash", () => statusBar.flashExposeToken());
|
|
50597
50619
|
writeContent(() => {
|
|
50598
50620
|
renderInfo(`Reconnected to existing P2P expose: ${reconnectedP2P.peerId}`);
|
|
50599
50621
|
});
|
|
@@ -51416,6 +51438,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
51416
51438
|
modelUsage: stats.modelUsage
|
|
51417
51439
|
});
|
|
51418
51440
|
});
|
|
51441
|
+
newP2P.on("token_flash", () => statusBar.flashExposeToken());
|
|
51419
51442
|
try {
|
|
51420
51443
|
const peerId = await newP2P.start();
|
|
51421
51444
|
clearInterval(exposeSpinner);
|
package/package.json
CHANGED