@integrity-labs/agt-cli 0.10.6 → 0.10.8

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.
@@ -13868,6 +13868,41 @@ var ALLOWED_USERS = new Set(
13868
13868
  (process.env.SLACK_ALLOWED_USERS ?? "").split(",").map((s) => s.trim()).filter(Boolean)
13869
13869
  );
13870
13870
  var THREAD_AUTO_FOLLOW = process.env.SLACK_THREAD_AUTO_FOLLOW ?? "off";
13871
+ var RESPONSE_TIMEOUT_MS = 12e4;
13872
+ var pendingMessages = /* @__PURE__ */ new Map();
13873
+ function trackPendingMessage(channel, threadTs, messageTs) {
13874
+ const key = `${channel}:${threadTs}:${messageTs}`;
13875
+ const timer = setTimeout(async () => {
13876
+ pendingMessages.delete(key);
13877
+ try {
13878
+ await fetch("https://slack.com/api/reactions.add", {
13879
+ method: "POST",
13880
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${BOT_TOKEN}` },
13881
+ body: JSON.stringify({ channel, timestamp: messageTs, name: "x" })
13882
+ });
13883
+ } catch {
13884
+ }
13885
+ try {
13886
+ await fetch("https://slack.com/api/reactions.remove", {
13887
+ method: "POST",
13888
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${BOT_TOKEN}` },
13889
+ body: JSON.stringify({ channel, timestamp: messageTs, name: "eyes" })
13890
+ });
13891
+ } catch {
13892
+ }
13893
+ process.stderr.write(`slack-channel: Response timeout for message ${messageTs} in ${channel}
13894
+ `);
13895
+ }, RESPONSE_TIMEOUT_MS);
13896
+ pendingMessages.set(key, timer);
13897
+ }
13898
+ function clearPendingMessage(channel, threadTs) {
13899
+ for (const [key, timer] of pendingMessages) {
13900
+ if (key.startsWith(`${channel}:${threadTs}:`)) {
13901
+ clearTimeout(timer);
13902
+ pendingMessages.delete(key);
13903
+ }
13904
+ }
13905
+ }
13871
13906
  var trackedThreads = /* @__PURE__ */ new Map();
13872
13907
  if (!BOT_TOKEN || !APP_TOKEN) {
13873
13908
  console.error(
@@ -13956,6 +13991,9 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
13956
13991
  const { name, arguments: args } = req.params;
13957
13992
  if (name === "slack.reply") {
13958
13993
  const { channel, text, thread_ts } = args;
13994
+ if (channel && thread_ts) {
13995
+ clearPendingMessage(channel, thread_ts);
13996
+ }
13959
13997
  try {
13960
13998
  const res = await fetch("https://slack.com/api/chat.postMessage", {
13961
13999
  method: "POST",
@@ -14140,6 +14178,9 @@ async function connectSocketMode() {
14140
14178
  });
14141
14179
  }
14142
14180
  const isAutoFollowed = evt.type === "message" && isThreadReply && trackedThreads.has(threadKey);
14181
+ if (channel && ts) {
14182
+ trackPendingMessage(channel, threadTs, ts);
14183
+ }
14143
14184
  await mcp.notification({
14144
14185
  method: "notifications/claude/channel",
14145
14186
  params: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.10.6",
3
+ "version": "0.10.8",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "bin": {