@openclaw/slack 2026.10.1 → 2026.10.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/account-configured-zcR9TJJN.mjs +35 -0
- package/dist/.setup/{account-inspect-Cs-7DXXW.mjs → account-inspect-D58VVDjk.mjs} +15 -35
- package/dist/.setup/{accounts-CDgkV7Cm.mjs → accounts-BMg9YLIv.mjs} +44 -53
- package/dist/.setup/{action-runtime-DJ1daRAZ.mjs → action-runtime-BiRZNsIG.mjs} +20 -22
- package/dist/.setup/action-runtime.runtime-C5xceJoS.mjs +2 -0
- package/dist/.setup/{actions-DDoAJnrH.mjs → actions-KGKwTAKO.mjs} +34 -43
- package/dist/.setup/{approval-handler.runtime-BcE_shWc.mjs → approval-handler.runtime-DYrsG2Ox.mjs} +44 -70
- package/dist/.setup/{approval-message-updates-EgKGmFXx.mjs → approval-message-updates-CwdDew9i.mjs} +1 -1
- package/dist/.setup/{channel-DgKSu8Iv.mjs → channel-C7MY-Hhg.mjs} +138 -97
- package/dist/.setup/{channel-type-B9zYYzBU.mjs → channel-type-NjX2SwvS.mjs} +3 -3
- package/dist/.setup/{channel.setup-BYIlwbQ7.mjs → channel.setup-BFpQowO3.mjs} +7 -14
- package/dist/.setup/{directory-config-B_by7zrc.mjs → directory-config-BEDZPfDn.mjs} +1 -1
- package/dist/.setup/{directory-live-C48wazJt.mjs → directory-live-FipfeCwt.mjs} +33 -36
- package/dist/.setup/{message-tool-api-CcjLPN3v.mjs → message-tool-api-C7im5ETh.mjs} +2 -2
- package/dist/.setup/{monitor-BuYBDmm7.mjs → monitor-BnN2px0N.mjs} +609 -801
- package/dist/.setup/{outbound-adapter-BZFkK-mw.mjs → outbound-adapter-4HdGq-8r.mjs} +4 -4
- package/dist/.setup/{pipeline.runtime-CIepKmZt.mjs → pipeline.runtime-ByPbC6MN.mjs} +287 -365
- package/dist/.setup/{policy-KKTqEiDv.mjs → policy-BaY9_eh1.mjs} +2 -2
- package/dist/.setup/{probe-BVlJ3dp0.mjs → probe-CyX52GtD.mjs} +54 -61
- package/dist/.setup/{relay-source-CC3h6M7y.mjs → relay-source-CVfH-fBO.mjs} +28 -45
- package/dist/.setup/{replies-DHbuthIR.mjs → replies-WmfwvQxc.mjs} +38 -49
- package/dist/.setup/{reply-blocks-CKnO4BSG.mjs → reply-blocks-rqHQ_3pr.mjs} +87 -138
- package/dist/.setup/{resolve-channels-HR0TgArR.mjs → resolve-channels-B96cgprw.mjs} +17 -41
- package/dist/.setup/{resolve-users-BNYBhF0q.mjs → resolve-users-Xz9aPdns.mjs} +22 -58
- package/dist/.setup/{scopes-DrDbyUH2.mjs → scopes-aMcMHhXk.mjs} +1 -1
- package/dist/.setup/{send-CgPI3Zj8.mjs → send-CLmsR42r.mjs} +157 -284
- package/dist/.setup/{session-status-D46GHwOV.mjs → session-status-CcXe10zN.mjs} +181 -238
- package/dist/.setup/{setup-plugin-api-ZrHs0N4U.mjs → setup-plugin-api-D92P5p51.mjs} +1 -1
- package/dist/.setup/{setup-surface-83lxvE2y.mjs → setup-surface-368jx6Uc.mjs} +6 -6
- package/dist/.setup/{shared-VtmYNj-v.mjs → shared-CtprVh_G.mjs} +5 -5
- package/dist/.setup/{slash-dispatch.runtime-gBj_uaLM.mjs → slash-dispatch.runtime-Dzwj6TPI.mjs} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/api.js +12 -12
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +6 -13
- package/dist/directory-contract-api.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +10 -10
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts +1 -1
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts +79 -4
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/block-kit/composition-objects.d.ts +17 -0
- package/node_modules/@slack/types/dist/block-kit/composition-objects.d.ts.map +1 -1
- package/node_modules/@slack/types/package.json +1 -1
- package/node_modules/@slack/web-api/dist/methods.d.ts +49 -2
- package/node_modules/@slack/web-api/dist/methods.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/methods.js +47 -0
- package/node_modules/@slack/web-api/dist/methods.js.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/agents.d.ts +186 -0
- package/node_modules/@slack/web-api/dist/types/request/agents.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts +1 -1
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.d.ts +9 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.d.ts +10 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.d.ts +29 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.d.ts +18 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.d.ts +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.d.ts +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.d.ts +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.d.ts +10 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.d.ts +15 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/ConversationsInfoResponse.d.ts +31 -0
- package/node_modules/@slack/web-api/dist/types/response/ConversationsInfoResponse.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts +9 -0
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/README.md +15 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +1077 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1800 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1361 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +3964 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +652 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ffi.d.ts +500 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +1477 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +4803 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +2218 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +2498 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +116 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +265 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +726 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +1074 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/package.json +155 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +617 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +2269 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/quic.d.ts +2191 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +508 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sqlite.d.ts +1140 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/iter.d.ts +449 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +320 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +1806 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test/reporters.d.ts +60 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +2558 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +1232 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +467 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +118 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +226 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1677 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +1059 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +1137 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/streams.d.ts +119 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +672 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +606 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -17
- package/node_modules/@slack/web-api/package.json +2 -2
- package/openclaw.plugin.json +0 -3
- package/package.json +6 -14
- package/dist/.setup/account-configured-sUohAxZr.mjs +0 -33
- package/dist/.setup/action-runtime.runtime-CdWL2mLC.mjs +0 -2
- package/dist/control-ui/2f4b1e827be6b68ced2ea0d8b7da8529a4eafbe72be27ee37e1064bdd530ec10/index.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as buildSlackChannelPolicyScope, r as buildSlackChannelIdCandidates } from "./session-status-
|
|
2
|
-
import {
|
|
1
|
+
import { i as buildSlackChannelPolicyScope, r as buildSlackChannelIdCandidates } from "./session-status-CcXe10zN.mjs";
|
|
2
|
+
import { j as resolveSlackUserAllowListForTeam, k as normalizeSlackSlug } from "./probe-CyX52GtD.mjs";
|
|
3
3
|
import { applyChannelMatchMeta, buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
4
4
|
import { firstDefined } from "openclaw/plugin-sdk/allow-from";
|
|
5
5
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { p as formatSlackBotTokenIdentityWarning } from "./accounts-
|
|
2
|
+
import { p as formatSlackBotTokenIdentityWarning } from "./accounts-BMg9YLIv.mjs";
|
|
3
3
|
import { a as parseSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { isRecord, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -8,9 +8,10 @@ import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
8
8
|
import { normalizeHyphenSlug, normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
9
9
|
import { compileAllowlist, resolveCompiledAllowlistMatch } from "openclaw/plugin-sdk/allow-from";
|
|
10
10
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
11
|
+
import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
11
12
|
import { hash } from "node:crypto";
|
|
12
13
|
import { WebAPIRateLimitedError, WebClient } from "@slack/web-api";
|
|
13
|
-
import { addActiveManagedProxyTlsOptions, captureChannelReadAuthority, createHttp1EnvHttpProxyAgent, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
14
|
+
import { addActiveManagedProxyTlsOptions, captureChannelReadAuthority, captureEffectAuthority, createHttp1EnvHttpProxyAgent, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
14
15
|
import { isDebugProxyGlobalFetchPatchInstalled } from "openclaw/plugin-sdk/proxy-capture";
|
|
15
16
|
import { parseRetryAfterHeaderSeconds, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
16
17
|
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
@@ -130,7 +131,6 @@ function normalizeSlackFetchInit(init) {
|
|
|
130
131
|
const { body: _body, ...rest } = init;
|
|
131
132
|
return rest;
|
|
132
133
|
}
|
|
133
|
-
/** Build the dispatcher for Slack Web API fetches (paired with the runtime fetch). */
|
|
134
134
|
function resolveSlackProxyDispatcher() {
|
|
135
135
|
const options = resolveEnvHttpProxyAgentOptions();
|
|
136
136
|
if (!options) return;
|
|
@@ -219,38 +219,33 @@ function buildSlackFetch(dispatcher) {
|
|
|
219
219
|
});
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
-
function fenceSlackReadFetch(slackFetch) {
|
|
222
|
+
function fenceSlackReadFetch(slackFetch, assertDirectAdapterHandoff) {
|
|
223
223
|
const assertReadAuthority = captureChannelReadAuthority();
|
|
224
|
+
const capturedEffect = captureEffectAuthority();
|
|
224
225
|
return (input, init) => {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
return (capturedEffect.active ? capturedEffect : captureEffectAuthority()).initiate(() => {
|
|
227
|
+
assertReadAuthority?.();
|
|
228
|
+
captureChannelReadAuthority()?.();
|
|
229
|
+
assertDirectAdapterHandoff?.();
|
|
230
|
+
return slackFetch(input, init);
|
|
231
|
+
});
|
|
228
232
|
};
|
|
229
233
|
}
|
|
230
|
-
function
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
function applySlackApiUrlAndProxyOptions(options, dispatcher) {
|
|
234
|
-
const slackApiUrl = options.slackApiUrl ?? resolveSlackApiUrlFromEnv();
|
|
234
|
+
function resolveSlackClientOptions(input, dispatcher, assertDirectAdapterHandoff) {
|
|
235
|
+
const options = Object.assign({}, input);
|
|
236
|
+
const slackApiUrl = options.slackApiUrl ?? (process.env.SLACK_API_URL?.trim() || void 0);
|
|
235
237
|
const fetch = options.fetch ?? buildSlackFetch(dispatcher);
|
|
236
|
-
if (fetch) options.fetch =
|
|
238
|
+
if (fetch) options.fetch = fetch;
|
|
237
239
|
if (slackApiUrl !== void 0) options.slackApiUrl = slackApiUrl;
|
|
238
240
|
else delete options.slackApiUrl;
|
|
239
|
-
}
|
|
240
|
-
function applySlackRequestAuthority(options, dispatcher, assertDirectAdapterHandoff) {
|
|
241
|
-
if (!assertDirectAdapterHandoff) return;
|
|
242
241
|
const slackFetch = options.fetch ?? buildSlackFetch(dispatcher);
|
|
243
|
-
if (!slackFetch)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
};
|
|
242
|
+
if (!slackFetch) {
|
|
243
|
+
if (assertDirectAdapterHandoff) throw new Error("Slack request fetch is unavailable for live authority.");
|
|
244
|
+
} else options.fetch = fenceSlackReadFetch(slackFetch, assertDirectAdapterHandoff);
|
|
245
|
+
return options;
|
|
248
246
|
}
|
|
249
247
|
function resolveSlackWebClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
250
|
-
const resolved =
|
|
251
|
-
applySlackApiUrlAndProxyOptions(resolved, dispatcher);
|
|
252
|
-
resolved.fetch ??= buildSlackFetch(dispatcher);
|
|
253
|
-
applySlackRequestAuthority(resolved, dispatcher, assertDirectAdapterHandoff);
|
|
248
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
254
249
|
resolved.retryConfig ??= SLACK_DEFAULT_RETRY_OPTIONS;
|
|
255
250
|
return resolved;
|
|
256
251
|
}
|
|
@@ -260,9 +255,7 @@ function resolveSlackReadClientOptions(options = {}, dispatcher = resolveSlackPr
|
|
|
260
255
|
return resolved;
|
|
261
256
|
}
|
|
262
257
|
function resolveSlackWriteClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
263
|
-
const resolved =
|
|
264
|
-
applySlackApiUrlAndProxyOptions(resolved, dispatcher);
|
|
265
|
-
applySlackRequestAuthority(resolved, dispatcher, assertDirectAdapterHandoff);
|
|
258
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
266
259
|
resolved.retryConfig ??= SLACK_WRITE_RETRY_OPTIONS;
|
|
267
260
|
if (resolved.rejectRateLimitedCalls !== true && resolved.retryConfig.retries === 0) {
|
|
268
261
|
const slackFetch = resolved.fetch ?? buildSlackFetch(dispatcher);
|
|
@@ -288,9 +281,7 @@ function resolveSlackWriteClientOptions(options = {}, dispatcher = resolveSlackP
|
|
|
288
281
|
return resolved;
|
|
289
282
|
}
|
|
290
283
|
function resolveSlackLookupClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
291
|
-
const resolved =
|
|
292
|
-
applySlackApiUrlAndProxyOptions(resolved, dispatcher);
|
|
293
|
-
applySlackRequestAuthority(resolved, dispatcher, assertDirectAdapterHandoff);
|
|
284
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
294
285
|
resolved.rejectRateLimitedCalls = true;
|
|
295
286
|
resolved.retryConfig = SLACK_LOOKUP_RETRY_OPTIONS;
|
|
296
287
|
resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
|
|
@@ -312,6 +303,14 @@ function writeLruMapEntry(cache, cacheKey, entry, maxEntries) {
|
|
|
312
303
|
cache.set(cacheKey, entry);
|
|
313
304
|
pruneMapToMaxSize(cache, maxEntries);
|
|
314
305
|
}
|
|
306
|
+
function pruneExpiredMapEntries(cache, rawNow) {
|
|
307
|
+
const now = asDateTimestampMs(rawNow);
|
|
308
|
+
if (now === void 0) {
|
|
309
|
+
cache.clear();
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
for (const [key, entry] of cache) if (asDateTimestampMs(entry.expiresAt) === void 0 || entry.expiresAt <= now) cache.delete(key);
|
|
313
|
+
}
|
|
315
314
|
//#endregion
|
|
316
315
|
//#region extensions/slack/src/client.ts
|
|
317
316
|
const SLACK_WRITE_CLIENT_CACHE_MAX = 32;
|
|
@@ -319,9 +318,12 @@ const SLACK_STARTUP_AUTH_TIMEOUT_MS = 1e4;
|
|
|
319
318
|
const SLACK_STARTUP_AUTH_RETRY_BUDGET_MS = 35e3;
|
|
320
319
|
const slackWriteClientCache = /* @__PURE__ */ new Map();
|
|
321
320
|
const slackListenerWriteClientCache = /* @__PURE__ */ new WeakMap();
|
|
322
|
-
function
|
|
323
|
-
return new WebClient(token,
|
|
321
|
+
function createSlackClientFactory(resolveOptions) {
|
|
322
|
+
return (token, options, assertDirectAdapterHandoff) => new WebClient(token, resolveOptions(options, void 0, assertDirectAdapterHandoff));
|
|
324
323
|
}
|
|
324
|
+
const createSlackWebClient = createSlackClientFactory(resolveSlackWebClientOptions);
|
|
325
|
+
const createSlackLookupClient = createSlackClientFactory(resolveSlackLookupClientOptions);
|
|
326
|
+
const createSlackWriteClient = createSlackClientFactory(resolveSlackWriteClientOptions);
|
|
325
327
|
function createSlackReadClient(token, options = {}, dispatcher, assertDirectAdapterHandoff) {
|
|
326
328
|
return new WebClient(token, resolveSlackReadClientOptions(options, dispatcher, assertDirectAdapterHandoff));
|
|
327
329
|
}
|
|
@@ -353,12 +355,6 @@ function createSlackStartupAuthClient(token, options = {}) {
|
|
|
353
355
|
timeout: SLACK_STARTUP_AUTH_TIMEOUT_MS
|
|
354
356
|
});
|
|
355
357
|
}
|
|
356
|
-
function createSlackLookupClient(token, options = {}, assertDirectAdapterHandoff) {
|
|
357
|
-
return new WebClient(token, resolveSlackLookupClientOptions(options, void 0, assertDirectAdapterHandoff));
|
|
358
|
-
}
|
|
359
|
-
function createSlackWriteClient(token, options = {}, assertDirectAdapterHandoff) {
|
|
360
|
-
return new WebClient(token, resolveSlackWriteClientOptions(options, void 0, assertDirectAdapterHandoff));
|
|
361
|
-
}
|
|
362
358
|
function createSlackTokenCacheKey(token) {
|
|
363
359
|
return `sha256:${hash("sha256", token, "base64url")}`;
|
|
364
360
|
}
|
|
@@ -366,6 +362,7 @@ function slackWriteClientCacheKey(token, options) {
|
|
|
366
362
|
return `${createSlackTokenCacheKey(token)}${options.slackApiUrl ? `:api:${options.slackApiUrl}` : ""}${options.teamId ? `:team:${options.teamId.trim().toLowerCase()}` : ""}`;
|
|
367
363
|
}
|
|
368
364
|
function getSlackWriteClient(token, options = {}) {
|
|
365
|
+
if (captureEffectAuthority().active) return createSlackWriteClient(token, options);
|
|
369
366
|
const resolvedOptions = resolveSlackWriteClientOptions(options);
|
|
370
367
|
const tokenKey = slackWriteClientCacheKey(token, resolvedOptions);
|
|
371
368
|
const cached = readLruMapEntry(slackWriteClientCache, tokenKey);
|
|
@@ -379,8 +376,12 @@ function getSlackListenerWriteClient(params) {
|
|
|
379
376
|
const token = params.listenerClient.token?.trim();
|
|
380
377
|
const teamId = params.teamId?.trim().toUpperCase();
|
|
381
378
|
if (!token) return;
|
|
379
|
+
const effectScoped = captureEffectAuthority().active;
|
|
382
380
|
const cached = slackListenerWriteClientCache.get(params.listenerClient);
|
|
383
|
-
if (cached)
|
|
381
|
+
if (cached) {
|
|
382
|
+
if (cached.teamId !== teamId) return;
|
|
383
|
+
if (!effectScoped && cached.client) return cached.client;
|
|
384
|
+
}
|
|
384
385
|
const headers = Object.fromEntries(Object.entries(params.clientOptions?.headers ?? {}).filter(([name]) => name.toLowerCase() !== "authorization"));
|
|
385
386
|
const client = new WebClient(token, resolveSlackWriteClientOptions({
|
|
386
387
|
...params.clientOptions,
|
|
@@ -390,10 +391,11 @@ function getSlackListenerWriteClient(params) {
|
|
|
390
391
|
retryConfig: SLACK_WRITE_RETRY_OPTIONS,
|
|
391
392
|
timeout: 0
|
|
392
393
|
}));
|
|
393
|
-
slackListenerWriteClientCache.set(params.listenerClient, {
|
|
394
|
+
if (!effectScoped) slackListenerWriteClientCache.set(params.listenerClient, {
|
|
394
395
|
teamId,
|
|
395
396
|
client
|
|
396
397
|
});
|
|
398
|
+
else if (!cached) slackListenerWriteClientCache.set(params.listenerClient, { teamId });
|
|
397
399
|
return client;
|
|
398
400
|
}
|
|
399
401
|
//#endregion
|
|
@@ -650,42 +652,33 @@ async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
|
650
652
|
status: 200,
|
|
651
653
|
error: result.error ?? "unknown"
|
|
652
654
|
};
|
|
653
|
-
|
|
655
|
+
const userIdentity = opts?.identity === "user";
|
|
656
|
+
let userId = result.user_id;
|
|
657
|
+
if (userIdentity) {
|
|
654
658
|
if (result.bot_id?.trim()) return {
|
|
655
659
|
ok: false,
|
|
656
660
|
status: 200,
|
|
657
661
|
error: "Slack auth.test identified a bot token; user identity requires a user OAuth token"
|
|
658
662
|
};
|
|
659
|
-
|
|
663
|
+
userId = result.user_id?.trim();
|
|
660
664
|
if (!userId) return {
|
|
661
665
|
ok: false,
|
|
662
666
|
status: 200,
|
|
663
667
|
error: "Slack auth.test returned no human user_id for user identity"
|
|
664
668
|
};
|
|
665
|
-
return {
|
|
666
|
-
ok: true,
|
|
667
|
-
status: 200,
|
|
668
|
-
user: {
|
|
669
|
-
id: userId,
|
|
670
|
-
name: result.user
|
|
671
|
-
},
|
|
672
|
-
team: {
|
|
673
|
-
id: result.team_id,
|
|
674
|
-
name: result.team
|
|
675
|
-
}
|
|
676
|
-
};
|
|
677
669
|
}
|
|
678
|
-
const warning = formatSlackBotTokenIdentityWarning({
|
|
670
|
+
const warning = userIdentity ? void 0 : formatSlackBotTokenIdentityWarning({
|
|
679
671
|
auth: result,
|
|
680
672
|
accountId: opts?.accountId
|
|
681
673
|
});
|
|
674
|
+
const authIdentity = {
|
|
675
|
+
id: userId,
|
|
676
|
+
name: result.user
|
|
677
|
+
};
|
|
682
678
|
return {
|
|
683
679
|
ok: true,
|
|
684
680
|
status: 200,
|
|
685
|
-
bot:
|
|
686
|
-
id: result.user_id,
|
|
687
|
-
name: result.user
|
|
688
|
-
},
|
|
681
|
+
...userIdentity ? { user: authIdentity } : { bot: authIdentity },
|
|
689
682
|
team: {
|
|
690
683
|
id: result.team_id,
|
|
691
684
|
name: result.team
|
|
@@ -704,4 +697,4 @@ async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
|
704
697
|
}
|
|
705
698
|
}
|
|
706
699
|
//#endregion
|
|
707
|
-
export {
|
|
700
|
+
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as formatSlackError } from "./probe-
|
|
2
|
-
import { d as parseSlackMessageEvent, f as requireSlackMessageEvent, x as SLACK_SOCKET_RECONNECT_POLICY } from "./monitor-
|
|
1
|
+
import { o as formatSlackError } from "./probe-CyX52GtD.mjs";
|
|
2
|
+
import { d as parseSlackMessageEvent, f as requireSlackMessageEvent, x as SLACK_SOCKET_RECONNECT_POLICY } from "./monitor-BnN2px0N.mjs";
|
|
3
3
|
import { asOptionalRecord, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { computeBackoff, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { createNodeProxyAgent } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -108,13 +108,31 @@ function runRelayWebSocket(params) {
|
|
|
108
108
|
pending.then(() => reject(error), reject);
|
|
109
109
|
};
|
|
110
110
|
const onMessage = (data) => {
|
|
111
|
-
pending = pending.then(() =>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
pending = pending.then(async () => {
|
|
112
|
+
const frame = asOptionalRecord(parseRelayFrame(data));
|
|
113
|
+
if (frame?.type === "hello") {
|
|
114
|
+
const identity = extractRelayIdentity(frame);
|
|
115
|
+
params.setIdentity?.(identity);
|
|
116
|
+
params.setStatus?.({ relayIdentity: identity ?? null });
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const event = extractRelaySlackMessageEvent(frame);
|
|
120
|
+
if (!event) return;
|
|
121
|
+
const now = Date.now();
|
|
122
|
+
params.setStatus?.({
|
|
123
|
+
lastEventAt: now,
|
|
124
|
+
lastInboundAt: now
|
|
125
|
+
});
|
|
126
|
+
params.setStatus?.({ relayRoute: event.route });
|
|
127
|
+
await params.acceptRelayEvent({
|
|
128
|
+
deliveryId: event.deliveryId,
|
|
129
|
+
message: event.message
|
|
130
|
+
});
|
|
131
|
+
if (ws.readyState === WebSocket.OPEN) ws.send(JSON.stringify({
|
|
132
|
+
type: "ack",
|
|
133
|
+
delivery_id: event.deliveryId
|
|
134
|
+
}));
|
|
135
|
+
}).catch((err) => {
|
|
118
136
|
params.runtime.error?.(`slack relay frame failed: ${formatSlackError(err)}`);
|
|
119
137
|
});
|
|
120
138
|
};
|
|
@@ -145,28 +163,6 @@ function runRelayWebSocket(params) {
|
|
|
145
163
|
ws.resume();
|
|
146
164
|
});
|
|
147
165
|
}
|
|
148
|
-
async function handleRelayFrame(params) {
|
|
149
|
-
const frame = parseRelayFrame(params.data);
|
|
150
|
-
const hello = extractRelayHello(frame);
|
|
151
|
-
if (hello) {
|
|
152
|
-
params.setIdentity?.(hello.identity);
|
|
153
|
-
params.setStatus?.({ relayIdentity: hello.identity ?? null });
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const event = extractRelaySlackMessageEvent(frame);
|
|
157
|
-
if (!event) return;
|
|
158
|
-
const now = Date.now();
|
|
159
|
-
params.setStatus?.({
|
|
160
|
-
lastEventAt: now,
|
|
161
|
-
lastInboundAt: now
|
|
162
|
-
});
|
|
163
|
-
params.setStatus?.({ relayRoute: event.route });
|
|
164
|
-
await params.acceptRelayEvent({
|
|
165
|
-
deliveryId: event.deliveryId,
|
|
166
|
-
message: event.message
|
|
167
|
-
});
|
|
168
|
-
sendRelayAck(params.ws, event.deliveryId);
|
|
169
|
-
}
|
|
170
166
|
function buildRelayWebSocketOptions(authToken, url) {
|
|
171
167
|
const agent = url.startsWith("wss:") ? createNodeProxyAgent({
|
|
172
168
|
mode: "env",
|
|
@@ -211,8 +207,7 @@ function parseRelayFrame(data) {
|
|
|
211
207
|
throw new SlackRelayMalformedFrameError("Slack relay received malformed JSON frame", { cause });
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
|
-
function extractRelaySlackMessageEvent(
|
|
215
|
-
const record = asOptionalRecord(frame);
|
|
210
|
+
function extractRelaySlackMessageEvent(record) {
|
|
216
211
|
if (!record || record.type !== "slack_event") return;
|
|
217
212
|
const deliveryId = readStringValue(record.delivery_id);
|
|
218
213
|
const routeRecord = asOptionalRecord(record.route);
|
|
@@ -231,11 +226,6 @@ function extractRelaySlackMessageEvent(frame) {
|
|
|
231
226
|
}
|
|
232
227
|
};
|
|
233
228
|
}
|
|
234
|
-
function extractRelayHello(frame) {
|
|
235
|
-
const record = asOptionalRecord(frame);
|
|
236
|
-
if (!record || record.type !== "hello") return;
|
|
237
|
-
return { identity: extractRelayIdentity(record) };
|
|
238
|
-
}
|
|
239
229
|
function extractRelayIdentity(record) {
|
|
240
230
|
const identityRecord = asOptionalRecord(record.slack_identity) ?? asOptionalRecord(record.slackIdentity);
|
|
241
231
|
if (!identityRecord) return;
|
|
@@ -249,13 +239,6 @@ function extractRelayIdentity(record) {
|
|
|
249
239
|
...iconEmoji ? { iconEmoji } : {}
|
|
250
240
|
};
|
|
251
241
|
}
|
|
252
|
-
function sendRelayAck(ws, deliveryId) {
|
|
253
|
-
if (ws.readyState !== WebSocket.OPEN) return;
|
|
254
|
-
ws.send(JSON.stringify({
|
|
255
|
-
type: "ack",
|
|
256
|
-
delivery_id: deliveryId
|
|
257
|
-
}));
|
|
258
|
-
}
|
|
259
242
|
function closeRelayWebSocket(ws) {
|
|
260
243
|
if (!ws || ws.readyState === WebSocket.CLOSED || ws.readyState === WebSocket.CLOSING) return;
|
|
261
244
|
ws.close();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as iterateSlackReplyDeliveryMessages, o as resolveSlackReplyBlockResolution, t as hasSlackReplyStructuredContent } from "./reply-blocks-
|
|
1
|
+
import { A as SLACK_TEXT_LIMIT, Y as markdownToSlackMrkdwnChunks, b as isSlackInvalidBlocksResponse, v as hasSlackNativeDataBlock, x as isSlackNativeResponseUrlRejection } from "./session-status-CcXe10zN.mjs";
|
|
2
|
+
import { n as iterateSlackReplyDeliveryMessages, o as resolveSlackReplyBlockResolution, t as hasSlackReplyStructuredContent } from "./reply-blocks-rqHQ_3pr.mjs";
|
|
3
3
|
import { n as resolveSlackReplyThreadTs } from "./thread-ts-Cvt7WD6B.mjs";
|
|
4
|
-
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-
|
|
5
|
-
import { a as SlackResponseAlreadyReportedError, o as createSlackResponseUrlBudget } from "./monitor-
|
|
4
|
+
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-CLmsR42r.mjs";
|
|
5
|
+
import { a as SlackResponseAlreadyReportedError, o as createSlackResponseUrlBudget } from "./monitor-BnN2px0N.mjs";
|
|
6
6
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
7
7
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
8
8
|
import { deliverTextOrMediaReply, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -55,27 +55,22 @@ function compactSlackResponseUrlFallback(messages) {
|
|
|
55
55
|
compacted.push(message);
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
if (pending?.blocks?.length) {
|
|
59
|
+
const text = `${pending.text}\n\n${message.text}`;
|
|
60
|
+
const blocks = [...pending.blocks, ...message.blocks];
|
|
61
|
+
if (text.length <= 4e4 && blocks.length <= 50) {
|
|
62
|
+
pending = {
|
|
63
|
+
text,
|
|
64
|
+
blocks,
|
|
65
|
+
mrkdwn: false
|
|
66
|
+
};
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
68
69
|
flush();
|
|
69
|
-
pending = {
|
|
70
|
-
...message,
|
|
71
|
-
blocks: [...message.blocks]
|
|
72
|
-
};
|
|
73
|
-
continue;
|
|
74
70
|
}
|
|
75
71
|
pending = {
|
|
76
|
-
|
|
77
|
-
blocks
|
|
78
|
-
mrkdwn: false
|
|
72
|
+
...message,
|
|
73
|
+
blocks: [...message.blocks]
|
|
79
74
|
};
|
|
80
75
|
}
|
|
81
76
|
flush();
|
|
@@ -268,36 +263,30 @@ async function deliverSlackSlashReplies(params) {
|
|
|
268
263
|
const textRaw = reply.hasText && !isSilentReplyText(reply.trimmedText, SILENT_REPLY_TOKEN) ? reply.trimmedText : void 0;
|
|
269
264
|
const materializeAuthoredText = hasSlackReplyStructuredContent(payload);
|
|
270
265
|
const { authoredTextPlacement, segments } = resolveSlackReplyBlockResolution(payload, { materializeAuthoredText });
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
266
|
+
if (segments.length > 0) {
|
|
267
|
+
const messages = [];
|
|
268
|
+
const hookParts = [];
|
|
269
|
+
for (const message of iterateSlackReplyDeliveryMessages({
|
|
270
|
+
authoredTextPlacement,
|
|
271
|
+
segments,
|
|
272
|
+
text: textRaw
|
|
273
|
+
})) {
|
|
274
|
+
hookParts.push(message.text);
|
|
275
|
+
if (!message.blocks) {
|
|
276
|
+
messages.push(...chunkSlackTextAtHardLimit(message.text).map((text) => ({ message: {
|
|
277
|
+
text,
|
|
282
278
|
mrkdwn: false
|
|
283
279
|
} })));
|
|
280
|
+
continue;
|
|
284
281
|
}
|
|
285
|
-
|
|
282
|
+
const blockPlan = createBlockMessagePlan({
|
|
283
|
+
blocks: message.blocks,
|
|
284
|
+
baseText: message.nativeDataFallbackBaseText ?? ""
|
|
285
|
+
});
|
|
286
|
+
messages.push(hasSlackNativeDataBlock(message.blocks) || blockPlan.skipOriginalBlocks ? blockPlan : { message: blockPlan.message });
|
|
286
287
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const accessibilityText = buildSlackNativeDataAccessibilityText(baseText, segment.blocks) || buildSlackBlocksFallbackText(segment.blocks);
|
|
290
|
-
hookParts.push(accessibilityText);
|
|
291
|
-
const blockPlan = createBlockMessagePlan({
|
|
292
|
-
blocks: segment.blocks,
|
|
293
|
-
baseText
|
|
294
|
-
});
|
|
295
|
-
messages.push(hasSlackNativeDataBlock(segment.blocks) || blockPlan.skipOriginalBlocks ? blockPlan : { message: blockPlan.message });
|
|
296
|
-
}
|
|
297
|
-
if (outsideText) hookParts.push(outsideText);
|
|
298
|
-
if (reply.mediaUrls.length > 0) hookParts.push(...reply.mediaUrls);
|
|
299
|
-
if (segments.length > 0) {
|
|
300
|
-
const trailingText = [outsideText, ...reply.mediaUrls].filter(Boolean).join("\n");
|
|
288
|
+
hookParts.push(...reply.mediaUrls);
|
|
289
|
+
const trailingText = reply.mediaUrls.filter(Boolean).join("\n");
|
|
301
290
|
if (trailingText) messages.push(...chunkSlackTextAtHardLimit(trailingText).map((text) => ({ message: {
|
|
302
291
|
text,
|
|
303
292
|
mrkdwn: false
|
|
@@ -371,7 +360,7 @@ async function deliverSlackSlashReplies(params) {
|
|
|
371
360
|
throw failure;
|
|
372
361
|
};
|
|
373
362
|
const initialRemaining = responseBudget.remaining();
|
|
374
|
-
const initialMinimumCalls =
|
|
363
|
+
const initialMinimumCalls = minimumRemainingCalls[0] ?? 0;
|
|
375
364
|
if (initialRemaining !== void 0 && initialMinimumCalls > initialRemaining) await failOversizedDelivery();
|
|
376
365
|
const deliverNativeFallback = async (messages, onVisible) => {
|
|
377
366
|
for (const message of messages) {
|