open-agents-ai 0.138.26 → 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 +26 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -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) {
|
|
@@ -53722,17 +53706,24 @@ async function startInteractive(config, repoPath) {
|
|
|
53722
53706
|
const streamRenderer = new StreamRenderer();
|
|
53723
53707
|
streamRenderer.onRenderedLine = (line) => statusBar.bufferContentLine(line);
|
|
53724
53708
|
if (savedSettings.voice) {
|
|
53725
|
-
voiceEngine.toggle().catch((err) => {
|
|
53726
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
53727
|
-
if (msg.includes("ONNX runtime crashes") || msg.includes("unavailable")) {
|
|
53728
|
-
renderWarning(`Voice disabled: ${msg}`);
|
|
53729
|
-
renderInfo("All other features work normally. Use /voice to retry later.");
|
|
53730
|
-
}
|
|
53731
|
-
});
|
|
53732
53709
|
if (savedSettings.voiceModel) {
|
|
53733
53710
|
voiceEngine.setModel(savedSettings.voiceModel).catch(() => {
|
|
53734
53711
|
});
|
|
53735
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
|
+
});
|
|
53736
53727
|
}
|
|
53737
53728
|
if (savedSettings.voiceMode) {
|
|
53738
53729
|
voiceEngine.voiceMode = savedSettings.voiceMode;
|
package/package.json
CHANGED