@integrity-labs/agt-cli 0.27.56 → 0.27.58

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  claudeModelAlias,
3
3
  isClaudeFastMode
4
- } from "./chunk-5XPUZ2LX.js";
4
+ } from "./chunk-G3DT2L7S.js";
5
5
  import {
6
6
  reapOrphanChannelMcps
7
7
  } from "./chunk-XWVM4KPK.js";
@@ -1125,4 +1125,4 @@ export {
1125
1125
  stopAllSessionsAndWait,
1126
1126
  getProjectDir
1127
1127
  };
1128
- //# sourceMappingURL=chunk-CULZTAU2.js.map
1128
+ //# sourceMappingURL=chunk-GDTWUJAR.js.map
@@ -9,7 +9,7 @@ import {
9
9
  parseDeliveryTarget,
10
10
  registerFramework,
11
11
  wrapScheduledTaskPrompt
12
- } from "./chunk-5XPUZ2LX.js";
12
+ } from "./chunk-G3DT2L7S.js";
13
13
 
14
14
  // ../../packages/core/dist/integrations/registry.js
15
15
  var INTEGRATION_REGISTRY = [
@@ -7163,4 +7163,4 @@ export {
7163
7163
  managerInstallSystemUnitCommand,
7164
7164
  managerUninstallSystemUnitCommand
7165
7165
  };
7166
- //# sourceMappingURL=chunk-YQKUGTQC.js.map
7166
+ //# sourceMappingURL=chunk-XX2LDA5B.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-JD4ED7E7.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-34B7NB6V.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-HXSL4LE2.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-ODZPAKZU.js.map
@@ -15,7 +15,7 @@ import {
15
15
  provisionOrientHook,
16
16
  provisionStopHook,
17
17
  requireHost
18
- } from "../chunk-YQKUGTQC.js";
18
+ } from "../chunk-XX2LDA5B.js";
19
19
  import {
20
20
  getProjectDir as getProjectDir2,
21
21
  getReadyTasks,
@@ -46,7 +46,7 @@ import {
46
46
  stopAllSessionsAndWait,
47
47
  stopPersistentSession,
48
48
  takeZombieDetection
49
- } from "../chunk-CULZTAU2.js";
49
+ } from "../chunk-GDTWUJAR.js";
50
50
  import {
51
51
  KANBAN_CHECK_COMMAND,
52
52
  appendDmFooter,
@@ -69,7 +69,7 @@ import {
69
69
  resolveConnectivityProbe,
70
70
  resolveDmTarget,
71
71
  wrapScheduledTaskPrompt
72
- } from "../chunk-5XPUZ2LX.js";
72
+ } from "../chunk-G3DT2L7S.js";
73
73
  import {
74
74
  parsePsRows,
75
75
  reapOrphanChannelMcps
@@ -3598,7 +3598,7 @@ var cachedFrameworkVersion = null;
3598
3598
  var lastVersionCheckAt = 0;
3599
3599
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
3600
3600
  var lastResponsivenessProbeAt = 0;
3601
- var agtCliVersion = true ? "0.27.56" : "dev";
3601
+ var agtCliVersion = true ? "0.27.58" : "dev";
3602
3602
  function resolveBrewPath(execFileSync4) {
3603
3603
  try {
3604
3604
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -4673,7 +4673,7 @@ async function pollCycle() {
4673
4673
  }
4674
4674
  try {
4675
4675
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
4676
- const { collectDiagnostics } = await import("../persistent-session-JD4ED7E7.js");
4676
+ const { collectDiagnostics } = await import("../persistent-session-34B7NB6V.js");
4677
4677
  const diagCodeNames = [...agentState.persistentSessionAgents];
4678
4678
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
4679
4679
  let tailscaleHostname;
@@ -4741,7 +4741,7 @@ async function pollCycle() {
4741
4741
  const {
4742
4742
  collectResponsivenessProbes,
4743
4743
  getResponsivenessIntervalMs
4744
- } = await import("../responsiveness-probe-FAPRINQ6.js");
4744
+ } = await import("../responsiveness-probe-Z2WYE6BO.js");
4745
4745
  const probeIntervalMs = getResponsivenessIntervalMs();
4746
4746
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
4747
4747
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -8885,7 +8885,7 @@ async function processClaudePairSessions(agents) {
8885
8885
  killPairSession,
8886
8886
  pairTmuxSession,
8887
8887
  finalizeClaudePairOnboarding
8888
- } = await import("../claude-pair-runtime-HXSL4LE2.js");
8888
+ } = await import("../claude-pair-runtime-ODZPAKZU.js");
8889
8889
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
8890
8890
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
8891
8891
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -14372,6 +14372,21 @@ function oldestPendingMarkerAgeMs(dir, now = Date.now()) {
14372
14372
  }
14373
14373
  return oldest;
14374
14374
  }
14375
+ function isPendingMarkerStale(receivedAt, nowMs, thresholdMs) {
14376
+ if (!receivedAt) return true;
14377
+ const t = Date.parse(receivedAt);
14378
+ if (!Number.isFinite(t)) return true;
14379
+ if (t > nowMs) return true;
14380
+ return nowMs - t > thresholdMs;
14381
+ }
14382
+ function channelOrphanMarkerMs() {
14383
+ const raw = parseInt(process.env.AGT_CHANNEL_ORPHAN_MARKER_MS ?? "", 10);
14384
+ return Number.isFinite(raw) && raw > 0 ? raw : 30 * 6e4;
14385
+ }
14386
+ var ORPHAN_SWEEP_INTERVAL_MS = 30 * 60 * 1e3;
14387
+ function orphanSweepIntervalMs() {
14388
+ return Math.max(6e4, Math.min(ORPHAN_SWEEP_INTERVAL_MS, channelOrphanMarkerMs()));
14389
+ }
14375
14390
 
14376
14391
  // src/session-probe-runtime.ts
14377
14392
  import { execFileSync } from "child_process";
@@ -16077,7 +16092,7 @@ var STALE_MARKER_MS = 24 * 60 * 60 * 1e3;
16077
16092
  function trackPendingMessage(channel, threadTs, messageTs, undeliverable = false) {
16078
16093
  writeSlackPendingInboundMarker(channel, threadTs, messageTs, undeliverable);
16079
16094
  }
16080
- function sweepSlackStaleMarkersOnBoot() {
16095
+ function sweepSlackStaleMarkers(thresholdMs) {
16081
16096
  if (!SLACK_PENDING_INBOUND_DIR) return;
16082
16097
  if (!existsSync3(SLACK_PENDING_INBOUND_DIR)) return;
16083
16098
  let filenames;
@@ -16112,16 +16127,7 @@ function sweepSlackStaleMarkersOnBoot() {
16112
16127
  continue;
16113
16128
  }
16114
16129
  const { channel, thread_ts, message_ts, received_at } = marker;
16115
- if (!channel || !thread_ts || !message_ts || !received_at) {
16116
- try {
16117
- unlinkSync3(fullPath);
16118
- } catch {
16119
- }
16120
- cleared++;
16121
- continue;
16122
- }
16123
- const receivedAtMs = Date.parse(received_at);
16124
- if (!Number.isFinite(receivedAtMs) || receivedAtMs > now || now - receivedAtMs > STALE_MARKER_MS) {
16130
+ if (!channel || !thread_ts || !message_ts || isPendingMarkerStale(received_at, now, thresholdMs)) {
16125
16131
  try {
16126
16132
  unlinkSync3(fullPath);
16127
16133
  } catch {
@@ -16136,7 +16142,13 @@ function sweepSlackStaleMarkersOnBoot() {
16136
16142
  );
16137
16143
  }
16138
16144
  }
16139
- sweepSlackStaleMarkersOnBoot();
16145
+ sweepSlackStaleMarkers(STALE_MARKER_MS);
16146
+ var slackOrphanSweepTimer = setInterval(() => {
16147
+ const probe = process.env.TMUX && AGENT_CODE_NAME ? probeAgentSessionCached(AGENT_CODE_NAME) : { tmux: "unknown", claude: "unknown" };
16148
+ const sessionAlive = probe.tmux === "alive" && probe.claude === "alive";
16149
+ sweepSlackStaleMarkers(sessionAlive ? channelOrphanMarkerMs() : STALE_MARKER_MS);
16150
+ }, orphanSweepIntervalMs());
16151
+ slackOrphanSweepTimer.unref?.();
16140
16152
  var SLACK_PROCESS_BOOT_MS = Date.now();
16141
16153
  var STRANDED_INBOUND_MIN_AGE_FROM_BOOT_MS = 6e4;
16142
16154
  var STRANDED_INBOUND_MAX_AGE_MS = 5 * 60 * 1e3;
@@ -15553,6 +15553,21 @@ function oldestPendingMarkerAgeMs(dir, now = Date.now()) {
15553
15553
  }
15554
15554
  return oldest;
15555
15555
  }
15556
+ function isPendingMarkerStale(receivedAt, nowMs, thresholdMs) {
15557
+ if (!receivedAt) return true;
15558
+ const t = Date.parse(receivedAt);
15559
+ if (!Number.isFinite(t)) return true;
15560
+ if (t > nowMs) return true;
15561
+ return nowMs - t > thresholdMs;
15562
+ }
15563
+ function channelOrphanMarkerMs() {
15564
+ const raw = parseInt(process.env.AGT_CHANNEL_ORPHAN_MARKER_MS ?? "", 10);
15565
+ return Number.isFinite(raw) && raw > 0 ? raw : 30 * 6e4;
15566
+ }
15567
+ var ORPHAN_SWEEP_INTERVAL_MS = 30 * 60 * 1e3;
15568
+ function orphanSweepIntervalMs() {
15569
+ return Math.max(6e4, Math.min(ORPHAN_SWEEP_INTERVAL_MS, channelOrphanMarkerMs()));
15570
+ }
15556
15571
 
15557
15572
  // src/session-probe-runtime.ts
15558
15573
  import { execFileSync } from "child_process";
@@ -16228,7 +16243,7 @@ var STALE_MARKER_MS = 24 * 60 * 60 * 1e3;
16228
16243
  function trackPendingMessage(chatId, messageId, chatType, undeliverable = false) {
16229
16244
  writePendingInboundMarker(chatId, messageId, chatType, undeliverable);
16230
16245
  }
16231
- function sweepTelegramStaleMarkersOnBoot() {
16246
+ function sweepTelegramStaleMarkers(thresholdMs) {
16232
16247
  if (!PENDING_INBOUND_DIR) return;
16233
16248
  if (!existsSync2(PENDING_INBOUND_DIR)) return;
16234
16249
  let filenames;
@@ -16263,16 +16278,7 @@ function sweepTelegramStaleMarkersOnBoot() {
16263
16278
  continue;
16264
16279
  }
16265
16280
  const { chat_id, message_id, received_at } = marker;
16266
- if (!chat_id || !message_id || !received_at) {
16267
- try {
16268
- unlinkSync3(fullPath);
16269
- } catch {
16270
- }
16271
- cleared++;
16272
- continue;
16273
- }
16274
- const receivedAtMs = Date.parse(received_at);
16275
- if (!Number.isFinite(receivedAtMs) || receivedAtMs > now || now - receivedAtMs > STALE_MARKER_MS) {
16281
+ if (!chat_id || !message_id || isPendingMarkerStale(received_at, now, thresholdMs)) {
16276
16282
  try {
16277
16283
  unlinkSync3(fullPath);
16278
16284
  } catch {
@@ -16287,7 +16293,13 @@ function sweepTelegramStaleMarkersOnBoot() {
16287
16293
  );
16288
16294
  }
16289
16295
  }
16290
- sweepTelegramStaleMarkersOnBoot();
16296
+ sweepTelegramStaleMarkers(STALE_MARKER_MS);
16297
+ var orphanSweepTimer = setInterval(() => {
16298
+ const probe = process.env.TMUX && AGENT_CODE_NAME && AGENT_CODE_NAME !== "unknown" ? probeAgentSessionCached(AGENT_CODE_NAME) : { tmux: "unknown", claude: "unknown" };
16299
+ const sessionAlive = probe.tmux === "alive" && probe.claude === "alive";
16300
+ sweepTelegramStaleMarkers(sessionAlive ? channelOrphanMarkerMs() : STALE_MARKER_MS);
16301
+ }, orphanSweepIntervalMs());
16302
+ orphanSweepTimer.unref?.();
16291
16303
  function clearPendingMessage(chatId, messageId) {
16292
16304
  if (messageId) {
16293
16305
  clearPendingInboundMarker(chatId, messageId);
@@ -17147,13 +17159,22 @@ async function pollLoop() {
17147
17159
  }
17148
17160
  const messageId = String(msg.message_id);
17149
17161
  const ackProbe = process.env.TMUX && AGENT_CODE_NAME && AGENT_CODE_NAME !== "unknown" ? probeAgentSessionCached(AGENT_CODE_NAME) : { tmux: "unknown", claude: "unknown" };
17162
+ let paneLogFreshAgeMs = null;
17163
+ if (AGENT_DIR) {
17164
+ try {
17165
+ const paneMtimeMs = statSync(join4(AGENT_DIR, "pane.log")).mtimeMs;
17166
+ paneLogFreshAgeMs = Math.max(0, Date.now() - paneMtimeMs);
17167
+ } catch {
17168
+ }
17169
+ }
17150
17170
  const ackDecision = decideAckReaction({
17151
17171
  hasTarget: Boolean(chatId && messageId),
17152
17172
  integrationReady: Boolean(BOT_TOKEN),
17153
17173
  tmux: ackProbe.tmux,
17154
17174
  claude: ackProbe.claude,
17155
17175
  withinStartupGrace: process.uptime() * 1e3 < ACK_STARTUP_GRACE_MS,
17156
- oldestPendingAgeMs: oldestPendingMarkerAgeMs(PENDING_INBOUND_DIR)
17176
+ oldestPendingAgeMs: oldestPendingMarkerAgeMs(PENDING_INBOUND_DIR),
17177
+ paneLogFreshAgeMs
17157
17178
  });
17158
17179
  if (ackDecision === "ack") {
17159
17180
  void setMessageReaction(chatId, messageId, ACK_EMOJI);
@@ -21,8 +21,8 @@ import {
21
21
  stopPersistentSession,
22
22
  takeZombieDetection,
23
23
  writePersistentClaudeWrapper
24
- } from "./chunk-CULZTAU2.js";
25
- import "./chunk-5XPUZ2LX.js";
24
+ } from "./chunk-GDTWUJAR.js";
25
+ import "./chunk-G3DT2L7S.js";
26
26
  import "./chunk-XWVM4KPK.js";
27
27
  export {
28
28
  SEND_KEYS_ENTER_DELAY_MS,
@@ -48,4 +48,4 @@ export {
48
48
  takeZombieDetection,
49
49
  writePersistentClaudeWrapper
50
50
  };
51
- //# sourceMappingURL=persistent-session-JD4ED7E7.js.map
51
+ //# sourceMappingURL=persistent-session-34B7NB6V.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-CULZTAU2.js";
4
- import "./chunk-5XPUZ2LX.js";
3
+ } from "./chunk-GDTWUJAR.js";
4
+ import "./chunk-G3DT2L7S.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -30,4 +30,4 @@ export {
30
30
  collectResponsivenessProbes,
31
31
  getResponsivenessIntervalMs
32
32
  };
33
- //# sourceMappingURL=responsiveness-probe-FAPRINQ6.js.map
33
+ //# sourceMappingURL=responsiveness-probe-Z2WYE6BO.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.27.56",
3
+ "version": "0.27.58",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {