@integrity-labs/agt-cli 0.28.216 → 0.28.217

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
@@ -38,7 +38,7 @@ import {
38
38
  success,
39
39
  table,
40
40
  warn
41
- } from "../chunk-6DMZIXM6.js";
41
+ } from "../chunk-U6RV5FVC.js";
42
42
  import {
43
43
  CHANNEL_REGISTRY,
44
44
  DEFAULT_FRAMEWORK,
@@ -4826,7 +4826,7 @@ import { execFileSync, execSync } from "child_process";
4826
4826
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4827
4827
  import chalk18 from "chalk";
4828
4828
  import ora16 from "ora";
4829
- var cliVersion = true ? "0.28.216" : "dev";
4829
+ var cliVersion = true ? "0.28.217" : "dev";
4830
4830
  async function fetchLatestVersion() {
4831
4831
  const host2 = getHost();
4832
4832
  if (!host2) return null;
@@ -5840,7 +5840,7 @@ function handleError(err) {
5840
5840
  }
5841
5841
 
5842
5842
  // src/bin/agt.ts
5843
- var cliVersion2 = true ? "0.28.216" : "dev";
5843
+ var cliVersion2 = true ? "0.28.217" : "dev";
5844
5844
  var program = new Command();
5845
5845
  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");
5846
5846
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -5529,7 +5529,7 @@ function requireHost() {
5529
5529
  }
5530
5530
 
5531
5531
  // src/lib/api-client.ts
5532
- var agtCliVersion = true ? "0.28.216" : "dev";
5532
+ var agtCliVersion = true ? "0.28.217" : "dev";
5533
5533
  var lastConfigHash = null;
5534
5534
  function setConfigHash(hash) {
5535
5535
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -7581,4 +7581,4 @@ export {
7581
7581
  managerInstallSystemUnitCommand,
7582
7582
  managerUninstallSystemUnitCommand
7583
7583
  };
7584
- //# sourceMappingURL=chunk-6DMZIXM6.js.map
7584
+ //# sourceMappingURL=chunk-U6RV5FVC.js.map
@@ -36,7 +36,7 @@ import {
36
36
  requireHost,
37
37
  safeWriteJsonAtomic,
38
38
  setConfigHash
39
- } from "../chunk-6DMZIXM6.js";
39
+ } from "../chunk-U6RV5FVC.js";
40
40
  import {
41
41
  getProjectDir as getProjectDir2,
42
42
  getReadyTasks,
@@ -5412,6 +5412,9 @@ var lastChannelSweepAt = 0;
5412
5412
  var config = null;
5413
5413
  var running = false;
5414
5414
  var pollTimer = null;
5415
+ var livenessTimer = null;
5416
+ var livenessInFlight = false;
5417
+ var LIVENESS_HEARTBEAT_INTERVAL_MS = 3e4;
5415
5418
  var PANE_TAIL_PREVIEW_LINES = 5;
5416
5419
  function extractCharterTelegramPeers(rawContent, gateContext) {
5417
5420
  if (!rawContent || rawContent.length === 0) return [];
@@ -6221,7 +6224,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
6221
6224
  var lastVersionCheckAt = 0;
6222
6225
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6223
6226
  var lastResponsivenessProbeAt = 0;
6224
- var agtCliVersion = true ? "0.28.216" : "dev";
6227
+ var agtCliVersion = true ? "0.28.217" : "dev";
6225
6228
  function resolveBrewPath(execFileSync2) {
6226
6229
  try {
6227
6230
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -10775,9 +10778,27 @@ async function driveArtifactStreamingInner() {
10775
10778
  if (!liveIds.has(id)) artifactScanners.delete(id);
10776
10779
  }
10777
10780
  }
10781
+ async function postLivenessHeartbeat() {
10782
+ if (!running || !config || restartAfterUpgrade) return;
10783
+ if (livenessInFlight) return;
10784
+ livenessInFlight = true;
10785
+ try {
10786
+ const hostId = await getHostId();
10787
+ if (!hostId) return;
10788
+ await api.post("/host/heartbeat", { host_id: hostId, agt_version: agtCliVersion });
10789
+ } catch (err) {
10790
+ log(`[liveness] fast heartbeat failed: ${err.message}`);
10791
+ } finally {
10792
+ livenessInFlight = false;
10793
+ }
10794
+ }
10778
10795
  function startPolling() {
10779
10796
  if (!config || running) return;
10780
10797
  running = true;
10798
+ livenessTimer = setInterval(() => {
10799
+ void postLivenessHeartbeat();
10800
+ }, LIVENESS_HEARTBEAT_INTERVAL_MS);
10801
+ livenessTimer.unref();
10781
10802
  void startCaffeinate();
10782
10803
  loadChannelHashCache2();
10783
10804
  hostFlagStore().init();
@@ -10865,6 +10886,10 @@ async function stopPolling(opts = {}) {
10865
10886
  clearTimeout(pollTimer);
10866
10887
  pollTimer = null;
10867
10888
  }
10889
+ if (livenessTimer) {
10890
+ clearInterval(livenessTimer);
10891
+ livenessTimer = null;
10892
+ }
10868
10893
  const shutdownTimer = setTimeout(() => {
10869
10894
  log("Shutdown timeout exceeded (15s), forcing exit");
10870
10895
  process.exit(opts.forcedExitCode ?? 1);