open-agents-ai 0.185.2 → 0.185.4
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 +100 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51503,7 +51503,8 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
51503
51503
|
const { execFileSync } = await import("node:child_process");
|
|
51504
51504
|
if (ctx.hasActiveTask?.())
|
|
51505
51505
|
ctx.abortActiveTask?.();
|
|
51506
|
-
ctx.
|
|
51506
|
+
ctx.stopBanner?.();
|
|
51507
|
+
ctx.deactivateStatusBar?.();
|
|
51507
51508
|
if (process.stdout.isTTY) {
|
|
51508
51509
|
process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[r\x1B[?25h\x1B[?1049l\x1B[2J\x1B[H\x1B[0m");
|
|
51509
51510
|
}
|
|
@@ -60372,8 +60373,12 @@ var init_status_bar = __esm({
|
|
|
60372
60373
|
_focusFrame = 0;
|
|
60373
60374
|
/** Slash command suggestion list (shown when user types /) */
|
|
60374
60375
|
_suggestions = [];
|
|
60376
|
+
/** Currently highlighted suggestion index (-1 = none) */
|
|
60377
|
+
_suggestIndex = -1;
|
|
60375
60378
|
/** Callback to get available slash commands for suggestion matching */
|
|
60376
60379
|
_commandListProvider = null;
|
|
60380
|
+
/** Callback to apply a selected suggestion to the input line */
|
|
60381
|
+
_suggestApply = null;
|
|
60377
60382
|
/** Whether agent is actively processing (braille animation) */
|
|
60378
60383
|
_processing = false;
|
|
60379
60384
|
_brailleSpinner = new BrailleSpinner();
|
|
@@ -60932,6 +60937,10 @@ var init_status_bar = __esm({
|
|
|
60932
60937
|
clearTimeout(this._resizeTimer);
|
|
60933
60938
|
this._resizeTimer = null;
|
|
60934
60939
|
}
|
|
60940
|
+
if (this._processing) {
|
|
60941
|
+
this._brailleSpinner.stop();
|
|
60942
|
+
this._processing = false;
|
|
60943
|
+
}
|
|
60935
60944
|
this.stopAllMetrics();
|
|
60936
60945
|
const rows = process.stdout.rows ?? 24;
|
|
60937
60946
|
this.termWrite(`\x1B[1;${rows}r`);
|
|
@@ -60979,6 +60988,55 @@ var init_status_bar = __esm({
|
|
|
60979
60988
|
setCommandListProvider(provider) {
|
|
60980
60989
|
this._commandListProvider = provider;
|
|
60981
60990
|
}
|
|
60991
|
+
/** Set callback to apply a selected suggestion to the input line */
|
|
60992
|
+
setSuggestApply(apply) {
|
|
60993
|
+
this._suggestApply = apply;
|
|
60994
|
+
}
|
|
60995
|
+
/** Whether suggestions are currently visible */
|
|
60996
|
+
get hasSuggestions() {
|
|
60997
|
+
return this._suggestions.length > 0;
|
|
60998
|
+
}
|
|
60999
|
+
/** Move suggestion highlight up */
|
|
61000
|
+
suggestUp() {
|
|
61001
|
+
if (this._suggestions.length === 0)
|
|
61002
|
+
return;
|
|
61003
|
+
this._suggestIndex = this._suggestIndex <= 0 ? this._suggestions.length - 1 : this._suggestIndex - 1;
|
|
61004
|
+
if (this.active)
|
|
61005
|
+
this.renderFooterPreserveCursor();
|
|
61006
|
+
}
|
|
61007
|
+
/** Move suggestion highlight down */
|
|
61008
|
+
suggestDown() {
|
|
61009
|
+
if (this._suggestions.length === 0)
|
|
61010
|
+
return;
|
|
61011
|
+
this._suggestIndex = this._suggestIndex >= this._suggestions.length - 1 ? 0 : this._suggestIndex + 1;
|
|
61012
|
+
if (this.active)
|
|
61013
|
+
this.renderFooterPreserveCursor();
|
|
61014
|
+
}
|
|
61015
|
+
/** Accept the currently highlighted suggestion */
|
|
61016
|
+
suggestAccept() {
|
|
61017
|
+
if (this._suggestions.length === 0 || this._suggestIndex < 0)
|
|
61018
|
+
return false;
|
|
61019
|
+
const cmd = this._suggestions[this._suggestIndex];
|
|
61020
|
+
if (cmd && this._suggestApply) {
|
|
61021
|
+
this._suggestApply("/" + cmd + " ");
|
|
61022
|
+
this._suggestIndex = -1;
|
|
61023
|
+
return true;
|
|
61024
|
+
}
|
|
61025
|
+
return false;
|
|
61026
|
+
}
|
|
61027
|
+
/** Handle mouse click on a suggestion row */
|
|
61028
|
+
suggestClickAt(row) {
|
|
61029
|
+
const rows = process.stdout.rows ?? 24;
|
|
61030
|
+
const pos = this.rowPositions(rows);
|
|
61031
|
+
if (pos.suggestStartRow <= 0 || this._suggestions.length === 0)
|
|
61032
|
+
return false;
|
|
61033
|
+
const idx = row - pos.suggestStartRow;
|
|
61034
|
+
if (idx >= 0 && idx < this._suggestions.length) {
|
|
61035
|
+
this._suggestIndex = idx;
|
|
61036
|
+
return this.suggestAccept();
|
|
61037
|
+
}
|
|
61038
|
+
return false;
|
|
61039
|
+
}
|
|
60982
61040
|
/** Update the suggestion list based on current input. Called on every render. */
|
|
60983
61041
|
_updateSuggestions() {
|
|
60984
61042
|
if (!this.inputStateProvider || !this._commandListProvider) {
|
|
@@ -60993,6 +61051,9 @@ var init_status_bar = __esm({
|
|
|
60993
61051
|
const query = line.slice(1).toLowerCase();
|
|
60994
61052
|
const commands = this._commandListProvider();
|
|
60995
61053
|
const matches = commands.filter((c3) => c3.toLowerCase().startsWith(query)).slice(0, 5);
|
|
61054
|
+
if (matches.join(",") !== this._suggestions.join(",")) {
|
|
61055
|
+
this._suggestIndex = -1;
|
|
61056
|
+
}
|
|
60996
61057
|
this._suggestions = matches;
|
|
60997
61058
|
}
|
|
60998
61059
|
/** Cycle focus: footer → header → content → footer */
|
|
@@ -61081,6 +61142,10 @@ var init_status_bar = __esm({
|
|
|
61081
61142
|
if (!this.active)
|
|
61082
61143
|
return;
|
|
61083
61144
|
const w = process.stdout.columns ?? 80;
|
|
61145
|
+
if (type === "press" && this._suggestions.length > 0) {
|
|
61146
|
+
if (this.suggestClickAt(row))
|
|
61147
|
+
return;
|
|
61148
|
+
}
|
|
61084
61149
|
if (row < this.scrollRegionTop) {
|
|
61085
61150
|
const cmd = hitTestHeaderButton(row, col, w);
|
|
61086
61151
|
if (type === "press" && cmd) {
|
|
@@ -62091,9 +62156,13 @@ ${CONTENT_BG_SEQ}`);
|
|
|
62091
62156
|
for (let si = 0; si < this._suggestions.length; si++) {
|
|
62092
62157
|
const row = pos.suggestStartRow + si;
|
|
62093
62158
|
const cmd = this._suggestions[si];
|
|
62094
|
-
|
|
62095
|
-
|
|
62096
|
-
|
|
62159
|
+
const isHighlighted = si === this._suggestIndex;
|
|
62160
|
+
const bg = isHighlighted ? `\x1B[48;5;236m` : PANEL_BG_SEQ;
|
|
62161
|
+
const fg2 = isHighlighted ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
62162
|
+
const slash = isHighlighted ? `\x1B[38;5;245m` : `\x1B[38;5;${TEXT_DIM}m`;
|
|
62163
|
+
const marker = isHighlighted ? `\x1B[38;5;${TEXT_PRIMARY}m\u203A ` : " ";
|
|
62164
|
+
buf += `\x1B[${row};1H${bg}\x1B[2K`;
|
|
62165
|
+
buf += `${bg}${marker}${slash}/${fg2}${cmd}`;
|
|
62097
62166
|
buf += `${RESET}`;
|
|
62098
62167
|
}
|
|
62099
62168
|
} else {
|
|
@@ -62411,14 +62480,18 @@ ${CONTENT_BG_SEQ}`);
|
|
|
62411
62480
|
di.on("tab-empty", () => self.cycleFocus());
|
|
62412
62481
|
di.on("ctrl-backslash", () => self.cycleFocus());
|
|
62413
62482
|
di.on("up", () => {
|
|
62414
|
-
if (self.
|
|
62483
|
+
if (self._suggestions.length > 0) {
|
|
62484
|
+
self.suggestUp();
|
|
62485
|
+
} else if (self.writeDepth > 0 || self._contentScrollOffset > 0) {
|
|
62415
62486
|
self.scrollContentUp(1);
|
|
62416
62487
|
} else {
|
|
62417
62488
|
di.historyUp();
|
|
62418
62489
|
}
|
|
62419
62490
|
});
|
|
62420
62491
|
di.on("down", () => {
|
|
62421
|
-
if (self.
|
|
62492
|
+
if (self._suggestions.length > 0) {
|
|
62493
|
+
self.suggestDown();
|
|
62494
|
+
} else if (self.writeDepth > 0 || self._contentScrollOffset > 0) {
|
|
62422
62495
|
self.scrollContentDown(1);
|
|
62423
62496
|
} else {
|
|
62424
62497
|
di.historyDown();
|
|
@@ -62633,11 +62706,16 @@ var init_direct_input = __esm({
|
|
|
62633
62706
|
/** No-op — readline compat */
|
|
62634
62707
|
prompt(_preserveCursor) {
|
|
62635
62708
|
}
|
|
62636
|
-
/** Set the line content and cursor position (for Esc-to-recall) */
|
|
62709
|
+
/** Set the line content and cursor position (for Esc-to-recall or suggestion apply) */
|
|
62637
62710
|
setLine(text, cursorPos) {
|
|
62638
62711
|
this.line = text;
|
|
62639
62712
|
this.cursor = cursorPos ?? text.length;
|
|
62640
62713
|
}
|
|
62714
|
+
/** Pre-submit hook — called before Enter submits. Return true to consume Enter. */
|
|
62715
|
+
_preSubmit = null;
|
|
62716
|
+
setPreSubmit(hook) {
|
|
62717
|
+
this._preSubmit = hook;
|
|
62718
|
+
}
|
|
62641
62719
|
/** Navigate history up (older) */
|
|
62642
62720
|
historyUp() {
|
|
62643
62721
|
if (this._history.length === 0)
|
|
@@ -62844,6 +62922,8 @@ var init_direct_input = __esm({
|
|
|
62844
62922
|
case 13:
|
|
62845
62923
|
// Enter (CR)
|
|
62846
62924
|
case 10:
|
|
62925
|
+
if (this._preSubmit?.())
|
|
62926
|
+
return;
|
|
62847
62927
|
this._submit();
|
|
62848
62928
|
return;
|
|
62849
62929
|
case 127:
|
|
@@ -66601,6 +66681,10 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
66601
66681
|
cursor: rl.cursor ?? 0
|
|
66602
66682
|
}));
|
|
66603
66683
|
statusBar.setCommandListProvider(() => allCompletions.map((c3) => c3.startsWith("/") ? c3.slice(1) : c3));
|
|
66684
|
+
statusBar.setSuggestApply((cmd) => {
|
|
66685
|
+
rl.setLine(cmd, cmd.length);
|
|
66686
|
+
});
|
|
66687
|
+
rl.setPreSubmit(() => statusBar.suggestAccept());
|
|
66604
66688
|
}
|
|
66605
66689
|
process.stdout.on("resize", () => {
|
|
66606
66690
|
statusBar.handleResize();
|
|
@@ -67125,6 +67209,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
67125
67209
|
statusBar.deactivate();
|
|
67126
67210
|
if (carousel.isRunning)
|
|
67127
67211
|
carousel.stop();
|
|
67212
|
+
banner.stop();
|
|
67128
67213
|
voiceEngine.dispose();
|
|
67129
67214
|
if (memoryDb) {
|
|
67130
67215
|
try {
|
|
@@ -67134,6 +67219,14 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
67134
67219
|
}
|
|
67135
67220
|
rl.close();
|
|
67136
67221
|
},
|
|
67222
|
+
deactivateStatusBar() {
|
|
67223
|
+
statusBar.deactivate();
|
|
67224
|
+
},
|
|
67225
|
+
stopBanner() {
|
|
67226
|
+
banner.stop();
|
|
67227
|
+
if (carousel.isRunning)
|
|
67228
|
+
carousel.stop();
|
|
67229
|
+
},
|
|
67137
67230
|
async voiceToggle() {
|
|
67138
67231
|
const msg = await voiceEngine.toggle();
|
|
67139
67232
|
if (telegramBridge) {
|
package/package.json
CHANGED