@integrity-labs/agt-cli 0.28.105 → 0.28.107

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.
@@ -3,7 +3,7 @@ import {
3
3
  formatMissingVar,
4
4
  isClaudeFastMode,
5
5
  probeMcpEnvSubstitution
6
- } from "./chunk-YUTJO6FU.js";
6
+ } from "./chunk-D22IMWAZ.js";
7
7
  import {
8
8
  reapOrphanChannelMcps
9
9
  } from "./chunk-XWVM4KPK.js";
@@ -1565,4 +1565,4 @@ export {
1565
1565
  stopAllSessionsAndWait,
1566
1566
  getProjectDir
1567
1567
  };
1568
- //# sourceMappingURL=chunk-GBE523G5.js.map
1568
+ //# sourceMappingURL=chunk-O4OYAFTZ.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveConnectivityProbe,
23
23
  worseConnectivityOutcome,
24
24
  wrapScheduledTaskPrompt
25
- } from "./chunk-YUTJO6FU.js";
25
+ } from "./chunk-D22IMWAZ.js";
26
26
 
27
27
  // ../../packages/core/dist/integrations/registry.js
28
28
  var INTEGRATION_REGISTRY = [
@@ -7600,7 +7600,7 @@ function requireHost() {
7600
7600
  }
7601
7601
 
7602
7602
  // src/lib/api-client.ts
7603
- var agtCliVersion = true ? "0.28.105" : "dev";
7603
+ var agtCliVersion = true ? "0.28.107" : "dev";
7604
7604
  var lastConfigHash = null;
7605
7605
  function setConfigHash(hash) {
7606
7606
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8897,4 +8897,4 @@ export {
8897
8897
  managerInstallSystemUnitCommand,
8898
8898
  managerUninstallSystemUnitCommand
8899
8899
  };
8900
- //# sourceMappingURL=chunk-5EVWGQ5X.js.map
8900
+ //# sourceMappingURL=chunk-WFMJOGRV.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-Q65SZNJ6.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-RMRG5HXI.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-WOE2EELU.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-6DZEDQAG.js.map
@@ -28,7 +28,7 @@ import {
28
28
  requireHost,
29
29
  safeWriteJsonAtomic,
30
30
  setConfigHash
31
- } from "../chunk-5EVWGQ5X.js";
31
+ } from "../chunk-WFMJOGRV.js";
32
32
  import {
33
33
  getProjectDir as getProjectDir2,
34
34
  getReadyTasks,
@@ -51,6 +51,7 @@ import {
51
51
  isAgentPromptReady,
52
52
  isSessionHealthy,
53
53
  isStaleForToday,
54
+ isolationMode,
54
55
  paneLogPath,
55
56
  peekCurrentSession,
56
57
  prepareForRespawn,
@@ -71,7 +72,7 @@ import {
71
72
  takeZombieDetection,
72
73
  transcriptActivityAgeSeconds,
73
74
  writeEgressAllowlist
74
- } from "../chunk-GBE523G5.js";
75
+ } from "../chunk-O4OYAFTZ.js";
75
76
  import {
76
77
  FLAGS_SCHEMA_VERSION,
77
78
  FLAG_REGISTRY,
@@ -96,6 +97,7 @@ import {
96
97
  isParseError,
97
98
  isResolveError,
98
99
  isSelfCompletion,
100
+ laneTagFragment,
99
101
  parseDeliveryTarget,
100
102
  parseEnvIntegrations,
101
103
  parseTranscriptUsage,
@@ -106,7 +108,7 @@ import {
106
108
  resolveDmTarget,
107
109
  sumTranscriptUsageInWindow,
108
110
  wrapScheduledTaskPrompt
109
- } from "../chunk-YUTJO6FU.js";
111
+ } from "../chunk-D22IMWAZ.js";
110
112
  import {
111
113
  parsePsRows,
112
114
  reapOrphanChannelMcps
@@ -342,8 +344,9 @@ function buildClaudeAgentMatcher(codeName) {
342
344
  function findMcpChildrenForAgent(args) {
343
345
  const { rows, codeName, serverKeys, mcpJson } = args;
344
346
  const maxDepth = args.maxDepth ?? 8;
347
+ const inContainer = args.inContainer ?? false;
345
348
  if (serverKeys.length === 0 || rows.length === 0) return [];
346
- const claudeMatcher = buildClaudeAgentMatcher(codeName);
349
+ const claudeMatcher = inContainer ? /\bclaude\b/ : buildClaudeAgentMatcher(codeName);
347
350
  const argvMatchers = [];
348
351
  for (const key of serverKeys) {
349
352
  const entry = mcpJson?.mcpServers?.[key];
@@ -486,7 +489,7 @@ function givenUpMcpServerKeys(codeName) {
486
489
  return out;
487
490
  }
488
491
  function findMissingMcpServers(args) {
489
- const { rows, codeName, mcpJson } = args;
492
+ const { rows, codeName, mcpJson, inContainer } = args;
490
493
  const servers = mcpJson?.mcpServers ?? {};
491
494
  const declared = Object.keys(servers);
492
495
  if (declared.length === 0) return [];
@@ -499,7 +502,8 @@ function findMissingMcpServers(args) {
499
502
  rows,
500
503
  codeName,
501
504
  serverKeys: [key],
502
- mcpJson
505
+ mcpJson,
506
+ inContainer
503
507
  });
504
508
  if (live.length === 0) missing.push(key);
505
509
  }
@@ -522,10 +526,14 @@ function reapMissingMcpSessions(args) {
522
526
  classifyKey = () => "essential",
523
527
  quarantineDwellMs = 0,
524
528
  quarantineMode = "off",
525
- onQuarantine
529
+ onQuarantine,
530
+ isolated = false
526
531
  } = args;
527
532
  const now = args.now ?? Date.now;
528
- const runPs = args.runPs ?? (() => execFileSync2("ps", ["-eo", "pid,ppid,args"], { encoding: "utf-8", timeout: 5e3 }));
533
+ const runPs = args.runPs ?? (isolated ? () => execFileSync2("docker", ["exec", `agt-${codeName}`, "ps", "-eo", "pid,ppid,args"], {
534
+ encoding: "utf-8",
535
+ timeout: 8e3
536
+ }) : () => execFileSync2("ps", ["-eo", "pid,ppid,args"], { encoding: "utf-8", timeout: 5e3 }));
529
537
  if (!mcpJson?.mcpServers) {
530
538
  return { missing: [], restarted: false, reason: "no-mcp-json" };
531
539
  }
@@ -550,7 +558,7 @@ function reapMissingMcpSessions(args) {
550
558
  return { missing: [], restarted: false, reason: "healthy" };
551
559
  }
552
560
  const rows = parsePsRows(psOutput);
553
- const missingRaw = findMissingMcpServers({ rows, codeName, mcpJson });
561
+ const missingRaw = findMissingMcpServers({ rows, codeName, mcpJson, inContainer: isolated });
554
562
  const rotationGraced = [];
555
563
  const missing = [];
556
564
  for (const key of missingRaw) {
@@ -6992,7 +7000,7 @@ var cachedMaintenanceWindow = null;
6992
7000
  var lastVersionCheckAt = 0;
6993
7001
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6994
7002
  var lastResponsivenessProbeAt = 0;
6995
- var agtCliVersion = true ? "0.28.105" : "dev";
7003
+ var agtCliVersion = true ? "0.28.107" : "dev";
6996
7004
  function resolveBrewPath(execFileSync4) {
6997
7005
  try {
6998
7006
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -8103,7 +8111,7 @@ async function pollCycle() {
8103
8111
  }
8104
8112
  try {
8105
8113
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
8106
- const { collectDiagnostics } = await import("../persistent-session-Q65SZNJ6.js");
8114
+ const { collectDiagnostics } = await import("../persistent-session-RMRG5HXI.js");
8107
8115
  const diagCodeNames = [...agentState.persistentSessionAgents];
8108
8116
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
8109
8117
  let tailscaleHostname;
@@ -8204,7 +8212,7 @@ async function pollCycle() {
8204
8212
  const {
8205
8213
  collectResponsivenessProbes,
8206
8214
  getResponsivenessIntervalMs
8207
- } = await import("../responsiveness-probe-FS3JNFI2.js");
8215
+ } = await import("../responsiveness-probe-2KVIALGI.js");
8208
8216
  const probeIntervalMs = getResponsivenessIntervalMs();
8209
8217
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
8210
8218
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -8236,7 +8244,7 @@ async function pollCycle() {
8236
8244
  collectResponsivenessProbes,
8237
8245
  livePendingInboundOldestAgeSeconds,
8238
8246
  parkPendingInbound
8239
- } = await import("../responsiveness-probe-FS3JNFI2.js");
8247
+ } = await import("../responsiveness-probe-2KVIALGI.js");
8240
8248
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
8241
8249
  const wedgeNow = /* @__PURE__ */ new Date();
8242
8250
  const liveAgents = agentState.persistentSessionAgents;
@@ -10140,6 +10148,10 @@ async function processAgent(agent, agentStates) {
10140
10148
  codeName: agent.code_name,
10141
10149
  mcpJson: mcpJsonParsed,
10142
10150
  sessionStartedAt: sess?.startedAt ?? null,
10151
+ // ENG-6660: under Docker the MCP children live in the agent's container
10152
+ // PID namespace - probe inside it (docker exec ps) instead of the host,
10153
+ // or every declared MCP looks "missing" -> restart loop -> flapping.
10154
+ isolated: isolationMode(agent.code_name) === "docker",
10143
10155
  // ENG-6486: a restart is already scheduled/deferred for this agent (e.g.
10144
10156
  // a freshly-added channel awaiting its convergence restart, deferred by
10145
10157
  // the maintenance window). The pending restart will spawn the declared-
@@ -11345,7 +11357,7 @@ async function processDirectChatMessage(agent, msg) {
11345
11357
  }
11346
11358
  }
11347
11359
  const escapeXml = (value) => value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&apos;");
11348
- const channelEnvelope = `<channel source="direct-chat" session_id="${escapeXml(msg.session_id)}" user="webapp">
11360
+ const channelEnvelope = `<channel source="direct-chat" session_id="${escapeXml(msg.session_id)}" user="webapp" ${laneTagFragment("conversational", true)}>
11349
11361
  ${escapeXml(msg.content)}
11350
11362
  </channel>`;
11351
11363
  const delivered = await injectMessage(
@@ -11764,7 +11776,7 @@ async function processClaudePairSessions(agents) {
11764
11776
  killPairSession,
11765
11777
  pairTmuxSession,
11766
11778
  finalizeClaudePairOnboarding
11767
- } = await import("../claude-pair-runtime-WOE2EELU.js");
11779
+ } = await import("../claude-pair-runtime-6DZEDQAG.js");
11768
11780
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
11769
11781
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
11770
11782
  const killed = await killPairSession(pairTmuxSession(pairId));