open-agents-ai 0.138.59 → 0.138.61
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 +138 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40439,22 +40439,55 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
|
40439
40439
|
}
|
|
40440
40440
|
renderInfo(" Installing LuxTTS dependencies...");
|
|
40441
40441
|
const pipCmd = JSON.stringify(venvPy);
|
|
40442
|
-
const
|
|
40443
|
-
|
|
40444
|
-
|
|
40445
|
-
|
|
40446
|
-
|
|
40447
|
-
|
|
40442
|
+
const isArm = process.arch === "arm64" || process.arch === "arm";
|
|
40443
|
+
const coreDeps = isArm ? `lhotse huggingface_hub safetensors pydub librosa "transformers<=4.57.6" inflect numpy "setuptools<81"` : `lhotse huggingface_hub safetensors pydub onnxruntime librosa "transformers<=4.57.6" inflect numpy vocos "setuptools<81"`;
|
|
40444
|
+
if (isArm) {
|
|
40445
|
+
renderInfo(" ARM device detected \u2014 skipping onnxruntime (no ARM wheels available); vocos install is non-fatal.");
|
|
40446
|
+
}
|
|
40447
|
+
const installSteps = [
|
|
40448
|
+
{
|
|
40449
|
+
cmd: `${pipCmd} -m pip install --quiet ${coreDeps}`,
|
|
40450
|
+
fatal: true,
|
|
40451
|
+
label: "core LuxTTS deps"
|
|
40452
|
+
},
|
|
40453
|
+
// On ARM, vocos is installed separately as non-fatal (may lack prebuilt wheels).
|
|
40454
|
+
// On x86_64 it is already included in coreDeps above and this step is skipped.
|
|
40455
|
+
...isArm ? [{
|
|
40456
|
+
cmd: `${pipCmd} -m pip install --quiet vocos`,
|
|
40457
|
+
fatal: false,
|
|
40458
|
+
label: "vocos"
|
|
40459
|
+
}] : [],
|
|
40460
|
+
{
|
|
40461
|
+
cmd: `${pipCmd} -m pip install --quiet piper-phonemize --find-links https://k2-fsa.github.io/icefall/piper_phonemize.html`,
|
|
40462
|
+
fatal: false,
|
|
40463
|
+
label: "piper-phonemize"
|
|
40464
|
+
},
|
|
40465
|
+
{
|
|
40466
|
+
cmd: `${pipCmd} -m pip install --quiet jieba pypinyin cn2an`,
|
|
40467
|
+
fatal: true,
|
|
40468
|
+
label: "Chinese text processing deps"
|
|
40469
|
+
},
|
|
40470
|
+
{
|
|
40471
|
+
cmd: `${pipCmd} -m pip install --quiet "git+https://github.com/ysharma3501/LinaCodec.git"`,
|
|
40472
|
+
fatal: false,
|
|
40473
|
+
label: "LinaCodec"
|
|
40474
|
+
},
|
|
40475
|
+
{
|
|
40476
|
+
cmd: `${pipCmd} -m pip install --quiet -e ${JSON.stringify(repoDir)}`,
|
|
40477
|
+
fatal: true,
|
|
40478
|
+
label: "LuxTTS (editable install)"
|
|
40479
|
+
}
|
|
40448
40480
|
];
|
|
40449
|
-
for (const
|
|
40481
|
+
for (const step of installSteps) {
|
|
40450
40482
|
try {
|
|
40451
|
-
await this.asyncShell(cmd, 3e5);
|
|
40483
|
+
await this.asyncShell(step.cmd, 3e5);
|
|
40452
40484
|
} catch (err) {
|
|
40453
40485
|
const msg = err instanceof Error ? err.message : String(err);
|
|
40454
|
-
if (
|
|
40455
|
-
|
|
40486
|
+
if (!step.fatal) {
|
|
40487
|
+
const armNote = isArm && (step.label === "piper-phonemize" || step.label === "vocos") ? " (expected on ARM \u2014 no prebuilt wheels)" : "";
|
|
40488
|
+
renderWarning(` Non-critical install warning (${step.label})${armNote}: ${msg.slice(0, 120)}`);
|
|
40456
40489
|
} else {
|
|
40457
|
-
throw new Error(`Failed to install LuxTTS dependencies: ${msg}`);
|
|
40490
|
+
throw new Error(`Failed to install LuxTTS dependencies (${step.label}): ${msg}`);
|
|
40458
40491
|
}
|
|
40459
40492
|
}
|
|
40460
40493
|
}
|
|
@@ -43385,7 +43418,7 @@ async function handlePeerEndpoint(peerId, authKey, ctx, local) {
|
|
|
43385
43418
|
}
|
|
43386
43419
|
}
|
|
43387
43420
|
async function handleParallel(arg, ctx) {
|
|
43388
|
-
const { execSync:
|
|
43421
|
+
const { execSync: execSync30 } = await import("node:child_process");
|
|
43389
43422
|
const baseUrl = ctx.config.backendUrl || "http://localhost:11434";
|
|
43390
43423
|
const isRemote = ctx.config.backendType === "nexus";
|
|
43391
43424
|
if (isRemote) {
|
|
@@ -43409,7 +43442,7 @@ async function handleParallel(arg, ctx) {
|
|
|
43409
43442
|
}
|
|
43410
43443
|
let systemdVal = "";
|
|
43411
43444
|
try {
|
|
43412
|
-
const out =
|
|
43445
|
+
const out = execSync30("systemctl show ollama.service -p Environment 2>/dev/null || true", { encoding: "utf8" });
|
|
43413
43446
|
const match = out.match(/OLLAMA_NUM_PARALLEL=(\d+)/);
|
|
43414
43447
|
if (match)
|
|
43415
43448
|
systemdVal = match[1];
|
|
@@ -43438,7 +43471,7 @@ async function handleParallel(arg, ctx) {
|
|
|
43438
43471
|
}
|
|
43439
43472
|
const isSystemd = (() => {
|
|
43440
43473
|
try {
|
|
43441
|
-
const out =
|
|
43474
|
+
const out = execSync30("systemctl is-active ollama.service 2>/dev/null", { encoding: "utf8" }).trim();
|
|
43442
43475
|
return out === "active" || out === "inactive";
|
|
43443
43476
|
} catch {
|
|
43444
43477
|
return false;
|
|
@@ -43452,10 +43485,10 @@ async function handleParallel(arg, ctx) {
|
|
|
43452
43485
|
const overrideContent = `[Service]
|
|
43453
43486
|
Environment="OLLAMA_NUM_PARALLEL=${n}"
|
|
43454
43487
|
`;
|
|
43455
|
-
|
|
43456
|
-
|
|
43457
|
-
|
|
43458
|
-
|
|
43488
|
+
execSync30(`sudo mkdir -p ${overrideDir}`, { stdio: "pipe" });
|
|
43489
|
+
execSync30(`echo '${overrideContent}' | sudo tee ${overrideFile} > /dev/null`, { stdio: "pipe" });
|
|
43490
|
+
execSync30("sudo systemctl daemon-reload", { stdio: "pipe" });
|
|
43491
|
+
execSync30("sudo systemctl restart ollama.service", { stdio: "pipe" });
|
|
43459
43492
|
let ready = false;
|
|
43460
43493
|
for (let i = 0; i < 30 && !ready; i++) {
|
|
43461
43494
|
await new Promise((r) => setTimeout(r, 500));
|
|
@@ -43482,7 +43515,7 @@ Environment="OLLAMA_NUM_PARALLEL=${n}"
|
|
|
43482
43515
|
renderInfo(`Setting OLLAMA_NUM_PARALLEL=${n}...`);
|
|
43483
43516
|
try {
|
|
43484
43517
|
try {
|
|
43485
|
-
|
|
43518
|
+
execSync30("pkill -f 'ollama serve' 2>/dev/null || true", { stdio: "pipe" });
|
|
43486
43519
|
} catch {
|
|
43487
43520
|
}
|
|
43488
43521
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
@@ -53480,6 +53513,7 @@ import { createRequire as createRequire2 } from "node:module";
|
|
|
53480
53513
|
import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
53481
53514
|
import { readFileSync as readFileSync32, writeFileSync as writeFileSync18, appendFileSync as appendFileSync4, rmSync as rmSync2, readdirSync as readdirSync16, mkdirSync as mkdirSync19 } from "node:fs";
|
|
53482
53515
|
import { existsSync as existsSync43 } from "node:fs";
|
|
53516
|
+
import { execSync as execSync29 } from "node:child_process";
|
|
53483
53517
|
import { homedir as homedir13 } from "node:os";
|
|
53484
53518
|
function formatTimeAgo(date) {
|
|
53485
53519
|
const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
|
|
@@ -56567,13 +56601,94 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
56567
56601
|
}
|
|
56568
56602
|
},
|
|
56569
56603
|
destroyProject() {
|
|
56604
|
+
const bgKilled = taskManager.stopAll();
|
|
56605
|
+
if (bgKilled > 0) {
|
|
56606
|
+
writeContent(() => renderInfo(`Killed ${bgKilled} background task(s).`));
|
|
56607
|
+
}
|
|
56608
|
+
try {
|
|
56609
|
+
const nexusDir = join59(repoRoot, OA_DIR, "nexus");
|
|
56610
|
+
const pidFile = join59(nexusDir, "daemon.pid");
|
|
56611
|
+
if (existsSync43(pidFile)) {
|
|
56612
|
+
const pid = parseInt(readFileSync32(pidFile, "utf8").trim(), 10);
|
|
56613
|
+
if (pid > 0) {
|
|
56614
|
+
try {
|
|
56615
|
+
if (process.platform === "win32") {
|
|
56616
|
+
try {
|
|
56617
|
+
execSync29(`taskkill /F /PID ${pid}`, { timeout: 5e3, stdio: "ignore" });
|
|
56618
|
+
} catch {
|
|
56619
|
+
}
|
|
56620
|
+
} else {
|
|
56621
|
+
try {
|
|
56622
|
+
process.kill(pid, "SIGTERM");
|
|
56623
|
+
} catch {
|
|
56624
|
+
}
|
|
56625
|
+
}
|
|
56626
|
+
writeContent(() => renderInfo(`Killed nexus daemon (PID ${pid}).`));
|
|
56627
|
+
} catch {
|
|
56628
|
+
}
|
|
56629
|
+
}
|
|
56630
|
+
}
|
|
56631
|
+
} catch {
|
|
56632
|
+
}
|
|
56633
|
+
try {
|
|
56634
|
+
const voiceDir2 = join59(homedir13(), ".open-agents", "voice");
|
|
56635
|
+
const voicePidFiles = ["luxtts-daemon.pid", "piper-daemon.pid"];
|
|
56636
|
+
for (const pf of voicePidFiles) {
|
|
56637
|
+
const pidPath = join59(voiceDir2, pf);
|
|
56638
|
+
if (existsSync43(pidPath)) {
|
|
56639
|
+
try {
|
|
56640
|
+
const pid = parseInt(readFileSync32(pidPath, "utf8").trim(), 10);
|
|
56641
|
+
if (pid > 0) {
|
|
56642
|
+
if (process.platform === "win32") {
|
|
56643
|
+
try {
|
|
56644
|
+
execSync29(`taskkill /F /PID ${pid}`, { timeout: 5e3, stdio: "ignore" });
|
|
56645
|
+
} catch {
|
|
56646
|
+
}
|
|
56647
|
+
} else {
|
|
56648
|
+
try {
|
|
56649
|
+
process.kill(pid, "SIGTERM");
|
|
56650
|
+
} catch {
|
|
56651
|
+
}
|
|
56652
|
+
}
|
|
56653
|
+
}
|
|
56654
|
+
} catch {
|
|
56655
|
+
}
|
|
56656
|
+
}
|
|
56657
|
+
}
|
|
56658
|
+
} catch {
|
|
56659
|
+
}
|
|
56660
|
+
try {
|
|
56661
|
+
execSync29(process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.5", { timeout: 3e3, stdio: "ignore" });
|
|
56662
|
+
} catch {
|
|
56663
|
+
}
|
|
56570
56664
|
const oaPath = join59(repoRoot, OA_DIR);
|
|
56571
56665
|
if (existsSync43(oaPath)) {
|
|
56572
|
-
|
|
56573
|
-
|
|
56666
|
+
let deleted = false;
|
|
56667
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
56668
|
+
try {
|
|
56669
|
+
rmSync2(oaPath, { recursive: true, force: true });
|
|
56670
|
+
deleted = true;
|
|
56671
|
+
break;
|
|
56672
|
+
} catch (err) {
|
|
56673
|
+
if (attempt < 2) {
|
|
56674
|
+
try {
|
|
56675
|
+
execSync29(process.platform === "win32" ? "timeout /t 1 /nobreak >nul" : "sleep 0.3", { timeout: 3e3, stdio: "ignore" });
|
|
56676
|
+
} catch {
|
|
56677
|
+
}
|
|
56678
|
+
} else {
|
|
56679
|
+
writeContent(() => renderWarning(`Could not fully remove ${OA_DIR}/: ${err instanceof Error ? err.message : String(err)}`));
|
|
56680
|
+
if (process.platform === "win32") {
|
|
56681
|
+
try {
|
|
56682
|
+
execSync29(`rd /s /q "${oaPath}"`, { timeout: 1e4, stdio: "ignore" });
|
|
56683
|
+
deleted = true;
|
|
56684
|
+
} catch {
|
|
56685
|
+
}
|
|
56686
|
+
}
|
|
56687
|
+
}
|
|
56688
|
+
}
|
|
56689
|
+
}
|
|
56690
|
+
if (deleted) {
|
|
56574
56691
|
writeContent(() => renderInfo(`Removed ${OA_DIR}/ directory.`));
|
|
56575
|
-
} catch (err) {
|
|
56576
|
-
writeContent(() => renderWarning(`Could not remove ${OA_DIR}/: ${err instanceof Error ? err.message : String(err)}`));
|
|
56577
56692
|
}
|
|
56578
56693
|
} else {
|
|
56579
56694
|
writeContent(() => renderInfo(`No ${OA_DIR}/ directory found.`));
|
package/package.json
CHANGED