open-agents-ai 0.138.92 → 0.138.94
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 +180 -103
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
39
39
|
mod
|
|
40
40
|
));
|
|
41
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
42
|
|
|
42
43
|
// packages/cli/dist/config.js
|
|
43
44
|
import { readFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
@@ -46311,9 +46312,25 @@ var init_banner = __esm({
|
|
|
46311
46312
|
rows = 3;
|
|
46312
46313
|
/** Callback fired after every frame render — used for header button overlay */
|
|
46313
46314
|
onAfterRender = null;
|
|
46315
|
+
/** When set, the version text on row 1 becomes a pulsing UPDATE button */
|
|
46316
|
+
_updateAvailable = null;
|
|
46317
|
+
/** Global frame counter for pulse animation (survives frame resets) */
|
|
46318
|
+
_pulseFrame = 0;
|
|
46314
46319
|
constructor() {
|
|
46315
46320
|
this.width = process.stdout.columns ?? 80;
|
|
46316
46321
|
}
|
|
46322
|
+
/** Signal that an update is available — enables pulsing UPDATE badge on row 1 */
|
|
46323
|
+
setUpdateAvailable(latestVersion) {
|
|
46324
|
+
this._updateAvailable = latestVersion;
|
|
46325
|
+
}
|
|
46326
|
+
/** Clear the update notification (after updating) */
|
|
46327
|
+
clearUpdateAvailable() {
|
|
46328
|
+
this._updateAvailable = null;
|
|
46329
|
+
}
|
|
46330
|
+
/** Whether an update badge is showing */
|
|
46331
|
+
get hasUpdate() {
|
|
46332
|
+
return this._updateAvailable !== null;
|
|
46333
|
+
}
|
|
46317
46334
|
/** Set the active banner design */
|
|
46318
46335
|
setDesign(design) {
|
|
46319
46336
|
this.stop();
|
|
@@ -46416,6 +46433,33 @@ var init_banner = __esm({
|
|
|
46416
46433
|
buf += "\x1B]8;;\x07";
|
|
46417
46434
|
}
|
|
46418
46435
|
}
|
|
46436
|
+
if (this._updateAvailable && this.currentDesign?.type === "default") {
|
|
46437
|
+
this._pulseFrame++;
|
|
46438
|
+
const t = (Math.sin(this._pulseFrame * 0.16) + 1) / 2;
|
|
46439
|
+
const ramp = [240, 241, 243, 245, 247, 249, 180, 178];
|
|
46440
|
+
const versionIdx = Math.round(t * (ramp.length - 1));
|
|
46441
|
+
const updateIdx = Math.round((1 - t) * (ramp.length - 1));
|
|
46442
|
+
const versionFg = ramp[versionIdx];
|
|
46443
|
+
const updateFg = ramp[updateIdx];
|
|
46444
|
+
const bgDark = 234;
|
|
46445
|
+
const vText = this.currentDesign.frames[0]?.grid[0]?.filter((c3) => c3.bold && (c3.fg === 178 || c3.fg === 226)).map((c3) => c3.char).join("") || "";
|
|
46446
|
+
const vStart = 3;
|
|
46447
|
+
const vLen = vText.length || 10;
|
|
46448
|
+
buf += `\x1B[1;${vStart}H\x1B[1;38;5;${versionFg}m\x1B[48;5;${bgDark}m`;
|
|
46449
|
+
for (let c3 = vStart - 1; c3 < vStart - 1 + vLen && c3 < this.width; c3++) {
|
|
46450
|
+
const cell = frame.grid[0]?.[c3];
|
|
46451
|
+
if (cell)
|
|
46452
|
+
buf += cell.char;
|
|
46453
|
+
}
|
|
46454
|
+
const badge = " UPDATE ";
|
|
46455
|
+
const badgeStart = vStart + vLen;
|
|
46456
|
+
if (badgeStart + badge.length < this.width) {
|
|
46457
|
+
buf += `\x1B]8;;oa-cmd:/update\x07`;
|
|
46458
|
+
buf += `\x1B[1;${badgeStart}H\x1B[1;38;5;${updateFg}m\x1B[48;5;236m${badge}`;
|
|
46459
|
+
buf += `\x1B]8;;\x07`;
|
|
46460
|
+
}
|
|
46461
|
+
buf += "\x1B[0m";
|
|
46462
|
+
}
|
|
46419
46463
|
buf += "\x1B8";
|
|
46420
46464
|
process.stdout.write(buf);
|
|
46421
46465
|
if (this.onAfterRender)
|
|
@@ -52319,6 +52363,21 @@ var init_system_metrics = __esm({
|
|
|
52319
52363
|
});
|
|
52320
52364
|
|
|
52321
52365
|
// packages/cli/dist/tui/text-selection.js
|
|
52366
|
+
var text_selection_exports = {};
|
|
52367
|
+
__export(text_selection_exports, {
|
|
52368
|
+
SEL_END: () => SEL_END,
|
|
52369
|
+
SEL_START: () => SEL_START,
|
|
52370
|
+
TextSelection: () => TextSelection,
|
|
52371
|
+
computeHeaderButtons: () => computeHeaderButtons,
|
|
52372
|
+
copyText: () => copyText,
|
|
52373
|
+
hitTestHeaderButton: () => hitTestHeaderButton,
|
|
52374
|
+
renderHeaderButtons: () => renderHeaderButtons,
|
|
52375
|
+
setHoveredButton: () => setHoveredButton,
|
|
52376
|
+
setPressedButton: () => setPressedButton,
|
|
52377
|
+
setUpdateBadgeRegion: () => setUpdateBadgeRegion,
|
|
52378
|
+
stripAnsi: () => stripAnsi3,
|
|
52379
|
+
visibleLength: () => visibleLength
|
|
52380
|
+
});
|
|
52322
52381
|
import { execSync as execSync29 } from "node:child_process";
|
|
52323
52382
|
function stripAnsi3(s) {
|
|
52324
52383
|
return s.replace(/\x1B\[[0-9;]*[A-Za-z]|\x1B\].*?(?:\x07|\x1B\\)/g, "");
|
|
@@ -52410,7 +52469,15 @@ function renderHeaderButtons(termWidth) {
|
|
|
52410
52469
|
}
|
|
52411
52470
|
return out;
|
|
52412
52471
|
}
|
|
52472
|
+
function setUpdateBadgeRegion(active, startCol, length) {
|
|
52473
|
+
_updateBadgeActive = active;
|
|
52474
|
+
_updateBadgeCol = startCol;
|
|
52475
|
+
_updateBadgeLen = length;
|
|
52476
|
+
}
|
|
52413
52477
|
function hitTestHeaderButton(row, col, termWidth) {
|
|
52478
|
+
if (_updateBadgeActive && row === 1 && col >= _updateBadgeCol && col < _updateBadgeCol + _updateBadgeLen) {
|
|
52479
|
+
return "/update";
|
|
52480
|
+
}
|
|
52414
52481
|
const buttons = computeHeaderButtons(termWidth);
|
|
52415
52482
|
for (const btn of buttons) {
|
|
52416
52483
|
if (row === btn.row && col >= btn.startCol && col <= btn.endCol) {
|
|
@@ -52419,7 +52486,7 @@ function hitTestHeaderButton(row, col, termWidth) {
|
|
|
52419
52486
|
}
|
|
52420
52487
|
return null;
|
|
52421
52488
|
}
|
|
52422
|
-
var SEL_BG, SEL_FG, SEL_START, SEL_END, TextSelection, _hoveredButtonCmd, _pressedButtonCmd, BTN_REST_BG, BTN_REST_FG, BTN_HOVER_BG, BTN_HOVER_FG, BTN_PRESS_BG, BTN_PRESS_FG;
|
|
52489
|
+
var SEL_BG, SEL_FG, SEL_START, SEL_END, TextSelection, _hoveredButtonCmd, _pressedButtonCmd, BTN_REST_BG, BTN_REST_FG, BTN_HOVER_BG, BTN_HOVER_FG, BTN_PRESS_BG, BTN_PRESS_FG, _updateBadgeActive, _updateBadgeCol, _updateBadgeLen;
|
|
52423
52490
|
var init_text_selection = __esm({
|
|
52424
52491
|
"packages/cli/dist/tui/text-selection.js"() {
|
|
52425
52492
|
"use strict";
|
|
@@ -52630,6 +52697,9 @@ var init_text_selection = __esm({
|
|
|
52630
52697
|
BTN_HOVER_FG = 252;
|
|
52631
52698
|
BTN_PRESS_BG = 249;
|
|
52632
52699
|
BTN_PRESS_FG = 234;
|
|
52700
|
+
_updateBadgeActive = false;
|
|
52701
|
+
_updateBadgeCol = 0;
|
|
52702
|
+
_updateBadgeLen = 0;
|
|
52633
52703
|
}
|
|
52634
52704
|
});
|
|
52635
52705
|
|
|
@@ -54475,120 +54545,123 @@ ${CONTENT_BG_SEQ}`);
|
|
|
54475
54545
|
let sawEscape = false;
|
|
54476
54546
|
let sawEscapeTime = 0;
|
|
54477
54547
|
rl._ttyWrite = function(s, key) {
|
|
54478
|
-
|
|
54479
|
-
|
|
54480
|
-
|
|
54481
|
-
|
|
54482
|
-
|
|
54548
|
+
try {
|
|
54549
|
+
if (!self.active)
|
|
54550
|
+
return origTtyWrite(s, key);
|
|
54551
|
+
if (key?.name === "backspace" && self.inputStateProvider) {
|
|
54552
|
+
const { cursor = 0 } = self.inputStateProvider() ?? {};
|
|
54553
|
+
if (cursor <= 0)
|
|
54554
|
+
return;
|
|
54555
|
+
}
|
|
54556
|
+
if (key?.ctrl && key?.name === "o" && onCtrlO) {
|
|
54557
|
+
onCtrlO();
|
|
54483
54558
|
return;
|
|
54484
|
-
|
|
54485
|
-
|
|
54486
|
-
|
|
54487
|
-
return;
|
|
54488
|
-
}
|
|
54489
|
-
if (key?.ctrl && key?.shift && key?.name === "c") {
|
|
54490
|
-
self.copySelection();
|
|
54491
|
-
return;
|
|
54492
|
-
}
|
|
54493
|
-
if (s === "\x1B[67;6u") {
|
|
54494
|
-
self.copySelection();
|
|
54495
|
-
return;
|
|
54496
|
-
}
|
|
54497
|
-
if (key?.ctrl && key?.shift && key?.name === "b") {
|
|
54498
|
-
self.armBlockSelection();
|
|
54499
|
-
return;
|
|
54500
|
-
}
|
|
54501
|
-
if (s === "\x1B[66;6u") {
|
|
54502
|
-
self.armBlockSelection();
|
|
54503
|
-
return;
|
|
54504
|
-
}
|
|
54505
|
-
if (s && (/\x1B\[</.test(s) || /^\d+;\d+;\d*[Mm]/.test(s) || /^;\d+[Mm]/.test(s) || /\[<\d/.test(s))) {
|
|
54506
|
-
return;
|
|
54507
|
-
}
|
|
54508
|
-
if (key?.name === "escape" || s === "\x1B") {
|
|
54509
|
-
sawEscape = true;
|
|
54510
|
-
sawEscapeTime = Date.now();
|
|
54511
|
-
if (onEscape && s.length === 1)
|
|
54512
|
-
onEscape();
|
|
54513
|
-
return;
|
|
54514
|
-
}
|
|
54515
|
-
if (sawEscape && Date.now() - sawEscapeTime < 100) {
|
|
54516
|
-
sawEscape = false;
|
|
54517
|
-
if (s === "[A" || s === "[B") {
|
|
54518
|
-
if (s === "[A")
|
|
54519
|
-
self.scrollContentUp(1);
|
|
54520
|
-
else
|
|
54521
|
-
self.scrollContentDown(1);
|
|
54559
|
+
}
|
|
54560
|
+
if (key?.ctrl && key?.shift && key?.name === "c") {
|
|
54561
|
+
self.copySelection();
|
|
54522
54562
|
return;
|
|
54523
54563
|
}
|
|
54524
|
-
if (s === "[
|
|
54525
|
-
|
|
54526
|
-
self.pageUpContent();
|
|
54527
|
-
else
|
|
54528
|
-
self.pageDownContent();
|
|
54564
|
+
if (s === "\x1B[67;6u") {
|
|
54565
|
+
self.copySelection();
|
|
54529
54566
|
return;
|
|
54530
54567
|
}
|
|
54531
|
-
if (
|
|
54568
|
+
if (key?.ctrl && key?.shift && key?.name === "b") {
|
|
54569
|
+
self.armBlockSelection();
|
|
54532
54570
|
return;
|
|
54533
|
-
|
|
54534
|
-
|
|
54535
|
-
|
|
54536
|
-
if (self.writeDepth > 0) {
|
|
54537
|
-
if (key.name === "up")
|
|
54538
|
-
self.scrollContentUp(1);
|
|
54539
|
-
else
|
|
54540
|
-
self.scrollContentDown(1);
|
|
54571
|
+
}
|
|
54572
|
+
if (s === "\x1B[66;6u") {
|
|
54573
|
+
self.armBlockSelection();
|
|
54541
54574
|
return;
|
|
54542
54575
|
}
|
|
54543
|
-
if (
|
|
54544
|
-
if (key.name === "up")
|
|
54545
|
-
self.scrollContentUp(1);
|
|
54546
|
-
else
|
|
54547
|
-
self.scrollContentDown(1);
|
|
54576
|
+
if (s && (/\x1B\[</.test(s) || /^\d+;\d+;\d*[Mm]/.test(s) || /^;\d+[Mm]/.test(s) || /\[<\d/.test(s))) {
|
|
54548
54577
|
return;
|
|
54549
54578
|
}
|
|
54550
|
-
|
|
54551
|
-
|
|
54552
|
-
|
|
54553
|
-
|
|
54554
|
-
|
|
54555
|
-
|
|
54556
|
-
|
|
54557
|
-
|
|
54558
|
-
|
|
54559
|
-
|
|
54560
|
-
|
|
54561
|
-
|
|
54562
|
-
|
|
54563
|
-
|
|
54564
|
-
|
|
54565
|
-
|
|
54566
|
-
|
|
54567
|
-
|
|
54568
|
-
|
|
54569
|
-
|
|
54579
|
+
if (key?.name === "escape" || s === "\x1B") {
|
|
54580
|
+
sawEscape = true;
|
|
54581
|
+
sawEscapeTime = Date.now();
|
|
54582
|
+
if (onEscape && s.length === 1)
|
|
54583
|
+
onEscape();
|
|
54584
|
+
return;
|
|
54585
|
+
}
|
|
54586
|
+
if (sawEscape && Date.now() - sawEscapeTime < 100) {
|
|
54587
|
+
sawEscape = false;
|
|
54588
|
+
if (s === "[A" || s === "[B") {
|
|
54589
|
+
if (s === "[A")
|
|
54590
|
+
self.scrollContentUp(1);
|
|
54591
|
+
else
|
|
54592
|
+
self.scrollContentDown(1);
|
|
54593
|
+
return;
|
|
54594
|
+
}
|
|
54595
|
+
if (s === "[5~" || s === "[6~") {
|
|
54596
|
+
if (s === "[5~")
|
|
54597
|
+
self.pageUpContent();
|
|
54598
|
+
else
|
|
54599
|
+
self.pageDownContent();
|
|
54600
|
+
return;
|
|
54601
|
+
}
|
|
54602
|
+
if (s.startsWith("["))
|
|
54603
|
+
return;
|
|
54604
|
+
}
|
|
54605
|
+
sawEscape = false;
|
|
54606
|
+
if (key?.name === "up" || key?.name === "down") {
|
|
54607
|
+
if (self.writeDepth > 0) {
|
|
54608
|
+
if (key.name === "up")
|
|
54609
|
+
self.scrollContentUp(1);
|
|
54610
|
+
else
|
|
54611
|
+
self.scrollContentDown(1);
|
|
54612
|
+
return;
|
|
54613
|
+
}
|
|
54614
|
+
if (self._contentScrollOffset > 0) {
|
|
54615
|
+
if (key.name === "up")
|
|
54616
|
+
self.scrollContentUp(1);
|
|
54617
|
+
else
|
|
54618
|
+
self.scrollContentDown(1);
|
|
54619
|
+
return;
|
|
54620
|
+
}
|
|
54621
|
+
return origTtyWrite(s, key);
|
|
54622
|
+
}
|
|
54623
|
+
if (key?.name === "pageup" || s === "\x1B[5~") {
|
|
54624
|
+
self.pageUpContent();
|
|
54570
54625
|
return;
|
|
54571
|
-
|
|
54626
|
+
}
|
|
54627
|
+
if (key?.name === "pagedown" || s === "\x1B[6~") {
|
|
54628
|
+
self.pageDownContent();
|
|
54572
54629
|
return;
|
|
54573
|
-
|
|
54574
|
-
|
|
54630
|
+
}
|
|
54631
|
+
if (key?.shift && key?.name === "up" || s === "\x1B[1;2A") {
|
|
54632
|
+
self.scrollContentUp(3);
|
|
54633
|
+
return;
|
|
54634
|
+
}
|
|
54635
|
+
if (key?.shift && key?.name === "down" || s === "\x1B[1;2B") {
|
|
54636
|
+
self.scrollContentDown(3);
|
|
54637
|
+
return;
|
|
54638
|
+
}
|
|
54639
|
+
if (self.writeDepth > 0) {
|
|
54640
|
+
if (s && (s.startsWith("\x1B") || s.startsWith("[")))
|
|
54641
|
+
return;
|
|
54642
|
+
if (key?.name === "escape")
|
|
54643
|
+
return;
|
|
54644
|
+
origTtyWrite(s, key);
|
|
54645
|
+
return;
|
|
54646
|
+
}
|
|
54647
|
+
if (self.inputStateProvider && (key?.name !== "return" && key?.name !== "enter" && key?.name !== "backspace")) {
|
|
54648
|
+
const { line = "" } = self.inputStateProvider() ?? {};
|
|
54649
|
+
const w = getTermWidth();
|
|
54650
|
+
const avail = Math.max(1, w - self.promptWidth);
|
|
54651
|
+
const currentLines = Math.ceil(Math.max(1, line.length) / avail);
|
|
54652
|
+
const nextLines = Math.ceil((line.length + 1) / avail);
|
|
54653
|
+
if (nextLines > currentLines) {
|
|
54654
|
+
self.updateFooterHeight();
|
|
54655
|
+
const rows = process.stdout.rows ?? 24;
|
|
54656
|
+
const pos = self.rowPositions(rows);
|
|
54657
|
+
const writer = self._origWrite ?? process.stdout.write.bind(process.stdout);
|
|
54658
|
+
writer(`\x1B[${self.scrollRegionTop};${pos.scrollEnd}r`);
|
|
54659
|
+
self.renderFooterAndPositionInput();
|
|
54660
|
+
}
|
|
54661
|
+
}
|
|
54662
|
+
return origTtyWrite(s, key);
|
|
54663
|
+
} catch {
|
|
54575
54664
|
}
|
|
54576
|
-
if (self.inputStateProvider && (key?.name !== "return" && key?.name !== "enter" && key?.name !== "backspace")) {
|
|
54577
|
-
const { line = "" } = self.inputStateProvider() ?? {};
|
|
54578
|
-
const w = getTermWidth();
|
|
54579
|
-
const avail = Math.max(1, w - self.promptWidth);
|
|
54580
|
-
const currentLines = Math.ceil(Math.max(1, line.length) / avail);
|
|
54581
|
-
const nextLines = Math.ceil((line.length + 1) / avail);
|
|
54582
|
-
if (nextLines > currentLines) {
|
|
54583
|
-
self.updateFooterHeight();
|
|
54584
|
-
const rows = process.stdout.rows ?? 24;
|
|
54585
|
-
const pos = self.rowPositions(rows);
|
|
54586
|
-
const writer = self._origWrite ?? process.stdout.write.bind(process.stdout);
|
|
54587
|
-
writer(`\x1B[${self.scrollRegionTop};${pos.scrollEnd}r`);
|
|
54588
|
-
self.renderFooterAndPositionInput();
|
|
54589
|
-
}
|
|
54590
|
-
}
|
|
54591
|
-
return origTtyWrite(s, key);
|
|
54592
54665
|
};
|
|
54593
54666
|
}
|
|
54594
54667
|
hookStdin() {
|
|
@@ -56214,6 +56287,10 @@ async function startInteractive(config, repoPath) {
|
|
|
56214
56287
|
if (!isResumed) {
|
|
56215
56288
|
checkForUpdate(version).then((updateInfo) => {
|
|
56216
56289
|
if (updateInfo) {
|
|
56290
|
+
banner.setUpdateAvailable(updateInfo.latestVersion);
|
|
56291
|
+
const vTextLen = ` OA v${version}`.length;
|
|
56292
|
+
const { setUpdateBadgeRegion: setUpdateBadgeRegion2 } = (init_text_selection(), __toCommonJS(text_selection_exports));
|
|
56293
|
+
setUpdateBadgeRegion2(true, vTextLen + 1, " UPDATE ".length);
|
|
56217
56294
|
const writeMsg = () => {
|
|
56218
56295
|
if (statusBar?.isActive && statusBar.isStreaming) {
|
|
56219
56296
|
setTimeout(writeMsg, 3e3);
|
|
@@ -56222,7 +56299,7 @@ async function startInteractive(config, repoPath) {
|
|
|
56222
56299
|
updateNotified = true;
|
|
56223
56300
|
if (statusBar?.isActive)
|
|
56224
56301
|
statusBar.beginContentWrite();
|
|
56225
|
-
renderInfo(`Update available: v${updateInfo.currentVersion} \u2192 v${c2.bold(c2.green(updateInfo.latestVersion))}.
|
|
56302
|
+
renderInfo(`Update available: v${updateInfo.currentVersion} \u2192 v${c2.bold(c2.green(updateInfo.latestVersion))}. Click UPDATE in header or run /update.`);
|
|
56226
56303
|
if (statusBar?.isActive)
|
|
56227
56304
|
statusBar.endContentWrite();
|
|
56228
56305
|
};
|
package/package.json
CHANGED