@openclaw/slack 2026.10.1 → 2026.10.5-beta.1

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 (195) hide show
  1. package/dist/.setup/account-configured-zcR9TJJN.mjs +35 -0
  2. package/dist/.setup/{account-inspect-Cs-7DXXW.mjs → account-inspect-D58VVDjk.mjs} +15 -35
  3. package/dist/.setup/{accounts-CDgkV7Cm.mjs → accounts-BMg9YLIv.mjs} +44 -53
  4. package/dist/.setup/{action-runtime-DJ1daRAZ.mjs → action-runtime-BiRZNsIG.mjs} +20 -22
  5. package/dist/.setup/action-runtime.runtime-C5xceJoS.mjs +2 -0
  6. package/dist/.setup/{actions-DDoAJnrH.mjs → actions-KGKwTAKO.mjs} +34 -43
  7. package/dist/.setup/{approval-handler.runtime-BcE_shWc.mjs → approval-handler.runtime-DYrsG2Ox.mjs} +44 -70
  8. package/dist/.setup/{approval-message-updates-EgKGmFXx.mjs → approval-message-updates-CwdDew9i.mjs} +1 -1
  9. package/dist/.setup/{channel-DgKSu8Iv.mjs → channel-C7MY-Hhg.mjs} +138 -97
  10. package/dist/.setup/{channel-type-B9zYYzBU.mjs → channel-type-NjX2SwvS.mjs} +3 -3
  11. package/dist/.setup/{channel.setup-BYIlwbQ7.mjs → channel.setup-BFpQowO3.mjs} +7 -14
  12. package/dist/.setup/{directory-config-B_by7zrc.mjs → directory-config-BEDZPfDn.mjs} +1 -1
  13. package/dist/.setup/{directory-live-C48wazJt.mjs → directory-live-FipfeCwt.mjs} +33 -36
  14. package/dist/.setup/{message-tool-api-CcjLPN3v.mjs → message-tool-api-C7im5ETh.mjs} +2 -2
  15. package/dist/.setup/{monitor-BuYBDmm7.mjs → monitor-BnN2px0N.mjs} +609 -801
  16. package/dist/.setup/{outbound-adapter-BZFkK-mw.mjs → outbound-adapter-4HdGq-8r.mjs} +4 -4
  17. package/dist/.setup/{pipeline.runtime-CIepKmZt.mjs → pipeline.runtime-ByPbC6MN.mjs} +287 -365
  18. package/dist/.setup/{policy-KKTqEiDv.mjs → policy-BaY9_eh1.mjs} +2 -2
  19. package/dist/.setup/{probe-BVlJ3dp0.mjs → probe-CyX52GtD.mjs} +54 -61
  20. package/dist/.setup/{relay-source-CC3h6M7y.mjs → relay-source-CVfH-fBO.mjs} +28 -45
  21. package/dist/.setup/{replies-DHbuthIR.mjs → replies-WmfwvQxc.mjs} +38 -49
  22. package/dist/.setup/{reply-blocks-CKnO4BSG.mjs → reply-blocks-rqHQ_3pr.mjs} +87 -138
  23. package/dist/.setup/{resolve-channels-HR0TgArR.mjs → resolve-channels-B96cgprw.mjs} +17 -41
  24. package/dist/.setup/{resolve-users-BNYBhF0q.mjs → resolve-users-Xz9aPdns.mjs} +22 -58
  25. package/dist/.setup/{scopes-DrDbyUH2.mjs → scopes-aMcMHhXk.mjs} +1 -1
  26. package/dist/.setup/{send-CgPI3Zj8.mjs → send-CLmsR42r.mjs} +157 -284
  27. package/dist/.setup/{session-status-D46GHwOV.mjs → session-status-CcXe10zN.mjs} +181 -238
  28. package/dist/.setup/{setup-plugin-api-ZrHs0N4U.mjs → setup-plugin-api-D92P5p51.mjs} +1 -1
  29. package/dist/.setup/{setup-surface-83lxvE2y.mjs → setup-surface-368jx6Uc.mjs} +6 -6
  30. package/dist/.setup/{shared-VtmYNj-v.mjs → shared-CtprVh_G.mjs} +5 -5
  31. package/dist/.setup/{slash-dispatch.runtime-gBj_uaLM.mjs → slash-dispatch.runtime-Dzwj6TPI.mjs} +1 -1
  32. package/dist/account-inspect-api.js +1 -1
  33. package/dist/api.js +12 -12
  34. package/dist/channel-plugin-api.js +1 -1
  35. package/dist/configured-state.js +6 -13
  36. package/dist/directory-contract-api.js +1 -1
  37. package/dist/message-tool-api.js +1 -1
  38. package/dist/runtime-api.js +10 -10
  39. package/dist/setup-entry.js +1 -1
  40. package/dist/setup-plugin-api.js +1 -1
  41. package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts +1 -1
  42. package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts.map +1 -1
  43. package/node_modules/@slack/types/dist/block-kit/blocks.d.ts +79 -4
  44. package/node_modules/@slack/types/dist/block-kit/blocks.d.ts.map +1 -1
  45. package/node_modules/@slack/types/dist/block-kit/composition-objects.d.ts +17 -0
  46. package/node_modules/@slack/types/dist/block-kit/composition-objects.d.ts.map +1 -1
  47. package/node_modules/@slack/types/package.json +1 -1
  48. package/node_modules/@slack/web-api/dist/methods.d.ts +49 -2
  49. package/node_modules/@slack/web-api/dist/methods.d.ts.map +1 -1
  50. package/node_modules/@slack/web-api/dist/methods.js +47 -0
  51. package/node_modules/@slack/web-api/dist/methods.js.map +1 -1
  52. package/node_modules/@slack/web-api/dist/types/request/agents.d.ts +186 -0
  53. package/node_modules/@slack/web-api/dist/types/request/agents.d.ts.map +1 -1
  54. package/node_modules/@slack/web-api/dist/types/request/index.d.ts +1 -1
  55. package/node_modules/@slack/web-api/dist/types/request/index.d.ts.map +1 -1
  56. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.d.ts +9 -0
  57. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.d.ts.map +1 -0
  58. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.js +11 -0
  59. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.js.map +1 -0
  60. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.d.ts +10 -0
  61. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.d.ts.map +1 -0
  62. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.js +11 -0
  63. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.js.map +1 -0
  64. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.d.ts +29 -0
  65. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.d.ts.map +1 -0
  66. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.js +11 -0
  67. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.js.map +1 -0
  68. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.d.ts +18 -0
  69. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.d.ts.map +1 -0
  70. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.js +11 -0
  71. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.js.map +1 -0
  72. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.d.ts +11 -0
  73. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.d.ts.map +1 -0
  74. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.js +11 -0
  75. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.js.map +1 -0
  76. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.d.ts +11 -0
  77. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.d.ts.map +1 -0
  78. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.js +11 -0
  79. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.js.map +1 -0
  80. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.d.ts +11 -0
  81. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.d.ts.map +1 -0
  82. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.js +11 -0
  83. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.js.map +1 -0
  84. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.d.ts +10 -0
  85. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.d.ts.map +1 -0
  86. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.js +11 -0
  87. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.js.map +1 -0
  88. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.d.ts +15 -0
  89. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.d.ts.map +1 -0
  90. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.js +11 -0
  91. package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.js.map +1 -0
  92. package/node_modules/@slack/web-api/dist/types/response/ConversationsInfoResponse.d.ts +31 -0
  93. package/node_modules/@slack/web-api/dist/types/response/ConversationsInfoResponse.d.ts.map +1 -1
  94. package/node_modules/@slack/web-api/dist/types/response/index.d.ts +9 -0
  95. package/node_modules/@slack/web-api/dist/types/response/index.d.ts.map +1 -1
  96. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/LICENSE +21 -0
  97. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/README.md +15 -0
  98. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +68 -0
  99. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +1077 -0
  100. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +711 -0
  101. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.buffer.d.ts +471 -0
  102. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1800 -0
  103. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1361 -0
  104. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +432 -0
  105. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +93 -0
  106. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +14 -0
  107. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +3964 -0
  108. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +652 -0
  109. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
  110. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +497 -0
  111. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +876 -0
  112. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +150 -0
  113. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +1008 -0
  114. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ffi.d.ts +500 -0
  115. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +1477 -0
  116. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +4803 -0
  117. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +150 -0
  118. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  119. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +2218 -0
  120. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +2498 -0
  121. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +400 -0
  122. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +116 -0
  123. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector/promises.d.ts +35 -0
  124. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +265 -0
  125. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  126. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +726 -0
  127. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +1074 -0
  128. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +498 -0
  129. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/package.json +155 -0
  130. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/posix.d.ts +8 -0
  131. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/win32.d.ts +8 -0
  132. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +178 -0
  133. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +617 -0
  134. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +2269 -0
  135. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +89 -0
  136. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +139 -0
  137. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/quic.d.ts +2191 -0
  138. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline/promises.d.ts +158 -0
  139. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +508 -0
  140. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +420 -0
  141. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sea.d.ts +47 -0
  142. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sqlite.d.ts +1140 -0
  143. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +114 -0
  144. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/iter.d.ts +449 -0
  145. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +211 -0
  146. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +320 -0
  147. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +1806 -0
  148. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +27 -0
  149. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test/reporters.d.ts +60 -0
  150. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +2558 -0
  151. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +93 -0
  152. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +149 -0
  153. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +1232 -0
  154. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +103 -0
  155. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +467 -0
  156. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  157. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  158. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +118 -0
  159. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  160. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/index.d.ts +118 -0
  161. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +226 -0
  162. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +556 -0
  163. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util/types.d.ts +558 -0
  164. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1677 -0
  165. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +1059 -0
  166. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vfs.d.ts +211 -0
  167. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +1137 -0
  168. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +131 -0
  169. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  170. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  171. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/console.d.ts +9 -0
  172. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  173. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
  174. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  175. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/events.d.ts +106 -0
  176. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  177. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  178. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  179. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  180. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  181. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  182. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/streams.d.ts +119 -0
  183. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  184. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/url.d.ts +24 -0
  185. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +672 -0
  186. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib/iter.d.ts +131 -0
  187. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +606 -0
  188. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +2 -2
  189. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -17
  190. package/node_modules/@slack/web-api/package.json +2 -2
  191. package/openclaw.plugin.json +0 -3
  192. package/package.json +6 -14
  193. package/dist/.setup/account-configured-sUohAxZr.mjs +0 -33
  194. package/dist/.setup/action-runtime.runtime-CdWL2mLC.mjs +0 -2
  195. package/dist/control-ui/2f4b1e827be6b68ced2ea0d8b7da8529a4eafbe72be27ee37e1064bdd530ec10/index.js +0 -1
@@ -1,4 +1,4 @@
1
- import { C as buildSlackBlocksFallbackText, G as encodeSlackQuestionAction, J as markdownToSlackMrkdwnChunks, N as SLACK_BUTTON_ACTION_IDS, Q as hasSlackDataVisualizationBlock, R as SLACK_SELECT_ACTION_IDS, T as renderSlackBlockFallbackText, X as buildSlackDataVisualizationBlock, Z as canRenderSlackDataVisualization, et as buildSlackDataTableBlock, ft as SLACK_SECTION_TEXT_MAX, g as buildSlackNativeDataAccessibilityText, it as renderSlackMessagePresentationChartFallbackText, j as truncateSlackText, lt as encodeSlackApprovalAction, m as appendSlackNativeDataFallbackText, mt as parseSlackBlocksInput, nt as countSlackDataTableCellCharacters, q as chunkSlackMrkdwnText, rt as resolveSlackDataTableCellCharacterCount, tt as countSlackDataTableBlocksCellCharacters, v as hasSlackNativeDataBlock, w as buildSlackCompleteBlocksFallbackText } from "./session-status-D46GHwOV.mjs";
1
+ import { E as renderSlackBlockFallbackText, J as chunkSlackMrkdwnText, K as encodeSlackQuestionAction, M as truncateSlackText, P as SLACK_BUTTON_ACTION_IDS, Q as hasSlackDataVisualizationBlock, T as buildSlackCompleteBlocksFallbackText, Y as markdownToSlackMrkdwnChunks, Z as buildSlackDataVisualizationBlock, ct as encodeSlackApprovalAction, dt as SLACK_SECTION_TEXT_MAX, et as buildSlackDataTableBlock, g as buildSlackNativeDataAccessibilityText, m as appendSlackNativeDataFallbackText, nt as countSlackDataTableCellCharacters, pt as parseSlackBlocksInput, rt as renderSlackMessagePresentationChartFallbackText, tt as countSlackDataTableBlocksCellCharacters, v as hasSlackNativeDataBlock, w as buildSlackBlocksFallbackText, z as SLACK_SELECT_ACTION_IDS } from "./session-status-CcXe10zN.mjs";
2
2
  import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
4
4
  import { legacyInteractiveReplyToPresentation, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
@@ -6,6 +6,13 @@ import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply
6
6
  import { resolveAskUserQuestionOptionIndex, resolveAskUserQuestionOptionIndices, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
7
7
  //#region extensions/slack/src/blocks-render.ts
8
8
  const SLACK_BUTTON_URL_MAX = 3e3;
9
+ function buildSlackPlainText(text, maxLength) {
10
+ return {
11
+ type: "plain_text",
12
+ text: truncateSlackText(text, maxLength),
13
+ emoji: true
14
+ };
15
+ }
9
16
  function resolveSlackButtonStyle(style) {
10
17
  if (style === "primary" || style === "danger") return style;
11
18
  if (style === "success") return "primary";
@@ -88,10 +95,6 @@ function resolveSlackOptionTarget(option) {
88
95
  value
89
96
  } : void 0;
90
97
  }
91
- function readSlackBlockId(block) {
92
- const value = block.block_id;
93
- return typeof value === "string" ? value : void 0;
94
- }
95
98
  function readSlackOpenClawBlockIndex(blockId, prefix) {
96
99
  if (!blockId.startsWith(prefix)) return;
97
100
  const value = Number.parseInt(blockId.slice(prefix.length), 10);
@@ -105,8 +108,8 @@ function resolveSlackBlockOffsets(blocks, mode = "all") {
105
108
  let selectIndexOffset = 0;
106
109
  for (const block of blocks ?? []) {
107
110
  if (mode === "all" && hasSlackDataVisualizationBlock([block])) dataVisualizationCountOffset += 1;
108
- const blockId = readSlackBlockId(block);
109
- if (!blockId) continue;
111
+ const blockId = block.block_id;
112
+ if (typeof blockId !== "string" || !blockId) continue;
110
113
  buttonIndexOffset = Math.max(buttonIndexOffset, readSlackOpenClawBlockIndex(blockId, "openclaw_reply_buttons_") ?? 0);
111
114
  selectIndexOffset = Math.max(selectIndexOffset, readSlackOpenClawBlockIndex(blockId, "openclaw_reply_select_") ?? 0);
112
115
  }
@@ -123,23 +126,29 @@ function resolveSlackBlockOffsets(blocks, mode = "all") {
123
126
  function buildSlackInteractiveBlocks(interactive, options = {}) {
124
127
  return buildSlackPresentationBlocks(interactive ? legacyInteractiveReplyToPresentation(interactive) : void 0, options);
125
128
  }
126
- /** Render portable presentation blocks as Slack Block Kit blocks. */
127
129
  function buildSlackPresentationBlocks(presentation, options = {}) {
130
+ return compileSlackPresentationBlocks(presentation, options, false) ?? [];
131
+ }
132
+ /** Return native blocks only when every portable control and data block fits. */
133
+ function buildSlackPresentationBlocksIfComplete(presentation, options = {}) {
134
+ return compileSlackPresentationBlocks(presentation, options, true);
135
+ }
136
+ function compileSlackPresentationBlocks(presentation, options, requireComplete) {
128
137
  if (!presentation) return [];
129
- const renderTablesNatively = canRenderSlackPresentationTables(presentation, options);
138
+ if (requireComplete && presentation.title && presentation.title.trim().length > 150) return;
139
+ const tables = buildSlackPresentationTables(presentation, options);
140
+ if (requireComplete && !tables) return;
130
141
  const blocks = [];
131
142
  if (presentation.title) blocks.push({
132
143
  type: "header",
133
- text: {
134
- type: "plain_text",
135
- text: truncateSlackText(presentation.title, 150),
136
- emoji: true
137
- }
144
+ text: buildSlackPlainText(presentation.title, 150)
138
145
  });
139
- let buttonIndex = options.buttonIndexOffset ?? 0;
140
- let dataTableCellCharacterCount = options.dataTableCellCharacterCountOffset ?? 0;
146
+ const controlIndices = {
147
+ buttons: options.buttonIndexOffset ?? 0,
148
+ select: options.selectIndexOffset ?? 0
149
+ };
150
+ let tableIndex = 0;
141
151
  let dataVisualizationCount = options.dataVisualizationCountOffset ?? 0;
142
- let selectIndex = options.selectIndexOffset ?? 0;
143
152
  for (const block of presentation.blocks) {
144
153
  if (block.type === "text" || block.type === "context") {
145
154
  const text = block.text.trim();
@@ -164,11 +173,17 @@ function buildSlackPresentationBlocks(presentation, options = {}) {
164
173
  blocks.push({ type: "divider" });
165
174
  continue;
166
175
  }
167
- if (block.type === "buttons") {
168
- const rendered = buildSlackPresentationButtonBlock(block, buttonIndex + 1, options.questionOptionIndices);
169
- if (rendered) {
170
- buttonIndex += 1;
171
- blocks.push(rendered);
176
+ if (block.type === "buttons" || block.type === "select") {
177
+ const index = controlIndices[block.type] + 1;
178
+ const elements = block.type === "buttons" ? buildSlackPresentationButtonElements(block, index, options.questionOptionIndices, requireComplete) : buildSlackPresentationSelectElements(block, index, requireComplete);
179
+ if (!elements) return;
180
+ if (elements.length > 0) {
181
+ controlIndices[block.type] = index;
182
+ blocks.push({
183
+ type: "actions",
184
+ block_id: `openclaw_reply_${block.type}_${index}`,
185
+ elements
186
+ });
172
187
  }
173
188
  continue;
174
189
  }
@@ -177,7 +192,8 @@ function buildSlackPresentationBlocks(presentation, options = {}) {
177
192
  if (rendered) {
178
193
  dataVisualizationCount += 1;
179
194
  blocks.push(rendered);
180
- } else {
195
+ } else if (requireComplete) return;
196
+ else {
181
197
  const fallback = renderSlackMessagePresentationChartFallbackText(block);
182
198
  blocks.push(...chunkTextForOutbound(fallback, SLACK_SECTION_TEXT_MAX).map((text) => ({
183
199
  type: "context",
@@ -191,123 +207,66 @@ function buildSlackPresentationBlocks(presentation, options = {}) {
191
207
  continue;
192
208
  }
193
209
  if (block.type === "table") {
194
- if (!renderTablesNatively) continue;
195
- const rendered = buildSlackDataTableBlock(block, { cellCharacterCountOffset: dataTableCellCharacterCount });
196
- if (rendered) {
197
- dataTableCellCharacterCount += countSlackDataTableCellCharacters(rendered);
198
- blocks.push(rendered);
199
- }
200
- continue;
201
- }
202
- if (block.type === "select") {
203
- const rendered = buildSlackPresentationSelectBlock(block, selectIndex + 1);
204
- if (rendered) {
205
- selectIndex += 1;
206
- blocks.push(rendered);
207
- }
210
+ if (tables) blocks.push(tables[tableIndex++]);
208
211
  }
209
212
  }
210
213
  return blocks;
211
214
  }
212
- function buildSlackPresentationButtonBlock(block, buttonIndex, questionOptionIndices) {
215
+ function buildSlackPresentationButtonElements(block, buttonIndex, questionOptionIndices, requireComplete) {
216
+ let complete = true;
213
217
  const elements = block.buttons.flatMap((button, choiceIndex) => {
214
218
  const target = resolveSlackButtonTarget(button, questionOptionIndices);
215
- if (!target || (target.kind === "link" ? target.url.length > SLACK_BUTTON_URL_MAX : target.value.length > 2e3)) return [];
219
+ if (!target || (target.kind === "link" ? target.url.length > SLACK_BUTTON_URL_MAX : target.value.length > 2e3)) {
220
+ if (requireComplete && !isSlackTextFallbackButton(button)) complete = false;
221
+ return [];
222
+ }
223
+ if (button.label.length > 75) complete = false;
216
224
  const style = resolveSlackButtonStyle(button.style);
217
225
  return [{
218
226
  type: "button",
219
227
  action_id: `${SLACK_BUTTON_ACTION_IDS[target.kind]}:${buttonIndex}:${choiceIndex + 1}`,
220
- text: {
221
- type: "plain_text",
222
- text: truncateSlackText(button.label, 75),
223
- emoji: true
224
- },
228
+ text: buildSlackPlainText(button.label, 75),
225
229
  ...target.kind === "link" ? { url: target.url } : { value: target.value },
226
230
  ...style ? { style } : {}
227
231
  }];
228
- }).slice(0, 25);
229
- return elements.length > 0 ? {
230
- type: "actions",
231
- block_id: `openclaw_reply_buttons_${buttonIndex}`,
232
- elements
233
- } : void 0;
232
+ });
233
+ if (requireComplete && (!complete || elements.length > 25)) return;
234
+ return elements.slice(0, 25);
234
235
  }
235
- /** True when every portable table fits Slack's native per-message table budget. */
236
- function canRenderSlackPresentationTables(presentation, options = {}) {
236
+ /** Admit tables together: one invalid or over-budget table keeps every table on the text path. */
237
+ function buildSlackPresentationTables(presentation, options = {}) {
238
+ const tables = [];
237
239
  let cellCharacterCount = options.dataTableCellCharacterCountOffset ?? 0;
238
240
  for (const block of presentation.blocks) {
239
241
  if (block.type !== "table") continue;
240
- const tableCellCharacterCount = resolveSlackDataTableCellCharacterCount(block, { cellCharacterCountOffset: cellCharacterCount });
241
- if (tableCellCharacterCount === void 0) return false;
242
- cellCharacterCount += tableCellCharacterCount;
243
- }
244
- return true;
245
- }
246
- /** True when native Slack rendering preserves every portable control. */
247
- function canRenderSlackPresentation(presentation, options = {}) {
248
- if (presentation.title && presentation.title.trim().length > 150) return false;
249
- if (!canRenderSlackPresentationTables(presentation, options)) return false;
250
- let dataVisualizationCount = options.dataVisualizationCountOffset ?? 0;
251
- for (const block of presentation.blocks) {
252
- if (block.type === "text" || block.type === "context") continue;
253
- if (block.type === "buttons") {
254
- let nativeButtonCount = 0;
255
- if (!(block.buttons.every((button) => {
256
- if (isSlackTextFallbackButton(button)) return true;
257
- nativeButtonCount += 1;
258
- if (button.label.length > 75) return false;
259
- const target = resolveSlackButtonTarget(button, options.questionOptionIndices);
260
- return target ? target.kind === "link" ? target.url.length <= SLACK_BUTTON_URL_MAX : target.value.length <= 2e3 : false;
261
- }) && nativeButtonCount <= 25)) return false;
262
- continue;
263
- }
264
- if (block.type === "select") {
265
- if (!((normalizeOptionalString(block.placeholder) ?? "Choose an option").length <= 75 && block.options.length <= 100 && (!block.placeholder || block.placeholder.length <= 75) && block.options.every((option) => {
266
- if (option.label.length > 75) return false;
267
- const target = resolveSlackOptionTarget(option);
268
- return target ? target.value.length <= 150 : false;
269
- }) && new Set(block.options.map((option) => resolveSlackOptionTarget(option)?.kind)).size === 1)) return false;
270
- continue;
271
- }
272
- if (block.type === "chart") {
273
- if (dataVisualizationCount >= 2 || !canRenderSlackDataVisualization(block)) return false;
274
- dataVisualizationCount += 1;
275
- continue;
276
- }
277
- if (block.type === "table") continue;
242
+ const table = buildSlackDataTableBlock(block, { cellCharacterCountOffset: cellCharacterCount });
243
+ if (!table) return;
244
+ cellCharacterCount += countSlackDataTableCellCharacters(table);
245
+ tables.push(table);
278
246
  }
279
- return true;
247
+ return tables;
280
248
  }
281
- function buildSlackPresentationSelectBlock(block, selectIndex) {
282
- const options = block.options.flatMap((option) => {
249
+ function buildSlackPresentationSelectElements(block, selectIndex, requireComplete) {
250
+ const placeholder = normalizeOptionalString(block.placeholder) ?? "Choose an option";
251
+ const candidates = block.options.map((option) => {
283
252
  const target = resolveSlackOptionTarget(option);
284
- return target ? [{
253
+ return target ? {
285
254
  label: option.label,
286
255
  ...target
287
- }] : [];
288
- }).filter((option) => option.value.length <= 150).slice(0, 100);
256
+ } : void 0;
257
+ });
258
+ if (requireComplete && (placeholder.length > 75 || block.options.length > 100 || block.placeholder && block.placeholder.length > 75 || !candidates.every((option) => option && option.label.length <= 75 && option.value.length <= 150) || new Set(candidates.map((option) => option?.kind)).size !== 1)) return;
259
+ const options = candidates.flatMap((option) => option && option.value.length <= 150 ? [option] : []).slice(0, 100);
289
260
  const optionKinds = new Set(options.map((option) => option.kind));
290
- return options.length > 0 && optionKinds.size === 1 ? {
291
- type: "actions",
292
- block_id: `openclaw_reply_select_${selectIndex}`,
293
- elements: [{
294
- type: "static_select",
295
- action_id: `${SLACK_SELECT_ACTION_IDS[options[0].kind]}:${selectIndex}`,
296
- placeholder: {
297
- type: "plain_text",
298
- text: truncateSlackText(normalizeOptionalString(block.placeholder) ?? "Choose an option", 75),
299
- emoji: true
300
- },
301
- options: options.map((option) => ({
302
- text: {
303
- type: "plain_text",
304
- text: truncateSlackText(option.label, 75),
305
- emoji: true
306
- },
307
- value: option.value
308
- }))
309
- }]
310
- } : void 0;
261
+ return options.length > 0 && optionKinds.size === 1 ? [{
262
+ type: "static_select",
263
+ action_id: `${SLACK_SELECT_ACTION_IDS[options[0].kind]}:${selectIndex}`,
264
+ placeholder: buildSlackPlainText(placeholder, 75),
265
+ options: options.map((option) => ({
266
+ text: buildSlackPlainText(option.label, 75),
267
+ value: option.value
268
+ }))
269
+ }] : [];
311
270
  }
312
271
  //#endregion
313
272
  //#region extensions/slack/src/authored-text.ts
@@ -566,28 +525,18 @@ function resolvePresentationRenderOptions(segments, mode) {
566
525
  selectIndexOffset: allOffsets.selectIndexOffset
567
526
  };
568
527
  }
569
- function renderNativePresentation(presentation, options) {
570
- if (!canRenderSlackPresentation(presentation, options)) return;
571
- const blocks = buildSlackPresentationBlocks(presentation, options);
572
- return blocks.length > 0 ? blocks : void 0;
573
- }
574
528
  function appendPresentationPart(segments, presentation, questionOptionIndices) {
575
529
  const currentBlocks = readLastBlockSegment(segments);
576
- const currentRendered = renderNativePresentation(presentation, {
577
- ...resolvePresentationRenderOptions(segments, "current"),
578
- questionOptionIndices
579
- });
580
- if (currentRendered && currentBlocks.length + currentRendered.length <= 50) {
581
- appendBlockSegment(segments, currentRendered);
582
- return;
583
- }
584
- const freshRendered = renderNativePresentation(presentation, {
585
- ...resolvePresentationRenderOptions(segments, "new-message"),
586
- questionOptionIndices
587
- });
588
- if (freshRendered) {
589
- appendBlockSegment(segments, freshRendered, true);
590
- return;
530
+ for (const mode of ["current", "new-message"]) {
531
+ const rendered = buildSlackPresentationBlocksIfComplete(presentation, {
532
+ ...resolvePresentationRenderOptions(segments, mode),
533
+ questionOptionIndices
534
+ });
535
+ const startNew = mode === "new-message";
536
+ if (rendered?.length && (startNew || currentBlocks.length + rendered.length <= 50)) {
537
+ appendBlockSegment(segments, rendered, startNew);
538
+ return;
539
+ }
591
540
  }
592
541
  appendTextSegment(segments, renderMessagePresentationFallbackText({ presentation }));
593
542
  }
@@ -699,4 +648,4 @@ function resolveSlackReplyBlocks(payload) {
699
648
  return segments.length === 1 && segments[0]?.kind === "blocks" ? segments[0].blocks : void 0;
700
649
  }
701
650
  //#endregion
702
- export { prepareSlackReply as a, resolveSlackReplyDeliveryMessages as c, buildSlackInteractiveBlocks as d, buildSlackPresentationBlocks as f, parseSlackReplyBlockSegments as i, resolveSlackReplyRenderPlan as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlockResolution as o, canRenderSlackPresentation as p, normalizeSlackReplyPayload as r, resolveSlackReplyBlocks as s, hasSlackReplyStructuredContent as t, resolveSlackAuthoredTextPlacement as u };
651
+ export { prepareSlackReply as a, resolveSlackReplyDeliveryMessages as c, buildSlackInteractiveBlocks as d, buildSlackPresentationBlocks as f, parseSlackReplyBlockSegments as i, resolveSlackReplyRenderPlan as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlockResolution as o, buildSlackPresentationBlocksIfComplete as p, normalizeSlackReplyPayload as r, resolveSlackReplyBlocks as s, hasSlackReplyStructuredContent as t, resolveSlackAuthoredTextPlacement as u };
@@ -1,8 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
2
  import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-FFE26kOV.mjs";
3
- import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-BVlJ3dp0.mjs";
3
+ import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-CyX52GtD.mjs";
4
4
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
5
- import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
6
5
  //#region extensions/slack/src/resolve-channels.ts
7
6
  var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveSlackChannelAllowlist: () => resolveSlackChannelAllowlist });
8
7
  function parseSlackChannelMention(raw) {
@@ -14,7 +13,7 @@ function parseSlackChannelMention(raw) {
14
13
  name: mention[2]?.trim()
15
14
  };
16
15
  const prefixed = trimmed.replace(/^(slack:|channel:)/i, "");
17
- if (/^[CG][A-Z0-9]+$/i.test(prefixed)) return { id: prefixed.toUpperCase() };
16
+ if (/^[CG][A-Z0-9]{8,}$/i.test(prefixed)) return { id: prefixed.toUpperCase() };
18
17
  const name = prefixed.replace(/^#/, "").trim();
19
18
  return name ? { name } : {};
20
19
  }
@@ -41,55 +40,32 @@ function resolveByName(name, channels) {
41
40
  return matches.find((channel) => !channel.archived) ?? matches[0];
42
41
  }
43
42
  async function resolveSlackChannelAllowlist(params) {
44
- const workspaceResolved = params.entries.map((input) => resolveWorkspaceQualifiedSlackTarget(input, "channel"));
45
- const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
46
- if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
47
- const parsedEntries = lookupEntries.map((input) => ({
43
+ const entries = params.entries.map((input) => ({
48
44
  input,
45
+ workspace: resolveWorkspaceQualifiedSlackTarget(input, "channel"),
49
46
  parsed: parseSlackChannelMention(input)
50
47
  }));
51
- if (parsedEntries.every((entry) => Boolean(entry.parsed.id))) {
52
- const resolved = parsedEntries.map(({ input, parsed }) => ({
53
- input,
54
- resolved: true,
55
- id: parsed.id,
56
- name: parsed.name
57
- }));
58
- let resolvedIndex = 0;
59
- return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
60
- }
48
+ if (entries.every(({ workspace, parsed }) => workspace || parsed.id)) return entries.map(({ input, workspace, parsed }) => workspace ?? {
49
+ input,
50
+ resolved: true,
51
+ id: parsed.id,
52
+ name: parsed.name
53
+ });
61
54
  const channels = await listSlackChannels(params.client ?? createSlackLookupClient(params.token));
62
- const resolved = resolveDirectoryAllowlistEntries({
63
- entries: lookupEntries,
64
- lookup: channels,
65
- parseInput: parseSlackChannelMention,
66
- findById: (lookup, id) => lookup.find((channel) => channel.id === id),
67
- buildIdResolved: ({ input, parsed, match }) => ({
55
+ return entries.map(({ input, workspace, parsed }) => {
56
+ if (workspace) return workspace;
57
+ const match = parsed.id ? channels.find((channel) => channel.id === parsed.id) : parsed.name ? resolveByName(parsed.name, channels) : void 0;
58
+ return parsed.id || match ? {
68
59
  input,
69
60
  resolved: true,
70
- id: parsed.id,
61
+ id: parsed.id ?? match?.id,
71
62
  name: match?.name ?? parsed.name,
72
63
  archived: match?.archived
73
- }),
74
- resolveNonId: ({ input, parsed, lookup }) => {
75
- if (!parsed.name) return;
76
- const match = resolveByName(parsed.name, lookup);
77
- if (!match) return;
78
- return {
79
- input,
80
- resolved: true,
81
- id: match.id,
82
- name: match.name,
83
- archived: match.archived
84
- };
85
- },
86
- buildUnresolved: (input) => ({
64
+ } : {
87
65
  input,
88
66
  resolved: false
89
- })
67
+ };
90
68
  });
91
- let resolvedIndex = 0;
92
- return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
93
69
  }
94
70
  //#endregion
95
71
  export { resolve_channels_exports as n, resolveSlackChannelAllowlist as t };
@@ -1,8 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
2
  import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-FFE26kOV.mjs";
3
- import { c as collectSlackCursorPages, u as createSlackLookupClient } from "./probe-BVlJ3dp0.mjs";
3
+ import { c as collectSlackCursorPages, u as createSlackLookupClient } from "./probe-CyX52GtD.mjs";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
- import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
6
5
  //#region extensions/slack/src/resolve-users.ts
7
6
  var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveSlackUserAllowlist: () => resolveSlackUserAllowlist });
8
7
  function parseSlackUserInput(raw) {
@@ -51,71 +50,36 @@ function matchesSlackUserName(user, name) {
51
50
  return Boolean(candidate) && candidate === target;
52
51
  });
53
52
  }
54
- function scoreSlackUser(user, match) {
55
- let score = 0;
56
- if (!user.deleted) score += 3;
57
- if (!user.isBot && !user.isAppUser) score += 2;
58
- if (match.email && user.email === match.email) score += 5;
59
- if (match.name && matchesSlackUserName(user, match.name)) score += 2;
60
- return score;
61
- }
62
- function resolveSlackUserFromMatches(input, matches, parsed) {
63
- const best = matches.map((user) => ({
64
- user,
65
- score: scoreSlackUser(user, parsed)
66
- })).toSorted((a, b) => b.score - a.score)[0]?.user;
67
- if (!best) return {
68
- input,
69
- resolved: false
70
- };
71
- return {
72
- input,
73
- resolved: true,
74
- id: best.id,
75
- name: best.displayName ?? best.realName ?? best.name,
76
- email: best.email,
77
- deleted: best.deleted,
78
- isBot: best.isBot,
79
- note: matches.length > 1 ? "multiple matches; chose best" : void 0
80
- };
53
+ function scoreSlackUser(user) {
54
+ return (user.deleted ? 0 : 3) + (user.isBot || user.isAppUser ? 0 : 2);
81
55
  }
82
56
  async function resolveSlackUserAllowlist(params) {
83
- const workspaceResolved = params.entries.map((input) => resolveWorkspaceQualifiedSlackTarget(input, "user"));
84
- const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
85
- if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
86
- const users = await listSlackUsers(params.client ?? createSlackLookupClient(params.token));
87
- const resolved = resolveDirectoryAllowlistEntries({
88
- entries: lookupEntries,
89
- lookup: users,
90
- parseInput: parseSlackUserInput,
91
- findById: (lookup, id) => lookup.find((user) => user.id === id),
92
- buildIdResolved: ({ input, parsed, match }) => ({
57
+ const entries = params.entries.map((input) => ({
58
+ input,
59
+ workspace: resolveWorkspaceQualifiedSlackTarget(input, "user"),
60
+ parsed: parseSlackUserInput(input)
61
+ }));
62
+ const users = entries.some(({ workspace }) => !workspace) ? await listSlackUsers(params.client ?? createSlackLookupClient(params.token)) : [];
63
+ return entries.map(({ input, workspace, parsed }) => {
64
+ if (workspace) return workspace;
65
+ const matches = users.filter((user) => parsed.id ? user.id === parsed.id : parsed.email ? user.email === parsed.email : parsed.name ? matchesSlackUserName(user, parsed.name) : false);
66
+ const match = parsed.id ? matches[0] : matches.toSorted((a, b) => scoreSlackUser(b) - scoreSlackUser(a))[0];
67
+ if (!parsed.id && !match) return {
68
+ input,
69
+ resolved: false
70
+ };
71
+ const result = {
93
72
  input,
94
73
  resolved: true,
95
- id: parsed.id,
74
+ id: parsed.id ?? match?.id,
96
75
  name: match?.displayName ?? match?.realName ?? match?.name,
97
76
  email: match?.email,
98
77
  deleted: match?.deleted,
99
78
  isBot: match?.isBot
100
- }),
101
- resolveNonId: ({ input, parsed, lookup }) => {
102
- if (parsed.email) {
103
- const matches = lookup.filter((user) => user.email === parsed.email);
104
- if (matches.length > 0) return resolveSlackUserFromMatches(input, matches, parsed);
105
- }
106
- const name = parsed.name;
107
- if (name) {
108
- const matches = lookup.filter((user) => matchesSlackUserName(user, name));
109
- if (matches.length > 0) return resolveSlackUserFromMatches(input, matches, parsed);
110
- }
111
- },
112
- buildUnresolved: (input) => ({
113
- input,
114
- resolved: false
115
- })
79
+ };
80
+ if (!parsed.id) result.note = matches.length > 1 ? "multiple matches; chose best" : void 0;
81
+ return result;
116
82
  });
117
- let resolvedIndex = 0;
118
- return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
119
83
  }
120
84
  //#endregion
121
85
  export { resolve_users_exports as n, resolveSlackUserAllowlist as t };
@@ -1,4 +1,4 @@
1
- import { d as createSlackReadClient, o as formatSlackError } from "./probe-BVlJ3dp0.mjs";
1
+ import { d as createSlackReadClient, o as formatSlackError } from "./probe-CyX52GtD.mjs";
2
2
  import { isRecord, normalizeOptionalString, normalizeTrimmedStringList, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/slack/src/scopes.ts
4
4
  function collectScopes(value, into) {