open-agents-ai 0.138.25 → 0.138.27
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 +52 -54
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36687,8 +36687,8 @@ function tuiSelect(opts) {
|
|
|
36687
36687
|
lines.push(` ${selectColors.dim("\u2191/\u2193 navigate Enter select" + actionHint + deleteHint + customHint + " Esc " + (filter ? "clear filter" : "cancel") + " Type to filter")}`);
|
|
36688
36688
|
}
|
|
36689
36689
|
lines.push("");
|
|
36690
|
-
const output = lines.join("\n");
|
|
36691
|
-
overlayWrite(output);
|
|
36690
|
+
const output = lines.join("\n").replace(/\x1B\[0m/g, "\x1B[0m\x1B[48;5;234m");
|
|
36691
|
+
overlayWrite("\x1B[48;5;234m" + output);
|
|
36692
36692
|
lastRenderedLines = lines.length;
|
|
36693
36693
|
}
|
|
36694
36694
|
function cleanup() {
|
|
@@ -39293,20 +39293,13 @@ var init_voice = __esm({
|
|
|
39293
39293
|
}
|
|
39294
39294
|
if (this.checkMlxInstalled())
|
|
39295
39295
|
return;
|
|
39296
|
-
renderInfo("Installing MLX Audio for voice synthesis (
|
|
39296
|
+
renderInfo("Installing MLX Audio for voice synthesis (background)...");
|
|
39297
39297
|
try {
|
|
39298
|
-
|
|
39299
|
-
stdio: "pipe",
|
|
39300
|
-
timeout: 3e5
|
|
39301
|
-
// 5 min — may need to compile
|
|
39302
|
-
});
|
|
39298
|
+
await this.asyncShell(`${py} -m pip install mlx-audio --quiet`, 3e5);
|
|
39303
39299
|
this.mlxInstalled = true;
|
|
39304
39300
|
} catch (err) {
|
|
39305
39301
|
try {
|
|
39306
|
-
|
|
39307
|
-
stdio: "pipe",
|
|
39308
|
-
timeout: 3e5
|
|
39309
|
-
});
|
|
39302
|
+
await this.asyncShell(`${py} -m pip install mlx-audio --user --quiet`, 3e5);
|
|
39310
39303
|
this.mlxInstalled = true;
|
|
39311
39304
|
} catch (err2) {
|
|
39312
39305
|
throw new Error(`Failed to install mlx-audio. Try manually: pip install mlx-audio
|
|
@@ -39913,36 +39906,31 @@ if __name__ == '__main__':
|
|
|
39913
39906
|
}, null, 2));
|
|
39914
39907
|
}
|
|
39915
39908
|
const voiceRequire = createRequire(join50(voiceDir(), "index.js"));
|
|
39916
|
-
const probeOnnx = () => {
|
|
39909
|
+
const probeOnnx = async () => {
|
|
39917
39910
|
try {
|
|
39918
|
-
const
|
|
39919
|
-
|
|
39920
|
-
return output === "OK";
|
|
39911
|
+
const output = await this.asyncShell(`NODE_PATH="${join50(voiceDir(), "node_modules")}" node -e "try { require('onnxruntime-node'); console.log('OK'); } catch(e) { console.log('FAIL:' + e.message); }"`, 15e3);
|
|
39912
|
+
return output.trim() === "OK";
|
|
39921
39913
|
} catch {
|
|
39922
39914
|
return false;
|
|
39923
39915
|
}
|
|
39924
39916
|
};
|
|
39925
39917
|
const onnxNodeModules = join50(voiceDir(), "node_modules", "onnxruntime-node");
|
|
39926
39918
|
const onnxInstalled = existsSync35(onnxNodeModules);
|
|
39927
|
-
if (onnxInstalled && !probeOnnx()) {
|
|
39919
|
+
if (onnxInstalled && !await probeOnnx()) {
|
|
39928
39920
|
throw new Error(`Voice synthesis unavailable: ONNX runtime crashes on this CPU (${process.platform}-${arch}). This is a known issue with some ARM SoCs where the CPU vendor is not recognized. Voice feedback will be disabled but all other features work normally.`);
|
|
39929
39921
|
}
|
|
39930
39922
|
try {
|
|
39931
39923
|
this.ort = voiceRequire("onnxruntime-node");
|
|
39932
39924
|
} catch {
|
|
39933
|
-
renderInfo("Installing ONNX runtime for voice synthesis...");
|
|
39925
|
+
renderInfo("Installing ONNX runtime for voice synthesis (background)...");
|
|
39934
39926
|
try {
|
|
39935
|
-
|
|
39936
|
-
cwd: voiceDir(),
|
|
39937
|
-
stdio: "pipe",
|
|
39938
|
-
timeout: 12e4
|
|
39939
|
-
});
|
|
39927
|
+
await this.asyncShell(`cd "${voiceDir()}" && npm install --no-audit --no-fund`, 12e4);
|
|
39940
39928
|
} catch (err) {
|
|
39941
39929
|
const archHint = arch !== "x64" ? ` onnxruntime-node may not have prebuilt binaries for ${process.platform}-${arch}.` : "";
|
|
39942
39930
|
throw new Error(`Failed to install voice dependencies.${archHint} Try manually: cd ${voiceDir()} && npm install
|
|
39943
39931
|
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
39944
39932
|
}
|
|
39945
|
-
if (!probeOnnx()) {
|
|
39933
|
+
if (!await probeOnnx()) {
|
|
39946
39934
|
throw new Error(`Voice synthesis unavailable: ONNX runtime crashes on this CPU (${process.platform}-${arch}). This is a known issue with some ARM SoCs where the CPU vendor is not recognized. Voice feedback will be disabled but all other features work normally.`);
|
|
39947
39935
|
}
|
|
39948
39936
|
try {
|
|
@@ -39955,13 +39943,9 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
|
39955
39943
|
const phonemizerMod = voiceRequire("phonemizer");
|
|
39956
39944
|
this.phonemizeFn = phonemizerMod.phonemize ?? phonemizerMod.default?.phonemize ?? phonemizerMod;
|
|
39957
39945
|
} catch {
|
|
39958
|
-
renderInfo("Installing phonemizer for voice synthesis...");
|
|
39946
|
+
renderInfo("Installing phonemizer for voice synthesis (background)...");
|
|
39959
39947
|
try {
|
|
39960
|
-
|
|
39961
|
-
cwd: voiceDir(),
|
|
39962
|
-
stdio: "pipe",
|
|
39963
|
-
timeout: 12e4
|
|
39964
|
-
});
|
|
39948
|
+
await this.asyncShell(`cd "${voiceDir()}" && npm install --no-audit --no-fund`, 12e4);
|
|
39965
39949
|
const phonemizerMod = voiceRequire("phonemizer");
|
|
39966
39950
|
this.phonemizeFn = phonemizerMod.phonemize ?? phonemizerMod.default?.phonemize ?? phonemizerMod;
|
|
39967
39951
|
} catch (err) {
|
|
@@ -51395,13 +51379,13 @@ var init_status_bar = __esm({
|
|
|
51395
51379
|
for (let row = clearStart; row <= rows; row++) {
|
|
51396
51380
|
buf += `\x1B[${row};1H\x1B[2K`;
|
|
51397
51381
|
}
|
|
51398
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}\x1B[${pos.topSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
|
|
51399
51382
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
|
51400
51383
|
const row = pos.inputStartRow + i;
|
|
51401
51384
|
const prefix = i === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
51402
|
-
buf += `\x1B[${row};1H${prefix}${inputWrap.lines[i]}`;
|
|
51385
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i]}${RESET}`;
|
|
51403
51386
|
}
|
|
51404
|
-
buf += `\x1B[${pos.
|
|
51387
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}`;
|
|
51388
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}\x1B[?7h\x1B[${pos.scrollEnd};1H`;
|
|
51405
51389
|
process.stdout.write(buf);
|
|
51406
51390
|
} else {
|
|
51407
51391
|
this.applyScrollRegion();
|
|
@@ -51906,7 +51890,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
51906
51890
|
/** Update _currentFooterHeight based on current input. Returns true if height changed. */
|
|
51907
51891
|
updateFooterHeight(termWidth) {
|
|
51908
51892
|
const inputLines = this.computeInputLineCount(termWidth);
|
|
51909
|
-
const newHeight =
|
|
51893
|
+
const newHeight = 2 + inputLines;
|
|
51910
51894
|
if (newHeight !== this._currentFooterHeight) {
|
|
51911
51895
|
this._currentFooterHeight = newHeight;
|
|
51912
51896
|
return true;
|
|
@@ -51916,18 +51900,25 @@ ${CONTENT_BG_SEQ}`);
|
|
|
51916
51900
|
/** Check if footer height would change, WITHOUT actually updating it */
|
|
51917
51901
|
footerHeightChanged(termWidth) {
|
|
51918
51902
|
const inputLines = this.computeInputLineCount(termWidth);
|
|
51919
|
-
return
|
|
51903
|
+
return 2 + inputLines !== this._currentFooterHeight;
|
|
51920
51904
|
}
|
|
51921
|
-
/** Compute absolute row positions for all footer elements
|
|
51905
|
+
/** Compute absolute row positions for all footer elements.
|
|
51906
|
+
* New layout (top to bottom): input → braille → metrics.
|
|
51907
|
+
* No separator lines, no blank rows. */
|
|
51922
51908
|
rowPositions(rows) {
|
|
51923
51909
|
const fh = this._currentFooterHeight;
|
|
51910
|
+
const inputLines = fh - 2;
|
|
51924
51911
|
return {
|
|
51925
51912
|
scrollEnd: Math.max(rows - fh, this.scrollRegionTop + 1),
|
|
51926
|
-
|
|
51927
|
-
|
|
51928
|
-
|
|
51929
|
-
|
|
51930
|
-
metricsRow: rows
|
|
51913
|
+
inputStartRow: rows - fh + 1,
|
|
51914
|
+
// input at TOP of footer
|
|
51915
|
+
bufferRow: rows - fh + 1 + inputLines,
|
|
51916
|
+
// braille below input
|
|
51917
|
+
metricsRow: rows,
|
|
51918
|
+
// metrics at BOTTOM
|
|
51919
|
+
// Legacy (unused but keeps TS happy for any remaining refs)
|
|
51920
|
+
topSepRow: -1,
|
|
51921
|
+
bottomSepRow: -1
|
|
51931
51922
|
};
|
|
51932
51923
|
}
|
|
51933
51924
|
/**
|
|
@@ -52024,14 +52015,16 @@ ${CONTENT_BG_SEQ}`);
|
|
|
52024
52015
|
}
|
|
52025
52016
|
}
|
|
52026
52017
|
const inputWrap = this.wrapInput(w);
|
|
52027
|
-
let buf =
|
|
52018
|
+
let buf = "\x1B[?7l";
|
|
52028
52019
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
|
52029
52020
|
const row = pos.inputStartRow + i;
|
|
52030
52021
|
const prefix = i === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
52031
52022
|
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i]}${RESET}`;
|
|
52032
52023
|
}
|
|
52033
52024
|
const cursorTermRow = pos.inputStartRow + inputWrap.cursorRow;
|
|
52034
|
-
buf += `\x1B[${pos.
|
|
52025
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}`;
|
|
52026
|
+
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}`;
|
|
52027
|
+
buf += `\x1B[?7h\x1B[${cursorTermRow};${inputWrap.cursorCol}H\x1B[?25h`;
|
|
52035
52028
|
process.stdout.write(buf);
|
|
52036
52029
|
}
|
|
52037
52030
|
/**
|
|
@@ -52058,7 +52051,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
52058
52051
|
const rows = process.stdout.rows ?? 24;
|
|
52059
52052
|
const w = getTermWidth();
|
|
52060
52053
|
const pos = this.rowPositions(rows);
|
|
52061
|
-
const buf = `\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}\x1B[${pos.
|
|
52054
|
+
const buf = `\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}\x1B[?7h\x1B8` + // DEC restore cursor
|
|
52062
52055
|
(this.writeDepth === 0 ? "\x1B[?25h" : "");
|
|
52063
52056
|
process.stdout.write(buf);
|
|
52064
52057
|
}
|
|
@@ -52093,14 +52086,12 @@ ${CONTENT_BG_SEQ}`);
|
|
|
52093
52086
|
buf += "\x1BM";
|
|
52094
52087
|
}
|
|
52095
52088
|
buf += "\x1B[?7l";
|
|
52096
|
-
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}`;
|
|
52097
|
-
buf += `\x1B[${pos.topSepRow};1H${PANEL_BG_SEQ}\x1B[2K${RESET}`;
|
|
52098
52089
|
for (let i = 0; i < inputWrap.lines.length; i++) {
|
|
52099
52090
|
const row = pos.inputStartRow + i;
|
|
52100
52091
|
const prefix = i === 0 ? this.promptText : " ".repeat(this.promptWidth);
|
|
52101
52092
|
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${prefix}${inputWrap.lines[i]}${RESET}`;
|
|
52102
52093
|
}
|
|
52103
|
-
buf += `\x1B[${pos.
|
|
52094
|
+
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildBufferContent(w)}${RESET}`;
|
|
52104
52095
|
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET}`;
|
|
52105
52096
|
buf += "\x1B[?7h";
|
|
52106
52097
|
buf += "\x1B8";
|
|
@@ -53715,17 +53706,24 @@ async function startInteractive(config, repoPath) {
|
|
|
53715
53706
|
const streamRenderer = new StreamRenderer();
|
|
53716
53707
|
streamRenderer.onRenderedLine = (line) => statusBar.bufferContentLine(line);
|
|
53717
53708
|
if (savedSettings.voice) {
|
|
53718
|
-
voiceEngine.toggle().catch((err) => {
|
|
53719
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
53720
|
-
if (msg.includes("ONNX runtime crashes") || msg.includes("unavailable")) {
|
|
53721
|
-
renderWarning(`Voice disabled: ${msg}`);
|
|
53722
|
-
renderInfo("All other features work normally. Use /voice to retry later.");
|
|
53723
|
-
}
|
|
53724
|
-
});
|
|
53725
53709
|
if (savedSettings.voiceModel) {
|
|
53726
53710
|
voiceEngine.setModel(savedSettings.voiceModel).catch(() => {
|
|
53727
53711
|
});
|
|
53728
53712
|
}
|
|
53713
|
+
voiceEngine.toggle().then((msg) => {
|
|
53714
|
+
if (statusBar?.isActive && !statusBar.isStreaming) {
|
|
53715
|
+
statusBar.beginContentWrite();
|
|
53716
|
+
renderInfo(msg);
|
|
53717
|
+
statusBar.endContentWrite();
|
|
53718
|
+
}
|
|
53719
|
+
}).catch((err) => {
|
|
53720
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
53721
|
+
if (statusBar?.isActive && !statusBar.isStreaming) {
|
|
53722
|
+
statusBar.beginContentWrite();
|
|
53723
|
+
renderWarning(`Voice: ${msg.slice(0, 80)}`);
|
|
53724
|
+
statusBar.endContentWrite();
|
|
53725
|
+
}
|
|
53726
|
+
});
|
|
53729
53727
|
}
|
|
53730
53728
|
if (savedSettings.voiceMode) {
|
|
53731
53729
|
voiceEngine.voiceMode = savedSettings.voiceMode;
|
package/package.json
CHANGED