@integrity-labs/agt-cli 0.28.339 → 0.28.340

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.
@@ -43,9 +43,10 @@ import {
43
43
  reapMissingMcpSessions,
44
44
  reapStaleMcpChildren,
45
45
  requireHost,
46
+ resolveEffectivePinRaw,
46
47
  safeWriteJsonAtomic,
47
48
  setConfigHash
48
- } from "../chunk-UVMGRGRO.js";
49
+ } from "../chunk-Z6ASBYHI.js";
49
50
  import {
50
51
  getProjectDir as getProjectDir2,
51
52
  getReadyTasks,
@@ -8384,11 +8385,13 @@ function clearAgentCaches(agentId, codeName) {
8384
8385
  }
8385
8386
  var cachedFrameworkVersion = null;
8386
8387
  var cachedMaintenanceWindow = null;
8388
+ var cachedDesiredAgtCliVersion = null;
8389
+ var desiredAgtCliVersionHydrated = false;
8387
8390
  var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
8388
8391
  var lastVersionCheckAt = 0;
8389
8392
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
8390
8393
  var lastResponsivenessProbeAt = 0;
8391
- var agtCliVersion = true ? "0.28.339" : "dev";
8394
+ var agtCliVersion = true ? "0.28.340" : "dev";
8392
8395
  function resolveBrewPath(execFileSync2) {
8393
8396
  try {
8394
8397
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -8738,7 +8741,11 @@ async function checkAndUpdateCliViaBrew(force = false) {
8738
8741
  const brewPath = resolveBrewPath(execFileSync2);
8739
8742
  if (!brewPath) return "noop";
8740
8743
  {
8741
- const brewPin = decidePin({ installed: agtCliVersion, pinRaw: process.env.AGT_CLI_PIN_VERSION });
8744
+ const brewPinRaw = resolveAgtCliPinRaw();
8745
+ if (brewPinRaw === void 0 && !desiredAgtCliVersionHydrated) {
8746
+ return "noop";
8747
+ }
8748
+ const brewPin = decidePin({ installed: agtCliVersion, pinRaw: brewPinRaw });
8742
8749
  if (brewPin.kind === "satisfied") {
8743
8750
  if (!selfUpdatePinnedLogged) {
8744
8751
  log(`[self-update] agt CLI pinned to ${brewPin.version} (AGT_CLI_PIN_VERSION); already satisfied on this brew install.`);
@@ -8820,10 +8827,16 @@ async function checkAndUpdateCliViaBrew(force = false) {
8820
8827
  return "failed";
8821
8828
  }
8822
8829
  }
8830
+ function resolveAgtCliPinRaw() {
8831
+ return resolveEffectivePinRaw(process.env.AGT_CLI_PIN_VERSION, cachedDesiredAgtCliVersion);
8832
+ }
8823
8833
  async function checkAndUpdateCliViaNpm(force = false) {
8824
8834
  if (agtCliVersion === "dev") return "noop";
8825
8835
  const channel = process.env.AGT_CLI_RELEASE_CHANNEL || "latest";
8826
- const pinRaw = process.env.AGT_CLI_PIN_VERSION;
8836
+ const pinRaw = resolveAgtCliPinRaw();
8837
+ if (pinRaw === void 0 && !desiredAgtCliVersionHydrated) {
8838
+ return "noop";
8839
+ }
8827
8840
  const pinDecision = decidePin({ installed: agtCliVersion, pinRaw });
8828
8841
  if (pinDecision.kind === "invalid") {
8829
8842
  if (!selfUpdatePinInvalidLogged) {
@@ -9523,6 +9536,12 @@ async function pollCycle() {
9523
9536
  if (hbResp?.maintenance_window) {
9524
9537
  cachedMaintenanceWindow = hbResp.maintenance_window;
9525
9538
  }
9539
+ if (hbResp) {
9540
+ desiredAgtCliVersionHydrated = true;
9541
+ if ("desired_agt_cli_version" in hbResp) {
9542
+ cachedDesiredAgtCliVersion = hbResp.desired_agt_cli_version ?? null;
9543
+ }
9544
+ }
9526
9545
  const requestedUpdateAt = hbResp?.update_requested_at ?? null;
9527
9546
  const forcedUpdate = decideForcedUpdate({
9528
9547
  requestedAt: requestedUpdateAt,