open-agents-ai 0.187.337 → 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 +64 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -328240,16 +328240,43 @@ async function handleRequest(req2, res, ollamaUrl, verbose) {
|
|
|
328240
328240
|
let ok2 = false;
|
|
328241
328241
|
if (id.startsWith("timer:")) {
|
|
328242
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
|
+
}
|
|
328243
328251
|
try {
|
|
328244
328252
|
userServiceAction(`${name11}.timer`, "disable");
|
|
328245
|
-
ok2 = true;
|
|
328246
328253
|
} catch {
|
|
328247
|
-
ok2 = false;
|
|
328248
328254
|
}
|
|
328249
328255
|
try {
|
|
328250
|
-
userServiceAction(`${name11}.
|
|
328256
|
+
userServiceAction(`${name11}.service`, "disable");
|
|
328251
328257
|
} catch {
|
|
328252
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
|
+
}
|
|
328277
|
+
} catch {
|
|
328278
|
+
}
|
|
328279
|
+
ok2 = true;
|
|
328253
328280
|
} else {
|
|
328254
328281
|
ok2 = deleteScheduledById(id);
|
|
328255
328282
|
}
|
|
@@ -329415,17 +329442,38 @@ function killProcessGroups(pids, pattern) {
|
|
|
329415
329442
|
function disableAllOaTimers() {
|
|
329416
329443
|
let disabled = 0;
|
|
329417
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`;
|
|
329418
329448
|
const timers = listOaUserTimers();
|
|
329419
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
|
+
}
|
|
329420
329458
|
try {
|
|
329421
329459
|
userServiceAction(`${t2.name}.timer`, "disable");
|
|
329422
329460
|
disabled++;
|
|
329423
329461
|
} catch {
|
|
329424
329462
|
}
|
|
329425
329463
|
try {
|
|
329426
|
-
userServiceAction(`${t2.name}.
|
|
329464
|
+
userServiceAction(`${t2.name}.service`, "disable");
|
|
329427
329465
|
} catch {
|
|
329428
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 {
|
|
329429
329477
|
}
|
|
329430
329478
|
} catch {
|
|
329431
329479
|
}
|
|
@@ -330312,6 +330360,8 @@ function removeCronByMarker(id) {
|
|
|
330312
330360
|
function disableUserTimerById(id) {
|
|
330313
330361
|
try {
|
|
330314
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`;
|
|
330315
330365
|
const names = [`oa-${id}`, `oa-sched-${id}`, id];
|
|
330316
330366
|
for (const n2 of names) {
|
|
330317
330367
|
try {
|
|
@@ -330322,6 +330372,16 @@ function disableUserTimerById(id) {
|
|
|
330322
330372
|
es(`systemctl --user stop ${n2}.service`, { stdio: "pipe" });
|
|
330323
330373
|
} catch {
|
|
330324
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 {
|
|
330325
330385
|
}
|
|
330326
330386
|
} catch {
|
|
330327
330387
|
}
|
package/package.json
CHANGED