open-agents-ai 0.187.90 → 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 +95 -116
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -278632,131 +278632,110 @@ 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
|
|
278636
|
-
*
|
|
278637
|
-
*
|
|
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. */
|
|
278638
278639
|
_rebuildHeaderPanels() {
|
|
278639
278640
|
this._headerPanels = [];
|
|
278640
278641
|
const savedIdx = this._headerPanelIndex;
|
|
278641
|
-
const
|
|
278642
|
-
|
|
278643
|
-
const
|
|
278644
|
-
|
|
278645
|
-
|
|
278646
|
-
|
|
278647
|
-
|
|
278648
|
-
|
|
278649
|
-
|
|
278650
|
-
]
|
|
278651
|
-
items.push({ type: "btn", cmd: btn.cmd, label: btn.label, w: btn.label.length + 1 });
|
|
278652
|
-
}
|
|
278653
|
-
items.push({ type: "sep", w: 3 });
|
|
278654
|
-
if (this._agentViews.size > 1) {
|
|
278655
|
-
for (const view of this._agentViews.values()) {
|
|
278656
|
-
if (view.id === "main" && this._activeViewId === "main")
|
|
278657
|
-
continue;
|
|
278658
|
-
const icon = view.status === "running" ? "\u25CF" : view.status === "completed" ? "\u2713" : view.status === "failed" ? "\u2717" : "\u25CB";
|
|
278659
|
-
const label = ` ${view.label} ${icon} `;
|
|
278660
|
-
items.push({ type: "btn", cmd: `view:${view.id}`, label, w: label.length + 1 });
|
|
278661
|
-
}
|
|
278662
|
-
} else {
|
|
278663
|
-
items.push({ type: "text", text: " no sub-agents", ansi: `\x1B[38;5;${TEXT_DIM}m no sub-agents`, w: 14 });
|
|
278664
|
-
}
|
|
278665
|
-
const voiceIcon = this._voiceActive ? "\u25CF" : "\u25CB";
|
|
278666
|
-
const voiceColor = this._voiceActive ? 82 : TEXT_DIM;
|
|
278667
|
-
const voiceLabel = this._voiceActive ? ` ${this._voiceModelId || "voice"} ` : " voice ";
|
|
278668
|
-
items.push({
|
|
278669
|
-
type: "btn",
|
|
278670
|
-
cmd: "voice",
|
|
278671
|
-
label: `${voiceIcon}${voiceLabel}`,
|
|
278672
|
-
w: voiceLabel.length + 1 + 1
|
|
278673
|
-
// icon + label + space
|
|
278674
|
-
});
|
|
278675
|
-
const nexusColor = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
|
|
278676
|
-
const nexusDot = this._nexusStatus === "connected" || this._nexusStatus === "connecting" ? "\u25CF" : "\u25CB";
|
|
278677
|
-
items.push({
|
|
278678
|
-
type: "btn",
|
|
278679
|
-
cmd: "nexus",
|
|
278680
|
-
label: `${nexusDot} nexus `,
|
|
278681
|
-
w: 8
|
|
278682
|
-
// dot + " nexus " + space
|
|
278683
|
-
});
|
|
278684
|
-
return items;
|
|
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`;
|
|
278685
278652
|
};
|
|
278686
|
-
const
|
|
278687
|
-
const
|
|
278688
|
-
|
|
278689
|
-
|
|
278690
|
-
|
|
278691
|
-
|
|
278692
|
-
|
|
278693
|
-
|
|
278694
|
-
|
|
278695
|
-
|
|
278696
|
-
|
|
278697
|
-
|
|
278698
|
-
|
|
278699
|
-
|
|
278700
|
-
|
|
278701
|
-
|
|
278702
|
-
|
|
278703
|
-
|
|
278704
|
-
|
|
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) => {
|
|
278705
278680
|
let out = "";
|
|
278706
278681
|
let usedW = 0;
|
|
278707
|
-
|
|
278708
|
-
|
|
278709
|
-
|
|
278710
|
-
|
|
278711
|
-
|
|
278712
|
-
|
|
278713
|
-
|
|
278714
|
-
|
|
278715
|
-
|
|
278716
|
-
|
|
278717
|
-
|
|
278718
|
-
}
|
|
278719
|
-
out += `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg2}m${item.label}\x1B]8;;\x07 `;
|
|
278720
|
-
usedW += item.w;
|
|
278721
|
-
} else if (item.type === "sep") {
|
|
278722
|
-
out += `\x1B[38;5;${TEXT_DIM}m \u2502 `;
|
|
278723
|
-
usedW += 3;
|
|
278724
|
-
}
|
|
278725
|
-
}
|
|
278726
|
-
if (pi === 0 && usedW < innerW) {
|
|
278727
|
-
const gapNeeded = innerW - usedW;
|
|
278728
|
-
const verEnd = pageItems.findIndex((it) => it.type !== "text");
|
|
278729
|
-
if (verEnd > 0) {
|
|
278730
|
-
let out2 = "";
|
|
278731
|
-
for (let i2 = 0; i2 < pageItems.length; i2++) {
|
|
278732
|
-
const item = pageItems[i2];
|
|
278733
|
-
if (item.type === "text") {
|
|
278734
|
-
out2 += item.ansi;
|
|
278735
|
-
} else {
|
|
278736
|
-
if (i2 === verEnd) {
|
|
278737
|
-
out2 += `\x1B[38;5;${TEXT_DIM}m${" ".repeat(gapNeeded)}`;
|
|
278738
|
-
}
|
|
278739
|
-
if (item.type === "btn") {
|
|
278740
|
-
const cmdPrefix = item.cmd.startsWith("view:") ? "oa-view:" + item.cmd.slice(5) : "oa-cmd:" + item.cmd;
|
|
278741
|
-
let fg2 = TEXT_DIM;
|
|
278742
|
-
if (item.cmd === "voice" && this._voiceActive)
|
|
278743
|
-
fg2 = 82;
|
|
278744
|
-
if (item.cmd === "nexus") {
|
|
278745
|
-
fg2 = this._nexusStatus === "connected" ? 82 : this._nexusStatus === "connecting" ? 208 : 196;
|
|
278746
|
-
}
|
|
278747
|
-
out2 += `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg2}m${item.label}\x1B]8;;\x07 `;
|
|
278748
|
-
} else if (item.type === "sep") {
|
|
278749
|
-
out2 += `\x1B[38;5;${TEXT_DIM}m \u2502 `;
|
|
278750
|
-
}
|
|
278751
|
-
}
|
|
278752
|
-
}
|
|
278753
|
-
return out2;
|
|
278754
|
-
}
|
|
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) + " ";
|
|
278755
278693
|
}
|
|
278756
278694
|
return out;
|
|
278757
278695
|
});
|
|
278758
278696
|
}
|
|
278759
|
-
|
|
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));
|
|
278760
278739
|
}
|
|
278761
278740
|
/** Switch to the next header panel (wraps around) */
|
|
278762
278741
|
nextHeaderPanel() {
|
|
@@ -278781,7 +278760,7 @@ var init_status_bar = __esm({
|
|
|
278781
278760
|
if (!this.active)
|
|
278782
278761
|
return;
|
|
278783
278762
|
const w = termCols();
|
|
278784
|
-
const innerW = w -
|
|
278763
|
+
const innerW = Math.max(1, w - 5);
|
|
278785
278764
|
const panel = this._headerPanels[this._headerPanelIndex];
|
|
278786
278765
|
if (!panel)
|
|
278787
278766
|
return;
|
package/package.json
CHANGED