open-agents-ai 0.138.91 → 0.138.93
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 +86 -6
- 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";
|
|
@@ -22868,8 +22869,12 @@ If you're stuck, try a completely different approach. Do NOT repeat what failed
|
|
|
22868
22869
|
break;
|
|
22869
22870
|
}
|
|
22870
22871
|
}
|
|
22871
|
-
|
|
22872
|
-
|
|
22872
|
+
this.emit({
|
|
22873
|
+
type: "error",
|
|
22874
|
+
content: `Backend unavailable \u2014 stopping task. Fix the issue and retry.`,
|
|
22875
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
22876
|
+
});
|
|
22877
|
+
break;
|
|
22873
22878
|
}
|
|
22874
22879
|
response = recovered;
|
|
22875
22880
|
}
|
|
@@ -23407,8 +23412,8 @@ Integrate this guidance into your current approach. Continue working on the task
|
|
|
23407
23412
|
const errMsg2 = reqErr instanceof Error ? reqErr.message : String(reqErr);
|
|
23408
23413
|
const cause2 = reqErr instanceof Error && reqErr.cause ? ` (${reqErr.cause.message ?? ""} ${reqErr.cause?.code ?? ""})` : "";
|
|
23409
23414
|
this.emit({ type: "error", content: `Backend error: ${errMsg2}${cause2}`, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
23410
|
-
|
|
23411
|
-
|
|
23415
|
+
this.emit({ type: "error", content: `Backend unavailable \u2014 stopping task.`, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
23416
|
+
break;
|
|
23412
23417
|
}
|
|
23413
23418
|
response = recovered;
|
|
23414
23419
|
}
|
|
@@ -24717,6 +24722,8 @@ ${transcript}`
|
|
|
24717
24722
|
if (err instanceof Error && err.fatal)
|
|
24718
24723
|
return false;
|
|
24719
24724
|
const msg = err instanceof Error ? err.message : String(err);
|
|
24725
|
+
if (/HTTP 429|429 Too Many|rate.?limit|too many requests/i.test(msg))
|
|
24726
|
+
return true;
|
|
24720
24727
|
if (/Backend HTTP (502|503|504)/i.test(msg))
|
|
24721
24728
|
return true;
|
|
24722
24729
|
if (/fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EPIPE|socket hang up/i.test(msg))
|
|
@@ -46305,9 +46312,25 @@ var init_banner = __esm({
|
|
|
46305
46312
|
rows = 3;
|
|
46306
46313
|
/** Callback fired after every frame render — used for header button overlay */
|
|
46307
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;
|
|
46308
46319
|
constructor() {
|
|
46309
46320
|
this.width = process.stdout.columns ?? 80;
|
|
46310
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
|
+
}
|
|
46311
46334
|
/** Set the active banner design */
|
|
46312
46335
|
setDesign(design) {
|
|
46313
46336
|
this.stop();
|
|
@@ -46410,6 +46433,33 @@ var init_banner = __esm({
|
|
|
46410
46433
|
buf += "\x1B]8;;\x07";
|
|
46411
46434
|
}
|
|
46412
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
|
+
}
|
|
46413
46463
|
buf += "\x1B8";
|
|
46414
46464
|
process.stdout.write(buf);
|
|
46415
46465
|
if (this.onAfterRender)
|
|
@@ -52313,6 +52363,21 @@ var init_system_metrics = __esm({
|
|
|
52313
52363
|
});
|
|
52314
52364
|
|
|
52315
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
|
+
});
|
|
52316
52381
|
import { execSync as execSync29 } from "node:child_process";
|
|
52317
52382
|
function stripAnsi3(s) {
|
|
52318
52383
|
return s.replace(/\x1B\[[0-9;]*[A-Za-z]|\x1B\].*?(?:\x07|\x1B\\)/g, "");
|
|
@@ -52404,7 +52469,15 @@ function renderHeaderButtons(termWidth) {
|
|
|
52404
52469
|
}
|
|
52405
52470
|
return out;
|
|
52406
52471
|
}
|
|
52472
|
+
function setUpdateBadgeRegion(active, startCol, length) {
|
|
52473
|
+
_updateBadgeActive = active;
|
|
52474
|
+
_updateBadgeCol = startCol;
|
|
52475
|
+
_updateBadgeLen = length;
|
|
52476
|
+
}
|
|
52407
52477
|
function hitTestHeaderButton(row, col, termWidth) {
|
|
52478
|
+
if (_updateBadgeActive && row === 1 && col >= _updateBadgeCol && col < _updateBadgeCol + _updateBadgeLen) {
|
|
52479
|
+
return "/update";
|
|
52480
|
+
}
|
|
52408
52481
|
const buttons = computeHeaderButtons(termWidth);
|
|
52409
52482
|
for (const btn of buttons) {
|
|
52410
52483
|
if (row === btn.row && col >= btn.startCol && col <= btn.endCol) {
|
|
@@ -52413,7 +52486,7 @@ function hitTestHeaderButton(row, col, termWidth) {
|
|
|
52413
52486
|
}
|
|
52414
52487
|
return null;
|
|
52415
52488
|
}
|
|
52416
|
-
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;
|
|
52417
52490
|
var init_text_selection = __esm({
|
|
52418
52491
|
"packages/cli/dist/tui/text-selection.js"() {
|
|
52419
52492
|
"use strict";
|
|
@@ -52624,6 +52697,9 @@ var init_text_selection = __esm({
|
|
|
52624
52697
|
BTN_HOVER_FG = 252;
|
|
52625
52698
|
BTN_PRESS_BG = 249;
|
|
52626
52699
|
BTN_PRESS_FG = 234;
|
|
52700
|
+
_updateBadgeActive = false;
|
|
52701
|
+
_updateBadgeCol = 0;
|
|
52702
|
+
_updateBadgeLen = 0;
|
|
52627
52703
|
}
|
|
52628
52704
|
});
|
|
52629
52705
|
|
|
@@ -56208,6 +56284,10 @@ async function startInteractive(config, repoPath) {
|
|
|
56208
56284
|
if (!isResumed) {
|
|
56209
56285
|
checkForUpdate(version).then((updateInfo) => {
|
|
56210
56286
|
if (updateInfo) {
|
|
56287
|
+
banner.setUpdateAvailable(updateInfo.latestVersion);
|
|
56288
|
+
const vTextLen = ` OA v${version}`.length;
|
|
56289
|
+
const { setUpdateBadgeRegion: setUpdateBadgeRegion2 } = (init_text_selection(), __toCommonJS(text_selection_exports));
|
|
56290
|
+
setUpdateBadgeRegion2(true, vTextLen + 1, " UPDATE ".length);
|
|
56211
56291
|
const writeMsg = () => {
|
|
56212
56292
|
if (statusBar?.isActive && statusBar.isStreaming) {
|
|
56213
56293
|
setTimeout(writeMsg, 3e3);
|
|
@@ -56216,7 +56296,7 @@ async function startInteractive(config, repoPath) {
|
|
|
56216
56296
|
updateNotified = true;
|
|
56217
56297
|
if (statusBar?.isActive)
|
|
56218
56298
|
statusBar.beginContentWrite();
|
|
56219
|
-
renderInfo(`Update available: v${updateInfo.currentVersion} \u2192 v${c2.bold(c2.green(updateInfo.latestVersion))}.
|
|
56299
|
+
renderInfo(`Update available: v${updateInfo.currentVersion} \u2192 v${c2.bold(c2.green(updateInfo.latestVersion))}. Click UPDATE in header or run /update.`);
|
|
56220
56300
|
if (statusBar?.isActive)
|
|
56221
56301
|
statusBar.endContentWrite();
|
|
56222
56302
|
};
|
package/package.json
CHANGED