@integrity-labs/agt-cli 0.28.216 → 0.28.218

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.
@@ -18,7 +18,7 @@ import {
18
18
  resolveConnectivityProbe,
19
19
  worseConnectivityOutcome,
20
20
  wrapScheduledTaskPrompt
21
- } from "./chunk-HMYD3ZSI.js";
21
+ } from "./chunk-DPKDUDVU.js";
22
22
  import {
23
23
  parsePsRows
24
24
  } from "./chunk-XWVM4KPK.js";
@@ -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.218" : "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-XVS6GYQF.js.map
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-ORUB5EN3.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-AMBAOJ37.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-I56B5ONN.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-NNXVFT7K.js.map
@@ -36,7 +36,7 @@ import {
36
36
  requireHost,
37
37
  safeWriteJsonAtomic,
38
38
  setConfigHash
39
- } from "../chunk-6DMZIXM6.js";
39
+ } from "../chunk-XVS6GYQF.js";
40
40
  import {
41
41
  getProjectDir as getProjectDir2,
42
42
  getReadyTasks,
@@ -121,7 +121,7 @@ import {
121
121
  takeZombieDetection,
122
122
  transcriptActivityAgeSeconds,
123
123
  writeEgressAllowlist
124
- } from "../chunk-HMYD3ZSI.js";
124
+ } from "../chunk-DPKDUDVU.js";
125
125
  import {
126
126
  reapOrphanChannelMcps
127
127
  } from "../chunk-XWVM4KPK.js";
@@ -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.218" : "dev";
6225
6228
  function resolveBrewPath(execFileSync2) {
6226
6229
  try {
6227
6230
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7130,7 +7133,7 @@ async function pollCycle() {
7130
7133
  }
7131
7134
  try {
7132
7135
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
7133
- const { collectDiagnostics } = await import("../persistent-session-ORUB5EN3.js");
7136
+ const { collectDiagnostics } = await import("../persistent-session-AMBAOJ37.js");
7134
7137
  const diagCodeNames = [...agentState.persistentSessionAgents];
7135
7138
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
7136
7139
  let tailscaleHostname;
@@ -7278,7 +7281,7 @@ async function pollCycle() {
7278
7281
  const {
7279
7282
  collectResponsivenessProbes,
7280
7283
  getResponsivenessIntervalMs
7281
- } = await import("../responsiveness-probe-GM66ELIO.js");
7284
+ } = await import("../responsiveness-probe-K5MOPKCC.js");
7282
7285
  const probeIntervalMs = getResponsivenessIntervalMs();
7283
7286
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
7284
7287
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -7310,7 +7313,7 @@ async function pollCycle() {
7310
7313
  collectResponsivenessProbes,
7311
7314
  livePendingInboundOldestAgeSeconds,
7312
7315
  parkPendingInbound
7313
- } = await import("../responsiveness-probe-GM66ELIO.js");
7316
+ } = await import("../responsiveness-probe-K5MOPKCC.js");
7314
7317
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
7315
7318
  const wedgeNow = /* @__PURE__ */ new Date();
7316
7319
  const liveAgents = agentState.persistentSessionAgents;
@@ -10331,7 +10334,7 @@ async function processClaudePairSessions(agents) {
10331
10334
  killPairSession,
10332
10335
  pairTmuxSession,
10333
10336
  finalizeClaudePairOnboarding
10334
- } = await import("../claude-pair-runtime-I56B5ONN.js");
10337
+ } = await import("../claude-pair-runtime-NNXVFT7K.js");
10335
10338
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
10336
10339
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
10337
10340
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -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);