@integrity-labs/agt-cli 0.28.1134 → 0.28.1135

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.
@@ -22942,6 +22942,9 @@ function textNode(v) {
22942
22942
  }
22943
22943
  var RICH_TEXT_MAX_DEPTH = 64;
22944
22944
  function richTextToString(node, depth = 0) {
22945
+ return flattenRichText(node, depth).trim();
22946
+ }
22947
+ function flattenRichText(node, depth) {
22945
22948
  if (depth >= RICH_TEXT_MAX_DEPTH) return "[nested rich text truncated]";
22946
22949
  const rec = asRecord(node);
22947
22950
  if (!rec) return "";
@@ -22955,7 +22958,9 @@ function richTextToString(node, depth = 0) {
22955
22958
  const channelId = rec["channel_id"];
22956
22959
  if (typeof channelId === "string") parts.push(`<#${channelId}>`);
22957
22960
  const type = typeof rec["type"] === "string" ? rec["type"] : "";
22958
- const children = asArray(rec["elements"]).map((c) => richTextToString(c, depth + 1)).filter(Boolean);
22961
+ const inline = asArray(rec["elements"]).map((c) => flattenRichText(c, depth + 1)).filter(Boolean);
22962
+ const blockLevel = BLOCK_LEVEL_RICH_TEXT.has(type);
22963
+ const children = blockLevel ? inline.map((c) => c.trim()).filter(Boolean) : inline;
22959
22964
  if (children.length > 0) {
22960
22965
  if (type === "rich_text_table") parts.push(children.join("\n"));
22961
22966
  else if (type === "rich_text_table_row") parts.push(children.join(" | "));
@@ -22977,8 +22982,15 @@ ${body}
22977
22982
  ${fence}`);
22978
22983
  } else parts.push(children.join(""));
22979
22984
  }
22980
- return parts.join("").trim();
22985
+ return parts.join("");
22981
22986
  }
22987
+ var BLOCK_LEVEL_RICH_TEXT = /* @__PURE__ */ new Set([
22988
+ "rich_text_table",
22989
+ "rich_text_table_row",
22990
+ "rich_text_list",
22991
+ "rich_text_quote",
22992
+ "rich_text_preformatted"
22993
+ ]);
22982
22994
  function blockToString(block) {
22983
22995
  const b = asRecord(block);
22984
22996
  if (!b) return "";
@@ -23074,9 +23086,19 @@ function slackMessageBody(msg) {
23074
23086
  if (!rich) return top;
23075
23087
  if (!top) return rich;
23076
23088
  if (rich.startsWith(top)) return rich;
23089
+ if (!attachmentText && allRichText(msg.blocks) && sameWords(top, blockText)) return top;
23077
23090
  return `${top}
23078
23091
  ${rich}`;
23079
23092
  }
23093
+ function allRichText(blocks) {
23094
+ const list = asArray(blocks);
23095
+ return list.length > 0 && list.every((b) => asRecord(b)?.["type"] === "rich_text");
23096
+ }
23097
+ function sameWords(mrkdwn, plain) {
23098
+ const norm = (v) => v.replace(/<([^<>|]+)\|([^<>]*)>/g, "$2").replace(/<([^<>]+)>/g, "$1").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/:[a-z0-9_+'-]+:/gi, "").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "");
23099
+ const a = norm(mrkdwn);
23100
+ return a.length > 0 && a === norm(plain);
23101
+ }
23080
23102
 
23081
23103
  // ../core/dist/channels/slack-rich-text.js
23082
23104
  var MAX_DEPTH = 12;
@@ -30377,6 +30399,14 @@ function humanEditedMessage(evt) {
30377
30399
  merged["edit_ts"] = evt.ts;
30378
30400
  return merged;
30379
30401
  }
30402
+ function isOwnNormalisedEdit(normalised, raw, botUserId2) {
30403
+ return normalised !== raw && !!botUserId2 && normalised.user === botUserId2;
30404
+ }
30405
+ function isSlackBotSender(evt, botUserId2) {
30406
+ if (typeof evt.bot_id === "string" && evt.bot_id.length > 0)
30407
+ return true;
30408
+ return !!botUserId2 && evt.user === botUserId2;
30409
+ }
30380
30410
  function decideSlackMessageForward(evt, thirdPartyBots) {
30381
30411
  if (evt.type !== "message") {
30382
30412
  return { forward: true };
@@ -30587,6 +30617,8 @@ function politeDeclineCopy(reason) {
30587
30617
  }
30588
30618
  }
30589
30619
  function isSlackDeclineAddressed(input) {
30620
+ if (input.isFromBot === true)
30621
+ return false;
30590
30622
  if (input.eventType === "app_mention")
30591
30623
  return true;
30592
30624
  if (typeof input.channelId === "string" && input.channelId.startsWith("D"))
@@ -51085,6 +51117,7 @@ async function connectSocketMode() {
51085
51117
  return;
51086
51118
  }
51087
51119
  const evt = humanEditedMessage(rawEvt) ?? rawEvt;
51120
+ if (isOwnNormalisedEdit(evt, rawEvt, botUserId)) return;
51088
51121
  const dedupId = slackInboundDedupId(evt);
51089
51122
  if (dedupId && markInboundDelivered("slack", dedupId)) {
51090
51123
  const isMention = evt.type === "app_mention";
@@ -51183,7 +51216,8 @@ async function connectSocketMode() {
51183
51216
  eventType: evt.type,
51184
51217
  channelId: evt.channel,
51185
51218
  text: evt.text,
51186
- botUserId
51219
+ botUserId,
51220
+ isFromBot: isSlackBotSender(evt, botUserId)
51187
51221
  })) {
51188
51222
  await maybeSendSenderPolicyDecline({
51189
51223
  channel: evt.channel,
@@ -68,8 +68,8 @@ import {
68
68
  writeDirectChatSessionState,
69
69
  writeEgressAllowlist,
70
70
  writePersistentClaudeWrapper
71
- } from "./chunk-HHLP37ZS.js";
72
- import "./chunk-4V3XZBB4.js";
71
+ } from "./chunk-PGTZFME3.js";
72
+ import "./chunk-773ZNDNR.js";
73
73
  import "./chunk-B6UYVEMD.js";
74
74
  import "./chunk-XWVM4KPK.js";
75
75
  import "./chunk-EL5MWGGH.js";
@@ -145,4 +145,4 @@ export {
145
145
  writeEgressAllowlist,
146
146
  writePersistentClaudeWrapper
147
147
  };
148
- //# sourceMappingURL=persistent-session-MNIZPA7A.js.map
148
+ //# sourceMappingURL=persistent-session-6W6PZGNB.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-HHLP37ZS.js";
4
- import "./chunk-4V3XZBB4.js";
3
+ } from "./chunk-PGTZFME3.js";
4
+ import "./chunk-773ZNDNR.js";
5
5
  import "./chunk-B6UYVEMD.js";
6
6
  import "./chunk-XWVM4KPK.js";
7
7
  import "./chunk-EL5MWGGH.js";
@@ -802,4 +802,4 @@ export {
802
802
  readAndResetSlackReplyBindingClassifications,
803
803
  readAndResetSlackReplyTargetClassifications
804
804
  };
805
- //# sourceMappingURL=responsiveness-probe-TJDREI5P.js.map
805
+ //# sourceMappingURL=responsiveness-probe-LLYHYZR7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionTranscriptDir
3
- } from "./chunk-4V3XZBB4.js";
3
+ } from "./chunk-773ZNDNR.js";
4
4
  import "./chunk-DGUM43GV.js";
5
5
 
6
6
  // src/lib/session-auth-dead.ts
@@ -204,4 +204,4 @@ export {
204
204
  decideSessionAuthState,
205
205
  probeSessionAuth
206
206
  };
207
- //# sourceMappingURL=session-auth-dead-WO7TZ2GV.js.map
207
+ //# sourceMappingURL=session-auth-dead-QZET5C3W.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1134",
3
+ "version": "0.28.1135",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {