@integrity-labs/agt-cli 0.28.226 → 0.28.228

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.
@@ -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-AIX7H4CC.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-VZ44GVA4.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-NWOXCBWA.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-CGFYM63W.js.map
@@ -37,7 +37,7 @@ import {
37
37
  requireHost,
38
38
  safeWriteJsonAtomic,
39
39
  setConfigHash
40
- } from "../chunk-IRMBTIZO.js";
40
+ } from "../chunk-STDJAYQQ.js";
41
41
  import {
42
42
  getProjectDir as getProjectDir2,
43
43
  getReadyTasks,
@@ -122,7 +122,7 @@ import {
122
122
  takeZombieDetection,
123
123
  transcriptActivityAgeSeconds,
124
124
  writeEgressAllowlist
125
- } from "../chunk-C2EXC6LY.js";
125
+ } from "../chunk-VV5IXUN6.js";
126
126
  import {
127
127
  reapOrphanChannelMcps
128
128
  } from "../chunk-XWVM4KPK.js";
@@ -6134,6 +6134,11 @@ async function runAgentConnectivityProbes(agent, integrations, projectDir) {
6134
6134
  );
6135
6135
  }
6136
6136
  }
6137
+ var sessionToolRebindCooldownAt = /* @__PURE__ */ new Map();
6138
+ var SESSION_TOOL_REBIND_COOLDOWN_MS = 10 * 60 * 1e3;
6139
+ function sessionToolRebindKey(codeName, serverKey) {
6140
+ return `${codeName}\0${serverKey}`;
6141
+ }
6137
6142
  async function runAgentSessionToolBindProbes(agent, integrations, projectDir) {
6138
6143
  if (integrations.length === 0) return;
6139
6144
  const intervalSec = Number(process.env.AGT_CONNECTIVITY_PROBE_INTERVAL_SECONDS) || 3600;
@@ -6153,6 +6158,36 @@ async function runAgentSessionToolBindProbes(agent, integrations, projectDir) {
6153
6158
  `Session-tool-bind probe for '${agent.code_name}': probed=${result.probed} reported=${result.reports.length} due=${result.due}`
6154
6159
  );
6155
6160
  }
6161
+ if (result && result.rebindCandidates.length > 0 && hostFlagStore().getBoolean("session-tool-rebind")) {
6162
+ let mcpJsonForRebind = null;
6163
+ try {
6164
+ mcpJsonForRebind = JSON.parse(readFileSync14(join16(projectDir, ".mcp.json"), "utf-8"));
6165
+ } catch {
6166
+ mcpJsonForRebind = null;
6167
+ }
6168
+ const isolated = isolationMode(agent.code_name) === "docker";
6169
+ const now = Date.now();
6170
+ for (const candidate of result.rebindCandidates) {
6171
+ const keysToReap = candidate.serverKeys.filter((k) => {
6172
+ const last = sessionToolRebindCooldownAt.get(sessionToolRebindKey(agent.code_name, k));
6173
+ return last === void 0 || now - last >= SESSION_TOOL_REBIND_COOLDOWN_MS;
6174
+ });
6175
+ if (keysToReap.length === 0) continue;
6176
+ reapStaleMcpChildren({
6177
+ log,
6178
+ codeName: agent.code_name,
6179
+ serverKeys: keysToReap,
6180
+ mcpJson: mcpJsonForRebind,
6181
+ isolated
6182
+ });
6183
+ for (const k of keysToReap) {
6184
+ sessionToolRebindCooldownAt.set(sessionToolRebindKey(agent.code_name, k), now);
6185
+ }
6186
+ log(
6187
+ `Session-tool rebind for '${agent.code_name}': ${candidate.status} integration=${candidate.integration_id} reaped MCP child(ren) [${keysToReap.join(", ")}] for respawn`
6188
+ );
6189
+ }
6190
+ }
6156
6191
  }
6157
6192
  function stopPersistentSessionAndForgetMcpBaseline(codeName, breakerReason, gateReason = breakerReason) {
6158
6193
  const gate = restartGateFor(codeName, gateReason);
@@ -6338,7 +6373,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
6338
6373
  var lastVersionCheckAt = 0;
6339
6374
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6340
6375
  var lastResponsivenessProbeAt = 0;
6341
- var agtCliVersion = true ? "0.28.226" : "dev";
6376
+ var agtCliVersion = true ? "0.28.228" : "dev";
6342
6377
  function resolveBrewPath(execFileSync2) {
6343
6378
  try {
6344
6379
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7263,7 +7298,7 @@ async function pollCycle() {
7263
7298
  }
7264
7299
  try {
7265
7300
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
7266
- const { collectDiagnostics } = await import("../persistent-session-AIX7H4CC.js");
7301
+ const { collectDiagnostics } = await import("../persistent-session-VZ44GVA4.js");
7267
7302
  const diagCodeNames = [...agentState.persistentSessionAgents];
7268
7303
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
7269
7304
  let tailscaleHostname;
@@ -7411,7 +7446,7 @@ async function pollCycle() {
7411
7446
  const {
7412
7447
  collectResponsivenessProbes,
7413
7448
  getResponsivenessIntervalMs
7414
- } = await import("../responsiveness-probe-VBXDCOHO.js");
7449
+ } = await import("../responsiveness-probe-DLIVXYKX.js");
7415
7450
  const probeIntervalMs = getResponsivenessIntervalMs();
7416
7451
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
7417
7452
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -7443,7 +7478,7 @@ async function pollCycle() {
7443
7478
  collectResponsivenessProbes,
7444
7479
  livePendingInboundOldestAgeSeconds,
7445
7480
  parkPendingInbound
7446
- } = await import("../responsiveness-probe-VBXDCOHO.js");
7481
+ } = await import("../responsiveness-probe-DLIVXYKX.js");
7447
7482
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
7448
7483
  const wedgeNow = /* @__PURE__ */ new Date();
7449
7484
  const liveAgents = agentState.persistentSessionAgents;
@@ -7714,7 +7749,7 @@ async function pollCycle() {
7714
7749
  if (restartedCodeNames.length > 0) {
7715
7750
  void (async () => {
7716
7751
  try {
7717
- const { collectDiagnostics } = await import("../persistent-session-AIX7H4CC.js");
7752
+ const { collectDiagnostics } = await import("../persistent-session-VZ44GVA4.js");
7718
7753
  const freshDiagnostics = collectDiagnostics(restartedCodeNames);
7719
7754
  await api.post("/host/heartbeat", {
7720
7755
  host_id: hostId,
@@ -10217,7 +10252,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
10217
10252
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
10218
10253
  void (async () => {
10219
10254
  try {
10220
- const { collectDiagnostics } = await import("../persistent-session-AIX7H4CC.js");
10255
+ const { collectDiagnostics } = await import("../persistent-session-VZ44GVA4.js");
10221
10256
  await api.post("/host/heartbeat", {
10222
10257
  host_id: hostId,
10223
10258
  agent_diagnostics: collectDiagnostics([codeName])
@@ -10611,7 +10646,7 @@ async function processClaudePairSessions(agents) {
10611
10646
  killPairSession,
10612
10647
  pairTmuxSession,
10613
10648
  finalizeClaudePairOnboarding
10614
- } = await import("../claude-pair-runtime-NWOXCBWA.js");
10649
+ } = await import("../claude-pair-runtime-CGFYM63W.js");
10615
10650
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
10616
10651
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
10617
10652
  const killed = await killPairSession(pairTmuxSession(pairId));