@integrity-labs/agt-cli 0.28.389 → 0.28.391

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.
package/dist/bin/agt.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-GZKD4K7H.js";
43
+ } from "../chunk-F2HXWMB6.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -4829,7 +4829,7 @@ import { execFileSync, execSync } from "child_process";
4829
4829
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4830
4830
  import chalk18 from "chalk";
4831
4831
  import ora16 from "ora";
4832
- var cliVersion = true ? "0.28.389" : "dev";
4832
+ var cliVersion = true ? "0.28.391" : "dev";
4833
4833
  async function fetchLatestVersion() {
4834
4834
  const host2 = getHost();
4835
4835
  if (!host2) return null;
@@ -6001,7 +6001,7 @@ function handleError(err) {
6001
6001
  }
6002
6002
 
6003
6003
  // src/bin/agt.ts
6004
- var cliVersion2 = true ? "0.28.389" : "dev";
6004
+ var cliVersion2 = true ? "0.28.391" : "dev";
6005
6005
  var program = new Command();
6006
6006
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6007
6007
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6196,7 +6196,7 @@ function requireHost() {
6196
6196
  }
6197
6197
 
6198
6198
  // src/lib/api-client.ts
6199
- var agtCliVersion = true ? "0.28.389" : "dev";
6199
+ var agtCliVersion = true ? "0.28.391" : "dev";
6200
6200
  var lastConfigHash = null;
6201
6201
  function setConfigHash(hash) {
6202
6202
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8650,4 +8650,4 @@ export {
8650
8650
  managerInstallSystemUnitCommand,
8651
8651
  managerUninstallSystemUnitCommand
8652
8652
  };
8653
- //# sourceMappingURL=chunk-GZKD4K7H.js.map
8653
+ //# sourceMappingURL=chunk-F2HXWMB6.js.map
@@ -43,7 +43,7 @@ import {
43
43
  resolveEffectivePinRaw,
44
44
  safeWriteJsonAtomic,
45
45
  setConfigHash
46
- } from "../chunk-GZKD4K7H.js";
46
+ } from "../chunk-F2HXWMB6.js";
47
47
  import {
48
48
  getProjectDir as getProjectDir2,
49
49
  getReadyTasks,
@@ -679,6 +679,9 @@ var OPTIONAL_CHANNEL_KEYS = /* @__PURE__ */ new Set([
679
679
  "irc",
680
680
  "nostr"
681
681
  ]);
682
+ function isKnownChannelKey(serverKey) {
683
+ return ESSENTIAL_CHANNEL_KEYS.has(serverKey) || OPTIONAL_CHANNEL_KEYS.has(serverKey);
684
+ }
682
685
  function readDeclaredCriticality(entry) {
683
686
  if (!entry || typeof entry !== "object") return void 0;
684
687
  const meta = entry._augmented;
@@ -1602,14 +1605,18 @@ var GATEABLE_RESTART_REASONS = /* @__PURE__ */ new Set([
1602
1605
  "channel-set-change",
1603
1606
  "sender-policy-change",
1604
1607
  "channel-behaviour-change",
1605
- "mcp-presence-reaper"
1608
+ "mcp-presence-reaper",
1609
+ // ENG-7949: same gate-but-window-exempt shape as 'mcp-presence-reaper' — see
1610
+ // WINDOW_EXEMPT_RESTART_REASONS below for why this one skips the window too.
1611
+ "channel-mcp-down"
1606
1612
  ]);
1607
1613
  function isGateableRestartReason(reason) {
1608
1614
  return reason != null && GATEABLE_RESTART_REASONS.has(reason);
1609
1615
  }
1610
1616
  var WINDOW_EXEMPT_RESTART_REASONS = /* @__PURE__ */ new Set([
1611
1617
  "channel-set-change",
1612
- "sender-policy-change"
1618
+ "sender-policy-change",
1619
+ "channel-mcp-down"
1613
1620
  ]);
1614
1621
  function isWindowExemptRestartReason(reason) {
1615
1622
  return reason != null && WINDOW_EXEMPT_RESTART_REASONS.has(reason);
@@ -9113,7 +9120,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9113
9120
  var lastVersionCheckAt = 0;
9114
9121
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9115
9122
  var lastResponsivenessProbeAt = 0;
9116
- var agtCliVersion = true ? "0.28.389" : "dev";
9123
+ var agtCliVersion = true ? "0.28.391" : "dev";
9117
9124
  function resolveBrewPath(execFileSync2) {
9118
9125
  try {
9119
9126
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -12769,13 +12776,24 @@ async function processAgent(agent, agentStates) {
12769
12776
  // MCP) is decoupled from the GATE reason. Pre-6264 an undefined breaker
12770
12777
  // reason also made the restart non-gateable → 'bypass' → the session was
12771
12778
  // torn down mid-turn (the common single-MCP case interrupted busy
12772
- // agents). Always pass 'mcp-presence-reaper' as the gate reason so the
12773
- // restart defers-until-idle, while breakerReason still governs whether it
12774
- // counts against the breaker.
12779
+ // agents). Pass 'mcp-presence-reaper' as the gate reason so the restart
12780
+ // defers-until-idle, while breakerReason still governs whether it counts
12781
+ // against the breaker.
12782
+ //
12783
+ // ENG-7949: EXCEPT when at least one dead MCP (ctx.activeKeys, already
12784
+ // confirmed to have no live children) is a recognised CHANNEL server —
12785
+ // then the gate reason promotes to 'channel-mcp-down', which is
12786
+ // window-exempt (still defer-until-idle, never interrupts a live turn,
12787
+ // but skips the up-to-~14h off-peak window wait). A dead channel MCP
12788
+ // means the agent is unreachable on that channel right now; sitting
12789
+ // silently deferred until the window opens is a worse outcome than a
12790
+ // gated restart. A routine tool-MCP-only reaper restart (xero,
12791
+ // composio_*, unrecognised keys) keeps the original 'mcp-presence-
12792
+ // reaper' gate reason and still waits for the window as before.
12775
12793
  stopSession: (codeName, ctx) => stopPersistentSessionAndForgetMcpBaseline(
12776
12794
  codeName,
12777
12795
  reaperRestartBreakerReason(ctx.activeKeys),
12778
- "mcp-presence-reaper"
12796
+ ctx.activeKeys.some(isKnownChannelKey) ? "channel-mcp-down" : "mcp-presence-reaper"
12779
12797
  ),
12780
12798
  // ENG-5292: when the reaper gives up on a managed MCP (cap from
12781
12799
  // ENG-5279 + state-preservation from ENG-5285 both said "this