open-agents-ai 0.187.48 → 0.187.50
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 +75 -56
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -292770,48 +292770,6 @@ var init_banner = __esm({
|
|
|
292770
292770
|
buf += `\x1B[${r2 + 1};1H\x1B[38;5;178m\x1B[48;5;0m${ch}\x1B[0m`;
|
|
292771
292771
|
}
|
|
292772
292772
|
}
|
|
292773
|
-
if (this._updateAvailable && this.currentDesign?.type === "default") {
|
|
292774
|
-
this._pulseFrame++;
|
|
292775
|
-
const t2 = (Math.sin(this._pulseFrame * 0.16) + 1) / 2;
|
|
292776
|
-
const ramp = [240, 241, 243, 245, 247, 249, 180, 178];
|
|
292777
|
-
const versionIdx = Math.round(t2 * (ramp.length - 1));
|
|
292778
|
-
const updateIdx = Math.round((1 - t2) * (ramp.length - 1));
|
|
292779
|
-
const versionFg = ramp[versionIdx];
|
|
292780
|
-
const updateFg = ramp[updateIdx];
|
|
292781
|
-
const bgDark = 0;
|
|
292782
|
-
const storedVersion = this.currentDesign.version ?? "";
|
|
292783
|
-
const vText = ` OA v${storedVersion}`;
|
|
292784
|
-
const vStart = 3;
|
|
292785
|
-
const vLen = vText.length;
|
|
292786
|
-
buf += `\x1B[1;${vStart}H\x1B[1;38;5;${versionFg}m\x1B[48;5;${bgDark}m`;
|
|
292787
|
-
for (let c4 = vStart - 1; c4 < vStart - 1 + vLen && c4 < this.width; c4++) {
|
|
292788
|
-
const cell = frame.grid[0]?.[c4];
|
|
292789
|
-
if (cell)
|
|
292790
|
-
buf += cell.char;
|
|
292791
|
-
}
|
|
292792
|
-
const badge = " UPDATE ";
|
|
292793
|
-
const badgeStart = vStart + vLen;
|
|
292794
|
-
if (badgeStart + badge.length < this.width) {
|
|
292795
|
-
buf += `\x1B]8;;oa-cmd:/update\x07`;
|
|
292796
|
-
buf += `\x1B[1;${badgeStart}H\x1B[1;38;5;${updateFg}m\x1B[48;5;0m${badge}`;
|
|
292797
|
-
buf += `\x1B]8;;\x07`;
|
|
292798
|
-
const mnemonicStartCol = badgeStart + badge.length;
|
|
292799
|
-
const gridRow = frame.grid[0];
|
|
292800
|
-
if (gridRow) {
|
|
292801
|
-
const origMnemonicStart = vStart - 1 + vLen;
|
|
292802
|
-
let mnBuf = `\x1B[1;${mnemonicStartCol}H\x1B[0;38;5;240m\x1B[48;5;${bgDark}m`;
|
|
292803
|
-
for (let c4 = origMnemonicStart; c4 < gridRow.length && c4 < Math.floor(this.width * 0.44); c4++) {
|
|
292804
|
-
const cell = gridRow[c4];
|
|
292805
|
-
if (cell && cell.char !== " " && !cell.bold)
|
|
292806
|
-
mnBuf += cell.char;
|
|
292807
|
-
else if (cell)
|
|
292808
|
-
mnBuf += cell.char;
|
|
292809
|
-
}
|
|
292810
|
-
buf += mnBuf;
|
|
292811
|
-
}
|
|
292812
|
-
}
|
|
292813
|
-
buf += "\x1B[0m";
|
|
292814
|
-
}
|
|
292815
292773
|
buf += "\x1B[0m";
|
|
292816
292774
|
try {
|
|
292817
292775
|
process.stdout.write(buf);
|
|
@@ -299061,16 +299019,21 @@ function hitTestHeaderButton(row, col, termWidth) {
|
|
|
299061
299019
|
if (row === 2) {
|
|
299062
299020
|
if (col <= 3)
|
|
299063
299021
|
return "header-prev";
|
|
299064
|
-
if (col >= termWidth -
|
|
299022
|
+
if (col >= termWidth - 3)
|
|
299065
299023
|
return "header-next";
|
|
299066
|
-
const
|
|
299067
|
-
|
|
299068
|
-
|
|
299069
|
-
|
|
299070
|
-
|
|
299071
|
-
|
|
299072
|
-
|
|
299073
|
-
|
|
299024
|
+
const btnDefs = [
|
|
299025
|
+
{ cmd: "/help", label: " help " },
|
|
299026
|
+
{ cmd: "/voice", label: " voice " },
|
|
299027
|
+
{ cmd: "/model", label: " model " },
|
|
299028
|
+
{ cmd: "/cohere", label: " cohere " }
|
|
299029
|
+
];
|
|
299030
|
+
let btnEnd = termWidth - 4;
|
|
299031
|
+
for (let i2 = btnDefs.length - 1; i2 >= 0; i2--) {
|
|
299032
|
+
const btn = btnDefs[i2];
|
|
299033
|
+
const btnStart = btnEnd - btn.label.length;
|
|
299034
|
+
if (col >= btnStart && col <= btnEnd)
|
|
299035
|
+
return btn.cmd;
|
|
299036
|
+
btnEnd = btnStart - 1;
|
|
299074
299037
|
}
|
|
299075
299038
|
}
|
|
299076
299039
|
return null;
|
|
@@ -299569,6 +299532,12 @@ var init_status_bar = __esm({
|
|
|
299569
299532
|
_suggestions = [];
|
|
299570
299533
|
/** Currently highlighted suggestion index (-1 = none) */
|
|
299571
299534
|
_suggestIndex = -1;
|
|
299535
|
+
/** Whether suggestions were triggered by direct typing (instant) vs history navigation (delayed) */
|
|
299536
|
+
_suggestFromHistory = false;
|
|
299537
|
+
/** Timer for delayed suggestion trigger on history navigation */
|
|
299538
|
+
_suggestDelayTimer = null;
|
|
299539
|
+
/** Whether suggestions were manually dismissed via Esc */
|
|
299540
|
+
_suggestDismissed = false;
|
|
299572
299541
|
/** Callback to get available slash commands for suggestion matching */
|
|
299573
299542
|
_commandListProvider = null;
|
|
299574
299543
|
/** Callback to apply a selected suggestion to the input line */
|
|
@@ -300367,9 +300336,17 @@ var init_status_bar = __esm({
|
|
|
300367
300336
|
this._suggestions = [];
|
|
300368
300337
|
return;
|
|
300369
300338
|
}
|
|
300339
|
+
if (this._suggestDismissed) {
|
|
300340
|
+
this._suggestions = [];
|
|
300341
|
+
return;
|
|
300342
|
+
}
|
|
300370
300343
|
const { line } = this.inputStateProvider();
|
|
300371
300344
|
if (!line.startsWith("/") || line.length < 2 || line.includes(" ")) {
|
|
300372
300345
|
this._suggestions = [];
|
|
300346
|
+
this._suggestDismissed = false;
|
|
300347
|
+
return;
|
|
300348
|
+
}
|
|
300349
|
+
if (this._suggestFromHistory) {
|
|
300373
300350
|
return;
|
|
300374
300351
|
}
|
|
300375
300352
|
const query = line.slice(1).toLowerCase();
|
|
@@ -300380,6 +300357,40 @@ var init_status_bar = __esm({
|
|
|
300380
300357
|
}
|
|
300381
300358
|
this._suggestions = matches;
|
|
300382
300359
|
}
|
|
300360
|
+
/** Dismiss suggestions (Esc key) */
|
|
300361
|
+
dismissSuggestions() {
|
|
300362
|
+
this._suggestions = [];
|
|
300363
|
+
this._suggestIndex = -1;
|
|
300364
|
+
this._suggestDismissed = true;
|
|
300365
|
+
if (this._suggestDelayTimer) {
|
|
300366
|
+
clearTimeout(this._suggestDelayTimer);
|
|
300367
|
+
this._suggestDelayTimer = null;
|
|
300368
|
+
}
|
|
300369
|
+
if (this.active)
|
|
300370
|
+
this.renderFooterAndPositionInput();
|
|
300371
|
+
}
|
|
300372
|
+
/** Notify that input changed via history navigation (up/down arrow) */
|
|
300373
|
+
notifyHistoryNavigation() {
|
|
300374
|
+
this._suggestFromHistory = true;
|
|
300375
|
+
this._suggestDismissed = false;
|
|
300376
|
+
if (this._suggestDelayTimer)
|
|
300377
|
+
clearTimeout(this._suggestDelayTimer);
|
|
300378
|
+
this._suggestDelayTimer = setTimeout(() => {
|
|
300379
|
+
this._suggestFromHistory = false;
|
|
300380
|
+
this._suggestDelayTimer = null;
|
|
300381
|
+
if (this.active)
|
|
300382
|
+
this.renderFooterAndPositionInput();
|
|
300383
|
+
}, 2e3);
|
|
300384
|
+
}
|
|
300385
|
+
/** Notify that input changed via direct typing (keyboard) */
|
|
300386
|
+
notifyDirectInput() {
|
|
300387
|
+
this._suggestFromHistory = false;
|
|
300388
|
+
this._suggestDismissed = false;
|
|
300389
|
+
if (this._suggestDelayTimer) {
|
|
300390
|
+
clearTimeout(this._suggestDelayTimer);
|
|
300391
|
+
this._suggestDelayTimer = null;
|
|
300392
|
+
}
|
|
300393
|
+
}
|
|
300383
300394
|
/** Cycle focus: footer → header → content → footer */
|
|
300384
300395
|
cycleFocus() {
|
|
300385
300396
|
const order = ["footer", "header", "content"];
|
|
@@ -301317,7 +301328,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301317
301328
|
updateFooterHeight(termWidth) {
|
|
301318
301329
|
this._updateSuggestions();
|
|
301319
301330
|
const inputLines = this.computeInputLineCount(termWidth);
|
|
301320
|
-
const suggestionRows = this._suggestions.length > 0 ? this._suggestions.length : 1;
|
|
301331
|
+
const suggestionRows = this._suggestions.length > 0 ? this._suggestions.length + 1 : 1;
|
|
301321
301332
|
const newHeight = 1 + 1 + inputLines + suggestionRows;
|
|
301322
301333
|
if (newHeight !== this._currentFooterHeight) {
|
|
301323
301334
|
this._currentFooterHeight = newHeight;
|
|
@@ -301329,7 +301340,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301329
301340
|
footerHeightChanged(termWidth) {
|
|
301330
301341
|
this._updateSuggestions();
|
|
301331
301342
|
const inputLines = this.computeInputLineCount(termWidth);
|
|
301332
|
-
const suggestionRows = this._suggestions.length > 0 ? this._suggestions.length : 1;
|
|
301343
|
+
const suggestionRows = this._suggestions.length > 0 ? this._suggestions.length + 1 : 1;
|
|
301333
301344
|
return 1 + 1 + inputLines + suggestionRows !== this._currentFooterHeight;
|
|
301334
301345
|
}
|
|
301335
301346
|
/** Compute absolute row positions for all footer elements.
|
|
@@ -301472,10 +301483,13 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301472
301483
|
const fg2 = isHighlighted ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
301473
301484
|
const slash = isHighlighted ? `\x1B[38;5;245m` : `\x1B[38;5;${TEXT_DIM}m`;
|
|
301474
301485
|
const marker = isHighlighted ? `\x1B[38;5;${TEXT_PRIMARY}m\u203A ` : " ";
|
|
301475
|
-
buf += `\x1B[${row};1H${
|
|
301476
|
-
buf += `${bg}${marker}${slash}/${fg2}${cmd}`;
|
|
301477
|
-
buf += `${
|
|
301486
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V}${RESET}`;
|
|
301487
|
+
buf += `${bg} ${marker}${slash}/${fg2}${cmd}`;
|
|
301488
|
+
buf += `${PANEL_BG_SEQ}\x1B[K`;
|
|
301489
|
+
buf += `\x1B[${row};${w}H${BOX_FG}${BOX_V}${RESET}`;
|
|
301478
301490
|
}
|
|
301491
|
+
const suggestBottomRow = pos.suggestStartRow + this._suggestions.length;
|
|
301492
|
+
buf += `\x1B[${suggestBottomRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL}${BOX_H.repeat(Math.max(0, boxInner))}${BOX_BR}${RESET}`;
|
|
301479
301493
|
} else {
|
|
301480
301494
|
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL}${BOX_H.repeat(Math.max(0, boxInner))}${BOX_BR}${RESET}`;
|
|
301481
301495
|
}
|
|
@@ -301675,6 +301689,10 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301675
301689
|
if (key?.name === "escape" || s2 === "\x1B") {
|
|
301676
301690
|
sawEscape = true;
|
|
301677
301691
|
sawEscapeTime = Date.now();
|
|
301692
|
+
if (self2._suggestions.length > 0) {
|
|
301693
|
+
self2.dismissSuggestions();
|
|
301694
|
+
return;
|
|
301695
|
+
}
|
|
301678
301696
|
if (onEscape && s2.length === 1)
|
|
301679
301697
|
onEscape();
|
|
301680
301698
|
return;
|
|
@@ -301714,6 +301732,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301714
301732
|
self2.scrollContentDown(1);
|
|
301715
301733
|
return;
|
|
301716
301734
|
}
|
|
301735
|
+
self2.notifyHistoryNavigation();
|
|
301717
301736
|
return origTtyWrite(s2, key);
|
|
301718
301737
|
}
|
|
301719
301738
|
if (key?.name === "pageup" || s2 === "\x1B[5~") {
|
package/package.json
CHANGED