@integrity-labs/agt-cli 0.16.0 → 0.16.1

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/bin/agt.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  success,
49
49
  table,
50
50
  warn
51
- } from "../chunk-LU6L2J32.js";
51
+ } from "../chunk-ITLXAEXI.js";
52
52
 
53
53
  // src/bin/agt.ts
54
54
  import { join as join10 } from "path";
@@ -3732,7 +3732,7 @@ import { execFileSync, execSync } from "child_process";
3732
3732
  import { existsSync as existsSync5, realpathSync } from "fs";
3733
3733
  import chalk17 from "chalk";
3734
3734
  import ora15 from "ora";
3735
- var cliVersion = true ? "0.16.0" : "dev";
3735
+ var cliVersion = true ? "0.16.1" : "dev";
3736
3736
  async function fetchLatestVersion() {
3737
3737
  const host2 = getHost();
3738
3738
  if (!host2) return null;
@@ -3761,12 +3761,21 @@ function isNewerVersion(local, remote) {
3761
3761
  if (rMin !== lMin) return rMin > lMin;
3762
3762
  return rPat > lPat;
3763
3763
  }
3764
+ function isPidAlive(pid) {
3765
+ if (!Number.isInteger(pid) || pid <= 0) return false;
3766
+ try {
3767
+ process.kill(pid, 0);
3768
+ return true;
3769
+ } catch (err) {
3770
+ return err.code === "EPERM";
3771
+ }
3772
+ }
3764
3773
  function detectActiveSessions() {
3765
3774
  let managerPid = null;
3766
3775
  try {
3767
3776
  const pid = execSync('pgrep -f "agt.*(manage|manager)" 2>/dev/null || true', { encoding: "utf-8" }).trim();
3768
3777
  const ownPid = String(process.pid);
3769
- const pids = pid.split("\n").filter((p) => p && p !== ownPid);
3778
+ const pids = pid.split("\n").map((p) => p.trim()).filter((p) => p && p !== ownPid).filter((p) => isPidAlive(Number(p)));
3770
3779
  managerPid = pids[0] ?? null;
3771
3780
  } catch {
3772
3781
  }
@@ -4181,7 +4190,7 @@ function handleError(err) {
4181
4190
  }
4182
4191
 
4183
4192
  // src/bin/agt.ts
4184
- var cliVersion2 = true ? "0.16.0" : "dev";
4193
+ var cliVersion2 = true ? "0.16.1" : "dev";
4185
4194
  var program = new Command();
4186
4195
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
4187
4196
  program.hook("preAction", (thisCommand) => {