@integrity-labs/agt-cli 0.28.1165 → 0.28.1167

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.
Files changed (31) hide show
  1. package/dist/bin/agt.js +6 -6
  2. package/dist/{chunk-TNPLCJIG.js → chunk-7IAJXJ7C.js} +315 -36
  3. package/dist/chunk-7IAJXJ7C.js.map +1 -0
  4. package/dist/{chunk-MBNPMML4.js → chunk-7WXWT4PA.js} +5 -5
  5. package/dist/{chunk-FGPPJKJ5.js → chunk-AJTF72A2.js} +3 -3
  6. package/dist/{chunk-ZDHCIJL6.js → chunk-AV4KD3HE.js} +2 -2
  7. package/dist/{chunk-T7NKHOJF.js → chunk-IV2UENRG.js} +10 -2
  8. package/dist/chunk-IV2UENRG.js.map +1 -0
  9. package/dist/{claude-code-updater-EM3AY2PR.js → claude-code-updater-WD4NNWY5.js} +5 -3
  10. package/dist/{claude-pair-runtime-P45H3GNC.js → claude-pair-runtime-JWXVVSSG.js} +3 -3
  11. package/dist/lib/manager-worker.js +40 -27
  12. package/dist/lib/manager-worker.js.map +1 -1
  13. package/dist/mcp/direct-chat-channel.js +763 -484
  14. package/dist/mcp/index.js +616 -337
  15. package/dist/mcp/origami.js +604 -325
  16. package/dist/mcp/slack-channel.js +613 -334
  17. package/dist/mcp/telegram-channel.js +604 -325
  18. package/dist/{persistent-session-KSV7RIQQ.js → persistent-session-LKJVSRHX.js} +4 -4
  19. package/dist/{responsiveness-probe-XVYYSQQN.js → responsiveness-probe-ZEK2TD5E.js} +4 -4
  20. package/dist/{session-auth-dead-KMMDVC5E.js → session-auth-dead-TSARKC55.js} +3 -3
  21. package/package.json +1 -1
  22. package/dist/chunk-T7NKHOJF.js.map +0 -1
  23. package/dist/chunk-TNPLCJIG.js.map +0 -1
  24. /package/dist/{chunk-MBNPMML4.js.map → chunk-7WXWT4PA.js.map} +0 -0
  25. /package/dist/{chunk-FGPPJKJ5.js.map → chunk-AJTF72A2.js.map} +0 -0
  26. /package/dist/{chunk-ZDHCIJL6.js.map → chunk-AV4KD3HE.js.map} +0 -0
  27. /package/dist/{claude-code-updater-EM3AY2PR.js.map → claude-code-updater-WD4NNWY5.js.map} +0 -0
  28. /package/dist/{claude-pair-runtime-P45H3GNC.js.map → claude-pair-runtime-JWXVVSSG.js.map} +0 -0
  29. /package/dist/{persistent-session-KSV7RIQQ.js.map → persistent-session-LKJVSRHX.js.map} +0 -0
  30. /package/dist/{responsiveness-probe-XVYYSQQN.js.map → responsiveness-probe-ZEK2TD5E.js.map} +0 -0
  31. /package/dist/{session-auth-dead-KMMDVC5E.js.map → session-auth-dead-TSARKC55.js.map} +0 -0
@@ -77,12 +77,13 @@ import {
77
77
  setConfigHash,
78
78
  shellGuard,
79
79
  tripClass
80
- } from "../chunk-MBNPMML4.js";
80
+ } from "../chunk-7WXWT4PA.js";
81
81
  import {
82
82
  CLAUDE_CODE_SECURITY_FLOOR,
83
83
  SELF_UPDATE_TIMEOUTS,
84
84
  anyPackageInstallRunning,
85
85
  compareVersions,
86
+ effectiveSecurityFloor,
86
87
  ensureDiskForSelfUpdate,
87
88
  maybeRunDiskGuard,
88
89
  readDiskStat,
@@ -90,7 +91,7 @@ import {
90
91
  runSafeCleanup,
91
92
  tightestDiskStat,
92
93
  withPackageCacheLock
93
- } from "../chunk-T7NKHOJF.js";
94
+ } from "../chunk-IV2UENRG.js";
94
95
  import {
95
96
  getProjectDir as getProjectDir2,
96
97
  getReadyTasks,
@@ -177,7 +178,7 @@ import {
177
178
  webFetchBaselineValue,
178
179
  webFetchRestartNeeded,
179
180
  writeEgressAllowlist
180
- } from "../chunk-FGPPJKJ5.js";
181
+ } from "../chunk-AJTF72A2.js";
181
182
  import {
182
183
  isAgentIdle,
183
184
  isStaleForToday,
@@ -186,7 +187,7 @@ import {
186
187
  sessionTranscriptDir,
187
188
  subagentActivityAgeSeconds,
188
189
  transcriptActivityAgeSeconds
189
- } from "../chunk-ZDHCIJL6.js";
190
+ } from "../chunk-AV4KD3HE.js";
190
191
  import {
191
192
  classifyUnanswerablePane,
192
193
  focusedConfirmDialogBlock,
@@ -304,7 +305,7 @@ import {
304
305
  serializeAccountEnforcementMarker,
305
306
  stabiliseResetInstant,
306
307
  sumTranscriptUsageInWindow
307
- } from "../chunk-TNPLCJIG.js";
308
+ } from "../chunk-7IAJXJ7C.js";
308
309
  import {
309
310
  CLAUDE_CONFIG_DIR_ENV,
310
311
  claudeConfigDirFor,
@@ -581,11 +582,10 @@ function heartbeatHostNodeFields(observation, pin, pinState) {
581
582
  import { execFileSync as syncExecFile } from "child_process";
582
583
 
583
584
  // src/lib/runtime-image-recycle.ts
584
- var RUNTIME_CLAUDE_CODE_SECURITY_FLOOR = CLAUDE_CODE_SECURITY_FLOOR;
585
585
  var RECYCLE_STAGGER_MS = 2 * 6e4;
586
586
  var CONTAINER_IMAGE_CACHE_MS = 5 * 6e4;
587
587
  var LOCAL_TAG_CACHE_MS = 6e4;
588
- function isBelowRuntimeFloor(version, floor = RUNTIME_CLAUDE_CODE_SECURITY_FLOOR) {
588
+ function isBelowRuntimeFloor(version, floor = CLAUDE_CODE_SECURITY_FLOOR) {
589
589
  if (!version) return false;
590
590
  const cmp = compareVersions(version, floor);
591
591
  return cmp !== null && cmp < 0;
@@ -716,7 +716,7 @@ function evaluateImageRecycle(args, io) {
716
716
  }
717
717
  if (lastLoggedDecision.get(codeName) !== decision) {
718
718
  lastLoggedDecision.set(codeName, decision);
719
- const floorNote = belowFloor ? ` running Claude Code ${runningVersion} is below the security floor ${args.floor ?? RUNTIME_CLAUDE_CODE_SECURITY_FLOOR};` : "";
719
+ const floorNote = belowFloor ? ` running Claude Code ${runningVersion} is below the security floor ${args.floor ?? CLAUDE_CODE_SECURITY_FLOOR};` : "";
720
720
  io.log(`[runtime-image-recycle] '${codeName}' ${describe};${floorNote} decision=${decision}`);
721
721
  }
722
722
  return decision;
@@ -15082,7 +15082,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
15082
15082
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
15083
15083
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
15084
15084
  async function channelInboundActivityAgeSecondsFor(codeName) {
15085
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-XVYYSQQN.js");
15085
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-ZEK2TD5E.js");
15086
15086
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
15087
15087
  if (newest === null) return null;
15088
15088
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -15868,13 +15868,17 @@ function clearAgentCaches(agentId, codeName) {
15868
15868
  }
15869
15869
  var cachedFrameworkVersion = null;
15870
15870
  var cachedMaintenanceWindow = null;
15871
+ var cachedServerSecurityFloor = null;
15872
+ function currentSecurityFloor() {
15873
+ return effectiveSecurityFloor(cachedServerSecurityFloor);
15874
+ }
15871
15875
  var cachedDesiredAgtCliVersion = null;
15872
15876
  var desiredAgtCliVersionHydrated = false;
15873
15877
  var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
15874
15878
  var lastVersionCheckAt = 0;
15875
15879
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
15876
15880
  var lastResponsivenessProbeAt = 0;
15877
- var agtCliVersion = true ? "0.28.1165" : "dev";
15881
+ var agtCliVersion = true ? "0.28.1167" : "dev";
15878
15882
  function resolveBrewPath(execFileSync3) {
15879
15883
  try {
15880
15884
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -17674,7 +17678,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
17674
17678
  if (codeNames.length === 0) return;
17675
17679
  void (async () => {
17676
17680
  try {
17677
- const { collectDiagnostics } = await import("../persistent-session-KSV7RIQQ.js");
17681
+ const { collectDiagnostics } = await import("../persistent-session-LKJVSRHX.js");
17678
17682
  await api.post("/host/heartbeat", {
17679
17683
  host_id: hostId,
17680
17684
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -17817,7 +17821,7 @@ async function pollCycleInner() {
17817
17821
  }
17818
17822
  try {
17819
17823
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
17820
- const { collectDiagnostics } = await import("../persistent-session-KSV7RIQQ.js");
17824
+ const { collectDiagnostics } = await import("../persistent-session-LKJVSRHX.js");
17821
17825
  const diagCodeNames = [...agentState.persistentSessionAgents];
17822
17826
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor) : void 0;
17823
17827
  let tailscaleHostname;
@@ -18002,6 +18006,10 @@ async function pollCycleInner() {
18002
18006
  if (hbResp?.maintenance_window) {
18003
18007
  cachedMaintenanceWindow = hbResp.maintenance_window;
18004
18008
  }
18009
+ if (hbResp && Object.prototype.hasOwnProperty.call(hbResp, "claude_code_security_floor")) {
18010
+ const serverFloor = hbResp.claude_code_security_floor;
18011
+ cachedServerSecurityFloor = typeof serverFloor === "string" ? serverFloor : null;
18012
+ }
18005
18013
  if (hbResp) {
18006
18014
  desiredAgtCliVersionHydrated = true;
18007
18015
  if ("desired_agt_cli_version" in hbResp) {
@@ -18017,7 +18025,8 @@ async function pollCycleInner() {
18017
18025
  setConfigHash(hbResp?.config_hash ?? null);
18018
18026
  try {
18019
18027
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
18020
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-EM3AY2PR.js");
18028
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-WD4NNWY5.js");
18029
+ const securityFloor = currentSecurityFloor();
18021
18030
  claudeUpdaterInFlight = true;
18022
18031
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
18023
18032
  log(
@@ -18026,12 +18035,14 @@ async function pollCycleInner() {
18026
18035
  } else if (desiredClaudeCodeVersion && shouldRunClaudeCodeUpdater({
18027
18036
  desiredVersion: desiredClaudeCodeVersion,
18028
18037
  installedVersion: cachedFrameworkVersion,
18029
- windowGate: decideMaintenanceWindowGate({ window: cachedMaintenanceWindow, now: /* @__PURE__ */ new Date() })
18038
+ windowGate: decideMaintenanceWindowGate({ window: cachedMaintenanceWindow, now: /* @__PURE__ */ new Date() }),
18039
+ floor: securityFloor
18030
18040
  })) {
18031
18041
  await maybeUpdateClaudeCode({
18032
18042
  desiredVersion: desiredClaudeCodeVersion,
18033
18043
  currentVersion: cachedFrameworkVersion,
18034
- log
18044
+ log,
18045
+ securityFloor
18035
18046
  });
18036
18047
  }
18037
18048
  } catch (err) {
@@ -18049,7 +18060,7 @@ async function pollCycleInner() {
18049
18060
  collectPanelessActivityProbes,
18050
18061
  getResponsivenessIntervalMs,
18051
18062
  occupancyQualificationClassifications
18052
- } = await import("../responsiveness-probe-XVYYSQQN.js");
18063
+ } = await import("../responsiveness-probe-ZEK2TD5E.js");
18053
18064
  const probeIntervalMs = getResponsivenessIntervalMs();
18054
18065
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
18055
18066
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -18166,7 +18177,7 @@ async function pollCycleInner() {
18166
18177
  collectResponsivenessProbes,
18167
18178
  livePendingInboundOldestAgeSeconds,
18168
18179
  parkPendingInbound
18169
- } = await import("../responsiveness-probe-XVYYSQQN.js");
18180
+ } = await import("../responsiveness-probe-ZEK2TD5E.js");
18170
18181
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
18171
18182
  const wedgeNow = /* @__PURE__ */ new Date();
18172
18183
  const liveAgents = agentState.persistentSessionAgents;
@@ -18452,7 +18463,7 @@ async function pollCycleInner() {
18452
18463
  }
18453
18464
  }
18454
18465
  );
18455
- const { parkPendingInbound } = await import("../responsiveness-probe-XVYYSQQN.js");
18466
+ const { parkPendingInbound } = await import("../responsiveness-probe-ZEK2TD5E.js");
18456
18467
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
18457
18468
  paneFatalStreak.delete(codeName);
18458
18469
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -18483,7 +18494,7 @@ async function pollCycleInner() {
18483
18494
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
18484
18495
  bindSourceEscalations
18485
18496
  } = await import("../transcript-mount-health-OHE6IVJV.js");
18486
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-KSV7RIQQ.js");
18497
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-LKJVSRHX.js");
18487
18498
  const mountConfig = resolveTranscriptMountConfig();
18488
18499
  const liveAgents = agentState.persistentSessionAgents;
18489
18500
  for (const tracked of [
@@ -18648,7 +18659,7 @@ async function pollCycleInner() {
18648
18659
  }
18649
18660
  try {
18650
18661
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
18651
- const { probeSessionAuth } = await import("../session-auth-dead-KMMDVC5E.js");
18662
+ const { probeSessionAuth } = await import("../session-auth-dead-TSARKC55.js");
18652
18663
  const observations = [];
18653
18664
  const pendingCacheCommits = [];
18654
18665
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -22671,7 +22682,8 @@ async function ensurePersistentSessionUnchecked(agent, tasks, boardItems, refres
22671
22682
  const recycleIdle = recycleCurrent ? isAgentIdle(projectDir, recycleCurrent.sessionId) : false;
22672
22683
  const runtimeSample = runtimeVersionFor(codeName);
22673
22684
  const runtimeClaudeVersion = recycleMode === "container" ? runtimeSample.state === "ok" ? runtimeSample.version : null : hostSessionStateFor(codeName, runtimeImageRecycleIo).version;
22674
- const recycleBelowFloor = isBelowRuntimeFloor(runtimeClaudeVersion);
22685
+ const recycleFloor = currentSecurityFloor();
22686
+ const recycleBelowFloor = isBelowRuntimeFloor(runtimeClaudeVersion, recycleFloor);
22675
22687
  const recycleDecision = evaluateImageRecycle(
22676
22688
  {
22677
22689
  codeName,
@@ -22680,6 +22692,7 @@ async function ensurePersistentSessionUnchecked(agent, tasks, boardItems, refres
22680
22692
  sessionHealthy: recycleSessionHealthy && recycleCurrent !== null,
22681
22693
  inWindow: decideMaintenanceWindowGate({ window: cachedMaintenanceWindow, now: /* @__PURE__ */ new Date() }) === "proceed",
22682
22694
  runtimeClaudeVersion,
22695
+ floor: recycleFloor,
22683
22696
  idle: recycleIdle,
22684
22697
  // Only stat the channel dirs when a forced recycle is on the table.
22685
22698
  recentInboundAgeSec: recycleBelowFloor && !recycleIdle ? await channelInboundActivityAgeSecondsFor(codeName) : null,
@@ -22692,8 +22705,8 @@ async function ensurePersistentSessionUnchecked(agent, tasks, boardItems, refres
22692
22705
  );
22693
22706
  if (recycleDecision === "recycle" || recycleDecision === "recycle-deadline") {
22694
22707
  const tornDown = stopPersistentSessionAndForgetMcpBaseline(codeName, "runtime-image-update", void 0, void 0, {
22695
- reason: recycleDecision === "recycle-deadline" ? `${recycleMode === "container" ? "container" : "host session"} below Claude Code security floor ${RUNTIME_CLAUDE_CODE_SECURITY_FLOOR}; busy past the deadline, recycled onto the current ${recycleMode === "container" ? "agt-runtime image" : "claude binary"}` : recycleMode === "container" ? "container running a superseded agt-runtime image; recycled between turns" : "host session running a replaced claude binary; recycled between turns",
22696
- detail: { runtime_claude_version: runtimeClaudeVersion, decision: recycleDecision, mode: recycleMode }
22708
+ reason: recycleDecision === "recycle-deadline" ? `${recycleMode === "container" ? "container" : "host session"} below Claude Code security floor ${recycleFloor}; busy past the deadline, recycled onto the current ${recycleMode === "container" ? "agt-runtime image" : "claude binary"}` : recycleMode === "container" ? "container running a superseded agt-runtime image; recycled between turns" : "host session running a replaced claude binary; recycled between turns",
22709
+ detail: { runtime_claude_version: runtimeClaudeVersion, decision: recycleDecision, mode: recycleMode, security_floor: recycleFloor }
22697
22710
  });
22698
22711
  if (tornDown) {
22699
22712
  agentState.persistentSessionAgents.delete(codeName);
@@ -23316,7 +23329,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
23316
23329
  try {
23317
23330
  const freshId = rotateSessionForWedge(codeName);
23318
23331
  consecutiveWedgeCycles.delete(codeName);
23319
- const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-XVYYSQQN.js");
23332
+ const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-ZEK2TD5E.js");
23320
23333
  const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
23321
23334
  const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
23322
23335
  const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
@@ -23359,7 +23372,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
23359
23372
  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}`));
23360
23373
  void (async () => {
23361
23374
  try {
23362
- const { collectDiagnostics } = await import("../persistent-session-KSV7RIQQ.js");
23375
+ const { collectDiagnostics } = await import("../persistent-session-LKJVSRHX.js");
23363
23376
  await api.post("/host/heartbeat", {
23364
23377
  host_id: hostId,
23365
23378
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -23410,7 +23423,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
23410
23423
  }
23411
23424
  try {
23412
23425
  const hostId = await getHostId();
23413
- const { collectDiagnostics } = await import("../persistent-session-KSV7RIQQ.js");
23426
+ const { collectDiagnostics } = await import("../persistent-session-LKJVSRHX.js");
23414
23427
  await api.post("/host/heartbeat", {
23415
23428
  host_id: hostId,
23416
23429
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -24104,7 +24117,7 @@ async function processClaudePairSessions(agents) {
24104
24117
  snapshotPairConfig,
24105
24118
  // ENG-11659: result -> report body + the manager.log line that records it.
24106
24119
  planPairStartReport
24107
- } = await import("../claude-pair-runtime-P45H3GNC.js");
24120
+ } = await import("../claude-pair-runtime-JWXVVSSG.js");
24108
24121
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-EF3UO5IK.js");
24109
24122
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
24110
24123
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);