open-agents-ai 0.187.332 → 0.187.334
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 +70 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -277869,19 +277869,18 @@ function ensureEmbedDeps() {
|
|
|
277869
277869
|
log22 += mk.stdout + mk.stderr;
|
|
277870
277870
|
}
|
|
277871
277871
|
const pip = process.platform === "win32" ? join68(venv, "Scripts", "pip.exe") : join68(venv, "bin", "pip");
|
|
277872
|
-
const
|
|
277873
|
-
|
|
277874
|
-
|
|
277875
|
-
"
|
|
277876
|
-
"torchaudio",
|
|
277877
|
-
"Pillow",
|
|
277878
|
-
"speechbrain",
|
|
277872
|
+
const up = spawnSync5(pip, ["install", "--upgrade", "pip", "setuptools", "wheel"], { encoding: "utf8", timeout: 3e5 });
|
|
277873
|
+
log22 += up.stdout + up.stderr;
|
|
277874
|
+
const asrPkgs = [
|
|
277875
|
+
"numpy==1.26.4",
|
|
277879
277876
|
"soundfile",
|
|
277880
|
-
"openai-whisper"
|
|
277877
|
+
"openai-whisper",
|
|
277878
|
+
// Embedding helpers used elsewhere (kept lightweight compared to full torch stack)
|
|
277879
|
+
"Pillow"
|
|
277881
277880
|
];
|
|
277882
|
-
const ins = spawnSync5(pip, ["install", "--upgrade", ...
|
|
277881
|
+
const ins = spawnSync5(pip, ["install", "--upgrade", ...asrPkgs], { encoding: "utf8", timeout: 9e5 });
|
|
277883
277882
|
log22 += ins.stdout + ins.stderr;
|
|
277884
|
-
const ok2 = ins.status === 0;
|
|
277883
|
+
const ok2 = ins.status === 0 && up.status === 0;
|
|
277885
277884
|
return { ok: ok2, log: log22 };
|
|
277886
277885
|
}
|
|
277887
277886
|
function runEmbedImage(input) {
|
|
@@ -297268,6 +297267,63 @@ async function runSudoScript(ctx3, script) {
|
|
|
297268
297267
|
} catch {
|
|
297269
297268
|
}
|
|
297270
297269
|
}
|
|
297270
|
+
async function ensureVoiceDeps(ctx3) {
|
|
297271
|
+
try {
|
|
297272
|
+
const mod2 = await Promise.resolve().then(() => (init_py_embed(), py_embed_exports));
|
|
297273
|
+
if (typeof mod2.ensureEmbedDeps === "function") {
|
|
297274
|
+
const res = mod2.ensureEmbedDeps();
|
|
297275
|
+
if (res?.log) renderInfo2(res.log.split("\n").slice(-3).join(" ").slice(0, 200));
|
|
297276
|
+
}
|
|
297277
|
+
} catch {
|
|
297278
|
+
}
|
|
297279
|
+
const missing = [];
|
|
297280
|
+
const has = (cmd) => {
|
|
297281
|
+
try {
|
|
297282
|
+
nodeExecSync(`which ${cmd}`, { stdio: "pipe" });
|
|
297283
|
+
return true;
|
|
297284
|
+
} catch {
|
|
297285
|
+
return false;
|
|
297286
|
+
}
|
|
297287
|
+
};
|
|
297288
|
+
const isLinux = process.platform === "linux";
|
|
297289
|
+
const isDarwin = process.platform === "darwin";
|
|
297290
|
+
if (isLinux) {
|
|
297291
|
+
if (!has("arecord") && !has("ffmpeg")) missing.push("ffmpeg");
|
|
297292
|
+
try {
|
|
297293
|
+
nodeExecSync("python3 -m venv --help", { stdio: "pipe" });
|
|
297294
|
+
} catch {
|
|
297295
|
+
missing.push("python3-venv");
|
|
297296
|
+
}
|
|
297297
|
+
} else if (isDarwin) {
|
|
297298
|
+
if (!has("sox") && !has("ffmpeg")) missing.push("sox", "ffmpeg");
|
|
297299
|
+
}
|
|
297300
|
+
if (missing.length === 0) return;
|
|
297301
|
+
let script = "";
|
|
297302
|
+
if (isLinux) {
|
|
297303
|
+
if (has("apt-get")) {
|
|
297304
|
+
const pkgs = missing.join(" ");
|
|
297305
|
+
script = `apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y ${pkgs}`;
|
|
297306
|
+
} else if (has("dnf")) {
|
|
297307
|
+
const pkgs = missing.map((p2) => p2 === "python3-venv" ? "python3-venv" : p2).join(" ");
|
|
297308
|
+
script = `dnf install -y ${pkgs}`;
|
|
297309
|
+
} else if (has("pacman")) {
|
|
297310
|
+
const pkgs = missing.map((p2) => p2 === "python3-venv" ? "python-virtualenv" : p2).join(" ");
|
|
297311
|
+
script = `pacman -Sy --noconfirm ${pkgs}`;
|
|
297312
|
+
} else if (has("zypper")) {
|
|
297313
|
+
const pkgs = missing.map((p2) => p2 === "python3-venv" ? "python311-venv" : p2).join(" ");
|
|
297314
|
+
script = `zypper install -y ${pkgs}`;
|
|
297315
|
+
}
|
|
297316
|
+
} else if (isDarwin && has("brew")) {
|
|
297317
|
+
const pkgs = [...new Set(missing)].join(" ");
|
|
297318
|
+
script = `brew install ${pkgs}`;
|
|
297319
|
+
}
|
|
297320
|
+
if (script) {
|
|
297321
|
+
renderInfo2(`Installing OS dependencies: ${missing.join(", ")}`);
|
|
297322
|
+
await runSudoScript(ctx3, script);
|
|
297323
|
+
} else {
|
|
297324
|
+
renderWarning2(`Missing tools: ${missing.join(", ")}. Please install them manually.`);
|
|
297325
|
+
}
|
|
297326
|
+
}
|
|
297271
297327
|
function findPidsByPattern(pattern) {
|
|
297272
297328
|
const isWin2 = process.platform === "win32";
|
|
297273
297329
|
try {
|
|
@@ -299863,6 +299919,10 @@ sleep 1
|
|
|
299863
299919
|
return "handled";
|
|
299864
299920
|
}
|
|
299865
299921
|
renderInfo2("Starting voice chat — mic will capture your speech, agent will respond via TTS...");
|
|
299922
|
+
try {
|
|
299923
|
+
await ensureVoiceDeps(ctx3);
|
|
299924
|
+
} catch {
|
|
299925
|
+
}
|
|
299866
299926
|
try {
|
|
299867
299927
|
await ctx3.voiceChatStart();
|
|
299868
299928
|
renderInfo2("Voice chat active. Speak naturally — agent hears you and responds. /hangup to stop.");
|
package/package.json
CHANGED