@integrity-labs/agt-cli 0.28.1199 → 0.28.1200

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
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-JPPFYGOQ.js";
43
+ } from "../chunk-LWF7F4IF.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
@@ -5200,7 +5200,7 @@ import { execFileSync, execSync } from "child_process";
5200
5200
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5201
5201
  import chalk17 from "chalk";
5202
5202
  import ora15 from "ora";
5203
- var cliVersion = true ? "0.28.1199" : "dev";
5203
+ var cliVersion = true ? "0.28.1200" : "dev";
5204
5204
  async function fetchLatestVersion() {
5205
5205
  const host2 = getHost();
5206
5206
  if (!host2) return null;
@@ -6460,7 +6460,7 @@ function handleError(err) {
6460
6460
  }
6461
6461
 
6462
6462
  // src/bin/agt.ts
6463
- var cliVersion2 = true ? "0.28.1199" : "dev";
6463
+ var cliVersion2 = true ? "0.28.1200" : "dev";
6464
6464
  var program = new Command();
6465
6465
  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");
6466
6466
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -8082,7 +8082,7 @@ function exchangeFailureKind(err) {
8082
8082
  }
8083
8083
 
8084
8084
  // src/lib/api-client.ts
8085
- var agtCliVersion = true ? "0.28.1199" : "dev";
8085
+ var agtCliVersion = true ? "0.28.1200" : "dev";
8086
8086
  var lastConfigHash = null;
8087
8087
  function setConfigHash(hash) {
8088
8088
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -13683,4 +13683,4 @@ export {
13683
13683
  managerInstallSystemUnitCommand,
13684
13684
  managerUninstallSystemUnitCommand
13685
13685
  };
13686
- //# sourceMappingURL=chunk-JPPFYGOQ.js.map
13686
+ //# sourceMappingURL=chunk-LWF7F4IF.js.map
@@ -85,7 +85,7 @@ import {
85
85
  tripClass,
86
86
  writeEtcEnvironment,
87
87
  writeProfileDScript
88
- } from "../chunk-JPPFYGOQ.js";
88
+ } from "../chunk-LWF7F4IF.js";
89
89
  import {
90
90
  CLAUDE_CODE_SECURITY_FLOOR,
91
91
  SELF_UPDATE_TIMEOUTS,
@@ -14653,6 +14653,7 @@ var CHANNEL_SWEEP_DRY_RUN = process.env["AGT_CHANNEL_SWEEP_DRY_RUN"] === "1";
14653
14653
  var lastChannelSweepAt = 0;
14654
14654
  var config = null;
14655
14655
  var running = false;
14656
+ var managerShutdownArmed = false;
14656
14657
  var pollTimer = null;
14657
14658
  var livenessTimer = null;
14658
14659
  var livenessInFlight = false;
@@ -16358,7 +16359,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
16358
16359
  var lastVersionCheckAt = 0;
16359
16360
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
16360
16361
  var lastResponsivenessProbeAt = 0;
16361
- var agtCliVersion = true ? "0.28.1199" : "dev";
16362
+ var agtCliVersion = true ? "0.28.1200" : "dev";
16362
16363
  function resolveBrewPath(execFileSync3) {
16363
16364
  try {
16364
16365
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -25833,6 +25834,10 @@ async function releaseInterruptedCardsOnDrain(snapshot) {
25833
25834
  );
25834
25835
  }
25835
25836
  async function stopPolling(opts = {}) {
25837
+ if (!managerShutdownArmed) {
25838
+ log("[drain] skipped: this process never started the manager");
25839
+ return;
25840
+ }
25836
25841
  running = false;
25837
25842
  if (pollTimer) {
25838
25843
  clearTimeout(pollTimer);
@@ -25902,6 +25907,7 @@ async function stopPolling(opts = {}) {
25902
25907
  }
25903
25908
  function startManager(opts) {
25904
25909
  log(`[startup] begin (pid=${process.pid}, node=${process.version}, interval=${opts.intervalMs}ms)`);
25910
+ armManagerShutdown();
25905
25911
  process.env["DISABLE_AUTOUPDATER"] = "1";
25906
25912
  config = opts;
25907
25913
  try {
@@ -26232,25 +26238,29 @@ async function stopManager() {
26232
26238
  await stopPolling();
26233
26239
  }
26234
26240
  var shuttingDown = false;
26235
- for (const sig of ["SIGTERM", "SIGINT"]) {
26236
- process.on(sig, () => {
26237
- if (shuttingDown) {
26238
- log(`Received ${sig} again during shutdown \u2014 ignoring (cleanup in progress)`);
26239
- return;
26240
- }
26241
- shuttingDown = true;
26242
- log(`Received ${sig}, shutting down`);
26241
+ function armManagerShutdown() {
26242
+ if (managerShutdownArmed) return;
26243
+ managerShutdownArmed = true;
26244
+ for (const sig of ["SIGTERM", "SIGINT"]) {
26245
+ process.on(sig, () => {
26246
+ if (shuttingDown) {
26247
+ log(`Received ${sig} again during shutdown \u2014 ignoring (cleanup in progress)`);
26248
+ return;
26249
+ }
26250
+ shuttingDown = true;
26251
+ log(`Received ${sig}, shutting down`);
26252
+ void stopPolling().then(() => {
26253
+ process.exit(0);
26254
+ });
26255
+ });
26256
+ }
26257
+ process.on("disconnect", () => {
26258
+ log("Parent disconnected, exiting");
26243
26259
  void stopPolling().then(() => {
26244
26260
  process.exit(0);
26245
26261
  });
26246
26262
  });
26247
26263
  }
26248
- process.on("disconnect", () => {
26249
- log("Parent disconnected, exiting");
26250
- void stopPolling().then(() => {
26251
- process.exit(0);
26252
- });
26253
- });
26254
26264
  export {
26255
26265
  BACK_ONLINE_GREETING_GUIDANCE,
26256
26266
  CHANNEL_SYNC_FREE_ATTEMPTS,
@@ -26269,6 +26279,7 @@ export {
26269
26279
  _claudePairTickForTests,
26270
26280
  applyMemoryTombstones,
26271
26281
  applyRestartAcks,
26282
+ armManagerShutdown,
26272
26283
  cancelKanbanNoticeOnDrain,
26273
26284
  channelSyncBackoffMs,
26274
26285
  classifyLazyDayRolloverReset,