open-agents-ai 0.187.392 → 0.187.394
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 +139 -29
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -532371,6 +532371,8 @@ var init_status_bar = __esm({
|
|
|
532371
532371
|
/** Current package version (shown in metrics row, rightmost) */
|
|
532372
532372
|
_version = "";
|
|
532373
532373
|
_updateLatest = null;
|
|
532374
|
+
_headerBackendType = "";
|
|
532375
|
+
_headerBackendUrl = "";
|
|
532374
532376
|
// ── Voice & Nexus status (for header panel display) ─────────────────
|
|
532375
532377
|
_voiceActive = false;
|
|
532376
532378
|
_voiceModelId = "";
|
|
@@ -532387,6 +532389,59 @@ var init_status_bar = __esm({
|
|
|
532387
532389
|
this._nexusStatus = status;
|
|
532388
532390
|
if (this.active) this.refreshHeaderContent();
|
|
532389
532391
|
}
|
|
532392
|
+
refreshHeaderPanels() {
|
|
532393
|
+
this._rebuildHeaderPanels();
|
|
532394
|
+
if (this.active) this.refreshHeaderContent();
|
|
532395
|
+
}
|
|
532396
|
+
refreshHeaderAndFooter() {
|
|
532397
|
+
this.refreshHeaderPanels();
|
|
532398
|
+
if (this.active) this.renderFooterPreserveCursor();
|
|
532399
|
+
}
|
|
532400
|
+
summarizeHeaderModelName() {
|
|
532401
|
+
const raw = this._modelName.trim();
|
|
532402
|
+
if (!raw) return "";
|
|
532403
|
+
const leaf = raw.split("/").pop() ?? raw;
|
|
532404
|
+
const familySource = leaf.split(":")[0]?.trim() || leaf;
|
|
532405
|
+
const paramMatch = raw.match(/(\d+(?:\.\d+)?\s*[bBmMkK])/);
|
|
532406
|
+
const param = paramMatch ? paramMatch[1].replace(/\s+/g, "").toLowerCase() : "";
|
|
532407
|
+
let summary = param && !familySource.toLowerCase().includes(param) ? `${familySource} ${param}` : familySource;
|
|
532408
|
+
if (summary.length > 18) {
|
|
532409
|
+
const compactBase = familySource.split(/[-_]/).filter(Boolean).slice(0, 2).join(" ") || familySource;
|
|
532410
|
+
summary = param && !compactBase.toLowerCase().includes(param) ? `${compactBase} ${param}` : compactBase;
|
|
532411
|
+
}
|
|
532412
|
+
return summary.length > 18 ? `${summary.slice(0, 17)}…` : summary;
|
|
532413
|
+
}
|
|
532414
|
+
summarizeHeaderTransport() {
|
|
532415
|
+
const backendType = this._headerBackendType;
|
|
532416
|
+
const backendUrl = this._headerBackendUrl;
|
|
532417
|
+
if (backendType === "nexus" || backendUrl.startsWith("peer://")) return "p2p";
|
|
532418
|
+
if (backendType === "fake") return "fake";
|
|
532419
|
+
if (!backendUrl) return "";
|
|
532420
|
+
if (backendUrl.includes("127.0.0.1") || backendUrl.includes("localhost") || backendUrl.includes("0.0.0.0")) {
|
|
532421
|
+
return "local";
|
|
532422
|
+
}
|
|
532423
|
+
return "remote";
|
|
532424
|
+
}
|
|
532425
|
+
buildHeaderVersionText() {
|
|
532426
|
+
const parts = [` OA v${this._version}`];
|
|
532427
|
+
const model = this.summarizeHeaderModelName();
|
|
532428
|
+
const transport = this.summarizeHeaderTransport();
|
|
532429
|
+
if (model) parts.push(model);
|
|
532430
|
+
if (transport) parts.push(transport);
|
|
532431
|
+
if (this._updateLatest) parts[parts.length - 1] += " ↑";
|
|
532432
|
+
return parts.join(" | ");
|
|
532433
|
+
}
|
|
532434
|
+
setBackendInfo(backendType, backendUrl) {
|
|
532435
|
+
this._headerBackendType = backendType;
|
|
532436
|
+
this._headerBackendUrl = backendUrl;
|
|
532437
|
+
this.refreshHeaderAndFooter();
|
|
532438
|
+
}
|
|
532439
|
+
setHeaderIdentity(modelName, backendType, backendUrl) {
|
|
532440
|
+
this._modelName = modelName;
|
|
532441
|
+
this._headerBackendType = backendType;
|
|
532442
|
+
this._headerBackendUrl = backendUrl;
|
|
532443
|
+
this.refreshHeaderAndFooter();
|
|
532444
|
+
}
|
|
532390
532445
|
// ── Header Panel System ──────────────────────────────────────────────
|
|
532391
532446
|
// Extensible dual-state (N-state) header: the content row inside the
|
|
532392
532447
|
// ╭│╰ box cycles between registered panels via arrow buttons.
|
|
@@ -532397,18 +532452,19 @@ var init_status_bar = __esm({
|
|
|
532397
532452
|
_headerPanels = [];
|
|
532398
532453
|
/** Index of the currently visible panel (0 = main) */
|
|
532399
532454
|
_headerPanelIndex = 0;
|
|
532455
|
+
_headerCommandZones = [];
|
|
532400
532456
|
/** Register a header panel. Returns its index. */
|
|
532401
|
-
registerHeaderPanel(id, render2) {
|
|
532457
|
+
registerHeaderPanel(id, render2, meta) {
|
|
532402
532458
|
const existing = this._headerPanels.findIndex((p2) => p2.id === id);
|
|
532403
532459
|
if (existing >= 0) {
|
|
532404
|
-
this._headerPanels[existing] = { id, render: render2 };
|
|
532460
|
+
this._headerPanels[existing] = { id, render: render2, meta };
|
|
532405
532461
|
return existing;
|
|
532406
532462
|
}
|
|
532407
|
-
this._headerPanels.push({ id, render: render2 });
|
|
532463
|
+
this._headerPanels.push({ id, render: render2, meta });
|
|
532408
532464
|
return this._headerPanels.length - 1;
|
|
532409
532465
|
}
|
|
532410
532466
|
/** Rebuild all header panels. Two categories are kept separate:
|
|
532411
|
-
* - Category A: Version + menu buttons (help/voice/model/
|
|
532467
|
+
* - Category A: Version + menu buttons (help/voice/model/endpoint/sponsor)
|
|
532412
532468
|
* - Category B: Systems (agents/voice status/nexus status)
|
|
532413
532469
|
* Each category paginates independently across N pages. */
|
|
532414
532470
|
_rebuildHeaderPanels() {
|
|
@@ -532424,14 +532480,13 @@ var init_status_bar = __esm({
|
|
|
532424
532480
|
}
|
|
532425
532481
|
return `\x1B]8;;${cmdPrefix}\x07\x1B[38;5;${fg3}m${label}\x1B]8;;\x07`;
|
|
532426
532482
|
};
|
|
532427
|
-
const
|
|
532428
|
-
const verArrow = this._updateLatest ? " ↑" : "";
|
|
532429
|
-
const verText = verBase + verArrow;
|
|
532483
|
+
const verText = this.buildHeaderVersionText();
|
|
532430
532484
|
const menuBtns = [
|
|
532431
532485
|
{ cmd: "help", label: " help ", w: 6 },
|
|
532432
532486
|
{ cmd: "voice", label: " voice ", w: 7 },
|
|
532433
532487
|
{ cmd: "model", label: " model ", w: 7 },
|
|
532434
|
-
{ cmd: "
|
|
532488
|
+
{ cmd: "endpoint", label: " endpoint ", w: 10 },
|
|
532489
|
+
{ cmd: "sponsor", label: " sponsor ", w: 9 }
|
|
532435
532490
|
];
|
|
532436
532491
|
const verW = verText.length;
|
|
532437
532492
|
let menuPages = [];
|
|
@@ -532455,10 +532510,6 @@ var init_status_bar = __esm({
|
|
|
532455
532510
|
let out = "";
|
|
532456
532511
|
let usedW = 0;
|
|
532457
532512
|
if (isFirstPage) {
|
|
532458
|
-
try {
|
|
532459
|
-
this._verClickZone = this._updateLatest ? { start: 4, end: 4 + verW - 1 } : null;
|
|
532460
|
-
} catch {
|
|
532461
|
-
}
|
|
532462
532513
|
out += `\x1B[1;38;5;${TEXT_PRIMARY}m${verText}\x1B[0m`;
|
|
532463
532514
|
usedW += verW;
|
|
532464
532515
|
}
|
|
@@ -532470,6 +532521,11 @@ var init_status_bar = __esm({
|
|
|
532470
532521
|
out += renderBtn(btn.cmd, btn.label) + " ";
|
|
532471
532522
|
}
|
|
532472
532523
|
return out;
|
|
532524
|
+
}, {
|
|
532525
|
+
kind: "main",
|
|
532526
|
+
buttons: btns,
|
|
532527
|
+
isFirstPage,
|
|
532528
|
+
versionWidth: verW
|
|
532473
532529
|
});
|
|
532474
532530
|
}
|
|
532475
532531
|
const sysItems = [];
|
|
@@ -532518,7 +532574,7 @@ var init_status_bar = __esm({
|
|
|
532518
532574
|
let out = "";
|
|
532519
532575
|
for (const item of items) out += item.render();
|
|
532520
532576
|
return out;
|
|
532521
|
-
});
|
|
532577
|
+
}, { kind: "system" });
|
|
532522
532578
|
}
|
|
532523
532579
|
this._headerPanelIndex = Math.min(savedIdx, Math.max(0, this._headerPanels.length - 1));
|
|
532524
532580
|
}
|
|
@@ -532538,15 +532594,65 @@ var init_status_bar = __esm({
|
|
|
532538
532594
|
get currentHeaderPanel() {
|
|
532539
532595
|
return this._headerPanels[this._headerPanelIndex]?.id ?? "main";
|
|
532540
532596
|
}
|
|
532597
|
+
getHeaderChromeLayout(termWidth) {
|
|
532598
|
+
const hasMultiple = this._headerPanels.length > 1;
|
|
532599
|
+
const showPrev = hasMultiple && this._headerPanelIndex > 0;
|
|
532600
|
+
const showNext = hasMultiple && this._headerPanelIndex < this._headerPanels.length - 1;
|
|
532601
|
+
const leftPadWidth = showPrev ? 2 : 0;
|
|
532602
|
+
const rightPadWidth = showNext ? 1 : 0;
|
|
532603
|
+
return {
|
|
532604
|
+
showPrev,
|
|
532605
|
+
showNext,
|
|
532606
|
+
contentStartCol: 2 + leftPadWidth,
|
|
532607
|
+
innerWidth: Math.max(1, termWidth - 2 - leftPadWidth - rightPadWidth)
|
|
532608
|
+
};
|
|
532609
|
+
}
|
|
532610
|
+
hitTestCurrentHeaderAction(row, col, termWidth) {
|
|
532611
|
+
const hdrRow = layout().headerContent;
|
|
532612
|
+
if (row !== hdrRow) return null;
|
|
532613
|
+
const chrome = this.getHeaderChromeLayout(termWidth);
|
|
532614
|
+
if (chrome.showPrev && col === 2) return "header-prev";
|
|
532615
|
+
if (chrome.showNext && col === termWidth - 1) return "header-next";
|
|
532616
|
+
const hit = this._headerCommandZones.find((zone) => col >= zone.start && col <= zone.end);
|
|
532617
|
+
return hit?.cmd ?? null;
|
|
532618
|
+
}
|
|
532541
532619
|
/** Render the current header panel content onto terminal row 2 (inside box) */
|
|
532542
532620
|
refreshHeaderContent() {
|
|
532543
532621
|
if (!this.active) return;
|
|
532544
532622
|
const w = termCols();
|
|
532545
|
-
const
|
|
532623
|
+
const chrome = this.getHeaderChromeLayout(w);
|
|
532624
|
+
const innerW = chrome.innerWidth;
|
|
532546
532625
|
const panel = this._headerPanels[this._headerPanelIndex];
|
|
532547
532626
|
if (!panel) return;
|
|
532627
|
+
this._headerCommandZones = [];
|
|
532628
|
+
try {
|
|
532629
|
+
this._verClickZone = null;
|
|
532630
|
+
} catch {
|
|
532631
|
+
}
|
|
532548
532632
|
let content = panel.render(innerW);
|
|
532549
532633
|
this._sysClickZones = [];
|
|
532634
|
+
if (panel.meta?.kind === "main") {
|
|
532635
|
+
const buttons = panel.meta.buttons ?? [];
|
|
532636
|
+
const versionWidth = panel.meta.versionWidth ?? 0;
|
|
532637
|
+
const usedW = panel.meta.isFirstPage ? versionWidth : 0;
|
|
532638
|
+
const btnTotalW = buttons.reduce((sum, btn) => sum + btn.w + 1, 0);
|
|
532639
|
+
const gap = Math.max(1, innerW - usedW - btnTotalW);
|
|
532640
|
+
let col = chrome.contentStartCol + usedW + gap;
|
|
532641
|
+
if (panel.meta.isFirstPage && this._updateLatest) {
|
|
532642
|
+
try {
|
|
532643
|
+
this._verClickZone = {
|
|
532644
|
+
start: chrome.contentStartCol,
|
|
532645
|
+
end: chrome.contentStartCol + versionWidth - 1
|
|
532646
|
+
};
|
|
532647
|
+
} catch {
|
|
532648
|
+
}
|
|
532649
|
+
}
|
|
532650
|
+
this._headerCommandZones = buttons.map((btn) => {
|
|
532651
|
+
const zone = { start: col, end: col + btn.w - 1, cmd: `/${btn.cmd}` };
|
|
532652
|
+
col += btn.w + 1;
|
|
532653
|
+
return zone;
|
|
532654
|
+
});
|
|
532655
|
+
}
|
|
532550
532656
|
if (String(this.currentHeaderPanel).startsWith("sys-")) {
|
|
532551
532657
|
const zones = [];
|
|
532552
532658
|
const trunc3 = (s2) => s2.trim().split(/\s+/).slice(0, 3).join(" ");
|
|
@@ -532583,7 +532689,7 @@ var init_status_bar = __esm({
|
|
|
532583
532689
|
if (cur.length > 0) pages.push(cur);
|
|
532584
532690
|
const idx = parseInt(String(this.currentHeaderPanel).split("-")[1] || "0", 10) || 0;
|
|
532585
532691
|
const page2 = pages[Math.max(0, Math.min(idx, pages.length - 1))] ?? [];
|
|
532586
|
-
let col =
|
|
532692
|
+
let col = chrome.contentStartCol;
|
|
532587
532693
|
const clickZones = [];
|
|
532588
532694
|
for (const z16 of page2) {
|
|
532589
532695
|
if (z16.id) clickZones.push({ start: col, end: col + z16.w - 2, id: z16.id });
|
|
@@ -532591,19 +532697,22 @@ var init_status_bar = __esm({
|
|
|
532591
532697
|
}
|
|
532592
532698
|
this._sysClickZones = clickZones;
|
|
532593
532699
|
}
|
|
532594
|
-
const
|
|
532595
|
-
const
|
|
532596
|
-
const rightArrow = hasMultiple ? `\x1B]8;;oa-cmd:header-next\x07\x1B[38;5;${TEXT_DIM}m${this._headerPanelIndex < this._headerPanels.length - 1 ? "▶" : " "}\x1B]8;;\x07` : " ";
|
|
532700
|
+
const leftArrow = chrome.showPrev ? `\x1B]8;;oa-cmd:header-prev\x07\x1B[38;5;${TEXT_DIM}m◀\x1B]8;;\x07` : "";
|
|
532701
|
+
const rightArrow = chrome.showNext ? `\x1B]8;;oa-cmd:header-next\x07\x1B[38;5;${TEXT_DIM}m▶\x1B]8;;\x07` : "";
|
|
532597
532702
|
const hdrRow = layout().headerContent;
|
|
532598
532703
|
let buf = "\x1B7";
|
|
532599
532704
|
buf += `\x1B[${hdrRow};1H${PANEL_BG_SEQ}\x1B[2K`;
|
|
532600
532705
|
buf += `${BOX_FG}│${RESET2}${PANEL_BG_SEQ}`;
|
|
532601
|
-
|
|
532602
|
-
|
|
532706
|
+
if (chrome.showPrev) {
|
|
532707
|
+
buf += leftArrow;
|
|
532708
|
+
buf += ` `;
|
|
532709
|
+
}
|
|
532603
532710
|
buf += `\x1B[38;5;${TEXT_PRIMARY}m${PANEL_BG_SEQ}`;
|
|
532604
532711
|
buf += content;
|
|
532605
|
-
|
|
532606
|
-
|
|
532712
|
+
if (chrome.showNext) {
|
|
532713
|
+
buf += `\x1B[${hdrRow};${w - 1}H`;
|
|
532714
|
+
buf += rightArrow;
|
|
532715
|
+
}
|
|
532607
532716
|
buf += `\x1B[${hdrRow};${w}H${BOX_FG}│${RESET2}`;
|
|
532608
532717
|
buf += "\x1B8";
|
|
532609
532718
|
this.termWrite(buf);
|
|
@@ -532708,12 +532817,12 @@ var init_status_bar = __esm({
|
|
|
532708
532817
|
/** Set the current package version for display in the metrics row */
|
|
532709
532818
|
setVersion(version4) {
|
|
532710
532819
|
this._version = version4;
|
|
532711
|
-
|
|
532820
|
+
this.refreshHeaderAndFooter();
|
|
532712
532821
|
}
|
|
532713
532822
|
/** Mark that a newer version is available (renders clickable ↑ next to version) */
|
|
532714
532823
|
setUpdateAvailable(latestVersion) {
|
|
532715
532824
|
this._updateLatest = latestVersion;
|
|
532716
|
-
|
|
532825
|
+
this.refreshHeaderPanels();
|
|
532717
532826
|
}
|
|
532718
532827
|
/** Human expert speed ratio tracker */
|
|
532719
532828
|
_speedTracker = new HumanSpeedTracker();
|
|
@@ -532766,8 +532875,7 @@ var init_status_bar = __esm({
|
|
|
532766
532875
|
_modelName = "";
|
|
532767
532876
|
/** Update active model name shown in the status bar */
|
|
532768
532877
|
setModelName(name10) {
|
|
532769
|
-
this.
|
|
532770
|
-
if (this.active) this.renderFooterPreserveCursor();
|
|
532878
|
+
this.setHeaderIdentity(name10, this._headerBackendType, this._headerBackendUrl);
|
|
532771
532879
|
}
|
|
532772
532880
|
/** Model capabilities — shown as emoji indicators on the status bar */
|
|
532773
532881
|
_caps = {
|
|
@@ -533450,7 +533558,7 @@ var init_status_bar = __esm({
|
|
|
533450
533558
|
return;
|
|
533451
533559
|
}
|
|
533452
533560
|
}
|
|
533453
|
-
const cmd =
|
|
533561
|
+
const cmd = this.hitTestCurrentHeaderAction(row, col, w);
|
|
533454
533562
|
if (type === "press" && cmd) {
|
|
533455
533563
|
if (cmd === "header-prev") {
|
|
533456
533564
|
this.prevHeaderPanel();
|
|
@@ -581708,7 +581816,7 @@ ${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
|
|
|
581708
581816
|
statusBar.setCapabilities(caps);
|
|
581709
581817
|
}).catch(() => {
|
|
581710
581818
|
});
|
|
581711
|
-
statusBar.
|
|
581819
|
+
statusBar.setHeaderIdentity(config.model, config.backendType, config.backendUrl);
|
|
581712
581820
|
const provider = detectProvider(config.backendUrl);
|
|
581713
581821
|
const costTracker = new CostTracker(provider.id);
|
|
581714
581822
|
const sessionMetrics = new SessionMetrics();
|
|
@@ -582607,6 +582715,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
582607
582715
|
currentConfig.backendUrl = best.tunnelUrl;
|
|
582608
582716
|
currentConfig.apiKey = bestNoAuth ? "" : best.authKey;
|
|
582609
582717
|
currentConfig.backendType = "openai";
|
|
582718
|
+
statusBar.setBackendInfo(currentConfig.backendType, currentConfig.backendUrl);
|
|
582610
582719
|
setTimeout(() => {
|
|
582611
582720
|
if (statusBar.isActive) {
|
|
582612
582721
|
writeContent(() => renderInfo2(`Connected to sponsored endpoint: ${best.name}`));
|
|
@@ -582791,7 +582900,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
582791
582900
|
sessionMetrics,
|
|
582792
582901
|
setModel(model) {
|
|
582793
582902
|
currentConfig = { ...currentConfig, model };
|
|
582794
|
-
statusBar.
|
|
582903
|
+
statusBar.setHeaderIdentity(model, currentConfig.backendType, currentConfig.backendUrl);
|
|
582795
582904
|
},
|
|
582796
582905
|
setVerbose(verbose) {
|
|
582797
582906
|
currentConfig = { ...currentConfig, verbose };
|
|
@@ -582803,6 +582912,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
582803
582912
|
backendType,
|
|
582804
582913
|
...apiKey !== void 0 ? { apiKey } : {}
|
|
582805
582914
|
};
|
|
582915
|
+
statusBar.setBackendInfo(backendType, url);
|
|
582806
582916
|
const newProvider = detectProvider(url);
|
|
582807
582917
|
costTracker.setProvider(newProvider.id);
|
|
582808
582918
|
const isPeer = url.startsWith("peer://");
|
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.394",
|
|
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.394",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "CC-BY-NC-4.0",
|
|
12
12
|
"dependencies": {
|
package/package.json
CHANGED