@integrity-labs/agt-cli 0.28.672 → 0.28.674

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 (25) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-YAVWYI5S.js → chunk-7Y54PSMR.js} +88 -3
  3. package/dist/chunk-7Y54PSMR.js.map +1 -0
  4. package/dist/{chunk-YOID6KOQ.js → chunk-AJNES24H.js} +33 -9
  5. package/dist/chunk-AJNES24H.js.map +1 -0
  6. package/dist/{chunk-EX6INJDG.js → chunk-ZD72DPZT.js} +4 -4
  7. package/dist/{claude-pair-runtime-UZ2JB2KY.js → claude-pair-runtime-VAU7UXE4.js} +2 -2
  8. package/dist/lib/manager-worker.js +39 -15
  9. package/dist/lib/manager-worker.js.map +1 -1
  10. package/dist/mcp/direct-chat-channel.js +7 -8
  11. package/dist/mcp/index.js +7 -8
  12. package/dist/mcp/origami.js +7 -8
  13. package/dist/mcp/slack-channel.js +14 -9
  14. package/dist/mcp/telegram-channel.js +14 -9
  15. package/dist/{persistent-session-PYAJ4VJW.js → persistent-session-F7JEOWHQ.js} +3 -3
  16. package/dist/{responsiveness-probe-5I2LIVCA.js → responsiveness-probe-7465YNMN.js} +3 -3
  17. package/dist/{session-auth-dead-NUX643UJ.js → session-auth-dead-GBC5QPH3.js} +2 -2
  18. package/package.json +1 -1
  19. package/dist/chunk-YAVWYI5S.js.map +0 -1
  20. package/dist/chunk-YOID6KOQ.js.map +0 -1
  21. /package/dist/{chunk-EX6INJDG.js.map → chunk-ZD72DPZT.js.map} +0 -0
  22. /package/dist/{claude-pair-runtime-UZ2JB2KY.js.map → claude-pair-runtime-VAU7UXE4.js.map} +0 -0
  23. /package/dist/{persistent-session-PYAJ4VJW.js.map → persistent-session-F7JEOWHQ.js.map} +0 -0
  24. /package/dist/{responsiveness-probe-5I2LIVCA.js.map → responsiveness-probe-7465YNMN.js.map} +0 -0
  25. /package/dist/{session-auth-dead-NUX643UJ.js.map → session-auth-dead-GBC5QPH3.js.map} +0 -0
@@ -12,7 +12,7 @@ import {
12
12
  parseEnvFileEntries,
13
13
  parseEnvIntegrations,
14
14
  shellQuote
15
- } from "./chunk-YAVWYI5S.js";
15
+ } from "./chunk-7Y54PSMR.js";
16
16
  import {
17
17
  BIND_FAILURE_QUARANTINE_THRESHOLD,
18
18
  INTEGRATIONS_SECTION_END,
@@ -59,7 +59,7 @@ import {
59
59
  resolveConnectivityProbe,
60
60
  worseConnectivityOutcome,
61
61
  wrapScheduledTaskPrompt
62
- } from "./chunk-YOID6KOQ.js";
62
+ } from "./chunk-AJNES24H.js";
63
63
  import {
64
64
  parsePsRows
65
65
  } from "./chunk-XWVM4KPK.js";
@@ -6292,7 +6292,7 @@ function exchangeFailureKind(err) {
6292
6292
  }
6293
6293
 
6294
6294
  // src/lib/api-client.ts
6295
- var agtCliVersion = true ? "0.28.672" : "dev";
6295
+ var agtCliVersion = true ? "0.28.674" : "dev";
6296
6296
  var lastConfigHash = null;
6297
6297
  function setConfigHash(hash) {
6298
6298
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10033,4 +10033,4 @@ export {
10033
10033
  managerInstallSystemUnitCommand,
10034
10034
  managerUninstallSystemUnitCommand
10035
10035
  };
10036
- //# sourceMappingURL=chunk-EX6INJDG.js.map
10036
+ //# sourceMappingURL=chunk-ZD72DPZT.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-PYAJ4VJW.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-F7JEOWHQ.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-UZ2JB2KY.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-VAU7UXE4.js.map
@@ -54,7 +54,7 @@ import {
54
54
  safeWriteJsonAtomic,
55
55
  setConfigHash,
56
56
  tripClass
57
- } from "../chunk-EX6INJDG.js";
57
+ } from "../chunk-ZD72DPZT.js";
58
58
  import {
59
59
  getProjectDir as getProjectDir2,
60
60
  getReadyTasks,
@@ -112,7 +112,7 @@ import {
112
112
  takeZombieDetection,
113
113
  toOpencodeModel,
114
114
  writeEgressAllowlist
115
- } from "../chunk-YAVWYI5S.js";
115
+ } from "../chunk-7Y54PSMR.js";
116
116
  import {
117
117
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
118
118
  AnchorSessionClient,
@@ -193,7 +193,7 @@ import {
193
193
  subagentActivityAgeSeconds,
194
194
  sumTranscriptUsageInWindow,
195
195
  transcriptActivityAgeSeconds
196
- } from "../chunk-YOID6KOQ.js";
196
+ } from "../chunk-AJNES24H.js";
197
197
  import {
198
198
  reapOrphanChannelMcps
199
199
  } from "../chunk-XWVM4KPK.js";
@@ -11617,7 +11617,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
11617
11617
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
11618
11618
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
11619
11619
  async function channelInboundActivityAgeSecondsFor(codeName) {
11620
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-5I2LIVCA.js");
11620
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-7465YNMN.js");
11621
11621
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
11622
11622
  if (newest === null) return null;
11623
11623
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -11824,7 +11824,7 @@ function runPendingForcedUpdate() {
11824
11824
  }
11825
11825
  return false;
11826
11826
  }
11827
- if (selfUpdateInFlight) {
11827
+ if (selfUpdateLatchVerdict(selfUpdateInFlightSince, Date.now()) === "held") {
11828
11828
  log(
11829
11829
  `[self-update] "Update CLI now" requested at ${requestedUpdateAt} \u2014 deferring: a self-update is already in flight. Retrying next poll.`
11830
11830
  );
@@ -12265,7 +12265,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12265
12265
  var lastVersionCheckAt = 0;
12266
12266
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12267
12267
  var lastResponsivenessProbeAt = 0;
12268
- var agtCliVersion = true ? "0.28.672" : "dev";
12268
+ var agtCliVersion = true ? "0.28.674" : "dev";
12269
12269
  function resolveBrewPath(execFileSync3) {
12270
12270
  try {
12271
12271
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -12780,14 +12780,35 @@ var selfUpdatePinInvalidLogged = false;
12780
12780
  var restartAfterUpgrade = false;
12781
12781
  var pendingUpgradeVersion = null;
12782
12782
  var selfUpdateInFlight = false;
12783
+ var selfUpdateInFlightSince = null;
12784
+ var SELF_UPDATE_LATCH_MAX_HOLD_MS = 20 * 6e4;
12785
+ function selfUpdateLatchVerdict(heldSince, now, maxHoldMs = SELF_UPDATE_LATCH_MAX_HOLD_MS) {
12786
+ if (heldSince === null) return "free";
12787
+ const heldMs = now - heldSince;
12788
+ return heldMs >= maxHoldMs ? "expired" : "held";
12789
+ }
12783
12790
  var upgradeRestartInitiated = false;
12784
12791
  var cachedUpdateRequestedAt = null;
12785
12792
  var forcedUpdateDeferStreak = 0;
12786
12793
  var forcedUpdateRelaxAnnounced = false;
12787
12794
  async function checkAndUpdateCli(opts) {
12788
12795
  const force = opts?.force ?? false;
12789
- if (selfUpdateInFlight) return "failed";
12796
+ const verdict = selfUpdateLatchVerdict(selfUpdateInFlightSince, Date.now());
12797
+ if (verdict === "held") {
12798
+ const heldSec = Math.round((Date.now() - (selfUpdateInFlightSince ?? Date.now())) / 1e3);
12799
+ log(
12800
+ `[self-update] deferring: a self-update has been in flight for ${heldSec}s. Retrying next poll; the latch breaks at ${Math.round(SELF_UPDATE_LATCH_MAX_HOLD_MS / 6e4)}m.`
12801
+ );
12802
+ return "failed";
12803
+ }
12804
+ if (verdict === "expired") {
12805
+ const heldMin = Math.round((Date.now() - (selfUpdateInFlightSince ?? Date.now())) / 6e4);
12806
+ console.warn(
12807
+ `[manager-worker] [self-update] WEDGE: the in-flight latch has been held for ${heldMin}m, past the ${Math.round(SELF_UPDATE_LATCH_MAX_HOLD_MS / 6e4)}m bound. Breaking it and proceeding \u2014 the previous updater never settled (ENG-8624).`
12808
+ );
12809
+ }
12790
12810
  selfUpdateInFlight = true;
12811
+ selfUpdateInFlightSince = Date.now();
12791
12812
  try {
12792
12813
  const cliPath = process.argv[1] ?? "";
12793
12814
  const isDevMode = cliPath.includes("/src/") || cliPath.includes("tsx");
@@ -12822,6 +12843,7 @@ async function checkAndUpdateCli(opts) {
12822
12843
  return outcome;
12823
12844
  } finally {
12824
12845
  selfUpdateInFlight = false;
12846
+ selfUpdateInFlightSince = null;
12825
12847
  }
12826
12848
  }
12827
12849
  async function checkAndUpdateCliViaBrew(force = false) {
@@ -13629,7 +13651,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
13629
13651
  if (codeNames.length === 0) return;
13630
13652
  void (async () => {
13631
13653
  try {
13632
- const { collectDiagnostics } = await import("../persistent-session-PYAJ4VJW.js");
13654
+ const { collectDiagnostics } = await import("../persistent-session-F7JEOWHQ.js");
13633
13655
  await api.post("/host/heartbeat", {
13634
13656
  host_id: hostId,
13635
13657
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -13745,7 +13767,7 @@ async function pollCycleInner() {
13745
13767
  }
13746
13768
  try {
13747
13769
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
13748
- const { collectDiagnostics } = await import("../persistent-session-PYAJ4VJW.js");
13770
+ const { collectDiagnostics } = await import("../persistent-session-F7JEOWHQ.js");
13749
13771
  const diagCodeNames = [...agentState.persistentSessionAgents];
13750
13772
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
13751
13773
  let tailscaleHostname;
@@ -13897,7 +13919,7 @@ async function pollCycleInner() {
13897
13919
  collectPanelessActivityProbes,
13898
13920
  getResponsivenessIntervalMs,
13899
13921
  occupancyQualificationClassifications
13900
- } = await import("../responsiveness-probe-5I2LIVCA.js");
13922
+ } = await import("../responsiveness-probe-7465YNMN.js");
13901
13923
  const probeIntervalMs = getResponsivenessIntervalMs();
13902
13924
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
13903
13925
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -14007,7 +14029,7 @@ async function pollCycleInner() {
14007
14029
  collectResponsivenessProbes,
14008
14030
  livePendingInboundOldestAgeSeconds,
14009
14031
  parkPendingInbound
14010
- } = await import("../responsiveness-probe-5I2LIVCA.js");
14032
+ } = await import("../responsiveness-probe-7465YNMN.js");
14011
14033
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
14012
14034
  const wedgeNow = /* @__PURE__ */ new Date();
14013
14035
  const liveAgents = agentState.persistentSessionAgents;
@@ -14163,7 +14185,7 @@ async function pollCycleInner() {
14163
14185
  }
14164
14186
  try {
14165
14187
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
14166
- const { probeSessionAuth } = await import("../session-auth-dead-NUX643UJ.js");
14188
+ const { probeSessionAuth } = await import("../session-auth-dead-GBC5QPH3.js");
14167
14189
  const observations = [];
14168
14190
  const pendingCacheCommits = [];
14169
14191
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -17923,7 +17945,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
17923
17945
  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}`));
17924
17946
  void (async () => {
17925
17947
  try {
17926
- const { collectDiagnostics } = await import("../persistent-session-PYAJ4VJW.js");
17948
+ const { collectDiagnostics } = await import("../persistent-session-F7JEOWHQ.js");
17927
17949
  await api.post("/host/heartbeat", {
17928
17950
  host_id: hostId,
17929
17951
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17974,7 +17996,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
17974
17996
  }
17975
17997
  try {
17976
17998
  const hostId = await getHostId();
17977
- const { collectDiagnostics } = await import("../persistent-session-PYAJ4VJW.js");
17999
+ const { collectDiagnostics } = await import("../persistent-session-F7JEOWHQ.js");
17978
18000
  await api.post("/host/heartbeat", {
17979
18001
  host_id: hostId,
17980
18002
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -18605,7 +18627,7 @@ async function processClaudePairSessions(agents) {
18605
18627
  killPairSession,
18606
18628
  pairTmuxSession,
18607
18629
  finalizeClaudePairOnboarding
18608
- } = await import("../claude-pair-runtime-UZ2JB2KY.js");
18630
+ } = await import("../claude-pair-runtime-VAU7UXE4.js");
18609
18631
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
18610
18632
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
18611
18633
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -19787,6 +19809,7 @@ export {
19787
19809
  REALTIME_REBIND_IN_FLIGHT_GRACE_MS,
19788
19810
  REALTIME_REBIND_MAX_BACKOFF_MS,
19789
19811
  REALTIME_REBIND_STUCK_AFTER_MS,
19812
+ SELF_UPDATE_LATCH_MAX_HOLD_MS,
19790
19813
  UntrustworthyToolkitResponseError,
19791
19814
  applyMemoryTombstones,
19792
19815
  applyRestartAcks,
@@ -19830,6 +19853,7 @@ export {
19830
19853
  restartReasonBindsNewMcp,
19831
19854
  retiredMemoryDir,
19832
19855
  sameChannelSet,
19856
+ selfUpdateLatchVerdict,
19833
19857
  shouldLogChannelSyncFailure,
19834
19858
  shouldReapOnRetag,
19835
19859
  shouldReportRestartToAudit,