open-agents-ai 0.122.0 → 0.124.0
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 +203 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -42426,7 +42426,24 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
42426
42426
|
installError = (stderr || err.message || "").trim();
|
|
42427
42427
|
resolve32(!err);
|
|
42428
42428
|
});
|
|
42429
|
-
child.stdout?.
|
|
42429
|
+
child.stdout?.on("data", (chunk) => {
|
|
42430
|
+
const text = String(chunk);
|
|
42431
|
+
for (const line of text.split("\n")) {
|
|
42432
|
+
if (line.trim()) {
|
|
42433
|
+
process.stdout.write(` ${c2.dim("\u2502")} ${line.trim().slice(0, 70)}
|
|
42434
|
+
`);
|
|
42435
|
+
}
|
|
42436
|
+
}
|
|
42437
|
+
});
|
|
42438
|
+
child.stderr?.on("data", (chunk) => {
|
|
42439
|
+
const text = String(chunk);
|
|
42440
|
+
for (const line of text.split("\n")) {
|
|
42441
|
+
if (line.trim() && !line.includes("npm warn")) {
|
|
42442
|
+
process.stdout.write(` ${c2.dim("\u2502")} ${c2.yellow(line.trim().slice(0, 70))}
|
|
42443
|
+
`);
|
|
42444
|
+
}
|
|
42445
|
+
}
|
|
42446
|
+
});
|
|
42430
42447
|
});
|
|
42431
42448
|
if (needsSudo) {
|
|
42432
42449
|
process.stdout.write("\x1B[?1049l");
|
|
@@ -44148,6 +44165,172 @@ var init_carousel = __esm({
|
|
|
44148
44165
|
}
|
|
44149
44166
|
});
|
|
44150
44167
|
|
|
44168
|
+
// packages/cli/dist/tui/banner.js
|
|
44169
|
+
function createDefaultBanner(version = "0.120.0") {
|
|
44170
|
+
const width = process.stdout.columns ?? 80;
|
|
44171
|
+
const rows = 3;
|
|
44172
|
+
const grid = [];
|
|
44173
|
+
const gradient = " .\xB7:;+*#\u2588";
|
|
44174
|
+
for (let r = 0; r < rows; r++) {
|
|
44175
|
+
const row = [];
|
|
44176
|
+
for (let c3 = 0; c3 < width; c3++) {
|
|
44177
|
+
const progress = c3 / width;
|
|
44178
|
+
const charIdx = Math.min(gradient.length - 1, Math.floor(progress * gradient.length));
|
|
44179
|
+
const grayColor = 232 + Math.floor(progress * 10);
|
|
44180
|
+
row.push({ char: gradient[charIdx], fg: grayColor, bg: 0, bold: false });
|
|
44181
|
+
}
|
|
44182
|
+
grid.push(row);
|
|
44183
|
+
}
|
|
44184
|
+
const versionText = `OA-${version}`;
|
|
44185
|
+
const hintText = " /cohere to engage distributed mind experiment";
|
|
44186
|
+
const fullText = versionText + hintText;
|
|
44187
|
+
const startCol = Math.max(2, Math.floor((width - fullText.length) / 2));
|
|
44188
|
+
for (let i = 0; i < versionText.length && startCol + i < width; i++) {
|
|
44189
|
+
grid[1][startCol + i] = { char: versionText[i], fg: 255, bg: 0, bold: true };
|
|
44190
|
+
}
|
|
44191
|
+
for (let i = 0; i < hintText.length && startCol + versionText.length + i < width; i++) {
|
|
44192
|
+
grid[1][startCol + versionText.length + i] = { char: hintText[i], fg: 226, bg: 0, bold: false };
|
|
44193
|
+
}
|
|
44194
|
+
return {
|
|
44195
|
+
id: "default-header",
|
|
44196
|
+
name: "OA Default Header",
|
|
44197
|
+
type: "default",
|
|
44198
|
+
frames: [{ grid, durationMs: 0 }],
|
|
44199
|
+
alignment: ["left", "center", "left"],
|
|
44200
|
+
flowSpeed: [0, 0, 0],
|
|
44201
|
+
author: "system",
|
|
44202
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
44203
|
+
};
|
|
44204
|
+
}
|
|
44205
|
+
function createCohereBanner() {
|
|
44206
|
+
const width = process.stdout.columns ?? 80;
|
|
44207
|
+
const rows = 3;
|
|
44208
|
+
const grid = [];
|
|
44209
|
+
for (let r = 0; r < rows; r++) {
|
|
44210
|
+
const row = [];
|
|
44211
|
+
for (let c3 = 0; c3 < width; c3++) {
|
|
44212
|
+
row.push({ char: " ", fg: 226, bg: 0, bold: false });
|
|
44213
|
+
}
|
|
44214
|
+
grid.push(row);
|
|
44215
|
+
}
|
|
44216
|
+
const text = "COHERE \u2014 Participating in distributed cognitive commons";
|
|
44217
|
+
const startCol = Math.max(0, Math.floor((width - text.length) / 2));
|
|
44218
|
+
for (let i = 0; i < text.length && startCol + i < width; i++) {
|
|
44219
|
+
grid[1][startCol + i] = { char: text[i], fg: 226, bg: 0, bold: true };
|
|
44220
|
+
}
|
|
44221
|
+
return {
|
|
44222
|
+
id: "cohere-default",
|
|
44223
|
+
name: "COHERE Participation",
|
|
44224
|
+
type: "cohere",
|
|
44225
|
+
frames: [{ grid, durationMs: 0 }],
|
|
44226
|
+
alignment: ["left", "center", "left"],
|
|
44227
|
+
flowSpeed: [0, 0, 0],
|
|
44228
|
+
author: "system",
|
|
44229
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
44230
|
+
};
|
|
44231
|
+
}
|
|
44232
|
+
var isTTY7, BannerRenderer;
|
|
44233
|
+
var init_banner = __esm({
|
|
44234
|
+
"packages/cli/dist/tui/banner.js"() {
|
|
44235
|
+
"use strict";
|
|
44236
|
+
isTTY7 = process.stdout.isTTY ?? false;
|
|
44237
|
+
BannerRenderer = class {
|
|
44238
|
+
currentDesign = null;
|
|
44239
|
+
currentFrame = 0;
|
|
44240
|
+
timer = null;
|
|
44241
|
+
frameTick = 0;
|
|
44242
|
+
width;
|
|
44243
|
+
rows = 3;
|
|
44244
|
+
constructor() {
|
|
44245
|
+
this.width = process.stdout.columns ?? 80;
|
|
44246
|
+
}
|
|
44247
|
+
/** Set the active banner design */
|
|
44248
|
+
setDesign(design) {
|
|
44249
|
+
this.stop();
|
|
44250
|
+
this.currentDesign = design;
|
|
44251
|
+
this.currentFrame = 0;
|
|
44252
|
+
this.frameTick = 0;
|
|
44253
|
+
this.width = process.stdout.columns ?? 80;
|
|
44254
|
+
}
|
|
44255
|
+
/** Get current design */
|
|
44256
|
+
getDesign() {
|
|
44257
|
+
return this.currentDesign;
|
|
44258
|
+
}
|
|
44259
|
+
/** Start rendering the banner */
|
|
44260
|
+
start() {
|
|
44261
|
+
if (!isTTY7 || !this.currentDesign)
|
|
44262
|
+
return;
|
|
44263
|
+
this.renderCurrentFrame();
|
|
44264
|
+
if (this.currentDesign.frames.length > 1) {
|
|
44265
|
+
this.timer = setInterval(() => {
|
|
44266
|
+
this.frameTick++;
|
|
44267
|
+
const frame = this.currentDesign.frames[this.currentFrame];
|
|
44268
|
+
if (frame.durationMs > 0 && this.frameTick * 66 >= frame.durationMs) {
|
|
44269
|
+
this.currentFrame = (this.currentFrame + 1) % this.currentDesign.frames.length;
|
|
44270
|
+
this.frameTick = 0;
|
|
44271
|
+
this.renderCurrentFrame();
|
|
44272
|
+
}
|
|
44273
|
+
}, 66);
|
|
44274
|
+
}
|
|
44275
|
+
}
|
|
44276
|
+
/** Stop rendering */
|
|
44277
|
+
stop() {
|
|
44278
|
+
if (this.timer) {
|
|
44279
|
+
clearInterval(this.timer);
|
|
44280
|
+
this.timer = null;
|
|
44281
|
+
}
|
|
44282
|
+
}
|
|
44283
|
+
/** Render the current frame into the top 3 rows */
|
|
44284
|
+
renderCurrentFrame() {
|
|
44285
|
+
if (!isTTY7 || !this.currentDesign)
|
|
44286
|
+
return;
|
|
44287
|
+
const frame = this.currentDesign.frames[this.currentFrame];
|
|
44288
|
+
if (!frame)
|
|
44289
|
+
return;
|
|
44290
|
+
this.width = process.stdout.columns ?? 80;
|
|
44291
|
+
let buf = "\x1B7";
|
|
44292
|
+
for (let r = 0; r < this.rows; r++) {
|
|
44293
|
+
buf += `\x1B[${r + 1};1H\x1B[2K`;
|
|
44294
|
+
const row = frame.grid[r];
|
|
44295
|
+
if (!row)
|
|
44296
|
+
continue;
|
|
44297
|
+
let prevFg = -1, prevBg = -1, prevBold = false;
|
|
44298
|
+
for (let c3 = 0; c3 < Math.min(this.width, row.length); c3++) {
|
|
44299
|
+
const cell = row[c3];
|
|
44300
|
+
let seq = "";
|
|
44301
|
+
if (cell.fg !== prevFg || cell.bg !== prevBg || cell.bold !== prevBold) {
|
|
44302
|
+
seq += "\x1B[0m";
|
|
44303
|
+
if (cell.bold)
|
|
44304
|
+
seq += "\x1B[1m";
|
|
44305
|
+
if (cell.fg >= 0)
|
|
44306
|
+
seq += `\x1B[38;5;${cell.fg}m`;
|
|
44307
|
+
if (cell.bg >= 0)
|
|
44308
|
+
seq += `\x1B[48;5;${cell.bg}m`;
|
|
44309
|
+
prevFg = cell.fg;
|
|
44310
|
+
prevBg = cell.bg;
|
|
44311
|
+
prevBold = cell.bold;
|
|
44312
|
+
}
|
|
44313
|
+
buf += seq + cell.char;
|
|
44314
|
+
}
|
|
44315
|
+
buf += "\x1B[0m";
|
|
44316
|
+
}
|
|
44317
|
+
buf += "\x1B8";
|
|
44318
|
+
process.stdout.write(buf);
|
|
44319
|
+
}
|
|
44320
|
+
/** Handle terminal resize */
|
|
44321
|
+
handleResize() {
|
|
44322
|
+
this.width = process.stdout.columns ?? 80;
|
|
44323
|
+
if (this.currentDesign) {
|
|
44324
|
+
if (this.currentDesign.type === "cohere") {
|
|
44325
|
+
this.currentDesign = createCohereBanner();
|
|
44326
|
+
}
|
|
44327
|
+
this.renderCurrentFrame();
|
|
44328
|
+
}
|
|
44329
|
+
}
|
|
44330
|
+
};
|
|
44331
|
+
}
|
|
44332
|
+
});
|
|
44333
|
+
|
|
44151
44334
|
// packages/cli/dist/tui/carousel-descriptors.js
|
|
44152
44335
|
import { existsSync as existsSync37, readFileSync as readFileSync26, writeFileSync as writeFileSync15, mkdirSync as mkdirSync14, readdirSync as readdirSync11 } from "node:fs";
|
|
44153
44336
|
import { join as join51, basename as basename11 } from "node:path";
|
|
@@ -44503,25 +44686,25 @@ var init_carousel_descriptors = __esm({
|
|
|
44503
44686
|
|
|
44504
44687
|
// packages/cli/dist/tui/stream-renderer.js
|
|
44505
44688
|
function fg2563(code, text) {
|
|
44506
|
-
return
|
|
44689
|
+
return isTTY8 ? `\x1B[38;5;${code}m${text}\x1B[0m` : text;
|
|
44507
44690
|
}
|
|
44508
44691
|
function dimText(text) {
|
|
44509
|
-
return
|
|
44692
|
+
return isTTY8 ? `\x1B[2m${text}\x1B[0m` : text;
|
|
44510
44693
|
}
|
|
44511
44694
|
function italicText(text) {
|
|
44512
|
-
return
|
|
44695
|
+
return isTTY8 ? `\x1B[3m${text}\x1B[0m` : text;
|
|
44513
44696
|
}
|
|
44514
44697
|
function dimItalic(text) {
|
|
44515
|
-
return
|
|
44698
|
+
return isTTY8 ? `\x1B[2;3m${text}\x1B[0m` : text;
|
|
44516
44699
|
}
|
|
44517
44700
|
function boldText(text) {
|
|
44518
|
-
return
|
|
44701
|
+
return isTTY8 ? `\x1B[1m${text}\x1B[0m` : text;
|
|
44519
44702
|
}
|
|
44520
|
-
var
|
|
44703
|
+
var isTTY8, PASTEL, StreamRenderer;
|
|
44521
44704
|
var init_stream_renderer = __esm({
|
|
44522
44705
|
"packages/cli/dist/tui/stream-renderer.js"() {
|
|
44523
44706
|
"use strict";
|
|
44524
|
-
|
|
44707
|
+
isTTY8 = process.stdout.isTTY ?? false;
|
|
44525
44708
|
PASTEL = {
|
|
44526
44709
|
key: 222,
|
|
44527
44710
|
// light gold — JSON keys
|
|
@@ -52750,6 +52933,7 @@ async function startInteractive(config, repoPath) {
|
|
|
52750
52933
|
} catch {
|
|
52751
52934
|
}
|
|
52752
52935
|
const carousel = new Carousel(carouselPhrases ?? void 0);
|
|
52936
|
+
const banner = new BannerRenderer();
|
|
52753
52937
|
let carouselLines = 0;
|
|
52754
52938
|
const version = getVersion3();
|
|
52755
52939
|
if (isResumed) {
|
|
@@ -52760,7 +52944,9 @@ async function startInteractive(config, repoPath) {
|
|
|
52760
52944
|
renderInfo(resumeMsg);
|
|
52761
52945
|
} else {
|
|
52762
52946
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
52763
|
-
|
|
52947
|
+
banner.setDesign(createDefaultBanner(version));
|
|
52948
|
+
banner.start();
|
|
52949
|
+
carouselLines = 4;
|
|
52764
52950
|
renderRichHeader({
|
|
52765
52951
|
model: config.model,
|
|
52766
52952
|
version,
|
|
@@ -53613,6 +53799,13 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
53613
53799
|
cohereToggle() {
|
|
53614
53800
|
cohereEnabled = !cohereEnabled;
|
|
53615
53801
|
statusBar.setCohereActive(cohereEnabled);
|
|
53802
|
+
if (cohereEnabled) {
|
|
53803
|
+
banner.setDesign(createCohereBanner());
|
|
53804
|
+
banner.start();
|
|
53805
|
+
} else {
|
|
53806
|
+
banner.setDesign(createDefaultBanner(version));
|
|
53807
|
+
banner.start();
|
|
53808
|
+
}
|
|
53616
53809
|
return cohereEnabled;
|
|
53617
53810
|
},
|
|
53618
53811
|
isCohere() {
|
|
@@ -55351,6 +55544,7 @@ var init_interactive = __esm({
|
|
|
55351
55544
|
init_oa_directory();
|
|
55352
55545
|
init_render();
|
|
55353
55546
|
init_carousel();
|
|
55547
|
+
init_banner();
|
|
55354
55548
|
init_carousel_descriptors();
|
|
55355
55549
|
init_voice();
|
|
55356
55550
|
init_stream_renderer();
|
package/package.json
CHANGED