@locusai/cli 0.15.3 → 0.15.4
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/bin/locus.js +18 -0
- package/package.json +4 -4
package/bin/locus.js
CHANGED
|
@@ -46389,6 +46389,20 @@ function runShell(cmd, args) {
|
|
|
46389
46389
|
proc.on("error", (err) => resolve2({ exitCode: 1, stdout, stderr: err.message }));
|
|
46390
46390
|
});
|
|
46391
46391
|
}
|
|
46392
|
+
async function killOrphanedProcesses() {
|
|
46393
|
+
const result = await runShell("pgrep", ["-f", "locus-telegram"]);
|
|
46394
|
+
const pids = result.stdout.trim().split(`
|
|
46395
|
+
`).filter((p) => p.length > 0);
|
|
46396
|
+
if (pids.length === 0)
|
|
46397
|
+
return;
|
|
46398
|
+
console.log(` ${c.info("▶")} Killing ${pids.length} orphaned locus-telegram process${pids.length > 1 ? "es" : ""}...`);
|
|
46399
|
+
await runShell("pkill", ["-f", "locus-telegram"]);
|
|
46400
|
+
await new Promise((resolve2) => setTimeout(resolve2, 2000));
|
|
46401
|
+
const check2 = await runShell("pgrep", ["-f", "locus-telegram"]);
|
|
46402
|
+
if (check2.stdout.trim().length > 0) {
|
|
46403
|
+
await runShell("pkill", ["-9", "-f", "locus-telegram"]);
|
|
46404
|
+
}
|
|
46405
|
+
}
|
|
46392
46406
|
function generateSystemdUnit(projectPath, user2, binaryPath, servicePath) {
|
|
46393
46407
|
return `[Unit]
|
|
46394
46408
|
Description=Locus AI Agent (Telegram bot + proposal scheduler)
|
|
@@ -46466,6 +46480,7 @@ async function uninstallSystemd() {
|
|
|
46466
46480
|
console.log(`
|
|
46467
46481
|
${c.dim("No systemd service found. Nothing to remove.")}
|
|
46468
46482
|
`);
|
|
46483
|
+
await killOrphanedProcesses();
|
|
46469
46484
|
return;
|
|
46470
46485
|
}
|
|
46471
46486
|
console.log(` ${c.info("▶")} Stopping and disabling ${SERVICE_NAME}...`);
|
|
@@ -46474,6 +46489,7 @@ async function uninstallSystemd() {
|
|
|
46474
46489
|
const { unlinkSync: unlinkSync6 } = await import("node:fs");
|
|
46475
46490
|
unlinkSync6(SYSTEMD_UNIT_PATH);
|
|
46476
46491
|
await runShell("systemctl", ["daemon-reload"]);
|
|
46492
|
+
await killOrphanedProcesses();
|
|
46477
46493
|
console.log(`
|
|
46478
46494
|
${c.success("✔")} ${c.bold("Locus service removed.")}
|
|
46479
46495
|
`);
|
|
@@ -46595,12 +46611,14 @@ async function uninstallLaunchd() {
|
|
|
46595
46611
|
console.log(`
|
|
46596
46612
|
${c.dim("No launchd service found. Nothing to remove.")}
|
|
46597
46613
|
`);
|
|
46614
|
+
await killOrphanedProcesses();
|
|
46598
46615
|
return;
|
|
46599
46616
|
}
|
|
46600
46617
|
console.log(` ${c.info("▶")} Unloading service...`);
|
|
46601
46618
|
await runShell("launchctl", ["unload", plistPath]);
|
|
46602
46619
|
const { unlinkSync: unlinkSync6 } = await import("node:fs");
|
|
46603
46620
|
unlinkSync6(plistPath);
|
|
46621
|
+
await killOrphanedProcesses();
|
|
46604
46622
|
console.log(`
|
|
46605
46623
|
${c.success("✔")} ${c.bold("Locus service removed.")}
|
|
46606
46624
|
`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/cli",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "CLI for Locus - AI-native project management platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@locusai/sdk": "^0.15.
|
|
36
|
-
"@locusai/shared": "^0.15.
|
|
37
|
-
"@locusai/telegram": "^0.15.
|
|
35
|
+
"@locusai/sdk": "^0.15.4",
|
|
36
|
+
"@locusai/shared": "^0.15.4",
|
|
37
|
+
"@locusai/telegram": "^0.15.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {}
|
|
40
40
|
}
|