open-agents-ai 0.187.336 → 0.187.338
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 +77 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -278120,17 +278120,20 @@ function findLiveWhisperScript() {
|
|
|
278120
278120
|
}
|
|
278121
278121
|
return null;
|
|
278122
278122
|
}
|
|
278123
|
-
function
|
|
278123
|
+
function ensureVenvForTranscribeCli() {
|
|
278124
278124
|
const bin = process.platform === "win32" ? "Scripts" : "bin";
|
|
278125
|
+
const exe = process.platform === "win32" ? "python.exe" : "python3";
|
|
278125
278126
|
const venvBin = join69(homedir24(), ".open-agents", "venv", bin);
|
|
278126
|
-
|
|
278127
|
+
const venvPython2 = join69(venvBin, exe);
|
|
278128
|
+
if (!existsSync53(venvPython2)) return false;
|
|
278129
|
+
process.env.TRANSCRIBE_PYTHON = venvPython2;
|
|
278127
278130
|
const pathSep2 = process.platform === "win32" ? ";" : ":";
|
|
278128
278131
|
const currentPath = process.env.PATH || "";
|
|
278129
278132
|
if (!currentPath.split(pathSep2).includes(venvBin)) {
|
|
278130
278133
|
process.env.PATH = `${venvBin}${pathSep2}${currentPath}`;
|
|
278131
278134
|
}
|
|
278132
278135
|
try {
|
|
278133
|
-
execSync44(
|
|
278136
|
+
execSync44(`"${venvPython2}" -c "import numpy"`, { stdio: "pipe", timeout: 1e4 });
|
|
278134
278137
|
return true;
|
|
278135
278138
|
} catch {
|
|
278136
278139
|
return false;
|
|
@@ -278461,7 +278464,7 @@ var init_listen = __esm({
|
|
|
278461
278464
|
if (tc) {
|
|
278462
278465
|
const TranscribeLive = tc.TranscribeLive;
|
|
278463
278466
|
if (TranscribeLive) {
|
|
278464
|
-
const venvReady =
|
|
278467
|
+
const venvReady = ensureVenvForTranscribeCli();
|
|
278465
278468
|
if (!venvReady) {
|
|
278466
278469
|
transcribeCliError = "venv Python missing numpy (required by transcribe-cli) — using whisper fallback";
|
|
278467
278470
|
} else {
|
|
@@ -278653,7 +278656,7 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
278653
278656
|
} catch {
|
|
278654
278657
|
}
|
|
278655
278658
|
}
|
|
278656
|
-
if (tc?.TranscribeLive &&
|
|
278659
|
+
if (tc?.TranscribeLive && ensureVenvForTranscribeCli()) {
|
|
278657
278660
|
try {
|
|
278658
278661
|
const transcriber = new tc.TranscribeLive({
|
|
278659
278662
|
model: this.config.model,
|
|
@@ -278707,7 +278710,7 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
278707
278710
|
}
|
|
278708
278711
|
}
|
|
278709
278712
|
if (!tc) return null;
|
|
278710
|
-
|
|
278713
|
+
ensureVenvForTranscribeCli();
|
|
278711
278714
|
try {
|
|
278712
278715
|
const result = await tc.transcribe(filePath, {
|
|
278713
278716
|
model: this.config.model,
|
|
@@ -297362,8 +297365,10 @@ async function ensureVoiceDeps(ctx3) {
|
|
|
297362
297365
|
if (typeof mod2.getVenvPython === "function") {
|
|
297363
297366
|
const { dirname: dirname32 } = await import("node:path");
|
|
297364
297367
|
const { existsSync: existsSync87 } = await import("node:fs");
|
|
297365
|
-
const
|
|
297366
|
-
if (existsSync87(
|
|
297368
|
+
const venvPy = mod2.getVenvPython();
|
|
297369
|
+
if (existsSync87(venvPy)) {
|
|
297370
|
+
process.env.TRANSCRIBE_PYTHON = venvPy;
|
|
297371
|
+
const venvBin = dirname32(venvPy);
|
|
297367
297372
|
const sep = process.platform === "win32" ? ";" : ":";
|
|
297368
297373
|
const cur = process.env.PATH || "";
|
|
297369
297374
|
if (!cur.split(sep).includes(venvBin)) {
|
|
@@ -328235,16 +328240,43 @@ async function handleRequest(req2, res, ollamaUrl, verbose) {
|
|
|
328235
328240
|
let ok2 = false;
|
|
328236
328241
|
if (id.startsWith("timer:")) {
|
|
328237
328242
|
const name11 = id.slice("timer:".length);
|
|
328243
|
+
try {
|
|
328244
|
+
userServiceAction(`${name11}.timer`, "stop");
|
|
328245
|
+
} catch {
|
|
328246
|
+
}
|
|
328247
|
+
try {
|
|
328248
|
+
userServiceAction(`${name11}.service`, "stop");
|
|
328249
|
+
} catch {
|
|
328250
|
+
}
|
|
328238
328251
|
try {
|
|
328239
328252
|
userServiceAction(`${name11}.timer`, "disable");
|
|
328240
|
-
ok2 = true;
|
|
328241
328253
|
} catch {
|
|
328242
|
-
ok2 = false;
|
|
328243
328254
|
}
|
|
328244
328255
|
try {
|
|
328245
|
-
userServiceAction(`${name11}.
|
|
328256
|
+
userServiceAction(`${name11}.service`, "disable");
|
|
328257
|
+
} catch {
|
|
328258
|
+
}
|
|
328259
|
+
try {
|
|
328260
|
+
const { execSync: es, spawnSync: ss } = __require("node:child_process");
|
|
328261
|
+
const home = process.env.HOME || __require("node:os").homedir();
|
|
328262
|
+
const userDir = `${home}/.config/systemd/user`;
|
|
328263
|
+
for (const suffix of [".timer", ".service"]) {
|
|
328264
|
+
try {
|
|
328265
|
+
es(`rm -f "${userDir}/${name11}${suffix}"`, { stdio: "pipe" });
|
|
328266
|
+
} catch {
|
|
328267
|
+
}
|
|
328268
|
+
}
|
|
328269
|
+
try {
|
|
328270
|
+
es("systemctl --user daemon-reload", { stdio: "pipe" });
|
|
328271
|
+
} catch {
|
|
328272
|
+
}
|
|
328273
|
+
try {
|
|
328274
|
+
ss("pkill", ["-f", name11], { stdio: "pipe", timeout: 3e3 });
|
|
328275
|
+
} catch {
|
|
328276
|
+
}
|
|
328246
328277
|
} catch {
|
|
328247
328278
|
}
|
|
328279
|
+
ok2 = true;
|
|
328248
328280
|
} else {
|
|
328249
328281
|
ok2 = deleteScheduledById(id);
|
|
328250
328282
|
}
|
|
@@ -329410,17 +329442,38 @@ function killProcessGroups(pids, pattern) {
|
|
|
329410
329442
|
function disableAllOaTimers() {
|
|
329411
329443
|
let disabled = 0;
|
|
329412
329444
|
try {
|
|
329445
|
+
const { execSync: es } = __require("node:child_process");
|
|
329446
|
+
const home = process.env.HOME || __require("node:os").homedir();
|
|
329447
|
+
const userDir = `${home}/.config/systemd/user`;
|
|
329413
329448
|
const timers = listOaUserTimers();
|
|
329414
329449
|
for (const t2 of timers) {
|
|
329450
|
+
try {
|
|
329451
|
+
userServiceAction(`${t2.name}.timer`, "stop");
|
|
329452
|
+
} catch {
|
|
329453
|
+
}
|
|
329454
|
+
try {
|
|
329455
|
+
userServiceAction(`${t2.name}.service`, "stop");
|
|
329456
|
+
} catch {
|
|
329457
|
+
}
|
|
329415
329458
|
try {
|
|
329416
329459
|
userServiceAction(`${t2.name}.timer`, "disable");
|
|
329417
329460
|
disabled++;
|
|
329418
329461
|
} catch {
|
|
329419
329462
|
}
|
|
329420
329463
|
try {
|
|
329421
|
-
userServiceAction(`${t2.name}.
|
|
329464
|
+
userServiceAction(`${t2.name}.service`, "disable");
|
|
329422
329465
|
} catch {
|
|
329423
329466
|
}
|
|
329467
|
+
for (const suffix of [".timer", ".service"]) {
|
|
329468
|
+
try {
|
|
329469
|
+
es(`rm -f "${userDir}/${t2.name}${suffix}"`, { stdio: "pipe" });
|
|
329470
|
+
} catch {
|
|
329471
|
+
}
|
|
329472
|
+
}
|
|
329473
|
+
}
|
|
329474
|
+
try {
|
|
329475
|
+
es("systemctl --user daemon-reload", { stdio: "pipe" });
|
|
329476
|
+
} catch {
|
|
329424
329477
|
}
|
|
329425
329478
|
} catch {
|
|
329426
329479
|
}
|
|
@@ -330307,6 +330360,8 @@ function removeCronByMarker(id) {
|
|
|
330307
330360
|
function disableUserTimerById(id) {
|
|
330308
330361
|
try {
|
|
330309
330362
|
const { execSync: es } = __require("node:child_process");
|
|
330363
|
+
const home = process.env.HOME || __require("node:os").homedir();
|
|
330364
|
+
const userDir = `${home}/.config/systemd/user`;
|
|
330310
330365
|
const names = [`oa-${id}`, `oa-sched-${id}`, id];
|
|
330311
330366
|
for (const n2 of names) {
|
|
330312
330367
|
try {
|
|
@@ -330317,6 +330372,16 @@ function disableUserTimerById(id) {
|
|
|
330317
330372
|
es(`systemctl --user stop ${n2}.service`, { stdio: "pipe" });
|
|
330318
330373
|
} catch {
|
|
330319
330374
|
}
|
|
330375
|
+
for (const suffix of [".timer", ".service"]) {
|
|
330376
|
+
try {
|
|
330377
|
+
es(`rm -f "${userDir}/${n2}${suffix}"`, { stdio: "pipe" });
|
|
330378
|
+
} catch {
|
|
330379
|
+
}
|
|
330380
|
+
}
|
|
330381
|
+
}
|
|
330382
|
+
try {
|
|
330383
|
+
es("systemctl --user daemon-reload", { stdio: "pipe" });
|
|
330384
|
+
} catch {
|
|
330320
330385
|
}
|
|
330321
330386
|
} catch {
|
|
330322
330387
|
}
|
package/package.json
CHANGED