open-agents-ai 0.103.99 → 0.104.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 +90 -30
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33610,6 +33610,45 @@ var init_setup = __esm({
|
|
|
33610
33610
|
}
|
|
33611
33611
|
});
|
|
33612
33612
|
|
|
33613
|
+
// packages/cli/dist/tui/overlay-lock.js
|
|
33614
|
+
function isOverlayActive() {
|
|
33615
|
+
return _overlayActive;
|
|
33616
|
+
}
|
|
33617
|
+
function bufferIfOverlay(stream, data) {
|
|
33618
|
+
if (!_overlayActive)
|
|
33619
|
+
return false;
|
|
33620
|
+
_buffer.push({ stream, data });
|
|
33621
|
+
return true;
|
|
33622
|
+
}
|
|
33623
|
+
function enterOverlay() {
|
|
33624
|
+
_depth++;
|
|
33625
|
+
_overlayActive = true;
|
|
33626
|
+
}
|
|
33627
|
+
function leaveOverlay() {
|
|
33628
|
+
_depth = Math.max(0, _depth - 1);
|
|
33629
|
+
if (_depth === 0) {
|
|
33630
|
+
_overlayActive = false;
|
|
33631
|
+
const pending = _buffer;
|
|
33632
|
+
_buffer = [];
|
|
33633
|
+
for (const { stream, data } of pending) {
|
|
33634
|
+
if (stream === "stdout") {
|
|
33635
|
+
process.stdout.write(data);
|
|
33636
|
+
} else {
|
|
33637
|
+
process.stderr.write(data);
|
|
33638
|
+
}
|
|
33639
|
+
}
|
|
33640
|
+
}
|
|
33641
|
+
}
|
|
33642
|
+
var _overlayActive, _depth, _buffer;
|
|
33643
|
+
var init_overlay_lock = __esm({
|
|
33644
|
+
"packages/cli/dist/tui/overlay-lock.js"() {
|
|
33645
|
+
"use strict";
|
|
33646
|
+
_overlayActive = false;
|
|
33647
|
+
_depth = 0;
|
|
33648
|
+
_buffer = [];
|
|
33649
|
+
}
|
|
33650
|
+
});
|
|
33651
|
+
|
|
33613
33652
|
// packages/cli/dist/tui/tui-select.js
|
|
33614
33653
|
function ansi3(code, text) {
|
|
33615
33654
|
return isTTY3 ? `\x1B[${code}m${text}\x1B[0m` : text;
|
|
@@ -33704,6 +33743,7 @@ function tuiSelect(opts) {
|
|
|
33704
33743
|
}
|
|
33705
33744
|
stdin.resume();
|
|
33706
33745
|
process.stdout.write("\x1B[?1049h\x1B[2J\x1B[H\x1B[?25l");
|
|
33746
|
+
enterOverlay();
|
|
33707
33747
|
function clampScroll(displayList) {
|
|
33708
33748
|
const cursorPos = displayList.indexOf(cursor);
|
|
33709
33749
|
if (cursorPos < 0)
|
|
@@ -33797,6 +33837,7 @@ function tuiSelect(opts) {
|
|
|
33797
33837
|
function cleanup() {
|
|
33798
33838
|
stdin.removeListener("data", onData);
|
|
33799
33839
|
process.stdout.removeListener("resize", onResize);
|
|
33840
|
+
leaveOverlay();
|
|
33800
33841
|
process.stdout.write("\x1B[?1049l\x1B[?25h");
|
|
33801
33842
|
if (typeof stdin.setRawMode === "function") {
|
|
33802
33843
|
stdin.setRawMode(hadRawMode ?? false);
|
|
@@ -34052,6 +34093,7 @@ var isTTY3, selectColors;
|
|
|
34052
34093
|
var init_tui_select = __esm({
|
|
34053
34094
|
"packages/cli/dist/tui/tui-select.js"() {
|
|
34054
34095
|
"use strict";
|
|
34096
|
+
init_overlay_lock();
|
|
34055
34097
|
isTTY3 = process.stdout.isTTY ?? false;
|
|
34056
34098
|
selectColors = {
|
|
34057
34099
|
orange: (t) => fg2562(208, t),
|
|
@@ -34094,6 +34136,7 @@ function showDropPanel(opts) {
|
|
|
34094
34136
|
}
|
|
34095
34137
|
stdin.resume();
|
|
34096
34138
|
process.stdout.write("\x1B[?1049h\x1B[2J\x1B[H\x1B[?25h");
|
|
34139
|
+
enterOverlay();
|
|
34097
34140
|
let inputBuf = "";
|
|
34098
34141
|
let errorMsg = "";
|
|
34099
34142
|
function render() {
|
|
@@ -34137,6 +34180,7 @@ function showDropPanel(opts) {
|
|
|
34137
34180
|
}
|
|
34138
34181
|
function cleanup() {
|
|
34139
34182
|
stdin.removeListener("data", onData);
|
|
34183
|
+
leaveOverlay();
|
|
34140
34184
|
process.stdout.write("\x1B[?1049l\x1B[?25h");
|
|
34141
34185
|
if (typeof stdin.setRawMode === "function") {
|
|
34142
34186
|
stdin.setRawMode(hadRawMode ?? false);
|
|
@@ -34212,6 +34256,7 @@ var isTTY4, dc;
|
|
|
34212
34256
|
var init_drop_panel = __esm({
|
|
34213
34257
|
"packages/cli/dist/tui/drop-panel.js"() {
|
|
34214
34258
|
"use strict";
|
|
34259
|
+
init_overlay_lock();
|
|
34215
34260
|
isTTY4 = process.stdout.isTTY ?? false;
|
|
34216
34261
|
dc = {
|
|
34217
34262
|
bold: (t) => ansi4("1", t),
|
|
@@ -37180,9 +37225,7 @@ async function handleSlashCommand(input, ctx) {
|
|
|
37180
37225
|
return "handled";
|
|
37181
37226
|
}
|
|
37182
37227
|
if (arg === "list" || arg === "ls" || arg === "voices") {
|
|
37183
|
-
ctx.setOverlayActive?.(true);
|
|
37184
37228
|
await handleVoiceList(ctx);
|
|
37185
|
-
ctx.setOverlayActive?.(false);
|
|
37186
37229
|
return "handled";
|
|
37187
37230
|
}
|
|
37188
37231
|
const msg = await ctx.voiceSetModel(arg);
|
|
@@ -38268,7 +38311,6 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38268
38311
|
{ key: "clone", label: "Clone Voice", detail: "drag & drop audio file" },
|
|
38269
38312
|
{ key: "list", label: "Manage Clone Voices", detail: "rename, play, delete" }
|
|
38270
38313
|
];
|
|
38271
|
-
ctx.setOverlayActive?.(true);
|
|
38272
38314
|
const result = await tuiSelect({
|
|
38273
38315
|
items,
|
|
38274
38316
|
title: "Voice Configuration",
|
|
@@ -38276,7 +38318,6 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38276
38318
|
availableRows: ctx.availableContentRows?.(),
|
|
38277
38319
|
skipKeys: ["header-status", "header-config"]
|
|
38278
38320
|
});
|
|
38279
|
-
ctx.setOverlayActive?.(false);
|
|
38280
38321
|
if (!result.confirmed || !result.key)
|
|
38281
38322
|
return;
|
|
38282
38323
|
switch (result.key) {
|
|
@@ -38287,7 +38328,6 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38287
38328
|
continue;
|
|
38288
38329
|
}
|
|
38289
38330
|
case "mode": {
|
|
38290
|
-
ctx.setOverlayActive?.(true);
|
|
38291
38331
|
const modeItems = [
|
|
38292
38332
|
{ key: "chat", label: "Chat", detail: "speaks streamed model text at normal pitch" },
|
|
38293
38333
|
{ key: "action", label: "Action", detail: "speaks tool call narrations with emotion pitch" },
|
|
@@ -38300,7 +38340,6 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38300
38340
|
rl: ctx.rl,
|
|
38301
38341
|
availableRows: ctx.availableContentRows?.()
|
|
38302
38342
|
});
|
|
38303
|
-
ctx.setOverlayActive?.(false);
|
|
38304
38343
|
if (modeResult.confirmed && modeResult.key) {
|
|
38305
38344
|
const mode = modeResult.key;
|
|
38306
38345
|
ctx.voiceSetMode?.(mode);
|
|
@@ -38309,7 +38348,6 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38309
38348
|
continue;
|
|
38310
38349
|
}
|
|
38311
38350
|
case "voice": {
|
|
38312
|
-
ctx.setOverlayActive?.(true);
|
|
38313
38351
|
const voiceItems = [
|
|
38314
38352
|
{ key: "header-onnx", label: selectColors.dim("\u2500\u2500\u2500 ONNX Voices \u2500\u2500\u2500") },
|
|
38315
38353
|
{ key: "glados", label: "GLaDOS", detail: "Portal AI voice (ONNX)" },
|
|
@@ -38330,15 +38368,13 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38330
38368
|
availableRows: ctx.availableContentRows?.(),
|
|
38331
38369
|
skipKeys: ["header-onnx", "header-mlx", "header-clone"]
|
|
38332
38370
|
});
|
|
38333
|
-
ctx.setOverlayActive?.(false);
|
|
38334
38371
|
if (voiceResult.confirmed && voiceResult.key) {
|
|
38335
|
-
|
|
38372
|
+
await ctx.voiceSetModel(voiceResult.key);
|
|
38336
38373
|
save({ voice: true, voiceModel: voiceResult.key });
|
|
38337
38374
|
}
|
|
38338
38375
|
continue;
|
|
38339
38376
|
}
|
|
38340
38377
|
case "system": {
|
|
38341
|
-
ctx.setOverlayActive?.(true);
|
|
38342
38378
|
const sysItems = [
|
|
38343
38379
|
{ key: "onnx", label: "Piper ONNX", detail: "cross-platform, fast, offline" },
|
|
38344
38380
|
{ key: "luxtts", label: "LuxTTS", detail: "voice cloning, Python venv" },
|
|
@@ -38355,10 +38391,8 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38355
38391
|
availableRows: ctx.availableContentRows?.(),
|
|
38356
38392
|
skipKeys: ["header-import"]
|
|
38357
38393
|
});
|
|
38358
|
-
ctx.setOverlayActive?.(false);
|
|
38359
38394
|
if (sysResult.confirmed && sysResult.key) {
|
|
38360
38395
|
if (sysResult.key === "import-onnx") {
|
|
38361
|
-
ctx.setOverlayActive?.(true);
|
|
38362
38396
|
const onnxDrop = await showDropPanel({
|
|
38363
38397
|
title: "Import Piper Voice \u2014 Drop .onnx File",
|
|
38364
38398
|
instruction: "Drag and drop the .onnx model file",
|
|
@@ -38366,11 +38400,9 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38366
38400
|
typeLabel: "ONNX model",
|
|
38367
38401
|
rl: ctx.rl
|
|
38368
38402
|
});
|
|
38369
|
-
ctx.setOverlayActive?.(false);
|
|
38370
38403
|
if (!onnxDrop.confirmed || !onnxDrop.path) {
|
|
38371
38404
|
continue;
|
|
38372
38405
|
}
|
|
38373
|
-
ctx.setOverlayActive?.(true);
|
|
38374
38406
|
const jsonDrop = await showDropPanel({
|
|
38375
38407
|
title: "Import Piper Voice \u2014 Drop .onnx.json Config",
|
|
38376
38408
|
instruction: "Drag and drop the .onnx.json config file for the model",
|
|
@@ -38378,7 +38410,6 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38378
38410
|
typeLabel: "JSON config",
|
|
38379
38411
|
rl: ctx.rl
|
|
38380
38412
|
});
|
|
38381
|
-
ctx.setOverlayActive?.(false);
|
|
38382
38413
|
if (!jsonDrop.confirmed || !jsonDrop.path) {
|
|
38383
38414
|
continue;
|
|
38384
38415
|
}
|
|
@@ -38409,7 +38440,6 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38409
38440
|
continue;
|
|
38410
38441
|
}
|
|
38411
38442
|
case "clone": {
|
|
38412
|
-
ctx.setOverlayActive?.(true);
|
|
38413
38443
|
const dropResult = await showDropPanel({
|
|
38414
38444
|
title: "Voice Clone \u2014 Drop Audio File",
|
|
38415
38445
|
instruction: "Drag and drop an audio file to use as voice clone reference",
|
|
@@ -38417,20 +38447,15 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
|
|
|
38417
38447
|
typeLabel: "Audio files",
|
|
38418
38448
|
rl: ctx.rl
|
|
38419
38449
|
});
|
|
38420
|
-
ctx.setOverlayActive?.(false);
|
|
38421
38450
|
if (dropResult.confirmed && dropResult.path && ctx.voiceClone) {
|
|
38422
38451
|
await ctx.voiceClone(dropResult.path);
|
|
38423
38452
|
const newFilename = ctx.voiceGetLastClonedFilename?.();
|
|
38424
|
-
ctx.setOverlayActive?.(true);
|
|
38425
38453
|
await handleVoiceList(ctx, newFilename ?? void 0);
|
|
38426
|
-
ctx.setOverlayActive?.(false);
|
|
38427
38454
|
}
|
|
38428
38455
|
continue;
|
|
38429
38456
|
}
|
|
38430
38457
|
case "list": {
|
|
38431
|
-
ctx.setOverlayActive?.(true);
|
|
38432
38458
|
await handleVoiceList(ctx);
|
|
38433
|
-
ctx.setOverlayActive?.(false);
|
|
38434
38459
|
continue;
|
|
38435
38460
|
}
|
|
38436
38461
|
}
|
|
@@ -48410,14 +48435,18 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
|
|
|
48410
48435
|
}
|
|
48411
48436
|
backend = new CascadeBackend(config.model, [primaryEndpoint, ...fallbackEndpoints], {
|
|
48412
48437
|
onSwitch: (_from, to, reason) => {
|
|
48413
|
-
|
|
48438
|
+
const msg = `
|
|
48414
48439
|
[cascade] Failover \u2192 ${to.label ?? to.url}: ${reason}
|
|
48415
|
-
|
|
48440
|
+
`;
|
|
48441
|
+
if (!bufferIfOverlay("stderr", msg))
|
|
48442
|
+
process.stderr.write(msg);
|
|
48416
48443
|
},
|
|
48417
48444
|
onProbeResult: (ep, success) => {
|
|
48418
48445
|
if (success) {
|
|
48419
|
-
|
|
48420
|
-
|
|
48446
|
+
const msg = `[cascade] Primary recovered: ${ep.label ?? ep.url}
|
|
48447
|
+
`;
|
|
48448
|
+
if (!bufferIfOverlay("stderr", msg))
|
|
48449
|
+
process.stderr.write(msg);
|
|
48421
48450
|
}
|
|
48422
48451
|
}
|
|
48423
48452
|
});
|
|
@@ -48657,8 +48686,22 @@ ${entry.fullContent}`
|
|
|
48657
48686
|
let streamStartMs = 0;
|
|
48658
48687
|
let streamTextBuffer = "";
|
|
48659
48688
|
const contentWrite = (fn) => {
|
|
48660
|
-
if (
|
|
48689
|
+
if (isOverlayActive()) {
|
|
48690
|
+
const origWrite = process.stdout.write;
|
|
48691
|
+
const chunks = [];
|
|
48692
|
+
process.stdout.write = ((chunk) => {
|
|
48693
|
+
chunks.push(chunk);
|
|
48694
|
+
return true;
|
|
48695
|
+
});
|
|
48696
|
+
try {
|
|
48697
|
+
fn();
|
|
48698
|
+
} finally {
|
|
48699
|
+
process.stdout.write = origWrite;
|
|
48700
|
+
}
|
|
48701
|
+
for (const chunk of chunks)
|
|
48702
|
+
bufferIfOverlay("stdout", chunk);
|
|
48661
48703
|
return;
|
|
48704
|
+
}
|
|
48662
48705
|
if (statusBar?.isActive) {
|
|
48663
48706
|
statusBar.beginContentWrite();
|
|
48664
48707
|
fn();
|
|
@@ -49410,8 +49453,22 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
49410
49453
|
}
|
|
49411
49454
|
}
|
|
49412
49455
|
function writeContent(fn) {
|
|
49413
|
-
if (
|
|
49456
|
+
if (isOverlayActive()) {
|
|
49457
|
+
const origWrite = process.stdout.write;
|
|
49458
|
+
const chunks = [];
|
|
49459
|
+
process.stdout.write = ((chunk) => {
|
|
49460
|
+
chunks.push(chunk);
|
|
49461
|
+
return true;
|
|
49462
|
+
});
|
|
49463
|
+
try {
|
|
49464
|
+
fn();
|
|
49465
|
+
} finally {
|
|
49466
|
+
process.stdout.write = origWrite;
|
|
49467
|
+
}
|
|
49468
|
+
for (const chunk of chunks)
|
|
49469
|
+
bufferIfOverlay("stdout", chunk);
|
|
49414
49470
|
return;
|
|
49471
|
+
}
|
|
49415
49472
|
if (statusBar.isActive) {
|
|
49416
49473
|
statusBar.beginContentWrite();
|
|
49417
49474
|
try {
|
|
@@ -49749,7 +49806,10 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
49749
49806
|
return voiceEngine.lastClonedFilename;
|
|
49750
49807
|
},
|
|
49751
49808
|
setOverlayActive(active) {
|
|
49752
|
-
|
|
49809
|
+
if (active)
|
|
49810
|
+
enterOverlay();
|
|
49811
|
+
else
|
|
49812
|
+
leaveOverlay();
|
|
49753
49813
|
},
|
|
49754
49814
|
streamToggle() {
|
|
49755
49815
|
streamEnabled = !streamEnabled;
|
|
@@ -51439,7 +51499,7 @@ async function runWithTUI(task, config, repoPath) {
|
|
|
51439
51499
|
process.exit(1);
|
|
51440
51500
|
}
|
|
51441
51501
|
}
|
|
51442
|
-
var
|
|
51502
|
+
var taskManager;
|
|
51443
51503
|
var init_interactive = __esm({
|
|
51444
51504
|
"packages/cli/dist/tui/interactive.js"() {
|
|
51445
51505
|
"use strict";
|
|
@@ -51475,7 +51535,7 @@ var init_interactive = __esm({
|
|
|
51475
51535
|
init_telegram_bridge();
|
|
51476
51536
|
init_status_bar();
|
|
51477
51537
|
init_dist6();
|
|
51478
|
-
|
|
51538
|
+
init_overlay_lock();
|
|
51479
51539
|
taskManager = new BackgroundTaskManager();
|
|
51480
51540
|
}
|
|
51481
51541
|
});
|
package/package.json
CHANGED