@integrity-labs/agt-cli 0.28.355 → 0.28.357

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.
@@ -48,7 +48,7 @@ import {
48
48
  safeWriteJsonAtomic,
49
49
  setConfigHash,
50
50
  toOpencodeModel
51
- } from "../chunk-R2D4AQGX.js";
51
+ } from "../chunk-GAWEPU6C.js";
52
52
  import {
53
53
  getProjectDir as getProjectDir2,
54
54
  getReadyTasks,
@@ -9460,7 +9460,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9460
9460
  var lastVersionCheckAt = 0;
9461
9461
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9462
9462
  var lastResponsivenessProbeAt = 0;
9463
- var agtCliVersion = true ? "0.28.355" : "dev";
9463
+ var agtCliVersion = true ? "0.28.357" : "dev";
9464
9464
  function resolveBrewPath(execFileSync2) {
9465
9465
  try {
9466
9466
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -37361,13 +37361,22 @@ function buildSlackMcpInstructions(opts) {
37361
37361
  "Address users by user_name, never raw user ID. In multi-participant threads the CURRENT speaker is on the latest <channel> tag.",
37362
37362
  `Reactions (slack.react sparingly - prefer a reply): :${ackReaction}: = ack (auto-added on inbound, don't duplicate); \u2705 = success.` + (skipReactionOn ? ` "${skipReaction}" = seen, not replying.` : "") + " NEVER react to signal failure of your work - on failure slack.reply one sentence explaining it (no stack traces/secrets). \u23F3 and \u274C are system-only; never add them.",
37363
37363
  skipReactionOn ? `Decided NOT to reply to a DM or thread message (different @-mention, side chat, auto_followed catch-up, nothing useful)? slack.react with "${skipReaction}" so the sender knows you saw it - never post "this wasn't for me". Top-level channel messages you may skip silently.` : "A thread message NOT addressed to you (different @-mention, side chat, auto_followed catch-up): SILENTLY SKIP - no reaction, no reply.",
37364
- 'auto_followed="true" \u2192 reply only if useful OR your bot user is @-mentioned. Deliver a file: save under your project dir, call slack.upload_file with path + channel + inbound_id.'
37364
+ 'auto_followed="true" \u2192 reply only if useful (self-mentions auto-cleared server-side). own_bot_user_id=your Slack user ID. File: slack.upload_file path+channel+inbound_id.'
37365
37365
  ].join(" ");
37366
37366
  }
37367
37367
 
37368
37368
  // src/slack-react-taxonomy.ts
37369
37369
  var SLACK_REACT_TOOL_DESCRIPTION = "Add an emoji reaction to a Slack message. Use sparingly \u2014 prefer a text reply. Reaction taxonomy: \u2705 = action completed successfully. \u{1F4DD} (:memo:) and \u26A0\uFE0F (:warning:) are blessed for explicit multi-state STATUS pipelines only \u2014 e.g. marking a run/parent \u2705 done / \u{1F4DD} waiting / \u26A0\uFE0F failed for at-a-glance status. That exception is narrow: never use a reaction to tell a user that YOUR reply failed \u2014 NEVER react to signal failure of your own work; on failure call slack.reply with one sentence explaining what went wrong instead (no stack traces, no secrets). \u{1F440} (eyes) is already auto-applied on inbound; do not duplicate. \u23F3 (:hourglass_flowing_sand:) is reserved for the system to mark an inbound that arrived while the agent couldn't reply \u2014 never add \u23F3 or \u274C yourself. (A \u{1F512} you may see on a thread is the server's reply-throttle marker, not a coerced reaction \u2014 slack.react passes your emoji straight through to Slack and never rewrites it to \u{1F512}.)";
37370
37370
 
37371
+ // src/slack-routed-to-note.ts
37372
+ function describeChannelRedirect(input) {
37373
+ const { requestedChannel, effectiveChannel, reason = null } = input;
37374
+ if (!requestedChannel) return null;
37375
+ if (requestedChannel === effectiveChannel) return null;
37376
+ const why = reason === "scheduled-task" ? " (routed to the scheduled task's configured destination)" : reason === "dm-channel-guard" ? " (redirected by the DM-channel guard because those coordinates belong to a DM)" : "";
37377
+ return `Heads up: this was delivered to ${effectiveChannel}, NOT the ${requestedChannel} you named${why}. routed_to=${effectiveChannel}. If ${effectiveChannel} is not where you intended this to go, the destination is misconfigured; do not assume it posted to ${requestedChannel}.`;
37378
+ }
37379
+
37371
37380
  // src/slack-reply-binding-telemetry.ts
37372
37381
  import { readFileSync as readFileSync13, writeFileSync as writeFileSync10 } from "fs";
37373
37382
  import { join as join13 } from "path";
@@ -40845,7 +40854,7 @@ async function resolveBotUserIdOrThrow() {
40845
40854
  err.authFailed = sawAuthFailure;
40846
40855
  throw err;
40847
40856
  }
40848
- var botUserId = null;
40857
+ var botUserId = (process.env.SLACK_OWN_BOT_USER_ID ?? "").trim() || null;
40849
40858
  var slackBotUserIdClient = createSlackBotUserIdClient({
40850
40859
  agtHost: AGT_HOST,
40851
40860
  agtApiKey: AGT_API_KEY,
@@ -41451,6 +41460,12 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
41451
41460
  if (hotThreadRedirected) {
41452
41461
  base += ". Note: this was threaded into the conversation you are actively working in rather than posted at the channel root. If you genuinely meant to start a NEW top-level topic, resend with to_channel_root:true.";
41453
41462
  }
41463
+ const redirectNote = describeChannelRedirect({
41464
+ requestedChannel: channel,
41465
+ effectiveChannel,
41466
+ reason: scheduledDest?.retargeted ? "scheduled-task" : channelGuard.corrected ? "dm-channel-guard" : null
41467
+ });
41468
+ if (redirectNote) base += `. ${redirectNote}`;
41454
41469
  const sentTs = typeof data.ts === "string" ? data.ts : void 0;
41455
41470
  return {
41456
41471
  content: [{ type: "text", text: sentTs ? `${base} (ts=${sentTs})` : base }]
@@ -43001,10 +43016,12 @@ async function connectSocketMode() {
43001
43016
  });
43002
43017
  }
43003
43018
  const isAutoFollowed = !isDirectMessage && evt.type === "message" && isThreadReply && !!threadKey && trackedThreads.has(threadKey);
43019
+ const isSelfMentioned = !!botUserId && text.includes(`<@${botUserId}>`);
43020
+ const effectiveIsAutoFollowed = isAutoFollowed && !isSelfMentioned;
43004
43021
  const shouldEngage = decideSlackEngagement({
43005
43022
  type: evt.type ?? "message",
43006
43023
  text,
43007
- isAutoFollowed,
43024
+ isAutoFollowed: effectiveIsAutoFollowed,
43008
43025
  botUserId
43009
43026
  });
43010
43027
  const participantEntry = threadKey ? trackedThreads.get(threadKey) : void 0;
@@ -43140,7 +43157,13 @@ ${forwarded.text}` : forwarded.text;
43140
43157
  // !shouldEngage) owes no reply. Additive only; no consumer gates on
43141
43158
  // these yet (Slice 2).
43142
43159
  ...conversationalLaneMeta(shouldEngage),
43143
- ...isAutoFollowed ? { auto_followed: "true" } : {},
43160
+ // ENG-7919: surface the effective auto-follow state (already cleared when
43161
+ // the bot was @-mentioned) so the agent sees auto_followed="true" only
43162
+ // when the message genuinely requires discretionary engagement judgment.
43163
+ // Also inject own_bot_user_id so the agent can identify self-mentions in
43164
+ // future without relying on external directory lookups.
43165
+ ...effectiveIsAutoFollowed ? { auto_followed: "true" } : {},
43166
+ ...botUserId ? { own_bot_user_id: botUserId } : {},
43144
43167
  // Only set these when we actually have attachments to avoid
43145
43168
  // bloating every notification with empty metadata.
43146
43169
  ...fileMeta.length > 0 ? { files: JSON.stringify(fileMeta) } : {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.355",
3
+ "version": "0.28.357",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {