@lawpath-tech/openclaw 2026.2.21-31 → 2026.2.21-33

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.
Files changed (130) hide show
  1. package/dist/{agents-BP8GDc9z.js → agents-B1Ai7rsS.js} +4 -4
  2. package/dist/{agents.config-Bz7K-hIv.js → agents.config-CxHnl-lL.js} +1 -1
  3. package/dist/{agents.config-BelTNn6K.js → agents.config-DX3tDviB.js} +1 -1
  4. package/dist/{audio-preflight-DP74Yvkp.js → audio-preflight-Dp9KYMCX.js} +4 -4
  5. package/dist/{auth-choice-D1nW1tnt.js → auth-choice-CW81kzG9.js} +1 -1
  6. package/dist/{auth-choice-CBUsciQJ.js → auth-choice-DKrgElus.js} +1 -1
  7. package/dist/{banner-C18cJKYR.js → banner-B3qK6V55.js} +1 -1
  8. package/dist/build-info.json +3 -3
  9. package/dist/bundled/boot-md/handler.js +8 -8
  10. package/dist/bundled/session-memory/handler.js +8 -8
  11. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  12. package/dist/{channel-options-DUJnpe5D.js → channel-options-CvSrxm2D.js} +1 -1
  13. package/dist/{channel-options-Dh4UX17R.js → channel-options-UCu5_Nv-.js} +1 -1
  14. package/dist/{channel-web-wLJAIBDS.js → channel-web-BUJggj7Y.js} +1 -1
  15. package/dist/{channels-cli-B3GeraPZ.js → channels-cli-B5TJMyaR.js} +6 -6
  16. package/dist/{channels-cli-7lL-U0bT.js → channels-cli-CGweC0NS.js} +6 -6
  17. package/dist/{chrome-BukFhWVN.js → chrome-DAmaIuXa.js} +7 -7
  18. package/dist/{cli-BdmFE8Ie.js → cli-B1suYn5Q.js} +3 -3
  19. package/dist/{cli-C9y6JSoj.js → cli-BFVjC6gz.js} +3 -3
  20. package/dist/{command-registry-D-PJPg1t.js → command-registry-C3Cb6_lT.js} +9 -9
  21. package/dist/{completion-cli-CA5pvA6W.js → completion-cli-CiR_bu8-.js} +1 -1
  22. package/dist/{completion-cli-zfVgI7-n.js → completion-cli-D-U8-xK-.js} +2 -2
  23. package/dist/{config-cli-BPrhK0hV.js → config-cli-BOhut0nG.js} +1 -1
  24. package/dist/{config-cli-CgMtqspq.js → config-cli-CsmTCdxD.js} +1 -1
  25. package/dist/{configure-yDD4TKIJ.js → configure-B7NUZjG2.js} +3 -3
  26. package/dist/{configure-P0T5xCKn.js → configure-BWfLMNPf.js} +3 -3
  27. package/dist/{deliver-BLmoUvp-.js → deliver-BP564y6d.js} +1 -1
  28. package/dist/{doctor-completion-wNJ24zG1.js → doctor-completion-CRCM30Gd.js} +1 -1
  29. package/dist/{doctor-completion-QnB3fOSm.js → doctor-completion-GAbf1D6s.js} +1 -1
  30. package/dist/entry.js +1 -1
  31. package/dist/extensionAPI.js +3 -3
  32. package/dist/{gateway-cli-jzI2iY9a.js → gateway-cli-DGPCB6rN.js} +10 -10
  33. package/dist/{gateway-cli-abohiHMm.js → gateway-cli-QMubBYii.js} +10 -10
  34. package/dist/{health-ChDsDryb.js → health-CwpYY0fN.js} +1 -1
  35. package/dist/{health-BJ6SHHDr.js → health-DR30gLMN.js} +1 -1
  36. package/dist/{hooks-cli-BmuxgZBH.js → hooks-cli-DNwlE26g.js} +4 -4
  37. package/dist/{hooks-cli-DuRDIltL.js → hooks-cli-DlkiBMJi.js} +4 -4
  38. package/dist/{image-hH4ugSJI.js → image-DL65NdIM.js} +1 -1
  39. package/dist/index.js +8 -8
  40. package/dist/llm-slug-generator.js +8 -8
  41. package/dist/{models-BpqbY6s6.js → models-DVkqCyTw.js} +2 -2
  42. package/dist/{models-cli-COanmcGm.js → models-cli-BEkmRLcC.js} +4 -4
  43. package/dist/{models-cli-DqWWTCao.js → models-cli-DVKgOKux.js} +5 -5
  44. package/dist/{onboard-wCY6TSre.js → onboard-BS7ZSQTR.js} +2 -2
  45. package/dist/{onboard-UEtBiCoJ.js → onboard-D9z9OO_A.js} +2 -2
  46. package/dist/{onboard-channels-BJ-tZka8.js → onboard-channels-CUuKFX-y.js} +1 -1
  47. package/dist/{onboard-channels-CPma01ab.js → onboard-channels-SRbD8DVG.js} +1 -1
  48. package/dist/{onboarding-Dp6k5p-a.js → onboarding-CQRQ7bCq.js} +3 -3
  49. package/dist/{onboarding-Di4SkJUj.js → onboarding-DVBEYCod.js} +3 -3
  50. package/dist/{onboarding.finalize-G-q87JA2.js → onboarding.finalize-BRewG-HX.js} +7 -7
  51. package/dist/{onboarding.finalize-DshqLGqp.js → onboarding.finalize-CTF-nyL8.js} +8 -8
  52. package/dist/{pi-embedded-C7TfFIPO.js → pi-embedded-BqyWOcTK.js} +200 -43
  53. package/dist/{pi-embedded-helpers-DR_3fJko.js → pi-embedded-helpers-HnqhrewN.js} +4 -4
  54. package/dist/{pi-embedded-BAqpVR_m.js → pi-embedded-rXq7jDOy.js} +214 -57
  55. package/dist/{plugin-registry-CFiYBSX2.js → plugin-registry-Bp0OjK16.js} +1 -1
  56. package/dist/{plugin-registry-BdQI8-bG.js → plugin-registry-Ca9kiZbZ.js} +1 -1
  57. package/dist/plugin-sdk/{agent-scope-BjU_kuyW.js → agent-scope-KjIvGpFh.js} +19 -19
  58. package/dist/plugin-sdk/{channel-web-DtyyUoWA.js → channel-web-i7Q0e2xL.js} +1 -1
  59. package/dist/plugin-sdk/index.js +4 -4
  60. package/dist/plugin-sdk/{manager-BBcNMx7F.js → manager-DeHKg0Ym.js} +28 -28
  61. package/dist/plugin-sdk/memory-host-search.js +4 -4
  62. package/dist/plugin-sdk/{qmd-manager-B5NFEjJd.js → qmd-manager-Ci6Ood2P.js} +2 -2
  63. package/dist/plugin-sdk/{replies-OoosoUz9.js → replies-CvKNemz4.js} +5 -4
  64. package/dist/plugin-sdk/{reply-C_4ajFUt.js → reply-CrBuiTf0.js} +200 -43
  65. package/dist/plugin-sdk/{send-C9Q83PfF.js → send-DzgvnkSq.js} +20 -1
  66. package/dist/plugin-sdk/slack/monitor/events/channels.d.ts +1 -0
  67. package/dist/plugin-sdk/slack/monitor/events/members.d.ts +1 -0
  68. package/dist/plugin-sdk/slack/monitor/events/pins.d.ts +1 -0
  69. package/dist/plugin-sdk/slack/monitor/events/reactions.d.ts +1 -0
  70. package/dist/plugin-sdk/slack/monitor/events.d.ts +2 -0
  71. package/dist/plugin-sdk/slack/monitor/message-handler.d.ts +2 -0
  72. package/dist/plugin-sdk/slack/monitor/provider.d.ts +6 -0
  73. package/dist/plugin-sdk/slack/monitor/replies.d.ts +2 -0
  74. package/dist/plugin-sdk/slack/monitor/types.d.ts +4 -0
  75. package/dist/plugin-sdk/slack/threading.d.ts +9 -0
  76. package/dist/plugin-sdk/{sqlite-CH_AglGD.js → sqlite-CcSeRdqy.js} +15 -15
  77. package/dist/plugin-sdk/{web-BlY2wNrk.js → web-DXbKqGiu.js} +4 -4
  78. package/dist/{plugins-cli-CmrER-zr.js → plugins-cli-B54I3YDp.js} +4 -4
  79. package/dist/{plugins-cli-B03aSLgf.js → plugins-cli-DQqPpkDg.js} +4 -4
  80. package/dist/{program-Djk08-l7.js → program-CiVPUyGe.js} +9 -9
  81. package/dist/{program-context-DlRS1tcr.js → program-context-B8jVIvqn.js} +17 -17
  82. package/dist/{prompt-select-styled-CMszn2hx.js → prompt-select-styled-DP6ORKEH.js} +4 -4
  83. package/dist/{prompt-select-styled-JkMJPt68.js → prompt-select-styled-XJNDuVI-.js} +4 -4
  84. package/dist/{provider-auth-helpers-36LOZ6SL.js → provider-auth-helpers-BvdnFgmZ.js} +1 -1
  85. package/dist/{provider-auth-helpers-ZV7-WRyR.js → provider-auth-helpers-GlPRMdgU.js} +1 -1
  86. package/dist/{push-apns-Cm-ZTdUp.js → push-apns-4PMWZHdd.js} +1 -1
  87. package/dist/{push-apns-TUUEPpx1.js → push-apns-BLl8QvkS.js} +1 -1
  88. package/dist/{pw-ai-Dp9c5KD_.js → pw-ai-BLLeU82T.js} +1 -1
  89. package/dist/{register.agent-DsFrb0R7.js → register.agent-DMDB7XFY.js} +8 -8
  90. package/dist/{register.agent-7Pku8mId.js → register.agent-O8MfanIY.js} +7 -7
  91. package/dist/{register.configure-BMfcA9Sh.js → register.configure-BnK5Jcux.js} +8 -8
  92. package/dist/{register.configure-CJ6IYgGS.js → register.configure-z-iZ8GQq.js} +8 -8
  93. package/dist/{register.maintenance-DfoSO5fo.js → register.maintenance-BnFA8dD9.js} +9 -9
  94. package/dist/{register.maintenance-BFSQHBgH.js → register.maintenance-DSLAHGdZ.js} +10 -10
  95. package/dist/{register.message-BTCpZ8RW.js → register.message-BEBbZm3E.js} +4 -4
  96. package/dist/{register.message-C-5P7V4g.js → register.message-Diwl2TLo.js} +4 -4
  97. package/dist/{register.onboard-CVXaGmEF.js → register.onboard-Bc4G3TMS.js} +6 -6
  98. package/dist/{register.onboard-CTO-qkWZ.js → register.onboard-gF_aeZ9o.js} +6 -6
  99. package/dist/{register.setup-Dg1Ud7ox.js → register.setup-B4r3oTHQ.js} +6 -6
  100. package/dist/{register.setup-BzaCK19n.js → register.setup-CdWPBfRb.js} +6 -6
  101. package/dist/{register.status-health-sessions-IymXWaoK.js → register.status-health-sessions-gEelqg9y.js} +5 -5
  102. package/dist/{register.status-health-sessions-DjwY1WQe.js → register.status-health-sessions-gHKOUBxw.js} +5 -5
  103. package/dist/{register.subclis-Bw1N3fIn.js → register.subclis-DflQa27k.js} +9 -9
  104. package/dist/{replies-MVPArv-r.js → replies-9ipbTXMP.js} +5 -4
  105. package/dist/{replies-DtFxhHfI.js → replies-BCd0AxfK.js} +5 -4
  106. package/dist/{replies-DKKNtkun.js → replies-BdkHHO5V.js} +5 -4
  107. package/dist/{replies-DhmTgroV.js → replies-CSjH2EQ6.js} +5 -4
  108. package/dist/{reply-pTxrsMtG.js → reply-CM9fxt2r.js} +200 -43
  109. package/dist/{run-main-DnYUey0K.js → run-main-3miuYYBs.js} +16 -16
  110. package/dist/{runner-CLY-9j7g.js → runner-CcRtHLpd.js} +1 -1
  111. package/dist/{send-CTGeWUSD.js → send-B3u53ZAu.js} +20 -1
  112. package/dist/{send-Cr8R-bMi.js → send-CAuzoyQe.js} +20 -1
  113. package/dist/{send-D_FU_HIa.js → send-D6r6s6Nf.js} +20 -1
  114. package/dist/{send-CKGUBMnM.js → send-DUc9Jw32.js} +20 -1
  115. package/dist/{server-node-events-Dhbdspn_.js → server-node-events-BcfA38Ht.js} +4 -4
  116. package/dist/{server-node-events-DQYNf8b_.js → server-node-events-DzAfZuLY.js} +4 -4
  117. package/dist/{session-dirs-CFHymbM9.js → session-dirs-BdEl6HTu.js} +1 -1
  118. package/dist/{session-dirs-DoK1aPxY.js → session-dirs-BeIjLerM.js} +1 -1
  119. package/dist/{status-D32_SxwC.js → status-B0MQkmRx.js} +2 -2
  120. package/dist/{status-CFnZ8E56.js → status-CgApQy5C.js} +1 -1
  121. package/dist/{status-C-PQHlxh.js → status-DpOLEQn-.js} +1 -1
  122. package/dist/{status-KRRAxPjg.js → status-dZ2UgRzN.js} +2 -2
  123. package/dist/{subagent-registry-DkjybHrK.js → subagent-registry-CEyaZMV5.js} +200 -43
  124. package/dist/{update-cli-DXd4fNuS.js → update-cli-COdYp-Y5.js} +10 -10
  125. package/dist/{update-cli-DMrRvy-m.js → update-cli-Y2wT8mXS.js} +9 -9
  126. package/dist/{web-Dsgry4ji.js → web-CQ4AF_Y7.js} +3 -3
  127. package/dist/{web-CCqlC0N_.js → web-Cp6O0VTJ.js} +4 -4
  128. package/dist/{web-IfDcZx01.js → web-D8FEwRAX.js} +3 -3
  129. package/dist/{web-DCNwbuhj.js → web-c0XVFCZq.js} +8 -8
  130. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
2
  import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-BQcb3NZa.js";
3
- import { r as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-D_FU_HIa.js";
3
+ import { i as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-D6r6s6Nf.js";
4
4
  import { i as chunkMarkdownTextWithMode } from "./chunk-D6AoZjLE.js";
5
5
 
6
6
  //#region src/auto-reply/reply/reply-reference.ts
@@ -43,7 +43,7 @@ var replies_exports = /* @__PURE__ */ __exportAll({
43
43
  });
44
44
  async function deliverReplies(params) {
45
45
  for (const payload of params.replies) {
46
- const threadTs = payload.replyToId ?? params.replyThreadTs;
46
+ const threadTs = (params.replyToMode === "off" ? void 0 : payload.replyToId) ?? params.replyThreadTs;
47
47
  const mediaList = payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []);
48
48
  const text = payload.text ?? "";
49
49
  if (!text && mediaList.length === 0) continue;
@@ -87,7 +87,7 @@ function resolveSlackThreadTs(params) {
87
87
  }
88
88
  function createSlackReplyReferencePlanner(params) {
89
89
  return createReplyReferencePlanner({
90
- replyToMode: params.incomingThreadTs ? "all" : params.replyToMode,
90
+ replyToMode: params.isThreadReply ? "all" : params.replyToMode,
91
91
  existingId: params.incomingThreadTs,
92
92
  startId: params.messageTs,
93
93
  hasReplied: params.hasReplied
@@ -98,7 +98,8 @@ function createSlackReplyDeliveryPlan(params) {
98
98
  replyToMode: params.replyToMode,
99
99
  incomingThreadTs: params.incomingThreadTs,
100
100
  messageTs: params.messageTs,
101
- hasReplied: params.hasRepliedRef.value
101
+ hasReplied: params.hasRepliedRef.value,
102
+ isThreadReply: params.isThreadReply
102
103
  });
103
104
  return {
104
105
  nextThreadTs: () => replyReference.use(),
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
2
  import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-HGSJ1Ptu.js";
3
- import { r as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-CTGeWUSD.js";
3
+ import { i as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-B3u53ZAu.js";
4
4
  import { i as chunkMarkdownTextWithMode } from "./chunk-D5Env9VX.js";
5
5
 
6
6
  //#region src/auto-reply/reply/reply-reference.ts
@@ -43,7 +43,7 @@ var replies_exports = /* @__PURE__ */ __exportAll({
43
43
  });
44
44
  async function deliverReplies(params) {
45
45
  for (const payload of params.replies) {
46
- const threadTs = payload.replyToId ?? params.replyThreadTs;
46
+ const threadTs = (params.replyToMode === "off" ? void 0 : payload.replyToId) ?? params.replyThreadTs;
47
47
  const mediaList = payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []);
48
48
  const text = payload.text ?? "";
49
49
  if (!text && mediaList.length === 0) continue;
@@ -87,7 +87,7 @@ function resolveSlackThreadTs(params) {
87
87
  }
88
88
  function createSlackReplyReferencePlanner(params) {
89
89
  return createReplyReferencePlanner({
90
- replyToMode: params.incomingThreadTs ? "all" : params.replyToMode,
90
+ replyToMode: params.isThreadReply ? "all" : params.replyToMode,
91
91
  existingId: params.incomingThreadTs,
92
92
  startId: params.messageTs,
93
93
  hasReplied: params.hasReplied
@@ -98,7 +98,8 @@ function createSlackReplyDeliveryPlan(params) {
98
98
  replyToMode: params.replyToMode,
99
99
  incomingThreadTs: params.incomingThreadTs,
100
100
  messageTs: params.messageTs,
101
- hasReplied: params.hasRepliedRef.value
101
+ hasReplied: params.hasRepliedRef.value,
102
+ isThreadReply: params.isThreadReply
102
103
  });
103
104
  return {
104
105
  nextThreadTs: () => replyReference.use(),
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
- import { r as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-CKGUBMnM.js";
2
+ import { i as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-DUc9Jw32.js";
3
3
  import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-BDil8-Uk.js";
4
4
  import { i as chunkMarkdownTextWithMode } from "./chunk-ZFvwZqoJ.js";
5
5
 
@@ -43,7 +43,7 @@ var replies_exports = /* @__PURE__ */ __exportAll({
43
43
  });
44
44
  async function deliverReplies(params) {
45
45
  for (const payload of params.replies) {
46
- const threadTs = payload.replyToId ?? params.replyThreadTs;
46
+ const threadTs = (params.replyToMode === "off" ? void 0 : payload.replyToId) ?? params.replyThreadTs;
47
47
  const mediaList = payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []);
48
48
  const text = payload.text ?? "";
49
49
  if (!text && mediaList.length === 0) continue;
@@ -87,7 +87,7 @@ function resolveSlackThreadTs(params) {
87
87
  }
88
88
  function createSlackReplyReferencePlanner(params) {
89
89
  return createReplyReferencePlanner({
90
- replyToMode: params.incomingThreadTs ? "all" : params.replyToMode,
90
+ replyToMode: params.isThreadReply ? "all" : params.replyToMode,
91
91
  existingId: params.incomingThreadTs,
92
92
  startId: params.messageTs,
93
93
  hasReplied: params.hasReplied
@@ -98,7 +98,8 @@ function createSlackReplyDeliveryPlan(params) {
98
98
  replyToMode: params.replyToMode,
99
99
  incomingThreadTs: params.incomingThreadTs,
100
100
  messageTs: params.messageTs,
101
- hasReplied: params.hasRepliedRef.value
101
+ hasReplied: params.hasRepliedRef.value,
102
+ isThreadReply: params.isThreadReply
102
103
  });
103
104
  return {
104
105
  nextThreadTs: () => replyReference.use(),
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
2
  import { i as isSilentReplyText, n as SILENT_REPLY_TOKEN } from "./tokens-CYCsLJQz.js";
3
- import { r as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-Cr8R-bMi.js";
3
+ import { i as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-CAuzoyQe.js";
4
4
  import { i as chunkMarkdownTextWithMode } from "./chunk-3g44i8OM.js";
5
5
 
6
6
  //#region src/auto-reply/reply/reply-reference.ts
@@ -43,7 +43,7 @@ var replies_exports = /* @__PURE__ */ __exportAll({
43
43
  });
44
44
  async function deliverReplies(params) {
45
45
  for (const payload of params.replies) {
46
- const threadTs = payload.replyToId ?? params.replyThreadTs;
46
+ const threadTs = (params.replyToMode === "off" ? void 0 : payload.replyToId) ?? params.replyThreadTs;
47
47
  const mediaList = payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []);
48
48
  const text = payload.text ?? "";
49
49
  if (!text && mediaList.length === 0) continue;
@@ -87,7 +87,7 @@ function resolveSlackThreadTs(params) {
87
87
  }
88
88
  function createSlackReplyReferencePlanner(params) {
89
89
  return createReplyReferencePlanner({
90
- replyToMode: params.incomingThreadTs ? "all" : params.replyToMode,
90
+ replyToMode: params.isThreadReply ? "all" : params.replyToMode,
91
91
  existingId: params.incomingThreadTs,
92
92
  startId: params.messageTs,
93
93
  hasReplied: params.hasReplied
@@ -98,7 +98,8 @@ function createSlackReplyDeliveryPlan(params) {
98
98
  replyToMode: params.replyToMode,
99
99
  incomingThreadTs: params.incomingThreadTs,
100
100
  messageTs: params.messageTs,
101
- hasReplied: params.hasRepliedRef.value
101
+ hasReplied: params.hasRepliedRef.value,
102
+ isThreadReply: params.isThreadReply
102
103
  });
103
104
  return {
104
105
  nextThreadTs: () => replyReference.use(),
@@ -41,7 +41,7 @@ import { _ as listEnabledDiscordAccounts, a as isWhatsAppGroupJid, c as listEnab
41
41
  import { a as logWebSelfId, i as getWebAuthAgeMs, m as webAuthExists, n as resolveWhatsAppAccount, o as logoutWeb, u as readWebSelfId } from "./accounts-CGBT0wQ4.js";
42
42
  import { t as resolveIMessageAccount } from "./accounts-BQX482gP.js";
43
43
  import { n as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-CAR30ERb.js";
44
- import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, i as createSlackWebClient, l as parseSlackTarget, o as parseSlackBlocksInput, s as validateSlackBlocksArray, t as sendMessageSlack, u as resolveSlackChannelId } from "./send-CKGUBMnM.js";
44
+ import { a as createSlackWebClient, c as validateSlackBlocksArray, d as resolveSlackChannelId, l as buildSlackBlocksFallbackText, o as resolveSlackWebClientOptions, r as markdownToSlackMrkdwn, s as parseSlackBlocksInput, t as sendMessageSlack, u as parseSlackTarget } from "./send-DUc9Jw32.js";
45
45
  import { c as resolveStorePath, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, r as resolveSessionFilePathOptions, t as resolveDefaultSessionStorePath } from "./paths-C6eomcf_.js";
46
46
  import { i as normalizeInputProvenance, n as applyInputProvenanceToUserMessage, r as hasInterSessionUserProvenance } from "./input-provenance-BzbXHcaD.js";
47
47
  import { t as emitSessionTranscriptUpdate } from "./transcript-events-DdnTeoR1.js";
@@ -81,7 +81,7 @@ import { i as readChannelAllowFromStore, l as listPairingChannels, o as removeCh
81
81
  import { t as makeProxyFetch } from "./proxy-DU7W9XSc.js";
82
82
  import { i as formatDurationSeconds, r as formatDurationPrecise, t as formatDurationCompact$1 } from "./format-duration-D0B0Uo-I.js";
83
83
  import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-DuqgZ7wS.js";
84
- import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-DKKNtkun.js";
84
+ import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-BdkHHO5V.js";
85
85
  import { b as ensureSkillsWatcher, i as resolveSkillCommandInvocation, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, r as listSkillCommandsForWorkspace, t as listReservedChatSlashCommandNames, x as getSkillsSnapshotVersion } from "./skill-commands-VCmL7mMC.js";
86
86
  import { c as hasNonzeroUsage, l as normalizeUsage, n as loadCostUsageSummary, o as derivePromptTokens, r as loadSessionCostSummary, s as deriveSessionTotalTokens } from "./session-cost-usage-CNxpZ3DJ.js";
87
87
  import { a as normalizeIMessageHandle, c as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, i as isAllowedIMessageSender, o as parseIMessageTarget, r as formatIMessageChatTarget, s as createIMessageRpcClient, t as sendMessageIMessage } from "./send-H5TFGeHl.js";
@@ -22376,7 +22376,7 @@ async function runWithImageModelFallback(params) {
22376
22376
  function createDefaultDeps() {
22377
22377
  return {
22378
22378
  sendMessageWhatsApp: async (...args) => {
22379
- const { sendMessageWhatsApp } = await import("./web-CCqlC0N_.js");
22379
+ const { sendMessageWhatsApp } = await import("./web-Cp6O0VTJ.js");
22380
22380
  return await sendMessageWhatsApp(...args);
22381
22381
  },
22382
22382
  sendMessageTelegram: async (...args) => {
@@ -22388,7 +22388,7 @@ function createDefaultDeps() {
22388
22388
  return await sendMessageDiscord(...args);
22389
22389
  },
22390
22390
  sendMessageSlack: async (...args) => {
22391
- const { sendMessageSlack } = await import("./send-CKGUBMnM.js").then((n) => n.n);
22391
+ const { sendMessageSlack } = await import("./send-DUc9Jw32.js").then((n) => n.n);
22392
22392
  return await sendMessageSlack(...args);
22393
22393
  },
22394
22394
  sendMessageSignal: async (...args) => {
@@ -31037,8 +31037,12 @@ function inferSlackChannelType(channelId) {
31037
31037
  }
31038
31038
  function normalizeSlackChannelType(channelType, channelId) {
31039
31039
  const normalized = channelType?.trim().toLowerCase();
31040
- if (normalized === "im" || normalized === "mpim" || normalized === "channel" || normalized === "group") return normalized;
31041
- return inferSlackChannelType(channelId) ?? "channel";
31040
+ const inferred = inferSlackChannelType(channelId);
31041
+ if (normalized === "im" || normalized === "mpim" || normalized === "channel" || normalized === "group") {
31042
+ if (inferred === "im" && normalized !== "im") return "im";
31043
+ return normalized;
31044
+ }
31045
+ return inferred ?? "channel";
31042
31046
  }
31043
31047
  function createSlackMonitorContext(params) {
31044
31048
  const channelHistories = /* @__PURE__ */ new Map();
@@ -31322,7 +31326,7 @@ function migrateSlackChannelConfig(params) {
31322
31326
  //#endregion
31323
31327
  //#region src/slack/monitor/events/channels.ts
31324
31328
  function registerSlackChannelEvents(params) {
31325
- const { ctx } = params;
31329
+ const { ctx, trackEvent } = params;
31326
31330
  const enqueueChannelSystemEvent = (params) => {
31327
31331
  if (!ctx.isChannelAllowed({
31328
31332
  channelId: params.channelId,
@@ -31345,6 +31349,7 @@ function registerSlackChannelEvents(params) {
31345
31349
  ctx.app.event("channel_created", async ({ event, body }) => {
31346
31350
  try {
31347
31351
  if (ctx.shouldDropMismatchedSlackEvent(body)) return;
31352
+ trackEvent?.();
31348
31353
  const payload = event;
31349
31354
  const channelId = payload.channel?.id;
31350
31355
  const channelName = payload.channel?.name;
@@ -31360,6 +31365,7 @@ function registerSlackChannelEvents(params) {
31360
31365
  ctx.app.event("channel_rename", async ({ event, body }) => {
31361
31366
  try {
31362
31367
  if (ctx.shouldDropMismatchedSlackEvent(body)) return;
31368
+ trackEvent?.();
31363
31369
  const payload = event;
31364
31370
  const channelId = payload.channel?.id;
31365
31371
  enqueueChannelSystemEvent({
@@ -31374,6 +31380,7 @@ function registerSlackChannelEvents(params) {
31374
31380
  ctx.app.event("channel_id_changed", async ({ event, body }) => {
31375
31381
  try {
31376
31382
  if (ctx.shouldDropMismatchedSlackEvent(body)) return;
31383
+ trackEvent?.();
31377
31384
  const payload = event;
31378
31385
  const oldChannelId = payload.old_channel_id;
31379
31386
  const newChannelId = payload.new_channel_id;
@@ -31779,10 +31786,11 @@ function registerSlackInteractionEvents(params) {
31779
31786
  //#endregion
31780
31787
  //#region src/slack/monitor/events/members.ts
31781
31788
  function registerSlackMemberEvents(params) {
31782
- const { ctx } = params;
31789
+ const { ctx, trackEvent } = params;
31783
31790
  const handleMemberChannelEvent = async (params) => {
31784
31791
  try {
31785
31792
  if (ctx.shouldDropMismatchedSlackEvent(params.body)) return;
31793
+ trackEvent?.();
31786
31794
  const payload = params.event;
31787
31795
  const channelId = payload.channel;
31788
31796
  const channelInfo = channelId ? await ctx.resolveChannelName(channelId) : {};
@@ -31918,9 +31926,10 @@ function registerSlackMessageEvents(params) {
31918
31926
  //#endregion
31919
31927
  //#region src/slack/monitor/events/pins.ts
31920
31928
  async function handleSlackPinEvent(params) {
31921
- const { ctx, body, event, action, contextKeySuffix, errorLabel } = params;
31929
+ const { ctx, trackEvent, body, event, action, contextKeySuffix, errorLabel } = params;
31922
31930
  try {
31923
31931
  if (ctx.shouldDropMismatchedSlackEvent(body)) return;
31932
+ trackEvent?.();
31924
31933
  const payload = event;
31925
31934
  const channelId = payload.channel_id;
31926
31935
  const channelInfo = channelId ? await ctx.resolveChannelName(channelId) : {};
@@ -31949,10 +31958,11 @@ async function handleSlackPinEvent(params) {
31949
31958
  }
31950
31959
  }
31951
31960
  function registerSlackPinEvents(params) {
31952
- const { ctx } = params;
31961
+ const { ctx, trackEvent } = params;
31953
31962
  ctx.app.event("pin_added", async ({ event, body }) => {
31954
31963
  await handleSlackPinEvent({
31955
31964
  ctx,
31965
+ trackEvent,
31956
31966
  body,
31957
31967
  event,
31958
31968
  action: "pinned",
@@ -31963,6 +31973,7 @@ function registerSlackPinEvents(params) {
31963
31973
  ctx.app.event("pin_removed", async ({ event, body }) => {
31964
31974
  await handleSlackPinEvent({
31965
31975
  ctx,
31976
+ trackEvent,
31966
31977
  body,
31967
31978
  event,
31968
31979
  action: "unpinned",
@@ -31975,11 +31986,12 @@ function registerSlackPinEvents(params) {
31975
31986
  //#endregion
31976
31987
  //#region src/slack/monitor/events/reactions.ts
31977
31988
  function registerSlackReactionEvents(params) {
31978
- const { ctx } = params;
31989
+ const { ctx, trackEvent } = params;
31979
31990
  const handleReactionEvent = async (event, action) => {
31980
31991
  try {
31981
31992
  const item = event.item;
31982
31993
  if (!item || item.type !== "message") return;
31994
+ trackEvent?.();
31983
31995
  const channelInfo = item.channel ? await ctx.resolveChannelName(item.channel) : {};
31984
31996
  const channelType = channelInfo?.type;
31985
31997
  if (!ctx.isChannelAllowed({
@@ -32023,10 +32035,22 @@ function registerSlackMonitorEvents(params) {
32023
32035
  ctx: params.ctx,
32024
32036
  handleSlackMessage: params.handleSlackMessage
32025
32037
  });
32026
- registerSlackReactionEvents({ ctx: params.ctx });
32027
- registerSlackMemberEvents({ ctx: params.ctx });
32028
- registerSlackChannelEvents({ ctx: params.ctx });
32029
- registerSlackPinEvents({ ctx: params.ctx });
32038
+ registerSlackReactionEvents({
32039
+ ctx: params.ctx,
32040
+ trackEvent: params.trackEvent
32041
+ });
32042
+ registerSlackMemberEvents({
32043
+ ctx: params.ctx,
32044
+ trackEvent: params.trackEvent
32045
+ });
32046
+ registerSlackChannelEvents({
32047
+ ctx: params.ctx,
32048
+ trackEvent: params.trackEvent
32049
+ });
32050
+ registerSlackPinEvents({
32051
+ ctx: params.ctx,
32052
+ trackEvent: params.trackEvent
32053
+ });
32030
32054
  registerSlackInteractionEvents({ ctx: params.ctx });
32031
32055
  }
32032
32056
 
@@ -32199,7 +32223,7 @@ async function startSlackStream(params) {
32199
32223
  stopped: false
32200
32224
  };
32201
32225
  if (text) {
32202
- await streamer.append({ markdown_text: text });
32226
+ await streamer.append({ markdown_text: markdownToSlackMrkdwn(text) });
32203
32227
  logVerbose(`slack-stream: appended initial text (${text.length} chars)`);
32204
32228
  }
32205
32229
  return session;
@@ -32214,7 +32238,7 @@ async function appendSlackStream(params) {
32214
32238
  return;
32215
32239
  }
32216
32240
  if (!text) return;
32217
- await session.streamer.append({ markdown_text: text });
32241
+ await session.streamer.append({ markdown_text: markdownToSlackMrkdwn(text) });
32218
32242
  logVerbose(`slack-stream: appended ${text.length} chars`);
32219
32243
  }
32220
32244
  /**
@@ -32231,7 +32255,7 @@ async function stopSlackStream(params) {
32231
32255
  }
32232
32256
  session.stopped = true;
32233
32257
  logVerbose(`slack-stream: stopping stream in ${session.channel} thread=${session.threadTs}${text ? ` (final text: ${text.length} chars)` : ""}`);
32234
- await session.streamer.stop(text ? { markdown_text: text } : void 0);
32258
+ await session.streamer.stop(text ? { markdown_text: markdownToSlackMrkdwn(text) } : void 0);
32235
32259
  logVerbose("slack-stream: stream stopped");
32236
32260
  }
32237
32261
 
@@ -32250,12 +32274,21 @@ function resolveSlackThreadContext(params) {
32250
32274
  messageThreadId: isThreadReply ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
32251
32275
  };
32252
32276
  }
32277
+ /**
32278
+ * Resolves Slack thread targeting for replies and status indicators.
32279
+ *
32280
+ * @returns replyThreadTs - Thread timestamp for reply messages
32281
+ * @returns statusThreadTs - Thread timestamp for status indicators (typing, etc.)
32282
+ * @returns isThreadReply - true if this is a genuine user reply in a thread,
32283
+ * false if thread_ts comes from a bot status message
32284
+ */
32253
32285
  function resolveSlackThreadTargets(params) {
32254
- const { incomingThreadTs, messageTs } = resolveSlackThreadContext(params);
32255
- const replyThreadTs = incomingThreadTs ?? (params.replyToMode === "all" ? messageTs : void 0);
32286
+ const { incomingThreadTs, messageTs, isThreadReply } = resolveSlackThreadContext(params);
32287
+ const replyThreadTs = isThreadReply ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0;
32256
32288
  return {
32257
32289
  replyThreadTs,
32258
- statusThreadTs: replyThreadTs ?? messageTs
32290
+ statusThreadTs: replyThreadTs ?? messageTs,
32291
+ isThreadReply
32259
32292
  };
32260
32293
  }
32261
32294
 
@@ -32295,12 +32328,13 @@ async function dispatchPreparedSlackMessage(prepared) {
32295
32328
  deliveryContext: {
32296
32329
  channel: "slack",
32297
32330
  to: `user:${message.user}`,
32298
- accountId: route.accountId
32331
+ accountId: route.accountId,
32332
+ threadId: prepared.ctxPayload.MessageThreadId
32299
32333
  },
32300
32334
  ctx: prepared.ctxPayload
32301
32335
  });
32302
32336
  }
32303
- const { statusThreadTs } = resolveSlackThreadTargets({
32337
+ const { statusThreadTs, isThreadReply } = resolveSlackThreadTargets({
32304
32338
  message,
32305
32339
  replyToMode: ctx.replyToMode
32306
32340
  });
@@ -32312,7 +32346,8 @@ async function dispatchPreparedSlackMessage(prepared) {
32312
32346
  replyToMode: ctx.replyToMode,
32313
32347
  incomingThreadTs,
32314
32348
  messageTs,
32315
- hasRepliedRef
32349
+ hasRepliedRef,
32350
+ isThreadReply
32316
32351
  });
32317
32352
  const typingTarget = statusThreadTs ? `${message.channel}/${statusThreadTs}` : message.channel;
32318
32353
  const typingCallbacks = createTypingCallbacks({
@@ -32377,7 +32412,8 @@ async function dispatchPreparedSlackMessage(prepared) {
32377
32412
  accountId: account.accountId,
32378
32413
  runtime,
32379
32414
  textLimit: ctx.textLimit,
32380
- replyThreadTs
32415
+ replyThreadTs,
32416
+ replyToMode: ctx.replyToMode
32381
32417
  });
32382
32418
  replyPlan.markSent();
32383
32419
  };
@@ -32438,7 +32474,7 @@ async function dispatchPreparedSlackMessage(prepared) {
32438
32474
  token: ctx.botToken,
32439
32475
  channel: draftChannelId,
32440
32476
  ts: draftMessageId,
32441
- text: finalText.trim()
32477
+ text: markdownToSlackMrkdwn(finalText.trim())
32442
32478
  });
32443
32479
  return;
32444
32480
  } catch (err) {
@@ -32468,7 +32504,8 @@ async function dispatchPreparedSlackMessage(prepared) {
32468
32504
  accountId: account.accountId,
32469
32505
  runtime,
32470
32506
  textLimit: ctx.textLimit,
32471
- replyThreadTs
32507
+ replyThreadTs,
32508
+ replyToMode: ctx.replyToMode
32472
32509
  });
32473
32510
  replyPlan.markSent();
32474
32511
  },
@@ -32477,7 +32514,8 @@ async function dispatchPreparedSlackMessage(prepared) {
32477
32514
  typingCallbacks.onIdle?.();
32478
32515
  },
32479
32516
  onReplyStart: typingCallbacks.onReplyStart,
32480
- onIdle: typingCallbacks.onIdle
32517
+ onIdle: typingCallbacks.onIdle,
32518
+ onCleanup: typingCallbacks.onCleanup
32481
32519
  });
32482
32520
  const draftStream = createSlackDraftStream({
32483
32521
  target: prepared.replyTarget,
@@ -33118,10 +33156,13 @@ async function prepareSlackMessage(params) {
33118
33156
  const mergedMedia = [...media ?? [], ...attachmentContent?.media ?? []];
33119
33157
  const effectiveDirectMedia = mergedMedia.length > 0 ? mergedMedia : null;
33120
33158
  const mediaPlaceholder = effectiveDirectMedia ? effectiveDirectMedia.map((m) => m.placeholder).join(" ") : void 0;
33159
+ const fileOnlyFallback = !mediaPlaceholder && (message.files?.length ?? 0) > 0 ? message.files.slice(0, 5).map((f) => f.name ?? "file").join(", ") : void 0;
33160
+ const fileOnlyPlaceholder = fileOnlyFallback ? `[Slack file: ${fileOnlyFallback}]` : void 0;
33121
33161
  const rawBody = [
33122
33162
  (message.text ?? "").trim(),
33123
33163
  attachmentContent?.text,
33124
- mediaPlaceholder
33164
+ mediaPlaceholder,
33165
+ fileOnlyPlaceholder
33125
33166
  ].filter(Boolean).join("\n") || "";
33126
33167
  if (!rawBody) return null;
33127
33168
  const ackReaction = resolveAckReaction(cfg, route.agentId, {
@@ -33296,7 +33337,7 @@ async function prepareSlackMessage(params) {
33296
33337
  ReplyToId: threadContext.replyToId,
33297
33338
  MessageThreadId: threadContext.messageThreadId,
33298
33339
  ParentSessionKey: threadKeys.parentSessionKey,
33299
- ThreadStarterBody: threadStarterBody,
33340
+ ThreadStarterBody: !threadSessionPreviousTimestamp ? threadStarterBody : void 0,
33300
33341
  ThreadHistoryBody: threadHistoryBody,
33301
33342
  IsFirstThreadTurn: isThreadReply && threadTs && !threadSessionPreviousTimestamp ? true : void 0,
33302
33343
  ThreadLabel: threadLabel,
@@ -33320,7 +33361,8 @@ async function prepareSlackMessage(params) {
33320
33361
  sessionKey: route.mainSessionKey,
33321
33362
  channel: "slack",
33322
33363
  to: `user:${message.user}`,
33323
- accountId: route.accountId
33364
+ accountId: route.accountId,
33365
+ threadId: threadContext.messageThreadId
33324
33366
  } : void 0,
33325
33367
  onRecordError: (err) => {
33326
33368
  ctx.logger.warn({
@@ -33447,7 +33489,7 @@ function buildSeenMessageKey(channelId, ts) {
33447
33489
  return `${channelId}:${ts}`;
33448
33490
  }
33449
33491
  function createSlackMessageHandler(params) {
33450
- const { ctx, account } = params;
33492
+ const { ctx, account, trackEvent } = params;
33451
33493
  const debounceMs = resolveInboundDebounceMs({
33452
33494
  cfg: ctx.cfg,
33453
33495
  channel: "slack"
@@ -33537,6 +33579,7 @@ function createSlackMessageHandler(params) {
33537
33579
  if (seenMessageKey && wasSeen) {
33538
33580
  if (opts.source !== "app_mention" || !consumeAppMentionRetryKey(seenMessageKey)) return;
33539
33581
  }
33582
+ trackEvent?.();
33540
33583
  const resolvedMessage = await threadTsResolver.resolve({
33541
33584
  message,
33542
33585
  source: opts.source
@@ -34010,7 +34053,7 @@ async function registerSlackMonitorSlashCommands(params) {
34010
34053
  });
34011
34054
  const deliverSlashPayloads = async (replies) => {
34012
34055
  const [{ deliverSlackSlashReplies }, { resolveChunkMode }, { resolveMarkdownTableMode }] = await Promise.all([
34013
- import("./replies-DKKNtkun.js").then((n) => n.r),
34056
+ import("./replies-BdkHHO5V.js").then((n) => n.r),
34014
34057
  import("./chunk-ZFvwZqoJ.js").then((n) => n.s),
34015
34058
  import("./markdown-tables-CXWxrKp3.js").then((n) => n.t)
34016
34059
  ]);
@@ -34190,6 +34233,73 @@ const slackBoltModule = SlackBolt;
34190
34233
  const { App, HTTPReceiver } = (slackBoltModule.App ? slackBoltModule : slackBoltModule.default) ?? slackBoltModule;
34191
34234
  const SLACK_WEBHOOK_MAX_BODY_BYTES = 1024 * 1024;
34192
34235
  const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
34236
+ const SLACK_SOCKET_RECONNECT_POLICY = {
34237
+ initialMs: 2e3,
34238
+ maxMs: 3e4,
34239
+ factor: 1.8,
34240
+ jitter: .25,
34241
+ maxAttempts: 12
34242
+ };
34243
+ function getSocketEmitter(app) {
34244
+ const receiver = app.receiver;
34245
+ const client = receiver && typeof receiver === "object" ? receiver.client : void 0;
34246
+ if (!client || typeof client !== "object") return null;
34247
+ const on = client.on;
34248
+ const off = client.off;
34249
+ if (typeof on !== "function" || typeof off !== "function") return null;
34250
+ return {
34251
+ on: (event, listener) => on.call(client, event, listener),
34252
+ off: (event, listener) => off.call(client, event, listener)
34253
+ };
34254
+ }
34255
+ function waitForSlackSocketDisconnect(app, abortSignal) {
34256
+ return new Promise((resolve) => {
34257
+ const emitter = getSocketEmitter(app);
34258
+ if (!emitter) {
34259
+ abortSignal?.addEventListener("abort", () => resolve({ event: "disconnect" }), { once: true });
34260
+ return;
34261
+ }
34262
+ const disconnectListener = () => resolveOnce({ event: "disconnect" });
34263
+ const startFailListener = () => resolveOnce({ event: "unable_to_socket_mode_start" });
34264
+ const errorListener = (error) => resolveOnce({
34265
+ event: "error",
34266
+ error
34267
+ });
34268
+ const abortListener = () => resolveOnce({ event: "disconnect" });
34269
+ const cleanup = () => {
34270
+ emitter.off("disconnected", disconnectListener);
34271
+ emitter.off("unable_to_socket_mode_start", startFailListener);
34272
+ emitter.off("error", errorListener);
34273
+ abortSignal?.removeEventListener("abort", abortListener);
34274
+ };
34275
+ const resolveOnce = (value) => {
34276
+ cleanup();
34277
+ resolve(value);
34278
+ };
34279
+ emitter.on("disconnected", disconnectListener);
34280
+ emitter.on("unable_to_socket_mode_start", startFailListener);
34281
+ emitter.on("error", errorListener);
34282
+ abortSignal?.addEventListener("abort", abortListener, { once: true });
34283
+ });
34284
+ }
34285
+ /**
34286
+ * Detect non-recoverable Slack API / auth errors that should NOT be retried.
34287
+ * These indicate permanent credential problems (revoked bot, deactivated account, etc.)
34288
+ * and retrying will never succeed — continuing to retry blocks the entire gateway.
34289
+ */
34290
+ function isNonRecoverableSlackAuthError(error) {
34291
+ const msg = error instanceof Error ? error.message : typeof error === "string" ? error : "";
34292
+ return /account_inactive|invalid_auth|token_revoked|token_expired|not_authed|org_login_required|team_access_not_granted|missing_scope|cannot_find_service|invalid_token/i.test(msg);
34293
+ }
34294
+ function formatUnknownError(error) {
34295
+ if (error instanceof Error) return error.message;
34296
+ if (typeof error === "string") return error;
34297
+ try {
34298
+ return JSON.stringify(error);
34299
+ } catch {
34300
+ return "unknown error";
34301
+ }
34302
+ }
34193
34303
  function parseApiAppIdFromAppToken(raw) {
34194
34304
  const token = raw?.trim();
34195
34305
  if (!token) return;
@@ -34313,13 +34423,21 @@ async function monitorSlackProvider(opts = {}) {
34313
34423
  mediaMaxBytes,
34314
34424
  removeAckAfterReply
34315
34425
  });
34426
+ const trackEvent = opts.setStatus ? () => {
34427
+ opts.setStatus({
34428
+ lastEventAt: Date.now(),
34429
+ lastInboundAt: Date.now()
34430
+ });
34431
+ } : void 0;
34316
34432
  registerSlackMonitorEvents({
34317
34433
  ctx,
34318
34434
  account,
34319
34435
  handleSlackMessage: createSlackMessageHandler({
34320
34436
  ctx,
34321
- account
34322
- })
34437
+ account,
34438
+ trackEvent
34439
+ }),
34440
+ trackEvent
34323
34441
  });
34324
34442
  await registerSlackMonitorSlashCommands({
34325
34443
  ctx,
@@ -34408,13 +34526,52 @@ async function monitorSlackProvider(opts = {}) {
34408
34526
  opts.abortSignal?.addEventListener("abort", stopOnAbort, { once: true });
34409
34527
  try {
34410
34528
  if (slackMode === "socket") {
34411
- await app.start();
34412
- runtime.log?.("slack socket mode connected");
34413
- } else runtime.log?.(`slack http mode listening at ${slackWebhookPath}`);
34414
- if (opts.abortSignal?.aborted) return;
34415
- await new Promise((resolve) => {
34416
- opts.abortSignal?.addEventListener("abort", () => resolve(), { once: true });
34417
- });
34529
+ let reconnectAttempts = 0;
34530
+ while (!opts.abortSignal?.aborted) {
34531
+ try {
34532
+ await app.start();
34533
+ reconnectAttempts = 0;
34534
+ runtime.log?.("slack socket mode connected");
34535
+ } catch (err) {
34536
+ if (isNonRecoverableSlackAuthError(err)) {
34537
+ runtime.error?.(`slack socket mode failed to start due to non-recoverable auth error — skipping channel (${formatUnknownError(err)})`);
34538
+ throw err;
34539
+ }
34540
+ reconnectAttempts += 1;
34541
+ if (SLACK_SOCKET_RECONNECT_POLICY.maxAttempts > 0 && reconnectAttempts >= SLACK_SOCKET_RECONNECT_POLICY.maxAttempts) throw err;
34542
+ const delayMs = computeBackoff(SLACK_SOCKET_RECONNECT_POLICY, reconnectAttempts);
34543
+ runtime.error?.(`slack socket mode failed to start. retry ${reconnectAttempts}/${SLACK_SOCKET_RECONNECT_POLICY.maxAttempts || "∞"} in ${Math.round(delayMs / 1e3)}s (${formatUnknownError(err)})`);
34544
+ try {
34545
+ await sleepWithAbort(delayMs, opts.abortSignal);
34546
+ } catch {
34547
+ break;
34548
+ }
34549
+ continue;
34550
+ }
34551
+ if (opts.abortSignal?.aborted) break;
34552
+ const disconnect = await waitForSlackSocketDisconnect(app, opts.abortSignal);
34553
+ if (opts.abortSignal?.aborted) break;
34554
+ if (disconnect.error && isNonRecoverableSlackAuthError(disconnect.error)) {
34555
+ runtime.error?.(`slack socket mode disconnected due to non-recoverable auth error — skipping channel (${formatUnknownError(disconnect.error)})`);
34556
+ throw disconnect.error instanceof Error ? disconnect.error : new Error(formatUnknownError(disconnect.error));
34557
+ }
34558
+ reconnectAttempts += 1;
34559
+ if (SLACK_SOCKET_RECONNECT_POLICY.maxAttempts > 0 && reconnectAttempts >= SLACK_SOCKET_RECONNECT_POLICY.maxAttempts) throw new Error(`Slack socket mode reconnect max attempts reached (${reconnectAttempts}/${SLACK_SOCKET_RECONNECT_POLICY.maxAttempts}) after ${disconnect.event}`);
34560
+ const delayMs = computeBackoff(SLACK_SOCKET_RECONNECT_POLICY, reconnectAttempts);
34561
+ runtime.error?.(`slack socket disconnected (${disconnect.event}). retry ${reconnectAttempts}/${SLACK_SOCKET_RECONNECT_POLICY.maxAttempts || "∞"} in ${Math.round(delayMs / 1e3)}s${disconnect.error ? ` (${formatUnknownError(disconnect.error)})` : ""}`);
34562
+ await app.stop().catch(() => void 0);
34563
+ try {
34564
+ await sleepWithAbort(delayMs, opts.abortSignal);
34565
+ } catch {
34566
+ break;
34567
+ }
34568
+ }
34569
+ } else {
34570
+ runtime.log?.(`slack http mode listening at ${slackWebhookPath}`);
34571
+ if (!opts.abortSignal?.aborted) await new Promise((resolve) => {
34572
+ opts.abortSignal?.addEventListener("abort", () => resolve(), { once: true });
34573
+ });
34574
+ }
34418
34575
  } finally {
34419
34576
  opts.abortSignal?.removeEventListener("abort", stopOnAbort);
34420
34577
  unregisterHttpHandler?.();
@@ -41000,7 +41157,7 @@ function loadWebLoginQr() {
41000
41157
  return webLoginQrPromise;
41001
41158
  }
41002
41159
  function loadWebChannel() {
41003
- webChannelPromise ??= import("./web-CCqlC0N_.js");
41160
+ webChannelPromise ??= import("./web-Cp6O0VTJ.js");
41004
41161
  return webChannelPromise;
41005
41162
  }
41006
41163
  function loadWhatsAppActions() {