open-agents-ai 0.104.21 → 0.104.22
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 +79 -66
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47628,6 +47628,9 @@ var init_status_bar = __esm({
|
|
|
47628
47628
|
_countdown = 0;
|
|
47629
47629
|
_recBlink = true;
|
|
47630
47630
|
_recBlinkTimer = null;
|
|
47631
|
+
/** Alive blinker: green/black dot at 0.5s, always on when status bar active */
|
|
47632
|
+
_aliveBlink = true;
|
|
47633
|
+
_aliveBlinkTimer = null;
|
|
47631
47634
|
/** Whether agent is actively processing (braille animation) */
|
|
47632
47635
|
_processing = false;
|
|
47633
47636
|
_brailleSpinner = new BrailleSpinner();
|
|
@@ -47817,70 +47820,41 @@ var init_status_bar = __esm({
|
|
|
47817
47820
|
}
|
|
47818
47821
|
/** Expose gateway status — shown after capability emojis */
|
|
47819
47822
|
_expose = null;
|
|
47820
|
-
/**
|
|
47821
|
-
|
|
47822
|
-
|
|
47823
|
-
/** Trail timer — keeps blinking briefly after connections drop */
|
|
47824
|
-
_exposeTrailTimer = null;
|
|
47825
|
-
/** Rolling request count for activity-based trail duration */
|
|
47826
|
-
_exposeRecentReqs = 0;
|
|
47827
|
-
_exposeLastReqCount = 0;
|
|
47828
|
-
/** Token-driven flash: OFF timeout after each token triggers ON */
|
|
47823
|
+
/** Token-flash state: true = LED lit (only during active token generation) */
|
|
47824
|
+
_exposeFlashOn = false;
|
|
47825
|
+
/** OFF-timer after each token flash */
|
|
47829
47826
|
_exposeTokenFlashTimer = null;
|
|
47830
|
-
/**
|
|
47827
|
+
/** Current active peer/connection count — drives LED color spectrum */
|
|
47828
|
+
_exposePeerCount = 0;
|
|
47829
|
+
/**
|
|
47830
|
+
* Blue→magenta color spectrum based on peer count.
|
|
47831
|
+
* 256-color ANSI codes: 33(blue) → 69 → 105 → 141 → 177 → 201(magenta)
|
|
47832
|
+
* 1 peer = blue, 5+ peers = magenta, 0 = dim gray (240).
|
|
47833
|
+
*/
|
|
47834
|
+
_exposeLedColor() {
|
|
47835
|
+
const n = this._exposePeerCount;
|
|
47836
|
+
if (n <= 0)
|
|
47837
|
+
return 240;
|
|
47838
|
+
const stops = [33, 69, 105, 141, 177, 201];
|
|
47839
|
+
const idx = Math.min(n - 1, stops.length - 1);
|
|
47840
|
+
return stops[idx];
|
|
47841
|
+
}
|
|
47842
|
+
/** Update expose gateway status — only stores state, no blink timers */
|
|
47831
47843
|
setExposeStatus(status) {
|
|
47832
47844
|
this._expose = status;
|
|
47833
|
-
|
|
47834
|
-
if (newReqs > 0) {
|
|
47835
|
-
this._exposeRecentReqs = Math.min(this._exposeRecentReqs + newReqs, 50);
|
|
47836
|
-
this._exposeLastReqCount = status.totalRequests;
|
|
47837
|
-
}
|
|
47838
|
-
if (status.activeConnections > 0) {
|
|
47839
|
-
if (this._exposeTrailTimer) {
|
|
47840
|
-
clearTimeout(this._exposeTrailTimer);
|
|
47841
|
-
this._exposeTrailTimer = null;
|
|
47842
|
-
}
|
|
47843
|
-
if (!this._exposeBlinkTimer) {
|
|
47844
|
-
this._exposeBlinkTimer = setInterval(() => {
|
|
47845
|
-
this._exposeBlinkOn = !this._exposeBlinkOn;
|
|
47846
|
-
if (this.active)
|
|
47847
|
-
this.renderFooterPreserveCursor();
|
|
47848
|
-
}, 100);
|
|
47849
|
-
}
|
|
47850
|
-
} else if (this._exposeBlinkTimer && !this._exposeTrailTimer) {
|
|
47851
|
-
const trailMs = Math.min(1e3 + this._exposeRecentReqs * 40, 3e3);
|
|
47852
|
-
this._exposeTrailTimer = setTimeout(() => {
|
|
47853
|
-
if (this._exposeBlinkTimer) {
|
|
47854
|
-
clearInterval(this._exposeBlinkTimer);
|
|
47855
|
-
this._exposeBlinkTimer = null;
|
|
47856
|
-
}
|
|
47857
|
-
this._exposeBlinkOn = true;
|
|
47858
|
-
this._exposeTrailTimer = null;
|
|
47859
|
-
this._exposeRecentReqs = Math.max(0, this._exposeRecentReqs - 5);
|
|
47860
|
-
if (this.active)
|
|
47861
|
-
this.renderFooterPreserveCursor();
|
|
47862
|
-
}, trailMs);
|
|
47863
|
-
}
|
|
47845
|
+
this._exposePeerCount = status.activeConnections;
|
|
47864
47846
|
if (this.active)
|
|
47865
47847
|
this.renderFooterPreserveCursor();
|
|
47866
47848
|
}
|
|
47867
47849
|
/** Clear expose gateway status */
|
|
47868
47850
|
clearExposeStatus() {
|
|
47869
47851
|
this._expose = null;
|
|
47870
|
-
if (this._exposeBlinkTimer) {
|
|
47871
|
-
clearInterval(this._exposeBlinkTimer);
|
|
47872
|
-
this._exposeBlinkTimer = null;
|
|
47873
|
-
}
|
|
47874
|
-
if (this._exposeTrailTimer) {
|
|
47875
|
-
clearTimeout(this._exposeTrailTimer);
|
|
47876
|
-
this._exposeTrailTimer = null;
|
|
47877
|
-
}
|
|
47878
47852
|
if (this._exposeTokenFlashTimer) {
|
|
47879
47853
|
clearTimeout(this._exposeTokenFlashTimer);
|
|
47880
47854
|
this._exposeTokenFlashTimer = null;
|
|
47881
47855
|
}
|
|
47882
|
-
this.
|
|
47883
|
-
this.
|
|
47856
|
+
this._exposeFlashOn = false;
|
|
47857
|
+
this._exposePeerCount = 0;
|
|
47884
47858
|
if (this.active)
|
|
47885
47859
|
this.renderFooterPreserveCursor();
|
|
47886
47860
|
}
|
|
@@ -47889,15 +47863,18 @@ var init_status_bar = __esm({
|
|
|
47889
47863
|
* this node is serving tokens to remote clients. Each call turns the LED ON
|
|
47890
47864
|
* for ~50ms then back OFF, creating a 1:1 visual link between generated
|
|
47891
47865
|
* tokens and the LED activity indicator (like a network TX LED on a router).
|
|
47866
|
+
*
|
|
47867
|
+
* LED color: blue (1 peer) → magenta (5+ peers) spectrum.
|
|
47868
|
+
* LED is dark (dim ●) when no tokens are being generated.
|
|
47892
47869
|
*/
|
|
47893
47870
|
flashExposeToken() {
|
|
47894
47871
|
if (!this._expose || this._expose.status !== "active")
|
|
47895
47872
|
return;
|
|
47896
|
-
this.
|
|
47873
|
+
this._exposeFlashOn = true;
|
|
47897
47874
|
if (this._exposeTokenFlashTimer)
|
|
47898
47875
|
clearTimeout(this._exposeTokenFlashTimer);
|
|
47899
47876
|
this._exposeTokenFlashTimer = setTimeout(() => {
|
|
47900
|
-
this.
|
|
47877
|
+
this._exposeFlashOn = false;
|
|
47901
47878
|
this._exposeTokenFlashTimer = null;
|
|
47902
47879
|
if (this.active)
|
|
47903
47880
|
this.renderFooterPreserveCursor();
|
|
@@ -48069,6 +48046,7 @@ var init_status_bar = __esm({
|
|
|
48069
48046
|
}
|
|
48070
48047
|
return null;
|
|
48071
48048
|
};
|
|
48049
|
+
let lastPeerMetricsDebug = "";
|
|
48072
48050
|
const poll = async () => {
|
|
48073
48051
|
pollAttempt++;
|
|
48074
48052
|
try {
|
|
@@ -48079,11 +48057,14 @@ var init_status_bar = __esm({
|
|
|
48079
48057
|
target_peer: peerId,
|
|
48080
48058
|
capability: "system_metrics",
|
|
48081
48059
|
input: queryData
|
|
48082
|
-
},
|
|
48083
|
-
if (typeof raw === "string" && raw.startsWith("Invoke error:"))
|
|
48060
|
+
}, 3e4);
|
|
48061
|
+
if (typeof raw === "string" && raw.startsWith("Invoke error:")) {
|
|
48062
|
+
lastPeerMetricsDebug = `invoke error: ${raw.slice(0, 200)}`;
|
|
48084
48063
|
throw new Error(raw);
|
|
48064
|
+
}
|
|
48085
48065
|
const metricsData = extractMetrics(raw);
|
|
48086
48066
|
if (metricsData?.cpu) {
|
|
48067
|
+
lastPeerMetricsDebug = `ok: cpu=${metricsData.cpu.utilization}%`;
|
|
48087
48068
|
this.setRemoteMetrics({
|
|
48088
48069
|
cpuUtil: metricsData.cpu?.utilization ?? 0,
|
|
48089
48070
|
cpuCores: metricsData.cpu?.cores ?? 0,
|
|
@@ -48099,13 +48080,17 @@ var init_status_bar = __esm({
|
|
|
48099
48080
|
});
|
|
48100
48081
|
return;
|
|
48101
48082
|
}
|
|
48102
|
-
|
|
48083
|
+
lastPeerMetricsDebug = `parse fail: ${typeof raw === "string" ? raw.slice(0, 300) : "non-string"}`;
|
|
48084
|
+
} catch (e) {
|
|
48085
|
+
if (!lastPeerMetricsDebug.startsWith("invoke error:")) {
|
|
48086
|
+
lastPeerMetricsDebug = `exception: ${e instanceof Error ? e.message.slice(0, 200) : String(e).slice(0, 200)}`;
|
|
48087
|
+
}
|
|
48103
48088
|
}
|
|
48104
48089
|
this.setRemoteMetrics({
|
|
48105
48090
|
cpuUtil: -1,
|
|
48106
48091
|
// -1 = unavailable (won't render bar)
|
|
48107
48092
|
gpuUtil: -1,
|
|
48108
|
-
gpuName: "peer
|
|
48093
|
+
gpuName: pollAttempt <= 2 ? "connecting..." : `peer (${lastPeerMetricsDebug.slice(0, 40)})`,
|
|
48109
48094
|
vramUtil: -1,
|
|
48110
48095
|
memUtil: -1
|
|
48111
48096
|
});
|
|
@@ -48183,6 +48168,14 @@ var init_status_bar = __esm({
|
|
|
48183
48168
|
if (!this._metricsCollector.isActive) {
|
|
48184
48169
|
this.startLocalMetrics();
|
|
48185
48170
|
}
|
|
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);
|
|
48186
48179
|
}
|
|
48187
48180
|
/** Deactivate — restore full-screen scroll region */
|
|
48188
48181
|
deactivate() {
|
|
@@ -48192,6 +48185,10 @@ var init_status_bar = __esm({
|
|
|
48192
48185
|
clearTimeout(this._resizeTimer);
|
|
48193
48186
|
this._resizeTimer = null;
|
|
48194
48187
|
}
|
|
48188
|
+
if (this._aliveBlinkTimer) {
|
|
48189
|
+
clearInterval(this._aliveBlinkTimer);
|
|
48190
|
+
this._aliveBlinkTimer = null;
|
|
48191
|
+
}
|
|
48195
48192
|
this.stopAllMetrics();
|
|
48196
48193
|
const rows = process.stdout.rows ?? 24;
|
|
48197
48194
|
process.stdout.write(`\x1B[1;${rows}r`);
|
|
@@ -48382,6 +48379,10 @@ var init_status_bar = __esm({
|
|
|
48382
48379
|
const compactOrder = [];
|
|
48383
48380
|
let modelSectionIdx = -1;
|
|
48384
48381
|
let versionSectionIdx = -1;
|
|
48382
|
+
{
|
|
48383
|
+
const dot = this._aliveBlink ? "\u{1F7E2}" : "\u26AB";
|
|
48384
|
+
sections.push({ expanded: dot, compact: dot, expandedW: 2, compactW: 2, empty: false });
|
|
48385
|
+
}
|
|
48385
48386
|
const tokInRaw = m.promptTokens > 0 ? m.promptTokens : Math.max(m.estimatedContextTokens, 0);
|
|
48386
48387
|
const effectiveOut = this.effectiveCompletionTokens;
|
|
48387
48388
|
const tokOutRaw = effectiveOut > 0 ? effectiveOut : Math.ceil(m.totalTokens > 0 ? m.totalTokens - m.promptTokens : m.estimatedContextTokens * 0.3);
|
|
@@ -48483,7 +48484,8 @@ var init_status_bar = __esm({
|
|
|
48483
48484
|
}
|
|
48484
48485
|
if (this._expose) {
|
|
48485
48486
|
const INTERNAL_CAPS = /* @__PURE__ */ new Set(["system_metrics", "__list_capabilities"]);
|
|
48486
|
-
const
|
|
48487
|
+
const ledColor = this._exposeFlashOn ? this._exposeLedColor() : this._expose.status === "error" ? 196 : this._expose.status === "active" ? 240 : 208;
|
|
48488
|
+
const statusEmoji = `\x1B[38;5;${ledColor}m\u25CF\x1B[0m`;
|
|
48487
48489
|
const models = Array.from(this._expose.modelUsage.keys()).filter((m2) => !INTERNAL_CAPS.has(m2));
|
|
48488
48490
|
const modelParams = models.map((mdl) => {
|
|
48489
48491
|
const pm = mdl.match(/(\d+[bBmM])/);
|
|
@@ -48547,6 +48549,13 @@ var init_status_bar = __esm({
|
|
|
48547
48549
|
hwExpW += 6 + `${rm2.vramUtil}%`.length + vramDetail.length;
|
|
48548
48550
|
hwCompW += 6 + `${rm2.vramUtil}%`.length;
|
|
48549
48551
|
}
|
|
48552
|
+
if (!isLocal && hwExpW === 0) {
|
|
48553
|
+
const statusMsg = rm2.gpuName && rm2.gpuName !== "peer" ? rm2.gpuName : "awaiting metrics...";
|
|
48554
|
+
hwExpStr = c2.dim(statusMsg);
|
|
48555
|
+
hwCompStr = c2.dim(statusMsg.slice(0, 20));
|
|
48556
|
+
hwExpW = statusMsg.length;
|
|
48557
|
+
hwCompW = Math.min(statusMsg.length, 20);
|
|
48558
|
+
}
|
|
48550
48559
|
const net = um.network;
|
|
48551
48560
|
const rxStr = formatRate(net.rxBytesPerSec);
|
|
48552
48561
|
const txStr = formatRate(net.txBytesPerSec);
|
|
@@ -50073,14 +50082,18 @@ async function startInteractive(config, repoPath) {
|
|
|
50073
50082
|
sessionSudoPassword = pw;
|
|
50074
50083
|
resolve32(pw);
|
|
50075
50084
|
};
|
|
50076
|
-
|
|
50077
|
-
|
|
50078
|
-
}
|
|
50079
|
-
|
|
50080
|
-
|
|
50081
|
-
|
|
50082
|
-
|
|
50083
|
-
|
|
50085
|
+
const pwPrompt1 = ` ${c2.bold(c2.yellow("\u{1F511} Password needed for dependency install:"))}
|
|
50086
|
+
`;
|
|
50087
|
+
const pwPrompt2 = ` ${c2.bold(c2.yellow("\u{1F511} Password:"))} `;
|
|
50088
|
+
if (isNeovimActive()) {
|
|
50089
|
+
writeToNeovimOutput(pwPrompt1 + pwPrompt2);
|
|
50090
|
+
} else {
|
|
50091
|
+
if (statusBar?.isActive)
|
|
50092
|
+
statusBar.beginContentWrite();
|
|
50093
|
+
process.stdout.write(pwPrompt1);
|
|
50094
|
+
process.stdout.write(pwPrompt2);
|
|
50095
|
+
if (statusBar?.isActive)
|
|
50096
|
+
statusBar.endContentWrite();
|
|
50084
50097
|
}
|
|
50085
50098
|
})).catch(() => {
|
|
50086
50099
|
});
|
package/package.json
CHANGED