@integrity-labs/agt-cli 0.10.2 → 0.10.3

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.
@@ -13867,6 +13867,8 @@ var APP_TOKEN = process.env.SLACK_APP_TOKEN;
13867
13867
  var ALLOWED_USERS = new Set(
13868
13868
  (process.env.SLACK_ALLOWED_USERS ?? "").split(",").map((s) => s.trim()).filter(Boolean)
13869
13869
  );
13870
+ var THREAD_AUTO_FOLLOW = process.env.SLACK_THREAD_AUTO_FOLLOW ?? "off";
13871
+ var trackedThreads = /* @__PURE__ */ new Map();
13870
13872
  if (!BOT_TOKEN || !APP_TOKEN) {
13871
13873
  console.error(
13872
13874
  "slack-channel: Missing SLACK_BOT_TOKEN or SLACK_APP_TOKEN. Cannot start."
@@ -13885,7 +13887,10 @@ var mcp = new Server(
13885
13887
  "Reply using the slack.reply tool, passing channel and thread_ts from the tag.",
13886
13888
  "For threaded replies, always include thread_ts so the response appears in the same thread.",
13887
13889
  "When someone @mentions you in a channel, respond helpfully in that thread.",
13888
- "For DMs, respond directly."
13890
+ "For DMs, respond directly.",
13891
+ "Messages with auto_followed=true are from threads you previously participated in.",
13892
+ "For auto-followed messages, use relevance judgment: only reply if you have something useful to add.",
13893
+ "Do NOT reply to every auto-followed message \u2014 skip if the conversation has moved on, the message is directed at someone else, or your input would not add value."
13889
13894
  ].join(" ")
13890
13895
  }
13891
13896
  );
@@ -13949,6 +13954,14 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
13949
13954
  isError: true
13950
13955
  };
13951
13956
  }
13957
+ if (THREAD_AUTO_FOLLOW !== "off") {
13958
+ const trackKey = thread_ts ?? data.ts ?? "";
13959
+ if (trackKey) {
13960
+ if (!trackedThreads.has(trackKey)) {
13961
+ trackedThreads.set(trackKey, thread_ts ? "mentioned" : "started");
13962
+ }
13963
+ }
13964
+ }
13952
13965
  return { content: [{ type: "text", text: "sent" }] };
13953
13966
  } catch (err) {
13954
13967
  return {
@@ -14024,7 +14037,19 @@ async function connectSocketMode() {
14024
14037
  const evt = msg.payload.event;
14025
14038
  if (evt.user === botUserId) return;
14026
14039
  if (evt.type !== "app_mention" && evt.type !== "message") return;
14027
- if (evt.type === "message" && evt.channel && !evt.channel.startsWith("D")) return;
14040
+ const isDirectMessage = evt.channel?.startsWith("D");
14041
+ const isThreadReply = !!evt.thread_ts && evt.thread_ts !== evt.ts;
14042
+ const threadKey = evt.thread_ts ?? evt.ts ?? "";
14043
+ if (evt.type === "app_mention" && threadKey) {
14044
+ trackedThreads.set(threadKey, trackedThreads.get(threadKey) ?? "mentioned");
14045
+ }
14046
+ if (evt.type === "message" && evt.channel && !isDirectMessage) {
14047
+ if (THREAD_AUTO_FOLLOW === "off") return;
14048
+ if (!isThreadReply) return;
14049
+ const threadInvolvement = trackedThreads.get(threadKey);
14050
+ if (!threadInvolvement) return;
14051
+ if (THREAD_AUTO_FOLLOW === "started" && threadInvolvement !== "started") return;
14052
+ }
14028
14053
  if (ALLOWED_USERS.size > 0 && evt.user && !ALLOWED_USERS.has(evt.user)) return;
14029
14054
  const text = evt.text ?? "";
14030
14055
  const channel = evt.channel ?? "";
@@ -14042,6 +14067,7 @@ async function connectSocketMode() {
14042
14067
  }).catch(() => {
14043
14068
  });
14044
14069
  }
14070
+ const isAutoFollowed = evt.type === "message" && isThreadReply && trackedThreads.has(threadKey);
14045
14071
  await mcp.notification({
14046
14072
  method: "notifications/claude/channel",
14047
14073
  params: {
@@ -14050,7 +14076,8 @@ async function connectSocketMode() {
14050
14076
  user,
14051
14077
  channel,
14052
14078
  thread_ts: threadTs,
14053
- event_type: evt.type
14079
+ event_type: evt.type,
14080
+ ...isAutoFollowed ? { auto_followed: true } : {}
14054
14081
  }
14055
14082
  }
14056
14083
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.10.2",
4
- "description": "Augmented CLI — agent provisioning and management",
3
+ "version": "0.10.3",
4
+ "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "agt": "./dist/bin/agt.js"