@integrity-labs/agt-cli 0.28.267 → 0.28.269

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-FGGXFAJH.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-ZQDTWV3D.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-CXIVEO6R.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-CXM2IH7U.js.map
@@ -38,7 +38,7 @@ import {
38
38
  requireHost,
39
39
  safeWriteJsonAtomic,
40
40
  setConfigHash
41
- } from "../chunk-OTXH3YLU.js";
41
+ } from "../chunk-ZH3CEX2A.js";
42
42
  import {
43
43
  getProjectDir as getProjectDir2,
44
44
  getReadyTasks,
@@ -123,7 +123,7 @@ import {
123
123
  takeZombieDetection,
124
124
  transcriptActivityAgeSeconds,
125
125
  writeEgressAllowlist
126
- } from "../chunk-GBVZDTCB.js";
126
+ } from "../chunk-JW6CWBNF.js";
127
127
  import {
128
128
  reapOrphanChannelMcps
129
129
  } from "../chunk-XWVM4KPK.js";
@@ -6700,7 +6700,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
6700
6700
  var lastVersionCheckAt = 0;
6701
6701
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6702
6702
  var lastResponsivenessProbeAt = 0;
6703
- var agtCliVersion = true ? "0.28.267" : "dev";
6703
+ var agtCliVersion = true ? "0.28.269" : "dev";
6704
6704
  function resolveBrewPath(execFileSync2) {
6705
6705
  try {
6706
6706
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7550,7 +7550,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
7550
7550
  if (codeNames.length === 0) return;
7551
7551
  void (async () => {
7552
7552
  try {
7553
- const { collectDiagnostics } = await import("../persistent-session-FGGXFAJH.js");
7553
+ const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
7554
7554
  await api.post("/host/heartbeat", {
7555
7555
  host_id: hostId,
7556
7556
  agent_diagnostics: collectDiagnostics(codeNames)
@@ -7648,7 +7648,7 @@ async function pollCycle() {
7648
7648
  }
7649
7649
  try {
7650
7650
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
7651
- const { collectDiagnostics } = await import("../persistent-session-FGGXFAJH.js");
7651
+ const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
7652
7652
  const diagCodeNames = [...agentState.persistentSessionAgents];
7653
7653
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
7654
7654
  let tailscaleHostname;
@@ -7796,7 +7796,7 @@ async function pollCycle() {
7796
7796
  const {
7797
7797
  collectResponsivenessProbes,
7798
7798
  getResponsivenessIntervalMs
7799
- } = await import("../responsiveness-probe-2734PYS6.js");
7799
+ } = await import("../responsiveness-probe-74SDDDGN.js");
7800
7800
  const probeIntervalMs = getResponsivenessIntervalMs();
7801
7801
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
7802
7802
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -7828,7 +7828,7 @@ async function pollCycle() {
7828
7828
  collectResponsivenessProbes,
7829
7829
  livePendingInboundOldestAgeSeconds,
7830
7830
  parkPendingInbound
7831
- } = await import("../responsiveness-probe-2734PYS6.js");
7831
+ } = await import("../responsiveness-probe-74SDDDGN.js");
7832
7832
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
7833
7833
  const wedgeNow = /* @__PURE__ */ new Date();
7834
7834
  const liveAgents = agentState.persistentSessionAgents;
@@ -10686,7 +10686,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
10686
10686
  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}`));
10687
10687
  void (async () => {
10688
10688
  try {
10689
- const { collectDiagnostics } = await import("../persistent-session-FGGXFAJH.js");
10689
+ const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
10690
10690
  await api.post("/host/heartbeat", {
10691
10691
  host_id: hostId,
10692
10692
  agent_diagnostics: collectDiagnostics([codeName])
@@ -10736,7 +10736,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
10736
10736
  }
10737
10737
  try {
10738
10738
  const hostId = await getHostId();
10739
- const { collectDiagnostics } = await import("../persistent-session-FGGXFAJH.js");
10739
+ const { collectDiagnostics } = await import("../persistent-session-ZQDTWV3D.js");
10740
10740
  await api.post("/host/heartbeat", {
10741
10741
  host_id: hostId,
10742
10742
  agent_diagnostics: collectDiagnostics([codeName])
@@ -11127,7 +11127,7 @@ async function processClaudePairSessions(agents) {
11127
11127
  killPairSession,
11128
11128
  pairTmuxSession,
11129
11129
  finalizeClaudePairOnboarding
11130
- } = await import("../claude-pair-runtime-CXIVEO6R.js");
11130
+ } = await import("../claude-pair-runtime-CXM2IH7U.js");
11131
11131
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
11132
11132
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
11133
11133
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -11,16 +11,38 @@ var URL_ENV = "AGT_REMOTE_MCP_URL";
11
11
  var TOKEN_FILE_ENV = "AGT_REMOTE_MCP_TOKEN_FILE";
12
12
  var TOKEN_VAR_ENV = "AGT_REMOTE_MCP_TOKEN_VAR";
13
13
  var ALLOWLIST_ENV = "AGT_REMOTE_MCP_TOOL_ALLOWLIST";
14
+ var PREENABLE_ENV = "AGT_REMOTE_MCP_PREENABLE_TOOLSETS";
14
15
  var REMOTE_FETCH_TIMEOUT_MS = 3e4;
15
16
  var remoteUrl = process.env[URL_ENV] ?? "";
16
17
  var tokenFile = process.env[TOKEN_FILE_ENV] ?? "";
17
18
  var tokenVar = process.env[TOKEN_VAR_ENV] ?? "";
18
19
  var label = process.env["AGT_REMOTE_MCP_LABEL"] || tokenVar || "remote-oauth";
19
20
  var toolAllowlist = parseToolAllowlist(process.env[ALLOWLIST_ENV] ?? "");
21
+ var preEnableToolsets = parsePreEnableToolsets(process.env[PREENABLE_ENV] ?? "");
20
22
  function logErr(msg) {
21
23
  process.stderr.write(`[remote-oauth-proxy:${label}] ${msg}
22
24
  `);
23
25
  }
26
+ function parsePreEnableToolsets(raw) {
27
+ const seen = /* @__PURE__ */ new Set();
28
+ const out = [];
29
+ for (const part of (raw || "").split(",")) {
30
+ const name = part.trim();
31
+ if (name && !seen.has(name)) {
32
+ seen.add(name);
33
+ out.push(name);
34
+ }
35
+ }
36
+ return out;
37
+ }
38
+ function buildEnableToolsetRequest(toolset) {
39
+ return JSON.stringify({
40
+ jsonrpc: "2.0",
41
+ id: `agt-preenable-${toolset}`,
42
+ method: "tools/call",
43
+ params: { name: "enable_toolset", arguments: { name: toolset } }
44
+ });
45
+ }
24
46
  function parseToolAllowlist(raw) {
25
47
  const out = /* @__PURE__ */ new Set();
26
48
  for (const part of (raw || "").split(",")) {
@@ -104,12 +126,54 @@ function extractJsonRpcMessages(contentType, body) {
104
126
  }
105
127
  return out;
106
128
  }
129
+ var preEnabledOnce = null;
130
+ function ensurePreEnabled(token) {
131
+ if (preEnabledOnce) return preEnabledOnce;
132
+ preEnabledOnce = Promise.allSettled(
133
+ preEnableToolsets.map(async (name) => {
134
+ const res = await fetch(remoteUrl, {
135
+ method: "POST",
136
+ headers: {
137
+ "Content-Type": "application/json",
138
+ Accept: "application/json, text/event-stream",
139
+ Authorization: `Bearer ${token}`
140
+ },
141
+ body: buildEnableToolsetRequest(name),
142
+ signal: AbortSignal.timeout(REMOTE_FETCH_TIMEOUT_MS)
143
+ });
144
+ const body = await res.text().catch(() => "");
145
+ if (!res.ok) {
146
+ throw new Error(`HTTP ${res.status}${body ? ` (${body.slice(0, 200).replace(/\s+/g, " ").trim()})` : ""}`);
147
+ }
148
+ let rpcError;
149
+ try {
150
+ rpcError = JSON.parse(body)?.error?.message;
151
+ } catch {
152
+ }
153
+ if (rpcError) throw new Error(rpcError);
154
+ return name;
155
+ })
156
+ ).then((results) => {
157
+ results.forEach((r, i) => {
158
+ const name = preEnableToolsets[i];
159
+ if (r.status === "fulfilled") {
160
+ logErr(`pre-enabled toolset "${name}"`);
161
+ } else {
162
+ logErr(`pre-enable toolset "${name}" failed: ${r.reason.message}`);
163
+ }
164
+ });
165
+ });
166
+ return preEnabledOnce;
167
+ }
107
168
  async function forward(line, id, isNotification, method) {
108
169
  const token = readCurrentToken(tokenFile, tokenVar);
109
170
  if (!token) {
110
171
  logErr(`no token in ${tokenFile} (var ${tokenVar})`);
111
172
  return isNotification ? [] : [jsonRpcError(id, -32e3, `${label}: no current access token available (reconnect the integration)`)];
112
173
  }
174
+ if (method === "tools/list" && preEnableToolsets.length > 0) {
175
+ await ensurePreEnabled(token);
176
+ }
113
177
  let res;
114
178
  try {
115
179
  res = await fetch(remoteUrl, {
@@ -224,10 +288,12 @@ if (invokedDirectly) {
224
288
  void main();
225
289
  }
226
290
  export {
291
+ buildEnableToolsetRequest,
227
292
  extractJsonRpcMessages,
228
293
  filterToolsListMessage,
229
294
  isToolCallBlocked,
230
295
  main,
296
+ parsePreEnableToolsets,
231
297
  parseToolAllowlist,
232
298
  readCurrentToken
233
299
  };
@@ -16869,7 +16869,7 @@ import { join as join9 } from "path";
16869
16869
  var DEFAULT_MAX_ENTRIES = 500;
16870
16870
  var DEFAULT_CLEARED_TTL_MS = 6 * 60 * 60 * 1e3;
16871
16871
  function entryKey(channel, messageTs) {
16872
- return `${channel}\0${messageTs}`;
16872
+ return `${channel} ${messageTs}`;
16873
16873
  }
16874
16874
  function createInboundRegistry(opts = {}) {
16875
16875
  const maxEntries = opts.maxEntries ?? DEFAULT_MAX_ENTRIES;
@@ -16946,6 +16946,27 @@ function createInboundRegistry(opts = {}) {
16946
16946
  }
16947
16947
  return best;
16948
16948
  }
16949
+ function byCoordsAnyChannel(threadOrMessageTs) {
16950
+ let best = null;
16951
+ let bestExact = false;
16952
+ for (const e of entries.values()) {
16953
+ const exact = e.messageTs === threadOrMessageTs;
16954
+ const thread = e.threadTs === threadOrMessageTs;
16955
+ if (!exact && !thread) continue;
16956
+ if (best === null) {
16957
+ best = e;
16958
+ bestExact = exact;
16959
+ continue;
16960
+ }
16961
+ if (exact && !bestExact) {
16962
+ best = e;
16963
+ bestExact = true;
16964
+ } else if (exact === bestExact && e.receivedAt >= best.receivedAt) {
16965
+ best = e;
16966
+ }
16967
+ }
16968
+ return best;
16969
+ }
16949
16970
  function livePending() {
16950
16971
  const out = [];
16951
16972
  for (const e of entries.values()) {
@@ -16994,6 +17015,7 @@ function createInboundRegistry(opts = {}) {
16994
17015
  markClearedOldestInChannel,
16995
17016
  byInboundId,
16996
17017
  byCoords,
17018
+ byCoordsAnyChannel,
16997
17019
  livePending,
16998
17020
  seedFromMarkerDir,
16999
17021
  size: () => entries.size
@@ -17059,6 +17081,33 @@ function resolveReplyBinding(input) {
17059
17081
  }
17060
17082
  return classifyByCoords(mode, args, registry2, now, false, knownThread);
17061
17083
  }
17084
+ function isDmChannel(channel) {
17085
+ return !!channel && channel.startsWith("D");
17086
+ }
17087
+ function guardReplyChannel(input) {
17088
+ const { args, registry: registry2 } = input;
17089
+ const noop = {
17090
+ channel: args.channel,
17091
+ threadTs: args.thread_ts,
17092
+ messageTs: args.message_ts,
17093
+ corrected: false,
17094
+ dm: false
17095
+ };
17096
+ if (args.inbound_id) return noop;
17097
+ if (args.proactive === true) return noop;
17098
+ if (!args.channel) return noop;
17099
+ const matched = (args.message_ts ? registry2.byCoordsAnyChannel(args.message_ts) : null) ?? (args.thread_ts ? registry2.byCoordsAnyChannel(args.thread_ts) : null);
17100
+ if (!matched) return noop;
17101
+ if (matched.channel === args.channel) return noop;
17102
+ return {
17103
+ channel: matched.channel,
17104
+ threadTs: matched.threadTs,
17105
+ messageTs: matched.messageTs,
17106
+ corrected: true,
17107
+ dm: isDmChannel(matched.channel),
17108
+ requestedChannel: args.channel
17109
+ };
17110
+ }
17062
17111
  function classifyByCoords(mode, args, registry2, now, unknownInboundId, knownThread) {
17063
17112
  const modelChannel = args.channel;
17064
17113
  const modelThread = args.thread_ts;
@@ -17121,6 +17170,8 @@ import { readFileSync as readFileSync11, writeFileSync as writeFileSync9 } from
17121
17170
  import { join as join10 } from "path";
17122
17171
  var REPLY_BINDING_CLASSIFICATION_COUNTER_SUFFIX = "-reply-binding-classifications.json";
17123
17172
  var UNKNOWN_INBOUND_ID_KEY = "unknown_inbound_id";
17173
+ var CHANNEL_MISTARGET_CORRECTED_KEY = "channel_mistarget_corrected";
17174
+ var DM_CHANNEL_MISTARGET_KEY = "dm_channel_mistarget";
17124
17175
  var VALID_MODES = /* @__PURE__ */ new Set(["shadow", "warn", "enforce"]);
17125
17176
  function slackReplyBindingMode() {
17126
17177
  const raw = process.env["AGT_SLACK_REPLY_BINDING"];
@@ -17145,6 +17196,24 @@ function recordReplyBindingClassification(agentDir, channel, input) {
17145
17196
  } catch {
17146
17197
  }
17147
17198
  }
17199
+ function recordChannelMistarget(agentDir, channel, input) {
17200
+ if (!agentDir) return;
17201
+ const path = join10(agentDir, `${channel}${REPLY_BINDING_CLASSIFICATION_COUNTER_SUFFIX}`);
17202
+ let counts = {};
17203
+ try {
17204
+ const parsed = JSON.parse(readFileSync11(path, "utf-8"));
17205
+ if (parsed && typeof parsed === "object") counts = parsed;
17206
+ } catch {
17207
+ }
17208
+ counts[CHANNEL_MISTARGET_CORRECTED_KEY] = (counts[CHANNEL_MISTARGET_CORRECTED_KEY] ?? 0) + 1;
17209
+ if (input.dm) {
17210
+ counts[DM_CHANNEL_MISTARGET_KEY] = (counts[DM_CHANNEL_MISTARGET_KEY] ?? 0) + 1;
17211
+ }
17212
+ try {
17213
+ writeFileSync9(path, JSON.stringify(counts), { mode: 384 });
17214
+ } catch {
17215
+ }
17216
+ }
17148
17217
 
17149
17218
  // src/slack-reply-target-telemetry.ts
17150
17219
  import { readFileSync as readFileSync12, writeFileSync as writeFileSync10 } from "fs";
@@ -20297,7 +20366,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
20297
20366
  properties: {
20298
20367
  channel: {
20299
20368
  type: "string",
20300
- description: "Slack channel ID (from the channel attribute in the <channel> tag)"
20369
+ description: 'Slack channel ID. Copy it from the channel attribute of the SAME <channel> tag you are answering - never reuse a channel from a different message. A DM channel starts with "D": a DM answer MUST go to that "D\u2026" id, not a shared "C\u2026"/"G\u2026" channel. Prefer passing inbound_id, which resolves the exact destination for you.'
20301
20370
  },
20302
20371
  text: { type: "string", description: "The message to send" },
20303
20372
  thread_ts: {
@@ -20324,7 +20393,7 @@ mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
20324
20393
  // WS2 (cross-thread reply routing): the preferred way to target a reply.
20325
20394
  inbound_id: {
20326
20395
  type: "string",
20327
- description: `The inbound_id attribute of the <channel> tag you are answering (e.g. "ib_a1b2c3d4e5f6"). PREFERRED over channel/thread_ts/message_ts: the server resolves the exact destination thread from it, so your reply can never land in another user's thread. Copy it verbatim from the tag of the message you are replying to.`
20396
+ description: `The inbound_id attribute of the <channel> tag you are answering (e.g. "ib_a1b2c3d4e5f6"). ALWAYS include it when replying to a message - it is STRONGLY PREFERRED over channel/thread_ts/message_ts because the server resolves the exact destination (channel AND thread) from it, so your reply can never land in another user's channel or thread. Copy it verbatim from the tag of the message you are replying to. Omit it only for a proactive (self-initiated) send.`
20328
20397
  },
20329
20398
  proactive: {
20330
20399
  type: "boolean",
@@ -20580,7 +20649,20 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
20580
20649
  classification: binding.classification,
20581
20650
  unknownInboundId: binding.unknownInboundId
20582
20651
  });
20583
- if (bindingMode === "enforce" && binding.reject) {
20652
+ const channelGuard = guardReplyChannel({
20653
+ args: { inbound_id, channel, thread_ts, message_ts, proactive },
20654
+ registry: slackInboundRegistry
20655
+ });
20656
+ if (channelGuard.corrected) {
20657
+ recordChannelMistarget(SLACK_AGENT_DIR, "slack", { dm: channelGuard.dm });
20658
+ process.stderr.write(
20659
+ `slack-channel(${AGENT_CODE_NAME}): reply_channel_mistarget_corrected dm=${channelGuard.dm} requested=${redactSlackId(channelGuard.requestedChannel)} registry=${redactSlackId(channelGuard.channel)}
20660
+ `
20661
+ );
20662
+ }
20663
+ const effectiveChannel = channelGuard.corrected && channelGuard.channel ? channelGuard.channel : channel;
20664
+ const effectiveMessageTs = channelGuard.corrected ? channelGuard.messageTs : message_ts;
20665
+ if (bindingMode === "enforce" && binding.reject && !channelGuard.corrected) {
20584
20666
  process.stderr.write(
20585
20667
  `slack-channel(${AGENT_CODE_NAME}): reply_binding_rejected class=${binding.classification} channel=${redactSlackId(channel)}
20586
20668
  `
@@ -20604,28 +20686,28 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
20604
20686
  };
20605
20687
  }
20606
20688
  const bindingFeedback = bindingMode === "warn" ? binding.agentFeedback : void 0;
20607
- const effectiveThreadTs = enforceBound ? binding.threadTs : resolveReplyThreadTs({
20689
+ const effectiveThreadTs = enforceBound ? binding.threadTs : channelGuard.corrected ? channelGuard.threadTs : resolveReplyThreadTs({
20608
20690
  channel,
20609
20691
  threadTs: thread_ts,
20610
20692
  messageTs: message_ts
20611
20693
  });
20612
- if (channel) {
20694
+ if (effectiveChannel) {
20613
20695
  recordReplyTargetClassification(
20614
20696
  SLACK_AGENT_DIR,
20615
20697
  "slack",
20616
20698
  classifyReplyTarget({
20617
- channel,
20699
+ channel: effectiveChannel,
20618
20700
  threadTs: effectiveThreadTs,
20619
- messageTs: message_ts,
20701
+ messageTs: effectiveMessageTs,
20620
20702
  registry: slackInboundRegistry
20621
20703
  })
20622
20704
  );
20623
20705
  }
20624
20706
  const throttleCfg = configFromEnv();
20625
- const throttleKey = effectiveThreadTs ?? channel;
20707
+ const throttleKey = effectiveThreadTs ?? effectiveChannel;
20626
20708
  const throttleNow = Date.now();
20627
20709
  const throttleDecision = decideReplyThrottle({
20628
- recentReplyTimestamps: getRecentReplies(channel, throttleKey, throttleNow, throttleCfg),
20710
+ recentReplyTimestamps: getRecentReplies(effectiveChannel, throttleKey, throttleNow, throttleCfg),
20629
20711
  now: throttleNow,
20630
20712
  config: throttleCfg
20631
20713
  });
@@ -20634,14 +20716,14 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
20634
20716
  `slack-channel(${AGENT_CODE_NAME}): reply_throttled channel=${redactSlackId(channel)} thread=${redactSlackId(throttleKey)} count=${throttleDecision.recentCount} window_ms=${throttleCfg.windowMs} threshold=${throttleCfg.threshold}
20635
20717
  `
20636
20718
  );
20637
- if (channel && effectiveThreadTs) {
20719
+ if (effectiveChannel && effectiveThreadTs) {
20638
20720
  fetch("https://slack.com/api/reactions.add", {
20639
20721
  method: "POST",
20640
20722
  headers: {
20641
20723
  "Content-Type": "application/json",
20642
20724
  Authorization: `Bearer ${BOT_TOKEN}`
20643
20725
  },
20644
- body: JSON.stringify({ channel, timestamp: effectiveThreadTs, name: "lock" })
20726
+ body: JSON.stringify({ channel: effectiveChannel, timestamp: effectiveThreadTs, name: "lock" })
20645
20727
  }).catch(() => {
20646
20728
  });
20647
20729
  }
@@ -20655,21 +20737,24 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
20655
20737
  isError: true
20656
20738
  };
20657
20739
  }
20740
+ const settleChannel = effectiveChannel;
20741
+ const settleMessageTs = effectiveMessageTs;
20742
+ const settleThreadTs = enforceBound ? binding.threadTs : channelGuard.corrected ? channelGuard.threadTs : thread_ts;
20658
20743
  const settlePendingMarker = () => {
20659
- if (!channel) return;
20660
- if (message_ts) {
20744
+ if (!settleChannel) return;
20745
+ if (settleMessageTs) {
20661
20746
  if (interim) {
20662
- markSeenSlackPendingMarkerByMessageTs2(channel, message_ts);
20663
- if (thread_ts) markSeenAllSlackPendingMarkersForThread2(channel, thread_ts);
20747
+ markSeenSlackPendingMarkerByMessageTs2(settleChannel, settleMessageTs);
20748
+ if (settleThreadTs) markSeenAllSlackPendingMarkersForThread2(settleChannel, settleThreadTs);
20664
20749
  } else {
20665
- clearSlackPendingMarkerByMessageTs2(channel, message_ts);
20666
- if (thread_ts) clearPendingMessage(channel, thread_ts);
20750
+ clearSlackPendingMarkerByMessageTs2(settleChannel, settleMessageTs);
20751
+ if (settleThreadTs) clearPendingMessage(settleChannel, settleThreadTs);
20667
20752
  }
20668
- } else if (thread_ts) {
20669
- if (interim) markSeenAllSlackPendingMarkersForThread2(channel, thread_ts);
20670
- else clearPendingMessage(channel, thread_ts);
20753
+ } else if (settleThreadTs) {
20754
+ if (interim) markSeenAllSlackPendingMarkersForThread2(settleChannel, settleThreadTs);
20755
+ else clearPendingMessage(settleChannel, settleThreadTs);
20671
20756
  } else if (!interim) {
20672
- clearOldestSlackPendingMarkerInChannel2(channel);
20757
+ clearOldestSlackPendingMarkerInChannel2(settleChannel);
20673
20758
  }
20674
20759
  };
20675
20760
  const sanitized = stripRepostPreambleWithMeta(text);
@@ -20686,7 +20771,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
20686
20771
  Authorization: `Bearer ${BOT_TOKEN}`
20687
20772
  },
20688
20773
  body: JSON.stringify({
20689
- channel,
20774
+ channel: effectiveChannel,
20690
20775
  text: apiErr.text,
20691
20776
  ...effectiveThreadTs ? { thread_ts: effectiveThreadTs } : {},
20692
20777
  ...buildAugmentedSlackMetadata() ? { metadata: buildAugmentedSlackMetadata() } : {}
@@ -20702,11 +20787,13 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
20702
20787
  };
20703
20788
  }
20704
20789
  settlePendingMarker();
20705
- recordReply(channel, throttleKey, throttleNow, throttleCfg);
20790
+ recordReply(effectiveChannel, throttleKey, throttleNow, throttleCfg);
20706
20791
  recordActivity("reply");
20707
20792
  if (THREAD_AUTO_FOLLOW !== "off") {
20708
20793
  const trackTs = effectiveThreadTs ?? data.ts ?? void 0;
20709
- rememberThread(channel, trackTs, thread_ts ? "mentioned" : "started", { botPosted: true });
20794
+ rememberThread(effectiveChannel, trackTs, thread_ts ? "mentioned" : "started", {
20795
+ botPosted: true
20796
+ });
20710
20797
  }
20711
20798
  if (interactiveHostAvailable() && data.ts) {
20712
20799
  const cfg = {
@@ -20720,7 +20807,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
20720
20807
  try {
20721
20808
  const runtime = await Promise.resolve().then(() => (init_slack_block_kit_runtime(), slack_block_kit_runtime_exports));
20722
20809
  await runtime.recordSlackDelivery(cfg, {
20723
- channel,
20810
+ channel: effectiveChannel,
20724
20811
  messageTs: tsToRecord,
20725
20812
  threadTs: threadTsToRecord
20726
20813
  });
@@ -36,7 +36,7 @@ import {
36
36
  writeDirectChatSessionState,
37
37
  writeEgressAllowlist,
38
38
  writePersistentClaudeWrapper
39
- } from "./chunk-GBVZDTCB.js";
39
+ } from "./chunk-JW6CWBNF.js";
40
40
  import "./chunk-XWVM4KPK.js";
41
41
  export {
42
42
  EGRESS_BASELINE_DOMAINS,
@@ -77,4 +77,4 @@ export {
77
77
  writeEgressAllowlist,
78
78
  writePersistentClaudeWrapper
79
79
  };
80
- //# sourceMappingURL=persistent-session-FGGXFAJH.js.map
80
+ //# sourceMappingURL=persistent-session-ZQDTWV3D.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-GBVZDTCB.js";
3
+ } from "./chunk-JW6CWBNF.js";
4
4
  import "./chunk-XWVM4KPK.js";
5
5
 
6
6
  // src/lib/responsiveness-probe.ts
@@ -418,4 +418,4 @@ export {
418
418
  readAndResetSlackReplyBindingClassifications,
419
419
  readAndResetSlackReplyTargetClassifications
420
420
  };
421
- //# sourceMappingURL=responsiveness-probe-2734PYS6.js.map
421
+ //# sourceMappingURL=responsiveness-probe-74SDDDGN.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.267",
3
+ "version": "0.28.269",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {