@integrity-labs/agt-cli 0.27.89 → 0.27.91

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.
@@ -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-HYJOPURH.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-BMP74QGP.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-OURIEGW6.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-XCZUY66M.js.map
@@ -16,7 +16,7 @@ import {
16
16
  provisionStopHook,
17
17
  requireHost,
18
18
  safeWriteJsonAtomic
19
- } from "../chunk-DDRAMRK3.js";
19
+ } from "../chunk-ALXQEKLP.js";
20
20
  import {
21
21
  getProjectDir as getProjectDir2,
22
22
  getReadyTasks,
@@ -54,7 +54,7 @@ import {
54
54
  stopPersistentSession,
55
55
  takeWatchdogGiveUpCount,
56
56
  takeZombieDetection
57
- } from "../chunk-TXIJLXOY.js";
57
+ } from "../chunk-4MZWINDQ.js";
58
58
  import {
59
59
  KANBAN_CHECK_COMMAND,
60
60
  appendDmFooter,
@@ -77,7 +77,7 @@ import {
77
77
  resolveConnectivityProbe,
78
78
  resolveDmTarget,
79
79
  wrapScheduledTaskPrompt
80
- } from "../chunk-XA3C3ZSH.js";
80
+ } from "../chunk-T2UTQH6W.js";
81
81
  import {
82
82
  parsePsRows,
83
83
  reapOrphanChannelMcps
@@ -695,6 +695,18 @@ function extractMsTeamsBehaviourSubset(config2) {
695
695
  };
696
696
  }
697
697
 
698
+ // src/lib/slack-behaviour-restart.ts
699
+ function extractSlackBehaviourSubset(config2) {
700
+ const rawAllowed = config2?.["allowed_users"];
701
+ return {
702
+ thread_auto_follow: config2?.["thread_auto_follow"] ?? "off",
703
+ channel_response_mode: config2?.["channel_response_mode"] ?? "mention_only",
704
+ // Mirror the adapter's defensive filter exactly — a malformed entry the
705
+ // adapter would drop must not count as an env change.
706
+ allowed_users: Array.isArray(rawAllowed) ? rawAllowed.filter((v) => typeof v === "string" && v.trim().length > 0).map((v) => v.trim()) : []
707
+ };
708
+ }
709
+
698
710
  // src/lib/channel-quarantine.ts
699
711
  import { readFileSync } from "fs";
700
712
  import { join } from "path";
@@ -2942,6 +2954,14 @@ var agentState = {
2942
2954
  * the session when an operator saves the webapp's Teams Advanced panel.
2943
2955
  */
2944
2956
  knownMsTeamsBehaviourHashes: /* @__PURE__ */ new Map(),
2957
+ /**
2958
+ * ENG-6035: hash of the Slack behaviour subset (allowed_users,
2959
+ * thread_auto_follow, channel_response_mode) from the agent's slack
2960
+ * channel config. Same last-hop rationale as the Teams map above —
2961
+ * slack-channel reads SLACK_ALLOWED_USERS (and friends) once at boot,
2962
+ * so an operator save needs this dedicated value-change trigger.
2963
+ */
2964
+ knownSlackBehaviourHashes: /* @__PURE__ */ new Map(),
2945
2965
  // ---------------------------------------------------------------------------
2946
2966
  // codeName-keyed
2947
2967
  // ---------------------------------------------------------------------------
@@ -2973,6 +2993,7 @@ function clearAgentState(agentId, codeName) {
2973
2993
  agentState.knownManagedMcpStructure.delete(agentId);
2974
2994
  agentState.knownSenderPolicyHashes.delete(agentId);
2975
2995
  agentState.knownMsTeamsBehaviourHashes.delete(agentId);
2996
+ agentState.knownSlackBehaviourHashes.delete(agentId);
2976
2997
  agentState.agentDisplayNames.delete(codeName);
2977
2998
  agentState.codeNameToAgentId.delete(codeName);
2978
2999
  let channelCacheMutated = false;
@@ -3975,7 +3996,7 @@ var cachedMaintenanceWindow = null;
3975
3996
  var lastVersionCheckAt = 0;
3976
3997
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
3977
3998
  var lastResponsivenessProbeAt = 0;
3978
- var agtCliVersion = true ? "0.27.89" : "dev";
3999
+ var agtCliVersion = true ? "0.27.91" : "dev";
3979
4000
  function resolveBrewPath(execFileSync4) {
3980
4001
  try {
3981
4002
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -5166,7 +5187,7 @@ async function pollCycle() {
5166
5187
  }
5167
5188
  try {
5168
5189
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
5169
- const { collectDiagnostics } = await import("../persistent-session-HYJOPURH.js");
5190
+ const { collectDiagnostics } = await import("../persistent-session-BMP74QGP.js");
5170
5191
  const diagCodeNames = [...agentState.persistentSessionAgents];
5171
5192
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
5172
5193
  let tailscaleHostname;
@@ -5239,7 +5260,7 @@ async function pollCycle() {
5239
5260
  const {
5240
5261
  collectResponsivenessProbes,
5241
5262
  getResponsivenessIntervalMs
5242
- } = await import("../responsiveness-probe-522ZBE5Q.js");
5263
+ } = await import("../responsiveness-probe-AFOPQEFX.js");
5243
5264
  const probeIntervalMs = getResponsivenessIntervalMs();
5244
5265
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
5245
5266
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -6165,6 +6186,7 @@ async function processAgent(agent, agentStates) {
6165
6186
  );
6166
6187
  }
6167
6188
  agentState.knownSenderPolicyHashes.set(agent.agent_id, senderPolicyHash);
6189
+ let msteamsBehaviourRestartScheduled = false;
6168
6190
  if (currentChannelIds.has("msteams")) {
6169
6191
  const msteamsEntry = refreshData.channel_configs?.["msteams"];
6170
6192
  const behaviourSubset = extractMsTeamsBehaviourSubset(
@@ -6206,11 +6228,59 @@ async function processAgent(agent, agentStates) {
6206
6228
  "msteams behaviour change",
6207
6229
  "channel-behaviour-change"
6208
6230
  );
6231
+ msteamsBehaviourRestartScheduled = true;
6209
6232
  }
6210
6233
  agentState.knownMsTeamsBehaviourHashes.set(agent.agent_id, behaviourHash);
6211
6234
  } else {
6212
6235
  agentState.knownMsTeamsBehaviourHashes.delete(agent.agent_id);
6213
6236
  }
6237
+ if (currentChannelIds.has("slack")) {
6238
+ const slackEntry = refreshData.channel_configs?.["slack"];
6239
+ const slackBehaviourSubset = extractSlackBehaviourSubset(
6240
+ slackEntry?.config
6241
+ );
6242
+ const slackBehaviourHash = createHash3("sha256").update(canonicalJson(slackBehaviourSubset)).digest("hex");
6243
+ const prevSlackBehaviourHash = agentState.knownSlackBehaviourHashes.get(agent.agent_id);
6244
+ const slackBehaviourDecision = decideSenderPolicyRestart({
6245
+ previousHash: prevSlackBehaviourHash,
6246
+ currentHash: slackBehaviourHash,
6247
+ sessionMode: refreshData.agent.session_mode,
6248
+ framework: agentFrameworkCache.get(agent.code_name) ?? "openclaw",
6249
+ sessionHealthy: isSessionHealthy(agent.code_name),
6250
+ // A channel-set, sender-policy, or msteams-behaviour restart
6251
+ // scheduled this tick respawns the MCP children with the
6252
+ // freshly-written env for free.
6253
+ channelSetRestartAlreadyScheduled: channelSetRestartScheduled || senderPolicyDecision.restart || msteamsBehaviourRestartScheduled
6254
+ });
6255
+ if (slackBehaviourDecision.restart) {
6256
+ log(
6257
+ `[hot-reload] slack behaviour settings changed for '${agent.code_name}' (${prevSlackBehaviourHash?.slice(0, 8) ?? "first"} \u2192 ${slackBehaviourHash.slice(0, 8)}) \u2014 restarting session`
6258
+ );
6259
+ const slackBehaviourNotice = "Your Slack channel behaviour settings were updated. Restarting session shortly so the slack-channel MCP picks up the new configuration.";
6260
+ const slackBehaviourDelivered = await injectMessage(
6261
+ agent.code_name,
6262
+ "system",
6263
+ slackBehaviourNotice,
6264
+ { task_name: "channel-update" },
6265
+ log
6266
+ ).catch(() => false);
6267
+ const slackBehaviourDelay = slackBehaviourDelivered ? 8e3 : 3e3;
6268
+ if (!slackBehaviourDelivered) {
6269
+ log(
6270
+ `[hot-reload] Inject notification unconfirmed for '${agent.code_name}' \u2014 proceeding with shorter delay`
6271
+ );
6272
+ }
6273
+ scheduleSessionRestart(
6274
+ agent.code_name,
6275
+ slackBehaviourDelay,
6276
+ "slack behaviour change",
6277
+ "channel-behaviour-change"
6278
+ );
6279
+ }
6280
+ agentState.knownSlackBehaviourHashes.set(agent.agent_id, slackBehaviourHash);
6281
+ } else {
6282
+ agentState.knownSlackBehaviourHashes.delete(agent.agent_id);
6283
+ }
6214
6284
  }
6215
6285
  const agentSessionMode = refreshData.agent.session_mode;
6216
6286
  if (agentSessionMode === "persistent" && (agentFrameworkCache.get(agent.code_name) ?? "openclaw") === "claude-code") {
@@ -9484,7 +9554,7 @@ async function processClaudePairSessions(agents) {
9484
9554
  killPairSession,
9485
9555
  pairTmuxSession,
9486
9556
  finalizeClaudePairOnboarding
9487
- } = await import("../claude-pair-runtime-OURIEGW6.js");
9557
+ } = await import("../claude-pair-runtime-XCZUY66M.js");
9488
9558
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
9489
9559
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
9490
9560
  const killed = await killPairSession(pairTmuxSession(pairId));