open-agents-ai 0.187.567 → 0.187.568
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 +258 -85
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -552332,6 +552332,8 @@ var init_status_bar = __esm({
|
|
|
552332
552332
|
// disable after 0.5s idle — fast enough for text selection
|
|
552333
552333
|
/** True while the user is actively press-dragging in the content region; freezes auto-scroll so selection sticks. */
|
|
552334
552334
|
_mouseSelecting = false;
|
|
552335
|
+
/** Set when a content-area left-click disables mouse tracking for native terminal selection. Prevents the mouse-activity handler from re-enabling tracking until the next keyboard event. */
|
|
552336
|
+
_nativeSelectionActive = false;
|
|
552335
552337
|
/** Text selection state — tracks click-drag selection for copy */
|
|
552336
552338
|
_textSelection = new TextSelection({
|
|
552337
552339
|
getContentLines: () => this._contentLines,
|
|
@@ -552500,7 +552502,8 @@ var init_status_bar = __esm({
|
|
|
552500
552502
|
summarizeHeaderTransport() {
|
|
552501
552503
|
const backendType = this._headerBackendType;
|
|
552502
552504
|
const backendUrl = this._headerBackendUrl;
|
|
552503
|
-
if (backendType === "nexus" || backendUrl.startsWith("peer://"))
|
|
552505
|
+
if (backendType === "nexus" || backendUrl.startsWith("peer://"))
|
|
552506
|
+
return "p2p";
|
|
552504
552507
|
if (backendType === "fake") return "fake";
|
|
552505
552508
|
if (!backendUrl) return "";
|
|
552506
552509
|
if (backendUrl.includes("127.0.0.1") || backendUrl.includes("localhost") || backendUrl.includes("0.0.0.0")) {
|
|
@@ -552609,11 +552612,17 @@ var init_status_bar = __esm({
|
|
|
552609
552612
|
if (isBranding) {
|
|
552610
552613
|
const BRAND_BG = 178;
|
|
552611
552614
|
const BRAND_FG = 65;
|
|
552612
|
-
return linkify(
|
|
552615
|
+
return linkify(
|
|
552616
|
+
cmd,
|
|
552617
|
+
`\x1B[38;5;${BRAND_FG}m\x1B[48;5;${BRAND_BG}m ${label} \x1B[0m${PANEL_BG_SEQ}`
|
|
552618
|
+
);
|
|
552613
552619
|
} else {
|
|
552614
552620
|
const WHITE_BG = 15;
|
|
552615
552621
|
const BLACK_FG = 0;
|
|
552616
|
-
return linkify(
|
|
552622
|
+
return linkify(
|
|
552623
|
+
cmd,
|
|
552624
|
+
`\x1B[38;5;${BLACK_FG}m\x1B[48;5;${WHITE_BG}m ${label} \x1B[0m${PANEL_BG_SEQ}`
|
|
552625
|
+
);
|
|
552617
552626
|
}
|
|
552618
552627
|
};
|
|
552619
552628
|
const renderBtn = (cmd, label) => {
|
|
@@ -552651,28 +552660,32 @@ var init_status_bar = __esm({
|
|
|
552651
552660
|
for (let pi = 0; pi < menuPages.length; pi++) {
|
|
552652
552661
|
const btns = menuPages[pi];
|
|
552653
552662
|
const isFirstPage = pi === 0;
|
|
552654
|
-
this.registerHeaderPanel(
|
|
552655
|
-
|
|
552656
|
-
|
|
552657
|
-
|
|
552658
|
-
|
|
552659
|
-
|
|
552660
|
-
|
|
552661
|
-
|
|
552662
|
-
|
|
552663
|
-
|
|
552664
|
-
|
|
552665
|
-
|
|
552666
|
-
|
|
552667
|
-
out +=
|
|
552668
|
-
|
|
552669
|
-
|
|
552670
|
-
|
|
552671
|
-
|
|
552672
|
-
|
|
552673
|
-
|
|
552674
|
-
|
|
552675
|
-
|
|
552663
|
+
this.registerHeaderPanel(
|
|
552664
|
+
`main-${pi}`,
|
|
552665
|
+
(innerW) => {
|
|
552666
|
+
const liveIdentity = this.buildHeaderIdentityRender();
|
|
552667
|
+
let out = "";
|
|
552668
|
+
let usedW = 0;
|
|
552669
|
+
if (isFirstPage) {
|
|
552670
|
+
out += liveIdentity.text;
|
|
552671
|
+
usedW += liveIdentity.width;
|
|
552672
|
+
}
|
|
552673
|
+
let btnTotalW = 0;
|
|
552674
|
+
for (const btn of btns) btnTotalW += btn.w + 1;
|
|
552675
|
+
const gap = Math.max(1, innerW - usedW - btnTotalW);
|
|
552676
|
+
out += `${PANEL_BG_SEQ}\x1B[38;5;${TEXT_DIM}m${" ".repeat(gap)}`;
|
|
552677
|
+
for (const btn of btns) {
|
|
552678
|
+
out += decorateMenuButton(btn.cmd, btn.label) + `${PANEL_BG_SEQ} `;
|
|
552679
|
+
}
|
|
552680
|
+
return out;
|
|
552681
|
+
},
|
|
552682
|
+
{
|
|
552683
|
+
kind: "main",
|
|
552684
|
+
buttons: btns,
|
|
552685
|
+
isFirstPage,
|
|
552686
|
+
versionWidth: verW
|
|
552687
|
+
}
|
|
552688
|
+
);
|
|
552676
552689
|
}
|
|
552677
552690
|
const sysItems = [];
|
|
552678
552691
|
const trunc3 = (s2) => {
|
|
@@ -552682,7 +552695,10 @@ var init_status_bar = __esm({
|
|
|
552682
552695
|
if (this._activeViewId !== "main") {
|
|
552683
552696
|
const mainLabel = ` ↩ main `;
|
|
552684
552697
|
const mainColored = `\x1B[38;5;110m${mainLabel}\x1B[0m`;
|
|
552685
|
-
sysItems.push({
|
|
552698
|
+
sysItems.push({
|
|
552699
|
+
render: () => mainColored + " ",
|
|
552700
|
+
w: mainLabel.length + 1
|
|
552701
|
+
});
|
|
552686
552702
|
}
|
|
552687
552703
|
if (this._agentViews.size > 1) {
|
|
552688
552704
|
for (const view of this._agentViews.values()) {
|
|
@@ -552690,19 +552706,34 @@ var init_status_bar = __esm({
|
|
|
552690
552706
|
const icon = view.status === "running" ? "●" : view.status === "completed" ? "✓" : view.status === "failed" ? "✗" : "○";
|
|
552691
552707
|
const base3 = ` ${trunc3(view.label)} ${icon} `;
|
|
552692
552708
|
const colored = view.id === this._activeViewId ? `\x1B[1;38;5;219m${base3}\x1B[0m` : `\x1B[38;5;213m${base3}\x1B[0m`;
|
|
552693
|
-
sysItems.push({
|
|
552709
|
+
sysItems.push({
|
|
552710
|
+
render: () => renderBtn(`view:${view.id}`, colored) + " ",
|
|
552711
|
+
w: base3.length + 1
|
|
552712
|
+
});
|
|
552694
552713
|
}
|
|
552695
552714
|
} else {
|
|
552696
|
-
sysItems.push({
|
|
552715
|
+
sysItems.push({
|
|
552716
|
+
render: () => `\x1B[38;5;${TEXT_DIM}m no sub-agents `,
|
|
552717
|
+
w: 14
|
|
552718
|
+
});
|
|
552697
552719
|
}
|
|
552698
552720
|
const sysSeparatorOffset = sysItems.reduce((sum, item) => sum + item.w, 0);
|
|
552699
552721
|
this._sysSeparatorOffset = sysSeparatorOffset;
|
|
552700
|
-
sysItems.push({
|
|
552722
|
+
sysItems.push({
|
|
552723
|
+
render: () => `${BOX_FG}│${RESET2}${PANEL_BG_SEQ} `,
|
|
552724
|
+
w: 2
|
|
552725
|
+
});
|
|
552701
552726
|
const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
|
|
552702
552727
|
const voiceIcon = this._voiceActive ? "●" : "○";
|
|
552703
|
-
sysItems.push({
|
|
552728
|
+
sysItems.push({
|
|
552729
|
+
render: () => renderBtn("voice", `${voiceIcon}${voiceLabel}`) + " ",
|
|
552730
|
+
w: voiceLabel.length + 2
|
|
552731
|
+
});
|
|
552704
552732
|
const nexusDot = this._nexusStatus === "connected" || this._nexusStatus === "connecting" ? "●" : "○";
|
|
552705
|
-
sysItems.push({
|
|
552733
|
+
sysItems.push({
|
|
552734
|
+
render: () => renderBtn("nexus", `${nexusDot} nexus `) + " ",
|
|
552735
|
+
w: 9
|
|
552736
|
+
});
|
|
552706
552737
|
let sysPages = [];
|
|
552707
552738
|
let sCurPage = [];
|
|
552708
552739
|
let sCurW = 0;
|
|
@@ -552718,13 +552749,20 @@ var init_status_bar = __esm({
|
|
|
552718
552749
|
if (sCurPage.length > 0) sysPages.push(sCurPage);
|
|
552719
552750
|
for (let pi = 0; pi < sysPages.length; pi++) {
|
|
552720
552751
|
const items = sysPages[pi];
|
|
552721
|
-
this.registerHeaderPanel(
|
|
552722
|
-
|
|
552723
|
-
|
|
552724
|
-
|
|
552725
|
-
|
|
552752
|
+
this.registerHeaderPanel(
|
|
552753
|
+
`sys-${pi}`,
|
|
552754
|
+
(_innerW) => {
|
|
552755
|
+
let out = "";
|
|
552756
|
+
for (const item of items) out += item.render();
|
|
552757
|
+
return out;
|
|
552758
|
+
},
|
|
552759
|
+
{ kind: "system", isFirstPage: pi === 0 }
|
|
552760
|
+
);
|
|
552726
552761
|
}
|
|
552727
|
-
this._headerPanelIndex = Math.min(
|
|
552762
|
+
this._headerPanelIndex = Math.min(
|
|
552763
|
+
savedIdx,
|
|
552764
|
+
Math.max(0, this._headerPanels.length - 1)
|
|
552765
|
+
);
|
|
552728
552766
|
}
|
|
552729
552767
|
/** Switch to the next header panel (wraps around) */
|
|
552730
552768
|
nextHeaderPanel() {
|
|
@@ -552777,7 +552815,9 @@ var init_status_bar = __esm({
|
|
|
552777
552815
|
const chrome = this.getHeaderChromeLayout(termWidth);
|
|
552778
552816
|
if (chrome.showPrev && col === 2) return "header-prev";
|
|
552779
552817
|
if (chrome.showNext && col === termWidth - 1) return "header-next";
|
|
552780
|
-
const hit = this._headerCommandZones.find(
|
|
552818
|
+
const hit = this._headerCommandZones.find(
|
|
552819
|
+
(zone) => col >= zone.start && col <= zone.end
|
|
552820
|
+
);
|
|
552781
552821
|
return hit?.cmd ?? null;
|
|
552782
552822
|
}
|
|
552783
552823
|
/** Render the current header panel content onto terminal row 2 (inside box) */
|
|
@@ -553039,7 +553079,11 @@ var init_status_bar = __esm({
|
|
|
553039
553079
|
_modelName = "";
|
|
553040
553080
|
/** Update active model name shown in the status bar */
|
|
553041
553081
|
setModelName(name10) {
|
|
553042
|
-
this.setHeaderIdentity(
|
|
553082
|
+
this.setHeaderIdentity(
|
|
553083
|
+
name10,
|
|
553084
|
+
this._headerBackendType,
|
|
553085
|
+
this._headerBackendUrl
|
|
553086
|
+
);
|
|
553043
553087
|
}
|
|
553044
553088
|
/** Model capabilities — shown as emoji indicators on the status bar */
|
|
553045
553089
|
_caps = {
|
|
@@ -553181,7 +553225,10 @@ var init_status_bar = __esm({
|
|
|
553181
553225
|
const url = new URL("/v1/system/metrics", endpointUrl);
|
|
553182
553226
|
const headers = {};
|
|
553183
553227
|
if (authKey) headers["Authorization"] = `Bearer ${authKey}`;
|
|
553184
|
-
const resp = await fetch(url.toString(), {
|
|
553228
|
+
const resp = await fetch(url.toString(), {
|
|
553229
|
+
headers,
|
|
553230
|
+
signal: AbortSignal.timeout(5e3)
|
|
553231
|
+
});
|
|
553185
553232
|
if (resp.ok) {
|
|
553186
553233
|
const data = await resp.json();
|
|
553187
553234
|
this.setRemoteMetrics({
|
|
@@ -553320,12 +553367,18 @@ var init_status_bar = __esm({
|
|
|
553320
553367
|
}
|
|
553321
553368
|
/** Update token metrics from a token_usage event */
|
|
553322
553369
|
updateMetrics(update2) {
|
|
553323
|
-
if (update2.promptTokens !== void 0)
|
|
553324
|
-
|
|
553325
|
-
if (update2.
|
|
553326
|
-
|
|
553327
|
-
if (update2.
|
|
553328
|
-
|
|
553370
|
+
if (update2.promptTokens !== void 0)
|
|
553371
|
+
this.metrics.promptTokens = update2.promptTokens;
|
|
553372
|
+
if (update2.completionTokens !== void 0)
|
|
553373
|
+
this.metrics.completionTokens = update2.completionTokens;
|
|
553374
|
+
if (update2.totalTokens !== void 0)
|
|
553375
|
+
this.metrics.totalTokens = update2.totalTokens;
|
|
553376
|
+
if (update2.estimatedContextTokens !== void 0)
|
|
553377
|
+
this.metrics.estimatedContextTokens = update2.estimatedContextTokens;
|
|
553378
|
+
if (update2.lastPromptTokens !== void 0)
|
|
553379
|
+
this.metrics.lastPromptTokens = update2.lastPromptTokens;
|
|
553380
|
+
if (update2.lastCompletionTokens !== void 0)
|
|
553381
|
+
this.metrics.lastCompletionTokens = update2.lastCompletionTokens;
|
|
553329
553382
|
this._streamingTokens = 0;
|
|
553330
553383
|
this._streamStartTime = 0;
|
|
553331
553384
|
this.pushSpinnerContextMetrics();
|
|
@@ -553484,7 +553537,10 @@ var init_status_bar = __esm({
|
|
|
553484
553537
|
const netRx = m2.network.rxBytesPerSec;
|
|
553485
553538
|
const netTx = m2.network.txBytesPerSec;
|
|
553486
553539
|
const gpuNorm = gpu >= 0 ? gpu / 100 : 0;
|
|
553487
|
-
const intensity = Math.min(
|
|
553540
|
+
const intensity = Math.min(
|
|
553541
|
+
1,
|
|
553542
|
+
cpu / 100 * 0.3 + gpuNorm * 0.3 + mem / 100 * 0.2 + Math.min(1, (netRx + netTx) / 5e7) * 0.2
|
|
553543
|
+
);
|
|
553488
553544
|
const baseDensity = Math.floor(intensity * 6);
|
|
553489
553545
|
const range = 4;
|
|
553490
553546
|
const phase = this._focusFrame * 0.15 + cpu / 50 * Math.sin(this._focusFrame * 0.05);
|
|
@@ -553545,7 +553601,8 @@ var init_status_bar = __esm({
|
|
|
553545
553601
|
/** Handle mouse click on a suggestion row */
|
|
553546
553602
|
suggestClickAt(row) {
|
|
553547
553603
|
const pos = this.rowPositions(termRows());
|
|
553548
|
-
if (pos.suggestStartRow <= 0 || this._suggestions.length === 0)
|
|
553604
|
+
if (pos.suggestStartRow <= 0 || this._suggestions.length === 0)
|
|
553605
|
+
return false;
|
|
553549
553606
|
const idx = row - pos.suggestStartRow;
|
|
553550
553607
|
if (idx >= 0 && idx < this._suggestions.length) {
|
|
553551
553608
|
this._suggestIndex = idx;
|
|
@@ -553655,6 +553712,7 @@ var init_status_bar = __esm({
|
|
|
553655
553712
|
/** Enable mouse tracking — respects neovim focus state */
|
|
553656
553713
|
enableMouseTracking() {
|
|
553657
553714
|
if (this._mouseTrackingEnabled || isOverlayActive()) return;
|
|
553715
|
+
if (this._nativeSelectionActive) return;
|
|
553658
553716
|
if (this._isNeovimFocused?.()) return;
|
|
553659
553717
|
this._mouseTrackingEnabled = true;
|
|
553660
553718
|
if (process.stdout.isTTY) {
|
|
@@ -553669,6 +553727,13 @@ var init_status_bar = __esm({
|
|
|
553669
553727
|
this._trueStdoutWrite.call(process.stdout, "\x1B[?1000l\x1B[?1006l");
|
|
553670
553728
|
}
|
|
553671
553729
|
}
|
|
553730
|
+
/** Clear native selection flag and re-enable mouse tracking.
|
|
553731
|
+
* Called from the keyboard-activity handler when the user types after
|
|
553732
|
+
* performing native terminal text selection in the content area. */
|
|
553733
|
+
resumeMouseTracking() {
|
|
553734
|
+
this._nativeSelectionActive = false;
|
|
553735
|
+
this.enableMouseTracking();
|
|
553736
|
+
}
|
|
553672
553737
|
/** Schedule mouse tracking disable after idle timeout.
|
|
553673
553738
|
* Called after each content write or stream end. Cancelled by scroll/stream start.
|
|
553674
553739
|
*
|
|
@@ -553720,9 +553785,11 @@ var init_status_bar = __esm({
|
|
|
553720
553785
|
this.switchToView(hit.id);
|
|
553721
553786
|
if (hit.id !== "main") {
|
|
553722
553787
|
this.beginContentWrite();
|
|
553723
|
-
process.stdout.write(
|
|
553788
|
+
process.stdout.write(
|
|
553789
|
+
`
|
|
553724
553790
|
\x1B[38;5;245mpress Esc to return to primary interface\x1B[0m
|
|
553725
|
-
`
|
|
553791
|
+
`
|
|
553792
|
+
);
|
|
553726
553793
|
this.endContentWrite();
|
|
553727
553794
|
}
|
|
553728
553795
|
return;
|
|
@@ -553782,6 +553849,12 @@ var init_status_bar = __esm({
|
|
|
553782
553849
|
if (type === "press") {
|
|
553783
553850
|
this._mouseSelecting = true;
|
|
553784
553851
|
this._autoScroll = false;
|
|
553852
|
+
this._nativeSelectionActive = true;
|
|
553853
|
+
queueMicrotask(() => {
|
|
553854
|
+
if (this._nativeSelectionActive) {
|
|
553855
|
+
this.disableMouseTracking();
|
|
553856
|
+
}
|
|
553857
|
+
});
|
|
553785
553858
|
return;
|
|
553786
553859
|
}
|
|
553787
553860
|
if (type === "release") {
|
|
@@ -553799,13 +553872,20 @@ var init_status_bar = __esm({
|
|
|
553799
553872
|
const pos = this.rowPositions(termRows());
|
|
553800
553873
|
const writer = this._origWrite ?? process.stdout.write.bind(process.stdout);
|
|
553801
553874
|
if (ok2) {
|
|
553802
|
-
writer(
|
|
553875
|
+
writer(
|
|
553876
|
+
`\x1B[${pos.metricsRow};1H\x1B[2K\x1B[38;5;${TEXT_PRIMARY}m ✓ Copied to clipboard\x1B[0m`
|
|
553877
|
+
);
|
|
553803
553878
|
} else {
|
|
553804
|
-
writer(
|
|
553879
|
+
writer(
|
|
553880
|
+
`\x1B[${pos.metricsRow};1H\x1B[2K\x1B[38;5;214m ⚠ Copy failed — install xclip: sudo apt install xclip\x1B[0m`
|
|
553881
|
+
);
|
|
553805
553882
|
}
|
|
553806
|
-
setTimeout(
|
|
553807
|
-
|
|
553808
|
-
|
|
553883
|
+
setTimeout(
|
|
553884
|
+
() => {
|
|
553885
|
+
if (this.active) this.renderFooterAndPositionInput();
|
|
553886
|
+
},
|
|
553887
|
+
ok2 ? 1200 : 3e3
|
|
553888
|
+
);
|
|
553809
553889
|
return ok2;
|
|
553810
553890
|
}
|
|
553811
553891
|
/** Arm block (rectangular) selection mode — next click starts block select */
|
|
@@ -553813,7 +553893,9 @@ var init_status_bar = __esm({
|
|
|
553813
553893
|
this._textSelection.armBlockMode();
|
|
553814
553894
|
const pos = this.rowPositions(termRows());
|
|
553815
553895
|
const writer = this._origWrite ?? process.stdout.write.bind(process.stdout);
|
|
553816
|
-
writer(
|
|
553896
|
+
writer(
|
|
553897
|
+
`\x1B[${pos.metricsRow};1H\x1B[2K\x1B[38;5;${TEXT_PRIMARY}m ■ Block selection mode — click and drag\x1B[0m`
|
|
553898
|
+
);
|
|
553817
553899
|
setTimeout(() => {
|
|
553818
553900
|
if (this.active) this.renderFooterAndPositionInput();
|
|
553819
553901
|
}, 1500);
|
|
@@ -553855,7 +553937,8 @@ var init_status_bar = __esm({
|
|
|
553855
553937
|
const view = this._agentViews.get(id);
|
|
553856
553938
|
if (!view) return;
|
|
553857
553939
|
view.status = status;
|
|
553858
|
-
if (status === "completed" || status === "failed")
|
|
553940
|
+
if (status === "completed" || status === "failed")
|
|
553941
|
+
view.completedAt = Date.now();
|
|
553859
553942
|
if (this.active) this.renderAgentTabs();
|
|
553860
553943
|
}
|
|
553861
553944
|
/** Switch which agent's content buffer is displayed */
|
|
@@ -553878,10 +553961,15 @@ var init_status_bar = __esm({
|
|
|
553878
553961
|
if (!view) return;
|
|
553879
553962
|
const lines = text.split("\n");
|
|
553880
553963
|
const color = view.colorCode ?? 213;
|
|
553881
|
-
const colored = lines.map(
|
|
553964
|
+
const colored = lines.map(
|
|
553965
|
+
(l2) => l2.length ? `\x1B[38;5;${color}m${l2}\x1B[0m` : l2
|
|
553966
|
+
);
|
|
553882
553967
|
view.contentLines.push(...colored);
|
|
553883
553968
|
if (view.contentLines.length > this._contentMaxLines) {
|
|
553884
|
-
view.contentLines.splice(
|
|
553969
|
+
view.contentLines.splice(
|
|
553970
|
+
0,
|
|
553971
|
+
view.contentLines.length - this._contentMaxLines
|
|
553972
|
+
);
|
|
553885
553973
|
}
|
|
553886
553974
|
if (this._activeViewId === id && this.active && this.writeDepth === 0) {
|
|
553887
553975
|
this.repaintContent();
|
|
@@ -553907,7 +553995,16 @@ var init_status_bar = __esm({
|
|
|
553907
553995
|
}
|
|
553908
553996
|
// Distinct color assignment per sub-agent for consistent labeling
|
|
553909
553997
|
_agentColorIndex = 0;
|
|
553910
|
-
_agentColorPalette = [
|
|
553998
|
+
_agentColorPalette = [
|
|
553999
|
+
213,
|
|
554000
|
+
183,
|
|
554001
|
+
147,
|
|
554002
|
+
219,
|
|
554003
|
+
141,
|
|
554004
|
+
177,
|
|
554005
|
+
111,
|
|
554006
|
+
186
|
|
554007
|
+
];
|
|
553911
554008
|
nextAgentColor() {
|
|
553912
554009
|
const code8 = this._agentColorPalette[this._agentColorIndex % this._agentColorPalette.length];
|
|
553913
554010
|
this._agentColorIndex++;
|
|
@@ -554170,7 +554267,10 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554170
554267
|
}
|
|
554171
554268
|
this.termWrite("\x1B[?2026h");
|
|
554172
554269
|
this._trueStdoutWrite.call(process.stdout, `\x1B[?25l${CONTENT_BG_SEQ}`);
|
|
554173
|
-
this._trueStdoutWrite.call(
|
|
554270
|
+
this._trueStdoutWrite.call(
|
|
554271
|
+
process.stdout,
|
|
554272
|
+
`\x1B[${this.scrollRegionTop};${scrollEnd}r`
|
|
554273
|
+
);
|
|
554174
554274
|
this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
|
|
554175
554275
|
this.renderFooterAndPositionInput();
|
|
554176
554276
|
this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
|
|
@@ -554190,7 +554290,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554190
554290
|
if (this.writeDepth === 0) {
|
|
554191
554291
|
this.clearStreamingRepaintTimer();
|
|
554192
554292
|
if (this._inProgressLine.length > 0) {
|
|
554193
|
-
const sanitized = this.sanitizeBufferedContentLine(
|
|
554293
|
+
const sanitized = this.sanitizeBufferedContentLine(
|
|
554294
|
+
this._inProgressLine
|
|
554295
|
+
);
|
|
554194
554296
|
const visible = stripAnsi(sanitized);
|
|
554195
554297
|
if (visible.length > 0) this.bufferContentLine(sanitized);
|
|
554196
554298
|
this._inProgressLine = "";
|
|
@@ -554253,7 +554355,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554253
554355
|
scheduleStreamingRepaint() {
|
|
554254
554356
|
if (!this.active || this.writeDepth === 0) return;
|
|
554255
554357
|
if (this._contentScrollOffset > 0 || this._mouseSelecting) return;
|
|
554256
|
-
if (this._streamingRepaintTimer || isOverlayActive() || this._suspendContentLayer)
|
|
554358
|
+
if (this._streamingRepaintTimer || isOverlayActive() || this._suspendContentLayer)
|
|
554359
|
+
return;
|
|
554257
554360
|
this._streamingRepaintTimer = setTimeout(() => {
|
|
554258
554361
|
this._streamingRepaintTimer = null;
|
|
554259
554362
|
if (!this.active || this.writeDepth === 0) return;
|
|
@@ -554281,7 +554384,10 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554281
554384
|
this._lastBufferedAt = now;
|
|
554282
554385
|
this._contentLines.push(sanitized);
|
|
554283
554386
|
if (this._contentLines.length > this._contentMaxLines) {
|
|
554284
|
-
this._contentLines.splice(
|
|
554387
|
+
this._contentLines.splice(
|
|
554388
|
+
0,
|
|
554389
|
+
this._contentLines.length - this._contentMaxLines
|
|
554390
|
+
);
|
|
554285
554391
|
if (this._contentScrollOffset > 0) {
|
|
554286
554392
|
this._contentScrollOffset = Math.min(
|
|
554287
554393
|
this._contentScrollOffset,
|
|
@@ -554289,11 +554395,15 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554289
554395
|
);
|
|
554290
554396
|
}
|
|
554291
554397
|
}
|
|
554292
|
-
if (this._autoScroll && !this._mouseSelecting)
|
|
554398
|
+
if (this._autoScroll && !this._mouseSelecting)
|
|
554399
|
+
this._contentScrollOffset = 0;
|
|
554293
554400
|
}
|
|
554294
554401
|
/** Keep SGR styling, drop replay-unsafe terminal control sequences from scrollback storage. */
|
|
554295
554402
|
sanitizeBufferedContentLine(line) {
|
|
554296
|
-
return line.replace(/\r/g, "").replace(/\x1B\][^\x07]*(?:\x07|\x1B\\)/g, "").replace(
|
|
554403
|
+
return line.replace(/\r/g, "").replace(/\x1B\][^\x07]*(?:\x07|\x1B\\)/g, "").replace(
|
|
554404
|
+
/\x1B\[[0-?]*[ -/]*[@-~]/g,
|
|
554405
|
+
(seq) => seq.endsWith("m") ? seq : ""
|
|
554406
|
+
);
|
|
554297
554407
|
}
|
|
554298
554408
|
/**
|
|
554299
554409
|
* Remove the last N lines from the content scrollback buffer and repaint.
|
|
@@ -554324,8 +554434,14 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554324
554434
|
this.cancelMouseIdle();
|
|
554325
554435
|
this.enableMouseTracking();
|
|
554326
554436
|
this._autoScroll = false;
|
|
554327
|
-
const maxOffset = Math.max(
|
|
554328
|
-
|
|
554437
|
+
const maxOffset = Math.max(
|
|
554438
|
+
0,
|
|
554439
|
+
this._contentLines.length - this.contentHeight
|
|
554440
|
+
);
|
|
554441
|
+
this._contentScrollOffset = Math.min(
|
|
554442
|
+
maxOffset,
|
|
554443
|
+
this._contentScrollOffset + lines
|
|
554444
|
+
);
|
|
554329
554445
|
this._syncPagerScope();
|
|
554330
554446
|
this.repaintContent();
|
|
554331
554447
|
this.scheduleMouseIdle();
|
|
@@ -554409,7 +554525,11 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554409
554525
|
const label = " ↓ scroll to bottom ";
|
|
554410
554526
|
const startCol = 3;
|
|
554411
554527
|
buf += `\x1B[${spacerRow};${startCol}H\x1B[48;5;236m\x1B[38;5;229m${label}\x1B[0m${CONTENT_BG_SEQ}`;
|
|
554412
|
-
this._scrollBtnRegion = {
|
|
554528
|
+
this._scrollBtnRegion = {
|
|
554529
|
+
row: spacerRow,
|
|
554530
|
+
start: startCol,
|
|
554531
|
+
end: startCol + label.length - 1
|
|
554532
|
+
};
|
|
554413
554533
|
} else {
|
|
554414
554534
|
this._scrollBtnRegion = null;
|
|
554415
554535
|
}
|
|
@@ -554433,7 +554553,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554433
554553
|
positionAtInput() {
|
|
554434
554554
|
if (!this.active) return;
|
|
554435
554555
|
const L = layout();
|
|
554436
|
-
this.termWrite(
|
|
554556
|
+
this.termWrite(
|
|
554557
|
+
`\x1B[${L.footerInput};${this.promptWidth + 2}H${CURSOR_BLINK_BLOCK}\x1B[?25h`
|
|
554558
|
+
);
|
|
554437
554559
|
}
|
|
554438
554560
|
/** Strip ANSI escape codes to measure visible character width */
|
|
554439
554561
|
static visWidth(s2) {
|
|
@@ -554467,17 +554589,31 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554467
554589
|
let versionSectionIdx = -1;
|
|
554468
554590
|
if (this._cohereActive) {
|
|
554469
554591
|
const cohereExpanded = "\x1B[38;5;214m🌐\x1B[0m";
|
|
554470
|
-
sections.push({
|
|
554592
|
+
sections.push({
|
|
554593
|
+
expanded: cohereExpanded,
|
|
554594
|
+
compact: cohereExpanded,
|
|
554595
|
+
expandedW: 2,
|
|
554596
|
+
compactW: 2,
|
|
554597
|
+
empty: false
|
|
554598
|
+
});
|
|
554471
554599
|
}
|
|
554472
554600
|
const tokInRaw = m2.promptTokens > 0 ? m2.promptTokens : Math.max(m2.estimatedContextTokens, 0);
|
|
554473
554601
|
const effectiveOut = this.effectiveCompletionTokens;
|
|
554474
|
-
const tokOutRaw = effectiveOut > 0 ? effectiveOut : Math.ceil(
|
|
554602
|
+
const tokOutRaw = effectiveOut > 0 ? effectiveOut : Math.ceil(
|
|
554603
|
+
m2.totalTokens > 0 ? m2.totalTokens - m2.promptTokens : m2.estimatedContextTokens * 0.3
|
|
554604
|
+
);
|
|
554475
554605
|
const tokOutVal = Math.max(0, tokOutRaw);
|
|
554476
554606
|
const tokExpanded = pastel2(117, "↑") + c3.bold(tokInRaw.toLocaleString()) + " " + pastel2(151, "↓") + c3.bold(tokOutVal.toLocaleString());
|
|
554477
554607
|
const tokCompact = pastel2(117, "↑") + c3.bold(_StatusBar.compactNum(tokInRaw)) + " " + pastel2(151, "↓") + c3.bold(_StatusBar.compactNum(tokOutVal));
|
|
554478
554608
|
const tokExpW = 1 + tokInRaw.toLocaleString().length + 1 + 1 + tokOutVal.toLocaleString().length;
|
|
554479
554609
|
const tokCompW = 1 + _StatusBar.compactNum(tokInRaw).length + 1 + 1 + _StatusBar.compactNum(tokOutVal).length;
|
|
554480
|
-
sections.push({
|
|
554610
|
+
sections.push({
|
|
554611
|
+
expanded: tokExpanded,
|
|
554612
|
+
compact: tokCompact,
|
|
554613
|
+
expandedW: tokExpW,
|
|
554614
|
+
compactW: tokCompW,
|
|
554615
|
+
empty: false
|
|
554616
|
+
});
|
|
554481
554617
|
{
|
|
554482
554618
|
const ctxUsed = m2.estimatedContextTokens;
|
|
554483
554619
|
const ctxTotal = m2.contextWindowSize;
|
|
@@ -554486,7 +554622,10 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554486
554622
|
let ctxCompSuffix = "";
|
|
554487
554623
|
let ctxCompSuffixW = 0;
|
|
554488
554624
|
if (ctxTotal > 0) {
|
|
554489
|
-
const ctxPct = Math.max(
|
|
554625
|
+
const ctxPct = Math.max(
|
|
554626
|
+
0,
|
|
554627
|
+
Math.min(100, Math.round((1 - ctxUsed / ctxTotal) * 100))
|
|
554628
|
+
);
|
|
554490
554629
|
const ctxColor = ctxPct > 50 ? c3.green : ctxPct > 20 ? c3.yellow : c3.red;
|
|
554491
554630
|
const ctxSizeStr = _StatusBar.compactNum(ctxTotal);
|
|
554492
554631
|
ctxSuffix = " " + ctxColor(`${ctxPct}%`) + c3.dim(` ${ctxSizeStr}`);
|
|
@@ -554530,9 +554669,21 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554530
554669
|
} else if (capParts.length > 0) {
|
|
554531
554670
|
const capsOnly = pastel2(183, capParts.join(" ")) + ctxCompSuffix;
|
|
554532
554671
|
const capsOnlyW = capParts.length * 2 + (capParts.length - 1) + ctxCompSuffixW;
|
|
554533
|
-
sections.push({
|
|
554672
|
+
sections.push({
|
|
554673
|
+
expanded: capsOnly,
|
|
554674
|
+
compact: capsOnly,
|
|
554675
|
+
expandedW: capsOnlyW,
|
|
554676
|
+
compactW: capsOnlyW,
|
|
554677
|
+
empty: false
|
|
554678
|
+
});
|
|
554534
554679
|
} else if (ctxTotal > 0) {
|
|
554535
|
-
sections.push({
|
|
554680
|
+
sections.push({
|
|
554681
|
+
expanded: ctxSuffix.trimStart(),
|
|
554682
|
+
compact: ctxCompSuffix.trimStart(),
|
|
554683
|
+
expandedW: ctxSuffixW - 1,
|
|
554684
|
+
compactW: ctxCompSuffixW - 1,
|
|
554685
|
+
empty: false
|
|
554686
|
+
});
|
|
554536
554687
|
}
|
|
554537
554688
|
}
|
|
554538
554689
|
if (this._snr) {
|
|
@@ -554543,7 +554694,13 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554543
554694
|
const snrExpanded = pastel2(183, "SNR ") + snrColor(c3.bold(`${snrPct}%`)) + c3.dim(` d'${dPrimeStr}`) + capStr;
|
|
554544
554695
|
const snrCompact = snrColor(`${snrPct}%`);
|
|
554545
554696
|
const expW = 4 + `${snrPct}%`.length + 3 + dPrimeStr.length + (this._snr.capacityWarning ? 5 : 0);
|
|
554546
|
-
sections.push({
|
|
554697
|
+
sections.push({
|
|
554698
|
+
expanded: snrExpanded,
|
|
554699
|
+
compact: snrCompact,
|
|
554700
|
+
expandedW: expW,
|
|
554701
|
+
compactW: `${snrPct}%`.length,
|
|
554702
|
+
empty: false
|
|
554703
|
+
});
|
|
554547
554704
|
}
|
|
554548
554705
|
if (this._emotion) {
|
|
554549
554706
|
const emotionExpanded = this._emotion.emoji + " " + pastel2(183, this._emotion.label);
|
|
@@ -554587,7 +554744,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554587
554744
|
const INTERNAL_CAPS = /* @__PURE__ */ new Set(["system_metrics", "__list_capabilities"]);
|
|
554588
554745
|
const ledColor = this._exposeFlashOn ? this._exposeLedColor() : this._expose.status === "error" ? 196 : this._expose.status === "active" ? 240 : 208;
|
|
554589
554746
|
const statusEmoji = `\x1B[38;5;${ledColor}m●\x1B[0m`;
|
|
554590
|
-
const models = Array.from(this._expose.modelUsage.keys()).filter(
|
|
554747
|
+
const models = Array.from(this._expose.modelUsage.keys()).filter(
|
|
554748
|
+
(m3) => !INTERNAL_CAPS.has(m3)
|
|
554749
|
+
);
|
|
554591
554750
|
const modelParams = models.map((mdl) => {
|
|
554592
554751
|
const pm = mdl.match(/(\d+[bBmM])/);
|
|
554593
554752
|
return pm ? pm[1] : mdl.split(":")[0]?.split("/").pop() ?? mdl;
|
|
@@ -554678,7 +554837,13 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554678
554837
|
const countdown = this._countdown > 0 ? c3.dim(` ${this._countdown}s`) : "";
|
|
554679
554838
|
const recStr = dot + pastel2(210, " REC") + countdown;
|
|
554680
554839
|
const recW = 1 + 4 + (this._countdown > 0 ? 1 + `${this._countdown}s`.length : 0);
|
|
554681
|
-
sections.push({
|
|
554840
|
+
sections.push({
|
|
554841
|
+
expanded: recStr,
|
|
554842
|
+
compact: recStr,
|
|
554843
|
+
expandedW: recW,
|
|
554844
|
+
compactW: recW,
|
|
554845
|
+
empty: false
|
|
554846
|
+
});
|
|
554682
554847
|
}
|
|
554683
554848
|
const activeIndices = sections.map((s2, i2) => !s2.empty ? i2 : -1).filter((i2) => i2 >= 0);
|
|
554684
554849
|
const isCompact = new Array(sections.length).fill(false);
|
|
@@ -554761,7 +554926,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554761
554926
|
if (remaining.length <= availWidth) break;
|
|
554762
554927
|
let breakAt = availWidth;
|
|
554763
554928
|
const lastSpace = remaining.lastIndexOf(" ", availWidth);
|
|
554764
|
-
if (lastSpace > 0 && lastSpace >= availWidth * 0.3)
|
|
554929
|
+
if (lastSpace > 0 && lastSpace >= availWidth * 0.3)
|
|
554930
|
+
breakAt = lastSpace + 1;
|
|
554765
554931
|
remaining = remaining.slice(breakAt);
|
|
554766
554932
|
}
|
|
554767
554933
|
return Math.max(1, count);
|
|
@@ -554908,7 +555074,9 @@ ${CONTENT_BG_SEQ}`);
|
|
|
554908
555074
|
const cursorRow = pos.inputStartRow + 1 + inputWrap.cursorRow;
|
|
554909
555075
|
const cursorCol = inputWrap.cursorCol;
|
|
554910
555076
|
if (process.env.OA_DEBUG_CURSOR === "1") {
|
|
554911
|
-
console.error(
|
|
555077
|
+
console.error(
|
|
555078
|
+
`[CURSOR DEBUG] parkCursorInInput: row=${cursorRow}, col=${cursorCol}, inputStartRow=${pos.inputStartRow}, cursorRow=${inputWrap.cursorRow}, writeDepth=${this.writeDepth}`
|
|
555079
|
+
);
|
|
554912
555080
|
}
|
|
554913
555081
|
this.termWrite(`\x1B[${cursorRow};${cursorCol}H\x1B[?25h`);
|
|
554914
555082
|
}
|
|
@@ -555053,7 +555221,10 @@ ${CONTENT_BG_SEQ}`);
|
|
|
555053
555221
|
const heightDelta = this._currentFooterHeight - oldFooterHeight;
|
|
555054
555222
|
let buf = "\x1B7";
|
|
555055
555223
|
if (heightDelta > 0) {
|
|
555056
|
-
const oldScrollEnd = Math.max(
|
|
555224
|
+
const oldScrollEnd = Math.max(
|
|
555225
|
+
rows - oldFooterHeight,
|
|
555226
|
+
this.scrollRegionTop + 1
|
|
555227
|
+
);
|
|
555057
555228
|
buf += `\x1B[${oldScrollEnd};1H`;
|
|
555058
555229
|
for (let i2 = 0; i2 < heightDelta; i2++) buf += "\n";
|
|
555059
555230
|
buf += `\x1B[${this.scrollRegionTop};${pos.scrollEnd}r`;
|
|
@@ -588015,8 +588186,10 @@ var init_mouse_filter = __esm({
|
|
|
588015
588186
|
const col = parseInt(mouseMatch[2]);
|
|
588016
588187
|
const row = parseInt(mouseMatch[3]);
|
|
588017
588188
|
const suffix = mouseMatch[4];
|
|
588018
|
-
if ((btn === 64 || btn === 96) && this.onScroll)
|
|
588019
|
-
|
|
588189
|
+
if ((btn === 64 || btn === 96) && this.onScroll)
|
|
588190
|
+
this.onScroll("up", 3, row);
|
|
588191
|
+
else if ((btn === 65 || btn === 97) && this.onScroll)
|
|
588192
|
+
this.onScroll("down", 3, row);
|
|
588020
588193
|
else if (this.onPointer) {
|
|
588021
588194
|
const hasShift = (btn & 4) !== 0 && btn < 32;
|
|
588022
588195
|
if (btn === 2) {
|
|
@@ -615165,7 +615338,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
615165
615338
|
statusBar.handlePointerEvent(type, col, row);
|
|
615166
615339
|
},
|
|
615167
615340
|
() => {
|
|
615168
|
-
statusBar.
|
|
615341
|
+
statusBar.resumeMouseTracking();
|
|
615169
615342
|
}
|
|
615170
615343
|
);
|
|
615171
615344
|
process.stdin.pipe(mouseFilter);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-agents-ai",
|
|
3
|
-
"version": "0.187.
|
|
3
|
+
"version": "0.187.568",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "open-agents-ai",
|
|
9
|
-
"version": "0.187.
|
|
9
|
+
"version": "0.187.568",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "CC-BY-NC-4.0",
|
|
12
12
|
"dependencies": {
|
package/package.json
CHANGED