@integrity-labs/agt-cli 0.27.112 → 0.27.114

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  claudeModelAlias,
3
3
  isClaudeFastMode
4
- } from "./chunk-Z3YQYO43.js";
4
+ } from "./chunk-MTKM655R.js";
5
5
  import {
6
6
  reapOrphanChannelMcps
7
7
  } from "./chunk-XWVM4KPK.js";
@@ -1574,4 +1574,4 @@ export {
1574
1574
  stopAllSessionsAndWait,
1575
1575
  getProjectDir
1576
1576
  };
1577
- //# sourceMappingURL=chunk-D2EJL2KI.js.map
1577
+ //# sourceMappingURL=chunk-RN3OMHW7.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-3ZWAGNNO.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-E6YLH6TX.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-DS7675XI.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-KVJ4U436.js.map
@@ -17,7 +17,7 @@ import {
17
17
  provisionStopHook,
18
18
  requireHost,
19
19
  safeWriteJsonAtomic
20
- } from "../chunk-ILYN3XBV.js";
20
+ } from "../chunk-7KIMZAMG.js";
21
21
  import {
22
22
  getProjectDir as getProjectDir2,
23
23
  getReadyTasks,
@@ -55,7 +55,7 @@ import {
55
55
  stopPersistentSession,
56
56
  takeWatchdogGiveUpCount,
57
57
  takeZombieDetection
58
- } from "../chunk-D2EJL2KI.js";
58
+ } from "../chunk-RN3OMHW7.js";
59
59
  import {
60
60
  KANBAN_CHECK_COMMAND,
61
61
  SUPPRESS_SENTINEL,
@@ -74,12 +74,14 @@ import {
74
74
  parseDeliveryTarget,
75
75
  parseTranscriptUsage,
76
76
  parseUsageBanner,
77
+ probeComposioAccount,
77
78
  probeHttpProvider,
78
79
  resolveChannels,
79
80
  resolveConnectivityProbe,
80
81
  resolveDmTarget,
82
+ worseConnectivityOutcome,
81
83
  wrapScheduledTaskPrompt
82
- } from "../chunk-Z3YQYO43.js";
84
+ } from "../chunk-MTKM655R.js";
83
85
  import {
84
86
  parsePsRows,
85
87
  reapOrphanChannelMcps
@@ -1030,6 +1032,22 @@ async function executeConnectivityProbe(target, deps = {}) {
1030
1032
  case "composio_account":
1031
1033
  if (!deps.composioProbe) return null;
1032
1034
  return deps.composioProbe(target.definitionId, target.credentials);
1035
+ case "managed_composite": {
1036
+ const outcomes = [];
1037
+ if (deps.mcpProbe) {
1038
+ outcomes.push(
1039
+ await deps.mcpProbe({
1040
+ serverKey: target.mcpServerKey ?? target.definitionId,
1041
+ definitionId: target.definitionId
1042
+ })
1043
+ );
1044
+ }
1045
+ if (deps.composioProbe) {
1046
+ outcomes.push(await deps.composioProbe(target.definitionId, target.credentials));
1047
+ }
1048
+ if (outcomes.length === 0) return null;
1049
+ return outcomes.reduce((acc, o) => worseConnectivityOutcome(acc, o));
1050
+ }
1033
1051
  case "mcp_tools_list":
1034
1052
  if (!deps.mcpProbe) return null;
1035
1053
  return deps.mcpProbe({
@@ -3771,6 +3789,7 @@ var autoResumeInFlight = /* @__PURE__ */ new Set();
3771
3789
  var AUTO_RESUME_SELF_WINDOW_MS = 12e4;
3772
3790
  var autoResumeLoggedSkips = /* @__PURE__ */ new Map();
3773
3791
  var autoResumeStandDowns = /* @__PURE__ */ new Set();
3792
+ var killPausedCodeNames = /* @__PURE__ */ new Set();
3774
3793
  function maybeAutoResume(agent) {
3775
3794
  const codeName = agent.code_name;
3776
3795
  if (autoResumeInFlight.has(codeName)) return;
@@ -3929,6 +3948,28 @@ async function runAgentConnectivityProbes(agent, integrations, projectDir) {
3929
3948
  return { status: "transient_error", message: `MCP server '${target.serverKey}' not resolvable from .mcp.json` };
3930
3949
  }
3931
3950
  return probeMcpHttp(cfg);
3951
+ },
3952
+ // ENG-6139: connected-account binding check for managed (Composio) toolkits.
3953
+ // The MCP handshake reads green on a dead/mis-bound account, so the managed
3954
+ // probe also verifies the account is ACTIVE + bound to the entity the agent
3955
+ // queries with. Inputs come from the agent's OWN wired MCP server: the
3956
+ // `x-api-key` header and the `user_id` query param (the agent already
3957
+ // authenticates with these), plus the recorded connected_account_id.
3958
+ composioProbe: async (definitionId, credentials) => {
3959
+ const serverKey = definitionId.replace(/[^a-z0-9]/gi, "_").toLowerCase();
3960
+ const cfg = readMcpHttpServerConfig(projectDir, serverKey);
3961
+ if (!cfg) {
3962
+ return { status: "transient_error", message: `MCP server '${serverKey}' not resolvable from .mcp.json` };
3963
+ }
3964
+ const apiKey = cfg.headers?.["x-api-key"] ?? cfg.headers?.["X-API-Key"] ?? "";
3965
+ let expectedUserId = "";
3966
+ try {
3967
+ expectedUserId = new URL(cfg.url).searchParams.get("user_id") ?? "";
3968
+ } catch {
3969
+ expectedUserId = "";
3970
+ }
3971
+ const connectedAccountId = typeof credentials?.["connected_account_id"] === "string" ? credentials["connected_account_id"] : "";
3972
+ return probeComposioAccount({ connectedAccountId, apiKey, expectedUserId });
3932
3973
  }
3933
3974
  };
3934
3975
  const intervalSec = Number(process.env.AGT_CONNECTIVITY_PROBE_INTERVAL_SECONDS) || 3600;
@@ -4133,7 +4174,7 @@ var cachedMaintenanceWindow = null;
4133
4174
  var lastVersionCheckAt = 0;
4134
4175
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
4135
4176
  var lastResponsivenessProbeAt = 0;
4136
- var agtCliVersion = true ? "0.27.112" : "dev";
4177
+ var agtCliVersion = true ? "0.27.114" : "dev";
4137
4178
  function resolveBrewPath(execFileSync4) {
4138
4179
  try {
4139
4180
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -5326,7 +5367,7 @@ async function pollCycle() {
5326
5367
  }
5327
5368
  try {
5328
5369
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
5329
- const { collectDiagnostics } = await import("../persistent-session-3ZWAGNNO.js");
5370
+ const { collectDiagnostics } = await import("../persistent-session-E6YLH6TX.js");
5330
5371
  const diagCodeNames = [...agentState.persistentSessionAgents];
5331
5372
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
5332
5373
  let tailscaleHostname;
@@ -5413,12 +5454,12 @@ async function pollCycle() {
5413
5454
  const {
5414
5455
  collectResponsivenessProbes,
5415
5456
  getResponsivenessIntervalMs
5416
- } = await import("../responsiveness-probe-EGXJFJBW.js");
5457
+ } = await import("../responsiveness-probe-TDHX6JKG.js");
5417
5458
  const probeIntervalMs = getResponsivenessIntervalMs();
5418
5459
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
5419
5460
  const probeCodeNames = [...agentState.persistentSessionAgents];
5420
5461
  if (probeCodeNames.length > 0) {
5421
- const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-3ZWAGNNO.js");
5462
+ const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-E6YLH6TX.js");
5422
5463
  const drainedGiveUps = /* @__PURE__ */ new Map();
5423
5464
  const drainedAcpxFailures = /* @__PURE__ */ new Map();
5424
5465
  const probes = collectResponsivenessProbes(probeCodeNames).map((p) => {
@@ -5778,6 +5819,16 @@ async function processAgent(agent, agentStates) {
5778
5819
  if (previousKnownStatus !== agent.status) {
5779
5820
  log(`Agent '${agent.code_name}' is ${agent.status}, skipping provisioning`);
5780
5821
  }
5822
+ if (agent.kill_switch) {
5823
+ killPausedCodeNames.add(agent.code_name);
5824
+ if (previousKnownStatus !== agent.status) {
5825
+ log(
5826
+ `[kill-switch] '${agent.code_name}' halted by ${agent.kill_switch.scope ?? "unknown"} kill switch` + (agent.kill_switch.reason ? ` (reason: ${agent.kill_switch.reason})` : "") + ` source=${agent.kill_switch.source ?? "unknown"}`
5827
+ );
5828
+ }
5829
+ } else if (killPausedCodeNames.delete(agent.code_name)) {
5830
+ log(`[kill-switch] '${agent.code_name}' kill switch cleared while still ${agent.status} (no resume \u2014 paused for another reason)`);
5831
+ }
5781
5832
  await stopGatewayIfRunning(agent.code_name, adapter);
5782
5833
  stopPersistentSessionAndForgetMcpBaseline(agent.code_name);
5783
5834
  try {
@@ -5786,7 +5837,7 @@ async function processAgent(agent, agentStates) {
5786
5837
  log(`Killed tmux session for paused agent '${agent.code_name}'`);
5787
5838
  } catch {
5788
5839
  }
5789
- if (agent.status === "paused") {
5840
+ if (agent.status === "paused" && !agent.kill_switch) {
5790
5841
  maybeAutoResume(agent);
5791
5842
  }
5792
5843
  agentStates.push({
@@ -5892,6 +5943,16 @@ async function processAgent(agent, agentStates) {
5892
5943
  log(`[auto-resume] Cleared auto-resume marker for '${agent.code_name}' on operator resume \u2014 credit re-armed (ENG-6088)`);
5893
5944
  }
5894
5945
  }
5946
+ if (previousStatus === "paused" && agent.status === "active" && killPausedCodeNames.delete(agent.code_name)) {
5947
+ log(`[kill-switch] '${agent.code_name}' kill switch cleared \u2014 resuming session`);
5948
+ void injectMessage(
5949
+ agent.code_name,
5950
+ "system",
5951
+ "The kill switch that halted you has been cleared. Your session is resuming.",
5952
+ { task_name: "kill-switch-resume" },
5953
+ log
5954
+ ).catch(() => false);
5955
+ }
5895
5956
  let channelCacheMutated = false;
5896
5957
  for (const key of agentState.knownChannelConfigHashes.keys()) {
5897
5958
  if (key.startsWith(`${agent.agent_id}:`)) {
@@ -9794,7 +9855,7 @@ async function processClaudePairSessions(agents) {
9794
9855
  killPairSession,
9795
9856
  pairTmuxSession,
9796
9857
  finalizeClaudePairOnboarding
9797
- } = await import("../claude-pair-runtime-DS7675XI.js");
9858
+ } = await import("../claude-pair-runtime-KVJ4U436.js");
9798
9859
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
9799
9860
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
9800
9861
  const killed = await killPairSession(pairTmuxSession(pairId));