@openclaw/slack 2026.9.6 → 2026.9.7
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.
- package/assets/icon.png +0 -0
- package/dist/.setup/{account-inspect-DP1Bcwj4.mjs → account-inspect-DWBXpER6.mjs} +1 -1
- package/dist/.setup/{accounts-BBHvg0pY.mjs → accounts-D_N9IqNA.mjs} +23 -1
- package/dist/.setup/{action-runtime-B01d85zt.mjs → action-runtime-DfWvuiZd.mjs} +26 -41
- package/dist/.setup/action-runtime.runtime-Ck4bAWOX.mjs +2 -0
- package/dist/.setup/{actions-DKCtBgCI.mjs → actions-Df0CzcDl.mjs} +88 -175
- package/dist/.setup/{approval-handler.runtime-DMszKn_7.mjs → approval-handler.runtime-Ed6Sw5VK.mjs} +37 -47
- package/dist/.setup/{approval-message-updates-Tb_qRokK.mjs → approval-message-updates-BadvtA7R.mjs} +1 -2
- package/dist/.setup/{channel-CErYZ5zw.mjs → channel-C7bgPSTE.mjs} +181 -273
- package/dist/.setup/channel-meta-C443t-lI.mjs +27 -0
- package/dist/.setup/{channel-type-Dxk8VJUb.mjs → channel-type-ClOttrZ5.mjs} +13 -21
- package/dist/.setup/{channel.setup-BVoUtdPn.mjs → channel.setup-Dh2jzAjN.mjs} +35 -42
- package/dist/.setup/{config-schema-CyL279e7.mjs → config-schema-BZCxmHKG.mjs} +24 -21
- package/dist/.setup/{directory-config-CQTSH45W.mjs → directory-config-BOUWH3hR.mjs} +7 -10
- package/dist/.setup/{directory-live-BCcj89QV.mjs → directory-live-B2O4B_Ho.mjs} +9 -21
- package/dist/.setup/doctor-contract-CRN1Z_c7.mjs +342 -0
- package/dist/.setup/{message-tool-api-C0PTFaNV.mjs → message-tool-api-Cu4lwlGy.mjs} +34 -48
- package/dist/.setup/{provider-C-jPaGt2.mjs → monitor-BPVfkumU.mjs} +2181 -2693
- package/dist/.setup/{outbound-adapter-A7Wdn8ZT.mjs → outbound-adapter-Bv48XUjq.mjs} +10 -21
- package/dist/.setup/{pipeline.runtime-BlPOexmJ.mjs → pipeline.runtime-B1H63Frf.mjs} +311 -457
- package/dist/.setup/{plugin-routes-C3X0eVaK.mjs → plugin-routes-B8tooDLj.mjs} +1 -1
- package/dist/.setup/{policy-BApW53pI.mjs → policy-D-jfM174.mjs} +5 -5
- package/dist/.setup/{probe-DiYIMPJo.mjs → probe-B2Y9qc_z.mjs} +101 -39
- package/dist/.setup/{registry-bbjH7IHX.mjs → registry-CIbMfuf8.mjs} +6 -2
- package/dist/.setup/{relay-source-DfOnjJTE.mjs → relay-source-BpKdjsll.mjs} +10 -12
- package/dist/.setup/{replies-BBAJxUOQ.mjs → replies-BAnUtr2f.mjs} +16 -76
- package/dist/.setup/{reply-blocks-Bm8kf6mK.mjs → reply-blocks-SE1kTE3I.mjs} +27 -154
- package/dist/.setup/{resolve-channels-BXbMBbJD.mjs → resolve-channels-XXBn8UU_.mjs} +4 -5
- package/dist/.setup/{resolve-users-65WqvIqD.mjs → resolve-users-DW0ngD03.mjs} +20 -22
- package/dist/.setup/{scopes-h3YB-mMs.mjs → scopes-CasuDvaa.mjs} +6 -17
- package/dist/.setup/{secret-contract-DxmvbxBF.mjs → secret-contract-BaZcu6P_.mjs} +15 -20
- package/dist/.setup/{secret-contract-api-D9UfYujm.mjs → secret-contract-api-Dp6290Vg.mjs} +1 -1
- package/dist/.setup/{security-audit-BypHqcq5.mjs → security-audit-BqDc-6VL.mjs} +1 -1
- package/dist/.setup/{send-Cp6omkOg.mjs → send-BOVLQi3n.mjs} +84 -171
- package/dist/.setup/{session-status-Cf7AvWOt.mjs → session-status-DscajIsd.mjs} +315 -238
- package/dist/.setup/{setup-plugin-api-dLPkL06L.mjs → setup-plugin-api-DTtbTKNk.mjs} +1 -1
- package/dist/.setup/{setup-surface-D3DLcCxu.mjs → setup-surface-Dn7QgWRE.mjs} +24 -56
- package/dist/.setup/{shared-CJ3arAFL.mjs → shared-qau-uDGl.mjs} +30 -56
- package/dist/.setup/{slash-dispatch.runtime-HFy_XvyO.mjs → slash-dispatch.runtime--AEzLVBF.mjs} +1 -1
- package/dist/.setup/{streaming-compat-B-e0mqM0.mjs → streaming-compat-C5Wut626.mjs} +31 -8
- package/dist/.setup/{target-parsing-DEsPjngB.mjs → target-parsing-FFE26kOV.mjs} +1 -7
- package/dist/.setup/{targets-Cku2KCvg.mjs → targets-C6LZQL1Q.mjs} +1 -1
- package/dist/.setup/{thread-ts-CukseRVL.mjs → thread-ts-Cvt7WD6B.mjs} +0 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/api.js +18 -17
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/http-routes-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +11 -12
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +20 -8
- package/node_modules/@slack/bolt/node_modules/@types/node/ffi.d.ts +14 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/http2.d.ts +3 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/net.d.ts +16 -4
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/process.d.ts +1 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/quic.d.ts +39 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/stream/iter.d.ts +9 -12
- package/node_modules/@slack/bolt/node_modules/@types/node/test/reporters.d.ts +1 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/test.d.ts +72 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/tls.d.ts +14 -10
- package/node_modules/@slack/bolt/node_modules/@types/node/vm.d.ts +2 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/worker_threads.d.ts +4 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +20 -8
- package/node_modules/@slack/web-api/node_modules/@types/node/ffi.d.ts +14 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +3 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +16 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/quic.d.ts +39 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/iter.d.ts +9 -12
- package/node_modules/@slack/web-api/node_modules/@types/node/test/reporters.d.ts +1 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +72 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +14 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +2 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +4 -1
- package/node_modules/get-east-asian-width/index.js +8 -3
- package/node_modules/get-east-asian-width/lookup-data.js +1 -1
- package/node_modules/get-east-asian-width/lookup.js +4 -4
- package/node_modules/get-east-asian-width/package.json +1 -1
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/node_modules/undici/README.md +81 -25
- package/node_modules/undici/docs/docs/api/Agent.md +249 -42
- package/node_modules/undici/docs/docs/api/BalancedPool.md +246 -48
- package/node_modules/undici/docs/docs/api/CacheStorage.md +171 -13
- package/node_modules/undici/docs/docs/api/CacheStore.md +294 -98
- package/node_modules/undici/docs/docs/api/Client.md +407 -162
- package/node_modules/undici/docs/docs/api/ClientStats.md +80 -14
- package/node_modules/undici/docs/docs/api/Connector.md +118 -35
- package/node_modules/undici/docs/docs/api/ContentType.md +65 -25
- package/node_modules/undici/docs/docs/api/Cookies.md +122 -71
- package/node_modules/undici/docs/docs/api/Debug.md +34 -18
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +364 -164
- package/node_modules/undici/docs/docs/api/Dispatcher.md +490 -1055
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +105 -93
- package/node_modules/undici/docs/docs/api/Errors.md +503 -28
- package/node_modules/undici/docs/docs/api/EventSource.md +326 -13
- package/node_modules/undici/docs/docs/api/Fetch.md +681 -30
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +78 -96
- package/node_modules/undici/docs/docs/api/H2CClient.md +298 -176
- package/node_modules/undici/docs/docs/api/Interceptors.md +418 -0
- package/node_modules/undici/docs/docs/api/MockAgent.md +333 -314
- package/node_modules/undici/docs/docs/api/MockCallHistory.md +272 -98
- package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +189 -26
- package/node_modules/undici/docs/docs/api/MockClient.md +151 -33
- package/node_modules/undici/docs/docs/api/MockErrors.md +56 -5
- package/node_modules/undici/docs/docs/api/MockPool.md +321 -258
- package/node_modules/undici/docs/docs/api/Pool.md +236 -41
- package/node_modules/undici/docs/docs/api/PoolStats.md +119 -13
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +179 -160
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +238 -55
- package/node_modules/undici/docs/docs/api/RetryAgent.md +113 -27
- package/node_modules/undici/docs/docs/api/RetryHandler.md +161 -79
- package/node_modules/undici/docs/docs/api/RoundRobinPool.md +166 -72
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +262 -517
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +177 -196
- package/node_modules/undici/docs/docs/api/Util.md +68 -11
- package/node_modules/undici/docs/docs/api/WebSocket.md +475 -80
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +100 -32
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +2 -0
- package/node_modules/undici/docs/docs/best-practices/crawling.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +233 -0
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +9 -7
- package/node_modules/undici/docs/docs/best-practices/proxy.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +10 -8
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +2 -0
- package/node_modules/undici/docs/docs/getting-started.md +281 -0
- package/node_modules/undici/docs/docs/index.md +784 -0
- package/node_modules/undici/docs/docs/site.json +125 -0
- package/node_modules/undici/docs/docs/type-map.json +79 -0
- package/node_modules/undici/index.js +4 -2
- package/node_modules/undici/lib/api/api-connect.js +13 -11
- package/node_modules/undici/lib/api/api-pipeline.js +26 -13
- package/node_modules/undici/lib/api/api-request.js +51 -21
- package/node_modules/undici/lib/api/api-stream.js +81 -20
- package/node_modules/undici/lib/api/api-upgrade.js +21 -11
- package/node_modules/undici/lib/api/readable.js +45 -9
- package/node_modules/undici/lib/cache/memory-cache-store.js +3 -3
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +3 -1
- package/node_modules/undici/lib/core/connect.js +46 -7
- package/node_modules/undici/lib/core/constants.js +1 -24
- package/node_modules/undici/lib/core/errors.js +22 -2
- package/node_modules/undici/lib/core/request.js +100 -18
- package/node_modules/undici/lib/core/symbols.js +4 -0
- package/node_modules/undici/lib/core/util.js +105 -48
- package/node_modules/undici/lib/dispatcher/agent.js +51 -32
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +23 -27
- package/node_modules/undici/lib/dispatcher/client-h1.js +86 -24
- package/node_modules/undici/lib/dispatcher/client-h2.js +1091 -361
- package/node_modules/undici/lib/dispatcher/client.js +109 -36
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +19 -6
- package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -5
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +110 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
- package/node_modules/undici/lib/dispatcher/h2c-client.js +4 -4
- package/node_modules/undici/lib/dispatcher/pool-base.js +28 -10
- package/node_modules/undici/lib/dispatcher/pool.js +30 -5
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +95 -19
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +32 -10
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +153 -63
- package/node_modules/undici/lib/global.js +37 -14
- package/node_modules/undici/lib/handler/cache-handler.js +49 -7
- package/node_modules/undici/lib/handler/cache-revalidation-handler.js +10 -0
- package/node_modules/undici/lib/handler/decorator-handler.js +8 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/undici/lib/handler/redirect-handler.js +66 -66
- package/node_modules/undici/lib/handler/retry-handler.js +191 -50
- package/node_modules/undici/lib/interceptor/cache.js +75 -25
- package/node_modules/undici/lib/interceptor/decompress.js +5 -2
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +12 -1
- package/node_modules/undici/lib/interceptor/redirect.js +3 -3
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -1
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -1
- package/node_modules/undici/lib/mock/mock-agent.js +21 -9
- package/node_modules/undici/lib/mock/mock-call-history.js +1 -1
- package/node_modules/undici/lib/mock/mock-interceptor.js +25 -7
- package/node_modules/undici/lib/mock/mock-utils.js +281 -47
- package/node_modules/undici/lib/mock/snapshot-agent.js +25 -7
- package/node_modules/undici/lib/mock/snapshot-recorder.js +38 -3
- package/node_modules/undici/lib/util/cache.js +92 -10
- package/node_modules/undici/lib/util/runtime-features.js +3 -34
- package/node_modules/undici/lib/web/cache/cache.js +6 -8
- package/node_modules/undici/lib/web/cookies/parse.js +150 -146
- package/node_modules/undici/lib/web/cookies/util.js +1 -1
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +20 -21
- package/node_modules/undici/lib/web/eventsource/util.js +32 -1
- package/node_modules/undici/lib/web/fetch/body.js +48 -10
- package/node_modules/undici/lib/web/fetch/constants.js +1 -1
- package/node_modules/undici/lib/web/fetch/formdata.js +21 -2
- package/node_modules/undici/lib/web/fetch/index.js +242 -223
- package/node_modules/undici/lib/web/fetch/request.js +35 -6
- package/node_modules/undici/lib/web/fetch/response.js +1 -3
- package/node_modules/undici/lib/web/fetch/util.js +10 -2
- package/node_modules/undici/lib/web/webidl/index.js +5 -7
- package/node_modules/undici/lib/web/websocket/frame.js +1 -7
- package/node_modules/undici/lib/web/websocket/receiver.js +1 -1
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +10 -10
- package/node_modules/undici/lib/web/websocket/websocket.js +25 -3
- package/node_modules/undici/package.json +10 -10
- package/node_modules/undici/types/agent.d.ts +0 -2
- package/node_modules/undici/types/client.d.ts +69 -24
- package/node_modules/undici/types/connector.d.ts +1 -0
- package/node_modules/undici/types/cookies.d.ts +1 -1
- package/node_modules/undici/types/dispatcher.d.ts +8 -30
- package/node_modules/undici/types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici/types/errors.d.ts +10 -0
- package/node_modules/undici/types/fetch.d.ts +5 -1
- package/node_modules/undici/types/formdata.d.ts +0 -6
- package/node_modules/undici/types/h2c-client.d.ts +6 -6
- package/node_modules/undici/types/handlers.d.ts +2 -0
- package/node_modules/undici/types/header.d.ts +5 -0
- package/node_modules/undici/types/index.d.ts +3 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/mock-agent.d.ts +11 -10
- package/node_modules/undici/types/mock-interceptor.d.ts +5 -1
- package/node_modules/undici/types/pool.d.ts +0 -2
- package/node_modules/undici/types/proxy-agent.d.ts +9 -2
- package/node_modules/undici/types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici/types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +4 -2
- package/node_modules/undici/types/webidl.d.ts +0 -1
- package/openclaw.plugin.json +31 -3
- package/package.json +7 -7
- package/dist/.setup/accounts.runtime-DN-PPocC.mjs +0 -2
- package/dist/.setup/action-runtime.runtime-C8R8CUan.mjs +0 -2
- package/dist/.setup/doctor-contract-CtMUqjvk.mjs +0 -186
- package/dist/.setup/monitor-_Sht7Dqy.mjs +0 -13
- package/dist/.setup/rolldown-runtime-D7D4PA-g.mjs +0 -13
- package/dist/.setup/send.runtime-B4caZU6T.mjs +0 -2
- package/dist/.setup/slash-commands.runtime-BpSH0b3q.mjs +0 -2
- package/dist/.setup/slash-skill-commands.runtime-Bi1JWZHY.mjs +0 -2
- package/node_modules/undici/lib/handler/unwrap-handler.js +0 -106
- package/node_modules/undici/lib/handler/wrap-handler.js +0 -105
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/util/promise.js +0 -28
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { n as isSlackPluginAccountConfigured } from "./account-configured-sUohAxZr.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { c as resolveSlackReplyDeliveryMessages, f as buildSlackPresentationBlocks, o as resolveSlackReplyBlockResolution, p as canRenderSlackPresentation, r as normalizeSlackReplyPayload, s as resolveSlackReplyBlocks
|
|
8
|
-
import { n as resolveSlackReplyThreadTs, r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-
|
|
9
|
-
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-
|
|
10
|
-
import {
|
|
11
|
-
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-Dxk8VJUb.mjs";
|
|
2
|
+
import { c as resolveSlackAccountAllowFrom, d as resolveSlackOperationToken, f as resolveSlackReplyToMode, i as listSlackAccountIds, n as hasImplicitDefaultSlackAccount, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-D_N9IqNA.mjs";
|
|
3
|
+
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, t as canonicalizeSlackApiTargetId } from "./target-parsing-FFE26kOV.mjs";
|
|
4
|
+
import { t as slackContextTargetsMatch } from "./targets-C6LZQL1Q.mjs";
|
|
5
|
+
import { A as countSlackTextUtf8Bytes, At as getSlackApprovalApproversForTeam, Bt as resolveSlackExecApprovalTarget, Ct as resolveSessionSlackOriginTarget, Dt as shouldHandleSlackNativeApprovalRequest, E as SLACK_EDIT_TEXT_MAX_BYTES, Et as resolveTurnSourceSlackOriginTarget, Ht as resolvePluginApprovalSlackApprovers, It as getSlackExecApprovalApprovers, Lt as isSlackExecApprovalAuthorizedSender, Mt as resolveSlackApprovalTeamId, Nt as getSlackInstallationKind, Ot as shouldHandleSlackPluginViaForwardingSession, Pt as isSlackWorkspaceInstallation, Q as normalizeSlackOutboundText, Rt as isSlackExecApprovalClientEnabled, St as normalizeSlackOriginTarget, Tt as resolveSlackFallbackOriginTarget, Vt as shouldSuppressLocalSlackExecApprovalPrompt, Wt as resolveSlackAutoThreadId, a as resolveSlackGroupRequireMention, bt as isSlackPluginApprovalRequest, c as qualifySlackRoutePeerId, ct as renderSlackMessagePresentationFallbackText, d as resolveSlackConversationBindingRoute, f as assertSlackDetachedTargetAllowed, jt as isSlackPluginApprovalAuthorizedSender, k as SLACK_TEXT_LIMIT, kt as slackTargetsMatch, mt as SLACK_PRESENTATION_CAPABILITIES, n as setSlackSessionStatus, o as resolveSlackGroupToolPolicy, s as qualifySlackConversationId, u as normalizeSlackRouteBindingConfig, wt as resolveSlackApproverDmTargets, xt as normalizeSlackForwardTarget, yt as isSlackAnyNativeApprovalClientEnabled } from "./session-status-DscajIsd.mjs";
|
|
6
|
+
import { _ as getSlackWriteClient, c as collectSlackCursorPages, o as formatSlackError, u as createSlackLookupClient } from "./probe-B2Y9qc_z.mjs";
|
|
7
|
+
import { c as resolveSlackReplyDeliveryMessages, f as buildSlackPresentationBlocks, o as resolveSlackReplyBlockResolution, p as canRenderSlackPresentation, r as normalizeSlackReplyPayload, s as resolveSlackReplyBlocks } from "./reply-blocks-SE1kTE3I.mjs";
|
|
8
|
+
import { n as resolveSlackReplyThreadTs, r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-Cvt7WD6B.mjs";
|
|
9
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-Cu4lwlGy.mjs";
|
|
10
|
+
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-ClOttrZ5.mjs";
|
|
12
11
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.mjs";
|
|
13
|
-
import {
|
|
12
|
+
import { n as slackConfigAdapter, r as slackSecurityAdapter, t as createSlackPluginBase } from "./shared-qau-uDGl.mjs";
|
|
13
|
+
import { a as slackSetupContract, i as createSlackSetupWizardProxy, o as SLACK_CHANNEL } from "./channel.setup-Dh2jzAjN.mjs";
|
|
14
14
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
15
15
|
import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-resolution";
|
|
16
16
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -20,8 +20,9 @@ import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameR
|
|
|
20
20
|
import { buildThreadAwareOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
21
21
|
import { createChannelMessageAdapterFromOutbound, createRuntimeOutboundDelegates } from "openclaw/plugin-sdk/channel-outbound";
|
|
22
22
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
23
|
+
import { PAIRING_APPROVED_MESSAGE, projectCredentialSnapshotFields, resolveConfiguredFromRequiredCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
23
24
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
24
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
25
|
+
import { createLazyRuntimeMethodBinder, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
25
26
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
26
27
|
import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
27
28
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
@@ -45,47 +46,17 @@ function shouldConsiderSlackNativeForwardingSuppression(input) {
|
|
|
45
46
|
}
|
|
46
47
|
const resolveSlackOriginTarget = createChannelNativeOriginTargetResolver({
|
|
47
48
|
channel: "slack",
|
|
48
|
-
shouldHandleRequest:
|
|
49
|
-
cfg,
|
|
50
|
-
accountId,
|
|
51
|
-
approvalKind,
|
|
52
|
-
request
|
|
53
|
-
}),
|
|
49
|
+
shouldHandleRequest: shouldHandleSlackNativeApprovalRequest,
|
|
54
50
|
resolveTurnSourceTarget: resolveTurnSourceSlackOriginTarget,
|
|
55
51
|
resolveSessionTarget: resolveSessionSlackOriginTarget,
|
|
56
52
|
normalizeTargetForMatch: normalizeSlackOriginTarget,
|
|
57
53
|
targetsMatch: slackTargetsMatch,
|
|
58
54
|
resolveFallbackTarget: resolveSlackFallbackOriginTarget
|
|
59
55
|
});
|
|
60
|
-
function resolveSlackApproverDmTargets(params) {
|
|
61
|
-
if (!shouldHandleSlackNativeApprovalRequest({
|
|
62
|
-
cfg: params.cfg,
|
|
63
|
-
accountId: params.accountId,
|
|
64
|
-
approvalKind: params.approvalKind,
|
|
65
|
-
request: params.request
|
|
66
|
-
})) return [];
|
|
67
|
-
const teamId = resolveEnterpriseApprovalTeamId(params.request);
|
|
68
|
-
return (params.approvalKind === "plugin" ? getSlackApprovalApproversForTeam({
|
|
69
|
-
...params,
|
|
70
|
-
teamId
|
|
71
|
-
}) : getSlackExecApprovalApprovers(params)).map((approver) => {
|
|
72
|
-
const target = parseSlackTarget(approver, { defaultKind: "user" });
|
|
73
|
-
if (!target || target.kind !== "user") throw new Error("Slack approval approver target must be a user");
|
|
74
|
-
return { to: formatSlackTarget({
|
|
75
|
-
kind: "user",
|
|
76
|
-
id: target.id,
|
|
77
|
-
teamId: target.teamId ?? teamId,
|
|
78
|
-
explicitKind: true
|
|
79
|
-
}) };
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
56
|
const shouldSuppressSlackForwardingFallback = createNativeApprovalForwardingFallbackSuppressor({
|
|
83
57
|
channel: "slack",
|
|
84
58
|
normalizeForwardTarget: normalizeSlackForwardTarget,
|
|
85
|
-
resolveAccountId:
|
|
86
|
-
target,
|
|
87
|
-
request
|
|
88
|
-
}),
|
|
59
|
+
resolveAccountId: resolveSlackNativeSuppressionAccountId,
|
|
89
60
|
isSessionRouteEligible: shouldHandleSlackNativeApprovalRequest,
|
|
90
61
|
isExplicitTargetEligible: shouldHandleSlackNativeApprovalRequest,
|
|
91
62
|
resolveOriginTarget: resolveSlackOriginTarget,
|
|
@@ -97,31 +68,23 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
97
68
|
channelLabel: "Slack",
|
|
98
69
|
describeExecApprovalSetup: ({ accountId }) => {
|
|
99
70
|
const prefix = accountId && accountId !== "default" ? `channels.slack.accounts.${accountId}` : "channels.slack";
|
|
100
|
-
return `Approve it from the Web UI
|
|
71
|
+
return `Approve it from the Web UI for now. Slack supports native exec approvals for this account. Configure \`${prefix}.execApprovals.approvers\` or \`commands.ownerAllowFrom\`; set \`${prefix}.execApprovals.enabled\` to \`auto\` or \`true\`. Unset or \`false\` disables native exec approval delivery.`;
|
|
101
72
|
},
|
|
73
|
+
describePluginApprovalSetup: () => "Check `approvals.plugin.slack` for a reviewer in the bot's workspace and confirm the Slack bot is connected, or connect an approval-capable Gateway client. Then retry the request.",
|
|
102
74
|
listAccountIds: listSlackAccountIds,
|
|
103
75
|
hasApprovers: ({ cfg, accountId }) => getSlackExecApprovalApprovers({
|
|
104
76
|
cfg,
|
|
105
77
|
accountId
|
|
106
78
|
}).length > 0,
|
|
107
|
-
isExecAuthorizedSender:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}),
|
|
117
|
-
isNativeDeliveryEnabled: ({ cfg, accountId }) => isSlackExecApprovalClientEnabled({
|
|
118
|
-
cfg,
|
|
119
|
-
accountId
|
|
120
|
-
}),
|
|
121
|
-
resolveNativeDeliveryMode: ({ cfg, accountId }) => resolveSlackExecApprovalTarget({
|
|
122
|
-
cfg,
|
|
123
|
-
accountId
|
|
124
|
-
}),
|
|
79
|
+
isExecAuthorizedSender: isSlackExecApprovalAuthorizedSender,
|
|
80
|
+
isPluginAuthorizedSender: (params) => isSlackPluginApprovalAuthorizedSender(params) && (!params.request || resolvePluginApprovalSlackApprovers(params.cfg, params.request) === void 0 || shouldHandleSlackNativeApprovalRequest({
|
|
81
|
+
cfg: params.cfg,
|
|
82
|
+
accountId: params.accountId,
|
|
83
|
+
approvalKind: "plugin",
|
|
84
|
+
request: params.request
|
|
85
|
+
})),
|
|
86
|
+
isNativeDeliveryEnabled: isSlackExecApprovalClientEnabled,
|
|
87
|
+
resolveNativeDeliveryMode: resolveSlackExecApprovalTarget,
|
|
125
88
|
requireMatchingTurnSourceChannel: true,
|
|
126
89
|
resolveSuppressionAccountId: resolveSlackNativeSuppressionAccountId,
|
|
127
90
|
resolveOriginTarget: resolveSlackOriginTarget,
|
|
@@ -134,26 +97,38 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
134
97
|
"plugin",
|
|
135
98
|
"system-agent"
|
|
136
99
|
],
|
|
137
|
-
isConfigured:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}),
|
|
141
|
-
shouldHandle: ({ cfg, accountId, approvalKind, request }) => shouldHandleSlackNativeApprovalRequest({
|
|
142
|
-
cfg,
|
|
143
|
-
accountId,
|
|
144
|
-
approvalKind,
|
|
145
|
-
request
|
|
146
|
-
}),
|
|
147
|
-
load: async () => (await import("./approval-handler.runtime-DMszKn_7.mjs")).slackApprovalNativeRuntime
|
|
100
|
+
isConfigured: isSlackAnyNativeApprovalClientEnabled,
|
|
101
|
+
shouldHandle: shouldHandleSlackNativeApprovalRequest,
|
|
102
|
+
load: async () => (await import("./approval-handler.runtime-Ed6Sw5VK.mjs")).slackApprovalNativeRuntime
|
|
148
103
|
})
|
|
149
104
|
});
|
|
150
105
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
151
106
|
const slackApprovalCapability = {
|
|
152
107
|
...baseSlackApprovalCapability,
|
|
108
|
+
supportsScopedPluginApprovalApprovers: true,
|
|
109
|
+
resolveReviewerSenderId: ({ senderId, spaceId }) => {
|
|
110
|
+
try {
|
|
111
|
+
const parsed = senderId ? parseSlackTarget(senderId, { defaultKind: "user" }) : void 0;
|
|
112
|
+
return parsed?.kind === "user" && spaceId ? formatSlackTarget({
|
|
113
|
+
kind: "user",
|
|
114
|
+
id: parsed.id,
|
|
115
|
+
teamId: spaceId
|
|
116
|
+
}) : senderId ?? void 0;
|
|
117
|
+
} catch {
|
|
118
|
+
return senderId ?? void 0;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
getActionAvailabilityState: (params) => params.approvalKind === "plugin" && params.cfg.approvals?.plugin?.slack && (!params.request || !isSlackPluginApprovalRequest(params.request) || resolvePluginApprovalSlackApprovers(params.cfg, params.request) !== void 0) ? { kind: params.request && !shouldHandleSlackNativeApprovalRequest({
|
|
122
|
+
...params,
|
|
123
|
+
approvalKind: "plugin",
|
|
124
|
+
request: params.request
|
|
125
|
+
}) ? "disabled" : "enabled" } : baseSlackApprovalCapability.getActionAvailabilityState?.(params) ?? { kind: "disabled" },
|
|
153
126
|
delivery: {
|
|
154
127
|
...baseSlackApprovalCapability.delivery,
|
|
128
|
+
shouldBlockForwardingFallback: (input) => shouldConsiderSlackNativeForwardingSuppression(input) && input.approvalKind === "plugin" && isSlackPluginApprovalRequest(input.request) && resolvePluginApprovalSlackApprovers(input.cfg, input.request) !== void 0,
|
|
155
129
|
shouldSuppressForwardingFallback: (input) => {
|
|
156
130
|
if (!shouldConsiderSlackNativeForwardingSuppression(input)) return false;
|
|
131
|
+
if (input.approvalKind === "plugin" && !isSlackPluginApprovalRequest(input.request)) return true;
|
|
157
132
|
const canHandleNative = shouldHandleSlackNativeApprovalRequest({
|
|
158
133
|
cfg: input.cfg,
|
|
159
134
|
accountId: resolveSlackNativeSuppressionAccountId(input),
|
|
@@ -170,32 +145,52 @@ const slackApprovalCapability = {
|
|
|
170
145
|
const capabilities = baseSlackNativeAdapter.describeDeliveryCapabilities(params);
|
|
171
146
|
const request = params.request;
|
|
172
147
|
const approvalKind = params.approvalKind;
|
|
173
|
-
|
|
148
|
+
const described = {
|
|
174
149
|
...capabilities,
|
|
175
150
|
enabled: shouldHandleSlackNativeApprovalRequest({
|
|
176
151
|
cfg: params.cfg,
|
|
177
152
|
accountId: params.accountId,
|
|
178
153
|
approvalKind,
|
|
179
154
|
request
|
|
180
|
-
})
|
|
181
|
-
|
|
155
|
+
})
|
|
156
|
+
};
|
|
157
|
+
if (approvalKind !== "plugin" || !isSlackPluginApprovalRequest(request)) return described;
|
|
158
|
+
if (resolvePluginApprovalSlackApprovers(params.cfg, request) !== void 0) return {
|
|
159
|
+
...described,
|
|
160
|
+
preferredSurface: "approver-dm",
|
|
161
|
+
supportsApproverDmSurface: true
|
|
162
|
+
};
|
|
163
|
+
if (!shouldHandleSlackPluginViaForwardingSession({
|
|
164
|
+
cfg: params.cfg,
|
|
165
|
+
accountId: params.accountId,
|
|
166
|
+
request
|
|
167
|
+
})) return described;
|
|
168
|
+
return {
|
|
169
|
+
...described,
|
|
170
|
+
preferredSurface: "origin",
|
|
171
|
+
supportsApproverDmSurface: getSlackApprovalApproversForTeam({
|
|
182
172
|
cfg: params.cfg,
|
|
183
173
|
accountId: params.accountId,
|
|
184
|
-
|
|
185
|
-
}) ? {
|
|
186
|
-
preferredSurface: "origin",
|
|
187
|
-
supportsApproverDmSurface: hasSlackPluginApprovers({
|
|
174
|
+
teamId: resolveSlackApprovalTeamId({
|
|
188
175
|
cfg: params.cfg,
|
|
189
176
|
accountId: params.accountId,
|
|
190
|
-
|
|
191
|
-
})
|
|
192
|
-
|
|
177
|
+
request
|
|
178
|
+
}),
|
|
179
|
+
request
|
|
180
|
+
}).length > 0
|
|
193
181
|
};
|
|
194
182
|
}
|
|
195
183
|
} : void 0
|
|
196
184
|
};
|
|
197
185
|
//#endregion
|
|
198
186
|
//#region extensions/slack/src/message-action-dispatch.ts
|
|
187
|
+
const SLACK_MESSAGE_ACTIONS = /* @__PURE__ */ new Map([
|
|
188
|
+
["reactions", "reactions"],
|
|
189
|
+
["delete", "deleteMessage"],
|
|
190
|
+
["pin", "pinMessage"],
|
|
191
|
+
["unpin", "unpinMessage"],
|
|
192
|
+
["list-pins", "listPins"]
|
|
193
|
+
]);
|
|
199
194
|
function readSlackForceDocument(params) {
|
|
200
195
|
return readBooleanParam(params, "forceDocument") ?? readBooleanParam(params, "asDocument") ?? false;
|
|
201
196
|
}
|
|
@@ -217,19 +212,28 @@ function renderSlackActionPresentation(presentation) {
|
|
|
217
212
|
}
|
|
218
213
|
/** Translate generic channel action requests into Slack-specific tool invocations and payload shapes. */
|
|
219
214
|
async function handleSlackMessageAction(params) {
|
|
220
|
-
const { providerId, ctx, invoke
|
|
215
|
+
const { providerId, ctx, invoke } = params;
|
|
221
216
|
const { action, cfg, params: actionParams } = ctx;
|
|
222
217
|
const accountId = ctx.accountId ?? void 0;
|
|
218
|
+
const invokeSlackAction = (request, toolContext = ctx.toolContext) => invoke({
|
|
219
|
+
...request,
|
|
220
|
+
accountId
|
|
221
|
+
}, cfg, toolContext);
|
|
223
222
|
const resolveChannelId = () => {
|
|
224
|
-
const
|
|
225
|
-
|
|
223
|
+
const raw = readStringParam$1(actionParams, "channelId") ?? readStringParam$1(actionParams, "to", { required: true });
|
|
224
|
+
const target = parseSlackTarget(raw, { defaultKind: "channel" });
|
|
225
|
+
const channelId = resolveSlackChannelId(raw);
|
|
226
|
+
return formatSlackTarget({
|
|
227
|
+
teamId: target?.teamId,
|
|
228
|
+
kind: "channel",
|
|
229
|
+
id: channelId
|
|
230
|
+
});
|
|
226
231
|
};
|
|
227
|
-
if (action === "conversation-open") return await
|
|
232
|
+
if (action === "conversation-open") return await invokeSlackAction({
|
|
228
233
|
action: "openConversation",
|
|
229
234
|
userIds: actionParams.userIds,
|
|
230
|
-
teamId: readStringParam$1(actionParams, "teamId")
|
|
231
|
-
|
|
232
|
-
}, cfg, ctx.toolContext);
|
|
235
|
+
teamId: readStringParam$1(actionParams, "teamId")
|
|
236
|
+
});
|
|
233
237
|
if (action === "send") {
|
|
234
238
|
const to = readStringParam$1(actionParams, "to", { required: true });
|
|
235
239
|
const content = readStringParam$1(actionParams, "message", {
|
|
@@ -260,20 +264,19 @@ async function handleSlackMessageAction(params) {
|
|
|
260
264
|
...ctx.toolContext,
|
|
261
265
|
preparedMessages
|
|
262
266
|
} : ctx.toolContext;
|
|
263
|
-
return await
|
|
267
|
+
return await invokeSlackAction({
|
|
264
268
|
action: "sendMessage",
|
|
265
269
|
to,
|
|
266
270
|
content: content ?? "",
|
|
267
271
|
mediaUrl: mediaUrl ?? void 0,
|
|
268
272
|
...readSlackForceDocument(actionParams) ? { forceDocument: true } : {},
|
|
269
|
-
accountId,
|
|
270
273
|
threadTs: resolveSlackThreadTsValue({
|
|
271
274
|
replyToId: replyTo,
|
|
272
275
|
threadId
|
|
273
276
|
}),
|
|
274
277
|
...topLevel ? { topLevel: true } : {},
|
|
275
278
|
...replyBroadcast ? { replyBroadcast } : {}
|
|
276
|
-
},
|
|
279
|
+
}, toolContext);
|
|
277
280
|
}
|
|
278
281
|
if (action === "react") {
|
|
279
282
|
const messageIdRaw = resolveReactionMessageId({
|
|
@@ -284,44 +287,39 @@ async function handleSlackMessageAction(params) {
|
|
|
284
287
|
const messageId = String(messageIdRaw);
|
|
285
288
|
const emoji = readStringParam$1(actionParams, "emoji", { allowEmpty: true });
|
|
286
289
|
const remove = typeof actionParams.remove === "boolean" ? actionParams.remove : void 0;
|
|
287
|
-
return await
|
|
290
|
+
return await invokeSlackAction({
|
|
288
291
|
action: "react",
|
|
289
292
|
channelId: resolveChannelId(),
|
|
290
293
|
messageId,
|
|
291
294
|
emoji,
|
|
292
|
-
remove
|
|
293
|
-
|
|
294
|
-
}, cfg, ctx.toolContext);
|
|
295
|
+
remove
|
|
296
|
+
});
|
|
295
297
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
const messageAction = SLACK_MESSAGE_ACTIONS.get(action);
|
|
299
|
+
if (messageAction) {
|
|
300
|
+
const messageId = action === "list-pins" ? void 0 : readStringParam$1(actionParams, "messageId", { required: true });
|
|
301
|
+
return await invokeSlackAction({
|
|
302
|
+
action: messageAction,
|
|
300
303
|
channelId: resolveChannelId(),
|
|
301
304
|
messageId,
|
|
302
|
-
limit: actionParams.limit
|
|
303
|
-
|
|
304
|
-
}, cfg, ctx.toolContext);
|
|
305
|
-
}
|
|
306
|
-
if (action === "read") {
|
|
307
|
-
const readAction = {
|
|
308
|
-
action: "readMessages",
|
|
309
|
-
channelId: resolveChannelId(),
|
|
310
|
-
limit: actionParams.limit,
|
|
311
|
-
before: readStringParam$1(actionParams, "before"),
|
|
312
|
-
after: readStringParam$1(actionParams, "after"),
|
|
313
|
-
messageId: readStringParam$1(actionParams, "messageId"),
|
|
314
|
-
accountId
|
|
315
|
-
};
|
|
316
|
-
if (includeReadThreadId) readAction.threadId = readStringParam$1(actionParams, "threadId");
|
|
317
|
-
return await invoke(readAction, cfg, ctx.toolContext);
|
|
305
|
+
...action === "reactions" ? { limit: actionParams.limit } : {}
|
|
306
|
+
});
|
|
318
307
|
}
|
|
308
|
+
if (action === "read") return await invokeSlackAction({
|
|
309
|
+
action: "readMessages",
|
|
310
|
+
channelId: resolveChannelId(),
|
|
311
|
+
limit: actionParams.limit,
|
|
312
|
+
before: readStringParam$1(actionParams, "before"),
|
|
313
|
+
after: readStringParam$1(actionParams, "after"),
|
|
314
|
+
messageId: readStringParam$1(actionParams, "messageId"),
|
|
315
|
+
threadId: readStringParam$1(actionParams, "threadId")
|
|
316
|
+
});
|
|
319
317
|
if (action === "edit") {
|
|
320
318
|
const messageId = readStringParam$1(actionParams, "messageId", { required: true });
|
|
321
319
|
const content = readStringParam$1(actionParams, "message", { allowEmpty: true });
|
|
322
320
|
const presentation = normalizeMessagePresentation(actionParams.presentation);
|
|
323
321
|
const renderedPresentation = renderSlackActionPresentation(presentation);
|
|
324
|
-
const blocks = renderedPresentation.
|
|
322
|
+
const blocks = renderedPresentation.blocks;
|
|
325
323
|
const accessibleContent = renderedPresentation.usesPresentationTextFallback ? renderSlackMessagePresentationFallbackText({
|
|
326
324
|
text: content,
|
|
327
325
|
presentation
|
|
@@ -336,32 +334,13 @@ async function handleSlackMessageAction(params) {
|
|
|
336
334
|
throw new Error(`${editSubject} exceeds the ${String(SLACK_EDIT_TEXT_MAX_BYTES)}-byte edit limit. Send a new message instead.`);
|
|
337
335
|
}
|
|
338
336
|
if (!accessibleContent && !blocks) throw new Error("Slack edit requires message or blocks.");
|
|
339
|
-
return await
|
|
337
|
+
return await invokeSlackAction({
|
|
340
338
|
action: "editMessage",
|
|
341
339
|
channelId: resolveChannelId(),
|
|
342
340
|
messageId,
|
|
343
341
|
content: accessibleContent,
|
|
344
|
-
blocks
|
|
345
|
-
|
|
346
|
-
}, cfg, ctx.toolContext);
|
|
347
|
-
}
|
|
348
|
-
if (action === "delete") {
|
|
349
|
-
const messageId = readStringParam$1(actionParams, "messageId", { required: true });
|
|
350
|
-
return await invoke({
|
|
351
|
-
action: "deleteMessage",
|
|
352
|
-
channelId: resolveChannelId(),
|
|
353
|
-
messageId,
|
|
354
|
-
accountId
|
|
355
|
-
}, cfg, ctx.toolContext);
|
|
356
|
-
}
|
|
357
|
-
if (action === "pin" || action === "unpin" || action === "list-pins") {
|
|
358
|
-
const messageId = action === "list-pins" ? void 0 : readStringParam$1(actionParams, "messageId", { required: true });
|
|
359
|
-
return await invoke({
|
|
360
|
-
action: action === "pin" ? "pinMessage" : action === "unpin" ? "unpinMessage" : "listPins",
|
|
361
|
-
channelId: resolveChannelId(),
|
|
362
|
-
messageId,
|
|
363
|
-
accountId
|
|
364
|
-
}, cfg, ctx.toolContext);
|
|
342
|
+
blocks
|
|
343
|
+
});
|
|
365
344
|
}
|
|
366
345
|
if (action === "member-info") {
|
|
367
346
|
const requesterAccountId = ctx.requesterAccountId ? normalizeAccountId$1(ctx.requesterAccountId) : void 0;
|
|
@@ -369,17 +348,15 @@ async function handleSlackMessageAction(params) {
|
|
|
369
348
|
const requesterUserId = normalizeOptionalLowercaseString(ctx.toolContext?.currentChannelProvider) === "slack" && requesterAccountId !== void 0 && requesterAccountId === targetAccountId ? normalizeOptionalString(ctx.requesterSenderId) : void 0;
|
|
370
349
|
const userId = readStringParam$1(actionParams, "userId") ?? requesterUserId;
|
|
371
350
|
if (!userId) throw new Error("member-info requires a userId outside a current Slack conversation.");
|
|
372
|
-
return await
|
|
351
|
+
return await invokeSlackAction({
|
|
373
352
|
action: "memberInfo",
|
|
374
|
-
userId
|
|
375
|
-
|
|
376
|
-
}, cfg, ctx.toolContext);
|
|
353
|
+
userId
|
|
354
|
+
});
|
|
377
355
|
}
|
|
378
|
-
if (action === "emoji-list") return await
|
|
356
|
+
if (action === "emoji-list") return await invokeSlackAction({
|
|
379
357
|
action: "emojiList",
|
|
380
|
-
limit: readPositiveIntegerParam$1(actionParams, "limit", { message: "limit must be a positive integer." })
|
|
381
|
-
|
|
382
|
-
}, cfg, ctx.toolContext);
|
|
358
|
+
limit: readPositiveIntegerParam$1(actionParams, "limit", { message: "limit must be a positive integer." })
|
|
359
|
+
});
|
|
383
360
|
if (action === "download-file") {
|
|
384
361
|
const fileIdParam = readStringParam$1(actionParams, "fileId");
|
|
385
362
|
const messageIdParam = readStringParam$1(actionParams, "messageId") ?? readStringParam$1(actionParams, "message_id");
|
|
@@ -387,13 +364,12 @@ async function handleSlackMessageAction(params) {
|
|
|
387
364
|
const fileId = readStringParam$1(actionParams, "fileId", { required: true });
|
|
388
365
|
const channelId = readStringParam$1(actionParams, "channelId") ?? readStringParam$1(actionParams, "to");
|
|
389
366
|
const threadId = readStringParam$1(actionParams, "threadId") ?? readStringParam$1(actionParams, "replyTo");
|
|
390
|
-
return await
|
|
367
|
+
return await invokeSlackAction({
|
|
391
368
|
action: "downloadFile",
|
|
392
369
|
fileId,
|
|
393
370
|
channelId: channelId ?? void 0,
|
|
394
|
-
threadId: threadId ?? void 0
|
|
395
|
-
|
|
396
|
-
}, cfg, ctx.toolContext);
|
|
371
|
+
threadId: threadId ?? void 0
|
|
372
|
+
});
|
|
397
373
|
}
|
|
398
374
|
if (action === "upload-file") {
|
|
399
375
|
if (readBooleanParam(actionParams, "replyBroadcast")) throw new Error("Slack replyBroadcast is only supported for text or block thread replies.");
|
|
@@ -402,7 +378,7 @@ async function handleSlackMessageAction(params) {
|
|
|
402
378
|
if (!filePath) throw new Error("upload-file requires filePath, path, or media");
|
|
403
379
|
const threadId = readStringParam$1(actionParams, "threadId") ?? readStringParam$1(actionParams, "replyTo");
|
|
404
380
|
const topLevel = readBooleanParam(actionParams, "topLevel") === true || actionParams.threadId === null;
|
|
405
|
-
return await
|
|
381
|
+
return await invokeSlackAction({
|
|
406
382
|
action: "uploadFile",
|
|
407
383
|
to,
|
|
408
384
|
filePath,
|
|
@@ -411,9 +387,8 @@ async function handleSlackMessageAction(params) {
|
|
|
411
387
|
title: readStringParam$1(actionParams, "title"),
|
|
412
388
|
threadTs: threadId ?? void 0,
|
|
413
389
|
...readSlackForceDocument(actionParams) ? { forceDocument: true } : {},
|
|
414
|
-
...topLevel ? { topLevel: true } : {}
|
|
415
|
-
|
|
416
|
-
}, cfg, ctx.toolContext);
|
|
390
|
+
...topLevel ? { topLevel: true } : {}
|
|
391
|
+
});
|
|
417
392
|
}
|
|
418
393
|
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
|
|
419
394
|
}
|
|
@@ -428,7 +403,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
428
403
|
"unpinMessage",
|
|
429
404
|
"uploadFile"
|
|
430
405
|
]);
|
|
431
|
-
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
406
|
+
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-Ck4bAWOX.mjs"));
|
|
432
407
|
function resolveSlackActionContext(ctx, toolContext) {
|
|
433
408
|
if (!toolContext && !ctx.mediaAccess && !ctx.mediaLocalRoots && !ctx.mediaReadFile && !ctx.conversationReadOrigin && !ctx.requesterAccountId && !ctx.requesterSenderId && !ctx.assertDirectAdapterHandoff) return;
|
|
434
409
|
return {
|
|
@@ -461,8 +436,6 @@ function createSlackActions(providerId, options) {
|
|
|
461
436
|
return await handleSlackMessageAction({
|
|
462
437
|
providerId,
|
|
463
438
|
ctx,
|
|
464
|
-
normalizeChannelId: normalizeSlackActionChannelTarget,
|
|
465
|
-
includeReadThreadId: true,
|
|
466
439
|
invoke: async (action, cfg, toolContext) => {
|
|
467
440
|
const actionContext = resolveSlackActionContext(ctx, toolContext);
|
|
468
441
|
return await (options?.invoke ? options.invoke(action, cfg, actionContext) : (await loadSlackActionRuntime$1()).handleSlackAction(action, cfg, actionContext));
|
|
@@ -471,15 +444,6 @@ function createSlackActions(providerId, options) {
|
|
|
471
444
|
}
|
|
472
445
|
};
|
|
473
446
|
}
|
|
474
|
-
function normalizeSlackActionChannelTarget(raw) {
|
|
475
|
-
const target = parseSlackTarget(raw, { defaultKind: "channel" });
|
|
476
|
-
const channelId = resolveSlackChannelId(raw);
|
|
477
|
-
return formatSlackTarget({
|
|
478
|
-
teamId: target?.teamId,
|
|
479
|
-
kind: "channel",
|
|
480
|
-
id: channelId
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
447
|
function shouldUseWorkspaceAwareSlackActionSend(rawTarget, context) {
|
|
484
448
|
const target = parseSlackTarget(rawTarget, { defaultKind: "channel" });
|
|
485
449
|
if (!target || target.teamId) return false;
|
|
@@ -510,8 +474,9 @@ function inspectSlackConversationRouteOwner(params) {
|
|
|
510
474
|
const enterpriseRoute = installationKind === "enterprise" || targetIsEnterprise;
|
|
511
475
|
if (enterpriseRoute && !teamId) return null;
|
|
512
476
|
const enterpriseScope = enterpriseRoute && teamId ? { teamId } : void 0;
|
|
513
|
-
const route = resolveAgentRoute({
|
|
514
|
-
cfg: normalizeSlackRouteBindingConfig(params.cfg),
|
|
477
|
+
const route = ({ boundAgentId, bindingOwnerAvailable }) => resolveAgentRoute({
|
|
478
|
+
cfg: boundAgentId || !bindingOwnerAvailable ? { session: params.cfg.session } : normalizeSlackRouteBindingConfig(params.cfg),
|
|
479
|
+
defaultAgentId: boundAgentId,
|
|
515
480
|
channel: "slack",
|
|
516
481
|
accountId,
|
|
517
482
|
teamId,
|
|
@@ -527,7 +492,7 @@ function inspectSlackConversationRouteOwner(params) {
|
|
|
527
492
|
const baseConversationId = qualifySlackConversationId(direct ? `user:${target.id}` : target.id, enterpriseScope);
|
|
528
493
|
const bindingRoute = resolveSlackConversationBindingRoute({
|
|
529
494
|
cfg: params.cfg,
|
|
530
|
-
route,
|
|
495
|
+
resolveRoute: route,
|
|
531
496
|
accountId,
|
|
532
497
|
baseConversationId,
|
|
533
498
|
runtimeBindingThreadId: params.conversation.threadId,
|
|
@@ -538,11 +503,11 @@ function inspectSlackConversationRouteOwner(params) {
|
|
|
538
503
|
if (bindingRoute.runtimeRoute.pluginId) return {
|
|
539
504
|
kind: "plugin",
|
|
540
505
|
pluginId: bindingRoute.runtimeRoute.pluginId,
|
|
541
|
-
fallbackAgentId: route.agentId
|
|
506
|
+
fallbackAgentId: bindingRoute.route.agentId
|
|
542
507
|
};
|
|
543
508
|
return {
|
|
544
509
|
kind: "agent",
|
|
545
|
-
agentId: bindingRoute.runtimeRoute.boundAgentId ?? bindingRoute.configuredRoute?.boundAgentId ?? route.agentId
|
|
510
|
+
agentId: bindingRoute.runtimeRoute.boundAgentId ?? bindingRoute.configuredRoute?.boundAgentId ?? bindingRoute.route.agentId
|
|
546
511
|
};
|
|
547
512
|
}
|
|
548
513
|
//#endregion
|
|
@@ -608,23 +573,21 @@ const EXTENSION_SHARED_MODULE_ID = "openclaw/plugin-sdk/extension-shared";
|
|
|
608
573
|
const TARGET_RESOLVER_RUNTIME_MODULE_ID = "openclaw/plugin-sdk/target-resolver-runtime";
|
|
609
574
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import(EXTENSION_SHARED_MODULE_ID));
|
|
610
575
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import(TARGET_RESOLVER_RUNTIME_MODULE_ID));
|
|
611
|
-
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-
|
|
612
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-
|
|
613
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
576
|
+
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-Dn7QgWRE.mjs"));
|
|
577
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-CasuDvaa.mjs"));
|
|
578
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-Bv48XUjq.mjs"));
|
|
579
|
+
const bindSlackOutbound = createLazyRuntimeMethodBinder(loadSlackOutboundAdapterModule);
|
|
614
580
|
async function resolveSlackHandleAction() {
|
|
615
581
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
616
582
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
const
|
|
622
|
-
const
|
|
623
|
-
const
|
|
624
|
-
const
|
|
625
|
-
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-DiYIMPJo.mjs").then((n) => n.n));
|
|
626
|
-
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-_Sht7Dqy.mjs").then((n) => n.t));
|
|
627
|
-
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-BCcj89QV.mjs").then((n) => n.t));
|
|
583
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-BOUWH3hR.mjs").then((n) => n.t));
|
|
584
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-XXBn8UU_.mjs").then((n) => n.n));
|
|
585
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DW0ngD03.mjs").then((n) => n.n));
|
|
586
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-Ck4bAWOX.mjs"));
|
|
587
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-BOVLQi3n.mjs").then((n) => n.n));
|
|
588
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-B2Y9qc_z.mjs").then((n) => n.n));
|
|
589
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-BPVfkumU.mjs").then((n) => n.t));
|
|
590
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-B2O4B_Ho.mjs").then((n) => n.t));
|
|
628
591
|
async function setSlackHeartbeatThreadStatus(params) {
|
|
629
592
|
const threadTs = resolveSlackThreadTsValue({ threadId: params.threadId });
|
|
630
593
|
const target = parseSlackTarget(params.to, { defaultKind: "channel" });
|
|
@@ -686,16 +649,6 @@ function matchSlackAcpConversation(params) {
|
|
|
686
649
|
};
|
|
687
650
|
return null;
|
|
688
651
|
}
|
|
689
|
-
function buildSlackBaseSessionKey(params) {
|
|
690
|
-
return buildOutboundBaseSessionKey({
|
|
691
|
-
...params,
|
|
692
|
-
channel: "slack"
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
function shouldRecoverSlackThreadFromCurrentSession(params) {
|
|
696
|
-
if (params.peerKind === "direct" && (params.cfg.session?.dmScope ?? "main") === "main") return false;
|
|
697
|
-
return true;
|
|
698
|
-
}
|
|
699
652
|
async function resolveSlackOutboundSessionRoute(params) {
|
|
700
653
|
const parsed = parseSlackTarget(params.target, { defaultKind: "channel" });
|
|
701
654
|
if (!parsed) return null;
|
|
@@ -745,7 +698,8 @@ async function resolveSlackOutboundSessionRoute(params) {
|
|
|
745
698
|
kind: peerKind,
|
|
746
699
|
id: peerId
|
|
747
700
|
};
|
|
748
|
-
const unpartitionedBaseSessionKey =
|
|
701
|
+
const unpartitionedBaseSessionKey = buildOutboundBaseSessionKey({
|
|
702
|
+
channel: "slack",
|
|
749
703
|
cfg: params.cfg,
|
|
750
704
|
agentId: params.agentId,
|
|
751
705
|
accountId: params.accountId,
|
|
@@ -768,10 +722,7 @@ async function resolveSlackOutboundSessionRoute(params) {
|
|
|
768
722
|
replyToId: params.replyToId,
|
|
769
723
|
threadId: params.threadId,
|
|
770
724
|
currentSessionKey: params.currentSessionKey,
|
|
771
|
-
canRecoverCurrentThread: () =>
|
|
772
|
-
cfg: params.cfg,
|
|
773
|
-
peerKind
|
|
774
|
-
})
|
|
725
|
+
canRecoverCurrentThread: () => peerKind !== "direct" || (params.cfg.session?.dmScope ?? "main") !== "main"
|
|
775
726
|
});
|
|
776
727
|
}
|
|
777
728
|
function formatSlackScopeDiagnostic(params) {
|
|
@@ -810,17 +761,10 @@ const slackChannelOutbound = {
|
|
|
810
761
|
thread: true,
|
|
811
762
|
messageSendingHooks: true
|
|
812
763
|
} },
|
|
813
|
-
shouldTreatDeliveredTextAsVisible:
|
|
764
|
+
shouldTreatDeliveredTextAsVisible: ({ kind, text }) => kind === "block" && typeof text === "string" && text.trim().length > 0,
|
|
814
765
|
preferFinalAssistantVisibleText: true,
|
|
815
|
-
shouldSuppressLocalPayloadPrompt:
|
|
816
|
-
|
|
817
|
-
accountId,
|
|
818
|
-
payload
|
|
819
|
-
}),
|
|
820
|
-
afterDeliverPayload: async (ctx) => {
|
|
821
|
-
const { slackOutbound } = await loadSlackOutboundAdapterModule();
|
|
822
|
-
await slackOutbound.afterDeliverPayload(ctx);
|
|
823
|
-
},
|
|
766
|
+
shouldSuppressLocalPayloadPrompt: shouldSuppressLocalSlackExecApprovalPrompt,
|
|
767
|
+
afterDeliverPayload: bindSlackOutbound(({ slackOutbound }) => slackOutbound.afterDeliverPayload),
|
|
824
768
|
presentationCapabilities: SLACK_PRESENTATION_CAPABILITIES,
|
|
825
769
|
...createRuntimeOutboundDelegates({
|
|
826
770
|
getRuntime: loadSlackOutboundAdapterModule,
|
|
@@ -829,18 +773,9 @@ const slackChannelOutbound = {
|
|
|
829
773
|
unavailableMessage: "Slack outbound presentation rendering is unavailable"
|
|
830
774
|
}
|
|
831
775
|
}),
|
|
832
|
-
sendPayload:
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
},
|
|
836
|
-
sendText: async (ctx) => {
|
|
837
|
-
const { slackOutbound } = await loadSlackOutboundAdapterModule();
|
|
838
|
-
return await slackOutbound.sendText(ctx);
|
|
839
|
-
},
|
|
840
|
-
sendMedia: async (ctx) => {
|
|
841
|
-
const { slackOutbound } = await loadSlackOutboundAdapterModule();
|
|
842
|
-
return await slackOutbound.sendMedia(ctx);
|
|
843
|
-
}
|
|
776
|
+
sendPayload: bindSlackOutbound(({ slackOutbound }) => slackOutbound.sendPayload),
|
|
777
|
+
sendText: bindSlackOutbound(({ slackOutbound }) => slackOutbound.sendText),
|
|
778
|
+
sendMedia: bindSlackOutbound(({ slackOutbound }) => slackOutbound.sendMedia)
|
|
844
779
|
};
|
|
845
780
|
const slackMessageAdapterBase = createChannelMessageAdapterFromOutbound({
|
|
846
781
|
id: "slack",
|
|
@@ -942,7 +877,7 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
942
877
|
return normalizeSlackMessagingTarget(`channel:${id}`);
|
|
943
878
|
},
|
|
944
879
|
inferTargetChatType: ({ to }) => resolveSlackRouteTarget(to)?.chatType,
|
|
945
|
-
resolveOutboundSessionRoute:
|
|
880
|
+
resolveOutboundSessionRoute: resolveSlackOutboundSessionRoute,
|
|
946
881
|
hasStructuredReplyPayload: ({ payload }) => {
|
|
947
882
|
try {
|
|
948
883
|
return Boolean(resolveSlackReplyBlocks(payload)?.length);
|
|
@@ -1011,27 +946,17 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1011
946
|
actions: createSlackActions(SLACK_CHANNEL, { invoke: async (action, cfg, toolContext) => await (await resolveSlackHandleAction())(action, cfg, toolContext) }),
|
|
1012
947
|
message: slackMessageAdapter,
|
|
1013
948
|
heartbeat: {
|
|
1014
|
-
sendTyping:
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
},
|
|
1023
|
-
clearTyping: async ({ cfg, to, accountId, threadId }) => {
|
|
1024
|
-
await setSlackHeartbeatThreadStatus({
|
|
1025
|
-
cfg,
|
|
1026
|
-
to,
|
|
1027
|
-
accountId,
|
|
1028
|
-
threadId,
|
|
1029
|
-
status: "active"
|
|
1030
|
-
});
|
|
1031
|
-
}
|
|
949
|
+
sendTyping: (params) => setSlackHeartbeatThreadStatus({
|
|
950
|
+
...params,
|
|
951
|
+
status: "processing"
|
|
952
|
+
}),
|
|
953
|
+
clearTyping: (params) => setSlackHeartbeatThreadStatus({
|
|
954
|
+
...params,
|
|
955
|
+
status: "active"
|
|
956
|
+
})
|
|
1032
957
|
},
|
|
1033
958
|
status: createComputedAccountStatusAdapter({
|
|
1034
|
-
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID
|
|
959
|
+
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID),
|
|
1035
960
|
buildChannelSummary: async ({ snapshot }) => {
|
|
1036
961
|
const { buildPassiveProbedChannelStatusSummary } = await loadExtensionSharedSdk();
|
|
1037
962
|
return buildPassiveProbedChannelStatusSummary(snapshot, snapshot.identity === "user" ? {
|
|
@@ -1076,37 +1001,20 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1076
1001
|
buildCapabilitiesDiagnostics: async ({ account, timeoutMs }) => {
|
|
1077
1002
|
const lines = [];
|
|
1078
1003
|
const details = {};
|
|
1079
|
-
const botToken = account.botToken?.trim();
|
|
1080
1004
|
const userToken = account.userToken?.trim();
|
|
1081
1005
|
const { fetchSlackScopes } = await loadSlackScopesModule();
|
|
1082
|
-
|
|
1083
|
-
|
|
1006
|
+
const tokenTypes = account.identity === "user" ? ["user"] : userToken ? ["bot", "user"] : ["bot"];
|
|
1007
|
+
for (const tokenType of tokenTypes) {
|
|
1008
|
+
const token = tokenType === "user" ? userToken : account.botToken?.trim();
|
|
1009
|
+
const result = token ? await fetchSlackScopes(token, timeoutMs) : {
|
|
1084
1010
|
ok: false,
|
|
1085
|
-
error:
|
|
1011
|
+
error: `Slack ${tokenType} token missing.`
|
|
1086
1012
|
};
|
|
1087
1013
|
lines.push(formatSlackScopeDiagnostic({
|
|
1088
|
-
tokenType
|
|
1089
|
-
result
|
|
1090
|
-
}));
|
|
1091
|
-
details.userScopes = userScopes;
|
|
1092
|
-
} else {
|
|
1093
|
-
const botScopes = botToken ? await fetchSlackScopes(botToken, timeoutMs) : {
|
|
1094
|
-
ok: false,
|
|
1095
|
-
error: "Slack bot token missing."
|
|
1096
|
-
};
|
|
1097
|
-
lines.push(formatSlackScopeDiagnostic({
|
|
1098
|
-
tokenType: "bot",
|
|
1099
|
-
result: botScopes
|
|
1100
|
-
}));
|
|
1101
|
-
details.botScopes = botScopes;
|
|
1102
|
-
}
|
|
1103
|
-
if (account.identity !== "user" && userToken) {
|
|
1104
|
-
const userScopes = await fetchSlackScopes(userToken, timeoutMs);
|
|
1105
|
-
lines.push(formatSlackScopeDiagnostic({
|
|
1106
|
-
tokenType: "user",
|
|
1107
|
-
result: userScopes
|
|
1014
|
+
tokenType,
|
|
1015
|
+
result
|
|
1108
1016
|
}));
|
|
1109
|
-
details
|
|
1017
|
+
details[`${tokenType}Scopes`] = result;
|
|
1110
1018
|
}
|
|
1111
1019
|
return {
|
|
1112
1020
|
lines,
|
|
@@ -1116,7 +1024,7 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1116
1024
|
resolveAccountSnapshot: ({ account }) => {
|
|
1117
1025
|
const mode = account.config.mode ?? "socket";
|
|
1118
1026
|
const identity = account.config.postAs ?? "bot";
|
|
1119
|
-
const configured = (mode === "http" ? resolveConfiguredFromRequiredCredentialStatuses(account, [identity === "user" ? "userTokenStatus" : "botTokenStatus",
|
|
1027
|
+
const configured = (mode === "http" || mode === "socket" ? resolveConfiguredFromRequiredCredentialStatuses(account, [identity === "user" ? "userTokenStatus" : "botTokenStatus", mode === "http" ? "signingSecretStatus" : "appTokenStatus"]) : void 0) ?? isSlackPluginAccountConfigured(account);
|
|
1120
1028
|
return {
|
|
1121
1029
|
accountId: account.accountId,
|
|
1122
1030
|
name: account.name,
|
|
@@ -1194,10 +1102,10 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1194
1102
|
matchesToolContextTarget: ({ target, toolContext }) => slackContextTargetsMatch(target, toolContext),
|
|
1195
1103
|
scopedAccountReplyToMode: {
|
|
1196
1104
|
resolveAccount: adaptScopedAccountAccessor(resolveSlackAccount),
|
|
1197
|
-
resolveReplyToMode:
|
|
1105
|
+
resolveReplyToMode: resolveSlackReplyToMode
|
|
1198
1106
|
},
|
|
1199
1107
|
allowExplicitReplyTagsWhenOff: false,
|
|
1200
|
-
buildToolContext:
|
|
1108
|
+
buildToolContext: buildSlackThreadingToolContext,
|
|
1201
1109
|
resolveAutoThreadId: ({ to, toolContext, replyToId }) => normalizeSlackThreadTsCandidate(replyToId) ? void 0 : normalizeSlackThreadTsCandidate(resolveSlackAutoThreadId({
|
|
1202
1110
|
to,
|
|
1203
1111
|
toolContext
|