open-agents-ai 0.187.89 → 0.187.91
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 +110 -62
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -278632,6 +278632,111 @@ var init_status_bar = __esm({
|
|
|
278632
278632
|
this._headerPanels.push({ id, render });
|
|
278633
278633
|
return this._headerPanels.length - 1;
|
|
278634
278634
|
}
|
|
278635
|
+
/** Rebuild all header panels. Two categories are kept separate:
|
|
278636
|
+
* - Category A: Version + menu buttons (help/voice/model/cohere)
|
|
278637
|
+
* - Category B: Systems (agents/voice status/nexus status)
|
|
278638
|
+
* Each category paginates independently across N pages. */
|
|
278639
|
+
_rebuildHeaderPanels() {
|
|
278640
|
+
this._headerPanels = [];
|
|
278641
|
+
const savedIdx = this._headerPanelIndex;
|
|
278642
|
+
const availW = Math.max(10, termCols() - 5);
|
|
278643
|
+
const renderBtn = (cmd, label) => {
|
|
278644
|
+
const cmdPrefix = cmd.startsWith("view:") ? "oa-view:" + cmd.slice(5) : "oa-cmd:" + cmd;
|
|
278645
|
+
let fg2 = TEXT_DIM;
|
|
278646
|
+
if (cmd === "voice" && this._voiceActive)
|
|
278647
|
+
fg2 = 82;
|
|
278648
|
+
if (cmd === "nexus") {
|
|
278649
|
+
fg2 = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
|
|
278650
|
+
}
|
|
278651
|
+
return `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg2}m${label}\x1B]8;;\x07`;
|
|
278652
|
+
};
|
|
278653
|
+
const verText = ` OA v${this._version}`;
|
|
278654
|
+
const menuBtns = [
|
|
278655
|
+
{ cmd: "help", label: " help ", w: 6 },
|
|
278656
|
+
{ cmd: "voice", label: " voice ", w: 7 },
|
|
278657
|
+
{ cmd: "model", label: " model ", w: 7 },
|
|
278658
|
+
{ cmd: "cohere", label: " cohere ", w: 8 }
|
|
278659
|
+
];
|
|
278660
|
+
const verW = verText.length;
|
|
278661
|
+
let menuPages = [];
|
|
278662
|
+
let curPage = [];
|
|
278663
|
+
let curW = verW + 1;
|
|
278664
|
+
for (const btn of menuBtns) {
|
|
278665
|
+
const btnW = btn.w + 1;
|
|
278666
|
+
if (curW + btnW > availW && curPage.length > 0) {
|
|
278667
|
+
menuPages.push(curPage);
|
|
278668
|
+
curPage = [];
|
|
278669
|
+
curW = 0;
|
|
278670
|
+
}
|
|
278671
|
+
curPage.push(btn);
|
|
278672
|
+
curW += btnW;
|
|
278673
|
+
}
|
|
278674
|
+
if (curPage.length > 0)
|
|
278675
|
+
menuPages.push(curPage);
|
|
278676
|
+
for (let pi = 0; pi < menuPages.length; pi++) {
|
|
278677
|
+
const btns = menuPages[pi];
|
|
278678
|
+
const isFirstPage = pi === 0;
|
|
278679
|
+
this.registerHeaderPanel(`main-${pi}`, (innerW) => {
|
|
278680
|
+
let out = "";
|
|
278681
|
+
let usedW = 0;
|
|
278682
|
+
if (isFirstPage) {
|
|
278683
|
+
out += `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}\x1B[0m`;
|
|
278684
|
+
usedW += verW;
|
|
278685
|
+
}
|
|
278686
|
+
let btnTotalW = 0;
|
|
278687
|
+
for (const btn of btns)
|
|
278688
|
+
btnTotalW += btn.w + 1;
|
|
278689
|
+
const gap = Math.max(1, innerW - usedW - btnTotalW);
|
|
278690
|
+
out += `\x1B[38;5;${TEXT_DIM}m${" ".repeat(gap)}`;
|
|
278691
|
+
for (const btn of btns) {
|
|
278692
|
+
out += renderBtn(btn.cmd, btn.label) + " ";
|
|
278693
|
+
}
|
|
278694
|
+
return out;
|
|
278695
|
+
});
|
|
278696
|
+
}
|
|
278697
|
+
const sysItems = [];
|
|
278698
|
+
if (this._agentViews.size > 1) {
|
|
278699
|
+
for (const view of this._agentViews.values()) {
|
|
278700
|
+
if (view.id === "main" && this._activeViewId === "main")
|
|
278701
|
+
continue;
|
|
278702
|
+
const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
|
|
278703
|
+
const label = ` ${view.label} ${icon} `;
|
|
278704
|
+
sysItems.push({ render: () => renderBtn(`view:${view.id}`, label) + " ", w: label.length + 1 });
|
|
278705
|
+
}
|
|
278706
|
+
} else {
|
|
278707
|
+
sysItems.push({ render: () => `\x1B[38;5;${TEXT_DIM}m no sub-agents `, w: 14 });
|
|
278708
|
+
}
|
|
278709
|
+
sysItems.push({ render: () => `\x1B[38;5;${TEXT_DIM}m\u2502 `, w: 2 });
|
|
278710
|
+
const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
|
|
278711
|
+
const voiceIcon = this._voiceActive ? "\u25CF" : "\u25CB";
|
|
278712
|
+
sysItems.push({ render: () => renderBtn("voice", `${voiceIcon}${voiceLabel}`) + " ", w: voiceLabel.length + 2 });
|
|
278713
|
+
const nexusDot = this._nexusStatus === "connected" || this._nexusStatus === "connecting" ? "\u25CF" : "\u25CB";
|
|
278714
|
+
sysItems.push({ render: () => renderBtn("nexus", `${nexusDot} nexus `) + " ", w: 9 });
|
|
278715
|
+
let sysPages = [];
|
|
278716
|
+
let sCurPage = [];
|
|
278717
|
+
let sCurW = 0;
|
|
278718
|
+
for (const item of sysItems) {
|
|
278719
|
+
if (sCurW + item.w > availW && sCurPage.length > 0) {
|
|
278720
|
+
sysPages.push(sCurPage);
|
|
278721
|
+
sCurPage = [];
|
|
278722
|
+
sCurW = 0;
|
|
278723
|
+
}
|
|
278724
|
+
sCurPage.push(item);
|
|
278725
|
+
sCurW += item.w;
|
|
278726
|
+
}
|
|
278727
|
+
if (sCurPage.length > 0)
|
|
278728
|
+
sysPages.push(sCurPage);
|
|
278729
|
+
for (let pi = 0; pi < sysPages.length; pi++) {
|
|
278730
|
+
const items = sysPages[pi];
|
|
278731
|
+
this.registerHeaderPanel(`sys-${pi}`, (_innerW) => {
|
|
278732
|
+
let out = "";
|
|
278733
|
+
for (const item of items)
|
|
278734
|
+
out += item.render();
|
|
278735
|
+
return out;
|
|
278736
|
+
});
|
|
278737
|
+
}
|
|
278738
|
+
this._headerPanelIndex = Math.min(savedIdx, Math.max(0, this._headerPanels.length - 1));
|
|
278739
|
+
}
|
|
278635
278740
|
/** Switch to the next header panel (wraps around) */
|
|
278636
278741
|
nextHeaderPanel() {
|
|
278637
278742
|
if (this._headerPanels.length <= 1)
|
|
@@ -278655,7 +278760,7 @@ var init_status_bar = __esm({
|
|
|
278655
278760
|
if (!this.active)
|
|
278656
278761
|
return;
|
|
278657
278762
|
const w = termCols();
|
|
278658
|
-
const innerW = w -
|
|
278763
|
+
const innerW = Math.max(1, w - 5);
|
|
278659
278764
|
const panel = this._headerPanels[this._headerPanelIndex];
|
|
278660
278765
|
if (!panel)
|
|
278661
278766
|
return;
|
|
@@ -278671,9 +278776,9 @@ var init_status_bar = __esm({
|
|
|
278671
278776
|
buf += ` `;
|
|
278672
278777
|
buf += `\x1B[38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}`;
|
|
278673
278778
|
buf += content;
|
|
278674
|
-
buf += `\x1B[${hdrRow};${w -
|
|
278779
|
+
buf += `\x1B[${hdrRow};${w - 1}H`;
|
|
278675
278780
|
buf += rightArrow;
|
|
278676
|
-
buf +=
|
|
278781
|
+
buf += `\x1B[${hdrRow};${w}H${BOX_FG}\u2502${RESET}`;
|
|
278677
278782
|
buf += "\x1B8";
|
|
278678
278783
|
this.termWrite(buf);
|
|
278679
278784
|
}
|
|
@@ -279199,65 +279304,7 @@ var init_status_bar = __esm({
|
|
|
279199
279304
|
this.scrollRegionTop = scrollRegionTop ?? 1;
|
|
279200
279305
|
this.active = true;
|
|
279201
279306
|
if (this._headerPanels.length === 0) {
|
|
279202
|
-
|
|
279203
|
-
{ cmd: "help", label: " help " },
|
|
279204
|
-
{ cmd: "voice", label: " voice " },
|
|
279205
|
-
{ cmd: "model", label: " model " },
|
|
279206
|
-
{ cmd: "cohere", label: " cohere " }
|
|
279207
|
-
];
|
|
279208
|
-
this.registerHeaderPanel("main", (innerW) => {
|
|
279209
|
-
const verText = ` OA v${this._version}`;
|
|
279210
|
-
let usedW = verText.length + 5;
|
|
279211
|
-
const fittingBtns = [];
|
|
279212
|
-
const overflowBtns = [];
|
|
279213
|
-
for (const btn of allBtns) {
|
|
279214
|
-
const btnW = btn.label.length + 1;
|
|
279215
|
-
if (usedW + btnW <= innerW) {
|
|
279216
|
-
fittingBtns.push(btn);
|
|
279217
|
-
usedW += btnW;
|
|
279218
|
-
} else {
|
|
279219
|
-
overflowBtns.push(btn);
|
|
279220
|
-
}
|
|
279221
|
-
}
|
|
279222
|
-
this._overflowBtns = overflowBtns;
|
|
279223
|
-
const gap = Math.max(1, innerW - usedW + 1);
|
|
279224
|
-
let out = `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}`;
|
|
279225
|
-
out += `\x1B[38;5;${TEXT_DIM}m${" ".repeat(gap)}`;
|
|
279226
|
-
for (const btn of fittingBtns) {
|
|
279227
|
-
out += `\x1B]8;;oa-cmd:${btn.cmd}\x07\x1B[38;5;${TEXT_DIM}m${btn.label}\x1B]8;;\x07 `;
|
|
279228
|
-
}
|
|
279229
|
-
return out;
|
|
279230
|
-
});
|
|
279231
|
-
this.registerHeaderPanel("systems", (innerW) => {
|
|
279232
|
-
let out = "";
|
|
279233
|
-
if (this._agentViews.size > 1) {
|
|
279234
|
-
for (const view of this._agentViews.values()) {
|
|
279235
|
-
if (view.id === "main" && this._activeViewId === "main")
|
|
279236
|
-
continue;
|
|
279237
|
-
const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
|
|
279238
|
-
const isActive = view.id === this._activeViewId;
|
|
279239
|
-
const fg2 = isActive ? 252 : 245;
|
|
279240
|
-
out += `\x1B]8;;oa-view:${view.id}\x07\x1B[38;5;${fg2}m ${view.label} ${icon} \x1B]8;;\x07 `;
|
|
279241
|
-
}
|
|
279242
|
-
} else {
|
|
279243
|
-
out += `\x1B[38;5;${TEXT_DIM}m no sub-agents `;
|
|
279244
|
-
}
|
|
279245
|
-
out += `\x1B[38;5;${TEXT_DIM}m\u2502 `;
|
|
279246
|
-
const voiceIcon = this._voiceActive ? `\x1B[38;5;82m\u25CF` : `\x1B[38;5;${TEXT_DIM}m\u25CB`;
|
|
279247
|
-
const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
|
|
279248
|
-
out += `\x1B]8;;oa-cmd:voice\x07${voiceIcon}\x1B[38;5;${this._voiceActive ? 82 : TEXT_DIM}m${voiceLabel}\x1B]8;;\x07 `;
|
|
279249
|
-
const nexusColor = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
|
|
279250
|
-
const nexusDot = this._nexusStatus === "connected" ? "\u25CF" : this._nexusStatus === "connecting" ? "\u25CF" : "\u25CB";
|
|
279251
|
-
out += `\x1B]8;;oa-cmd:nexus\x07\x1B[38;5;${nexusColor}m${nexusDot}\x1B[38;5;${TEXT_DIM}m nexus \x1B]8;;\x07`;
|
|
279252
|
-
const overflow = this._overflowBtns;
|
|
279253
|
-
if (overflow && overflow.length > 0) {
|
|
279254
|
-
out += `\x1B[38;5;${TEXT_DIM}m\u2502 `;
|
|
279255
|
-
for (const btn of overflow) {
|
|
279256
|
-
out += `\x1B]8;;oa-cmd:${btn.cmd}\x07\x1B[38;5;${TEXT_DIM}m${btn.label}\x1B]8;;\x07 `;
|
|
279257
|
-
}
|
|
279258
|
-
}
|
|
279259
|
-
return out;
|
|
279260
|
-
});
|
|
279307
|
+
this._rebuildHeaderPanels();
|
|
279261
279308
|
}
|
|
279262
279309
|
if (!this._agentViews.has("main")) {
|
|
279263
279310
|
this._agentViews.set("main", {
|
|
@@ -279823,6 +279870,7 @@ var init_status_bar = __esm({
|
|
|
279823
279870
|
if (!this.active)
|
|
279824
279871
|
return;
|
|
279825
279872
|
setTermSize(process.stdout.rows ?? 24, process.stdout.columns ?? 80);
|
|
279873
|
+
this._rebuildHeaderPanels();
|
|
279826
279874
|
const prevRows = this._prevTermRows;
|
|
279827
279875
|
const prevCols = this._prevTermCols;
|
|
279828
279876
|
this.updateFooterHeight();
|
package/package.json
CHANGED