@openclaw/slack 2026.10.10-beta.5 → 2026.11.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 (284) hide show
  1. package/dist/.setup/{account-configured-zcR9TJJN.mjs → account-configured-35y0-Hso.mjs} +1 -2
  2. package/dist/.setup/{account-inspect-CmkKiSb9.mjs → account-inspect-DgQgj0wk.mjs} +13 -11
  3. package/dist/.setup/{accounts-msihSF3-.mjs → accounts-EaPP0fFY.mjs} +16 -11
  4. package/dist/.setup/{action-runtime-ChRfnnBu.mjs → action-runtime-CK9QZgQl.mjs} +39 -47
  5. package/dist/.setup/action-runtime.runtime-CpZktret.mjs +1 -0
  6. package/dist/.setup/{actions-By7tvpvv.mjs → actions-s3CcFO45.mjs} +98 -93
  7. package/dist/.setup/{approval-handler.runtime-D8ArtDQt.mjs → approval-handler.runtime-Ch7BecYK.mjs} +27 -32
  8. package/dist/.setup/{approval-message-updates-DT7XBPbV.mjs → approval-message-updates-CqcRoa28.mjs} +2 -3
  9. package/dist/.setup/{channel-6YzXl_63.mjs → channel-CAvo_WNZ.mjs} +573 -352
  10. package/dist/.setup/{channel-meta-C443t-lI.mjs → channel-meta-C5vsCo3a.mjs} +1 -2
  11. package/dist/.setup/{channel-type-BEFP2ORi.mjs → channel-type-9Lw6yLf2.mjs} +6 -11
  12. package/dist/.setup/{channel.setup-u6QQdbTa.mjs → channel.setup-BlgXNuCJ.mjs} +19 -23
  13. package/dist/.setup/{config-schema-DNnh6bWU.mjs → config-schema-Bx1tCZB0.mjs} +5 -11
  14. package/dist/.setup/cursor-pages-jVn3Vkfi.mjs +309 -0
  15. package/dist/.setup/{directory-config-Cjj0N8R0.mjs → directory-config-CGvKYg9F.mjs} +5 -6
  16. package/dist/.setup/{directory-live-BIKD-5B_.mjs → directory-live-DNdw97LA.mjs} +6 -7
  17. package/dist/.setup/{doctor-contract-Cd4-VzIM.mjs → doctor-contract-BB2KJ9Ni.mjs} +44 -58
  18. package/dist/.setup/{message-tool-api-BS5ekEA_.mjs → message-tool-api-B38BpEaE.mjs} +7 -8
  19. package/dist/.setup/{monitor-BFilOuM_.mjs → monitor-BD86SotB.mjs} +3416 -3750
  20. package/dist/.setup/{outbound-adapter-9dbnYtL1.mjs → outbound-adapter-BH6iPWBj.mjs} +32 -39
  21. package/dist/.setup/paths-CQZI_5WY.mjs +7 -0
  22. package/dist/.setup/{pipeline.runtime-BG5swHnj.mjs → pipeline.runtime-C4ELxaRU.mjs} +444 -590
  23. package/dist/.setup/{policy-yhn48xf5.mjs → policy-C6_DdlSf.mjs} +3 -6
  24. package/dist/.setup/{session-status-Dv8wNBEt.mjs → probe-B_Ax1vS1.mjs} +1015 -678
  25. package/dist/.setup/question-delivery-D3qAIwuv.mjs +38 -0
  26. package/dist/.setup/{relay-source-oY9SbDiX.mjs → relay-source-a8jodKuO.mjs} +12 -6
  27. package/dist/.setup/{replies-CJwjTqDr.mjs → replies-Bq7n0gfM.mjs} +37 -24
  28. package/dist/.setup/{reply-blocks-Ca-raz2z.mjs → reply-blocks-DyYYRrP_.mjs} +202 -210
  29. package/dist/.setup/{resolve-channels-DRRhElwz.mjs → resolve-channels-CF2JME9q.mjs} +6 -10
  30. package/dist/.setup/{resolve-users-Cz8e17ky.mjs → resolve-users-DDcCAjH1.mjs} +10 -19
  31. package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
  32. package/dist/.setup/{runtime-JSVZSWAj.mjs → runtime-C6HKn7Av.mjs} +1 -2
  33. package/dist/.setup/runtime-setter-api-DrXr965r.mjs +2 -0
  34. package/dist/.setup/{scopes-DfQVi8Jw.mjs → scopes-CzHC_dwV.mjs} +3 -3
  35. package/dist/.setup/{secret-contract-B-Qm6aQQ.mjs → secret-contract-CqVqR7MP.mjs} +5 -4
  36. package/dist/.setup/{secret-contract-api-DB6CMdgc.mjs → secret-contract-api-DaCXZ47j.mjs} +1 -1
  37. package/dist/.setup/{security-audit-DFGiFLqd.mjs → security-audit-C3hXCfDt.mjs} +2 -3
  38. package/dist/.setup/{send-C-8wY0lK.mjs → send-WJZ73VSf.mjs} +306 -349
  39. package/dist/.setup/{send-results-eeOu_HYm.mjs → send-results-Bm6V1ekL.mjs} +4 -6
  40. package/dist/.setup/setup-plugin-api-DJXIB8CF.mjs +2 -0
  41. package/dist/.setup/{setup-surface-9WVQgYCT.mjs → setup-surface-uIqP2B0Y.mjs} +6 -8
  42. package/dist/.setup/{slash-dispatch.runtime-v5kQqJPh.mjs → slash-dispatch.runtime-Cwuwv7FL.mjs} +2 -2
  43. package/dist/.setup/{target-parsing-FFE26kOV.mjs → target-parsing-DwYAP3ts.mjs} +2 -4
  44. package/dist/.setup/{targets-C6LZQL1Q.mjs → targets-eeOxA_b_.mjs} +2 -3
  45. package/dist/.setup/{thread-ts-Cvt7WD6B.mjs → thread-ts-47Au2-Yn.mjs} +1 -2
  46. package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -0
  47. package/dist/account-inspect-api.js +2 -3
  48. package/dist/api.js +17 -18
  49. package/dist/channel-config-api.js +1 -1
  50. package/dist/channel-entry.js +1 -2
  51. package/dist/channel-plugin-api.js +1 -1
  52. package/dist/configured-state.js +2 -3
  53. package/dist/directory-contract-api.js +1 -1
  54. package/dist/doctor-contract-api.js +1 -1
  55. package/dist/index.js +1 -8
  56. package/dist/message-tool-api.js +1 -1
  57. package/dist/runtime-api.js +11 -13
  58. package/dist/runtime-setter-api.js +1 -1
  59. package/dist/secret-contract-api.js +1 -1
  60. package/dist/security-contract-api.js +1 -1
  61. package/dist/setup-entry.js +4 -5
  62. package/dist/setup-plugin-api.js +1 -1
  63. package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
  64. package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
  65. package/node_modules/@slack/bolt/node_modules/@types/node/util.d.ts +6 -3
  66. package/node_modules/@slack/bolt/node_modules/content-disposition/README.md +105 -35
  67. package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.d.ts +72 -0
  68. package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js +388 -0
  69. package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js.map +1 -0
  70. package/node_modules/@slack/bolt/node_modules/content-disposition/package.json +31 -19
  71. package/node_modules/@slack/bolt/node_modules/content-type/README.md +34 -57
  72. package/node_modules/@slack/bolt/node_modules/content-type/package.json +35 -25
  73. package/node_modules/@slack/bolt/node_modules/express/Readme.md +15 -9
  74. package/node_modules/@slack/bolt/node_modules/express/lib/application.js +2 -2
  75. package/node_modules/@slack/bolt/node_modules/express/lib/request.js +32 -19
  76. package/node_modules/@slack/bolt/node_modules/express/lib/response.js +27 -30
  77. package/node_modules/@slack/bolt/node_modules/express/package.json +10 -10
  78. package/node_modules/@slack/bolt/node_modules/qs/.github/THREAT_MODEL.md +4 -2
  79. package/node_modules/@slack/bolt/node_modules/qs/CHANGELOG.md +38 -14
  80. package/node_modules/@slack/bolt/node_modules/qs/README.md +31 -3
  81. package/node_modules/@slack/bolt/node_modules/qs/dist/qs.js +20 -20
  82. package/node_modules/@slack/bolt/node_modules/qs/lib/parse.js +94 -4
  83. package/node_modules/@slack/bolt/node_modules/qs/lib/stringify.js +4 -4
  84. package/node_modules/@slack/bolt/node_modules/qs/lib/utils.js +130 -6
  85. package/node_modules/@slack/bolt/node_modules/qs/package.json +4 -4
  86. package/node_modules/@slack/bolt/node_modules/qs/test/parse.js +174 -0
  87. package/node_modules/@slack/bolt/node_modules/qs/test/stringify.js +263 -33
  88. package/node_modules/@slack/bolt/node_modules/qs/test/utils.js +184 -0
  89. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  90. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  91. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +6 -3
  92. package/node_modules/typebox/build/format/duration.d.mts +2 -2
  93. package/node_modules/typebox/build/format/duration.mjs +2 -2
  94. package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
  95. package/node_modules/typebox/build/format/idn_email.mjs +1 -0
  96. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
  97. package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
  98. package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
  99. package/node_modules/typebox/build/format/ipv4.mjs +2 -2
  100. package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
  101. package/node_modules/typebox/build/format/ipv6.mjs +1 -1
  102. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  103. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  104. package/node_modules/typebox/build/schema/build.mjs +1 -0
  105. package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
  106. package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
  107. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
  108. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
  109. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
  110. package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
  111. package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
  112. package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
  113. package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
  114. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
  115. package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
  116. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  117. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
  118. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
  119. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  120. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  121. package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
  122. package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
  123. package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
  124. package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
  125. package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
  126. package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
  127. package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
  128. package/node_modules/typebox/build/system/memory/create.mjs +18 -13
  129. package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
  130. package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
  131. package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
  132. package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
  133. package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
  134. package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
  135. package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
  136. package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
  137. package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
  138. package/node_modules/typebox/build/system/memory/update.mjs +43 -16
  139. package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
  140. package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
  141. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
  142. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
  143. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
  144. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
  145. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
  146. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
  147. package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
  148. package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
  149. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
  150. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
  151. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
  152. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
  153. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
  154. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  155. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
  156. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
  157. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
  158. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
  159. package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
  160. package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
  161. package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
  162. package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
  163. package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
  164. package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
  165. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
  166. package/node_modules/typebox/package.json +1 -1
  167. package/node_modules/typebox/readme.md +1 -1
  168. package/node_modules/undici/README.md +25 -3
  169. package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  170. package/node_modules/undici/docs/docs/api/Client.md +11 -6
  171. package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
  172. package/node_modules/undici/docs/docs/api/Errors.md +76 -1
  173. package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  174. package/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
  175. package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  176. package/node_modules/undici/docs/docs/index.md +12 -12
  177. package/node_modules/undici/docs/docs/type-map.json +66 -66
  178. package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  179. package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  180. package/node_modules/undici/lib/core/connect.js +10 -4
  181. package/node_modules/undici/lib/core/constants.js +12 -1
  182. package/node_modules/undici/lib/core/errors.js +38 -1
  183. package/node_modules/undici/lib/core/request.js +16 -1
  184. package/node_modules/undici/lib/core/symbols.js +2 -0
  185. package/node_modules/undici/lib/core/util.js +26 -1
  186. package/node_modules/undici/lib/dispatcher/agent.js +6 -2
  187. package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
  188. package/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
  189. package/node_modules/undici/lib/dispatcher/client.js +4 -1
  190. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  191. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  192. package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  193. package/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
  194. package/node_modules/undici/lib/dispatcher/pool.js +11 -8
  195. package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
  196. package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  197. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  198. package/node_modules/undici/lib/handler/cache-handler.js +153 -15
  199. package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
  200. package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
  201. package/node_modules/undici/lib/handler/retry-handler.js +44 -11
  202. package/node_modules/undici/lib/interceptor/cache.js +11 -3
  203. package/node_modules/undici/lib/interceptor/decompress.js +22 -9
  204. package/node_modules/undici/lib/interceptor/dns.js +11 -0
  205. package/node_modules/undici/lib/interceptor/response-error.js +72 -28
  206. package/node_modules/undici/lib/milo/LICENSE.md +7 -0
  207. package/node_modules/undici/lib/milo/no-simd.js +1002 -0
  208. package/node_modules/undici/lib/milo/simd.js +1002 -0
  209. package/node_modules/undici/lib/mock/mock-agent.js +11 -0
  210. package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  211. package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  212. package/node_modules/undici/lib/util/cache.js +11 -5
  213. package/node_modules/undici/lib/web/cookies/util.js +19 -2
  214. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  215. package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
  216. package/node_modules/undici/lib/web/fetch/body.js +47 -38
  217. package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  218. package/node_modules/undici/lib/web/fetch/headers.js +2 -2
  219. package/node_modules/undici/lib/web/fetch/index.js +8 -4
  220. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  221. package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
  222. package/node_modules/undici/package.json +9 -7
  223. package/node_modules/undici/types/api.d.ts +1 -1
  224. package/node_modules/undici/types/cache-interceptor.d.ts +10 -0
  225. package/node_modules/undici/types/client.d.ts +10 -4
  226. package/node_modules/undici/types/errors.d.ts +16 -1
  227. package/node_modules/undici/types/h2c-client.d.ts +1 -1
  228. package/node_modules/undici/types/interceptors.d.ts +6 -1
  229. package/node_modules/undici/types/utility.d.ts +4 -4
  230. package/node_modules/zod/package.json +1 -1
  231. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  232. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  233. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  234. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  235. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  236. package/node_modules/zod/src/v4/core/util.ts +13 -0
  237. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  238. package/node_modules/zod/v4/core/compile.cjs +8 -0
  239. package/node_modules/zod/v4/core/compile.js +8 -0
  240. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  241. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  242. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  243. package/node_modules/zod/v4/core/schemas.js +30 -0
  244. package/node_modules/zod/v4/core/util.cjs +15 -0
  245. package/node_modules/zod/v4/core/util.d.cts +2 -0
  246. package/node_modules/zod/v4/core/util.d.ts +2 -0
  247. package/node_modules/zod/v4/core/util.js +14 -0
  248. package/node_modules/zod/v4/core/versions.cjs +1 -1
  249. package/node_modules/zod/v4/core/versions.js +1 -1
  250. package/openclaw.plugin.json +6 -30
  251. package/package.json +7 -7
  252. package/dist/.setup/action-runtime.runtime-Ck_j1YTn.mjs +0 -1
  253. package/dist/.setup/http-C9sM-FXe.mjs +0 -2
  254. package/dist/.setup/plugin-routes-D4qozHVn.mjs +0 -22
  255. package/dist/.setup/probe-IiHogLQN.mjs +0 -694
  256. package/dist/.setup/registry-DizWcnNp.mjs +0 -36
  257. package/dist/.setup/runtime-setter-api-Cx_PV-xu.mjs +0 -2
  258. package/dist/.setup/setup-plugin-api-B18kDKtr.mjs +0 -2
  259. package/dist/.setup/shared-DpHCoKy2.mjs +0 -259
  260. package/dist/.source-module-urls/562d694877afe9d9dcbb3b32a8883c16974738f2aa892c48d45572cdc9a62529.json +0 -1
  261. package/dist/http-routes-api.js +0 -1
  262. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/LICENSE +0 -22
  263. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +0 -71
  264. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +0 -52
  265. package/node_modules/@slack/bolt/node_modules/content-disposition/index.js +0 -536
  266. package/node_modules/@slack/bolt/node_modules/content-type/HISTORY.md +0 -29
  267. package/node_modules/@slack/bolt/node_modules/content-type/index.js +0 -225
  268. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +0 -22
  269. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +0 -71
  270. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +0 -46
  271. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +0 -176
  272. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +0 -1
  273. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +0 -52
  274. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/LICENSE +0 -22
  275. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +0 -71
  276. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +0 -46
  277. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +0 -176
  278. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +0 -1
  279. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +0 -52
  280. package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
  281. package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
  282. /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.d.ts +0 -0
  283. /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js +0 -0
  284. /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js.map +0 -0
@@ -1,694 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
- import { p as formatSlackBotTokenIdentityWarning } from "./accounts-msihSF3-.mjs";
3
- import { a as parseSlackTarget } from "./target-parsing-FFE26kOV.mjs";
4
- import { createRequire } from "node:module";
5
- import { isRecord, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
- import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
7
- import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
8
- import { normalizeHyphenSlug, normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
9
- import { compileAllowlist, resolveCompiledAllowlistMatch } from "openclaw/plugin-sdk/allow-from";
10
- import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
11
- import { hash } from "node:crypto";
12
- import { WebAPIRateLimitedError, WebClient } from "@slack/web-api";
13
- import { addActiveManagedProxyTlsOptions, captureChannelReadAuthority, captureEffectAuthority, createHttp1EnvHttpProxyAgent, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
14
- import { isDebugProxyGlobalFetchPatchInstalled } from "openclaw/plugin-sdk/proxy-capture";
15
- import { parseRetryAfterHeaderSeconds, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
16
- import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
17
- import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
18
- import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
19
- //#region extensions/slack/src/monitor/allow-list.ts
20
- const SLACK_SLUG_CACHE_MAX = 512;
21
- const SLACK_STABLE_USER_ID_RE = /^[ubw][a-z0-9]+$/;
22
- const slackSlugCache = /* @__PURE__ */ new Map();
23
- function normalizeSlackSlug(raw) {
24
- const key = raw ?? "";
25
- const cached = slackSlugCache.get(key);
26
- if (cached !== void 0) return cached;
27
- const normalized = normalizeHyphenSlug(raw);
28
- slackSlugCache.set(key, normalized);
29
- pruneMapToMaxSize(slackSlugCache, SLACK_SLUG_CACHE_MAX);
30
- return normalized;
31
- }
32
- function normalizeSlackAllowOwnerEntry(entry) {
33
- const trimmed = normalizeOptionalLowercaseString(entry);
34
- if (!trimmed || trimmed === "*") return;
35
- try {
36
- const target = parseSlackTarget(trimmed);
37
- if (target?.kind === "user" && target.teamId) return target.id.toLowerCase();
38
- } catch {
39
- return;
40
- }
41
- const withoutPrefix = trimmed.replace(/^(slack:|user:)/, "");
42
- return SLACK_STABLE_USER_ID_RE.test(withoutPrefix) ? withoutPrefix : void 0;
43
- }
44
- function resolveSlackAllowListMatch(params) {
45
- const compiledAllowList = compileAllowlist(params.allowList);
46
- const teamId = normalizeOptionalLowercaseString(params.teamId);
47
- const id = normalizeOptionalLowercaseString(params.id);
48
- const name = normalizeOptionalLowercaseString(params.name);
49
- const slug = normalizeSlackSlug(name);
50
- const scopedCandidates = [{
51
- value: teamId && id ? `team:${teamId}:user:${id}` : void 0,
52
- source: "workspace-id"
53
- }];
54
- const unscopedCandidates = [
55
- {
56
- value: id,
57
- source: "id"
58
- },
59
- {
60
- value: id ? `slack:${id}` : void 0,
61
- source: "prefixed-id"
62
- },
63
- {
64
- value: id ? `user:${id}` : void 0,
65
- source: "prefixed-user"
66
- },
67
- ...params.allowNameMatching === true ? [
68
- {
69
- value: name,
70
- source: "name"
71
- },
72
- {
73
- value: name ? `slack:${name}` : void 0,
74
- source: "prefixed-name"
75
- },
76
- {
77
- value: slug,
78
- source: "slug"
79
- }
80
- ] : []
81
- ];
82
- return resolveCompiledAllowlistMatch({
83
- compiledAllowlist: compiledAllowList,
84
- candidates: [...scopedCandidates, ...unscopedCandidates]
85
- });
86
- }
87
- function allowListMatches(params) {
88
- return resolveSlackAllowListMatch(params).allowed;
89
- }
90
- function resolveSlackUserAllowed(params) {
91
- const allowList = normalizeStringEntriesLower(params.allowList);
92
- if (allowList.length === 0) return true;
93
- return allowListMatches({
94
- allowList,
95
- teamId: params.teamId,
96
- id: params.userId,
97
- name: params.userName,
98
- allowNameMatching: params.allowNameMatching
99
- });
100
- }
101
- function resolveSlackUserAllowListForTeam(params) {
102
- const allowList = normalizeStringEntriesLower(params.allowList);
103
- const teamId = normalizeOptionalLowercaseString(params.teamId);
104
- return allowList.flatMap((entry) => {
105
- if (entry === "*") return [entry];
106
- if (!entry.startsWith("team:")) return [entry];
107
- try {
108
- const target = parseSlackTarget(entry);
109
- if (target?.kind === "user" && target.teamId?.toLowerCase() === teamId) return [entry];
110
- return params.preserveUnmatchedScopedEntries ? [entry] : [];
111
- } catch {
112
- return params.preserveUnmatchedScopedEntries ? [entry] : [];
113
- }
114
- });
115
- }
116
- //#endregion
117
- //#region extensions/slack/src/client-options.ts
118
- const SLACK_DEFAULT_RETRY_OPTIONS = {
119
- retries: 2,
120
- factor: 2,
121
- minTimeout: 500,
122
- maxTimeout: 3e3,
123
- randomize: true
124
- };
125
- const SLACK_WRITE_RETRY_OPTIONS = { retries: 0 };
126
- const SLACK_READ_TIMEOUT_MS = 3e4;
127
- const SLACK_LOOKUP_RETRY_OPTIONS = { retries: 0 };
128
- function normalizeSlackFetchInit(init) {
129
- if (init?.body !== "") return init;
130
- const { body: _body, ...rest } = init;
131
- return rest;
132
- }
133
- function resolveSlackProxyDispatcher() {
134
- const options = resolveEnvHttpProxyAgentOptions();
135
- if (!options) return;
136
- try {
137
- return createHttp1EnvHttpProxyAgent(options, void 0, process.env);
138
- } catch {
139
- return;
140
- }
141
- }
142
- let slackSocketModeUndici;
143
- /**
144
- * Load the undici copy that @slack/socket-mode opens its WebSocket with.
145
- *
146
- * Socket Mode 3 calls `new undici.WebSocket(url, { dispatcher })` with its own
147
- * undici. A dispatcher from another undici copy fails the handshake, so we must
148
- * identify whether Socket Mode can share the runtime dispatcher. The explicit
149
- * `undici/index.js` subpath keeps Bun's bare-`undici` placeholder out of the
150
- * dispatcher (the same reason the runtime loads undici this way); under Bun,
151
- * Socket Mode's bare import gets Bun's WebSocket, which does not consult a
152
- * dispatcher at all.
153
- */
154
- function loadSlackSocketModeUndici() {
155
- if (slackSocketModeUndici) return slackSocketModeUndici;
156
- const requireFromPlugin = createRequire(import.meta.url);
157
- const requireFromBolt = createRequire(requireFromPlugin.resolve("@slack/bolt/package.json"));
158
- slackSocketModeUndici = createRequire(requireFromBolt.resolve("@slack/socket-mode/package.json"))("undici/index.js");
159
- return slackSocketModeUndici;
160
- }
161
- /**
162
- * Build the env-proxy dispatcher for Socket Mode's WebSocket.
163
- *
164
- * Reuse the Web API dispatcher when both transports load the same undici copy;
165
- * its custom proxy routing supports Socket Mode's CONNECT handshake. Otherwise
166
- * build one from Socket Mode's copy. Without a proxy env, preserve the default
167
- * direct connection.
168
- */
169
- function resolveSlackSocketModeDispatcher(webApi) {
170
- const options = resolveEnvHttpProxyAgentOptions();
171
- if (!options) return;
172
- const { EnvHttpProxyAgent } = loadSlackSocketModeUndici();
173
- if (webApi instanceof EnvHttpProxyAgent) return webApi;
174
- const agentOptions = addActiveManagedProxyTlsOptions(options);
175
- try {
176
- return new EnvHttpProxyAgent(agentOptions);
177
- } catch {
178
- return;
179
- }
180
- }
181
- /** Pair each Slack monitor transport with the dispatcher from the undici copy it uses. */
182
- function resolveSlackMonitorDispatchers(mode) {
183
- const webApi = resolveSlackProxyDispatcher();
184
- const socketMode = mode === "socket" ? resolveSlackSocketModeDispatcher(webApi) : void 0;
185
- return {
186
- webApi,
187
- socketMode,
188
- close: async () => {
189
- await webApi?.close();
190
- if (socketMode !== webApi) await socketMode?.close();
191
- }
192
- };
193
- }
194
- const DIRECT_SLACK_DISPATCHER_OPTIONS = {
195
- httpProxy: "",
196
- httpsProxy: "",
197
- noProxy: "*"
198
- };
199
- /** Create a probe-owned dispatcher so timeout cleanup can retire every socket. */
200
- function createSlackProbeDispatcher(timeoutMs) {
201
- const options = resolveEnvHttpProxyAgentOptions() ?? DIRECT_SLACK_DISPATCHER_OPTIONS;
202
- try {
203
- return createHttp1EnvHttpProxyAgent(options, timeoutMs, process.env);
204
- } catch {
205
- return createHttp1EnvHttpProxyAgent(DIRECT_SLACK_DISPATCHER_OPTIONS, timeoutMs, {});
206
- }
207
- }
208
- function buildSlackFetch(dispatcher) {
209
- if (!dispatcher || isDebugProxyGlobalFetchPatchInstalled()) {
210
- const slackFetch = resolveFetch();
211
- if (!slackFetch) return;
212
- return ((input, init) => slackFetch(input, normalizeSlackFetchInit(init)));
213
- }
214
- return ((input, init) => {
215
- return fetchWithRuntimeDispatcher(input, {
216
- ...normalizeSlackFetchInit(init),
217
- dispatcher
218
- });
219
- });
220
- }
221
- function fenceSlackReadFetch(slackFetch, assertDirectAdapterHandoff) {
222
- const assertReadAuthority = captureChannelReadAuthority();
223
- const capturedEffect = captureEffectAuthority();
224
- return (input, init) => {
225
- return (capturedEffect.active ? capturedEffect : captureEffectAuthority()).initiate(() => {
226
- assertReadAuthority?.();
227
- captureChannelReadAuthority()?.();
228
- assertDirectAdapterHandoff?.();
229
- return slackFetch(input, init);
230
- });
231
- };
232
- }
233
- function resolveSlackClientOptions(input, dispatcher, assertDirectAdapterHandoff) {
234
- const options = Object.assign({}, input);
235
- const slackApiUrl = options.slackApiUrl ?? (process.env.SLACK_API_URL?.trim() || void 0);
236
- const fetch = options.fetch ?? buildSlackFetch(dispatcher);
237
- if (fetch) options.fetch = fetch;
238
- if (slackApiUrl !== void 0) options.slackApiUrl = slackApiUrl;
239
- else delete options.slackApiUrl;
240
- const slackFetch = options.fetch ?? buildSlackFetch(dispatcher);
241
- if (!slackFetch) {
242
- if (assertDirectAdapterHandoff) throw new Error("Slack request fetch is unavailable for live authority.");
243
- } else options.fetch = fenceSlackReadFetch(slackFetch, assertDirectAdapterHandoff);
244
- return options;
245
- }
246
- function resolveSlackWebClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
247
- const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
248
- resolved.retryConfig ??= SLACK_DEFAULT_RETRY_OPTIONS;
249
- return resolved;
250
- }
251
- function resolveSlackReadClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
252
- const resolved = resolveSlackWebClientOptions(options, dispatcher, assertDirectAdapterHandoff);
253
- resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
254
- return resolved;
255
- }
256
- function resolveSlackWriteClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
257
- const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
258
- resolved.retryConfig ??= SLACK_WRITE_RETRY_OPTIONS;
259
- if (resolved.rejectRateLimitedCalls !== true && resolved.retryConfig.retries === 0) {
260
- const slackFetch = resolved.fetch ?? buildSlackFetch(dispatcher);
261
- if (slackFetch) resolved.fetch = (input, init) => retryAsync(async () => {
262
- init?.signal?.throwIfAborted();
263
- const response = await slackFetch(input, init);
264
- if (response.status !== 429) return response;
265
- const retryAfter = parseRetryAfterHeaderSeconds(response.headers.get("retry-after"));
266
- response.body?.cancel().catch(() => void 0);
267
- init?.signal?.throwIfAborted();
268
- if (retryAfter === void 0 || retryAfter * 1e3 > 2147e6) return response;
269
- throw new WebAPIRateLimitedError(retryAfter);
270
- }, {
271
- attempts: 3,
272
- minDelayMs: 0,
273
- maxDelayMs: 0,
274
- shouldRetry: (error) => error instanceof WebAPIRateLimitedError,
275
- retryAfterMs: (error) => error instanceof WebAPIRateLimitedError ? error.retryAfter * 1e3 : void 0,
276
- sleep: (delayMs) => sleepWithAbort(delayMs, init?.signal)
277
- });
278
- resolved.rejectRateLimitedCalls = true;
279
- }
280
- return resolved;
281
- }
282
- function resolveSlackLookupClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
283
- const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
284
- resolved.rejectRateLimitedCalls = true;
285
- resolved.retryConfig = SLACK_LOOKUP_RETRY_OPTIONS;
286
- resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
287
- return resolved;
288
- }
289
- //#endregion
290
- //#region extensions/slack/src/monitor/lru-map-cache.ts
291
- /** LRU-touch read: move hit to newest so pruneMapToMaxSize keeps active keys. */
292
- function readLruMapEntry(cache, cacheKey) {
293
- const cached = cache.get(cacheKey);
294
- if (cached) {
295
- cache.delete(cacheKey);
296
- cache.set(cacheKey, cached);
297
- }
298
- return cached;
299
- }
300
- function writeLruMapEntry(cache, cacheKey, entry, maxEntries) {
301
- cache.delete(cacheKey);
302
- cache.set(cacheKey, entry);
303
- pruneMapToMaxSize(cache, maxEntries);
304
- }
305
- function pruneExpiredMapEntries(cache, now) {
306
- for (const [key, entry] of cache) if (entry.expiresAt <= now) cache.delete(key);
307
- }
308
- //#endregion
309
- //#region extensions/slack/src/client.ts
310
- const SLACK_WRITE_CLIENT_CACHE_MAX = 32;
311
- const SLACK_STARTUP_AUTH_TIMEOUT_MS = 1e4;
312
- const SLACK_STARTUP_AUTH_RETRY_BUDGET_MS = 35e3;
313
- const slackWriteClientCache = /* @__PURE__ */ new Map();
314
- const slackListenerWriteClientCache = /* @__PURE__ */ new WeakMap();
315
- function createSlackClientFactory(resolveOptions) {
316
- return (token, options, assertDirectAdapterHandoff) => new WebClient(token, resolveOptions(options, void 0, assertDirectAdapterHandoff));
317
- }
318
- const createSlackWebClient = createSlackClientFactory(resolveSlackWebClientOptions);
319
- const createSlackLookupClient = createSlackClientFactory(resolveSlackLookupClientOptions);
320
- const createSlackWriteClient = createSlackClientFactory(resolveSlackWriteClientOptions);
321
- function createSlackReadClient(token, options = {}, dispatcher, assertDirectAdapterHandoff) {
322
- return new WebClient(token, resolveSlackReadClientOptions(options, dispatcher, assertDirectAdapterHandoff));
323
- }
324
- function createSlackStartupAuthFetch(baseFetch) {
325
- const deadline = Date.now() + SLACK_STARTUP_AUTH_RETRY_BUDGET_MS;
326
- return async (input, init) => {
327
- const response = await baseFetch(input, init);
328
- if (response.status !== 429) return response;
329
- const retryAfter = Number.parseInt(response.headers.get("retry-after") ?? "", 10);
330
- const remainingMs = Math.max(0, deadline - Date.now());
331
- if (!Number.isFinite(retryAfter) || retryAfter * 1e3 <= remainingMs) return response;
332
- await new Promise((resolve) => {
333
- setTimeout(resolve, remainingMs);
334
- });
335
- throw new Error("Slack startup auth retry budget exhausted after rate limit");
336
- };
337
- }
338
- function createSlackStartupAuthClient(token, options = {}) {
339
- const resolvedOptions = resolveSlackWebClientOptions(options);
340
- const baseFetch = resolvedOptions.fetch;
341
- if (!baseFetch) throw new Error("Slack startup auth fetch is unavailable");
342
- return new WebClient(token, {
343
- ...resolvedOptions,
344
- fetch: createSlackStartupAuthFetch(baseFetch),
345
- retryConfig: {
346
- ...SLACK_DEFAULT_RETRY_OPTIONS,
347
- maxRetryTime: SLACK_STARTUP_AUTH_RETRY_BUDGET_MS
348
- },
349
- timeout: SLACK_STARTUP_AUTH_TIMEOUT_MS
350
- });
351
- }
352
- function createSlackTokenCacheKey(token) {
353
- return `sha256:${hash("sha256", token, "base64url")}`;
354
- }
355
- function slackWriteClientCacheKey(token, options) {
356
- return `${createSlackTokenCacheKey(token)}${options.slackApiUrl ? `:api:${options.slackApiUrl}` : ""}${options.teamId ? `:team:${options.teamId.trim().toLowerCase()}` : ""}`;
357
- }
358
- function getSlackWriteClient(token, options = {}) {
359
- if (captureEffectAuthority().active) return createSlackWriteClient(token, options);
360
- const resolvedOptions = resolveSlackWriteClientOptions(options);
361
- const tokenKey = slackWriteClientCacheKey(token, resolvedOptions);
362
- const cached = readLruMapEntry(slackWriteClientCache, tokenKey);
363
- if (cached) return cached;
364
- const client = new WebClient(token, resolvedOptions);
365
- slackWriteClientCache.set(tokenKey, client);
366
- pruneMapToMaxSize(slackWriteClientCache, SLACK_WRITE_CLIENT_CACHE_MAX);
367
- return client;
368
- }
369
- function getSlackListenerWriteClient(params) {
370
- const token = params.listenerClient.token?.trim();
371
- const teamId = params.teamId?.trim().toUpperCase();
372
- if (!token) return;
373
- const effectScoped = captureEffectAuthority().active;
374
- const cached = slackListenerWriteClientCache.get(params.listenerClient);
375
- if (cached) {
376
- if (cached.teamId !== teamId) return;
377
- if (!effectScoped && cached.client) return cached.client;
378
- }
379
- const headers = Object.fromEntries(Object.entries(params.clientOptions?.headers ?? {}).filter(([name]) => name.toLowerCase() !== "authorization"));
380
- const client = new WebClient(token, resolveSlackWriteClientOptions({
381
- ...params.clientOptions,
382
- headers,
383
- slackApiUrl: params.listenerClient.slackApiUrl,
384
- teamId,
385
- retryConfig: SLACK_WRITE_RETRY_OPTIONS,
386
- timeout: 0
387
- }));
388
- if (!effectScoped) slackListenerWriteClientCache.set(params.listenerClient, {
389
- teamId,
390
- client
391
- });
392
- else if (!cached) slackListenerWriteClientCache.set(params.listenerClient, { teamId });
393
- return client;
394
- }
395
- //#endregion
396
- //#region extensions/slack/src/cursor-pages.ts
397
- const SLACK_CURSOR_PAGE_LIMIT = 1e4;
398
- const fetchSlackChannelListPage = (client, cursor) => client.conversations.list({
399
- types: "public_channel,private_channel",
400
- exclude_archived: false,
401
- limit: 1e3,
402
- cursor
403
- });
404
- async function collectSlackCursorPages(params) {
405
- const items = [];
406
- let cursor;
407
- const seenCursors = /* @__PURE__ */ new Set();
408
- for (let pageCount = 1; pageCount <= SLACK_CURSOR_PAGE_LIMIT; pageCount += 1) {
409
- const response = await params.fetchPage(cursor);
410
- items.push(...params.collectPageItems(response));
411
- const nextCursor = response.response_metadata?.next_cursor?.trim() || void 0;
412
- if (!nextCursor) return items;
413
- if (seenCursors.has(nextCursor)) throw new Error(`Slack cursor pagination repeated a cursor after ${pageCount} pages`);
414
- seenCursors.add(nextCursor);
415
- cursor = nextCursor;
416
- }
417
- throw new Error(`Slack cursor pagination exceeded ${SLACK_CURSOR_PAGE_LIMIT} pages`);
418
- }
419
- //#endregion
420
- //#region extensions/slack/src/errors.ts
421
- const NO_ERROR_DETAIL = "no error detail";
422
- const MAX_ERROR_CAUSE_DEPTH = 32;
423
- function getSlackWebApiErrorData(error) {
424
- if (!(error instanceof Error)) return;
425
- const data = error.data;
426
- return data && typeof data === "object" ? data : void 0;
427
- }
428
- function addStringDetail(details, label, value) {
429
- if (typeof value !== "string") return;
430
- const trimmed = redactSensitiveText(value.trim());
431
- if (trimmed) details.push(label ? `${label}: ${trimmed}` : trimmed);
432
- }
433
- function addScalarDetail(details, label, value) {
434
- if (typeof value === "string") {
435
- addStringDetail(details, label, value);
436
- return;
437
- }
438
- if (typeof value === "number" || typeof value === "boolean") details.push(`${label}: ${String(value)}`);
439
- }
440
- function addStringListDetail(details, label, value) {
441
- if (!Array.isArray(value)) return;
442
- const entries = [];
443
- for (const entry of value) addStringDetail(entries, "", entry);
444
- if (entries.length) details.push(`${label}: ${entries.join(", ")}`);
445
- }
446
- function safeStringify(value) {
447
- const seen = /* @__PURE__ */ new WeakSet();
448
- try {
449
- const result = JSON.stringify(value, (_key, nested) => {
450
- if (typeof nested !== "object" || nested === null) return nested;
451
- if (seen.has(nested)) return "[Circular]";
452
- seen.add(nested);
453
- return nested;
454
- });
455
- return result ? redactSensitiveText(result) : void 0;
456
- } catch {
457
- return;
458
- }
459
- }
460
- function addSlackResponseMetadata(details, value) {
461
- if (!isRecord(value)) return;
462
- addStringListDetail(details, "scopes", value.scopes);
463
- addStringListDetail(details, "accepted", value.acceptedScopes);
464
- for (const [key, label] of [["messages", "slack message"], ["warnings", "slack warning"]]) {
465
- const entries = value[key];
466
- if (Array.isArray(entries)) for (const entry of entries) addStringDetail(details, label, entry);
467
- }
468
- }
469
- function addSlackDataDetails(details, value) {
470
- if (!isRecord(value)) return;
471
- addScalarDetail(details, "slack error", value.error);
472
- addScalarDetail(details, "needed", value.needed);
473
- addScalarDetail(details, "provided", value.provided);
474
- addSlackResponseMetadata(details, value.response_metadata);
475
- }
476
- function addRecordDetails(details, value) {
477
- addScalarDetail(details, "code", value.code);
478
- addScalarDetail(details, "status", value.status);
479
- addScalarDetail(details, "statusCode", value.statusCode);
480
- addScalarDetail(details, "statusMessage", value.statusMessage);
481
- addScalarDetail(details, "retryAfter", value.retryAfter);
482
- addScalarDetail(details, "errno", value.errno);
483
- addScalarDetail(details, "syscall", value.syscall);
484
- addScalarDetail(details, "hostname", value.hostname);
485
- addScalarDetail(details, "type", value.type);
486
- addStringDetail(details, "statusText", value.statusText);
487
- addStringDetail(details, "body", value.body);
488
- addSlackDataDetails(details, value.data);
489
- if (isRecord(value.response)) {
490
- addScalarDetail(details, "response status", value.response.status);
491
- addStringDetail(details, "response statusText", value.response.statusText);
492
- addSlackDataDetails(details, value.response.data);
493
- }
494
- }
495
- function collectSlackErrorDetails(error, seen) {
496
- const details = [];
497
- if (error === void 0 || error === null) return details;
498
- if (typeof error === "string") {
499
- addStringDetail(details, "", error);
500
- return details;
501
- }
502
- if (error instanceof Error) {
503
- addStringDetail(details, "", error.message || error.name);
504
- if (error.cause !== void 0) {
505
- const cause = formatSlackErrorWithCauses(error.cause, "", seen);
506
- if (cause) details.push(`cause: ${cause}`);
507
- }
508
- }
509
- if (isRecord(error)) {
510
- addRecordDetails(details, error);
511
- const fallback = safeStringify(error);
512
- if (details.length === 0 && fallback && fallback !== "{}") details.push(fallback);
513
- }
514
- return details;
515
- }
516
- function formatSlackErrorWithCauses(error, fallback, seen) {
517
- if (error instanceof Error) {
518
- if (seen.has(error)) return "[Circular]";
519
- if (seen.size >= MAX_ERROR_CAUSE_DEPTH) return "[Cause chain truncated]";
520
- seen.add(error);
521
- }
522
- const details = collectSlackErrorDetails(error, seen);
523
- if (details.length > 0) return details.join("; ");
524
- if (error === void 0 || error === null) return fallback;
525
- if (typeof error === "string" && !error.trim()) return fallback;
526
- return safeStringify(error) ?? fallback;
527
- }
528
- function formatSlackError(error, fallback = NO_ERROR_DETAIL) {
529
- return formatSlackErrorWithCauses(error, fallback, /* @__PURE__ */ new Set());
530
- }
531
- //#endregion
532
- //#region extensions/slack/src/monitor/ingress-identity.ts
533
- const SLACK_USER_NAME_KIND = "plugin:slack-user-name";
534
- const SLACK_WORKSPACE_USER_ID_KIND = "plugin:slack-workspace-user-id";
535
- function normalizeSlackUserId(raw) {
536
- const value = (raw ?? "").trim().toLowerCase();
537
- if (!value) return "";
538
- const mention = value.match(/^<@([a-z0-9_]+)>$/i);
539
- if (mention?.[1]) return mention[1];
540
- return value.replace(/^(slack:|user:)/, "");
541
- }
542
- function isSlackStableUserId(value) {
543
- return /^[ubw][a-z0-9_]+$/i.test(value);
544
- }
545
- function normalizeSlackWorkspaceUserEntry(entry) {
546
- const normalized = entry.trim().toLowerCase();
547
- if (!normalized) return null;
548
- try {
549
- const target = parseSlackTarget(normalized);
550
- if (target?.kind === "user" && target.teamId) return target.normalized;
551
- } catch {
552
- return null;
553
- }
554
- return null;
555
- }
556
- function normalizeSlackBareUserEntry(entry) {
557
- const normalized = entry.trim().toLowerCase();
558
- if (!normalized || normalizeSlackWorkspaceUserEntry(normalized)) return null;
559
- const userId = normalizeSlackUserId(normalized);
560
- return isSlackStableUserId(userId) ? userId : null;
561
- }
562
- function normalizeSlackStableEntry(entry) {
563
- return normalizeSlackBareUserEntry(entry) ?? normalizeSlackWorkspaceUserEntry(entry);
564
- }
565
- function normalizeSlackNameEntry(entry) {
566
- const normalized = entry.trim().toLowerCase();
567
- if (!normalized || normalizeSlackStableEntry(normalized)) return null;
568
- return normalized.replace(/^slack:/, "") || null;
569
- }
570
- function normalizeSlackNameSubject(value) {
571
- return value.trim().toLowerCase() || null;
572
- }
573
- function normalizeSlackNameSlugEntry(entry) {
574
- const name = normalizeSlackNameEntry(entry);
575
- if (!name) return null;
576
- return normalizeSlackSlug(name) || null;
577
- }
578
- const slackIngressIdentity = defineStableChannelIngressIdentity({
579
- resolveParticipant: (subject) => {
580
- const qualified = subject.aliases?.workspaceSenderId;
581
- if (typeof qualified !== "string") return;
582
- const normalized = normalizeSlackWorkspaceUserEntry(qualified);
583
- const target = normalized ? parseSlackTarget(normalized) : void 0;
584
- return target?.teamId ? {
585
- domain: target.teamId,
586
- idKind: target.id.startsWith("b") ? "bot-id" : "user-id",
587
- id: target.id
588
- } : void 0;
589
- },
590
- key: "senderId",
591
- kind: "stable-id",
592
- authentication: "asserted",
593
- normalizeEntry: normalizeSlackBareUserEntry,
594
- normalizeSubject: normalizeSlackUserId,
595
- sensitivity: "pii",
596
- aliases: [{
597
- key: "workspaceSenderId",
598
- kind: SLACK_WORKSPACE_USER_ID_KIND,
599
- authentication: "asserted",
600
- normalizeEntry: normalizeSlackWorkspaceUserEntry,
601
- normalizeSubject: normalizeSlackWorkspaceUserEntry,
602
- sensitivity: "pii"
603
- }, ...[["senderName", normalizeSlackNameEntry], ["senderNameSlug", normalizeSlackNameSlugEntry]].map(([key, normalizeEntry]) => ({
604
- key,
605
- kind: SLACK_USER_NAME_KIND,
606
- normalizeEntry,
607
- normalizeSubject: normalizeSlackNameSubject,
608
- authentication: "mutable",
609
- sensitivity: "pii"
610
- }))]
611
- });
612
- function createSlackIngressSubject(params) {
613
- const senderId = normalizeSlackUserId(params.senderId);
614
- const teamId = normalizeOptionalLowercaseString(params.teamId);
615
- const senderName = params.senderName?.trim().toLowerCase();
616
- const senderNameSlug = senderName ? normalizeSlackSlug(senderName) : void 0;
617
- return {
618
- stableId: params.senderId,
619
- authentication: {
620
- senderId: params.senderAuthentication ?? "asserted",
621
- workspaceSenderId: params.senderAuthentication ?? "asserted",
622
- senderName: "mutable",
623
- senderNameSlug: "mutable"
624
- },
625
- aliases: {
626
- workspaceSenderId: teamId && senderId ? `team:${teamId}:user:${senderId}` : void 0,
627
- senderName,
628
- senderNameSlug
629
- }
630
- };
631
- }
632
- //#endregion
633
- //#region extensions/slack/src/probe.ts
634
- var probe_exports = /* @__PURE__ */ __exportAll({ probeSlack: () => probeSlack });
635
- async function probeSlack(token, timeoutMs = 2500, opts) {
636
- const dispatcher = createSlackProbeDispatcher(timeoutMs);
637
- const client = createSlackReadClient(token, {
638
- rejectRateLimitedCalls: true,
639
- retryConfig: { retries: 0 },
640
- timeout: timeoutMs
641
- }, dispatcher);
642
- const probeResult = runChannelProbe(timeoutMs, async () => {
643
- const result = await client.auth.test();
644
- if (!result.ok) return {
645
- ok: false,
646
- status: 200,
647
- error: result.error ?? "unknown"
648
- };
649
- const userIdentity = opts?.identity === "user";
650
- let userId = result.user_id;
651
- if (userIdentity) {
652
- if (result.bot_id?.trim()) return {
653
- ok: false,
654
- status: 200,
655
- error: "Slack auth.test identified a bot token; user identity requires a user OAuth token"
656
- };
657
- userId = result.user_id?.trim();
658
- if (!userId) return {
659
- ok: false,
660
- status: 200,
661
- error: "Slack auth.test returned no human user_id for user identity"
662
- };
663
- }
664
- const warning = userIdentity ? void 0 : formatSlackBotTokenIdentityWarning({
665
- auth: result,
666
- accountId: opts?.accountId
667
- });
668
- const authIdentity = {
669
- id: userId,
670
- name: result.user
671
- };
672
- return {
673
- ok: true,
674
- status: 200,
675
- ...userIdentity ? { user: authIdentity } : { bot: authIdentity },
676
- team: {
677
- id: result.team_id,
678
- name: result.team
679
- },
680
- ...warning ? { warning } : {}
681
- };
682
- }, (error) => ({
683
- ok: false,
684
- status: typeof error.statusCode === "number" ? error.statusCode : null,
685
- error: formatSlackError(error)
686
- }));
687
- try {
688
- return await probeResult;
689
- } finally {
690
- await dispatcher.destroy().catch(() => void 0);
691
- }
692
- }
693
- //#endregion
694
- export { resolveSlackAllowListMatch as A, resolveSlackLookupClientOptions as C, allowListMatches as D, resolveSlackWriteClientOptions as E, resolveSlackUserAllowed as M, normalizeSlackAllowOwnerEntry as O, SLACK_WRITE_RETRY_OPTIONS as S, resolveSlackWebClientOptions as T, getSlackWriteClient as _, slackIngressIdentity as a, writeLruMapEntry as b, collectSlackCursorPages as c, createSlackReadClient as d, createSlackStartupAuthClient as f, getSlackListenerWriteClient as g, createSlackWriteClient as h, createSlackIngressSubject as i, resolveSlackUserAllowListForTeam as j, normalizeSlackSlug as k, fetchSlackChannelListPage as l, createSlackWebClient as m, probe_exports as n, formatSlackError as o, createSlackTokenCacheKey as p, SLACK_USER_NAME_KIND as r, getSlackWebApiErrorData as s, probeSlack as t, createSlackLookupClient as u, pruneExpiredMapEntries as v, resolveSlackMonitorDispatchers as w, SLACK_DEFAULT_RETRY_OPTIONS as x, readLruMapEntry as y };